From 11b9b59551913fc7cce475482548874504d9bf42 Mon Sep 17 00:00:00 2001 From: "Vladimir V. Kisil" Date: Sun, 8 Aug 2021 16:01:46 +0200 Subject: [PATCH] [BUGFIX] Fix a bug in normal() method. Any function was confused with an exponent of the same argument during a normalisation of an expression. Example: normal(cos(x)/exp(x)) often returned 1 for realsymbol x. --- ginac/normal.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ginac/normal.cpp b/ginac/normal.cpp index 818aa808..2dd2ac3e 100644 --- a/ginac/normal.cpp +++ b/ginac/normal.cpp @@ -2072,7 +2072,7 @@ static ex replace_with_symbol(const ex & e, exmap & repl, exmap & rev_lookup, ls // they can be rationalised more efficiently if (is_a(e_replaced) && is_ex_the_function(e_replaced, exp)) { for (auto & it : repl) { - if (is_a(it.second) && is_ex_the_function(e_replaced, exp)) { + if (is_a(it.second) && is_ex_the_function(it.second, exp)) { ex ratio = normal(e_replaced.op(0) / it.second.op(0)); if (is_a(ratio) && ex_to(ratio).is_rational()) { // Different exponents can be treated as powers of the same basic equation -- 2.44.0