POV-Ray : Newsgroups : povray.programming : what is quicker ? : Re: what is quicker ? Server Time
5 May 2024 14:41:00 EDT (-0400)
  Re: what is quicker ?  
From: Christian Froeschlin
Date: 14 Oct 2007 15:48:20
Message: <47127284$1@news.povray.org>
> 2/ compute a global product, so that's about N multiplications,
> followed by N divisions if the product is not null, or followed by N
> simple 1 or 0 choice based on d[i] being null or not.

If product is 0 and d[i] is 0 you still need to compute z[i]
using option 1/? But otherwise, if N is large, you will be
much better off doing N divisions than N*(N-1) multiplications.
The capabilities of the processor only determine the value
of N where option 2/ becomes faster than option 1/.

> Extra bonus question: to enhance scalability and precisions with
> large N, shouldn't d[] be scaled beforehand so that max value of d[]
> become limited to 1

That would be a sensible course of action if the
actual numbers can be very large or very small.


Post a reply to this message

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