Opened 8 years ago
Closed 7 years ago
#16491 closed defect (fixed)
doctest trigonometric functions for complex input
Reported by:  Punarbasu Purkayastha  Owned by:  

Priority:  major  Milestone:  sage7.2 
Component:  symbolics  Keywords:  
Cc:  Burcin Erocal, KarlDieter Crisman, Ralf Stephan  Merged in:  
Authors:  Ralf Stephan  Reviewers:  Vincent Delecroix 
Report Upstream:  N/A  Work issues:  
Branch:  5e18f34 (Commits, GitHub, GitLab)  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 8 years ago by
Description:  modified (diff) 

comment:2 Changed 8 years ago by
Milestone:  sage6.3 → sage6.4 

comment:3 Changed 8 years ago by
Summary:  Fix output of trigonometric functions for complex input → unify output of trigonometric functions for complex input 

comment:4 Changed 7 years ago by
Milestone:  sage6.4 → sageduplicate/invalid/wontfix 

Status:  new → 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:6 Changed 7 years ago by
Branch:  → u/rws/unify_output_of_trigonometric_functions_for_complex_input 

comment:7 Changed 7 years ago by
Authors:  → Ralf Stephan 

Commit:  → 5e18f344b2016d6e7eea64c06d398017da851761 
Milestone:  sageduplicate/invalid/wontfix → sage7.2 
Summary:  unify output of trigonometric functions for complex input → doctest trigonometric functions for complex input 
New commits:
5e18f34  16491: doctest complex trig functions

comment:8 Changed 7 years ago by
Reviewers:  → Vincent Delecroix 

Status:  needs_review → positive_review 
comment:9 Changed 7 years ago by
Branch:  u/rws/unify_output_of_trigonometric_functions_for_complex_input → 5e18f344b2016d6e7eea64c06d398017da851761 

Resolution:  → fixed 
Status:  positive_review → closed 
Note: See
TracTickets for help on using
tickets.
Everything except point 2 seems to be fixed so I'm changing the title.