Post Reply 
WP34s: inconsistent behavior for Zeta near zero
08-01-2017, 07:22 PM (This post was last modified: 08-01-2017 07:23 PM by Dieter.)
Post: #1
WP34s: inconsistent behavior for Zeta near zero
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
Find all posts by this user
Quote this message in a reply
08-01-2017, 11:54 PM (This post was last modified: 08-02-2017 12:33 AM by Paul Dale.)
Post: #2
RE: WP34s: inconsistent behavior for Zeta near zero
I think you are correct pointing at the reflection code as the cause here.


Pauli
Find all posts by this user
Quote this message in a reply
08-03-2017, 12:39 AM
Post: #3
RE: WP34s: inconsistent behavior for Zeta near zero
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.
Find all posts by this user
Quote this message in a reply
08-03-2017, 07:30 AM
Post: #4
RE: WP34s: inconsistent behavior for Zeta near zero
The fix has been committed. We await the next rebuild for the firmware and emulators.

Pauli
Find all posts by this user
Quote this message in a reply
08-03-2017, 09:45 PM
Post: #5
RE: WP34s: inconsistent behavior for Zeta near zero
(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
Find all posts by this user
Quote this message in a reply
08-04-2017, 01:02 AM
Post: #6
RE: WP34s: inconsistent behavior for Zeta near zero
I expect it will be Marcus making the new images.


Pauli
Find all posts by this user
Quote this message in a reply
01-20-2018, 04:20 PM
Post: #7
RE: WP34s: inconsistent behavior for Zeta near zero
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.

Marcus von Cube
Wehrheim, Germany
http://www.mvcsys.de
http://wp34s.sf.net
http://mvcsys.de/doc/basic-compare.html
Find all posts by this user
Quote this message in a reply
Post Reply 




User(s) browsing this thread: 1 Guest(s)