3
$\begingroup$

I was working on an approximation for the sine function, in which I needed to calculate the maximum error to work on a compensation polynomial. My approximation was this:

$f(x) = \frac {4} {\pi^2} x (\pi - |x|)$

Then, obviously the error is found by substracting that from $\sin(x)$. In order to find the x-coordinate of the maximum error I took the derivative and and set it equal to zero.

$\begin{align*} \mathrm{err}(x) &= \sin(x) -f(x)\\ \mathrm{err}'(x) &= \cos(x) + \frac {8} {\pi^2}|x| - \frac 4 {\pi} \\ \mathrm{err}'(x) &= 0 \rightarrow \cos(x) = \frac 4 \pi - \frac 8 {\pi^2}|x| \end{align*}$

But I'm only a highschool student and I have no knowledge of the maths required to solve that last equation, if possible. How would one go into solving that last equation exactly?

A small image:

enter image description here


For my particular purpose it would suffice by calculating the value numerically and continue, but just purely for interest I'd like to know the exact value. Not homework.

  • 0
    @bgins: that's exactly what I do, but I've also added a second polynomial that boosts accuracy a lot. My code can be found here: https://gist.github.com/18552602012-02-17

0 Answers 0