
(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 21 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 (+ x 1.0)))
(t_2 (sqrt (+ 1.0 z)))
(t_3 (- (sqrt (+ 1.0 t)) (sqrt t))))
(if (<= (- t_1 (sqrt x)) 0.9)
(+
(+
(+ (* 0.5 (sqrt (/ 1.0 y))) (/ 1.0 (+ (sqrt x) t_1)))
(- t_2 (sqrt z)))
t_3)
(+
t_3
(+
(+ (- (+ 1.0 (* x 0.5)) (sqrt x)) (/ 1.0 (+ (sqrt (+ 1.0 y)) (sqrt y))))
(/ 1.0 (+ (sqrt z) t_2)))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((x + 1.0));
double t_2 = sqrt((1.0 + z));
double t_3 = sqrt((1.0 + t)) - sqrt(t);
double tmp;
if ((t_1 - sqrt(x)) <= 0.9) {
tmp = (((0.5 * sqrt((1.0 / y))) + (1.0 / (sqrt(x) + t_1))) + (t_2 - sqrt(z))) + t_3;
} else {
tmp = t_3 + ((((1.0 + (x * 0.5)) - sqrt(x)) + (1.0 / (sqrt((1.0 + y)) + sqrt(y)))) + (1.0 / (sqrt(z) + 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) :: t_3
real(8) :: tmp
t_1 = sqrt((x + 1.0d0))
t_2 = sqrt((1.0d0 + z))
t_3 = sqrt((1.0d0 + t)) - sqrt(t)
if ((t_1 - sqrt(x)) <= 0.9d0) then
tmp = (((0.5d0 * sqrt((1.0d0 / y))) + (1.0d0 / (sqrt(x) + t_1))) + (t_2 - sqrt(z))) + t_3
else
tmp = t_3 + ((((1.0d0 + (x * 0.5d0)) - sqrt(x)) + (1.0d0 / (sqrt((1.0d0 + y)) + sqrt(y)))) + (1.0d0 / (sqrt(z) + 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((x + 1.0));
double t_2 = Math.sqrt((1.0 + z));
double t_3 = Math.sqrt((1.0 + t)) - Math.sqrt(t);
double tmp;
if ((t_1 - Math.sqrt(x)) <= 0.9) {
tmp = (((0.5 * Math.sqrt((1.0 / y))) + (1.0 / (Math.sqrt(x) + t_1))) + (t_2 - Math.sqrt(z))) + t_3;
} else {
tmp = t_3 + ((((1.0 + (x * 0.5)) - Math.sqrt(x)) + (1.0 / (Math.sqrt((1.0 + y)) + Math.sqrt(y)))) + (1.0 / (Math.sqrt(z) + t_2)));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((x + 1.0)) t_2 = math.sqrt((1.0 + z)) t_3 = math.sqrt((1.0 + t)) - math.sqrt(t) tmp = 0 if (t_1 - math.sqrt(x)) <= 0.9: tmp = (((0.5 * math.sqrt((1.0 / y))) + (1.0 / (math.sqrt(x) + t_1))) + (t_2 - math.sqrt(z))) + t_3 else: tmp = t_3 + ((((1.0 + (x * 0.5)) - math.sqrt(x)) + (1.0 / (math.sqrt((1.0 + y)) + math.sqrt(y)))) + (1.0 / (math.sqrt(z) + t_2))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(x + 1.0)) t_2 = sqrt(Float64(1.0 + z)) t_3 = Float64(sqrt(Float64(1.0 + t)) - sqrt(t)) tmp = 0.0 if (Float64(t_1 - sqrt(x)) <= 0.9) tmp = Float64(Float64(Float64(Float64(0.5 * sqrt(Float64(1.0 / y))) + Float64(1.0 / Float64(sqrt(x) + t_1))) + Float64(t_2 - sqrt(z))) + t_3); else tmp = Float64(t_3 + Float64(Float64(Float64(Float64(1.0 + Float64(x * 0.5)) - sqrt(x)) + Float64(1.0 / Float64(sqrt(Float64(1.0 + y)) + sqrt(y)))) + Float64(1.0 / Float64(sqrt(z) + 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((x + 1.0));
t_2 = sqrt((1.0 + z));
t_3 = sqrt((1.0 + t)) - sqrt(t);
tmp = 0.0;
if ((t_1 - sqrt(x)) <= 0.9)
tmp = (((0.5 * sqrt((1.0 / y))) + (1.0 / (sqrt(x) + t_1))) + (t_2 - sqrt(z))) + t_3;
else
tmp = t_3 + ((((1.0 + (x * 0.5)) - sqrt(x)) + (1.0 / (sqrt((1.0 + y)) + sqrt(y)))) + (1.0 / (sqrt(z) + t_2)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(1.0 + z), $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$1 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision], 0.9], N[(N[(N[(N[(0.5 * N[Sqrt[N[(1.0 / y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$2 - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$3), $MachinePrecision], N[(t$95$3 + N[(N[(N[(N[(1.0 + N[(x * 0.5), $MachinePrecision]), $MachinePrecision] - N[Sqrt[x], $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[z], $MachinePrecision] + t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{x + 1}\\
t_2 := \sqrt{1 + z}\\
t_3 := \sqrt{1 + t} - \sqrt{t}\\
\mathbf{if}\;t\_1 - \sqrt{x} \leq 0.9:\\
\;\;\;\;\left(\left(0.5 \cdot \sqrt{\frac{1}{y}} + \frac{1}{\sqrt{x} + t\_1}\right) + \left(t\_2 - \sqrt{z}\right)\right) + t\_3\\
\mathbf{else}:\\
\;\;\;\;t\_3 + \left(\left(\left(\left(1 + x \cdot 0.5\right) - \sqrt{x}\right) + \frac{1}{\sqrt{1 + y} + \sqrt{y}}\right) + \frac{1}{\sqrt{z} + t\_2}\right)\\
\end{array}
\end{array}
if (-.f64 (sqrt.f64 (+.f64 x #s(literal 1 binary64))) (sqrt.f64 x)) < 0.900000000000000022Initial program 85.1%
flip--85.3%
add-sqr-sqrt63.4%
+-commutative63.4%
add-sqr-sqrt86.2%
+-commutative86.2%
Applied egg-rr86.2%
associate--l+91.0%
+-inverses91.0%
metadata-eval91.0%
Simplified91.0%
flip--91.1%
add-sqr-sqrt43.9%
add-sqr-sqrt91.1%
Applied egg-rr91.1%
Taylor expanded in y around inf 53.5%
if 0.900000000000000022 < (-.f64 (sqrt.f64 (+.f64 x #s(literal 1 binary64))) (sqrt.f64 x)) Initial program 97.8%
flip--97.8%
add-sqr-sqrt74.2%
+-commutative74.2%
add-sqr-sqrt98.1%
+-commutative98.1%
Applied egg-rr98.1%
associate--l+98.1%
+-inverses98.1%
metadata-eval98.1%
Simplified98.1%
Taylor expanded in x around 0 97.7%
flip--97.7%
add-sqr-sqrt78.0%
+-commutative78.0%
add-sqr-sqrt98.3%
+-commutative98.3%
Applied egg-rr98.3%
associate--l+98.7%
+-inverses98.7%
metadata-eval98.7%
Simplified98.7%
Final simplification78.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 t)) (sqrt t)))
(t_2 (sqrt (+ x 1.0)))
(t_3 (- (sqrt (+ 1.0 z)) (sqrt z))))
(if (<= (- t_2 (sqrt x)) 0.9)
(+ (+ (+ (* 0.5 (sqrt (/ 1.0 y))) (/ 1.0 (+ (sqrt x) t_2))) t_3) t_1)
(+
t_1
(+
t_3
(+
(- (+ 1.0 (* x 0.5)) (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) {
double t_1 = sqrt((1.0 + t)) - sqrt(t);
double t_2 = sqrt((x + 1.0));
double t_3 = sqrt((1.0 + z)) - sqrt(z);
double tmp;
if ((t_2 - sqrt(x)) <= 0.9) {
tmp = (((0.5 * sqrt((1.0 / y))) + (1.0 / (sqrt(x) + t_2))) + t_3) + t_1;
} else {
tmp = t_1 + (t_3 + (((1.0 + (x * 0.5)) - sqrt(x)) + (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) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = sqrt((1.0d0 + t)) - sqrt(t)
t_2 = sqrt((x + 1.0d0))
t_3 = sqrt((1.0d0 + z)) - sqrt(z)
if ((t_2 - sqrt(x)) <= 0.9d0) then
tmp = (((0.5d0 * sqrt((1.0d0 / y))) + (1.0d0 / (sqrt(x) + t_2))) + t_3) + t_1
else
tmp = t_1 + (t_3 + (((1.0d0 + (x * 0.5d0)) - sqrt(x)) + (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 t_1 = Math.sqrt((1.0 + t)) - Math.sqrt(t);
double t_2 = Math.sqrt((x + 1.0));
double t_3 = Math.sqrt((1.0 + z)) - Math.sqrt(z);
double tmp;
if ((t_2 - Math.sqrt(x)) <= 0.9) {
tmp = (((0.5 * Math.sqrt((1.0 / y))) + (1.0 / (Math.sqrt(x) + t_2))) + t_3) + t_1;
} else {
tmp = t_1 + (t_3 + (((1.0 + (x * 0.5)) - Math.sqrt(x)) + (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): t_1 = math.sqrt((1.0 + t)) - math.sqrt(t) t_2 = math.sqrt((x + 1.0)) t_3 = math.sqrt((1.0 + z)) - math.sqrt(z) tmp = 0 if (t_2 - math.sqrt(x)) <= 0.9: tmp = (((0.5 * math.sqrt((1.0 / y))) + (1.0 / (math.sqrt(x) + t_2))) + t_3) + t_1 else: tmp = t_1 + (t_3 + (((1.0 + (x * 0.5)) - math.sqrt(x)) + (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) t_1 = Float64(sqrt(Float64(1.0 + t)) - sqrt(t)) t_2 = sqrt(Float64(x + 1.0)) t_3 = Float64(sqrt(Float64(1.0 + z)) - sqrt(z)) tmp = 0.0 if (Float64(t_2 - sqrt(x)) <= 0.9) tmp = Float64(Float64(Float64(Float64(0.5 * sqrt(Float64(1.0 / y))) + Float64(1.0 / Float64(sqrt(x) + t_2))) + t_3) + t_1); else tmp = Float64(t_1 + Float64(t_3 + Float64(Float64(Float64(1.0 + Float64(x * 0.5)) - sqrt(x)) + 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)
t_1 = sqrt((1.0 + t)) - sqrt(t);
t_2 = sqrt((x + 1.0));
t_3 = sqrt((1.0 + z)) - sqrt(z);
tmp = 0.0;
if ((t_2 - sqrt(x)) <= 0.9)
tmp = (((0.5 * sqrt((1.0 / y))) + (1.0 / (sqrt(x) + t_2))) + t_3) + t_1;
else
tmp = t_1 + (t_3 + (((1.0 + (x * 0.5)) - sqrt(x)) + (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_] := 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[(x + 1.0), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(t$95$2 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision], 0.9], N[(N[(N[(N[(0.5 * N[Sqrt[N[(1.0 / y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$3), $MachinePrecision] + t$95$1), $MachinePrecision], N[(t$95$1 + N[(t$95$3 + N[(N[(N[(1.0 + N[(x * 0.5), $MachinePrecision]), $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + t} - \sqrt{t}\\
t_2 := \sqrt{x + 1}\\
t_3 := \sqrt{1 + z} - \sqrt{z}\\
\mathbf{if}\;t\_2 - \sqrt{x} \leq 0.9:\\
\;\;\;\;\left(\left(0.5 \cdot \sqrt{\frac{1}{y}} + \frac{1}{\sqrt{x} + t\_2}\right) + t\_3\right) + t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_1 + \left(t\_3 + \left(\left(\left(1 + x \cdot 0.5\right) - \sqrt{x}\right) + \frac{1}{\sqrt{1 + y} + \sqrt{y}}\right)\right)\\
\end{array}
\end{array}
if (-.f64 (sqrt.f64 (+.f64 x #s(literal 1 binary64))) (sqrt.f64 x)) < 0.900000000000000022Initial program 85.1%
flip--85.3%
add-sqr-sqrt63.4%
+-commutative63.4%
add-sqr-sqrt86.2%
+-commutative86.2%
Applied egg-rr86.2%
associate--l+91.0%
+-inverses91.0%
metadata-eval91.0%
Simplified91.0%
flip--91.1%
add-sqr-sqrt43.9%
add-sqr-sqrt91.1%
Applied egg-rr91.1%
Taylor expanded in y around inf 53.5%
if 0.900000000000000022 < (-.f64 (sqrt.f64 (+.f64 x #s(literal 1 binary64))) (sqrt.f64 x)) Initial program 97.8%
flip--97.8%
add-sqr-sqrt74.2%
+-commutative74.2%
add-sqr-sqrt98.1%
+-commutative98.1%
Applied egg-rr98.1%
associate--l+98.1%
+-inverses98.1%
metadata-eval98.1%
Simplified98.1%
Taylor expanded in x around 0 97.7%
Final simplification77.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 y)) (sqrt y)))
(t_2 (- (sqrt (+ 1.0 z)) (sqrt z)))
(t_3 (- (sqrt (+ 1.0 t)) (sqrt t))))
(if (<= t_1 1e-7)
(+
(+
(+ (* 0.5 (sqrt (/ 1.0 y))) (/ 1.0 (+ (sqrt x) (sqrt (+ x 1.0)))))
t_2)
t_3)
(+ t_3 (+ t_2 (+ t_1 (+ 1.0 (- (* x 0.5) (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)) - sqrt(y);
double t_2 = sqrt((1.0 + z)) - sqrt(z);
double t_3 = sqrt((1.0 + t)) - sqrt(t);
double tmp;
if (t_1 <= 1e-7) {
tmp = (((0.5 * sqrt((1.0 / y))) + (1.0 / (sqrt(x) + sqrt((x + 1.0))))) + t_2) + t_3;
} else {
tmp = t_3 + (t_2 + (t_1 + (1.0 + ((x * 0.5) - 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) :: t_3
real(8) :: tmp
t_1 = sqrt((1.0d0 + y)) - sqrt(y)
t_2 = sqrt((1.0d0 + z)) - sqrt(z)
t_3 = sqrt((1.0d0 + t)) - sqrt(t)
if (t_1 <= 1d-7) then
tmp = (((0.5d0 * sqrt((1.0d0 / y))) + (1.0d0 / (sqrt(x) + sqrt((x + 1.0d0))))) + t_2) + t_3
else
tmp = t_3 + (t_2 + (t_1 + (1.0d0 + ((x * 0.5d0) - 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)) - Math.sqrt(y);
double t_2 = Math.sqrt((1.0 + z)) - Math.sqrt(z);
double t_3 = Math.sqrt((1.0 + t)) - Math.sqrt(t);
double tmp;
if (t_1 <= 1e-7) {
tmp = (((0.5 * Math.sqrt((1.0 / y))) + (1.0 / (Math.sqrt(x) + Math.sqrt((x + 1.0))))) + t_2) + t_3;
} else {
tmp = t_3 + (t_2 + (t_1 + (1.0 + ((x * 0.5) - 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)) - math.sqrt(y) t_2 = math.sqrt((1.0 + z)) - math.sqrt(z) t_3 = math.sqrt((1.0 + t)) - math.sqrt(t) tmp = 0 if t_1 <= 1e-7: tmp = (((0.5 * math.sqrt((1.0 / y))) + (1.0 / (math.sqrt(x) + math.sqrt((x + 1.0))))) + t_2) + t_3 else: tmp = t_3 + (t_2 + (t_1 + (1.0 + ((x * 0.5) - math.sqrt(x))))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = Float64(sqrt(Float64(1.0 + y)) - sqrt(y)) t_2 = Float64(sqrt(Float64(1.0 + z)) - sqrt(z)) t_3 = Float64(sqrt(Float64(1.0 + t)) - sqrt(t)) tmp = 0.0 if (t_1 <= 1e-7) tmp = Float64(Float64(Float64(Float64(0.5 * sqrt(Float64(1.0 / y))) + Float64(1.0 / Float64(sqrt(x) + sqrt(Float64(x + 1.0))))) + t_2) + t_3); else tmp = Float64(t_3 + Float64(t_2 + Float64(t_1 + Float64(1.0 + Float64(Float64(x * 0.5) - 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)) - sqrt(y);
t_2 = sqrt((1.0 + z)) - sqrt(z);
t_3 = sqrt((1.0 + t)) - sqrt(t);
tmp = 0.0;
if (t_1 <= 1e-7)
tmp = (((0.5 * sqrt((1.0 / y))) + (1.0 / (sqrt(x) + sqrt((x + 1.0))))) + t_2) + t_3;
else
tmp = t_3 + (t_2 + (t_1 + (1.0 + ((x * 0.5) - 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[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, 1e-7], N[(N[(N[(N[(0.5 * N[Sqrt[N[(1.0 / y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$2), $MachinePrecision] + t$95$3), $MachinePrecision], N[(t$95$3 + N[(t$95$2 + N[(t$95$1 + N[(1.0 + N[(N[(x * 0.5), $MachinePrecision] - N[Sqrt[x], $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} - \sqrt{y}\\
t_2 := \sqrt{1 + z} - \sqrt{z}\\
t_3 := \sqrt{1 + t} - \sqrt{t}\\
\mathbf{if}\;t\_1 \leq 10^{-7}:\\
\;\;\;\;\left(\left(0.5 \cdot \sqrt{\frac{1}{y}} + \frac{1}{\sqrt{x} + \sqrt{x + 1}}\right) + t\_2\right) + t\_3\\
\mathbf{else}:\\
\;\;\;\;t\_3 + \left(t\_2 + \left(t\_1 + \left(1 + \left(x \cdot 0.5 - \sqrt{x}\right)\right)\right)\right)\\
\end{array}
\end{array}
if (-.f64 (sqrt.f64 (+.f64 y #s(literal 1 binary64))) (sqrt.f64 y)) < 9.9999999999999995e-8Initial program 87.8%
flip--88.0%
add-sqr-sqrt44.6%
+-commutative44.6%
add-sqr-sqrt88.3%
+-commutative88.3%
Applied egg-rr88.3%
associate--l+92.5%
+-inverses92.5%
metadata-eval92.5%
Simplified92.5%
flip--92.6%
add-sqr-sqrt72.1%
add-sqr-sqrt92.6%
Applied egg-rr92.6%
Taylor expanded in y around inf 94.1%
if 9.9999999999999995e-8 < (-.f64 (sqrt.f64 (+.f64 y #s(literal 1 binary64))) (sqrt.f64 y)) Initial program 96.7%
Taylor expanded in x around 0 57.0%
associate--l+57.0%
Simplified57.0%
Final simplification76.6%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(if (<= (- (sqrt (+ x 1.0)) (sqrt x)) 0.001)
(+
(* -0.125 (sqrt (/ 1.0 (pow x 3.0))))
(+
(* 0.5 (sqrt (/ 1.0 x)))
(* 0.5 (+ (sqrt (/ 1.0 t)) (+ (sqrt (/ 1.0 y)) (sqrt (/ 1.0 z)))))))
(+
(- (sqrt (+ 1.0 t)) (sqrt t))
(+
(/ 1.0 (+ (sqrt z) (sqrt (+ 1.0 z))))
(+
(- (+ 1.0 (* x 0.5)) (sqrt x))
(/ 1.0 (+ (sqrt y) (+ 1.0 (* 0.5 y)))))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if ((sqrt((x + 1.0)) - sqrt(x)) <= 0.001) {
tmp = (-0.125 * sqrt((1.0 / pow(x, 3.0)))) + ((0.5 * sqrt((1.0 / x))) + (0.5 * (sqrt((1.0 / t)) + (sqrt((1.0 / y)) + sqrt((1.0 / z))))));
} else {
tmp = (sqrt((1.0 + t)) - sqrt(t)) + ((1.0 / (sqrt(z) + sqrt((1.0 + z)))) + (((1.0 + (x * 0.5)) - sqrt(x)) + (1.0 / (sqrt(y) + (1.0 + (0.5 * 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 ((sqrt((x + 1.0d0)) - sqrt(x)) <= 0.001d0) then
tmp = ((-0.125d0) * sqrt((1.0d0 / (x ** 3.0d0)))) + ((0.5d0 * sqrt((1.0d0 / x))) + (0.5d0 * (sqrt((1.0d0 / t)) + (sqrt((1.0d0 / y)) + sqrt((1.0d0 / z))))))
else
tmp = (sqrt((1.0d0 + t)) - sqrt(t)) + ((1.0d0 / (sqrt(z) + sqrt((1.0d0 + z)))) + (((1.0d0 + (x * 0.5d0)) - sqrt(x)) + (1.0d0 / (sqrt(y) + (1.0d0 + (0.5d0 * 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 ((Math.sqrt((x + 1.0)) - Math.sqrt(x)) <= 0.001) {
tmp = (-0.125 * Math.sqrt((1.0 / Math.pow(x, 3.0)))) + ((0.5 * Math.sqrt((1.0 / x))) + (0.5 * (Math.sqrt((1.0 / t)) + (Math.sqrt((1.0 / y)) + Math.sqrt((1.0 / z))))));
} else {
tmp = (Math.sqrt((1.0 + t)) - Math.sqrt(t)) + ((1.0 / (Math.sqrt(z) + Math.sqrt((1.0 + z)))) + (((1.0 + (x * 0.5)) - Math.sqrt(x)) + (1.0 / (Math.sqrt(y) + (1.0 + (0.5 * y))))));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if (math.sqrt((x + 1.0)) - math.sqrt(x)) <= 0.001: tmp = (-0.125 * math.sqrt((1.0 / math.pow(x, 3.0)))) + ((0.5 * math.sqrt((1.0 / x))) + (0.5 * (math.sqrt((1.0 / t)) + (math.sqrt((1.0 / y)) + math.sqrt((1.0 / z)))))) else: tmp = (math.sqrt((1.0 + t)) - math.sqrt(t)) + ((1.0 / (math.sqrt(z) + math.sqrt((1.0 + z)))) + (((1.0 + (x * 0.5)) - math.sqrt(x)) + (1.0 / (math.sqrt(y) + (1.0 + (0.5 * y)))))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (Float64(sqrt(Float64(x + 1.0)) - sqrt(x)) <= 0.001) tmp = Float64(Float64(-0.125 * sqrt(Float64(1.0 / (x ^ 3.0)))) + Float64(Float64(0.5 * sqrt(Float64(1.0 / x))) + Float64(0.5 * Float64(sqrt(Float64(1.0 / t)) + Float64(sqrt(Float64(1.0 / y)) + sqrt(Float64(1.0 / z))))))); else tmp = Float64(Float64(sqrt(Float64(1.0 + t)) - sqrt(t)) + Float64(Float64(1.0 / Float64(sqrt(z) + sqrt(Float64(1.0 + z)))) + Float64(Float64(Float64(1.0 + Float64(x * 0.5)) - sqrt(x)) + Float64(1.0 / Float64(sqrt(y) + Float64(1.0 + Float64(0.5 * 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 ((sqrt((x + 1.0)) - sqrt(x)) <= 0.001)
tmp = (-0.125 * sqrt((1.0 / (x ^ 3.0)))) + ((0.5 * sqrt((1.0 / x))) + (0.5 * (sqrt((1.0 / t)) + (sqrt((1.0 / y)) + sqrt((1.0 / z))))));
else
tmp = (sqrt((1.0 + t)) - sqrt(t)) + ((1.0 / (sqrt(z) + sqrt((1.0 + z)))) + (((1.0 + (x * 0.5)) - sqrt(x)) + (1.0 / (sqrt(y) + (1.0 + (0.5 * 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[N[(N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision], 0.001], N[(N[(-0.125 * N[Sqrt[N[(1.0 / N[Power[x, 3.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(N[(0.5 * N[Sqrt[N[(1.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(0.5 * N[(N[Sqrt[N[(1.0 / t), $MachinePrecision]], $MachinePrecision] + N[(N[Sqrt[N[(1.0 / y), $MachinePrecision]], $MachinePrecision] + N[Sqrt[N[(1.0 / z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 / N[(N[Sqrt[z], $MachinePrecision] + N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(1.0 + N[(x * 0.5), $MachinePrecision]), $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[y], $MachinePrecision] + N[(1.0 + N[(0.5 * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;\sqrt{x + 1} - \sqrt{x} \leq 0.001:\\
\;\;\;\;-0.125 \cdot \sqrt{\frac{1}{{x}^{3}}} + \left(0.5 \cdot \sqrt{\frac{1}{x}} + 0.5 \cdot \left(\sqrt{\frac{1}{t}} + \left(\sqrt{\frac{1}{y}} + \sqrt{\frac{1}{z}}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\sqrt{1 + t} - \sqrt{t}\right) + \left(\frac{1}{\sqrt{z} + \sqrt{1 + z}} + \left(\left(\left(1 + x \cdot 0.5\right) - \sqrt{x}\right) + \frac{1}{\sqrt{y} + \left(1 + 0.5 \cdot y\right)}\right)\right)\\
\end{array}
\end{array}
if (-.f64 (sqrt.f64 (+.f64 x #s(literal 1 binary64))) (sqrt.f64 x)) < 1e-3Initial program 85.3%
Taylor expanded in t around inf 3.8%
associate--l+5.1%
Simplified5.1%
Taylor expanded in z around inf 5.4%
associate--l+5.4%
distribute-lft-out5.4%
+-commutative5.4%
Simplified5.4%
Taylor expanded in y around inf 4.6%
distribute-lft-out4.6%
+-commutative4.6%
Simplified4.6%
Taylor expanded in x around inf 19.0%
if 1e-3 < (-.f64 (sqrt.f64 (+.f64 x #s(literal 1 binary64))) (sqrt.f64 x)) Initial program 97.5%
flip--97.5%
add-sqr-sqrt74.1%
+-commutative74.1%
add-sqr-sqrt98.1%
+-commutative98.1%
Applied egg-rr98.1%
associate--l+98.1%
+-inverses98.1%
metadata-eval98.1%
Simplified98.1%
Taylor expanded in x around 0 97.3%
flip--97.3%
add-sqr-sqrt77.5%
+-commutative77.5%
add-sqr-sqrt97.9%
+-commutative97.9%
Applied egg-rr97.9%
associate--l+98.3%
+-inverses98.3%
metadata-eval98.3%
Simplified98.3%
Taylor expanded in y around 0 96.8%
Final simplification61.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 z))))
(if (<= (- t_1 (sqrt z)) 2e-6)
(+
(- (sqrt (+ x 1.0)) (sqrt x))
(+
(- (sqrt (+ 1.0 y)) (sqrt y))
(* 0.5 (+ (sqrt (/ 1.0 t)) (sqrt (/ 1.0 z))))))
(+
(- (sqrt (+ 1.0 t)) (sqrt t))
(+
2.0
(- (+ t_1 (* 0.5 (+ x y))) (+ (sqrt z) (+ (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 + z));
double tmp;
if ((t_1 - sqrt(z)) <= 2e-6) {
tmp = (sqrt((x + 1.0)) - sqrt(x)) + ((sqrt((1.0 + y)) - sqrt(y)) + (0.5 * (sqrt((1.0 / t)) + sqrt((1.0 / z)))));
} else {
tmp = (sqrt((1.0 + t)) - sqrt(t)) + (2.0 + ((t_1 + (0.5 * (x + y))) - (sqrt(z) + (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 + z))
if ((t_1 - sqrt(z)) <= 2d-6) then
tmp = (sqrt((x + 1.0d0)) - sqrt(x)) + ((sqrt((1.0d0 + y)) - sqrt(y)) + (0.5d0 * (sqrt((1.0d0 / t)) + sqrt((1.0d0 / z)))))
else
tmp = (sqrt((1.0d0 + t)) - sqrt(t)) + (2.0d0 + ((t_1 + (0.5d0 * (x + y))) - (sqrt(z) + (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 + z));
double tmp;
if ((t_1 - Math.sqrt(z)) <= 2e-6) {
tmp = (Math.sqrt((x + 1.0)) - Math.sqrt(x)) + ((Math.sqrt((1.0 + y)) - Math.sqrt(y)) + (0.5 * (Math.sqrt((1.0 / t)) + Math.sqrt((1.0 / z)))));
} else {
tmp = (Math.sqrt((1.0 + t)) - Math.sqrt(t)) + (2.0 + ((t_1 + (0.5 * (x + y))) - (Math.sqrt(z) + (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 + z)) tmp = 0 if (t_1 - math.sqrt(z)) <= 2e-6: tmp = (math.sqrt((x + 1.0)) - math.sqrt(x)) + ((math.sqrt((1.0 + y)) - math.sqrt(y)) + (0.5 * (math.sqrt((1.0 / t)) + math.sqrt((1.0 / z))))) else: tmp = (math.sqrt((1.0 + t)) - math.sqrt(t)) + (2.0 + ((t_1 + (0.5 * (x + y))) - (math.sqrt(z) + (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 + z)) tmp = 0.0 if (Float64(t_1 - sqrt(z)) <= 2e-6) tmp = Float64(Float64(sqrt(Float64(x + 1.0)) - sqrt(x)) + Float64(Float64(sqrt(Float64(1.0 + y)) - sqrt(y)) + Float64(0.5 * Float64(sqrt(Float64(1.0 / t)) + sqrt(Float64(1.0 / z)))))); else tmp = Float64(Float64(sqrt(Float64(1.0 + t)) - sqrt(t)) + Float64(2.0 + Float64(Float64(t_1 + Float64(0.5 * Float64(x + y))) - Float64(sqrt(z) + Float64(sqrt(x) + sqrt(y)))))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + z));
tmp = 0.0;
if ((t_1 - sqrt(z)) <= 2e-6)
tmp = (sqrt((x + 1.0)) - sqrt(x)) + ((sqrt((1.0 + y)) - sqrt(y)) + (0.5 * (sqrt((1.0 / t)) + sqrt((1.0 / z)))));
else
tmp = (sqrt((1.0 + t)) - sqrt(t)) + (2.0 + ((t_1 + (0.5 * (x + y))) - (sqrt(z) + (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 + z), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(t$95$1 - N[Sqrt[z], $MachinePrecision]), $MachinePrecision], 2e-6], N[(N[(N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision] + N[(0.5 * N[(N[Sqrt[N[(1.0 / t), $MachinePrecision]], $MachinePrecision] + N[Sqrt[N[(1.0 / z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision] + N[(2.0 + N[(N[(t$95$1 + N[(0.5 * N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[z], $MachinePrecision] + N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + z}\\
\mathbf{if}\;t\_1 - \sqrt{z} \leq 2 \cdot 10^{-6}:\\
\;\;\;\;\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\left(\sqrt{1 + y} - \sqrt{y}\right) + 0.5 \cdot \left(\sqrt{\frac{1}{t}} + \sqrt{\frac{1}{z}}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\sqrt{1 + t} - \sqrt{t}\right) + \left(2 + \left(\left(t\_1 + 0.5 \cdot \left(x + y\right)\right) - \left(\sqrt{z} + \left(\sqrt{x} + \sqrt{y}\right)\right)\right)\right)\\
\end{array}
\end{array}
if (-.f64 (sqrt.f64 (+.f64 z #s(literal 1 binary64))) (sqrt.f64 z)) < 1.99999999999999991e-6Initial program 84.9%
associate-+l+84.9%
associate-+l+84.9%
+-commutative84.9%
+-commutative84.9%
associate-+l-84.9%
+-commutative84.9%
+-commutative84.9%
Simplified84.9%
Taylor expanded in t around inf 41.8%
Taylor expanded in z around inf 48.2%
distribute-lft-out48.2%
Simplified48.2%
if 1.99999999999999991e-6 < (-.f64 (sqrt.f64 (+.f64 z #s(literal 1 binary64))) (sqrt.f64 z)) Initial program 98.3%
Taylor expanded in x around 0 32.5%
associate--l+38.9%
Simplified38.9%
Taylor expanded in y around 0 28.9%
associate--l+28.9%
distribute-lft-out28.9%
associate-+r+28.9%
+-commutative28.9%
Simplified28.9%
Final simplification37.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 z))) (t_2 (- (sqrt (+ 1.0 t)) (sqrt t))))
(if (<= y 2.4)
(+
t_2
(+
(/ 1.0 (+ (sqrt z) t_1))
(+
(- (+ 1.0 (* x 0.5)) (sqrt x))
(/ 1.0 (+ (sqrt y) (+ 1.0 (* 0.5 y)))))))
(+
(+
(+ (* 0.5 (sqrt (/ 1.0 y))) (/ 1.0 (+ (sqrt x) (sqrt (+ x 1.0)))))
(- t_1 (sqrt z)))
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 + z));
double t_2 = sqrt((1.0 + t)) - sqrt(t);
double tmp;
if (y <= 2.4) {
tmp = t_2 + ((1.0 / (sqrt(z) + t_1)) + (((1.0 + (x * 0.5)) - sqrt(x)) + (1.0 / (sqrt(y) + (1.0 + (0.5 * y))))));
} else {
tmp = (((0.5 * sqrt((1.0 / y))) + (1.0 / (sqrt(x) + sqrt((x + 1.0))))) + (t_1 - sqrt(z))) + 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 + z))
t_2 = sqrt((1.0d0 + t)) - sqrt(t)
if (y <= 2.4d0) then
tmp = t_2 + ((1.0d0 / (sqrt(z) + t_1)) + (((1.0d0 + (x * 0.5d0)) - sqrt(x)) + (1.0d0 / (sqrt(y) + (1.0d0 + (0.5d0 * y))))))
else
tmp = (((0.5d0 * sqrt((1.0d0 / y))) + (1.0d0 / (sqrt(x) + sqrt((x + 1.0d0))))) + (t_1 - sqrt(z))) + 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 + z));
double t_2 = Math.sqrt((1.0 + t)) - Math.sqrt(t);
double tmp;
if (y <= 2.4) {
tmp = t_2 + ((1.0 / (Math.sqrt(z) + t_1)) + (((1.0 + (x * 0.5)) - Math.sqrt(x)) + (1.0 / (Math.sqrt(y) + (1.0 + (0.5 * y))))));
} else {
tmp = (((0.5 * Math.sqrt((1.0 / y))) + (1.0 / (Math.sqrt(x) + Math.sqrt((x + 1.0))))) + (t_1 - Math.sqrt(z))) + 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 + z)) t_2 = math.sqrt((1.0 + t)) - math.sqrt(t) tmp = 0 if y <= 2.4: tmp = t_2 + ((1.0 / (math.sqrt(z) + t_1)) + (((1.0 + (x * 0.5)) - math.sqrt(x)) + (1.0 / (math.sqrt(y) + (1.0 + (0.5 * y)))))) else: tmp = (((0.5 * math.sqrt((1.0 / y))) + (1.0 / (math.sqrt(x) + math.sqrt((x + 1.0))))) + (t_1 - math.sqrt(z))) + t_2 return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(1.0 + z)) t_2 = Float64(sqrt(Float64(1.0 + t)) - sqrt(t)) tmp = 0.0 if (y <= 2.4) tmp = Float64(t_2 + Float64(Float64(1.0 / Float64(sqrt(z) + t_1)) + Float64(Float64(Float64(1.0 + Float64(x * 0.5)) - sqrt(x)) + Float64(1.0 / Float64(sqrt(y) + Float64(1.0 + Float64(0.5 * y))))))); else tmp = Float64(Float64(Float64(Float64(0.5 * sqrt(Float64(1.0 / y))) + Float64(1.0 / Float64(sqrt(x) + sqrt(Float64(x + 1.0))))) + Float64(t_1 - sqrt(z))) + 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 + z));
t_2 = sqrt((1.0 + t)) - sqrt(t);
tmp = 0.0;
if (y <= 2.4)
tmp = t_2 + ((1.0 / (sqrt(z) + t_1)) + (((1.0 + (x * 0.5)) - sqrt(x)) + (1.0 / (sqrt(y) + (1.0 + (0.5 * y))))));
else
tmp = (((0.5 * sqrt((1.0 / y))) + (1.0 / (sqrt(x) + sqrt((x + 1.0))))) + (t_1 - sqrt(z))) + t_2;
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 2.4], N[(t$95$2 + N[(N[(1.0 / N[(N[Sqrt[z], $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(1.0 + N[(x * 0.5), $MachinePrecision]), $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[y], $MachinePrecision] + N[(1.0 + N[(0.5 * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(0.5 * N[Sqrt[N[(1.0 / y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$1 - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$2), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + z}\\
t_2 := \sqrt{1 + t} - \sqrt{t}\\
\mathbf{if}\;y \leq 2.4:\\
\;\;\;\;t\_2 + \left(\frac{1}{\sqrt{z} + t\_1} + \left(\left(\left(1 + x \cdot 0.5\right) - \sqrt{x}\right) + \frac{1}{\sqrt{y} + \left(1 + 0.5 \cdot y\right)}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(0.5 \cdot \sqrt{\frac{1}{y}} + \frac{1}{\sqrt{x} + \sqrt{x + 1}}\right) + \left(t\_1 - \sqrt{z}\right)\right) + t\_2\\
\end{array}
\end{array}
if y < 2.39999999999999991Initial program 97.6%
flip--97.6%
add-sqr-sqrt97.6%
+-commutative97.6%
add-sqr-sqrt97.7%
+-commutative97.7%
Applied egg-rr97.7%
associate--l+97.6%
+-inverses97.6%
metadata-eval97.6%
Simplified97.6%
Taylor expanded in x around 0 57.9%
flip--57.9%
add-sqr-sqrt42.9%
+-commutative42.9%
add-sqr-sqrt58.6%
+-commutative58.6%
Applied egg-rr58.6%
associate--l+58.6%
+-inverses58.6%
metadata-eval58.6%
Simplified58.6%
Taylor expanded in y around 0 57.9%
if 2.39999999999999991 < y Initial program 87.3%
flip--87.5%
add-sqr-sqrt45.8%
+-commutative45.8%
add-sqr-sqrt88.5%
+-commutative88.5%
Applied egg-rr88.5%
associate--l+92.5%
+-inverses92.5%
metadata-eval92.5%
Simplified92.5%
flip--92.6%
add-sqr-sqrt71.5%
add-sqr-sqrt92.6%
Applied egg-rr92.6%
Taylor expanded in y around inf 93.2%
Final simplification77.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 (<= z 0.58)
(+
(- (sqrt (+ 1.0 t)) (sqrt t))
(- (+ 3.0 (* 0.5 (+ z (+ x y)))) (+ (sqrt x) (+ (sqrt z) (sqrt y)))))
(+
(- (sqrt (+ x 1.0)) (sqrt x))
(+
(- (sqrt (+ 1.0 y)) (sqrt y))
(* 0.5 (+ (sqrt (/ 1.0 t)) (sqrt (/ 1.0 z))))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (z <= 0.58) {
tmp = (sqrt((1.0 + t)) - sqrt(t)) + ((3.0 + (0.5 * (z + (x + y)))) - (sqrt(x) + (sqrt(z) + sqrt(y))));
} else {
tmp = (sqrt((x + 1.0)) - sqrt(x)) + ((sqrt((1.0 + y)) - sqrt(y)) + (0.5 * (sqrt((1.0 / t)) + sqrt((1.0 / 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 (z <= 0.58d0) then
tmp = (sqrt((1.0d0 + t)) - sqrt(t)) + ((3.0d0 + (0.5d0 * (z + (x + y)))) - (sqrt(x) + (sqrt(z) + sqrt(y))))
else
tmp = (sqrt((x + 1.0d0)) - sqrt(x)) + ((sqrt((1.0d0 + y)) - sqrt(y)) + (0.5d0 * (sqrt((1.0d0 / t)) + sqrt((1.0d0 / 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 (z <= 0.58) {
tmp = (Math.sqrt((1.0 + t)) - Math.sqrt(t)) + ((3.0 + (0.5 * (z + (x + y)))) - (Math.sqrt(x) + (Math.sqrt(z) + Math.sqrt(y))));
} else {
tmp = (Math.sqrt((x + 1.0)) - Math.sqrt(x)) + ((Math.sqrt((1.0 + y)) - Math.sqrt(y)) + (0.5 * (Math.sqrt((1.0 / t)) + Math.sqrt((1.0 / z)))));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if z <= 0.58: tmp = (math.sqrt((1.0 + t)) - math.sqrt(t)) + ((3.0 + (0.5 * (z + (x + y)))) - (math.sqrt(x) + (math.sqrt(z) + math.sqrt(y)))) else: tmp = (math.sqrt((x + 1.0)) - math.sqrt(x)) + ((math.sqrt((1.0 + y)) - math.sqrt(y)) + (0.5 * (math.sqrt((1.0 / t)) + math.sqrt((1.0 / z))))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (z <= 0.58) tmp = Float64(Float64(sqrt(Float64(1.0 + t)) - sqrt(t)) + Float64(Float64(3.0 + Float64(0.5 * Float64(z + Float64(x + y)))) - Float64(sqrt(x) + Float64(sqrt(z) + sqrt(y))))); else tmp = Float64(Float64(sqrt(Float64(x + 1.0)) - sqrt(x)) + Float64(Float64(sqrt(Float64(1.0 + y)) - sqrt(y)) + Float64(0.5 * Float64(sqrt(Float64(1.0 / t)) + sqrt(Float64(1.0 / 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 (z <= 0.58)
tmp = (sqrt((1.0 + t)) - sqrt(t)) + ((3.0 + (0.5 * (z + (x + y)))) - (sqrt(x) + (sqrt(z) + sqrt(y))));
else
tmp = (sqrt((x + 1.0)) - sqrt(x)) + ((sqrt((1.0 + y)) - sqrt(y)) + (0.5 * (sqrt((1.0 / t)) + sqrt((1.0 / 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[z, 0.58], N[(N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision] + N[(N[(3.0 + N[(0.5 * N[(z + N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[x], $MachinePrecision] + N[(N[Sqrt[z], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision] + N[(0.5 * N[(N[Sqrt[N[(1.0 / t), $MachinePrecision]], $MachinePrecision] + N[Sqrt[N[(1.0 / z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq 0.58:\\
\;\;\;\;\left(\sqrt{1 + t} - \sqrt{t}\right) + \left(\left(3 + 0.5 \cdot \left(z + \left(x + y\right)\right)\right) - \left(\sqrt{x} + \left(\sqrt{z} + \sqrt{y}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\left(\sqrt{1 + y} - \sqrt{y}\right) + 0.5 \cdot \left(\sqrt{\frac{1}{t}} + \sqrt{\frac{1}{z}}\right)\right)\\
\end{array}
\end{array}
if z < 0.57999999999999996Initial program 98.3%
Taylor expanded in x around 0 32.2%
associate--l+38.7%
Simplified38.7%
Taylor expanded in y around 0 28.6%
associate--l+28.6%
metadata-eval28.6%
rem-square-sqrt28.6%
hypot-undefine28.6%
distribute-lft-out28.6%
associate-+r+28.6%
+-commutative28.6%
Simplified28.6%
Taylor expanded in z around 0 28.6%
distribute-lft-out28.6%
Simplified28.6%
if 0.57999999999999996 < z Initial program 85.1%
associate-+l+85.1%
associate-+l+85.1%
+-commutative85.1%
+-commutative85.1%
associate-+l-85.1%
+-commutative85.1%
+-commutative85.1%
Simplified85.1%
Taylor expanded in t around inf 41.2%
Taylor expanded in z around inf 47.5%
distribute-lft-out47.5%
Simplified47.5%
Final simplification37.6%
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.39)
(+
(- (sqrt (+ 1.0 t)) (sqrt t))
(- (+ 3.0 (* 0.5 (+ z (+ x y)))) (+ (sqrt x) (+ (sqrt z) (sqrt y)))))
(+
(sqrt (+ x 1.0))
(+
(sqrt (+ 1.0 y))
(- (* 0.5 (+ (pow t -0.5) (pow z -0.5))) (+ (sqrt x) (sqrt y)))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (z <= 0.39) {
tmp = (sqrt((1.0 + t)) - sqrt(t)) + ((3.0 + (0.5 * (z + (x + y)))) - (sqrt(x) + (sqrt(z) + sqrt(y))));
} else {
tmp = sqrt((x + 1.0)) + (sqrt((1.0 + y)) + ((0.5 * (pow(t, -0.5) + pow(z, -0.5))) - (sqrt(x) + sqrt(y))));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (z <= 0.39d0) then
tmp = (sqrt((1.0d0 + t)) - sqrt(t)) + ((3.0d0 + (0.5d0 * (z + (x + y)))) - (sqrt(x) + (sqrt(z) + sqrt(y))))
else
tmp = sqrt((x + 1.0d0)) + (sqrt((1.0d0 + y)) + ((0.5d0 * ((t ** (-0.5d0)) + (z ** (-0.5d0)))) - (sqrt(x) + sqrt(y))))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= 0.39) {
tmp = (Math.sqrt((1.0 + t)) - Math.sqrt(t)) + ((3.0 + (0.5 * (z + (x + y)))) - (Math.sqrt(x) + (Math.sqrt(z) + Math.sqrt(y))));
} else {
tmp = Math.sqrt((x + 1.0)) + (Math.sqrt((1.0 + y)) + ((0.5 * (Math.pow(t, -0.5) + Math.pow(z, -0.5))) - (Math.sqrt(x) + Math.sqrt(y))));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if z <= 0.39: tmp = (math.sqrt((1.0 + t)) - math.sqrt(t)) + ((3.0 + (0.5 * (z + (x + y)))) - (math.sqrt(x) + (math.sqrt(z) + math.sqrt(y)))) else: tmp = math.sqrt((x + 1.0)) + (math.sqrt((1.0 + y)) + ((0.5 * (math.pow(t, -0.5) + math.pow(z, -0.5))) - (math.sqrt(x) + math.sqrt(y)))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (z <= 0.39) tmp = Float64(Float64(sqrt(Float64(1.0 + t)) - sqrt(t)) + Float64(Float64(3.0 + Float64(0.5 * Float64(z + Float64(x + y)))) - Float64(sqrt(x) + Float64(sqrt(z) + sqrt(y))))); else tmp = Float64(sqrt(Float64(x + 1.0)) + Float64(sqrt(Float64(1.0 + y)) + Float64(Float64(0.5 * Float64((t ^ -0.5) + (z ^ -0.5))) - Float64(sqrt(x) + sqrt(y))))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (z <= 0.39)
tmp = (sqrt((1.0 + t)) - sqrt(t)) + ((3.0 + (0.5 * (z + (x + y)))) - (sqrt(x) + (sqrt(z) + sqrt(y))));
else
tmp = sqrt((x + 1.0)) + (sqrt((1.0 + y)) + ((0.5 * ((t ^ -0.5) + (z ^ -0.5))) - (sqrt(x) + sqrt(y))));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[z, 0.39], N[(N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision] + N[(N[(3.0 + N[(0.5 * N[(z + N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[x], $MachinePrecision] + N[(N[Sqrt[z], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision] + N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] + N[(N[(0.5 * N[(N[Power[t, -0.5], $MachinePrecision] + N[Power[z, -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq 0.39:\\
\;\;\;\;\left(\sqrt{1 + t} - \sqrt{t}\right) + \left(\left(3 + 0.5 \cdot \left(z + \left(x + y\right)\right)\right) - \left(\sqrt{x} + \left(\sqrt{z} + \sqrt{y}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\sqrt{x + 1} + \left(\sqrt{1 + y} + \left(0.5 \cdot \left({t}^{-0.5} + {z}^{-0.5}\right) - \left(\sqrt{x} + \sqrt{y}\right)\right)\right)\\
\end{array}
\end{array}
if z < 0.39000000000000001Initial program 98.3%
Taylor expanded in x around 0 32.2%
associate--l+38.7%
Simplified38.7%
Taylor expanded in y around 0 28.6%
associate--l+28.6%
metadata-eval28.6%
rem-square-sqrt28.6%
hypot-undefine28.6%
distribute-lft-out28.6%
associate-+r+28.6%
+-commutative28.6%
Simplified28.6%
Taylor expanded in z around 0 28.6%
distribute-lft-out28.6%
Simplified28.6%
if 0.39000000000000001 < z Initial program 85.1%
Taylor expanded in t around inf 4.2%
associate--l+15.9%
Simplified15.9%
Taylor expanded in z around inf 21.1%
associate--l+28.7%
distribute-lft-in28.7%
+-commutative28.7%
associate-+r-28.7%
associate-+r+21.1%
Applied egg-rr21.1%
associate-+l+28.7%
+-commutative28.7%
Simplified28.7%
Final simplification28.6%
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 1.28e-244)
(-
(+ 4.0 (+ (* 0.5 t) (+ (* 0.5 (+ x y)) (* 0.5 z))))
(+ (sqrt t) (+ (sqrt x) (+ (sqrt z) (sqrt y)))))
(if (<= y 1.3)
(+
(+ 1.0 (* x 0.5))
(-
(+
1.0
(+
(* 0.5 (+ (sqrt (/ 1.0 t)) (sqrt (/ 1.0 z))))
(* y (+ 0.5 (* y (- (* y (+ 0.0625 (* y -0.0390625))) 0.125))))))
(+ (sqrt x) (sqrt y))))
(-
(+
(sqrt (+ x 1.0))
(* 0.5 (+ (pow y -0.5) (+ (pow t -0.5) (pow z -0.5)))))
(sqrt x)))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 1.28e-244) {
tmp = (4.0 + ((0.5 * t) + ((0.5 * (x + y)) + (0.5 * z)))) - (sqrt(t) + (sqrt(x) + (sqrt(z) + sqrt(y))));
} else if (y <= 1.3) {
tmp = (1.0 + (x * 0.5)) + ((1.0 + ((0.5 * (sqrt((1.0 / t)) + sqrt((1.0 / z)))) + (y * (0.5 + (y * ((y * (0.0625 + (y * -0.0390625))) - 0.125)))))) - (sqrt(x) + sqrt(y)));
} else {
tmp = (sqrt((x + 1.0)) + (0.5 * (pow(y, -0.5) + (pow(t, -0.5) + pow(z, -0.5))))) - 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 <= 1.28d-244) then
tmp = (4.0d0 + ((0.5d0 * t) + ((0.5d0 * (x + y)) + (0.5d0 * z)))) - (sqrt(t) + (sqrt(x) + (sqrt(z) + sqrt(y))))
else if (y <= 1.3d0) then
tmp = (1.0d0 + (x * 0.5d0)) + ((1.0d0 + ((0.5d0 * (sqrt((1.0d0 / t)) + sqrt((1.0d0 / z)))) + (y * (0.5d0 + (y * ((y * (0.0625d0 + (y * (-0.0390625d0)))) - 0.125d0)))))) - (sqrt(x) + sqrt(y)))
else
tmp = (sqrt((x + 1.0d0)) + (0.5d0 * ((y ** (-0.5d0)) + ((t ** (-0.5d0)) + (z ** (-0.5d0)))))) - 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 <= 1.28e-244) {
tmp = (4.0 + ((0.5 * t) + ((0.5 * (x + y)) + (0.5 * z)))) - (Math.sqrt(t) + (Math.sqrt(x) + (Math.sqrt(z) + Math.sqrt(y))));
} else if (y <= 1.3) {
tmp = (1.0 + (x * 0.5)) + ((1.0 + ((0.5 * (Math.sqrt((1.0 / t)) + Math.sqrt((1.0 / z)))) + (y * (0.5 + (y * ((y * (0.0625 + (y * -0.0390625))) - 0.125)))))) - (Math.sqrt(x) + Math.sqrt(y)));
} else {
tmp = (Math.sqrt((x + 1.0)) + (0.5 * (Math.pow(y, -0.5) + (Math.pow(t, -0.5) + Math.pow(z, -0.5))))) - Math.sqrt(x);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if y <= 1.28e-244: tmp = (4.0 + ((0.5 * t) + ((0.5 * (x + y)) + (0.5 * z)))) - (math.sqrt(t) + (math.sqrt(x) + (math.sqrt(z) + math.sqrt(y)))) elif y <= 1.3: tmp = (1.0 + (x * 0.5)) + ((1.0 + ((0.5 * (math.sqrt((1.0 / t)) + math.sqrt((1.0 / z)))) + (y * (0.5 + (y * ((y * (0.0625 + (y * -0.0390625))) - 0.125)))))) - (math.sqrt(x) + math.sqrt(y))) else: tmp = (math.sqrt((x + 1.0)) + (0.5 * (math.pow(y, -0.5) + (math.pow(t, -0.5) + math.pow(z, -0.5))))) - 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 <= 1.28e-244) tmp = Float64(Float64(4.0 + Float64(Float64(0.5 * t) + Float64(Float64(0.5 * Float64(x + y)) + Float64(0.5 * z)))) - Float64(sqrt(t) + Float64(sqrt(x) + Float64(sqrt(z) + sqrt(y))))); elseif (y <= 1.3) tmp = Float64(Float64(1.0 + Float64(x * 0.5)) + Float64(Float64(1.0 + Float64(Float64(0.5 * Float64(sqrt(Float64(1.0 / t)) + sqrt(Float64(1.0 / z)))) + Float64(y * Float64(0.5 + Float64(y * Float64(Float64(y * Float64(0.0625 + Float64(y * -0.0390625))) - 0.125)))))) - Float64(sqrt(x) + sqrt(y)))); else tmp = Float64(Float64(sqrt(Float64(x + 1.0)) + Float64(0.5 * Float64((y ^ -0.5) + Float64((t ^ -0.5) + (z ^ -0.5))))) - 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 <= 1.28e-244)
tmp = (4.0 + ((0.5 * t) + ((0.5 * (x + y)) + (0.5 * z)))) - (sqrt(t) + (sqrt(x) + (sqrt(z) + sqrt(y))));
elseif (y <= 1.3)
tmp = (1.0 + (x * 0.5)) + ((1.0 + ((0.5 * (sqrt((1.0 / t)) + sqrt((1.0 / z)))) + (y * (0.5 + (y * ((y * (0.0625 + (y * -0.0390625))) - 0.125)))))) - (sqrt(x) + sqrt(y)));
else
tmp = (sqrt((x + 1.0)) + (0.5 * ((y ^ -0.5) + ((t ^ -0.5) + (z ^ -0.5))))) - 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, 1.28e-244], N[(N[(4.0 + N[(N[(0.5 * t), $MachinePrecision] + N[(N[(0.5 * N[(x + y), $MachinePrecision]), $MachinePrecision] + N[(0.5 * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[t], $MachinePrecision] + N[(N[Sqrt[x], $MachinePrecision] + N[(N[Sqrt[z], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.3], N[(N[(1.0 + N[(x * 0.5), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 + N[(N[(0.5 * N[(N[Sqrt[N[(1.0 / t), $MachinePrecision]], $MachinePrecision] + N[Sqrt[N[(1.0 / z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(y * N[(0.5 + N[(y * N[(N[(y * N[(0.0625 + N[(y * -0.0390625), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 0.125), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision] + N[(0.5 * N[(N[Power[y, -0.5], $MachinePrecision] + N[(N[Power[t, -0.5], $MachinePrecision] + N[Power[z, -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 1.28 \cdot 10^{-244}:\\
\;\;\;\;\left(4 + \left(0.5 \cdot t + \left(0.5 \cdot \left(x + y\right) + 0.5 \cdot z\right)\right)\right) - \left(\sqrt{t} + \left(\sqrt{x} + \left(\sqrt{z} + \sqrt{y}\right)\right)\right)\\
\mathbf{elif}\;y \leq 1.3:\\
\;\;\;\;\left(1 + x \cdot 0.5\right) + \left(\left(1 + \left(0.5 \cdot \left(\sqrt{\frac{1}{t}} + \sqrt{\frac{1}{z}}\right) + y \cdot \left(0.5 + y \cdot \left(y \cdot \left(0.0625 + y \cdot -0.0390625\right) - 0.125\right)\right)\right)\right) - \left(\sqrt{x} + \sqrt{y}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\sqrt{x + 1} + 0.5 \cdot \left({y}^{-0.5} + \left({t}^{-0.5} + {z}^{-0.5}\right)\right)\right) - \sqrt{x}\\
\end{array}
\end{array}
if y < 1.27999999999999994e-244Initial program 96.1%
Taylor expanded in x around 0 32.5%
associate--l+37.1%
Simplified37.1%
Taylor expanded in y around 0 32.5%
associate--l+53.5%
metadata-eval53.5%
rem-square-sqrt53.5%
hypot-undefine53.5%
distribute-lft-out53.5%
associate-+r+53.5%
+-commutative53.5%
Simplified53.5%
Taylor expanded in t around 0 30.3%
Taylor expanded in z around 0 9.7%
if 1.27999999999999994e-244 < y < 1.30000000000000004Initial program 97.9%
Taylor expanded in t around inf 19.7%
associate--l+23.5%
Simplified23.5%
Taylor expanded in z around inf 21.6%
associate--l+21.6%
distribute-lft-out21.6%
+-commutative21.6%
Simplified21.6%
Taylor expanded in x around 0 21.8%
Taylor expanded in y around 0 21.8%
if 1.30000000000000004 < y Initial program 87.4%
Taylor expanded in t around inf 4.4%
associate--l+15.2%
Simplified15.2%
Taylor expanded in z around inf 14.1%
associate--l+14.1%
distribute-lft-out14.1%
+-commutative14.1%
Simplified14.1%
Taylor expanded in y around inf 13.5%
distribute-lft-out13.5%
+-commutative13.5%
Simplified13.5%
associate-+r-13.5%
pow1/213.5%
inv-pow13.5%
pow-pow13.5%
metadata-eval13.5%
pow1/213.5%
inv-pow13.5%
pow-pow13.5%
metadata-eval13.5%
pow1/213.5%
inv-pow13.5%
pow-pow13.5%
metadata-eval13.5%
Applied egg-rr13.5%
Final simplification16.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 (<= z 0.8)
(+
(- (sqrt (+ 1.0 t)) (sqrt t))
(- (+ 3.0 (* 0.5 (+ z (+ x y)))) (+ (sqrt x) (+ (sqrt z) (sqrt y)))))
(+
1.0
(-
(+ (sqrt (+ 1.0 y)) (* 0.5 (+ x (+ (sqrt (/ 1.0 t)) (sqrt (/ 1.0 z))))))
(+ (sqrt x) (sqrt y))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (z <= 0.8) {
tmp = (sqrt((1.0 + t)) - sqrt(t)) + ((3.0 + (0.5 * (z + (x + y)))) - (sqrt(x) + (sqrt(z) + sqrt(y))));
} else {
tmp = 1.0 + ((sqrt((1.0 + y)) + (0.5 * (x + (sqrt((1.0 / t)) + sqrt((1.0 / z)))))) - (sqrt(x) + sqrt(y)));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (z <= 0.8d0) then
tmp = (sqrt((1.0d0 + t)) - sqrt(t)) + ((3.0d0 + (0.5d0 * (z + (x + y)))) - (sqrt(x) + (sqrt(z) + sqrt(y))))
else
tmp = 1.0d0 + ((sqrt((1.0d0 + y)) + (0.5d0 * (x + (sqrt((1.0d0 / t)) + sqrt((1.0d0 / z)))))) - (sqrt(x) + sqrt(y)))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= 0.8) {
tmp = (Math.sqrt((1.0 + t)) - Math.sqrt(t)) + ((3.0 + (0.5 * (z + (x + y)))) - (Math.sqrt(x) + (Math.sqrt(z) + Math.sqrt(y))));
} else {
tmp = 1.0 + ((Math.sqrt((1.0 + y)) + (0.5 * (x + (Math.sqrt((1.0 / t)) + Math.sqrt((1.0 / z)))))) - (Math.sqrt(x) + Math.sqrt(y)));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if z <= 0.8: tmp = (math.sqrt((1.0 + t)) - math.sqrt(t)) + ((3.0 + (0.5 * (z + (x + y)))) - (math.sqrt(x) + (math.sqrt(z) + math.sqrt(y)))) else: tmp = 1.0 + ((math.sqrt((1.0 + y)) + (0.5 * (x + (math.sqrt((1.0 / t)) + math.sqrt((1.0 / z)))))) - (math.sqrt(x) + math.sqrt(y))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (z <= 0.8) tmp = Float64(Float64(sqrt(Float64(1.0 + t)) - sqrt(t)) + Float64(Float64(3.0 + Float64(0.5 * Float64(z + Float64(x + y)))) - Float64(sqrt(x) + Float64(sqrt(z) + sqrt(y))))); else tmp = Float64(1.0 + Float64(Float64(sqrt(Float64(1.0 + y)) + Float64(0.5 * Float64(x + Float64(sqrt(Float64(1.0 / t)) + sqrt(Float64(1.0 / z)))))) - Float64(sqrt(x) + sqrt(y)))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (z <= 0.8)
tmp = (sqrt((1.0 + t)) - sqrt(t)) + ((3.0 + (0.5 * (z + (x + y)))) - (sqrt(x) + (sqrt(z) + sqrt(y))));
else
tmp = 1.0 + ((sqrt((1.0 + y)) + (0.5 * (x + (sqrt((1.0 / t)) + sqrt((1.0 / z)))))) - (sqrt(x) + sqrt(y)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[z, 0.8], N[(N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision] + N[(N[(3.0 + N[(0.5 * N[(z + N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[x], $MachinePrecision] + N[(N[Sqrt[z], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] + N[(0.5 * N[(x + N[(N[Sqrt[N[(1.0 / t), $MachinePrecision]], $MachinePrecision] + N[Sqrt[N[(1.0 / z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq 0.8:\\
\;\;\;\;\left(\sqrt{1 + t} - \sqrt{t}\right) + \left(\left(3 + 0.5 \cdot \left(z + \left(x + y\right)\right)\right) - \left(\sqrt{x} + \left(\sqrt{z} + \sqrt{y}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;1 + \left(\left(\sqrt{1 + y} + 0.5 \cdot \left(x + \left(\sqrt{\frac{1}{t}} + \sqrt{\frac{1}{z}}\right)\right)\right) - \left(\sqrt{x} + \sqrt{y}\right)\right)\\
\end{array}
\end{array}
if z < 0.80000000000000004Initial program 98.3%
Taylor expanded in x around 0 32.2%
associate--l+38.7%
Simplified38.7%
Taylor expanded in y around 0 28.6%
associate--l+28.6%
metadata-eval28.6%
rem-square-sqrt28.6%
hypot-undefine28.6%
distribute-lft-out28.6%
associate-+r+28.6%
+-commutative28.6%
Simplified28.6%
Taylor expanded in z around 0 28.6%
distribute-lft-out28.6%
Simplified28.6%
if 0.80000000000000004 < z Initial program 85.1%
Taylor expanded in t around inf 4.2%
associate--l+15.9%
Simplified15.9%
Taylor expanded in z around inf 28.7%
associate--l+28.7%
distribute-lft-out28.7%
+-commutative28.7%
Simplified28.7%
Taylor expanded in x around 0 20.6%
associate--l+32.0%
distribute-lft-in32.0%
Simplified32.0%
Final simplification30.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))))
(if (<= z 10500000.0)
(+
2.0
(-
(+ (sqrt (+ 1.0 z)) (* 0.5 (+ t_1 (+ x y))))
(+ (sqrt x) (+ (sqrt z) (sqrt y)))))
(+
1.0
(-
(+ (sqrt (+ 1.0 y)) (* 0.5 (+ x (+ t_1 (sqrt (/ 1.0 z))))))
(+ (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 / t));
double tmp;
if (z <= 10500000.0) {
tmp = 2.0 + ((sqrt((1.0 + z)) + (0.5 * (t_1 + (x + y)))) - (sqrt(x) + (sqrt(z) + sqrt(y))));
} else {
tmp = 1.0 + ((sqrt((1.0 + y)) + (0.5 * (x + (t_1 + sqrt((1.0 / z)))))) - (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 / t))
if (z <= 10500000.0d0) then
tmp = 2.0d0 + ((sqrt((1.0d0 + z)) + (0.5d0 * (t_1 + (x + y)))) - (sqrt(x) + (sqrt(z) + sqrt(y))))
else
tmp = 1.0d0 + ((sqrt((1.0d0 + y)) + (0.5d0 * (x + (t_1 + sqrt((1.0d0 / z)))))) - (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 / t));
double tmp;
if (z <= 10500000.0) {
tmp = 2.0 + ((Math.sqrt((1.0 + z)) + (0.5 * (t_1 + (x + y)))) - (Math.sqrt(x) + (Math.sqrt(z) + Math.sqrt(y))));
} else {
tmp = 1.0 + ((Math.sqrt((1.0 + y)) + (0.5 * (x + (t_1 + Math.sqrt((1.0 / z)))))) - (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 / t)) tmp = 0 if z <= 10500000.0: tmp = 2.0 + ((math.sqrt((1.0 + z)) + (0.5 * (t_1 + (x + y)))) - (math.sqrt(x) + (math.sqrt(z) + math.sqrt(y)))) else: tmp = 1.0 + ((math.sqrt((1.0 + y)) + (0.5 * (x + (t_1 + math.sqrt((1.0 / z)))))) - (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 / t)) tmp = 0.0 if (z <= 10500000.0) tmp = Float64(2.0 + Float64(Float64(sqrt(Float64(1.0 + z)) + Float64(0.5 * Float64(t_1 + Float64(x + y)))) - Float64(sqrt(x) + Float64(sqrt(z) + sqrt(y))))); else tmp = Float64(1.0 + Float64(Float64(sqrt(Float64(1.0 + y)) + Float64(0.5 * Float64(x + Float64(t_1 + sqrt(Float64(1.0 / z)))))) - Float64(sqrt(x) + sqrt(y)))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 / t));
tmp = 0.0;
if (z <= 10500000.0)
tmp = 2.0 + ((sqrt((1.0 + z)) + (0.5 * (t_1 + (x + y)))) - (sqrt(x) + (sqrt(z) + sqrt(y))));
else
tmp = 1.0 + ((sqrt((1.0 + y)) + (0.5 * (x + (t_1 + sqrt((1.0 / z)))))) - (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 / t), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[z, 10500000.0], N[(2.0 + N[(N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] + N[(0.5 * N[(t$95$1 + N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[x], $MachinePrecision] + N[(N[Sqrt[z], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] + N[(0.5 * N[(x + N[(t$95$1 + N[Sqrt[N[(1.0 / z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{\frac{1}{t}}\\
\mathbf{if}\;z \leq 10500000:\\
\;\;\;\;2 + \left(\left(\sqrt{1 + z} + 0.5 \cdot \left(t\_1 + \left(x + y\right)\right)\right) - \left(\sqrt{x} + \left(\sqrt{z} + \sqrt{y}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;1 + \left(\left(\sqrt{1 + y} + 0.5 \cdot \left(x + \left(t\_1 + \sqrt{\frac{1}{z}}\right)\right)\right) - \left(\sqrt{x} + \sqrt{y}\right)\right)\\
\end{array}
\end{array}
if z < 1.05e7Initial program 98.3%
Taylor expanded in x around 0 32.5%
associate--l+38.9%
Simplified38.9%
Taylor expanded in y around 0 28.9%
associate--l+28.9%
metadata-eval28.9%
rem-square-sqrt28.9%
hypot-undefine28.9%
distribute-lft-out28.9%
associate-+r+28.9%
+-commutative28.9%
Simplified28.9%
Taylor expanded in t around inf 17.4%
associate--l+17.4%
distribute-lft-out17.4%
Simplified17.4%
if 1.05e7 < z Initial program 84.9%
Taylor expanded in t around inf 4.2%
associate--l+16.0%
Simplified16.0%
Taylor expanded in z around inf 29.1%
associate--l+29.1%
distribute-lft-out29.1%
+-commutative29.1%
Simplified29.1%
Taylor expanded in x around 0 20.9%
associate--l+32.4%
distribute-lft-in32.4%
Simplified32.4%
Final simplification24.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 (<= t 4.4e+24)
(+
(- (+ 3.0 (* 0.5 (+ z (+ x y)))) (+ (sqrt x) (+ (sqrt z) (sqrt y))))
(- (+ 1.0 (* 0.5 t)) (sqrt t)))
(+
1.0
(-
(+ (sqrt (+ 1.0 y)) (* 0.5 (+ x (+ (sqrt (/ 1.0 t)) (sqrt (/ 1.0 z))))))
(+ (sqrt x) (sqrt y))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (t <= 4.4e+24) {
tmp = ((3.0 + (0.5 * (z + (x + y)))) - (sqrt(x) + (sqrt(z) + sqrt(y)))) + ((1.0 + (0.5 * t)) - sqrt(t));
} else {
tmp = 1.0 + ((sqrt((1.0 + y)) + (0.5 * (x + (sqrt((1.0 / t)) + sqrt((1.0 / z)))))) - (sqrt(x) + sqrt(y)));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (t <= 4.4d+24) then
tmp = ((3.0d0 + (0.5d0 * (z + (x + y)))) - (sqrt(x) + (sqrt(z) + sqrt(y)))) + ((1.0d0 + (0.5d0 * t)) - sqrt(t))
else
tmp = 1.0d0 + ((sqrt((1.0d0 + y)) + (0.5d0 * (x + (sqrt((1.0d0 / t)) + sqrt((1.0d0 / z)))))) - (sqrt(x) + sqrt(y)))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (t <= 4.4e+24) {
tmp = ((3.0 + (0.5 * (z + (x + y)))) - (Math.sqrt(x) + (Math.sqrt(z) + Math.sqrt(y)))) + ((1.0 + (0.5 * t)) - Math.sqrt(t));
} else {
tmp = 1.0 + ((Math.sqrt((1.0 + y)) + (0.5 * (x + (Math.sqrt((1.0 / t)) + Math.sqrt((1.0 / z)))))) - (Math.sqrt(x) + Math.sqrt(y)));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if t <= 4.4e+24: tmp = ((3.0 + (0.5 * (z + (x + y)))) - (math.sqrt(x) + (math.sqrt(z) + math.sqrt(y)))) + ((1.0 + (0.5 * t)) - math.sqrt(t)) else: tmp = 1.0 + ((math.sqrt((1.0 + y)) + (0.5 * (x + (math.sqrt((1.0 / t)) + math.sqrt((1.0 / z)))))) - (math.sqrt(x) + math.sqrt(y))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (t <= 4.4e+24) tmp = Float64(Float64(Float64(3.0 + Float64(0.5 * Float64(z + Float64(x + y)))) - Float64(sqrt(x) + Float64(sqrt(z) + sqrt(y)))) + Float64(Float64(1.0 + Float64(0.5 * t)) - sqrt(t))); else tmp = Float64(1.0 + Float64(Float64(sqrt(Float64(1.0 + y)) + Float64(0.5 * Float64(x + Float64(sqrt(Float64(1.0 / t)) + sqrt(Float64(1.0 / z)))))) - Float64(sqrt(x) + sqrt(y)))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (t <= 4.4e+24)
tmp = ((3.0 + (0.5 * (z + (x + y)))) - (sqrt(x) + (sqrt(z) + sqrt(y)))) + ((1.0 + (0.5 * t)) - sqrt(t));
else
tmp = 1.0 + ((sqrt((1.0 + y)) + (0.5 * (x + (sqrt((1.0 / t)) + sqrt((1.0 / z)))))) - (sqrt(x) + sqrt(y)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[t, 4.4e+24], N[(N[(N[(3.0 + N[(0.5 * N[(z + N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[x], $MachinePrecision] + N[(N[Sqrt[z], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 + N[(0.5 * t), $MachinePrecision]), $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] + N[(0.5 * N[(x + N[(N[Sqrt[N[(1.0 / t), $MachinePrecision]], $MachinePrecision] + N[Sqrt[N[(1.0 / z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq 4.4 \cdot 10^{+24}:\\
\;\;\;\;\left(\left(3 + 0.5 \cdot \left(z + \left(x + y\right)\right)\right) - \left(\sqrt{x} + \left(\sqrt{z} + \sqrt{y}\right)\right)\right) + \left(\left(1 + 0.5 \cdot t\right) - \sqrt{t}\right)\\
\mathbf{else}:\\
\;\;\;\;1 + \left(\left(\sqrt{1 + y} + 0.5 \cdot \left(x + \left(\sqrt{\frac{1}{t}} + \sqrt{\frac{1}{z}}\right)\right)\right) - \left(\sqrt{x} + \sqrt{y}\right)\right)\\
\end{array}
\end{array}
if t < 4.40000000000000003e24Initial program 96.4%
Taylor expanded in x around 0 27.2%
associate--l+39.1%
Simplified39.1%
Taylor expanded in y around 0 18.9%
associate--l+26.1%
metadata-eval26.1%
rem-square-sqrt26.2%
hypot-undefine26.2%
distribute-lft-out26.2%
associate-+r+26.2%
+-commutative26.2%
Simplified26.2%
Taylor expanded in t around 0 24.4%
Taylor expanded in z around 0 15.4%
distribute-lft-out16.0%
Simplified15.4%
if 4.40000000000000003e24 < t Initial program 86.7%
Taylor expanded in t around inf 18.7%
associate--l+30.5%
Simplified30.5%
Taylor expanded in z around inf 27.4%
associate--l+27.4%
distribute-lft-out27.4%
+-commutative27.4%
Simplified27.4%
Taylor expanded in x around 0 19.7%
associate--l+27.3%
distribute-lft-in27.3%
Simplified27.3%
Final simplification20.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 t))) (t_2 (sqrt (/ 1.0 z))))
(if (<= y 1.28e-244)
(-
(+ 4.0 (+ (* 0.5 t) (+ (* 0.5 (+ x y)) (* 0.5 z))))
(+ (sqrt t) (+ (sqrt x) (+ (sqrt z) (sqrt y)))))
(if (<= y 1.3)
(+
(+ 1.0 (* x 0.5))
(-
(+
1.0
(+
(* 0.5 (+ t_1 t_2))
(* y (+ 0.5 (* y (- (* y (+ 0.0625 (* y -0.0390625))) 0.125))))))
(+ (sqrt x) (sqrt y))))
(+ 1.0 (- (* 0.5 (+ x (+ t_1 (+ (sqrt (/ 1.0 y)) t_2)))) (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 / t));
double t_2 = sqrt((1.0 / z));
double tmp;
if (y <= 1.28e-244) {
tmp = (4.0 + ((0.5 * t) + ((0.5 * (x + y)) + (0.5 * z)))) - (sqrt(t) + (sqrt(x) + (sqrt(z) + sqrt(y))));
} else if (y <= 1.3) {
tmp = (1.0 + (x * 0.5)) + ((1.0 + ((0.5 * (t_1 + t_2)) + (y * (0.5 + (y * ((y * (0.0625 + (y * -0.0390625))) - 0.125)))))) - (sqrt(x) + sqrt(y)));
} else {
tmp = 1.0 + ((0.5 * (x + (t_1 + (sqrt((1.0 / y)) + t_2)))) - 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 / t))
t_2 = sqrt((1.0d0 / z))
if (y <= 1.28d-244) then
tmp = (4.0d0 + ((0.5d0 * t) + ((0.5d0 * (x + y)) + (0.5d0 * z)))) - (sqrt(t) + (sqrt(x) + (sqrt(z) + sqrt(y))))
else if (y <= 1.3d0) then
tmp = (1.0d0 + (x * 0.5d0)) + ((1.0d0 + ((0.5d0 * (t_1 + t_2)) + (y * (0.5d0 + (y * ((y * (0.0625d0 + (y * (-0.0390625d0)))) - 0.125d0)))))) - (sqrt(x) + sqrt(y)))
else
tmp = 1.0d0 + ((0.5d0 * (x + (t_1 + (sqrt((1.0d0 / y)) + t_2)))) - 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 / t));
double t_2 = Math.sqrt((1.0 / z));
double tmp;
if (y <= 1.28e-244) {
tmp = (4.0 + ((0.5 * t) + ((0.5 * (x + y)) + (0.5 * z)))) - (Math.sqrt(t) + (Math.sqrt(x) + (Math.sqrt(z) + Math.sqrt(y))));
} else if (y <= 1.3) {
tmp = (1.0 + (x * 0.5)) + ((1.0 + ((0.5 * (t_1 + t_2)) + (y * (0.5 + (y * ((y * (0.0625 + (y * -0.0390625))) - 0.125)))))) - (Math.sqrt(x) + Math.sqrt(y)));
} else {
tmp = 1.0 + ((0.5 * (x + (t_1 + (Math.sqrt((1.0 / y)) + t_2)))) - 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 / t)) t_2 = math.sqrt((1.0 / z)) tmp = 0 if y <= 1.28e-244: tmp = (4.0 + ((0.5 * t) + ((0.5 * (x + y)) + (0.5 * z)))) - (math.sqrt(t) + (math.sqrt(x) + (math.sqrt(z) + math.sqrt(y)))) elif y <= 1.3: tmp = (1.0 + (x * 0.5)) + ((1.0 + ((0.5 * (t_1 + t_2)) + (y * (0.5 + (y * ((y * (0.0625 + (y * -0.0390625))) - 0.125)))))) - (math.sqrt(x) + math.sqrt(y))) else: tmp = 1.0 + ((0.5 * (x + (t_1 + (math.sqrt((1.0 / y)) + t_2)))) - 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 / t)) t_2 = sqrt(Float64(1.0 / z)) tmp = 0.0 if (y <= 1.28e-244) tmp = Float64(Float64(4.0 + Float64(Float64(0.5 * t) + Float64(Float64(0.5 * Float64(x + y)) + Float64(0.5 * z)))) - Float64(sqrt(t) + Float64(sqrt(x) + Float64(sqrt(z) + sqrt(y))))); elseif (y <= 1.3) tmp = Float64(Float64(1.0 + Float64(x * 0.5)) + Float64(Float64(1.0 + Float64(Float64(0.5 * Float64(t_1 + t_2)) + Float64(y * Float64(0.5 + Float64(y * Float64(Float64(y * Float64(0.0625 + Float64(y * -0.0390625))) - 0.125)))))) - Float64(sqrt(x) + sqrt(y)))); else tmp = Float64(1.0 + Float64(Float64(0.5 * Float64(x + Float64(t_1 + Float64(sqrt(Float64(1.0 / y)) + t_2)))) - 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 / t));
t_2 = sqrt((1.0 / z));
tmp = 0.0;
if (y <= 1.28e-244)
tmp = (4.0 + ((0.5 * t) + ((0.5 * (x + y)) + (0.5 * z)))) - (sqrt(t) + (sqrt(x) + (sqrt(z) + sqrt(y))));
elseif (y <= 1.3)
tmp = (1.0 + (x * 0.5)) + ((1.0 + ((0.5 * (t_1 + t_2)) + (y * (0.5 + (y * ((y * (0.0625 + (y * -0.0390625))) - 0.125)))))) - (sqrt(x) + sqrt(y)));
else
tmp = 1.0 + ((0.5 * (x + (t_1 + (sqrt((1.0 / y)) + t_2)))) - 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 / t), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(1.0 / z), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y, 1.28e-244], N[(N[(4.0 + N[(N[(0.5 * t), $MachinePrecision] + N[(N[(0.5 * N[(x + y), $MachinePrecision]), $MachinePrecision] + N[(0.5 * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[t], $MachinePrecision] + N[(N[Sqrt[x], $MachinePrecision] + N[(N[Sqrt[z], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.3], N[(N[(1.0 + N[(x * 0.5), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 + N[(N[(0.5 * N[(t$95$1 + t$95$2), $MachinePrecision]), $MachinePrecision] + N[(y * N[(0.5 + N[(y * N[(N[(y * N[(0.0625 + N[(y * -0.0390625), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 0.125), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(N[(0.5 * N[(x + N[(t$95$1 + N[(N[Sqrt[N[(1.0 / y), $MachinePrecision]], $MachinePrecision] + t$95$2), $MachinePrecision]), $MachinePrecision]), $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{\frac{1}{t}}\\
t_2 := \sqrt{\frac{1}{z}}\\
\mathbf{if}\;y \leq 1.28 \cdot 10^{-244}:\\
\;\;\;\;\left(4 + \left(0.5 \cdot t + \left(0.5 \cdot \left(x + y\right) + 0.5 \cdot z\right)\right)\right) - \left(\sqrt{t} + \left(\sqrt{x} + \left(\sqrt{z} + \sqrt{y}\right)\right)\right)\\
\mathbf{elif}\;y \leq 1.3:\\
\;\;\;\;\left(1 + x \cdot 0.5\right) + \left(\left(1 + \left(0.5 \cdot \left(t\_1 + t\_2\right) + y \cdot \left(0.5 + y \cdot \left(y \cdot \left(0.0625 + y \cdot -0.0390625\right) - 0.125\right)\right)\right)\right) - \left(\sqrt{x} + \sqrt{y}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;1 + \left(0.5 \cdot \left(x + \left(t\_1 + \left(\sqrt{\frac{1}{y}} + t\_2\right)\right)\right) - \sqrt{x}\right)\\
\end{array}
\end{array}
if y < 1.27999999999999994e-244Initial program 96.1%
Taylor expanded in x around 0 32.5%
associate--l+37.1%
Simplified37.1%
Taylor expanded in y around 0 32.5%
associate--l+53.5%
metadata-eval53.5%
rem-square-sqrt53.5%
hypot-undefine53.5%
distribute-lft-out53.5%
associate-+r+53.5%
+-commutative53.5%
Simplified53.5%
Taylor expanded in t around 0 30.3%
Taylor expanded in z around 0 9.7%
if 1.27999999999999994e-244 < y < 1.30000000000000004Initial program 97.9%
Taylor expanded in t around inf 19.7%
associate--l+23.5%
Simplified23.5%
Taylor expanded in z around inf 21.6%
associate--l+21.6%
distribute-lft-out21.6%
+-commutative21.6%
Simplified21.6%
Taylor expanded in x around 0 21.8%
Taylor expanded in y around 0 21.8%
if 1.30000000000000004 < y Initial program 87.4%
Taylor expanded in t around inf 4.4%
associate--l+15.2%
Simplified15.2%
Taylor expanded in z around inf 14.1%
associate--l+14.1%
distribute-lft-out14.1%
+-commutative14.1%
Simplified14.1%
Taylor expanded in y around inf 13.5%
distribute-lft-out13.5%
+-commutative13.5%
Simplified13.5%
Taylor expanded in x around 0 13.1%
associate--l+13.1%
distribute-lft-out13.1%
+-commutative13.1%
Simplified13.1%
Final simplification16.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 t))) (t_2 (sqrt (/ 1.0 z))))
(if (<= y 1.28e-244)
(-
(+ 4.0 (+ (* 0.5 t) (+ (* 0.5 (+ x y)) (* 0.5 z))))
(+ (sqrt t) (+ (sqrt x) (+ (sqrt z) (sqrt y)))))
(if (<= y 1.3)
(+
(+ 1.0 (* x 0.5))
(-
(+
1.0
(+ (* 0.5 (+ t_1 t_2)) (* y (+ 0.5 (* y (- (* y 0.0625) 0.125))))))
(+ (sqrt x) (sqrt y))))
(+ 1.0 (- (* 0.5 (+ x (+ t_1 (+ (sqrt (/ 1.0 y)) t_2)))) (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 / t));
double t_2 = sqrt((1.0 / z));
double tmp;
if (y <= 1.28e-244) {
tmp = (4.0 + ((0.5 * t) + ((0.5 * (x + y)) + (0.5 * z)))) - (sqrt(t) + (sqrt(x) + (sqrt(z) + sqrt(y))));
} else if (y <= 1.3) {
tmp = (1.0 + (x * 0.5)) + ((1.0 + ((0.5 * (t_1 + t_2)) + (y * (0.5 + (y * ((y * 0.0625) - 0.125)))))) - (sqrt(x) + sqrt(y)));
} else {
tmp = 1.0 + ((0.5 * (x + (t_1 + (sqrt((1.0 / y)) + t_2)))) - 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 / t))
t_2 = sqrt((1.0d0 / z))
if (y <= 1.28d-244) then
tmp = (4.0d0 + ((0.5d0 * t) + ((0.5d0 * (x + y)) + (0.5d0 * z)))) - (sqrt(t) + (sqrt(x) + (sqrt(z) + sqrt(y))))
else if (y <= 1.3d0) then
tmp = (1.0d0 + (x * 0.5d0)) + ((1.0d0 + ((0.5d0 * (t_1 + t_2)) + (y * (0.5d0 + (y * ((y * 0.0625d0) - 0.125d0)))))) - (sqrt(x) + sqrt(y)))
else
tmp = 1.0d0 + ((0.5d0 * (x + (t_1 + (sqrt((1.0d0 / y)) + t_2)))) - 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 / t));
double t_2 = Math.sqrt((1.0 / z));
double tmp;
if (y <= 1.28e-244) {
tmp = (4.0 + ((0.5 * t) + ((0.5 * (x + y)) + (0.5 * z)))) - (Math.sqrt(t) + (Math.sqrt(x) + (Math.sqrt(z) + Math.sqrt(y))));
} else if (y <= 1.3) {
tmp = (1.0 + (x * 0.5)) + ((1.0 + ((0.5 * (t_1 + t_2)) + (y * (0.5 + (y * ((y * 0.0625) - 0.125)))))) - (Math.sqrt(x) + Math.sqrt(y)));
} else {
tmp = 1.0 + ((0.5 * (x + (t_1 + (Math.sqrt((1.0 / y)) + t_2)))) - 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 / t)) t_2 = math.sqrt((1.0 / z)) tmp = 0 if y <= 1.28e-244: tmp = (4.0 + ((0.5 * t) + ((0.5 * (x + y)) + (0.5 * z)))) - (math.sqrt(t) + (math.sqrt(x) + (math.sqrt(z) + math.sqrt(y)))) elif y <= 1.3: tmp = (1.0 + (x * 0.5)) + ((1.0 + ((0.5 * (t_1 + t_2)) + (y * (0.5 + (y * ((y * 0.0625) - 0.125)))))) - (math.sqrt(x) + math.sqrt(y))) else: tmp = 1.0 + ((0.5 * (x + (t_1 + (math.sqrt((1.0 / y)) + t_2)))) - 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 / t)) t_2 = sqrt(Float64(1.0 / z)) tmp = 0.0 if (y <= 1.28e-244) tmp = Float64(Float64(4.0 + Float64(Float64(0.5 * t) + Float64(Float64(0.5 * Float64(x + y)) + Float64(0.5 * z)))) - Float64(sqrt(t) + Float64(sqrt(x) + Float64(sqrt(z) + sqrt(y))))); elseif (y <= 1.3) tmp = Float64(Float64(1.0 + Float64(x * 0.5)) + Float64(Float64(1.0 + Float64(Float64(0.5 * Float64(t_1 + t_2)) + Float64(y * Float64(0.5 + Float64(y * Float64(Float64(y * 0.0625) - 0.125)))))) - Float64(sqrt(x) + sqrt(y)))); else tmp = Float64(1.0 + Float64(Float64(0.5 * Float64(x + Float64(t_1 + Float64(sqrt(Float64(1.0 / y)) + t_2)))) - 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 / t));
t_2 = sqrt((1.0 / z));
tmp = 0.0;
if (y <= 1.28e-244)
tmp = (4.0 + ((0.5 * t) + ((0.5 * (x + y)) + (0.5 * z)))) - (sqrt(t) + (sqrt(x) + (sqrt(z) + sqrt(y))));
elseif (y <= 1.3)
tmp = (1.0 + (x * 0.5)) + ((1.0 + ((0.5 * (t_1 + t_2)) + (y * (0.5 + (y * ((y * 0.0625) - 0.125)))))) - (sqrt(x) + sqrt(y)));
else
tmp = 1.0 + ((0.5 * (x + (t_1 + (sqrt((1.0 / y)) + t_2)))) - 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 / t), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(1.0 / z), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y, 1.28e-244], N[(N[(4.0 + N[(N[(0.5 * t), $MachinePrecision] + N[(N[(0.5 * N[(x + y), $MachinePrecision]), $MachinePrecision] + N[(0.5 * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[t], $MachinePrecision] + N[(N[Sqrt[x], $MachinePrecision] + N[(N[Sqrt[z], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.3], N[(N[(1.0 + N[(x * 0.5), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 + N[(N[(0.5 * N[(t$95$1 + t$95$2), $MachinePrecision]), $MachinePrecision] + N[(y * N[(0.5 + N[(y * N[(N[(y * 0.0625), $MachinePrecision] - 0.125), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(N[(0.5 * N[(x + N[(t$95$1 + N[(N[Sqrt[N[(1.0 / y), $MachinePrecision]], $MachinePrecision] + t$95$2), $MachinePrecision]), $MachinePrecision]), $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{\frac{1}{t}}\\
t_2 := \sqrt{\frac{1}{z}}\\
\mathbf{if}\;y \leq 1.28 \cdot 10^{-244}:\\
\;\;\;\;\left(4 + \left(0.5 \cdot t + \left(0.5 \cdot \left(x + y\right) + 0.5 \cdot z\right)\right)\right) - \left(\sqrt{t} + \left(\sqrt{x} + \left(\sqrt{z} + \sqrt{y}\right)\right)\right)\\
\mathbf{elif}\;y \leq 1.3:\\
\;\;\;\;\left(1 + x \cdot 0.5\right) + \left(\left(1 + \left(0.5 \cdot \left(t\_1 + t\_2\right) + y \cdot \left(0.5 + y \cdot \left(y \cdot 0.0625 - 0.125\right)\right)\right)\right) - \left(\sqrt{x} + \sqrt{y}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;1 + \left(0.5 \cdot \left(x + \left(t\_1 + \left(\sqrt{\frac{1}{y}} + t\_2\right)\right)\right) - \sqrt{x}\right)\\
\end{array}
\end{array}
if y < 1.27999999999999994e-244Initial program 96.1%
Taylor expanded in x around 0 32.5%
associate--l+37.1%
Simplified37.1%
Taylor expanded in y around 0 32.5%
associate--l+53.5%
metadata-eval53.5%
rem-square-sqrt53.5%
hypot-undefine53.5%
distribute-lft-out53.5%
associate-+r+53.5%
+-commutative53.5%
Simplified53.5%
Taylor expanded in t around 0 30.3%
Taylor expanded in z around 0 9.7%
if 1.27999999999999994e-244 < y < 1.30000000000000004Initial program 97.9%
Taylor expanded in t around inf 19.7%
associate--l+23.5%
Simplified23.5%
Taylor expanded in z around inf 21.6%
associate--l+21.6%
distribute-lft-out21.6%
+-commutative21.6%
Simplified21.6%
Taylor expanded in x around 0 21.8%
Taylor expanded in y around 0 21.8%
if 1.30000000000000004 < y Initial program 87.4%
Taylor expanded in t around inf 4.4%
associate--l+15.2%
Simplified15.2%
Taylor expanded in z around inf 14.1%
associate--l+14.1%
distribute-lft-out14.1%
+-commutative14.1%
Simplified14.1%
Taylor expanded in y around inf 13.5%
distribute-lft-out13.5%
+-commutative13.5%
Simplified13.5%
Taylor expanded in x around 0 13.1%
associate--l+13.1%
distribute-lft-out13.1%
+-commutative13.1%
Simplified13.1%
Final simplification16.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 t))) (t_2 (sqrt (/ 1.0 z))))
(if (<= y 1.28e-244)
(-
(+ 4.0 (+ (* 0.5 t) (+ (* 0.5 (+ x y)) (* 0.5 z))))
(+ (sqrt t) (+ (sqrt x) (+ (sqrt z) (sqrt y)))))
(if (<= y 1.25)
(+
(+ 1.0 (* x 0.5))
(-
(+ 1.0 (+ (* 0.5 (+ t_1 t_2)) (* y (+ 0.5 (* y -0.125)))))
(+ (sqrt x) (sqrt y))))
(+ 1.0 (- (* 0.5 (+ x (+ t_1 (+ (sqrt (/ 1.0 y)) t_2)))) (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 / t));
double t_2 = sqrt((1.0 / z));
double tmp;
if (y <= 1.28e-244) {
tmp = (4.0 + ((0.5 * t) + ((0.5 * (x + y)) + (0.5 * z)))) - (sqrt(t) + (sqrt(x) + (sqrt(z) + sqrt(y))));
} else if (y <= 1.25) {
tmp = (1.0 + (x * 0.5)) + ((1.0 + ((0.5 * (t_1 + t_2)) + (y * (0.5 + (y * -0.125))))) - (sqrt(x) + sqrt(y)));
} else {
tmp = 1.0 + ((0.5 * (x + (t_1 + (sqrt((1.0 / y)) + t_2)))) - 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 / t))
t_2 = sqrt((1.0d0 / z))
if (y <= 1.28d-244) then
tmp = (4.0d0 + ((0.5d0 * t) + ((0.5d0 * (x + y)) + (0.5d0 * z)))) - (sqrt(t) + (sqrt(x) + (sqrt(z) + sqrt(y))))
else if (y <= 1.25d0) then
tmp = (1.0d0 + (x * 0.5d0)) + ((1.0d0 + ((0.5d0 * (t_1 + t_2)) + (y * (0.5d0 + (y * (-0.125d0)))))) - (sqrt(x) + sqrt(y)))
else
tmp = 1.0d0 + ((0.5d0 * (x + (t_1 + (sqrt((1.0d0 / y)) + t_2)))) - 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 / t));
double t_2 = Math.sqrt((1.0 / z));
double tmp;
if (y <= 1.28e-244) {
tmp = (4.0 + ((0.5 * t) + ((0.5 * (x + y)) + (0.5 * z)))) - (Math.sqrt(t) + (Math.sqrt(x) + (Math.sqrt(z) + Math.sqrt(y))));
} else if (y <= 1.25) {
tmp = (1.0 + (x * 0.5)) + ((1.0 + ((0.5 * (t_1 + t_2)) + (y * (0.5 + (y * -0.125))))) - (Math.sqrt(x) + Math.sqrt(y)));
} else {
tmp = 1.0 + ((0.5 * (x + (t_1 + (Math.sqrt((1.0 / y)) + t_2)))) - 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 / t)) t_2 = math.sqrt((1.0 / z)) tmp = 0 if y <= 1.28e-244: tmp = (4.0 + ((0.5 * t) + ((0.5 * (x + y)) + (0.5 * z)))) - (math.sqrt(t) + (math.sqrt(x) + (math.sqrt(z) + math.sqrt(y)))) elif y <= 1.25: tmp = (1.0 + (x * 0.5)) + ((1.0 + ((0.5 * (t_1 + t_2)) + (y * (0.5 + (y * -0.125))))) - (math.sqrt(x) + math.sqrt(y))) else: tmp = 1.0 + ((0.5 * (x + (t_1 + (math.sqrt((1.0 / y)) + t_2)))) - 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 / t)) t_2 = sqrt(Float64(1.0 / z)) tmp = 0.0 if (y <= 1.28e-244) tmp = Float64(Float64(4.0 + Float64(Float64(0.5 * t) + Float64(Float64(0.5 * Float64(x + y)) + Float64(0.5 * z)))) - Float64(sqrt(t) + Float64(sqrt(x) + Float64(sqrt(z) + sqrt(y))))); elseif (y <= 1.25) tmp = Float64(Float64(1.0 + Float64(x * 0.5)) + Float64(Float64(1.0 + Float64(Float64(0.5 * Float64(t_1 + t_2)) + Float64(y * Float64(0.5 + Float64(y * -0.125))))) - Float64(sqrt(x) + sqrt(y)))); else tmp = Float64(1.0 + Float64(Float64(0.5 * Float64(x + Float64(t_1 + Float64(sqrt(Float64(1.0 / y)) + t_2)))) - 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 / t));
t_2 = sqrt((1.0 / z));
tmp = 0.0;
if (y <= 1.28e-244)
tmp = (4.0 + ((0.5 * t) + ((0.5 * (x + y)) + (0.5 * z)))) - (sqrt(t) + (sqrt(x) + (sqrt(z) + sqrt(y))));
elseif (y <= 1.25)
tmp = (1.0 + (x * 0.5)) + ((1.0 + ((0.5 * (t_1 + t_2)) + (y * (0.5 + (y * -0.125))))) - (sqrt(x) + sqrt(y)));
else
tmp = 1.0 + ((0.5 * (x + (t_1 + (sqrt((1.0 / y)) + t_2)))) - 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 / t), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(1.0 / z), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y, 1.28e-244], N[(N[(4.0 + N[(N[(0.5 * t), $MachinePrecision] + N[(N[(0.5 * N[(x + y), $MachinePrecision]), $MachinePrecision] + N[(0.5 * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[t], $MachinePrecision] + N[(N[Sqrt[x], $MachinePrecision] + N[(N[Sqrt[z], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.25], N[(N[(1.0 + N[(x * 0.5), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 + N[(N[(0.5 * N[(t$95$1 + t$95$2), $MachinePrecision]), $MachinePrecision] + N[(y * N[(0.5 + N[(y * -0.125), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(N[(0.5 * N[(x + N[(t$95$1 + N[(N[Sqrt[N[(1.0 / y), $MachinePrecision]], $MachinePrecision] + t$95$2), $MachinePrecision]), $MachinePrecision]), $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{\frac{1}{t}}\\
t_2 := \sqrt{\frac{1}{z}}\\
\mathbf{if}\;y \leq 1.28 \cdot 10^{-244}:\\
\;\;\;\;\left(4 + \left(0.5 \cdot t + \left(0.5 \cdot \left(x + y\right) + 0.5 \cdot z\right)\right)\right) - \left(\sqrt{t} + \left(\sqrt{x} + \left(\sqrt{z} + \sqrt{y}\right)\right)\right)\\
\mathbf{elif}\;y \leq 1.25:\\
\;\;\;\;\left(1 + x \cdot 0.5\right) + \left(\left(1 + \left(0.5 \cdot \left(t\_1 + t\_2\right) + y \cdot \left(0.5 + y \cdot -0.125\right)\right)\right) - \left(\sqrt{x} + \sqrt{y}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;1 + \left(0.5 \cdot \left(x + \left(t\_1 + \left(\sqrt{\frac{1}{y}} + t\_2\right)\right)\right) - \sqrt{x}\right)\\
\end{array}
\end{array}
if y < 1.27999999999999994e-244Initial program 96.1%
Taylor expanded in x around 0 32.5%
associate--l+37.1%
Simplified37.1%
Taylor expanded in y around 0 32.5%
associate--l+53.5%
metadata-eval53.5%
rem-square-sqrt53.5%
hypot-undefine53.5%
distribute-lft-out53.5%
associate-+r+53.5%
+-commutative53.5%
Simplified53.5%
Taylor expanded in t around 0 30.3%
Taylor expanded in z around 0 9.7%
if 1.27999999999999994e-244 < y < 1.25Initial program 97.9%
Taylor expanded in t around inf 19.7%
associate--l+23.5%
Simplified23.5%
Taylor expanded in z around inf 21.6%
associate--l+21.6%
distribute-lft-out21.6%
+-commutative21.6%
Simplified21.6%
Taylor expanded in x around 0 21.8%
Taylor expanded in y around 0 21.8%
if 1.25 < y Initial program 87.4%
Taylor expanded in t around inf 4.4%
associate--l+15.2%
Simplified15.2%
Taylor expanded in z around inf 14.1%
associate--l+14.1%
distribute-lft-out14.1%
+-commutative14.1%
Simplified14.1%
Taylor expanded in y around inf 13.5%
distribute-lft-out13.5%
+-commutative13.5%
Simplified13.5%
Taylor expanded in x around 0 13.1%
associate--l+13.1%
distribute-lft-out13.1%
+-commutative13.1%
Simplified13.1%
Final simplification16.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 t))) (t_2 (sqrt (/ 1.0 z))))
(if (<= y 1.28e-244)
(-
(+ 4.0 (+ (* 0.5 t) (+ (* 0.5 (+ x y)) (* 0.5 z))))
(+ (sqrt t) (+ (sqrt x) (+ (sqrt z) (sqrt y)))))
(if (<= y 1.0)
(+
(+ 1.0 (* x 0.5))
(- (+ 1.0 (+ (* 0.5 y) (* 0.5 (+ t_1 t_2)))) (+ (sqrt x) (sqrt y))))
(+ 1.0 (- (* 0.5 (+ x (+ t_1 (+ (sqrt (/ 1.0 y)) t_2)))) (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 / t));
double t_2 = sqrt((1.0 / z));
double tmp;
if (y <= 1.28e-244) {
tmp = (4.0 + ((0.5 * t) + ((0.5 * (x + y)) + (0.5 * z)))) - (sqrt(t) + (sqrt(x) + (sqrt(z) + sqrt(y))));
} else if (y <= 1.0) {
tmp = (1.0 + (x * 0.5)) + ((1.0 + ((0.5 * y) + (0.5 * (t_1 + t_2)))) - (sqrt(x) + sqrt(y)));
} else {
tmp = 1.0 + ((0.5 * (x + (t_1 + (sqrt((1.0 / y)) + t_2)))) - 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 / t))
t_2 = sqrt((1.0d0 / z))
if (y <= 1.28d-244) then
tmp = (4.0d0 + ((0.5d0 * t) + ((0.5d0 * (x + y)) + (0.5d0 * z)))) - (sqrt(t) + (sqrt(x) + (sqrt(z) + sqrt(y))))
else if (y <= 1.0d0) then
tmp = (1.0d0 + (x * 0.5d0)) + ((1.0d0 + ((0.5d0 * y) + (0.5d0 * (t_1 + t_2)))) - (sqrt(x) + sqrt(y)))
else
tmp = 1.0d0 + ((0.5d0 * (x + (t_1 + (sqrt((1.0d0 / y)) + t_2)))) - 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 / t));
double t_2 = Math.sqrt((1.0 / z));
double tmp;
if (y <= 1.28e-244) {
tmp = (4.0 + ((0.5 * t) + ((0.5 * (x + y)) + (0.5 * z)))) - (Math.sqrt(t) + (Math.sqrt(x) + (Math.sqrt(z) + Math.sqrt(y))));
} else if (y <= 1.0) {
tmp = (1.0 + (x * 0.5)) + ((1.0 + ((0.5 * y) + (0.5 * (t_1 + t_2)))) - (Math.sqrt(x) + Math.sqrt(y)));
} else {
tmp = 1.0 + ((0.5 * (x + (t_1 + (Math.sqrt((1.0 / y)) + t_2)))) - 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 / t)) t_2 = math.sqrt((1.0 / z)) tmp = 0 if y <= 1.28e-244: tmp = (4.0 + ((0.5 * t) + ((0.5 * (x + y)) + (0.5 * z)))) - (math.sqrt(t) + (math.sqrt(x) + (math.sqrt(z) + math.sqrt(y)))) elif y <= 1.0: tmp = (1.0 + (x * 0.5)) + ((1.0 + ((0.5 * y) + (0.5 * (t_1 + t_2)))) - (math.sqrt(x) + math.sqrt(y))) else: tmp = 1.0 + ((0.5 * (x + (t_1 + (math.sqrt((1.0 / y)) + t_2)))) - 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 / t)) t_2 = sqrt(Float64(1.0 / z)) tmp = 0.0 if (y <= 1.28e-244) tmp = Float64(Float64(4.0 + Float64(Float64(0.5 * t) + Float64(Float64(0.5 * Float64(x + y)) + Float64(0.5 * z)))) - Float64(sqrt(t) + Float64(sqrt(x) + Float64(sqrt(z) + sqrt(y))))); elseif (y <= 1.0) tmp = Float64(Float64(1.0 + Float64(x * 0.5)) + Float64(Float64(1.0 + Float64(Float64(0.5 * y) + Float64(0.5 * Float64(t_1 + t_2)))) - Float64(sqrt(x) + sqrt(y)))); else tmp = Float64(1.0 + Float64(Float64(0.5 * Float64(x + Float64(t_1 + Float64(sqrt(Float64(1.0 / y)) + t_2)))) - 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 / t));
t_2 = sqrt((1.0 / z));
tmp = 0.0;
if (y <= 1.28e-244)
tmp = (4.0 + ((0.5 * t) + ((0.5 * (x + y)) + (0.5 * z)))) - (sqrt(t) + (sqrt(x) + (sqrt(z) + sqrt(y))));
elseif (y <= 1.0)
tmp = (1.0 + (x * 0.5)) + ((1.0 + ((0.5 * y) + (0.5 * (t_1 + t_2)))) - (sqrt(x) + sqrt(y)));
else
tmp = 1.0 + ((0.5 * (x + (t_1 + (sqrt((1.0 / y)) + t_2)))) - 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 / t), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(1.0 / z), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y, 1.28e-244], N[(N[(4.0 + N[(N[(0.5 * t), $MachinePrecision] + N[(N[(0.5 * N[(x + y), $MachinePrecision]), $MachinePrecision] + N[(0.5 * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[t], $MachinePrecision] + N[(N[Sqrt[x], $MachinePrecision] + N[(N[Sqrt[z], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.0], N[(N[(1.0 + N[(x * 0.5), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 + N[(N[(0.5 * y), $MachinePrecision] + N[(0.5 * N[(t$95$1 + t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(N[(0.5 * N[(x + N[(t$95$1 + N[(N[Sqrt[N[(1.0 / y), $MachinePrecision]], $MachinePrecision] + t$95$2), $MachinePrecision]), $MachinePrecision]), $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{\frac{1}{t}}\\
t_2 := \sqrt{\frac{1}{z}}\\
\mathbf{if}\;y \leq 1.28 \cdot 10^{-244}:\\
\;\;\;\;\left(4 + \left(0.5 \cdot t + \left(0.5 \cdot \left(x + y\right) + 0.5 \cdot z\right)\right)\right) - \left(\sqrt{t} + \left(\sqrt{x} + \left(\sqrt{z} + \sqrt{y}\right)\right)\right)\\
\mathbf{elif}\;y \leq 1:\\
\;\;\;\;\left(1 + x \cdot 0.5\right) + \left(\left(1 + \left(0.5 \cdot y + 0.5 \cdot \left(t\_1 + t\_2\right)\right)\right) - \left(\sqrt{x} + \sqrt{y}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;1 + \left(0.5 \cdot \left(x + \left(t\_1 + \left(\sqrt{\frac{1}{y}} + t\_2\right)\right)\right) - \sqrt{x}\right)\\
\end{array}
\end{array}
if y < 1.27999999999999994e-244Initial program 96.1%
Taylor expanded in x around 0 32.5%
associate--l+37.1%
Simplified37.1%
Taylor expanded in y around 0 32.5%
associate--l+53.5%
metadata-eval53.5%
rem-square-sqrt53.5%
hypot-undefine53.5%
distribute-lft-out53.5%
associate-+r+53.5%
+-commutative53.5%
Simplified53.5%
Taylor expanded in t around 0 30.3%
Taylor expanded in z around 0 9.7%
if 1.27999999999999994e-244 < y < 1Initial program 97.9%
Taylor expanded in t around inf 19.7%
associate--l+23.5%
Simplified23.5%
Taylor expanded in z around inf 21.6%
associate--l+21.6%
distribute-lft-out21.6%
+-commutative21.6%
Simplified21.6%
Taylor expanded in x around 0 21.8%
Taylor expanded in y around 0 21.8%
if 1 < y Initial program 87.4%
Taylor expanded in t around inf 4.4%
associate--l+15.2%
Simplified15.2%
Taylor expanded in z around inf 14.1%
associate--l+14.1%
distribute-lft-out14.1%
+-commutative14.1%
Simplified14.1%
Taylor expanded in y around inf 13.5%
distribute-lft-out13.5%
+-commutative13.5%
Simplified13.5%
Taylor expanded in x around 0 13.1%
associate--l+13.1%
distribute-lft-out13.1%
+-commutative13.1%
Simplified13.1%
Final simplification16.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 t))) (t_2 (sqrt (/ 1.0 z))))
(if (<= y 1.28e-244)
(-
(+ 4.0 (+ (* 0.5 t) (+ (* 0.5 (+ x y)) (* 0.5 z))))
(+ (sqrt t) (+ (sqrt x) (+ (sqrt z) (sqrt y)))))
(if (<= y 1.0)
(+
(+ 1.0 (* x 0.5))
(+ 1.0 (- (* 0.5 (+ y (+ t_1 t_2))) (+ (sqrt x) (sqrt y)))))
(+ 1.0 (- (* 0.5 (+ x (+ t_1 (+ (sqrt (/ 1.0 y)) t_2)))) (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 / t));
double t_2 = sqrt((1.0 / z));
double tmp;
if (y <= 1.28e-244) {
tmp = (4.0 + ((0.5 * t) + ((0.5 * (x + y)) + (0.5 * z)))) - (sqrt(t) + (sqrt(x) + (sqrt(z) + sqrt(y))));
} else if (y <= 1.0) {
tmp = (1.0 + (x * 0.5)) + (1.0 + ((0.5 * (y + (t_1 + t_2))) - (sqrt(x) + sqrt(y))));
} else {
tmp = 1.0 + ((0.5 * (x + (t_1 + (sqrt((1.0 / y)) + t_2)))) - 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 / t))
t_2 = sqrt((1.0d0 / z))
if (y <= 1.28d-244) then
tmp = (4.0d0 + ((0.5d0 * t) + ((0.5d0 * (x + y)) + (0.5d0 * z)))) - (sqrt(t) + (sqrt(x) + (sqrt(z) + sqrt(y))))
else if (y <= 1.0d0) then
tmp = (1.0d0 + (x * 0.5d0)) + (1.0d0 + ((0.5d0 * (y + (t_1 + t_2))) - (sqrt(x) + sqrt(y))))
else
tmp = 1.0d0 + ((0.5d0 * (x + (t_1 + (sqrt((1.0d0 / y)) + t_2)))) - 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 / t));
double t_2 = Math.sqrt((1.0 / z));
double tmp;
if (y <= 1.28e-244) {
tmp = (4.0 + ((0.5 * t) + ((0.5 * (x + y)) + (0.5 * z)))) - (Math.sqrt(t) + (Math.sqrt(x) + (Math.sqrt(z) + Math.sqrt(y))));
} else if (y <= 1.0) {
tmp = (1.0 + (x * 0.5)) + (1.0 + ((0.5 * (y + (t_1 + t_2))) - (Math.sqrt(x) + Math.sqrt(y))));
} else {
tmp = 1.0 + ((0.5 * (x + (t_1 + (Math.sqrt((1.0 / y)) + t_2)))) - 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 / t)) t_2 = math.sqrt((1.0 / z)) tmp = 0 if y <= 1.28e-244: tmp = (4.0 + ((0.5 * t) + ((0.5 * (x + y)) + (0.5 * z)))) - (math.sqrt(t) + (math.sqrt(x) + (math.sqrt(z) + math.sqrt(y)))) elif y <= 1.0: tmp = (1.0 + (x * 0.5)) + (1.0 + ((0.5 * (y + (t_1 + t_2))) - (math.sqrt(x) + math.sqrt(y)))) else: tmp = 1.0 + ((0.5 * (x + (t_1 + (math.sqrt((1.0 / y)) + t_2)))) - 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 / t)) t_2 = sqrt(Float64(1.0 / z)) tmp = 0.0 if (y <= 1.28e-244) tmp = Float64(Float64(4.0 + Float64(Float64(0.5 * t) + Float64(Float64(0.5 * Float64(x + y)) + Float64(0.5 * z)))) - Float64(sqrt(t) + Float64(sqrt(x) + Float64(sqrt(z) + sqrt(y))))); elseif (y <= 1.0) tmp = Float64(Float64(1.0 + Float64(x * 0.5)) + Float64(1.0 + Float64(Float64(0.5 * Float64(y + Float64(t_1 + t_2))) - Float64(sqrt(x) + sqrt(y))))); else tmp = Float64(1.0 + Float64(Float64(0.5 * Float64(x + Float64(t_1 + Float64(sqrt(Float64(1.0 / y)) + t_2)))) - 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 / t));
t_2 = sqrt((1.0 / z));
tmp = 0.0;
if (y <= 1.28e-244)
tmp = (4.0 + ((0.5 * t) + ((0.5 * (x + y)) + (0.5 * z)))) - (sqrt(t) + (sqrt(x) + (sqrt(z) + sqrt(y))));
elseif (y <= 1.0)
tmp = (1.0 + (x * 0.5)) + (1.0 + ((0.5 * (y + (t_1 + t_2))) - (sqrt(x) + sqrt(y))));
else
tmp = 1.0 + ((0.5 * (x + (t_1 + (sqrt((1.0 / y)) + t_2)))) - 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 / t), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(1.0 / z), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y, 1.28e-244], N[(N[(4.0 + N[(N[(0.5 * t), $MachinePrecision] + N[(N[(0.5 * N[(x + y), $MachinePrecision]), $MachinePrecision] + N[(0.5 * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[t], $MachinePrecision] + N[(N[Sqrt[x], $MachinePrecision] + N[(N[Sqrt[z], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.0], N[(N[(1.0 + N[(x * 0.5), $MachinePrecision]), $MachinePrecision] + N[(1.0 + N[(N[(0.5 * N[(y + N[(t$95$1 + t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(N[(0.5 * N[(x + N[(t$95$1 + N[(N[Sqrt[N[(1.0 / y), $MachinePrecision]], $MachinePrecision] + t$95$2), $MachinePrecision]), $MachinePrecision]), $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{\frac{1}{t}}\\
t_2 := \sqrt{\frac{1}{z}}\\
\mathbf{if}\;y \leq 1.28 \cdot 10^{-244}:\\
\;\;\;\;\left(4 + \left(0.5 \cdot t + \left(0.5 \cdot \left(x + y\right) + 0.5 \cdot z\right)\right)\right) - \left(\sqrt{t} + \left(\sqrt{x} + \left(\sqrt{z} + \sqrt{y}\right)\right)\right)\\
\mathbf{elif}\;y \leq 1:\\
\;\;\;\;\left(1 + x \cdot 0.5\right) + \left(1 + \left(0.5 \cdot \left(y + \left(t\_1 + t\_2\right)\right) - \left(\sqrt{x} + \sqrt{y}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;1 + \left(0.5 \cdot \left(x + \left(t\_1 + \left(\sqrt{\frac{1}{y}} + t\_2\right)\right)\right) - \sqrt{x}\right)\\
\end{array}
\end{array}
if y < 1.27999999999999994e-244Initial program 96.1%
Taylor expanded in x around 0 32.5%
associate--l+37.1%
Simplified37.1%
Taylor expanded in y around 0 32.5%
associate--l+53.5%
metadata-eval53.5%
rem-square-sqrt53.5%
hypot-undefine53.5%
distribute-lft-out53.5%
associate-+r+53.5%
+-commutative53.5%
Simplified53.5%
Taylor expanded in t around 0 30.3%
Taylor expanded in z around 0 9.7%
if 1.27999999999999994e-244 < y < 1Initial program 97.9%
Taylor expanded in t around inf 19.7%
associate--l+23.5%
Simplified23.5%
Taylor expanded in z around inf 21.6%
associate--l+21.6%
distribute-lft-out21.6%
+-commutative21.6%
Simplified21.6%
Taylor expanded in x around 0 21.8%
Taylor expanded in y around 0 21.8%
associate--l+21.8%
distribute-lft-out21.8%
+-commutative21.8%
Simplified21.8%
if 1 < y Initial program 87.4%
Taylor expanded in t around inf 4.4%
associate--l+15.2%
Simplified15.2%
Taylor expanded in z around inf 14.1%
associate--l+14.1%
distribute-lft-out14.1%
+-commutative14.1%
Simplified14.1%
Taylor expanded in y around inf 13.5%
distribute-lft-out13.5%
+-commutative13.5%
Simplified13.5%
Taylor expanded in x around 0 13.1%
associate--l+13.1%
distribute-lft-out13.1%
+-commutative13.1%
Simplified13.1%
Final simplification16.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 t)))
(t_2 (+ (sqrt x) (sqrt y)))
(t_3 (sqrt (/ 1.0 z))))
(if (<= y 1.28e-244)
(+ 4.0 (- (* 0.5 (+ t (+ z (+ x y)))) (+ (sqrt t) (+ (sqrt z) t_2))))
(if (<= y 1.0)
(+ (+ 1.0 (* x 0.5)) (+ 1.0 (- (* 0.5 (+ y (+ t_1 t_3))) t_2)))
(+ 1.0 (- (* 0.5 (+ x (+ t_1 (+ (sqrt (/ 1.0 y)) t_3)))) (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 / t));
double t_2 = sqrt(x) + sqrt(y);
double t_3 = sqrt((1.0 / z));
double tmp;
if (y <= 1.28e-244) {
tmp = 4.0 + ((0.5 * (t + (z + (x + y)))) - (sqrt(t) + (sqrt(z) + t_2)));
} else if (y <= 1.0) {
tmp = (1.0 + (x * 0.5)) + (1.0 + ((0.5 * (y + (t_1 + t_3))) - t_2));
} else {
tmp = 1.0 + ((0.5 * (x + (t_1 + (sqrt((1.0 / y)) + t_3)))) - 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) :: t_3
real(8) :: tmp
t_1 = sqrt((1.0d0 / t))
t_2 = sqrt(x) + sqrt(y)
t_3 = sqrt((1.0d0 / z))
if (y <= 1.28d-244) then
tmp = 4.0d0 + ((0.5d0 * (t + (z + (x + y)))) - (sqrt(t) + (sqrt(z) + t_2)))
else if (y <= 1.0d0) then
tmp = (1.0d0 + (x * 0.5d0)) + (1.0d0 + ((0.5d0 * (y + (t_1 + t_3))) - t_2))
else
tmp = 1.0d0 + ((0.5d0 * (x + (t_1 + (sqrt((1.0d0 / y)) + t_3)))) - 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 / t));
double t_2 = Math.sqrt(x) + Math.sqrt(y);
double t_3 = Math.sqrt((1.0 / z));
double tmp;
if (y <= 1.28e-244) {
tmp = 4.0 + ((0.5 * (t + (z + (x + y)))) - (Math.sqrt(t) + (Math.sqrt(z) + t_2)));
} else if (y <= 1.0) {
tmp = (1.0 + (x * 0.5)) + (1.0 + ((0.5 * (y + (t_1 + t_3))) - t_2));
} else {
tmp = 1.0 + ((0.5 * (x + (t_1 + (Math.sqrt((1.0 / y)) + t_3)))) - 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 / t)) t_2 = math.sqrt(x) + math.sqrt(y) t_3 = math.sqrt((1.0 / z)) tmp = 0 if y <= 1.28e-244: tmp = 4.0 + ((0.5 * (t + (z + (x + y)))) - (math.sqrt(t) + (math.sqrt(z) + t_2))) elif y <= 1.0: tmp = (1.0 + (x * 0.5)) + (1.0 + ((0.5 * (y + (t_1 + t_3))) - t_2)) else: tmp = 1.0 + ((0.5 * (x + (t_1 + (math.sqrt((1.0 / y)) + t_3)))) - 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 / t)) t_2 = Float64(sqrt(x) + sqrt(y)) t_3 = sqrt(Float64(1.0 / z)) tmp = 0.0 if (y <= 1.28e-244) tmp = Float64(4.0 + Float64(Float64(0.5 * Float64(t + Float64(z + Float64(x + y)))) - Float64(sqrt(t) + Float64(sqrt(z) + t_2)))); elseif (y <= 1.0) tmp = Float64(Float64(1.0 + Float64(x * 0.5)) + Float64(1.0 + Float64(Float64(0.5 * Float64(y + Float64(t_1 + t_3))) - t_2))); else tmp = Float64(1.0 + Float64(Float64(0.5 * Float64(x + Float64(t_1 + Float64(sqrt(Float64(1.0 / y)) + t_3)))) - 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 / t));
t_2 = sqrt(x) + sqrt(y);
t_3 = sqrt((1.0 / z));
tmp = 0.0;
if (y <= 1.28e-244)
tmp = 4.0 + ((0.5 * (t + (z + (x + y)))) - (sqrt(t) + (sqrt(z) + t_2)));
elseif (y <= 1.0)
tmp = (1.0 + (x * 0.5)) + (1.0 + ((0.5 * (y + (t_1 + t_3))) - t_2));
else
tmp = 1.0 + ((0.5 * (x + (t_1 + (sqrt((1.0 / y)) + t_3)))) - 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 / t), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[Sqrt[N[(1.0 / z), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y, 1.28e-244], N[(4.0 + N[(N[(0.5 * N[(t + N[(z + N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[t], $MachinePrecision] + N[(N[Sqrt[z], $MachinePrecision] + t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.0], N[(N[(1.0 + N[(x * 0.5), $MachinePrecision]), $MachinePrecision] + N[(1.0 + N[(N[(0.5 * N[(y + N[(t$95$1 + t$95$3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(N[(0.5 * N[(x + N[(t$95$1 + N[(N[Sqrt[N[(1.0 / y), $MachinePrecision]], $MachinePrecision] + t$95$3), $MachinePrecision]), $MachinePrecision]), $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{\frac{1}{t}}\\
t_2 := \sqrt{x} + \sqrt{y}\\
t_3 := \sqrt{\frac{1}{z}}\\
\mathbf{if}\;y \leq 1.28 \cdot 10^{-244}:\\
\;\;\;\;4 + \left(0.5 \cdot \left(t + \left(z + \left(x + y\right)\right)\right) - \left(\sqrt{t} + \left(\sqrt{z} + t\_2\right)\right)\right)\\
\mathbf{elif}\;y \leq 1:\\
\;\;\;\;\left(1 + x \cdot 0.5\right) + \left(1 + \left(0.5 \cdot \left(y + \left(t\_1 + t\_3\right)\right) - t\_2\right)\right)\\
\mathbf{else}:\\
\;\;\;\;1 + \left(0.5 \cdot \left(x + \left(t\_1 + \left(\sqrt{\frac{1}{y}} + t\_3\right)\right)\right) - \sqrt{x}\right)\\
\end{array}
\end{array}
if y < 1.27999999999999994e-244Initial program 96.1%
Taylor expanded in x around 0 32.5%
associate--l+37.1%
Simplified37.1%
Taylor expanded in y around 0 32.5%
associate--l+53.5%
metadata-eval53.5%
rem-square-sqrt53.5%
hypot-undefine53.5%
distribute-lft-out53.5%
associate-+r+53.5%
+-commutative53.5%
Simplified53.5%
Taylor expanded in t around 0 30.3%
Taylor expanded in z around 0 9.7%
associate--l+9.7%
+-commutative9.7%
distribute-lft-out9.7%
distribute-lft-out9.7%
+-commutative9.7%
+-commutative9.7%
+-commutative9.7%
associate-+r+9.7%
Simplified9.7%
if 1.27999999999999994e-244 < y < 1Initial program 97.9%
Taylor expanded in t around inf 19.7%
associate--l+23.5%
Simplified23.5%
Taylor expanded in z around inf 21.6%
associate--l+21.6%
distribute-lft-out21.6%
+-commutative21.6%
Simplified21.6%
Taylor expanded in x around 0 21.8%
Taylor expanded in y around 0 21.8%
associate--l+21.8%
distribute-lft-out21.8%
+-commutative21.8%
Simplified21.8%
if 1 < y Initial program 87.4%
Taylor expanded in t around inf 4.4%
associate--l+15.2%
Simplified15.2%
Taylor expanded in z around inf 14.1%
associate--l+14.1%
distribute-lft-out14.1%
+-commutative14.1%
Simplified14.1%
Taylor expanded in y around inf 13.5%
distribute-lft-out13.5%
+-commutative13.5%
Simplified13.5%
Taylor expanded in x around 0 13.1%
associate--l+13.1%
distribute-lft-out13.1%
+-commutative13.1%
Simplified13.1%
Final simplification16.0%
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 8.5e+33)
(+
4.0
(-
(* 0.5 (+ t (+ z (+ x y))))
(+ (sqrt t) (+ (sqrt z) (+ (sqrt x) (sqrt y))))))
(+
1.0
(-
(* 0.5 (+ x (+ (sqrt (/ 1.0 t)) (+ (sqrt (/ 1.0 y)) (sqrt (/ 1.0 z))))))
(sqrt x)))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (t <= 8.5e+33) {
tmp = 4.0 + ((0.5 * (t + (z + (x + y)))) - (sqrt(t) + (sqrt(z) + (sqrt(x) + sqrt(y)))));
} else {
tmp = 1.0 + ((0.5 * (x + (sqrt((1.0 / t)) + (sqrt((1.0 / y)) + sqrt((1.0 / z)))))) - 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 (t <= 8.5d+33) then
tmp = 4.0d0 + ((0.5d0 * (t + (z + (x + y)))) - (sqrt(t) + (sqrt(z) + (sqrt(x) + sqrt(y)))))
else
tmp = 1.0d0 + ((0.5d0 * (x + (sqrt((1.0d0 / t)) + (sqrt((1.0d0 / y)) + sqrt((1.0d0 / z)))))) - 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 (t <= 8.5e+33) {
tmp = 4.0 + ((0.5 * (t + (z + (x + y)))) - (Math.sqrt(t) + (Math.sqrt(z) + (Math.sqrt(x) + Math.sqrt(y)))));
} else {
tmp = 1.0 + ((0.5 * (x + (Math.sqrt((1.0 / t)) + (Math.sqrt((1.0 / y)) + Math.sqrt((1.0 / z)))))) - Math.sqrt(x));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if t <= 8.5e+33: tmp = 4.0 + ((0.5 * (t + (z + (x + y)))) - (math.sqrt(t) + (math.sqrt(z) + (math.sqrt(x) + math.sqrt(y))))) else: tmp = 1.0 + ((0.5 * (x + (math.sqrt((1.0 / t)) + (math.sqrt((1.0 / y)) + math.sqrt((1.0 / z)))))) - math.sqrt(x)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (t <= 8.5e+33) tmp = Float64(4.0 + Float64(Float64(0.5 * Float64(t + Float64(z + Float64(x + y)))) - Float64(sqrt(t) + Float64(sqrt(z) + Float64(sqrt(x) + sqrt(y)))))); else tmp = Float64(1.0 + Float64(Float64(0.5 * Float64(x + Float64(sqrt(Float64(1.0 / t)) + Float64(sqrt(Float64(1.0 / y)) + sqrt(Float64(1.0 / z)))))) - 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 (t <= 8.5e+33)
tmp = 4.0 + ((0.5 * (t + (z + (x + y)))) - (sqrt(t) + (sqrt(z) + (sqrt(x) + sqrt(y)))));
else
tmp = 1.0 + ((0.5 * (x + (sqrt((1.0 / t)) + (sqrt((1.0 / y)) + sqrt((1.0 / z)))))) - 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[t, 8.5e+33], N[(4.0 + N[(N[(0.5 * N[(t + N[(z + N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[t], $MachinePrecision] + N[(N[Sqrt[z], $MachinePrecision] + N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(N[(0.5 * N[(x + N[(N[Sqrt[N[(1.0 / t), $MachinePrecision]], $MachinePrecision] + N[(N[Sqrt[N[(1.0 / y), $MachinePrecision]], $MachinePrecision] + N[Sqrt[N[(1.0 / z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $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}\;t \leq 8.5 \cdot 10^{+33}:\\
\;\;\;\;4 + \left(0.5 \cdot \left(t + \left(z + \left(x + y\right)\right)\right) - \left(\sqrt{t} + \left(\sqrt{z} + \left(\sqrt{x} + \sqrt{y}\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;1 + \left(0.5 \cdot \left(x + \left(\sqrt{\frac{1}{t}} + \left(\sqrt{\frac{1}{y}} + \sqrt{\frac{1}{z}}\right)\right)\right) - \sqrt{x}\right)\\
\end{array}
\end{array}
if t < 8.4999999999999998e33Initial program 95.7%
Taylor expanded in x around 0 26.9%
associate--l+38.5%
Simplified38.5%
Taylor expanded in y around 0 18.9%
associate--l+26.8%
metadata-eval26.8%
rem-square-sqrt26.8%
hypot-undefine26.8%
distribute-lft-out26.8%
associate-+r+26.8%
+-commutative26.8%
Simplified26.8%
Taylor expanded in t around 0 23.7%
Taylor expanded in z around 0 15.0%
associate--l+15.0%
+-commutative15.0%
distribute-lft-out15.0%
distribute-lft-out15.0%
+-commutative15.0%
+-commutative15.0%
+-commutative15.0%
associate-+r+15.0%
Simplified15.0%
if 8.4999999999999998e33 < t Initial program 87.0%
Taylor expanded in t around inf 18.7%
associate--l+30.8%
Simplified30.8%
Taylor expanded in z around inf 26.9%
associate--l+26.9%
distribute-lft-out26.9%
+-commutative26.9%
Simplified26.9%
Taylor expanded in y around inf 14.7%
distribute-lft-out14.7%
+-commutative14.7%
Simplified14.7%
Taylor expanded in x around 0 14.2%
associate--l+14.2%
distribute-lft-out14.2%
+-commutative14.2%
Simplified14.2%
Final simplification14.7%
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 (/ 1.0 y)) (sqrt (/ 1.0 z))))))
(if (<= x 1.0)
(+ 1.0 (- (* 0.5 (+ x t_1)) (sqrt x)))
(* 0.5 (+ (sqrt (/ 1.0 x)) 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((1.0 / y)) + sqrt((1.0 / z)));
double tmp;
if (x <= 1.0) {
tmp = 1.0 + ((0.5 * (x + t_1)) - sqrt(x));
} else {
tmp = 0.5 * (sqrt((1.0 / x)) + t_1);
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = sqrt((1.0d0 / t)) + (sqrt((1.0d0 / y)) + sqrt((1.0d0 / z)))
if (x <= 1.0d0) then
tmp = 1.0d0 + ((0.5d0 * (x + t_1)) - sqrt(x))
else
tmp = 0.5d0 * (sqrt((1.0d0 / x)) + t_1)
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 / t)) + (Math.sqrt((1.0 / y)) + Math.sqrt((1.0 / z)));
double tmp;
if (x <= 1.0) {
tmp = 1.0 + ((0.5 * (x + t_1)) - Math.sqrt(x));
} else {
tmp = 0.5 * (Math.sqrt((1.0 / x)) + 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((1.0 / y)) + math.sqrt((1.0 / z))) tmp = 0 if x <= 1.0: tmp = 1.0 + ((0.5 * (x + t_1)) - math.sqrt(x)) else: tmp = 0.5 * (math.sqrt((1.0 / x)) + 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)) + Float64(sqrt(Float64(1.0 / y)) + sqrt(Float64(1.0 / z)))) tmp = 0.0 if (x <= 1.0) tmp = Float64(1.0 + Float64(Float64(0.5 * Float64(x + t_1)) - sqrt(x))); else tmp = Float64(0.5 * Float64(sqrt(Float64(1.0 / x)) + t_1)); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 / t)) + (sqrt((1.0 / y)) + sqrt((1.0 / z)));
tmp = 0.0;
if (x <= 1.0)
tmp = 1.0 + ((0.5 * (x + t_1)) - sqrt(x));
else
tmp = 0.5 * (sqrt((1.0 / x)) + t_1);
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[Sqrt[N[(1.0 / t), $MachinePrecision]], $MachinePrecision] + N[(N[Sqrt[N[(1.0 / y), $MachinePrecision]], $MachinePrecision] + N[Sqrt[N[(1.0 / z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, 1.0], N[(1.0 + N[(N[(0.5 * N[(x + t$95$1), $MachinePrecision]), $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.5 * N[(N[Sqrt[N[(1.0 / x), $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{\frac{1}{t}} + \left(\sqrt{\frac{1}{y}} + \sqrt{\frac{1}{z}}\right)\\
\mathbf{if}\;x \leq 1:\\
\;\;\;\;1 + \left(0.5 \cdot \left(x + t\_1\right) - \sqrt{x}\right)\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \left(\sqrt{\frac{1}{x}} + t\_1\right)\\
\end{array}
\end{array}
if x < 1Initial program 97.5%
Taylor expanded in t around inf 17.7%
associate--l+30.4%
Simplified30.4%
Taylor expanded in z around inf 27.0%
associate--l+27.0%
distribute-lft-out27.0%
+-commutative27.0%
Simplified27.0%
Taylor expanded in y around inf 14.3%
distribute-lft-out14.3%
+-commutative14.3%
Simplified14.3%
Taylor expanded in x around 0 13.9%
associate--l+13.9%
distribute-lft-out13.9%
+-commutative13.9%
Simplified13.9%
if 1 < x Initial program 85.3%
Taylor expanded in t around inf 3.8%
associate--l+5.1%
Simplified5.1%
Taylor expanded in z around inf 5.4%
associate--l+5.4%
distribute-lft-out5.4%
+-commutative5.4%
Simplified5.4%
Taylor expanded in y around inf 4.6%
distribute-lft-out4.6%
+-commutative4.6%
Simplified4.6%
Taylor expanded in x around inf 19.0%
distribute-lft-out19.0%
+-commutative19.0%
Simplified19.0%
Final simplification16.2%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (* 0.5 (+ (sqrt (/ 1.0 x)) (+ (sqrt (/ 1.0 t)) (+ (sqrt (/ 1.0 y)) (sqrt (/ 1.0 z)))))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
return 0.5 * (sqrt((1.0 / x)) + (sqrt((1.0 / t)) + (sqrt((1.0 / y)) + sqrt((1.0 / 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 = 0.5d0 * (sqrt((1.0d0 / x)) + (sqrt((1.0d0 / t)) + (sqrt((1.0d0 / y)) + sqrt((1.0d0 / z)))))
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
return 0.5 * (Math.sqrt((1.0 / x)) + (Math.sqrt((1.0 / t)) + (Math.sqrt((1.0 / y)) + Math.sqrt((1.0 / z)))));
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): return 0.5 * (math.sqrt((1.0 / x)) + (math.sqrt((1.0 / t)) + (math.sqrt((1.0 / y)) + math.sqrt((1.0 / z)))))
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) return Float64(0.5 * Float64(sqrt(Float64(1.0 / x)) + Float64(sqrt(Float64(1.0 / t)) + Float64(sqrt(Float64(1.0 / y)) + sqrt(Float64(1.0 / z)))))) end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp = code(x, y, z, t)
tmp = 0.5 * (sqrt((1.0 / x)) + (sqrt((1.0 / t)) + (sqrt((1.0 / y)) + sqrt((1.0 / z)))));
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := N[(0.5 * N[(N[Sqrt[N[(1.0 / x), $MachinePrecision]], $MachinePrecision] + N[(N[Sqrt[N[(1.0 / t), $MachinePrecision]], $MachinePrecision] + N[(N[Sqrt[N[(1.0 / y), $MachinePrecision]], $MachinePrecision] + N[Sqrt[N[(1.0 / z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
0.5 \cdot \left(\sqrt{\frac{1}{x}} + \left(\sqrt{\frac{1}{t}} + \left(\sqrt{\frac{1}{y}} + \sqrt{\frac{1}{z}}\right)\right)\right)
\end{array}
Initial program 92.0%
Taylor expanded in t around inf 11.4%
associate--l+19.0%
Simplified19.0%
Taylor expanded in z around inf 17.2%
associate--l+17.2%
distribute-lft-out17.2%
+-commutative17.2%
Simplified17.2%
Taylor expanded in y around inf 9.9%
distribute-lft-out9.9%
+-commutative9.9%
Simplified9.9%
Taylor expanded in x around inf 11.8%
distribute-lft-out11.8%
+-commutative11.8%
Simplified11.8%
Final simplification11.8%
(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 2024179
(FPCore (x y z t)
:name "Main:z from "
:precision binary64
:alt
(! :herbie-platform default (+ (+ (+ (/ 1 (+ (sqrt (+ x 1)) (sqrt x))) (/ 1 (+ (sqrt (+ y 1)) (sqrt y)))) (/ 1 (+ (sqrt (+ z 1)) (sqrt z)))) (- (sqrt (+ t 1)) (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))))