?

Average Accuracy: 97.4% → 97.1%
Time: 29.9s
Precision: binary64
Cost: 26692

?

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

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


\end{array}

Error?

Try it out?

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original97.4%
Target83.0%
Herbie97.1%
\[\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)) < -750

    1. Initial program 99.9%

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

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

      [Start]99.9

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

      associate-*l/ [<=]86.4

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

      *-commutative [=>]86.4

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

      \[\leadsto \color{blue}{\frac{{z}^{y} \cdot \left({a}^{t} \cdot x\right)}{y \cdot a}} \]
    4. Simplified70.7%

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

      [Start]72.5

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

      associate-/r* [=>]84.2

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

      associate-*r* [=>]84.2

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

      *-commutative [<=]84.2

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

      associate-*r/ [<=]70.7

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

      associate-*l* [=>]70.7

      \[ \frac{\color{blue}{{a}^{t} \cdot \left({z}^{y} \cdot \frac{x}{y}\right)}}{a} \]
    5. Taylor expanded in y around 0 99.9%

      \[\leadsto \frac{\color{blue}{\frac{{a}^{t} \cdot x}{y}}}{a} \]

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

    1. Initial program 95.7%

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

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

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

      [Start]95.3

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

      mul-1-neg [=>]95.3

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

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

Alternatives

Alternative 1
Accuracy91.5%
Cost27016
\[\begin{array}{l} t_1 := \left(t + -1\right) \cdot \log a\\ \mathbf{if}\;t_1 \leq -750:\\ \;\;\;\;\frac{\frac{x \cdot {a}^{t}}{y}}{a}\\ \mathbf{elif}\;t_1 \leq -400:\\ \;\;\;\;\frac{x}{y \cdot \left(a + a \cdot b\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{{z}^{y}}{a} \cdot \frac{x}{y \cdot e^{b}}\\ \end{array} \]
Alternative 2
Accuracy97.4%
Cost20160
\[\frac{x \cdot e^{\left(y \cdot \log z + \left(t + -1\right) \cdot \log a\right) - b}}{y} \]
Alternative 3
Accuracy77.5%
Cost7308
\[\begin{array}{l} t_1 := {z}^{y} \cdot \frac{\frac{x}{y}}{a}\\ \mathbf{if}\;b \leq -6.8 \cdot 10^{-30}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;b \leq -1.25 \cdot 10^{-217}:\\ \;\;\;\;\frac{{a}^{t}}{y} \cdot \frac{x}{a}\\ \mathbf{elif}\;b \leq 1.2 \cdot 10^{-40}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y \cdot \left(a \cdot e^{b}\right)}\\ \end{array} \]
Alternative 4
Accuracy78.2%
Cost7308
\[\begin{array}{l} t_1 := \frac{\frac{x}{y}}{\frac{a}{{z}^{y}}}\\ \mathbf{if}\;b \leq -7 \cdot 10^{-41}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;b \leq -1.9 \cdot 10^{-209}:\\ \;\;\;\;\frac{{a}^{t}}{y} \cdot \frac{x}{a}\\ \mathbf{elif}\;b \leq 1.12 \cdot 10^{-40}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y \cdot \left(a \cdot e^{b}\right)}\\ \end{array} \]
Alternative 5
Accuracy79.2%
Cost7308
\[\begin{array}{l} \mathbf{if}\;b \leq -1.02 \cdot 10^{-39}:\\ \;\;\;\;\frac{\frac{x}{y}}{\frac{a}{{z}^{y}}}\\ \mathbf{elif}\;b \leq -4.8 \cdot 10^{-151}:\\ \;\;\;\;\frac{{a}^{t}}{y} \cdot \frac{x}{a}\\ \mathbf{elif}\;b \leq 1.2 \cdot 10^{-40}:\\ \;\;\;\;\frac{\frac{x \cdot {z}^{y}}{a}}{y}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y \cdot \left(a \cdot e^{b}\right)}\\ \end{array} \]
Alternative 6
Accuracy79.8%
Cost7176
\[\begin{array}{l} \mathbf{if}\;b \leq -1.3 \cdot 10^{+83}:\\ \;\;\;\;\frac{x}{y \cdot \left(a \cdot b\right)}\\ \mathbf{elif}\;b \leq 4 \cdot 10^{-10}:\\ \;\;\;\;\frac{{a}^{t}}{y} \cdot \frac{x}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y \cdot \left(a \cdot e^{b}\right)}\\ \end{array} \]
Alternative 7
Accuracy82.3%
Cost7176
\[\begin{array}{l} \mathbf{if}\;b \leq 1.7 \cdot 10^{-267}:\\ \;\;\;\;\frac{\frac{x \cdot {a}^{t}}{y}}{a}\\ \mathbf{elif}\;b \leq 1.2 \cdot 10^{-40}:\\ \;\;\;\;\frac{\frac{x \cdot {z}^{y}}{a}}{y}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y \cdot \left(a \cdot e^{b}\right)}\\ \end{array} \]
Alternative 8
Accuracy65.5%
Cost6980
\[\begin{array}{l} \mathbf{if}\;b \leq -280:\\ \;\;\;\;\frac{x}{y \cdot \left(a \cdot b\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y \cdot \left(a \cdot e^{b}\right)}\\ \end{array} \]
Alternative 9
Accuracy65.5%
Cost6980
\[\begin{array}{l} \mathbf{if}\;b \leq 3.1 \cdot 10^{-255}:\\ \;\;\;\;\frac{x}{y \cdot \left(a + a \cdot b\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{y \cdot e^{b}}}{a}\\ \end{array} \]
Alternative 10
Accuracy44.8%
Cost713
\[\begin{array}{l} \mathbf{if}\;b \leq -850 \lor \neg \left(b \leq 2.9 \cdot 10^{-7}\right):\\ \;\;\;\;\frac{x}{a \cdot \left(y \cdot b\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y \cdot a}\\ \end{array} \]
Alternative 11
Accuracy44.2%
Cost712
\[\begin{array}{l} \mathbf{if}\;b \leq -840:\\ \;\;\;\;\frac{x}{y \cdot \left(a \cdot b\right)}\\ \mathbf{elif}\;b \leq 2.9 \cdot 10^{-7}:\\ \;\;\;\;\frac{x}{y \cdot 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 1.1 \cdot 10^{-120}:\\ \;\;\;\;\frac{\frac{x}{y \cdot b}}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y \cdot \left(a + a \cdot b\right)}\\ \end{array} \]
Alternative 13
Accuracy52.5%
Cost708
\[\begin{array}{l} \mathbf{if}\;a \leq 5 \cdot 10^{-25}:\\ \;\;\;\;\frac{\frac{x}{y + y \cdot b}}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y \cdot \left(a + a \cdot b\right)}\\ \end{array} \]
Alternative 14
Accuracy35.3%
Cost585
\[\begin{array}{l} \mathbf{if}\;y \leq -1.3 \cdot 10^{-115} \lor \neg \left(y \leq 4.1 \cdot 10^{-114}\right):\\ \;\;\;\;\frac{x}{y \cdot a}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{a}}{y}\\ \end{array} \]
Alternative 15
Accuracy37.7%
Cost452
\[\begin{array}{l} \mathbf{if}\;a \leq 1.2 \cdot 10^{-24}:\\ \;\;\;\;\frac{\frac{x}{y}}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y \cdot a}\\ \end{array} \]
Alternative 16
Accuracy32.8%
Cost320
\[\frac{x}{y \cdot a} \]

Error

Reproduce?

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