digitalmars.D - Third attempt for SUM
- Ilya Yaroshenko (9/9) Nov 12 2016 Hi all,
- safety0ff (7/10) Nov 13 2016 Hi,
- Ilya Yaroshenko (6/18) Nov 13 2016 Yes, KBN should be used instead Kahan when possible (for example
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
Nov 12 2016
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.
Nov 13 2016
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: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.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.
Nov 13 2016
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.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.
Nov 13 2016
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.
Nov 14 2016