Semantics of RealBallField and RealIntervalField ?
I do not understand the meaning (or the output) of RealBallField elements. An example will be clearer :
sage: foo=RealBallField(10)(pi/2);foo
[1.57 +/- 2.27e-3]
So far, so good.
sage: sin(foo)
[1.0 +/- 3.92e-3]
An interval centered on 1, Isn't there a problem ? Mathematically, he upper bound is 1, and, since the derivative is 0, the maximal error is intuitively expected to be much smaller than the error on the argument. Let's find out analytically. If I'm not mistaken, the maximal error is :
sage: 1-sin(pi/2-2^-10).n()
4.76837120344520e-7
So I would expect something along the lines of [1-4.76*10^-7 1].
Maybe my expectation to use directly the printed notation is misguided. Let's use the specialized methods :
sage: sin(foo).below_abs()
[0.996 +/- 9.38e-5]
sage: sin(foo).above_abs()
[1.00 +/- 3.91e-3]
Three surprises :
- I'd expect the bounds to be ("sharp") reals, not balls...
- The stated radii make no sense to me/
- The stated lower bound is way too low.
Therefore, I do not understand the results. But I may be mistaken : my last formal contact with numerical analysis of errors is about 35 years old...
Can some kind soul point me to an explanation ?
Note : the RealIntervalField gives me different nonsense :
sage: bar=RealIntervalField(10)(pi/2);bar
1.58?
sage: bar.str(style="brackets")
'[1.5703 .. 1.5723]'
Okay so far...
sage: sin(bar)
1.000?
Possibly okay : value at the center of the argument. But not the center of the interval...
sage: sin(bar).str(style="brackets")
'[0.99902 .. 1.0000]'
The upper bound is correct ; I beleeve that the lower bound is too low...
sage: sin(bar).center()
1.0
Again, this is not the center of the interval, but the value at the center of the interval of the argument...
sage: sin(bar).absolute_diameter()
0.00098
I think this is too low...
EDIT : My understanding problems mat be better summarized by the following :
sage: foo=RealBallField(10)(pi/2);foo
[1.57 +/- 2.27e-3]
sage: bar=RealIntervalField(10)(pi/2);bar
1.58?
sage: foo.sin().upper()
1.1
sage: bar.sin().upper()
1.0