Average Error: 1.7 → 0.2
Time: 14.5s
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}^{\left(y \cdot \log 1 + \mathsf{fma}\left(\log 1 - \left(\mathsf{fma}\left(\frac{1}{2}, \frac{{z}^{2}}{{1}^{2}}, 1 \cdot z\right) + b\right), a, y \cdot \left(\log z - t\right)\right)\right)}\]
x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)}
x \cdot {e}^{\left(y \cdot \log 1 + \mathsf{fma}\left(\log 1 - \left(\mathsf{fma}\left(\frac{1}{2}, \frac{{z}^{2}}{{1}^{2}}, 1 \cdot z\right) + b\right), a, y \cdot \left(\log z - t\right)\right)\right)}
double f(double x, double y, double z, double t, double a, double b) {
        double r127489 = x;
        double r127490 = y;
        double r127491 = z;
        double r127492 = log(r127491);
        double r127493 = t;
        double r127494 = r127492 - r127493;
        double r127495 = r127490 * r127494;
        double r127496 = a;
        double r127497 = 1.0;
        double r127498 = r127497 - r127491;
        double r127499 = log(r127498);
        double r127500 = b;
        double r127501 = r127499 - r127500;
        double r127502 = r127496 * r127501;
        double r127503 = r127495 + r127502;
        double r127504 = exp(r127503);
        double r127505 = r127489 * r127504;
        return r127505;
}

double f(double x, double y, double z, double t, double a, double b) {
        double r127506 = x;
        double r127507 = exp(1.0);
        double r127508 = y;
        double r127509 = 1.0;
        double r127510 = log(r127509);
        double r127511 = r127508 * r127510;
        double r127512 = 1.0;
        double r127513 = log(r127512);
        double r127514 = 0.5;
        double r127515 = z;
        double r127516 = 2.0;
        double r127517 = pow(r127515, r127516);
        double r127518 = pow(r127512, r127516);
        double r127519 = r127517 / r127518;
        double r127520 = r127512 * r127515;
        double r127521 = fma(r127514, r127519, r127520);
        double r127522 = b;
        double r127523 = r127521 + r127522;
        double r127524 = r127513 - r127523;
        double r127525 = a;
        double r127526 = log(r127515);
        double r127527 = t;
        double r127528 = r127526 - r127527;
        double r127529 = r127508 * r127528;
        double r127530 = fma(r127524, r127525, r127529);
        double r127531 = r127511 + r127530;
        double r127532 = pow(r127507, r127531);
        double r127533 = r127506 * r127532;
        return r127533;
}

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

    \[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 \color{blue}{\left(1 \cdot z\right)} - t\right) + a \cdot \left(\left(\log 1 - \left(\frac{1}{2} \cdot \frac{{z}^{2}}{{1}^{2}} + 1 \cdot z\right)\right) - b\right)}\]
  5. Applied log-prod0.4

    \[\leadsto x \cdot e^{y \cdot \left(\color{blue}{\left(\log 1 + \log z\right)} - t\right) + a \cdot \left(\left(\log 1 - \left(\frac{1}{2} \cdot \frac{{z}^{2}}{{1}^{2}} + 1 \cdot z\right)\right) - b\right)}\]
  6. Applied associate--l+0.4

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

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

    \[\leadsto x \cdot e^{\color{blue}{y \cdot \log 1 + \left(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) - b\right)\right)}}\]
  9. Simplified0.2

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

    \[\leadsto x \cdot e^{\color{blue}{1 \cdot \left(y \cdot \log 1 + \mathsf{fma}\left(\log 1 - \left(\mathsf{fma}\left(\frac{1}{2}, \frac{{z}^{2}}{{1}^{2}}, 1 \cdot z\right) + b\right), a, y \cdot \left(\log z - t\right)\right)\right)}}\]
  12. Applied exp-prod0.2

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

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

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

Reproduce

herbie shell --seed 2020083 +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))))))