Post Reply 
Riemann's Zeta Function - another approach (RPL)
07-02-2017, 02:54 PM (This post was last modified: 07-02-2017 05:02 PM by Dieter.)
Post: #34
RE: Riemann's Zeta Function - another approach (RPL)
(07-02-2017 12:52 PM)Gerson W. Barbosa Wrote:  Thank you very much, Dieter, for kind of doing my homework:-)

I also did mine, and so here is a new HP41 program.

First, there is a new approximation for 0,97≤x≤1,03 with an error of approx. ±0,5 units in the 10th significant digit.

Then I realized that for 0,3454<x<0,97 the program may use a constant number of iterations and the results show a relatively constant error (only a few ULP) that can be compensated by a heuristc formula. Here I chose 54 terms, and the result is corrected by an amount of approx. 5 E–9/x¼. This keeps the error within about ±0,6 ULP.

The lower limit for x is the point where Zeta(x) is exactly –1. Beyond this the accuracy will substantially degrade, so x=0,3453726573 is the limit here. Below this the program throws a DATA ERROR.

So here is the latest version:

Code:
 01 LBL "ZETA"
 02 STO 00
 03 .3453726573
 04 -
 05 SQRT
 06 .03
 07 RCL 00
 08 1
 09 -
 10 ABS
 11 X>Y?
 12 GTO 00
 13 LASTX
 14 1/X
 15 LASTX
 16 LASTX
 17 .9135
 18 *
 19 13.73336
 20 +
 21 /
 22 .577215664
 23 +
 24 +
 25 GTO 02
 26 LBL 00
 27 26
 28 RCL 00
 29 /
 30 2
 31 +
 32 INT
 33 ST+ X
 34 54
 35 X>Y?
 36 X<>Y
 37 STO 01
 38 RCL 00
 39 CHS
 40 STO 00
 41 CLX
 42 LBL 01
 43 RCL Y
 44 RCL 00
 45 Y^X
 46 -
 47 CHS
 48 DSE Y
 49 GTO 01
 50 RCL 00
 51 ST+ X
 52 1
 53 -
 54 24
 55 /
 56 RCL 01
 57 X^2
 58 /
 59 1
 60 RCL 00
 61 -
 62 8
 63 /
 64 RCL 01
 65 /
 66 +
 67 .5
 68 +
 69 RCL 01
 70 +
 71 RCL 00
 72 Y^X
 73 2
 74 /
 75 +
 76 RCL 00
 77 1
 78 +
 79 2
 80 LN
 81 *
 82 E^X-1
 83 CHS
 84 /
 85 RCL 00
 86 1
 87 +
 88 SIGN
 89 X<0?
 90 ST- X
 91 5.5 E-9
 92 *
 93 RCL 00
 94 ABS
 95 SQRT
 96 SQRT
 97 /
 98 -
 99 LBL 02
100 END

Examples:

Code:
0,35  XEQ"ZETA"  => -1,010511224   exact   37 s
0,5   XEQ"ZETA"  => -1,460354509   exact   37 s
0,75  XEQ"ZETA"  => -3,441285386  -1 ULP   37 s
0,9   XEQ"ZETA"  => -9,430114018  -1 ULP   37 s
0,97  XEQ"ZETA"  => -32,75830650   exact    2 s
0,999 XEQ"ZETA"  => -999,4228572   exact    2 s
1,001 XEQ"ZETA"  =>  1000,577288   exact    2 s
1,03  XEQ"ZETA"  =>  33,91272911  +1 ULP    2 s
1,05  XEQ"ZETA"  =>  20,58084429  -1 ULP   36 s
1,27  XEQ"ZETA"  =>  4,300220201   exact   31 s
2     XEQ"ZETA"  =>  1,644934067   exact   22 s
3     XEQ"ZETA"  =>  1,202056903   exact   16 s
5     XEQ"ZETA"  =>  1,036927755   exact   12 s
19,99 XEQ"ZETA"  =>  1,000000961   exact    8 s
30    XEQ"ZETA"  =>  1,000000001   exact    6 s

Finally Zeta(0,3453726573) returns exactly –1.

The given execution times are due to V41 and a speed setting that quite exactly matches the real thing.

Dieter
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Riemann's Zeta Function - another approach (RPL) - Dieter - 07-02-2017 02:54 PM



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