Average Error: 1.9 → 0.4
Time: 28.9s
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 := e^{\left(y \cdot \log z + \left(t - 1\right) \cdot \log a\right) - b}\\ t_2 := \frac{x \cdot t_1}{y}\\ t_3 := \frac{{a}^{t}}{a \cdot e^{b}}\\ \mathbf{if}\;t_2 \leq -2.2648629349364475 \cdot 10^{-40}:\\ \;\;\;\;\frac{x \cdot t_3}{y}\\ \mathbf{elif}\;t_2 \leq 2.117665316366963 \cdot 10^{-252}:\\ \;\;\;\;\frac{x}{\frac{y}{t_1}}\\ \mathbf{else}:\\ \;\;\;\;\frac{x \cdot \left(t_3 \cdot {z}^{y}\right)}{y}\\ \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 (exp (- (+ (* y (log z)) (* (- t 1.0) (log a))) b)))
        (t_2 (/ (* x t_1) y))
        (t_3 (/ (pow a t) (* a (exp b)))))
   (if (<= t_2 -2.2648629349364475e-40)
     (/ (* x t_3) y)
     (if (<= t_2 2.117665316366963e-252)
       (/ x (/ y t_1))
       (/ (* x (* t_3 (pow z y))) y)))))
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 = exp((((y * log(z)) + ((t - 1.0) * log(a))) - b));
	double t_2 = (x * t_1) / y;
	double t_3 = pow(a, t) / (a * exp(b));
	double tmp;
	if (t_2 <= -2.2648629349364475e-40) {
		tmp = (x * t_3) / y;
	} else if (t_2 <= 2.117665316366963e-252) {
		tmp = x / (y / t_1);
	} else {
		tmp = (x * (t_3 * pow(z, y))) / y;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    code = (x * exp((((y * log(z)) + ((t - 1.0d0) * log(a))) - b))) / y
end function
real(8) function code(x, y, z, t, a, b)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: t_3
    real(8) :: tmp
    t_1 = exp((((y * log(z)) + ((t - 1.0d0) * log(a))) - b))
    t_2 = (x * t_1) / y
    t_3 = (a ** t) / (a * exp(b))
    if (t_2 <= (-2.2648629349364475d-40)) then
        tmp = (x * t_3) / y
    else if (t_2 <= 2.117665316366963d-252) then
        tmp = x / (y / t_1)
    else
        tmp = (x * (t_3 * (z ** y))) / y
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	return (x * Math.exp((((y * Math.log(z)) + ((t - 1.0) * Math.log(a))) - b))) / y;
}
public static double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = Math.exp((((y * Math.log(z)) + ((t - 1.0) * Math.log(a))) - b));
	double t_2 = (x * t_1) / y;
	double t_3 = Math.pow(a, t) / (a * Math.exp(b));
	double tmp;
	if (t_2 <= -2.2648629349364475e-40) {
		tmp = (x * t_3) / y;
	} else if (t_2 <= 2.117665316366963e-252) {
		tmp = x / (y / t_1);
	} else {
		tmp = (x * (t_3 * Math.pow(z, y))) / y;
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	return (x * math.exp((((y * math.log(z)) + ((t - 1.0) * math.log(a))) - b))) / y
def code(x, y, z, t, a, b):
	t_1 = math.exp((((y * math.log(z)) + ((t - 1.0) * math.log(a))) - b))
	t_2 = (x * t_1) / y
	t_3 = math.pow(a, t) / (a * math.exp(b))
	tmp = 0
	if t_2 <= -2.2648629349364475e-40:
		tmp = (x * t_3) / y
	elif t_2 <= 2.117665316366963e-252:
		tmp = x / (y / t_1)
	else:
		tmp = (x * (t_3 * math.pow(z, y))) / y
	return tmp
function code(x, y, z, t, a, b)
	return Float64(Float64(x * exp(Float64(Float64(Float64(y * log(z)) + Float64(Float64(t - 1.0) * log(a))) - b))) / y)
end
function code(x, y, z, t, a, b)
	t_1 = exp(Float64(Float64(Float64(y * log(z)) + Float64(Float64(t - 1.0) * log(a))) - b))
	t_2 = Float64(Float64(x * t_1) / y)
	t_3 = Float64((a ^ t) / Float64(a * exp(b)))
	tmp = 0.0
	if (t_2 <= -2.2648629349364475e-40)
		tmp = Float64(Float64(x * t_3) / y);
	elseif (t_2 <= 2.117665316366963e-252)
		tmp = Float64(x / Float64(y / t_1));
	else
		tmp = Float64(Float64(x * Float64(t_3 * (z ^ y))) / y);
	end
	return tmp
end
function tmp = code(x, y, z, t, a, b)
	tmp = (x * exp((((y * log(z)) + ((t - 1.0) * log(a))) - b))) / y;
end
function tmp_2 = code(x, y, z, t, a, b)
	t_1 = exp((((y * log(z)) + ((t - 1.0) * log(a))) - b));
	t_2 = (x * t_1) / y;
	t_3 = (a ^ t) / (a * exp(b));
	tmp = 0.0;
	if (t_2 <= -2.2648629349364475e-40)
		tmp = (x * t_3) / y;
	elseif (t_2 <= 2.117665316366963e-252)
		tmp = x / (y / t_1);
	else
		tmp = (x * (t_3 * (z ^ y))) / y;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := N[(N[(x * N[Exp[N[(N[(N[(y * N[Log[z], $MachinePrecision]), $MachinePrecision] + N[(N[(t - 1.0), $MachinePrecision] * N[Log[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - b), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[Exp[N[(N[(N[(y * N[Log[z], $MachinePrecision]), $MachinePrecision] + N[(N[(t - 1.0), $MachinePrecision] * N[Log[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - b), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(N[(x * t$95$1), $MachinePrecision] / y), $MachinePrecision]}, Block[{t$95$3 = N[(N[Power[a, t], $MachinePrecision] / N[(a * N[Exp[b], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -2.2648629349364475e-40], N[(N[(x * t$95$3), $MachinePrecision] / y), $MachinePrecision], If[LessEqual[t$95$2, 2.117665316366963e-252], N[(x / N[(y / t$95$1), $MachinePrecision]), $MachinePrecision], N[(N[(x * N[(t$95$3 * N[Power[z, y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]]]]]]
\frac{x \cdot e^{\left(y \cdot \log z + \left(t - 1\right) \cdot \log a\right) - b}}{y}
\begin{array}{l}
t_1 := e^{\left(y \cdot \log z + \left(t - 1\right) \cdot \log a\right) - b}\\
t_2 := \frac{x \cdot t_1}{y}\\
t_3 := \frac{{a}^{t}}{a \cdot e^{b}}\\
\mathbf{if}\;t_2 \leq -2.2648629349364475 \cdot 10^{-40}:\\
\;\;\;\;\frac{x \cdot t_3}{y}\\

\mathbf{elif}\;t_2 \leq 2.117665316366963 \cdot 10^{-252}:\\
\;\;\;\;\frac{x}{\frac{y}{t_1}}\\

\mathbf{else}:\\
\;\;\;\;\frac{x \cdot \left(t_3 \cdot {z}^{y}\right)}{y}\\


\end{array}

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.9
Target11.1
Herbie0.4
\[\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) < -2.26486293493644754e-40

    1. Initial program 5.8

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

      \[\leadsto \frac{x \cdot \color{blue}{\left(\left(\sqrt[3]{e^{\left(y \cdot \log z + \left(t - 1\right) \cdot \log a\right) - b}} \cdot \sqrt[3]{e^{\left(y \cdot \log z + \left(t - 1\right) \cdot \log a\right) - b}}\right) \cdot \sqrt[3]{e^{\left(y \cdot \log z + \left(t - 1\right) \cdot \log a\right) - b}}\right)}}{y} \]
    3. Taylor expanded in y around 0 6.6

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

      \[\leadsto \color{blue}{\frac{x}{y} \cdot \frac{{a}^{t}}{a \cdot e^{b}}} \]
    5. Applied associate-*l/_binary641.6

      \[\leadsto \color{blue}{\frac{x \cdot \frac{{a}^{t}}{a \cdot e^{b}}}{y}} \]

    if -2.26486293493644754e-40 < (/.f64 (*.f64 x (exp.f64 (-.f64 (+.f64 (*.f64 y (log.f64 z)) (*.f64 (-.f64 t 1) (log.f64 a))) b))) y) < 2.11766531636696306e-252

    1. Initial program 1.2

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

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

    if 2.11766531636696306e-252 < (/.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.1

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

      \[\leadsto \frac{x \cdot \color{blue}{\left(\left(\sqrt[3]{e^{\left(y \cdot \log z + \left(t - 1\right) \cdot \log a\right) - b}} \cdot \sqrt[3]{e^{\left(y \cdot \log z + \left(t - 1\right) \cdot \log a\right) - b}}\right) \cdot \sqrt[3]{e^{\left(y \cdot \log z + \left(t - 1\right) \cdot \log a\right) - b}}\right)}}{y} \]
    3. Applied *-un-lft-identity_binary646.1

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

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

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

    \[\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 -2.2648629349364475 \cdot 10^{-40}:\\ \;\;\;\;\frac{x \cdot \frac{{a}^{t}}{a \cdot e^{b}}}{y}\\ \mathbf{elif}\;\frac{x \cdot e^{\left(y \cdot \log z + \left(t - 1\right) \cdot \log a\right) - b}}{y} \leq 2.117665316366963 \cdot 10^{-252}:\\ \;\;\;\;\frac{x}{\frac{y}{e^{\left(y \cdot \log z + \left(t - 1\right) \cdot \log a\right) - b}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{x \cdot \left(\frac{{a}^{t}}{a \cdot e^{b}} \cdot {z}^{y}\right)}{y}\\ \end{array} \]

Reproduce

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