I'm testing the following code:
$Version
fRe[x_, σ_] = 1/(Sqrt[2 π] σ) Exp[-(x^2/(2σ^2))];
Integrate[fRe[x, σ]/(x - X), {x, -∞, ∞},
PrincipalValue -> True, Assumptions -> σ > 0 && X < 0]
On one machine (Core i7-4765T) I get this as output:
"9.0 for Linux x86 (32-bit) (November 20, 2012)"
-((Sqrt[2] DawsonF[X/(Sqrt[2] σ)])/σ)
On another machine (EEE PC 1015PN with Intel Atom N570) the result is different:
"9.0 for Linux x86 (32-bit) (November 20, 2012)"
E^(X^2/(2*σ^2))/(2*Sqrt[2*Pi]*σ)
(-EulerGamma + CoshIntegral[X^2/(2*σ^2)] - 2*Pi*Erfi[X/(Sqrt[2]*σ)] + Log[2] -
2*Log[-X] + 2*Log[σ] + SinhIntegral[X^2/(2*σ^2)] +
E^(X^2/(2*σ^2))*Derivative[1, 0, 0][Hypergeometric1F1][1, 1, -(X^2/(2*σ^2))])
On both machines Help->About Mathematica gives version number 9.0.0.0.
How is this possible? I'd expect something similar for numerical calculations due to CPU-specific optimized code paths which might lead to different precision for different CPUs, but this is purely symbolic integration, isn't it?
Integrate
, use various heuristics. They try one approach to solve the problem, work on it for a given amount of time, and if they don't succeed, they try something else. The fast machine might succeed in the allotted time, the slow one may not. These functions also cache partial results. Caching affects performance. This means that evaluating something multiple times will give different results. $\endgroup$ – Szabolcs May 20 '16 at 7:47