Average Error: 2.2 → 1.1
Time: 42.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} t_1 := t \cdot \log a\\ t_2 := y \cdot \log z\\ t_3 := \frac{x \cdot e^{\left(t_2 + \left(t - 1\right) \cdot \log a\right) - b}}{y}\\ \mathbf{if}\;t_3 \leq -8.538211024059792 \cdot 10^{-135}:\\ \;\;\;\;\begin{array}{l} t_4 := \frac{{z}^{y}}{a \cdot e^{b}} \cdot \frac{x}{y}\\ t_4 + t_4 \cdot t_1 \end{array}\\ \mathbf{elif}\;t_3 \leq 1.69252999221247 \cdot 10^{-128}:\\ \;\;\;\;\frac{x}{\frac{y}{e^{t_2 - \left(b - \left(t_1 - \log a\right)\right)}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{e^{b} \cdot \frac{y}{x \cdot \left({a}^{t} \cdot \frac{{z}^{y}}{a}\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}
t_1 := t \cdot \log a\\
t_2 := y \cdot \log z\\
t_3 := \frac{x \cdot e^{\left(t_2 + \left(t - 1\right) \cdot \log a\right) - b}}{y}\\
\mathbf{if}\;t_3 \leq -8.538211024059792 \cdot 10^{-135}:\\
\;\;\;\;\begin{array}{l}
t_4 := \frac{{z}^{y}}{a \cdot e^{b}} \cdot \frac{x}{y}\\
t_4 + t_4 \cdot t_1
\end{array}\\

\mathbf{elif}\;t_3 \leq 1.69252999221247 \cdot 10^{-128}:\\
\;\;\;\;\frac{x}{\frac{y}{e^{t_2 - \left(b - \left(t_1 - \log a\right)\right)}}}\\

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


\end{array}
(FPCore (x y z t a b)
 :precision binary64
 (/ (* x (exp (- (+ (* y (log z)) (* (- t 1.0) (log a))) b))) y))
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (* t (log a)))
        (t_2 (* y (log z)))
        (t_3 (/ (* x (exp (- (+ t_2 (* (- t 1.0) (log a))) b))) y)))
   (if (<= t_3 -8.538211024059792e-135)
     (let* ((t_4 (* (/ (pow z y) (* a (exp b))) (/ x y)))) (+ t_4 (* t_4 t_1)))
     (if (<= t_3 1.69252999221247e-128)
       (/ x (/ y (exp (- t_2 (- b (- t_1 (log a)))))))
       (/ 1.0 (* (exp b) (/ y (* x (* (pow a t) (/ (pow z y) a))))))))))
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 t_1 = t * log(a);
	double t_2 = y * log(z);
	double t_3 = (x * exp((t_2 + ((t - 1.0) * log(a))) - b)) / y;
	double tmp;
	if (t_3 <= -8.538211024059792e-135) {
		double t_4_1 = (pow(z, y) / (a * exp(b))) * (x / y);
		tmp = t_4_1 + (t_4_1 * t_1);
	} else if (t_3 <= 1.69252999221247e-128) {
		tmp = x / (y / exp(t_2 - (b - (t_1 - log(a)))));
	} else {
		tmp = 1.0 / (exp(b) * (y / (x * (pow(a, t) * (pow(z, y) / a)))));
	}
	return tmp;
}

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.2
Target11.4
Herbie1.1
\[\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 3 regimes
  2. if (/.f64 (*.f64 x (exp.f64 (-.f64 (+.f64 (*.f64 y (log.f64 z)) (*.f64 (-.f64 t 1) (log.f64 a))) b))) y) < -8.5382110240597924e-135

    1. Initial program 5.9

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

      \[\leadsto \color{blue}{\frac{e^{\log z \cdot y - \left(\log a + b\right)} \cdot x}{y} + \frac{\log a \cdot \left(t \cdot \left(e^{\log z \cdot y - \left(\log a + b\right)} \cdot x\right)\right)}{y}} \]
    3. Simplified11.9

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

    if -8.5382110240597924e-135 < (/.f64 (*.f64 x (exp.f64 (-.f64 (+.f64 (*.f64 y (log.f64 z)) (*.f64 (-.f64 t 1) (log.f64 a))) b))) y) < 1.6925299922124701e-128

    1. Initial program 1.6

      \[\frac{x \cdot e^{\left(y \cdot \log z + \left(t - 1\right) \cdot \log a\right) - b}}{y} \]
    2. Applied associate-/l*_binary640.2

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

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

      \[\leadsto \frac{x}{\frac{y}{\frac{{z}^{y}}{\frac{e^{b}}{\color{blue}{{a}^{t} \cdot {a}^{-1}}}}}} \]
    5. Applied add-exp-log_binary6420.0

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

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

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

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

      \[\leadsto \frac{x}{\frac{y}{\frac{\color{blue}{e^{\log z \cdot y}}}{e^{b - \left(\log a \cdot t + \log \left({a}^{-1}\right)\right)}}}} \]
    10. Applied div-exp_binary640.3

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

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

    if 1.6925299922124701e-128 < (/.f64 (*.f64 x (exp.f64 (-.f64 (+.f64 (*.f64 y (log.f64 z)) (*.f64 (-.f64 t 1) (log.f64 a))) b))) y)

    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. Applied clear-num_binary646.0

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{x \cdot e^{\left(y \cdot \log z + \left(t - 1\right) \cdot \log a\right) - b}}{y} \leq -8.538211024059792 \cdot 10^{-135}:\\ \;\;\;\;\frac{{z}^{y}}{a \cdot e^{b}} \cdot \frac{x}{y} + \left(\frac{{z}^{y}}{a \cdot e^{b}} \cdot \frac{x}{y}\right) \cdot \left(t \cdot \log a\right)\\ \mathbf{elif}\;\frac{x \cdot e^{\left(y \cdot \log z + \left(t - 1\right) \cdot \log a\right) - b}}{y} \leq 1.69252999221247 \cdot 10^{-128}:\\ \;\;\;\;\frac{x}{\frac{y}{e^{y \cdot \log z - \left(b - \left(t \cdot \log a - \log a\right)\right)}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{e^{b} \cdot \frac{y}{x \cdot \left({a}^{t} \cdot \frac{{z}^{y}}{a}\right)}}\\ \end{array} \]

Reproduce

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