HP Forums

Full Version: WP34s: inconsistent behavior for Zeta near zero
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
In the General Forum there is a discussion about the Riemann Zeta function and its implementation on various HP calculators. For this purpose the high accuracy 34s served me very well for reliable reference values. But now I realized that arguments very close to zero may be off. The following examples refer to 34s version 3.3 3840 with printer support.

Note: for x close to zero Zeta(x) is approximately –0,5–x. So Zeta(1E-10) is ~ –0,5000000001 and Zeta(1E-20) rounds to –0,5 in SP mode. So far so good.

But then:

Zeta(3 E-30) yields –0,5 (correct)
Zeta(3,3333 E-30) returns –0,5 (correct)
Zeta(3,33333 E-30) returns –0,5000045000450005 (completely off)
Zeta(–3,33333 E-30) returns –0,5000495049504950 (completely off)
Zeta(3,14159 E-30) returns –0,4999984084542908 (completely off)
Zeta(1E-40) throws a –∞ error

One reason for me posting this is ...I came across the same problem when I tried to calculate Zeta for arguments very close to zero by means of the reflection formula. Here Zeta(x) can be expressed in terms of Zeta(1–x) so that x<0 or even x<0,5 can be handled. Maybe this is also the reason for the mentioned strange results on the 34s. I suspect that 1–x here simply rounds to 1, and Zeta(1) is undefined, or ∞ if you prefer.

Dieter
I think you are correct pointing at the reflection code as the cause here.


Pauli
I've got a fix which I'll commit tonight.
Instead of reflecting at x=0.5, the change reflects for x<=0. The series converges for x>0 so values should still be good and the accuracy loss won't occur.
The fix has been committed. We await the next rebuild for the firmware and emulators.

Pauli
(08-03-2017 07:30 AM)Paul Dale Wrote: [ -> ]The fix has been committed. We await the next rebuild for the firmware and emulators.

Great, thank you.

When the new version is available on sourceforge, github or whereever, could you please post a direct link to the directory with the .bin files resp. the new emulator files? I always get lost when I try to find these things.

Dieter
I expect it will be Marcus making the new images.


Pauli
I've my new build system up and running (a Surface Pro 3 with the latest Windows 10). A new build is committed but totally untested. At least the classic emulator seems to work.
Reference URL's