
(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 (+ t 1.0)))
(t_2 (sqrt (+ x 1.0)))
(t_3 (sqrt (+ z 1.0)))
(t_4
(-
(+ (- t_2 (sqrt x)) (- (sqrt (+ y 1.0)) (sqrt y)))
(- (sqrt z) t_3))))
(if (<= t_4 1.00005)
(+
(/ 1.0 (+ t_2 (sqrt x)))
(+ (* 0.5 (sqrt (/ 1.0 y))) (+ t_1 (- (- t_3 (sqrt z)) (sqrt t)))))
(+ t_4 (- t_1 (sqrt t))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((t + 1.0));
double t_2 = sqrt((x + 1.0));
double t_3 = sqrt((z + 1.0));
double t_4 = ((t_2 - sqrt(x)) + (sqrt((y + 1.0)) - sqrt(y))) - (sqrt(z) - t_3);
double tmp;
if (t_4 <= 1.00005) {
tmp = (1.0 / (t_2 + sqrt(x))) + ((0.5 * sqrt((1.0 / y))) + (t_1 + ((t_3 - sqrt(z)) - sqrt(t))));
} else {
tmp = t_4 + (t_1 - sqrt(t));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: tmp
t_1 = sqrt((t + 1.0d0))
t_2 = sqrt((x + 1.0d0))
t_3 = sqrt((z + 1.0d0))
t_4 = ((t_2 - sqrt(x)) + (sqrt((y + 1.0d0)) - sqrt(y))) - (sqrt(z) - t_3)
if (t_4 <= 1.00005d0) then
tmp = (1.0d0 / (t_2 + sqrt(x))) + ((0.5d0 * sqrt((1.0d0 / y))) + (t_1 + ((t_3 - sqrt(z)) - sqrt(t))))
else
tmp = t_4 + (t_1 - sqrt(t))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((t + 1.0));
double t_2 = Math.sqrt((x + 1.0));
double t_3 = Math.sqrt((z + 1.0));
double t_4 = ((t_2 - Math.sqrt(x)) + (Math.sqrt((y + 1.0)) - Math.sqrt(y))) - (Math.sqrt(z) - t_3);
double tmp;
if (t_4 <= 1.00005) {
tmp = (1.0 / (t_2 + Math.sqrt(x))) + ((0.5 * Math.sqrt((1.0 / y))) + (t_1 + ((t_3 - Math.sqrt(z)) - Math.sqrt(t))));
} else {
tmp = t_4 + (t_1 - Math.sqrt(t));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((t + 1.0)) t_2 = math.sqrt((x + 1.0)) t_3 = math.sqrt((z + 1.0)) t_4 = ((t_2 - math.sqrt(x)) + (math.sqrt((y + 1.0)) - math.sqrt(y))) - (math.sqrt(z) - t_3) tmp = 0 if t_4 <= 1.00005: tmp = (1.0 / (t_2 + math.sqrt(x))) + ((0.5 * math.sqrt((1.0 / y))) + (t_1 + ((t_3 - math.sqrt(z)) - math.sqrt(t)))) else: tmp = t_4 + (t_1 - math.sqrt(t)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(t + 1.0)) t_2 = sqrt(Float64(x + 1.0)) t_3 = sqrt(Float64(z + 1.0)) t_4 = Float64(Float64(Float64(t_2 - sqrt(x)) + Float64(sqrt(Float64(y + 1.0)) - sqrt(y))) - Float64(sqrt(z) - t_3)) tmp = 0.0 if (t_4 <= 1.00005) tmp = Float64(Float64(1.0 / Float64(t_2 + sqrt(x))) + Float64(Float64(0.5 * sqrt(Float64(1.0 / y))) + Float64(t_1 + Float64(Float64(t_3 - sqrt(z)) - sqrt(t))))); else tmp = Float64(t_4 + Float64(t_1 - sqrt(t))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((t + 1.0));
t_2 = sqrt((x + 1.0));
t_3 = sqrt((z + 1.0));
t_4 = ((t_2 - sqrt(x)) + (sqrt((y + 1.0)) - sqrt(y))) - (sqrt(z) - t_3);
tmp = 0.0;
if (t_4 <= 1.00005)
tmp = (1.0 / (t_2 + sqrt(x))) + ((0.5 * sqrt((1.0 / y))) + (t_1 + ((t_3 - sqrt(z)) - sqrt(t))));
else
tmp = t_4 + (t_1 - sqrt(t));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(t + 1.0), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[Sqrt[N[(z + 1.0), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$4 = N[(N[(N[(t$95$2 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[z], $MachinePrecision] - t$95$3), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$4, 1.00005], N[(N[(1.0 / N[(t$95$2 + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(0.5 * N[Sqrt[N[(1.0 / y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(t$95$1 + N[(N[(t$95$3 - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$4 + N[(t$95$1 - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{t + 1}\\
t_2 := \sqrt{x + 1}\\
t_3 := \sqrt{z + 1}\\
t_4 := \left(\left(t\_2 - \sqrt{x}\right) + \left(\sqrt{y + 1} - \sqrt{y}\right)\right) - \left(\sqrt{z} - t\_3\right)\\
\mathbf{if}\;t\_4 \leq 1.00005:\\
\;\;\;\;\frac{1}{t\_2 + \sqrt{x}} + \left(0.5 \cdot \sqrt{\frac{1}{y}} + \left(t\_1 + \left(\left(t\_3 - \sqrt{z}\right) - \sqrt{t}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_4 + \left(t\_1 - \sqrt{t}\right)\\
\end{array}
\end{array}
if (+.f64 (+.f64 (-.f64 (sqrt.f64 (+.f64 x #s(literal 1 binary64))) (sqrt.f64 x)) (-.f64 (sqrt.f64 (+.f64 y #s(literal 1 binary64))) (sqrt.f64 y))) (-.f64 (sqrt.f64 (+.f64 z #s(literal 1 binary64))) (sqrt.f64 z))) < 1.00005000000000011Initial program 86.7%
associate-+l+86.7%
associate-+l+86.7%
+-commutative86.7%
+-commutative86.7%
associate-+l-79.1%
+-commutative79.1%
+-commutative79.1%
Simplified79.1%
flip--79.1%
add-sqr-sqrt48.2%
+-commutative48.2%
add-sqr-sqrt79.3%
+-commutative79.3%
Applied egg-rr79.3%
associate--l+81.1%
+-inverses81.1%
metadata-eval81.1%
Simplified81.1%
Taylor expanded in y around inf 65.8%
if 1.00005000000000011 < (+.f64 (+.f64 (-.f64 (sqrt.f64 (+.f64 x #s(literal 1 binary64))) (sqrt.f64 x)) (-.f64 (sqrt.f64 (+.f64 y #s(literal 1 binary64))) (sqrt.f64 y))) (-.f64 (sqrt.f64 (+.f64 z #s(literal 1 binary64))) (sqrt.f64 z))) Initial program 97.4%
Final simplification81.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 (+ y 1.0))) (t_2 (sqrt (+ t 1.0))))
(if (<= z 2.9e+21)
(+
t_1
(+
(+ (sqrt (+ z 1.0)) (- (- (sqrt (+ x 1.0)) (sqrt x)) (sqrt z)))
(- (- t_2 (sqrt t)) (sqrt y))))
(+
(/ 1.0 (+ (hypot 1.0 (sqrt x)) (sqrt x)))
(- (- t_1 (sqrt y)) (- (sqrt t) t_2))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((y + 1.0));
double t_2 = sqrt((t + 1.0));
double tmp;
if (z <= 2.9e+21) {
tmp = t_1 + ((sqrt((z + 1.0)) + ((sqrt((x + 1.0)) - sqrt(x)) - sqrt(z))) + ((t_2 - sqrt(t)) - sqrt(y)));
} else {
tmp = (1.0 / (hypot(1.0, sqrt(x)) + sqrt(x))) + ((t_1 - sqrt(y)) - (sqrt(t) - t_2));
}
return tmp;
}
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((y + 1.0));
double t_2 = Math.sqrt((t + 1.0));
double tmp;
if (z <= 2.9e+21) {
tmp = t_1 + ((Math.sqrt((z + 1.0)) + ((Math.sqrt((x + 1.0)) - Math.sqrt(x)) - Math.sqrt(z))) + ((t_2 - Math.sqrt(t)) - Math.sqrt(y)));
} else {
tmp = (1.0 / (Math.hypot(1.0, Math.sqrt(x)) + Math.sqrt(x))) + ((t_1 - Math.sqrt(y)) - (Math.sqrt(t) - t_2));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((y + 1.0)) t_2 = math.sqrt((t + 1.0)) tmp = 0 if z <= 2.9e+21: tmp = t_1 + ((math.sqrt((z + 1.0)) + ((math.sqrt((x + 1.0)) - math.sqrt(x)) - math.sqrt(z))) + ((t_2 - math.sqrt(t)) - math.sqrt(y))) else: tmp = (1.0 / (math.hypot(1.0, math.sqrt(x)) + math.sqrt(x))) + ((t_1 - math.sqrt(y)) - (math.sqrt(t) - t_2)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(y + 1.0)) t_2 = sqrt(Float64(t + 1.0)) tmp = 0.0 if (z <= 2.9e+21) tmp = Float64(t_1 + Float64(Float64(sqrt(Float64(z + 1.0)) + Float64(Float64(sqrt(Float64(x + 1.0)) - sqrt(x)) - sqrt(z))) + Float64(Float64(t_2 - sqrt(t)) - sqrt(y)))); else tmp = Float64(Float64(1.0 / Float64(hypot(1.0, sqrt(x)) + sqrt(x))) + Float64(Float64(t_1 - sqrt(y)) - Float64(sqrt(t) - 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((y + 1.0));
t_2 = sqrt((t + 1.0));
tmp = 0.0;
if (z <= 2.9e+21)
tmp = t_1 + ((sqrt((z + 1.0)) + ((sqrt((x + 1.0)) - sqrt(x)) - sqrt(z))) + ((t_2 - sqrt(t)) - sqrt(y)));
else
tmp = (1.0 / (hypot(1.0, sqrt(x)) + sqrt(x))) + ((t_1 - sqrt(y)) - (sqrt(t) - 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[(y + 1.0), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(t + 1.0), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[z, 2.9e+21], N[(t$95$1 + N[(N[(N[Sqrt[N[(z + 1.0), $MachinePrecision]], $MachinePrecision] + N[(N[(N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$2 - N[Sqrt[t], $MachinePrecision]), $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[(N[Sqrt[1.0 ^ 2 + N[Sqrt[x], $MachinePrecision] ^ 2], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$1 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[t], $MachinePrecision] - t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{y + 1}\\
t_2 := \sqrt{t + 1}\\
\mathbf{if}\;z \leq 2.9 \cdot 10^{+21}:\\
\;\;\;\;t\_1 + \left(\left(\sqrt{z + 1} + \left(\left(\sqrt{x + 1} - \sqrt{x}\right) - \sqrt{z}\right)\right) + \left(\left(t\_2 - \sqrt{t}\right) - \sqrt{y}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\mathsf{hypot}\left(1, \sqrt{x}\right) + \sqrt{x}} + \left(\left(t\_1 - \sqrt{y}\right) - \left(\sqrt{t} - t\_2\right)\right)\\
\end{array}
\end{array}
if z < 2.9e21Initial program 96.6%
+-commutative96.6%
associate-+r+96.6%
associate-+r-73.9%
associate-+l-62.2%
associate-+r-47.1%
Simplified47.1%
if 2.9e21 < z Initial program 87.6%
associate-+l+87.6%
associate-+l+87.6%
+-commutative87.6%
+-commutative87.6%
associate-+l-87.6%
+-commutative87.6%
+-commutative87.6%
Simplified87.6%
flip--87.6%
add-sqr-sqrt63.9%
+-commutative63.9%
add-sqr-sqrt87.8%
+-commutative87.8%
Applied egg-rr87.8%
associate--l+89.3%
+-inverses89.3%
metadata-eval89.3%
Simplified89.3%
add-sqr-sqrt89.3%
hypot-1-def89.3%
Applied egg-rr89.3%
Taylor expanded in z around inf 89.3%
+-commutative89.3%
Simplified89.3%
Final simplification67.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 (+ t 1.0))))
(if (<= z 5.4e-34)
(+ 3.0 (- t_1 (+ (+ (sqrt y) (sqrt z)) (+ (sqrt t) (sqrt x)))))
(if (<= z 2.9e+21)
(+
(- 1.0 (sqrt x))
(+
(- 1.0 (sqrt y))
(+ (sqrt (+ z 1.0)) (- (* 0.5 (sqrt (/ 1.0 t))) (sqrt z)))))
(+
(/ 1.0 (+ (hypot 1.0 (sqrt x)) (sqrt x)))
(- (- (sqrt (+ y 1.0)) (sqrt y)) (- (sqrt t) t_1)))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((t + 1.0));
double tmp;
if (z <= 5.4e-34) {
tmp = 3.0 + (t_1 - ((sqrt(y) + sqrt(z)) + (sqrt(t) + sqrt(x))));
} else if (z <= 2.9e+21) {
tmp = (1.0 - sqrt(x)) + ((1.0 - sqrt(y)) + (sqrt((z + 1.0)) + ((0.5 * sqrt((1.0 / t))) - sqrt(z))));
} else {
tmp = (1.0 / (hypot(1.0, sqrt(x)) + sqrt(x))) + ((sqrt((y + 1.0)) - sqrt(y)) - (sqrt(t) - t_1));
}
return tmp;
}
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((t + 1.0));
double tmp;
if (z <= 5.4e-34) {
tmp = 3.0 + (t_1 - ((Math.sqrt(y) + Math.sqrt(z)) + (Math.sqrt(t) + Math.sqrt(x))));
} else if (z <= 2.9e+21) {
tmp = (1.0 - Math.sqrt(x)) + ((1.0 - Math.sqrt(y)) + (Math.sqrt((z + 1.0)) + ((0.5 * Math.sqrt((1.0 / t))) - Math.sqrt(z))));
} else {
tmp = (1.0 / (Math.hypot(1.0, Math.sqrt(x)) + Math.sqrt(x))) + ((Math.sqrt((y + 1.0)) - Math.sqrt(y)) - (Math.sqrt(t) - t_1));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((t + 1.0)) tmp = 0 if z <= 5.4e-34: tmp = 3.0 + (t_1 - ((math.sqrt(y) + math.sqrt(z)) + (math.sqrt(t) + math.sqrt(x)))) elif z <= 2.9e+21: tmp = (1.0 - math.sqrt(x)) + ((1.0 - math.sqrt(y)) + (math.sqrt((z + 1.0)) + ((0.5 * math.sqrt((1.0 / t))) - math.sqrt(z)))) else: tmp = (1.0 / (math.hypot(1.0, math.sqrt(x)) + math.sqrt(x))) + ((math.sqrt((y + 1.0)) - math.sqrt(y)) - (math.sqrt(t) - t_1)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(t + 1.0)) tmp = 0.0 if (z <= 5.4e-34) tmp = Float64(3.0 + Float64(t_1 - Float64(Float64(sqrt(y) + sqrt(z)) + Float64(sqrt(t) + sqrt(x))))); elseif (z <= 2.9e+21) tmp = Float64(Float64(1.0 - sqrt(x)) + Float64(Float64(1.0 - sqrt(y)) + Float64(sqrt(Float64(z + 1.0)) + Float64(Float64(0.5 * sqrt(Float64(1.0 / t))) - sqrt(z))))); else tmp = Float64(Float64(1.0 / Float64(hypot(1.0, sqrt(x)) + sqrt(x))) + Float64(Float64(sqrt(Float64(y + 1.0)) - sqrt(y)) - Float64(sqrt(t) - 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((t + 1.0));
tmp = 0.0;
if (z <= 5.4e-34)
tmp = 3.0 + (t_1 - ((sqrt(y) + sqrt(z)) + (sqrt(t) + sqrt(x))));
elseif (z <= 2.9e+21)
tmp = (1.0 - sqrt(x)) + ((1.0 - sqrt(y)) + (sqrt((z + 1.0)) + ((0.5 * sqrt((1.0 / t))) - sqrt(z))));
else
tmp = (1.0 / (hypot(1.0, sqrt(x)) + sqrt(x))) + ((sqrt((y + 1.0)) - sqrt(y)) - (sqrt(t) - t_1));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(t + 1.0), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[z, 5.4e-34], N[(3.0 + N[(t$95$1 - N[(N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[t], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.9e+21], N[(N[(1.0 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(z + 1.0), $MachinePrecision]], $MachinePrecision] + N[(N[(0.5 * N[Sqrt[N[(1.0 / t), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[(N[Sqrt[1.0 ^ 2 + N[Sqrt[x], $MachinePrecision] ^ 2], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[t], $MachinePrecision] - t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{t + 1}\\
\mathbf{if}\;z \leq 5.4 \cdot 10^{-34}:\\
\;\;\;\;3 + \left(t\_1 - \left(\left(\sqrt{y} + \sqrt{z}\right) + \left(\sqrt{t} + \sqrt{x}\right)\right)\right)\\
\mathbf{elif}\;z \leq 2.9 \cdot 10^{+21}:\\
\;\;\;\;\left(1 - \sqrt{x}\right) + \left(\left(1 - \sqrt{y}\right) + \left(\sqrt{z + 1} + \left(0.5 \cdot \sqrt{\frac{1}{t}} - \sqrt{z}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\mathsf{hypot}\left(1, \sqrt{x}\right) + \sqrt{x}} + \left(\left(\sqrt{y + 1} - \sqrt{y}\right) - \left(\sqrt{t} - t\_1\right)\right)\\
\end{array}
\end{array}
if z < 5.40000000000000034e-34Initial program 97.6%
associate-+l+97.6%
associate-+l+97.6%
+-commutative97.6%
+-commutative97.6%
associate-+l-65.2%
+-commutative65.2%
+-commutative65.2%
Simplified65.2%
Taylor expanded in y around 0 30.7%
Taylor expanded in x around 0 15.1%
Taylor expanded in z around 0 14.0%
associate--l+22.8%
associate-+r+22.8%
Simplified22.8%
if 5.40000000000000034e-34 < z < 2.9e21Initial program 91.2%
associate-+l+91.2%
associate-+l+91.2%
+-commutative91.2%
+-commutative91.2%
associate-+l-54.5%
+-commutative54.5%
+-commutative54.5%
Simplified54.5%
Taylor expanded in y around 0 19.0%
Taylor expanded in x around 0 7.8%
Taylor expanded in t around inf 12.0%
associate--l+12.0%
Simplified12.0%
if 2.9e21 < z Initial program 87.6%
associate-+l+87.6%
associate-+l+87.6%
+-commutative87.6%
+-commutative87.6%
associate-+l-87.6%
+-commutative87.6%
+-commutative87.6%
Simplified87.6%
flip--87.6%
add-sqr-sqrt63.9%
+-commutative63.9%
add-sqr-sqrt87.8%
+-commutative87.8%
Applied egg-rr87.8%
associate--l+89.3%
+-inverses89.3%
metadata-eval89.3%
Simplified89.3%
add-sqr-sqrt89.3%
hypot-1-def89.3%
Applied egg-rr89.3%
Taylor expanded in z around inf 89.3%
+-commutative89.3%
Simplified89.3%
Final simplification54.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 (+ t 1.0))) (t_2 (sqrt (+ y 1.0))))
(if (<= z 2.9e+21)
(+
t_2
(+
(- (+ (sqrt (+ z 1.0)) (- 1.0 (sqrt x))) (sqrt z))
(- (- t_1 (sqrt t)) (sqrt y))))
(+
(/ 1.0 (+ (hypot 1.0 (sqrt x)) (sqrt x)))
(- (- t_2 (sqrt y)) (- (sqrt t) t_1))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((t + 1.0));
double t_2 = sqrt((y + 1.0));
double tmp;
if (z <= 2.9e+21) {
tmp = t_2 + (((sqrt((z + 1.0)) + (1.0 - sqrt(x))) - sqrt(z)) + ((t_1 - sqrt(t)) - sqrt(y)));
} else {
tmp = (1.0 / (hypot(1.0, sqrt(x)) + sqrt(x))) + ((t_2 - sqrt(y)) - (sqrt(t) - t_1));
}
return tmp;
}
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((t + 1.0));
double t_2 = Math.sqrt((y + 1.0));
double tmp;
if (z <= 2.9e+21) {
tmp = t_2 + (((Math.sqrt((z + 1.0)) + (1.0 - Math.sqrt(x))) - Math.sqrt(z)) + ((t_1 - Math.sqrt(t)) - Math.sqrt(y)));
} else {
tmp = (1.0 / (Math.hypot(1.0, Math.sqrt(x)) + Math.sqrt(x))) + ((t_2 - Math.sqrt(y)) - (Math.sqrt(t) - t_1));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((t + 1.0)) t_2 = math.sqrt((y + 1.0)) tmp = 0 if z <= 2.9e+21: tmp = t_2 + (((math.sqrt((z + 1.0)) + (1.0 - math.sqrt(x))) - math.sqrt(z)) + ((t_1 - math.sqrt(t)) - math.sqrt(y))) else: tmp = (1.0 / (math.hypot(1.0, math.sqrt(x)) + math.sqrt(x))) + ((t_2 - math.sqrt(y)) - (math.sqrt(t) - t_1)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(t + 1.0)) t_2 = sqrt(Float64(y + 1.0)) tmp = 0.0 if (z <= 2.9e+21) tmp = Float64(t_2 + Float64(Float64(Float64(sqrt(Float64(z + 1.0)) + Float64(1.0 - sqrt(x))) - sqrt(z)) + Float64(Float64(t_1 - sqrt(t)) - sqrt(y)))); else tmp = Float64(Float64(1.0 / Float64(hypot(1.0, sqrt(x)) + sqrt(x))) + Float64(Float64(t_2 - sqrt(y)) - Float64(sqrt(t) - 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((t + 1.0));
t_2 = sqrt((y + 1.0));
tmp = 0.0;
if (z <= 2.9e+21)
tmp = t_2 + (((sqrt((z + 1.0)) + (1.0 - sqrt(x))) - sqrt(z)) + ((t_1 - sqrt(t)) - sqrt(y)));
else
tmp = (1.0 / (hypot(1.0, sqrt(x)) + sqrt(x))) + ((t_2 - sqrt(y)) - (sqrt(t) - t_1));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(t + 1.0), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[z, 2.9e+21], N[(t$95$2 + N[(N[(N[(N[Sqrt[N[(z + 1.0), $MachinePrecision]], $MachinePrecision] + N[(1.0 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$1 - N[Sqrt[t], $MachinePrecision]), $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[(N[Sqrt[1.0 ^ 2 + N[Sqrt[x], $MachinePrecision] ^ 2], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$2 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[t], $MachinePrecision] - t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{t + 1}\\
t_2 := \sqrt{y + 1}\\
\mathbf{if}\;z \leq 2.9 \cdot 10^{+21}:\\
\;\;\;\;t\_2 + \left(\left(\left(\sqrt{z + 1} + \left(1 - \sqrt{x}\right)\right) - \sqrt{z}\right) + \left(\left(t\_1 - \sqrt{t}\right) - \sqrt{y}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\mathsf{hypot}\left(1, \sqrt{x}\right) + \sqrt{x}} + \left(\left(t\_2 - \sqrt{y}\right) - \left(\sqrt{t} - t\_1\right)\right)\\
\end{array}
\end{array}
if z < 2.9e21Initial program 96.6%
+-commutative96.6%
associate-+r+96.6%
associate-+r-73.9%
associate-+l-62.2%
associate-+r-47.1%
Simplified47.1%
Taylor expanded in x around 0 23.2%
associate--r+23.2%
+-commutative23.2%
associate--l+23.2%
Simplified23.2%
if 2.9e21 < z Initial program 87.6%
associate-+l+87.6%
associate-+l+87.6%
+-commutative87.6%
+-commutative87.6%
associate-+l-87.6%
+-commutative87.6%
+-commutative87.6%
Simplified87.6%
flip--87.6%
add-sqr-sqrt63.9%
+-commutative63.9%
add-sqr-sqrt87.8%
+-commutative87.8%
Applied egg-rr87.8%
associate--l+89.3%
+-inverses89.3%
metadata-eval89.3%
Simplified89.3%
add-sqr-sqrt89.3%
hypot-1-def89.3%
Applied egg-rr89.3%
Taylor expanded in z around inf 89.3%
+-commutative89.3%
Simplified89.3%
Final simplification55.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 (+ t 1.0))))
(if (<= z 5.4e-34)
(+ 3.0 (- t_1 (+ (+ (sqrt y) (sqrt z)) (+ (sqrt t) (sqrt x)))))
(if (<= z 2.9e+21)
(+
(- 1.0 (sqrt x))
(+
(- 1.0 (sqrt y))
(+ (sqrt (+ z 1.0)) (- (* 0.5 (sqrt (/ 1.0 t))) (sqrt z)))))
(+
(/ 1.0 (+ (sqrt (+ x 1.0)) (sqrt x)))
(- (- (sqrt (+ y 1.0)) (sqrt y)) (- (sqrt t) t_1)))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((t + 1.0));
double tmp;
if (z <= 5.4e-34) {
tmp = 3.0 + (t_1 - ((sqrt(y) + sqrt(z)) + (sqrt(t) + sqrt(x))));
} else if (z <= 2.9e+21) {
tmp = (1.0 - sqrt(x)) + ((1.0 - sqrt(y)) + (sqrt((z + 1.0)) + ((0.5 * sqrt((1.0 / t))) - sqrt(z))));
} else {
tmp = (1.0 / (sqrt((x + 1.0)) + sqrt(x))) + ((sqrt((y + 1.0)) - sqrt(y)) - (sqrt(t) - 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((t + 1.0d0))
if (z <= 5.4d-34) then
tmp = 3.0d0 + (t_1 - ((sqrt(y) + sqrt(z)) + (sqrt(t) + sqrt(x))))
else if (z <= 2.9d+21) then
tmp = (1.0d0 - sqrt(x)) + ((1.0d0 - sqrt(y)) + (sqrt((z + 1.0d0)) + ((0.5d0 * sqrt((1.0d0 / t))) - sqrt(z))))
else
tmp = (1.0d0 / (sqrt((x + 1.0d0)) + sqrt(x))) + ((sqrt((y + 1.0d0)) - sqrt(y)) - (sqrt(t) - 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((t + 1.0));
double tmp;
if (z <= 5.4e-34) {
tmp = 3.0 + (t_1 - ((Math.sqrt(y) + Math.sqrt(z)) + (Math.sqrt(t) + Math.sqrt(x))));
} else if (z <= 2.9e+21) {
tmp = (1.0 - Math.sqrt(x)) + ((1.0 - Math.sqrt(y)) + (Math.sqrt((z + 1.0)) + ((0.5 * Math.sqrt((1.0 / t))) - Math.sqrt(z))));
} else {
tmp = (1.0 / (Math.sqrt((x + 1.0)) + Math.sqrt(x))) + ((Math.sqrt((y + 1.0)) - Math.sqrt(y)) - (Math.sqrt(t) - t_1));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((t + 1.0)) tmp = 0 if z <= 5.4e-34: tmp = 3.0 + (t_1 - ((math.sqrt(y) + math.sqrt(z)) + (math.sqrt(t) + math.sqrt(x)))) elif z <= 2.9e+21: tmp = (1.0 - math.sqrt(x)) + ((1.0 - math.sqrt(y)) + (math.sqrt((z + 1.0)) + ((0.5 * math.sqrt((1.0 / t))) - math.sqrt(z)))) else: tmp = (1.0 / (math.sqrt((x + 1.0)) + math.sqrt(x))) + ((math.sqrt((y + 1.0)) - math.sqrt(y)) - (math.sqrt(t) - t_1)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(t + 1.0)) tmp = 0.0 if (z <= 5.4e-34) tmp = Float64(3.0 + Float64(t_1 - Float64(Float64(sqrt(y) + sqrt(z)) + Float64(sqrt(t) + sqrt(x))))); elseif (z <= 2.9e+21) tmp = Float64(Float64(1.0 - sqrt(x)) + Float64(Float64(1.0 - sqrt(y)) + Float64(sqrt(Float64(z + 1.0)) + Float64(Float64(0.5 * sqrt(Float64(1.0 / t))) - sqrt(z))))); else tmp = Float64(Float64(1.0 / Float64(sqrt(Float64(x + 1.0)) + sqrt(x))) + Float64(Float64(sqrt(Float64(y + 1.0)) - sqrt(y)) - Float64(sqrt(t) - 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((t + 1.0));
tmp = 0.0;
if (z <= 5.4e-34)
tmp = 3.0 + (t_1 - ((sqrt(y) + sqrt(z)) + (sqrt(t) + sqrt(x))));
elseif (z <= 2.9e+21)
tmp = (1.0 - sqrt(x)) + ((1.0 - sqrt(y)) + (sqrt((z + 1.0)) + ((0.5 * sqrt((1.0 / t))) - sqrt(z))));
else
tmp = (1.0 / (sqrt((x + 1.0)) + sqrt(x))) + ((sqrt((y + 1.0)) - sqrt(y)) - (sqrt(t) - t_1));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(t + 1.0), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[z, 5.4e-34], N[(3.0 + N[(t$95$1 - N[(N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[t], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.9e+21], N[(N[(1.0 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(z + 1.0), $MachinePrecision]], $MachinePrecision] + N[(N[(0.5 * N[Sqrt[N[(1.0 / t), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[(N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[t], $MachinePrecision] - t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{t + 1}\\
\mathbf{if}\;z \leq 5.4 \cdot 10^{-34}:\\
\;\;\;\;3 + \left(t\_1 - \left(\left(\sqrt{y} + \sqrt{z}\right) + \left(\sqrt{t} + \sqrt{x}\right)\right)\right)\\
\mathbf{elif}\;z \leq 2.9 \cdot 10^{+21}:\\
\;\;\;\;\left(1 - \sqrt{x}\right) + \left(\left(1 - \sqrt{y}\right) + \left(\sqrt{z + 1} + \left(0.5 \cdot \sqrt{\frac{1}{t}} - \sqrt{z}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{x + 1} + \sqrt{x}} + \left(\left(\sqrt{y + 1} - \sqrt{y}\right) - \left(\sqrt{t} - t\_1\right)\right)\\
\end{array}
\end{array}
if z < 5.40000000000000034e-34Initial program 97.6%
associate-+l+97.6%
associate-+l+97.6%
+-commutative97.6%
+-commutative97.6%
associate-+l-65.2%
+-commutative65.2%
+-commutative65.2%
Simplified65.2%
Taylor expanded in y around 0 30.7%
Taylor expanded in x around 0 15.1%
Taylor expanded in z around 0 14.0%
associate--l+22.8%
associate-+r+22.8%
Simplified22.8%
if 5.40000000000000034e-34 < z < 2.9e21Initial program 91.2%
associate-+l+91.2%
associate-+l+91.2%
+-commutative91.2%
+-commutative91.2%
associate-+l-54.5%
+-commutative54.5%
+-commutative54.5%
Simplified54.5%
Taylor expanded in y around 0 19.0%
Taylor expanded in x around 0 7.8%
Taylor expanded in t around inf 12.0%
associate--l+12.0%
Simplified12.0%
if 2.9e21 < z Initial program 87.6%
associate-+l+87.6%
associate-+l+87.6%
+-commutative87.6%
+-commutative87.6%
associate-+l-87.6%
+-commutative87.6%
+-commutative87.6%
Simplified87.6%
flip--87.6%
add-sqr-sqrt63.9%
+-commutative63.9%
add-sqr-sqrt87.8%
+-commutative87.8%
Applied egg-rr87.8%
associate--l+89.3%
+-inverses89.3%
metadata-eval89.3%
Simplified89.3%
Taylor expanded in z around inf 89.3%
+-commutative89.3%
Simplified89.3%
Final simplification54.7%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(if (<= z 5.4e-34)
(+ 3.0 (- (sqrt (+ t 1.0)) (+ (+ (sqrt y) (sqrt z)) (+ (sqrt t) (sqrt x)))))
(if (<= z 490000.0)
(+
(- 1.0 (sqrt x))
(+
(- 1.0 (sqrt y))
(+ (sqrt (+ z 1.0)) (- (* 0.5 (sqrt (/ 1.0 t))) (sqrt z)))))
(+
(+
(sqrt (+ x 1.0))
(* x (- (/ (- (sqrt (+ y 1.0)) (sqrt y)) x) (sqrt (/ 1.0 x)))))
(* 0.5 (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 <= 5.4e-34) {
tmp = 3.0 + (sqrt((t + 1.0)) - ((sqrt(y) + sqrt(z)) + (sqrt(t) + sqrt(x))));
} else if (z <= 490000.0) {
tmp = (1.0 - sqrt(x)) + ((1.0 - sqrt(y)) + (sqrt((z + 1.0)) + ((0.5 * sqrt((1.0 / t))) - sqrt(z))));
} else {
tmp = (sqrt((x + 1.0)) + (x * (((sqrt((y + 1.0)) - sqrt(y)) / x) - sqrt((1.0 / x))))) + (0.5 * 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 <= 5.4d-34) then
tmp = 3.0d0 + (sqrt((t + 1.0d0)) - ((sqrt(y) + sqrt(z)) + (sqrt(t) + sqrt(x))))
else if (z <= 490000.0d0) then
tmp = (1.0d0 - sqrt(x)) + ((1.0d0 - sqrt(y)) + (sqrt((z + 1.0d0)) + ((0.5d0 * sqrt((1.0d0 / t))) - sqrt(z))))
else
tmp = (sqrt((x + 1.0d0)) + (x * (((sqrt((y + 1.0d0)) - sqrt(y)) / x) - sqrt((1.0d0 / x))))) + (0.5d0 * 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 <= 5.4e-34) {
tmp = 3.0 + (Math.sqrt((t + 1.0)) - ((Math.sqrt(y) + Math.sqrt(z)) + (Math.sqrt(t) + Math.sqrt(x))));
} else if (z <= 490000.0) {
tmp = (1.0 - Math.sqrt(x)) + ((1.0 - Math.sqrt(y)) + (Math.sqrt((z + 1.0)) + ((0.5 * Math.sqrt((1.0 / t))) - Math.sqrt(z))));
} else {
tmp = (Math.sqrt((x + 1.0)) + (x * (((Math.sqrt((y + 1.0)) - Math.sqrt(y)) / x) - Math.sqrt((1.0 / x))))) + (0.5 * 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 <= 5.4e-34: tmp = 3.0 + (math.sqrt((t + 1.0)) - ((math.sqrt(y) + math.sqrt(z)) + (math.sqrt(t) + math.sqrt(x)))) elif z <= 490000.0: tmp = (1.0 - math.sqrt(x)) + ((1.0 - math.sqrt(y)) + (math.sqrt((z + 1.0)) + ((0.5 * math.sqrt((1.0 / t))) - math.sqrt(z)))) else: tmp = (math.sqrt((x + 1.0)) + (x * (((math.sqrt((y + 1.0)) - math.sqrt(y)) / x) - math.sqrt((1.0 / x))))) + (0.5 * 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 <= 5.4e-34) tmp = Float64(3.0 + Float64(sqrt(Float64(t + 1.0)) - Float64(Float64(sqrt(y) + sqrt(z)) + Float64(sqrt(t) + sqrt(x))))); elseif (z <= 490000.0) tmp = Float64(Float64(1.0 - sqrt(x)) + Float64(Float64(1.0 - sqrt(y)) + Float64(sqrt(Float64(z + 1.0)) + Float64(Float64(0.5 * sqrt(Float64(1.0 / t))) - sqrt(z))))); else tmp = Float64(Float64(sqrt(Float64(x + 1.0)) + Float64(x * Float64(Float64(Float64(sqrt(Float64(y + 1.0)) - sqrt(y)) / x) - sqrt(Float64(1.0 / x))))) + Float64(0.5 * 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 <= 5.4e-34)
tmp = 3.0 + (sqrt((t + 1.0)) - ((sqrt(y) + sqrt(z)) + (sqrt(t) + sqrt(x))));
elseif (z <= 490000.0)
tmp = (1.0 - sqrt(x)) + ((1.0 - sqrt(y)) + (sqrt((z + 1.0)) + ((0.5 * sqrt((1.0 / t))) - sqrt(z))));
else
tmp = (sqrt((x + 1.0)) + (x * (((sqrt((y + 1.0)) - sqrt(y)) / x) - sqrt((1.0 / x))))) + (0.5 * 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, 5.4e-34], N[(3.0 + N[(N[Sqrt[N[(t + 1.0), $MachinePrecision]], $MachinePrecision] - N[(N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[t], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 490000.0], N[(N[(1.0 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(z + 1.0), $MachinePrecision]], $MachinePrecision] + N[(N[(0.5 * N[Sqrt[N[(1.0 / t), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision] + N[(x * N[(N[(N[(N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision] - N[Sqrt[N[(1.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(0.5 * N[Sqrt[N[(1.0 / z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq 5.4 \cdot 10^{-34}:\\
\;\;\;\;3 + \left(\sqrt{t + 1} - \left(\left(\sqrt{y} + \sqrt{z}\right) + \left(\sqrt{t} + \sqrt{x}\right)\right)\right)\\
\mathbf{elif}\;z \leq 490000:\\
\;\;\;\;\left(1 - \sqrt{x}\right) + \left(\left(1 - \sqrt{y}\right) + \left(\sqrt{z + 1} + \left(0.5 \cdot \sqrt{\frac{1}{t}} - \sqrt{z}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\sqrt{x + 1} + x \cdot \left(\frac{\sqrt{y + 1} - \sqrt{y}}{x} - \sqrt{\frac{1}{x}}\right)\right) + 0.5 \cdot \sqrt{\frac{1}{z}}\\
\end{array}
\end{array}
if z < 5.40000000000000034e-34Initial program 97.6%
associate-+l+97.6%
associate-+l+97.6%
+-commutative97.6%
+-commutative97.6%
associate-+l-65.2%
+-commutative65.2%
+-commutative65.2%
Simplified65.2%
Taylor expanded in y around 0 30.7%
Taylor expanded in x around 0 15.1%
Taylor expanded in z around 0 14.0%
associate--l+22.8%
associate-+r+22.8%
Simplified22.8%
if 5.40000000000000034e-34 < z < 4.9e5Initial program 95.3%
associate-+l+95.3%
associate-+l+95.3%
+-commutative95.3%
+-commutative95.3%
associate-+l-52.8%
+-commutative52.8%
+-commutative52.8%
Simplified52.8%
Taylor expanded in y around 0 20.9%
Taylor expanded in x around 0 9.3%
Taylor expanded in t around inf 14.3%
associate--l+14.3%
Simplified14.3%
if 4.9e5 < z Initial program 87.2%
+-commutative87.2%
associate-+r+87.2%
associate-+r-70.1%
associate-+l-51.7%
associate-+r-51.6%
Simplified31.5%
Taylor expanded in t around inf 3.5%
associate--l+20.8%
+-commutative20.8%
+-commutative20.8%
Simplified20.8%
Taylor expanded in x around -inf 0.0%
mul-1-neg0.0%
*-commutative0.0%
distribute-rgt-neg-in0.0%
Simplified20.8%
Taylor expanded in z around inf 27.3%
associate-+r+30.5%
mul-1-neg30.5%
unsub-neg30.5%
mul-1-neg30.5%
unsub-neg30.5%
Simplified30.5%
Final simplification26.1%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(if (<= z 5.4e-34)
(+ 3.0 (- (sqrt (+ t 1.0)) (+ (+ (sqrt y) (sqrt z)) (+ (sqrt t) (sqrt x)))))
(if (<= z 1250000.0)
(+
(- 1.0 (sqrt x))
(+
(- 1.0 (sqrt y))
(+ (sqrt (+ z 1.0)) (- (* 0.5 (sqrt (/ 1.0 t))) (sqrt z)))))
(+
(- (+ (sqrt (+ y 1.0)) (* 0.5 (sqrt (/ 1.0 z)))) (+ (sqrt y) (sqrt x)))
1.0))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (z <= 5.4e-34) {
tmp = 3.0 + (sqrt((t + 1.0)) - ((sqrt(y) + sqrt(z)) + (sqrt(t) + sqrt(x))));
} else if (z <= 1250000.0) {
tmp = (1.0 - sqrt(x)) + ((1.0 - sqrt(y)) + (sqrt((z + 1.0)) + ((0.5 * sqrt((1.0 / t))) - sqrt(z))));
} else {
tmp = ((sqrt((y + 1.0)) + (0.5 * sqrt((1.0 / z)))) - (sqrt(y) + sqrt(x))) + 1.0;
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (z <= 5.4d-34) then
tmp = 3.0d0 + (sqrt((t + 1.0d0)) - ((sqrt(y) + sqrt(z)) + (sqrt(t) + sqrt(x))))
else if (z <= 1250000.0d0) then
tmp = (1.0d0 - sqrt(x)) + ((1.0d0 - sqrt(y)) + (sqrt((z + 1.0d0)) + ((0.5d0 * sqrt((1.0d0 / t))) - sqrt(z))))
else
tmp = ((sqrt((y + 1.0d0)) + (0.5d0 * sqrt((1.0d0 / z)))) - (sqrt(y) + sqrt(x))) + 1.0d0
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= 5.4e-34) {
tmp = 3.0 + (Math.sqrt((t + 1.0)) - ((Math.sqrt(y) + Math.sqrt(z)) + (Math.sqrt(t) + Math.sqrt(x))));
} else if (z <= 1250000.0) {
tmp = (1.0 - Math.sqrt(x)) + ((1.0 - Math.sqrt(y)) + (Math.sqrt((z + 1.0)) + ((0.5 * Math.sqrt((1.0 / t))) - Math.sqrt(z))));
} else {
tmp = ((Math.sqrt((y + 1.0)) + (0.5 * Math.sqrt((1.0 / z)))) - (Math.sqrt(y) + Math.sqrt(x))) + 1.0;
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if z <= 5.4e-34: tmp = 3.0 + (math.sqrt((t + 1.0)) - ((math.sqrt(y) + math.sqrt(z)) + (math.sqrt(t) + math.sqrt(x)))) elif z <= 1250000.0: tmp = (1.0 - math.sqrt(x)) + ((1.0 - math.sqrt(y)) + (math.sqrt((z + 1.0)) + ((0.5 * math.sqrt((1.0 / t))) - math.sqrt(z)))) else: tmp = ((math.sqrt((y + 1.0)) + (0.5 * math.sqrt((1.0 / z)))) - (math.sqrt(y) + math.sqrt(x))) + 1.0 return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (z <= 5.4e-34) tmp = Float64(3.0 + Float64(sqrt(Float64(t + 1.0)) - Float64(Float64(sqrt(y) + sqrt(z)) + Float64(sqrt(t) + sqrt(x))))); elseif (z <= 1250000.0) tmp = Float64(Float64(1.0 - sqrt(x)) + Float64(Float64(1.0 - sqrt(y)) + Float64(sqrt(Float64(z + 1.0)) + Float64(Float64(0.5 * sqrt(Float64(1.0 / t))) - sqrt(z))))); else tmp = Float64(Float64(Float64(sqrt(Float64(y + 1.0)) + Float64(0.5 * sqrt(Float64(1.0 / z)))) - Float64(sqrt(y) + sqrt(x))) + 1.0); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (z <= 5.4e-34)
tmp = 3.0 + (sqrt((t + 1.0)) - ((sqrt(y) + sqrt(z)) + (sqrt(t) + sqrt(x))));
elseif (z <= 1250000.0)
tmp = (1.0 - sqrt(x)) + ((1.0 - sqrt(y)) + (sqrt((z + 1.0)) + ((0.5 * sqrt((1.0 / t))) - sqrt(z))));
else
tmp = ((sqrt((y + 1.0)) + (0.5 * sqrt((1.0 / z)))) - (sqrt(y) + sqrt(x))) + 1.0;
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[z, 5.4e-34], N[(3.0 + N[(N[Sqrt[N[(t + 1.0), $MachinePrecision]], $MachinePrecision] - N[(N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[t], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1250000.0], N[(N[(1.0 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(z + 1.0), $MachinePrecision]], $MachinePrecision] + N[(N[(0.5 * N[Sqrt[N[(1.0 / t), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision] + N[(0.5 * N[Sqrt[N[(1.0 / z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq 5.4 \cdot 10^{-34}:\\
\;\;\;\;3 + \left(\sqrt{t + 1} - \left(\left(\sqrt{y} + \sqrt{z}\right) + \left(\sqrt{t} + \sqrt{x}\right)\right)\right)\\
\mathbf{elif}\;z \leq 1250000:\\
\;\;\;\;\left(1 - \sqrt{x}\right) + \left(\left(1 - \sqrt{y}\right) + \left(\sqrt{z + 1} + \left(0.5 \cdot \sqrt{\frac{1}{t}} - \sqrt{z}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\sqrt{y + 1} + 0.5 \cdot \sqrt{\frac{1}{z}}\right) - \left(\sqrt{y} + \sqrt{x}\right)\right) + 1\\
\end{array}
\end{array}
if z < 5.40000000000000034e-34Initial program 97.6%
associate-+l+97.6%
associate-+l+97.6%
+-commutative97.6%
+-commutative97.6%
associate-+l-65.2%
+-commutative65.2%
+-commutative65.2%
Simplified65.2%
Taylor expanded in y around 0 30.7%
Taylor expanded in x around 0 15.1%
Taylor expanded in z around 0 14.0%
associate--l+22.8%
associate-+r+22.8%
Simplified22.8%
if 5.40000000000000034e-34 < z < 1.25e6Initial program 95.3%
associate-+l+95.3%
associate-+l+95.3%
+-commutative95.3%
+-commutative95.3%
associate-+l-52.8%
+-commutative52.8%
+-commutative52.8%
Simplified52.8%
Taylor expanded in y around 0 20.9%
Taylor expanded in x around 0 9.3%
Taylor expanded in t around inf 14.3%
associate--l+14.3%
Simplified14.3%
if 1.25e6 < z Initial program 87.2%
+-commutative87.2%
associate-+r+87.2%
associate-+r-70.1%
associate-+l-51.7%
associate-+r-51.6%
Simplified31.5%
Taylor expanded in t around inf 3.5%
associate--l+20.8%
+-commutative20.8%
+-commutative20.8%
Simplified20.8%
Taylor expanded in z around inf 27.0%
associate--l+27.0%
+-commutative27.0%
Simplified27.0%
Taylor expanded in x around 0 13.8%
associate--l+32.5%
Simplified32.5%
Final simplification27.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 y) (sqrt z))))
(if (<= z 5.4e-34)
(+ 3.0 (- (sqrt (+ t 1.0)) (+ t_1 (+ (sqrt t) (sqrt x)))))
(if (<= z 500000.0)
(+
2.0
(- (+ (sqrt (+ z 1.0)) (* 0.5 (sqrt (/ 1.0 t)))) (+ t_1 (sqrt x))))
(+
(- (+ (sqrt (+ y 1.0)) (* 0.5 (sqrt (/ 1.0 z)))) (+ (sqrt y) (sqrt x)))
1.0)))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt(y) + sqrt(z);
double tmp;
if (z <= 5.4e-34) {
tmp = 3.0 + (sqrt((t + 1.0)) - (t_1 + (sqrt(t) + sqrt(x))));
} else if (z <= 500000.0) {
tmp = 2.0 + ((sqrt((z + 1.0)) + (0.5 * sqrt((1.0 / t)))) - (t_1 + sqrt(x)));
} else {
tmp = ((sqrt((y + 1.0)) + (0.5 * sqrt((1.0 / z)))) - (sqrt(y) + sqrt(x))) + 1.0;
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = sqrt(y) + sqrt(z)
if (z <= 5.4d-34) then
tmp = 3.0d0 + (sqrt((t + 1.0d0)) - (t_1 + (sqrt(t) + sqrt(x))))
else if (z <= 500000.0d0) then
tmp = 2.0d0 + ((sqrt((z + 1.0d0)) + (0.5d0 * sqrt((1.0d0 / t)))) - (t_1 + sqrt(x)))
else
tmp = ((sqrt((y + 1.0d0)) + (0.5d0 * sqrt((1.0d0 / z)))) - (sqrt(y) + sqrt(x))) + 1.0d0
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt(y) + Math.sqrt(z);
double tmp;
if (z <= 5.4e-34) {
tmp = 3.0 + (Math.sqrt((t + 1.0)) - (t_1 + (Math.sqrt(t) + Math.sqrt(x))));
} else if (z <= 500000.0) {
tmp = 2.0 + ((Math.sqrt((z + 1.0)) + (0.5 * Math.sqrt((1.0 / t)))) - (t_1 + Math.sqrt(x)));
} else {
tmp = ((Math.sqrt((y + 1.0)) + (0.5 * Math.sqrt((1.0 / z)))) - (Math.sqrt(y) + Math.sqrt(x))) + 1.0;
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt(y) + math.sqrt(z) tmp = 0 if z <= 5.4e-34: tmp = 3.0 + (math.sqrt((t + 1.0)) - (t_1 + (math.sqrt(t) + math.sqrt(x)))) elif z <= 500000.0: tmp = 2.0 + ((math.sqrt((z + 1.0)) + (0.5 * math.sqrt((1.0 / t)))) - (t_1 + math.sqrt(x))) else: tmp = ((math.sqrt((y + 1.0)) + (0.5 * math.sqrt((1.0 / z)))) - (math.sqrt(y) + math.sqrt(x))) + 1.0 return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = Float64(sqrt(y) + sqrt(z)) tmp = 0.0 if (z <= 5.4e-34) tmp = Float64(3.0 + Float64(sqrt(Float64(t + 1.0)) - Float64(t_1 + Float64(sqrt(t) + sqrt(x))))); elseif (z <= 500000.0) tmp = Float64(2.0 + Float64(Float64(sqrt(Float64(z + 1.0)) + Float64(0.5 * sqrt(Float64(1.0 / t)))) - Float64(t_1 + sqrt(x)))); else tmp = Float64(Float64(Float64(sqrt(Float64(y + 1.0)) + Float64(0.5 * sqrt(Float64(1.0 / z)))) - Float64(sqrt(y) + sqrt(x))) + 1.0); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt(y) + sqrt(z);
tmp = 0.0;
if (z <= 5.4e-34)
tmp = 3.0 + (sqrt((t + 1.0)) - (t_1 + (sqrt(t) + sqrt(x))));
elseif (z <= 500000.0)
tmp = 2.0 + ((sqrt((z + 1.0)) + (0.5 * sqrt((1.0 / t)))) - (t_1 + sqrt(x)));
else
tmp = ((sqrt((y + 1.0)) + (0.5 * sqrt((1.0 / z)))) - (sqrt(y) + sqrt(x))) + 1.0;
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, 5.4e-34], N[(3.0 + N[(N[Sqrt[N[(t + 1.0), $MachinePrecision]], $MachinePrecision] - N[(t$95$1 + N[(N[Sqrt[t], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 500000.0], N[(2.0 + N[(N[(N[Sqrt[N[(z + 1.0), $MachinePrecision]], $MachinePrecision] + N[(0.5 * N[Sqrt[N[(1.0 / t), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(t$95$1 + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision] + N[(0.5 * N[Sqrt[N[(1.0 / z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{y} + \sqrt{z}\\
\mathbf{if}\;z \leq 5.4 \cdot 10^{-34}:\\
\;\;\;\;3 + \left(\sqrt{t + 1} - \left(t\_1 + \left(\sqrt{t} + \sqrt{x}\right)\right)\right)\\
\mathbf{elif}\;z \leq 500000:\\
\;\;\;\;2 + \left(\left(\sqrt{z + 1} + 0.5 \cdot \sqrt{\frac{1}{t}}\right) - \left(t\_1 + \sqrt{x}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\sqrt{y + 1} + 0.5 \cdot \sqrt{\frac{1}{z}}\right) - \left(\sqrt{y} + \sqrt{x}\right)\right) + 1\\
\end{array}
\end{array}
if z < 5.40000000000000034e-34Initial program 97.6%
associate-+l+97.6%
associate-+l+97.6%
+-commutative97.6%
+-commutative97.6%
associate-+l-65.2%
+-commutative65.2%
+-commutative65.2%
Simplified65.2%
Taylor expanded in y around 0 30.7%
Taylor expanded in x around 0 15.1%
Taylor expanded in z around 0 14.0%
associate--l+22.8%
associate-+r+22.8%
Simplified22.8%
if 5.40000000000000034e-34 < z < 5e5Initial program 95.3%
associate-+l+95.3%
associate-+l+95.3%
+-commutative95.3%
+-commutative95.3%
associate-+l-52.8%
+-commutative52.8%
+-commutative52.8%
Simplified52.8%
Taylor expanded in y around 0 20.9%
Taylor expanded in x around 0 9.3%
Taylor expanded in t around inf 14.3%
associate--l+14.3%
Simplified14.3%
if 5e5 < z Initial program 87.2%
+-commutative87.2%
associate-+r+87.2%
associate-+r-70.1%
associate-+l-51.7%
associate-+r-51.6%
Simplified31.5%
Taylor expanded in t around inf 3.5%
associate--l+20.8%
+-commutative20.8%
+-commutative20.8%
Simplified20.8%
Taylor expanded in z around inf 27.0%
associate--l+27.0%
+-commutative27.0%
Simplified27.0%
Taylor expanded in x around 0 13.8%
associate--l+32.5%
Simplified32.5%
Final simplification27.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 y) (sqrt z))))
(if (<= z 5.4e-34)
(+ 3.0 (- (sqrt (+ t 1.0)) (+ t_1 (+ (sqrt t) (sqrt x)))))
(if (<= z 6000000.0)
(- (+ (sqrt (+ z 1.0)) 2.0) (+ t_1 (sqrt x)))
(+
(- (+ (sqrt (+ y 1.0)) (* 0.5 (sqrt (/ 1.0 z)))) (+ (sqrt y) (sqrt x)))
1.0)))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt(y) + sqrt(z);
double tmp;
if (z <= 5.4e-34) {
tmp = 3.0 + (sqrt((t + 1.0)) - (t_1 + (sqrt(t) + sqrt(x))));
} else if (z <= 6000000.0) {
tmp = (sqrt((z + 1.0)) + 2.0) - (t_1 + sqrt(x));
} else {
tmp = ((sqrt((y + 1.0)) + (0.5 * sqrt((1.0 / z)))) - (sqrt(y) + sqrt(x))) + 1.0;
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = sqrt(y) + sqrt(z)
if (z <= 5.4d-34) then
tmp = 3.0d0 + (sqrt((t + 1.0d0)) - (t_1 + (sqrt(t) + sqrt(x))))
else if (z <= 6000000.0d0) then
tmp = (sqrt((z + 1.0d0)) + 2.0d0) - (t_1 + sqrt(x))
else
tmp = ((sqrt((y + 1.0d0)) + (0.5d0 * sqrt((1.0d0 / z)))) - (sqrt(y) + sqrt(x))) + 1.0d0
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt(y) + Math.sqrt(z);
double tmp;
if (z <= 5.4e-34) {
tmp = 3.0 + (Math.sqrt((t + 1.0)) - (t_1 + (Math.sqrt(t) + Math.sqrt(x))));
} else if (z <= 6000000.0) {
tmp = (Math.sqrt((z + 1.0)) + 2.0) - (t_1 + Math.sqrt(x));
} else {
tmp = ((Math.sqrt((y + 1.0)) + (0.5 * Math.sqrt((1.0 / z)))) - (Math.sqrt(y) + Math.sqrt(x))) + 1.0;
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt(y) + math.sqrt(z) tmp = 0 if z <= 5.4e-34: tmp = 3.0 + (math.sqrt((t + 1.0)) - (t_1 + (math.sqrt(t) + math.sqrt(x)))) elif z <= 6000000.0: tmp = (math.sqrt((z + 1.0)) + 2.0) - (t_1 + math.sqrt(x)) else: tmp = ((math.sqrt((y + 1.0)) + (0.5 * math.sqrt((1.0 / z)))) - (math.sqrt(y) + math.sqrt(x))) + 1.0 return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = Float64(sqrt(y) + sqrt(z)) tmp = 0.0 if (z <= 5.4e-34) tmp = Float64(3.0 + Float64(sqrt(Float64(t + 1.0)) - Float64(t_1 + Float64(sqrt(t) + sqrt(x))))); elseif (z <= 6000000.0) tmp = Float64(Float64(sqrt(Float64(z + 1.0)) + 2.0) - Float64(t_1 + sqrt(x))); else tmp = Float64(Float64(Float64(sqrt(Float64(y + 1.0)) + Float64(0.5 * sqrt(Float64(1.0 / z)))) - Float64(sqrt(y) + sqrt(x))) + 1.0); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt(y) + sqrt(z);
tmp = 0.0;
if (z <= 5.4e-34)
tmp = 3.0 + (sqrt((t + 1.0)) - (t_1 + (sqrt(t) + sqrt(x))));
elseif (z <= 6000000.0)
tmp = (sqrt((z + 1.0)) + 2.0) - (t_1 + sqrt(x));
else
tmp = ((sqrt((y + 1.0)) + (0.5 * sqrt((1.0 / z)))) - (sqrt(y) + sqrt(x))) + 1.0;
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, 5.4e-34], N[(3.0 + N[(N[Sqrt[N[(t + 1.0), $MachinePrecision]], $MachinePrecision] - N[(t$95$1 + N[(N[Sqrt[t], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 6000000.0], N[(N[(N[Sqrt[N[(z + 1.0), $MachinePrecision]], $MachinePrecision] + 2.0), $MachinePrecision] - N[(t$95$1 + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision] + N[(0.5 * N[Sqrt[N[(1.0 / z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{y} + \sqrt{z}\\
\mathbf{if}\;z \leq 5.4 \cdot 10^{-34}:\\
\;\;\;\;3 + \left(\sqrt{t + 1} - \left(t\_1 + \left(\sqrt{t} + \sqrt{x}\right)\right)\right)\\
\mathbf{elif}\;z \leq 6000000:\\
\;\;\;\;\left(\sqrt{z + 1} + 2\right) - \left(t\_1 + \sqrt{x}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\sqrt{y + 1} + 0.5 \cdot \sqrt{\frac{1}{z}}\right) - \left(\sqrt{y} + \sqrt{x}\right)\right) + 1\\
\end{array}
\end{array}
if z < 5.40000000000000034e-34Initial program 97.6%
associate-+l+97.6%
associate-+l+97.6%
+-commutative97.6%
+-commutative97.6%
associate-+l-65.2%
+-commutative65.2%
+-commutative65.2%
Simplified65.2%
Taylor expanded in y around 0 30.7%
Taylor expanded in x around 0 15.1%
Taylor expanded in z around 0 14.0%
associate--l+22.8%
associate-+r+22.8%
Simplified22.8%
if 5.40000000000000034e-34 < z < 6e6Initial program 95.3%
associate-+l+95.3%
associate-+l+95.3%
+-commutative95.3%
+-commutative95.3%
associate-+l-52.8%
+-commutative52.8%
+-commutative52.8%
Simplified52.8%
Taylor expanded in y around 0 20.9%
Taylor expanded in x around 0 9.3%
Taylor expanded in t around inf 13.9%
if 6e6 < z Initial program 87.2%
+-commutative87.2%
associate-+r+87.2%
associate-+r-70.1%
associate-+l-51.7%
associate-+r-51.6%
Simplified31.5%
Taylor expanded in t around inf 3.5%
associate--l+20.8%
+-commutative20.8%
+-commutative20.8%
Simplified20.8%
Taylor expanded in z around inf 27.0%
associate--l+27.0%
+-commutative27.0%
Simplified27.0%
Taylor expanded in x around 0 13.8%
associate--l+32.5%
Simplified32.5%
Final simplification27.1%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (/ 1.0 z))))
(if (<= y 6.6e-24)
(+ 2.0 (- (sqrt (+ z 1.0)) (+ (sqrt z) (sqrt x))))
(if (<= y 70000000.0)
(+ (- (+ (sqrt (+ y 1.0)) (* 0.5 t_1)) (+ (sqrt y) (sqrt x))) 1.0)
(+ (sqrt (+ x 1.0)) (- (* 0.5 (+ (sqrt (/ 1.0 y)) t_1)) (sqrt x)))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 / z));
double tmp;
if (y <= 6.6e-24) {
tmp = 2.0 + (sqrt((z + 1.0)) - (sqrt(z) + sqrt(x)));
} else if (y <= 70000000.0) {
tmp = ((sqrt((y + 1.0)) + (0.5 * t_1)) - (sqrt(y) + sqrt(x))) + 1.0;
} else {
tmp = sqrt((x + 1.0)) + ((0.5 * (sqrt((1.0 / y)) + t_1)) - sqrt(x));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = sqrt((1.0d0 / z))
if (y <= 6.6d-24) then
tmp = 2.0d0 + (sqrt((z + 1.0d0)) - (sqrt(z) + sqrt(x)))
else if (y <= 70000000.0d0) then
tmp = ((sqrt((y + 1.0d0)) + (0.5d0 * t_1)) - (sqrt(y) + sqrt(x))) + 1.0d0
else
tmp = sqrt((x + 1.0d0)) + ((0.5d0 * (sqrt((1.0d0 / y)) + t_1)) - sqrt(x))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 / z));
double tmp;
if (y <= 6.6e-24) {
tmp = 2.0 + (Math.sqrt((z + 1.0)) - (Math.sqrt(z) + Math.sqrt(x)));
} else if (y <= 70000000.0) {
tmp = ((Math.sqrt((y + 1.0)) + (0.5 * t_1)) - (Math.sqrt(y) + Math.sqrt(x))) + 1.0;
} else {
tmp = Math.sqrt((x + 1.0)) + ((0.5 * (Math.sqrt((1.0 / y)) + t_1)) - Math.sqrt(x));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 / z)) tmp = 0 if y <= 6.6e-24: tmp = 2.0 + (math.sqrt((z + 1.0)) - (math.sqrt(z) + math.sqrt(x))) elif y <= 70000000.0: tmp = ((math.sqrt((y + 1.0)) + (0.5 * t_1)) - (math.sqrt(y) + math.sqrt(x))) + 1.0 else: tmp = math.sqrt((x + 1.0)) + ((0.5 * (math.sqrt((1.0 / y)) + t_1)) - math.sqrt(x)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(1.0 / z)) tmp = 0.0 if (y <= 6.6e-24) tmp = Float64(2.0 + Float64(sqrt(Float64(z + 1.0)) - Float64(sqrt(z) + sqrt(x)))); elseif (y <= 70000000.0) tmp = Float64(Float64(Float64(sqrt(Float64(y + 1.0)) + Float64(0.5 * t_1)) - Float64(sqrt(y) + sqrt(x))) + 1.0); else tmp = Float64(sqrt(Float64(x + 1.0)) + Float64(Float64(0.5 * Float64(sqrt(Float64(1.0 / y)) + t_1)) - sqrt(x))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 / z));
tmp = 0.0;
if (y <= 6.6e-24)
tmp = 2.0 + (sqrt((z + 1.0)) - (sqrt(z) + sqrt(x)));
elseif (y <= 70000000.0)
tmp = ((sqrt((y + 1.0)) + (0.5 * t_1)) - (sqrt(y) + sqrt(x))) + 1.0;
else
tmp = sqrt((x + 1.0)) + ((0.5 * (sqrt((1.0 / y)) + t_1)) - sqrt(x));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(1.0 / z), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y, 6.6e-24], N[(2.0 + N[(N[Sqrt[N[(z + 1.0), $MachinePrecision]], $MachinePrecision] - N[(N[Sqrt[z], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 70000000.0], N[(N[(N[(N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision] + N[(0.5 * t$95$1), $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision], N[(N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision] + N[(N[(0.5 * N[(N[Sqrt[N[(1.0 / y), $MachinePrecision]], $MachinePrecision] + t$95$1), $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}{z}}\\
\mathbf{if}\;y \leq 6.6 \cdot 10^{-24}:\\
\;\;\;\;2 + \left(\sqrt{z + 1} - \left(\sqrt{z} + \sqrt{x}\right)\right)\\
\mathbf{elif}\;y \leq 70000000:\\
\;\;\;\;\left(\left(\sqrt{y + 1} + 0.5 \cdot t\_1\right) - \left(\sqrt{y} + \sqrt{x}\right)\right) + 1\\
\mathbf{else}:\\
\;\;\;\;\sqrt{x + 1} + \left(0.5 \cdot \left(\sqrt{\frac{1}{y}} + t\_1\right) - \sqrt{x}\right)\\
\end{array}
\end{array}
if y < 6.59999999999999968e-24Initial program 98.2%
+-commutative98.2%
associate-+r+98.2%
associate-+r-98.2%
associate-+l-98.2%
associate-+r-98.2%
Simplified76.6%
Taylor expanded in t around inf 18.2%
associate--l+22.5%
+-commutative22.5%
+-commutative22.5%
Simplified22.5%
Taylor expanded in z around inf 22.5%
Taylor expanded in x around 0 26.2%
Taylor expanded in y around 0 15.4%
associate--l+28.2%
Simplified28.2%
if 6.59999999999999968e-24 < y < 7e7Initial program 90.4%
+-commutative90.4%
associate-+r+90.4%
associate-+r-90.3%
associate-+l-90.3%
associate-+r-90.3%
Simplified70.4%
Taylor expanded in t around inf 10.6%
associate--l+17.8%
+-commutative17.8%
+-commutative17.8%
Simplified17.8%
Taylor expanded in z around inf 28.4%
associate--l+28.4%
+-commutative28.4%
Simplified28.4%
Taylor expanded in x around 0 26.7%
associate--l+26.7%
Simplified26.7%
if 7e7 < y Initial program 87.8%
+-commutative87.8%
associate-+r+87.8%
associate-+r-50.1%
associate-+l-22.9%
associate-+r-8.5%
Simplified8.0%
Taylor expanded in t around inf 3.9%
associate--l+20.7%
+-commutative20.7%
+-commutative20.7%
Simplified20.7%
Taylor expanded in z around inf 18.4%
associate--l+18.4%
+-commutative18.4%
Simplified18.4%
Taylor expanded in y around inf 17.4%
distribute-lft-out17.4%
Simplified17.4%
Final simplification22.3%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(if (<= z 550000.0)
(- (+ (sqrt (+ z 1.0)) 2.0) (+ (+ (sqrt y) (sqrt z)) (sqrt x)))
(+
(- (+ (sqrt (+ y 1.0)) (* 0.5 (sqrt (/ 1.0 z)))) (+ (sqrt y) (sqrt x)))
1.0)))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (z <= 550000.0) {
tmp = (sqrt((z + 1.0)) + 2.0) - ((sqrt(y) + sqrt(z)) + sqrt(x));
} else {
tmp = ((sqrt((y + 1.0)) + (0.5 * sqrt((1.0 / z)))) - (sqrt(y) + sqrt(x))) + 1.0;
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (z <= 550000.0d0) then
tmp = (sqrt((z + 1.0d0)) + 2.0d0) - ((sqrt(y) + sqrt(z)) + sqrt(x))
else
tmp = ((sqrt((y + 1.0d0)) + (0.5d0 * sqrt((1.0d0 / z)))) - (sqrt(y) + sqrt(x))) + 1.0d0
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= 550000.0) {
tmp = (Math.sqrt((z + 1.0)) + 2.0) - ((Math.sqrt(y) + Math.sqrt(z)) + Math.sqrt(x));
} else {
tmp = ((Math.sqrt((y + 1.0)) + (0.5 * Math.sqrt((1.0 / z)))) - (Math.sqrt(y) + Math.sqrt(x))) + 1.0;
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if z <= 550000.0: tmp = (math.sqrt((z + 1.0)) + 2.0) - ((math.sqrt(y) + math.sqrt(z)) + math.sqrt(x)) else: tmp = ((math.sqrt((y + 1.0)) + (0.5 * math.sqrt((1.0 / z)))) - (math.sqrt(y) + math.sqrt(x))) + 1.0 return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (z <= 550000.0) tmp = Float64(Float64(sqrt(Float64(z + 1.0)) + 2.0) - Float64(Float64(sqrt(y) + sqrt(z)) + sqrt(x))); else tmp = Float64(Float64(Float64(sqrt(Float64(y + 1.0)) + Float64(0.5 * sqrt(Float64(1.0 / z)))) - Float64(sqrt(y) + sqrt(x))) + 1.0); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (z <= 550000.0)
tmp = (sqrt((z + 1.0)) + 2.0) - ((sqrt(y) + sqrt(z)) + sqrt(x));
else
tmp = ((sqrt((y + 1.0)) + (0.5 * sqrt((1.0 / z)))) - (sqrt(y) + sqrt(x))) + 1.0;
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[z, 550000.0], N[(N[(N[Sqrt[N[(z + 1.0), $MachinePrecision]], $MachinePrecision] + 2.0), $MachinePrecision] - N[(N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision] + N[(0.5 * N[Sqrt[N[(1.0 / z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq 550000:\\
\;\;\;\;\left(\sqrt{z + 1} + 2\right) - \left(\left(\sqrt{y} + \sqrt{z}\right) + \sqrt{x}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\sqrt{y + 1} + 0.5 \cdot \sqrt{\frac{1}{z}}\right) - \left(\sqrt{y} + \sqrt{x}\right)\right) + 1\\
\end{array}
\end{array}
if z < 5.5e5Initial program 97.3%
associate-+l+97.3%
associate-+l+97.3%
+-commutative97.3%
+-commutative97.3%
associate-+l-63.5%
+-commutative63.5%
+-commutative63.5%
Simplified63.5%
Taylor expanded in y around 0 29.3%
Taylor expanded in x around 0 14.3%
Taylor expanded in t around inf 12.8%
if 5.5e5 < z Initial program 87.2%
+-commutative87.2%
associate-+r+87.2%
associate-+r-70.1%
associate-+l-51.7%
associate-+r-51.6%
Simplified31.5%
Taylor expanded in t around inf 3.5%
associate--l+20.8%
+-commutative20.8%
+-commutative20.8%
Simplified20.8%
Taylor expanded in z around inf 27.0%
associate--l+27.0%
+-commutative27.0%
Simplified27.0%
Taylor expanded in x around 0 13.8%
associate--l+32.5%
Simplified32.5%
Final simplification22.8%
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 25000000000000.0) (- (+ (sqrt (+ z 1.0)) 2.0) (+ (sqrt z) (sqrt x))) (+ (sqrt (+ x 1.0)) (- (sqrt (+ y 1.0)) (+ (sqrt y) (sqrt x))))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (z <= 25000000000000.0) {
tmp = (sqrt((z + 1.0)) + 2.0) - (sqrt(z) + sqrt(x));
} else {
tmp = sqrt((x + 1.0)) + (sqrt((y + 1.0)) - (sqrt(y) + sqrt(x)));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (z <= 25000000000000.0d0) then
tmp = (sqrt((z + 1.0d0)) + 2.0d0) - (sqrt(z) + sqrt(x))
else
tmp = sqrt((x + 1.0d0)) + (sqrt((y + 1.0d0)) - (sqrt(y) + sqrt(x)))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= 25000000000000.0) {
tmp = (Math.sqrt((z + 1.0)) + 2.0) - (Math.sqrt(z) + Math.sqrt(x));
} else {
tmp = Math.sqrt((x + 1.0)) + (Math.sqrt((y + 1.0)) - (Math.sqrt(y) + Math.sqrt(x)));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if z <= 25000000000000.0: tmp = (math.sqrt((z + 1.0)) + 2.0) - (math.sqrt(z) + math.sqrt(x)) else: tmp = math.sqrt((x + 1.0)) + (math.sqrt((y + 1.0)) - (math.sqrt(y) + math.sqrt(x))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (z <= 25000000000000.0) tmp = Float64(Float64(sqrt(Float64(z + 1.0)) + 2.0) - Float64(sqrt(z) + sqrt(x))); else tmp = Float64(sqrt(Float64(x + 1.0)) + Float64(sqrt(Float64(y + 1.0)) - Float64(sqrt(y) + sqrt(x)))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (z <= 25000000000000.0)
tmp = (sqrt((z + 1.0)) + 2.0) - (sqrt(z) + sqrt(x));
else
tmp = sqrt((x + 1.0)) + (sqrt((y + 1.0)) - (sqrt(y) + sqrt(x)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[z, 25000000000000.0], N[(N[(N[Sqrt[N[(z + 1.0), $MachinePrecision]], $MachinePrecision] + 2.0), $MachinePrecision] - N[(N[Sqrt[z], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision] + N[(N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision] - N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq 25000000000000:\\
\;\;\;\;\left(\sqrt{z + 1} + 2\right) - \left(\sqrt{z} + \sqrt{x}\right)\\
\mathbf{else}:\\
\;\;\;\;\sqrt{x + 1} + \left(\sqrt{y + 1} - \left(\sqrt{y} + \sqrt{x}\right)\right)\\
\end{array}
\end{array}
if z < 2.5e13Initial program 96.8%
+-commutative96.8%
associate-+r+96.8%
associate-+r-74.0%
associate-+l-62.6%
associate-+r-47.4%
Simplified47.4%
Taylor expanded in t around inf 16.6%
associate--l+21.5%
+-commutative21.5%
+-commutative21.5%
Simplified21.5%
Taylor expanded in z around inf 17.2%
Taylor expanded in x around 0 14.6%
Taylor expanded in y around 0 26.8%
if 2.5e13 < z Initial program 87.4%
+-commutative87.4%
associate-+r+87.4%
associate-+r-69.9%
associate-+l-52.1%
associate-+r-52.1%
Simplified31.5%
Taylor expanded in t around inf 3.6%
associate--l+21.1%
+-commutative21.1%
+-commutative21.1%
Simplified21.1%
Taylor expanded in z around inf 27.5%
+-commutative27.5%
Simplified27.5%
Final simplification27.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 25000000000000.0) (- (+ (sqrt (+ z 1.0)) 2.0) (+ (+ (sqrt y) (sqrt z)) (sqrt x))) (+ (sqrt (+ x 1.0)) (- (sqrt (+ y 1.0)) (+ (sqrt y) (sqrt x))))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (z <= 25000000000000.0) {
tmp = (sqrt((z + 1.0)) + 2.0) - ((sqrt(y) + sqrt(z)) + sqrt(x));
} else {
tmp = sqrt((x + 1.0)) + (sqrt((y + 1.0)) - (sqrt(y) + sqrt(x)));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (z <= 25000000000000.0d0) then
tmp = (sqrt((z + 1.0d0)) + 2.0d0) - ((sqrt(y) + sqrt(z)) + sqrt(x))
else
tmp = sqrt((x + 1.0d0)) + (sqrt((y + 1.0d0)) - (sqrt(y) + sqrt(x)))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= 25000000000000.0) {
tmp = (Math.sqrt((z + 1.0)) + 2.0) - ((Math.sqrt(y) + Math.sqrt(z)) + Math.sqrt(x));
} else {
tmp = Math.sqrt((x + 1.0)) + (Math.sqrt((y + 1.0)) - (Math.sqrt(y) + Math.sqrt(x)));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if z <= 25000000000000.0: tmp = (math.sqrt((z + 1.0)) + 2.0) - ((math.sqrt(y) + math.sqrt(z)) + math.sqrt(x)) else: tmp = math.sqrt((x + 1.0)) + (math.sqrt((y + 1.0)) - (math.sqrt(y) + math.sqrt(x))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (z <= 25000000000000.0) tmp = Float64(Float64(sqrt(Float64(z + 1.0)) + 2.0) - Float64(Float64(sqrt(y) + sqrt(z)) + sqrt(x))); else tmp = Float64(sqrt(Float64(x + 1.0)) + Float64(sqrt(Float64(y + 1.0)) - Float64(sqrt(y) + sqrt(x)))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (z <= 25000000000000.0)
tmp = (sqrt((z + 1.0)) + 2.0) - ((sqrt(y) + sqrt(z)) + sqrt(x));
else
tmp = sqrt((x + 1.0)) + (sqrt((y + 1.0)) - (sqrt(y) + sqrt(x)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[z, 25000000000000.0], N[(N[(N[Sqrt[N[(z + 1.0), $MachinePrecision]], $MachinePrecision] + 2.0), $MachinePrecision] - N[(N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision] + N[(N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision] - N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq 25000000000000:\\
\;\;\;\;\left(\sqrt{z + 1} + 2\right) - \left(\left(\sqrt{y} + \sqrt{z}\right) + \sqrt{x}\right)\\
\mathbf{else}:\\
\;\;\;\;\sqrt{x + 1} + \left(\sqrt{y + 1} - \left(\sqrt{y} + \sqrt{x}\right)\right)\\
\end{array}
\end{array}
if z < 2.5e13Initial program 96.8%
associate-+l+96.8%
associate-+l+96.8%
+-commutative96.8%
+-commutative96.8%
associate-+l-63.4%
+-commutative63.4%
+-commutative63.4%
Simplified63.4%
Taylor expanded in y around 0 29.0%
Taylor expanded in x around 0 14.0%
Taylor expanded in t around inf 12.5%
if 2.5e13 < z Initial program 87.4%
+-commutative87.4%
associate-+r+87.4%
associate-+r-69.9%
associate-+l-52.1%
associate-+r-52.1%
Simplified31.5%
Taylor expanded in t around inf 3.6%
associate--l+21.1%
+-commutative21.1%
+-commutative21.1%
Simplified21.1%
Taylor expanded in z around inf 27.5%
+-commutative27.5%
Simplified27.5%
Final simplification20.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 (<= y 1.96) (+ 2.0 (- (sqrt (+ z 1.0)) (+ (sqrt z) (sqrt x)))) (- (sqrt (+ x 1.0)) (sqrt x))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 1.96) {
tmp = 2.0 + (sqrt((z + 1.0)) - (sqrt(z) + sqrt(x)));
} else {
tmp = sqrt((x + 1.0)) - sqrt(x);
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= 1.96d0) then
tmp = 2.0d0 + (sqrt((z + 1.0d0)) - (sqrt(z) + sqrt(x)))
else
tmp = sqrt((x + 1.0d0)) - sqrt(x)
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= 1.96) {
tmp = 2.0 + (Math.sqrt((z + 1.0)) - (Math.sqrt(z) + Math.sqrt(x)));
} else {
tmp = Math.sqrt((x + 1.0)) - Math.sqrt(x);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if y <= 1.96: tmp = 2.0 + (math.sqrt((z + 1.0)) - (math.sqrt(z) + math.sqrt(x))) else: tmp = math.sqrt((x + 1.0)) - math.sqrt(x) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (y <= 1.96) tmp = Float64(2.0 + Float64(sqrt(Float64(z + 1.0)) - Float64(sqrt(z) + sqrt(x)))); else tmp = Float64(sqrt(Float64(x + 1.0)) - sqrt(x)); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (y <= 1.96)
tmp = 2.0 + (sqrt((z + 1.0)) - (sqrt(z) + sqrt(x)));
else
tmp = sqrt((x + 1.0)) - sqrt(x);
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[y, 1.96], N[(2.0 + N[(N[Sqrt[N[(z + 1.0), $MachinePrecision]], $MachinePrecision] - N[(N[Sqrt[z], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 1.96:\\
\;\;\;\;2 + \left(\sqrt{z + 1} - \left(\sqrt{z} + \sqrt{x}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\sqrt{x + 1} - \sqrt{x}\\
\end{array}
\end{array}
if y < 1.96Initial program 97.5%
+-commutative97.5%
associate-+r+97.5%
associate-+r-97.4%
associate-+l-97.4%
associate-+r-97.4%
Simplified76.8%
Taylor expanded in t around inf 17.7%
associate--l+21.8%
+-commutative21.8%
+-commutative21.8%
Simplified21.8%
Taylor expanded in z around inf 21.8%
Taylor expanded in x around 0 25.0%
Taylor expanded in y around 0 14.9%
associate--l+27.6%
Simplified27.6%
if 1.96 < y Initial program 87.8%
+-commutative87.8%
associate-+r+87.8%
associate-+r-50.9%
associate-+l-24.2%
associate-+r-10.2%
Simplified8.6%
Taylor expanded in t around inf 3.9%
associate--l+20.8%
+-commutative20.8%
+-commutative20.8%
Simplified20.8%
Taylor expanded in x around inf 20.0%
neg-mul-120.0%
Simplified20.0%
Final simplification23.4%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= y 0.72) (+ (- (sqrt (+ y 1.0)) (sqrt x)) 1.0) (- (sqrt (+ x 1.0)) (sqrt x))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 0.72) {
tmp = (sqrt((y + 1.0)) - sqrt(x)) + 1.0;
} else {
tmp = sqrt((x + 1.0)) - sqrt(x);
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= 0.72d0) then
tmp = (sqrt((y + 1.0d0)) - sqrt(x)) + 1.0d0
else
tmp = sqrt((x + 1.0d0)) - sqrt(x)
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= 0.72) {
tmp = (Math.sqrt((y + 1.0)) - Math.sqrt(x)) + 1.0;
} else {
tmp = Math.sqrt((x + 1.0)) - Math.sqrt(x);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if y <= 0.72: tmp = (math.sqrt((y + 1.0)) - math.sqrt(x)) + 1.0 else: tmp = math.sqrt((x + 1.0)) - math.sqrt(x) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (y <= 0.72) tmp = Float64(Float64(sqrt(Float64(y + 1.0)) - sqrt(x)) + 1.0); else tmp = Float64(sqrt(Float64(x + 1.0)) - sqrt(x)); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (y <= 0.72)
tmp = (sqrt((y + 1.0)) - sqrt(x)) + 1.0;
else
tmp = sqrt((x + 1.0)) - sqrt(x);
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[y, 0.72], N[(N[(N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision], N[(N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 0.72:\\
\;\;\;\;\left(\sqrt{y + 1} - \sqrt{x}\right) + 1\\
\mathbf{else}:\\
\;\;\;\;\sqrt{x + 1} - \sqrt{x}\\
\end{array}
\end{array}
if y < 0.71999999999999997Initial program 97.5%
+-commutative97.5%
associate-+r+97.5%
associate-+r-97.4%
associate-+l-97.4%
associate-+r-97.4%
Simplified76.8%
Taylor expanded in t around inf 17.7%
associate--l+21.8%
+-commutative21.8%
+-commutative21.8%
Simplified21.8%
Taylor expanded in z around inf 21.8%
Taylor expanded in x around 0 25.0%
Taylor expanded in z around inf 16.4%
associate--l+16.4%
Simplified16.4%
if 0.71999999999999997 < y Initial program 87.8%
+-commutative87.8%
associate-+r+87.8%
associate-+r-50.9%
associate-+l-24.2%
associate-+r-10.2%
Simplified8.6%
Taylor expanded in t around inf 3.9%
associate--l+20.8%
+-commutative20.8%
+-commutative20.8%
Simplified20.8%
Taylor expanded in x around inf 20.0%
neg-mul-120.0%
Simplified20.0%
Final simplification18.4%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= y 1.5) (- (+ (sqrt (+ y 1.0)) 1.0) (sqrt x)) (- (sqrt (+ x 1.0)) (sqrt x))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 1.5) {
tmp = (sqrt((y + 1.0)) + 1.0) - sqrt(x);
} else {
tmp = sqrt((x + 1.0)) - sqrt(x);
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= 1.5d0) then
tmp = (sqrt((y + 1.0d0)) + 1.0d0) - sqrt(x)
else
tmp = sqrt((x + 1.0d0)) - sqrt(x)
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= 1.5) {
tmp = (Math.sqrt((y + 1.0)) + 1.0) - Math.sqrt(x);
} else {
tmp = Math.sqrt((x + 1.0)) - Math.sqrt(x);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if y <= 1.5: tmp = (math.sqrt((y + 1.0)) + 1.0) - math.sqrt(x) else: tmp = math.sqrt((x + 1.0)) - math.sqrt(x) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (y <= 1.5) tmp = Float64(Float64(sqrt(Float64(y + 1.0)) + 1.0) - sqrt(x)); else tmp = Float64(sqrt(Float64(x + 1.0)) - sqrt(x)); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (y <= 1.5)
tmp = (sqrt((y + 1.0)) + 1.0) - sqrt(x);
else
tmp = sqrt((x + 1.0)) - sqrt(x);
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[y, 1.5], N[(N[(N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision] + 1.0), $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 1.5:\\
\;\;\;\;\left(\sqrt{y + 1} + 1\right) - \sqrt{x}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{x + 1} - \sqrt{x}\\
\end{array}
\end{array}
if y < 1.5Initial program 97.5%
+-commutative97.5%
associate-+r+97.5%
associate-+r-97.4%
associate-+l-97.4%
associate-+r-97.4%
Simplified76.8%
Taylor expanded in t around inf 17.7%
associate--l+21.8%
+-commutative21.8%
+-commutative21.8%
Simplified21.8%
Taylor expanded in z around inf 21.8%
Taylor expanded in x around 0 25.0%
Taylor expanded in z around inf 16.4%
if 1.5 < y Initial program 87.8%
+-commutative87.8%
associate-+r+87.8%
associate-+r-50.9%
associate-+l-24.2%
associate-+r-10.2%
Simplified8.6%
Taylor expanded in t around inf 3.9%
associate--l+20.8%
+-commutative20.8%
+-commutative20.8%
Simplified20.8%
Taylor expanded in x around inf 20.0%
neg-mul-120.0%
Simplified20.0%
Final simplification18.4%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (- (sqrt (+ x 1.0)) (sqrt x)))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
return sqrt((x + 1.0)) - sqrt(x);
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = sqrt((x + 1.0d0)) - sqrt(x)
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
return Math.sqrt((x + 1.0)) - Math.sqrt(x);
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): return math.sqrt((x + 1.0)) - math.sqrt(x)
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) return Float64(sqrt(Float64(x + 1.0)) - sqrt(x)) end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp = code(x, y, z, t)
tmp = sqrt((x + 1.0)) - sqrt(x);
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := N[(N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\sqrt{x + 1} - \sqrt{x}
\end{array}
Initial program 92.2%
+-commutative92.2%
associate-+r+92.2%
associate-+r-72.0%
associate-+l-57.4%
associate-+r-49.7%
Simplified39.5%
Taylor expanded in t around inf 10.1%
associate--l+21.3%
+-commutative21.3%
+-commutative21.3%
Simplified21.3%
Taylor expanded in x around inf 15.9%
neg-mul-115.9%
Simplified15.9%
Final simplification15.9%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (+ (sqrt y) 1.0))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
return sqrt(y) + 1.0;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = sqrt(y) + 1.0d0
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
return Math.sqrt(y) + 1.0;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): return math.sqrt(y) + 1.0
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) return Float64(sqrt(y) + 1.0) end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp = code(x, y, z, t)
tmp = sqrt(y) + 1.0;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := N[(N[Sqrt[y], $MachinePrecision] + 1.0), $MachinePrecision]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\sqrt{y} + 1
\end{array}
Initial program 92.2%
+-commutative92.2%
associate-+r+92.2%
associate-+r-72.0%
associate-+l-57.4%
associate-+r-49.7%
Simplified39.5%
Taylor expanded in t around inf 10.1%
associate--l+21.3%
+-commutative21.3%
+-commutative21.3%
Simplified21.3%
Taylor expanded in z around inf 14.4%
Taylor expanded in x around 0 18.3%
Taylor expanded in y around inf 16.8%
Final simplification16.8%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (- 1.0 (sqrt x)))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
return 1.0 - sqrt(x);
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = 1.0d0 - sqrt(x)
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
return 1.0 - Math.sqrt(x);
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): return 1.0 - math.sqrt(x)
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) return Float64(1.0 - sqrt(x)) end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp = code(x, y, z, t)
tmp = 1.0 - sqrt(x);
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := N[(1.0 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
1 - \sqrt{x}
\end{array}
Initial program 92.2%
+-commutative92.2%
associate-+r+92.2%
associate-+r-72.0%
associate-+l-57.4%
associate-+r-49.7%
Simplified39.5%
Taylor expanded in t around inf 10.1%
associate--l+21.3%
+-commutative21.3%
+-commutative21.3%
Simplified21.3%
Taylor expanded in z around inf 14.4%
Taylor expanded in x around 0 18.3%
Taylor expanded in x around inf 14.6%
mul-1-neg14.6%
Simplified14.6%
Final simplification14.6%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (sqrt y))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
return sqrt(y);
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = sqrt(y)
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
return Math.sqrt(y);
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): return math.sqrt(y)
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) return sqrt(y) end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp = code(x, y, z, t)
tmp = sqrt(y);
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := N[Sqrt[y], $MachinePrecision]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\sqrt{y}
\end{array}
Initial program 92.2%
+-commutative92.2%
associate-+r+92.2%
associate-+r-72.0%
associate-+l-57.4%
associate-+r-49.7%
Simplified39.5%
Taylor expanded in t around inf 10.1%
associate--l+21.3%
+-commutative21.3%
+-commutative21.3%
Simplified21.3%
Taylor expanded in z around inf 14.4%
Taylor expanded in x around 0 18.3%
Taylor expanded in y around inf 6.9%
Final simplification6.9%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (* x 0.0))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
return x * 0.0;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = x * 0.0d0
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
return x * 0.0;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): return x * 0.0
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) return Float64(x * 0.0) end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp = code(x, y, z, t)
tmp = x * 0.0;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := N[(x * 0.0), $MachinePrecision]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
x \cdot 0
\end{array}
Initial program 92.2%
+-commutative92.2%
associate-+r+92.2%
associate-+r-72.0%
associate-+l-57.4%
associate-+r-49.7%
Simplified39.5%
Taylor expanded in t around inf 10.1%
associate--l+21.3%
+-commutative21.3%
+-commutative21.3%
Simplified21.3%
Taylor expanded in x around -inf 0.0%
mul-1-neg0.0%
*-commutative0.0%
distribute-rgt-neg-in0.0%
Simplified21.2%
Taylor expanded in x around inf 3.1%
distribute-rgt1-in3.1%
metadata-eval3.1%
mul0-lft3.1%
Simplified3.1%
Final simplification3.1%
(FPCore (x y z t)
:precision binary64
(+
(+
(+
(/ 1.0 (+ (sqrt (+ x 1.0)) (sqrt x)))
(/ 1.0 (+ (sqrt (+ y 1.0)) (sqrt y))))
(/ 1.0 (+ (sqrt (+ z 1.0)) (sqrt z))))
(- (sqrt (+ t 1.0)) (sqrt t))))
double code(double x, double y, double z, double t) {
return (((1.0 / (sqrt((x + 1.0)) + sqrt(x))) + (1.0 / (sqrt((y + 1.0)) + sqrt(y)))) + (1.0 / (sqrt((z + 1.0)) + sqrt(z)))) + (sqrt((t + 1.0)) - sqrt(t));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (((1.0d0 / (sqrt((x + 1.0d0)) + sqrt(x))) + (1.0d0 / (sqrt((y + 1.0d0)) + sqrt(y)))) + (1.0d0 / (sqrt((z + 1.0d0)) + sqrt(z)))) + (sqrt((t + 1.0d0)) - sqrt(t))
end function
public static double code(double x, double y, double z, double t) {
return (((1.0 / (Math.sqrt((x + 1.0)) + Math.sqrt(x))) + (1.0 / (Math.sqrt((y + 1.0)) + Math.sqrt(y)))) + (1.0 / (Math.sqrt((z + 1.0)) + Math.sqrt(z)))) + (Math.sqrt((t + 1.0)) - Math.sqrt(t));
}
def code(x, y, z, t): return (((1.0 / (math.sqrt((x + 1.0)) + math.sqrt(x))) + (1.0 / (math.sqrt((y + 1.0)) + math.sqrt(y)))) + (1.0 / (math.sqrt((z + 1.0)) + math.sqrt(z)))) + (math.sqrt((t + 1.0)) - math.sqrt(t))
function code(x, y, z, t) return Float64(Float64(Float64(Float64(1.0 / Float64(sqrt(Float64(x + 1.0)) + sqrt(x))) + Float64(1.0 / Float64(sqrt(Float64(y + 1.0)) + sqrt(y)))) + Float64(1.0 / Float64(sqrt(Float64(z + 1.0)) + sqrt(z)))) + Float64(sqrt(Float64(t + 1.0)) - sqrt(t))) end
function tmp = code(x, y, z, t) tmp = (((1.0 / (sqrt((x + 1.0)) + sqrt(x))) + (1.0 / (sqrt((y + 1.0)) + sqrt(y)))) + (1.0 / (sqrt((z + 1.0)) + sqrt(z)))) + (sqrt((t + 1.0)) - sqrt(t)); end
code[x_, y_, z_, t_] := N[(N[(N[(N[(1.0 / N[(N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[N[(z + 1.0), $MachinePrecision]], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(t + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\frac{1}{\sqrt{x + 1} + \sqrt{x}} + \frac{1}{\sqrt{y + 1} + \sqrt{y}}\right) + \frac{1}{\sqrt{z + 1} + \sqrt{z}}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)
\end{array}
herbie shell --seed 2024115
(FPCore (x y z t)
:name "Main:z from "
:precision binary64
:alt
(+ (+ (+ (/ 1.0 (+ (sqrt (+ x 1.0)) (sqrt x))) (/ 1.0 (+ (sqrt (+ y 1.0)) (sqrt y)))) (/ 1.0 (+ (sqrt (+ z 1.0)) (sqrt z)))) (- (sqrt (+ t 1.0)) (sqrt t)))
(+ (+ (+ (- (sqrt (+ x 1.0)) (sqrt x)) (- (sqrt (+ y 1.0)) (sqrt y))) (- (sqrt (+ z 1.0)) (sqrt z))) (- (sqrt (+ t 1.0)) (sqrt t))))