?

Average Accuracy: 96.9% → 96.6%
Time: 33.1s
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 -692.5:\\ \;\;\;\;x \cdot \frac{{a}^{\left(t + -1\right)}}{y}\\ \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)) -692.5)
   (* x (/ (pow a (+ t -1.0)) y))
   (/ (* 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)) <= -692.5) {
		tmp = x * (pow(a, (t + -1.0)) / y);
	} 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)) <= (-692.5d0)) then
        tmp = x * ((a ** (t + (-1.0d0))) / y)
    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)) <= -692.5) {
		tmp = x * (Math.pow(a, (t + -1.0)) / y);
	} 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)) <= -692.5:
		tmp = x * (math.pow(a, (t + -1.0)) / y)
	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)) <= -692.5)
		tmp = Float64(x * Float64((a ^ Float64(t + -1.0)) / y));
	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)) <= -692.5)
		tmp = x * ((a ^ (t + -1.0)) / y);
	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], -692.5], N[(x * N[(N[Power[a, N[(t + -1.0), $MachinePrecision]], $MachinePrecision] / y), $MachinePrecision]), $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 -692.5:\\
\;\;\;\;x \cdot \frac{{a}^{\left(t + -1\right)}}{y}\\

\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

Original96.9%
Target82.4%
Herbie96.6%
\[\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)) < -692.5

    1. Initial program 99.7%

      \[\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 97.9%

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

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

      [Start]97.9

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

      associate-/l* [=>]85.7

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

      associate-/r/ [=>]98.2

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

      exp-diff [=>]85.4

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

      log-pow [<=]85.4

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

      sub-neg [=>]85.4

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

      metadata-eval [=>]85.4

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

      rem-exp-log [=>]85.5

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

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

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

    1. Initial program 95.2%

      \[\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 94.7%

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

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

      [Start]94.7

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

      mul-1-neg [=>]94.7

      \[ \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 simplification96.6%

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

Alternatives

Alternative 1
Accuracy89.0%
Cost20228
\[\begin{array}{l} \mathbf{if}\;\left(t + -1\right) \cdot \log a \leq -470:\\ \;\;\;\;x \cdot \frac{{a}^{\left(t + -1\right)}}{y}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \frac{{z}^{y}}{y \cdot \left(a \cdot e^{b}\right)}\\ \end{array} \]
Alternative 2
Accuracy96.9%
Cost20160
\[\frac{x \cdot e^{\left(y \cdot \log z + \left(t + -1\right) \cdot \log a\right) - b}}{y} \]
Alternative 3
Accuracy65.0%
Cost7508
\[\begin{array}{l} t_1 := \frac{1}{y} + \frac{b}{y}\\ t_2 := \frac{y - y \cdot b}{\frac{a \cdot \left(y \cdot y\right)}{x}}\\ \mathbf{if}\;b \leq -3.2 \cdot 10^{+47}:\\ \;\;\;\;\frac{x}{a} \cdot \left(b \cdot \frac{y - \frac{y}{b}}{-y \cdot y}\right)\\ \mathbf{elif}\;b \leq -5.8 \cdot 10^{-156}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;b \leq -1.42 \cdot 10^{-260}:\\ \;\;\;\;\frac{t_1}{\frac{t_1 \cdot \frac{a}{x}}{\frac{1 - b}{y}}}\\ \mathbf{elif}\;b \leq -7.8 \cdot 10^{-291}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;b \leq 1.12 \cdot 10^{-122}:\\ \;\;\;\;\frac{x}{y} \cdot \frac{-b}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y \cdot \left(a \cdot e^{b}\right)}\\ \end{array} \]
Alternative 4
Accuracy80.8%
Cost7376
\[\begin{array}{l} t_1 := \frac{1}{y} + \frac{b}{y}\\ t_2 := \frac{{z}^{y}}{a}\\ \mathbf{if}\;b \leq -9.4 \cdot 10^{-147}:\\ \;\;\;\;x \cdot \frac{t_2}{y}\\ \mathbf{elif}\;b \leq 5 \cdot 10^{-116}:\\ \;\;\;\;x \cdot \frac{{a}^{\left(t + -1\right)}}{y}\\ \mathbf{elif}\;b \leq 1.75 \cdot 10^{-9}:\\ \;\;\;\;t_2 \cdot \frac{x}{y}\\ \mathbf{elif}\;b \leq 4.6 \cdot 10^{-8}:\\ \;\;\;\;\frac{t_1}{\frac{t_1 \cdot \frac{a}{x}}{\frac{1 - b}{y}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y \cdot \left(a \cdot e^{b}\right)}\\ \end{array} \]
Alternative 5
Accuracy78.6%
Cost7044
\[\begin{array}{l} \mathbf{if}\;b \leq 1.36 \cdot 10^{-13}:\\ \;\;\;\;\frac{{z}^{y}}{a} \cdot \frac{x}{y}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y \cdot \left(a \cdot e^{b}\right)}\\ \end{array} \]
Alternative 6
Accuracy78.7%
Cost7044
\[\begin{array}{l} \mathbf{if}\;b \leq 9 \cdot 10^{-24}:\\ \;\;\;\;x \cdot \frac{\frac{{z}^{y}}{a}}{y}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y \cdot \left(a \cdot e^{b}\right)}\\ \end{array} \]
Alternative 7
Accuracy42.0%
Cost1996
\[\begin{array}{l} t_1 := \frac{1}{y} + \frac{b}{y}\\ t_2 := \frac{y - y \cdot b}{\frac{a \cdot \left(y \cdot y\right)}{x}}\\ \mathbf{if}\;b \leq -4 \cdot 10^{+46}:\\ \;\;\;\;\frac{x}{a} \cdot \left(b \cdot \frac{y - \frac{y}{b}}{-y \cdot y}\right)\\ \mathbf{elif}\;b \leq -3.1 \cdot 10^{-156}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;b \leq -1.4 \cdot 10^{-260}:\\ \;\;\;\;\frac{t_1}{\frac{t_1 \cdot \frac{a}{x}}{\frac{1 - b}{y}}}\\ \mathbf{elif}\;b \leq -2.25 \cdot 10^{-291}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;b \leq 1.2 \cdot 10^{-122}:\\ \;\;\;\;\frac{x}{y} \cdot \frac{-b}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{y}}{a + a \cdot b}\\ \end{array} \]
Alternative 8
Accuracy42.6%
Cost1492
\[\begin{array}{l} t_1 := \frac{\frac{x}{y}}{a + a \cdot b}\\ \mathbf{if}\;y \leq -1.6 \cdot 10^{+211}:\\ \;\;\;\;\frac{b}{y} \cdot \frac{-x}{a}\\ \mathbf{elif}\;y \leq -1.35 \cdot 10^{+166}:\\ \;\;\;\;\frac{x}{a} \cdot \left(b \cdot \frac{y - \frac{y}{b}}{-y \cdot y}\right)\\ \mathbf{elif}\;y \leq -1.45 \cdot 10^{-123}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 4.8 \cdot 10^{-267}:\\ \;\;\;\;\frac{\frac{x}{a}}{y}\\ \mathbf{elif}\;y \leq 2 \cdot 10^{+91}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;\frac{y - y \cdot b}{\frac{a \cdot \left(y \cdot y\right)}{x}}\\ \end{array} \]
Alternative 9
Accuracy41.8%
Cost1104
\[\begin{array}{l} t_1 := a + a \cdot b\\ \mathbf{if}\;b \leq -1.55 \cdot 10^{-106}:\\ \;\;\;\;\frac{x}{y \cdot t_1}\\ \mathbf{elif}\;b \leq -1.25 \cdot 10^{-154}:\\ \;\;\;\;\frac{b}{y} \cdot \frac{-x}{a}\\ \mathbf{elif}\;b \leq 9 \cdot 10^{-250}:\\ \;\;\;\;\frac{\frac{x}{a}}{y}\\ \mathbf{elif}\;b \leq 1.1 \cdot 10^{-122}:\\ \;\;\;\;\frac{x}{y} \cdot \frac{-b}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{y}}{t_1}\\ \end{array} \]
Alternative 10
Accuracy42.5%
Cost1096
\[\begin{array}{l} t_1 := \frac{\frac{x}{y}}{a + a \cdot b}\\ \mathbf{if}\;b \leq -6.5 \cdot 10^{+68}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;b \leq -1.85 \cdot 10^{-291}:\\ \;\;\;\;\frac{y - y \cdot b}{\frac{a \cdot \left(y \cdot y\right)}{x}}\\ \mathbf{elif}\;b \leq 1.3 \cdot 10^{-122}:\\ \;\;\;\;\frac{x}{y} \cdot \frac{-b}{a}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 11
Accuracy32.4%
Cost1040
\[\begin{array}{l} \mathbf{if}\;b \leq -1.05 \cdot 10^{-106}:\\ \;\;\;\;\frac{x}{y \cdot a}\\ \mathbf{elif}\;b \leq -3.1 \cdot 10^{-155}:\\ \;\;\;\;\frac{b}{y} \cdot \frac{-x}{a}\\ \mathbf{elif}\;b \leq 7.2 \cdot 10^{-252}:\\ \;\;\;\;\frac{\frac{x}{a}}{y}\\ \mathbf{elif}\;b \leq 1.1 \cdot 10^{-122}:\\ \;\;\;\;\frac{x}{y} \cdot \frac{-b}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{1}{a}}{\frac{y}{x}}\\ \end{array} \]
Alternative 12
Accuracy39.6%
Cost713
\[\begin{array}{l} \mathbf{if}\;x \leq -1 \cdot 10^{+30} \lor \neg \left(x \leq 9 \cdot 10^{-28}\right):\\ \;\;\;\;\frac{x}{y \cdot a}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{1}{a}}{\frac{y}{x}}\\ \end{array} \]
Alternative 13
Accuracy49.2%
Cost708
\[\begin{array}{l} \mathbf{if}\;a \leq 1.75 \cdot 10^{-90}:\\ \;\;\;\;\frac{\frac{1}{a}}{\frac{y}{x}}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{y \cdot \left(a + a \cdot b\right)}\\ \end{array} \]
Alternative 14
Accuracy36.6%
Cost585
\[\begin{array}{l} \mathbf{if}\;y \leq -2.6 \cdot 10^{-110} \lor \neg \left(y \leq 2 \cdot 10^{-13}\right):\\ \;\;\;\;\frac{x}{y \cdot a}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{a}}{y}\\ \end{array} \]
Alternative 15
Accuracy39.2%
Cost585
\[\begin{array}{l} \mathbf{if}\;x \leq -1 \cdot 10^{+30} \lor \neg \left(x \leq 2 \cdot 10^{-28}\right):\\ \;\;\;\;\frac{x}{y \cdot a}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{x}{y}}{a}\\ \end{array} \]
Alternative 16
Accuracy34.2%
Cost320
\[\frac{x}{y \cdot a} \]

Error

Reproduce?

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