Average Error: 1.8 → 1.8
Time: 36.4s
Precision: binary64
Cost: 20160
\[\frac{x \cdot e^{\left(y \cdot \log z + \left(t - 1\right) \cdot \log a\right) - b}}{y} \]
\[\frac{x \cdot e^{\left(y \cdot \log z + \left(t + -1\right) \cdot \log a\right) - b}}{y} \]
(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
 (/ (* 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) {
	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) {
	return (x * exp((((y * log(z)) + ((t + -1.0) * log(a))) - b))) / y;
}
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
    code = (x * exp((((y * log(z)) + ((t + (-1.0d0)) * log(a))) - b))) / y
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) {
	return (x * Math.exp((((y * Math.log(z)) + ((t + -1.0) * Math.log(a))) - b))) / y;
}
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):
	return (x * math.exp((((y * math.log(z)) + ((t + -1.0) * math.log(a))) - b))) / y
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)
	return Float64(Float64(x * exp(Float64(Float64(Float64(y * log(z)) + Float64(Float64(t + -1.0) * log(a))) - b))) / y)
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 = code(x, y, z, t, a, b)
	tmp = (x * exp((((y * log(z)) + ((t + -1.0) * log(a))) - b))) / y;
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_] := 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]
\frac{x \cdot e^{\left(y \cdot \log z + \left(t - 1\right) \cdot \log a\right) - b}}{y}
\frac{x \cdot e^{\left(y \cdot \log z + \left(t + -1\right) \cdot \log a\right) - b}}{y}

Error

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original1.8
Target11.2
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. Initial program 1.8

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

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

Alternatives

Alternative 1
Error7.8
Cost40592
\[\begin{array}{l} t_1 := \left(t + -1\right) \cdot \log a\\ \mathbf{if}\;t_1 \leq -2 \cdot 10^{+15}:\\ \;\;\;\;x \cdot \frac{\frac{{a}^{t}}{a}}{y}\\ \mathbf{elif}\;t_1 \leq -425:\\ \;\;\;\;x \cdot \frac{\frac{{z}^{y}}{y \cdot e^{b}}}{a}\\ \mathbf{elif}\;t_1 \leq -305:\\ \;\;\;\;x \cdot \left(\left(1 + \frac{1}{y \cdot a}\right) + -1\right)\\ \mathbf{elif}\;t_1 \leq 681:\\ \;\;\;\;\frac{x \cdot \frac{\frac{{z}^{y}}{a}}{e^{b}}}{y}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{\frac{{z}^{y}}{y}}{a}\\ \end{array} \]
Alternative 2
Error2.3
Cost26692
\[\begin{array}{l} \mathbf{if}\;\left(t + -1\right) \cdot \log a \leq -2 \cdot 10^{+15}:\\ \;\;\;\;x \cdot \frac{\frac{{a}^{t}}{a}}{y}\\ \mathbf{else}:\\ \;\;\;\;\frac{x \cdot e^{\left(y \cdot \log z - \log a\right) - b}}{y}\\ \end{array} \]
Alternative 3
Error22.5
Cost7508
\[\begin{array}{l} t_1 := \frac{\frac{x}{y}}{a \cdot e^{b}}\\ t_2 := \left(1 + \frac{\frac{x}{y}}{a}\right) + -1\\ \mathbf{if}\;b \leq -108:\\ \;\;\;\;t_2\\ \mathbf{elif}\;b \leq -4.8 \cdot 10^{-59}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;b \leq 5.5 \cdot 10^{-178}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;b \leq 2.4 \cdot 10^{-62}:\\ \;\;\;\;\frac{x}{y \cdot a}\\ \mathbf{elif}\;b \leq 1.25 \cdot 10^{-26}:\\ \;\;\;\;t_2\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 4
Error19.0
Cost7508
\[\begin{array}{l} t_1 := \frac{\frac{x}{a \cdot e^{b}}}{y}\\ t_2 := \left(1 + \frac{\frac{x}{y}}{a}\right) + -1\\ \mathbf{if}\;b \leq -108:\\ \;\;\;\;t_2\\ \mathbf{elif}\;b \leq -3.4 \cdot 10^{-65}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;b \leq 5.5 \cdot 10^{-178}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;b \leq 2.4 \cdot 10^{-62}:\\ \;\;\;\;\frac{x}{y \cdot a}\\ \mathbf{elif}\;b \leq 1.25 \cdot 10^{-26}:\\ \;\;\;\;t_2\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 5
Error11.9
Cost7176
\[\begin{array}{l} \mathbf{if}\;b \leq -5.6 \cdot 10^{-123}:\\ \;\;\;\;x \cdot \frac{\frac{{z}^{y}}{y}}{a}\\ \mathbf{elif}\;b \leq 1.62 \cdot 10^{-41}:\\ \;\;\;\;x \cdot \frac{\frac{{a}^{t}}{a}}{y}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y \cdot \left(a \cdot e^{b}\right)}\\ \end{array} \]
Alternative 6
Error11.6
Cost7176
\[\begin{array}{l} \mathbf{if}\;b \leq -5.6 \cdot 10^{-123}:\\ \;\;\;\;\frac{\frac{x \cdot {z}^{y}}{a}}{y}\\ \mathbf{elif}\;b \leq 1.62 \cdot 10^{-41}:\\ \;\;\;\;x \cdot \frac{\frac{{a}^{t}}{a}}{y}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y \cdot \left(a \cdot e^{b}\right)}\\ \end{array} \]
Alternative 7
Error13.9
Cost7044
\[\begin{array}{l} \mathbf{if}\;b \leq 1.25 \cdot 10^{-20}:\\ \;\;\;\;x \cdot \frac{\frac{{z}^{y}}{y}}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{a \cdot e^{b}}}{y}\\ \end{array} \]
Alternative 8
Error25.9
Cost968
\[\begin{array}{l} t_1 := x \cdot \left(\left(1 + \frac{1}{y \cdot a}\right) + -1\right)\\ \mathbf{if}\;x \leq -2.1278456819470296 \cdot 10^{+30}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \leq 1.2646001710291181 \cdot 10^{-145}:\\ \;\;\;\;\left(1 + \frac{\frac{x}{y}}{a}\right) + -1\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 9
Error30.2
Cost840
\[\begin{array}{l} t_1 := \left(1 + \frac{\frac{x}{y}}{a}\right) + -1\\ \mathbf{if}\;y \leq -1.5 \cdot 10^{-216}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 6.2 \cdot 10^{-65}:\\ \;\;\;\;\frac{\frac{x}{a}}{y}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 10
Error30.2
Cost840
\[\begin{array}{l} t_1 := \left(1 + \frac{\frac{x}{y}}{a}\right) + -1\\ \mathbf{if}\;y \leq -8 \cdot 10^{-220}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 6.2 \cdot 10^{-65}:\\ \;\;\;\;\frac{\frac{x}{a}}{y} \cdot \left(1 - b\right)\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 11
Error40.6
Cost776
\[\begin{array}{l} t_1 := \frac{x \cdot \left(-b\right)}{y \cdot a}\\ \mathbf{if}\;t \leq -5.5:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq 1.65 \cdot 10^{+50}:\\ \;\;\;\;\frac{x}{y \cdot a}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 12
Error38.6
Cost712
\[\begin{array}{l} t_1 := \frac{x}{y \cdot a}\\ \mathbf{if}\;x \leq -2.1278456819470296 \cdot 10^{+30}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \leq 9.761458223952808 \cdot 10^{-37}:\\ \;\;\;\;\frac{\frac{1}{a}}{\frac{y}{x}}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 13
Error40.9
Cost584
\[\begin{array}{l} t_1 := \frac{x}{y \cdot a}\\ \mathbf{if}\;x \leq -3.1473441615900636 \cdot 10^{+93}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \leq 9.255108897324502 \cdot 10^{-182}:\\ \;\;\;\;\frac{\frac{x}{a}}{y}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 14
Error38.7
Cost452
\[\begin{array}{l} \mathbf{if}\;a \leq 5 \cdot 10^{-18}:\\ \;\;\;\;\frac{\frac{x}{y}}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y \cdot a}\\ \end{array} \]
Alternative 15
Error43.0
Cost320
\[\frac{\frac{x}{a}}{y} \]

Error

Reproduce

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