x \cdot \log \left(\frac{x}{y}\right) - z
\mathsf{fma}\left(x, 2 \cdot \log \left(\frac{\sqrt[3]{x}}{\sqrt[3]{y}}\right), x \cdot \log \left(\frac{\sqrt[3]{\sqrt[3]{x} \cdot \left(\sqrt[3]{x} \cdot \sqrt[3]{x}\right)}}{\sqrt[3]{y}}\right)\right) - z
(FPCore (x y z) :precision binary64 (- (* x (log (/ x y))) z))
(FPCore (x y z) :precision binary64 (- (fma x (* 2.0 (log (/ (cbrt x) (cbrt y)))) (* x (log (/ (cbrt (* (cbrt x) (* (cbrt x) (cbrt x)))) (cbrt y))))) z))
double code(double x, double y, double z) {
return (x * log(x / y)) - z;
}
double code(double x, double y, double z) {
return fma(x, (2.0 * log(cbrt(x) / cbrt(y))), (x * log(cbrt(cbrt(x) * (cbrt(x) * cbrt(x))) / cbrt(y)))) - z;
}




Bits error versus x




Bits error versus y




Bits error versus z
| Original | 14.7 |
|---|---|
| Target | 7.5 |
| Herbie | 0.2 |
Initial program 14.7
Applied add-cube-cbrt_binary6414.7
Applied add-cube-cbrt_binary6414.7
Applied times-frac_binary6414.7
Applied log-prod_binary643.7
Applied distribute-rgt-in_binary643.7
Simplified0.2
Simplified0.2
Applied fma-def_binary640.2
Applied add-cbrt-cube_binary640.2
Final simplification0.2
herbie shell --seed 2021313
(FPCore (x y z)
:name "Numeric.SpecFunctions.Extra:bd0 from math-functions-0.1.5.2"
:precision binary64
:herbie-target
(if (< y 7.595077799083773e-308) (- (* x (log (/ x y))) z) (- (* x (- (log x) (log y))) z))
(- (* x (log (/ x y))) z))