\left(x \cdot \log y + z \cdot \log \left(1.0 - y\right)\right) - t
\mathsf{fma}\left(\log 1.0 - \mathsf{fma}\left(\frac{y}{1.0} \cdot \frac{y}{1.0}, \frac{1}{2}, 1.0 \cdot y\right), z, \log y \cdot x\right) - tdouble f(double x, double y, double z, double t) {
double r7495878 = x;
double r7495879 = y;
double r7495880 = log(r7495879);
double r7495881 = r7495878 * r7495880;
double r7495882 = z;
double r7495883 = 1.0;
double r7495884 = r7495883 - r7495879;
double r7495885 = log(r7495884);
double r7495886 = r7495882 * r7495885;
double r7495887 = r7495881 + r7495886;
double r7495888 = t;
double r7495889 = r7495887 - r7495888;
return r7495889;
}
double f(double x, double y, double z, double t) {
double r7495890 = 1.0;
double r7495891 = log(r7495890);
double r7495892 = y;
double r7495893 = r7495892 / r7495890;
double r7495894 = r7495893 * r7495893;
double r7495895 = 0.5;
double r7495896 = r7495890 * r7495892;
double r7495897 = fma(r7495894, r7495895, r7495896);
double r7495898 = r7495891 - r7495897;
double r7495899 = z;
double r7495900 = log(r7495892);
double r7495901 = x;
double r7495902 = r7495900 * r7495901;
double r7495903 = fma(r7495898, r7495899, r7495902);
double r7495904 = t;
double r7495905 = r7495903 - r7495904;
return r7495905;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
| Original | 9.1 |
|---|---|
| Target | 0.3 |
| Herbie | 0.3 |
Initial program 9.1
Simplified9.1
Taylor expanded around 0 0.3
Simplified0.3
rmApplied add-cube-cbrt0.7
Applied associate-*l*0.7
rmApplied cbrt-unprod0.6
Taylor expanded around inf 0.4
Simplified0.3
Final simplification0.3
herbie shell --seed 2019156 +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) (* (/ 1/3 (* 1.0 (* 1.0 1.0))) (* y (* y y))))) (- t (* x (log y))))
(- (+ (* x (log y)) (* z (log (- 1.0 y)))) t))