POV-Ray : Newsgroups : povray.unofficial.patches : radiosity samples: 255x255x255 probably isn't enough : Re: pow()??? (Re: radiosity samples: 255x255x255 probably isn't enough) Server Time
4 Jul 2024 22:22:02 EDT (-0400)
  Re: pow()??? (Re: radiosity samples: 255x255x255 probably isn't enough)  
From: Anders K 
Date: 8 Jan 2003 12:14:30
Message: <3e1c5c76$1@news.povray.org>
Apache wrote:
> Maybe you're right. I don't know. But I know that x*x is faster than
> src_vec->x*src_vec->x.

A reasonably smart compiler will optimize "src_vec->x * src_vec->x" to "x =
src_vec->x; x * x", but I doubt it would change "pow(x, 2)" to "x * x".

> Haven't thought about it really. I have this blurry
> and faint feeling that the power function is incorporated in most cpus. If
> not, please tell me.

Even if pow is included on the CPU, multiplication is much faster (AFAIK).

Anders

--
#macro E(D)(#if(D<2)D#else#declare I=I+1;mod(pow(.5mod(I 6))*asc(substr(
"X0(1X([\\&Q@TV'YDGU`3F(-V[6Y4aL4XFUTD#N#F8\\A+F1BFO4`#bJN61EM8PFSbFA?C"
I/6 1))2)<1#end)#end#macro R(D,I,T,X,Y)#if(E(D))R(D-1I,T,Y/2X)R(D-1I,T+Y
/2Y/2X)#else box{T T+X+Y pigment{rgb E(2)*9}}#end#end R(10,5z*3-1v*2u*2)


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.