x \cdot \log \left(\frac{x}{y}\right) - zx \cdot \left(\sqrt[3]{2 \cdot \log \left(\frac{\sqrt[3]{x}}{\sqrt[3]{y}}\right)} \cdot \sqrt[3]{{\left(2 \cdot \log \left(\frac{\sqrt[3]{x}}{\sqrt[3]{y}}\right)\right)}^{2}}\right) + \left(x \cdot \log \left(\frac{\sqrt[3]{x}}{\sqrt[3]{y}}\right) - z\right)double f(double x, double y, double z) {
double r291991 = x;
double r291992 = y;
double r291993 = r291991 / r291992;
double r291994 = log(r291993);
double r291995 = r291991 * r291994;
double r291996 = z;
double r291997 = r291995 - r291996;
return r291997;
}
double f(double x, double y, double z) {
double r291998 = x;
double r291999 = 2.0;
double r292000 = cbrt(r291998);
double r292001 = y;
double r292002 = cbrt(r292001);
double r292003 = r292000 / r292002;
double r292004 = log(r292003);
double r292005 = r291999 * r292004;
double r292006 = cbrt(r292005);
double r292007 = pow(r292005, r291999);
double r292008 = cbrt(r292007);
double r292009 = r292006 * r292008;
double r292010 = r291998 * r292009;
double r292011 = r291998 * r292004;
double r292012 = z;
double r292013 = r292011 - r292012;
double r292014 = r292010 + r292013;
return r292014;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 15.7 |
|---|---|
| Target | 8.1 |
| Herbie | 0.3 |
Initial program 15.7
rmApplied add-cube-cbrt15.7
Applied add-cube-cbrt15.7
Applied times-frac15.7
Applied log-prod3.5
Applied distribute-lft-in3.5
Applied associate--l+3.5
rmApplied add-cbrt-cube3.5
Simplified0.3
rmApplied cube-mult0.3
Applied cbrt-prod0.3
Simplified0.3
Final simplification0.3
herbie shell --seed 2019305 +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))