2 ms·
But this is the case for the polynomial approximation to just about anything. The individual terms yield wildly different numbers that cancel each other out, an
by kazinator 7y ago
But this is the case for the polynomial approximation to just about anything. The individual terms yield wildly different numbers that cancel each other out, and individually they approximate the desired function poorly.
As a joke, a few years ago I created a polynomial approximation for Fibonacci.
fib(9) suddenly goes beserk and calculates the answer to life, the universe and everything!
https://news.ycombinator.com/item?id=14331627 https://news.ycombinator.com/item?id=14331627
- meuk 7y agoYou should approximate it with an exponential function. Actually, the nth Fibonacci can be obtained exactly by rounding an exponential function: https://en.wikipedia.org/wiki/Fibonacci_number#Computation_by_rounding https://en.wikipedia.org/wiki/Fibonacci_number#Computation_b...
- kazinator 7y agoI'm well aware of the closed form for Fibonacci since my undergrad days. This was produced as a kind of joke. I simply took the first several, plus 42 thrown in, and fit them to an N-th degree polynomial.