# Changes between Version 6 and Version 7 of research/trigTweet

Ignore:
Timestamp:
Oct 14, 2011, 12:16:42 PM (9 years ago)
Comment:

--

### Legend:

Unmodified
 v6 }}} We know sin(x) is an odd function, so instead we look for a polynomial Q(x) such that P(x) = xQ(x²): We know sin(x) is an odd function, so instead we look for a polynomial Q(x) such that P(x) = xQ(x²), and we reduce the range to positive values: {{{ #!latex $\max_{x \in [-\pi/2, \pi/2]}{\big\vert\sin(x) - xQ(x^2)\big\vert} = E$ $\max_{x \in [0, \pi/2]}{\big\vert\sin(x) - xQ(x^2)\big\vert} = E$ }}} Substitute y for x² and reduce the range to positive values: Substitute y for x²: {{{ {{{ #!cpp static real myfun(real const &y) { a6 = -7.36458957326227991327065122848667046e-13; }}} === Relative error === Searching for '''relative error''' instead: {{{ #!latex $\max_{x \in [-\pi/2, \pi/2]}{\dfrac{\big\vert\sin(x) - P(x)\big\vert}{|\sin(x)|}} = E$ }}} Using the same method as for absolute error, we get: {{{ #!latex $\max_{x \in [0, \pi^2/4]}{\dfrac{\bigg\lvert\dfrac{\sin(\sqrt{y})-\sqrt{y}}{y\sqrt{y}} - R(y)\bigg\rvert}{\bigg\lvert\dfrac{\sin(y)}{y\sqrt{y}}\bigg\rvert}} = E$ }}} {{{ #!cpp static real myfun(real const &y) { real x = sqrt(y); return (sin(x) - x) / (x * y); } static real myerr(real const &y) { real x = sqrt(y); return sin(x) / (x * y); } RemezSolver<6> solver; solver.Run(real::R_1 >> 400, real::R_PI_2 * real::R_PI_2, myfun, myerr, 15); }}} {{{ #!cpp a0 = -1.666666666666666587374325845020415990185e-1; a1 = +8.333333333333133768001243698120735518527e-3; a2 = -1.984126984109960366729319073763957206143e-4; a3 = +2.755731915499171528179303925040423384803e-6; a4 = -2.505209340355388148617179634180834358690e-8; a5 = +1.605725287696319345779134635418774782711e-10; a6 = -7.535968124281960435283756562793611388136e-13; }}}