\[ \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 + y}\\
t_3 := \frac{1}{t_2 + \sqrt{y}}\\
t_4 := \frac{1}{\sqrt{1 + z} + \sqrt{z}}\\
\mathbf{if}\;t_2 - \sqrt{y} \leq 5 \cdot 10^{-8}:\\
\;\;\;\;\frac{1}{\sqrt{x} + t_1} + \left(t_3 + t_4\right)\\
\mathbf{else}:\\
\;\;\;\;\left(t_1 - \sqrt{x}\right) + \left(t_3 + \left(t_4 + \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 y)))
(t_3 (/ 1.0 (+ t_2 (sqrt y))))
(t_4 (/ 1.0 (+ (sqrt (+ 1.0 z)) (sqrt z)))))
(if (<= (- t_2 (sqrt y)) 5e-8)
(+ (/ 1.0 (+ (sqrt x) t_1)) (+ t_3 t_4))
(+
(- t_1 (sqrt x))
(+ t_3 (+ t_4 (/ 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 + y));
double t_3 = 1.0 / (t_2 + sqrt(y));
double t_4 = 1.0 / (sqrt((1.0 + z)) + sqrt(z));
double tmp;
if ((t_2 - sqrt(y)) <= 5e-8) {
tmp = (1.0 / (sqrt(x) + t_1)) + (t_3 + t_4);
} else {
tmp = (t_1 - sqrt(x)) + (t_3 + (t_4 + (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 + y))
t_3 = 1.0d0 / (t_2 + sqrt(y))
t_4 = 1.0d0 / (sqrt((1.0d0 + z)) + sqrt(z))
if ((t_2 - sqrt(y)) <= 5d-8) then
tmp = (1.0d0 / (sqrt(x) + t_1)) + (t_3 + t_4)
else
tmp = (t_1 - sqrt(x)) + (t_3 + (t_4 + (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 + y));
double t_3 = 1.0 / (t_2 + Math.sqrt(y));
double t_4 = 1.0 / (Math.sqrt((1.0 + z)) + Math.sqrt(z));
double tmp;
if ((t_2 - Math.sqrt(y)) <= 5e-8) {
tmp = (1.0 / (Math.sqrt(x) + t_1)) + (t_3 + t_4);
} else {
tmp = (t_1 - Math.sqrt(x)) + (t_3 + (t_4 + (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 + y))
t_3 = 1.0 / (t_2 + math.sqrt(y))
t_4 = 1.0 / (math.sqrt((1.0 + z)) + math.sqrt(z))
tmp = 0
if (t_2 - math.sqrt(y)) <= 5e-8:
tmp = (1.0 / (math.sqrt(x) + t_1)) + (t_3 + t_4)
else:
tmp = (t_1 - math.sqrt(x)) + (t_3 + (t_4 + (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 + y))
t_3 = Float64(1.0 / Float64(t_2 + sqrt(y)))
t_4 = Float64(1.0 / Float64(sqrt(Float64(1.0 + z)) + sqrt(z)))
tmp = 0.0
if (Float64(t_2 - sqrt(y)) <= 5e-8)
tmp = Float64(Float64(1.0 / Float64(sqrt(x) + t_1)) + Float64(t_3 + t_4));
else
tmp = Float64(Float64(t_1 - sqrt(x)) + Float64(t_3 + Float64(t_4 + 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 + y));
t_3 = 1.0 / (t_2 + sqrt(y));
t_4 = 1.0 / (sqrt((1.0 + z)) + sqrt(z));
tmp = 0.0;
if ((t_2 - sqrt(y)) <= 5e-8)
tmp = (1.0 / (sqrt(x) + t_1)) + (t_3 + t_4);
else
tmp = (t_1 - sqrt(x)) + (t_3 + (t_4 + (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 + y), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[(1.0 / N[(t$95$2 + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(1.0 / N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(t$95$2 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision], 5e-8], N[(N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision] + N[(t$95$3 + t$95$4), $MachinePrecision]), $MachinePrecision], N[(N[(t$95$1 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(t$95$3 + N[(t$95$4 + 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 + y}\\
t_3 := \frac{1}{t_2 + \sqrt{y}}\\
t_4 := \frac{1}{\sqrt{1 + z} + \sqrt{z}}\\
\mathbf{if}\;t_2 - \sqrt{y} \leq 5 \cdot 10^{-8}:\\
\;\;\;\;\frac{1}{\sqrt{x} + t_1} + \left(t_3 + t_4\right)\\
\mathbf{else}:\\
\;\;\;\;\left(t_1 - \sqrt{x}\right) + \left(t_3 + \left(t_4 + \frac{1}{\sqrt{1 + t} + \sqrt{t}}\right)\right)\\
\end{array}
Alternatives
| Alternative 1 |
|---|
| Error | 0.1 |
|---|
| Cost | 66116 |
|---|
\[\begin{array}{l}
t_1 := \sqrt{1 + x}\\
t_2 := \sqrt{1 + y}\\
t_3 := t_2 - \sqrt{y}\\
t_4 := \frac{1}{\sqrt{1 + z} + \sqrt{z}}\\
\mathbf{if}\;t_3 \leq 0.996:\\
\;\;\;\;\frac{1}{\sqrt{x} + t_1} + \left(\frac{1}{t_2 + \sqrt{y}} + t_4\right)\\
\mathbf{else}:\\
\;\;\;\;\left(t_1 - \sqrt{x}\right) + \left(\left(t_4 + \frac{1}{\sqrt{1 + t} + \sqrt{t}}\right) + t_3\right)\\
\end{array}
\]
| Alternative 2 |
|---|
| Error | 0.2 |
|---|
| Cost | 53060 |
|---|
\[\begin{array}{l}
t_1 := \sqrt{1 + z}\\
t_2 := t_1 - \sqrt{z}\\
t_3 := \sqrt{1 + y}\\
\mathbf{if}\;t_2 \leq 0.02:\\
\;\;\;\;\frac{1}{\sqrt{x} + \sqrt{1 + x}} + \left(\frac{1}{t_3 + \sqrt{y}} + \frac{1}{t_1 + \sqrt{z}}\right)\\
\mathbf{else}:\\
\;\;\;\;1 + \left(\left(t_3 - \sqrt{y}\right) + \left(\frac{1}{\sqrt{1 + t} + \sqrt{t}} + t_2\right)\right)\\
\end{array}
\]
| Alternative 3 |
|---|
| Error | 0.4 |
|---|
| Cost | 53056 |
|---|
\[\frac{1}{\sqrt{x} + \sqrt{1 + x}} + \left(\frac{1}{\sqrt{1 + y} + \sqrt{y}} + \left(\frac{1}{\sqrt{1 + z} + \sqrt{z}} + \left(\sqrt{1 + t} - \sqrt{t}\right)\right)\right)
\]
| Alternative 4 |
|---|
| Error | 0.6 |
|---|
| Cost | 39876 |
|---|
\[\begin{array}{l}
t_1 := \sqrt{1 + y}\\
t_2 := \sqrt{1 + z}\\
\mathbf{if}\;z \leq 1.42 \cdot 10^{+32}:\\
\;\;\;\;1 + \left(\left(\frac{1}{t_2 + \sqrt{z}} + \left(\sqrt{1 + t} - \sqrt{t}\right)\right) + \left(t_1 - \sqrt{y}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{x} + \sqrt{1 + x}} + \left(\frac{1}{t_1 + \sqrt{y}} + \left(t_2 - \sqrt{z}\right)\right)\\
\end{array}
\]
| Alternative 5 |
|---|
| Error | 5.9 |
|---|
| Cost | 39744 |
|---|
\[1 + \left(\left(\sqrt{1 + y} - \sqrt{y}\right) + \left(\frac{1}{\sqrt{1 + t} + \sqrt{t}} + \left(\sqrt{1 + z} - \sqrt{z}\right)\right)\right)
\]
| Alternative 6 |
|---|
| Error | 5.3 |
|---|
| Cost | 39744 |
|---|
\[1 + \left(\left(\frac{1}{\sqrt{1 + z} + \sqrt{z}} + \left(\sqrt{1 + t} - \sqrt{t}\right)\right) + \left(\sqrt{1 + y} - \sqrt{y}\right)\right)
\]
| Alternative 7 |
|---|
| Error | 6.1 |
|---|
| Cost | 39616 |
|---|
\[1 + \left(\left(\sqrt{1 + y} - \sqrt{y}\right) + \left(\left(\sqrt{1 + t} - \sqrt{t}\right) + \left(\sqrt{1 + z} - \sqrt{z}\right)\right)\right)
\]
| Alternative 8 |
|---|
| Error | 6.5 |
|---|
| Cost | 26696 |
|---|
\[\begin{array}{l}
t_1 := \sqrt{1 + y}\\
\mathbf{if}\;z \leq 1.85 \cdot 10^{-44}:\\
\;\;\;\;\left(\sqrt{1 + t} - \sqrt{t}\right) + 3\\
\mathbf{elif}\;z \leq 5.4 \cdot 10^{+14}:\\
\;\;\;\;1 + \left(\sqrt{1 + z} + \left(t_1 - \left(\sqrt{y} + \sqrt{z}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;1 + \left(t_1 - \sqrt{y}\right)\\
\end{array}
\]
| Alternative 9 |
|---|
| Error | 6.6 |
|---|
| Cost | 26696 |
|---|
\[\begin{array}{l}
t_1 := \sqrt{1 + y}\\
\mathbf{if}\;z \leq 1.55 \cdot 10^{-43}:\\
\;\;\;\;\left(\sqrt{1 + t} - \sqrt{t}\right) + 3\\
\mathbf{elif}\;z \leq 86000000000000:\\
\;\;\;\;t_1 + \left(1 + \left(\sqrt{1 + z} - \left(\sqrt{y} + \sqrt{z}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;1 + \left(t_1 - \sqrt{y}\right)\\
\end{array}
\]
| Alternative 10 |
|---|
| Error | 6.9 |
|---|
| Cost | 13512 |
|---|
\[\begin{array}{l}
\mathbf{if}\;z \leq 2 \cdot 10^{-44}:\\
\;\;\;\;\left(\sqrt{1 + t} - \sqrt{t}\right) + 3\\
\mathbf{elif}\;z \leq 255000000000:\\
\;\;\;\;\left(\sqrt{1 + z} - \sqrt{z}\right) + 2\\
\mathbf{else}:\\
\;\;\;\;1 + \left(\sqrt{1 + y} - \sqrt{y}\right)\\
\end{array}
\]
| Alternative 11 |
|---|
| Error | 10.2 |
|---|
| Cost | 13380 |
|---|
\[\begin{array}{l}
\mathbf{if}\;y \leq 1.2 \cdot 10^{-29}:\\
\;\;\;\;\left(\sqrt{1 + z} - \sqrt{z}\right) + 2\\
\mathbf{else}:\\
\;\;\;\;1 + \left(\sqrt{1 + y} - \sqrt{y}\right)\\
\end{array}
\]
| Alternative 12 |
|---|
| Error | 22.8 |
|---|
| Cost | 13248 |
|---|
\[1 + \left(\sqrt{1 + y} - \sqrt{y}\right)
\]
| Alternative 13 |
|---|
| Error | 54.6 |
|---|
| Cost | 6848 |
|---|
\[\left(1 + y \cdot 0.5\right) - \sqrt{y}
\]
| Alternative 14 |
|---|
| Error | 55.7 |
|---|
| Cost | 6592 |
|---|
\[1 - \sqrt{y}
\]