x + \frac{y \cdot \left(\left(\left(\left(z \cdot 3.13060547623 + 11.1667541262\right) \cdot z + t\right) \cdot z + a\right) \cdot z + b\right)}{\left(\left(\left(z + 15.234687407\right) \cdot z + 31.4690115749\right) \cdot z + 11.9400905721\right) \cdot z + 0.607771387771}\begin{array}{l}
\mathbf{if}\;z \leq -1.5826630768290659 \cdot 10^{+59}:\\
\;\;\;\;x + \left(y \cdot 3.13060547623 + \left(\sqrt[3]{y} \cdot \sqrt[3]{y}\right) \cdot \left(\left(\frac{t}{z} + -36.527041698806414\right) \cdot \frac{\sqrt[3]{y}}{z}\right)\right)\\
\mathbf{elif}\;z \leq 2.6725087956259304 \cdot 10^{+43}:\\
\;\;\;\;x + \frac{y}{\frac{z \cdot \left(z \cdot \left(z \cdot \left(z + 15.234687407\right) + 31.4690115749\right) + 11.9400905721\right) + 0.607771387771}{z \cdot \left(z \cdot \left(t + z \cdot \left(z \cdot 3.13060547623 + 11.1667541262\right)\right) + a\right) + b}}\\
\mathbf{else}:\\
\;\;\;\;x + \left(y \cdot \left(3.13060547623 + \frac{t}{z \cdot z}\right) + -36.527041698806414 \cdot \frac{y}{z}\right)\\
\end{array}(FPCore (x y z t a b)
:precision binary64
(+
x
(/
(*
y
(+ (* (+ (* (+ (* (+ (* z 3.13060547623) 11.1667541262) z) t) z) a) z) b))
(+
(* (+ (* (+ (* (+ z 15.234687407) z) 31.4690115749) z) 11.9400905721) z)
0.607771387771))))(FPCore (x y z t a b)
:precision binary64
(if (<= z -1.5826630768290659e+59)
(+
x
(+
(* y 3.13060547623)
(*
(* (cbrt y) (cbrt y))
(* (+ (/ t z) -36.527041698806414) (/ (cbrt y) z)))))
(if (<= z 2.6725087956259304e+43)
(+
x
(/
y
(/
(+
(*
z
(+ (* z (+ (* z (+ z 15.234687407)) 31.4690115749)) 11.9400905721))
0.607771387771)
(+
(* z (+ (* z (+ t (* z (+ (* z 3.13060547623) 11.1667541262)))) a))
b))))
(+
x
(+
(* y (+ 3.13060547623 (/ t (* z z))))
(* -36.527041698806414 (/ y z)))))))double code(double x, double y, double z, double t, double a, double b) {
return x + ((y * ((((((((z * 3.13060547623) + 11.1667541262) * z) + t) * z) + a) * z) + b)) / (((((((z + 15.234687407) * z) + 31.4690115749) * z) + 11.9400905721) * z) + 0.607771387771));
}
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -1.5826630768290659e+59) {
tmp = x + ((y * 3.13060547623) + ((cbrt(y) * cbrt(y)) * (((t / z) + -36.527041698806414) * (cbrt(y) / z))));
} else if (z <= 2.6725087956259304e+43) {
tmp = x + (y / (((z * ((z * ((z * (z + 15.234687407)) + 31.4690115749)) + 11.9400905721)) + 0.607771387771) / ((z * ((z * (t + (z * ((z * 3.13060547623) + 11.1667541262)))) + a)) + b)));
} else {
tmp = x + ((y * (3.13060547623 + (t / (z * z)))) + (-36.527041698806414 * (y / z)));
}
return tmp;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t




Bits error versus a




Bits error versus b
Results
| Original | 29.3 |
|---|---|
| Target | 1.0 |
| Herbie | 1.1 |
if z < -1.58266307682907e59Initial program 62.1
Taylor expanded around inf 8.0
Simplified0.8
rmApplied *-un-lft-identity_binary64_109900.8
Applied add-cube-cbrt_binary64_110250.8
Applied times-frac_binary64_109960.8
Applied associate-*l*_binary64_109310.6
Simplified0.6
rmApplied div-inv_binary64_109870.6
Applied associate-*l*_binary64_109310.6
Simplified0.6
if -1.58266307682907e59 < z < 2.67250879562593e43Initial program 2.7
rmApplied associate-/l*_binary64_109351.2
Simplified1.2
if 2.67250879562593e43 < z Initial program 60.1
Taylor expanded around inf 8.5
Simplified1.2
rmApplied distribute-rgt-in_binary64_109401.2
Applied associate-+r+_binary64_109221.2
Simplified1.1
Final simplification1.1
herbie shell --seed 2020355
(FPCore (x y z t a b)
:name "Numeric.SpecFunctions:logGamma from math-functions-0.1.5.2, D"
:precision binary64
:herbie-target
(if (< z -6.499344996252632e+53) (+ x (* (+ (- 3.13060547623 (/ 36.527041698806414 z)) (/ t (* z z))) (/ y 1.0))) (if (< z 7.066965436914287e+59) (+ x (/ y (/ (+ (* (+ (* (+ (* (+ z 15.234687407) z) 31.4690115749) z) 11.9400905721) z) 0.607771387771) (+ (* (+ (* (+ (* (+ (* z 3.13060547623) 11.1667541262) z) t) z) a) z) b)))) (+ x (* (+ (- 3.13060547623 (/ 36.527041698806414 z)) (/ t (* z z))) (/ y 1.0)))))
(+ x (/ (* y (+ (* (+ (* (+ (* (+ (* z 3.13060547623) 11.1667541262) z) t) z) a) z) b)) (+ (* (+ (* (+ (* (+ z 15.234687407) z) 31.4690115749) z) 11.9400905721) z) 0.607771387771))))