\left(\left(\left(x - 0.5\right) \cdot \log x - x\right) + 0.91893853320467\right) + \frac{\left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) \cdot z + 0.083333333333333}{x}\left(\left(\log \left(\sqrt[3]{x} \cdot \sqrt[3]{x}\right) \cdot \left(x - 0.5\right) + \left(\left(x - 0.5\right) \cdot \log \left({x}^{0.3333333333333333}\right) - x\right)\right) + 0.91893853320467\right) + \left(\left(\frac{0.083333333333333}{x} + \left(z \cdot \frac{z}{x}\right) \cdot \left(0.0007936500793651 + y\right)\right) - \frac{z}{x} \cdot 0.0027777777777778\right)(FPCore (x y z)
:precision binary64
(+
(+ (- (* (- x 0.5) (log x)) x) 0.91893853320467)
(/
(+
(* (- (* (+ y 0.0007936500793651) z) 0.0027777777777778) z)
0.083333333333333)
x)))(FPCore (x y z)
:precision binary64
(+
(+
(+
(* (log (* (cbrt x) (cbrt x))) (- x 0.5))
(- (* (- x 0.5) (log (pow x 0.3333333333333333))) x))
0.91893853320467)
(-
(+ (/ 0.083333333333333 x) (* (* z (/ z x)) (+ 0.0007936500793651 y)))
(* (/ z x) 0.0027777777777778))))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) {
return (((log(cbrt(x) * cbrt(x)) * (x - 0.5)) + (((x - 0.5) * log(pow(x, 0.3333333333333333))) - x)) + 0.91893853320467) + (((0.083333333333333 / x) + ((z * (z / x)) * (0.0007936500793651 + y))) - ((z / x) * 0.0027777777777778));
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 6.0 |
|---|---|
| Target | 1.2 |
| Herbie | 0.3 |
Initial program 6.0
Taylor expanded around 0 6.2
Simplified4.2
rmApplied *-un-lft-identity_binary64_109904.2
Applied times-frac_binary64_109960.3
Simplified0.3
rmApplied add-cube-cbrt_binary64_110250.3
Applied log-prod_binary64_110760.4
Applied distribute-rgt-in_binary64_109400.4
Applied associate--l+_binary64_109270.3
Simplified0.3
rmApplied pow1/3_binary64_110720.3
Final simplification0.3
herbie shell --seed 2021091
(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)))