\left(x \cdot \log y + z \cdot \log \left(1 - y\right)\right) - t
\left(\mathsf{fma}\left(x, 2 \cdot \log \left(\sqrt[3]{y}\right), x \cdot \log \left(\sqrt[3]{y}\right)\right) + \mathsf{fma}\left(z, \log 1, -\mathsf{fma}\left(1, z \cdot y, \frac{1}{2} \cdot \frac{z \cdot {y}^{2}}{{1}^{2}}\right)\right)\right) - tdouble f(double x, double y, double z, double t) {
double r373865 = x;
double r373866 = y;
double r373867 = log(r373866);
double r373868 = r373865 * r373867;
double r373869 = z;
double r373870 = 1.0;
double r373871 = r373870 - r373866;
double r373872 = log(r373871);
double r373873 = r373869 * r373872;
double r373874 = r373868 + r373873;
double r373875 = t;
double r373876 = r373874 - r373875;
return r373876;
}
double f(double x, double y, double z, double t) {
double r373877 = x;
double r373878 = 2.0;
double r373879 = y;
double r373880 = cbrt(r373879);
double r373881 = log(r373880);
double r373882 = r373878 * r373881;
double r373883 = r373877 * r373881;
double r373884 = fma(r373877, r373882, r373883);
double r373885 = z;
double r373886 = 1.0;
double r373887 = log(r373886);
double r373888 = r373885 * r373879;
double r373889 = 0.5;
double r373890 = pow(r373879, r373878);
double r373891 = r373885 * r373890;
double r373892 = pow(r373886, r373878);
double r373893 = r373891 / r373892;
double r373894 = r373889 * r373893;
double r373895 = fma(r373886, r373888, r373894);
double r373896 = -r373895;
double r373897 = fma(r373885, r373887, r373896);
double r373898 = r373884 + r373897;
double r373899 = t;
double r373900 = r373898 - r373899;
return r373900;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
| Original | 9.7 |
|---|---|
| Target | 0.3 |
| Herbie | 0.4 |
Initial program 9.7
Taylor expanded around 0 0.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 2020060 +o rules:numerics
(FPCore (x y z t)
:name "Numeric.SpecFunctions:invIncompleteBetaWorker from math-functions-0.1.5.2, B"
:precision binary64
:herbie-target
(- (* (- z) (+ (+ (* 0.5 (* y y)) y) (* (/ 0.3333333333333333 (* 1 (* 1 1))) (* y (* y y))))) (- t (* x (log y))))
(- (+ (* x (log y)) (* z (log (- 1 y)))) t))