x \cdot \log \left(\frac{x}{y}\right) - z\left(x \cdot \left(\log \left(\left|\frac{\sqrt[3]{x}}{\sqrt[3]{y}}\right|\right) + \log \left(\left|\frac{\sqrt[3]{x}}{\sqrt[3]{y}}\right|\right)\right) + x \cdot \log \left(\frac{\sqrt[3]{x}}{\sqrt[3]{y}}\right)\right) - zdouble f(double x, double y, double z) {
double r309088 = x;
double r309089 = y;
double r309090 = r309088 / r309089;
double r309091 = log(r309090);
double r309092 = r309088 * r309091;
double r309093 = z;
double r309094 = r309092 - r309093;
return r309094;
}
double f(double x, double y, double z) {
double r309095 = x;
double r309096 = cbrt(r309095);
double r309097 = y;
double r309098 = cbrt(r309097);
double r309099 = r309096 / r309098;
double r309100 = fabs(r309099);
double r309101 = log(r309100);
double r309102 = r309101 + r309101;
double r309103 = r309095 * r309102;
double r309104 = log(r309099);
double r309105 = r309095 * r309104;
double r309106 = r309103 + r309105;
double r309107 = z;
double r309108 = r309106 - r309107;
return r309108;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 15.0 |
|---|---|
| Target | 7.7 |
| Herbie | 0.2 |
Initial program 15.0
rmApplied add-cube-cbrt15.0
Applied add-cube-cbrt15.0
Applied times-frac15.0
Applied log-prod3.4
Applied distribute-lft-in3.4
rmApplied add-sqr-sqrt3.4
Applied log-prod3.4
Simplified3.4
Simplified0.2
Final simplification0.2
herbie shell --seed 2019198 +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))