Average Error: 2.0 → 0.3
Time: 2.5m
Precision: 64
\[x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)}\]
\[{\left(e^{\sqrt[3]{\mathsf{fma}\left(y, \log z - t, a \cdot \left(\left(\log 1 - \mathsf{fma}\left(\frac{1}{2}, \frac{z}{1} \cdot \frac{z}{1}, 1 \cdot z\right)\right) - b\right)\right)} \cdot \sqrt[3]{\mathsf{fma}\left(y, \log z - t, a \cdot \left(\left(\log 1 - \mathsf{fma}\left(\frac{1}{2}, \frac{z}{1} \cdot \frac{z}{1}, 1 \cdot z\right)\right) - b\right)\right)}}\right)}^{\left(\sqrt[3]{\mathsf{fma}\left(y, \log z - t, a \cdot \left(\left(\log 1 - \mathsf{fma}\left(\frac{1}{2}, \frac{z}{1} \cdot \frac{z}{1}, 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)}
{\left(e^{\sqrt[3]{\mathsf{fma}\left(y, \log z - t, a \cdot \left(\left(\log 1 - \mathsf{fma}\left(\frac{1}{2}, \frac{z}{1} \cdot \frac{z}{1}, 1 \cdot z\right)\right) - b\right)\right)} \cdot \sqrt[3]{\mathsf{fma}\left(y, \log z - t, a \cdot \left(\left(\log 1 - \mathsf{fma}\left(\frac{1}{2}, \frac{z}{1} \cdot \frac{z}{1}, 1 \cdot z\right)\right) - b\right)\right)}}\right)}^{\left(\sqrt[3]{\mathsf{fma}\left(y, \log z - t, a \cdot \left(\left(\log 1 - \mathsf{fma}\left(\frac{1}{2}, \frac{z}{1} \cdot \frac{z}{1}, 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 r5415786 = x;
        double r5415787 = y;
        double r5415788 = z;
        double r5415789 = log(r5415788);
        double r5415790 = t;
        double r5415791 = r5415789 - r5415790;
        double r5415792 = r5415787 * r5415791;
        double r5415793 = a;
        double r5415794 = 1.0;
        double r5415795 = r5415794 - r5415788;
        double r5415796 = log(r5415795);
        double r5415797 = b;
        double r5415798 = r5415796 - r5415797;
        double r5415799 = r5415793 * r5415798;
        double r5415800 = r5415792 + r5415799;
        double r5415801 = exp(r5415800);
        double r5415802 = r5415786 * r5415801;
        return r5415802;
}

double f(double x, double y, double z, double t, double a, double b) {
        double r5415803 = y;
        double r5415804 = z;
        double r5415805 = log(r5415804);
        double r5415806 = t;
        double r5415807 = r5415805 - r5415806;
        double r5415808 = a;
        double r5415809 = 1.0;
        double r5415810 = log(r5415809);
        double r5415811 = 0.5;
        double r5415812 = r5415804 / r5415809;
        double r5415813 = r5415812 * r5415812;
        double r5415814 = r5415809 * r5415804;
        double r5415815 = fma(r5415811, r5415813, r5415814);
        double r5415816 = r5415810 - r5415815;
        double r5415817 = b;
        double r5415818 = r5415816 - r5415817;
        double r5415819 = r5415808 * r5415818;
        double r5415820 = fma(r5415803, r5415807, r5415819);
        double r5415821 = cbrt(r5415820);
        double r5415822 = r5415821 * r5415821;
        double r5415823 = exp(r5415822);
        double r5415824 = pow(r5415823, r5415821);
        double r5415825 = x;
        double r5415826 = r5415824 * r5415825;
        return r5415826;
}

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

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

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

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

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

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

Reproduce

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