This paper presents a method to approximate $sin(x)$ with high precision and relatively low computational cost. The approximation employs a straightforward polynomial transformation. Specifically, it uses the cubic $3x^2-2x^3$, also known as $smoothstep$, to approximate $sin(x)$ in a limited domain.
sin(x) in green, h(x) in blue and sin(x) - h(x) in red.
To better approximate $sin(x)$ using $h(x)$, we first need to define a new function, $g(x)$, where $g(x) = h(x) \cdot n + m$.
Take two values $x_1$and $x_2$ from the range $[0,\frac{\pi}{2}]$ where $x_2\geq x_1$
Solve for $n$ and $m$ in the equations $g(x_1)=sin(x_1)$ and $g(x_2)=sin(x_2)$. Then, $g(x)\approx sin(x)$ for the range $[x_1, x_2]$.
Solving the equations:
$$ g(x_1)=sin(x_1)\\ h(x_1)\cdot n+m=sin(x_1)\\ m=sin(x_1)-h(x_1)\cdot n\\ \\\ \\ g(x_2)=sin(x_2)\\ h(x_2)\cdot n+m=sin(x_2)\\ h(x_2)\cdot n+sin(x_1)-h(x_1)\cdot n=sin(x_2)\\ (h(x_2)-h(x_1))n=sin(x_2)-sin(x_1)\\ n=\frac{sin(x_2)-sin(x_1)}{h(x_2)-h(x_1)}\\ $$
An interesting fact is that the precision of the approximation depends on the difference between $x_1$ and $x_2$. When this difference is small, the precision is remarkably high within the range $[x_1,x_2]$, but considerably low outside this range.
The graphs from the previous image have been dashed, g(x) is in orange and sin(x)-g(x) is the non dashed red line. The two values chosen were pi/3 for x1 and x1 + 0.1 for x2.
As a standalone process this method does not produce remarkable results, When you consider the need to calculate the sines of $x_1$and $x_2$.
To enhance the efficacy of this method, we could divide the range $[0, \frac{\pi}{2}]$ into a collection, $S$, and pré compute the sines of each element within this collection. Once we have these pré calculated sine values, we can use them to perform interpolation of $sin(x)$ between the elements of $S$.
This strategy leverages the computational power of pré computation, where we calculate the sine values of the elements of $S$ beforehand rather than in real-time.
Using this method we can achieve a highly precise approximation of $sin(x)$ but with the additional cost of pré computing and storing the sines for $S$.