Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Commit

Permalink
24299: Bugs with inverse trig and hyperbolic functions of CIF argument
Browse files Browse the repository at this point in the history
  • Loading branch information
rwst committed Dec 26, 2017
1 parent d3b9b39 commit 0dad6ad
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 0 deletions.
24 changes: 24 additions & 0 deletions src/sage/functions/hyperbolic.py
Original file line number Diff line number Diff line change
Expand Up @@ -395,6 +395,10 @@ def __init__(self):
arcsinh(1/2)
sage: arcsinh(1 + I*1.0)
1.06127506190504 + 0.666239432492515*I
sage: asinh(CIF(0.6))
0.5688248987322476?
sage: parent(asinh(CIF(0.6))) is CIF
True
To prevent automatic evaluation use the ``hold`` argument::
Expand Down Expand Up @@ -458,6 +462,10 @@ def __init__(self):
2.0
sage: arccosh(complex(1, 2)) # abs tol 1e-15
(1.5285709194809982+1.1437177404024204j)
sage: acosh(CIF(0.6))
0.9272952180016122?*I
sage: parent(acosh(CIF(0.6))) is CIF
True
.. warning::
Expand Down Expand Up @@ -539,6 +547,10 @@ def __init__(self):
arctanh(1/2)
sage: arctanh(1 + I*1.0)
0.402359478108525 + 1.01722196789785*I
sage: atanh(CIF(0.6))
0.6931471805599452?
sage: parent(atanh(CIF(0.6))) is CIF
True
To prevent automatic evaluation use the ``hold`` argument::
Expand Down Expand Up @@ -600,6 +612,10 @@ def __init__(self):
0.402359478108525 - 0.553574358897045*I
sage: arccoth(2).n(200)
0.54930614433405484569762261846126285232374527891137472586735
sage: acoth(CIF(0.6))
0.693147180559945?
sage: parent(acoth(CIF(0.6))) is CIF
True
sage: bool(diff(acoth(x), x) == diff(atanh(x), x))
True
Expand Down Expand Up @@ -663,6 +679,10 @@ def __init__(self):
1.3169578969248167086250463473079684440269819714675164797685
sage: float(arcsech(1/2))
1.3169578969248168
sage: asech(CIF(0.6))
1.098612288668110?
sage: parent(asech(CIF(0.6))) is CIF
True
sage: diff(asech(x), x)
-1/(sqrt(-x^2 + 1)*x)
Expand Down Expand Up @@ -707,6 +727,10 @@ def __init__(self):
0.88137358701954302523260932497979230902816032826163541075330
sage: float(arccsch(1))
0.881373587019543
sage: acsch(CIF(0.6))
1.283795662743193?
sage: parent(acsch(CIF(0.6))) is CIF
True
sage: diff(acsch(x), x)
-1/(sqrt(x^2 + 1)*x)
Expand Down
24 changes: 24 additions & 0 deletions src/sage/functions/trig.py
Original file line number Diff line number Diff line change
Expand Up @@ -491,6 +491,10 @@ def __init__(self):
1/6*pi
sage: arcsin(1 + 1.0*I)
0.666239432492515 + 1.06127506190504*I
sage: asin(CIF(0.6))
0.6435011087932843?
sage: parent(asin(CIF(0.6))) is CIF
True
We can delay evaluation using the ``hold`` parameter::
Expand Down Expand Up @@ -557,6 +561,10 @@ def __init__(self):
0.904556894302381 - 1.06127506190504*I
sage: arccos(3/4).n(100)
0.72273424781341561117837735264
sage: acos(CIF(1/3))
1.230959417340775?
sage: parent(acos(CIF(1/3))) is CIF
True
We can delay evaluation using the ``hold`` parameter::
Expand Down Expand Up @@ -623,6 +631,10 @@ def __init__(self):
arctan(I + 1)
sage: arctan(1/2).n(100)
0.46364760900080611621425623146
sage: atan(CIF(1/3))
0.321750554396643?
sage: parent(atan(CIF(1/3))) is CIF
True
We can delay evaluation using the ``hold`` parameter::
Expand Down Expand Up @@ -693,6 +705,10 @@ def __init__(self):
1.1071487177940905030170654602
sage: float(arccot(1/2)) # abs tol 2e-16
1.1071487177940906
sage: acot(CIF(1/3))
1.249045772398255?
sage: parent(acot(CIF(1/3))) is CIF
True
sage: bool(diff(acot(x), x) == -diff(atan(x), x))
True
sage: diff(acot(x), x)
Expand Down Expand Up @@ -752,6 +768,10 @@ def __init__(self):
0.52359877559829887307710723055
sage: float(arccsc(2))
0.52359877559829...
sage: asec(CIF(7/3))
1.127885282721258?
sage: parent(asec(CIF(7/3))) is CIF
True
sage: arccsc(1 + I)
arccsc(I + 1)
sage: diff(acsc(x), x)
Expand Down Expand Up @@ -810,6 +830,10 @@ def __init__(self):
NaN
sage: RDF(arcsec(2)) # abs tol 1e-15
1.0471975511965976
sage: acsc(CIF(7/3))
0.442911044073639?
sage: parent(acsc(CIF(7/3))) is CIF
True
sage: arcsec(1 + I)
arcsec(I + 1)
sage: diff(asec(x), x)
Expand Down

0 comments on commit 0dad6ad

Please sign in to comment.