Ticket #8497 (new defect)

Opened 6 months ago

Last modified 6 months ago

bug in simplify_radical

Reported by: zimmerma Owned by: burcin
Priority: major Milestone: sage-4.5.3
Component: calculus Keywords: simplify, radical, sqrt
Cc: Author(s):
Report Upstream: N/A Reviewer(s):
Merged in: Work issues:

Description

the documentation of simplify_radical says:

sage: x.simplify_radical?
...
       Simplifies this symbolic expression, which can contain logs,
       exponentials, and radicals, by converting it into a form which is
       canonical over a large class of expressions and a given ordering of
       variables

however if indeed it is able to recognize zero:

sage: a=1/(sqrt(5)+sqrt(2))-(sqrt(5)-sqrt(2))/3
sage: a.simplify_radical()
0

it does *not* return a canonical expression:

sage: a1=1/(sqrt(5)+sqrt(2))
sage: a2=(sqrt(5)-sqrt(2))/3
sage: a1.simplify_radical()
1/(sqrt(2) + sqrt(5))
sage: a2.simplify_radical()
-1/3*sqrt(2) + 1/3*sqrt(5)
sage: (a1-a2).simplify_radical()
0

Change History

Changed 6 months ago by zimmerma

Note the original question posed to me was: how to multiply say 1/(1+sqrt(2)+sqrt(3)) by the conjugate expression?

Changed 6 months ago by mhansen

  • summary changed from bug in simplify_rational to bug in simplify_radical

This is the full docstring from Maxima:

Simplifies expr, which can contain logs, exponentials, and radicals, by converting it into a form which is canonical over a large class of expressions and a given ordering of variables; that is, all functionally equivalent forms are mapped into a unique form. For a somewhat larger class of expressions, radcan produces a regular form. Two equivalent expressions in this class do not necessarily have the same appearance, but their difference can be simplified by radcan to zero.

    For some expressions radcan is quite time consuming. This is the cost of exploring certain relationships among the components of the expression for simplifications based on factoring and partial-fraction expansions of exponents. 

Perhaps we should include this

Changed 6 months ago by zimmerma

Perhaps we should include this

yes (unless of course upstream finds a way to get a real canonical form). And maybe adding an example showing the difference when checking for 0.

Note: See TracTickets for help on using tickets.