
(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 16 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 (sqrt (+ 1.0 y)))
(t_2 (sqrt (+ z 1.0)))
(t_3 (sqrt (+ x 1.0)))
(t_4 (sqrt (+ 1.0 t))))
(if (<= z 7.6e+40)
(+
(+ (- t_3 (sqrt x)) (+ (- t_1 (sqrt y)) (/ 1.0 (+ t_2 (sqrt z)))))
(/ 1.0 (+ t_4 (sqrt t))))
(+
(/ 1.0 (+ (sqrt x) t_3))
(+ (/ 1.0 (+ t_1 (sqrt y))) (+ t_4 (- (- t_2 (sqrt z)) (sqrt t))))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + y));
double t_2 = sqrt((z + 1.0));
double t_3 = sqrt((x + 1.0));
double t_4 = sqrt((1.0 + t));
double tmp;
if (z <= 7.6e+40) {
tmp = ((t_3 - sqrt(x)) + ((t_1 - sqrt(y)) + (1.0 / (t_2 + sqrt(z))))) + (1.0 / (t_4 + sqrt(t)));
} else {
tmp = (1.0 / (sqrt(x) + t_3)) + ((1.0 / (t_1 + sqrt(y))) + (t_4 + ((t_2 - sqrt(z)) - sqrt(t))));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: tmp
t_1 = sqrt((1.0d0 + y))
t_2 = sqrt((z + 1.0d0))
t_3 = sqrt((x + 1.0d0))
t_4 = sqrt((1.0d0 + t))
if (z <= 7.6d+40) then
tmp = ((t_3 - sqrt(x)) + ((t_1 - sqrt(y)) + (1.0d0 / (t_2 + sqrt(z))))) + (1.0d0 / (t_4 + sqrt(t)))
else
tmp = (1.0d0 / (sqrt(x) + t_3)) + ((1.0d0 / (t_1 + sqrt(y))) + (t_4 + ((t_2 - sqrt(z)) - sqrt(t))))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + y));
double t_2 = Math.sqrt((z + 1.0));
double t_3 = Math.sqrt((x + 1.0));
double t_4 = Math.sqrt((1.0 + t));
double tmp;
if (z <= 7.6e+40) {
tmp = ((t_3 - Math.sqrt(x)) + ((t_1 - Math.sqrt(y)) + (1.0 / (t_2 + Math.sqrt(z))))) + (1.0 / (t_4 + Math.sqrt(t)));
} else {
tmp = (1.0 / (Math.sqrt(x) + t_3)) + ((1.0 / (t_1 + Math.sqrt(y))) + (t_4 + ((t_2 - Math.sqrt(z)) - Math.sqrt(t))));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + y)) t_2 = math.sqrt((z + 1.0)) t_3 = math.sqrt((x + 1.0)) t_4 = math.sqrt((1.0 + t)) tmp = 0 if z <= 7.6e+40: tmp = ((t_3 - math.sqrt(x)) + ((t_1 - math.sqrt(y)) + (1.0 / (t_2 + math.sqrt(z))))) + (1.0 / (t_4 + math.sqrt(t))) else: tmp = (1.0 / (math.sqrt(x) + t_3)) + ((1.0 / (t_1 + math.sqrt(y))) + (t_4 + ((t_2 - math.sqrt(z)) - math.sqrt(t)))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(1.0 + y)) t_2 = sqrt(Float64(z + 1.0)) t_3 = sqrt(Float64(x + 1.0)) t_4 = sqrt(Float64(1.0 + t)) tmp = 0.0 if (z <= 7.6e+40) tmp = Float64(Float64(Float64(t_3 - sqrt(x)) + Float64(Float64(t_1 - sqrt(y)) + Float64(1.0 / Float64(t_2 + sqrt(z))))) + Float64(1.0 / Float64(t_4 + sqrt(t)))); else tmp = Float64(Float64(1.0 / Float64(sqrt(x) + t_3)) + Float64(Float64(1.0 / Float64(t_1 + sqrt(y))) + Float64(t_4 + Float64(Float64(t_2 - sqrt(z)) - sqrt(t))))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + y));
t_2 = sqrt((z + 1.0));
t_3 = sqrt((x + 1.0));
t_4 = sqrt((1.0 + t));
tmp = 0.0;
if (z <= 7.6e+40)
tmp = ((t_3 - sqrt(x)) + ((t_1 - sqrt(y)) + (1.0 / (t_2 + sqrt(z))))) + (1.0 / (t_4 + sqrt(t)));
else
tmp = (1.0 / (sqrt(x) + t_3)) + ((1.0 / (t_1 + sqrt(y))) + (t_4 + ((t_2 - sqrt(z)) - sqrt(t))));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(z + 1.0), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$4 = N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[z, 7.6e+40], N[(N[(N[(t$95$3 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$1 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(t$95$2 + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(t$95$4 + N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + t$95$3), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 / N[(t$95$1 + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$4 + N[(N[(t$95$2 - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + y}\\
t_2 := \sqrt{z + 1}\\
t_3 := \sqrt{x + 1}\\
t_4 := \sqrt{1 + t}\\
\mathbf{if}\;z \leq 7.6 \cdot 10^{+40}:\\
\;\;\;\;\left(\left(t_3 - \sqrt{x}\right) + \left(\left(t_1 - \sqrt{y}\right) + \frac{1}{t_2 + \sqrt{z}}\right)\right) + \frac{1}{t_4 + \sqrt{t}}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{x} + t_3} + \left(\frac{1}{t_1 + \sqrt{y}} + \left(t_4 + \left(\left(t_2 - \sqrt{z}\right) - \sqrt{t}\right)\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 (+ x 1.0)))
(t_2 (- t_1 (sqrt x)))
(t_3 (sqrt (+ 1.0 t)))
(t_4 (- (sqrt (+ 1.0 y)) (sqrt y)))
(t_5 (sqrt (+ z 1.0))))
(if (<= (+ t_2 t_4) 0.4)
(+ (/ 1.0 (+ (sqrt x) t_1)) (+ t_4 (+ t_3 (- (- t_5 (sqrt z)) (sqrt t)))))
(+ (+ t_2 (+ t_4 (/ 1.0 (+ t_5 (sqrt z))))) (/ 1.0 (+ t_3 (sqrt t)))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((x + 1.0));
double t_2 = t_1 - sqrt(x);
double t_3 = sqrt((1.0 + t));
double t_4 = sqrt((1.0 + y)) - sqrt(y);
double t_5 = sqrt((z + 1.0));
double tmp;
if ((t_2 + t_4) <= 0.4) {
tmp = (1.0 / (sqrt(x) + t_1)) + (t_4 + (t_3 + ((t_5 - sqrt(z)) - sqrt(t))));
} else {
tmp = (t_2 + (t_4 + (1.0 / (t_5 + sqrt(z))))) + (1.0 / (t_3 + sqrt(t)));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: t_5
real(8) :: tmp
t_1 = sqrt((x + 1.0d0))
t_2 = t_1 - sqrt(x)
t_3 = sqrt((1.0d0 + t))
t_4 = sqrt((1.0d0 + y)) - sqrt(y)
t_5 = sqrt((z + 1.0d0))
if ((t_2 + t_4) <= 0.4d0) then
tmp = (1.0d0 / (sqrt(x) + t_1)) + (t_4 + (t_3 + ((t_5 - sqrt(z)) - sqrt(t))))
else
tmp = (t_2 + (t_4 + (1.0d0 / (t_5 + sqrt(z))))) + (1.0d0 / (t_3 + sqrt(t)))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((x + 1.0));
double t_2 = t_1 - Math.sqrt(x);
double t_3 = Math.sqrt((1.0 + t));
double t_4 = Math.sqrt((1.0 + y)) - Math.sqrt(y);
double t_5 = Math.sqrt((z + 1.0));
double tmp;
if ((t_2 + t_4) <= 0.4) {
tmp = (1.0 / (Math.sqrt(x) + t_1)) + (t_4 + (t_3 + ((t_5 - Math.sqrt(z)) - Math.sqrt(t))));
} else {
tmp = (t_2 + (t_4 + (1.0 / (t_5 + Math.sqrt(z))))) + (1.0 / (t_3 + Math.sqrt(t)));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((x + 1.0)) t_2 = t_1 - math.sqrt(x) t_3 = math.sqrt((1.0 + t)) t_4 = math.sqrt((1.0 + y)) - math.sqrt(y) t_5 = math.sqrt((z + 1.0)) tmp = 0 if (t_2 + t_4) <= 0.4: tmp = (1.0 / (math.sqrt(x) + t_1)) + (t_4 + (t_3 + ((t_5 - math.sqrt(z)) - math.sqrt(t)))) else: tmp = (t_2 + (t_4 + (1.0 / (t_5 + math.sqrt(z))))) + (1.0 / (t_3 + math.sqrt(t))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(x + 1.0)) t_2 = Float64(t_1 - sqrt(x)) t_3 = sqrt(Float64(1.0 + t)) t_4 = Float64(sqrt(Float64(1.0 + y)) - sqrt(y)) t_5 = sqrt(Float64(z + 1.0)) tmp = 0.0 if (Float64(t_2 + t_4) <= 0.4) tmp = Float64(Float64(1.0 / Float64(sqrt(x) + t_1)) + Float64(t_4 + Float64(t_3 + Float64(Float64(t_5 - sqrt(z)) - sqrt(t))))); else tmp = Float64(Float64(t_2 + Float64(t_4 + Float64(1.0 / Float64(t_5 + sqrt(z))))) + Float64(1.0 / Float64(t_3 + sqrt(t)))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((x + 1.0));
t_2 = t_1 - sqrt(x);
t_3 = sqrt((1.0 + t));
t_4 = sqrt((1.0 + y)) - sqrt(y);
t_5 = sqrt((z + 1.0));
tmp = 0.0;
if ((t_2 + t_4) <= 0.4)
tmp = (1.0 / (sqrt(x) + t_1)) + (t_4 + (t_3 + ((t_5 - sqrt(z)) - sqrt(t))));
else
tmp = (t_2 + (t_4 + (1.0 / (t_5 + sqrt(z))))) + (1.0 / (t_3 + sqrt(t)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(t$95$1 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$4 = N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[Sqrt[N[(z + 1.0), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(t$95$2 + t$95$4), $MachinePrecision], 0.4], N[(N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision] + N[(t$95$4 + N[(t$95$3 + N[(N[(t$95$5 - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(t$95$2 + N[(t$95$4 + N[(1.0 / N[(t$95$5 + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(t$95$3 + N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{x + 1}\\
t_2 := t_1 - \sqrt{x}\\
t_3 := \sqrt{1 + t}\\
t_4 := \sqrt{1 + y} - \sqrt{y}\\
t_5 := \sqrt{z + 1}\\
\mathbf{if}\;t_2 + t_4 \leq 0.4:\\
\;\;\;\;\frac{1}{\sqrt{x} + t_1} + \left(t_4 + \left(t_3 + \left(\left(t_5 - \sqrt{z}\right) - \sqrt{t}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(t_2 + \left(t_4 + \frac{1}{t_5 + \sqrt{z}}\right)\right) + \frac{1}{t_3 + \sqrt{t}}\\
\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)) (sqrt y)))
(t_2 (sqrt (+ z 1.0)))
(t_3 (sqrt (+ x 1.0)))
(t_4 (- t_3 (sqrt x)))
(t_5 (sqrt (+ 1.0 t))))
(if (<= t_4 0.4)
(+ (/ 1.0 (+ (sqrt x) t_3)) (+ t_1 (+ t_5 (- (- t_2 (sqrt z)) (sqrt t)))))
(+ (+ t_4 (+ t_1 (/ 1.0 (+ t_2 (sqrt z))))) (- t_5 (sqrt t))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + y)) - sqrt(y);
double t_2 = sqrt((z + 1.0));
double t_3 = sqrt((x + 1.0));
double t_4 = t_3 - sqrt(x);
double t_5 = sqrt((1.0 + t));
double tmp;
if (t_4 <= 0.4) {
tmp = (1.0 / (sqrt(x) + t_3)) + (t_1 + (t_5 + ((t_2 - sqrt(z)) - sqrt(t))));
} else {
tmp = (t_4 + (t_1 + (1.0 / (t_2 + sqrt(z))))) + (t_5 - sqrt(t));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: t_5
real(8) :: tmp
t_1 = sqrt((1.0d0 + y)) - sqrt(y)
t_2 = sqrt((z + 1.0d0))
t_3 = sqrt((x + 1.0d0))
t_4 = t_3 - sqrt(x)
t_5 = sqrt((1.0d0 + t))
if (t_4 <= 0.4d0) then
tmp = (1.0d0 / (sqrt(x) + t_3)) + (t_1 + (t_5 + ((t_2 - sqrt(z)) - sqrt(t))))
else
tmp = (t_4 + (t_1 + (1.0d0 / (t_2 + sqrt(z))))) + (t_5 - sqrt(t))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + y)) - Math.sqrt(y);
double t_2 = Math.sqrt((z + 1.0));
double t_3 = Math.sqrt((x + 1.0));
double t_4 = t_3 - Math.sqrt(x);
double t_5 = Math.sqrt((1.0 + t));
double tmp;
if (t_4 <= 0.4) {
tmp = (1.0 / (Math.sqrt(x) + t_3)) + (t_1 + (t_5 + ((t_2 - Math.sqrt(z)) - Math.sqrt(t))));
} else {
tmp = (t_4 + (t_1 + (1.0 / (t_2 + Math.sqrt(z))))) + (t_5 - Math.sqrt(t));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + y)) - math.sqrt(y) t_2 = math.sqrt((z + 1.0)) t_3 = math.sqrt((x + 1.0)) t_4 = t_3 - math.sqrt(x) t_5 = math.sqrt((1.0 + t)) tmp = 0 if t_4 <= 0.4: tmp = (1.0 / (math.sqrt(x) + t_3)) + (t_1 + (t_5 + ((t_2 - math.sqrt(z)) - math.sqrt(t)))) else: tmp = (t_4 + (t_1 + (1.0 / (t_2 + math.sqrt(z))))) + (t_5 - math.sqrt(t)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = Float64(sqrt(Float64(1.0 + y)) - sqrt(y)) t_2 = sqrt(Float64(z + 1.0)) t_3 = sqrt(Float64(x + 1.0)) t_4 = Float64(t_3 - sqrt(x)) t_5 = sqrt(Float64(1.0 + t)) tmp = 0.0 if (t_4 <= 0.4) tmp = Float64(Float64(1.0 / Float64(sqrt(x) + t_3)) + Float64(t_1 + Float64(t_5 + Float64(Float64(t_2 - sqrt(z)) - sqrt(t))))); else tmp = Float64(Float64(t_4 + Float64(t_1 + Float64(1.0 / Float64(t_2 + sqrt(z))))) + Float64(t_5 - sqrt(t))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + y)) - sqrt(y);
t_2 = sqrt((z + 1.0));
t_3 = sqrt((x + 1.0));
t_4 = t_3 - sqrt(x);
t_5 = sqrt((1.0 + t));
tmp = 0.0;
if (t_4 <= 0.4)
tmp = (1.0 / (sqrt(x) + t_3)) + (t_1 + (t_5 + ((t_2 - sqrt(z)) - sqrt(t))));
else
tmp = (t_4 + (t_1 + (1.0 / (t_2 + sqrt(z))))) + (t_5 - sqrt(t));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(z + 1.0), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$4 = N[(t$95$3 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t$95$4, 0.4], N[(N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + t$95$3), $MachinePrecision]), $MachinePrecision] + N[(t$95$1 + N[(t$95$5 + N[(N[(t$95$2 - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(t$95$4 + N[(t$95$1 + N[(1.0 / N[(t$95$2 + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$5 - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + y} - \sqrt{y}\\
t_2 := \sqrt{z + 1}\\
t_3 := \sqrt{x + 1}\\
t_4 := t_3 - \sqrt{x}\\
t_5 := \sqrt{1 + t}\\
\mathbf{if}\;t_4 \leq 0.4:\\
\;\;\;\;\frac{1}{\sqrt{x} + t_3} + \left(t_1 + \left(t_5 + \left(\left(t_2 - \sqrt{z}\right) - \sqrt{t}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(t_4 + \left(t_1 + \frac{1}{t_2 + \sqrt{z}}\right)\right) + \left(t_5 - \sqrt{t}\right)\\
\end{array}
\end{array}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ x 1.0))))
(if (<= y 2.8e+33)
(+
(+
(- t_1 (sqrt x))
(+ (- (sqrt (+ 1.0 y)) (sqrt y)) (/ 1.0 (+ (sqrt (+ z 1.0)) (sqrt z)))))
(- (sqrt (+ 1.0 t)) (sqrt t)))
(/ (+ 1.0 (- x x)) (+ (sqrt x) t_1)))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((x + 1.0));
double tmp;
if (y <= 2.8e+33) {
tmp = ((t_1 - sqrt(x)) + ((sqrt((1.0 + y)) - sqrt(y)) + (1.0 / (sqrt((z + 1.0)) + sqrt(z))))) + (sqrt((1.0 + t)) - sqrt(t));
} else {
tmp = (1.0 + (x - x)) / (sqrt(x) + 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((x + 1.0d0))
if (y <= 2.8d+33) then
tmp = ((t_1 - sqrt(x)) + ((sqrt((1.0d0 + y)) - sqrt(y)) + (1.0d0 / (sqrt((z + 1.0d0)) + sqrt(z))))) + (sqrt((1.0d0 + t)) - sqrt(t))
else
tmp = (1.0d0 + (x - x)) / (sqrt(x) + 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((x + 1.0));
double tmp;
if (y <= 2.8e+33) {
tmp = ((t_1 - Math.sqrt(x)) + ((Math.sqrt((1.0 + y)) - Math.sqrt(y)) + (1.0 / (Math.sqrt((z + 1.0)) + Math.sqrt(z))))) + (Math.sqrt((1.0 + t)) - Math.sqrt(t));
} else {
tmp = (1.0 + (x - x)) / (Math.sqrt(x) + t_1);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((x + 1.0)) tmp = 0 if y <= 2.8e+33: tmp = ((t_1 - math.sqrt(x)) + ((math.sqrt((1.0 + y)) - math.sqrt(y)) + (1.0 / (math.sqrt((z + 1.0)) + math.sqrt(z))))) + (math.sqrt((1.0 + t)) - math.sqrt(t)) else: tmp = (1.0 + (x - x)) / (math.sqrt(x) + t_1) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(x + 1.0)) tmp = 0.0 if (y <= 2.8e+33) tmp = Float64(Float64(Float64(t_1 - sqrt(x)) + Float64(Float64(sqrt(Float64(1.0 + y)) - sqrt(y)) + Float64(1.0 / Float64(sqrt(Float64(z + 1.0)) + sqrt(z))))) + Float64(sqrt(Float64(1.0 + t)) - sqrt(t))); else tmp = Float64(Float64(1.0 + Float64(x - x)) / Float64(sqrt(x) + 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((x + 1.0));
tmp = 0.0;
if (y <= 2.8e+33)
tmp = ((t_1 - sqrt(x)) + ((sqrt((1.0 + y)) - sqrt(y)) + (1.0 / (sqrt((z + 1.0)) + sqrt(z))))) + (sqrt((1.0 + t)) - sqrt(t));
else
tmp = (1.0 + (x - x)) / (sqrt(x) + 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[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y, 2.8e+33], N[(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[(1.0 / N[(N[Sqrt[N[(z + 1.0), $MachinePrecision]], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 + N[(x - x), $MachinePrecision]), $MachinePrecision] / N[(N[Sqrt[x], $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{x + 1}\\
\mathbf{if}\;y \leq 2.8 \cdot 10^{+33}:\\
\;\;\;\;\left(\left(t_1 - \sqrt{x}\right) + \left(\left(\sqrt{1 + y} - \sqrt{y}\right) + \frac{1}{\sqrt{z + 1} + \sqrt{z}}\right)\right) + \left(\sqrt{1 + t} - \sqrt{t}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1 + \left(x - x\right)}{\sqrt{x} + t_1}\\
\end{array}
\end{array}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ x 1.0))) (t_2 (- t_1 (sqrt x))) (t_3 (sqrt (+ z 1.0))))
(if (<= y 1.45e-7)
(+
(- (sqrt (+ 1.0 t)) (sqrt t))
(+ t_2 (+ (/ 1.0 (+ t_3 (sqrt z))) (- (+ 1.0 (* y 0.5)) (sqrt y)))))
(if (<= y 2.8e+33)
(+ t_2 (+ (/ 1.0 (+ (sqrt (+ 1.0 y)) (sqrt y))) (- t_3 (sqrt z))))
(/ (+ 1.0 (- x x)) (+ (sqrt x) t_1))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((x + 1.0));
double t_2 = t_1 - sqrt(x);
double t_3 = sqrt((z + 1.0));
double tmp;
if (y <= 1.45e-7) {
tmp = (sqrt((1.0 + t)) - sqrt(t)) + (t_2 + ((1.0 / (t_3 + sqrt(z))) + ((1.0 + (y * 0.5)) - sqrt(y))));
} else if (y <= 2.8e+33) {
tmp = t_2 + ((1.0 / (sqrt((1.0 + y)) + sqrt(y))) + (t_3 - sqrt(z)));
} else {
tmp = (1.0 + (x - x)) / (sqrt(x) + t_1);
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = sqrt((x + 1.0d0))
t_2 = t_1 - sqrt(x)
t_3 = sqrt((z + 1.0d0))
if (y <= 1.45d-7) then
tmp = (sqrt((1.0d0 + t)) - sqrt(t)) + (t_2 + ((1.0d0 / (t_3 + sqrt(z))) + ((1.0d0 + (y * 0.5d0)) - sqrt(y))))
else if (y <= 2.8d+33) then
tmp = t_2 + ((1.0d0 / (sqrt((1.0d0 + y)) + sqrt(y))) + (t_3 - sqrt(z)))
else
tmp = (1.0d0 + (x - x)) / (sqrt(x) + 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((x + 1.0));
double t_2 = t_1 - Math.sqrt(x);
double t_3 = Math.sqrt((z + 1.0));
double tmp;
if (y <= 1.45e-7) {
tmp = (Math.sqrt((1.0 + t)) - Math.sqrt(t)) + (t_2 + ((1.0 / (t_3 + Math.sqrt(z))) + ((1.0 + (y * 0.5)) - Math.sqrt(y))));
} else if (y <= 2.8e+33) {
tmp = t_2 + ((1.0 / (Math.sqrt((1.0 + y)) + Math.sqrt(y))) + (t_3 - Math.sqrt(z)));
} else {
tmp = (1.0 + (x - x)) / (Math.sqrt(x) + t_1);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((x + 1.0)) t_2 = t_1 - math.sqrt(x) t_3 = math.sqrt((z + 1.0)) tmp = 0 if y <= 1.45e-7: tmp = (math.sqrt((1.0 + t)) - math.sqrt(t)) + (t_2 + ((1.0 / (t_3 + math.sqrt(z))) + ((1.0 + (y * 0.5)) - math.sqrt(y)))) elif y <= 2.8e+33: tmp = t_2 + ((1.0 / (math.sqrt((1.0 + y)) + math.sqrt(y))) + (t_3 - math.sqrt(z))) else: tmp = (1.0 + (x - x)) / (math.sqrt(x) + t_1) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(x + 1.0)) t_2 = Float64(t_1 - sqrt(x)) t_3 = sqrt(Float64(z + 1.0)) tmp = 0.0 if (y <= 1.45e-7) tmp = Float64(Float64(sqrt(Float64(1.0 + t)) - sqrt(t)) + Float64(t_2 + Float64(Float64(1.0 / Float64(t_3 + sqrt(z))) + Float64(Float64(1.0 + Float64(y * 0.5)) - sqrt(y))))); elseif (y <= 2.8e+33) tmp = Float64(t_2 + Float64(Float64(1.0 / Float64(sqrt(Float64(1.0 + y)) + sqrt(y))) + Float64(t_3 - sqrt(z)))); else tmp = Float64(Float64(1.0 + Float64(x - x)) / Float64(sqrt(x) + 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((x + 1.0));
t_2 = t_1 - sqrt(x);
t_3 = sqrt((z + 1.0));
tmp = 0.0;
if (y <= 1.45e-7)
tmp = (sqrt((1.0 + t)) - sqrt(t)) + (t_2 + ((1.0 / (t_3 + sqrt(z))) + ((1.0 + (y * 0.5)) - sqrt(y))));
elseif (y <= 2.8e+33)
tmp = t_2 + ((1.0 / (sqrt((1.0 + y)) + sqrt(y))) + (t_3 - sqrt(z)));
else
tmp = (1.0 + (x - x)) / (sqrt(x) + 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[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(t$95$1 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[Sqrt[N[(z + 1.0), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y, 1.45e-7], N[(N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision] + N[(t$95$2 + N[(N[(1.0 / N[(t$95$3 + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 + N[(y * 0.5), $MachinePrecision]), $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.8e+33], N[(t$95$2 + N[(N[(1.0 / N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$3 - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 + N[(x - x), $MachinePrecision]), $MachinePrecision] / N[(N[Sqrt[x], $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{x + 1}\\
t_2 := t_1 - \sqrt{x}\\
t_3 := \sqrt{z + 1}\\
\mathbf{if}\;y \leq 1.45 \cdot 10^{-7}:\\
\;\;\;\;\left(\sqrt{1 + t} - \sqrt{t}\right) + \left(t_2 + \left(\frac{1}{t_3 + \sqrt{z}} + \left(\left(1 + y \cdot 0.5\right) - \sqrt{y}\right)\right)\right)\\
\mathbf{elif}\;y \leq 2.8 \cdot 10^{+33}:\\
\;\;\;\;t_2 + \left(\frac{1}{\sqrt{1 + y} + \sqrt{y}} + \left(t_3 - \sqrt{z}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1 + \left(x - x\right)}{\sqrt{x} + 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 (<= y 8.5e+31)
(+
(-
(+ 1.0 (+ (sqrt (+ 1.0 y)) (/ 1.0 (+ (sqrt (+ z 1.0)) (sqrt z)))))
(sqrt y))
(/ 1.0 (+ (sqrt t) (+ 1.0 (* t 0.5)))))
(/ (+ 1.0 (- x x)) (+ (sqrt x) (sqrt (+ x 1.0))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 8.5e+31) {
tmp = ((1.0 + (sqrt((1.0 + y)) + (1.0 / (sqrt((z + 1.0)) + sqrt(z))))) - sqrt(y)) + (1.0 / (sqrt(t) + (1.0 + (t * 0.5))));
} else {
tmp = (1.0 + (x - x)) / (sqrt(x) + sqrt((x + 1.0)));
}
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 <= 8.5d+31) then
tmp = ((1.0d0 + (sqrt((1.0d0 + y)) + (1.0d0 / (sqrt((z + 1.0d0)) + sqrt(z))))) - sqrt(y)) + (1.0d0 / (sqrt(t) + (1.0d0 + (t * 0.5d0))))
else
tmp = (1.0d0 + (x - x)) / (sqrt(x) + sqrt((x + 1.0d0)))
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 <= 8.5e+31) {
tmp = ((1.0 + (Math.sqrt((1.0 + y)) + (1.0 / (Math.sqrt((z + 1.0)) + Math.sqrt(z))))) - Math.sqrt(y)) + (1.0 / (Math.sqrt(t) + (1.0 + (t * 0.5))));
} else {
tmp = (1.0 + (x - x)) / (Math.sqrt(x) + Math.sqrt((x + 1.0)));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if y <= 8.5e+31: tmp = ((1.0 + (math.sqrt((1.0 + y)) + (1.0 / (math.sqrt((z + 1.0)) + math.sqrt(z))))) - math.sqrt(y)) + (1.0 / (math.sqrt(t) + (1.0 + (t * 0.5)))) else: tmp = (1.0 + (x - x)) / (math.sqrt(x) + math.sqrt((x + 1.0))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (y <= 8.5e+31) tmp = Float64(Float64(Float64(1.0 + Float64(sqrt(Float64(1.0 + y)) + Float64(1.0 / Float64(sqrt(Float64(z + 1.0)) + sqrt(z))))) - sqrt(y)) + Float64(1.0 / Float64(sqrt(t) + Float64(1.0 + Float64(t * 0.5))))); else tmp = Float64(Float64(1.0 + Float64(x - x)) / Float64(sqrt(x) + sqrt(Float64(x + 1.0)))); 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 <= 8.5e+31)
tmp = ((1.0 + (sqrt((1.0 + y)) + (1.0 / (sqrt((z + 1.0)) + sqrt(z))))) - sqrt(y)) + (1.0 / (sqrt(t) + (1.0 + (t * 0.5))));
else
tmp = (1.0 + (x - x)) / (sqrt(x) + sqrt((x + 1.0)));
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, 8.5e+31], N[(N[(N[(1.0 + N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] + N[(1.0 / N[(N[Sqrt[N[(z + 1.0), $MachinePrecision]], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[t], $MachinePrecision] + N[(1.0 + N[(t * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 + N[(x - x), $MachinePrecision]), $MachinePrecision] / N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 8.5 \cdot 10^{+31}:\\
\;\;\;\;\left(\left(1 + \left(\sqrt{1 + y} + \frac{1}{\sqrt{z + 1} + \sqrt{z}}\right)\right) - \sqrt{y}\right) + \frac{1}{\sqrt{t} + \left(1 + t \cdot 0.5\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 + \left(x - x\right)}{\sqrt{x} + \sqrt{x + 1}}\\
\end{array}
\end{array}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ 1.0 y))))
(if (<= z 1.45e-15)
(- (+ (- (sqrt (+ 1.0 t)) (sqrt t)) 3.0) (sqrt z))
(if (<= z 7e+19)
(+ 1.0 (- t_1 (- (+ (sqrt y) (sqrt z)) (sqrt (+ z 1.0)))))
(+ (sqrt (+ x 1.0)) (- t_1 (+ (sqrt x) (sqrt y))))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + y));
double tmp;
if (z <= 1.45e-15) {
tmp = ((sqrt((1.0 + t)) - sqrt(t)) + 3.0) - sqrt(z);
} else if (z <= 7e+19) {
tmp = 1.0 + (t_1 - ((sqrt(y) + sqrt(z)) - sqrt((z + 1.0))));
} else {
tmp = sqrt((x + 1.0)) + (t_1 - (sqrt(x) + sqrt(y)));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = sqrt((1.0d0 + y))
if (z <= 1.45d-15) then
tmp = ((sqrt((1.0d0 + t)) - sqrt(t)) + 3.0d0) - sqrt(z)
else if (z <= 7d+19) then
tmp = 1.0d0 + (t_1 - ((sqrt(y) + sqrt(z)) - sqrt((z + 1.0d0))))
else
tmp = sqrt((x + 1.0d0)) + (t_1 - (sqrt(x) + sqrt(y)))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + y));
double tmp;
if (z <= 1.45e-15) {
tmp = ((Math.sqrt((1.0 + t)) - Math.sqrt(t)) + 3.0) - Math.sqrt(z);
} else if (z <= 7e+19) {
tmp = 1.0 + (t_1 - ((Math.sqrt(y) + Math.sqrt(z)) - Math.sqrt((z + 1.0))));
} else {
tmp = Math.sqrt((x + 1.0)) + (t_1 - (Math.sqrt(x) + Math.sqrt(y)));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + y)) tmp = 0 if z <= 1.45e-15: tmp = ((math.sqrt((1.0 + t)) - math.sqrt(t)) + 3.0) - math.sqrt(z) elif z <= 7e+19: tmp = 1.0 + (t_1 - ((math.sqrt(y) + math.sqrt(z)) - math.sqrt((z + 1.0)))) else: tmp = math.sqrt((x + 1.0)) + (t_1 - (math.sqrt(x) + math.sqrt(y))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(1.0 + y)) tmp = 0.0 if (z <= 1.45e-15) tmp = Float64(Float64(Float64(sqrt(Float64(1.0 + t)) - sqrt(t)) + 3.0) - sqrt(z)); elseif (z <= 7e+19) tmp = Float64(1.0 + Float64(t_1 - Float64(Float64(sqrt(y) + sqrt(z)) - sqrt(Float64(z + 1.0))))); else tmp = Float64(sqrt(Float64(x + 1.0)) + Float64(t_1 - Float64(sqrt(x) + sqrt(y)))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + y));
tmp = 0.0;
if (z <= 1.45e-15)
tmp = ((sqrt((1.0 + t)) - sqrt(t)) + 3.0) - sqrt(z);
elseif (z <= 7e+19)
tmp = 1.0 + (t_1 - ((sqrt(y) + sqrt(z)) - sqrt((z + 1.0))));
else
tmp = sqrt((x + 1.0)) + (t_1 - (sqrt(x) + sqrt(y)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[z, 1.45e-15], N[(N[(N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision] + 3.0), $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 7e+19], N[(1.0 + N[(t$95$1 - N[(N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision] - N[Sqrt[N[(z + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision] + N[(t$95$1 - N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + y}\\
\mathbf{if}\;z \leq 1.45 \cdot 10^{-15}:\\
\;\;\;\;\left(\left(\sqrt{1 + t} - \sqrt{t}\right) + 3\right) - \sqrt{z}\\
\mathbf{elif}\;z \leq 7 \cdot 10^{+19}:\\
\;\;\;\;1 + \left(t_1 - \left(\left(\sqrt{y} + \sqrt{z}\right) - \sqrt{z + 1}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\sqrt{x + 1} + \left(t_1 - \left(\sqrt{x} + \sqrt{y}\right)\right)\\
\end{array}
\end{array}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(if (<= z 1.65e-15)
(- (+ (- (sqrt (+ 1.0 t)) (sqrt t)) 3.0) (sqrt z))
(if (<= z 125000000000.0)
(+ (- (sqrt (+ z 1.0)) (sqrt z)) 2.0)
(+ (sqrt (+ x 1.0)) (- (sqrt (+ 1.0 y)) (+ (sqrt x) (sqrt y)))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (z <= 1.65e-15) {
tmp = ((sqrt((1.0 + t)) - sqrt(t)) + 3.0) - sqrt(z);
} else if (z <= 125000000000.0) {
tmp = (sqrt((z + 1.0)) - sqrt(z)) + 2.0;
} else {
tmp = sqrt((x + 1.0)) + (sqrt((1.0 + y)) - (sqrt(x) + sqrt(y)));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (z <= 1.65d-15) then
tmp = ((sqrt((1.0d0 + t)) - sqrt(t)) + 3.0d0) - sqrt(z)
else if (z <= 125000000000.0d0) then
tmp = (sqrt((z + 1.0d0)) - sqrt(z)) + 2.0d0
else
tmp = sqrt((x + 1.0d0)) + (sqrt((1.0d0 + y)) - (sqrt(x) + sqrt(y)))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= 1.65e-15) {
tmp = ((Math.sqrt((1.0 + t)) - Math.sqrt(t)) + 3.0) - Math.sqrt(z);
} else if (z <= 125000000000.0) {
tmp = (Math.sqrt((z + 1.0)) - Math.sqrt(z)) + 2.0;
} else {
tmp = Math.sqrt((x + 1.0)) + (Math.sqrt((1.0 + y)) - (Math.sqrt(x) + Math.sqrt(y)));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if z <= 1.65e-15: tmp = ((math.sqrt((1.0 + t)) - math.sqrt(t)) + 3.0) - math.sqrt(z) elif z <= 125000000000.0: tmp = (math.sqrt((z + 1.0)) - math.sqrt(z)) + 2.0 else: tmp = math.sqrt((x + 1.0)) + (math.sqrt((1.0 + y)) - (math.sqrt(x) + 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 <= 1.65e-15) tmp = Float64(Float64(Float64(sqrt(Float64(1.0 + t)) - sqrt(t)) + 3.0) - sqrt(z)); elseif (z <= 125000000000.0) tmp = Float64(Float64(sqrt(Float64(z + 1.0)) - sqrt(z)) + 2.0); else tmp = Float64(sqrt(Float64(x + 1.0)) + Float64(sqrt(Float64(1.0 + y)) - Float64(sqrt(x) + sqrt(y)))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (z <= 1.65e-15)
tmp = ((sqrt((1.0 + t)) - sqrt(t)) + 3.0) - sqrt(z);
elseif (z <= 125000000000.0)
tmp = (sqrt((z + 1.0)) - sqrt(z)) + 2.0;
else
tmp = sqrt((x + 1.0)) + (sqrt((1.0 + y)) - (sqrt(x) + sqrt(y)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[z, 1.65e-15], N[(N[(N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision] + 3.0), $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 125000000000.0], N[(N[(N[Sqrt[N[(z + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision], N[(N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision] + N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] - N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq 1.65 \cdot 10^{-15}:\\
\;\;\;\;\left(\left(\sqrt{1 + t} - \sqrt{t}\right) + 3\right) - \sqrt{z}\\
\mathbf{elif}\;z \leq 125000000000:\\
\;\;\;\;\left(\sqrt{z + 1} - \sqrt{z}\right) + 2\\
\mathbf{else}:\\
\;\;\;\;\sqrt{x + 1} + \left(\sqrt{1 + y} - \left(\sqrt{x} + \sqrt{y}\right)\right)\\
\end{array}
\end{array}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(if (<= y 2.2e-31)
(+ (- (sqrt (+ z 1.0)) (sqrt z)) 2.0)
(if (<= y 1e+23)
(- (+ 1.0 (sqrt (+ 1.0 y))) (sqrt y))
(/ (+ 1.0 (- x x)) (+ (sqrt x) (sqrt (+ x 1.0)))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 2.2e-31) {
tmp = (sqrt((z + 1.0)) - sqrt(z)) + 2.0;
} else if (y <= 1e+23) {
tmp = (1.0 + sqrt((1.0 + y))) - sqrt(y);
} else {
tmp = (1.0 + (x - x)) / (sqrt(x) + sqrt((x + 1.0)));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= 2.2d-31) then
tmp = (sqrt((z + 1.0d0)) - sqrt(z)) + 2.0d0
else if (y <= 1d+23) then
tmp = (1.0d0 + sqrt((1.0d0 + y))) - sqrt(y)
else
tmp = (1.0d0 + (x - x)) / (sqrt(x) + sqrt((x + 1.0d0)))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= 2.2e-31) {
tmp = (Math.sqrt((z + 1.0)) - Math.sqrt(z)) + 2.0;
} else if (y <= 1e+23) {
tmp = (1.0 + Math.sqrt((1.0 + y))) - Math.sqrt(y);
} else {
tmp = (1.0 + (x - x)) / (Math.sqrt(x) + Math.sqrt((x + 1.0)));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if y <= 2.2e-31: tmp = (math.sqrt((z + 1.0)) - math.sqrt(z)) + 2.0 elif y <= 1e+23: tmp = (1.0 + math.sqrt((1.0 + y))) - math.sqrt(y) else: tmp = (1.0 + (x - x)) / (math.sqrt(x) + math.sqrt((x + 1.0))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (y <= 2.2e-31) tmp = Float64(Float64(sqrt(Float64(z + 1.0)) - sqrt(z)) + 2.0); elseif (y <= 1e+23) tmp = Float64(Float64(1.0 + sqrt(Float64(1.0 + y))) - sqrt(y)); else tmp = Float64(Float64(1.0 + Float64(x - x)) / Float64(sqrt(x) + sqrt(Float64(x + 1.0)))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (y <= 2.2e-31)
tmp = (sqrt((z + 1.0)) - sqrt(z)) + 2.0;
elseif (y <= 1e+23)
tmp = (1.0 + sqrt((1.0 + y))) - sqrt(y);
else
tmp = (1.0 + (x - x)) / (sqrt(x) + sqrt((x + 1.0)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[y, 2.2e-31], N[(N[(N[Sqrt[N[(z + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision], If[LessEqual[y, 1e+23], N[(N[(1.0 + N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision], N[(N[(1.0 + N[(x - x), $MachinePrecision]), $MachinePrecision] / N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 2.2 \cdot 10^{-31}:\\
\;\;\;\;\left(\sqrt{z + 1} - \sqrt{z}\right) + 2\\
\mathbf{elif}\;y \leq 10^{+23}:\\
\;\;\;\;\left(1 + \sqrt{1 + y}\right) - \sqrt{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 + \left(x - x\right)}{\sqrt{x} + \sqrt{x + 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 (<= y 2.2e-31)
(+ (- (sqrt (+ z 1.0)) (sqrt z)) 2.0)
(if (<= y 3.2e+24)
(- (sqrt (+ 1.0 y)) (+ (sqrt y) -1.0))
(- (sqrt (+ x 1.0)) (sqrt x)))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 2.2e-31) {
tmp = (sqrt((z + 1.0)) - sqrt(z)) + 2.0;
} else if (y <= 3.2e+24) {
tmp = sqrt((1.0 + y)) - (sqrt(y) + -1.0);
} else {
tmp = sqrt((x + 1.0)) - 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 <= 2.2d-31) then
tmp = (sqrt((z + 1.0d0)) - sqrt(z)) + 2.0d0
else if (y <= 3.2d+24) then
tmp = sqrt((1.0d0 + y)) - (sqrt(y) + (-1.0d0))
else
tmp = sqrt((x + 1.0d0)) - 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 <= 2.2e-31) {
tmp = (Math.sqrt((z + 1.0)) - Math.sqrt(z)) + 2.0;
} else if (y <= 3.2e+24) {
tmp = Math.sqrt((1.0 + y)) - (Math.sqrt(y) + -1.0);
} else {
tmp = Math.sqrt((x + 1.0)) - Math.sqrt(x);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if y <= 2.2e-31: tmp = (math.sqrt((z + 1.0)) - math.sqrt(z)) + 2.0 elif y <= 3.2e+24: tmp = math.sqrt((1.0 + y)) - (math.sqrt(y) + -1.0) else: tmp = math.sqrt((x + 1.0)) - 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 <= 2.2e-31) tmp = Float64(Float64(sqrt(Float64(z + 1.0)) - sqrt(z)) + 2.0); elseif (y <= 3.2e+24) tmp = Float64(sqrt(Float64(1.0 + y)) - Float64(sqrt(y) + -1.0)); else tmp = Float64(sqrt(Float64(x + 1.0)) - 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 <= 2.2e-31)
tmp = (sqrt((z + 1.0)) - sqrt(z)) + 2.0;
elseif (y <= 3.2e+24)
tmp = sqrt((1.0 + y)) - (sqrt(y) + -1.0);
else
tmp = sqrt((x + 1.0)) - 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, 2.2e-31], N[(N[(N[Sqrt[N[(z + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision], If[LessEqual[y, 3.2e+24], N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] - N[(N[Sqrt[y], $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 2.2 \cdot 10^{-31}:\\
\;\;\;\;\left(\sqrt{z + 1} - \sqrt{z}\right) + 2\\
\mathbf{elif}\;y \leq 3.2 \cdot 10^{+24}:\\
\;\;\;\;\sqrt{1 + y} - \left(\sqrt{y} + -1\right)\\
\mathbf{else}:\\
\;\;\;\;\sqrt{x + 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 (<= y 2.2e-31)
(+ (- (sqrt (+ z 1.0)) (sqrt z)) 2.0)
(if (<= y 1e+23)
(- (+ 1.0 (sqrt (+ 1.0 y))) (sqrt y))
(- (sqrt (+ x 1.0)) (sqrt x)))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 2.2e-31) {
tmp = (sqrt((z + 1.0)) - sqrt(z)) + 2.0;
} else if (y <= 1e+23) {
tmp = (1.0 + sqrt((1.0 + y))) - sqrt(y);
} else {
tmp = sqrt((x + 1.0)) - 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 <= 2.2d-31) then
tmp = (sqrt((z + 1.0d0)) - sqrt(z)) + 2.0d0
else if (y <= 1d+23) then
tmp = (1.0d0 + sqrt((1.0d0 + y))) - sqrt(y)
else
tmp = sqrt((x + 1.0d0)) - 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 <= 2.2e-31) {
tmp = (Math.sqrt((z + 1.0)) - Math.sqrt(z)) + 2.0;
} else if (y <= 1e+23) {
tmp = (1.0 + Math.sqrt((1.0 + y))) - Math.sqrt(y);
} else {
tmp = Math.sqrt((x + 1.0)) - Math.sqrt(x);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if y <= 2.2e-31: tmp = (math.sqrt((z + 1.0)) - math.sqrt(z)) + 2.0 elif y <= 1e+23: tmp = (1.0 + math.sqrt((1.0 + y))) - math.sqrt(y) else: tmp = math.sqrt((x + 1.0)) - 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 <= 2.2e-31) tmp = Float64(Float64(sqrt(Float64(z + 1.0)) - sqrt(z)) + 2.0); elseif (y <= 1e+23) tmp = Float64(Float64(1.0 + sqrt(Float64(1.0 + y))) - sqrt(y)); else tmp = Float64(sqrt(Float64(x + 1.0)) - 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 <= 2.2e-31)
tmp = (sqrt((z + 1.0)) - sqrt(z)) + 2.0;
elseif (y <= 1e+23)
tmp = (1.0 + sqrt((1.0 + y))) - sqrt(y);
else
tmp = sqrt((x + 1.0)) - 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, 2.2e-31], N[(N[(N[Sqrt[N[(z + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision], If[LessEqual[y, 1e+23], N[(N[(1.0 + N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 2.2 \cdot 10^{-31}:\\
\;\;\;\;\left(\sqrt{z + 1} - \sqrt{z}\right) + 2\\
\mathbf{elif}\;y \leq 10^{+23}:\\
\;\;\;\;\left(1 + \sqrt{1 + y}\right) - \sqrt{y}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{x + 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 (<= y 5.0) (+ (- (sqrt (+ 1.0 t)) (sqrt t)) 2.0) (- (sqrt (+ x 1.0)) (sqrt x))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 5.0) {
tmp = (sqrt((1.0 + t)) - sqrt(t)) + 2.0;
} else {
tmp = sqrt((x + 1.0)) - 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 <= 5.0d0) then
tmp = (sqrt((1.0d0 + t)) - sqrt(t)) + 2.0d0
else
tmp = sqrt((x + 1.0d0)) - 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 <= 5.0) {
tmp = (Math.sqrt((1.0 + t)) - Math.sqrt(t)) + 2.0;
} else {
tmp = Math.sqrt((x + 1.0)) - Math.sqrt(x);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if y <= 5.0: tmp = (math.sqrt((1.0 + t)) - math.sqrt(t)) + 2.0 else: tmp = math.sqrt((x + 1.0)) - 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 <= 5.0) tmp = Float64(Float64(sqrt(Float64(1.0 + t)) - sqrt(t)) + 2.0); else tmp = Float64(sqrt(Float64(x + 1.0)) - 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 <= 5.0)
tmp = (sqrt((1.0 + t)) - sqrt(t)) + 2.0;
else
tmp = sqrt((x + 1.0)) - 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, 5.0], N[(N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision], N[(N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 5:\\
\;\;\;\;\left(\sqrt{1 + t} - \sqrt{t}\right) + 2\\
\mathbf{else}:\\
\;\;\;\;\sqrt{x + 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 (<= y 3.85) (+ (- (sqrt (+ z 1.0)) (sqrt z)) 2.0) (- (sqrt (+ x 1.0)) (sqrt x))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 3.85) {
tmp = (sqrt((z + 1.0)) - sqrt(z)) + 2.0;
} else {
tmp = sqrt((x + 1.0)) - 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 <= 3.85d0) then
tmp = (sqrt((z + 1.0d0)) - sqrt(z)) + 2.0d0
else
tmp = sqrt((x + 1.0d0)) - 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 <= 3.85) {
tmp = (Math.sqrt((z + 1.0)) - Math.sqrt(z)) + 2.0;
} else {
tmp = Math.sqrt((x + 1.0)) - Math.sqrt(x);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if y <= 3.85: tmp = (math.sqrt((z + 1.0)) - math.sqrt(z)) + 2.0 else: tmp = math.sqrt((x + 1.0)) - 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 <= 3.85) tmp = Float64(Float64(sqrt(Float64(z + 1.0)) - sqrt(z)) + 2.0); else tmp = Float64(sqrt(Float64(x + 1.0)) - 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 <= 3.85)
tmp = (sqrt((z + 1.0)) - sqrt(z)) + 2.0;
else
tmp = sqrt((x + 1.0)) - 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, 3.85], N[(N[(N[Sqrt[N[(z + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision], N[(N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 3.85:\\
\;\;\;\;\left(\sqrt{z + 1} - \sqrt{z}\right) + 2\\
\mathbf{else}:\\
\;\;\;\;\sqrt{x + 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 (- (sqrt (+ x 1.0)) (sqrt x)))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
return sqrt((x + 1.0)) - 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((x + 1.0d0)) - 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((x + 1.0)) - Math.sqrt(x);
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): return math.sqrt((x + 1.0)) - math.sqrt(x)
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) return Float64(sqrt(Float64(x + 1.0)) - sqrt(x)) end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp = code(x, y, z, t)
tmp = sqrt((x + 1.0)) - 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[(x + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\sqrt{x + 1} - \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 2023364
(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))))