\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467001\right) + \frac{\left(\left(y + 7.93650079365100015 \cdot 10^{-4}\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.0833333333333329956}{x}\begin{array}{l}
\mathbf{if}\;\left(\left(y + 7.93650079365100015 \cdot 10^{-4}\right) \cdot z - 0.0027777777777778\right) \cdot z \le 8.37321655534011972 \cdot 10^{233}:\\
\;\;\;\;\left(\left(x - 0.5\right) \cdot \log \left(\sqrt[3]{x} \cdot \sqrt[3]{x}\right) + \left(\left(\log \left(\sqrt[3]{x}\right) \cdot \left(x - 0.5\right) - x\right) + 0.91893853320467001\right)\right) + \frac{\left(\left(y + 7.93650079365100015 \cdot 10^{-4}\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.0833333333333329956}{x}\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467001\right) + \frac{1}{\left(0.400000000000006406 \cdot \left(x \cdot z\right) + 12.000000000000048 \cdot x\right) - 0.100952278095241613 \cdot \left(x \cdot {z}^{2}\right)}\\
\end{array}double code(double x, double y, double z) {
return (((((x - 0.5) * log(x)) - x) + 0.91893853320467) + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x));
}
double code(double x, double y, double z) {
double VAR;
if ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) <= 8.37321655534012e+233)) {
VAR = ((((x - 0.5) * log((cbrt(x) * cbrt(x)))) + (((log(cbrt(x)) * (x - 0.5)) - x) + 0.91893853320467)) + ((((((y + 0.0007936500793651) * z) - 0.0027777777777778) * z) + 0.083333333333333) / x));
} else {
VAR = (((((x - 0.5) * log(x)) - x) + 0.91893853320467) + (1.0 / (((0.4000000000000064 * (x * z)) + (12.000000000000048 * x)) - (0.10095227809524161 * (x * pow(z, 2.0))))));
}
return VAR;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 5.9 |
|---|---|
| Target | 1.2 |
| Herbie | 6.2 |
if (* (- (* (+ y 0.0007936500793651) z) 0.0027777777777778) z) < 8.37321655534012e+233Initial program 1.7
rmApplied add-cube-cbrt1.8
Applied log-prod1.8
Applied distribute-lft-in1.8
Applied associate--l+1.8
Applied associate-+l+1.8
Simplified1.8
if 8.37321655534012e+233 < (* (- (* (+ y 0.0007936500793651) z) 0.0027777777777778) z) Initial program 40.2
rmApplied clear-num40.2
Taylor expanded around 0 43.6
Final simplification6.2
herbie shell --seed 2020100
(FPCore (x y z)
:name "Numeric.SpecFunctions:$slogFactorial from math-functions-0.1.5.2, B"
:precision binary64
:herbie-target
(+ (+ (+ (* (- x 0.5) (log x)) (- 0.91893853320467 x)) (/ 0.083333333333333 x)) (* (/ z x) (- (* z (+ y 0.0007936500793651)) 0.0027777777777778)))
(+ (+ (- (* (- x 0.5) (log x)) x) 0.91893853320467) (/ (+ (* (- (* (+ y 0.0007936500793651) z) 0.0027777777777778) z) 0.083333333333333) x)))