
(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:
Herbie found 17 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(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}
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 (/ 1.0 (+ (sqrt (+ 1.0 y)) (sqrt y))))
(t_2 (sqrt (+ 1.0 x)))
(t_3 (- t_2 (sqrt x)))
(t_4 (- (sqrt (+ 1.0 t)) (sqrt t)))
(t_5 (sqrt (+ 1.0 z))))
(if (<= t_3 0.005)
(+ t_4 (+ (+ t_1 (/ 1.0 (+ t_2 (sqrt x)))) (- t_5 (sqrt z))))
(+ t_4 (+ (/ 1.0 (+ t_5 (sqrt z))) (+ t_1 t_3))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = 1.0 / (sqrt((1.0 + y)) + sqrt(y));
double t_2 = sqrt((1.0 + x));
double t_3 = t_2 - sqrt(x);
double t_4 = sqrt((1.0 + t)) - sqrt(t);
double t_5 = sqrt((1.0 + z));
double tmp;
if (t_3 <= 0.005) {
tmp = t_4 + ((t_1 + (1.0 / (t_2 + sqrt(x)))) + (t_5 - sqrt(z)));
} else {
tmp = t_4 + ((1.0 / (t_5 + sqrt(z))) + (t_1 + t_3));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: t_5
real(8) :: tmp
t_1 = 1.0d0 / (sqrt((1.0d0 + y)) + sqrt(y))
t_2 = sqrt((1.0d0 + x))
t_3 = t_2 - sqrt(x)
t_4 = sqrt((1.0d0 + t)) - sqrt(t)
t_5 = sqrt((1.0d0 + z))
if (t_3 <= 0.005d0) then
tmp = t_4 + ((t_1 + (1.0d0 / (t_2 + sqrt(x)))) + (t_5 - sqrt(z)))
else
tmp = t_4 + ((1.0d0 / (t_5 + sqrt(z))) + (t_1 + t_3))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = 1.0 / (Math.sqrt((1.0 + y)) + Math.sqrt(y));
double t_2 = Math.sqrt((1.0 + x));
double t_3 = t_2 - Math.sqrt(x);
double t_4 = Math.sqrt((1.0 + t)) - Math.sqrt(t);
double t_5 = Math.sqrt((1.0 + z));
double tmp;
if (t_3 <= 0.005) {
tmp = t_4 + ((t_1 + (1.0 / (t_2 + Math.sqrt(x)))) + (t_5 - Math.sqrt(z)));
} else {
tmp = t_4 + ((1.0 / (t_5 + Math.sqrt(z))) + (t_1 + t_3));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = 1.0 / (math.sqrt((1.0 + y)) + math.sqrt(y)) t_2 = math.sqrt((1.0 + x)) t_3 = t_2 - math.sqrt(x) t_4 = math.sqrt((1.0 + t)) - math.sqrt(t) t_5 = math.sqrt((1.0 + z)) tmp = 0 if t_3 <= 0.005: tmp = t_4 + ((t_1 + (1.0 / (t_2 + math.sqrt(x)))) + (t_5 - math.sqrt(z))) else: tmp = t_4 + ((1.0 / (t_5 + math.sqrt(z))) + (t_1 + t_3)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = Float64(1.0 / Float64(sqrt(Float64(1.0 + y)) + sqrt(y))) t_2 = sqrt(Float64(1.0 + x)) t_3 = Float64(t_2 - sqrt(x)) t_4 = Float64(sqrt(Float64(1.0 + t)) - sqrt(t)) t_5 = sqrt(Float64(1.0 + z)) tmp = 0.0 if (t_3 <= 0.005) tmp = Float64(t_4 + Float64(Float64(t_1 + Float64(1.0 / Float64(t_2 + sqrt(x)))) + Float64(t_5 - sqrt(z)))); else tmp = Float64(t_4 + Float64(Float64(1.0 / Float64(t_5 + sqrt(z))) + Float64(t_1 + t_3))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = 1.0 / (sqrt((1.0 + y)) + sqrt(y));
t_2 = sqrt((1.0 + x));
t_3 = t_2 - sqrt(x);
t_4 = sqrt((1.0 + t)) - sqrt(t);
t_5 = sqrt((1.0 + z));
tmp = 0.0;
if (t_3 <= 0.005)
tmp = t_4 + ((t_1 + (1.0 / (t_2 + sqrt(x)))) + (t_5 - sqrt(z)));
else
tmp = t_4 + ((1.0 / (t_5 + sqrt(z))) + (t_1 + t_3));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(1.0 / N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[(t$95$2 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t$95$3, 0.005], N[(t$95$4 + N[(N[(t$95$1 + N[(1.0 / N[(t$95$2 + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$5 - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$4 + N[(N[(1.0 / N[(t$95$5 + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$1 + t$95$3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \frac{1}{\sqrt{1 + y} + \sqrt{y}}\\
t_2 := \sqrt{1 + x}\\
t_3 := t_2 - \sqrt{x}\\
t_4 := \sqrt{1 + t} - \sqrt{t}\\
t_5 := \sqrt{1 + z}\\
\mathbf{if}\;t_3 \leq 0.005:\\
\;\;\;\;t_4 + \left(\left(t_1 + \frac{1}{t_2 + \sqrt{x}}\right) + \left(t_5 - \sqrt{z}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_4 + \left(\frac{1}{t_5 + \sqrt{z}} + \left(t_1 + t_3\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 (- t_1 (sqrt x))))
(if (<= t_2 0.005)
(/ 1.0 (+ t_1 (sqrt x)))
(+
(- (sqrt (+ 1.0 t)) (sqrt t))
(+
(/ 1.0 (+ (sqrt (+ 1.0 z)) (sqrt z)))
(+ (/ 1.0 (+ (sqrt (+ 1.0 y)) (sqrt y))) 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 = t_1 - sqrt(x);
double tmp;
if (t_2 <= 0.005) {
tmp = 1.0 / (t_1 + sqrt(x));
} else {
tmp = (sqrt((1.0 + t)) - sqrt(t)) + ((1.0 / (sqrt((1.0 + z)) + sqrt(z))) + ((1.0 / (sqrt((1.0 + y)) + sqrt(y))) + 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) :: tmp
t_1 = sqrt((1.0d0 + x))
t_2 = t_1 - sqrt(x)
if (t_2 <= 0.005d0) then
tmp = 1.0d0 / (t_1 + sqrt(x))
else
tmp = (sqrt((1.0d0 + t)) - sqrt(t)) + ((1.0d0 / (sqrt((1.0d0 + z)) + sqrt(z))) + ((1.0d0 / (sqrt((1.0d0 + y)) + sqrt(y))) + 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 = t_1 - Math.sqrt(x);
double tmp;
if (t_2 <= 0.005) {
tmp = 1.0 / (t_1 + Math.sqrt(x));
} else {
tmp = (Math.sqrt((1.0 + t)) - Math.sqrt(t)) + ((1.0 / (Math.sqrt((1.0 + z)) + Math.sqrt(z))) + ((1.0 / (Math.sqrt((1.0 + y)) + Math.sqrt(y))) + 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 = t_1 - math.sqrt(x) tmp = 0 if t_2 <= 0.005: tmp = 1.0 / (t_1 + math.sqrt(x)) else: tmp = (math.sqrt((1.0 + t)) - math.sqrt(t)) + ((1.0 / (math.sqrt((1.0 + z)) + math.sqrt(z))) + ((1.0 / (math.sqrt((1.0 + y)) + math.sqrt(y))) + 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(t_1 - sqrt(x)) tmp = 0.0 if (t_2 <= 0.005) tmp = Float64(1.0 / Float64(t_1 + sqrt(x))); else tmp = Float64(Float64(sqrt(Float64(1.0 + t)) - sqrt(t)) + Float64(Float64(1.0 / Float64(sqrt(Float64(1.0 + z)) + sqrt(z))) + Float64(Float64(1.0 / Float64(sqrt(Float64(1.0 + y)) + sqrt(y))) + 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 = t_1 - sqrt(x);
tmp = 0.0;
if (t_2 <= 0.005)
tmp = 1.0 / (t_1 + sqrt(x));
else
tmp = (sqrt((1.0 + t)) - sqrt(t)) + ((1.0 / (sqrt((1.0 + z)) + sqrt(z))) + ((1.0 / (sqrt((1.0 + y)) + sqrt(y))) + 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[(t$95$1 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, 0.005], N[(1.0 / N[(t$95$1 + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 / N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 / N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$2), $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 := t_1 - \sqrt{x}\\
\mathbf{if}\;t_2 \leq 0.005:\\
\;\;\;\;\frac{1}{t_1 + \sqrt{x}}\\
\mathbf{else}:\\
\;\;\;\;\left(\sqrt{1 + t} - \sqrt{t}\right) + \left(\frac{1}{\sqrt{1 + z} + \sqrt{z}} + \left(\frac{1}{\sqrt{1 + y} + \sqrt{y}} + t_2\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))) (t_3 (sqrt (+ 1.0 z))))
(if (<= (- t_2 (sqrt x)) 0.999999999999998)
(+ (/ 1.0 (+ t_2 (sqrt x))) (+ (- t_1 (sqrt y)) (- t_3 (sqrt z))))
(+
(- (sqrt (+ 1.0 t)) (sqrt t))
(+ (/ 1.0 (+ t_3 (sqrt z))) (+ 1.0 (/ 1.0 (+ t_1 (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 t_3 = sqrt((1.0 + z));
double tmp;
if ((t_2 - sqrt(x)) <= 0.999999999999998) {
tmp = (1.0 / (t_2 + sqrt(x))) + ((t_1 - sqrt(y)) + (t_3 - sqrt(z)));
} else {
tmp = (sqrt((1.0 + t)) - sqrt(t)) + ((1.0 / (t_3 + sqrt(z))) + (1.0 + (1.0 / (t_1 + 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) :: t_3
real(8) :: tmp
t_1 = sqrt((1.0d0 + y))
t_2 = sqrt((1.0d0 + x))
t_3 = sqrt((1.0d0 + z))
if ((t_2 - sqrt(x)) <= 0.999999999999998d0) then
tmp = (1.0d0 / (t_2 + sqrt(x))) + ((t_1 - sqrt(y)) + (t_3 - sqrt(z)))
else
tmp = (sqrt((1.0d0 + t)) - sqrt(t)) + ((1.0d0 / (t_3 + sqrt(z))) + (1.0d0 + (1.0d0 / (t_1 + 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 t_3 = Math.sqrt((1.0 + z));
double tmp;
if ((t_2 - Math.sqrt(x)) <= 0.999999999999998) {
tmp = (1.0 / (t_2 + Math.sqrt(x))) + ((t_1 - Math.sqrt(y)) + (t_3 - Math.sqrt(z)));
} else {
tmp = (Math.sqrt((1.0 + t)) - Math.sqrt(t)) + ((1.0 / (t_3 + Math.sqrt(z))) + (1.0 + (1.0 / (t_1 + 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)) t_3 = math.sqrt((1.0 + z)) tmp = 0 if (t_2 - math.sqrt(x)) <= 0.999999999999998: tmp = (1.0 / (t_2 + math.sqrt(x))) + ((t_1 - math.sqrt(y)) + (t_3 - math.sqrt(z))) else: tmp = (math.sqrt((1.0 + t)) - math.sqrt(t)) + ((1.0 / (t_3 + math.sqrt(z))) + (1.0 + (1.0 / (t_1 + 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)) t_3 = sqrt(Float64(1.0 + z)) tmp = 0.0 if (Float64(t_2 - sqrt(x)) <= 0.999999999999998) tmp = Float64(Float64(1.0 / Float64(t_2 + sqrt(x))) + Float64(Float64(t_1 - sqrt(y)) + Float64(t_3 - sqrt(z)))); else tmp = Float64(Float64(sqrt(Float64(1.0 + t)) - sqrt(t)) + Float64(Float64(1.0 / Float64(t_3 + sqrt(z))) + Float64(1.0 + Float64(1.0 / Float64(t_1 + 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));
t_3 = sqrt((1.0 + z));
tmp = 0.0;
if ((t_2 - sqrt(x)) <= 0.999999999999998)
tmp = (1.0 / (t_2 + sqrt(x))) + ((t_1 - sqrt(y)) + (t_3 - sqrt(z)));
else
tmp = (sqrt((1.0 + t)) - sqrt(t)) + ((1.0 / (t_3 + sqrt(z))) + (1.0 + (1.0 / (t_1 + 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]}, Block[{t$95$3 = N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(t$95$2 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision], 0.999999999999998], N[(N[(1.0 / N[(t$95$2 + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$1 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision] + N[(t$95$3 - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 / N[(t$95$3 + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 + N[(1.0 / N[(t$95$1 + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + y}\\
t_2 := \sqrt{1 + x}\\
t_3 := \sqrt{1 + z}\\
\mathbf{if}\;t_2 - \sqrt{x} \leq 0.999999999999998:\\
\;\;\;\;\frac{1}{t_2 + \sqrt{x}} + \left(\left(t_1 - \sqrt{y}\right) + \left(t_3 - \sqrt{z}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\sqrt{1 + t} - \sqrt{t}\right) + \left(\frac{1}{t_3 + \sqrt{z}} + \left(1 + \frac{1}{t_1 + \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
(+
(+
(+
(/ 1.0 (+ (sqrt (+ 1.0 y)) (sqrt y)))
(/ 1.0 (+ (sqrt (+ 1.0 x)) (sqrt x))))
(/ 1.0 (+ (sqrt (+ 1.0 z)) (sqrt z))))
(- (sqrt (+ 1.0 t)) (sqrt t))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
return (((1.0 / (sqrt((1.0 + y)) + sqrt(y))) + (1.0 / (sqrt((1.0 + x)) + sqrt(x)))) + (1.0 / (sqrt((1.0 + z)) + sqrt(z)))) + (sqrt((1.0 + t)) - sqrt(t));
}
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((1.0d0 + y)) + sqrt(y))) + (1.0d0 / (sqrt((1.0d0 + x)) + sqrt(x)))) + (1.0d0 / (sqrt((1.0d0 + z)) + sqrt(z)))) + (sqrt((1.0d0 + t)) - sqrt(t))
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((1.0 + y)) + Math.sqrt(y))) + (1.0 / (Math.sqrt((1.0 + x)) + Math.sqrt(x)))) + (1.0 / (Math.sqrt((1.0 + z)) + Math.sqrt(z)))) + (Math.sqrt((1.0 + t)) - Math.sqrt(t));
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): return (((1.0 / (math.sqrt((1.0 + y)) + math.sqrt(y))) + (1.0 / (math.sqrt((1.0 + x)) + math.sqrt(x)))) + (1.0 / (math.sqrt((1.0 + z)) + math.sqrt(z)))) + (math.sqrt((1.0 + t)) - math.sqrt(t))
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) return Float64(Float64(Float64(Float64(1.0 / Float64(sqrt(Float64(1.0 + y)) + sqrt(y))) + Float64(1.0 / Float64(sqrt(Float64(1.0 + x)) + sqrt(x)))) + Float64(1.0 / Float64(sqrt(Float64(1.0 + z)) + sqrt(z)))) + Float64(sqrt(Float64(1.0 + t)) - sqrt(t))) end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp = code(x, y, z, t)
tmp = (((1.0 / (sqrt((1.0 + y)) + sqrt(y))) + (1.0 / (sqrt((1.0 + x)) + sqrt(x)))) + (1.0 / (sqrt((1.0 + z)) + sqrt(z)))) + (sqrt((1.0 + t)) - sqrt(t));
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := N[(N[(N[(N[(1.0 / N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\left(\left(\frac{1}{\sqrt{1 + y} + \sqrt{y}} + \frac{1}{\sqrt{1 + x} + \sqrt{x}}\right) + \frac{1}{\sqrt{1 + z} + \sqrt{z}}\right) + \left(\sqrt{1 + t} - \sqrt{t}\right)
\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 z)) (sqrt z)))
(t_3 (sqrt (+ 1.0 x))))
(if (<= (- t_3 (sqrt x)) 0.999999999999998)
(+ (/ 1.0 (+ t_3 (sqrt x))) (+ (- t_1 (sqrt y)) t_2))
(+
(- (sqrt (+ 1.0 t)) (sqrt t))
(+ t_2 (+ 1.0 (/ 1.0 (+ t_1 (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 + z)) - sqrt(z);
double t_3 = sqrt((1.0 + x));
double tmp;
if ((t_3 - sqrt(x)) <= 0.999999999999998) {
tmp = (1.0 / (t_3 + sqrt(x))) + ((t_1 - sqrt(y)) + t_2);
} else {
tmp = (sqrt((1.0 + t)) - sqrt(t)) + (t_2 + (1.0 + (1.0 / (t_1 + 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) :: t_3
real(8) :: tmp
t_1 = sqrt((1.0d0 + y))
t_2 = sqrt((1.0d0 + z)) - sqrt(z)
t_3 = sqrt((1.0d0 + x))
if ((t_3 - sqrt(x)) <= 0.999999999999998d0) then
tmp = (1.0d0 / (t_3 + sqrt(x))) + ((t_1 - sqrt(y)) + t_2)
else
tmp = (sqrt((1.0d0 + t)) - sqrt(t)) + (t_2 + (1.0d0 + (1.0d0 / (t_1 + 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 + z)) - Math.sqrt(z);
double t_3 = Math.sqrt((1.0 + x));
double tmp;
if ((t_3 - Math.sqrt(x)) <= 0.999999999999998) {
tmp = (1.0 / (t_3 + Math.sqrt(x))) + ((t_1 - Math.sqrt(y)) + t_2);
} else {
tmp = (Math.sqrt((1.0 + t)) - Math.sqrt(t)) + (t_2 + (1.0 + (1.0 / (t_1 + 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 + z)) - math.sqrt(z) t_3 = math.sqrt((1.0 + x)) tmp = 0 if (t_3 - math.sqrt(x)) <= 0.999999999999998: tmp = (1.0 / (t_3 + math.sqrt(x))) + ((t_1 - math.sqrt(y)) + t_2) else: tmp = (math.sqrt((1.0 + t)) - math.sqrt(t)) + (t_2 + (1.0 + (1.0 / (t_1 + 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 = Float64(sqrt(Float64(1.0 + z)) - sqrt(z)) t_3 = sqrt(Float64(1.0 + x)) tmp = 0.0 if (Float64(t_3 - sqrt(x)) <= 0.999999999999998) tmp = Float64(Float64(1.0 / Float64(t_3 + sqrt(x))) + Float64(Float64(t_1 - sqrt(y)) + t_2)); else tmp = Float64(Float64(sqrt(Float64(1.0 + t)) - sqrt(t)) + Float64(t_2 + Float64(1.0 + Float64(1.0 / Float64(t_1 + 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 + z)) - sqrt(z);
t_3 = sqrt((1.0 + x));
tmp = 0.0;
if ((t_3 - sqrt(x)) <= 0.999999999999998)
tmp = (1.0 / (t_3 + sqrt(x))) + ((t_1 - sqrt(y)) + t_2);
else
tmp = (sqrt((1.0 + t)) - sqrt(t)) + (t_2 + (1.0 + (1.0 / (t_1 + 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[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(t$95$3 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision], 0.999999999999998], N[(N[(1.0 / N[(t$95$3 + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$1 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision] + t$95$2), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision] + N[(t$95$2 + N[(1.0 + N[(1.0 / N[(t$95$1 + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + y}\\
t_2 := \sqrt{1 + z} - \sqrt{z}\\
t_3 := \sqrt{1 + x}\\
\mathbf{if}\;t_3 - \sqrt{x} \leq 0.999999999999998:\\
\;\;\;\;\frac{1}{t_3 + \sqrt{x}} + \left(\left(t_1 - \sqrt{y}\right) + t_2\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\sqrt{1 + t} - \sqrt{t}\right) + \left(t_2 + \left(1 + \frac{1}{t_1 + \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 x))) (t_2 (sqrt (+ 1.0 z))))
(if (<= t 9.5e+16)
(+ 1.0 (+ (+ t_1 t_2) (- (sqrt (+ 1.0 t)) (+ (sqrt z) (sqrt t)))))
(+
(/ 1.0 (+ t_1 (sqrt x)))
(+ (- (sqrt (+ 1.0 y)) (sqrt y)) (- t_2 (sqrt z)))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + x));
double t_2 = sqrt((1.0 + z));
double tmp;
if (t <= 9.5e+16) {
tmp = 1.0 + ((t_1 + t_2) + (sqrt((1.0 + t)) - (sqrt(z) + sqrt(t))));
} else {
tmp = (1.0 / (t_1 + sqrt(x))) + ((sqrt((1.0 + y)) - sqrt(y)) + (t_2 - sqrt(z)));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = sqrt((1.0d0 + x))
t_2 = sqrt((1.0d0 + z))
if (t <= 9.5d+16) then
tmp = 1.0d0 + ((t_1 + t_2) + (sqrt((1.0d0 + t)) - (sqrt(z) + sqrt(t))))
else
tmp = (1.0d0 / (t_1 + sqrt(x))) + ((sqrt((1.0d0 + y)) - sqrt(y)) + (t_2 - sqrt(z)))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + x));
double t_2 = Math.sqrt((1.0 + z));
double tmp;
if (t <= 9.5e+16) {
tmp = 1.0 + ((t_1 + t_2) + (Math.sqrt((1.0 + t)) - (Math.sqrt(z) + Math.sqrt(t))));
} else {
tmp = (1.0 / (t_1 + Math.sqrt(x))) + ((Math.sqrt((1.0 + y)) - Math.sqrt(y)) + (t_2 - Math.sqrt(z)));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + x)) t_2 = math.sqrt((1.0 + z)) tmp = 0 if t <= 9.5e+16: tmp = 1.0 + ((t_1 + t_2) + (math.sqrt((1.0 + t)) - (math.sqrt(z) + math.sqrt(t)))) else: tmp = (1.0 / (t_1 + math.sqrt(x))) + ((math.sqrt((1.0 + y)) - math.sqrt(y)) + (t_2 - math.sqrt(z))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(1.0 + x)) t_2 = sqrt(Float64(1.0 + z)) tmp = 0.0 if (t <= 9.5e+16) tmp = Float64(1.0 + Float64(Float64(t_1 + t_2) + Float64(sqrt(Float64(1.0 + t)) - Float64(sqrt(z) + sqrt(t))))); else tmp = Float64(Float64(1.0 / Float64(t_1 + sqrt(x))) + Float64(Float64(sqrt(Float64(1.0 + y)) - sqrt(y)) + Float64(t_2 - sqrt(z)))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + x));
t_2 = sqrt((1.0 + z));
tmp = 0.0;
if (t <= 9.5e+16)
tmp = 1.0 + ((t_1 + t_2) + (sqrt((1.0 + t)) - (sqrt(z) + sqrt(t))));
else
tmp = (1.0 / (t_1 + sqrt(x))) + ((sqrt((1.0 + y)) - sqrt(y)) + (t_2 - sqrt(z)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t, 9.5e+16], N[(1.0 + N[(N[(t$95$1 + t$95$2), $MachinePrecision] + N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[(N[Sqrt[z], $MachinePrecision] + N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[(t$95$1 + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision] + N[(t$95$2 - N[Sqrt[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 + x}\\
t_2 := \sqrt{1 + z}\\
\mathbf{if}\;t \leq 9.5 \cdot 10^{+16}:\\
\;\;\;\;1 + \left(\left(t_1 + t_2\right) + \left(\sqrt{1 + t} - \left(\sqrt{z} + \sqrt{t}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{t_1 + \sqrt{x}} + \left(\left(\sqrt{1 + y} - \sqrt{y}\right) + \left(t_2 - \sqrt{z}\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 z))))
(if (<= t 9.5e+16)
(+ 1.0 (+ (+ t_1 t_2) (- (sqrt (+ 1.0 t)) (+ (sqrt z) (sqrt t)))))
(+ (- t_1 (sqrt x)) (+ (- (sqrt (+ 1.0 y)) (sqrt y)) (- t_2 (sqrt z)))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + x));
double t_2 = sqrt((1.0 + z));
double tmp;
if (t <= 9.5e+16) {
tmp = 1.0 + ((t_1 + t_2) + (sqrt((1.0 + t)) - (sqrt(z) + sqrt(t))));
} else {
tmp = (t_1 - sqrt(x)) + ((sqrt((1.0 + y)) - sqrt(y)) + (t_2 - sqrt(z)));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = sqrt((1.0d0 + x))
t_2 = sqrt((1.0d0 + z))
if (t <= 9.5d+16) then
tmp = 1.0d0 + ((t_1 + t_2) + (sqrt((1.0d0 + t)) - (sqrt(z) + sqrt(t))))
else
tmp = (t_1 - sqrt(x)) + ((sqrt((1.0d0 + y)) - sqrt(y)) + (t_2 - sqrt(z)))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + x));
double t_2 = Math.sqrt((1.0 + z));
double tmp;
if (t <= 9.5e+16) {
tmp = 1.0 + ((t_1 + t_2) + (Math.sqrt((1.0 + t)) - (Math.sqrt(z) + Math.sqrt(t))));
} else {
tmp = (t_1 - Math.sqrt(x)) + ((Math.sqrt((1.0 + y)) - Math.sqrt(y)) + (t_2 - Math.sqrt(z)));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + x)) t_2 = math.sqrt((1.0 + z)) tmp = 0 if t <= 9.5e+16: tmp = 1.0 + ((t_1 + t_2) + (math.sqrt((1.0 + t)) - (math.sqrt(z) + math.sqrt(t)))) else: tmp = (t_1 - math.sqrt(x)) + ((math.sqrt((1.0 + y)) - math.sqrt(y)) + (t_2 - math.sqrt(z))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(1.0 + x)) t_2 = sqrt(Float64(1.0 + z)) tmp = 0.0 if (t <= 9.5e+16) tmp = Float64(1.0 + Float64(Float64(t_1 + t_2) + Float64(sqrt(Float64(1.0 + t)) - Float64(sqrt(z) + sqrt(t))))); else tmp = Float64(Float64(t_1 - sqrt(x)) + Float64(Float64(sqrt(Float64(1.0 + y)) - sqrt(y)) + Float64(t_2 - sqrt(z)))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + x));
t_2 = sqrt((1.0 + z));
tmp = 0.0;
if (t <= 9.5e+16)
tmp = 1.0 + ((t_1 + t_2) + (sqrt((1.0 + t)) - (sqrt(z) + sqrt(t))));
else
tmp = (t_1 - sqrt(x)) + ((sqrt((1.0 + y)) - sqrt(y)) + (t_2 - sqrt(z)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t, 9.5e+16], N[(1.0 + N[(N[(t$95$1 + t$95$2), $MachinePrecision] + N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[(N[Sqrt[z], $MachinePrecision] + N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(t$95$1 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision] + N[(t$95$2 - N[Sqrt[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 + x}\\
t_2 := \sqrt{1 + z}\\
\mathbf{if}\;t \leq 9.5 \cdot 10^{+16}:\\
\;\;\;\;1 + \left(\left(t_1 + t_2\right) + \left(\sqrt{1 + t} - \left(\sqrt{z} + \sqrt{t}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(t_1 - \sqrt{x}\right) + \left(\left(\sqrt{1 + y} - \sqrt{y}\right) + \left(t_2 - \sqrt{z}\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))))
(if (<= y 3.7e-25)
(+ (- (sqrt (+ 1.0 z)) (sqrt z)) 2.0)
(if (<= y 5e+15)
(+ t_1 (- (sqrt (+ 1.0 y)) (+ (sqrt x) (sqrt y))))
(/ 1.0 (+ 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 (y <= 3.7e-25) {
tmp = (sqrt((1.0 + z)) - sqrt(z)) + 2.0;
} else if (y <= 5e+15) {
tmp = t_1 + (sqrt((1.0 + y)) - (sqrt(x) + sqrt(y)));
} else {
tmp = 1.0 / (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 (y <= 3.7d-25) then
tmp = (sqrt((1.0d0 + z)) - sqrt(z)) + 2.0d0
else if (y <= 5d+15) then
tmp = t_1 + (sqrt((1.0d0 + y)) - (sqrt(x) + sqrt(y)))
else
tmp = 1.0d0 / (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 (y <= 3.7e-25) {
tmp = (Math.sqrt((1.0 + z)) - Math.sqrt(z)) + 2.0;
} else if (y <= 5e+15) {
tmp = t_1 + (Math.sqrt((1.0 + y)) - (Math.sqrt(x) + Math.sqrt(y)));
} else {
tmp = 1.0 / (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 y <= 3.7e-25: tmp = (math.sqrt((1.0 + z)) - math.sqrt(z)) + 2.0 elif y <= 5e+15: tmp = t_1 + (math.sqrt((1.0 + y)) - (math.sqrt(x) + math.sqrt(y))) else: tmp = 1.0 / (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 (y <= 3.7e-25) tmp = Float64(Float64(sqrt(Float64(1.0 + z)) - sqrt(z)) + 2.0); elseif (y <= 5e+15) tmp = Float64(t_1 + Float64(sqrt(Float64(1.0 + y)) - Float64(sqrt(x) + sqrt(y)))); else tmp = Float64(1.0 / 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 (y <= 3.7e-25)
tmp = (sqrt((1.0 + z)) - sqrt(z)) + 2.0;
elseif (y <= 5e+15)
tmp = t_1 + (sqrt((1.0 + y)) - (sqrt(x) + sqrt(y)));
else
tmp = 1.0 / (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[y, 3.7e-25], N[(N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision], If[LessEqual[y, 5e+15], N[(t$95$1 + N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] - N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(t$95$1 + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + x}\\
\mathbf{if}\;y \leq 3.7 \cdot 10^{-25}:\\
\;\;\;\;\left(\sqrt{1 + z} - \sqrt{z}\right) + 2\\
\mathbf{elif}\;y \leq 5 \cdot 10^{+15}:\\
\;\;\;\;t_1 + \left(\sqrt{1 + y} - \left(\sqrt{x} + \sqrt{y}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{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 (if (<= x 1.45e-53) (+ 1.0 (+ (- (sqrt (+ 1.0 y)) (sqrt y)) (- (sqrt (+ 1.0 z)) (sqrt z)))) (/ 1.0 (+ (sqrt (+ 1.0 x)) (sqrt x)))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (x <= 1.45e-53) {
tmp = 1.0 + ((sqrt((1.0 + y)) - sqrt(y)) + (sqrt((1.0 + z)) - sqrt(z)));
} else {
tmp = 1.0 / (sqrt((1.0 + x)) + 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) :: tmp
if (x <= 1.45d-53) then
tmp = 1.0d0 + ((sqrt((1.0d0 + y)) - sqrt(y)) + (sqrt((1.0d0 + z)) - sqrt(z)))
else
tmp = 1.0d0 / (sqrt((1.0d0 + x)) + 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 tmp;
if (x <= 1.45e-53) {
tmp = 1.0 + ((Math.sqrt((1.0 + y)) - Math.sqrt(y)) + (Math.sqrt((1.0 + z)) - Math.sqrt(z)));
} else {
tmp = 1.0 / (Math.sqrt((1.0 + x)) + Math.sqrt(x));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if x <= 1.45e-53: tmp = 1.0 + ((math.sqrt((1.0 + y)) - math.sqrt(y)) + (math.sqrt((1.0 + z)) - math.sqrt(z))) else: tmp = 1.0 / (math.sqrt((1.0 + x)) + math.sqrt(x)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (x <= 1.45e-53) tmp = Float64(1.0 + Float64(Float64(sqrt(Float64(1.0 + y)) - sqrt(y)) + Float64(sqrt(Float64(1.0 + z)) - sqrt(z)))); else tmp = Float64(1.0 / Float64(sqrt(Float64(1.0 + x)) + sqrt(x))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (x <= 1.45e-53)
tmp = 1.0 + ((sqrt((1.0 + y)) - sqrt(y)) + (sqrt((1.0 + z)) - sqrt(z)));
else
tmp = 1.0 / (sqrt((1.0 + x)) + 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_] := If[LessEqual[x, 1.45e-53], N[(1.0 + N[(N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq 1.45 \cdot 10^{-53}:\\
\;\;\;\;1 + \left(\left(\sqrt{1 + y} - \sqrt{y}\right) + \left(\sqrt{1 + z} - \sqrt{z}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{1 + x} + \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
(if (<= y 4.5e-25)
(+ (- (sqrt (+ 1.0 z)) (sqrt z)) 2.0)
(if (<= y 7.2e+14)
(+ (- (sqrt (+ 1.0 y)) (+ (sqrt x) (sqrt y))) (+ 1.0 (* x 0.5)))
(/ 1.0 (+ (sqrt (+ 1.0 x)) (sqrt x))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 4.5e-25) {
tmp = (sqrt((1.0 + z)) - sqrt(z)) + 2.0;
} else if (y <= 7.2e+14) {
tmp = (sqrt((1.0 + y)) - (sqrt(x) + sqrt(y))) + (1.0 + (x * 0.5));
} else {
tmp = 1.0 / (sqrt((1.0 + x)) + 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) :: tmp
if (y <= 4.5d-25) then
tmp = (sqrt((1.0d0 + z)) - sqrt(z)) + 2.0d0
else if (y <= 7.2d+14) then
tmp = (sqrt((1.0d0 + y)) - (sqrt(x) + sqrt(y))) + (1.0d0 + (x * 0.5d0))
else
tmp = 1.0d0 / (sqrt((1.0d0 + x)) + 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 tmp;
if (y <= 4.5e-25) {
tmp = (Math.sqrt((1.0 + z)) - Math.sqrt(z)) + 2.0;
} else if (y <= 7.2e+14) {
tmp = (Math.sqrt((1.0 + y)) - (Math.sqrt(x) + Math.sqrt(y))) + (1.0 + (x * 0.5));
} else {
tmp = 1.0 / (Math.sqrt((1.0 + x)) + Math.sqrt(x));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if y <= 4.5e-25: tmp = (math.sqrt((1.0 + z)) - math.sqrt(z)) + 2.0 elif y <= 7.2e+14: tmp = (math.sqrt((1.0 + y)) - (math.sqrt(x) + math.sqrt(y))) + (1.0 + (x * 0.5)) else: tmp = 1.0 / (math.sqrt((1.0 + x)) + math.sqrt(x)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (y <= 4.5e-25) tmp = Float64(Float64(sqrt(Float64(1.0 + z)) - sqrt(z)) + 2.0); elseif (y <= 7.2e+14) tmp = Float64(Float64(sqrt(Float64(1.0 + y)) - Float64(sqrt(x) + sqrt(y))) + Float64(1.0 + Float64(x * 0.5))); else tmp = Float64(1.0 / Float64(sqrt(Float64(1.0 + x)) + sqrt(x))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (y <= 4.5e-25)
tmp = (sqrt((1.0 + z)) - sqrt(z)) + 2.0;
elseif (y <= 7.2e+14)
tmp = (sqrt((1.0 + y)) - (sqrt(x) + sqrt(y))) + (1.0 + (x * 0.5));
else
tmp = 1.0 / (sqrt((1.0 + x)) + 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_] := If[LessEqual[y, 4.5e-25], N[(N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision], If[LessEqual[y, 7.2e+14], N[(N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] - N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 + N[(x * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 4.5 \cdot 10^{-25}:\\
\;\;\;\;\left(\sqrt{1 + z} - \sqrt{z}\right) + 2\\
\mathbf{elif}\;y \leq 7.2 \cdot 10^{+14}:\\
\;\;\;\;\left(\sqrt{1 + y} - \left(\sqrt{x} + \sqrt{y}\right)\right) + \left(1 + x \cdot 0.5\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{1 + x} + \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
(if (<= y 4.5e-25)
(+ (- (sqrt (+ 1.0 z)) (sqrt z)) 2.0)
(if (<= y 7.2e+14)
(+ 1.0 (- (sqrt (+ 1.0 y)) (sqrt y)))
(/ 1.0 (+ (sqrt (+ 1.0 x)) (sqrt x))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 4.5e-25) {
tmp = (sqrt((1.0 + z)) - sqrt(z)) + 2.0;
} else if (y <= 7.2e+14) {
tmp = 1.0 + (sqrt((1.0 + y)) - sqrt(y));
} else {
tmp = 1.0 / (sqrt((1.0 + x)) + 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) :: tmp
if (y <= 4.5d-25) then
tmp = (sqrt((1.0d0 + z)) - sqrt(z)) + 2.0d0
else if (y <= 7.2d+14) then
tmp = 1.0d0 + (sqrt((1.0d0 + y)) - sqrt(y))
else
tmp = 1.0d0 / (sqrt((1.0d0 + x)) + 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 tmp;
if (y <= 4.5e-25) {
tmp = (Math.sqrt((1.0 + z)) - Math.sqrt(z)) + 2.0;
} else if (y <= 7.2e+14) {
tmp = 1.0 + (Math.sqrt((1.0 + y)) - Math.sqrt(y));
} else {
tmp = 1.0 / (Math.sqrt((1.0 + x)) + Math.sqrt(x));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if y <= 4.5e-25: tmp = (math.sqrt((1.0 + z)) - math.sqrt(z)) + 2.0 elif y <= 7.2e+14: tmp = 1.0 + (math.sqrt((1.0 + y)) - math.sqrt(y)) else: tmp = 1.0 / (math.sqrt((1.0 + x)) + math.sqrt(x)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (y <= 4.5e-25) tmp = Float64(Float64(sqrt(Float64(1.0 + z)) - sqrt(z)) + 2.0); elseif (y <= 7.2e+14) tmp = Float64(1.0 + Float64(sqrt(Float64(1.0 + y)) - sqrt(y))); else tmp = Float64(1.0 / Float64(sqrt(Float64(1.0 + x)) + sqrt(x))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (y <= 4.5e-25)
tmp = (sqrt((1.0 + z)) - sqrt(z)) + 2.0;
elseif (y <= 7.2e+14)
tmp = 1.0 + (sqrt((1.0 + y)) - sqrt(y));
else
tmp = 1.0 / (sqrt((1.0 + x)) + 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_] := If[LessEqual[y, 4.5e-25], N[(N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision], If[LessEqual[y, 7.2e+14], N[(1.0 + N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 4.5 \cdot 10^{-25}:\\
\;\;\;\;\left(\sqrt{1 + z} - \sqrt{z}\right) + 2\\
\mathbf{elif}\;y \leq 7.2 \cdot 10^{+14}:\\
\;\;\;\;1 + \left(\sqrt{1 + y} - \sqrt{y}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{1 + x} + \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)) (sqrt x)))) (if (<= y 3.15) (+ 1.0 t_1) t_1)))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + x)) - sqrt(x);
double tmp;
if (y <= 3.15) {
tmp = 1.0 + t_1;
} else {
tmp = t_1;
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = sqrt((1.0d0 + x)) - sqrt(x)
if (y <= 3.15d0) then
tmp = 1.0d0 + t_1
else
tmp = t_1
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + x)) - Math.sqrt(x);
double tmp;
if (y <= 3.15) {
tmp = 1.0 + t_1;
} else {
tmp = t_1;
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + x)) - math.sqrt(x) tmp = 0 if y <= 3.15: tmp = 1.0 + t_1 else: tmp = t_1 return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = Float64(sqrt(Float64(1.0 + x)) - sqrt(x)) tmp = 0.0 if (y <= 3.15) tmp = Float64(1.0 + t_1); else tmp = t_1; end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + x)) - sqrt(x);
tmp = 0.0;
if (y <= 3.15)
tmp = 1.0 + t_1;
else
tmp = 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[(N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 3.15], N[(1.0 + t$95$1), $MachinePrecision], t$95$1]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + x} - \sqrt{x}\\
\mathbf{if}\;y \leq 3.15:\\
\;\;\;\;1 + t_1\\
\mathbf{else}:\\
\;\;\;\;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 (if (<= z 5.1e+14) (+ (- (sqrt (+ 1.0 z)) (sqrt z)) 2.0) (+ 1.0 (- (sqrt (+ 1.0 y)) (sqrt y)))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (z <= 5.1e+14) {
tmp = (sqrt((1.0 + z)) - sqrt(z)) + 2.0;
} else {
tmp = 1.0 + (sqrt((1.0 + y)) - 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) :: tmp
if (z <= 5.1d+14) then
tmp = (sqrt((1.0d0 + z)) - sqrt(z)) + 2.0d0
else
tmp = 1.0d0 + (sqrt((1.0d0 + y)) - 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 tmp;
if (z <= 5.1e+14) {
tmp = (Math.sqrt((1.0 + z)) - Math.sqrt(z)) + 2.0;
} else {
tmp = 1.0 + (Math.sqrt((1.0 + y)) - Math.sqrt(y));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if z <= 5.1e+14: tmp = (math.sqrt((1.0 + z)) - math.sqrt(z)) + 2.0 else: tmp = 1.0 + (math.sqrt((1.0 + y)) - math.sqrt(y)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (z <= 5.1e+14) tmp = Float64(Float64(sqrt(Float64(1.0 + z)) - sqrt(z)) + 2.0); else tmp = Float64(1.0 + Float64(sqrt(Float64(1.0 + y)) - sqrt(y))); 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 (z <= 5.1e+14)
tmp = (sqrt((1.0 + z)) - sqrt(z)) + 2.0;
else
tmp = 1.0 + (sqrt((1.0 + y)) - 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_] := If[LessEqual[z, 5.1e+14], N[(N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision], N[(1.0 + N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq 5.1 \cdot 10^{+14}:\\
\;\;\;\;\left(\sqrt{1 + z} - \sqrt{z}\right) + 2\\
\mathbf{else}:\\
\;\;\;\;1 + \left(\sqrt{1 + y} - \sqrt{y}\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 (+ 1.0 (- (sqrt (+ 1.0 y)) (sqrt y))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
return 1.0 + (sqrt((1.0 + 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 = 1.0d0 + (sqrt((1.0d0 + 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 1.0 + (Math.sqrt((1.0 + y)) - Math.sqrt(y));
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): return 1.0 + (math.sqrt((1.0 + y)) - math.sqrt(y))
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) return Float64(1.0 + Float64(sqrt(Float64(1.0 + y)) - sqrt(y))) end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp = code(x, y, z, t)
tmp = 1.0 + (sqrt((1.0 + 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[(1.0 + N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
1 + \left(\sqrt{1 + y} - \sqrt{y}\right)
\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}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (- (+ 1.0 (* x 0.5)) (sqrt x)))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
return (1.0 + (x * 0.5)) - sqrt(x);
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (1.0d0 + (x * 0.5d0)) - sqrt(x)
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
return (1.0 + (x * 0.5)) - Math.sqrt(x);
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): return (1.0 + (x * 0.5)) - math.sqrt(x)
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) return Float64(Float64(1.0 + Float64(x * 0.5)) - sqrt(x)) end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp = code(x, y, z, t)
tmp = (1.0 + (x * 0.5)) - 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[(1.0 + N[(x * 0.5), $MachinePrecision]), $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\left(1 + x \cdot 0.5\right) - \sqrt{x}
\end{array}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 1.0)
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
return 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
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
return 1.0;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): return 1.0
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) return 1.0 end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp = code(x, y, z, t)
tmp = 1.0;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := 1.0
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
1
\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}
herbie shell --seed 2024006
(FPCore (x y z t)
:name "Main:z from "
:precision binary64
:herbie-target
(+ (+ (+ (/ 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)))
(+ (+ (+ (- (sqrt (+ x 1.0)) (sqrt x)) (- (sqrt (+ y 1.0)) (sqrt y))) (- (sqrt (+ z 1.0)) (sqrt z))) (- (sqrt (+ t 1.0)) (sqrt t))))