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

Arithmetic advices for expm1 and hypot + others #258

Open
genmeblog opened this issue May 10, 2024 · 0 comments
Open

Arithmetic advices for expm1 and hypot + others #258

genmeblog opened this issue May 10, 2024 · 0 comments

Comments

@genmeblog
Copy link

genmeblog commented May 10, 2024

I've just found some advices in arithmetic which shouldn't be there.

(dec (exp x)) and (expm1 x) are not equivalent. expm1 is more precise near 0.0 but it shouldn't be treated as drop in replacement in every case. The same for hypot (which catches overflows and underflow).

Also (long (+ x 0.5)) fails on overflow while (Math/round) not. Catching overflow can be beneficial in some cases so I would be careful.

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

1 participant