Some functions treat arbitrary-precision numbers as above machine-precision numbers. They are different kinds of numbers. Exact numbers are above arbitrary-precision and machine-precision numbers. See the Numbers tech note for further discussion. So if in NonlinearModelFit[]
, you set WorkingPrecision
to any positive numeric expression other than the symbol MachinePrecision
and your data or model have machine-precision numbers in them, a warning message will be printed. It is a warning only. NonlinearModelFit[]
will convert the inputs to the appropriate precision. But if the inputs are of lower precision than the desired output, a warning seems appropriate.
(1a) One way to deal with it is to ignore it. (1b) This also ignores it and keeps the warning from being printed: Quiet[NonlinearModelFit[...], NonlinearModelFit::precw]
.
(2) Another way is to artificially raise the precision of the inputs. Jim Baldwin's suggestion, Rationalize[..., 0]
, converts the numbers to exactly rational numbers. SetPrecision[stuff, 6]
would set the argument stuff
to have a Precision
of 6
.
(3) You may have a reason for using WorkingPrecision -> 6
(round-off error tracking, for instance, except...†), but in most cases I've encountered, PrecisionGoal -> 3
and machine precision is faster and just as good.
†Note: Using a number for WorkingPrecision
does not guarantee error-tracking. Error-tracking in arbitrary-precision numbers can be overridden with $MinPrecision
and $MaxPrecision
. I'm not sure what NonlinearModelFit[]
does.