Average Error: 2.0 → 0.3
Time: 16.5s
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(\left(\sqrt[3]{e^{\mathsf{fma}\left(y, \log z - t, \mathsf{fma}\left(\sqrt{\log 1} + \sqrt{\frac{1}{2} \cdot \frac{{z}^{2}}{{1}^{2}} + 1 \cdot z}, \sqrt{\log 1} - \sqrt{\frac{1}{2} \cdot \frac{{z}^{2}}{{1}^{2}} + 1 \cdot z}, -b \cdot 1\right) \cdot a\right) + \mathsf{fma}\left(-b, 1, b \cdot 1\right) \cdot a}} \cdot \sqrt[3]{e^{\mathsf{fma}\left(y, \log z - t, \mathsf{fma}\left(\sqrt{\log 1} + \sqrt{\frac{1}{2} \cdot \frac{{z}^{2}}{{1}^{2}} + 1 \cdot z}, \sqrt{\log 1} - \sqrt{\frac{1}{2} \cdot \frac{{z}^{2}}{{1}^{2}} + 1 \cdot z}, -b \cdot 1\right) \cdot a\right) + \mathsf{fma}\left(-b, 1, b \cdot 1\right) \cdot a}}\right) \cdot \sqrt[3]{e^{\mathsf{fma}\left(y, \log z - t, \mathsf{fma}\left(\sqrt{\log 1} + \sqrt{\frac{1}{2} \cdot \frac{{z}^{2}}{{1}^{2}} + 1 \cdot z}, \sqrt{\log 1} - \sqrt{\frac{1}{2} \cdot \frac{{z}^{2}}{{1}^{2}} + 1 \cdot z}, -b \cdot 1\right) \cdot a\right) + \mathsf{fma}\left(-b, 1, b \cdot 1\right) \cdot a}}\right)\]
x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)}
x \cdot \left(\left(\sqrt[3]{e^{\mathsf{fma}\left(y, \log z - t, \mathsf{fma}\left(\sqrt{\log 1} + \sqrt{\frac{1}{2} \cdot \frac{{z}^{2}}{{1}^{2}} + 1 \cdot z}, \sqrt{\log 1} - \sqrt{\frac{1}{2} \cdot \frac{{z}^{2}}{{1}^{2}} + 1 \cdot z}, -b \cdot 1\right) \cdot a\right) + \mathsf{fma}\left(-b, 1, b \cdot 1\right) \cdot a}} \cdot \sqrt[3]{e^{\mathsf{fma}\left(y, \log z - t, \mathsf{fma}\left(\sqrt{\log 1} + \sqrt{\frac{1}{2} \cdot \frac{{z}^{2}}{{1}^{2}} + 1 \cdot z}, \sqrt{\log 1} - \sqrt{\frac{1}{2} \cdot \frac{{z}^{2}}{{1}^{2}} + 1 \cdot z}, -b \cdot 1\right) \cdot a\right) + \mathsf{fma}\left(-b, 1, b \cdot 1\right) \cdot a}}\right) \cdot \sqrt[3]{e^{\mathsf{fma}\left(y, \log z - t, \mathsf{fma}\left(\sqrt{\log 1} + \sqrt{\frac{1}{2} \cdot \frac{{z}^{2}}{{1}^{2}} + 1 \cdot z}, \sqrt{\log 1} - \sqrt{\frac{1}{2} \cdot \frac{{z}^{2}}{{1}^{2}} + 1 \cdot z}, -b \cdot 1\right) \cdot a\right) + \mathsf{fma}\left(-b, 1, b \cdot 1\right) \cdot a}}\right)
double f(double x, double y, double z, double t, double a, double b) {
        double r173136 = x;
        double r173137 = y;
        double r173138 = z;
        double r173139 = log(r173138);
        double r173140 = t;
        double r173141 = r173139 - r173140;
        double r173142 = r173137 * r173141;
        double r173143 = a;
        double r173144 = 1.0;
        double r173145 = r173144 - r173138;
        double r173146 = log(r173145);
        double r173147 = b;
        double r173148 = r173146 - r173147;
        double r173149 = r173143 * r173148;
        double r173150 = r173142 + r173149;
        double r173151 = exp(r173150);
        double r173152 = r173136 * r173151;
        return r173152;
}

double f(double x, double y, double z, double t, double a, double b) {
        double r173153 = x;
        double r173154 = y;
        double r173155 = z;
        double r173156 = log(r173155);
        double r173157 = t;
        double r173158 = r173156 - r173157;
        double r173159 = 1.0;
        double r173160 = log(r173159);
        double r173161 = sqrt(r173160);
        double r173162 = 0.5;
        double r173163 = 2.0;
        double r173164 = pow(r173155, r173163);
        double r173165 = pow(r173159, r173163);
        double r173166 = r173164 / r173165;
        double r173167 = r173162 * r173166;
        double r173168 = r173159 * r173155;
        double r173169 = r173167 + r173168;
        double r173170 = sqrt(r173169);
        double r173171 = r173161 + r173170;
        double r173172 = r173161 - r173170;
        double r173173 = b;
        double r173174 = 1.0;
        double r173175 = r173173 * r173174;
        double r173176 = -r173175;
        double r173177 = fma(r173171, r173172, r173176);
        double r173178 = a;
        double r173179 = r173177 * r173178;
        double r173180 = fma(r173154, r173158, r173179);
        double r173181 = -r173173;
        double r173182 = fma(r173181, r173174, r173175);
        double r173183 = r173182 * r173178;
        double r173184 = r173180 + r173183;
        double r173185 = exp(r173184);
        double r173186 = cbrt(r173185);
        double r173187 = r173186 * r173186;
        double r173188 = r173187 * r173186;
        double r173189 = r173153 * r173188;
        return r173189;
}

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

    \[\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 *-un-lft-identity0.4

    \[\leadsto x \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) - \color{blue}{1 \cdot b}\right)}\]
  5. Applied add-sqr-sqrt0.4

    \[\leadsto x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\left(\log 1 - \color{blue}{\sqrt{\frac{1}{2} \cdot \frac{{z}^{2}}{{1}^{2}} + 1 \cdot z} \cdot \sqrt{\frac{1}{2} \cdot \frac{{z}^{2}}{{1}^{2}} + 1 \cdot z}}\right) - 1 \cdot b\right)}\]
  6. Applied add-sqr-sqrt0.4

    \[\leadsto x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\left(\color{blue}{\sqrt{\log 1} \cdot \sqrt{\log 1}} - \sqrt{\frac{1}{2} \cdot \frac{{z}^{2}}{{1}^{2}} + 1 \cdot z} \cdot \sqrt{\frac{1}{2} \cdot \frac{{z}^{2}}{{1}^{2}} + 1 \cdot z}\right) - 1 \cdot b\right)}\]
  7. Applied difference-of-squares0.4

    \[\leadsto x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\color{blue}{\left(\sqrt{\log 1} + \sqrt{\frac{1}{2} \cdot \frac{{z}^{2}}{{1}^{2}} + 1 \cdot z}\right) \cdot \left(\sqrt{\log 1} - \sqrt{\frac{1}{2} \cdot \frac{{z}^{2}}{{1}^{2}} + 1 \cdot z}\right)} - 1 \cdot b\right)}\]
  8. Applied prod-diff0.4

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

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

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

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

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

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