Average Error: 2.2 → 0.3
Time: 12.8s
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^{y \cdot \log \left(\sqrt{z}\right) + \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 \left(\sqrt{z}\right) - t\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^{y \cdot \log \left(\sqrt{z}\right) + \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 \left(\sqrt{z}\right) - t\right)\right)}
double f(double x, double y, double z, double t, double a, double b) {
        double r106504 = x;
        double r106505 = y;
        double r106506 = z;
        double r106507 = log(r106506);
        double r106508 = t;
        double r106509 = r106507 - r106508;
        double r106510 = r106505 * r106509;
        double r106511 = a;
        double r106512 = 1.0;
        double r106513 = r106512 - r106506;
        double r106514 = log(r106513);
        double r106515 = b;
        double r106516 = r106514 - r106515;
        double r106517 = r106511 * r106516;
        double r106518 = r106510 + r106517;
        double r106519 = exp(r106518);
        double r106520 = r106504 * r106519;
        return r106520;
}

double f(double x, double y, double z, double t, double a, double b) {
        double r106521 = x;
        double r106522 = y;
        double r106523 = z;
        double r106524 = sqrt(r106523);
        double r106525 = log(r106524);
        double r106526 = r106522 * r106525;
        double r106527 = 1.0;
        double r106528 = log(r106527);
        double r106529 = 0.5;
        double r106530 = 2.0;
        double r106531 = pow(r106523, r106530);
        double r106532 = pow(r106527, r106530);
        double r106533 = r106531 / r106532;
        double r106534 = r106527 * r106523;
        double r106535 = fma(r106529, r106533, r106534);
        double r106536 = b;
        double r106537 = r106535 + r106536;
        double r106538 = r106528 - r106537;
        double r106539 = a;
        double r106540 = t;
        double r106541 = r106525 - r106540;
        double r106542 = r106522 * r106541;
        double r106543 = fma(r106538, r106539, r106542);
        double r106544 = r106526 + r106543;
        double r106545 = exp(r106544);
        double r106546 = r106521 * r106545;
        return r106546;
}

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

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

    \[\leadsto x \cdot e^{y \cdot \left(\log \color{blue}{\left(\sqrt{z} \cdot \sqrt{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 \left(\sqrt{z}\right) + \log \left(\sqrt{z}\right)\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 \left(\sqrt{z}\right) + \left(\log \left(\sqrt{z}\right) - 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.5

    \[\leadsto x \cdot e^{\color{blue}{\left(y \cdot \log \left(\sqrt{z}\right) + y \cdot \left(\log \left(\sqrt{z}\right) - 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.5

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

    \[\leadsto x \cdot e^{y \cdot \log \left(\sqrt{z}\right) + \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 \left(\sqrt{z}\right) - t\right)\right)}}\]
  10. Final simplification0.3

    \[\leadsto x \cdot e^{y \cdot \log \left(\sqrt{z}\right) + \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 \left(\sqrt{z}\right) - t\right)\right)}\]

Reproduce

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