Skip to main content

Timeline for Speed up this NIntegrate

Current License: CC BY-SA 4.0

7 events
when toggle format what by license comment
May 4, 2019 at 23:09 comment added eyorble @m137 Yes, you can use PrecisionGoal to lower NIntegrate's tolerances if you don't need the precision. If PrecisionGoal -> 4 isn't quite what you meant, it's still a speed up for PrecisionGoal -> 5, just less dramatic. They turn out to get the same result for this problem.
May 4, 2019 at 23:06 history edited eyorble CC BY-SA 4.0
Since precision can be low, we can use PrecisionGoal.
May 4, 2019 at 20:36 comment added m137 @eyorble thanks, your answer is super useful. The speed up is amazing. P.S. For the final result I care to have a precision of at most 10^-5, can this be useful to make it even faster?
May 4, 2019 at 17:30 comment added CA Trevillian Ah yes, I agree with this view definitely. Mt silencing suggestion comes from my normal use of internal implementations of functions I (usually) know enough about to either ignore the message with silence, or because it is an internal function, there is a slowdown associated with the message being outputted during evaluation, and then it just doesn't look very pretty when its being printed out in the middle of my outputs.
May 4, 2019 at 17:24 comment added eyorble I didn't explicitly clear the cache, but it's about the same speed on a completely fresh kernel. While the convergence rate error can be silenced, I would highly recommend not doing so, as that's putting a band-aid over the limitations of the numerical methods. I'd much rather the reminder that the result may not be perfectly accurate than be lulled into a false sense of security by Quiet.
May 4, 2019 at 17:19 comment added CA Trevillian Wow! Question: Did you clear the cache before you ran the second result? If so, I LOVE the speed-up we get when we tell the computer just a liiiiiittle bit more about our problem, instead of letting it think everything about it on its own! And Nice catch on the set-delayed, I did not even notice!!! @m137, if you're running this a lot, for many different functional inputs, then accessing them again multiple times, memoization will valuable, as for the convergence rate (barring some group misunderstanding on our parts) just silence the message from being outputted.
May 4, 2019 at 17:10 history answered eyorble CC BY-SA 4.0