Hi David,

> Here is a puzzle (to me if not to you).
> 
> In sage 2.10.2 (although the problem occurs in earlier versions)
> on a CoreDuo MacIntosh running under MacOS X.5.2 we have:
> 
> 
> a = gp.sin(1)
> octave.eval('format long g')
> b = octave.sin(1)
> c = math.sin(1)
> eps = 1. - (4./3.-1.)*3.
> d = a*eps
> a
>       0.8414709848078965066525023216
> b
>       0.841470984807897
> c
>       0.8414709848078965
> (a-b)/d
>       -2.640423314436302686
> (a-c)/d
>       -553.9021661362176753
> (b-c)/d
>       -553.7921192926074518167939202
> 
> Notice that a, b, c all seem to agree to about 16 digits, but when
> the 'native' sage value is mixed with the gp and octave values a
> horrendously large error occurs.
> 
> The same behavior occurs for cos(1), exp(1), atan(1).
> 
> Something very peculiar is happening. What? Why?
> 
> Thank you,
> 
> David Galant

my guess is that in a-c, c is converted to 'sage.interfaces.gp.GpElement'
with a smaller precision:

sage: a-a.parent()(c)
-1.0349334749767836598 E-13
sage: a-c
-1.0349334749767836598 E-13

sage: c
0.8414709848078965
sage: a.parent()(c)
0.8414709848080000000000000000

Paul Zimmermann

--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to