Average Error: 2.0 → 0.3
Time: 30.9s
Precision: 64
\[x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)}\]
\[{e}^{\left(\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\]
x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)}
{e}^{\left(\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
double f(double x, double y, double z, double t, double a, double b) {
        double r97694 = x;
        double r97695 = y;
        double r97696 = z;
        double r97697 = log(r97696);
        double r97698 = t;
        double r97699 = r97697 - r97698;
        double r97700 = r97695 * r97699;
        double r97701 = a;
        double r97702 = 1.0;
        double r97703 = r97702 - r97696;
        double r97704 = log(r97703);
        double r97705 = b;
        double r97706 = r97704 - r97705;
        double r97707 = r97701 * r97706;
        double r97708 = r97700 + r97707;
        double r97709 = exp(r97708);
        double r97710 = r97694 * r97709;
        return r97710;
}

double f(double x, double y, double z, double t, double a, double b) {
        double r97711 = exp(1.0);
        double r97712 = y;
        double r97713 = z;
        double r97714 = log(r97713);
        double r97715 = t;
        double r97716 = r97714 - r97715;
        double r97717 = a;
        double r97718 = 1.0;
        double r97719 = log(r97718);
        double r97720 = 0.5;
        double r97721 = 2.0;
        double r97722 = pow(r97713, r97721);
        double r97723 = pow(r97718, r97721);
        double r97724 = r97722 / r97723;
        double r97725 = r97718 * r97713;
        double r97726 = fma(r97720, r97724, r97725);
        double r97727 = r97719 - r97726;
        double r97728 = b;
        double r97729 = r97727 - r97728;
        double r97730 = r97717 * r97729;
        double r97731 = fma(r97712, r97716, r97730);
        double r97732 = pow(r97711, r97731);
        double r97733 = x;
        double r97734 = r97732 * r97733;
        return r97734;
}

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 *-un-lft-identity0.3

    \[\leadsto e^{\color{blue}{1 \cdot \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\]
  7. Applied exp-prod0.3

    \[\leadsto \color{blue}{{\left(e^{1}\right)}^{\left(\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\]
  8. Simplified0.3

    \[\leadsto {\color{blue}{e}}^{\left(\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\]
  9. Final simplification0.3

    \[\leadsto {e}^{\left(\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\]

Reproduce

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