Average Error: 2.1 → 0.3
Time: 32.5s
Precision: 64
\[x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)}\]
\[{e}^{\left(\mathsf{fma}\left(y, \log z - t, a \cdot \left(\left(\log 1 - \mathsf{fma}\left(\frac{1}{2}, \frac{{z}^{2}}{{1}^{2}}, 1 \cdot z\right)\right) - b\right)\right)\right)} \cdot x\]
x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)}
{e}^{\left(\mathsf{fma}\left(y, \log z - t, a \cdot \left(\left(\log 1 - \mathsf{fma}\left(\frac{1}{2}, \frac{{z}^{2}}{{1}^{2}}, 1 \cdot z\right)\right) - b\right)\right)\right)} \cdot x
double f(double x, double y, double z, double t, double a, double b) {
        double r93312 = x;
        double r93313 = y;
        double r93314 = z;
        double r93315 = log(r93314);
        double r93316 = t;
        double r93317 = r93315 - r93316;
        double r93318 = r93313 * r93317;
        double r93319 = a;
        double r93320 = 1.0;
        double r93321 = r93320 - r93314;
        double r93322 = log(r93321);
        double r93323 = b;
        double r93324 = r93322 - r93323;
        double r93325 = r93319 * r93324;
        double r93326 = r93318 + r93325;
        double r93327 = exp(r93326);
        double r93328 = r93312 * r93327;
        return r93328;
}

double f(double x, double y, double z, double t, double a, double b) {
        double r93329 = exp(1.0);
        double r93330 = y;
        double r93331 = z;
        double r93332 = log(r93331);
        double r93333 = t;
        double r93334 = r93332 - r93333;
        double r93335 = a;
        double r93336 = 1.0;
        double r93337 = log(r93336);
        double r93338 = 0.5;
        double r93339 = 2.0;
        double r93340 = pow(r93331, r93339);
        double r93341 = pow(r93336, r93339);
        double r93342 = r93340 / r93341;
        double r93343 = r93336 * r93331;
        double r93344 = fma(r93338, r93342, r93343);
        double r93345 = r93337 - r93344;
        double r93346 = b;
        double r93347 = r93345 - r93346;
        double r93348 = r93335 * r93347;
        double r93349 = fma(r93330, r93334, r93348);
        double r93350 = pow(r93329, r93349);
        double r93351 = x;
        double r93352 = r93350 * r93351;
        return r93352;
}

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. Simplified1.9

    \[\leadsto \color{blue}{e^{\mathsf{fma}\left(y, \log z - t, a \cdot \left(\log \left(1 - z\right) - b\right)\right)} \cdot x}\]
  3. Taylor expanded around 0 0.3

    \[\leadsto e^{\mathsf{fma}\left(y, \log z - t, 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)\right)} \cdot x\]
  4. Simplified0.3

    \[\leadsto e^{\mathsf{fma}\left(y, \log z - t, a \cdot \left(\color{blue}{\left(\log 1 - \mathsf{fma}\left(\frac{1}{2}, \frac{{z}^{2}}{{1}^{2}}, 1 \cdot z\right)\right)} - b\right)\right)} \cdot x\]
  5. Using strategy rm
  6. Applied *-un-lft-identity0.3

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

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

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

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

Reproduce

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