
(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 x)))
(t_2 (sqrt (+ 1.0 y)))
(t_3 (/ 1.0 (+ (sqrt z) (sqrt (+ 1.0 z))))))
(if (<= (- t_2 (sqrt y)) 0.999995)
(+ (/ 1.0 (+ (sqrt x) t_1)) (+ (/ 1.0 (+ t_2 (sqrt y))) t_3))
(+
(- (+ t_2 (- t_1 (sqrt y))) (sqrt x))
(+ t_3 (/ 1.0 (+ (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 + y));
double t_3 = 1.0 / (sqrt(z) + sqrt((1.0 + z)));
double tmp;
if ((t_2 - sqrt(y)) <= 0.999995) {
tmp = (1.0 / (sqrt(x) + t_1)) + ((1.0 / (t_2 + sqrt(y))) + t_3);
} else {
tmp = ((t_2 + (t_1 - sqrt(y))) - sqrt(x)) + (t_3 + (1.0 / (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) :: tmp
t_1 = sqrt((1.0d0 + x))
t_2 = sqrt((1.0d0 + y))
t_3 = 1.0d0 / (sqrt(z) + sqrt((1.0d0 + z)))
if ((t_2 - sqrt(y)) <= 0.999995d0) then
tmp = (1.0d0 / (sqrt(x) + t_1)) + ((1.0d0 / (t_2 + sqrt(y))) + t_3)
else
tmp = ((t_2 + (t_1 - sqrt(y))) - sqrt(x)) + (t_3 + (1.0d0 / (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 + y));
double t_3 = 1.0 / (Math.sqrt(z) + Math.sqrt((1.0 + z)));
double tmp;
if ((t_2 - Math.sqrt(y)) <= 0.999995) {
tmp = (1.0 / (Math.sqrt(x) + t_1)) + ((1.0 / (t_2 + Math.sqrt(y))) + t_3);
} else {
tmp = ((t_2 + (t_1 - Math.sqrt(y))) - Math.sqrt(x)) + (t_3 + (1.0 / (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 + y)) t_3 = 1.0 / (math.sqrt(z) + math.sqrt((1.0 + z))) tmp = 0 if (t_2 - math.sqrt(y)) <= 0.999995: tmp = (1.0 / (math.sqrt(x) + t_1)) + ((1.0 / (t_2 + math.sqrt(y))) + t_3) else: tmp = ((t_2 + (t_1 - math.sqrt(y))) - math.sqrt(x)) + (t_3 + (1.0 / (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 + y)) t_3 = Float64(1.0 / Float64(sqrt(z) + sqrt(Float64(1.0 + z)))) tmp = 0.0 if (Float64(t_2 - sqrt(y)) <= 0.999995) tmp = Float64(Float64(1.0 / Float64(sqrt(x) + t_1)) + Float64(Float64(1.0 / Float64(t_2 + sqrt(y))) + t_3)); else tmp = Float64(Float64(Float64(t_2 + Float64(t_1 - sqrt(y))) - sqrt(x)) + Float64(t_3 + Float64(1.0 / 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 + y));
t_3 = 1.0 / (sqrt(z) + sqrt((1.0 + z)));
tmp = 0.0;
if ((t_2 - sqrt(y)) <= 0.999995)
tmp = (1.0 / (sqrt(x) + t_1)) + ((1.0 / (t_2 + sqrt(y))) + t_3);
else
tmp = ((t_2 + (t_1 - sqrt(y))) - sqrt(x)) + (t_3 + (1.0 / (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 + y), $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[N[(t$95$2 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision], 0.999995], N[(N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 / N[(t$95$2 + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$3), $MachinePrecision]), $MachinePrecision], N[(N[(N[(t$95$2 + N[(t$95$1 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(t$95$3 + N[(1.0 / N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] + N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + x}\\
t_2 := \sqrt{1 + y}\\
t_3 := \frac{1}{\sqrt{z} + \sqrt{1 + z}}\\
\mathbf{if}\;t_2 - \sqrt{y} \leq 0.999995:\\
\;\;\;\;\frac{1}{\sqrt{x} + t_1} + \left(\frac{1}{t_2 + \sqrt{y}} + t_3\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(t_2 + \left(t_1 - \sqrt{y}\right)\right) - \sqrt{x}\right) + \left(t_3 + \frac{1}{\sqrt{1 + t} + \sqrt{t}}\right)\\
\end{array}
\end{array}
if (-.f64 (sqrt.f64 (+.f64 y 1)) (sqrt.f64 y)) < 0.99999499999999997Initial program 87.7%
associate-+l+87.7%
associate-+l+87.7%
+-commutative87.7%
+-commutative87.7%
+-commutative87.7%
Simplified87.7%
flip--87.7%
add-sqr-sqrt69.3%
add-sqr-sqrt88.3%
Applied egg-rr88.3%
+-commutative88.3%
associate--l+91.5%
+-inverses91.5%
metadata-eval91.5%
+-commutative91.5%
+-commutative91.5%
Simplified91.5%
flip--91.6%
add-sqr-sqrt56.6%
add-sqr-sqrt91.7%
Applied egg-rr91.7%
associate--l+94.7%
+-inverses94.7%
metadata-eval94.7%
Simplified94.7%
flip--94.7%
add-sqr-sqrt74.9%
add-sqr-sqrt95.9%
Applied egg-rr95.9%
associate--l+98.2%
+-inverses98.2%
metadata-eval98.2%
+-commutative98.2%
+-commutative98.2%
Simplified98.2%
Taylor expanded in t around inf 54.2%
if 0.99999499999999997 < (-.f64 (sqrt.f64 (+.f64 y 1)) (sqrt.f64 y)) Initial program 96.4%
associate-+l+96.4%
+-commutative96.4%
associate-+r-60.1%
associate-+l-54.4%
+-commutative54.4%
+-commutative54.4%
associate--l+54.4%
Simplified39.4%
associate-+r-39.4%
Applied egg-rr39.4%
associate-+l-39.8%
associate--r-43.7%
associate-+r-43.6%
+-commutative43.6%
associate--l+43.7%
+-commutative43.7%
associate-+l-49.8%
associate--r-60.1%
Simplified60.1%
+-commutative60.1%
flip--60.4%
add-sqr-sqrt47.4%
add-sqr-sqrt60.4%
Applied egg-rr60.4%
associate--l+60.7%
+-inverses60.7%
metadata-eval60.7%
Simplified60.7%
+-commutative60.7%
flip--60.7%
add-sqr-sqrt48.5%
add-sqr-sqrt60.8%
Applied egg-rr60.8%
associate--l+61.5%
+-inverses61.5%
metadata-eval61.5%
Simplified61.5%
Final simplification58.0%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ 1.0 z)))
(t_2 (- t_1 (sqrt z)))
(t_3 (sqrt (+ 1.0 x)))
(t_4 (- t_3 (sqrt x)))
(t_5 (sqrt (+ 1.0 y)))
(t_6 (- t_5 (sqrt y))))
(if (<= (+ (+ t_4 t_6) t_2) 2.1)
(+
(/ 1.0 (+ (sqrt x) t_3))
(+ (/ 1.0 (+ t_5 (sqrt y))) (/ 1.0 (+ (sqrt z) t_1))))
(+ t_4 (+ t_6 (+ (/ 1.0 (+ (sqrt (+ 1.0 t)) (sqrt t))) t_2))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + z));
double t_2 = t_1 - sqrt(z);
double t_3 = sqrt((1.0 + x));
double t_4 = t_3 - sqrt(x);
double t_5 = sqrt((1.0 + y));
double t_6 = t_5 - sqrt(y);
double tmp;
if (((t_4 + t_6) + t_2) <= 2.1) {
tmp = (1.0 / (sqrt(x) + t_3)) + ((1.0 / (t_5 + sqrt(y))) + (1.0 / (sqrt(z) + t_1)));
} else {
tmp = t_4 + (t_6 + ((1.0 / (sqrt((1.0 + t)) + sqrt(t))) + t_2));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: t_5
real(8) :: t_6
real(8) :: tmp
t_1 = sqrt((1.0d0 + z))
t_2 = t_1 - sqrt(z)
t_3 = sqrt((1.0d0 + x))
t_4 = t_3 - sqrt(x)
t_5 = sqrt((1.0d0 + y))
t_6 = t_5 - sqrt(y)
if (((t_4 + t_6) + t_2) <= 2.1d0) then
tmp = (1.0d0 / (sqrt(x) + t_3)) + ((1.0d0 / (t_5 + sqrt(y))) + (1.0d0 / (sqrt(z) + t_1)))
else
tmp = t_4 + (t_6 + ((1.0d0 / (sqrt((1.0d0 + t)) + sqrt(t))) + t_2))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + z));
double t_2 = t_1 - Math.sqrt(z);
double t_3 = Math.sqrt((1.0 + x));
double t_4 = t_3 - Math.sqrt(x);
double t_5 = Math.sqrt((1.0 + y));
double t_6 = t_5 - Math.sqrt(y);
double tmp;
if (((t_4 + t_6) + t_2) <= 2.1) {
tmp = (1.0 / (Math.sqrt(x) + t_3)) + ((1.0 / (t_5 + Math.sqrt(y))) + (1.0 / (Math.sqrt(z) + t_1)));
} else {
tmp = t_4 + (t_6 + ((1.0 / (Math.sqrt((1.0 + t)) + Math.sqrt(t))) + t_2));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + z)) t_2 = t_1 - math.sqrt(z) t_3 = math.sqrt((1.0 + x)) t_4 = t_3 - math.sqrt(x) t_5 = math.sqrt((1.0 + y)) t_6 = t_5 - math.sqrt(y) tmp = 0 if ((t_4 + t_6) + t_2) <= 2.1: tmp = (1.0 / (math.sqrt(x) + t_3)) + ((1.0 / (t_5 + math.sqrt(y))) + (1.0 / (math.sqrt(z) + t_1))) else: tmp = t_4 + (t_6 + ((1.0 / (math.sqrt((1.0 + t)) + math.sqrt(t))) + t_2)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(1.0 + z)) t_2 = Float64(t_1 - sqrt(z)) t_3 = sqrt(Float64(1.0 + x)) t_4 = Float64(t_3 - sqrt(x)) t_5 = sqrt(Float64(1.0 + y)) t_6 = Float64(t_5 - sqrt(y)) tmp = 0.0 if (Float64(Float64(t_4 + t_6) + t_2) <= 2.1) tmp = Float64(Float64(1.0 / Float64(sqrt(x) + t_3)) + Float64(Float64(1.0 / Float64(t_5 + sqrt(y))) + Float64(1.0 / Float64(sqrt(z) + t_1)))); else tmp = Float64(t_4 + Float64(t_6 + Float64(Float64(1.0 / Float64(sqrt(Float64(1.0 + t)) + sqrt(t))) + t_2))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + z));
t_2 = t_1 - sqrt(z);
t_3 = sqrt((1.0 + x));
t_4 = t_3 - sqrt(x);
t_5 = sqrt((1.0 + y));
t_6 = t_5 - sqrt(y);
tmp = 0.0;
if (((t_4 + t_6) + t_2) <= 2.1)
tmp = (1.0 / (sqrt(x) + t_3)) + ((1.0 / (t_5 + sqrt(y))) + (1.0 / (sqrt(z) + t_1)));
else
tmp = t_4 + (t_6 + ((1.0 / (sqrt((1.0 + t)) + sqrt(t))) + t_2));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(t$95$1 - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$4 = N[(t$95$3 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$6 = N[(t$95$5 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(N[(t$95$4 + t$95$6), $MachinePrecision] + t$95$2), $MachinePrecision], 2.1], N[(N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + t$95$3), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 / N[(t$95$5 + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[z], $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$4 + N[(t$95$6 + N[(N[(1.0 / N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] + N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + z}\\
t_2 := t_1 - \sqrt{z}\\
t_3 := \sqrt{1 + x}\\
t_4 := t_3 - \sqrt{x}\\
t_5 := \sqrt{1 + y}\\
t_6 := t_5 - \sqrt{y}\\
\mathbf{if}\;\left(t_4 + t_6\right) + t_2 \leq 2.1:\\
\;\;\;\;\frac{1}{\sqrt{x} + t_3} + \left(\frac{1}{t_5 + \sqrt{y}} + \frac{1}{\sqrt{z} + t_1}\right)\\
\mathbf{else}:\\
\;\;\;\;t_4 + \left(t_6 + \left(\frac{1}{\sqrt{1 + t} + \sqrt{t}} + t_2\right)\right)\\
\end{array}
\end{array}
if (+.f64 (+.f64 (-.f64 (sqrt.f64 (+.f64 x 1)) (sqrt.f64 x)) (-.f64 (sqrt.f64 (+.f64 y 1)) (sqrt.f64 y))) (-.f64 (sqrt.f64 (+.f64 z 1)) (sqrt.f64 z))) < 2.10000000000000009Initial program 91.4%
associate-+l+91.4%
associate-+l+91.4%
+-commutative91.4%
+-commutative91.4%
+-commutative91.4%
Simplified91.4%
flip--91.4%
add-sqr-sqrt70.3%
add-sqr-sqrt92.2%
Applied egg-rr92.2%
+-commutative92.2%
associate--l+94.2%
+-inverses94.2%
metadata-eval94.2%
+-commutative94.2%
+-commutative94.2%
Simplified94.2%
flip--94.3%
add-sqr-sqrt74.9%
add-sqr-sqrt94.3%
Applied egg-rr94.3%
associate--l+96.0%
+-inverses96.0%
metadata-eval96.0%
Simplified96.0%
flip--96.4%
add-sqr-sqrt73.5%
add-sqr-sqrt97.2%
Applied egg-rr97.2%
associate--l+98.6%
+-inverses98.6%
metadata-eval98.6%
+-commutative98.6%
+-commutative98.6%
Simplified98.6%
Taylor expanded in t around inf 54.1%
if 2.10000000000000009 < (+.f64 (+.f64 (-.f64 (sqrt.f64 (+.f64 x 1)) (sqrt.f64 x)) (-.f64 (sqrt.f64 (+.f64 y 1)) (sqrt.f64 y))) (-.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.3%
add-sqr-sqrt70.1%
add-sqr-sqrt98.3%
Applied egg-rr98.3%
associate--l+99.8%
+-inverses99.8%
metadata-eval99.8%
+-commutative99.8%
+-commutative99.8%
Simplified99.8%
Final simplification60.0%
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 (+ 1.0 y)) (sqrt y))) (+ (/ 1.0 (+ (sqrt z) (sqrt (+ 1.0 z)))) (- (sqrt (+ 1.0 t)) (sqrt t))))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
return (1.0 / (sqrt(x) + sqrt((1.0 + x)))) + ((1.0 / (sqrt((1.0 + y)) + sqrt(y))) + ((1.0 / (sqrt(z) + sqrt((1.0 + z)))) + (sqrt((1.0 + t)) - sqrt(t))));
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (1.0d0 / (sqrt(x) + sqrt((1.0d0 + x)))) + ((1.0d0 / (sqrt((1.0d0 + y)) + sqrt(y))) + ((1.0d0 / (sqrt(z) + sqrt((1.0d0 + z)))) + (sqrt((1.0d0 + t)) - sqrt(t))))
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
return (1.0 / (Math.sqrt(x) + Math.sqrt((1.0 + x)))) + ((1.0 / (Math.sqrt((1.0 + y)) + Math.sqrt(y))) + ((1.0 / (Math.sqrt(z) + Math.sqrt((1.0 + z)))) + (Math.sqrt((1.0 + t)) - Math.sqrt(t))));
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): return (1.0 / (math.sqrt(x) + math.sqrt((1.0 + x)))) + ((1.0 / (math.sqrt((1.0 + y)) + math.sqrt(y))) + ((1.0 / (math.sqrt(z) + math.sqrt((1.0 + z)))) + (math.sqrt((1.0 + t)) - math.sqrt(t))))
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) return Float64(Float64(1.0 / Float64(sqrt(x) + sqrt(Float64(1.0 + x)))) + Float64(Float64(1.0 / Float64(sqrt(Float64(1.0 + y)) + sqrt(y))) + Float64(Float64(1.0 / Float64(sqrt(z) + sqrt(Float64(1.0 + z)))) + Float64(sqrt(Float64(1.0 + t)) - sqrt(t))))) end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp = code(x, y, z, t)
tmp = (1.0 / (sqrt(x) + sqrt((1.0 + x)))) + ((1.0 / (sqrt((1.0 + y)) + sqrt(y))) + ((1.0 / (sqrt(z) + sqrt((1.0 + z)))) + (sqrt((1.0 + t)) - sqrt(t))));
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := N[(N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 / N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(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]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\frac{1}{\sqrt{x} + \sqrt{1 + x}} + \left(\frac{1}{\sqrt{1 + y} + \sqrt{y}} + \left(\frac{1}{\sqrt{z} + \sqrt{1 + z}} + \left(\sqrt{1 + t} - \sqrt{t}\right)\right)\right)
\end{array}
Initial program 92.2%
associate-+l+92.2%
associate-+l+92.2%
+-commutative92.2%
+-commutative92.2%
+-commutative92.2%
Simplified92.2%
flip--92.2%
add-sqr-sqrt73.9%
add-sqr-sqrt93.0%
Applied egg-rr93.0%
+-commutative93.0%
associate--l+94.7%
+-inverses94.7%
metadata-eval94.7%
+-commutative94.7%
+-commutative94.7%
Simplified94.7%
flip--94.8%
add-sqr-sqrt77.9%
add-sqr-sqrt94.8%
Applied egg-rr94.8%
associate--l+96.2%
+-inverses96.2%
metadata-eval96.2%
Simplified96.2%
flip--96.6%
add-sqr-sqrt76.7%
add-sqr-sqrt97.3%
Applied egg-rr97.3%
associate--l+98.5%
+-inverses98.5%
metadata-eval98.5%
+-commutative98.5%
+-commutative98.5%
Simplified98.5%
Final simplification98.5%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ 1.0 y)))
(t_2 (sqrt (+ 1.0 z)))
(t_3 (sqrt (+ 1.0 x)))
(t_4 (- t_3 (sqrt x))))
(if (<= y 9e-86)
(+ t_4 (+ 1.0 (+ (- (sqrt (+ 1.0 t)) (sqrt t)) (- t_2 (sqrt z)))))
(if (<= y 1e+33)
(+ t_4 (+ (/ 1.0 (+ t_1 (sqrt y))) (/ 1.0 (+ (sqrt z) t_2))))
(+ (/ 1.0 (+ (sqrt x) t_3)) (- (- t_1 (sqrt y)) (- (sqrt z) t_2)))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + y));
double t_2 = sqrt((1.0 + z));
double t_3 = sqrt((1.0 + x));
double t_4 = t_3 - sqrt(x);
double tmp;
if (y <= 9e-86) {
tmp = t_4 + (1.0 + ((sqrt((1.0 + t)) - sqrt(t)) + (t_2 - sqrt(z))));
} else if (y <= 1e+33) {
tmp = t_4 + ((1.0 / (t_1 + sqrt(y))) + (1.0 / (sqrt(z) + t_2)));
} else {
tmp = (1.0 / (sqrt(x) + t_3)) + ((t_1 - sqrt(y)) - (sqrt(z) - t_2));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: tmp
t_1 = sqrt((1.0d0 + y))
t_2 = sqrt((1.0d0 + z))
t_3 = sqrt((1.0d0 + x))
t_4 = t_3 - sqrt(x)
if (y <= 9d-86) then
tmp = t_4 + (1.0d0 + ((sqrt((1.0d0 + t)) - sqrt(t)) + (t_2 - sqrt(z))))
else if (y <= 1d+33) then
tmp = t_4 + ((1.0d0 / (t_1 + sqrt(y))) + (1.0d0 / (sqrt(z) + t_2)))
else
tmp = (1.0d0 / (sqrt(x) + t_3)) + ((t_1 - sqrt(y)) - (sqrt(z) - t_2))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + y));
double t_2 = Math.sqrt((1.0 + z));
double t_3 = Math.sqrt((1.0 + x));
double t_4 = t_3 - Math.sqrt(x);
double tmp;
if (y <= 9e-86) {
tmp = t_4 + (1.0 + ((Math.sqrt((1.0 + t)) - Math.sqrt(t)) + (t_2 - Math.sqrt(z))));
} else if (y <= 1e+33) {
tmp = t_4 + ((1.0 / (t_1 + Math.sqrt(y))) + (1.0 / (Math.sqrt(z) + t_2)));
} else {
tmp = (1.0 / (Math.sqrt(x) + t_3)) + ((t_1 - Math.sqrt(y)) - (Math.sqrt(z) - t_2));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + y)) t_2 = math.sqrt((1.0 + z)) t_3 = math.sqrt((1.0 + x)) t_4 = t_3 - math.sqrt(x) tmp = 0 if y <= 9e-86: tmp = t_4 + (1.0 + ((math.sqrt((1.0 + t)) - math.sqrt(t)) + (t_2 - math.sqrt(z)))) elif y <= 1e+33: tmp = t_4 + ((1.0 / (t_1 + math.sqrt(y))) + (1.0 / (math.sqrt(z) + t_2))) else: tmp = (1.0 / (math.sqrt(x) + t_3)) + ((t_1 - math.sqrt(y)) - (math.sqrt(z) - t_2)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(1.0 + y)) t_2 = sqrt(Float64(1.0 + z)) t_3 = sqrt(Float64(1.0 + x)) t_4 = Float64(t_3 - sqrt(x)) tmp = 0.0 if (y <= 9e-86) tmp = Float64(t_4 + Float64(1.0 + Float64(Float64(sqrt(Float64(1.0 + t)) - sqrt(t)) + Float64(t_2 - sqrt(z))))); elseif (y <= 1e+33) tmp = Float64(t_4 + Float64(Float64(1.0 / Float64(t_1 + sqrt(y))) + Float64(1.0 / Float64(sqrt(z) + t_2)))); else tmp = Float64(Float64(1.0 / Float64(sqrt(x) + t_3)) + Float64(Float64(t_1 - sqrt(y)) - Float64(sqrt(z) - t_2))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + y));
t_2 = sqrt((1.0 + z));
t_3 = sqrt((1.0 + x));
t_4 = t_3 - sqrt(x);
tmp = 0.0;
if (y <= 9e-86)
tmp = t_4 + (1.0 + ((sqrt((1.0 + t)) - sqrt(t)) + (t_2 - sqrt(z))));
elseif (y <= 1e+33)
tmp = t_4 + ((1.0 / (t_1 + sqrt(y))) + (1.0 / (sqrt(z) + t_2)));
else
tmp = (1.0 / (sqrt(x) + t_3)) + ((t_1 - sqrt(y)) - (sqrt(z) - t_2));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$4 = N[(t$95$3 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 9e-86], N[(t$95$4 + N[(1.0 + N[(N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision] + N[(t$95$2 - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1e+33], N[(t$95$4 + N[(N[(1.0 / N[(t$95$1 + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[z], $MachinePrecision] + t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + t$95$3), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$1 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[z], $MachinePrecision] - t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + y}\\
t_2 := \sqrt{1 + z}\\
t_3 := \sqrt{1 + x}\\
t_4 := t_3 - \sqrt{x}\\
\mathbf{if}\;y \leq 9 \cdot 10^{-86}:\\
\;\;\;\;t_4 + \left(1 + \left(\left(\sqrt{1 + t} - \sqrt{t}\right) + \left(t_2 - \sqrt{z}\right)\right)\right)\\
\mathbf{elif}\;y \leq 10^{+33}:\\
\;\;\;\;t_4 + \left(\frac{1}{t_1 + \sqrt{y}} + \frac{1}{\sqrt{z} + t_2}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{x} + t_3} + \left(\left(t_1 - \sqrt{y}\right) - \left(\sqrt{z} - t_2\right)\right)\\
\end{array}
\end{array}
if y < 8.9999999999999995e-86Initial program 96.2%
associate-+l+96.2%
associate-+l+96.2%
+-commutative96.2%
+-commutative96.2%
+-commutative96.2%
Simplified96.2%
Taylor expanded in y around 0 96.2%
if 8.9999999999999995e-86 < y < 9.9999999999999995e32Initial program 93.3%
associate-+l+93.3%
associate-+l+93.3%
+-commutative93.3%
+-commutative93.3%
+-commutative93.3%
Simplified93.3%
flip--93.8%
add-sqr-sqrt88.5%
add-sqr-sqrt93.8%
Applied egg-rr93.6%
associate--l+95.6%
+-inverses95.6%
metadata-eval95.6%
Simplified95.0%
Taylor expanded in t around inf 55.8%
flip--95.6%
add-sqr-sqrt77.5%
add-sqr-sqrt97.8%
Applied egg-rr57.3%
associate--l+97.8%
+-inverses97.8%
metadata-eval97.8%
+-commutative97.8%
+-commutative97.8%
Simplified57.3%
if 9.9999999999999995e32 < y Initial program 88.4%
associate-+l+88.4%
associate-+l+88.4%
+-commutative88.4%
+-commutative88.4%
+-commutative88.4%
Simplified88.4%
flip--88.3%
add-sqr-sqrt69.7%
add-sqr-sqrt89.0%
Applied egg-rr89.0%
+-commutative89.0%
associate--l+92.5%
+-inverses92.5%
metadata-eval92.5%
+-commutative92.5%
+-commutative92.5%
Simplified92.5%
Taylor expanded in t around inf 48.7%
Final simplification67.9%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ 1.0 z))))
(if (<= t 8.5e+15)
(+ 2.0 (+ t_1 (- (hypot 1.0 (sqrt t)) (+ (sqrt z) (sqrt t)))))
(+
(/ 1.0 (+ (sqrt x) (sqrt (+ 1.0 x))))
(+ (/ 1.0 (+ (sqrt (+ 1.0 y)) (sqrt y))) (/ 1.0 (+ (sqrt z) t_1)))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + z));
double tmp;
if (t <= 8.5e+15) {
tmp = 2.0 + (t_1 + (hypot(1.0, sqrt(t)) - (sqrt(z) + sqrt(t))));
} else {
tmp = (1.0 / (sqrt(x) + sqrt((1.0 + x)))) + ((1.0 / (sqrt((1.0 + y)) + sqrt(y))) + (1.0 / (sqrt(z) + t_1)));
}
return tmp;
}
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + z));
double tmp;
if (t <= 8.5e+15) {
tmp = 2.0 + (t_1 + (Math.hypot(1.0, Math.sqrt(t)) - (Math.sqrt(z) + Math.sqrt(t))));
} else {
tmp = (1.0 / (Math.sqrt(x) + Math.sqrt((1.0 + x)))) + ((1.0 / (Math.sqrt((1.0 + y)) + Math.sqrt(y))) + (1.0 / (Math.sqrt(z) + t_1)));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + z)) tmp = 0 if t <= 8.5e+15: tmp = 2.0 + (t_1 + (math.hypot(1.0, math.sqrt(t)) - (math.sqrt(z) + math.sqrt(t)))) else: tmp = (1.0 / (math.sqrt(x) + math.sqrt((1.0 + x)))) + ((1.0 / (math.sqrt((1.0 + y)) + math.sqrt(y))) + (1.0 / (math.sqrt(z) + t_1))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(1.0 + z)) tmp = 0.0 if (t <= 8.5e+15) tmp = Float64(2.0 + Float64(t_1 + Float64(hypot(1.0, sqrt(t)) - Float64(sqrt(z) + sqrt(t))))); else tmp = Float64(Float64(1.0 / Float64(sqrt(x) + sqrt(Float64(1.0 + x)))) + Float64(Float64(1.0 / Float64(sqrt(Float64(1.0 + y)) + sqrt(y))) + Float64(1.0 / Float64(sqrt(z) + t_1)))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + z));
tmp = 0.0;
if (t <= 8.5e+15)
tmp = 2.0 + (t_1 + (hypot(1.0, sqrt(t)) - (sqrt(z) + sqrt(t))));
else
tmp = (1.0 / (sqrt(x) + sqrt((1.0 + x)))) + ((1.0 / (sqrt((1.0 + y)) + sqrt(y))) + (1.0 / (sqrt(z) + t_1)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t, 8.5e+15], N[(2.0 + N[(t$95$1 + N[(N[Sqrt[1.0 ^ 2 + N[Sqrt[t], $MachinePrecision] ^ 2], $MachinePrecision] - N[(N[Sqrt[z], $MachinePrecision] + N[Sqrt[t], $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[(N[(1.0 / N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[z], $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + z}\\
\mathbf{if}\;t \leq 8.5 \cdot 10^{+15}:\\
\;\;\;\;2 + \left(t_1 + \left(\mathsf{hypot}\left(1, \sqrt{t}\right) - \left(\sqrt{z} + \sqrt{t}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{x} + \sqrt{1 + x}} + \left(\frac{1}{\sqrt{1 + y} + \sqrt{y}} + \frac{1}{\sqrt{z} + t_1}\right)\\
\end{array}
\end{array}
if t < 8.5e15Initial program 97.4%
associate-+l+97.4%
+-commutative97.4%
associate-+r-79.6%
associate-+l-49.8%
+-commutative49.8%
+-commutative49.8%
associate--l+49.8%
Simplified48.8%
Taylor expanded in y around 0 18.3%
associate--l+38.6%
+-commutative38.6%
associate--l+38.6%
+-commutative38.6%
+-commutative38.6%
+-commutative38.6%
+-commutative38.6%
Simplified38.6%
expm1-log1p-u18.3%
Applied egg-rr18.3%
Taylor expanded in x around 0 21.1%
associate--l+43.9%
+-commutative43.9%
associate--l+43.9%
rem-square-sqrt43.9%
hypot-1-def43.9%
Simplified43.9%
if 8.5e15 < t Initial program 86.1%
associate-+l+86.1%
associate-+l+86.1%
+-commutative86.1%
+-commutative86.1%
+-commutative86.1%
Simplified86.1%
flip--86.1%
add-sqr-sqrt70.5%
add-sqr-sqrt86.7%
Applied egg-rr86.7%
+-commutative86.7%
associate--l+90.1%
+-inverses90.1%
metadata-eval90.1%
+-commutative90.1%
+-commutative90.1%
Simplified90.1%
flip--90.2%
add-sqr-sqrt74.8%
add-sqr-sqrt90.2%
Applied egg-rr90.2%
associate--l+93.0%
+-inverses93.0%
metadata-eval93.0%
Simplified93.0%
flip--93.4%
add-sqr-sqrt72.1%
add-sqr-sqrt94.6%
Applied egg-rr94.6%
associate--l+97.2%
+-inverses97.2%
metadata-eval97.2%
+-commutative97.2%
+-commutative97.2%
Simplified97.2%
Taylor expanded in t around inf 97.2%
Final simplification68.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 z))) (t_3 (sqrt (+ 1.0 y))))
(if (<= z 1.06e-43)
(+ 2.0 (+ t_2 (- (hypot 1.0 (sqrt t)) (+ (sqrt z) (sqrt t)))))
(if (<= z 1.25e+29)
(+ t_1 (- (- t_3 (sqrt y)) (+ (sqrt x) (/ -1.0 (+ (sqrt z) t_2)))))
(+ (/ 1.0 (+ t_3 (sqrt y))) (- t_1 (sqrt x)))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + x));
double t_2 = sqrt((1.0 + z));
double t_3 = sqrt((1.0 + y));
double tmp;
if (z <= 1.06e-43) {
tmp = 2.0 + (t_2 + (hypot(1.0, sqrt(t)) - (sqrt(z) + sqrt(t))));
} else if (z <= 1.25e+29) {
tmp = t_1 + ((t_3 - sqrt(y)) - (sqrt(x) + (-1.0 / (sqrt(z) + t_2))));
} else {
tmp = (1.0 / (t_3 + sqrt(y))) + (t_1 - sqrt(x));
}
return tmp;
}
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + x));
double t_2 = Math.sqrt((1.0 + z));
double t_3 = Math.sqrt((1.0 + y));
double tmp;
if (z <= 1.06e-43) {
tmp = 2.0 + (t_2 + (Math.hypot(1.0, Math.sqrt(t)) - (Math.sqrt(z) + Math.sqrt(t))));
} else if (z <= 1.25e+29) {
tmp = t_1 + ((t_3 - Math.sqrt(y)) - (Math.sqrt(x) + (-1.0 / (Math.sqrt(z) + t_2))));
} else {
tmp = (1.0 / (t_3 + Math.sqrt(y))) + (t_1 - Math.sqrt(x));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + x)) t_2 = math.sqrt((1.0 + z)) t_3 = math.sqrt((1.0 + y)) tmp = 0 if z <= 1.06e-43: tmp = 2.0 + (t_2 + (math.hypot(1.0, math.sqrt(t)) - (math.sqrt(z) + math.sqrt(t)))) elif z <= 1.25e+29: tmp = t_1 + ((t_3 - math.sqrt(y)) - (math.sqrt(x) + (-1.0 / (math.sqrt(z) + t_2)))) else: tmp = (1.0 / (t_3 + math.sqrt(y))) + (t_1 - math.sqrt(x)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(1.0 + x)) t_2 = sqrt(Float64(1.0 + z)) t_3 = sqrt(Float64(1.0 + y)) tmp = 0.0 if (z <= 1.06e-43) tmp = Float64(2.0 + Float64(t_2 + Float64(hypot(1.0, sqrt(t)) - Float64(sqrt(z) + sqrt(t))))); elseif (z <= 1.25e+29) tmp = Float64(t_1 + Float64(Float64(t_3 - sqrt(y)) - Float64(sqrt(x) + Float64(-1.0 / Float64(sqrt(z) + t_2))))); else tmp = Float64(Float64(1.0 / Float64(t_3 + sqrt(y))) + Float64(t_1 - sqrt(x))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + x));
t_2 = sqrt((1.0 + z));
t_3 = sqrt((1.0 + y));
tmp = 0.0;
if (z <= 1.06e-43)
tmp = 2.0 + (t_2 + (hypot(1.0, sqrt(t)) - (sqrt(z) + sqrt(t))));
elseif (z <= 1.25e+29)
tmp = t_1 + ((t_3 - sqrt(y)) - (sqrt(x) + (-1.0 / (sqrt(z) + t_2))));
else
tmp = (1.0 / (t_3 + sqrt(y))) + (t_1 - sqrt(x));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[z, 1.06e-43], N[(2.0 + N[(t$95$2 + N[(N[Sqrt[1.0 ^ 2 + N[Sqrt[t], $MachinePrecision] ^ 2], $MachinePrecision] - N[(N[Sqrt[z], $MachinePrecision] + N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.25e+29], N[(t$95$1 + N[(N[(t$95$3 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[x], $MachinePrecision] + N[(-1.0 / N[(N[Sqrt[z], $MachinePrecision] + t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[(t$95$3 + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$1 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + x}\\
t_2 := \sqrt{1 + z}\\
t_3 := \sqrt{1 + y}\\
\mathbf{if}\;z \leq 1.06 \cdot 10^{-43}:\\
\;\;\;\;2 + \left(t_2 + \left(\mathsf{hypot}\left(1, \sqrt{t}\right) - \left(\sqrt{z} + \sqrt{t}\right)\right)\right)\\
\mathbf{elif}\;z \leq 1.25 \cdot 10^{+29}:\\
\;\;\;\;t_1 + \left(\left(t_3 - \sqrt{y}\right) - \left(\sqrt{x} + \frac{-1}{\sqrt{z} + t_2}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{t_3 + \sqrt{y}} + \left(t_1 - \sqrt{x}\right)\\
\end{array}
\end{array}
if z < 1.05999999999999994e-43Initial program 97.0%
associate-+l+97.0%
+-commutative97.0%
associate-+r-77.0%
associate-+l-46.5%
+-commutative46.5%
+-commutative46.5%
associate--l+46.5%
Simplified28.7%
Taylor expanded in y around 0 19.2%
associate--l+39.3%
+-commutative39.3%
associate--l+42.3%
+-commutative42.3%
+-commutative42.3%
+-commutative42.3%
+-commutative42.3%
Simplified42.3%
expm1-log1p-u18.5%
Applied egg-rr18.5%
Taylor expanded in x around 0 22.6%
associate--l+46.8%
+-commutative46.8%
associate--l+37.3%
rem-square-sqrt37.3%
hypot-1-def37.3%
Simplified37.3%
if 1.05999999999999994e-43 < z < 1.25e29Initial program 80.9%
associate-+l+80.9%
+-commutative80.9%
associate-+r-63.8%
associate-+l-41.5%
+-commutative41.5%
+-commutative41.5%
associate--l+41.5%
Simplified30.2%
Taylor expanded in t around inf 23.5%
associate--l+25.1%
+-commutative25.1%
Simplified25.1%
flip--22.7%
add-sqr-sqrt22.7%
add-sqr-sqrt22.7%
+-commutative22.7%
+-commutative22.7%
Applied egg-rr26.0%
+-commutative22.7%
associate--r+22.7%
+-inverses22.7%
metadata-eval22.7%
+-commutative22.7%
Simplified26.0%
if 1.25e29 < z Initial program 89.9%
associate-+l+89.9%
associate-+l+89.9%
+-commutative89.9%
+-commutative89.9%
+-commutative89.9%
Simplified89.9%
flip--93.4%
add-sqr-sqrt79.8%
add-sqr-sqrt93.4%
Applied egg-rr90.1%
associate--l+96.5%
+-inverses96.5%
metadata-eval96.5%
Simplified93.2%
Taylor expanded in t around inf 44.0%
Taylor expanded in z around inf 29.4%
+-commutative29.4%
+-commutative29.4%
associate--l+44.0%
+-commutative44.0%
+-commutative44.0%
Simplified44.0%
Final simplification39.0%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (sqrt (+ 1.0 z)) (sqrt z)))
(t_2 (sqrt (+ 1.0 x)))
(t_3 (- t_2 (sqrt x))))
(if (<= y 1.1e-85)
(+ t_3 (+ 1.0 (+ (- (sqrt (+ 1.0 t)) (sqrt t)) t_1)))
(if (<= y 1.95e+35)
(+ t_3 (+ (/ 1.0 (+ (sqrt (+ 1.0 y)) (sqrt y))) t_1))
(/ 1.0 (+ (sqrt x) t_2))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + z)) - sqrt(z);
double t_2 = sqrt((1.0 + x));
double t_3 = t_2 - sqrt(x);
double tmp;
if (y <= 1.1e-85) {
tmp = t_3 + (1.0 + ((sqrt((1.0 + t)) - sqrt(t)) + t_1));
} else if (y <= 1.95e+35) {
tmp = t_3 + ((1.0 / (sqrt((1.0 + y)) + sqrt(y))) + t_1);
} else {
tmp = 1.0 / (sqrt(x) + t_2);
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = sqrt((1.0d0 + z)) - sqrt(z)
t_2 = sqrt((1.0d0 + x))
t_3 = t_2 - sqrt(x)
if (y <= 1.1d-85) then
tmp = t_3 + (1.0d0 + ((sqrt((1.0d0 + t)) - sqrt(t)) + t_1))
else if (y <= 1.95d+35) then
tmp = t_3 + ((1.0d0 / (sqrt((1.0d0 + y)) + sqrt(y))) + t_1)
else
tmp = 1.0d0 / (sqrt(x) + t_2)
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + z)) - Math.sqrt(z);
double t_2 = Math.sqrt((1.0 + x));
double t_3 = t_2 - Math.sqrt(x);
double tmp;
if (y <= 1.1e-85) {
tmp = t_3 + (1.0 + ((Math.sqrt((1.0 + t)) - Math.sqrt(t)) + t_1));
} else if (y <= 1.95e+35) {
tmp = t_3 + ((1.0 / (Math.sqrt((1.0 + y)) + Math.sqrt(y))) + t_1);
} else {
tmp = 1.0 / (Math.sqrt(x) + t_2);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + z)) - math.sqrt(z) t_2 = math.sqrt((1.0 + x)) t_3 = t_2 - math.sqrt(x) tmp = 0 if y <= 1.1e-85: tmp = t_3 + (1.0 + ((math.sqrt((1.0 + t)) - math.sqrt(t)) + t_1)) elif y <= 1.95e+35: tmp = t_3 + ((1.0 / (math.sqrt((1.0 + y)) + math.sqrt(y))) + t_1) else: tmp = 1.0 / (math.sqrt(x) + t_2) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = Float64(sqrt(Float64(1.0 + z)) - sqrt(z)) t_2 = sqrt(Float64(1.0 + x)) t_3 = Float64(t_2 - sqrt(x)) tmp = 0.0 if (y <= 1.1e-85) tmp = Float64(t_3 + Float64(1.0 + Float64(Float64(sqrt(Float64(1.0 + t)) - sqrt(t)) + t_1))); elseif (y <= 1.95e+35) tmp = Float64(t_3 + Float64(Float64(1.0 / Float64(sqrt(Float64(1.0 + y)) + sqrt(y))) + t_1)); else tmp = Float64(1.0 / Float64(sqrt(x) + t_2)); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + z)) - sqrt(z);
t_2 = sqrt((1.0 + x));
t_3 = t_2 - sqrt(x);
tmp = 0.0;
if (y <= 1.1e-85)
tmp = t_3 + (1.0 + ((sqrt((1.0 + t)) - sqrt(t)) + t_1));
elseif (y <= 1.95e+35)
tmp = t_3 + ((1.0 / (sqrt((1.0 + y)) + sqrt(y))) + t_1);
else
tmp = 1.0 / (sqrt(x) + t_2);
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[(t$95$2 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 1.1e-85], N[(t$95$3 + N[(1.0 + N[(N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.95e+35], N[(t$95$3 + N[(N[(1.0 / N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + t$95$2), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + z} - \sqrt{z}\\
t_2 := \sqrt{1 + x}\\
t_3 := t_2 - \sqrt{x}\\
\mathbf{if}\;y \leq 1.1 \cdot 10^{-85}:\\
\;\;\;\;t_3 + \left(1 + \left(\left(\sqrt{1 + t} - \sqrt{t}\right) + t_1\right)\right)\\
\mathbf{elif}\;y \leq 1.95 \cdot 10^{+35}:\\
\;\;\;\;t_3 + \left(\frac{1}{\sqrt{1 + y} + \sqrt{y}} + t_1\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{x} + t_2}\\
\end{array}
\end{array}
if y < 1.1e-85Initial program 96.2%
associate-+l+96.2%
associate-+l+96.2%
+-commutative96.2%
+-commutative96.2%
+-commutative96.2%
Simplified96.2%
Taylor expanded in y around 0 96.2%
if 1.1e-85 < y < 1.95e35Initial program 93.2%
associate-+l+93.2%
associate-+l+93.2%
+-commutative93.2%
+-commutative93.2%
+-commutative93.2%
Simplified93.2%
flip--94.2%
add-sqr-sqrt87.4%
add-sqr-sqrt94.2%
Applied egg-rr93.5%
associate--l+95.8%
+-inverses95.8%
metadata-eval95.8%
Simplified94.8%
Taylor expanded in t around inf 54.9%
if 1.95e35 < y Initial program 88.3%
associate-+l+88.3%
+-commutative88.3%
associate-+r-88.3%
associate-+l-45.4%
+-commutative45.4%
+-commutative45.4%
associate--l+45.4%
Simplified27.4%
Taylor expanded in t around inf 28.7%
associate--l+29.6%
+-commutative29.6%
Simplified29.6%
Taylor expanded in z around inf 17.0%
+-commutative17.0%
Simplified17.0%
Taylor expanded in y around inf 16.9%
flip--16.9%
add-sqr-sqrt17.4%
add-sqr-sqrt17.0%
Applied egg-rr17.0%
associate--l+21.6%
+-inverses21.6%
metadata-eval21.6%
Simplified21.6%
Final simplification56.2%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ 1.0 z))))
(if (<= t 8.5e+15)
(+ 2.0 (+ t_1 (- (hypot 1.0 (sqrt t)) (+ (sqrt z) (sqrt t)))))
(+
(/ 1.0 (+ (sqrt x) (sqrt (+ 1.0 x))))
(+ (/ 1.0 (+ (sqrt (+ 1.0 y)) (sqrt y))) (- t_1 (sqrt z)))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + z));
double tmp;
if (t <= 8.5e+15) {
tmp = 2.0 + (t_1 + (hypot(1.0, sqrt(t)) - (sqrt(z) + sqrt(t))));
} else {
tmp = (1.0 / (sqrt(x) + sqrt((1.0 + x)))) + ((1.0 / (sqrt((1.0 + y)) + sqrt(y))) + (t_1 - sqrt(z)));
}
return tmp;
}
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + z));
double tmp;
if (t <= 8.5e+15) {
tmp = 2.0 + (t_1 + (Math.hypot(1.0, Math.sqrt(t)) - (Math.sqrt(z) + Math.sqrt(t))));
} else {
tmp = (1.0 / (Math.sqrt(x) + Math.sqrt((1.0 + x)))) + ((1.0 / (Math.sqrt((1.0 + y)) + Math.sqrt(y))) + (t_1 - Math.sqrt(z)));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + z)) tmp = 0 if t <= 8.5e+15: tmp = 2.0 + (t_1 + (math.hypot(1.0, math.sqrt(t)) - (math.sqrt(z) + math.sqrt(t)))) else: tmp = (1.0 / (math.sqrt(x) + math.sqrt((1.0 + x)))) + ((1.0 / (math.sqrt((1.0 + y)) + math.sqrt(y))) + (t_1 - math.sqrt(z))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(1.0 + z)) tmp = 0.0 if (t <= 8.5e+15) tmp = Float64(2.0 + Float64(t_1 + Float64(hypot(1.0, sqrt(t)) - Float64(sqrt(z) + sqrt(t))))); else tmp = Float64(Float64(1.0 / Float64(sqrt(x) + sqrt(Float64(1.0 + x)))) + Float64(Float64(1.0 / Float64(sqrt(Float64(1.0 + y)) + sqrt(y))) + Float64(t_1 - sqrt(z)))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + z));
tmp = 0.0;
if (t <= 8.5e+15)
tmp = 2.0 + (t_1 + (hypot(1.0, sqrt(t)) - (sqrt(z) + sqrt(t))));
else
tmp = (1.0 / (sqrt(x) + sqrt((1.0 + x)))) + ((1.0 / (sqrt((1.0 + y)) + sqrt(y))) + (t_1 - sqrt(z)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t, 8.5e+15], N[(2.0 + N[(t$95$1 + N[(N[Sqrt[1.0 ^ 2 + N[Sqrt[t], $MachinePrecision] ^ 2], $MachinePrecision] - N[(N[Sqrt[z], $MachinePrecision] + N[Sqrt[t], $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[(N[(1.0 / N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$1 - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + z}\\
\mathbf{if}\;t \leq 8.5 \cdot 10^{+15}:\\
\;\;\;\;2 + \left(t_1 + \left(\mathsf{hypot}\left(1, \sqrt{t}\right) - \left(\sqrt{z} + \sqrt{t}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{x} + \sqrt{1 + x}} + \left(\frac{1}{\sqrt{1 + y} + \sqrt{y}} + \left(t_1 - \sqrt{z}\right)\right)\\
\end{array}
\end{array}
if t < 8.5e15Initial program 97.4%
associate-+l+97.4%
+-commutative97.4%
associate-+r-79.6%
associate-+l-49.8%
+-commutative49.8%
+-commutative49.8%
associate--l+49.8%
Simplified48.8%
Taylor expanded in y around 0 18.3%
associate--l+38.6%
+-commutative38.6%
associate--l+38.6%
+-commutative38.6%
+-commutative38.6%
+-commutative38.6%
+-commutative38.6%
Simplified38.6%
expm1-log1p-u18.3%
Applied egg-rr18.3%
Taylor expanded in x around 0 21.1%
associate--l+43.9%
+-commutative43.9%
associate--l+43.9%
rem-square-sqrt43.9%
hypot-1-def43.9%
Simplified43.9%
if 8.5e15 < t Initial program 86.1%
associate-+l+86.1%
associate-+l+86.1%
+-commutative86.1%
+-commutative86.1%
+-commutative86.1%
Simplified86.1%
flip--86.1%
add-sqr-sqrt70.5%
add-sqr-sqrt86.7%
Applied egg-rr86.7%
+-commutative86.7%
associate--l+90.1%
+-inverses90.1%
metadata-eval90.1%
+-commutative90.1%
+-commutative90.1%
Simplified90.1%
flip--90.2%
add-sqr-sqrt74.8%
add-sqr-sqrt90.2%
Applied egg-rr90.2%
associate--l+93.0%
+-inverses93.0%
metadata-eval93.0%
Simplified93.0%
Taylor expanded in t around inf 93.0%
Final simplification66.4%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ 1.0 x))) (t_2 (- t_1 (sqrt x))))
(if (<= y 7.2e-32)
(+
t_2
(+ 1.0 (+ (- (sqrt (+ 1.0 t)) (sqrt t)) (- (sqrt (+ 1.0 z)) (sqrt z)))))
(if (<= y 2e+30)
(+ (/ 1.0 (+ (sqrt (+ 1.0 y)) (sqrt y))) t_2)
(/ 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 = t_1 - sqrt(x);
double tmp;
if (y <= 7.2e-32) {
tmp = t_2 + (1.0 + ((sqrt((1.0 + t)) - sqrt(t)) + (sqrt((1.0 + z)) - sqrt(z))));
} else if (y <= 2e+30) {
tmp = (1.0 / (sqrt((1.0 + y)) + sqrt(y))) + t_2;
} 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 = t_1 - sqrt(x)
if (y <= 7.2d-32) then
tmp = t_2 + (1.0d0 + ((sqrt((1.0d0 + t)) - sqrt(t)) + (sqrt((1.0d0 + z)) - sqrt(z))))
else if (y <= 2d+30) then
tmp = (1.0d0 / (sqrt((1.0d0 + y)) + sqrt(y))) + t_2
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 = t_1 - Math.sqrt(x);
double tmp;
if (y <= 7.2e-32) {
tmp = t_2 + (1.0 + ((Math.sqrt((1.0 + t)) - Math.sqrt(t)) + (Math.sqrt((1.0 + z)) - Math.sqrt(z))));
} else if (y <= 2e+30) {
tmp = (1.0 / (Math.sqrt((1.0 + y)) + Math.sqrt(y))) + t_2;
} 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 = t_1 - math.sqrt(x) tmp = 0 if y <= 7.2e-32: tmp = t_2 + (1.0 + ((math.sqrt((1.0 + t)) - math.sqrt(t)) + (math.sqrt((1.0 + z)) - math.sqrt(z)))) elif y <= 2e+30: tmp = (1.0 / (math.sqrt((1.0 + y)) + math.sqrt(y))) + t_2 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 = Float64(t_1 - sqrt(x)) tmp = 0.0 if (y <= 7.2e-32) tmp = Float64(t_2 + Float64(1.0 + Float64(Float64(sqrt(Float64(1.0 + t)) - sqrt(t)) + Float64(sqrt(Float64(1.0 + z)) - sqrt(z))))); elseif (y <= 2e+30) tmp = Float64(Float64(1.0 / Float64(sqrt(Float64(1.0 + y)) + sqrt(y))) + t_2); 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 = t_1 - sqrt(x);
tmp = 0.0;
if (y <= 7.2e-32)
tmp = t_2 + (1.0 + ((sqrt((1.0 + t)) - sqrt(t)) + (sqrt((1.0 + z)) - sqrt(z))));
elseif (y <= 2e+30)
tmp = (1.0 / (sqrt((1.0 + y)) + sqrt(y))) + t_2;
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[(t$95$1 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 7.2e-32], N[(t$95$2 + N[(1.0 + N[(N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2e+30], N[(N[(1.0 / N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$2), $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 := t_1 - \sqrt{x}\\
\mathbf{if}\;y \leq 7.2 \cdot 10^{-32}:\\
\;\;\;\;t_2 + \left(1 + \left(\left(\sqrt{1 + t} - \sqrt{t}\right) + \left(\sqrt{1 + z} - \sqrt{z}\right)\right)\right)\\
\mathbf{elif}\;y \leq 2 \cdot 10^{+30}:\\
\;\;\;\;\frac{1}{\sqrt{1 + y} + \sqrt{y}} + t_2\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{x} + t_1}\\
\end{array}
\end{array}
if y < 7.19999999999999986e-32Initial program 96.1%
associate-+l+96.1%
associate-+l+96.1%
+-commutative96.1%
+-commutative96.1%
+-commutative96.1%
Simplified96.1%
Taylor expanded in y around 0 96.1%
if 7.19999999999999986e-32 < y < 2e30Initial program 90.7%
associate-+l+90.7%
associate-+l+90.7%
+-commutative90.7%
+-commutative90.7%
+-commutative90.7%
Simplified90.7%
flip--92.0%
add-sqr-sqrt85.4%
add-sqr-sqrt92.0%
Applied egg-rr91.5%
associate--l+96.1%
+-inverses96.1%
metadata-eval96.1%
Simplified94.6%
Taylor expanded in t around inf 41.3%
Taylor expanded in z around inf 17.2%
+-commutative17.2%
+-commutative17.2%
associate--l+25.0%
+-commutative25.0%
+-commutative25.0%
Simplified25.0%
if 2e30 < y Initial program 88.3%
associate-+l+88.3%
+-commutative88.3%
associate-+r-88.3%
associate-+l-45.6%
+-commutative45.6%
+-commutative45.6%
associate--l+45.6%
Simplified27.3%
Taylor expanded in t around inf 28.8%
associate--l+29.8%
+-commutative29.8%
Simplified29.8%
Taylor expanded in z around inf 16.8%
+-commutative16.8%
Simplified16.8%
Taylor expanded in y around inf 17.0%
flip--17.0%
add-sqr-sqrt17.4%
add-sqr-sqrt17.1%
Applied egg-rr17.1%
associate--l+21.6%
+-inverses21.6%
metadata-eval21.6%
Simplified21.6%
Final simplification57.4%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ 1.0 z))))
(if (<= t 8.5e+15)
(+ 2.0 (+ t_1 (- (hypot 1.0 (sqrt t)) (+ (sqrt z) (sqrt t)))))
(+
(/ 1.0 (+ (sqrt x) (sqrt (+ 1.0 x))))
(- (- (sqrt (+ 1.0 y)) (sqrt y)) (- (sqrt z) t_1))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + z));
double tmp;
if (t <= 8.5e+15) {
tmp = 2.0 + (t_1 + (hypot(1.0, sqrt(t)) - (sqrt(z) + sqrt(t))));
} else {
tmp = (1.0 / (sqrt(x) + sqrt((1.0 + x)))) + ((sqrt((1.0 + y)) - sqrt(y)) - (sqrt(z) - t_1));
}
return tmp;
}
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + z));
double tmp;
if (t <= 8.5e+15) {
tmp = 2.0 + (t_1 + (Math.hypot(1.0, Math.sqrt(t)) - (Math.sqrt(z) + Math.sqrt(t))));
} else {
tmp = (1.0 / (Math.sqrt(x) + Math.sqrt((1.0 + x)))) + ((Math.sqrt((1.0 + y)) - Math.sqrt(y)) - (Math.sqrt(z) - t_1));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + z)) tmp = 0 if t <= 8.5e+15: tmp = 2.0 + (t_1 + (math.hypot(1.0, math.sqrt(t)) - (math.sqrt(z) + math.sqrt(t)))) else: tmp = (1.0 / (math.sqrt(x) + math.sqrt((1.0 + x)))) + ((math.sqrt((1.0 + y)) - math.sqrt(y)) - (math.sqrt(z) - t_1)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(1.0 + z)) tmp = 0.0 if (t <= 8.5e+15) tmp = Float64(2.0 + Float64(t_1 + Float64(hypot(1.0, sqrt(t)) - Float64(sqrt(z) + sqrt(t))))); else tmp = Float64(Float64(1.0 / Float64(sqrt(x) + sqrt(Float64(1.0 + x)))) + Float64(Float64(sqrt(Float64(1.0 + y)) - sqrt(y)) - Float64(sqrt(z) - t_1))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + z));
tmp = 0.0;
if (t <= 8.5e+15)
tmp = 2.0 + (t_1 + (hypot(1.0, sqrt(t)) - (sqrt(z) + sqrt(t))));
else
tmp = (1.0 / (sqrt(x) + sqrt((1.0 + x)))) + ((sqrt((1.0 + y)) - sqrt(y)) - (sqrt(z) - t_1));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t, 8.5e+15], N[(2.0 + N[(t$95$1 + N[(N[Sqrt[1.0 ^ 2 + N[Sqrt[t], $MachinePrecision] ^ 2], $MachinePrecision] - N[(N[Sqrt[z], $MachinePrecision] + N[Sqrt[t], $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[(N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[z], $MachinePrecision] - t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + z}\\
\mathbf{if}\;t \leq 8.5 \cdot 10^{+15}:\\
\;\;\;\;2 + \left(t_1 + \left(\mathsf{hypot}\left(1, \sqrt{t}\right) - \left(\sqrt{z} + \sqrt{t}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{x} + \sqrt{1 + x}} + \left(\left(\sqrt{1 + y} - \sqrt{y}\right) - \left(\sqrt{z} - t_1\right)\right)\\
\end{array}
\end{array}
if t < 8.5e15Initial program 97.4%
associate-+l+97.4%
+-commutative97.4%
associate-+r-79.6%
associate-+l-49.8%
+-commutative49.8%
+-commutative49.8%
associate--l+49.8%
Simplified48.8%
Taylor expanded in y around 0 18.3%
associate--l+38.6%
+-commutative38.6%
associate--l+38.6%
+-commutative38.6%
+-commutative38.6%
+-commutative38.6%
+-commutative38.6%
Simplified38.6%
expm1-log1p-u18.3%
Applied egg-rr18.3%
Taylor expanded in x around 0 21.1%
associate--l+43.9%
+-commutative43.9%
associate--l+43.9%
rem-square-sqrt43.9%
hypot-1-def43.9%
Simplified43.9%
if 8.5e15 < t Initial program 86.1%
associate-+l+86.1%
associate-+l+86.1%
+-commutative86.1%
+-commutative86.1%
+-commutative86.1%
Simplified86.1%
flip--86.1%
add-sqr-sqrt70.5%
add-sqr-sqrt86.7%
Applied egg-rr86.7%
+-commutative86.7%
associate--l+90.1%
+-inverses90.1%
metadata-eval90.1%
+-commutative90.1%
+-commutative90.1%
Simplified90.1%
Taylor expanded in t around inf 90.1%
Final simplification65.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))))
(if (<= z 1e-43)
(+ 2.0 (+ t_2 (- (hypot 1.0 (sqrt t)) (+ (sqrt z) (sqrt t)))))
(if (<= z 6.8e+19)
(+ t_1 (- 1.0 (+ (sqrt x) (/ -1.0 (+ (sqrt z) t_2)))))
(+ (/ 1.0 (+ (sqrt (+ 1.0 y)) (sqrt y))) (- t_1 (sqrt x)))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + x));
double t_2 = sqrt((1.0 + z));
double tmp;
if (z <= 1e-43) {
tmp = 2.0 + (t_2 + (hypot(1.0, sqrt(t)) - (sqrt(z) + sqrt(t))));
} else if (z <= 6.8e+19) {
tmp = t_1 + (1.0 - (sqrt(x) + (-1.0 / (sqrt(z) + t_2))));
} else {
tmp = (1.0 / (sqrt((1.0 + y)) + sqrt(y))) + (t_1 - sqrt(x));
}
return tmp;
}
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + x));
double t_2 = Math.sqrt((1.0 + z));
double tmp;
if (z <= 1e-43) {
tmp = 2.0 + (t_2 + (Math.hypot(1.0, Math.sqrt(t)) - (Math.sqrt(z) + Math.sqrt(t))));
} else if (z <= 6.8e+19) {
tmp = t_1 + (1.0 - (Math.sqrt(x) + (-1.0 / (Math.sqrt(z) + t_2))));
} else {
tmp = (1.0 / (Math.sqrt((1.0 + y)) + Math.sqrt(y))) + (t_1 - Math.sqrt(x));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + x)) t_2 = math.sqrt((1.0 + z)) tmp = 0 if z <= 1e-43: tmp = 2.0 + (t_2 + (math.hypot(1.0, math.sqrt(t)) - (math.sqrt(z) + math.sqrt(t)))) elif z <= 6.8e+19: tmp = t_1 + (1.0 - (math.sqrt(x) + (-1.0 / (math.sqrt(z) + t_2)))) else: tmp = (1.0 / (math.sqrt((1.0 + y)) + math.sqrt(y))) + (t_1 - math.sqrt(x)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(1.0 + x)) t_2 = sqrt(Float64(1.0 + z)) tmp = 0.0 if (z <= 1e-43) tmp = Float64(2.0 + Float64(t_2 + Float64(hypot(1.0, sqrt(t)) - Float64(sqrt(z) + sqrt(t))))); elseif (z <= 6.8e+19) tmp = Float64(t_1 + Float64(1.0 - Float64(sqrt(x) + Float64(-1.0 / Float64(sqrt(z) + t_2))))); else tmp = Float64(Float64(1.0 / Float64(sqrt(Float64(1.0 + y)) + sqrt(y))) + Float64(t_1 - sqrt(x))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + x));
t_2 = sqrt((1.0 + z));
tmp = 0.0;
if (z <= 1e-43)
tmp = 2.0 + (t_2 + (hypot(1.0, sqrt(t)) - (sqrt(z) + sqrt(t))));
elseif (z <= 6.8e+19)
tmp = t_1 + (1.0 - (sqrt(x) + (-1.0 / (sqrt(z) + t_2))));
else
tmp = (1.0 / (sqrt((1.0 + y)) + sqrt(y))) + (t_1 - sqrt(x));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[z, 1e-43], N[(2.0 + N[(t$95$2 + N[(N[Sqrt[1.0 ^ 2 + N[Sqrt[t], $MachinePrecision] ^ 2], $MachinePrecision] - N[(N[Sqrt[z], $MachinePrecision] + N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 6.8e+19], N[(t$95$1 + N[(1.0 - N[(N[Sqrt[x], $MachinePrecision] + N[(-1.0 / N[(N[Sqrt[z], $MachinePrecision] + t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$1 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + x}\\
t_2 := \sqrt{1 + z}\\
\mathbf{if}\;z \leq 10^{-43}:\\
\;\;\;\;2 + \left(t_2 + \left(\mathsf{hypot}\left(1, \sqrt{t}\right) - \left(\sqrt{z} + \sqrt{t}\right)\right)\right)\\
\mathbf{elif}\;z \leq 6.8 \cdot 10^{+19}:\\
\;\;\;\;t_1 + \left(1 - \left(\sqrt{x} + \frac{-1}{\sqrt{z} + t_2}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{1 + y} + \sqrt{y}} + \left(t_1 - \sqrt{x}\right)\\
\end{array}
\end{array}
if z < 1.00000000000000008e-43Initial program 97.0%
associate-+l+97.0%
+-commutative97.0%
associate-+r-77.0%
associate-+l-46.5%
+-commutative46.5%
+-commutative46.5%
associate--l+46.5%
Simplified28.7%
Taylor expanded in y around 0 19.2%
associate--l+39.3%
+-commutative39.3%
associate--l+42.3%
+-commutative42.3%
+-commutative42.3%
+-commutative42.3%
+-commutative42.3%
Simplified42.3%
expm1-log1p-u18.5%
Applied egg-rr18.5%
Taylor expanded in x around 0 22.6%
associate--l+46.8%
+-commutative46.8%
associate--l+37.3%
rem-square-sqrt37.3%
hypot-1-def37.3%
Simplified37.3%
if 1.00000000000000008e-43 < z < 6.8e19Initial program 85.7%
associate-+l+85.7%
+-commutative85.7%
associate-+r-69.6%
associate-+l-44.5%
+-commutative44.5%
+-commutative44.5%
associate--l+44.5%
Simplified33.3%
Taylor expanded in t around inf 26.1%
associate--l+26.1%
+-commutative26.1%
Simplified26.1%
Taylor expanded in y around 0 23.8%
flip--24.7%
add-sqr-sqrt24.7%
add-sqr-sqrt24.8%
+-commutative24.8%
+-commutative24.8%
Applied egg-rr24.8%
+-commutative24.8%
associate--r+24.8%
+-inverses24.8%
metadata-eval24.8%
+-commutative24.8%
Simplified24.8%
if 6.8e19 < z Initial program 88.6%
associate-+l+88.6%
associate-+l+88.6%
+-commutative88.6%
+-commutative88.6%
+-commutative88.6%
Simplified88.6%
flip--92.2%
add-sqr-sqrt78.4%
add-sqr-sqrt92.2%
Applied egg-rr88.8%
associate--l+95.2%
+-inverses95.2%
metadata-eval95.2%
Simplified91.9%
Taylor expanded in t around inf 43.9%
Taylor expanded in z around inf 29.0%
+-commutative29.0%
+-commutative29.0%
associate--l+43.9%
+-commutative43.9%
+-commutative43.9%
Simplified43.9%
Final simplification39.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 x))))
(if (<= y 4.4e-32)
(+ t_1 (- 1.0 (+ (sqrt x) (- (sqrt z) (sqrt (+ 1.0 z))))))
(if (<= y 1e+33)
(+ (/ 1.0 (+ (sqrt (+ 1.0 y)) (sqrt y))) (- t_1 (sqrt x)))
(/ 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 tmp;
if (y <= 4.4e-32) {
tmp = t_1 + (1.0 - (sqrt(x) + (sqrt(z) - sqrt((1.0 + z)))));
} else if (y <= 1e+33) {
tmp = (1.0 / (sqrt((1.0 + y)) + sqrt(y))) + (t_1 - sqrt(x));
} 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) :: tmp
t_1 = sqrt((1.0d0 + x))
if (y <= 4.4d-32) then
tmp = t_1 + (1.0d0 - (sqrt(x) + (sqrt(z) - sqrt((1.0d0 + z)))))
else if (y <= 1d+33) then
tmp = (1.0d0 / (sqrt((1.0d0 + y)) + sqrt(y))) + (t_1 - sqrt(x))
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 tmp;
if (y <= 4.4e-32) {
tmp = t_1 + (1.0 - (Math.sqrt(x) + (Math.sqrt(z) - Math.sqrt((1.0 + z)))));
} else if (y <= 1e+33) {
tmp = (1.0 / (Math.sqrt((1.0 + y)) + Math.sqrt(y))) + (t_1 - Math.sqrt(x));
} 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)) tmp = 0 if y <= 4.4e-32: tmp = t_1 + (1.0 - (math.sqrt(x) + (math.sqrt(z) - math.sqrt((1.0 + z))))) elif y <= 1e+33: tmp = (1.0 / (math.sqrt((1.0 + y)) + math.sqrt(y))) + (t_1 - math.sqrt(x)) 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)) tmp = 0.0 if (y <= 4.4e-32) tmp = Float64(t_1 + Float64(1.0 - Float64(sqrt(x) + Float64(sqrt(z) - sqrt(Float64(1.0 + z)))))); elseif (y <= 1e+33) tmp = Float64(Float64(1.0 / Float64(sqrt(Float64(1.0 + y)) + sqrt(y))) + Float64(t_1 - sqrt(x))); 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));
tmp = 0.0;
if (y <= 4.4e-32)
tmp = t_1 + (1.0 - (sqrt(x) + (sqrt(z) - sqrt((1.0 + z)))));
elseif (y <= 1e+33)
tmp = (1.0 / (sqrt((1.0 + y)) + sqrt(y))) + (t_1 - sqrt(x));
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]}, If[LessEqual[y, 4.4e-32], N[(t$95$1 + N[(1.0 - N[(N[Sqrt[x], $MachinePrecision] + N[(N[Sqrt[z], $MachinePrecision] - N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1e+33], N[(N[(1.0 / N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$1 - N[Sqrt[x], $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}\\
\mathbf{if}\;y \leq 4.4 \cdot 10^{-32}:\\
\;\;\;\;t_1 + \left(1 - \left(\sqrt{x} + \left(\sqrt{z} - \sqrt{1 + z}\right)\right)\right)\\
\mathbf{elif}\;y \leq 10^{+33}:\\
\;\;\;\;\frac{1}{\sqrt{1 + y} + \sqrt{y}} + \left(t_1 - \sqrt{x}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{x} + t_1}\\
\end{array}
\end{array}
if y < 4.4e-32Initial program 96.1%
associate-+l+96.1%
+-commutative96.1%
associate-+r-60.5%
associate-+l-55.1%
+-commutative55.1%
+-commutative55.1%
associate--l+55.1%
Simplified39.4%
Taylor expanded in t around inf 30.5%
associate--l+30.9%
+-commutative30.9%
Simplified30.9%
Taylor expanded in y around 0 30.9%
if 4.4e-32 < y < 9.9999999999999995e32Initial program 90.2%
associate-+l+90.2%
associate-+l+90.2%
+-commutative90.2%
+-commutative90.2%
+-commutative90.2%
Simplified90.2%
flip--91.4%
add-sqr-sqrt80.2%
add-sqr-sqrt91.4%
Applied egg-rr90.9%
associate--l+95.1%
+-inverses95.1%
metadata-eval95.1%
Simplified93.8%
Taylor expanded in t around inf 41.5%
Taylor expanded in z around inf 18.7%
+-commutative18.7%
+-commutative18.7%
associate--l+26.2%
+-commutative26.2%
+-commutative26.2%
Simplified26.2%
if 9.9999999999999995e32 < y Initial program 88.4%
associate-+l+88.4%
+-commutative88.4%
associate-+r-88.4%
associate-+l-45.8%
+-commutative45.8%
+-commutative45.8%
associate--l+45.8%
Simplified27.7%
Taylor expanded in t around inf 28.9%
associate--l+29.6%
+-commutative29.6%
Simplified29.6%
Taylor expanded in z around inf 16.7%
+-commutative16.7%
Simplified16.7%
Taylor expanded in y around inf 16.7%
flip--16.7%
add-sqr-sqrt17.1%
add-sqr-sqrt16.8%
Applied egg-rr16.8%
associate--l+21.3%
+-inverses21.3%
metadata-eval21.3%
Simplified21.3%
Final simplification26.4%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ 1.0 x))))
(if (<= y 7.2e-32)
(+ t_1 (- 1.0 (+ (sqrt x) (/ -1.0 (+ (sqrt z) (sqrt (+ 1.0 z)))))))
(if (<= y 2e+30)
(+ (/ 1.0 (+ (sqrt (+ 1.0 y)) (sqrt y))) (- t_1 (sqrt x)))
(/ 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 tmp;
if (y <= 7.2e-32) {
tmp = t_1 + (1.0 - (sqrt(x) + (-1.0 / (sqrt(z) + sqrt((1.0 + z))))));
} else if (y <= 2e+30) {
tmp = (1.0 / (sqrt((1.0 + y)) + sqrt(y))) + (t_1 - sqrt(x));
} 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) :: tmp
t_1 = sqrt((1.0d0 + x))
if (y <= 7.2d-32) then
tmp = t_1 + (1.0d0 - (sqrt(x) + ((-1.0d0) / (sqrt(z) + sqrt((1.0d0 + z))))))
else if (y <= 2d+30) then
tmp = (1.0d0 / (sqrt((1.0d0 + y)) + sqrt(y))) + (t_1 - sqrt(x))
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 tmp;
if (y <= 7.2e-32) {
tmp = t_1 + (1.0 - (Math.sqrt(x) + (-1.0 / (Math.sqrt(z) + Math.sqrt((1.0 + z))))));
} else if (y <= 2e+30) {
tmp = (1.0 / (Math.sqrt((1.0 + y)) + Math.sqrt(y))) + (t_1 - Math.sqrt(x));
} 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)) tmp = 0 if y <= 7.2e-32: tmp = t_1 + (1.0 - (math.sqrt(x) + (-1.0 / (math.sqrt(z) + math.sqrt((1.0 + z)))))) elif y <= 2e+30: tmp = (1.0 / (math.sqrt((1.0 + y)) + math.sqrt(y))) + (t_1 - math.sqrt(x)) 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)) tmp = 0.0 if (y <= 7.2e-32) tmp = Float64(t_1 + Float64(1.0 - Float64(sqrt(x) + Float64(-1.0 / Float64(sqrt(z) + sqrt(Float64(1.0 + z))))))); elseif (y <= 2e+30) tmp = Float64(Float64(1.0 / Float64(sqrt(Float64(1.0 + y)) + sqrt(y))) + Float64(t_1 - sqrt(x))); 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));
tmp = 0.0;
if (y <= 7.2e-32)
tmp = t_1 + (1.0 - (sqrt(x) + (-1.0 / (sqrt(z) + sqrt((1.0 + z))))));
elseif (y <= 2e+30)
tmp = (1.0 / (sqrt((1.0 + y)) + sqrt(y))) + (t_1 - sqrt(x));
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]}, If[LessEqual[y, 7.2e-32], N[(t$95$1 + N[(1.0 - N[(N[Sqrt[x], $MachinePrecision] + N[(-1.0 / N[(N[Sqrt[z], $MachinePrecision] + N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2e+30], N[(N[(1.0 / N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$1 - N[Sqrt[x], $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}\\
\mathbf{if}\;y \leq 7.2 \cdot 10^{-32}:\\
\;\;\;\;t_1 + \left(1 - \left(\sqrt{x} + \frac{-1}{\sqrt{z} + \sqrt{1 + z}}\right)\right)\\
\mathbf{elif}\;y \leq 2 \cdot 10^{+30}:\\
\;\;\;\;\frac{1}{\sqrt{1 + y} + \sqrt{y}} + \left(t_1 - \sqrt{x}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{x} + t_1}\\
\end{array}
\end{array}
if y < 7.19999999999999986e-32Initial program 96.1%
associate-+l+96.1%
+-commutative96.1%
associate-+r-60.5%
associate-+l-55.1%
+-commutative55.1%
+-commutative55.1%
associate--l+55.1%
Simplified39.4%
Taylor expanded in t around inf 30.5%
associate--l+30.9%
+-commutative30.9%
Simplified30.9%
Taylor expanded in y around 0 30.9%
flip--31.1%
add-sqr-sqrt23.1%
add-sqr-sqrt31.1%
+-commutative31.1%
+-commutative31.1%
Applied egg-rr31.1%
+-commutative31.1%
associate--r+31.1%
+-inverses31.1%
metadata-eval31.1%
+-commutative31.1%
Simplified31.1%
if 7.19999999999999986e-32 < y < 2e30Initial program 90.7%
associate-+l+90.7%
associate-+l+90.7%
+-commutative90.7%
+-commutative90.7%
+-commutative90.7%
Simplified90.7%
flip--92.0%
add-sqr-sqrt85.4%
add-sqr-sqrt92.0%
Applied egg-rr91.5%
associate--l+96.1%
+-inverses96.1%
metadata-eval96.1%
Simplified94.6%
Taylor expanded in t around inf 41.3%
Taylor expanded in z around inf 17.2%
+-commutative17.2%
+-commutative17.2%
associate--l+25.0%
+-commutative25.0%
+-commutative25.0%
Simplified25.0%
if 2e30 < y Initial program 88.3%
associate-+l+88.3%
+-commutative88.3%
associate-+r-88.3%
associate-+l-45.6%
+-commutative45.6%
+-commutative45.6%
associate--l+45.6%
Simplified27.3%
Taylor expanded in t around inf 28.8%
associate--l+29.8%
+-commutative29.8%
Simplified29.8%
Taylor expanded in z around inf 16.8%
+-commutative16.8%
Simplified16.8%
Taylor expanded in y around inf 17.0%
flip--17.0%
add-sqr-sqrt17.4%
add-sqr-sqrt17.1%
Applied egg-rr17.1%
associate--l+21.6%
+-inverses21.6%
metadata-eval21.6%
Simplified21.6%
Final simplification26.4%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ 1.0 x))))
(if (<= y 6.4e-32)
(+ t_1 (- 1.0 (+ (sqrt x) (- (sqrt z) (sqrt (+ 1.0 z))))))
(if (<= y 5e+15)
(+ (sqrt (+ 1.0 y)) (- t_1 (+ (sqrt x) (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 tmp;
if (y <= 6.4e-32) {
tmp = t_1 + (1.0 - (sqrt(x) + (sqrt(z) - sqrt((1.0 + z)))));
} else if (y <= 5e+15) {
tmp = sqrt((1.0 + y)) + (t_1 - (sqrt(x) + 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) :: tmp
t_1 = sqrt((1.0d0 + x))
if (y <= 6.4d-32) then
tmp = t_1 + (1.0d0 - (sqrt(x) + (sqrt(z) - sqrt((1.0d0 + z)))))
else if (y <= 5d+15) then
tmp = sqrt((1.0d0 + y)) + (t_1 - (sqrt(x) + 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 tmp;
if (y <= 6.4e-32) {
tmp = t_1 + (1.0 - (Math.sqrt(x) + (Math.sqrt(z) - Math.sqrt((1.0 + z)))));
} else if (y <= 5e+15) {
tmp = Math.sqrt((1.0 + y)) + (t_1 - (Math.sqrt(x) + 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)) tmp = 0 if y <= 6.4e-32: tmp = t_1 + (1.0 - (math.sqrt(x) + (math.sqrt(z) - math.sqrt((1.0 + z))))) elif y <= 5e+15: tmp = math.sqrt((1.0 + y)) + (t_1 - (math.sqrt(x) + 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)) tmp = 0.0 if (y <= 6.4e-32) tmp = Float64(t_1 + Float64(1.0 - Float64(sqrt(x) + Float64(sqrt(z) - sqrt(Float64(1.0 + z)))))); elseif (y <= 5e+15) tmp = Float64(sqrt(Float64(1.0 + y)) + Float64(t_1 - Float64(sqrt(x) + 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));
tmp = 0.0;
if (y <= 6.4e-32)
tmp = t_1 + (1.0 - (sqrt(x) + (sqrt(z) - sqrt((1.0 + z)))));
elseif (y <= 5e+15)
tmp = sqrt((1.0 + y)) + (t_1 - (sqrt(x) + 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]}, If[LessEqual[y, 6.4e-32], N[(t$95$1 + N[(1.0 - N[(N[Sqrt[x], $MachinePrecision] + N[(N[Sqrt[z], $MachinePrecision] - N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 5e+15], N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] + N[(t$95$1 - N[(N[Sqrt[x], $MachinePrecision] + 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}\\
\mathbf{if}\;y \leq 6.4 \cdot 10^{-32}:\\
\;\;\;\;t_1 + \left(1 - \left(\sqrt{x} + \left(\sqrt{z} - \sqrt{1 + z}\right)\right)\right)\\
\mathbf{elif}\;y \leq 5 \cdot 10^{+15}:\\
\;\;\;\;\sqrt{1 + y} + \left(t_1 - \left(\sqrt{x} + \sqrt{y}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{x} + t_1}\\
\end{array}
\end{array}
if y < 6.4000000000000004e-32Initial program 96.1%
associate-+l+96.1%
+-commutative96.1%
associate-+r-60.5%
associate-+l-55.1%
+-commutative55.1%
+-commutative55.1%
associate--l+55.1%
Simplified39.4%
Taylor expanded in t around inf 30.5%
associate--l+30.9%
+-commutative30.9%
Simplified30.9%
Taylor expanded in y around 0 30.9%
if 6.4000000000000004e-32 < y < 5e15Initial program 93.9%
associate-+l+93.9%
+-commutative93.9%
associate-+r-56.8%
associate-+l-48.4%
+-commutative48.4%
+-commutative48.4%
associate--l+48.4%
Simplified44.5%
Taylor expanded in t around inf 19.6%
associate--l+19.6%
+-commutative19.6%
Simplified19.6%
Taylor expanded in z around inf 14.9%
+-commutative14.9%
Simplified14.9%
associate-+r-14.9%
+-commutative14.9%
Applied egg-rr14.9%
+-commutative14.9%
associate--l+21.9%
+-commutative21.9%
Simplified21.9%
if 5e15 < y Initial program 87.9%
associate-+l+87.9%
+-commutative87.9%
associate-+r-87.9%
associate-+l-45.0%
+-commutative45.0%
+-commutative45.0%
associate--l+45.0%
Simplified26.8%
Taylor expanded in t around inf 28.4%
associate--l+29.3%
+-commutative29.3%
Simplified29.3%
Taylor expanded in z around inf 17.0%
+-commutative17.0%
Simplified17.0%
Taylor expanded in y around inf 17.1%
flip--17.1%
add-sqr-sqrt17.5%
add-sqr-sqrt17.2%
Applied egg-rr17.2%
associate--l+21.6%
+-inverses21.6%
metadata-eval21.6%
Simplified21.6%
Final simplification26.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 (<= z 1.6e+14) (- (+ (sqrt (+ 1.0 z)) 2.0) (sqrt z)) (+ (sqrt (+ 1.0 x)) (- (sqrt (+ 1.0 y)) (+ (sqrt x) (sqrt y))))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (z <= 1.6e+14) {
tmp = (sqrt((1.0 + z)) + 2.0) - sqrt(z);
} else {
tmp = sqrt((1.0 + x)) + (sqrt((1.0 + y)) - (sqrt(x) + sqrt(y)));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (z <= 1.6d+14) then
tmp = (sqrt((1.0d0 + z)) + 2.0d0) - sqrt(z)
else
tmp = sqrt((1.0d0 + x)) + (sqrt((1.0d0 + y)) - (sqrt(x) + sqrt(y)))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= 1.6e+14) {
tmp = (Math.sqrt((1.0 + z)) + 2.0) - Math.sqrt(z);
} else {
tmp = Math.sqrt((1.0 + x)) + (Math.sqrt((1.0 + y)) - (Math.sqrt(x) + Math.sqrt(y)));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if z <= 1.6e+14: tmp = (math.sqrt((1.0 + z)) + 2.0) - math.sqrt(z) else: tmp = math.sqrt((1.0 + x)) + (math.sqrt((1.0 + y)) - (math.sqrt(x) + math.sqrt(y))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (z <= 1.6e+14) tmp = Float64(Float64(sqrt(Float64(1.0 + z)) + 2.0) - sqrt(z)); else tmp = Float64(sqrt(Float64(1.0 + x)) + Float64(sqrt(Float64(1.0 + y)) - Float64(sqrt(x) + sqrt(y)))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (z <= 1.6e+14)
tmp = (sqrt((1.0 + z)) + 2.0) - sqrt(z);
else
tmp = sqrt((1.0 + x)) + (sqrt((1.0 + y)) - (sqrt(x) + sqrt(y)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[z, 1.6e+14], N[(N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] + 2.0), $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision] + N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] - N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq 1.6 \cdot 10^{+14}:\\
\;\;\;\;\left(\sqrt{1 + z} + 2\right) - \sqrt{z}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{1 + x} + \left(\sqrt{1 + y} - \left(\sqrt{x} + \sqrt{y}\right)\right)\\
\end{array}
\end{array}
if z < 1.6e14Initial program 95.3%
associate-+l+95.3%
+-commutative95.3%
associate-+r-75.9%
associate-+l-46.1%
+-commutative46.1%
+-commutative46.1%
associate--l+46.1%
Simplified29.2%
Taylor expanded in t around inf 29.9%
associate--l+29.9%
+-commutative29.9%
Simplified29.9%
Taylor expanded in y around 0 24.8%
Taylor expanded in x around 0 40.8%
+-commutative40.8%
Simplified40.8%
if 1.6e14 < z Initial program 88.4%
associate-+l+88.4%
+-commutative88.4%
associate-+r-68.7%
associate-+l-55.0%
+-commutative55.0%
+-commutative55.0%
associate--l+55.0%
Simplified40.1%
Taylor expanded in t around inf 27.3%
associate--l+28.6%
+-commutative28.6%
Simplified28.6%
Taylor expanded in z around inf 27.9%
+-commutative27.9%
Simplified27.9%
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 x)) (sqrt x)))) (if (<= y 800.0) (+ 1.0 t_1) t_1)))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + x)) - sqrt(x);
double tmp;
if (y <= 800.0) {
tmp = 1.0 + t_1;
} else {
tmp = t_1;
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = sqrt((1.0d0 + x)) - sqrt(x)
if (y <= 800.0d0) then
tmp = 1.0d0 + t_1
else
tmp = t_1
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + x)) - Math.sqrt(x);
double tmp;
if (y <= 800.0) {
tmp = 1.0 + t_1;
} else {
tmp = t_1;
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + x)) - math.sqrt(x) tmp = 0 if y <= 800.0: tmp = 1.0 + t_1 else: tmp = t_1 return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = Float64(sqrt(Float64(1.0 + x)) - sqrt(x)) tmp = 0.0 if (y <= 800.0) tmp = Float64(1.0 + t_1); else tmp = t_1; end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + x)) - sqrt(x);
tmp = 0.0;
if (y <= 800.0)
tmp = 1.0 + t_1;
else
tmp = t_1;
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 800.0], N[(1.0 + t$95$1), $MachinePrecision], t$95$1]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + x} - \sqrt{x}\\
\mathbf{if}\;y \leq 800:\\
\;\;\;\;1 + t_1\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if y < 800Initial program 96.2%
associate-+l+96.2%
+-commutative96.2%
associate-+r-60.1%
associate-+l-54.5%
+-commutative54.5%
+-commutative54.5%
associate--l+54.5%
Simplified39.8%
Taylor expanded in t around inf 29.1%
associate--l+29.5%
+-commutative29.5%
Simplified29.5%
Taylor expanded in z around inf 19.5%
+-commutative19.5%
Simplified19.5%
Taylor expanded in y around 0 19.5%
associate--l+33.4%
Simplified33.4%
if 800 < y Initial program 87.7%
associate-+l+87.7%
+-commutative87.7%
associate-+r-86.9%
associate-+l-45.0%
+-commutative45.0%
+-commutative45.0%
associate--l+45.0%
Simplified27.6%
Taylor expanded in t around inf 28.4%
associate--l+29.2%
+-commutative29.2%
Simplified29.2%
Taylor expanded in z around inf 17.3%
+-commutative17.3%
Simplified17.3%
Taylor expanded in y around inf 17.0%
Final simplification25.7%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= z 1.6e+14) (+ (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 <= 1.6e+14) {
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 <= 1.6d+14) 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 <= 1.6e+14) {
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 <= 1.6e+14: 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 <= 1.6e+14) tmp = Float64(sqrt(Float64(1.0 + z)) + Float64(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 <= 1.6e+14)
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, 1.6e+14], N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] + N[(2.0 - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq 1.6 \cdot 10^{+14}:\\
\;\;\;\;\sqrt{1 + z} + \left(2 - \sqrt{z}\right)\\
\mathbf{else}:\\
\;\;\;\;1 + \left(\sqrt{1 + y} - \sqrt{y}\right)\\
\end{array}
\end{array}
if z < 1.6e14Initial program 95.3%
associate-+l+95.3%
+-commutative95.3%
associate-+r-75.9%
associate-+l-46.1%
+-commutative46.1%
+-commutative46.1%
associate--l+46.1%
Simplified29.2%
Taylor expanded in t around inf 29.9%
associate--l+29.9%
+-commutative29.9%
Simplified29.9%
Taylor expanded in y around 0 24.8%
Taylor expanded in x around 0 40.8%
+-commutative40.8%
associate--l+40.8%
Simplified40.8%
if 1.6e14 < z Initial program 88.4%
associate-+l+88.4%
+-commutative88.4%
associate-+r-68.7%
associate-+l-55.0%
+-commutative55.0%
+-commutative55.0%
associate--l+55.0%
Simplified40.1%
Taylor expanded in t around inf 27.3%
associate--l+28.6%
+-commutative28.6%
Simplified28.6%
Taylor expanded in z around inf 27.9%
+-commutative27.9%
Simplified27.9%
Taylor expanded in x around 0 31.9%
associate--l+52.6%
Simplified52.6%
Final simplification46.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 (<= z 1.7e+14) (- (+ (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 <= 1.7e+14) {
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 <= 1.7d+14) 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 <= 1.7e+14) {
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 <= 1.7e+14: 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 <= 1.7e+14) 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 <= 1.7e+14)
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, 1.7e+14], 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 1.7 \cdot 10^{+14}:\\
\;\;\;\;\left(\sqrt{1 + z} + 2\right) - \sqrt{z}\\
\mathbf{else}:\\
\;\;\;\;1 + \left(\sqrt{1 + y} - \sqrt{y}\right)\\
\end{array}
\end{array}
if z < 1.7e14Initial program 95.3%
associate-+l+95.3%
+-commutative95.3%
associate-+r-75.9%
associate-+l-46.1%
+-commutative46.1%
+-commutative46.1%
associate--l+46.1%
Simplified29.2%
Taylor expanded in t around inf 29.9%
associate--l+29.9%
+-commutative29.9%
Simplified29.9%
Taylor expanded in y around 0 24.8%
Taylor expanded in x around 0 40.8%
+-commutative40.8%
Simplified40.8%
if 1.7e14 < z Initial program 88.4%
associate-+l+88.4%
+-commutative88.4%
associate-+r-68.7%
associate-+l-55.0%
+-commutative55.0%
+-commutative55.0%
associate--l+55.0%
Simplified40.1%
Taylor expanded in t around inf 27.3%
associate--l+28.6%
+-commutative28.6%
Simplified28.6%
Taylor expanded in z around inf 27.9%
+-commutative27.9%
Simplified27.9%
Taylor expanded in x around 0 31.9%
associate--l+52.6%
Simplified52.6%
Final simplification46.1%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (+ 1.0 (- (sqrt (+ 1.0 y)) (sqrt y))))
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 92.2%
associate-+l+92.2%
+-commutative92.2%
associate-+r-72.7%
associate-+l-50.0%
+-commutative50.0%
+-commutative50.0%
associate--l+50.0%
Simplified34.1%
Taylor expanded in t around inf 28.8%
associate--l+29.4%
+-commutative29.4%
Simplified29.4%
Taylor expanded in z around inf 18.5%
+-commutative18.5%
Simplified18.5%
Taylor expanded in x around 0 26.9%
associate--l+44.1%
Simplified44.1%
Final simplification44.1%
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 92.2%
associate-+l+92.2%
+-commutative92.2%
associate-+r-72.7%
associate-+l-50.0%
+-commutative50.0%
+-commutative50.0%
associate--l+50.0%
Simplified34.1%
Taylor expanded in t around inf 28.8%
associate--l+29.4%
+-commutative29.4%
Simplified29.4%
Taylor expanded in z around inf 18.5%
+-commutative18.5%
Simplified18.5%
Taylor expanded in y around inf 13.7%
Final simplification13.7%
(FPCore (x y z t)
:precision binary64
(+
(+
(+
(/ 1.0 (+ (sqrt (+ x 1.0)) (sqrt x)))
(/ 1.0 (+ (sqrt (+ y 1.0)) (sqrt y))))
(/ 1.0 (+ (sqrt (+ z 1.0)) (sqrt z))))
(- (sqrt (+ t 1.0)) (sqrt t))))
double code(double x, double y, double z, double t) {
return (((1.0 / (sqrt((x + 1.0)) + sqrt(x))) + (1.0 / (sqrt((y + 1.0)) + sqrt(y)))) + (1.0 / (sqrt((z + 1.0)) + sqrt(z)))) + (sqrt((t + 1.0)) - sqrt(t));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (((1.0d0 / (sqrt((x + 1.0d0)) + sqrt(x))) + (1.0d0 / (sqrt((y + 1.0d0)) + sqrt(y)))) + (1.0d0 / (sqrt((z + 1.0d0)) + sqrt(z)))) + (sqrt((t + 1.0d0)) - sqrt(t))
end function
public static double code(double x, double y, double z, double t) {
return (((1.0 / (Math.sqrt((x + 1.0)) + Math.sqrt(x))) + (1.0 / (Math.sqrt((y + 1.0)) + Math.sqrt(y)))) + (1.0 / (Math.sqrt((z + 1.0)) + Math.sqrt(z)))) + (Math.sqrt((t + 1.0)) - Math.sqrt(t));
}
def code(x, y, z, t): return (((1.0 / (math.sqrt((x + 1.0)) + math.sqrt(x))) + (1.0 / (math.sqrt((y + 1.0)) + math.sqrt(y)))) + (1.0 / (math.sqrt((z + 1.0)) + math.sqrt(z)))) + (math.sqrt((t + 1.0)) - math.sqrt(t))
function code(x, y, z, t) return Float64(Float64(Float64(Float64(1.0 / Float64(sqrt(Float64(x + 1.0)) + sqrt(x))) + Float64(1.0 / Float64(sqrt(Float64(y + 1.0)) + sqrt(y)))) + Float64(1.0 / Float64(sqrt(Float64(z + 1.0)) + sqrt(z)))) + Float64(sqrt(Float64(t + 1.0)) - sqrt(t))) end
function tmp = code(x, y, z, t) tmp = (((1.0 / (sqrt((x + 1.0)) + sqrt(x))) + (1.0 / (sqrt((y + 1.0)) + sqrt(y)))) + (1.0 / (sqrt((z + 1.0)) + sqrt(z)))) + (sqrt((t + 1.0)) - sqrt(t)); end
code[x_, y_, z_, t_] := N[(N[(N[(N[(1.0 / N[(N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[N[(z + 1.0), $MachinePrecision]], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(t + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\frac{1}{\sqrt{x + 1} + \sqrt{x}} + \frac{1}{\sqrt{y + 1} + \sqrt{y}}\right) + \frac{1}{\sqrt{z + 1} + \sqrt{z}}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)
\end{array}
herbie shell --seed 2023271
(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))))