Thread overview | |||||||
---|---|---|---|---|---|---|---|
|
November 12, 2016 Third attempt for SUM | ||||
---|---|---|---|---|
| ||||
Hi all, Advanced summation algorithms [3] from Mir project [1] are ready to be merged to Phobos. Many thanks to Walter Bright for the new Dlang floating point semantic [2]. Best regards, Ilya 1. https://github.com/libmir/mir 2. https://github.com/dlang/dmd/pull/6247 3. https://github.com/dlang/phobos/pull/4896 |
November 13, 2016 Re: Third attempt for SUM | ||||
---|---|---|---|---|
| ||||
Posted in reply to Ilya Yaroshenko | On Saturday, 12 November 2016 at 15:37:29 UTC, Ilya Yaroshenko wrote:
> Hi all,
>
> Advanced summation algorithms [3] from Mir project [1] are ready to be merged to Phobos.
Hi,
Do you have any thoughts at to when Kahan should be used over KBN?
I was testing summation for a program (summing logarithms of primes as doubles,) and KBN seemed to be slightly outperforming Kahan.
|
November 13, 2016 Re: Third attempt for SUM | ||||
---|---|---|---|---|
| ||||
Posted in reply to safety0ff | On Sunday, 13 November 2016 at 16:04:51 UTC, safety0ff wrote: > On Saturday, 12 November 2016 at 15:37:29 UTC, Ilya Yaroshenko wrote: >> Hi all, >> >> Advanced summation algorithms [3] from Mir project [1] are ready to be merged to Phobos. > > Hi, > Do you have any thoughts at to when Kahan should be used over KBN? > > I was testing summation for a program (summing logarithms of primes as doubles,) and KBN seemed to be slightly outperforming Kahan. Yes, KBN should be used instead Kahan when possible (for example Quaternions can not be summed using default KBN implementation). BTW, i have implemented sumOfLogs [1], it is more precise then everything else. [1] http://dlang.org/phobos/std_numeric.html#.sumOfLog2s |
November 14, 2016 Re: Third attempt for SUM | ||||
---|---|---|---|---|
| ||||
Posted in reply to Ilya Yaroshenko | On Sunday, 13 November 2016 at 16:56:30 UTC, Ilya Yaroshenko wrote:
>
> Yes, KBN should be used instead Kahan when possible (for example Quaternions can not be summed using default KBN implementation).
>
> BTW, i have implemented sumOfLogs [1], it is more precise then everything else.
>
> [1] http://dlang.org/phobos/std_numeric.html#.sumOfLog2s
Can you re-order the examples or something so that the first one is an example of how it would be used most commonly? The last one looks like it should be first, and then maybe only with additional explanation (that these are some rarer cases) should the others be there.
|
November 14, 2016 Re: Third attempt for SUM | ||||
---|---|---|---|---|
| ||||
Posted in reply to Ilya Yaroshenko | On Sunday, 13 November 2016 at 16:56:30 UTC, Ilya Yaroshenko wrote:
>
> BTW, i have implemented sumOfLogs [1], it is more precise then everything else.
Thanks, I was going to use 32.64 fixed point for my program but now I think I will get better precision modifying that to use a 32 bit exponent field with a 1.64 fixed point field (to represent [1,2) normalized number.)
The [0.5,1) normalization due to frexp was confusing at first glance.
|
Copyright © 1999-2021 by the D Language Foundation