Cosine power approximation to Gaussian density


Years ago I wrote about how you can make a decent approximation to the Gaussian density by shifting and scaling the cosine function. This observation dates back at least as far as 1961.

Turns out you can do even better by raising the cosine term to a power. Not only can you get a good approximation, you can get an upper and lower bound of the same form.

In [1] the authors prove the following. For −π/2 < x < π/2,

\left( \frac{1 + \cos x}{2}\right)^a \leq \exp(-x^2) \leq \left( \frac{1 + \cos x}{2}\right)^b

and

\left( \frac{2 + \cos x}{3}\right)^c \leq \exp(-x^2) \leq \left( \frac{2 + \cos x}{3}\right)^d

with the best possible constants

\begin{align*} a &= 4 \\ b &= (\pi/2)^2/\log(2) \approx 3.559707\\ c &= (\pi/2)^2 / \log(3/2) \approx 6.08536\\ d &= 6 \end{align*}

When the authors say “best” they mean best with respect to L2 norm, i.e. best the the least-squares sense.

The graph at the top of the page plots exp(−x²) as solid blue line, the first upper bound as a dotted green line, and the first lower bound as a dotted orange line. The blue and green lines blend into a single bluish-green line. You can barely see the orange line separate from the others. The curves are difficult to distinguish visually, which is the point.

The second pair of upper and lower bounds are even better. Here’s a plot of the errors for the second pair of bounds.

gaps in bounds

Note that the theorem is stated for the interval [−π/2, π/2], but the plot covers a wider range in order to show that the errors are still small outside the interval. Outside the specified interval, the lower bound error becomes positive, i.e. the lower bound is no longer a lower bound, though it’s still a good approximation.

[1] Yogesh J. Bagul and Christophe Chesneau. Some sharp circular and hyperbolic bounds of exp(−x²) with applications. Applicable Analysis and Discrete Mathematics, Vol. 14, No. 1 (April 2020), pp. 239–254