
(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 20 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 8.2e+30)
(+
(- t_2 (sqrt x))
(+ (- t_1 (sqrt y)) (+ (/ 1.0 (+ (sqrt t) (sqrt (+ 1.0 t)))) t_3)))
(+ t_3 (+ (/ 1.0 (+ (sqrt x) t_2)) (/ 1.0 (+ t_1 (sqrt y))))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + y));
double t_2 = sqrt((1.0 + x));
double t_3 = 1.0 / (sqrt(z) + sqrt((1.0 + z)));
double tmp;
if (t <= 8.2e+30) {
tmp = (t_2 - sqrt(x)) + ((t_1 - sqrt(y)) + ((1.0 / (sqrt(t) + sqrt((1.0 + t)))) + t_3));
} else {
tmp = t_3 + ((1.0 / (sqrt(x) + t_2)) + (1.0 / (t_1 + sqrt(y))));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = sqrt((1.0d0 + y))
t_2 = sqrt((1.0d0 + x))
t_3 = 1.0d0 / (sqrt(z) + sqrt((1.0d0 + z)))
if (t <= 8.2d+30) then
tmp = (t_2 - sqrt(x)) + ((t_1 - sqrt(y)) + ((1.0d0 / (sqrt(t) + sqrt((1.0d0 + t)))) + t_3))
else
tmp = t_3 + ((1.0d0 / (sqrt(x) + t_2)) + (1.0d0 / (t_1 + sqrt(y))))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + 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 <= 8.2e+30) {
tmp = (t_2 - Math.sqrt(x)) + ((t_1 - Math.sqrt(y)) + ((1.0 / (Math.sqrt(t) + Math.sqrt((1.0 + t)))) + t_3));
} else {
tmp = t_3 + ((1.0 / (Math.sqrt(x) + t_2)) + (1.0 / (t_1 + Math.sqrt(y))));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + y)) t_2 = math.sqrt((1.0 + x)) t_3 = 1.0 / (math.sqrt(z) + math.sqrt((1.0 + z))) tmp = 0 if t <= 8.2e+30: tmp = (t_2 - math.sqrt(x)) + ((t_1 - math.sqrt(y)) + ((1.0 / (math.sqrt(t) + math.sqrt((1.0 + t)))) + t_3)) else: tmp = t_3 + ((1.0 / (math.sqrt(x) + t_2)) + (1.0 / (t_1 + math.sqrt(y)))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(1.0 + 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 <= 8.2e+30) tmp = Float64(Float64(t_2 - sqrt(x)) + Float64(Float64(t_1 - sqrt(y)) + Float64(Float64(1.0 / Float64(sqrt(t) + sqrt(Float64(1.0 + t)))) + t_3))); else tmp = Float64(t_3 + Float64(Float64(1.0 / Float64(sqrt(x) + t_2)) + Float64(1.0 / Float64(t_1 + sqrt(y))))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + y));
t_2 = sqrt((1.0 + x));
t_3 = 1.0 / (sqrt(z) + sqrt((1.0 + z)));
tmp = 0.0;
if (t <= 8.2e+30)
tmp = (t_2 - sqrt(x)) + ((t_1 - sqrt(y)) + ((1.0 / (sqrt(t) + sqrt((1.0 + t)))) + t_3));
else
tmp = t_3 + ((1.0 / (sqrt(x) + t_2)) + (1.0 / (t_1 + sqrt(y))));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(1.0 + 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, 8.2e+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[t], $MachinePrecision] + N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$3 + N[(N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + t$95$2), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(t$95$1 + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + y}\\
t_2 := \sqrt{1 + x}\\
t_3 := \frac{1}{\sqrt{z} + \sqrt{1 + z}}\\
\mathbf{if}\;t \leq 8.2 \cdot 10^{+30}:\\
\;\;\;\;\left(t_2 - \sqrt{x}\right) + \left(\left(t_1 - \sqrt{y}\right) + \left(\frac{1}{\sqrt{t} + \sqrt{1 + t}} + t_3\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_3 + \left(\frac{1}{\sqrt{x} + t_2} + \frac{1}{t_1 + \sqrt{y}}\right)\\
\end{array}
\end{array}
if t < 8.20000000000000011e30Initial program 96.6%
associate-+l+96.6%
associate-+l+96.6%
+-commutative96.6%
+-commutative96.6%
+-commutative96.6%
Simplified96.6%
flip--96.5%
add-sqr-sqrt77.0%
add-sqr-sqrt96.7%
Applied egg-rr96.7%
associate--l+97.0%
+-inverses97.0%
metadata-eval97.0%
+-commutative97.0%
+-commutative97.0%
Simplified97.0%
flip--97.0%
add-sqr-sqrt95.6%
add-sqr-sqrt97.3%
Applied egg-rr97.3%
associate--l+98.1%
+-inverses98.1%
metadata-eval98.1%
+-commutative98.1%
+-commutative98.1%
Simplified98.1%
if 8.20000000000000011e30 < t Initial program 86.1%
associate-+l+86.1%
associate-+l+86.1%
+-commutative86.1%
+-commutative86.1%
+-commutative86.1%
Simplified86.1%
flip--86.2%
add-sqr-sqrt66.8%
add-sqr-sqrt86.7%
Applied egg-rr86.7%
+-commutative86.7%
associate--l+88.4%
+-inverses88.4%
metadata-eval88.4%
+-commutative88.4%
+-commutative88.4%
Simplified88.4%
flip--88.7%
add-sqr-sqrt68.7%
add-sqr-sqrt89.0%
Applied egg-rr89.0%
associate--l+92.4%
+-inverses92.4%
metadata-eval92.4%
Simplified92.4%
flip--86.4%
add-sqr-sqrt71.9%
add-sqr-sqrt86.4%
Applied egg-rr92.7%
associate--l+89.4%
+-inverses89.4%
metadata-eval89.4%
+-commutative89.4%
+-commutative89.4%
Simplified95.8%
Taylor expanded in t around inf 95.8%
associate-+r+95.8%
+-commutative95.8%
Simplified95.8%
Final simplification97.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 x)))
(t_2 (sqrt (+ 1.0 z)))
(t_3 (- t_2 (sqrt z)))
(t_4 (sqrt (+ 1.0 y))))
(if (<= t_3 0.999)
(+
(/ 1.0 (+ (sqrt z) t_2))
(+ (/ 1.0 (+ (sqrt x) t_1)) (/ 1.0 (+ t_4 (sqrt y)))))
(+
(- t_1 (sqrt x))
(+ (- t_4 (sqrt y)) (+ (/ 1.0 (+ (sqrt t) (sqrt (+ 1.0 t)))) t_3))))))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 t_3 = t_2 - sqrt(z);
double t_4 = sqrt((1.0 + y));
double tmp;
if (t_3 <= 0.999) {
tmp = (1.0 / (sqrt(z) + t_2)) + ((1.0 / (sqrt(x) + t_1)) + (1.0 / (t_4 + sqrt(y))));
} else {
tmp = (t_1 - sqrt(x)) + ((t_4 - sqrt(y)) + ((1.0 / (sqrt(t) + sqrt((1.0 + t)))) + t_3));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: tmp
t_1 = sqrt((1.0d0 + x))
t_2 = sqrt((1.0d0 + z))
t_3 = t_2 - sqrt(z)
t_4 = sqrt((1.0d0 + y))
if (t_3 <= 0.999d0) then
tmp = (1.0d0 / (sqrt(z) + t_2)) + ((1.0d0 / (sqrt(x) + t_1)) + (1.0d0 / (t_4 + sqrt(y))))
else
tmp = (t_1 - sqrt(x)) + ((t_4 - sqrt(y)) + ((1.0d0 / (sqrt(t) + sqrt((1.0d0 + t)))) + t_3))
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 t_3 = t_2 - Math.sqrt(z);
double t_4 = Math.sqrt((1.0 + y));
double tmp;
if (t_3 <= 0.999) {
tmp = (1.0 / (Math.sqrt(z) + t_2)) + ((1.0 / (Math.sqrt(x) + t_1)) + (1.0 / (t_4 + Math.sqrt(y))));
} else {
tmp = (t_1 - Math.sqrt(x)) + ((t_4 - Math.sqrt(y)) + ((1.0 / (Math.sqrt(t) + Math.sqrt((1.0 + t)))) + t_3));
}
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)) t_3 = t_2 - math.sqrt(z) t_4 = math.sqrt((1.0 + y)) tmp = 0 if t_3 <= 0.999: tmp = (1.0 / (math.sqrt(z) + t_2)) + ((1.0 / (math.sqrt(x) + t_1)) + (1.0 / (t_4 + math.sqrt(y)))) else: tmp = (t_1 - math.sqrt(x)) + ((t_4 - math.sqrt(y)) + ((1.0 / (math.sqrt(t) + math.sqrt((1.0 + t)))) + t_3)) 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)) t_3 = Float64(t_2 - sqrt(z)) t_4 = sqrt(Float64(1.0 + y)) tmp = 0.0 if (t_3 <= 0.999) tmp = Float64(Float64(1.0 / Float64(sqrt(z) + t_2)) + Float64(Float64(1.0 / Float64(sqrt(x) + t_1)) + Float64(1.0 / Float64(t_4 + sqrt(y))))); else tmp = Float64(Float64(t_1 - sqrt(x)) + Float64(Float64(t_4 - sqrt(y)) + Float64(Float64(1.0 / Float64(sqrt(t) + sqrt(Float64(1.0 + t)))) + t_3))); 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));
t_3 = t_2 - sqrt(z);
t_4 = sqrt((1.0 + y));
tmp = 0.0;
if (t_3 <= 0.999)
tmp = (1.0 / (sqrt(z) + t_2)) + ((1.0 / (sqrt(x) + t_1)) + (1.0 / (t_4 + sqrt(y))));
else
tmp = (t_1 - sqrt(x)) + ((t_4 - sqrt(y)) + ((1.0 / (sqrt(t) + sqrt((1.0 + t)))) + t_3));
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]}, Block[{t$95$3 = N[(t$95$2 - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t$95$3, 0.999], N[(N[(1.0 / N[(N[Sqrt[z], $MachinePrecision] + t$95$2), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(t$95$4 + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(t$95$1 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$4 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 / N[(N[Sqrt[t], $MachinePrecision] + N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$3), $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}\\
t_3 := t_2 - \sqrt{z}\\
t_4 := \sqrt{1 + y}\\
\mathbf{if}\;t_3 \leq 0.999:\\
\;\;\;\;\frac{1}{\sqrt{z} + t_2} + \left(\frac{1}{\sqrt{x} + t_1} + \frac{1}{t_4 + \sqrt{y}}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(t_1 - \sqrt{x}\right) + \left(\left(t_4 - \sqrt{y}\right) + \left(\frac{1}{\sqrt{t} + \sqrt{1 + t}} + t_3\right)\right)\\
\end{array}
\end{array}
if (-.f64 (sqrt.f64 (+.f64 z 1)) (sqrt.f64 z)) < 0.998999999999999999Initial program 84.9%
associate-+l+84.9%
associate-+l+84.9%
+-commutative84.9%
+-commutative84.9%
+-commutative84.9%
Simplified84.9%
flip--85.0%
add-sqr-sqrt68.3%
add-sqr-sqrt85.7%
Applied egg-rr85.7%
+-commutative85.7%
associate--l+87.8%
+-inverses87.8%
metadata-eval87.8%
+-commutative87.8%
+-commutative87.8%
Simplified87.8%
flip--88.2%
add-sqr-sqrt69.6%
add-sqr-sqrt88.3%
Applied egg-rr88.3%
associate--l+91.4%
+-inverses91.4%
metadata-eval91.4%
Simplified91.4%
flip--85.2%
add-sqr-sqrt51.0%
add-sqr-sqrt85.4%
Applied egg-rr91.8%
associate--l+88.6%
+-inverses88.6%
metadata-eval88.6%
+-commutative88.6%
+-commutative88.6%
Simplified95.2%
Taylor expanded in t around inf 54.6%
associate-+r+54.7%
+-commutative54.7%
Simplified54.7%
if 0.998999999999999999 < (-.f64 (sqrt.f64 (+.f64 z 1)) (sqrt.f64 z)) Initial program 98.1%
associate-+l+98.1%
associate-+l+98.1%
+-commutative98.1%
+-commutative98.1%
+-commutative98.1%
Simplified98.1%
flip--98.0%
add-sqr-sqrt72.7%
add-sqr-sqrt98.1%
Applied egg-rr98.1%
associate--l+98.5%
+-inverses98.5%
metadata-eval98.5%
+-commutative98.5%
+-commutative98.5%
Simplified98.5%
Final simplification76.6%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ 1.0 x)))
(t_2 (sqrt (+ 1.0 z)))
(t_3 (- t_2 (sqrt z)))
(t_4 (sqrt (+ 1.0 y))))
(if (<= t_3 0.999)
(+
(/ 1.0 (+ (sqrt z) t_2))
(+ (/ 1.0 (+ (sqrt x) t_1)) (/ 1.0 (+ t_4 (sqrt y)))))
(+
(+ t_3 (+ (- t_1 (sqrt x)) (- t_4 (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) {
double t_1 = sqrt((1.0 + x));
double t_2 = sqrt((1.0 + z));
double t_3 = t_2 - sqrt(z);
double t_4 = sqrt((1.0 + y));
double tmp;
if (t_3 <= 0.999) {
tmp = (1.0 / (sqrt(z) + t_2)) + ((1.0 / (sqrt(x) + t_1)) + (1.0 / (t_4 + sqrt(y))));
} else {
tmp = (t_3 + ((t_1 - sqrt(x)) + (t_4 - sqrt(y)))) + (sqrt((1.0 + t)) - sqrt(t));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: tmp
t_1 = sqrt((1.0d0 + x))
t_2 = sqrt((1.0d0 + z))
t_3 = t_2 - sqrt(z)
t_4 = sqrt((1.0d0 + y))
if (t_3 <= 0.999d0) then
tmp = (1.0d0 / (sqrt(z) + t_2)) + ((1.0d0 / (sqrt(x) + t_1)) + (1.0d0 / (t_4 + sqrt(y))))
else
tmp = (t_3 + ((t_1 - sqrt(x)) + (t_4 - sqrt(y)))) + (sqrt((1.0d0 + t)) - sqrt(t))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + x));
double t_2 = Math.sqrt((1.0 + z));
double t_3 = t_2 - Math.sqrt(z);
double t_4 = Math.sqrt((1.0 + y));
double tmp;
if (t_3 <= 0.999) {
tmp = (1.0 / (Math.sqrt(z) + t_2)) + ((1.0 / (Math.sqrt(x) + t_1)) + (1.0 / (t_4 + Math.sqrt(y))));
} else {
tmp = (t_3 + ((t_1 - Math.sqrt(x)) + (t_4 - Math.sqrt(y)))) + (Math.sqrt((1.0 + t)) - Math.sqrt(t));
}
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)) t_3 = t_2 - math.sqrt(z) t_4 = math.sqrt((1.0 + y)) tmp = 0 if t_3 <= 0.999: tmp = (1.0 / (math.sqrt(z) + t_2)) + ((1.0 / (math.sqrt(x) + t_1)) + (1.0 / (t_4 + math.sqrt(y)))) else: tmp = (t_3 + ((t_1 - math.sqrt(x)) + (t_4 - math.sqrt(y)))) + (math.sqrt((1.0 + t)) - math.sqrt(t)) 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)) t_3 = Float64(t_2 - sqrt(z)) t_4 = sqrt(Float64(1.0 + y)) tmp = 0.0 if (t_3 <= 0.999) tmp = Float64(Float64(1.0 / Float64(sqrt(z) + t_2)) + Float64(Float64(1.0 / Float64(sqrt(x) + t_1)) + Float64(1.0 / Float64(t_4 + sqrt(y))))); else tmp = Float64(Float64(t_3 + Float64(Float64(t_1 - sqrt(x)) + Float64(t_4 - sqrt(y)))) + Float64(sqrt(Float64(1.0 + t)) - sqrt(t))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + x));
t_2 = sqrt((1.0 + z));
t_3 = t_2 - sqrt(z);
t_4 = sqrt((1.0 + y));
tmp = 0.0;
if (t_3 <= 0.999)
tmp = (1.0 / (sqrt(z) + t_2)) + ((1.0 / (sqrt(x) + t_1)) + (1.0 / (t_4 + sqrt(y))));
else
tmp = (t_3 + ((t_1 - sqrt(x)) + (t_4 - sqrt(y)))) + (sqrt((1.0 + t)) - sqrt(t));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[(t$95$2 - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t$95$3, 0.999], N[(N[(1.0 / N[(N[Sqrt[z], $MachinePrecision] + t$95$2), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(t$95$4 + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(t$95$3 + N[(N[(t$95$1 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(t$95$4 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + x}\\
t_2 := \sqrt{1 + z}\\
t_3 := t_2 - \sqrt{z}\\
t_4 := \sqrt{1 + y}\\
\mathbf{if}\;t_3 \leq 0.999:\\
\;\;\;\;\frac{1}{\sqrt{z} + t_2} + \left(\frac{1}{\sqrt{x} + t_1} + \frac{1}{t_4 + \sqrt{y}}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(t_3 + \left(\left(t_1 - \sqrt{x}\right) + \left(t_4 - \sqrt{y}\right)\right)\right) + \left(\sqrt{1 + t} - \sqrt{t}\right)\\
\end{array}
\end{array}
if (-.f64 (sqrt.f64 (+.f64 z 1)) (sqrt.f64 z)) < 0.998999999999999999Initial program 84.9%
associate-+l+84.9%
associate-+l+84.9%
+-commutative84.9%
+-commutative84.9%
+-commutative84.9%
Simplified84.9%
flip--85.0%
add-sqr-sqrt68.3%
add-sqr-sqrt85.7%
Applied egg-rr85.7%
+-commutative85.7%
associate--l+87.8%
+-inverses87.8%
metadata-eval87.8%
+-commutative87.8%
+-commutative87.8%
Simplified87.8%
flip--88.2%
add-sqr-sqrt69.6%
add-sqr-sqrt88.3%
Applied egg-rr88.3%
associate--l+91.4%
+-inverses91.4%
metadata-eval91.4%
Simplified91.4%
flip--85.2%
add-sqr-sqrt51.0%
add-sqr-sqrt85.4%
Applied egg-rr91.8%
associate--l+88.6%
+-inverses88.6%
metadata-eval88.6%
+-commutative88.6%
+-commutative88.6%
Simplified95.2%
Taylor expanded in t around inf 54.6%
associate-+r+54.7%
+-commutative54.7%
Simplified54.7%
if 0.998999999999999999 < (-.f64 (sqrt.f64 (+.f64 z 1)) (sqrt.f64 z)) Initial program 98.1%
Final simplification76.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 x) (sqrt (+ 1.0 x)))) (+ (+ (/ 1.0 (+ (sqrt z) (sqrt (+ 1.0 z)))) (- (sqrt (+ 1.0 t)) (sqrt t))) (/ 1.0 (+ (sqrt (+ 1.0 y)) (sqrt y))))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
return (1.0 / (sqrt(x) + sqrt((1.0 + x)))) + (((1.0 / (sqrt(z) + sqrt((1.0 + z)))) + (sqrt((1.0 + t)) - sqrt(t))) + (1.0 / (sqrt((1.0 + y)) + sqrt(y))));
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (1.0d0 / (sqrt(x) + sqrt((1.0d0 + x)))) + (((1.0d0 / (sqrt(z) + sqrt((1.0d0 + z)))) + (sqrt((1.0d0 + t)) - sqrt(t))) + (1.0d0 / (sqrt((1.0d0 + y)) + sqrt(y))))
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
return (1.0 / (Math.sqrt(x) + Math.sqrt((1.0 + x)))) + (((1.0 / (Math.sqrt(z) + Math.sqrt((1.0 + z)))) + (Math.sqrt((1.0 + t)) - Math.sqrt(t))) + (1.0 / (Math.sqrt((1.0 + y)) + Math.sqrt(y))));
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): return (1.0 / (math.sqrt(x) + math.sqrt((1.0 + x)))) + (((1.0 / (math.sqrt(z) + math.sqrt((1.0 + z)))) + (math.sqrt((1.0 + t)) - math.sqrt(t))) + (1.0 / (math.sqrt((1.0 + y)) + math.sqrt(y))))
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) return Float64(Float64(1.0 / Float64(sqrt(x) + sqrt(Float64(1.0 + x)))) + Float64(Float64(Float64(1.0 / Float64(sqrt(z) + sqrt(Float64(1.0 + z)))) + Float64(sqrt(Float64(1.0 + t)) - sqrt(t))) + Float64(1.0 / Float64(sqrt(Float64(1.0 + y)) + sqrt(y))))) end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp = code(x, y, z, t)
tmp = (1.0 / (sqrt(x) + sqrt((1.0 + x)))) + (((1.0 / (sqrt(z) + sqrt((1.0 + z)))) + (sqrt((1.0 + t)) - sqrt(t))) + (1.0 / (sqrt((1.0 + y)) + sqrt(y))));
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := N[(N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(1.0 / N[(N[Sqrt[z], $MachinePrecision] + N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\frac{1}{\sqrt{x} + \sqrt{1 + x}} + \left(\left(\frac{1}{\sqrt{z} + \sqrt{1 + z}} + \left(\sqrt{1 + t} - \sqrt{t}\right)\right) + \frac{1}{\sqrt{1 + y} + \sqrt{y}}\right)
\end{array}
Initial program 91.5%
associate-+l+91.5%
associate-+l+91.5%
+-commutative91.5%
+-commutative91.5%
+-commutative91.5%
Simplified91.5%
flip--91.6%
add-sqr-sqrt68.6%
add-sqr-sqrt91.9%
Applied egg-rr91.9%
+-commutative91.9%
associate--l+93.0%
+-inverses93.0%
metadata-eval93.0%
+-commutative93.0%
+-commutative93.0%
Simplified93.0%
flip--93.5%
add-sqr-sqrt70.8%
add-sqr-sqrt93.8%
Applied egg-rr93.8%
associate--l+95.4%
+-inverses95.4%
metadata-eval95.4%
Simplified95.4%
flip--91.6%
add-sqr-sqrt74.5%
add-sqr-sqrt91.7%
Applied egg-rr95.6%
associate--l+93.3%
+-inverses93.3%
metadata-eval93.3%
+-commutative93.3%
+-commutative93.3%
Simplified97.3%
Final simplification97.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 y))) (t_2 (sqrt (+ 1.0 x))))
(if (<= t 930000000000.0)
(+
t_2
(- (+ (sqrt (+ 1.0 t)) (+ 1.0 t_1)) (+ (sqrt t) (+ (sqrt x) (sqrt y)))))
(+
(/ 1.0 (+ (sqrt x) t_2))
(+ (/ 1.0 (+ (sqrt z) (sqrt (+ 1.0 z)))) (/ 1.0 (+ t_1 (sqrt y))))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + y));
double t_2 = sqrt((1.0 + x));
double tmp;
if (t <= 930000000000.0) {
tmp = t_2 + ((sqrt((1.0 + t)) + (1.0 + t_1)) - (sqrt(t) + (sqrt(x) + sqrt(y))));
} else {
tmp = (1.0 / (sqrt(x) + t_2)) + ((1.0 / (sqrt(z) + sqrt((1.0 + z)))) + (1.0 / (t_1 + sqrt(y))));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = sqrt((1.0d0 + y))
t_2 = sqrt((1.0d0 + x))
if (t <= 930000000000.0d0) then
tmp = t_2 + ((sqrt((1.0d0 + t)) + (1.0d0 + t_1)) - (sqrt(t) + (sqrt(x) + sqrt(y))))
else
tmp = (1.0d0 / (sqrt(x) + t_2)) + ((1.0d0 / (sqrt(z) + sqrt((1.0d0 + z)))) + (1.0d0 / (t_1 + sqrt(y))))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + y));
double t_2 = Math.sqrt((1.0 + x));
double tmp;
if (t <= 930000000000.0) {
tmp = t_2 + ((Math.sqrt((1.0 + t)) + (1.0 + t_1)) - (Math.sqrt(t) + (Math.sqrt(x) + Math.sqrt(y))));
} else {
tmp = (1.0 / (Math.sqrt(x) + t_2)) + ((1.0 / (Math.sqrt(z) + Math.sqrt((1.0 + z)))) + (1.0 / (t_1 + Math.sqrt(y))));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + y)) t_2 = math.sqrt((1.0 + x)) tmp = 0 if t <= 930000000000.0: tmp = t_2 + ((math.sqrt((1.0 + t)) + (1.0 + t_1)) - (math.sqrt(t) + (math.sqrt(x) + math.sqrt(y)))) else: tmp = (1.0 / (math.sqrt(x) + t_2)) + ((1.0 / (math.sqrt(z) + math.sqrt((1.0 + z)))) + (1.0 / (t_1 + math.sqrt(y)))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(1.0 + y)) t_2 = sqrt(Float64(1.0 + x)) tmp = 0.0 if (t <= 930000000000.0) tmp = Float64(t_2 + Float64(Float64(sqrt(Float64(1.0 + t)) + Float64(1.0 + t_1)) - Float64(sqrt(t) + Float64(sqrt(x) + sqrt(y))))); else tmp = Float64(Float64(1.0 / Float64(sqrt(x) + t_2)) + Float64(Float64(1.0 / Float64(sqrt(z) + sqrt(Float64(1.0 + z)))) + Float64(1.0 / Float64(t_1 + sqrt(y))))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + y));
t_2 = sqrt((1.0 + x));
tmp = 0.0;
if (t <= 930000000000.0)
tmp = t_2 + ((sqrt((1.0 + t)) + (1.0 + t_1)) - (sqrt(t) + (sqrt(x) + sqrt(y))));
else
tmp = (1.0 / (sqrt(x) + t_2)) + ((1.0 / (sqrt(z) + sqrt((1.0 + z)))) + (1.0 / (t_1 + sqrt(y))));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t, 930000000000.0], N[(t$95$2 + N[(N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] + N[(1.0 + t$95$1), $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[t], $MachinePrecision] + N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + t$95$2), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 / N[(N[Sqrt[z], $MachinePrecision] + N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(t$95$1 + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + y}\\
t_2 := \sqrt{1 + x}\\
\mathbf{if}\;t \leq 930000000000:\\
\;\;\;\;t_2 + \left(\left(\sqrt{1 + t} + \left(1 + t_1\right)\right) - \left(\sqrt{t} + \left(\sqrt{x} + \sqrt{y}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{x} + t_2} + \left(\frac{1}{\sqrt{z} + \sqrt{1 + z}} + \frac{1}{t_1 + \sqrt{y}}\right)\\
\end{array}
\end{array}
if t < 9.3e11Initial program 97.3%
associate-+l+97.3%
+-commutative97.3%
associate-+r-81.6%
associate-+l-55.7%
+-commutative55.7%
+-commutative55.7%
associate--l+55.7%
Simplified54.2%
Taylor expanded in z around 0 23.8%
associate-+r+23.8%
+-commutative23.8%
associate-+l+23.8%
+-commutative23.8%
Simplified23.8%
if 9.3e11 < t Initial program 85.9%
associate-+l+85.9%
associate-+l+85.9%
+-commutative85.9%
+-commutative85.9%
+-commutative85.9%
Simplified85.9%
flip--86.1%
add-sqr-sqrt67.7%
add-sqr-sqrt86.5%
Applied egg-rr86.5%
+-commutative86.5%
associate--l+88.1%
+-inverses88.1%
metadata-eval88.1%
+-commutative88.1%
+-commutative88.1%
Simplified88.1%
flip--88.4%
add-sqr-sqrt68.1%
add-sqr-sqrt88.7%
Applied egg-rr88.7%
associate--l+91.9%
+-inverses91.9%
metadata-eval91.9%
Simplified91.9%
flip--86.2%
add-sqr-sqrt71.3%
add-sqr-sqrt86.2%
Applied egg-rr92.2%
associate--l+89.1%
+-inverses89.1%
metadata-eval89.1%
+-commutative89.1%
+-commutative89.1%
Simplified95.1%
Taylor expanded in t around inf 95.1%
Final simplification60.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 y))) (t_2 (sqrt (+ 1.0 x))))
(if (<= t 930000000000.0)
(+
t_2
(- (+ (sqrt (+ 1.0 t)) (+ 1.0 t_1)) (+ (sqrt t) (+ (sqrt x) (sqrt y)))))
(+
(/ 1.0 (+ (sqrt z) (sqrt (+ 1.0 z))))
(+ (/ 1.0 (+ (sqrt x) t_2)) (/ 1.0 (+ t_1 (sqrt y))))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + y));
double t_2 = sqrt((1.0 + x));
double tmp;
if (t <= 930000000000.0) {
tmp = t_2 + ((sqrt((1.0 + t)) + (1.0 + t_1)) - (sqrt(t) + (sqrt(x) + sqrt(y))));
} else {
tmp = (1.0 / (sqrt(z) + sqrt((1.0 + z)))) + ((1.0 / (sqrt(x) + t_2)) + (1.0 / (t_1 + sqrt(y))));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = sqrt((1.0d0 + y))
t_2 = sqrt((1.0d0 + x))
if (t <= 930000000000.0d0) then
tmp = t_2 + ((sqrt((1.0d0 + t)) + (1.0d0 + t_1)) - (sqrt(t) + (sqrt(x) + sqrt(y))))
else
tmp = (1.0d0 / (sqrt(z) + sqrt((1.0d0 + z)))) + ((1.0d0 / (sqrt(x) + t_2)) + (1.0d0 / (t_1 + sqrt(y))))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + y));
double t_2 = Math.sqrt((1.0 + x));
double tmp;
if (t <= 930000000000.0) {
tmp = t_2 + ((Math.sqrt((1.0 + t)) + (1.0 + t_1)) - (Math.sqrt(t) + (Math.sqrt(x) + Math.sqrt(y))));
} else {
tmp = (1.0 / (Math.sqrt(z) + Math.sqrt((1.0 + z)))) + ((1.0 / (Math.sqrt(x) + t_2)) + (1.0 / (t_1 + Math.sqrt(y))));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + y)) t_2 = math.sqrt((1.0 + x)) tmp = 0 if t <= 930000000000.0: tmp = t_2 + ((math.sqrt((1.0 + t)) + (1.0 + t_1)) - (math.sqrt(t) + (math.sqrt(x) + math.sqrt(y)))) else: tmp = (1.0 / (math.sqrt(z) + math.sqrt((1.0 + z)))) + ((1.0 / (math.sqrt(x) + t_2)) + (1.0 / (t_1 + math.sqrt(y)))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(1.0 + y)) t_2 = sqrt(Float64(1.0 + x)) tmp = 0.0 if (t <= 930000000000.0) tmp = Float64(t_2 + Float64(Float64(sqrt(Float64(1.0 + t)) + Float64(1.0 + t_1)) - Float64(sqrt(t) + Float64(sqrt(x) + sqrt(y))))); else tmp = Float64(Float64(1.0 / Float64(sqrt(z) + sqrt(Float64(1.0 + z)))) + Float64(Float64(1.0 / Float64(sqrt(x) + t_2)) + Float64(1.0 / Float64(t_1 + sqrt(y))))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + y));
t_2 = sqrt((1.0 + x));
tmp = 0.0;
if (t <= 930000000000.0)
tmp = t_2 + ((sqrt((1.0 + t)) + (1.0 + t_1)) - (sqrt(t) + (sqrt(x) + sqrt(y))));
else
tmp = (1.0 / (sqrt(z) + sqrt((1.0 + z)))) + ((1.0 / (sqrt(x) + t_2)) + (1.0 / (t_1 + sqrt(y))));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t, 930000000000.0], N[(t$95$2 + N[(N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] + N[(1.0 + t$95$1), $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[t], $MachinePrecision] + N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 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[x], $MachinePrecision] + t$95$2), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(t$95$1 + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + y}\\
t_2 := \sqrt{1 + x}\\
\mathbf{if}\;t \leq 930000000000:\\
\;\;\;\;t_2 + \left(\left(\sqrt{1 + t} + \left(1 + t_1\right)\right) - \left(\sqrt{t} + \left(\sqrt{x} + \sqrt{y}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{z} + \sqrt{1 + z}} + \left(\frac{1}{\sqrt{x} + t_2} + \frac{1}{t_1 + \sqrt{y}}\right)\\
\end{array}
\end{array}
if t < 9.3e11Initial program 97.3%
associate-+l+97.3%
+-commutative97.3%
associate-+r-81.6%
associate-+l-55.7%
+-commutative55.7%
+-commutative55.7%
associate--l+55.7%
Simplified54.2%
Taylor expanded in z around 0 23.8%
associate-+r+23.8%
+-commutative23.8%
associate-+l+23.8%
+-commutative23.8%
Simplified23.8%
if 9.3e11 < t Initial program 85.9%
associate-+l+85.9%
associate-+l+85.9%
+-commutative85.9%
+-commutative85.9%
+-commutative85.9%
Simplified85.9%
flip--86.1%
add-sqr-sqrt67.7%
add-sqr-sqrt86.5%
Applied egg-rr86.5%
+-commutative86.5%
associate--l+88.1%
+-inverses88.1%
metadata-eval88.1%
+-commutative88.1%
+-commutative88.1%
Simplified88.1%
flip--88.4%
add-sqr-sqrt68.1%
add-sqr-sqrt88.7%
Applied egg-rr88.7%
associate--l+91.9%
+-inverses91.9%
metadata-eval91.9%
Simplified91.9%
flip--86.2%
add-sqr-sqrt71.3%
add-sqr-sqrt86.2%
Applied egg-rr92.2%
associate--l+89.1%
+-inverses89.1%
metadata-eval89.1%
+-commutative89.1%
+-commutative89.1%
Simplified95.1%
Taylor expanded in t around inf 95.1%
associate-+r+95.2%
+-commutative95.2%
Simplified95.2%
Final simplification60.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 x))))
(if (<= y 6.8e-20)
(+
(- t_1 (sqrt x))
(+
1.0
(+
(/ 1.0 (+ (sqrt z) (sqrt (+ 1.0 z))))
(- (sqrt (+ 1.0 t)) (sqrt t)))))
(+ (/ 1.0 (+ (sqrt x) t_1)) (/ 1.0 (+ (sqrt (+ 1.0 y)) (sqrt y)))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + x));
double tmp;
if (y <= 6.8e-20) {
tmp = (t_1 - sqrt(x)) + (1.0 + ((1.0 / (sqrt(z) + sqrt((1.0 + z)))) + (sqrt((1.0 + t)) - sqrt(t))));
} else {
tmp = (1.0 / (sqrt(x) + t_1)) + (1.0 / (sqrt((1.0 + y)) + sqrt(y)));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = sqrt((1.0d0 + x))
if (y <= 6.8d-20) then
tmp = (t_1 - sqrt(x)) + (1.0d0 + ((1.0d0 / (sqrt(z) + sqrt((1.0d0 + z)))) + (sqrt((1.0d0 + t)) - sqrt(t))))
else
tmp = (1.0d0 / (sqrt(x) + t_1)) + (1.0d0 / (sqrt((1.0d0 + y)) + sqrt(y)))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + x));
double tmp;
if (y <= 6.8e-20) {
tmp = (t_1 - Math.sqrt(x)) + (1.0 + ((1.0 / (Math.sqrt(z) + Math.sqrt((1.0 + z)))) + (Math.sqrt((1.0 + t)) - Math.sqrt(t))));
} else {
tmp = (1.0 / (Math.sqrt(x) + t_1)) + (1.0 / (Math.sqrt((1.0 + y)) + Math.sqrt(y)));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + x)) tmp = 0 if y <= 6.8e-20: tmp = (t_1 - math.sqrt(x)) + (1.0 + ((1.0 / (math.sqrt(z) + math.sqrt((1.0 + z)))) + (math.sqrt((1.0 + t)) - math.sqrt(t)))) else: tmp = (1.0 / (math.sqrt(x) + t_1)) + (1.0 / (math.sqrt((1.0 + y)) + math.sqrt(y))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(1.0 + x)) tmp = 0.0 if (y <= 6.8e-20) tmp = Float64(Float64(t_1 - sqrt(x)) + Float64(1.0 + Float64(Float64(1.0 / Float64(sqrt(z) + sqrt(Float64(1.0 + z)))) + Float64(sqrt(Float64(1.0 + t)) - sqrt(t))))); else tmp = Float64(Float64(1.0 / Float64(sqrt(x) + t_1)) + Float64(1.0 / Float64(sqrt(Float64(1.0 + y)) + sqrt(y)))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + x));
tmp = 0.0;
if (y <= 6.8e-20)
tmp = (t_1 - sqrt(x)) + (1.0 + ((1.0 / (sqrt(z) + sqrt((1.0 + z)))) + (sqrt((1.0 + t)) - sqrt(t))));
else
tmp = (1.0 / (sqrt(x) + t_1)) + (1.0 / (sqrt((1.0 + y)) + sqrt(y)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y, 6.8e-20], N[(N[(t$95$1 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(1.0 + N[(N[(1.0 / N[(N[Sqrt[z], $MachinePrecision] + N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + x}\\
\mathbf{if}\;y \leq 6.8 \cdot 10^{-20}:\\
\;\;\;\;\left(t_1 - \sqrt{x}\right) + \left(1 + \left(\frac{1}{\sqrt{z} + \sqrt{1 + z}} + \left(\sqrt{1 + t} - \sqrt{t}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{x} + t_1} + \frac{1}{\sqrt{1 + y} + \sqrt{y}}\\
\end{array}
\end{array}
if y < 6.7999999999999994e-20Initial program 98.3%
associate-+l+98.3%
associate-+l+98.3%
+-commutative98.3%
+-commutative98.3%
+-commutative98.3%
Simplified98.3%
flip--98.6%
add-sqr-sqrt82.3%
add-sqr-sqrt98.8%
Applied egg-rr98.8%
associate--l+99.1%
+-inverses99.1%
metadata-eval99.1%
+-commutative99.1%
+-commutative99.1%
Simplified99.1%
Taylor expanded in y around 0 98.6%
if 6.7999999999999994e-20 < y Initial program 87.2%
associate-+l+87.2%
+-commutative87.2%
associate-+r-85.3%
associate-+l-55.0%
+-commutative55.0%
+-commutative55.0%
associate--l+55.0%
Simplified37.5%
Taylor expanded in t around inf 33.2%
associate--l+34.3%
+-commutative34.3%
Simplified34.3%
flip--90.3%
add-sqr-sqrt52.9%
add-sqr-sqrt90.8%
Applied egg-rr34.8%
Taylor expanded in z around inf 24.2%
+-commutative24.2%
+-commutative24.2%
associate--l+28.4%
+-commutative28.4%
Simplified28.4%
flip--22.4%
add-sqr-sqrt23.1%
add-sqr-sqrt22.8%
+-commutative22.8%
Applied egg-rr28.9%
associate--l+25.5%
+-inverses25.5%
metadata-eval25.5%
Simplified30.3%
Final simplification57.0%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(if (<= y 3500000000.0)
(+
1.0
(+
(/ 1.0 (+ (sqrt z) (sqrt (+ 1.0 z))))
(/ 1.0 (+ (sqrt y) (hypot 1.0 (sqrt y))))))
(+
(/ 1.0 (+ (sqrt x) (sqrt (+ 1.0 x))))
(/ 1.0 (+ (sqrt (+ 1.0 y)) (sqrt y))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 3500000000.0) {
tmp = 1.0 + ((1.0 / (sqrt(z) + sqrt((1.0 + z)))) + (1.0 / (sqrt(y) + hypot(1.0, sqrt(y)))));
} else {
tmp = (1.0 / (sqrt(x) + sqrt((1.0 + x)))) + (1.0 / (sqrt((1.0 + 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 (y <= 3500000000.0) {
tmp = 1.0 + ((1.0 / (Math.sqrt(z) + Math.sqrt((1.0 + z)))) + (1.0 / (Math.sqrt(y) + Math.hypot(1.0, Math.sqrt(y)))));
} else {
tmp = (1.0 / (Math.sqrt(x) + Math.sqrt((1.0 + x)))) + (1.0 / (Math.sqrt((1.0 + y)) + Math.sqrt(y)));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if y <= 3500000000.0: tmp = 1.0 + ((1.0 / (math.sqrt(z) + math.sqrt((1.0 + z)))) + (1.0 / (math.sqrt(y) + math.hypot(1.0, math.sqrt(y))))) else: tmp = (1.0 / (math.sqrt(x) + math.sqrt((1.0 + x)))) + (1.0 / (math.sqrt((1.0 + y)) + math.sqrt(y))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (y <= 3500000000.0) tmp = Float64(1.0 + Float64(Float64(1.0 / Float64(sqrt(z) + sqrt(Float64(1.0 + z)))) + Float64(1.0 / Float64(sqrt(y) + hypot(1.0, sqrt(y)))))); else tmp = Float64(Float64(1.0 / Float64(sqrt(x) + sqrt(Float64(1.0 + x)))) + Float64(1.0 / Float64(sqrt(Float64(1.0 + y)) + sqrt(y)))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (y <= 3500000000.0)
tmp = 1.0 + ((1.0 / (sqrt(z) + sqrt((1.0 + z)))) + (1.0 / (sqrt(y) + hypot(1.0, sqrt(y)))));
else
tmp = (1.0 / (sqrt(x) + sqrt((1.0 + x)))) + (1.0 / (sqrt((1.0 + y)) + sqrt(y)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[y, 3500000000.0], N[(1.0 + N[(N[(1.0 / N[(N[Sqrt[z], $MachinePrecision] + N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[1.0 ^ 2 + N[Sqrt[y], $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 3500000000:\\
\;\;\;\;1 + \left(\frac{1}{\sqrt{z} + \sqrt{1 + z}} + \frac{1}{\sqrt{y} + \mathsf{hypot}\left(1, \sqrt{y}\right)}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{x} + \sqrt{1 + x}} + \frac{1}{\sqrt{1 + y} + \sqrt{y}}\\
\end{array}
\end{array}
if y < 3.5e9Initial program 98.0%
associate-+l+98.0%
+-commutative98.0%
associate-+r-62.6%
associate-+l-56.9%
+-commutative56.9%
+-commutative56.9%
associate--l+56.9%
Simplified40.5%
Taylor expanded in t around inf 34.2%
associate--l+35.3%
+-commutative35.3%
Simplified35.3%
flip--98.5%
add-sqr-sqrt98.6%
add-sqr-sqrt98.6%
Applied egg-rr35.4%
Taylor expanded in x around 0 32.9%
associate--l+45.0%
+-commutative45.0%
+-commutative45.0%
associate--l+58.9%
+-commutative58.9%
rem-square-sqrt58.9%
hypot-1-def58.9%
rem-square-sqrt58.9%
hypot-1-def58.9%
Simplified58.9%
flip--59.0%
hypot-udef59.0%
metadata-eval59.0%
add-sqr-sqrt59.0%
+-commutative59.0%
hypot-udef59.0%
metadata-eval59.0%
add-sqr-sqrt59.0%
+-commutative59.0%
add-sqr-sqrt46.8%
+-commutative46.8%
add-sqr-sqrt59.0%
hypot-udef59.0%
metadata-eval59.0%
add-sqr-sqrt59.0%
+-commutative59.0%
+-commutative59.0%
Applied egg-rr59.0%
associate--l+59.2%
+-inverses59.2%
metadata-eval59.2%
Simplified59.2%
if 3.5e9 < y Initial program 86.6%
associate-+l+86.6%
+-commutative86.6%
associate-+r-86.3%
associate-+l-54.2%
+-commutative54.2%
+-commutative54.2%
associate--l+54.2%
Simplified36.0%
Taylor expanded in t around inf 32.4%
associate--l+33.5%
+-commutative33.5%
Simplified33.5%
flip--89.8%
add-sqr-sqrt49.8%
add-sqr-sqrt90.2%
Applied egg-rr34.0%
Taylor expanded in z around inf 23.3%
+-commutative23.3%
+-commutative23.3%
associate--l+27.5%
+-commutative27.5%
Simplified27.5%
flip--22.9%
add-sqr-sqrt23.7%
add-sqr-sqrt23.3%
+-commutative23.3%
Applied egg-rr28.0%
associate--l+26.2%
+-inverses26.2%
metadata-eval26.2%
Simplified29.5%
Final simplification42.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 x))) (t_2 (sqrt (+ 1.0 y))))
(if (<= y 1.55e-20)
(+ 1.0 (+ t_2 (- (sqrt (+ 1.0 z)) (+ (sqrt y) (sqrt z)))))
(if (<= y 2e+62)
(+ (- t_1 (sqrt x)) (/ 1.0 (+ t_2 (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 + y));
double tmp;
if (y <= 1.55e-20) {
tmp = 1.0 + (t_2 + (sqrt((1.0 + z)) - (sqrt(y) + sqrt(z))));
} else if (y <= 2e+62) {
tmp = (t_1 - sqrt(x)) + (1.0 / (t_2 + sqrt(y)));
} else {
tmp = 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 + y))
if (y <= 1.55d-20) then
tmp = 1.0d0 + (t_2 + (sqrt((1.0d0 + z)) - (sqrt(y) + sqrt(z))))
else if (y <= 2d+62) then
tmp = (t_1 - sqrt(x)) + (1.0d0 / (t_2 + sqrt(y)))
else
tmp = 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 + y));
double tmp;
if (y <= 1.55e-20) {
tmp = 1.0 + (t_2 + (Math.sqrt((1.0 + z)) - (Math.sqrt(y) + Math.sqrt(z))));
} else if (y <= 2e+62) {
tmp = (t_1 - Math.sqrt(x)) + (1.0 / (t_2 + Math.sqrt(y)));
} else {
tmp = 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 + y)) tmp = 0 if y <= 1.55e-20: tmp = 1.0 + (t_2 + (math.sqrt((1.0 + z)) - (math.sqrt(y) + math.sqrt(z)))) elif y <= 2e+62: tmp = (t_1 - math.sqrt(x)) + (1.0 / (t_2 + math.sqrt(y))) else: tmp = 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 + y)) tmp = 0.0 if (y <= 1.55e-20) tmp = Float64(1.0 + Float64(t_2 + Float64(sqrt(Float64(1.0 + z)) - Float64(sqrt(y) + sqrt(z))))); elseif (y <= 2e+62) tmp = Float64(Float64(t_1 - sqrt(x)) + Float64(1.0 / Float64(t_2 + sqrt(y)))); else tmp = 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 + y));
tmp = 0.0;
if (y <= 1.55e-20)
tmp = 1.0 + (t_2 + (sqrt((1.0 + z)) - (sqrt(y) + sqrt(z))));
elseif (y <= 2e+62)
tmp = (t_1 - sqrt(x)) + (1.0 / (t_2 + sqrt(y)));
else
tmp = 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 + y), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y, 1.55e-20], N[(1.0 + N[(t$95$2 + N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2e+62], N[(N[(t$95$1 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(t$95$2 + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + x}\\
t_2 := \sqrt{1 + y}\\
\mathbf{if}\;y \leq 1.55 \cdot 10^{-20}:\\
\;\;\;\;1 + \left(t_2 + \left(\sqrt{1 + z} - \left(\sqrt{y} + \sqrt{z}\right)\right)\right)\\
\mathbf{elif}\;y \leq 2 \cdot 10^{+62}:\\
\;\;\;\;\left(t_1 - \sqrt{x}\right) + \frac{1}{t_2 + \sqrt{y}}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{x} + t_1}\\
\end{array}
\end{array}
if y < 1.55e-20Initial program 98.3%
associate-+l+98.3%
+-commutative98.3%
associate-+r-61.8%
associate-+l-55.9%
+-commutative55.9%
+-commutative55.9%
associate--l+55.9%
Simplified38.7%
Taylor expanded in t around inf 33.0%
associate--l+34.3%
+-commutative34.3%
Simplified34.3%
Taylor expanded in x around 0 34.2%
associate--l+46.3%
associate--l+57.5%
Simplified57.5%
if 1.55e-20 < y < 2.00000000000000007e62Initial program 87.3%
associate-+l+87.3%
+-commutative87.3%
associate-+r-79.9%
associate-+l-59.5%
+-commutative59.5%
+-commutative59.5%
associate--l+59.5%
Simplified43.6%
Taylor expanded in t around inf 38.1%
associate--l+37.7%
+-commutative37.7%
Simplified37.7%
flip--91.6%
add-sqr-sqrt69.0%
add-sqr-sqrt93.4%
Applied egg-rr39.9%
Taylor expanded in z around inf 31.9%
+-commutative31.9%
+-commutative31.9%
associate--l+39.8%
+-commutative39.8%
Simplified39.8%
if 2.00000000000000007e62 < y Initial program 87.1%
associate-+l+87.1%
+-commutative87.1%
associate-+r-87.1%
associate-+l-53.6%
+-commutative53.6%
+-commutative53.6%
associate--l+53.6%
Simplified35.5%
Taylor expanded in t around inf 31.7%
associate--l+33.2%
+-commutative33.2%
Simplified33.2%
Taylor expanded in z around inf 21.1%
+-commutative21.1%
Simplified21.1%
Taylor expanded in y around inf 21.8%
flip--21.9%
add-sqr-sqrt22.6%
add-sqr-sqrt22.4%
+-commutative22.4%
Applied egg-rr22.4%
associate--l+25.6%
+-inverses25.6%
metadata-eval25.6%
Simplified25.6%
Final simplification40.1%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(if (<= x 1.06e-13)
(+
1.0
(+ (/ 1.0 (+ (sqrt (+ 1.0 y)) (sqrt y))) (- (sqrt (+ 1.0 z)) (sqrt 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) {
double tmp;
if (x <= 1.06e-13) {
tmp = 1.0 + ((1.0 / (sqrt((1.0 + y)) + sqrt(y))) + (sqrt((1.0 + z)) - sqrt(z)));
} else {
tmp = 1.0 / (sqrt(x) + sqrt((1.0 + 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 (x <= 1.06d-13) then
tmp = 1.0d0 + ((1.0d0 / (sqrt((1.0d0 + y)) + sqrt(y))) + (sqrt((1.0d0 + z)) - sqrt(z)))
else
tmp = 1.0d0 / (sqrt(x) + sqrt((1.0d0 + 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 (x <= 1.06e-13) {
tmp = 1.0 + ((1.0 / (Math.sqrt((1.0 + y)) + Math.sqrt(y))) + (Math.sqrt((1.0 + z)) - Math.sqrt(z)));
} else {
tmp = 1.0 / (Math.sqrt(x) + Math.sqrt((1.0 + x)));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if x <= 1.06e-13: tmp = 1.0 + ((1.0 / (math.sqrt((1.0 + y)) + math.sqrt(y))) + (math.sqrt((1.0 + z)) - math.sqrt(z))) else: tmp = 1.0 / (math.sqrt(x) + math.sqrt((1.0 + x))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (x <= 1.06e-13) tmp = Float64(1.0 + Float64(Float64(1.0 / Float64(sqrt(Float64(1.0 + y)) + sqrt(y))) + Float64(sqrt(Float64(1.0 + z)) - sqrt(z)))); else tmp = Float64(1.0 / Float64(sqrt(x) + sqrt(Float64(1.0 + 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 (x <= 1.06e-13)
tmp = 1.0 + ((1.0 / (sqrt((1.0 + y)) + sqrt(y))) + (sqrt((1.0 + z)) - sqrt(z)));
else
tmp = 1.0 / (sqrt(x) + sqrt((1.0 + 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[x, 1.06e-13], N[(1.0 + N[(N[(1.0 / N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq 1.06 \cdot 10^{-13}:\\
\;\;\;\;1 + \left(\frac{1}{\sqrt{1 + y} + \sqrt{y}} + \left(\sqrt{1 + z} - \sqrt{z}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{x} + \sqrt{1 + x}}\\
\end{array}
\end{array}
if x < 1.06e-13Initial program 97.0%
associate-+l+97.0%
+-commutative97.0%
associate-+r-97.0%
associate-+l-97.0%
+-commutative97.0%
+-commutative97.0%
associate--l+97.0%
Simplified66.9%
Taylor expanded in t around inf 58.4%
associate--l+59.0%
+-commutative59.0%
Simplified59.0%
flip--97.4%
add-sqr-sqrt72.5%
add-sqr-sqrt97.9%
Applied egg-rr59.6%
Taylor expanded in x around 0 30.8%
associate--l+49.7%
+-commutative49.7%
+-commutative49.7%
associate--l+59.1%
+-commutative59.1%
Simplified59.1%
if 1.06e-13 < x Initial program 86.0%
associate-+l+86.0%
+-commutative86.0%
associate-+r-55.2%
associate-+l-13.7%
+-commutative13.7%
+-commutative13.7%
associate--l+13.7%
Simplified9.0%
Taylor expanded in t around inf 7.9%
associate--l+9.6%
+-commutative9.6%
Simplified9.6%
Taylor expanded in z around inf 6.3%
+-commutative6.3%
Simplified6.3%
Taylor expanded in y around inf 6.0%
flip--6.1%
add-sqr-sqrt7.2%
add-sqr-sqrt6.6%
+-commutative6.6%
Applied egg-rr6.6%
associate--l+11.1%
+-inverses11.1%
metadata-eval11.1%
Simplified11.1%
Final simplification35.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 y))))
(if (<= z 3.6e+21)
(- (+ (sqrt (+ 1.0 z)) (+ 1.0 (- t_1 (sqrt y)))) (sqrt z))
(+ (/ 1.0 (+ (sqrt x) (sqrt (+ 1.0 x)))) (/ 1.0 (+ t_1 (sqrt y)))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + y));
double tmp;
if (z <= 3.6e+21) {
tmp = (sqrt((1.0 + z)) + (1.0 + (t_1 - sqrt(y)))) - sqrt(z);
} else {
tmp = (1.0 / (sqrt(x) + sqrt((1.0 + x)))) + (1.0 / (t_1 + sqrt(y)));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = sqrt((1.0d0 + y))
if (z <= 3.6d+21) then
tmp = (sqrt((1.0d0 + z)) + (1.0d0 + (t_1 - sqrt(y)))) - sqrt(z)
else
tmp = (1.0d0 / (sqrt(x) + sqrt((1.0d0 + x)))) + (1.0d0 / (t_1 + sqrt(y)))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + y));
double tmp;
if (z <= 3.6e+21) {
tmp = (Math.sqrt((1.0 + z)) + (1.0 + (t_1 - Math.sqrt(y)))) - Math.sqrt(z);
} else {
tmp = (1.0 / (Math.sqrt(x) + Math.sqrt((1.0 + x)))) + (1.0 / (t_1 + Math.sqrt(y)));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + y)) tmp = 0 if z <= 3.6e+21: tmp = (math.sqrt((1.0 + z)) + (1.0 + (t_1 - math.sqrt(y)))) - math.sqrt(z) else: tmp = (1.0 / (math.sqrt(x) + math.sqrt((1.0 + x)))) + (1.0 / (t_1 + math.sqrt(y))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(1.0 + y)) tmp = 0.0 if (z <= 3.6e+21) tmp = Float64(Float64(sqrt(Float64(1.0 + z)) + Float64(1.0 + Float64(t_1 - sqrt(y)))) - sqrt(z)); else tmp = Float64(Float64(1.0 / Float64(sqrt(x) + sqrt(Float64(1.0 + x)))) + Float64(1.0 / Float64(t_1 + sqrt(y)))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + y));
tmp = 0.0;
if (z <= 3.6e+21)
tmp = (sqrt((1.0 + z)) + (1.0 + (t_1 - sqrt(y)))) - sqrt(z);
else
tmp = (1.0 / (sqrt(x) + sqrt((1.0 + x)))) + (1.0 / (t_1 + sqrt(y)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[z, 3.6e+21], N[(N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] + N[(1.0 + N[(t$95$1 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(t$95$1 + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + y}\\
\mathbf{if}\;z \leq 3.6 \cdot 10^{+21}:\\
\;\;\;\;\left(\sqrt{1 + z} + \left(1 + \left(t_1 - \sqrt{y}\right)\right)\right) - \sqrt{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{x} + \sqrt{1 + x}} + \frac{1}{t_1 + \sqrt{y}}\\
\end{array}
\end{array}
if z < 3.6e21Initial program 97.4%
associate-+l+97.4%
+-commutative97.4%
associate-+r-80.1%
associate-+l-51.9%
+-commutative51.9%
+-commutative51.9%
associate--l+51.9%
Simplified34.9%
Taylor expanded in t around inf 31.3%
associate--l+31.3%
+-commutative31.3%
Simplified31.3%
Taylor expanded in x around 0 29.5%
associate--r+28.9%
associate-+r+28.9%
associate--l+28.9%
Simplified28.9%
associate-+r-28.9%
Applied egg-rr28.9%
+-commutative28.9%
associate--l+49.4%
associate--l+54.2%
Simplified54.2%
if 3.6e21 < z Initial program 84.8%
associate-+l+84.8%
+-commutative84.8%
associate-+r-71.6%
associate-+l-59.3%
+-commutative59.3%
+-commutative59.3%
associate--l+59.3%
Simplified41.4%
Taylor expanded in t around inf 35.3%
associate--l+37.7%
+-commutative37.7%
Simplified37.7%
flip--88.3%
add-sqr-sqrt68.5%
add-sqr-sqrt88.4%
Applied egg-rr37.9%
Taylor expanded in z around inf 38.0%
+-commutative38.0%
+-commutative38.0%
associate--l+49.2%
+-commutative49.2%
Simplified49.2%
flip--26.4%
add-sqr-sqrt26.9%
add-sqr-sqrt26.9%
+-commutative26.9%
Applied egg-rr49.8%
associate--l+29.8%
+-inverses29.8%
metadata-eval29.8%
Simplified51.3%
Final simplification52.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 y))))
(if (<= y 4.3e-19)
(+ 1.0 (+ t_1 (- (sqrt (+ 1.0 z)) (+ (sqrt y) (sqrt z)))))
(if (<= y 1.15e+26)
(+ 1.0 (/ 1.0 (+ t_1 (sqrt y))))
(/ 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) {
double t_1 = sqrt((1.0 + y));
double tmp;
if (y <= 4.3e-19) {
tmp = 1.0 + (t_1 + (sqrt((1.0 + z)) - (sqrt(y) + sqrt(z))));
} else if (y <= 1.15e+26) {
tmp = 1.0 + (1.0 / (t_1 + sqrt(y)));
} else {
tmp = 1.0 / (sqrt(x) + sqrt((1.0 + 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 + y))
if (y <= 4.3d-19) then
tmp = 1.0d0 + (t_1 + (sqrt((1.0d0 + z)) - (sqrt(y) + sqrt(z))))
else if (y <= 1.15d+26) then
tmp = 1.0d0 + (1.0d0 / (t_1 + sqrt(y)))
else
tmp = 1.0d0 / (sqrt(x) + sqrt((1.0d0 + x)))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + y));
double tmp;
if (y <= 4.3e-19) {
tmp = 1.0 + (t_1 + (Math.sqrt((1.0 + z)) - (Math.sqrt(y) + Math.sqrt(z))));
} else if (y <= 1.15e+26) {
tmp = 1.0 + (1.0 / (t_1 + Math.sqrt(y)));
} else {
tmp = 1.0 / (Math.sqrt(x) + Math.sqrt((1.0 + x)));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + y)) tmp = 0 if y <= 4.3e-19: tmp = 1.0 + (t_1 + (math.sqrt((1.0 + z)) - (math.sqrt(y) + math.sqrt(z)))) elif y <= 1.15e+26: tmp = 1.0 + (1.0 / (t_1 + math.sqrt(y))) else: tmp = 1.0 / (math.sqrt(x) + math.sqrt((1.0 + x))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(1.0 + y)) tmp = 0.0 if (y <= 4.3e-19) tmp = Float64(1.0 + Float64(t_1 + Float64(sqrt(Float64(1.0 + z)) - Float64(sqrt(y) + sqrt(z))))); elseif (y <= 1.15e+26) tmp = Float64(1.0 + Float64(1.0 / Float64(t_1 + sqrt(y)))); else tmp = Float64(1.0 / Float64(sqrt(x) + sqrt(Float64(1.0 + x)))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + y));
tmp = 0.0;
if (y <= 4.3e-19)
tmp = 1.0 + (t_1 + (sqrt((1.0 + z)) - (sqrt(y) + sqrt(z))));
elseif (y <= 1.15e+26)
tmp = 1.0 + (1.0 / (t_1 + sqrt(y)));
else
tmp = 1.0 / (sqrt(x) + sqrt((1.0 + x)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y, 4.3e-19], N[(1.0 + N[(t$95$1 + N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.15e+26], N[(1.0 + N[(1.0 / N[(t$95$1 + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[N[(1.0 + 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 + y}\\
\mathbf{if}\;y \leq 4.3 \cdot 10^{-19}:\\
\;\;\;\;1 + \left(t_1 + \left(\sqrt{1 + z} - \left(\sqrt{y} + \sqrt{z}\right)\right)\right)\\
\mathbf{elif}\;y \leq 1.15 \cdot 10^{+26}:\\
\;\;\;\;1 + \frac{1}{t_1 + \sqrt{y}}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{x} + \sqrt{1 + x}}\\
\end{array}
\end{array}
if y < 4.3e-19Initial program 98.3%
associate-+l+98.3%
+-commutative98.3%
associate-+r-61.8%
associate-+l-55.9%
+-commutative55.9%
+-commutative55.9%
associate--l+55.9%
Simplified38.7%
Taylor expanded in t around inf 33.0%
associate--l+34.3%
+-commutative34.3%
Simplified34.3%
Taylor expanded in x around 0 34.2%
associate--l+46.3%
associate--l+57.5%
Simplified57.5%
if 4.3e-19 < y < 1.15e26Initial program 85.7%
associate-+l+85.7%
+-commutative85.7%
associate-+r-70.9%
associate-+l-60.7%
+-commutative60.7%
+-commutative60.7%
associate--l+60.7%
Simplified38.9%
Taylor expanded in t around inf 46.3%
associate--l+45.8%
+-commutative45.8%
Simplified45.8%
flip--94.0%
add-sqr-sqrt85.4%
add-sqr-sqrt97.6%
Applied egg-rr50.1%
Taylor expanded in z around inf 34.8%
+-commutative34.8%
+-commutative34.8%
associate--l+38.6%
+-commutative38.6%
Simplified38.6%
Taylor expanded in x around 0 58.8%
if 1.15e26 < y Initial program 87.4%
associate-+l+87.4%
+-commutative87.4%
associate-+r-87.4%
associate-+l-54.3%
+-commutative54.3%
+-commutative54.3%
associate--l+54.3%
Simplified37.3%
Taylor expanded in t around inf 31.4%
associate--l+32.7%
+-commutative32.7%
Simplified32.7%
Taylor expanded in z around inf 22.2%
+-commutative22.2%
Simplified22.2%
Taylor expanded in y around inf 22.8%
flip--22.9%
add-sqr-sqrt23.5%
add-sqr-sqrt23.3%
+-commutative23.3%
Applied egg-rr23.3%
associate--l+26.2%
+-inverses26.2%
metadata-eval26.2%
Simplified26.2%
Final simplification40.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.6e+21)
(- (+ (+ 1.0 (+ 1.0 (* y 0.5))) (- (sqrt (+ 1.0 z)) (sqrt y))) (sqrt z))
(if (or (<= z 8.5e+244) (not (<= z 1.65e+280)))
(+ 1.0 (/ 1.0 (+ (sqrt (+ 1.0 y)) (sqrt y))))
(/ 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) {
double tmp;
if (z <= 3.6e+21) {
tmp = ((1.0 + (1.0 + (y * 0.5))) + (sqrt((1.0 + z)) - sqrt(y))) - sqrt(z);
} else if ((z <= 8.5e+244) || !(z <= 1.65e+280)) {
tmp = 1.0 + (1.0 / (sqrt((1.0 + y)) + sqrt(y)));
} else {
tmp = 1.0 / (sqrt(x) + sqrt((1.0 + 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 <= 3.6d+21) then
tmp = ((1.0d0 + (1.0d0 + (y * 0.5d0))) + (sqrt((1.0d0 + z)) - sqrt(y))) - sqrt(z)
else if ((z <= 8.5d+244) .or. (.not. (z <= 1.65d+280))) then
tmp = 1.0d0 + (1.0d0 / (sqrt((1.0d0 + y)) + sqrt(y)))
else
tmp = 1.0d0 / (sqrt(x) + sqrt((1.0d0 + 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 <= 3.6e+21) {
tmp = ((1.0 + (1.0 + (y * 0.5))) + (Math.sqrt((1.0 + z)) - Math.sqrt(y))) - Math.sqrt(z);
} else if ((z <= 8.5e+244) || !(z <= 1.65e+280)) {
tmp = 1.0 + (1.0 / (Math.sqrt((1.0 + y)) + Math.sqrt(y)));
} else {
tmp = 1.0 / (Math.sqrt(x) + Math.sqrt((1.0 + x)));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if z <= 3.6e+21: tmp = ((1.0 + (1.0 + (y * 0.5))) + (math.sqrt((1.0 + z)) - math.sqrt(y))) - math.sqrt(z) elif (z <= 8.5e+244) or not (z <= 1.65e+280): tmp = 1.0 + (1.0 / (math.sqrt((1.0 + y)) + math.sqrt(y))) else: tmp = 1.0 / (math.sqrt(x) + math.sqrt((1.0 + x))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (z <= 3.6e+21) tmp = Float64(Float64(Float64(1.0 + Float64(1.0 + Float64(y * 0.5))) + Float64(sqrt(Float64(1.0 + z)) - sqrt(y))) - sqrt(z)); elseif ((z <= 8.5e+244) || !(z <= 1.65e+280)) tmp = Float64(1.0 + Float64(1.0 / Float64(sqrt(Float64(1.0 + y)) + sqrt(y)))); else tmp = Float64(1.0 / Float64(sqrt(x) + sqrt(Float64(1.0 + 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 <= 3.6e+21)
tmp = ((1.0 + (1.0 + (y * 0.5))) + (sqrt((1.0 + z)) - sqrt(y))) - sqrt(z);
elseif ((z <= 8.5e+244) || ~((z <= 1.65e+280)))
tmp = 1.0 + (1.0 / (sqrt((1.0 + y)) + sqrt(y)));
else
tmp = 1.0 / (sqrt(x) + sqrt((1.0 + 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, 3.6e+21], N[(N[(N[(1.0 + N[(1.0 + N[(y * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[z, 8.5e+244], N[Not[LessEqual[z, 1.65e+280]], $MachinePrecision]], N[(1.0 + N[(1.0 / N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq 3.6 \cdot 10^{+21}:\\
\;\;\;\;\left(\left(1 + \left(1 + y \cdot 0.5\right)\right) + \left(\sqrt{1 + z} - \sqrt{y}\right)\right) - \sqrt{z}\\
\mathbf{elif}\;z \leq 8.5 \cdot 10^{+244} \lor \neg \left(z \leq 1.65 \cdot 10^{+280}\right):\\
\;\;\;\;1 + \frac{1}{\sqrt{1 + y} + \sqrt{y}}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{x} + \sqrt{1 + x}}\\
\end{array}
\end{array}
if z < 3.6e21Initial program 97.4%
associate-+l+97.4%
+-commutative97.4%
associate-+r-80.1%
associate-+l-51.9%
+-commutative51.9%
+-commutative51.9%
associate--l+51.9%
Simplified34.9%
Taylor expanded in t around inf 31.3%
associate--l+31.3%
+-commutative31.3%
Simplified31.3%
Taylor expanded in x around 0 29.5%
associate--r+28.9%
associate-+r+28.9%
associate--l+28.9%
Simplified28.9%
Taylor expanded in y around 0 28.1%
*-commutative28.1%
Simplified28.1%
if 3.6e21 < z < 8.49999999999999995e244 or 1.65000000000000001e280 < z Initial program 83.7%
associate-+l+83.7%
+-commutative83.7%
associate-+r-70.6%
associate-+l-60.3%
+-commutative60.3%
+-commutative60.3%
associate--l+60.3%
Simplified44.4%
Taylor expanded in t around inf 34.3%
associate--l+37.3%
+-commutative37.3%
Simplified37.3%
flip--87.7%
add-sqr-sqrt68.9%
add-sqr-sqrt87.8%
Applied egg-rr37.5%
Taylor expanded in z around inf 37.6%
+-commutative37.6%
+-commutative37.6%
associate--l+48.3%
+-commutative48.3%
Simplified48.3%
Taylor expanded in x around 0 57.0%
if 8.49999999999999995e244 < z < 1.65000000000000001e280Initial program 92.8%
associate-+l+92.8%
+-commutative92.8%
associate-+r-79.0%
associate-+l-51.4%
+-commutative51.4%
+-commutative51.4%
associate--l+51.4%
Simplified19.2%
Taylor expanded in t around inf 42.6%
associate--l+41.0%
+-commutative41.0%
Simplified41.0%
Taylor expanded in z around inf 41.6%
+-commutative41.6%
Simplified41.6%
Taylor expanded in y around inf 34.2%
flip--34.2%
add-sqr-sqrt34.3%
add-sqr-sqrt34.2%
+-commutative34.2%
Applied egg-rr34.2%
associate--l+36.0%
+-inverses36.0%
metadata-eval36.0%
Simplified36.0%
Final simplification40.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 3.6e+21)
(- (+ (sqrt (+ 1.0 z)) 2.0) (sqrt z))
(if (or (<= z 8.5e+244) (not (<= z 1.65e+280)))
(+ 1.0 (/ 1.0 (+ (sqrt (+ 1.0 y)) (sqrt y))))
(/ 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) {
double tmp;
if (z <= 3.6e+21) {
tmp = (sqrt((1.0 + z)) + 2.0) - sqrt(z);
} else if ((z <= 8.5e+244) || !(z <= 1.65e+280)) {
tmp = 1.0 + (1.0 / (sqrt((1.0 + y)) + sqrt(y)));
} else {
tmp = 1.0 / (sqrt(x) + sqrt((1.0 + 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 <= 3.6d+21) then
tmp = (sqrt((1.0d0 + z)) + 2.0d0) - sqrt(z)
else if ((z <= 8.5d+244) .or. (.not. (z <= 1.65d+280))) then
tmp = 1.0d0 + (1.0d0 / (sqrt((1.0d0 + y)) + sqrt(y)))
else
tmp = 1.0d0 / (sqrt(x) + sqrt((1.0d0 + 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 <= 3.6e+21) {
tmp = (Math.sqrt((1.0 + z)) + 2.0) - Math.sqrt(z);
} else if ((z <= 8.5e+244) || !(z <= 1.65e+280)) {
tmp = 1.0 + (1.0 / (Math.sqrt((1.0 + y)) + Math.sqrt(y)));
} else {
tmp = 1.0 / (Math.sqrt(x) + Math.sqrt((1.0 + x)));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if z <= 3.6e+21: tmp = (math.sqrt((1.0 + z)) + 2.0) - math.sqrt(z) elif (z <= 8.5e+244) or not (z <= 1.65e+280): tmp = 1.0 + (1.0 / (math.sqrt((1.0 + y)) + math.sqrt(y))) else: tmp = 1.0 / (math.sqrt(x) + math.sqrt((1.0 + x))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (z <= 3.6e+21) tmp = Float64(Float64(sqrt(Float64(1.0 + z)) + 2.0) - sqrt(z)); elseif ((z <= 8.5e+244) || !(z <= 1.65e+280)) tmp = Float64(1.0 + Float64(1.0 / Float64(sqrt(Float64(1.0 + y)) + sqrt(y)))); else tmp = Float64(1.0 / Float64(sqrt(x) + sqrt(Float64(1.0 + 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 <= 3.6e+21)
tmp = (sqrt((1.0 + z)) + 2.0) - sqrt(z);
elseif ((z <= 8.5e+244) || ~((z <= 1.65e+280)))
tmp = 1.0 + (1.0 / (sqrt((1.0 + y)) + sqrt(y)));
else
tmp = 1.0 / (sqrt(x) + sqrt((1.0 + 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, 3.6e+21], N[(N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] + 2.0), $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[z, 8.5e+244], N[Not[LessEqual[z, 1.65e+280]], $MachinePrecision]], N[(1.0 + N[(1.0 / N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq 3.6 \cdot 10^{+21}:\\
\;\;\;\;\left(\sqrt{1 + z} + 2\right) - \sqrt{z}\\
\mathbf{elif}\;z \leq 8.5 \cdot 10^{+244} \lor \neg \left(z \leq 1.65 \cdot 10^{+280}\right):\\
\;\;\;\;1 + \frac{1}{\sqrt{1 + y} + \sqrt{y}}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{x} + \sqrt{1 + x}}\\
\end{array}
\end{array}
if z < 3.6e21Initial program 97.4%
associate-+l+97.4%
+-commutative97.4%
associate-+r-80.1%
associate-+l-51.9%
+-commutative51.9%
+-commutative51.9%
associate--l+51.9%
Simplified34.9%
Taylor expanded in t around inf 31.3%
associate--l+31.3%
+-commutative31.3%
Simplified31.3%
Taylor expanded in x around 0 29.5%
associate--r+28.9%
associate-+r+28.9%
associate--l+28.9%
Simplified28.9%
Taylor expanded in y around 0 44.3%
+-commutative44.3%
Simplified44.3%
if 3.6e21 < z < 8.49999999999999995e244 or 1.65000000000000001e280 < z Initial program 83.7%
associate-+l+83.7%
+-commutative83.7%
associate-+r-70.6%
associate-+l-60.3%
+-commutative60.3%
+-commutative60.3%
associate--l+60.3%
Simplified44.4%
Taylor expanded in t around inf 34.3%
associate--l+37.3%
+-commutative37.3%
Simplified37.3%
flip--87.7%
add-sqr-sqrt68.9%
add-sqr-sqrt87.8%
Applied egg-rr37.5%
Taylor expanded in z around inf 37.6%
+-commutative37.6%
+-commutative37.6%
associate--l+48.3%
+-commutative48.3%
Simplified48.3%
Taylor expanded in x around 0 57.0%
if 8.49999999999999995e244 < z < 1.65000000000000001e280Initial program 92.8%
associate-+l+92.8%
+-commutative92.8%
associate-+r-79.0%
associate-+l-51.4%
+-commutative51.4%
+-commutative51.4%
associate--l+51.4%
Simplified19.2%
Taylor expanded in t around inf 42.6%
associate--l+41.0%
+-commutative41.0%
Simplified41.0%
Taylor expanded in z around inf 41.6%
+-commutative41.6%
Simplified41.6%
Taylor expanded in y around inf 34.2%
flip--34.2%
add-sqr-sqrt34.3%
add-sqr-sqrt34.2%
+-commutative34.2%
Applied egg-rr34.2%
associate--l+36.0%
+-inverses36.0%
metadata-eval36.0%
Simplified36.0%
Final simplification49.1%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(if (<= z 3.6e+21)
(- (+ (sqrt (+ 1.0 z)) 2.0) (sqrt z))
(if (<= z 8.5e+244)
(+ 1.0 (- (sqrt (+ 1.0 y)) (sqrt y)))
(/ 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) {
double tmp;
if (z <= 3.6e+21) {
tmp = (sqrt((1.0 + z)) + 2.0) - sqrt(z);
} else if (z <= 8.5e+244) {
tmp = 1.0 + (sqrt((1.0 + y)) - sqrt(y));
} else {
tmp = 1.0 / (sqrt(x) + sqrt((1.0 + 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 <= 3.6d+21) then
tmp = (sqrt((1.0d0 + z)) + 2.0d0) - sqrt(z)
else if (z <= 8.5d+244) then
tmp = 1.0d0 + (sqrt((1.0d0 + y)) - sqrt(y))
else
tmp = 1.0d0 / (sqrt(x) + sqrt((1.0d0 + 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 <= 3.6e+21) {
tmp = (Math.sqrt((1.0 + z)) + 2.0) - Math.sqrt(z);
} else if (z <= 8.5e+244) {
tmp = 1.0 + (Math.sqrt((1.0 + y)) - Math.sqrt(y));
} else {
tmp = 1.0 / (Math.sqrt(x) + Math.sqrt((1.0 + x)));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if z <= 3.6e+21: tmp = (math.sqrt((1.0 + z)) + 2.0) - math.sqrt(z) elif z <= 8.5e+244: tmp = 1.0 + (math.sqrt((1.0 + y)) - math.sqrt(y)) else: tmp = 1.0 / (math.sqrt(x) + math.sqrt((1.0 + x))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (z <= 3.6e+21) tmp = Float64(Float64(sqrt(Float64(1.0 + z)) + 2.0) - sqrt(z)); elseif (z <= 8.5e+244) tmp = Float64(1.0 + Float64(sqrt(Float64(1.0 + y)) - sqrt(y))); else tmp = Float64(1.0 / Float64(sqrt(x) + sqrt(Float64(1.0 + 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 <= 3.6e+21)
tmp = (sqrt((1.0 + z)) + 2.0) - sqrt(z);
elseif (z <= 8.5e+244)
tmp = 1.0 + (sqrt((1.0 + y)) - sqrt(y));
else
tmp = 1.0 / (sqrt(x) + sqrt((1.0 + 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, 3.6e+21], N[(N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] + 2.0), $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 8.5e+244], 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] + N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq 3.6 \cdot 10^{+21}:\\
\;\;\;\;\left(\sqrt{1 + z} + 2\right) - \sqrt{z}\\
\mathbf{elif}\;z \leq 8.5 \cdot 10^{+244}:\\
\;\;\;\;1 + \left(\sqrt{1 + y} - \sqrt{y}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{x} + \sqrt{1 + x}}\\
\end{array}
\end{array}
if z < 3.6e21Initial program 97.4%
associate-+l+97.4%
+-commutative97.4%
associate-+r-80.1%
associate-+l-51.9%
+-commutative51.9%
+-commutative51.9%
associate--l+51.9%
Simplified34.9%
Taylor expanded in t around inf 31.3%
associate--l+31.3%
+-commutative31.3%
Simplified31.3%
Taylor expanded in x around 0 29.5%
associate--r+28.9%
associate-+r+28.9%
associate--l+28.9%
Simplified28.9%
Taylor expanded in y around 0 44.3%
+-commutative44.3%
Simplified44.3%
if 3.6e21 < z < 8.49999999999999995e244Initial program 83.2%
associate-+l+83.2%
+-commutative83.2%
associate-+r-68.8%
associate-+l-58.0%
+-commutative58.0%
+-commutative58.0%
associate--l+58.1%
Simplified45.1%
Taylor expanded in t around inf 33.7%
associate--l+35.4%
+-commutative35.4%
Simplified35.4%
Taylor expanded in z around inf 35.0%
+-commutative35.0%
Simplified35.0%
Taylor expanded in x around 0 32.8%
associate--l+56.7%
Simplified56.7%
if 8.49999999999999995e244 < z Initial program 89.8%
associate-+l+89.8%
+-commutative89.8%
associate-+r-80.3%
associate-+l-63.1%
+-commutative63.1%
+-commutative63.1%
associate--l+63.1%
Simplified29.9%
Taylor expanded in t around inf 40.2%
associate--l+44.9%
+-commutative44.9%
Simplified44.9%
Taylor expanded in z around inf 40.8%
+-commutative40.8%
Simplified40.8%
Taylor expanded in y around inf 36.6%
flip--37.3%
add-sqr-sqrt36.6%
add-sqr-sqrt37.3%
+-commutative37.3%
Applied egg-rr37.3%
associate--l+38.8%
+-inverses38.8%
metadata-eval38.8%
Simplified38.8%
Final simplification48.1%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= z 3.6e+21) (- (+ (sqrt (+ 1.0 z)) 2.0) (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 <= 3.6e+21) {
tmp = (sqrt((1.0 + z)) + 2.0) - 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 <= 3.6d+21) then
tmp = (sqrt((1.0d0 + z)) + 2.0d0) - 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 <= 3.6e+21) {
tmp = (Math.sqrt((1.0 + z)) + 2.0) - 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 <= 3.6e+21: tmp = (math.sqrt((1.0 + z)) + 2.0) - 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 <= 3.6e+21) tmp = Float64(Float64(sqrt(Float64(1.0 + z)) + 2.0) - 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 <= 3.6e+21)
tmp = (sqrt((1.0 + z)) + 2.0) - 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, 3.6e+21], 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[(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.6 \cdot 10^{+21}:\\
\;\;\;\;\left(\sqrt{1 + z} + 2\right) - \sqrt{z}\\
\mathbf{else}:\\
\;\;\;\;1 + \left(\sqrt{1 + y} - \sqrt{y}\right)\\
\end{array}
\end{array}
if z < 3.6e21Initial program 97.4%
associate-+l+97.4%
+-commutative97.4%
associate-+r-80.1%
associate-+l-51.9%
+-commutative51.9%
+-commutative51.9%
associate--l+51.9%
Simplified34.9%
Taylor expanded in t around inf 31.3%
associate--l+31.3%
+-commutative31.3%
Simplified31.3%
Taylor expanded in x around 0 29.5%
associate--r+28.9%
associate-+r+28.9%
associate--l+28.9%
Simplified28.9%
Taylor expanded in y around 0 44.3%
+-commutative44.3%
Simplified44.3%
if 3.6e21 < z Initial program 84.8%
associate-+l+84.8%
+-commutative84.8%
associate-+r-71.6%
associate-+l-59.3%
+-commutative59.3%
+-commutative59.3%
associate--l+59.3%
Simplified41.4%
Taylor expanded in t around inf 35.3%
associate--l+37.7%
+-commutative37.7%
Simplified37.7%
Taylor expanded in z around inf 36.4%
+-commutative36.4%
Simplified36.4%
Taylor expanded in x around 0 29.9%
associate--l+57.6%
Simplified57.6%
Final simplification50.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 (- (sqrt (+ 1.0 y)) (sqrt y))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
return 1.0 + (sqrt((1.0 + y)) - sqrt(y));
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = 1.0d0 + (sqrt((1.0d0 + y)) - sqrt(y))
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
return 1.0 + (Math.sqrt((1.0 + y)) - Math.sqrt(y));
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): return 1.0 + (math.sqrt((1.0 + y)) - math.sqrt(y))
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) return Float64(1.0 + Float64(sqrt(Float64(1.0 + y)) - sqrt(y))) end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp = code(x, y, z, t)
tmp = 1.0 + (sqrt((1.0 + y)) - sqrt(y));
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := N[(1.0 + N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
1 + \left(\sqrt{1 + y} - \sqrt{y}\right)
\end{array}
Initial program 91.5%
associate-+l+91.5%
+-commutative91.5%
associate-+r-76.1%
associate-+l-55.4%
+-commutative55.4%
+-commutative55.4%
associate--l+55.4%
Simplified38.0%
Taylor expanded in t around inf 33.1%
associate--l+34.3%
+-commutative34.3%
Simplified34.3%
Taylor expanded in z around inf 23.5%
+-commutative23.5%
Simplified23.5%
Taylor expanded in x around 0 24.9%
associate--l+48.3%
Simplified48.3%
Final simplification48.3%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (- (sqrt (+ 1.0 x)) (sqrt x)))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
return sqrt((1.0 + x)) - sqrt(x);
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = sqrt((1.0d0 + x)) - sqrt(x)
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
return Math.sqrt((1.0 + x)) - Math.sqrt(x);
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): return math.sqrt((1.0 + x)) - math.sqrt(x)
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) return Float64(sqrt(Float64(1.0 + x)) - sqrt(x)) end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp = code(x, y, z, t)
tmp = sqrt((1.0 + x)) - sqrt(x);
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := N[(N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\sqrt{1 + x} - \sqrt{x}
\end{array}
Initial program 91.5%
associate-+l+91.5%
+-commutative91.5%
associate-+r-76.1%
associate-+l-55.4%
+-commutative55.4%
+-commutative55.4%
associate--l+55.4%
Simplified38.0%
Taylor expanded in t around inf 33.1%
associate--l+34.3%
+-commutative34.3%
Simplified34.3%
Taylor expanded in z around inf 23.5%
+-commutative23.5%
Simplified23.5%
Taylor expanded in y around inf 17.9%
Final simplification17.9%
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 (* x 0.5)) (sqrt x)))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
return (1.0 + (x * 0.5)) - sqrt(x);
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (1.0d0 + (x * 0.5d0)) - sqrt(x)
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
return (1.0 + (x * 0.5)) - Math.sqrt(x);
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): return (1.0 + (x * 0.5)) - math.sqrt(x)
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) return Float64(Float64(1.0 + Float64(x * 0.5)) - sqrt(x)) end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp = code(x, y, z, t)
tmp = (1.0 + (x * 0.5)) - sqrt(x);
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := N[(N[(1.0 + N[(x * 0.5), $MachinePrecision]), $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\left(1 + x \cdot 0.5\right) - \sqrt{x}
\end{array}
Initial program 91.5%
associate-+l+91.5%
+-commutative91.5%
associate-+r-76.1%
associate-+l-55.4%
+-commutative55.4%
+-commutative55.4%
associate--l+55.4%
Simplified38.0%
Taylor expanded in t around inf 33.1%
associate--l+34.3%
+-commutative34.3%
Simplified34.3%
Taylor expanded in z around inf 23.5%
+-commutative23.5%
Simplified23.5%
Taylor expanded in y around inf 17.9%
Taylor expanded in x around 0 18.2%
*-commutative18.2%
Simplified18.2%
Final simplification18.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 91.5%
associate-+l+91.5%
+-commutative91.5%
associate-+r-76.1%
associate-+l-55.4%
+-commutative55.4%
+-commutative55.4%
associate--l+55.4%
Simplified38.0%
Taylor expanded in t around inf 33.1%
associate--l+34.3%
+-commutative34.3%
Simplified34.3%
Taylor expanded in z around inf 23.5%
+-commutative23.5%
Simplified23.5%
Taylor expanded in y around inf 17.9%
Taylor expanded in x around 0 37.1%
Final simplification37.1%
(FPCore (x y z t)
:precision binary64
(+
(+
(+
(/ 1.0 (+ (sqrt (+ x 1.0)) (sqrt x)))
(/ 1.0 (+ (sqrt (+ y 1.0)) (sqrt y))))
(/ 1.0 (+ (sqrt (+ z 1.0)) (sqrt z))))
(- (sqrt (+ t 1.0)) (sqrt t))))
double code(double x, double y, double z, double t) {
return (((1.0 / (sqrt((x + 1.0)) + sqrt(x))) + (1.0 / (sqrt((y + 1.0)) + sqrt(y)))) + (1.0 / (sqrt((z + 1.0)) + sqrt(z)))) + (sqrt((t + 1.0)) - sqrt(t));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (((1.0d0 / (sqrt((x + 1.0d0)) + sqrt(x))) + (1.0d0 / (sqrt((y + 1.0d0)) + sqrt(y)))) + (1.0d0 / (sqrt((z + 1.0d0)) + sqrt(z)))) + (sqrt((t + 1.0d0)) - sqrt(t))
end function
public static double code(double x, double y, double z, double t) {
return (((1.0 / (Math.sqrt((x + 1.0)) + Math.sqrt(x))) + (1.0 / (Math.sqrt((y + 1.0)) + Math.sqrt(y)))) + (1.0 / (Math.sqrt((z + 1.0)) + Math.sqrt(z)))) + (Math.sqrt((t + 1.0)) - Math.sqrt(t));
}
def code(x, y, z, t): return (((1.0 / (math.sqrt((x + 1.0)) + math.sqrt(x))) + (1.0 / (math.sqrt((y + 1.0)) + math.sqrt(y)))) + (1.0 / (math.sqrt((z + 1.0)) + math.sqrt(z)))) + (math.sqrt((t + 1.0)) - math.sqrt(t))
function code(x, y, z, t) return Float64(Float64(Float64(Float64(1.0 / Float64(sqrt(Float64(x + 1.0)) + sqrt(x))) + Float64(1.0 / Float64(sqrt(Float64(y + 1.0)) + sqrt(y)))) + Float64(1.0 / Float64(sqrt(Float64(z + 1.0)) + sqrt(z)))) + Float64(sqrt(Float64(t + 1.0)) - sqrt(t))) end
function tmp = code(x, y, z, t) tmp = (((1.0 / (sqrt((x + 1.0)) + sqrt(x))) + (1.0 / (sqrt((y + 1.0)) + sqrt(y)))) + (1.0 / (sqrt((z + 1.0)) + sqrt(z)))) + (sqrt((t + 1.0)) - sqrt(t)); end
code[x_, y_, z_, t_] := N[(N[(N[(N[(1.0 / N[(N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[N[(z + 1.0), $MachinePrecision]], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(t + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\frac{1}{\sqrt{x + 1} + \sqrt{x}} + \frac{1}{\sqrt{y + 1} + \sqrt{y}}\right) + \frac{1}{\sqrt{z + 1} + \sqrt{z}}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)
\end{array}
herbie shell --seed 2023279
(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))))