
(FPCore (x y z t) :precision binary64 (+ (+ (+ (- (sqrt (+ x 1.0)) (sqrt x)) (- (sqrt (+ y 1.0)) (sqrt y))) (- (sqrt (+ z 1.0)) (sqrt z))) (- (sqrt (+ t 1.0)) (sqrt t))))
double code(double x, double y, double z, double t) {
return (((sqrt((x + 1.0)) - sqrt(x)) + (sqrt((y + 1.0)) - sqrt(y))) + (sqrt((z + 1.0)) - sqrt(z))) + (sqrt((t + 1.0)) - sqrt(t));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (((sqrt((x + 1.0d0)) - sqrt(x)) + (sqrt((y + 1.0d0)) - sqrt(y))) + (sqrt((z + 1.0d0)) - sqrt(z))) + (sqrt((t + 1.0d0)) - sqrt(t))
end function
public static double code(double x, double y, double z, double t) {
return (((Math.sqrt((x + 1.0)) - Math.sqrt(x)) + (Math.sqrt((y + 1.0)) - Math.sqrt(y))) + (Math.sqrt((z + 1.0)) - Math.sqrt(z))) + (Math.sqrt((t + 1.0)) - Math.sqrt(t));
}
def code(x, y, z, t): return (((math.sqrt((x + 1.0)) - math.sqrt(x)) + (math.sqrt((y + 1.0)) - math.sqrt(y))) + (math.sqrt((z + 1.0)) - math.sqrt(z))) + (math.sqrt((t + 1.0)) - math.sqrt(t))
function code(x, y, z, t) return Float64(Float64(Float64(Float64(sqrt(Float64(x + 1.0)) - sqrt(x)) + Float64(sqrt(Float64(y + 1.0)) - sqrt(y))) + Float64(sqrt(Float64(z + 1.0)) - sqrt(z))) + Float64(sqrt(Float64(t + 1.0)) - sqrt(t))) end
function tmp = code(x, y, z, t) tmp = (((sqrt((x + 1.0)) - sqrt(x)) + (sqrt((y + 1.0)) - sqrt(y))) + (sqrt((z + 1.0)) - sqrt(z))) + (sqrt((t + 1.0)) - sqrt(t)); end
code[x_, y_, z_, t_] := N[(N[(N[(N[(N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(z + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(t + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{y + 1} - \sqrt{y}\right)\right) + \left(\sqrt{z + 1} - \sqrt{z}\right)\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 17 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (+ (+ (+ (- (sqrt (+ x 1.0)) (sqrt x)) (- (sqrt (+ y 1.0)) (sqrt y))) (- (sqrt (+ z 1.0)) (sqrt z))) (- (sqrt (+ t 1.0)) (sqrt t))))
double code(double x, double y, double z, double t) {
return (((sqrt((x + 1.0)) - sqrt(x)) + (sqrt((y + 1.0)) - sqrt(y))) + (sqrt((z + 1.0)) - sqrt(z))) + (sqrt((t + 1.0)) - sqrt(t));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (((sqrt((x + 1.0d0)) - sqrt(x)) + (sqrt((y + 1.0d0)) - sqrt(y))) + (sqrt((z + 1.0d0)) - sqrt(z))) + (sqrt((t + 1.0d0)) - sqrt(t))
end function
public static double code(double x, double y, double z, double t) {
return (((Math.sqrt((x + 1.0)) - Math.sqrt(x)) + (Math.sqrt((y + 1.0)) - Math.sqrt(y))) + (Math.sqrt((z + 1.0)) - Math.sqrt(z))) + (Math.sqrt((t + 1.0)) - Math.sqrt(t));
}
def code(x, y, z, t): return (((math.sqrt((x + 1.0)) - math.sqrt(x)) + (math.sqrt((y + 1.0)) - math.sqrt(y))) + (math.sqrt((z + 1.0)) - math.sqrt(z))) + (math.sqrt((t + 1.0)) - math.sqrt(t))
function code(x, y, z, t) return Float64(Float64(Float64(Float64(sqrt(Float64(x + 1.0)) - sqrt(x)) + Float64(sqrt(Float64(y + 1.0)) - sqrt(y))) + Float64(sqrt(Float64(z + 1.0)) - sqrt(z))) + Float64(sqrt(Float64(t + 1.0)) - sqrt(t))) end
function tmp = code(x, y, z, t) tmp = (((sqrt((x + 1.0)) - sqrt(x)) + (sqrt((y + 1.0)) - sqrt(y))) + (sqrt((z + 1.0)) - sqrt(z))) + (sqrt((t + 1.0)) - sqrt(t)); end
code[x_, y_, z_, t_] := N[(N[(N[(N[(N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(z + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(t + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{y + 1} - \sqrt{y}\right)\right) + \left(\sqrt{z + 1} - \sqrt{z}\right)\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)
\end{array}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ 1.0 y)))
(t_2 (- t_1 (sqrt y)))
(t_3 (sqrt (+ 1.0 z)))
(t_4 (sqrt (+ 1.0 x)))
(t_5 (- t_4 (sqrt x)))
(t_6 (- (sqrt (+ 1.0 t)) (sqrt t))))
(if (<= (+ (- t_3 (sqrt z)) (+ t_5 t_2)) 1.2)
(+ (/ 1.0 (+ (sqrt x) t_4)) (+ (/ 1.0 (+ t_1 (sqrt y))) t_6))
(+ t_5 (+ t_6 (+ t_2 (/ 1.0 (+ t_3 (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 + y));
double t_2 = t_1 - sqrt(y);
double t_3 = sqrt((1.0 + z));
double t_4 = sqrt((1.0 + x));
double t_5 = t_4 - sqrt(x);
double t_6 = sqrt((1.0 + t)) - sqrt(t);
double tmp;
if (((t_3 - sqrt(z)) + (t_5 + t_2)) <= 1.2) {
tmp = (1.0 / (sqrt(x) + t_4)) + ((1.0 / (t_1 + sqrt(y))) + t_6);
} else {
tmp = t_5 + (t_6 + (t_2 + (1.0 / (t_3 + 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) :: t_4
real(8) :: t_5
real(8) :: t_6
real(8) :: tmp
t_1 = sqrt((1.0d0 + y))
t_2 = t_1 - sqrt(y)
t_3 = sqrt((1.0d0 + z))
t_4 = sqrt((1.0d0 + x))
t_5 = t_4 - sqrt(x)
t_6 = sqrt((1.0d0 + t)) - sqrt(t)
if (((t_3 - sqrt(z)) + (t_5 + t_2)) <= 1.2d0) then
tmp = (1.0d0 / (sqrt(x) + t_4)) + ((1.0d0 / (t_1 + sqrt(y))) + t_6)
else
tmp = t_5 + (t_6 + (t_2 + (1.0d0 / (t_3 + 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 + y));
double t_2 = t_1 - Math.sqrt(y);
double t_3 = Math.sqrt((1.0 + z));
double t_4 = Math.sqrt((1.0 + x));
double t_5 = t_4 - Math.sqrt(x);
double t_6 = Math.sqrt((1.0 + t)) - Math.sqrt(t);
double tmp;
if (((t_3 - Math.sqrt(z)) + (t_5 + t_2)) <= 1.2) {
tmp = (1.0 / (Math.sqrt(x) + t_4)) + ((1.0 / (t_1 + Math.sqrt(y))) + t_6);
} else {
tmp = t_5 + (t_6 + (t_2 + (1.0 / (t_3 + 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 + y)) t_2 = t_1 - math.sqrt(y) t_3 = math.sqrt((1.0 + z)) t_4 = math.sqrt((1.0 + x)) t_5 = t_4 - math.sqrt(x) t_6 = math.sqrt((1.0 + t)) - math.sqrt(t) tmp = 0 if ((t_3 - math.sqrt(z)) + (t_5 + t_2)) <= 1.2: tmp = (1.0 / (math.sqrt(x) + t_4)) + ((1.0 / (t_1 + math.sqrt(y))) + t_6) else: tmp = t_5 + (t_6 + (t_2 + (1.0 / (t_3 + 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 + y)) t_2 = Float64(t_1 - sqrt(y)) t_3 = sqrt(Float64(1.0 + z)) t_4 = sqrt(Float64(1.0 + x)) t_5 = Float64(t_4 - sqrt(x)) t_6 = Float64(sqrt(Float64(1.0 + t)) - sqrt(t)) tmp = 0.0 if (Float64(Float64(t_3 - sqrt(z)) + Float64(t_5 + t_2)) <= 1.2) tmp = Float64(Float64(1.0 / Float64(sqrt(x) + t_4)) + Float64(Float64(1.0 / Float64(t_1 + sqrt(y))) + t_6)); else tmp = Float64(t_5 + Float64(t_6 + Float64(t_2 + Float64(1.0 / Float64(t_3 + 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 + y));
t_2 = t_1 - sqrt(y);
t_3 = sqrt((1.0 + z));
t_4 = sqrt((1.0 + x));
t_5 = t_4 - sqrt(x);
t_6 = sqrt((1.0 + t)) - sqrt(t);
tmp = 0.0;
if (((t_3 - sqrt(z)) + (t_5 + t_2)) <= 1.2)
tmp = (1.0 / (sqrt(x) + t_4)) + ((1.0 / (t_1 + sqrt(y))) + t_6);
else
tmp = t_5 + (t_6 + (t_2 + (1.0 / (t_3 + 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 + y), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(t$95$1 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$4 = N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$5 = N[(t$95$4 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$6 = N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(N[(t$95$3 - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] + N[(t$95$5 + t$95$2), $MachinePrecision]), $MachinePrecision], 1.2], N[(N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + t$95$4), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 / N[(t$95$1 + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$6), $MachinePrecision]), $MachinePrecision], N[(t$95$5 + N[(t$95$6 + N[(t$95$2 + N[(1.0 / N[(t$95$3 + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + y}\\
t_2 := t_1 - \sqrt{y}\\
t_3 := \sqrt{1 + z}\\
t_4 := \sqrt{1 + x}\\
t_5 := t_4 - \sqrt{x}\\
t_6 := \sqrt{1 + t} - \sqrt{t}\\
\mathbf{if}\;\left(t_3 - \sqrt{z}\right) + \left(t_5 + t_2\right) \leq 1.2:\\
\;\;\;\;\frac{1}{\sqrt{x} + t_4} + \left(\frac{1}{t_1 + \sqrt{y}} + t_6\right)\\
\mathbf{else}:\\
\;\;\;\;t_5 + \left(t_6 + \left(t_2 + \frac{1}{t_3 + \sqrt{z}}\right)\right)\\
\end{array}
\end{array}
if (+.f64 (+.f64 (-.f64 (sqrt.f64 (+.f64 x 1)) (sqrt.f64 x)) (-.f64 (sqrt.f64 (+.f64 y 1)) (sqrt.f64 y))) (-.f64 (sqrt.f64 (+.f64 z 1)) (sqrt.f64 z))) < 1.19999999999999996Initial program 89.3%
associate-+l+89.3%
associate-+l+89.3%
sub-neg89.3%
+-commutative89.3%
sub-neg89.3%
+-commutative89.3%
+-commutative89.3%
Simplified89.3%
flip--89.3%
add-sqr-sqrt55.2%
+-commutative55.2%
add-sqr-sqrt90.7%
+-commutative90.7%
Applied egg-rr90.7%
associate--l+93.3%
+-inverses93.3%
metadata-eval93.3%
+-commutative93.3%
Simplified93.3%
flip--93.6%
add-sqr-sqrt64.8%
add-sqr-sqrt93.8%
Applied egg-rr93.8%
associate--l+95.6%
+-inverses95.6%
metadata-eval95.6%
Simplified95.6%
Taylor expanded in z around inf 73.0%
if 1.19999999999999996 < (+.f64 (+.f64 (-.f64 (sqrt.f64 (+.f64 x 1)) (sqrt.f64 x)) (-.f64 (sqrt.f64 (+.f64 y 1)) (sqrt.f64 y))) (-.f64 (sqrt.f64 (+.f64 z 1)) (sqrt.f64 z))) Initial program 97.9%
associate-+l+97.9%
associate-+l+97.9%
sub-neg97.9%
+-commutative97.9%
sub-neg97.9%
+-commutative97.9%
+-commutative97.9%
Simplified97.9%
flip--97.9%
add-sqr-sqrt84.8%
+-commutative84.8%
add-sqr-sqrt97.9%
+-commutative97.9%
Applied egg-rr97.9%
Taylor expanded in z around 0 98.3%
Final simplification85.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)))
(t_2 (sqrt (+ 1.0 y)))
(t_3 (- (sqrt (+ 1.0 t)) (sqrt t))))
(if (<= (- t_2 (sqrt y)) 0.9998)
(+ (/ 1.0 (+ (sqrt x) t_1)) (+ (/ 1.0 (+ t_2 (sqrt y))) t_3))
(+
(- t_1 (sqrt x))
(+
t_3
(+
(- (+ 1.0 (* y 0.5)) (sqrt y))
(/ (- (+ 1.0 z) z) (+ (sqrt (+ 1.0 z)) (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 + y));
double t_3 = sqrt((1.0 + t)) - sqrt(t);
double tmp;
if ((t_2 - sqrt(y)) <= 0.9998) {
tmp = (1.0 / (sqrt(x) + t_1)) + ((1.0 / (t_2 + sqrt(y))) + t_3);
} else {
tmp = (t_1 - sqrt(x)) + (t_3 + (((1.0 + (y * 0.5)) - sqrt(y)) + (((1.0 + z) - z) / (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) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = sqrt((1.0d0 + x))
t_2 = sqrt((1.0d0 + y))
t_3 = sqrt((1.0d0 + t)) - sqrt(t)
if ((t_2 - sqrt(y)) <= 0.9998d0) then
tmp = (1.0d0 / (sqrt(x) + t_1)) + ((1.0d0 / (t_2 + sqrt(y))) + t_3)
else
tmp = (t_1 - sqrt(x)) + (t_3 + (((1.0d0 + (y * 0.5d0)) - sqrt(y)) + (((1.0d0 + z) - z) / (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 t_1 = Math.sqrt((1.0 + x));
double t_2 = Math.sqrt((1.0 + y));
double t_3 = Math.sqrt((1.0 + t)) - Math.sqrt(t);
double tmp;
if ((t_2 - Math.sqrt(y)) <= 0.9998) {
tmp = (1.0 / (Math.sqrt(x) + t_1)) + ((1.0 / (t_2 + Math.sqrt(y))) + t_3);
} else {
tmp = (t_1 - Math.sqrt(x)) + (t_3 + (((1.0 + (y * 0.5)) - Math.sqrt(y)) + (((1.0 + z) - z) / (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): t_1 = math.sqrt((1.0 + x)) t_2 = math.sqrt((1.0 + y)) t_3 = math.sqrt((1.0 + t)) - math.sqrt(t) tmp = 0 if (t_2 - math.sqrt(y)) <= 0.9998: tmp = (1.0 / (math.sqrt(x) + t_1)) + ((1.0 / (t_2 + math.sqrt(y))) + t_3) else: tmp = (t_1 - math.sqrt(x)) + (t_3 + (((1.0 + (y * 0.5)) - math.sqrt(y)) + (((1.0 + z) - z) / (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) t_1 = sqrt(Float64(1.0 + x)) t_2 = sqrt(Float64(1.0 + y)) t_3 = Float64(sqrt(Float64(1.0 + t)) - sqrt(t)) tmp = 0.0 if (Float64(t_2 - sqrt(y)) <= 0.9998) tmp = Float64(Float64(1.0 / Float64(sqrt(x) + t_1)) + Float64(Float64(1.0 / Float64(t_2 + sqrt(y))) + t_3)); else tmp = Float64(Float64(t_1 - sqrt(x)) + Float64(t_3 + Float64(Float64(Float64(1.0 + Float64(y * 0.5)) - sqrt(y)) + Float64(Float64(Float64(1.0 + z) - z) / 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)
t_1 = sqrt((1.0 + x));
t_2 = sqrt((1.0 + y));
t_3 = sqrt((1.0 + t)) - sqrt(t);
tmp = 0.0;
if ((t_2 - sqrt(y)) <= 0.9998)
tmp = (1.0 / (sqrt(x) + t_1)) + ((1.0 / (t_2 + sqrt(y))) + t_3);
else
tmp = (t_1 - sqrt(x)) + (t_3 + (((1.0 + (y * 0.5)) - sqrt(y)) + (((1.0 + z) - z) / (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_] := Block[{t$95$1 = N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(t$95$2 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision], 0.9998], N[(N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 / N[(t$95$2 + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$3), $MachinePrecision]), $MachinePrecision], N[(N[(t$95$1 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(t$95$3 + N[(N[(N[(1.0 + N[(y * 0.5), $MachinePrecision]), $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision] + N[(N[(N[(1.0 + z), $MachinePrecision] - z), $MachinePrecision] / N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + x}\\
t_2 := \sqrt{1 + y}\\
t_3 := \sqrt{1 + t} - \sqrt{t}\\
\mathbf{if}\;t_2 - \sqrt{y} \leq 0.9998:\\
\;\;\;\;\frac{1}{\sqrt{x} + t_1} + \left(\frac{1}{t_2 + \sqrt{y}} + t_3\right)\\
\mathbf{else}:\\
\;\;\;\;\left(t_1 - \sqrt{x}\right) + \left(t_3 + \left(\left(\left(1 + y \cdot 0.5\right) - \sqrt{y}\right) + \frac{\left(1 + z\right) - z}{\sqrt{1 + z} + \sqrt{z}}\right)\right)\\
\end{array}
\end{array}
if (-.f64 (sqrt.f64 (+.f64 y 1)) (sqrt.f64 y)) < 0.99980000000000002Initial program 90.0%
associate-+l+90.0%
associate-+l+90.0%
sub-neg90.0%
+-commutative90.0%
sub-neg90.0%
+-commutative90.0%
+-commutative90.0%
Simplified90.0%
flip--90.0%
add-sqr-sqrt68.0%
+-commutative68.0%
add-sqr-sqrt90.9%
+-commutative90.9%
Applied egg-rr90.9%
associate--l+93.3%
+-inverses93.3%
metadata-eval93.3%
+-commutative93.3%
Simplified93.3%
flip--93.6%
add-sqr-sqrt53.4%
add-sqr-sqrt93.9%
Applied egg-rr93.9%
associate--l+95.7%
+-inverses95.7%
metadata-eval95.7%
Simplified95.7%
Taylor expanded in z around inf 52.0%
if 0.99980000000000002 < (-.f64 (sqrt.f64 (+.f64 y 1)) (sqrt.f64 y)) Initial program 97.0%
associate-+l+97.0%
associate-+l+97.0%
sub-neg97.0%
+-commutative97.0%
sub-neg97.0%
+-commutative97.0%
+-commutative97.0%
Simplified97.0%
flip--97.0%
add-sqr-sqrt73.9%
+-commutative73.9%
add-sqr-sqrt97.2%
+-commutative97.2%
Applied egg-rr97.2%
Taylor expanded in y around 0 97.2%
*-commutative97.2%
Simplified97.2%
Final simplification75.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 x) (sqrt (+ 1.0 x)))) (+ (+ (/ 1.0 (+ (sqrt (+ 1.0 y)) (sqrt y))) (- (sqrt (+ 1.0 z)) (sqrt z))) (- (sqrt (+ 1.0 t)) (sqrt t)))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
return (1.0 / (sqrt(x) + sqrt((1.0 + x)))) + (((1.0 / (sqrt((1.0 + y)) + sqrt(y))) + (sqrt((1.0 + z)) - sqrt(z))) + (sqrt((1.0 + t)) - sqrt(t)));
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (1.0d0 / (sqrt(x) + sqrt((1.0d0 + x)))) + (((1.0d0 / (sqrt((1.0d0 + y)) + sqrt(y))) + (sqrt((1.0d0 + z)) - sqrt(z))) + (sqrt((1.0d0 + t)) - sqrt(t)))
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
return (1.0 / (Math.sqrt(x) + Math.sqrt((1.0 + x)))) + (((1.0 / (Math.sqrt((1.0 + y)) + Math.sqrt(y))) + (Math.sqrt((1.0 + z)) - Math.sqrt(z))) + (Math.sqrt((1.0 + t)) - Math.sqrt(t)));
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): return (1.0 / (math.sqrt(x) + math.sqrt((1.0 + x)))) + (((1.0 / (math.sqrt((1.0 + y)) + math.sqrt(y))) + (math.sqrt((1.0 + z)) - math.sqrt(z))) + (math.sqrt((1.0 + t)) - math.sqrt(t)))
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) return Float64(Float64(1.0 / Float64(sqrt(x) + sqrt(Float64(1.0 + x)))) + Float64(Float64(Float64(1.0 / Float64(sqrt(Float64(1.0 + y)) + sqrt(y))) + Float64(sqrt(Float64(1.0 + z)) - sqrt(z))) + Float64(sqrt(Float64(1.0 + t)) - sqrt(t)))) end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp = code(x, y, z, t)
tmp = (1.0 / (sqrt(x) + sqrt((1.0 + x)))) + (((1.0 / (sqrt((1.0 + y)) + sqrt(y))) + (sqrt((1.0 + z)) - sqrt(z))) + (sqrt((1.0 + t)) - sqrt(t)));
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := N[(N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(1.0 / N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\frac{1}{\sqrt{x} + \sqrt{1 + x}} + \left(\left(\frac{1}{\sqrt{1 + y} + \sqrt{y}} + \left(\sqrt{1 + z} - \sqrt{z}\right)\right) + \left(\sqrt{1 + t} - \sqrt{t}\right)\right)
\end{array}
Initial program 93.6%
associate-+l+93.6%
associate-+l+93.6%
sub-neg93.6%
+-commutative93.6%
sub-neg93.6%
+-commutative93.6%
+-commutative93.6%
Simplified93.6%
flip--93.8%
add-sqr-sqrt71.6%
+-commutative71.6%
add-sqr-sqrt94.5%
+-commutative94.5%
Applied egg-rr94.5%
associate--l+95.9%
+-inverses95.9%
metadata-eval95.9%
+-commutative95.9%
Simplified95.9%
flip--96.1%
add-sqr-sqrt76.6%
add-sqr-sqrt96.2%
Applied egg-rr96.2%
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
(let* ((t_1 (- (sqrt (+ 1.0 t)) (sqrt t))) (t_2 (sqrt (+ 1.0 x))))
(if (<= y 9.6e-14)
(+
(- t_2 (sqrt x))
(+
t_1
(+ (/ (- (+ 1.0 z) z) (+ (sqrt (+ 1.0 z)) (sqrt z))) (- 1.0 (sqrt y)))))
(+
(/ 1.0 (+ (sqrt x) t_2))
(+ (/ 1.0 (+ (sqrt (+ 1.0 y)) (sqrt y))) 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 + t)) - sqrt(t);
double t_2 = sqrt((1.0 + x));
double tmp;
if (y <= 9.6e-14) {
tmp = (t_2 - sqrt(x)) + (t_1 + ((((1.0 + z) - z) / (sqrt((1.0 + z)) + sqrt(z))) + (1.0 - sqrt(y))));
} else {
tmp = (1.0 / (sqrt(x) + t_2)) + ((1.0 / (sqrt((1.0 + y)) + sqrt(y))) + 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) :: tmp
t_1 = sqrt((1.0d0 + t)) - sqrt(t)
t_2 = sqrt((1.0d0 + x))
if (y <= 9.6d-14) then
tmp = (t_2 - sqrt(x)) + (t_1 + ((((1.0d0 + z) - z) / (sqrt((1.0d0 + z)) + sqrt(z))) + (1.0d0 - sqrt(y))))
else
tmp = (1.0d0 / (sqrt(x) + t_2)) + ((1.0d0 / (sqrt((1.0d0 + y)) + sqrt(y))) + 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 + t)) - Math.sqrt(t);
double t_2 = Math.sqrt((1.0 + x));
double tmp;
if (y <= 9.6e-14) {
tmp = (t_2 - Math.sqrt(x)) + (t_1 + ((((1.0 + z) - z) / (Math.sqrt((1.0 + z)) + Math.sqrt(z))) + (1.0 - Math.sqrt(y))));
} else {
tmp = (1.0 / (Math.sqrt(x) + t_2)) + ((1.0 / (Math.sqrt((1.0 + y)) + Math.sqrt(y))) + 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 + t)) - math.sqrt(t) t_2 = math.sqrt((1.0 + x)) tmp = 0 if y <= 9.6e-14: tmp = (t_2 - math.sqrt(x)) + (t_1 + ((((1.0 + z) - z) / (math.sqrt((1.0 + z)) + math.sqrt(z))) + (1.0 - math.sqrt(y)))) else: tmp = (1.0 / (math.sqrt(x) + t_2)) + ((1.0 / (math.sqrt((1.0 + y)) + math.sqrt(y))) + 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 + t)) - sqrt(t)) t_2 = sqrt(Float64(1.0 + x)) tmp = 0.0 if (y <= 9.6e-14) tmp = Float64(Float64(t_2 - sqrt(x)) + Float64(t_1 + Float64(Float64(Float64(Float64(1.0 + z) - z) / Float64(sqrt(Float64(1.0 + z)) + sqrt(z))) + Float64(1.0 - sqrt(y))))); else tmp = Float64(Float64(1.0 / Float64(sqrt(x) + t_2)) + Float64(Float64(1.0 / Float64(sqrt(Float64(1.0 + y)) + sqrt(y))) + 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 + t)) - sqrt(t);
t_2 = sqrt((1.0 + x));
tmp = 0.0;
if (y <= 9.6e-14)
tmp = (t_2 - sqrt(x)) + (t_1 + ((((1.0 + z) - z) / (sqrt((1.0 + z)) + sqrt(z))) + (1.0 - sqrt(y))));
else
tmp = (1.0 / (sqrt(x) + t_2)) + ((1.0 / (sqrt((1.0 + y)) + sqrt(y))) + 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 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y, 9.6e-14], N[(N[(t$95$2 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(t$95$1 + N[(N[(N[(N[(1.0 + z), $MachinePrecision] - z), $MachinePrecision] / N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + t$95$2), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 / N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $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{1 + t} - \sqrt{t}\\
t_2 := \sqrt{1 + x}\\
\mathbf{if}\;y \leq 9.6 \cdot 10^{-14}:\\
\;\;\;\;\left(t_2 - \sqrt{x}\right) + \left(t_1 + \left(\frac{\left(1 + z\right) - z}{\sqrt{1 + z} + \sqrt{z}} + \left(1 - \sqrt{y}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{x} + t_2} + \left(\frac{1}{\sqrt{1 + y} + \sqrt{y}} + t_1\right)\\
\end{array}
\end{array}
if y < 9.599999999999999e-14Initial program 97.0%
associate-+l+97.0%
associate-+l+97.0%
sub-neg97.0%
+-commutative97.0%
sub-neg97.0%
+-commutative97.0%
+-commutative97.0%
Simplified97.0%
flip--97.0%
add-sqr-sqrt73.9%
+-commutative73.9%
add-sqr-sqrt97.2%
+-commutative97.2%
Applied egg-rr97.2%
Taylor expanded in y around 0 97.2%
if 9.599999999999999e-14 < y Initial program 90.0%
associate-+l+90.0%
associate-+l+90.0%
sub-neg90.0%
+-commutative90.0%
sub-neg90.0%
+-commutative90.0%
+-commutative90.0%
Simplified90.0%
flip--90.0%
add-sqr-sqrt68.0%
+-commutative68.0%
add-sqr-sqrt90.9%
+-commutative90.9%
Applied egg-rr90.9%
associate--l+93.3%
+-inverses93.3%
metadata-eval93.3%
+-commutative93.3%
Simplified93.3%
flip--93.6%
add-sqr-sqrt53.4%
add-sqr-sqrt93.9%
Applied egg-rr93.9%
associate--l+95.7%
+-inverses95.7%
metadata-eval95.7%
Simplified95.7%
Taylor expanded in z around inf 52.0%
Final simplification75.3%
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 t)) (sqrt t))) (t_2 (sqrt (+ 1.0 x))))
(if (<= z 9e+14)
(+
(- t_2 (sqrt x))
(+ t_1 (+ 1.0 (/ (- (+ 1.0 z) z) (+ (sqrt (+ 1.0 z)) (sqrt z))))))
(+
(/ 1.0 (+ (sqrt x) t_2))
(+ (/ 1.0 (+ (sqrt (+ 1.0 y)) (sqrt y))) 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 + t)) - sqrt(t);
double t_2 = sqrt((1.0 + x));
double tmp;
if (z <= 9e+14) {
tmp = (t_2 - sqrt(x)) + (t_1 + (1.0 + (((1.0 + z) - z) / (sqrt((1.0 + z)) + sqrt(z)))));
} else {
tmp = (1.0 / (sqrt(x) + t_2)) + ((1.0 / (sqrt((1.0 + y)) + sqrt(y))) + 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) :: tmp
t_1 = sqrt((1.0d0 + t)) - sqrt(t)
t_2 = sqrt((1.0d0 + x))
if (z <= 9d+14) then
tmp = (t_2 - sqrt(x)) + (t_1 + (1.0d0 + (((1.0d0 + z) - z) / (sqrt((1.0d0 + z)) + sqrt(z)))))
else
tmp = (1.0d0 / (sqrt(x) + t_2)) + ((1.0d0 / (sqrt((1.0d0 + y)) + sqrt(y))) + 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 + t)) - Math.sqrt(t);
double t_2 = Math.sqrt((1.0 + x));
double tmp;
if (z <= 9e+14) {
tmp = (t_2 - Math.sqrt(x)) + (t_1 + (1.0 + (((1.0 + z) - z) / (Math.sqrt((1.0 + z)) + Math.sqrt(z)))));
} else {
tmp = (1.0 / (Math.sqrt(x) + t_2)) + ((1.0 / (Math.sqrt((1.0 + y)) + Math.sqrt(y))) + 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 + t)) - math.sqrt(t) t_2 = math.sqrt((1.0 + x)) tmp = 0 if z <= 9e+14: tmp = (t_2 - math.sqrt(x)) + (t_1 + (1.0 + (((1.0 + z) - z) / (math.sqrt((1.0 + z)) + math.sqrt(z))))) else: tmp = (1.0 / (math.sqrt(x) + t_2)) + ((1.0 / (math.sqrt((1.0 + y)) + math.sqrt(y))) + 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 + t)) - sqrt(t)) t_2 = sqrt(Float64(1.0 + x)) tmp = 0.0 if (z <= 9e+14) tmp = Float64(Float64(t_2 - sqrt(x)) + Float64(t_1 + Float64(1.0 + Float64(Float64(Float64(1.0 + z) - z) / Float64(sqrt(Float64(1.0 + z)) + sqrt(z)))))); else tmp = Float64(Float64(1.0 / Float64(sqrt(x) + t_2)) + Float64(Float64(1.0 / Float64(sqrt(Float64(1.0 + y)) + sqrt(y))) + 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 + t)) - sqrt(t);
t_2 = sqrt((1.0 + x));
tmp = 0.0;
if (z <= 9e+14)
tmp = (t_2 - sqrt(x)) + (t_1 + (1.0 + (((1.0 + z) - z) / (sqrt((1.0 + z)) + sqrt(z)))));
else
tmp = (1.0 / (sqrt(x) + t_2)) + ((1.0 / (sqrt((1.0 + y)) + sqrt(y))) + 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 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[z, 9e+14], N[(N[(t$95$2 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(t$95$1 + N[(1.0 + N[(N[(N[(1.0 + z), $MachinePrecision] - z), $MachinePrecision] / N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + t$95$2), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 / N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $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{1 + t} - \sqrt{t}\\
t_2 := \sqrt{1 + x}\\
\mathbf{if}\;z \leq 9 \cdot 10^{+14}:\\
\;\;\;\;\left(t_2 - \sqrt{x}\right) + \left(t_1 + \left(1 + \frac{\left(1 + z\right) - z}{\sqrt{1 + z} + \sqrt{z}}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{x} + t_2} + \left(\frac{1}{\sqrt{1 + y} + \sqrt{y}} + t_1\right)\\
\end{array}
\end{array}
if z < 9e14Initial program 96.8%
associate-+l+96.8%
associate-+l+96.8%
sub-neg96.8%
+-commutative96.8%
sub-neg96.8%
+-commutative96.8%
+-commutative96.8%
Simplified96.8%
flip--96.8%
add-sqr-sqrt97.1%
+-commutative97.1%
add-sqr-sqrt97.3%
+-commutative97.3%
Applied egg-rr97.3%
Taylor expanded in y around 0 57.8%
if 9e14 < z Initial program 90.2%
associate-+l+90.2%
associate-+l+90.2%
sub-neg90.2%
+-commutative90.2%
sub-neg90.2%
+-commutative90.2%
+-commutative90.2%
Simplified90.2%
flip--90.2%
add-sqr-sqrt69.4%
+-commutative69.4%
add-sqr-sqrt91.5%
+-commutative91.5%
Applied egg-rr91.5%
associate--l+93.9%
+-inverses93.9%
metadata-eval93.9%
+-commutative93.9%
Simplified93.9%
flip--94.2%
add-sqr-sqrt76.5%
add-sqr-sqrt94.5%
Applied egg-rr94.5%
associate--l+96.0%
+-inverses96.0%
metadata-eval96.0%
Simplified96.0%
Taylor expanded in z around inf 96.0%
Final simplification76.3%
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 t)) (sqrt t))) (t_2 (sqrt (+ 1.0 x))))
(if (<= y 1.55e-28)
(+ (- t_2 (sqrt x)) (+ t_1 (+ 1.0 (- (sqrt (+ 1.0 z)) (sqrt z)))))
(if (<= y 3.8e+31)
(+ t_2 (+ (/ 1.0 (+ (sqrt (+ 1.0 y)) (sqrt y))) (- t_1 (sqrt x))))
(/ 1.0 (+ (sqrt x) t_2))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + t)) - sqrt(t);
double t_2 = sqrt((1.0 + x));
double tmp;
if (y <= 1.55e-28) {
tmp = (t_2 - sqrt(x)) + (t_1 + (1.0 + (sqrt((1.0 + z)) - sqrt(z))));
} else if (y <= 3.8e+31) {
tmp = t_2 + ((1.0 / (sqrt((1.0 + y)) + sqrt(y))) + (t_1 - sqrt(x)));
} else {
tmp = 1.0 / (sqrt(x) + t_2);
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = sqrt((1.0d0 + t)) - sqrt(t)
t_2 = sqrt((1.0d0 + x))
if (y <= 1.55d-28) then
tmp = (t_2 - sqrt(x)) + (t_1 + (1.0d0 + (sqrt((1.0d0 + z)) - sqrt(z))))
else if (y <= 3.8d+31) then
tmp = t_2 + ((1.0d0 / (sqrt((1.0d0 + y)) + sqrt(y))) + (t_1 - sqrt(x)))
else
tmp = 1.0d0 / (sqrt(x) + t_2)
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + t)) - Math.sqrt(t);
double t_2 = Math.sqrt((1.0 + x));
double tmp;
if (y <= 1.55e-28) {
tmp = (t_2 - Math.sqrt(x)) + (t_1 + (1.0 + (Math.sqrt((1.0 + z)) - Math.sqrt(z))));
} else if (y <= 3.8e+31) {
tmp = t_2 + ((1.0 / (Math.sqrt((1.0 + y)) + Math.sqrt(y))) + (t_1 - Math.sqrt(x)));
} else {
tmp = 1.0 / (Math.sqrt(x) + t_2);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + t)) - math.sqrt(t) t_2 = math.sqrt((1.0 + x)) tmp = 0 if y <= 1.55e-28: tmp = (t_2 - math.sqrt(x)) + (t_1 + (1.0 + (math.sqrt((1.0 + z)) - math.sqrt(z)))) elif y <= 3.8e+31: tmp = t_2 + ((1.0 / (math.sqrt((1.0 + y)) + math.sqrt(y))) + (t_1 - math.sqrt(x))) else: tmp = 1.0 / (math.sqrt(x) + t_2) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = Float64(sqrt(Float64(1.0 + t)) - sqrt(t)) t_2 = sqrt(Float64(1.0 + x)) tmp = 0.0 if (y <= 1.55e-28) tmp = Float64(Float64(t_2 - sqrt(x)) + Float64(t_1 + Float64(1.0 + Float64(sqrt(Float64(1.0 + z)) - sqrt(z))))); elseif (y <= 3.8e+31) tmp = Float64(t_2 + Float64(Float64(1.0 / Float64(sqrt(Float64(1.0 + y)) + sqrt(y))) + Float64(t_1 - sqrt(x)))); else tmp = Float64(1.0 / Float64(sqrt(x) + t_2)); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + t)) - sqrt(t);
t_2 = sqrt((1.0 + x));
tmp = 0.0;
if (y <= 1.55e-28)
tmp = (t_2 - sqrt(x)) + (t_1 + (1.0 + (sqrt((1.0 + z)) - sqrt(z))));
elseif (y <= 3.8e+31)
tmp = t_2 + ((1.0 / (sqrt((1.0 + y)) + sqrt(y))) + (t_1 - sqrt(x)));
else
tmp = 1.0 / (sqrt(x) + t_2);
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y, 1.55e-28], N[(N[(t$95$2 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(t$95$1 + N[(1.0 + N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3.8e+31], 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$1 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + t$95$2), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + t} - \sqrt{t}\\
t_2 := \sqrt{1 + x}\\
\mathbf{if}\;y \leq 1.55 \cdot 10^{-28}:\\
\;\;\;\;\left(t_2 - \sqrt{x}\right) + \left(t_1 + \left(1 + \left(\sqrt{1 + z} - \sqrt{z}\right)\right)\right)\\
\mathbf{elif}\;y \leq 3.8 \cdot 10^{+31}:\\
\;\;\;\;t_2 + \left(\frac{1}{\sqrt{1 + y} + \sqrt{y}} + \left(t_1 - \sqrt{x}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{x} + t_2}\\
\end{array}
\end{array}
if y < 1.54999999999999996e-28Initial program 96.9%
associate-+l+96.9%
associate-+l+96.9%
sub-neg96.9%
+-commutative96.9%
sub-neg96.9%
+-commutative96.9%
+-commutative96.9%
Simplified96.9%
Taylor expanded in y around 0 96.9%
if 1.54999999999999996e-28 < y < 3.8000000000000001e31Initial program 92.6%
associate-+l+92.6%
+-commutative92.6%
associate-+r-83.7%
associate-+l-77.5%
+-commutative77.5%
associate--l+77.5%
+-commutative77.5%
Simplified46.5%
Taylor expanded in z around inf 52.9%
associate--l+52.9%
Simplified52.9%
flip--96.3%
add-sqr-sqrt82.7%
add-sqr-sqrt98.1%
Applied egg-rr56.8%
associate--l+99.9%
+-inverses99.9%
metadata-eval99.9%
Simplified57.1%
if 3.8000000000000001e31 < y Initial program 89.9%
associate-+l+89.9%
+-commutative89.9%
associate-+r-89.9%
associate-+l-50.7%
+-commutative50.7%
associate--l+50.7%
+-commutative50.7%
Simplified37.5%
Taylor expanded in t around inf 3.1%
associate--l+4.2%
+-commutative4.2%
+-commutative4.2%
associate--l+4.2%
associate-+r+4.2%
+-commutative4.2%
associate-+l+4.2%
Simplified4.2%
Taylor expanded in z around inf 3.1%
associate--l+3.9%
+-commutative3.9%
Simplified3.9%
Taylor expanded in y around inf 20.2%
flip--20.2%
add-sqr-sqrt21.3%
add-sqr-sqrt20.9%
Applied egg-rr20.9%
associate--l+24.8%
+-inverses24.8%
metadata-eval24.8%
Simplified24.8%
Final simplification63.1%
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 t)) (sqrt t))) (t_2 (sqrt (+ 1.0 x))))
(if (<= z 4.3e+14)
(+ (- t_2 (sqrt x)) (+ t_1 (+ 1.0 (- (sqrt (+ 1.0 z)) (sqrt z)))))
(+
(/ 1.0 (+ (sqrt x) t_2))
(+ (/ 1.0 (+ (sqrt (+ 1.0 y)) (sqrt y))) 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 + t)) - sqrt(t);
double t_2 = sqrt((1.0 + x));
double tmp;
if (z <= 4.3e+14) {
tmp = (t_2 - sqrt(x)) + (t_1 + (1.0 + (sqrt((1.0 + z)) - sqrt(z))));
} else {
tmp = (1.0 / (sqrt(x) + t_2)) + ((1.0 / (sqrt((1.0 + y)) + sqrt(y))) + 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) :: tmp
t_1 = sqrt((1.0d0 + t)) - sqrt(t)
t_2 = sqrt((1.0d0 + x))
if (z <= 4.3d+14) then
tmp = (t_2 - sqrt(x)) + (t_1 + (1.0d0 + (sqrt((1.0d0 + z)) - sqrt(z))))
else
tmp = (1.0d0 / (sqrt(x) + t_2)) + ((1.0d0 / (sqrt((1.0d0 + y)) + sqrt(y))) + 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 + t)) - Math.sqrt(t);
double t_2 = Math.sqrt((1.0 + x));
double tmp;
if (z <= 4.3e+14) {
tmp = (t_2 - Math.sqrt(x)) + (t_1 + (1.0 + (Math.sqrt((1.0 + z)) - Math.sqrt(z))));
} else {
tmp = (1.0 / (Math.sqrt(x) + t_2)) + ((1.0 / (Math.sqrt((1.0 + y)) + Math.sqrt(y))) + 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 + t)) - math.sqrt(t) t_2 = math.sqrt((1.0 + x)) tmp = 0 if z <= 4.3e+14: tmp = (t_2 - math.sqrt(x)) + (t_1 + (1.0 + (math.sqrt((1.0 + z)) - math.sqrt(z)))) else: tmp = (1.0 / (math.sqrt(x) + t_2)) + ((1.0 / (math.sqrt((1.0 + y)) + math.sqrt(y))) + 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 + t)) - sqrt(t)) t_2 = sqrt(Float64(1.0 + x)) tmp = 0.0 if (z <= 4.3e+14) tmp = Float64(Float64(t_2 - sqrt(x)) + Float64(t_1 + Float64(1.0 + Float64(sqrt(Float64(1.0 + z)) - sqrt(z))))); else tmp = Float64(Float64(1.0 / Float64(sqrt(x) + t_2)) + Float64(Float64(1.0 / Float64(sqrt(Float64(1.0 + y)) + sqrt(y))) + 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 + t)) - sqrt(t);
t_2 = sqrt((1.0 + x));
tmp = 0.0;
if (z <= 4.3e+14)
tmp = (t_2 - sqrt(x)) + (t_1 + (1.0 + (sqrt((1.0 + z)) - sqrt(z))));
else
tmp = (1.0 / (sqrt(x) + t_2)) + ((1.0 / (sqrt((1.0 + y)) + sqrt(y))) + 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 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[z, 4.3e+14], N[(N[(t$95$2 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(t$95$1 + N[(1.0 + N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + t$95$2), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 / N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $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{1 + t} - \sqrt{t}\\
t_2 := \sqrt{1 + x}\\
\mathbf{if}\;z \leq 4.3 \cdot 10^{+14}:\\
\;\;\;\;\left(t_2 - \sqrt{x}\right) + \left(t_1 + \left(1 + \left(\sqrt{1 + z} - \sqrt{z}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{x} + t_2} + \left(\frac{1}{\sqrt{1 + y} + \sqrt{y}} + t_1\right)\\
\end{array}
\end{array}
if z < 4.3e14Initial program 96.8%
associate-+l+96.8%
associate-+l+96.8%
sub-neg96.8%
+-commutative96.8%
sub-neg96.8%
+-commutative96.8%
+-commutative96.8%
Simplified96.8%
Taylor expanded in y around 0 57.6%
if 4.3e14 < z Initial program 90.2%
associate-+l+90.2%
associate-+l+90.2%
sub-neg90.2%
+-commutative90.2%
sub-neg90.2%
+-commutative90.2%
+-commutative90.2%
Simplified90.2%
flip--90.2%
add-sqr-sqrt69.4%
+-commutative69.4%
add-sqr-sqrt91.5%
+-commutative91.5%
Applied egg-rr91.5%
associate--l+93.9%
+-inverses93.9%
metadata-eval93.9%
+-commutative93.9%
Simplified93.9%
flip--94.2%
add-sqr-sqrt76.5%
add-sqr-sqrt94.5%
Applied egg-rr94.5%
associate--l+96.0%
+-inverses96.0%
metadata-eval96.0%
Simplified96.0%
Taylor expanded in z around inf 96.0%
Final simplification76.2%
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 t)) (sqrt t))) (t_2 (sqrt (+ 1.0 x))))
(if (<= z 4.3e+14)
(+ (- t_2 (sqrt x)) (+ t_1 (+ 1.0 (- (sqrt (+ 1.0 z)) (sqrt z)))))
(+ (/ 1.0 (+ (sqrt x) t_2)) (+ t_1 (- (sqrt (+ 1.0 y)) (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 + t)) - sqrt(t);
double t_2 = sqrt((1.0 + x));
double tmp;
if (z <= 4.3e+14) {
tmp = (t_2 - sqrt(x)) + (t_1 + (1.0 + (sqrt((1.0 + z)) - sqrt(z))));
} else {
tmp = (1.0 / (sqrt(x) + t_2)) + (t_1 + (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) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = sqrt((1.0d0 + t)) - sqrt(t)
t_2 = sqrt((1.0d0 + x))
if (z <= 4.3d+14) then
tmp = (t_2 - sqrt(x)) + (t_1 + (1.0d0 + (sqrt((1.0d0 + z)) - sqrt(z))))
else
tmp = (1.0d0 / (sqrt(x) + t_2)) + (t_1 + (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 t_1 = Math.sqrt((1.0 + t)) - Math.sqrt(t);
double t_2 = Math.sqrt((1.0 + x));
double tmp;
if (z <= 4.3e+14) {
tmp = (t_2 - Math.sqrt(x)) + (t_1 + (1.0 + (Math.sqrt((1.0 + z)) - Math.sqrt(z))));
} else {
tmp = (1.0 / (Math.sqrt(x) + t_2)) + (t_1 + (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): t_1 = math.sqrt((1.0 + t)) - math.sqrt(t) t_2 = math.sqrt((1.0 + x)) tmp = 0 if z <= 4.3e+14: tmp = (t_2 - math.sqrt(x)) + (t_1 + (1.0 + (math.sqrt((1.0 + z)) - math.sqrt(z)))) else: tmp = (1.0 / (math.sqrt(x) + t_2)) + (t_1 + (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) t_1 = Float64(sqrt(Float64(1.0 + t)) - sqrt(t)) t_2 = sqrt(Float64(1.0 + x)) tmp = 0.0 if (z <= 4.3e+14) tmp = Float64(Float64(t_2 - sqrt(x)) + Float64(t_1 + Float64(1.0 + Float64(sqrt(Float64(1.0 + z)) - sqrt(z))))); else tmp = Float64(Float64(1.0 / Float64(sqrt(x) + t_2)) + Float64(t_1 + 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)
t_1 = sqrt((1.0 + t)) - sqrt(t);
t_2 = sqrt((1.0 + x));
tmp = 0.0;
if (z <= 4.3e+14)
tmp = (t_2 - sqrt(x)) + (t_1 + (1.0 + (sqrt((1.0 + z)) - sqrt(z))));
else
tmp = (1.0 / (sqrt(x) + t_2)) + (t_1 + (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_] := Block[{t$95$1 = N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[z, 4.3e+14], N[(N[(t$95$2 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(t$95$1 + N[(1.0 + N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + t$95$2), $MachinePrecision]), $MachinePrecision] + N[(t$95$1 + 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}
t_1 := \sqrt{1 + t} - \sqrt{t}\\
t_2 := \sqrt{1 + x}\\
\mathbf{if}\;z \leq 4.3 \cdot 10^{+14}:\\
\;\;\;\;\left(t_2 - \sqrt{x}\right) + \left(t_1 + \left(1 + \left(\sqrt{1 + z} - \sqrt{z}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{x} + t_2} + \left(t_1 + \left(\sqrt{1 + y} - \sqrt{y}\right)\right)\\
\end{array}
\end{array}
if z < 4.3e14Initial program 96.8%
associate-+l+96.8%
associate-+l+96.8%
sub-neg96.8%
+-commutative96.8%
sub-neg96.8%
+-commutative96.8%
+-commutative96.8%
Simplified96.8%
Taylor expanded in y around 0 57.6%
if 4.3e14 < z Initial program 90.2%
associate-+l+90.2%
associate-+l+90.2%
sub-neg90.2%
+-commutative90.2%
sub-neg90.2%
+-commutative90.2%
+-commutative90.2%
Simplified90.2%
flip--90.2%
add-sqr-sqrt69.4%
+-commutative69.4%
add-sqr-sqrt91.5%
+-commutative91.5%
Applied egg-rr91.5%
associate--l+93.9%
+-inverses93.9%
metadata-eval93.9%
+-commutative93.9%
Simplified93.9%
Taylor expanded in z around inf 93.9%
Final simplification75.2%
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 (<= t 3.1e+25)
(+
1.0
(-
(+ t_1 (+ 1.0 (+ (sqrt (+ 1.0 t)) (* z 0.5))))
(+ (sqrt z) (+ (sqrt x) (sqrt t)))))
(+
t_1
(+
(- (sqrt (+ 1.0 z)) (sqrt z))
(- (- (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 t_1 = sqrt((1.0 + x));
double tmp;
if (t <= 3.1e+25) {
tmp = 1.0 + ((t_1 + (1.0 + (sqrt((1.0 + t)) + (z * 0.5)))) - (sqrt(z) + (sqrt(x) + sqrt(t))));
} else {
tmp = t_1 + ((sqrt((1.0 + z)) - sqrt(z)) + ((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) :: t_1
real(8) :: tmp
t_1 = sqrt((1.0d0 + x))
if (t <= 3.1d+25) then
tmp = 1.0d0 + ((t_1 + (1.0d0 + (sqrt((1.0d0 + t)) + (z * 0.5d0)))) - (sqrt(z) + (sqrt(x) + sqrt(t))))
else
tmp = t_1 + ((sqrt((1.0d0 + z)) - sqrt(z)) + ((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 t_1 = Math.sqrt((1.0 + x));
double tmp;
if (t <= 3.1e+25) {
tmp = 1.0 + ((t_1 + (1.0 + (Math.sqrt((1.0 + t)) + (z * 0.5)))) - (Math.sqrt(z) + (Math.sqrt(x) + Math.sqrt(t))));
} else {
tmp = t_1 + ((Math.sqrt((1.0 + z)) - Math.sqrt(z)) + ((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): t_1 = math.sqrt((1.0 + x)) tmp = 0 if t <= 3.1e+25: tmp = 1.0 + ((t_1 + (1.0 + (math.sqrt((1.0 + t)) + (z * 0.5)))) - (math.sqrt(z) + (math.sqrt(x) + math.sqrt(t)))) else: tmp = t_1 + ((math.sqrt((1.0 + z)) - math.sqrt(z)) + ((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) t_1 = sqrt(Float64(1.0 + x)) tmp = 0.0 if (t <= 3.1e+25) tmp = Float64(1.0 + Float64(Float64(t_1 + Float64(1.0 + Float64(sqrt(Float64(1.0 + t)) + Float64(z * 0.5)))) - Float64(sqrt(z) + Float64(sqrt(x) + sqrt(t))))); else tmp = Float64(t_1 + Float64(Float64(sqrt(Float64(1.0 + z)) - sqrt(z)) + Float64(Float64(sqrt(Float64(1.0 + y)) - 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 + x));
tmp = 0.0;
if (t <= 3.1e+25)
tmp = 1.0 + ((t_1 + (1.0 + (sqrt((1.0 + t)) + (z * 0.5)))) - (sqrt(z) + (sqrt(x) + sqrt(t))));
else
tmp = t_1 + ((sqrt((1.0 + z)) - sqrt(z)) + ((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_] := Block[{t$95$1 = N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t, 3.1e+25], N[(1.0 + N[(N[(t$95$1 + N[(1.0 + N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] + N[(z * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[z], $MachinePrecision] + N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 + N[(N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] + N[(N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] - N[Sqrt[x], $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}
t_1 := \sqrt{1 + x}\\
\mathbf{if}\;t \leq 3.1 \cdot 10^{+25}:\\
\;\;\;\;1 + \left(\left(t_1 + \left(1 + \left(\sqrt{1 + t} + z \cdot 0.5\right)\right)\right) - \left(\sqrt{z} + \left(\sqrt{x} + \sqrt{t}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_1 + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\left(\sqrt{1 + y} - \sqrt{x}\right) - \sqrt{y}\right)\right)\\
\end{array}
\end{array}
if t < 3.0999999999999998e25Initial program 94.9%
associate-+l+94.9%
+-commutative94.9%
associate-+r-78.2%
associate-+l-54.1%
+-commutative54.1%
associate--l+54.1%
+-commutative54.1%
Simplified38.5%
Taylor expanded in y around 0 21.1%
associate--l+42.3%
associate-+r+42.3%
+-commutative42.3%
+-commutative42.3%
+-commutative42.3%
Simplified42.3%
Taylor expanded in z around 0 26.8%
if 3.0999999999999998e25 < t Initial program 92.1%
associate-+l+92.1%
sub-neg92.1%
associate-+l+71.2%
associate-+l+56.7%
+-commutative56.7%
neg-sub056.7%
associate-+l-56.7%
neg-sub056.7%
Simplified20.9%
Taylor expanded in t around inf 55.6%
+-commutative55.6%
Simplified55.6%
Final simplification39.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 y))) (t_2 (sqrt (+ 1.0 z))))
(if (<= z 5.6e-21)
(+ 2.0 (+ t_2 (- (sqrt (+ 1.0 t)) (+ (sqrt t) (sqrt z)))))
(if (<= z 1.2e+15)
(+ t_1 (+ 1.0 (- (- t_2 (sqrt y)) (sqrt z))))
(+ (sqrt (+ 1.0 x)) (- (- t_1 (sqrt y)) (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 + y));
double t_2 = sqrt((1.0 + z));
double tmp;
if (z <= 5.6e-21) {
tmp = 2.0 + (t_2 + (sqrt((1.0 + t)) - (sqrt(t) + sqrt(z))));
} else if (z <= 1.2e+15) {
tmp = t_1 + (1.0 + ((t_2 - sqrt(y)) - sqrt(z)));
} else {
tmp = sqrt((1.0 + x)) + ((t_1 - sqrt(y)) - 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) :: t_2
real(8) :: tmp
t_1 = sqrt((1.0d0 + y))
t_2 = sqrt((1.0d0 + z))
if (z <= 5.6d-21) then
tmp = 2.0d0 + (t_2 + (sqrt((1.0d0 + t)) - (sqrt(t) + sqrt(z))))
else if (z <= 1.2d+15) then
tmp = t_1 + (1.0d0 + ((t_2 - sqrt(y)) - sqrt(z)))
else
tmp = sqrt((1.0d0 + x)) + ((t_1 - sqrt(y)) - 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 + y));
double t_2 = Math.sqrt((1.0 + z));
double tmp;
if (z <= 5.6e-21) {
tmp = 2.0 + (t_2 + (Math.sqrt((1.0 + t)) - (Math.sqrt(t) + Math.sqrt(z))));
} else if (z <= 1.2e+15) {
tmp = t_1 + (1.0 + ((t_2 - Math.sqrt(y)) - Math.sqrt(z)));
} else {
tmp = Math.sqrt((1.0 + x)) + ((t_1 - Math.sqrt(y)) - 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 + y)) t_2 = math.sqrt((1.0 + z)) tmp = 0 if z <= 5.6e-21: tmp = 2.0 + (t_2 + (math.sqrt((1.0 + t)) - (math.sqrt(t) + math.sqrt(z)))) elif z <= 1.2e+15: tmp = t_1 + (1.0 + ((t_2 - math.sqrt(y)) - math.sqrt(z))) else: tmp = math.sqrt((1.0 + x)) + ((t_1 - math.sqrt(y)) - 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 + y)) t_2 = sqrt(Float64(1.0 + z)) tmp = 0.0 if (z <= 5.6e-21) tmp = Float64(2.0 + Float64(t_2 + Float64(sqrt(Float64(1.0 + t)) - Float64(sqrt(t) + sqrt(z))))); elseif (z <= 1.2e+15) tmp = Float64(t_1 + Float64(1.0 + Float64(Float64(t_2 - sqrt(y)) - sqrt(z)))); else tmp = Float64(sqrt(Float64(1.0 + x)) + Float64(Float64(t_1 - sqrt(y)) - 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 + y));
t_2 = sqrt((1.0 + z));
tmp = 0.0;
if (z <= 5.6e-21)
tmp = 2.0 + (t_2 + (sqrt((1.0 + t)) - (sqrt(t) + sqrt(z))));
elseif (z <= 1.2e+15)
tmp = t_1 + (1.0 + ((t_2 - sqrt(y)) - sqrt(z)));
else
tmp = sqrt((1.0 + x)) + ((t_1 - sqrt(y)) - 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 + y), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[z, 5.6e-21], N[(2.0 + N[(t$95$2 + N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[(N[Sqrt[t], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.2e+15], N[(t$95$1 + N[(1.0 + N[(N[(t$95$2 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision] + N[(N[(t$95$1 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision] - 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 + y}\\
t_2 := \sqrt{1 + z}\\
\mathbf{if}\;z \leq 5.6 \cdot 10^{-21}:\\
\;\;\;\;2 + \left(t_2 + \left(\sqrt{1 + t} - \left(\sqrt{t} + \sqrt{z}\right)\right)\right)\\
\mathbf{elif}\;z \leq 1.2 \cdot 10^{+15}:\\
\;\;\;\;t_1 + \left(1 + \left(\left(t_2 - \sqrt{y}\right) - \sqrt{z}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\sqrt{1 + x} + \left(\left(t_1 - \sqrt{y}\right) - \sqrt{x}\right)\\
\end{array}
\end{array}
if z < 5.60000000000000008e-21Initial program 98.0%
associate-+l+98.0%
+-commutative98.0%
associate-+r-85.0%
associate-+l-60.6%
+-commutative60.6%
associate--l+60.6%
+-commutative60.6%
Simplified60.5%
Taylor expanded in y around 0 23.8%
associate--l+44.3%
associate-+r+44.3%
+-commutative44.3%
+-commutative44.3%
+-commutative44.3%
Simplified44.3%
Taylor expanded in x around 0 24.5%
associate--l+46.0%
associate--l+41.8%
Simplified41.8%
if 5.60000000000000008e-21 < z < 1.2e15Initial program 86.7%
associate-+l+86.7%
+-commutative86.7%
associate-+r-59.9%
associate-+l-35.3%
+-commutative35.3%
associate--l+35.3%
+-commutative35.3%
Simplified29.5%
Taylor expanded in t around inf 11.1%
associate--l+16.6%
+-commutative16.6%
+-commutative16.6%
associate--l+16.6%
associate-+r+16.6%
+-commutative16.6%
associate-+l+16.6%
Simplified16.6%
Taylor expanded in x around 0 32.2%
associate--l+32.3%
+-commutative32.3%
associate--r+32.3%
Simplified32.3%
if 1.2e15 < z Initial program 90.2%
associate-+l+90.2%
+-commutative90.2%
associate-+r-67.2%
associate-+l-52.5%
+-commutative52.5%
associate--l+52.5%
+-commutative52.5%
Simplified21.3%
Taylor expanded in z around inf 51.0%
associate--l+52.5%
Simplified52.5%
Taylor expanded in t around inf 22.2%
+-commutative22.2%
associate--r+21.7%
+-commutative21.7%
associate-+r-33.8%
associate--l+33.8%
Simplified33.8%
Final simplification37.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 (<= z 1.65) (+ 2.0 (+ (sqrt (+ 1.0 z)) (- (sqrt (+ 1.0 t)) (+ (sqrt t) (sqrt z))))) (+ (sqrt (+ 1.0 x)) (- (- (sqrt (+ 1.0 y)) (sqrt y)) (sqrt x)))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (z <= 1.65) {
tmp = 2.0 + (sqrt((1.0 + z)) + (sqrt((1.0 + t)) - (sqrt(t) + sqrt(z))));
} else {
tmp = sqrt((1.0 + x)) + ((sqrt((1.0 + y)) - sqrt(y)) - 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 (z <= 1.65d0) then
tmp = 2.0d0 + (sqrt((1.0d0 + z)) + (sqrt((1.0d0 + t)) - (sqrt(t) + sqrt(z))))
else
tmp = sqrt((1.0d0 + x)) + ((sqrt((1.0d0 + y)) - sqrt(y)) - 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 (z <= 1.65) {
tmp = 2.0 + (Math.sqrt((1.0 + z)) + (Math.sqrt((1.0 + t)) - (Math.sqrt(t) + Math.sqrt(z))));
} else {
tmp = Math.sqrt((1.0 + x)) + ((Math.sqrt((1.0 + y)) - Math.sqrt(y)) - Math.sqrt(x));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if z <= 1.65: tmp = 2.0 + (math.sqrt((1.0 + z)) + (math.sqrt((1.0 + t)) - (math.sqrt(t) + math.sqrt(z)))) else: tmp = math.sqrt((1.0 + x)) + ((math.sqrt((1.0 + y)) - math.sqrt(y)) - math.sqrt(x)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (z <= 1.65) tmp = Float64(2.0 + Float64(sqrt(Float64(1.0 + z)) + Float64(sqrt(Float64(1.0 + t)) - Float64(sqrt(t) + sqrt(z))))); else tmp = Float64(sqrt(Float64(1.0 + x)) + Float64(Float64(sqrt(Float64(1.0 + y)) - sqrt(y)) - 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 (z <= 1.65)
tmp = 2.0 + (sqrt((1.0 + z)) + (sqrt((1.0 + t)) - (sqrt(t) + sqrt(z))));
else
tmp = sqrt((1.0 + x)) + ((sqrt((1.0 + y)) - sqrt(y)) - 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[z, 1.65], N[(2.0 + N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] + N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[(N[Sqrt[t], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision] + N[(N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $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}\;z \leq 1.65:\\
\;\;\;\;2 + \left(\sqrt{1 + z} + \left(\sqrt{1 + t} - \left(\sqrt{t} + \sqrt{z}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\sqrt{1 + x} + \left(\left(\sqrt{1 + y} - \sqrt{y}\right) - \sqrt{x}\right)\\
\end{array}
\end{array}
if z < 1.6499999999999999Initial program 97.7%
associate-+l+97.7%
+-commutative97.7%
associate-+r-83.5%
associate-+l-59.2%
+-commutative59.2%
associate--l+59.2%
+-commutative59.2%
Simplified59.2%
Taylor expanded in y around 0 23.7%
associate--l+43.5%
associate-+r+43.5%
+-commutative43.5%
+-commutative43.5%
+-commutative43.5%
Simplified43.5%
Taylor expanded in x around 0 24.2%
associate--l+45.2%
associate--l+40.8%
Simplified40.8%
if 1.6499999999999999 < z Initial program 89.7%
associate-+l+89.7%
+-commutative89.7%
associate-+r-67.0%
associate-+l-51.5%
+-commutative51.5%
associate--l+51.5%
+-commutative51.5%
Simplified21.3%
Taylor expanded in z around inf 49.5%
associate--l+50.9%
Simplified50.9%
Taylor expanded in t around inf 21.4%
+-commutative21.4%
associate--r+20.9%
+-commutative20.9%
associate-+r-32.4%
associate--l+32.4%
Simplified32.4%
Final simplification36.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))))
(if (<= z 0.08)
(- (+ 1.0 (+ 1.0 t_1)) (+ (sqrt x) (sqrt y)))
(+ t_1 (- (- (sqrt (+ 1.0 y)) (sqrt y)) (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 (z <= 0.08) {
tmp = (1.0 + (1.0 + t_1)) - (sqrt(x) + sqrt(y));
} else {
tmp = t_1 + ((sqrt((1.0 + y)) - sqrt(y)) - 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 (z <= 0.08d0) then
tmp = (1.0d0 + (1.0d0 + t_1)) - (sqrt(x) + sqrt(y))
else
tmp = t_1 + ((sqrt((1.0d0 + y)) - sqrt(y)) - 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 (z <= 0.08) {
tmp = (1.0 + (1.0 + t_1)) - (Math.sqrt(x) + Math.sqrt(y));
} else {
tmp = t_1 + ((Math.sqrt((1.0 + y)) - Math.sqrt(y)) - 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 z <= 0.08: tmp = (1.0 + (1.0 + t_1)) - (math.sqrt(x) + math.sqrt(y)) else: tmp = t_1 + ((math.sqrt((1.0 + y)) - math.sqrt(y)) - 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 (z <= 0.08) tmp = Float64(Float64(1.0 + Float64(1.0 + t_1)) - Float64(sqrt(x) + sqrt(y))); else tmp = Float64(t_1 + Float64(Float64(sqrt(Float64(1.0 + y)) - sqrt(y)) - 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 (z <= 0.08)
tmp = (1.0 + (1.0 + t_1)) - (sqrt(x) + sqrt(y));
else
tmp = t_1 + ((sqrt((1.0 + y)) - sqrt(y)) - 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[z, 0.08], N[(N[(1.0 + N[(1.0 + t$95$1), $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 + N[(N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision] - 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}\;z \leq 0.08:\\
\;\;\;\;\left(1 + \left(1 + t_1\right)\right) - \left(\sqrt{x} + \sqrt{y}\right)\\
\mathbf{else}:\\
\;\;\;\;t_1 + \left(\left(\sqrt{1 + y} - \sqrt{y}\right) - \sqrt{x}\right)\\
\end{array}
\end{array}
if z < 0.0800000000000000017Initial program 97.7%
associate-+l+97.7%
+-commutative97.7%
associate-+r-83.5%
associate-+l-59.2%
+-commutative59.2%
associate--l+59.2%
+-commutative59.2%
Simplified59.2%
Taylor expanded in z around inf 13.4%
associate--l+13.1%
Simplified13.1%
Taylor expanded in t around 0 20.8%
Taylor expanded in y around 0 19.4%
if 0.0800000000000000017 < z Initial program 89.7%
associate-+l+89.7%
+-commutative89.7%
associate-+r-67.0%
associate-+l-51.5%
+-commutative51.5%
associate--l+51.5%
+-commutative51.5%
Simplified21.3%
Taylor expanded in z around inf 49.5%
associate--l+50.9%
Simplified50.9%
Taylor expanded in t around inf 21.4%
+-commutative21.4%
associate--r+20.9%
+-commutative20.9%
associate-+r-32.4%
associate--l+32.4%
Simplified32.4%
Final simplification26.1%
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 0.085) (- (+ 1.0 (+ 1.0 (sqrt (+ 1.0 x)))) (+ (sqrt x) (sqrt y))) (+ 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 <= 0.085) {
tmp = (1.0 + (1.0 + sqrt((1.0 + x)))) - (sqrt(x) + sqrt(y));
} 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 <= 0.085d0) then
tmp = (1.0d0 + (1.0d0 + sqrt((1.0d0 + x)))) - (sqrt(x) + sqrt(y))
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 <= 0.085) {
tmp = (1.0 + (1.0 + Math.sqrt((1.0 + x)))) - (Math.sqrt(x) + Math.sqrt(y));
} 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 <= 0.085: tmp = (1.0 + (1.0 + math.sqrt((1.0 + x)))) - (math.sqrt(x) + math.sqrt(y)) 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 <= 0.085) tmp = Float64(Float64(1.0 + Float64(1.0 + sqrt(Float64(1.0 + x)))) - Float64(sqrt(x) + sqrt(y))); 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 <= 0.085)
tmp = (1.0 + (1.0 + sqrt((1.0 + x)))) - (sqrt(x) + sqrt(y));
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, 0.085], N[(N[(1.0 + N[(1.0 + N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $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 0.085:\\
\;\;\;\;\left(1 + \left(1 + \sqrt{1 + x}\right)\right) - \left(\sqrt{x} + \sqrt{y}\right)\\
\mathbf{else}:\\
\;\;\;\;1 + \left(\sqrt{1 + y} - \sqrt{y}\right)\\
\end{array}
\end{array}
if z < 0.0850000000000000061Initial program 97.7%
associate-+l+97.7%
+-commutative97.7%
associate-+r-83.5%
associate-+l-59.2%
+-commutative59.2%
associate--l+59.2%
+-commutative59.2%
Simplified59.2%
Taylor expanded in z around inf 13.4%
associate--l+13.1%
Simplified13.1%
Taylor expanded in t around 0 20.8%
Taylor expanded in y around 0 19.4%
if 0.0850000000000000061 < z Initial program 89.7%
associate-+l+89.7%
+-commutative89.7%
associate-+r-67.0%
associate-+l-51.5%
+-commutative51.5%
associate--l+51.5%
+-commutative51.5%
Simplified21.3%
Taylor expanded in t around inf 4.9%
associate--l+23.3%
+-commutative23.3%
+-commutative23.3%
associate--l+27.2%
associate-+r+27.2%
+-commutative27.2%
associate-+l+27.2%
Simplified27.2%
Taylor expanded in z around inf 21.4%
associate--l+34.7%
+-commutative34.7%
Simplified34.7%
Taylor expanded in x around 0 35.7%
associate--l+59.9%
Simplified59.9%
Final simplification40.1%
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 1.85) (+ 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 <= 1.85) {
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 <= 1.85d0) 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 <= 1.85) {
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 <= 1.85: 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 <= 1.85) 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 <= 1.85)
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, 1.85], 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 1.85:\\
\;\;\;\;1 + t_1\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if y < 1.8500000000000001Initial program 97.1%
associate-+l+97.1%
+-commutative97.1%
associate-+r-62.7%
associate-+l-57.9%
+-commutative57.9%
associate--l+57.9%
+-commutative57.9%
Simplified41.8%
Taylor expanded in t around inf 20.6%
associate--l+39.8%
+-commutative39.8%
+-commutative39.8%
associate--l+43.6%
associate-+r+43.6%
+-commutative43.6%
associate-+l+43.6%
Simplified43.6%
Taylor expanded in z around inf 23.7%
associate--l+38.6%
+-commutative38.6%
Simplified38.6%
Taylor expanded in y around 0 22.9%
associate--l+37.8%
Simplified37.8%
if 1.8500000000000001 < y Initial program 89.5%
associate-+l+89.5%
+-commutative89.5%
associate-+r-89.5%
associate-+l-52.2%
+-commutative52.2%
associate--l+52.2%
+-commutative52.2%
Simplified37.4%
Taylor expanded in t around inf 3.4%
associate--l+4.8%
+-commutative4.8%
+-commutative4.8%
associate--l+4.7%
associate-+r+4.7%
+-commutative4.7%
associate-+l+4.7%
Simplified4.7%
Taylor expanded in z around inf 5.4%
associate--l+6.2%
+-commutative6.2%
Simplified6.2%
Taylor expanded in y around inf 20.6%
Final simplification29.9%
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)))) (if (<= z 0.64) (+ t_1 2.0) (+ 1.0 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 + y)) - sqrt(y);
double tmp;
if (z <= 0.64) {
tmp = t_1 + 2.0;
} else {
tmp = 1.0 + 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 + y)) - sqrt(y)
if (z <= 0.64d0) then
tmp = t_1 + 2.0d0
else
tmp = 1.0d0 + 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 + y)) - Math.sqrt(y);
double tmp;
if (z <= 0.64) {
tmp = t_1 + 2.0;
} else {
tmp = 1.0 + 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 + y)) - math.sqrt(y) tmp = 0 if z <= 0.64: tmp = t_1 + 2.0 else: tmp = 1.0 + 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 + y)) - sqrt(y)) tmp = 0.0 if (z <= 0.64) tmp = Float64(t_1 + 2.0); else tmp = Float64(1.0 + 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 + y)) - sqrt(y);
tmp = 0.0;
if (z <= 0.64)
tmp = t_1 + 2.0;
else
tmp = 1.0 + 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 + y), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, 0.64], N[(t$95$1 + 2.0), $MachinePrecision], N[(1.0 + t$95$1), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + y} - \sqrt{y}\\
\mathbf{if}\;z \leq 0.64:\\
\;\;\;\;t_1 + 2\\
\mathbf{else}:\\
\;\;\;\;1 + t_1\\
\end{array}
\end{array}
if z < 0.640000000000000013Initial program 97.7%
associate-+l+97.7%
+-commutative97.7%
associate-+r-83.5%
associate-+l-59.2%
+-commutative59.2%
associate--l+59.2%
+-commutative59.2%
Simplified59.2%
Taylor expanded in z around inf 13.4%
associate--l+13.1%
Simplified13.1%
Taylor expanded in t around 0 20.8%
Taylor expanded in x around 0 30.1%
associate--l+52.0%
Simplified52.0%
if 0.640000000000000013 < z Initial program 89.7%
associate-+l+89.7%
+-commutative89.7%
associate-+r-67.0%
associate-+l-51.5%
+-commutative51.5%
associate--l+51.5%
+-commutative51.5%
Simplified21.3%
Taylor expanded in t around inf 4.9%
associate--l+23.3%
+-commutative23.3%
+-commutative23.3%
associate--l+27.2%
associate-+r+27.2%
+-commutative27.2%
associate-+l+27.2%
Simplified27.2%
Taylor expanded in z around inf 21.4%
associate--l+34.7%
+-commutative34.7%
Simplified34.7%
Taylor expanded in x around 0 35.7%
associate--l+59.9%
Simplified59.9%
Final simplification56.0%
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 93.6%
associate-+l+93.6%
+-commutative93.6%
associate-+r-75.0%
associate-+l-55.3%
+-commutative55.3%
associate--l+55.3%
+-commutative55.3%
Simplified39.8%
Taylor expanded in t around inf 12.7%
associate--l+23.7%
+-commutative23.7%
+-commutative23.7%
associate--l+25.7%
associate-+r+25.7%
+-commutative25.7%
associate-+l+25.7%
Simplified25.7%
Taylor expanded in z around inf 15.2%
associate--l+23.6%
+-commutative23.6%
Simplified23.6%
Taylor expanded in x around 0 28.4%
associate--l+48.8%
Simplified48.8%
Final simplification48.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 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 93.6%
associate-+l+93.6%
+-commutative93.6%
associate-+r-75.0%
associate-+l-55.3%
+-commutative55.3%
associate--l+55.3%
+-commutative55.3%
Simplified39.8%
Taylor expanded in t around inf 12.7%
associate--l+23.7%
+-commutative23.7%
+-commutative23.7%
associate--l+25.7%
associate-+r+25.7%
+-commutative25.7%
associate-+l+25.7%
Simplified25.7%
Taylor expanded in z around inf 15.2%
associate--l+23.6%
+-commutative23.6%
Simplified23.6%
Taylor expanded in y around inf 15.6%
Final simplification15.6%
(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 2023196
(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))))