HP Forums

Full Version: Maxima
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I developed a program on HP50G to calculate the Theorical Normal Earth Gravity.

Then I checked some of my program key values with the ones given by Charles Karney, who suggested me to verify my figures myself by own calculations with the program Maxima.

And look what I found with Maxima:

bigfloat (1/298257223563) gives

3.35281066474748071984552861852055595573263617800976384662611491675256864397313809041641635312737285​6... × 10^-12

but, executing,
bigfloat (1/298.257223563) gives

3.3528106647474804902220313351790537126362323760986328125... × 10^-3,

having previously done
fpprec : 100

Surprising result for a dummy like me.

How do you tackle such an issue?

Thanks in advance for your help and insight on the topic.

Gil Campart
Hi, Gil

What you wanted is to increase precision of 298.257223563 before getting reciprocal, so do this:

1 / 298.257223563b0
There is also a decimal float package, https://people.eecs.berkeley.edu/~fatema...decfp.lisp

(%i1) load(decfp);
"C:/Program Files/Maxima/share/maxima/5.38.0/share/decfp.lisp"

(%i2) 0.9 - 0.3 * 3              → 1.110223024625157 * 10^16
(%i3) 0.9b0 - 0.3b0 * 3       → -1.387778780781446b-17
(%i4) 0.9L0 - 0.3L0 * 3       → 0.L0
Indeed, with b0 at the end the same digits with my programs.% “HP50G Division many digits“ !

Well, I feel somewhat more confident!

Thanks for the tip.


But why is it so to proceed?
Gil
If you need higher precision on the 50g you can use the LongFloat library. With DIGITS set to 50, 298257223563 R<->F FINV returns 33528106647474807198455286185205559557326361780098.E-61 which agrees with your first result. With input of 298.257223563, R<->F FINV returns 33528106647474807198455286185205559557326361780098.E-52 which is also correct for all 50 digits, differing only in the exponent.

DIGITS can be set to any number up to 9999 which should be adequate for most purposes. Smile
(10-21-2021 11:48 AM)John Keith Wrote: [ -> ]DIGITS can be set to any number up to 9999 which should be adequate for most purposes. Smile

[chuckle!]
(Remembering "the Rule of Thumb" for pi ~ 2)
Reference URL's