8000 BUG: log1p output has less precision for the real part of small complex inputs · Issue #21105 · numpy/numpy · GitHub
[go: up one dir, main page]

Skip to content

BUG: log1p output has less precision for the real part of small complex inputs #21105

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
vmagno opened this issue Feb 22, 2022 · 1 comment
Closed
Labels

Comments

@vmagno
Copy link
vmagno commented Feb 22, 2022

Describe the issue:

The real part of the output of numpy.log1p is rounded down to zero when the real part of a complex input is less than about 1e-15. This does not occur for the imaginary part of a complex input/output, or when the input is real.
For example:

>>> import numpy as np
>>> np.log1p(1e-14 + 1e-14j)
(9.992007221626358e-15+9.9999999999999e-15j)
>>> np.log1p(1e-16 + 1e-16j)
1e-16j
>>> np.log1p(1e-16)
1e-16
>>> np.log1p(1e-16j)
1e-16j

This occurs on Linux with numpy version 1.22.2, and python version 3.10.2

Reproduce the code example:

import numpy as np
np.log1p(1e-14 + 1e-14j)
np.log1p(1e-16 + 1e-16j)
np.log1p(1e-16)
np.log1p(1e-16j)

Error message:

No response

NumPy/Python version information:

1.22.2 3.10.2 (main, Jan 15 2022, 19:56:27) [GCC 11.1.0]

@seberg
Copy link
Member
seberg commented Nov 19, 2022

Identical to the newer gh-22609, closing this one as there is some activity.

@seberg seberg closed this as completed Nov 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants
0