Average Error: 2.0 → 0.3
Time: 20.7s
Precision: 64
\[x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)}\]
\[e^{\mathsf{fma}\left(a, \mathsf{fma}\left(\sqrt{\log 1} + \sqrt{\mathsf{fma}\left(\frac{1}{2}, \frac{{z}^{2}}{{1}^{2}}, 1 \cdot z\right)}, \sqrt{\log 1} - \sqrt{\mathsf{fma}\left(\frac{1}{2}, \frac{{z}^{2}}{{1}^{2}}, 1 \cdot z\right)}, -b\right), y \cdot \left(\log z - t\right)\right) + a \cdot \mathsf{fma}\left(-b, 1, b\right)} \cdot x\]
x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)}
e^{\mathsf{fma}\left(a, \mathsf{fma}\left(\sqrt{\log 1} + \sqrt{\mathsf{fma}\left(\frac{1}{2}, \frac{{z}^{2}}{{1}^{2}}, 1 \cdot z\right)}, \sqrt{\log 1} - \sqrt{\mathsf{fma}\left(\frac{1}{2}, \frac{{z}^{2}}{{1}^{2}}, 1 \cdot z\right)}, -b\right), y \cdot \left(\log z - t\right)\right) + a \cdot \mathsf{fma}\left(-b, 1, b\right)} \cdot x
double f(double x, double y, double z, double t, double a, double b) {
        double r150513 = x;
        double r150514 = y;
        double r150515 = z;
        double r150516 = log(r150515);
        double r150517 = t;
        double r150518 = r150516 - r150517;
        double r150519 = r150514 * r150518;
        double r150520 = a;
        double r150521 = 1.0;
        double r150522 = r150521 - r150515;
        double r150523 = log(r150522);
        double r150524 = b;
        double r150525 = r150523 - r150524;
        double r150526 = r150520 * r150525;
        double r150527 = r150519 + r150526;
        double r150528 = exp(r150527);
        double r150529 = r150513 * r150528;
        return r150529;
}

double f(double x, double y, double z, double t, double a, double b) {
        double r150530 = a;
        double r150531 = 1.0;
        double r150532 = log(r150531);
        double r150533 = sqrt(r150532);
        double r150534 = 0.5;
        double r150535 = z;
        double r150536 = 2.0;
        double r150537 = pow(r150535, r150536);
        double r150538 = pow(r150531, r150536);
        double r150539 = r150537 / r150538;
        double r150540 = r150531 * r150535;
        double r150541 = fma(r150534, r150539, r150540);
        double r150542 = sqrt(r150541);
        double r150543 = r150533 + r150542;
        double r150544 = r150533 - r150542;
        double r150545 = b;
        double r150546 = -r150545;
        double r150547 = fma(r150543, r150544, r150546);
        double r150548 = y;
        double r150549 = log(r150535);
        double r150550 = t;
        double r150551 = r150549 - r150550;
        double r150552 = r150548 * r150551;
        double r150553 = fma(r150530, r150547, r150552);
        double r150554 = 1.0;
        double r150555 = fma(r150546, r150554, r150545);
        double r150556 = r150530 * r150555;
        double r150557 = r150553 + r150556;
        double r150558 = exp(r150557);
        double r150559 = x;
        double r150560 = r150558 * r150559;
        return r150560;
}

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

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

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

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

    \[\leadsto x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\left(\log 1 - \color{blue}{\sqrt{\mathsf{fma}\left(\frac{1}{2}, \frac{{z}^{2}}{{1}^{2}}, 1 \cdot z\right)} \cdot \sqrt{\mathsf{fma}\left(\frac{1}{2}, \frac{{z}^{2}}{{1}^{2}}, 1 \cdot z\right)}}\right) - 1 \cdot b\right)}\]
  7. Applied add-sqr-sqrt0.5

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

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

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

    \[\leadsto x \cdot e^{y \cdot \left(\log z - t\right) + \color{blue}{\left(\mathsf{fma}\left(\sqrt{\log 1} + \sqrt{\mathsf{fma}\left(\frac{1}{2}, \frac{{z}^{2}}{{1}^{2}}, 1 \cdot z\right)}, \sqrt{\log 1} - \sqrt{\mathsf{fma}\left(\frac{1}{2}, \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)}}\]
  11. Applied associate-+r+0.5

    \[\leadsto x \cdot e^{\color{blue}{\left(y \cdot \left(\log z - t\right) + \mathsf{fma}\left(\sqrt{\log 1} + \sqrt{\mathsf{fma}\left(\frac{1}{2}, \frac{{z}^{2}}{{1}^{2}}, 1 \cdot z\right)}, \sqrt{\log 1} - \sqrt{\mathsf{fma}\left(\frac{1}{2}, \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}}\]
  12. Simplified0.3

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

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

Reproduce

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