Average Error: 2.0 → 1.3
Time: 20.0s
Precision: 64
\[\frac{x \cdot e^{\left(y \cdot \log z + \left(t - 1\right) \cdot \log a\right) - b}}{y}\]
\[\frac{x}{\frac{y}{\frac{{\left(\frac{1}{a}\right)}^{1}}{e^{\mathsf{fma}\left(y, \log \left(\frac{1}{z}\right), \mathsf{fma}\left(\log \left(\frac{1}{a}\right), t, b\right)\right)}}}}\]
\frac{x \cdot e^{\left(y \cdot \log z + \left(t - 1\right) \cdot \log a\right) - b}}{y}
\frac{x}{\frac{y}{\frac{{\left(\frac{1}{a}\right)}^{1}}{e^{\mathsf{fma}\left(y, \log \left(\frac{1}{z}\right), \mathsf{fma}\left(\log \left(\frac{1}{a}\right), t, b\right)\right)}}}}
double f(double x, double y, double z, double t, double a, double b) {
        double r488218 = x;
        double r488219 = y;
        double r488220 = z;
        double r488221 = log(r488220);
        double r488222 = r488219 * r488221;
        double r488223 = t;
        double r488224 = 1.0;
        double r488225 = r488223 - r488224;
        double r488226 = a;
        double r488227 = log(r488226);
        double r488228 = r488225 * r488227;
        double r488229 = r488222 + r488228;
        double r488230 = b;
        double r488231 = r488229 - r488230;
        double r488232 = exp(r488231);
        double r488233 = r488218 * r488232;
        double r488234 = r488233 / r488219;
        return r488234;
}

double f(double x, double y, double z, double t, double a, double b) {
        double r488235 = x;
        double r488236 = y;
        double r488237 = 1.0;
        double r488238 = a;
        double r488239 = r488237 / r488238;
        double r488240 = 1.0;
        double r488241 = pow(r488239, r488240);
        double r488242 = z;
        double r488243 = r488237 / r488242;
        double r488244 = log(r488243);
        double r488245 = log(r488239);
        double r488246 = t;
        double r488247 = b;
        double r488248 = fma(r488245, r488246, r488247);
        double r488249 = fma(r488236, r488244, r488248);
        double r488250 = exp(r488249);
        double r488251 = r488241 / r488250;
        double r488252 = r488236 / r488251;
        double r488253 = r488235 / r488252;
        return r488253;
}

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.0
Target11.4
Herbie1.3
\[\begin{array}{l} \mathbf{if}\;t \lt -0.88458485041274715:\\ \;\;\;\;\frac{x \cdot \frac{{a}^{\left(t - 1\right)}}{y}}{\left(b + 1\right) - y \cdot \log z}\\ \mathbf{elif}\;t \lt 852031.22883740731:\\ \;\;\;\;\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.0

    \[\frac{x \cdot e^{\left(y \cdot \log z + \left(t - 1\right) \cdot \log a\right) - b}}{y}\]
  2. Taylor expanded around inf 2.0

    \[\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}\]
  3. Simplified1.3

    \[\leadsto \frac{x \cdot \color{blue}{\frac{{\left(\frac{1}{a}\right)}^{1}}{e^{\mathsf{fma}\left(y, \log \left(\frac{1}{z}\right), \mathsf{fma}\left(\log \left(\frac{1}{a}\right), t, b\right)\right)}}}}{y}\]
  4. Using strategy rm
  5. Applied associate-/l*1.3

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

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

Reproduce

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