Average Error: 2.0 → 1.4
Time: 18.8s
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 r580076 = x;
        double r580077 = y;
        double r580078 = z;
        double r580079 = log(r580078);
        double r580080 = r580077 * r580079;
        double r580081 = t;
        double r580082 = 1.0;
        double r580083 = r580081 - r580082;
        double r580084 = a;
        double r580085 = log(r580084);
        double r580086 = r580083 * r580085;
        double r580087 = r580080 + r580086;
        double r580088 = b;
        double r580089 = r580087 - r580088;
        double r580090 = exp(r580089);
        double r580091 = r580076 * r580090;
        double r580092 = r580091 / r580077;
        return r580092;
}

double f(double x, double y, double z, double t, double a, double b) {
        double r580093 = x;
        double r580094 = y;
        double r580095 = 1.0;
        double r580096 = a;
        double r580097 = r580095 / r580096;
        double r580098 = 1.0;
        double r580099 = pow(r580097, r580098);
        double r580100 = z;
        double r580101 = r580095 / r580100;
        double r580102 = log(r580101);
        double r580103 = log(r580097);
        double r580104 = t;
        double r580105 = b;
        double r580106 = fma(r580103, r580104, r580105);
        double r580107 = fma(r580094, r580102, r580106);
        double r580108 = exp(r580107);
        double r580109 = r580099 / r580108;
        double r580110 = r580094 / r580109;
        double r580111 = r580093 / r580110;
        return r580111;
}

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
Target10.9
Herbie1.4
\[\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.4

    \[\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.4

    \[\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 2020057 +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))