Re: [sympy] Subs and custom expression

2025-02-10 Thread Paul Royik
Sure. https://github.com/sympy/sympy/issues/27582 On Sunday, January 26, 2025 at 5:24:47 PM UTC+2 Oscar wrote: > Hi Paul, > > This is a bug. I assume that the result is mathematically correct but > it is not a good transformation of the expression. > > Can you open a GitHub issue for this and lin

Re: [sympy] Subs and custom expression

2025-01-26 Thread Oscar Benjamin
Hi Paul, This is a bug. I assume that the result is mathematically correct but it is not a good transformation of the expression. Can you open a GitHub issue for this and link back to this mailing list thread (and send the link to the issue back here as well)? The problem is with Pow.conjugate

[sympy] Subs and custom expression

2025-01-26 Thread Paul Royik
from sympy import Expr, log, Abs, sqrt from sympy.abc import x, u class CustomExpr(Expr): pass expr = log(Abs(sqrt(1+2/x)-1)) print(expr.subs(x, u)) print(expr.subs(x, CustomExpr(u))) The first one prints, as expected, log(|sqrt(1 + 2/u) - 1|) But the second prints something different: log(sqr