accuracy of intrinsic SUM function

N.M. Maclaren nmm1@cam.ac.uk
Tue Aug 28 08:45:00 GMT 2012


On Aug 27 2012, Schorsch MCMLX wrote:
>
>The naive summation code leads to a random-walk like error pattern if 
>the error is plotted as a function of the number of elements N. Thus, 
>it is impossible to judge on the quality of the naive recurrent code 
>by only looking a single N, as can be seen from the figure attached.

Well, yes, but that applies to all forms of summation.

>Another common problem when comparing these algorithms is the poor 
>quality of ND PRNs in case Box-Muller's algo is used in order to 
>convert UD PRNs into ND ones. Then, at least 4 trailing bits of the ND
>PRNs will be zero due to intermediate squaring... and thus nearly 
>totally supress the error pattern of the naive summation algo.

Box-Muller has been known to be a disaster since the early 1970s,
and should NEVER be used.  The Polar (rejection)  method is both
faster and numerically much better.  I don't see that's relevant.

You will also get very different accuracy graphs with different
distributions and patterns of serial association.

Regards,
Nick Maclaren.



More information about the Fortran mailing list