Mister Math is wanted!

Ilya Yaroshenko via Digitalmars-d-announce digitalmars-d-announce at puremagic.com
Fri Feb 27 01:27:48 PST 2015


> Unfortunate overlap in functionality is unfortunate.
>
> $ git grep -i kahan
> std/algorithm/iteration.d:$(D sum) uses the $(WEB 
> en.wikipedia.org/wiki/Kahan_summation,
> std/algorithm/iteration.d:Kahan summation) algorithm.)
> std/algorithm/iteration.d:            return sumKahan!E(seed, 
> r);
> std/algorithm/iteration.d:// Kahan algo 
> http://en.wikipedia.org/wiki/Kahan_summation_algorithm
> std/algorithm/iteration.d:private auto sumKahan(Result, 
> R)(Result result, R r)
> $ _
>
>
> Andrei

Would one of the following solutions be fortunate ?

I. Use alias of fsum!(Summation. Appropriate) for floating 
version of std.algorithm.sum.

     Appropriate algorithm performs D Pairwise summation for 
random access ranges.
     Otherwise performs D KBN summation of floating point and 
complex numbers and
     Kahan summation of user defined types.

or

II. Move this submodule to std.algorithm.iteration.

or

III. Remove Kahan (including KBN and KB2) and Pairwise algorithms 
from fsum, and use only Precise algorithm for std.numeric.



More information about the Digitalmars-d-announce mailing list