x \cdot \log \left(\frac{x}{y}\right) - z\left(x \cdot \left(\log \left(\sqrt[3]{x} \cdot \sqrt[3]{x}\right) - \log \left(\sqrt[3]{y} \cdot \sqrt[3]{y}\right)\right) + x \cdot \log \left(\frac{\sqrt[3]{x}}{\sqrt[3]{y}}\right)\right) - zdouble f(double x, double y, double z) {
double r343971 = x;
double r343972 = y;
double r343973 = r343971 / r343972;
double r343974 = log(r343973);
double r343975 = r343971 * r343974;
double r343976 = z;
double r343977 = r343975 - r343976;
return r343977;
}
double f(double x, double y, double z) {
double r343978 = x;
double r343979 = cbrt(r343978);
double r343980 = r343979 * r343979;
double r343981 = log(r343980);
double r343982 = y;
double r343983 = cbrt(r343982);
double r343984 = r343983 * r343983;
double r343985 = log(r343984);
double r343986 = r343981 - r343985;
double r343987 = r343978 * r343986;
double r343988 = r343979 / r343983;
double r343989 = log(r343988);
double r343990 = r343978 * r343989;
double r343991 = r343987 + r343990;
double r343992 = z;
double r343993 = r343991 - r343992;
return r343993;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 15.4 |
|---|---|
| Target | 8.1 |
| Herbie | 0.3 |
Initial program 15.4
rmApplied add-cube-cbrt15.4
Applied add-cube-cbrt15.4
Applied times-frac15.4
Applied log-prod3.7
Applied distribute-lft-in3.7
rmApplied add-exp-log3.7
Applied add-exp-log3.8
Applied div-exp3.8
Applied rem-log-exp0.3
Final simplification0.3
herbie shell --seed 2019212 +o rules:numerics
(FPCore (x y z)
:name "Numeric.SpecFunctions.Extra:bd0 from math-functions-0.1.5.2"
:precision binary64
:herbie-target
(if (< y 7.59507779908377277e-308) (- (* x (log (/ x y))) z) (- (* x (- (log x) (log y))) z))
(- (* x (log (/ x y))) z))