Average Error: 1.9 → 1.9
Time: 28.6s
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.9
Target11.2
Herbie1.9
\[\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.9

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

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

Alternatives

Alternative 1
Error2.3
Cost26692
\[\begin{array}{l} \mathbf{if}\;\left(t + -1\right) \cdot \log a \leq -680:\\ \;\;\;\;\frac{x \cdot {a}^{\left(t + -1\right)}}{y}\\ \mathbf{else}:\\ \;\;\;\;\frac{x \cdot e^{\left(y \cdot \log z - \log a\right) - b}}{y}\\ \end{array} \]
Alternative 2
Error12.6
Cost14100
\[\begin{array}{l} t_1 := a \cdot \left(y \cdot e^{b}\right)\\ t_2 := {a}^{\left(t + -1\right)}\\ t_3 := x \cdot {z}^{y}\\ \mathbf{if}\;b \leq -4 \cdot 10^{+91}:\\ \;\;\;\;\frac{x}{y \cdot \left(a \cdot b\right)}\\ \mathbf{elif}\;b \leq -16:\\ \;\;\;\;\frac{x \cdot t_2}{y}\\ \mathbf{elif}\;b \leq -1.3 \cdot 10^{-72}:\\ \;\;\;\;\frac{t_3}{t_1}\\ \mathbf{elif}\;b \leq 5 \cdot 10^{-304}:\\ \;\;\;\;\frac{{a}^{t}}{a} \cdot \frac{x}{y}\\ \mathbf{elif}\;b \leq 2.1 \cdot 10^{-119}:\\ \;\;\;\;\frac{x \cdot \frac{t_2}{e^{b}}}{y}\\ \mathbf{elif}\;b \leq 9 \cdot 10^{-13}:\\ \;\;\;\;\frac{t_3}{y \cdot a}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{t_1}\\ \end{array} \]
Alternative 3
Error8.2
Cost14034
\[\begin{array}{l} \mathbf{if}\;y \leq -4 \cdot 10^{+180} \lor \neg \left(y \leq 10^{+25}\right) \land \left(y \leq 1.85 \cdot 10^{+76} \lor \neg \left(y \leq 1.2 \cdot 10^{+153}\right)\right):\\ \;\;\;\;\frac{x \cdot {z}^{y}}{y \cdot a}\\ \mathbf{else}:\\ \;\;\;\;\frac{x \cdot e^{\left(t + -1\right) \cdot \log a - b}}{y}\\ \end{array} \]
Alternative 4
Error11.8
Cost7308
\[\begin{array}{l} \mathbf{if}\;b \leq -1.04 \cdot 10^{+99}:\\ \;\;\;\;\frac{x}{y \cdot \left(a \cdot b\right)}\\ \mathbf{elif}\;b \leq 3.6 \cdot 10^{-119}:\\ \;\;\;\;\frac{x \cdot {a}^{\left(t + -1\right)}}{y}\\ \mathbf{elif}\;b \leq 9 \cdot 10^{-13}:\\ \;\;\;\;\frac{x \cdot {z}^{y}}{y \cdot a}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{a \cdot \left(y \cdot e^{b}\right)}\\ \end{array} \]
Alternative 5
Error21.4
Cost7244
\[\begin{array}{l} \mathbf{if}\;b \leq -2.5 \cdot 10^{-7}:\\ \;\;\;\;\frac{x}{y \cdot \left(a \cdot \left(1 + b\right)\right)}\\ \mathbf{elif}\;b \leq -1.9 \cdot 10^{-233}:\\ \;\;\;\;\frac{1}{a \cdot \frac{y}{x}}\\ \mathbf{elif}\;b \leq -1.1 \cdot 10^{-306}:\\ \;\;\;\;x \cdot \frac{\frac{-b}{a}}{y}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{a \cdot \left(y \cdot e^{b}\right)}\\ \end{array} \]
Alternative 6
Error21.4
Cost7244
\[\begin{array}{l} \mathbf{if}\;b \leq -450:\\ \;\;\;\;\frac{x}{y \cdot \left(a \cdot b\right)}\\ \mathbf{elif}\;b \leq -1.25 \cdot 10^{-233}:\\ \;\;\;\;\frac{\frac{\frac{x}{y}}{e^{b}}}{a}\\ \mathbf{elif}\;b \leq -3.8 \cdot 10^{-304}:\\ \;\;\;\;x \cdot \frac{\frac{-b}{a}}{y}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{a \cdot \left(y \cdot e^{b}\right)}\\ \end{array} \]
Alternative 7
Error12.7
Cost7176
\[\begin{array}{l} \mathbf{if}\;b \leq -2.75 \cdot 10^{+163}:\\ \;\;\;\;\frac{x}{y \cdot \left(a \cdot b\right)}\\ \mathbf{elif}\;b \leq 3.2 \cdot 10^{-11}:\\ \;\;\;\;\frac{{a}^{t}}{a} \cdot \frac{x}{y}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{a \cdot \left(y \cdot e^{b}\right)}\\ \end{array} \]
Alternative 8
Error11.2
Cost7176
\[\begin{array}{l} \mathbf{if}\;b \leq -5.5 \cdot 10^{+98}:\\ \;\;\;\;\frac{x}{y \cdot \left(a \cdot b\right)}\\ \mathbf{elif}\;b \leq 6.2 \cdot 10^{-9}:\\ \;\;\;\;\frac{x \cdot {a}^{\left(t + -1\right)}}{y}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{a \cdot \left(y \cdot e^{b}\right)}\\ \end{array} \]
Alternative 9
Error34.2
Cost976
\[\begin{array}{l} \mathbf{if}\;b \leq -15200:\\ \;\;\;\;\frac{x}{y \cdot \left(a \cdot b\right)}\\ \mathbf{elif}\;b \leq -1.85 \cdot 10^{-233}:\\ \;\;\;\;\frac{1}{a \cdot \frac{y}{x}}\\ \mathbf{elif}\;b \leq -8 \cdot 10^{-306}:\\ \;\;\;\;x \cdot \frac{\frac{-b}{a}}{y}\\ \mathbf{elif}\;b \leq 5.3 \cdot 10^{-11}:\\ \;\;\;\;\frac{x}{\frac{y}{\frac{1}{a}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{a \cdot \left(y \cdot b\right)}\\ \end{array} \]
Alternative 10
Error34.1
Cost972
\[\begin{array}{l} \mathbf{if}\;b \leq -1050:\\ \;\;\;\;\frac{x}{y \cdot \left(a \cdot b\right)}\\ \mathbf{elif}\;b \leq -2.8 \cdot 10^{-233}:\\ \;\;\;\;\frac{1}{a \cdot \frac{y}{x}}\\ \mathbf{elif}\;b \leq 1.75 \cdot 10^{-307}:\\ \;\;\;\;x \cdot \frac{\frac{-b}{a}}{y}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{a \cdot \left(y + y \cdot b\right)}\\ \end{array} \]
Alternative 11
Error34.1
Cost972
\[\begin{array}{l} \mathbf{if}\;b \leq -1.3 \cdot 10^{-6}:\\ \;\;\;\;\frac{x}{y \cdot \left(a \cdot \left(1 + b\right)\right)}\\ \mathbf{elif}\;b \leq -9.3 \cdot 10^{-234}:\\ \;\;\;\;\frac{1}{a \cdot \frac{y}{x}}\\ \mathbf{elif}\;b \leq 7 \cdot 10^{-309}:\\ \;\;\;\;x \cdot \frac{\frac{-b}{a}}{y}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{a \cdot \left(y + y \cdot b\right)}\\ \end{array} \]
Alternative 12
Error33.9
Cost844
\[\begin{array}{l} t_1 := \frac{x}{y \cdot \left(a \cdot b\right)}\\ \mathbf{if}\;b \leq -26000:\\ \;\;\;\;t_1\\ \mathbf{elif}\;b \leq -8.2 \cdot 10^{-297}:\\ \;\;\;\;\frac{1}{a \cdot \frac{y}{x}}\\ \mathbf{elif}\;b \leq 5.3 \cdot 10^{-11}:\\ \;\;\;\;\frac{x}{y \cdot a}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 13
Error34.4
Cost844
\[\begin{array}{l} \mathbf{if}\;b \leq -4200:\\ \;\;\;\;\frac{x}{y \cdot \left(a \cdot b\right)}\\ \mathbf{elif}\;b \leq -2.6 \cdot 10^{-294}:\\ \;\;\;\;\frac{1}{a \cdot \frac{y}{x}}\\ \mathbf{elif}\;b \leq 5.3 \cdot 10^{-11}:\\ \;\;\;\;\frac{x}{y \cdot a}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{a \cdot \left(y \cdot b\right)}\\ \end{array} \]
Alternative 14
Error34.4
Cost844
\[\begin{array}{l} \mathbf{if}\;b \leq -820:\\ \;\;\;\;\frac{x}{y \cdot \left(a \cdot b\right)}\\ \mathbf{elif}\;b \leq -2.5 \cdot 10^{-297}:\\ \;\;\;\;\frac{1}{a \cdot \frac{y}{x}}\\ \mathbf{elif}\;b \leq 5.3 \cdot 10^{-11}:\\ \;\;\;\;\frac{x}{\frac{y}{\frac{1}{a}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{a \cdot \left(y \cdot b\right)}\\ \end{array} \]
Alternative 15
Error38.4
Cost712
\[\begin{array}{l} \mathbf{if}\;x \leq -4.5 \cdot 10^{-99}:\\ \;\;\;\;x \cdot \frac{\frac{1}{y}}{a}\\ \mathbf{elif}\;x \leq 10^{-23}:\\ \;\;\;\;\frac{1}{a \cdot \frac{y}{x}}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y \cdot a}\\ \end{array} \]
Alternative 16
Error39.9
Cost585
\[\begin{array}{l} \mathbf{if}\;x \leq -4 \cdot 10^{-99} \lor \neg \left(x \leq 4 \cdot 10^{-73}\right):\\ \;\;\;\;\frac{x}{y \cdot a}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{a}}{y}\\ \end{array} \]
Alternative 17
Error38.5
Cost585
\[\begin{array}{l} \mathbf{if}\;x \leq -9.2 \cdot 10^{+61} \lor \neg \left(x \leq 3.8 \cdot 10^{-70}\right):\\ \;\;\;\;\frac{x}{y \cdot a}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{y}}{a}\\ \end{array} \]
Alternative 18
Error38.6
Cost584
\[\begin{array}{l} \mathbf{if}\;x \leq -9.2 \cdot 10^{+61}:\\ \;\;\;\;x \cdot \frac{\frac{1}{y}}{a}\\ \mathbf{elif}\;x \leq 2.3 \cdot 10^{-70}:\\ \;\;\;\;\frac{\frac{x}{y}}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y \cdot a}\\ \end{array} \]
Alternative 19
Error41.5
Cost320
\[\frac{x}{y \cdot a} \]

Error

Reproduce

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