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

What to do with underflows when constituent would otherwise not underflow #141

Open
ckormanyos opened this issue Jan 28, 2023 · 0 comments

Comments

@ckormanyos
Copy link
Member

ckormanyos commented Jan 28, 2023

This curiously named issue relates to some of the discussions raised in #140.

In that issue we identified a test case:

// N[BesselK[-1000, 700], 51]
// 6.515619791447358189035538526063833129844093619841284E-31

At one point in the calculation of BesselK[-1000, 700], the value of exp(-700) is computed, which is approximately $9.86{\times}10^{-305}$. An exponent of $-305$ is out-of-range for cpp_double_fp< eight-byte-double >, hence eval_exp() returns $0$ which cascades to the final output being $0$ as well.

The result of the modified Bessel function is not an extreme edge-case, but getting to this result relies on edge-case (or near edge-case) multiplication.

What's the strategy on such calculations?

  • Take the result of $0$ which is actually correct for the intermediate steps?
  • Modify the scaling of the calculation? This seems like an overly-curated approach to handling the special functions calculations in Math.
  • Eliminate the test point from the test suite for this particular backend type?

I'm curious what John (@jzmaddock) might think.

Cc: @sinandredemption and @cosurgi

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