#20089: arc cosine surprising numeric results
-----------------------------+------------------------
Reporter: rws | Owner:
Type: defect | Status: new
Priority: major | Milestone: sage-7.1
Component: symbolics | Resolution:
Keywords: | Merged in:
Authors: | Reviewers:
Report Upstream: N/A | Work issues:
Branch: | Commit:
Dependencies: | Stopgaps:
-----------------------------+------------------------
Old description:
> The default `RR` type of input FP numbers is surprising. If we have
> complex variables as default, why are floats of type `RR` not `CC`?
> {{{
> sage: cos(1.*I)
> 1.54308063481524
> 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
> }}}
New description:
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
}}}
--
Comment (by rws):
I have come to a conclusion, and adapted the ticket description.
--
Ticket URL: <http://trac.sagemath.org/ticket/20089#comment:5>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.