Bug introduced in 8 or earlier and persisting through 11.0.1 or later
In the help page ref/message/FunctionInterpolation/ncvb
, it is mentioned that one should specify AccuracyGoal
for some (even very simple) functions:
FunctionInterpolation[Sqrt[x], {x, 0, 1}, AccuracyGoal -> 2]
However, when I evaluate it, a lot of error messages are generated, such as
Thread::tdlen: Objects of unequal length in {-(1/8),-(1/24),1/24,1/8}^{} cannot be combined. FunctionInterpolation::nreal: "Near x = 1/8, the function did not evaluate to a real number.
Also, the precision I got is very bad (as one can check using Plot[%[x] - Sqrt[x], {x, 0, 1}, PlotRange -> All]
). The error is about 5% so not usable for realistic work (and the situation does not change when I increase AccuracyGoal).
Is it a bug? Perhaps I have to do Interpolation
or ListInterpolation
by hand myself.
$Version
"9.0 for Linux x86 (64-bit) (February 7, 2013)"
PS: I found this thread may be related but still different FunctionInterpolation Errors / Question re Evaluation Order and Options