Opened 7 years ago

Closed 6 years ago

## #20089 closed defect (invalid)

# arc cosine surprising numeric results

Reported by: | Ralf Stephan | 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 7 years ago by

Description: | modified (diff) |
---|

### comment:2 Changed 7 years ago by

### comment:4 Changed 7 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 7 years ago by

Description: | modified (diff) |
---|

I have come to a conclusion, and adapted the ticket description.

### comment:6 Changed 6 years ago by

Milestone: | sage-7.1 → sage-duplicate/invalid/wontfix |
---|---|

Status: | new → 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 6 years ago by

Status: | needs_review → positive_review |
---|

### comment:8 Changed 6 years ago by

Resolution: | → invalid |
---|---|

Status: | positive_review → closed |

**Note:**See TracTickets for help on using tickets.

Replying to rws:

Are you suggesting