\[ \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 + t}\\
t_2 := \sqrt{1 + x}\\
t_3 := \sqrt{1 + y}\\
t_4 := \sqrt{1 + z}\\
\mathbf{if}\;z \leq 2.35 \cdot 10^{+30}:\\
\;\;\;\;\left(\frac{1}{t_4 + \sqrt{z}} + \left(\left(t_2 - \sqrt{x}\right) + \left(t_3 - \sqrt{y}\right)\right)\right) + \frac{1 + \left(t - t\right)}{\sqrt{t} + t_1}\\
\mathbf{else}:\\
\;\;\;\;\left(t_1 - \sqrt{t}\right) + \left(\left(\frac{1}{\sqrt{x} + t_2} + \frac{1}{t_3 + \sqrt{y}}\right) + \left(t_4 - \sqrt{z}\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 t)))
(t_2 (sqrt (+ 1.0 x)))
(t_3 (sqrt (+ 1.0 y)))
(t_4 (sqrt (+ 1.0 z))))
(if (<= z 2.35e+30)
(+
(+ (/ 1.0 (+ t_4 (sqrt z))) (+ (- t_2 (sqrt x)) (- t_3 (sqrt y))))
(/ (+ 1.0 (- t t)) (+ (sqrt t) t_1)))
(+
(- t_1 (sqrt t))
(+
(+ (/ 1.0 (+ (sqrt x) t_2)) (/ 1.0 (+ t_3 (sqrt y))))
(- t_4 (sqrt z)))))))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 + t));
double t_2 = sqrt((1.0 + x));
double t_3 = sqrt((1.0 + y));
double t_4 = sqrt((1.0 + z));
double tmp;
if (z <= 2.35e+30) {
tmp = ((1.0 / (t_4 + sqrt(z))) + ((t_2 - sqrt(x)) + (t_3 - sqrt(y)))) + ((1.0 + (t - t)) / (sqrt(t) + t_1));
} else {
tmp = (t_1 - sqrt(t)) + (((1.0 / (sqrt(x) + t_2)) + (1.0 / (t_3 + sqrt(y)))) + (t_4 - sqrt(z)));
}
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 + t))
t_2 = sqrt((1.0d0 + x))
t_3 = sqrt((1.0d0 + y))
t_4 = sqrt((1.0d0 + z))
if (z <= 2.35d+30) then
tmp = ((1.0d0 / (t_4 + sqrt(z))) + ((t_2 - sqrt(x)) + (t_3 - sqrt(y)))) + ((1.0d0 + (t - t)) / (sqrt(t) + t_1))
else
tmp = (t_1 - sqrt(t)) + (((1.0d0 / (sqrt(x) + t_2)) + (1.0d0 / (t_3 + sqrt(y)))) + (t_4 - sqrt(z)))
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 + t));
double t_2 = Math.sqrt((1.0 + x));
double t_3 = Math.sqrt((1.0 + y));
double t_4 = Math.sqrt((1.0 + z));
double tmp;
if (z <= 2.35e+30) {
tmp = ((1.0 / (t_4 + Math.sqrt(z))) + ((t_2 - Math.sqrt(x)) + (t_3 - Math.sqrt(y)))) + ((1.0 + (t - t)) / (Math.sqrt(t) + t_1));
} else {
tmp = (t_1 - Math.sqrt(t)) + (((1.0 / (Math.sqrt(x) + t_2)) + (1.0 / (t_3 + Math.sqrt(y)))) + (t_4 - Math.sqrt(z)));
}
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 + t))
t_2 = math.sqrt((1.0 + x))
t_3 = math.sqrt((1.0 + y))
t_4 = math.sqrt((1.0 + z))
tmp = 0
if z <= 2.35e+30:
tmp = ((1.0 / (t_4 + math.sqrt(z))) + ((t_2 - math.sqrt(x)) + (t_3 - math.sqrt(y)))) + ((1.0 + (t - t)) / (math.sqrt(t) + t_1))
else:
tmp = (t_1 - math.sqrt(t)) + (((1.0 / (math.sqrt(x) + t_2)) + (1.0 / (t_3 + math.sqrt(y)))) + (t_4 - math.sqrt(z)))
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 + t))
t_2 = sqrt(Float64(1.0 + x))
t_3 = sqrt(Float64(1.0 + y))
t_4 = sqrt(Float64(1.0 + z))
tmp = 0.0
if (z <= 2.35e+30)
tmp = Float64(Float64(Float64(1.0 / Float64(t_4 + sqrt(z))) + Float64(Float64(t_2 - sqrt(x)) + Float64(t_3 - sqrt(y)))) + Float64(Float64(1.0 + Float64(t - t)) / Float64(sqrt(t) + t_1)));
else
tmp = Float64(Float64(t_1 - sqrt(t)) + Float64(Float64(Float64(1.0 / Float64(sqrt(x) + t_2)) + Float64(1.0 / Float64(t_3 + sqrt(y)))) + Float64(t_4 - sqrt(z))));
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 + t));
t_2 = sqrt((1.0 + x));
t_3 = sqrt((1.0 + y));
t_4 = sqrt((1.0 + z));
tmp = 0.0;
if (z <= 2.35e+30)
tmp = ((1.0 / (t_4 + sqrt(z))) + ((t_2 - sqrt(x)) + (t_3 - sqrt(y)))) + ((1.0 + (t - t)) / (sqrt(t) + t_1));
else
tmp = (t_1 - sqrt(t)) + (((1.0 / (sqrt(x) + t_2)) + (1.0 / (t_3 + sqrt(y)))) + (t_4 - sqrt(z)));
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 + t), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$4 = N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[z, 2.35e+30], N[(N[(N[(1.0 / N[(t$95$4 + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$2 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(t$95$3 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 + N[(t - t), $MachinePrecision]), $MachinePrecision] / N[(N[Sqrt[t], $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(t$95$1 - N[Sqrt[t], $MachinePrecision]), $MachinePrecision] + N[(N[(N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + t$95$2), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(t$95$3 + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$4 - N[Sqrt[z], $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 + t}\\
t_2 := \sqrt{1 + x}\\
t_3 := \sqrt{1 + y}\\
t_4 := \sqrt{1 + z}\\
\mathbf{if}\;z \leq 2.35 \cdot 10^{+30}:\\
\;\;\;\;\left(\frac{1}{t_4 + \sqrt{z}} + \left(\left(t_2 - \sqrt{x}\right) + \left(t_3 - \sqrt{y}\right)\right)\right) + \frac{1 + \left(t - t\right)}{\sqrt{t} + t_1}\\
\mathbf{else}:\\
\;\;\;\;\left(t_1 - \sqrt{t}\right) + \left(\left(\frac{1}{\sqrt{x} + t_2} + \frac{1}{t_3 + \sqrt{y}}\right) + \left(t_4 - \sqrt{z}\right)\right)\\
\end{array}
Alternatives
| Alternative 1 |
|---|
| Error | 1.77% |
|---|
| Cost | 105544 |
|---|
\[\begin{array}{l}
t_1 := \sqrt{1 + t} - \sqrt{t}\\
t_2 := \sqrt{1 + x}\\
t_3 := \frac{1}{\sqrt{1 + z} + \sqrt{z}}\\
t_4 := \sqrt{1 + y}\\
t_5 := \left(t_2 - \sqrt{x}\right) + \left(t_4 - \sqrt{y}\right)\\
\mathbf{if}\;t_5 \leq 0.9999999999999986:\\
\;\;\;\;t_1 + \left(t_3 + \frac{1}{\sqrt{x} + t_2}\right)\\
\mathbf{elif}\;t_5 \leq 1.05:\\
\;\;\;\;t_1 + \left(t_3 + \left(1 + \frac{1}{t_4 + \sqrt{y}}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_1 + \left(t_3 + t_5\right)\\
\end{array}
\]
| Alternative 2 |
|---|
| Error | 1.93% |
|---|
| Cost | 66244 |
|---|
\[\begin{array}{l}
t_1 := \sqrt{1 + t} - \sqrt{t}\\
t_2 := \sqrt{1 + x}\\
t_3 := \frac{1}{\sqrt{1 + z} + \sqrt{z}}\\
t_4 := \sqrt{1 + y}\\
\mathbf{if}\;\left(t_2 - \sqrt{x}\right) + \left(t_4 - \sqrt{y}\right) \leq 0.9999999999999986:\\
\;\;\;\;t_1 + \left(t_3 + \frac{1}{\sqrt{x} + t_2}\right)\\
\mathbf{else}:\\
\;\;\;\;t_1 + \left(t_3 + \left(1 + \frac{1}{t_4 + \sqrt{y}}\right)\right)\\
\end{array}
\]
| Alternative 3 |
|---|
| Error | 0.62% |
|---|
| Cost | 53056 |
|---|
\[\left(\left(\frac{1}{\sqrt{x} + \sqrt{1 + x}} + \frac{1}{\sqrt{1 + y} + \sqrt{y}}\right) + \frac{1}{\sqrt{1 + z} + \sqrt{z}}\right) + \left(\sqrt{1 + t} - \sqrt{t}\right)
\]
| Alternative 4 |
|---|
| Error | 1.96% |
|---|
| Cost | 52928 |
|---|
\[\left(\sqrt{1 + t} - \sqrt{t}\right) + \left(\left(\frac{1}{\sqrt{x} + \sqrt{1 + x}} + \frac{1}{\sqrt{1 + y} + \sqrt{y}}\right) + \left(\sqrt{1 + z} - \sqrt{z}\right)\right)
\]
| Alternative 5 |
|---|
| Error | 2.11% |
|---|
| Cost | 40004 |
|---|
\[\begin{array}{l}
t_1 := \sqrt{1 + z}\\
t_2 := \sqrt{1 + t} - \sqrt{t}\\
\mathbf{if}\;y \leq 4.6 \cdot 10^{+27}:\\
\;\;\;\;t_2 + \left(\frac{1}{t_1 + \sqrt{z}} + \left(1 + \frac{1}{\sqrt{1 + y} + \sqrt{y}}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_2 + \left(\left(t_1 - \sqrt{z}\right) + \frac{1}{\sqrt{x} + \sqrt{1 + x}}\right)\\
\end{array}
\]
| Alternative 6 |
|---|
| Error | 2.91% |
|---|
| Cost | 39880 |
|---|
\[\begin{array}{l}
t_1 := \sqrt{1 + z}\\
t_2 := \sqrt{1 + x}\\
t_3 := \sqrt{1 + t} - \sqrt{t}\\
\mathbf{if}\;y \leq 5 \cdot 10^{-25}:\\
\;\;\;\;t_3 + \left(\frac{1}{t_1 + \sqrt{z}} + \left(1 + \left(t_2 - \sqrt{x}\right)\right)\right)\\
\mathbf{elif}\;y \leq 7.8 \cdot 10^{+59}:\\
\;\;\;\;t_2 + \left(\frac{1}{\sqrt{1 + y} + \sqrt{y}} + \left(t_3 - \sqrt{x}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_3 + \left(\left(t_1 - \sqrt{z}\right) + \frac{1}{\sqrt{x} + t_2}\right)\\
\end{array}
\]
| Alternative 7 |
|---|
| Error | 6.65% |
|---|
| Cost | 39876 |
|---|
\[\begin{array}{l}
t_1 := \sqrt{1 + x}\\
t_2 := \sqrt{1 + t} - \sqrt{t}\\
\mathbf{if}\;y \leq 4.5 \cdot 10^{-25}:\\
\;\;\;\;t_2 + \left(\frac{1}{\sqrt{1 + z} + \sqrt{z}} + \left(1 + \left(t_1 - \sqrt{x}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_1 + \left(\frac{1}{\sqrt{1 + y} + \sqrt{y}} + \left(t_2 - \sqrt{x}\right)\right)\\
\end{array}
\]
| Alternative 8 |
|---|
| Error | 10% |
|---|
| Cost | 39748 |
|---|
\[\begin{array}{l}
t_1 := \sqrt{1 + x}\\
t_2 := \sqrt{1 + y} - \sqrt{y}\\
\mathbf{if}\;t \leq 1300000000:\\
\;\;\;\;t_1 + \left(t_2 + \left(\left(1 + \sqrt{1 + t}\right) - \left(\sqrt{x} + \sqrt{t}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_1 + \left(t_2 + \left(\sqrt{1 + z} - \left(\sqrt{x} + \sqrt{z}\right)\right)\right)\\
\end{array}
\]
| Alternative 9 |
|---|
| Error | 7.6% |
|---|
| Cost | 39748 |
|---|
\[\begin{array}{l}
t_1 := \sqrt{1 + x}\\
t_2 := \sqrt{1 + t} - \sqrt{t}\\
\mathbf{if}\;y \leq 5 \cdot 10^{-25}:\\
\;\;\;\;t_2 + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(1 + \left(t_1 - \sqrt{x}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_1 + \left(\frac{1}{\sqrt{1 + y} + \sqrt{y}} + \left(t_2 - \sqrt{x}\right)\right)\\
\end{array}
\]
| Alternative 10 |
|---|
| Error | 13.99% |
|---|
| Cost | 39620 |
|---|
\[\begin{array}{l}
t_1 := \sqrt{1 + y}\\
\mathbf{if}\;z \leq 2.25 \cdot 10^{+14}:\\
\;\;\;\;\left(1 + \left(t_1 + {\left(1 + z\right)}^{0.5}\right)\right) - \left(\sqrt{y} + \sqrt{z}\right)\\
\mathbf{else}:\\
\;\;\;\;\sqrt{1 + x} + \left(\left(t_1 - \sqrt{y}\right) + \left(\left(\sqrt{1 + t} - \sqrt{t}\right) - \sqrt{x}\right)\right)\\
\end{array}
\]
| Alternative 11 |
|---|
| Error | 15.32% |
|---|
| Cost | 26628 |
|---|
\[\begin{array}{l}
t_1 := \sqrt{1 + y}\\
\mathbf{if}\;z \leq 2.2 \cdot 10^{+14}:\\
\;\;\;\;\left(1 + \left(t_1 + {\left(1 + z\right)}^{0.5}\right)\right) - \left(\sqrt{y} + \sqrt{z}\right)\\
\mathbf{else}:\\
\;\;\;\;\sqrt{1 + x} + \left(t_1 - \left(\sqrt{x} + \sqrt{y}\right)\right)\\
\end{array}
\]
| Alternative 12 |
|---|
| Error | 15.3% |
|---|
| Cost | 26564 |
|---|
\[\begin{array}{l}
t_1 := \sqrt{1 + y}\\
\mathbf{if}\;z \leq 3.8 \cdot 10^{+14}:\\
\;\;\;\;1 + \left(\sqrt{1 + z} + \left(t_1 - \left(\sqrt{y} + \sqrt{z}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\sqrt{1 + x} + \left(t_1 - \left(\sqrt{x} + \sqrt{y}\right)\right)\\
\end{array}
\]
| Alternative 13 |
|---|
| Error | 15.97% |
|---|
| Cost | 26436 |
|---|
\[\begin{array}{l}
\mathbf{if}\;y \leq 4 \cdot 10^{-25}:\\
\;\;\;\;\left(\sqrt{1 + z} - \sqrt{z}\right) + 2\\
\mathbf{else}:\\
\;\;\;\;\sqrt{1 + x} + \left(\sqrt{1 + y} - \left(\sqrt{x} + \sqrt{y}\right)\right)\\
\end{array}
\]
| Alternative 14 |
|---|
| Error | 16.15% |
|---|
| Cost | 13512 |
|---|
\[\begin{array}{l}
\mathbf{if}\;y \leq 3.5 \cdot 10^{-25}:\\
\;\;\;\;\left(\sqrt{1 + z} - \sqrt{z}\right) + 2\\
\mathbf{elif}\;y \leq 10^{+31}:\\
\;\;\;\;\sqrt{1 + y} + \left(1 - \sqrt{y}\right)\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\]
| Alternative 15 |
|---|
| Error | 19.53% |
|---|
| Cost | 13380 |
|---|
\[\begin{array}{l}
t_1 := \sqrt{1 + z} - \sqrt{z}\\
\mathbf{if}\;y \leq 0.55:\\
\;\;\;\;t_1 + 2\\
\mathbf{else}:\\
\;\;\;\;1 + t_1\\
\end{array}
\]
| Alternative 16 |
|---|
| Error | 64.74% |
|---|
| Cost | 13248 |
|---|
\[1 + \left(\sqrt{1 + z} - \sqrt{z}\right)
\]
| Alternative 17 |
|---|
| Error | 65.48% |
|---|
| Cost | 64 |
|---|
\[1
\]