Prime calculator sum(1.0002^n/n, 1, 20000)
12-29-2020, 05:10 PM
Post: #24
 Albert Chan Senior Member Posts: 2,678 Joined: Jul 2018
RE: Prime calculator sum(1.0002^n/n, 1, 20000)
(12-29-2020 01:57 AM)Gil Wrote:  Just note that, due to roundings, the last digits of the
given result 28.14397383505516924725756564071173
are — not surprisingly — incorrect after checking with Wolfram Alpha
(458 [55], instead of 173).

The errors mostly comes from implementation of Y^X.
For integer X, Free42 were patched to repeated squaring: Y^X = (Y^(X//2))^2 * Y^(X%2)

Example, for 7 squarings:
1.0002 128 Y^X ﻿ ﻿ ﻿ ﻿ ﻿ ﻿ ﻿ ﻿ ﻿ ﻿ ﻿ ﻿ ﻿ ﻿ → 1.025927868161809572716800732564789
1.0002 LN 128 × E^X ﻿ ﻿ ﻿ ﻿ ﻿ ﻿ → 1.025927868161809572716800732564790

Extending to 14 squarings:
1.0002 16384 Y^X ﻿ ﻿ ﻿ ﻿ ﻿ ﻿ ﻿ ﻿ ﻿ ﻿ → 26.48218820206050462500040752260032
1.0002 LN 16384 × E^X ﻿ ﻿ → 26.48218820206050462500040752260470 (last digit should be 1)

Because all terms are using the same base, almost all errors fall on the same side.
And, it get worse and worse, with 1 ULP error for 7 squarings to 471-32 = 439 ULP for 14.

I replaced Y^X by E^(X*LN(Y)), and the sum ends in 447, much closer to true result.
 « Next Oldest | Next Newest »

 Messages In This Thread Prime calculator sum(1.0002^n/n, 1, 20000) - Gil - 12-27-2020, 03:04 AM RE: Prime calculator sum(1.0002^n/n, 1, 20000) - Joe Horn - 12-27-2020, 04:16 AM RE: Prime calculator sum(1.0002^n/n, 1, 20000) - toml_12953 - 12-27-2020, 04:27 AM RE: Prime calculator sum(1.0002^n/n, 1, 20000) - Gil - 12-27-2020, 10:37 AM RE: Prime calculator sum(1.0002^n/n, 1, 20000) - toml_12953 - 12-27-2020, 10:53 AM RE: Prime calculator sum(1.0002^n/n, 1, 20000) - Steve Simpkin - 12-27-2020, 01:46 PM RE: Prime calculator sum(1.0002^n/n, 1, 20000) - Tyann - 12-27-2020, 03:17 PM RE: Prime calculator sum(1.0002^n/n, 1, 20000) - Gil - 12-27-2020, 05:32 PM RE: Prime calculator sum(1.0002^n/n, 1, 20000) - Gil - 12-27-2020, 05:35 PM RE: Prime calculator sum(1.0002^n/n, 1, 20000) - StephenG1CMZ - 12-27-2020, 05:43 PM RE: Prime calculator sum(1.0002^n/n, 1, 20000) - lrdheat - 12-27-2020, 05:56 PM RE: Prime calculator sum(1.0002^n/n, 1, 20000) - ijabbott - 12-28-2020, 10:47 AM RE: Prime calculator sum(1.0002^n/n, 1, 20000) - _nmr_ - 12-28-2020, 12:59 PM RE: Prime calculator sum(1.0002^n/n, 1, 20000) - John Keith - 12-27-2020, 07:03 PM RE: Prime calculator sum(1.0002^n/n, 1, 20000) - Claudio L. - 12-30-2020, 09:02 PM RE: Prime calculator sum(1.0002^n/n, 1, 20000) - lrdheat - 12-27-2020, 08:07 PM RE: Prime calculator sum(1.0002^n/n, 1, 20000) - Gerson W. Barbosa - 12-27-2020, 10:43 PM RE: Prime calculator sum(1.0002^n/n, 1, 20000) - Valentin Albillo - 12-28-2020, 03:20 AM RE: Prime calculator sum(1.0002^n/n, 1, 20000) - Joe Horn - 12-28-2020, 03:02 PM RE: Prime calculator sum(1.0002^n/n, 1, 20000) - Didier Lachieze - 12-28-2020, 04:21 PM RE: Prime calculator sum(1.0002^n/n, 1, 20000) - Joe Horn - 12-28-2020, 11:13 PM RE: Prime calculator sum(1.0002^n/n, 1, 20000) - StephenG1CMZ - 12-28-2020, 02:03 PM RE: Prime calculator sum(1.0002^n/n, 1, 20000) - Albert Chan - 12-28-2020, 09:14 PM RE: Prime calculator sum(1.0002^n/n, 1, 20000) - Gil - 12-29-2020, 01:57 AM RE: Prime calculator sum(1.0002^n/n, 1, 20000) - Albert Chan - 12-29-2020 05:10 PM RE: Prime calculator sum(1.0002^n/n, 1, 20000) - Gil - 12-31-2020, 01:19 AM

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