Main:z from

Percentage Accurate: 91.7% → 99.7%
Time: 45.5s
Alternatives: 17
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 17 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.7% 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.5× speedup?

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

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


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

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

        \[\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. +-commutative88.8%

        \[\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) \]
      3. +-commutative88.8%

        \[\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) \]
      4. +-commutative88.8%

        \[\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. Simplified88.8%

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

        \[\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-sqrt70.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. +-commutative70.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-sqrt89.1%

        \[\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. +-commutative89.1%

        \[\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) \]
    6. Applied egg-rr89.1%

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

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

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

        \[\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) \]
    8. Simplified92.5%

      \[\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) \]
    9. Step-by-step derivation
      1. flip--92.7%

        \[\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-sqrt68.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-sqrt93.0%

        \[\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) \]
    10. Applied egg-rr93.0%

      \[\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) \]
    11. Step-by-step derivation
      1. associate--l+94.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. +-inverses94.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-eval94.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) \]
    12. Simplified94.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) \]
    13. Taylor expanded in t around inf 68.0%

      \[\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)} \]
    14. Step-by-step derivation
      1. flip--68.1%

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

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

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

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

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

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

        \[\leadsto \left(\frac{1}{\sqrt{1 + x} + \sqrt{x}} + \frac{1}{\sqrt{1 + y} + \sqrt{y}}\right) + \frac{\color{blue}{1}}{\sqrt{1 + z} + \sqrt{z}} \]
    17. Simplified69.9%

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

    if 2.99999800000000016 < (+.f64 (+.f64 (+.f64 (-.f64 (sqrt.f64 (+.f64 x 1)) (sqrt.f64 x)) (-.f64 (sqrt.f64 (+.f64 y 1)) (sqrt.f64 y))) (-.f64 (sqrt.f64 (+.f64 z 1)) (sqrt.f64 z))) (-.f64 (sqrt.f64 (+.f64 t 1)) (sqrt.f64 t)))

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\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) \leq 2.999998:\\ \;\;\;\;\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}:\\ \;\;\;\;\sqrt{1 + y} + \left(\left(\sqrt{1 + z} + \left(\left(\sqrt{1 + x} - \sqrt{x}\right) - \sqrt{z}\right)\right) - \left(\sqrt{y} + \frac{-1}{\sqrt{1 + t} + \sqrt{t}}\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 2: 99.3% accurate, 0.6× 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 + t} - \sqrt{t}\\ t_3 := \sqrt{1 + y}\\ t_4 := \sqrt{1 + z}\\ \mathbf{if}\;t\_2 + \left(\left(t\_4 - \sqrt{z}\right) + \left(\left(t\_1 - \sqrt{x}\right) + \left(t\_3 - \sqrt{y}\right)\right)\right) \leq 2.99999:\\ \;\;\;\;\left(\frac{1}{t\_1 + \sqrt{x}} + \frac{1}{t\_3 + \sqrt{y}}\right) + \frac{1}{t\_4 + \sqrt{z}}\\ \mathbf{else}:\\ \;\;\;\;\left(\left(1 + \left(t\_3 + t\_4\right)\right) - \sqrt{z}\right) + \left(t\_2 - \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
 (let* ((t_1 (sqrt (+ 1.0 x)))
        (t_2 (- (sqrt (+ 1.0 t)) (sqrt t)))
        (t_3 (sqrt (+ 1.0 y)))
        (t_4 (sqrt (+ 1.0 z))))
   (if (<=
        (+ t_2 (+ (- t_4 (sqrt z)) (+ (- t_1 (sqrt x)) (- t_3 (sqrt y)))))
        2.99999)
     (+
      (+ (/ 1.0 (+ t_1 (sqrt x))) (/ 1.0 (+ t_3 (sqrt y))))
      (/ 1.0 (+ t_4 (sqrt z))))
     (+ (- (+ 1.0 (+ t_3 t_4)) (sqrt z)) (- t_2 (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 + t)) - sqrt(t);
	double t_3 = sqrt((1.0 + y));
	double t_4 = sqrt((1.0 + z));
	double tmp;
	if ((t_2 + ((t_4 - sqrt(z)) + ((t_1 - sqrt(x)) + (t_3 - sqrt(y))))) <= 2.99999) {
		tmp = ((1.0 / (t_1 + sqrt(x))) + (1.0 / (t_3 + sqrt(y)))) + (1.0 / (t_4 + sqrt(z)));
	} else {
		tmp = ((1.0 + (t_3 + t_4)) - sqrt(z)) + (t_2 - 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 + t)) - sqrt(t)
    t_3 = sqrt((1.0d0 + y))
    t_4 = sqrt((1.0d0 + z))
    if ((t_2 + ((t_4 - sqrt(z)) + ((t_1 - sqrt(x)) + (t_3 - sqrt(y))))) <= 2.99999d0) then
        tmp = ((1.0d0 / (t_1 + sqrt(x))) + (1.0d0 / (t_3 + sqrt(y)))) + (1.0d0 / (t_4 + sqrt(z)))
    else
        tmp = ((1.0d0 + (t_3 + t_4)) - sqrt(z)) + (t_2 - 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 + t)) - Math.sqrt(t);
	double t_3 = Math.sqrt((1.0 + y));
	double t_4 = Math.sqrt((1.0 + z));
	double tmp;
	if ((t_2 + ((t_4 - Math.sqrt(z)) + ((t_1 - Math.sqrt(x)) + (t_3 - Math.sqrt(y))))) <= 2.99999) {
		tmp = ((1.0 / (t_1 + Math.sqrt(x))) + (1.0 / (t_3 + Math.sqrt(y)))) + (1.0 / (t_4 + Math.sqrt(z)));
	} else {
		tmp = ((1.0 + (t_3 + t_4)) - Math.sqrt(z)) + (t_2 - 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 + t)) - math.sqrt(t)
	t_3 = math.sqrt((1.0 + y))
	t_4 = math.sqrt((1.0 + z))
	tmp = 0
	if (t_2 + ((t_4 - math.sqrt(z)) + ((t_1 - math.sqrt(x)) + (t_3 - math.sqrt(y))))) <= 2.99999:
		tmp = ((1.0 / (t_1 + math.sqrt(x))) + (1.0 / (t_3 + math.sqrt(y)))) + (1.0 / (t_4 + math.sqrt(z)))
	else:
		tmp = ((1.0 + (t_3 + t_4)) - math.sqrt(z)) + (t_2 - 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 = Float64(sqrt(Float64(1.0 + t)) - sqrt(t))
	t_3 = sqrt(Float64(1.0 + y))
	t_4 = sqrt(Float64(1.0 + z))
	tmp = 0.0
	if (Float64(t_2 + Float64(Float64(t_4 - sqrt(z)) + Float64(Float64(t_1 - sqrt(x)) + Float64(t_3 - sqrt(y))))) <= 2.99999)
		tmp = Float64(Float64(Float64(1.0 / Float64(t_1 + sqrt(x))) + Float64(1.0 / Float64(t_3 + sqrt(y)))) + Float64(1.0 / Float64(t_4 + sqrt(z))));
	else
		tmp = Float64(Float64(Float64(1.0 + Float64(t_3 + t_4)) - sqrt(z)) + Float64(t_2 - 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 + t)) - sqrt(t);
	t_3 = sqrt((1.0 + y));
	t_4 = sqrt((1.0 + z));
	tmp = 0.0;
	if ((t_2 + ((t_4 - sqrt(z)) + ((t_1 - sqrt(x)) + (t_3 - sqrt(y))))) <= 2.99999)
		tmp = ((1.0 / (t_1 + sqrt(x))) + (1.0 / (t_3 + sqrt(y)))) + (1.0 / (t_4 + sqrt(z)));
	else
		tmp = ((1.0 + (t_3 + t_4)) - sqrt(z)) + (t_2 - 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[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$4 = N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(t$95$2 + N[(N[(t$95$4 - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$1 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(t$95$3 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.99999], 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$4 + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 + N[(t$95$3 + t$95$4), $MachinePrecision]), $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] + N[(t$95$2 - N[Sqrt[y], $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 + t} - \sqrt{t}\\
t_3 := \sqrt{1 + y}\\
t_4 := \sqrt{1 + z}\\
\mathbf{if}\;t\_2 + \left(\left(t\_4 - \sqrt{z}\right) + \left(\left(t\_1 - \sqrt{x}\right) + \left(t\_3 - \sqrt{y}\right)\right)\right) \leq 2.99999:\\
\;\;\;\;\left(\frac{1}{t\_1 + \sqrt{x}} + \frac{1}{t\_3 + \sqrt{y}}\right) + \frac{1}{t\_4 + \sqrt{z}}\\

\mathbf{else}:\\
\;\;\;\;\left(\left(1 + \left(t\_3 + t\_4\right)\right) - \sqrt{z}\right) + \left(t\_2 - \sqrt{y}\right)\\


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

    1. Initial program 88.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+88.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. +-commutative88.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) \]
      3. +-commutative88.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) \]
      4. +-commutative88.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. Simplified88.7%

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

        \[\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-sqrt70.3%

        \[\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. +-commutative70.3%

        \[\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-sqrt88.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. +-commutative88.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) \]
    6. Applied egg-rr88.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) \]
    7. Step-by-step derivation
      1. associate--l+92.5%

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

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

        \[\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) \]
    8. Simplified92.5%

      \[\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) \]
    9. 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-sqrt68.4%

        \[\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.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) \]
    10. Applied egg-rr92.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) \]
    11. Step-by-step derivation
      1. associate--l+94.8%

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

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

        \[\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) \]
    12. Simplified94.8%

      \[\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) \]
    13. Taylor expanded in t around inf 68.5%

      \[\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)} \]
    14. Step-by-step derivation
      1. flip--68.6%

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

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

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

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

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

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

        \[\leadsto \left(\frac{1}{\sqrt{1 + x} + \sqrt{x}} + \frac{1}{\sqrt{1 + y} + \sqrt{y}}\right) + \frac{\color{blue}{1}}{\sqrt{1 + z} + \sqrt{z}} \]
    17. Simplified70.4%

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

    if 2.99998999999999993 < (+.f64 (+.f64 (+.f64 (-.f64 (sqrt.f64 (+.f64 x 1)) (sqrt.f64 x)) (-.f64 (sqrt.f64 (+.f64 y 1)) (sqrt.f64 y))) (-.f64 (sqrt.f64 (+.f64 z 1)) (sqrt.f64 z))) (-.f64 (sqrt.f64 (+.f64 t 1)) (sqrt.f64 t)))

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\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) \leq 2.99999:\\ \;\;\;\;\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(1 + \left(\sqrt{1 + y} + \sqrt{1 + z}\right)\right) - \sqrt{z}\right) + \left(\left(\sqrt{1 + t} - \sqrt{t}\right) - \sqrt{y}\right)\\ \end{array} \]
  5. Add Preprocessing

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

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

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

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

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

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

    \[\leadsto \color{blue}{\left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{1 + y} - \sqrt{y}\right)\right) + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\sqrt{1 + t} - \sqrt{t}\right)\right)} \]
  4. Add Preprocessing
  5. Step-by-step derivation
    1. flip--91.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-sqrt76.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. +-commutative76.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-sqrt91.4%

      \[\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. +-commutative91.4%

      \[\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) \]
  6. Applied egg-rr91.4%

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

      \[\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. +-inverses94.2%

      \[\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-eval94.2%

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

    \[\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) \]
  9. Step-by-step derivation
    1. flip--94.3%

      \[\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-sqrt74.2%

      \[\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-sqrt94.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) \]
  10. Applied egg-rr94.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) \]
  11. Step-by-step derivation
    1. associate--l+95.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. +-inverses95.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-eval95.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) \]
  12. Simplified95.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) \]
  13. Step-by-step derivation
    1. flip--60.2%

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

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

      \[\leadsto \left(\frac{1}{\sqrt{1 + x} + \sqrt{x}} + \frac{1}{\sqrt{1 + y} + \sqrt{y}}\right) + \frac{\left(1 + z\right) - \color{blue}{z}}{\sqrt{1 + z} + \sqrt{z}} \]
  14. Applied egg-rr96.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) \]
  15. Step-by-step derivation
    1. associate--l+61.6%

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

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

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

    \[\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) \]
  17. Final simplification97.5%

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

Alternative 4: 97.9% 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 91.2%

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

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

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

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

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

    \[\leadsto \color{blue}{\left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{1 + y} - \sqrt{y}\right)\right) + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\sqrt{1 + t} - \sqrt{t}\right)\right)} \]
  4. Add Preprocessing
  5. Step-by-step derivation
    1. flip--91.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-sqrt76.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. +-commutative76.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-sqrt91.4%

      \[\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. +-commutative91.4%

      \[\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) \]
  6. Applied egg-rr91.4%

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

      \[\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. +-inverses94.2%

      \[\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-eval94.2%

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

    \[\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) \]
  9. Step-by-step derivation
    1. flip--94.3%

      \[\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-sqrt74.2%

      \[\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-sqrt94.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) \]
  10. Applied egg-rr94.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) \]
  11. Step-by-step derivation
    1. associate--l+95.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. +-inverses95.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-eval95.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) \]
  12. Simplified95.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) \]
  13. Final simplification95.9%

    \[\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) \]
  14. Add Preprocessing

Alternative 5: 97.9% accurate, 1.3× speedup?

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < 1.35e-10

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

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

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

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

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

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

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

    if 1.35e-10 < y

    1. Initial program 84.2%

      \[\left(\left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{y + 1} - \sqrt{y}\right)\right) + \left(\sqrt{z + 1} - \sqrt{z}\right)\right) + \left(\sqrt{t + 1} - \sqrt{t}\right) \]
    2. Step-by-step derivation
      1. associate-+l+84.2%

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

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

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

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

      \[\leadsto \color{blue}{\left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{1 + y} - \sqrt{y}\right)\right) + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\sqrt{1 + t} - \sqrt{t}\right)\right)} \]
    4. Add Preprocessing
    5. 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-sqrt67.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. +-commutative67.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.3%

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

        \[\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) \]
    6. Applied egg-rr84.3%

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

        \[\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. +-inverses89.3%

        \[\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-eval89.3%

        \[\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) \]
    8. Simplified89.3%

      \[\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) \]
    9. Step-by-step derivation
      1. flip--89.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-sqrt49.4%

        \[\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-sqrt90.1%

        \[\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) \]
    10. Applied egg-rr90.1%

      \[\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) \]
    11. Step-by-step derivation
      1. associate--l+92.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. +-inverses92.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-eval92.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) \]
    12. Simplified92.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) \]
    13. Taylor expanded in t around inf 57.1%

      \[\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 simplification59.5%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq 1.35 \cdot 10^{-10}:\\ \;\;\;\;\left(\left(\sqrt{1 + t} - \sqrt{t}\right) + \left(\sqrt{1 + z} - \sqrt{z}\right)\right) + \left(1 + \left(\sqrt{1 + y} - \sqrt{y}\right)\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} \]
  5. Add Preprocessing

Alternative 6: 93.6% accurate, 1.3× speedup?

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

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


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

    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. Step-by-step derivation
      1. +-commutative98.2%

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.85e10 < t

    1. Initial program 85.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+85.6%

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

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

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

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

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

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

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

        \[\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-sqrt85.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. +-commutative85.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) \]
    6. Applied egg-rr85.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) \]
    7. Step-by-step derivation
      1. associate--l+90.3%

        \[\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. +-inverses90.3%

        \[\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-eval90.3%

        \[\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) \]
    8. Simplified90.3%

      \[\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) \]
    9. Step-by-step derivation
      1. flip--90.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-sqrt73.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-sqrt90.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) \]
    10. Applied egg-rr90.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) \]
    11. Step-by-step derivation
      1. associate--l+93.1%

        \[\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. +-inverses93.1%

        \[\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-eval93.1%

        \[\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) \]
    12. Simplified93.1%

      \[\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) \]
    13. Taylor expanded in t around inf 93.0%

      \[\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)} \]
    14. Taylor expanded in y around 0 89.7%

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

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

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

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

Alternative 7: 95.7% accurate, 1.3× speedup?

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

\mathbf{else}:\\
\;\;\;\;t\_1 + \left(\frac{1}{\sqrt{1 + x} + \sqrt{x}} + \frac{1}{\sqrt{y} + \left(1 + y \cdot 0.5\right)}\right)\\


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

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

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

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

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

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

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

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

    if 1e16 < y

    1. Initial program 83.9%

      \[\left(\left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{y + 1} - \sqrt{y}\right)\right) + \left(\sqrt{z + 1} - \sqrt{z}\right)\right) + \left(\sqrt{t + 1} - \sqrt{t}\right) \]
    2. Step-by-step derivation
      1. associate-+l+83.9%

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

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

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

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

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

        \[\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-sqrt68.4%

        \[\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. +-commutative68.4%

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

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

        \[\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) \]
    6. Applied egg-rr84.0%

      \[\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) \]
    7. Step-by-step derivation
      1. associate--l+89.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. +-inverses89.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-eval89.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) \]
    8. Simplified89.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) \]
    9. Step-by-step derivation
      1. flip--89.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-sqrt46.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-sqrt89.4%

        \[\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) \]
    10. Applied egg-rr89.4%

      \[\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) \]
    11. Step-by-step derivation
      1. associate--l+92.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. +-inverses92.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-eval92.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) \]
    12. Simplified92.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) \]
    13. Taylor expanded in t around inf 56.3%

      \[\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)} \]
    14. Taylor expanded in y around 0 53.5%

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

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

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

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

Alternative 8: 95.9% accurate, 1.3× speedup?

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

\mathbf{else}:\\
\;\;\;\;t\_1 + \left(\frac{1}{\sqrt{1 + x} + \sqrt{x}} + t\_2\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < 1.4600000000000001e-30

    1. Initial program 98.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+98.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. +-commutative98.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) \]
      3. +-commutative98.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) \]
      4. +-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) + \left(\sqrt{\color{blue}{1 + t}} - \sqrt{t}\right)\right) \]
    3. Simplified98.5%

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

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

    if 1.4600000000000001e-30 < x

    1. Initial program 84.9%

      \[\left(\left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{y + 1} - \sqrt{y}\right)\right) + \left(\sqrt{z + 1} - \sqrt{z}\right)\right) + \left(\sqrt{t + 1} - \sqrt{t}\right) \]
    2. Step-by-step derivation
      1. associate-+l+84.9%

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

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

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

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

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

        \[\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-sqrt57.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. +-commutative57.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-sqrt85.3%

        \[\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. +-commutative85.3%

        \[\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) \]
    6. Applied egg-rr85.3%

      \[\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) \]
    7. Step-by-step derivation
      1. associate--l+90.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. +-inverses90.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-eval90.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) \]
    8. Simplified90.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) \]
    9. Taylor expanded in t around inf 55.3%

      \[\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 simplification75.2%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq 1.46 \cdot 10^{-30}:\\ \;\;\;\;\left(\left(\sqrt{1 + t} - \sqrt{t}\right) + \left(\sqrt{1 + z} - \sqrt{z}\right)\right) + \left(1 + \left(\sqrt{1 + y} - \sqrt{y}\right)\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} \]
  5. Add Preprocessing

Alternative 9: 90.8% accurate, 1.6× speedup?

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < 9.8000000000000002e-24

    1. Initial program 98.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+98.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. +-commutative98.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) \]
      3. +-commutative98.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) \]
      4. +-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) + \left(\sqrt{\color{blue}{1 + t}} - \sqrt{t}\right)\right) \]
    3. Simplified98.5%

      \[\leadsto \color{blue}{\left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{1 + y} - \sqrt{y}\right)\right) + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\sqrt{1 + t} - \sqrt{t}\right)\right)} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. flip--98.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-sqrt98.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. +-commutative98.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-sqrt98.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. +-commutative98.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) \]
    6. Applied egg-rr98.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) \]
    7. Step-by-step derivation
      1. associate--l+98.5%

        \[\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. +-inverses98.5%

        \[\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-eval98.5%

        \[\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) \]
    8. Simplified98.5%

      \[\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) \]
    9. Step-by-step derivation
      1. flip--98.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-sqrt72.5%

        \[\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-sqrt98.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) \]
    10. Applied egg-rr98.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) \]
    11. Step-by-step derivation
      1. associate--l+98.8%

        \[\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. +-inverses98.8%

        \[\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-eval98.8%

        \[\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) \]
    12. Simplified98.8%

      \[\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) \]
    13. Taylor expanded in t around inf 61.7%

      \[\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)} \]
    14. Taylor expanded in x around 0 61.6%

      \[\leadsto \color{blue}{\left(1 + \frac{1}{\sqrt{y} + \sqrt{1 + y}}\right)} + \left(\sqrt{1 + z} - \sqrt{z}\right) \]
    15. Step-by-step derivation
      1. +-commutative61.6%

        \[\leadsto \left(1 + \frac{1}{\color{blue}{\sqrt{1 + y} + \sqrt{y}}}\right) + \left(\sqrt{1 + z} - \sqrt{z}\right) \]
    16. Simplified61.6%

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

    if 9.8000000000000002e-24 < x

    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. +-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) \]
      3. +-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) \]
      4. +-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. Add Preprocessing
    5. Step-by-step derivation
      1. flip--84.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-sqrt56.0%

        \[\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. +-commutative56.0%

        \[\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.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. +-commutative84.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) \]
    6. Applied egg-rr84.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) \]
    7. Step-by-step derivation
      1. associate--l+90.2%

        \[\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. +-inverses90.2%

        \[\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-eval90.2%

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

      \[\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) \]
    9. Step-by-step derivation
      1. flip--90.2%

        \[\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-sqrt75.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-sqrt90.6%

        \[\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) \]
    10. Applied egg-rr90.6%

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

        \[\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. +-inverses93.3%

        \[\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-eval93.3%

        \[\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) \]
    12. Simplified93.3%

      \[\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) \]
    13. Taylor expanded in t around inf 58.7%

      \[\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)} \]
    14. Taylor expanded in y around 0 54.9%

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

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

Alternative 10: 89.3% 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.1 \cdot 10^{-31}:\\ \;\;\;\;\left(\sqrt{1 + z} - \sqrt{z}\right) + 2\\ \mathbf{elif}\;y \leq 5 \cdot 10^{+15}:\\ \;\;\;\;t\_1 + \left(\sqrt{1 + y} - \left(\sqrt{x} + \sqrt{y}\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.1e-31)
     (+ (- (sqrt (+ 1.0 z)) (sqrt z)) 2.0)
     (if (<= y 5e+15)
       (+ t_1 (- (sqrt (+ 1.0 y)) (+ (sqrt x) (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 <= 2.1e-31) {
		tmp = (sqrt((1.0 + z)) - sqrt(z)) + 2.0;
	} else if (y <= 5e+15) {
		tmp = t_1 + (sqrt((1.0 + y)) - (sqrt(x) + 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 <= 2.1d-31) then
        tmp = (sqrt((1.0d0 + z)) - sqrt(z)) + 2.0d0
    else if (y <= 5d+15) then
        tmp = t_1 + (sqrt((1.0d0 + y)) - (sqrt(x) + 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 <= 2.1e-31) {
		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(x) + 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 <= 2.1e-31:
		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(x) + 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 <= 2.1e-31)
		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(x) + 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 <= 2.1e-31)
		tmp = (sqrt((1.0 + z)) - sqrt(z)) + 2.0;
	elseif (y <= 5e+15)
		tmp = t_1 + (sqrt((1.0 + y)) - (sqrt(x) + 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, 2.1e-31], 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[x], $MachinePrecision] + N[Sqrt[y], $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.1 \cdot 10^{-31}:\\
\;\;\;\;\left(\sqrt{1 + z} - \sqrt{z}\right) + 2\\

\mathbf{elif}\;y \leq 5 \cdot 10^{+15}:\\
\;\;\;\;t\_1 + \left(\sqrt{1 + y} - \left(\sqrt{x} + \sqrt{y}\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.09999999999999991e-31

    1. Initial program 98.0%

      \[\left(\left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{y + 1} - \sqrt{y}\right)\right) + \left(\sqrt{z + 1} - \sqrt{z}\right)\right) + \left(\sqrt{t + 1} - \sqrt{t}\right) \]
    2. Step-by-step derivation
      1. +-commutative98.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.09999999999999991e-31 < y < 5e15

    1. Initial program 94.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. Step-by-step derivation
      1. +-commutative94.8%

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

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

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

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

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

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

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

        \[\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. +-commutative20.0%

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

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

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

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

    if 5e15 < y

    1. Initial program 83.9%

      \[\left(\left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{y + 1} - \sqrt{y}\right)\right) + \left(\sqrt{z + 1} - \sqrt{z}\right)\right) + \left(\sqrt{t + 1} - \sqrt{t}\right) \]
    2. Step-by-step derivation
      1. +-commutative83.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq 2.1 \cdot 10^{-31}:\\ \;\;\;\;\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{x} + \sqrt{y}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sqrt{1 + x} + \sqrt{x}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 11: 90.7% accurate, 2.0× speedup?

\[\begin{array}{l} [x, y, z, t] = \mathsf{sort}([x, y, z, t])\\ \\ \begin{array}{l} \mathbf{if}\;x \leq 9.5 \cdot 10^{-20}:\\ \;\;\;\;\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(1 + \frac{1}{\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 (<= x 9.5e-20)
   (+
    (- (sqrt (+ 1.0 z)) (sqrt z))
    (+ 1.0 (/ 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 (x <= 9.5e-20) {
		tmp = (sqrt((1.0 + z)) - sqrt(z)) + (1.0 + (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 (x <= 9.5d-20) then
        tmp = (sqrt((1.0d0 + z)) - sqrt(z)) + (1.0d0 + (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 (x <= 9.5e-20) {
		tmp = (Math.sqrt((1.0 + z)) - Math.sqrt(z)) + (1.0 + (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 x <= 9.5e-20:
		tmp = (math.sqrt((1.0 + z)) - math.sqrt(z)) + (1.0 + (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 (x <= 9.5e-20)
		tmp = Float64(Float64(sqrt(Float64(1.0 + z)) - sqrt(z)) + Float64(1.0 + 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 (x <= 9.5e-20)
		tmp = (sqrt((1.0 + z)) - sqrt(z)) + (1.0 + (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[x, 9.5e-20], N[(N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] + N[(1.0 + N[(1.0 / N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $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}\;x \leq 9.5 \cdot 10^{-20}:\\
\;\;\;\;\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(1 + \frac{1}{\sqrt{1 + y} + \sqrt{y}}\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < 9.5e-20

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

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

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

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

      \[\leadsto \color{blue}{\left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{1 + y} - \sqrt{y}\right)\right) + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\sqrt{1 + t} - \sqrt{t}\right)\right)} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. flip--98.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-sqrt98.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. +-commutative98.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-sqrt98.6%

        \[\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. +-commutative98.6%

        \[\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) \]
    6. Applied egg-rr98.6%

      \[\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) \]
    7. Step-by-step derivation
      1. associate--l+98.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. +-inverses98.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-eval98.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) \]
    8. Simplified98.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) \]
    9. Step-by-step derivation
      1. flip--98.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-sqrt72.9%

        \[\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-sqrt98.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) \]
    10. Applied egg-rr98.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) \]
    11. Step-by-step derivation
      1. associate--l+98.8%

        \[\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. +-inverses98.8%

        \[\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-eval98.8%

        \[\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) \]
    12. Simplified98.8%

      \[\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) \]
    13. Taylor expanded in t around inf 61.0%

      \[\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)} \]
    14. Taylor expanded in x around 0 60.9%

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

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

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

    if 9.5e-20 < x

    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. +-commutative84.3%

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

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

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

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

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

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

      \[\leadsto \color{blue}{\left(\sqrt{1 + x} + \left(\sqrt{1 + y} + \sqrt{1 + z}\right)\right) - \left(\sqrt{x} + \left(\sqrt{y} + \sqrt{z}\right)\right)} \]
    6. Step-by-step derivation
      1. associate--l+10.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. +-commutative10.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+9.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. +-commutative9.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 12: 89.1% accurate, 3.8× speedup?

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

\mathbf{elif}\;y \leq 10^{+16}:\\
\;\;\;\;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 < 1.39999999999999994e-30

    1. Initial program 98.1%

      \[\left(\left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{y + 1} - \sqrt{y}\right)\right) + \left(\sqrt{z + 1} - \sqrt{z}\right)\right) + \left(\sqrt{t + 1} - \sqrt{t}\right) \]
    2. Step-by-step derivation
      1. +-commutative98.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.39999999999999994e-30 < y < 1e16

    1. Initial program 94.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. +-commutative94.5%

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

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

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

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

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

      \[\leadsto \color{blue}{\sqrt{1 + y} + \left(\left(\sqrt{1 + z} + \left(\left(\sqrt{x + 1} - \sqrt{x}\right) - \sqrt{z}\right)\right) - \left(\sqrt{y} + \left(\sqrt{t} - \sqrt{1 + t}\right)\right)\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in t around inf 15.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)} \]
    6. Step-by-step derivation
      1. associate--l+19.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. +-commutative19.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+19.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. +-commutative19.9%

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

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

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

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

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

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

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

    if 1e16 < y

    1. Initial program 83.9%

      \[\left(\left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{y + 1} - \sqrt{y}\right)\right) + \left(\sqrt{z + 1} - \sqrt{z}\right)\right) + \left(\sqrt{t + 1} - \sqrt{t}\right) \]
    2. Step-by-step derivation
      1. +-commutative83.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 13: 84.1% accurate, 3.9× speedup?

\[\begin{array}{l} [x, y, z, t] = \mathsf{sort}([x, y, z, t])\\ \\ \begin{array}{l} \mathbf{if}\;z \leq 8.2 \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 8.2e+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 <= 8.2e+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 <= 8.2d+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 <= 8.2e+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 <= 8.2e+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 <= 8.2e+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 <= 8.2e+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, 8.2e+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 8.2 \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 < 8.2e14

    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. Step-by-step derivation
      1. +-commutative97.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 8.2e14 < z

    1. Initial program 85.2%

      \[\left(\left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{y + 1} - \sqrt{y}\right)\right) + \left(\sqrt{z + 1} - \sqrt{z}\right)\right) + \left(\sqrt{t + 1} - \sqrt{t}\right) \]
    2. Step-by-step derivation
      1. +-commutative85.2%

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

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

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

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

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

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

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

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

        \[\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. +-commutative14.7%

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

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

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

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

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

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

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

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

Alternative 14: 60.7% 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:\\ \;\;\;\;1 + \sqrt{1 + y}\\ \mathbf{else}:\\ \;\;\;\;\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.0) (+ 1.0 (sqrt (+ 1.0 y))) (- (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.0) {
		tmp = 1.0 + sqrt((1.0 + y));
	} else {
		tmp = 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.0d0) then
        tmp = 1.0d0 + sqrt((1.0d0 + y))
    else
        tmp = 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.0) {
		tmp = 1.0 + Math.sqrt((1.0 + y));
	} else {
		tmp = 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.0:
		tmp = 1.0 + math.sqrt((1.0 + y))
	else:
		tmp = 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.0)
		tmp = Float64(1.0 + sqrt(Float64(1.0 + y)));
	else
		tmp = 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.0)
		tmp = 1.0 + sqrt((1.0 + y));
	else
		tmp = 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.0], N[(1.0 + N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 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])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 2:\\
\;\;\;\;1 + \sqrt{1 + y}\\

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


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

    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. Step-by-step derivation
      1. +-commutative98.2%

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

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

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

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

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

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

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

        \[\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+23.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. +-commutative23.1%

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

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

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

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

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

      \[\leadsto \color{blue}{1 + \sqrt{1 + y}} \]

    if 2 < y

    1. Initial program 83.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. +-commutative83.6%

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

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

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

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

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

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

      \[\leadsto \color{blue}{\left(\sqrt{1 + x} + \left(\sqrt{1 + y} + \sqrt{1 + z}\right)\right) - \left(\sqrt{x} + \left(\sqrt{y} + \sqrt{z}\right)\right)} \]
    6. Step-by-step derivation
      1. associate--l+20.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. +-commutative20.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+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. +-commutative24.8%

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

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

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

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

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

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

Alternative 15: 63.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 91.2%

    \[\left(\left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{y + 1} - \sqrt{y}\right)\right) + \left(\sqrt{z + 1} - \sqrt{z}\right)\right) + \left(\sqrt{t + 1} - \sqrt{t}\right) \]
  2. Step-by-step derivation
    1. +-commutative91.2%

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

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

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

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

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

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

    \[\leadsto \color{blue}{\left(\sqrt{1 + x} + \left(\sqrt{1 + y} + \sqrt{1 + z}\right)\right) - \left(\sqrt{x} + \left(\sqrt{y} + \sqrt{z}\right)\right)} \]
  6. Step-by-step derivation
    1. associate--l+21.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. +-commutative21.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+23.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. +-commutative23.9%

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

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

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

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

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

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

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

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

Alternative 16: 40.9% accurate, 7.8× speedup?

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

    \[\left(\left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{y + 1} - \sqrt{y}\right)\right) + \left(\sqrt{z + 1} - \sqrt{z}\right)\right) + \left(\sqrt{t + 1} - \sqrt{t}\right) \]
  2. Step-by-step derivation
    1. +-commutative91.2%

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

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

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

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

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

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

    \[\leadsto \color{blue}{\left(\sqrt{1 + x} + \left(\sqrt{1 + y} + \sqrt{1 + z}\right)\right) - \left(\sqrt{x} + \left(\sqrt{y} + \sqrt{z}\right)\right)} \]
  6. Step-by-step derivation
    1. associate--l+21.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. +-commutative21.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+23.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. +-commutative23.9%

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

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

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

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

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

    \[\leadsto \color{blue}{1 + \sqrt{1 + y}} \]
  11. Final simplification27.6%

    \[\leadsto 1 + \sqrt{1 + y} \]
  12. Add Preprocessing

Alternative 17: 15.3% accurate, 8.0× speedup?

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

    \[\left(\left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{y + 1} - \sqrt{y}\right)\right) + \left(\sqrt{z + 1} - \sqrt{z}\right)\right) + \left(\sqrt{t + 1} - \sqrt{t}\right) \]
  2. Step-by-step derivation
    1. +-commutative91.2%

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

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

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

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

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

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

    \[\leadsto \color{blue}{\left(\sqrt{1 + x} + \left(\sqrt{1 + y} + \sqrt{1 + z}\right)\right) - \left(\sqrt{x} + \left(\sqrt{y} + \sqrt{z}\right)\right)} \]
  6. Step-by-step derivation
    1. associate--l+21.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. +-commutative21.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+23.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. +-commutative23.9%

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

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

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

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

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

    \[\leadsto \color{blue}{\sqrt{1 + y}} \]
  11. Final simplification15.4%

    \[\leadsto \sqrt{1 + y} \]
  12. Add Preprocessing

Developer target: 99.4% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \left(\left(\frac{1}{\sqrt{x + 1} + \sqrt{x}} + \frac{1}{\sqrt{y + 1} + \sqrt{y}}\right) + \frac{1}{\sqrt{z + 1} + \sqrt{z}}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right) \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (+
  (+
   (+
    (/ 1.0 (+ (sqrt (+ x 1.0)) (sqrt x)))
    (/ 1.0 (+ (sqrt (+ y 1.0)) (sqrt y))))
   (/ 1.0 (+ (sqrt (+ z 1.0)) (sqrt z))))
  (- (sqrt (+ t 1.0)) (sqrt t))))
double code(double x, double y, double z, double t) {
	return (((1.0 / (sqrt((x + 1.0)) + sqrt(x))) + (1.0 / (sqrt((y + 1.0)) + sqrt(y)))) + (1.0 / (sqrt((z + 1.0)) + sqrt(z)))) + (sqrt((t + 1.0)) - sqrt(t));
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    code = (((1.0d0 / (sqrt((x + 1.0d0)) + sqrt(x))) + (1.0d0 / (sqrt((y + 1.0d0)) + sqrt(y)))) + (1.0d0 / (sqrt((z + 1.0d0)) + sqrt(z)))) + (sqrt((t + 1.0d0)) - sqrt(t))
end function
public static double code(double x, double y, double z, double t) {
	return (((1.0 / (Math.sqrt((x + 1.0)) + Math.sqrt(x))) + (1.0 / (Math.sqrt((y + 1.0)) + Math.sqrt(y)))) + (1.0 / (Math.sqrt((z + 1.0)) + Math.sqrt(z)))) + (Math.sqrt((t + 1.0)) - Math.sqrt(t));
}
def code(x, y, z, t):
	return (((1.0 / (math.sqrt((x + 1.0)) + math.sqrt(x))) + (1.0 / (math.sqrt((y + 1.0)) + math.sqrt(y)))) + (1.0 / (math.sqrt((z + 1.0)) + math.sqrt(z)))) + (math.sqrt((t + 1.0)) - math.sqrt(t))
function code(x, y, z, t)
	return Float64(Float64(Float64(Float64(1.0 / Float64(sqrt(Float64(x + 1.0)) + sqrt(x))) + Float64(1.0 / Float64(sqrt(Float64(y + 1.0)) + sqrt(y)))) + Float64(1.0 / Float64(sqrt(Float64(z + 1.0)) + sqrt(z)))) + Float64(sqrt(Float64(t + 1.0)) - sqrt(t)))
end
function tmp = code(x, y, z, t)
	tmp = (((1.0 / (sqrt((x + 1.0)) + sqrt(x))) + (1.0 / (sqrt((y + 1.0)) + sqrt(y)))) + (1.0 / (sqrt((z + 1.0)) + sqrt(z)))) + (sqrt((t + 1.0)) - sqrt(t));
end
code[x_, y_, z_, t_] := N[(N[(N[(N[(1.0 / N[(N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[N[(z + 1.0), $MachinePrecision]], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(t + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\left(\left(\frac{1}{\sqrt{x + 1} + \sqrt{x}} + \frac{1}{\sqrt{y + 1} + \sqrt{y}}\right) + \frac{1}{\sqrt{z + 1} + \sqrt{z}}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)
\end{array}

Reproduce

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