Opened 5 years ago
Closed 3 years ago
#16491 closed defect (fixed)
doctest trigonometric functions for complex input
Reported by:  ppurka  Owned by:  

Priority:  major  Milestone:  sage7.2 
Component:  symbolics  Keywords:  
Cc:  burcin, kcrisman, rws  Merged in:  
Authors:  Ralf Stephan  Reviewers:  Vincent Delecroix 
Report Upstream:  N/A  Work issues:  
Branch:  5e18f34 (Commits)  Commit:  5e18f344b2016d6e7eea64c06d398017da851761 
Dependencies:  Stopgaps: 
Description (last modified by )
This is a follow up to #16439.
 The functions
atan, acos, asin
giveTypeError
on Pythoncomplex
input.
 The output of trigonometric functions are inconsistent depending on whether
complex
orCDF
orCC
is used as the input type.
From #16439 discussion by @kcrisman:
Just one point  almost certainly some of those digits are 'extra' from Python. Compare (after this):
sage: sec(1.+i) 0.498337030555187 + 0.591083841721045*I sage: sec(complex(1,1)) (0.49833703055518686+0.5910838417210451j) sage: sec(CDF(complex(1,1))) 0.498337030555 + 0.591083841721*I
Interesting.
Here is something else I don't know what to do with.
sage: arccot(1.+i) arccot(1.00000000000000 + 1.00000000000000*I) # in SR sage: cot(1.+i) 0.217621561854403  0.868014142895925*I
One would think this should be the same type of output.
That said, SR is useful for some other cases of exact input.
I'm wondering whether we want to try to fix all of this here, though.
Change History (9)
comment:1 Changed 5 years ago by
 Description modified (diff)
comment:2 Changed 5 years ago by
 Milestone changed from sage6.3 to sage6.4
comment:3 Changed 4 years ago by
 Summary changed from Fix output of trigonometric functions for complex input to unify output of trigonometric functions for complex input
comment:4 Changed 3 years ago by
 Milestone changed from sage6.4 to sageduplicate/invalid/wontfix
 Status changed from new to needs_review
I get now:
sage: arccot(1.+i) 0.553574358897045  0.402359478108525*I sage: cot(1.+i) 0.217621561854403  0.868014142895925*I
So this seems fixed.
comment:5 Changed 3 years ago by
What about adding doctests?
comment:6 Changed 3 years ago by
 Branch set to u/rws/unify_output_of_trigonometric_functions_for_complex_input
comment:7 Changed 3 years ago by
 Commit set to 5e18f344b2016d6e7eea64c06d398017da851761
 Milestone changed from sageduplicate/invalid/wontfix to sage7.2
 Summary changed from unify output of trigonometric functions for complex input to doctest trigonometric functions for complex input
New commits:
5e18f34  16491: doctest complex trig functions

comment:8 Changed 3 years ago by
 Reviewers set to Vincent Delecroix
 Status changed from needs_review to positive_review
comment:9 Changed 3 years ago by
 Branch changed from u/rws/unify_output_of_trigonometric_functions_for_complex_input to 5e18f344b2016d6e7eea64c06d398017da851761
 Resolution set to fixed
 Status changed from positive_review to closed
Note: See
TracTickets for help on using
tickets.
Everything except point 2 seems to be fixed so I'm changing the title.