Related: Ellipse circumference
Introduction
An ellipsoid (Wikipedia / MathWorld) is a 3D object analogous to an ellipse on 2D. Its shape is defined by three principal semi-axes \$a,b,c\$:
$$ \frac{x^2}{a^2} + \frac{y^2}{b^2} + \frac{z^2}{c^2} = 1 $$
Just like an ellipse, the volume of an ellipsoid is easy, but its surface area does not have an elementary formula. Even Ramanujan won't save you here.
The basic formula is given as the following:
$$ S = 2\pi c^2 + \frac{2\pi ab}{\sin\varphi} \left( E(\varphi,k) \sin^2\varphi + F(\varphi,k) \cos^2\varphi \right) \\ \text{where }\cos\varphi = \frac{c}{a},\quad k^2 = \frac{a^2(b^2-c^2)}{b^2(a^2-c^2)},\quad a \ge b \ge c $$
\$F\$ and \$E\$ are incomplete elliptic integral of the first kind and second kind respectively. Note that the formula does not work for a sphere.
A good approximation can be found on this archived page, where Knud Thomsen developed a symmetrical formula of
$$ S \approx 4\pi \left(\frac{a^p b^p + b^p c^p + c^p a^p} {3 - k\left(1-27abc/\left(a+b+c\right)^3\right)}\right)^{\frac{1}{p}} $$
with empirical values of \$p=\frac{\ln 2}{\ln (\pi/2)}\$ and \$k=3/32\$.
Challenge
Given the three principal semi-axes \$a,b,c\$ of an ellipsoid, compute its surface area.
All three input values are guaranteed to be positive, and you can use any reasonable representation of a real number for input. Also, you may assume the three values are given in a certain order (increasing or decreasing).
The result must be within 0.1% (=10-3) relative error for the given test cases. You can go for the exact formula (if your language has the necessary built-ins) or Thomsen's approximation, or you can go for numerical integration (extra brownie points if you succeed in this way).
Test cases
The true answer was calculated by feeding the corresponding ellipsoid equation into WolframAlpha.
a b c => answer
------------------
1 1 1 => 12.5664
1 1 2 => 21.4784
1 2 2 => 34.6875
1 1 10 => 99.151
1 2 3 => 48.8821
1 10 10 => 647.22
1 3 10 => 212.00