abs exp simplify bug

10 views
Skip to first unread message

rych

unread,
Nov 29, 2009, 8:06:36 PM11/29/09
to sage-support
var('y', domain='real')
assume(y, 'real')



abs(exp(y*I)).simplify()
1



abs(exp(1.1*y*I)).simplify()
e^(1.1*I*y)


The last result is incorrect. It seems simplify() doesn't like
floating point?

Burcin Erocal

unread,
Nov 30, 2009, 5:00:08 AM11/30/09
to sage-s...@googlegroups.com
Hi,
Thank you for the report. This is a bug in conversion to maxima:

sage: t = abs(exp(y*I)); t
abs(e^(I*y))
sage: t._maxima_init_()
'abs(exp((y)*(0+%i*1)))'

sage: u = abs(exp(1.1*y*I)); u
abs(e^(1.10000000000000*I*y))
sage: u._maxima_init_()
'abs(exp((y)*(1.1000000000000001*I)))'


This might be the reason:

sage: t.operands()[0].operands()[0].operands()[1].pyobject()
I
sage: type(t.operands()[0].operands()[0].operands()[1].pyobject())
<type
'sage.rings.number_field.number_field_element_quadratic.NumberFieldElement_quadratic'>

sage: u.operands()[0].operands()[0].operands()[1].pyobject()
1.10000000000000*I
sage: type(u.operands()[0].operands()[0].operands()[1].pyobject())
<type 'sage.rings.complex_number.ComplexNumber'>


We'll be tracking this issue here:

http://trac.sagemath.org/sage_trac/ticket/7557


Cheers,
Burcin


kcrisman

unread,
Nov 30, 2009, 1:21:33 PM11/30/09
to sage-support


On Nov 30, 5:00 am, Burcin Erocal <bur...@erocal.org> wrote:
> Hi,
>
> On Sun, 29 Nov 2009 17:06:36 -0800 (PST)
>
Is this related to #6882?

- kcrisman

- kcrisman
Reply all
Reply to author
Forward
0 new messages