Average Error: 1.8 → 0.3
Time: 14.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 e^{y \cdot \log \left(\sqrt[3]{z} \cdot \sqrt[3]{z}\right) + \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(\log \left(\sqrt[3]{z}\right) - t\right)\right)}\]
x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)}
x \cdot e^{y \cdot \log \left(\sqrt[3]{z} \cdot \sqrt[3]{z}\right) + \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(\log \left(\sqrt[3]{z}\right) - t\right)\right)}
double f(double x, double y, double z, double t, double a, double b) {
        double r92135 = x;
        double r92136 = y;
        double r92137 = z;
        double r92138 = log(r92137);
        double r92139 = t;
        double r92140 = r92138 - r92139;
        double r92141 = r92136 * r92140;
        double r92142 = a;
        double r92143 = 1.0;
        double r92144 = r92143 - r92137;
        double r92145 = log(r92144);
        double r92146 = b;
        double r92147 = r92145 - r92146;
        double r92148 = r92142 * r92147;
        double r92149 = r92141 + r92148;
        double r92150 = exp(r92149);
        double r92151 = r92135 * r92150;
        return r92151;
}

double f(double x, double y, double z, double t, double a, double b) {
        double r92152 = x;
        double r92153 = y;
        double r92154 = z;
        double r92155 = cbrt(r92154);
        double r92156 = r92155 * r92155;
        double r92157 = log(r92156);
        double r92158 = r92153 * r92157;
        double r92159 = 1.0;
        double r92160 = log(r92159);
        double r92161 = 0.5;
        double r92162 = 2.0;
        double r92163 = pow(r92154, r92162);
        double r92164 = pow(r92159, r92162);
        double r92165 = r92163 / r92164;
        double r92166 = r92159 * r92154;
        double r92167 = fma(r92161, r92165, r92166);
        double r92168 = b;
        double r92169 = r92167 + r92168;
        double r92170 = r92160 - r92169;
        double r92171 = a;
        double r92172 = log(r92155);
        double r92173 = t;
        double r92174 = r92172 - r92173;
        double r92175 = r92153 * r92174;
        double r92176 = fma(r92170, r92171, r92175);
        double r92177 = r92158 + r92176;
        double r92178 = exp(r92177);
        double r92179 = r92152 * r92178;
        return r92179;
}

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.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-cube-cbrt0.5

    \[\leadsto x \cdot e^{y \cdot \left(\log \color{blue}{\left(\left(\sqrt[3]{z} \cdot \sqrt[3]{z}\right) \cdot \sqrt[3]{z}\right)} - 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)}\]
  5. Applied log-prod0.5

    \[\leadsto x \cdot e^{y \cdot \left(\color{blue}{\left(\log \left(\sqrt[3]{z} \cdot \sqrt[3]{z}\right) + \log \left(\sqrt[3]{z}\right)\right)} - 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)}\]
  6. Applied associate--l+0.5

    \[\leadsto x \cdot e^{y \cdot \color{blue}{\left(\log \left(\sqrt[3]{z} \cdot \sqrt[3]{z}\right) + \left(\log \left(\sqrt[3]{z}\right) - 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)}\]
  7. Applied distribute-lft-in0.5

    \[\leadsto x \cdot e^{\color{blue}{\left(y \cdot \log \left(\sqrt[3]{z} \cdot \sqrt[3]{z}\right) + y \cdot \left(\log \left(\sqrt[3]{z}\right) - 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)}\]
  8. Applied associate-+l+0.5

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

    \[\leadsto x \cdot e^{y \cdot \log \left(\sqrt[3]{z} \cdot \sqrt[3]{z}\right) + \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(\log \left(\sqrt[3]{z}\right) - t\right)\right)}}\]
  10. Final simplification0.3

    \[\leadsto x \cdot e^{y \cdot \log \left(\sqrt[3]{z} \cdot \sqrt[3]{z}\right) + \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(\log \left(\sqrt[3]{z}\right) - t\right)\right)}\]

Reproduce

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