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
Slightly inaccurate when integrating over floor/ceil. #30
Comments
Well, integration will often not be perfectly accurate, since functions can really vary a lot. Sometimes it's spot on, sometimes it's not. in this case, it looks like it's related to floating point numbers not being perfectly accurate, since it gets less accurate when you have numbers like 1/100000. This is the kind of thing I'm interested in making more accurate though, so this is a great example! It appears to be just slightly better (for me at least) on the desktop version, that is better at dealing with very large/very small numbers. Eventually, I'd like this to be the case for the web version as well, but the language it's written in (Rust) seems to lack a mature library for this. |
Makes sense, thank you for the quick reply! Please feel free to close this issue if it is not useful to you to have it open. :) |
Hi, I encountered the same result just like this one Given We suppose to get the result Is there something that can be improved in the future? |
Ah. Well, when it comes to more "complicated" ones like this, it may be difficult to get more accuracy. It can always be tweaked though, and maybe made more flexible. I'll look into it! |
I can't reproduce this, it says ≈ 1 for me. I think a good solution to this problem would be to add an optional parameter for the integrate function to set the accuracy. |
I'm not sure if this is a known limitation or something that should be an issue. I suspect it applies to all step-wise functions but I haven't checked.
This should be 1 exactly, but I suspect that the code falls back to numerical integration in these cases.
More examples:
The text was updated successfully, but these errors were encountered: