Average Error: 1.9 → 0.4
Time: 13.9s
Precision: 64
\[x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)}\]
\[x \cdot \log \left({\left(e^{{z}^{y}}\right)}^{\left(e^{\mathsf{fma}\left(\log 1 - \left(\mathsf{fma}\left(\frac{1}{2}, \frac{{z}^{2}}{{1}^{2}}, 1 \cdot z\right) + b\right), a, -1 \cdot \left(t \cdot y\right)\right)}\right)}\right)\]
x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)}
x \cdot \log \left({\left(e^{{z}^{y}}\right)}^{\left(e^{\mathsf{fma}\left(\log 1 - \left(\mathsf{fma}\left(\frac{1}{2}, \frac{{z}^{2}}{{1}^{2}}, 1 \cdot z\right) + b\right), a, -1 \cdot \left(t \cdot y\right)\right)}\right)}\right)
double f(double x, double y, double z, double t, double a, double b) {
        double r130048 = x;
        double r130049 = y;
        double r130050 = z;
        double r130051 = log(r130050);
        double r130052 = t;
        double r130053 = r130051 - r130052;
        double r130054 = r130049 * r130053;
        double r130055 = a;
        double r130056 = 1.0;
        double r130057 = r130056 - r130050;
        double r130058 = log(r130057);
        double r130059 = b;
        double r130060 = r130058 - r130059;
        double r130061 = r130055 * r130060;
        double r130062 = r130054 + r130061;
        double r130063 = exp(r130062);
        double r130064 = r130048 * r130063;
        return r130064;
}

double f(double x, double y, double z, double t, double a, double b) {
        double r130065 = x;
        double r130066 = z;
        double r130067 = y;
        double r130068 = pow(r130066, r130067);
        double r130069 = exp(r130068);
        double r130070 = 1.0;
        double r130071 = log(r130070);
        double r130072 = 0.5;
        double r130073 = 2.0;
        double r130074 = pow(r130066, r130073);
        double r130075 = pow(r130070, r130073);
        double r130076 = r130074 / r130075;
        double r130077 = r130070 * r130066;
        double r130078 = fma(r130072, r130076, r130077);
        double r130079 = b;
        double r130080 = r130078 + r130079;
        double r130081 = r130071 - r130080;
        double r130082 = a;
        double r130083 = -1.0;
        double r130084 = t;
        double r130085 = r130084 * r130067;
        double r130086 = r130083 * r130085;
        double r130087 = fma(r130081, r130082, r130086);
        double r130088 = exp(r130087);
        double r130089 = pow(r130069, r130088);
        double r130090 = log(r130089);
        double r130091 = r130065 * r130090;
        return r130091;
}

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. Taylor expanded around 0 0.5

    \[\leadsto x \cdot e^{y \cdot \left(\log z - t\right) + 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)}\]
  3. Using strategy rm
  4. Applied sub-neg0.5

    \[\leadsto x \cdot e^{y \cdot \color{blue}{\left(\log z + \left(-t\right)\right)} + a \cdot \left(\left(\log 1 - \left(\frac{1}{2} \cdot \frac{{z}^{2}}{{1}^{2}} + 1 \cdot z\right)\right) - b\right)}\]
  5. Applied distribute-lft-in0.5

    \[\leadsto x \cdot e^{\color{blue}{\left(y \cdot \log z + y \cdot \left(-t\right)\right)} + a \cdot \left(\left(\log 1 - \left(\frac{1}{2} \cdot \frac{{z}^{2}}{{1}^{2}} + 1 \cdot z\right)\right) - b\right)}\]
  6. Applied associate-+l+0.5

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

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

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

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

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

Reproduce

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