?

Average Accuracy: 96.8% → 96.4%
Time: 28.0s
Precision: binary64
Cost: 33737

?

\[\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 -678 \lor \neg \left(t_1 \leq -75\right):\\ \;\;\;\;\frac{x \cdot e^{\left(t_1 + y \cdot \log z\right) - b}}{y}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{\frac{{z}^{y}}{{a}^{\left(1 - t\right)}}}{y \cdot e^{b}}\\ \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 (or (<= t_1 -678.0) (not (<= t_1 -75.0)))
     (/ (* x (exp (- (+ t_1 (* y (log z))) b))) y)
     (* x (/ (/ (pow z y) (pow a (- 1.0 t))) (* y (exp b)))))))
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 <= -678.0) || !(t_1 <= -75.0)) {
		tmp = (x * exp(((t_1 + (y * log(z))) - b))) / y;
	} else {
		tmp = x * ((pow(z, y) / pow(a, (1.0 - t))) / (y * exp(b)));
	}
	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 <= (-678.0d0)) .or. (.not. (t_1 <= (-75.0d0)))) then
        tmp = (x * exp(((t_1 + (y * log(z))) - b))) / y
    else
        tmp = x * (((z ** y) / (a ** (1.0d0 - t))) / (y * exp(b)))
    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 <= -678.0) || !(t_1 <= -75.0)) {
		tmp = (x * Math.exp(((t_1 + (y * Math.log(z))) - b))) / y;
	} else {
		tmp = x * ((Math.pow(z, y) / Math.pow(a, (1.0 - t))) / (y * Math.exp(b)));
	}
	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 <= -678.0) or not (t_1 <= -75.0):
		tmp = (x * math.exp(((t_1 + (y * math.log(z))) - b))) / y
	else:
		tmp = x * ((math.pow(z, y) / math.pow(a, (1.0 - t))) / (y * math.exp(b)))
	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 <= -678.0) || !(t_1 <= -75.0))
		tmp = Float64(Float64(x * exp(Float64(Float64(t_1 + Float64(y * log(z))) - b))) / y);
	else
		tmp = Float64(x * Float64(Float64((z ^ y) / (a ^ Float64(1.0 - t))) / Float64(y * exp(b))));
	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 <= -678.0) || ~((t_1 <= -75.0)))
		tmp = (x * exp(((t_1 + (y * log(z))) - b))) / y;
	else
		tmp = x * (((z ^ y) / (a ^ (1.0 - t))) / (y * exp(b)));
	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[Or[LessEqual[t$95$1, -678.0], N[Not[LessEqual[t$95$1, -75.0]], $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], N[(x * N[(N[(N[Power[z, y], $MachinePrecision] / N[Power[a, N[(1.0 - t), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[(y * N[Exp[b], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $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 -678 \lor \neg \left(t_1 \leq -75\right):\\
\;\;\;\;\frac{x \cdot e^{\left(t_1 + y \cdot \log z\right) - b}}{y}\\

\mathbf{else}:\\
\;\;\;\;x \cdot \frac{\frac{{z}^{y}}{{a}^{\left(1 - t\right)}}}{y \cdot e^{b}}\\


\end{array}

Error?

Try it out?

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original96.8%
Target82.8%
Herbie96.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 2 regimes
  2. if (*.f64 (-.f64 t 1) (log.f64 a)) < -678 or -75 < (*.f64 (-.f64 t 1) (log.f64 a))

    1. Initial program 99.0%

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

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

    1. Initial program 89.9%

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

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

      [Start]89.9

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

      associate-*r/ [<=]96.6

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

      exp-diff [=>]85.4

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

      associate-/l/ [=>]85.5

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

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

Alternatives

Alternative 1
Accuracy95.4%
Cost33608
\[\begin{array}{l} t_1 := \left(t + -1\right) \cdot \log a\\ \mathbf{if}\;t_1 \leq -1 \cdot 10^{+64}:\\ \;\;\;\;x \cdot \frac{\frac{{a}^{t}}{a}}{y}\\ \mathbf{elif}\;t_1 \leq -75:\\ \;\;\;\;x \cdot \frac{\frac{{z}^{y}}{{a}^{\left(1 - t\right)}}}{y \cdot e^{b}}\\ \mathbf{else}:\\ \;\;\;\;\frac{x \cdot e^{\left(y \cdot \log z - \log a\right) - b}}{y}\\ \end{array} \]
Alternative 2
Accuracy95.4%
Cost33480
\[\begin{array}{l} t_1 := \left(t + -1\right) \cdot \log a\\ \mathbf{if}\;t_1 \leq -5 \cdot 10^{+23}:\\ \;\;\;\;x \cdot \frac{\frac{{a}^{t}}{a}}{y}\\ \mathbf{elif}\;t_1 \leq -75:\\ \;\;\;\;\frac{x \cdot {a}^{t}}{y \cdot \left(a \cdot e^{b}\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{x \cdot e^{\left(y \cdot \log z - \log a\right) - b}}{y}\\ \end{array} \]
Alternative 3
Accuracy91.0%
Cost27016
\[\begin{array}{l} t_1 := \left(t + -1\right) \cdot \log a\\ \mathbf{if}\;t_1 \leq -5 \cdot 10^{+23}:\\ \;\;\;\;x \cdot \frac{\frac{{a}^{t}}{a}}{y}\\ \mathbf{elif}\;t_1 \leq -195:\\ \;\;\;\;\frac{x \cdot {a}^{t}}{y \cdot \left(a \cdot e^{b}\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{{z}^{y}}{a} \cdot \frac{x}{y \cdot e^{b}}\\ \end{array} \]
Alternative 4
Accuracy84.0%
Cost13836
\[\begin{array}{l} t_1 := y \cdot e^{b}\\ t_2 := {a}^{\left(1 - t\right)}\\ \mathbf{if}\;b \leq 2.8 \cdot 10^{-133}:\\ \;\;\;\;\frac{x}{y \cdot t_2}\\ \mathbf{elif}\;b \leq 6.7 \cdot 10^{-85}:\\ \;\;\;\;x \cdot \frac{\frac{{z}^{y}}{a}}{y}\\ \mathbf{elif}\;b \leq 60:\\ \;\;\;\;\frac{x}{t_2 \cdot t_1}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{t_1}}{a}\\ \end{array} \]
Alternative 5
Accuracy83.4%
Cost7308
\[\begin{array}{l} t_1 := x \cdot \frac{\frac{{a}^{t}}{a}}{y}\\ \mathbf{if}\;b \leq 2.95 \cdot 10^{-133}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;b \leq 1.85 \cdot 10^{-75}:\\ \;\;\;\;x \cdot \frac{\frac{{z}^{y}}{a}}{y}\\ \mathbf{elif}\;b \leq 1.32 \cdot 10^{-9}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y \cdot \left(a \cdot e^{b}\right)}\\ \end{array} \]
Alternative 6
Accuracy83.7%
Cost7308
\[\begin{array}{l} \mathbf{if}\;b \leq 2.95 \cdot 10^{-133}:\\ \;\;\;\;\frac{x}{y \cdot {a}^{\left(1 - t\right)}}\\ \mathbf{elif}\;b \leq 6.6 \cdot 10^{-74}:\\ \;\;\;\;x \cdot \frac{\frac{{z}^{y}}{a}}{y}\\ \mathbf{elif}\;b \leq 0.0069:\\ \;\;\;\;x \cdot \frac{\frac{{a}^{t}}{a}}{y}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y \cdot \left(a \cdot e^{b}\right)}\\ \end{array} \]
Alternative 7
Accuracy78.3%
Cost7044
\[\begin{array}{l} \mathbf{if}\;b \leq 1.22 \cdot 10^{-49}:\\ \;\;\;\;x \cdot \frac{\frac{{z}^{y}}{a}}{y}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y \cdot \left(a \cdot e^{b}\right)}\\ \end{array} \]
Alternative 8
Accuracy65.0%
Cost6980
\[\begin{array}{l} \mathbf{if}\;b \leq 3.4 \cdot 10^{-128}:\\ \;\;\;\;\frac{\frac{x}{y + y \cdot b}}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y \cdot \left(a \cdot e^{b}\right)}\\ \end{array} \]
Alternative 9
Accuracy43.5%
Cost840
\[\begin{array}{l} \mathbf{if}\;b \leq -20000:\\ \;\;\;\;\frac{x}{y \cdot \left(a \cdot b\right)}\\ \mathbf{elif}\;b \leq 1.22 \cdot 10^{-49}:\\ \;\;\;\;\frac{1}{a} \cdot \frac{1}{\frac{y}{x}}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{a \cdot \left(y \cdot b\right)}\\ \end{array} \]
Alternative 10
Accuracy43.8%
Cost713
\[\begin{array}{l} \mathbf{if}\;b \leq -230 \lor \neg \left(b \leq 1.22 \cdot 10^{-49}\right):\\ \;\;\;\;\frac{x}{a \cdot \left(y \cdot b\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{y}}{a}\\ \end{array} \]
Alternative 11
Accuracy43.4%
Cost712
\[\begin{array}{l} \mathbf{if}\;b \leq -0.013:\\ \;\;\;\;\frac{x}{y \cdot \left(a \cdot b\right)}\\ \mathbf{elif}\;b \leq 1.22 \cdot 10^{-49}:\\ \;\;\;\;\frac{\frac{x}{y}}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{a \cdot \left(y \cdot b\right)}\\ \end{array} \]
Alternative 12
Accuracy47.3%
Cost708
\[\begin{array}{l} \mathbf{if}\;a \leq 5.8 \cdot 10^{-211}:\\ \;\;\;\;\frac{\frac{x}{y}}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y \cdot \left(a \cdot \left(1 + b\right)\right)}\\ \end{array} \]
Alternative 13
Accuracy52.8%
Cost708
\[\begin{array}{l} \mathbf{if}\;a \leq 2.2 \cdot 10^{+39}:\\ \;\;\;\;\frac{\frac{x}{y + y \cdot b}}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y \cdot \left(a \cdot \left(1 + b\right)\right)}\\ \end{array} \]
Alternative 14
Accuracy36.2%
Cost585
\[\begin{array}{l} \mathbf{if}\;y \leq -3.6 \cdot 10^{-98} \lor \neg \left(y \leq 2.25 \cdot 10^{-180}\right):\\ \;\;\;\;\frac{x}{a \cdot y}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{a}}{y}\\ \end{array} \]
Alternative 15
Accuracy39.4%
Cost452
\[\begin{array}{l} \mathbf{if}\;a \leq 2.4 \cdot 10^{+39}:\\ \;\;\;\;\frac{\frac{x}{y}}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{a \cdot y}\\ \end{array} \]
Alternative 16
Accuracy34.8%
Cost320
\[\frac{x}{a \cdot y} \]

Error

Reproduce?

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