?

Average Error: 1.8 → 1.8
Time: 26.7s
Precision: binary64
Cost: 26560

?

\[\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 \cdot \log a - \log a\right)\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 (log a)) (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 * log(a)) - 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 * log(a)) - 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 * Math.log(a)) - 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 * math.log(a)) - 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 * log(a)) - 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 * log(a)) - 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 * N[Log[a], $MachinePrecision]), $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 \cdot \log a - \log a\right)\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. Applied egg-rr1.8

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

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

Alternatives

Alternative 1
Error9.1
Cost33868
\[\begin{array}{l} t_1 := \left(t - 1\right) \cdot \log a\\ \mathbf{if}\;t_1 \leq -10000000:\\ \;\;\;\;\frac{{a}^{\left(t - 1\right)} \cdot x}{y}\\ \mathbf{elif}\;t_1 \leq -195:\\ \;\;\;\;\frac{x}{a \cdot y}\\ \mathbf{elif}\;t_1 \leq 335:\\ \;\;\;\;\frac{e^{t_1 - b} \cdot x}{y}\\ \mathbf{else}:\\ \;\;\;\;\frac{x \cdot e^{y \cdot \log z - b}}{y}\\ \end{array} \]
Alternative 2
Error2.3
Cost26692
\[\begin{array}{l} \mathbf{if}\;\left(t - 1\right) \cdot \log a \leq -10000000000:\\ \;\;\;\;\frac{{a}^{\left(t - 1\right)} \cdot x}{y}\\ \mathbf{else}:\\ \;\;\;\;\frac{x \cdot e^{\left(y \cdot \log z - \log a\right) - b}}{y}\\ \end{array} \]
Alternative 3
Error2.3
Cost20296
\[\begin{array}{l} t_1 := t \cdot \log a\\ t_2 := \frac{x \cdot e^{\left(y \cdot \log z + t_1\right) - b}}{y}\\ \mathbf{if}\;y \leq -1100000:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y \leq 5.8 \cdot 10^{-18}:\\ \;\;\;\;\frac{e^{\left(t_1 - \log a\right) - b} \cdot x}{y}\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 4
Error1.8
Cost20160
\[\frac{x \cdot e^{\left(y \cdot \log z + \left(t - 1\right) \cdot \log a\right) - b}}{y} \]
Alternative 5
Error14.0
Cost14168
\[\begin{array}{l} t_1 := \frac{e^{\left(-\log a\right) - b} \cdot x}{y}\\ t_2 := \frac{{a}^{\left(t - 1\right)} \cdot x}{y}\\ t_3 := \frac{x \cdot e^{y \cdot \log z - b}}{y}\\ \mathbf{if}\;y \leq -7.4 \cdot 10^{-16}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;y \leq -1.02 \cdot 10^{-108}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y \leq -5.5 \cdot 10^{-265}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 8.8 \cdot 10^{-213}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y \leq 2.2 \cdot 10^{-166}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 470000:\\ \;\;\;\;t_2\\ \mathbf{else}:\\ \;\;\;\;t_3\\ \end{array} \]
Alternative 6
Error21.5
Cost7576
\[\begin{array}{l} t_1 := \frac{x}{a \cdot y}\\ t_2 := \frac{{z}^{y} \cdot x}{y}\\ \mathbf{if}\;b \leq -2.9 \cdot 10^{+20}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;b \leq -4.4 \cdot 10^{-96}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;b \leq -2 \cdot 10^{-177}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;b \leq -7.4 \cdot 10^{-283}:\\ \;\;\;\;\frac{\frac{x}{a}}{y}\\ \mathbf{elif}\;b \leq 6.8 \cdot 10^{-279}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;b \leq 5.6 \cdot 10^{-7}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;\frac{e^{-b} \cdot x}{y}\\ \end{array} \]
Alternative 7
Error11.3
Cost7308
\[\begin{array}{l} t_1 := \frac{{a}^{\left(t - 1\right)} \cdot x}{y}\\ \mathbf{if}\;b \leq -2.55 \cdot 10^{-98}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;b \leq -1.2 \cdot 10^{-146}:\\ \;\;\;\;\frac{{z}^{y} \cdot x}{y}\\ \mathbf{elif}\;b \leq 28.5:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;\frac{e^{-b} \cdot x}{y}\\ \end{array} \]
Alternative 8
Error22.6
Cost6916
\[\begin{array}{l} \mathbf{if}\;b \leq 5.6 \cdot 10^{-7}:\\ \;\;\;\;\frac{x}{a \cdot y}\\ \mathbf{else}:\\ \;\;\;\;\frac{e^{-b} \cdot x}{y}\\ \end{array} \]
Alternative 9
Error41.2
Cost452
\[\begin{array}{l} \mathbf{if}\;a \leq 1.75 \cdot 10^{+90}:\\ \;\;\;\;\frac{\frac{x}{a}}{y}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{a \cdot y}\\ \end{array} \]
Alternative 10
Error42.2
Cost320
\[\frac{x}{a \cdot y} \]
Alternative 11
Error54.8
Cost192
\[\frac{x}{y} \]

Error

Reproduce?

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