0

There are a lot of functions that are related to numerical computation of integrals, numerical solutions of algebraic/differential equations, etc. In such functions there a lot of different methods (for instance, NIntegrate and NDSolve contain many strategies/methods).

Question: Can I safely assume that these built-in functions and methods (to be more specific, consider NIntegrate and NDsolve , and their methods) are completely optimized and tuned? So, any attempt to realize this functions by hand is slower than existing realization?

To be more specific, let me consider the numerical solution of a differential equation with 4-th order Runge-Kutta method. In principle, I can realize by hand such scheme and perform the explicit performance comparison between my code and NDsolve with with Method->"ExplicitRungeKutta" but the question is more general.

Can anyone provide the references/examples where this question is discussed? My interest is mostly about NIntegrate and NDSolve, then about RandomFunction.

Artem Alexandrov
  • 803
  • 4
  • 11
  • 1
    I have managed to surpass Mathematica's speed dramatically by writing specialized C code. Mathematica's functions seem to be generic, but likely also written in C. Matching their speed by writing Mathematica code does not seem likely to me. – Roman Apr 02 '22 at 10:06
  • This is very interesting reading https://mathematica.stackexchange.com/questions/4700/shaving-the-last-50-ms-off-nminimize In short, sometimes you can but if you spend one week to shave 50 ms is it worth it for a few times use? – yarchik Apr 02 '22 at 10:06
  • I've written Mathematica code to surpass Mathematica's built-in functions. But I'm simply stating it's possible and do not wish to go into details. – josh Apr 02 '22 at 10:17
  • It depends heavily on just how much work has gone into optimizing the built in code in terms of algorithm(s) used, heuristics for switching methods and/or parameter values, etc. Difficult to give a general response. – Daniel Lichtblau Apr 02 '22 at 16:12

0 Answers0