2
0
mirror of https://github.com/boostorg/math.git synced 2026-01-30 20:12:09 +00:00

ellint_3: rearrange special cases for better performance and to avoid redundant check.

Fixes https://github.com/boostorg/math/issues/197.
This commit is contained in:
jzmaddock
2019-05-13 19:16:00 +01:00
parent 143e20ed02
commit 63f09b4c30

View File

@@ -73,6 +73,9 @@ T ellint_pi_imp(T v, T phi, T k, T vc, const Policy& pol)
if(v == 1)
{
if (k == 0)
return tan(phi);
// http://functions.wolfram.com/08.06.03.0008.01
T m = k * k;
result = sqrt(1 - m * sphi * sphi) * tan(phi) - ellint_e_imp(phi, k, pol);
@@ -143,10 +146,6 @@ T ellint_pi_imp(T v, T phi, T k, T vc, const Policy& pol)
T vcr = sqrt(vc);
return atan(vcr * tan(phi)) / vcr;
}
else if(v == 1)
{
return tan(phi);
}
else
{
// v > 1: