New Casio fx-9860 GIII model
|
10-05-2020, 06:02 PM
Post: #48
|
|||
|
|||
RE: New Casio fx-9860 GIII model
(10-04-2020 07:26 PM)John Keith Wrote:(10-04-2020 04:53 PM)grsbanks Wrote: Using a python program it does it in only 2 seconds for \(n=10^3\), 18 seconds for \(n=10^4\) or 184 seconds for \(n=10^5\). That's 10× faster than using Casio Basic, BUT with what appears to be greatly reduced precision. I would be surprised if Casio picked single-precision float for its Python implementation. With only 7 digits precision (and greatly reduced exponent range), that is just asking for user complaints. More likely, what appeared to be reduced precision is just default display format of numbers. To get a good reference of what is expected, I simplified the formula: Σ (e^sin(atan(x)))^(1/3) = Σ e^(x/(sqrt(9*x*x+9)) All terms about the same size, approaching e^(1/3) ≈ 1.39561 when x is big To reduce errors, break up the sum to its integer and fractional parts. Code: expm1 = require'mathx'.expm1 lua> sum(1e3) 1395 0.34628774342325536 lua> sum(1e4) 13955 0.8579042915289953 lua> sum(1e5) 139560 0.9761411065516028 Binary math tends to be more accurate, because of smaller accumulated rounding errors. |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 2 Guest(s)