Average Error: 1.9 → 0.2
Time: 13.2s
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 r136587 = x;
        double r136588 = y;
        double r136589 = z;
        double r136590 = log(r136589);
        double r136591 = t;
        double r136592 = r136590 - r136591;
        double r136593 = r136588 * r136592;
        double r136594 = a;
        double r136595 = 1.0;
        double r136596 = r136595 - r136589;
        double r136597 = log(r136596);
        double r136598 = b;
        double r136599 = r136597 - r136598;
        double r136600 = r136594 * r136599;
        double r136601 = r136593 + r136600;
        double r136602 = exp(r136601);
        double r136603 = r136587 * r136602;
        return r136603;
}

double f(double x, double y, double z, double t, double a, double b) {
        double r136604 = x;
        double r136605 = y;
        double r136606 = z;
        double r136607 = log(r136606);
        double r136608 = t;
        double r136609 = r136607 - r136608;
        double r136610 = 1.0;
        double r136611 = log(r136610);
        double r136612 = 0.5;
        double r136613 = 2.0;
        double r136614 = pow(r136606, r136613);
        double r136615 = pow(r136610, r136613);
        double r136616 = r136614 / r136615;
        double r136617 = r136612 * r136616;
        double r136618 = r136610 * r136606;
        double r136619 = r136617 + r136618;
        double r136620 = r136611 - r136619;
        double r136621 = cbrt(r136620);
        double r136622 = r136621 * r136621;
        double r136623 = b;
        double r136624 = 1.0;
        double r136625 = r136623 * r136624;
        double r136626 = -r136625;
        double r136627 = fma(r136622, r136621, r136626);
        double r136628 = a;
        double r136629 = r136627 * r136628;
        double r136630 = fma(r136605, r136609, r136629);
        double r136631 = -r136623;
        double r136632 = fma(r136631, r136624, r136625);
        double r136633 = r136632 * r136628;
        double r136634 = r136630 + r136633;
        double r136635 = exp(r136634);
        double r136636 = r136604 * r136635;
        return r136636;
}

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.9

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