Average Error: 2.0 → 0.3
Time: 19.5s
Precision: 64
\[x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)}\]
\[\sqrt{1} \cdot \left(e^{\mathsf{fma}\left(\log 1 - \mathsf{fma}\left(\frac{1}{2}, \frac{{z}^{2}}{{1}^{2}}, \mathsf{fma}\left(1, z, b\right)\right), a, \left(\log z - t\right) \cdot y\right)} \cdot x\right)\]
x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)}
\sqrt{1} \cdot \left(e^{\mathsf{fma}\left(\log 1 - \mathsf{fma}\left(\frac{1}{2}, \frac{{z}^{2}}{{1}^{2}}, \mathsf{fma}\left(1, z, b\right)\right), a, \left(\log z - t\right) \cdot y\right)} \cdot x\right)
double f(double x, double y, double z, double t, double a, double b) {
        double r135403 = x;
        double r135404 = y;
        double r135405 = z;
        double r135406 = log(r135405);
        double r135407 = t;
        double r135408 = r135406 - r135407;
        double r135409 = r135404 * r135408;
        double r135410 = a;
        double r135411 = 1.0;
        double r135412 = r135411 - r135405;
        double r135413 = log(r135412);
        double r135414 = b;
        double r135415 = r135413 - r135414;
        double r135416 = r135410 * r135415;
        double r135417 = r135409 + r135416;
        double r135418 = exp(r135417);
        double r135419 = r135403 * r135418;
        return r135419;
}

double f(double x, double y, double z, double t, double a, double b) {
        double r135420 = 1.0;
        double r135421 = sqrt(r135420);
        double r135422 = 1.0;
        double r135423 = log(r135422);
        double r135424 = 0.5;
        double r135425 = z;
        double r135426 = 2.0;
        double r135427 = pow(r135425, r135426);
        double r135428 = pow(r135422, r135426);
        double r135429 = r135427 / r135428;
        double r135430 = b;
        double r135431 = fma(r135422, r135425, r135430);
        double r135432 = fma(r135424, r135429, r135431);
        double r135433 = r135423 - r135432;
        double r135434 = a;
        double r135435 = log(r135425);
        double r135436 = t;
        double r135437 = r135435 - r135436;
        double r135438 = y;
        double r135439 = r135437 * r135438;
        double r135440 = fma(r135433, r135434, r135439);
        double r135441 = exp(r135440);
        double r135442 = x;
        double r135443 = r135441 * r135442;
        double r135444 = r135421 * r135443;
        return r135444;
}

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

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

    \[\leadsto e^{\mathsf{fma}\left(y, \log z - t, 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)\right)} \cdot x\]
  4. Simplified0.3

    \[\leadsto e^{\mathsf{fma}\left(y, \log z - t, 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)\right)} \cdot x\]
  5. Using strategy rm
  6. Applied add-sqr-sqrt0.3

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

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

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

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

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

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

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

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