?

Average Accuracy: 97.3% → 97.5%
Time: 27.6s
Precision: binary64
Cost: 33736

?

\[\frac{x \cdot e^{\left(y \cdot \log z + \left(t - 1\right) \cdot \log a\right) - b}}{y} \]
\[\begin{array}{l} t_1 := \left(t + -1\right) \cdot \log a\\ \mathbf{if}\;t_1 \leq -2000:\\ \;\;\;\;\frac{{a}^{\left(t + -1\right)} \cdot x}{y}\\ \mathbf{elif}\;t_1 \leq -360:\\ \;\;\;\;\frac{x}{y \cdot \left(a + a \cdot b\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{x \cdot e^{\left(t_1 + y \cdot \log z\right) - b}}{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 (* (+ t -1.0) (log a))))
   (if (<= t_1 -2000.0)
     (/ (* (pow a (+ t -1.0)) x) y)
     (if (<= t_1 -360.0)
       (/ x (* y (+ a (* a b))))
       (/ (* x (exp (- (+ t_1 (* y (log z))) 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) {
	double t_1 = (t + -1.0) * log(a);
	double tmp;
	if (t_1 <= -2000.0) {
		tmp = (pow(a, (t + -1.0)) * x) / y;
	} else if (t_1 <= -360.0) {
		tmp = x / (y * (a + (a * b)));
	} else {
		tmp = (x * exp(((t_1 + (y * log(z))) - b))) / 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) :: tmp
    t_1 = (t + (-1.0d0)) * log(a)
    if (t_1 <= (-2000.0d0)) then
        tmp = ((a ** (t + (-1.0d0))) * x) / y
    else if (t_1 <= (-360.0d0)) then
        tmp = x / (y * (a + (a * b)))
    else
        tmp = (x * exp(((t_1 + (y * log(z))) - b))) / 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 = (t + -1.0) * Math.log(a);
	double tmp;
	if (t_1 <= -2000.0) {
		tmp = (Math.pow(a, (t + -1.0)) * x) / y;
	} else if (t_1 <= -360.0) {
		tmp = x / (y * (a + (a * b)));
	} else {
		tmp = (x * Math.exp(((t_1 + (y * Math.log(z))) - b))) / 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 = (t + -1.0) * math.log(a)
	tmp = 0
	if t_1 <= -2000.0:
		tmp = (math.pow(a, (t + -1.0)) * x) / y
	elif t_1 <= -360.0:
		tmp = x / (y * (a + (a * b)))
	else:
		tmp = (x * math.exp(((t_1 + (y * math.log(z))) - b))) / 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 = Float64(Float64(t + -1.0) * log(a))
	tmp = 0.0
	if (t_1 <= -2000.0)
		tmp = Float64(Float64((a ^ Float64(t + -1.0)) * x) / y);
	elseif (t_1 <= -360.0)
		tmp = Float64(x / Float64(y * Float64(a + Float64(a * b))));
	else
		tmp = Float64(Float64(x * exp(Float64(Float64(t_1 + Float64(y * log(z))) - b))) / 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 = (t + -1.0) * log(a);
	tmp = 0.0;
	if (t_1 <= -2000.0)
		tmp = ((a ^ (t + -1.0)) * x) / y;
	elseif (t_1 <= -360.0)
		tmp = x / (y * (a + (a * b)));
	else
		tmp = (x * exp(((t_1 + (y * log(z))) - b))) / 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[(N[(t + -1.0), $MachinePrecision] * N[Log[a], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -2000.0], N[(N[(N[Power[a, N[(t + -1.0), $MachinePrecision]], $MachinePrecision] * x), $MachinePrecision] / y), $MachinePrecision], If[LessEqual[t$95$1, -360.0], N[(x / N[(y * N[(a + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * N[Exp[N[(N[(t$95$1 + N[(y * N[Log[z], $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}
\begin{array}{l}
t_1 := \left(t + -1\right) \cdot \log a\\
\mathbf{if}\;t_1 \leq -2000:\\
\;\;\;\;\frac{{a}^{\left(t + -1\right)} \cdot x}{y}\\

\mathbf{elif}\;t_1 \leq -360:\\
\;\;\;\;\frac{x}{y \cdot \left(a + a \cdot b\right)}\\

\mathbf{else}:\\
\;\;\;\;\frac{x \cdot e^{\left(t_1 + y \cdot \log z\right) - b}}{y}\\


\end{array}

Error?

Try it out?

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original97.3%
Target82.4%
Herbie97.5%
\[\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 t 1) (log.f64 a)) < -2e3

    1. Initial program 100.0%

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

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

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

    if -2e3 < (*.f64 (-.f64 t 1) (log.f64 a)) < -360

    1. Initial program 90.3%

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

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

      [Start]90.3

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

      associate-*l/ [<=]82.8

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

      *-commutative [=>]82.8

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

      sub-neg [=>]82.8

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

      exp-sum [=>]73.8

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

      \[\leadsto \color{blue}{\frac{{z}^{y} \cdot x}{a \cdot \left(y \cdot e^{b}\right)}} \]
    4. Simplified83.0%

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

      [Start]89.9

      \[ \frac{{z}^{y} \cdot x}{a \cdot \left(y \cdot e^{b}\right)} \]

      *-commutative [=>]89.9

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

      associate-*r* [=>]89.9

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

      *-commutative [<=]89.9

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

      times-frac [=>]83.1

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

      associate-/r* [=>]83.0

      \[ \frac{{z}^{y}}{y} \cdot \color{blue}{\frac{\frac{x}{a}}{e^{b}}} \]
    5. Taylor expanded in y around 0 91.1%

      \[\leadsto \color{blue}{\frac{x}{y \cdot \left(a \cdot e^{b}\right)}} \]
    6. Taylor expanded in b around 0 92.1%

      \[\leadsto \frac{x}{y \cdot \color{blue}{\left(a \cdot b + a\right)}} \]

    if -360 < (*.f64 (-.f64 t 1) (log.f64 a))

    1. Initial program 97.3%

      \[\frac{x \cdot e^{\left(y \cdot \log z + \left(t - 1\right) \cdot \log a\right) - b}}{y} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification97.5%

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

Alternatives

Alternative 1
Accuracy84.5%
Cost33804
\[\begin{array}{l} t_1 := \left(t + -1\right) \cdot \log a\\ t_2 := x \cdot {z}^{y}\\ \mathbf{if}\;t_1 \leq -670:\\ \;\;\;\;\frac{x \cdot e^{t_1 - b}}{y}\\ \mathbf{elif}\;t_1 \leq -55:\\ \;\;\;\;\frac{t_2}{a \cdot y}\\ \mathbf{elif}\;t_1 \leq 350:\\ \;\;\;\;\frac{x \cdot \frac{{a}^{\left(t + -1\right)}}{e^{b}}}{y}\\ \mathbf{else}:\\ \;\;\;\;\frac{t_2}{y \cdot \left(a \cdot e^{b}\right)}\\ \end{array} \]
Alternative 2
Accuracy97.2%
Cost33480
\[\begin{array}{l} t_1 := \left(t + -1\right) \cdot \log a\\ \mathbf{if}\;t_1 \leq -2000:\\ \;\;\;\;\frac{{a}^{\left(t + -1\right)} \cdot x}{y}\\ \mathbf{elif}\;t_1 \leq -360:\\ \;\;\;\;\frac{x}{y \cdot \left(a + a \cdot b\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{x \cdot e^{\left(y \cdot \log z - \log a\right) - b}}{y}\\ \end{array} \]
Alternative 3
Accuracy82.3%
Cost13836
\[\begin{array}{l} t_1 := \frac{x \cdot {z}^{y}}{a \cdot y}\\ t_2 := {a}^{\left(t + -1\right)}\\ \mathbf{if}\;b \leq -1.36 \cdot 10^{-142}:\\ \;\;\;\;\frac{t_2 \cdot x}{y}\\ \mathbf{elif}\;b \leq -8 \cdot 10^{-178}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;b \leq 1.95 \cdot 10^{-204}:\\ \;\;\;\;x \cdot \frac{\frac{t_2}{e^{b}}}{y}\\ \mathbf{elif}\;b \leq 4.3 \cdot 10^{-129}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;b \leq 1.66:\\ \;\;\;\;\frac{t_2}{\frac{y}{x}}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y \cdot \left(a \cdot e^{b}\right)}\\ \end{array} \]
Alternative 4
Accuracy82.2%
Cost7572
\[\begin{array}{l} t_1 := \frac{x \cdot {z}^{y}}{a \cdot y}\\ t_2 := \frac{{a}^{\left(t + -1\right)} \cdot x}{y}\\ \mathbf{if}\;b \leq -6.5 \cdot 10^{-147}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;b \leq -1.35 \cdot 10^{-195}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;b \leq -1.45 \cdot 10^{-300}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;b \leq 2.9 \cdot 10^{-129}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;b \leq 125:\\ \;\;\;\;t_2\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y \cdot \left(a \cdot e^{b}\right)}\\ \end{array} \]
Alternative 5
Accuracy81.7%
Cost7572
\[\begin{array}{l} t_1 := \frac{x \cdot {z}^{y}}{a \cdot y}\\ t_2 := {a}^{\left(t + -1\right)}\\ t_3 := \frac{t_2 \cdot x}{y}\\ \mathbf{if}\;b \leq -1.4 \cdot 10^{-142}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;b \leq -1.3 \cdot 10^{-196}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;b \leq -1.16 \cdot 10^{-300}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;b \leq 1.8 \cdot 10^{-128}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;b \leq 128:\\ \;\;\;\;\frac{t_2}{\frac{y}{x}}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y \cdot \left(a \cdot e^{b}\right)}\\ \end{array} \]
Alternative 6
Accuracy66.3%
Cost7112
\[\begin{array}{l} \mathbf{if}\;b \leq 8 \cdot 10^{-180}:\\ \;\;\;\;\frac{x}{y \cdot \left(a + a \cdot b\right)}\\ \mathbf{elif}\;b \leq 7.8 \cdot 10^{-21}:\\ \;\;\;\;\frac{x}{y} \cdot \frac{1}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y \cdot \left(a \cdot e^{b}\right)}\\ \end{array} \]
Alternative 7
Accuracy83.3%
Cost7044
\[\begin{array}{l} \mathbf{if}\;b \leq 12:\\ \;\;\;\;\frac{{a}^{\left(t + -1\right)} \cdot x}{y}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y \cdot \left(a \cdot e^{b}\right)}\\ \end{array} \]
Alternative 8
Accuracy66.6%
Cost6980
\[\begin{array}{l} \mathbf{if}\;b \leq 7.2 \cdot 10^{-41}:\\ \;\;\;\;\frac{x}{y \cdot \left(a + a \cdot b\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{a \cdot e^{b}}}{y}\\ \end{array} \]
Alternative 9
Accuracy43.7%
Cost712
\[\begin{array}{l} \mathbf{if}\;b \leq 7 \cdot 10^{-180}:\\ \;\;\;\;\frac{x}{a \cdot y}\\ \mathbf{elif}\;b \leq 0.000195:\\ \;\;\;\;\frac{x}{y} \cdot \frac{1}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{a \cdot \left(y \cdot b\right)}\\ \end{array} \]
Alternative 10
Accuracy50.0%
Cost708
\[\begin{array}{l} \mathbf{if}\;a \leq 4.8 \cdot 10^{-79}:\\ \;\;\;\;\frac{\frac{1}{a}}{\frac{y}{x}}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y \cdot \left(a + a \cdot b\right)}\\ \end{array} \]
Alternative 11
Accuracy36.8%
Cost585
\[\begin{array}{l} \mathbf{if}\;y \leq -3.35 \cdot 10^{-172} \lor \neg \left(y \leq 2 \cdot 10^{-138}\right):\\ \;\;\;\;\frac{x}{a \cdot y}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{a}}{y}\\ \end{array} \]
Alternative 12
Accuracy40.0%
Cost452
\[\begin{array}{l} \mathbf{if}\;a \leq 10^{-32}:\\ \;\;\;\;\frac{\frac{x}{y}}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{a \cdot y}\\ \end{array} \]
Alternative 13
Accuracy34.8%
Cost320
\[\frac{x}{a \cdot y} \]

Error

Reproduce?

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