Average Error: 1.8 → 0.6
Time: 9.9s
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}\;\left(t - 1\right) \cdot \log a \le -89857766.7366942018 \lor \neg \left(\left(t - 1\right) \cdot \log a \le 239.969958721699498\right):\\ \;\;\;\;\frac{x \cdot e^{\left(y \cdot \log z + \left(t - 1\right) \cdot \log a\right) - b}}{y}\\ \mathbf{else}:\\ \;\;\;\;\frac{x \cdot \left({a}^{t} \cdot e^{y \cdot \log z - b}\right)}{y \cdot {a}^{1}}\\ \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 \le -89857766.7366942018 \lor \neg \left(\left(t - 1\right) \cdot \log a \le 239.969958721699498\right):\\
\;\;\;\;\frac{x \cdot e^{\left(y \cdot \log z + \left(t - 1\right) \cdot \log a\right) - b}}{y}\\

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

\end{array}
double code(double x, double y, double z, double t, double a, double b) {
	return ((x * exp((((y * log(z)) + ((t - 1.0) * log(a))) - b))) / y);
}
double code(double x, double y, double z, double t, double a, double b) {
	double VAR;
	if (((((t - 1.0) * log(a)) <= -89857766.7366942) || !(((t - 1.0) * log(a)) <= 239.9699587216995))) {
		VAR = ((x * exp((((y * log(z)) + ((t - 1.0) * log(a))) - b))) / y);
	} else {
		VAR = ((x * (pow(a, t) * exp(((y * log(z)) - b)))) / (y * 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

Original1.8
Target10.8
Herbie0.6
\[\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 (* (- t 1.0) (log a)) < -89857766.7366942 or 239.9699587216995 < (* (- t 1.0) (log a))

    1. Initial program 0.3

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

    if -89857766.7366942 < (* (- t 1.0) (log a)) < 239.9699587216995

    1. Initial program 4.4

      \[\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 +-commutative4.4

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

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

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

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

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

      \[\leadsto \frac{x \cdot \color{blue}{\frac{{a}^{t} \cdot e^{y \cdot \log z - b}}{{a}^{1}}}}{y}\]
    10. Applied associate-*r/2.9

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

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

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

Reproduce

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