Average Error: 2.0 → 0.2
Time: 15.1s
Precision: 64
\[x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)}\]
\[x \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)}\]
x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)}
x \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)}
double f(double x, double y, double z, double t, double a, double b) {
        double r138847 = x;
        double r138848 = y;
        double r138849 = z;
        double r138850 = log(r138849);
        double r138851 = t;
        double r138852 = r138850 - r138851;
        double r138853 = r138848 * r138852;
        double r138854 = a;
        double r138855 = 1.0;
        double r138856 = r138855 - r138849;
        double r138857 = log(r138856);
        double r138858 = b;
        double r138859 = r138857 - r138858;
        double r138860 = r138854 * r138859;
        double r138861 = r138853 + r138860;
        double r138862 = exp(r138861);
        double r138863 = r138847 * r138862;
        return r138863;
}

double f(double x, double y, double z, double t, double a, double b) {
        double r138864 = x;
        double r138865 = y;
        double r138866 = z;
        double r138867 = log(r138866);
        double r138868 = t;
        double r138869 = r138867 - r138868;
        double r138870 = a;
        double r138871 = 1.0;
        double r138872 = log(r138871);
        double r138873 = 0.5;
        double r138874 = 2.0;
        double r138875 = pow(r138866, r138874);
        double r138876 = pow(r138871, r138874);
        double r138877 = r138875 / r138876;
        double r138878 = r138871 * r138866;
        double r138879 = fma(r138873, r138877, r138878);
        double r138880 = r138872 - r138879;
        double r138881 = b;
        double r138882 = r138880 - r138881;
        double r138883 = r138870 * r138882;
        double r138884 = fma(r138865, r138869, r138883);
        double r138885 = exp(r138884);
        double r138886 = r138864 * r138885;
        return r138886;
}

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

    \[\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.2

    \[\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 *-commutative0.2

    \[\leadsto \color{blue}{x \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)}}\]
  7. Final simplification0.2

    \[\leadsto x \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)}\]

Reproduce

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