Polynomial interpolation
Here&#x27;s some Clojure code I wrote for the Emmy computer algebra system that implements polynomial interpolation with a few different algorithms described in Numerical Recipes:<p><a href="https:&#x2F;&#x2F;github.com&#x2F;mentat-collective&#x2F;emmy&#x2F;blob&#x2F;main&#x2F;src&#x2F;emmy&#x2F;polynomial&#x2F;interpolate.cljc">https:&#x2F;&#x2F;github.com&#x2F;mentat-collective&#x2F;emmy&#x2F;blob&#x2F;main&#x2F;src&#x2F;emmy...</a><p>I discovered while writing this that I could express each of these algorithms as folds that consumed a stream of points, accumulating a progressively higher order polynomial.<p>Here&#x27;s the same sort of thing but for rational function interpolation: <a href="https:&#x2F;&#x2F;github.com&#x2F;mentat-collective&#x2F;emmy&#x2F;blob&#x2F;main&#x2F;src&#x2F;emmy&#x2F;rational_function&#x2F;interpolate.cljc">https:&#x2F;&#x2F;github.com&#x2F;mentat-collective&#x2F;emmy&#x2F;blob&#x2F;main&#x2F;src&#x2F;emmy...</a>