Simplify exp(y + log(x))
Hi Axel,
I would have expected Symja to be able to simplify an expression like
exp(y + log(x))
to something like
x * exp(y)
but the term is left as it is.
I've tried both the web ui and a Java example like this
new EvalEngine().evaluate(F.Simplify(F.Exp(F.Plus(F.Log(F.x), F.y))))
Is this a simplification that still needs to be implemented, or am I doing something wrong? If the former, I can try to make a pull request if you can give me some pointers on where to start.
Nice holidays!
Comments (6)
-
repo owner -
repo owner See also
#137 -
repo owner Commited clean up 3b8741b. Thanks for your pull requests.
-
repo owner - changed status to resolved
-
reporter I've found another case where the simplifications are not used:
check("E^(2*(y+Log(x)))", "E^(2*y)*x^2");
I could manually check for the exponent including a
Times
, but I think it would be more appropriate to run the simplifications on a fully expanded / multiplied-out version. Is there a function that I can call to do this? -
repo owner In commit 8b71d00 I added F.evalExpand(arg2):
if (arg1.isE() && (arg2.isPlusTimesPower())) { IExpr expandedFunction = F.evalExpand(arg2); if (expandedFunction.isPlus()) { return powerEPlus((IAST) expandedFunction); } }
- Log in to comment
This is a simplification that still needs to be implemented.
The input
will be transformed internally to
which is in FullForm:
Use commmit 8d7dc24 (org.matheclipse.core.reflection.system.Power.java) as a starting point:to implement your changes:
Define a JUnit testcase in LowercaseTestCase.java to test your implementation: