\[ \begin{array}{c}[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\ \end{array} \]
\[\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)
\]
↓
\[\begin{array}{l}
t_1 := \sqrt{1 + x}\\
t_2 := \sqrt{1 + z}\\
t_3 := t_2 - \sqrt{z}\\
t_4 := \sqrt{1 + y}\\
\mathbf{if}\;t_3 \leq 0.02:\\
\;\;\;\;\frac{1}{t_2 + \sqrt{z}} + \left(\frac{1}{t_1 + \sqrt{x}} + \frac{1}{t_4 + \sqrt{y}}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(t_1 - \sqrt{x}\right) + \left(\left(t_4 - \sqrt{y}\right) + \left(t_3 + \frac{1}{\sqrt{1 + t} + \sqrt{t}}\right)\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))))
↓
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ 1.0 x)))
(t_2 (sqrt (+ 1.0 z)))
(t_3 (- t_2 (sqrt z)))
(t_4 (sqrt (+ 1.0 y))))
(if (<= t_3 0.02)
(+
(/ 1.0 (+ t_2 (sqrt z)))
(+ (/ 1.0 (+ t_1 (sqrt x))) (/ 1.0 (+ t_4 (sqrt y)))))
(+
(- t_1 (sqrt x))
(+ (- t_4 (sqrt y)) (+ t_3 (/ 1.0 (+ (sqrt (+ 1.0 t)) (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));
}
↓
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + x));
double t_2 = sqrt((1.0 + z));
double t_3 = t_2 - sqrt(z);
double t_4 = sqrt((1.0 + y));
double tmp;
if (t_3 <= 0.02) {
tmp = (1.0 / (t_2 + sqrt(z))) + ((1.0 / (t_1 + sqrt(x))) + (1.0 / (t_4 + sqrt(y))));
} else {
tmp = (t_1 - sqrt(x)) + ((t_4 - sqrt(y)) + (t_3 + (1.0 / (sqrt((1.0 + t)) + sqrt(t)))));
}
return tmp;
}
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
↓
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: tmp
t_1 = sqrt((1.0d0 + x))
t_2 = sqrt((1.0d0 + z))
t_3 = t_2 - sqrt(z)
t_4 = sqrt((1.0d0 + y))
if (t_3 <= 0.02d0) then
tmp = (1.0d0 / (t_2 + sqrt(z))) + ((1.0d0 / (t_1 + sqrt(x))) + (1.0d0 / (t_4 + sqrt(y))))
else
tmp = (t_1 - sqrt(x)) + ((t_4 - sqrt(y)) + (t_3 + (1.0d0 / (sqrt((1.0d0 + t)) + sqrt(t)))))
end if
code = tmp
end function
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));
}
↓
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + x));
double t_2 = Math.sqrt((1.0 + z));
double t_3 = t_2 - Math.sqrt(z);
double t_4 = Math.sqrt((1.0 + y));
double tmp;
if (t_3 <= 0.02) {
tmp = (1.0 / (t_2 + Math.sqrt(z))) + ((1.0 / (t_1 + Math.sqrt(x))) + (1.0 / (t_4 + Math.sqrt(y))));
} else {
tmp = (t_1 - Math.sqrt(x)) + ((t_4 - Math.sqrt(y)) + (t_3 + (1.0 / (Math.sqrt((1.0 + t)) + Math.sqrt(t)))));
}
return tmp;
}
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))
↓
def code(x, y, z, t):
t_1 = math.sqrt((1.0 + x))
t_2 = math.sqrt((1.0 + z))
t_3 = t_2 - math.sqrt(z)
t_4 = math.sqrt((1.0 + y))
tmp = 0
if t_3 <= 0.02:
tmp = (1.0 / (t_2 + math.sqrt(z))) + ((1.0 / (t_1 + math.sqrt(x))) + (1.0 / (t_4 + math.sqrt(y))))
else:
tmp = (t_1 - math.sqrt(x)) + ((t_4 - math.sqrt(y)) + (t_3 + (1.0 / (math.sqrt((1.0 + t)) + math.sqrt(t)))))
return tmp
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 code(x, y, z, t)
t_1 = sqrt(Float64(1.0 + x))
t_2 = sqrt(Float64(1.0 + z))
t_3 = Float64(t_2 - sqrt(z))
t_4 = sqrt(Float64(1.0 + y))
tmp = 0.0
if (t_3 <= 0.02)
tmp = Float64(Float64(1.0 / Float64(t_2 + sqrt(z))) + Float64(Float64(1.0 / Float64(t_1 + sqrt(x))) + Float64(1.0 / Float64(t_4 + sqrt(y)))));
else
tmp = Float64(Float64(t_1 - sqrt(x)) + Float64(Float64(t_4 - sqrt(y)) + Float64(t_3 + Float64(1.0 / Float64(sqrt(Float64(1.0 + t)) + sqrt(t))))));
end
return tmp
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
↓
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + x));
t_2 = sqrt((1.0 + z));
t_3 = t_2 - sqrt(z);
t_4 = sqrt((1.0 + y));
tmp = 0.0;
if (t_3 <= 0.02)
tmp = (1.0 / (t_2 + sqrt(z))) + ((1.0 / (t_1 + sqrt(x))) + (1.0 / (t_4 + sqrt(y))));
else
tmp = (t_1 - sqrt(x)) + ((t_4 - sqrt(y)) + (t_3 + (1.0 / (sqrt((1.0 + t)) + sqrt(t)))));
end
tmp_2 = tmp;
end
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]
↓
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[(t$95$2 - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t$95$3, 0.02], N[(N[(1.0 / N[(t$95$2 + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 / N[(t$95$1 + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(t$95$4 + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(t$95$1 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$4 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision] + N[(t$95$3 + N[(1.0 / N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] + N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\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)
↓
\begin{array}{l}
t_1 := \sqrt{1 + x}\\
t_2 := \sqrt{1 + z}\\
t_3 := t_2 - \sqrt{z}\\
t_4 := \sqrt{1 + y}\\
\mathbf{if}\;t_3 \leq 0.02:\\
\;\;\;\;\frac{1}{t_2 + \sqrt{z}} + \left(\frac{1}{t_1 + \sqrt{x}} + \frac{1}{t_4 + \sqrt{y}}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(t_1 - \sqrt{x}\right) + \left(\left(t_4 - \sqrt{y}\right) + \left(t_3 + \frac{1}{\sqrt{1 + t} + \sqrt{t}}\right)\right)\\
\end{array}
Alternatives
| Alternative 1 |
|---|
| Error | 0.4 |
|---|
| Cost | 53056 |
|---|
\[\frac{1}{\sqrt{1 + x} + \sqrt{x}} + \left(\frac{1}{\sqrt{1 + y} + \sqrt{y}} + \left(\left(\sqrt{1 + t} - \sqrt{t}\right) + \frac{1}{\sqrt{1 + z} + \sqrt{z}}\right)\right)
\]
| Alternative 2 |
|---|
| Error | 0.5 |
|---|
| Cost | 40004 |
|---|
\[\begin{array}{l}
t_1 := \sqrt{1 + y}\\
t_2 := \sqrt{1 + x}\\
\mathbf{if}\;t \leq 6.8 \cdot 10^{+27}:\\
\;\;\;\;\left(t_2 - \sqrt{x}\right) + \left(\left(t_1 - \sqrt{y}\right) + \left(1 + \frac{1}{\sqrt{1 + t} + \sqrt{t}}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{1 + z} + \sqrt{z}} + \left(\frac{1}{t_2 + \sqrt{x}} + \frac{1}{t_1 + \sqrt{y}}\right)\\
\end{array}
\]
| Alternative 3 |
|---|
| Error | 6.6 |
|---|
| Cost | 39880 |
|---|
\[\begin{array}{l}
t_1 := \sqrt{1 + y}\\
\mathbf{if}\;z \leq 2.75 \cdot 10^{-114}:\\
\;\;\;\;3 - \sqrt{y}\\
\mathbf{elif}\;z \leq 4 \cdot 10^{-97}:\\
\;\;\;\;1 + \left(\left(\sqrt{1 + z} + \sqrt{1 + t}\right) + \left(t_1 - \left(\sqrt{z} + \left(\sqrt{y} + \sqrt{t}\right)\right)\right)\right)\\
\mathbf{elif}\;z \leq 3.1 \cdot 10^{+19}:\\
\;\;\;\;\left(1 + \left(1 + \mathsf{hypot}\left(1, \sqrt{z}\right)\right)\right) - \left(\sqrt{y} + \sqrt{z}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{1 + x} + \sqrt{x}} + \left(t_1 - \sqrt{y}\right)\\
\end{array}
\]
| Alternative 4 |
|---|
| Error | 1.4 |
|---|
| Cost | 39876 |
|---|
\[\begin{array}{l}
t_1 := \sqrt{1 + y}\\
t_2 := \sqrt{1 + x}\\
\mathbf{if}\;t \leq 6.8 \cdot 10^{+27}:\\
\;\;\;\;\left(t_2 - \sqrt{x}\right) + \left(\left(t_1 - \sqrt{y}\right) + \left(1 + \frac{1}{\sqrt{1 + t} + \sqrt{t}}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{t_2 + \sqrt{x}} + \left(\frac{1}{t_1 + \sqrt{y}} + \left(\sqrt{1 + z} - \sqrt{z}\right)\right)\\
\end{array}
\]
| Alternative 5 |
|---|
| Error | 2.8 |
|---|
| Cost | 39748 |
|---|
\[\begin{array}{l}
t_1 := \sqrt{1 + y}\\
t_2 := \sqrt{1 + z}\\
\mathbf{if}\;z \leq 1.9 \cdot 10^{-21}:\\
\;\;\;\;1 + \left(\left(t_1 + t_2\right) + \left(\left(\sqrt{1 + t} - \sqrt{z}\right) - \left(\sqrt{y} + \sqrt{t}\right)\right)\right)\\
\mathbf{elif}\;z \leq 3.1 \cdot 10^{+19}:\\
\;\;\;\;1 + \left(t_2 + \left(t_1 - \left(\sqrt{y} + \sqrt{z}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{1 + x} + \sqrt{x}} + \left(t_1 - \sqrt{y}\right)\\
\end{array}
\]
| Alternative 6 |
|---|
| Error | 2.9 |
|---|
| Cost | 39748 |
|---|
\[\begin{array}{l}
t_1 := \sqrt{1 + x}\\
\mathbf{if}\;z \leq 3.1 \cdot 10^{+19}:\\
\;\;\;\;\left(t_1 - \sqrt{x}\right) + \left(1 + \left(\left(\sqrt{1 + t} - \sqrt{t}\right) + \left(\sqrt{1 + z} - \sqrt{z}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{t_1 + \sqrt{x}} + \left(\sqrt{1 + y} - \sqrt{y}\right)\\
\end{array}
\]
| Alternative 7 |
|---|
| Error | 6.0 |
|---|
| Cost | 39620 |
|---|
\[\begin{array}{l}
t_1 := \sqrt{1 + x}\\
t_2 := \sqrt{1 + y}\\
\mathbf{if}\;y \leq 1.12 \cdot 10^{-12}:\\
\;\;\;\;\left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(t_1 + t_2\right)\right) - \left(\sqrt{x} + \sqrt{y}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{t_1 + \sqrt{x}} + \left(t_2 - \sqrt{y}\right)\\
\end{array}
\]
| Alternative 8 |
|---|
| Error | 6.2 |
|---|
| Cost | 26568 |
|---|
\[\begin{array}{l}
t_1 := \sqrt{1 + x}\\
\mathbf{if}\;y \leq 2.4 \cdot 10^{-21}:\\
\;\;\;\;\left(\left(\sqrt{1 + z} - \sqrt{z}\right) + 2\right) - \sqrt{y}\\
\mathbf{elif}\;y \leq 4 \cdot 10^{+24}:\\
\;\;\;\;\left(t_1 + \sqrt{1 + y}\right) - \left(\sqrt{x} + \sqrt{y}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{t_1 + \sqrt{x}}\\
\end{array}
\]
| Alternative 9 |
|---|
| Error | 6.1 |
|---|
| Cost | 26568 |
|---|
\[\begin{array}{l}
t_1 := \sqrt{1 + x}\\
\mathbf{if}\;y \leq 1.12 \cdot 10^{-12}:\\
\;\;\;\;\left(\left(\sqrt{1 + z} - \sqrt{z}\right) + 2\right) - \sqrt{y}\\
\mathbf{elif}\;y \leq 2.5 \cdot 10^{+24}:\\
\;\;\;\;\left(\sqrt{1 + y} + \left(t_1 - \sqrt{y}\right)\right) - \sqrt{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{t_1 + \sqrt{x}}\\
\end{array}
\]
| Alternative 10 |
|---|
| Error | 6.1 |
|---|
| Cost | 26564 |
|---|
\[\begin{array}{l}
\mathbf{if}\;y \leq 2.5 \cdot 10^{-13}:\\
\;\;\;\;\left(\left(\sqrt{1 + z} - \sqrt{z}\right) + 2\right) - \sqrt{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{1 + x} + \sqrt{x}} + \left(\sqrt{1 + y} - \sqrt{y}\right)\\
\end{array}
\]
| Alternative 11 |
|---|
| Error | 6.3 |
|---|
| Cost | 19908 |
|---|
\[\begin{array}{l}
\mathbf{if}\;y \leq 7.2 \cdot 10^{-13}:\\
\;\;\;\;\left(\left(\sqrt{1 + z} - \sqrt{z}\right) + 2\right) - \sqrt{y}\\
\mathbf{elif}\;y \leq 4 \cdot 10^{+24}:\\
\;\;\;\;1 + \left(\sqrt{1 + y} - \sqrt{y}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{1 + x} + \sqrt{x}}\\
\end{array}
\]
| Alternative 12 |
|---|
| Error | 6.6 |
|---|
| Cost | 13512 |
|---|
\[\begin{array}{l}
\mathbf{if}\;y \leq 2.2 \cdot 10^{-21}:\\
\;\;\;\;\left(\sqrt{1 + z} - \sqrt{z}\right) + 2\\
\mathbf{elif}\;y \leq 4.2 \cdot 10^{+24}:\\
\;\;\;\;1 + \left(\sqrt{1 + y} - \sqrt{y}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{1 + x} + \sqrt{x}}\\
\end{array}
\]
| Alternative 13 |
|---|
| Error | 12.5 |
|---|
| Cost | 13380 |
|---|
\[\begin{array}{l}
\mathbf{if}\;z \leq 0.45:\\
\;\;\;\;3 - \sqrt{y}\\
\mathbf{else}:\\
\;\;\;\;1 + \left(\sqrt{1 + y} - \sqrt{y}\right)\\
\end{array}
\]
| Alternative 14 |
|---|
| Error | 10.2 |
|---|
| Cost | 13380 |
|---|
\[\begin{array}{l}
\mathbf{if}\;z \leq 3.1 \cdot 10^{+19}:\\
\;\;\;\;\left(\sqrt{1 + z} - \sqrt{z}\right) + 2\\
\mathbf{else}:\\
\;\;\;\;1 + \left(\sqrt{1 + y} - \sqrt{y}\right)\\
\end{array}
\]
| Alternative 15 |
|---|
| Error | 30.0 |
|---|
| Cost | 13252 |
|---|
\[\begin{array}{l}
\mathbf{if}\;y \leq 4:\\
\;\;\;\;3 - \sqrt{y}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{1 + x} - \sqrt{x}\\
\end{array}
\]
| Alternative 16 |
|---|
| Error | 30.4 |
|---|
| Cost | 6980 |
|---|
\[\begin{array}{l}
\mathbf{if}\;y \leq 5.1:\\
\;\;\;\;3 - \sqrt{y}\\
\mathbf{else}:\\
\;\;\;\;\left(1 + x \cdot 0.5\right) - \sqrt{x}\\
\end{array}
\]
| Alternative 17 |
|---|
| Error | 30.8 |
|---|
| Cost | 6724 |
|---|
\[\begin{array}{l}
\mathbf{if}\;y \leq 4:\\
\;\;\;\;3 - \sqrt{y}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\]
| Alternative 18 |
|---|
| Error | 41.8 |
|---|
| Cost | 64 |
|---|
\[1
\]