Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to force precision in SAGE?
#1
I've been trying to remove some inaccuracy from my tetration library, and I keep getting precision limited to about 10-15 digits or so. I've finally figured out that despite using a RealField(256), which should provide at least a good 80 digits of precision, I'm getting truncations to double precision at some point. The net result is that I can perform a reversible series of transformations on 0 and get back numbers like -0.00000000718...

Needless to say, it's very frustrating. I haven't found a global setting in SAGE for the precision of real arithmetic, so I'm stuck having to push all my reversible transformations (like e^z-1 and ln(z+1)) through a RealField variable. Even then, I'm still losing precision somewhere. What's the "right" way to use arbitrary precision math in SAGE?

Please Help!
~ Jay Daniel Fox
Reply
#2
Never mind, I figured it out. Apperently, e^z and exp(z) are not equivalent. The former uses double precision, as if it were doing the following internally:

, with b = 2.7182818284590458..., where that final 8 should be a 2.

In other words, it treats e as any other base, and solves e^z by performing exp(z)/ln(e), where e is only accurate to double precision. Now I know not to use e^z.
~ Jay Daniel Fox
Reply
#3
Yep, I just verified, if I type e.base_ring(), I get:
Real Field with 53 bits of precision

Well, whatever, I'm using exp(z) now, so onwards and upwards.
~ Jay Daniel Fox
Reply


Possibly Related Threads...
Thread Author Replies Views Last Post
  Attempt to find a limit point but each step needs doubling the precision... Gottfried 15 20,936 11/09/2014, 10:25 PM
Last Post: tommy1729
  Precision check on [pentation.gp] SOLVED Cherrina_Pixie 7 12,361 07/02/2011, 01:39 AM
Last Post: Cherrina_Pixie
  Sage Question? rsgerard 1 4,310 05/09/2010, 11:40 AM
Last Post: bo198214
  SAGE code for computing flow matrix for exp(z)-1 jaydfox 4 9,022 08/21/2009, 05:32 PM
Last Post: jaydfox
  How to free memory in SAGE? jaydfox 2 5,892 12/21/2007, 06:38 PM
Last Post: andydude
  SAGE code implementing slog with acceleration jaydfox 4 7,742 10/22/2007, 12:59 AM
Last Post: jaydfox
  Complete SAGE code for tetration eyu100 4 6,704 10/18/2007, 03:55 AM
Last Post: jaydfox



Users browsing this thread: 1 Guest(s)