?

Average Error: 8.05% → 0.33%
Time: 25.2s
Precision: binary64
Cost: 53316

?

\[ \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{1 + x}\\ t_3 := \sqrt{1 + y}\\ t_4 := \sqrt{1 + z}\\ \mathbf{if}\;z \leq 2.35 \cdot 10^{+30}:\\ \;\;\;\;\left(\frac{1}{t_4 + \sqrt{z}} + \left(\left(t_2 - \sqrt{x}\right) + \left(t_3 - \sqrt{y}\right)\right)\right) + \frac{1 + \left(t - t\right)}{\sqrt{t} + t_1}\\ \mathbf{else}:\\ \;\;\;\;\left(t_1 - \sqrt{t}\right) + \left(\left(\frac{1}{\sqrt{x} + t_2} + \frac{1}{t_3 + \sqrt{y}}\right) + \left(t_4 - \sqrt{z}\right)\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 (+ 1.0 x)))
        (t_3 (sqrt (+ 1.0 y)))
        (t_4 (sqrt (+ 1.0 z))))
   (if (<= z 2.35e+30)
     (+
      (+ (/ 1.0 (+ t_4 (sqrt z))) (+ (- t_2 (sqrt x)) (- t_3 (sqrt y))))
      (/ (+ 1.0 (- t t)) (+ (sqrt t) t_1)))
     (+
      (- t_1 (sqrt t))
      (+
       (+ (/ 1.0 (+ (sqrt x) t_2)) (/ 1.0 (+ t_3 (sqrt y))))
       (- t_4 (sqrt z)))))))
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((1.0 + x));
	double t_3 = sqrt((1.0 + y));
	double t_4 = sqrt((1.0 + z));
	double tmp;
	if (z <= 2.35e+30) {
		tmp = ((1.0 / (t_4 + sqrt(z))) + ((t_2 - sqrt(x)) + (t_3 - sqrt(y)))) + ((1.0 + (t - t)) / (sqrt(t) + t_1));
	} else {
		tmp = (t_1 - sqrt(t)) + (((1.0 / (sqrt(x) + t_2)) + (1.0 / (t_3 + sqrt(y)))) + (t_4 - sqrt(z)));
	}
	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((1.0d0 + x))
    t_3 = sqrt((1.0d0 + y))
    t_4 = sqrt((1.0d0 + z))
    if (z <= 2.35d+30) then
        tmp = ((1.0d0 / (t_4 + sqrt(z))) + ((t_2 - sqrt(x)) + (t_3 - sqrt(y)))) + ((1.0d0 + (t - t)) / (sqrt(t) + t_1))
    else
        tmp = (t_1 - sqrt(t)) + (((1.0d0 / (sqrt(x) + t_2)) + (1.0d0 / (t_3 + sqrt(y)))) + (t_4 - sqrt(z)))
    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((1.0 + x));
	double t_3 = Math.sqrt((1.0 + y));
	double t_4 = Math.sqrt((1.0 + z));
	double tmp;
	if (z <= 2.35e+30) {
		tmp = ((1.0 / (t_4 + Math.sqrt(z))) + ((t_2 - Math.sqrt(x)) + (t_3 - Math.sqrt(y)))) + ((1.0 + (t - t)) / (Math.sqrt(t) + t_1));
	} else {
		tmp = (t_1 - Math.sqrt(t)) + (((1.0 / (Math.sqrt(x) + t_2)) + (1.0 / (t_3 + Math.sqrt(y)))) + (t_4 - Math.sqrt(z)));
	}
	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((1.0 + x))
	t_3 = math.sqrt((1.0 + y))
	t_4 = math.sqrt((1.0 + z))
	tmp = 0
	if z <= 2.35e+30:
		tmp = ((1.0 / (t_4 + math.sqrt(z))) + ((t_2 - math.sqrt(x)) + (t_3 - math.sqrt(y)))) + ((1.0 + (t - t)) / (math.sqrt(t) + t_1))
	else:
		tmp = (t_1 - math.sqrt(t)) + (((1.0 / (math.sqrt(x) + t_2)) + (1.0 / (t_3 + math.sqrt(y)))) + (t_4 - math.sqrt(z)))
	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(1.0 + x))
	t_3 = sqrt(Float64(1.0 + y))
	t_4 = sqrt(Float64(1.0 + z))
	tmp = 0.0
	if (z <= 2.35e+30)
		tmp = Float64(Float64(Float64(1.0 / Float64(t_4 + sqrt(z))) + Float64(Float64(t_2 - sqrt(x)) + Float64(t_3 - sqrt(y)))) + Float64(Float64(1.0 + Float64(t - t)) / Float64(sqrt(t) + t_1)));
	else
		tmp = Float64(Float64(t_1 - sqrt(t)) + Float64(Float64(Float64(1.0 / Float64(sqrt(x) + t_2)) + Float64(1.0 / Float64(t_3 + sqrt(y)))) + Float64(t_4 - sqrt(z))));
	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((1.0 + x));
	t_3 = sqrt((1.0 + y));
	t_4 = sqrt((1.0 + z));
	tmp = 0.0;
	if (z <= 2.35e+30)
		tmp = ((1.0 / (t_4 + sqrt(z))) + ((t_2 - sqrt(x)) + (t_3 - sqrt(y)))) + ((1.0 + (t - t)) / (sqrt(t) + t_1));
	else
		tmp = (t_1 - sqrt(t)) + (((1.0 / (sqrt(x) + t_2)) + (1.0 / (t_3 + sqrt(y)))) + (t_4 - sqrt(z)));
	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[(1.0 + x), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$4 = N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[z, 2.35e+30], N[(N[(N[(1.0 / N[(t$95$4 + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$2 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(t$95$3 - N[Sqrt[y], $MachinePrecision]), $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[(t$95$1 - N[Sqrt[t], $MachinePrecision]), $MachinePrecision] + N[(N[(N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + t$95$2), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(t$95$3 + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$4 - N[Sqrt[z], $MachinePrecision]), $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{1 + x}\\
t_3 := \sqrt{1 + y}\\
t_4 := \sqrt{1 + z}\\
\mathbf{if}\;z \leq 2.35 \cdot 10^{+30}:\\
\;\;\;\;\left(\frac{1}{t_4 + \sqrt{z}} + \left(\left(t_2 - \sqrt{x}\right) + \left(t_3 - \sqrt{y}\right)\right)\right) + \frac{1 + \left(t - t\right)}{\sqrt{t} + t_1}\\

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


\end{array}

Error?

Try it out?

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original8.05%
Target0.62%
Herbie0.33%
\[\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 < 2.34999999999999995e30

    1. Initial program 4.61

      \[\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-rr1.64

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

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

      [Start]1.64

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

      +-commutative [=>]1.64

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

      +-inverses [=>]1.64

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

      metadata-eval [=>]1.64

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

      *-lft-identity [=>]1.64

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

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

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

      [Start]0.96

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

      associate-*r/ [=>]0.96

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

      *-rgt-identity [=>]0.96

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

      associate-+r- [=>]0.96

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

      +-commutative [<=]0.96

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

      associate--l+ [=>]0.42

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

    if 2.34999999999999995e30 < z

    1. Initial program 10.35

      \[\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-rr3.47

      \[\leadsto \left(\left(\color{blue}{\left(1 + \left(x - x\right)\right) \cdot \frac{1}{\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. Simplified3.47

      \[\leadsto \left(\left(\color{blue}{\frac{1}{\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) \]
      Proof

      [Start]3.47

      \[ \left(\left(\left(1 + \left(x - x\right)\right) \cdot \frac{1}{\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) \]

      +-commutative [=>]3.47

      \[ \left(\left(\color{blue}{\left(\left(x - x\right) + 1\right)} \cdot \frac{1}{\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) \]

      +-inverses [=>]3.47

      \[ \left(\left(\left(\color{blue}{0} + 1\right) \cdot \frac{1}{\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) \]

      metadata-eval [=>]3.47

      \[ \left(\left(\color{blue}{1} \cdot \frac{1}{\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) \]

      *-lft-identity [=>]3.47

      \[ \left(\left(\color{blue}{\frac{1}{\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) \]
    4. Applied egg-rr2.51

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

      \[\leadsto \left(\left(\frac{1}{\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) \]
      Proof

      [Start]2.51

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

      associate-*r/ [=>]2.51

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

      *-rgt-identity [=>]2.51

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

      associate-+r- [=>]2.51

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

      +-commutative [=>]2.51

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

      associate--l+ [=>]0.27

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

      +-commutative [=>]0.27

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

      \[\leadsto \left(\left(\frac{1}{\sqrt{1 + x} + \sqrt{x}} + \color{blue}{-1 \cdot \frac{-1}{\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.33

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

Alternatives

Alternative 1
Error1.77%
Cost105544
\[\begin{array}{l} t_1 := \sqrt{1 + t} - \sqrt{t}\\ t_2 := \sqrt{1 + x}\\ t_3 := \frac{1}{\sqrt{1 + z} + \sqrt{z}}\\ t_4 := \sqrt{1 + y}\\ t_5 := \left(t_2 - \sqrt{x}\right) + \left(t_4 - \sqrt{y}\right)\\ \mathbf{if}\;t_5 \leq 0.9999999999999986:\\ \;\;\;\;t_1 + \left(t_3 + \frac{1}{\sqrt{x} + t_2}\right)\\ \mathbf{elif}\;t_5 \leq 1.05:\\ \;\;\;\;t_1 + \left(t_3 + \left(1 + \frac{1}{t_4 + \sqrt{y}}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t_1 + \left(t_3 + t_5\right)\\ \end{array} \]
Alternative 2
Error1.93%
Cost66244
\[\begin{array}{l} t_1 := \sqrt{1 + t} - \sqrt{t}\\ t_2 := \sqrt{1 + x}\\ t_3 := \frac{1}{\sqrt{1 + z} + \sqrt{z}}\\ t_4 := \sqrt{1 + y}\\ \mathbf{if}\;\left(t_2 - \sqrt{x}\right) + \left(t_4 - \sqrt{y}\right) \leq 0.9999999999999986:\\ \;\;\;\;t_1 + \left(t_3 + \frac{1}{\sqrt{x} + t_2}\right)\\ \mathbf{else}:\\ \;\;\;\;t_1 + \left(t_3 + \left(1 + \frac{1}{t_4 + \sqrt{y}}\right)\right)\\ \end{array} \]
Alternative 3
Error0.62%
Cost53056
\[\left(\left(\frac{1}{\sqrt{x} + \sqrt{1 + x}} + \frac{1}{\sqrt{1 + y} + \sqrt{y}}\right) + \frac{1}{\sqrt{1 + z} + \sqrt{z}}\right) + \left(\sqrt{1 + t} - \sqrt{t}\right) \]
Alternative 4
Error1.96%
Cost52928
\[\left(\sqrt{1 + t} - \sqrt{t}\right) + \left(\left(\frac{1}{\sqrt{x} + \sqrt{1 + x}} + \frac{1}{\sqrt{1 + y} + \sqrt{y}}\right) + \left(\sqrt{1 + z} - \sqrt{z}\right)\right) \]
Alternative 5
Error2.11%
Cost40004
\[\begin{array}{l} t_1 := \sqrt{1 + z}\\ t_2 := \sqrt{1 + t} - \sqrt{t}\\ \mathbf{if}\;y \leq 4.6 \cdot 10^{+27}:\\ \;\;\;\;t_2 + \left(\frac{1}{t_1 + \sqrt{z}} + \left(1 + \frac{1}{\sqrt{1 + y} + \sqrt{y}}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t_2 + \left(\left(t_1 - \sqrt{z}\right) + \frac{1}{\sqrt{x} + \sqrt{1 + x}}\right)\\ \end{array} \]
Alternative 6
Error2.91%
Cost39880
\[\begin{array}{l} t_1 := \sqrt{1 + z}\\ t_2 := \sqrt{1 + x}\\ t_3 := \sqrt{1 + t} - \sqrt{t}\\ \mathbf{if}\;y \leq 5 \cdot 10^{-25}:\\ \;\;\;\;t_3 + \left(\frac{1}{t_1 + \sqrt{z}} + \left(1 + \left(t_2 - \sqrt{x}\right)\right)\right)\\ \mathbf{elif}\;y \leq 7.8 \cdot 10^{+59}:\\ \;\;\;\;t_2 + \left(\frac{1}{\sqrt{1 + y} + \sqrt{y}} + \left(t_3 - \sqrt{x}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t_3 + \left(\left(t_1 - \sqrt{z}\right) + \frac{1}{\sqrt{x} + t_2}\right)\\ \end{array} \]
Alternative 7
Error6.65%
Cost39876
\[\begin{array}{l} t_1 := \sqrt{1 + x}\\ t_2 := \sqrt{1 + t} - \sqrt{t}\\ \mathbf{if}\;y \leq 4.5 \cdot 10^{-25}:\\ \;\;\;\;t_2 + \left(\frac{1}{\sqrt{1 + z} + \sqrt{z}} + \left(1 + \left(t_1 - \sqrt{x}\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t_1 + \left(\frac{1}{\sqrt{1 + y} + \sqrt{y}} + \left(t_2 - \sqrt{x}\right)\right)\\ \end{array} \]
Alternative 8
Error10%
Cost39748
\[\begin{array}{l} t_1 := \sqrt{1 + x}\\ t_2 := \sqrt{1 + y} - \sqrt{y}\\ \mathbf{if}\;t \leq 1300000000:\\ \;\;\;\;t_1 + \left(t_2 + \left(\left(1 + \sqrt{1 + t}\right) - \left(\sqrt{x} + \sqrt{t}\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t_1 + \left(t_2 + \left(\sqrt{1 + z} - \left(\sqrt{x} + \sqrt{z}\right)\right)\right)\\ \end{array} \]
Alternative 9
Error7.6%
Cost39748
\[\begin{array}{l} t_1 := \sqrt{1 + x}\\ t_2 := \sqrt{1 + t} - \sqrt{t}\\ \mathbf{if}\;y \leq 5 \cdot 10^{-25}:\\ \;\;\;\;t_2 + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(1 + \left(t_1 - \sqrt{x}\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t_1 + \left(\frac{1}{\sqrt{1 + y} + \sqrt{y}} + \left(t_2 - \sqrt{x}\right)\right)\\ \end{array} \]
Alternative 10
Error13.99%
Cost39620
\[\begin{array}{l} t_1 := \sqrt{1 + y}\\ \mathbf{if}\;z \leq 2.25 \cdot 10^{+14}:\\ \;\;\;\;\left(1 + \left(t_1 + {\left(1 + z\right)}^{0.5}\right)\right) - \left(\sqrt{y} + \sqrt{z}\right)\\ \mathbf{else}:\\ \;\;\;\;\sqrt{1 + x} + \left(\left(t_1 - \sqrt{y}\right) + \left(\left(\sqrt{1 + t} - \sqrt{t}\right) - \sqrt{x}\right)\right)\\ \end{array} \]
Alternative 11
Error15.32%
Cost26628
\[\begin{array}{l} t_1 := \sqrt{1 + y}\\ \mathbf{if}\;z \leq 2.2 \cdot 10^{+14}:\\ \;\;\;\;\left(1 + \left(t_1 + {\left(1 + z\right)}^{0.5}\right)\right) - \left(\sqrt{y} + \sqrt{z}\right)\\ \mathbf{else}:\\ \;\;\;\;\sqrt{1 + x} + \left(t_1 - \left(\sqrt{x} + \sqrt{y}\right)\right)\\ \end{array} \]
Alternative 12
Error15.3%
Cost26564
\[\begin{array}{l} t_1 := \sqrt{1 + y}\\ \mathbf{if}\;z \leq 3.8 \cdot 10^{+14}:\\ \;\;\;\;1 + \left(\sqrt{1 + z} + \left(t_1 - \left(\sqrt{y} + \sqrt{z}\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\sqrt{1 + x} + \left(t_1 - \left(\sqrt{x} + \sqrt{y}\right)\right)\\ \end{array} \]
Alternative 13
Error15.97%
Cost26436
\[\begin{array}{l} \mathbf{if}\;y \leq 4 \cdot 10^{-25}:\\ \;\;\;\;\left(\sqrt{1 + z} - \sqrt{z}\right) + 2\\ \mathbf{else}:\\ \;\;\;\;\sqrt{1 + x} + \left(\sqrt{1 + y} - \left(\sqrt{x} + \sqrt{y}\right)\right)\\ \end{array} \]
Alternative 14
Error16.15%
Cost13512
\[\begin{array}{l} \mathbf{if}\;y \leq 3.5 \cdot 10^{-25}:\\ \;\;\;\;\left(\sqrt{1 + z} - \sqrt{z}\right) + 2\\ \mathbf{elif}\;y \leq 10^{+31}:\\ \;\;\;\;\sqrt{1 + y} + \left(1 - \sqrt{y}\right)\\ \mathbf{else}:\\ \;\;\;\;1\\ \end{array} \]
Alternative 15
Error19.53%
Cost13380
\[\begin{array}{l} t_1 := \sqrt{1 + z} - \sqrt{z}\\ \mathbf{if}\;y \leq 0.55:\\ \;\;\;\;t_1 + 2\\ \mathbf{else}:\\ \;\;\;\;1 + t_1\\ \end{array} \]
Alternative 16
Error64.74%
Cost13248
\[1 + \left(\sqrt{1 + z} - \sqrt{z}\right) \]
Alternative 17
Error65.48%
Cost64
\[1 \]

Error

Reproduce?

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