I'd like to understand why one of these inputs gives me an error and the other doesn't:
s1 =
NDSolve[
{x'[t] == x[t], x[0] == SetPrecision[1., 10]},
{x}, {t, 0, 1},
WorkingPrecision -> $MachinePrecision
][[1]]
NDSolve::precw: The precision of the differential equation ({{(x^[Prime])[t]==x[t],x[0]==1.000000000},{},{},{},{}}) is less than WorkingPrecision (15.954589770191003`). >>
(* Out: {x -> InterpolatingFunction[{{0, 1.000000000000000}}, <>]} *)
versus
s2 =
NDSolve[
{x'[t] == x[t], x[0] == SetPrecision[1., 10]},
{x}, {t, 0, 1},
WorkingPrecision -> MachinePrecision
][[1]]
(* Out: {x -> InterpolatingFunction[{{0., 1.}}, <>]} *)
Notice that the only difference is the fact that $MachinePrecision got changed to MachinePrecision. Also, oddly enough, the resulting answers are not identical:
x1[t_] = Evaluate[x[t] /. s1];
x2[t_] = Evaluate[x[t] /. s2];
Plot[x1[t] - x2[t], {t, 0, 1}]

$MachinePrecisionin the current version of Mathematica forces the (admittedly counterintuitive in this case) use of the arbitrary-precision numerics.MachinePrecisionis the right setting to use if you want to stay within machine precision computations, but you do run the risk of hitting instabilities if you are the unlucky sort. – J. M.'s missing motivation Jun 08 '16 at 05:13SetPrecision[1., 10]is unfortunate in the former case, since10 < $MachinePrecision, which is why you get the error observed. – J. M.'s missing motivation Jun 08 '16 at 05:24$MachinePrecisionis the number of digits of precision that is roughly equivalent to running a native machine-precision calculation on your system. You can evaluate it, and it will return a real number, on my system for instance ca. 15.9. Now think of it this way:WorkingPrecision -> someNumberforces the use of the arbitrary precision engine, withsomeNumberdigits of precision. ... – MarcoB Jun 08 '16 at 06:22WorkingPrecision -> $MachinePrecisiontriggers the use of the arbitrary precision system, with a number of digits of precision that mimics the native machine's precision, but now with error tracking thanks to the arbitrary precision engine. A comparative example can be found in the "Possible Issues" section of the docs on$MachinePrecision. – MarcoB Jun 08 '16 at 06:24$MachinePrecisionevaluates to that number (15.9..), I fully expect thatWorkingPrecision -> 15.9546andWorkingPrecision -> $MachinePrecisionwill lead to the same results on your machine. – MarcoB Jun 08 '16 at 17:32