Opened 3 years ago
Closed 2 years ago
#20089 closed defect (invalid)
arc cosine surprising numeric results
Reported by: | rws | Owned by: | |
---|---|---|---|
Priority: | major | Milestone: | sage-duplicate/invalid/wontfix |
Component: | symbolics | Keywords: | |
Cc: | Merged in: | ||
Authors: | Reviewers: | ||
Report Upstream: | N/A | Work issues: | |
Branch: | Commit: | ||
Dependencies: | Stopgaps: |
Description (last modified by )
Here under the hood, RR.acos
gets called. I think this should return meaningful values even if the value is outside the domain.
sage: cos(1.*I) 1.54308063481524 <--- CC element sage: acos(_) 1.00000000000000*I sage: acos(1.54308063481524) NaN sage: acos(CC(1.54308063481524)) 0.999999999999997*I sage: acos(RR(1.54308063481524)) NaN
Neither SymPy? nor Pari nor Maxima do this:
In [1]: acos(1.543) Out[1]: 0.999931383282944⋅ⅈ ? acos(1.543) %1 = 0.99993138328294395810833497263866793658*I (%i1) acos(1.543); (%o1) 0.9999313832829438 %i
Change History (8)
comment:1 Changed 3 years ago by
- Description modified (diff)
comment:2 in reply to: ↑ description Changed 3 years ago by
comment:3 Changed 3 years ago by
The alternative would be to return complex in RR.acos
.
comment:4 Changed 3 years ago by
It's also a symptom of inconsistency in symbolic/pynac.pyx
where we call RR.function
, i.e. mpfr but also mpmath directly. Do you have a preference? Maybe it's best to use mpmath throughout in pynac.pyx
.
comment:5 Changed 3 years ago by
- Description modified (diff)
I have come to a conclusion, and adapted the ticket description.
comment:6 Changed 3 years ago by
- Milestone changed from sage-7.1 to sage-duplicate/invalid/wontfix
- Status changed from new to needs_review
Ok, since this is at least consistent with arb behaviour I'll file this as oddity not bug. It would be interesting to know what the big Ms return.
comment:7 Changed 2 years ago by
- Status changed from needs_review to positive_review
comment:8 Changed 2 years ago by
- Resolution set to invalid
- Status changed from positive_review to closed
Replying to rws:
Are you suggesting