x \cdot \log \left(\frac{x}{y}\right) - z\left(x \cdot \left(2 \cdot \log \left(\frac{\sqrt[3]{x}}{\sqrt[3]{y}}\right)\right) + \log \left(\frac{\sqrt[3]{x}}{\sqrt[3]{y}}\right) \cdot x\right) - zdouble f(double x, double y, double z) {
double r168686 = x;
double r168687 = y;
double r168688 = r168686 / r168687;
double r168689 = log(r168688);
double r168690 = r168686 * r168689;
double r168691 = z;
double r168692 = r168690 - r168691;
return r168692;
}
double f(double x, double y, double z) {
double r168693 = x;
double r168694 = 2.0;
double r168695 = cbrt(r168693);
double r168696 = y;
double r168697 = cbrt(r168696);
double r168698 = r168695 / r168697;
double r168699 = log(r168698);
double r168700 = r168694 * r168699;
double r168701 = r168693 * r168700;
double r168702 = r168699 * r168693;
double r168703 = r168701 + r168702;
double r168704 = z;
double r168705 = r168703 - r168704;
return r168705;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 15.5 |
|---|---|
| Target | 7.9 |
| Herbie | 0.2 |
Initial program 15.5
rmApplied add-cube-cbrt15.5
Applied add-cube-cbrt15.5
Applied times-frac15.5
Applied log-prod3.6
Applied distribute-lft-in3.6
Simplified0.2
Simplified0.2
Final simplification0.2
herbie shell --seed 2020042 +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.595077799083773e-308) (- (* x (log (/ x y))) z) (- (* x (- (log x) (log y))) z))
(- (* x (log (/ x y))) z))