\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}\begin{array}{l}
\mathbf{if}\;x \leq 3398719.205669345:\\
\;\;\;\;\left(\left(\sqrt[3]{\log x \cdot \left(x - 0.5\right)} \cdot \left(\sqrt[3]{\log x \cdot \left(x - 0.5\right)} \cdot \sqrt[3]{\log x \cdot \left(x - 0.5\right)}\right) - x\right) + 0.91893853320467\right) + \frac{z \cdot \left(\left(y + 0.0007936500793651\right) \cdot z - 0.0027777777777778\right) + 0.083333333333333}{x}\\
\mathbf{else}:\\
\;\;\;\;\left(0.91893853320467 + \left(\left(x - 0.5\right) \cdot \log \left(\sqrt[3]{x} \cdot \sqrt[3]{x}\right) + \left(\left(x - 0.5\right) \cdot \log \left(\sqrt[3]{x}\right) - x\right)\right)\right) + \left(\left(y + 0.0007936500793651\right) \cdot \left(z \cdot \frac{z}{x}\right) - 0.0027777777777778 \cdot \frac{z}{x}\right)\\
\end{array}(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
(if (<= x 3398719.205669345)
(+
(+
(-
(*
(cbrt (* (log x) (- x 0.5)))
(* (cbrt (* (log x) (- x 0.5))) (cbrt (* (log x) (- x 0.5)))))
x)
0.91893853320467)
(/
(+
(* z (- (* (+ y 0.0007936500793651) z) 0.0027777777777778))
0.083333333333333)
x))
(+
(+
0.91893853320467
(+
(* (- x 0.5) (log (* (cbrt x) (cbrt x))))
(- (* (- x 0.5) (log (cbrt x))) x)))
(-
(* (+ y 0.0007936500793651) (* z (/ z x)))
(* 0.0027777777777778 (/ z x))))))double code(double x, double y, double z) {
return ((double) (((double) (((double) (((double) (((double) (x - 0.5)) * ((double) log(x)))) - x)) + 0.91893853320467)) + (((double) (((double) (((double) (((double) (((double) (y + 0.0007936500793651)) * z)) - 0.0027777777777778)) * z)) + 0.083333333333333)) / x)));
}
double code(double x, double y, double z) {
double tmp;
if ((x <= 3398719.205669345)) {
tmp = ((double) (((double) (((double) (((double) (((double) cbrt(((double) (((double) log(x)) * ((double) (x - 0.5)))))) * ((double) (((double) cbrt(((double) (((double) log(x)) * ((double) (x - 0.5)))))) * ((double) cbrt(((double) (((double) log(x)) * ((double) (x - 0.5)))))))))) - x)) + 0.91893853320467)) + (((double) (((double) (z * ((double) (((double) (((double) (y + 0.0007936500793651)) * z)) - 0.0027777777777778)))) + 0.083333333333333)) / x)));
} else {
tmp = ((double) (((double) (0.91893853320467 + ((double) (((double) (((double) (x - 0.5)) * ((double) log(((double) (((double) cbrt(x)) * ((double) cbrt(x)))))))) + ((double) (((double) (((double) (x - 0.5)) * ((double) log(((double) cbrt(x)))))) - x)))))) + ((double) (((double) (((double) (y + 0.0007936500793651)) * ((double) (z * (z / x))))) - ((double) (0.0027777777777778 * (z / x)))))));
}
return tmp;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 5.9 |
|---|---|
| Target | 1.2 |
| Herbie | 0.4 |
if x < 3398719.20566934487Initial program Error: 0.2 bits
rmApplied add-cube-cbrtError: 0.2 bits
SimplifiedError: 0.2 bits
SimplifiedError: 0.2 bits
if 3398719.20566934487 < x Initial program Error: 10.1 bits
rmApplied add-cube-cbrtError: 10.1 bits
Applied log-prodError: 10.2 bits
Applied distribute-lft-inError: 10.2 bits
Applied associate--l+Error: 10.1 bits
Taylor expanded around inf Error: 10.2 bits
SimplifiedError: 0.5 bits
Final simplificationError: 0.4 bits
herbie shell --seed 2020203
(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)))