I would like to approximate the Fresnel S and Fresnel C with standard functions.
I've started with the $ S(x) $ function:
$$ approxS(x) = sgn(x) * \left ( sgn(x)* \left ( \frac{ \sin( \frac{x^2}{2} ) }{x} \right) + 0.5 \right ) $$
The result looks like this:
This is the FresnelS function:
The difference ( $ approxS(x) - S(x) $ ):
What do I wrong? How could I approximate it better?



According to https://en.wikipedia.org/wiki/Fresnel_integral, for large $x$, $S(x) =\sqrt{\dfrac{\pi}{2}}\left(\dfrac{sign(x)}{2} -(1+O(x^{-4}))\left(\dfrac{\cos(x^2)}{x\sqrt{2\pi}} +\dfrac{\sin(x^2)}{x^3\sqrt{8\pi}} \right)\right) $ and $C(x) =\sqrt{\dfrac{\pi}{2}}\left(\dfrac{sign(x)}{2} +(1+O(x^{-4}))\left(\dfrac{\sin(x^2)}{x\sqrt{2\pi}} +\dfrac{\cos(x^2)}{x^3\sqrt{8\pi}} \right)\right) $.
You can get the direct power series (good for small $x$) by expanding the integral term-by-term.
It might be interesting to see how close these are.