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