Function Proposal: std.algorithm.iteration : cumulativeSum

e-y-e via Digitalmars-d digitalmars-d at puremagic.com
Tue Nov 1 15:41:04 PDT 2016


On Tuesday, 1 November 2016 at 22:22:17 UTC, Ivan Kazmenko wrote:
> On Tuesday, 1 November 2016 at 22:13:29 UTC, e-y-e wrote:
>> ...
>
> Ouch, and I completely misread the TL;DR paragraph, sorry for 
> the noise!

My fault, note to self: always re-read everything.

>
> It's logical to have cumulativeSum specialized from 
> cumulativeFold when sum is a specialization of fold.
>
> I have yet to write a program which relies on Kahan summation, 
> but I can imagine that being useful.

To be entirely honest, I haven't experienced any _problems_ with 
the accuracy of naive summation. But Kahan summation does improve 
accuracy in some cases and I want that assurance.

It does have its own inaccuracies though and I think (may be 
wrong, again, its late) a flag like -ffastmath would probably 
eliminate any accuracy gain.




More information about the Digitalmars-d mailing list