Opened 13 years ago

Last modified 7 years ago

#5993 new enhancement

document use of interval arithmetic

Reported by: was Owned by: mvngu
Priority: minor Milestone: sage-6.4
Component: documentation Keywords:
Cc: Merged in:
Authors: Reviewers:
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Status badges


This email snippet pretty much describes the issue:

On Tue, May 5, 2009 at 11:16 PM, Henryk Trappmann <> wrote:
> Ah now I see, you mean though it displays 1/384 it is internally still
> the above sum, which is computed when evaluated with n.

True.  In Sage right now the internal form of the expression (not the simplified form) is used by the "n" command.  This will change when Sage switches from using maxima-based symbolics to Pynac. 

By the way, you can use the real interval field to get a floating point approximation to any symbolic expression to a given number of digits of precision.  Every digit is definitely right except the one right before the question mark:

sage: a = 1/(48*sqrt(1)) - 7/(96*1**(3/2)) + 3/(32*1**(5/2)) - 5/ (128*1**(7/2))
sage: RealIntervalField(100)(a)             # increase 100 for more digits

I think the n function (numerical_approx) for symbolics should be changed to using interval arithmetic.  This will be a huge improvement.  Notice, e.g., that interval arithmetic very nicely gives the right answer for the infamous sin(10^50):

sage: a = sin(10^50)
sage: a.n(53)
sage: a.n(100)
sage: RealIntervalField(100)(a)
sage: RealIntervalField(1000)(a)
sage: RealIntervalField(2000)(a)

Change History (6)

comment:1 Changed 11 years ago by kcrisman

  • Priority changed from major to minor
  • Report Upstream set to N/A

Disagree, primarily because it's been this way for quite a while now, and because a lot of users would be really confused by the question mark. We certainly could update the documentation to make it clear how to get much more accurate answers using RIF.

comment:2 Changed 9 years ago by jdemeyer

  • Milestone changed from sage-5.11 to sage-5.12

comment:3 Changed 8 years ago by vbraun_spam

  • Milestone changed from sage-6.1 to sage-6.2

comment:4 Changed 8 years ago by vbraun_spam

  • Milestone changed from sage-6.2 to sage-6.3

comment:5 Changed 8 years ago by vbraun_spam

  • Milestone changed from sage-6.3 to sage-6.4

comment:6 Changed 7 years ago by rws

  • Component changed from calculus to documentation
  • Owner changed from burcin to mvngu
  • Summary changed from rewrite numerical_approx (the n function) to use interval arithmetic to document use of interval arithmetic
Note: See TracTickets for help on using tickets.