Agreed that inf-inf => 0 is a much more common case.
Perhaps have some sort of structured comment in the code when we notice cases like this.
e.g. ;;; BAD atan2(inf,inf)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Running the testsuite plus the share testsuite, the case atan2(inf,inf) never happens. That's good.
Currently Maxima simplifies atan2(x,inf) to zero. As long as x isn't an extended real, that's OK, but the code doesn't first check for the atan2(inf,inf) case, and I say that's a bug.
Inserting code that catches a few cases such as atan2(ind,inf) = 0 doesn't trigger any testsuite failures and doesn't fix any testsuite failures.
Inserting code that catches atan2(inf,inf) -> either an error or an atan2 nounform does not trigger any testsuite failures and doesn't fix any testsuite failures.
Last edit: Barton Willis 2025-09-27
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
But Maxima also says that
inf - inf = 0andinf + inf = 2*inf.Making such a change for
atan2would mean opening Pandora's box ...Agreed that inf-inf => 0 is a much more common case.
Perhaps have some sort of structured comment in the code when we notice cases like this.
e.g. ;;; BAD atan2(inf,inf)
A few facts:
Running the testsuite plus the share testsuite, the case
atan2(inf,inf)never happens. That's good.Currently Maxima simplifies
atan2(x,inf)to zero. As long asxisn't an extended real, that's OK, but the code doesn't first check for theatan2(inf,inf)case, and I say that's a bug.Inserting code that catches a few cases such as
atan2(ind,inf) = 0doesn't trigger any testsuite failures and doesn't fix any testsuite failures.Inserting code that catches
atan2(inf,inf) ->either an error or anatan2nounform does not trigger any testsuite failures and doesn't fix any testsuite failures.Last edit: Barton Willis 2025-09-27
Fixed by Commit [d00e00] . Regression tests added to rtest_atan2. Closing ticket.
Related
Commit: [d00e00]