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

Question about absolute error in NestedRule #13

Open
e-eight opened this issue Jul 31, 2024 · 1 comment
Open

Question about absolute error in NestedRule #13

e-eight opened this issue Jul 31, 2024 · 1 comment
Labels
question Further information is requested

Comments

@e-eight
Copy link

e-eight commented Jul 31, 2024

Nice package! I am trying to implement some custom quadrature rules using quadax. I was trying to understand how you are computing the absolute error in NestedRule:

abserr = jnp.where(
    (integral_mmn != 0.0) & (abserr != 0.0),
    integral_mmn * jnp.minimum(1.0, (200.0 * abserr / integral_mmn) ** 1.5),
    abserr,
)
abserr = jnp.where(
    (integral_abs > uflow / (50.0 * eps)),
    jnp.maximum((eps * 50.0) * integral_abs, abserr),
    abserr,
)

Where are you getting the numbers 200.0, 1.5, and 50.0 from?

@f0uriest
Copy link
Owner

f0uriest commented Aug 8, 2024

These were mostly taken from the fortran library QUADPACK (for which the documentation is rather sparse for things like this). My understanding is that they are heuristic values meant to compensate for floating point errors and possible under/overflow.

I think for most reasonably "well behaved" integrands this sort of stuff isn't necessary, so you can probably omit it.

@f0uriest f0uriest added the question Further information is requested label Dec 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants