Average Error: 1.9 → 0.3
Time: 59.5s
Precision: 64
\[x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)}\]
\[e^{\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 x\]
x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)}
e^{\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 x
double f(double x, double y, double z, double t, double a, double b) {
        double r8088838 = x;
        double r8088839 = y;
        double r8088840 = z;
        double r8088841 = log(r8088840);
        double r8088842 = t;
        double r8088843 = r8088841 - r8088842;
        double r8088844 = r8088839 * r8088843;
        double r8088845 = a;
        double r8088846 = 1.0;
        double r8088847 = r8088846 - r8088840;
        double r8088848 = log(r8088847);
        double r8088849 = b;
        double r8088850 = r8088848 - r8088849;
        double r8088851 = r8088845 * r8088850;
        double r8088852 = r8088844 + r8088851;
        double r8088853 = exp(r8088852);
        double r8088854 = r8088838 * r8088853;
        return r8088854;
}

double f(double x, double y, double z, double t, double a, double b) {
        double r8088855 = y;
        double r8088856 = z;
        double r8088857 = log(r8088856);
        double r8088858 = t;
        double r8088859 = r8088857 - r8088858;
        double r8088860 = a;
        double r8088861 = 1.0;
        double r8088862 = log(r8088861);
        double r8088863 = 0.5;
        double r8088864 = r8088856 / r8088861;
        double r8088865 = r8088864 * r8088864;
        double r8088866 = r8088861 * r8088856;
        double r8088867 = fma(r8088863, r8088865, r8088866);
        double r8088868 = r8088862 - r8088867;
        double r8088869 = b;
        double r8088870 = r8088868 - r8088869;
        double r8088871 = r8088860 * r8088870;
        double r8088872 = fma(r8088855, r8088859, r8088871);
        double r8088873 = exp(r8088872);
        double r8088874 = x;
        double r8088875 = r8088873 * r8088874;
        return r8088875;
}

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}{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(1 \cdot z + \frac{1}{2} \cdot \frac{{z}^{2}}{{1}^{2}}\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}{1} \cdot \frac{z}{1}, 1 \cdot z\right)\right)} - b\right)\right)} \cdot x\]
  5. Final simplification0.3

    \[\leadsto e^{\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 x\]

Reproduce

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