Average Error: 5.1 → 0.2
Time: 37.2s
Precision: binary64
Cost: 53572
\[ \begin{array}{c}[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\ \end{array} \]
\[\left(\left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{y + 1} - \sqrt{y}\right)\right) + \left(\sqrt{z + 1} - \sqrt{z}\right)\right) + \left(\sqrt{t + 1} - \sqrt{t}\right) \]
\[\begin{array}{l} t_1 := \sqrt{1 + t}\\ t_2 := \sqrt{x + 1}\\ t_3 := \sqrt{z + 1}\\ t_4 := \sqrt{1 + y}\\ \mathbf{if}\;z \leq 1.6728622018806565 \cdot 10^{+27}:\\ \;\;\;\;\left(\left(\left(t_4 - \sqrt{y}\right) + \left(t_2 - \sqrt{x}\right)\right) + \frac{1}{\sqrt{z} + t_3}\right) + \frac{1 + \left(t - t\right)}{\sqrt{t} + t_1}\\ \mathbf{else}:\\ \;\;\;\;\left(\left(\frac{1 + \left(x - x\right)}{\sqrt{x} + t_2} + \frac{1 + \left(y - y\right)}{\sqrt{y} + t_4}\right) + \left(t_3 - \sqrt{z}\right)\right) + \left(t_1 - \sqrt{t}\right)\\ \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (+
  (+
   (+ (- (sqrt (+ x 1.0)) (sqrt x)) (- (sqrt (+ y 1.0)) (sqrt y)))
   (- (sqrt (+ z 1.0)) (sqrt z)))
  (- (sqrt (+ t 1.0)) (sqrt t))))
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (sqrt (+ 1.0 t)))
        (t_2 (sqrt (+ x 1.0)))
        (t_3 (sqrt (+ z 1.0)))
        (t_4 (sqrt (+ 1.0 y))))
   (if (<= z 1.6728622018806565e+27)
     (+
      (+ (+ (- t_4 (sqrt y)) (- t_2 (sqrt x))) (/ 1.0 (+ (sqrt z) t_3)))
      (/ (+ 1.0 (- t t)) (+ (sqrt t) t_1)))
     (+
      (+
       (+
        (/ (+ 1.0 (- x x)) (+ (sqrt x) t_2))
        (/ (+ 1.0 (- y y)) (+ (sqrt y) t_4)))
       (- t_3 (sqrt z)))
      (- t_1 (sqrt t))))))
double code(double x, double y, double z, double t) {
	return (((sqrt((x + 1.0)) - sqrt(x)) + (sqrt((y + 1.0)) - sqrt(y))) + (sqrt((z + 1.0)) - sqrt(z))) + (sqrt((t + 1.0)) - sqrt(t));
}
double code(double x, double y, double z, double t) {
	double t_1 = sqrt((1.0 + t));
	double t_2 = sqrt((x + 1.0));
	double t_3 = sqrt((z + 1.0));
	double t_4 = sqrt((1.0 + y));
	double tmp;
	if (z <= 1.6728622018806565e+27) {
		tmp = (((t_4 - sqrt(y)) + (t_2 - sqrt(x))) + (1.0 / (sqrt(z) + t_3))) + ((1.0 + (t - t)) / (sqrt(t) + t_1));
	} else {
		tmp = ((((1.0 + (x - x)) / (sqrt(x) + t_2)) + ((1.0 + (y - y)) / (sqrt(y) + t_4))) + (t_3 - sqrt(z))) + (t_1 - sqrt(t));
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    code = (((sqrt((x + 1.0d0)) - sqrt(x)) + (sqrt((y + 1.0d0)) - sqrt(y))) + (sqrt((z + 1.0d0)) - sqrt(z))) + (sqrt((t + 1.0d0)) - sqrt(t))
end function
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: t_3
    real(8) :: t_4
    real(8) :: tmp
    t_1 = sqrt((1.0d0 + t))
    t_2 = sqrt((x + 1.0d0))
    t_3 = sqrt((z + 1.0d0))
    t_4 = sqrt((1.0d0 + y))
    if (z <= 1.6728622018806565d+27) then
        tmp = (((t_4 - sqrt(y)) + (t_2 - sqrt(x))) + (1.0d0 / (sqrt(z) + t_3))) + ((1.0d0 + (t - t)) / (sqrt(t) + t_1))
    else
        tmp = ((((1.0d0 + (x - x)) / (sqrt(x) + t_2)) + ((1.0d0 + (y - y)) / (sqrt(y) + t_4))) + (t_3 - sqrt(z))) + (t_1 - sqrt(t))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	return (((Math.sqrt((x + 1.0)) - Math.sqrt(x)) + (Math.sqrt((y + 1.0)) - Math.sqrt(y))) + (Math.sqrt((z + 1.0)) - Math.sqrt(z))) + (Math.sqrt((t + 1.0)) - Math.sqrt(t));
}
public static double code(double x, double y, double z, double t) {
	double t_1 = Math.sqrt((1.0 + t));
	double t_2 = Math.sqrt((x + 1.0));
	double t_3 = Math.sqrt((z + 1.0));
	double t_4 = Math.sqrt((1.0 + y));
	double tmp;
	if (z <= 1.6728622018806565e+27) {
		tmp = (((t_4 - Math.sqrt(y)) + (t_2 - Math.sqrt(x))) + (1.0 / (Math.sqrt(z) + t_3))) + ((1.0 + (t - t)) / (Math.sqrt(t) + t_1));
	} else {
		tmp = ((((1.0 + (x - x)) / (Math.sqrt(x) + t_2)) + ((1.0 + (y - y)) / (Math.sqrt(y) + t_4))) + (t_3 - Math.sqrt(z))) + (t_1 - Math.sqrt(t));
	}
	return tmp;
}
def code(x, y, z, t):
	return (((math.sqrt((x + 1.0)) - math.sqrt(x)) + (math.sqrt((y + 1.0)) - math.sqrt(y))) + (math.sqrt((z + 1.0)) - math.sqrt(z))) + (math.sqrt((t + 1.0)) - math.sqrt(t))
def code(x, y, z, t):
	t_1 = math.sqrt((1.0 + t))
	t_2 = math.sqrt((x + 1.0))
	t_3 = math.sqrt((z + 1.0))
	t_4 = math.sqrt((1.0 + y))
	tmp = 0
	if z <= 1.6728622018806565e+27:
		tmp = (((t_4 - math.sqrt(y)) + (t_2 - math.sqrt(x))) + (1.0 / (math.sqrt(z) + t_3))) + ((1.0 + (t - t)) / (math.sqrt(t) + t_1))
	else:
		tmp = ((((1.0 + (x - x)) / (math.sqrt(x) + t_2)) + ((1.0 + (y - y)) / (math.sqrt(y) + t_4))) + (t_3 - math.sqrt(z))) + (t_1 - math.sqrt(t))
	return tmp
function code(x, y, z, t)
	return Float64(Float64(Float64(Float64(sqrt(Float64(x + 1.0)) - sqrt(x)) + Float64(sqrt(Float64(y + 1.0)) - sqrt(y))) + Float64(sqrt(Float64(z + 1.0)) - sqrt(z))) + Float64(sqrt(Float64(t + 1.0)) - sqrt(t)))
end
function code(x, y, z, t)
	t_1 = sqrt(Float64(1.0 + t))
	t_2 = sqrt(Float64(x + 1.0))
	t_3 = sqrt(Float64(z + 1.0))
	t_4 = sqrt(Float64(1.0 + y))
	tmp = 0.0
	if (z <= 1.6728622018806565e+27)
		tmp = Float64(Float64(Float64(Float64(t_4 - sqrt(y)) + Float64(t_2 - sqrt(x))) + Float64(1.0 / Float64(sqrt(z) + t_3))) + Float64(Float64(1.0 + Float64(t - t)) / Float64(sqrt(t) + t_1)));
	else
		tmp = Float64(Float64(Float64(Float64(Float64(1.0 + Float64(x - x)) / Float64(sqrt(x) + t_2)) + Float64(Float64(1.0 + Float64(y - y)) / Float64(sqrt(y) + t_4))) + Float64(t_3 - sqrt(z))) + Float64(t_1 - sqrt(t)));
	end
	return tmp
end
function tmp = code(x, y, z, t)
	tmp = (((sqrt((x + 1.0)) - sqrt(x)) + (sqrt((y + 1.0)) - sqrt(y))) + (sqrt((z + 1.0)) - sqrt(z))) + (sqrt((t + 1.0)) - sqrt(t));
end
function tmp_2 = code(x, y, z, t)
	t_1 = sqrt((1.0 + t));
	t_2 = sqrt((x + 1.0));
	t_3 = sqrt((z + 1.0));
	t_4 = sqrt((1.0 + y));
	tmp = 0.0;
	if (z <= 1.6728622018806565e+27)
		tmp = (((t_4 - sqrt(y)) + (t_2 - sqrt(x))) + (1.0 / (sqrt(z) + t_3))) + ((1.0 + (t - t)) / (sqrt(t) + t_1));
	else
		tmp = ((((1.0 + (x - x)) / (sqrt(x) + t_2)) + ((1.0 + (y - y)) / (sqrt(y) + t_4))) + (t_3 - sqrt(z))) + (t_1 - sqrt(t));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := N[(N[(N[(N[(N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(z + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(t + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[Sqrt[N[(z + 1.0), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$4 = N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[z, 1.6728622018806565e+27], N[(N[(N[(N[(t$95$4 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision] + N[(t$95$2 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[z], $MachinePrecision] + t$95$3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 + N[(t - t), $MachinePrecision]), $MachinePrecision] / N[(N[Sqrt[t], $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(N[(1.0 + N[(x - x), $MachinePrecision]), $MachinePrecision] / N[(N[Sqrt[x], $MachinePrecision] + t$95$2), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 + N[(y - y), $MachinePrecision]), $MachinePrecision] / N[(N[Sqrt[y], $MachinePrecision] + t$95$4), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$3 - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$1 - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\left(\left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{y + 1} - \sqrt{y}\right)\right) + \left(\sqrt{z + 1} - \sqrt{z}\right)\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)
\begin{array}{l}
t_1 := \sqrt{1 + t}\\
t_2 := \sqrt{x + 1}\\
t_3 := \sqrt{z + 1}\\
t_4 := \sqrt{1 + y}\\
\mathbf{if}\;z \leq 1.6728622018806565 \cdot 10^{+27}:\\
\;\;\;\;\left(\left(\left(t_4 - \sqrt{y}\right) + \left(t_2 - \sqrt{x}\right)\right) + \frac{1}{\sqrt{z} + t_3}\right) + \frac{1 + \left(t - t\right)}{\sqrt{t} + t_1}\\

\mathbf{else}:\\
\;\;\;\;\left(\left(\frac{1 + \left(x - x\right)}{\sqrt{x} + t_2} + \frac{1 + \left(y - y\right)}{\sqrt{y} + t_4}\right) + \left(t_3 - \sqrt{z}\right)\right) + \left(t_1 - \sqrt{t}\right)\\


\end{array}

Error

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original5.1
Target0.4
Herbie0.2
\[\left(\left(\frac{1}{\sqrt{x + 1} + \sqrt{x}} + \frac{1}{\sqrt{y + 1} + \sqrt{y}}\right) + \frac{1}{\sqrt{z + 1} + \sqrt{z}}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right) \]

Derivation

  1. Split input into 2 regimes
  2. if z < 1.67286220188065649e27

    1. Initial program 2.8

      \[\left(\left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{y + 1} - \sqrt{y}\right)\right) + \left(\sqrt{z + 1} - \sqrt{z}\right)\right) + \left(\sqrt{t + 1} - \sqrt{t}\right) \]
    2. Applied egg-rr2.0

      \[\leadsto \left(\left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{y + 1} - \sqrt{y}\right)\right) + \color{blue}{\frac{z + \left(1 - z\right)}{\sqrt{z + 1} + \sqrt{z}}}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right) \]
    3. Applied egg-rr1.2

      \[\leadsto \left(\left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{y + 1} - \sqrt{y}\right)\right) + \frac{z + \left(1 - z\right)}{\sqrt{z + 1} + \sqrt{z}}\right) + \color{blue}{\frac{1 + \left(t - t\right)}{\sqrt{1 + t} + \sqrt{t}}} \]
    4. Taylor expanded in z around 0 0.2

      \[\leadsto \left(\left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{y + 1} - \sqrt{y}\right)\right) + \frac{\color{blue}{1}}{\sqrt{z + 1} + \sqrt{z}}\right) + \frac{1 + \left(t - t\right)}{\sqrt{1 + t} + \sqrt{t}} \]

    if 1.67286220188065649e27 < z

    1. Initial program 6.4

      \[\left(\left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{y + 1} - \sqrt{y}\right)\right) + \left(\sqrt{z + 1} - \sqrt{z}\right)\right) + \left(\sqrt{t + 1} - \sqrt{t}\right) \]
    2. Applied egg-rr2.1

      \[\leadsto \left(\left(\color{blue}{\frac{1 + \left(x - x\right)}{\sqrt{1 + x} + \sqrt{x}}} + \left(\sqrt{y + 1} - \sqrt{y}\right)\right) + \left(\sqrt{z + 1} - \sqrt{z}\right)\right) + \left(\sqrt{t + 1} - \sqrt{t}\right) \]
    3. Applied egg-rr0.2

      \[\leadsto \left(\left(\frac{1 + \left(x - x\right)}{\sqrt{1 + x} + \sqrt{x}} + \color{blue}{\frac{1 + \left(y - y\right)}{\sqrt{1 + y} + \sqrt{y}}}\right) + \left(\sqrt{z + 1} - \sqrt{z}\right)\right) + \left(\sqrt{t + 1} - \sqrt{t}\right) \]
  3. Recombined 2 regimes into one program.
  4. Final simplification0.2

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq 1.6728622018806565 \cdot 10^{+27}:\\ \;\;\;\;\left(\left(\left(\sqrt{1 + y} - \sqrt{y}\right) + \left(\sqrt{x + 1} - \sqrt{x}\right)\right) + \frac{1}{\sqrt{z} + \sqrt{z + 1}}\right) + \frac{1 + \left(t - t\right)}{\sqrt{t} + \sqrt{1 + t}}\\ \mathbf{else}:\\ \;\;\;\;\left(\left(\frac{1 + \left(x - x\right)}{\sqrt{x} + \sqrt{x + 1}} + \frac{1 + \left(y - y\right)}{\sqrt{y} + \sqrt{1 + y}}\right) + \left(\sqrt{z + 1} - \sqrt{z}\right)\right) + \left(\sqrt{1 + t} - \sqrt{t}\right)\\ \end{array} \]

Alternatives

Alternative 1
Error2.6
Cost92228
\[\begin{array}{l} t_1 := \sqrt{x + 1}\\ t_2 := \left(\left(\sqrt{1 + y} - \sqrt{y}\right) + \left(t_1 - \sqrt{x}\right)\right) + \left(\sqrt{z + 1} - \sqrt{z}\right)\\ \mathbf{if}\;t_2 \leq 0:\\ \;\;\;\;\frac{1 + \left(x - x\right)}{\sqrt{x} + t_1}\\ \mathbf{else}:\\ \;\;\;\;\left(\sqrt{1 + t} - \sqrt{t}\right) + t_2\\ \end{array} \]
Alternative 2
Error1.3
Cost79556
\[\begin{array}{l} t_1 := \sqrt{1 + t}\\ t_2 := \sqrt{1 + y} - \sqrt{y}\\ t_3 := \sqrt{z + 1}\\ t_4 := \sqrt{x + 1}\\ t_5 := t_2 + \left(t_4 - \sqrt{x}\right)\\ \mathbf{if}\;t_5 \leq 0.99999999:\\ \;\;\;\;\left(t_1 - \sqrt{t}\right) + \left(\left(t_3 - \sqrt{z}\right) + \left(t_2 + \frac{1 + \left(x - x\right)}{\sqrt{x} + t_4}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(t_5 + \frac{1}{\sqrt{z} + t_3}\right) + \frac{1 + \left(t - t\right)}{\sqrt{t} + t_1}\\ \end{array} \]
Alternative 3
Error1.1
Cost79556
\[\begin{array}{l} t_1 := \sqrt{1 + y}\\ t_2 := \sqrt{x + 1}\\ t_3 := t_2 - \sqrt{x}\\ \mathbf{if}\;\left(t_1 - \sqrt{y}\right) + t_3 \leq 0:\\ \;\;\;\;\frac{1 + \left(x - x\right)}{\sqrt{x} + t_2}\\ \mathbf{else}:\\ \;\;\;\;\left(\sqrt{1 + t} - \sqrt{t}\right) + \left(\frac{1}{\sqrt{z} + \sqrt{z + 1}} + \left(\frac{1 + \left(y - y\right)}{\sqrt{y} + t_1} + t_3\right)\right)\\ \end{array} \]
Alternative 4
Error1.8
Cost65988
\[\begin{array}{l} t_1 := \sqrt{x + 1}\\ t_2 := t_1 - \sqrt{x}\\ \mathbf{if}\;t_2 \leq 0:\\ \;\;\;\;\frac{1 + \left(x - x\right)}{\sqrt{x} + t_1}\\ \mathbf{else}:\\ \;\;\;\;\left(\left(\left(\sqrt{1 + y} - \sqrt{y}\right) + t_2\right) + \frac{1}{\sqrt{z} + \sqrt{z + 1}}\right) + \left(\sqrt{1 + t} - \sqrt{t}\right)\\ \end{array} \]
Alternative 5
Error2.3
Cost53056
\[\left(\sqrt{1 + t} - \sqrt{t}\right) + \left(\left(\sqrt{z + 1} - \sqrt{z}\right) + \left(\left(\sqrt{1 + y} - \sqrt{y}\right) + \frac{1 + \left(x - x\right)}{\sqrt{x} + \sqrt{x + 1}}\right)\right) \]
Alternative 6
Error2.5
Cost52804
\[\begin{array}{l} t_1 := \sqrt{1 + y} - \sqrt{y}\\ \mathbf{if}\;t_1 \leq 2 \cdot 10^{-6}:\\ \;\;\;\;\frac{1 + \left(x - x\right)}{\sqrt{x} + \sqrt{x + 1}}\\ \mathbf{else}:\\ \;\;\;\;\left(\sqrt{1 + t} - \sqrt{t}\right) + \left(\left(\sqrt{z + 1} - \sqrt{z}\right) + \left(1 + t_1\right)\right)\\ \end{array} \]
Alternative 7
Error1.9
Cost40132
\[\begin{array}{l} \mathbf{if}\;y \leq 1.9293630078411976 \cdot 10^{+30}:\\ \;\;\;\;\left(\sqrt{1 + t} - \sqrt{t}\right) + \left(\left(\sqrt{z + 1} - \sqrt{z}\right) + \left(1 + \frac{1 + \left(y - y\right)}{\sqrt{y} + \sqrt{1 + y}}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{1 + \left(x - x\right)}{\sqrt{x} + \sqrt{x + 1}}\\ \end{array} \]
Alternative 8
Error6.5
Cost26568
\[\begin{array}{l} t_1 := \sqrt{x + 1}\\ \mathbf{if}\;y \leq 5.062546996102832 \cdot 10^{-22}:\\ \;\;\;\;1 + \left(1 + \left(\mathsf{hypot}\left(1, \sqrt{z}\right) - \sqrt{z}\right)\right)\\ \mathbf{elif}\;y \leq 332581002450147.6:\\ \;\;\;\;\sqrt{1 + y} + \left(t_1 - \left(\sqrt{x} + \sqrt{y}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{1 + \left(x - x\right)}{\sqrt{x} + t_1}\\ \end{array} \]
Alternative 9
Error6.2
Cost26564
\[\begin{array}{l} \mathbf{if}\;y \leq 30680498937.427963:\\ \;\;\;\;\left(1 + \sqrt{1 + y}\right) + \left(\left(\sqrt{z + 1} - \sqrt{z}\right) - \sqrt{y}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{1 + \left(x - x\right)}{\sqrt{x} + \sqrt{x + 1}}\\ \end{array} \]
Alternative 10
Error6.7
Cost19844
\[\begin{array}{l} \mathbf{if}\;y \leq 5.062546996102832 \cdot 10^{-22}:\\ \;\;\;\;1 + \left(1 + \left(\mathsf{hypot}\left(1, \sqrt{z}\right) - \sqrt{z}\right)\right)\\ \mathbf{elif}\;y \leq 30680498937.427963:\\ \;\;\;\;\sqrt{1 + y} + \left(1 - \sqrt{y}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{1 + \left(x - x\right)}{\sqrt{x} + \sqrt{x + 1}}\\ \end{array} \]
Alternative 11
Error20.6
Cost14432
\[\begin{array}{l} t_1 := \sqrt{1 + y}\\ t_2 := t_1 + \left(1 - \sqrt{y}\right)\\ t_3 := \sqrt{z + 1}\\ t_4 := \sqrt{x + 1}\\ t_5 := t_4 - \sqrt{x}\\ \mathbf{if}\;z \leq 2061756901170:\\ \;\;\;\;\left(t_3 + 2\right) - \sqrt{z}\\ \mathbf{elif}\;z \leq 1.7237002018336683 \cdot 10^{+109}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;z \leq 2.9275730598692184 \cdot 10^{+162}:\\ \;\;\;\;t_5\\ \mathbf{elif}\;z \leq 2.716932641093776 \cdot 10^{+181}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;z \leq 1.2360104755004707 \cdot 10^{+197}:\\ \;\;\;\;t_5\\ \mathbf{elif}\;z \leq 2.1805094440027102 \cdot 10^{+215}:\\ \;\;\;\;\left(1 + t_4\right) - \sqrt{x}\\ \mathbf{elif}\;z \leq 6.098789985749242 \cdot 10^{+246}:\\ \;\;\;\;t_5\\ \mathbf{elif}\;z \leq 1.1288356159155267 \cdot 10^{+275}:\\ \;\;\;\;\left(1 + t_1\right) - \sqrt{y}\\ \mathbf{else}:\\ \;\;\;\;1 + \left(\left(1 + t_3\right) - \sqrt{z}\right)\\ \end{array} \]
Alternative 12
Error20.4
Cost14304
\[\begin{array}{l} t_1 := \left(1 + \sqrt{1 + y}\right) - \sqrt{y}\\ t_2 := \sqrt{x + 1} - \sqrt{x}\\ \mathbf{if}\;z \leq 2061756901170:\\ \;\;\;\;\left(\sqrt{z + 1} + 2\right) - \sqrt{z}\\ \mathbf{elif}\;z \leq 1.7237002018336683 \cdot 10^{+109}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq 2.9275730598692184 \cdot 10^{+162}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;z \leq 2.716932641093776 \cdot 10^{+181}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq 1.1577822878362023 \cdot 10^{+202}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;z \leq 2.1805094440027102 \cdot 10^{+215}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq 6.098789985749242 \cdot 10^{+246}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;z \leq 1.1288356159155267 \cdot 10^{+275}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;1\\ \end{array} \]
Alternative 13
Error20.6
Cost14304
\[\begin{array}{l} t_1 := \left(1 + \sqrt{1 + y}\right) - \sqrt{y}\\ t_2 := \sqrt{x + 1}\\ t_3 := t_2 - \sqrt{x}\\ \mathbf{if}\;z \leq 2061756901170:\\ \;\;\;\;\left(\sqrt{z + 1} + 2\right) - \sqrt{z}\\ \mathbf{elif}\;z \leq 1.7237002018336683 \cdot 10^{+109}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq 2.9275730598692184 \cdot 10^{+162}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;z \leq 2.716932641093776 \cdot 10^{+181}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq 1.2360104755004707 \cdot 10^{+197}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;z \leq 2.1805094440027102 \cdot 10^{+215}:\\ \;\;\;\;\left(1 + t_2\right) - \sqrt{x}\\ \mathbf{elif}\;z \leq 6.098789985749242 \cdot 10^{+246}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;z \leq 1.1288356159155267 \cdot 10^{+275}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;1\\ \end{array} \]
Alternative 14
Error20.6
Cost14304
\[\begin{array}{l} t_1 := \sqrt{1 + y}\\ t_2 := t_1 + \left(1 - \sqrt{y}\right)\\ t_3 := \sqrt{x + 1}\\ t_4 := t_3 - \sqrt{x}\\ \mathbf{if}\;z \leq 2061756901170:\\ \;\;\;\;\left(\sqrt{z + 1} + 2\right) - \sqrt{z}\\ \mathbf{elif}\;z \leq 1.7237002018336683 \cdot 10^{+109}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;z \leq 2.9275730598692184 \cdot 10^{+162}:\\ \;\;\;\;t_4\\ \mathbf{elif}\;z \leq 2.716932641093776 \cdot 10^{+181}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;z \leq 1.2360104755004707 \cdot 10^{+197}:\\ \;\;\;\;t_4\\ \mathbf{elif}\;z \leq 2.1805094440027102 \cdot 10^{+215}:\\ \;\;\;\;\left(1 + t_3\right) - \sqrt{x}\\ \mathbf{elif}\;z \leq 6.098789985749242 \cdot 10^{+246}:\\ \;\;\;\;t_4\\ \mathbf{elif}\;z \leq 1.1288356159155267 \cdot 10^{+275}:\\ \;\;\;\;\left(1 + t_1\right) - \sqrt{y}\\ \mathbf{else}:\\ \;\;\;\;1\\ \end{array} \]
Alternative 15
Error17.4
Cost14032
\[\begin{array}{l} t_1 := \sqrt{1 + y} + \left(1 - \sqrt{y}\right)\\ t_2 := \frac{1 + \left(x - x\right)}{\sqrt{x} + \sqrt{x + 1}}\\ \mathbf{if}\;z \leq 2061756901170:\\ \;\;\;\;\left(\sqrt{z + 1} + 2\right) - \sqrt{z}\\ \mathbf{elif}\;z \leq 1.7237002018336683 \cdot 10^{+109}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq 3.7116364499216265 \cdot 10^{+168}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;z \leq 2.716932641093776 \cdot 10^{+181}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 16
Error26.4
Cost13380
\[\begin{array}{l} \mathbf{if}\;z \leq 1.6728622018806565 \cdot 10^{+27}:\\ \;\;\;\;\sqrt{z + 1} + \left(2 - \sqrt{z}\right)\\ \mathbf{else}:\\ \;\;\;\;\sqrt{x + 1} - \sqrt{x}\\ \end{array} \]
Alternative 17
Error26.4
Cost13380
\[\begin{array}{l} \mathbf{if}\;z \leq 1.6728622018806565 \cdot 10^{+27}:\\ \;\;\;\;\left(\sqrt{z + 1} + 2\right) - \sqrt{z}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{x + 1} - \sqrt{x}\\ \end{array} \]
Alternative 18
Error41.2
Cost13120
\[\sqrt{x + 1} - \sqrt{x} \]
Alternative 19
Error41.7
Cost6848
\[\left(1 + x \cdot 0.5\right) - \sqrt{x} \]
Alternative 20
Error42.0
Cost64
\[1 \]

Error

Reproduce

herbie shell --seed 2022295 
(FPCore (x y z t)
  :name "Main:z from "
  :precision binary64

  :herbie-target
  (+ (+ (+ (/ 1.0 (+ (sqrt (+ x 1.0)) (sqrt x))) (/ 1.0 (+ (sqrt (+ y 1.0)) (sqrt y)))) (/ 1.0 (+ (sqrt (+ z 1.0)) (sqrt z)))) (- (sqrt (+ t 1.0)) (sqrt t)))

  (+ (+ (+ (- (sqrt (+ x 1.0)) (sqrt x)) (- (sqrt (+ y 1.0)) (sqrt y))) (- (sqrt (+ z 1.0)) (sqrt z))) (- (sqrt (+ t 1.0)) (sqrt t))))