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 -4.702036921833592 \cdot 10^{+67}:\\
\;\;\;\;x + y \cdot \left(\left(3.13060547623 + \frac{t}{z \cdot z}\right) - \frac{36.527041698806414}{z}\right)\\
\mathbf{elif}\;z \leq 4.974259772593562 \cdot 10^{+39}:\\
\;\;\;\;x + y \cdot \frac{z \cdot \left(\left(\sqrt[3]{z} \cdot \sqrt[3]{z}\right) \cdot \left(\sqrt[3]{z} \cdot \left(t + z \cdot \left(z \cdot 3.13060547623 + 11.1667541262\right)\right)\right) + a\right) + b}{z \cdot \left(z \cdot \left(z \cdot \left(z + 15.234687407\right) + 31.4690115749\right) + 11.9400905721\right) + 0.607771387771}\\
\mathbf{else}:\\
\;\;\;\;x + \left(y \cdot 3.13060547623 + \frac{y}{z} \cdot \left(\frac{t}{z} + -36.527041698806414\right)\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 -4.702036921833592e+67)
(+ x (* y (- (+ 3.13060547623 (/ t (* z z))) (/ 36.527041698806414 z))))
(if (<= z 4.974259772593562e+39)
(+
x
(*
y
(/
(+
(*
z
(+
(*
(* (cbrt z) (cbrt z))
(* (cbrt z) (+ t (* z (+ (* z 3.13060547623) 11.1667541262)))))
a))
b)
(+
(*
z
(+ (* z (+ (* z (+ z 15.234687407)) 31.4690115749)) 11.9400905721))
0.607771387771))))
(+
x
(+ (* y 3.13060547623) (* (/ y z) (+ (/ t z) -36.527041698806414)))))))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 <= -4.702036921833592e+67) {
tmp = x + (y * ((3.13060547623 + (t / (z * z))) - (36.527041698806414 / z)));
} else if (z <= 4.974259772593562e+39) {
tmp = x + (y * (((z * (((cbrt(z) * cbrt(z)) * (cbrt(z) * (t + (z * ((z * 3.13060547623) + 11.1667541262))))) + a)) + b) / ((z * ((z * ((z * (z + 15.234687407)) + 31.4690115749)) + 11.9400905721)) + 0.607771387771)));
} else {
tmp = x + ((y * 3.13060547623) + ((y / z) * ((t / z) + -36.527041698806414)));
}
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.7 |
|---|---|
| Target | 0.9 |
| Herbie | 1.0 |
if z < -4.7020369218335918e67Initial program 63.1
rmApplied *-un-lft-identity_binary64_546963.1
Applied times-frac_binary64_547562.2
Simplified62.2
Simplified62.2
Taylor expanded around inf 0.5
Simplified0.5
if -4.7020369218335918e67 < z < 4.9742597725935623e39Initial program 2.8
rmApplied *-un-lft-identity_binary64_54692.8
Applied times-frac_binary64_54751.0
Simplified1.0
Simplified1.0
rmApplied add-cube-cbrt_binary64_55011.1
Applied associate-*l*_binary64_54121.1
Simplified1.1
if 4.9742597725935623e39 < z Initial program 60.4
Taylor expanded around inf 8.2
Simplified1.0
Final simplification1.0
herbie shell --seed 2020280
(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))))