simon-git: spigot (master): Simon Tatham

Commits to Tartarus hosted VCS tartarus-commits at lists.tartarus.org
Sat Sep 2 14:53:03 BST 2017


TL;DR:
  b2b1994 Add a missing const on a member function.
  1949557 Fix ordering errors in zeta.cpp's IntInterval class.
  44e9508 Add some interval-endpoint ordering assertions.
  dae9b4b Add an extra diagnostic in zeta.cpp.
  d311e5e Add test cases for zeta(-2.1) and zeta(-2.001).

Repository:     https://git.tartarus.org/simon/spigot.git
On the web:     https://git.tartarus.org/?p=simon/spigot.git
Branch updated: master
Committer:      Simon Tatham <anakin at pobox.com>
Date:           2017-09-02 14:53:03

commit b2b1994b7a0f1bba8d1ef4b603249f943f4990fc
web diff https://git.tartarus.org/?p=simon/spigot.git;a=commitdiff;h=b2b1994b7a0f1bba8d1ef4b603249f943f4990fc;hp=fdb4d9d333583d8b305e7186fd32203151bd8bee
Author: Simon Tatham <anakin at pobox.com>
Date:   Sat Sep 2 14:39:36 2017 +0100

    Add a missing const on a member function.
    
    zeta.cpp's IntInterval::max_magnitude() can perfectly well be
    called on a const instance of the class.

 zeta.cpp | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

commit 1949557699982a424c4c9bff066714b87c420cba
web diff https://git.tartarus.org/?p=simon/spigot.git;a=commitdiff;h=1949557699982a424c4c9bff066714b87c420cba;hp=b2b1994b7a0f1bba8d1ef4b603249f943f4990fc
Author: Simon Tatham <anakin at pobox.com>
Date:   Sat Sep 2 14:39:56 2017 +0100

    Fix ordering errors in zeta.cpp's IntInterval class.
    
    Multiplication and division can reorder the interval endpoints if you
    multiply or divide by a negative number, so each one should be
    followed up by checking the order and swapping the endpoints if
    necessary. This was leading to an assertion failure in computing zeta
    of numbers like -2.1 or -2.001.
    
    While looking for that bug, I spotted an even worse one (but
    fortunately it doesn't seem to have actually caused any trouble yet):
    the subtraction function was actually yielding _wrong_ interval
    bounds, because it was computing the output interval bounds as
    a.lo-b.lo and a.hi-b.hi, whereas actually all you can say about the
    result of a subtraction is that it's between a.lo-b.hi and a.hi-b.lo.
    Fixed that too, while I was here.

 zeta.cpp | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

commit 44e95088f7a8253469ea9639b5943f411b469ba9
web diff https://git.tartarus.org/?p=simon/spigot.git;a=commitdiff;h=44e95088f7a8253469ea9639b5943f411b469ba9;hp=1949557699982a424c4c9bff066714b87c420cba
Author: Simon Tatham <anakin at pobox.com>
Date:   Sat Sep 2 14:44:05 2017 +0100

    Add some interval-endpoint ordering assertions.
    
    Mostly within IntInterval itself, to catch any further problems
    like the ones in the last commit as close as possible to the
    source. But also I've added an assert in BinaryIntervalSource to
    enforce that _any_ subclass of it is generating sensibly ordered
    interval endpoints.

 spigot.cpp | 1 +
 zeta.cpp   | 4 ++++
 2 files changed, 5 insertions(+)

commit dae9b4bfde6fa6cfeb3d6619450ab997b262bf51
web diff https://git.tartarus.org/?p=simon/spigot.git;a=commitdiff;h=dae9b4bfde6fa6cfeb3d6619450ab997b262bf51;hp=44e95088f7a8253469ea9639b5943f411b469ba9
Author: Simon Tatham <anakin at pobox.com>
Date:   Sat Sep 2 14:44:10 2017 +0100

    Add an extra diagnostic in zeta.cpp.
    
    I added this in the course of tracking down the zeta(-2.1) bug, and
    having done it, it seems a shame to throw it away again.

 zeta.cpp | 1 +
 1 file changed, 1 insertion(+)

commit d311e5ebd589d0ebbfa1d2d09e78a7edfb8d7b4d
web diff https://git.tartarus.org/?p=simon/spigot.git;a=commitdiff;h=d311e5ebd589d0ebbfa1d2d09e78a7edfb8d7b4d;hp=dae9b4bfde6fa6cfeb3d6619450ab997b262bf51
Author: Simon Tatham <anakin at pobox.com>
Date:   Sat Sep 2 14:46:50 2017 +0100

    Add test cases for zeta(-2.1) and zeta(-2.001).
    
    Verified by generating the expected answers using the reflection
    formula. This should yield the same as simply 'zeta(-2.1)':
    
      spigot -d70 'let Zeta(z) = zeta(1-z) * (2pi)^z / (2*gamma(z) * cos(z pi/2))
                   in Zeta(-2.1)'

 test.sh | 2 ++
 1 file changed, 2 insertions(+)



More information about the tartarus-commits mailing list