Average Error: 1.8 → 0.2
Time: 16.0s
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^{\sqrt[3]{{\left(\mathsf{fma}\left(\log z - t, y, \mathsf{fma}\left(a, \log 1, -\mathsf{fma}\left(a, b, 1 \cdot \left(a \cdot z\right)\right)\right)\right)\right)}^{3}}}\]
x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)}
x \cdot e^{\sqrt[3]{{\left(\mathsf{fma}\left(\log z - t, y, \mathsf{fma}\left(a, \log 1, -\mathsf{fma}\left(a, b, 1 \cdot \left(a \cdot z\right)\right)\right)\right)\right)}^{3}}}
double f(double x, double y, double z, double t, double a, double b) {
        double r151005 = x;
        double r151006 = y;
        double r151007 = z;
        double r151008 = log(r151007);
        double r151009 = t;
        double r151010 = r151008 - r151009;
        double r151011 = r151006 * r151010;
        double r151012 = a;
        double r151013 = 1.0;
        double r151014 = r151013 - r151007;
        double r151015 = log(r151014);
        double r151016 = b;
        double r151017 = r151015 - r151016;
        double r151018 = r151012 * r151017;
        double r151019 = r151011 + r151018;
        double r151020 = exp(r151019);
        double r151021 = r151005 * r151020;
        return r151021;
}

double f(double x, double y, double z, double t, double a, double b) {
        double r151022 = x;
        double r151023 = z;
        double r151024 = log(r151023);
        double r151025 = t;
        double r151026 = r151024 - r151025;
        double r151027 = y;
        double r151028 = a;
        double r151029 = 1.0;
        double r151030 = log(r151029);
        double r151031 = b;
        double r151032 = r151028 * r151023;
        double r151033 = r151029 * r151032;
        double r151034 = fma(r151028, r151031, r151033);
        double r151035 = -r151034;
        double r151036 = fma(r151028, r151030, r151035);
        double r151037 = fma(r151026, r151027, r151036);
        double r151038 = 3.0;
        double r151039 = pow(r151037, r151038);
        double r151040 = cbrt(r151039);
        double r151041 = exp(r151040);
        double r151042 = r151022 * r151041;
        return r151042;
}

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

    \[x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)}\]
  2. Taylor expanded around 0 0.4

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

    \[\leadsto x \cdot e^{y \cdot \left(\log z - t\right) + \color{blue}{\mathsf{fma}\left(a, \log 1, -\mathsf{fma}\left(a, b, 1 \cdot \left(a \cdot z\right)\right)\right)}}\]
  4. Using strategy rm
  5. Applied add-cbrt-cube0.4

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

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

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

Reproduce

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