Average Error: 1.8 → 1.8
Time: 8.8s
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 -7.208256000558871 \cdot 10^{+20} \lor \neg \left(\left(t - 1\right) \cdot \log a \leq -182.1523251921793\right):\\ \;\;\;\;\frac{x \cdot e^{\left(\left(t - 1\right) \cdot \log a + y \cdot \log z\right) - b}}{y}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{{z}^{y} \cdot \frac{\frac{{a}^{t}}{{a}^{1}}}{e^{b}}}{y}\\ \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 -7.208256000558871 \cdot 10^{+20} \lor \neg \left(\left(t - 1\right) \cdot \log a \leq -182.1523251921793\right):\\
\;\;\;\;\frac{x \cdot e^{\left(\left(t - 1\right) \cdot \log a + y \cdot \log z\right) - b}}{y}\\

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

\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)))) <= -7.208256000558871e+20) || !(((double) (((double) (t - 1.0)) * ((double) log(a)))) <= -182.1523251921793))) {
		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) (x * (((double) (((double) pow(z, y)) * ((((double) pow(a, t)) / ((double) pow(a, 1.0))) / ((double) exp(b))))) / y)));
	}
	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

Original1.8
Target11.4
Herbie1.8
\[\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)) < -720825600055887135000 or -182.152325192179291 < (* (- 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 -720825600055887135000 < (* (- t 1.0) (log a)) < -182.152325192179291

    1. Initial program 6.0

      \[\frac{x \cdot e^{\left(y \cdot \log z + \left(t - 1\right) \cdot \log a\right) - b}}{y}\]
    2. Using strategy rm
    3. Applied *-un-lft-identity6.0

      \[\leadsto \frac{x \cdot e^{\left(y \cdot \log z + \left(t - 1\right) \cdot \log a\right) - b}}{\color{blue}{1 \cdot y}}\]
    4. Applied times-frac2.0

      \[\leadsto \color{blue}{\frac{x}{1} \cdot \frac{e^{\left(y \cdot \log z + \left(t - 1\right) \cdot \log a\right) - b}}{y}}\]
    5. Simplified2.0

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

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

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

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

Reproduce

herbie shell --seed 2020196 
(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))