Main:z from

Percentage Accurate: 91.5% → 99.6%
Time: 32.2s
Alternatives: 18
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 18 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.5% 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.6% accurate, 0.5× speedup?

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

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


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

    1. Initial program 79.3%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(\left(x + 1\right) - x, \sqrt{1 + y} + \sqrt{y}, \left(\sqrt{x + 1} + \sqrt{x}\right) \cdot \left(\left(1 + y\right) - y\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) \]
      2. associate--l+81.0%

        \[\leadsto \frac{\mathsf{fma}\left(\color{blue}{x + \left(1 - x\right)}, \sqrt{1 + y} + \sqrt{y}, \left(\sqrt{x + 1} + \sqrt{x}\right) \cdot \left(\left(1 + y\right) - y\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) \]
      3. +-commutative81.0%

        \[\leadsto \frac{\mathsf{fma}\left(x + \left(1 - x\right), \sqrt{1 + y} + \sqrt{y}, \color{blue}{\left(\sqrt{x} + \sqrt{x + 1}\right)} \cdot \left(\left(1 + y\right) - y\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) \]
      4. +-commutative81.0%

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

        \[\leadsto \frac{\mathsf{fma}\left(x + \left(1 - x\right), \sqrt{1 + y} + \sqrt{y}, \left(\sqrt{x} + \sqrt{1 + x}\right) \cdot \color{blue}{\left(1 + \left(y - y\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) \]
      6. +-commutative85.1%

        \[\leadsto \frac{\mathsf{fma}\left(x + \left(1 - x\right), \sqrt{1 + y} + \sqrt{y}, \left(\sqrt{x} + \sqrt{1 + x}\right) \cdot \left(1 + \left(y - y\right)\right)\right)}{\color{blue}{\left(\sqrt{x} + \sqrt{x + 1}\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. +-commutative85.1%

        \[\leadsto \frac{\mathsf{fma}\left(x + \left(1 - x\right), \sqrt{1 + y} + \sqrt{y}, \left(\sqrt{x} + \sqrt{1 + x}\right) \cdot \left(1 + \left(y - y\right)\right)\right)}{\left(\sqrt{x} + \sqrt{\color{blue}{1 + 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. Simplified85.1%

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(x + \left(1 - x\right), \sqrt{1 + y} + \sqrt{y}, \left(\sqrt{x} + \sqrt{1 + x}\right) \cdot \left(1 + \left(y - y\right)\right)\right)}{\left(\sqrt{x} + \sqrt{1 + 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. Step-by-step derivation
      1. add-cube-cbrt84.1%

        \[\leadsto \frac{\color{blue}{\left(\sqrt[3]{\mathsf{fma}\left(x + \left(1 - x\right), \sqrt{1 + y} + \sqrt{y}, \left(\sqrt{x} + \sqrt{1 + x}\right) \cdot \left(1 + \left(y - y\right)\right)\right)} \cdot \sqrt[3]{\mathsf{fma}\left(x + \left(1 - x\right), \sqrt{1 + y} + \sqrt{y}, \left(\sqrt{x} + \sqrt{1 + x}\right) \cdot \left(1 + \left(y - y\right)\right)\right)}\right) \cdot \sqrt[3]{\mathsf{fma}\left(x + \left(1 - x\right), \sqrt{1 + y} + \sqrt{y}, \left(\sqrt{x} + \sqrt{1 + x}\right) \cdot \left(1 + \left(y - y\right)\right)\right)}}}{\left(\sqrt{x} + \sqrt{1 + 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. pow384.0%

        \[\leadsto \frac{\color{blue}{{\left(\sqrt[3]{\mathsf{fma}\left(x + \left(1 - x\right), \sqrt{1 + y} + \sqrt{y}, \left(\sqrt{x} + \sqrt{1 + x}\right) \cdot \left(1 + \left(y - y\right)\right)\right)}\right)}^{3}}}{\left(\sqrt{x} + \sqrt{1 + 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. +-inverses84.0%

        \[\leadsto \frac{{\left(\sqrt[3]{\mathsf{fma}\left(x + \left(1 - x\right), \sqrt{1 + y} + \sqrt{y}, \left(\sqrt{x} + \sqrt{1 + x}\right) \cdot \left(1 + \color{blue}{0}\right)\right)}\right)}^{3}}{\left(\sqrt{x} + \sqrt{1 + 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. metadata-eval84.0%

        \[\leadsto \frac{{\left(\sqrt[3]{\mathsf{fma}\left(x + \left(1 - x\right), \sqrt{1 + y} + \sqrt{y}, \left(\sqrt{x} + \sqrt{1 + x}\right) \cdot \color{blue}{1}\right)}\right)}^{3}}{\left(\sqrt{x} + \sqrt{1 + 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. *-commutative84.0%

        \[\leadsto \frac{{\left(\sqrt[3]{\mathsf{fma}\left(x + \left(1 - x\right), \sqrt{1 + y} + \sqrt{y}, \color{blue}{1 \cdot \left(\sqrt{x} + \sqrt{1 + x}\right)}\right)}\right)}^{3}}{\left(\sqrt{x} + \sqrt{1 + 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. *-un-lft-identity84.0%

        \[\leadsto \frac{{\left(\sqrt[3]{\mathsf{fma}\left(x + \left(1 - x\right), \sqrt{1 + y} + \sqrt{y}, \color{blue}{\sqrt{x} + \sqrt{1 + x}}\right)}\right)}^{3}}{\left(\sqrt{x} + \sqrt{1 + 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. +-commutative84.0%

        \[\leadsto \frac{{\left(\sqrt[3]{\mathsf{fma}\left(x + \left(1 - x\right), \sqrt{1 + y} + \sqrt{y}, \sqrt{x} + \sqrt{\color{blue}{x + 1}}\right)}\right)}^{3}}{\left(\sqrt{x} + \sqrt{1 + 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) \]
    10. Applied egg-rr84.0%

      \[\leadsto \frac{\color{blue}{{\left(\sqrt[3]{\mathsf{fma}\left(x + \left(1 - x\right), \sqrt{1 + y} + \sqrt{y}, \sqrt{x} + \sqrt{x + 1}\right)}\right)}^{3}}}{\left(\sqrt{x} + \sqrt{1 + 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) \]
    11. Taylor expanded in t around inf 45.3%

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

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

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

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

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

    1. Initial program 96.8%

      \[\left(\left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{y + 1} - \sqrt{y}\right)\right) + \left(\sqrt{z + 1} - \sqrt{z}\right)\right) + \left(\sqrt{t + 1} - \sqrt{t}\right) \]
    2. Step-by-step derivation
      1. associate-+l+96.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. associate-+l-79.4%

        \[\leadsto \color{blue}{\left(\sqrt{x + 1} - \left(\sqrt{x} - \left(\sqrt{y + 1} - \sqrt{y}\right)\right)\right)} + \left(\left(\sqrt{z + 1} - \sqrt{z}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)\right) \]
      3. associate-+l-96.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) \]
      4. +-commutative96.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. +-commutative96.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. +-commutative96.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. Simplified96.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 45.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--45.5%

        \[\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{\sqrt{1 + t} \cdot \sqrt{1 + t} - \sqrt{t} \cdot \sqrt{t}}{\sqrt{1 + t} + \sqrt{t}}}\right) \]
      2. add-sqr-sqrt37.3%

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

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

      \[\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{\left(1 + t\right) - t}{\sqrt{1 + t} + \sqrt{t}}}\right) \]
    8. Step-by-step derivation
      1. associate--l+45.7%

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

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

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

      \[\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) \]
  3. Recombined 2 regimes into one program.
  4. Final simplification49.9%

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

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


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

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

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

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

        \[\leadsto \color{blue}{\left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{y + 1} - \sqrt{y}\right)\right)} + \left(\left(\sqrt{z + 1} - \sqrt{z}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)\right) \]
      4. +-commutative85.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. +-commutative85.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. +-commutative85.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. Simplified85.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--85.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--85.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-add85.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-rr86.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. fma-define86.3%

        \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(\left(x + 1\right) - x, \sqrt{1 + y} + \sqrt{y}, \left(\sqrt{x + 1} + \sqrt{x}\right) \cdot \left(\left(1 + y\right) - y\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) \]
      2. associate--l+86.3%

        \[\leadsto \frac{\mathsf{fma}\left(\color{blue}{x + \left(1 - x\right)}, \sqrt{1 + y} + \sqrt{y}, \left(\sqrt{x + 1} + \sqrt{x}\right) \cdot \left(\left(1 + y\right) - y\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) \]
      3. +-commutative86.3%

        \[\leadsto \frac{\mathsf{fma}\left(x + \left(1 - x\right), \sqrt{1 + y} + \sqrt{y}, \color{blue}{\left(\sqrt{x} + \sqrt{x + 1}\right)} \cdot \left(\left(1 + y\right) - y\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) \]
      4. +-commutative86.3%

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

        \[\leadsto \frac{\mathsf{fma}\left(x + \left(1 - x\right), \sqrt{1 + y} + \sqrt{y}, \left(\sqrt{x} + \sqrt{1 + x}\right) \cdot \color{blue}{\left(1 + \left(y - y\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) \]
      6. +-commutative89.5%

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

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

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(x + \left(1 - x\right), \sqrt{1 + y} + \sqrt{y}, \left(\sqrt{x} + \sqrt{1 + x}\right) \cdot \left(1 + \left(y - y\right)\right)\right)}{\left(\sqrt{x} + \sqrt{1 + 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. Step-by-step derivation
      1. add-cube-cbrt88.9%

        \[\leadsto \frac{\color{blue}{\left(\sqrt[3]{\mathsf{fma}\left(x + \left(1 - x\right), \sqrt{1 + y} + \sqrt{y}, \left(\sqrt{x} + \sqrt{1 + x}\right) \cdot \left(1 + \left(y - y\right)\right)\right)} \cdot \sqrt[3]{\mathsf{fma}\left(x + \left(1 - x\right), \sqrt{1 + y} + \sqrt{y}, \left(\sqrt{x} + \sqrt{1 + x}\right) \cdot \left(1 + \left(y - y\right)\right)\right)}\right) \cdot \sqrt[3]{\mathsf{fma}\left(x + \left(1 - x\right), \sqrt{1 + y} + \sqrt{y}, \left(\sqrt{x} + \sqrt{1 + x}\right) \cdot \left(1 + \left(y - y\right)\right)\right)}}}{\left(\sqrt{x} + \sqrt{1 + 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. pow388.8%

        \[\leadsto \frac{\color{blue}{{\left(\sqrt[3]{\mathsf{fma}\left(x + \left(1 - x\right), \sqrt{1 + y} + \sqrt{y}, \left(\sqrt{x} + \sqrt{1 + x}\right) \cdot \left(1 + \left(y - y\right)\right)\right)}\right)}^{3}}}{\left(\sqrt{x} + \sqrt{1 + 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. +-inverses88.8%

        \[\leadsto \frac{{\left(\sqrt[3]{\mathsf{fma}\left(x + \left(1 - x\right), \sqrt{1 + y} + \sqrt{y}, \left(\sqrt{x} + \sqrt{1 + x}\right) \cdot \left(1 + \color{blue}{0}\right)\right)}\right)}^{3}}{\left(\sqrt{x} + \sqrt{1 + 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. metadata-eval88.8%

        \[\leadsto \frac{{\left(\sqrt[3]{\mathsf{fma}\left(x + \left(1 - x\right), \sqrt{1 + y} + \sqrt{y}, \left(\sqrt{x} + \sqrt{1 + x}\right) \cdot \color{blue}{1}\right)}\right)}^{3}}{\left(\sqrt{x} + \sqrt{1 + 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. *-commutative88.8%

        \[\leadsto \frac{{\left(\sqrt[3]{\mathsf{fma}\left(x + \left(1 - x\right), \sqrt{1 + y} + \sqrt{y}, \color{blue}{1 \cdot \left(\sqrt{x} + \sqrt{1 + x}\right)}\right)}\right)}^{3}}{\left(\sqrt{x} + \sqrt{1 + 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. *-un-lft-identity88.8%

        \[\leadsto \frac{{\left(\sqrt[3]{\mathsf{fma}\left(x + \left(1 - x\right), \sqrt{1 + y} + \sqrt{y}, \color{blue}{\sqrt{x} + \sqrt{1 + x}}\right)}\right)}^{3}}{\left(\sqrt{x} + \sqrt{1 + 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. +-commutative88.8%

        \[\leadsto \frac{{\left(\sqrt[3]{\mathsf{fma}\left(x + \left(1 - x\right), \sqrt{1 + y} + \sqrt{y}, \sqrt{x} + \sqrt{\color{blue}{x + 1}}\right)}\right)}^{3}}{\left(\sqrt{x} + \sqrt{1 + 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) \]
    10. Applied egg-rr88.8%

      \[\leadsto \frac{\color{blue}{{\left(\sqrt[3]{\mathsf{fma}\left(x + \left(1 - x\right), \sqrt{1 + y} + \sqrt{y}, \sqrt{x} + \sqrt{x + 1}\right)}\right)}^{3}}}{\left(\sqrt{x} + \sqrt{1 + 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) \]
    11. Taylor expanded in t around inf 49.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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


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

    1. Initial program 79.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+79.7%

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

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

        \[\leadsto \color{blue}{\left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{y + 1} - \sqrt{y}\right)\right)} + \left(\left(\sqrt{z + 1} - \sqrt{z}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)\right) \]
      4. +-commutative79.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. +-commutative79.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. +-commutative79.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. Simplified79.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--79.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--80.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-add80.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-rr81.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. fma-define81.2%

        \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(\left(x + 1\right) - x, \sqrt{1 + y} + \sqrt{y}, \left(\sqrt{x + 1} + \sqrt{x}\right) \cdot \left(\left(1 + y\right) - y\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) \]
      2. associate--l+81.2%

        \[\leadsto \frac{\mathsf{fma}\left(\color{blue}{x + \left(1 - x\right)}, \sqrt{1 + y} + \sqrt{y}, \left(\sqrt{x + 1} + \sqrt{x}\right) \cdot \left(\left(1 + y\right) - y\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) \]
      3. +-commutative81.2%

        \[\leadsto \frac{\mathsf{fma}\left(x + \left(1 - x\right), \sqrt{1 + y} + \sqrt{y}, \color{blue}{\left(\sqrt{x} + \sqrt{x + 1}\right)} \cdot \left(\left(1 + y\right) - y\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) \]
      4. +-commutative81.2%

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

        \[\leadsto \frac{\mathsf{fma}\left(x + \left(1 - x\right), \sqrt{1 + y} + \sqrt{y}, \left(\sqrt{x} + \sqrt{1 + x}\right) \cdot \color{blue}{\left(1 + \left(y - y\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) \]
      6. +-commutative86.1%

        \[\leadsto \frac{\mathsf{fma}\left(x + \left(1 - x\right), \sqrt{1 + y} + \sqrt{y}, \left(\sqrt{x} + \sqrt{1 + x}\right) \cdot \left(1 + \left(y - y\right)\right)\right)}{\color{blue}{\left(\sqrt{x} + \sqrt{x + 1}\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. +-commutative86.1%

        \[\leadsto \frac{\mathsf{fma}\left(x + \left(1 - x\right), \sqrt{1 + y} + \sqrt{y}, \left(\sqrt{x} + \sqrt{1 + x}\right) \cdot \left(1 + \left(y - y\right)\right)\right)}{\left(\sqrt{x} + \sqrt{\color{blue}{1 + 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. Simplified86.1%

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(x + \left(1 - x\right), \sqrt{1 + y} + \sqrt{y}, \left(\sqrt{x} + \sqrt{1 + x}\right) \cdot \left(1 + \left(y - y\right)\right)\right)}{\left(\sqrt{x} + \sqrt{1 + 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. Step-by-step derivation
      1. add-cube-cbrt85.6%

        \[\leadsto \frac{\color{blue}{\left(\sqrt[3]{\mathsf{fma}\left(x + \left(1 - x\right), \sqrt{1 + y} + \sqrt{y}, \left(\sqrt{x} + \sqrt{1 + x}\right) \cdot \left(1 + \left(y - y\right)\right)\right)} \cdot \sqrt[3]{\mathsf{fma}\left(x + \left(1 - x\right), \sqrt{1 + y} + \sqrt{y}, \left(\sqrt{x} + \sqrt{1 + x}\right) \cdot \left(1 + \left(y - y\right)\right)\right)}\right) \cdot \sqrt[3]{\mathsf{fma}\left(x + \left(1 - x\right), \sqrt{1 + y} + \sqrt{y}, \left(\sqrt{x} + \sqrt{1 + x}\right) \cdot \left(1 + \left(y - y\right)\right)\right)}}}{\left(\sqrt{x} + \sqrt{1 + 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. pow385.6%

        \[\leadsto \frac{\color{blue}{{\left(\sqrt[3]{\mathsf{fma}\left(x + \left(1 - x\right), \sqrt{1 + y} + \sqrt{y}, \left(\sqrt{x} + \sqrt{1 + x}\right) \cdot \left(1 + \left(y - y\right)\right)\right)}\right)}^{3}}}{\left(\sqrt{x} + \sqrt{1 + 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. +-inverses85.6%

        \[\leadsto \frac{{\left(\sqrt[3]{\mathsf{fma}\left(x + \left(1 - x\right), \sqrt{1 + y} + \sqrt{y}, \left(\sqrt{x} + \sqrt{1 + x}\right) \cdot \left(1 + \color{blue}{0}\right)\right)}\right)}^{3}}{\left(\sqrt{x} + \sqrt{1 + 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. metadata-eval85.6%

        \[\leadsto \frac{{\left(\sqrt[3]{\mathsf{fma}\left(x + \left(1 - x\right), \sqrt{1 + y} + \sqrt{y}, \left(\sqrt{x} + \sqrt{1 + x}\right) \cdot \color{blue}{1}\right)}\right)}^{3}}{\left(\sqrt{x} + \sqrt{1 + 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. *-commutative85.6%

        \[\leadsto \frac{{\left(\sqrt[3]{\mathsf{fma}\left(x + \left(1 - x\right), \sqrt{1 + y} + \sqrt{y}, \color{blue}{1 \cdot \left(\sqrt{x} + \sqrt{1 + x}\right)}\right)}\right)}^{3}}{\left(\sqrt{x} + \sqrt{1 + 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. *-un-lft-identity85.6%

        \[\leadsto \frac{{\left(\sqrt[3]{\mathsf{fma}\left(x + \left(1 - x\right), \sqrt{1 + y} + \sqrt{y}, \color{blue}{\sqrt{x} + \sqrt{1 + x}}\right)}\right)}^{3}}{\left(\sqrt{x} + \sqrt{1 + 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. +-commutative85.6%

        \[\leadsto \frac{{\left(\sqrt[3]{\mathsf{fma}\left(x + \left(1 - x\right), \sqrt{1 + y} + \sqrt{y}, \sqrt{x} + \sqrt{\color{blue}{x + 1}}\right)}\right)}^{3}}{\left(\sqrt{x} + \sqrt{1 + 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) \]
    10. Applied egg-rr85.6%

      \[\leadsto \frac{\color{blue}{{\left(\sqrt[3]{\mathsf{fma}\left(x + \left(1 - x\right), \sqrt{1 + y} + \sqrt{y}, \sqrt{x} + \sqrt{x + 1}\right)}\right)}^{3}}}{\left(\sqrt{x} + \sqrt{1 + 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) \]
    11. Taylor expanded in t around inf 50.0%

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

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

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

    1. Initial program 96.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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


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

    1. Initial program 96.3%

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

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

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

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

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

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

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

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

      \[\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--96.3%

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

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

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

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

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

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

        \[\leadsto \left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{1 + y} - \sqrt{y}\right)\right) + \left(\frac{\color{blue}{1}}{\sqrt{1 + z} + \sqrt{z}} + \left(\sqrt{1 + t} - \sqrt{t}\right)\right) \]
    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 1.6e6 < y

    1. Initial program 79.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+79.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. associate-+l-79.2%

        \[\leadsto \color{blue}{\left(\sqrt{x + 1} - \left(\sqrt{x} - \left(\sqrt{y + 1} - \sqrt{y}\right)\right)\right)} + \left(\left(\sqrt{z + 1} - \sqrt{z}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)\right) \]
      3. associate-+l-79.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) \]
      4. +-commutative79.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. +-commutative79.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. +-commutative79.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. Simplified79.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--79.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--80.9%

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

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

        \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(\left(x + 1\right) - x, \sqrt{1 + y} + \sqrt{y}, \left(\sqrt{x + 1} + \sqrt{x}\right) \cdot \left(\left(1 + y\right) - y\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) \]
      2. associate--l+81.5%

        \[\leadsto \frac{\mathsf{fma}\left(\color{blue}{x + \left(1 - x\right)}, \sqrt{1 + y} + \sqrt{y}, \left(\sqrt{x + 1} + \sqrt{x}\right) \cdot \left(\left(1 + y\right) - y\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) \]
      3. +-commutative81.5%

        \[\leadsto \frac{\mathsf{fma}\left(x + \left(1 - x\right), \sqrt{1 + y} + \sqrt{y}, \color{blue}{\left(\sqrt{x} + \sqrt{x + 1}\right)} \cdot \left(\left(1 + y\right) - y\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) \]
      4. +-commutative81.5%

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

        \[\leadsto \frac{\mathsf{fma}\left(x + \left(1 - x\right), \sqrt{1 + y} + \sqrt{y}, \left(\sqrt{x} + \sqrt{1 + x}\right) \cdot \color{blue}{\left(1 + \left(y - y\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) \]
      6. +-commutative86.3%

        \[\leadsto \frac{\mathsf{fma}\left(x + \left(1 - x\right), \sqrt{1 + y} + \sqrt{y}, \left(\sqrt{x} + \sqrt{1 + x}\right) \cdot \left(1 + \left(y - y\right)\right)\right)}{\color{blue}{\left(\sqrt{x} + \sqrt{x + 1}\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. +-commutative86.3%

        \[\leadsto \frac{\mathsf{fma}\left(x + \left(1 - x\right), \sqrt{1 + y} + \sqrt{y}, \left(\sqrt{x} + \sqrt{1 + x}\right) \cdot \left(1 + \left(y - y\right)\right)\right)}{\left(\sqrt{x} + \sqrt{\color{blue}{1 + 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. Simplified86.3%

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(x + \left(1 - x\right), \sqrt{1 + y} + \sqrt{y}, \left(\sqrt{x} + \sqrt{1 + x}\right) \cdot \left(1 + \left(y - y\right)\right)\right)}{\left(\sqrt{x} + \sqrt{1 + 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. Taylor expanded in y around inf 90.0%

      \[\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) \]
    10. Taylor expanded in z around inf 50.3%

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

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

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

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

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


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

    1. Initial program 96.3%

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

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

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

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

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

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

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

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

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

        \[\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{\sqrt{1 + t} \cdot \sqrt{1 + t} - \sqrt{t} \cdot \sqrt{t}}{\sqrt{1 + t} + \sqrt{t}}}\right) \]
      2. add-sqr-sqrt40.4%

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

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

      \[\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{\left(1 + t\right) - t}{\sqrt{1 + t} + \sqrt{t}}}\right) \]
    8. Step-by-step derivation
      1. associate--l+51.5%

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

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

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

      \[\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 1.6e6 < y

    1. Initial program 79.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+79.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. associate-+l-79.2%

        \[\leadsto \color{blue}{\left(\sqrt{x + 1} - \left(\sqrt{x} - \left(\sqrt{y + 1} - \sqrt{y}\right)\right)\right)} + \left(\left(\sqrt{z + 1} - \sqrt{z}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)\right) \]
      3. associate-+l-79.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) \]
      4. +-commutative79.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. +-commutative79.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. +-commutative79.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. Simplified79.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--79.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--80.9%

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

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

        \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(\left(x + 1\right) - x, \sqrt{1 + y} + \sqrt{y}, \left(\sqrt{x + 1} + \sqrt{x}\right) \cdot \left(\left(1 + y\right) - y\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) \]
      2. associate--l+81.5%

        \[\leadsto \frac{\mathsf{fma}\left(\color{blue}{x + \left(1 - x\right)}, \sqrt{1 + y} + \sqrt{y}, \left(\sqrt{x + 1} + \sqrt{x}\right) \cdot \left(\left(1 + y\right) - y\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) \]
      3. +-commutative81.5%

        \[\leadsto \frac{\mathsf{fma}\left(x + \left(1 - x\right), \sqrt{1 + y} + \sqrt{y}, \color{blue}{\left(\sqrt{x} + \sqrt{x + 1}\right)} \cdot \left(\left(1 + y\right) - y\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) \]
      4. +-commutative81.5%

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

        \[\leadsto \frac{\mathsf{fma}\left(x + \left(1 - x\right), \sqrt{1 + y} + \sqrt{y}, \left(\sqrt{x} + \sqrt{1 + x}\right) \cdot \color{blue}{\left(1 + \left(y - y\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) \]
      6. +-commutative86.3%

        \[\leadsto \frac{\mathsf{fma}\left(x + \left(1 - x\right), \sqrt{1 + y} + \sqrt{y}, \left(\sqrt{x} + \sqrt{1 + x}\right) \cdot \left(1 + \left(y - y\right)\right)\right)}{\color{blue}{\left(\sqrt{x} + \sqrt{x + 1}\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. +-commutative86.3%

        \[\leadsto \frac{\mathsf{fma}\left(x + \left(1 - x\right), \sqrt{1 + y} + \sqrt{y}, \left(\sqrt{x} + \sqrt{1 + x}\right) \cdot \left(1 + \left(y - y\right)\right)\right)}{\left(\sqrt{x} + \sqrt{\color{blue}{1 + 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. Simplified86.3%

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(x + \left(1 - x\right), \sqrt{1 + y} + \sqrt{y}, \left(\sqrt{x} + \sqrt{1 + x}\right) \cdot \left(1 + \left(y - y\right)\right)\right)}{\left(\sqrt{x} + \sqrt{1 + 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. Taylor expanded in y around inf 90.0%

      \[\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) \]
    10. Taylor expanded in z around inf 50.3%

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

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

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

Alternative 6: 98.0% accurate, 1.1× speedup?

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

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


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

    1. Initial program 96.3%

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

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

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

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

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

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

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

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

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

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

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

    if 1.6e6 < y

    1. Initial program 79.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+79.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. associate-+l-79.2%

        \[\leadsto \color{blue}{\left(\sqrt{x + 1} - \left(\sqrt{x} - \left(\sqrt{y + 1} - \sqrt{y}\right)\right)\right)} + \left(\left(\sqrt{z + 1} - \sqrt{z}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)\right) \]
      3. associate-+l-79.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) \]
      4. +-commutative79.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. +-commutative79.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. +-commutative79.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. Simplified79.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--79.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--80.9%

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

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

        \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(\left(x + 1\right) - x, \sqrt{1 + y} + \sqrt{y}, \left(\sqrt{x + 1} + \sqrt{x}\right) \cdot \left(\left(1 + y\right) - y\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) \]
      2. associate--l+81.5%

        \[\leadsto \frac{\mathsf{fma}\left(\color{blue}{x + \left(1 - x\right)}, \sqrt{1 + y} + \sqrt{y}, \left(\sqrt{x + 1} + \sqrt{x}\right) \cdot \left(\left(1 + y\right) - y\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) \]
      3. +-commutative81.5%

        \[\leadsto \frac{\mathsf{fma}\left(x + \left(1 - x\right), \sqrt{1 + y} + \sqrt{y}, \color{blue}{\left(\sqrt{x} + \sqrt{x + 1}\right)} \cdot \left(\left(1 + y\right) - y\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) \]
      4. +-commutative81.5%

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

        \[\leadsto \frac{\mathsf{fma}\left(x + \left(1 - x\right), \sqrt{1 + y} + \sqrt{y}, \left(\sqrt{x} + \sqrt{1 + x}\right) \cdot \color{blue}{\left(1 + \left(y - y\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) \]
      6. +-commutative86.3%

        \[\leadsto \frac{\mathsf{fma}\left(x + \left(1 - x\right), \sqrt{1 + y} + \sqrt{y}, \left(\sqrt{x} + \sqrt{1 + x}\right) \cdot \left(1 + \left(y - y\right)\right)\right)}{\color{blue}{\left(\sqrt{x} + \sqrt{x + 1}\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. +-commutative86.3%

        \[\leadsto \frac{\mathsf{fma}\left(x + \left(1 - x\right), \sqrt{1 + y} + \sqrt{y}, \left(\sqrt{x} + \sqrt{1 + x}\right) \cdot \left(1 + \left(y - y\right)\right)\right)}{\left(\sqrt{x} + \sqrt{\color{blue}{1 + 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. Simplified86.3%

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(x + \left(1 - x\right), \sqrt{1 + y} + \sqrt{y}, \left(\sqrt{x} + \sqrt{1 + x}\right) \cdot \left(1 + \left(y - y\right)\right)\right)}{\left(\sqrt{x} + \sqrt{1 + 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. Taylor expanded in y around inf 90.0%

      \[\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) \]
    10. Taylor expanded in z around inf 50.3%

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

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

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

Alternative 7: 97.1% accurate, 1.3× speedup?

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

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


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

    1. Initial program 96.6%

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

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

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

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

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

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

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

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

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

    if 2.5 < y

    1. Initial program 80.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+80.4%

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(\left(x + 1\right) - x, \sqrt{1 + y} + \sqrt{y}, \left(\sqrt{x + 1} + \sqrt{x}\right) \cdot \left(\left(1 + y\right) - y\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) \]
      2. associate--l+82.3%

        \[\leadsto \frac{\mathsf{fma}\left(\color{blue}{x + \left(1 - x\right)}, \sqrt{1 + y} + \sqrt{y}, \left(\sqrt{x + 1} + \sqrt{x}\right) \cdot \left(\left(1 + y\right) - y\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) \]
      3. +-commutative82.3%

        \[\leadsto \frac{\mathsf{fma}\left(x + \left(1 - x\right), \sqrt{1 + y} + \sqrt{y}, \color{blue}{\left(\sqrt{x} + \sqrt{x + 1}\right)} \cdot \left(\left(1 + y\right) - y\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) \]
      4. +-commutative82.3%

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

        \[\leadsto \frac{\mathsf{fma}\left(x + \left(1 - x\right), \sqrt{1 + y} + \sqrt{y}, \left(\sqrt{x} + \sqrt{1 + x}\right) \cdot \color{blue}{\left(1 + \left(y - y\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) \]
      6. +-commutative86.8%

        \[\leadsto \frac{\mathsf{fma}\left(x + \left(1 - x\right), \sqrt{1 + y} + \sqrt{y}, \left(\sqrt{x} + \sqrt{1 + x}\right) \cdot \left(1 + \left(y - y\right)\right)\right)}{\color{blue}{\left(\sqrt{x} + \sqrt{x + 1}\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. +-commutative86.8%

        \[\leadsto \frac{\mathsf{fma}\left(x + \left(1 - x\right), \sqrt{1 + y} + \sqrt{y}, \left(\sqrt{x} + \sqrt{1 + x}\right) \cdot \left(1 + \left(y - y\right)\right)\right)}{\left(\sqrt{x} + \sqrt{\color{blue}{1 + 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. Simplified86.8%

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(x + \left(1 - x\right), \sqrt{1 + y} + \sqrt{y}, \left(\sqrt{x} + \sqrt{1 + x}\right) \cdot \left(1 + \left(y - y\right)\right)\right)}{\left(\sqrt{x} + \sqrt{1 + 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. Taylor expanded in y around inf 88.2%

      \[\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) \]
    10. Taylor expanded in z around inf 50.0%

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

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

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

Alternative 8: 97.8% accurate, 1.3× speedup?

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

\mathbf{elif}\;y \leq 50000000:\\
\;\;\;\;\left(t\_1 + \left(\sqrt{1 + y} + t\_2\right)\right) - t\_3\\

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


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

    1. Initial program 96.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+96.4%

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

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

        \[\leadsto \color{blue}{\left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{y + 1} - \sqrt{y}\right)\right)} + \left(\left(\sqrt{z + 1} - \sqrt{z}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)\right) \]
      4. +-commutative96.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. +-commutative96.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. +-commutative96.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. Simplified96.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 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 y around 0 51.3%

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

    if 6.10000000000000013e-21 < y < 5e7

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

        \[\leadsto \color{blue}{\left(\sqrt{x + 1} - \left(\sqrt{x} - \left(\sqrt{y + 1} - \sqrt{y}\right)\right)\right)} + \left(\left(\sqrt{z + 1} - \sqrt{z}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)\right) \]
      3. associate-+l-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) \]
      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 t around inf 21.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+26.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. Simplified26.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 z around inf 22.1%

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

    if 5e7 < y

    1. Initial program 79.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+79.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. associate-+l-79.1%

        \[\leadsto \color{blue}{\left(\sqrt{x + 1} - \left(\sqrt{x} - \left(\sqrt{y + 1} - \sqrt{y}\right)\right)\right)} + \left(\left(\sqrt{z + 1} - \sqrt{z}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)\right) \]
      3. associate-+l-79.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) \]
      4. +-commutative79.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. +-commutative79.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. +-commutative79.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. Simplified79.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--79.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--80.9%

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

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

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

        \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(\left(x + 1\right) - x, \sqrt{1 + y} + \sqrt{y}, \left(\sqrt{x + 1} + \sqrt{x}\right) \cdot \left(\left(1 + y\right) - y\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) \]
      2. associate--l+81.4%

        \[\leadsto \frac{\mathsf{fma}\left(\color{blue}{x + \left(1 - x\right)}, \sqrt{1 + y} + \sqrt{y}, \left(\sqrt{x + 1} + \sqrt{x}\right) \cdot \left(\left(1 + y\right) - y\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) \]
      3. +-commutative81.4%

        \[\leadsto \frac{\mathsf{fma}\left(x + \left(1 - x\right), \sqrt{1 + y} + \sqrt{y}, \color{blue}{\left(\sqrt{x} + \sqrt{x + 1}\right)} \cdot \left(\left(1 + y\right) - y\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) \]
      4. +-commutative81.4%

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

        \[\leadsto \frac{\mathsf{fma}\left(x + \left(1 - x\right), \sqrt{1 + y} + \sqrt{y}, \left(\sqrt{x} + \sqrt{1 + x}\right) \cdot \color{blue}{\left(1 + \left(y - y\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) \]
      6. +-commutative86.2%

        \[\leadsto \frac{\mathsf{fma}\left(x + \left(1 - x\right), \sqrt{1 + y} + \sqrt{y}, \left(\sqrt{x} + \sqrt{1 + x}\right) \cdot \left(1 + \left(y - y\right)\right)\right)}{\color{blue}{\left(\sqrt{x} + \sqrt{x + 1}\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. +-commutative86.2%

        \[\leadsto \frac{\mathsf{fma}\left(x + \left(1 - x\right), \sqrt{1 + y} + \sqrt{y}, \left(\sqrt{x} + \sqrt{1 + x}\right) \cdot \left(1 + \left(y - y\right)\right)\right)}{\left(\sqrt{x} + \sqrt{\color{blue}{1 + 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. Simplified86.2%

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(x + \left(1 - x\right), \sqrt{1 + y} + \sqrt{y}, \left(\sqrt{x} + \sqrt{1 + x}\right) \cdot \left(1 + \left(y - y\right)\right)\right)}{\left(\sqrt{x} + \sqrt{1 + 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. Taylor expanded in y around inf 90.0%

      \[\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) \]
    10. Taylor expanded in z around inf 50.6%

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

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

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

Alternative 9: 92.6% accurate, 1.6× speedup?

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

\mathbf{elif}\;y \leq 53000000:\\
\;\;\;\;\left(t\_2 + \left(\sqrt{1 + y} + t\_1\right)\right) - \left(\sqrt{x} + \sqrt{y}\right)\\

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


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

    1. Initial program 96.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+96.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.0499999999999999e-6 < y < 5.3e7

    1. Initial program 94.5%

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

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

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

        \[\leadsto \color{blue}{\left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{y + 1} - \sqrt{y}\right)\right)} + \left(\left(\sqrt{z + 1} - \sqrt{z}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)\right) \]
      4. +-commutative94.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. +-commutative94.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. +-commutative94.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. Simplified94.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 25.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+31.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. Simplified31.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 20.0%

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

    if 5.3e7 < y

    1. Initial program 79.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+79.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. associate-+l-79.1%

        \[\leadsto \color{blue}{\left(\sqrt{x + 1} - \left(\sqrt{x} - \left(\sqrt{y + 1} - \sqrt{y}\right)\right)\right)} + \left(\left(\sqrt{z + 1} - \sqrt{z}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)\right) \]
      3. associate-+l-79.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) \]
      4. +-commutative79.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. +-commutative79.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. +-commutative79.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. Simplified79.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--79.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--80.9%

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

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

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

        \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(\left(x + 1\right) - x, \sqrt{1 + y} + \sqrt{y}, \left(\sqrt{x + 1} + \sqrt{x}\right) \cdot \left(\left(1 + y\right) - y\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) \]
      2. associate--l+81.4%

        \[\leadsto \frac{\mathsf{fma}\left(\color{blue}{x + \left(1 - x\right)}, \sqrt{1 + y} + \sqrt{y}, \left(\sqrt{x + 1} + \sqrt{x}\right) \cdot \left(\left(1 + y\right) - y\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) \]
      3. +-commutative81.4%

        \[\leadsto \frac{\mathsf{fma}\left(x + \left(1 - x\right), \sqrt{1 + y} + \sqrt{y}, \color{blue}{\left(\sqrt{x} + \sqrt{x + 1}\right)} \cdot \left(\left(1 + y\right) - y\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) \]
      4. +-commutative81.4%

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

        \[\leadsto \frac{\mathsf{fma}\left(x + \left(1 - x\right), \sqrt{1 + y} + \sqrt{y}, \left(\sqrt{x} + \sqrt{1 + x}\right) \cdot \color{blue}{\left(1 + \left(y - y\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) \]
      6. +-commutative86.2%

        \[\leadsto \frac{\mathsf{fma}\left(x + \left(1 - x\right), \sqrt{1 + y} + \sqrt{y}, \left(\sqrt{x} + \sqrt{1 + x}\right) \cdot \left(1 + \left(y - y\right)\right)\right)}{\color{blue}{\left(\sqrt{x} + \sqrt{x + 1}\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. +-commutative86.2%

        \[\leadsto \frac{\mathsf{fma}\left(x + \left(1 - x\right), \sqrt{1 + y} + \sqrt{y}, \left(\sqrt{x} + \sqrt{1 + x}\right) \cdot \left(1 + \left(y - y\right)\right)\right)}{\left(\sqrt{x} + \sqrt{\color{blue}{1 + 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. Simplified86.2%

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(x + \left(1 - x\right), \sqrt{1 + y} + \sqrt{y}, \left(\sqrt{x} + \sqrt{1 + x}\right) \cdot \left(1 + \left(y - y\right)\right)\right)}{\left(\sqrt{x} + \sqrt{1 + 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. Taylor expanded in y around inf 90.0%

      \[\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) \]
    10. Taylor expanded in z around inf 50.6%

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

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

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

Alternative 10: 91.8% accurate, 1.6× speedup?

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

\mathbf{elif}\;y \leq 26500000:\\
\;\;\;\;\left(t\_3 + \left(t\_2 + t\_4\right)\right) - t\_1\\

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


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

    1. Initial program 96.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.6499999999999999e-36 < y < 2.65e7

    1. Initial program 96.2%

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

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

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

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

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

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

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

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

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

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

    if 2.65e7 < y

    1. Initial program 79.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+79.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. associate-+l-79.1%

        \[\leadsto \color{blue}{\left(\sqrt{x + 1} - \left(\sqrt{x} - \left(\sqrt{y + 1} - \sqrt{y}\right)\right)\right)} + \left(\left(\sqrt{z + 1} - \sqrt{z}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)\right) \]
      3. associate-+l-79.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) \]
      4. +-commutative79.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. +-commutative79.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. +-commutative79.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. Simplified79.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--79.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--80.9%

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

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

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

        \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(\left(x + 1\right) - x, \sqrt{1 + y} + \sqrt{y}, \left(\sqrt{x + 1} + \sqrt{x}\right) \cdot \left(\left(1 + y\right) - y\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) \]
      2. associate--l+81.4%

        \[\leadsto \frac{\mathsf{fma}\left(\color{blue}{x + \left(1 - x\right)}, \sqrt{1 + y} + \sqrt{y}, \left(\sqrt{x + 1} + \sqrt{x}\right) \cdot \left(\left(1 + y\right) - y\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) \]
      3. +-commutative81.4%

        \[\leadsto \frac{\mathsf{fma}\left(x + \left(1 - x\right), \sqrt{1 + y} + \sqrt{y}, \color{blue}{\left(\sqrt{x} + \sqrt{x + 1}\right)} \cdot \left(\left(1 + y\right) - y\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) \]
      4. +-commutative81.4%

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

        \[\leadsto \frac{\mathsf{fma}\left(x + \left(1 - x\right), \sqrt{1 + y} + \sqrt{y}, \left(\sqrt{x} + \sqrt{1 + x}\right) \cdot \color{blue}{\left(1 + \left(y - y\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) \]
      6. +-commutative86.2%

        \[\leadsto \frac{\mathsf{fma}\left(x + \left(1 - x\right), \sqrt{1 + y} + \sqrt{y}, \left(\sqrt{x} + \sqrt{1 + x}\right) \cdot \left(1 + \left(y - y\right)\right)\right)}{\color{blue}{\left(\sqrt{x} + \sqrt{x + 1}\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. +-commutative86.2%

        \[\leadsto \frac{\mathsf{fma}\left(x + \left(1 - x\right), \sqrt{1 + y} + \sqrt{y}, \left(\sqrt{x} + \sqrt{1 + x}\right) \cdot \left(1 + \left(y - y\right)\right)\right)}{\left(\sqrt{x} + \sqrt{\color{blue}{1 + 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. Simplified86.2%

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(x + \left(1 - x\right), \sqrt{1 + y} + \sqrt{y}, \left(\sqrt{x} + \sqrt{1 + x}\right) \cdot \left(1 + \left(y - y\right)\right)\right)}{\left(\sqrt{x} + \sqrt{1 + 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. Taylor expanded in y around inf 90.0%

      \[\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) \]
    10. Taylor expanded in z around inf 50.6%

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

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

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

Alternative 11: 91.7% accurate, 1.6× speedup?

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

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

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


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

    1. Initial program 96.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+96.4%

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

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

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

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

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

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

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

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

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

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

    if 3.3999999999999998e-22 < y < 9e6

    1. Initial program 96.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 9e6 < y

    1. Initial program 79.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+79.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. associate-+l-79.2%

        \[\leadsto \color{blue}{\left(\sqrt{x + 1} - \left(\sqrt{x} - \left(\sqrt{y + 1} - \sqrt{y}\right)\right)\right)} + \left(\left(\sqrt{z + 1} - \sqrt{z}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)\right) \]
      3. associate-+l-79.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) \]
      4. +-commutative79.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. +-commutative79.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. +-commutative79.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. Simplified79.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--79.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--80.9%

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

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

        \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(\left(x + 1\right) - x, \sqrt{1 + y} + \sqrt{y}, \left(\sqrt{x + 1} + \sqrt{x}\right) \cdot \left(\left(1 + y\right) - y\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) \]
      2. associate--l+81.5%

        \[\leadsto \frac{\mathsf{fma}\left(\color{blue}{x + \left(1 - x\right)}, \sqrt{1 + y} + \sqrt{y}, \left(\sqrt{x + 1} + \sqrt{x}\right) \cdot \left(\left(1 + y\right) - y\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) \]
      3. +-commutative81.5%

        \[\leadsto \frac{\mathsf{fma}\left(x + \left(1 - x\right), \sqrt{1 + y} + \sqrt{y}, \color{blue}{\left(\sqrt{x} + \sqrt{x + 1}\right)} \cdot \left(\left(1 + y\right) - y\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) \]
      4. +-commutative81.5%

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

        \[\leadsto \frac{\mathsf{fma}\left(x + \left(1 - x\right), \sqrt{1 + y} + \sqrt{y}, \left(\sqrt{x} + \sqrt{1 + x}\right) \cdot \color{blue}{\left(1 + \left(y - y\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) \]
      6. +-commutative86.3%

        \[\leadsto \frac{\mathsf{fma}\left(x + \left(1 - x\right), \sqrt{1 + y} + \sqrt{y}, \left(\sqrt{x} + \sqrt{1 + x}\right) \cdot \left(1 + \left(y - y\right)\right)\right)}{\color{blue}{\left(\sqrt{x} + \sqrt{x + 1}\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. +-commutative86.3%

        \[\leadsto \frac{\mathsf{fma}\left(x + \left(1 - x\right), \sqrt{1 + y} + \sqrt{y}, \left(\sqrt{x} + \sqrt{1 + x}\right) \cdot \left(1 + \left(y - y\right)\right)\right)}{\left(\sqrt{x} + \sqrt{\color{blue}{1 + 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. Simplified86.3%

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(x + \left(1 - x\right), \sqrt{1 + y} + \sqrt{y}, \left(\sqrt{x} + \sqrt{1 + x}\right) \cdot \left(1 + \left(y - y\right)\right)\right)}{\left(\sqrt{x} + \sqrt{1 + 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. Taylor expanded in y around inf 90.0%

      \[\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) \]
    10. Taylor expanded in z around inf 50.3%

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

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

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

Alternative 12: 82.6% accurate, 2.0× speedup?

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

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


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

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

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

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

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

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

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

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

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

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

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

    if 1.82000000000000006 < z

    1. Initial program 79.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+79.9%

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

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

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

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

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

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

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

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

Alternative 13: 54.5% accurate, 2.5× speedup?

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

\mathbf{else}:\\
\;\;\;\;t\_1 - \sqrt{x}\\


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

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

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

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

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

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

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

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

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

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

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

    if 2.10000000000000009 < z

    1. Initial program 79.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+79.9%

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

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

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

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

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

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

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

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

Alternative 14: 52.5% accurate, 2.5× speedup?

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

\mathbf{else}:\\
\;\;\;\;t\_1 - \sqrt{x}\\


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

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

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

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

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

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

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

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

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

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

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

    if 6.20000000000000018 < z

    1. Initial program 79.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+79.9%

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

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

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

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

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

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

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

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

Alternative 15: 35.0% accurate, 4.0× speedup?

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

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

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

      \[\leadsto \color{blue}{\left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{y + 1} - \sqrt{y}\right)\right)} + \left(\left(\sqrt{z + 1} - \sqrt{z}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)\right) \]
    4. +-commutative88.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. +-commutative88.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. +-commutative88.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. Simplified88.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 13.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+23.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. Simplified23.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 15.3%

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

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

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

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

Alternative 16: 3.3% accurate, 7.8× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{y \cdot \left(0.5 - \sqrt{\frac{1}{y}}\right)} \]
  9. Taylor expanded in y around 0 3.7%

    \[\leadsto \color{blue}{-1 \cdot \sqrt{y} + 0.5 \cdot y} \]
  10. Step-by-step derivation
    1. mul-1-neg3.7%

      \[\leadsto \color{blue}{\left(-\sqrt{y}\right)} + 0.5 \cdot y \]
    2. +-commutative3.7%

      \[\leadsto \color{blue}{0.5 \cdot y + \left(-\sqrt{y}\right)} \]
    3. sub-neg3.7%

      \[\leadsto \color{blue}{0.5 \cdot y - \sqrt{y}} \]
    4. *-commutative3.7%

      \[\leadsto \color{blue}{y \cdot 0.5} - \sqrt{y} \]
  11. Simplified3.7%

    \[\leadsto \color{blue}{y \cdot 0.5 - \sqrt{y}} \]
  12. Final simplification3.7%

    \[\leadsto 0.5 \cdot y - \sqrt{y} \]
  13. Add Preprocessing

Alternative 17: 2.5% accurate, 7.8× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{y \cdot \left(0.5 - \sqrt{\frac{1}{y}}\right)} \]
  9. Taylor expanded in y around 0 1.6%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 18: 1.7% accurate, 8.1× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{y \cdot \left(0.5 - \sqrt{\frac{1}{y}}\right)} \]
  9. Taylor expanded in y around 0 1.6%

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

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

    \[\leadsto \color{blue}{-\sqrt{y}} \]
  12. Add Preprocessing

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

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

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

Reproduce

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