Function approximation with Maclaurin series
- by marines
I need to approx (1-x)^0.25 with given accuracy (0.0001 e.g.). I'm using expansion found on Wikipedia for (1+x)^0.25. I need to stop approximating when current expression is less than the accuracy.
long double s(long double x, long double d) {
long double w = 1;
long double n = 1; // nth expression in series
long double tmp = 1;
…