Average Error: 1.8 → 1.2
Time: 12.6s
Precision: 64
\[\frac{x \cdot e^{\left(y \cdot \log z + \left(t - 1\right) \cdot \log a\right) - b}}{y}\]
\[\frac{1}{\frac{y}{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)}}}}\]
\frac{x \cdot e^{\left(y \cdot \log z + \left(t - 1\right) \cdot \log a\right) - b}}{y}
\frac{1}{\frac{y}{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)}}}}
double f(double x, double y, double z, double t, double a, double b) {
        double r399846 = x;
        double r399847 = y;
        double r399848 = z;
        double r399849 = log(r399848);
        double r399850 = r399847 * r399849;
        double r399851 = t;
        double r399852 = 1.0;
        double r399853 = r399851 - r399852;
        double r399854 = a;
        double r399855 = log(r399854);
        double r399856 = r399853 * r399855;
        double r399857 = r399850 + r399856;
        double r399858 = b;
        double r399859 = r399857 - r399858;
        double r399860 = exp(r399859);
        double r399861 = r399846 * r399860;
        double r399862 = r399861 / r399847;
        return r399862;
}

double f(double x, double y, double z, double t, double a, double b) {
        double r399863 = 1.0;
        double r399864 = y;
        double r399865 = x;
        double r399866 = a;
        double r399867 = r399863 / r399866;
        double r399868 = 1.0;
        double r399869 = pow(r399867, r399868);
        double r399870 = z;
        double r399871 = r399863 / r399870;
        double r399872 = log(r399871);
        double r399873 = log(r399867);
        double r399874 = t;
        double r399875 = b;
        double r399876 = fma(r399873, r399874, r399875);
        double r399877 = fma(r399864, r399872, r399876);
        double r399878 = exp(r399877);
        double r399879 = r399869 / r399878;
        double r399880 = r399865 * r399879;
        double r399881 = r399864 / r399880;
        double r399882 = r399863 / r399881;
        return r399882;
}

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.0
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 clear-num1.2

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

    \[\leadsto \frac{1}{\frac{y}{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)}}}}\]

Reproduce

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