Average Error: 1.8 → 1.2
Time: 15.2s
Precision: 64
\[\frac{x \cdot e^{\left(y \cdot \log z + \left(t - 1\right) \cdot \log a\right) - b}}{y}\]
\[\left(x \cdot \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)}}\right) \cdot \frac{1}{y}\]
\frac{x \cdot e^{\left(y \cdot \log z + \left(t - 1\right) \cdot \log a\right) - b}}{y}
\left(x \cdot \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)}}\right) \cdot \frac{1}{y}
double f(double x, double y, double z, double t, double a, double b) {
        double r400903 = x;
        double r400904 = y;
        double r400905 = z;
        double r400906 = log(r400905);
        double r400907 = r400904 * r400906;
        double r400908 = t;
        double r400909 = 1.0;
        double r400910 = r400908 - r400909;
        double r400911 = a;
        double r400912 = log(r400911);
        double r400913 = r400910 * r400912;
        double r400914 = r400907 + r400913;
        double r400915 = b;
        double r400916 = r400914 - r400915;
        double r400917 = exp(r400916);
        double r400918 = r400903 * r400917;
        double r400919 = r400918 / r400904;
        return r400919;
}

double f(double x, double y, double z, double t, double a, double b) {
        double r400920 = x;
        double r400921 = 1.0;
        double r400922 = a;
        double r400923 = r400921 / r400922;
        double r400924 = 1.0;
        double r400925 = pow(r400923, r400924);
        double r400926 = y;
        double r400927 = z;
        double r400928 = r400921 / r400927;
        double r400929 = log(r400928);
        double r400930 = log(r400923);
        double r400931 = t;
        double r400932 = b;
        double r400933 = fma(r400930, r400931, r400932);
        double r400934 = fma(r400926, r400929, r400933);
        double r400935 = exp(r400934);
        double r400936 = r400925 / r400935;
        double r400937 = r400920 * r400936;
        double r400938 = r400921 / r400926;
        double r400939 = r400937 * r400938;
        return r400939;
}

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

Original1.8
Target11.6
Herbie1.2
\[\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 1.8

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

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

    \[\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 div-inv1.2

    \[\leadsto \color{blue}{\left(x \cdot \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)}}\right) \cdot \frac{1}{y}}\]
  6. Final simplification1.2

    \[\leadsto \left(x \cdot \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)}}\right) \cdot \frac{1}{y}\]

Reproduce

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