MathGroup Archive 2006

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Precision of arguments to FunctionInterpolation

  • To: mathgroup at smc.vnet.net
  • Subject: [mg68393] Re: Precision of arguments to FunctionInterpolation
  • From: "Andrew Moylan" <andrew.j.moylan at gmail.com>
  • Date: Thu, 3 Aug 2006 06:07:25 -0400 (EDT)
  • References: <eakeg1$r1j$1@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

Here is some further information that makes the strangeness more
obvious:

The following three different calls to FunctionInterpolation all fail:

 FunctionInterpolation[lowPrecisionSin[x], {x, 0, 1.`14}]
 FunctionInterpolation[lowPrecisionSin[x], {x, 0, 1.`20}]
 FunctionInterpolation[lowPrecisionSin[x], {x, 0, 1}]

The only way that I can successfully interpolate to an upper bound of
roughly 1 is by entering the upper bound as the
exactly-machine-precision number "1.":

  FunctionInterpolation[lowPrecisionSin[x], {x, 0, 1.}]

Can anyone explain why higher-than-machine-precision (e.g. 1.`20),
lower-than-machine-precision (e.g. 1.`14), and infinite precision (1)
all fail, but exactly machine-precision succeeds here?

Secondly, does anyone know the meaning of the InterpolationPrecision
option to FunctionInterpolation? In particular, with the default
setting of InterpolationPrecision->Automatic, what value is
automatically chosen?


Andrew Moylan wrote:
> Hi,
>
> Can someone help me understand an unexpected dependence of
> FunctionInterpolation on the precision of its second argument?
>
> Here is function that behaves like a low-precision version of Sin:
>
>   lowPrecisionSin[x_?NumericQ] := SetPrecision[Sin[x], 5]
>
> I can create an interpolation of this function thus:
>
>   FunctionInterpolation[lowPrecisionSin[x], {x, 0, 1.}]
>
> This quickly successfully returns: InterpolatingFunction[{{0., 1.}},
> <>]
>
> If I instead try to create an interpolation of this function thus:
>
>   FunctionInterpolation[lowPrecisionSin[x], {x, 0, 1.`14}]
>
> where the only difference is in the precision of the upper bound of the
> range of interpolation, FunctionInterpolation fails to return quickly,
> and it reports warnings like the following:
>
>   FunctionInterpolation::ncvb: FunctionInterpolation failed to meet the
> \
> prescribed accuracy and precision goals after 6 recursive bisections
> near x = \
> 0.015625`13.154901959985743. Continuing to refine elsewhere.
>
> Note that this behaviour is unchanged if I add the options e.g.
> "PrecisionGoal -> 5, InterpolationPrecision -> 14" to each call to
> FunctionInterpolation. But the behaviour _does_ depend on the precision
> of lowPrecisionSin: if I change "5" to "10" in the definition of
> lowPrecisionSin, the problem disappears.
>
> Can anyone explain this apparently strange behaviour?
> 
> Cheers,
> 
> Andrew


  • Prev by Date: Re: Zero times a variable in numerical calculations
  • Next by Date: Re: "No more memory available" -- a recurring problem
  • Previous by thread: Re: Pattern match question
  • Next by thread: Re: Precision of arguments to FunctionInterpolation