Skip to content

doctest trigonometric functions for complex input #16491

@ppurka

Description

@ppurka

This is a follow up to #16439.

  1. The functions atan, acos, asin give TypeError on Python complex input.

  2. The output of trigonometric functions are inconsistent depending on whether complex or CDF or CC 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.

CC: @burcin @kcrisman @rwst

Component: symbolics

Author: Ralf Stephan

Branch/Commit: 5e18f34

Reviewer: Vincent Delecroix

Issue created by migration from https://trac.sagemath.org/ticket/16491

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions