rtoy / maxima

A Clone of Maxima's repo
Other
0 stars 0 forks source link

cabs(expr) fails when expr is 0 #2608

Closed rtoy closed 3 months ago

rtoy commented 3 months ago

Imported from SourceForge on 2024-07-06 16:12:31 Created by rtoy on 2012-07-20 16:12:46 Original: https://sourceforge.net/p/maxima/bugs/2449


This came up on the mailing list discussion about rtest_trig failures on 2012-07-19. The issue is that commit 5ea6ff3 fixed an issue with polarform but introduces a new issue when the expression is zero, as determined by $sign. Here is an example that causes it. It shows up with cmucl, but not other lisps. I assume with other lisps the expression doesn't evaluate to zero.

(%i1) expr: 0.983425555216359*%i/(0.839139579024831-1.171945144524351*%i) -.8680141428959249*%i +0.834650094344116/(0.839139579024831-1.171945144524351*%i)+.2176215618544027$

(%i2) trace(sign)$

(%i3) cabs(expr);

1 Enter ?sign [0.983425555216359*%i/(0.839139579024831-1.171945144524351*%i) -.8680141428959249*%i +0.834650094344116/(0.839139579024831-1.171945144524351*%i) +.2176215618544027] 1 Exit ?sign zero (%o3) 0.983425555216359*%i/(0.839139579024831-1.171945144524351*%i) -.8680141428959249*%i +0.834650094344116/(0.839139579024831-1.171945144524351*%i)+.2176215618544027

(%i4) rectform(expr); (%o4) 0.0

rtoy commented 3 months ago

Imported from SourceForge on 2024-07-06 16:12:33 Created by dgildea on 2013-01-07 12:37:33 Original: https://sourceforge.net/p/maxima/bugs/2449/#8af7


rtoy commented 3 months ago

Imported from SourceForge on 2024-07-06 16:12:36 Created by dgildea on 2013-01-07 12:37:33 Original: https://sourceforge.net/p/maxima/bugs/2449/#5636


Fixed in rpart.lisp.