Average Error: 2.1 → 1.4
Time: 29.4s
Precision: 64
\[\frac{x \cdot e^{\left(y \cdot \log z + \left(t - 1\right) \cdot \log a\right) - b}}{y}\]
\[\frac{x \cdot \frac{{a}^{\left(-1\right)}}{e^{\mathsf{fma}\left(y, -\log z, \mathsf{fma}\left(-\log a, t, b\right)\right)}}}{y}\]
\frac{x \cdot e^{\left(y \cdot \log z + \left(t - 1\right) \cdot \log a\right) - b}}{y}
\frac{x \cdot \frac{{a}^{\left(-1\right)}}{e^{\mathsf{fma}\left(y, -\log z, \mathsf{fma}\left(-\log a, t, b\right)\right)}}}{y}
double f(double x, double y, double z, double t, double a, double b) {
        double r290449 = x;
        double r290450 = y;
        double r290451 = z;
        double r290452 = log(r290451);
        double r290453 = r290450 * r290452;
        double r290454 = t;
        double r290455 = 1.0;
        double r290456 = r290454 - r290455;
        double r290457 = a;
        double r290458 = log(r290457);
        double r290459 = r290456 * r290458;
        double r290460 = r290453 + r290459;
        double r290461 = b;
        double r290462 = r290460 - r290461;
        double r290463 = exp(r290462);
        double r290464 = r290449 * r290463;
        double r290465 = r290464 / r290450;
        return r290465;
}

double f(double x, double y, double z, double t, double a, double b) {
        double r290466 = x;
        double r290467 = a;
        double r290468 = 1.0;
        double r290469 = -r290468;
        double r290470 = pow(r290467, r290469);
        double r290471 = y;
        double r290472 = z;
        double r290473 = log(r290472);
        double r290474 = -r290473;
        double r290475 = log(r290467);
        double r290476 = -r290475;
        double r290477 = t;
        double r290478 = b;
        double r290479 = fma(r290476, r290477, r290478);
        double r290480 = fma(r290471, r290474, r290479);
        double r290481 = exp(r290480);
        double r290482 = r290470 / r290481;
        double r290483 = r290466 * r290482;
        double r290484 = r290483 / r290471;
        return r290484;
}

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

Target

Original2.1
Target11.0
Herbie1.4
\[\begin{array}{l} \mathbf{if}\;t \lt -0.8845848504127471478852839936735108494759:\\ \;\;\;\;\frac{x \cdot \frac{{a}^{\left(t - 1\right)}}{y}}{\left(b + 1\right) - y \cdot \log z}\\ \mathbf{elif}\;t \lt 852031.228837407310493290424346923828125:\\ \;\;\;\;\frac{\frac{x}{y} \cdot {a}^{\left(t - 1\right)}}{e^{b - \log z \cdot y}}\\ \mathbf{else}:\\ \;\;\;\;\frac{x \cdot \frac{{a}^{\left(t - 1\right)}}{y}}{\left(b + 1\right) - y \cdot \log z}\\ \end{array}\]

Derivation

  1. Initial program 2.1

    \[\frac{x \cdot e^{\left(y \cdot \log z + \left(t - 1\right) \cdot \log a\right) - b}}{y}\]
  2. Using strategy rm
  3. Applied add-cube-cbrt2.1

    \[\leadsto \frac{x \cdot e^{\left(\color{blue}{\left(\sqrt[3]{y \cdot \log z} \cdot \sqrt[3]{y \cdot \log z}\right) \cdot \sqrt[3]{y \cdot \log z}} + \left(t - 1\right) \cdot \log a\right) - b}}{y}\]
  4. Taylor expanded around inf 2.1

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

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

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

Reproduce

herbie shell --seed 2019347 +o rules:numerics
(FPCore (x y z t a b)
  :name "Numeric.SpecFunctions:incompleteBetaWorker from math-functions-0.1.5.2, A"
  :precision binary64

  :herbie-target
  (if (< t -0.8845848504127471) (/ (* x (/ (pow a (- t 1)) y)) (- (+ b 1) (* y (log z)))) (if (< t 852031.2288374073) (/ (* (/ x y) (pow a (- t 1))) (exp (- b (* (log z) y)))) (/ (* x (/ (pow a (- t 1)) y)) (- (+ b 1) (* y (log z))))))

  (/ (* x (exp (- (+ (* y (log z)) (* (- t 1) (log a))) b))) y))