x \cdot \log \left(\frac{x}{y}\right) - zx \cdot \left(\log \left(\frac{\sqrt[3]{x}}{\sqrt[3]{y}}\right) + \log \left(\frac{\sqrt[3]{x}}{\sqrt[3]{y}}\right)\right) + \left(\log \left(\frac{\sqrt[3]{x}}{\sqrt[3]{y}}\right) \cdot x - z\right)double f(double x, double y, double z) {
double r17999474 = x;
double r17999475 = y;
double r17999476 = r17999474 / r17999475;
double r17999477 = log(r17999476);
double r17999478 = r17999474 * r17999477;
double r17999479 = z;
double r17999480 = r17999478 - r17999479;
return r17999480;
}
double f(double x, double y, double z) {
double r17999481 = x;
double r17999482 = cbrt(r17999481);
double r17999483 = y;
double r17999484 = cbrt(r17999483);
double r17999485 = r17999482 / r17999484;
double r17999486 = log(r17999485);
double r17999487 = r17999486 + r17999486;
double r17999488 = r17999481 * r17999487;
double r17999489 = r17999486 * r17999481;
double r17999490 = z;
double r17999491 = r17999489 - r17999490;
double r17999492 = r17999488 + r17999491;
return r17999492;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 14.8 |
|---|---|
| Target | 7.7 |
| Herbie | 0.2 |
Initial program 14.8
rmApplied add-cube-cbrt14.8
Applied add-cube-cbrt14.8
Applied times-frac14.8
Applied log-prod3.6
Applied distribute-lft-in3.6
Applied associate--l+3.6
rmApplied times-frac3.6
Applied log-prod0.2
Final simplification0.2
herbie shell --seed 2019163 +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))