Average Error: 1.8 → 0.2
Time: 13.6s
Precision: 64
\[x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)}\]
\[x \cdot e^{\mathsf{fma}\left(y, \log z - t, \mathsf{fma}\left(\sqrt[3]{\log 1 - \left(\frac{1}{2} \cdot \frac{{z}^{2}}{{1}^{2}} + 1 \cdot z\right)} \cdot \sqrt[3]{\log 1 - \left(\frac{1}{2} \cdot \frac{{z}^{2}}{{1}^{2}} + 1 \cdot z\right)}, \sqrt[3]{\log 1 - \left(\frac{1}{2} \cdot \frac{{z}^{2}}{{1}^{2}} + 1 \cdot z\right)}, -b \cdot 1\right) \cdot a\right) + \mathsf{fma}\left(-b, 1, b \cdot 1\right) \cdot a}\]
x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)}
x \cdot e^{\mathsf{fma}\left(y, \log z - t, \mathsf{fma}\left(\sqrt[3]{\log 1 - \left(\frac{1}{2} \cdot \frac{{z}^{2}}{{1}^{2}} + 1 \cdot z\right)} \cdot \sqrt[3]{\log 1 - \left(\frac{1}{2} \cdot \frac{{z}^{2}}{{1}^{2}} + 1 \cdot z\right)}, \sqrt[3]{\log 1 - \left(\frac{1}{2} \cdot \frac{{z}^{2}}{{1}^{2}} + 1 \cdot z\right)}, -b \cdot 1\right) \cdot a\right) + \mathsf{fma}\left(-b, 1, b \cdot 1\right) \cdot a}
double f(double x, double y, double z, double t, double a, double b) {
        double r128910 = x;
        double r128911 = y;
        double r128912 = z;
        double r128913 = log(r128912);
        double r128914 = t;
        double r128915 = r128913 - r128914;
        double r128916 = r128911 * r128915;
        double r128917 = a;
        double r128918 = 1.0;
        double r128919 = r128918 - r128912;
        double r128920 = log(r128919);
        double r128921 = b;
        double r128922 = r128920 - r128921;
        double r128923 = r128917 * r128922;
        double r128924 = r128916 + r128923;
        double r128925 = exp(r128924);
        double r128926 = r128910 * r128925;
        return r128926;
}

double f(double x, double y, double z, double t, double a, double b) {
        double r128927 = x;
        double r128928 = y;
        double r128929 = z;
        double r128930 = log(r128929);
        double r128931 = t;
        double r128932 = r128930 - r128931;
        double r128933 = 1.0;
        double r128934 = log(r128933);
        double r128935 = 0.5;
        double r128936 = 2.0;
        double r128937 = pow(r128929, r128936);
        double r128938 = pow(r128933, r128936);
        double r128939 = r128937 / r128938;
        double r128940 = r128935 * r128939;
        double r128941 = r128933 * r128929;
        double r128942 = r128940 + r128941;
        double r128943 = r128934 - r128942;
        double r128944 = cbrt(r128943);
        double r128945 = r128944 * r128944;
        double r128946 = b;
        double r128947 = 1.0;
        double r128948 = r128946 * r128947;
        double r128949 = -r128948;
        double r128950 = fma(r128945, r128944, r128949);
        double r128951 = a;
        double r128952 = r128950 * r128951;
        double r128953 = fma(r128928, r128932, r128952);
        double r128954 = -r128946;
        double r128955 = fma(r128954, r128947, r128948);
        double r128956 = r128955 * r128951;
        double r128957 = r128953 + r128956;
        double r128958 = exp(r128957);
        double r128959 = r128927 * r128958;
        return r128959;
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Bits error versus t

Bits error versus a

Bits error versus b

Derivation

  1. Initial program 1.8

    \[x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)}\]
  2. Taylor expanded around 0 0.4

    \[\leadsto x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\color{blue}{\left(\log 1 - \left(\frac{1}{2} \cdot \frac{{z}^{2}}{{1}^{2}} + 1 \cdot z\right)\right)} - b\right)}\]
  3. Using strategy rm
  4. Applied *-un-lft-identity0.4

    \[\leadsto x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\left(\log 1 - \left(\frac{1}{2} \cdot \frac{{z}^{2}}{{1}^{2}} + 1 \cdot z\right)\right) - \color{blue}{1 \cdot b}\right)}\]
  5. Applied add-cube-cbrt0.4

    \[\leadsto x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\color{blue}{\left(\sqrt[3]{\log 1 - \left(\frac{1}{2} \cdot \frac{{z}^{2}}{{1}^{2}} + 1 \cdot z\right)} \cdot \sqrt[3]{\log 1 - \left(\frac{1}{2} \cdot \frac{{z}^{2}}{{1}^{2}} + 1 \cdot z\right)}\right) \cdot \sqrt[3]{\log 1 - \left(\frac{1}{2} \cdot \frac{{z}^{2}}{{1}^{2}} + 1 \cdot z\right)}} - 1 \cdot b\right)}\]
  6. Applied prod-diff0.4

    \[\leadsto x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \color{blue}{\left(\mathsf{fma}\left(\sqrt[3]{\log 1 - \left(\frac{1}{2} \cdot \frac{{z}^{2}}{{1}^{2}} + 1 \cdot z\right)} \cdot \sqrt[3]{\log 1 - \left(\frac{1}{2} \cdot \frac{{z}^{2}}{{1}^{2}} + 1 \cdot z\right)}, \sqrt[3]{\log 1 - \left(\frac{1}{2} \cdot \frac{{z}^{2}}{{1}^{2}} + 1 \cdot z\right)}, -b \cdot 1\right) + \mathsf{fma}\left(-b, 1, b \cdot 1\right)\right)}}\]
  7. Applied distribute-rgt-in0.4

    \[\leadsto x \cdot e^{y \cdot \left(\log z - t\right) + \color{blue}{\left(\mathsf{fma}\left(\sqrt[3]{\log 1 - \left(\frac{1}{2} \cdot \frac{{z}^{2}}{{1}^{2}} + 1 \cdot z\right)} \cdot \sqrt[3]{\log 1 - \left(\frac{1}{2} \cdot \frac{{z}^{2}}{{1}^{2}} + 1 \cdot z\right)}, \sqrt[3]{\log 1 - \left(\frac{1}{2} \cdot \frac{{z}^{2}}{{1}^{2}} + 1 \cdot z\right)}, -b \cdot 1\right) \cdot a + \mathsf{fma}\left(-b, 1, b \cdot 1\right) \cdot a\right)}}\]
  8. Applied associate-+r+0.4

    \[\leadsto x \cdot e^{\color{blue}{\left(y \cdot \left(\log z - t\right) + \mathsf{fma}\left(\sqrt[3]{\log 1 - \left(\frac{1}{2} \cdot \frac{{z}^{2}}{{1}^{2}} + 1 \cdot z\right)} \cdot \sqrt[3]{\log 1 - \left(\frac{1}{2} \cdot \frac{{z}^{2}}{{1}^{2}} + 1 \cdot z\right)}, \sqrt[3]{\log 1 - \left(\frac{1}{2} \cdot \frac{{z}^{2}}{{1}^{2}} + 1 \cdot z\right)}, -b \cdot 1\right) \cdot a\right) + \mathsf{fma}\left(-b, 1, b \cdot 1\right) \cdot a}}\]
  9. Simplified0.2

    \[\leadsto x \cdot e^{\color{blue}{\mathsf{fma}\left(y, \log z - t, \mathsf{fma}\left(\sqrt[3]{\log 1 - \left(\frac{1}{2} \cdot \frac{{z}^{2}}{{1}^{2}} + 1 \cdot z\right)} \cdot \sqrt[3]{\log 1 - \left(\frac{1}{2} \cdot \frac{{z}^{2}}{{1}^{2}} + 1 \cdot z\right)}, \sqrt[3]{\log 1 - \left(\frac{1}{2} \cdot \frac{{z}^{2}}{{1}^{2}} + 1 \cdot z\right)}, -b \cdot 1\right) \cdot a\right)} + \mathsf{fma}\left(-b, 1, b \cdot 1\right) \cdot a}\]
  10. Final simplification0.2

    \[\leadsto x \cdot e^{\mathsf{fma}\left(y, \log z - t, \mathsf{fma}\left(\sqrt[3]{\log 1 - \left(\frac{1}{2} \cdot \frac{{z}^{2}}{{1}^{2}} + 1 \cdot z\right)} \cdot \sqrt[3]{\log 1 - \left(\frac{1}{2} \cdot \frac{{z}^{2}}{{1}^{2}} + 1 \cdot z\right)}, \sqrt[3]{\log 1 - \left(\frac{1}{2} \cdot \frac{{z}^{2}}{{1}^{2}} + 1 \cdot z\right)}, -b \cdot 1\right) \cdot a\right) + \mathsf{fma}\left(-b, 1, b \cdot 1\right) \cdot a}\]

Reproduce

herbie shell --seed 2020064 +o rules:numerics
(FPCore (x y z t a b)
  :name "Numeric.SpecFunctions:incompleteBetaApprox from math-functions-0.1.5.2, B"
  :precision binary64
  (* x (exp (+ (* y (- (log z) t)) (* a (- (log (- 1 z)) b))))))