Skip to content
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

BUG: irr function inconsistent behavior on different cpu architecture #131

Open
siqi-he opened this issue Oct 20, 2024 · 1 comment
Open

Comments

@siqi-he
Copy link

siqi-he commented Oct 20, 2024

Describe the issue:

Hi, I noticed that npf.irr function could return different results on different cpus in some cases. The results would match if i run irr function more than once. Please see example below.

Reproduce the code example:

python -c "import numpy_financial as npf; amount = 37155; month_count = 144; monthly_payment = 560; npf.irr([-amount] + [monthly_payment] * int(month_count));  print(npf.irr([-amount] + [monthly_payment] * int(month_count)))"

python -c "import numpy_financial as npf; amount = 37155; month_count = 144; monthly_payment = 560; print(npf.irr([-amount] + [monthly_payment] * int(month_count)))"

Error message:

On aws ec2 6i instance with Intel Ice Lake, I got the following:
0.01258179635558565
0.01258179635558565

On aws ec2 7i instance with Intel Sapphire Rapids, I got the following:
0.01258179635558565
0.006850691458678115

Runtime information:

1.23.5
3.10.14 | packaged by conda-forge | (main, Mar 20 2024, 12:45:18) [GCC 12.3.0]

Context for the issue:

No response

@TCYTseven
Copy link

Fixed this in Pull Request 132

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants