Open fwip opened 3 years ago
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
∫(-2,2,(√(4-x^2))*(1/2+x^3*cos(x/2))dx)
We suppose to get the result pi
, which is 3.1415926535897
However, I got 3.1415340713
using Kalk
Is there something that can be improved in the future? Many thanks.
Hi, I encountered the same result just like this one
Given
∫(-2,2,(√(4-x^2))*(1/2+x^3*cos(x/2))dx)
We suppose to get the result
pi
, which is3.1415926535897
However, I got3.1415340713
using KalkIs there something that can be improved in the future? Many thanks.
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!
∫ (1/10000000, 1, ⌈x⌉, dx) 1.0004165666 # over one? should be 0.9999999
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: