Average Error: 2.1 → 0.3
Time: 12.6s
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(\sqrt[3]{{\left(e^{2 \cdot \mathsf{fma}\left(y, \log z - t, a \cdot \left(\log 1 - \left(\mathsf{fma}\left(\frac{1}{2}, \frac{{z}^{2}}{{1}^{2}}, 1 \cdot z\right) + b\right)\right)\right)}\right)}^{3}}\right)}^{\frac{1}{2}}\]
x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)}
x \cdot {\left(\sqrt[3]{{\left(e^{2 \cdot \mathsf{fma}\left(y, \log z - t, a \cdot \left(\log 1 - \left(\mathsf{fma}\left(\frac{1}{2}, \frac{{z}^{2}}{{1}^{2}}, 1 \cdot z\right) + b\right)\right)\right)}\right)}^{3}}\right)}^{\frac{1}{2}}
double f(double x, double y, double z, double t, double a, double b) {
        double r110027 = x;
        double r110028 = y;
        double r110029 = z;
        double r110030 = log(r110029);
        double r110031 = t;
        double r110032 = r110030 - r110031;
        double r110033 = r110028 * r110032;
        double r110034 = a;
        double r110035 = 1.0;
        double r110036 = r110035 - r110029;
        double r110037 = log(r110036);
        double r110038 = b;
        double r110039 = r110037 - r110038;
        double r110040 = r110034 * r110039;
        double r110041 = r110033 + r110040;
        double r110042 = exp(r110041);
        double r110043 = r110027 * r110042;
        return r110043;
}

double f(double x, double y, double z, double t, double a, double b) {
        double r110044 = x;
        double r110045 = 2.0;
        double r110046 = y;
        double r110047 = z;
        double r110048 = log(r110047);
        double r110049 = t;
        double r110050 = r110048 - r110049;
        double r110051 = a;
        double r110052 = 1.0;
        double r110053 = log(r110052);
        double r110054 = 0.5;
        double r110055 = pow(r110047, r110045);
        double r110056 = pow(r110052, r110045);
        double r110057 = r110055 / r110056;
        double r110058 = r110052 * r110047;
        double r110059 = fma(r110054, r110057, r110058);
        double r110060 = b;
        double r110061 = r110059 + r110060;
        double r110062 = r110053 - r110061;
        double r110063 = r110051 * r110062;
        double r110064 = fma(r110046, r110050, r110063);
        double r110065 = r110045 * r110064;
        double r110066 = exp(r110065);
        double r110067 = 3.0;
        double r110068 = pow(r110066, r110067);
        double r110069 = cbrt(r110068);
        double r110070 = pow(r110069, r110054);
        double r110071 = r110044 * r110070;
        return r110071;
}

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. 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 add-sqr-sqrt0.5

    \[\leadsto x \cdot \color{blue}{\left(\sqrt{e^{y \cdot \left(\log z - 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)}} \cdot \sqrt{e^{y \cdot \left(\log z - 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)}\]
  5. Using strategy rm
  6. Applied pow1/20.5

    \[\leadsto x \cdot \left(\sqrt{e^{y \cdot \left(\log z - 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)}} \cdot \color{blue}{{\left(e^{y \cdot \left(\log z - 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)}^{\frac{1}{2}}}\right)\]
  7. Applied pow1/20.5

    \[\leadsto x \cdot \left(\color{blue}{{\left(e^{y \cdot \left(\log z - 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)}^{\frac{1}{2}}} \cdot {\left(e^{y \cdot \left(\log z - 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)}^{\frac{1}{2}}\right)\]
  8. Applied pow-prod-down0.5

    \[\leadsto x \cdot \color{blue}{{\left(e^{y \cdot \left(\log z - 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)} \cdot e^{y \cdot \left(\log z - 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)}^{\frac{1}{2}}}\]
  9. Simplified0.3

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

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

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

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

Reproduce

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