Average Error: 1.9 → 0.2
Time: 56.6s
Precision: 64
\[x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)}\]
\[\left(x \cdot \sqrt{e^{\mathsf{fma}\left(y, \log z - t, \left(\mathsf{fma}\left(\frac{-1}{2}, \frac{z}{1} \cdot \frac{z}{1}, \log 1 - 1 \cdot z\right) - b\right) \cdot a\right)}}\right) \cdot \sqrt{{\left(e^{\sqrt[3]{\mathsf{fma}\left(y, \log z - t, \left(\mathsf{fma}\left(\frac{-1}{2}, \frac{z}{1} \cdot \frac{z}{1}, \log 1 - 1 \cdot z\right) - b\right) \cdot a\right)} \cdot \sqrt[3]{\mathsf{fma}\left(y, \log z - t, \left(\mathsf{fma}\left(\frac{-1}{2}, \frac{z}{1} \cdot \frac{z}{1}, \log 1 - 1 \cdot z\right) - b\right) \cdot a\right)}}\right)}^{\left(\sqrt[3]{\mathsf{fma}\left(y, \log z - t, \left(\mathsf{fma}\left(\frac{-1}{2}, \frac{z}{1} \cdot \frac{z}{1}, \log 1 - 1 \cdot z\right) - b\right) \cdot a\right)}\right)}}\]
x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)}
\left(x \cdot \sqrt{e^{\mathsf{fma}\left(y, \log z - t, \left(\mathsf{fma}\left(\frac{-1}{2}, \frac{z}{1} \cdot \frac{z}{1}, \log 1 - 1 \cdot z\right) - b\right) \cdot a\right)}}\right) \cdot \sqrt{{\left(e^{\sqrt[3]{\mathsf{fma}\left(y, \log z - t, \left(\mathsf{fma}\left(\frac{-1}{2}, \frac{z}{1} \cdot \frac{z}{1}, \log 1 - 1 \cdot z\right) - b\right) \cdot a\right)} \cdot \sqrt[3]{\mathsf{fma}\left(y, \log z - t, \left(\mathsf{fma}\left(\frac{-1}{2}, \frac{z}{1} \cdot \frac{z}{1}, \log 1 - 1 \cdot z\right) - b\right) \cdot a\right)}}\right)}^{\left(\sqrt[3]{\mathsf{fma}\left(y, \log z - t, \left(\mathsf{fma}\left(\frac{-1}{2}, \frac{z}{1} \cdot \frac{z}{1}, \log 1 - 1 \cdot z\right) - b\right) \cdot a\right)}\right)}}
double f(double x, double y, double z, double t, double a, double b) {
        double r5533452 = x;
        double r5533453 = y;
        double r5533454 = z;
        double r5533455 = log(r5533454);
        double r5533456 = t;
        double r5533457 = r5533455 - r5533456;
        double r5533458 = r5533453 * r5533457;
        double r5533459 = a;
        double r5533460 = 1.0;
        double r5533461 = r5533460 - r5533454;
        double r5533462 = log(r5533461);
        double r5533463 = b;
        double r5533464 = r5533462 - r5533463;
        double r5533465 = r5533459 * r5533464;
        double r5533466 = r5533458 + r5533465;
        double r5533467 = exp(r5533466);
        double r5533468 = r5533452 * r5533467;
        return r5533468;
}

double f(double x, double y, double z, double t, double a, double b) {
        double r5533469 = x;
        double r5533470 = y;
        double r5533471 = z;
        double r5533472 = log(r5533471);
        double r5533473 = t;
        double r5533474 = r5533472 - r5533473;
        double r5533475 = -0.5;
        double r5533476 = 1.0;
        double r5533477 = r5533471 / r5533476;
        double r5533478 = r5533477 * r5533477;
        double r5533479 = log(r5533476);
        double r5533480 = r5533476 * r5533471;
        double r5533481 = r5533479 - r5533480;
        double r5533482 = fma(r5533475, r5533478, r5533481);
        double r5533483 = b;
        double r5533484 = r5533482 - r5533483;
        double r5533485 = a;
        double r5533486 = r5533484 * r5533485;
        double r5533487 = fma(r5533470, r5533474, r5533486);
        double r5533488 = exp(r5533487);
        double r5533489 = sqrt(r5533488);
        double r5533490 = r5533469 * r5533489;
        double r5533491 = cbrt(r5533487);
        double r5533492 = r5533491 * r5533491;
        double r5533493 = exp(r5533492);
        double r5533494 = pow(r5533493, r5533491);
        double r5533495 = sqrt(r5533494);
        double r5533496 = r5533490 * r5533495;
        return r5533496;
}

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

    \[\leadsto \color{blue}{x \cdot e^{\mathsf{fma}\left(y, \log z - t, \left(\log \left(1 - z\right) - b\right) \cdot a\right)}}\]
  3. Taylor expanded around 0 0.2

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

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

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

    \[\leadsto \color{blue}{\left(x \cdot \sqrt{e^{\mathsf{fma}\left(y, \log z - t, \left(\mathsf{fma}\left(\frac{-1}{2}, \frac{z}{1} \cdot \frac{z}{1}, \log 1 - 1 \cdot z\right) - b\right) \cdot a\right)}}\right) \cdot \sqrt{e^{\mathsf{fma}\left(y, \log z - t, \left(\mathsf{fma}\left(\frac{-1}{2}, \frac{z}{1} \cdot \frac{z}{1}, \log 1 - 1 \cdot z\right) - b\right) \cdot a\right)}}}\]
  8. Using strategy rm
  9. Applied add-cube-cbrt0.2

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

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

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

Reproduce

herbie shell --seed 2019169 +o rules:numerics
(FPCore (x y z t a b)
  :name "Numeric.SpecFunctions:incompleteBetaApprox from math-functions-0.1.5.2, B"
  (* x (exp (+ (* y (- (log z) t)) (* a (- (log (- 1.0 z)) b))))))