Maxima

10202021, 09:52 PM
(This post was last modified: 10202021 09:53 PM by Gil.)
Post: #1




Maxima
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.352810664747480719845528618520555955732636178009763846626114916752568643973138090416416353127372856... × 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 

10202021, 10:35 PM
Post: #2




RE: Maxima
Hi, Gil
What you wanted is to increase precision of 298.257223563 before getting reciprocal, so do this: 1 / 298.257223563b0 

10202021, 11:12 PM
Post: #3




RE: Maxima
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.387778780781446b17 (%i4) 0.9L0  0.3L0 * 3 → 0.L0 

10202021, 11:27 PM
(This post was last modified: 10202021 11:29 PM by Gil.)
Post: #4




RE: Maxima
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 

10212021, 11:48 AM
(This post was last modified: 10212021 11:56 AM by John Keith.)
Post: #5




RE: Maxima
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.E61 which agrees with your first result. With input of 298.257223563, R<>F FINV returns 33528106647474807198455286185205559557326361780098.E52 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. 

10212021, 02:07 PM
(This post was last modified: 10212021 02:09 PM by Ren.)
Post: #6




RE: Maxima
(10212021 11:48 AM)John Keith Wrote: DIGITS can be set to any number up to 9999 which should be adequate for most purposes. [chuckle!] (Remembering "the Rule of Thumb" for pi ~ 2) 10B, 10BII, 12C, 14B, 15C, 16C, 17B, 18C, 19BII, 20b, 22, 29C, 35, 38G, 39G, 41CV, 48G, 97 

« Next Oldest  Next Newest »

User(s) browsing this thread: