Main:z from

Percentage Accurate: 91.9% → 99.7%
Time: 32.3s
Alternatives: 20
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 20 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: 99.7% accurate, 0.8× speedup?

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (-.f64 (sqrt.f64 (+.f64 z 1)) (sqrt.f64 z)) < 0.5

    1. Initial program 83.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+83.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-70.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-83.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. sub-neg83.5%

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

        \[\leadsto \left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \color{blue}{\left(\sqrt{y + 1} - \sqrt{y}\right)}\right) + \left(\left(\sqrt{z + 1} - \sqrt{z}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)\right) \]
      6. +-commutative83.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) \]
      7. +-commutative83.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) \]
      8. +-commutative83.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. Simplified83.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. Step-by-step derivation
      1. flip--83.4%

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

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

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

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

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

      \[\leadsto \left(\color{blue}{\frac{\left(1 + x\right) - x}{\sqrt{1 + x} + \sqrt{x}}} + \left(\sqrt{1 + y} - \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+86.8%

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

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

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

      \[\leadsto \left(\color{blue}{\frac{1}{\sqrt{1 + x} + \sqrt{x}}} + \left(\sqrt{1 + y} - \sqrt{y}\right)\right) + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\sqrt{1 + t} - \sqrt{t}\right)\right) \]
    8. Step-by-step derivation
      1. flip--86.8%

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

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

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

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

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

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

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

      \[\leadsto \left(\frac{1}{\sqrt{1 + x} + \sqrt{x}} + \color{blue}{\frac{1}{\sqrt{1 + y} + \sqrt{y}}}\right) + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\sqrt{1 + t} - \sqrt{t}\right)\right) \]
    12. Step-by-step derivation
      1. flip--89.9%

        \[\leadsto \left(\frac{1}{\sqrt{1 + x} + \sqrt{x}} + \frac{1}{\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) \]
      2. add-sqr-sqrt50.8%

        \[\leadsto \left(\frac{1}{\sqrt{1 + x} + \sqrt{x}} + \frac{1}{\sqrt{1 + y} + \sqrt{y}}\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-sqrt90.2%

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

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

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

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

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

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

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

    if 0.5 < (-.f64 (sqrt.f64 (+.f64 z 1)) (sqrt.f64 z))

    1. Initial program 97.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+97.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-79.8%

        \[\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.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. sub-neg97.7%

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

        \[\leadsto \left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \color{blue}{\left(\sqrt{y + 1} - \sqrt{y}\right)}\right) + \left(\left(\sqrt{z + 1} - \sqrt{z}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)\right) \]
      6. +-commutative97.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) \]
      7. +-commutative97.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) \]
      8. +-commutative97.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. Simplified97.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. Step-by-step derivation
      1. flip--97.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) + \color{blue}{\frac{\sqrt{1 + t} \cdot \sqrt{1 + t} - \sqrt{t} \cdot \sqrt{t}}{\sqrt{1 + t} + \sqrt{t}}}\right) \]
      2. add-sqr-sqrt74.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) + \frac{\color{blue}{\left(1 + t\right)} - \sqrt{t} \cdot \sqrt{t}}{\sqrt{1 + t} + \sqrt{t}}\right) \]
      3. +-commutative74.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) + \frac{\color{blue}{\left(t + 1\right)} - \sqrt{t} \cdot \sqrt{t}}{\sqrt{1 + t} + \sqrt{t}}\right) \]
      4. add-sqr-sqrt98.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) + \frac{\left(t + 1\right) - \color{blue}{t}}{\sqrt{1 + t} + \sqrt{t}}\right) \]
      5. +-commutative98.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) + \frac{\left(t + 1\right) - t}{\sqrt{\color{blue}{t + 1}} + \sqrt{t}}\right) \]
    5. Applied egg-rr98.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) + \color{blue}{\frac{\left(t + 1\right) - t}{\sqrt{t + 1} + \sqrt{t}}}\right) \]
    6. Step-by-step derivation
      1. +-commutative98.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) + \frac{\color{blue}{\left(1 + t\right)} - t}{\sqrt{t + 1} + \sqrt{t}}\right) \]
      2. associate--l+98.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) + \frac{\color{blue}{1 + \left(t - t\right)}}{\sqrt{t + 1} + \sqrt{t}}\right) \]
      3. +-inverses98.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) + \frac{1 + \color{blue}{0}}{\sqrt{t + 1} + \sqrt{t}}\right) \]
      4. metadata-eval98.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) + \frac{\color{blue}{1}}{\sqrt{t + 1} + \sqrt{t}}\right) \]
      5. +-commutative98.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) + \frac{1}{\color{blue}{\sqrt{t} + \sqrt{t + 1}}}\right) \]
      6. +-commutative98.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) + \frac{1}{\sqrt{t} + \sqrt{\color{blue}{1 + t}}}\right) \]
    7. Simplified98.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) + \color{blue}{\frac{1}{\sqrt{t} + \sqrt{1 + t}}}\right) \]
  3. Recombined 2 regimes into one program.
  4. Final simplification78.3%

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

Alternative 2: 99.3% accurate, 0.8× speedup?

\[\begin{array}{l} [x, y, z, t] = \mathsf{sort}([x, y, z, t])\\ \\ \left(\frac{1}{\sqrt{1 + x} + \sqrt{x}} + {\left({\left(\frac{1}{\sqrt{1 + y} + \sqrt{y}}\right)}^{3}\right)}^{0.3333333333333333}\right) + \left(\left(\sqrt{1 + t} - \sqrt{t}\right) + \frac{1}{\sqrt{1 + z} + \sqrt{z}}\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 (+ 1.0 x)) (sqrt x)))
   (pow (pow (/ 1.0 (+ (sqrt (+ 1.0 y)) (sqrt y))) 3.0) 0.3333333333333333))
  (+ (- (sqrt (+ 1.0 t)) (sqrt t)) (/ 1.0 (+ (sqrt (+ 1.0 z)) (sqrt z))))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
	return ((1.0 / (sqrt((1.0 + x)) + sqrt(x))) + pow(pow((1.0 / (sqrt((1.0 + y)) + sqrt(y))), 3.0), 0.3333333333333333)) + ((sqrt((1.0 + t)) - sqrt(t)) + (1.0 / (sqrt((1.0 + z)) + sqrt(z))));
}
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((1.0d0 + x)) + sqrt(x))) + (((1.0d0 / (sqrt((1.0d0 + y)) + sqrt(y))) ** 3.0d0) ** 0.3333333333333333d0)) + ((sqrt((1.0d0 + t)) - sqrt(t)) + (1.0d0 / (sqrt((1.0d0 + z)) + sqrt(z))))
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((1.0 + x)) + Math.sqrt(x))) + Math.pow(Math.pow((1.0 / (Math.sqrt((1.0 + y)) + Math.sqrt(y))), 3.0), 0.3333333333333333)) + ((Math.sqrt((1.0 + t)) - Math.sqrt(t)) + (1.0 / (Math.sqrt((1.0 + z)) + Math.sqrt(z))));
}
[x, y, z, t] = sort([x, y, z, t])
def code(x, y, z, t):
	return ((1.0 / (math.sqrt((1.0 + x)) + math.sqrt(x))) + math.pow(math.pow((1.0 / (math.sqrt((1.0 + y)) + math.sqrt(y))), 3.0), 0.3333333333333333)) + ((math.sqrt((1.0 + t)) - math.sqrt(t)) + (1.0 / (math.sqrt((1.0 + z)) + math.sqrt(z))))
x, y, z, t = sort([x, y, z, t])
function code(x, y, z, t)
	return Float64(Float64(Float64(1.0 / Float64(sqrt(Float64(1.0 + x)) + sqrt(x))) + ((Float64(1.0 / Float64(sqrt(Float64(1.0 + y)) + sqrt(y))) ^ 3.0) ^ 0.3333333333333333)) + Float64(Float64(sqrt(Float64(1.0 + t)) - sqrt(t)) + Float64(1.0 / Float64(sqrt(Float64(1.0 + z)) + sqrt(z)))))
end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp = code(x, y, z, t)
	tmp = ((1.0 / (sqrt((1.0 + x)) + sqrt(x))) + (((1.0 / (sqrt((1.0 + y)) + sqrt(y))) ^ 3.0) ^ 0.3333333333333333)) + ((sqrt((1.0 + t)) - sqrt(t)) + (1.0 / (sqrt((1.0 + z)) + sqrt(z))));
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := N[(N[(N[(1.0 / N[(N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[Power[N[Power[N[(1.0 / N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 3.0], $MachinePrecision], 0.3333333333333333], $MachinePrecision]), $MachinePrecision] + N[(N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\left(\frac{1}{\sqrt{1 + x} + \sqrt{x}} + {\left({\left(\frac{1}{\sqrt{1 + y} + \sqrt{y}}\right)}^{3}\right)}^{0.3333333333333333}\right) + \left(\left(\sqrt{1 + t} - \sqrt{t}\right) + \frac{1}{\sqrt{1 + z} + \sqrt{z}}\right)
\end{array}
Derivation
  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-75.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-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. sub-neg90.7%

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

      \[\leadsto \left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \color{blue}{\left(\sqrt{y + 1} - \sqrt{y}\right)}\right) + \left(\left(\sqrt{z + 1} - \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{\color{blue}{1 + y}} - \sqrt{y}\right)\right) + \left(\left(\sqrt{z + 1} - \sqrt{z}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)\right) \]
    7. +-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) \]
    8. +-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. Step-by-step derivation
    1. flip--90.6%

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

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

      \[\leadsto \left(\frac{\color{blue}{\left(1 + x\right)} - \sqrt{x} \cdot \sqrt{x}}{\sqrt{x + 1} + \sqrt{x}} + \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-sqr-sqrt90.9%

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

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

    \[\leadsto \left(\color{blue}{\frac{\left(1 + x\right) - x}{\sqrt{1 + x} + \sqrt{x}}} + \left(\sqrt{1 + y} - \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+92.7%

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

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

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

    \[\leadsto \left(\color{blue}{\frac{1}{\sqrt{1 + x} + \sqrt{x}}} + \left(\sqrt{1 + y} - \sqrt{y}\right)\right) + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\sqrt{1 + t} - \sqrt{t}\right)\right) \]
  8. Step-by-step derivation
    1. flip--92.6%

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

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

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

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

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

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

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

    \[\leadsto \left(\frac{1}{\sqrt{1 + x} + \sqrt{x}} + \color{blue}{\frac{1}{\sqrt{1 + y} + \sqrt{y}}}\right) + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\sqrt{1 + t} - \sqrt{t}\right)\right) \]
  12. Step-by-step derivation
    1. flip--94.5%

      \[\leadsto \left(\frac{1}{\sqrt{1 + x} + \sqrt{x}} + \frac{1}{\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) \]
    2. add-sqr-sqrt75.3%

      \[\leadsto \left(\frac{1}{\sqrt{1 + x} + \sqrt{x}} + \frac{1}{\sqrt{1 + y} + \sqrt{y}}\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-sqrt94.7%

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

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

      \[\leadsto \left(\frac{1}{\sqrt{1 + x} + \sqrt{x}} + \frac{1}{\sqrt{1 + y} + \sqrt{y}}\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.1%

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

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

    \[\leadsto \left(\frac{1}{\sqrt{1 + x} + \sqrt{x}} + \frac{1}{\sqrt{1 + y} + \sqrt{y}}\right) + \left(\color{blue}{\frac{1}{\sqrt{1 + z} + \sqrt{z}}} + \left(\sqrt{1 + t} - \sqrt{t}\right)\right) \]
  16. Step-by-step derivation
    1. add-cbrt-cube97.1%

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

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

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

    \[\leadsto \left(\frac{1}{\sqrt{1 + x} + \sqrt{x}} + \color{blue}{{\left({\left(\frac{1}{\sqrt{1 + y} + \sqrt{y}}\right)}^{3}\right)}^{0.3333333333333333}}\right) + \left(\frac{1}{\sqrt{1 + z} + \sqrt{z}} + \left(\sqrt{1 + t} - \sqrt{t}\right)\right) \]
  18. Final simplification97.0%

    \[\leadsto \left(\frac{1}{\sqrt{1 + x} + \sqrt{x}} + {\left({\left(\frac{1}{\sqrt{1 + y} + \sqrt{y}}\right)}^{3}\right)}^{0.3333333333333333}\right) + \left(\left(\sqrt{1 + t} - \sqrt{t}\right) + \frac{1}{\sqrt{1 + z} + \sqrt{z}}\right) \]

Alternative 3: 99.3% accurate, 0.8× speedup?

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (-.f64 (sqrt.f64 (+.f64 z 1)) (sqrt.f64 z)) < 0.5

    1. Initial program 83.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+83.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-70.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-83.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. sub-neg83.5%

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

        \[\leadsto \left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \color{blue}{\left(\sqrt{y + 1} - \sqrt{y}\right)}\right) + \left(\left(\sqrt{z + 1} - \sqrt{z}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)\right) \]
      6. +-commutative83.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) \]
      7. +-commutative83.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) \]
      8. +-commutative83.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. Simplified83.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. Step-by-step derivation
      1. flip--83.4%

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

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

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

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

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

      \[\leadsto \left(\color{blue}{\frac{\left(1 + x\right) - x}{\sqrt{1 + x} + \sqrt{x}}} + \left(\sqrt{1 + y} - \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+86.8%

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

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

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

      \[\leadsto \left(\color{blue}{\frac{1}{\sqrt{1 + x} + \sqrt{x}}} + \left(\sqrt{1 + y} - \sqrt{y}\right)\right) + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\sqrt{1 + t} - \sqrt{t}\right)\right) \]
    8. Step-by-step derivation
      1. flip--86.8%

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

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

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

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

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

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

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

      \[\leadsto \left(\frac{1}{\sqrt{1 + x} + \sqrt{x}} + \color{blue}{\frac{1}{\sqrt{1 + y} + \sqrt{y}}}\right) + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\sqrt{1 + t} - \sqrt{t}\right)\right) \]
    12. Step-by-step derivation
      1. flip--89.9%

        \[\leadsto \left(\frac{1}{\sqrt{1 + x} + \sqrt{x}} + \frac{1}{\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) \]
      2. add-sqr-sqrt50.8%

        \[\leadsto \left(\frac{1}{\sqrt{1 + x} + \sqrt{x}} + \frac{1}{\sqrt{1 + y} + \sqrt{y}}\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-sqrt90.2%

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

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

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

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

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

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

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

    if 0.5 < (-.f64 (sqrt.f64 (+.f64 z 1)) (sqrt.f64 z))

    1. Initial program 97.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) \]
  3. Recombined 2 regimes into one program.
  4. Final simplification77.8%

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

Alternative 4: 99.3% accurate, 1.0× speedup?

\[\begin{array}{l} [x, y, z, t] = \mathsf{sort}([x, y, z, t])\\ \\ \left(\left(\sqrt{1 + t} - \sqrt{t}\right) + \frac{1}{\sqrt{1 + z} + \sqrt{z}}\right) + \left(\frac{1}{\sqrt{1 + x} + \sqrt{x}} + \frac{1}{\sqrt{1 + y} + \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
 (+
  (+ (- (sqrt (+ 1.0 t)) (sqrt t)) (/ 1.0 (+ (sqrt (+ 1.0 z)) (sqrt z))))
  (+
   (/ 1.0 (+ (sqrt (+ 1.0 x)) (sqrt x)))
   (/ 1.0 (+ (sqrt (+ 1.0 y)) (sqrt y))))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
	return ((sqrt((1.0 + t)) - sqrt(t)) + (1.0 / (sqrt((1.0 + z)) + sqrt(z)))) + ((1.0 / (sqrt((1.0 + x)) + sqrt(x))) + (1.0 / (sqrt((1.0 + y)) + 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 = ((sqrt((1.0d0 + t)) - sqrt(t)) + (1.0d0 / (sqrt((1.0d0 + z)) + sqrt(z)))) + ((1.0d0 / (sqrt((1.0d0 + x)) + sqrt(x))) + (1.0d0 / (sqrt((1.0d0 + y)) + sqrt(y))))
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
	return ((Math.sqrt((1.0 + t)) - Math.sqrt(t)) + (1.0 / (Math.sqrt((1.0 + z)) + Math.sqrt(z)))) + ((1.0 / (Math.sqrt((1.0 + x)) + Math.sqrt(x))) + (1.0 / (Math.sqrt((1.0 + y)) + Math.sqrt(y))));
}
[x, y, z, t] = sort([x, y, z, t])
def code(x, y, z, t):
	return ((math.sqrt((1.0 + t)) - math.sqrt(t)) + (1.0 / (math.sqrt((1.0 + z)) + math.sqrt(z)))) + ((1.0 / (math.sqrt((1.0 + x)) + math.sqrt(x))) + (1.0 / (math.sqrt((1.0 + y)) + math.sqrt(y))))
x, y, z, t = sort([x, y, z, t])
function code(x, y, z, t)
	return Float64(Float64(Float64(sqrt(Float64(1.0 + t)) - sqrt(t)) + Float64(1.0 / Float64(sqrt(Float64(1.0 + z)) + sqrt(z)))) + Float64(Float64(1.0 / Float64(sqrt(Float64(1.0 + x)) + sqrt(x))) + Float64(1.0 / Float64(sqrt(Float64(1.0 + y)) + sqrt(y)))))
end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp = code(x, y, z, t)
	tmp = ((sqrt((1.0 + t)) - sqrt(t)) + (1.0 / (sqrt((1.0 + z)) + sqrt(z)))) + ((1.0 / (sqrt((1.0 + x)) + sqrt(x))) + (1.0 / (sqrt((1.0 + y)) + 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[(N[(N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 / N[(N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\left(\left(\sqrt{1 + t} - \sqrt{t}\right) + \frac{1}{\sqrt{1 + z} + \sqrt{z}}\right) + \left(\frac{1}{\sqrt{1 + x} + \sqrt{x}} + \frac{1}{\sqrt{1 + y} + \sqrt{y}}\right)
\end{array}
Derivation
  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-75.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-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. sub-neg90.7%

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

      \[\leadsto \left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \color{blue}{\left(\sqrt{y + 1} - \sqrt{y}\right)}\right) + \left(\left(\sqrt{z + 1} - \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{\color{blue}{1 + y}} - \sqrt{y}\right)\right) + \left(\left(\sqrt{z + 1} - \sqrt{z}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)\right) \]
    7. +-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) \]
    8. +-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. Step-by-step derivation
    1. flip--90.6%

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

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

      \[\leadsto \left(\frac{\color{blue}{\left(1 + x\right)} - \sqrt{x} \cdot \sqrt{x}}{\sqrt{x + 1} + \sqrt{x}} + \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-sqr-sqrt90.9%

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

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

    \[\leadsto \left(\color{blue}{\frac{\left(1 + x\right) - x}{\sqrt{1 + x} + \sqrt{x}}} + \left(\sqrt{1 + y} - \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+92.7%

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

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

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

    \[\leadsto \left(\color{blue}{\frac{1}{\sqrt{1 + x} + \sqrt{x}}} + \left(\sqrt{1 + y} - \sqrt{y}\right)\right) + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\sqrt{1 + t} - \sqrt{t}\right)\right) \]
  8. Step-by-step derivation
    1. flip--92.6%

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

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

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

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

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

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

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

    \[\leadsto \left(\frac{1}{\sqrt{1 + x} + \sqrt{x}} + \color{blue}{\frac{1}{\sqrt{1 + y} + \sqrt{y}}}\right) + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\sqrt{1 + t} - \sqrt{t}\right)\right) \]
  12. Step-by-step derivation
    1. flip--94.5%

      \[\leadsto \left(\frac{1}{\sqrt{1 + x} + \sqrt{x}} + \frac{1}{\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) \]
    2. add-sqr-sqrt75.3%

      \[\leadsto \left(\frac{1}{\sqrt{1 + x} + \sqrt{x}} + \frac{1}{\sqrt{1 + y} + \sqrt{y}}\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-sqrt94.7%

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

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

      \[\leadsto \left(\frac{1}{\sqrt{1 + x} + \sqrt{x}} + \frac{1}{\sqrt{1 + y} + \sqrt{y}}\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.1%

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

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

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

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

Alternative 5: 98.0% accurate, 1.0× speedup?

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

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

      \[\leadsto \left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \color{blue}{\left(\sqrt{y + 1} - \sqrt{y}\right)}\right) + \left(\left(\sqrt{z + 1} - \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{\color{blue}{1 + y}} - \sqrt{y}\right)\right) + \left(\left(\sqrt{z + 1} - \sqrt{z}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)\right) \]
    7. +-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) \]
    8. +-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. Step-by-step derivation
    1. flip--90.6%

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

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

      \[\leadsto \left(\frac{\color{blue}{\left(1 + x\right)} - \sqrt{x} \cdot \sqrt{x}}{\sqrt{x + 1} + \sqrt{x}} + \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-sqr-sqrt90.9%

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

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

    \[\leadsto \left(\color{blue}{\frac{\left(1 + x\right) - x}{\sqrt{1 + x} + \sqrt{x}}} + \left(\sqrt{1 + y} - \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+92.7%

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

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

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

    \[\leadsto \left(\color{blue}{\frac{1}{\sqrt{1 + x} + \sqrt{x}}} + \left(\sqrt{1 + y} - \sqrt{y}\right)\right) + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\sqrt{1 + t} - \sqrt{t}\right)\right) \]
  8. Step-by-step derivation
    1. flip--92.6%

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

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

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

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

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

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

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

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

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

Alternative 6: 99.1% accurate, 1.0× speedup?

\[\begin{array}{l} [x, y, z, t] = \mathsf{sort}([x, y, z, t])\\ \\ \begin{array}{l} t_1 := \sqrt{1 + x}\\ t_2 := \sqrt{1 + z}\\ t_3 := \sqrt{1 + y}\\ \mathbf{if}\;z \leq 1.55 \cdot 10^{-19}:\\ \;\;\;\;t_3 + \left(\left(\left(t_1 + \left(t_2 + \left(\left(\sqrt{1 + t} - \sqrt{t}\right) - \sqrt{x}\right)\right)\right) - \sqrt{z}\right) - \sqrt{y}\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\frac{1}{t_1 + \sqrt{x}} + \frac{1}{t_3 + \sqrt{y}}\right) + \frac{1}{t_2 + \sqrt{z}}\\ \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 x))) (t_2 (sqrt (+ 1.0 z))) (t_3 (sqrt (+ 1.0 y))))
   (if (<= z 1.55e-19)
     (+
      t_3
      (-
       (- (+ t_1 (+ t_2 (- (- (sqrt (+ 1.0 t)) (sqrt t)) (sqrt x)))) (sqrt z))
       (sqrt y)))
     (+
      (+ (/ 1.0 (+ t_1 (sqrt x))) (/ 1.0 (+ t_3 (sqrt y))))
      (/ 1.0 (+ t_2 (sqrt z)))))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
	double t_1 = sqrt((1.0 + x));
	double t_2 = sqrt((1.0 + z));
	double t_3 = sqrt((1.0 + y));
	double tmp;
	if (z <= 1.55e-19) {
		tmp = t_3 + (((t_1 + (t_2 + ((sqrt((1.0 + t)) - sqrt(t)) - sqrt(x)))) - sqrt(z)) - sqrt(y));
	} else {
		tmp = ((1.0 / (t_1 + sqrt(x))) + (1.0 / (t_3 + sqrt(y)))) + (1.0 / (t_2 + sqrt(z)));
	}
	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) :: tmp
    t_1 = sqrt((1.0d0 + x))
    t_2 = sqrt((1.0d0 + z))
    t_3 = sqrt((1.0d0 + y))
    if (z <= 1.55d-19) then
        tmp = t_3 + (((t_1 + (t_2 + ((sqrt((1.0d0 + t)) - sqrt(t)) - sqrt(x)))) - sqrt(z)) - sqrt(y))
    else
        tmp = ((1.0d0 / (t_1 + sqrt(x))) + (1.0d0 / (t_3 + sqrt(y)))) + (1.0d0 / (t_2 + sqrt(z)))
    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 + x));
	double t_2 = Math.sqrt((1.0 + z));
	double t_3 = Math.sqrt((1.0 + y));
	double tmp;
	if (z <= 1.55e-19) {
		tmp = t_3 + (((t_1 + (t_2 + ((Math.sqrt((1.0 + t)) - Math.sqrt(t)) - Math.sqrt(x)))) - Math.sqrt(z)) - Math.sqrt(y));
	} else {
		tmp = ((1.0 / (t_1 + Math.sqrt(x))) + (1.0 / (t_3 + Math.sqrt(y)))) + (1.0 / (t_2 + Math.sqrt(z)));
	}
	return tmp;
}
[x, y, z, t] = sort([x, y, z, t])
def code(x, y, z, t):
	t_1 = math.sqrt((1.0 + x))
	t_2 = math.sqrt((1.0 + z))
	t_3 = math.sqrt((1.0 + y))
	tmp = 0
	if z <= 1.55e-19:
		tmp = t_3 + (((t_1 + (t_2 + ((math.sqrt((1.0 + t)) - math.sqrt(t)) - math.sqrt(x)))) - math.sqrt(z)) - math.sqrt(y))
	else:
		tmp = ((1.0 / (t_1 + math.sqrt(x))) + (1.0 / (t_3 + math.sqrt(y)))) + (1.0 / (t_2 + math.sqrt(z)))
	return tmp
x, y, z, t = sort([x, y, z, t])
function code(x, y, z, t)
	t_1 = sqrt(Float64(1.0 + x))
	t_2 = sqrt(Float64(1.0 + z))
	t_3 = sqrt(Float64(1.0 + y))
	tmp = 0.0
	if (z <= 1.55e-19)
		tmp = Float64(t_3 + Float64(Float64(Float64(t_1 + Float64(t_2 + Float64(Float64(sqrt(Float64(1.0 + t)) - sqrt(t)) - sqrt(x)))) - sqrt(z)) - sqrt(y)));
	else
		tmp = Float64(Float64(Float64(1.0 / Float64(t_1 + sqrt(x))) + Float64(1.0 / Float64(t_3 + sqrt(y)))) + Float64(1.0 / Float64(t_2 + sqrt(z))));
	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 + x));
	t_2 = sqrt((1.0 + z));
	t_3 = sqrt((1.0 + y));
	tmp = 0.0;
	if (z <= 1.55e-19)
		tmp = t_3 + (((t_1 + (t_2 + ((sqrt((1.0 + t)) - sqrt(t)) - sqrt(x)))) - sqrt(z)) - sqrt(y));
	else
		tmp = ((1.0 / (t_1 + sqrt(x))) + (1.0 / (t_3 + sqrt(y)))) + (1.0 / (t_2 + sqrt(z)));
	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 + x), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[z, 1.55e-19], N[(t$95$3 + N[(N[(N[(t$95$1 + N[(t$95$2 + N[(N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 / N[(t$95$1 + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(t$95$3 + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(t$95$2 + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + x}\\
t_2 := \sqrt{1 + z}\\
t_3 := \sqrt{1 + y}\\
\mathbf{if}\;z \leq 1.55 \cdot 10^{-19}:\\
\;\;\;\;t_3 + \left(\left(\left(t_1 + \left(t_2 + \left(\left(\sqrt{1 + t} - \sqrt{t}\right) - \sqrt{x}\right)\right)\right) - \sqrt{z}\right) - \sqrt{y}\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < 1.5499999999999999e-19

    1. Initial program 97.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. Simplified31.8%

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

    if 1.5499999999999999e-19 < z

    1. Initial program 84.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+84.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-71.8%

        \[\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-84.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. sub-neg84.3%

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

        \[\leadsto \left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \color{blue}{\left(\sqrt{y + 1} - \sqrt{y}\right)}\right) + \left(\left(\sqrt{z + 1} - \sqrt{z}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)\right) \]
      6. +-commutative84.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) \]
      7. +-commutative84.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) \]
      8. +-commutative84.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. Simplified84.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. Step-by-step derivation
      1. flip--84.3%

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

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

        \[\leadsto \left(\frac{\color{blue}{\left(1 + x\right)} - \sqrt{x} \cdot \sqrt{x}}{\sqrt{x + 1} + \sqrt{x}} + \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-sqr-sqrt84.5%

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

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

      \[\leadsto \left(\color{blue}{\frac{\left(1 + x\right) - x}{\sqrt{1 + x} + \sqrt{x}}} + \left(\sqrt{1 + y} - \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+87.4%

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

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

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

      \[\leadsto \left(\color{blue}{\frac{1}{\sqrt{1 + x} + \sqrt{x}}} + \left(\sqrt{1 + y} - \sqrt{y}\right)\right) + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\sqrt{1 + t} - \sqrt{t}\right)\right) \]
    8. Step-by-step derivation
      1. flip--87.4%

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

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

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

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

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

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

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

      \[\leadsto \left(\frac{1}{\sqrt{1 + x} + \sqrt{x}} + \color{blue}{\frac{1}{\sqrt{1 + y} + \sqrt{y}}}\right) + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\sqrt{1 + t} - \sqrt{t}\right)\right) \]
    12. Step-by-step derivation
      1. flip--90.4%

        \[\leadsto \left(\frac{1}{\sqrt{1 + x} + \sqrt{x}} + \frac{1}{\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) \]
      2. add-sqr-sqrt53.3%

        \[\leadsto \left(\frac{1}{\sqrt{1 + x} + \sqrt{x}} + \frac{1}{\sqrt{1 + y} + \sqrt{y}}\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-sqrt90.7%

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

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

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

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

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

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

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

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

Alternative 7: 98.9% accurate, 1.3× speedup?

\[\begin{array}{l} [x, y, z, t] = \mathsf{sort}([x, y, z, t])\\ \\ \begin{array}{l} \mathbf{if}\;t \leq 4.8 \cdot 10^{+25}:\\ \;\;\;\;3 + \left(\sqrt{1 + t} - \sqrt{t}\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\frac{1}{\sqrt{1 + x} + \sqrt{x}} + \frac{1}{\sqrt{1 + y} + \sqrt{y}}\right) + \frac{1}{\sqrt{1 + z} + \sqrt{z}}\\ \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 (<= t 4.8e+25)
   (+ 3.0 (- (sqrt (+ 1.0 t)) (sqrt t)))
   (+
    (+
     (/ 1.0 (+ (sqrt (+ 1.0 x)) (sqrt x)))
     (/ 1.0 (+ (sqrt (+ 1.0 y)) (sqrt y))))
    (/ 1.0 (+ (sqrt (+ 1.0 z)) (sqrt z))))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
	double tmp;
	if (t <= 4.8e+25) {
		tmp = 3.0 + (sqrt((1.0 + t)) - sqrt(t));
	} else {
		tmp = ((1.0 / (sqrt((1.0 + x)) + sqrt(x))) + (1.0 / (sqrt((1.0 + y)) + sqrt(y)))) + (1.0 / (sqrt((1.0 + z)) + sqrt(z)));
	}
	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 (t <= 4.8d+25) then
        tmp = 3.0d0 + (sqrt((1.0d0 + t)) - sqrt(t))
    else
        tmp = ((1.0d0 / (sqrt((1.0d0 + x)) + sqrt(x))) + (1.0d0 / (sqrt((1.0d0 + y)) + sqrt(y)))) + (1.0d0 / (sqrt((1.0d0 + z)) + sqrt(z)))
    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 (t <= 4.8e+25) {
		tmp = 3.0 + (Math.sqrt((1.0 + t)) - Math.sqrt(t));
	} else {
		tmp = ((1.0 / (Math.sqrt((1.0 + x)) + Math.sqrt(x))) + (1.0 / (Math.sqrt((1.0 + y)) + Math.sqrt(y)))) + (1.0 / (Math.sqrt((1.0 + z)) + Math.sqrt(z)));
	}
	return tmp;
}
[x, y, z, t] = sort([x, y, z, t])
def code(x, y, z, t):
	tmp = 0
	if t <= 4.8e+25:
		tmp = 3.0 + (math.sqrt((1.0 + t)) - math.sqrt(t))
	else:
		tmp = ((1.0 / (math.sqrt((1.0 + x)) + math.sqrt(x))) + (1.0 / (math.sqrt((1.0 + y)) + math.sqrt(y)))) + (1.0 / (math.sqrt((1.0 + z)) + math.sqrt(z)))
	return tmp
x, y, z, t = sort([x, y, z, t])
function code(x, y, z, t)
	tmp = 0.0
	if (t <= 4.8e+25)
		tmp = Float64(3.0 + Float64(sqrt(Float64(1.0 + t)) - sqrt(t)));
	else
		tmp = Float64(Float64(Float64(1.0 / Float64(sqrt(Float64(1.0 + x)) + sqrt(x))) + Float64(1.0 / Float64(sqrt(Float64(1.0 + y)) + sqrt(y)))) + Float64(1.0 / Float64(sqrt(Float64(1.0 + z)) + sqrt(z))));
	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 (t <= 4.8e+25)
		tmp = 3.0 + (sqrt((1.0 + t)) - sqrt(t));
	else
		tmp = ((1.0 / (sqrt((1.0 + x)) + sqrt(x))) + (1.0 / (sqrt((1.0 + y)) + sqrt(y)))) + (1.0 / (sqrt((1.0 + z)) + sqrt(z)));
	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[t, 4.8e+25], N[(3.0 + N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 / N[(N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq 4.8 \cdot 10^{+25}:\\
\;\;\;\;3 + \left(\sqrt{1 + t} - \sqrt{t}\right)\\

\mathbf{else}:\\
\;\;\;\;\left(\frac{1}{\sqrt{1 + x} + \sqrt{x}} + \frac{1}{\sqrt{1 + y} + \sqrt{y}}\right) + \frac{1}{\sqrt{1 + z} + \sqrt{z}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < 4.79999999999999992e25

    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. Simplified18.7%

      \[\leadsto \color{blue}{\sqrt{1 + y} + \left(\left(\left(\sqrt{x + 1} - \left(\left(\sqrt{x} + \left(\sqrt{t} - \sqrt{1 + t}\right)\right) - \sqrt{1 + z}\right)\right) - \sqrt{z}\right) - \sqrt{y}\right)} \]
    3. Taylor expanded in y around 0 17.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} + \sqrt{z}\right)\right)} \]
    4. Step-by-step derivation
      1. associate--l+35.7%

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

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

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

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

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

      \[\leadsto \color{blue}{\left(2 + \left(\sqrt{1 + t} + \sqrt{1 + z}\right)\right) - \left(\sqrt{t} + \sqrt{z}\right)} \]
    7. Step-by-step derivation
      1. +-commutative19.9%

        \[\leadsto \color{blue}{\left(\left(\sqrt{1 + t} + \sqrt{1 + z}\right) + 2\right)} - \left(\sqrt{t} + \sqrt{z}\right) \]
    8. Simplified19.9%

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

      \[\leadsto \color{blue}{\left(3 + \sqrt{1 + t}\right) - \sqrt{t}} \]
    10. Step-by-step derivation
      1. associate--l+26.0%

        \[\leadsto \color{blue}{3 + \left(\sqrt{1 + t} - \sqrt{t}\right)} \]
    11. Simplified26.0%

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

    if 4.79999999999999992e25 < t

    1. Initial program 84.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+84.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-68.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-84.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. sub-neg84.5%

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

        \[\leadsto \left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \color{blue}{\left(\sqrt{y + 1} - \sqrt{y}\right)}\right) + \left(\left(\sqrt{z + 1} - \sqrt{z}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)\right) \]
      6. +-commutative84.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) \]
      7. +-commutative84.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) \]
      8. +-commutative84.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. Simplified84.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. Step-by-step derivation
      1. flip--84.5%

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

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

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

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

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

      \[\leadsto \left(\color{blue}{\frac{\left(1 + x\right) - x}{\sqrt{1 + x} + \sqrt{x}}} + \left(\sqrt{1 + y} - \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+87.9%

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

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

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

      \[\leadsto \left(\color{blue}{\frac{1}{\sqrt{1 + x} + \sqrt{x}}} + \left(\sqrt{1 + y} - \sqrt{y}\right)\right) + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\sqrt{1 + t} - \sqrt{t}\right)\right) \]
    8. Step-by-step derivation
      1. flip--87.9%

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

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

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

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

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

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

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

      \[\leadsto \left(\frac{1}{\sqrt{1 + x} + \sqrt{x}} + \color{blue}{\frac{1}{\sqrt{1 + y} + \sqrt{y}}}\right) + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\sqrt{1 + t} - \sqrt{t}\right)\right) \]
    12. Step-by-step derivation
      1. flip--91.2%

        \[\leadsto \left(\frac{1}{\sqrt{1 + x} + \sqrt{x}} + \frac{1}{\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) \]
      2. add-sqr-sqrt72.8%

        \[\leadsto \left(\frac{1}{\sqrt{1 + x} + \sqrt{x}} + \frac{1}{\sqrt{1 + y} + \sqrt{y}}\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-sqrt91.5%

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

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

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

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

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

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

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

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

Alternative 8: 97.5% accurate, 1.3× speedup?

\[\begin{array}{l} [x, y, z, t] = \mathsf{sort}([x, y, z, t])\\ \\ \begin{array}{l} \mathbf{if}\;t \leq 4.8 \cdot 10^{+25}:\\ \;\;\;\;3 + \left(\sqrt{1 + t} - \sqrt{t}\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\frac{1}{\sqrt{1 + x} + \sqrt{x}} + \frac{1}{\sqrt{1 + y} + \sqrt{y}}\right) + \left(\sqrt{1 + z} - \sqrt{z}\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
 (if (<= t 4.8e+25)
   (+ 3.0 (- (sqrt (+ 1.0 t)) (sqrt t)))
   (+
    (+
     (/ 1.0 (+ (sqrt (+ 1.0 x)) (sqrt x)))
     (/ 1.0 (+ (sqrt (+ 1.0 y)) (sqrt y))))
    (- (sqrt (+ 1.0 z)) (sqrt z)))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
	double tmp;
	if (t <= 4.8e+25) {
		tmp = 3.0 + (sqrt((1.0 + t)) - sqrt(t));
	} else {
		tmp = ((1.0 / (sqrt((1.0 + x)) + sqrt(x))) + (1.0 / (sqrt((1.0 + y)) + sqrt(y)))) + (sqrt((1.0 + z)) - sqrt(z));
	}
	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 (t <= 4.8d+25) then
        tmp = 3.0d0 + (sqrt((1.0d0 + t)) - sqrt(t))
    else
        tmp = ((1.0d0 / (sqrt((1.0d0 + x)) + sqrt(x))) + (1.0d0 / (sqrt((1.0d0 + y)) + sqrt(y)))) + (sqrt((1.0d0 + z)) - sqrt(z))
    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 (t <= 4.8e+25) {
		tmp = 3.0 + (Math.sqrt((1.0 + t)) - Math.sqrt(t));
	} else {
		tmp = ((1.0 / (Math.sqrt((1.0 + x)) + Math.sqrt(x))) + (1.0 / (Math.sqrt((1.0 + y)) + Math.sqrt(y)))) + (Math.sqrt((1.0 + z)) - Math.sqrt(z));
	}
	return tmp;
}
[x, y, z, t] = sort([x, y, z, t])
def code(x, y, z, t):
	tmp = 0
	if t <= 4.8e+25:
		tmp = 3.0 + (math.sqrt((1.0 + t)) - math.sqrt(t))
	else:
		tmp = ((1.0 / (math.sqrt((1.0 + x)) + math.sqrt(x))) + (1.0 / (math.sqrt((1.0 + y)) + math.sqrt(y)))) + (math.sqrt((1.0 + z)) - math.sqrt(z))
	return tmp
x, y, z, t = sort([x, y, z, t])
function code(x, y, z, t)
	tmp = 0.0
	if (t <= 4.8e+25)
		tmp = Float64(3.0 + Float64(sqrt(Float64(1.0 + t)) - sqrt(t)));
	else
		tmp = Float64(Float64(Float64(1.0 / Float64(sqrt(Float64(1.0 + x)) + sqrt(x))) + Float64(1.0 / Float64(sqrt(Float64(1.0 + y)) + sqrt(y)))) + Float64(sqrt(Float64(1.0 + z)) - sqrt(z)));
	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 (t <= 4.8e+25)
		tmp = 3.0 + (sqrt((1.0 + t)) - sqrt(t));
	else
		tmp = ((1.0 / (sqrt((1.0 + x)) + sqrt(x))) + (1.0 / (sqrt((1.0 + y)) + sqrt(y)))) + (sqrt((1.0 + z)) - sqrt(z));
	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[t, 4.8e+25], N[(3.0 + N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 / N[(N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq 4.8 \cdot 10^{+25}:\\
\;\;\;\;3 + \left(\sqrt{1 + t} - \sqrt{t}\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < 4.79999999999999992e25

    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. Simplified18.7%

      \[\leadsto \color{blue}{\sqrt{1 + y} + \left(\left(\left(\sqrt{x + 1} - \left(\left(\sqrt{x} + \left(\sqrt{t} - \sqrt{1 + t}\right)\right) - \sqrt{1 + z}\right)\right) - \sqrt{z}\right) - \sqrt{y}\right)} \]
    3. Taylor expanded in y around 0 17.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} + \sqrt{z}\right)\right)} \]
    4. Step-by-step derivation
      1. associate--l+35.7%

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

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

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

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

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

      \[\leadsto \color{blue}{\left(2 + \left(\sqrt{1 + t} + \sqrt{1 + z}\right)\right) - \left(\sqrt{t} + \sqrt{z}\right)} \]
    7. Step-by-step derivation
      1. +-commutative19.9%

        \[\leadsto \color{blue}{\left(\left(\sqrt{1 + t} + \sqrt{1 + z}\right) + 2\right)} - \left(\sqrt{t} + \sqrt{z}\right) \]
    8. Simplified19.9%

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

      \[\leadsto \color{blue}{\left(3 + \sqrt{1 + t}\right) - \sqrt{t}} \]
    10. Step-by-step derivation
      1. associate--l+26.0%

        \[\leadsto \color{blue}{3 + \left(\sqrt{1 + t} - \sqrt{t}\right)} \]
    11. Simplified26.0%

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

    if 4.79999999999999992e25 < t

    1. Initial program 84.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+84.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-68.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-84.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. sub-neg84.5%

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

        \[\leadsto \left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \color{blue}{\left(\sqrt{y + 1} - \sqrt{y}\right)}\right) + \left(\left(\sqrt{z + 1} - \sqrt{z}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)\right) \]
      6. +-commutative84.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) \]
      7. +-commutative84.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) \]
      8. +-commutative84.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. Simplified84.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. Step-by-step derivation
      1. flip--84.5%

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

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

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

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

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

      \[\leadsto \left(\color{blue}{\frac{\left(1 + x\right) - x}{\sqrt{1 + x} + \sqrt{x}}} + \left(\sqrt{1 + y} - \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+87.9%

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

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

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

      \[\leadsto \left(\color{blue}{\frac{1}{\sqrt{1 + x} + \sqrt{x}}} + \left(\sqrt{1 + y} - \sqrt{y}\right)\right) + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\sqrt{1 + t} - \sqrt{t}\right)\right) \]
    8. Step-by-step derivation
      1. flip--87.9%

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

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

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

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

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

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

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

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

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

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

Alternative 9: 95.8% accurate, 1.3× speedup?

\[\begin{array}{l} [x, y, z, t] = \mathsf{sort}([x, y, z, t])\\ \\ \begin{array}{l} \mathbf{if}\;t \leq 1.02 \cdot 10^{+15}:\\ \;\;\;\;3 + \left(\sqrt{1 + t} - \sqrt{t}\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\frac{1}{\sqrt{1 + x} + \sqrt{x}} + \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
 (if (<= t 1.02e+15)
   (+ 3.0 (- (sqrt (+ 1.0 t)) (sqrt t)))
   (+
    (- (sqrt (+ 1.0 z)) (sqrt z))
    (+ (/ 1.0 (+ (sqrt (+ 1.0 x)) (sqrt x))) (- (sqrt (+ 1.0 y)) (sqrt y))))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
	double tmp;
	if (t <= 1.02e+15) {
		tmp = 3.0 + (sqrt((1.0 + t)) - sqrt(t));
	} else {
		tmp = (sqrt((1.0 + z)) - sqrt(z)) + ((1.0 / (sqrt((1.0 + x)) + sqrt(x))) + (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) :: tmp
    if (t <= 1.02d+15) then
        tmp = 3.0d0 + (sqrt((1.0d0 + t)) - sqrt(t))
    else
        tmp = (sqrt((1.0d0 + z)) - sqrt(z)) + ((1.0d0 / (sqrt((1.0d0 + x)) + sqrt(x))) + (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 tmp;
	if (t <= 1.02e+15) {
		tmp = 3.0 + (Math.sqrt((1.0 + t)) - Math.sqrt(t));
	} else {
		tmp = (Math.sqrt((1.0 + z)) - Math.sqrt(z)) + ((1.0 / (Math.sqrt((1.0 + x)) + Math.sqrt(x))) + (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):
	tmp = 0
	if t <= 1.02e+15:
		tmp = 3.0 + (math.sqrt((1.0 + t)) - math.sqrt(t))
	else:
		tmp = (math.sqrt((1.0 + z)) - math.sqrt(z)) + ((1.0 / (math.sqrt((1.0 + x)) + math.sqrt(x))) + (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)
	tmp = 0.0
	if (t <= 1.02e+15)
		tmp = Float64(3.0 + Float64(sqrt(Float64(1.0 + t)) - sqrt(t)));
	else
		tmp = Float64(Float64(sqrt(Float64(1.0 + z)) - sqrt(z)) + Float64(Float64(1.0 / Float64(sqrt(Float64(1.0 + x)) + sqrt(x))) + 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)
	tmp = 0.0;
	if (t <= 1.02e+15)
		tmp = 3.0 + (sqrt((1.0 + t)) - sqrt(t));
	else
		tmp = (sqrt((1.0 + z)) - sqrt(z)) + ((1.0 / (sqrt((1.0 + x)) + sqrt(x))) + (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_] := If[LessEqual[t, 1.02e+15], N[(3.0 + N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 / N[(N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $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}
\mathbf{if}\;t \leq 1.02 \cdot 10^{+15}:\\
\;\;\;\;3 + \left(\sqrt{1 + t} - \sqrt{t}\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < 1.02e15

    1. Initial program 97.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. Simplified18.9%

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

      \[\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} + \sqrt{z}\right)\right)} \]
    4. Step-by-step derivation
      1. associate--l+35.2%

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

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

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

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

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

      \[\leadsto \color{blue}{\left(2 + \left(\sqrt{1 + t} + \sqrt{1 + z}\right)\right) - \left(\sqrt{t} + \sqrt{z}\right)} \]
    7. Step-by-step derivation
      1. +-commutative20.0%

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

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

      \[\leadsto \color{blue}{\left(3 + \sqrt{1 + t}\right) - \sqrt{t}} \]
    10. Step-by-step derivation
      1. associate--l+26.2%

        \[\leadsto \color{blue}{3 + \left(\sqrt{1 + t} - \sqrt{t}\right)} \]
    11. Simplified26.2%

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

    if 1.02e15 < t

    1. Initial program 84.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+84.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-68.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-84.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. sub-neg84.3%

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

        \[\leadsto \left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \color{blue}{\left(\sqrt{y + 1} - \sqrt{y}\right)}\right) + \left(\left(\sqrt{z + 1} - \sqrt{z}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)\right) \]
      6. +-commutative84.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) \]
      7. +-commutative84.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) \]
      8. +-commutative84.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. Simplified84.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. Step-by-step derivation
      1. flip--84.2%

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

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

        \[\leadsto \left(\frac{\color{blue}{\left(1 + x\right)} - \sqrt{x} \cdot \sqrt{x}}{\sqrt{x + 1} + \sqrt{x}} + \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-sqr-sqrt84.5%

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

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

      \[\leadsto \left(\color{blue}{\frac{\left(1 + x\right) - x}{\sqrt{1 + x} + \sqrt{x}}} + \left(\sqrt{1 + y} - \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+87.6%

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

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

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

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

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

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

Alternative 10: 90.4% accurate, 1.3× speedup?

\[\begin{array}{l} [x, y, z, t] = \mathsf{sort}([x, y, z, t])\\ \\ \begin{array}{l} t_1 := \sqrt{1 + x}\\ \mathbf{if}\;y \leq 5.5 \cdot 10^{+19}:\\ \;\;\;\;\sqrt{1 + y} + \left(\left(t_1 + \left(\sqrt{1 + z} - \left(\sqrt{x} + \sqrt{z}\right)\right)\right) - \sqrt{y}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{t_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
 (let* ((t_1 (sqrt (+ 1.0 x))))
   (if (<= y 5.5e+19)
     (+
      (sqrt (+ 1.0 y))
      (- (+ t_1 (- (sqrt (+ 1.0 z)) (+ (sqrt x) (sqrt z)))) (sqrt y)))
     (/ 1.0 (+ t_1 (sqrt x))))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
	double t_1 = sqrt((1.0 + x));
	double tmp;
	if (y <= 5.5e+19) {
		tmp = sqrt((1.0 + y)) + ((t_1 + (sqrt((1.0 + z)) - (sqrt(x) + sqrt(z)))) - sqrt(y));
	} else {
		tmp = 1.0 / (t_1 + 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) :: t_1
    real(8) :: tmp
    t_1 = sqrt((1.0d0 + x))
    if (y <= 5.5d+19) then
        tmp = sqrt((1.0d0 + y)) + ((t_1 + (sqrt((1.0d0 + z)) - (sqrt(x) + sqrt(z)))) - sqrt(y))
    else
        tmp = 1.0d0 / (t_1 + 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 t_1 = Math.sqrt((1.0 + x));
	double tmp;
	if (y <= 5.5e+19) {
		tmp = Math.sqrt((1.0 + y)) + ((t_1 + (Math.sqrt((1.0 + z)) - (Math.sqrt(x) + Math.sqrt(z)))) - Math.sqrt(y));
	} else {
		tmp = 1.0 / (t_1 + Math.sqrt(x));
	}
	return tmp;
}
[x, y, z, t] = sort([x, y, z, t])
def code(x, y, z, t):
	t_1 = math.sqrt((1.0 + x))
	tmp = 0
	if y <= 5.5e+19:
		tmp = math.sqrt((1.0 + y)) + ((t_1 + (math.sqrt((1.0 + z)) - (math.sqrt(x) + math.sqrt(z)))) - math.sqrt(y))
	else:
		tmp = 1.0 / (t_1 + math.sqrt(x))
	return tmp
x, y, z, t = sort([x, y, z, t])
function code(x, y, z, t)
	t_1 = sqrt(Float64(1.0 + x))
	tmp = 0.0
	if (y <= 5.5e+19)
		tmp = Float64(sqrt(Float64(1.0 + y)) + Float64(Float64(t_1 + Float64(sqrt(Float64(1.0 + z)) - Float64(sqrt(x) + sqrt(z)))) - sqrt(y)));
	else
		tmp = Float64(1.0 / Float64(t_1 + sqrt(x)));
	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 + x));
	tmp = 0.0;
	if (y <= 5.5e+19)
		tmp = sqrt((1.0 + y)) + ((t_1 + (sqrt((1.0 + z)) - (sqrt(x) + sqrt(z)))) - sqrt(y));
	else
		tmp = 1.0 / (t_1 + 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_] := Block[{t$95$1 = N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y, 5.5e+19], N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] + N[(N[(t$95$1 + N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(t$95$1 + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + x}\\
\mathbf{if}\;y \leq 5.5 \cdot 10^{+19}:\\
\;\;\;\;\sqrt{1 + y} + \left(\left(t_1 + \left(\sqrt{1 + z} - \left(\sqrt{x} + \sqrt{z}\right)\right)\right) - \sqrt{y}\right)\\

\mathbf{else}:\\
\;\;\;\;\frac{1}{t_1 + \sqrt{x}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < 5.5e19

    1. Initial program 96.8%

      \[\left(\left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{y + 1} - \sqrt{y}\right)\right) + \left(\sqrt{z + 1} - \sqrt{z}\right)\right) + \left(\sqrt{t + 1} - \sqrt{t}\right) \]
    2. Simplified44.8%

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

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

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

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

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

    if 5.5e19 < y

    1. Initial program 85.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. Simplified3.8%

      \[\leadsto \color{blue}{\sqrt{1 + y} + \left(\left(\left(\sqrt{x + 1} - \left(\left(\sqrt{x} + \left(\sqrt{t} - \sqrt{1 + t}\right)\right) - \sqrt{1 + z}\right)\right) - \sqrt{z}\right) - \sqrt{y}\right)} \]
    3. 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)} \]
    4. Step-by-step derivation
      1. associate--l+22.7%

        \[\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)} \]
      2. +-commutative22.7%

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\sqrt{1 + x} - \sqrt{x}} \]
    10. Step-by-step derivation
      1. flip--23.1%

        \[\leadsto \color{blue}{\frac{\sqrt{1 + x} \cdot \sqrt{1 + x} - \sqrt{x} \cdot \sqrt{x}}{\sqrt{1 + x} + \sqrt{x}}} \]
      2. add-sqr-sqrt23.2%

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

        \[\leadsto \frac{\left(1 + x\right) - \color{blue}{x}}{\sqrt{1 + x} + \sqrt{x}} \]
    11. Applied egg-rr23.2%

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

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

        \[\leadsto \frac{1 + \color{blue}{0}}{\sqrt{1 + x} + \sqrt{x}} \]
      3. metadata-eval26.9%

        \[\leadsto \frac{\color{blue}{1}}{\sqrt{1 + x} + \sqrt{x}} \]
    13. Simplified26.9%

      \[\leadsto \color{blue}{\frac{1}{\sqrt{1 + x} + \sqrt{x}}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification33.8%

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

Alternative 11: 89.6% accurate, 2.0× speedup?

\[\begin{array}{l} [x, y, z, t] = \mathsf{sort}([x, y, z, t])\\ \\ \begin{array}{l} t_1 := \sqrt{1 + x}\\ \mathbf{if}\;y \leq 2.3 \cdot 10^{-33}:\\ \;\;\;\;\left(\sqrt{1 + z} - \sqrt{z}\right) + 2\\ \mathbf{elif}\;y \leq 5 \cdot 10^{+15}:\\ \;\;\;\;t_1 + \left(\sqrt{1 + y} - \left(\sqrt{y} + \sqrt{x}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{t_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
 (let* ((t_1 (sqrt (+ 1.0 x))))
   (if (<= y 2.3e-33)
     (+ (- (sqrt (+ 1.0 z)) (sqrt z)) 2.0)
     (if (<= y 5e+15)
       (+ t_1 (- (sqrt (+ 1.0 y)) (+ (sqrt y) (sqrt x))))
       (/ 1.0 (+ t_1 (sqrt x)))))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
	double t_1 = sqrt((1.0 + x));
	double tmp;
	if (y <= 2.3e-33) {
		tmp = (sqrt((1.0 + z)) - sqrt(z)) + 2.0;
	} else if (y <= 5e+15) {
		tmp = t_1 + (sqrt((1.0 + y)) - (sqrt(y) + sqrt(x)));
	} else {
		tmp = 1.0 / (t_1 + 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) :: t_1
    real(8) :: tmp
    t_1 = sqrt((1.0d0 + x))
    if (y <= 2.3d-33) then
        tmp = (sqrt((1.0d0 + z)) - sqrt(z)) + 2.0d0
    else if (y <= 5d+15) then
        tmp = t_1 + (sqrt((1.0d0 + y)) - (sqrt(y) + sqrt(x)))
    else
        tmp = 1.0d0 / (t_1 + 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 t_1 = Math.sqrt((1.0 + x));
	double tmp;
	if (y <= 2.3e-33) {
		tmp = (Math.sqrt((1.0 + z)) - Math.sqrt(z)) + 2.0;
	} else if (y <= 5e+15) {
		tmp = t_1 + (Math.sqrt((1.0 + y)) - (Math.sqrt(y) + Math.sqrt(x)));
	} else {
		tmp = 1.0 / (t_1 + Math.sqrt(x));
	}
	return tmp;
}
[x, y, z, t] = sort([x, y, z, t])
def code(x, y, z, t):
	t_1 = math.sqrt((1.0 + x))
	tmp = 0
	if y <= 2.3e-33:
		tmp = (math.sqrt((1.0 + z)) - math.sqrt(z)) + 2.0
	elif y <= 5e+15:
		tmp = t_1 + (math.sqrt((1.0 + y)) - (math.sqrt(y) + math.sqrt(x)))
	else:
		tmp = 1.0 / (t_1 + math.sqrt(x))
	return tmp
x, y, z, t = sort([x, y, z, t])
function code(x, y, z, t)
	t_1 = sqrt(Float64(1.0 + x))
	tmp = 0.0
	if (y <= 2.3e-33)
		tmp = Float64(Float64(sqrt(Float64(1.0 + z)) - sqrt(z)) + 2.0);
	elseif (y <= 5e+15)
		tmp = Float64(t_1 + Float64(sqrt(Float64(1.0 + y)) - Float64(sqrt(y) + sqrt(x))));
	else
		tmp = Float64(1.0 / Float64(t_1 + sqrt(x)));
	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 + x));
	tmp = 0.0;
	if (y <= 2.3e-33)
		tmp = (sqrt((1.0 + z)) - sqrt(z)) + 2.0;
	elseif (y <= 5e+15)
		tmp = t_1 + (sqrt((1.0 + y)) - (sqrt(y) + sqrt(x)));
	else
		tmp = 1.0 / (t_1 + 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_] := Block[{t$95$1 = N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y, 2.3e-33], N[(N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision], If[LessEqual[y, 5e+15], N[(t$95$1 + N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] - N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(t$95$1 + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + x}\\
\mathbf{if}\;y \leq 2.3 \cdot 10^{-33}:\\
\;\;\;\;\left(\sqrt{1 + z} - \sqrt{z}\right) + 2\\

\mathbf{elif}\;y \leq 5 \cdot 10^{+15}:\\
\;\;\;\;t_1 + \left(\sqrt{1 + y} - \left(\sqrt{y} + \sqrt{x}\right)\right)\\

\mathbf{else}:\\
\;\;\;\;\frac{1}{t_1 + \sqrt{x}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < 2.29999999999999986e-33

    1. Initial program 98.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. Simplified46.2%

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

      \[\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} + \sqrt{z}\right)\right)} \]
    4. Step-by-step derivation
      1. associate--l+38.6%

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

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

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

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

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

      \[\leadsto \color{blue}{\left(2 + \left(\sqrt{1 + t} + \sqrt{1 + z}\right)\right) - \left(\sqrt{t} + \sqrt{z}\right)} \]
    7. Step-by-step derivation
      1. +-commutative17.5%

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

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

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

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

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

    if 2.29999999999999986e-33 < y < 5e15

    1. Initial program 94.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. Simplified36.6%

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

      \[\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)} \]
    4. Step-by-step derivation
      1. associate--l+32.7%

        \[\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)} \]
      2. +-commutative32.7%

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

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

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

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

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

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

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

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

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

    if 5e15 < y

    1. Initial program 84.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. Simplified4.3%

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

      \[\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)} \]
    4. 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)} \]
      2. +-commutative22.6%

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\sqrt{1 + x} - \sqrt{x}} \]
    10. Step-by-step derivation
      1. flip--23.0%

        \[\leadsto \color{blue}{\frac{\sqrt{1 + x} \cdot \sqrt{1 + x} - \sqrt{x} \cdot \sqrt{x}}{\sqrt{1 + x} + \sqrt{x}}} \]
      2. add-sqr-sqrt23.0%

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

        \[\leadsto \frac{\left(1 + x\right) - \color{blue}{x}}{\sqrt{1 + x} + \sqrt{x}} \]
    11. Applied egg-rr23.0%

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

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

        \[\leadsto \frac{1 + \color{blue}{0}}{\sqrt{1 + x} + \sqrt{x}} \]
      3. metadata-eval26.7%

        \[\leadsto \frac{\color{blue}{1}}{\sqrt{1 + x} + \sqrt{x}} \]
    13. Simplified26.7%

      \[\leadsto \color{blue}{\frac{1}{\sqrt{1 + x} + \sqrt{x}}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification38.4%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq 2.3 \cdot 10^{-33}:\\ \;\;\;\;\left(\sqrt{1 + z} - \sqrt{z}\right) + 2\\ \mathbf{elif}\;y \leq 5 \cdot 10^{+15}:\\ \;\;\;\;\sqrt{1 + x} + \left(\sqrt{1 + y} - \left(\sqrt{y} + \sqrt{x}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sqrt{1 + x} + \sqrt{x}}\\ \end{array} \]

Alternative 12: 89.5% accurate, 2.6× speedup?

\[\begin{array}{l} [x, y, z, t] = \mathsf{sort}([x, y, z, t])\\ \\ \begin{array}{l} \mathbf{if}\;y \leq 2.3 \cdot 10^{-33}:\\ \;\;\;\;\left(\sqrt{1 + z} - \sqrt{z}\right) + 2\\ \mathbf{elif}\;y \leq 5 \cdot 10^{+17}:\\ \;\;\;\;\left(1 + \sqrt{1 + y}\right) - \left(\sqrt{y} + \sqrt{x}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sqrt{1 + x} + \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 2.3e-33)
   (+ (- (sqrt (+ 1.0 z)) (sqrt z)) 2.0)
   (if (<= y 5e+17)
     (- (+ 1.0 (sqrt (+ 1.0 y))) (+ (sqrt y) (sqrt x)))
     (/ 1.0 (+ (sqrt (+ 1.0 x)) (sqrt x))))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
	double tmp;
	if (y <= 2.3e-33) {
		tmp = (sqrt((1.0 + z)) - sqrt(z)) + 2.0;
	} else if (y <= 5e+17) {
		tmp = (1.0 + sqrt((1.0 + y))) - (sqrt(y) + sqrt(x));
	} else {
		tmp = 1.0 / (sqrt((1.0 + x)) + 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 <= 2.3d-33) then
        tmp = (sqrt((1.0d0 + z)) - sqrt(z)) + 2.0d0
    else if (y <= 5d+17) then
        tmp = (1.0d0 + sqrt((1.0d0 + y))) - (sqrt(y) + sqrt(x))
    else
        tmp = 1.0d0 / (sqrt((1.0d0 + x)) + 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 <= 2.3e-33) {
		tmp = (Math.sqrt((1.0 + z)) - Math.sqrt(z)) + 2.0;
	} else if (y <= 5e+17) {
		tmp = (1.0 + Math.sqrt((1.0 + y))) - (Math.sqrt(y) + Math.sqrt(x));
	} else {
		tmp = 1.0 / (Math.sqrt((1.0 + x)) + Math.sqrt(x));
	}
	return tmp;
}
[x, y, z, t] = sort([x, y, z, t])
def code(x, y, z, t):
	tmp = 0
	if y <= 2.3e-33:
		tmp = (math.sqrt((1.0 + z)) - math.sqrt(z)) + 2.0
	elif y <= 5e+17:
		tmp = (1.0 + math.sqrt((1.0 + y))) - (math.sqrt(y) + math.sqrt(x))
	else:
		tmp = 1.0 / (math.sqrt((1.0 + x)) + 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 <= 2.3e-33)
		tmp = Float64(Float64(sqrt(Float64(1.0 + z)) - sqrt(z)) + 2.0);
	elseif (y <= 5e+17)
		tmp = Float64(Float64(1.0 + sqrt(Float64(1.0 + y))) - Float64(sqrt(y) + sqrt(x)));
	else
		tmp = Float64(1.0 / Float64(sqrt(Float64(1.0 + x)) + 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 <= 2.3e-33)
		tmp = (sqrt((1.0 + z)) - sqrt(z)) + 2.0;
	elseif (y <= 5e+17)
		tmp = (1.0 + sqrt((1.0 + y))) - (sqrt(y) + sqrt(x));
	else
		tmp = 1.0 / (sqrt((1.0 + x)) + 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, 2.3e-33], N[(N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision], If[LessEqual[y, 5e+17], N[(N[(1.0 + N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 2.3 \cdot 10^{-33}:\\
\;\;\;\;\left(\sqrt{1 + z} - \sqrt{z}\right) + 2\\

\mathbf{elif}\;y \leq 5 \cdot 10^{+17}:\\
\;\;\;\;\left(1 + \sqrt{1 + y}\right) - \left(\sqrt{y} + \sqrt{x}\right)\\

\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{1 + x} + \sqrt{x}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < 2.29999999999999986e-33

    1. Initial program 98.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. Simplified46.2%

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

      \[\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} + \sqrt{z}\right)\right)} \]
    4. Step-by-step derivation
      1. associate--l+38.6%

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

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

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

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

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

      \[\leadsto \color{blue}{\left(2 + \left(\sqrt{1 + t} + \sqrt{1 + z}\right)\right) - \left(\sqrt{t} + \sqrt{z}\right)} \]
    7. Step-by-step derivation
      1. +-commutative17.5%

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

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

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

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

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

    if 2.29999999999999986e-33 < y < 5e17

    1. Initial program 93.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. Simplified38.4%

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

      \[\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)} \]
    4. Step-by-step derivation
      1. associate--l+32.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)} \]
      2. +-commutative32.0%

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

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

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

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

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

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

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

    if 5e17 < y

    1. Initial program 84.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. Simplified3.8%

      \[\leadsto \color{blue}{\sqrt{1 + y} + \left(\left(\left(\sqrt{x + 1} - \left(\left(\sqrt{x} + \left(\sqrt{t} - \sqrt{1 + t}\right)\right) - \sqrt{1 + z}\right)\right) - \sqrt{z}\right) - \sqrt{y}\right)} \]
    3. 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)} \]
    4. 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)} \]
      2. +-commutative22.6%

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\sqrt{1 + x} - \sqrt{x}} \]
    10. Step-by-step derivation
      1. flip--23.0%

        \[\leadsto \color{blue}{\frac{\sqrt{1 + x} \cdot \sqrt{1 + x} - \sqrt{x} \cdot \sqrt{x}}{\sqrt{1 + x} + \sqrt{x}}} \]
      2. add-sqr-sqrt23.1%

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

        \[\leadsto \frac{\left(1 + x\right) - \color{blue}{x}}{\sqrt{1 + x} + \sqrt{x}} \]
    11. Applied egg-rr23.0%

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

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

        \[\leadsto \frac{1 + \color{blue}{0}}{\sqrt{1 + x} + \sqrt{x}} \]
      3. metadata-eval26.7%

        \[\leadsto \frac{\color{blue}{1}}{\sqrt{1 + x} + \sqrt{x}} \]
    13. Simplified26.7%

      \[\leadsto \color{blue}{\frac{1}{\sqrt{1 + x} + \sqrt{x}}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification38.3%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq 2.3 \cdot 10^{-33}:\\ \;\;\;\;\left(\sqrt{1 + z} - \sqrt{z}\right) + 2\\ \mathbf{elif}\;y \leq 5 \cdot 10^{+17}:\\ \;\;\;\;\left(1 + \sqrt{1 + y}\right) - \left(\sqrt{y} + \sqrt{x}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sqrt{1 + x} + \sqrt{x}}\\ \end{array} \]

Alternative 13: 89.6% accurate, 3.9× speedup?

\[\begin{array}{l} [x, y, z, t] = \mathsf{sort}([x, y, z, t])\\ \\ \begin{array}{l} \mathbf{if}\;z \leq 6.8 \cdot 10^{-34}:\\ \;\;\;\;3 + \left(\sqrt{1 + t} - \sqrt{t}\right)\\ \mathbf{elif}\;z \leq 80000000000000:\\ \;\;\;\;\left(\sqrt{1 + z} - \sqrt{z}\right) + 2\\ \mathbf{else}:\\ \;\;\;\;1 + \left(\sqrt{1 + y} - \sqrt{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
 (if (<= z 6.8e-34)
   (+ 3.0 (- (sqrt (+ 1.0 t)) (sqrt t)))
   (if (<= z 80000000000000.0)
     (+ (- (sqrt (+ 1.0 z)) (sqrt z)) 2.0)
     (+ 1.0 (- (sqrt (+ 1.0 y)) (sqrt y))))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
	double tmp;
	if (z <= 6.8e-34) {
		tmp = 3.0 + (sqrt((1.0 + t)) - sqrt(t));
	} else if (z <= 80000000000000.0) {
		tmp = (sqrt((1.0 + z)) - sqrt(z)) + 2.0;
	} else {
		tmp = 1.0 + (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) :: tmp
    if (z <= 6.8d-34) then
        tmp = 3.0d0 + (sqrt((1.0d0 + t)) - sqrt(t))
    else if (z <= 80000000000000.0d0) then
        tmp = (sqrt((1.0d0 + z)) - sqrt(z)) + 2.0d0
    else
        tmp = 1.0d0 + (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 tmp;
	if (z <= 6.8e-34) {
		tmp = 3.0 + (Math.sqrt((1.0 + t)) - Math.sqrt(t));
	} else if (z <= 80000000000000.0) {
		tmp = (Math.sqrt((1.0 + z)) - Math.sqrt(z)) + 2.0;
	} else {
		tmp = 1.0 + (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):
	tmp = 0
	if z <= 6.8e-34:
		tmp = 3.0 + (math.sqrt((1.0 + t)) - math.sqrt(t))
	elif z <= 80000000000000.0:
		tmp = (math.sqrt((1.0 + z)) - math.sqrt(z)) + 2.0
	else:
		tmp = 1.0 + (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)
	tmp = 0.0
	if (z <= 6.8e-34)
		tmp = Float64(3.0 + Float64(sqrt(Float64(1.0 + t)) - sqrt(t)));
	elseif (z <= 80000000000000.0)
		tmp = Float64(Float64(sqrt(Float64(1.0 + z)) - sqrt(z)) + 2.0);
	else
		tmp = Float64(1.0 + 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)
	tmp = 0.0;
	if (z <= 6.8e-34)
		tmp = 3.0 + (sqrt((1.0 + t)) - sqrt(t));
	elseif (z <= 80000000000000.0)
		tmp = (sqrt((1.0 + z)) - sqrt(z)) + 2.0;
	else
		tmp = 1.0 + (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_] := If[LessEqual[z, 6.8e-34], N[(3.0 + N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 80000000000000.0], N[(N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision], N[(1.0 + N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq 6.8 \cdot 10^{-34}:\\
\;\;\;\;3 + \left(\sqrt{1 + t} - \sqrt{t}\right)\\

\mathbf{elif}\;z \leq 80000000000000:\\
\;\;\;\;\left(\sqrt{1 + z} - \sqrt{z}\right) + 2\\

\mathbf{else}:\\
\;\;\;\;1 + \left(\sqrt{1 + y} - \sqrt{y}\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < 6.8000000000000001e-34

    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. Simplified30.5%

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

      \[\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} + \sqrt{z}\right)\right)} \]
    4. Step-by-step derivation
      1. associate--l+34.2%

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

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

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

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

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

      \[\leadsto \color{blue}{\left(2 + \left(\sqrt{1 + t} + \sqrt{1 + z}\right)\right) - \left(\sqrt{t} + \sqrt{z}\right)} \]
    7. Step-by-step derivation
      1. +-commutative20.5%

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

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

      \[\leadsto \color{blue}{\left(3 + \sqrt{1 + t}\right) - \sqrt{t}} \]
    10. Step-by-step derivation
      1. associate--l+33.6%

        \[\leadsto \color{blue}{3 + \left(\sqrt{1 + t} - \sqrt{t}\right)} \]
    11. Simplified33.6%

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

    if 6.8000000000000001e-34 < z < 8e13

    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. Simplified34.7%

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

      \[\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} + \sqrt{z}\right)\right)} \]
    4. Step-by-step derivation
      1. associate--l+26.6%

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

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

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

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

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

      \[\leadsto \color{blue}{\left(2 + \left(\sqrt{1 + t} + \sqrt{1 + z}\right)\right) - \left(\sqrt{t} + \sqrt{z}\right)} \]
    7. Step-by-step derivation
      1. +-commutative12.7%

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

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

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

        \[\leadsto \color{blue}{2 + \left(\sqrt{1 + z} - \sqrt{z}\right)} \]
    11. Simplified52.8%

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

    if 8e13 < z

    1. Initial program 83.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. Simplified14.9%

      \[\leadsto \color{blue}{\sqrt{1 + y} + \left(\left(\left(\sqrt{x + 1} - \left(\left(\sqrt{x} + \left(\sqrt{t} - \sqrt{1 + t}\right)\right) - \sqrt{1 + z}\right)\right) - \sqrt{z}\right) - \sqrt{y}\right)} \]
    3. 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)} \]
    4. 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)} \]
      2. +-commutative22.9%

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq 6.8 \cdot 10^{-34}:\\ \;\;\;\;3 + \left(\sqrt{1 + t} - \sqrt{t}\right)\\ \mathbf{elif}\;z \leq 80000000000000:\\ \;\;\;\;\left(\sqrt{1 + z} - \sqrt{z}\right) + 2\\ \mathbf{else}:\\ \;\;\;\;1 + \left(\sqrt{1 + y} - \sqrt{y}\right)\\ \end{array} \]

Alternative 14: 89.4% accurate, 3.9× speedup?

\[\begin{array}{l} [x, y, z, t] = \mathsf{sort}([x, y, z, t])\\ \\ \begin{array}{l} \mathbf{if}\;y \leq 2.3 \cdot 10^{-33}:\\ \;\;\;\;\left(\sqrt{1 + z} - \sqrt{z}\right) + 2\\ \mathbf{elif}\;y \leq 8 \cdot 10^{+17}:\\ \;\;\;\;1 + \left(\sqrt{1 + y} - \sqrt{y}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sqrt{1 + x} + \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 2.3e-33)
   (+ (- (sqrt (+ 1.0 z)) (sqrt z)) 2.0)
   (if (<= y 8e+17)
     (+ 1.0 (- (sqrt (+ 1.0 y)) (sqrt y)))
     (/ 1.0 (+ (sqrt (+ 1.0 x)) (sqrt x))))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
	double tmp;
	if (y <= 2.3e-33) {
		tmp = (sqrt((1.0 + z)) - sqrt(z)) + 2.0;
	} else if (y <= 8e+17) {
		tmp = 1.0 + (sqrt((1.0 + y)) - sqrt(y));
	} else {
		tmp = 1.0 / (sqrt((1.0 + x)) + 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 <= 2.3d-33) then
        tmp = (sqrt((1.0d0 + z)) - sqrt(z)) + 2.0d0
    else if (y <= 8d+17) then
        tmp = 1.0d0 + (sqrt((1.0d0 + y)) - sqrt(y))
    else
        tmp = 1.0d0 / (sqrt((1.0d0 + x)) + 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 <= 2.3e-33) {
		tmp = (Math.sqrt((1.0 + z)) - Math.sqrt(z)) + 2.0;
	} else if (y <= 8e+17) {
		tmp = 1.0 + (Math.sqrt((1.0 + y)) - Math.sqrt(y));
	} else {
		tmp = 1.0 / (Math.sqrt((1.0 + x)) + Math.sqrt(x));
	}
	return tmp;
}
[x, y, z, t] = sort([x, y, z, t])
def code(x, y, z, t):
	tmp = 0
	if y <= 2.3e-33:
		tmp = (math.sqrt((1.0 + z)) - math.sqrt(z)) + 2.0
	elif y <= 8e+17:
		tmp = 1.0 + (math.sqrt((1.0 + y)) - math.sqrt(y))
	else:
		tmp = 1.0 / (math.sqrt((1.0 + x)) + 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 <= 2.3e-33)
		tmp = Float64(Float64(sqrt(Float64(1.0 + z)) - sqrt(z)) + 2.0);
	elseif (y <= 8e+17)
		tmp = Float64(1.0 + Float64(sqrt(Float64(1.0 + y)) - sqrt(y)));
	else
		tmp = Float64(1.0 / Float64(sqrt(Float64(1.0 + x)) + 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 <= 2.3e-33)
		tmp = (sqrt((1.0 + z)) - sqrt(z)) + 2.0;
	elseif (y <= 8e+17)
		tmp = 1.0 + (sqrt((1.0 + y)) - sqrt(y));
	else
		tmp = 1.0 / (sqrt((1.0 + x)) + 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, 2.3e-33], N[(N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision], If[LessEqual[y, 8e+17], N[(1.0 + N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 2.3 \cdot 10^{-33}:\\
\;\;\;\;\left(\sqrt{1 + z} - \sqrt{z}\right) + 2\\

\mathbf{elif}\;y \leq 8 \cdot 10^{+17}:\\
\;\;\;\;1 + \left(\sqrt{1 + y} - \sqrt{y}\right)\\

\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{1 + x} + \sqrt{x}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < 2.29999999999999986e-33

    1. Initial program 98.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. Simplified46.2%

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

      \[\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} + \sqrt{z}\right)\right)} \]
    4. Step-by-step derivation
      1. associate--l+38.6%

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

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

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

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

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

      \[\leadsto \color{blue}{\left(2 + \left(\sqrt{1 + t} + \sqrt{1 + z}\right)\right) - \left(\sqrt{t} + \sqrt{z}\right)} \]
    7. Step-by-step derivation
      1. +-commutative17.5%

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

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

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

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

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

    if 2.29999999999999986e-33 < y < 8e17

    1. Initial program 93.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. Simplified38.4%

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

      \[\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)} \]
    4. Step-by-step derivation
      1. associate--l+32.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)} \]
      2. +-commutative32.0%

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

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

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

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

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

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

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

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

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

    if 8e17 < y

    1. Initial program 84.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. Simplified3.8%

      \[\leadsto \color{blue}{\sqrt{1 + y} + \left(\left(\left(\sqrt{x + 1} - \left(\left(\sqrt{x} + \left(\sqrt{t} - \sqrt{1 + t}\right)\right) - \sqrt{1 + z}\right)\right) - \sqrt{z}\right) - \sqrt{y}\right)} \]
    3. 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)} \]
    4. 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)} \]
      2. +-commutative22.6%

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\sqrt{1 + x} - \sqrt{x}} \]
    10. Step-by-step derivation
      1. flip--23.0%

        \[\leadsto \color{blue}{\frac{\sqrt{1 + x} \cdot \sqrt{1 + x} - \sqrt{x} \cdot \sqrt{x}}{\sqrt{1 + x} + \sqrt{x}}} \]
      2. add-sqr-sqrt23.1%

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

        \[\leadsto \frac{\left(1 + x\right) - \color{blue}{x}}{\sqrt{1 + x} + \sqrt{x}} \]
    11. Applied egg-rr23.0%

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

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

        \[\leadsto \frac{1 + \color{blue}{0}}{\sqrt{1 + x} + \sqrt{x}} \]
      3. metadata-eval26.7%

        \[\leadsto \frac{\color{blue}{1}}{\sqrt{1 + x} + \sqrt{x}} \]
    13. Simplified26.7%

      \[\leadsto \color{blue}{\frac{1}{\sqrt{1 + x} + \sqrt{x}}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification40.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq 2.3 \cdot 10^{-33}:\\ \;\;\;\;\left(\sqrt{1 + z} - \sqrt{z}\right) + 2\\ \mathbf{elif}\;y \leq 8 \cdot 10^{+17}:\\ \;\;\;\;1 + \left(\sqrt{1 + y} - \sqrt{y}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sqrt{1 + x} + \sqrt{x}}\\ \end{array} \]

Alternative 15: 61.8% accurate, 3.9× speedup?

\[\begin{array}{l} [x, y, z, t] = \mathsf{sort}([x, y, z, t])\\ \\ \begin{array}{l} t_1 := \sqrt{1 + x} - \sqrt{x}\\ \mathbf{if}\;y \leq 19.5:\\ \;\;\;\;1 + t_1\\ \mathbf{else}:\\ \;\;\;\;t_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 (+ 1.0 x)) (sqrt x)))) (if (<= y 19.5) (+ 1.0 t_1) 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 + x)) - sqrt(x);
	double tmp;
	if (y <= 19.5) {
		tmp = 1.0 + t_1;
	} else {
		tmp = 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) :: tmp
    t_1 = sqrt((1.0d0 + x)) - sqrt(x)
    if (y <= 19.5d0) then
        tmp = 1.0d0 + t_1
    else
        tmp = 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 + x)) - Math.sqrt(x);
	double tmp;
	if (y <= 19.5) {
		tmp = 1.0 + t_1;
	} else {
		tmp = 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 + x)) - math.sqrt(x)
	tmp = 0
	if y <= 19.5:
		tmp = 1.0 + t_1
	else:
		tmp = t_1
	return tmp
x, y, z, t = sort([x, y, z, t])
function code(x, y, z, t)
	t_1 = Float64(sqrt(Float64(1.0 + x)) - sqrt(x))
	tmp = 0.0
	if (y <= 19.5)
		tmp = Float64(1.0 + t_1);
	else
		tmp = 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 + x)) - sqrt(x);
	tmp = 0.0;
	if (y <= 19.5)
		tmp = 1.0 + t_1;
	else
		tmp = 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[N[(1.0 + x), $MachinePrecision]], $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 19.5], N[(1.0 + t$95$1), $MachinePrecision], t$95$1]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + x} - \sqrt{x}\\
\mathbf{if}\;y \leq 19.5:\\
\;\;\;\;1 + t_1\\

\mathbf{else}:\\
\;\;\;\;t_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < 19.5

    1. Initial program 98.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. Simplified46.1%

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

      \[\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)} \]
    4. Step-by-step derivation
      1. associate--l+25.7%

        \[\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)} \]
      2. +-commutative25.7%

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{1 + \left(\sqrt{1 + x} - \sqrt{x}\right)} \]
    11. Simplified37.8%

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

    if 19.5 < y

    1. Initial program 84.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. Simplified4.4%

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

      \[\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)} \]
    4. Step-by-step derivation
      1. associate--l+22.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)} \]
      2. +-commutative22.2%

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

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

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

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

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

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

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

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

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

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

Alternative 16: 84.4% accurate, 3.9× speedup?

\[\begin{array}{l} [x, y, z, t] = \mathsf{sort}([x, y, z, t])\\ \\ \begin{array}{l} \mathbf{if}\;z \leq 2.3 \cdot 10^{+14}:\\ \;\;\;\;\left(\sqrt{1 + z} - \sqrt{z}\right) + 2\\ \mathbf{else}:\\ \;\;\;\;1 + \left(\sqrt{1 + y} - \sqrt{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
 (if (<= z 2.3e+14)
   (+ (- (sqrt (+ 1.0 z)) (sqrt z)) 2.0)
   (+ 1.0 (- (sqrt (+ 1.0 y)) (sqrt y)))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
	double tmp;
	if (z <= 2.3e+14) {
		tmp = (sqrt((1.0 + z)) - sqrt(z)) + 2.0;
	} else {
		tmp = 1.0 + (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) :: tmp
    if (z <= 2.3d+14) then
        tmp = (sqrt((1.0d0 + z)) - sqrt(z)) + 2.0d0
    else
        tmp = 1.0d0 + (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 tmp;
	if (z <= 2.3e+14) {
		tmp = (Math.sqrt((1.0 + z)) - Math.sqrt(z)) + 2.0;
	} else {
		tmp = 1.0 + (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):
	tmp = 0
	if z <= 2.3e+14:
		tmp = (math.sqrt((1.0 + z)) - math.sqrt(z)) + 2.0
	else:
		tmp = 1.0 + (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)
	tmp = 0.0
	if (z <= 2.3e+14)
		tmp = Float64(Float64(sqrt(Float64(1.0 + z)) - sqrt(z)) + 2.0);
	else
		tmp = Float64(1.0 + 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)
	tmp = 0.0;
	if (z <= 2.3e+14)
		tmp = (sqrt((1.0 + z)) - sqrt(z)) + 2.0;
	else
		tmp = 1.0 + (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_] := If[LessEqual[z, 2.3e+14], N[(N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision], N[(1.0 + N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq 2.3 \cdot 10^{+14}:\\
\;\;\;\;\left(\sqrt{1 + z} - \sqrt{z}\right) + 2\\

\mathbf{else}:\\
\;\;\;\;1 + \left(\sqrt{1 + y} - \sqrt{y}\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < 2.3e14

    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. Simplified31.1%

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

      \[\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} + \sqrt{z}\right)\right)} \]
    4. Step-by-step derivation
      1. associate--l+33.1%

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

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

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

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

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

      \[\leadsto \color{blue}{\left(2 + \left(\sqrt{1 + t} + \sqrt{1 + z}\right)\right) - \left(\sqrt{t} + \sqrt{z}\right)} \]
    7. Step-by-step derivation
      1. +-commutative19.4%

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

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

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

        \[\leadsto \color{blue}{2 + \left(\sqrt{1 + z} - \sqrt{z}\right)} \]
    11. Simplified49.9%

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

    if 2.3e14 < z

    1. Initial program 83.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. Simplified14.9%

      \[\leadsto \color{blue}{\sqrt{1 + y} + \left(\left(\left(\sqrt{x + 1} - \left(\left(\sqrt{x} + \left(\sqrt{t} - \sqrt{1 + t}\right)\right) - \sqrt{1 + z}\right)\right) - \sqrt{z}\right) - \sqrt{y}\right)} \]
    3. 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)} \]
    4. 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)} \]
      2. +-commutative22.9%

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

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

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

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

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

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

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

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

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

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

Alternative 17: 64.5% accurate, 4.0× speedup?

\[\begin{array}{l} [x, y, z, t] = \mathsf{sort}([x, y, z, t])\\ \\ 1 + \left(\sqrt{1 + y} - \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 (- (sqrt (+ 1.0 y)) (sqrt y))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
	return 1.0 + (sqrt((1.0 + y)) - 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 + (sqrt((1.0d0 + y)) - 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 + (Math.sqrt((1.0 + y)) - Math.sqrt(y));
}
[x, y, z, t] = sort([x, y, z, t])
def code(x, y, z, t):
	return 1.0 + (math.sqrt((1.0 + y)) - math.sqrt(y))
x, y, z, t = sort([x, y, z, t])
function code(x, y, z, t)
	return Float64(1.0 + Float64(sqrt(Float64(1.0 + y)) - sqrt(y)))
end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp = code(x, y, z, t)
	tmp = 1.0 + (sqrt((1.0 + y)) - 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[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
1 + \left(\sqrt{1 + y} - \sqrt{y}\right)
\end{array}
Derivation
  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. Simplified23.3%

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

    \[\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)} \]
  4. Step-by-step derivation
    1. associate--l+23.8%

      \[\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)} \]
    2. +-commutative23.8%

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

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

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

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

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

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

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

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

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

    \[\leadsto 1 + \left(\sqrt{1 + y} - \sqrt{y}\right) \]

Alternative 18: 36.7% accurate, 4.0× speedup?

\[\begin{array}{l} [x, y, z, t] = \mathsf{sort}([x, y, z, t])\\ \\ \sqrt{1 + x} - \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 (+ 1.0 x)) (sqrt x)))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
	return sqrt((1.0 + x)) - 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((1.0d0 + x)) - 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((1.0 + x)) - Math.sqrt(x);
}
[x, y, z, t] = sort([x, y, z, t])
def code(x, y, z, t):
	return math.sqrt((1.0 + x)) - math.sqrt(x)
x, y, z, t = sort([x, y, z, t])
function code(x, y, z, t)
	return Float64(sqrt(Float64(1.0 + x)) - sqrt(x))
end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp = code(x, y, z, t)
	tmp = sqrt((1.0 + x)) - 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[(N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\sqrt{1 + x} - \sqrt{x}
\end{array}
Derivation
  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. Simplified23.3%

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

    \[\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)} \]
  4. Step-by-step derivation
    1. associate--l+23.8%

      \[\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)} \]
    2. +-commutative23.8%

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

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{\sqrt{1 + x} - \sqrt{x}} \]
  10. Final simplification17.5%

    \[\leadsto \sqrt{1 + x} - \sqrt{x} \]

Alternative 19: 36.0% accurate, 7.7× speedup?

\[\begin{array}{l} [x, y, z, t] = \mathsf{sort}([x, y, z, t])\\ \\ \left(1 + x \cdot 0.5\right) - \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 (- (+ 1.0 (* x 0.5)) (sqrt x)))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
	return (1.0 + (x * 0.5)) - 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 = (1.0d0 + (x * 0.5d0)) - sqrt(x)
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
	return (1.0 + (x * 0.5)) - Math.sqrt(x);
}
[x, y, z, t] = sort([x, y, z, t])
def code(x, y, z, t):
	return (1.0 + (x * 0.5)) - math.sqrt(x)
x, y, z, t = sort([x, y, z, t])
function code(x, y, z, t)
	return Float64(Float64(1.0 + Float64(x * 0.5)) - sqrt(x))
end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp = code(x, y, z, t)
	tmp = (1.0 + (x * 0.5)) - 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[(N[(1.0 + N[(x * 0.5), $MachinePrecision]), $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\left(1 + x \cdot 0.5\right) - \sqrt{x}
\end{array}
Derivation
  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. Simplified23.3%

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

    \[\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)} \]
  4. Step-by-step derivation
    1. associate--l+23.8%

      \[\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)} \]
    2. +-commutative23.8%

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

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{\sqrt{1 + x} - \sqrt{x}} \]
  10. Taylor expanded in x around 0 17.6%

    \[\leadsto \color{blue}{\left(1 + 0.5 \cdot x\right)} - \sqrt{x} \]
  11. Step-by-step derivation
    1. *-commutative17.6%

      \[\leadsto \left(1 + \color{blue}{x \cdot 0.5}\right) - \sqrt{x} \]
  12. Simplified17.6%

    \[\leadsto \color{blue}{\left(1 + x \cdot 0.5\right)} - \sqrt{x} \]
  13. Final simplification17.6%

    \[\leadsto \left(1 + x \cdot 0.5\right) - \sqrt{x} \]

Alternative 20: 35.4% accurate, 823.0× speedup?

\[\begin{array}{l} [x, y, z, t] = \mathsf{sort}([x, y, z, t])\\ \\ 1 \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)
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
	return 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
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
	return 1.0;
}
[x, y, z, t] = sort([x, y, z, t])
def code(x, y, z, t):
	return 1.0
x, y, z, t = sort([x, y, z, t])
function code(x, y, z, t)
	return 1.0
end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp = code(x, y, z, t)
	tmp = 1.0;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := 1.0
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
1
\end{array}
Derivation
  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. Simplified23.3%

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

    \[\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)} \]
  4. Step-by-step derivation
    1. associate--l+23.8%

      \[\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)} \]
    2. +-commutative23.8%

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

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{\sqrt{1 + x} - \sqrt{x}} \]
  10. Taylor expanded in x around 0 32.1%

    \[\leadsto \color{blue}{1} \]
  11. Final simplification32.1%

    \[\leadsto 1 \]

Developer target: 99.3% 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 2023336 
(FPCore (x y z t)
  :name "Main:z from "
  :precision binary64

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

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