Post Reply 
(42) Double precision summation and DOT
04-14-2020, 02:35 PM
Post: #2
RE: (42) Double precision summation and DOT
Quote:0.9 SQRT X^2 0.9 - produces 10^-n, where n=12 for a real 42S and 34 for Free42 Decimal.

This is just lucky. For decimal precision P, many times it just return 0.
Code:
P    "0.9 SQRT X^2 0.9 -"
10   1E-10
11   0
12   1E-12
13   0
14   -1E-14
15   0
16   0
17   0
18   1E-18
19   0
20   0
21   1E-21
22   1E-22
23   0
24   0
25   1E-25
26   -1E-26
27   -1E-27
28   -1E-28
29   0
30   0
31   0
32   1E-32
33   1E-33
34   1E-34
35   0
36   0
37   0
38   1E-38
39   0
40   1E-40

Kahan suggest a better way, "Matlab’s Loss is Nobody’s Gain", page 5

ULP = abs((4/3 - 1)*3 – 1)

round(4/3 - 1) has error of 1/3 ULP (exactly), under both decimal and binary version

Example:

Free42Binary.exe:  ULP = 2^-52 ≈ 2.22E-16  → precision = 53 bits
Free42Decimal.exe: ULP = 1E-33             → precision = 34 decimals
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: (42) Double precision summation and DOT - Albert Chan - 04-14-2020 02:35 PM



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