
(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 20 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 x)))
(t_2 (sqrt (+ 1.0 z)))
(t_3 (- t_2 (sqrt z)))
(t_4 (sqrt (+ 1.0 y))))
(if (<= t_3 0.5)
(+
(+ (/ 1.0 (+ t_1 (sqrt x))) (/ 1.0 (+ t_4 (sqrt y))))
(/ 1.0 (+ t_2 (sqrt z))))
(+
(+ (- t_1 (sqrt x)) (- t_4 (sqrt y)))
(+ t_3 (/ 1.0 (+ (sqrt (+ 1.0 t)) (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 + x));
double t_2 = sqrt((1.0 + z));
double t_3 = t_2 - sqrt(z);
double t_4 = sqrt((1.0 + y));
double tmp;
if (t_3 <= 0.5) {
tmp = ((1.0 / (t_1 + sqrt(x))) + (1.0 / (t_4 + sqrt(y)))) + (1.0 / (t_2 + sqrt(z)));
} else {
tmp = ((t_1 - sqrt(x)) + (t_4 - sqrt(y))) + (t_3 + (1.0 / (sqrt((1.0 + t)) + 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 + x))
t_2 = sqrt((1.0d0 + z))
t_3 = t_2 - sqrt(z)
t_4 = sqrt((1.0d0 + y))
if (t_3 <= 0.5d0) then
tmp = ((1.0d0 / (t_1 + sqrt(x))) + (1.0d0 / (t_4 + sqrt(y)))) + (1.0d0 / (t_2 + sqrt(z)))
else
tmp = ((t_1 - sqrt(x)) + (t_4 - sqrt(y))) + (t_3 + (1.0d0 / (sqrt((1.0d0 + t)) + sqrt(t))))
end if
code = tmp
end function
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 t_3 = t_2 - Math.sqrt(z);
double t_4 = Math.sqrt((1.0 + y));
double tmp;
if (t_3 <= 0.5) {
tmp = ((1.0 / (t_1 + Math.sqrt(x))) + (1.0 / (t_4 + Math.sqrt(y)))) + (1.0 / (t_2 + Math.sqrt(z)));
} else {
tmp = ((t_1 - Math.sqrt(x)) + (t_4 - Math.sqrt(y))) + (t_3 + (1.0 / (Math.sqrt((1.0 + t)) + Math.sqrt(t))));
}
return tmp;
}
[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)) t_3 = t_2 - math.sqrt(z) t_4 = math.sqrt((1.0 + y)) tmp = 0 if t_3 <= 0.5: tmp = ((1.0 / (t_1 + math.sqrt(x))) + (1.0 / (t_4 + math.sqrt(y)))) + (1.0 / (t_2 + math.sqrt(z))) else: tmp = ((t_1 - math.sqrt(x)) + (t_4 - math.sqrt(y))) + (t_3 + (1.0 / (math.sqrt((1.0 + t)) + math.sqrt(t)))) return tmp
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)) t_3 = Float64(t_2 - sqrt(z)) t_4 = sqrt(Float64(1.0 + y)) tmp = 0.0 if (t_3 <= 0.5) tmp = Float64(Float64(Float64(1.0 / Float64(t_1 + sqrt(x))) + Float64(1.0 / Float64(t_4 + sqrt(y)))) + Float64(1.0 / Float64(t_2 + sqrt(z)))); else tmp = Float64(Float64(Float64(t_1 - sqrt(x)) + Float64(t_4 - sqrt(y))) + Float64(t_3 + Float64(1.0 / Float64(sqrt(Float64(1.0 + t)) + 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 + x));
t_2 = sqrt((1.0 + z));
t_3 = t_2 - sqrt(z);
t_4 = sqrt((1.0 + y));
tmp = 0.0;
if (t_3 <= 0.5)
tmp = ((1.0 / (t_1 + sqrt(x))) + (1.0 / (t_4 + sqrt(y)))) + (1.0 / (t_2 + sqrt(z)));
else
tmp = ((t_1 - sqrt(x)) + (t_4 - sqrt(y))) + (t_3 + (1.0 / (sqrt((1.0 + t)) + sqrt(t))));
end
tmp_2 = tmp;
end
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]}, Block[{t$95$3 = N[(t$95$2 - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t$95$3, 0.5], N[(N[(N[(1.0 / N[(t$95$1 + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(t$95$4 + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(t$95$2 + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(t$95$1 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(t$95$4 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$3 + N[(1.0 / N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] + N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\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}\\
t_3 := t_2 - \sqrt{z}\\
t_4 := \sqrt{1 + y}\\
\mathbf{if}\;t_3 \leq 0.5:\\
\;\;\;\;\left(\frac{1}{t_1 + \sqrt{x}} + \frac{1}{t_4 + \sqrt{y}}\right) + \frac{1}{t_2 + \sqrt{z}}\\
\mathbf{else}:\\
\;\;\;\;\left(\left(t_1 - \sqrt{x}\right) + \left(t_4 - \sqrt{y}\right)\right) + \left(t_3 + \frac{1}{\sqrt{1 + t} + \sqrt{t}}\right)\\
\end{array}
\end{array}
if (-.f64 (sqrt.f64 (+.f64 z 1)) (sqrt.f64 z)) < 0.5Initial program 83.5%
associate-+l+83.5%
associate-+l-70.9%
associate-+l-83.5%
sub-neg83.5%
sub-neg83.5%
+-commutative83.5%
+-commutative83.5%
+-commutative83.5%
Simplified83.5%
flip--83.4%
add-sqr-sqrt72.8%
+-commutative72.8%
add-sqr-sqrt83.7%
+-commutative83.7%
Applied egg-rr83.7%
associate--l+86.8%
+-inverses86.8%
metadata-eval86.8%
Simplified86.8%
flip--86.8%
add-sqr-sqrt64.7%
add-sqr-sqrt86.9%
Applied egg-rr86.9%
associate--l+89.9%
+-inverses89.9%
metadata-eval89.9%
Simplified89.9%
flip--89.9%
add-sqr-sqrt50.8%
add-sqr-sqrt90.2%
Applied egg-rr90.2%
associate--l+95.2%
+-inverses95.2%
metadata-eval95.2%
Simplified95.2%
Taylor expanded in t around inf 57.4%
if 0.5 < (-.f64 (sqrt.f64 (+.f64 z 1)) (sqrt.f64 z)) Initial program 97.6%
associate-+l+97.7%
associate-+l-79.8%
associate-+l-97.7%
sub-neg97.7%
sub-neg97.7%
+-commutative97.7%
+-commutative97.7%
+-commutative97.7%
Simplified97.7%
flip--97.6%
add-sqr-sqrt74.5%
+-commutative74.5%
add-sqr-sqrt98.5%
+-commutative98.5%
Applied egg-rr98.5%
+-commutative98.5%
associate--l+98.6%
+-inverses98.6%
metadata-eval98.6%
+-commutative98.6%
+-commutative98.6%
Simplified98.6%
Final simplification78.3%
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 x)) (sqrt x))) (pow (pow (/ 1.0 (+ (sqrt (+ 1.0 y)) (sqrt y))) 3.0) 0.3333333333333333)) (+ (- (sqrt (+ 1.0 t)) (sqrt t)) (/ 1.0 (+ (sqrt (+ 1.0 z)) (sqrt z))))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
return ((1.0 / (sqrt((1.0 + x)) + sqrt(x))) + pow(pow((1.0 / (sqrt((1.0 + y)) + sqrt(y))), 3.0), 0.3333333333333333)) + ((sqrt((1.0 + t)) - sqrt(t)) + (1.0 / (sqrt((1.0 + z)) + sqrt(z))));
}
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 + x)) + sqrt(x))) + (((1.0d0 / (sqrt((1.0d0 + y)) + sqrt(y))) ** 3.0d0) ** 0.3333333333333333d0)) + ((sqrt((1.0d0 + t)) - sqrt(t)) + (1.0d0 / (sqrt((1.0d0 + z)) + sqrt(z))))
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 + x)) + Math.sqrt(x))) + Math.pow(Math.pow((1.0 / (Math.sqrt((1.0 + y)) + Math.sqrt(y))), 3.0), 0.3333333333333333)) + ((Math.sqrt((1.0 + t)) - Math.sqrt(t)) + (1.0 / (Math.sqrt((1.0 + z)) + Math.sqrt(z))));
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): return ((1.0 / (math.sqrt((1.0 + x)) + math.sqrt(x))) + math.pow(math.pow((1.0 / (math.sqrt((1.0 + y)) + math.sqrt(y))), 3.0), 0.3333333333333333)) + ((math.sqrt((1.0 + t)) - math.sqrt(t)) + (1.0 / (math.sqrt((1.0 + z)) + math.sqrt(z))))
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) return Float64(Float64(Float64(1.0 / Float64(sqrt(Float64(1.0 + x)) + sqrt(x))) + ((Float64(1.0 / Float64(sqrt(Float64(1.0 + y)) + sqrt(y))) ^ 3.0) ^ 0.3333333333333333)) + Float64(Float64(sqrt(Float64(1.0 + t)) - sqrt(t)) + Float64(1.0 / Float64(sqrt(Float64(1.0 + z)) + sqrt(z))))) end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp = code(x, y, z, t)
tmp = ((1.0 / (sqrt((1.0 + x)) + sqrt(x))) + (((1.0 / (sqrt((1.0 + y)) + sqrt(y))) ^ 3.0) ^ 0.3333333333333333)) + ((sqrt((1.0 + t)) - sqrt(t)) + (1.0 / (sqrt((1.0 + z)) + sqrt(z))));
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[(1.0 / N[(N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[Power[N[Power[N[(1.0 / N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 3.0], $MachinePrecision], 0.3333333333333333], $MachinePrecision]), $MachinePrecision] + N[(N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\left(\frac{1}{\sqrt{1 + x} + \sqrt{x}} + {\left({\left(\frac{1}{\sqrt{1 + y} + \sqrt{y}}\right)}^{3}\right)}^{0.3333333333333333}\right) + \left(\left(\sqrt{1 + t} - \sqrt{t}\right) + \frac{1}{\sqrt{1 + z} + \sqrt{z}}\right)
\end{array}
Initial program 90.7%
associate-+l+90.7%
associate-+l-75.4%
associate-+l-90.7%
sub-neg90.7%
sub-neg90.7%
+-commutative90.7%
+-commutative90.7%
+-commutative90.7%
Simplified90.7%
flip--90.6%
add-sqr-sqrt73.8%
+-commutative73.8%
add-sqr-sqrt90.9%
+-commutative90.9%
Applied egg-rr90.9%
associate--l+92.7%
+-inverses92.7%
metadata-eval92.7%
Simplified92.7%
flip--92.6%
add-sqr-sqrt69.3%
add-sqr-sqrt92.8%
Applied egg-rr92.8%
associate--l+94.5%
+-inverses94.5%
metadata-eval94.5%
Simplified94.5%
flip--94.5%
add-sqr-sqrt75.3%
add-sqr-sqrt94.7%
Applied egg-rr94.7%
associate--l+97.1%
+-inverses97.1%
metadata-eval97.1%
Simplified97.1%
add-cbrt-cube97.1%
pow1/397.0%
pow397.0%
Applied egg-rr97.0%
Final simplification97.0%
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)))
(t_3 (- t_2 (sqrt z)))
(t_4 (sqrt (+ 1.0 y))))
(if (<= t_3 0.5)
(+
(+ (/ 1.0 (+ t_1 (sqrt x))) (/ 1.0 (+ t_4 (sqrt y))))
(/ 1.0 (+ t_2 (sqrt z))))
(+
(- (sqrt (+ 1.0 t)) (sqrt t))
(+ t_3 (+ (- t_1 (sqrt x)) (- t_4 (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 + x));
double t_2 = sqrt((1.0 + z));
double t_3 = t_2 - sqrt(z);
double t_4 = sqrt((1.0 + y));
double tmp;
if (t_3 <= 0.5) {
tmp = ((1.0 / (t_1 + sqrt(x))) + (1.0 / (t_4 + sqrt(y)))) + (1.0 / (t_2 + sqrt(z)));
} else {
tmp = (sqrt((1.0 + t)) - sqrt(t)) + (t_3 + ((t_1 - sqrt(x)) + (t_4 - 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) :: t_4
real(8) :: tmp
t_1 = sqrt((1.0d0 + x))
t_2 = sqrt((1.0d0 + z))
t_3 = t_2 - sqrt(z)
t_4 = sqrt((1.0d0 + y))
if (t_3 <= 0.5d0) then
tmp = ((1.0d0 / (t_1 + sqrt(x))) + (1.0d0 / (t_4 + sqrt(y)))) + (1.0d0 / (t_2 + sqrt(z)))
else
tmp = (sqrt((1.0d0 + t)) - sqrt(t)) + (t_3 + ((t_1 - sqrt(x)) + (t_4 - 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 + x));
double t_2 = Math.sqrt((1.0 + z));
double t_3 = t_2 - Math.sqrt(z);
double t_4 = Math.sqrt((1.0 + y));
double tmp;
if (t_3 <= 0.5) {
tmp = ((1.0 / (t_1 + Math.sqrt(x))) + (1.0 / (t_4 + Math.sqrt(y)))) + (1.0 / (t_2 + Math.sqrt(z)));
} else {
tmp = (Math.sqrt((1.0 + t)) - Math.sqrt(t)) + (t_3 + ((t_1 - Math.sqrt(x)) + (t_4 - 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 + x)) t_2 = math.sqrt((1.0 + z)) t_3 = t_2 - math.sqrt(z) t_4 = math.sqrt((1.0 + y)) tmp = 0 if t_3 <= 0.5: tmp = ((1.0 / (t_1 + math.sqrt(x))) + (1.0 / (t_4 + math.sqrt(y)))) + (1.0 / (t_2 + math.sqrt(z))) else: tmp = (math.sqrt((1.0 + t)) - math.sqrt(t)) + (t_3 + ((t_1 - math.sqrt(x)) + (t_4 - 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 + x)) t_2 = sqrt(Float64(1.0 + z)) t_3 = Float64(t_2 - sqrt(z)) t_4 = sqrt(Float64(1.0 + y)) tmp = 0.0 if (t_3 <= 0.5) tmp = Float64(Float64(Float64(1.0 / Float64(t_1 + sqrt(x))) + Float64(1.0 / Float64(t_4 + sqrt(y)))) + Float64(1.0 / Float64(t_2 + sqrt(z)))); else tmp = Float64(Float64(sqrt(Float64(1.0 + t)) - sqrt(t)) + Float64(t_3 + Float64(Float64(t_1 - sqrt(x)) + Float64(t_4 - 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 + x));
t_2 = sqrt((1.0 + z));
t_3 = t_2 - sqrt(z);
t_4 = sqrt((1.0 + y));
tmp = 0.0;
if (t_3 <= 0.5)
tmp = ((1.0 / (t_1 + sqrt(x))) + (1.0 / (t_4 + sqrt(y)))) + (1.0 / (t_2 + sqrt(z)));
else
tmp = (sqrt((1.0 + t)) - sqrt(t)) + (t_3 + ((t_1 - sqrt(x)) + (t_4 - 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 + x), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[(t$95$2 - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t$95$3, 0.5], N[(N[(N[(1.0 / N[(t$95$1 + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(t$95$4 + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(t$95$2 + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision] + N[(t$95$3 + N[(N[(t$95$1 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(t$95$4 - N[Sqrt[y], $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 + x}\\
t_2 := \sqrt{1 + z}\\
t_3 := t_2 - \sqrt{z}\\
t_4 := \sqrt{1 + y}\\
\mathbf{if}\;t_3 \leq 0.5:\\
\;\;\;\;\left(\frac{1}{t_1 + \sqrt{x}} + \frac{1}{t_4 + \sqrt{y}}\right) + \frac{1}{t_2 + \sqrt{z}}\\
\mathbf{else}:\\
\;\;\;\;\left(\sqrt{1 + t} - \sqrt{t}\right) + \left(t_3 + \left(\left(t_1 - \sqrt{x}\right) + \left(t_4 - \sqrt{y}\right)\right)\right)\\
\end{array}
\end{array}
if (-.f64 (sqrt.f64 (+.f64 z 1)) (sqrt.f64 z)) < 0.5Initial program 83.5%
associate-+l+83.5%
associate-+l-70.9%
associate-+l-83.5%
sub-neg83.5%
sub-neg83.5%
+-commutative83.5%
+-commutative83.5%
+-commutative83.5%
Simplified83.5%
flip--83.4%
add-sqr-sqrt72.8%
+-commutative72.8%
add-sqr-sqrt83.7%
+-commutative83.7%
Applied egg-rr83.7%
associate--l+86.8%
+-inverses86.8%
metadata-eval86.8%
Simplified86.8%
flip--86.8%
add-sqr-sqrt64.7%
add-sqr-sqrt86.9%
Applied egg-rr86.9%
associate--l+89.9%
+-inverses89.9%
metadata-eval89.9%
Simplified89.9%
flip--89.9%
add-sqr-sqrt50.8%
add-sqr-sqrt90.2%
Applied egg-rr90.2%
associate--l+95.2%
+-inverses95.2%
metadata-eval95.2%
Simplified95.2%
Taylor expanded in t around inf 57.4%
if 0.5 < (-.f64 (sqrt.f64 (+.f64 z 1)) (sqrt.f64 z)) Initial program 97.6%
Final simplification77.8%
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 t)) (sqrt t)) (/ 1.0 (+ (sqrt (+ 1.0 z)) (sqrt z)))) (+ (/ 1.0 (+ (sqrt (+ 1.0 x)) (sqrt x))) (/ 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 ((sqrt((1.0 + t)) - sqrt(t)) + (1.0 / (sqrt((1.0 + z)) + sqrt(z)))) + ((1.0 / (sqrt((1.0 + x)) + sqrt(x))) + (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 = ((sqrt((1.0d0 + t)) - sqrt(t)) + (1.0d0 / (sqrt((1.0d0 + z)) + sqrt(z)))) + ((1.0d0 / (sqrt((1.0d0 + x)) + sqrt(x))) + (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 ((Math.sqrt((1.0 + t)) - Math.sqrt(t)) + (1.0 / (Math.sqrt((1.0 + z)) + Math.sqrt(z)))) + ((1.0 / (Math.sqrt((1.0 + x)) + Math.sqrt(x))) + (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 ((math.sqrt((1.0 + t)) - math.sqrt(t)) + (1.0 / (math.sqrt((1.0 + z)) + math.sqrt(z)))) + ((1.0 / (math.sqrt((1.0 + x)) + math.sqrt(x))) + (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(Float64(Float64(sqrt(Float64(1.0 + t)) - sqrt(t)) + Float64(1.0 / Float64(sqrt(Float64(1.0 + z)) + sqrt(z)))) + Float64(Float64(1.0 / Float64(sqrt(Float64(1.0 + x)) + sqrt(x))) + 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 = ((sqrt((1.0 + t)) - sqrt(t)) + (1.0 / (sqrt((1.0 + z)) + sqrt(z)))) + ((1.0 / (sqrt((1.0 + x)) + sqrt(x))) + (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[(N[(N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 / N[(N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\left(\left(\sqrt{1 + t} - \sqrt{t}\right) + \frac{1}{\sqrt{1 + z} + \sqrt{z}}\right) + \left(\frac{1}{\sqrt{1 + x} + \sqrt{x}} + \frac{1}{\sqrt{1 + y} + \sqrt{y}}\right)
\end{array}
Initial program 90.7%
associate-+l+90.7%
associate-+l-75.4%
associate-+l-90.7%
sub-neg90.7%
sub-neg90.7%
+-commutative90.7%
+-commutative90.7%
+-commutative90.7%
Simplified90.7%
flip--90.6%
add-sqr-sqrt73.8%
+-commutative73.8%
add-sqr-sqrt90.9%
+-commutative90.9%
Applied egg-rr90.9%
associate--l+92.7%
+-inverses92.7%
metadata-eval92.7%
Simplified92.7%
flip--92.6%
add-sqr-sqrt69.3%
add-sqr-sqrt92.8%
Applied egg-rr92.8%
associate--l+94.5%
+-inverses94.5%
metadata-eval94.5%
Simplified94.5%
flip--94.5%
add-sqr-sqrt75.3%
add-sqr-sqrt94.7%
Applied egg-rr94.7%
associate--l+97.1%
+-inverses97.1%
metadata-eval97.1%
Simplified97.1%
Final simplification97.1%
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 x)) (sqrt x))) (/ 1.0 (+ (sqrt (+ 1.0 y)) (sqrt y)))) (+ (- (sqrt (+ 1.0 t)) (sqrt t)) (- (sqrt (+ 1.0 z)) (sqrt z)))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
return ((1.0 / (sqrt((1.0 + x)) + sqrt(x))) + (1.0 / (sqrt((1.0 + y)) + sqrt(y)))) + ((sqrt((1.0 + t)) - sqrt(t)) + (sqrt((1.0 + z)) - sqrt(z)));
}
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 + x)) + sqrt(x))) + (1.0d0 / (sqrt((1.0d0 + y)) + sqrt(y)))) + ((sqrt((1.0d0 + t)) - sqrt(t)) + (sqrt((1.0d0 + z)) - sqrt(z)))
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 + x)) + Math.sqrt(x))) + (1.0 / (Math.sqrt((1.0 + y)) + Math.sqrt(y)))) + ((Math.sqrt((1.0 + t)) - Math.sqrt(t)) + (Math.sqrt((1.0 + z)) - Math.sqrt(z)));
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): return ((1.0 / (math.sqrt((1.0 + x)) + math.sqrt(x))) + (1.0 / (math.sqrt((1.0 + y)) + math.sqrt(y)))) + ((math.sqrt((1.0 + t)) - math.sqrt(t)) + (math.sqrt((1.0 + z)) - math.sqrt(z)))
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) return Float64(Float64(Float64(1.0 / Float64(sqrt(Float64(1.0 + x)) + sqrt(x))) + Float64(1.0 / Float64(sqrt(Float64(1.0 + y)) + sqrt(y)))) + Float64(Float64(sqrt(Float64(1.0 + t)) - sqrt(t)) + Float64(sqrt(Float64(1.0 + z)) - sqrt(z)))) end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp = code(x, y, z, t)
tmp = ((1.0 / (sqrt((1.0 + x)) + sqrt(x))) + (1.0 / (sqrt((1.0 + y)) + sqrt(y)))) + ((sqrt((1.0 + t)) - sqrt(t)) + (sqrt((1.0 + z)) - sqrt(z)));
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[(1.0 / N[(N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\left(\frac{1}{\sqrt{1 + x} + \sqrt{x}} + \frac{1}{\sqrt{1 + y} + \sqrt{y}}\right) + \left(\left(\sqrt{1 + t} - \sqrt{t}\right) + \left(\sqrt{1 + z} - \sqrt{z}\right)\right)
\end{array}
Initial program 90.7%
associate-+l+90.7%
associate-+l-75.4%
associate-+l-90.7%
sub-neg90.7%
sub-neg90.7%
+-commutative90.7%
+-commutative90.7%
+-commutative90.7%
Simplified90.7%
flip--90.6%
add-sqr-sqrt73.8%
+-commutative73.8%
add-sqr-sqrt90.9%
+-commutative90.9%
Applied egg-rr90.9%
associate--l+92.7%
+-inverses92.7%
metadata-eval92.7%
Simplified92.7%
flip--92.6%
add-sqr-sqrt69.3%
add-sqr-sqrt92.8%
Applied egg-rr92.8%
associate--l+94.5%
+-inverses94.5%
metadata-eval94.5%
Simplified94.5%
Final simplification94.5%
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))) (t_3 (sqrt (+ 1.0 y))))
(if (<= z 1.55e-19)
(+
t_3
(-
(- (+ t_1 (+ t_2 (- (- (sqrt (+ 1.0 t)) (sqrt t)) (sqrt x)))) (sqrt z))
(sqrt y)))
(+
(+ (/ 1.0 (+ t_1 (sqrt x))) (/ 1.0 (+ t_3 (sqrt y))))
(/ 1.0 (+ 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 t_3 = sqrt((1.0 + y));
double tmp;
if (z <= 1.55e-19) {
tmp = t_3 + (((t_1 + (t_2 + ((sqrt((1.0 + t)) - sqrt(t)) - sqrt(x)))) - sqrt(z)) - sqrt(y));
} else {
tmp = ((1.0 / (t_1 + sqrt(x))) + (1.0 / (t_3 + sqrt(y)))) + (1.0 / (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) :: t_3
real(8) :: tmp
t_1 = sqrt((1.0d0 + x))
t_2 = sqrt((1.0d0 + z))
t_3 = sqrt((1.0d0 + y))
if (z <= 1.55d-19) then
tmp = t_3 + (((t_1 + (t_2 + ((sqrt((1.0d0 + t)) - sqrt(t)) - sqrt(x)))) - sqrt(z)) - sqrt(y))
else
tmp = ((1.0d0 / (t_1 + sqrt(x))) + (1.0d0 / (t_3 + sqrt(y)))) + (1.0d0 / (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 t_3 = Math.sqrt((1.0 + y));
double tmp;
if (z <= 1.55e-19) {
tmp = t_3 + (((t_1 + (t_2 + ((Math.sqrt((1.0 + t)) - Math.sqrt(t)) - Math.sqrt(x)))) - Math.sqrt(z)) - Math.sqrt(y));
} else {
tmp = ((1.0 / (t_1 + Math.sqrt(x))) + (1.0 / (t_3 + Math.sqrt(y)))) + (1.0 / (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)) t_3 = math.sqrt((1.0 + y)) tmp = 0 if z <= 1.55e-19: tmp = t_3 + (((t_1 + (t_2 + ((math.sqrt((1.0 + t)) - math.sqrt(t)) - math.sqrt(x)))) - math.sqrt(z)) - math.sqrt(y)) else: tmp = ((1.0 / (t_1 + math.sqrt(x))) + (1.0 / (t_3 + math.sqrt(y)))) + (1.0 / (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)) t_3 = sqrt(Float64(1.0 + y)) tmp = 0.0 if (z <= 1.55e-19) tmp = Float64(t_3 + Float64(Float64(Float64(t_1 + Float64(t_2 + Float64(Float64(sqrt(Float64(1.0 + t)) - sqrt(t)) - sqrt(x)))) - sqrt(z)) - sqrt(y))); else tmp = Float64(Float64(Float64(1.0 / Float64(t_1 + sqrt(x))) + Float64(1.0 / Float64(t_3 + sqrt(y)))) + Float64(1.0 / 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));
t_3 = sqrt((1.0 + y));
tmp = 0.0;
if (z <= 1.55e-19)
tmp = t_3 + (((t_1 + (t_2 + ((sqrt((1.0 + t)) - sqrt(t)) - sqrt(x)))) - sqrt(z)) - sqrt(y));
else
tmp = ((1.0 / (t_1 + sqrt(x))) + (1.0 / (t_3 + sqrt(y)))) + (1.0 / (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]}, Block[{t$95$3 = N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[z, 1.55e-19], N[(t$95$3 + N[(N[(N[(t$95$1 + N[(t$95$2 + N[(N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 / N[(t$95$1 + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(t$95$3 + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / 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}\\
t_3 := \sqrt{1 + y}\\
\mathbf{if}\;z \leq 1.55 \cdot 10^{-19}:\\
\;\;\;\;t_3 + \left(\left(\left(t_1 + \left(t_2 + \left(\left(\sqrt{1 + t} - \sqrt{t}\right) - \sqrt{x}\right)\right)\right) - \sqrt{z}\right) - \sqrt{y}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{1}{t_1 + \sqrt{x}} + \frac{1}{t_3 + \sqrt{y}}\right) + \frac{1}{t_2 + \sqrt{z}}\\
\end{array}
\end{array}
if z < 1.5499999999999999e-19Initial program 97.6%
Simplified31.8%
if 1.5499999999999999e-19 < z Initial program 84.3%
associate-+l+84.3%
associate-+l-71.8%
associate-+l-84.3%
sub-neg84.3%
sub-neg84.3%
+-commutative84.3%
+-commutative84.3%
+-commutative84.3%
Simplified84.3%
flip--84.3%
add-sqr-sqrt74.2%
+-commutative74.2%
add-sqr-sqrt84.5%
+-commutative84.5%
Applied egg-rr84.5%
associate--l+87.4%
+-inverses87.4%
metadata-eval87.4%
Simplified87.4%
flip--87.4%
add-sqr-sqrt65.0%
add-sqr-sqrt87.5%
Applied egg-rr87.5%
associate--l+90.4%
+-inverses90.4%
metadata-eval90.4%
Simplified90.4%
flip--90.4%
add-sqr-sqrt53.3%
add-sqr-sqrt90.7%
Applied egg-rr90.7%
associate--l+95.4%
+-inverses95.4%
metadata-eval95.4%
Simplified95.4%
Taylor expanded in t around inf 57.8%
Final simplification45.3%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(if (<= t 4.8e+25)
(+ 3.0 (- (sqrt (+ 1.0 t)) (sqrt t)))
(+
(+
(/ 1.0 (+ (sqrt (+ 1.0 x)) (sqrt x)))
(/ 1.0 (+ (sqrt (+ 1.0 y)) (sqrt y))))
(/ 1.0 (+ (sqrt (+ 1.0 z)) (sqrt z))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (t <= 4.8e+25) {
tmp = 3.0 + (sqrt((1.0 + t)) - sqrt(t));
} else {
tmp = ((1.0 / (sqrt((1.0 + x)) + sqrt(x))) + (1.0 / (sqrt((1.0 + y)) + sqrt(y)))) + (1.0 / (sqrt((1.0 + z)) + 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) :: tmp
if (t <= 4.8d+25) then
tmp = 3.0d0 + (sqrt((1.0d0 + t)) - sqrt(t))
else
tmp = ((1.0d0 / (sqrt((1.0d0 + x)) + sqrt(x))) + (1.0d0 / (sqrt((1.0d0 + y)) + sqrt(y)))) + (1.0d0 / (sqrt((1.0d0 + z)) + 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 tmp;
if (t <= 4.8e+25) {
tmp = 3.0 + (Math.sqrt((1.0 + t)) - Math.sqrt(t));
} else {
tmp = ((1.0 / (Math.sqrt((1.0 + x)) + Math.sqrt(x))) + (1.0 / (Math.sqrt((1.0 + y)) + Math.sqrt(y)))) + (1.0 / (Math.sqrt((1.0 + z)) + Math.sqrt(z)));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if t <= 4.8e+25: tmp = 3.0 + (math.sqrt((1.0 + t)) - math.sqrt(t)) else: tmp = ((1.0 / (math.sqrt((1.0 + x)) + math.sqrt(x))) + (1.0 / (math.sqrt((1.0 + y)) + math.sqrt(y)))) + (1.0 / (math.sqrt((1.0 + z)) + math.sqrt(z))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (t <= 4.8e+25) tmp = Float64(3.0 + Float64(sqrt(Float64(1.0 + t)) - sqrt(t))); else tmp = Float64(Float64(Float64(1.0 / Float64(sqrt(Float64(1.0 + x)) + sqrt(x))) + Float64(1.0 / Float64(sqrt(Float64(1.0 + y)) + sqrt(y)))) + Float64(1.0 / Float64(sqrt(Float64(1.0 + z)) + sqrt(z)))); 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 (t <= 4.8e+25)
tmp = 3.0 + (sqrt((1.0 + t)) - sqrt(t));
else
tmp = ((1.0 / (sqrt((1.0 + x)) + sqrt(x))) + (1.0 / (sqrt((1.0 + y)) + sqrt(y)))) + (1.0 / (sqrt((1.0 + z)) + 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_] := If[LessEqual[t, 4.8e+25], N[(3.0 + N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 / N[(N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq 4.8 \cdot 10^{+25}:\\
\;\;\;\;3 + \left(\sqrt{1 + t} - \sqrt{t}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{1}{\sqrt{1 + x} + \sqrt{x}} + \frac{1}{\sqrt{1 + y} + \sqrt{y}}\right) + \frac{1}{\sqrt{1 + z} + \sqrt{z}}\\
\end{array}
\end{array}
if t < 4.79999999999999992e25Initial program 96.5%
Simplified18.7%
Taylor expanded in y around 0 17.0%
associate--l+35.7%
+-commutative35.7%
+-commutative35.7%
+-commutative35.7%
Simplified35.7%
Taylor expanded in x around 0 19.9%
+-commutative19.9%
Simplified19.9%
Taylor expanded in z around 0 26.0%
associate--l+26.0%
Simplified26.0%
if 4.79999999999999992e25 < t Initial program 84.5%
associate-+l+84.5%
associate-+l-68.4%
associate-+l-84.5%
sub-neg84.5%
sub-neg84.5%
+-commutative84.5%
+-commutative84.5%
+-commutative84.5%
Simplified84.5%
flip--84.5%
add-sqr-sqrt72.6%
+-commutative72.6%
add-sqr-sqrt84.7%
+-commutative84.7%
Applied egg-rr84.7%
associate--l+87.9%
+-inverses87.9%
metadata-eval87.9%
Simplified87.9%
flip--87.9%
add-sqr-sqrt69.8%
add-sqr-sqrt88.2%
Applied egg-rr88.2%
associate--l+91.2%
+-inverses91.2%
metadata-eval91.2%
Simplified91.2%
flip--91.2%
add-sqr-sqrt72.8%
add-sqr-sqrt91.5%
Applied egg-rr91.5%
associate--l+95.9%
+-inverses95.9%
metadata-eval95.9%
Simplified95.9%
Taylor expanded in t around inf 95.9%
Final simplification60.2%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(if (<= t 4.8e+25)
(+ 3.0 (- (sqrt (+ 1.0 t)) (sqrt t)))
(+
(+
(/ 1.0 (+ (sqrt (+ 1.0 x)) (sqrt x)))
(/ 1.0 (+ (sqrt (+ 1.0 y)) (sqrt y))))
(- (sqrt (+ 1.0 z)) (sqrt z)))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (t <= 4.8e+25) {
tmp = 3.0 + (sqrt((1.0 + t)) - sqrt(t));
} else {
tmp = ((1.0 / (sqrt((1.0 + x)) + sqrt(x))) + (1.0 / (sqrt((1.0 + y)) + sqrt(y)))) + (sqrt((1.0 + z)) - 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) :: tmp
if (t <= 4.8d+25) then
tmp = 3.0d0 + (sqrt((1.0d0 + t)) - sqrt(t))
else
tmp = ((1.0d0 / (sqrt((1.0d0 + x)) + sqrt(x))) + (1.0d0 / (sqrt((1.0d0 + y)) + sqrt(y)))) + (sqrt((1.0d0 + z)) - 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 tmp;
if (t <= 4.8e+25) {
tmp = 3.0 + (Math.sqrt((1.0 + t)) - Math.sqrt(t));
} else {
tmp = ((1.0 / (Math.sqrt((1.0 + x)) + Math.sqrt(x))) + (1.0 / (Math.sqrt((1.0 + y)) + Math.sqrt(y)))) + (Math.sqrt((1.0 + z)) - Math.sqrt(z));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if t <= 4.8e+25: tmp = 3.0 + (math.sqrt((1.0 + t)) - math.sqrt(t)) else: tmp = ((1.0 / (math.sqrt((1.0 + x)) + math.sqrt(x))) + (1.0 / (math.sqrt((1.0 + y)) + math.sqrt(y)))) + (math.sqrt((1.0 + z)) - math.sqrt(z)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (t <= 4.8e+25) tmp = Float64(3.0 + Float64(sqrt(Float64(1.0 + t)) - sqrt(t))); else tmp = Float64(Float64(Float64(1.0 / Float64(sqrt(Float64(1.0 + x)) + sqrt(x))) + Float64(1.0 / Float64(sqrt(Float64(1.0 + y)) + sqrt(y)))) + Float64(sqrt(Float64(1.0 + z)) - sqrt(z))); 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 (t <= 4.8e+25)
tmp = 3.0 + (sqrt((1.0 + t)) - sqrt(t));
else
tmp = ((1.0 / (sqrt((1.0 + x)) + sqrt(x))) + (1.0 / (sqrt((1.0 + y)) + sqrt(y)))) + (sqrt((1.0 + z)) - 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_] := If[LessEqual[t, 4.8e+25], N[(3.0 + N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 / N[(N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq 4.8 \cdot 10^{+25}:\\
\;\;\;\;3 + \left(\sqrt{1 + t} - \sqrt{t}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{1}{\sqrt{1 + x} + \sqrt{x}} + \frac{1}{\sqrt{1 + y} + \sqrt{y}}\right) + \left(\sqrt{1 + z} - \sqrt{z}\right)\\
\end{array}
\end{array}
if t < 4.79999999999999992e25Initial program 96.5%
Simplified18.7%
Taylor expanded in y around 0 17.0%
associate--l+35.7%
+-commutative35.7%
+-commutative35.7%
+-commutative35.7%
Simplified35.7%
Taylor expanded in x around 0 19.9%
+-commutative19.9%
Simplified19.9%
Taylor expanded in z around 0 26.0%
associate--l+26.0%
Simplified26.0%
if 4.79999999999999992e25 < t Initial program 84.5%
associate-+l+84.5%
associate-+l-68.4%
associate-+l-84.5%
sub-neg84.5%
sub-neg84.5%
+-commutative84.5%
+-commutative84.5%
+-commutative84.5%
Simplified84.5%
flip--84.5%
add-sqr-sqrt72.6%
+-commutative72.6%
add-sqr-sqrt84.7%
+-commutative84.7%
Applied egg-rr84.7%
associate--l+87.9%
+-inverses87.9%
metadata-eval87.9%
Simplified87.9%
flip--87.9%
add-sqr-sqrt69.8%
add-sqr-sqrt88.2%
Applied egg-rr88.2%
associate--l+91.2%
+-inverses91.2%
metadata-eval91.2%
Simplified91.2%
Taylor expanded in t around inf 91.2%
Final simplification57.9%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(if (<= t 1.02e+15)
(+ 3.0 (- (sqrt (+ 1.0 t)) (sqrt t)))
(+
(- (sqrt (+ 1.0 z)) (sqrt z))
(+ (/ 1.0 (+ (sqrt (+ 1.0 x)) (sqrt x))) (- (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 (t <= 1.02e+15) {
tmp = 3.0 + (sqrt((1.0 + t)) - sqrt(t));
} else {
tmp = (sqrt((1.0 + z)) - sqrt(z)) + ((1.0 / (sqrt((1.0 + x)) + sqrt(x))) + (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 (t <= 1.02d+15) then
tmp = 3.0d0 + (sqrt((1.0d0 + t)) - sqrt(t))
else
tmp = (sqrt((1.0d0 + z)) - sqrt(z)) + ((1.0d0 / (sqrt((1.0d0 + x)) + sqrt(x))) + (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 (t <= 1.02e+15) {
tmp = 3.0 + (Math.sqrt((1.0 + t)) - Math.sqrt(t));
} else {
tmp = (Math.sqrt((1.0 + z)) - Math.sqrt(z)) + ((1.0 / (Math.sqrt((1.0 + x)) + Math.sqrt(x))) + (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 t <= 1.02e+15: tmp = 3.0 + (math.sqrt((1.0 + t)) - math.sqrt(t)) else: tmp = (math.sqrt((1.0 + z)) - math.sqrt(z)) + ((1.0 / (math.sqrt((1.0 + x)) + math.sqrt(x))) + (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 (t <= 1.02e+15) tmp = Float64(3.0 + Float64(sqrt(Float64(1.0 + t)) - sqrt(t))); else tmp = Float64(Float64(sqrt(Float64(1.0 + z)) - sqrt(z)) + Float64(Float64(1.0 / Float64(sqrt(Float64(1.0 + x)) + sqrt(x))) + 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 (t <= 1.02e+15)
tmp = 3.0 + (sqrt((1.0 + t)) - sqrt(t));
else
tmp = (sqrt((1.0 + z)) - sqrt(z)) + ((1.0 / (sqrt((1.0 + x)) + sqrt(x))) + (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[t, 1.02e+15], N[(3.0 + N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 / N[(N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $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}\;t \leq 1.02 \cdot 10^{+15}:\\
\;\;\;\;3 + \left(\sqrt{1 + t} - \sqrt{t}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\frac{1}{\sqrt{1 + x} + \sqrt{x}} + \left(\sqrt{1 + y} - \sqrt{y}\right)\right)\\
\end{array}
\end{array}
if t < 1.02e15Initial program 97.0%
Simplified18.9%
Taylor expanded in y around 0 17.2%
associate--l+35.2%
+-commutative35.2%
+-commutative35.2%
+-commutative35.2%
Simplified35.2%
Taylor expanded in x around 0 20.0%
+-commutative20.0%
Simplified20.0%
Taylor expanded in z around 0 26.2%
associate--l+26.2%
Simplified26.2%
if 1.02e15 < t Initial program 84.3%
associate-+l+84.3%
associate-+l-68.4%
associate-+l-84.3%
sub-neg84.3%
sub-neg84.3%
+-commutative84.3%
+-commutative84.3%
+-commutative84.3%
Simplified84.3%
flip--84.2%
add-sqr-sqrt72.5%
+-commutative72.5%
add-sqr-sqrt84.5%
+-commutative84.5%
Applied egg-rr84.5%
associate--l+87.6%
+-inverses87.6%
metadata-eval87.6%
Simplified87.6%
Taylor expanded in t around inf 87.5%
Final simplification56.6%
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 5.5e+19)
(+
(sqrt (+ 1.0 y))
(- (+ t_1 (- (sqrt (+ 1.0 z)) (+ (sqrt x) (sqrt z)))) (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 <= 5.5e+19) {
tmp = sqrt((1.0 + y)) + ((t_1 + (sqrt((1.0 + z)) - (sqrt(x) + sqrt(z)))) - 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 <= 5.5d+19) then
tmp = sqrt((1.0d0 + y)) + ((t_1 + (sqrt((1.0d0 + z)) - (sqrt(x) + sqrt(z)))) - 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 <= 5.5e+19) {
tmp = Math.sqrt((1.0 + y)) + ((t_1 + (Math.sqrt((1.0 + z)) - (Math.sqrt(x) + Math.sqrt(z)))) - 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 <= 5.5e+19: tmp = math.sqrt((1.0 + y)) + ((t_1 + (math.sqrt((1.0 + z)) - (math.sqrt(x) + math.sqrt(z)))) - 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 <= 5.5e+19) tmp = Float64(sqrt(Float64(1.0 + y)) + Float64(Float64(t_1 + Float64(sqrt(Float64(1.0 + z)) - Float64(sqrt(x) + sqrt(z)))) - 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 <= 5.5e+19)
tmp = sqrt((1.0 + y)) + ((t_1 + (sqrt((1.0 + z)) - (sqrt(x) + sqrt(z)))) - 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, 5.5e+19], N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] + N[(N[(t$95$1 + N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Sqrt[y], $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 5.5 \cdot 10^{+19}:\\
\;\;\;\;\sqrt{1 + y} + \left(\left(t_1 + \left(\sqrt{1 + z} - \left(\sqrt{x} + \sqrt{z}\right)\right)\right) - \sqrt{y}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{t_1 + \sqrt{x}}\\
\end{array}
\end{array}
if y < 5.5e19Initial program 96.8%
Simplified44.8%
Taylor expanded in t around inf 38.2%
associate--l+41.3%
+-commutative41.3%
Simplified41.3%
if 5.5e19 < y Initial program 85.1%
Simplified3.8%
Taylor expanded in t around inf 3.9%
associate--l+22.7%
+-commutative22.7%
associate--l+24.6%
associate-+r+24.6%
+-commutative24.6%
Simplified24.6%
Taylor expanded in y around inf 34.1%
associate--r+34.1%
Simplified34.1%
Taylor expanded in z around inf 23.2%
flip--23.1%
add-sqr-sqrt23.2%
add-sqr-sqrt23.2%
Applied egg-rr23.2%
associate--l+26.9%
+-inverses26.9%
metadata-eval26.9%
Simplified26.9%
Final simplification33.8%
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 2.3e-33)
(+ (- (sqrt (+ 1.0 z)) (sqrt z)) 2.0)
(if (<= y 5e+15)
(+ t_1 (- (sqrt (+ 1.0 y)) (+ (sqrt y) (sqrt x))))
(/ 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 <= 2.3e-33) {
tmp = (sqrt((1.0 + z)) - sqrt(z)) + 2.0;
} else if (y <= 5e+15) {
tmp = t_1 + (sqrt((1.0 + y)) - (sqrt(y) + sqrt(x)));
} 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 <= 2.3d-33) then
tmp = (sqrt((1.0d0 + z)) - sqrt(z)) + 2.0d0
else if (y <= 5d+15) then
tmp = t_1 + (sqrt((1.0d0 + y)) - (sqrt(y) + sqrt(x)))
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 <= 2.3e-33) {
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(y) + Math.sqrt(x)));
} 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 <= 2.3e-33: 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(y) + math.sqrt(x))) 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 <= 2.3e-33) 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(y) + sqrt(x)))); 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 <= 2.3e-33)
tmp = (sqrt((1.0 + z)) - sqrt(z)) + 2.0;
elseif (y <= 5e+15)
tmp = t_1 + (sqrt((1.0 + y)) - (sqrt(y) + sqrt(x)));
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, 2.3e-33], 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[y], $MachinePrecision] + N[Sqrt[x], $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 2.3 \cdot 10^{-33}:\\
\;\;\;\;\left(\sqrt{1 + z} - \sqrt{z}\right) + 2\\
\mathbf{elif}\;y \leq 5 \cdot 10^{+15}:\\
\;\;\;\;t_1 + \left(\sqrt{1 + y} - \left(\sqrt{y} + \sqrt{x}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{t_1 + \sqrt{x}}\\
\end{array}
\end{array}
if y < 2.29999999999999986e-33Initial program 98.2%
Simplified46.2%
Taylor expanded in y around 0 17.1%
associate--l+38.6%
+-commutative38.6%
+-commutative38.6%
+-commutative38.6%
Simplified38.6%
Taylor expanded in x around 0 17.5%
+-commutative17.5%
Simplified17.5%
Taylor expanded in t around inf 32.6%
associate--l+56.3%
Simplified56.3%
if 2.29999999999999986e-33 < y < 5e15Initial program 94.9%
Simplified36.6%
Taylor expanded in t around inf 27.1%
associate--l+32.7%
+-commutative32.7%
associate--l+32.9%
associate-+r+32.9%
+-commutative32.9%
Simplified32.9%
Taylor expanded in z around inf 21.9%
associate--l+21.9%
+-commutative21.9%
Simplified21.9%
if 5e15 < y Initial program 84.4%
Simplified4.3%
Taylor expanded in t around inf 4.0%
associate--l+22.6%
+-commutative22.6%
associate--l+24.5%
associate-+r+24.5%
+-commutative24.5%
Simplified24.5%
Taylor expanded in y around inf 33.7%
associate--r+33.7%
Simplified33.7%
Taylor expanded in z around inf 23.0%
flip--23.0%
add-sqr-sqrt23.0%
add-sqr-sqrt23.0%
Applied egg-rr23.0%
associate--l+26.7%
+-inverses26.7%
metadata-eval26.7%
Simplified26.7%
Final simplification38.4%
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.3e-33)
(+ (- (sqrt (+ 1.0 z)) (sqrt z)) 2.0)
(if (<= y 5e+17)
(- (+ 1.0 (sqrt (+ 1.0 y))) (+ (sqrt y) (sqrt x)))
(/ 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 <= 2.3e-33) {
tmp = (sqrt((1.0 + z)) - sqrt(z)) + 2.0;
} else if (y <= 5e+17) {
tmp = (1.0 + sqrt((1.0 + y))) - (sqrt(y) + sqrt(x));
} 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 <= 2.3d-33) then
tmp = (sqrt((1.0d0 + z)) - sqrt(z)) + 2.0d0
else if (y <= 5d+17) then
tmp = (1.0d0 + sqrt((1.0d0 + y))) - (sqrt(y) + sqrt(x))
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 <= 2.3e-33) {
tmp = (Math.sqrt((1.0 + z)) - Math.sqrt(z)) + 2.0;
} else if (y <= 5e+17) {
tmp = (1.0 + Math.sqrt((1.0 + y))) - (Math.sqrt(y) + Math.sqrt(x));
} 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 <= 2.3e-33: tmp = (math.sqrt((1.0 + z)) - math.sqrt(z)) + 2.0 elif y <= 5e+17: tmp = (1.0 + math.sqrt((1.0 + y))) - (math.sqrt(y) + math.sqrt(x)) 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 <= 2.3e-33) tmp = Float64(Float64(sqrt(Float64(1.0 + z)) - sqrt(z)) + 2.0); elseif (y <= 5e+17) tmp = Float64(Float64(1.0 + sqrt(Float64(1.0 + y))) - Float64(sqrt(y) + sqrt(x))); 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 <= 2.3e-33)
tmp = (sqrt((1.0 + z)) - sqrt(z)) + 2.0;
elseif (y <= 5e+17)
tmp = (1.0 + sqrt((1.0 + y))) - (sqrt(y) + sqrt(x));
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, 2.3e-33], N[(N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision], If[LessEqual[y, 5e+17], N[(N[(1.0 + N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[x], $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 2.3 \cdot 10^{-33}:\\
\;\;\;\;\left(\sqrt{1 + z} - \sqrt{z}\right) + 2\\
\mathbf{elif}\;y \leq 5 \cdot 10^{+17}:\\
\;\;\;\;\left(1 + \sqrt{1 + y}\right) - \left(\sqrt{y} + \sqrt{x}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{1 + x} + \sqrt{x}}\\
\end{array}
\end{array}
if y < 2.29999999999999986e-33Initial program 98.2%
Simplified46.2%
Taylor expanded in y around 0 17.1%
associate--l+38.6%
+-commutative38.6%
+-commutative38.6%
+-commutative38.6%
Simplified38.6%
Taylor expanded in x around 0 17.5%
+-commutative17.5%
Simplified17.5%
Taylor expanded in t around inf 32.6%
associate--l+56.3%
Simplified56.3%
if 2.29999999999999986e-33 < y < 5e17Initial program 93.3%
Simplified38.4%
Taylor expanded in t around inf 26.7%
associate--l+32.0%
+-commutative32.0%
associate--l+32.2%
associate-+r+32.2%
+-commutative32.2%
Simplified32.2%
Taylor expanded in z around inf 21.6%
Taylor expanded in x around 0 20.9%
if 5e17 < y Initial program 84.5%
Simplified3.8%
Taylor expanded in t around inf 3.9%
associate--l+22.6%
+-commutative22.6%
associate--l+24.5%
associate-+r+24.5%
+-commutative24.5%
Simplified24.5%
Taylor expanded in y around inf 33.8%
associate--r+33.8%
Simplified33.8%
Taylor expanded in z around inf 23.0%
flip--23.0%
add-sqr-sqrt23.1%
add-sqr-sqrt23.0%
Applied egg-rr23.0%
associate--l+26.7%
+-inverses26.7%
metadata-eval26.7%
Simplified26.7%
Final simplification38.3%
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 6.8e-34)
(+ 3.0 (- (sqrt (+ 1.0 t)) (sqrt t)))
(if (<= z 80000000000000.0)
(+ (- (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 <= 6.8e-34) {
tmp = 3.0 + (sqrt((1.0 + t)) - sqrt(t));
} else if (z <= 80000000000000.0) {
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 <= 6.8d-34) then
tmp = 3.0d0 + (sqrt((1.0d0 + t)) - sqrt(t))
else if (z <= 80000000000000.0d0) 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 <= 6.8e-34) {
tmp = 3.0 + (Math.sqrt((1.0 + t)) - Math.sqrt(t));
} else if (z <= 80000000000000.0) {
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 <= 6.8e-34: tmp = 3.0 + (math.sqrt((1.0 + t)) - math.sqrt(t)) elif z <= 80000000000000.0: 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 <= 6.8e-34) tmp = Float64(3.0 + Float64(sqrt(Float64(1.0 + t)) - sqrt(t))); elseif (z <= 80000000000000.0) 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 <= 6.8e-34)
tmp = 3.0 + (sqrt((1.0 + t)) - sqrt(t));
elseif (z <= 80000000000000.0)
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, 6.8e-34], N[(3.0 + N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 80000000000000.0], 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 6.8 \cdot 10^{-34}:\\
\;\;\;\;3 + \left(\sqrt{1 + t} - \sqrt{t}\right)\\
\mathbf{elif}\;z \leq 80000000000000:\\
\;\;\;\;\left(\sqrt{1 + z} - \sqrt{z}\right) + 2\\
\mathbf{else}:\\
\;\;\;\;1 + \left(\sqrt{1 + y} - \sqrt{y}\right)\\
\end{array}
\end{array}
if z < 6.8000000000000001e-34Initial program 97.4%
Simplified30.5%
Taylor expanded in y around 0 17.4%
associate--l+34.2%
+-commutative34.2%
+-commutative34.2%
+-commutative34.2%
Simplified34.2%
Taylor expanded in x around 0 20.5%
+-commutative20.5%
Simplified20.5%
Taylor expanded in z around 0 20.5%
associate--l+33.6%
Simplified33.6%
if 6.8000000000000001e-34 < z < 8e13Initial program 97.5%
Simplified34.7%
Taylor expanded in y around 0 11.8%
associate--l+26.6%
+-commutative26.6%
+-commutative26.6%
+-commutative26.6%
Simplified26.6%
Taylor expanded in x around 0 12.7%
+-commutative12.7%
Simplified12.7%
Taylor expanded in t around inf 52.8%
associate--l+52.8%
Simplified52.8%
if 8e13 < z Initial program 83.4%
Simplified14.9%
Taylor expanded in t around inf 3.3%
associate--l+22.9%
+-commutative22.9%
associate--l+14.1%
associate-+r+14.1%
+-commutative14.1%
Simplified14.1%
Taylor expanded in z around inf 21.4%
Taylor expanded in x around 0 28.5%
associate--l+49.1%
Simplified49.1%
Final simplification42.5%
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.3e-33)
(+ (- (sqrt (+ 1.0 z)) (sqrt z)) 2.0)
(if (<= y 8e+17)
(+ 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 <= 2.3e-33) {
tmp = (sqrt((1.0 + z)) - sqrt(z)) + 2.0;
} else if (y <= 8e+17) {
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 <= 2.3d-33) then
tmp = (sqrt((1.0d0 + z)) - sqrt(z)) + 2.0d0
else if (y <= 8d+17) 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 <= 2.3e-33) {
tmp = (Math.sqrt((1.0 + z)) - Math.sqrt(z)) + 2.0;
} else if (y <= 8e+17) {
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 <= 2.3e-33: tmp = (math.sqrt((1.0 + z)) - math.sqrt(z)) + 2.0 elif y <= 8e+17: 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 <= 2.3e-33) tmp = Float64(Float64(sqrt(Float64(1.0 + z)) - sqrt(z)) + 2.0); elseif (y <= 8e+17) 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 <= 2.3e-33)
tmp = (sqrt((1.0 + z)) - sqrt(z)) + 2.0;
elseif (y <= 8e+17)
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, 2.3e-33], N[(N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision], If[LessEqual[y, 8e+17], 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 2.3 \cdot 10^{-33}:\\
\;\;\;\;\left(\sqrt{1 + z} - \sqrt{z}\right) + 2\\
\mathbf{elif}\;y \leq 8 \cdot 10^{+17}:\\
\;\;\;\;1 + \left(\sqrt{1 + y} - \sqrt{y}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{1 + x} + \sqrt{x}}\\
\end{array}
\end{array}
if y < 2.29999999999999986e-33Initial program 98.2%
Simplified46.2%
Taylor expanded in y around 0 17.1%
associate--l+38.6%
+-commutative38.6%
+-commutative38.6%
+-commutative38.6%
Simplified38.6%
Taylor expanded in x around 0 17.5%
+-commutative17.5%
Simplified17.5%
Taylor expanded in t around inf 32.6%
associate--l+56.3%
Simplified56.3%
if 2.29999999999999986e-33 < y < 8e17Initial program 93.3%
Simplified38.4%
Taylor expanded in t around inf 26.7%
associate--l+32.0%
+-commutative32.0%
associate--l+32.2%
associate-+r+32.2%
+-commutative32.2%
Simplified32.2%
Taylor expanded in z around inf 21.6%
Taylor expanded in x around 0 46.7%
associate--l+46.7%
Simplified46.7%
if 8e17 < y Initial program 84.5%
Simplified3.8%
Taylor expanded in t around inf 3.9%
associate--l+22.6%
+-commutative22.6%
associate--l+24.5%
associate-+r+24.5%
+-commutative24.5%
Simplified24.5%
Taylor expanded in y around inf 33.8%
associate--r+33.8%
Simplified33.8%
Taylor expanded in z around inf 23.0%
flip--23.0%
add-sqr-sqrt23.1%
add-sqr-sqrt23.0%
Applied egg-rr23.0%
associate--l+26.7%
+-inverses26.7%
metadata-eval26.7%
Simplified26.7%
Final simplification40.0%
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 19.5) (+ 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 <= 19.5) {
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 <= 19.5d0) 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 <= 19.5) {
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 <= 19.5: 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 <= 19.5) 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 <= 19.5)
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, 19.5], 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 19.5:\\
\;\;\;\;1 + t_1\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if y < 19.5Initial program 98.4%
Simplified46.1%
Taylor expanded in t around inf 21.0%
associate--l+25.7%
+-commutative25.7%
associate--l+25.8%
associate-+r+25.8%
+-commutative25.8%
Simplified25.8%
Taylor expanded in y around inf 12.6%
associate--r+12.6%
Simplified12.6%
Taylor expanded in z around 0 25.0%
associate--l+37.8%
Simplified37.8%
if 19.5 < y Initial program 84.3%
Simplified4.4%
Taylor expanded in t around inf 4.0%
associate--l+22.2%
+-commutative22.2%
associate--l+24.1%
associate-+r+24.1%
+-commutative24.1%
Simplified24.1%
Taylor expanded in y around inf 33.1%
associate--r+33.1%
Simplified33.1%
Taylor expanded in z around inf 22.6%
Final simplification29.5%
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 2.3e+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 <= 2.3e+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 <= 2.3d+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 <= 2.3e+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 <= 2.3e+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 <= 2.3e+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 <= 2.3e+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, 2.3e+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 2.3 \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}
if z < 2.3e14Initial program 97.4%
Simplified31.1%
Taylor expanded in y around 0 16.6%
associate--l+33.1%
+-commutative33.1%
+-commutative33.1%
+-commutative33.1%
Simplified33.1%
Taylor expanded in x around 0 19.4%
+-commutative19.4%
Simplified19.4%
Taylor expanded in t around inf 49.9%
associate--l+49.9%
Simplified49.9%
if 2.3e14 < z Initial program 83.4%
Simplified14.9%
Taylor expanded in t around inf 3.3%
associate--l+22.9%
+-commutative22.9%
associate--l+14.1%
associate-+r+14.1%
+-commutative14.1%
Simplified14.1%
Taylor expanded in z around inf 21.4%
Taylor expanded in x around 0 28.5%
associate--l+49.1%
Simplified49.1%
Final simplification49.5%
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}
Initial program 90.7%
Simplified23.3%
Taylor expanded in t around inf 11.7%
associate--l+23.8%
+-commutative23.8%
associate--l+24.8%
associate-+r+24.8%
+-commutative24.8%
Simplified24.8%
Taylor expanded in z around inf 14.2%
Taylor expanded in x around 0 24.4%
associate--l+41.2%
Simplified41.2%
Final simplification41.2%
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}
Initial program 90.7%
Simplified23.3%
Taylor expanded in t around inf 11.7%
associate--l+23.8%
+-commutative23.8%
associate--l+24.8%
associate-+r+24.8%
+-commutative24.8%
Simplified24.8%
Taylor expanded in y around inf 23.8%
associate--r+23.8%
Simplified23.8%
Taylor expanded in z around inf 17.5%
Final simplification17.5%
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}
Initial program 90.7%
Simplified23.3%
Taylor expanded in t around inf 11.7%
associate--l+23.8%
+-commutative23.8%
associate--l+24.8%
associate-+r+24.8%
+-commutative24.8%
Simplified24.8%
Taylor expanded in y around inf 23.8%
associate--r+23.8%
Simplified23.8%
Taylor expanded in z around inf 17.5%
Taylor expanded in x around 0 17.6%
*-commutative17.6%
Simplified17.6%
Final simplification17.6%
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}
Initial program 90.7%
Simplified23.3%
Taylor expanded in t around inf 11.7%
associate--l+23.8%
+-commutative23.8%
associate--l+24.8%
associate-+r+24.8%
+-commutative24.8%
Simplified24.8%
Taylor expanded in y around inf 23.8%
associate--r+23.8%
Simplified23.8%
Taylor expanded in z around inf 17.5%
Taylor expanded in x around 0 32.1%
Final simplification32.1%
(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 2023336
(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))))