this uses "gaussian elimination" and "back substitution". the example finds a solution for 3 equations with 3 variables. both the code and example equations were taking from the wiki page on gaussian elimination.
earlier we stole a Padé approximated sine, so maybe we can make one
ourself?
it works pretty well. the P(x)/Q(x) coefficients are printed below the code; notice how half of them are zero when a=0 (again - we saw this back in the article on taylor series too). also, linsolve() fails sometimes, e.g. for N=M=3. not sure what's going on. judging by the polynomials in the previous best stolen sine, it has N=M=6, and if we use those parameters, we see the same max error.
how about log2
here i see max error about 0.00002 for N=3,M=2, while a 6th order Taylor series last time had an error of about 0.00007. N=3 suggests a 3rd order polynomial, but the numerator coefficients are still only second order for some reason (the coefficient for x**3 is zero). not sure what's going on here.