Skip to content

Commit

Permalink
WIP #944 Log10(Log10(Log(Log(Log(Log10(Log10())))))) causes crash
Browse files Browse the repository at this point in the history
  • Loading branch information
axkr committed Mar 14, 2024
1 parent fe31696 commit 943cb91
Showing 1 changed file with 9 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2355,13 +2355,15 @@ public IExpr e1ObjArg(IExpr arg1) {
if (arg1.isAST(S.Underflow, 1)) {
return F.Underflow();
}
// arg1.re()^2 + arg1.im()^2
EvalEngine engine = EvalEngine.get();
IExpr temp = engine.evaluate(F.Plus(F.Sqr(arg1.re()), F.Sqr(arg1.im())));
if (temp.isOne()) {
// Log(x + I*y) == (1/2)*Log(x^2 + y^2) + I*Arg(x + I y) with Log(1) == 0
// ==> I*Arg(x + I y)
return F.Times(F.CI, F.Arg(arg1));
if (arg1.isNumericFunction()) {
// arg1.re()^2 + arg1.im()^2
EvalEngine engine = EvalEngine.get();
IExpr temp = engine.evaluate(F.Plus(F.Sqr(arg1.re()), F.Sqr(arg1.im())));
if (temp.isOne()) {
// Log(x + I*y) == (1/2)*Log(x^2 + y^2) + I*Arg(x + I y) with Log(1) == 0
// ==> I*Arg(x + I y)
return F.Times(F.CI, F.Arg(arg1));
}
}
return F.NIL;
}
Expand Down

0 comments on commit 943cb91

Please sign in to comment.