Average Error: 2.0 → 1.9
Time: 10.3s
Precision: binary64
\[\frac{x \cdot e^{\left(y \cdot \log z + \left(t - 1\right) \cdot \log a\right) - b}}{y}\]
\[\begin{array}{l} \mathbf{if}\;\left(t - 1\right) \cdot \log a \leq -704.4577027056826 \lor \neg \left(\left(t - 1\right) \cdot \log a \leq -119.05853805921062\right):\\ \;\;\;\;\frac{x \cdot e^{\left(\left(t - 1\right) \cdot \log a + y \cdot \log z\right) - b}}{y}\\ \mathbf{else}:\\ \;\;\;\;\frac{{a}^{t} \cdot \left(x \cdot {z}^{y}\right)}{y \cdot \left(e^{b} \cdot {a}^{1}\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}\;\left(t - 1\right) \cdot \log a \leq -704.4577027056826 \lor \neg \left(\left(t - 1\right) \cdot \log a \leq -119.05853805921062\right):\\
\;\;\;\;\frac{x \cdot e^{\left(\left(t - 1\right) \cdot \log a + y \cdot \log z\right) - b}}{y}\\

\mathbf{else}:\\
\;\;\;\;\frac{{a}^{t} \cdot \left(x \cdot {z}^{y}\right)}{y \cdot \left(e^{b} \cdot {a}^{1}\right)}\\

\end{array}
double code(double x, double y, double z, double t, double a, double b) {
	return (((double) (x * ((double) exp(((double) (((double) (((double) (y * ((double) log(z)))) + ((double) (((double) (t - 1.0)) * ((double) log(a)))))) - b)))))) / y);
}
double code(double x, double y, double z, double t, double a, double b) {
	double VAR;
	if (((((double) (((double) (t - 1.0)) * ((double) log(a)))) <= -704.4577027056826) || !(((double) (((double) (t - 1.0)) * ((double) log(a)))) <= -119.05853805921062))) {
		VAR = (((double) (x * ((double) exp(((double) (((double) (((double) (((double) (t - 1.0)) * ((double) log(a)))) + ((double) (y * ((double) log(z)))))) - b)))))) / y);
	} else {
		VAR = (((double) (((double) pow(a, t)) * ((double) (x * ((double) pow(z, y)))))) / ((double) (y * ((double) (((double) exp(b)) * ((double) pow(a, 1.0)))))));
	}
	return VAR;
}

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

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original2.0
Target10.8
Herbie1.9
\[\begin{array}{l} \mathbf{if}\;t < -0.8845848504127471:\\ \;\;\;\;\frac{x \cdot \frac{{a}^{\left(t - 1\right)}}{y}}{\left(b + 1\right) - y \cdot \log z}\\ \mathbf{elif}\;t < 852031.2288374073:\\ \;\;\;\;\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 (* (- t 1.0) (log a)) < -704.45770270568255 or -119.058538059210619 < (* (- t 1.0) (log a))

    1. Initial program 0.6

      \[\frac{x \cdot e^{\left(y \cdot \log z + \left(t - 1\right) \cdot \log a\right) - b}}{y}\]

    if -704.45770270568255 < (* (- t 1.0) (log a)) < -119.058538059210619

    1. Initial program 6.6

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

      \[\leadsto \color{blue}{x \cdot \left(\frac{{a}^{\left(t - 1\right)}}{e^{b}} \cdot \frac{{z}^{y}}{y}\right)}\]
    3. Using strategy rm
    4. Applied sub-neg6.2

      \[\leadsto x \cdot \left(\frac{{a}^{\color{blue}{\left(t + \left(-1\right)\right)}}}{e^{b}} \cdot \frac{{z}^{y}}{y}\right)\]
    5. Applied unpow-prod-up6.2

      \[\leadsto x \cdot \left(\frac{\color{blue}{{a}^{t} \cdot {a}^{\left(-1\right)}}}{e^{b}} \cdot \frac{{z}^{y}}{y}\right)\]
    6. Applied associate-/l*6.2

      \[\leadsto x \cdot \left(\color{blue}{\frac{{a}^{t}}{\frac{e^{b}}{{a}^{\left(-1\right)}}}} \cdot \frac{{z}^{y}}{y}\right)\]
    7. Using strategy rm
    8. Applied frac-times6.2

      \[\leadsto x \cdot \color{blue}{\frac{{a}^{t} \cdot {z}^{y}}{\frac{e^{b}}{{a}^{\left(-1\right)}} \cdot y}}\]
    9. Applied associate-*r/6.1

      \[\leadsto \color{blue}{\frac{x \cdot \left({a}^{t} \cdot {z}^{y}\right)}{\frac{e^{b}}{{a}^{\left(-1\right)}} \cdot y}}\]
    10. Simplified6.1

      \[\leadsto \frac{\color{blue}{{a}^{t} \cdot \left({z}^{y} \cdot x\right)}}{\frac{e^{b}}{{a}^{\left(-1\right)}} \cdot y}\]
    11. Using strategy rm
    12. Applied div-inv6.1

      \[\leadsto \frac{{a}^{t} \cdot \left({z}^{y} \cdot x\right)}{\color{blue}{\left(e^{b} \cdot \frac{1}{{a}^{\left(-1\right)}}\right)} \cdot y}\]
    13. Simplified6.1

      \[\leadsto \frac{{a}^{t} \cdot \left({z}^{y} \cdot x\right)}{\left(e^{b} \cdot \color{blue}{{a}^{1}}\right) \cdot y}\]
  3. Recombined 2 regimes into one program.
  4. Final simplification1.9

    \[\leadsto \begin{array}{l} \mathbf{if}\;\left(t - 1\right) \cdot \log a \leq -704.4577027056826 \lor \neg \left(\left(t - 1\right) \cdot \log a \leq -119.05853805921062\right):\\ \;\;\;\;\frac{x \cdot e^{\left(\left(t - 1\right) \cdot \log a + y \cdot \log z\right) - b}}{y}\\ \mathbf{else}:\\ \;\;\;\;\frac{{a}^{t} \cdot \left(x \cdot {z}^{y}\right)}{y \cdot \left(e^{b} \cdot {a}^{1}\right)}\\ \end{array}\]

Reproduce

herbie shell --seed 2020199 
(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.0)) y)) (- (+ b 1.0) (* y (log z)))) (if (< t 852031.2288374073) (/ (* (/ x y) (pow a (- t 1.0))) (exp (- b (* (log z) y)))) (/ (* x (/ (pow a (- t 1.0)) y)) (- (+ b 1.0) (* y (log z))))))

  (/ (* x (exp (- (+ (* y (log z)) (* (- t 1.0) (log a))) b))) y))