\frac{\left(x - 2\right) \cdot \left(\left(\left(\left(x \cdot 4.16438922227999964 + 78.6994924154000017\right) \cdot x + 137.51941641600001\right) \cdot x + y\right) \cdot x + z\right)}{\left(\left(\left(x + 43.3400022514000014\right) \cdot x + 263.50507472100003\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606000001}\begin{array}{l}
\mathbf{if}\;x \le -3.86740450779857118 \cdot 10^{31} \lor \neg \left(x \le 3.96292524545208809 \cdot 10^{49}\right):\\
\;\;\;\;\left(\frac{y}{{x}^{2}} + 4.16438922227999964 \cdot x\right) - 110.11392429848109\\
\mathbf{else}:\\
\;\;\;\;\left(x - 2\right) \cdot \frac{\left(\left(\sqrt[3]{{\left(\left(x \cdot 4.16438922227999964 + 78.6994924154000017\right) \cdot x\right)}^{3}} + 137.51941641600001\right) \cdot x + y\right) \cdot x + z}{\left(\left(\left(x + 43.3400022514000014\right) \cdot x + 263.50507472100003\right) \cdot x + 313.399215894\right) \cdot x + 47.066876606000001}\\
\end{array}double code(double x, double y, double z) {
return (((x - 2.0) * ((((((((x * 4.16438922228) + 78.6994924154) * x) + 137.519416416) * x) + y) * x) + z)) / (((((((x + 43.3400022514) * x) + 263.505074721) * x) + 313.399215894) * x) + 47.066876606));
}
double code(double x, double y, double z) {
double VAR;
if (((x <= -3.867404507798571e+31) || !(x <= 3.962925245452088e+49))) {
VAR = (((y / pow(x, 2.0)) + (4.16438922228 * x)) - 110.1139242984811);
} else {
VAR = ((x - 2.0) * ((((((cbrt(pow((((x * 4.16438922228) + 78.6994924154) * x), 3.0)) + 137.519416416) * x) + y) * x) + z) / (((((((x + 43.3400022514) * x) + 263.505074721) * x) + 313.399215894) * x) + 47.066876606)));
}
return VAR;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 26.6 |
|---|---|
| Target | 0.6 |
| Herbie | 0.8 |
if x < -3.867404507798571e+31 or 3.962925245452088e+49 < x Initial program 60.0
Taylor expanded around inf 1.2
if -3.867404507798571e+31 < x < 3.962925245452088e+49Initial program 1.0
rmApplied *-un-lft-identity1.0
Applied times-frac0.4
Simplified0.4
rmApplied add-cbrt-cube0.5
Applied add-cbrt-cube0.5
Applied cbrt-unprod0.5
Simplified0.5
Final simplification0.8
herbie shell --seed 2020075
(FPCore (x y z)
:name "Numeric.SpecFunctions:logGamma from math-functions-0.1.5.2, C"
:precision binary64
:herbie-target
(if (< x -3.326128725870005e+62) (- (+ (/ y (* x x)) (* 4.16438922228 x)) 110.1139242984811) (if (< x 9.429991714554673e+55) (* (/ (- x 2) 1) (/ (+ (* (+ (* (+ (* (+ (* x 4.16438922228) 78.6994924154) x) 137.519416416) x) y) x) z) (+ (* (+ (+ (* 263.505074721 x) (+ (* 43.3400022514 (* x x)) (* x (* x x)))) 313.399215894) x) 47.066876606))) (- (+ (/ y (* x x)) (* 4.16438922228 x)) 110.1139242984811)))
(/ (* (- x 2) (+ (* (+ (* (+ (* (+ (* x 4.16438922228) 78.6994924154) x) 137.519416416) x) y) x) z)) (+ (* (+ (* (+ (* (+ x 43.3400022514) x) 263.505074721) x) 313.399215894) x) 47.066876606)))