\left(x \cdot \log y + z \cdot \log \left(1 - y\right)\right) - t
\mathsf{fma}\left(z, \log 1 - \mathsf{fma}\left(\frac{y}{1} \cdot \frac{y}{1}, \frac{1}{2}, y \cdot 1\right), \mathsf{fma}\left(\log \left(\sqrt[3]{y}\right), x + x, \log \left(\sqrt[3]{y}\right) \cdot x\right) - t\right) + \mathsf{fma}\left(-1, t, t\right)double f(double x, double y, double z, double t) {
double r17801926 = x;
double r17801927 = y;
double r17801928 = log(r17801927);
double r17801929 = r17801926 * r17801928;
double r17801930 = z;
double r17801931 = 1.0;
double r17801932 = r17801931 - r17801927;
double r17801933 = log(r17801932);
double r17801934 = r17801930 * r17801933;
double r17801935 = r17801929 + r17801934;
double r17801936 = t;
double r17801937 = r17801935 - r17801936;
return r17801937;
}
double f(double x, double y, double z, double t) {
double r17801938 = z;
double r17801939 = 1.0;
double r17801940 = log(r17801939);
double r17801941 = y;
double r17801942 = r17801941 / r17801939;
double r17801943 = r17801942 * r17801942;
double r17801944 = 0.5;
double r17801945 = r17801941 * r17801939;
double r17801946 = fma(r17801943, r17801944, r17801945);
double r17801947 = r17801940 - r17801946;
double r17801948 = cbrt(r17801941);
double r17801949 = log(r17801948);
double r17801950 = x;
double r17801951 = r17801950 + r17801950;
double r17801952 = r17801949 * r17801950;
double r17801953 = fma(r17801949, r17801951, r17801952);
double r17801954 = t;
double r17801955 = r17801953 - r17801954;
double r17801956 = fma(r17801938, r17801947, r17801955);
double r17801957 = -1.0;
double r17801958 = fma(r17801957, r17801954, r17801954);
double r17801959 = r17801956 + r17801958;
return r17801959;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
| Original | 9.6 |
|---|---|
| Target | 0.3 |
| Herbie | 0.4 |
Initial program 9.6
Simplified9.6
Taylor expanded around 0 0.4
Simplified0.4
rmApplied add-cube-cbrt0.9
Applied add-sqr-sqrt32.3
Applied prod-diff32.3
Simplified0.4
Simplified0.4
rmApplied add-cube-cbrt0.4
Applied log-prod0.4
Applied distribute-lft-in0.4
Simplified0.4
rmApplied fma-def0.4
Final simplification0.4
herbie shell --seed 2019179 +o rules:numerics
(FPCore (x y z t)
:name "Numeric.SpecFunctions:invIncompleteBetaWorker from math-functions-0.1.5.2, B"
:herbie-target
(- (* (- z) (+ (+ (* 0.5 (* y y)) y) (* (/ 0.3333333333333333 (* 1.0 (* 1.0 1.0))) (* y (* y y))))) (- t (* x (log y))))
(- (+ (* x (log y)) (* z (log (- 1.0 y)))) t))