How to approximate a function

wind_factor(x)=evalpoly(1/x, (1.5949457323488772, 1518.919208108258, 104930.09322893005, -211416.6534637618, 1.3390365545830491e6, -5.705301564190215e6, 1.0384434802323304e7))/evalpoly(1/x, (1.0, 1092.3211847159544, 91063.22360243625))

here’s the absolute error: (and it runs in 3ns)
image

(found by using Remez; ratfn_minimax(x->wind_factor(1/x), (1/1000,1/6), 6, 2))

Note that this should probably assert that 6<x<1000 since it is off by .2 by the time x gets to 3, and it goes totally wack further outside the range.

7 Likes