
(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 25 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 (+ (+ (/ 1.0 (+ (sqrt (+ 1.0 x)) (sqrt x))) (/ 1.0 (+ (sqrt (+ 1.0 y)) (sqrt y)))) (+ (/ 1.0 (+ (sqrt (+ 1.0 z)) (sqrt z))) (/ 1.0 (+ (sqrt t) (sqrt (+ 1.0 t)))))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
return ((1.0 / (sqrt((1.0 + x)) + sqrt(x))) + (1.0 / (sqrt((1.0 + y)) + sqrt(y)))) + ((1.0 / (sqrt((1.0 + z)) + sqrt(z))) + (1.0 / (sqrt(t) + sqrt((1.0 + 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((1.0d0 + x)) + sqrt(x))) + (1.0d0 / (sqrt((1.0d0 + y)) + sqrt(y)))) + ((1.0d0 / (sqrt((1.0d0 + z)) + sqrt(z))) + (1.0d0 / (sqrt(t) + sqrt((1.0d0 + 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((1.0 + x)) + Math.sqrt(x))) + (1.0 / (Math.sqrt((1.0 + y)) + Math.sqrt(y)))) + ((1.0 / (Math.sqrt((1.0 + z)) + Math.sqrt(z))) + (1.0 / (Math.sqrt(t) + Math.sqrt((1.0 + t)))));
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): return ((1.0 / (math.sqrt((1.0 + x)) + math.sqrt(x))) + (1.0 / (math.sqrt((1.0 + y)) + math.sqrt(y)))) + ((1.0 / (math.sqrt((1.0 + z)) + math.sqrt(z))) + (1.0 / (math.sqrt(t) + math.sqrt((1.0 + t)))))
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) return Float64(Float64(Float64(1.0 / Float64(sqrt(Float64(1.0 + x)) + sqrt(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(1.0 / Float64(sqrt(t) + sqrt(Float64(1.0 + t)))))) end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp = code(x, y, z, t)
tmp = ((1.0 / (sqrt((1.0 + x)) + sqrt(x))) + (1.0 / (sqrt((1.0 + y)) + sqrt(y)))) + ((1.0 / (sqrt((1.0 + z)) + sqrt(z))) + (1.0 / (sqrt(t) + sqrt((1.0 + 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[N[(1.0 + x), $MachinePrecision]], $MachinePrecision] + N[Sqrt[x], $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[(1.0 / N[(N[Sqrt[t], $MachinePrecision] + N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\left(\frac{1}{\sqrt{1 + x} + \sqrt{x}} + \frac{1}{\sqrt{1 + y} + \sqrt{y}}\right) + \left(\frac{1}{\sqrt{1 + z} + \sqrt{z}} + \frac{1}{\sqrt{t} + \sqrt{1 + t}}\right)
\end{array}
Initial program 90.5%
associate-+l+90.5%
+-commutative90.5%
+-commutative90.5%
+-commutative90.5%
Simplified90.5%
flip--90.8%
add-sqr-sqrt68.9%
+-commutative68.9%
add-sqr-sqrt91.0%
+-commutative91.0%
Applied egg-rr91.0%
associate--l+92.2%
+-inverses92.2%
metadata-eval92.2%
Simplified92.2%
flip--92.2%
add-sqr-sqrt72.0%
add-sqr-sqrt92.6%
Applied egg-rr92.6%
associate--l+95.3%
+-inverses95.3%
metadata-eval95.3%
Simplified95.3%
flip--95.5%
add-sqr-sqrt75.3%
add-sqr-sqrt95.6%
Applied egg-rr95.6%
associate--l+97.8%
+-inverses97.8%
metadata-eval97.8%
Simplified97.8%
flip--97.8%
add-sqr-sqrt77.2%
+-commutative77.2%
add-sqr-sqrt98.3%
+-commutative98.3%
Applied egg-rr98.3%
+-commutative98.3%
+-commutative98.3%
associate--l+99.8%
+-inverses99.8%
metadata-eval99.8%
+-commutative99.8%
Simplified99.8%
Final simplification99.8%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ 1.0 x)))
(t_2 (sqrt (+ 1.0 z)))
(t_3 (- t_2 (sqrt z)))
(t_4 (sqrt (+ 1.0 y))))
(if (<= t_3 0.1)
(+
(+ (/ 1.0 (+ t_1 (sqrt x))) (/ 1.0 (+ t_4 (sqrt y))))
(/ 1.0 (+ t_2 (sqrt z))))
(+
(+ (- t_1 (sqrt x)) (- t_4 (sqrt y)))
(+ (/ 1.0 (+ (sqrt t) (sqrt (+ 1.0 t)))) t_3)))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + x));
double t_2 = sqrt((1.0 + z));
double t_3 = t_2 - sqrt(z);
double t_4 = sqrt((1.0 + y));
double tmp;
if (t_3 <= 0.1) {
tmp = ((1.0 / (t_1 + sqrt(x))) + (1.0 / (t_4 + sqrt(y)))) + (1.0 / (t_2 + sqrt(z)));
} else {
tmp = ((t_1 - sqrt(x)) + (t_4 - sqrt(y))) + ((1.0 / (sqrt(t) + sqrt((1.0 + t)))) + t_3);
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: tmp
t_1 = sqrt((1.0d0 + x))
t_2 = sqrt((1.0d0 + z))
t_3 = t_2 - sqrt(z)
t_4 = sqrt((1.0d0 + y))
if (t_3 <= 0.1d0) then
tmp = ((1.0d0 / (t_1 + sqrt(x))) + (1.0d0 / (t_4 + sqrt(y)))) + (1.0d0 / (t_2 + sqrt(z)))
else
tmp = ((t_1 - sqrt(x)) + (t_4 - sqrt(y))) + ((1.0d0 / (sqrt(t) + sqrt((1.0d0 + t)))) + t_3)
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + x));
double t_2 = Math.sqrt((1.0 + z));
double t_3 = t_2 - Math.sqrt(z);
double t_4 = Math.sqrt((1.0 + y));
double tmp;
if (t_3 <= 0.1) {
tmp = ((1.0 / (t_1 + Math.sqrt(x))) + (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))) + ((1.0 / (Math.sqrt(t) + Math.sqrt((1.0 + t)))) + t_3);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + x)) t_2 = math.sqrt((1.0 + z)) t_3 = t_2 - math.sqrt(z) t_4 = math.sqrt((1.0 + y)) tmp = 0 if t_3 <= 0.1: tmp = ((1.0 / (t_1 + math.sqrt(x))) + (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))) + ((1.0 / (math.sqrt(t) + math.sqrt((1.0 + t)))) + t_3) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(1.0 + x)) t_2 = sqrt(Float64(1.0 + z)) t_3 = Float64(t_2 - sqrt(z)) t_4 = sqrt(Float64(1.0 + y)) tmp = 0.0 if (t_3 <= 0.1) tmp = Float64(Float64(Float64(1.0 / Float64(t_1 + sqrt(x))) + 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(Float64(1.0 / Float64(sqrt(t) + sqrt(Float64(1.0 + t)))) + t_3)); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + x));
t_2 = sqrt((1.0 + z));
t_3 = t_2 - sqrt(z);
t_4 = sqrt((1.0 + y));
tmp = 0.0;
if (t_3 <= 0.1)
tmp = ((1.0 / (t_1 + sqrt(x))) + (1.0 / (t_4 + sqrt(y)))) + (1.0 / (t_2 + sqrt(z)));
else
tmp = ((t_1 - sqrt(x)) + (t_4 - sqrt(y))) + ((1.0 / (sqrt(t) + sqrt((1.0 + t)))) + t_3);
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[(t$95$2 - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t$95$3, 0.1], N[(N[(N[(1.0 / N[(t$95$1 + N[Sqrt[x], $MachinePrecision]), $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[(N[(1.0 / N[(N[Sqrt[t], $MachinePrecision] + N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$3), $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.1:\\
\;\;\;\;\left(\frac{1}{t_1 + \sqrt{x}} + \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(\frac{1}{\sqrt{t} + \sqrt{1 + t}} + t_3\right)\\
\end{array}
\end{array}
if (-.f64 (sqrt.f64 (+.f64 z 1)) (sqrt.f64 z)) < 0.10000000000000001Initial program 83.4%
associate-+l+83.4%
+-commutative83.4%
+-commutative83.4%
+-commutative83.4%
Simplified83.4%
flip--83.7%
add-sqr-sqrt63.7%
+-commutative63.7%
add-sqr-sqrt83.7%
+-commutative83.7%
Applied egg-rr83.7%
associate--l+86.0%
+-inverses86.0%
metadata-eval86.0%
Simplified86.0%
flip--86.1%
add-sqr-sqrt69.1%
add-sqr-sqrt86.5%
Applied egg-rr86.5%
associate--l+91.4%
+-inverses91.4%
metadata-eval91.4%
Simplified91.4%
Taylor expanded in t around inf 50.2%
flip--92.0%
add-sqr-sqrt48.9%
add-sqr-sqrt92.2%
Applied egg-rr50.7%
associate--l+96.8%
+-inverses96.8%
metadata-eval96.8%
Simplified54.6%
if 0.10000000000000001 < (-.f64 (sqrt.f64 (+.f64 z 1)) (sqrt.f64 z)) Initial program 96.8%
associate-+l+96.8%
+-commutative96.8%
+-commutative96.8%
+-commutative96.8%
Simplified96.8%
flip--98.6%
add-sqr-sqrt77.2%
+-commutative77.2%
add-sqr-sqrt99.2%
+-commutative99.2%
Applied egg-rr97.4%
+-commutative99.2%
+-commutative99.2%
associate--l+99.8%
+-inverses99.8%
metadata-eval99.8%
+-commutative99.8%
Simplified97.8%
Final simplification77.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 (/ 1.0 (+ (sqrt (+ 1.0 y)) (sqrt y))))
(t_2 (sqrt (+ 1.0 x)))
(t_3 (sqrt (+ 1.0 z))))
(if (<= (- t_2 (sqrt x)) 0.99999999999999)
(+ (+ (/ 1.0 (+ t_2 (sqrt x))) t_1) (- t_3 (sqrt z)))
(+
(+ (/ 1.0 (+ t_3 (sqrt z))) (- (sqrt (+ 1.0 t)) (sqrt t)))
(+ 1.0 t_1)))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = 1.0 / (sqrt((1.0 + y)) + sqrt(y));
double t_2 = sqrt((1.0 + x));
double t_3 = sqrt((1.0 + z));
double tmp;
if ((t_2 - sqrt(x)) <= 0.99999999999999) {
tmp = ((1.0 / (t_2 + sqrt(x))) + t_1) + (t_3 - sqrt(z));
} else {
tmp = ((1.0 / (t_3 + sqrt(z))) + (sqrt((1.0 + t)) - sqrt(t))) + (1.0 + 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) :: t_3
real(8) :: tmp
t_1 = 1.0d0 / (sqrt((1.0d0 + y)) + sqrt(y))
t_2 = sqrt((1.0d0 + x))
t_3 = sqrt((1.0d0 + z))
if ((t_2 - sqrt(x)) <= 0.99999999999999d0) then
tmp = ((1.0d0 / (t_2 + sqrt(x))) + t_1) + (t_3 - sqrt(z))
else
tmp = ((1.0d0 / (t_3 + sqrt(z))) + (sqrt((1.0d0 + t)) - sqrt(t))) + (1.0d0 + 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 = 1.0 / (Math.sqrt((1.0 + y)) + Math.sqrt(y));
double t_2 = Math.sqrt((1.0 + x));
double t_3 = Math.sqrt((1.0 + z));
double tmp;
if ((t_2 - Math.sqrt(x)) <= 0.99999999999999) {
tmp = ((1.0 / (t_2 + Math.sqrt(x))) + t_1) + (t_3 - Math.sqrt(z));
} else {
tmp = ((1.0 / (t_3 + Math.sqrt(z))) + (Math.sqrt((1.0 + t)) - Math.sqrt(t))) + (1.0 + t_1);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = 1.0 / (math.sqrt((1.0 + y)) + math.sqrt(y)) t_2 = math.sqrt((1.0 + x)) t_3 = math.sqrt((1.0 + z)) tmp = 0 if (t_2 - math.sqrt(x)) <= 0.99999999999999: tmp = ((1.0 / (t_2 + math.sqrt(x))) + t_1) + (t_3 - math.sqrt(z)) else: tmp = ((1.0 / (t_3 + math.sqrt(z))) + (math.sqrt((1.0 + t)) - math.sqrt(t))) + (1.0 + t_1) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = Float64(1.0 / Float64(sqrt(Float64(1.0 + y)) + sqrt(y))) t_2 = sqrt(Float64(1.0 + x)) t_3 = sqrt(Float64(1.0 + z)) tmp = 0.0 if (Float64(t_2 - sqrt(x)) <= 0.99999999999999) tmp = Float64(Float64(Float64(1.0 / Float64(t_2 + sqrt(x))) + t_1) + Float64(t_3 - sqrt(z))); else tmp = Float64(Float64(Float64(1.0 / Float64(t_3 + sqrt(z))) + Float64(sqrt(Float64(1.0 + t)) - sqrt(t))) + Float64(1.0 + 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 = 1.0 / (sqrt((1.0 + y)) + sqrt(y));
t_2 = sqrt((1.0 + x));
t_3 = sqrt((1.0 + z));
tmp = 0.0;
if ((t_2 - sqrt(x)) <= 0.99999999999999)
tmp = ((1.0 / (t_2 + sqrt(x))) + t_1) + (t_3 - sqrt(z));
else
tmp = ((1.0 / (t_3 + sqrt(z))) + (sqrt((1.0 + t)) - sqrt(t))) + (1.0 + 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[(1.0 / N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(t$95$2 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision], 0.99999999999999], N[(N[(N[(1.0 / N[(t$95$2 + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision] + N[(t$95$3 - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 / N[(t$95$3 + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 + t$95$1), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \frac{1}{\sqrt{1 + y} + \sqrt{y}}\\
t_2 := \sqrt{1 + x}\\
t_3 := \sqrt{1 + z}\\
\mathbf{if}\;t_2 - \sqrt{x} \leq 0.99999999999999:\\
\;\;\;\;\left(\frac{1}{t_2 + \sqrt{x}} + t_1\right) + \left(t_3 - \sqrt{z}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{1}{t_3 + \sqrt{z}} + \left(\sqrt{1 + t} - \sqrt{t}\right)\right) + \left(1 + t_1\right)\\
\end{array}
\end{array}
if (-.f64 (sqrt.f64 (+.f64 x 1)) (sqrt.f64 x)) < 0.99999999999999001Initial program 87.0%
associate-+l+87.0%
+-commutative87.0%
+-commutative87.0%
+-commutative87.0%
Simplified87.0%
flip--87.4%
add-sqr-sqrt51.8%
+-commutative51.8%
add-sqr-sqrt87.8%
+-commutative87.8%
Applied egg-rr87.8%
associate--l+89.8%
+-inverses89.8%
metadata-eval89.8%
Simplified89.8%
flip--89.8%
add-sqr-sqrt68.6%
add-sqr-sqrt90.2%
Applied egg-rr90.2%
associate--l+93.6%
+-inverses93.6%
metadata-eval93.6%
Simplified93.6%
Taylor expanded in t around inf 56.0%
if 0.99999999999999001 < (-.f64 (sqrt.f64 (+.f64 x 1)) (sqrt.f64 x)) Initial program 96.1%
associate-+l+96.1%
+-commutative96.1%
+-commutative96.1%
+-commutative96.1%
Simplified96.1%
flip--96.1%
add-sqr-sqrt96.1%
+-commutative96.1%
add-sqr-sqrt96.1%
+-commutative96.1%
Applied egg-rr96.1%
associate--l+96.1%
+-inverses96.1%
metadata-eval96.1%
Simplified96.1%
flip--96.1%
add-sqr-sqrt77.5%
add-sqr-sqrt96.4%
Applied egg-rr96.4%
associate--l+97.9%
+-inverses97.9%
metadata-eval97.9%
Simplified97.9%
flip--97.8%
add-sqr-sqrt77.6%
add-sqr-sqrt98.0%
Applied egg-rr98.0%
associate--l+99.0%
+-inverses99.0%
metadata-eval99.0%
Simplified99.0%
Taylor expanded in x around 0 99.0%
+-commutative56.1%
Simplified99.0%
Final simplification72.6%
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 x)) (sqrt 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((1.0 + x)) + sqrt(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((1.0d0 + x)) + sqrt(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((1.0 + x)) + Math.sqrt(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((1.0 + x)) + math.sqrt(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(Float64(1.0 + x)) + sqrt(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((1.0 + x)) + sqrt(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[N[(1.0 + x), $MachinePrecision]], $MachinePrecision] + N[Sqrt[x], $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{1 + x} + \sqrt{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 90.5%
associate-+l+90.5%
+-commutative90.5%
+-commutative90.5%
+-commutative90.5%
Simplified90.5%
flip--90.8%
add-sqr-sqrt68.9%
+-commutative68.9%
add-sqr-sqrt91.0%
+-commutative91.0%
Applied egg-rr91.0%
associate--l+92.2%
+-inverses92.2%
metadata-eval92.2%
Simplified92.2%
flip--92.2%
add-sqr-sqrt72.0%
add-sqr-sqrt92.6%
Applied egg-rr92.6%
associate--l+95.3%
+-inverses95.3%
metadata-eval95.3%
Simplified95.3%
flip--95.5%
add-sqr-sqrt75.3%
add-sqr-sqrt95.6%
Applied egg-rr95.6%
associate--l+97.8%
+-inverses97.8%
metadata-eval97.8%
Simplified97.8%
Final simplification97.8%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ 1.0 x))) (t_2 (- (sqrt (+ 1.0 z)) (sqrt z))))
(if (<= (- t_1 (sqrt x)) 1.0)
(+ t_2 (+ (/ 1.0 (+ t_1 (sqrt x))) (/ 1.0 (+ 1.0 (sqrt y)))))
(+
(+ (- (sqrt (+ 1.0 t)) (sqrt t)) t_2)
(+ 1.0 (- (sqrt (+ 1.0 y)) (sqrt y)))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + x));
double t_2 = sqrt((1.0 + z)) - sqrt(z);
double tmp;
if ((t_1 - sqrt(x)) <= 1.0) {
tmp = t_2 + ((1.0 / (t_1 + sqrt(x))) + (1.0 / (1.0 + sqrt(y))));
} else {
tmp = ((sqrt((1.0 + t)) - sqrt(t)) + t_2) + (1.0 + (sqrt((1.0 + y)) - sqrt(y)));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = sqrt((1.0d0 + x))
t_2 = sqrt((1.0d0 + z)) - sqrt(z)
if ((t_1 - sqrt(x)) <= 1.0d0) then
tmp = t_2 + ((1.0d0 / (t_1 + sqrt(x))) + (1.0d0 / (1.0d0 + sqrt(y))))
else
tmp = ((sqrt((1.0d0 + t)) - sqrt(t)) + t_2) + (1.0d0 + (sqrt((1.0d0 + y)) - sqrt(y)))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + x));
double t_2 = Math.sqrt((1.0 + z)) - Math.sqrt(z);
double tmp;
if ((t_1 - Math.sqrt(x)) <= 1.0) {
tmp = t_2 + ((1.0 / (t_1 + Math.sqrt(x))) + (1.0 / (1.0 + Math.sqrt(y))));
} else {
tmp = ((Math.sqrt((1.0 + t)) - Math.sqrt(t)) + t_2) + (1.0 + (Math.sqrt((1.0 + y)) - Math.sqrt(y)));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + x)) t_2 = math.sqrt((1.0 + z)) - math.sqrt(z) tmp = 0 if (t_1 - math.sqrt(x)) <= 1.0: tmp = t_2 + ((1.0 / (t_1 + math.sqrt(x))) + (1.0 / (1.0 + math.sqrt(y)))) else: tmp = ((math.sqrt((1.0 + t)) - math.sqrt(t)) + t_2) + (1.0 + (math.sqrt((1.0 + y)) - math.sqrt(y))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(1.0 + x)) t_2 = Float64(sqrt(Float64(1.0 + z)) - sqrt(z)) tmp = 0.0 if (Float64(t_1 - sqrt(x)) <= 1.0) tmp = Float64(t_2 + Float64(Float64(1.0 / Float64(t_1 + sqrt(x))) + Float64(1.0 / Float64(1.0 + sqrt(y))))); else tmp = Float64(Float64(Float64(sqrt(Float64(1.0 + t)) - sqrt(t)) + t_2) + Float64(1.0 + Float64(sqrt(Float64(1.0 + y)) - sqrt(y)))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + x));
t_2 = sqrt((1.0 + z)) - sqrt(z);
tmp = 0.0;
if ((t_1 - sqrt(x)) <= 1.0)
tmp = t_2 + ((1.0 / (t_1 + sqrt(x))) + (1.0 / (1.0 + sqrt(y))));
else
tmp = ((sqrt((1.0 + t)) - sqrt(t)) + t_2) + (1.0 + (sqrt((1.0 + y)) - sqrt(y)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(t$95$1 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision], 1.0], N[(t$95$2 + N[(N[(1.0 / N[(t$95$1 + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(1.0 + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision] + t$95$2), $MachinePrecision] + N[(1.0 + N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + x}\\
t_2 := \sqrt{1 + z} - \sqrt{z}\\
\mathbf{if}\;t_1 - \sqrt{x} \leq 1:\\
\;\;\;\;t_2 + \left(\frac{1}{t_1 + \sqrt{x}} + \frac{1}{1 + \sqrt{y}}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\sqrt{1 + t} - \sqrt{t}\right) + t_2\right) + \left(1 + \left(\sqrt{1 + y} - \sqrt{y}\right)\right)\\
\end{array}
\end{array}
if (-.f64 (sqrt.f64 (+.f64 x 1)) (sqrt.f64 x)) < 1Initial program 90.5%
associate-+l+90.5%
+-commutative90.5%
+-commutative90.5%
+-commutative90.5%
Simplified90.5%
flip--90.8%
add-sqr-sqrt68.9%
+-commutative68.9%
add-sqr-sqrt91.0%
+-commutative91.0%
Applied egg-rr91.0%
associate--l+92.2%
+-inverses92.2%
metadata-eval92.2%
Simplified92.2%
flip--92.2%
add-sqr-sqrt72.0%
add-sqr-sqrt92.6%
Applied egg-rr92.6%
associate--l+95.3%
+-inverses95.3%
metadata-eval95.3%
Simplified95.3%
Taylor expanded in t around inf 56.0%
Taylor expanded in y around 0 52.5%
if 1 < (-.f64 (sqrt.f64 (+.f64 x 1)) (sqrt.f64 x)) Initial program 90.5%
associate-+l+90.5%
+-commutative90.5%
+-commutative90.5%
+-commutative90.5%
Simplified90.5%
Taylor expanded in x around 0 50.7%
Final simplification52.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 (/ 1.0 (+ (sqrt (+ 1.0 x)) (sqrt x))))
(t_2 (/ 1.0 (+ (sqrt (+ 1.0 z)) (sqrt z)))))
(if (<= z 1.45e+19)
(+
(+ t_2 (- (sqrt (+ 1.0 t)) (sqrt t)))
(+ t_1 (/ 1.0 (+ (sqrt y) (+ 1.0 (* y 0.5))))))
(+ (+ t_1 (/ 1.0 (+ (sqrt (+ 1.0 y)) (sqrt y)))) t_2))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = 1.0 / (sqrt((1.0 + x)) + sqrt(x));
double t_2 = 1.0 / (sqrt((1.0 + z)) + sqrt(z));
double tmp;
if (z <= 1.45e+19) {
tmp = (t_2 + (sqrt((1.0 + t)) - sqrt(t))) + (t_1 + (1.0 / (sqrt(y) + (1.0 + (y * 0.5)))));
} else {
tmp = (t_1 + (1.0 / (sqrt((1.0 + y)) + sqrt(y)))) + t_2;
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = 1.0d0 / (sqrt((1.0d0 + x)) + sqrt(x))
t_2 = 1.0d0 / (sqrt((1.0d0 + z)) + sqrt(z))
if (z <= 1.45d+19) then
tmp = (t_2 + (sqrt((1.0d0 + t)) - sqrt(t))) + (t_1 + (1.0d0 / (sqrt(y) + (1.0d0 + (y * 0.5d0)))))
else
tmp = (t_1 + (1.0d0 / (sqrt((1.0d0 + y)) + sqrt(y)))) + 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 = 1.0 / (Math.sqrt((1.0 + x)) + Math.sqrt(x));
double t_2 = 1.0 / (Math.sqrt((1.0 + z)) + Math.sqrt(z));
double tmp;
if (z <= 1.45e+19) {
tmp = (t_2 + (Math.sqrt((1.0 + t)) - Math.sqrt(t))) + (t_1 + (1.0 / (Math.sqrt(y) + (1.0 + (y * 0.5)))));
} else {
tmp = (t_1 + (1.0 / (Math.sqrt((1.0 + y)) + Math.sqrt(y)))) + t_2;
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = 1.0 / (math.sqrt((1.0 + x)) + math.sqrt(x)) t_2 = 1.0 / (math.sqrt((1.0 + z)) + math.sqrt(z)) tmp = 0 if z <= 1.45e+19: tmp = (t_2 + (math.sqrt((1.0 + t)) - math.sqrt(t))) + (t_1 + (1.0 / (math.sqrt(y) + (1.0 + (y * 0.5))))) else: tmp = (t_1 + (1.0 / (math.sqrt((1.0 + y)) + math.sqrt(y)))) + t_2 return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = Float64(1.0 / Float64(sqrt(Float64(1.0 + x)) + sqrt(x))) t_2 = Float64(1.0 / Float64(sqrt(Float64(1.0 + z)) + sqrt(z))) tmp = 0.0 if (z <= 1.45e+19) tmp = Float64(Float64(t_2 + Float64(sqrt(Float64(1.0 + t)) - sqrt(t))) + Float64(t_1 + Float64(1.0 / Float64(sqrt(y) + Float64(1.0 + Float64(y * 0.5)))))); else tmp = Float64(Float64(t_1 + Float64(1.0 / Float64(sqrt(Float64(1.0 + y)) + sqrt(y)))) + 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 = 1.0 / (sqrt((1.0 + x)) + sqrt(x));
t_2 = 1.0 / (sqrt((1.0 + z)) + sqrt(z));
tmp = 0.0;
if (z <= 1.45e+19)
tmp = (t_2 + (sqrt((1.0 + t)) - sqrt(t))) + (t_1 + (1.0 / (sqrt(y) + (1.0 + (y * 0.5)))));
else
tmp = (t_1 + (1.0 / (sqrt((1.0 + y)) + sqrt(y)))) + 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[(1.0 / N[(N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(1.0 / N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, 1.45e+19], N[(N[(t$95$2 + N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$1 + N[(1.0 / N[(N[Sqrt[y], $MachinePrecision] + N[(1.0 + N[(y * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(t$95$1 + N[(1.0 / N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$2), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \frac{1}{\sqrt{1 + x} + \sqrt{x}}\\
t_2 := \frac{1}{\sqrt{1 + z} + \sqrt{z}}\\
\mathbf{if}\;z \leq 1.45 \cdot 10^{+19}:\\
\;\;\;\;\left(t_2 + \left(\sqrt{1 + t} - \sqrt{t}\right)\right) + \left(t_1 + \frac{1}{\sqrt{y} + \left(1 + y \cdot 0.5\right)}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(t_1 + \frac{1}{\sqrt{1 + y} + \sqrt{y}}\right) + t_2\\
\end{array}
\end{array}
if z < 1.45e19Initial program 95.9%
associate-+l+95.9%
+-commutative95.9%
+-commutative95.9%
+-commutative95.9%
Simplified95.9%
flip--96.1%
add-sqr-sqrt72.7%
+-commutative72.7%
add-sqr-sqrt96.5%
+-commutative96.5%
Applied egg-rr96.5%
associate--l+96.7%
+-inverses96.7%
metadata-eval96.7%
Simplified96.7%
flip--96.6%
add-sqr-sqrt74.7%
add-sqr-sqrt96.9%
Applied egg-rr96.9%
associate--l+97.6%
+-inverses97.6%
metadata-eval97.6%
Simplified97.6%
flip--98.0%
add-sqr-sqrt97.7%
add-sqr-sqrt98.2%
Applied egg-rr98.2%
associate--l+98.7%
+-inverses98.7%
metadata-eval98.7%
Simplified98.7%
Taylor expanded in y around 0 96.9%
*-commutative96.9%
Simplified96.9%
if 1.45e19 < z Initial program 83.8%
associate-+l+83.8%
+-commutative83.8%
+-commutative83.8%
+-commutative83.8%
Simplified83.8%
flip--84.1%
add-sqr-sqrt64.1%
+-commutative64.1%
add-sqr-sqrt84.1%
+-commutative84.1%
Applied egg-rr84.1%
associate--l+86.6%
+-inverses86.6%
metadata-eval86.6%
Simplified86.6%
flip--86.7%
add-sqr-sqrt68.6%
add-sqr-sqrt87.1%
Applied egg-rr87.1%
associate--l+92.3%
+-inverses92.3%
metadata-eval92.3%
Simplified92.3%
Taylor expanded in t around inf 50.6%
flip--92.3%
add-sqr-sqrt47.0%
add-sqr-sqrt92.3%
Applied egg-rr50.6%
associate--l+96.6%
+-inverses96.6%
metadata-eval96.6%
Simplified54.7%
Final simplification78.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 (/ 1.0 (+ (sqrt (+ 1.0 y)) (sqrt y))))
(t_2 (/ 1.0 (+ (sqrt (+ 1.0 z)) (sqrt z)))))
(if (<= z 1.16e+14)
(+ (+ t_2 (- (sqrt (+ 1.0 t)) (sqrt t))) (+ 1.0 t_1))
(+ (+ (/ 1.0 (+ (sqrt (+ 1.0 x)) (sqrt x))) t_1) t_2))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = 1.0 / (sqrt((1.0 + y)) + sqrt(y));
double t_2 = 1.0 / (sqrt((1.0 + z)) + sqrt(z));
double tmp;
if (z <= 1.16e+14) {
tmp = (t_2 + (sqrt((1.0 + t)) - sqrt(t))) + (1.0 + t_1);
} else {
tmp = ((1.0 / (sqrt((1.0 + x)) + sqrt(x))) + t_1) + t_2;
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = 1.0d0 / (sqrt((1.0d0 + y)) + sqrt(y))
t_2 = 1.0d0 / (sqrt((1.0d0 + z)) + sqrt(z))
if (z <= 1.16d+14) then
tmp = (t_2 + (sqrt((1.0d0 + t)) - sqrt(t))) + (1.0d0 + t_1)
else
tmp = ((1.0d0 / (sqrt((1.0d0 + x)) + sqrt(x))) + t_1) + 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 = 1.0 / (Math.sqrt((1.0 + y)) + Math.sqrt(y));
double t_2 = 1.0 / (Math.sqrt((1.0 + z)) + Math.sqrt(z));
double tmp;
if (z <= 1.16e+14) {
tmp = (t_2 + (Math.sqrt((1.0 + t)) - Math.sqrt(t))) + (1.0 + t_1);
} else {
tmp = ((1.0 / (Math.sqrt((1.0 + x)) + Math.sqrt(x))) + t_1) + t_2;
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = 1.0 / (math.sqrt((1.0 + y)) + math.sqrt(y)) t_2 = 1.0 / (math.sqrt((1.0 + z)) + math.sqrt(z)) tmp = 0 if z <= 1.16e+14: tmp = (t_2 + (math.sqrt((1.0 + t)) - math.sqrt(t))) + (1.0 + t_1) else: tmp = ((1.0 / (math.sqrt((1.0 + x)) + math.sqrt(x))) + t_1) + t_2 return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = Float64(1.0 / Float64(sqrt(Float64(1.0 + y)) + sqrt(y))) t_2 = Float64(1.0 / Float64(sqrt(Float64(1.0 + z)) + sqrt(z))) tmp = 0.0 if (z <= 1.16e+14) tmp = Float64(Float64(t_2 + Float64(sqrt(Float64(1.0 + t)) - sqrt(t))) + Float64(1.0 + t_1)); else tmp = Float64(Float64(Float64(1.0 / Float64(sqrt(Float64(1.0 + x)) + sqrt(x))) + t_1) + 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 = 1.0 / (sqrt((1.0 + y)) + sqrt(y));
t_2 = 1.0 / (sqrt((1.0 + z)) + sqrt(z));
tmp = 0.0;
if (z <= 1.16e+14)
tmp = (t_2 + (sqrt((1.0 + t)) - sqrt(t))) + (1.0 + t_1);
else
tmp = ((1.0 / (sqrt((1.0 + x)) + sqrt(x))) + t_1) + 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[(1.0 / N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(1.0 / N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, 1.16e+14], N[(N[(t$95$2 + N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 + t$95$1), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 / N[(N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision] + t$95$2), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \frac{1}{\sqrt{1 + y} + \sqrt{y}}\\
t_2 := \frac{1}{\sqrt{1 + z} + \sqrt{z}}\\
\mathbf{if}\;z \leq 1.16 \cdot 10^{+14}:\\
\;\;\;\;\left(t_2 + \left(\sqrt{1 + t} - \sqrt{t}\right)\right) + \left(1 + t_1\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{1}{\sqrt{1 + x} + \sqrt{x}} + t_1\right) + t_2\\
\end{array}
\end{array}
if z < 1.16e14Initial program 96.3%
associate-+l+96.3%
+-commutative96.3%
+-commutative96.3%
+-commutative96.3%
Simplified96.3%
flip--96.5%
add-sqr-sqrt72.8%
+-commutative72.8%
add-sqr-sqrt96.9%
+-commutative96.9%
Applied egg-rr96.9%
associate--l+97.1%
+-inverses97.1%
metadata-eval97.1%
Simplified97.1%
flip--97.1%
add-sqr-sqrt74.8%
add-sqr-sqrt97.4%
Applied egg-rr97.4%
associate--l+98.0%
+-inverses98.0%
metadata-eval98.0%
Simplified98.0%
flip--98.5%
add-sqr-sqrt98.1%
add-sqr-sqrt98.7%
Applied egg-rr98.7%
associate--l+98.6%
+-inverses98.6%
metadata-eval98.6%
Simplified98.6%
Taylor expanded in x around 0 50.5%
+-commutative48.9%
Simplified50.5%
if 1.16e14 < z Initial program 83.5%
associate-+l+83.5%
+-commutative83.5%
+-commutative83.5%
+-commutative83.5%
Simplified83.5%
flip--83.8%
add-sqr-sqrt64.2%
+-commutative64.2%
add-sqr-sqrt83.8%
+-commutative83.8%
Applied egg-rr83.8%
associate--l+86.3%
+-inverses86.3%
metadata-eval86.3%
Simplified86.3%
flip--86.3%
add-sqr-sqrt68.6%
add-sqr-sqrt86.7%
Applied egg-rr86.7%
associate--l+91.9%
+-inverses91.9%
metadata-eval91.9%
Simplified91.9%
Taylor expanded in t around inf 50.0%
flip--91.9%
add-sqr-sqrt47.3%
add-sqr-sqrt91.9%
Applied egg-rr50.0%
associate--l+96.7%
+-inverses96.7%
metadata-eval96.7%
Simplified54.1%
Final simplification52.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)) (sqrt z))) (t_2 (sqrt (+ 1.0 y))))
(if (<= x 3.3e-29)
(+ (+ 1.0 (/ 1.0 (+ t_2 (sqrt y)))) (+ (- (sqrt (+ 1.0 t)) (sqrt t)) t_1))
(+ t_1 (+ (/ 1.0 (+ (sqrt (+ 1.0 x)) (sqrt x))) (- t_2 (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 + z)) - sqrt(z);
double t_2 = sqrt((1.0 + y));
double tmp;
if (x <= 3.3e-29) {
tmp = (1.0 + (1.0 / (t_2 + sqrt(y)))) + ((sqrt((1.0 + t)) - sqrt(t)) + t_1);
} else {
tmp = t_1 + ((1.0 / (sqrt((1.0 + x)) + sqrt(x))) + (t_2 - sqrt(y)));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = sqrt((1.0d0 + z)) - sqrt(z)
t_2 = sqrt((1.0d0 + y))
if (x <= 3.3d-29) then
tmp = (1.0d0 + (1.0d0 / (t_2 + sqrt(y)))) + ((sqrt((1.0d0 + t)) - sqrt(t)) + t_1)
else
tmp = t_1 + ((1.0d0 / (sqrt((1.0d0 + x)) + sqrt(x))) + (t_2 - 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 + z)) - Math.sqrt(z);
double t_2 = Math.sqrt((1.0 + y));
double tmp;
if (x <= 3.3e-29) {
tmp = (1.0 + (1.0 / (t_2 + Math.sqrt(y)))) + ((Math.sqrt((1.0 + t)) - Math.sqrt(t)) + t_1);
} else {
tmp = t_1 + ((1.0 / (Math.sqrt((1.0 + x)) + Math.sqrt(x))) + (t_2 - 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 + z)) - math.sqrt(z) t_2 = math.sqrt((1.0 + y)) tmp = 0 if x <= 3.3e-29: tmp = (1.0 + (1.0 / (t_2 + math.sqrt(y)))) + ((math.sqrt((1.0 + t)) - math.sqrt(t)) + t_1) else: tmp = t_1 + ((1.0 / (math.sqrt((1.0 + x)) + math.sqrt(x))) + (t_2 - math.sqrt(y))) 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 + y)) tmp = 0.0 if (x <= 3.3e-29) tmp = Float64(Float64(1.0 + Float64(1.0 / Float64(t_2 + sqrt(y)))) + Float64(Float64(sqrt(Float64(1.0 + t)) - sqrt(t)) + t_1)); else tmp = Float64(t_1 + Float64(Float64(1.0 / Float64(sqrt(Float64(1.0 + x)) + sqrt(x))) + Float64(t_2 - 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 + z)) - sqrt(z);
t_2 = sqrt((1.0 + y));
tmp = 0.0;
if (x <= 3.3e-29)
tmp = (1.0 + (1.0 / (t_2 + sqrt(y)))) + ((sqrt((1.0 + t)) - sqrt(t)) + t_1);
else
tmp = t_1 + ((1.0 / (sqrt((1.0 + x)) + sqrt(x))) + (t_2 - 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[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x, 3.3e-29], N[(N[(1.0 + N[(1.0 / N[(t$95$2 + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision], N[(t$95$1 + N[(N[(1.0 / N[(N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$2 - 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 + z} - \sqrt{z}\\
t_2 := \sqrt{1 + y}\\
\mathbf{if}\;x \leq 3.3 \cdot 10^{-29}:\\
\;\;\;\;\left(1 + \frac{1}{t_2 + \sqrt{y}}\right) + \left(\left(\sqrt{1 + t} - \sqrt{t}\right) + t_1\right)\\
\mathbf{else}:\\
\;\;\;\;t_1 + \left(\frac{1}{\sqrt{1 + x} + \sqrt{x}} + \left(t_2 - \sqrt{y}\right)\right)\\
\end{array}
\end{array}
if x < 3.30000000000000028e-29Initial program 96.1%
associate-+l+96.1%
+-commutative96.1%
+-commutative96.1%
+-commutative96.1%
Simplified96.1%
flip--96.1%
add-sqr-sqrt77.5%
add-sqr-sqrt96.4%
Applied egg-rr96.4%
associate--l+97.9%
+-inverses97.9%
metadata-eval97.9%
Simplified97.9%
Taylor expanded in x around 0 97.9%
if 3.30000000000000028e-29 < x Initial program 87.0%
associate-+l+87.0%
+-commutative87.0%
+-commutative87.0%
+-commutative87.0%
Simplified87.0%
flip--87.4%
add-sqr-sqrt51.8%
+-commutative51.8%
add-sqr-sqrt87.8%
+-commutative87.8%
Applied egg-rr87.8%
associate--l+89.8%
+-inverses89.8%
metadata-eval89.8%
Simplified89.8%
Taylor expanded in t around inf 52.3%
Final simplification69.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 y))) (t_2 (- (sqrt (+ 1.0 z)) (sqrt z))))
(if (<= z 2.8e+18)
(+ (+ 1.0 (+ t_1 t_2)) (- (- (sqrt (+ 1.0 t)) (sqrt t)) (sqrt y)))
(+
(+ (/ 1.0 (+ (sqrt (+ 1.0 x)) (sqrt x))) (/ 1.0 (+ t_1 (sqrt y))))
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)) - sqrt(z);
double tmp;
if (z <= 2.8e+18) {
tmp = (1.0 + (t_1 + t_2)) + ((sqrt((1.0 + t)) - sqrt(t)) - sqrt(y));
} else {
tmp = ((1.0 / (sqrt((1.0 + x)) + sqrt(x))) + (1.0 / (t_1 + sqrt(y)))) + t_2;
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = sqrt((1.0d0 + y))
t_2 = sqrt((1.0d0 + z)) - sqrt(z)
if (z <= 2.8d+18) then
tmp = (1.0d0 + (t_1 + t_2)) + ((sqrt((1.0d0 + t)) - sqrt(t)) - sqrt(y))
else
tmp = ((1.0d0 / (sqrt((1.0d0 + x)) + sqrt(x))) + (1.0d0 / (t_1 + sqrt(y)))) + 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)) - Math.sqrt(z);
double tmp;
if (z <= 2.8e+18) {
tmp = (1.0 + (t_1 + t_2)) + ((Math.sqrt((1.0 + t)) - Math.sqrt(t)) - Math.sqrt(y));
} else {
tmp = ((1.0 / (Math.sqrt((1.0 + x)) + Math.sqrt(x))) + (1.0 / (t_1 + Math.sqrt(y)))) + 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)) - math.sqrt(z) tmp = 0 if z <= 2.8e+18: tmp = (1.0 + (t_1 + t_2)) + ((math.sqrt((1.0 + t)) - math.sqrt(t)) - math.sqrt(y)) else: tmp = ((1.0 / (math.sqrt((1.0 + x)) + math.sqrt(x))) + (1.0 / (t_1 + math.sqrt(y)))) + 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 = Float64(sqrt(Float64(1.0 + z)) - sqrt(z)) tmp = 0.0 if (z <= 2.8e+18) tmp = Float64(Float64(1.0 + Float64(t_1 + t_2)) + Float64(Float64(sqrt(Float64(1.0 + t)) - sqrt(t)) - sqrt(y))); else tmp = Float64(Float64(Float64(1.0 / Float64(sqrt(Float64(1.0 + x)) + sqrt(x))) + Float64(1.0 / Float64(t_1 + sqrt(y)))) + 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)) - sqrt(z);
tmp = 0.0;
if (z <= 2.8e+18)
tmp = (1.0 + (t_1 + t_2)) + ((sqrt((1.0 + t)) - sqrt(t)) - sqrt(y));
else
tmp = ((1.0 / (sqrt((1.0 + x)) + sqrt(x))) + (1.0 / (t_1 + sqrt(y)))) + 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[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, 2.8e+18], N[(N[(1.0 + N[(t$95$1 + t$95$2), $MachinePrecision]), $MachinePrecision] + N[(N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 / N[(N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(t$95$1 + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$2), $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} - \sqrt{z}\\
\mathbf{if}\;z \leq 2.8 \cdot 10^{+18}:\\
\;\;\;\;\left(1 + \left(t_1 + t_2\right)\right) + \left(\left(\sqrt{1 + t} - \sqrt{t}\right) - \sqrt{y}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{1}{\sqrt{1 + x} + \sqrt{x}} + \frac{1}{t_1 + \sqrt{y}}\right) + t_2\\
\end{array}
\end{array}
if z < 2.8e18Initial program 95.9%
+-commutative95.9%
associate-+r+95.9%
associate-+r-79.2%
associate-+l-69.8%
associate-+r-51.9%
Simplified51.9%
associate-+r-51.9%
associate--l-49.7%
+-commutative49.7%
+-commutative49.7%
+-commutative49.7%
Applied egg-rr49.7%
Taylor expanded in x around 0 27.4%
associate--l+27.4%
associate--l+27.4%
Simplified27.4%
if 2.8e18 < z Initial program 83.8%
associate-+l+83.8%
+-commutative83.8%
+-commutative83.8%
+-commutative83.8%
Simplified83.8%
flip--84.1%
add-sqr-sqrt64.1%
+-commutative64.1%
add-sqr-sqrt84.1%
+-commutative84.1%
Applied egg-rr84.1%
associate--l+86.6%
+-inverses86.6%
metadata-eval86.6%
Simplified86.6%
flip--86.7%
add-sqr-sqrt68.6%
add-sqr-sqrt87.1%
Applied egg-rr87.1%
associate--l+92.3%
+-inverses92.3%
metadata-eval92.3%
Simplified92.3%
Taylor expanded in t around inf 50.6%
Final simplification37.6%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ 1.0 z))))
(if (<= t 6.5e+16)
(+
1.0
(-
(+ (sqrt (+ 1.0 t)) (+ (sqrt (+ 1.0 y)) t_1))
(+ (sqrt t) (+ (sqrt y) (sqrt z)))))
(+
(- t_1 (sqrt z))
(+ (/ 1.0 (+ (sqrt (+ 1.0 x)) (sqrt x))) (/ 1.0 (+ 1.0 (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 + z));
double tmp;
if (t <= 6.5e+16) {
tmp = 1.0 + ((sqrt((1.0 + t)) + (sqrt((1.0 + y)) + t_1)) - (sqrt(t) + (sqrt(y) + sqrt(z))));
} else {
tmp = (t_1 - sqrt(z)) + ((1.0 / (sqrt((1.0 + x)) + sqrt(x))) + (1.0 / (1.0 + sqrt(y))));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = sqrt((1.0d0 + z))
if (t <= 6.5d+16) then
tmp = 1.0d0 + ((sqrt((1.0d0 + t)) + (sqrt((1.0d0 + y)) + t_1)) - (sqrt(t) + (sqrt(y) + sqrt(z))))
else
tmp = (t_1 - sqrt(z)) + ((1.0d0 / (sqrt((1.0d0 + x)) + sqrt(x))) + (1.0d0 / (1.0d0 + sqrt(y))))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + z));
double tmp;
if (t <= 6.5e+16) {
tmp = 1.0 + ((Math.sqrt((1.0 + t)) + (Math.sqrt((1.0 + y)) + t_1)) - (Math.sqrt(t) + (Math.sqrt(y) + Math.sqrt(z))));
} else {
tmp = (t_1 - Math.sqrt(z)) + ((1.0 / (Math.sqrt((1.0 + x)) + Math.sqrt(x))) + (1.0 / (1.0 + 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 + z)) tmp = 0 if t <= 6.5e+16: tmp = 1.0 + ((math.sqrt((1.0 + t)) + (math.sqrt((1.0 + y)) + t_1)) - (math.sqrt(t) + (math.sqrt(y) + math.sqrt(z)))) else: tmp = (t_1 - math.sqrt(z)) + ((1.0 / (math.sqrt((1.0 + x)) + math.sqrt(x))) + (1.0 / (1.0 + 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 + z)) tmp = 0.0 if (t <= 6.5e+16) tmp = Float64(1.0 + Float64(Float64(sqrt(Float64(1.0 + t)) + Float64(sqrt(Float64(1.0 + y)) + t_1)) - Float64(sqrt(t) + Float64(sqrt(y) + sqrt(z))))); else tmp = Float64(Float64(t_1 - sqrt(z)) + Float64(Float64(1.0 / Float64(sqrt(Float64(1.0 + x)) + sqrt(x))) + Float64(1.0 / Float64(1.0 + sqrt(y))))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + z));
tmp = 0.0;
if (t <= 6.5e+16)
tmp = 1.0 + ((sqrt((1.0 + t)) + (sqrt((1.0 + y)) + t_1)) - (sqrt(t) + (sqrt(y) + sqrt(z))));
else
tmp = (t_1 - sqrt(z)) + ((1.0 / (sqrt((1.0 + x)) + sqrt(x))) + (1.0 / (1.0 + sqrt(y))));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t, 6.5e+16], N[(1.0 + N[(N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] + N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[t], $MachinePrecision] + N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(t$95$1 - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 / N[(N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(1.0 + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + z}\\
\mathbf{if}\;t \leq 6.5 \cdot 10^{+16}:\\
\;\;\;\;1 + \left(\left(\sqrt{1 + t} + \left(\sqrt{1 + y} + t_1\right)\right) - \left(\sqrt{t} + \left(\sqrt{y} + \sqrt{z}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(t_1 - \sqrt{z}\right) + \left(\frac{1}{\sqrt{1 + x} + \sqrt{x}} + \frac{1}{1 + \sqrt{y}}\right)\\
\end{array}
\end{array}
if t < 6.5e16Initial program 96.0%
+-commutative96.0%
associate-+r+96.0%
associate-+r-78.5%
associate-+l-57.4%
associate-+r-53.4%
Simplified43.7%
Taylor expanded in x around 0 18.3%
associate--l+37.6%
+-commutative37.6%
+-commutative37.6%
+-commutative37.6%
Simplified37.6%
if 6.5e16 < t Initial program 85.0%
associate-+l+85.0%
+-commutative85.0%
+-commutative85.0%
+-commutative85.0%
Simplified85.0%
flip--85.1%
add-sqr-sqrt67.6%
+-commutative67.6%
add-sqr-sqrt85.4%
+-commutative85.4%
Applied egg-rr85.4%
associate--l+87.7%
+-inverses87.7%
metadata-eval87.7%
Simplified87.7%
flip--87.7%
add-sqr-sqrt72.8%
add-sqr-sqrt88.4%
Applied egg-rr88.4%
associate--l+93.0%
+-inverses93.0%
metadata-eval93.0%
Simplified93.0%
Taylor expanded in t around inf 93.0%
Taylor expanded in y around 0 86.0%
Final simplification61.6%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (sqrt (+ 1.0 z)) (sqrt z)))
(t_2 (- (sqrt (+ 1.0 y)) (sqrt y))))
(if (<= z 3e+18)
(+ (+ (- (sqrt (+ 1.0 t)) (sqrt t)) t_1) (+ 1.0 t_2))
(+ t_1 (+ (/ 1.0 (+ (sqrt (+ 1.0 x)) (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 + y)) - sqrt(y);
double tmp;
if (z <= 3e+18) {
tmp = ((sqrt((1.0 + t)) - sqrt(t)) + t_1) + (1.0 + t_2);
} else {
tmp = t_1 + ((1.0 / (sqrt((1.0 + x)) + sqrt(x))) + t_2);
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = sqrt((1.0d0 + z)) - sqrt(z)
t_2 = sqrt((1.0d0 + y)) - sqrt(y)
if (z <= 3d+18) then
tmp = ((sqrt((1.0d0 + t)) - sqrt(t)) + t_1) + (1.0d0 + t_2)
else
tmp = t_1 + ((1.0d0 / (sqrt((1.0d0 + x)) + 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 + y)) - Math.sqrt(y);
double tmp;
if (z <= 3e+18) {
tmp = ((Math.sqrt((1.0 + t)) - Math.sqrt(t)) + t_1) + (1.0 + t_2);
} else {
tmp = t_1 + ((1.0 / (Math.sqrt((1.0 + x)) + 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 + y)) - math.sqrt(y) tmp = 0 if z <= 3e+18: tmp = ((math.sqrt((1.0 + t)) - math.sqrt(t)) + t_1) + (1.0 + t_2) else: tmp = t_1 + ((1.0 / (math.sqrt((1.0 + x)) + 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 = Float64(sqrt(Float64(1.0 + y)) - sqrt(y)) tmp = 0.0 if (z <= 3e+18) tmp = Float64(Float64(Float64(sqrt(Float64(1.0 + t)) - sqrt(t)) + t_1) + Float64(1.0 + t_2)); else tmp = Float64(t_1 + Float64(Float64(1.0 / Float64(sqrt(Float64(1.0 + x)) + 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 + y)) - sqrt(y);
tmp = 0.0;
if (z <= 3e+18)
tmp = ((sqrt((1.0 + t)) - sqrt(t)) + t_1) + (1.0 + t_2);
else
tmp = t_1 + ((1.0 / (sqrt((1.0 + x)) + 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[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, 3e+18], N[(N[(N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision] + N[(1.0 + t$95$2), $MachinePrecision]), $MachinePrecision], N[(t$95$1 + N[(N[(1.0 / N[(N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $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 + y} - \sqrt{y}\\
\mathbf{if}\;z \leq 3 \cdot 10^{+18}:\\
\;\;\;\;\left(\left(\sqrt{1 + t} - \sqrt{t}\right) + t_1\right) + \left(1 + t_2\right)\\
\mathbf{else}:\\
\;\;\;\;t_1 + \left(\frac{1}{\sqrt{1 + x} + \sqrt{x}} + t_2\right)\\
\end{array}
\end{array}
if z < 3e18Initial program 95.9%
associate-+l+95.9%
+-commutative95.9%
+-commutative95.9%
+-commutative95.9%
Simplified95.9%
Taylor expanded in x around 0 50.1%
if 3e18 < z Initial program 83.8%
associate-+l+83.8%
+-commutative83.8%
+-commutative83.8%
+-commutative83.8%
Simplified83.8%
flip--84.1%
add-sqr-sqrt64.1%
+-commutative64.1%
add-sqr-sqrt84.1%
+-commutative84.1%
Applied egg-rr84.1%
associate--l+86.6%
+-inverses86.6%
metadata-eval86.6%
Simplified86.6%
Taylor expanded in t around inf 45.3%
Final simplification48.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 z)) (sqrt z))))
(if (<= z 2.05e+26)
(+ (+ 1.0 (+ t_1 t_2)) (- (- (sqrt (+ 1.0 t)) (sqrt t)) (sqrt y)))
(+ t_2 (+ (/ 1.0 (+ (sqrt (+ 1.0 x)) (sqrt x))) (- t_1 (sqrt y)))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + y));
double t_2 = sqrt((1.0 + z)) - sqrt(z);
double tmp;
if (z <= 2.05e+26) {
tmp = (1.0 + (t_1 + t_2)) + ((sqrt((1.0 + t)) - sqrt(t)) - sqrt(y));
} else {
tmp = t_2 + ((1.0 / (sqrt((1.0 + x)) + sqrt(x))) + (t_1 - sqrt(y)));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = sqrt((1.0d0 + y))
t_2 = sqrt((1.0d0 + z)) - sqrt(z)
if (z <= 2.05d+26) then
tmp = (1.0d0 + (t_1 + t_2)) + ((sqrt((1.0d0 + t)) - sqrt(t)) - sqrt(y))
else
tmp = t_2 + ((1.0d0 / (sqrt((1.0d0 + x)) + sqrt(x))) + (t_1 - sqrt(y)))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + y));
double t_2 = Math.sqrt((1.0 + z)) - Math.sqrt(z);
double tmp;
if (z <= 2.05e+26) {
tmp = (1.0 + (t_1 + t_2)) + ((Math.sqrt((1.0 + t)) - Math.sqrt(t)) - Math.sqrt(y));
} else {
tmp = t_2 + ((1.0 / (Math.sqrt((1.0 + x)) + Math.sqrt(x))) + (t_1 - Math.sqrt(y)));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + y)) t_2 = math.sqrt((1.0 + z)) - math.sqrt(z) tmp = 0 if z <= 2.05e+26: tmp = (1.0 + (t_1 + t_2)) + ((math.sqrt((1.0 + t)) - math.sqrt(t)) - math.sqrt(y)) else: tmp = t_2 + ((1.0 / (math.sqrt((1.0 + x)) + math.sqrt(x))) + (t_1 - math.sqrt(y))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(1.0 + y)) t_2 = Float64(sqrt(Float64(1.0 + z)) - sqrt(z)) tmp = 0.0 if (z <= 2.05e+26) tmp = Float64(Float64(1.0 + Float64(t_1 + t_2)) + Float64(Float64(sqrt(Float64(1.0 + t)) - sqrt(t)) - sqrt(y))); else tmp = Float64(t_2 + Float64(Float64(1.0 / Float64(sqrt(Float64(1.0 + x)) + sqrt(x))) + Float64(t_1 - sqrt(y)))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + y));
t_2 = sqrt((1.0 + z)) - sqrt(z);
tmp = 0.0;
if (z <= 2.05e+26)
tmp = (1.0 + (t_1 + t_2)) + ((sqrt((1.0 + t)) - sqrt(t)) - sqrt(y));
else
tmp = t_2 + ((1.0 / (sqrt((1.0 + x)) + sqrt(x))) + (t_1 - sqrt(y)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, 2.05e+26], N[(N[(1.0 + N[(t$95$1 + t$95$2), $MachinePrecision]), $MachinePrecision] + N[(N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$2 + N[(N[(1.0 / N[(N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 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}\\
t_2 := \sqrt{1 + z} - \sqrt{z}\\
\mathbf{if}\;z \leq 2.05 \cdot 10^{+26}:\\
\;\;\;\;\left(1 + \left(t_1 + t_2\right)\right) + \left(\left(\sqrt{1 + t} - \sqrt{t}\right) - \sqrt{y}\right)\\
\mathbf{else}:\\
\;\;\;\;t_2 + \left(\frac{1}{\sqrt{1 + x} + \sqrt{x}} + \left(t_1 - \sqrt{y}\right)\right)\\
\end{array}
\end{array}
if z < 2.04999999999999992e26Initial program 95.8%
+-commutative95.8%
associate-+r+95.8%
associate-+r-78.7%
associate-+l-69.4%
associate-+r-51.5%
Simplified51.6%
associate-+r-51.5%
associate--l-49.4%
+-commutative49.4%
+-commutative49.4%
+-commutative49.4%
Applied egg-rr49.4%
Taylor expanded in x around 0 27.2%
associate--l+27.2%
associate--l+27.2%
Simplified27.2%
if 2.04999999999999992e26 < z Initial program 83.8%
associate-+l+83.8%
+-commutative83.8%
+-commutative83.8%
+-commutative83.8%
Simplified83.8%
flip--84.1%
add-sqr-sqrt64.0%
+-commutative64.0%
add-sqr-sqrt84.1%
+-commutative84.1%
Applied egg-rr84.1%
associate--l+86.7%
+-inverses86.7%
metadata-eval86.7%
Simplified86.7%
Taylor expanded in t around inf 45.5%
Final simplification35.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 (<= x 0.000195)
(+
(- (sqrt (+ 1.0 z)) (sqrt z))
(+
(/ 1.0 (+ (sqrt (+ 1.0 y)) (sqrt y)))
(/ 1.0 (+ (sqrt x) (+ 1.0 (* x 0.5))))))
(/ 1.0 (+ (sqrt (+ 1.0 x)) (sqrt x)))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (x <= 0.000195) {
tmp = (sqrt((1.0 + z)) - sqrt(z)) + ((1.0 / (sqrt((1.0 + y)) + sqrt(y))) + (1.0 / (sqrt(x) + (1.0 + (x * 0.5)))));
} else {
tmp = 1.0 / (sqrt((1.0 + x)) + sqrt(x));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (x <= 0.000195d0) then
tmp = (sqrt((1.0d0 + z)) - sqrt(z)) + ((1.0d0 / (sqrt((1.0d0 + y)) + sqrt(y))) + (1.0d0 / (sqrt(x) + (1.0d0 + (x * 0.5d0)))))
else
tmp = 1.0d0 / (sqrt((1.0d0 + x)) + sqrt(x))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (x <= 0.000195) {
tmp = (Math.sqrt((1.0 + z)) - Math.sqrt(z)) + ((1.0 / (Math.sqrt((1.0 + y)) + Math.sqrt(y))) + (1.0 / (Math.sqrt(x) + (1.0 + (x * 0.5)))));
} else {
tmp = 1.0 / (Math.sqrt((1.0 + x)) + Math.sqrt(x));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if x <= 0.000195: tmp = (math.sqrt((1.0 + z)) - math.sqrt(z)) + ((1.0 / (math.sqrt((1.0 + y)) + math.sqrt(y))) + (1.0 / (math.sqrt(x) + (1.0 + (x * 0.5))))) else: tmp = 1.0 / (math.sqrt((1.0 + x)) + math.sqrt(x)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (x <= 0.000195) tmp = Float64(Float64(sqrt(Float64(1.0 + z)) - sqrt(z)) + Float64(Float64(1.0 / Float64(sqrt(Float64(1.0 + y)) + sqrt(y))) + Float64(1.0 / Float64(sqrt(x) + Float64(1.0 + Float64(x * 0.5)))))); else tmp = Float64(1.0 / Float64(sqrt(Float64(1.0 + x)) + sqrt(x))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (x <= 0.000195)
tmp = (sqrt((1.0 + z)) - sqrt(z)) + ((1.0 / (sqrt((1.0 + y)) + sqrt(y))) + (1.0 / (sqrt(x) + (1.0 + (x * 0.5)))));
else
tmp = 1.0 / (sqrt((1.0 + x)) + sqrt(x));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[x, 0.000195], N[(N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 / N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + N[(1.0 + N[(x * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq 0.000195:\\
\;\;\;\;\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\frac{1}{\sqrt{1 + y} + \sqrt{y}} + \frac{1}{\sqrt{x} + \left(1 + x \cdot 0.5\right)}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{1 + x} + \sqrt{x}}\\
\end{array}
\end{array}
if x < 1.94999999999999996e-4Initial program 96.4%
associate-+l+96.4%
+-commutative96.4%
+-commutative96.4%
+-commutative96.4%
Simplified96.4%
flip--96.4%
add-sqr-sqrt96.4%
+-commutative96.4%
add-sqr-sqrt96.4%
+-commutative96.4%
Applied egg-rr96.4%
associate--l+96.4%
+-inverses96.4%
metadata-eval96.4%
Simplified96.4%
flip--96.4%
add-sqr-sqrt78.0%
add-sqr-sqrt96.7%
Applied egg-rr96.7%
associate--l+98.0%
+-inverses98.0%
metadata-eval98.0%
Simplified98.0%
Taylor expanded in t around inf 55.9%
Taylor expanded in x around 0 55.9%
if 1.94999999999999996e-4 < x Initial program 86.1%
+-commutative86.1%
associate-+r+86.1%
associate-+r-84.1%
associate-+l-66.9%
associate-+r-52.3%
Simplified51.0%
Taylor expanded in t around inf 4.5%
associate--l+6.4%
+-commutative6.4%
associate--l+6.4%
+-commutative6.4%
associate-+r+6.4%
Simplified6.4%
Taylor expanded in z around inf 6.6%
Taylor expanded in y around inf 4.9%
flip--4.9%
add-sqr-sqrt5.3%
add-sqr-sqrt4.9%
Applied egg-rr4.9%
associate--l+9.4%
+-inverses9.4%
metadata-eval9.4%
Simplified9.4%
Final simplification29.6%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (sqrt (+ 1.0 z)) (sqrt z))))
(if (<= x 9.2e-35)
(+ t_1 (+ 1.0 (/ 1.0 (+ (sqrt (+ 1.0 y)) (sqrt y)))))
(+
t_1
(+ (/ 1.0 (+ (sqrt (+ 1.0 x)) (sqrt x))) (/ 1.0 (+ 1.0 (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 + z)) - sqrt(z);
double tmp;
if (x <= 9.2e-35) {
tmp = t_1 + (1.0 + (1.0 / (sqrt((1.0 + y)) + sqrt(y))));
} else {
tmp = t_1 + ((1.0 / (sqrt((1.0 + x)) + sqrt(x))) + (1.0 / (1.0 + sqrt(y))));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = sqrt((1.0d0 + z)) - sqrt(z)
if (x <= 9.2d-35) then
tmp = t_1 + (1.0d0 + (1.0d0 / (sqrt((1.0d0 + y)) + sqrt(y))))
else
tmp = t_1 + ((1.0d0 / (sqrt((1.0d0 + x)) + sqrt(x))) + (1.0d0 / (1.0d0 + sqrt(y))))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + z)) - Math.sqrt(z);
double tmp;
if (x <= 9.2e-35) {
tmp = t_1 + (1.0 + (1.0 / (Math.sqrt((1.0 + y)) + Math.sqrt(y))));
} else {
tmp = t_1 + ((1.0 / (Math.sqrt((1.0 + x)) + Math.sqrt(x))) + (1.0 / (1.0 + 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 + z)) - math.sqrt(z) tmp = 0 if x <= 9.2e-35: tmp = t_1 + (1.0 + (1.0 / (math.sqrt((1.0 + y)) + math.sqrt(y)))) else: tmp = t_1 + ((1.0 / (math.sqrt((1.0 + x)) + math.sqrt(x))) + (1.0 / (1.0 + math.sqrt(y)))) 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)) tmp = 0.0 if (x <= 9.2e-35) tmp = Float64(t_1 + Float64(1.0 + Float64(1.0 / Float64(sqrt(Float64(1.0 + y)) + sqrt(y))))); else tmp = Float64(t_1 + Float64(Float64(1.0 / Float64(sqrt(Float64(1.0 + x)) + sqrt(x))) + Float64(1.0 / Float64(1.0 + sqrt(y))))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + z)) - sqrt(z);
tmp = 0.0;
if (x <= 9.2e-35)
tmp = t_1 + (1.0 + (1.0 / (sqrt((1.0 + y)) + sqrt(y))));
else
tmp = t_1 + ((1.0 / (sqrt((1.0 + x)) + sqrt(x))) + (1.0 / (1.0 + sqrt(y))));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, 9.2e-35], N[(t$95$1 + N[(1.0 + N[(1.0 / N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 + N[(N[(1.0 / N[(N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(1.0 + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + z} - \sqrt{z}\\
\mathbf{if}\;x \leq 9.2 \cdot 10^{-35}:\\
\;\;\;\;t_1 + \left(1 + \frac{1}{\sqrt{1 + y} + \sqrt{y}}\right)\\
\mathbf{else}:\\
\;\;\;\;t_1 + \left(\frac{1}{\sqrt{1 + x} + \sqrt{x}} + \frac{1}{1 + \sqrt{y}}\right)\\
\end{array}
\end{array}
if x < 9.1999999999999996e-35Initial program 96.1%
associate-+l+96.1%
+-commutative96.1%
+-commutative96.1%
+-commutative96.1%
Simplified96.1%
flip--96.1%
add-sqr-sqrt96.1%
+-commutative96.1%
add-sqr-sqrt96.1%
+-commutative96.1%
Applied egg-rr96.1%
associate--l+96.1%
+-inverses96.1%
metadata-eval96.1%
Simplified96.1%
flip--96.1%
add-sqr-sqrt77.2%
add-sqr-sqrt96.4%
Applied egg-rr96.4%
associate--l+97.9%
+-inverses97.9%
metadata-eval97.9%
Simplified97.9%
Taylor expanded in t around inf 56.5%
Taylor expanded in x around 0 56.5%
+-commutative56.5%
Simplified56.5%
if 9.1999999999999996e-35 < x Initial program 87.1%
associate-+l+87.1%
+-commutative87.1%
+-commutative87.1%
+-commutative87.1%
Simplified87.1%
flip--87.5%
add-sqr-sqrt52.1%
+-commutative52.1%
add-sqr-sqrt87.9%
+-commutative87.9%
Applied egg-rr87.9%
associate--l+89.9%
+-inverses89.9%
metadata-eval89.9%
Simplified89.9%
flip--89.9%
add-sqr-sqrt68.8%
add-sqr-sqrt90.2%
Applied egg-rr90.2%
associate--l+93.7%
+-inverses93.7%
metadata-eval93.7%
Simplified93.7%
Taylor expanded in t around inf 55.7%
Taylor expanded in y around 0 51.4%
Final simplification53.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 1.42e-27)
(+ (- (sqrt (+ 1.0 z)) (sqrt z)) 2.0)
(if (<= y 4.5e+15)
(+ t_1 (- (sqrt (+ 1.0 y)) (+ (sqrt x) (sqrt y))))
(/ 1.0 (+ 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 tmp;
if (y <= 1.42e-27) {
tmp = (sqrt((1.0 + z)) - sqrt(z)) + 2.0;
} else if (y <= 4.5e+15) {
tmp = t_1 + (sqrt((1.0 + y)) - (sqrt(x) + sqrt(y)));
} else {
tmp = 1.0 / (t_1 + sqrt(x));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = sqrt((1.0d0 + x))
if (y <= 1.42d-27) then
tmp = (sqrt((1.0d0 + z)) - sqrt(z)) + 2.0d0
else if (y <= 4.5d+15) then
tmp = t_1 + (sqrt((1.0d0 + y)) - (sqrt(x) + sqrt(y)))
else
tmp = 1.0d0 / (t_1 + sqrt(x))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + x));
double tmp;
if (y <= 1.42e-27) {
tmp = (Math.sqrt((1.0 + z)) - Math.sqrt(z)) + 2.0;
} else if (y <= 4.5e+15) {
tmp = t_1 + (Math.sqrt((1.0 + y)) - (Math.sqrt(x) + Math.sqrt(y)));
} else {
tmp = 1.0 / (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)) tmp = 0 if y <= 1.42e-27: tmp = (math.sqrt((1.0 + z)) - math.sqrt(z)) + 2.0 elif y <= 4.5e+15: tmp = t_1 + (math.sqrt((1.0 + y)) - (math.sqrt(x) + math.sqrt(y))) else: tmp = 1.0 / (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)) tmp = 0.0 if (y <= 1.42e-27) tmp = Float64(Float64(sqrt(Float64(1.0 + z)) - sqrt(z)) + 2.0); elseif (y <= 4.5e+15) tmp = Float64(t_1 + Float64(sqrt(Float64(1.0 + y)) - Float64(sqrt(x) + sqrt(y)))); else tmp = Float64(1.0 / 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));
tmp = 0.0;
if (y <= 1.42e-27)
tmp = (sqrt((1.0 + z)) - sqrt(z)) + 2.0;
elseif (y <= 4.5e+15)
tmp = t_1 + (sqrt((1.0 + y)) - (sqrt(x) + sqrt(y)));
else
tmp = 1.0 / (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]}, If[LessEqual[y, 1.42e-27], N[(N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision], If[LessEqual[y, 4.5e+15], N[(t$95$1 + N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] - N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / 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}\\
\mathbf{if}\;y \leq 1.42 \cdot 10^{-27}:\\
\;\;\;\;\left(\sqrt{1 + z} - \sqrt{z}\right) + 2\\
\mathbf{elif}\;y \leq 4.5 \cdot 10^{+15}:\\
\;\;\;\;t_1 + \left(\sqrt{1 + y} - \left(\sqrt{x} + \sqrt{y}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{t_1 + \sqrt{x}}\\
\end{array}
\end{array}
if y < 1.41999999999999996e-27Initial program 97.1%
+-commutative97.1%
associate-+r+97.1%
associate-+r-97.1%
associate-+l-97.1%
associate-+r-97.1%
Simplified80.8%
Taylor expanded in t around inf 15.7%
associate--l+19.3%
+-commutative19.3%
associate--l+19.3%
+-commutative19.3%
associate-+r+19.3%
Simplified19.3%
Taylor expanded in x around 0 29.4%
Taylor expanded in y around 0 29.4%
associate--l+51.8%
Simplified51.8%
if 1.41999999999999996e-27 < y < 4.5e15Initial program 91.3%
+-commutative91.3%
associate-+r+91.3%
associate-+r-91.1%
associate-+l-91.0%
associate-+r-91.0%
Simplified65.6%
Taylor expanded in t around inf 11.9%
associate--l+19.6%
+-commutative19.6%
associate--l+19.6%
+-commutative19.6%
associate-+r+19.6%
Simplified19.6%
Taylor expanded in z around inf 25.5%
if 4.5e15 < y Initial program 84.4%
+-commutative84.4%
associate-+r+84.4%
associate-+r-50.9%
associate-+l-28.8%
associate-+r-7.9%
Simplified5.4%
Taylor expanded in t around inf 4.0%
associate--l+17.6%
+-commutative17.6%
associate--l+21.2%
+-commutative21.2%
associate-+r+21.2%
Simplified21.2%
Taylor expanded in z around inf 17.0%
Taylor expanded in y around inf 17.1%
flip--17.1%
add-sqr-sqrt17.4%
add-sqr-sqrt17.1%
Applied egg-rr17.1%
associate--l+20.6%
+-inverses20.6%
metadata-eval20.6%
Simplified20.6%
Final simplification34.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 x))) (t_2 (sqrt (+ 1.0 y))))
(if (<= y 1.5e-27)
(+ 1.0 (+ t_2 (- (sqrt (+ 1.0 z)) (+ (sqrt y) (sqrt z)))))
(if (<= y 4.5e+15)
(+ t_1 (- t_2 (+ (sqrt x) (sqrt y))))
(/ 1.0 (+ 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 + y));
double tmp;
if (y <= 1.5e-27) {
tmp = 1.0 + (t_2 + (sqrt((1.0 + z)) - (sqrt(y) + sqrt(z))));
} else if (y <= 4.5e+15) {
tmp = t_1 + (t_2 - (sqrt(x) + sqrt(y)));
} else {
tmp = 1.0 / (t_1 + sqrt(x));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = sqrt((1.0d0 + x))
t_2 = sqrt((1.0d0 + y))
if (y <= 1.5d-27) then
tmp = 1.0d0 + (t_2 + (sqrt((1.0d0 + z)) - (sqrt(y) + sqrt(z))))
else if (y <= 4.5d+15) then
tmp = t_1 + (t_2 - (sqrt(x) + sqrt(y)))
else
tmp = 1.0d0 / (t_1 + sqrt(x))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + x));
double t_2 = Math.sqrt((1.0 + y));
double tmp;
if (y <= 1.5e-27) {
tmp = 1.0 + (t_2 + (Math.sqrt((1.0 + z)) - (Math.sqrt(y) + Math.sqrt(z))));
} else if (y <= 4.5e+15) {
tmp = t_1 + (t_2 - (Math.sqrt(x) + Math.sqrt(y)));
} else {
tmp = 1.0 / (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 + y)) tmp = 0 if y <= 1.5e-27: tmp = 1.0 + (t_2 + (math.sqrt((1.0 + z)) - (math.sqrt(y) + math.sqrt(z)))) elif y <= 4.5e+15: tmp = t_1 + (t_2 - (math.sqrt(x) + math.sqrt(y))) else: tmp = 1.0 / (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 + y)) tmp = 0.0 if (y <= 1.5e-27) tmp = Float64(1.0 + Float64(t_2 + Float64(sqrt(Float64(1.0 + z)) - Float64(sqrt(y) + sqrt(z))))); elseif (y <= 4.5e+15) tmp = Float64(t_1 + Float64(t_2 - Float64(sqrt(x) + sqrt(y)))); else tmp = Float64(1.0 / 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 + y));
tmp = 0.0;
if (y <= 1.5e-27)
tmp = 1.0 + (t_2 + (sqrt((1.0 + z)) - (sqrt(y) + sqrt(z))));
elseif (y <= 4.5e+15)
tmp = t_1 + (t_2 - (sqrt(x) + sqrt(y)));
else
tmp = 1.0 / (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 + y), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y, 1.5e-27], N[(1.0 + N[(t$95$2 + N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 4.5e+15], N[(t$95$1 + N[(t$95$2 - N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / 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 + y}\\
\mathbf{if}\;y \leq 1.5 \cdot 10^{-27}:\\
\;\;\;\;1 + \left(t_2 + \left(\sqrt{1 + z} - \left(\sqrt{y} + \sqrt{z}\right)\right)\right)\\
\mathbf{elif}\;y \leq 4.5 \cdot 10^{+15}:\\
\;\;\;\;t_1 + \left(t_2 - \left(\sqrt{x} + \sqrt{y}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{t_1 + \sqrt{x}}\\
\end{array}
\end{array}
if y < 1.5000000000000001e-27Initial program 97.1%
+-commutative97.1%
associate-+r+97.1%
associate-+r-97.1%
associate-+l-97.1%
associate-+r-97.1%
Simplified80.8%
Taylor expanded in t around inf 15.7%
associate--l+19.3%
+-commutative19.3%
associate--l+19.3%
+-commutative19.3%
associate-+r+19.3%
Simplified19.3%
Taylor expanded in x around 0 29.4%
associate--l+44.3%
associate--l+51.8%
+-commutative51.8%
Simplified51.8%
if 1.5000000000000001e-27 < y < 4.5e15Initial program 91.3%
+-commutative91.3%
associate-+r+91.3%
associate-+r-91.1%
associate-+l-91.0%
associate-+r-91.0%
Simplified65.6%
Taylor expanded in t around inf 11.9%
associate--l+19.6%
+-commutative19.6%
associate--l+19.6%
+-commutative19.6%
associate-+r+19.6%
Simplified19.6%
Taylor expanded in z around inf 25.5%
if 4.5e15 < y Initial program 84.4%
+-commutative84.4%
associate-+r+84.4%
associate-+r-50.9%
associate-+l-28.8%
associate-+r-7.9%
Simplified5.4%
Taylor expanded in t around inf 4.0%
associate--l+17.6%
+-commutative17.6%
associate--l+21.2%
+-commutative21.2%
associate-+r+21.2%
Simplified21.2%
Taylor expanded in z around inf 17.0%
Taylor expanded in y around inf 17.1%
flip--17.1%
add-sqr-sqrt17.4%
add-sqr-sqrt17.1%
Applied egg-rr17.1%
associate--l+20.6%
+-inverses20.6%
metadata-eval20.6%
Simplified20.6%
Final simplification34.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 (<= y 9e+19)
(+
(- (sqrt (+ 1.0 z)) (sqrt z))
(+ 1.0 (/ 1.0 (+ (sqrt (+ 1.0 y)) (sqrt y)))))
(/ 1.0 (+ (sqrt (+ 1.0 x)) (sqrt x)))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 9e+19) {
tmp = (sqrt((1.0 + z)) - sqrt(z)) + (1.0 + (1.0 / (sqrt((1.0 + y)) + sqrt(y))));
} else {
tmp = 1.0 / (sqrt((1.0 + x)) + sqrt(x));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= 9d+19) then
tmp = (sqrt((1.0d0 + z)) - sqrt(z)) + (1.0d0 + (1.0d0 / (sqrt((1.0d0 + y)) + sqrt(y))))
else
tmp = 1.0d0 / (sqrt((1.0d0 + x)) + sqrt(x))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= 9e+19) {
tmp = (Math.sqrt((1.0 + z)) - Math.sqrt(z)) + (1.0 + (1.0 / (Math.sqrt((1.0 + y)) + Math.sqrt(y))));
} else {
tmp = 1.0 / (Math.sqrt((1.0 + x)) + Math.sqrt(x));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if y <= 9e+19: tmp = (math.sqrt((1.0 + z)) - math.sqrt(z)) + (1.0 + (1.0 / (math.sqrt((1.0 + y)) + math.sqrt(y)))) else: tmp = 1.0 / (math.sqrt((1.0 + x)) + math.sqrt(x)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (y <= 9e+19) tmp = Float64(Float64(sqrt(Float64(1.0 + z)) - sqrt(z)) + Float64(1.0 + Float64(1.0 / Float64(sqrt(Float64(1.0 + y)) + sqrt(y))))); else tmp = Float64(1.0 / Float64(sqrt(Float64(1.0 + x)) + sqrt(x))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (y <= 9e+19)
tmp = (sqrt((1.0 + z)) - sqrt(z)) + (1.0 + (1.0 / (sqrt((1.0 + y)) + sqrt(y))));
else
tmp = 1.0 / (sqrt((1.0 + x)) + sqrt(x));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[y, 9e+19], N[(N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $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]), $MachinePrecision], N[(1.0 / N[(N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 9 \cdot 10^{+19}:\\
\;\;\;\;\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(1 + \frac{1}{\sqrt{1 + y} + \sqrt{y}}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{1 + x} + \sqrt{x}}\\
\end{array}
\end{array}
if y < 9e19Initial program 94.5%
associate-+l+94.5%
+-commutative94.5%
+-commutative94.5%
+-commutative94.5%
Simplified94.5%
flip--94.8%
add-sqr-sqrt72.6%
+-commutative72.6%
add-sqr-sqrt95.2%
+-commutative95.2%
Applied egg-rr95.2%
associate--l+95.5%
+-inverses95.5%
metadata-eval95.5%
Simplified95.5%
flip--95.5%
add-sqr-sqrt95.3%
add-sqr-sqrt96.1%
Applied egg-rr96.1%
associate--l+97.9%
+-inverses97.9%
metadata-eval97.9%
Simplified97.9%
Taylor expanded in t around inf 60.1%
Taylor expanded in x around 0 51.6%
+-commutative51.6%
Simplified51.6%
if 9e19 < y Initial program 85.9%
+-commutative85.9%
associate-+r+85.9%
associate-+r-50.6%
associate-+l-27.4%
associate-+r-5.7%
Simplified4.0%
Taylor expanded in t around inf 3.2%
associate--l+16.7%
+-commutative16.7%
associate--l+20.4%
+-commutative20.4%
associate-+r+20.4%
Simplified20.4%
Taylor expanded in z around inf 16.8%
Taylor expanded in y around inf 16.9%
flip--16.9%
add-sqr-sqrt17.2%
add-sqr-sqrt16.9%
Applied egg-rr16.9%
associate--l+20.5%
+-inverses20.5%
metadata-eval20.5%
Simplified20.5%
Final simplification37.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.5e-27)
(+ (- (sqrt (+ 1.0 z)) (sqrt z)) 2.0)
(if (<= y 4.5e+15)
(- (+ (sqrt (+ 1.0 y)) (+ 1.0 (* x 0.5))) (+ (sqrt x) (sqrt y)))
(/ 1.0 (+ (sqrt (+ 1.0 x)) (sqrt x))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 1.5e-27) {
tmp = (sqrt((1.0 + z)) - sqrt(z)) + 2.0;
} else if (y <= 4.5e+15) {
tmp = (sqrt((1.0 + y)) + (1.0 + (x * 0.5))) - (sqrt(x) + sqrt(y));
} else {
tmp = 1.0 / (sqrt((1.0 + x)) + sqrt(x));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= 1.5d-27) then
tmp = (sqrt((1.0d0 + z)) - sqrt(z)) + 2.0d0
else if (y <= 4.5d+15) then
tmp = (sqrt((1.0d0 + y)) + (1.0d0 + (x * 0.5d0))) - (sqrt(x) + sqrt(y))
else
tmp = 1.0d0 / (sqrt((1.0d0 + x)) + sqrt(x))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= 1.5e-27) {
tmp = (Math.sqrt((1.0 + z)) - Math.sqrt(z)) + 2.0;
} else if (y <= 4.5e+15) {
tmp = (Math.sqrt((1.0 + y)) + (1.0 + (x * 0.5))) - (Math.sqrt(x) + Math.sqrt(y));
} else {
tmp = 1.0 / (Math.sqrt((1.0 + x)) + Math.sqrt(x));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if y <= 1.5e-27: tmp = (math.sqrt((1.0 + z)) - math.sqrt(z)) + 2.0 elif y <= 4.5e+15: tmp = (math.sqrt((1.0 + y)) + (1.0 + (x * 0.5))) - (math.sqrt(x) + math.sqrt(y)) else: tmp = 1.0 / (math.sqrt((1.0 + x)) + math.sqrt(x)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (y <= 1.5e-27) tmp = Float64(Float64(sqrt(Float64(1.0 + z)) - sqrt(z)) + 2.0); elseif (y <= 4.5e+15) tmp = Float64(Float64(sqrt(Float64(1.0 + y)) + Float64(1.0 + Float64(x * 0.5))) - Float64(sqrt(x) + sqrt(y))); else tmp = Float64(1.0 / Float64(sqrt(Float64(1.0 + x)) + sqrt(x))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (y <= 1.5e-27)
tmp = (sqrt((1.0 + z)) - sqrt(z)) + 2.0;
elseif (y <= 4.5e+15)
tmp = (sqrt((1.0 + y)) + (1.0 + (x * 0.5))) - (sqrt(x) + sqrt(y));
else
tmp = 1.0 / (sqrt((1.0 + x)) + sqrt(x));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[y, 1.5e-27], N[(N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision], If[LessEqual[y, 4.5e+15], N[(N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] + N[(1.0 + N[(x * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 1.5 \cdot 10^{-27}:\\
\;\;\;\;\left(\sqrt{1 + z} - \sqrt{z}\right) + 2\\
\mathbf{elif}\;y \leq 4.5 \cdot 10^{+15}:\\
\;\;\;\;\left(\sqrt{1 + y} + \left(1 + x \cdot 0.5\right)\right) - \left(\sqrt{x} + \sqrt{y}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{1 + x} + \sqrt{x}}\\
\end{array}
\end{array}
if y < 1.5000000000000001e-27Initial program 97.1%
+-commutative97.1%
associate-+r+97.1%
associate-+r-97.1%
associate-+l-97.1%
associate-+r-97.1%
Simplified80.8%
Taylor expanded in t around inf 15.7%
associate--l+19.3%
+-commutative19.3%
associate--l+19.3%
+-commutative19.3%
associate-+r+19.3%
Simplified19.3%
Taylor expanded in x around 0 29.4%
Taylor expanded in y around 0 29.4%
associate--l+51.8%
Simplified51.8%
if 1.5000000000000001e-27 < y < 4.5e15Initial program 91.3%
+-commutative91.3%
associate-+r+91.3%
associate-+r-91.1%
associate-+l-91.0%
associate-+r-91.0%
Simplified65.6%
Taylor expanded in t around inf 11.9%
associate--l+19.6%
+-commutative19.6%
associate--l+19.6%
+-commutative19.6%
associate-+r+19.6%
Simplified19.6%
Taylor expanded in z around inf 25.3%
Taylor expanded in x around 0 25.5%
if 4.5e15 < y Initial program 84.4%
+-commutative84.4%
associate-+r+84.4%
associate-+r-50.9%
associate-+l-28.8%
associate-+r-7.9%
Simplified5.4%
Taylor expanded in t around inf 4.0%
associate--l+17.6%
+-commutative17.6%
associate--l+21.2%
+-commutative21.2%
associate-+r+21.2%
Simplified21.2%
Taylor expanded in z around inf 17.0%
Taylor expanded in y around inf 17.1%
flip--17.1%
add-sqr-sqrt17.4%
add-sqr-sqrt17.1%
Applied egg-rr17.1%
associate--l+20.6%
+-inverses20.6%
metadata-eval20.6%
Simplified20.6%
Final simplification34.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 (<= y 1.5e-27)
(+ (- (sqrt (+ 1.0 z)) (sqrt z)) 2.0)
(if (<= y 4.5e+15)
(- (+ 1.0 (sqrt (+ 1.0 y))) (+ (sqrt x) (sqrt y)))
(/ 1.0 (+ (sqrt (+ 1.0 x)) (sqrt x))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 1.5e-27) {
tmp = (sqrt((1.0 + z)) - sqrt(z)) + 2.0;
} else if (y <= 4.5e+15) {
tmp = (1.0 + sqrt((1.0 + y))) - (sqrt(x) + sqrt(y));
} else {
tmp = 1.0 / (sqrt((1.0 + x)) + sqrt(x));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= 1.5d-27) then
tmp = (sqrt((1.0d0 + z)) - sqrt(z)) + 2.0d0
else if (y <= 4.5d+15) then
tmp = (1.0d0 + sqrt((1.0d0 + y))) - (sqrt(x) + sqrt(y))
else
tmp = 1.0d0 / (sqrt((1.0d0 + x)) + sqrt(x))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= 1.5e-27) {
tmp = (Math.sqrt((1.0 + z)) - Math.sqrt(z)) + 2.0;
} else if (y <= 4.5e+15) {
tmp = (1.0 + Math.sqrt((1.0 + y))) - (Math.sqrt(x) + Math.sqrt(y));
} else {
tmp = 1.0 / (Math.sqrt((1.0 + x)) + Math.sqrt(x));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if y <= 1.5e-27: tmp = (math.sqrt((1.0 + z)) - math.sqrt(z)) + 2.0 elif y <= 4.5e+15: tmp = (1.0 + math.sqrt((1.0 + y))) - (math.sqrt(x) + math.sqrt(y)) else: tmp = 1.0 / (math.sqrt((1.0 + x)) + math.sqrt(x)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (y <= 1.5e-27) tmp = Float64(Float64(sqrt(Float64(1.0 + z)) - sqrt(z)) + 2.0); elseif (y <= 4.5e+15) tmp = Float64(Float64(1.0 + sqrt(Float64(1.0 + y))) - Float64(sqrt(x) + sqrt(y))); else tmp = Float64(1.0 / Float64(sqrt(Float64(1.0 + x)) + sqrt(x))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (y <= 1.5e-27)
tmp = (sqrt((1.0 + z)) - sqrt(z)) + 2.0;
elseif (y <= 4.5e+15)
tmp = (1.0 + sqrt((1.0 + y))) - (sqrt(x) + sqrt(y));
else
tmp = 1.0 / (sqrt((1.0 + x)) + sqrt(x));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[y, 1.5e-27], N[(N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision], If[LessEqual[y, 4.5e+15], N[(N[(1.0 + N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 1.5 \cdot 10^{-27}:\\
\;\;\;\;\left(\sqrt{1 + z} - \sqrt{z}\right) + 2\\
\mathbf{elif}\;y \leq 4.5 \cdot 10^{+15}:\\
\;\;\;\;\left(1 + \sqrt{1 + y}\right) - \left(\sqrt{x} + \sqrt{y}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{1 + x} + \sqrt{x}}\\
\end{array}
\end{array}
if y < 1.5000000000000001e-27Initial program 97.1%
+-commutative97.1%
associate-+r+97.1%
associate-+r-97.1%
associate-+l-97.1%
associate-+r-97.1%
Simplified80.8%
Taylor expanded in t around inf 15.7%
associate--l+19.3%
+-commutative19.3%
associate--l+19.3%
+-commutative19.3%
associate-+r+19.3%
Simplified19.3%
Taylor expanded in x around 0 29.4%
Taylor expanded in y around 0 29.4%
associate--l+51.8%
Simplified51.8%
if 1.5000000000000001e-27 < y < 4.5e15Initial program 91.3%
+-commutative91.3%
associate-+r+91.3%
associate-+r-91.1%
associate-+l-91.0%
associate-+r-91.0%
Simplified65.6%
Taylor expanded in t around inf 11.9%
associate--l+19.6%
+-commutative19.6%
associate--l+19.6%
+-commutative19.6%
associate-+r+19.6%
Simplified19.6%
Taylor expanded in z around inf 25.3%
Taylor expanded in x around 0 23.6%
if 4.5e15 < y Initial program 84.4%
+-commutative84.4%
associate-+r+84.4%
associate-+r-50.9%
associate-+l-28.8%
associate-+r-7.9%
Simplified5.4%
Taylor expanded in t around inf 4.0%
associate--l+17.6%
+-commutative17.6%
associate--l+21.2%
+-commutative21.2%
associate-+r+21.2%
Simplified21.2%
Taylor expanded in z around inf 17.0%
Taylor expanded in y around inf 17.1%
flip--17.1%
add-sqr-sqrt17.4%
add-sqr-sqrt17.1%
Applied egg-rr17.1%
associate--l+20.6%
+-inverses20.6%
metadata-eval20.6%
Simplified20.6%
Final simplification34.5%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(if (<= y 1.5e-27)
(+ (- (sqrt (+ 1.0 z)) (sqrt z)) 2.0)
(if (<= y 2e+15)
(+ 1.0 (- (sqrt (+ 1.0 y)) (sqrt y)))
(/ 1.0 (+ (sqrt (+ 1.0 x)) (sqrt x))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 1.5e-27) {
tmp = (sqrt((1.0 + z)) - sqrt(z)) + 2.0;
} else if (y <= 2e+15) {
tmp = 1.0 + (sqrt((1.0 + y)) - sqrt(y));
} else {
tmp = 1.0 / (sqrt((1.0 + x)) + sqrt(x));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= 1.5d-27) then
tmp = (sqrt((1.0d0 + z)) - sqrt(z)) + 2.0d0
else if (y <= 2d+15) then
tmp = 1.0d0 + (sqrt((1.0d0 + y)) - sqrt(y))
else
tmp = 1.0d0 / (sqrt((1.0d0 + x)) + sqrt(x))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= 1.5e-27) {
tmp = (Math.sqrt((1.0 + z)) - Math.sqrt(z)) + 2.0;
} else if (y <= 2e+15) {
tmp = 1.0 + (Math.sqrt((1.0 + y)) - Math.sqrt(y));
} else {
tmp = 1.0 / (Math.sqrt((1.0 + x)) + Math.sqrt(x));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if y <= 1.5e-27: tmp = (math.sqrt((1.0 + z)) - math.sqrt(z)) + 2.0 elif y <= 2e+15: tmp = 1.0 + (math.sqrt((1.0 + y)) - math.sqrt(y)) else: tmp = 1.0 / (math.sqrt((1.0 + x)) + math.sqrt(x)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (y <= 1.5e-27) tmp = Float64(Float64(sqrt(Float64(1.0 + z)) - sqrt(z)) + 2.0); elseif (y <= 2e+15) tmp = Float64(1.0 + Float64(sqrt(Float64(1.0 + y)) - sqrt(y))); else tmp = Float64(1.0 / Float64(sqrt(Float64(1.0 + x)) + sqrt(x))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (y <= 1.5e-27)
tmp = (sqrt((1.0 + z)) - sqrt(z)) + 2.0;
elseif (y <= 2e+15)
tmp = 1.0 + (sqrt((1.0 + y)) - sqrt(y));
else
tmp = 1.0 / (sqrt((1.0 + x)) + sqrt(x));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[y, 1.5e-27], N[(N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision], If[LessEqual[y, 2e+15], N[(1.0 + N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 1.5 \cdot 10^{-27}:\\
\;\;\;\;\left(\sqrt{1 + z} - \sqrt{z}\right) + 2\\
\mathbf{elif}\;y \leq 2 \cdot 10^{+15}:\\
\;\;\;\;1 + \left(\sqrt{1 + y} - \sqrt{y}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{1 + x} + \sqrt{x}}\\
\end{array}
\end{array}
if y < 1.5000000000000001e-27Initial program 97.1%
+-commutative97.1%
associate-+r+97.1%
associate-+r-97.1%
associate-+l-97.1%
associate-+r-97.1%
Simplified80.8%
Taylor expanded in t around inf 15.7%
associate--l+19.3%
+-commutative19.3%
associate--l+19.3%
+-commutative19.3%
associate-+r+19.3%
Simplified19.3%
Taylor expanded in x around 0 29.4%
Taylor expanded in y around 0 29.4%
associate--l+51.8%
Simplified51.8%
if 1.5000000000000001e-27 < y < 2e15Initial program 91.3%
+-commutative91.3%
associate-+r+91.3%
associate-+r-91.1%
associate-+l-91.0%
associate-+r-91.0%
Simplified65.6%
Taylor expanded in t around inf 11.9%
associate--l+19.6%
+-commutative19.6%
associate--l+19.6%
+-commutative19.6%
associate-+r+19.6%
Simplified19.6%
Taylor expanded in z around inf 25.5%
Taylor expanded in x around 0 52.3%
associate--l+52.6%
Simplified52.6%
if 2e15 < y Initial program 84.4%
+-commutative84.4%
associate-+r+84.4%
associate-+r-50.9%
associate-+l-28.8%
associate-+r-7.9%
Simplified5.4%
Taylor expanded in t around inf 4.0%
associate--l+17.6%
+-commutative17.6%
associate--l+21.2%
+-commutative21.2%
associate-+r+21.2%
Simplified21.2%
Taylor expanded in z around inf 17.0%
Taylor expanded in y around inf 17.1%
flip--17.1%
add-sqr-sqrt17.4%
add-sqr-sqrt17.1%
Applied egg-rr17.1%
associate--l+20.6%
+-inverses20.6%
metadata-eval20.6%
Simplified20.6%
Final simplification36.9%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= y 6.2e+15) (+ 1.0 (- (sqrt (+ 1.0 y)) (sqrt y))) (- (sqrt (+ 1.0 x)) (sqrt x))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 6.2e+15) {
tmp = 1.0 + (sqrt((1.0 + y)) - sqrt(y));
} else {
tmp = sqrt((1.0 + x)) - sqrt(x);
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= 6.2d+15) then
tmp = 1.0d0 + (sqrt((1.0d0 + y)) - sqrt(y))
else
tmp = sqrt((1.0d0 + x)) - sqrt(x)
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= 6.2e+15) {
tmp = 1.0 + (Math.sqrt((1.0 + y)) - Math.sqrt(y));
} else {
tmp = Math.sqrt((1.0 + x)) - Math.sqrt(x);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if y <= 6.2e+15: tmp = 1.0 + (math.sqrt((1.0 + y)) - math.sqrt(y)) else: tmp = math.sqrt((1.0 + x)) - math.sqrt(x) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (y <= 6.2e+15) tmp = Float64(1.0 + Float64(sqrt(Float64(1.0 + y)) - sqrt(y))); else tmp = Float64(sqrt(Float64(1.0 + x)) - sqrt(x)); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (y <= 6.2e+15)
tmp = 1.0 + (sqrt((1.0 + y)) - sqrt(y));
else
tmp = sqrt((1.0 + x)) - sqrt(x);
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[y, 6.2e+15], N[(1.0 + N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 6.2 \cdot 10^{+15}:\\
\;\;\;\;1 + \left(\sqrt{1 + y} - \sqrt{y}\right)\\
\mathbf{else}:\\
\;\;\;\;\sqrt{1 + x} - \sqrt{x}\\
\end{array}
\end{array}
if y < 6.2e15Initial program 96.2%
+-commutative96.2%
associate-+r+96.2%
associate-+r-96.1%
associate-+l-96.1%
associate-+r-96.1%
Simplified78.4%
Taylor expanded in t around inf 15.1%
associate--l+19.3%
+-commutative19.3%
associate--l+19.3%
+-commutative19.3%
associate-+r+19.3%
Simplified19.3%
Taylor expanded in z around inf 21.6%
Taylor expanded in x around 0 49.6%
associate--l+49.6%
Simplified49.6%
if 6.2e15 < y Initial program 84.4%
+-commutative84.4%
associate-+r+84.4%
associate-+r-50.9%
associate-+l-28.8%
associate-+r-7.9%
Simplified5.4%
Taylor expanded in t around inf 4.0%
associate--l+17.6%
+-commutative17.6%
associate--l+21.2%
+-commutative21.2%
associate-+r+21.2%
Simplified21.2%
Taylor expanded in z around inf 17.0%
Taylor expanded in y around inf 17.1%
Final simplification34.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.35e+15) (+ (- (sqrt (+ 1.0 z)) (sqrt z)) 2.0) (+ 1.0 (- (sqrt (+ 1.0 y)) (sqrt y)))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (z <= 1.35e+15) {
tmp = (sqrt((1.0 + z)) - sqrt(z)) + 2.0;
} else {
tmp = 1.0 + (sqrt((1.0 + y)) - sqrt(y));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (z <= 1.35d+15) then
tmp = (sqrt((1.0d0 + z)) - sqrt(z)) + 2.0d0
else
tmp = 1.0d0 + (sqrt((1.0d0 + y)) - sqrt(y))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= 1.35e+15) {
tmp = (Math.sqrt((1.0 + z)) - Math.sqrt(z)) + 2.0;
} else {
tmp = 1.0 + (Math.sqrt((1.0 + y)) - Math.sqrt(y));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if z <= 1.35e+15: tmp = (math.sqrt((1.0 + z)) - math.sqrt(z)) + 2.0 else: tmp = 1.0 + (math.sqrt((1.0 + y)) - math.sqrt(y)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (z <= 1.35e+15) tmp = Float64(Float64(sqrt(Float64(1.0 + z)) - sqrt(z)) + 2.0); else tmp = Float64(1.0 + Float64(sqrt(Float64(1.0 + y)) - sqrt(y))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (z <= 1.35e+15)
tmp = (sqrt((1.0 + z)) - sqrt(z)) + 2.0;
else
tmp = 1.0 + (sqrt((1.0 + y)) - sqrt(y));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[z, 1.35e+15], N[(N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision], N[(1.0 + N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq 1.35 \cdot 10^{+15}:\\
\;\;\;\;\left(\sqrt{1 + z} - \sqrt{z}\right) + 2\\
\mathbf{else}:\\
\;\;\;\;1 + \left(\sqrt{1 + y} - \sqrt{y}\right)\\
\end{array}
\end{array}
if z < 1.35e15Initial program 96.3%
+-commutative96.3%
associate-+r+96.3%
associate-+r-79.3%
associate-+l-69.9%
associate-+r-51.7%
Simplified51.7%
Taylor expanded in t around inf 14.8%
associate--l+18.5%
+-commutative18.5%
associate--l+25.5%
+-commutative25.5%
associate-+r+25.5%
Simplified25.5%
Taylor expanded in x around 0 26.4%
Taylor expanded in y around 0 40.1%
associate--l+40.1%
Simplified40.1%
if 1.35e15 < z Initial program 83.5%
+-commutative83.5%
associate-+r+83.5%
associate-+r-68.4%
associate-+l-56.3%
associate-+r-56.3%
Simplified33.1%
Taylor expanded in t around inf 3.6%
associate--l+18.5%
+-commutative18.5%
associate--l+13.7%
+-commutative13.7%
associate-+r+13.7%
Simplified13.7%
Taylor expanded in z around inf 29.8%
Taylor expanded in x around 0 33.9%
associate--l+52.1%
Simplified52.1%
Final simplification45.5%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= z 1.35e+15) (- (+ (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.35e+15) {
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.35d+15) 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.35e+15) {
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.35e+15: 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.35e+15) 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.35e+15)
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.35e+15], N[(N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] + 2.0), $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(N[Sqrt[N[(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.35 \cdot 10^{+15}:\\
\;\;\;\;\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.35e15Initial program 96.3%
+-commutative96.3%
associate-+r+96.3%
associate-+r-79.3%
associate-+l-69.9%
associate-+r-51.7%
Simplified51.7%
Taylor expanded in t around inf 14.8%
associate--l+18.5%
+-commutative18.5%
associate--l+25.5%
+-commutative25.5%
associate-+r+25.5%
Simplified25.5%
Taylor expanded in x around 0 26.4%
Taylor expanded in y around 0 40.1%
if 1.35e15 < z Initial program 83.5%
+-commutative83.5%
associate-+r+83.5%
associate-+r-68.4%
associate-+l-56.3%
associate-+r-56.3%
Simplified33.1%
Taylor expanded in t around inf 3.6%
associate--l+18.5%
+-commutative18.5%
associate--l+13.7%
+-commutative13.7%
associate-+r+13.7%
Simplified13.7%
Taylor expanded in z around inf 29.8%
Taylor expanded in x around 0 33.9%
associate--l+52.1%
Simplified52.1%
Final simplification45.5%
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 90.5%
+-commutative90.5%
associate-+r+90.5%
associate-+r-74.4%
associate-+l-63.8%
associate-+r-53.7%
Simplified43.3%
Taylor expanded in t around inf 9.8%
associate--l+18.5%
+-commutative18.5%
associate--l+20.2%
+-commutative20.2%
associate-+r+20.2%
Simplified20.2%
Taylor expanded in z around inf 19.4%
Taylor expanded in y around inf 13.6%
Final simplification13.6%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (- (+ 1.0 (* x 0.5)) (sqrt x)))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
return (1.0 + (x * 0.5)) - sqrt(x);
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (1.0d0 + (x * 0.5d0)) - sqrt(x)
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
return (1.0 + (x * 0.5)) - Math.sqrt(x);
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): return (1.0 + (x * 0.5)) - math.sqrt(x)
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) return Float64(Float64(1.0 + Float64(x * 0.5)) - sqrt(x)) end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp = code(x, y, z, t)
tmp = (1.0 + (x * 0.5)) - sqrt(x);
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := N[(N[(1.0 + N[(x * 0.5), $MachinePrecision]), $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\left(1 + x \cdot 0.5\right) - \sqrt{x}
\end{array}
Initial program 90.5%
+-commutative90.5%
associate-+r+90.5%
associate-+r-74.4%
associate-+l-63.8%
associate-+r-53.7%
Simplified43.3%
Taylor expanded in t around inf 9.8%
associate--l+18.5%
+-commutative18.5%
associate--l+20.2%
+-commutative20.2%
associate-+r+20.2%
Simplified20.2%
Taylor expanded in z around inf 19.4%
Taylor expanded in y around inf 13.6%
Taylor expanded in x around 0 14.2%
Final simplification14.2%
(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 2024018
(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))))