Smooth Convex Interpolation

Smooth convex interpolation in 1D

Place values and gradients, then see whether an L-smooth, μ-strongly convex function passes through all of them.

Click empty space to add a point. Drag a marker to move it, or drag an end of its dashed tangent to turn the gradient. Double-click a marker to delete it. With the chart focused, arrow keys move the selected point and [ ] turn its gradient.

Selected point

Function class

Presets

Interpolant shown

All interpolants lie between these two.

Editing

Limits appear while dragging: in green, where the point can go with its gradient kept, or the gradients it can take where it stands.

Theorem (Taylor, Hendrickx, Glineur, 2017). Let 0 ≤ μ < L ≤ +∞. There exists an L-smooth, μ-strongly convex function f with f(xi) = fi and f ′(xi) = gi for all i ∈ I if and only if, for every pair i, j ∈ I,

fi ≥ fj + gj(xi − xj) + 12(1 − μ/L) ( 1L (gi − gj)² + μ (xi − xj)² − 2 μL (gi − gj)(xi − xj) ).

The same condition is used here for negative μ, where it describes L-smooth functions whose curvature stays above μ. Pairs that break it are joined in red on the chart.

Create from function

Points are evenly spaced and take the function's value and derivative. They replace the current points, and the chart window is fitted to them. You can use + − * / ^, sin, cos, tan, exp, log, sqrt, abs, tanh, cosh, sinh, atan, pi and e.