Average Error: 2.1 → 0.3
Time: 15.4s
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{\log 1} + \sqrt{\frac{1}{2} \cdot \frac{{z}^{2}}{{1}^{2}} + 1 \cdot z}, \sqrt{\log 1} - \sqrt{\frac{1}{2} \cdot \frac{{z}^{2}}{{1}^{2}} + 1 \cdot z}, -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{\log 1} + \sqrt{\frac{1}{2} \cdot \frac{{z}^{2}}{{1}^{2}} + 1 \cdot z}, \sqrt{\log 1} - \sqrt{\frac{1}{2} \cdot \frac{{z}^{2}}{{1}^{2}} + 1 \cdot z}, -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 r110359 = x;
        double r110360 = y;
        double r110361 = z;
        double r110362 = log(r110361);
        double r110363 = t;
        double r110364 = r110362 - r110363;
        double r110365 = r110360 * r110364;
        double r110366 = a;
        double r110367 = 1.0;
        double r110368 = r110367 - r110361;
        double r110369 = log(r110368);
        double r110370 = b;
        double r110371 = r110369 - r110370;
        double r110372 = r110366 * r110371;
        double r110373 = r110365 + r110372;
        double r110374 = exp(r110373);
        double r110375 = r110359 * r110374;
        return r110375;
}

double f(double x, double y, double z, double t, double a, double b) {
        double r110376 = x;
        double r110377 = y;
        double r110378 = z;
        double r110379 = log(r110378);
        double r110380 = t;
        double r110381 = r110379 - r110380;
        double r110382 = 1.0;
        double r110383 = log(r110382);
        double r110384 = sqrt(r110383);
        double r110385 = 0.5;
        double r110386 = 2.0;
        double r110387 = pow(r110378, r110386);
        double r110388 = pow(r110382, r110386);
        double r110389 = r110387 / r110388;
        double r110390 = r110385 * r110389;
        double r110391 = r110382 * r110378;
        double r110392 = r110390 + r110391;
        double r110393 = sqrt(r110392);
        double r110394 = r110384 + r110393;
        double r110395 = r110384 - r110393;
        double r110396 = b;
        double r110397 = 1.0;
        double r110398 = r110396 * r110397;
        double r110399 = -r110398;
        double r110400 = fma(r110394, r110395, r110399);
        double r110401 = a;
        double r110402 = r110400 * r110401;
        double r110403 = fma(r110377, r110381, r110402);
        double r110404 = -r110396;
        double r110405 = fma(r110404, r110397, r110398);
        double r110406 = r110405 * r110401;
        double r110407 = r110403 + r110406;
        double r110408 = exp(r110407);
        double r110409 = r110376 * r110408;
        return r110409;
}

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

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

    \[\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-sqr-sqrt0.6

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

    \[\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{\frac{1}{2} \cdot \frac{{z}^{2}}{{1}^{2}} + 1 \cdot z} \cdot \sqrt{\frac{1}{2} \cdot \frac{{z}^{2}}{{1}^{2}} + 1 \cdot z}\right) - 1 \cdot b\right)}\]
  7. Applied difference-of-squares0.6

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

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

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

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

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

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

Reproduce

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