|
|
Alain wrote:
>> nice iso
>> here the formular:
>> 2*(x*x*pow((3-4*x*x),2)+y*y*pow((3-4*y*y),2)+z*z*pow((3-4*z*z),2))-3
>> contained_by{box{-1.2,1.2}}
>> threshold -.2
>>
>> rendered with cm-pov
>>
>> H.Karsten
>>
>>
>> ----------------------------------------------------------------------
--
>>
> Nice little box.
>
> I remenber a tread where it was said that "pow(x,2)" is faster than
> "x*x". It may only be due to the fact that the variable is evaluated
> only once, but it seems to be faster.
>
> So, if you rewrite:
> 2*(x*x*pow((3-4*x*x),2)+y*y*pow((3-4*y*y),2)+z*z*pow((3-4*z*z),2))-3
>
> As:
> 2*(pow(x,2)*pow((3-4*pow(x,2),2)+pow(y,2)*pow((3-4*pow(y,2),2)+pow(z,2)
*pow((3-4*pow(z,2),2)-3
>
>
> You should get a performance improvement.
>
Plus, you can factor it some more and save three calls to pow:
2*(pow(x*(3-4*pow(x,2)),2)+pow(y*(3-4*pow(y,2)),2)+pow(z*(3-4*pow(z,2)),2
))-3
Jerome
--
mailto:jeb### [at] freefr
http://jeberger.free.fr
Jabber: jeb### [at] jabberfr
Post a reply to this message
Attachments:
Download 'us-ascii' (1 KB)
|
|