diff options
Diffstat (limited to 'boost/math/special_functions/detail/t_distribution_inv.hpp')
-rw-r--r-- | boost/math/special_functions/detail/t_distribution_inv.hpp | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/boost/math/special_functions/detail/t_distribution_inv.hpp b/boost/math/special_functions/detail/t_distribution_inv.hpp index 72f6f0c646..e8bd0db28f 100644 --- a/boost/math/special_functions/detail/t_distribution_inv.hpp +++ b/boost/math/special_functions/detail/t_distribution_inv.hpp @@ -56,9 +56,9 @@ T inverse_students_t_hill(T ndf, T u, const Policy& pol) } else { - y = ((1 / (((ndf + 6) / (ndf * y) - 0.089f * d - 0.822f) + y = static_cast<T>(((1 / (((ndf + 6) / (ndf * y) - 0.089f * d - 0.822f) * (ndf + 2) * 3) + 0.5 / (ndf + 4)) * y - 1) - * (ndf + 1) / (ndf + 2) + 1 / y; + * (ndf + 1) / (ndf + 2) + 1 / y); } q = sqrt(ndf * y); @@ -144,41 +144,41 @@ T inverse_students_t_body_series(T df, T u, const Policy& pol) // only on the degrees of freedom (Eq 57 of Shaw): // T in = 1 / df; - c[2] = 0.16666666666666666667 + 0.16666666666666666667 * in; - c[3] = (0.0083333333333333333333 * in + c[2] = static_cast<T>(0.16666666666666666667 + 0.16666666666666666667 * in); + c[3] = static_cast<T>((0.0083333333333333333333 * in + 0.066666666666666666667) * in - + 0.058333333333333333333; - c[4] = ((0.00019841269841269841270 * in + + 0.058333333333333333333); + c[4] = static_cast<T>(((0.00019841269841269841270 * in + 0.0017857142857142857143) * in + 0.026785714285714285714) * in - + 0.025198412698412698413; - c[5] = (((2.7557319223985890653e-6 * in + + 0.025198412698412698413); + c[5] = static_cast<T>((((2.7557319223985890653e-6 * in + 0.00037477954144620811287) * in - 0.0011078042328042328042) * in + 0.010559964726631393298) * in - + 0.012039792768959435626; - c[6] = ((((2.5052108385441718775e-8 * in + + 0.012039792768959435626); + c[6] = static_cast<T>(((((2.5052108385441718775e-8 * in - 0.000062705427288760622094) * in + 0.00059458674042007375341) * in - 0.0016095979637646304313) * in + 0.0061039211560044893378) * in - + 0.0038370059724226390893; - c[7] = (((((1.6059043836821614599e-10 * in + + 0.0038370059724226390893); + c[7] = static_cast<T>((((((1.6059043836821614599e-10 * in + 0.000015401265401265401265) * in - 0.00016376804137220803887) * in + 0.00069084207973096861986) * in - 0.0012579159844784844785) * in + 0.0010898206731540064873) * in - + 0.0032177478835464946576; - c[8] = ((((((7.6471637318198164759e-13 * in + + 0.0032177478835464946576); + c[8] = static_cast<T>(((((((7.6471637318198164759e-13 * in - 3.9851014346715404916e-6) * in + 0.000049255746366361445727) * in - 0.00024947258047043099953) * in + 0.00064513046951456342991) * in - 0.00076245135440323932387) * in + 0.000033530976880017885309) * in - + 0.0017438262298340009980; - c[9] = (((((((2.8114572543455207632e-15 * in + + 0.0017438262298340009980); + c[9] = static_cast<T>((((((((2.8114572543455207632e-15 * in + 1.0914179173496789432e-6) * in - 0.000015303004486655377567) * in + 0.000090867107935219902229) * in @@ -186,8 +186,8 @@ T inverse_students_t_body_series(T df, T u, const Policy& pol) + 0.00051406605788341121363) * in - 0.00036307660358786885787) * in - 0.00031101086326318780412) * in - + 0.00096472747321388644237; - c[10] = ((((((((8.2206352466243297170e-18 * in + + 0.00096472747321388644237); + c[10] = static_cast<T>(((((((((8.2206352466243297170e-18 * in - 3.1239569599829868045e-7) * in + 4.8903045291975346210e-6) * in - 0.000033202652391372058698) * in @@ -196,7 +196,7 @@ T inverse_students_t_body_series(T df, T u, const Policy& pol) + 0.00035764655430568632777) * in - 0.00010230378073700412687) * in - 0.00036942667800009661203) * in - + 0.00054229262813129686486; + + 0.00054229262813129686486); // // The result is then a polynomial in v (see Eq 56 of Shaw): // @@ -285,7 +285,7 @@ T inverse_students_t(T df, T u, T v, const Policy& pol, bool* pexact = 0) // T a = 4 * (u - u * u);//1 - 4 * (u - 0.5f) * (u - 0.5f); T b = boost::math::cbrt(a); - static const T c = 0.85498797333834849467655443627193; + static const T c = static_cast<T>(0.85498797333834849467655443627193L); T p = 6 * (1 + c * (1 / b - 1)); T p0; do{ |