Skip to content

problems with real_part function #7957

@burcin

Description

@burcin

From the sage-devel thread:

http://groups.google.com/group/sage-devel/t/56519182d53e9cf8

On Tue, 5 Jan 2010 04:35:27 -0800 (PST)
Håkan Granath <[email protected]> wrote:

> Hi,
> 
> It seems computations in QQbar is sometimes much slower in Sage
> 4.3 than in the previous version. Here is an example (I am sorry
> if it is too convoluted):
> 
> v1 = sqrt(QQbar(3))
> v2 = QQbar(999/1000*I)
> v3 = (1 + v1)/2 + v2*(-3 - v1)/2
> v4 = (3 - v1)/2 + v2*(1 - v1)/2
> v5 = v3*(1/2) + v4*QQbar(500/999*I)
> v6 = v3*(1/2) + v4*QQbar(-500/999*I)
> v7 = -(v5/v6).conjugate() - QQbar(abs(v5))/v5/v6.conjugate()*QQbar(I)
> v8 = -(v5/v6).conjugate() + QQbar(abs(v5))/v5/v6.conjugate()*QQbar(I)
> v9 = abs(v8)
> v10 = abs(v7)
> v11 = (v7 - v8 + QQbar(v9*v9)*v7 - QQbar(v10*v10)*v8)/\
>       (v8.conjugate()*v7 - v7.conjugate()*v8)
> v12 = (v11*QQbar(I) - QQbar(-I)*v11.conjugate())/2/QQbar(I)
> v13 = abs(v12)
> v14 = QQbar(1 - sqrt(1 - 1/(v13*v13)))*v12
> time real(v14)
> 
> In Sage 4.3 I get the output:
> 
> Exception TypeError: TypeError('Unable to convert number to real
> interval.',) in 'sage.symbolic.pynac.py_is_real' ignored
> CPU times: user 67.94 s, sys: 0.30 s, total: 68.23 s
> Wall time: 68.68 s
> -0.5773508481209188?
> 
> In Sage 4.2.1 on the same computer I get the output:
> 
> CPU times: user 0.00 s, sys: 0.00 s, total: 0.00 s
> Wall time: 0.00 s
> -0.5773508481209188?

This is fallout from #7490. See also #7916 for problems with conjugate().

CC: @sagetrac-rossk

Component: symbolics

Author: Burcin Erocal

Reviewer: Karl-Dieter Crisman

Merged: sage-4.3.3.alpha1

Issue created by migration from https://trac.sagemath.org/ticket/7957

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions