Menu

#4609 atan2(inf,inf) -> 0

None
closed
nobody
None
5
2025-10-07
2025-09-15
No

This is wrong--it should either be an error or an atan2 nounform:

(%i1) atan2(inf,inf);
(%o1)                                  0

Discussion

  • David Scherfgen

    David Scherfgen - 2025-09-26

    But Maxima also says that inf - inf = 0 and inf + inf = 2*inf.
    Making such a change for atan2 would mean opening Pandora's box ...

     
    • Stavros Macrakis

      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)

       
  • Barton Willis

    Barton Willis - 2025-09-26

    A few facts:

    1. Running the testsuite plus the share testsuite, the case atan2(inf,inf) never happens. That's good.

    2. 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.

    3. 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.

    4. 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
  • Barton Willis

    Barton Willis - 2025-10-07
    • status: open --> closed
     
  • Barton Willis

    Barton Willis - 2025-10-07

    Fixed by Commit [d00e00] . Regression tests added to rtest_atan2. Closing ticket.

     

    Related

    Commit: [d00e00]


Log in to post a comment.