FunctionInterpolation [expr,{x,xmin,xmax}]
evaluates expr with x running from xmin to xmax and constructs an InterpolatingFunction object which represents an approximate function corresponding to the result.
FunctionInterpolation [expr,{x,xmin,xmax},{y,ymin,ymax},…]
constructs an InterpolatingFunction object with several arguments.
FunctionInterpolation [expr,{x,y}∈Ω]
constructs an InterpolatingFunction object over the region Ω.
FunctionInterpolation
FunctionInterpolation [expr,{x,xmin,xmax}]
evaluates expr with x running from xmin to xmax and constructs an InterpolatingFunction object which represents an approximate function corresponding to the result.
FunctionInterpolation [expr,{x,xmin,xmax},{y,ymin,ymax},…]
constructs an InterpolatingFunction object with several arguments.
FunctionInterpolation [expr,{x,y}∈Ω]
constructs an InterpolatingFunction object over the region Ω.
Details and Options
- You can use FunctionInterpolation to generate a single InterpolatingFunction object from an expression containing several such objects.
- The syntax {x,xmin,xmax},… creates a structured InterpolatingFunction .
- Using a region specification {x,…}∈Ω creates an unstructured InterpolatingFunction .
- FunctionInterpolation over regions can be constructed in 1D, 2D and 3D.
- Unstructured FunctionInterpolation is based on the finite element method.
- The following options can be given:
-
- For structured interpolations, the InterpolationOrder can be arbitrary.
- For unstructured interpolations, the InterpolationOrder can be 1 or 2.
- The default InterpolationOrder :
-
structured unstructured
- For structured interpolations, derivatives can be specified to improve accuracy.
- The error goal for structured interpolation is less than where is the AccuracyGoal , is the PrecisionGoal and the expression.
Examples
open all close allBasic Examples (2)
Compute an InterpolatingFunction representation of Exp [-Sin [x]^2]:
Use the resulting function as any function:
Compute an InterpolatingFunction representation of yExp [-Sin [x]^2] over a Disk region:
Use the resulting function like any function:
Scope (7)
Approximate a function over a structured domain:
Plot the function:
Specify a region for function interpolation:
Use the resulting interpolating function like any function:
Specify a region discretization for function interpolation:
Use the resulting interpolating function like any function:
Approximate a function over a structured 4D domain:
Plot a cross section of the function:
Create a 3D domain:
Approximate a function over an unstructured 3D domain:
Visualize the InterpolatingFunction :
Use a CSGRegion as a region specification:
Create an InterpolatingFunction over the CSGRegion :
Visualize the result:
Use derivatives to improve the smoothness of the approximation:
Options (6)
MaxRecursion (1)
The default settings are insufficient to meet the prescribed accuracy and precision goals in this example:
Increase the maximum recursion limit to fix the issue:
AccuracyGoal (1)
Create a FunctionInterpolation with a specific AccuracyGoal and PrecisionGoal :
Create an error plot, showing in gold the accuracy and precision goal and in blue the error.
InterpolationOrder (3)
Compute an InterpolatingFunction representation of Exp [-Sin [x]^2]:
Plot the difference between the function and the interpolation:
Compute an InterpolatingFunction representation of Exp [-Sin [x]^2] with an increased InterpolationOrder :
Plot the difference between the function and the interpolation:
Use different interpolation orders in different directions for structured interpolation:
The interpolation order has an effect on how many sample points are needed. Create two function interpolations:
The interpolation order 4 needs fewer interpolation points than the interpolation order 1:
Visualize the accuracy and precision goal of the two interpolations:
PrecisionGoal (1)
Create a FunctionInterpolation with a specific AccuracyGoal and PrecisionGoal :
Create an error plot, showing in gold the accuracy and precision goal and in blue the error:
Applications (6)
Basic Applications (4)
Compute the inverse of a function by working with its interpolation:
Using InverseFunction gives the inverse:
Look at a more complicated function:
Use interpolation to easily find its inverse:
Create evenly spaced points on a curve. Define a function:
When function fun is seen as the position of a particle in time, then the magnitude of the velocity in time can be expressed as:
The antiderivative of this function gives the distance covered as a function of time:
This is a monotonically increasing function, so it can be inverted:
Using the inverse, generate the times at which the point passes through the equally spaced points:
Visualize the equally spaced points:
Define a function that integrates over a and create a FunctionInterpolation over the parameter :
Visualize the result:
Verify the result:
Create a function interpolation for an antiderivative:
Visualize the result:
Region Interpolation (2)
Create an InterpolatingFunction over a Disk :
Use the function as the right-hand side in a partial differential equation:
Visualize the solution of the equation:
Create a 3D CSGRegion :
Construct the interpolating function of an expression over that region:
Visualize the function:
Properties & Relations (2)
Plot the difference between a structured and an unstructured interpolating function:
Plot the difference between a structured and a refined unstructured interpolating function:
Possible Issues (4)
The dimensionality of the region and the embedding dimension need to match:
The region dimension of this Circle is:
There are two variables {x,y}, and as such, a region with embedding dimension two needs to be specified:
The dimensionality of the independent variables and the region need to match:
The region dimension of this Line is:
There are two variables {x,y}, and as such, a two-dimensional region needs to be specified:
It is not enough that the embedding dimensionality of the independent variables and the region match:
The region embedding dimension of this Line is:
The region dimension of this Line is:
There are two variables {x,y}, and as such, a two-dimensional region needs to be specified:
The default recursion limit of FunctionInterpolation may not always be sufficient:
Increase the maximum recursion limit:
An alternative is to increase the sampling frequency:
Tech Notes
Related Guides
History
Introduced in 1996 (3.0) | Updated in 2025 (14.3)
Text
Wolfram Research (1996), FunctionInterpolation, Wolfram Language function, https://reference.wolfram.com/language/ref/FunctionInterpolation.html (updated 2025).
CMS
Wolfram Language. 1996. "FunctionInterpolation." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2025. https://reference.wolfram.com/language/ref/FunctionInterpolation.html.
APA
Wolfram Language. (1996). FunctionInterpolation. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/FunctionInterpolation.html
BibTeX
@misc{reference.wolfram_2025_functioninterpolation, author="Wolfram Research", title="{FunctionInterpolation}", year="2025", howpublished="\url{https://reference.wolfram.com/language/ref/FunctionInterpolation.html}", note=[Accessed: 17-November-2025]}
BibLaTeX
@online{reference.wolfram_2025_functioninterpolation, organization={Wolfram Research}, title={FunctionInterpolation}, year={2025}, url={https://reference.wolfram.com/language/ref/FunctionInterpolation.html}, note=[Accessed: 17-November-2025]}