|
|
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
|
|