x \cdot \log \left(\frac{x}{y}\right) - zx \cdot \log \left(\frac{1}{\sqrt[3]{y} \cdot \sqrt[3]{y}}\right) + \left(\left(\left(\log \left(\frac{\sqrt[3]{x}}{\sqrt[3]{\sqrt[3]{y}}}\right) + \log \left(\frac{\sqrt[3]{x}}{\sqrt[3]{\sqrt[3]{y}}}\right)\right) + \log \left(\frac{\sqrt[3]{x}}{\sqrt[3]{\sqrt[3]{y}}}\right)\right) \cdot x - z\right)double f(double x, double y, double z) {
double r17941883 = x;
double r17941884 = y;
double r17941885 = r17941883 / r17941884;
double r17941886 = log(r17941885);
double r17941887 = r17941883 * r17941886;
double r17941888 = z;
double r17941889 = r17941887 - r17941888;
return r17941889;
}
double f(double x, double y, double z) {
double r17941890 = x;
double r17941891 = 1.0;
double r17941892 = y;
double r17941893 = cbrt(r17941892);
double r17941894 = r17941893 * r17941893;
double r17941895 = r17941891 / r17941894;
double r17941896 = log(r17941895);
double r17941897 = r17941890 * r17941896;
double r17941898 = cbrt(r17941890);
double r17941899 = cbrt(r17941893);
double r17941900 = r17941898 / r17941899;
double r17941901 = log(r17941900);
double r17941902 = r17941901 + r17941901;
double r17941903 = r17941902 + r17941901;
double r17941904 = r17941903 * r17941890;
double r17941905 = z;
double r17941906 = r17941904 - r17941905;
double r17941907 = r17941897 + r17941906;
return r17941907;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 15.3 |
|---|---|
| Target | 7.8 |
| Herbie | 0.3 |
Initial program 15.3
rmApplied add-cube-cbrt15.3
Applied *-un-lft-identity15.3
Applied times-frac15.3
Applied log-prod4.7
Applied distribute-lft-in4.8
Applied associate--l+4.8
rmApplied add-cube-cbrt4.8
Applied add-cube-cbrt4.8
Applied times-frac4.8
Applied log-prod0.3
Simplified0.3
Final simplification0.3
herbie shell --seed 2019172 +o rules:numerics
(FPCore (x y z)
:name "Numeric.SpecFunctions.Extra:bd0 from math-functions-0.1.5.2"
:herbie-target
(if (< y 7.595077799083773e-308) (- (* x (log (/ x y))) z) (- (* x (- (log x) (log y))) z))
(- (* x (log (/ x y))) z))