Average Error: 2.1 → 0.3
Time: 46.4s
Precision: 64
\[x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)}\]
\[x \cdot {\left(e^{\sqrt[3]{\mathsf{fma}\left(y, \log z - t, a \cdot \log 1 - \mathsf{fma}\left(z, 1, b\right) \cdot a\right)} \cdot \sqrt[3]{\mathsf{fma}\left(y, \log z - t, a \cdot \log 1 - \mathsf{fma}\left(z, 1, b\right) \cdot a\right)}}\right)}^{\left(\sqrt[3]{\mathsf{fma}\left(y, \log z - t, a \cdot \log 1 - \mathsf{fma}\left(z, 1, b\right) \cdot a\right)}\right)}\]
x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)}
x \cdot {\left(e^{\sqrt[3]{\mathsf{fma}\left(y, \log z - t, a \cdot \log 1 - \mathsf{fma}\left(z, 1, b\right) \cdot a\right)} \cdot \sqrt[3]{\mathsf{fma}\left(y, \log z - t, a \cdot \log 1 - \mathsf{fma}\left(z, 1, b\right) \cdot a\right)}}\right)}^{\left(\sqrt[3]{\mathsf{fma}\left(y, \log z - t, a \cdot \log 1 - \mathsf{fma}\left(z, 1, b\right) \cdot a\right)}\right)}
double f(double x, double y, double z, double t, double a, double b) {
        double r4698982 = x;
        double r4698983 = y;
        double r4698984 = z;
        double r4698985 = log(r4698984);
        double r4698986 = t;
        double r4698987 = r4698985 - r4698986;
        double r4698988 = r4698983 * r4698987;
        double r4698989 = a;
        double r4698990 = 1.0;
        double r4698991 = r4698990 - r4698984;
        double r4698992 = log(r4698991);
        double r4698993 = b;
        double r4698994 = r4698992 - r4698993;
        double r4698995 = r4698989 * r4698994;
        double r4698996 = r4698988 + r4698995;
        double r4698997 = exp(r4698996);
        double r4698998 = r4698982 * r4698997;
        return r4698998;
}

double f(double x, double y, double z, double t, double a, double b) {
        double r4698999 = x;
        double r4699000 = y;
        double r4699001 = z;
        double r4699002 = log(r4699001);
        double r4699003 = t;
        double r4699004 = r4699002 - r4699003;
        double r4699005 = a;
        double r4699006 = 1.0;
        double r4699007 = log(r4699006);
        double r4699008 = r4699005 * r4699007;
        double r4699009 = b;
        double r4699010 = fma(r4699001, r4699006, r4699009);
        double r4699011 = r4699010 * r4699005;
        double r4699012 = r4699008 - r4699011;
        double r4699013 = fma(r4699000, r4699004, r4699012);
        double r4699014 = cbrt(r4699013);
        double r4699015 = r4699014 * r4699014;
        double r4699016 = exp(r4699015);
        double r4699017 = pow(r4699016, r4699014);
        double r4699018 = r4698999 * r4699017;
        return r4699018;
}

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

    \[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}{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, \color{blue}{a \cdot \log 1 - \left(1 \cdot \left(a \cdot z\right) + a \cdot b\right)}\right)}\]
  4. Simplified0.3

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

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

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

Reproduce

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