x \cdot \log \left(\frac{x}{y}\right) - zx \cdot \left(\left(-\log \left(\sqrt[3]{y} \cdot \sqrt[3]{y}\right)\right) + \left(2 \cdot \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)\right) - zdouble f(double x, double y, double z) {
double r312413 = x;
double r312414 = y;
double r312415 = r312413 / r312414;
double r312416 = log(r312415);
double r312417 = r312413 * r312416;
double r312418 = z;
double r312419 = r312417 - r312418;
return r312419;
}
double f(double x, double y, double z) {
double r312420 = x;
double r312421 = y;
double r312422 = cbrt(r312421);
double r312423 = r312422 * r312422;
double r312424 = log(r312423);
double r312425 = -r312424;
double r312426 = 2.0;
double r312427 = cbrt(r312420);
double r312428 = cbrt(r312422);
double r312429 = r312427 / r312428;
double r312430 = log(r312429);
double r312431 = r312426 * r312430;
double r312432 = r312431 + r312430;
double r312433 = r312425 + r312432;
double r312434 = r312420 * r312433;
double r312435 = z;
double r312436 = r312434 - r312435;
return r312436;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 15.4 |
|---|---|
| Target | 7.8 |
| Herbie | 0.3 |
Initial program 15.4
rmApplied add-cube-cbrt15.4
Applied *-un-lft-identity15.4
Applied times-frac15.4
Applied log-prod4.7
Simplified4.7
rmApplied add-cube-cbrt4.7
Applied add-cube-cbrt4.7
Applied times-frac4.7
Applied log-prod0.3
Simplified0.3
Final simplification0.3
herbie shell --seed 2019235 +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))