Average Error: 3.8 → 1.8
Time: 36.1s
Precision: binary64
Cost: 22724
\[\frac{x}{x + y \cdot e^{2 \cdot \left(\frac{z \cdot \sqrt{t + a}}{t} - \left(b - c\right) \cdot \left(\left(a + \frac{5}{6}\right) - \frac{2}{t \cdot 3}\right)\right)}} \]
\[\begin{array}{l} t_1 := \frac{z \cdot \sqrt{t + a}}{t} - \left(b - c\right) \cdot \left(\left(a + \frac{5}{6}\right) - \frac{2}{t \cdot 3}\right)\\ \mathbf{if}\;t_1 \leq \infty:\\ \;\;\;\;\frac{x}{x + y \cdot e^{2 \cdot t_1}}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{x + y \cdot e^{2 \cdot \frac{\sqrt{a} \cdot z - -0.6666666666666666 \cdot \left(b - c\right)}{t}}}\\ \end{array} \]
(FPCore (x y z t a b c)
 :precision binary64
 (/
  x
  (+
   x
   (*
    y
    (exp
     (*
      2.0
      (-
       (/ (* z (sqrt (+ t a))) t)
       (* (- b c) (- (+ a (/ 5.0 6.0)) (/ 2.0 (* t 3.0)))))))))))
(FPCore (x y z t a b c)
 :precision binary64
 (let* ((t_1
         (-
          (/ (* z (sqrt (+ t a))) t)
          (* (- b c) (- (+ a (/ 5.0 6.0)) (/ 2.0 (* t 3.0)))))))
   (if (<= t_1 INFINITY)
     (/ x (+ x (* y (exp (* 2.0 t_1)))))
     (/
      x
      (+
       x
       (*
        y
        (exp
         (*
          2.0
          (/ (- (* (sqrt a) z) (* -0.6666666666666666 (- b c))) t)))))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
	return x / (x + (y * exp((2.0 * (((z * sqrt((t + a))) / t) - ((b - c) * ((a + (5.0 / 6.0)) - (2.0 / (t * 3.0)))))))));
}
double code(double x, double y, double z, double t, double a, double b, double c) {
	double t_1 = ((z * sqrt((t + a))) / t) - ((b - c) * ((a + (5.0 / 6.0)) - (2.0 / (t * 3.0))));
	double tmp;
	if (t_1 <= ((double) INFINITY)) {
		tmp = x / (x + (y * exp((2.0 * t_1))));
	} else {
		tmp = x / (x + (y * exp((2.0 * (((sqrt(a) * z) - (-0.6666666666666666 * (b - c))) / t)))));
	}
	return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b, double c) {
	return x / (x + (y * Math.exp((2.0 * (((z * Math.sqrt((t + a))) / t) - ((b - c) * ((a + (5.0 / 6.0)) - (2.0 / (t * 3.0)))))))));
}
public static double code(double x, double y, double z, double t, double a, double b, double c) {
	double t_1 = ((z * Math.sqrt((t + a))) / t) - ((b - c) * ((a + (5.0 / 6.0)) - (2.0 / (t * 3.0))));
	double tmp;
	if (t_1 <= Double.POSITIVE_INFINITY) {
		tmp = x / (x + (y * Math.exp((2.0 * t_1))));
	} else {
		tmp = x / (x + (y * Math.exp((2.0 * (((Math.sqrt(a) * z) - (-0.6666666666666666 * (b - c))) / t)))));
	}
	return tmp;
}
def code(x, y, z, t, a, b, c):
	return x / (x + (y * math.exp((2.0 * (((z * math.sqrt((t + a))) / t) - ((b - c) * ((a + (5.0 / 6.0)) - (2.0 / (t * 3.0)))))))))
def code(x, y, z, t, a, b, c):
	t_1 = ((z * math.sqrt((t + a))) / t) - ((b - c) * ((a + (5.0 / 6.0)) - (2.0 / (t * 3.0))))
	tmp = 0
	if t_1 <= math.inf:
		tmp = x / (x + (y * math.exp((2.0 * t_1))))
	else:
		tmp = x / (x + (y * math.exp((2.0 * (((math.sqrt(a) * z) - (-0.6666666666666666 * (b - c))) / t)))))
	return tmp
function code(x, y, z, t, a, b, c)
	return Float64(x / Float64(x + Float64(y * exp(Float64(2.0 * Float64(Float64(Float64(z * sqrt(Float64(t + a))) / t) - Float64(Float64(b - c) * Float64(Float64(a + Float64(5.0 / 6.0)) - Float64(2.0 / Float64(t * 3.0))))))))))
end
function code(x, y, z, t, a, b, c)
	t_1 = Float64(Float64(Float64(z * sqrt(Float64(t + a))) / t) - Float64(Float64(b - c) * Float64(Float64(a + Float64(5.0 / 6.0)) - Float64(2.0 / Float64(t * 3.0)))))
	tmp = 0.0
	if (t_1 <= Inf)
		tmp = Float64(x / Float64(x + Float64(y * exp(Float64(2.0 * t_1)))));
	else
		tmp = Float64(x / Float64(x + Float64(y * exp(Float64(2.0 * Float64(Float64(Float64(sqrt(a) * z) - Float64(-0.6666666666666666 * Float64(b - c))) / t))))));
	end
	return tmp
end
function tmp = code(x, y, z, t, a, b, c)
	tmp = x / (x + (y * exp((2.0 * (((z * sqrt((t + a))) / t) - ((b - c) * ((a + (5.0 / 6.0)) - (2.0 / (t * 3.0)))))))));
end
function tmp_2 = code(x, y, z, t, a, b, c)
	t_1 = ((z * sqrt((t + a))) / t) - ((b - c) * ((a + (5.0 / 6.0)) - (2.0 / (t * 3.0))));
	tmp = 0.0;
	if (t_1 <= Inf)
		tmp = x / (x + (y * exp((2.0 * t_1))));
	else
		tmp = x / (x + (y * exp((2.0 * (((sqrt(a) * z) - (-0.6666666666666666 * (b - c))) / t)))));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_] := N[(x / N[(x + N[(y * N[Exp[N[(2.0 * N[(N[(N[(z * N[Sqrt[N[(t + a), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision] - N[(N[(b - c), $MachinePrecision] * N[(N[(a + N[(5.0 / 6.0), $MachinePrecision]), $MachinePrecision] - N[(2.0 / N[(t * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(N[(N[(z * N[Sqrt[N[(t + a), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision] - N[(N[(b - c), $MachinePrecision] * N[(N[(a + N[(5.0 / 6.0), $MachinePrecision]), $MachinePrecision] - N[(2.0 / N[(t * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, Infinity], N[(x / N[(x + N[(y * N[Exp[N[(2.0 * t$95$1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x / N[(x + N[(y * N[Exp[N[(2.0 * N[(N[(N[(N[Sqrt[a], $MachinePrecision] * z), $MachinePrecision] - N[(-0.6666666666666666 * N[(b - c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\frac{x}{x + y \cdot e^{2 \cdot \left(\frac{z \cdot \sqrt{t + a}}{t} - \left(b - c\right) \cdot \left(\left(a + \frac{5}{6}\right) - \frac{2}{t \cdot 3}\right)\right)}}
\begin{array}{l}
t_1 := \frac{z \cdot \sqrt{t + a}}{t} - \left(b - c\right) \cdot \left(\left(a + \frac{5}{6}\right) - \frac{2}{t \cdot 3}\right)\\
\mathbf{if}\;t_1 \leq \infty:\\
\;\;\;\;\frac{x}{x + y \cdot e^{2 \cdot t_1}}\\

\mathbf{else}:\\
\;\;\;\;\frac{x}{x + y \cdot e^{2 \cdot \frac{\sqrt{a} \cdot z - -0.6666666666666666 \cdot \left(b - c\right)}{t}}}\\


\end{array}

Error

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original3.8
Target3.3
Herbie1.8
\[\begin{array}{l} \mathbf{if}\;t < -2.118326644891581 \cdot 10^{-50}:\\ \;\;\;\;\frac{x}{x + y \cdot e^{2 \cdot \left(\left(a \cdot c + 0.8333333333333334 \cdot c\right) - a \cdot b\right)}}\\ \mathbf{elif}\;t < 5.196588770651547 \cdot 10^{-123}:\\ \;\;\;\;\frac{x}{x + y \cdot e^{2 \cdot \frac{\left(z \cdot \sqrt{t + a}\right) \cdot \left(\left(3 \cdot t\right) \cdot \left(a - \frac{5}{6}\right)\right) - \left(\left(\frac{5}{6} + a\right) \cdot \left(3 \cdot t\right) - 2\right) \cdot \left(\left(a - \frac{5}{6}\right) \cdot \left(\left(b - c\right) \cdot t\right)\right)}{\left(\left(t \cdot t\right) \cdot 3\right) \cdot \left(a - \frac{5}{6}\right)}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{x + y \cdot e^{2 \cdot \left(\frac{z \cdot \sqrt{t + a}}{t} - \left(b - c\right) \cdot \left(\left(a + \frac{5}{6}\right) - \frac{2}{t \cdot 3}\right)\right)}}\\ \end{array} \]

Derivation

  1. Split input into 2 regimes
  2. if (-.f64 (/.f64 (*.f64 z (sqrt.f64 (+.f64 t a))) t) (*.f64 (-.f64 b c) (-.f64 (+.f64 a (/.f64 5 6)) (/.f64 2 (*.f64 t 3))))) < +inf.0

    1. Initial program 0.9

      \[\frac{x}{x + y \cdot e^{2 \cdot \left(\frac{z \cdot \sqrt{t + a}}{t} - \left(b - c\right) \cdot \left(\left(a + \frac{5}{6}\right) - \frac{2}{t \cdot 3}\right)\right)}} \]

    if +inf.0 < (-.f64 (/.f64 (*.f64 z (sqrt.f64 (+.f64 t a))) t) (*.f64 (-.f64 b c) (-.f64 (+.f64 a (/.f64 5 6)) (/.f64 2 (*.f64 t 3)))))

    1. Initial program 64.0

      \[\frac{x}{x + y \cdot e^{2 \cdot \left(\frac{z \cdot \sqrt{t + a}}{t} - \left(b - c\right) \cdot \left(\left(a + \frac{5}{6}\right) - \frac{2}{t \cdot 3}\right)\right)}} \]
    2. Taylor expanded in t around 0 19.5

      \[\leadsto \frac{x}{x + y \cdot e^{2 \cdot \color{blue}{\frac{\sqrt{a} \cdot z - -0.6666666666666666 \cdot \left(b - c\right)}{t}}}} \]
  3. Recombined 2 regimes into one program.

Alternatives

Alternative 1
Error8.3
Cost14668
\[\begin{array}{l} \mathbf{if}\;t \leq -1 \cdot 10^{+47}:\\ \;\;\;\;\frac{x}{x + e^{-1.6666666666666667 \cdot \left(b - c\right)} \cdot y}\\ \mathbf{elif}\;t \leq 6.5 \cdot 10^{-220}:\\ \;\;\;\;\frac{x}{x + y \cdot e^{2 \cdot \frac{\sqrt{a} \cdot z - -0.6666666666666666 \cdot \left(b - c\right)}{t}}}\\ \mathbf{elif}\;t \leq 2.3 \cdot 10^{-6}:\\ \;\;\;\;\frac{x}{x + y \cdot e^{2 \cdot \left(-\left(b - c\right) \cdot \left(\left(0.8333333333333334 + a\right) + \frac{-0.6666666666666666}{t}\right)\right)}}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{x + y \cdot e^{2 \cdot \left(\frac{z \cdot \sqrt{t}}{t} + \left(c - b\right) \cdot \left(0.8333333333333334 + \frac{-0.6666666666666666}{t}\right)\right)}}\\ \end{array} \]
Alternative 2
Error9.0
Cost14152
\[\begin{array}{l} t_1 := \frac{x}{x + y \cdot e^{2 \cdot \left(-\left(b - c\right) \cdot \left(\left(0.8333333333333334 + a\right) + \frac{-0.6666666666666666}{t}\right)\right)}}\\ \mathbf{if}\;b - c \leq -1 \cdot 10^{-21}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;b - c \leq 5 \cdot 10^{-19}:\\ \;\;\;\;\frac{x}{x + y \cdot e^{2 \cdot \frac{z \cdot \sqrt{t}}{t}}}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 3
Error33.6
Cost7768
\[\begin{array}{l} \mathbf{if}\;b \leq -2 \cdot 10^{+224}:\\ \;\;\;\;1\\ \mathbf{elif}\;b \leq -7.2 \cdot 10^{+189}:\\ \;\;\;\;\frac{x}{e^{-2 \cdot \left(a \cdot b\right)} \cdot y}\\ \mathbf{elif}\;b \leq -2.9 \cdot 10^{-308}:\\ \;\;\;\;1\\ \mathbf{elif}\;b \leq 1.45 \cdot 10^{-254}:\\ \;\;\;\;\frac{x}{e^{c \cdot 1.6666666666666667} \cdot y}\\ \mathbf{elif}\;b \leq 1.2 \cdot 10^{+198}:\\ \;\;\;\;1\\ \mathbf{elif}\;b \leq 7 \cdot 10^{+299}:\\ \;\;\;\;\frac{x}{e^{\frac{1.3333333333333333 \cdot b}{t}} \cdot y}\\ \mathbf{else}:\\ \;\;\;\;1\\ \end{array} \]
Alternative 4
Error7.7
Cost7680
\[\frac{x}{x + y \cdot e^{2 \cdot \left(-\left(b - c\right) \cdot \left(\left(0.8333333333333334 + a\right) + \frac{-0.6666666666666666}{t}\right)\right)}} \]
Alternative 5
Error20.2
Cost7632
\[\begin{array}{l} t_1 := \frac{x}{x + e^{-1.6666666666666667 \cdot \left(b - c\right)} \cdot y}\\ \mathbf{if}\;t \leq -1.65 \cdot 10^{-276}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq 1.18 \cdot 10^{-150}:\\ \;\;\;\;1\\ \mathbf{elif}\;t \leq 4 \cdot 10^{-121}:\\ \;\;\;\;\frac{x}{e^{\frac{1.3333333333333333 \cdot \left(b - c\right)}{t}} \cdot y}\\ \mathbf{elif}\;t \leq 3.55 \cdot 10^{-25}:\\ \;\;\;\;1\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 6
Error19.9
Cost7632
\[\begin{array}{l} \mathbf{if}\;t \leq -4.8 \cdot 10^{-270}:\\ \;\;\;\;\frac{x}{x + y \cdot e^{2 \cdot \left(\left(c - b\right) \cdot a\right)}}\\ \mathbf{elif}\;t \leq 4.6 \cdot 10^{-152}:\\ \;\;\;\;1\\ \mathbf{elif}\;t \leq 2.25 \cdot 10^{-121}:\\ \;\;\;\;\frac{x}{e^{\frac{1.3333333333333333 \cdot \left(b - c\right)}{t}} \cdot y}\\ \mathbf{elif}\;t \leq 8 \cdot 10^{-43}:\\ \;\;\;\;1\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{x + e^{-1.6666666666666667 \cdot \left(b - c\right)} \cdot y}\\ \end{array} \]
Alternative 7
Error11.3
Cost7556
\[\begin{array}{l} \mathbf{if}\;t \leq 2.7 \cdot 10^{-17}:\\ \;\;\;\;\frac{x}{x + y \cdot e^{\frac{1.3333333333333333 \cdot \left(b - c\right)}{t}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{x + y \cdot e^{2 \cdot \left(-\left(b - c\right) \cdot \left(0.8333333333333334 + a\right)\right)}}\\ \end{array} \]
Alternative 8
Error26.7
Cost7508
\[\begin{array}{l} t_1 := \frac{x}{x + e^{-1.6666666666666667 \cdot b} \cdot y}\\ \mathbf{if}\;c \leq -8500000:\\ \;\;\;\;1\\ \mathbf{elif}\;c \leq -1.05 \cdot 10^{-130}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;c \leq -1.5 \cdot 10^{-278}:\\ \;\;\;\;1\\ \mathbf{elif}\;c \leq 4.5 \cdot 10^{-107}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;c \leq 7.2 \cdot 10^{+89}:\\ \;\;\;\;1\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{e^{c \cdot 1.6666666666666667} \cdot y}\\ \end{array} \]
Alternative 9
Error15.3
Cost7364
\[\begin{array}{l} \mathbf{if}\;t \leq 5.5 \cdot 10^{-17}:\\ \;\;\;\;\frac{x}{x + y \cdot e^{\frac{1.3333333333333333 \cdot \left(b - c\right)}{t}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{x + e^{-1.6666666666666667 \cdot \left(b - c\right)} \cdot y}\\ \end{array} \]
Alternative 10
Error28.2
Cost7244
\[\begin{array}{l} \mathbf{if}\;c \leq -1.8 \cdot 10^{-283}:\\ \;\;\;\;1\\ \mathbf{elif}\;c \leq 5.5 \cdot 10^{-261}:\\ \;\;\;\;\frac{x}{y + x}\\ \mathbf{elif}\;c \leq 5 \cdot 10^{+90}:\\ \;\;\;\;1\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{e^{c \cdot 1.6666666666666667} \cdot y}\\ \end{array} \]
Alternative 11
Error28.7
Cost7244
\[\begin{array}{l} \mathbf{if}\;c \leq -4.1 \cdot 10^{-296}:\\ \;\;\;\;1\\ \mathbf{elif}\;c \leq 2.6 \cdot 10^{-264}:\\ \;\;\;\;\frac{x}{e^{-2 \cdot \left(a \cdot b\right)} \cdot y}\\ \mathbf{elif}\;c \leq 7.8 \cdot 10^{+89}:\\ \;\;\;\;1\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{e^{c \cdot 1.6666666666666667} \cdot y}\\ \end{array} \]
Alternative 12
Error33.0
Cost2644
\[\begin{array}{l} t_1 := x - \frac{y}{t}\\ t_2 := t_1 - y\\ t_3 := \frac{x}{x + \left(1 + c \cdot 1.6666666666666667\right) \cdot y}\\ \mathbf{if}\;z \leq -8.6 \cdot 10^{-94}:\\ \;\;\;\;1\\ \mathbf{elif}\;z \leq -4.1 \cdot 10^{-178}:\\ \;\;\;\;\frac{x}{y \cdot a + \left(y + x\right)}\\ \mathbf{elif}\;z \leq -2.5 \cdot 10^{-235}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;z \leq -4.8 \cdot 10^{-277}:\\ \;\;\;\;\frac{x}{\begin{array}{l} \mathbf{if}\;t_2 \ne 0:\\ \;\;\;\;\frac{t_1 \cdot t_1 - y \cdot y}{t_2}\\ \mathbf{else}:\\ \;\;\;\;\left(x + y\right) - \frac{y}{t}\\ \end{array}}\\ \mathbf{elif}\;z \leq 2.2 \cdot 10^{+205}:\\ \;\;\;\;1\\ \mathbf{elif}\;z \leq 2.6 \cdot 10^{+300}:\\ \;\;\;\;t_3\\ \mathbf{else}:\\ \;\;\;\;1\\ \end{array} \]
Alternative 13
Error31.9
Cost1232
\[\begin{array}{l} \mathbf{if}\;z \leq -6.5 \cdot 10^{-93}:\\ \;\;\;\;1\\ \mathbf{elif}\;z \leq -2.1 \cdot 10^{-174}:\\ \;\;\;\;\frac{x}{y \cdot a + \left(y + x\right)}\\ \mathbf{elif}\;z \leq 1.45 \cdot 10^{+204}:\\ \;\;\;\;1\\ \mathbf{elif}\;z \leq 3.9 \cdot 10^{+301}:\\ \;\;\;\;\frac{x}{x + \left(1 + c \cdot 1.6666666666666667\right) \cdot y}\\ \mathbf{else}:\\ \;\;\;\;1\\ \end{array} \]
Alternative 14
Error31.4
Cost584
\[\begin{array}{l} \mathbf{if}\;a \leq 3.35 \cdot 10^{+227}:\\ \;\;\;\;1\\ \mathbf{elif}\;a \leq 3.5 \cdot 10^{+249}:\\ \;\;\;\;\frac{x}{y \cdot a}\\ \mathbf{else}:\\ \;\;\;\;1\\ \end{array} \]
Alternative 15
Error31.0
Cost64
\[1 \]

Error

Reproduce

herbie shell --seed 2023010 
(FPCore (x y z t a b c)
  :name "Numeric.SpecFunctions:invIncompleteBetaWorker from math-functions-0.1.5.2, I"
  :precision binary64

  :herbie-target
  (if (< t -2.118326644891581e-50) (/ x (+ x (* y (exp (* 2.0 (- (+ (* a c) (* 0.8333333333333334 c)) (* a b))))))) (if (< t 5.196588770651547e-123) (/ x (+ x (* y (exp (* 2.0 (/ (- (* (* z (sqrt (+ t a))) (* (* 3.0 t) (- a (/ 5.0 6.0)))) (* (- (* (+ (/ 5.0 6.0) a) (* 3.0 t)) 2.0) (* (- a (/ 5.0 6.0)) (* (- b c) t)))) (* (* (* t t) 3.0) (- a (/ 5.0 6.0))))))))) (/ x (+ x (* y (exp (* 2.0 (- (/ (* z (sqrt (+ t a))) t) (* (- b c) (- (+ a (/ 5.0 6.0)) (/ 2.0 (* t 3.0))))))))))))

  (/ x (+ x (* y (exp (* 2.0 (- (/ (* z (sqrt (+ t a))) t) (* (- b c) (- (+ a (/ 5.0 6.0)) (/ 2.0 (* t 3.0)))))))))))