
(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 18 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (+ (+ (+ (- (sqrt (+ x 1.0)) (sqrt x)) (- (sqrt (+ y 1.0)) (sqrt y))) (- (sqrt (+ z 1.0)) (sqrt z))) (- (sqrt (+ t 1.0)) (sqrt t))))
double code(double x, double y, double z, double t) {
return (((sqrt((x + 1.0)) - sqrt(x)) + (sqrt((y + 1.0)) - sqrt(y))) + (sqrt((z + 1.0)) - sqrt(z))) + (sqrt((t + 1.0)) - sqrt(t));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (((sqrt((x + 1.0d0)) - sqrt(x)) + (sqrt((y + 1.0d0)) - sqrt(y))) + (sqrt((z + 1.0d0)) - sqrt(z))) + (sqrt((t + 1.0d0)) - sqrt(t))
end function
public static double code(double x, double y, double z, double t) {
return (((Math.sqrt((x + 1.0)) - Math.sqrt(x)) + (Math.sqrt((y + 1.0)) - Math.sqrt(y))) + (Math.sqrt((z + 1.0)) - Math.sqrt(z))) + (Math.sqrt((t + 1.0)) - Math.sqrt(t));
}
def code(x, y, z, t): return (((math.sqrt((x + 1.0)) - math.sqrt(x)) + (math.sqrt((y + 1.0)) - math.sqrt(y))) + (math.sqrt((z + 1.0)) - math.sqrt(z))) + (math.sqrt((t + 1.0)) - math.sqrt(t))
function code(x, y, z, t) return Float64(Float64(Float64(Float64(sqrt(Float64(x + 1.0)) - sqrt(x)) + Float64(sqrt(Float64(y + 1.0)) - sqrt(y))) + Float64(sqrt(Float64(z + 1.0)) - sqrt(z))) + Float64(sqrt(Float64(t + 1.0)) - sqrt(t))) end
function tmp = code(x, y, z, t) tmp = (((sqrt((x + 1.0)) - sqrt(x)) + (sqrt((y + 1.0)) - sqrt(y))) + (sqrt((z + 1.0)) - sqrt(z))) + (sqrt((t + 1.0)) - sqrt(t)); end
code[x_, y_, z_, t_] := N[(N[(N[(N[(N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(z + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(t + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{y + 1} - \sqrt{y}\right)\right) + \left(\sqrt{z + 1} - \sqrt{z}\right)\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)
\end{array}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ 1.0 y)))
(t_2 (sqrt (+ 1.0 x)))
(t_3 (/ 1.0 (+ (sqrt z) (sqrt (+ 1.0 z))))))
(if (<= t 1.65e+30)
(+
(- t_2 (sqrt x))
(+ (- t_1 (sqrt y)) (+ (/ 1.0 (+ (sqrt (+ 1.0 t)) (sqrt t))) t_3)))
(+ t_3 (+ (/ 1.0 (+ t_1 (sqrt y))) (/ 1.0 (+ (sqrt x) t_2)))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + y));
double t_2 = sqrt((1.0 + x));
double t_3 = 1.0 / (sqrt(z) + sqrt((1.0 + z)));
double tmp;
if (t <= 1.65e+30) {
tmp = (t_2 - sqrt(x)) + ((t_1 - sqrt(y)) + ((1.0 / (sqrt((1.0 + t)) + sqrt(t))) + t_3));
} else {
tmp = t_3 + ((1.0 / (t_1 + sqrt(y))) + (1.0 / (sqrt(x) + t_2)));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = sqrt((1.0d0 + y))
t_2 = sqrt((1.0d0 + x))
t_3 = 1.0d0 / (sqrt(z) + sqrt((1.0d0 + z)))
if (t <= 1.65d+30) then
tmp = (t_2 - sqrt(x)) + ((t_1 - sqrt(y)) + ((1.0d0 / (sqrt((1.0d0 + t)) + sqrt(t))) + t_3))
else
tmp = t_3 + ((1.0d0 / (t_1 + sqrt(y))) + (1.0d0 / (sqrt(x) + t_2)))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + y));
double t_2 = Math.sqrt((1.0 + x));
double t_3 = 1.0 / (Math.sqrt(z) + Math.sqrt((1.0 + z)));
double tmp;
if (t <= 1.65e+30) {
tmp = (t_2 - Math.sqrt(x)) + ((t_1 - Math.sqrt(y)) + ((1.0 / (Math.sqrt((1.0 + t)) + Math.sqrt(t))) + t_3));
} else {
tmp = t_3 + ((1.0 / (t_1 + Math.sqrt(y))) + (1.0 / (Math.sqrt(x) + t_2)));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + y)) t_2 = math.sqrt((1.0 + x)) t_3 = 1.0 / (math.sqrt(z) + math.sqrt((1.0 + z))) tmp = 0 if t <= 1.65e+30: tmp = (t_2 - math.sqrt(x)) + ((t_1 - math.sqrt(y)) + ((1.0 / (math.sqrt((1.0 + t)) + math.sqrt(t))) + t_3)) else: tmp = t_3 + ((1.0 / (t_1 + math.sqrt(y))) + (1.0 / (math.sqrt(x) + t_2))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(1.0 + y)) t_2 = sqrt(Float64(1.0 + x)) t_3 = Float64(1.0 / Float64(sqrt(z) + sqrt(Float64(1.0 + z)))) tmp = 0.0 if (t <= 1.65e+30) tmp = Float64(Float64(t_2 - sqrt(x)) + Float64(Float64(t_1 - sqrt(y)) + Float64(Float64(1.0 / Float64(sqrt(Float64(1.0 + t)) + sqrt(t))) + t_3))); else tmp = Float64(t_3 + Float64(Float64(1.0 / Float64(t_1 + sqrt(y))) + Float64(1.0 / Float64(sqrt(x) + t_2)))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + y));
t_2 = sqrt((1.0 + x));
t_3 = 1.0 / (sqrt(z) + sqrt((1.0 + z)));
tmp = 0.0;
if (t <= 1.65e+30)
tmp = (t_2 - sqrt(x)) + ((t_1 - sqrt(y)) + ((1.0 / (sqrt((1.0 + t)) + sqrt(t))) + t_3));
else
tmp = t_3 + ((1.0 / (t_1 + sqrt(y))) + (1.0 / (sqrt(x) + t_2)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[(1.0 / N[(N[Sqrt[z], $MachinePrecision] + N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, 1.65e+30], N[(N[(t$95$2 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$1 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 / N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] + N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$3 + N[(N[(1.0 / N[(t$95$1 + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + y}\\
t_2 := \sqrt{1 + x}\\
t_3 := \frac{1}{\sqrt{z} + \sqrt{1 + z}}\\
\mathbf{if}\;t \leq 1.65 \cdot 10^{+30}:\\
\;\;\;\;\left(t_2 - \sqrt{x}\right) + \left(\left(t_1 - \sqrt{y}\right) + \left(\frac{1}{\sqrt{1 + t} + \sqrt{t}} + t_3\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_3 + \left(\frac{1}{t_1 + \sqrt{y}} + \frac{1}{\sqrt{x} + t_2}\right)\\
\end{array}
\end{array}
if t < 1.65000000000000013e30Initial program 95.0%
associate-+l+95.0%
associate-+l+95.0%
+-commutative95.0%
+-commutative95.0%
+-commutative95.0%
Simplified95.0%
flip--95.1%
add-sqr-sqrt73.4%
add-sqr-sqrt95.3%
Applied egg-rr95.3%
associate--l+95.5%
+-inverses95.5%
metadata-eval95.5%
+-commutative95.5%
+-commutative95.5%
Simplified95.5%
flip--95.7%
add-sqr-sqrt95.0%
add-sqr-sqrt97.1%
Applied egg-rr97.1%
associate--l+97.9%
+-inverses97.9%
metadata-eval97.9%
+-commutative97.9%
+-commutative97.9%
Simplified97.9%
if 1.65000000000000013e30 < t Initial program 88.9%
associate-+l+88.9%
associate-+l+88.9%
+-commutative88.9%
+-commutative88.9%
+-commutative88.9%
Simplified88.9%
flip--89.1%
add-sqr-sqrt68.0%
add-sqr-sqrt89.1%
Applied egg-rr89.1%
+-commutative89.1%
associate--l+91.8%
+-inverses91.8%
metadata-eval91.8%
+-commutative91.8%
+-commutative91.8%
Simplified91.8%
flip--91.7%
add-sqr-sqrt68.3%
add-sqr-sqrt92.0%
Applied egg-rr92.0%
associate--l+95.5%
+-inverses95.5%
metadata-eval95.5%
Simplified95.5%
flip--88.8%
add-sqr-sqrt72.6%
add-sqr-sqrt89.6%
Applied egg-rr96.3%
associate--l+91.9%
+-inverses91.9%
metadata-eval91.9%
+-commutative91.9%
+-commutative91.9%
Simplified98.4%
Taylor expanded in t around inf 98.4%
associate-+r+98.4%
+-commutative98.4%
Simplified98.4%
Final simplification98.1%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (+ (+ (/ 1.0 (+ (sqrt (+ 1.0 y)) (sqrt y))) (+ (- (sqrt (+ 1.0 t)) (sqrt t)) (/ 1.0 (+ (sqrt z) (sqrt (+ 1.0 z)))))) (/ 1.0 (+ (sqrt x) (sqrt (+ 1.0 x))))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
return ((1.0 / (sqrt((1.0 + y)) + sqrt(y))) + ((sqrt((1.0 + t)) - sqrt(t)) + (1.0 / (sqrt(z) + sqrt((1.0 + z)))))) + (1.0 / (sqrt(x) + sqrt((1.0 + 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((1.0d0 + y)) + sqrt(y))) + ((sqrt((1.0d0 + t)) - sqrt(t)) + (1.0d0 / (sqrt(z) + sqrt((1.0d0 + z)))))) + (1.0d0 / (sqrt(x) + sqrt((1.0d0 + 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((1.0 + y)) + Math.sqrt(y))) + ((Math.sqrt((1.0 + t)) - Math.sqrt(t)) + (1.0 / (Math.sqrt(z) + Math.sqrt((1.0 + z)))))) + (1.0 / (Math.sqrt(x) + Math.sqrt((1.0 + x))));
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): return ((1.0 / (math.sqrt((1.0 + y)) + math.sqrt(y))) + ((math.sqrt((1.0 + t)) - math.sqrt(t)) + (1.0 / (math.sqrt(z) + math.sqrt((1.0 + z)))))) + (1.0 / (math.sqrt(x) + math.sqrt((1.0 + x))))
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) return Float64(Float64(Float64(1.0 / Float64(sqrt(Float64(1.0 + y)) + sqrt(y))) + Float64(Float64(sqrt(Float64(1.0 + t)) - sqrt(t)) + Float64(1.0 / Float64(sqrt(z) + sqrt(Float64(1.0 + z)))))) + Float64(1.0 / Float64(sqrt(x) + sqrt(Float64(1.0 + x))))) end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp = code(x, y, z, t)
tmp = ((1.0 / (sqrt((1.0 + y)) + sqrt(y))) + ((sqrt((1.0 + t)) - sqrt(t)) + (1.0 / (sqrt(z) + sqrt((1.0 + z)))))) + (1.0 / (sqrt(x) + sqrt((1.0 + 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[(N[(1.0 / N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[z], $MachinePrecision] + N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\left(\frac{1}{\sqrt{1 + y} + \sqrt{y}} + \left(\left(\sqrt{1 + t} - \sqrt{t}\right) + \frac{1}{\sqrt{z} + \sqrt{1 + z}}\right)\right) + \frac{1}{\sqrt{x} + \sqrt{1 + x}}
\end{array}
Initial program 92.2%
associate-+l+92.2%
associate-+l+92.2%
+-commutative92.2%
+-commutative92.2%
+-commutative92.2%
Simplified92.2%
flip--92.4%
add-sqr-sqrt73.1%
add-sqr-sqrt92.6%
Applied egg-rr92.6%
+-commutative92.6%
associate--l+94.1%
+-inverses94.1%
metadata-eval94.1%
+-commutative94.1%
+-commutative94.1%
Simplified94.1%
flip--94.3%
add-sqr-sqrt71.5%
add-sqr-sqrt94.6%
Applied egg-rr94.6%
associate--l+96.3%
+-inverses96.3%
metadata-eval96.3%
Simplified96.3%
flip--92.2%
add-sqr-sqrt73.0%
add-sqr-sqrt92.7%
Applied egg-rr96.8%
associate--l+93.8%
+-inverses93.8%
metadata-eval93.8%
+-commutative93.8%
+-commutative93.8%
Simplified97.9%
Final simplification97.9%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ 1.0 x))) (t_2 (sqrt (+ 1.0 z))))
(if (<= z 1200.0)
(+
(- t_1 (sqrt x))
(+
(- (+ 1.0 (* y 0.5)) (sqrt y))
(+ (/ 1.0 (+ (sqrt (+ 1.0 t)) (sqrt t))) (- t_2 (sqrt z)))))
(+
(/ 1.0 (+ (sqrt z) t_2))
(+ (/ 1.0 (+ (sqrt (+ 1.0 y)) (sqrt y))) (/ 1.0 (+ (sqrt x) t_1)))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + x));
double t_2 = sqrt((1.0 + z));
double tmp;
if (z <= 1200.0) {
tmp = (t_1 - sqrt(x)) + (((1.0 + (y * 0.5)) - sqrt(y)) + ((1.0 / (sqrt((1.0 + t)) + sqrt(t))) + (t_2 - sqrt(z))));
} else {
tmp = (1.0 / (sqrt(z) + t_2)) + ((1.0 / (sqrt((1.0 + y)) + sqrt(y))) + (1.0 / (sqrt(x) + t_1)));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = sqrt((1.0d0 + x))
t_2 = sqrt((1.0d0 + z))
if (z <= 1200.0d0) then
tmp = (t_1 - sqrt(x)) + (((1.0d0 + (y * 0.5d0)) - sqrt(y)) + ((1.0d0 / (sqrt((1.0d0 + t)) + sqrt(t))) + (t_2 - sqrt(z))))
else
tmp = (1.0d0 / (sqrt(z) + t_2)) + ((1.0d0 / (sqrt((1.0d0 + y)) + sqrt(y))) + (1.0d0 / (sqrt(x) + t_1)))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + x));
double t_2 = Math.sqrt((1.0 + z));
double tmp;
if (z <= 1200.0) {
tmp = (t_1 - Math.sqrt(x)) + (((1.0 + (y * 0.5)) - Math.sqrt(y)) + ((1.0 / (Math.sqrt((1.0 + t)) + Math.sqrt(t))) + (t_2 - Math.sqrt(z))));
} else {
tmp = (1.0 / (Math.sqrt(z) + t_2)) + ((1.0 / (Math.sqrt((1.0 + y)) + Math.sqrt(y))) + (1.0 / (Math.sqrt(x) + t_1)));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + x)) t_2 = math.sqrt((1.0 + z)) tmp = 0 if z <= 1200.0: tmp = (t_1 - math.sqrt(x)) + (((1.0 + (y * 0.5)) - math.sqrt(y)) + ((1.0 / (math.sqrt((1.0 + t)) + math.sqrt(t))) + (t_2 - math.sqrt(z)))) else: tmp = (1.0 / (math.sqrt(z) + t_2)) + ((1.0 / (math.sqrt((1.0 + y)) + math.sqrt(y))) + (1.0 / (math.sqrt(x) + t_1))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(1.0 + x)) t_2 = sqrt(Float64(1.0 + z)) tmp = 0.0 if (z <= 1200.0) tmp = Float64(Float64(t_1 - sqrt(x)) + Float64(Float64(Float64(1.0 + Float64(y * 0.5)) - sqrt(y)) + Float64(Float64(1.0 / Float64(sqrt(Float64(1.0 + t)) + sqrt(t))) + Float64(t_2 - sqrt(z))))); else tmp = Float64(Float64(1.0 / Float64(sqrt(z) + t_2)) + Float64(Float64(1.0 / Float64(sqrt(Float64(1.0 + y)) + sqrt(y))) + Float64(1.0 / Float64(sqrt(x) + t_1)))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + x));
t_2 = sqrt((1.0 + z));
tmp = 0.0;
if (z <= 1200.0)
tmp = (t_1 - sqrt(x)) + (((1.0 + (y * 0.5)) - sqrt(y)) + ((1.0 / (sqrt((1.0 + t)) + sqrt(t))) + (t_2 - sqrt(z))));
else
tmp = (1.0 / (sqrt(z) + t_2)) + ((1.0 / (sqrt((1.0 + y)) + sqrt(y))) + (1.0 / (sqrt(x) + t_1)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[z, 1200.0], N[(N[(t$95$1 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(N[(N[(1.0 + N[(y * 0.5), $MachinePrecision]), $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 / N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] + N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$2 - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[(N[Sqrt[z], $MachinePrecision] + t$95$2), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 / N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + x}\\
t_2 := \sqrt{1 + z}\\
\mathbf{if}\;z \leq 1200:\\
\;\;\;\;\left(t_1 - \sqrt{x}\right) + \left(\left(\left(1 + y \cdot 0.5\right) - \sqrt{y}\right) + \left(\frac{1}{\sqrt{1 + t} + \sqrt{t}} + \left(t_2 - \sqrt{z}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{z} + t_2} + \left(\frac{1}{\sqrt{1 + y} + \sqrt{y}} + \frac{1}{\sqrt{x} + t_1}\right)\\
\end{array}
\end{array}
if z < 1200Initial program 97.0%
associate-+l+97.0%
associate-+l+97.0%
+-commutative97.0%
+-commutative97.0%
+-commutative97.0%
Simplified97.0%
flip--97.1%
add-sqr-sqrt75.2%
add-sqr-sqrt97.7%
Applied egg-rr97.7%
associate--l+98.1%
+-inverses98.1%
metadata-eval98.1%
+-commutative98.1%
+-commutative98.1%
Simplified98.1%
Taylor expanded in y around 0 46.1%
*-commutative46.1%
Simplified46.1%
if 1200 < z Initial program 86.7%
associate-+l+86.7%
associate-+l+86.7%
+-commutative86.7%
+-commutative86.7%
+-commutative86.7%
Simplified86.7%
flip--87.0%
add-sqr-sqrt73.3%
add-sqr-sqrt87.3%
Applied egg-rr87.3%
+-commutative87.3%
associate--l+90.1%
+-inverses90.1%
metadata-eval90.1%
+-commutative90.1%
+-commutative90.1%
Simplified90.1%
flip--90.1%
add-sqr-sqrt73.6%
add-sqr-sqrt90.3%
Applied egg-rr90.3%
associate--l+93.5%
+-inverses93.5%
metadata-eval93.5%
Simplified93.5%
flip--86.7%
add-sqr-sqrt45.8%
add-sqr-sqrt87.7%
Applied egg-rr94.6%
associate--l+90.1%
+-inverses90.1%
metadata-eval90.1%
+-commutative90.1%
+-commutative90.1%
Simplified96.8%
Taylor expanded in t around inf 56.8%
associate-+r+56.8%
+-commutative56.8%
Simplified56.8%
Final simplification51.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))) (t_2 (sqrt (+ 1.0 x))))
(if (<= z 1200.0)
(+
(- t_2 (sqrt x))
(+ 1.0 (+ (/ 1.0 (+ (sqrt (+ 1.0 t)) (sqrt t))) (- t_1 (sqrt z)))))
(+
(/ 1.0 (+ (sqrt z) t_1))
(+ (/ 1.0 (+ (sqrt (+ 1.0 y)) (sqrt y))) (/ 1.0 (+ (sqrt x) t_2)))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + z));
double t_2 = sqrt((1.0 + x));
double tmp;
if (z <= 1200.0) {
tmp = (t_2 - sqrt(x)) + (1.0 + ((1.0 / (sqrt((1.0 + t)) + sqrt(t))) + (t_1 - sqrt(z))));
} else {
tmp = (1.0 / (sqrt(z) + t_1)) + ((1.0 / (sqrt((1.0 + y)) + sqrt(y))) + (1.0 / (sqrt(x) + t_2)));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = sqrt((1.0d0 + z))
t_2 = sqrt((1.0d0 + x))
if (z <= 1200.0d0) then
tmp = (t_2 - sqrt(x)) + (1.0d0 + ((1.0d0 / (sqrt((1.0d0 + t)) + sqrt(t))) + (t_1 - sqrt(z))))
else
tmp = (1.0d0 / (sqrt(z) + t_1)) + ((1.0d0 / (sqrt((1.0d0 + y)) + sqrt(y))) + (1.0d0 / (sqrt(x) + t_2)))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + z));
double t_2 = Math.sqrt((1.0 + x));
double tmp;
if (z <= 1200.0) {
tmp = (t_2 - Math.sqrt(x)) + (1.0 + ((1.0 / (Math.sqrt((1.0 + t)) + Math.sqrt(t))) + (t_1 - Math.sqrt(z))));
} else {
tmp = (1.0 / (Math.sqrt(z) + t_1)) + ((1.0 / (Math.sqrt((1.0 + y)) + Math.sqrt(y))) + (1.0 / (Math.sqrt(x) + t_2)));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + z)) t_2 = math.sqrt((1.0 + x)) tmp = 0 if z <= 1200.0: tmp = (t_2 - math.sqrt(x)) + (1.0 + ((1.0 / (math.sqrt((1.0 + t)) + math.sqrt(t))) + (t_1 - math.sqrt(z)))) else: tmp = (1.0 / (math.sqrt(z) + t_1)) + ((1.0 / (math.sqrt((1.0 + y)) + math.sqrt(y))) + (1.0 / (math.sqrt(x) + t_2))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(1.0 + z)) t_2 = sqrt(Float64(1.0 + x)) tmp = 0.0 if (z <= 1200.0) tmp = Float64(Float64(t_2 - sqrt(x)) + Float64(1.0 + Float64(Float64(1.0 / Float64(sqrt(Float64(1.0 + t)) + sqrt(t))) + Float64(t_1 - sqrt(z))))); else tmp = Float64(Float64(1.0 / Float64(sqrt(z) + t_1)) + Float64(Float64(1.0 / Float64(sqrt(Float64(1.0 + y)) + sqrt(y))) + Float64(1.0 / Float64(sqrt(x) + t_2)))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + z));
t_2 = sqrt((1.0 + x));
tmp = 0.0;
if (z <= 1200.0)
tmp = (t_2 - sqrt(x)) + (1.0 + ((1.0 / (sqrt((1.0 + t)) + sqrt(t))) + (t_1 - sqrt(z))));
else
tmp = (1.0 / (sqrt(z) + t_1)) + ((1.0 / (sqrt((1.0 + y)) + sqrt(y))) + (1.0 / (sqrt(x) + t_2)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[z, 1200.0], N[(N[(t$95$2 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(1.0 + N[(N[(1.0 / N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] + N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$1 - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[(N[Sqrt[z], $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 / N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + z}\\
t_2 := \sqrt{1 + x}\\
\mathbf{if}\;z \leq 1200:\\
\;\;\;\;\left(t_2 - \sqrt{x}\right) + \left(1 + \left(\frac{1}{\sqrt{1 + t} + \sqrt{t}} + \left(t_1 - \sqrt{z}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{z} + t_1} + \left(\frac{1}{\sqrt{1 + y} + \sqrt{y}} + \frac{1}{\sqrt{x} + t_2}\right)\\
\end{array}
\end{array}
if z < 1200Initial program 97.0%
associate-+l+97.0%
associate-+l+97.0%
+-commutative97.0%
+-commutative97.0%
+-commutative97.0%
Simplified97.0%
flip--97.1%
add-sqr-sqrt75.2%
add-sqr-sqrt97.7%
Applied egg-rr97.7%
associate--l+98.1%
+-inverses98.1%
metadata-eval98.1%
+-commutative98.1%
+-commutative98.1%
Simplified98.1%
Taylor expanded in y around 0 52.5%
if 1200 < z Initial program 86.7%
associate-+l+86.7%
associate-+l+86.7%
+-commutative86.7%
+-commutative86.7%
+-commutative86.7%
Simplified86.7%
flip--87.0%
add-sqr-sqrt73.3%
add-sqr-sqrt87.3%
Applied egg-rr87.3%
+-commutative87.3%
associate--l+90.1%
+-inverses90.1%
metadata-eval90.1%
+-commutative90.1%
+-commutative90.1%
Simplified90.1%
flip--90.1%
add-sqr-sqrt73.6%
add-sqr-sqrt90.3%
Applied egg-rr90.3%
associate--l+93.5%
+-inverses93.5%
metadata-eval93.5%
Simplified93.5%
flip--86.7%
add-sqr-sqrt45.8%
add-sqr-sqrt87.7%
Applied egg-rr94.6%
associate--l+90.1%
+-inverses90.1%
metadata-eval90.1%
+-commutative90.1%
+-commutative90.1%
Simplified96.8%
Taylor expanded in t around inf 56.8%
associate-+r+56.8%
+-commutative56.8%
Simplified56.8%
Final simplification54.5%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (sqrt (+ 1.0 x)) (sqrt x))))
(if (<= z 1.1e+17)
(+
t_1
(+
1.0
(+
(/ 1.0 (+ (sqrt (+ 1.0 t)) (sqrt t)))
(- (sqrt (+ 1.0 z)) (sqrt z)))))
(+ (/ 1.0 (+ (sqrt (+ 1.0 y)) (sqrt y))) t_1))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + x)) - sqrt(x);
double tmp;
if (z <= 1.1e+17) {
tmp = t_1 + (1.0 + ((1.0 / (sqrt((1.0 + t)) + sqrt(t))) + (sqrt((1.0 + z)) - sqrt(z))));
} else {
tmp = (1.0 / (sqrt((1.0 + y)) + sqrt(y))) + t_1;
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = sqrt((1.0d0 + x)) - sqrt(x)
if (z <= 1.1d+17) then
tmp = t_1 + (1.0d0 + ((1.0d0 / (sqrt((1.0d0 + t)) + sqrt(t))) + (sqrt((1.0d0 + z)) - sqrt(z))))
else
tmp = (1.0d0 / (sqrt((1.0d0 + y)) + sqrt(y))) + t_1
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + x)) - Math.sqrt(x);
double tmp;
if (z <= 1.1e+17) {
tmp = t_1 + (1.0 + ((1.0 / (Math.sqrt((1.0 + t)) + Math.sqrt(t))) + (Math.sqrt((1.0 + z)) - Math.sqrt(z))));
} else {
tmp = (1.0 / (Math.sqrt((1.0 + y)) + Math.sqrt(y))) + t_1;
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + x)) - math.sqrt(x) tmp = 0 if z <= 1.1e+17: tmp = t_1 + (1.0 + ((1.0 / (math.sqrt((1.0 + t)) + math.sqrt(t))) + (math.sqrt((1.0 + z)) - math.sqrt(z)))) else: tmp = (1.0 / (math.sqrt((1.0 + y)) + math.sqrt(y))) + t_1 return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = Float64(sqrt(Float64(1.0 + x)) - sqrt(x)) tmp = 0.0 if (z <= 1.1e+17) tmp = Float64(t_1 + Float64(1.0 + Float64(Float64(1.0 / Float64(sqrt(Float64(1.0 + t)) + sqrt(t))) + Float64(sqrt(Float64(1.0 + z)) - sqrt(z))))); else tmp = Float64(Float64(1.0 / Float64(sqrt(Float64(1.0 + y)) + sqrt(y))) + t_1); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + x)) - sqrt(x);
tmp = 0.0;
if (z <= 1.1e+17)
tmp = t_1 + (1.0 + ((1.0 / (sqrt((1.0 + t)) + sqrt(t))) + (sqrt((1.0 + z)) - sqrt(z))));
else
tmp = (1.0 / (sqrt((1.0 + y)) + sqrt(y))) + t_1;
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, 1.1e+17], N[(t$95$1 + N[(1.0 + N[(N[(1.0 / N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] + N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + x} - \sqrt{x}\\
\mathbf{if}\;z \leq 1.1 \cdot 10^{+17}:\\
\;\;\;\;t_1 + \left(1 + \left(\frac{1}{\sqrt{1 + t} + \sqrt{t}} + \left(\sqrt{1 + z} - \sqrt{z}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{1 + y} + \sqrt{y}} + t_1\\
\end{array}
\end{array}
if z < 1.1e17Initial program 96.3%
associate-+l+96.3%
associate-+l+96.3%
+-commutative96.3%
+-commutative96.3%
+-commutative96.3%
Simplified96.3%
flip--97.2%
add-sqr-sqrt74.4%
add-sqr-sqrt97.8%
Applied egg-rr96.9%
associate--l+98.2%
+-inverses98.2%
metadata-eval98.2%
+-commutative98.2%
+-commutative98.2%
Simplified97.3%
Taylor expanded in y around 0 53.0%
if 1.1e17 < z Initial program 87.0%
associate-+l+87.0%
+-commutative87.0%
associate-+r-66.5%
associate-+l-58.6%
+-commutative58.6%
+-commutative58.6%
associate--l+58.6%
Simplified46.9%
Taylor expanded in z around inf 57.5%
associate--l+58.6%
+-commutative58.6%
Simplified58.6%
flip--90.6%
add-sqr-sqrt73.7%
add-sqr-sqrt90.8%
Applied egg-rr58.8%
associate--l+94.2%
+-inverses94.2%
metadata-eval94.2%
Simplified58.8%
Taylor expanded in t around inf 35.4%
associate--l+51.6%
Simplified51.6%
Final simplification52.4%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (sqrt (+ 1.0 x)) (sqrt x))))
(if (<= y 1.7e-23)
(+
t_1
(+
1.0
(+
(- (sqrt (+ 1.0 t)) (sqrt t))
(/ 1.0 (+ (sqrt z) (sqrt (+ 1.0 z)))))))
(+ (/ 1.0 (+ (sqrt (+ 1.0 y)) (sqrt y))) t_1))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + x)) - sqrt(x);
double tmp;
if (y <= 1.7e-23) {
tmp = t_1 + (1.0 + ((sqrt((1.0 + t)) - sqrt(t)) + (1.0 / (sqrt(z) + sqrt((1.0 + z))))));
} else {
tmp = (1.0 / (sqrt((1.0 + y)) + sqrt(y))) + t_1;
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = sqrt((1.0d0 + x)) - sqrt(x)
if (y <= 1.7d-23) then
tmp = t_1 + (1.0d0 + ((sqrt((1.0d0 + t)) - sqrt(t)) + (1.0d0 / (sqrt(z) + sqrt((1.0d0 + z))))))
else
tmp = (1.0d0 / (sqrt((1.0d0 + y)) + sqrt(y))) + t_1
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + x)) - Math.sqrt(x);
double tmp;
if (y <= 1.7e-23) {
tmp = t_1 + (1.0 + ((Math.sqrt((1.0 + t)) - Math.sqrt(t)) + (1.0 / (Math.sqrt(z) + Math.sqrt((1.0 + z))))));
} else {
tmp = (1.0 / (Math.sqrt((1.0 + y)) + Math.sqrt(y))) + t_1;
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + x)) - math.sqrt(x) tmp = 0 if y <= 1.7e-23: tmp = t_1 + (1.0 + ((math.sqrt((1.0 + t)) - math.sqrt(t)) + (1.0 / (math.sqrt(z) + math.sqrt((1.0 + z)))))) else: tmp = (1.0 / (math.sqrt((1.0 + y)) + math.sqrt(y))) + t_1 return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = Float64(sqrt(Float64(1.0 + x)) - sqrt(x)) tmp = 0.0 if (y <= 1.7e-23) tmp = Float64(t_1 + Float64(1.0 + Float64(Float64(sqrt(Float64(1.0 + t)) - sqrt(t)) + Float64(1.0 / Float64(sqrt(z) + sqrt(Float64(1.0 + z))))))); else tmp = Float64(Float64(1.0 / Float64(sqrt(Float64(1.0 + y)) + sqrt(y))) + t_1); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + x)) - sqrt(x);
tmp = 0.0;
if (y <= 1.7e-23)
tmp = t_1 + (1.0 + ((sqrt((1.0 + t)) - sqrt(t)) + (1.0 / (sqrt(z) + sqrt((1.0 + z))))));
else
tmp = (1.0 / (sqrt((1.0 + y)) + sqrt(y))) + t_1;
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 1.7e-23], N[(t$95$1 + N[(1.0 + N[(N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[z], $MachinePrecision] + N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + x} - \sqrt{x}\\
\mathbf{if}\;y \leq 1.7 \cdot 10^{-23}:\\
\;\;\;\;t_1 + \left(1 + \left(\left(\sqrt{1 + t} - \sqrt{t}\right) + \frac{1}{\sqrt{z} + \sqrt{1 + z}}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{1 + y} + \sqrt{y}} + t_1\\
\end{array}
\end{array}
if y < 1.7e-23Initial program 97.1%
associate-+l+97.1%
associate-+l+97.1%
+-commutative97.1%
+-commutative97.1%
+-commutative97.1%
Simplified97.1%
flip--97.1%
add-sqr-sqrt76.0%
add-sqr-sqrt97.9%
Applied egg-rr97.9%
associate--l+97.9%
+-inverses97.9%
metadata-eval97.9%
+-commutative97.9%
+-commutative97.9%
Simplified97.9%
Taylor expanded in y around 0 97.5%
if 1.7e-23 < y Initial program 88.1%
associate-+l+88.1%
+-commutative88.1%
associate-+r-86.0%
associate-+l-52.4%
+-commutative52.4%
+-commutative52.4%
associate--l+52.4%
Simplified40.6%
Taylor expanded in z around inf 30.3%
associate--l+30.5%
+-commutative30.5%
Simplified30.5%
flip--91.4%
add-sqr-sqrt49.6%
add-sqr-sqrt91.8%
Applied egg-rr30.7%
associate--l+94.9%
+-inverses94.9%
metadata-eval94.9%
Simplified30.7%
Taylor expanded in t around inf 20.4%
associate--l+26.3%
Simplified26.3%
Final simplification58.5%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (+ 1.0 (+ (/ 1.0 (+ (sqrt z) (sqrt (+ 1.0 z)))) (+ (/ 1.0 (+ (sqrt (+ 1.0 y)) (sqrt y))) (- (sqrt (+ 1.0 t)) (sqrt t))))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
return 1.0 + ((1.0 / (sqrt(z) + sqrt((1.0 + z)))) + ((1.0 / (sqrt((1.0 + y)) + sqrt(y))) + (sqrt((1.0 + t)) - sqrt(t))));
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = 1.0d0 + ((1.0d0 / (sqrt(z) + sqrt((1.0d0 + z)))) + ((1.0d0 / (sqrt((1.0d0 + y)) + sqrt(y))) + (sqrt((1.0d0 + t)) - sqrt(t))))
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
return 1.0 + ((1.0 / (Math.sqrt(z) + Math.sqrt((1.0 + z)))) + ((1.0 / (Math.sqrt((1.0 + y)) + Math.sqrt(y))) + (Math.sqrt((1.0 + t)) - Math.sqrt(t))));
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): return 1.0 + ((1.0 / (math.sqrt(z) + math.sqrt((1.0 + z)))) + ((1.0 / (math.sqrt((1.0 + y)) + math.sqrt(y))) + (math.sqrt((1.0 + t)) - math.sqrt(t))))
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) return Float64(1.0 + Float64(Float64(1.0 / Float64(sqrt(z) + sqrt(Float64(1.0 + z)))) + Float64(Float64(1.0 / Float64(sqrt(Float64(1.0 + y)) + sqrt(y))) + Float64(sqrt(Float64(1.0 + t)) - sqrt(t))))) end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp = code(x, y, z, t)
tmp = 1.0 + ((1.0 / (sqrt(z) + sqrt((1.0 + z)))) + ((1.0 / (sqrt((1.0 + y)) + sqrt(y))) + (sqrt((1.0 + t)) - sqrt(t))));
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := N[(1.0 + N[(N[(1.0 / N[(N[Sqrt[z], $MachinePrecision] + N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 / N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
1 + \left(\frac{1}{\sqrt{z} + \sqrt{1 + z}} + \left(\frac{1}{\sqrt{1 + y} + \sqrt{y}} + \left(\sqrt{1 + t} - \sqrt{t}\right)\right)\right)
\end{array}
Initial program 92.2%
associate-+l+92.2%
associate-+l+92.2%
+-commutative92.2%
+-commutative92.2%
+-commutative92.2%
Simplified92.2%
flip--92.4%
add-sqr-sqrt73.1%
add-sqr-sqrt92.6%
Applied egg-rr92.6%
+-commutative92.6%
associate--l+94.1%
+-inverses94.1%
metadata-eval94.1%
+-commutative94.1%
+-commutative94.1%
Simplified94.1%
flip--94.3%
add-sqr-sqrt71.5%
add-sqr-sqrt94.6%
Applied egg-rr94.6%
associate--l+96.3%
+-inverses96.3%
metadata-eval96.3%
Simplified96.3%
flip--92.2%
add-sqr-sqrt73.0%
add-sqr-sqrt92.7%
Applied egg-rr96.8%
associate--l+93.8%
+-inverses93.8%
metadata-eval93.8%
+-commutative93.8%
+-commutative93.8%
Simplified97.9%
Taylor expanded in x around 0 33.0%
associate--l+53.2%
associate-+r-59.6%
+-commutative59.6%
associate-+r-56.2%
+-commutative56.2%
associate-+l+56.2%
+-commutative56.2%
Simplified56.2%
Final simplification56.2%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (sqrt (+ 1.0 x)) (sqrt x))))
(if (<= z 7.6e+14)
(+
t_1
(+ 1.0 (+ (- (sqrt (+ 1.0 t)) (sqrt t)) (- (sqrt (+ 1.0 z)) (sqrt z)))))
(+ (/ 1.0 (+ (sqrt (+ 1.0 y)) (sqrt y))) t_1))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + x)) - sqrt(x);
double tmp;
if (z <= 7.6e+14) {
tmp = t_1 + (1.0 + ((sqrt((1.0 + t)) - sqrt(t)) + (sqrt((1.0 + z)) - sqrt(z))));
} else {
tmp = (1.0 / (sqrt((1.0 + y)) + sqrt(y))) + t_1;
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = sqrt((1.0d0 + x)) - sqrt(x)
if (z <= 7.6d+14) then
tmp = t_1 + (1.0d0 + ((sqrt((1.0d0 + t)) - sqrt(t)) + (sqrt((1.0d0 + z)) - sqrt(z))))
else
tmp = (1.0d0 / (sqrt((1.0d0 + y)) + sqrt(y))) + t_1
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + x)) - Math.sqrt(x);
double tmp;
if (z <= 7.6e+14) {
tmp = t_1 + (1.0 + ((Math.sqrt((1.0 + t)) - Math.sqrt(t)) + (Math.sqrt((1.0 + z)) - Math.sqrt(z))));
} else {
tmp = (1.0 / (Math.sqrt((1.0 + y)) + Math.sqrt(y))) + t_1;
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + x)) - math.sqrt(x) tmp = 0 if z <= 7.6e+14: tmp = t_1 + (1.0 + ((math.sqrt((1.0 + t)) - math.sqrt(t)) + (math.sqrt((1.0 + z)) - math.sqrt(z)))) else: tmp = (1.0 / (math.sqrt((1.0 + y)) + math.sqrt(y))) + t_1 return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = Float64(sqrt(Float64(1.0 + x)) - sqrt(x)) tmp = 0.0 if (z <= 7.6e+14) tmp = Float64(t_1 + Float64(1.0 + Float64(Float64(sqrt(Float64(1.0 + t)) - sqrt(t)) + Float64(sqrt(Float64(1.0 + z)) - sqrt(z))))); else tmp = Float64(Float64(1.0 / Float64(sqrt(Float64(1.0 + y)) + sqrt(y))) + t_1); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + x)) - sqrt(x);
tmp = 0.0;
if (z <= 7.6e+14)
tmp = t_1 + (1.0 + ((sqrt((1.0 + t)) - sqrt(t)) + (sqrt((1.0 + z)) - sqrt(z))));
else
tmp = (1.0 / (sqrt((1.0 + y)) + sqrt(y))) + t_1;
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, 7.6e+14], N[(t$95$1 + N[(1.0 + N[(N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + x} - \sqrt{x}\\
\mathbf{if}\;z \leq 7.6 \cdot 10^{+14}:\\
\;\;\;\;t_1 + \left(1 + \left(\left(\sqrt{1 + t} - \sqrt{t}\right) + \left(\sqrt{1 + z} - \sqrt{z}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{1 + y} + \sqrt{y}} + t_1\\
\end{array}
\end{array}
if z < 7.6e14Initial program 96.3%
associate-+l+96.3%
associate-+l+96.3%
+-commutative96.3%
+-commutative96.3%
+-commutative96.3%
Simplified96.3%
Taylor expanded in y around 0 52.4%
if 7.6e14 < z Initial program 87.0%
associate-+l+87.0%
+-commutative87.0%
associate-+r-66.5%
associate-+l-58.6%
+-commutative58.6%
+-commutative58.6%
associate--l+58.6%
Simplified46.9%
Taylor expanded in z around inf 57.5%
associate--l+58.6%
+-commutative58.6%
Simplified58.6%
flip--90.6%
add-sqr-sqrt73.7%
add-sqr-sqrt90.8%
Applied egg-rr58.8%
associate--l+94.2%
+-inverses94.2%
metadata-eval94.2%
Simplified58.8%
Taylor expanded in t around inf 35.4%
associate--l+51.6%
Simplified51.6%
Final simplification52.0%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ 1.0 z))))
(if (<= z 3.05e-30)
(+ 2.0 (+ t_1 (- (sqrt (+ 1.0 t)) (+ (sqrt z) (sqrt t)))))
(if (<= z 1.1e+17)
(- (+ 1.0 (+ 1.0 t_1)) (+ (sqrt y) (sqrt z)))
(+
(/ 1.0 (+ (sqrt (+ 1.0 y)) (sqrt y)))
(- (sqrt (+ 1.0 x)) (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 (z <= 3.05e-30) {
tmp = 2.0 + (t_1 + (sqrt((1.0 + t)) - (sqrt(z) + sqrt(t))));
} else if (z <= 1.1e+17) {
tmp = (1.0 + (1.0 + t_1)) - (sqrt(y) + sqrt(z));
} else {
tmp = (1.0 / (sqrt((1.0 + y)) + sqrt(y))) + (sqrt((1.0 + x)) - sqrt(x));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = sqrt((1.0d0 + z))
if (z <= 3.05d-30) then
tmp = 2.0d0 + (t_1 + (sqrt((1.0d0 + t)) - (sqrt(z) + sqrt(t))))
else if (z <= 1.1d+17) then
tmp = (1.0d0 + (1.0d0 + t_1)) - (sqrt(y) + sqrt(z))
else
tmp = (1.0d0 / (sqrt((1.0d0 + y)) + sqrt(y))) + (sqrt((1.0d0 + x)) - sqrt(x))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + z));
double tmp;
if (z <= 3.05e-30) {
tmp = 2.0 + (t_1 + (Math.sqrt((1.0 + t)) - (Math.sqrt(z) + Math.sqrt(t))));
} else if (z <= 1.1e+17) {
tmp = (1.0 + (1.0 + t_1)) - (Math.sqrt(y) + Math.sqrt(z));
} else {
tmp = (1.0 / (Math.sqrt((1.0 + y)) + Math.sqrt(y))) + (Math.sqrt((1.0 + x)) - Math.sqrt(x));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + z)) tmp = 0 if z <= 3.05e-30: tmp = 2.0 + (t_1 + (math.sqrt((1.0 + t)) - (math.sqrt(z) + math.sqrt(t)))) elif z <= 1.1e+17: tmp = (1.0 + (1.0 + t_1)) - (math.sqrt(y) + math.sqrt(z)) else: tmp = (1.0 / (math.sqrt((1.0 + y)) + math.sqrt(y))) + (math.sqrt((1.0 + x)) - math.sqrt(x)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(1.0 + z)) tmp = 0.0 if (z <= 3.05e-30) tmp = Float64(2.0 + Float64(t_1 + Float64(sqrt(Float64(1.0 + t)) - Float64(sqrt(z) + sqrt(t))))); elseif (z <= 1.1e+17) tmp = Float64(Float64(1.0 + Float64(1.0 + t_1)) - Float64(sqrt(y) + sqrt(z))); else tmp = Float64(Float64(1.0 / Float64(sqrt(Float64(1.0 + y)) + sqrt(y))) + Float64(sqrt(Float64(1.0 + x)) - sqrt(x))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + z));
tmp = 0.0;
if (z <= 3.05e-30)
tmp = 2.0 + (t_1 + (sqrt((1.0 + t)) - (sqrt(z) + sqrt(t))));
elseif (z <= 1.1e+17)
tmp = (1.0 + (1.0 + t_1)) - (sqrt(y) + sqrt(z));
else
tmp = (1.0 / (sqrt((1.0 + y)) + sqrt(y))) + (sqrt((1.0 + x)) - sqrt(x));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[z, 3.05e-30], N[(2.0 + N[(t$95$1 + N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[(N[Sqrt[z], $MachinePrecision] + N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.1e+17], N[(N[(1.0 + N[(1.0 + t$95$1), $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + z}\\
\mathbf{if}\;z \leq 3.05 \cdot 10^{-30}:\\
\;\;\;\;2 + \left(t_1 + \left(\sqrt{1 + t} - \left(\sqrt{z} + \sqrt{t}\right)\right)\right)\\
\mathbf{elif}\;z \leq 1.1 \cdot 10^{+17}:\\
\;\;\;\;\left(1 + \left(1 + t_1\right)\right) - \left(\sqrt{y} + \sqrt{z}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{1 + y} + \sqrt{y}} + \left(\sqrt{1 + x} - \sqrt{x}\right)\\
\end{array}
\end{array}
if z < 3.0499999999999999e-30Initial program 96.9%
associate-+l+96.9%
+-commutative96.9%
associate-+r-81.7%
associate-+l-51.5%
+-commutative51.5%
+-commutative51.5%
associate--l+51.5%
Simplified35.8%
Taylor expanded in x around 0 19.8%
associate--l+44.1%
+-commutative44.1%
+-commutative44.1%
+-commutative44.1%
Simplified44.1%
Taylor expanded in y around 0 21.0%
associate--l+47.1%
associate--l+35.2%
Simplified35.2%
if 3.0499999999999999e-30 < z < 1.1e17Initial program 92.7%
associate-+l+92.7%
+-commutative92.7%
associate-+r-70.2%
associate-+l-32.0%
+-commutative32.0%
+-commutative32.0%
associate--l+32.0%
Simplified26.8%
Taylor expanded in x around 0 20.4%
associate--l+33.9%
+-commutative33.9%
+-commutative33.9%
+-commutative33.9%
Simplified33.9%
Taylor expanded in t around inf 27.5%
Taylor expanded in y around 0 24.9%
if 1.1e17 < z Initial program 87.0%
associate-+l+87.0%
+-commutative87.0%
associate-+r-66.5%
associate-+l-58.6%
+-commutative58.6%
+-commutative58.6%
associate--l+58.6%
Simplified46.9%
Taylor expanded in z around inf 57.5%
associate--l+58.6%
+-commutative58.6%
Simplified58.6%
flip--90.6%
add-sqr-sqrt73.7%
add-sqr-sqrt90.8%
Applied egg-rr58.8%
associate--l+94.2%
+-inverses94.2%
metadata-eval94.2%
Simplified58.8%
Taylor expanded in t around inf 35.4%
associate--l+51.6%
Simplified51.6%
Final simplification41.6%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ 1.0 z))))
(if (<= z 3.05e-30)
(+ 2.0 (+ t_1 (- (sqrt (+ 1.0 t)) (+ (sqrt z) (sqrt t)))))
(if (<= z 1.1e+17)
(- (+ 1.0 (+ 1.0 t_1)) (+ (sqrt y) (sqrt z)))
(+ (sqrt (+ 1.0 x)) (- (- (sqrt (+ 1.0 y)) (sqrt y)) (sqrt x)))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + z));
double tmp;
if (z <= 3.05e-30) {
tmp = 2.0 + (t_1 + (sqrt((1.0 + t)) - (sqrt(z) + sqrt(t))));
} else if (z <= 1.1e+17) {
tmp = (1.0 + (1.0 + t_1)) - (sqrt(y) + sqrt(z));
} else {
tmp = sqrt((1.0 + x)) + ((sqrt((1.0 + y)) - sqrt(y)) - sqrt(x));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = sqrt((1.0d0 + z))
if (z <= 3.05d-30) then
tmp = 2.0d0 + (t_1 + (sqrt((1.0d0 + t)) - (sqrt(z) + sqrt(t))))
else if (z <= 1.1d+17) then
tmp = (1.0d0 + (1.0d0 + t_1)) - (sqrt(y) + sqrt(z))
else
tmp = sqrt((1.0d0 + x)) + ((sqrt((1.0d0 + y)) - sqrt(y)) - sqrt(x))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + z));
double tmp;
if (z <= 3.05e-30) {
tmp = 2.0 + (t_1 + (Math.sqrt((1.0 + t)) - (Math.sqrt(z) + Math.sqrt(t))));
} else if (z <= 1.1e+17) {
tmp = (1.0 + (1.0 + t_1)) - (Math.sqrt(y) + Math.sqrt(z));
} else {
tmp = Math.sqrt((1.0 + x)) + ((Math.sqrt((1.0 + y)) - Math.sqrt(y)) - Math.sqrt(x));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + z)) tmp = 0 if z <= 3.05e-30: tmp = 2.0 + (t_1 + (math.sqrt((1.0 + t)) - (math.sqrt(z) + math.sqrt(t)))) elif z <= 1.1e+17: tmp = (1.0 + (1.0 + t_1)) - (math.sqrt(y) + math.sqrt(z)) else: tmp = math.sqrt((1.0 + x)) + ((math.sqrt((1.0 + y)) - math.sqrt(y)) - math.sqrt(x)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(1.0 + z)) tmp = 0.0 if (z <= 3.05e-30) tmp = Float64(2.0 + Float64(t_1 + Float64(sqrt(Float64(1.0 + t)) - Float64(sqrt(z) + sqrt(t))))); elseif (z <= 1.1e+17) tmp = Float64(Float64(1.0 + Float64(1.0 + t_1)) - Float64(sqrt(y) + sqrt(z))); else tmp = Float64(sqrt(Float64(1.0 + x)) + Float64(Float64(sqrt(Float64(1.0 + y)) - sqrt(y)) - sqrt(x))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + z));
tmp = 0.0;
if (z <= 3.05e-30)
tmp = 2.0 + (t_1 + (sqrt((1.0 + t)) - (sqrt(z) + sqrt(t))));
elseif (z <= 1.1e+17)
tmp = (1.0 + (1.0 + t_1)) - (sqrt(y) + sqrt(z));
else
tmp = sqrt((1.0 + x)) + ((sqrt((1.0 + y)) - sqrt(y)) - sqrt(x));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[z, 3.05e-30], N[(2.0 + N[(t$95$1 + N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[(N[Sqrt[z], $MachinePrecision] + N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.1e+17], N[(N[(1.0 + N[(1.0 + t$95$1), $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision] + N[(N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + z}\\
\mathbf{if}\;z \leq 3.05 \cdot 10^{-30}:\\
\;\;\;\;2 + \left(t_1 + \left(\sqrt{1 + t} - \left(\sqrt{z} + \sqrt{t}\right)\right)\right)\\
\mathbf{elif}\;z \leq 1.1 \cdot 10^{+17}:\\
\;\;\;\;\left(1 + \left(1 + t_1\right)\right) - \left(\sqrt{y} + \sqrt{z}\right)\\
\mathbf{else}:\\
\;\;\;\;\sqrt{1 + x} + \left(\left(\sqrt{1 + y} - \sqrt{y}\right) - \sqrt{x}\right)\\
\end{array}
\end{array}
if z < 3.0499999999999999e-30Initial program 96.9%
associate-+l+96.9%
+-commutative96.9%
associate-+r-81.7%
associate-+l-51.5%
+-commutative51.5%
+-commutative51.5%
associate--l+51.5%
Simplified35.8%
Taylor expanded in x around 0 19.8%
associate--l+44.1%
+-commutative44.1%
+-commutative44.1%
+-commutative44.1%
Simplified44.1%
Taylor expanded in y around 0 21.0%
associate--l+47.1%
associate--l+35.2%
Simplified35.2%
if 3.0499999999999999e-30 < z < 1.1e17Initial program 92.7%
associate-+l+92.7%
+-commutative92.7%
associate-+r-70.2%
associate-+l-32.0%
+-commutative32.0%
+-commutative32.0%
associate--l+32.0%
Simplified26.8%
Taylor expanded in x around 0 20.4%
associate--l+33.9%
+-commutative33.9%
+-commutative33.9%
+-commutative33.9%
Simplified33.9%
Taylor expanded in t around inf 27.5%
Taylor expanded in y around 0 24.9%
if 1.1e17 < z Initial program 87.0%
associate-+l+87.0%
+-commutative87.0%
associate-+r-66.5%
associate-+l-58.6%
+-commutative58.6%
+-commutative58.6%
associate--l+58.6%
Simplified46.9%
Taylor expanded in z around inf 57.5%
associate--l+58.6%
+-commutative58.6%
Simplified58.6%
Taylor expanded in t around inf 35.2%
Final simplification34.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 7.5e+14) (- (+ 1.0 (+ 1.0 (sqrt (+ 1.0 z)))) (+ (sqrt y) (sqrt z))) (+ (sqrt (+ 1.0 x)) (- (- (sqrt (+ 1.0 y)) (sqrt y)) (sqrt x)))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (z <= 7.5e+14) {
tmp = (1.0 + (1.0 + sqrt((1.0 + z)))) - (sqrt(y) + sqrt(z));
} else {
tmp = sqrt((1.0 + x)) + ((sqrt((1.0 + y)) - sqrt(y)) - sqrt(x));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (z <= 7.5d+14) then
tmp = (1.0d0 + (1.0d0 + sqrt((1.0d0 + z)))) - (sqrt(y) + sqrt(z))
else
tmp = sqrt((1.0d0 + x)) + ((sqrt((1.0d0 + y)) - sqrt(y)) - sqrt(x))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= 7.5e+14) {
tmp = (1.0 + (1.0 + Math.sqrt((1.0 + z)))) - (Math.sqrt(y) + Math.sqrt(z));
} else {
tmp = Math.sqrt((1.0 + x)) + ((Math.sqrt((1.0 + y)) - Math.sqrt(y)) - Math.sqrt(x));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if z <= 7.5e+14: tmp = (1.0 + (1.0 + math.sqrt((1.0 + z)))) - (math.sqrt(y) + math.sqrt(z)) else: tmp = math.sqrt((1.0 + x)) + ((math.sqrt((1.0 + y)) - math.sqrt(y)) - math.sqrt(x)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (z <= 7.5e+14) tmp = Float64(Float64(1.0 + Float64(1.0 + sqrt(Float64(1.0 + z)))) - Float64(sqrt(y) + sqrt(z))); else tmp = Float64(sqrt(Float64(1.0 + x)) + Float64(Float64(sqrt(Float64(1.0 + y)) - sqrt(y)) - sqrt(x))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (z <= 7.5e+14)
tmp = (1.0 + (1.0 + sqrt((1.0 + z)))) - (sqrt(y) + sqrt(z));
else
tmp = sqrt((1.0 + x)) + ((sqrt((1.0 + y)) - sqrt(y)) - sqrt(x));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[z, 7.5e+14], N[(N[(1.0 + N[(1.0 + N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision] + N[(N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq 7.5 \cdot 10^{+14}:\\
\;\;\;\;\left(1 + \left(1 + \sqrt{1 + z}\right)\right) - \left(\sqrt{y} + \sqrt{z}\right)\\
\mathbf{else}:\\
\;\;\;\;\sqrt{1 + x} + \left(\left(\sqrt{1 + y} - \sqrt{y}\right) - \sqrt{x}\right)\\
\end{array}
\end{array}
if z < 7.5e14Initial program 96.3%
associate-+l+96.3%
+-commutative96.3%
associate-+r-79.9%
associate-+l-48.5%
+-commutative48.5%
+-commutative48.5%
associate--l+48.5%
Simplified34.4%
Taylor expanded in x around 0 19.9%
associate--l+42.5%
+-commutative42.5%
+-commutative42.5%
+-commutative42.5%
Simplified42.5%
Taylor expanded in t around inf 27.8%
Taylor expanded in y around 0 22.1%
if 7.5e14 < z Initial program 87.0%
associate-+l+87.0%
+-commutative87.0%
associate-+r-66.5%
associate-+l-58.6%
+-commutative58.6%
+-commutative58.6%
associate--l+58.6%
Simplified46.9%
Taylor expanded in z around inf 57.5%
associate--l+58.6%
+-commutative58.6%
Simplified58.6%
Taylor expanded in t around inf 35.2%
Final simplification27.9%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= z 3.65e+14) (- (+ 1.0 (+ 1.0 (sqrt (+ 1.0 z)))) (+ (sqrt y) (sqrt z))) (+ 1.0 (- (hypot 1.0 (sqrt y)) (sqrt y)))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (z <= 3.65e+14) {
tmp = (1.0 + (1.0 + sqrt((1.0 + z)))) - (sqrt(y) + sqrt(z));
} else {
tmp = 1.0 + (hypot(1.0, sqrt(y)) - sqrt(y));
}
return tmp;
}
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= 3.65e+14) {
tmp = (1.0 + (1.0 + Math.sqrt((1.0 + z)))) - (Math.sqrt(y) + Math.sqrt(z));
} else {
tmp = 1.0 + (Math.hypot(1.0, Math.sqrt(y)) - Math.sqrt(y));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if z <= 3.65e+14: tmp = (1.0 + (1.0 + math.sqrt((1.0 + z)))) - (math.sqrt(y) + math.sqrt(z)) else: tmp = 1.0 + (math.hypot(1.0, math.sqrt(y)) - math.sqrt(y)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (z <= 3.65e+14) tmp = Float64(Float64(1.0 + Float64(1.0 + sqrt(Float64(1.0 + z)))) - Float64(sqrt(y) + sqrt(z))); else tmp = Float64(1.0 + Float64(hypot(1.0, sqrt(y)) - sqrt(y))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (z <= 3.65e+14)
tmp = (1.0 + (1.0 + sqrt((1.0 + z)))) - (sqrt(y) + sqrt(z));
else
tmp = 1.0 + (hypot(1.0, sqrt(y)) - sqrt(y));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[z, 3.65e+14], N[(N[(1.0 + N[(1.0 + N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(N[Sqrt[1.0 ^ 2 + N[Sqrt[y], $MachinePrecision] ^ 2], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq 3.65 \cdot 10^{+14}:\\
\;\;\;\;\left(1 + \left(1 + \sqrt{1 + z}\right)\right) - \left(\sqrt{y} + \sqrt{z}\right)\\
\mathbf{else}:\\
\;\;\;\;1 + \left(\mathsf{hypot}\left(1, \sqrt{y}\right) - \sqrt{y}\right)\\
\end{array}
\end{array}
if z < 3.65e14Initial program 96.3%
associate-+l+96.3%
+-commutative96.3%
associate-+r-79.9%
associate-+l-48.5%
+-commutative48.5%
+-commutative48.5%
associate--l+48.5%
Simplified34.4%
Taylor expanded in x around 0 19.9%
associate--l+42.5%
+-commutative42.5%
+-commutative42.5%
+-commutative42.5%
Simplified42.5%
Taylor expanded in t around inf 27.8%
Taylor expanded in y around 0 22.1%
if 3.65e14 < z Initial program 87.0%
associate-+l+87.0%
+-commutative87.0%
associate-+r-66.5%
associate-+l-58.6%
+-commutative58.6%
+-commutative58.6%
associate--l+58.6%
Simplified46.9%
Taylor expanded in z around inf 57.5%
associate--l+58.6%
+-commutative58.6%
Simplified58.6%
Taylor expanded in x around inf 19.1%
associate--l+31.7%
+-commutative31.7%
Simplified31.7%
Taylor expanded in t around 0 34.9%
associate--l+54.5%
rem-square-sqrt54.6%
hypot-1-def54.6%
Simplified54.6%
Final simplification36.5%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= z 5.1e+14) (+ (- (sqrt (+ 1.0 z)) (sqrt z)) 2.0) (+ 1.0 (- (hypot 1.0 (sqrt y)) (sqrt y)))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (z <= 5.1e+14) {
tmp = (sqrt((1.0 + z)) - sqrt(z)) + 2.0;
} else {
tmp = 1.0 + (hypot(1.0, sqrt(y)) - sqrt(y));
}
return tmp;
}
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= 5.1e+14) {
tmp = (Math.sqrt((1.0 + z)) - Math.sqrt(z)) + 2.0;
} else {
tmp = 1.0 + (Math.hypot(1.0, Math.sqrt(y)) - Math.sqrt(y));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if z <= 5.1e+14: tmp = (math.sqrt((1.0 + z)) - math.sqrt(z)) + 2.0 else: tmp = 1.0 + (math.hypot(1.0, math.sqrt(y)) - math.sqrt(y)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (z <= 5.1e+14) tmp = Float64(Float64(sqrt(Float64(1.0 + z)) - sqrt(z)) + 2.0); else tmp = Float64(1.0 + Float64(hypot(1.0, sqrt(y)) - sqrt(y))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (z <= 5.1e+14)
tmp = (sqrt((1.0 + z)) - sqrt(z)) + 2.0;
else
tmp = 1.0 + (hypot(1.0, sqrt(y)) - sqrt(y));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[z, 5.1e+14], N[(N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision], N[(1.0 + N[(N[Sqrt[1.0 ^ 2 + N[Sqrt[y], $MachinePrecision] ^ 2], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq 5.1 \cdot 10^{+14}:\\
\;\;\;\;\left(\sqrt{1 + z} - \sqrt{z}\right) + 2\\
\mathbf{else}:\\
\;\;\;\;1 + \left(\mathsf{hypot}\left(1, \sqrt{y}\right) - \sqrt{y}\right)\\
\end{array}
\end{array}
if z < 5.1e14Initial program 96.3%
associate-+l+96.3%
+-commutative96.3%
associate-+r-79.9%
associate-+l-48.5%
+-commutative48.5%
+-commutative48.5%
associate--l+48.5%
Simplified34.4%
Taylor expanded in x around 0 19.9%
associate--l+42.5%
+-commutative42.5%
+-commutative42.5%
+-commutative42.5%
Simplified42.5%
Taylor expanded in t around inf 27.8%
Taylor expanded in y around 0 40.4%
associate--l+40.4%
Simplified40.4%
if 5.1e14 < z Initial program 87.0%
associate-+l+87.0%
+-commutative87.0%
associate-+r-66.5%
associate-+l-58.6%
+-commutative58.6%
+-commutative58.6%
associate--l+58.6%
Simplified46.9%
Taylor expanded in z around inf 57.5%
associate--l+58.6%
+-commutative58.6%
Simplified58.6%
Taylor expanded in x around inf 19.1%
associate--l+31.7%
+-commutative31.7%
Simplified31.7%
Taylor expanded in t around 0 34.9%
associate--l+54.5%
rem-square-sqrt54.6%
hypot-1-def54.6%
Simplified54.6%
Final simplification46.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 1.1e+17) (+ (hypot 1.0 (sqrt z)) (- 2.0 (sqrt z))) (+ 1.0 (- (hypot 1.0 (sqrt y)) (sqrt y)))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (z <= 1.1e+17) {
tmp = hypot(1.0, sqrt(z)) + (2.0 - sqrt(z));
} else {
tmp = 1.0 + (hypot(1.0, sqrt(y)) - sqrt(y));
}
return tmp;
}
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= 1.1e+17) {
tmp = Math.hypot(1.0, Math.sqrt(z)) + (2.0 - Math.sqrt(z));
} else {
tmp = 1.0 + (Math.hypot(1.0, Math.sqrt(y)) - Math.sqrt(y));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if z <= 1.1e+17: tmp = math.hypot(1.0, math.sqrt(z)) + (2.0 - math.sqrt(z)) else: tmp = 1.0 + (math.hypot(1.0, math.sqrt(y)) - math.sqrt(y)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (z <= 1.1e+17) tmp = Float64(hypot(1.0, sqrt(z)) + Float64(2.0 - sqrt(z))); else tmp = Float64(1.0 + Float64(hypot(1.0, sqrt(y)) - sqrt(y))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (z <= 1.1e+17)
tmp = hypot(1.0, sqrt(z)) + (2.0 - sqrt(z));
else
tmp = 1.0 + (hypot(1.0, sqrt(y)) - sqrt(y));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[z, 1.1e+17], N[(N[Sqrt[1.0 ^ 2 + N[Sqrt[z], $MachinePrecision] ^ 2], $MachinePrecision] + N[(2.0 - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(N[Sqrt[1.0 ^ 2 + N[Sqrt[y], $MachinePrecision] ^ 2], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq 1.1 \cdot 10^{+17}:\\
\;\;\;\;\mathsf{hypot}\left(1, \sqrt{z}\right) + \left(2 - \sqrt{z}\right)\\
\mathbf{else}:\\
\;\;\;\;1 + \left(\mathsf{hypot}\left(1, \sqrt{y}\right) - \sqrt{y}\right)\\
\end{array}
\end{array}
if z < 1.1e17Initial program 96.3%
associate-+l+96.3%
+-commutative96.3%
associate-+r-79.9%
associate-+l-48.5%
+-commutative48.5%
+-commutative48.5%
associate--l+48.5%
Simplified34.4%
Taylor expanded in x around 0 19.9%
associate--l+42.5%
+-commutative42.5%
+-commutative42.5%
+-commutative42.5%
Simplified42.5%
Taylor expanded in t around inf 27.8%
Taylor expanded in y around 0 40.4%
+-commutative40.4%
associate--l+40.4%
rem-square-sqrt40.4%
hypot-1-def40.4%
Simplified40.4%
if 1.1e17 < z Initial program 87.0%
associate-+l+87.0%
+-commutative87.0%
associate-+r-66.5%
associate-+l-58.6%
+-commutative58.6%
+-commutative58.6%
associate--l+58.6%
Simplified46.9%
Taylor expanded in z around inf 57.5%
associate--l+58.6%
+-commutative58.6%
Simplified58.6%
Taylor expanded in x around inf 19.1%
associate--l+31.7%
+-commutative31.7%
Simplified31.7%
Taylor expanded in t around 0 34.9%
associate--l+54.5%
rem-square-sqrt54.6%
hypot-1-def54.6%
Simplified54.6%
Final simplification46.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 1.8) (- (+ 3.0 (* z 0.5)) (sqrt z)) (+ 1.0 (- (sqrt (+ 1.0 y)) (sqrt y)))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (z <= 1.8) {
tmp = (3.0 + (z * 0.5)) - sqrt(z);
} else {
tmp = 1.0 + (sqrt((1.0 + y)) - sqrt(y));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (z <= 1.8d0) then
tmp = (3.0d0 + (z * 0.5d0)) - sqrt(z)
else
tmp = 1.0d0 + (sqrt((1.0d0 + y)) - sqrt(y))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= 1.8) {
tmp = (3.0 + (z * 0.5)) - Math.sqrt(z);
} else {
tmp = 1.0 + (Math.sqrt((1.0 + y)) - Math.sqrt(y));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if z <= 1.8: tmp = (3.0 + (z * 0.5)) - math.sqrt(z) else: tmp = 1.0 + (math.sqrt((1.0 + y)) - math.sqrt(y)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (z <= 1.8) tmp = Float64(Float64(3.0 + Float64(z * 0.5)) - sqrt(z)); else tmp = Float64(1.0 + Float64(sqrt(Float64(1.0 + y)) - sqrt(y))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (z <= 1.8)
tmp = (3.0 + (z * 0.5)) - sqrt(z);
else
tmp = 1.0 + (sqrt((1.0 + y)) - sqrt(y));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[z, 1.8], N[(N[(3.0 + N[(z * 0.5), $MachinePrecision]), $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq 1.8:\\
\;\;\;\;\left(3 + z \cdot 0.5\right) - \sqrt{z}\\
\mathbf{else}:\\
\;\;\;\;1 + \left(\sqrt{1 + y} - \sqrt{y}\right)\\
\end{array}
\end{array}
if z < 1.80000000000000004Initial program 97.0%
associate-+l+97.0%
+-commutative97.0%
associate-+r-81.3%
associate-+l-49.6%
+-commutative49.6%
+-commutative49.6%
associate--l+49.6%
Simplified35.1%
Taylor expanded in x around 0 20.1%
associate--l+42.6%
+-commutative42.6%
+-commutative42.6%
+-commutative42.6%
Simplified42.6%
Taylor expanded in t around inf 27.5%
Taylor expanded in z around 0 27.5%
*-commutative27.5%
Simplified27.5%
Taylor expanded in y around 0 40.6%
if 1.80000000000000004 < z Initial program 86.7%
associate-+l+86.7%
+-commutative86.7%
associate-+r-65.8%
associate-+l-56.8%
+-commutative56.8%
+-commutative56.8%
associate--l+56.8%
Simplified45.4%
Taylor expanded in z around inf 55.0%
associate--l+56.0%
+-commutative56.0%
Simplified56.0%
Taylor expanded in x around inf 18.7%
associate--l+31.5%
+-commutative31.5%
Simplified31.5%
Taylor expanded in t around 0 34.1%
associate--l+52.9%
Simplified52.9%
Final simplification46.4%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= z 3.65e+14) (+ (- (sqrt (+ 1.0 z)) (sqrt z)) 2.0) (+ 1.0 (- (sqrt (+ 1.0 y)) (sqrt y)))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (z <= 3.65e+14) {
tmp = (sqrt((1.0 + z)) - sqrt(z)) + 2.0;
} else {
tmp = 1.0 + (sqrt((1.0 + y)) - sqrt(y));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (z <= 3.65d+14) then
tmp = (sqrt((1.0d0 + z)) - sqrt(z)) + 2.0d0
else
tmp = 1.0d0 + (sqrt((1.0d0 + y)) - sqrt(y))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= 3.65e+14) {
tmp = (Math.sqrt((1.0 + z)) - Math.sqrt(z)) + 2.0;
} else {
tmp = 1.0 + (Math.sqrt((1.0 + y)) - Math.sqrt(y));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if z <= 3.65e+14: tmp = (math.sqrt((1.0 + z)) - math.sqrt(z)) + 2.0 else: tmp = 1.0 + (math.sqrt((1.0 + y)) - math.sqrt(y)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (z <= 3.65e+14) tmp = Float64(Float64(sqrt(Float64(1.0 + z)) - sqrt(z)) + 2.0); else tmp = Float64(1.0 + Float64(sqrt(Float64(1.0 + y)) - sqrt(y))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (z <= 3.65e+14)
tmp = (sqrt((1.0 + z)) - sqrt(z)) + 2.0;
else
tmp = 1.0 + (sqrt((1.0 + y)) - sqrt(y));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[z, 3.65e+14], N[(N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision], N[(1.0 + N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq 3.65 \cdot 10^{+14}:\\
\;\;\;\;\left(\sqrt{1 + z} - \sqrt{z}\right) + 2\\
\mathbf{else}:\\
\;\;\;\;1 + \left(\sqrt{1 + y} - \sqrt{y}\right)\\
\end{array}
\end{array}
if z < 3.65e14Initial program 96.3%
associate-+l+96.3%
+-commutative96.3%
associate-+r-79.9%
associate-+l-48.5%
+-commutative48.5%
+-commutative48.5%
associate--l+48.5%
Simplified34.4%
Taylor expanded in x around 0 19.9%
associate--l+42.5%
+-commutative42.5%
+-commutative42.5%
+-commutative42.5%
Simplified42.5%
Taylor expanded in t around inf 27.8%
Taylor expanded in y around 0 40.4%
associate--l+40.4%
Simplified40.4%
if 3.65e14 < z Initial program 87.0%
associate-+l+87.0%
+-commutative87.0%
associate-+r-66.5%
associate-+l-58.6%
+-commutative58.6%
+-commutative58.6%
associate--l+58.6%
Simplified46.9%
Taylor expanded in z around inf 57.5%
associate--l+58.6%
+-commutative58.6%
Simplified58.6%
Taylor expanded in x around inf 19.1%
associate--l+31.7%
+-commutative31.7%
Simplified31.7%
Taylor expanded in t around 0 34.9%
associate--l+54.5%
Simplified54.5%
Final simplification46.6%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= z 5.6) (- (+ 3.0 (* z 0.5)) (sqrt z)) 1.0))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (z <= 5.6) {
tmp = (3.0 + (z * 0.5)) - sqrt(z);
} else {
tmp = 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.6d0) then
tmp = (3.0d0 + (z * 0.5d0)) - sqrt(z)
else
tmp = 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.6) {
tmp = (3.0 + (z * 0.5)) - Math.sqrt(z);
} else {
tmp = 1.0;
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if z <= 5.6: tmp = (3.0 + (z * 0.5)) - math.sqrt(z) else: tmp = 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.6) tmp = Float64(Float64(3.0 + Float64(z * 0.5)) - sqrt(z)); else tmp = 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.6)
tmp = (3.0 + (z * 0.5)) - sqrt(z);
else
tmp = 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.6], N[(N[(3.0 + N[(z * 0.5), $MachinePrecision]), $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision], 1.0]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq 5.6:\\
\;\;\;\;\left(3 + z \cdot 0.5\right) - \sqrt{z}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if z < 5.5999999999999996Initial program 97.0%
associate-+l+97.0%
+-commutative97.0%
associate-+r-81.3%
associate-+l-49.6%
+-commutative49.6%
+-commutative49.6%
associate--l+49.6%
Simplified35.1%
Taylor expanded in x around 0 20.1%
associate--l+42.6%
+-commutative42.6%
+-commutative42.6%
+-commutative42.6%
Simplified42.6%
Taylor expanded in t around inf 27.5%
Taylor expanded in z around 0 27.5%
*-commutative27.5%
Simplified27.5%
Taylor expanded in y around 0 40.6%
if 5.5999999999999996 < z Initial program 86.7%
associate-+l+86.7%
+-commutative86.7%
associate-+r-65.8%
associate-+l-56.8%
+-commutative56.8%
+-commutative56.8%
associate--l+56.8%
Simplified45.4%
Taylor expanded in z around inf 55.0%
associate--l+56.0%
+-commutative56.0%
Simplified56.0%
Taylor expanded in x around inf 18.7%
associate--l+31.5%
+-commutative31.5%
Simplified31.5%
Taylor expanded in t around inf 20.8%
Taylor expanded in y around 0 39.8%
Final simplification40.2%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 1.0)
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
return 1.0;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = 1.0d0
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
return 1.0;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): return 1.0
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) return 1.0 end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp = code(x, y, z, t)
tmp = 1.0;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := 1.0
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
1
\end{array}
Initial program 92.2%
associate-+l+92.2%
+-commutative92.2%
associate-+r-74.0%
associate-+l-53.0%
+-commutative53.0%
+-commutative53.0%
associate--l+53.0%
Simplified39.9%
Taylor expanded in z around inf 32.1%
associate--l+32.3%
+-commutative32.3%
Simplified32.3%
Taylor expanded in x around inf 12.9%
associate--l+20.8%
+-commutative20.8%
Simplified20.8%
Taylor expanded in t around inf 15.0%
Taylor expanded in y around 0 34.7%
Final simplification34.7%
(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 2023274
(FPCore (x y z t)
:name "Main:z from "
:precision binary64
:herbie-target
(+ (+ (+ (/ 1.0 (+ (sqrt (+ x 1.0)) (sqrt x))) (/ 1.0 (+ (sqrt (+ y 1.0)) (sqrt y)))) (/ 1.0 (+ (sqrt (+ z 1.0)) (sqrt z)))) (- (sqrt (+ t 1.0)) (sqrt t)))
(+ (+ (+ (- (sqrt (+ x 1.0)) (sqrt x)) (- (sqrt (+ y 1.0)) (sqrt y))) (- (sqrt (+ z 1.0)) (sqrt z))) (- (sqrt (+ t 1.0)) (sqrt t))))