
(FPCore (x y z t) :precision binary64 (+ (+ (+ (- (sqrt (+ x 1.0)) (sqrt x)) (- (sqrt (+ y 1.0)) (sqrt y))) (- (sqrt (+ z 1.0)) (sqrt z))) (- (sqrt (+ t 1.0)) (sqrt t))))
double code(double x, double y, double z, double t) {
return (((sqrt((x + 1.0)) - sqrt(x)) + (sqrt((y + 1.0)) - sqrt(y))) + (sqrt((z + 1.0)) - sqrt(z))) + (sqrt((t + 1.0)) - sqrt(t));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (((sqrt((x + 1.0d0)) - sqrt(x)) + (sqrt((y + 1.0d0)) - sqrt(y))) + (sqrt((z + 1.0d0)) - sqrt(z))) + (sqrt((t + 1.0d0)) - sqrt(t))
end function
public static double code(double x, double y, double z, double t) {
return (((Math.sqrt((x + 1.0)) - Math.sqrt(x)) + (Math.sqrt((y + 1.0)) - Math.sqrt(y))) + (Math.sqrt((z + 1.0)) - Math.sqrt(z))) + (Math.sqrt((t + 1.0)) - Math.sqrt(t));
}
def code(x, y, z, t): return (((math.sqrt((x + 1.0)) - math.sqrt(x)) + (math.sqrt((y + 1.0)) - math.sqrt(y))) + (math.sqrt((z + 1.0)) - math.sqrt(z))) + (math.sqrt((t + 1.0)) - math.sqrt(t))
function code(x, y, z, t) return Float64(Float64(Float64(Float64(sqrt(Float64(x + 1.0)) - sqrt(x)) + Float64(sqrt(Float64(y + 1.0)) - sqrt(y))) + Float64(sqrt(Float64(z + 1.0)) - sqrt(z))) + Float64(sqrt(Float64(t + 1.0)) - sqrt(t))) end
function tmp = code(x, y, z, t) tmp = (((sqrt((x + 1.0)) - sqrt(x)) + (sqrt((y + 1.0)) - sqrt(y))) + (sqrt((z + 1.0)) - sqrt(z))) + (sqrt((t + 1.0)) - sqrt(t)); end
code[x_, y_, z_, t_] := N[(N[(N[(N[(N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(z + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(t + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{y + 1} - \sqrt{y}\right)\right) + \left(\sqrt{z + 1} - \sqrt{z}\right)\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 20 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (+ (+ (+ (- (sqrt (+ x 1.0)) (sqrt x)) (- (sqrt (+ y 1.0)) (sqrt y))) (- (sqrt (+ z 1.0)) (sqrt z))) (- (sqrt (+ t 1.0)) (sqrt t))))
double code(double x, double y, double z, double t) {
return (((sqrt((x + 1.0)) - sqrt(x)) + (sqrt((y + 1.0)) - sqrt(y))) + (sqrt((z + 1.0)) - sqrt(z))) + (sqrt((t + 1.0)) - sqrt(t));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (((sqrt((x + 1.0d0)) - sqrt(x)) + (sqrt((y + 1.0d0)) - sqrt(y))) + (sqrt((z + 1.0d0)) - sqrt(z))) + (sqrt((t + 1.0d0)) - sqrt(t))
end function
public static double code(double x, double y, double z, double t) {
return (((Math.sqrt((x + 1.0)) - Math.sqrt(x)) + (Math.sqrt((y + 1.0)) - Math.sqrt(y))) + (Math.sqrt((z + 1.0)) - Math.sqrt(z))) + (Math.sqrt((t + 1.0)) - Math.sqrt(t));
}
def code(x, y, z, t): return (((math.sqrt((x + 1.0)) - math.sqrt(x)) + (math.sqrt((y + 1.0)) - math.sqrt(y))) + (math.sqrt((z + 1.0)) - math.sqrt(z))) + (math.sqrt((t + 1.0)) - math.sqrt(t))
function code(x, y, z, t) return Float64(Float64(Float64(Float64(sqrt(Float64(x + 1.0)) - sqrt(x)) + Float64(sqrt(Float64(y + 1.0)) - sqrt(y))) + Float64(sqrt(Float64(z + 1.0)) - sqrt(z))) + Float64(sqrt(Float64(t + 1.0)) - sqrt(t))) end
function tmp = code(x, y, z, t) tmp = (((sqrt((x + 1.0)) - sqrt(x)) + (sqrt((y + 1.0)) - sqrt(y))) + (sqrt((z + 1.0)) - sqrt(z))) + (sqrt((t + 1.0)) - sqrt(t)); end
code[x_, y_, z_, t_] := N[(N[(N[(N[(N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(z + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(t + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{y + 1} - \sqrt{y}\right)\right) + \left(\sqrt{z + 1} - \sqrt{z}\right)\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)
\end{array}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ 1.0 y))) (t_2 (sqrt (+ z 1.0))) (t_3 (sqrt (+ x 1.0))))
(if (<= z 2.8e+31)
(+
(+ (- t_3 (sqrt x)) (- t_1 (sqrt y)))
(+ (/ 1.0 (+ (sqrt z) t_2)) (- (sqrt (+ 1.0 t)) (sqrt t))))
(+
(+ (/ 1.0 (+ (sqrt x) t_3)) (/ 1.0 (+ t_1 (sqrt y))))
(- t_2 (sqrt z))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + y));
double t_2 = sqrt((z + 1.0));
double t_3 = sqrt((x + 1.0));
double tmp;
if (z <= 2.8e+31) {
tmp = ((t_3 - sqrt(x)) + (t_1 - sqrt(y))) + ((1.0 / (sqrt(z) + t_2)) + (sqrt((1.0 + t)) - sqrt(t)));
} else {
tmp = ((1.0 / (sqrt(x) + t_3)) + (1.0 / (t_1 + sqrt(y)))) + (t_2 - sqrt(z));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = sqrt((1.0d0 + y))
t_2 = sqrt((z + 1.0d0))
t_3 = sqrt((x + 1.0d0))
if (z <= 2.8d+31) then
tmp = ((t_3 - sqrt(x)) + (t_1 - sqrt(y))) + ((1.0d0 / (sqrt(z) + t_2)) + (sqrt((1.0d0 + t)) - sqrt(t)))
else
tmp = ((1.0d0 / (sqrt(x) + t_3)) + (1.0d0 / (t_1 + sqrt(y)))) + (t_2 - sqrt(z))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + y));
double t_2 = Math.sqrt((z + 1.0));
double t_3 = Math.sqrt((x + 1.0));
double tmp;
if (z <= 2.8e+31) {
tmp = ((t_3 - Math.sqrt(x)) + (t_1 - Math.sqrt(y))) + ((1.0 / (Math.sqrt(z) + t_2)) + (Math.sqrt((1.0 + t)) - Math.sqrt(t)));
} else {
tmp = ((1.0 / (Math.sqrt(x) + t_3)) + (1.0 / (t_1 + Math.sqrt(y)))) + (t_2 - Math.sqrt(z));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + y)) t_2 = math.sqrt((z + 1.0)) t_3 = math.sqrt((x + 1.0)) tmp = 0 if z <= 2.8e+31: tmp = ((t_3 - math.sqrt(x)) + (t_1 - math.sqrt(y))) + ((1.0 / (math.sqrt(z) + t_2)) + (math.sqrt((1.0 + t)) - math.sqrt(t))) else: tmp = ((1.0 / (math.sqrt(x) + t_3)) + (1.0 / (t_1 + math.sqrt(y)))) + (t_2 - math.sqrt(z)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(1.0 + y)) t_2 = sqrt(Float64(z + 1.0)) t_3 = sqrt(Float64(x + 1.0)) tmp = 0.0 if (z <= 2.8e+31) tmp = Float64(Float64(Float64(t_3 - sqrt(x)) + Float64(t_1 - sqrt(y))) + Float64(Float64(1.0 / Float64(sqrt(z) + t_2)) + Float64(sqrt(Float64(1.0 + t)) - sqrt(t)))); else tmp = Float64(Float64(Float64(1.0 / Float64(sqrt(x) + t_3)) + Float64(1.0 / Float64(t_1 + sqrt(y)))) + Float64(t_2 - sqrt(z))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + y));
t_2 = sqrt((z + 1.0));
t_3 = sqrt((x + 1.0));
tmp = 0.0;
if (z <= 2.8e+31)
tmp = ((t_3 - sqrt(x)) + (t_1 - sqrt(y))) + ((1.0 / (sqrt(z) + t_2)) + (sqrt((1.0 + t)) - sqrt(t)));
else
tmp = ((1.0 / (sqrt(x) + t_3)) + (1.0 / (t_1 + sqrt(y)))) + (t_2 - sqrt(z));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(z + 1.0), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[z, 2.8e+31], N[(N[(N[(t$95$3 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(t$95$1 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 / N[(N[Sqrt[z], $MachinePrecision] + t$95$2), $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + t$95$3), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(t$95$1 + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$2 - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + y}\\
t_2 := \sqrt{z + 1}\\
t_3 := \sqrt{x + 1}\\
\mathbf{if}\;z \leq 2.8 \cdot 10^{+31}:\\
\;\;\;\;\left(\left(t\_3 - \sqrt{x}\right) + \left(t\_1 - \sqrt{y}\right)\right) + \left(\frac{1}{\sqrt{z} + t\_2} + \left(\sqrt{1 + t} - \sqrt{t}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{1}{\sqrt{x} + t\_3} + \frac{1}{t\_1 + \sqrt{y}}\right) + \left(t\_2 - \sqrt{z}\right)\\
\end{array}
\end{array}
if z < 2.80000000000000017e31Initial program 95.8%
associate-+l+95.8%
sub-neg95.8%
sub-neg95.8%
+-commutative95.8%
+-commutative95.8%
+-commutative95.8%
Simplified95.8%
flip--96.4%
div-inv96.4%
add-sqr-sqrt96.2%
add-sqr-sqrt96.9%
associate--l+97.6%
Applied egg-rr97.6%
+-inverses97.6%
metadata-eval97.6%
*-lft-identity97.6%
+-commutative97.6%
Simplified97.6%
if 2.80000000000000017e31 < z Initial program 86.9%
associate-+l+86.9%
sub-neg86.9%
sub-neg86.9%
+-commutative86.9%
+-commutative86.9%
+-commutative86.9%
Simplified86.9%
flip--87.1%
div-inv87.1%
add-sqr-sqrt72.1%
add-sqr-sqrt87.4%
associate--l+88.8%
Applied egg-rr88.8%
+-inverses88.8%
metadata-eval88.8%
*-lft-identity88.8%
+-commutative88.8%
Simplified88.8%
Taylor expanded in t around inf 39.3%
flip--39.4%
div-inv39.4%
add-sqr-sqrt35.3%
+-commutative35.3%
add-sqr-sqrt40.6%
+-commutative40.6%
Applied egg-rr40.6%
associate--l+44.3%
+-inverses44.3%
metadata-eval44.3%
*-lft-identity44.3%
+-commutative44.3%
Simplified44.3%
Final simplification74.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 (+ z 1.0))))
(if (<= (- (sqrt (+ x 1.0)) (sqrt x)) 0.6)
(+ (- t_2 (sqrt z)) (+ (/ 1.0 (+ t_1 (sqrt y))) (* 0.5 (sqrt (/ 1.0 x)))))
(+ (/ 1.0 (+ (sqrt z) t_2)) (+ (- t_1 (sqrt y)) (- 1.0 (sqrt x)))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + y));
double t_2 = sqrt((z + 1.0));
double tmp;
if ((sqrt((x + 1.0)) - sqrt(x)) <= 0.6) {
tmp = (t_2 - sqrt(z)) + ((1.0 / (t_1 + sqrt(y))) + (0.5 * sqrt((1.0 / x))));
} else {
tmp = (1.0 / (sqrt(z) + t_2)) + ((t_1 - sqrt(y)) + (1.0 - sqrt(x)));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = sqrt((1.0d0 + y))
t_2 = sqrt((z + 1.0d0))
if ((sqrt((x + 1.0d0)) - sqrt(x)) <= 0.6d0) then
tmp = (t_2 - sqrt(z)) + ((1.0d0 / (t_1 + sqrt(y))) + (0.5d0 * sqrt((1.0d0 / x))))
else
tmp = (1.0d0 / (sqrt(z) + t_2)) + ((t_1 - sqrt(y)) + (1.0d0 - sqrt(x)))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + y));
double t_2 = Math.sqrt((z + 1.0));
double tmp;
if ((Math.sqrt((x + 1.0)) - Math.sqrt(x)) <= 0.6) {
tmp = (t_2 - Math.sqrt(z)) + ((1.0 / (t_1 + Math.sqrt(y))) + (0.5 * Math.sqrt((1.0 / x))));
} else {
tmp = (1.0 / (Math.sqrt(z) + t_2)) + ((t_1 - Math.sqrt(y)) + (1.0 - Math.sqrt(x)));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + y)) t_2 = math.sqrt((z + 1.0)) tmp = 0 if (math.sqrt((x + 1.0)) - math.sqrt(x)) <= 0.6: tmp = (t_2 - math.sqrt(z)) + ((1.0 / (t_1 + math.sqrt(y))) + (0.5 * math.sqrt((1.0 / x)))) else: tmp = (1.0 / (math.sqrt(z) + t_2)) + ((t_1 - math.sqrt(y)) + (1.0 - math.sqrt(x))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(1.0 + y)) t_2 = sqrt(Float64(z + 1.0)) tmp = 0.0 if (Float64(sqrt(Float64(x + 1.0)) - sqrt(x)) <= 0.6) tmp = Float64(Float64(t_2 - sqrt(z)) + Float64(Float64(1.0 / Float64(t_1 + sqrt(y))) + Float64(0.5 * sqrt(Float64(1.0 / x))))); else tmp = Float64(Float64(1.0 / Float64(sqrt(z) + t_2)) + Float64(Float64(t_1 - sqrt(y)) + Float64(1.0 - sqrt(x)))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + y));
t_2 = sqrt((z + 1.0));
tmp = 0.0;
if ((sqrt((x + 1.0)) - sqrt(x)) <= 0.6)
tmp = (t_2 - sqrt(z)) + ((1.0 / (t_1 + sqrt(y))) + (0.5 * sqrt((1.0 / x))));
else
tmp = (1.0 / (sqrt(z) + t_2)) + ((t_1 - sqrt(y)) + (1.0 - sqrt(x)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(z + 1.0), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision], 0.6], N[(N[(t$95$2 - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 / N[(t$95$1 + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(0.5 * N[Sqrt[N[(1.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[(N[Sqrt[z], $MachinePrecision] + t$95$2), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$1 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision] + N[(1.0 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + y}\\
t_2 := \sqrt{z + 1}\\
\mathbf{if}\;\sqrt{x + 1} - \sqrt{x} \leq 0.6:\\
\;\;\;\;\left(t\_2 - \sqrt{z}\right) + \left(\frac{1}{t\_1 + \sqrt{y}} + 0.5 \cdot \sqrt{\frac{1}{x}}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{z} + t\_2} + \left(\left(t\_1 - \sqrt{y}\right) + \left(1 - \sqrt{x}\right)\right)\\
\end{array}
\end{array}
if (-.f64 (sqrt.f64 (+.f64 x #s(literal 1 binary64))) (sqrt.f64 x)) < 0.599999999999999978Initial program 86.4%
associate-+l+86.4%
sub-neg86.4%
sub-neg86.4%
+-commutative86.4%
+-commutative86.4%
+-commutative86.4%
Simplified86.4%
flip--86.5%
div-inv86.5%
add-sqr-sqrt69.9%
add-sqr-sqrt86.6%
associate--l+87.9%
Applied egg-rr87.9%
+-inverses87.9%
metadata-eval87.9%
*-lft-identity87.9%
+-commutative87.9%
Simplified87.9%
Taylor expanded in t around inf 41.5%
Taylor expanded in x around inf 46.2%
if 0.599999999999999978 < (-.f64 (sqrt.f64 (+.f64 x #s(literal 1 binary64))) (sqrt.f64 x)) Initial program 97.9%
associate-+l+97.9%
sub-neg97.9%
sub-neg97.9%
+-commutative97.9%
+-commutative97.9%
+-commutative97.9%
Simplified97.9%
Taylor expanded in x around 0 97.0%
flip--98.5%
div-inv98.5%
add-sqr-sqrt82.7%
add-sqr-sqrt98.8%
associate--l+98.8%
Applied egg-rr97.9%
+-inverses98.8%
metadata-eval98.8%
*-lft-identity98.8%
+-commutative98.8%
Simplified97.9%
Taylor expanded in t around inf 52.8%
Final simplification49.4%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ 1.0 y))) (t_2 (sqrt (+ z 1.0))))
(if (<= z 1.66e+31)
(+
(+ (/ 1.0 (+ (sqrt z) t_2)) (- (sqrt (+ 1.0 t)) (sqrt t)))
(+ (- t_1 (sqrt y)) (- 1.0 (sqrt x))))
(+
(+ (/ 1.0 (+ (sqrt x) (sqrt (+ x 1.0)))) (/ 1.0 (+ t_1 (sqrt y))))
(- t_2 (sqrt z))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + y));
double t_2 = sqrt((z + 1.0));
double tmp;
if (z <= 1.66e+31) {
tmp = ((1.0 / (sqrt(z) + t_2)) + (sqrt((1.0 + t)) - sqrt(t))) + ((t_1 - sqrt(y)) + (1.0 - sqrt(x)));
} else {
tmp = ((1.0 / (sqrt(x) + sqrt((x + 1.0)))) + (1.0 / (t_1 + sqrt(y)))) + (t_2 - sqrt(z));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = sqrt((1.0d0 + y))
t_2 = sqrt((z + 1.0d0))
if (z <= 1.66d+31) then
tmp = ((1.0d0 / (sqrt(z) + t_2)) + (sqrt((1.0d0 + t)) - sqrt(t))) + ((t_1 - sqrt(y)) + (1.0d0 - sqrt(x)))
else
tmp = ((1.0d0 / (sqrt(x) + sqrt((x + 1.0d0)))) + (1.0d0 / (t_1 + sqrt(y)))) + (t_2 - sqrt(z))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + y));
double t_2 = Math.sqrt((z + 1.0));
double tmp;
if (z <= 1.66e+31) {
tmp = ((1.0 / (Math.sqrt(z) + t_2)) + (Math.sqrt((1.0 + t)) - Math.sqrt(t))) + ((t_1 - Math.sqrt(y)) + (1.0 - Math.sqrt(x)));
} else {
tmp = ((1.0 / (Math.sqrt(x) + Math.sqrt((x + 1.0)))) + (1.0 / (t_1 + Math.sqrt(y)))) + (t_2 - Math.sqrt(z));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + y)) t_2 = math.sqrt((z + 1.0)) tmp = 0 if z <= 1.66e+31: tmp = ((1.0 / (math.sqrt(z) + t_2)) + (math.sqrt((1.0 + t)) - math.sqrt(t))) + ((t_1 - math.sqrt(y)) + (1.0 - math.sqrt(x))) else: tmp = ((1.0 / (math.sqrt(x) + math.sqrt((x + 1.0)))) + (1.0 / (t_1 + math.sqrt(y)))) + (t_2 - math.sqrt(z)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(1.0 + y)) t_2 = sqrt(Float64(z + 1.0)) tmp = 0.0 if (z <= 1.66e+31) tmp = Float64(Float64(Float64(1.0 / Float64(sqrt(z) + t_2)) + Float64(sqrt(Float64(1.0 + t)) - sqrt(t))) + Float64(Float64(t_1 - sqrt(y)) + Float64(1.0 - sqrt(x)))); else tmp = Float64(Float64(Float64(1.0 / Float64(sqrt(x) + sqrt(Float64(x + 1.0)))) + Float64(1.0 / Float64(t_1 + sqrt(y)))) + Float64(t_2 - sqrt(z))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + y));
t_2 = sqrt((z + 1.0));
tmp = 0.0;
if (z <= 1.66e+31)
tmp = ((1.0 / (sqrt(z) + t_2)) + (sqrt((1.0 + t)) - sqrt(t))) + ((t_1 - sqrt(y)) + (1.0 - sqrt(x)));
else
tmp = ((1.0 / (sqrt(x) + sqrt((x + 1.0)))) + (1.0 / (t_1 + sqrt(y)))) + (t_2 - sqrt(z));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(z + 1.0), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[z, 1.66e+31], N[(N[(N[(1.0 / N[(N[Sqrt[z], $MachinePrecision] + t$95$2), $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$1 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision] + N[(1.0 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(t$95$1 + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$2 - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + y}\\
t_2 := \sqrt{z + 1}\\
\mathbf{if}\;z \leq 1.66 \cdot 10^{+31}:\\
\;\;\;\;\left(\frac{1}{\sqrt{z} + t\_2} + \left(\sqrt{1 + t} - \sqrt{t}\right)\right) + \left(\left(t\_1 - \sqrt{y}\right) + \left(1 - \sqrt{x}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{1}{\sqrt{x} + \sqrt{x + 1}} + \frac{1}{t\_1 + \sqrt{y}}\right) + \left(t\_2 - \sqrt{z}\right)\\
\end{array}
\end{array}
if z < 1.6599999999999999e31Initial program 95.8%
associate-+l+95.8%
sub-neg95.8%
sub-neg95.8%
+-commutative95.8%
+-commutative95.8%
+-commutative95.8%
Simplified95.8%
Taylor expanded in x around 0 48.6%
flip--96.4%
div-inv96.4%
add-sqr-sqrt96.2%
add-sqr-sqrt96.9%
associate--l+97.6%
Applied egg-rr49.4%
+-inverses97.6%
metadata-eval97.6%
*-lft-identity97.6%
+-commutative97.6%
Simplified49.4%
if 1.6599999999999999e31 < z Initial program 86.9%
associate-+l+86.9%
sub-neg86.9%
sub-neg86.9%
+-commutative86.9%
+-commutative86.9%
+-commutative86.9%
Simplified86.9%
flip--87.1%
div-inv87.1%
add-sqr-sqrt72.1%
add-sqr-sqrt87.4%
associate--l+88.8%
Applied egg-rr88.8%
+-inverses88.8%
metadata-eval88.8%
*-lft-identity88.8%
+-commutative88.8%
Simplified88.8%
Taylor expanded in t around inf 39.3%
flip--39.4%
div-inv39.4%
add-sqr-sqrt35.3%
+-commutative35.3%
add-sqr-sqrt40.6%
+-commutative40.6%
Applied egg-rr40.6%
associate--l+44.3%
+-inverses44.3%
metadata-eval44.3%
*-lft-identity44.3%
+-commutative44.3%
Simplified44.3%
Final simplification47.2%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ z 1.0))) (t_2 (sqrt (+ x 1.0))))
(if (<= (- t_2 (sqrt x)) 0.9999998)
(+ (/ 1.0 (+ (sqrt x) t_2)) (- t_1 (sqrt z)))
(+
(/ 1.0 (+ (sqrt z) t_1))
(+ (- (sqrt (+ 1.0 y)) (sqrt y)) (- 1.0 (sqrt x)))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((z + 1.0));
double t_2 = sqrt((x + 1.0));
double tmp;
if ((t_2 - sqrt(x)) <= 0.9999998) {
tmp = (1.0 / (sqrt(x) + t_2)) + (t_1 - sqrt(z));
} else {
tmp = (1.0 / (sqrt(z) + t_1)) + ((sqrt((1.0 + y)) - sqrt(y)) + (1.0 - sqrt(x)));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = sqrt((z + 1.0d0))
t_2 = sqrt((x + 1.0d0))
if ((t_2 - sqrt(x)) <= 0.9999998d0) then
tmp = (1.0d0 / (sqrt(x) + t_2)) + (t_1 - sqrt(z))
else
tmp = (1.0d0 / (sqrt(z) + t_1)) + ((sqrt((1.0d0 + y)) - sqrt(y)) + (1.0d0 - sqrt(x)))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((z + 1.0));
double t_2 = Math.sqrt((x + 1.0));
double tmp;
if ((t_2 - Math.sqrt(x)) <= 0.9999998) {
tmp = (1.0 / (Math.sqrt(x) + t_2)) + (t_1 - Math.sqrt(z));
} else {
tmp = (1.0 / (Math.sqrt(z) + t_1)) + ((Math.sqrt((1.0 + y)) - Math.sqrt(y)) + (1.0 - Math.sqrt(x)));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((z + 1.0)) t_2 = math.sqrt((x + 1.0)) tmp = 0 if (t_2 - math.sqrt(x)) <= 0.9999998: tmp = (1.0 / (math.sqrt(x) + t_2)) + (t_1 - math.sqrt(z)) else: tmp = (1.0 / (math.sqrt(z) + t_1)) + ((math.sqrt((1.0 + y)) - math.sqrt(y)) + (1.0 - math.sqrt(x))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(z + 1.0)) t_2 = sqrt(Float64(x + 1.0)) tmp = 0.0 if (Float64(t_2 - sqrt(x)) <= 0.9999998) tmp = Float64(Float64(1.0 / Float64(sqrt(x) + t_2)) + Float64(t_1 - sqrt(z))); else tmp = Float64(Float64(1.0 / Float64(sqrt(z) + t_1)) + Float64(Float64(sqrt(Float64(1.0 + y)) - sqrt(y)) + Float64(1.0 - sqrt(x)))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((z + 1.0));
t_2 = sqrt((x + 1.0));
tmp = 0.0;
if ((t_2 - sqrt(x)) <= 0.9999998)
tmp = (1.0 / (sqrt(x) + t_2)) + (t_1 - sqrt(z));
else
tmp = (1.0 / (sqrt(z) + t_1)) + ((sqrt((1.0 + y)) - sqrt(y)) + (1.0 - sqrt(x)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(z + 1.0), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(t$95$2 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision], 0.9999998], N[(N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + t$95$2), $MachinePrecision]), $MachinePrecision] + N[(t$95$1 - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[(N[Sqrt[z], $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision] + N[(N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision] + N[(1.0 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{z + 1}\\
t_2 := \sqrt{x + 1}\\
\mathbf{if}\;t\_2 - \sqrt{x} \leq 0.9999998:\\
\;\;\;\;\frac{1}{\sqrt{x} + t\_2} + \left(t\_1 - \sqrt{z}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{z} + t\_1} + \left(\left(\sqrt{1 + y} - \sqrt{y}\right) + \left(1 - \sqrt{x}\right)\right)\\
\end{array}
\end{array}
if (-.f64 (sqrt.f64 (+.f64 x #s(literal 1 binary64))) (sqrt.f64 x)) < 0.999999799999999994Initial program 86.7%
associate-+l+86.7%
sub-neg86.7%
sub-neg86.7%
+-commutative86.7%
+-commutative86.7%
+-commutative86.7%
Simplified86.7%
flip--86.8%
div-inv86.8%
add-sqr-sqrt69.9%
add-sqr-sqrt86.9%
associate--l+88.2%
Applied egg-rr88.2%
+-inverses88.2%
metadata-eval88.2%
*-lft-identity88.2%
+-commutative88.2%
Simplified88.2%
Taylor expanded in t around inf 42.2%
flip--42.3%
div-inv42.3%
add-sqr-sqrt27.4%
+-commutative27.4%
add-sqr-sqrt43.5%
+-commutative43.5%
Applied egg-rr43.5%
associate--l+47.0%
+-inverses47.0%
metadata-eval47.0%
*-lft-identity47.0%
+-commutative47.0%
Simplified47.0%
Taylor expanded in y around inf 25.5%
if 0.999999799999999994 < (-.f64 (sqrt.f64 (+.f64 x #s(literal 1 binary64))) (sqrt.f64 x)) Initial program 97.9%
associate-+l+97.9%
sub-neg97.9%
sub-neg97.9%
+-commutative97.9%
+-commutative97.9%
+-commutative97.9%
Simplified97.9%
Taylor expanded in x around 0 97.9%
flip--98.5%
div-inv98.5%
add-sqr-sqrt82.3%
add-sqr-sqrt98.7%
associate--l+98.7%
Applied egg-rr98.7%
+-inverses98.7%
metadata-eval98.7%
*-lft-identity98.7%
+-commutative98.7%
Simplified98.7%
Taylor expanded in t around inf 52.8%
Final simplification38.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 (+ z 1.0)))
(t_2 (- (sqrt (+ 1.0 y)) (sqrt y)))
(t_3 (+ t_2 (- 1.0 (sqrt x)))))
(if (<= z 5e-23)
(+ t_3 (+ (- (sqrt (+ 1.0 t)) (sqrt t)) (- 1.0 (sqrt z))))
(if (<= z 1.65e+31)
(+ (/ 1.0 (+ (sqrt z) t_1)) t_3)
(+ (- t_1 (sqrt z)) (+ t_2 (/ 1.0 (+ (sqrt x) (sqrt (+ x 1.0))))))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((z + 1.0));
double t_2 = sqrt((1.0 + y)) - sqrt(y);
double t_3 = t_2 + (1.0 - sqrt(x));
double tmp;
if (z <= 5e-23) {
tmp = t_3 + ((sqrt((1.0 + t)) - sqrt(t)) + (1.0 - sqrt(z)));
} else if (z <= 1.65e+31) {
tmp = (1.0 / (sqrt(z) + t_1)) + t_3;
} else {
tmp = (t_1 - sqrt(z)) + (t_2 + (1.0 / (sqrt(x) + sqrt((x + 1.0)))));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = sqrt((z + 1.0d0))
t_2 = sqrt((1.0d0 + y)) - sqrt(y)
t_3 = t_2 + (1.0d0 - sqrt(x))
if (z <= 5d-23) then
tmp = t_3 + ((sqrt((1.0d0 + t)) - sqrt(t)) + (1.0d0 - sqrt(z)))
else if (z <= 1.65d+31) then
tmp = (1.0d0 / (sqrt(z) + t_1)) + t_3
else
tmp = (t_1 - sqrt(z)) + (t_2 + (1.0d0 / (sqrt(x) + sqrt((x + 1.0d0)))))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((z + 1.0));
double t_2 = Math.sqrt((1.0 + y)) - Math.sqrt(y);
double t_3 = t_2 + (1.0 - Math.sqrt(x));
double tmp;
if (z <= 5e-23) {
tmp = t_3 + ((Math.sqrt((1.0 + t)) - Math.sqrt(t)) + (1.0 - Math.sqrt(z)));
} else if (z <= 1.65e+31) {
tmp = (1.0 / (Math.sqrt(z) + t_1)) + t_3;
} else {
tmp = (t_1 - Math.sqrt(z)) + (t_2 + (1.0 / (Math.sqrt(x) + Math.sqrt((x + 1.0)))));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((z + 1.0)) t_2 = math.sqrt((1.0 + y)) - math.sqrt(y) t_3 = t_2 + (1.0 - math.sqrt(x)) tmp = 0 if z <= 5e-23: tmp = t_3 + ((math.sqrt((1.0 + t)) - math.sqrt(t)) + (1.0 - math.sqrt(z))) elif z <= 1.65e+31: tmp = (1.0 / (math.sqrt(z) + t_1)) + t_3 else: tmp = (t_1 - math.sqrt(z)) + (t_2 + (1.0 / (math.sqrt(x) + math.sqrt((x + 1.0))))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(z + 1.0)) t_2 = Float64(sqrt(Float64(1.0 + y)) - sqrt(y)) t_3 = Float64(t_2 + Float64(1.0 - sqrt(x))) tmp = 0.0 if (z <= 5e-23) tmp = Float64(t_3 + Float64(Float64(sqrt(Float64(1.0 + t)) - sqrt(t)) + Float64(1.0 - sqrt(z)))); elseif (z <= 1.65e+31) tmp = Float64(Float64(1.0 / Float64(sqrt(z) + t_1)) + t_3); else tmp = Float64(Float64(t_1 - sqrt(z)) + Float64(t_2 + Float64(1.0 / Float64(sqrt(x) + sqrt(Float64(x + 1.0)))))); 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((z + 1.0));
t_2 = sqrt((1.0 + y)) - sqrt(y);
t_3 = t_2 + (1.0 - sqrt(x));
tmp = 0.0;
if (z <= 5e-23)
tmp = t_3 + ((sqrt((1.0 + t)) - sqrt(t)) + (1.0 - sqrt(z)));
elseif (z <= 1.65e+31)
tmp = (1.0 / (sqrt(z) + t_1)) + t_3;
else
tmp = (t_1 - sqrt(z)) + (t_2 + (1.0 / (sqrt(x) + sqrt((x + 1.0)))));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(z + 1.0), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(t$95$2 + N[(1.0 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, 5e-23], N[(t$95$3 + N[(N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision] + N[(1.0 - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.65e+31], N[(N[(1.0 / N[(N[Sqrt[z], $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision] + t$95$3), $MachinePrecision], N[(N[(t$95$1 - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] + N[(t$95$2 + N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{z + 1}\\
t_2 := \sqrt{1 + y} - \sqrt{y}\\
t_3 := t\_2 + \left(1 - \sqrt{x}\right)\\
\mathbf{if}\;z \leq 5 \cdot 10^{-23}:\\
\;\;\;\;t\_3 + \left(\left(\sqrt{1 + t} - \sqrt{t}\right) + \left(1 - \sqrt{z}\right)\right)\\
\mathbf{elif}\;z \leq 1.65 \cdot 10^{+31}:\\
\;\;\;\;\frac{1}{\sqrt{z} + t\_1} + t\_3\\
\mathbf{else}:\\
\;\;\;\;\left(t\_1 - \sqrt{z}\right) + \left(t\_2 + \frac{1}{\sqrt{x} + \sqrt{x + 1}}\right)\\
\end{array}
\end{array}
if z < 5.0000000000000002e-23Initial program 97.5%
associate-+l+97.5%
sub-neg97.5%
sub-neg97.5%
+-commutative97.5%
+-commutative97.5%
+-commutative97.5%
Simplified97.5%
Taylor expanded in x around 0 51.5%
Taylor expanded in z around 0 51.5%
if 5.0000000000000002e-23 < z < 1.64999999999999996e31Initial program 84.8%
associate-+l+84.8%
sub-neg84.8%
sub-neg84.8%
+-commutative84.8%
+-commutative84.8%
+-commutative84.8%
Simplified84.8%
Taylor expanded in x around 0 30.5%
flip--89.4%
div-inv89.4%
add-sqr-sqrt88.2%
add-sqr-sqrt92.8%
associate--l+98.3%
Applied egg-rr35.8%
+-inverses98.3%
metadata-eval98.3%
*-lft-identity98.3%
+-commutative98.3%
Simplified35.8%
Taylor expanded in t around inf 19.7%
if 1.64999999999999996e31 < z Initial program 86.9%
associate-+l+86.9%
sub-neg86.9%
sub-neg86.9%
+-commutative86.9%
+-commutative86.9%
+-commutative86.9%
Simplified86.9%
flip--39.4%
div-inv39.4%
add-sqr-sqrt35.3%
+-commutative35.3%
add-sqr-sqrt40.6%
+-commutative40.6%
Applied egg-rr88.3%
associate--l+44.3%
+-inverses44.3%
metadata-eval44.3%
*-lft-identity44.3%
+-commutative44.3%
Simplified92.3%
Taylor expanded in t around inf 43.8%
Final simplification45.7%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ z 1.0))))
(if (<= y 4.8e-15)
(+
(+ (/ 1.0 (+ (sqrt z) t_1)) (- (sqrt (+ 1.0 t)) (sqrt t)))
(- 2.0 (+ (sqrt x) (sqrt y))))
(+
(+
(/ 1.0 (+ (sqrt x) (sqrt (+ x 1.0))))
(/ 1.0 (+ (sqrt (+ 1.0 y)) (sqrt y))))
(- t_1 (sqrt z))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((z + 1.0));
double tmp;
if (y <= 4.8e-15) {
tmp = ((1.0 / (sqrt(z) + t_1)) + (sqrt((1.0 + t)) - sqrt(t))) + (2.0 - (sqrt(x) + sqrt(y)));
} else {
tmp = ((1.0 / (sqrt(x) + sqrt((x + 1.0)))) + (1.0 / (sqrt((1.0 + y)) + sqrt(y)))) + (t_1 - sqrt(z));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = sqrt((z + 1.0d0))
if (y <= 4.8d-15) then
tmp = ((1.0d0 / (sqrt(z) + t_1)) + (sqrt((1.0d0 + t)) - sqrt(t))) + (2.0d0 - (sqrt(x) + sqrt(y)))
else
tmp = ((1.0d0 / (sqrt(x) + sqrt((x + 1.0d0)))) + (1.0d0 / (sqrt((1.0d0 + y)) + sqrt(y)))) + (t_1 - sqrt(z))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((z + 1.0));
double tmp;
if (y <= 4.8e-15) {
tmp = ((1.0 / (Math.sqrt(z) + t_1)) + (Math.sqrt((1.0 + t)) - Math.sqrt(t))) + (2.0 - (Math.sqrt(x) + Math.sqrt(y)));
} else {
tmp = ((1.0 / (Math.sqrt(x) + Math.sqrt((x + 1.0)))) + (1.0 / (Math.sqrt((1.0 + y)) + Math.sqrt(y)))) + (t_1 - Math.sqrt(z));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((z + 1.0)) tmp = 0 if y <= 4.8e-15: tmp = ((1.0 / (math.sqrt(z) + t_1)) + (math.sqrt((1.0 + t)) - math.sqrt(t))) + (2.0 - (math.sqrt(x) + math.sqrt(y))) else: tmp = ((1.0 / (math.sqrt(x) + math.sqrt((x + 1.0)))) + (1.0 / (math.sqrt((1.0 + y)) + math.sqrt(y)))) + (t_1 - math.sqrt(z)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(z + 1.0)) tmp = 0.0 if (y <= 4.8e-15) tmp = Float64(Float64(Float64(1.0 / Float64(sqrt(z) + t_1)) + Float64(sqrt(Float64(1.0 + t)) - sqrt(t))) + Float64(2.0 - Float64(sqrt(x) + sqrt(y)))); else tmp = Float64(Float64(Float64(1.0 / Float64(sqrt(x) + sqrt(Float64(x + 1.0)))) + Float64(1.0 / Float64(sqrt(Float64(1.0 + y)) + sqrt(y)))) + Float64(t_1 - sqrt(z))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((z + 1.0));
tmp = 0.0;
if (y <= 4.8e-15)
tmp = ((1.0 / (sqrt(z) + t_1)) + (sqrt((1.0 + t)) - sqrt(t))) + (2.0 - (sqrt(x) + sqrt(y)));
else
tmp = ((1.0 / (sqrt(x) + sqrt((x + 1.0)))) + (1.0 / (sqrt((1.0 + y)) + sqrt(y)))) + (t_1 - sqrt(z));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(z + 1.0), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y, 4.8e-15], N[(N[(N[(1.0 / N[(N[Sqrt[z], $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(2.0 - N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$1 - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{z + 1}\\
\mathbf{if}\;y \leq 4.8 \cdot 10^{-15}:\\
\;\;\;\;\left(\frac{1}{\sqrt{z} + t\_1} + \left(\sqrt{1 + t} - \sqrt{t}\right)\right) + \left(2 - \left(\sqrt{x} + \sqrt{y}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{1}{\sqrt{x} + \sqrt{x + 1}} + \frac{1}{\sqrt{1 + y} + \sqrt{y}}\right) + \left(t\_1 - \sqrt{z}\right)\\
\end{array}
\end{array}
if y < 4.7999999999999999e-15Initial program 97.5%
associate-+l+97.5%
sub-neg97.5%
sub-neg97.5%
+-commutative97.5%
+-commutative97.5%
+-commutative97.5%
Simplified97.5%
Taylor expanded in x around 0 46.0%
flip--97.5%
div-inv97.5%
add-sqr-sqrt84.3%
add-sqr-sqrt97.5%
associate--l+98.0%
Applied egg-rr46.1%
+-inverses98.0%
metadata-eval98.0%
*-lft-identity98.0%
+-commutative98.0%
Simplified46.1%
Taylor expanded in y around 0 46.0%
if 4.7999999999999999e-15 < y Initial program 87.5%
associate-+l+87.5%
sub-neg87.5%
sub-neg87.5%
+-commutative87.5%
+-commutative87.5%
+-commutative87.5%
Simplified87.5%
flip--87.6%
div-inv87.6%
add-sqr-sqrt52.7%
add-sqr-sqrt87.9%
associate--l+89.7%
Applied egg-rr89.7%
+-inverses89.7%
metadata-eval89.7%
*-lft-identity89.7%
+-commutative89.7%
Simplified89.7%
Taylor expanded in t around inf 42.2%
flip--42.2%
div-inv42.2%
add-sqr-sqrt35.7%
+-commutative35.7%
add-sqr-sqrt43.2%
+-commutative43.2%
Applied egg-rr43.2%
associate--l+46.1%
+-inverses46.1%
metadata-eval46.1%
*-lft-identity46.1%
+-commutative46.1%
Simplified46.1%
Final simplification46.1%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ x 1.0))) (t_2 (sqrt (+ z 1.0))))
(if (<= y 5.4e-15)
(+
(+ (/ 1.0 (+ (sqrt z) t_2)) (- (sqrt (+ 1.0 t)) (sqrt t)))
(- 2.0 (+ (sqrt x) (sqrt y))))
(if (<= y 195000000.0)
(+
(+ (- t_1 (sqrt x)) (/ 1.0 (+ (sqrt (+ 1.0 y)) (sqrt y))))
(* 0.5 (sqrt (/ 1.0 z))))
(+
(- t_2 (sqrt z))
(+ (/ 1.0 (+ (sqrt x) t_1)) (* 0.5 (sqrt (/ 1.0 y)))))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((x + 1.0));
double t_2 = sqrt((z + 1.0));
double tmp;
if (y <= 5.4e-15) {
tmp = ((1.0 / (sqrt(z) + t_2)) + (sqrt((1.0 + t)) - sqrt(t))) + (2.0 - (sqrt(x) + sqrt(y)));
} else if (y <= 195000000.0) {
tmp = ((t_1 - sqrt(x)) + (1.0 / (sqrt((1.0 + y)) + sqrt(y)))) + (0.5 * sqrt((1.0 / z)));
} else {
tmp = (t_2 - sqrt(z)) + ((1.0 / (sqrt(x) + t_1)) + (0.5 * sqrt((1.0 / 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((x + 1.0d0))
t_2 = sqrt((z + 1.0d0))
if (y <= 5.4d-15) then
tmp = ((1.0d0 / (sqrt(z) + t_2)) + (sqrt((1.0d0 + t)) - sqrt(t))) + (2.0d0 - (sqrt(x) + sqrt(y)))
else if (y <= 195000000.0d0) then
tmp = ((t_1 - sqrt(x)) + (1.0d0 / (sqrt((1.0d0 + y)) + sqrt(y)))) + (0.5d0 * sqrt((1.0d0 / z)))
else
tmp = (t_2 - sqrt(z)) + ((1.0d0 / (sqrt(x) + t_1)) + (0.5d0 * sqrt((1.0d0 / 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((x + 1.0));
double t_2 = Math.sqrt((z + 1.0));
double tmp;
if (y <= 5.4e-15) {
tmp = ((1.0 / (Math.sqrt(z) + t_2)) + (Math.sqrt((1.0 + t)) - Math.sqrt(t))) + (2.0 - (Math.sqrt(x) + Math.sqrt(y)));
} else if (y <= 195000000.0) {
tmp = ((t_1 - Math.sqrt(x)) + (1.0 / (Math.sqrt((1.0 + y)) + Math.sqrt(y)))) + (0.5 * Math.sqrt((1.0 / z)));
} else {
tmp = (t_2 - Math.sqrt(z)) + ((1.0 / (Math.sqrt(x) + t_1)) + (0.5 * Math.sqrt((1.0 / y))));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((x + 1.0)) t_2 = math.sqrt((z + 1.0)) tmp = 0 if y <= 5.4e-15: tmp = ((1.0 / (math.sqrt(z) + t_2)) + (math.sqrt((1.0 + t)) - math.sqrt(t))) + (2.0 - (math.sqrt(x) + math.sqrt(y))) elif y <= 195000000.0: tmp = ((t_1 - math.sqrt(x)) + (1.0 / (math.sqrt((1.0 + y)) + math.sqrt(y)))) + (0.5 * math.sqrt((1.0 / z))) else: tmp = (t_2 - math.sqrt(z)) + ((1.0 / (math.sqrt(x) + t_1)) + (0.5 * math.sqrt((1.0 / y)))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(x + 1.0)) t_2 = sqrt(Float64(z + 1.0)) tmp = 0.0 if (y <= 5.4e-15) tmp = Float64(Float64(Float64(1.0 / Float64(sqrt(z) + t_2)) + Float64(sqrt(Float64(1.0 + t)) - sqrt(t))) + Float64(2.0 - Float64(sqrt(x) + sqrt(y)))); elseif (y <= 195000000.0) tmp = Float64(Float64(Float64(t_1 - sqrt(x)) + Float64(1.0 / Float64(sqrt(Float64(1.0 + y)) + sqrt(y)))) + Float64(0.5 * sqrt(Float64(1.0 / z)))); else tmp = Float64(Float64(t_2 - sqrt(z)) + Float64(Float64(1.0 / Float64(sqrt(x) + t_1)) + Float64(0.5 * sqrt(Float64(1.0 / 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((x + 1.0));
t_2 = sqrt((z + 1.0));
tmp = 0.0;
if (y <= 5.4e-15)
tmp = ((1.0 / (sqrt(z) + t_2)) + (sqrt((1.0 + t)) - sqrt(t))) + (2.0 - (sqrt(x) + sqrt(y)));
elseif (y <= 195000000.0)
tmp = ((t_1 - sqrt(x)) + (1.0 / (sqrt((1.0 + y)) + sqrt(y)))) + (0.5 * sqrt((1.0 / z)));
else
tmp = (t_2 - sqrt(z)) + ((1.0 / (sqrt(x) + t_1)) + (0.5 * sqrt((1.0 / 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[(x + 1.0), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(z + 1.0), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y, 5.4e-15], N[(N[(N[(1.0 / N[(N[Sqrt[z], $MachinePrecision] + t$95$2), $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(2.0 - N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 195000000.0], N[(N[(N[(t$95$1 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(0.5 * N[Sqrt[N[(1.0 / z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(t$95$2 - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision] + N[(0.5 * N[Sqrt[N[(1.0 / 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{x + 1}\\
t_2 := \sqrt{z + 1}\\
\mathbf{if}\;y \leq 5.4 \cdot 10^{-15}:\\
\;\;\;\;\left(\frac{1}{\sqrt{z} + t\_2} + \left(\sqrt{1 + t} - \sqrt{t}\right)\right) + \left(2 - \left(\sqrt{x} + \sqrt{y}\right)\right)\\
\mathbf{elif}\;y \leq 195000000:\\
\;\;\;\;\left(\left(t\_1 - \sqrt{x}\right) + \frac{1}{\sqrt{1 + y} + \sqrt{y}}\right) + 0.5 \cdot \sqrt{\frac{1}{z}}\\
\mathbf{else}:\\
\;\;\;\;\left(t\_2 - \sqrt{z}\right) + \left(\frac{1}{\sqrt{x} + t\_1} + 0.5 \cdot \sqrt{\frac{1}{y}}\right)\\
\end{array}
\end{array}
if y < 5.40000000000000018e-15Initial program 97.5%
associate-+l+97.5%
sub-neg97.5%
sub-neg97.5%
+-commutative97.5%
+-commutative97.5%
+-commutative97.5%
Simplified97.5%
Taylor expanded in x around 0 46.0%
flip--97.5%
div-inv97.5%
add-sqr-sqrt84.3%
add-sqr-sqrt97.5%
associate--l+98.0%
Applied egg-rr46.1%
+-inverses98.0%
metadata-eval98.0%
*-lft-identity98.0%
+-commutative98.0%
Simplified46.1%
Taylor expanded in y around 0 46.0%
if 5.40000000000000018e-15 < y < 1.95e8Initial program 90.9%
associate-+l+90.9%
sub-neg90.9%
sub-neg90.9%
+-commutative90.9%
+-commutative90.9%
+-commutative90.9%
Simplified90.9%
flip--91.7%
div-inv91.7%
add-sqr-sqrt90.2%
add-sqr-sqrt92.6%
associate--l+92.8%
Applied egg-rr92.8%
+-inverses92.8%
metadata-eval92.8%
*-lft-identity92.8%
+-commutative92.8%
Simplified92.8%
Taylor expanded in t around inf 51.3%
Taylor expanded in z around inf 31.5%
if 1.95e8 < y Initial program 87.1%
associate-+l+87.1%
sub-neg87.1%
sub-neg87.1%
+-commutative87.1%
+-commutative87.1%
+-commutative87.1%
Simplified87.1%
flip--87.1%
div-inv87.1%
add-sqr-sqrt48.6%
add-sqr-sqrt87.4%
associate--l+89.3%
Applied egg-rr89.3%
+-inverses89.3%
metadata-eval89.3%
*-lft-identity89.3%
+-commutative89.3%
Simplified89.3%
Taylor expanded in t around inf 41.2%
flip--41.2%
div-inv41.2%
add-sqr-sqrt35.3%
+-commutative35.3%
add-sqr-sqrt42.3%
+-commutative42.3%
Applied egg-rr42.3%
associate--l+45.6%
+-inverses45.6%
metadata-eval45.6%
*-lft-identity45.6%
+-commutative45.6%
Simplified45.6%
Taylor expanded in y around inf 45.6%
Final simplification45.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 (+ z 1.0))))
(if (<= y 118000000.0)
(+
(/ 1.0 (+ (sqrt z) t_1))
(+ (- (sqrt (+ 1.0 y)) (sqrt y)) (- 1.0 (sqrt x))))
(+
(- t_1 (sqrt z))
(+ (/ 1.0 (+ (sqrt x) (sqrt (+ x 1.0)))) (* 0.5 (sqrt (/ 1.0 y))))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((z + 1.0));
double tmp;
if (y <= 118000000.0) {
tmp = (1.0 / (sqrt(z) + t_1)) + ((sqrt((1.0 + y)) - sqrt(y)) + (1.0 - sqrt(x)));
} else {
tmp = (t_1 - sqrt(z)) + ((1.0 / (sqrt(x) + sqrt((x + 1.0)))) + (0.5 * sqrt((1.0 / 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((z + 1.0d0))
if (y <= 118000000.0d0) then
tmp = (1.0d0 / (sqrt(z) + t_1)) + ((sqrt((1.0d0 + y)) - sqrt(y)) + (1.0d0 - sqrt(x)))
else
tmp = (t_1 - sqrt(z)) + ((1.0d0 / (sqrt(x) + sqrt((x + 1.0d0)))) + (0.5d0 * sqrt((1.0d0 / 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((z + 1.0));
double tmp;
if (y <= 118000000.0) {
tmp = (1.0 / (Math.sqrt(z) + t_1)) + ((Math.sqrt((1.0 + y)) - Math.sqrt(y)) + (1.0 - Math.sqrt(x)));
} else {
tmp = (t_1 - Math.sqrt(z)) + ((1.0 / (Math.sqrt(x) + Math.sqrt((x + 1.0)))) + (0.5 * Math.sqrt((1.0 / y))));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((z + 1.0)) tmp = 0 if y <= 118000000.0: tmp = (1.0 / (math.sqrt(z) + t_1)) + ((math.sqrt((1.0 + y)) - math.sqrt(y)) + (1.0 - math.sqrt(x))) else: tmp = (t_1 - math.sqrt(z)) + ((1.0 / (math.sqrt(x) + math.sqrt((x + 1.0)))) + (0.5 * math.sqrt((1.0 / y)))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(z + 1.0)) tmp = 0.0 if (y <= 118000000.0) tmp = Float64(Float64(1.0 / Float64(sqrt(z) + t_1)) + Float64(Float64(sqrt(Float64(1.0 + y)) - sqrt(y)) + Float64(1.0 - sqrt(x)))); else tmp = Float64(Float64(t_1 - sqrt(z)) + Float64(Float64(1.0 / Float64(sqrt(x) + sqrt(Float64(x + 1.0)))) + Float64(0.5 * sqrt(Float64(1.0 / 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((z + 1.0));
tmp = 0.0;
if (y <= 118000000.0)
tmp = (1.0 / (sqrt(z) + t_1)) + ((sqrt((1.0 + y)) - sqrt(y)) + (1.0 - sqrt(x)));
else
tmp = (t_1 - sqrt(z)) + ((1.0 / (sqrt(x) + sqrt((x + 1.0)))) + (0.5 * sqrt((1.0 / 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[(z + 1.0), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y, 118000000.0], N[(N[(1.0 / N[(N[Sqrt[z], $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision] + N[(N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision] + N[(1.0 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(t$95$1 - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(0.5 * N[Sqrt[N[(1.0 / 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{z + 1}\\
\mathbf{if}\;y \leq 118000000:\\
\;\;\;\;\frac{1}{\sqrt{z} + t\_1} + \left(\left(\sqrt{1 + y} - \sqrt{y}\right) + \left(1 - \sqrt{x}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(t\_1 - \sqrt{z}\right) + \left(\frac{1}{\sqrt{x} + \sqrt{x + 1}} + 0.5 \cdot \sqrt{\frac{1}{y}}\right)\\
\end{array}
\end{array}
if y < 1.18e8Initial program 96.9%
associate-+l+96.9%
sub-neg96.9%
sub-neg96.9%
+-commutative96.9%
+-commutative96.9%
+-commutative96.9%
Simplified96.9%
Taylor expanded in x around 0 46.6%
flip--96.9%
div-inv96.9%
add-sqr-sqrt84.6%
add-sqr-sqrt97.4%
associate--l+97.8%
Applied egg-rr46.9%
+-inverses97.8%
metadata-eval97.8%
*-lft-identity97.8%
+-commutative97.8%
Simplified46.9%
Taylor expanded in t around inf 26.9%
if 1.18e8 < y Initial program 87.1%
associate-+l+87.1%
sub-neg87.1%
sub-neg87.1%
+-commutative87.1%
+-commutative87.1%
+-commutative87.1%
Simplified87.1%
flip--87.2%
div-inv87.2%
add-sqr-sqrt48.8%
add-sqr-sqrt87.5%
associate--l+89.4%
Applied egg-rr89.4%
+-inverses89.4%
metadata-eval89.4%
*-lft-identity89.4%
+-commutative89.4%
Simplified89.4%
Taylor expanded in t around inf 41.0%
flip--41.0%
div-inv41.0%
add-sqr-sqrt35.1%
+-commutative35.1%
add-sqr-sqrt42.0%
+-commutative42.0%
Applied egg-rr42.0%
associate--l+45.3%
+-inverses45.3%
metadata-eval45.3%
*-lft-identity45.3%
+-commutative45.3%
Simplified45.3%
Taylor expanded in y around inf 45.3%
Final simplification36.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 (+ z 1.0)) (sqrt z))))
(if (<= x 1.02e-13)
(+ t_1 (+ (- (sqrt (+ 1.0 y)) (sqrt y)) (- 1.0 (sqrt x))))
(+ (/ 1.0 (+ (sqrt x) (sqrt (+ x 1.0)))) t_1))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((z + 1.0)) - sqrt(z);
double tmp;
if (x <= 1.02e-13) {
tmp = t_1 + ((sqrt((1.0 + y)) - sqrt(y)) + (1.0 - sqrt(x)));
} else {
tmp = (1.0 / (sqrt(x) + sqrt((x + 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) :: tmp
t_1 = sqrt((z + 1.0d0)) - sqrt(z)
if (x <= 1.02d-13) then
tmp = t_1 + ((sqrt((1.0d0 + y)) - sqrt(y)) + (1.0d0 - sqrt(x)))
else
tmp = (1.0d0 / (sqrt(x) + sqrt((x + 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 = Math.sqrt((z + 1.0)) - Math.sqrt(z);
double tmp;
if (x <= 1.02e-13) {
tmp = t_1 + ((Math.sqrt((1.0 + y)) - Math.sqrt(y)) + (1.0 - Math.sqrt(x)));
} else {
tmp = (1.0 / (Math.sqrt(x) + Math.sqrt((x + 1.0)))) + t_1;
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((z + 1.0)) - math.sqrt(z) tmp = 0 if x <= 1.02e-13: tmp = t_1 + ((math.sqrt((1.0 + y)) - math.sqrt(y)) + (1.0 - math.sqrt(x))) else: tmp = (1.0 / (math.sqrt(x) + math.sqrt((x + 1.0)))) + t_1 return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = Float64(sqrt(Float64(z + 1.0)) - sqrt(z)) tmp = 0.0 if (x <= 1.02e-13) tmp = Float64(t_1 + Float64(Float64(sqrt(Float64(1.0 + y)) - sqrt(y)) + Float64(1.0 - sqrt(x)))); else tmp = Float64(Float64(1.0 / Float64(sqrt(x) + sqrt(Float64(x + 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 = sqrt((z + 1.0)) - sqrt(z);
tmp = 0.0;
if (x <= 1.02e-13)
tmp = t_1 + ((sqrt((1.0 + y)) - sqrt(y)) + (1.0 - sqrt(x)));
else
tmp = (1.0 / (sqrt(x) + sqrt((x + 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[(N[Sqrt[N[(z + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, 1.02e-13], N[(t$95$1 + N[(N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision] + N[(1.0 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{z + 1} - \sqrt{z}\\
\mathbf{if}\;x \leq 1.02 \cdot 10^{-13}:\\
\;\;\;\;t\_1 + \left(\left(\sqrt{1 + y} - \sqrt{y}\right) + \left(1 - \sqrt{x}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{x} + \sqrt{x + 1}} + t\_1\\
\end{array}
\end{array}
if x < 1.0199999999999999e-13Initial program 97.9%
associate-+l+97.9%
sub-neg97.9%
sub-neg97.9%
+-commutative97.9%
+-commutative97.9%
+-commutative97.9%
Simplified97.9%
Taylor expanded in x around 0 97.9%
Taylor expanded in t around inf 52.3%
if 1.0199999999999999e-13 < x Initial program 86.7%
associate-+l+86.7%
sub-neg86.7%
sub-neg86.7%
+-commutative86.7%
+-commutative86.7%
+-commutative86.7%
Simplified86.7%
flip--86.8%
div-inv86.8%
add-sqr-sqrt69.9%
add-sqr-sqrt86.9%
associate--l+88.2%
Applied egg-rr88.2%
+-inverses88.2%
metadata-eval88.2%
*-lft-identity88.2%
+-commutative88.2%
Simplified88.2%
Taylor expanded in t around inf 42.2%
flip--42.3%
div-inv42.3%
add-sqr-sqrt27.4%
+-commutative27.4%
add-sqr-sqrt43.5%
+-commutative43.5%
Applied egg-rr43.5%
associate--l+47.0%
+-inverses47.0%
metadata-eval47.0%
*-lft-identity47.0%
+-commutative47.0%
Simplified47.0%
Taylor expanded in y around inf 25.5%
Final simplification38.3%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (sqrt (+ z 1.0)) (sqrt z))))
(if (<= y 1.05e-18)
(+ t_1 (- 2.0 (+ (sqrt x) (sqrt y))))
(if (<= y 1.02e+38)
(+
(* 0.5 (sqrt (/ 1.0 z)))
(+
(/ 1.0 (+ (sqrt (+ 1.0 y)) (sqrt y)))
(+ 1.0 (- (* x 0.5) (sqrt x)))))
(+ (/ 1.0 (+ (sqrt x) (sqrt (+ x 1.0)))) t_1)))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((z + 1.0)) - sqrt(z);
double tmp;
if (y <= 1.05e-18) {
tmp = t_1 + (2.0 - (sqrt(x) + sqrt(y)));
} else if (y <= 1.02e+38) {
tmp = (0.5 * sqrt((1.0 / z))) + ((1.0 / (sqrt((1.0 + y)) + sqrt(y))) + (1.0 + ((x * 0.5) - sqrt(x))));
} else {
tmp = (1.0 / (sqrt(x) + sqrt((x + 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) :: tmp
t_1 = sqrt((z + 1.0d0)) - sqrt(z)
if (y <= 1.05d-18) then
tmp = t_1 + (2.0d0 - (sqrt(x) + sqrt(y)))
else if (y <= 1.02d+38) then
tmp = (0.5d0 * sqrt((1.0d0 / z))) + ((1.0d0 / (sqrt((1.0d0 + y)) + sqrt(y))) + (1.0d0 + ((x * 0.5d0) - sqrt(x))))
else
tmp = (1.0d0 / (sqrt(x) + sqrt((x + 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 = Math.sqrt((z + 1.0)) - Math.sqrt(z);
double tmp;
if (y <= 1.05e-18) {
tmp = t_1 + (2.0 - (Math.sqrt(x) + Math.sqrt(y)));
} else if (y <= 1.02e+38) {
tmp = (0.5 * Math.sqrt((1.0 / z))) + ((1.0 / (Math.sqrt((1.0 + y)) + Math.sqrt(y))) + (1.0 + ((x * 0.5) - Math.sqrt(x))));
} else {
tmp = (1.0 / (Math.sqrt(x) + Math.sqrt((x + 1.0)))) + t_1;
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((z + 1.0)) - math.sqrt(z) tmp = 0 if y <= 1.05e-18: tmp = t_1 + (2.0 - (math.sqrt(x) + math.sqrt(y))) elif y <= 1.02e+38: tmp = (0.5 * math.sqrt((1.0 / z))) + ((1.0 / (math.sqrt((1.0 + y)) + math.sqrt(y))) + (1.0 + ((x * 0.5) - math.sqrt(x)))) else: tmp = (1.0 / (math.sqrt(x) + math.sqrt((x + 1.0)))) + t_1 return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = Float64(sqrt(Float64(z + 1.0)) - sqrt(z)) tmp = 0.0 if (y <= 1.05e-18) tmp = Float64(t_1 + Float64(2.0 - Float64(sqrt(x) + sqrt(y)))); elseif (y <= 1.02e+38) tmp = Float64(Float64(0.5 * sqrt(Float64(1.0 / z))) + Float64(Float64(1.0 / Float64(sqrt(Float64(1.0 + y)) + sqrt(y))) + Float64(1.0 + Float64(Float64(x * 0.5) - sqrt(x))))); else tmp = Float64(Float64(1.0 / Float64(sqrt(x) + sqrt(Float64(x + 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 = sqrt((z + 1.0)) - sqrt(z);
tmp = 0.0;
if (y <= 1.05e-18)
tmp = t_1 + (2.0 - (sqrt(x) + sqrt(y)));
elseif (y <= 1.02e+38)
tmp = (0.5 * sqrt((1.0 / z))) + ((1.0 / (sqrt((1.0 + y)) + sqrt(y))) + (1.0 + ((x * 0.5) - sqrt(x))));
else
tmp = (1.0 / (sqrt(x) + sqrt((x + 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[(N[Sqrt[N[(z + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 1.05e-18], N[(t$95$1 + N[(2.0 - N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.02e+38], N[(N[(0.5 * N[Sqrt[N[(1.0 / z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 / N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 + N[(N[(x * 0.5), $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{z + 1} - \sqrt{z}\\
\mathbf{if}\;y \leq 1.05 \cdot 10^{-18}:\\
\;\;\;\;t\_1 + \left(2 - \left(\sqrt{x} + \sqrt{y}\right)\right)\\
\mathbf{elif}\;y \leq 1.02 \cdot 10^{+38}:\\
\;\;\;\;0.5 \cdot \sqrt{\frac{1}{z}} + \left(\frac{1}{\sqrt{1 + y} + \sqrt{y}} + \left(1 + \left(x \cdot 0.5 - \sqrt{x}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{x} + \sqrt{x + 1}} + t\_1\\
\end{array}
\end{array}
if y < 1.05e-18Initial program 97.4%
associate-+l+97.4%
sub-neg97.4%
sub-neg97.4%
+-commutative97.4%
+-commutative97.4%
+-commutative97.4%
Simplified97.4%
Taylor expanded in x around 0 45.9%
Taylor expanded in t around inf 25.4%
Taylor expanded in y around 0 25.4%
if 1.05e-18 < y < 1.02000000000000006e38Initial program 87.5%
associate-+l+87.5%
sub-neg87.5%
sub-neg87.5%
+-commutative87.5%
+-commutative87.5%
+-commutative87.5%
Simplified87.5%
flip--87.9%
div-inv87.9%
add-sqr-sqrt78.4%
add-sqr-sqrt89.8%
associate--l+96.0%
Applied egg-rr96.0%
+-inverses96.0%
metadata-eval96.0%
*-lft-identity96.0%
+-commutative96.0%
Simplified96.0%
Taylor expanded in t around inf 47.3%
Taylor expanded in x around 0 28.7%
associate--l+28.7%
Simplified28.7%
Taylor expanded in z around inf 18.2%
if 1.02000000000000006e38 < y Initial program 87.7%
associate-+l+87.7%
sub-neg87.7%
sub-neg87.7%
+-commutative87.7%
+-commutative87.7%
+-commutative87.7%
Simplified87.7%
flip--87.7%
div-inv87.7%
add-sqr-sqrt47.5%
add-sqr-sqrt87.7%
associate--l+88.3%
Applied egg-rr88.3%
+-inverses88.3%
metadata-eval88.3%
*-lft-identity88.3%
+-commutative88.3%
Simplified88.3%
Taylor expanded in t around inf 41.3%
flip--41.3%
div-inv41.3%
add-sqr-sqrt35.8%
+-commutative35.8%
add-sqr-sqrt42.5%
+-commutative42.5%
Applied egg-rr42.5%
associate--l+46.1%
+-inverses46.1%
metadata-eval46.1%
*-lft-identity46.1%
+-commutative46.1%
Simplified46.1%
Taylor expanded in y around inf 45.6%
Final simplification33.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 (+ z 1.0)) (sqrt z))))
(if (<= y 1.05e-18)
(+ t_1 (- 2.0 (+ (sqrt x) (sqrt y))))
(if (<= y 1.02e+38)
(+
(+ (- (sqrt (+ 1.0 y)) (sqrt y)) (- 1.0 (sqrt x)))
(* 0.5 (sqrt (/ 1.0 z))))
(+ (/ 1.0 (+ (sqrt x) (sqrt (+ x 1.0)))) t_1)))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((z + 1.0)) - sqrt(z);
double tmp;
if (y <= 1.05e-18) {
tmp = t_1 + (2.0 - (sqrt(x) + sqrt(y)));
} else if (y <= 1.02e+38) {
tmp = ((sqrt((1.0 + y)) - sqrt(y)) + (1.0 - sqrt(x))) + (0.5 * sqrt((1.0 / z)));
} else {
tmp = (1.0 / (sqrt(x) + sqrt((x + 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) :: tmp
t_1 = sqrt((z + 1.0d0)) - sqrt(z)
if (y <= 1.05d-18) then
tmp = t_1 + (2.0d0 - (sqrt(x) + sqrt(y)))
else if (y <= 1.02d+38) then
tmp = ((sqrt((1.0d0 + y)) - sqrt(y)) + (1.0d0 - sqrt(x))) + (0.5d0 * sqrt((1.0d0 / z)))
else
tmp = (1.0d0 / (sqrt(x) + sqrt((x + 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 = Math.sqrt((z + 1.0)) - Math.sqrt(z);
double tmp;
if (y <= 1.05e-18) {
tmp = t_1 + (2.0 - (Math.sqrt(x) + Math.sqrt(y)));
} else if (y <= 1.02e+38) {
tmp = ((Math.sqrt((1.0 + y)) - Math.sqrt(y)) + (1.0 - Math.sqrt(x))) + (0.5 * Math.sqrt((1.0 / z)));
} else {
tmp = (1.0 / (Math.sqrt(x) + Math.sqrt((x + 1.0)))) + t_1;
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((z + 1.0)) - math.sqrt(z) tmp = 0 if y <= 1.05e-18: tmp = t_1 + (2.0 - (math.sqrt(x) + math.sqrt(y))) elif y <= 1.02e+38: tmp = ((math.sqrt((1.0 + y)) - math.sqrt(y)) + (1.0 - math.sqrt(x))) + (0.5 * math.sqrt((1.0 / z))) else: tmp = (1.0 / (math.sqrt(x) + math.sqrt((x + 1.0)))) + t_1 return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = Float64(sqrt(Float64(z + 1.0)) - sqrt(z)) tmp = 0.0 if (y <= 1.05e-18) tmp = Float64(t_1 + Float64(2.0 - Float64(sqrt(x) + sqrt(y)))); elseif (y <= 1.02e+38) tmp = Float64(Float64(Float64(sqrt(Float64(1.0 + y)) - sqrt(y)) + Float64(1.0 - sqrt(x))) + Float64(0.5 * sqrt(Float64(1.0 / z)))); else tmp = Float64(Float64(1.0 / Float64(sqrt(x) + sqrt(Float64(x + 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 = sqrt((z + 1.0)) - sqrt(z);
tmp = 0.0;
if (y <= 1.05e-18)
tmp = t_1 + (2.0 - (sqrt(x) + sqrt(y)));
elseif (y <= 1.02e+38)
tmp = ((sqrt((1.0 + y)) - sqrt(y)) + (1.0 - sqrt(x))) + (0.5 * sqrt((1.0 / z)));
else
tmp = (1.0 / (sqrt(x) + sqrt((x + 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[(N[Sqrt[N[(z + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 1.05e-18], N[(t$95$1 + N[(2.0 - N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.02e+38], N[(N[(N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision] + N[(1.0 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(0.5 * N[Sqrt[N[(1.0 / z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{z + 1} - \sqrt{z}\\
\mathbf{if}\;y \leq 1.05 \cdot 10^{-18}:\\
\;\;\;\;t\_1 + \left(2 - \left(\sqrt{x} + \sqrt{y}\right)\right)\\
\mathbf{elif}\;y \leq 1.02 \cdot 10^{+38}:\\
\;\;\;\;\left(\left(\sqrt{1 + y} - \sqrt{y}\right) + \left(1 - \sqrt{x}\right)\right) + 0.5 \cdot \sqrt{\frac{1}{z}}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{x} + \sqrt{x + 1}} + t\_1\\
\end{array}
\end{array}
if y < 1.05e-18Initial program 97.4%
associate-+l+97.4%
sub-neg97.4%
sub-neg97.4%
+-commutative97.4%
+-commutative97.4%
+-commutative97.4%
Simplified97.4%
Taylor expanded in x around 0 45.9%
Taylor expanded in t around inf 25.4%
Taylor expanded in y around 0 25.4%
if 1.05e-18 < y < 1.02000000000000006e38Initial program 87.5%
associate-+l+87.5%
sub-neg87.5%
sub-neg87.5%
+-commutative87.5%
+-commutative87.5%
+-commutative87.5%
Simplified87.5%
Taylor expanded in x around 0 43.4%
Taylor expanded in t around inf 26.6%
Taylor expanded in z around inf 17.2%
if 1.02000000000000006e38 < y Initial program 87.7%
associate-+l+87.7%
sub-neg87.7%
sub-neg87.7%
+-commutative87.7%
+-commutative87.7%
+-commutative87.7%
Simplified87.7%
flip--87.7%
div-inv87.7%
add-sqr-sqrt47.5%
add-sqr-sqrt87.7%
associate--l+88.3%
Applied egg-rr88.3%
+-inverses88.3%
metadata-eval88.3%
*-lft-identity88.3%
+-commutative88.3%
Simplified88.3%
Taylor expanded in t around inf 41.3%
flip--41.3%
div-inv41.3%
add-sqr-sqrt35.8%
+-commutative35.8%
add-sqr-sqrt42.5%
+-commutative42.5%
Applied egg-rr42.5%
associate--l+46.1%
+-inverses46.1%
metadata-eval46.1%
*-lft-identity46.1%
+-commutative46.1%
Simplified46.1%
Taylor expanded in y around inf 45.6%
Final simplification33.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 (+ z 1.0)) (sqrt z))))
(if (<= y 2.2)
(+ t_1 (+ 2.0 (- (* y 0.5) (+ (sqrt x) (sqrt y)))))
(+ (/ 1.0 (+ (sqrt x) (sqrt (+ x 1.0)))) t_1))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((z + 1.0)) - sqrt(z);
double tmp;
if (y <= 2.2) {
tmp = t_1 + (2.0 + ((y * 0.5) - (sqrt(x) + sqrt(y))));
} else {
tmp = (1.0 / (sqrt(x) + sqrt((x + 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) :: tmp
t_1 = sqrt((z + 1.0d0)) - sqrt(z)
if (y <= 2.2d0) then
tmp = t_1 + (2.0d0 + ((y * 0.5d0) - (sqrt(x) + sqrt(y))))
else
tmp = (1.0d0 / (sqrt(x) + sqrt((x + 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 = Math.sqrt((z + 1.0)) - Math.sqrt(z);
double tmp;
if (y <= 2.2) {
tmp = t_1 + (2.0 + ((y * 0.5) - (Math.sqrt(x) + Math.sqrt(y))));
} else {
tmp = (1.0 / (Math.sqrt(x) + Math.sqrt((x + 1.0)))) + t_1;
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((z + 1.0)) - math.sqrt(z) tmp = 0 if y <= 2.2: tmp = t_1 + (2.0 + ((y * 0.5) - (math.sqrt(x) + math.sqrt(y)))) else: tmp = (1.0 / (math.sqrt(x) + math.sqrt((x + 1.0)))) + t_1 return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = Float64(sqrt(Float64(z + 1.0)) - sqrt(z)) tmp = 0.0 if (y <= 2.2) tmp = Float64(t_1 + Float64(2.0 + Float64(Float64(y * 0.5) - Float64(sqrt(x) + sqrt(y))))); else tmp = Float64(Float64(1.0 / Float64(sqrt(x) + sqrt(Float64(x + 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 = sqrt((z + 1.0)) - sqrt(z);
tmp = 0.0;
if (y <= 2.2)
tmp = t_1 + (2.0 + ((y * 0.5) - (sqrt(x) + sqrt(y))));
else
tmp = (1.0 / (sqrt(x) + sqrt((x + 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[(N[Sqrt[N[(z + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 2.2], N[(t$95$1 + N[(2.0 + N[(N[(y * 0.5), $MachinePrecision] - N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{z + 1} - \sqrt{z}\\
\mathbf{if}\;y \leq 2.2:\\
\;\;\;\;t\_1 + \left(2 + \left(y \cdot 0.5 - \left(\sqrt{x} + \sqrt{y}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{x} + \sqrt{x + 1}} + t\_1\\
\end{array}
\end{array}
if y < 2.2000000000000002Initial program 96.9%
associate-+l+96.9%
sub-neg96.9%
sub-neg96.9%
+-commutative96.9%
+-commutative96.9%
+-commutative96.9%
Simplified96.9%
Taylor expanded in x around 0 46.1%
Taylor expanded in t around inf 25.7%
expm1-log1p-u24.7%
expm1-undefine24.7%
+-commutative24.7%
Applied egg-rr24.7%
sub-neg24.7%
log1p-undefine24.8%
rem-exp-log25.7%
+-commutative25.7%
associate--r-25.7%
associate-+r-25.7%
metadata-eval25.7%
associate--r-25.7%
metadata-eval25.7%
Simplified25.7%
Taylor expanded in y around 0 24.9%
associate--l+24.9%
*-commutative24.9%
Simplified24.9%
if 2.2000000000000002 < y Initial program 87.3%
associate-+l+87.3%
sub-neg87.3%
sub-neg87.3%
+-commutative87.3%
+-commutative87.3%
+-commutative87.3%
Simplified87.3%
flip--87.4%
div-inv87.4%
add-sqr-sqrt49.9%
add-sqr-sqrt87.8%
associate--l+89.6%
Applied egg-rr89.6%
+-inverses89.6%
metadata-eval89.6%
*-lft-identity89.6%
+-commutative89.6%
Simplified89.6%
Taylor expanded in t around inf 42.3%
flip--42.3%
div-inv42.3%
add-sqr-sqrt35.8%
+-commutative35.8%
add-sqr-sqrt43.3%
+-commutative43.3%
Applied egg-rr43.3%
associate--l+46.6%
+-inverses46.6%
metadata-eval46.6%
*-lft-identity46.6%
+-commutative46.6%
Simplified46.6%
Taylor expanded in y around inf 44.2%
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 (+ z 1.0)) (sqrt z))))
(if (<= y 0.9)
(+ t_1 (- 2.0 (+ (sqrt x) (sqrt y))))
(+ (/ 1.0 (+ (sqrt x) (sqrt (+ x 1.0)))) t_1))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((z + 1.0)) - sqrt(z);
double tmp;
if (y <= 0.9) {
tmp = t_1 + (2.0 - (sqrt(x) + sqrt(y)));
} else {
tmp = (1.0 / (sqrt(x) + sqrt((x + 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) :: tmp
t_1 = sqrt((z + 1.0d0)) - sqrt(z)
if (y <= 0.9d0) then
tmp = t_1 + (2.0d0 - (sqrt(x) + sqrt(y)))
else
tmp = (1.0d0 / (sqrt(x) + sqrt((x + 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 = Math.sqrt((z + 1.0)) - Math.sqrt(z);
double tmp;
if (y <= 0.9) {
tmp = t_1 + (2.0 - (Math.sqrt(x) + Math.sqrt(y)));
} else {
tmp = (1.0 / (Math.sqrt(x) + Math.sqrt((x + 1.0)))) + t_1;
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((z + 1.0)) - math.sqrt(z) tmp = 0 if y <= 0.9: tmp = t_1 + (2.0 - (math.sqrt(x) + math.sqrt(y))) else: tmp = (1.0 / (math.sqrt(x) + math.sqrt((x + 1.0)))) + t_1 return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = Float64(sqrt(Float64(z + 1.0)) - sqrt(z)) tmp = 0.0 if (y <= 0.9) tmp = Float64(t_1 + Float64(2.0 - Float64(sqrt(x) + sqrt(y)))); else tmp = Float64(Float64(1.0 / Float64(sqrt(x) + sqrt(Float64(x + 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 = sqrt((z + 1.0)) - sqrt(z);
tmp = 0.0;
if (y <= 0.9)
tmp = t_1 + (2.0 - (sqrt(x) + sqrt(y)));
else
tmp = (1.0 / (sqrt(x) + sqrt((x + 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[(N[Sqrt[N[(z + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 0.9], N[(t$95$1 + N[(2.0 - N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{z + 1} - \sqrt{z}\\
\mathbf{if}\;y \leq 0.9:\\
\;\;\;\;t\_1 + \left(2 - \left(\sqrt{x} + \sqrt{y}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{x} + \sqrt{x + 1}} + t\_1\\
\end{array}
\end{array}
if y < 0.900000000000000022Initial program 96.9%
associate-+l+96.9%
sub-neg96.9%
sub-neg96.9%
+-commutative96.9%
+-commutative96.9%
+-commutative96.9%
Simplified96.9%
Taylor expanded in x around 0 46.1%
Taylor expanded in t around inf 25.7%
Taylor expanded in y around 0 24.4%
if 0.900000000000000022 < y Initial program 87.3%
associate-+l+87.3%
sub-neg87.3%
sub-neg87.3%
+-commutative87.3%
+-commutative87.3%
+-commutative87.3%
Simplified87.3%
flip--87.4%
div-inv87.4%
add-sqr-sqrt49.9%
add-sqr-sqrt87.8%
associate--l+89.6%
Applied egg-rr89.6%
+-inverses89.6%
metadata-eval89.6%
*-lft-identity89.6%
+-commutative89.6%
Simplified89.6%
Taylor expanded in t around inf 42.3%
flip--42.3%
div-inv42.3%
add-sqr-sqrt35.8%
+-commutative35.8%
add-sqr-sqrt43.3%
+-commutative43.3%
Applied egg-rr43.3%
associate--l+46.6%
+-inverses46.6%
metadata-eval46.6%
*-lft-identity46.6%
+-commutative46.6%
Simplified46.6%
Taylor expanded in y around inf 44.2%
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 0.45) (+ (- (sqrt (+ z 1.0)) (sqrt z)) (- 2.0 (+ (sqrt x) (sqrt y)))) (+ (* 0.5 (sqrt (/ 1.0 z))) (- (+ 1.0 (* 0.5 (sqrt (/ 1.0 y)))) (sqrt x)))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 0.45) {
tmp = (sqrt((z + 1.0)) - sqrt(z)) + (2.0 - (sqrt(x) + sqrt(y)));
} else {
tmp = (0.5 * sqrt((1.0 / z))) + ((1.0 + (0.5 * sqrt((1.0 / y)))) - sqrt(x));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= 0.45d0) then
tmp = (sqrt((z + 1.0d0)) - sqrt(z)) + (2.0d0 - (sqrt(x) + sqrt(y)))
else
tmp = (0.5d0 * sqrt((1.0d0 / z))) + ((1.0d0 + (0.5d0 * sqrt((1.0d0 / y)))) - sqrt(x))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= 0.45) {
tmp = (Math.sqrt((z + 1.0)) - Math.sqrt(z)) + (2.0 - (Math.sqrt(x) + Math.sqrt(y)));
} else {
tmp = (0.5 * Math.sqrt((1.0 / z))) + ((1.0 + (0.5 * Math.sqrt((1.0 / y)))) - Math.sqrt(x));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if y <= 0.45: tmp = (math.sqrt((z + 1.0)) - math.sqrt(z)) + (2.0 - (math.sqrt(x) + math.sqrt(y))) else: tmp = (0.5 * math.sqrt((1.0 / z))) + ((1.0 + (0.5 * math.sqrt((1.0 / y)))) - math.sqrt(x)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (y <= 0.45) tmp = Float64(Float64(sqrt(Float64(z + 1.0)) - sqrt(z)) + Float64(2.0 - Float64(sqrt(x) + sqrt(y)))); else tmp = Float64(Float64(0.5 * sqrt(Float64(1.0 / z))) + Float64(Float64(1.0 + Float64(0.5 * sqrt(Float64(1.0 / y)))) - sqrt(x))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (y <= 0.45)
tmp = (sqrt((z + 1.0)) - sqrt(z)) + (2.0 - (sqrt(x) + sqrt(y)));
else
tmp = (0.5 * sqrt((1.0 / z))) + ((1.0 + (0.5 * sqrt((1.0 / y)))) - sqrt(x));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[y, 0.45], N[(N[(N[Sqrt[N[(z + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] + N[(2.0 - N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(0.5 * N[Sqrt[N[(1.0 / z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 + N[(0.5 * N[Sqrt[N[(1.0 / y), $MachinePrecision]], $MachinePrecision]), $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 0.45:\\
\;\;\;\;\left(\sqrt{z + 1} - \sqrt{z}\right) + \left(2 - \left(\sqrt{x} + \sqrt{y}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \sqrt{\frac{1}{z}} + \left(\left(1 + 0.5 \cdot \sqrt{\frac{1}{y}}\right) - \sqrt{x}\right)\\
\end{array}
\end{array}
if y < 0.450000000000000011Initial program 96.9%
associate-+l+96.9%
sub-neg96.9%
sub-neg96.9%
+-commutative96.9%
+-commutative96.9%
+-commutative96.9%
Simplified96.9%
Taylor expanded in x around 0 46.1%
Taylor expanded in t around inf 25.7%
Taylor expanded in y around 0 24.4%
if 0.450000000000000011 < y Initial program 87.3%
associate-+l+87.3%
sub-neg87.3%
sub-neg87.3%
+-commutative87.3%
+-commutative87.3%
+-commutative87.3%
Simplified87.3%
Taylor expanded in x around 0 49.9%
Taylor expanded in t around inf 26.7%
Taylor expanded in y around inf 25.8%
Taylor expanded in z around inf 12.2%
Final simplification18.2%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (+ (- (sqrt (+ z 1.0)) (sqrt z)) (+ 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 (sqrt((z + 1.0)) - sqrt(z)) + (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 = (sqrt((z + 1.0d0)) - sqrt(z)) + (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 (Math.sqrt((z + 1.0)) - Math.sqrt(z)) + (1.0 + ((x * 0.5) - Math.sqrt(x)));
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): return (math.sqrt((z + 1.0)) - math.sqrt(z)) + (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(sqrt(Float64(z + 1.0)) - sqrt(z)) + Float64(1.0 + Float64(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 = (sqrt((z + 1.0)) - sqrt(z)) + (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[(N[Sqrt[N[(z + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] + N[(1.0 + N[(N[(x * 0.5), $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\left(\sqrt{z + 1} - \sqrt{z}\right) + \left(1 + \left(x \cdot 0.5 - \sqrt{x}\right)\right)
\end{array}
Initial program 92.0%
associate-+l+92.0%
sub-neg92.0%
sub-neg92.0%
+-commutative92.0%
+-commutative92.0%
+-commutative92.0%
Simplified92.0%
flip--92.1%
div-inv92.1%
add-sqr-sqrt73.0%
add-sqr-sqrt92.3%
associate--l+93.2%
Applied egg-rr93.2%
+-inverses93.2%
metadata-eval93.2%
*-lft-identity93.2%
+-commutative93.2%
Simplified93.2%
Taylor expanded in t around inf 47.0%
Taylor expanded in x around 0 28.3%
associate--l+28.3%
Simplified28.3%
Taylor expanded in y around inf 19.6%
*-commutative19.6%
associate-+r-19.6%
Simplified19.6%
Final simplification19.6%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (+ (- (sqrt (+ z 1.0)) (sqrt z)) (- 1.0 (sqrt x))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
return (sqrt((z + 1.0)) - sqrt(z)) + (1.0 - 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((z + 1.0d0)) - sqrt(z)) + (1.0d0 - 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((z + 1.0)) - Math.sqrt(z)) + (1.0 - Math.sqrt(x));
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): return (math.sqrt((z + 1.0)) - math.sqrt(z)) + (1.0 - math.sqrt(x))
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) return Float64(Float64(sqrt(Float64(z + 1.0)) - sqrt(z)) + Float64(1.0 - sqrt(x))) end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp = code(x, y, z, t)
tmp = (sqrt((z + 1.0)) - sqrt(z)) + (1.0 - 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[(N[Sqrt[N[(z + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] + N[(1.0 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\left(\sqrt{z + 1} - \sqrt{z}\right) + \left(1 - \sqrt{x}\right)
\end{array}
Initial program 92.0%
associate-+l+92.0%
sub-neg92.0%
sub-neg92.0%
+-commutative92.0%
+-commutative92.0%
+-commutative92.0%
Simplified92.0%
Taylor expanded in x around 0 48.0%
Taylor expanded in t around inf 26.2%
Taylor expanded in y around inf 17.6%
Final simplification17.6%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= z 0.0045) (- (- 1.0 (sqrt x)) (sqrt z)) (- (* 0.5 (sqrt (/ 1.0 z))) (sqrt x))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (z <= 0.0045) {
tmp = (1.0 - sqrt(x)) - sqrt(z);
} else {
tmp = (0.5 * sqrt((1.0 / z))) - sqrt(x);
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (z <= 0.0045d0) then
tmp = (1.0d0 - sqrt(x)) - sqrt(z)
else
tmp = (0.5d0 * sqrt((1.0d0 / z))) - sqrt(x)
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= 0.0045) {
tmp = (1.0 - Math.sqrt(x)) - Math.sqrt(z);
} else {
tmp = (0.5 * Math.sqrt((1.0 / z))) - Math.sqrt(x);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if z <= 0.0045: tmp = (1.0 - math.sqrt(x)) - math.sqrt(z) else: tmp = (0.5 * math.sqrt((1.0 / z))) - math.sqrt(x) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (z <= 0.0045) tmp = Float64(Float64(1.0 - sqrt(x)) - sqrt(z)); else tmp = Float64(Float64(0.5 * sqrt(Float64(1.0 / z))) - sqrt(x)); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (z <= 0.0045)
tmp = (1.0 - sqrt(x)) - sqrt(z);
else
tmp = (0.5 * sqrt((1.0 / z))) - sqrt(x);
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[z, 0.0045], N[(N[(1.0 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision], N[(N[(0.5 * N[Sqrt[N[(1.0 / z), $MachinePrecision]], $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}\;z \leq 0.0045:\\
\;\;\;\;\left(1 - \sqrt{x}\right) - \sqrt{z}\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \sqrt{\frac{1}{z}} - \sqrt{x}\\
\end{array}
\end{array}
if z < 0.00449999999999999966Initial program 97.4%
associate-+l+97.4%
sub-neg97.4%
sub-neg97.4%
+-commutative97.4%
+-commutative97.4%
+-commutative97.4%
Simplified97.4%
Taylor expanded in x around 0 49.2%
Taylor expanded in t around inf 28.7%
Taylor expanded in x around inf 9.5%
mul-1-neg9.5%
Simplified9.5%
Taylor expanded in z around 0 9.5%
associate--r+9.5%
Simplified9.5%
if 0.00449999999999999966 < z Initial program 86.0%
associate-+l+86.0%
sub-neg86.0%
sub-neg86.0%
+-commutative86.0%
+-commutative86.0%
+-commutative86.0%
Simplified86.0%
Taylor expanded in x around 0 46.7%
Taylor expanded in t around inf 23.3%
Taylor expanded in x around inf 2.1%
mul-1-neg2.1%
Simplified2.1%
Taylor expanded in z around inf 3.2%
Final simplification6.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 (* z 0.5)) (+ (sqrt x) (sqrt z))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
return (1.0 + (z * 0.5)) - (sqrt(x) + sqrt(z));
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (1.0d0 + (z * 0.5d0)) - (sqrt(x) + sqrt(z))
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
return (1.0 + (z * 0.5)) - (Math.sqrt(x) + Math.sqrt(z));
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): return (1.0 + (z * 0.5)) - (math.sqrt(x) + math.sqrt(z))
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) return Float64(Float64(1.0 + Float64(z * 0.5)) - Float64(sqrt(x) + sqrt(z))) end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp = code(x, y, z, t)
tmp = (1.0 + (z * 0.5)) - (sqrt(x) + sqrt(z));
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := N[(N[(1.0 + N[(z * 0.5), $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\left(1 + z \cdot 0.5\right) - \left(\sqrt{x} + \sqrt{z}\right)
\end{array}
Initial program 92.0%
associate-+l+92.0%
sub-neg92.0%
sub-neg92.0%
+-commutative92.0%
+-commutative92.0%
+-commutative92.0%
Simplified92.0%
Taylor expanded in x around 0 48.0%
Taylor expanded in t around inf 26.2%
Taylor expanded in x around inf 6.0%
mul-1-neg6.0%
Simplified6.0%
Taylor expanded in z around 0 7.1%
Final simplification7.1%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (- (- 1.0 (sqrt x)) (sqrt z)))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
return (1.0 - sqrt(x)) - sqrt(z);
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (1.0d0 - sqrt(x)) - sqrt(z)
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
return (1.0 - Math.sqrt(x)) - Math.sqrt(z);
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): return (1.0 - math.sqrt(x)) - math.sqrt(z)
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) return Float64(Float64(1.0 - sqrt(x)) - sqrt(z)) end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp = code(x, y, z, t)
tmp = (1.0 - sqrt(x)) - sqrt(z);
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := N[(N[(1.0 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\left(1 - \sqrt{x}\right) - \sqrt{z}
\end{array}
Initial program 92.0%
associate-+l+92.0%
sub-neg92.0%
sub-neg92.0%
+-commutative92.0%
+-commutative92.0%
+-commutative92.0%
Simplified92.0%
Taylor expanded in x around 0 48.0%
Taylor expanded in t around inf 26.2%
Taylor expanded in x around inf 6.0%
mul-1-neg6.0%
Simplified6.0%
Taylor expanded in z around 0 5.7%
associate--r+5.7%
Simplified5.7%
Final simplification5.7%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (- (sqrt x)))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
return -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(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(x);
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): return -math.sqrt(x)
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) return Float64(-sqrt(x)) end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp = code(x, y, z, t)
tmp = -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[Sqrt[x], $MachinePrecision])
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
-\sqrt{x}
\end{array}
Initial program 92.0%
associate-+l+92.0%
sub-neg92.0%
sub-neg92.0%
+-commutative92.0%
+-commutative92.0%
+-commutative92.0%
Simplified92.0%
Taylor expanded in x around 0 48.0%
Taylor expanded in t around inf 26.2%
Taylor expanded in x around inf 6.0%
mul-1-neg6.0%
Simplified6.0%
Taylor expanded in x around inf 1.6%
neg-mul-11.6%
Simplified1.6%
Final simplification1.6%
(FPCore (x y z t)
:precision binary64
(+
(+
(+
(/ 1.0 (+ (sqrt (+ x 1.0)) (sqrt x)))
(/ 1.0 (+ (sqrt (+ y 1.0)) (sqrt y))))
(/ 1.0 (+ (sqrt (+ z 1.0)) (sqrt z))))
(- (sqrt (+ t 1.0)) (sqrt t))))
double code(double x, double y, double z, double t) {
return (((1.0 / (sqrt((x + 1.0)) + sqrt(x))) + (1.0 / (sqrt((y + 1.0)) + sqrt(y)))) + (1.0 / (sqrt((z + 1.0)) + sqrt(z)))) + (sqrt((t + 1.0)) - sqrt(t));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (((1.0d0 / (sqrt((x + 1.0d0)) + sqrt(x))) + (1.0d0 / (sqrt((y + 1.0d0)) + sqrt(y)))) + (1.0d0 / (sqrt((z + 1.0d0)) + sqrt(z)))) + (sqrt((t + 1.0d0)) - sqrt(t))
end function
public static double code(double x, double y, double z, double t) {
return (((1.0 / (Math.sqrt((x + 1.0)) + Math.sqrt(x))) + (1.0 / (Math.sqrt((y + 1.0)) + Math.sqrt(y)))) + (1.0 / (Math.sqrt((z + 1.0)) + Math.sqrt(z)))) + (Math.sqrt((t + 1.0)) - Math.sqrt(t));
}
def code(x, y, z, t): return (((1.0 / (math.sqrt((x + 1.0)) + math.sqrt(x))) + (1.0 / (math.sqrt((y + 1.0)) + math.sqrt(y)))) + (1.0 / (math.sqrt((z + 1.0)) + math.sqrt(z)))) + (math.sqrt((t + 1.0)) - math.sqrt(t))
function code(x, y, z, t) return Float64(Float64(Float64(Float64(1.0 / Float64(sqrt(Float64(x + 1.0)) + sqrt(x))) + Float64(1.0 / Float64(sqrt(Float64(y + 1.0)) + sqrt(y)))) + Float64(1.0 / Float64(sqrt(Float64(z + 1.0)) + sqrt(z)))) + Float64(sqrt(Float64(t + 1.0)) - sqrt(t))) end
function tmp = code(x, y, z, t) tmp = (((1.0 / (sqrt((x + 1.0)) + sqrt(x))) + (1.0 / (sqrt((y + 1.0)) + sqrt(y)))) + (1.0 / (sqrt((z + 1.0)) + sqrt(z)))) + (sqrt((t + 1.0)) - sqrt(t)); end
code[x_, y_, z_, t_] := N[(N[(N[(N[(1.0 / N[(N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[N[(z + 1.0), $MachinePrecision]], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(t + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\frac{1}{\sqrt{x + 1} + \sqrt{x}} + \frac{1}{\sqrt{y + 1} + \sqrt{y}}\right) + \frac{1}{\sqrt{z + 1} + \sqrt{z}}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)
\end{array}
herbie shell --seed 2024067
(FPCore (x y z t)
:name "Main:z from "
:precision binary64
:alt
(+ (+ (+ (/ 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))))