
(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 22 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (+ (+ (+ (- (sqrt (+ x 1.0)) (sqrt x)) (- (sqrt (+ y 1.0)) (sqrt y))) (- (sqrt (+ z 1.0)) (sqrt z))) (- (sqrt (+ t 1.0)) (sqrt t))))
double code(double x, double y, double z, double t) {
return (((sqrt((x + 1.0)) - sqrt(x)) + (sqrt((y + 1.0)) - sqrt(y))) + (sqrt((z + 1.0)) - sqrt(z))) + (sqrt((t + 1.0)) - sqrt(t));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (((sqrt((x + 1.0d0)) - sqrt(x)) + (sqrt((y + 1.0d0)) - sqrt(y))) + (sqrt((z + 1.0d0)) - sqrt(z))) + (sqrt((t + 1.0d0)) - sqrt(t))
end function
public static double code(double x, double y, double z, double t) {
return (((Math.sqrt((x + 1.0)) - Math.sqrt(x)) + (Math.sqrt((y + 1.0)) - Math.sqrt(y))) + (Math.sqrt((z + 1.0)) - Math.sqrt(z))) + (Math.sqrt((t + 1.0)) - Math.sqrt(t));
}
def code(x, y, z, t): return (((math.sqrt((x + 1.0)) - math.sqrt(x)) + (math.sqrt((y + 1.0)) - math.sqrt(y))) + (math.sqrt((z + 1.0)) - math.sqrt(z))) + (math.sqrt((t + 1.0)) - math.sqrt(t))
function code(x, y, z, t) return Float64(Float64(Float64(Float64(sqrt(Float64(x + 1.0)) - sqrt(x)) + Float64(sqrt(Float64(y + 1.0)) - sqrt(y))) + Float64(sqrt(Float64(z + 1.0)) - sqrt(z))) + Float64(sqrt(Float64(t + 1.0)) - sqrt(t))) end
function tmp = code(x, y, z, t) tmp = (((sqrt((x + 1.0)) - sqrt(x)) + (sqrt((y + 1.0)) - sqrt(y))) + (sqrt((z + 1.0)) - sqrt(z))) + (sqrt((t + 1.0)) - sqrt(t)); end
code[x_, y_, z_, t_] := N[(N[(N[(N[(N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(z + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(t + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{y + 1} - \sqrt{y}\right)\right) + \left(\sqrt{z + 1} - \sqrt{z}\right)\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)
\end{array}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ 1.0 x))) (t_2 (sqrt (+ 1.0 z))))
(if (<= y 4.8e-7)
(+
(+ (- (sqrt (+ 1.0 t)) (sqrt t)) (/ (- (+ 1.0 z) z) (+ t_2 (sqrt z))))
(- (+ 1.0 (+ 1.0 (* y 0.5))) (sqrt y)))
(if (<= y 4e+33)
(+
(- t_2 (sqrt z))
(+ t_1 (- (/ 1.0 (+ (sqrt (+ 1.0 y)) (sqrt y))) (sqrt x))))
(/ 1.0 (+ (sqrt x) t_1))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + x));
double t_2 = sqrt((1.0 + z));
double tmp;
if (y <= 4.8e-7) {
tmp = ((sqrt((1.0 + t)) - sqrt(t)) + (((1.0 + z) - z) / (t_2 + sqrt(z)))) + ((1.0 + (1.0 + (y * 0.5))) - sqrt(y));
} else if (y <= 4e+33) {
tmp = (t_2 - sqrt(z)) + (t_1 + ((1.0 / (sqrt((1.0 + y)) + sqrt(y))) - sqrt(x)));
} else {
tmp = 1.0 / (sqrt(x) + t_1);
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = sqrt((1.0d0 + x))
t_2 = sqrt((1.0d0 + z))
if (y <= 4.8d-7) then
tmp = ((sqrt((1.0d0 + t)) - sqrt(t)) + (((1.0d0 + z) - z) / (t_2 + sqrt(z)))) + ((1.0d0 + (1.0d0 + (y * 0.5d0))) - sqrt(y))
else if (y <= 4d+33) then
tmp = (t_2 - sqrt(z)) + (t_1 + ((1.0d0 / (sqrt((1.0d0 + y)) + sqrt(y))) - sqrt(x)))
else
tmp = 1.0d0 / (sqrt(x) + t_1)
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + x));
double t_2 = Math.sqrt((1.0 + z));
double tmp;
if (y <= 4.8e-7) {
tmp = ((Math.sqrt((1.0 + t)) - Math.sqrt(t)) + (((1.0 + z) - z) / (t_2 + Math.sqrt(z)))) + ((1.0 + (1.0 + (y * 0.5))) - Math.sqrt(y));
} else if (y <= 4e+33) {
tmp = (t_2 - Math.sqrt(z)) + (t_1 + ((1.0 / (Math.sqrt((1.0 + y)) + Math.sqrt(y))) - Math.sqrt(x)));
} else {
tmp = 1.0 / (Math.sqrt(x) + t_1);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + x)) t_2 = math.sqrt((1.0 + z)) tmp = 0 if y <= 4.8e-7: tmp = ((math.sqrt((1.0 + t)) - math.sqrt(t)) + (((1.0 + z) - z) / (t_2 + math.sqrt(z)))) + ((1.0 + (1.0 + (y * 0.5))) - math.sqrt(y)) elif y <= 4e+33: tmp = (t_2 - math.sqrt(z)) + (t_1 + ((1.0 / (math.sqrt((1.0 + y)) + math.sqrt(y))) - math.sqrt(x))) else: tmp = 1.0 / (math.sqrt(x) + t_1) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(1.0 + x)) t_2 = sqrt(Float64(1.0 + z)) tmp = 0.0 if (y <= 4.8e-7) tmp = Float64(Float64(Float64(sqrt(Float64(1.0 + t)) - sqrt(t)) + Float64(Float64(Float64(1.0 + z) - z) / Float64(t_2 + sqrt(z)))) + Float64(Float64(1.0 + Float64(1.0 + Float64(y * 0.5))) - sqrt(y))); elseif (y <= 4e+33) tmp = Float64(Float64(t_2 - sqrt(z)) + Float64(t_1 + Float64(Float64(1.0 / Float64(sqrt(Float64(1.0 + y)) + sqrt(y))) - sqrt(x)))); else tmp = Float64(1.0 / Float64(sqrt(x) + t_1)); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + x));
t_2 = sqrt((1.0 + z));
tmp = 0.0;
if (y <= 4.8e-7)
tmp = ((sqrt((1.0 + t)) - sqrt(t)) + (((1.0 + z) - z) / (t_2 + sqrt(z)))) + ((1.0 + (1.0 + (y * 0.5))) - sqrt(y));
elseif (y <= 4e+33)
tmp = (t_2 - sqrt(z)) + (t_1 + ((1.0 / (sqrt((1.0 + y)) + sqrt(y))) - sqrt(x)));
else
tmp = 1.0 / (sqrt(x) + t_1);
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y, 4.8e-7], N[(N[(N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision] + N[(N[(N[(1.0 + z), $MachinePrecision] - z), $MachinePrecision] / N[(t$95$2 + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 + N[(1.0 + N[(y * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 4e+33], N[(N[(t$95$2 - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] + N[(t$95$1 + N[(N[(1.0 / N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + x}\\
t_2 := \sqrt{1 + z}\\
\mathbf{if}\;y \leq 4.8 \cdot 10^{-7}:\\
\;\;\;\;\left(\left(\sqrt{1 + t} - \sqrt{t}\right) + \frac{\left(1 + z\right) - z}{t_2 + \sqrt{z}}\right) + \left(\left(1 + \left(1 + y \cdot 0.5\right)\right) - \sqrt{y}\right)\\
\mathbf{elif}\;y \leq 4 \cdot 10^{+33}:\\
\;\;\;\;\left(t_2 - \sqrt{z}\right) + \left(t_1 + \left(\frac{1}{\sqrt{1 + y} + \sqrt{y}} - \sqrt{x}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{x} + t_1}\\
\end{array}
\end{array}
if y < 4.79999999999999957e-7Initial program 97.8%
associate-+l+97.8%
associate-+l-58.5%
+-commutative58.5%
sub-neg58.5%
sub-neg58.5%
+-commutative58.5%
+-commutative58.5%
Simplified58.5%
Taylor expanded in x around 0 57.4%
flip--57.5%
add-sqr-sqrt44.6%
+-commutative44.6%
add-sqr-sqrt57.6%
+-commutative57.6%
Applied egg-rr57.6%
Taylor expanded in y around 0 57.6%
*-commutative57.6%
Simplified57.6%
if 4.79999999999999957e-7 < y < 3.9999999999999998e33Initial program 82.3%
associate-+l+82.3%
associate-+l-71.5%
+-commutative71.5%
sub-neg71.5%
sub-neg71.5%
+-commutative71.5%
+-commutative71.5%
Simplified71.5%
flip--72.8%
add-sqr-sqrt69.6%
add-sqr-sqrt77.0%
Applied egg-rr77.0%
associate--l+77.6%
+-inverses77.6%
metadata-eval77.6%
Simplified77.6%
Taylor expanded in t around inf 39.7%
if 3.9999999999999998e33 < y Initial program 85.6%
associate-+l+85.6%
+-commutative85.6%
associate-+r-85.6%
associate-+l-57.8%
+-commutative57.8%
associate--l+57.8%
+-commutative57.8%
Simplified37.3%
Taylor expanded in t around inf 31.9%
+-commutative31.9%
+-commutative31.9%
associate--l+34.1%
Simplified34.1%
Taylor expanded in z around inf 3.2%
associate--l+4.1%
+-commutative4.1%
Simplified4.1%
Taylor expanded in y around inf 22.8%
flip--23.0%
add-sqr-sqrt23.8%
+-commutative23.8%
add-sqr-sqrt24.3%
+-commutative24.3%
Applied egg-rr24.3%
+-commutative24.3%
associate--l+26.6%
+-inverses26.6%
metadata-eval26.6%
+-commutative26.6%
+-commutative26.6%
Simplified26.6%
Final simplification42.5%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ 1.0 z)))
(t_2 (- (sqrt (+ 1.0 t)) (sqrt t)))
(t_3 (sqrt (+ 1.0 y))))
(if (<= (+ (- (sqrt (+ 1.0 x)) (sqrt x)) (- t_3 (sqrt y))) 1.0)
(+ (+ (- t_1 (sqrt z)) t_2) (/ 1.0 (+ (sqrt x) (hypot 1.0 (sqrt x)))))
(+
(+ 1.0 (/ 1.0 (+ t_3 (sqrt y))))
(+ t_2 (/ (- (+ 1.0 z) z) (+ t_1 (sqrt z))))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + z));
double t_2 = sqrt((1.0 + t)) - sqrt(t);
double t_3 = sqrt((1.0 + y));
double tmp;
if (((sqrt((1.0 + x)) - sqrt(x)) + (t_3 - sqrt(y))) <= 1.0) {
tmp = ((t_1 - sqrt(z)) + t_2) + (1.0 / (sqrt(x) + hypot(1.0, sqrt(x))));
} else {
tmp = (1.0 + (1.0 / (t_3 + sqrt(y)))) + (t_2 + (((1.0 + z) - z) / (t_1 + sqrt(z))));
}
return tmp;
}
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + z));
double t_2 = Math.sqrt((1.0 + t)) - Math.sqrt(t);
double t_3 = Math.sqrt((1.0 + y));
double tmp;
if (((Math.sqrt((1.0 + x)) - Math.sqrt(x)) + (t_3 - Math.sqrt(y))) <= 1.0) {
tmp = ((t_1 - Math.sqrt(z)) + t_2) + (1.0 / (Math.sqrt(x) + Math.hypot(1.0, Math.sqrt(x))));
} else {
tmp = (1.0 + (1.0 / (t_3 + Math.sqrt(y)))) + (t_2 + (((1.0 + z) - z) / (t_1 + Math.sqrt(z))));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + z)) t_2 = math.sqrt((1.0 + t)) - math.sqrt(t) t_3 = math.sqrt((1.0 + y)) tmp = 0 if ((math.sqrt((1.0 + x)) - math.sqrt(x)) + (t_3 - math.sqrt(y))) <= 1.0: tmp = ((t_1 - math.sqrt(z)) + t_2) + (1.0 / (math.sqrt(x) + math.hypot(1.0, math.sqrt(x)))) else: tmp = (1.0 + (1.0 / (t_3 + math.sqrt(y)))) + (t_2 + (((1.0 + z) - z) / (t_1 + math.sqrt(z)))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(1.0 + z)) t_2 = Float64(sqrt(Float64(1.0 + t)) - sqrt(t)) t_3 = sqrt(Float64(1.0 + y)) tmp = 0.0 if (Float64(Float64(sqrt(Float64(1.0 + x)) - sqrt(x)) + Float64(t_3 - sqrt(y))) <= 1.0) tmp = Float64(Float64(Float64(t_1 - sqrt(z)) + t_2) + Float64(1.0 / Float64(sqrt(x) + hypot(1.0, sqrt(x))))); else tmp = Float64(Float64(1.0 + Float64(1.0 / Float64(t_3 + sqrt(y)))) + Float64(t_2 + Float64(Float64(Float64(1.0 + z) - z) / Float64(t_1 + sqrt(z))))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + z));
t_2 = sqrt((1.0 + t)) - sqrt(t);
t_3 = sqrt((1.0 + y));
tmp = 0.0;
if (((sqrt((1.0 + x)) - sqrt(x)) + (t_3 - sqrt(y))) <= 1.0)
tmp = ((t_1 - sqrt(z)) + t_2) + (1.0 / (sqrt(x) + hypot(1.0, sqrt(x))));
else
tmp = (1.0 + (1.0 / (t_3 + sqrt(y)))) + (t_2 + (((1.0 + z) - z) / (t_1 + sqrt(z))));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(N[(N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(t$95$3 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1.0], N[(N[(N[(t$95$1 - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] + t$95$2), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[1.0 ^ 2 + N[Sqrt[x], $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 + N[(1.0 / N[(t$95$3 + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$2 + N[(N[(N[(1.0 + z), $MachinePrecision] - z), $MachinePrecision] / N[(t$95$1 + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + z}\\
t_2 := \sqrt{1 + t} - \sqrt{t}\\
t_3 := \sqrt{1 + y}\\
\mathbf{if}\;\left(\sqrt{1 + x} - \sqrt{x}\right) + \left(t_3 - \sqrt{y}\right) \leq 1:\\
\;\;\;\;\left(\left(t_1 - \sqrt{z}\right) + t_2\right) + \frac{1}{\sqrt{x} + \mathsf{hypot}\left(1, \sqrt{x}\right)}\\
\mathbf{else}:\\
\;\;\;\;\left(1 + \frac{1}{t_3 + \sqrt{y}}\right) + \left(t_2 + \frac{\left(1 + z\right) - z}{t_1 + \sqrt{z}}\right)\\
\end{array}
\end{array}
if (+.f64 (-.f64 (sqrt.f64 (+.f64 x 1)) (sqrt.f64 x)) (-.f64 (sqrt.f64 (+.f64 y 1)) (sqrt.f64 y))) < 1Initial program 88.8%
associate-+l+88.8%
associate-+l-61.5%
+-commutative61.5%
sub-neg61.5%
sub-neg61.5%
+-commutative61.5%
+-commutative61.5%
Simplified61.5%
add-log-exp61.5%
associate--r-88.8%
+-commutative88.8%
Applied egg-rr88.8%
flip--16.0%
add-sqr-sqrt16.8%
+-commutative16.8%
add-sqr-sqrt16.8%
+-commutative16.8%
Applied egg-rr89.7%
+-commutative16.8%
associate--l+19.5%
+-inverses19.5%
metadata-eval19.5%
+-commutative19.5%
+-commutative19.5%
Simplified89.9%
Taylor expanded in y around inf 63.2%
+-commutative63.2%
rem-square-sqrt63.2%
hypot-1-def63.2%
Simplified63.2%
if 1 < (+.f64 (-.f64 (sqrt.f64 (+.f64 x 1)) (sqrt.f64 x)) (-.f64 (sqrt.f64 (+.f64 y 1)) (sqrt.f64 y))) Initial program 97.8%
associate-+l+97.8%
associate-+l-97.8%
+-commutative97.8%
sub-neg97.8%
sub-neg97.8%
+-commutative97.8%
+-commutative97.8%
Simplified97.8%
flip--98.1%
add-sqr-sqrt98.2%
add-sqr-sqrt98.7%
Applied egg-rr98.7%
associate--l+98.7%
+-inverses98.7%
metadata-eval98.7%
Simplified98.7%
flip--93.6%
add-sqr-sqrt71.8%
+-commutative71.8%
add-sqr-sqrt93.8%
+-commutative93.8%
Applied egg-rr99.1%
Taylor expanded in x around 0 94.8%
Final simplification72.0%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (+ (+ (/ 1.0 (+ (sqrt (+ 1.0 y)) (sqrt y))) (/ 1.0 (+ (sqrt x) (sqrt (+ 1.0 x))))) (+ (- (sqrt (+ 1.0 z)) (sqrt z)) (- (sqrt (+ 1.0 t)) (sqrt t)))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
return ((1.0 / (sqrt((1.0 + y)) + sqrt(y))) + (1.0 / (sqrt(x) + sqrt((1.0 + x))))) + ((sqrt((1.0 + z)) - sqrt(z)) + (sqrt((1.0 + t)) - sqrt(t)));
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = ((1.0d0 / (sqrt((1.0d0 + y)) + sqrt(y))) + (1.0d0 / (sqrt(x) + sqrt((1.0d0 + x))))) + ((sqrt((1.0d0 + z)) - sqrt(z)) + (sqrt((1.0d0 + t)) - sqrt(t)))
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
return ((1.0 / (Math.sqrt((1.0 + y)) + Math.sqrt(y))) + (1.0 / (Math.sqrt(x) + Math.sqrt((1.0 + x))))) + ((Math.sqrt((1.0 + z)) - Math.sqrt(z)) + (Math.sqrt((1.0 + t)) - Math.sqrt(t)));
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): return ((1.0 / (math.sqrt((1.0 + y)) + math.sqrt(y))) + (1.0 / (math.sqrt(x) + math.sqrt((1.0 + x))))) + ((math.sqrt((1.0 + z)) - math.sqrt(z)) + (math.sqrt((1.0 + t)) - math.sqrt(t)))
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) return Float64(Float64(Float64(1.0 / Float64(sqrt(Float64(1.0 + y)) + sqrt(y))) + Float64(1.0 / Float64(sqrt(x) + sqrt(Float64(1.0 + x))))) + Float64(Float64(sqrt(Float64(1.0 + z)) - sqrt(z)) + Float64(sqrt(Float64(1.0 + t)) - sqrt(t)))) end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp = code(x, y, z, t)
tmp = ((1.0 / (sqrt((1.0 + y)) + sqrt(y))) + (1.0 / (sqrt(x) + sqrt((1.0 + x))))) + ((sqrt((1.0 + z)) - sqrt(z)) + (sqrt((1.0 + t)) - sqrt(t)));
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := N[(N[(N[(1.0 / N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\left(\frac{1}{\sqrt{1 + y} + \sqrt{y}} + \frac{1}{\sqrt{x} + \sqrt{1 + x}}\right) + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\sqrt{1 + t} - \sqrt{t}\right)\right)
\end{array}
Initial program 91.3%
associate-+l+91.3%
associate-+l-71.6%
+-commutative71.6%
sub-neg71.6%
sub-neg71.6%
+-commutative71.6%
+-commutative71.6%
Simplified71.6%
flip--71.7%
add-sqr-sqrt56.2%
add-sqr-sqrt71.9%
Applied egg-rr71.9%
associate--l+72.0%
+-inverses72.0%
metadata-eval72.0%
Simplified72.0%
sub-neg72.0%
Applied egg-rr72.0%
unsub-neg72.0%
associate-+l-94.2%
+-commutative94.2%
+-commutative94.2%
Simplified94.2%
flip--16.6%
add-sqr-sqrt17.2%
+-commutative17.2%
add-sqr-sqrt17.2%
+-commutative17.2%
Applied egg-rr95.2%
+-commutative17.2%
associate--l+19.1%
+-inverses19.1%
metadata-eval19.1%
+-commutative19.1%
+-commutative19.1%
Simplified95.9%
Final simplification95.9%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(if (<= y 1.22e+26)
(+
(+ 1.0 (/ 1.0 (+ (sqrt (+ 1.0 y)) (sqrt y))))
(+
(- (sqrt (+ 1.0 t)) (sqrt t))
(/ (- (+ 1.0 z) z) (+ (sqrt (+ 1.0 z)) (sqrt z)))))
(/ 1.0 (+ (sqrt x) (sqrt (+ 1.0 x))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 1.22e+26) {
tmp = (1.0 + (1.0 / (sqrt((1.0 + y)) + sqrt(y)))) + ((sqrt((1.0 + t)) - sqrt(t)) + (((1.0 + z) - z) / (sqrt((1.0 + z)) + sqrt(z))));
} else {
tmp = 1.0 / (sqrt(x) + sqrt((1.0 + x)));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= 1.22d+26) then
tmp = (1.0d0 + (1.0d0 / (sqrt((1.0d0 + y)) + sqrt(y)))) + ((sqrt((1.0d0 + t)) - sqrt(t)) + (((1.0d0 + z) - z) / (sqrt((1.0d0 + z)) + sqrt(z))))
else
tmp = 1.0d0 / (sqrt(x) + sqrt((1.0d0 + x)))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= 1.22e+26) {
tmp = (1.0 + (1.0 / (Math.sqrt((1.0 + y)) + Math.sqrt(y)))) + ((Math.sqrt((1.0 + t)) - Math.sqrt(t)) + (((1.0 + z) - z) / (Math.sqrt((1.0 + z)) + Math.sqrt(z))));
} else {
tmp = 1.0 / (Math.sqrt(x) + Math.sqrt((1.0 + x)));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if y <= 1.22e+26: tmp = (1.0 + (1.0 / (math.sqrt((1.0 + y)) + math.sqrt(y)))) + ((math.sqrt((1.0 + t)) - math.sqrt(t)) + (((1.0 + z) - z) / (math.sqrt((1.0 + z)) + math.sqrt(z)))) else: tmp = 1.0 / (math.sqrt(x) + math.sqrt((1.0 + x))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (y <= 1.22e+26) tmp = Float64(Float64(1.0 + Float64(1.0 / Float64(sqrt(Float64(1.0 + y)) + sqrt(y)))) + Float64(Float64(sqrt(Float64(1.0 + t)) - sqrt(t)) + Float64(Float64(Float64(1.0 + z) - z) / Float64(sqrt(Float64(1.0 + z)) + sqrt(z))))); else tmp = Float64(1.0 / Float64(sqrt(x) + sqrt(Float64(1.0 + x)))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (y <= 1.22e+26)
tmp = (1.0 + (1.0 / (sqrt((1.0 + y)) + sqrt(y)))) + ((sqrt((1.0 + t)) - sqrt(t)) + (((1.0 + z) - z) / (sqrt((1.0 + z)) + sqrt(z))));
else
tmp = 1.0 / (sqrt(x) + sqrt((1.0 + x)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[y, 1.22e+26], N[(N[(1.0 + N[(1.0 / N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision] + N[(N[(N[(1.0 + z), $MachinePrecision] - z), $MachinePrecision] / N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 1.22 \cdot 10^{+26}:\\
\;\;\;\;\left(1 + \frac{1}{\sqrt{1 + y} + \sqrt{y}}\right) + \left(\left(\sqrt{1 + t} - \sqrt{t}\right) + \frac{\left(1 + z\right) - z}{\sqrt{1 + z} + \sqrt{z}}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{x} + \sqrt{1 + x}}\\
\end{array}
\end{array}
if y < 1.2200000000000001e26Initial program 96.0%
associate-+l+96.0%
associate-+l-59.7%
+-commutative59.7%
sub-neg59.7%
sub-neg59.7%
+-commutative59.7%
+-commutative59.7%
Simplified59.7%
flip--59.8%
add-sqr-sqrt59.9%
add-sqr-sqrt60.3%
Applied egg-rr60.3%
associate--l+60.3%
+-inverses60.3%
metadata-eval60.3%
Simplified60.3%
flip--57.5%
add-sqr-sqrt45.2%
+-commutative45.2%
add-sqr-sqrt57.6%
+-commutative57.6%
Applied egg-rr60.6%
Taylor expanded in x around 0 58.0%
if 1.2200000000000001e26 < y Initial program 85.7%
associate-+l+85.7%
+-commutative85.7%
associate-+r-85.7%
associate-+l-57.6%
+-commutative57.6%
associate--l+57.6%
+-commutative57.6%
Simplified36.8%
Taylor expanded in t around inf 32.2%
+-commutative32.2%
+-commutative32.2%
associate--l+34.4%
Simplified34.4%
Taylor expanded in z around inf 3.9%
associate--l+4.9%
+-commutative4.9%
Simplified4.9%
Taylor expanded in y around inf 23.2%
flip--23.4%
add-sqr-sqrt24.2%
+-commutative24.2%
add-sqr-sqrt24.7%
+-commutative24.7%
Applied egg-rr24.7%
+-commutative24.7%
associate--l+27.0%
+-inverses27.0%
metadata-eval27.0%
+-commutative27.0%
+-commutative27.0%
Simplified27.0%
Final simplification43.8%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(if (<= y 2.1e+17)
(+
(+
(- (sqrt (+ 1.0 t)) (sqrt t))
(/ (- (+ 1.0 z) z) (+ (sqrt (+ 1.0 z)) (sqrt z))))
(- (+ 1.0 (sqrt (+ 1.0 y))) (sqrt y)))
(/ 1.0 (+ (sqrt x) (sqrt (+ 1.0 x))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 2.1e+17) {
tmp = ((sqrt((1.0 + t)) - sqrt(t)) + (((1.0 + z) - z) / (sqrt((1.0 + z)) + sqrt(z)))) + ((1.0 + sqrt((1.0 + y))) - sqrt(y));
} else {
tmp = 1.0 / (sqrt(x) + sqrt((1.0 + x)));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= 2.1d+17) then
tmp = ((sqrt((1.0d0 + t)) - sqrt(t)) + (((1.0d0 + z) - z) / (sqrt((1.0d0 + z)) + sqrt(z)))) + ((1.0d0 + sqrt((1.0d0 + y))) - sqrt(y))
else
tmp = 1.0d0 / (sqrt(x) + sqrt((1.0d0 + x)))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= 2.1e+17) {
tmp = ((Math.sqrt((1.0 + t)) - Math.sqrt(t)) + (((1.0 + z) - z) / (Math.sqrt((1.0 + z)) + Math.sqrt(z)))) + ((1.0 + Math.sqrt((1.0 + y))) - Math.sqrt(y));
} else {
tmp = 1.0 / (Math.sqrt(x) + Math.sqrt((1.0 + x)));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if y <= 2.1e+17: tmp = ((math.sqrt((1.0 + t)) - math.sqrt(t)) + (((1.0 + z) - z) / (math.sqrt((1.0 + z)) + math.sqrt(z)))) + ((1.0 + math.sqrt((1.0 + y))) - math.sqrt(y)) else: tmp = 1.0 / (math.sqrt(x) + math.sqrt((1.0 + x))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (y <= 2.1e+17) tmp = Float64(Float64(Float64(sqrt(Float64(1.0 + t)) - sqrt(t)) + Float64(Float64(Float64(1.0 + z) - z) / Float64(sqrt(Float64(1.0 + z)) + sqrt(z)))) + Float64(Float64(1.0 + sqrt(Float64(1.0 + y))) - sqrt(y))); else tmp = Float64(1.0 / Float64(sqrt(x) + sqrt(Float64(1.0 + x)))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (y <= 2.1e+17)
tmp = ((sqrt((1.0 + t)) - sqrt(t)) + (((1.0 + z) - z) / (sqrt((1.0 + z)) + sqrt(z)))) + ((1.0 + sqrt((1.0 + y))) - sqrt(y));
else
tmp = 1.0 / (sqrt(x) + sqrt((1.0 + x)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[y, 2.1e+17], N[(N[(N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision] + N[(N[(N[(1.0 + z), $MachinePrecision] - z), $MachinePrecision] / N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 + N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 2.1 \cdot 10^{+17}:\\
\;\;\;\;\left(\left(\sqrt{1 + t} - \sqrt{t}\right) + \frac{\left(1 + z\right) - z}{\sqrt{1 + z} + \sqrt{z}}\right) + \left(\left(1 + \sqrt{1 + y}\right) - \sqrt{y}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{x} + \sqrt{1 + x}}\\
\end{array}
\end{array}
if y < 2.1e17Initial program 97.0%
associate-+l+97.0%
associate-+l-59.8%
+-commutative59.8%
sub-neg59.8%
sub-neg59.8%
+-commutative59.8%
+-commutative59.8%
Simplified59.8%
Taylor expanded in x around 0 58.3%
flip--58.4%
add-sqr-sqrt45.9%
+-commutative45.9%
add-sqr-sqrt58.5%
+-commutative58.5%
Applied egg-rr58.5%
if 2.1e17 < y Initial program 84.8%
associate-+l+84.8%
+-commutative84.8%
associate-+r-84.8%
associate-+l-56.2%
+-commutative56.2%
associate--l+56.2%
+-commutative56.2%
Simplified36.0%
Taylor expanded in t around inf 31.4%
+-commutative31.4%
+-commutative31.4%
associate--l+33.6%
Simplified33.6%
Taylor expanded in z around inf 3.9%
associate--l+5.0%
+-commutative5.0%
Simplified5.0%
Taylor expanded in y around inf 22.7%
flip--22.9%
add-sqr-sqrt23.7%
+-commutative23.7%
add-sqr-sqrt24.1%
+-commutative24.1%
Applied egg-rr24.1%
+-commutative24.1%
associate--l+26.5%
+-inverses26.5%
metadata-eval26.5%
+-commutative26.5%
+-commutative26.5%
Simplified26.5%
Final simplification43.5%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ 1.0 z))))
(if (<= y 5e-7)
(+
(+ (- (sqrt (+ 1.0 t)) (sqrt t)) (/ (- (+ 1.0 z) z) (+ t_1 (sqrt z))))
(- (+ 1.0 (+ 1.0 (* y 0.5))) (sqrt y)))
(if (<= y 1.22e+26)
(exp
(log
(+ (- t_1 (sqrt z)) (+ 1.0 (/ 1.0 (+ (sqrt (+ 1.0 y)) (sqrt y)))))))
(/ 1.0 (+ (sqrt x) (sqrt (+ 1.0 x))))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + z));
double tmp;
if (y <= 5e-7) {
tmp = ((sqrt((1.0 + t)) - sqrt(t)) + (((1.0 + z) - z) / (t_1 + sqrt(z)))) + ((1.0 + (1.0 + (y * 0.5))) - sqrt(y));
} else if (y <= 1.22e+26) {
tmp = exp(log(((t_1 - sqrt(z)) + (1.0 + (1.0 / (sqrt((1.0 + y)) + sqrt(y)))))));
} else {
tmp = 1.0 / (sqrt(x) + sqrt((1.0 + x)));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = sqrt((1.0d0 + z))
if (y <= 5d-7) then
tmp = ((sqrt((1.0d0 + t)) - sqrt(t)) + (((1.0d0 + z) - z) / (t_1 + sqrt(z)))) + ((1.0d0 + (1.0d0 + (y * 0.5d0))) - sqrt(y))
else if (y <= 1.22d+26) then
tmp = exp(log(((t_1 - sqrt(z)) + (1.0d0 + (1.0d0 / (sqrt((1.0d0 + y)) + sqrt(y)))))))
else
tmp = 1.0d0 / (sqrt(x) + sqrt((1.0d0 + x)))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + z));
double tmp;
if (y <= 5e-7) {
tmp = ((Math.sqrt((1.0 + t)) - Math.sqrt(t)) + (((1.0 + z) - z) / (t_1 + Math.sqrt(z)))) + ((1.0 + (1.0 + (y * 0.5))) - Math.sqrt(y));
} else if (y <= 1.22e+26) {
tmp = Math.exp(Math.log(((t_1 - Math.sqrt(z)) + (1.0 + (1.0 / (Math.sqrt((1.0 + y)) + Math.sqrt(y)))))));
} else {
tmp = 1.0 / (Math.sqrt(x) + Math.sqrt((1.0 + x)));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + z)) tmp = 0 if y <= 5e-7: tmp = ((math.sqrt((1.0 + t)) - math.sqrt(t)) + (((1.0 + z) - z) / (t_1 + math.sqrt(z)))) + ((1.0 + (1.0 + (y * 0.5))) - math.sqrt(y)) elif y <= 1.22e+26: tmp = math.exp(math.log(((t_1 - math.sqrt(z)) + (1.0 + (1.0 / (math.sqrt((1.0 + y)) + math.sqrt(y))))))) else: tmp = 1.0 / (math.sqrt(x) + math.sqrt((1.0 + x))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(1.0 + z)) tmp = 0.0 if (y <= 5e-7) tmp = Float64(Float64(Float64(sqrt(Float64(1.0 + t)) - sqrt(t)) + Float64(Float64(Float64(1.0 + z) - z) / Float64(t_1 + sqrt(z)))) + Float64(Float64(1.0 + Float64(1.0 + Float64(y * 0.5))) - sqrt(y))); elseif (y <= 1.22e+26) tmp = exp(log(Float64(Float64(t_1 - sqrt(z)) + Float64(1.0 + Float64(1.0 / Float64(sqrt(Float64(1.0 + y)) + sqrt(y))))))); else tmp = Float64(1.0 / Float64(sqrt(x) + sqrt(Float64(1.0 + x)))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + z));
tmp = 0.0;
if (y <= 5e-7)
tmp = ((sqrt((1.0 + t)) - sqrt(t)) + (((1.0 + z) - z) / (t_1 + sqrt(z)))) + ((1.0 + (1.0 + (y * 0.5))) - sqrt(y));
elseif (y <= 1.22e+26)
tmp = exp(log(((t_1 - sqrt(z)) + (1.0 + (1.0 / (sqrt((1.0 + y)) + sqrt(y)))))));
else
tmp = 1.0 / (sqrt(x) + sqrt((1.0 + x)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y, 5e-7], N[(N[(N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision] + N[(N[(N[(1.0 + z), $MachinePrecision] - z), $MachinePrecision] / N[(t$95$1 + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 + N[(1.0 + N[(y * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.22e+26], N[Exp[N[Log[N[(N[(t$95$1 - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] + N[(1.0 + N[(1.0 / N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision], N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + z}\\
\mathbf{if}\;y \leq 5 \cdot 10^{-7}:\\
\;\;\;\;\left(\left(\sqrt{1 + t} - \sqrt{t}\right) + \frac{\left(1 + z\right) - z}{t_1 + \sqrt{z}}\right) + \left(\left(1 + \left(1 + y \cdot 0.5\right)\right) - \sqrt{y}\right)\\
\mathbf{elif}\;y \leq 1.22 \cdot 10^{+26}:\\
\;\;\;\;e^{\log \left(\left(t_1 - \sqrt{z}\right) + \left(1 + \frac{1}{\sqrt{1 + y} + \sqrt{y}}\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{x} + \sqrt{1 + x}}\\
\end{array}
\end{array}
if y < 4.99999999999999977e-7Initial program 97.8%
associate-+l+97.8%
associate-+l-58.5%
+-commutative58.5%
sub-neg58.5%
sub-neg58.5%
+-commutative58.5%
+-commutative58.5%
Simplified58.5%
Taylor expanded in x around 0 57.4%
flip--57.5%
add-sqr-sqrt44.6%
+-commutative44.6%
add-sqr-sqrt57.6%
+-commutative57.6%
Applied egg-rr57.6%
Taylor expanded in y around 0 57.6%
*-commutative57.6%
Simplified57.6%
if 4.99999999999999977e-7 < y < 1.2200000000000001e26Initial program 81.3%
associate-+l+81.3%
associate-+l-69.1%
+-commutative69.1%
sub-neg69.1%
sub-neg69.1%
+-commutative69.1%
+-commutative69.1%
Simplified69.1%
Taylor expanded in x around 0 56.8%
Taylor expanded in t around inf 42.9%
add-exp-log42.8%
associate--l+43.0%
+-commutative43.0%
Applied egg-rr43.0%
flip--70.5%
add-sqr-sqrt70.7%
add-sqr-sqrt75.3%
Applied egg-rr45.4%
associate--l+75.3%
+-inverses75.3%
metadata-eval75.3%
Simplified46.6%
if 1.2200000000000001e26 < y Initial program 85.7%
associate-+l+85.7%
+-commutative85.7%
associate-+r-85.7%
associate-+l-57.6%
+-commutative57.6%
associate--l+57.6%
+-commutative57.6%
Simplified36.8%
Taylor expanded in t around inf 32.2%
+-commutative32.2%
+-commutative32.2%
associate--l+34.4%
Simplified34.4%
Taylor expanded in z around inf 3.9%
associate--l+4.9%
+-commutative4.9%
Simplified4.9%
Taylor expanded in y around inf 23.2%
flip--23.4%
add-sqr-sqrt24.2%
+-commutative24.2%
add-sqr-sqrt24.7%
+-commutative24.7%
Applied egg-rr24.7%
+-commutative24.7%
associate--l+27.0%
+-inverses27.0%
metadata-eval27.0%
+-commutative27.0%
+-commutative27.0%
Simplified27.0%
Final simplification43.0%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (+ (sqrt (+ 1.0 z)) (sqrt z))))
(if (<= y 4.4e-8)
(+
(+ (- (sqrt (+ 1.0 t)) (sqrt t)) (/ (- (+ 1.0 z) z) t_1))
(- (+ 1.0 (+ 1.0 (* y 0.5))) (sqrt y)))
(if (<= y 2.1e+17)
(+ (/ 1.0 t_1) (+ (sqrt (+ 1.0 y)) (- 1.0 (sqrt y))))
(/ 1.0 (+ (sqrt x) (sqrt (+ 1.0 x))))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + z)) + sqrt(z);
double tmp;
if (y <= 4.4e-8) {
tmp = ((sqrt((1.0 + t)) - sqrt(t)) + (((1.0 + z) - z) / t_1)) + ((1.0 + (1.0 + (y * 0.5))) - sqrt(y));
} else if (y <= 2.1e+17) {
tmp = (1.0 / t_1) + (sqrt((1.0 + y)) + (1.0 - sqrt(y)));
} else {
tmp = 1.0 / (sqrt(x) + sqrt((1.0 + x)));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = sqrt((1.0d0 + z)) + sqrt(z)
if (y <= 4.4d-8) then
tmp = ((sqrt((1.0d0 + t)) - sqrt(t)) + (((1.0d0 + z) - z) / t_1)) + ((1.0d0 + (1.0d0 + (y * 0.5d0))) - sqrt(y))
else if (y <= 2.1d+17) then
tmp = (1.0d0 / t_1) + (sqrt((1.0d0 + y)) + (1.0d0 - sqrt(y)))
else
tmp = 1.0d0 / (sqrt(x) + sqrt((1.0d0 + x)))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + z)) + Math.sqrt(z);
double tmp;
if (y <= 4.4e-8) {
tmp = ((Math.sqrt((1.0 + t)) - Math.sqrt(t)) + (((1.0 + z) - z) / t_1)) + ((1.0 + (1.0 + (y * 0.5))) - Math.sqrt(y));
} else if (y <= 2.1e+17) {
tmp = (1.0 / t_1) + (Math.sqrt((1.0 + y)) + (1.0 - Math.sqrt(y)));
} else {
tmp = 1.0 / (Math.sqrt(x) + Math.sqrt((1.0 + x)));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + z)) + math.sqrt(z) tmp = 0 if y <= 4.4e-8: tmp = ((math.sqrt((1.0 + t)) - math.sqrt(t)) + (((1.0 + z) - z) / t_1)) + ((1.0 + (1.0 + (y * 0.5))) - math.sqrt(y)) elif y <= 2.1e+17: tmp = (1.0 / t_1) + (math.sqrt((1.0 + y)) + (1.0 - math.sqrt(y))) else: tmp = 1.0 / (math.sqrt(x) + math.sqrt((1.0 + x))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = Float64(sqrt(Float64(1.0 + z)) + sqrt(z)) tmp = 0.0 if (y <= 4.4e-8) tmp = Float64(Float64(Float64(sqrt(Float64(1.0 + t)) - sqrt(t)) + Float64(Float64(Float64(1.0 + z) - z) / t_1)) + Float64(Float64(1.0 + Float64(1.0 + Float64(y * 0.5))) - sqrt(y))); elseif (y <= 2.1e+17) tmp = Float64(Float64(1.0 / t_1) + Float64(sqrt(Float64(1.0 + y)) + Float64(1.0 - sqrt(y)))); else tmp = Float64(1.0 / Float64(sqrt(x) + sqrt(Float64(1.0 + x)))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + z)) + sqrt(z);
tmp = 0.0;
if (y <= 4.4e-8)
tmp = ((sqrt((1.0 + t)) - sqrt(t)) + (((1.0 + z) - z) / t_1)) + ((1.0 + (1.0 + (y * 0.5))) - sqrt(y));
elseif (y <= 2.1e+17)
tmp = (1.0 / t_1) + (sqrt((1.0 + y)) + (1.0 - sqrt(y)));
else
tmp = 1.0 / (sqrt(x) + sqrt((1.0 + x)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 4.4e-8], N[(N[(N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision] + N[(N[(N[(1.0 + z), $MachinePrecision] - z), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 + N[(1.0 + N[(y * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.1e+17], N[(N[(1.0 / t$95$1), $MachinePrecision] + N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] + N[(1.0 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + z} + \sqrt{z}\\
\mathbf{if}\;y \leq 4.4 \cdot 10^{-8}:\\
\;\;\;\;\left(\left(\sqrt{1 + t} - \sqrt{t}\right) + \frac{\left(1 + z\right) - z}{t_1}\right) + \left(\left(1 + \left(1 + y \cdot 0.5\right)\right) - \sqrt{y}\right)\\
\mathbf{elif}\;y \leq 2.1 \cdot 10^{+17}:\\
\;\;\;\;\frac{1}{t_1} + \left(\sqrt{1 + y} + \left(1 - \sqrt{y}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{x} + \sqrt{1 + x}}\\
\end{array}
\end{array}
if y < 4.3999999999999997e-8Initial program 97.8%
associate-+l+97.8%
associate-+l-58.5%
+-commutative58.5%
sub-neg58.5%
sub-neg58.5%
+-commutative58.5%
+-commutative58.5%
Simplified58.5%
Taylor expanded in x around 0 57.4%
flip--57.5%
add-sqr-sqrt44.6%
+-commutative44.6%
add-sqr-sqrt57.6%
+-commutative57.6%
Applied egg-rr57.6%
Taylor expanded in y around 0 57.6%
*-commutative57.6%
Simplified57.6%
if 4.3999999999999997e-8 < y < 2.1e17Initial program 88.7%
associate-+l+88.7%
associate-+l-73.4%
+-commutative73.4%
sub-neg73.4%
sub-neg73.4%
+-commutative73.4%
+-commutative73.4%
Simplified73.4%
Taylor expanded in x around 0 66.9%
Taylor expanded in t around inf 45.3%
+-commutative45.3%
flip--45.3%
add-sqr-sqrt44.7%
+-commutative44.7%
add-sqr-sqrt45.3%
+-commutative45.3%
div-inv45.3%
fma-def45.3%
associate--l+45.3%
+-commutative45.3%
associate--l+45.4%
Applied egg-rr45.4%
fma-udef45.4%
associate-+r-45.4%
+-commutative45.4%
associate--l+45.4%
+-inverses45.4%
metadata-eval45.4%
*-lft-identity45.4%
+-commutative45.4%
associate-+r-45.3%
+-commutative45.3%
associate--l+45.4%
Simplified45.4%
if 2.1e17 < y Initial program 84.8%
associate-+l+84.8%
+-commutative84.8%
associate-+r-84.8%
associate-+l-56.2%
+-commutative56.2%
associate--l+56.2%
+-commutative56.2%
Simplified36.0%
Taylor expanded in t around inf 31.4%
+-commutative31.4%
+-commutative31.4%
associate--l+33.6%
Simplified33.6%
Taylor expanded in z around inf 3.9%
associate--l+5.0%
+-commutative5.0%
Simplified5.0%
Taylor expanded in y around inf 22.7%
flip--22.9%
add-sqr-sqrt23.7%
+-commutative23.7%
add-sqr-sqrt24.1%
+-commutative24.1%
Applied egg-rr24.1%
+-commutative24.1%
associate--l+26.5%
+-inverses26.5%
metadata-eval26.5%
+-commutative26.5%
+-commutative26.5%
Simplified26.5%
Final simplification42.5%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ 1.0 z))))
(if (<= y 2.2e-55)
(+ (+ (- t_1 (sqrt z)) (- (sqrt (+ 1.0 t)) (sqrt t))) 2.0)
(if (<= y 2.1e+17)
(+ (/ 1.0 (+ t_1 (sqrt z))) (+ (sqrt (+ 1.0 y)) (- 1.0 (sqrt y))))
(/ 1.0 (+ (sqrt x) (sqrt (+ 1.0 x))))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + z));
double tmp;
if (y <= 2.2e-55) {
tmp = ((t_1 - sqrt(z)) + (sqrt((1.0 + t)) - sqrt(t))) + 2.0;
} else if (y <= 2.1e+17) {
tmp = (1.0 / (t_1 + sqrt(z))) + (sqrt((1.0 + y)) + (1.0 - sqrt(y)));
} else {
tmp = 1.0 / (sqrt(x) + sqrt((1.0 + x)));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = sqrt((1.0d0 + z))
if (y <= 2.2d-55) then
tmp = ((t_1 - sqrt(z)) + (sqrt((1.0d0 + t)) - sqrt(t))) + 2.0d0
else if (y <= 2.1d+17) then
tmp = (1.0d0 / (t_1 + sqrt(z))) + (sqrt((1.0d0 + y)) + (1.0d0 - sqrt(y)))
else
tmp = 1.0d0 / (sqrt(x) + sqrt((1.0d0 + x)))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + z));
double tmp;
if (y <= 2.2e-55) {
tmp = ((t_1 - Math.sqrt(z)) + (Math.sqrt((1.0 + t)) - Math.sqrt(t))) + 2.0;
} else if (y <= 2.1e+17) {
tmp = (1.0 / (t_1 + Math.sqrt(z))) + (Math.sqrt((1.0 + y)) + (1.0 - Math.sqrt(y)));
} else {
tmp = 1.0 / (Math.sqrt(x) + Math.sqrt((1.0 + x)));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + z)) tmp = 0 if y <= 2.2e-55: tmp = ((t_1 - math.sqrt(z)) + (math.sqrt((1.0 + t)) - math.sqrt(t))) + 2.0 elif y <= 2.1e+17: tmp = (1.0 / (t_1 + math.sqrt(z))) + (math.sqrt((1.0 + y)) + (1.0 - math.sqrt(y))) else: tmp = 1.0 / (math.sqrt(x) + math.sqrt((1.0 + x))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(1.0 + z)) tmp = 0.0 if (y <= 2.2e-55) tmp = Float64(Float64(Float64(t_1 - sqrt(z)) + Float64(sqrt(Float64(1.0 + t)) - sqrt(t))) + 2.0); elseif (y <= 2.1e+17) tmp = Float64(Float64(1.0 / Float64(t_1 + sqrt(z))) + Float64(sqrt(Float64(1.0 + y)) + Float64(1.0 - sqrt(y)))); else tmp = Float64(1.0 / Float64(sqrt(x) + sqrt(Float64(1.0 + x)))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + z));
tmp = 0.0;
if (y <= 2.2e-55)
tmp = ((t_1 - sqrt(z)) + (sqrt((1.0 + t)) - sqrt(t))) + 2.0;
elseif (y <= 2.1e+17)
tmp = (1.0 / (t_1 + sqrt(z))) + (sqrt((1.0 + y)) + (1.0 - sqrt(y)));
else
tmp = 1.0 / (sqrt(x) + sqrt((1.0 + x)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y, 2.2e-55], N[(N[(N[(t$95$1 - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision], If[LessEqual[y, 2.1e+17], N[(N[(1.0 / N[(t$95$1 + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] + N[(1.0 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + z}\\
\mathbf{if}\;y \leq 2.2 \cdot 10^{-55}:\\
\;\;\;\;\left(\left(t_1 - \sqrt{z}\right) + \left(\sqrt{1 + t} - \sqrt{t}\right)\right) + 2\\
\mathbf{elif}\;y \leq 2.1 \cdot 10^{+17}:\\
\;\;\;\;\frac{1}{t_1 + \sqrt{z}} + \left(\sqrt{1 + y} + \left(1 - \sqrt{y}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{x} + \sqrt{1 + x}}\\
\end{array}
\end{array}
if y < 2.2e-55Initial program 97.4%
associate-+l+97.4%
associate-+l-55.6%
+-commutative55.6%
sub-neg55.6%
sub-neg55.6%
+-commutative55.6%
+-commutative55.6%
Simplified55.6%
Taylor expanded in x around 0 54.1%
Taylor expanded in y around 0 54.1%
if 2.2e-55 < y < 2.1e17Initial program 95.6%
associate-+l+95.6%
associate-+l-73.7%
+-commutative73.7%
sub-neg73.7%
sub-neg73.7%
+-commutative73.7%
+-commutative73.7%
Simplified73.7%
Taylor expanded in x around 0 71.7%
Taylor expanded in t around inf 54.5%
+-commutative54.5%
flip--54.5%
add-sqr-sqrt47.9%
+-commutative47.9%
add-sqr-sqrt54.5%
+-commutative54.5%
div-inv54.5%
fma-def54.5%
associate--l+54.5%
+-commutative54.5%
associate--l+54.5%
Applied egg-rr54.5%
fma-udef54.5%
associate-+r-54.5%
+-commutative54.5%
associate--l+54.5%
+-inverses54.5%
metadata-eval54.5%
*-lft-identity54.5%
+-commutative54.5%
associate-+r-54.5%
+-commutative54.5%
associate--l+54.5%
Simplified54.5%
if 2.1e17 < y Initial program 84.8%
associate-+l+84.8%
+-commutative84.8%
associate-+r-84.8%
associate-+l-56.2%
+-commutative56.2%
associate--l+56.2%
+-commutative56.2%
Simplified36.0%
Taylor expanded in t around inf 31.4%
+-commutative31.4%
+-commutative31.4%
associate--l+33.6%
Simplified33.6%
Taylor expanded in z around inf 3.9%
associate--l+5.0%
+-commutative5.0%
Simplified5.0%
Taylor expanded in y around inf 22.7%
flip--22.9%
add-sqr-sqrt23.7%
+-commutative23.7%
add-sqr-sqrt24.1%
+-commutative24.1%
Applied egg-rr24.1%
+-commutative24.1%
associate--l+26.5%
+-inverses26.5%
metadata-eval26.5%
+-commutative26.5%
+-commutative26.5%
Simplified26.5%
Final simplification41.2%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (sqrt (+ 1.0 z)) (sqrt z))))
(if (<= y 2e-56)
(+ (+ t_1 (- (sqrt (+ 1.0 t)) (sqrt t))) 2.0)
(if (<= y 2.1e+17)
(+ t_1 (- (+ 1.0 (sqrt (+ 1.0 y))) (sqrt y)))
(/ 1.0 (+ (sqrt x) (sqrt (+ 1.0 x))))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + z)) - sqrt(z);
double tmp;
if (y <= 2e-56) {
tmp = (t_1 + (sqrt((1.0 + t)) - sqrt(t))) + 2.0;
} else if (y <= 2.1e+17) {
tmp = t_1 + ((1.0 + sqrt((1.0 + y))) - sqrt(y));
} else {
tmp = 1.0 / (sqrt(x) + sqrt((1.0 + x)));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = sqrt((1.0d0 + z)) - sqrt(z)
if (y <= 2d-56) then
tmp = (t_1 + (sqrt((1.0d0 + t)) - sqrt(t))) + 2.0d0
else if (y <= 2.1d+17) then
tmp = t_1 + ((1.0d0 + sqrt((1.0d0 + y))) - sqrt(y))
else
tmp = 1.0d0 / (sqrt(x) + sqrt((1.0d0 + x)))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + z)) - Math.sqrt(z);
double tmp;
if (y <= 2e-56) {
tmp = (t_1 + (Math.sqrt((1.0 + t)) - Math.sqrt(t))) + 2.0;
} else if (y <= 2.1e+17) {
tmp = t_1 + ((1.0 + Math.sqrt((1.0 + y))) - Math.sqrt(y));
} else {
tmp = 1.0 / (Math.sqrt(x) + Math.sqrt((1.0 + x)));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + z)) - math.sqrt(z) tmp = 0 if y <= 2e-56: tmp = (t_1 + (math.sqrt((1.0 + t)) - math.sqrt(t))) + 2.0 elif y <= 2.1e+17: tmp = t_1 + ((1.0 + math.sqrt((1.0 + y))) - math.sqrt(y)) else: tmp = 1.0 / (math.sqrt(x) + math.sqrt((1.0 + x))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = Float64(sqrt(Float64(1.0 + z)) - sqrt(z)) tmp = 0.0 if (y <= 2e-56) tmp = Float64(Float64(t_1 + Float64(sqrt(Float64(1.0 + t)) - sqrt(t))) + 2.0); elseif (y <= 2.1e+17) tmp = Float64(t_1 + Float64(Float64(1.0 + sqrt(Float64(1.0 + y))) - sqrt(y))); else tmp = Float64(1.0 / Float64(sqrt(x) + sqrt(Float64(1.0 + x)))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + z)) - sqrt(z);
tmp = 0.0;
if (y <= 2e-56)
tmp = (t_1 + (sqrt((1.0 + t)) - sqrt(t))) + 2.0;
elseif (y <= 2.1e+17)
tmp = t_1 + ((1.0 + sqrt((1.0 + y))) - sqrt(y));
else
tmp = 1.0 / (sqrt(x) + sqrt((1.0 + x)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 2e-56], N[(N[(t$95$1 + N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision], If[LessEqual[y, 2.1e+17], N[(t$95$1 + N[(N[(1.0 + N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + z} - \sqrt{z}\\
\mathbf{if}\;y \leq 2 \cdot 10^{-56}:\\
\;\;\;\;\left(t_1 + \left(\sqrt{1 + t} - \sqrt{t}\right)\right) + 2\\
\mathbf{elif}\;y \leq 2.1 \cdot 10^{+17}:\\
\;\;\;\;t_1 + \left(\left(1 + \sqrt{1 + y}\right) - \sqrt{y}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{x} + \sqrt{1 + x}}\\
\end{array}
\end{array}
if y < 2.0000000000000001e-56Initial program 97.4%
associate-+l+97.4%
associate-+l-55.6%
+-commutative55.6%
sub-neg55.6%
sub-neg55.6%
+-commutative55.6%
+-commutative55.6%
Simplified55.6%
Taylor expanded in x around 0 54.1%
Taylor expanded in y around 0 54.1%
if 2.0000000000000001e-56 < y < 2.1e17Initial program 95.6%
associate-+l+95.6%
associate-+l-73.7%
+-commutative73.7%
sub-neg73.7%
sub-neg73.7%
+-commutative73.7%
+-commutative73.7%
Simplified73.7%
Taylor expanded in x around 0 71.7%
Taylor expanded in t around inf 54.5%
if 2.1e17 < y Initial program 84.8%
associate-+l+84.8%
+-commutative84.8%
associate-+r-84.8%
associate-+l-56.2%
+-commutative56.2%
associate--l+56.2%
+-commutative56.2%
Simplified36.0%
Taylor expanded in t around inf 31.4%
+-commutative31.4%
+-commutative31.4%
associate--l+33.6%
Simplified33.6%
Taylor expanded in z around inf 3.9%
associate--l+5.0%
+-commutative5.0%
Simplified5.0%
Taylor expanded in y around inf 22.7%
flip--22.9%
add-sqr-sqrt23.7%
+-commutative23.7%
add-sqr-sqrt24.1%
+-commutative24.1%
Applied egg-rr24.1%
+-commutative24.1%
associate--l+26.5%
+-inverses26.5%
metadata-eval26.5%
+-commutative26.5%
+-commutative26.5%
Simplified26.5%
Final simplification41.2%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ 1.0 x))))
(if (<= y 5.5e-7)
(+
(/ (- (+ 1.0 z) z) (+ (sqrt (+ 1.0 z)) (sqrt z)))
(- (+ 1.0 (+ 1.0 (* y 0.5))) (sqrt y)))
(if (<= y 1.45e+16)
(+ (sqrt (+ 1.0 y)) (- t_1 (+ (sqrt y) (sqrt x))))
(/ 1.0 (+ (sqrt x) t_1))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + x));
double tmp;
if (y <= 5.5e-7) {
tmp = (((1.0 + z) - z) / (sqrt((1.0 + z)) + sqrt(z))) + ((1.0 + (1.0 + (y * 0.5))) - sqrt(y));
} else if (y <= 1.45e+16) {
tmp = sqrt((1.0 + y)) + (t_1 - (sqrt(y) + sqrt(x)));
} else {
tmp = 1.0 / (sqrt(x) + t_1);
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = sqrt((1.0d0 + x))
if (y <= 5.5d-7) then
tmp = (((1.0d0 + z) - z) / (sqrt((1.0d0 + z)) + sqrt(z))) + ((1.0d0 + (1.0d0 + (y * 0.5d0))) - sqrt(y))
else if (y <= 1.45d+16) then
tmp = sqrt((1.0d0 + y)) + (t_1 - (sqrt(y) + sqrt(x)))
else
tmp = 1.0d0 / (sqrt(x) + t_1)
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + x));
double tmp;
if (y <= 5.5e-7) {
tmp = (((1.0 + z) - z) / (Math.sqrt((1.0 + z)) + Math.sqrt(z))) + ((1.0 + (1.0 + (y * 0.5))) - Math.sqrt(y));
} else if (y <= 1.45e+16) {
tmp = Math.sqrt((1.0 + y)) + (t_1 - (Math.sqrt(y) + Math.sqrt(x)));
} else {
tmp = 1.0 / (Math.sqrt(x) + t_1);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + x)) tmp = 0 if y <= 5.5e-7: tmp = (((1.0 + z) - z) / (math.sqrt((1.0 + z)) + math.sqrt(z))) + ((1.0 + (1.0 + (y * 0.5))) - math.sqrt(y)) elif y <= 1.45e+16: tmp = math.sqrt((1.0 + y)) + (t_1 - (math.sqrt(y) + math.sqrt(x))) else: tmp = 1.0 / (math.sqrt(x) + t_1) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(1.0 + x)) tmp = 0.0 if (y <= 5.5e-7) tmp = Float64(Float64(Float64(Float64(1.0 + z) - z) / Float64(sqrt(Float64(1.0 + z)) + sqrt(z))) + Float64(Float64(1.0 + Float64(1.0 + Float64(y * 0.5))) - sqrt(y))); elseif (y <= 1.45e+16) tmp = Float64(sqrt(Float64(1.0 + y)) + Float64(t_1 - Float64(sqrt(y) + sqrt(x)))); else tmp = Float64(1.0 / Float64(sqrt(x) + t_1)); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + x));
tmp = 0.0;
if (y <= 5.5e-7)
tmp = (((1.0 + z) - z) / (sqrt((1.0 + z)) + sqrt(z))) + ((1.0 + (1.0 + (y * 0.5))) - sqrt(y));
elseif (y <= 1.45e+16)
tmp = sqrt((1.0 + y)) + (t_1 - (sqrt(y) + sqrt(x)));
else
tmp = 1.0 / (sqrt(x) + t_1);
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y, 5.5e-7], N[(N[(N[(N[(1.0 + z), $MachinePrecision] - z), $MachinePrecision] / N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 + N[(1.0 + N[(y * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.45e+16], N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] + N[(t$95$1 - N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + x}\\
\mathbf{if}\;y \leq 5.5 \cdot 10^{-7}:\\
\;\;\;\;\frac{\left(1 + z\right) - z}{\sqrt{1 + z} + \sqrt{z}} + \left(\left(1 + \left(1 + y \cdot 0.5\right)\right) - \sqrt{y}\right)\\
\mathbf{elif}\;y \leq 1.45 \cdot 10^{+16}:\\
\;\;\;\;\sqrt{1 + y} + \left(t_1 - \left(\sqrt{y} + \sqrt{x}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{x} + t_1}\\
\end{array}
\end{array}
if y < 5.5000000000000003e-7Initial program 97.8%
associate-+l+97.8%
associate-+l-58.5%
+-commutative58.5%
sub-neg58.5%
sub-neg58.5%
+-commutative58.5%
+-commutative58.5%
Simplified58.5%
Taylor expanded in x around 0 57.4%
Taylor expanded in t around inf 53.8%
Taylor expanded in y around 0 53.8%
*-commutative57.6%
Simplified53.8%
flip--57.5%
add-sqr-sqrt44.6%
+-commutative44.6%
add-sqr-sqrt57.6%
+-commutative57.6%
Applied egg-rr54.0%
if 5.5000000000000003e-7 < y < 1.45e16Initial program 88.7%
associate-+l+88.7%
+-commutative88.7%
associate-+r-73.4%
associate-+l-67.3%
+-commutative67.3%
associate--l+67.3%
+-commutative67.3%
Simplified48.6%
Taylor expanded in t around inf 32.2%
+-commutative32.2%
+-commutative32.2%
associate--l+32.2%
Simplified32.2%
Taylor expanded in z around inf 15.6%
associate--l+18.7%
+-commutative18.7%
Simplified18.7%
if 1.45e16 < y Initial program 84.8%
associate-+l+84.8%
+-commutative84.8%
associate-+r-84.8%
associate-+l-56.2%
+-commutative56.2%
associate--l+56.2%
+-commutative56.2%
Simplified36.0%
Taylor expanded in t around inf 31.4%
+-commutative31.4%
+-commutative31.4%
associate--l+33.6%
Simplified33.6%
Taylor expanded in z around inf 3.9%
associate--l+5.0%
+-commutative5.0%
Simplified5.0%
Taylor expanded in y around inf 22.7%
flip--22.9%
add-sqr-sqrt23.7%
+-commutative23.7%
add-sqr-sqrt24.1%
+-commutative24.1%
Applied egg-rr24.1%
+-commutative24.1%
associate--l+26.5%
+-inverses26.5%
metadata-eval26.5%
+-commutative26.5%
+-commutative26.5%
Simplified26.5%
Final simplification39.5%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ 1.0 x))))
(if (<= y 3.6e-37)
(+ (+ (- (sqrt (+ 1.0 z)) (sqrt z)) (- (sqrt (+ 1.0 t)) (sqrt t))) 2.0)
(if (<= y 5e+16)
(+ (sqrt (+ 1.0 y)) (- t_1 (+ (sqrt y) (sqrt x))))
(/ 1.0 (+ (sqrt x) t_1))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + x));
double tmp;
if (y <= 3.6e-37) {
tmp = ((sqrt((1.0 + z)) - sqrt(z)) + (sqrt((1.0 + t)) - sqrt(t))) + 2.0;
} else if (y <= 5e+16) {
tmp = sqrt((1.0 + y)) + (t_1 - (sqrt(y) + sqrt(x)));
} else {
tmp = 1.0 / (sqrt(x) + t_1);
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = sqrt((1.0d0 + x))
if (y <= 3.6d-37) then
tmp = ((sqrt((1.0d0 + z)) - sqrt(z)) + (sqrt((1.0d0 + t)) - sqrt(t))) + 2.0d0
else if (y <= 5d+16) then
tmp = sqrt((1.0d0 + y)) + (t_1 - (sqrt(y) + sqrt(x)))
else
tmp = 1.0d0 / (sqrt(x) + t_1)
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + x));
double tmp;
if (y <= 3.6e-37) {
tmp = ((Math.sqrt((1.0 + z)) - Math.sqrt(z)) + (Math.sqrt((1.0 + t)) - Math.sqrt(t))) + 2.0;
} else if (y <= 5e+16) {
tmp = Math.sqrt((1.0 + y)) + (t_1 - (Math.sqrt(y) + Math.sqrt(x)));
} else {
tmp = 1.0 / (Math.sqrt(x) + t_1);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + x)) tmp = 0 if y <= 3.6e-37: tmp = ((math.sqrt((1.0 + z)) - math.sqrt(z)) + (math.sqrt((1.0 + t)) - math.sqrt(t))) + 2.0 elif y <= 5e+16: tmp = math.sqrt((1.0 + y)) + (t_1 - (math.sqrt(y) + math.sqrt(x))) else: tmp = 1.0 / (math.sqrt(x) + t_1) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(1.0 + x)) tmp = 0.0 if (y <= 3.6e-37) tmp = Float64(Float64(Float64(sqrt(Float64(1.0 + z)) - sqrt(z)) + Float64(sqrt(Float64(1.0 + t)) - sqrt(t))) + 2.0); elseif (y <= 5e+16) tmp = Float64(sqrt(Float64(1.0 + y)) + Float64(t_1 - Float64(sqrt(y) + sqrt(x)))); else tmp = Float64(1.0 / Float64(sqrt(x) + t_1)); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + x));
tmp = 0.0;
if (y <= 3.6e-37)
tmp = ((sqrt((1.0 + z)) - sqrt(z)) + (sqrt((1.0 + t)) - sqrt(t))) + 2.0;
elseif (y <= 5e+16)
tmp = sqrt((1.0 + y)) + (t_1 - (sqrt(y) + sqrt(x)));
else
tmp = 1.0 / (sqrt(x) + t_1);
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y, 3.6e-37], N[(N[(N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision], If[LessEqual[y, 5e+16], N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] + N[(t$95$1 - N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + x}\\
\mathbf{if}\;y \leq 3.6 \cdot 10^{-37}:\\
\;\;\;\;\left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\sqrt{1 + t} - \sqrt{t}\right)\right) + 2\\
\mathbf{elif}\;y \leq 5 \cdot 10^{+16}:\\
\;\;\;\;\sqrt{1 + y} + \left(t_1 - \left(\sqrt{y} + \sqrt{x}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{x} + t_1}\\
\end{array}
\end{array}
if y < 3.60000000000000007e-37Initial program 97.6%
associate-+l+97.6%
associate-+l-56.5%
+-commutative56.5%
sub-neg56.5%
sub-neg56.5%
+-commutative56.5%
+-commutative56.5%
Simplified56.5%
Taylor expanded in x around 0 55.1%
Taylor expanded in y around 0 55.1%
if 3.60000000000000007e-37 < y < 5e16Initial program 93.5%
associate-+l+93.5%
+-commutative93.5%
associate-+r-77.1%
associate-+l-73.0%
+-commutative73.0%
associate--l+73.0%
+-commutative73.0%
Simplified55.1%
Taylor expanded in t around inf 46.9%
+-commutative46.9%
+-commutative46.9%
associate--l+46.9%
Simplified46.9%
Taylor expanded in z around inf 30.7%
associate--l+37.4%
+-commutative37.4%
Simplified37.4%
if 5e16 < y Initial program 84.8%
associate-+l+84.8%
+-commutative84.8%
associate-+r-84.8%
associate-+l-56.2%
+-commutative56.2%
associate--l+56.2%
+-commutative56.2%
Simplified36.0%
Taylor expanded in t around inf 31.4%
+-commutative31.4%
+-commutative31.4%
associate--l+33.6%
Simplified33.6%
Taylor expanded in z around inf 3.9%
associate--l+5.0%
+-commutative5.0%
Simplified5.0%
Taylor expanded in y around inf 22.7%
flip--22.9%
add-sqr-sqrt23.7%
+-commutative23.7%
add-sqr-sqrt24.1%
+-commutative24.1%
Applied egg-rr24.1%
+-commutative24.1%
associate--l+26.5%
+-inverses26.5%
metadata-eval26.5%
+-commutative26.5%
+-commutative26.5%
Simplified26.5%
Final simplification40.2%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(if (<= y 5.5e-7)
(+
(/ (- (+ 1.0 z) z) (+ (sqrt (+ 1.0 z)) (sqrt z)))
(- (+ 1.0 (+ 1.0 (* y 0.5))) (sqrt y)))
(if (<= y 1.8e+17)
(+ 1.0 (- (sqrt (+ 1.0 y)) (sqrt y)))
(/ 1.0 (+ (sqrt x) (sqrt (+ 1.0 x)))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 5.5e-7) {
tmp = (((1.0 + z) - z) / (sqrt((1.0 + z)) + sqrt(z))) + ((1.0 + (1.0 + (y * 0.5))) - sqrt(y));
} else if (y <= 1.8e+17) {
tmp = 1.0 + (sqrt((1.0 + y)) - sqrt(y));
} else {
tmp = 1.0 / (sqrt(x) + sqrt((1.0 + x)));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= 5.5d-7) then
tmp = (((1.0d0 + z) - z) / (sqrt((1.0d0 + z)) + sqrt(z))) + ((1.0d0 + (1.0d0 + (y * 0.5d0))) - sqrt(y))
else if (y <= 1.8d+17) then
tmp = 1.0d0 + (sqrt((1.0d0 + y)) - sqrt(y))
else
tmp = 1.0d0 / (sqrt(x) + sqrt((1.0d0 + x)))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= 5.5e-7) {
tmp = (((1.0 + z) - z) / (Math.sqrt((1.0 + z)) + Math.sqrt(z))) + ((1.0 + (1.0 + (y * 0.5))) - Math.sqrt(y));
} else if (y <= 1.8e+17) {
tmp = 1.0 + (Math.sqrt((1.0 + y)) - Math.sqrt(y));
} else {
tmp = 1.0 / (Math.sqrt(x) + Math.sqrt((1.0 + x)));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if y <= 5.5e-7: tmp = (((1.0 + z) - z) / (math.sqrt((1.0 + z)) + math.sqrt(z))) + ((1.0 + (1.0 + (y * 0.5))) - math.sqrt(y)) elif y <= 1.8e+17: tmp = 1.0 + (math.sqrt((1.0 + y)) - math.sqrt(y)) else: tmp = 1.0 / (math.sqrt(x) + math.sqrt((1.0 + x))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (y <= 5.5e-7) tmp = Float64(Float64(Float64(Float64(1.0 + z) - z) / Float64(sqrt(Float64(1.0 + z)) + sqrt(z))) + Float64(Float64(1.0 + Float64(1.0 + Float64(y * 0.5))) - sqrt(y))); elseif (y <= 1.8e+17) tmp = Float64(1.0 + Float64(sqrt(Float64(1.0 + y)) - sqrt(y))); else tmp = Float64(1.0 / Float64(sqrt(x) + sqrt(Float64(1.0 + x)))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (y <= 5.5e-7)
tmp = (((1.0 + z) - z) / (sqrt((1.0 + z)) + sqrt(z))) + ((1.0 + (1.0 + (y * 0.5))) - sqrt(y));
elseif (y <= 1.8e+17)
tmp = 1.0 + (sqrt((1.0 + y)) - sqrt(y));
else
tmp = 1.0 / (sqrt(x) + sqrt((1.0 + x)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[y, 5.5e-7], N[(N[(N[(N[(1.0 + z), $MachinePrecision] - z), $MachinePrecision] / N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 + N[(1.0 + N[(y * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.8e+17], N[(1.0 + N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 5.5 \cdot 10^{-7}:\\
\;\;\;\;\frac{\left(1 + z\right) - z}{\sqrt{1 + z} + \sqrt{z}} + \left(\left(1 + \left(1 + y \cdot 0.5\right)\right) - \sqrt{y}\right)\\
\mathbf{elif}\;y \leq 1.8 \cdot 10^{+17}:\\
\;\;\;\;1 + \left(\sqrt{1 + y} - \sqrt{y}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{x} + \sqrt{1 + x}}\\
\end{array}
\end{array}
if y < 5.5000000000000003e-7Initial program 97.8%
associate-+l+97.8%
associate-+l-58.5%
+-commutative58.5%
sub-neg58.5%
sub-neg58.5%
+-commutative58.5%
+-commutative58.5%
Simplified58.5%
Taylor expanded in x around 0 57.4%
Taylor expanded in t around inf 53.8%
Taylor expanded in y around 0 53.8%
*-commutative57.6%
Simplified53.8%
flip--57.5%
add-sqr-sqrt44.6%
+-commutative44.6%
add-sqr-sqrt57.6%
+-commutative57.6%
Applied egg-rr54.0%
if 5.5000000000000003e-7 < y < 1.8e17Initial program 88.7%
associate-+l+88.7%
+-commutative88.7%
associate-+r-73.4%
associate-+l-67.3%
+-commutative67.3%
associate--l+67.3%
+-commutative67.3%
Simplified48.6%
Taylor expanded in t around inf 32.2%
+-commutative32.2%
+-commutative32.2%
associate--l+32.2%
Simplified32.2%
Taylor expanded in z around inf 15.6%
associate--l+18.7%
+-commutative18.7%
Simplified18.7%
Taylor expanded in x around 0 21.6%
associate-+r-21.6%
Simplified21.6%
if 1.8e17 < y Initial program 84.8%
associate-+l+84.8%
+-commutative84.8%
associate-+r-84.8%
associate-+l-56.2%
+-commutative56.2%
associate--l+56.2%
+-commutative56.2%
Simplified36.0%
Taylor expanded in t around inf 31.4%
+-commutative31.4%
+-commutative31.4%
associate--l+33.6%
Simplified33.6%
Taylor expanded in z around inf 3.9%
associate--l+5.0%
+-commutative5.0%
Simplified5.0%
Taylor expanded in y around inf 22.7%
flip--22.9%
add-sqr-sqrt23.7%
+-commutative23.7%
add-sqr-sqrt24.1%
+-commutative24.1%
Applied egg-rr24.1%
+-commutative24.1%
associate--l+26.5%
+-inverses26.5%
metadata-eval26.5%
+-commutative26.5%
+-commutative26.5%
Simplified26.5%
Final simplification39.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 (<= y 6.5e-7)
(+ (- (sqrt (+ 1.0 z)) (sqrt z)) (- (+ 1.0 (+ 1.0 (* y 0.5))) (sqrt y)))
(if (<= y 5.5e+15)
(+ 1.0 (- (sqrt (+ 1.0 y)) (sqrt y)))
(/ 1.0 (+ (sqrt x) (sqrt (+ 1.0 x)))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 6.5e-7) {
tmp = (sqrt((1.0 + z)) - sqrt(z)) + ((1.0 + (1.0 + (y * 0.5))) - sqrt(y));
} else if (y <= 5.5e+15) {
tmp = 1.0 + (sqrt((1.0 + y)) - sqrt(y));
} else {
tmp = 1.0 / (sqrt(x) + sqrt((1.0 + x)));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= 6.5d-7) then
tmp = (sqrt((1.0d0 + z)) - sqrt(z)) + ((1.0d0 + (1.0d0 + (y * 0.5d0))) - sqrt(y))
else if (y <= 5.5d+15) then
tmp = 1.0d0 + (sqrt((1.0d0 + y)) - sqrt(y))
else
tmp = 1.0d0 / (sqrt(x) + sqrt((1.0d0 + x)))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= 6.5e-7) {
tmp = (Math.sqrt((1.0 + z)) - Math.sqrt(z)) + ((1.0 + (1.0 + (y * 0.5))) - Math.sqrt(y));
} else if (y <= 5.5e+15) {
tmp = 1.0 + (Math.sqrt((1.0 + y)) - Math.sqrt(y));
} else {
tmp = 1.0 / (Math.sqrt(x) + Math.sqrt((1.0 + x)));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if y <= 6.5e-7: tmp = (math.sqrt((1.0 + z)) - math.sqrt(z)) + ((1.0 + (1.0 + (y * 0.5))) - math.sqrt(y)) elif y <= 5.5e+15: tmp = 1.0 + (math.sqrt((1.0 + y)) - math.sqrt(y)) else: tmp = 1.0 / (math.sqrt(x) + math.sqrt((1.0 + x))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (y <= 6.5e-7) tmp = Float64(Float64(sqrt(Float64(1.0 + z)) - sqrt(z)) + Float64(Float64(1.0 + Float64(1.0 + Float64(y * 0.5))) - sqrt(y))); elseif (y <= 5.5e+15) tmp = Float64(1.0 + Float64(sqrt(Float64(1.0 + y)) - sqrt(y))); else tmp = Float64(1.0 / Float64(sqrt(x) + sqrt(Float64(1.0 + x)))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (y <= 6.5e-7)
tmp = (sqrt((1.0 + z)) - sqrt(z)) + ((1.0 + (1.0 + (y * 0.5))) - sqrt(y));
elseif (y <= 5.5e+15)
tmp = 1.0 + (sqrt((1.0 + y)) - sqrt(y));
else
tmp = 1.0 / (sqrt(x) + sqrt((1.0 + x)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[y, 6.5e-7], N[(N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 + N[(1.0 + N[(y * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 5.5e+15], N[(1.0 + N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 6.5 \cdot 10^{-7}:\\
\;\;\;\;\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\left(1 + \left(1 + y \cdot 0.5\right)\right) - \sqrt{y}\right)\\
\mathbf{elif}\;y \leq 5.5 \cdot 10^{+15}:\\
\;\;\;\;1 + \left(\sqrt{1 + y} - \sqrt{y}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{x} + \sqrt{1 + x}}\\
\end{array}
\end{array}
if y < 6.50000000000000024e-7Initial program 97.8%
associate-+l+97.8%
associate-+l-58.9%
+-commutative58.9%
sub-neg58.9%
sub-neg58.9%
+-commutative58.9%
+-commutative58.9%
Simplified58.9%
Taylor expanded in x around 0 57.8%
Taylor expanded in t around inf 53.5%
Taylor expanded in y around 0 53.5%
*-commutative57.9%
Simplified53.5%
if 6.50000000000000024e-7 < y < 5.5e15Initial program 87.7%
associate-+l+87.7%
+-commutative87.7%
associate-+r-71.0%
associate-+l-64.3%
+-commutative64.3%
associate--l+64.3%
+-commutative64.3%
Simplified51.2%
Taylor expanded in t around inf 33.3%
+-commutative33.3%
+-commutative33.3%
associate--l+33.3%
Simplified33.3%
Taylor expanded in z around inf 15.1%
associate--l+18.6%
+-commutative18.6%
Simplified18.6%
Taylor expanded in x around 0 21.7%
associate-+r-21.7%
Simplified21.7%
if 5.5e15 < y Initial program 84.8%
associate-+l+84.8%
+-commutative84.8%
associate-+r-84.8%
associate-+l-56.2%
+-commutative56.2%
associate--l+56.2%
+-commutative56.2%
Simplified36.0%
Taylor expanded in t around inf 31.4%
+-commutative31.4%
+-commutative31.4%
associate--l+33.6%
Simplified33.6%
Taylor expanded in z around inf 3.9%
associate--l+5.0%
+-commutative5.0%
Simplified5.0%
Taylor expanded in y around inf 22.7%
flip--22.9%
add-sqr-sqrt23.7%
+-commutative23.7%
add-sqr-sqrt24.1%
+-commutative24.1%
Applied egg-rr24.1%
+-commutative24.1%
associate--l+26.5%
+-inverses26.5%
metadata-eval26.5%
+-commutative26.5%
+-commutative26.5%
Simplified26.5%
Final simplification39.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 6.2e-7)
(+ (+ (* y 0.5) 2.0) (- (- (sqrt (+ 1.0 z)) (sqrt z)) (sqrt y)))
(if (<= y 5.2e+15)
(+ 1.0 (- (sqrt (+ 1.0 y)) (sqrt y)))
(/ 1.0 (+ (sqrt x) (sqrt (+ 1.0 x)))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 6.2e-7) {
tmp = ((y * 0.5) + 2.0) + ((sqrt((1.0 + z)) - sqrt(z)) - sqrt(y));
} else if (y <= 5.2e+15) {
tmp = 1.0 + (sqrt((1.0 + y)) - sqrt(y));
} else {
tmp = 1.0 / (sqrt(x) + sqrt((1.0 + x)));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= 6.2d-7) then
tmp = ((y * 0.5d0) + 2.0d0) + ((sqrt((1.0d0 + z)) - sqrt(z)) - sqrt(y))
else if (y <= 5.2d+15) then
tmp = 1.0d0 + (sqrt((1.0d0 + y)) - sqrt(y))
else
tmp = 1.0d0 / (sqrt(x) + sqrt((1.0d0 + x)))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= 6.2e-7) {
tmp = ((y * 0.5) + 2.0) + ((Math.sqrt((1.0 + z)) - Math.sqrt(z)) - Math.sqrt(y));
} else if (y <= 5.2e+15) {
tmp = 1.0 + (Math.sqrt((1.0 + y)) - Math.sqrt(y));
} else {
tmp = 1.0 / (Math.sqrt(x) + Math.sqrt((1.0 + x)));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if y <= 6.2e-7: tmp = ((y * 0.5) + 2.0) + ((math.sqrt((1.0 + z)) - math.sqrt(z)) - math.sqrt(y)) elif y <= 5.2e+15: tmp = 1.0 + (math.sqrt((1.0 + y)) - math.sqrt(y)) else: tmp = 1.0 / (math.sqrt(x) + math.sqrt((1.0 + x))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (y <= 6.2e-7) tmp = Float64(Float64(Float64(y * 0.5) + 2.0) + Float64(Float64(sqrt(Float64(1.0 + z)) - sqrt(z)) - sqrt(y))); elseif (y <= 5.2e+15) tmp = Float64(1.0 + Float64(sqrt(Float64(1.0 + y)) - sqrt(y))); else tmp = Float64(1.0 / Float64(sqrt(x) + sqrt(Float64(1.0 + x)))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (y <= 6.2e-7)
tmp = ((y * 0.5) + 2.0) + ((sqrt((1.0 + z)) - sqrt(z)) - sqrt(y));
elseif (y <= 5.2e+15)
tmp = 1.0 + (sqrt((1.0 + y)) - sqrt(y));
else
tmp = 1.0 / (sqrt(x) + sqrt((1.0 + x)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[y, 6.2e-7], N[(N[(N[(y * 0.5), $MachinePrecision] + 2.0), $MachinePrecision] + N[(N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 5.2e+15], N[(1.0 + N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 6.2 \cdot 10^{-7}:\\
\;\;\;\;\left(y \cdot 0.5 + 2\right) + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) - \sqrt{y}\right)\\
\mathbf{elif}\;y \leq 5.2 \cdot 10^{+15}:\\
\;\;\;\;1 + \left(\sqrt{1 + y} - \sqrt{y}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{x} + \sqrt{1 + x}}\\
\end{array}
\end{array}
if y < 6.1999999999999999e-7Initial program 97.8%
associate-+l+97.8%
associate-+l-58.9%
+-commutative58.9%
sub-neg58.9%
sub-neg58.9%
+-commutative58.9%
+-commutative58.9%
Simplified58.9%
Taylor expanded in x around 0 57.8%
Taylor expanded in t around inf 53.5%
Taylor expanded in y around 0 53.5%
*-commutative57.9%
Simplified53.5%
associate-+l-53.5%
associate-+r+53.5%
metadata-eval53.5%
Applied egg-rr53.5%
if 6.1999999999999999e-7 < y < 5.2e15Initial program 87.7%
associate-+l+87.7%
+-commutative87.7%
associate-+r-71.0%
associate-+l-64.3%
+-commutative64.3%
associate--l+64.3%
+-commutative64.3%
Simplified51.2%
Taylor expanded in t around inf 33.3%
+-commutative33.3%
+-commutative33.3%
associate--l+33.3%
Simplified33.3%
Taylor expanded in z around inf 15.1%
associate--l+18.6%
+-commutative18.6%
Simplified18.6%
Taylor expanded in x around 0 21.7%
associate-+r-21.7%
Simplified21.7%
if 5.2e15 < y Initial program 84.8%
associate-+l+84.8%
+-commutative84.8%
associate-+r-84.8%
associate-+l-56.2%
+-commutative56.2%
associate--l+56.2%
+-commutative56.2%
Simplified36.0%
Taylor expanded in t around inf 31.4%
+-commutative31.4%
+-commutative31.4%
associate--l+33.6%
Simplified33.6%
Taylor expanded in z around inf 3.9%
associate--l+5.0%
+-commutative5.0%
Simplified5.0%
Taylor expanded in y around inf 22.7%
flip--22.9%
add-sqr-sqrt23.7%
+-commutative23.7%
add-sqr-sqrt24.1%
+-commutative24.1%
Applied egg-rr24.1%
+-commutative24.1%
associate--l+26.5%
+-inverses26.5%
metadata-eval26.5%
+-commutative26.5%
+-commutative26.5%
Simplified26.5%
Final simplification39.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 6.1e-37)
(+ (- (sqrt (+ 1.0 z)) (sqrt z)) 2.0)
(if (<= y 6.4e+15)
(+ 1.0 (- (sqrt (+ 1.0 y)) (sqrt y)))
(/ 1.0 (+ (sqrt x) (sqrt (+ 1.0 x)))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 6.1e-37) {
tmp = (sqrt((1.0 + z)) - sqrt(z)) + 2.0;
} else if (y <= 6.4e+15) {
tmp = 1.0 + (sqrt((1.0 + y)) - sqrt(y));
} else {
tmp = 1.0 / (sqrt(x) + sqrt((1.0 + x)));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= 6.1d-37) then
tmp = (sqrt((1.0d0 + z)) - sqrt(z)) + 2.0d0
else if (y <= 6.4d+15) then
tmp = 1.0d0 + (sqrt((1.0d0 + y)) - sqrt(y))
else
tmp = 1.0d0 / (sqrt(x) + sqrt((1.0d0 + x)))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= 6.1e-37) {
tmp = (Math.sqrt((1.0 + z)) - Math.sqrt(z)) + 2.0;
} else if (y <= 6.4e+15) {
tmp = 1.0 + (Math.sqrt((1.0 + y)) - Math.sqrt(y));
} else {
tmp = 1.0 / (Math.sqrt(x) + Math.sqrt((1.0 + x)));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if y <= 6.1e-37: tmp = (math.sqrt((1.0 + z)) - math.sqrt(z)) + 2.0 elif y <= 6.4e+15: tmp = 1.0 + (math.sqrt((1.0 + y)) - math.sqrt(y)) else: tmp = 1.0 / (math.sqrt(x) + math.sqrt((1.0 + x))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (y <= 6.1e-37) tmp = Float64(Float64(sqrt(Float64(1.0 + z)) - sqrt(z)) + 2.0); elseif (y <= 6.4e+15) tmp = Float64(1.0 + Float64(sqrt(Float64(1.0 + y)) - sqrt(y))); else tmp = Float64(1.0 / Float64(sqrt(x) + sqrt(Float64(1.0 + x)))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (y <= 6.1e-37)
tmp = (sqrt((1.0 + z)) - sqrt(z)) + 2.0;
elseif (y <= 6.4e+15)
tmp = 1.0 + (sqrt((1.0 + y)) - sqrt(y));
else
tmp = 1.0 / (sqrt(x) + sqrt((1.0 + x)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[y, 6.1e-37], N[(N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision], If[LessEqual[y, 6.4e+15], N[(1.0 + N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 6.1 \cdot 10^{-37}:\\
\;\;\;\;\left(\sqrt{1 + z} - \sqrt{z}\right) + 2\\
\mathbf{elif}\;y \leq 6.4 \cdot 10^{+15}:\\
\;\;\;\;1 + \left(\sqrt{1 + y} - \sqrt{y}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{x} + \sqrt{1 + x}}\\
\end{array}
\end{array}
if y < 6.1000000000000003e-37Initial program 97.6%
associate-+l+97.6%
associate-+l-56.5%
+-commutative56.5%
sub-neg56.5%
sub-neg56.5%
+-commutative56.5%
+-commutative56.5%
Simplified56.5%
Taylor expanded in x around 0 55.1%
Taylor expanded in t around inf 52.6%
Taylor expanded in y around 0 30.5%
associate--l+52.6%
Simplified52.6%
if 6.1000000000000003e-37 < y < 6.4e15Initial program 93.5%
associate-+l+93.5%
+-commutative93.5%
associate-+r-77.1%
associate-+l-73.0%
+-commutative73.0%
associate--l+73.0%
+-commutative73.0%
Simplified55.1%
Taylor expanded in t around inf 46.9%
+-commutative46.9%
+-commutative46.9%
associate--l+46.9%
Simplified46.9%
Taylor expanded in z around inf 30.7%
associate--l+37.4%
+-commutative37.4%
Simplified37.4%
Taylor expanded in x around 0 39.0%
associate-+r-39.0%
Simplified39.0%
if 6.4e15 < y Initial program 84.8%
associate-+l+84.8%
+-commutative84.8%
associate-+r-84.8%
associate-+l-56.2%
+-commutative56.2%
associate--l+56.2%
+-commutative56.2%
Simplified36.0%
Taylor expanded in t around inf 31.4%
+-commutative31.4%
+-commutative31.4%
associate--l+33.6%
Simplified33.6%
Taylor expanded in z around inf 3.9%
associate--l+5.0%
+-commutative5.0%
Simplified5.0%
Taylor expanded in y around inf 22.7%
flip--22.9%
add-sqr-sqrt23.7%
+-commutative23.7%
add-sqr-sqrt24.1%
+-commutative24.1%
Applied egg-rr24.1%
+-commutative24.1%
associate--l+26.5%
+-inverses26.5%
metadata-eval26.5%
+-commutative26.5%
+-commutative26.5%
Simplified26.5%
Final simplification39.2%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= z 0.24) (- (+ (* y 0.5) 3.0) (sqrt y)) (+ 1.0 (- (sqrt (+ 1.0 y)) (sqrt y)))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (z <= 0.24) {
tmp = ((y * 0.5) + 3.0) - sqrt(y);
} else {
tmp = 1.0 + (sqrt((1.0 + y)) - sqrt(y));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (z <= 0.24d0) then
tmp = ((y * 0.5d0) + 3.0d0) - sqrt(y)
else
tmp = 1.0d0 + (sqrt((1.0d0 + y)) - sqrt(y))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= 0.24) {
tmp = ((y * 0.5) + 3.0) - Math.sqrt(y);
} else {
tmp = 1.0 + (Math.sqrt((1.0 + y)) - Math.sqrt(y));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if z <= 0.24: tmp = ((y * 0.5) + 3.0) - math.sqrt(y) else: tmp = 1.0 + (math.sqrt((1.0 + y)) - math.sqrt(y)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (z <= 0.24) tmp = Float64(Float64(Float64(y * 0.5) + 3.0) - sqrt(y)); else tmp = Float64(1.0 + Float64(sqrt(Float64(1.0 + y)) - sqrt(y))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (z <= 0.24)
tmp = ((y * 0.5) + 3.0) - sqrt(y);
else
tmp = 1.0 + (sqrt((1.0 + y)) - sqrt(y));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[z, 0.24], N[(N[(N[(y * 0.5), $MachinePrecision] + 3.0), $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq 0.24:\\
\;\;\;\;\left(y \cdot 0.5 + 3\right) - \sqrt{y}\\
\mathbf{else}:\\
\;\;\;\;1 + \left(\sqrt{1 + y} - \sqrt{y}\right)\\
\end{array}
\end{array}
if z < 0.23999999999999999Initial program 97.5%
associate-+l+97.5%
associate-+l-76.4%
+-commutative76.4%
sub-neg76.4%
sub-neg76.4%
+-commutative76.4%
+-commutative76.4%
Simplified76.4%
Taylor expanded in x around 0 54.7%
Taylor expanded in t around inf 45.7%
Taylor expanded in y around 0 29.3%
*-commutative31.1%
Simplified29.3%
Taylor expanded in z around 0 28.9%
if 0.23999999999999999 < z Initial program 85.1%
associate-+l+85.1%
+-commutative85.1%
associate-+r-66.8%
associate-+l-55.7%
+-commutative55.7%
associate--l+55.7%
+-commutative55.7%
Simplified21.8%
Taylor expanded in t around inf 34.0%
+-commutative34.0%
+-commutative34.0%
associate--l+36.3%
Simplified36.3%
Taylor expanded in z around inf 20.9%
associate--l+34.9%
+-commutative34.9%
Simplified34.9%
Taylor expanded in x around 0 29.1%
associate-+r-50.4%
Simplified50.4%
Final simplification39.7%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= z 2500000000000.0) (+ (- (sqrt (+ 1.0 z)) (sqrt z)) 2.0) (+ 1.0 (- (sqrt (+ 1.0 y)) (sqrt y)))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (z <= 2500000000000.0) {
tmp = (sqrt((1.0 + z)) - sqrt(z)) + 2.0;
} else {
tmp = 1.0 + (sqrt((1.0 + y)) - sqrt(y));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (z <= 2500000000000.0d0) then
tmp = (sqrt((1.0d0 + z)) - sqrt(z)) + 2.0d0
else
tmp = 1.0d0 + (sqrt((1.0d0 + y)) - sqrt(y))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= 2500000000000.0) {
tmp = (Math.sqrt((1.0 + z)) - Math.sqrt(z)) + 2.0;
} else {
tmp = 1.0 + (Math.sqrt((1.0 + y)) - Math.sqrt(y));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if z <= 2500000000000.0: tmp = (math.sqrt((1.0 + z)) - math.sqrt(z)) + 2.0 else: tmp = 1.0 + (math.sqrt((1.0 + y)) - math.sqrt(y)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (z <= 2500000000000.0) tmp = Float64(Float64(sqrt(Float64(1.0 + z)) - sqrt(z)) + 2.0); else tmp = Float64(1.0 + Float64(sqrt(Float64(1.0 + y)) - sqrt(y))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (z <= 2500000000000.0)
tmp = (sqrt((1.0 + z)) - sqrt(z)) + 2.0;
else
tmp = 1.0 + (sqrt((1.0 + y)) - sqrt(y));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[z, 2500000000000.0], N[(N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision], N[(1.0 + N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq 2500000000000:\\
\;\;\;\;\left(\sqrt{1 + z} - \sqrt{z}\right) + 2\\
\mathbf{else}:\\
\;\;\;\;1 + \left(\sqrt{1 + y} - \sqrt{y}\right)\\
\end{array}
\end{array}
if z < 2.5e12Initial program 97.4%
associate-+l+97.4%
associate-+l-77.2%
+-commutative77.2%
sub-neg77.2%
sub-neg77.2%
+-commutative77.2%
+-commutative77.2%
Simplified77.2%
Taylor expanded in x around 0 55.9%
Taylor expanded in t around inf 46.1%
Taylor expanded in y around 0 45.2%
associate--l+45.2%
Simplified45.2%
if 2.5e12 < z Initial program 84.7%
associate-+l+84.7%
+-commutative84.7%
associate-+r-65.5%
associate-+l-54.6%
+-commutative54.6%
associate--l+54.5%
+-commutative54.5%
Simplified20.9%
Taylor expanded in t around inf 33.1%
+-commutative33.1%
+-commutative33.1%
associate--l+35.5%
Simplified35.5%
Taylor expanded in z around inf 20.9%
associate--l+35.6%
+-commutative35.6%
Simplified35.6%
Taylor expanded in x around 0 29.5%
associate-+r-51.6%
Simplified51.6%
Final simplification48.2%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= z 900000000000.0) (- (+ (sqrt (+ 1.0 z)) 2.0) (sqrt z)) (+ 1.0 (- (sqrt (+ 1.0 y)) (sqrt y)))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (z <= 900000000000.0) {
tmp = (sqrt((1.0 + z)) + 2.0) - sqrt(z);
} else {
tmp = 1.0 + (sqrt((1.0 + y)) - sqrt(y));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (z <= 900000000000.0d0) then
tmp = (sqrt((1.0d0 + z)) + 2.0d0) - sqrt(z)
else
tmp = 1.0d0 + (sqrt((1.0d0 + y)) - sqrt(y))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= 900000000000.0) {
tmp = (Math.sqrt((1.0 + z)) + 2.0) - Math.sqrt(z);
} else {
tmp = 1.0 + (Math.sqrt((1.0 + y)) - Math.sqrt(y));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if z <= 900000000000.0: tmp = (math.sqrt((1.0 + z)) + 2.0) - math.sqrt(z) else: tmp = 1.0 + (math.sqrt((1.0 + y)) - math.sqrt(y)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (z <= 900000000000.0) tmp = Float64(Float64(sqrt(Float64(1.0 + z)) + 2.0) - sqrt(z)); else tmp = Float64(1.0 + Float64(sqrt(Float64(1.0 + y)) - sqrt(y))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (z <= 900000000000.0)
tmp = (sqrt((1.0 + z)) + 2.0) - sqrt(z);
else
tmp = 1.0 + (sqrt((1.0 + y)) - sqrt(y));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[z, 900000000000.0], N[(N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] + 2.0), $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq 900000000000:\\
\;\;\;\;\left(\sqrt{1 + z} + 2\right) - \sqrt{z}\\
\mathbf{else}:\\
\;\;\;\;1 + \left(\sqrt{1 + y} - \sqrt{y}\right)\\
\end{array}
\end{array}
if z < 9e11Initial program 97.4%
associate-+l+97.4%
associate-+l-77.2%
+-commutative77.2%
sub-neg77.2%
sub-neg77.2%
+-commutative77.2%
+-commutative77.2%
Simplified77.2%
Taylor expanded in x around 0 55.9%
Taylor expanded in t around inf 46.1%
Taylor expanded in y around 0 45.2%
if 9e11 < z Initial program 84.7%
associate-+l+84.7%
+-commutative84.7%
associate-+r-65.5%
associate-+l-54.6%
+-commutative54.6%
associate--l+54.5%
+-commutative54.5%
Simplified20.9%
Taylor expanded in t around inf 33.1%
+-commutative33.1%
+-commutative33.1%
associate--l+35.5%
Simplified35.5%
Taylor expanded in z around inf 20.9%
associate--l+35.6%
+-commutative35.6%
Simplified35.6%
Taylor expanded in x around 0 29.5%
associate-+r-51.6%
Simplified51.6%
Final simplification48.3%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= y 2.9) (+ 2.0 (- (* y 0.5) (sqrt y))) (- (sqrt (+ 1.0 x)) (sqrt x))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 2.9) {
tmp = 2.0 + ((y * 0.5) - sqrt(y));
} else {
tmp = sqrt((1.0 + x)) - sqrt(x);
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= 2.9d0) then
tmp = 2.0d0 + ((y * 0.5d0) - sqrt(y))
else
tmp = sqrt((1.0d0 + x)) - sqrt(x)
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= 2.9) {
tmp = 2.0 + ((y * 0.5) - Math.sqrt(y));
} else {
tmp = Math.sqrt((1.0 + x)) - Math.sqrt(x);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if y <= 2.9: tmp = 2.0 + ((y * 0.5) - math.sqrt(y)) else: tmp = math.sqrt((1.0 + x)) - math.sqrt(x) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (y <= 2.9) tmp = Float64(2.0 + Float64(Float64(y * 0.5) - sqrt(y))); else tmp = Float64(sqrt(Float64(1.0 + x)) - sqrt(x)); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (y <= 2.9)
tmp = 2.0 + ((y * 0.5) - sqrt(y));
else
tmp = sqrt((1.0 + x)) - sqrt(x);
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[y, 2.9], N[(2.0 + N[(N[(y * 0.5), $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 2.9:\\
\;\;\;\;2 + \left(y \cdot 0.5 - \sqrt{y}\right)\\
\mathbf{else}:\\
\;\;\;\;\sqrt{1 + x} - \sqrt{x}\\
\end{array}
\end{array}
if y < 2.89999999999999991Initial program 97.8%
associate-+l+97.8%
associate-+l-59.2%
+-commutative59.2%
sub-neg59.2%
sub-neg59.2%
+-commutative59.2%
+-commutative59.2%
Simplified59.2%
Taylor expanded in x around 0 58.1%
Taylor expanded in t around inf 54.0%
Taylor expanded in y around 0 53.5%
*-commutative57.5%
Simplified53.5%
Taylor expanded in z around inf 47.9%
associate--l+47.9%
*-commutative47.9%
Simplified47.9%
if 2.89999999999999991 < y Initial program 84.7%
associate-+l+84.7%
+-commutative84.7%
associate-+r-83.9%
associate-+l-56.6%
+-commutative56.6%
associate--l+56.6%
+-commutative56.6%
Simplified37.1%
Taylor expanded in t around inf 31.4%
+-commutative31.4%
+-commutative31.4%
associate--l+33.4%
Simplified33.4%
Taylor expanded in z around inf 4.6%
associate--l+5.9%
+-commutative5.9%
Simplified5.9%
Taylor expanded in y around inf 22.2%
Final simplification35.0%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= y 5.0) (+ 2.0 (- (* y 0.5) (sqrt y))) (- 1.0 (sqrt x))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 5.0) {
tmp = 2.0 + ((y * 0.5) - sqrt(y));
} else {
tmp = 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) :: tmp
if (y <= 5.0d0) then
tmp = 2.0d0 + ((y * 0.5d0) - sqrt(y))
else
tmp = 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 tmp;
if (y <= 5.0) {
tmp = 2.0 + ((y * 0.5) - Math.sqrt(y));
} else {
tmp = 1.0 - Math.sqrt(x);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if y <= 5.0: tmp = 2.0 + ((y * 0.5) - math.sqrt(y)) else: tmp = 1.0 - 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 <= 5.0) tmp = Float64(2.0 + Float64(Float64(y * 0.5) - sqrt(y))); else tmp = 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)
tmp = 0.0;
if (y <= 5.0)
tmp = 2.0 + ((y * 0.5) - sqrt(y));
else
tmp = 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_] := If[LessEqual[y, 5.0], N[(2.0 + N[(N[(y * 0.5), $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 5:\\
\;\;\;\;2 + \left(y \cdot 0.5 - \sqrt{y}\right)\\
\mathbf{else}:\\
\;\;\;\;1 - \sqrt{x}\\
\end{array}
\end{array}
if y < 5Initial program 97.8%
associate-+l+97.8%
associate-+l-59.2%
+-commutative59.2%
sub-neg59.2%
sub-neg59.2%
+-commutative59.2%
+-commutative59.2%
Simplified59.2%
Taylor expanded in x around 0 58.1%
Taylor expanded in t around inf 54.0%
Taylor expanded in y around 0 53.5%
*-commutative57.5%
Simplified53.5%
Taylor expanded in z around inf 47.9%
associate--l+47.9%
*-commutative47.9%
Simplified47.9%
if 5 < y Initial program 84.7%
associate-+l+84.7%
+-commutative84.7%
associate-+r-83.9%
associate-+l-56.6%
+-commutative56.6%
associate--l+56.6%
+-commutative56.6%
Simplified37.1%
Taylor expanded in t around inf 31.4%
+-commutative31.4%
+-commutative31.4%
associate--l+33.4%
Simplified33.4%
Taylor expanded in z around inf 4.6%
associate--l+5.9%
+-commutative5.9%
Simplified5.9%
Taylor expanded in y around inf 22.2%
Taylor expanded in x around 0 18.8%
Final simplification33.4%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= y 3.05) (+ 2.0 (- (* y 0.5) (sqrt y))) (- (+ 1.0 (* x 0.5)) (sqrt x))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 3.05) {
tmp = 2.0 + ((y * 0.5) - sqrt(y));
} else {
tmp = (1.0 + (x * 0.5)) - 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 <= 3.05d0) then
tmp = 2.0d0 + ((y * 0.5d0) - sqrt(y))
else
tmp = (1.0d0 + (x * 0.5d0)) - 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 <= 3.05) {
tmp = 2.0 + ((y * 0.5) - Math.sqrt(y));
} else {
tmp = (1.0 + (x * 0.5)) - Math.sqrt(x);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if y <= 3.05: tmp = 2.0 + ((y * 0.5) - math.sqrt(y)) else: tmp = (1.0 + (x * 0.5)) - 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 <= 3.05) tmp = Float64(2.0 + Float64(Float64(y * 0.5) - sqrt(y))); else tmp = Float64(Float64(1.0 + Float64(x * 0.5)) - 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 <= 3.05)
tmp = 2.0 + ((y * 0.5) - sqrt(y));
else
tmp = (1.0 + (x * 0.5)) - 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, 3.05], N[(2.0 + N[(N[(y * 0.5), $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 + N[(x * 0.5), $MachinePrecision]), $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 3.05:\\
\;\;\;\;2 + \left(y \cdot 0.5 - \sqrt{y}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(1 + x \cdot 0.5\right) - \sqrt{x}\\
\end{array}
\end{array}
if y < 3.0499999999999998Initial program 97.8%
associate-+l+97.8%
associate-+l-59.2%
+-commutative59.2%
sub-neg59.2%
sub-neg59.2%
+-commutative59.2%
+-commutative59.2%
Simplified59.2%
Taylor expanded in x around 0 58.1%
Taylor expanded in t around inf 54.0%
Taylor expanded in y around 0 53.5%
*-commutative57.5%
Simplified53.5%
Taylor expanded in z around inf 47.9%
associate--l+47.9%
*-commutative47.9%
Simplified47.9%
if 3.0499999999999998 < y Initial program 84.7%
associate-+l+84.7%
+-commutative84.7%
associate-+r-83.9%
associate-+l-56.6%
+-commutative56.6%
associate--l+56.6%
+-commutative56.6%
Simplified37.1%
Taylor expanded in t around inf 31.4%
+-commutative31.4%
+-commutative31.4%
associate--l+33.4%
Simplified33.4%
Taylor expanded in z around inf 4.6%
associate--l+5.9%
+-commutative5.9%
Simplified5.9%
Taylor expanded in y around inf 22.2%
Taylor expanded in x around 0 21.5%
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 (- 1.0 (sqrt x)))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
return 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 = 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 1.0 - Math.sqrt(x);
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): return 1.0 - math.sqrt(x)
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) return Float64(1.0 - sqrt(x)) end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp = code(x, y, z, t)
tmp = 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[(1.0 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
1 - \sqrt{x}
\end{array}
Initial program 91.3%
associate-+l+91.3%
+-commutative91.3%
associate-+r-71.6%
associate-+l-55.2%
+-commutative55.2%
associate--l+55.2%
+-commutative55.2%
Simplified37.8%
Taylor expanded in t around inf 32.7%
+-commutative32.7%
+-commutative32.7%
associate--l+33.9%
Simplified33.9%
Taylor expanded in z around inf 14.5%
associate--l+23.8%
+-commutative23.8%
Simplified23.8%
Taylor expanded in y around inf 16.5%
Taylor expanded in x around 0 14.3%
Final simplification14.3%
(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 2023224
(FPCore (x y z t)
:name "Main:z from "
:precision binary64
:herbie-target
(+ (+ (+ (/ 1.0 (+ (sqrt (+ x 1.0)) (sqrt x))) (/ 1.0 (+ (sqrt (+ y 1.0)) (sqrt y)))) (/ 1.0 (+ (sqrt (+ z 1.0)) (sqrt z)))) (- (sqrt (+ t 1.0)) (sqrt t)))
(+ (+ (+ (- (sqrt (+ x 1.0)) (sqrt x)) (- (sqrt (+ y 1.0)) (sqrt y))) (- (sqrt (+ z 1.0)) (sqrt z))) (- (sqrt (+ t 1.0)) (sqrt t))))