
(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 16 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 (+ y 1.0)) (sqrt y)))
(t_2 (- (sqrt (+ 1.0 t)) (sqrt t)))
(t_3 (/ -1.0 t_1))
(t_4 (sqrt (+ x 1.0)))
(t_5 (- (/ 1.0 t_1) (sqrt x)))
(t_6 (sqrt (+ 1.0 z))))
(if (<= y 5.5e+40)
(+ (+ t_4 t_5) (+ t_2 (/ 1.0 (+ (sqrt z) t_6))))
(+
(/ (+ 1.0 (+ x (* (+ (sqrt x) t_3) t_5))) (+ (sqrt x) (+ t_4 t_3)))
(+ t_2 (- t_6 (sqrt z)))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((y + 1.0)) + sqrt(y);
double t_2 = sqrt((1.0 + t)) - sqrt(t);
double t_3 = -1.0 / t_1;
double t_4 = sqrt((x + 1.0));
double t_5 = (1.0 / t_1) - sqrt(x);
double t_6 = sqrt((1.0 + z));
double tmp;
if (y <= 5.5e+40) {
tmp = (t_4 + t_5) + (t_2 + (1.0 / (sqrt(z) + t_6)));
} else {
tmp = ((1.0 + (x + ((sqrt(x) + t_3) * t_5))) / (sqrt(x) + (t_4 + t_3))) + (t_2 + (t_6 - sqrt(z)));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: t_5
real(8) :: t_6
real(8) :: tmp
t_1 = sqrt((y + 1.0d0)) + sqrt(y)
t_2 = sqrt((1.0d0 + t)) - sqrt(t)
t_3 = (-1.0d0) / t_1
t_4 = sqrt((x + 1.0d0))
t_5 = (1.0d0 / t_1) - sqrt(x)
t_6 = sqrt((1.0d0 + z))
if (y <= 5.5d+40) then
tmp = (t_4 + t_5) + (t_2 + (1.0d0 / (sqrt(z) + t_6)))
else
tmp = ((1.0d0 + (x + ((sqrt(x) + t_3) * t_5))) / (sqrt(x) + (t_4 + t_3))) + (t_2 + (t_6 - sqrt(z)))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((y + 1.0)) + Math.sqrt(y);
double t_2 = Math.sqrt((1.0 + t)) - Math.sqrt(t);
double t_3 = -1.0 / t_1;
double t_4 = Math.sqrt((x + 1.0));
double t_5 = (1.0 / t_1) - Math.sqrt(x);
double t_6 = Math.sqrt((1.0 + z));
double tmp;
if (y <= 5.5e+40) {
tmp = (t_4 + t_5) + (t_2 + (1.0 / (Math.sqrt(z) + t_6)));
} else {
tmp = ((1.0 + (x + ((Math.sqrt(x) + t_3) * t_5))) / (Math.sqrt(x) + (t_4 + t_3))) + (t_2 + (t_6 - Math.sqrt(z)));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((y + 1.0)) + math.sqrt(y) t_2 = math.sqrt((1.0 + t)) - math.sqrt(t) t_3 = -1.0 / t_1 t_4 = math.sqrt((x + 1.0)) t_5 = (1.0 / t_1) - math.sqrt(x) t_6 = math.sqrt((1.0 + z)) tmp = 0 if y <= 5.5e+40: tmp = (t_4 + t_5) + (t_2 + (1.0 / (math.sqrt(z) + t_6))) else: tmp = ((1.0 + (x + ((math.sqrt(x) + t_3) * t_5))) / (math.sqrt(x) + (t_4 + t_3))) + (t_2 + (t_6 - math.sqrt(z))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = Float64(sqrt(Float64(y + 1.0)) + sqrt(y)) t_2 = Float64(sqrt(Float64(1.0 + t)) - sqrt(t)) t_3 = Float64(-1.0 / t_1) t_4 = sqrt(Float64(x + 1.0)) t_5 = Float64(Float64(1.0 / t_1) - sqrt(x)) t_6 = sqrt(Float64(1.0 + z)) tmp = 0.0 if (y <= 5.5e+40) tmp = Float64(Float64(t_4 + t_5) + Float64(t_2 + Float64(1.0 / Float64(sqrt(z) + t_6)))); else tmp = Float64(Float64(Float64(1.0 + Float64(x + Float64(Float64(sqrt(x) + t_3) * t_5))) / Float64(sqrt(x) + Float64(t_4 + t_3))) + Float64(t_2 + Float64(t_6 - sqrt(z)))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((y + 1.0)) + sqrt(y);
t_2 = sqrt((1.0 + t)) - sqrt(t);
t_3 = -1.0 / t_1;
t_4 = sqrt((x + 1.0));
t_5 = (1.0 / t_1) - sqrt(x);
t_6 = sqrt((1.0 + z));
tmp = 0.0;
if (y <= 5.5e+40)
tmp = (t_4 + t_5) + (t_2 + (1.0 / (sqrt(z) + t_6)));
else
tmp = ((1.0 + (x + ((sqrt(x) + t_3) * t_5))) / (sqrt(x) + (t_4 + t_3))) + (t_2 + (t_6 - sqrt(z)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(-1.0 / t$95$1), $MachinePrecision]}, Block[{t$95$4 = N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$5 = N[(N[(1.0 / t$95$1), $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$6 = N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y, 5.5e+40], N[(N[(t$95$4 + t$95$5), $MachinePrecision] + N[(t$95$2 + N[(1.0 / N[(N[Sqrt[z], $MachinePrecision] + t$95$6), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 + N[(x + N[(N[(N[Sqrt[x], $MachinePrecision] + t$95$3), $MachinePrecision] * t$95$5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[Sqrt[x], $MachinePrecision] + N[(t$95$4 + t$95$3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$2 + N[(t$95$6 - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{y + 1} + \sqrt{y}\\
t_2 := \sqrt{1 + t} - \sqrt{t}\\
t_3 := \frac{-1}{t_1}\\
t_4 := \sqrt{x + 1}\\
t_5 := \frac{1}{t_1} - \sqrt{x}\\
t_6 := \sqrt{1 + z}\\
\mathbf{if}\;y \leq 5.5 \cdot 10^{+40}:\\
\;\;\;\;\left(t_4 + t_5\right) + \left(t_2 + \frac{1}{\sqrt{z} + t_6}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1 + \left(x + \left(\sqrt{x} + t_3\right) \cdot t_5\right)}{\sqrt{x} + \left(t_4 + t_3\right)} + \left(t_2 + \left(t_6 - \sqrt{z}\right)\right)\\
\end{array}
\end{array}
if y < 5.49999999999999974e40Initial program 95.2%
associate-+l+95.2%
associate-+l-66.0%
+-commutative66.0%
sub-neg66.0%
sub-neg66.0%
+-commutative66.0%
+-commutative66.0%
Simplified66.0%
flip--66.0%
add-sqr-sqrt65.7%
add-sqr-sqrt66.6%
Applied egg-rr66.6%
associate--l+66.8%
+-inverses66.8%
metadata-eval66.8%
Simplified66.8%
flip--66.9%
add-sqr-sqrt56.8%
+-commutative56.8%
add-sqr-sqrt67.3%
+-commutative67.3%
Applied egg-rr67.3%
Taylor expanded in z around 0 67.8%
if 5.49999999999999974e40 < y Initial program 86.4%
associate-+l+86.4%
associate-+l-86.4%
+-commutative86.4%
sub-neg86.4%
sub-neg86.4%
+-commutative86.4%
+-commutative86.4%
Simplified86.4%
flip--86.4%
add-sqr-sqrt58.7%
add-sqr-sqrt86.4%
Applied egg-rr86.4%
associate--l+86.4%
+-inverses86.4%
metadata-eval86.4%
Simplified86.4%
flip--86.4%
add-sqr-sqrt70.1%
Applied egg-rr70.1%
Simplified70.2%
Final simplification68.8%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (+ (+ (sqrt (+ x 1.0)) (- (/ 1.0 (+ (sqrt (+ y 1.0)) (sqrt y))) (sqrt x))) (+ (- (sqrt (+ 1.0 t)) (sqrt t)) (/ 1.0 (+ (sqrt z) (sqrt (+ 1.0 z)))))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
return (sqrt((x + 1.0)) + ((1.0 / (sqrt((y + 1.0)) + sqrt(y))) - sqrt(x))) + ((sqrt((1.0 + t)) - sqrt(t)) + (1.0 / (sqrt(z) + sqrt((1.0 + z)))));
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (sqrt((x + 1.0d0)) + ((1.0d0 / (sqrt((y + 1.0d0)) + sqrt(y))) - sqrt(x))) + ((sqrt((1.0d0 + t)) - sqrt(t)) + (1.0d0 / (sqrt(z) + sqrt((1.0d0 + z)))))
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
return (Math.sqrt((x + 1.0)) + ((1.0 / (Math.sqrt((y + 1.0)) + Math.sqrt(y))) - Math.sqrt(x))) + ((Math.sqrt((1.0 + t)) - Math.sqrt(t)) + (1.0 / (Math.sqrt(z) + Math.sqrt((1.0 + z)))));
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): return (math.sqrt((x + 1.0)) + ((1.0 / (math.sqrt((y + 1.0)) + math.sqrt(y))) - math.sqrt(x))) + ((math.sqrt((1.0 + t)) - math.sqrt(t)) + (1.0 / (math.sqrt(z) + math.sqrt((1.0 + z)))))
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) return Float64(Float64(sqrt(Float64(x + 1.0)) + Float64(Float64(1.0 / Float64(sqrt(Float64(y + 1.0)) + sqrt(y))) - sqrt(x))) + Float64(Float64(sqrt(Float64(1.0 + t)) - sqrt(t)) + Float64(1.0 / Float64(sqrt(z) + sqrt(Float64(1.0 + z)))))) end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp = code(x, y, z, t)
tmp = (sqrt((x + 1.0)) + ((1.0 / (sqrt((y + 1.0)) + sqrt(y))) - sqrt(x))) + ((sqrt((1.0 + t)) - sqrt(t)) + (1.0 / (sqrt(z) + sqrt((1.0 + z)))));
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := N[(N[(N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision] + N[(N[(1.0 / N[(N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Sqrt[x], $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]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\left(\sqrt{x + 1} + \left(\frac{1}{\sqrt{y + 1} + \sqrt{y}} - \sqrt{x}\right)\right) + \left(\left(\sqrt{1 + t} - \sqrt{t}\right) + \frac{1}{\sqrt{z} + \sqrt{1 + z}}\right)
\end{array}
Initial program 91.6%
associate-+l+91.6%
associate-+l-74.3%
+-commutative74.3%
sub-neg74.3%
sub-neg74.3%
+-commutative74.3%
+-commutative74.3%
Simplified74.3%
flip--74.3%
add-sqr-sqrt62.9%
add-sqr-sqrt74.7%
Applied egg-rr74.7%
associate--l+74.8%
+-inverses74.8%
metadata-eval74.8%
Simplified74.8%
flip--75.1%
add-sqr-sqrt61.6%
+-commutative61.6%
add-sqr-sqrt75.5%
+-commutative75.5%
Applied egg-rr75.5%
Taylor expanded in z around 0 77.3%
Final simplification77.3%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ 1.0 z))))
(if (<= t 2.5e+14)
(+ 2.0 (+ t_1 (- (sqrt (+ 1.0 t)) (+ (sqrt z) (sqrt t)))))
(+
(+ (sqrt (+ x 1.0)) (- (/ 1.0 (+ (sqrt (+ y 1.0)) (sqrt y))) (sqrt x)))
(/ 1.0 (+ (sqrt z) 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 + z));
double tmp;
if (t <= 2.5e+14) {
tmp = 2.0 + (t_1 + (sqrt((1.0 + t)) - (sqrt(z) + sqrt(t))));
} else {
tmp = (sqrt((x + 1.0)) + ((1.0 / (sqrt((y + 1.0)) + sqrt(y))) - sqrt(x))) + (1.0 / (sqrt(z) + 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 + z))
if (t <= 2.5d+14) then
tmp = 2.0d0 + (t_1 + (sqrt((1.0d0 + t)) - (sqrt(z) + sqrt(t))))
else
tmp = (sqrt((x + 1.0d0)) + ((1.0d0 / (sqrt((y + 1.0d0)) + sqrt(y))) - sqrt(x))) + (1.0d0 / (sqrt(z) + 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 + z));
double tmp;
if (t <= 2.5e+14) {
tmp = 2.0 + (t_1 + (Math.sqrt((1.0 + t)) - (Math.sqrt(z) + Math.sqrt(t))));
} else {
tmp = (Math.sqrt((x + 1.0)) + ((1.0 / (Math.sqrt((y + 1.0)) + Math.sqrt(y))) - Math.sqrt(x))) + (1.0 / (Math.sqrt(z) + 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 + z)) tmp = 0 if t <= 2.5e+14: tmp = 2.0 + (t_1 + (math.sqrt((1.0 + t)) - (math.sqrt(z) + math.sqrt(t)))) else: tmp = (math.sqrt((x + 1.0)) + ((1.0 / (math.sqrt((y + 1.0)) + math.sqrt(y))) - math.sqrt(x))) + (1.0 / (math.sqrt(z) + 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 + z)) tmp = 0.0 if (t <= 2.5e+14) tmp = Float64(2.0 + Float64(t_1 + Float64(sqrt(Float64(1.0 + t)) - Float64(sqrt(z) + sqrt(t))))); else tmp = Float64(Float64(sqrt(Float64(x + 1.0)) + Float64(Float64(1.0 / Float64(sqrt(Float64(y + 1.0)) + sqrt(y))) - sqrt(x))) + Float64(1.0 / Float64(sqrt(z) + 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 + z));
tmp = 0.0;
if (t <= 2.5e+14)
tmp = 2.0 + (t_1 + (sqrt((1.0 + t)) - (sqrt(z) + sqrt(t))));
else
tmp = (sqrt((x + 1.0)) + ((1.0 / (sqrt((y + 1.0)) + sqrt(y))) - sqrt(x))) + (1.0 / (sqrt(z) + 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 + z), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t, 2.5e+14], 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], N[(N[(N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision] + N[(N[(1.0 / N[(N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[z], $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{1 + z}\\
\mathbf{if}\;t \leq 2.5 \cdot 10^{+14}:\\
\;\;\;\;2 + \left(t_1 + \left(\sqrt{1 + t} - \left(\sqrt{z} + \sqrt{t}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\sqrt{x + 1} + \left(\frac{1}{\sqrt{y + 1} + \sqrt{y}} - \sqrt{x}\right)\right) + \frac{1}{\sqrt{z} + t_1}\\
\end{array}
\end{array}
if t < 2.5e14Initial program 96.2%
associate-+l+96.2%
sub-neg96.2%
associate-+l+81.8%
associate-+l+56.4%
+-commutative56.4%
neg-sub056.4%
associate-+l-56.4%
neg-sub056.4%
Simplified38.5%
Taylor expanded in y around 0 35.3%
Taylor expanded in x around 0 25.9%
associate--l+45.3%
+-commutative45.3%
associate--l+45.3%
+-commutative45.3%
Simplified45.3%
if 2.5e14 < t Initial program 86.2%
associate-+l+86.2%
associate-+l-65.5%
+-commutative65.5%
sub-neg65.5%
sub-neg65.5%
+-commutative65.5%
+-commutative65.5%
Simplified65.5%
flip--65.5%
add-sqr-sqrt55.9%
add-sqr-sqrt65.7%
Applied egg-rr65.7%
associate--l+65.7%
+-inverses65.7%
metadata-eval65.7%
Simplified65.7%
flip--66.0%
add-sqr-sqrt56.8%
+-commutative56.8%
add-sqr-sqrt66.8%
+-commutative66.8%
Applied egg-rr66.8%
Taylor expanded in z around 0 70.6%
Taylor expanded in t around inf 70.6%
Final simplification56.9%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ 1.0 z))))
(if (<= t 2.5e+14)
(+ 2.0 (+ t_1 (- (sqrt (+ 1.0 t)) (+ (sqrt z) (sqrt t)))))
(+
(/ 1.0 (+ (sqrt (+ y 1.0)) (sqrt y)))
(+ (/ 1.0 (+ (sqrt z) t_1)) (- (sqrt (+ x 1.0)) (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 (t <= 2.5e+14) {
tmp = 2.0 + (t_1 + (sqrt((1.0 + t)) - (sqrt(z) + sqrt(t))));
} else {
tmp = (1.0 / (sqrt((y + 1.0)) + sqrt(y))) + ((1.0 / (sqrt(z) + t_1)) + (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) :: t_1
real(8) :: tmp
t_1 = sqrt((1.0d0 + z))
if (t <= 2.5d+14) then
tmp = 2.0d0 + (t_1 + (sqrt((1.0d0 + t)) - (sqrt(z) + sqrt(t))))
else
tmp = (1.0d0 / (sqrt((y + 1.0d0)) + sqrt(y))) + ((1.0d0 / (sqrt(z) + t_1)) + (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 t_1 = Math.sqrt((1.0 + z));
double tmp;
if (t <= 2.5e+14) {
tmp = 2.0 + (t_1 + (Math.sqrt((1.0 + t)) - (Math.sqrt(z) + Math.sqrt(t))));
} else {
tmp = (1.0 / (Math.sqrt((y + 1.0)) + Math.sqrt(y))) + ((1.0 / (Math.sqrt(z) + t_1)) + (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): t_1 = math.sqrt((1.0 + z)) tmp = 0 if t <= 2.5e+14: tmp = 2.0 + (t_1 + (math.sqrt((1.0 + t)) - (math.sqrt(z) + math.sqrt(t)))) else: tmp = (1.0 / (math.sqrt((y + 1.0)) + math.sqrt(y))) + ((1.0 / (math.sqrt(z) + t_1)) + (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) t_1 = sqrt(Float64(1.0 + z)) tmp = 0.0 if (t <= 2.5e+14) tmp = Float64(2.0 + Float64(t_1 + Float64(sqrt(Float64(1.0 + t)) - Float64(sqrt(z) + sqrt(t))))); else tmp = Float64(Float64(1.0 / Float64(sqrt(Float64(y + 1.0)) + sqrt(y))) + Float64(Float64(1.0 / Float64(sqrt(z) + t_1)) + 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)
t_1 = sqrt((1.0 + z));
tmp = 0.0;
if (t <= 2.5e+14)
tmp = 2.0 + (t_1 + (sqrt((1.0 + t)) - (sqrt(z) + sqrt(t))));
else
tmp = (1.0 / (sqrt((y + 1.0)) + sqrt(y))) + ((1.0 / (sqrt(z) + t_1)) + (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_] := Block[{t$95$1 = N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t, 2.5e+14], 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], N[(N[(1.0 / N[(N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 / N[(N[Sqrt[z], $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + z}\\
\mathbf{if}\;t \leq 2.5 \cdot 10^{+14}:\\
\;\;\;\;2 + \left(t_1 + \left(\sqrt{1 + t} - \left(\sqrt{z} + \sqrt{t}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{y + 1} + \sqrt{y}} + \left(\frac{1}{\sqrt{z} + t_1} + \left(\sqrt{x + 1} - \sqrt{x}\right)\right)\\
\end{array}
\end{array}
if t < 2.5e14Initial program 96.2%
associate-+l+96.2%
sub-neg96.2%
associate-+l+81.8%
associate-+l+56.4%
+-commutative56.4%
neg-sub056.4%
associate-+l-56.4%
neg-sub056.4%
Simplified38.5%
Taylor expanded in y around 0 35.3%
Taylor expanded in x around 0 25.9%
associate--l+45.3%
+-commutative45.3%
associate--l+45.3%
+-commutative45.3%
Simplified45.3%
if 2.5e14 < t Initial program 86.2%
associate-+l+86.2%
associate-+l-65.5%
+-commutative65.5%
sub-neg65.5%
sub-neg65.5%
+-commutative65.5%
+-commutative65.5%
Simplified65.5%
flip--65.5%
add-sqr-sqrt55.9%
add-sqr-sqrt65.7%
Applied egg-rr65.7%
associate--l+65.7%
+-inverses65.7%
metadata-eval65.7%
Simplified65.7%
flip--66.0%
add-sqr-sqrt56.8%
+-commutative56.8%
add-sqr-sqrt66.8%
+-commutative66.8%
Applied egg-rr66.8%
Taylor expanded in z around 0 70.6%
Taylor expanded in t around inf 54.0%
associate--l+66.3%
+-commutative66.3%
+-commutative66.3%
associate--l+93.8%
+-commutative93.8%
Simplified93.8%
Final simplification67.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 (+ y 1.0)) (sqrt y))) (+ (- (sqrt (+ 1.0 t)) (sqrt t)) (/ 1.0 (+ (sqrt z) (sqrt (+ 1.0 z))))))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
return 1.0 + ((1.0 / (sqrt((y + 1.0)) + sqrt(y))) + ((sqrt((1.0 + t)) - sqrt(t)) + (1.0 / (sqrt(z) + sqrt((1.0 + z))))));
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = 1.0d0 + ((1.0d0 / (sqrt((y + 1.0d0)) + sqrt(y))) + ((sqrt((1.0d0 + t)) - sqrt(t)) + (1.0d0 / (sqrt(z) + sqrt((1.0d0 + z))))))
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
return 1.0 + ((1.0 / (Math.sqrt((y + 1.0)) + Math.sqrt(y))) + ((Math.sqrt((1.0 + t)) - Math.sqrt(t)) + (1.0 / (Math.sqrt(z) + Math.sqrt((1.0 + z))))));
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): return 1.0 + ((1.0 / (math.sqrt((y + 1.0)) + math.sqrt(y))) + ((math.sqrt((1.0 + t)) - math.sqrt(t)) + (1.0 / (math.sqrt(z) + math.sqrt((1.0 + z))))))
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(Float64(y + 1.0)) + sqrt(y))) + Float64(Float64(sqrt(Float64(1.0 + t)) - sqrt(t)) + Float64(1.0 / Float64(sqrt(z) + sqrt(Float64(1.0 + z))))))) end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp = code(x, y, z, t)
tmp = 1.0 + ((1.0 / (sqrt((y + 1.0)) + sqrt(y))) + ((sqrt((1.0 + t)) - sqrt(t)) + (1.0 / (sqrt(z) + sqrt((1.0 + z))))));
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := N[(1.0 + N[(N[(1.0 / N[(N[Sqrt[N[(y + 1.0), $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]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
1 + \left(\frac{1}{\sqrt{y + 1} + \sqrt{y}} + \left(\left(\sqrt{1 + t} - \sqrt{t}\right) + \frac{1}{\sqrt{z} + \sqrt{1 + z}}\right)\right)
\end{array}
Initial program 91.6%
associate-+l+91.6%
associate-+l-74.3%
+-commutative74.3%
sub-neg74.3%
sub-neg74.3%
+-commutative74.3%
+-commutative74.3%
Simplified74.3%
flip--74.3%
add-sqr-sqrt62.9%
add-sqr-sqrt74.7%
Applied egg-rr74.7%
associate--l+74.8%
+-inverses74.8%
metadata-eval74.8%
Simplified74.8%
flip--75.1%
add-sqr-sqrt61.6%
+-commutative61.6%
add-sqr-sqrt75.5%
+-commutative75.5%
Applied egg-rr75.5%
Taylor expanded in z around 0 77.3%
Taylor expanded in x around 0 35.0%
associate--l+51.3%
associate--l+58.1%
+-commutative58.1%
associate-+r-58.6%
Simplified58.6%
Final simplification58.6%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ 1.0 z))))
(if (<= t 2.5e+14)
(+ 2.0 (+ t_1 (- (sqrt (+ 1.0 t)) (+ (sqrt z) (sqrt t)))))
(+
(sqrt (+ x 1.0))
(+
(/ 1.0 (+ (sqrt (+ y 1.0)) (sqrt y)))
(- (- t_1 (sqrt z)) (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 (t <= 2.5e+14) {
tmp = 2.0 + (t_1 + (sqrt((1.0 + t)) - (sqrt(z) + sqrt(t))));
} else {
tmp = sqrt((x + 1.0)) + ((1.0 / (sqrt((y + 1.0)) + sqrt(y))) + ((t_1 - sqrt(z)) - sqrt(x)));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = sqrt((1.0d0 + z))
if (t <= 2.5d+14) then
tmp = 2.0d0 + (t_1 + (sqrt((1.0d0 + t)) - (sqrt(z) + sqrt(t))))
else
tmp = sqrt((x + 1.0d0)) + ((1.0d0 / (sqrt((y + 1.0d0)) + sqrt(y))) + ((t_1 - sqrt(z)) - sqrt(x)))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + z));
double tmp;
if (t <= 2.5e+14) {
tmp = 2.0 + (t_1 + (Math.sqrt((1.0 + t)) - (Math.sqrt(z) + Math.sqrt(t))));
} else {
tmp = Math.sqrt((x + 1.0)) + ((1.0 / (Math.sqrt((y + 1.0)) + Math.sqrt(y))) + ((t_1 - Math.sqrt(z)) - 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 t <= 2.5e+14: tmp = 2.0 + (t_1 + (math.sqrt((1.0 + t)) - (math.sqrt(z) + math.sqrt(t)))) else: tmp = math.sqrt((x + 1.0)) + ((1.0 / (math.sqrt((y + 1.0)) + math.sqrt(y))) + ((t_1 - math.sqrt(z)) - 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 (t <= 2.5e+14) tmp = Float64(2.0 + Float64(t_1 + Float64(sqrt(Float64(1.0 + t)) - Float64(sqrt(z) + sqrt(t))))); else tmp = Float64(sqrt(Float64(x + 1.0)) + Float64(Float64(1.0 / Float64(sqrt(Float64(y + 1.0)) + sqrt(y))) + Float64(Float64(t_1 - sqrt(z)) - sqrt(x)))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + z));
tmp = 0.0;
if (t <= 2.5e+14)
tmp = 2.0 + (t_1 + (sqrt((1.0 + t)) - (sqrt(z) + sqrt(t))));
else
tmp = sqrt((x + 1.0)) + ((1.0 / (sqrt((y + 1.0)) + sqrt(y))) + ((t_1 - sqrt(z)) - sqrt(x)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t, 2.5e+14], 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], N[(N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision] + N[(N[(1.0 / N[(N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$1 - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + z}\\
\mathbf{if}\;t \leq 2.5 \cdot 10^{+14}:\\
\;\;\;\;2 + \left(t_1 + \left(\sqrt{1 + t} - \left(\sqrt{z} + \sqrt{t}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\sqrt{x + 1} + \left(\frac{1}{\sqrt{y + 1} + \sqrt{y}} + \left(\left(t_1 - \sqrt{z}\right) - \sqrt{x}\right)\right)\\
\end{array}
\end{array}
if t < 2.5e14Initial program 96.2%
associate-+l+96.2%
sub-neg96.2%
associate-+l+81.8%
associate-+l+56.4%
+-commutative56.4%
neg-sub056.4%
associate-+l-56.4%
neg-sub056.4%
Simplified38.5%
Taylor expanded in y around 0 35.3%
Taylor expanded in x around 0 25.9%
associate--l+45.3%
+-commutative45.3%
associate--l+45.3%
+-commutative45.3%
Simplified45.3%
if 2.5e14 < t Initial program 86.2%
associate-+l+86.2%
+-commutative86.2%
associate-+r-65.5%
associate-+l-53.1%
+-commutative53.1%
associate--l+53.1%
+-commutative53.1%
Simplified36.4%
Taylor expanded in t around inf 50.9%
+-commutative50.9%
+-commutative50.9%
associate--l+53.1%
Simplified53.1%
flip--65.5%
add-sqr-sqrt55.9%
add-sqr-sqrt65.7%
Applied egg-rr53.3%
associate--l+65.7%
+-inverses65.7%
metadata-eval65.7%
Simplified53.3%
Final simplification49.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)) (sqrt z))) (t_2 (sqrt (+ y 1.0))))
(if (<= y 1.4)
(+ (+ (- (sqrt (+ 1.0 t)) (sqrt t)) t_1) (- (+ 1.0 t_2) (sqrt y)))
(+ (sqrt (+ x 1.0)) (+ (/ 1.0 (+ t_2 (sqrt 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)) - sqrt(z);
double t_2 = sqrt((y + 1.0));
double tmp;
if (y <= 1.4) {
tmp = ((sqrt((1.0 + t)) - sqrt(t)) + t_1) + ((1.0 + t_2) - sqrt(y));
} else {
tmp = sqrt((x + 1.0)) + ((1.0 / (t_2 + sqrt(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) :: t_2
real(8) :: tmp
t_1 = sqrt((1.0d0 + z)) - sqrt(z)
t_2 = sqrt((y + 1.0d0))
if (y <= 1.4d0) then
tmp = ((sqrt((1.0d0 + t)) - sqrt(t)) + t_1) + ((1.0d0 + t_2) - sqrt(y))
else
tmp = sqrt((x + 1.0d0)) + ((1.0d0 / (t_2 + sqrt(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)) - Math.sqrt(z);
double t_2 = Math.sqrt((y + 1.0));
double tmp;
if (y <= 1.4) {
tmp = ((Math.sqrt((1.0 + t)) - Math.sqrt(t)) + t_1) + ((1.0 + t_2) - Math.sqrt(y));
} else {
tmp = Math.sqrt((x + 1.0)) + ((1.0 / (t_2 + Math.sqrt(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)) - math.sqrt(z) t_2 = math.sqrt((y + 1.0)) tmp = 0 if y <= 1.4: tmp = ((math.sqrt((1.0 + t)) - math.sqrt(t)) + t_1) + ((1.0 + t_2) - math.sqrt(y)) else: tmp = math.sqrt((x + 1.0)) + ((1.0 / (t_2 + math.sqrt(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 = Float64(sqrt(Float64(1.0 + z)) - sqrt(z)) t_2 = sqrt(Float64(y + 1.0)) tmp = 0.0 if (y <= 1.4) tmp = Float64(Float64(Float64(sqrt(Float64(1.0 + t)) - sqrt(t)) + t_1) + Float64(Float64(1.0 + t_2) - sqrt(y))); else tmp = Float64(sqrt(Float64(x + 1.0)) + Float64(Float64(1.0 / Float64(t_2 + sqrt(y))) + Float64(t_1 - sqrt(x)))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + z)) - sqrt(z);
t_2 = sqrt((y + 1.0));
tmp = 0.0;
if (y <= 1.4)
tmp = ((sqrt((1.0 + t)) - sqrt(t)) + t_1) + ((1.0 + t_2) - sqrt(y));
else
tmp = sqrt((x + 1.0)) + ((1.0 / (t_2 + sqrt(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[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y, 1.4], N[(N[(N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision] + N[(N[(1.0 + t$95$2), $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision] + N[(N[(1.0 / N[(t$95$2 + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$1 - N[Sqrt[x], $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} - \sqrt{z}\\
t_2 := \sqrt{y + 1}\\
\mathbf{if}\;y \leq 1.4:\\
\;\;\;\;\left(\left(\sqrt{1 + t} - \sqrt{t}\right) + t_1\right) + \left(\left(1 + t_2\right) - \sqrt{y}\right)\\
\mathbf{else}:\\
\;\;\;\;\sqrt{x + 1} + \left(\frac{1}{t_2 + \sqrt{y}} + \left(t_1 - \sqrt{x}\right)\right)\\
\end{array}
\end{array}
if y < 1.3999999999999999Initial program 97.5%
associate-+l+97.5%
associate-+l-64.6%
+-commutative64.6%
sub-neg64.6%
sub-neg64.6%
+-commutative64.6%
+-commutative64.6%
Simplified64.6%
Taylor expanded in x around 0 61.4%
if 1.3999999999999999 < y Initial program 85.4%
associate-+l+85.4%
+-commutative85.4%
associate-+r-84.7%
associate-+l-50.5%
+-commutative50.5%
associate--l+50.5%
+-commutative50.5%
Simplified32.8%
Taylor expanded in t around inf 28.1%
+-commutative28.1%
+-commutative28.1%
associate--l+28.2%
Simplified28.2%
flip--84.7%
add-sqr-sqrt61.0%
add-sqr-sqrt85.4%
Applied egg-rr28.4%
associate--l+85.6%
+-inverses85.6%
metadata-eval85.6%
Simplified28.4%
Final simplification45.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 z))))
(if (<= t 1.16e+15)
(+ 2.0 (+ t_1 (- (sqrt (+ 1.0 t)) (+ (sqrt z) (sqrt t)))))
(+
(sqrt (+ x 1.0))
(+ (- (sqrt (+ y 1.0)) (sqrt y)) (- (- t_1 (sqrt z)) (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 (t <= 1.16e+15) {
tmp = 2.0 + (t_1 + (sqrt((1.0 + t)) - (sqrt(z) + sqrt(t))));
} else {
tmp = sqrt((x + 1.0)) + ((sqrt((y + 1.0)) - sqrt(y)) + ((t_1 - sqrt(z)) - sqrt(x)));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = sqrt((1.0d0 + z))
if (t <= 1.16d+15) then
tmp = 2.0d0 + (t_1 + (sqrt((1.0d0 + t)) - (sqrt(z) + sqrt(t))))
else
tmp = sqrt((x + 1.0d0)) + ((sqrt((y + 1.0d0)) - sqrt(y)) + ((t_1 - sqrt(z)) - sqrt(x)))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + z));
double tmp;
if (t <= 1.16e+15) {
tmp = 2.0 + (t_1 + (Math.sqrt((1.0 + t)) - (Math.sqrt(z) + Math.sqrt(t))));
} else {
tmp = Math.sqrt((x + 1.0)) + ((Math.sqrt((y + 1.0)) - Math.sqrt(y)) + ((t_1 - Math.sqrt(z)) - 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 t <= 1.16e+15: tmp = 2.0 + (t_1 + (math.sqrt((1.0 + t)) - (math.sqrt(z) + math.sqrt(t)))) else: tmp = math.sqrt((x + 1.0)) + ((math.sqrt((y + 1.0)) - math.sqrt(y)) + ((t_1 - math.sqrt(z)) - 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 (t <= 1.16e+15) tmp = Float64(2.0 + Float64(t_1 + Float64(sqrt(Float64(1.0 + t)) - Float64(sqrt(z) + sqrt(t))))); else tmp = Float64(sqrt(Float64(x + 1.0)) + Float64(Float64(sqrt(Float64(y + 1.0)) - sqrt(y)) + Float64(Float64(t_1 - sqrt(z)) - sqrt(x)))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + z));
tmp = 0.0;
if (t <= 1.16e+15)
tmp = 2.0 + (t_1 + (sqrt((1.0 + t)) - (sqrt(z) + sqrt(t))));
else
tmp = sqrt((x + 1.0)) + ((sqrt((y + 1.0)) - sqrt(y)) + ((t_1 - sqrt(z)) - sqrt(x)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t, 1.16e+15], 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], N[(N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision] + N[(N[(N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$1 - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + z}\\
\mathbf{if}\;t \leq 1.16 \cdot 10^{+15}:\\
\;\;\;\;2 + \left(t_1 + \left(\sqrt{1 + t} - \left(\sqrt{z} + \sqrt{t}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\sqrt{x + 1} + \left(\left(\sqrt{y + 1} - \sqrt{y}\right) + \left(\left(t_1 - \sqrt{z}\right) - \sqrt{x}\right)\right)\\
\end{array}
\end{array}
if t < 1.16e15Initial program 96.2%
associate-+l+96.2%
sub-neg96.2%
associate-+l+81.8%
associate-+l+56.4%
+-commutative56.4%
neg-sub056.4%
associate-+l-56.4%
neg-sub056.4%
Simplified38.5%
Taylor expanded in y around 0 35.3%
Taylor expanded in x around 0 25.9%
associate--l+45.3%
+-commutative45.3%
associate--l+45.3%
+-commutative45.3%
Simplified45.3%
if 1.16e15 < t Initial program 86.2%
associate-+l+86.2%
+-commutative86.2%
associate-+r-65.5%
associate-+l-53.1%
+-commutative53.1%
associate--l+53.1%
+-commutative53.1%
Simplified36.4%
Taylor expanded in t around inf 50.9%
+-commutative50.9%
+-commutative50.9%
associate--l+53.1%
Simplified53.1%
Final simplification48.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))))
(if (<= z 2.5e+16)
(+ 1.0 (- t_1 (- (+ (sqrt y) (sqrt z)) (sqrt (+ 1.0 z)))))
(+ (sqrt (+ x 1.0)) (- (- t_1 (sqrt y)) (sqrt x))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((y + 1.0));
double tmp;
if (z <= 2.5e+16) {
tmp = 1.0 + (t_1 - ((sqrt(y) + sqrt(z)) - sqrt((1.0 + z))));
} else {
tmp = sqrt((x + 1.0)) + ((t_1 - sqrt(y)) - sqrt(x));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = sqrt((y + 1.0d0))
if (z <= 2.5d+16) then
tmp = 1.0d0 + (t_1 - ((sqrt(y) + sqrt(z)) - sqrt((1.0d0 + z))))
else
tmp = sqrt((x + 1.0d0)) + ((t_1 - sqrt(y)) - sqrt(x))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((y + 1.0));
double tmp;
if (z <= 2.5e+16) {
tmp = 1.0 + (t_1 - ((Math.sqrt(y) + Math.sqrt(z)) - Math.sqrt((1.0 + z))));
} else {
tmp = Math.sqrt((x + 1.0)) + ((t_1 - Math.sqrt(y)) - Math.sqrt(x));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((y + 1.0)) tmp = 0 if z <= 2.5e+16: tmp = 1.0 + (t_1 - ((math.sqrt(y) + math.sqrt(z)) - math.sqrt((1.0 + z)))) else: tmp = math.sqrt((x + 1.0)) + ((t_1 - math.sqrt(y)) - math.sqrt(x)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(y + 1.0)) tmp = 0.0 if (z <= 2.5e+16) tmp = Float64(1.0 + Float64(t_1 - Float64(Float64(sqrt(y) + sqrt(z)) - sqrt(Float64(1.0 + z))))); else tmp = Float64(sqrt(Float64(x + 1.0)) + Float64(Float64(t_1 - sqrt(y)) - sqrt(x))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((y + 1.0));
tmp = 0.0;
if (z <= 2.5e+16)
tmp = 1.0 + (t_1 - ((sqrt(y) + sqrt(z)) - sqrt((1.0 + z))));
else
tmp = sqrt((x + 1.0)) + ((t_1 - sqrt(y)) - sqrt(x));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[z, 2.5e+16], N[(1.0 + N[(t$95$1 - N[(N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision] - N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision] + N[(N[(t$95$1 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{y + 1}\\
\mathbf{if}\;z \leq 2.5 \cdot 10^{+16}:\\
\;\;\;\;1 + \left(t_1 - \left(\left(\sqrt{y} + \sqrt{z}\right) - \sqrt{1 + z}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\sqrt{x + 1} + \left(\left(t_1 - \sqrt{y}\right) - \sqrt{x}\right)\\
\end{array}
\end{array}
if z < 2.5e16Initial program 96.0%
associate-+l+96.0%
+-commutative96.0%
associate-+r-76.1%
associate-+l-56.6%
+-commutative56.6%
associate--l+56.6%
+-commutative56.6%
Simplified52.6%
Taylor expanded in t around inf 33.5%
+-commutative33.5%
+-commutative33.5%
associate--l+33.5%
Simplified33.5%
Taylor expanded in x around 0 35.4%
associate--l+46.9%
+-commutative46.9%
associate--l+46.9%
+-commutative46.9%
Simplified46.9%
if 2.5e16 < z Initial program 86.1%
associate-+l+86.1%
+-commutative86.1%
associate-+r-72.1%
associate-+l-52.8%
+-commutative52.8%
associate--l+52.8%
+-commutative52.8%
Simplified18.8%
Taylor expanded in t around inf 26.9%
+-commutative26.9%
+-commutative26.9%
associate--l+28.7%
Simplified28.7%
Taylor expanded in z around inf 28.7%
Final simplification38.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 (<= t 2.5e+14) (- (+ (sqrt (+ 1.0 t)) 3.0) (+ (sqrt z) (sqrt t))) (+ 1.0 (- (sqrt (+ y 1.0)) (+ (sqrt y) (- (sqrt z) (sqrt (+ 1.0 z))))))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (t <= 2.5e+14) {
tmp = (sqrt((1.0 + t)) + 3.0) - (sqrt(z) + sqrt(t));
} else {
tmp = 1.0 + (sqrt((y + 1.0)) - (sqrt(y) + (sqrt(z) - 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 (t <= 2.5d+14) then
tmp = (sqrt((1.0d0 + t)) + 3.0d0) - (sqrt(z) + sqrt(t))
else
tmp = 1.0d0 + (sqrt((y + 1.0d0)) - (sqrt(y) + (sqrt(z) - 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 (t <= 2.5e+14) {
tmp = (Math.sqrt((1.0 + t)) + 3.0) - (Math.sqrt(z) + Math.sqrt(t));
} else {
tmp = 1.0 + (Math.sqrt((y + 1.0)) - (Math.sqrt(y) + (Math.sqrt(z) - 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 t <= 2.5e+14: tmp = (math.sqrt((1.0 + t)) + 3.0) - (math.sqrt(z) + math.sqrt(t)) else: tmp = 1.0 + (math.sqrt((y + 1.0)) - (math.sqrt(y) + (math.sqrt(z) - 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 (t <= 2.5e+14) tmp = Float64(Float64(sqrt(Float64(1.0 + t)) + 3.0) - Float64(sqrt(z) + sqrt(t))); else tmp = Float64(1.0 + Float64(sqrt(Float64(y + 1.0)) - Float64(sqrt(y) + Float64(sqrt(z) - 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 (t <= 2.5e+14)
tmp = (sqrt((1.0 + t)) + 3.0) - (sqrt(z) + sqrt(t));
else
tmp = 1.0 + (sqrt((y + 1.0)) - (sqrt(y) + (sqrt(z) - 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[t, 2.5e+14], N[(N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] + 3.0), $MachinePrecision] - N[(N[Sqrt[z], $MachinePrecision] + N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision] - N[(N[Sqrt[y], $MachinePrecision] + N[(N[Sqrt[z], $MachinePrecision] - N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq 2.5 \cdot 10^{+14}:\\
\;\;\;\;\left(\sqrt{1 + t} + 3\right) - \left(\sqrt{z} + \sqrt{t}\right)\\
\mathbf{else}:\\
\;\;\;\;1 + \left(\sqrt{y + 1} - \left(\sqrt{y} + \left(\sqrt{z} - \sqrt{1 + z}\right)\right)\right)\\
\end{array}
\end{array}
if t < 2.5e14Initial program 96.2%
associate-+l+96.2%
sub-neg96.2%
associate-+l+81.8%
associate-+l+56.4%
+-commutative56.4%
neg-sub056.4%
associate-+l-56.4%
neg-sub056.4%
Simplified38.5%
Taylor expanded in y around 0 35.3%
Taylor expanded in z around 0 21.8%
Taylor expanded in x around 0 23.6%
if 2.5e14 < t Initial program 86.2%
associate-+l+86.2%
+-commutative86.2%
associate-+r-65.5%
associate-+l-53.1%
+-commutative53.1%
associate--l+53.1%
+-commutative53.1%
Simplified36.4%
Taylor expanded in t around inf 50.9%
+-commutative50.9%
+-commutative50.9%
associate--l+53.1%
Simplified53.1%
Taylor expanded in x around 0 25.0%
associate--l+53.4%
+-commutative53.4%
+-commutative53.4%
Applied egg-rr53.4%
associate--l+49.8%
+-commutative49.8%
associate--r+54.8%
Simplified54.8%
Final simplification37.8%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ 1.0 z))))
(if (<= t 2.55e+14)
(+ 2.0 (+ t_1 (- (sqrt (+ 1.0 t)) (+ (sqrt z) (sqrt t)))))
(+ 1.0 (- (sqrt (+ y 1.0)) (+ (sqrt y) (- (sqrt z) 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 + z));
double tmp;
if (t <= 2.55e+14) {
tmp = 2.0 + (t_1 + (sqrt((1.0 + t)) - (sqrt(z) + sqrt(t))));
} else {
tmp = 1.0 + (sqrt((y + 1.0)) - (sqrt(y) + (sqrt(z) - 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 + z))
if (t <= 2.55d+14) then
tmp = 2.0d0 + (t_1 + (sqrt((1.0d0 + t)) - (sqrt(z) + sqrt(t))))
else
tmp = 1.0d0 + (sqrt((y + 1.0d0)) - (sqrt(y) + (sqrt(z) - 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 + z));
double tmp;
if (t <= 2.55e+14) {
tmp = 2.0 + (t_1 + (Math.sqrt((1.0 + t)) - (Math.sqrt(z) + Math.sqrt(t))));
} else {
tmp = 1.0 + (Math.sqrt((y + 1.0)) - (Math.sqrt(y) + (Math.sqrt(z) - 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 + z)) tmp = 0 if t <= 2.55e+14: tmp = 2.0 + (t_1 + (math.sqrt((1.0 + t)) - (math.sqrt(z) + math.sqrt(t)))) else: tmp = 1.0 + (math.sqrt((y + 1.0)) - (math.sqrt(y) + (math.sqrt(z) - 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 + z)) tmp = 0.0 if (t <= 2.55e+14) tmp = Float64(2.0 + Float64(t_1 + Float64(sqrt(Float64(1.0 + t)) - Float64(sqrt(z) + sqrt(t))))); else tmp = Float64(1.0 + Float64(sqrt(Float64(y + 1.0)) - Float64(sqrt(y) + Float64(sqrt(z) - 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 + z));
tmp = 0.0;
if (t <= 2.55e+14)
tmp = 2.0 + (t_1 + (sqrt((1.0 + t)) - (sqrt(z) + sqrt(t))));
else
tmp = 1.0 + (sqrt((y + 1.0)) - (sqrt(y) + (sqrt(z) - 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 + z), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t, 2.55e+14], 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], N[(1.0 + N[(N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision] - N[(N[Sqrt[y], $MachinePrecision] + N[(N[Sqrt[z], $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 + z}\\
\mathbf{if}\;t \leq 2.55 \cdot 10^{+14}:\\
\;\;\;\;2 + \left(t_1 + \left(\sqrt{1 + t} - \left(\sqrt{z} + \sqrt{t}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;1 + \left(\sqrt{y + 1} - \left(\sqrt{y} + \left(\sqrt{z} - t_1\right)\right)\right)\\
\end{array}
\end{array}
if t < 2.55e14Initial program 96.2%
associate-+l+96.2%
sub-neg96.2%
associate-+l+81.8%
associate-+l+56.4%
+-commutative56.4%
neg-sub056.4%
associate-+l-56.4%
neg-sub056.4%
Simplified38.5%
Taylor expanded in y around 0 35.3%
Taylor expanded in x around 0 25.9%
associate--l+45.3%
+-commutative45.3%
associate--l+45.3%
+-commutative45.3%
Simplified45.3%
if 2.55e14 < t Initial program 86.2%
associate-+l+86.2%
+-commutative86.2%
associate-+r-65.5%
associate-+l-53.1%
+-commutative53.1%
associate--l+53.1%
+-commutative53.1%
Simplified36.4%
Taylor expanded in t around inf 50.9%
+-commutative50.9%
+-commutative50.9%
associate--l+53.1%
Simplified53.1%
Taylor expanded in x around 0 25.0%
associate--l+53.4%
+-commutative53.4%
+-commutative53.4%
Applied egg-rr53.4%
associate--l+49.8%
+-commutative49.8%
associate--r+54.8%
Simplified54.8%
Final simplification49.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 1.85e+15) (- (+ (sqrt (+ 1.0 z)) 2.0) (sqrt z)) (+ (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 <= 1.85e+15) {
tmp = (sqrt((1.0 + z)) + 2.0) - sqrt(z);
} 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 <= 1.85d+15) then
tmp = (sqrt((1.0d0 + z)) + 2.0d0) - sqrt(z)
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 <= 1.85e+15) {
tmp = (Math.sqrt((1.0 + z)) + 2.0) - Math.sqrt(z);
} 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 <= 1.85e+15: tmp = (math.sqrt((1.0 + z)) + 2.0) - math.sqrt(z) 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 <= 1.85e+15) tmp = Float64(Float64(sqrt(Float64(1.0 + z)) + 2.0) - sqrt(z)); else tmp = Float64(sqrt(Float64(x + 1.0)) + Float64(Float64(sqrt(Float64(y + 1.0)) - sqrt(y)) - sqrt(x))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (z <= 1.85e+15)
tmp = (sqrt((1.0 + z)) + 2.0) - sqrt(z);
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, 1.85e+15], N[(N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] + 2.0), $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision] + N[(N[(N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq 1.85 \cdot 10^{+15}:\\
\;\;\;\;\left(\sqrt{1 + z} + 2\right) - \sqrt{z}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{x + 1} + \left(\left(\sqrt{y + 1} - \sqrt{y}\right) - \sqrt{x}\right)\\
\end{array}
\end{array}
if z < 1.85e15Initial program 96.2%
associate-+l+96.2%
+-commutative96.2%
associate-+r-76.2%
associate-+l-56.5%
+-commutative56.5%
associate--l+56.5%
+-commutative56.5%
Simplified52.5%
Taylor expanded in t around inf 33.6%
+-commutative33.6%
+-commutative33.6%
associate--l+33.6%
Simplified33.6%
Taylor expanded in x around 0 35.6%
Taylor expanded in y around 0 46.5%
if 1.85e15 < z Initial program 85.9%
associate-+l+85.9%
+-commutative85.9%
associate-+r-72.0%
associate-+l-52.9%
+-commutative52.9%
associate--l+52.9%
+-commutative52.9%
Simplified19.2%
Taylor expanded in t around inf 26.9%
+-commutative26.9%
+-commutative26.9%
associate--l+28.6%
Simplified28.6%
Taylor expanded in z around inf 28.6%
Final simplification38.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 1.85e+15) (- 2.0 (- (sqrt z) (sqrt (+ 1.0 z)))) (+ 1.0 (- (sqrt (+ y 1.0)) (sqrt y)))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (z <= 1.85e+15) {
tmp = 2.0 - (sqrt(z) - sqrt((1.0 + z)));
} else {
tmp = 1.0 + (sqrt((y + 1.0)) - 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.85d+15) then
tmp = 2.0d0 - (sqrt(z) - sqrt((1.0d0 + z)))
else
tmp = 1.0d0 + (sqrt((y + 1.0d0)) - 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.85e+15) {
tmp = 2.0 - (Math.sqrt(z) - Math.sqrt((1.0 + z)));
} else {
tmp = 1.0 + (Math.sqrt((y + 1.0)) - 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.85e+15: tmp = 2.0 - (math.sqrt(z) - math.sqrt((1.0 + z))) else: tmp = 1.0 + (math.sqrt((y + 1.0)) - 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.85e+15) tmp = Float64(2.0 - Float64(sqrt(z) - sqrt(Float64(1.0 + z)))); else tmp = Float64(1.0 + Float64(sqrt(Float64(y + 1.0)) - 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.85e+15)
tmp = 2.0 - (sqrt(z) - sqrt((1.0 + z)));
else
tmp = 1.0 + (sqrt((y + 1.0)) - 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.85e+15], N[(2.0 - N[(N[Sqrt[z], $MachinePrecision] - N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(N[Sqrt[N[(y + 1.0), $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.85 \cdot 10^{+15}:\\
\;\;\;\;2 - \left(\sqrt{z} - \sqrt{1 + z}\right)\\
\mathbf{else}:\\
\;\;\;\;1 + \left(\sqrt{y + 1} - \sqrt{y}\right)\\
\end{array}
\end{array}
if z < 1.85e15Initial program 96.2%
associate-+l+96.2%
+-commutative96.2%
associate-+r-76.2%
associate-+l-56.5%
+-commutative56.5%
associate--l+56.5%
+-commutative56.5%
Simplified52.5%
Taylor expanded in t around inf 33.6%
+-commutative33.6%
+-commutative33.6%
associate--l+33.6%
Simplified33.6%
Taylor expanded in x around 0 35.6%
Taylor expanded in y around 0 46.5%
associate--l+46.5%
Simplified46.5%
if 1.85e15 < z Initial program 85.9%
associate-+l+85.9%
+-commutative85.9%
associate-+r-72.0%
associate-+l-52.9%
+-commutative52.9%
associate--l+52.9%
+-commutative52.9%
Simplified19.2%
Taylor expanded in t around inf 26.9%
+-commutative26.9%
+-commutative26.9%
associate--l+28.6%
Simplified28.6%
Taylor expanded in x around inf 4.0%
associate--l+17.9%
+-commutative17.9%
Simplified17.9%
Taylor expanded in z around 0 27.6%
associate--l+55.3%
Simplified55.3%
Final simplification50.4%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= z 1.85e+15) (- (+ (sqrt (+ 1.0 z)) 2.0) (sqrt z)) (+ 1.0 (- (sqrt (+ y 1.0)) (sqrt y)))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (z <= 1.85e+15) {
tmp = (sqrt((1.0 + z)) + 2.0) - sqrt(z);
} else {
tmp = 1.0 + (sqrt((y + 1.0)) - 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.85d+15) then
tmp = (sqrt((1.0d0 + z)) + 2.0d0) - sqrt(z)
else
tmp = 1.0d0 + (sqrt((y + 1.0d0)) - 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.85e+15) {
tmp = (Math.sqrt((1.0 + z)) + 2.0) - Math.sqrt(z);
} else {
tmp = 1.0 + (Math.sqrt((y + 1.0)) - 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.85e+15: tmp = (math.sqrt((1.0 + z)) + 2.0) - math.sqrt(z) else: tmp = 1.0 + (math.sqrt((y + 1.0)) - 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.85e+15) tmp = Float64(Float64(sqrt(Float64(1.0 + z)) + 2.0) - sqrt(z)); else tmp = Float64(1.0 + Float64(sqrt(Float64(y + 1.0)) - 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.85e+15)
tmp = (sqrt((1.0 + z)) + 2.0) - sqrt(z);
else
tmp = 1.0 + (sqrt((y + 1.0)) - 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.85e+15], N[(N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] + 2.0), $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(N[Sqrt[N[(y + 1.0), $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.85 \cdot 10^{+15}:\\
\;\;\;\;\left(\sqrt{1 + z} + 2\right) - \sqrt{z}\\
\mathbf{else}:\\
\;\;\;\;1 + \left(\sqrt{y + 1} - \sqrt{y}\right)\\
\end{array}
\end{array}
if z < 1.85e15Initial program 96.2%
associate-+l+96.2%
+-commutative96.2%
associate-+r-76.2%
associate-+l-56.5%
+-commutative56.5%
associate--l+56.5%
+-commutative56.5%
Simplified52.5%
Taylor expanded in t around inf 33.6%
+-commutative33.6%
+-commutative33.6%
associate--l+33.6%
Simplified33.6%
Taylor expanded in x around 0 35.6%
Taylor expanded in y around 0 46.5%
if 1.85e15 < z Initial program 85.9%
associate-+l+85.9%
+-commutative85.9%
associate-+r-72.0%
associate-+l-52.9%
+-commutative52.9%
associate--l+52.9%
+-commutative52.9%
Simplified19.2%
Taylor expanded in t around inf 26.9%
+-commutative26.9%
+-commutative26.9%
associate--l+28.6%
Simplified28.6%
Taylor expanded in x around inf 4.0%
associate--l+17.9%
+-commutative17.9%
Simplified17.9%
Taylor expanded in z around 0 27.6%
associate--l+55.3%
Simplified55.3%
Final simplification50.4%
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 (+ y 1.0)) (sqrt y))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
return 1.0 + (sqrt((y + 1.0)) - sqrt(y));
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = 1.0d0 + (sqrt((y + 1.0d0)) - sqrt(y))
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
return 1.0 + (Math.sqrt((y + 1.0)) - Math.sqrt(y));
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): return 1.0 + (math.sqrt((y + 1.0)) - math.sqrt(y))
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) return Float64(1.0 + Float64(sqrt(Float64(y + 1.0)) - sqrt(y))) end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp = code(x, y, z, t)
tmp = 1.0 + (sqrt((y + 1.0)) - sqrt(y));
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := N[(1.0 + N[(N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
1 + \left(\sqrt{y + 1} - \sqrt{y}\right)
\end{array}
Initial program 91.6%
associate-+l+91.6%
+-commutative91.6%
associate-+r-74.3%
associate-+l-54.9%
+-commutative54.9%
associate--l+54.9%
+-commutative54.9%
Simplified37.7%
Taylor expanded in t around inf 30.6%
+-commutative30.6%
+-commutative30.6%
associate--l+31.4%
Simplified31.4%
Taylor expanded in x around inf 16.3%
associate--l+22.4%
+-commutative22.4%
Simplified22.4%
Taylor expanded in z around 0 27.0%
associate--l+45.7%
Simplified45.7%
Final simplification45.7%
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)) (sqrt y)))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
return sqrt((y + 1.0)) - 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 + 1.0d0)) - 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 + 1.0)) - Math.sqrt(y);
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): return math.sqrt((y + 1.0)) - math.sqrt(y)
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) return Float64(sqrt(Float64(y + 1.0)) - sqrt(y)) end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp = code(x, y, z, t)
tmp = sqrt((y + 1.0)) - sqrt(y);
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := N[(N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\sqrt{y + 1} - \sqrt{y}
\end{array}
Initial program 91.6%
associate-+l+91.6%
+-commutative91.6%
associate-+r-74.3%
associate-+l-54.9%
+-commutative54.9%
associate--l+54.9%
+-commutative54.9%
Simplified37.7%
Taylor expanded in t around inf 30.6%
+-commutative30.6%
+-commutative30.6%
associate--l+31.4%
Simplified31.4%
Taylor expanded in x around inf 16.3%
associate--l+22.4%
+-commutative22.4%
Simplified22.4%
Taylor expanded in z around inf 14.4%
Final simplification14.4%
(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 2023229
(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))))