Main:z from

Percentage Accurate: 91.6% → 99.5%
Time: 34.4s
Alternatives: 22
Speedup: 1.6×

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 22 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.6% 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.5% accurate, 0.6× speedup?

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

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


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

    1. Initial program 86.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(\left(1 + y\right) - y, \sqrt{x + 1} + \sqrt{x}, \left(\sqrt{1 + y} + \sqrt{y}\right) \cdot \left(\left(x + 1\right) - x\right)\right)}}{\left(\sqrt{x + 1} + \sqrt{x}\right) \cdot \left(\sqrt{1 + y} + \sqrt{y}\right)} + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\sqrt{1 + t} - \sqrt{t}\right)\right) \]
      5. associate--l+90.0%

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

        \[\leadsto \frac{\mathsf{fma}\left(1 + \left(y - y\right), \color{blue}{\sqrt{x} + \sqrt{x + 1}}, \left(\sqrt{1 + y} + \sqrt{y}\right) \cdot \left(\left(x + 1\right) - x\right)\right)}{\left(\sqrt{x + 1} + \sqrt{x}\right) \cdot \left(\sqrt{1 + y} + \sqrt{y}\right)} + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\sqrt{1 + t} - \sqrt{t}\right)\right) \]
      7. +-commutative90.0%

        \[\leadsto \frac{\mathsf{fma}\left(1 + \left(y - y\right), \sqrt{x} + \sqrt{\color{blue}{1 + x}}, \left(\sqrt{1 + y} + \sqrt{y}\right) \cdot \left(\left(x + 1\right) - x\right)\right)}{\left(\sqrt{x + 1} + \sqrt{x}\right) \cdot \left(\sqrt{1 + y} + \sqrt{y}\right)} + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\sqrt{1 + t} - \sqrt{t}\right)\right) \]
      8. associate--l+90.0%

        \[\leadsto \frac{\mathsf{fma}\left(1 + \left(y - y\right), \sqrt{x} + \sqrt{1 + x}, \left(\sqrt{1 + y} + \sqrt{y}\right) \cdot \color{blue}{\left(x + \left(1 - x\right)\right)}\right)}{\left(\sqrt{x + 1} + \sqrt{x}\right) \cdot \left(\sqrt{1 + y} + \sqrt{y}\right)} + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\sqrt{1 + t} - \sqrt{t}\right)\right) \]
      9. *-commutative90.0%

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

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(1 + \left(y - y\right), \sqrt{x} + \sqrt{1 + x}, \left(\sqrt{1 + y} + \sqrt{y}\right) \cdot \left(x + \left(1 - x\right)\right)\right)}{\left(\sqrt{1 + y} + \sqrt{y}\right) \cdot \left(\sqrt{x} + \sqrt{1 + x}\right)}} + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\sqrt{1 + t} - \sqrt{t}\right)\right) \]
    9. Step-by-step derivation
      1. expm1-log1p-u88.3%

        \[\leadsto \frac{\mathsf{fma}\left(1 + \left(y - y\right), \sqrt{x} + \sqrt{1 + x}, \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\left(\sqrt{1 + y} + \sqrt{y}\right) \cdot \left(x + \left(1 - x\right)\right)\right)\right)}\right)}{\left(\sqrt{1 + y} + \sqrt{y}\right) \cdot \left(\sqrt{x} + \sqrt{1 + x}\right)} + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\sqrt{1 + t} - \sqrt{t}\right)\right) \]
      2. expm1-undefine88.3%

        \[\leadsto \frac{\mathsf{fma}\left(1 + \left(y - y\right), \sqrt{x} + \sqrt{1 + x}, \color{blue}{e^{\mathsf{log1p}\left(\left(\sqrt{1 + y} + \sqrt{y}\right) \cdot \left(x + \left(1 - x\right)\right)\right)} - 1}\right)}{\left(\sqrt{1 + y} + \sqrt{y}\right) \cdot \left(\sqrt{x} + \sqrt{1 + x}\right)} + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\sqrt{1 + t} - \sqrt{t}\right)\right) \]
      3. associate-+r-88.3%

        \[\leadsto \frac{\mathsf{fma}\left(1 + \left(y - y\right), \sqrt{x} + \sqrt{1 + x}, e^{\mathsf{log1p}\left(\left(\sqrt{1 + y} + \sqrt{y}\right) \cdot \color{blue}{\left(\left(x + 1\right) - x\right)}\right)} - 1\right)}{\left(\sqrt{1 + y} + \sqrt{y}\right) \cdot \left(\sqrt{x} + \sqrt{1 + x}\right)} + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\sqrt{1 + t} - \sqrt{t}\right)\right) \]
      4. +-commutative88.3%

        \[\leadsto \frac{\mathsf{fma}\left(1 + \left(y - y\right), \sqrt{x} + \sqrt{1 + x}, e^{\mathsf{log1p}\left(\left(\sqrt{1 + y} + \sqrt{y}\right) \cdot \left(\color{blue}{\left(1 + x\right)} - x\right)\right)} - 1\right)}{\left(\sqrt{1 + y} + \sqrt{y}\right) \cdot \left(\sqrt{x} + \sqrt{1 + x}\right)} + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\sqrt{1 + t} - \sqrt{t}\right)\right) \]
    10. Applied egg-rr88.3%

      \[\leadsto \frac{\mathsf{fma}\left(1 + \left(y - y\right), \sqrt{x} + \sqrt{1 + x}, \color{blue}{e^{\mathsf{log1p}\left(\left(\sqrt{1 + y} + \sqrt{y}\right) \cdot \left(\left(1 + x\right) - x\right)\right)} - 1}\right)}{\left(\sqrt{1 + y} + \sqrt{y}\right) \cdot \left(\sqrt{x} + \sqrt{1 + x}\right)} + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\sqrt{1 + t} - \sqrt{t}\right)\right) \]
    11. Step-by-step derivation
      1. expm1-define88.3%

        \[\leadsto \frac{\mathsf{fma}\left(1 + \left(y - y\right), \sqrt{x} + \sqrt{1 + x}, \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\left(\sqrt{1 + y} + \sqrt{y}\right) \cdot \left(\left(1 + x\right) - x\right)\right)\right)}\right)}{\left(\sqrt{1 + y} + \sqrt{y}\right) \cdot \left(\sqrt{x} + \sqrt{1 + x}\right)} + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\sqrt{1 + t} - \sqrt{t}\right)\right) \]
      2. +-commutative88.3%

        \[\leadsto \frac{\mathsf{fma}\left(1 + \left(y - y\right), \sqrt{x} + \sqrt{1 + x}, \mathsf{expm1}\left(\mathsf{log1p}\left(\color{blue}{\left(\sqrt{y} + \sqrt{1 + y}\right)} \cdot \left(\left(1 + x\right) - x\right)\right)\right)\right)}{\left(\sqrt{1 + y} + \sqrt{y}\right) \cdot \left(\sqrt{x} + \sqrt{1 + x}\right)} + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\sqrt{1 + t} - \sqrt{t}\right)\right) \]
      3. associate--l+90.9%

        \[\leadsto \frac{\mathsf{fma}\left(1 + \left(y - y\right), \sqrt{x} + \sqrt{1 + x}, \mathsf{expm1}\left(\mathsf{log1p}\left(\left(\sqrt{y} + \sqrt{1 + y}\right) \cdot \color{blue}{\left(1 + \left(x - x\right)\right)}\right)\right)\right)}{\left(\sqrt{1 + y} + \sqrt{y}\right) \cdot \left(\sqrt{x} + \sqrt{1 + x}\right)} + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\sqrt{1 + t} - \sqrt{t}\right)\right) \]
    12. Simplified90.9%

      \[\leadsto \frac{\mathsf{fma}\left(1 + \left(y - y\right), \sqrt{x} + \sqrt{1 + x}, \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\left(\sqrt{y} + \sqrt{1 + y}\right) \cdot \left(1 + \left(x - x\right)\right)\right)\right)}\right)}{\left(\sqrt{1 + y} + \sqrt{y}\right) \cdot \left(\sqrt{x} + \sqrt{1 + x}\right)} + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\sqrt{1 + t} - \sqrt{t}\right)\right) \]
    13. Step-by-step derivation
      1. clear-num90.9%

        \[\leadsto \color{blue}{\frac{1}{\frac{\left(\sqrt{1 + y} + \sqrt{y}\right) \cdot \left(\sqrt{x} + \sqrt{1 + x}\right)}{\mathsf{fma}\left(1 + \left(y - y\right), \sqrt{x} + \sqrt{1 + x}, \mathsf{expm1}\left(\mathsf{log1p}\left(\left(\sqrt{y} + \sqrt{1 + y}\right) \cdot \left(1 + \left(x - x\right)\right)\right)\right)\right)}}} + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\sqrt{1 + t} - \sqrt{t}\right)\right) \]
      2. inv-pow90.9%

        \[\leadsto \color{blue}{{\left(\frac{\left(\sqrt{1 + y} + \sqrt{y}\right) \cdot \left(\sqrt{x} + \sqrt{1 + x}\right)}{\mathsf{fma}\left(1 + \left(y - y\right), \sqrt{x} + \sqrt{1 + x}, \mathsf{expm1}\left(\mathsf{log1p}\left(\left(\sqrt{y} + \sqrt{1 + y}\right) \cdot \left(1 + \left(x - x\right)\right)\right)\right)\right)}\right)}^{-1}} + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\sqrt{1 + t} - \sqrt{t}\right)\right) \]
    14. Applied egg-rr92.8%

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

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

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

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

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

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

    1. Initial program 95.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+95.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. sub-neg95.6%

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

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

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

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

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

      \[\leadsto \color{blue}{\left(\left(2 + y \cdot \left(0.5 + -0.125 \cdot y\right)\right) - \left(\sqrt{x} + \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+28.4%

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

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

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

      \[\leadsto \left(2 + \left(y \cdot \left(0.5 + y \cdot -0.125\right) - \color{blue}{\sqrt{y}}\right)\right) + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\sqrt{1 + t} - \sqrt{t}\right)\right) \]
    10. Step-by-step derivation
      1. flip--32.0%

        \[\leadsto \left(2 + \left(y \cdot \left(0.5 + y \cdot -0.125\right) - \sqrt{y}\right)\right) + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \color{blue}{\frac{\sqrt{1 + t} \cdot \sqrt{1 + t} - \sqrt{t} \cdot \sqrt{t}}{\sqrt{1 + t} + \sqrt{t}}}\right) \]
      2. div-inv32.0%

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

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

        \[\leadsto \left(2 + \left(y \cdot \left(0.5 + y \cdot -0.125\right) - \sqrt{y}\right)\right) + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\left(1 + t\right) - \color{blue}{t}\right) \cdot \frac{1}{\sqrt{1 + t} + \sqrt{t}}\right) \]
    11. Applied egg-rr32.0%

      \[\leadsto \left(2 + \left(y \cdot \left(0.5 + y \cdot -0.125\right) - \sqrt{y}\right)\right) + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \color{blue}{\left(\left(1 + t\right) - t\right) \cdot \frac{1}{\sqrt{1 + t} + \sqrt{t}}}\right) \]
    12. Step-by-step derivation
      1. associate-*r/32.0%

        \[\leadsto \left(2 + \left(y \cdot \left(0.5 + y \cdot -0.125\right) - \sqrt{y}\right)\right) + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \color{blue}{\frac{\left(\left(1 + t\right) - t\right) \cdot 1}{\sqrt{1 + t} + \sqrt{t}}}\right) \]
      2. *-rgt-identity32.0%

        \[\leadsto \left(2 + \left(y \cdot \left(0.5 + y \cdot -0.125\right) - \sqrt{y}\right)\right) + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \frac{\color{blue}{\left(1 + t\right) - t}}{\sqrt{1 + t} + \sqrt{t}}\right) \]
      3. associate--l+32.2%

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

        \[\leadsto \left(2 + \left(y \cdot \left(0.5 + y \cdot -0.125\right) - \sqrt{y}\right)\right) + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \frac{1 + \color{blue}{0}}{\sqrt{1 + t} + \sqrt{t}}\right) \]
      5. metadata-eval32.2%

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

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

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

Alternative 2: 98.8% accurate, 0.7× speedup?

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

\mathbf{else}:\\
\;\;\;\;\left(t\_4 + \frac{1}{\sqrt{z} + t\_1}\right) + t\_3\\


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

    1. Initial program 88.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(\left(1 + y\right) - y, \sqrt{x + 1} + \sqrt{x}, \left(\sqrt{1 + y} + \sqrt{y}\right) \cdot \left(\left(x + 1\right) - x\right)\right)}}{\left(\sqrt{x + 1} + \sqrt{x}\right) \cdot \left(\sqrt{1 + y} + \sqrt{y}\right)} + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\sqrt{1 + t} - \sqrt{t}\right)\right) \]
      5. associate--l+92.3%

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

        \[\leadsto \frac{\mathsf{fma}\left(1 + \left(y - y\right), \color{blue}{\sqrt{x} + \sqrt{x + 1}}, \left(\sqrt{1 + y} + \sqrt{y}\right) \cdot \left(\left(x + 1\right) - x\right)\right)}{\left(\sqrt{x + 1} + \sqrt{x}\right) \cdot \left(\sqrt{1 + y} + \sqrt{y}\right)} + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\sqrt{1 + t} - \sqrt{t}\right)\right) \]
      7. +-commutative92.3%

        \[\leadsto \frac{\mathsf{fma}\left(1 + \left(y - y\right), \sqrt{x} + \sqrt{\color{blue}{1 + x}}, \left(\sqrt{1 + y} + \sqrt{y}\right) \cdot \left(\left(x + 1\right) - x\right)\right)}{\left(\sqrt{x + 1} + \sqrt{x}\right) \cdot \left(\sqrt{1 + y} + \sqrt{y}\right)} + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\sqrt{1 + t} - \sqrt{t}\right)\right) \]
      8. associate--l+92.3%

        \[\leadsto \frac{\mathsf{fma}\left(1 + \left(y - y\right), \sqrt{x} + \sqrt{1 + x}, \left(\sqrt{1 + y} + \sqrt{y}\right) \cdot \color{blue}{\left(x + \left(1 - x\right)\right)}\right)}{\left(\sqrt{x + 1} + \sqrt{x}\right) \cdot \left(\sqrt{1 + y} + \sqrt{y}\right)} + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\sqrt{1 + t} - \sqrt{t}\right)\right) \]
      9. *-commutative92.3%

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

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

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

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

    1. Initial program 95.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+95.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. sub-neg95.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 98.8% accurate, 0.7× speedup?

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

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


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

    1. Initial program 88.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(\left(1 + y\right) - y, \sqrt{x + 1} + \sqrt{x}, \left(\sqrt{1 + y} + \sqrt{y}\right) \cdot \left(\left(x + 1\right) - x\right)\right)}}{\left(\sqrt{x + 1} + \sqrt{x}\right) \cdot \left(\sqrt{1 + y} + \sqrt{y}\right)} + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\sqrt{1 + t} - \sqrt{t}\right)\right) \]
      5. associate--l+92.3%

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

        \[\leadsto \frac{\mathsf{fma}\left(1 + \left(y - y\right), \color{blue}{\sqrt{x} + \sqrt{x + 1}}, \left(\sqrt{1 + y} + \sqrt{y}\right) \cdot \left(\left(x + 1\right) - x\right)\right)}{\left(\sqrt{x + 1} + \sqrt{x}\right) \cdot \left(\sqrt{1 + y} + \sqrt{y}\right)} + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\sqrt{1 + t} - \sqrt{t}\right)\right) \]
      7. +-commutative92.3%

        \[\leadsto \frac{\mathsf{fma}\left(1 + \left(y - y\right), \sqrt{x} + \sqrt{\color{blue}{1 + x}}, \left(\sqrt{1 + y} + \sqrt{y}\right) \cdot \left(\left(x + 1\right) - x\right)\right)}{\left(\sqrt{x + 1} + \sqrt{x}\right) \cdot \left(\sqrt{1 + y} + \sqrt{y}\right)} + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\sqrt{1 + t} - \sqrt{t}\right)\right) \]
      8. associate--l+92.3%

        \[\leadsto \frac{\mathsf{fma}\left(1 + \left(y - y\right), \sqrt{x} + \sqrt{1 + x}, \left(\sqrt{1 + y} + \sqrt{y}\right) \cdot \color{blue}{\left(x + \left(1 - x\right)\right)}\right)}{\left(\sqrt{x + 1} + \sqrt{x}\right) \cdot \left(\sqrt{1 + y} + \sqrt{y}\right)} + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\sqrt{1 + t} - \sqrt{t}\right)\right) \]
      9. *-commutative92.3%

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

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

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

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

    1. Initial program 95.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+95.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. sub-neg95.8%

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

        \[\leadsto \left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \color{blue}{\left(\sqrt{y + 1} - \sqrt{y}\right)}\right) + \left(\left(\sqrt{z + 1} - \sqrt{z}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)\right) \]
      4. +-commutative95.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) \]
      5. +-commutative95.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) \]
      6. +-commutative95.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. Simplified95.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. Taylor expanded in x around 0 89.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 99.0% accurate, 0.8× speedup?

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

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


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

    1. Initial program 92.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 6.20000000000000022e24 < z

    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. sub-neg88.7%

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

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

        \[\leadsto \left(\frac{\sqrt{x + 1} \cdot \sqrt{x + 1} - \sqrt{x} \cdot \sqrt{x}}{\sqrt{x + 1} + \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) \]
      3. frac-add88.8%

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(\left(1 + y\right) - y, \sqrt{x + 1} + \sqrt{x}, \left(\sqrt{1 + y} + \sqrt{y}\right) \cdot \left(\left(x + 1\right) - x\right)\right)}}{\left(\sqrt{x + 1} + \sqrt{x}\right) \cdot \left(\sqrt{1 + y} + \sqrt{y}\right)} + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\sqrt{1 + t} - \sqrt{t}\right)\right) \]
      5. associate--l+93.2%

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

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

        \[\leadsto \frac{\mathsf{fma}\left(1 + \left(y - y\right), \sqrt{x} + \sqrt{\color{blue}{1 + x}}, \left(\sqrt{1 + y} + \sqrt{y}\right) \cdot \left(\left(x + 1\right) - x\right)\right)}{\left(\sqrt{x + 1} + \sqrt{x}\right) \cdot \left(\sqrt{1 + y} + \sqrt{y}\right)} + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\sqrt{1 + t} - \sqrt{t}\right)\right) \]
      8. associate--l+93.2%

        \[\leadsto \frac{\mathsf{fma}\left(1 + \left(y - y\right), \sqrt{x} + \sqrt{1 + x}, \left(\sqrt{1 + y} + \sqrt{y}\right) \cdot \color{blue}{\left(x + \left(1 - x\right)\right)}\right)}{\left(\sqrt{x + 1} + \sqrt{x}\right) \cdot \left(\sqrt{1 + y} + \sqrt{y}\right)} + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\sqrt{1 + t} - \sqrt{t}\right)\right) \]
      9. *-commutative93.2%

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

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(1 + \left(y - y\right), \sqrt{x} + \sqrt{1 + x}, \left(\sqrt{1 + y} + \sqrt{y}\right) \cdot \left(x + \left(1 - x\right)\right)\right)}{\left(\sqrt{1 + y} + \sqrt{y}\right) \cdot \left(\sqrt{x} + \sqrt{1 + x}\right)}} + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\sqrt{1 + t} - \sqrt{t}\right)\right) \]
    9. Step-by-step derivation
      1. expm1-log1p-u91.3%

        \[\leadsto \frac{\mathsf{fma}\left(1 + \left(y - y\right), \sqrt{x} + \sqrt{1 + x}, \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\left(\sqrt{1 + y} + \sqrt{y}\right) \cdot \left(x + \left(1 - x\right)\right)\right)\right)}\right)}{\left(\sqrt{1 + y} + \sqrt{y}\right) \cdot \left(\sqrt{x} + \sqrt{1 + x}\right)} + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\sqrt{1 + t} - \sqrt{t}\right)\right) \]
      2. expm1-undefine91.3%

        \[\leadsto \frac{\mathsf{fma}\left(1 + \left(y - y\right), \sqrt{x} + \sqrt{1 + x}, \color{blue}{e^{\mathsf{log1p}\left(\left(\sqrt{1 + y} + \sqrt{y}\right) \cdot \left(x + \left(1 - x\right)\right)\right)} - 1}\right)}{\left(\sqrt{1 + y} + \sqrt{y}\right) \cdot \left(\sqrt{x} + \sqrt{1 + x}\right)} + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\sqrt{1 + t} - \sqrt{t}\right)\right) \]
      3. associate-+r-91.3%

        \[\leadsto \frac{\mathsf{fma}\left(1 + \left(y - y\right), \sqrt{x} + \sqrt{1 + x}, e^{\mathsf{log1p}\left(\left(\sqrt{1 + y} + \sqrt{y}\right) \cdot \color{blue}{\left(\left(x + 1\right) - x\right)}\right)} - 1\right)}{\left(\sqrt{1 + y} + \sqrt{y}\right) \cdot \left(\sqrt{x} + \sqrt{1 + x}\right)} + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\sqrt{1 + t} - \sqrt{t}\right)\right) \]
      4. +-commutative91.3%

        \[\leadsto \frac{\mathsf{fma}\left(1 + \left(y - y\right), \sqrt{x} + \sqrt{1 + x}, e^{\mathsf{log1p}\left(\left(\sqrt{1 + y} + \sqrt{y}\right) \cdot \left(\color{blue}{\left(1 + x\right)} - x\right)\right)} - 1\right)}{\left(\sqrt{1 + y} + \sqrt{y}\right) \cdot \left(\sqrt{x} + \sqrt{1 + x}\right)} + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\sqrt{1 + t} - \sqrt{t}\right)\right) \]
    10. Applied egg-rr91.3%

      \[\leadsto \frac{\mathsf{fma}\left(1 + \left(y - y\right), \sqrt{x} + \sqrt{1 + x}, \color{blue}{e^{\mathsf{log1p}\left(\left(\sqrt{1 + y} + \sqrt{y}\right) \cdot \left(\left(1 + x\right) - x\right)\right)} - 1}\right)}{\left(\sqrt{1 + y} + \sqrt{y}\right) \cdot \left(\sqrt{x} + \sqrt{1 + x}\right)} + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\sqrt{1 + t} - \sqrt{t}\right)\right) \]
    11. Step-by-step derivation
      1. expm1-define91.3%

        \[\leadsto \frac{\mathsf{fma}\left(1 + \left(y - y\right), \sqrt{x} + \sqrt{1 + x}, \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\left(\sqrt{1 + y} + \sqrt{y}\right) \cdot \left(\left(1 + x\right) - x\right)\right)\right)}\right)}{\left(\sqrt{1 + y} + \sqrt{y}\right) \cdot \left(\sqrt{x} + \sqrt{1 + x}\right)} + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\sqrt{1 + t} - \sqrt{t}\right)\right) \]
      2. +-commutative91.3%

        \[\leadsto \frac{\mathsf{fma}\left(1 + \left(y - y\right), \sqrt{x} + \sqrt{1 + x}, \mathsf{expm1}\left(\mathsf{log1p}\left(\color{blue}{\left(\sqrt{y} + \sqrt{1 + y}\right)} \cdot \left(\left(1 + x\right) - x\right)\right)\right)\right)}{\left(\sqrt{1 + y} + \sqrt{y}\right) \cdot \left(\sqrt{x} + \sqrt{1 + x}\right)} + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\sqrt{1 + t} - \sqrt{t}\right)\right) \]
      3. associate--l+94.1%

        \[\leadsto \frac{\mathsf{fma}\left(1 + \left(y - y\right), \sqrt{x} + \sqrt{1 + x}, \mathsf{expm1}\left(\mathsf{log1p}\left(\left(\sqrt{y} + \sqrt{1 + y}\right) \cdot \color{blue}{\left(1 + \left(x - x\right)\right)}\right)\right)\right)}{\left(\sqrt{1 + y} + \sqrt{y}\right) \cdot \left(\sqrt{x} + \sqrt{1 + x}\right)} + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\sqrt{1 + t} - \sqrt{t}\right)\right) \]
    12. Simplified94.1%

      \[\leadsto \frac{\mathsf{fma}\left(1 + \left(y - y\right), \sqrt{x} + \sqrt{1 + x}, \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\left(\sqrt{y} + \sqrt{1 + y}\right) \cdot \left(1 + \left(x - x\right)\right)\right)\right)}\right)}{\left(\sqrt{1 + y} + \sqrt{y}\right) \cdot \left(\sqrt{x} + \sqrt{1 + x}\right)} + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\sqrt{1 + t} - \sqrt{t}\right)\right) \]
    13. Step-by-step derivation
      1. clear-num94.1%

        \[\leadsto \color{blue}{\frac{1}{\frac{\left(\sqrt{1 + y} + \sqrt{y}\right) \cdot \left(\sqrt{x} + \sqrt{1 + x}\right)}{\mathsf{fma}\left(1 + \left(y - y\right), \sqrt{x} + \sqrt{1 + x}, \mathsf{expm1}\left(\mathsf{log1p}\left(\left(\sqrt{y} + \sqrt{1 + y}\right) \cdot \left(1 + \left(x - x\right)\right)\right)\right)\right)}}} + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\sqrt{1 + t} - \sqrt{t}\right)\right) \]
      2. inv-pow94.1%

        \[\leadsto \color{blue}{{\left(\frac{\left(\sqrt{1 + y} + \sqrt{y}\right) \cdot \left(\sqrt{x} + \sqrt{1 + x}\right)}{\mathsf{fma}\left(1 + \left(y - y\right), \sqrt{x} + \sqrt{1 + x}, \mathsf{expm1}\left(\mathsf{log1p}\left(\left(\sqrt{y} + \sqrt{1 + y}\right) \cdot \left(1 + \left(x - x\right)\right)\right)\right)\right)}\right)}^{-1}} + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\sqrt{1 + t} - \sqrt{t}\right)\right) \]
    14. Applied egg-rr96.2%

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

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

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

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

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

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

Alternative 5: 97.1% accurate, 1.1× speedup?

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

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


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

    1. Initial program 95.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+95.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. sub-neg95.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 6.2e15 < y

    1. Initial program 85.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+85.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. sub-neg85.5%

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

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

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

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

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

      \[\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.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)} \]
    7. Simplified19.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)} \]
    8. Taylor expanded in x around inf 18.9%

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

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

      \[\leadsto \sqrt{1 + x} + \color{blue}{\left(-\sqrt{x}\right)} \]
    11. Step-by-step derivation
      1. flip-+18.9%

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

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

        \[\leadsto \frac{\left(1 + x\right) - \color{blue}{{\left(-\sqrt{x}\right)}^{2}}}{\sqrt{1 + x} - \left(-\sqrt{x}\right)} \]
    12. Applied egg-rr19.5%

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

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

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

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

        \[\leadsto \frac{1 + \left(x - \color{blue}{x}\right)}{\sqrt{1 + x} - \left(-\sqrt{x}\right)} \]
      5. sub-neg23.5%

        \[\leadsto \frac{1 + \left(x - x\right)}{\color{blue}{\sqrt{1 + x} + \left(-\left(-\sqrt{x}\right)\right)}} \]
      6. remove-double-neg23.5%

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

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

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

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

Alternative 6: 96.4% accurate, 1.1× speedup?

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

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


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

    1. Initial program 95.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+95.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. sub-neg95.7%

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

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

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

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

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

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

        \[\leadsto \left(2 + \left(y \cdot \left(0.5 + y \cdot -0.125\right) - \sqrt{y}\right)\right) + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \color{blue}{\frac{\sqrt{1 + t} \cdot \sqrt{1 + t} - \sqrt{t} \cdot \sqrt{t}}{\sqrt{1 + t} + \sqrt{t}}}\right) \]
      2. div-inv57.9%

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

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

        \[\leadsto \left(2 + \left(y \cdot \left(0.5 + y \cdot -0.125\right) - \sqrt{y}\right)\right) + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\left(1 + t\right) - \color{blue}{t}\right) \cdot \frac{1}{\sqrt{1 + t} + \sqrt{t}}\right) \]
    7. Applied egg-rr52.4%

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

        \[\leadsto \left(2 + \left(y \cdot \left(0.5 + y \cdot -0.125\right) - \sqrt{y}\right)\right) + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \color{blue}{\frac{\left(\left(1 + t\right) - t\right) \cdot 1}{\sqrt{1 + t} + \sqrt{t}}}\right) \]
      2. *-rgt-identity58.4%

        \[\leadsto \left(2 + \left(y \cdot \left(0.5 + y \cdot -0.125\right) - \sqrt{y}\right)\right) + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \frac{\color{blue}{\left(1 + t\right) - t}}{\sqrt{1 + t} + \sqrt{t}}\right) \]
      3. associate--l+58.6%

        \[\leadsto \left(2 + \left(y \cdot \left(0.5 + y \cdot -0.125\right) - \sqrt{y}\right)\right) + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \frac{\color{blue}{1 + \left(t - t\right)}}{\sqrt{1 + t} + \sqrt{t}}\right) \]
      4. +-inverses58.6%

        \[\leadsto \left(2 + \left(y \cdot \left(0.5 + y \cdot -0.125\right) - \sqrt{y}\right)\right) + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \frac{1 + \color{blue}{0}}{\sqrt{1 + t} + \sqrt{t}}\right) \]
      5. metadata-eval58.6%

        \[\leadsto \left(2 + \left(y \cdot \left(0.5 + y \cdot -0.125\right) - \sqrt{y}\right)\right) + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \frac{\color{blue}{1}}{\sqrt{1 + t} + \sqrt{t}}\right) \]
    9. Simplified52.6%

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

    if 6.2e15 < y

    1. Initial program 85.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+85.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. sub-neg85.5%

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

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

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

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

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

      \[\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.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)} \]
    7. Simplified19.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)} \]
    8. Taylor expanded in x around inf 18.9%

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

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

      \[\leadsto \sqrt{1 + x} + \color{blue}{\left(-\sqrt{x}\right)} \]
    11. Step-by-step derivation
      1. flip-+18.9%

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

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

        \[\leadsto \frac{\left(1 + x\right) - \color{blue}{{\left(-\sqrt{x}\right)}^{2}}}{\sqrt{1 + x} - \left(-\sqrt{x}\right)} \]
    12. Applied egg-rr19.5%

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

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

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

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

        \[\leadsto \frac{1 + \left(x - \color{blue}{x}\right)}{\sqrt{1 + x} - \left(-\sqrt{x}\right)} \]
      5. sub-neg23.5%

        \[\leadsto \frac{1 + \left(x - x\right)}{\color{blue}{\sqrt{1 + x} + \left(-\left(-\sqrt{x}\right)\right)}} \]
      6. remove-double-neg23.5%

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

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

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

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

Alternative 7: 95.9% accurate, 1.1× speedup?

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

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


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

    1. Initial program 95.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+95.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. sub-neg95.7%

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

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

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

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

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

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

    if 6.2e15 < y

    1. Initial program 85.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+85.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. sub-neg85.5%

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

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

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

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

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

      \[\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.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)} \]
    7. Simplified19.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)} \]
    8. Taylor expanded in x around inf 18.9%

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

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

      \[\leadsto \sqrt{1 + x} + \color{blue}{\left(-\sqrt{x}\right)} \]
    11. Step-by-step derivation
      1. flip-+18.9%

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

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

        \[\leadsto \frac{\left(1 + x\right) - \color{blue}{{\left(-\sqrt{x}\right)}^{2}}}{\sqrt{1 + x} - \left(-\sqrt{x}\right)} \]
    12. Applied egg-rr19.5%

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

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

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

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

        \[\leadsto \frac{1 + \left(x - \color{blue}{x}\right)}{\sqrt{1 + x} - \left(-\sqrt{x}\right)} \]
      5. sub-neg23.5%

        \[\leadsto \frac{1 + \left(x - x\right)}{\color{blue}{\sqrt{1 + x} + \left(-\left(-\sqrt{x}\right)\right)}} \]
      6. remove-double-neg23.5%

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

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

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

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

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

\mathbf{elif}\;y \leq 4.5 \cdot 10^{+15}:\\
\;\;\;\;t\_1 + \left(\left(\sqrt{1 + y} + 0.5 \cdot \sqrt{\frac{1}{z}}\right) - \left(\sqrt{x} + \sqrt{y}\right)\right)\\

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


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

    1. Initial program 95.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+95.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. sub-neg95.7%

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

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

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

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

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

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

      \[\leadsto \color{blue}{\left(\left(2 + y \cdot \left(0.5 + -0.125 \cdot y\right)\right) - \left(\sqrt{x} + \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+51.2%

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

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

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

      \[\leadsto \left(2 + \left(y \cdot \left(0.5 + y \cdot -0.125\right) - \color{blue}{\sqrt{y}}\right)\right) + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\sqrt{1 + t} - \sqrt{t}\right)\right) \]
    10. Step-by-step derivation
      1. flip--59.5%

        \[\leadsto \left(2 + \left(y \cdot \left(0.5 + y \cdot -0.125\right) - \sqrt{y}\right)\right) + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \color{blue}{\frac{\sqrt{1 + t} \cdot \sqrt{1 + t} - \sqrt{t} \cdot \sqrt{t}}{\sqrt{1 + t} + \sqrt{t}}}\right) \]
      2. div-inv59.5%

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

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

        \[\leadsto \left(2 + \left(y \cdot \left(0.5 + y \cdot -0.125\right) - \sqrt{y}\right)\right) + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\left(1 + t\right) - \color{blue}{t}\right) \cdot \frac{1}{\sqrt{1 + t} + \sqrt{t}}\right) \]
    11. Applied egg-rr60.0%

      \[\leadsto \left(2 + \left(y \cdot \left(0.5 + y \cdot -0.125\right) - \sqrt{y}\right)\right) + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \color{blue}{\left(\left(1 + t\right) - t\right) \cdot \frac{1}{\sqrt{1 + t} + \sqrt{t}}}\right) \]
    12. Step-by-step derivation
      1. associate-*r/60.0%

        \[\leadsto \left(2 + \left(y \cdot \left(0.5 + y \cdot -0.125\right) - \sqrt{y}\right)\right) + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \color{blue}{\frac{\left(\left(1 + t\right) - t\right) \cdot 1}{\sqrt{1 + t} + \sqrt{t}}}\right) \]
      2. *-rgt-identity60.0%

        \[\leadsto \left(2 + \left(y \cdot \left(0.5 + y \cdot -0.125\right) - \sqrt{y}\right)\right) + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \frac{\color{blue}{\left(1 + t\right) - t}}{\sqrt{1 + t} + \sqrt{t}}\right) \]
      3. associate--l+60.2%

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

        \[\leadsto \left(2 + \left(y \cdot \left(0.5 + y \cdot -0.125\right) - \sqrt{y}\right)\right) + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \frac{1 + \color{blue}{0}}{\sqrt{1 + t} + \sqrt{t}}\right) \]
      5. metadata-eval60.2%

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

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

    if 3.5999999999999998e-13 < y < 4.5e15

    1. Initial program 95.4%

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

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

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

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

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

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

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

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

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

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

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

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

    if 4.5e15 < y

    1. Initial program 85.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+85.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. sub-neg85.5%

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

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

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

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

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

      \[\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.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)} \]
    7. Simplified19.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)} \]
    8. Taylor expanded in x around inf 18.9%

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

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

      \[\leadsto \sqrt{1 + x} + \color{blue}{\left(-\sqrt{x}\right)} \]
    11. Step-by-step derivation
      1. flip-+18.9%

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

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

        \[\leadsto \frac{\left(1 + x\right) - \color{blue}{{\left(-\sqrt{x}\right)}^{2}}}{\sqrt{1 + x} - \left(-\sqrt{x}\right)} \]
    12. Applied egg-rr19.5%

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

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

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

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

        \[\leadsto \frac{1 + \left(x - \color{blue}{x}\right)}{\sqrt{1 + x} - \left(-\sqrt{x}\right)} \]
      5. sub-neg23.5%

        \[\leadsto \frac{1 + \left(x - x\right)}{\color{blue}{\sqrt{1 + x} + \left(-\left(-\sqrt{x}\right)\right)}} \]
      6. remove-double-neg23.5%

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

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

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

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

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

\mathbf{elif}\;y \leq 2.5 \cdot 10^{+15}:\\
\;\;\;\;t\_1 + \left(\left(\sqrt{1 + y} + 0.5 \cdot \sqrt{\frac{1}{z}}\right) - \left(\sqrt{x} + \sqrt{y}\right)\right)\\

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


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

    1. Initial program 95.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+95.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. sub-neg95.7%

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

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

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

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

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

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

      \[\leadsto \color{blue}{\left(\left(2 + y \cdot \left(0.5 + -0.125 \cdot y\right)\right) - \left(\sqrt{x} + \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+51.2%

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

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

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

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

    if 2.6e-13 < y < 2.5e15

    1. Initial program 95.4%

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.5e15 < y

    1. Initial program 85.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+85.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. sub-neg85.5%

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

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

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

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

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

      \[\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.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)} \]
    7. Simplified19.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)} \]
    8. Taylor expanded in x around inf 18.9%

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

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

      \[\leadsto \sqrt{1 + x} + \color{blue}{\left(-\sqrt{x}\right)} \]
    11. Step-by-step derivation
      1. flip-+18.9%

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

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

        \[\leadsto \frac{\left(1 + x\right) - \color{blue}{{\left(-\sqrt{x}\right)}^{2}}}{\sqrt{1 + x} - \left(-\sqrt{x}\right)} \]
    12. Applied egg-rr19.5%

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

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

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

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

        \[\leadsto \frac{1 + \left(x - \color{blue}{x}\right)}{\sqrt{1 + x} - \left(-\sqrt{x}\right)} \]
      5. sub-neg23.5%

        \[\leadsto \frac{1 + \left(x - x\right)}{\color{blue}{\sqrt{1 + x} + \left(-\left(-\sqrt{x}\right)\right)}} \]
      6. remove-double-neg23.5%

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

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

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

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

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

\mathbf{elif}\;y \leq 2.3 \cdot 10^{+15}:\\
\;\;\;\;t\_1 + \left(\left(\sqrt{1 + y} + 0.5 \cdot \sqrt{\frac{1}{z}}\right) - \left(\sqrt{x} + \sqrt{y}\right)\right)\\

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


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

    1. Initial program 95.4%

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(1 + \left(y \cdot 0.5 - \sqrt{y}\right)\right)\right) + \color{blue}{\left(\sqrt{1 + z} - \sqrt{z}\right)} \]
    9. Step-by-step derivation
      1. flip--51.2%

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

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

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

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

      \[\leadsto \left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(1 + \left(y \cdot 0.5 - \sqrt{y}\right)\right)\right) + \color{blue}{\left(\left(1 + z\right) - z\right) \cdot \frac{1}{\sqrt{1 + z} + \sqrt{z}}} \]
    11. Step-by-step derivation
      1. associate-*r/51.2%

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

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

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

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

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

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

    if 1.19999999999999996e-29 < y < 2.3e15

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

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

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

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

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

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

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

    if 2.3e15 < y

    1. Initial program 85.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+85.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. sub-neg85.5%

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

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

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

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

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

      \[\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.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)} \]
    7. Simplified19.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)} \]
    8. Taylor expanded in x around inf 18.9%

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

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

      \[\leadsto \sqrt{1 + x} + \color{blue}{\left(-\sqrt{x}\right)} \]
    11. Step-by-step derivation
      1. flip-+18.9%

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

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

        \[\leadsto \frac{\left(1 + x\right) - \color{blue}{{\left(-\sqrt{x}\right)}^{2}}}{\sqrt{1 + x} - \left(-\sqrt{x}\right)} \]
    12. Applied egg-rr19.5%

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

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

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

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

        \[\leadsto \frac{1 + \left(x - \color{blue}{x}\right)}{\sqrt{1 + x} - \left(-\sqrt{x}\right)} \]
      5. sub-neg23.5%

        \[\leadsto \frac{1 + \left(x - x\right)}{\color{blue}{\sqrt{1 + x} + \left(-\left(-\sqrt{x}\right)\right)}} \]
      6. remove-double-neg23.5%

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

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

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

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

Alternative 11: 90.5% accurate, 1.6× speedup?

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

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


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

    1. Initial program 95.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+95.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. sub-neg95.7%

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

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

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

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

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

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

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

    if 5.8e15 < y

    1. Initial program 85.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+85.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. sub-neg85.5%

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

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

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

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

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

      \[\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.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)} \]
    7. Simplified19.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)} \]
    8. Taylor expanded in x around inf 18.9%

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

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

      \[\leadsto \sqrt{1 + x} + \color{blue}{\left(-\sqrt{x}\right)} \]
    11. Step-by-step derivation
      1. flip-+18.9%

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

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

        \[\leadsto \frac{\left(1 + x\right) - \color{blue}{{\left(-\sqrt{x}\right)}^{2}}}{\sqrt{1 + x} - \left(-\sqrt{x}\right)} \]
    12. Applied egg-rr19.5%

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

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

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

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

        \[\leadsto \frac{1 + \left(x - \color{blue}{x}\right)}{\sqrt{1 + x} - \left(-\sqrt{x}\right)} \]
      5. sub-neg23.5%

        \[\leadsto \frac{1 + \left(x - x\right)}{\color{blue}{\sqrt{1 + x} + \left(-\left(-\sqrt{x}\right)\right)}} \]
      6. remove-double-neg23.5%

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

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

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

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

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

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

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


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

    1. Initial program 95.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+95.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. sub-neg95.7%

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

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

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

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

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

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

      \[\leadsto \color{blue}{\left(\left(2 + y \cdot \left(0.5 + -0.125 \cdot y\right)\right) - \left(\sqrt{x} + \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+51.2%

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

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

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

      \[\leadsto \left(2 + \left(y \cdot \left(0.5 + y \cdot -0.125\right) - \color{blue}{\sqrt{y}}\right)\right) + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\sqrt{1 + t} - \sqrt{t}\right)\right) \]
    10. Taylor expanded in t around inf 42.1%

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

    if 1.04999999999999994e-13 < y < 5.8e15

    1. Initial program 95.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 5.8e15 < y

    1. Initial program 85.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+85.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. sub-neg85.5%

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

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

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

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

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

      \[\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.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)} \]
    7. Simplified19.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)} \]
    8. Taylor expanded in x around inf 18.9%

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

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

      \[\leadsto \sqrt{1 + x} + \color{blue}{\left(-\sqrt{x}\right)} \]
    11. Step-by-step derivation
      1. flip-+18.9%

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

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

        \[\leadsto \frac{\left(1 + x\right) - \color{blue}{{\left(-\sqrt{x}\right)}^{2}}}{\sqrt{1 + x} - \left(-\sqrt{x}\right)} \]
    12. Applied egg-rr19.5%

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

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

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

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

        \[\leadsto \frac{1 + \left(x - \color{blue}{x}\right)}{\sqrt{1 + x} - \left(-\sqrt{x}\right)} \]
      5. sub-neg23.5%

        \[\leadsto \frac{1 + \left(x - x\right)}{\color{blue}{\sqrt{1 + x} + \left(-\left(-\sqrt{x}\right)\right)}} \]
      6. remove-double-neg23.5%

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

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

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

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

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

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

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


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

    1. Initial program 95.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+95.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. sub-neg95.7%

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

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

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

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

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

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

      \[\leadsto \color{blue}{\left(\left(2 + y \cdot \left(0.5 + -0.125 \cdot y\right)\right) - \left(\sqrt{x} + \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+51.2%

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

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

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

      \[\leadsto \left(2 + \left(y \cdot \left(0.5 + y \cdot -0.125\right) - \color{blue}{\sqrt{y}}\right)\right) + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\sqrt{1 + t} - \sqrt{t}\right)\right) \]
    10. Taylor expanded in t around inf 65.9%

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

    if 2.8000000000000002e-13 < y < 4.5e15

    1. Initial program 95.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 4.5e15 < y

    1. Initial program 85.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+85.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. sub-neg85.5%

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

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

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

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

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

      \[\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.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)} \]
    7. Simplified19.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)} \]
    8. Taylor expanded in x around inf 18.9%

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

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

      \[\leadsto \sqrt{1 + x} + \color{blue}{\left(-\sqrt{x}\right)} \]
    11. Step-by-step derivation
      1. flip-+18.9%

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

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

        \[\leadsto \frac{\left(1 + x\right) - \color{blue}{{\left(-\sqrt{x}\right)}^{2}}}{\sqrt{1 + x} - \left(-\sqrt{x}\right)} \]
    12. Applied egg-rr19.5%

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

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

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

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

        \[\leadsto \frac{1 + \left(x - \color{blue}{x}\right)}{\sqrt{1 + x} - \left(-\sqrt{x}\right)} \]
      5. sub-neg23.5%

        \[\leadsto \frac{1 + \left(x - x\right)}{\color{blue}{\sqrt{1 + x} + \left(-\left(-\sqrt{x}\right)\right)}} \]
      6. remove-double-neg23.5%

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

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

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

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

Alternative 14: 88.6% accurate, 2.6× speedup?

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

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


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

    1. Initial program 95.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+95.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. sub-neg95.9%

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

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

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

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

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

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

      \[\leadsto \color{blue}{\left(\left(2 + y \cdot \left(0.5 + -0.125 \cdot y\right)\right) - \left(\sqrt{x} + \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+50.6%

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

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

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

      \[\leadsto \left(2 + \left(y \cdot \left(0.5 + y \cdot -0.125\right) - \color{blue}{\sqrt{y}}\right)\right) + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\sqrt{1 + t} - \sqrt{t}\right)\right) \]
    10. Taylor expanded in t around inf 64.3%

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

    if 2.60000000000000009 < y

    1. Initial program 85.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+85.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. sub-neg85.5%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \sqrt{1 + x} + \color{blue}{\left(-\sqrt{x}\right)} \]
    11. Step-by-step derivation
      1. flip-+18.8%

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

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

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

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

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

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

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

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

        \[\leadsto \frac{1 + \left(x - x\right)}{\color{blue}{\sqrt{1 + x} + \left(-\left(-\sqrt{x}\right)\right)}} \]
      6. remove-double-neg23.3%

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

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

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

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

Alternative 15: 40.6% accurate, 3.9× speedup?

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \sqrt{1 + x} + \color{blue}{\left(-\sqrt{x}\right)} \]
  11. Step-by-step derivation
    1. flip-+15.2%

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

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

      \[\leadsto \frac{\left(1 + x\right) - \color{blue}{{\left(-\sqrt{x}\right)}^{2}}}{\sqrt{1 + x} - \left(-\sqrt{x}\right)} \]
  12. Applied egg-rr15.8%

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

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

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

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

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

      \[\leadsto \frac{1 + \left(x - x\right)}{\color{blue}{\sqrt{1 + x} + \left(-\left(-\sqrt{x}\right)\right)}} \]
    6. remove-double-neg18.3%

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

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

    \[\leadsto \color{blue}{\frac{1 + \left(x - x\right)}{\sqrt{x} + \sqrt{1 + x}}} \]
  15. Add Preprocessing

Alternative 16: 40.4% accurate, 3.9× speedup?

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

\mathbf{else}:\\
\;\;\;\;0.5 \cdot \sqrt{\frac{1}{x}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < 1.05e8

    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. associate-+l+97.0%

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

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

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

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

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

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

      \[\leadsto \color{blue}{\left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{1 + y} - \sqrt{y}\right)\right) + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\sqrt{1 + t} - \sqrt{t}\right)\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in t around inf 19.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+38.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)} \]
    7. Simplified38.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)} \]
    8. Taylor expanded in x around inf 26.8%

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

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

      \[\leadsto \sqrt{1 + x} + \color{blue}{\left(-\sqrt{x}\right)} \]
    11. Step-by-step derivation
      1. unsub-neg26.8%

        \[\leadsto \color{blue}{\sqrt{1 + x} - \sqrt{x}} \]
    12. Applied egg-rr26.8%

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

    if 1.05e8 < x

    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. sub-neg84.2%

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

        \[\leadsto \left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \color{blue}{\left(\sqrt{y + 1} - \sqrt{y}\right)}\right) + \left(\left(\sqrt{z + 1} - \sqrt{z}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)\right) \]
      4. +-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) \]
      5. +-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) \]
      6. +-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. Taylor expanded in t around inf 4.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+6.0%

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

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

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

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

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

      \[\leadsto \color{blue}{0.5 \cdot \sqrt{\frac{1}{x}}} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 17: 40.2% accurate, 6.9× speedup?

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

\mathbf{else}:\\
\;\;\;\;0.5 \cdot \sqrt{\frac{1}{x}}\\


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

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

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

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

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

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

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

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

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

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

    if 1.32000000000000006 < x

    1. Initial program 84.1%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{1 + y} - \sqrt{y}\right)\right) + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\sqrt{1 + t} - \sqrt{t}\right)\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in t around inf 4.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+6.7%

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

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

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

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

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

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

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

Alternative 18: 40.2% accurate, 7.1× speedup?

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

\mathbf{else}:\\
\;\;\;\;0.5 \cdot \sqrt{\frac{1}{x}}\\


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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{1 + \left(x \cdot \left(0.5 + -0.125 \cdot x\right) - \sqrt{x}\right)} \]
      2. *-commutative26.9%

        \[\leadsto 1 + \left(x \cdot \left(0.5 + \color{blue}{x \cdot -0.125}\right) - \sqrt{x}\right) \]
    13. Simplified26.9%

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

    if 0.73999999999999999 < x

    1. Initial program 84.1%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{1 + y} - \sqrt{y}\right)\right) + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\sqrt{1 + t} - \sqrt{t}\right)\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in t around inf 4.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+6.7%

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

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

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

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

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

      \[\leadsto \color{blue}{0.5 \cdot \sqrt{\frac{1}{x}}} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 19: 40.1% accurate, 7.3× speedup?

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

\mathbf{else}:\\
\;\;\;\;0.5 \cdot \sqrt{\frac{1}{x}}\\


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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{1 + \left(0.5 \cdot x - \sqrt{x}\right)} \]
      2. *-commutative26.9%

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

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

    if 0.880000000000000004 < x

    1. Initial program 84.1%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{1 + y} - \sqrt{y}\right)\right) + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\sqrt{1 + t} - \sqrt{t}\right)\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in t around inf 4.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+6.7%

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

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

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

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

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

      \[\leadsto \color{blue}{0.5 \cdot \sqrt{\frac{1}{x}}} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 20: 39.9% accurate, 7.5× speedup?

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

\mathbf{else}:\\
\;\;\;\;0.5 \cdot \sqrt{\frac{1}{x}}\\


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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{1 - \sqrt{x}} \]

    if 0.23999999999999999 < x

    1. Initial program 84.1%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{1 + y} - \sqrt{y}\right)\right) + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\sqrt{1 + t} - \sqrt{t}\right)\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in t around inf 4.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+6.7%

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

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

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

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

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

      \[\leadsto \color{blue}{0.5 \cdot \sqrt{\frac{1}{x}}} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 21: 35.1% accurate, 8.0× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 22: 1.9% accurate, 8.1× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{1 - \sqrt{x}} \]
  12. Taylor expanded in x around inf 1.6%

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

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

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

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

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

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

Reproduce

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

  :alt
  (! :herbie-platform default (+ (+ (+ (/ 1 (+ (sqrt (+ x 1)) (sqrt x))) (/ 1 (+ (sqrt (+ y 1)) (sqrt y)))) (/ 1 (+ (sqrt (+ z 1)) (sqrt z)))) (- (sqrt (+ t 1)) (sqrt t))))

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