Main:z from

Percentage Accurate: 91.9% → 98.9%
Time: 36.6s
Alternatives: 21
Speedup: 1.3×

Specification

?
\[\begin{array}{l} \\ \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) \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))))
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));
}
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
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));
}
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))
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 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
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]
\begin{array}{l}

\\
\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)
\end{array}

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

The average percentage accuracy by input value. Horizontal axis shows value of an input variable; the variable is choosen in the title. Vertical axis is accuracy; higher is better. Red represent the original program, while blue represents Herbie's suggestion. These can be toggled with buttons below the plot. The line is an average while dots represent individual samples.

Accuracy vs Speed?

Herbie found 21 alternatives:

AlternativeAccuracySpeedup
The accuracy (vertical axis) and speed (horizontal axis) of each alternatives. Up and to the right is better. The red square shows the initial program, and each blue circle shows an alternative.The line shows the best available speed-accuracy tradeoffs.

Initial Program: 91.9% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \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) \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))))
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));
}
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
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));
}
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))
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 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
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]
\begin{array}{l}

\\
\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)
\end{array}

Alternative 1: 98.9% accurate, 0.5× speedup?

\[\begin{array}{l} [x, y, z, t] = \mathsf{sort}([x, y, z, t])\\ \\ \begin{array}{l} t_1 := \sqrt{1 + t} - \sqrt{t}\\ t_2 := \sqrt{x + 1}\\ t_3 := \sqrt{1 + z}\\ t_4 := t\_3 - \sqrt{z}\\ t_5 := \sqrt{1 + y}\\ t_6 := \left(t\_2 - \sqrt{x}\right) + \left(t\_5 - \sqrt{y}\right)\\ \mathbf{if}\;t\_6 \leq 0:\\ \;\;\;\;0.5 \cdot \left(\sqrt{\frac{1}{x}} + \sqrt{\frac{1}{y}}\right) + \left(t\_4 + 0.5 \cdot \sqrt{\frac{1}{t}}\right)\\ \mathbf{elif}\;t\_6 \leq 1.002:\\ \;\;\;\;\frac{\sqrt{y} \cdot 0.5 + y \cdot \frac{\left(x + 1\right) - x}{\sqrt{x} + t\_2}}{y} + \left(t\_4 + t\_1\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\frac{1}{t\_3 + \sqrt{z}} + t\_1\right) + \left(\left(1 + t\_5\right) - \left(\sqrt{x} + \sqrt{y}\right)\right)\\ \end{array} \end{array} \]
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (- (sqrt (+ 1.0 t)) (sqrt t)))
        (t_2 (sqrt (+ x 1.0)))
        (t_3 (sqrt (+ 1.0 z)))
        (t_4 (- t_3 (sqrt z)))
        (t_5 (sqrt (+ 1.0 y)))
        (t_6 (+ (- t_2 (sqrt x)) (- t_5 (sqrt y)))))
   (if (<= t_6 0.0)
     (+
      (* 0.5 (+ (sqrt (/ 1.0 x)) (sqrt (/ 1.0 y))))
      (+ t_4 (* 0.5 (sqrt (/ 1.0 t)))))
     (if (<= t_6 1.002)
       (+
        (/ (+ (* (sqrt y) 0.5) (* y (/ (- (+ x 1.0) x) (+ (sqrt x) t_2)))) y)
        (+ t_4 t_1))
       (+
        (+ (/ 1.0 (+ t_3 (sqrt z))) t_1)
        (- (+ 1.0 t_5) (+ (sqrt x) (sqrt y))))))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
	double t_1 = sqrt((1.0 + t)) - sqrt(t);
	double t_2 = sqrt((x + 1.0));
	double t_3 = sqrt((1.0 + z));
	double t_4 = t_3 - sqrt(z);
	double t_5 = sqrt((1.0 + y));
	double t_6 = (t_2 - sqrt(x)) + (t_5 - sqrt(y));
	double tmp;
	if (t_6 <= 0.0) {
		tmp = (0.5 * (sqrt((1.0 / x)) + sqrt((1.0 / y)))) + (t_4 + (0.5 * sqrt((1.0 / t))));
	} else if (t_6 <= 1.002) {
		tmp = (((sqrt(y) * 0.5) + (y * (((x + 1.0) - x) / (sqrt(x) + t_2)))) / y) + (t_4 + t_1);
	} else {
		tmp = ((1.0 / (t_3 + sqrt(z))) + t_1) + ((1.0 + t_5) - (sqrt(x) + sqrt(y)));
	}
	return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this 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) :: t_5
    real(8) :: t_6
    real(8) :: tmp
    t_1 = sqrt((1.0d0 + t)) - sqrt(t)
    t_2 = sqrt((x + 1.0d0))
    t_3 = sqrt((1.0d0 + z))
    t_4 = t_3 - sqrt(z)
    t_5 = sqrt((1.0d0 + y))
    t_6 = (t_2 - sqrt(x)) + (t_5 - sqrt(y))
    if (t_6 <= 0.0d0) then
        tmp = (0.5d0 * (sqrt((1.0d0 / x)) + sqrt((1.0d0 / y)))) + (t_4 + (0.5d0 * sqrt((1.0d0 / t))))
    else if (t_6 <= 1.002d0) then
        tmp = (((sqrt(y) * 0.5d0) + (y * (((x + 1.0d0) - x) / (sqrt(x) + t_2)))) / y) + (t_4 + t_1)
    else
        tmp = ((1.0d0 / (t_3 + sqrt(z))) + t_1) + ((1.0d0 + t_5) - (sqrt(x) + sqrt(y)))
    end if
    code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
	double t_1 = Math.sqrt((1.0 + t)) - Math.sqrt(t);
	double t_2 = Math.sqrt((x + 1.0));
	double t_3 = Math.sqrt((1.0 + z));
	double t_4 = t_3 - Math.sqrt(z);
	double t_5 = Math.sqrt((1.0 + y));
	double t_6 = (t_2 - Math.sqrt(x)) + (t_5 - Math.sqrt(y));
	double tmp;
	if (t_6 <= 0.0) {
		tmp = (0.5 * (Math.sqrt((1.0 / x)) + Math.sqrt((1.0 / y)))) + (t_4 + (0.5 * Math.sqrt((1.0 / t))));
	} else if (t_6 <= 1.002) {
		tmp = (((Math.sqrt(y) * 0.5) + (y * (((x + 1.0) - x) / (Math.sqrt(x) + t_2)))) / y) + (t_4 + t_1);
	} else {
		tmp = ((1.0 / (t_3 + Math.sqrt(z))) + t_1) + ((1.0 + t_5) - (Math.sqrt(x) + Math.sqrt(y)));
	}
	return tmp;
}
[x, y, z, t] = sort([x, y, z, t])
def code(x, y, z, t):
	t_1 = math.sqrt((1.0 + t)) - math.sqrt(t)
	t_2 = math.sqrt((x + 1.0))
	t_3 = math.sqrt((1.0 + z))
	t_4 = t_3 - math.sqrt(z)
	t_5 = math.sqrt((1.0 + y))
	t_6 = (t_2 - math.sqrt(x)) + (t_5 - math.sqrt(y))
	tmp = 0
	if t_6 <= 0.0:
		tmp = (0.5 * (math.sqrt((1.0 / x)) + math.sqrt((1.0 / y)))) + (t_4 + (0.5 * math.sqrt((1.0 / t))))
	elif t_6 <= 1.002:
		tmp = (((math.sqrt(y) * 0.5) + (y * (((x + 1.0) - x) / (math.sqrt(x) + t_2)))) / y) + (t_4 + t_1)
	else:
		tmp = ((1.0 / (t_3 + math.sqrt(z))) + t_1) + ((1.0 + t_5) - (math.sqrt(x) + math.sqrt(y)))
	return tmp
x, y, z, t = sort([x, y, z, t])
function code(x, y, z, t)
	t_1 = Float64(sqrt(Float64(1.0 + t)) - sqrt(t))
	t_2 = sqrt(Float64(x + 1.0))
	t_3 = sqrt(Float64(1.0 + z))
	t_4 = Float64(t_3 - sqrt(z))
	t_5 = sqrt(Float64(1.0 + y))
	t_6 = Float64(Float64(t_2 - sqrt(x)) + Float64(t_5 - sqrt(y)))
	tmp = 0.0
	if (t_6 <= 0.0)
		tmp = Float64(Float64(0.5 * Float64(sqrt(Float64(1.0 / x)) + sqrt(Float64(1.0 / y)))) + Float64(t_4 + Float64(0.5 * sqrt(Float64(1.0 / t)))));
	elseif (t_6 <= 1.002)
		tmp = Float64(Float64(Float64(Float64(sqrt(y) * 0.5) + Float64(y * Float64(Float64(Float64(x + 1.0) - x) / Float64(sqrt(x) + t_2)))) / y) + Float64(t_4 + t_1));
	else
		tmp = Float64(Float64(Float64(1.0 / Float64(t_3 + sqrt(z))) + t_1) + Float64(Float64(1.0 + t_5) - Float64(sqrt(x) + sqrt(y))));
	end
	return tmp
end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
	t_1 = sqrt((1.0 + t)) - sqrt(t);
	t_2 = sqrt((x + 1.0));
	t_3 = sqrt((1.0 + z));
	t_4 = t_3 - sqrt(z);
	t_5 = sqrt((1.0 + y));
	t_6 = (t_2 - sqrt(x)) + (t_5 - sqrt(y));
	tmp = 0.0;
	if (t_6 <= 0.0)
		tmp = (0.5 * (sqrt((1.0 / x)) + sqrt((1.0 / y)))) + (t_4 + (0.5 * sqrt((1.0 / t))));
	elseif (t_6 <= 1.002)
		tmp = (((sqrt(y) * 0.5) + (y * (((x + 1.0) - x) / (sqrt(x) + t_2)))) / y) + (t_4 + t_1);
	else
		tmp = ((1.0 / (t_3 + sqrt(z))) + t_1) + ((1.0 + t_5) - (sqrt(x) + sqrt(y)));
	end
	tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$4 = N[(t$95$3 - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$6 = N[(N[(t$95$2 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(t$95$5 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$6, 0.0], N[(N[(0.5 * N[(N[Sqrt[N[(1.0 / x), $MachinePrecision]], $MachinePrecision] + N[Sqrt[N[(1.0 / y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$4 + N[(0.5 * N[Sqrt[N[(1.0 / t), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$6, 1.002], N[(N[(N[(N[(N[Sqrt[y], $MachinePrecision] * 0.5), $MachinePrecision] + N[(y * N[(N[(N[(x + 1.0), $MachinePrecision] - x), $MachinePrecision] / N[(N[Sqrt[x], $MachinePrecision] + t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision] + N[(t$95$4 + t$95$1), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 / N[(t$95$3 + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision] + N[(N[(1.0 + t$95$5), $MachinePrecision] - N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + t} - \sqrt{t}\\
t_2 := \sqrt{x + 1}\\
t_3 := \sqrt{1 + z}\\
t_4 := t\_3 - \sqrt{z}\\
t_5 := \sqrt{1 + y}\\
t_6 := \left(t\_2 - \sqrt{x}\right) + \left(t\_5 - \sqrt{y}\right)\\
\mathbf{if}\;t\_6 \leq 0:\\
\;\;\;\;0.5 \cdot \left(\sqrt{\frac{1}{x}} + \sqrt{\frac{1}{y}}\right) + \left(t\_4 + 0.5 \cdot \sqrt{\frac{1}{t}}\right)\\

\mathbf{elif}\;t\_6 \leq 1.002:\\
\;\;\;\;\frac{\sqrt{y} \cdot 0.5 + y \cdot \frac{\left(x + 1\right) - x}{\sqrt{x} + t\_2}}{y} + \left(t\_4 + t\_1\right)\\

\mathbf{else}:\\
\;\;\;\;\left(\frac{1}{t\_3 + \sqrt{z}} + t\_1\right) + \left(\left(1 + t\_5\right) - \left(\sqrt{x} + \sqrt{y}\right)\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (+.f64 (-.f64 (sqrt.f64 (+.f64 x #s(literal 1 binary64))) (sqrt.f64 x)) (-.f64 (sqrt.f64 (+.f64 y #s(literal 1 binary64))) (sqrt.f64 y))) < 0.0

    1. Initial program 86.5%

      \[\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. Step-by-step derivation
      1. associate-+l+86.5%

        \[\leadsto \color{blue}{\left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{y + 1} - \sqrt{y}\right)\right) + \left(\left(\sqrt{z + 1} - \sqrt{z}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)\right)} \]
      2. associate-+l-86.5%

        \[\leadsto \color{blue}{\left(\sqrt{x + 1} - \left(\sqrt{x} - \left(\sqrt{y + 1} - \sqrt{y}\right)\right)\right)} + \left(\left(\sqrt{z + 1} - \sqrt{z}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)\right) \]
      3. associate-+l-86.5%

        \[\leadsto \color{blue}{\left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{y + 1} - \sqrt{y}\right)\right)} + \left(\left(\sqrt{z + 1} - \sqrt{z}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)\right) \]
      4. +-commutative86.5%

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

        \[\leadsto \left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{1 + y} - \sqrt{y}\right)\right) + \left(\left(\sqrt{\color{blue}{1 + z}} - \sqrt{z}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)\right) \]
      6. +-commutative86.5%

        \[\leadsto \left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{1 + y} - \sqrt{y}\right)\right) + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\sqrt{\color{blue}{1 + t}} - \sqrt{t}\right)\right) \]
    3. Simplified86.5%

      \[\leadsto \color{blue}{\left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{1 + y} - \sqrt{y}\right)\right) + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\sqrt{1 + t} - \sqrt{t}\right)\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in y around inf 86.5%

      \[\leadsto \color{blue}{\left(\left(\sqrt{1 + x} + 0.5 \cdot \sqrt{\frac{1}{y}}\right) - \sqrt{x}\right)} + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\sqrt{1 + t} - \sqrt{t}\right)\right) \]
    6. Taylor expanded in x around inf 91.1%

      \[\leadsto \color{blue}{\left(0.5 \cdot \sqrt{\frac{1}{x}} + 0.5 \cdot \sqrt{\frac{1}{y}}\right)} + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\sqrt{1 + t} - \sqrt{t}\right)\right) \]
    7. Step-by-step derivation
      1. distribute-lft-out91.1%

        \[\leadsto \color{blue}{0.5 \cdot \left(\sqrt{\frac{1}{x}} + \sqrt{\frac{1}{y}}\right)} + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\sqrt{1 + t} - \sqrt{t}\right)\right) \]
    8. Simplified91.1%

      \[\leadsto \color{blue}{0.5 \cdot \left(\sqrt{\frac{1}{x}} + \sqrt{\frac{1}{y}}\right)} + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\sqrt{1 + t} - \sqrt{t}\right)\right) \]
    9. Taylor expanded in t around inf 36.5%

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

    if 0.0 < (+.f64 (-.f64 (sqrt.f64 (+.f64 x #s(literal 1 binary64))) (sqrt.f64 x)) (-.f64 (sqrt.f64 (+.f64 y #s(literal 1 binary64))) (sqrt.f64 y))) < 1.002

    1. Initial program 96.0%

      \[\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. Step-by-step derivation
      1. associate-+l+96.0%

        \[\leadsto \color{blue}{\left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{y + 1} - \sqrt{y}\right)\right) + \left(\left(\sqrt{z + 1} - \sqrt{z}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)\right)} \]
      2. associate-+l-60.7%

        \[\leadsto \color{blue}{\left(\sqrt{x + 1} - \left(\sqrt{x} - \left(\sqrt{y + 1} - \sqrt{y}\right)\right)\right)} + \left(\left(\sqrt{z + 1} - \sqrt{z}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)\right) \]
      3. associate-+l-96.0%

        \[\leadsto \color{blue}{\left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{y + 1} - \sqrt{y}\right)\right)} + \left(\left(\sqrt{z + 1} - \sqrt{z}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)\right) \]
      4. +-commutative96.0%

        \[\leadsto \left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{\color{blue}{1 + y}} - \sqrt{y}\right)\right) + \left(\left(\sqrt{z + 1} - \sqrt{z}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)\right) \]
      5. +-commutative96.0%

        \[\leadsto \left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{1 + y} - \sqrt{y}\right)\right) + \left(\left(\sqrt{\color{blue}{1 + z}} - \sqrt{z}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)\right) \]
      6. +-commutative96.0%

        \[\leadsto \left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{1 + y} - \sqrt{y}\right)\right) + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\sqrt{\color{blue}{1 + t}} - \sqrt{t}\right)\right) \]
    3. Simplified96.0%

      \[\leadsto \color{blue}{\left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{1 + y} - \sqrt{y}\right)\right) + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\sqrt{1 + t} - \sqrt{t}\right)\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in y around inf 57.9%

      \[\leadsto \color{blue}{\left(\left(\sqrt{1 + x} + 0.5 \cdot \sqrt{\frac{1}{y}}\right) - \sqrt{x}\right)} + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\sqrt{1 + t} - \sqrt{t}\right)\right) \]
    6. Taylor expanded in y around 0 57.1%

      \[\leadsto \color{blue}{\frac{0.5 \cdot \sqrt{y} + y \cdot \left(\sqrt{1 + x} - \sqrt{x}\right)}{y}} + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\sqrt{1 + t} - \sqrt{t}\right)\right) \]
    7. Step-by-step derivation
      1. +-commutative57.1%

        \[\leadsto \frac{0.5 \cdot \sqrt{y} + y \cdot \left(\sqrt{\color{blue}{x + 1}} - \sqrt{x}\right)}{y} + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\sqrt{1 + t} - \sqrt{t}\right)\right) \]
      2. flip--57.0%

        \[\leadsto \frac{0.5 \cdot \sqrt{y} + y \cdot \color{blue}{\frac{\sqrt{x + 1} \cdot \sqrt{x + 1} - \sqrt{x} \cdot \sqrt{x}}{\sqrt{x + 1} + \sqrt{x}}}}{y} + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\sqrt{1 + t} - \sqrt{t}\right)\right) \]
      3. add-sqr-sqrt56.3%

        \[\leadsto \frac{0.5 \cdot \sqrt{y} + y \cdot \frac{\color{blue}{\left(x + 1\right)} - \sqrt{x} \cdot \sqrt{x}}{\sqrt{x + 1} + \sqrt{x}}}{y} + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\sqrt{1 + t} - \sqrt{t}\right)\right) \]
      4. add-sqr-sqrt57.5%

        \[\leadsto \frac{0.5 \cdot \sqrt{y} + y \cdot \frac{\left(x + 1\right) - \color{blue}{x}}{\sqrt{x + 1} + \sqrt{x}}}{y} + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\sqrt{1 + t} - \sqrt{t}\right)\right) \]
    8. Applied egg-rr57.5%

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

    if 1.002 < (+.f64 (-.f64 (sqrt.f64 (+.f64 x #s(literal 1 binary64))) (sqrt.f64 x)) (-.f64 (sqrt.f64 (+.f64 y #s(literal 1 binary64))) (sqrt.f64 y)))

    1. Initial program 97.1%

      \[\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. Step-by-step derivation
      1. associate-+l+97.1%

        \[\leadsto \color{blue}{\left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{y + 1} - \sqrt{y}\right)\right) + \left(\left(\sqrt{z + 1} - \sqrt{z}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)\right)} \]
      2. associate-+l-97.1%

        \[\leadsto \color{blue}{\left(\sqrt{x + 1} - \left(\sqrt{x} - \left(\sqrt{y + 1} - \sqrt{y}\right)\right)\right)} + \left(\left(\sqrt{z + 1} - \sqrt{z}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)\right) \]
      3. associate-+l-97.1%

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

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

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

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

      \[\leadsto \color{blue}{\left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{1 + y} - \sqrt{y}\right)\right) + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\sqrt{1 + t} - \sqrt{t}\right)\right)} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. flip--97.2%

        \[\leadsto \left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{1 + y} - \sqrt{y}\right)\right) + \left(\color{blue}{\frac{\sqrt{1 + z} \cdot \sqrt{1 + z} - \sqrt{z} \cdot \sqrt{z}}{\sqrt{1 + z} + \sqrt{z}}} + \left(\sqrt{1 + t} - \sqrt{t}\right)\right) \]
      2. add-sqr-sqrt75.5%

        \[\leadsto \left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{1 + y} - \sqrt{y}\right)\right) + \left(\frac{\color{blue}{\left(1 + z\right)} - \sqrt{z} \cdot \sqrt{z}}{\sqrt{1 + z} + \sqrt{z}} + \left(\sqrt{1 + t} - \sqrt{t}\right)\right) \]
      3. add-sqr-sqrt97.2%

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

      \[\leadsto \left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{1 + y} - \sqrt{y}\right)\right) + \left(\color{blue}{\frac{\left(1 + z\right) - z}{\sqrt{1 + z} + \sqrt{z}}} + \left(\sqrt{1 + t} - \sqrt{t}\right)\right) \]
    7. Step-by-step derivation
      1. associate--l+97.8%

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

        \[\leadsto \left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{1 + y} - \sqrt{y}\right)\right) + \left(\frac{1 + \color{blue}{0}}{\sqrt{1 + z} + \sqrt{z}} + \left(\sqrt{1 + t} - \sqrt{t}\right)\right) \]
      3. metadata-eval97.8%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{1 + y} - \sqrt{y}\right) \leq 0:\\ \;\;\;\;0.5 \cdot \left(\sqrt{\frac{1}{x}} + \sqrt{\frac{1}{y}}\right) + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + 0.5 \cdot \sqrt{\frac{1}{t}}\right)\\ \mathbf{elif}\;\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{1 + y} - \sqrt{y}\right) \leq 1.002:\\ \;\;\;\;\frac{\sqrt{y} \cdot 0.5 + y \cdot \frac{\left(x + 1\right) - x}{\sqrt{x} + \sqrt{x + 1}}}{y} + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\sqrt{1 + t} - \sqrt{t}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\frac{1}{\sqrt{1 + z} + \sqrt{z}} + \left(\sqrt{1 + t} - \sqrt{t}\right)\right) + \left(\left(1 + \sqrt{1 + y}\right) - \left(\sqrt{x} + \sqrt{y}\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 2: 98.4% accurate, 0.5× speedup?

\[\begin{array}{l} [x, y, z, t] = \mathsf{sort}([x, y, z, t])\\ \\ \begin{array}{l} t_1 := \sqrt{x + 1} - \sqrt{x}\\ t_2 := \sqrt{1 + t} + \sqrt{t}\\ t_3 := \sqrt{1 + y} - \sqrt{y}\\ t_4 := \sqrt{1 + z}\\ t_5 := t\_4 + \sqrt{z}\\ \mathbf{if}\;t\_1 + t\_3 \leq 5 \cdot 10^{-5}:\\ \;\;\;\;0.5 \cdot \left(\sqrt{\frac{1}{x}} + \sqrt{\frac{1}{y}}\right) + \left(\left(t\_4 - \sqrt{z}\right) + 0.5 \cdot \sqrt{\frac{1}{t}}\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1 + \left(t\_3 + \frac{t\_2 + t\_5}{t\_2 \cdot t\_5}\right)\\ \end{array} \end{array} \]
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (- (sqrt (+ x 1.0)) (sqrt x)))
        (t_2 (+ (sqrt (+ 1.0 t)) (sqrt t)))
        (t_3 (- (sqrt (+ 1.0 y)) (sqrt y)))
        (t_4 (sqrt (+ 1.0 z)))
        (t_5 (+ t_4 (sqrt z))))
   (if (<= (+ t_1 t_3) 5e-5)
     (+
      (* 0.5 (+ (sqrt (/ 1.0 x)) (sqrt (/ 1.0 y))))
      (+ (- t_4 (sqrt z)) (* 0.5 (sqrt (/ 1.0 t)))))
     (+ t_1 (+ t_3 (/ (+ t_2 t_5) (* t_2 t_5)))))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
	double t_1 = sqrt((x + 1.0)) - sqrt(x);
	double t_2 = sqrt((1.0 + t)) + sqrt(t);
	double t_3 = sqrt((1.0 + y)) - sqrt(y);
	double t_4 = sqrt((1.0 + z));
	double t_5 = t_4 + sqrt(z);
	double tmp;
	if ((t_1 + t_3) <= 5e-5) {
		tmp = (0.5 * (sqrt((1.0 / x)) + sqrt((1.0 / y)))) + ((t_4 - sqrt(z)) + (0.5 * sqrt((1.0 / t))));
	} else {
		tmp = t_1 + (t_3 + ((t_2 + t_5) / (t_2 * t_5)));
	}
	return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this 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) :: t_5
    real(8) :: tmp
    t_1 = sqrt((x + 1.0d0)) - sqrt(x)
    t_2 = sqrt((1.0d0 + t)) + sqrt(t)
    t_3 = sqrt((1.0d0 + y)) - sqrt(y)
    t_4 = sqrt((1.0d0 + z))
    t_5 = t_4 + sqrt(z)
    if ((t_1 + t_3) <= 5d-5) then
        tmp = (0.5d0 * (sqrt((1.0d0 / x)) + sqrt((1.0d0 / y)))) + ((t_4 - sqrt(z)) + (0.5d0 * sqrt((1.0d0 / t))))
    else
        tmp = t_1 + (t_3 + ((t_2 + t_5) / (t_2 * t_5)))
    end if
    code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
	double t_1 = Math.sqrt((x + 1.0)) - Math.sqrt(x);
	double t_2 = Math.sqrt((1.0 + t)) + Math.sqrt(t);
	double t_3 = Math.sqrt((1.0 + y)) - Math.sqrt(y);
	double t_4 = Math.sqrt((1.0 + z));
	double t_5 = t_4 + Math.sqrt(z);
	double tmp;
	if ((t_1 + t_3) <= 5e-5) {
		tmp = (0.5 * (Math.sqrt((1.0 / x)) + Math.sqrt((1.0 / y)))) + ((t_4 - Math.sqrt(z)) + (0.5 * Math.sqrt((1.0 / t))));
	} else {
		tmp = t_1 + (t_3 + ((t_2 + t_5) / (t_2 * t_5)));
	}
	return tmp;
}
[x, y, z, t] = sort([x, y, z, t])
def code(x, y, z, t):
	t_1 = math.sqrt((x + 1.0)) - math.sqrt(x)
	t_2 = math.sqrt((1.0 + t)) + math.sqrt(t)
	t_3 = math.sqrt((1.0 + y)) - math.sqrt(y)
	t_4 = math.sqrt((1.0 + z))
	t_5 = t_4 + math.sqrt(z)
	tmp = 0
	if (t_1 + t_3) <= 5e-5:
		tmp = (0.5 * (math.sqrt((1.0 / x)) + math.sqrt((1.0 / y)))) + ((t_4 - math.sqrt(z)) + (0.5 * math.sqrt((1.0 / t))))
	else:
		tmp = t_1 + (t_3 + ((t_2 + t_5) / (t_2 * t_5)))
	return tmp
x, y, z, t = sort([x, y, z, t])
function code(x, y, z, t)
	t_1 = Float64(sqrt(Float64(x + 1.0)) - sqrt(x))
	t_2 = Float64(sqrt(Float64(1.0 + t)) + sqrt(t))
	t_3 = Float64(sqrt(Float64(1.0 + y)) - sqrt(y))
	t_4 = sqrt(Float64(1.0 + z))
	t_5 = Float64(t_4 + sqrt(z))
	tmp = 0.0
	if (Float64(t_1 + t_3) <= 5e-5)
		tmp = Float64(Float64(0.5 * Float64(sqrt(Float64(1.0 / x)) + sqrt(Float64(1.0 / y)))) + Float64(Float64(t_4 - sqrt(z)) + Float64(0.5 * sqrt(Float64(1.0 / t)))));
	else
		tmp = Float64(t_1 + Float64(t_3 + Float64(Float64(t_2 + t_5) / Float64(t_2 * t_5))));
	end
	return tmp
end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
	t_1 = sqrt((x + 1.0)) - sqrt(x);
	t_2 = sqrt((1.0 + t)) + sqrt(t);
	t_3 = sqrt((1.0 + y)) - sqrt(y);
	t_4 = sqrt((1.0 + z));
	t_5 = t_4 + sqrt(z);
	tmp = 0.0;
	if ((t_1 + t_3) <= 5e-5)
		tmp = (0.5 * (sqrt((1.0 / x)) + sqrt((1.0 / y)))) + ((t_4 - sqrt(z)) + (0.5 * sqrt((1.0 / t))));
	else
		tmp = t_1 + (t_3 + ((t_2 + t_5) / (t_2 * t_5)));
	end
	tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] + N[Sqrt[t], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$5 = N[(t$95$4 + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(t$95$1 + t$95$3), $MachinePrecision], 5e-5], N[(N[(0.5 * N[(N[Sqrt[N[(1.0 / x), $MachinePrecision]], $MachinePrecision] + N[Sqrt[N[(1.0 / y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$4 - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] + N[(0.5 * N[Sqrt[N[(1.0 / t), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 + N[(t$95$3 + N[(N[(t$95$2 + t$95$5), $MachinePrecision] / N[(t$95$2 * t$95$5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{x + 1} - \sqrt{x}\\
t_2 := \sqrt{1 + t} + \sqrt{t}\\
t_3 := \sqrt{1 + y} - \sqrt{y}\\
t_4 := \sqrt{1 + z}\\
t_5 := t\_4 + \sqrt{z}\\
\mathbf{if}\;t\_1 + t\_3 \leq 5 \cdot 10^{-5}:\\
\;\;\;\;0.5 \cdot \left(\sqrt{\frac{1}{x}} + \sqrt{\frac{1}{y}}\right) + \left(\left(t\_4 - \sqrt{z}\right) + 0.5 \cdot \sqrt{\frac{1}{t}}\right)\\

\mathbf{else}:\\
\;\;\;\;t\_1 + \left(t\_3 + \frac{t\_2 + t\_5}{t\_2 \cdot t\_5}\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (+.f64 (-.f64 (sqrt.f64 (+.f64 x #s(literal 1 binary64))) (sqrt.f64 x)) (-.f64 (sqrt.f64 (+.f64 y #s(literal 1 binary64))) (sqrt.f64 y))) < 5.00000000000000024e-5

    1. Initial program 85.9%

      \[\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. Step-by-step derivation
      1. associate-+l+85.9%

        \[\leadsto \color{blue}{\left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{y + 1} - \sqrt{y}\right)\right) + \left(\left(\sqrt{z + 1} - \sqrt{z}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)\right)} \]
      2. associate-+l-85.0%

        \[\leadsto \color{blue}{\left(\sqrt{x + 1} - \left(\sqrt{x} - \left(\sqrt{y + 1} - \sqrt{y}\right)\right)\right)} + \left(\left(\sqrt{z + 1} - \sqrt{z}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)\right) \]
      3. associate-+l-85.9%

        \[\leadsto \color{blue}{\left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{y + 1} - \sqrt{y}\right)\right)} + \left(\left(\sqrt{z + 1} - \sqrt{z}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)\right) \]
      4. +-commutative85.9%

        \[\leadsto \left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{\color{blue}{1 + y}} - \sqrt{y}\right)\right) + \left(\left(\sqrt{z + 1} - \sqrt{z}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)\right) \]
      5. +-commutative85.9%

        \[\leadsto \left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{1 + y} - \sqrt{y}\right)\right) + \left(\left(\sqrt{\color{blue}{1 + z}} - \sqrt{z}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)\right) \]
      6. +-commutative85.9%

        \[\leadsto \left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{1 + y} - \sqrt{y}\right)\right) + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\sqrt{\color{blue}{1 + t}} - \sqrt{t}\right)\right) \]
    3. Simplified85.9%

      \[\leadsto \color{blue}{\left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{1 + y} - \sqrt{y}\right)\right) + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\sqrt{1 + t} - \sqrt{t}\right)\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in y around inf 85.0%

      \[\leadsto \color{blue}{\left(\left(\sqrt{1 + x} + 0.5 \cdot \sqrt{\frac{1}{y}}\right) - \sqrt{x}\right)} + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\sqrt{1 + t} - \sqrt{t}\right)\right) \]
    6. Taylor expanded in x around inf 90.8%

      \[\leadsto \color{blue}{\left(0.5 \cdot \sqrt{\frac{1}{x}} + 0.5 \cdot \sqrt{\frac{1}{y}}\right)} + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\sqrt{1 + t} - \sqrt{t}\right)\right) \]
    7. Step-by-step derivation
      1. distribute-lft-out90.8%

        \[\leadsto \color{blue}{0.5 \cdot \left(\sqrt{\frac{1}{x}} + \sqrt{\frac{1}{y}}\right)} + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\sqrt{1 + t} - \sqrt{t}\right)\right) \]
    8. Simplified90.8%

      \[\leadsto \color{blue}{0.5 \cdot \left(\sqrt{\frac{1}{x}} + \sqrt{\frac{1}{y}}\right)} + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\sqrt{1 + t} - \sqrt{t}\right)\right) \]
    9. Taylor expanded in t around inf 36.5%

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

    if 5.00000000000000024e-5 < (+.f64 (-.f64 (sqrt.f64 (+.f64 x #s(literal 1 binary64))) (sqrt.f64 x)) (-.f64 (sqrt.f64 (+.f64 y #s(literal 1 binary64))) (sqrt.f64 y)))

    1. Initial program 96.7%

      \[\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. Step-by-step derivation
      1. associate-+l+96.7%

        \[\leadsto \color{blue}{\left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{y + 1} - \sqrt{y}\right)\right) + \left(\left(\sqrt{z + 1} - \sqrt{z}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)\right)} \]
      2. associate-+l+96.7%

        \[\leadsto \color{blue}{\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\left(\sqrt{y + 1} - \sqrt{y}\right) + \left(\left(\sqrt{z + 1} - \sqrt{z}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)\right)\right)} \]
      3. +-commutative96.7%

        \[\leadsto \left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\left(\sqrt{\color{blue}{1 + y}} - \sqrt{y}\right) + \left(\left(\sqrt{z + 1} - \sqrt{z}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)\right)\right) \]
      4. +-commutative96.7%

        \[\leadsto \left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\left(\sqrt{1 + y} - \sqrt{y}\right) + \color{blue}{\left(\left(\sqrt{t + 1} - \sqrt{t}\right) + \left(\sqrt{z + 1} - \sqrt{z}\right)\right)}\right) \]
      5. associate-+l-78.2%

        \[\leadsto \left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\left(\sqrt{1 + y} - \sqrt{y}\right) + \color{blue}{\left(\sqrt{t + 1} - \left(\sqrt{t} - \left(\sqrt{z + 1} - \sqrt{z}\right)\right)\right)}\right) \]
      6. +-commutative78.2%

        \[\leadsto \left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\left(\sqrt{1 + y} - \sqrt{y}\right) + \left(\sqrt{\color{blue}{1 + t}} - \left(\sqrt{t} - \left(\sqrt{z + 1} - \sqrt{z}\right)\right)\right)\right) \]
      7. +-commutative78.2%

        \[\leadsto \left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\left(\sqrt{1 + y} - \sqrt{y}\right) + \left(\sqrt{1 + t} - \left(\sqrt{t} - \left(\sqrt{\color{blue}{1 + z}} - \sqrt{z}\right)\right)\right)\right) \]
    3. Simplified78.2%

      \[\leadsto \color{blue}{\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\left(\sqrt{1 + y} - \sqrt{y}\right) + \left(\sqrt{1 + t} - \left(\sqrt{t} - \left(\sqrt{1 + z} - \sqrt{z}\right)\right)\right)\right)} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. associate--r-96.7%

        \[\leadsto \left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\left(\sqrt{1 + y} - \sqrt{y}\right) + \color{blue}{\left(\left(\sqrt{1 + t} - \sqrt{t}\right) + \left(\sqrt{1 + z} - \sqrt{z}\right)\right)}\right) \]
      2. +-commutative96.7%

        \[\leadsto \left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\left(\sqrt{1 + y} - \sqrt{y}\right) + \color{blue}{\left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\sqrt{1 + t} - \sqrt{t}\right)\right)}\right) \]
      3. flip--96.7%

        \[\leadsto \left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\left(\sqrt{1 + y} - \sqrt{y}\right) + \left(\color{blue}{\frac{\sqrt{1 + z} \cdot \sqrt{1 + z} - \sqrt{z} \cdot \sqrt{z}}{\sqrt{1 + z} + \sqrt{z}}} + \left(\sqrt{1 + t} - \sqrt{t}\right)\right)\right) \]
      4. flip--96.9%

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

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

      \[\leadsto \left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\left(\sqrt{1 + y} - \sqrt{y}\right) + \color{blue}{\frac{\left(\left(1 + z\right) - z\right) \cdot \left(\sqrt{1 + t} + \sqrt{t}\right) + \left(\sqrt{1 + z} + \sqrt{z}\right) \cdot \left(\left(1 + t\right) - t\right)}{\left(\sqrt{1 + z} + \sqrt{z}\right) \cdot \left(\sqrt{1 + t} + \sqrt{t}\right)}}\right) \]
    7. Step-by-step derivation
      1. Simplified98.4%

        \[\leadsto \left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\left(\sqrt{1 + y} - \sqrt{y}\right) + \color{blue}{\frac{\left(\sqrt{1 + t} + \sqrt{t}\right) + \left(\sqrt{1 + z} + \sqrt{z}\right)}{\left(\sqrt{1 + t} + \sqrt{t}\right) \cdot \left(\sqrt{1 + z} + \sqrt{z}\right)}}\right) \]
    8. Recombined 2 regimes into one program.
    9. Final simplification82.6%

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

    Alternative 3: 97.9% accurate, 0.7× speedup?

    \[\begin{array}{l} [x, y, z, t] = \mathsf{sort}([x, y, z, t])\\ \\ \begin{array}{l} t_1 := \left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{1 + y} - \sqrt{y}\right)\\ t_2 := \sqrt{1 + z}\\ \mathbf{if}\;t\_1 \leq 5 \cdot 10^{-5}:\\ \;\;\;\;0.5 \cdot \left(\sqrt{\frac{1}{x}} + \sqrt{\frac{1}{y}}\right) + \left(\left(t\_2 - \sqrt{z}\right) + 0.5 \cdot \sqrt{\frac{1}{t}}\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1 + \left(\frac{1}{t\_2 + \sqrt{z}} + \left(\sqrt{1 + t} - \sqrt{t}\right)\right)\\ \end{array} \end{array} \]
    NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
    (FPCore (x y z t)
     :precision binary64
     (let* ((t_1 (+ (- (sqrt (+ x 1.0)) (sqrt x)) (- (sqrt (+ 1.0 y)) (sqrt y))))
            (t_2 (sqrt (+ 1.0 z))))
       (if (<= t_1 5e-5)
         (+
          (* 0.5 (+ (sqrt (/ 1.0 x)) (sqrt (/ 1.0 y))))
          (+ (- t_2 (sqrt z)) (* 0.5 (sqrt (/ 1.0 t)))))
         (+ t_1 (+ (/ 1.0 (+ t_2 (sqrt z))) (- (sqrt (+ 1.0 t)) (sqrt t)))))))
    assert(x < y && y < z && z < t);
    double code(double x, double y, double z, double t) {
    	double t_1 = (sqrt((x + 1.0)) - sqrt(x)) + (sqrt((1.0 + y)) - sqrt(y));
    	double t_2 = sqrt((1.0 + z));
    	double tmp;
    	if (t_1 <= 5e-5) {
    		tmp = (0.5 * (sqrt((1.0 / x)) + sqrt((1.0 / y)))) + ((t_2 - sqrt(z)) + (0.5 * sqrt((1.0 / t))));
    	} else {
    		tmp = t_1 + ((1.0 / (t_2 + sqrt(z))) + (sqrt((1.0 + t)) - sqrt(t)));
    	}
    	return tmp;
    }
    
    NOTE: x, y, z, and t should be sorted in increasing order before calling this 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) :: tmp
        t_1 = (sqrt((x + 1.0d0)) - sqrt(x)) + (sqrt((1.0d0 + y)) - sqrt(y))
        t_2 = sqrt((1.0d0 + z))
        if (t_1 <= 5d-5) then
            tmp = (0.5d0 * (sqrt((1.0d0 / x)) + sqrt((1.0d0 / y)))) + ((t_2 - sqrt(z)) + (0.5d0 * sqrt((1.0d0 / t))))
        else
            tmp = t_1 + ((1.0d0 / (t_2 + sqrt(z))) + (sqrt((1.0d0 + t)) - sqrt(t)))
        end if
        code = tmp
    end function
    
    assert x < y && y < z && z < t;
    public static double code(double x, double y, double z, double t) {
    	double t_1 = (Math.sqrt((x + 1.0)) - Math.sqrt(x)) + (Math.sqrt((1.0 + y)) - Math.sqrt(y));
    	double t_2 = Math.sqrt((1.0 + z));
    	double tmp;
    	if (t_1 <= 5e-5) {
    		tmp = (0.5 * (Math.sqrt((1.0 / x)) + Math.sqrt((1.0 / y)))) + ((t_2 - Math.sqrt(z)) + (0.5 * Math.sqrt((1.0 / t))));
    	} else {
    		tmp = t_1 + ((1.0 / (t_2 + Math.sqrt(z))) + (Math.sqrt((1.0 + t)) - Math.sqrt(t)));
    	}
    	return tmp;
    }
    
    [x, y, z, t] = sort([x, y, z, t])
    def code(x, y, z, t):
    	t_1 = (math.sqrt((x + 1.0)) - math.sqrt(x)) + (math.sqrt((1.0 + y)) - math.sqrt(y))
    	t_2 = math.sqrt((1.0 + z))
    	tmp = 0
    	if t_1 <= 5e-5:
    		tmp = (0.5 * (math.sqrt((1.0 / x)) + math.sqrt((1.0 / y)))) + ((t_2 - math.sqrt(z)) + (0.5 * math.sqrt((1.0 / t))))
    	else:
    		tmp = t_1 + ((1.0 / (t_2 + math.sqrt(z))) + (math.sqrt((1.0 + t)) - math.sqrt(t)))
    	return tmp
    
    x, y, z, t = sort([x, y, z, t])
    function code(x, y, z, t)
    	t_1 = Float64(Float64(sqrt(Float64(x + 1.0)) - sqrt(x)) + Float64(sqrt(Float64(1.0 + y)) - sqrt(y)))
    	t_2 = sqrt(Float64(1.0 + z))
    	tmp = 0.0
    	if (t_1 <= 5e-5)
    		tmp = Float64(Float64(0.5 * Float64(sqrt(Float64(1.0 / x)) + sqrt(Float64(1.0 / y)))) + Float64(Float64(t_2 - sqrt(z)) + Float64(0.5 * sqrt(Float64(1.0 / t)))));
    	else
    		tmp = Float64(t_1 + Float64(Float64(1.0 / Float64(t_2 + sqrt(z))) + Float64(sqrt(Float64(1.0 + t)) - sqrt(t))));
    	end
    	return tmp
    end
    
    x, y, z, t = num2cell(sort([x, y, z, t])){:}
    function tmp_2 = code(x, y, z, t)
    	t_1 = (sqrt((x + 1.0)) - sqrt(x)) + (sqrt((1.0 + y)) - sqrt(y));
    	t_2 = sqrt((1.0 + z));
    	tmp = 0.0;
    	if (t_1 <= 5e-5)
    		tmp = (0.5 * (sqrt((1.0 / x)) + sqrt((1.0 / y)))) + ((t_2 - sqrt(z)) + (0.5 * sqrt((1.0 / t))));
    	else
    		tmp = t_1 + ((1.0 / (t_2 + sqrt(z))) + (sqrt((1.0 + t)) - sqrt(t)));
    	end
    	tmp_2 = tmp;
    end
    
    NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
    code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t$95$1, 5e-5], N[(N[(0.5 * N[(N[Sqrt[N[(1.0 / x), $MachinePrecision]], $MachinePrecision] + N[Sqrt[N[(1.0 / y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$2 - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] + N[(0.5 * N[Sqrt[N[(1.0 / t), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 + N[(N[(1.0 / N[(t$95$2 + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
    
    \begin{array}{l}
    [x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
    \\
    \begin{array}{l}
    t_1 := \left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{1 + y} - \sqrt{y}\right)\\
    t_2 := \sqrt{1 + z}\\
    \mathbf{if}\;t\_1 \leq 5 \cdot 10^{-5}:\\
    \;\;\;\;0.5 \cdot \left(\sqrt{\frac{1}{x}} + \sqrt{\frac{1}{y}}\right) + \left(\left(t\_2 - \sqrt{z}\right) + 0.5 \cdot \sqrt{\frac{1}{t}}\right)\\
    
    \mathbf{else}:\\
    \;\;\;\;t\_1 + \left(\frac{1}{t\_2 + \sqrt{z}} + \left(\sqrt{1 + t} - \sqrt{t}\right)\right)\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if (+.f64 (-.f64 (sqrt.f64 (+.f64 x #s(literal 1 binary64))) (sqrt.f64 x)) (-.f64 (sqrt.f64 (+.f64 y #s(literal 1 binary64))) (sqrt.f64 y))) < 5.00000000000000024e-5

      1. Initial program 85.9%

        \[\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. Step-by-step derivation
        1. associate-+l+85.9%

          \[\leadsto \color{blue}{\left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{y + 1} - \sqrt{y}\right)\right) + \left(\left(\sqrt{z + 1} - \sqrt{z}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)\right)} \]
        2. associate-+l-85.0%

          \[\leadsto \color{blue}{\left(\sqrt{x + 1} - \left(\sqrt{x} - \left(\sqrt{y + 1} - \sqrt{y}\right)\right)\right)} + \left(\left(\sqrt{z + 1} - \sqrt{z}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)\right) \]
        3. associate-+l-85.9%

          \[\leadsto \color{blue}{\left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{y + 1} - \sqrt{y}\right)\right)} + \left(\left(\sqrt{z + 1} - \sqrt{z}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)\right) \]
        4. +-commutative85.9%

          \[\leadsto \left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{\color{blue}{1 + y}} - \sqrt{y}\right)\right) + \left(\left(\sqrt{z + 1} - \sqrt{z}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)\right) \]
        5. +-commutative85.9%

          \[\leadsto \left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{1 + y} - \sqrt{y}\right)\right) + \left(\left(\sqrt{\color{blue}{1 + z}} - \sqrt{z}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)\right) \]
        6. +-commutative85.9%

          \[\leadsto \left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{1 + y} - \sqrt{y}\right)\right) + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\sqrt{\color{blue}{1 + t}} - \sqrt{t}\right)\right) \]
      3. Simplified85.9%

        \[\leadsto \color{blue}{\left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{1 + y} - \sqrt{y}\right)\right) + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\sqrt{1 + t} - \sqrt{t}\right)\right)} \]
      4. Add Preprocessing
      5. Taylor expanded in y around inf 85.0%

        \[\leadsto \color{blue}{\left(\left(\sqrt{1 + x} + 0.5 \cdot \sqrt{\frac{1}{y}}\right) - \sqrt{x}\right)} + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\sqrt{1 + t} - \sqrt{t}\right)\right) \]
      6. Taylor expanded in x around inf 90.8%

        \[\leadsto \color{blue}{\left(0.5 \cdot \sqrt{\frac{1}{x}} + 0.5 \cdot \sqrt{\frac{1}{y}}\right)} + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\sqrt{1 + t} - \sqrt{t}\right)\right) \]
      7. Step-by-step derivation
        1. distribute-lft-out90.8%

          \[\leadsto \color{blue}{0.5 \cdot \left(\sqrt{\frac{1}{x}} + \sqrt{\frac{1}{y}}\right)} + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\sqrt{1 + t} - \sqrt{t}\right)\right) \]
      8. Simplified90.8%

        \[\leadsto \color{blue}{0.5 \cdot \left(\sqrt{\frac{1}{x}} + \sqrt{\frac{1}{y}}\right)} + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\sqrt{1 + t} - \sqrt{t}\right)\right) \]
      9. Taylor expanded in t around inf 36.5%

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

      if 5.00000000000000024e-5 < (+.f64 (-.f64 (sqrt.f64 (+.f64 x #s(literal 1 binary64))) (sqrt.f64 x)) (-.f64 (sqrt.f64 (+.f64 y #s(literal 1 binary64))) (sqrt.f64 y)))

      1. Initial program 96.7%

        \[\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. Step-by-step derivation
        1. associate-+l+96.7%

          \[\leadsto \color{blue}{\left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{y + 1} - \sqrt{y}\right)\right) + \left(\left(\sqrt{z + 1} - \sqrt{z}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)\right)} \]
        2. associate-+l-74.3%

          \[\leadsto \color{blue}{\left(\sqrt{x + 1} - \left(\sqrt{x} - \left(\sqrt{y + 1} - \sqrt{y}\right)\right)\right)} + \left(\left(\sqrt{z + 1} - \sqrt{z}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)\right) \]
        3. associate-+l-96.7%

          \[\leadsto \color{blue}{\left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{y + 1} - \sqrt{y}\right)\right)} + \left(\left(\sqrt{z + 1} - \sqrt{z}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)\right) \]
        4. +-commutative96.7%

          \[\leadsto \left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{\color{blue}{1 + y}} - \sqrt{y}\right)\right) + \left(\left(\sqrt{z + 1} - \sqrt{z}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)\right) \]
        5. +-commutative96.7%

          \[\leadsto \left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{1 + y} - \sqrt{y}\right)\right) + \left(\left(\sqrt{\color{blue}{1 + z}} - \sqrt{z}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)\right) \]
        6. +-commutative96.7%

          \[\leadsto \left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{1 + y} - \sqrt{y}\right)\right) + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\sqrt{\color{blue}{1 + t}} - \sqrt{t}\right)\right) \]
      3. Simplified96.7%

        \[\leadsto \color{blue}{\left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{1 + y} - \sqrt{y}\right)\right) + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\sqrt{1 + t} - \sqrt{t}\right)\right)} \]
      4. Add Preprocessing
      5. Step-by-step derivation
        1. flip--96.8%

          \[\leadsto \left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{1 + y} - \sqrt{y}\right)\right) + \left(\color{blue}{\frac{\sqrt{1 + z} \cdot \sqrt{1 + z} - \sqrt{z} \cdot \sqrt{z}}{\sqrt{1 + z} + \sqrt{z}}} + \left(\sqrt{1 + t} - \sqrt{t}\right)\right) \]
        2. add-sqr-sqrt75.9%

          \[\leadsto \left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{1 + y} - \sqrt{y}\right)\right) + \left(\frac{\color{blue}{\left(1 + z\right)} - \sqrt{z} \cdot \sqrt{z}}{\sqrt{1 + z} + \sqrt{z}} + \left(\sqrt{1 + t} - \sqrt{t}\right)\right) \]
        3. add-sqr-sqrt96.8%

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

        \[\leadsto \left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{1 + y} - \sqrt{y}\right)\right) + \left(\color{blue}{\frac{\left(1 + z\right) - z}{\sqrt{1 + z} + \sqrt{z}}} + \left(\sqrt{1 + t} - \sqrt{t}\right)\right) \]
      7. Step-by-step derivation
        1. associate--l+97.2%

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

          \[\leadsto \left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{1 + y} - \sqrt{y}\right)\right) + \left(\frac{1 + \color{blue}{0}}{\sqrt{1 + z} + \sqrt{z}} + \left(\sqrt{1 + t} - \sqrt{t}\right)\right) \]
        3. metadata-eval97.2%

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

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

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

    Alternative 4: 91.3% accurate, 1.0× speedup?

    \[\begin{array}{l} [x, y, z, t] = \mathsf{sort}([x, y, z, t])\\ \\ \begin{array}{l} t_1 := \sqrt{x + 1} - \sqrt{x}\\ t_2 := \sqrt{1 + z} - \sqrt{z}\\ \mathbf{if}\;t\_1 \leq 5 \cdot 10^{-5}:\\ \;\;\;\;0.5 \cdot \left(\sqrt{\frac{1}{x}} + \sqrt{\frac{1}{y}}\right) + \left(t\_2 + 0.5 \cdot \sqrt{\frac{1}{t}}\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1 + \left(t\_2 + \left(\sqrt{1 + y} - \sqrt{y}\right)\right)\\ \end{array} \end{array} \]
    NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
    (FPCore (x y z t)
     :precision binary64
     (let* ((t_1 (- (sqrt (+ x 1.0)) (sqrt x)))
            (t_2 (- (sqrt (+ 1.0 z)) (sqrt z))))
       (if (<= t_1 5e-5)
         (+
          (* 0.5 (+ (sqrt (/ 1.0 x)) (sqrt (/ 1.0 y))))
          (+ t_2 (* 0.5 (sqrt (/ 1.0 t)))))
         (+ t_1 (+ t_2 (- (sqrt (+ 1.0 y)) (sqrt y)))))))
    assert(x < y && y < z && z < t);
    double code(double x, double y, double z, double t) {
    	double t_1 = sqrt((x + 1.0)) - sqrt(x);
    	double t_2 = sqrt((1.0 + z)) - sqrt(z);
    	double tmp;
    	if (t_1 <= 5e-5) {
    		tmp = (0.5 * (sqrt((1.0 / x)) + sqrt((1.0 / y)))) + (t_2 + (0.5 * sqrt((1.0 / t))));
    	} else {
    		tmp = t_1 + (t_2 + (sqrt((1.0 + y)) - sqrt(y)));
    	}
    	return tmp;
    }
    
    NOTE: x, y, z, and t should be sorted in increasing order before calling this 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) :: tmp
        t_1 = sqrt((x + 1.0d0)) - sqrt(x)
        t_2 = sqrt((1.0d0 + z)) - sqrt(z)
        if (t_1 <= 5d-5) then
            tmp = (0.5d0 * (sqrt((1.0d0 / x)) + sqrt((1.0d0 / y)))) + (t_2 + (0.5d0 * sqrt((1.0d0 / t))))
        else
            tmp = t_1 + (t_2 + (sqrt((1.0d0 + y)) - sqrt(y)))
        end if
        code = tmp
    end function
    
    assert x < y && y < z && z < t;
    public static double code(double x, double y, double z, double t) {
    	double t_1 = Math.sqrt((x + 1.0)) - Math.sqrt(x);
    	double t_2 = Math.sqrt((1.0 + z)) - Math.sqrt(z);
    	double tmp;
    	if (t_1 <= 5e-5) {
    		tmp = (0.5 * (Math.sqrt((1.0 / x)) + Math.sqrt((1.0 / y)))) + (t_2 + (0.5 * Math.sqrt((1.0 / t))));
    	} else {
    		tmp = t_1 + (t_2 + (Math.sqrt((1.0 + y)) - Math.sqrt(y)));
    	}
    	return tmp;
    }
    
    [x, y, z, t] = sort([x, y, z, t])
    def code(x, y, z, t):
    	t_1 = math.sqrt((x + 1.0)) - math.sqrt(x)
    	t_2 = math.sqrt((1.0 + z)) - math.sqrt(z)
    	tmp = 0
    	if t_1 <= 5e-5:
    		tmp = (0.5 * (math.sqrt((1.0 / x)) + math.sqrt((1.0 / y)))) + (t_2 + (0.5 * math.sqrt((1.0 / t))))
    	else:
    		tmp = t_1 + (t_2 + (math.sqrt((1.0 + y)) - math.sqrt(y)))
    	return tmp
    
    x, y, z, t = sort([x, y, z, t])
    function code(x, y, z, t)
    	t_1 = Float64(sqrt(Float64(x + 1.0)) - sqrt(x))
    	t_2 = Float64(sqrt(Float64(1.0 + z)) - sqrt(z))
    	tmp = 0.0
    	if (t_1 <= 5e-5)
    		tmp = Float64(Float64(0.5 * Float64(sqrt(Float64(1.0 / x)) + sqrt(Float64(1.0 / y)))) + Float64(t_2 + Float64(0.5 * sqrt(Float64(1.0 / t)))));
    	else
    		tmp = Float64(t_1 + Float64(t_2 + Float64(sqrt(Float64(1.0 + y)) - sqrt(y))));
    	end
    	return tmp
    end
    
    x, y, z, t = num2cell(sort([x, y, z, t])){:}
    function tmp_2 = code(x, y, z, t)
    	t_1 = sqrt((x + 1.0)) - sqrt(x);
    	t_2 = sqrt((1.0 + z)) - sqrt(z);
    	tmp = 0.0;
    	if (t_1 <= 5e-5)
    		tmp = (0.5 * (sqrt((1.0 / x)) + sqrt((1.0 / y)))) + (t_2 + (0.5 * sqrt((1.0 / t))));
    	else
    		tmp = t_1 + (t_2 + (sqrt((1.0 + y)) - sqrt(y)));
    	end
    	tmp_2 = tmp;
    end
    
    NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
    code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, 5e-5], N[(N[(0.5 * N[(N[Sqrt[N[(1.0 / x), $MachinePrecision]], $MachinePrecision] + N[Sqrt[N[(1.0 / y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$2 + N[(0.5 * N[Sqrt[N[(1.0 / t), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 + N[(t$95$2 + N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
    
    \begin{array}{l}
    [x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
    \\
    \begin{array}{l}
    t_1 := \sqrt{x + 1} - \sqrt{x}\\
    t_2 := \sqrt{1 + z} - \sqrt{z}\\
    \mathbf{if}\;t\_1 \leq 5 \cdot 10^{-5}:\\
    \;\;\;\;0.5 \cdot \left(\sqrt{\frac{1}{x}} + \sqrt{\frac{1}{y}}\right) + \left(t\_2 + 0.5 \cdot \sqrt{\frac{1}{t}}\right)\\
    
    \mathbf{else}:\\
    \;\;\;\;t\_1 + \left(t\_2 + \left(\sqrt{1 + y} - \sqrt{y}\right)\right)\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if (-.f64 (sqrt.f64 (+.f64 x #s(literal 1 binary64))) (sqrt.f64 x)) < 5.00000000000000024e-5

      1. Initial program 91.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. Step-by-step derivation
        1. associate-+l+91.4%

          \[\leadsto \color{blue}{\left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{y + 1} - \sqrt{y}\right)\right) + \left(\left(\sqrt{z + 1} - \sqrt{z}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)\right)} \]
        2. associate-+l-55.1%

          \[\leadsto \color{blue}{\left(\sqrt{x + 1} - \left(\sqrt{x} - \left(\sqrt{y + 1} - \sqrt{y}\right)\right)\right)} + \left(\left(\sqrt{z + 1} - \sqrt{z}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)\right) \]
        3. associate-+l-91.4%

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

          \[\leadsto \left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{\color{blue}{1 + y}} - \sqrt{y}\right)\right) + \left(\left(\sqrt{z + 1} - \sqrt{z}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)\right) \]
        5. +-commutative91.4%

          \[\leadsto \left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{1 + y} - \sqrt{y}\right)\right) + \left(\left(\sqrt{\color{blue}{1 + z}} - \sqrt{z}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)\right) \]
        6. +-commutative91.4%

          \[\leadsto \left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{1 + y} - \sqrt{y}\right)\right) + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\sqrt{\color{blue}{1 + t}} - \sqrt{t}\right)\right) \]
      3. Simplified91.4%

        \[\leadsto \color{blue}{\left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{1 + y} - \sqrt{y}\right)\right) + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\sqrt{1 + t} - \sqrt{t}\right)\right)} \]
      4. Add Preprocessing
      5. Taylor expanded in y around inf 50.7%

        \[\leadsto \color{blue}{\left(\left(\sqrt{1 + x} + 0.5 \cdot \sqrt{\frac{1}{y}}\right) - \sqrt{x}\right)} + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\sqrt{1 + t} - \sqrt{t}\right)\right) \]
      6. Taylor expanded in x around inf 52.5%

        \[\leadsto \color{blue}{\left(0.5 \cdot \sqrt{\frac{1}{x}} + 0.5 \cdot \sqrt{\frac{1}{y}}\right)} + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\sqrt{1 + t} - \sqrt{t}\right)\right) \]
      7. Step-by-step derivation
        1. distribute-lft-out52.5%

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

        \[\leadsto \color{blue}{0.5 \cdot \left(\sqrt{\frac{1}{x}} + \sqrt{\frac{1}{y}}\right)} + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\sqrt{1 + t} - \sqrt{t}\right)\right) \]
      9. Taylor expanded in t around inf 22.8%

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

      if 5.00000000000000024e-5 < (-.f64 (sqrt.f64 (+.f64 x #s(literal 1 binary64))) (sqrt.f64 x))

      1. Initial program 96.3%

        \[\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. Step-by-step derivation
        1. associate-+l+96.3%

          \[\leadsto \color{blue}{\left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{y + 1} - \sqrt{y}\right)\right) + \left(\left(\sqrt{z + 1} - \sqrt{z}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)\right)} \]
        2. associate-+l+96.3%

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

          \[\leadsto \left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\left(\sqrt{\color{blue}{1 + y}} - \sqrt{y}\right) + \left(\left(\sqrt{z + 1} - \sqrt{z}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)\right)\right) \]
        4. +-commutative96.3%

          \[\leadsto \left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\left(\sqrt{1 + y} - \sqrt{y}\right) + \color{blue}{\left(\left(\sqrt{t + 1} - \sqrt{t}\right) + \left(\sqrt{z + 1} - \sqrt{z}\right)\right)}\right) \]
        5. associate-+l-79.5%

          \[\leadsto \left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\left(\sqrt{1 + y} - \sqrt{y}\right) + \color{blue}{\left(\sqrt{t + 1} - \left(\sqrt{t} - \left(\sqrt{z + 1} - \sqrt{z}\right)\right)\right)}\right) \]
        6. +-commutative79.5%

          \[\leadsto \left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\left(\sqrt{1 + y} - \sqrt{y}\right) + \left(\sqrt{\color{blue}{1 + t}} - \left(\sqrt{t} - \left(\sqrt{z + 1} - \sqrt{z}\right)\right)\right)\right) \]
        7. +-commutative79.5%

          \[\leadsto \left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\left(\sqrt{1 + y} - \sqrt{y}\right) + \left(\sqrt{1 + t} - \left(\sqrt{t} - \left(\sqrt{\color{blue}{1 + z}} - \sqrt{z}\right)\right)\right)\right) \]
      3. Simplified79.5%

        \[\leadsto \color{blue}{\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\left(\sqrt{1 + y} - \sqrt{y}\right) + \left(\sqrt{1 + t} - \left(\sqrt{t} - \left(\sqrt{1 + z} - \sqrt{z}\right)\right)\right)\right)} \]
      4. Add Preprocessing
      5. Taylor expanded in t around inf 57.7%

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

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

    Alternative 5: 94.3% accurate, 1.1× speedup?

    \[\begin{array}{l} [x, y, z, t] = \mathsf{sort}([x, y, z, t])\\ \\ \begin{array}{l} t_1 := \sqrt{1 + y}\\ t_2 := \sqrt{1 + z}\\ \mathbf{if}\;y \leq 5.2 \cdot 10^{-15}:\\ \;\;\;\;\left(\frac{1}{t\_2 + \sqrt{z}} + \left(\sqrt{1 + t} - \sqrt{t}\right)\right) + \left(\left(1 + t\_1\right) - \left(\sqrt{x} + \sqrt{y}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\left(t\_2 - \sqrt{z}\right) + \frac{1}{\sqrt{y} + t\_1}\right)\\ \end{array} \end{array} \]
    NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
    (FPCore (x y z t)
     :precision binary64
     (let* ((t_1 (sqrt (+ 1.0 y))) (t_2 (sqrt (+ 1.0 z))))
       (if (<= y 5.2e-15)
         (+
          (+ (/ 1.0 (+ t_2 (sqrt z))) (- (sqrt (+ 1.0 t)) (sqrt t)))
          (- (+ 1.0 t_1) (+ (sqrt x) (sqrt y))))
         (+
          (- (sqrt (+ x 1.0)) (sqrt x))
          (+ (- t_2 (sqrt z)) (/ 1.0 (+ (sqrt y) t_1)))))))
    assert(x < y && y < z && z < t);
    double code(double x, double y, double z, double t) {
    	double t_1 = sqrt((1.0 + y));
    	double t_2 = sqrt((1.0 + z));
    	double tmp;
    	if (y <= 5.2e-15) {
    		tmp = ((1.0 / (t_2 + sqrt(z))) + (sqrt((1.0 + t)) - sqrt(t))) + ((1.0 + t_1) - (sqrt(x) + sqrt(y)));
    	} else {
    		tmp = (sqrt((x + 1.0)) - sqrt(x)) + ((t_2 - sqrt(z)) + (1.0 / (sqrt(y) + t_1)));
    	}
    	return tmp;
    }
    
    NOTE: x, y, z, and t should be sorted in increasing order before calling this 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) :: tmp
        t_1 = sqrt((1.0d0 + y))
        t_2 = sqrt((1.0d0 + z))
        if (y <= 5.2d-15) then
            tmp = ((1.0d0 / (t_2 + sqrt(z))) + (sqrt((1.0d0 + t)) - sqrt(t))) + ((1.0d0 + t_1) - (sqrt(x) + sqrt(y)))
        else
            tmp = (sqrt((x + 1.0d0)) - sqrt(x)) + ((t_2 - sqrt(z)) + (1.0d0 / (sqrt(y) + t_1)))
        end if
        code = tmp
    end function
    
    assert x < y && y < z && z < t;
    public static double code(double x, double y, double z, double t) {
    	double t_1 = Math.sqrt((1.0 + y));
    	double t_2 = Math.sqrt((1.0 + z));
    	double tmp;
    	if (y <= 5.2e-15) {
    		tmp = ((1.0 / (t_2 + Math.sqrt(z))) + (Math.sqrt((1.0 + t)) - Math.sqrt(t))) + ((1.0 + t_1) - (Math.sqrt(x) + Math.sqrt(y)));
    	} else {
    		tmp = (Math.sqrt((x + 1.0)) - Math.sqrt(x)) + ((t_2 - Math.sqrt(z)) + (1.0 / (Math.sqrt(y) + t_1)));
    	}
    	return tmp;
    }
    
    [x, y, z, t] = sort([x, y, z, t])
    def code(x, y, z, t):
    	t_1 = math.sqrt((1.0 + y))
    	t_2 = math.sqrt((1.0 + z))
    	tmp = 0
    	if y <= 5.2e-15:
    		tmp = ((1.0 / (t_2 + math.sqrt(z))) + (math.sqrt((1.0 + t)) - math.sqrt(t))) + ((1.0 + t_1) - (math.sqrt(x) + math.sqrt(y)))
    	else:
    		tmp = (math.sqrt((x + 1.0)) - math.sqrt(x)) + ((t_2 - math.sqrt(z)) + (1.0 / (math.sqrt(y) + t_1)))
    	return tmp
    
    x, y, z, t = sort([x, y, z, t])
    function code(x, y, z, t)
    	t_1 = sqrt(Float64(1.0 + y))
    	t_2 = sqrt(Float64(1.0 + z))
    	tmp = 0.0
    	if (y <= 5.2e-15)
    		tmp = Float64(Float64(Float64(1.0 / Float64(t_2 + sqrt(z))) + Float64(sqrt(Float64(1.0 + t)) - sqrt(t))) + Float64(Float64(1.0 + t_1) - Float64(sqrt(x) + sqrt(y))));
    	else
    		tmp = Float64(Float64(sqrt(Float64(x + 1.0)) - sqrt(x)) + Float64(Float64(t_2 - sqrt(z)) + Float64(1.0 / Float64(sqrt(y) + t_1))));
    	end
    	return tmp
    end
    
    x, y, z, t = num2cell(sort([x, y, z, t])){:}
    function tmp_2 = code(x, y, z, t)
    	t_1 = sqrt((1.0 + y));
    	t_2 = sqrt((1.0 + z));
    	tmp = 0.0;
    	if (y <= 5.2e-15)
    		tmp = ((1.0 / (t_2 + sqrt(z))) + (sqrt((1.0 + t)) - sqrt(t))) + ((1.0 + t_1) - (sqrt(x) + sqrt(y)));
    	else
    		tmp = (sqrt((x + 1.0)) - sqrt(x)) + ((t_2 - sqrt(z)) + (1.0 / (sqrt(y) + t_1)));
    	end
    	tmp_2 = tmp;
    end
    
    NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
    code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y, 5.2e-15], N[(N[(N[(1.0 / N[(t$95$2 + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 + t$95$1), $MachinePrecision] - N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$2 - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[y], $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
    
    \begin{array}{l}
    [x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
    \\
    \begin{array}{l}
    t_1 := \sqrt{1 + y}\\
    t_2 := \sqrt{1 + z}\\
    \mathbf{if}\;y \leq 5.2 \cdot 10^{-15}:\\
    \;\;\;\;\left(\frac{1}{t\_2 + \sqrt{z}} + \left(\sqrt{1 + t} - \sqrt{t}\right)\right) + \left(\left(1 + t\_1\right) - \left(\sqrt{x} + \sqrt{y}\right)\right)\\
    
    \mathbf{else}:\\
    \;\;\;\;\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\left(t\_2 - \sqrt{z}\right) + \frac{1}{\sqrt{y} + t\_1}\right)\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if y < 5.20000000000000009e-15

      1. Initial program 97.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. Step-by-step derivation
        1. associate-+l+97.4%

          \[\leadsto \color{blue}{\left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{y + 1} - \sqrt{y}\right)\right) + \left(\left(\sqrt{z + 1} - \sqrt{z}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)\right)} \]
        2. associate-+l-62.2%

          \[\leadsto \color{blue}{\left(\sqrt{x + 1} - \left(\sqrt{x} - \left(\sqrt{y + 1} - \sqrt{y}\right)\right)\right)} + \left(\left(\sqrt{z + 1} - \sqrt{z}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)\right) \]
        3. associate-+l-97.4%

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

          \[\leadsto \left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{\color{blue}{1 + y}} - \sqrt{y}\right)\right) + \left(\left(\sqrt{z + 1} - \sqrt{z}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)\right) \]
        5. +-commutative97.4%

          \[\leadsto \left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{1 + y} - \sqrt{y}\right)\right) + \left(\left(\sqrt{\color{blue}{1 + z}} - \sqrt{z}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)\right) \]
        6. +-commutative97.4%

          \[\leadsto \left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{1 + y} - \sqrt{y}\right)\right) + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\sqrt{\color{blue}{1 + t}} - \sqrt{t}\right)\right) \]
      3. Simplified97.4%

        \[\leadsto \color{blue}{\left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{1 + y} - \sqrt{y}\right)\right) + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\sqrt{1 + t} - \sqrt{t}\right)\right)} \]
      4. Add Preprocessing
      5. Step-by-step derivation
        1. flip--97.4%

          \[\leadsto \left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{1 + y} - \sqrt{y}\right)\right) + \left(\color{blue}{\frac{\sqrt{1 + z} \cdot \sqrt{1 + z} - \sqrt{z} \cdot \sqrt{z}}{\sqrt{1 + z} + \sqrt{z}}} + \left(\sqrt{1 + t} - \sqrt{t}\right)\right) \]
        2. add-sqr-sqrt74.9%

          \[\leadsto \left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{1 + y} - \sqrt{y}\right)\right) + \left(\frac{\color{blue}{\left(1 + z\right)} - \sqrt{z} \cdot \sqrt{z}}{\sqrt{1 + z} + \sqrt{z}} + \left(\sqrt{1 + t} - \sqrt{t}\right)\right) \]
        3. add-sqr-sqrt97.4%

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

        \[\leadsto \left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{1 + y} - \sqrt{y}\right)\right) + \left(\color{blue}{\frac{\left(1 + z\right) - z}{\sqrt{1 + z} + \sqrt{z}}} + \left(\sqrt{1 + t} - \sqrt{t}\right)\right) \]
      7. Step-by-step derivation
        1. associate--l+97.9%

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

          \[\leadsto \left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{1 + y} - \sqrt{y}\right)\right) + \left(\frac{1 + \color{blue}{0}}{\sqrt{1 + z} + \sqrt{z}} + \left(\sqrt{1 + t} - \sqrt{t}\right)\right) \]
        3. metadata-eval97.9%

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

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

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

      if 5.20000000000000009e-15 < y

      1. Initial program 91.1%

        \[\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. Step-by-step derivation
        1. associate-+l+91.1%

          \[\leadsto \color{blue}{\left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{y + 1} - \sqrt{y}\right)\right) + \left(\left(\sqrt{z + 1} - \sqrt{z}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)\right)} \]
        2. associate-+l+91.1%

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

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

          \[\leadsto \left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\left(\sqrt{1 + y} - \sqrt{y}\right) + \color{blue}{\left(\left(\sqrt{t + 1} - \sqrt{t}\right) + \left(\sqrt{z + 1} - \sqrt{z}\right)\right)}\right) \]
        5. associate-+l-74.0%

          \[\leadsto \left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\left(\sqrt{1 + y} - \sqrt{y}\right) + \color{blue}{\left(\sqrt{t + 1} - \left(\sqrt{t} - \left(\sqrt{z + 1} - \sqrt{z}\right)\right)\right)}\right) \]
        6. +-commutative74.0%

          \[\leadsto \left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\left(\sqrt{1 + y} - \sqrt{y}\right) + \left(\sqrt{\color{blue}{1 + t}} - \left(\sqrt{t} - \left(\sqrt{z + 1} - \sqrt{z}\right)\right)\right)\right) \]
        7. +-commutative74.0%

          \[\leadsto \left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\left(\sqrt{1 + y} - \sqrt{y}\right) + \left(\sqrt{1 + t} - \left(\sqrt{t} - \left(\sqrt{\color{blue}{1 + z}} - \sqrt{z}\right)\right)\right)\right) \]
      3. Simplified74.0%

        \[\leadsto \color{blue}{\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\left(\sqrt{1 + y} - \sqrt{y}\right) + \left(\sqrt{1 + t} - \left(\sqrt{t} - \left(\sqrt{1 + z} - \sqrt{z}\right)\right)\right)\right)} \]
      4. Add Preprocessing
      5. Step-by-step derivation
        1. flip--74.1%

          \[\leadsto \left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\color{blue}{\frac{\sqrt{1 + y} \cdot \sqrt{1 + y} - \sqrt{y} \cdot \sqrt{y}}{\sqrt{1 + y} + \sqrt{y}}} + \left(\sqrt{1 + t} - \left(\sqrt{t} - \left(\sqrt{1 + z} - \sqrt{z}\right)\right)\right)\right) \]
        2. add-sqr-sqrt45.9%

          \[\leadsto \left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\frac{\color{blue}{\left(1 + y\right)} - \sqrt{y} \cdot \sqrt{y}}{\sqrt{1 + y} + \sqrt{y}} + \left(\sqrt{1 + t} - \left(\sqrt{t} - \left(\sqrt{1 + z} - \sqrt{z}\right)\right)\right)\right) \]
        3. add-sqr-sqrt74.4%

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

        \[\leadsto \left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\color{blue}{\frac{\left(1 + y\right) - y}{\sqrt{1 + y} + \sqrt{y}}} + \left(\sqrt{1 + t} - \left(\sqrt{t} - \left(\sqrt{1 + z} - \sqrt{z}\right)\right)\right)\right) \]
      7. Step-by-step derivation
        1. associate--l+77.2%

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

          \[\leadsto \left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\frac{1 + \color{blue}{0}}{\sqrt{1 + y} + \sqrt{y}} + \left(\sqrt{1 + t} - \left(\sqrt{t} - \left(\sqrt{1 + z} - \sqrt{z}\right)\right)\right)\right) \]
        3. metadata-eval77.2%

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

        \[\leadsto \left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\color{blue}{\frac{1}{\sqrt{1 + y} + \sqrt{y}}} + \left(\sqrt{1 + t} - \left(\sqrt{t} - \left(\sqrt{1 + z} - \sqrt{z}\right)\right)\right)\right) \]
      9. Taylor expanded in t around inf 46.2%

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

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

    Alternative 6: 93.7% accurate, 1.1× speedup?

    \[\begin{array}{l} [x, y, z, t] = \mathsf{sort}([x, y, z, t])\\ \\ \begin{array}{l} t_1 := \sqrt{1 + z} - \sqrt{z}\\ t_2 := \sqrt{1 + y}\\ \mathbf{if}\;z \leq 400000:\\ \;\;\;\;\left(\left(1 + t\_2\right) - \left(\sqrt{x} + \sqrt{y}\right)\right) + \left(t\_1 + \frac{1}{\sqrt{1 + t} + \sqrt{t}}\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(t\_1 + \frac{1}{\sqrt{y} + t\_2}\right)\\ \end{array} \end{array} \]
    NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
    (FPCore (x y z t)
     :precision binary64
     (let* ((t_1 (- (sqrt (+ 1.0 z)) (sqrt z))) (t_2 (sqrt (+ 1.0 y))))
       (if (<= z 400000.0)
         (+
          (- (+ 1.0 t_2) (+ (sqrt x) (sqrt y)))
          (+ t_1 (/ 1.0 (+ (sqrt (+ 1.0 t)) (sqrt t)))))
         (+ (- (sqrt (+ x 1.0)) (sqrt x)) (+ t_1 (/ 1.0 (+ (sqrt y) t_2)))))))
    assert(x < y && y < z && z < t);
    double code(double x, double y, double z, double t) {
    	double t_1 = sqrt((1.0 + z)) - sqrt(z);
    	double t_2 = sqrt((1.0 + y));
    	double tmp;
    	if (z <= 400000.0) {
    		tmp = ((1.0 + t_2) - (sqrt(x) + sqrt(y))) + (t_1 + (1.0 / (sqrt((1.0 + t)) + sqrt(t))));
    	} else {
    		tmp = (sqrt((x + 1.0)) - sqrt(x)) + (t_1 + (1.0 / (sqrt(y) + t_2)));
    	}
    	return tmp;
    }
    
    NOTE: x, y, z, and t should be sorted in increasing order before calling this 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) :: tmp
        t_1 = sqrt((1.0d0 + z)) - sqrt(z)
        t_2 = sqrt((1.0d0 + y))
        if (z <= 400000.0d0) then
            tmp = ((1.0d0 + t_2) - (sqrt(x) + sqrt(y))) + (t_1 + (1.0d0 / (sqrt((1.0d0 + t)) + sqrt(t))))
        else
            tmp = (sqrt((x + 1.0d0)) - sqrt(x)) + (t_1 + (1.0d0 / (sqrt(y) + t_2)))
        end if
        code = tmp
    end function
    
    assert x < y && y < z && z < t;
    public static double code(double x, double y, double z, double t) {
    	double t_1 = Math.sqrt((1.0 + z)) - Math.sqrt(z);
    	double t_2 = Math.sqrt((1.0 + y));
    	double tmp;
    	if (z <= 400000.0) {
    		tmp = ((1.0 + t_2) - (Math.sqrt(x) + Math.sqrt(y))) + (t_1 + (1.0 / (Math.sqrt((1.0 + t)) + Math.sqrt(t))));
    	} else {
    		tmp = (Math.sqrt((x + 1.0)) - Math.sqrt(x)) + (t_1 + (1.0 / (Math.sqrt(y) + t_2)));
    	}
    	return tmp;
    }
    
    [x, y, z, t] = sort([x, y, z, t])
    def code(x, y, z, t):
    	t_1 = math.sqrt((1.0 + z)) - math.sqrt(z)
    	t_2 = math.sqrt((1.0 + y))
    	tmp = 0
    	if z <= 400000.0:
    		tmp = ((1.0 + t_2) - (math.sqrt(x) + math.sqrt(y))) + (t_1 + (1.0 / (math.sqrt((1.0 + t)) + math.sqrt(t))))
    	else:
    		tmp = (math.sqrt((x + 1.0)) - math.sqrt(x)) + (t_1 + (1.0 / (math.sqrt(y) + t_2)))
    	return tmp
    
    x, y, z, t = sort([x, y, z, t])
    function code(x, y, z, t)
    	t_1 = Float64(sqrt(Float64(1.0 + z)) - sqrt(z))
    	t_2 = sqrt(Float64(1.0 + y))
    	tmp = 0.0
    	if (z <= 400000.0)
    		tmp = Float64(Float64(Float64(1.0 + t_2) - Float64(sqrt(x) + sqrt(y))) + Float64(t_1 + Float64(1.0 / Float64(sqrt(Float64(1.0 + t)) + sqrt(t)))));
    	else
    		tmp = Float64(Float64(sqrt(Float64(x + 1.0)) - sqrt(x)) + Float64(t_1 + Float64(1.0 / Float64(sqrt(y) + t_2))));
    	end
    	return tmp
    end
    
    x, y, z, t = num2cell(sort([x, y, z, t])){:}
    function tmp_2 = code(x, y, z, t)
    	t_1 = sqrt((1.0 + z)) - sqrt(z);
    	t_2 = sqrt((1.0 + y));
    	tmp = 0.0;
    	if (z <= 400000.0)
    		tmp = ((1.0 + t_2) - (sqrt(x) + sqrt(y))) + (t_1 + (1.0 / (sqrt((1.0 + t)) + sqrt(t))));
    	else
    		tmp = (sqrt((x + 1.0)) - sqrt(x)) + (t_1 + (1.0 / (sqrt(y) + t_2)));
    	end
    	tmp_2 = tmp;
    end
    
    NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
    code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[z, 400000.0], N[(N[(N[(1.0 + t$95$2), $MachinePrecision] - N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$1 + N[(1.0 / N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] + N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(t$95$1 + N[(1.0 / N[(N[Sqrt[y], $MachinePrecision] + t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
    
    \begin{array}{l}
    [x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
    \\
    \begin{array}{l}
    t_1 := \sqrt{1 + z} - \sqrt{z}\\
    t_2 := \sqrt{1 + y}\\
    \mathbf{if}\;z \leq 400000:\\
    \;\;\;\;\left(\left(1 + t\_2\right) - \left(\sqrt{x} + \sqrt{y}\right)\right) + \left(t\_1 + \frac{1}{\sqrt{1 + t} + \sqrt{t}}\right)\\
    
    \mathbf{else}:\\
    \;\;\;\;\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(t\_1 + \frac{1}{\sqrt{y} + t\_2}\right)\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if z < 4e5

      1. Initial program 96.6%

        \[\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. Step-by-step derivation
        1. associate-+l+96.6%

          \[\leadsto \color{blue}{\left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{y + 1} - \sqrt{y}\right)\right) + \left(\left(\sqrt{z + 1} - \sqrt{z}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)\right)} \]
        2. associate-+l-79.4%

          \[\leadsto \color{blue}{\left(\sqrt{x + 1} - \left(\sqrt{x} - \left(\sqrt{y + 1} - \sqrt{y}\right)\right)\right)} + \left(\left(\sqrt{z + 1} - \sqrt{z}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)\right) \]
        3. associate-+l-96.6%

          \[\leadsto \color{blue}{\left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{y + 1} - \sqrt{y}\right)\right)} + \left(\left(\sqrt{z + 1} - \sqrt{z}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)\right) \]
        4. +-commutative96.6%

          \[\leadsto \left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{\color{blue}{1 + y}} - \sqrt{y}\right)\right) + \left(\left(\sqrt{z + 1} - \sqrt{z}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)\right) \]
        5. +-commutative96.6%

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

          \[\leadsto \left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{1 + y} - \sqrt{y}\right)\right) + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\sqrt{\color{blue}{1 + t}} - \sqrt{t}\right)\right) \]
      3. Simplified96.6%

        \[\leadsto \color{blue}{\left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{1 + y} - \sqrt{y}\right)\right) + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\sqrt{1 + t} - \sqrt{t}\right)\right)} \]
      4. Add Preprocessing
      5. Step-by-step derivation
        1. flip--96.7%

          \[\leadsto \left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{1 + y} - \sqrt{y}\right)\right) + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \color{blue}{\frac{\sqrt{1 + t} \cdot \sqrt{1 + t} - \sqrt{t} \cdot \sqrt{t}}{\sqrt{1 + t} + \sqrt{t}}}\right) \]
        2. add-sqr-sqrt76.3%

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

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

        \[\leadsto \left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{1 + y} - \sqrt{y}\right)\right) + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \color{blue}{\frac{\left(1 + t\right) - t}{\sqrt{1 + t} + \sqrt{t}}}\right) \]
      7. Step-by-step derivation
        1. associate--l+97.7%

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

          \[\leadsto \left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{1 + y} - \sqrt{y}\right)\right) + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \frac{1 + \color{blue}{0}}{\sqrt{1 + t} + \sqrt{t}}\right) \]
        3. metadata-eval97.7%

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

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

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

      if 4e5 < z

      1. Initial program 91.0%

        \[\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. Step-by-step derivation
        1. associate-+l+91.0%

          \[\leadsto \color{blue}{\left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{y + 1} - \sqrt{y}\right)\right) + \left(\left(\sqrt{z + 1} - \sqrt{z}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)\right)} \]
        2. associate-+l+91.0%

          \[\leadsto \color{blue}{\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\left(\sqrt{y + 1} - \sqrt{y}\right) + \left(\left(\sqrt{z + 1} - \sqrt{z}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)\right)\right)} \]
        3. +-commutative91.0%

          \[\leadsto \left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\left(\sqrt{\color{blue}{1 + y}} - \sqrt{y}\right) + \left(\left(\sqrt{z + 1} - \sqrt{z}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)\right)\right) \]
        4. +-commutative91.0%

          \[\leadsto \left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\left(\sqrt{1 + y} - \sqrt{y}\right) + \color{blue}{\left(\left(\sqrt{t + 1} - \sqrt{t}\right) + \left(\sqrt{z + 1} - \sqrt{z}\right)\right)}\right) \]
        5. associate-+l-90.6%

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

          \[\leadsto \left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\left(\sqrt{1 + y} - \sqrt{y}\right) + \left(\sqrt{\color{blue}{1 + t}} - \left(\sqrt{t} - \left(\sqrt{z + 1} - \sqrt{z}\right)\right)\right)\right) \]
        7. +-commutative90.6%

          \[\leadsto \left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\left(\sqrt{1 + y} - \sqrt{y}\right) + \left(\sqrt{1 + t} - \left(\sqrt{t} - \left(\sqrt{\color{blue}{1 + z}} - \sqrt{z}\right)\right)\right)\right) \]
      3. Simplified90.6%

        \[\leadsto \color{blue}{\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\left(\sqrt{1 + y} - \sqrt{y}\right) + \left(\sqrt{1 + t} - \left(\sqrt{t} - \left(\sqrt{1 + z} - \sqrt{z}\right)\right)\right)\right)} \]
      4. Add Preprocessing
      5. Step-by-step derivation
        1. flip--90.8%

          \[\leadsto \left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\color{blue}{\frac{\sqrt{1 + y} \cdot \sqrt{1 + y} - \sqrt{y} \cdot \sqrt{y}}{\sqrt{1 + y} + \sqrt{y}}} + \left(\sqrt{1 + t} - \left(\sqrt{t} - \left(\sqrt{1 + z} - \sqrt{z}\right)\right)\right)\right) \]
        2. add-sqr-sqrt73.7%

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

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

        \[\leadsto \left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\color{blue}{\frac{\left(1 + y\right) - y}{\sqrt{1 + y} + \sqrt{y}}} + \left(\sqrt{1 + t} - \left(\sqrt{t} - \left(\sqrt{1 + z} - \sqrt{z}\right)\right)\right)\right) \]
      7. Step-by-step derivation
        1. associate--l+93.7%

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

          \[\leadsto \left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\frac{1 + \color{blue}{0}}{\sqrt{1 + y} + \sqrt{y}} + \left(\sqrt{1 + t} - \left(\sqrt{t} - \left(\sqrt{1 + z} - \sqrt{z}\right)\right)\right)\right) \]
        3. metadata-eval93.7%

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

        \[\leadsto \left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\color{blue}{\frac{1}{\sqrt{1 + y} + \sqrt{y}}} + \left(\sqrt{1 + t} - \left(\sqrt{t} - \left(\sqrt{1 + z} - \sqrt{z}\right)\right)\right)\right) \]
      9. Taylor expanded in t around inf 50.4%

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

      \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq 400000:\\ \;\;\;\;\left(\left(1 + \sqrt{1 + y}\right) - \left(\sqrt{x} + \sqrt{y}\right)\right) + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \frac{1}{\sqrt{1 + t} + \sqrt{t}}\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \frac{1}{\sqrt{y} + \sqrt{1 + y}}\right)\\ \end{array} \]
    5. Add Preprocessing

    Alternative 7: 96.9% accurate, 1.1× speedup?

    \[\begin{array}{l} [x, y, z, t] = \mathsf{sort}([x, y, z, t])\\ \\ \begin{array}{l} t_1 := \sqrt{1 + y}\\ t_2 := \sqrt{1 + z} - \sqrt{z}\\ \mathbf{if}\;x \leq 3.35 \cdot 10^{-164}:\\ \;\;\;\;\left(t\_2 + \left(\sqrt{1 + t} - \sqrt{t}\right)\right) + \left(1 + \left(t\_1 - \left(\sqrt{x} + \sqrt{y}\right)\right)\right)\\ \mathbf{elif}\;x \leq 115000000:\\ \;\;\;\;\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(t\_2 + \frac{1}{\sqrt{y} + t\_1}\right)\\ \mathbf{else}:\\ \;\;\;\;0.5 \cdot \left(\sqrt{\frac{1}{x}} + \sqrt{\frac{1}{y}}\right) + \left(t\_2 + 0.5 \cdot \sqrt{\frac{1}{t}}\right)\\ \end{array} \end{array} \]
    NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
    (FPCore (x y z t)
     :precision binary64
     (let* ((t_1 (sqrt (+ 1.0 y))) (t_2 (- (sqrt (+ 1.0 z)) (sqrt z))))
       (if (<= x 3.35e-164)
         (+
          (+ t_2 (- (sqrt (+ 1.0 t)) (sqrt t)))
          (+ 1.0 (- t_1 (+ (sqrt x) (sqrt y)))))
         (if (<= x 115000000.0)
           (+ (- (sqrt (+ x 1.0)) (sqrt x)) (+ t_2 (/ 1.0 (+ (sqrt y) t_1))))
           (+
            (* 0.5 (+ (sqrt (/ 1.0 x)) (sqrt (/ 1.0 y))))
            (+ t_2 (* 0.5 (sqrt (/ 1.0 t)))))))))
    assert(x < y && y < z && z < t);
    double code(double x, double y, double z, double t) {
    	double t_1 = sqrt((1.0 + y));
    	double t_2 = sqrt((1.0 + z)) - sqrt(z);
    	double tmp;
    	if (x <= 3.35e-164) {
    		tmp = (t_2 + (sqrt((1.0 + t)) - sqrt(t))) + (1.0 + (t_1 - (sqrt(x) + sqrt(y))));
    	} else if (x <= 115000000.0) {
    		tmp = (sqrt((x + 1.0)) - sqrt(x)) + (t_2 + (1.0 / (sqrt(y) + t_1)));
    	} else {
    		tmp = (0.5 * (sqrt((1.0 / x)) + sqrt((1.0 / y)))) + (t_2 + (0.5 * sqrt((1.0 / t))));
    	}
    	return tmp;
    }
    
    NOTE: x, y, z, and t should be sorted in increasing order before calling this 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) :: tmp
        t_1 = sqrt((1.0d0 + y))
        t_2 = sqrt((1.0d0 + z)) - sqrt(z)
        if (x <= 3.35d-164) then
            tmp = (t_2 + (sqrt((1.0d0 + t)) - sqrt(t))) + (1.0d0 + (t_1 - (sqrt(x) + sqrt(y))))
        else if (x <= 115000000.0d0) then
            tmp = (sqrt((x + 1.0d0)) - sqrt(x)) + (t_2 + (1.0d0 / (sqrt(y) + t_1)))
        else
            tmp = (0.5d0 * (sqrt((1.0d0 / x)) + sqrt((1.0d0 / y)))) + (t_2 + (0.5d0 * sqrt((1.0d0 / t))))
        end if
        code = tmp
    end function
    
    assert x < y && y < z && z < t;
    public static double code(double x, double y, double z, double t) {
    	double t_1 = Math.sqrt((1.0 + y));
    	double t_2 = Math.sqrt((1.0 + z)) - Math.sqrt(z);
    	double tmp;
    	if (x <= 3.35e-164) {
    		tmp = (t_2 + (Math.sqrt((1.0 + t)) - Math.sqrt(t))) + (1.0 + (t_1 - (Math.sqrt(x) + Math.sqrt(y))));
    	} else if (x <= 115000000.0) {
    		tmp = (Math.sqrt((x + 1.0)) - Math.sqrt(x)) + (t_2 + (1.0 / (Math.sqrt(y) + t_1)));
    	} else {
    		tmp = (0.5 * (Math.sqrt((1.0 / x)) + Math.sqrt((1.0 / y)))) + (t_2 + (0.5 * Math.sqrt((1.0 / t))));
    	}
    	return tmp;
    }
    
    [x, y, z, t] = sort([x, y, z, t])
    def code(x, y, z, t):
    	t_1 = math.sqrt((1.0 + y))
    	t_2 = math.sqrt((1.0 + z)) - math.sqrt(z)
    	tmp = 0
    	if x <= 3.35e-164:
    		tmp = (t_2 + (math.sqrt((1.0 + t)) - math.sqrt(t))) + (1.0 + (t_1 - (math.sqrt(x) + math.sqrt(y))))
    	elif x <= 115000000.0:
    		tmp = (math.sqrt((x + 1.0)) - math.sqrt(x)) + (t_2 + (1.0 / (math.sqrt(y) + t_1)))
    	else:
    		tmp = (0.5 * (math.sqrt((1.0 / x)) + math.sqrt((1.0 / y)))) + (t_2 + (0.5 * math.sqrt((1.0 / t))))
    	return tmp
    
    x, y, z, t = sort([x, y, z, t])
    function code(x, y, z, t)
    	t_1 = sqrt(Float64(1.0 + y))
    	t_2 = Float64(sqrt(Float64(1.0 + z)) - sqrt(z))
    	tmp = 0.0
    	if (x <= 3.35e-164)
    		tmp = Float64(Float64(t_2 + Float64(sqrt(Float64(1.0 + t)) - sqrt(t))) + Float64(1.0 + Float64(t_1 - Float64(sqrt(x) + sqrt(y)))));
    	elseif (x <= 115000000.0)
    		tmp = Float64(Float64(sqrt(Float64(x + 1.0)) - sqrt(x)) + Float64(t_2 + Float64(1.0 / Float64(sqrt(y) + t_1))));
    	else
    		tmp = Float64(Float64(0.5 * Float64(sqrt(Float64(1.0 / x)) + sqrt(Float64(1.0 / y)))) + Float64(t_2 + Float64(0.5 * sqrt(Float64(1.0 / t)))));
    	end
    	return tmp
    end
    
    x, y, z, t = num2cell(sort([x, y, z, t])){:}
    function tmp_2 = code(x, y, z, t)
    	t_1 = sqrt((1.0 + y));
    	t_2 = sqrt((1.0 + z)) - sqrt(z);
    	tmp = 0.0;
    	if (x <= 3.35e-164)
    		tmp = (t_2 + (sqrt((1.0 + t)) - sqrt(t))) + (1.0 + (t_1 - (sqrt(x) + sqrt(y))));
    	elseif (x <= 115000000.0)
    		tmp = (sqrt((x + 1.0)) - sqrt(x)) + (t_2 + (1.0 / (sqrt(y) + t_1)));
    	else
    		tmp = (0.5 * (sqrt((1.0 / x)) + sqrt((1.0 / y)))) + (t_2 + (0.5 * sqrt((1.0 / t))));
    	end
    	tmp_2 = tmp;
    end
    
    NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
    code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, 3.35e-164], N[(N[(t$95$2 + N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 + N[(t$95$1 - N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 115000000.0], N[(N[(N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(t$95$2 + N[(1.0 / N[(N[Sqrt[y], $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(0.5 * N[(N[Sqrt[N[(1.0 / x), $MachinePrecision]], $MachinePrecision] + N[Sqrt[N[(1.0 / y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$2 + N[(0.5 * N[Sqrt[N[(1.0 / t), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
    
    \begin{array}{l}
    [x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
    \\
    \begin{array}{l}
    t_1 := \sqrt{1 + y}\\
    t_2 := \sqrt{1 + z} - \sqrt{z}\\
    \mathbf{if}\;x \leq 3.35 \cdot 10^{-164}:\\
    \;\;\;\;\left(t\_2 + \left(\sqrt{1 + t} - \sqrt{t}\right)\right) + \left(1 + \left(t\_1 - \left(\sqrt{x} + \sqrt{y}\right)\right)\right)\\
    
    \mathbf{elif}\;x \leq 115000000:\\
    \;\;\;\;\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(t\_2 + \frac{1}{\sqrt{y} + t\_1}\right)\\
    
    \mathbf{else}:\\
    \;\;\;\;0.5 \cdot \left(\sqrt{\frac{1}{x}} + \sqrt{\frac{1}{y}}\right) + \left(t\_2 + 0.5 \cdot \sqrt{\frac{1}{t}}\right)\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 3 regimes
    2. if x < 3.35e-164

      1. Initial program 97.3%

        \[\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. Step-by-step derivation
        1. associate-+l+97.3%

          \[\leadsto \color{blue}{\left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{y + 1} - \sqrt{y}\right)\right) + \left(\left(\sqrt{z + 1} - \sqrt{z}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)\right)} \]
        2. associate-+l-97.3%

          \[\leadsto \color{blue}{\left(\sqrt{x + 1} - \left(\sqrt{x} - \left(\sqrt{y + 1} - \sqrt{y}\right)\right)\right)} + \left(\left(\sqrt{z + 1} - \sqrt{z}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)\right) \]
        3. associate-+l-97.3%

          \[\leadsto \color{blue}{\left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{y + 1} - \sqrt{y}\right)\right)} + \left(\left(\sqrt{z + 1} - \sqrt{z}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)\right) \]
        4. +-commutative97.3%

          \[\leadsto \left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{\color{blue}{1 + y}} - \sqrt{y}\right)\right) + \left(\left(\sqrt{z + 1} - \sqrt{z}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)\right) \]
        5. +-commutative97.3%

          \[\leadsto \left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{1 + y} - \sqrt{y}\right)\right) + \left(\left(\sqrt{\color{blue}{1 + z}} - \sqrt{z}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)\right) \]
        6. +-commutative97.3%

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

        \[\leadsto \color{blue}{\left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{1 + y} - \sqrt{y}\right)\right) + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\sqrt{1 + t} - \sqrt{t}\right)\right)} \]
      4. Add Preprocessing
      5. Taylor expanded in x around 0 56.8%

        \[\leadsto \color{blue}{\left(\left(1 + \sqrt{1 + y}\right) - \left(\sqrt{x} + \sqrt{y}\right)\right)} + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\sqrt{1 + t} - \sqrt{t}\right)\right) \]
      6. Step-by-step derivation
        1. associate--l+97.3%

          \[\leadsto \color{blue}{\left(1 + \left(\sqrt{1 + y} - \left(\sqrt{x} + \sqrt{y}\right)\right)\right)} + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\sqrt{1 + t} - \sqrt{t}\right)\right) \]
      7. Simplified97.3%

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

      if 3.35e-164 < x < 1.15e8

      1. Initial program 95.3%

        \[\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. Step-by-step derivation
        1. associate-+l+95.3%

          \[\leadsto \color{blue}{\left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{y + 1} - \sqrt{y}\right)\right) + \left(\left(\sqrt{z + 1} - \sqrt{z}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)\right)} \]
        2. associate-+l+95.3%

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

          \[\leadsto \left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\left(\sqrt{\color{blue}{1 + y}} - \sqrt{y}\right) + \left(\left(\sqrt{z + 1} - \sqrt{z}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)\right)\right) \]
        4. +-commutative95.3%

          \[\leadsto \left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\left(\sqrt{1 + y} - \sqrt{y}\right) + \color{blue}{\left(\left(\sqrt{t + 1} - \sqrt{t}\right) + \left(\sqrt{z + 1} - \sqrt{z}\right)\right)}\right) \]
        5. associate-+l-76.2%

          \[\leadsto \left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\left(\sqrt{1 + y} - \sqrt{y}\right) + \color{blue}{\left(\sqrt{t + 1} - \left(\sqrt{t} - \left(\sqrt{z + 1} - \sqrt{z}\right)\right)\right)}\right) \]
        6. +-commutative76.2%

          \[\leadsto \left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\left(\sqrt{1 + y} - \sqrt{y}\right) + \left(\sqrt{\color{blue}{1 + t}} - \left(\sqrt{t} - \left(\sqrt{z + 1} - \sqrt{z}\right)\right)\right)\right) \]
        7. +-commutative76.2%

          \[\leadsto \left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\left(\sqrt{1 + y} - \sqrt{y}\right) + \left(\sqrt{1 + t} - \left(\sqrt{t} - \left(\sqrt{\color{blue}{1 + z}} - \sqrt{z}\right)\right)\right)\right) \]
      3. Simplified76.2%

        \[\leadsto \color{blue}{\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\left(\sqrt{1 + y} - \sqrt{y}\right) + \left(\sqrt{1 + t} - \left(\sqrt{t} - \left(\sqrt{1 + z} - \sqrt{z}\right)\right)\right)\right)} \]
      4. Add Preprocessing
      5. Step-by-step derivation
        1. flip--76.4%

          \[\leadsto \left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\color{blue}{\frac{\sqrt{1 + y} \cdot \sqrt{1 + y} - \sqrt{y} \cdot \sqrt{y}}{\sqrt{1 + y} + \sqrt{y}}} + \left(\sqrt{1 + t} - \left(\sqrt{t} - \left(\sqrt{1 + z} - \sqrt{z}\right)\right)\right)\right) \]
        2. add-sqr-sqrt61.8%

          \[\leadsto \left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\frac{\color{blue}{\left(1 + y\right)} - \sqrt{y} \cdot \sqrt{y}}{\sqrt{1 + y} + \sqrt{y}} + \left(\sqrt{1 + t} - \left(\sqrt{t} - \left(\sqrt{1 + z} - \sqrt{z}\right)\right)\right)\right) \]
        3. add-sqr-sqrt76.4%

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

        \[\leadsto \left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\color{blue}{\frac{\left(1 + y\right) - y}{\sqrt{1 + y} + \sqrt{y}}} + \left(\sqrt{1 + t} - \left(\sqrt{t} - \left(\sqrt{1 + z} - \sqrt{z}\right)\right)\right)\right) \]
      7. Step-by-step derivation
        1. associate--l+78.0%

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

          \[\leadsto \left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\frac{1 + \color{blue}{0}}{\sqrt{1 + y} + \sqrt{y}} + \left(\sqrt{1 + t} - \left(\sqrt{t} - \left(\sqrt{1 + z} - \sqrt{z}\right)\right)\right)\right) \]
        3. metadata-eval78.0%

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

        \[\leadsto \left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\color{blue}{\frac{1}{\sqrt{1 + y} + \sqrt{y}}} + \left(\sqrt{1 + t} - \left(\sqrt{t} - \left(\sqrt{1 + z} - \sqrt{z}\right)\right)\right)\right) \]
      9. Taylor expanded in t around inf 62.3%

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

      if 1.15e8 < x

      1. Initial program 91.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. Step-by-step derivation
        1. associate-+l+91.4%

          \[\leadsto \color{blue}{\left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{y + 1} - \sqrt{y}\right)\right) + \left(\left(\sqrt{z + 1} - \sqrt{z}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)\right)} \]
        2. associate-+l-55.1%

          \[\leadsto \color{blue}{\left(\sqrt{x + 1} - \left(\sqrt{x} - \left(\sqrt{y + 1} - \sqrt{y}\right)\right)\right)} + \left(\left(\sqrt{z + 1} - \sqrt{z}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)\right) \]
        3. associate-+l-91.4%

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

          \[\leadsto \left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{\color{blue}{1 + y}} - \sqrt{y}\right)\right) + \left(\left(\sqrt{z + 1} - \sqrt{z}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)\right) \]
        5. +-commutative91.4%

          \[\leadsto \left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{1 + y} - \sqrt{y}\right)\right) + \left(\left(\sqrt{\color{blue}{1 + z}} - \sqrt{z}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)\right) \]
        6. +-commutative91.4%

          \[\leadsto \left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{1 + y} - \sqrt{y}\right)\right) + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\sqrt{\color{blue}{1 + t}} - \sqrt{t}\right)\right) \]
      3. Simplified91.4%

        \[\leadsto \color{blue}{\left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{1 + y} - \sqrt{y}\right)\right) + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\sqrt{1 + t} - \sqrt{t}\right)\right)} \]
      4. Add Preprocessing
      5. Taylor expanded in y around inf 50.7%

        \[\leadsto \color{blue}{\left(\left(\sqrt{1 + x} + 0.5 \cdot \sqrt{\frac{1}{y}}\right) - \sqrt{x}\right)} + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\sqrt{1 + t} - \sqrt{t}\right)\right) \]
      6. Taylor expanded in x around inf 52.5%

        \[\leadsto \color{blue}{\left(0.5 \cdot \sqrt{\frac{1}{x}} + 0.5 \cdot \sqrt{\frac{1}{y}}\right)} + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\sqrt{1 + t} - \sqrt{t}\right)\right) \]
      7. Step-by-step derivation
        1. distribute-lft-out52.5%

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

        \[\leadsto \color{blue}{0.5 \cdot \left(\sqrt{\frac{1}{x}} + \sqrt{\frac{1}{y}}\right)} + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\sqrt{1 + t} - \sqrt{t}\right)\right) \]
      9. Taylor expanded in t around inf 22.8%

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

      \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq 3.35 \cdot 10^{-164}:\\ \;\;\;\;\left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\sqrt{1 + t} - \sqrt{t}\right)\right) + \left(1 + \left(\sqrt{1 + y} - \left(\sqrt{x} + \sqrt{y}\right)\right)\right)\\ \mathbf{elif}\;x \leq 115000000:\\ \;\;\;\;\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \frac{1}{\sqrt{y} + \sqrt{1 + y}}\right)\\ \mathbf{else}:\\ \;\;\;\;0.5 \cdot \left(\sqrt{\frac{1}{x}} + \sqrt{\frac{1}{y}}\right) + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + 0.5 \cdot \sqrt{\frac{1}{t}}\right)\\ \end{array} \]
    5. Add Preprocessing

    Alternative 8: 93.3% accurate, 1.3× speedup?

    \[\begin{array}{l} [x, y, z, t] = \mathsf{sort}([x, y, z, t])\\ \\ \begin{array}{l} t_1 := \sqrt{1 + z}\\ \mathbf{if}\;t \leq 7.2 \cdot 10^{+14}:\\ \;\;\;\;\left(2 + \left(t\_1 + \sqrt{1 + t}\right)\right) - \left(\sqrt{t} + \left(\sqrt{x} + \left(\sqrt{y} + \sqrt{z}\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\left(t\_1 - \sqrt{z}\right) + \frac{1}{\sqrt{y} + \sqrt{1 + y}}\right)\\ \end{array} \end{array} \]
    NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
    (FPCore (x y z t)
     :precision binary64
     (let* ((t_1 (sqrt (+ 1.0 z))))
       (if (<= t 7.2e+14)
         (-
          (+ 2.0 (+ t_1 (sqrt (+ 1.0 t))))
          (+ (sqrt t) (+ (sqrt x) (+ (sqrt y) (sqrt z)))))
         (+
          (- (sqrt (+ x 1.0)) (sqrt x))
          (+ (- t_1 (sqrt z)) (/ 1.0 (+ (sqrt y) (sqrt (+ 1.0 y)))))))))
    assert(x < y && y < z && z < t);
    double code(double x, double y, double z, double t) {
    	double t_1 = sqrt((1.0 + z));
    	double tmp;
    	if (t <= 7.2e+14) {
    		tmp = (2.0 + (t_1 + sqrt((1.0 + t)))) - (sqrt(t) + (sqrt(x) + (sqrt(y) + sqrt(z))));
    	} else {
    		tmp = (sqrt((x + 1.0)) - sqrt(x)) + ((t_1 - sqrt(z)) + (1.0 / (sqrt(y) + sqrt((1.0 + y)))));
    	}
    	return tmp;
    }
    
    NOTE: x, y, z, and t should be sorted in increasing order before calling this 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) :: tmp
        t_1 = sqrt((1.0d0 + z))
        if (t <= 7.2d+14) then
            tmp = (2.0d0 + (t_1 + sqrt((1.0d0 + t)))) - (sqrt(t) + (sqrt(x) + (sqrt(y) + sqrt(z))))
        else
            tmp = (sqrt((x + 1.0d0)) - sqrt(x)) + ((t_1 - sqrt(z)) + (1.0d0 / (sqrt(y) + sqrt((1.0d0 + y)))))
        end if
        code = tmp
    end function
    
    assert x < y && y < z && z < t;
    public static double code(double x, double y, double z, double t) {
    	double t_1 = Math.sqrt((1.0 + z));
    	double tmp;
    	if (t <= 7.2e+14) {
    		tmp = (2.0 + (t_1 + Math.sqrt((1.0 + t)))) - (Math.sqrt(t) + (Math.sqrt(x) + (Math.sqrt(y) + Math.sqrt(z))));
    	} else {
    		tmp = (Math.sqrt((x + 1.0)) - Math.sqrt(x)) + ((t_1 - Math.sqrt(z)) + (1.0 / (Math.sqrt(y) + Math.sqrt((1.0 + y)))));
    	}
    	return tmp;
    }
    
    [x, y, z, t] = sort([x, y, z, t])
    def code(x, y, z, t):
    	t_1 = math.sqrt((1.0 + z))
    	tmp = 0
    	if t <= 7.2e+14:
    		tmp = (2.0 + (t_1 + math.sqrt((1.0 + t)))) - (math.sqrt(t) + (math.sqrt(x) + (math.sqrt(y) + math.sqrt(z))))
    	else:
    		tmp = (math.sqrt((x + 1.0)) - math.sqrt(x)) + ((t_1 - math.sqrt(z)) + (1.0 / (math.sqrt(y) + math.sqrt((1.0 + y)))))
    	return tmp
    
    x, y, z, t = sort([x, y, z, t])
    function code(x, y, z, t)
    	t_1 = sqrt(Float64(1.0 + z))
    	tmp = 0.0
    	if (t <= 7.2e+14)
    		tmp = Float64(Float64(2.0 + Float64(t_1 + sqrt(Float64(1.0 + t)))) - Float64(sqrt(t) + Float64(sqrt(x) + Float64(sqrt(y) + sqrt(z)))));
    	else
    		tmp = Float64(Float64(sqrt(Float64(x + 1.0)) - sqrt(x)) + Float64(Float64(t_1 - sqrt(z)) + Float64(1.0 / Float64(sqrt(y) + sqrt(Float64(1.0 + y))))));
    	end
    	return tmp
    end
    
    x, y, z, t = num2cell(sort([x, y, z, t])){:}
    function tmp_2 = code(x, y, z, t)
    	t_1 = sqrt((1.0 + z));
    	tmp = 0.0;
    	if (t <= 7.2e+14)
    		tmp = (2.0 + (t_1 + sqrt((1.0 + t)))) - (sqrt(t) + (sqrt(x) + (sqrt(y) + sqrt(z))));
    	else
    		tmp = (sqrt((x + 1.0)) - sqrt(x)) + ((t_1 - sqrt(z)) + (1.0 / (sqrt(y) + sqrt((1.0 + y)))));
    	end
    	tmp_2 = tmp;
    end
    
    NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
    code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t, 7.2e+14], N[(N[(2.0 + N[(t$95$1 + N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[t], $MachinePrecision] + N[(N[Sqrt[x], $MachinePrecision] + N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$1 - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
    
    \begin{array}{l}
    [x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
    \\
    \begin{array}{l}
    t_1 := \sqrt{1 + z}\\
    \mathbf{if}\;t \leq 7.2 \cdot 10^{+14}:\\
    \;\;\;\;\left(2 + \left(t\_1 + \sqrt{1 + t}\right)\right) - \left(\sqrt{t} + \left(\sqrt{x} + \left(\sqrt{y} + \sqrt{z}\right)\right)\right)\\
    
    \mathbf{else}:\\
    \;\;\;\;\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\left(t\_1 - \sqrt{z}\right) + \frac{1}{\sqrt{y} + \sqrt{1 + y}}\right)\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if t < 7.2e14

      1. Initial program 96.3%

        \[\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. Step-by-step derivation
        1. associate-+l+96.3%

          \[\leadsto \color{blue}{\left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{y + 1} - \sqrt{y}\right)\right) + \left(\left(\sqrt{z + 1} - \sqrt{z}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)\right)} \]
        2. associate-+l-82.5%

          \[\leadsto \color{blue}{\left(\sqrt{x + 1} - \left(\sqrt{x} - \left(\sqrt{y + 1} - \sqrt{y}\right)\right)\right)} + \left(\left(\sqrt{z + 1} - \sqrt{z}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)\right) \]
        3. associate-+l-96.3%

          \[\leadsto \color{blue}{\left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{y + 1} - \sqrt{y}\right)\right)} + \left(\left(\sqrt{z + 1} - \sqrt{z}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)\right) \]
        4. +-commutative96.3%

          \[\leadsto \left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{\color{blue}{1 + y}} - \sqrt{y}\right)\right) + \left(\left(\sqrt{z + 1} - \sqrt{z}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)\right) \]
        5. +-commutative96.3%

          \[\leadsto \left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{1 + y} - \sqrt{y}\right)\right) + \left(\left(\sqrt{\color{blue}{1 + z}} - \sqrt{z}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)\right) \]
        6. +-commutative96.3%

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

        \[\leadsto \color{blue}{\left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{1 + y} - \sqrt{y}\right)\right) + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\sqrt{1 + t} - \sqrt{t}\right)\right)} \]
      4. Add Preprocessing
      5. Taylor expanded in y around 0 15.5%

        \[\leadsto \color{blue}{\left(1 + \left(\sqrt{1 + t} + \left(\sqrt{1 + x} + \sqrt{1 + z}\right)\right)\right) - \left(\sqrt{t} + \left(\sqrt{x} + \left(\sqrt{y} + \sqrt{z}\right)\right)\right)} \]
      6. Step-by-step derivation
        1. associate-+r+15.5%

          \[\leadsto \color{blue}{\left(\left(1 + \sqrt{1 + t}\right) + \left(\sqrt{1 + x} + \sqrt{1 + z}\right)\right)} - \left(\sqrt{t} + \left(\sqrt{x} + \left(\sqrt{y} + \sqrt{z}\right)\right)\right) \]
        2. +-commutative15.5%

          \[\leadsto \left(\left(1 + \sqrt{1 + t}\right) + \color{blue}{\left(\sqrt{1 + z} + \sqrt{1 + x}\right)}\right) - \left(\sqrt{t} + \left(\sqrt{x} + \left(\sqrt{y} + \sqrt{z}\right)\right)\right) \]
      7. Simplified15.5%

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

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

      if 7.2e14 < t

      1. Initial program 91.2%

        \[\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. Step-by-step derivation
        1. associate-+l+91.2%

          \[\leadsto \color{blue}{\left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{y + 1} - \sqrt{y}\right)\right) + \left(\left(\sqrt{z + 1} - \sqrt{z}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)\right)} \]
        2. associate-+l+91.2%

          \[\leadsto \color{blue}{\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\left(\sqrt{y + 1} - \sqrt{y}\right) + \left(\left(\sqrt{z + 1} - \sqrt{z}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)\right)\right)} \]
        3. +-commutative91.2%

          \[\leadsto \left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\left(\sqrt{\color{blue}{1 + y}} - \sqrt{y}\right) + \left(\left(\sqrt{z + 1} - \sqrt{z}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)\right)\right) \]
        4. +-commutative91.2%

          \[\leadsto \left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\left(\sqrt{1 + y} - \sqrt{y}\right) + \color{blue}{\left(\left(\sqrt{t + 1} - \sqrt{t}\right) + \left(\sqrt{z + 1} - \sqrt{z}\right)\right)}\right) \]
        5. associate-+l-50.7%

          \[\leadsto \left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\left(\sqrt{1 + y} - \sqrt{y}\right) + \color{blue}{\left(\sqrt{t + 1} - \left(\sqrt{t} - \left(\sqrt{z + 1} - \sqrt{z}\right)\right)\right)}\right) \]
        6. +-commutative50.7%

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

          \[\leadsto \left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\left(\sqrt{1 + y} - \sqrt{y}\right) + \left(\sqrt{1 + t} - \left(\sqrt{t} - \left(\sqrt{\color{blue}{1 + z}} - \sqrt{z}\right)\right)\right)\right) \]
      3. Simplified50.7%

        \[\leadsto \color{blue}{\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\left(\sqrt{1 + y} - \sqrt{y}\right) + \left(\sqrt{1 + t} - \left(\sqrt{t} - \left(\sqrt{1 + z} - \sqrt{z}\right)\right)\right)\right)} \]
      4. Add Preprocessing
      5. Step-by-step derivation
        1. flip--50.8%

          \[\leadsto \left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\color{blue}{\frac{\sqrt{1 + y} \cdot \sqrt{1 + y} - \sqrt{y} \cdot \sqrt{y}}{\sqrt{1 + y} + \sqrt{y}}} + \left(\sqrt{1 + t} - \left(\sqrt{t} - \left(\sqrt{1 + z} - \sqrt{z}\right)\right)\right)\right) \]
        2. add-sqr-sqrt44.0%

          \[\leadsto \left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\frac{\color{blue}{\left(1 + y\right)} - \sqrt{y} \cdot \sqrt{y}}{\sqrt{1 + y} + \sqrt{y}} + \left(\sqrt{1 + t} - \left(\sqrt{t} - \left(\sqrt{1 + z} - \sqrt{z}\right)\right)\right)\right) \]
        3. add-sqr-sqrt51.2%

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

        \[\leadsto \left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\color{blue}{\frac{\left(1 + y\right) - y}{\sqrt{1 + y} + \sqrt{y}}} + \left(\sqrt{1 + t} - \left(\sqrt{t} - \left(\sqrt{1 + z} - \sqrt{z}\right)\right)\right)\right) \]
      7. Step-by-step derivation
        1. associate--l+53.7%

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

          \[\leadsto \left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\frac{1 + \color{blue}{0}}{\sqrt{1 + y} + \sqrt{y}} + \left(\sqrt{1 + t} - \left(\sqrt{t} - \left(\sqrt{1 + z} - \sqrt{z}\right)\right)\right)\right) \]
        3. metadata-eval53.7%

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

        \[\leadsto \left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\color{blue}{\frac{1}{\sqrt{1 + y} + \sqrt{y}}} + \left(\sqrt{1 + t} - \left(\sqrt{t} - \left(\sqrt{1 + z} - \sqrt{z}\right)\right)\right)\right) \]
      9. Taylor expanded in t around inf 93.9%

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

      \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq 7.2 \cdot 10^{+14}:\\ \;\;\;\;\left(2 + \left(\sqrt{1 + z} + \sqrt{1 + t}\right)\right) - \left(\sqrt{t} + \left(\sqrt{x} + \left(\sqrt{y} + \sqrt{z}\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \frac{1}{\sqrt{y} + \sqrt{1 + y}}\right)\\ \end{array} \]
    5. Add Preprocessing

    Alternative 9: 91.8% accurate, 1.3× speedup?

    \[\begin{array}{l} [x, y, z, t] = \mathsf{sort}([x, y, z, t])\\ \\ \begin{array}{l} t_1 := \sqrt{1 + z}\\ \mathbf{if}\;t \leq 7.2 \cdot 10^{+14}:\\ \;\;\;\;\left(2 + \left(t\_1 + \sqrt{1 + t}\right)\right) - \left(\sqrt{t} + \left(\sqrt{x} + \left(\sqrt{y} + \sqrt{z}\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\left(t\_1 - \sqrt{z}\right) + \left(\sqrt{1 + y} - \sqrt{y}\right)\right)\\ \end{array} \end{array} \]
    NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
    (FPCore (x y z t)
     :precision binary64
     (let* ((t_1 (sqrt (+ 1.0 z))))
       (if (<= t 7.2e+14)
         (-
          (+ 2.0 (+ t_1 (sqrt (+ 1.0 t))))
          (+ (sqrt t) (+ (sqrt x) (+ (sqrt y) (sqrt z)))))
         (+
          (- (sqrt (+ x 1.0)) (sqrt x))
          (+ (- t_1 (sqrt z)) (- (sqrt (+ 1.0 y)) (sqrt y)))))))
    assert(x < y && y < z && z < t);
    double code(double x, double y, double z, double t) {
    	double t_1 = sqrt((1.0 + z));
    	double tmp;
    	if (t <= 7.2e+14) {
    		tmp = (2.0 + (t_1 + sqrt((1.0 + t)))) - (sqrt(t) + (sqrt(x) + (sqrt(y) + sqrt(z))));
    	} else {
    		tmp = (sqrt((x + 1.0)) - sqrt(x)) + ((t_1 - sqrt(z)) + (sqrt((1.0 + y)) - sqrt(y)));
    	}
    	return tmp;
    }
    
    NOTE: x, y, z, and t should be sorted in increasing order before calling this 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) :: tmp
        t_1 = sqrt((1.0d0 + z))
        if (t <= 7.2d+14) then
            tmp = (2.0d0 + (t_1 + sqrt((1.0d0 + t)))) - (sqrt(t) + (sqrt(x) + (sqrt(y) + sqrt(z))))
        else
            tmp = (sqrt((x + 1.0d0)) - sqrt(x)) + ((t_1 - sqrt(z)) + (sqrt((1.0d0 + y)) - sqrt(y)))
        end if
        code = tmp
    end function
    
    assert x < y && y < z && z < t;
    public static double code(double x, double y, double z, double t) {
    	double t_1 = Math.sqrt((1.0 + z));
    	double tmp;
    	if (t <= 7.2e+14) {
    		tmp = (2.0 + (t_1 + Math.sqrt((1.0 + t)))) - (Math.sqrt(t) + (Math.sqrt(x) + (Math.sqrt(y) + Math.sqrt(z))));
    	} else {
    		tmp = (Math.sqrt((x + 1.0)) - Math.sqrt(x)) + ((t_1 - Math.sqrt(z)) + (Math.sqrt((1.0 + y)) - Math.sqrt(y)));
    	}
    	return tmp;
    }
    
    [x, y, z, t] = sort([x, y, z, t])
    def code(x, y, z, t):
    	t_1 = math.sqrt((1.0 + z))
    	tmp = 0
    	if t <= 7.2e+14:
    		tmp = (2.0 + (t_1 + math.sqrt((1.0 + t)))) - (math.sqrt(t) + (math.sqrt(x) + (math.sqrt(y) + math.sqrt(z))))
    	else:
    		tmp = (math.sqrt((x + 1.0)) - math.sqrt(x)) + ((t_1 - math.sqrt(z)) + (math.sqrt((1.0 + y)) - math.sqrt(y)))
    	return tmp
    
    x, y, z, t = sort([x, y, z, t])
    function code(x, y, z, t)
    	t_1 = sqrt(Float64(1.0 + z))
    	tmp = 0.0
    	if (t <= 7.2e+14)
    		tmp = Float64(Float64(2.0 + Float64(t_1 + sqrt(Float64(1.0 + t)))) - Float64(sqrt(t) + Float64(sqrt(x) + Float64(sqrt(y) + sqrt(z)))));
    	else
    		tmp = Float64(Float64(sqrt(Float64(x + 1.0)) - sqrt(x)) + Float64(Float64(t_1 - sqrt(z)) + Float64(sqrt(Float64(1.0 + y)) - sqrt(y))));
    	end
    	return tmp
    end
    
    x, y, z, t = num2cell(sort([x, y, z, t])){:}
    function tmp_2 = code(x, y, z, t)
    	t_1 = sqrt((1.0 + z));
    	tmp = 0.0;
    	if (t <= 7.2e+14)
    		tmp = (2.0 + (t_1 + sqrt((1.0 + t)))) - (sqrt(t) + (sqrt(x) + (sqrt(y) + sqrt(z))));
    	else
    		tmp = (sqrt((x + 1.0)) - sqrt(x)) + ((t_1 - sqrt(z)) + (sqrt((1.0 + y)) - sqrt(y)));
    	end
    	tmp_2 = tmp;
    end
    
    NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
    code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t, 7.2e+14], N[(N[(2.0 + N[(t$95$1 + N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[t], $MachinePrecision] + N[(N[Sqrt[x], $MachinePrecision] + N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$1 - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
    
    \begin{array}{l}
    [x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
    \\
    \begin{array}{l}
    t_1 := \sqrt{1 + z}\\
    \mathbf{if}\;t \leq 7.2 \cdot 10^{+14}:\\
    \;\;\;\;\left(2 + \left(t\_1 + \sqrt{1 + t}\right)\right) - \left(\sqrt{t} + \left(\sqrt{x} + \left(\sqrt{y} + \sqrt{z}\right)\right)\right)\\
    
    \mathbf{else}:\\
    \;\;\;\;\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\left(t\_1 - \sqrt{z}\right) + \left(\sqrt{1 + y} - \sqrt{y}\right)\right)\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if t < 7.2e14

      1. Initial program 96.3%

        \[\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. Step-by-step derivation
        1. associate-+l+96.3%

          \[\leadsto \color{blue}{\left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{y + 1} - \sqrt{y}\right)\right) + \left(\left(\sqrt{z + 1} - \sqrt{z}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)\right)} \]
        2. associate-+l-82.5%

          \[\leadsto \color{blue}{\left(\sqrt{x + 1} - \left(\sqrt{x} - \left(\sqrt{y + 1} - \sqrt{y}\right)\right)\right)} + \left(\left(\sqrt{z + 1} - \sqrt{z}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)\right) \]
        3. associate-+l-96.3%

          \[\leadsto \color{blue}{\left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{y + 1} - \sqrt{y}\right)\right)} + \left(\left(\sqrt{z + 1} - \sqrt{z}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)\right) \]
        4. +-commutative96.3%

          \[\leadsto \left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{\color{blue}{1 + y}} - \sqrt{y}\right)\right) + \left(\left(\sqrt{z + 1} - \sqrt{z}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)\right) \]
        5. +-commutative96.3%

          \[\leadsto \left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{1 + y} - \sqrt{y}\right)\right) + \left(\left(\sqrt{\color{blue}{1 + z}} - \sqrt{z}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)\right) \]
        6. +-commutative96.3%

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

        \[\leadsto \color{blue}{\left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{1 + y} - \sqrt{y}\right)\right) + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\sqrt{1 + t} - \sqrt{t}\right)\right)} \]
      4. Add Preprocessing
      5. Taylor expanded in y around 0 15.5%

        \[\leadsto \color{blue}{\left(1 + \left(\sqrt{1 + t} + \left(\sqrt{1 + x} + \sqrt{1 + z}\right)\right)\right) - \left(\sqrt{t} + \left(\sqrt{x} + \left(\sqrt{y} + \sqrt{z}\right)\right)\right)} \]
      6. Step-by-step derivation
        1. associate-+r+15.5%

          \[\leadsto \color{blue}{\left(\left(1 + \sqrt{1 + t}\right) + \left(\sqrt{1 + x} + \sqrt{1 + z}\right)\right)} - \left(\sqrt{t} + \left(\sqrt{x} + \left(\sqrt{y} + \sqrt{z}\right)\right)\right) \]
        2. +-commutative15.5%

          \[\leadsto \left(\left(1 + \sqrt{1 + t}\right) + \color{blue}{\left(\sqrt{1 + z} + \sqrt{1 + x}\right)}\right) - \left(\sqrt{t} + \left(\sqrt{x} + \left(\sqrt{y} + \sqrt{z}\right)\right)\right) \]
      7. Simplified15.5%

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

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

      if 7.2e14 < t

      1. Initial program 91.2%

        \[\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. Step-by-step derivation
        1. associate-+l+91.2%

          \[\leadsto \color{blue}{\left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{y + 1} - \sqrt{y}\right)\right) + \left(\left(\sqrt{z + 1} - \sqrt{z}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)\right)} \]
        2. associate-+l+91.2%

          \[\leadsto \color{blue}{\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\left(\sqrt{y + 1} - \sqrt{y}\right) + \left(\left(\sqrt{z + 1} - \sqrt{z}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)\right)\right)} \]
        3. +-commutative91.2%

          \[\leadsto \left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\left(\sqrt{\color{blue}{1 + y}} - \sqrt{y}\right) + \left(\left(\sqrt{z + 1} - \sqrt{z}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)\right)\right) \]
        4. +-commutative91.2%

          \[\leadsto \left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\left(\sqrt{1 + y} - \sqrt{y}\right) + \color{blue}{\left(\left(\sqrt{t + 1} - \sqrt{t}\right) + \left(\sqrt{z + 1} - \sqrt{z}\right)\right)}\right) \]
        5. associate-+l-50.7%

          \[\leadsto \left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\left(\sqrt{1 + y} - \sqrt{y}\right) + \color{blue}{\left(\sqrt{t + 1} - \left(\sqrt{t} - \left(\sqrt{z + 1} - \sqrt{z}\right)\right)\right)}\right) \]
        6. +-commutative50.7%

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

          \[\leadsto \left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\left(\sqrt{1 + y} - \sqrt{y}\right) + \left(\sqrt{1 + t} - \left(\sqrt{t} - \left(\sqrt{\color{blue}{1 + z}} - \sqrt{z}\right)\right)\right)\right) \]
      3. Simplified50.7%

        \[\leadsto \color{blue}{\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\left(\sqrt{1 + y} - \sqrt{y}\right) + \left(\sqrt{1 + t} - \left(\sqrt{t} - \left(\sqrt{1 + z} - \sqrt{z}\right)\right)\right)\right)} \]
      4. Add Preprocessing
      5. Taylor expanded in t around inf 91.2%

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

      \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq 7.2 \cdot 10^{+14}:\\ \;\;\;\;\left(2 + \left(\sqrt{1 + z} + \sqrt{1 + t}\right)\right) - \left(\sqrt{t} + \left(\sqrt{x} + \left(\sqrt{y} + \sqrt{z}\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\sqrt{1 + y} - \sqrt{y}\right)\right)\\ \end{array} \]
    5. Add Preprocessing

    Alternative 10: 86.4% accurate, 1.6× speedup?

    \[\begin{array}{l} [x, y, z, t] = \mathsf{sort}([x, y, z, t])\\ \\ \begin{array}{l} t_1 := \sqrt{x} + \sqrt{y}\\ \mathbf{if}\;z \leq 7400000:\\ \;\;\;\;2 + \left(\mathsf{hypot}\left(1, \sqrt{z}\right) - \left(\sqrt{z} + t\_1\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\sqrt{x + 1} + \left(\left(\sqrt{1 + y} + 0.5 \cdot \sqrt{\frac{1}{z}}\right) - t\_1\right)\\ \end{array} \end{array} \]
    NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
    (FPCore (x y z t)
     :precision binary64
     (let* ((t_1 (+ (sqrt x) (sqrt y))))
       (if (<= z 7400000.0)
         (+ 2.0 (- (hypot 1.0 (sqrt z)) (+ (sqrt z) t_1)))
         (+
          (sqrt (+ x 1.0))
          (- (+ (sqrt (+ 1.0 y)) (* 0.5 (sqrt (/ 1.0 z)))) t_1)))))
    assert(x < y && y < z && z < t);
    double code(double x, double y, double z, double t) {
    	double t_1 = sqrt(x) + sqrt(y);
    	double tmp;
    	if (z <= 7400000.0) {
    		tmp = 2.0 + (hypot(1.0, sqrt(z)) - (sqrt(z) + t_1));
    	} else {
    		tmp = sqrt((x + 1.0)) + ((sqrt((1.0 + y)) + (0.5 * sqrt((1.0 / z)))) - t_1);
    	}
    	return tmp;
    }
    
    assert x < y && y < z && z < t;
    public static double code(double x, double y, double z, double t) {
    	double t_1 = Math.sqrt(x) + Math.sqrt(y);
    	double tmp;
    	if (z <= 7400000.0) {
    		tmp = 2.0 + (Math.hypot(1.0, Math.sqrt(z)) - (Math.sqrt(z) + t_1));
    	} else {
    		tmp = Math.sqrt((x + 1.0)) + ((Math.sqrt((1.0 + y)) + (0.5 * Math.sqrt((1.0 / z)))) - t_1);
    	}
    	return tmp;
    }
    
    [x, y, z, t] = sort([x, y, z, t])
    def code(x, y, z, t):
    	t_1 = math.sqrt(x) + math.sqrt(y)
    	tmp = 0
    	if z <= 7400000.0:
    		tmp = 2.0 + (math.hypot(1.0, math.sqrt(z)) - (math.sqrt(z) + t_1))
    	else:
    		tmp = math.sqrt((x + 1.0)) + ((math.sqrt((1.0 + y)) + (0.5 * math.sqrt((1.0 / z)))) - t_1)
    	return tmp
    
    x, y, z, t = sort([x, y, z, t])
    function code(x, y, z, t)
    	t_1 = Float64(sqrt(x) + sqrt(y))
    	tmp = 0.0
    	if (z <= 7400000.0)
    		tmp = Float64(2.0 + Float64(hypot(1.0, sqrt(z)) - Float64(sqrt(z) + t_1)));
    	else
    		tmp = Float64(sqrt(Float64(x + 1.0)) + Float64(Float64(sqrt(Float64(1.0 + y)) + Float64(0.5 * sqrt(Float64(1.0 / z)))) - t_1));
    	end
    	return tmp
    end
    
    x, y, z, t = num2cell(sort([x, y, z, t])){:}
    function tmp_2 = code(x, y, z, t)
    	t_1 = sqrt(x) + sqrt(y);
    	tmp = 0.0;
    	if (z <= 7400000.0)
    		tmp = 2.0 + (hypot(1.0, sqrt(z)) - (sqrt(z) + t_1));
    	else
    		tmp = sqrt((x + 1.0)) + ((sqrt((1.0 + y)) + (0.5 * sqrt((1.0 / z)))) - t_1);
    	end
    	tmp_2 = tmp;
    end
    
    NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
    code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, 7400000.0], N[(2.0 + N[(N[Sqrt[1.0 ^ 2 + N[Sqrt[z], $MachinePrecision] ^ 2], $MachinePrecision] - N[(N[Sqrt[z], $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision] + N[(N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] + N[(0.5 * N[Sqrt[N[(1.0 / z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]), $MachinePrecision]]]
    
    \begin{array}{l}
    [x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
    \\
    \begin{array}{l}
    t_1 := \sqrt{x} + \sqrt{y}\\
    \mathbf{if}\;z \leq 7400000:\\
    \;\;\;\;2 + \left(\mathsf{hypot}\left(1, \sqrt{z}\right) - \left(\sqrt{z} + t\_1\right)\right)\\
    
    \mathbf{else}:\\
    \;\;\;\;\sqrt{x + 1} + \left(\left(\sqrt{1 + y} + 0.5 \cdot \sqrt{\frac{1}{z}}\right) - t\_1\right)\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if z < 7.4e6

      1. Initial program 96.5%

        \[\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. Step-by-step derivation
        1. associate-+l+96.5%

          \[\leadsto \color{blue}{\left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{y + 1} - \sqrt{y}\right)\right) + \left(\left(\sqrt{z + 1} - \sqrt{z}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)\right)} \]
        2. associate-+l-79.5%

          \[\leadsto \color{blue}{\left(\sqrt{x + 1} - \left(\sqrt{x} - \left(\sqrt{y + 1} - \sqrt{y}\right)\right)\right)} + \left(\left(\sqrt{z + 1} - \sqrt{z}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)\right) \]
        3. associate-+l-96.5%

          \[\leadsto \color{blue}{\left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{y + 1} - \sqrt{y}\right)\right)} + \left(\left(\sqrt{z + 1} - \sqrt{z}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)\right) \]
        4. +-commutative96.5%

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

          \[\leadsto \left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{1 + y} - \sqrt{y}\right)\right) + \left(\left(\sqrt{\color{blue}{1 + z}} - \sqrt{z}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)\right) \]
        6. +-commutative96.5%

          \[\leadsto \left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{1 + y} - \sqrt{y}\right)\right) + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\sqrt{\color{blue}{1 + t}} - \sqrt{t}\right)\right) \]
      3. Simplified96.5%

        \[\leadsto \color{blue}{\left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{1 + y} - \sqrt{y}\right)\right) + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\sqrt{1 + t} - \sqrt{t}\right)\right)} \]
      4. Add Preprocessing
      5. Taylor expanded in t around inf 19.5%

        \[\leadsto \color{blue}{\left(\sqrt{1 + x} + \left(\sqrt{1 + y} + \sqrt{1 + z}\right)\right) - \left(\sqrt{x} + \left(\sqrt{y} + \sqrt{z}\right)\right)} \]
      6. Step-by-step derivation
        1. associate--l+23.4%

          \[\leadsto \color{blue}{\sqrt{1 + x} + \left(\left(\sqrt{1 + y} + \sqrt{1 + z}\right) - \left(\sqrt{x} + \left(\sqrt{y} + \sqrt{z}\right)\right)\right)} \]
      7. Simplified23.4%

        \[\leadsto \color{blue}{\sqrt{1 + x} + \left(\left(\sqrt{1 + y} + \sqrt{1 + z}\right) - \left(\sqrt{x} + \left(\sqrt{y} + \sqrt{z}\right)\right)\right)} \]
      8. Taylor expanded in y around 0 17.6%

        \[\leadsto \color{blue}{\left(1 + \left(\sqrt{1 + x} + \sqrt{1 + z}\right)\right) - \left(\sqrt{x} + \left(\sqrt{y} + \sqrt{z}\right)\right)} \]
      9. Step-by-step derivation
        1. associate--l+26.6%

          \[\leadsto \color{blue}{1 + \left(\left(\sqrt{1 + x} + \sqrt{1 + z}\right) - \left(\sqrt{x} + \left(\sqrt{y} + \sqrt{z}\right)\right)\right)} \]
        2. +-commutative26.6%

          \[\leadsto 1 + \left(\color{blue}{\left(\sqrt{1 + z} + \sqrt{1 + x}\right)} - \left(\sqrt{x} + \left(\sqrt{y} + \sqrt{z}\right)\right)\right) \]
        3. +-commutative26.6%

          \[\leadsto 1 + \left(\left(\sqrt{1 + z} + \sqrt{1 + x}\right) - \left(\sqrt{x} + \color{blue}{\left(\sqrt{z} + \sqrt{y}\right)}\right)\right) \]
      10. Simplified26.6%

        \[\leadsto \color{blue}{1 + \left(\left(\sqrt{1 + z} + \sqrt{1 + x}\right) - \left(\sqrt{x} + \left(\sqrt{z} + \sqrt{y}\right)\right)\right)} \]
      11. Taylor expanded in x around 0 15.6%

        \[\leadsto \color{blue}{\left(2 + \sqrt{1 + z}\right) - \left(\sqrt{x} + \left(\sqrt{y} + \sqrt{z}\right)\right)} \]
      12. Step-by-step derivation
        1. associate--l+15.6%

          \[\leadsto \color{blue}{2 + \left(\sqrt{1 + z} - \left(\sqrt{x} + \left(\sqrt{y} + \sqrt{z}\right)\right)\right)} \]
        2. metadata-eval15.6%

          \[\leadsto 2 + \left(\sqrt{\color{blue}{1 \cdot 1} + z} - \left(\sqrt{x} + \left(\sqrt{y} + \sqrt{z}\right)\right)\right) \]
        3. rem-square-sqrt15.6%

          \[\leadsto 2 + \left(\sqrt{1 \cdot 1 + \color{blue}{\sqrt{z} \cdot \sqrt{z}}} - \left(\sqrt{x} + \left(\sqrt{y} + \sqrt{z}\right)\right)\right) \]
        4. hypot-undefine15.6%

          \[\leadsto 2 + \left(\color{blue}{\mathsf{hypot}\left(1, \sqrt{z}\right)} - \left(\sqrt{x} + \left(\sqrt{y} + \sqrt{z}\right)\right)\right) \]
        5. associate-+r+15.6%

          \[\leadsto 2 + \left(\mathsf{hypot}\left(1, \sqrt{z}\right) - \color{blue}{\left(\left(\sqrt{x} + \sqrt{y}\right) + \sqrt{z}\right)}\right) \]
      13. Simplified15.6%

        \[\leadsto \color{blue}{2 + \left(\mathsf{hypot}\left(1, \sqrt{z}\right) - \left(\left(\sqrt{x} + \sqrt{y}\right) + \sqrt{z}\right)\right)} \]

      if 7.4e6 < z

      1. Initial program 91.0%

        \[\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. Step-by-step derivation
        1. associate-+l+91.0%

          \[\leadsto \color{blue}{\left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{y + 1} - \sqrt{y}\right)\right) + \left(\left(\sqrt{z + 1} - \sqrt{z}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)\right)} \]
        2. associate-+l-74.1%

          \[\leadsto \color{blue}{\left(\sqrt{x + 1} - \left(\sqrt{x} - \left(\sqrt{y + 1} - \sqrt{y}\right)\right)\right)} + \left(\left(\sqrt{z + 1} - \sqrt{z}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)\right) \]
        3. associate-+l-91.0%

          \[\leadsto \color{blue}{\left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{y + 1} - \sqrt{y}\right)\right)} + \left(\left(\sqrt{z + 1} - \sqrt{z}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)\right) \]
        4. +-commutative91.0%

          \[\leadsto \left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{\color{blue}{1 + y}} - \sqrt{y}\right)\right) + \left(\left(\sqrt{z + 1} - \sqrt{z}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)\right) \]
        5. +-commutative91.0%

          \[\leadsto \left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{1 + y} - \sqrt{y}\right)\right) + \left(\left(\sqrt{\color{blue}{1 + z}} - \sqrt{z}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)\right) \]
        6. +-commutative91.0%

          \[\leadsto \left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{1 + y} - \sqrt{y}\right)\right) + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\sqrt{\color{blue}{1 + t}} - \sqrt{t}\right)\right) \]
      3. Simplified91.0%

        \[\leadsto \color{blue}{\left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{1 + y} - \sqrt{y}\right)\right) + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\sqrt{1 + t} - \sqrt{t}\right)\right)} \]
      4. Add Preprocessing
      5. Taylor expanded in t around inf 3.3%

        \[\leadsto \color{blue}{\left(\sqrt{1 + x} + \left(\sqrt{1 + y} + \sqrt{1 + z}\right)\right) - \left(\sqrt{x} + \left(\sqrt{y} + \sqrt{z}\right)\right)} \]
      6. Step-by-step derivation
        1. associate--l+22.3%

          \[\leadsto \color{blue}{\sqrt{1 + x} + \left(\left(\sqrt{1 + y} + \sqrt{1 + z}\right) - \left(\sqrt{x} + \left(\sqrt{y} + \sqrt{z}\right)\right)\right)} \]
      7. Simplified22.3%

        \[\leadsto \color{blue}{\sqrt{1 + x} + \left(\left(\sqrt{1 + y} + \sqrt{1 + z}\right) - \left(\sqrt{x} + \left(\sqrt{y} + \sqrt{z}\right)\right)\right)} \]
      8. Taylor expanded in z around inf 35.1%

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

      \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq 7400000:\\ \;\;\;\;2 + \left(\mathsf{hypot}\left(1, \sqrt{z}\right) - \left(\sqrt{z} + \left(\sqrt{x} + \sqrt{y}\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\sqrt{x + 1} + \left(\left(\sqrt{1 + y} + 0.5 \cdot \sqrt{\frac{1}{z}}\right) - \left(\sqrt{x} + \sqrt{y}\right)\right)\\ \end{array} \]
    5. Add Preprocessing

    Alternative 11: 85.2% accurate, 1.6× speedup?

    \[\begin{array}{l} [x, y, z, t] = \mathsf{sort}([x, y, z, t])\\ \\ \begin{array}{l} t_1 := \sqrt{x} + \sqrt{y}\\ \mathbf{if}\;z \leq 5.8 \cdot 10^{+14}:\\ \;\;\;\;2 + \left(\mathsf{hypot}\left(1, \sqrt{z}\right) - \left(\sqrt{z} + t\_1\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\sqrt{1 + y} - t\_1\right) + \sqrt{x + 1}\\ \end{array} \end{array} \]
    NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
    (FPCore (x y z t)
     :precision binary64
     (let* ((t_1 (+ (sqrt x) (sqrt y))))
       (if (<= z 5.8e+14)
         (+ 2.0 (- (hypot 1.0 (sqrt z)) (+ (sqrt z) t_1)))
         (+ (- (sqrt (+ 1.0 y)) t_1) (sqrt (+ x 1.0))))))
    assert(x < y && y < z && z < t);
    double code(double x, double y, double z, double t) {
    	double t_1 = sqrt(x) + sqrt(y);
    	double tmp;
    	if (z <= 5.8e+14) {
    		tmp = 2.0 + (hypot(1.0, sqrt(z)) - (sqrt(z) + t_1));
    	} else {
    		tmp = (sqrt((1.0 + y)) - t_1) + sqrt((x + 1.0));
    	}
    	return tmp;
    }
    
    assert x < y && y < z && z < t;
    public static double code(double x, double y, double z, double t) {
    	double t_1 = Math.sqrt(x) + Math.sqrt(y);
    	double tmp;
    	if (z <= 5.8e+14) {
    		tmp = 2.0 + (Math.hypot(1.0, Math.sqrt(z)) - (Math.sqrt(z) + t_1));
    	} else {
    		tmp = (Math.sqrt((1.0 + y)) - t_1) + Math.sqrt((x + 1.0));
    	}
    	return tmp;
    }
    
    [x, y, z, t] = sort([x, y, z, t])
    def code(x, y, z, t):
    	t_1 = math.sqrt(x) + math.sqrt(y)
    	tmp = 0
    	if z <= 5.8e+14:
    		tmp = 2.0 + (math.hypot(1.0, math.sqrt(z)) - (math.sqrt(z) + t_1))
    	else:
    		tmp = (math.sqrt((1.0 + y)) - t_1) + math.sqrt((x + 1.0))
    	return tmp
    
    x, y, z, t = sort([x, y, z, t])
    function code(x, y, z, t)
    	t_1 = Float64(sqrt(x) + sqrt(y))
    	tmp = 0.0
    	if (z <= 5.8e+14)
    		tmp = Float64(2.0 + Float64(hypot(1.0, sqrt(z)) - Float64(sqrt(z) + t_1)));
    	else
    		tmp = Float64(Float64(sqrt(Float64(1.0 + y)) - t_1) + sqrt(Float64(x + 1.0)));
    	end
    	return tmp
    end
    
    x, y, z, t = num2cell(sort([x, y, z, t])){:}
    function tmp_2 = code(x, y, z, t)
    	t_1 = sqrt(x) + sqrt(y);
    	tmp = 0.0;
    	if (z <= 5.8e+14)
    		tmp = 2.0 + (hypot(1.0, sqrt(z)) - (sqrt(z) + t_1));
    	else
    		tmp = (sqrt((1.0 + y)) - t_1) + sqrt((x + 1.0));
    	end
    	tmp_2 = tmp;
    end
    
    NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
    code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, 5.8e+14], N[(2.0 + N[(N[Sqrt[1.0 ^ 2 + N[Sqrt[z], $MachinePrecision] ^ 2], $MachinePrecision] - N[(N[Sqrt[z], $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] - t$95$1), $MachinePrecision] + N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
    
    \begin{array}{l}
    [x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
    \\
    \begin{array}{l}
    t_1 := \sqrt{x} + \sqrt{y}\\
    \mathbf{if}\;z \leq 5.8 \cdot 10^{+14}:\\
    \;\;\;\;2 + \left(\mathsf{hypot}\left(1, \sqrt{z}\right) - \left(\sqrt{z} + t\_1\right)\right)\\
    
    \mathbf{else}:\\
    \;\;\;\;\left(\sqrt{1 + y} - t\_1\right) + \sqrt{x + 1}\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if z < 5.8e14

      1. Initial program 96.2%

        \[\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. Step-by-step derivation
        1. associate-+l+96.2%

          \[\leadsto \color{blue}{\left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{y + 1} - \sqrt{y}\right)\right) + \left(\left(\sqrt{z + 1} - \sqrt{z}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)\right)} \]
        2. associate-+l-79.4%

          \[\leadsto \color{blue}{\left(\sqrt{x + 1} - \left(\sqrt{x} - \left(\sqrt{y + 1} - \sqrt{y}\right)\right)\right)} + \left(\left(\sqrt{z + 1} - \sqrt{z}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)\right) \]
        3. associate-+l-96.2%

          \[\leadsto \color{blue}{\left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{y + 1} - \sqrt{y}\right)\right)} + \left(\left(\sqrt{z + 1} - \sqrt{z}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)\right) \]
        4. +-commutative96.2%

          \[\leadsto \left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{\color{blue}{1 + y}} - \sqrt{y}\right)\right) + \left(\left(\sqrt{z + 1} - \sqrt{z}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)\right) \]
        5. +-commutative96.2%

          \[\leadsto \left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{1 + y} - \sqrt{y}\right)\right) + \left(\left(\sqrt{\color{blue}{1 + z}} - \sqrt{z}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)\right) \]
        6. +-commutative96.2%

          \[\leadsto \left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{1 + y} - \sqrt{y}\right)\right) + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\sqrt{\color{blue}{1 + t}} - \sqrt{t}\right)\right) \]
      3. Simplified96.2%

        \[\leadsto \color{blue}{\left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{1 + y} - \sqrt{y}\right)\right) + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\sqrt{1 + t} - \sqrt{t}\right)\right)} \]
      4. Add Preprocessing
      5. Taylor expanded in t around inf 19.2%

        \[\leadsto \color{blue}{\left(\sqrt{1 + x} + \left(\sqrt{1 + y} + \sqrt{1 + z}\right)\right) - \left(\sqrt{x} + \left(\sqrt{y} + \sqrt{z}\right)\right)} \]
      6. Step-by-step derivation
        1. associate--l+23.2%

          \[\leadsto \color{blue}{\sqrt{1 + x} + \left(\left(\sqrt{1 + y} + \sqrt{1 + z}\right) - \left(\sqrt{x} + \left(\sqrt{y} + \sqrt{z}\right)\right)\right)} \]
      7. Simplified23.2%

        \[\leadsto \color{blue}{\sqrt{1 + x} + \left(\left(\sqrt{1 + y} + \sqrt{1 + z}\right) - \left(\sqrt{x} + \left(\sqrt{y} + \sqrt{z}\right)\right)\right)} \]
      8. Taylor expanded in y around 0 17.3%

        \[\leadsto \color{blue}{\left(1 + \left(\sqrt{1 + x} + \sqrt{1 + z}\right)\right) - \left(\sqrt{x} + \left(\sqrt{y} + \sqrt{z}\right)\right)} \]
      9. Step-by-step derivation
        1. associate--l+26.2%

          \[\leadsto \color{blue}{1 + \left(\left(\sqrt{1 + x} + \sqrt{1 + z}\right) - \left(\sqrt{x} + \left(\sqrt{y} + \sqrt{z}\right)\right)\right)} \]
        2. +-commutative26.2%

          \[\leadsto 1 + \left(\color{blue}{\left(\sqrt{1 + z} + \sqrt{1 + x}\right)} - \left(\sqrt{x} + \left(\sqrt{y} + \sqrt{z}\right)\right)\right) \]
        3. +-commutative26.2%

          \[\leadsto 1 + \left(\left(\sqrt{1 + z} + \sqrt{1 + x}\right) - \left(\sqrt{x} + \color{blue}{\left(\sqrt{z} + \sqrt{y}\right)}\right)\right) \]
      10. Simplified26.2%

        \[\leadsto \color{blue}{1 + \left(\left(\sqrt{1 + z} + \sqrt{1 + x}\right) - \left(\sqrt{x} + \left(\sqrt{z} + \sqrt{y}\right)\right)\right)} \]
      11. Taylor expanded in x around 0 15.4%

        \[\leadsto \color{blue}{\left(2 + \sqrt{1 + z}\right) - \left(\sqrt{x} + \left(\sqrt{y} + \sqrt{z}\right)\right)} \]
      12. Step-by-step derivation
        1. associate--l+15.4%

          \[\leadsto \color{blue}{2 + \left(\sqrt{1 + z} - \left(\sqrt{x} + \left(\sqrt{y} + \sqrt{z}\right)\right)\right)} \]
        2. metadata-eval15.4%

          \[\leadsto 2 + \left(\sqrt{\color{blue}{1 \cdot 1} + z} - \left(\sqrt{x} + \left(\sqrt{y} + \sqrt{z}\right)\right)\right) \]
        3. rem-square-sqrt15.4%

          \[\leadsto 2 + \left(\sqrt{1 \cdot 1 + \color{blue}{\sqrt{z} \cdot \sqrt{z}}} - \left(\sqrt{x} + \left(\sqrt{y} + \sqrt{z}\right)\right)\right) \]
        4. hypot-undefine15.4%

          \[\leadsto 2 + \left(\color{blue}{\mathsf{hypot}\left(1, \sqrt{z}\right)} - \left(\sqrt{x} + \left(\sqrt{y} + \sqrt{z}\right)\right)\right) \]
        5. associate-+r+15.4%

          \[\leadsto 2 + \left(\mathsf{hypot}\left(1, \sqrt{z}\right) - \color{blue}{\left(\left(\sqrt{x} + \sqrt{y}\right) + \sqrt{z}\right)}\right) \]
      13. Simplified15.4%

        \[\leadsto \color{blue}{2 + \left(\mathsf{hypot}\left(1, \sqrt{z}\right) - \left(\left(\sqrt{x} + \sqrt{y}\right) + \sqrt{z}\right)\right)} \]

      if 5.8e14 < z

      1. Initial program 91.3%

        \[\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. Step-by-step derivation
        1. associate-+l+91.3%

          \[\leadsto \color{blue}{\left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{y + 1} - \sqrt{y}\right)\right) + \left(\left(\sqrt{z + 1} - \sqrt{z}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)\right)} \]
        2. associate-+l-74.1%

          \[\leadsto \color{blue}{\left(\sqrt{x + 1} - \left(\sqrt{x} - \left(\sqrt{y + 1} - \sqrt{y}\right)\right)\right)} + \left(\left(\sqrt{z + 1} - \sqrt{z}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)\right) \]
        3. associate-+l-91.3%

          \[\leadsto \color{blue}{\left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{y + 1} - \sqrt{y}\right)\right)} + \left(\left(\sqrt{z + 1} - \sqrt{z}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)\right) \]
        4. +-commutative91.3%

          \[\leadsto \left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{\color{blue}{1 + y}} - \sqrt{y}\right)\right) + \left(\left(\sqrt{z + 1} - \sqrt{z}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)\right) \]
        5. +-commutative91.3%

          \[\leadsto \left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{1 + y} - \sqrt{y}\right)\right) + \left(\left(\sqrt{\color{blue}{1 + z}} - \sqrt{z}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)\right) \]
        6. +-commutative91.3%

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

        \[\leadsto \color{blue}{\left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{1 + y} - \sqrt{y}\right)\right) + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\sqrt{1 + t} - \sqrt{t}\right)\right)} \]
      4. Add Preprocessing
      5. Taylor expanded in t around inf 3.3%

        \[\leadsto \color{blue}{\left(\sqrt{1 + x} + \left(\sqrt{1 + y} + \sqrt{1 + z}\right)\right) - \left(\sqrt{x} + \left(\sqrt{y} + \sqrt{z}\right)\right)} \]
      6. Step-by-step derivation
        1. associate--l+22.6%

          \[\leadsto \color{blue}{\sqrt{1 + x} + \left(\left(\sqrt{1 + y} + \sqrt{1 + z}\right) - \left(\sqrt{x} + \left(\sqrt{y} + \sqrt{z}\right)\right)\right)} \]
      7. Simplified22.6%

        \[\leadsto \color{blue}{\sqrt{1 + x} + \left(\left(\sqrt{1 + y} + \sqrt{1 + z}\right) - \left(\sqrt{x} + \left(\sqrt{y} + \sqrt{z}\right)\right)\right)} \]
      8. Taylor expanded in z around inf 23.4%

        \[\leadsto \color{blue}{\left(\sqrt{1 + x} + \sqrt{1 + y}\right) - \left(\sqrt{x} + \sqrt{y}\right)} \]
      9. Step-by-step derivation
        1. associate--l+35.6%

          \[\leadsto \color{blue}{\sqrt{1 + x} + \left(\sqrt{1 + y} - \left(\sqrt{x} + \sqrt{y}\right)\right)} \]
      10. Simplified35.6%

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

      \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq 5.8 \cdot 10^{+14}:\\ \;\;\;\;2 + \left(\mathsf{hypot}\left(1, \sqrt{z}\right) - \left(\sqrt{z} + \left(\sqrt{x} + \sqrt{y}\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\sqrt{1 + y} - \left(\sqrt{x} + \sqrt{y}\right)\right) + \sqrt{x + 1}\\ \end{array} \]
    5. Add Preprocessing

    Alternative 12: 85.2% accurate, 1.9× speedup?

    \[\begin{array}{l} [x, y, z, t] = \mathsf{sort}([x, y, z, t])\\ \\ \begin{array}{l} t_1 := \sqrt{x} + \sqrt{y}\\ \mathbf{if}\;z \leq 5.8 \cdot 10^{+14}:\\ \;\;\;\;2 + \left(\sqrt{1 + z} + z \cdot \left(t\_1 \cdot \frac{-1}{z} - \sqrt{\frac{1}{z}}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\sqrt{1 + y} - t\_1\right) + \sqrt{x + 1}\\ \end{array} \end{array} \]
    NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
    (FPCore (x y z t)
     :precision binary64
     (let* ((t_1 (+ (sqrt x) (sqrt y))))
       (if (<= z 5.8e+14)
         (+ 2.0 (+ (sqrt (+ 1.0 z)) (* z (- (* t_1 (/ -1.0 z)) (sqrt (/ 1.0 z))))))
         (+ (- (sqrt (+ 1.0 y)) t_1) (sqrt (+ x 1.0))))))
    assert(x < y && y < z && z < t);
    double code(double x, double y, double z, double t) {
    	double t_1 = sqrt(x) + sqrt(y);
    	double tmp;
    	if (z <= 5.8e+14) {
    		tmp = 2.0 + (sqrt((1.0 + z)) + (z * ((t_1 * (-1.0 / z)) - sqrt((1.0 / z)))));
    	} else {
    		tmp = (sqrt((1.0 + y)) - t_1) + sqrt((x + 1.0));
    	}
    	return tmp;
    }
    
    NOTE: x, y, z, and t should be sorted in increasing order before calling this 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) :: tmp
        t_1 = sqrt(x) + sqrt(y)
        if (z <= 5.8d+14) then
            tmp = 2.0d0 + (sqrt((1.0d0 + z)) + (z * ((t_1 * ((-1.0d0) / z)) - sqrt((1.0d0 / z)))))
        else
            tmp = (sqrt((1.0d0 + y)) - t_1) + sqrt((x + 1.0d0))
        end if
        code = tmp
    end function
    
    assert x < y && y < z && z < t;
    public static double code(double x, double y, double z, double t) {
    	double t_1 = Math.sqrt(x) + Math.sqrt(y);
    	double tmp;
    	if (z <= 5.8e+14) {
    		tmp = 2.0 + (Math.sqrt((1.0 + z)) + (z * ((t_1 * (-1.0 / z)) - Math.sqrt((1.0 / z)))));
    	} else {
    		tmp = (Math.sqrt((1.0 + y)) - t_1) + Math.sqrt((x + 1.0));
    	}
    	return tmp;
    }
    
    [x, y, z, t] = sort([x, y, z, t])
    def code(x, y, z, t):
    	t_1 = math.sqrt(x) + math.sqrt(y)
    	tmp = 0
    	if z <= 5.8e+14:
    		tmp = 2.0 + (math.sqrt((1.0 + z)) + (z * ((t_1 * (-1.0 / z)) - math.sqrt((1.0 / z)))))
    	else:
    		tmp = (math.sqrt((1.0 + y)) - t_1) + math.sqrt((x + 1.0))
    	return tmp
    
    x, y, z, t = sort([x, y, z, t])
    function code(x, y, z, t)
    	t_1 = Float64(sqrt(x) + sqrt(y))
    	tmp = 0.0
    	if (z <= 5.8e+14)
    		tmp = Float64(2.0 + Float64(sqrt(Float64(1.0 + z)) + Float64(z * Float64(Float64(t_1 * Float64(-1.0 / z)) - sqrt(Float64(1.0 / z))))));
    	else
    		tmp = Float64(Float64(sqrt(Float64(1.0 + y)) - t_1) + sqrt(Float64(x + 1.0)));
    	end
    	return tmp
    end
    
    x, y, z, t = num2cell(sort([x, y, z, t])){:}
    function tmp_2 = code(x, y, z, t)
    	t_1 = sqrt(x) + sqrt(y);
    	tmp = 0.0;
    	if (z <= 5.8e+14)
    		tmp = 2.0 + (sqrt((1.0 + z)) + (z * ((t_1 * (-1.0 / z)) - sqrt((1.0 / z)))));
    	else
    		tmp = (sqrt((1.0 + y)) - t_1) + sqrt((x + 1.0));
    	end
    	tmp_2 = tmp;
    end
    
    NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
    code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, 5.8e+14], N[(2.0 + N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] + N[(z * N[(N[(t$95$1 * N[(-1.0 / z), $MachinePrecision]), $MachinePrecision] - N[Sqrt[N[(1.0 / z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] - t$95$1), $MachinePrecision] + N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
    
    \begin{array}{l}
    [x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
    \\
    \begin{array}{l}
    t_1 := \sqrt{x} + \sqrt{y}\\
    \mathbf{if}\;z \leq 5.8 \cdot 10^{+14}:\\
    \;\;\;\;2 + \left(\sqrt{1 + z} + z \cdot \left(t\_1 \cdot \frac{-1}{z} - \sqrt{\frac{1}{z}}\right)\right)\\
    
    \mathbf{else}:\\
    \;\;\;\;\left(\sqrt{1 + y} - t\_1\right) + \sqrt{x + 1}\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if z < 5.8e14

      1. Initial program 96.2%

        \[\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. Step-by-step derivation
        1. associate-+l+96.2%

          \[\leadsto \color{blue}{\left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{y + 1} - \sqrt{y}\right)\right) + \left(\left(\sqrt{z + 1} - \sqrt{z}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)\right)} \]
        2. associate-+l-79.4%

          \[\leadsto \color{blue}{\left(\sqrt{x + 1} - \left(\sqrt{x} - \left(\sqrt{y + 1} - \sqrt{y}\right)\right)\right)} + \left(\left(\sqrt{z + 1} - \sqrt{z}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)\right) \]
        3. associate-+l-96.2%

          \[\leadsto \color{blue}{\left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{y + 1} - \sqrt{y}\right)\right)} + \left(\left(\sqrt{z + 1} - \sqrt{z}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)\right) \]
        4. +-commutative96.2%

          \[\leadsto \left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{\color{blue}{1 + y}} - \sqrt{y}\right)\right) + \left(\left(\sqrt{z + 1} - \sqrt{z}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)\right) \]
        5. +-commutative96.2%

          \[\leadsto \left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{1 + y} - \sqrt{y}\right)\right) + \left(\left(\sqrt{\color{blue}{1 + z}} - \sqrt{z}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)\right) \]
        6. +-commutative96.2%

          \[\leadsto \left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{1 + y} - \sqrt{y}\right)\right) + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\sqrt{\color{blue}{1 + t}} - \sqrt{t}\right)\right) \]
      3. Simplified96.2%

        \[\leadsto \color{blue}{\left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{1 + y} - \sqrt{y}\right)\right) + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\sqrt{1 + t} - \sqrt{t}\right)\right)} \]
      4. Add Preprocessing
      5. Taylor expanded in t around inf 19.2%

        \[\leadsto \color{blue}{\left(\sqrt{1 + x} + \left(\sqrt{1 + y} + \sqrt{1 + z}\right)\right) - \left(\sqrt{x} + \left(\sqrt{y} + \sqrt{z}\right)\right)} \]
      6. Step-by-step derivation
        1. associate--l+23.2%

          \[\leadsto \color{blue}{\sqrt{1 + x} + \left(\left(\sqrt{1 + y} + \sqrt{1 + z}\right) - \left(\sqrt{x} + \left(\sqrt{y} + \sqrt{z}\right)\right)\right)} \]
      7. Simplified23.2%

        \[\leadsto \color{blue}{\sqrt{1 + x} + \left(\left(\sqrt{1 + y} + \sqrt{1 + z}\right) - \left(\sqrt{x} + \left(\sqrt{y} + \sqrt{z}\right)\right)\right)} \]
      8. Taylor expanded in y around 0 17.3%

        \[\leadsto \color{blue}{\left(1 + \left(\sqrt{1 + x} + \sqrt{1 + z}\right)\right) - \left(\sqrt{x} + \left(\sqrt{y} + \sqrt{z}\right)\right)} \]
      9. Step-by-step derivation
        1. associate--l+26.2%

          \[\leadsto \color{blue}{1 + \left(\left(\sqrt{1 + x} + \sqrt{1 + z}\right) - \left(\sqrt{x} + \left(\sqrt{y} + \sqrt{z}\right)\right)\right)} \]
        2. +-commutative26.2%

          \[\leadsto 1 + \left(\color{blue}{\left(\sqrt{1 + z} + \sqrt{1 + x}\right)} - \left(\sqrt{x} + \left(\sqrt{y} + \sqrt{z}\right)\right)\right) \]
        3. +-commutative26.2%

          \[\leadsto 1 + \left(\left(\sqrt{1 + z} + \sqrt{1 + x}\right) - \left(\sqrt{x} + \color{blue}{\left(\sqrt{z} + \sqrt{y}\right)}\right)\right) \]
      10. Simplified26.2%

        \[\leadsto \color{blue}{1 + \left(\left(\sqrt{1 + z} + \sqrt{1 + x}\right) - \left(\sqrt{x} + \left(\sqrt{z} + \sqrt{y}\right)\right)\right)} \]
      11. Taylor expanded in x around 0 15.4%

        \[\leadsto \color{blue}{\left(2 + \sqrt{1 + z}\right) - \left(\sqrt{x} + \left(\sqrt{y} + \sqrt{z}\right)\right)} \]
      12. Step-by-step derivation
        1. associate--l+15.4%

          \[\leadsto \color{blue}{2 + \left(\sqrt{1 + z} - \left(\sqrt{x} + \left(\sqrt{y} + \sqrt{z}\right)\right)\right)} \]
        2. associate-+r+15.4%

          \[\leadsto 2 + \left(\sqrt{1 + z} - \color{blue}{\left(\left(\sqrt{x} + \sqrt{y}\right) + \sqrt{z}\right)}\right) \]
      13. Simplified15.4%

        \[\leadsto \color{blue}{2 + \left(\sqrt{1 + z} - \left(\left(\sqrt{x} + \sqrt{y}\right) + \sqrt{z}\right)\right)} \]
      14. Taylor expanded in z around inf 15.3%

        \[\leadsto 2 + \left(\sqrt{1 + z} - \color{blue}{z \cdot \left(\sqrt{\frac{1}{z}} + \left(\sqrt{x} \cdot \frac{1}{z} + \sqrt{y} \cdot \frac{1}{z}\right)\right)}\right) \]
      15. Step-by-step derivation
        1. distribute-rgt-out15.3%

          \[\leadsto 2 + \left(\sqrt{1 + z} - z \cdot \left(\sqrt{\frac{1}{z}} + \color{blue}{\frac{1}{z} \cdot \left(\sqrt{x} + \sqrt{y}\right)}\right)\right) \]
        2. +-commutative15.3%

          \[\leadsto 2 + \left(\sqrt{1 + z} - z \cdot \left(\sqrt{\frac{1}{z}} + \frac{1}{z} \cdot \color{blue}{\left(\sqrt{y} + \sqrt{x}\right)}\right)\right) \]
      16. Simplified15.3%

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

      if 5.8e14 < z

      1. Initial program 91.3%

        \[\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. Step-by-step derivation
        1. associate-+l+91.3%

          \[\leadsto \color{blue}{\left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{y + 1} - \sqrt{y}\right)\right) + \left(\left(\sqrt{z + 1} - \sqrt{z}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)\right)} \]
        2. associate-+l-74.1%

          \[\leadsto \color{blue}{\left(\sqrt{x + 1} - \left(\sqrt{x} - \left(\sqrt{y + 1} - \sqrt{y}\right)\right)\right)} + \left(\left(\sqrt{z + 1} - \sqrt{z}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)\right) \]
        3. associate-+l-91.3%

          \[\leadsto \color{blue}{\left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{y + 1} - \sqrt{y}\right)\right)} + \left(\left(\sqrt{z + 1} - \sqrt{z}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)\right) \]
        4. +-commutative91.3%

          \[\leadsto \left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{\color{blue}{1 + y}} - \sqrt{y}\right)\right) + \left(\left(\sqrt{z + 1} - \sqrt{z}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)\right) \]
        5. +-commutative91.3%

          \[\leadsto \left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{1 + y} - \sqrt{y}\right)\right) + \left(\left(\sqrt{\color{blue}{1 + z}} - \sqrt{z}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)\right) \]
        6. +-commutative91.3%

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

        \[\leadsto \color{blue}{\left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{1 + y} - \sqrt{y}\right)\right) + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\sqrt{1 + t} - \sqrt{t}\right)\right)} \]
      4. Add Preprocessing
      5. Taylor expanded in t around inf 3.3%

        \[\leadsto \color{blue}{\left(\sqrt{1 + x} + \left(\sqrt{1 + y} + \sqrt{1 + z}\right)\right) - \left(\sqrt{x} + \left(\sqrt{y} + \sqrt{z}\right)\right)} \]
      6. Step-by-step derivation
        1. associate--l+22.6%

          \[\leadsto \color{blue}{\sqrt{1 + x} + \left(\left(\sqrt{1 + y} + \sqrt{1 + z}\right) - \left(\sqrt{x} + \left(\sqrt{y} + \sqrt{z}\right)\right)\right)} \]
      7. Simplified22.6%

        \[\leadsto \color{blue}{\sqrt{1 + x} + \left(\left(\sqrt{1 + y} + \sqrt{1 + z}\right) - \left(\sqrt{x} + \left(\sqrt{y} + \sqrt{z}\right)\right)\right)} \]
      8. Taylor expanded in z around inf 23.4%

        \[\leadsto \color{blue}{\left(\sqrt{1 + x} + \sqrt{1 + y}\right) - \left(\sqrt{x} + \sqrt{y}\right)} \]
      9. Step-by-step derivation
        1. associate--l+35.6%

          \[\leadsto \color{blue}{\sqrt{1 + x} + \left(\sqrt{1 + y} - \left(\sqrt{x} + \sqrt{y}\right)\right)} \]
      10. Simplified35.6%

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

      \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq 5.8 \cdot 10^{+14}:\\ \;\;\;\;2 + \left(\sqrt{1 + z} + z \cdot \left(\left(\sqrt{x} + \sqrt{y}\right) \cdot \frac{-1}{z} - \sqrt{\frac{1}{z}}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\sqrt{1 + y} - \left(\sqrt{x} + \sqrt{y}\right)\right) + \sqrt{x + 1}\\ \end{array} \]
    5. Add Preprocessing

    Alternative 13: 85.2% accurate, 2.0× speedup?

    \[\begin{array}{l} [x, y, z, t] = \mathsf{sort}([x, y, z, t])\\ \\ \begin{array}{l} t_1 := \sqrt{x} + \sqrt{y}\\ \mathbf{if}\;z \leq 5.8 \cdot 10^{+14}:\\ \;\;\;\;2 + \left(\sqrt{1 + z} - \left(\sqrt{z} + t\_1\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\sqrt{1 + y} - t\_1\right) + \sqrt{x + 1}\\ \end{array} \end{array} \]
    NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
    (FPCore (x y z t)
     :precision binary64
     (let* ((t_1 (+ (sqrt x) (sqrt y))))
       (if (<= z 5.8e+14)
         (+ 2.0 (- (sqrt (+ 1.0 z)) (+ (sqrt z) t_1)))
         (+ (- (sqrt (+ 1.0 y)) t_1) (sqrt (+ x 1.0))))))
    assert(x < y && y < z && z < t);
    double code(double x, double y, double z, double t) {
    	double t_1 = sqrt(x) + sqrt(y);
    	double tmp;
    	if (z <= 5.8e+14) {
    		tmp = 2.0 + (sqrt((1.0 + z)) - (sqrt(z) + t_1));
    	} else {
    		tmp = (sqrt((1.0 + y)) - t_1) + sqrt((x + 1.0));
    	}
    	return tmp;
    }
    
    NOTE: x, y, z, and t should be sorted in increasing order before calling this 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) :: tmp
        t_1 = sqrt(x) + sqrt(y)
        if (z <= 5.8d+14) then
            tmp = 2.0d0 + (sqrt((1.0d0 + z)) - (sqrt(z) + t_1))
        else
            tmp = (sqrt((1.0d0 + y)) - t_1) + sqrt((x + 1.0d0))
        end if
        code = tmp
    end function
    
    assert x < y && y < z && z < t;
    public static double code(double x, double y, double z, double t) {
    	double t_1 = Math.sqrt(x) + Math.sqrt(y);
    	double tmp;
    	if (z <= 5.8e+14) {
    		tmp = 2.0 + (Math.sqrt((1.0 + z)) - (Math.sqrt(z) + t_1));
    	} else {
    		tmp = (Math.sqrt((1.0 + y)) - t_1) + Math.sqrt((x + 1.0));
    	}
    	return tmp;
    }
    
    [x, y, z, t] = sort([x, y, z, t])
    def code(x, y, z, t):
    	t_1 = math.sqrt(x) + math.sqrt(y)
    	tmp = 0
    	if z <= 5.8e+14:
    		tmp = 2.0 + (math.sqrt((1.0 + z)) - (math.sqrt(z) + t_1))
    	else:
    		tmp = (math.sqrt((1.0 + y)) - t_1) + math.sqrt((x + 1.0))
    	return tmp
    
    x, y, z, t = sort([x, y, z, t])
    function code(x, y, z, t)
    	t_1 = Float64(sqrt(x) + sqrt(y))
    	tmp = 0.0
    	if (z <= 5.8e+14)
    		tmp = Float64(2.0 + Float64(sqrt(Float64(1.0 + z)) - Float64(sqrt(z) + t_1)));
    	else
    		tmp = Float64(Float64(sqrt(Float64(1.0 + y)) - t_1) + sqrt(Float64(x + 1.0)));
    	end
    	return tmp
    end
    
    x, y, z, t = num2cell(sort([x, y, z, t])){:}
    function tmp_2 = code(x, y, z, t)
    	t_1 = sqrt(x) + sqrt(y);
    	tmp = 0.0;
    	if (z <= 5.8e+14)
    		tmp = 2.0 + (sqrt((1.0 + z)) - (sqrt(z) + t_1));
    	else
    		tmp = (sqrt((1.0 + y)) - t_1) + sqrt((x + 1.0));
    	end
    	tmp_2 = tmp;
    end
    
    NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
    code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, 5.8e+14], N[(2.0 + N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[(N[Sqrt[z], $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] - t$95$1), $MachinePrecision] + N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
    
    \begin{array}{l}
    [x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
    \\
    \begin{array}{l}
    t_1 := \sqrt{x} + \sqrt{y}\\
    \mathbf{if}\;z \leq 5.8 \cdot 10^{+14}:\\
    \;\;\;\;2 + \left(\sqrt{1 + z} - \left(\sqrt{z} + t\_1\right)\right)\\
    
    \mathbf{else}:\\
    \;\;\;\;\left(\sqrt{1 + y} - t\_1\right) + \sqrt{x + 1}\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if z < 5.8e14

      1. Initial program 96.2%

        \[\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. Step-by-step derivation
        1. associate-+l+96.2%

          \[\leadsto \color{blue}{\left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{y + 1} - \sqrt{y}\right)\right) + \left(\left(\sqrt{z + 1} - \sqrt{z}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)\right)} \]
        2. associate-+l-79.4%

          \[\leadsto \color{blue}{\left(\sqrt{x + 1} - \left(\sqrt{x} - \left(\sqrt{y + 1} - \sqrt{y}\right)\right)\right)} + \left(\left(\sqrt{z + 1} - \sqrt{z}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)\right) \]
        3. associate-+l-96.2%

          \[\leadsto \color{blue}{\left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{y + 1} - \sqrt{y}\right)\right)} + \left(\left(\sqrt{z + 1} - \sqrt{z}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)\right) \]
        4. +-commutative96.2%

          \[\leadsto \left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{\color{blue}{1 + y}} - \sqrt{y}\right)\right) + \left(\left(\sqrt{z + 1} - \sqrt{z}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)\right) \]
        5. +-commutative96.2%

          \[\leadsto \left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{1 + y} - \sqrt{y}\right)\right) + \left(\left(\sqrt{\color{blue}{1 + z}} - \sqrt{z}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)\right) \]
        6. +-commutative96.2%

          \[\leadsto \left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{1 + y} - \sqrt{y}\right)\right) + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\sqrt{\color{blue}{1 + t}} - \sqrt{t}\right)\right) \]
      3. Simplified96.2%

        \[\leadsto \color{blue}{\left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{1 + y} - \sqrt{y}\right)\right) + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\sqrt{1 + t} - \sqrt{t}\right)\right)} \]
      4. Add Preprocessing
      5. Taylor expanded in t around inf 19.2%

        \[\leadsto \color{blue}{\left(\sqrt{1 + x} + \left(\sqrt{1 + y} + \sqrt{1 + z}\right)\right) - \left(\sqrt{x} + \left(\sqrt{y} + \sqrt{z}\right)\right)} \]
      6. Step-by-step derivation
        1. associate--l+23.2%

          \[\leadsto \color{blue}{\sqrt{1 + x} + \left(\left(\sqrt{1 + y} + \sqrt{1 + z}\right) - \left(\sqrt{x} + \left(\sqrt{y} + \sqrt{z}\right)\right)\right)} \]
      7. Simplified23.2%

        \[\leadsto \color{blue}{\sqrt{1 + x} + \left(\left(\sqrt{1 + y} + \sqrt{1 + z}\right) - \left(\sqrt{x} + \left(\sqrt{y} + \sqrt{z}\right)\right)\right)} \]
      8. Taylor expanded in y around 0 17.3%

        \[\leadsto \color{blue}{\left(1 + \left(\sqrt{1 + x} + \sqrt{1 + z}\right)\right) - \left(\sqrt{x} + \left(\sqrt{y} + \sqrt{z}\right)\right)} \]
      9. Step-by-step derivation
        1. associate--l+26.2%

          \[\leadsto \color{blue}{1 + \left(\left(\sqrt{1 + x} + \sqrt{1 + z}\right) - \left(\sqrt{x} + \left(\sqrt{y} + \sqrt{z}\right)\right)\right)} \]
        2. +-commutative26.2%

          \[\leadsto 1 + \left(\color{blue}{\left(\sqrt{1 + z} + \sqrt{1 + x}\right)} - \left(\sqrt{x} + \left(\sqrt{y} + \sqrt{z}\right)\right)\right) \]
        3. +-commutative26.2%

          \[\leadsto 1 + \left(\left(\sqrt{1 + z} + \sqrt{1 + x}\right) - \left(\sqrt{x} + \color{blue}{\left(\sqrt{z} + \sqrt{y}\right)}\right)\right) \]
      10. Simplified26.2%

        \[\leadsto \color{blue}{1 + \left(\left(\sqrt{1 + z} + \sqrt{1 + x}\right) - \left(\sqrt{x} + \left(\sqrt{z} + \sqrt{y}\right)\right)\right)} \]
      11. Taylor expanded in x around 0 15.4%

        \[\leadsto \color{blue}{\left(2 + \sqrt{1 + z}\right) - \left(\sqrt{x} + \left(\sqrt{y} + \sqrt{z}\right)\right)} \]
      12. Step-by-step derivation
        1. associate--l+15.4%

          \[\leadsto \color{blue}{2 + \left(\sqrt{1 + z} - \left(\sqrt{x} + \left(\sqrt{y} + \sqrt{z}\right)\right)\right)} \]
        2. associate-+r+15.4%

          \[\leadsto 2 + \left(\sqrt{1 + z} - \color{blue}{\left(\left(\sqrt{x} + \sqrt{y}\right) + \sqrt{z}\right)}\right) \]
      13. Simplified15.4%

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

      if 5.8e14 < z

      1. Initial program 91.3%

        \[\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. Step-by-step derivation
        1. associate-+l+91.3%

          \[\leadsto \color{blue}{\left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{y + 1} - \sqrt{y}\right)\right) + \left(\left(\sqrt{z + 1} - \sqrt{z}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)\right)} \]
        2. associate-+l-74.1%

          \[\leadsto \color{blue}{\left(\sqrt{x + 1} - \left(\sqrt{x} - \left(\sqrt{y + 1} - \sqrt{y}\right)\right)\right)} + \left(\left(\sqrt{z + 1} - \sqrt{z}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)\right) \]
        3. associate-+l-91.3%

          \[\leadsto \color{blue}{\left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{y + 1} - \sqrt{y}\right)\right)} + \left(\left(\sqrt{z + 1} - \sqrt{z}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)\right) \]
        4. +-commutative91.3%

          \[\leadsto \left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{\color{blue}{1 + y}} - \sqrt{y}\right)\right) + \left(\left(\sqrt{z + 1} - \sqrt{z}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)\right) \]
        5. +-commutative91.3%

          \[\leadsto \left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{1 + y} - \sqrt{y}\right)\right) + \left(\left(\sqrt{\color{blue}{1 + z}} - \sqrt{z}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)\right) \]
        6. +-commutative91.3%

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

        \[\leadsto \color{blue}{\left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{1 + y} - \sqrt{y}\right)\right) + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\sqrt{1 + t} - \sqrt{t}\right)\right)} \]
      4. Add Preprocessing
      5. Taylor expanded in t around inf 3.3%

        \[\leadsto \color{blue}{\left(\sqrt{1 + x} + \left(\sqrt{1 + y} + \sqrt{1 + z}\right)\right) - \left(\sqrt{x} + \left(\sqrt{y} + \sqrt{z}\right)\right)} \]
      6. Step-by-step derivation
        1. associate--l+22.6%

          \[\leadsto \color{blue}{\sqrt{1 + x} + \left(\left(\sqrt{1 + y} + \sqrt{1 + z}\right) - \left(\sqrt{x} + \left(\sqrt{y} + \sqrt{z}\right)\right)\right)} \]
      7. Simplified22.6%

        \[\leadsto \color{blue}{\sqrt{1 + x} + \left(\left(\sqrt{1 + y} + \sqrt{1 + z}\right) - \left(\sqrt{x} + \left(\sqrt{y} + \sqrt{z}\right)\right)\right)} \]
      8. Taylor expanded in z around inf 23.4%

        \[\leadsto \color{blue}{\left(\sqrt{1 + x} + \sqrt{1 + y}\right) - \left(\sqrt{x} + \sqrt{y}\right)} \]
      9. Step-by-step derivation
        1. associate--l+35.6%

          \[\leadsto \color{blue}{\sqrt{1 + x} + \left(\sqrt{1 + y} - \left(\sqrt{x} + \sqrt{y}\right)\right)} \]
      10. Simplified35.6%

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

      \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq 5.8 \cdot 10^{+14}:\\ \;\;\;\;2 + \left(\sqrt{1 + z} - \left(\sqrt{z} + \left(\sqrt{x} + \sqrt{y}\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\sqrt{1 + y} - \left(\sqrt{x} + \sqrt{y}\right)\right) + \sqrt{x + 1}\\ \end{array} \]
    5. Add Preprocessing

    Alternative 14: 82.1% accurate, 2.0× speedup?

    \[\begin{array}{l} [x, y, z, t] = \mathsf{sort}([x, y, z, t])\\ \\ \begin{array}{l} \mathbf{if}\;y \leq 3:\\ \;\;\;\;2 + \left(\sqrt{1 + z} - \left(\sqrt{z} + \left(\sqrt{x} + \sqrt{y}\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\sqrt{x + 1} - \sqrt{x}\\ \end{array} \end{array} \]
    NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
    (FPCore (x y z t)
     :precision binary64
     (if (<= y 3.0)
       (+ 2.0 (- (sqrt (+ 1.0 z)) (+ (sqrt z) (+ (sqrt x) (sqrt y)))))
       (- (sqrt (+ x 1.0)) (sqrt x))))
    assert(x < y && y < z && z < t);
    double code(double x, double y, double z, double t) {
    	double tmp;
    	if (y <= 3.0) {
    		tmp = 2.0 + (sqrt((1.0 + z)) - (sqrt(z) + (sqrt(x) + sqrt(y))));
    	} else {
    		tmp = sqrt((x + 1.0)) - sqrt(x);
    	}
    	return tmp;
    }
    
    NOTE: x, y, z, and t should be sorted in increasing order before calling this 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) :: tmp
        if (y <= 3.0d0) then
            tmp = 2.0d0 + (sqrt((1.0d0 + z)) - (sqrt(z) + (sqrt(x) + sqrt(y))))
        else
            tmp = sqrt((x + 1.0d0)) - sqrt(x)
        end if
        code = tmp
    end function
    
    assert x < y && y < z && z < t;
    public static double code(double x, double y, double z, double t) {
    	double tmp;
    	if (y <= 3.0) {
    		tmp = 2.0 + (Math.sqrt((1.0 + z)) - (Math.sqrt(z) + (Math.sqrt(x) + Math.sqrt(y))));
    	} else {
    		tmp = Math.sqrt((x + 1.0)) - Math.sqrt(x);
    	}
    	return tmp;
    }
    
    [x, y, z, t] = sort([x, y, z, t])
    def code(x, y, z, t):
    	tmp = 0
    	if y <= 3.0:
    		tmp = 2.0 + (math.sqrt((1.0 + z)) - (math.sqrt(z) + (math.sqrt(x) + math.sqrt(y))))
    	else:
    		tmp = math.sqrt((x + 1.0)) - math.sqrt(x)
    	return tmp
    
    x, y, z, t = sort([x, y, z, t])
    function code(x, y, z, t)
    	tmp = 0.0
    	if (y <= 3.0)
    		tmp = Float64(2.0 + Float64(sqrt(Float64(1.0 + z)) - Float64(sqrt(z) + Float64(sqrt(x) + sqrt(y)))));
    	else
    		tmp = Float64(sqrt(Float64(x + 1.0)) - sqrt(x));
    	end
    	return tmp
    end
    
    x, y, z, t = num2cell(sort([x, y, z, t])){:}
    function tmp_2 = code(x, y, z, t)
    	tmp = 0.0;
    	if (y <= 3.0)
    		tmp = 2.0 + (sqrt((1.0 + z)) - (sqrt(z) + (sqrt(x) + sqrt(y))));
    	else
    		tmp = sqrt((x + 1.0)) - sqrt(x);
    	end
    	tmp_2 = tmp;
    end
    
    NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
    code[x_, y_, z_, t_] := If[LessEqual[y, 3.0], N[(2.0 + N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[(N[Sqrt[z], $MachinePrecision] + N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]]
    
    \begin{array}{l}
    [x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
    \\
    \begin{array}{l}
    \mathbf{if}\;y \leq 3:\\
    \;\;\;\;2 + \left(\sqrt{1 + z} - \left(\sqrt{z} + \left(\sqrt{x} + \sqrt{y}\right)\right)\right)\\
    
    \mathbf{else}:\\
    \;\;\;\;\sqrt{x + 1} - \sqrt{x}\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if y < 3

      1. Initial program 97.5%

        \[\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. Step-by-step derivation
        1. associate-+l+97.5%

          \[\leadsto \color{blue}{\left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{y + 1} - \sqrt{y}\right)\right) + \left(\left(\sqrt{z + 1} - \sqrt{z}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)\right)} \]
        2. associate-+l-62.9%

          \[\leadsto \color{blue}{\left(\sqrt{x + 1} - \left(\sqrt{x} - \left(\sqrt{y + 1} - \sqrt{y}\right)\right)\right)} + \left(\left(\sqrt{z + 1} - \sqrt{z}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)\right) \]
        3. associate-+l-97.5%

          \[\leadsto \color{blue}{\left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{y + 1} - \sqrt{y}\right)\right)} + \left(\left(\sqrt{z + 1} - \sqrt{z}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)\right) \]
        4. +-commutative97.5%

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

          \[\leadsto \left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{1 + y} - \sqrt{y}\right)\right) + \left(\left(\sqrt{\color{blue}{1 + z}} - \sqrt{z}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)\right) \]
        6. +-commutative97.5%

          \[\leadsto \left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{1 + y} - \sqrt{y}\right)\right) + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\sqrt{\color{blue}{1 + t}} - \sqrt{t}\right)\right) \]
      3. Simplified97.5%

        \[\leadsto \color{blue}{\left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{1 + y} - \sqrt{y}\right)\right) + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\sqrt{1 + t} - \sqrt{t}\right)\right)} \]
      4. Add Preprocessing
      5. Taylor expanded in t around inf 20.5%

        \[\leadsto \color{blue}{\left(\sqrt{1 + x} + \left(\sqrt{1 + y} + \sqrt{1 + z}\right)\right) - \left(\sqrt{x} + \left(\sqrt{y} + \sqrt{z}\right)\right)} \]
      6. Step-by-step derivation
        1. associate--l+24.9%

          \[\leadsto \color{blue}{\sqrt{1 + x} + \left(\left(\sqrt{1 + y} + \sqrt{1 + z}\right) - \left(\sqrt{x} + \left(\sqrt{y} + \sqrt{z}\right)\right)\right)} \]
      7. Simplified24.9%

        \[\leadsto \color{blue}{\sqrt{1 + x} + \left(\left(\sqrt{1 + y} + \sqrt{1 + z}\right) - \left(\sqrt{x} + \left(\sqrt{y} + \sqrt{z}\right)\right)\right)} \]
      8. Taylor expanded in y around 0 20.0%

        \[\leadsto \color{blue}{\left(1 + \left(\sqrt{1 + x} + \sqrt{1 + z}\right)\right) - \left(\sqrt{x} + \left(\sqrt{y} + \sqrt{z}\right)\right)} \]
      9. Step-by-step derivation
        1. associate--l+38.3%

          \[\leadsto \color{blue}{1 + \left(\left(\sqrt{1 + x} + \sqrt{1 + z}\right) - \left(\sqrt{x} + \left(\sqrt{y} + \sqrt{z}\right)\right)\right)} \]
        2. +-commutative38.3%

          \[\leadsto 1 + \left(\color{blue}{\left(\sqrt{1 + z} + \sqrt{1 + x}\right)} - \left(\sqrt{x} + \left(\sqrt{y} + \sqrt{z}\right)\right)\right) \]
        3. +-commutative38.3%

          \[\leadsto 1 + \left(\left(\sqrt{1 + z} + \sqrt{1 + x}\right) - \left(\sqrt{x} + \color{blue}{\left(\sqrt{z} + \sqrt{y}\right)}\right)\right) \]
      10. Simplified38.3%

        \[\leadsto \color{blue}{1 + \left(\left(\sqrt{1 + z} + \sqrt{1 + x}\right) - \left(\sqrt{x} + \left(\sqrt{z} + \sqrt{y}\right)\right)\right)} \]
      11. Taylor expanded in x around 0 17.9%

        \[\leadsto \color{blue}{\left(2 + \sqrt{1 + z}\right) - \left(\sqrt{x} + \left(\sqrt{y} + \sqrt{z}\right)\right)} \]
      12. Step-by-step derivation
        1. associate--l+35.9%

          \[\leadsto \color{blue}{2 + \left(\sqrt{1 + z} - \left(\sqrt{x} + \left(\sqrt{y} + \sqrt{z}\right)\right)\right)} \]
        2. associate-+r+35.9%

          \[\leadsto 2 + \left(\sqrt{1 + z} - \color{blue}{\left(\left(\sqrt{x} + \sqrt{y}\right) + \sqrt{z}\right)}\right) \]
      13. Simplified35.9%

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

      if 3 < y

      1. Initial program 90.7%

        \[\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. Step-by-step derivation
        1. associate-+l+90.7%

          \[\leadsto \color{blue}{\left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{y + 1} - \sqrt{y}\right)\right) + \left(\left(\sqrt{z + 1} - \sqrt{z}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)\right)} \]
        2. associate-+l-90.2%

          \[\leadsto \color{blue}{\left(\sqrt{x + 1} - \left(\sqrt{x} - \left(\sqrt{y + 1} - \sqrt{y}\right)\right)\right)} + \left(\left(\sqrt{z + 1} - \sqrt{z}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)\right) \]
        3. associate-+l-90.7%

          \[\leadsto \color{blue}{\left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{y + 1} - \sqrt{y}\right)\right)} + \left(\left(\sqrt{z + 1} - \sqrt{z}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)\right) \]
        4. +-commutative90.7%

          \[\leadsto \left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{\color{blue}{1 + y}} - \sqrt{y}\right)\right) + \left(\left(\sqrt{z + 1} - \sqrt{z}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)\right) \]
        5. +-commutative90.7%

          \[\leadsto \left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{1 + y} - \sqrt{y}\right)\right) + \left(\left(\sqrt{\color{blue}{1 + z}} - \sqrt{z}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)\right) \]
        6. +-commutative90.7%

          \[\leadsto \left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{1 + y} - \sqrt{y}\right)\right) + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\sqrt{\color{blue}{1 + t}} - \sqrt{t}\right)\right) \]
      3. Simplified90.7%

        \[\leadsto \color{blue}{\left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{1 + y} - \sqrt{y}\right)\right) + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\sqrt{1 + t} - \sqrt{t}\right)\right)} \]
      4. Add Preprocessing
      5. Taylor expanded in t around inf 3.9%

        \[\leadsto \color{blue}{\left(\sqrt{1 + x} + \left(\sqrt{1 + y} + \sqrt{1 + z}\right)\right) - \left(\sqrt{x} + \left(\sqrt{y} + \sqrt{z}\right)\right)} \]
      6. Step-by-step derivation
        1. associate--l+21.0%

          \[\leadsto \color{blue}{\sqrt{1 + x} + \left(\left(\sqrt{1 + y} + \sqrt{1 + z}\right) - \left(\sqrt{x} + \left(\sqrt{y} + \sqrt{z}\right)\right)\right)} \]
      7. Simplified21.0%

        \[\leadsto \color{blue}{\sqrt{1 + x} + \left(\left(\sqrt{1 + y} + \sqrt{1 + z}\right) - \left(\sqrt{x} + \left(\sqrt{y} + \sqrt{z}\right)\right)\right)} \]
      8. Taylor expanded in x around inf 20.2%

        \[\leadsto \sqrt{1 + x} + \color{blue}{-1 \cdot \sqrt{x}} \]
      9. Step-by-step derivation
        1. neg-mul-120.2%

          \[\leadsto \sqrt{1 + x} + \color{blue}{\left(-\sqrt{x}\right)} \]
      10. Simplified20.2%

        \[\leadsto \sqrt{1 + x} + \color{blue}{\left(-\sqrt{x}\right)} \]
    3. Recombined 2 regimes into one program.
    4. Final simplification27.8%

      \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq 3:\\ \;\;\;\;2 + \left(\sqrt{1 + z} - \left(\sqrt{z} + \left(\sqrt{x} + \sqrt{y}\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\sqrt{x + 1} - \sqrt{x}\\ \end{array} \]
    5. Add Preprocessing

    Alternative 15: 81.8% accurate, 3.9× speedup?

    \[\begin{array}{l} [x, y, z, t] = \mathsf{sort}([x, y, z, t])\\ \\ \begin{array}{l} \mathbf{if}\;y \leq 1.45:\\ \;\;\;\;\left(\sqrt{1 + z} - \sqrt{z}\right) + 2\\ \mathbf{else}:\\ \;\;\;\;\sqrt{x + 1} - \sqrt{x}\\ \end{array} \end{array} \]
    NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
    (FPCore (x y z t)
     :precision binary64
     (if (<= y 1.45)
       (+ (- (sqrt (+ 1.0 z)) (sqrt z)) 2.0)
       (- (sqrt (+ x 1.0)) (sqrt x))))
    assert(x < y && y < z && z < t);
    double code(double x, double y, double z, double t) {
    	double tmp;
    	if (y <= 1.45) {
    		tmp = (sqrt((1.0 + z)) - sqrt(z)) + 2.0;
    	} else {
    		tmp = sqrt((x + 1.0)) - sqrt(x);
    	}
    	return tmp;
    }
    
    NOTE: x, y, z, and t should be sorted in increasing order before calling this 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) :: tmp
        if (y <= 1.45d0) then
            tmp = (sqrt((1.0d0 + z)) - sqrt(z)) + 2.0d0
        else
            tmp = sqrt((x + 1.0d0)) - sqrt(x)
        end if
        code = tmp
    end function
    
    assert x < y && y < z && z < t;
    public static double code(double x, double y, double z, double t) {
    	double tmp;
    	if (y <= 1.45) {
    		tmp = (Math.sqrt((1.0 + z)) - Math.sqrt(z)) + 2.0;
    	} else {
    		tmp = Math.sqrt((x + 1.0)) - Math.sqrt(x);
    	}
    	return tmp;
    }
    
    [x, y, z, t] = sort([x, y, z, t])
    def code(x, y, z, t):
    	tmp = 0
    	if y <= 1.45:
    		tmp = (math.sqrt((1.0 + z)) - math.sqrt(z)) + 2.0
    	else:
    		tmp = math.sqrt((x + 1.0)) - math.sqrt(x)
    	return tmp
    
    x, y, z, t = sort([x, y, z, t])
    function code(x, y, z, t)
    	tmp = 0.0
    	if (y <= 1.45)
    		tmp = Float64(Float64(sqrt(Float64(1.0 + z)) - sqrt(z)) + 2.0);
    	else
    		tmp = Float64(sqrt(Float64(x + 1.0)) - sqrt(x));
    	end
    	return tmp
    end
    
    x, y, z, t = num2cell(sort([x, y, z, t])){:}
    function tmp_2 = code(x, y, z, t)
    	tmp = 0.0;
    	if (y <= 1.45)
    		tmp = (sqrt((1.0 + z)) - sqrt(z)) + 2.0;
    	else
    		tmp = sqrt((x + 1.0)) - sqrt(x);
    	end
    	tmp_2 = tmp;
    end
    
    NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
    code[x_, y_, z_, t_] := If[LessEqual[y, 1.45], N[(N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision], N[(N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]]
    
    \begin{array}{l}
    [x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
    \\
    \begin{array}{l}
    \mathbf{if}\;y \leq 1.45:\\
    \;\;\;\;\left(\sqrt{1 + z} - \sqrt{z}\right) + 2\\
    
    \mathbf{else}:\\
    \;\;\;\;\sqrt{x + 1} - \sqrt{x}\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if y < 1.44999999999999996

      1. Initial program 97.5%

        \[\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. Step-by-step derivation
        1. associate-+l+97.5%

          \[\leadsto \color{blue}{\left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{y + 1} - \sqrt{y}\right)\right) + \left(\left(\sqrt{z + 1} - \sqrt{z}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)\right)} \]
        2. associate-+l-62.9%

          \[\leadsto \color{blue}{\left(\sqrt{x + 1} - \left(\sqrt{x} - \left(\sqrt{y + 1} - \sqrt{y}\right)\right)\right)} + \left(\left(\sqrt{z + 1} - \sqrt{z}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)\right) \]
        3. associate-+l-97.5%

          \[\leadsto \color{blue}{\left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{y + 1} - \sqrt{y}\right)\right)} + \left(\left(\sqrt{z + 1} - \sqrt{z}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)\right) \]
        4. +-commutative97.5%

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

          \[\leadsto \left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{1 + y} - \sqrt{y}\right)\right) + \left(\left(\sqrt{\color{blue}{1 + z}} - \sqrt{z}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)\right) \]
        6. +-commutative97.5%

          \[\leadsto \left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{1 + y} - \sqrt{y}\right)\right) + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\sqrt{\color{blue}{1 + t}} - \sqrt{t}\right)\right) \]
      3. Simplified97.5%

        \[\leadsto \color{blue}{\left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{1 + y} - \sqrt{y}\right)\right) + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\sqrt{1 + t} - \sqrt{t}\right)\right)} \]
      4. Add Preprocessing
      5. Taylor expanded in t around inf 20.5%

        \[\leadsto \color{blue}{\left(\sqrt{1 + x} + \left(\sqrt{1 + y} + \sqrt{1 + z}\right)\right) - \left(\sqrt{x} + \left(\sqrt{y} + \sqrt{z}\right)\right)} \]
      6. Step-by-step derivation
        1. associate--l+24.9%

          \[\leadsto \color{blue}{\sqrt{1 + x} + \left(\left(\sqrt{1 + y} + \sqrt{1 + z}\right) - \left(\sqrt{x} + \left(\sqrt{y} + \sqrt{z}\right)\right)\right)} \]
      7. Simplified24.9%

        \[\leadsto \color{blue}{\sqrt{1 + x} + \left(\left(\sqrt{1 + y} + \sqrt{1 + z}\right) - \left(\sqrt{x} + \left(\sqrt{y} + \sqrt{z}\right)\right)\right)} \]
      8. Taylor expanded in y around 0 20.0%

        \[\leadsto \color{blue}{\left(1 + \left(\sqrt{1 + x} + \sqrt{1 + z}\right)\right) - \left(\sqrt{x} + \left(\sqrt{y} + \sqrt{z}\right)\right)} \]
      9. Step-by-step derivation
        1. associate--l+38.3%

          \[\leadsto \color{blue}{1 + \left(\left(\sqrt{1 + x} + \sqrt{1 + z}\right) - \left(\sqrt{x} + \left(\sqrt{y} + \sqrt{z}\right)\right)\right)} \]
        2. +-commutative38.3%

          \[\leadsto 1 + \left(\color{blue}{\left(\sqrt{1 + z} + \sqrt{1 + x}\right)} - \left(\sqrt{x} + \left(\sqrt{y} + \sqrt{z}\right)\right)\right) \]
        3. +-commutative38.3%

          \[\leadsto 1 + \left(\left(\sqrt{1 + z} + \sqrt{1 + x}\right) - \left(\sqrt{x} + \color{blue}{\left(\sqrt{z} + \sqrt{y}\right)}\right)\right) \]
      10. Simplified38.3%

        \[\leadsto \color{blue}{1 + \left(\left(\sqrt{1 + z} + \sqrt{1 + x}\right) - \left(\sqrt{x} + \left(\sqrt{z} + \sqrt{y}\right)\right)\right)} \]
      11. Taylor expanded in x around 0 17.9%

        \[\leadsto \color{blue}{\left(2 + \sqrt{1 + z}\right) - \left(\sqrt{x} + \left(\sqrt{y} + \sqrt{z}\right)\right)} \]
      12. Step-by-step derivation
        1. associate--l+35.9%

          \[\leadsto \color{blue}{2 + \left(\sqrt{1 + z} - \left(\sqrt{x} + \left(\sqrt{y} + \sqrt{z}\right)\right)\right)} \]
        2. associate-+r+35.9%

          \[\leadsto 2 + \left(\sqrt{1 + z} - \color{blue}{\left(\left(\sqrt{x} + \sqrt{y}\right) + \sqrt{z}\right)}\right) \]
      13. Simplified35.9%

        \[\leadsto \color{blue}{2 + \left(\sqrt{1 + z} - \left(\left(\sqrt{x} + \sqrt{y}\right) + \sqrt{z}\right)\right)} \]
      14. Taylor expanded in z around inf 53.7%

        \[\leadsto 2 + \left(\sqrt{1 + z} - \color{blue}{\sqrt{z}}\right) \]

      if 1.44999999999999996 < y

      1. Initial program 90.7%

        \[\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. Step-by-step derivation
        1. associate-+l+90.7%

          \[\leadsto \color{blue}{\left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{y + 1} - \sqrt{y}\right)\right) + \left(\left(\sqrt{z + 1} - \sqrt{z}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)\right)} \]
        2. associate-+l-90.2%

          \[\leadsto \color{blue}{\left(\sqrt{x + 1} - \left(\sqrt{x} - \left(\sqrt{y + 1} - \sqrt{y}\right)\right)\right)} + \left(\left(\sqrt{z + 1} - \sqrt{z}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)\right) \]
        3. associate-+l-90.7%

          \[\leadsto \color{blue}{\left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{y + 1} - \sqrt{y}\right)\right)} + \left(\left(\sqrt{z + 1} - \sqrt{z}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)\right) \]
        4. +-commutative90.7%

          \[\leadsto \left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{\color{blue}{1 + y}} - \sqrt{y}\right)\right) + \left(\left(\sqrt{z + 1} - \sqrt{z}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)\right) \]
        5. +-commutative90.7%

          \[\leadsto \left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{1 + y} - \sqrt{y}\right)\right) + \left(\left(\sqrt{\color{blue}{1 + z}} - \sqrt{z}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)\right) \]
        6. +-commutative90.7%

          \[\leadsto \left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{1 + y} - \sqrt{y}\right)\right) + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\sqrt{\color{blue}{1 + t}} - \sqrt{t}\right)\right) \]
      3. Simplified90.7%

        \[\leadsto \color{blue}{\left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{1 + y} - \sqrt{y}\right)\right) + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\sqrt{1 + t} - \sqrt{t}\right)\right)} \]
      4. Add Preprocessing
      5. Taylor expanded in t around inf 3.9%

        \[\leadsto \color{blue}{\left(\sqrt{1 + x} + \left(\sqrt{1 + y} + \sqrt{1 + z}\right)\right) - \left(\sqrt{x} + \left(\sqrt{y} + \sqrt{z}\right)\right)} \]
      6. Step-by-step derivation
        1. associate--l+21.0%

          \[\leadsto \color{blue}{\sqrt{1 + x} + \left(\left(\sqrt{1 + y} + \sqrt{1 + z}\right) - \left(\sqrt{x} + \left(\sqrt{y} + \sqrt{z}\right)\right)\right)} \]
      7. Simplified21.0%

        \[\leadsto \color{blue}{\sqrt{1 + x} + \left(\left(\sqrt{1 + y} + \sqrt{1 + z}\right) - \left(\sqrt{x} + \left(\sqrt{y} + \sqrt{z}\right)\right)\right)} \]
      8. Taylor expanded in x around inf 20.2%

        \[\leadsto \sqrt{1 + x} + \color{blue}{-1 \cdot \sqrt{x}} \]
      9. Step-by-step derivation
        1. neg-mul-120.2%

          \[\leadsto \sqrt{1 + x} + \color{blue}{\left(-\sqrt{x}\right)} \]
      10. Simplified20.2%

        \[\leadsto \sqrt{1 + x} + \color{blue}{\left(-\sqrt{x}\right)} \]
    3. Recombined 2 regimes into one program.
    4. Final simplification36.5%

      \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq 1.45:\\ \;\;\;\;\left(\sqrt{1 + z} - \sqrt{z}\right) + 2\\ \mathbf{else}:\\ \;\;\;\;\sqrt{x + 1} - \sqrt{x}\\ \end{array} \]
    5. Add Preprocessing

    Alternative 16: 63.2% accurate, 3.9× speedup?

    \[\begin{array}{l} [x, y, z, t] = \mathsf{sort}([x, y, z, t])\\ \\ \begin{array}{l} \mathbf{if}\;y \leq 1:\\ \;\;\;\;2 - \left(\sqrt{x} + \sqrt{y}\right)\\ \mathbf{else}:\\ \;\;\;\;\sqrt{x + 1} - \sqrt{x}\\ \end{array} \end{array} \]
    NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
    (FPCore (x y z t)
     :precision binary64
     (if (<= y 1.0) (- 2.0 (+ (sqrt x) (sqrt y))) (- (sqrt (+ x 1.0)) (sqrt x))))
    assert(x < y && y < z && z < t);
    double code(double x, double y, double z, double t) {
    	double tmp;
    	if (y <= 1.0) {
    		tmp = 2.0 - (sqrt(x) + sqrt(y));
    	} else {
    		tmp = sqrt((x + 1.0)) - sqrt(x);
    	}
    	return tmp;
    }
    
    NOTE: x, y, z, and t should be sorted in increasing order before calling this 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) :: tmp
        if (y <= 1.0d0) then
            tmp = 2.0d0 - (sqrt(x) + sqrt(y))
        else
            tmp = sqrt((x + 1.0d0)) - sqrt(x)
        end if
        code = tmp
    end function
    
    assert x < y && y < z && z < t;
    public static double code(double x, double y, double z, double t) {
    	double tmp;
    	if (y <= 1.0) {
    		tmp = 2.0 - (Math.sqrt(x) + Math.sqrt(y));
    	} else {
    		tmp = Math.sqrt((x + 1.0)) - Math.sqrt(x);
    	}
    	return tmp;
    }
    
    [x, y, z, t] = sort([x, y, z, t])
    def code(x, y, z, t):
    	tmp = 0
    	if y <= 1.0:
    		tmp = 2.0 - (math.sqrt(x) + math.sqrt(y))
    	else:
    		tmp = math.sqrt((x + 1.0)) - math.sqrt(x)
    	return tmp
    
    x, y, z, t = sort([x, y, z, t])
    function code(x, y, z, t)
    	tmp = 0.0
    	if (y <= 1.0)
    		tmp = Float64(2.0 - Float64(sqrt(x) + sqrt(y)));
    	else
    		tmp = Float64(sqrt(Float64(x + 1.0)) - sqrt(x));
    	end
    	return tmp
    end
    
    x, y, z, t = num2cell(sort([x, y, z, t])){:}
    function tmp_2 = code(x, y, z, t)
    	tmp = 0.0;
    	if (y <= 1.0)
    		tmp = 2.0 - (sqrt(x) + sqrt(y));
    	else
    		tmp = sqrt((x + 1.0)) - sqrt(x);
    	end
    	tmp_2 = tmp;
    end
    
    NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
    code[x_, y_, z_, t_] := If[LessEqual[y, 1.0], N[(2.0 - N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]]
    
    \begin{array}{l}
    [x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
    \\
    \begin{array}{l}
    \mathbf{if}\;y \leq 1:\\
    \;\;\;\;2 - \left(\sqrt{x} + \sqrt{y}\right)\\
    
    \mathbf{else}:\\
    \;\;\;\;\sqrt{x + 1} - \sqrt{x}\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if y < 1

      1. Initial program 97.5%

        \[\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. Step-by-step derivation
        1. associate-+l+97.5%

          \[\leadsto \color{blue}{\left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{y + 1} - \sqrt{y}\right)\right) + \left(\left(\sqrt{z + 1} - \sqrt{z}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)\right)} \]
        2. associate-+l-62.9%

          \[\leadsto \color{blue}{\left(\sqrt{x + 1} - \left(\sqrt{x} - \left(\sqrt{y + 1} - \sqrt{y}\right)\right)\right)} + \left(\left(\sqrt{z + 1} - \sqrt{z}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)\right) \]
        3. associate-+l-97.5%

          \[\leadsto \color{blue}{\left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{y + 1} - \sqrt{y}\right)\right)} + \left(\left(\sqrt{z + 1} - \sqrt{z}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)\right) \]
        4. +-commutative97.5%

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

          \[\leadsto \left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{1 + y} - \sqrt{y}\right)\right) + \left(\left(\sqrt{\color{blue}{1 + z}} - \sqrt{z}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)\right) \]
        6. +-commutative97.5%

          \[\leadsto \left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{1 + y} - \sqrt{y}\right)\right) + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\sqrt{\color{blue}{1 + t}} - \sqrt{t}\right)\right) \]
      3. Simplified97.5%

        \[\leadsto \color{blue}{\left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{1 + y} - \sqrt{y}\right)\right) + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\sqrt{1 + t} - \sqrt{t}\right)\right)} \]
      4. Add Preprocessing
      5. Taylor expanded in t around inf 20.5%

        \[\leadsto \color{blue}{\left(\sqrt{1 + x} + \left(\sqrt{1 + y} + \sqrt{1 + z}\right)\right) - \left(\sqrt{x} + \left(\sqrt{y} + \sqrt{z}\right)\right)} \]
      6. Step-by-step derivation
        1. associate--l+24.9%

          \[\leadsto \color{blue}{\sqrt{1 + x} + \left(\left(\sqrt{1 + y} + \sqrt{1 + z}\right) - \left(\sqrt{x} + \left(\sqrt{y} + \sqrt{z}\right)\right)\right)} \]
      7. Simplified24.9%

        \[\leadsto \color{blue}{\sqrt{1 + x} + \left(\left(\sqrt{1 + y} + \sqrt{1 + z}\right) - \left(\sqrt{x} + \left(\sqrt{y} + \sqrt{z}\right)\right)\right)} \]
      8. Taylor expanded in y around 0 20.0%

        \[\leadsto \color{blue}{\left(1 + \left(\sqrt{1 + x} + \sqrt{1 + z}\right)\right) - \left(\sqrt{x} + \left(\sqrt{y} + \sqrt{z}\right)\right)} \]
      9. Step-by-step derivation
        1. associate--l+38.3%

          \[\leadsto \color{blue}{1 + \left(\left(\sqrt{1 + x} + \sqrt{1 + z}\right) - \left(\sqrt{x} + \left(\sqrt{y} + \sqrt{z}\right)\right)\right)} \]
        2. +-commutative38.3%

          \[\leadsto 1 + \left(\color{blue}{\left(\sqrt{1 + z} + \sqrt{1 + x}\right)} - \left(\sqrt{x} + \left(\sqrt{y} + \sqrt{z}\right)\right)\right) \]
        3. +-commutative38.3%

          \[\leadsto 1 + \left(\left(\sqrt{1 + z} + \sqrt{1 + x}\right) - \left(\sqrt{x} + \color{blue}{\left(\sqrt{z} + \sqrt{y}\right)}\right)\right) \]
      10. Simplified38.3%

        \[\leadsto \color{blue}{1 + \left(\left(\sqrt{1 + z} + \sqrt{1 + x}\right) - \left(\sqrt{x} + \left(\sqrt{z} + \sqrt{y}\right)\right)\right)} \]
      11. Taylor expanded in x around 0 17.9%

        \[\leadsto \color{blue}{\left(2 + \sqrt{1 + z}\right) - \left(\sqrt{x} + \left(\sqrt{y} + \sqrt{z}\right)\right)} \]
      12. Step-by-step derivation
        1. associate--l+35.9%

          \[\leadsto \color{blue}{2 + \left(\sqrt{1 + z} - \left(\sqrt{x} + \left(\sqrt{y} + \sqrt{z}\right)\right)\right)} \]
        2. associate-+r+35.9%

          \[\leadsto 2 + \left(\sqrt{1 + z} - \color{blue}{\left(\left(\sqrt{x} + \sqrt{y}\right) + \sqrt{z}\right)}\right) \]
      13. Simplified35.9%

        \[\leadsto \color{blue}{2 + \left(\sqrt{1 + z} - \left(\left(\sqrt{x} + \sqrt{y}\right) + \sqrt{z}\right)\right)} \]
      14. Taylor expanded in z around inf 21.9%

        \[\leadsto \color{blue}{2 - \left(\sqrt{x} + \sqrt{y}\right)} \]
      15. Step-by-step derivation
        1. +-commutative21.9%

          \[\leadsto 2 - \color{blue}{\left(\sqrt{y} + \sqrt{x}\right)} \]
      16. Simplified21.9%

        \[\leadsto \color{blue}{2 - \left(\sqrt{y} + \sqrt{x}\right)} \]

      if 1 < y

      1. Initial program 90.7%

        \[\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. Step-by-step derivation
        1. associate-+l+90.7%

          \[\leadsto \color{blue}{\left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{y + 1} - \sqrt{y}\right)\right) + \left(\left(\sqrt{z + 1} - \sqrt{z}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)\right)} \]
        2. associate-+l-90.2%

          \[\leadsto \color{blue}{\left(\sqrt{x + 1} - \left(\sqrt{x} - \left(\sqrt{y + 1} - \sqrt{y}\right)\right)\right)} + \left(\left(\sqrt{z + 1} - \sqrt{z}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)\right) \]
        3. associate-+l-90.7%

          \[\leadsto \color{blue}{\left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{y + 1} - \sqrt{y}\right)\right)} + \left(\left(\sqrt{z + 1} - \sqrt{z}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)\right) \]
        4. +-commutative90.7%

          \[\leadsto \left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{\color{blue}{1 + y}} - \sqrt{y}\right)\right) + \left(\left(\sqrt{z + 1} - \sqrt{z}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)\right) \]
        5. +-commutative90.7%

          \[\leadsto \left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{1 + y} - \sqrt{y}\right)\right) + \left(\left(\sqrt{\color{blue}{1 + z}} - \sqrt{z}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)\right) \]
        6. +-commutative90.7%

          \[\leadsto \left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{1 + y} - \sqrt{y}\right)\right) + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\sqrt{\color{blue}{1 + t}} - \sqrt{t}\right)\right) \]
      3. Simplified90.7%

        \[\leadsto \color{blue}{\left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{1 + y} - \sqrt{y}\right)\right) + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\sqrt{1 + t} - \sqrt{t}\right)\right)} \]
      4. Add Preprocessing
      5. Taylor expanded in t around inf 3.9%

        \[\leadsto \color{blue}{\left(\sqrt{1 + x} + \left(\sqrt{1 + y} + \sqrt{1 + z}\right)\right) - \left(\sqrt{x} + \left(\sqrt{y} + \sqrt{z}\right)\right)} \]
      6. Step-by-step derivation
        1. associate--l+21.0%

          \[\leadsto \color{blue}{\sqrt{1 + x} + \left(\left(\sqrt{1 + y} + \sqrt{1 + z}\right) - \left(\sqrt{x} + \left(\sqrt{y} + \sqrt{z}\right)\right)\right)} \]
      7. Simplified21.0%

        \[\leadsto \color{blue}{\sqrt{1 + x} + \left(\left(\sqrt{1 + y} + \sqrt{1 + z}\right) - \left(\sqrt{x} + \left(\sqrt{y} + \sqrt{z}\right)\right)\right)} \]
      8. Taylor expanded in x around inf 20.2%

        \[\leadsto \sqrt{1 + x} + \color{blue}{-1 \cdot \sqrt{x}} \]
      9. Step-by-step derivation
        1. neg-mul-120.2%

          \[\leadsto \sqrt{1 + x} + \color{blue}{\left(-\sqrt{x}\right)} \]
      10. Simplified20.2%

        \[\leadsto \sqrt{1 + x} + \color{blue}{\left(-\sqrt{x}\right)} \]
    3. Recombined 2 regimes into one program.
    4. Final simplification21.0%

      \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq 1:\\ \;\;\;\;2 - \left(\sqrt{x} + \sqrt{y}\right)\\ \mathbf{else}:\\ \;\;\;\;\sqrt{x + 1} - \sqrt{x}\\ \end{array} \]
    5. Add Preprocessing

    Alternative 17: 43.5% accurate, 3.9× speedup?

    \[\begin{array}{l} [x, y, z, t] = \mathsf{sort}([x, y, z, t])\\ \\ \begin{array}{l} \mathbf{if}\;y \leq 0.25:\\ \;\;\;\;2 - \left(\sqrt{x} + \sqrt{y}\right)\\ \mathbf{else}:\\ \;\;\;\;1 + y \cdot \sqrt{\frac{1}{y}}\\ \end{array} \end{array} \]
    NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
    (FPCore (x y z t)
     :precision binary64
     (if (<= y 0.25) (- 2.0 (+ (sqrt x) (sqrt y))) (+ 1.0 (* y (sqrt (/ 1.0 y))))))
    assert(x < y && y < z && z < t);
    double code(double x, double y, double z, double t) {
    	double tmp;
    	if (y <= 0.25) {
    		tmp = 2.0 - (sqrt(x) + sqrt(y));
    	} else {
    		tmp = 1.0 + (y * sqrt((1.0 / y)));
    	}
    	return tmp;
    }
    
    NOTE: x, y, z, and t should be sorted in increasing order before calling this 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) :: tmp
        if (y <= 0.25d0) then
            tmp = 2.0d0 - (sqrt(x) + sqrt(y))
        else
            tmp = 1.0d0 + (y * sqrt((1.0d0 / y)))
        end if
        code = tmp
    end function
    
    assert x < y && y < z && z < t;
    public static double code(double x, double y, double z, double t) {
    	double tmp;
    	if (y <= 0.25) {
    		tmp = 2.0 - (Math.sqrt(x) + Math.sqrt(y));
    	} else {
    		tmp = 1.0 + (y * Math.sqrt((1.0 / y)));
    	}
    	return tmp;
    }
    
    [x, y, z, t] = sort([x, y, z, t])
    def code(x, y, z, t):
    	tmp = 0
    	if y <= 0.25:
    		tmp = 2.0 - (math.sqrt(x) + math.sqrt(y))
    	else:
    		tmp = 1.0 + (y * math.sqrt((1.0 / y)))
    	return tmp
    
    x, y, z, t = sort([x, y, z, t])
    function code(x, y, z, t)
    	tmp = 0.0
    	if (y <= 0.25)
    		tmp = Float64(2.0 - Float64(sqrt(x) + sqrt(y)));
    	else
    		tmp = Float64(1.0 + Float64(y * sqrt(Float64(1.0 / y))));
    	end
    	return tmp
    end
    
    x, y, z, t = num2cell(sort([x, y, z, t])){:}
    function tmp_2 = code(x, y, z, t)
    	tmp = 0.0;
    	if (y <= 0.25)
    		tmp = 2.0 - (sqrt(x) + sqrt(y));
    	else
    		tmp = 1.0 + (y * sqrt((1.0 / y)));
    	end
    	tmp_2 = tmp;
    end
    
    NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
    code[x_, y_, z_, t_] := If[LessEqual[y, 0.25], N[(2.0 - N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(y * N[Sqrt[N[(1.0 / y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
    
    \begin{array}{l}
    [x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
    \\
    \begin{array}{l}
    \mathbf{if}\;y \leq 0.25:\\
    \;\;\;\;2 - \left(\sqrt{x} + \sqrt{y}\right)\\
    
    \mathbf{else}:\\
    \;\;\;\;1 + y \cdot \sqrt{\frac{1}{y}}\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if y < 0.25

      1. Initial program 97.5%

        \[\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. Step-by-step derivation
        1. associate-+l+97.5%

          \[\leadsto \color{blue}{\left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{y + 1} - \sqrt{y}\right)\right) + \left(\left(\sqrt{z + 1} - \sqrt{z}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)\right)} \]
        2. associate-+l-62.9%

          \[\leadsto \color{blue}{\left(\sqrt{x + 1} - \left(\sqrt{x} - \left(\sqrt{y + 1} - \sqrt{y}\right)\right)\right)} + \left(\left(\sqrt{z + 1} - \sqrt{z}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)\right) \]
        3. associate-+l-97.5%

          \[\leadsto \color{blue}{\left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{y + 1} - \sqrt{y}\right)\right)} + \left(\left(\sqrt{z + 1} - \sqrt{z}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)\right) \]
        4. +-commutative97.5%

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

          \[\leadsto \left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{1 + y} - \sqrt{y}\right)\right) + \left(\left(\sqrt{\color{blue}{1 + z}} - \sqrt{z}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)\right) \]
        6. +-commutative97.5%

          \[\leadsto \left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{1 + y} - \sqrt{y}\right)\right) + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\sqrt{\color{blue}{1 + t}} - \sqrt{t}\right)\right) \]
      3. Simplified97.5%

        \[\leadsto \color{blue}{\left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{1 + y} - \sqrt{y}\right)\right) + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\sqrt{1 + t} - \sqrt{t}\right)\right)} \]
      4. Add Preprocessing
      5. Taylor expanded in t around inf 20.5%

        \[\leadsto \color{blue}{\left(\sqrt{1 + x} + \left(\sqrt{1 + y} + \sqrt{1 + z}\right)\right) - \left(\sqrt{x} + \left(\sqrt{y} + \sqrt{z}\right)\right)} \]
      6. Step-by-step derivation
        1. associate--l+24.9%

          \[\leadsto \color{blue}{\sqrt{1 + x} + \left(\left(\sqrt{1 + y} + \sqrt{1 + z}\right) - \left(\sqrt{x} + \left(\sqrt{y} + \sqrt{z}\right)\right)\right)} \]
      7. Simplified24.9%

        \[\leadsto \color{blue}{\sqrt{1 + x} + \left(\left(\sqrt{1 + y} + \sqrt{1 + z}\right) - \left(\sqrt{x} + \left(\sqrt{y} + \sqrt{z}\right)\right)\right)} \]
      8. Taylor expanded in y around 0 20.0%

        \[\leadsto \color{blue}{\left(1 + \left(\sqrt{1 + x} + \sqrt{1 + z}\right)\right) - \left(\sqrt{x} + \left(\sqrt{y} + \sqrt{z}\right)\right)} \]
      9. Step-by-step derivation
        1. associate--l+38.3%

          \[\leadsto \color{blue}{1 + \left(\left(\sqrt{1 + x} + \sqrt{1 + z}\right) - \left(\sqrt{x} + \left(\sqrt{y} + \sqrt{z}\right)\right)\right)} \]
        2. +-commutative38.3%

          \[\leadsto 1 + \left(\color{blue}{\left(\sqrt{1 + z} + \sqrt{1 + x}\right)} - \left(\sqrt{x} + \left(\sqrt{y} + \sqrt{z}\right)\right)\right) \]
        3. +-commutative38.3%

          \[\leadsto 1 + \left(\left(\sqrt{1 + z} + \sqrt{1 + x}\right) - \left(\sqrt{x} + \color{blue}{\left(\sqrt{z} + \sqrt{y}\right)}\right)\right) \]
      10. Simplified38.3%

        \[\leadsto \color{blue}{1 + \left(\left(\sqrt{1 + z} + \sqrt{1 + x}\right) - \left(\sqrt{x} + \left(\sqrt{z} + \sqrt{y}\right)\right)\right)} \]
      11. Taylor expanded in x around 0 17.9%

        \[\leadsto \color{blue}{\left(2 + \sqrt{1 + z}\right) - \left(\sqrt{x} + \left(\sqrt{y} + \sqrt{z}\right)\right)} \]
      12. Step-by-step derivation
        1. associate--l+35.9%

          \[\leadsto \color{blue}{2 + \left(\sqrt{1 + z} - \left(\sqrt{x} + \left(\sqrt{y} + \sqrt{z}\right)\right)\right)} \]
        2. associate-+r+35.9%

          \[\leadsto 2 + \left(\sqrt{1 + z} - \color{blue}{\left(\left(\sqrt{x} + \sqrt{y}\right) + \sqrt{z}\right)}\right) \]
      13. Simplified35.9%

        \[\leadsto \color{blue}{2 + \left(\sqrt{1 + z} - \left(\left(\sqrt{x} + \sqrt{y}\right) + \sqrt{z}\right)\right)} \]
      14. Taylor expanded in z around inf 21.9%

        \[\leadsto \color{blue}{2 - \left(\sqrt{x} + \sqrt{y}\right)} \]
      15. Step-by-step derivation
        1. +-commutative21.9%

          \[\leadsto 2 - \color{blue}{\left(\sqrt{y} + \sqrt{x}\right)} \]
      16. Simplified21.9%

        \[\leadsto \color{blue}{2 - \left(\sqrt{y} + \sqrt{x}\right)} \]

      if 0.25 < y

      1. Initial program 90.7%

        \[\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. Step-by-step derivation
        1. associate-+l+90.7%

          \[\leadsto \color{blue}{\left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{y + 1} - \sqrt{y}\right)\right) + \left(\left(\sqrt{z + 1} - \sqrt{z}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)\right)} \]
        2. associate-+l-90.2%

          \[\leadsto \color{blue}{\left(\sqrt{x + 1} - \left(\sqrt{x} - \left(\sqrt{y + 1} - \sqrt{y}\right)\right)\right)} + \left(\left(\sqrt{z + 1} - \sqrt{z}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)\right) \]
        3. associate-+l-90.7%

          \[\leadsto \color{blue}{\left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{y + 1} - \sqrt{y}\right)\right)} + \left(\left(\sqrt{z + 1} - \sqrt{z}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)\right) \]
        4. +-commutative90.7%

          \[\leadsto \left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{\color{blue}{1 + y}} - \sqrt{y}\right)\right) + \left(\left(\sqrt{z + 1} - \sqrt{z}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)\right) \]
        5. +-commutative90.7%

          \[\leadsto \left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{1 + y} - \sqrt{y}\right)\right) + \left(\left(\sqrt{\color{blue}{1 + z}} - \sqrt{z}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)\right) \]
        6. +-commutative90.7%

          \[\leadsto \left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{1 + y} - \sqrt{y}\right)\right) + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\sqrt{\color{blue}{1 + t}} - \sqrt{t}\right)\right) \]
      3. Simplified90.7%

        \[\leadsto \color{blue}{\left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{1 + y} - \sqrt{y}\right)\right) + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\sqrt{1 + t} - \sqrt{t}\right)\right)} \]
      4. Add Preprocessing
      5. Taylor expanded in t around inf 3.9%

        \[\leadsto \color{blue}{\left(\sqrt{1 + x} + \left(\sqrt{1 + y} + \sqrt{1 + z}\right)\right) - \left(\sqrt{x} + \left(\sqrt{y} + \sqrt{z}\right)\right)} \]
      6. Step-by-step derivation
        1. associate--l+21.0%

          \[\leadsto \color{blue}{\sqrt{1 + x} + \left(\left(\sqrt{1 + y} + \sqrt{1 + z}\right) - \left(\sqrt{x} + \left(\sqrt{y} + \sqrt{z}\right)\right)\right)} \]
      7. Simplified21.0%

        \[\leadsto \color{blue}{\sqrt{1 + x} + \left(\left(\sqrt{1 + y} + \sqrt{1 + z}\right) - \left(\sqrt{x} + \left(\sqrt{y} + \sqrt{z}\right)\right)\right)} \]
      8. Taylor expanded in y around 0 1.9%

        \[\leadsto \color{blue}{\left(1 + \left(\sqrt{1 + x} + \sqrt{1 + z}\right)\right) - \left(\sqrt{x} + \left(\sqrt{y} + \sqrt{z}\right)\right)} \]
      9. Step-by-step derivation
        1. associate--l+22.4%

          \[\leadsto \color{blue}{1 + \left(\left(\sqrt{1 + x} + \sqrt{1 + z}\right) - \left(\sqrt{x} + \left(\sqrt{y} + \sqrt{z}\right)\right)\right)} \]
        2. +-commutative22.4%

          \[\leadsto 1 + \left(\color{blue}{\left(\sqrt{1 + z} + \sqrt{1 + x}\right)} - \left(\sqrt{x} + \left(\sqrt{y} + \sqrt{z}\right)\right)\right) \]
        3. +-commutative22.4%

          \[\leadsto 1 + \left(\left(\sqrt{1 + z} + \sqrt{1 + x}\right) - \left(\sqrt{x} + \color{blue}{\left(\sqrt{z} + \sqrt{y}\right)}\right)\right) \]
      10. Simplified22.4%

        \[\leadsto \color{blue}{1 + \left(\left(\sqrt{1 + z} + \sqrt{1 + x}\right) - \left(\sqrt{x} + \left(\sqrt{z} + \sqrt{y}\right)\right)\right)} \]
      11. Taylor expanded in y around inf 22.4%

        \[\leadsto 1 + \color{blue}{y \cdot \left(\left(\frac{1}{y} \cdot \sqrt{1 + x} + \frac{1}{y} \cdot \sqrt{1 + z}\right) - \left(\sqrt{\frac{1}{y}} + \left(\sqrt{x} \cdot \frac{1}{y} + \frac{1}{y} \cdot \sqrt{z}\right)\right)\right)} \]
      12. Step-by-step derivation
        1. distribute-lft-out21.7%

          \[\leadsto 1 + y \cdot \left(\color{blue}{\frac{1}{y} \cdot \left(\sqrt{1 + x} + \sqrt{1 + z}\right)} - \left(\sqrt{\frac{1}{y}} + \left(\sqrt{x} \cdot \frac{1}{y} + \frac{1}{y} \cdot \sqrt{z}\right)\right)\right) \]
        2. +-commutative21.7%

          \[\leadsto 1 + y \cdot \left(\frac{1}{y} \cdot \color{blue}{\left(\sqrt{1 + z} + \sqrt{1 + x}\right)} - \left(\sqrt{\frac{1}{y}} + \left(\sqrt{x} \cdot \frac{1}{y} + \frac{1}{y} \cdot \sqrt{z}\right)\right)\right) \]
        3. associate-*r/18.1%

          \[\leadsto 1 + y \cdot \left(\frac{1}{y} \cdot \left(\sqrt{1 + z} + \sqrt{1 + x}\right) - \left(\sqrt{\frac{1}{y}} + \left(\color{blue}{\frac{\sqrt{x} \cdot 1}{y}} + \frac{1}{y} \cdot \sqrt{z}\right)\right)\right) \]
        4. *-rgt-identity18.1%

          \[\leadsto 1 + y \cdot \left(\frac{1}{y} \cdot \left(\sqrt{1 + z} + \sqrt{1 + x}\right) - \left(\sqrt{\frac{1}{y}} + \left(\frac{\color{blue}{\sqrt{x}}}{y} + \frac{1}{y} \cdot \sqrt{z}\right)\right)\right) \]
        5. *-commutative18.1%

          \[\leadsto 1 + y \cdot \left(\frac{1}{y} \cdot \left(\sqrt{1 + z} + \sqrt{1 + x}\right) - \left(\sqrt{\frac{1}{y}} + \left(\frac{\sqrt{x}}{y} + \color{blue}{\sqrt{z} \cdot \frac{1}{y}}\right)\right)\right) \]
      13. Simplified18.1%

        \[\leadsto 1 + \color{blue}{y \cdot \left(\frac{1}{y} \cdot \left(\sqrt{1 + z} + \sqrt{1 + x}\right) - \left(\sqrt{\frac{1}{y}} + \left(\frac{\sqrt{x}}{y} + \sqrt{z} \cdot \frac{1}{y}\right)\right)\right)} \]
      14. Taylor expanded in y around -inf 0.0%

        \[\leadsto 1 + y \cdot \color{blue}{\left(-1 \cdot \left(\sqrt{\frac{1}{y}} \cdot {\left(\sqrt{-1}\right)}^{2}\right)\right)} \]
      15. Step-by-step derivation
        1. mul-1-neg0.0%

          \[\leadsto 1 + y \cdot \color{blue}{\left(-\sqrt{\frac{1}{y}} \cdot {\left(\sqrt{-1}\right)}^{2}\right)} \]
        2. *-commutative0.0%

          \[\leadsto 1 + y \cdot \left(-\color{blue}{{\left(\sqrt{-1}\right)}^{2} \cdot \sqrt{\frac{1}{y}}}\right) \]
        3. unpow20.0%

          \[\leadsto 1 + y \cdot \left(-\color{blue}{\left(\sqrt{-1} \cdot \sqrt{-1}\right)} \cdot \sqrt{\frac{1}{y}}\right) \]
        4. rem-square-sqrt6.9%

          \[\leadsto 1 + y \cdot \left(-\color{blue}{-1} \cdot \sqrt{\frac{1}{y}}\right) \]
        5. distribute-lft-neg-in6.9%

          \[\leadsto 1 + y \cdot \color{blue}{\left(\left(--1\right) \cdot \sqrt{\frac{1}{y}}\right)} \]
        6. metadata-eval6.9%

          \[\leadsto 1 + y \cdot \left(\color{blue}{1} \cdot \sqrt{\frac{1}{y}}\right) \]
        7. *-lft-identity6.9%

          \[\leadsto 1 + y \cdot \color{blue}{\sqrt{\frac{1}{y}}} \]
      16. Simplified6.9%

        \[\leadsto 1 + y \cdot \color{blue}{\sqrt{\frac{1}{y}}} \]
    3. Recombined 2 regimes into one program.
    4. Final simplification14.1%

      \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq 0.25:\\ \;\;\;\;2 - \left(\sqrt{x} + \sqrt{y}\right)\\ \mathbf{else}:\\ \;\;\;\;1 + y \cdot \sqrt{\frac{1}{y}}\\ \end{array} \]
    5. Add Preprocessing

    Alternative 18: 15.3% accurate, 7.7× speedup?

    \[\begin{array}{l} [x, y, z, t] = \mathsf{sort}([x, y, z, t])\\ \\ 1 + y \cdot \sqrt{\frac{1}{y}} \end{array} \]
    NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
    (FPCore (x y z t) :precision binary64 (+ 1.0 (* y (sqrt (/ 1.0 y)))))
    assert(x < y && y < z && z < t);
    double code(double x, double y, double z, double t) {
    	return 1.0 + (y * sqrt((1.0 / y)));
    }
    
    NOTE: x, y, z, and t should be sorted in increasing order before calling this 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
        code = 1.0d0 + (y * sqrt((1.0d0 / y)))
    end function
    
    assert x < y && y < z && z < t;
    public static double code(double x, double y, double z, double t) {
    	return 1.0 + (y * Math.sqrt((1.0 / y)));
    }
    
    [x, y, z, t] = sort([x, y, z, t])
    def code(x, y, z, t):
    	return 1.0 + (y * math.sqrt((1.0 / y)))
    
    x, y, z, t = sort([x, y, z, t])
    function code(x, y, z, t)
    	return Float64(1.0 + Float64(y * sqrt(Float64(1.0 / y))))
    end
    
    x, y, z, t = num2cell(sort([x, y, z, t])){:}
    function tmp = code(x, y, z, t)
    	tmp = 1.0 + (y * sqrt((1.0 / y)));
    end
    
    NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
    code[x_, y_, z_, t_] := N[(1.0 + N[(y * N[Sqrt[N[(1.0 / y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
    
    \begin{array}{l}
    [x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
    \\
    1 + y \cdot \sqrt{\frac{1}{y}}
    \end{array}
    
    Derivation
    1. Initial program 94.0%

      \[\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. Step-by-step derivation
      1. associate-+l+94.0%

        \[\leadsto \color{blue}{\left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{y + 1} - \sqrt{y}\right)\right) + \left(\left(\sqrt{z + 1} - \sqrt{z}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)\right)} \]
      2. associate-+l-77.0%

        \[\leadsto \color{blue}{\left(\sqrt{x + 1} - \left(\sqrt{x} - \left(\sqrt{y + 1} - \sqrt{y}\right)\right)\right)} + \left(\left(\sqrt{z + 1} - \sqrt{z}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)\right) \]
      3. associate-+l-94.0%

        \[\leadsto \color{blue}{\left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{y + 1} - \sqrt{y}\right)\right)} + \left(\left(\sqrt{z + 1} - \sqrt{z}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)\right) \]
      4. +-commutative94.0%

        \[\leadsto \left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{\color{blue}{1 + y}} - \sqrt{y}\right)\right) + \left(\left(\sqrt{z + 1} - \sqrt{z}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)\right) \]
      5. +-commutative94.0%

        \[\leadsto \left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{1 + y} - \sqrt{y}\right)\right) + \left(\left(\sqrt{\color{blue}{1 + z}} - \sqrt{z}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)\right) \]
      6. +-commutative94.0%

        \[\leadsto \left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{1 + y} - \sqrt{y}\right)\right) + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\sqrt{\color{blue}{1 + t}} - \sqrt{t}\right)\right) \]
    3. Simplified94.0%

      \[\leadsto \color{blue}{\left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{1 + y} - \sqrt{y}\right)\right) + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\sqrt{1 + t} - \sqrt{t}\right)\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in t around inf 11.9%

      \[\leadsto \color{blue}{\left(\sqrt{1 + x} + \left(\sqrt{1 + y} + \sqrt{1 + z}\right)\right) - \left(\sqrt{x} + \left(\sqrt{y} + \sqrt{z}\right)\right)} \]
    6. Step-by-step derivation
      1. associate--l+22.9%

        \[\leadsto \color{blue}{\sqrt{1 + x} + \left(\left(\sqrt{1 + y} + \sqrt{1 + z}\right) - \left(\sqrt{x} + \left(\sqrt{y} + \sqrt{z}\right)\right)\right)} \]
    7. Simplified22.9%

      \[\leadsto \color{blue}{\sqrt{1 + x} + \left(\left(\sqrt{1 + y} + \sqrt{1 + z}\right) - \left(\sqrt{x} + \left(\sqrt{y} + \sqrt{z}\right)\right)\right)} \]
    8. Taylor expanded in y around 0 10.7%

      \[\leadsto \color{blue}{\left(1 + \left(\sqrt{1 + x} + \sqrt{1 + z}\right)\right) - \left(\sqrt{x} + \left(\sqrt{y} + \sqrt{z}\right)\right)} \]
    9. Step-by-step derivation
      1. associate--l+30.1%

        \[\leadsto \color{blue}{1 + \left(\left(\sqrt{1 + x} + \sqrt{1 + z}\right) - \left(\sqrt{x} + \left(\sqrt{y} + \sqrt{z}\right)\right)\right)} \]
      2. +-commutative30.1%

        \[\leadsto 1 + \left(\color{blue}{\left(\sqrt{1 + z} + \sqrt{1 + x}\right)} - \left(\sqrt{x} + \left(\sqrt{y} + \sqrt{z}\right)\right)\right) \]
      3. +-commutative30.1%

        \[\leadsto 1 + \left(\left(\sqrt{1 + z} + \sqrt{1 + x}\right) - \left(\sqrt{x} + \color{blue}{\left(\sqrt{z} + \sqrt{y}\right)}\right)\right) \]
    10. Simplified30.1%

      \[\leadsto \color{blue}{1 + \left(\left(\sqrt{1 + z} + \sqrt{1 + x}\right) - \left(\sqrt{x} + \left(\sqrt{z} + \sqrt{y}\right)\right)\right)} \]
    11. Taylor expanded in y around inf 27.8%

      \[\leadsto 1 + \color{blue}{y \cdot \left(\left(\frac{1}{y} \cdot \sqrt{1 + x} + \frac{1}{y} \cdot \sqrt{1 + z}\right) - \left(\sqrt{\frac{1}{y}} + \left(\sqrt{x} \cdot \frac{1}{y} + \frac{1}{y} \cdot \sqrt{z}\right)\right)\right)} \]
    12. Step-by-step derivation
      1. distribute-lft-out27.1%

        \[\leadsto 1 + y \cdot \left(\color{blue}{\frac{1}{y} \cdot \left(\sqrt{1 + x} + \sqrt{1 + z}\right)} - \left(\sqrt{\frac{1}{y}} + \left(\sqrt{x} \cdot \frac{1}{y} + \frac{1}{y} \cdot \sqrt{z}\right)\right)\right) \]
      2. +-commutative27.1%

        \[\leadsto 1 + y \cdot \left(\frac{1}{y} \cdot \color{blue}{\left(\sqrt{1 + z} + \sqrt{1 + x}\right)} - \left(\sqrt{\frac{1}{y}} + \left(\sqrt{x} \cdot \frac{1}{y} + \frac{1}{y} \cdot \sqrt{z}\right)\right)\right) \]
      3. associate-*r/24.5%

        \[\leadsto 1 + y \cdot \left(\frac{1}{y} \cdot \left(\sqrt{1 + z} + \sqrt{1 + x}\right) - \left(\sqrt{\frac{1}{y}} + \left(\color{blue}{\frac{\sqrt{x} \cdot 1}{y}} + \frac{1}{y} \cdot \sqrt{z}\right)\right)\right) \]
      4. *-rgt-identity24.5%

        \[\leadsto 1 + y \cdot \left(\frac{1}{y} \cdot \left(\sqrt{1 + z} + \sqrt{1 + x}\right) - \left(\sqrt{\frac{1}{y}} + \left(\frac{\color{blue}{\sqrt{x}}}{y} + \frac{1}{y} \cdot \sqrt{z}\right)\right)\right) \]
      5. *-commutative24.5%

        \[\leadsto 1 + y \cdot \left(\frac{1}{y} \cdot \left(\sqrt{1 + z} + \sqrt{1 + x}\right) - \left(\sqrt{\frac{1}{y}} + \left(\frac{\sqrt{x}}{y} + \color{blue}{\sqrt{z} \cdot \frac{1}{y}}\right)\right)\right) \]
    13. Simplified24.5%

      \[\leadsto 1 + \color{blue}{y \cdot \left(\frac{1}{y} \cdot \left(\sqrt{1 + z} + \sqrt{1 + x}\right) - \left(\sqrt{\frac{1}{y}} + \left(\frac{\sqrt{x}}{y} + \sqrt{z} \cdot \frac{1}{y}\right)\right)\right)} \]
    14. Taylor expanded in y around -inf 0.0%

      \[\leadsto 1 + y \cdot \color{blue}{\left(-1 \cdot \left(\sqrt{\frac{1}{y}} \cdot {\left(\sqrt{-1}\right)}^{2}\right)\right)} \]
    15. Step-by-step derivation
      1. mul-1-neg0.0%

        \[\leadsto 1 + y \cdot \color{blue}{\left(-\sqrt{\frac{1}{y}} \cdot {\left(\sqrt{-1}\right)}^{2}\right)} \]
      2. *-commutative0.0%

        \[\leadsto 1 + y \cdot \left(-\color{blue}{{\left(\sqrt{-1}\right)}^{2} \cdot \sqrt{\frac{1}{y}}}\right) \]
      3. unpow20.0%

        \[\leadsto 1 + y \cdot \left(-\color{blue}{\left(\sqrt{-1} \cdot \sqrt{-1}\right)} \cdot \sqrt{\frac{1}{y}}\right) \]
      4. rem-square-sqrt16.1%

        \[\leadsto 1 + y \cdot \left(-\color{blue}{-1} \cdot \sqrt{\frac{1}{y}}\right) \]
      5. distribute-lft-neg-in16.1%

        \[\leadsto 1 + y \cdot \color{blue}{\left(\left(--1\right) \cdot \sqrt{\frac{1}{y}}\right)} \]
      6. metadata-eval16.1%

        \[\leadsto 1 + y \cdot \left(\color{blue}{1} \cdot \sqrt{\frac{1}{y}}\right) \]
      7. *-lft-identity16.1%

        \[\leadsto 1 + y \cdot \color{blue}{\sqrt{\frac{1}{y}}} \]
    16. Simplified16.1%

      \[\leadsto 1 + y \cdot \color{blue}{\sqrt{\frac{1}{y}}} \]
    17. Add Preprocessing

    Alternative 19: 2.5% accurate, 7.8× speedup?

    \[\begin{array}{l} [x, y, z, t] = \mathsf{sort}([x, y, z, t])\\ \\ 1 - \left(\sqrt{y} - -1\right) \end{array} \]
    NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
    (FPCore (x y z t) :precision binary64 (- 1.0 (- (sqrt y) -1.0)))
    assert(x < y && y < z && z < t);
    double code(double x, double y, double z, double t) {
    	return 1.0 - (sqrt(y) - -1.0);
    }
    
    NOTE: x, y, z, and t should be sorted in increasing order before calling this 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
        code = 1.0d0 - (sqrt(y) - (-1.0d0))
    end function
    
    assert x < y && y < z && z < t;
    public static double code(double x, double y, double z, double t) {
    	return 1.0 - (Math.sqrt(y) - -1.0);
    }
    
    [x, y, z, t] = sort([x, y, z, t])
    def code(x, y, z, t):
    	return 1.0 - (math.sqrt(y) - -1.0)
    
    x, y, z, t = sort([x, y, z, t])
    function code(x, y, z, t)
    	return Float64(1.0 - Float64(sqrt(y) - -1.0))
    end
    
    x, y, z, t = num2cell(sort([x, y, z, t])){:}
    function tmp = code(x, y, z, t)
    	tmp = 1.0 - (sqrt(y) - -1.0);
    end
    
    NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
    code[x_, y_, z_, t_] := N[(1.0 - N[(N[Sqrt[y], $MachinePrecision] - -1.0), $MachinePrecision]), $MachinePrecision]
    
    \begin{array}{l}
    [x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
    \\
    1 - \left(\sqrt{y} - -1\right)
    \end{array}
    
    Derivation
    1. Initial program 94.0%

      \[\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. Step-by-step derivation
      1. associate-+l+94.0%

        \[\leadsto \color{blue}{\left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{y + 1} - \sqrt{y}\right)\right) + \left(\left(\sqrt{z + 1} - \sqrt{z}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)\right)} \]
      2. associate-+l-77.0%

        \[\leadsto \color{blue}{\left(\sqrt{x + 1} - \left(\sqrt{x} - \left(\sqrt{y + 1} - \sqrt{y}\right)\right)\right)} + \left(\left(\sqrt{z + 1} - \sqrt{z}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)\right) \]
      3. associate-+l-94.0%

        \[\leadsto \color{blue}{\left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{y + 1} - \sqrt{y}\right)\right)} + \left(\left(\sqrt{z + 1} - \sqrt{z}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)\right) \]
      4. +-commutative94.0%

        \[\leadsto \left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{\color{blue}{1 + y}} - \sqrt{y}\right)\right) + \left(\left(\sqrt{z + 1} - \sqrt{z}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)\right) \]
      5. +-commutative94.0%

        \[\leadsto \left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{1 + y} - \sqrt{y}\right)\right) + \left(\left(\sqrt{\color{blue}{1 + z}} - \sqrt{z}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)\right) \]
      6. +-commutative94.0%

        \[\leadsto \left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{1 + y} - \sqrt{y}\right)\right) + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\sqrt{\color{blue}{1 + t}} - \sqrt{t}\right)\right) \]
    3. Simplified94.0%

      \[\leadsto \color{blue}{\left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{1 + y} - \sqrt{y}\right)\right) + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\sqrt{1 + t} - \sqrt{t}\right)\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in y around 0 10.0%

      \[\leadsto \color{blue}{\left(1 + \left(\sqrt{1 + t} + \left(\sqrt{1 + x} + \sqrt{1 + z}\right)\right)\right) - \left(\sqrt{t} + \left(\sqrt{x} + \left(\sqrt{y} + \sqrt{z}\right)\right)\right)} \]
    6. Step-by-step derivation
      1. associate-+r+10.0%

        \[\leadsto \color{blue}{\left(\left(1 + \sqrt{1 + t}\right) + \left(\sqrt{1 + x} + \sqrt{1 + z}\right)\right)} - \left(\sqrt{t} + \left(\sqrt{x} + \left(\sqrt{y} + \sqrt{z}\right)\right)\right) \]
      2. +-commutative10.0%

        \[\leadsto \left(\left(1 + \sqrt{1 + t}\right) + \color{blue}{\left(\sqrt{1 + z} + \sqrt{1 + x}\right)}\right) - \left(\sqrt{t} + \left(\sqrt{x} + \left(\sqrt{y} + \sqrt{z}\right)\right)\right) \]
    7. Simplified10.0%

      \[\leadsto \color{blue}{\left(\left(1 + \sqrt{1 + t}\right) + \left(\sqrt{1 + z} + \sqrt{1 + x}\right)\right) - \left(\sqrt{t} + \left(\sqrt{x} + \left(\sqrt{y} + \sqrt{z}\right)\right)\right)} \]
    8. Taylor expanded in y around inf 1.6%

      \[\leadsto \color{blue}{-1 \cdot \sqrt{y}} \]
    9. Step-by-step derivation
      1. mul-1-neg1.6%

        \[\leadsto \color{blue}{-\sqrt{y}} \]
    10. Simplified1.6%

      \[\leadsto \color{blue}{-\sqrt{y}} \]
    11. Step-by-step derivation
      1. expm1-log1p-u0.9%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(-\sqrt{y}\right)\right)} \]
      2. expm1-undefine1.4%

        \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(-\sqrt{y}\right)} - 1} \]
    12. Applied egg-rr1.4%

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(-\sqrt{y}\right)} - 1} \]
    13. Step-by-step derivation
      1. sub-neg1.4%

        \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(-\sqrt{y}\right)} + \left(-1\right)} \]
      2. log1p-undefine1.4%

        \[\leadsto e^{\color{blue}{\log \left(1 + \left(-\sqrt{y}\right)\right)}} + \left(-1\right) \]
      3. rem-exp-log2.1%

        \[\leadsto \color{blue}{\left(1 + \left(-\sqrt{y}\right)\right)} + \left(-1\right) \]
      4. unsub-neg2.1%

        \[\leadsto \color{blue}{\left(1 - \sqrt{y}\right)} + \left(-1\right) \]
      5. metadata-eval2.1%

        \[\leadsto \left(1 - \sqrt{y}\right) + \color{blue}{-1} \]
    14. Simplified2.1%

      \[\leadsto \color{blue}{\left(1 - \sqrt{y}\right) + -1} \]
    15. Step-by-step derivation
      1. associate-+l-2.1%

        \[\leadsto \color{blue}{1 - \left(\sqrt{y} - -1\right)} \]
    16. Applied egg-rr2.1%

      \[\leadsto \color{blue}{1 - \left(\sqrt{y} - -1\right)} \]
    17. Add Preprocessing

    Alternative 20: 2.5% accurate, 7.8× speedup?

    \[\begin{array}{l} [x, y, z, t] = \mathsf{sort}([x, y, z, t])\\ \\ -1 + \left(1 - \sqrt{y}\right) \end{array} \]
    NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
    (FPCore (x y z t) :precision binary64 (+ -1.0 (- 1.0 (sqrt y))))
    assert(x < y && y < z && z < t);
    double code(double x, double y, double z, double t) {
    	return -1.0 + (1.0 - sqrt(y));
    }
    
    NOTE: x, y, z, and t should be sorted in increasing order before calling this 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
        code = (-1.0d0) + (1.0d0 - sqrt(y))
    end function
    
    assert x < y && y < z && z < t;
    public static double code(double x, double y, double z, double t) {
    	return -1.0 + (1.0 - Math.sqrt(y));
    }
    
    [x, y, z, t] = sort([x, y, z, t])
    def code(x, y, z, t):
    	return -1.0 + (1.0 - math.sqrt(y))
    
    x, y, z, t = sort([x, y, z, t])
    function code(x, y, z, t)
    	return Float64(-1.0 + Float64(1.0 - sqrt(y)))
    end
    
    x, y, z, t = num2cell(sort([x, y, z, t])){:}
    function tmp = code(x, y, z, t)
    	tmp = -1.0 + (1.0 - sqrt(y));
    end
    
    NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
    code[x_, y_, z_, t_] := N[(-1.0 + N[(1.0 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
    
    \begin{array}{l}
    [x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
    \\
    -1 + \left(1 - \sqrt{y}\right)
    \end{array}
    
    Derivation
    1. Initial program 94.0%

      \[\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. Step-by-step derivation
      1. associate-+l+94.0%

        \[\leadsto \color{blue}{\left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{y + 1} - \sqrt{y}\right)\right) + \left(\left(\sqrt{z + 1} - \sqrt{z}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)\right)} \]
      2. associate-+l-77.0%

        \[\leadsto \color{blue}{\left(\sqrt{x + 1} - \left(\sqrt{x} - \left(\sqrt{y + 1} - \sqrt{y}\right)\right)\right)} + \left(\left(\sqrt{z + 1} - \sqrt{z}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)\right) \]
      3. associate-+l-94.0%

        \[\leadsto \color{blue}{\left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{y + 1} - \sqrt{y}\right)\right)} + \left(\left(\sqrt{z + 1} - \sqrt{z}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)\right) \]
      4. +-commutative94.0%

        \[\leadsto \left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{\color{blue}{1 + y}} - \sqrt{y}\right)\right) + \left(\left(\sqrt{z + 1} - \sqrt{z}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)\right) \]
      5. +-commutative94.0%

        \[\leadsto \left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{1 + y} - \sqrt{y}\right)\right) + \left(\left(\sqrt{\color{blue}{1 + z}} - \sqrt{z}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)\right) \]
      6. +-commutative94.0%

        \[\leadsto \left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{1 + y} - \sqrt{y}\right)\right) + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\sqrt{\color{blue}{1 + t}} - \sqrt{t}\right)\right) \]
    3. Simplified94.0%

      \[\leadsto \color{blue}{\left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{1 + y} - \sqrt{y}\right)\right) + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\sqrt{1 + t} - \sqrt{t}\right)\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in y around 0 10.0%

      \[\leadsto \color{blue}{\left(1 + \left(\sqrt{1 + t} + \left(\sqrt{1 + x} + \sqrt{1 + z}\right)\right)\right) - \left(\sqrt{t} + \left(\sqrt{x} + \left(\sqrt{y} + \sqrt{z}\right)\right)\right)} \]
    6. Step-by-step derivation
      1. associate-+r+10.0%

        \[\leadsto \color{blue}{\left(\left(1 + \sqrt{1 + t}\right) + \left(\sqrt{1 + x} + \sqrt{1 + z}\right)\right)} - \left(\sqrt{t} + \left(\sqrt{x} + \left(\sqrt{y} + \sqrt{z}\right)\right)\right) \]
      2. +-commutative10.0%

        \[\leadsto \left(\left(1 + \sqrt{1 + t}\right) + \color{blue}{\left(\sqrt{1 + z} + \sqrt{1 + x}\right)}\right) - \left(\sqrt{t} + \left(\sqrt{x} + \left(\sqrt{y} + \sqrt{z}\right)\right)\right) \]
    7. Simplified10.0%

      \[\leadsto \color{blue}{\left(\left(1 + \sqrt{1 + t}\right) + \left(\sqrt{1 + z} + \sqrt{1 + x}\right)\right) - \left(\sqrt{t} + \left(\sqrt{x} + \left(\sqrt{y} + \sqrt{z}\right)\right)\right)} \]
    8. Taylor expanded in y around inf 1.6%

      \[\leadsto \color{blue}{-1 \cdot \sqrt{y}} \]
    9. Step-by-step derivation
      1. mul-1-neg1.6%

        \[\leadsto \color{blue}{-\sqrt{y}} \]
    10. Simplified1.6%

      \[\leadsto \color{blue}{-\sqrt{y}} \]
    11. Step-by-step derivation
      1. expm1-log1p-u0.9%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(-\sqrt{y}\right)\right)} \]
      2. expm1-undefine1.4%

        \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(-\sqrt{y}\right)} - 1} \]
    12. Applied egg-rr1.4%

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(-\sqrt{y}\right)} - 1} \]
    13. Step-by-step derivation
      1. sub-neg1.4%

        \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(-\sqrt{y}\right)} + \left(-1\right)} \]
      2. log1p-undefine1.4%

        \[\leadsto e^{\color{blue}{\log \left(1 + \left(-\sqrt{y}\right)\right)}} + \left(-1\right) \]
      3. rem-exp-log2.1%

        \[\leadsto \color{blue}{\left(1 + \left(-\sqrt{y}\right)\right)} + \left(-1\right) \]
      4. unsub-neg2.1%

        \[\leadsto \color{blue}{\left(1 - \sqrt{y}\right)} + \left(-1\right) \]
      5. metadata-eval2.1%

        \[\leadsto \left(1 - \sqrt{y}\right) + \color{blue}{-1} \]
    14. Simplified2.1%

      \[\leadsto \color{blue}{\left(1 - \sqrt{y}\right) + -1} \]
    15. Final simplification2.1%

      \[\leadsto -1 + \left(1 - \sqrt{y}\right) \]
    16. Add Preprocessing

    Alternative 21: 1.9% accurate, 8.1× speedup?

    \[\begin{array}{l} [x, y, z, t] = \mathsf{sort}([x, y, z, t])\\ \\ -\sqrt{x} \end{array} \]
    NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
    (FPCore (x y z t) :precision binary64 (- (sqrt x)))
    assert(x < y && y < z && z < t);
    double code(double x, double y, double z, double t) {
    	return -sqrt(x);
    }
    
    NOTE: x, y, z, and t should be sorted in increasing order before calling this 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
        code = -sqrt(x)
    end function
    
    assert x < y && y < z && z < t;
    public static double code(double x, double y, double z, double t) {
    	return -Math.sqrt(x);
    }
    
    [x, y, z, t] = sort([x, y, z, t])
    def code(x, y, z, t):
    	return -math.sqrt(x)
    
    x, y, z, t = sort([x, y, z, t])
    function code(x, y, z, t)
    	return Float64(-sqrt(x))
    end
    
    x, y, z, t = num2cell(sort([x, y, z, t])){:}
    function tmp = code(x, y, z, t)
    	tmp = -sqrt(x);
    end
    
    NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
    code[x_, y_, z_, t_] := (-N[Sqrt[x], $MachinePrecision])
    
    \begin{array}{l}
    [x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
    \\
    -\sqrt{x}
    \end{array}
    
    Derivation
    1. Initial program 94.0%

      \[\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. Step-by-step derivation
      1. associate-+l+94.0%

        \[\leadsto \color{blue}{\left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{y + 1} - \sqrt{y}\right)\right) + \left(\left(\sqrt{z + 1} - \sqrt{z}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)\right)} \]
      2. associate-+l-77.0%

        \[\leadsto \color{blue}{\left(\sqrt{x + 1} - \left(\sqrt{x} - \left(\sqrt{y + 1} - \sqrt{y}\right)\right)\right)} + \left(\left(\sqrt{z + 1} - \sqrt{z}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)\right) \]
      3. associate-+l-94.0%

        \[\leadsto \color{blue}{\left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{y + 1} - \sqrt{y}\right)\right)} + \left(\left(\sqrt{z + 1} - \sqrt{z}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)\right) \]
      4. +-commutative94.0%

        \[\leadsto \left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{\color{blue}{1 + y}} - \sqrt{y}\right)\right) + \left(\left(\sqrt{z + 1} - \sqrt{z}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)\right) \]
      5. +-commutative94.0%

        \[\leadsto \left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{1 + y} - \sqrt{y}\right)\right) + \left(\left(\sqrt{\color{blue}{1 + z}} - \sqrt{z}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)\right) \]
      6. +-commutative94.0%

        \[\leadsto \left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{1 + y} - \sqrt{y}\right)\right) + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\sqrt{\color{blue}{1 + t}} - \sqrt{t}\right)\right) \]
    3. Simplified94.0%

      \[\leadsto \color{blue}{\left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{1 + y} - \sqrt{y}\right)\right) + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\sqrt{1 + t} - \sqrt{t}\right)\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in t around inf 11.9%

      \[\leadsto \color{blue}{\left(\sqrt{1 + x} + \left(\sqrt{1 + y} + \sqrt{1 + z}\right)\right) - \left(\sqrt{x} + \left(\sqrt{y} + \sqrt{z}\right)\right)} \]
    6. Step-by-step derivation
      1. associate--l+22.9%

        \[\leadsto \color{blue}{\sqrt{1 + x} + \left(\left(\sqrt{1 + y} + \sqrt{1 + z}\right) - \left(\sqrt{x} + \left(\sqrt{y} + \sqrt{z}\right)\right)\right)} \]
    7. Simplified22.9%

      \[\leadsto \color{blue}{\sqrt{1 + x} + \left(\left(\sqrt{1 + y} + \sqrt{1 + z}\right) - \left(\sqrt{x} + \left(\sqrt{y} + \sqrt{z}\right)\right)\right)} \]
    8. Taylor expanded in y around 0 10.7%

      \[\leadsto \color{blue}{\left(1 + \left(\sqrt{1 + x} + \sqrt{1 + z}\right)\right) - \left(\sqrt{x} + \left(\sqrt{y} + \sqrt{z}\right)\right)} \]
    9. Step-by-step derivation
      1. associate--l+30.1%

        \[\leadsto \color{blue}{1 + \left(\left(\sqrt{1 + x} + \sqrt{1 + z}\right) - \left(\sqrt{x} + \left(\sqrt{y} + \sqrt{z}\right)\right)\right)} \]
      2. +-commutative30.1%

        \[\leadsto 1 + \left(\color{blue}{\left(\sqrt{1 + z} + \sqrt{1 + x}\right)} - \left(\sqrt{x} + \left(\sqrt{y} + \sqrt{z}\right)\right)\right) \]
      3. +-commutative30.1%

        \[\leadsto 1 + \left(\left(\sqrt{1 + z} + \sqrt{1 + x}\right) - \left(\sqrt{x} + \color{blue}{\left(\sqrt{z} + \sqrt{y}\right)}\right)\right) \]
    10. Simplified30.1%

      \[\leadsto \color{blue}{1 + \left(\left(\sqrt{1 + z} + \sqrt{1 + x}\right) - \left(\sqrt{x} + \left(\sqrt{z} + \sqrt{y}\right)\right)\right)} \]
    11. Taylor expanded in x around 0 9.4%

      \[\leadsto \color{blue}{\left(2 + \sqrt{1 + z}\right) - \left(\sqrt{x} + \left(\sqrt{y} + \sqrt{z}\right)\right)} \]
    12. Step-by-step derivation
      1. associate--l+21.1%

        \[\leadsto \color{blue}{2 + \left(\sqrt{1 + z} - \left(\sqrt{x} + \left(\sqrt{y} + \sqrt{z}\right)\right)\right)} \]
      2. associate-+r+21.1%

        \[\leadsto 2 + \left(\sqrt{1 + z} - \color{blue}{\left(\left(\sqrt{x} + \sqrt{y}\right) + \sqrt{z}\right)}\right) \]
    13. Simplified21.1%

      \[\leadsto \color{blue}{2 + \left(\sqrt{1 + z} - \left(\left(\sqrt{x} + \sqrt{y}\right) + \sqrt{z}\right)\right)} \]
    14. Taylor expanded in x around inf 1.6%

      \[\leadsto \color{blue}{-1 \cdot \sqrt{x}} \]
    15. Step-by-step derivation
      1. mul-1-neg1.6%

        \[\leadsto \color{blue}{-\sqrt{x}} \]
    16. Simplified1.6%

      \[\leadsto \color{blue}{-\sqrt{x}} \]
    17. Add Preprocessing

    Developer Target 1: 99.4% accurate, 1.0× speedup?

    \[\begin{array}{l} \\ \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) \end{array} \]
    (FPCore (x y z t)
     :precision binary64
     (+
      (+
       (+
        (/ 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))))
    double code(double x, double y, double z, double t) {
    	return (((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));
    }
    
    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 = (((1.0d0 / (sqrt((x + 1.0d0)) + sqrt(x))) + (1.0d0 / (sqrt((y + 1.0d0)) + sqrt(y)))) + (1.0d0 / (sqrt((z + 1.0d0)) + sqrt(z)))) + (sqrt((t + 1.0d0)) - sqrt(t))
    end function
    
    public static double code(double x, double y, double z, double t) {
    	return (((1.0 / (Math.sqrt((x + 1.0)) + Math.sqrt(x))) + (1.0 / (Math.sqrt((y + 1.0)) + Math.sqrt(y)))) + (1.0 / (Math.sqrt((z + 1.0)) + Math.sqrt(z)))) + (Math.sqrt((t + 1.0)) - Math.sqrt(t));
    }
    
    def code(x, y, z, t):
    	return (((1.0 / (math.sqrt((x + 1.0)) + math.sqrt(x))) + (1.0 / (math.sqrt((y + 1.0)) + math.sqrt(y)))) + (1.0 / (math.sqrt((z + 1.0)) + math.sqrt(z)))) + (math.sqrt((t + 1.0)) - math.sqrt(t))
    
    function code(x, y, z, t)
    	return Float64(Float64(Float64(Float64(1.0 / Float64(sqrt(Float64(x + 1.0)) + sqrt(x))) + Float64(1.0 / Float64(sqrt(Float64(y + 1.0)) + sqrt(y)))) + Float64(1.0 / Float64(sqrt(Float64(z + 1.0)) + sqrt(z)))) + Float64(sqrt(Float64(t + 1.0)) - sqrt(t)))
    end
    
    function tmp = code(x, y, z, t)
    	tmp = (((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));
    end
    
    code[x_, y_, z_, t_] := N[(N[(N[(N[(1.0 / N[(N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[N[(z + 1.0), $MachinePrecision]], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(t + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
    
    \begin{array}{l}
    
    \\
    \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)
    \end{array}
    

    Reproduce

    ?
    herbie shell --seed 2024147 
    (FPCore (x y z t)
      :name "Main:z from "
      :precision binary64
    
      :alt
      (! :herbie-platform default (+ (+ (+ (/ 1 (+ (sqrt (+ x 1)) (sqrt x))) (/ 1 (+ (sqrt (+ y 1)) (sqrt y)))) (/ 1 (+ (sqrt (+ z 1)) (sqrt z)))) (- (sqrt (+ t 1)) (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))))