POV-Ray : Newsgroups : povray.advanced-users : Isosurface speed Server Time
31 Oct 2024 23:30:01 EDT (-0400)
  Isosurface speed (Message 1 to 3 of 3)  
From: Andrew C on Mozilla
Subject: Isosurface speed
Date: 22 Jul 2004 16:30:23
Message: <410023df$1@news.povray.org>
Which is faster (in an isosurface)?

pow(x, 2) or x*x?

(Ditto for x^3.)

Andrew @ home.


Post a reply to this message

From: Thorsten Froehlich
Subject: Re: Isosurface speed
Date: 22 Jul 2004 17:33:30
Message: <410032aa@news.povray.org>
In article <410023df$1@news.povray.org> , Andrew C on Mozilla 
<voi### [at] devnull>  wrote:

> Which is faster (in an isosurface)?
>
> pow(x, 2) or x*x?
>
> (Ditto for x^3.)

The speed will be identical for all of these.  Further, note that all
constant integer powers up to eight will be optimised such to take as few
multiplications as possible, i.e. a power of four only takes two
multiplications instead of four, and a power of eight only takes three
multiplications.

    Thorsten

____________________________________________________
Thorsten Froehlich, Duisburg, Germany
e-mail: tho### [at] trfde

Visit POV-Ray on the web: http://mac.povray.org


Post a reply to this message

From: Andrew C on Mozilla
Subject: Re: Isosurface speed
Date: 24 Jul 2004 03:55:39
Message: <410215fb$1@news.povray.org>
>>Which is faster (in an isosurface)?
>>
>>pow(x, 2) or x*x?
>>
>>(Ditto for x^3.)
> 
> 
> The speed will be identical for all of these.  Further, note that all
> constant integer powers up to eight will be optimised such to take as few
> multiplications as possible, i.e. a power of four only takes two
> multiplications instead of four, and a power of eight only takes three
> multiplications.

Excellent.

POV-Ray Rocks!(tm)


Post a reply to this message

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