Skip to content

mp.asin is inaccurate for small complex inputs #787

@pearu

Description

@pearu

As in the title.

Reproducer:

>>> mpmath.mp.asin(mpmath.mpc(0, 1e-22))
mpc(real='0.0', imag='0.0')
>>> mpmath.fp.asin(mpmath.mpc(0, 1e-22))  # expected result
1e-22j

A workaround is to increase precision:

>>> mpmath.mp.prec=80
>>> mpmath.mp.asin(mpmath.mpc(0, 1e-22))
mpc(real='0.0', imag='9.9999996826552253889673883e-23')

Points z=x+yj in the following (approximate) region

|x| < |y| < 1e-19

of the complex plane suffer from the defect reported here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugan unexpected problem or unintended behavior

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions