Safe Haskell | None |
---|---|
Language | Haskell2010 |
Lagrange interpolation
Synopsis
- lagrangeInterp :: KnownSymbol var => [(Rational, Rational)] -> Univariate Rational var
- lagrangePoly :: KnownSymbol var => [Rational] -> Int -> Univariate Rational var
Lagrange interpolation
lagrangeInterp :: KnownSymbol var => [(Rational, Rational)] -> Univariate Rational var Source #
The Lagrange interpolation for a list of (x_i,y_i)
pairs: the resulting polynomial P
is the one with minimal degree for which P(x_i) = y_i
lagrangePoly :: KnownSymbol var => [Rational] -> Int -> Univariate Rational var Source #
The minimal degree polynomial which evaluates to zero at the given inputs, except a single one on which it evaluates to 1