Skip to content

Give an algorithm keyword to (some?) simplify methods/functions #32472

@EmmanuelCharpentier

Description

@EmmanuelCharpentier

Case in point (many other examples exist...) :

sage: var("x", domain="positive")
x
sage: u = -1/2*I*x + 1/2*I*sqrt(x^2 - 1) + 1/2*I/(x - sqrt(x^2 - 1))
sage: u.simplify()
-1/2*I*x + 1/2*I*sqrt(x^2 - 1) + 1/2*I/(x - sqrt(x^2 - 1))
sage: u._giac_().simplify()._sage_()
I*sqrt(x^2 - 1)
sage: u._fricas_().simplify()._sage_()
-(I*x^2 - I*sqrt(x^2 - 1)*x - I)/(x - sqrt(x^2 - 1))
sage: u._sympy_().simplify()._sage_()
-I*(x^2 - sqrt(x^2 - 1)*x - 1)/(x - sqrt(x^2 - 1))
sage: mathematica.FullSimplify(u).sage()
I*sqrt(x^2 - 1)

Suggestion : give to the simplify method of symbolic expressions (and its wrapper function) an algorithm keyword selecting an alternative to our "default" (which is to send the expression to Maxima and accept whatever Maxima sends back to us...).

This might be also useful for the more specialized methods/functions (such as simplify_trig). Advice required...

Advice also required about adding it to simplify_full, which aims to be a useful helper in complicated cases, but often bites more than it can swallow...

CC: @slel

Component: symbolics

Author: Emmanuel Charpentier

Branch/Commit: u/charpent/give_an__algorithm__keyword_to__some____simplify__methods_functions @ 6472588

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions