TITLE: A 1,400 years old approximation to the sine function by Mahabhaskariya of Bhaskara I
QUESTION [244 upvotes]: The approximation $$\sin(x) \simeq \frac{16 (\pi -x) x}{5 \pi ^2-4 (\pi -x) x}\qquad (0\leq x\leq\pi)$$ was proposed by Mahabhaskariya of Bhaskara I, a seventh-century Indian mathematician.
I wondered how much this could be improved using our computers and so I tried (very immodestly) to see if we could do better using $$\sin(x) \simeq \frac{a (\pi -x) x}{5 \pi ^2-b (\pi -x) x}$$ I so computed $$\Phi(a,b)=\int_0^{\pi} \left(\sin (x)-\frac{a (\pi -x) x}{5 \pi ^2-b (\pi -x)x}\right)^2 dx$$ the analytical expression of which not being added to the post. Settings the derivatives equal to $0$ and solving for $a$ and $b$, I arrived to $a=15.9815,b=4.03344$ so close to the original approximation !
What is interesting is to compare the values of $\Phi$ : $2.98 \times 10^{-6}$ only decreased to $2.17 \times 10^{-6}$. Then, no improvement and loss of attractive coefficients.
Now, since this is a matter of etiquette on this site, I ask a simple question: 

with all the tools and machines we have in our hands, could any of our community propose something as simple (or almost) for basic trigonometric functions ?

In the discussions, I mentioned one I made (it is probable that I reinvented the wheel) in the same spirit $$\cos(x) \simeq\frac{\pi ^2-4x^2}{\pi ^2+x^2}\qquad (-\frac \pi 2 \leq x\leq\frac \pi 2)$$  which is amazing too !

REPLY [2 votes]: I would like to add an addendum to @BeaumontTaz's wonderful derivation of the approximation, because I think I have a very simple answer to user @kaka's comment "What is the intuition behind scaling of $x(\pi−x)$ by dividing with $p(x)$, and not by some multiplicative function ?". The key prerequisite to this approximation is I think the knowledge of the five nicest/simplest values of the sine function on $[0,\pi]$, namely $\sin(0) = 0, \sin(\frac \pi 6) = \frac 12, \sin(\frac \pi 2) = 1, \sin (\frac{5\pi}6) = \frac 12, \sin (\pi) = 0$. It is no surprise that these values were known to Bhaskara I in the 7th century, as all the values are rational (none of that square-rooty business that apocryphally got someone killed), and can be easily derived through the 30-60-90 triangle.
Anyways, as BeaumontTaz did, the first order of business is to approximate using the zeroes, so $f(x)= x (\pi-x)$. Then obviously, we want $f(\frac \pi 2) = \sin (\frac \pi 2) = 1$, so the easiest thing we could do is scale by $\frac 1{f(\pi/2)}$ and get the approximation
$$a_1(x) = \frac{x(\pi-x)}{f(\pi/2)}.$$
This is not too good of an approximation, so we hope to do better. Lucky for us, we still have two pieces of information left! We want our approximation to agree with $\sin x$ at $x = \frac \pi6, \frac{5\pi}6$ as well. So at $x=\frac \pi6$, we would need to scale by $\frac{\sin(\pi/6)}{f(\pi/6)} = \frac{1}{2f(\pi/6)}$, and similarly at $x= \frac{5\pi}6$ we would scale by $\frac{\sin(5\pi/6)}{f(5\pi/6)} = \frac{1}{2f(5\pi/6)}$. In summary, at $x = \frac \pi6, \frac \pi2, \frac{5\pi}6$ respectively, we would like to divide by $2f(\pi/6), f(\pi/2), 2f(5\pi/6)$ respectively, i.e. we have a "scaling function" $s(x)$ that we divide by that we have pinned down at three values, and an approximation $a(x) = \frac{f(x)}{s(x)}$. What's the easiest way to extend a function defined at three points? Well, there is exactly one parabola passing through those three points, and parabolas are very easy to deal with, so let us simply take $s(x)$ to be the parabola passing those three points.
So we see that the reason it is "more natural" to divide by the scaling instead of multiplying like @kaka suggested was because in this problem the first idea we had of scaling was in the form of a division ("priming our mind for division"), and all the scaling factors looked like $\frac{1}{\text{something}}$, and it is easier to deal with/look at interpolation at points $(\frac \pi 6, 2f(\frac \pi 6)), (\frac \pi 2, f(\frac \pi2)), (\frac{5\pi}6, 2f(\frac{5\pi}6))$ than interpolation at points $(\frac \pi 6, \frac{1}{2f(\frac \pi 6)}), (\frac \pi 2, \frac{1}{f(\frac \pi2)}), (\frac{5\pi}6, \frac1{2f(\frac{5\pi}6)})$. Said another way, when we want to "renormalize" $f(\frac \pi 6)$ to $\frac 12$, I think people naturally think "divide by $f(\frac \pi 6)$ to normalize to 1, and then divide by 2/multiply by $\frac 12$ to get to $\frac 12$", i.e. the idea of "normalization to 1" is "more naturally" thought of as a division rather than a multiplication by reciprocal.
I do think aesthetics/simplicity play some role in formulas like these (they were written out in verses in Sanskrit), and the formula for the parabola passing through $(\frac \pi 6, 2f(\frac \pi 6)), (\frac \pi 2, f(\frac \pi2)), (\frac{5\pi}6, 2f(\frac{5\pi}6))$ is much nicer (especially if we write things in terms of degrees instead of radians) than the formula for the parabola passing through $(\frac \pi 6, \frac{1}{2f(\frac \pi 6)}), (\frac \pi 2, \frac{1}{f(\frac \pi2)}), (\frac{5\pi}6, \frac1{2f(\frac{5\pi}6)})$ (taking reciprocals in the latter case messes up things quite a lot). Indeed explicitly writing out the interpolation w.r.t. the first and second set of points in degrees, we have $s_1(x) = \frac{1}{4}x^{2}-45x+10125$ and $s_2(x)=-\frac{1}{291600000}x^{2}+\frac{1}{1620000}x+\frac{31}{324000}$; you can visualize them here: https://www.desmos.com/calculator/aiqcjbbcn2.
I hope this answer gave a little bit more details to the "naturality" of dividing by scaling factors (and the "naturality" of the entire construction/approximation --- basically I argue that the formula in Claude's question is the simplest and most reasonable approximation given exactly the five "trivial" values of $\sin x$), and didn't just repeat what people already knew.