#11423 closed defect (duplicate)
Make atan2(0,0) consistent
Reported by: | kcrisman | Owned by: | burcin |
---|---|---|---|
Priority: | major | Milestone: | sage-duplicate/invalid/wontfix |
Component: | symbolics | Keywords: | sd31 |
Cc: | titusn | Merged in: | |
Authors: | Reviewers: | Volker Braun, Titus Nicolae, Burcin Erocal | |
Report Upstream: | N/A | Work issues: | |
Branch: | Commit: | ||
Dependencies: | Stopgaps: |
Description (last modified by )
This is bad:
sage: atan2(0,0) 0 sage: atan2(0,0,hold=True) arctan2(0, 0) sage: atan2(0,0,hold=True).n() ValueError: arctan2(0,0) undefined sage: atan2(0,0,hold=True).simplify() ----------------------------------------------------- TypeError: Error executing code in Maxima CODE: sage1 : atan2(0,0)$ Maxima ERROR: atan2: atan2(0,0) is undefined. -- an error. To debug this try: debugmode(true);
Probably we should make sure that atan2(0,0) always raises an error. Wolfram Alpha/Mathematica? gives the interval from -pi to pi, which seems as good as any answer, and who knows what others do.
Originally reported at ask.sagemath.org.
Change History (12)
comment:1 Changed 10 years ago by
- Description modified (diff)
comment:2 Changed 10 years ago by
- Keywords sd31 added
comment:3 Changed 10 years ago by
Should that be reported upstream? Just curious.
comment:4 Changed 9 years ago by
- Cc titusn added
GiNaC probably got atan2(0,0) -> 0
from Maple:
|\^/| Maple 12 (X86 64 LINUX) ._|\| |/|_. Copyright (c) Maplesoft, a division of Waterloo Maple Inc. 2008 \ MAPLE / All rights reserved. Maple is a trademark of <____ ____> Waterloo Maple Inc. | Type ? for help. > arctan(0,0); 0
MMA prints an error like Maxima:
In[5]:= ArcTan[0,0] ArcTan::indet: Indeterminate expression ArcTan[0, 0] encountered. Out[5]= Interval[{-Pi, Pi}]
Titus points out that with Volker's patch, arg(0)
in Sage also gives an error. All of MMA, Maple and Maxima evaluate that to 0 though.
comment:5 follow-up: ↓ 6 Changed 9 years ago by
- Milestone changed from sage-5.0 to sage-5.1
Pynac 0.2.4 (#12950), includes the patch Volker mentioned in comment:2. Attached to that ticket there is also a patch by Titus fixing failing doctests in symbolics related files and modifying the arg()
function so that arg(0)
still returns 0.
Apparently this change breaks some tests in 3d plotting. We should open a ticket with that and make this one depend on it. Titus, can you handle that?
comment:6 in reply to: ↑ 5 Changed 9 years ago by
Apparently this change breaks some tests in 3d plotting. We should open a ticket with that and make this one depend on it. Titus, can you handle that?
And please cc me on that ticket, thanks.
comment:7 Changed 9 years ago by
- Reviewers set to Burcin Erocal
- Status changed from new to needs_review
This was fixed with #12950.
comment:8 Changed 9 years ago by
- Status changed from needs_review to positive_review
comment:9 Changed 9 years ago by
- Milestone changed from sage-5.1 to sage-5.2
comment:10 Changed 9 years ago by
- Milestone changed from sage-5.2 to sage-duplicate/invalid/wontfix
comment:11 Changed 9 years ago by
- Resolution set to duplicate
- Reviewers changed from Burcin Erocal to Volker Braun, Titus Nicolae, Burcin Erocal
- Status changed from positive_review to closed
comment:12 Changed 5 years ago by
- Description modified (diff)
I made a patch to pynac yield the following. I'll try to push the patch into the new pynac release at #9880.