Average Error: 2.1 → 0.3
Time: 18.7s
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 r104980 = x;
        double r104981 = y;
        double r104982 = z;
        double r104983 = log(r104982);
        double r104984 = t;
        double r104985 = r104983 - r104984;
        double r104986 = r104981 * r104985;
        double r104987 = a;
        double r104988 = 1.0;
        double r104989 = r104988 - r104982;
        double r104990 = log(r104989);
        double r104991 = b;
        double r104992 = r104990 - r104991;
        double r104993 = r104987 * r104992;
        double r104994 = r104986 + r104993;
        double r104995 = exp(r104994);
        double r104996 = r104980 * r104995;
        return r104996;
}

double f(double x, double y, double z, double t, double a, double b) {
        double r104997 = x;
        double r104998 = y;
        double r104999 = z;
        double r105000 = log(r104999);
        double r105001 = t;
        double r105002 = r105000 - r105001;
        double r105003 = 1.0;
        double r105004 = log(r105003);
        double r105005 = 0.5;
        double r105006 = 2.0;
        double r105007 = pow(r104999, r105006);
        double r105008 = pow(r105003, r105006);
        double r105009 = r105007 / r105008;
        double r105010 = r105005 * r105009;
        double r105011 = r105003 * r104999;
        double r105012 = r105010 + r105011;
        double r105013 = r105004 - r105012;
        double r105014 = cbrt(r105013);
        double r105015 = r105014 * r105014;
        double r105016 = b;
        double r105017 = 1.0;
        double r105018 = r105016 * r105017;
        double r105019 = -r105018;
        double r105020 = fma(r105015, r105014, r105019);
        double r105021 = a;
        double r105022 = r105020 * r105021;
        double r105023 = fma(r104998, r105002, r105022);
        double r105024 = -r105016;
        double r105025 = fma(r105024, r105017, r105018);
        double r105026 = r105025 * r105021;
        double r105027 = r105023 + r105026;
        double r105028 = exp(r105027);
        double r105029 = r104997 * r105028;
        return r105029;
}

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 2.1

    \[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.5

    \[\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.5

    \[\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.5

    \[\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.5

    \[\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.5

    \[\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.5

    \[\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.3

    \[\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.3

    \[\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 2019353 +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))))))