
(FPCore (x y z t) :precision binary64 (+ (+ (+ (- (sqrt (+ x 1.0)) (sqrt x)) (- (sqrt (+ y 1.0)) (sqrt y))) (- (sqrt (+ z 1.0)) (sqrt z))) (- (sqrt (+ t 1.0)) (sqrt t))))
double code(double x, double y, double z, double t) {
return (((sqrt((x + 1.0)) - sqrt(x)) + (sqrt((y + 1.0)) - sqrt(y))) + (sqrt((z + 1.0)) - sqrt(z))) + (sqrt((t + 1.0)) - sqrt(t));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (((sqrt((x + 1.0d0)) - sqrt(x)) + (sqrt((y + 1.0d0)) - sqrt(y))) + (sqrt((z + 1.0d0)) - sqrt(z))) + (sqrt((t + 1.0d0)) - sqrt(t))
end function
public static double code(double x, double y, double z, double t) {
return (((Math.sqrt((x + 1.0)) - Math.sqrt(x)) + (Math.sqrt((y + 1.0)) - Math.sqrt(y))) + (Math.sqrt((z + 1.0)) - Math.sqrt(z))) + (Math.sqrt((t + 1.0)) - Math.sqrt(t));
}
def code(x, y, z, t): return (((math.sqrt((x + 1.0)) - math.sqrt(x)) + (math.sqrt((y + 1.0)) - math.sqrt(y))) + (math.sqrt((z + 1.0)) - math.sqrt(z))) + (math.sqrt((t + 1.0)) - math.sqrt(t))
function code(x, y, z, t) return Float64(Float64(Float64(Float64(sqrt(Float64(x + 1.0)) - sqrt(x)) + Float64(sqrt(Float64(y + 1.0)) - sqrt(y))) + Float64(sqrt(Float64(z + 1.0)) - sqrt(z))) + Float64(sqrt(Float64(t + 1.0)) - sqrt(t))) end
function tmp = code(x, y, z, t) tmp = (((sqrt((x + 1.0)) - sqrt(x)) + (sqrt((y + 1.0)) - sqrt(y))) + (sqrt((z + 1.0)) - sqrt(z))) + (sqrt((t + 1.0)) - sqrt(t)); end
code[x_, y_, z_, t_] := N[(N[(N[(N[(N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(z + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(t + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{y + 1} - \sqrt{y}\right)\right) + \left(\sqrt{z + 1} - \sqrt{z}\right)\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 21 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (+ (+ (+ (- (sqrt (+ x 1.0)) (sqrt x)) (- (sqrt (+ y 1.0)) (sqrt y))) (- (sqrt (+ z 1.0)) (sqrt z))) (- (sqrt (+ t 1.0)) (sqrt t))))
double code(double x, double y, double z, double t) {
return (((sqrt((x + 1.0)) - sqrt(x)) + (sqrt((y + 1.0)) - sqrt(y))) + (sqrt((z + 1.0)) - sqrt(z))) + (sqrt((t + 1.0)) - sqrt(t));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (((sqrt((x + 1.0d0)) - sqrt(x)) + (sqrt((y + 1.0d0)) - sqrt(y))) + (sqrt((z + 1.0d0)) - sqrt(z))) + (sqrt((t + 1.0d0)) - sqrt(t))
end function
public static double code(double x, double y, double z, double t) {
return (((Math.sqrt((x + 1.0)) - Math.sqrt(x)) + (Math.sqrt((y + 1.0)) - Math.sqrt(y))) + (Math.sqrt((z + 1.0)) - Math.sqrt(z))) + (Math.sqrt((t + 1.0)) - Math.sqrt(t));
}
def code(x, y, z, t): return (((math.sqrt((x + 1.0)) - math.sqrt(x)) + (math.sqrt((y + 1.0)) - math.sqrt(y))) + (math.sqrt((z + 1.0)) - math.sqrt(z))) + (math.sqrt((t + 1.0)) - math.sqrt(t))
function code(x, y, z, t) return Float64(Float64(Float64(Float64(sqrt(Float64(x + 1.0)) - sqrt(x)) + Float64(sqrt(Float64(y + 1.0)) - sqrt(y))) + Float64(sqrt(Float64(z + 1.0)) - sqrt(z))) + Float64(sqrt(Float64(t + 1.0)) - sqrt(t))) end
function tmp = code(x, y, z, t) tmp = (((sqrt((x + 1.0)) - sqrt(x)) + (sqrt((y + 1.0)) - sqrt(y))) + (sqrt((z + 1.0)) - sqrt(z))) + (sqrt((t + 1.0)) - sqrt(t)); end
code[x_, y_, z_, t_] := N[(N[(N[(N[(N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(z + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(t + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{y + 1} - \sqrt{y}\right)\right) + \left(\sqrt{z + 1} - \sqrt{z}\right)\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)
\end{array}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ 1.0 x)))
(t_2 (sqrt (+ 1.0 z)))
(t_3 (/ 1.0 (+ t_2 (sqrt z))))
(t_4 (sqrt (+ 1.0 y))))
(if (<= (- t_2 (sqrt z)) 0.0005)
(+ (+ (/ 1.0 (+ (sqrt x) t_1)) (/ 1.0 (+ t_4 (sqrt y)))) t_3)
(+
(+ (- t_1 (sqrt x)) (- t_4 (sqrt y)))
(+ 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 + z));
double t_3 = 1.0 / (t_2 + sqrt(z));
double t_4 = sqrt((1.0 + y));
double tmp;
if ((t_2 - sqrt(z)) <= 0.0005) {
tmp = ((1.0 / (sqrt(x) + t_1)) + (1.0 / (t_4 + sqrt(y)))) + t_3;
} else {
tmp = ((t_1 - sqrt(x)) + (t_4 - sqrt(y))) + (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) :: t_4
real(8) :: tmp
t_1 = sqrt((1.0d0 + x))
t_2 = sqrt((1.0d0 + z))
t_3 = 1.0d0 / (t_2 + sqrt(z))
t_4 = sqrt((1.0d0 + y))
if ((t_2 - sqrt(z)) <= 0.0005d0) then
tmp = ((1.0d0 / (sqrt(x) + t_1)) + (1.0d0 / (t_4 + sqrt(y)))) + t_3
else
tmp = ((t_1 - sqrt(x)) + (t_4 - sqrt(y))) + (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 + z));
double t_3 = 1.0 / (t_2 + Math.sqrt(z));
double t_4 = Math.sqrt((1.0 + y));
double tmp;
if ((t_2 - Math.sqrt(z)) <= 0.0005) {
tmp = ((1.0 / (Math.sqrt(x) + t_1)) + (1.0 / (t_4 + Math.sqrt(y)))) + t_3;
} else {
tmp = ((t_1 - Math.sqrt(x)) + (t_4 - Math.sqrt(y))) + (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 + z)) t_3 = 1.0 / (t_2 + math.sqrt(z)) t_4 = math.sqrt((1.0 + y)) tmp = 0 if (t_2 - math.sqrt(z)) <= 0.0005: tmp = ((1.0 / (math.sqrt(x) + t_1)) + (1.0 / (t_4 + math.sqrt(y)))) + t_3 else: tmp = ((t_1 - math.sqrt(x)) + (t_4 - math.sqrt(y))) + (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 + z)) t_3 = Float64(1.0 / Float64(t_2 + sqrt(z))) t_4 = sqrt(Float64(1.0 + y)) tmp = 0.0 if (Float64(t_2 - sqrt(z)) <= 0.0005) tmp = Float64(Float64(Float64(1.0 / Float64(sqrt(x) + t_1)) + Float64(1.0 / Float64(t_4 + sqrt(y)))) + t_3); else tmp = Float64(Float64(Float64(t_1 - sqrt(x)) + Float64(t_4 - sqrt(y))) + 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 + z));
t_3 = 1.0 / (t_2 + sqrt(z));
t_4 = sqrt((1.0 + y));
tmp = 0.0;
if ((t_2 - sqrt(z)) <= 0.0005)
tmp = ((1.0 / (sqrt(x) + t_1)) + (1.0 / (t_4 + sqrt(y)))) + t_3;
else
tmp = ((t_1 - sqrt(x)) + (t_4 - sqrt(y))) + (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 + z), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[(1.0 / N[(t$95$2 + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(t$95$2 - N[Sqrt[z], $MachinePrecision]), $MachinePrecision], 0.0005], N[(N[(N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(t$95$4 + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$3), $MachinePrecision], N[(N[(N[(t$95$1 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(t$95$4 - N[Sqrt[y], $MachinePrecision]), $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 + z}\\
t_3 := \frac{1}{t_2 + \sqrt{z}}\\
t_4 := \sqrt{1 + y}\\
\mathbf{if}\;t_2 - \sqrt{z} \leq 0.0005:\\
\;\;\;\;\left(\frac{1}{\sqrt{x} + t_1} + \frac{1}{t_4 + \sqrt{y}}\right) + t_3\\
\mathbf{else}:\\
\;\;\;\;\left(\left(t_1 - \sqrt{x}\right) + \left(t_4 - \sqrt{y}\right)\right) + \left(t_3 + \frac{1}{\sqrt{1 + t} + \sqrt{t}}\right)\\
\end{array}
\end{array}
if (-.f64 (sqrt.f64 (+.f64 z 1)) (sqrt.f64 z)) < 5.0000000000000001e-4Initial program 87.1%
associate-+l+87.1%
+-commutative87.1%
+-commutative87.1%
+-commutative87.1%
Simplified87.1%
flip--87.1%
div-inv87.1%
add-sqr-sqrt68.9%
+-commutative68.9%
add-sqr-sqrt87.1%
+-commutative87.1%
Applied egg-rr87.1%
associate--l+91.1%
+-inverses91.1%
metadata-eval91.1%
*-lft-identity91.1%
Simplified91.1%
flip--91.1%
div-inv91.1%
add-sqr-sqrt71.2%
add-sqr-sqrt91.5%
associate--l+92.5%
Applied egg-rr92.5%
+-inverses92.5%
metadata-eval92.5%
*-lft-identity92.5%
Simplified92.5%
flip--93.4%
div-inv93.4%
add-sqr-sqrt44.5%
add-sqr-sqrt94.1%
associate--l+96.9%
Applied egg-rr96.9%
+-inverses96.9%
metadata-eval96.9%
*-lft-identity96.9%
Simplified96.9%
Taylor expanded in t around inf 56.3%
if 5.0000000000000001e-4 < (-.f64 (sqrt.f64 (+.f64 z 1)) (sqrt.f64 z)) Initial program 97.5%
associate-+l+97.5%
+-commutative97.5%
+-commutative97.5%
+-commutative97.5%
Simplified97.5%
flip--99.2%
div-inv99.2%
add-sqr-sqrt99.2%
add-sqr-sqrt99.2%
associate--l+99.2%
Applied egg-rr97.5%
+-inverses99.2%
metadata-eval99.2%
*-lft-identity99.2%
Simplified97.5%
flip--97.6%
div-inv97.6%
add-sqr-sqrt72.7%
add-sqr-sqrt97.9%
associate--l+98.2%
Applied egg-rr98.2%
+-inverses98.2%
metadata-eval98.2%
*-lft-identity98.2%
Simplified98.2%
Final simplification79.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 (sqrt (+ 1.0 z)))
(t_3 (- t_2 (sqrt z)))
(t_4 (sqrt (+ 1.0 y))))
(if (<= t_3 0.9995)
(+
(+ (/ 1.0 (+ (sqrt x) t_1)) (/ 1.0 (+ t_4 (sqrt y))))
(/ 1.0 (+ t_2 (sqrt z))))
(+
(+ (- t_1 (sqrt x)) (- t_4 (sqrt y)))
(+ 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 + z));
double t_3 = t_2 - sqrt(z);
double t_4 = sqrt((1.0 + y));
double tmp;
if (t_3 <= 0.9995) {
tmp = ((1.0 / (sqrt(x) + t_1)) + (1.0 / (t_4 + sqrt(y)))) + (1.0 / (t_2 + sqrt(z)));
} else {
tmp = ((t_1 - sqrt(x)) + (t_4 - sqrt(y))) + (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) :: t_4
real(8) :: tmp
t_1 = sqrt((1.0d0 + x))
t_2 = sqrt((1.0d0 + z))
t_3 = t_2 - sqrt(z)
t_4 = sqrt((1.0d0 + y))
if (t_3 <= 0.9995d0) then
tmp = ((1.0d0 / (sqrt(x) + t_1)) + (1.0d0 / (t_4 + sqrt(y)))) + (1.0d0 / (t_2 + sqrt(z)))
else
tmp = ((t_1 - sqrt(x)) + (t_4 - sqrt(y))) + (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 + z));
double t_3 = t_2 - Math.sqrt(z);
double t_4 = Math.sqrt((1.0 + y));
double tmp;
if (t_3 <= 0.9995) {
tmp = ((1.0 / (Math.sqrt(x) + t_1)) + (1.0 / (t_4 + Math.sqrt(y)))) + (1.0 / (t_2 + Math.sqrt(z)));
} else {
tmp = ((t_1 - Math.sqrt(x)) + (t_4 - Math.sqrt(y))) + (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 + z)) t_3 = t_2 - math.sqrt(z) t_4 = math.sqrt((1.0 + y)) tmp = 0 if t_3 <= 0.9995: tmp = ((1.0 / (math.sqrt(x) + t_1)) + (1.0 / (t_4 + math.sqrt(y)))) + (1.0 / (t_2 + math.sqrt(z))) else: tmp = ((t_1 - math.sqrt(x)) + (t_4 - math.sqrt(y))) + (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 + z)) t_3 = Float64(t_2 - sqrt(z)) t_4 = sqrt(Float64(1.0 + y)) tmp = 0.0 if (t_3 <= 0.9995) tmp = Float64(Float64(Float64(1.0 / Float64(sqrt(x) + t_1)) + Float64(1.0 / Float64(t_4 + sqrt(y)))) + Float64(1.0 / Float64(t_2 + sqrt(z)))); else tmp = Float64(Float64(Float64(t_1 - sqrt(x)) + Float64(t_4 - sqrt(y))) + 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 + z));
t_3 = t_2 - sqrt(z);
t_4 = sqrt((1.0 + y));
tmp = 0.0;
if (t_3 <= 0.9995)
tmp = ((1.0 / (sqrt(x) + t_1)) + (1.0 / (t_4 + sqrt(y)))) + (1.0 / (t_2 + sqrt(z)));
else
tmp = ((t_1 - sqrt(x)) + (t_4 - sqrt(y))) + (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 + z), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[(t$95$2 - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t$95$3, 0.9995], N[(N[(N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(t$95$4 + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(t$95$2 + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(t$95$1 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(t$95$4 - N[Sqrt[y], $MachinePrecision]), $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 + z}\\
t_3 := t_2 - \sqrt{z}\\
t_4 := \sqrt{1 + y}\\
\mathbf{if}\;t_3 \leq 0.9995:\\
\;\;\;\;\left(\frac{1}{\sqrt{x} + t_1} + \frac{1}{t_4 + \sqrt{y}}\right) + \frac{1}{t_2 + \sqrt{z}}\\
\mathbf{else}:\\
\;\;\;\;\left(\left(t_1 - \sqrt{x}\right) + \left(t_4 - \sqrt{y}\right)\right) + \left(t_3 + \frac{1}{\sqrt{1 + t} + \sqrt{t}}\right)\\
\end{array}
\end{array}
if (-.f64 (sqrt.f64 (+.f64 z 1)) (sqrt.f64 z)) < 0.99950000000000006Initial program 87.2%
associate-+l+87.2%
+-commutative87.2%
+-commutative87.2%
+-commutative87.2%
Simplified87.2%
flip--87.2%
div-inv87.2%
add-sqr-sqrt69.1%
+-commutative69.1%
add-sqr-sqrt87.2%
+-commutative87.2%
Applied egg-rr87.2%
associate--l+91.0%
+-inverses91.0%
metadata-eval91.0%
*-lft-identity91.0%
Simplified91.0%
flip--91.0%
div-inv91.0%
add-sqr-sqrt70.5%
add-sqr-sqrt91.4%
associate--l+92.4%
Applied egg-rr92.4%
+-inverses92.4%
metadata-eval92.4%
*-lft-identity92.4%
Simplified92.4%
flip--93.3%
div-inv93.3%
add-sqr-sqrt46.1%
add-sqr-sqrt94.0%
associate--l+96.8%
Applied egg-rr96.8%
+-inverses96.8%
metadata-eval96.8%
*-lft-identity96.8%
Simplified96.8%
Taylor expanded in t around inf 56.7%
if 0.99950000000000006 < (-.f64 (sqrt.f64 (+.f64 z 1)) (sqrt.f64 z)) Initial program 97.7%
associate-+l+97.7%
+-commutative97.7%
+-commutative97.7%
+-commutative97.7%
Simplified97.7%
flip--97.8%
div-inv97.8%
add-sqr-sqrt72.7%
add-sqr-sqrt97.9%
associate--l+98.2%
Applied egg-rr98.2%
+-inverses98.2%
metadata-eval98.2%
*-lft-identity98.2%
Simplified98.2%
Final simplification78.9%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (+ (+ (/ 1.0 (+ (sqrt x) (sqrt (+ 1.0 x)))) (/ 1.0 (+ (sqrt (+ 1.0 y)) (sqrt y)))) (+ (/ 1.0 (+ (sqrt (+ 1.0 z)) (sqrt 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((1.0 + z)) + sqrt(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((1.0d0 + z)) + sqrt(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((1.0 + z)) + Math.sqrt(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((1.0 + z)) + math.sqrt(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(Float64(1.0 / Float64(sqrt(x) + sqrt(Float64(1.0 + x)))) + Float64(1.0 / Float64(sqrt(Float64(1.0 + y)) + sqrt(y)))) + Float64(Float64(1.0 / Float64(sqrt(Float64(1.0 + z)) + sqrt(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((1.0 + z)) + sqrt(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[(N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 / N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\left(\frac{1}{\sqrt{x} + \sqrt{1 + x}} + \frac{1}{\sqrt{1 + y} + \sqrt{y}}\right) + \left(\frac{1}{\sqrt{1 + z} + \sqrt{z}} + \left(\sqrt{1 + t} - \sqrt{t}\right)\right)
\end{array}
Initial program 92.8%
associate-+l+92.8%
+-commutative92.8%
+-commutative92.8%
+-commutative92.8%
Simplified92.8%
flip--92.8%
div-inv92.8%
add-sqr-sqrt70.3%
+-commutative70.3%
add-sqr-sqrt93.0%
+-commutative93.0%
Applied egg-rr93.0%
associate--l+95.0%
+-inverses95.0%
metadata-eval95.0%
*-lft-identity95.0%
Simplified95.0%
flip--95.1%
div-inv95.1%
add-sqr-sqrt73.4%
add-sqr-sqrt95.4%
associate--l+96.2%
Applied egg-rr96.2%
+-inverses96.2%
metadata-eval96.2%
*-lft-identity96.2%
Simplified96.2%
flip--96.6%
div-inv96.6%
add-sqr-sqrt74.6%
add-sqr-sqrt96.9%
associate--l+98.2%
Applied egg-rr98.2%
+-inverses98.2%
metadata-eval98.2%
*-lft-identity98.2%
Simplified98.2%
Final simplification98.2%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (+ (+ (/ 1.0 (+ (sqrt x) (sqrt (+ 1.0 x)))) (/ 1.0 (+ (sqrt (+ 1.0 y)) (sqrt y)))) (+ (- (sqrt (+ 1.0 t)) (sqrt t)) (- (sqrt (+ 1.0 z)) (sqrt z)))))
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)))) + ((sqrt((1.0 + t)) - sqrt(t)) + (sqrt((1.0 + z)) - sqrt(z)));
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = ((1.0d0 / (sqrt(x) + sqrt((1.0d0 + x)))) + (1.0d0 / (sqrt((1.0d0 + y)) + sqrt(y)))) + ((sqrt((1.0d0 + t)) - sqrt(t)) + (sqrt((1.0d0 + z)) - sqrt(z)))
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
return ((1.0 / (Math.sqrt(x) + Math.sqrt((1.0 + x)))) + (1.0 / (Math.sqrt((1.0 + y)) + Math.sqrt(y)))) + ((Math.sqrt((1.0 + t)) - Math.sqrt(t)) + (Math.sqrt((1.0 + z)) - Math.sqrt(z)));
}
[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)))) + ((math.sqrt((1.0 + t)) - math.sqrt(t)) + (math.sqrt((1.0 + z)) - math.sqrt(z)))
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) return Float64(Float64(Float64(1.0 / Float64(sqrt(x) + sqrt(Float64(1.0 + x)))) + Float64(1.0 / Float64(sqrt(Float64(1.0 + y)) + sqrt(y)))) + Float64(Float64(sqrt(Float64(1.0 + t)) - sqrt(t)) + Float64(sqrt(Float64(1.0 + z)) - sqrt(z)))) 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)))) + ((sqrt((1.0 + t)) - sqrt(t)) + (sqrt((1.0 + z)) - sqrt(z)));
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := N[(N[(N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 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]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\left(\frac{1}{\sqrt{x} + \sqrt{1 + x}} + \frac{1}{\sqrt{1 + y} + \sqrt{y}}\right) + \left(\left(\sqrt{1 + t} - \sqrt{t}\right) + \left(\sqrt{1 + z} - \sqrt{z}\right)\right)
\end{array}
Initial program 92.8%
associate-+l+92.8%
+-commutative92.8%
+-commutative92.8%
+-commutative92.8%
Simplified92.8%
flip--92.8%
div-inv92.8%
add-sqr-sqrt70.3%
+-commutative70.3%
add-sqr-sqrt93.0%
+-commutative93.0%
Applied egg-rr93.0%
associate--l+95.0%
+-inverses95.0%
metadata-eval95.0%
*-lft-identity95.0%
Simplified95.0%
flip--95.1%
div-inv95.1%
add-sqr-sqrt73.4%
add-sqr-sqrt95.4%
associate--l+96.2%
Applied egg-rr96.2%
+-inverses96.2%
metadata-eval96.2%
*-lft-identity96.2%
Simplified96.2%
Final simplification96.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 y))) (t_2 (sqrt (+ 1.0 x))))
(if (<= t 1.5e+24)
(+
(+ (- t_2 (sqrt x)) (- t_1 (sqrt y)))
(+ 1.0 (/ 1.0 (+ (sqrt (+ 1.0 t)) (sqrt t)))))
(+
(+ (/ 1.0 (+ (sqrt x) t_2)) (/ 1.0 (+ t_1 (sqrt y))))
(/ 1.0 (+ (sqrt (+ 1.0 z)) (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 + y));
double t_2 = sqrt((1.0 + x));
double tmp;
if (t <= 1.5e+24) {
tmp = ((t_2 - sqrt(x)) + (t_1 - sqrt(y))) + (1.0 + (1.0 / (sqrt((1.0 + t)) + sqrt(t))));
} else {
tmp = ((1.0 / (sqrt(x) + t_2)) + (1.0 / (t_1 + sqrt(y)))) + (1.0 / (sqrt((1.0 + z)) + sqrt(z)));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = sqrt((1.0d0 + y))
t_2 = sqrt((1.0d0 + x))
if (t <= 1.5d+24) then
tmp = ((t_2 - sqrt(x)) + (t_1 - sqrt(y))) + (1.0d0 + (1.0d0 / (sqrt((1.0d0 + t)) + sqrt(t))))
else
tmp = ((1.0d0 / (sqrt(x) + t_2)) + (1.0d0 / (t_1 + sqrt(y)))) + (1.0d0 / (sqrt((1.0d0 + z)) + sqrt(z)))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + y));
double t_2 = Math.sqrt((1.0 + x));
double tmp;
if (t <= 1.5e+24) {
tmp = ((t_2 - Math.sqrt(x)) + (t_1 - Math.sqrt(y))) + (1.0 + (1.0 / (Math.sqrt((1.0 + t)) + Math.sqrt(t))));
} else {
tmp = ((1.0 / (Math.sqrt(x) + t_2)) + (1.0 / (t_1 + Math.sqrt(y)))) + (1.0 / (Math.sqrt((1.0 + z)) + 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 + y)) t_2 = math.sqrt((1.0 + x)) tmp = 0 if t <= 1.5e+24: tmp = ((t_2 - math.sqrt(x)) + (t_1 - math.sqrt(y))) + (1.0 + (1.0 / (math.sqrt((1.0 + t)) + math.sqrt(t)))) else: tmp = ((1.0 / (math.sqrt(x) + t_2)) + (1.0 / (t_1 + math.sqrt(y)))) + (1.0 / (math.sqrt((1.0 + z)) + 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 + y)) t_2 = sqrt(Float64(1.0 + x)) tmp = 0.0 if (t <= 1.5e+24) tmp = Float64(Float64(Float64(t_2 - sqrt(x)) + Float64(t_1 - sqrt(y))) + Float64(1.0 + Float64(1.0 / Float64(sqrt(Float64(1.0 + t)) + sqrt(t))))); else tmp = Float64(Float64(Float64(1.0 / Float64(sqrt(x) + t_2)) + Float64(1.0 / Float64(t_1 + sqrt(y)))) + Float64(1.0 / Float64(sqrt(Float64(1.0 + z)) + 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 + y));
t_2 = sqrt((1.0 + x));
tmp = 0.0;
if (t <= 1.5e+24)
tmp = ((t_2 - sqrt(x)) + (t_1 - sqrt(y))) + (1.0 + (1.0 / (sqrt((1.0 + t)) + sqrt(t))));
else
tmp = ((1.0 / (sqrt(x) + t_2)) + (1.0 / (t_1 + sqrt(y)))) + (1.0 / (sqrt((1.0 + z)) + 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 + y), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t, 1.5e+24], N[(N[(N[(t$95$2 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(t$95$1 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 + N[(1.0 / N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] + N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + t$95$2), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(t$95$1 + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] + 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 + y}\\
t_2 := \sqrt{1 + x}\\
\mathbf{if}\;t \leq 1.5 \cdot 10^{+24}:\\
\;\;\;\;\left(\left(t_2 - \sqrt{x}\right) + \left(t_1 - \sqrt{y}\right)\right) + \left(1 + \frac{1}{\sqrt{1 + t} + \sqrt{t}}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{1}{\sqrt{x} + t_2} + \frac{1}{t_1 + \sqrt{y}}\right) + \frac{1}{\sqrt{1 + z} + \sqrt{z}}\\
\end{array}
\end{array}
if t < 1.49999999999999997e24Initial program 97.1%
associate-+l+97.1%
+-commutative97.1%
+-commutative97.1%
+-commutative97.1%
Simplified97.1%
flip--98.2%
div-inv98.2%
add-sqr-sqrt74.6%
add-sqr-sqrt98.8%
associate--l+98.8%
Applied egg-rr97.7%
+-inverses98.8%
metadata-eval98.8%
*-lft-identity98.8%
Simplified97.7%
flip--97.8%
div-inv97.8%
add-sqr-sqrt98.3%
add-sqr-sqrt98.6%
associate--l+98.8%
Applied egg-rr98.8%
+-inverses98.8%
metadata-eval98.8%
*-lft-identity98.8%
Simplified98.8%
Taylor expanded in z around 0 60.9%
if 1.49999999999999997e24 < t Initial program 88.3%
associate-+l+88.3%
+-commutative88.3%
+-commutative88.3%
+-commutative88.3%
Simplified88.3%
flip--88.3%
div-inv88.3%
add-sqr-sqrt66.2%
+-commutative66.2%
add-sqr-sqrt88.2%
+-commutative88.2%
Applied egg-rr88.2%
associate--l+92.1%
+-inverses92.1%
metadata-eval92.1%
*-lft-identity92.1%
Simplified92.1%
flip--92.3%
div-inv92.3%
add-sqr-sqrt71.9%
add-sqr-sqrt92.6%
associate--l+94.1%
Applied egg-rr94.1%
+-inverses94.1%
metadata-eval94.1%
*-lft-identity94.1%
Simplified94.1%
flip--94.9%
div-inv94.9%
add-sqr-sqrt74.7%
add-sqr-sqrt94.9%
associate--l+97.6%
Applied egg-rr97.6%
+-inverses97.6%
metadata-eval97.6%
*-lft-identity97.6%
Simplified97.6%
Taylor expanded in t around inf 97.6%
Final simplification78.7%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (sqrt (+ 1.0 y)) (sqrt y))) (t_2 (sqrt (+ 1.0 x))))
(if (<= t 1.5e+24)
(+ (+ (- t_2 (sqrt x)) t_1) (+ 1.0 (/ 1.0 (+ (sqrt (+ 1.0 t)) (sqrt t)))))
(+ (- (sqrt (+ 1.0 z)) (sqrt z)) (+ (/ 1.0 (+ (sqrt x) t_2)) 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 + y)) - sqrt(y);
double t_2 = sqrt((1.0 + x));
double tmp;
if (t <= 1.5e+24) {
tmp = ((t_2 - sqrt(x)) + t_1) + (1.0 + (1.0 / (sqrt((1.0 + t)) + sqrt(t))));
} else {
tmp = (sqrt((1.0 + z)) - sqrt(z)) + ((1.0 / (sqrt(x) + t_2)) + 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 + y)) - sqrt(y)
t_2 = sqrt((1.0d0 + x))
if (t <= 1.5d+24) then
tmp = ((t_2 - sqrt(x)) + t_1) + (1.0d0 + (1.0d0 / (sqrt((1.0d0 + t)) + sqrt(t))))
else
tmp = (sqrt((1.0d0 + z)) - sqrt(z)) + ((1.0d0 / (sqrt(x) + t_2)) + 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 + y)) - Math.sqrt(y);
double t_2 = Math.sqrt((1.0 + x));
double tmp;
if (t <= 1.5e+24) {
tmp = ((t_2 - Math.sqrt(x)) + t_1) + (1.0 + (1.0 / (Math.sqrt((1.0 + t)) + Math.sqrt(t))));
} else {
tmp = (Math.sqrt((1.0 + z)) - Math.sqrt(z)) + ((1.0 / (Math.sqrt(x) + t_2)) + 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 + y)) - math.sqrt(y) t_2 = math.sqrt((1.0 + x)) tmp = 0 if t <= 1.5e+24: tmp = ((t_2 - math.sqrt(x)) + t_1) + (1.0 + (1.0 / (math.sqrt((1.0 + t)) + math.sqrt(t)))) else: tmp = (math.sqrt((1.0 + z)) - math.sqrt(z)) + ((1.0 / (math.sqrt(x) + t_2)) + 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 + y)) - sqrt(y)) t_2 = sqrt(Float64(1.0 + x)) tmp = 0.0 if (t <= 1.5e+24) tmp = Float64(Float64(Float64(t_2 - sqrt(x)) + t_1) + Float64(1.0 + Float64(1.0 / Float64(sqrt(Float64(1.0 + t)) + sqrt(t))))); else tmp = Float64(Float64(sqrt(Float64(1.0 + z)) - sqrt(z)) + Float64(Float64(1.0 / Float64(sqrt(x) + t_2)) + 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 + y)) - sqrt(y);
t_2 = sqrt((1.0 + x));
tmp = 0.0;
if (t <= 1.5e+24)
tmp = ((t_2 - sqrt(x)) + t_1) + (1.0 + (1.0 / (sqrt((1.0 + t)) + sqrt(t))));
else
tmp = (sqrt((1.0 + z)) - sqrt(z)) + ((1.0 / (sqrt(x) + t_2)) + 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 + y), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t, 1.5e+24], N[(N[(N[(t$95$2 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision] + N[(1.0 + N[(1.0 / N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] + N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + t$95$2), $MachinePrecision]), $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 + y} - \sqrt{y}\\
t_2 := \sqrt{1 + x}\\
\mathbf{if}\;t \leq 1.5 \cdot 10^{+24}:\\
\;\;\;\;\left(\left(t_2 - \sqrt{x}\right) + t_1\right) + \left(1 + \frac{1}{\sqrt{1 + t} + \sqrt{t}}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\frac{1}{\sqrt{x} + t_2} + t_1\right)\\
\end{array}
\end{array}
if t < 1.49999999999999997e24Initial program 97.1%
associate-+l+97.1%
+-commutative97.1%
+-commutative97.1%
+-commutative97.1%
Simplified97.1%
flip--98.2%
div-inv98.2%
add-sqr-sqrt74.6%
add-sqr-sqrt98.8%
associate--l+98.8%
Applied egg-rr97.7%
+-inverses98.8%
metadata-eval98.8%
*-lft-identity98.8%
Simplified97.7%
flip--97.8%
div-inv97.8%
add-sqr-sqrt98.3%
add-sqr-sqrt98.6%
associate--l+98.8%
Applied egg-rr98.8%
+-inverses98.8%
metadata-eval98.8%
*-lft-identity98.8%
Simplified98.8%
Taylor expanded in z around 0 60.9%
if 1.49999999999999997e24 < t Initial program 88.3%
associate-+l+88.3%
+-commutative88.3%
+-commutative88.3%
+-commutative88.3%
Simplified88.3%
flip--88.3%
div-inv88.3%
add-sqr-sqrt66.2%
+-commutative66.2%
add-sqr-sqrt88.2%
+-commutative88.2%
Applied egg-rr88.2%
associate--l+92.1%
+-inverses92.1%
metadata-eval92.1%
*-lft-identity92.1%
Simplified92.1%
Taylor expanded in t around inf 92.1%
Final simplification76.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 y))) (t_2 (sqrt (+ 1.0 x))))
(if (<= t 1.5e+24)
(+
(+ (- t_2 (sqrt x)) (- t_1 (sqrt y)))
(+ 1.0 (/ 1.0 (+ (sqrt (+ 1.0 t)) (sqrt t)))))
(+
(+ (/ 1.0 (+ (sqrt x) t_2)) (/ 1.0 (+ t_1 (sqrt y))))
(- (sqrt (+ 1.0 z)) (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 + y));
double t_2 = sqrt((1.0 + x));
double tmp;
if (t <= 1.5e+24) {
tmp = ((t_2 - sqrt(x)) + (t_1 - sqrt(y))) + (1.0 + (1.0 / (sqrt((1.0 + t)) + sqrt(t))));
} else {
tmp = ((1.0 / (sqrt(x) + t_2)) + (1.0 / (t_1 + sqrt(y)))) + (sqrt((1.0 + z)) - sqrt(z));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = sqrt((1.0d0 + y))
t_2 = sqrt((1.0d0 + x))
if (t <= 1.5d+24) then
tmp = ((t_2 - sqrt(x)) + (t_1 - sqrt(y))) + (1.0d0 + (1.0d0 / (sqrt((1.0d0 + t)) + sqrt(t))))
else
tmp = ((1.0d0 / (sqrt(x) + t_2)) + (1.0d0 / (t_1 + sqrt(y)))) + (sqrt((1.0d0 + z)) - sqrt(z))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + y));
double t_2 = Math.sqrt((1.0 + x));
double tmp;
if (t <= 1.5e+24) {
tmp = ((t_2 - Math.sqrt(x)) + (t_1 - Math.sqrt(y))) + (1.0 + (1.0 / (Math.sqrt((1.0 + t)) + Math.sqrt(t))));
} else {
tmp = ((1.0 / (Math.sqrt(x) + t_2)) + (1.0 / (t_1 + Math.sqrt(y)))) + (Math.sqrt((1.0 + z)) - 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 + y)) t_2 = math.sqrt((1.0 + x)) tmp = 0 if t <= 1.5e+24: tmp = ((t_2 - math.sqrt(x)) + (t_1 - math.sqrt(y))) + (1.0 + (1.0 / (math.sqrt((1.0 + t)) + math.sqrt(t)))) else: tmp = ((1.0 / (math.sqrt(x) + t_2)) + (1.0 / (t_1 + math.sqrt(y)))) + (math.sqrt((1.0 + z)) - 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 + y)) t_2 = sqrt(Float64(1.0 + x)) tmp = 0.0 if (t <= 1.5e+24) tmp = Float64(Float64(Float64(t_2 - sqrt(x)) + Float64(t_1 - sqrt(y))) + Float64(1.0 + Float64(1.0 / Float64(sqrt(Float64(1.0 + t)) + sqrt(t))))); else tmp = Float64(Float64(Float64(1.0 / Float64(sqrt(x) + t_2)) + Float64(1.0 / Float64(t_1 + sqrt(y)))) + Float64(sqrt(Float64(1.0 + z)) - 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 + y));
t_2 = sqrt((1.0 + x));
tmp = 0.0;
if (t <= 1.5e+24)
tmp = ((t_2 - sqrt(x)) + (t_1 - sqrt(y))) + (1.0 + (1.0 / (sqrt((1.0 + t)) + sqrt(t))));
else
tmp = ((1.0 / (sqrt(x) + t_2)) + (1.0 / (t_1 + sqrt(y)))) + (sqrt((1.0 + z)) - 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 + y), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t, 1.5e+24], N[(N[(N[(t$95$2 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(t$95$1 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 + N[(1.0 / N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] + N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + t$95$2), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(t$95$1 + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + y}\\
t_2 := \sqrt{1 + x}\\
\mathbf{if}\;t \leq 1.5 \cdot 10^{+24}:\\
\;\;\;\;\left(\left(t_2 - \sqrt{x}\right) + \left(t_1 - \sqrt{y}\right)\right) + \left(1 + \frac{1}{\sqrt{1 + t} + \sqrt{t}}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{1}{\sqrt{x} + t_2} + \frac{1}{t_1 + \sqrt{y}}\right) + \left(\sqrt{1 + z} - \sqrt{z}\right)\\
\end{array}
\end{array}
if t < 1.49999999999999997e24Initial program 97.1%
associate-+l+97.1%
+-commutative97.1%
+-commutative97.1%
+-commutative97.1%
Simplified97.1%
flip--98.2%
div-inv98.2%
add-sqr-sqrt74.6%
add-sqr-sqrt98.8%
associate--l+98.8%
Applied egg-rr97.7%
+-inverses98.8%
metadata-eval98.8%
*-lft-identity98.8%
Simplified97.7%
flip--97.8%
div-inv97.8%
add-sqr-sqrt98.3%
add-sqr-sqrt98.6%
associate--l+98.8%
Applied egg-rr98.8%
+-inverses98.8%
metadata-eval98.8%
*-lft-identity98.8%
Simplified98.8%
Taylor expanded in z around 0 60.9%
if 1.49999999999999997e24 < t Initial program 88.3%
associate-+l+88.3%
+-commutative88.3%
+-commutative88.3%
+-commutative88.3%
Simplified88.3%
flip--88.3%
div-inv88.3%
add-sqr-sqrt66.2%
+-commutative66.2%
add-sqr-sqrt88.2%
+-commutative88.2%
Applied egg-rr88.2%
associate--l+92.1%
+-inverses92.1%
metadata-eval92.1%
*-lft-identity92.1%
Simplified92.1%
flip--92.3%
div-inv92.3%
add-sqr-sqrt71.9%
add-sqr-sqrt92.6%
associate--l+94.1%
Applied egg-rr94.1%
+-inverses94.1%
metadata-eval94.1%
*-lft-identity94.1%
Simplified94.1%
Taylor expanded in t around inf 94.1%
Final simplification77.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 y)) (sqrt y))))
(if (<= t 34000000000000.0)
(+
(+ (- (sqrt (+ 1.0 x)) (sqrt x)) t_1)
(+ 1.0 (- (sqrt (+ 1.0 t)) (sqrt t))))
(+ (/ 1.0 (+ (sqrt (+ 1.0 z)) (sqrt z))) (+ t_1 (log1p (expm1 1.0)))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + y)) - sqrt(y);
double tmp;
if (t <= 34000000000000.0) {
tmp = ((sqrt((1.0 + x)) - sqrt(x)) + t_1) + (1.0 + (sqrt((1.0 + t)) - sqrt(t)));
} else {
tmp = (1.0 / (sqrt((1.0 + z)) + sqrt(z))) + (t_1 + log1p(expm1(1.0)));
}
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 + y)) - Math.sqrt(y);
double tmp;
if (t <= 34000000000000.0) {
tmp = ((Math.sqrt((1.0 + x)) - Math.sqrt(x)) + t_1) + (1.0 + (Math.sqrt((1.0 + t)) - Math.sqrt(t)));
} else {
tmp = (1.0 / (Math.sqrt((1.0 + z)) + Math.sqrt(z))) + (t_1 + Math.log1p(Math.expm1(1.0)));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + y)) - math.sqrt(y) tmp = 0 if t <= 34000000000000.0: tmp = ((math.sqrt((1.0 + x)) - math.sqrt(x)) + t_1) + (1.0 + (math.sqrt((1.0 + t)) - math.sqrt(t))) else: tmp = (1.0 / (math.sqrt((1.0 + z)) + math.sqrt(z))) + (t_1 + math.log1p(math.expm1(1.0))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = Float64(sqrt(Float64(1.0 + y)) - sqrt(y)) tmp = 0.0 if (t <= 34000000000000.0) tmp = Float64(Float64(Float64(sqrt(Float64(1.0 + x)) - sqrt(x)) + t_1) + Float64(1.0 + Float64(sqrt(Float64(1.0 + t)) - sqrt(t)))); else tmp = Float64(Float64(1.0 / Float64(sqrt(Float64(1.0 + z)) + sqrt(z))) + Float64(t_1 + log1p(expm1(1.0)))); end return 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 + y), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, 34000000000000.0], N[(N[(N[(N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision] + N[(1.0 + N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$1 + N[Log[1 + N[(Exp[1.0] - 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 + y} - \sqrt{y}\\
\mathbf{if}\;t \leq 34000000000000:\\
\;\;\;\;\left(\left(\sqrt{1 + x} - \sqrt{x}\right) + t_1\right) + \left(1 + \left(\sqrt{1 + t} - \sqrt{t}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{1 + z} + \sqrt{z}} + \left(t_1 + \mathsf{log1p}\left(\mathsf{expm1}\left(1\right)\right)\right)\\
\end{array}
\end{array}
if t < 3.4e13Initial program 97.5%
associate-+l+97.5%
+-commutative97.5%
+-commutative97.5%
+-commutative97.5%
Simplified97.5%
flip--98.6%
div-inv98.6%
add-sqr-sqrt75.1%
add-sqr-sqrt99.2%
associate--l+99.2%
Applied egg-rr98.1%
+-inverses99.2%
metadata-eval99.2%
*-lft-identity99.2%
Simplified98.1%
Taylor expanded in z around 0 60.8%
if 3.4e13 < t Initial program 88.0%
associate-+l+88.0%
+-commutative88.0%
+-commutative88.0%
+-commutative88.0%
Simplified88.0%
log1p-expm1-u88.0%
+-commutative88.0%
Applied egg-rr88.0%
Taylor expanded in t around inf 88.0%
flip--94.5%
div-inv94.5%
add-sqr-sqrt74.2%
add-sqr-sqrt94.5%
associate--l+97.1%
Applied egg-rr90.4%
+-inverses97.1%
metadata-eval97.1%
*-lft-identity97.1%
Simplified90.4%
Taylor expanded in x around 0 53.4%
expm1-def53.4%
Simplified53.4%
Final simplification57.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 y)) (sqrt y))) (t_2 (sqrt (+ 1.0 x))))
(if (<= t 34000000000000.0)
(+ (+ (- t_2 (sqrt x)) t_1) (+ 1.0 (- (sqrt (+ 1.0 t)) (sqrt t))))
(+ (- (sqrt (+ 1.0 z)) (sqrt z)) (+ (/ 1.0 (+ (sqrt x) t_2)) 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 + y)) - sqrt(y);
double t_2 = sqrt((1.0 + x));
double tmp;
if (t <= 34000000000000.0) {
tmp = ((t_2 - sqrt(x)) + t_1) + (1.0 + (sqrt((1.0 + t)) - sqrt(t)));
} else {
tmp = (sqrt((1.0 + z)) - sqrt(z)) + ((1.0 / (sqrt(x) + t_2)) + 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 + y)) - sqrt(y)
t_2 = sqrt((1.0d0 + x))
if (t <= 34000000000000.0d0) then
tmp = ((t_2 - sqrt(x)) + t_1) + (1.0d0 + (sqrt((1.0d0 + t)) - sqrt(t)))
else
tmp = (sqrt((1.0d0 + z)) - sqrt(z)) + ((1.0d0 / (sqrt(x) + t_2)) + 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 + y)) - Math.sqrt(y);
double t_2 = Math.sqrt((1.0 + x));
double tmp;
if (t <= 34000000000000.0) {
tmp = ((t_2 - Math.sqrt(x)) + t_1) + (1.0 + (Math.sqrt((1.0 + t)) - Math.sqrt(t)));
} else {
tmp = (Math.sqrt((1.0 + z)) - Math.sqrt(z)) + ((1.0 / (Math.sqrt(x) + t_2)) + 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 + y)) - math.sqrt(y) t_2 = math.sqrt((1.0 + x)) tmp = 0 if t <= 34000000000000.0: tmp = ((t_2 - math.sqrt(x)) + t_1) + (1.0 + (math.sqrt((1.0 + t)) - math.sqrt(t))) else: tmp = (math.sqrt((1.0 + z)) - math.sqrt(z)) + ((1.0 / (math.sqrt(x) + t_2)) + 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 + y)) - sqrt(y)) t_2 = sqrt(Float64(1.0 + x)) tmp = 0.0 if (t <= 34000000000000.0) tmp = Float64(Float64(Float64(t_2 - sqrt(x)) + t_1) + Float64(1.0 + Float64(sqrt(Float64(1.0 + t)) - sqrt(t)))); else tmp = Float64(Float64(sqrt(Float64(1.0 + z)) - sqrt(z)) + Float64(Float64(1.0 / Float64(sqrt(x) + t_2)) + 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 + y)) - sqrt(y);
t_2 = sqrt((1.0 + x));
tmp = 0.0;
if (t <= 34000000000000.0)
tmp = ((t_2 - sqrt(x)) + t_1) + (1.0 + (sqrt((1.0 + t)) - sqrt(t)));
else
tmp = (sqrt((1.0 + z)) - sqrt(z)) + ((1.0 / (sqrt(x) + t_2)) + 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 + y), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t, 34000000000000.0], N[(N[(N[(t$95$2 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision] + N[(1.0 + N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + t$95$2), $MachinePrecision]), $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 + y} - \sqrt{y}\\
t_2 := \sqrt{1 + x}\\
\mathbf{if}\;t \leq 34000000000000:\\
\;\;\;\;\left(\left(t_2 - \sqrt{x}\right) + t_1\right) + \left(1 + \left(\sqrt{1 + t} - \sqrt{t}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\frac{1}{\sqrt{x} + t_2} + t_1\right)\\
\end{array}
\end{array}
if t < 3.4e13Initial program 97.5%
associate-+l+97.5%
+-commutative97.5%
+-commutative97.5%
+-commutative97.5%
Simplified97.5%
flip--98.6%
div-inv98.6%
add-sqr-sqrt75.1%
add-sqr-sqrt99.2%
associate--l+99.2%
Applied egg-rr98.1%
+-inverses99.2%
metadata-eval99.2%
*-lft-identity99.2%
Simplified98.1%
Taylor expanded in z around 0 60.8%
if 3.4e13 < t Initial program 88.0%
associate-+l+88.0%
+-commutative88.0%
+-commutative88.0%
+-commutative88.0%
Simplified88.0%
flip--88.0%
div-inv88.0%
add-sqr-sqrt65.3%
+-commutative65.3%
add-sqr-sqrt88.0%
+-commutative88.0%
Applied egg-rr88.0%
associate--l+91.8%
+-inverses91.8%
metadata-eval91.8%
*-lft-identity91.8%
Simplified91.8%
Taylor expanded in t around inf 91.8%
Final simplification76.1%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ 1.0 z))))
(if (<= t 0.011)
(- (+ t_1 3.0) (sqrt z))
(+
(/ 1.0 (+ t_1 (sqrt z)))
(+ (- (sqrt (+ 1.0 y)) (sqrt y)) (log1p (expm1 1.0)))))))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 <= 0.011) {
tmp = (t_1 + 3.0) - sqrt(z);
} else {
tmp = (1.0 / (t_1 + sqrt(z))) + ((sqrt((1.0 + y)) - sqrt(y)) + log1p(expm1(1.0)));
}
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 <= 0.011) {
tmp = (t_1 + 3.0) - Math.sqrt(z);
} else {
tmp = (1.0 / (t_1 + Math.sqrt(z))) + ((Math.sqrt((1.0 + y)) - Math.sqrt(y)) + Math.log1p(Math.expm1(1.0)));
}
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 <= 0.011: tmp = (t_1 + 3.0) - math.sqrt(z) else: tmp = (1.0 / (t_1 + math.sqrt(z))) + ((math.sqrt((1.0 + y)) - math.sqrt(y)) + math.log1p(math.expm1(1.0))) 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 <= 0.011) tmp = Float64(Float64(t_1 + 3.0) - sqrt(z)); else tmp = Float64(Float64(1.0 / Float64(t_1 + sqrt(z))) + Float64(Float64(sqrt(Float64(1.0 + y)) - sqrt(y)) + log1p(expm1(1.0)))); end return 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, 0.011], N[(N[(t$95$1 + 3.0), $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[(t$95$1 + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision] + N[Log[1 + N[(Exp[1.0] - 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 0.011:\\
\;\;\;\;\left(t_1 + 3\right) - \sqrt{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{t_1 + \sqrt{z}} + \left(\left(\sqrt{1 + y} - \sqrt{y}\right) + \mathsf{log1p}\left(\mathsf{expm1}\left(1\right)\right)\right)\\
\end{array}
\end{array}
if t < 0.010999999999999999Initial program 98.1%
associate-+l+98.1%
+-commutative98.1%
+-commutative98.1%
+-commutative98.1%
Simplified98.1%
Taylor expanded in t around 0 93.3%
Taylor expanded in x around 0 20.4%
associate--l+55.2%
+-commutative55.2%
+-commutative55.2%
Simplified55.2%
Taylor expanded in y around 0 24.3%
if 0.010999999999999999 < t Initial program 87.8%
associate-+l+87.8%
+-commutative87.8%
+-commutative87.8%
+-commutative87.8%
Simplified87.8%
log1p-expm1-u87.8%
+-commutative87.8%
Applied egg-rr87.8%
Taylor expanded in t around inf 86.1%
flip--94.1%
div-inv94.1%
add-sqr-sqrt74.0%
add-sqr-sqrt94.1%
associate--l+96.6%
Applied egg-rr88.5%
+-inverses96.6%
metadata-eval96.6%
*-lft-identity96.6%
Simplified88.5%
Taylor expanded in x around 0 52.0%
expm1-def52.0%
Simplified52.0%
Final simplification38.5%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ 1.0 y))))
(if (<= z 11000000000000.0)
(+ 1.0 (+ (sqrt (+ 1.0 z)) (+ t_1 (/ (- y z) (- (sqrt z) (sqrt y))))))
(+ 1.0 (/ 1.0 (+ t_1 (sqrt y)))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + y));
double tmp;
if (z <= 11000000000000.0) {
tmp = 1.0 + (sqrt((1.0 + z)) + (t_1 + ((y - z) / (sqrt(z) - sqrt(y)))));
} else {
tmp = 1.0 + (1.0 / (t_1 + sqrt(y)));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = sqrt((1.0d0 + y))
if (z <= 11000000000000.0d0) then
tmp = 1.0d0 + (sqrt((1.0d0 + z)) + (t_1 + ((y - z) / (sqrt(z) - sqrt(y)))))
else
tmp = 1.0d0 + (1.0d0 / (t_1 + sqrt(y)))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + y));
double tmp;
if (z <= 11000000000000.0) {
tmp = 1.0 + (Math.sqrt((1.0 + z)) + (t_1 + ((y - z) / (Math.sqrt(z) - Math.sqrt(y)))));
} else {
tmp = 1.0 + (1.0 / (t_1 + Math.sqrt(y)));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + y)) tmp = 0 if z <= 11000000000000.0: tmp = 1.0 + (math.sqrt((1.0 + z)) + (t_1 + ((y - z) / (math.sqrt(z) - math.sqrt(y))))) else: tmp = 1.0 + (1.0 / (t_1 + math.sqrt(y))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(1.0 + y)) tmp = 0.0 if (z <= 11000000000000.0) tmp = Float64(1.0 + Float64(sqrt(Float64(1.0 + z)) + Float64(t_1 + Float64(Float64(y - z) / Float64(sqrt(z) - sqrt(y)))))); else tmp = Float64(1.0 + Float64(1.0 / Float64(t_1 + sqrt(y)))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + y));
tmp = 0.0;
if (z <= 11000000000000.0)
tmp = 1.0 + (sqrt((1.0 + z)) + (t_1 + ((y - z) / (sqrt(z) - sqrt(y)))));
else
tmp = 1.0 + (1.0 / (t_1 + sqrt(y)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[z, 11000000000000.0], N[(1.0 + N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] + N[(t$95$1 + N[(N[(y - z), $MachinePrecision] / N[(N[Sqrt[z], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(1.0 / N[(t$95$1 + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + y}\\
\mathbf{if}\;z \leq 11000000000000:\\
\;\;\;\;1 + \left(\sqrt{1 + z} + \left(t_1 + \frac{y - z}{\sqrt{z} - \sqrt{y}}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{1}{t_1 + \sqrt{y}}\\
\end{array}
\end{array}
if z < 1.1e13Initial program 96.8%
associate-+l+96.8%
+-commutative96.8%
+-commutative96.8%
+-commutative96.8%
Simplified96.8%
Taylor expanded in t around 0 56.5%
Taylor expanded in x around inf 30.0%
associate--l+46.7%
+-commutative46.7%
associate--l+50.4%
+-commutative50.4%
Simplified50.4%
flip-+48.1%
add-sqr-sqrt48.1%
add-sqr-sqrt40.9%
Applied egg-rr40.9%
if 1.1e13 < z Initial program 87.6%
associate-+l+87.6%
+-commutative87.6%
+-commutative87.6%
+-commutative87.6%
Simplified87.6%
Taylor expanded in t around 0 53.0%
Taylor expanded in x around inf 4.3%
associate--l+43.6%
+-commutative43.6%
associate--l+33.4%
+-commutative33.4%
Simplified33.4%
Taylor expanded in z around inf 52.6%
flip--91.7%
div-inv91.7%
add-sqr-sqrt72.4%
add-sqr-sqrt92.1%
associate--l+93.2%
Applied egg-rr52.8%
+-inverses93.2%
metadata-eval93.2%
*-lft-identity93.2%
Simplified52.8%
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
(let* ((t_1 (sqrt (+ 1.0 y))))
(if (<= z 3.8e+14)
(+ 1.0 (+ (sqrt (+ 1.0 z)) (- t_1 (+ (sqrt y) (sqrt z)))))
(+ 1.0 (/ 1.0 (+ t_1 (sqrt y)))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + y));
double tmp;
if (z <= 3.8e+14) {
tmp = 1.0 + (sqrt((1.0 + z)) + (t_1 - (sqrt(y) + sqrt(z))));
} else {
tmp = 1.0 + (1.0 / (t_1 + sqrt(y)));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = sqrt((1.0d0 + y))
if (z <= 3.8d+14) then
tmp = 1.0d0 + (sqrt((1.0d0 + z)) + (t_1 - (sqrt(y) + sqrt(z))))
else
tmp = 1.0d0 + (1.0d0 / (t_1 + sqrt(y)))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + y));
double tmp;
if (z <= 3.8e+14) {
tmp = 1.0 + (Math.sqrt((1.0 + z)) + (t_1 - (Math.sqrt(y) + Math.sqrt(z))));
} else {
tmp = 1.0 + (1.0 / (t_1 + Math.sqrt(y)));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + y)) tmp = 0 if z <= 3.8e+14: tmp = 1.0 + (math.sqrt((1.0 + z)) + (t_1 - (math.sqrt(y) + math.sqrt(z)))) else: tmp = 1.0 + (1.0 / (t_1 + math.sqrt(y))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(1.0 + y)) tmp = 0.0 if (z <= 3.8e+14) tmp = Float64(1.0 + Float64(sqrt(Float64(1.0 + z)) + Float64(t_1 - Float64(sqrt(y) + sqrt(z))))); else tmp = Float64(1.0 + Float64(1.0 / Float64(t_1 + sqrt(y)))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + y));
tmp = 0.0;
if (z <= 3.8e+14)
tmp = 1.0 + (sqrt((1.0 + z)) + (t_1 - (sqrt(y) + sqrt(z))));
else
tmp = 1.0 + (1.0 / (t_1 + sqrt(y)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[z, 3.8e+14], N[(1.0 + N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] + N[(t$95$1 - N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(1.0 / N[(t$95$1 + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + y}\\
\mathbf{if}\;z \leq 3.8 \cdot 10^{+14}:\\
\;\;\;\;1 + \left(\sqrt{1 + z} + \left(t_1 - \left(\sqrt{y} + \sqrt{z}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{1}{t_1 + \sqrt{y}}\\
\end{array}
\end{array}
if z < 3.8e14Initial program 96.8%
associate-+l+96.8%
+-commutative96.8%
+-commutative96.8%
+-commutative96.8%
Simplified96.8%
Taylor expanded in t around 0 56.5%
Taylor expanded in x around inf 30.0%
associate--l+46.7%
+-commutative46.7%
associate--l+50.4%
+-commutative50.4%
Simplified50.4%
if 3.8e14 < z Initial program 87.6%
associate-+l+87.6%
+-commutative87.6%
+-commutative87.6%
+-commutative87.6%
Simplified87.6%
Taylor expanded in t around 0 53.0%
Taylor expanded in x around inf 4.3%
associate--l+43.6%
+-commutative43.6%
associate--l+33.4%
+-commutative33.4%
Simplified33.4%
Taylor expanded in z around inf 52.6%
flip--91.7%
div-inv91.7%
add-sqr-sqrt72.4%
add-sqr-sqrt92.1%
associate--l+93.2%
Applied egg-rr52.8%
+-inverses93.2%
metadata-eval93.2%
*-lft-identity93.2%
Simplified52.8%
Final simplification51.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 y))))
(if (<= z 3.3e+16)
(+ 1.0 (+ (sqrt (+ 1.0 z)) (- (- t_1 (sqrt y)) (sqrt z))))
(+ 1.0 (/ 1.0 (+ t_1 (sqrt y)))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + y));
double tmp;
if (z <= 3.3e+16) {
tmp = 1.0 + (sqrt((1.0 + z)) + ((t_1 - sqrt(y)) - sqrt(z)));
} else {
tmp = 1.0 + (1.0 / (t_1 + sqrt(y)));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = sqrt((1.0d0 + y))
if (z <= 3.3d+16) then
tmp = 1.0d0 + (sqrt((1.0d0 + z)) + ((t_1 - sqrt(y)) - sqrt(z)))
else
tmp = 1.0d0 + (1.0d0 / (t_1 + sqrt(y)))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + y));
double tmp;
if (z <= 3.3e+16) {
tmp = 1.0 + (Math.sqrt((1.0 + z)) + ((t_1 - Math.sqrt(y)) - Math.sqrt(z)));
} else {
tmp = 1.0 + (1.0 / (t_1 + Math.sqrt(y)));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + y)) tmp = 0 if z <= 3.3e+16: tmp = 1.0 + (math.sqrt((1.0 + z)) + ((t_1 - math.sqrt(y)) - math.sqrt(z))) else: tmp = 1.0 + (1.0 / (t_1 + math.sqrt(y))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(1.0 + y)) tmp = 0.0 if (z <= 3.3e+16) tmp = Float64(1.0 + Float64(sqrt(Float64(1.0 + z)) + Float64(Float64(t_1 - sqrt(y)) - sqrt(z)))); else tmp = Float64(1.0 + Float64(1.0 / Float64(t_1 + sqrt(y)))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + y));
tmp = 0.0;
if (z <= 3.3e+16)
tmp = 1.0 + (sqrt((1.0 + z)) + ((t_1 - sqrt(y)) - sqrt(z)));
else
tmp = 1.0 + (1.0 / (t_1 + sqrt(y)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[z, 3.3e+16], N[(1.0 + N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] + N[(N[(t$95$1 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(1.0 / N[(t$95$1 + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + y}\\
\mathbf{if}\;z \leq 3.3 \cdot 10^{+16}:\\
\;\;\;\;1 + \left(\sqrt{1 + z} + \left(\left(t_1 - \sqrt{y}\right) - \sqrt{z}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{1}{t_1 + \sqrt{y}}\\
\end{array}
\end{array}
if z < 3.3e16Initial program 96.4%
associate-+l+96.4%
+-commutative96.4%
+-commutative96.4%
+-commutative96.4%
Simplified96.4%
Taylor expanded in t around 0 56.2%
Taylor expanded in x around inf 29.8%
associate--l+46.4%
+-commutative46.4%
associate--l+50.0%
+-commutative50.0%
Simplified50.0%
add-exp-log49.8%
log1p-udef49.8%
+-commutative49.8%
Applied egg-rr49.8%
+-commutative49.8%
associate-+l-46.2%
Simplified46.2%
log1p-udef46.2%
rem-exp-log46.4%
associate--r-50.0%
+-commutative50.0%
associate--r+51.8%
Applied egg-rr51.8%
if 3.3e16 < z Initial program 88.1%
associate-+l+88.1%
+-commutative88.1%
+-commutative88.1%
+-commutative88.1%
Simplified88.1%
Taylor expanded in t around 0 53.3%
Taylor expanded in x around inf 4.3%
associate--l+43.9%
+-commutative43.9%
associate--l+33.7%
+-commutative33.7%
Simplified33.7%
Taylor expanded in z around inf 53.0%
flip--92.3%
div-inv92.3%
add-sqr-sqrt72.8%
add-sqr-sqrt92.7%
associate--l+93.8%
Applied egg-rr53.1%
+-inverses93.8%
metadata-eval93.8%
*-lft-identity93.8%
Simplified53.1%
Final simplification52.4%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ 1.0 y))))
(if (<= z 5e+15)
(+ 1.0 (- (- (+ t_1 (sqrt (+ 1.0 z))) (sqrt z)) (sqrt y)))
(+ 1.0 (/ 1.0 (+ t_1 (sqrt y)))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + y));
double tmp;
if (z <= 5e+15) {
tmp = 1.0 + (((t_1 + sqrt((1.0 + z))) - sqrt(z)) - sqrt(y));
} else {
tmp = 1.0 + (1.0 / (t_1 + sqrt(y)));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = sqrt((1.0d0 + y))
if (z <= 5d+15) then
tmp = 1.0d0 + (((t_1 + sqrt((1.0d0 + z))) - sqrt(z)) - sqrt(y))
else
tmp = 1.0d0 + (1.0d0 / (t_1 + sqrt(y)))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + y));
double tmp;
if (z <= 5e+15) {
tmp = 1.0 + (((t_1 + Math.sqrt((1.0 + z))) - Math.sqrt(z)) - Math.sqrt(y));
} else {
tmp = 1.0 + (1.0 / (t_1 + Math.sqrt(y)));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + y)) tmp = 0 if z <= 5e+15: tmp = 1.0 + (((t_1 + math.sqrt((1.0 + z))) - math.sqrt(z)) - math.sqrt(y)) else: tmp = 1.0 + (1.0 / (t_1 + math.sqrt(y))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(1.0 + y)) tmp = 0.0 if (z <= 5e+15) tmp = Float64(1.0 + Float64(Float64(Float64(t_1 + sqrt(Float64(1.0 + z))) - sqrt(z)) - sqrt(y))); else tmp = Float64(1.0 + Float64(1.0 / Float64(t_1 + sqrt(y)))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + y));
tmp = 0.0;
if (z <= 5e+15)
tmp = 1.0 + (((t_1 + sqrt((1.0 + z))) - sqrt(z)) - sqrt(y));
else
tmp = 1.0 + (1.0 / (t_1 + sqrt(y)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[z, 5e+15], N[(1.0 + N[(N[(N[(t$95$1 + N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(1.0 / N[(t$95$1 + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + y}\\
\mathbf{if}\;z \leq 5 \cdot 10^{+15}:\\
\;\;\;\;1 + \left(\left(\left(t_1 + \sqrt{1 + z}\right) - \sqrt{z}\right) - \sqrt{y}\right)\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{1}{t_1 + \sqrt{y}}\\
\end{array}
\end{array}
if z < 5e15Initial program 96.4%
associate-+l+96.4%
+-commutative96.4%
+-commutative96.4%
+-commutative96.4%
Simplified96.4%
Taylor expanded in t around 0 56.2%
Taylor expanded in x around inf 29.8%
associate--l+46.4%
+-commutative46.4%
associate--l+50.0%
+-commutative50.0%
Simplified50.0%
associate-+r-46.4%
associate--r+46.4%
+-commutative46.4%
Applied egg-rr46.4%
if 5e15 < z Initial program 88.1%
associate-+l+88.1%
+-commutative88.1%
+-commutative88.1%
+-commutative88.1%
Simplified88.1%
Taylor expanded in t around 0 53.3%
Taylor expanded in x around inf 4.3%
associate--l+43.9%
+-commutative43.9%
associate--l+33.7%
+-commutative33.7%
Simplified33.7%
Taylor expanded in z around inf 53.0%
flip--92.3%
div-inv92.3%
add-sqr-sqrt72.8%
add-sqr-sqrt92.7%
associate--l+93.8%
Applied egg-rr53.1%
+-inverses93.8%
metadata-eval93.8%
*-lft-identity93.8%
Simplified53.1%
Final simplification49.3%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= z 9500000000000.0) (- (+ (sqrt (+ 1.0 z)) 2.0) (sqrt z)) (+ 1.0 (/ 1.0 (+ (sqrt (+ 1.0 y)) (sqrt y))))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (z <= 9500000000000.0) {
tmp = (sqrt((1.0 + z)) + 2.0) - sqrt(z);
} else {
tmp = 1.0 + (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 <= 9500000000000.0d0) then
tmp = (sqrt((1.0d0 + z)) + 2.0d0) - sqrt(z)
else
tmp = 1.0d0 + (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 <= 9500000000000.0) {
tmp = (Math.sqrt((1.0 + z)) + 2.0) - Math.sqrt(z);
} else {
tmp = 1.0 + (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 <= 9500000000000.0: tmp = (math.sqrt((1.0 + z)) + 2.0) - math.sqrt(z) else: tmp = 1.0 + (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 <= 9500000000000.0) tmp = Float64(Float64(sqrt(Float64(1.0 + z)) + 2.0) - sqrt(z)); else tmp = Float64(1.0 + 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 <= 9500000000000.0)
tmp = (sqrt((1.0 + z)) + 2.0) - sqrt(z);
else
tmp = 1.0 + (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, 9500000000000.0], N[(N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] + 2.0), $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(1.0 / N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq 9500000000000:\\
\;\;\;\;\left(\sqrt{1 + z} + 2\right) - \sqrt{z}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{1}{\sqrt{1 + y} + \sqrt{y}}\\
\end{array}
\end{array}
if z < 9.5e12Initial program 97.0%
associate-+l+97.0%
+-commutative97.0%
+-commutative97.0%
+-commutative97.0%
Simplified97.0%
Taylor expanded in t around 0 56.8%
Taylor expanded in x around inf 29.7%
associate--l+46.5%
+-commutative46.5%
associate--l+50.2%
+-commutative50.2%
Simplified50.2%
Taylor expanded in y around 0 44.5%
if 9.5e12 < z Initial program 87.4%
associate-+l+87.4%
+-commutative87.4%
+-commutative87.4%
+-commutative87.4%
Simplified87.4%
Taylor expanded in t around 0 52.7%
Taylor expanded in x around inf 4.9%
associate--l+43.9%
+-commutative43.9%
associate--l+33.7%
+-commutative33.7%
Simplified33.7%
Taylor expanded in z around inf 52.6%
flip--91.5%
div-inv91.5%
add-sqr-sqrt72.4%
add-sqr-sqrt91.9%
associate--l+93.0%
Applied egg-rr52.8%
+-inverses93.0%
metadata-eval93.0%
*-lft-identity93.0%
Simplified52.8%
Final simplification48.1%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= z 8500000000000.0) (+ (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 <= 8500000000000.0) {
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 <= 8500000000000.0d0) 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 <= 8500000000000.0) {
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 <= 8500000000000.0: 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 <= 8500000000000.0) 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 <= 8500000000000.0)
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, 8500000000000.0], 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 8500000000000:\\
\;\;\;\;\sqrt{1 + z} + \left(2 - \sqrt{z}\right)\\
\mathbf{else}:\\
\;\;\;\;1 + \left(\sqrt{1 + y} - \sqrt{y}\right)\\
\end{array}
\end{array}
if z < 8.5e12Initial program 97.0%
associate-+l+97.0%
+-commutative97.0%
+-commutative97.0%
+-commutative97.0%
Simplified97.0%
Taylor expanded in t around 0 56.8%
Taylor expanded in x around inf 29.7%
associate--l+46.5%
+-commutative46.5%
associate--l+50.2%
+-commutative50.2%
Simplified50.2%
Taylor expanded in y around 0 44.5%
+-commutative44.5%
associate--l+44.5%
Simplified44.5%
if 8.5e12 < z Initial program 87.4%
associate-+l+87.4%
+-commutative87.4%
+-commutative87.4%
+-commutative87.4%
Simplified87.4%
Taylor expanded in t around 0 52.7%
Taylor expanded in x around inf 4.9%
associate--l+43.9%
+-commutative43.9%
associate--l+33.7%
+-commutative33.7%
Simplified33.7%
Taylor expanded in z around inf 52.6%
Final simplification48.1%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= z 8200000000000.0) (- (+ (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 <= 8200000000000.0) {
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 <= 8200000000000.0d0) 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 <= 8200000000000.0) {
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 <= 8200000000000.0: 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 <= 8200000000000.0) 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 <= 8200000000000.0)
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, 8200000000000.0], 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 8200000000000:\\
\;\;\;\;\left(\sqrt{1 + z} + 2\right) - \sqrt{z}\\
\mathbf{else}:\\
\;\;\;\;1 + \left(\sqrt{1 + y} - \sqrt{y}\right)\\
\end{array}
\end{array}
if z < 8.2e12Initial program 97.0%
associate-+l+97.0%
+-commutative97.0%
+-commutative97.0%
+-commutative97.0%
Simplified97.0%
Taylor expanded in t around 0 56.8%
Taylor expanded in x around inf 29.7%
associate--l+46.5%
+-commutative46.5%
associate--l+50.2%
+-commutative50.2%
Simplified50.2%
Taylor expanded in y around 0 44.5%
if 8.2e12 < z Initial program 87.4%
associate-+l+87.4%
+-commutative87.4%
+-commutative87.4%
+-commutative87.4%
Simplified87.4%
Taylor expanded in t around 0 52.7%
Taylor expanded in x around inf 4.9%
associate--l+43.9%
+-commutative43.9%
associate--l+33.7%
+-commutative33.7%
Simplified33.7%
Taylor expanded in z around inf 52.6%
Final simplification48.1%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (+ 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.8%
associate-+l+92.8%
+-commutative92.8%
+-commutative92.8%
+-commutative92.8%
Simplified92.8%
Taylor expanded in t around 0 55.0%
Taylor expanded in x around inf 18.9%
associate--l+45.4%
+-commutative45.4%
associate--l+43.0%
+-commutative43.0%
Simplified43.0%
Taylor expanded in z around inf 45.2%
Final simplification45.2%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= y 2.5) (+ 1.0 (- (+ 1.0 (* y 0.5)) (sqrt y))) 1.0))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 2.5) {
tmp = 1.0 + ((1.0 + (y * 0.5)) - sqrt(y));
} else {
tmp = 1.0;
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= 2.5d0) then
tmp = 1.0d0 + ((1.0d0 + (y * 0.5d0)) - sqrt(y))
else
tmp = 1.0d0
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= 2.5) {
tmp = 1.0 + ((1.0 + (y * 0.5)) - Math.sqrt(y));
} else {
tmp = 1.0;
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if y <= 2.5: tmp = 1.0 + ((1.0 + (y * 0.5)) - math.sqrt(y)) else: tmp = 1.0 return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (y <= 2.5) tmp = Float64(1.0 + Float64(Float64(1.0 + Float64(y * 0.5)) - sqrt(y))); else tmp = 1.0; end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (y <= 2.5)
tmp = 1.0 + ((1.0 + (y * 0.5)) - sqrt(y));
else
tmp = 1.0;
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[y, 2.5], N[(1.0 + N[(N[(1.0 + N[(y * 0.5), $MachinePrecision]), $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1.0]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 2.5:\\
\;\;\;\;1 + \left(\left(1 + y \cdot 0.5\right) - \sqrt{y}\right)\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if y < 2.5Initial program 97.9%
associate-+l+97.9%
+-commutative97.9%
+-commutative97.9%
+-commutative97.9%
Simplified97.9%
Taylor expanded in t around 0 57.1%
Taylor expanded in x around inf 33.2%
associate--l+47.1%
+-commutative47.1%
associate--l+47.1%
+-commutative47.1%
Simplified47.1%
Taylor expanded in z around inf 45.0%
Taylor expanded in y around 0 44.5%
if 2.5 < y Initial program 88.0%
associate-+l+88.0%
+-commutative88.0%
+-commutative88.0%
+-commutative88.0%
Simplified88.0%
Taylor expanded in t around 0 53.0%
Taylor expanded in x around inf 5.2%
associate--l+43.7%
+-commutative43.7%
associate--l+39.1%
+-commutative39.1%
Simplified39.1%
Taylor expanded in z around inf 45.4%
Taylor expanded in y around inf 44.2%
Final simplification44.4%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= y 1.8) 2.0 1.0))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 1.8) {
tmp = 2.0;
} else {
tmp = 1.0;
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= 1.8d0) then
tmp = 2.0d0
else
tmp = 1.0d0
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= 1.8) {
tmp = 2.0;
} else {
tmp = 1.0;
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if y <= 1.8: tmp = 2.0 else: tmp = 1.0 return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (y <= 1.8) tmp = 2.0; else tmp = 1.0; end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (y <= 1.8)
tmp = 2.0;
else
tmp = 1.0;
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[y, 1.8], 2.0, 1.0]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 1.8:\\
\;\;\;\;2\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if y < 1.80000000000000004Initial program 97.9%
associate-+l+97.9%
+-commutative97.9%
+-commutative97.9%
+-commutative97.9%
Simplified97.9%
Taylor expanded in t around 0 57.1%
Taylor expanded in x around inf 33.2%
associate--l+47.1%
+-commutative47.1%
associate--l+47.1%
+-commutative47.1%
Simplified47.1%
Taylor expanded in z around inf 45.0%
Taylor expanded in y around 0 44.0%
if 1.80000000000000004 < y Initial program 88.0%
associate-+l+88.0%
+-commutative88.0%
+-commutative88.0%
+-commutative88.0%
Simplified88.0%
Taylor expanded in t around 0 53.0%
Taylor expanded in x around inf 5.2%
associate--l+43.7%
+-commutative43.7%
associate--l+39.1%
+-commutative39.1%
Simplified39.1%
Taylor expanded in z around inf 45.4%
Taylor expanded in y around inf 44.2%
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 1.0)
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
return 1.0;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = 1.0d0
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
return 1.0;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): return 1.0
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) return 1.0 end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp = code(x, y, z, t)
tmp = 1.0;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := 1.0
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
1
\end{array}
Initial program 92.8%
associate-+l+92.8%
+-commutative92.8%
+-commutative92.8%
+-commutative92.8%
Simplified92.8%
Taylor expanded in t around 0 55.0%
Taylor expanded in x around inf 18.9%
associate--l+45.4%
+-commutative45.4%
associate--l+43.0%
+-commutative43.0%
Simplified43.0%
Taylor expanded in z around inf 45.2%
Taylor expanded in y around inf 35.6%
Final simplification35.6%
(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 2024019
(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))))