Average Error: 1.8 → 0.3
Time: 16.3s
Precision: 64
\[\frac{x \cdot e^{\left(y \cdot \log z + \left(t - 1\right) \cdot \log a\right) - b}}{y}\]
\[\begin{array}{l} \mathbf{if}\;a \le 3.1520248947255987 \cdot 10^{-105}:\\ \;\;\;\;\frac{x \cdot \frac{{\left(\frac{1}{a}\right)}^{1}}{\sqrt[3]{{\left(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)}^{3}}}}{y}\\ \mathbf{else}:\\ \;\;\;\;\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)}}}}\\ \end{array}\]
\frac{x \cdot e^{\left(y \cdot \log z + \left(t - 1\right) \cdot \log a\right) - b}}{y}
\begin{array}{l}
\mathbf{if}\;a \le 3.1520248947255987 \cdot 10^{-105}:\\
\;\;\;\;\frac{x \cdot \frac{{\left(\frac{1}{a}\right)}^{1}}{\sqrt[3]{{\left(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)}^{3}}}}{y}\\

\mathbf{else}:\\
\;\;\;\;\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)}}}}\\

\end{array}
double f(double x, double y, double z, double t, double a, double b) {
        double r575081 = x;
        double r575082 = y;
        double r575083 = z;
        double r575084 = log(r575083);
        double r575085 = r575082 * r575084;
        double r575086 = t;
        double r575087 = 1.0;
        double r575088 = r575086 - r575087;
        double r575089 = a;
        double r575090 = log(r575089);
        double r575091 = r575088 * r575090;
        double r575092 = r575085 + r575091;
        double r575093 = b;
        double r575094 = r575092 - r575093;
        double r575095 = exp(r575094);
        double r575096 = r575081 * r575095;
        double r575097 = r575096 / r575082;
        return r575097;
}

double f(double x, double y, double z, double t, double a, double b) {
        double r575098 = a;
        double r575099 = 3.1520248947255987e-105;
        bool r575100 = r575098 <= r575099;
        double r575101 = x;
        double r575102 = 1.0;
        double r575103 = r575102 / r575098;
        double r575104 = 1.0;
        double r575105 = pow(r575103, r575104);
        double r575106 = y;
        double r575107 = z;
        double r575108 = r575102 / r575107;
        double r575109 = log(r575108);
        double r575110 = log(r575103);
        double r575111 = t;
        double r575112 = b;
        double r575113 = fma(r575110, r575111, r575112);
        double r575114 = fma(r575106, r575109, r575113);
        double r575115 = exp(r575114);
        double r575116 = 3.0;
        double r575117 = pow(r575115, r575116);
        double r575118 = cbrt(r575117);
        double r575119 = r575105 / r575118;
        double r575120 = r575101 * r575119;
        double r575121 = r575120 / r575106;
        double r575122 = r575105 / r575115;
        double r575123 = r575106 / r575122;
        double r575124 = r575101 / r575123;
        double r575125 = r575100 ? r575121 : r575124;
        return r575125;
}

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
Target10.9
Herbie0.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. Split input into 2 regimes
  2. if a < 3.1520248947255987e-105

    1. Initial program 0.7

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

      \[\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. Simplified0.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 add-cbrt-cube0.1

      \[\leadsto \frac{x \cdot \frac{{\left(\frac{1}{a}\right)}^{1}}{\color{blue}{\sqrt[3]{\left(e^{\mathsf{fma}\left(y, \log \left(\frac{1}{z}\right), \mathsf{fma}\left(\log \left(\frac{1}{a}\right), t, b\right)\right)} \cdot 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 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}\]
    6. Simplified0.1

      \[\leadsto \frac{x \cdot \frac{{\left(\frac{1}{a}\right)}^{1}}{\sqrt[3]{\color{blue}{{\left(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)}^{3}}}}}{y}\]

    if 3.1520248947255987e-105 < a

    1. Initial program 2.3

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

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

      \[\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*0.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)}}}}}\]
  3. Recombined 2 regimes into one program.
  4. Final simplification0.3

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \le 3.1520248947255987 \cdot 10^{-105}:\\ \;\;\;\;\frac{x \cdot \frac{{\left(\frac{1}{a}\right)}^{1}}{\sqrt[3]{{\left(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)}^{3}}}}{y}\\ \mathbf{else}:\\ \;\;\;\;\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)}}}}\\ \end{array}\]

Reproduce

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