
(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 18 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 z))) (t_2 (sqrt (+ 1.0 y))))
(if (<= z 1.5e+26)
(+
(+ 1.0 (- t_2 (sqrt y)))
(+ (- (sqrt (+ 1.0 t)) (sqrt t)) (/ (- (+ 1.0 z) z) (+ t_1 (sqrt z)))))
(+
(+ (/ 1.0 (+ t_2 (sqrt y))) (/ 1.0 (+ (sqrt x) (sqrt (+ 1.0 x)))))
(- 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 + y));
double tmp;
if (z <= 1.5e+26) {
tmp = (1.0 + (t_2 - sqrt(y))) + ((sqrt((1.0 + t)) - sqrt(t)) + (((1.0 + z) - z) / (t_1 + sqrt(z))));
} else {
tmp = ((1.0 / (t_2 + sqrt(y))) + (1.0 / (sqrt(x) + sqrt((1.0 + x))))) + (t_1 - sqrt(z));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = sqrt((1.0d0 + z))
t_2 = sqrt((1.0d0 + y))
if (z <= 1.5d+26) then
tmp = (1.0d0 + (t_2 - sqrt(y))) + ((sqrt((1.0d0 + t)) - sqrt(t)) + (((1.0d0 + z) - z) / (t_1 + sqrt(z))))
else
tmp = ((1.0d0 / (t_2 + sqrt(y))) + (1.0d0 / (sqrt(x) + sqrt((1.0d0 + x))))) + (t_1 - sqrt(z))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + z));
double t_2 = Math.sqrt((1.0 + y));
double tmp;
if (z <= 1.5e+26) {
tmp = (1.0 + (t_2 - Math.sqrt(y))) + ((Math.sqrt((1.0 + t)) - Math.sqrt(t)) + (((1.0 + z) - z) / (t_1 + Math.sqrt(z))));
} else {
tmp = ((1.0 / (t_2 + Math.sqrt(y))) + (1.0 / (Math.sqrt(x) + Math.sqrt((1.0 + x))))) + (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 + y)) tmp = 0 if z <= 1.5e+26: tmp = (1.0 + (t_2 - math.sqrt(y))) + ((math.sqrt((1.0 + t)) - math.sqrt(t)) + (((1.0 + z) - z) / (t_1 + math.sqrt(z)))) else: tmp = ((1.0 / (t_2 + math.sqrt(y))) + (1.0 / (math.sqrt(x) + math.sqrt((1.0 + x))))) + (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 = sqrt(Float64(1.0 + y)) tmp = 0.0 if (z <= 1.5e+26) tmp = Float64(Float64(1.0 + Float64(t_2 - sqrt(y))) + Float64(Float64(sqrt(Float64(1.0 + t)) - sqrt(t)) + Float64(Float64(Float64(1.0 + z) - z) / Float64(t_1 + sqrt(z))))); else tmp = Float64(Float64(Float64(1.0 / Float64(t_2 + sqrt(y))) + Float64(1.0 / Float64(sqrt(x) + sqrt(Float64(1.0 + x))))) + 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 + y));
tmp = 0.0;
if (z <= 1.5e+26)
tmp = (1.0 + (t_2 - sqrt(y))) + ((sqrt((1.0 + t)) - sqrt(t)) + (((1.0 + z) - z) / (t_1 + sqrt(z))));
else
tmp = ((1.0 / (t_2 + sqrt(y))) + (1.0 / (sqrt(x) + sqrt((1.0 + x))))) + (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[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[z, 1.5e+26], N[(N[(1.0 + N[(t$95$2 - N[Sqrt[y], $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[(t$95$1 + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 / N[(t$95$2 + 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[(t$95$1 - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + z}\\
t_2 := \sqrt{1 + y}\\
\mathbf{if}\;z \leq 1.5 \cdot 10^{+26}:\\
\;\;\;\;\left(1 + \left(t_2 - \sqrt{y}\right)\right) + \left(\left(\sqrt{1 + t} - \sqrt{t}\right) + \frac{\left(1 + z\right) - z}{t_1 + \sqrt{z}}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{1}{t_2 + \sqrt{y}} + \frac{1}{\sqrt{x} + \sqrt{1 + x}}\right) + \left(t_1 - \sqrt{z}\right)\\
\end{array}
\end{array}
if z < 1.49999999999999999e26Initial program 96.2%
associate-+l+96.2%
associate-+l-79.2%
+-commutative79.2%
sub-neg79.2%
sub-neg79.2%
+-commutative79.2%
+-commutative79.2%
Simplified79.2%
Taylor expanded in x around 0 55.9%
associate--l+54.7%
Simplified54.7%
flip--55.1%
add-sqr-sqrt54.5%
+-commutative54.5%
add-sqr-sqrt55.2%
+-commutative55.2%
Applied egg-rr55.2%
if 1.49999999999999999e26 < z Initial program 89.8%
associate-+l+89.8%
associate-+l-68.6%
+-commutative68.6%
sub-neg68.6%
sub-neg68.6%
+-commutative68.6%
+-commutative68.6%
Simplified68.6%
flip--68.6%
add-sqr-sqrt51.1%
add-sqr-sqrt68.6%
Applied egg-rr68.6%
associate--l+68.9%
+-inverses68.9%
metadata-eval68.9%
Simplified68.9%
sub-neg68.9%
Applied egg-rr68.9%
sub-neg68.9%
associate-+l-91.8%
+-commutative91.8%
+-commutative91.8%
Simplified91.8%
flip--91.8%
add-sqr-sqrt76.7%
add-sqr-sqrt92.4%
Applied egg-rr92.4%
associate--l+94.3%
+-inverses94.3%
metadata-eval94.3%
+-commutative94.3%
Simplified94.3%
Taylor expanded in t around inf 59.6%
Final simplification57.3%
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 93.1%
associate-+l+93.1%
associate-+l-74.2%
+-commutative74.2%
sub-neg74.2%
sub-neg74.2%
+-commutative74.2%
+-commutative74.2%
Simplified74.2%
flip--74.2%
add-sqr-sqrt54.6%
add-sqr-sqrt74.2%
Applied egg-rr74.2%
associate--l+74.3%
+-inverses74.3%
metadata-eval74.3%
Simplified74.3%
sub-neg74.3%
Applied egg-rr74.3%
sub-neg74.3%
associate-+l-94.2%
+-commutative94.2%
+-commutative94.2%
Simplified94.2%
flip--94.2%
add-sqr-sqrt73.5%
add-sqr-sqrt94.6%
Applied egg-rr94.6%
associate--l+95.9%
+-inverses95.9%
metadata-eval95.9%
+-commutative95.9%
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
(let* ((t_1 (- (sqrt (+ 1.0 z)) (sqrt z))) (t_2 (sqrt (+ 1.0 y))))
(if (<= z 1.2e+26)
(+
(+ 1.0 (- t_2 (sqrt y)))
(+ t_1 (/ (- (+ 1.0 t) t) (+ (sqrt (+ 1.0 t)) (sqrt t)))))
(+
(+ (/ 1.0 (+ t_2 (sqrt y))) (/ 1.0 (+ (sqrt x) (sqrt (+ 1.0 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 + z)) - sqrt(z);
double t_2 = sqrt((1.0 + y));
double tmp;
if (z <= 1.2e+26) {
tmp = (1.0 + (t_2 - sqrt(y))) + (t_1 + (((1.0 + t) - t) / (sqrt((1.0 + t)) + sqrt(t))));
} else {
tmp = ((1.0 / (t_2 + sqrt(y))) + (1.0 / (sqrt(x) + sqrt((1.0 + 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 + z)) - sqrt(z)
t_2 = sqrt((1.0d0 + y))
if (z <= 1.2d+26) then
tmp = (1.0d0 + (t_2 - sqrt(y))) + (t_1 + (((1.0d0 + t) - t) / (sqrt((1.0d0 + t)) + sqrt(t))))
else
tmp = ((1.0d0 / (t_2 + sqrt(y))) + (1.0d0 / (sqrt(x) + sqrt((1.0d0 + 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 + z)) - Math.sqrt(z);
double t_2 = Math.sqrt((1.0 + y));
double tmp;
if (z <= 1.2e+26) {
tmp = (1.0 + (t_2 - Math.sqrt(y))) + (t_1 + (((1.0 + t) - t) / (Math.sqrt((1.0 + t)) + Math.sqrt(t))));
} else {
tmp = ((1.0 / (t_2 + Math.sqrt(y))) + (1.0 / (Math.sqrt(x) + Math.sqrt((1.0 + 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 + z)) - math.sqrt(z) t_2 = math.sqrt((1.0 + y)) tmp = 0 if z <= 1.2e+26: tmp = (1.0 + (t_2 - math.sqrt(y))) + (t_1 + (((1.0 + t) - t) / (math.sqrt((1.0 + t)) + math.sqrt(t)))) else: tmp = ((1.0 / (t_2 + math.sqrt(y))) + (1.0 / (math.sqrt(x) + math.sqrt((1.0 + x))))) + t_1 return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = Float64(sqrt(Float64(1.0 + z)) - sqrt(z)) t_2 = sqrt(Float64(1.0 + y)) tmp = 0.0 if (z <= 1.2e+26) tmp = Float64(Float64(1.0 + Float64(t_2 - sqrt(y))) + Float64(t_1 + Float64(Float64(Float64(1.0 + t) - t) / Float64(sqrt(Float64(1.0 + t)) + sqrt(t))))); else tmp = Float64(Float64(Float64(1.0 / Float64(t_2 + sqrt(y))) + Float64(1.0 / Float64(sqrt(x) + sqrt(Float64(1.0 + 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 + z)) - sqrt(z);
t_2 = sqrt((1.0 + y));
tmp = 0.0;
if (z <= 1.2e+26)
tmp = (1.0 + (t_2 - sqrt(y))) + (t_1 + (((1.0 + t) - t) / (sqrt((1.0 + t)) + sqrt(t))));
else
tmp = ((1.0 / (t_2 + sqrt(y))) + (1.0 / (sqrt(x) + sqrt((1.0 + 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[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[z, 1.2e+26], N[(N[(1.0 + N[(t$95$2 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$1 + N[(N[(N[(1.0 + t), $MachinePrecision] - t), $MachinePrecision] / N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] + N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 / N[(t$95$2 + 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] + t$95$1), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + z} - \sqrt{z}\\
t_2 := \sqrt{1 + y}\\
\mathbf{if}\;z \leq 1.2 \cdot 10^{+26}:\\
\;\;\;\;\left(1 + \left(t_2 - \sqrt{y}\right)\right) + \left(t_1 + \frac{\left(1 + t\right) - t}{\sqrt{1 + t} + \sqrt{t}}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{1}{t_2 + \sqrt{y}} + \frac{1}{\sqrt{x} + \sqrt{1 + x}}\right) + t_1\\
\end{array}
\end{array}
if z < 1.20000000000000002e26Initial program 96.2%
associate-+l+96.2%
associate-+l-79.2%
+-commutative79.2%
sub-neg79.2%
sub-neg79.2%
+-commutative79.2%
+-commutative79.2%
Simplified79.2%
Taylor expanded in x around 0 55.9%
associate--l+54.7%
Simplified54.7%
flip--54.7%
add-sqr-sqrt45.0%
+-commutative45.0%
add-sqr-sqrt54.7%
+-commutative54.7%
Applied egg-rr54.7%
if 1.20000000000000002e26 < z Initial program 89.8%
associate-+l+89.8%
associate-+l-68.6%
+-commutative68.6%
sub-neg68.6%
sub-neg68.6%
+-commutative68.6%
+-commutative68.6%
Simplified68.6%
flip--68.6%
add-sqr-sqrt51.1%
add-sqr-sqrt68.6%
Applied egg-rr68.6%
associate--l+68.9%
+-inverses68.9%
metadata-eval68.9%
Simplified68.9%
sub-neg68.9%
Applied egg-rr68.9%
sub-neg68.9%
associate-+l-91.8%
+-commutative91.8%
+-commutative91.8%
Simplified91.8%
flip--91.8%
add-sqr-sqrt76.7%
add-sqr-sqrt92.4%
Applied egg-rr92.4%
associate--l+94.3%
+-inverses94.3%
metadata-eval94.3%
+-commutative94.3%
Simplified94.3%
Taylor expanded in t around inf 59.6%
Final simplification57.0%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ 1.0 y))) (t_2 (- (sqrt (+ 1.0 z)) (sqrt z))))
(if (<= z 1.2e+26)
(+ (+ t_2 (- (sqrt (+ 1.0 t)) (sqrt t))) (- (+ 1.0 t_1) (sqrt y)))
(+
(+ (/ 1.0 (+ t_1 (sqrt y))) (/ 1.0 (+ (sqrt x) (sqrt (+ 1.0 x)))))
t_2))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + y));
double t_2 = sqrt((1.0 + z)) - sqrt(z);
double tmp;
if (z <= 1.2e+26) {
tmp = (t_2 + (sqrt((1.0 + t)) - sqrt(t))) + ((1.0 + t_1) - sqrt(y));
} else {
tmp = ((1.0 / (t_1 + sqrt(y))) + (1.0 / (sqrt(x) + sqrt((1.0 + x))))) + t_2;
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = sqrt((1.0d0 + y))
t_2 = sqrt((1.0d0 + z)) - sqrt(z)
if (z <= 1.2d+26) then
tmp = (t_2 + (sqrt((1.0d0 + t)) - sqrt(t))) + ((1.0d0 + t_1) - sqrt(y))
else
tmp = ((1.0d0 / (t_1 + sqrt(y))) + (1.0d0 / (sqrt(x) + sqrt((1.0d0 + x))))) + t_2
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + y));
double t_2 = Math.sqrt((1.0 + z)) - Math.sqrt(z);
double tmp;
if (z <= 1.2e+26) {
tmp = (t_2 + (Math.sqrt((1.0 + t)) - Math.sqrt(t))) + ((1.0 + t_1) - Math.sqrt(y));
} else {
tmp = ((1.0 / (t_1 + Math.sqrt(y))) + (1.0 / (Math.sqrt(x) + Math.sqrt((1.0 + x))))) + t_2;
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + y)) t_2 = math.sqrt((1.0 + z)) - math.sqrt(z) tmp = 0 if z <= 1.2e+26: tmp = (t_2 + (math.sqrt((1.0 + t)) - math.sqrt(t))) + ((1.0 + t_1) - math.sqrt(y)) else: tmp = ((1.0 / (t_1 + math.sqrt(y))) + (1.0 / (math.sqrt(x) + math.sqrt((1.0 + x))))) + t_2 return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(1.0 + y)) t_2 = Float64(sqrt(Float64(1.0 + z)) - sqrt(z)) tmp = 0.0 if (z <= 1.2e+26) tmp = Float64(Float64(t_2 + Float64(sqrt(Float64(1.0 + t)) - sqrt(t))) + Float64(Float64(1.0 + t_1) - sqrt(y))); else tmp = Float64(Float64(Float64(1.0 / Float64(t_1 + sqrt(y))) + Float64(1.0 / Float64(sqrt(x) + sqrt(Float64(1.0 + x))))) + t_2); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + y));
t_2 = sqrt((1.0 + z)) - sqrt(z);
tmp = 0.0;
if (z <= 1.2e+26)
tmp = (t_2 + (sqrt((1.0 + t)) - sqrt(t))) + ((1.0 + t_1) - sqrt(y));
else
tmp = ((1.0 / (t_1 + sqrt(y))) + (1.0 / (sqrt(x) + sqrt((1.0 + x))))) + t_2;
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, 1.2e+26], N[(N[(t$95$2 + N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 + t$95$1), $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 / N[(t$95$1 + 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] + t$95$2), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + y}\\
t_2 := \sqrt{1 + z} - \sqrt{z}\\
\mathbf{if}\;z \leq 1.2 \cdot 10^{+26}:\\
\;\;\;\;\left(t_2 + \left(\sqrt{1 + t} - \sqrt{t}\right)\right) + \left(\left(1 + t_1\right) - \sqrt{y}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{1}{t_1 + \sqrt{y}} + \frac{1}{\sqrt{x} + \sqrt{1 + x}}\right) + t_2\\
\end{array}
\end{array}
if z < 1.20000000000000002e26Initial program 96.2%
associate-+l+96.2%
associate-+l-79.2%
+-commutative79.2%
sub-neg79.2%
sub-neg79.2%
+-commutative79.2%
+-commutative79.2%
Simplified79.2%
Taylor expanded in x around 0 55.9%
if 1.20000000000000002e26 < z Initial program 89.8%
associate-+l+89.8%
associate-+l-68.6%
+-commutative68.6%
sub-neg68.6%
sub-neg68.6%
+-commutative68.6%
+-commutative68.6%
Simplified68.6%
flip--68.6%
add-sqr-sqrt51.1%
add-sqr-sqrt68.6%
Applied egg-rr68.6%
associate--l+68.9%
+-inverses68.9%
metadata-eval68.9%
Simplified68.9%
sub-neg68.9%
Applied egg-rr68.9%
sub-neg68.9%
associate-+l-91.8%
+-commutative91.8%
+-commutative91.8%
Simplified91.8%
flip--91.8%
add-sqr-sqrt76.7%
add-sqr-sqrt92.4%
Applied egg-rr92.4%
associate--l+94.3%
+-inverses94.3%
metadata-eval94.3%
+-commutative94.3%
Simplified94.3%
Taylor expanded in t around inf 59.6%
Final simplification57.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 (<= x 6.5e-28)
(+
(+ (- (sqrt (+ 1.0 z)) (sqrt z)) (- (sqrt (+ 1.0 t)) (sqrt t)))
(+ 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 (x <= 6.5e-28) {
tmp = ((sqrt((1.0 + z)) - sqrt(z)) + (sqrt((1.0 + t)) - sqrt(t))) + (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 (x <= 6.5d-28) then
tmp = ((sqrt((1.0d0 + z)) - sqrt(z)) + (sqrt((1.0d0 + t)) - sqrt(t))) + (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 (x <= 6.5e-28) {
tmp = ((Math.sqrt((1.0 + z)) - Math.sqrt(z)) + (Math.sqrt((1.0 + t)) - Math.sqrt(t))) + (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 x <= 6.5e-28: tmp = ((math.sqrt((1.0 + z)) - math.sqrt(z)) + (math.sqrt((1.0 + t)) - math.sqrt(t))) + (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 (x <= 6.5e-28) tmp = Float64(Float64(Float64(sqrt(Float64(1.0 + z)) - sqrt(z)) + Float64(sqrt(Float64(1.0 + t)) - sqrt(t))) + 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 (x <= 6.5e-28)
tmp = ((sqrt((1.0 + z)) - sqrt(z)) + (sqrt((1.0 + t)) - sqrt(t))) + (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[x, 6.5e-28], 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] + N[(1.0 + N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] - 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}
\mathbf{if}\;x \leq 6.5 \cdot 10^{-28}:\\
\;\;\;\;\left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\sqrt{1 + t} - \sqrt{t}\right)\right) + \left(1 + \left(\sqrt{1 + y} - \sqrt{y}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{x} + \sqrt{1 + x}}\\
\end{array}
\end{array}
if x < 6.50000000000000043e-28Initial program 98.4%
associate-+l+98.4%
associate-+l-98.4%
+-commutative98.4%
sub-neg98.4%
sub-neg98.4%
+-commutative98.4%
+-commutative98.4%
Simplified98.4%
Taylor expanded in x around 0 59.8%
associate--l+98.4%
Simplified98.4%
if 6.50000000000000043e-28 < x Initial program 88.8%
associate-+l+88.8%
+-commutative88.8%
associate-+r-54.1%
associate-+l-19.9%
+-commutative19.9%
associate--l+19.9%
+-commutative19.9%
Simplified13.4%
Taylor expanded in t around inf 10.8%
+-commutative10.8%
+-commutative10.8%
associate--l+13.5%
Simplified13.5%
Taylor expanded in y around inf 5.6%
+-commutative5.6%
+-commutative5.6%
associate--l+7.9%
+-commutative7.9%
+-commutative7.9%
Simplified7.9%
Taylor expanded in z around inf 7.6%
flip--90.8%
add-sqr-sqrt52.8%
add-sqr-sqrt91.5%
Applied egg-rr7.6%
associate--l+93.8%
+-inverses93.8%
metadata-eval93.8%
+-commutative93.8%
Simplified12.0%
Final simplification51.1%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (sqrt (+ 1.0 z)) (sqrt z))))
(if (<= y 5.8e-34)
(+ (+ t_1 (- (sqrt (+ 1.0 t)) (sqrt t))) 2.0)
(if (<= y 8.5e+29)
(+ t_1 (+ 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)) - sqrt(z);
double tmp;
if (y <= 5.8e-34) {
tmp = (t_1 + (sqrt((1.0 + t)) - sqrt(t))) + 2.0;
} else if (y <= 8.5e+29) {
tmp = t_1 + (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)) - sqrt(z)
if (y <= 5.8d-34) then
tmp = (t_1 + (sqrt((1.0d0 + t)) - sqrt(t))) + 2.0d0
else if (y <= 8.5d+29) then
tmp = t_1 + (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)) - Math.sqrt(z);
double tmp;
if (y <= 5.8e-34) {
tmp = (t_1 + (Math.sqrt((1.0 + t)) - Math.sqrt(t))) + 2.0;
} else if (y <= 8.5e+29) {
tmp = t_1 + (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)) - math.sqrt(z) tmp = 0 if y <= 5.8e-34: tmp = (t_1 + (math.sqrt((1.0 + t)) - math.sqrt(t))) + 2.0 elif y <= 8.5e+29: tmp = t_1 + (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 = Float64(sqrt(Float64(1.0 + z)) - sqrt(z)) tmp = 0.0 if (y <= 5.8e-34) tmp = Float64(Float64(t_1 + Float64(sqrt(Float64(1.0 + t)) - sqrt(t))) + 2.0); elseif (y <= 8.5e+29) tmp = Float64(t_1 + 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)) - sqrt(z);
tmp = 0.0;
if (y <= 5.8e-34)
tmp = (t_1 + (sqrt((1.0 + t)) - sqrt(t))) + 2.0;
elseif (y <= 8.5e+29)
tmp = t_1 + (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[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 5.8e-34], 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, 8.5e+29], N[(t$95$1 + N[(1.0 + N[(1.0 / N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(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 5.8 \cdot 10^{-34}:\\
\;\;\;\;\left(t_1 + \left(\sqrt{1 + t} - \sqrt{t}\right)\right) + 2\\
\mathbf{elif}\;y \leq 8.5 \cdot 10^{+29}:\\
\;\;\;\;t_1 + \left(1 + \frac{1}{\sqrt{1 + y} + \sqrt{y}}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{x} + \sqrt{1 + x}}\\
\end{array}
\end{array}
if y < 5.8000000000000004e-34Initial program 97.4%
associate-+l+97.4%
associate-+l-61.7%
+-commutative61.7%
sub-neg61.7%
sub-neg61.7%
+-commutative61.7%
+-commutative61.7%
Simplified61.7%
Taylor expanded in x around 0 58.1%
associate--l+58.1%
Simplified58.1%
Taylor expanded in y around 0 58.1%
if 5.8000000000000004e-34 < y < 8.5000000000000006e29Initial program 89.1%
associate-+l+89.1%
associate-+l-58.3%
+-commutative58.3%
sub-neg58.3%
sub-neg58.3%
+-commutative58.3%
+-commutative58.3%
Simplified58.3%
flip--58.3%
add-sqr-sqrt51.4%
add-sqr-sqrt58.3%
Applied egg-rr58.3%
associate--l+59.5%
+-inverses59.5%
metadata-eval59.5%
Simplified59.5%
Taylor expanded in t around inf 33.7%
Taylor expanded in x around 0 60.8%
if 8.5000000000000006e29 < y Initial program 90.1%
associate-+l+90.1%
+-commutative90.1%
associate-+r-90.1%
associate-+l-56.5%
+-commutative56.5%
associate--l+56.5%
+-commutative56.5%
Simplified38.2%
Taylor expanded in t around inf 32.3%
+-commutative32.3%
+-commutative32.3%
associate--l+33.9%
Simplified33.9%
Taylor expanded in y around inf 18.6%
+-commutative18.6%
+-commutative18.6%
associate--l+32.3%
+-commutative32.3%
+-commutative32.3%
Simplified32.3%
Taylor expanded in z around inf 24.7%
flip--91.8%
add-sqr-sqrt76.5%
add-sqr-sqrt92.1%
Applied egg-rr24.8%
associate--l+93.8%
+-inverses93.8%
metadata-eval93.8%
+-commutative93.8%
Simplified27.8%
Final simplification44.7%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ 1.0 z))) (t_2 (- (sqrt (+ 1.0 y)) (sqrt y))))
(if (<= z 2.9e-31)
(+ 2.0 (+ t_1 (- (- (sqrt (+ 1.0 t)) (sqrt z)) (sqrt t))))
(if (<= z 3.8e+28)
(+ (- t_1 (sqrt z)) (+ 1.0 t_2))
(+ (sqrt (+ 1.0 x)) (- t_2 (sqrt x)))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + z));
double t_2 = sqrt((1.0 + y)) - sqrt(y);
double tmp;
if (z <= 2.9e-31) {
tmp = 2.0 + (t_1 + ((sqrt((1.0 + t)) - sqrt(z)) - sqrt(t)));
} else if (z <= 3.8e+28) {
tmp = (t_1 - sqrt(z)) + (1.0 + t_2);
} else {
tmp = sqrt((1.0 + x)) + (t_2 - sqrt(x));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = sqrt((1.0d0 + z))
t_2 = sqrt((1.0d0 + y)) - sqrt(y)
if (z <= 2.9d-31) then
tmp = 2.0d0 + (t_1 + ((sqrt((1.0d0 + t)) - sqrt(z)) - sqrt(t)))
else if (z <= 3.8d+28) then
tmp = (t_1 - sqrt(z)) + (1.0d0 + t_2)
else
tmp = sqrt((1.0d0 + x)) + (t_2 - sqrt(x))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + z));
double t_2 = Math.sqrt((1.0 + y)) - Math.sqrt(y);
double tmp;
if (z <= 2.9e-31) {
tmp = 2.0 + (t_1 + ((Math.sqrt((1.0 + t)) - Math.sqrt(z)) - Math.sqrt(t)));
} else if (z <= 3.8e+28) {
tmp = (t_1 - Math.sqrt(z)) + (1.0 + t_2);
} else {
tmp = Math.sqrt((1.0 + x)) + (t_2 - Math.sqrt(x));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + z)) t_2 = math.sqrt((1.0 + y)) - math.sqrt(y) tmp = 0 if z <= 2.9e-31: tmp = 2.0 + (t_1 + ((math.sqrt((1.0 + t)) - math.sqrt(z)) - math.sqrt(t))) elif z <= 3.8e+28: tmp = (t_1 - math.sqrt(z)) + (1.0 + t_2) else: tmp = math.sqrt((1.0 + x)) + (t_2 - math.sqrt(x)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(1.0 + z)) t_2 = Float64(sqrt(Float64(1.0 + y)) - sqrt(y)) tmp = 0.0 if (z <= 2.9e-31) tmp = Float64(2.0 + Float64(t_1 + Float64(Float64(sqrt(Float64(1.0 + t)) - sqrt(z)) - sqrt(t)))); elseif (z <= 3.8e+28) tmp = Float64(Float64(t_1 - sqrt(z)) + Float64(1.0 + t_2)); else tmp = Float64(sqrt(Float64(1.0 + x)) + Float64(t_2 - sqrt(x))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + z));
t_2 = sqrt((1.0 + y)) - sqrt(y);
tmp = 0.0;
if (z <= 2.9e-31)
tmp = 2.0 + (t_1 + ((sqrt((1.0 + t)) - sqrt(z)) - sqrt(t)));
elseif (z <= 3.8e+28)
tmp = (t_1 - sqrt(z)) + (1.0 + t_2);
else
tmp = sqrt((1.0 + x)) + (t_2 - sqrt(x));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, 2.9e-31], N[(2.0 + N[(t$95$1 + N[(N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.8e+28], N[(N[(t$95$1 - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] + N[(1.0 + t$95$2), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision] + N[(t$95$2 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + z}\\
t_2 := \sqrt{1 + y} - \sqrt{y}\\
\mathbf{if}\;z \leq 2.9 \cdot 10^{-31}:\\
\;\;\;\;2 + \left(t_1 + \left(\left(\sqrt{1 + t} - \sqrt{z}\right) - \sqrt{t}\right)\right)\\
\mathbf{elif}\;z \leq 3.8 \cdot 10^{+28}:\\
\;\;\;\;\left(t_1 - \sqrt{z}\right) + \left(1 + t_2\right)\\
\mathbf{else}:\\
\;\;\;\;\sqrt{1 + x} + \left(t_2 - \sqrt{x}\right)\\
\end{array}
\end{array}
if z < 2.9000000000000001e-31Initial program 97.9%
associate-+l+97.9%
sub-neg97.9%
associate-+l+79.6%
associate-+l+49.3%
+-commutative49.3%
neg-sub049.3%
associate-+l-49.3%
neg-sub049.3%
Simplified32.3%
Taylor expanded in y around 0 27.6%
Taylor expanded in x around 0 21.8%
associate--l+41.5%
+-commutative41.5%
associate--l+34.7%
+-commutative34.7%
associate--r+34.7%
Simplified34.7%
if 2.9000000000000001e-31 < z < 3.7999999999999999e28Initial program 83.7%
associate-+l+83.7%
associate-+l-69.0%
+-commutative69.0%
sub-neg69.0%
sub-neg69.0%
+-commutative69.0%
+-commutative69.0%
Simplified69.0%
Taylor expanded in x around 0 45.6%
associate--l+63.3%
Simplified63.3%
Taylor expanded in t around inf 44.1%
if 3.7999999999999999e28 < z Initial program 90.5%
associate-+l+90.5%
+-commutative90.5%
associate-+r-69.9%
associate-+l-59.0%
+-commutative59.0%
associate--l+59.0%
+-commutative59.0%
Simplified22.8%
Taylor expanded in t around inf 39.1%
+-commutative39.1%
+-commutative39.1%
associate--l+42.4%
Simplified42.4%
Taylor expanded in z around inf 42.4%
Final simplification39.1%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ 1.0 x))))
(if (<= y 6.6e-127)
(+ (- (sqrt (+ 1.0 t)) (sqrt t)) 3.0)
(if (<= y 4.5e+15)
(+ (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 <= 6.6e-127) {
tmp = (sqrt((1.0 + t)) - sqrt(t)) + 3.0;
} else if (y <= 4.5e+15) {
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 <= 6.6d-127) then
tmp = (sqrt((1.0d0 + t)) - sqrt(t)) + 3.0d0
else if (y <= 4.5d+15) 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 <= 6.6e-127) {
tmp = (Math.sqrt((1.0 + t)) - Math.sqrt(t)) + 3.0;
} else if (y <= 4.5e+15) {
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 <= 6.6e-127: tmp = (math.sqrt((1.0 + t)) - math.sqrt(t)) + 3.0 elif y <= 4.5e+15: 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 <= 6.6e-127) tmp = Float64(Float64(sqrt(Float64(1.0 + t)) - sqrt(t)) + 3.0); elseif (y <= 4.5e+15) tmp = Float64(sqrt(Float64(1.0 + y)) + Float64(Float64(t_1 - 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 <= 6.6e-127)
tmp = (sqrt((1.0 + t)) - sqrt(t)) + 3.0;
elseif (y <= 4.5e+15)
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, 6.6e-127], N[(N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision] + 3.0), $MachinePrecision], If[LessEqual[y, 4.5e+15], N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] + N[(N[(t$95$1 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + x}\\
\mathbf{if}\;y \leq 6.6 \cdot 10^{-127}:\\
\;\;\;\;\left(\sqrt{1 + t} - \sqrt{t}\right) + 3\\
\mathbf{elif}\;y \leq 4.5 \cdot 10^{+15}:\\
\;\;\;\;\sqrt{1 + y} + \left(\left(t_1 - \sqrt{y}\right) - \sqrt{x}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{x} + t_1}\\
\end{array}
\end{array}
if y < 6.59999999999999961e-127Initial program 98.1%
associate-+l+98.1%
sub-neg98.1%
associate-+l+65.8%
associate-+l+60.7%
+-commutative60.7%
neg-sub060.7%
associate-+l-60.7%
neg-sub060.7%
Simplified30.6%
Taylor expanded in y around 0 30.6%
Taylor expanded in x around 0 19.0%
associate--l+60.4%
+-commutative60.4%
associate--l+49.6%
+-commutative49.6%
associate--r+49.6%
Simplified49.6%
Taylor expanded in z around 0 18.9%
associate--l+36.6%
Simplified36.6%
if 6.59999999999999961e-127 < y < 4.5e15Initial program 94.3%
associate-+l+94.4%
+-commutative94.4%
associate-+r-53.3%
associate-+l-46.1%
+-commutative46.1%
associate--l+46.1%
+-commutative46.1%
Simplified30.7%
Taylor expanded in t around inf 27.3%
+-commutative27.3%
+-commutative27.3%
associate--l+26.6%
Simplified26.6%
log1p-expm1-u26.6%
+-commutative26.6%
Applied egg-rr26.6%
Taylor expanded in z around inf 22.4%
associate--l+40.5%
+-commutative40.5%
associate--r+40.5%
Simplified40.5%
if 4.5e15 < y Initial program 89.5%
associate-+l+89.5%
+-commutative89.5%
associate-+r-89.5%
associate-+l-56.9%
+-commutative56.9%
associate--l+56.9%
+-commutative56.9%
Simplified37.7%
Taylor expanded in t around inf 31.5%
+-commutative31.5%
+-commutative31.5%
associate--l+33.2%
Simplified33.2%
Taylor expanded in y around inf 18.0%
+-commutative18.0%
+-commutative18.0%
associate--l+31.5%
+-commutative31.5%
+-commutative31.5%
Simplified31.5%
Taylor expanded in z around inf 24.5%
flip--91.5%
add-sqr-sqrt76.7%
add-sqr-sqrt92.3%
Applied egg-rr24.5%
associate--l+94.0%
+-inverses94.0%
metadata-eval94.0%
+-commutative94.0%
Simplified27.5%
Final simplification33.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 1.4e-27)
(+ (- (sqrt (+ 1.0 t)) (sqrt t)) 3.0)
(if (<= z 3.1e+16)
(+ (sqrt (+ 1.0 z)) (- 2.0 (sqrt z)))
(+ (sqrt (+ 1.0 x)) (- (- (sqrt (+ 1.0 y)) (sqrt y)) (sqrt x))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (z <= 1.4e-27) {
tmp = (sqrt((1.0 + t)) - sqrt(t)) + 3.0;
} else if (z <= 3.1e+16) {
tmp = sqrt((1.0 + z)) + (2.0 - sqrt(z));
} else {
tmp = sqrt((1.0 + x)) + ((sqrt((1.0 + y)) - sqrt(y)) - sqrt(x));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (z <= 1.4d-27) then
tmp = (sqrt((1.0d0 + t)) - sqrt(t)) + 3.0d0
else if (z <= 3.1d+16) then
tmp = sqrt((1.0d0 + z)) + (2.0d0 - sqrt(z))
else
tmp = sqrt((1.0d0 + x)) + ((sqrt((1.0d0 + y)) - sqrt(y)) - sqrt(x))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= 1.4e-27) {
tmp = (Math.sqrt((1.0 + t)) - Math.sqrt(t)) + 3.0;
} else if (z <= 3.1e+16) {
tmp = Math.sqrt((1.0 + z)) + (2.0 - Math.sqrt(z));
} else {
tmp = Math.sqrt((1.0 + x)) + ((Math.sqrt((1.0 + y)) - Math.sqrt(y)) - Math.sqrt(x));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if z <= 1.4e-27: tmp = (math.sqrt((1.0 + t)) - math.sqrt(t)) + 3.0 elif z <= 3.1e+16: tmp = math.sqrt((1.0 + z)) + (2.0 - math.sqrt(z)) else: tmp = math.sqrt((1.0 + x)) + ((math.sqrt((1.0 + y)) - math.sqrt(y)) - math.sqrt(x)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (z <= 1.4e-27) tmp = Float64(Float64(sqrt(Float64(1.0 + t)) - sqrt(t)) + 3.0); elseif (z <= 3.1e+16) tmp = Float64(sqrt(Float64(1.0 + z)) + Float64(2.0 - sqrt(z))); else tmp = Float64(sqrt(Float64(1.0 + x)) + Float64(Float64(sqrt(Float64(1.0 + y)) - sqrt(y)) - sqrt(x))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (z <= 1.4e-27)
tmp = (sqrt((1.0 + t)) - sqrt(t)) + 3.0;
elseif (z <= 3.1e+16)
tmp = sqrt((1.0 + z)) + (2.0 - sqrt(z));
else
tmp = sqrt((1.0 + x)) + ((sqrt((1.0 + y)) - sqrt(y)) - sqrt(x));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[z, 1.4e-27], N[(N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision] + 3.0), $MachinePrecision], If[LessEqual[z, 3.1e+16], N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] + N[(2.0 - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision] + N[(N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq 1.4 \cdot 10^{-27}:\\
\;\;\;\;\left(\sqrt{1 + t} - \sqrt{t}\right) + 3\\
\mathbf{elif}\;z \leq 3.1 \cdot 10^{+16}:\\
\;\;\;\;\sqrt{1 + z} + \left(2 - \sqrt{z}\right)\\
\mathbf{else}:\\
\;\;\;\;\sqrt{1 + x} + \left(\left(\sqrt{1 + y} - \sqrt{y}\right) - \sqrt{x}\right)\\
\end{array}
\end{array}
if z < 1.4e-27Initial program 97.9%
associate-+l+97.9%
sub-neg97.9%
associate-+l+79.8%
associate-+l+49.7%
+-commutative49.7%
neg-sub049.7%
associate-+l-49.7%
neg-sub049.7%
Simplified32.9%
Taylor expanded in y around 0 28.3%
Taylor expanded in x around 0 22.5%
associate--l+42.0%
+-commutative42.0%
associate--l+35.3%
+-commutative35.3%
associate--r+35.3%
Simplified35.3%
Taylor expanded in z around 0 22.5%
associate--l+35.2%
Simplified35.2%
if 1.4e-27 < z < 3.1e16Initial program 88.5%
associate-+l+88.5%
sub-neg88.5%
associate-+l+79.7%
associate-+l+77.9%
+-commutative77.9%
neg-sub077.9%
associate-+l-77.9%
neg-sub077.9%
Simplified46.2%
Taylor expanded in y around 0 51.6%
Taylor expanded in x around 0 35.5%
associate--l+53.9%
+-commutative53.9%
associate--l+43.5%
+-commutative43.5%
associate--r+43.5%
Simplified43.5%
Taylor expanded in t around inf 33.3%
+-commutative33.3%
associate--l+33.5%
Simplified33.5%
if 3.1e16 < z Initial program 89.3%
associate-+l+89.3%
+-commutative89.3%
associate-+r-68.4%
associate-+l-58.0%
+-commutative58.0%
associate--l+58.0%
+-commutative58.0%
Simplified23.0%
Taylor expanded in t around inf 38.2%
+-commutative38.2%
+-commutative38.2%
associate--l+41.2%
Simplified41.2%
Taylor expanded in z around inf 41.2%
Final simplification38.1%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ 1.0 z))))
(if (<= z 5.2e-30)
(+ 2.0 (+ t_1 (- (- (sqrt (+ 1.0 t)) (sqrt z)) (sqrt t))))
(if (<= z 3.1e+16)
(+ t_1 (- 2.0 (sqrt z)))
(+ (sqrt (+ 1.0 x)) (- (- (sqrt (+ 1.0 y)) (sqrt y)) (sqrt x)))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + z));
double tmp;
if (z <= 5.2e-30) {
tmp = 2.0 + (t_1 + ((sqrt((1.0 + t)) - sqrt(z)) - sqrt(t)));
} else if (z <= 3.1e+16) {
tmp = t_1 + (2.0 - sqrt(z));
} else {
tmp = sqrt((1.0 + x)) + ((sqrt((1.0 + y)) - sqrt(y)) - sqrt(x));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = sqrt((1.0d0 + z))
if (z <= 5.2d-30) then
tmp = 2.0d0 + (t_1 + ((sqrt((1.0d0 + t)) - sqrt(z)) - sqrt(t)))
else if (z <= 3.1d+16) then
tmp = t_1 + (2.0d0 - sqrt(z))
else
tmp = sqrt((1.0d0 + x)) + ((sqrt((1.0d0 + y)) - sqrt(y)) - sqrt(x))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + z));
double tmp;
if (z <= 5.2e-30) {
tmp = 2.0 + (t_1 + ((Math.sqrt((1.0 + t)) - Math.sqrt(z)) - Math.sqrt(t)));
} else if (z <= 3.1e+16) {
tmp = t_1 + (2.0 - Math.sqrt(z));
} else {
tmp = Math.sqrt((1.0 + x)) + ((Math.sqrt((1.0 + y)) - Math.sqrt(y)) - Math.sqrt(x));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + z)) tmp = 0 if z <= 5.2e-30: tmp = 2.0 + (t_1 + ((math.sqrt((1.0 + t)) - math.sqrt(z)) - math.sqrt(t))) elif z <= 3.1e+16: tmp = t_1 + (2.0 - math.sqrt(z)) else: tmp = math.sqrt((1.0 + x)) + ((math.sqrt((1.0 + y)) - math.sqrt(y)) - math.sqrt(x)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(1.0 + z)) tmp = 0.0 if (z <= 5.2e-30) tmp = Float64(2.0 + Float64(t_1 + Float64(Float64(sqrt(Float64(1.0 + t)) - sqrt(z)) - sqrt(t)))); elseif (z <= 3.1e+16) tmp = Float64(t_1 + Float64(2.0 - sqrt(z))); else tmp = Float64(sqrt(Float64(1.0 + x)) + Float64(Float64(sqrt(Float64(1.0 + y)) - sqrt(y)) - sqrt(x))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + z));
tmp = 0.0;
if (z <= 5.2e-30)
tmp = 2.0 + (t_1 + ((sqrt((1.0 + t)) - sqrt(z)) - sqrt(t)));
elseif (z <= 3.1e+16)
tmp = t_1 + (2.0 - sqrt(z));
else
tmp = sqrt((1.0 + x)) + ((sqrt((1.0 + y)) - sqrt(y)) - sqrt(x));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[z, 5.2e-30], N[(2.0 + N[(t$95$1 + N[(N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.1e+16], N[(t$95$1 + N[(2.0 - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision] + N[(N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + z}\\
\mathbf{if}\;z \leq 5.2 \cdot 10^{-30}:\\
\;\;\;\;2 + \left(t_1 + \left(\left(\sqrt{1 + t} - \sqrt{z}\right) - \sqrt{t}\right)\right)\\
\mathbf{elif}\;z \leq 3.1 \cdot 10^{+16}:\\
\;\;\;\;t_1 + \left(2 - \sqrt{z}\right)\\
\mathbf{else}:\\
\;\;\;\;\sqrt{1 + x} + \left(\left(\sqrt{1 + y} - \sqrt{y}\right) - \sqrt{x}\right)\\
\end{array}
\end{array}
if z < 5.19999999999999973e-30Initial program 97.9%
associate-+l+97.9%
sub-neg97.9%
associate-+l+79.6%
associate-+l+49.3%
+-commutative49.3%
neg-sub049.3%
associate-+l-49.3%
neg-sub049.3%
Simplified32.3%
Taylor expanded in y around 0 27.6%
Taylor expanded in x around 0 21.8%
associate--l+41.5%
+-commutative41.5%
associate--l+34.7%
+-commutative34.7%
associate--r+34.7%
Simplified34.7%
if 5.19999999999999973e-30 < z < 3.1e16Initial program 89.2%
associate-+l+89.2%
sub-neg89.2%
associate-+l+81.0%
associate-+l+79.3%
+-commutative79.3%
neg-sub079.3%
associate-+l-79.3%
neg-sub079.3%
Simplified49.4%
Taylor expanded in y around 0 54.5%
Taylor expanded in x around 0 39.6%
associate--l+56.7%
+-commutative56.7%
associate--l+47.0%
+-commutative47.0%
associate--r+47.0%
Simplified47.0%
Taylor expanded in t around inf 32.5%
+-commutative32.5%
associate--l+32.7%
Simplified32.7%
if 3.1e16 < z Initial program 89.3%
associate-+l+89.3%
+-commutative89.3%
associate-+r-68.4%
associate-+l-58.0%
+-commutative58.0%
associate--l+58.0%
+-commutative58.0%
Simplified23.0%
Taylor expanded in t around inf 38.2%
+-commutative38.2%
+-commutative38.2%
associate--l+41.2%
Simplified41.2%
Taylor expanded in z around inf 41.2%
Final simplification37.8%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ 1.0 x))))
(if (<= y 1.35e-26)
(+ (+ (- (sqrt (+ 1.0 z)) (sqrt z)) (- (sqrt (+ 1.0 t)) (sqrt t))) 2.0)
(if (<= y 6e+15)
(- (+ (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 <= 1.35e-26) {
tmp = ((sqrt((1.0 + z)) - sqrt(z)) + (sqrt((1.0 + t)) - sqrt(t))) + 2.0;
} else if (y <= 6e+15) {
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 <= 1.35d-26) then
tmp = ((sqrt((1.0d0 + z)) - sqrt(z)) + (sqrt((1.0d0 + t)) - sqrt(t))) + 2.0d0
else if (y <= 6d+15) 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 <= 1.35e-26) {
tmp = ((Math.sqrt((1.0 + z)) - Math.sqrt(z)) + (Math.sqrt((1.0 + t)) - Math.sqrt(t))) + 2.0;
} else if (y <= 6e+15) {
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 <= 1.35e-26: tmp = ((math.sqrt((1.0 + z)) - math.sqrt(z)) + (math.sqrt((1.0 + t)) - math.sqrt(t))) + 2.0 elif y <= 6e+15: 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 <= 1.35e-26) tmp = Float64(Float64(Float64(sqrt(Float64(1.0 + z)) - sqrt(z)) + Float64(sqrt(Float64(1.0 + t)) - sqrt(t))) + 2.0); elseif (y <= 6e+15) tmp = Float64(Float64(sqrt(Float64(1.0 + y)) + 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 <= 1.35e-26)
tmp = ((sqrt((1.0 + z)) - sqrt(z)) + (sqrt((1.0 + t)) - sqrt(t))) + 2.0;
elseif (y <= 6e+15)
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, 1.35e-26], 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, 6e+15], N[(N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] + t$95$1), $MachinePrecision] - N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + x}\\
\mathbf{if}\;y \leq 1.35 \cdot 10^{-26}:\\
\;\;\;\;\left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\sqrt{1 + t} - \sqrt{t}\right)\right) + 2\\
\mathbf{elif}\;y \leq 6 \cdot 10^{+15}:\\
\;\;\;\;\left(\sqrt{1 + y} + t_1\right) - \left(\sqrt{y} + \sqrt{x}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{x} + t_1}\\
\end{array}
\end{array}
if y < 1.34999999999999991e-26Initial program 97.0%
associate-+l+97.0%
associate-+l-61.5%
+-commutative61.5%
sub-neg61.5%
sub-neg61.5%
+-commutative61.5%
+-commutative61.5%
Simplified61.5%
Taylor expanded in x around 0 58.2%
associate--l+58.3%
Simplified58.3%
Taylor expanded in y around 0 58.2%
if 1.34999999999999991e-26 < y < 6e15Initial program 92.2%
associate-+l+92.2%
+-commutative92.2%
associate-+r-50.6%
associate-+l-40.4%
+-commutative40.4%
associate--l+40.4%
+-commutative40.4%
Simplified21.1%
Taylor expanded in t around inf 36.6%
+-commutative36.6%
+-commutative36.6%
associate--l+35.5%
Simplified35.5%
Taylor expanded in z around inf 30.1%
+-commutative30.1%
Simplified30.1%
if 6e15 < y Initial program 89.5%
associate-+l+89.5%
+-commutative89.5%
associate-+r-89.5%
associate-+l-56.9%
+-commutative56.9%
associate--l+56.9%
+-commutative56.9%
Simplified37.7%
Taylor expanded in t around inf 31.5%
+-commutative31.5%
+-commutative31.5%
associate--l+33.2%
Simplified33.2%
Taylor expanded in y around inf 18.0%
+-commutative18.0%
+-commutative18.0%
associate--l+31.5%
+-commutative31.5%
+-commutative31.5%
Simplified31.5%
Taylor expanded in z around inf 24.5%
flip--91.5%
add-sqr-sqrt76.7%
add-sqr-sqrt92.3%
Applied egg-rr24.5%
associate--l+94.0%
+-inverses94.0%
metadata-eval94.0%
+-commutative94.0%
Simplified27.5%
Final simplification41.8%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (sqrt (+ 1.0 x)) (sqrt x))))
(if (<= z 1.1e-26)
(+ (- (sqrt (+ 1.0 t)) (sqrt t)) 3.0)
(if (<= z 3e+32)
(+ (sqrt (+ 1.0 z)) (- 2.0 (sqrt z)))
(if (or (<= z 2.6e+114) (and (not (<= z 1e+156)) (<= z 8e+196)))
(+ 1.0 t_1)
t_1)))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + x)) - sqrt(x);
double tmp;
if (z <= 1.1e-26) {
tmp = (sqrt((1.0 + t)) - sqrt(t)) + 3.0;
} else if (z <= 3e+32) {
tmp = sqrt((1.0 + z)) + (2.0 - sqrt(z));
} else if ((z <= 2.6e+114) || (!(z <= 1e+156) && (z <= 8e+196))) {
tmp = 1.0 + t_1;
} else {
tmp = t_1;
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = sqrt((1.0d0 + x)) - sqrt(x)
if (z <= 1.1d-26) then
tmp = (sqrt((1.0d0 + t)) - sqrt(t)) + 3.0d0
else if (z <= 3d+32) then
tmp = sqrt((1.0d0 + z)) + (2.0d0 - sqrt(z))
else if ((z <= 2.6d+114) .or. (.not. (z <= 1d+156)) .and. (z <= 8d+196)) then
tmp = 1.0d0 + t_1
else
tmp = t_1
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + x)) - Math.sqrt(x);
double tmp;
if (z <= 1.1e-26) {
tmp = (Math.sqrt((1.0 + t)) - Math.sqrt(t)) + 3.0;
} else if (z <= 3e+32) {
tmp = Math.sqrt((1.0 + z)) + (2.0 - Math.sqrt(z));
} else if ((z <= 2.6e+114) || (!(z <= 1e+156) && (z <= 8e+196))) {
tmp = 1.0 + t_1;
} else {
tmp = t_1;
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + x)) - math.sqrt(x) tmp = 0 if z <= 1.1e-26: tmp = (math.sqrt((1.0 + t)) - math.sqrt(t)) + 3.0 elif z <= 3e+32: tmp = math.sqrt((1.0 + z)) + (2.0 - math.sqrt(z)) elif (z <= 2.6e+114) or (not (z <= 1e+156) and (z <= 8e+196)): tmp = 1.0 + t_1 else: tmp = t_1 return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = Float64(sqrt(Float64(1.0 + x)) - sqrt(x)) tmp = 0.0 if (z <= 1.1e-26) tmp = Float64(Float64(sqrt(Float64(1.0 + t)) - sqrt(t)) + 3.0); elseif (z <= 3e+32) tmp = Float64(sqrt(Float64(1.0 + z)) + Float64(2.0 - sqrt(z))); elseif ((z <= 2.6e+114) || (!(z <= 1e+156) && (z <= 8e+196))) tmp = Float64(1.0 + t_1); else tmp = t_1; end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + x)) - sqrt(x);
tmp = 0.0;
if (z <= 1.1e-26)
tmp = (sqrt((1.0 + t)) - sqrt(t)) + 3.0;
elseif (z <= 3e+32)
tmp = sqrt((1.0 + z)) + (2.0 - sqrt(z));
elseif ((z <= 2.6e+114) || (~((z <= 1e+156)) && (z <= 8e+196)))
tmp = 1.0 + t_1;
else
tmp = t_1;
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, 1.1e-26], N[(N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision] + 3.0), $MachinePrecision], If[LessEqual[z, 3e+32], N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] + N[(2.0 - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[z, 2.6e+114], And[N[Not[LessEqual[z, 1e+156]], $MachinePrecision], LessEqual[z, 8e+196]]], N[(1.0 + t$95$1), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + x} - \sqrt{x}\\
\mathbf{if}\;z \leq 1.1 \cdot 10^{-26}:\\
\;\;\;\;\left(\sqrt{1 + t} - \sqrt{t}\right) + 3\\
\mathbf{elif}\;z \leq 3 \cdot 10^{+32}:\\
\;\;\;\;\sqrt{1 + z} + \left(2 - \sqrt{z}\right)\\
\mathbf{elif}\;z \leq 2.6 \cdot 10^{+114} \lor \neg \left(z \leq 10^{+156}\right) \land z \leq 8 \cdot 10^{+196}:\\
\;\;\;\;1 + t_1\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < 1.1e-26Initial program 97.9%
associate-+l+97.9%
sub-neg97.9%
associate-+l+79.8%
associate-+l+49.7%
+-commutative49.7%
neg-sub049.7%
associate-+l-49.7%
neg-sub049.7%
Simplified32.9%
Taylor expanded in y around 0 28.3%
Taylor expanded in x around 0 22.5%
associate--l+42.0%
+-commutative42.0%
associate--l+35.3%
+-commutative35.3%
associate--r+35.3%
Simplified35.3%
Taylor expanded in z around 0 22.5%
associate--l+35.2%
Simplified35.2%
if 1.1e-26 < z < 3e32Initial program 83.4%
associate-+l+83.4%
sub-neg83.4%
associate-+l+66.8%
associate-+l+65.2%
+-commutative65.2%
neg-sub065.2%
associate-+l-65.2%
neg-sub065.2%
Simplified34.7%
Taylor expanded in y around 0 32.8%
Taylor expanded in x around 0 24.3%
associate--l+38.7%
+-commutative38.7%
associate--l+30.5%
+-commutative30.5%
associate--r+30.5%
Simplified30.5%
Taylor expanded in t around inf 31.7%
+-commutative31.7%
associate--l+31.8%
Simplified31.8%
if 3e32 < z < 2.6e114 or 9.9999999999999998e155 < z < 7.9999999999999996e196Initial program 86.3%
associate-+l+86.3%
+-commutative86.3%
associate-+r-62.5%
associate-+l-58.2%
+-commutative58.2%
associate--l+58.2%
+-commutative58.2%
Simplified14.5%
Taylor expanded in t around inf 34.3%
+-commutative34.3%
+-commutative34.3%
associate--l+37.9%
Simplified37.9%
Taylor expanded in y around inf 3.2%
+-commutative3.2%
+-commutative3.2%
associate--l+21.2%
+-commutative21.2%
+-commutative21.2%
Simplified21.2%
Taylor expanded in z around 0 39.4%
associate--l+56.4%
Simplified56.4%
if 2.6e114 < z < 9.9999999999999998e155 or 7.9999999999999996e196 < z Initial program 94.8%
associate-+l+94.8%
+-commutative94.8%
associate-+r-77.7%
associate-+l-59.7%
+-commutative59.7%
associate--l+59.8%
+-commutative59.8%
Simplified30.5%
Taylor expanded in t around inf 43.9%
+-commutative43.9%
+-commutative43.9%
associate--l+45.9%
Simplified45.9%
Taylor expanded in y around inf 3.1%
+-commutative3.1%
+-commutative3.1%
associate--l+24.4%
+-commutative24.4%
+-commutative24.4%
Simplified24.4%
Taylor expanded in z around inf 24.7%
Final simplification37.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 t)) (sqrt t))))
(if (<= y 1.7e-153)
(+ t_1 3.0)
(if (<= y 3.0) (+ t_1 2.0) (- (sqrt (+ 1.0 x)) (sqrt x))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + t)) - sqrt(t);
double tmp;
if (y <= 1.7e-153) {
tmp = t_1 + 3.0;
} else if (y <= 3.0) {
tmp = t_1 + 2.0;
} 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) :: t_1
real(8) :: tmp
t_1 = sqrt((1.0d0 + t)) - sqrt(t)
if (y <= 1.7d-153) then
tmp = t_1 + 3.0d0
else if (y <= 3.0d0) then
tmp = t_1 + 2.0d0
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 t_1 = Math.sqrt((1.0 + t)) - Math.sqrt(t);
double tmp;
if (y <= 1.7e-153) {
tmp = t_1 + 3.0;
} else if (y <= 3.0) {
tmp = t_1 + 2.0;
} 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): t_1 = math.sqrt((1.0 + t)) - math.sqrt(t) tmp = 0 if y <= 1.7e-153: tmp = t_1 + 3.0 elif y <= 3.0: tmp = t_1 + 2.0 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) t_1 = Float64(sqrt(Float64(1.0 + t)) - sqrt(t)) tmp = 0.0 if (y <= 1.7e-153) tmp = Float64(t_1 + 3.0); elseif (y <= 3.0) tmp = Float64(t_1 + 2.0); 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)
t_1 = sqrt((1.0 + t)) - sqrt(t);
tmp = 0.0;
if (y <= 1.7e-153)
tmp = t_1 + 3.0;
elseif (y <= 3.0)
tmp = t_1 + 2.0;
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_] := Block[{t$95$1 = N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 1.7e-153], N[(t$95$1 + 3.0), $MachinePrecision], If[LessEqual[y, 3.0], N[(t$95$1 + 2.0), $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}
t_1 := \sqrt{1 + t} - \sqrt{t}\\
\mathbf{if}\;y \leq 1.7 \cdot 10^{-153}:\\
\;\;\;\;t_1 + 3\\
\mathbf{elif}\;y \leq 3:\\
\;\;\;\;t_1 + 2\\
\mathbf{else}:\\
\;\;\;\;\sqrt{1 + x} - \sqrt{x}\\
\end{array}
\end{array}
if y < 1.6999999999999999e-153Initial program 98.2%
associate-+l+98.2%
sub-neg98.2%
associate-+l+68.5%
associate-+l+63.6%
+-commutative63.6%
neg-sub063.6%
associate-+l-63.6%
neg-sub063.6%
Simplified31.9%
Taylor expanded in y around 0 31.9%
Taylor expanded in x around 0 17.9%
associate--l+59.2%
+-commutative59.2%
associate--l+49.8%
+-commutative49.8%
associate--r+49.8%
Simplified49.8%
Taylor expanded in z around 0 17.1%
associate--l+36.8%
Simplified36.8%
if 1.6999999999999999e-153 < y < 3Initial program 95.3%
associate-+l+95.4%
sub-neg95.4%
associate-+l+52.6%
associate-+l+46.6%
+-commutative46.6%
neg-sub046.6%
associate-+l-46.6%
neg-sub046.6%
Simplified25.9%
Taylor expanded in y around 0 25.3%
Taylor expanded in x around 0 20.5%
associate--l+52.8%
+-commutative52.8%
associate--l+42.0%
+-commutative42.0%
associate--r+42.0%
Simplified42.0%
Taylor expanded in z around inf 31.4%
associate--l+51.4%
Simplified51.4%
if 3 < y Initial program 89.4%
associate-+l+89.4%
+-commutative89.4%
associate-+r-88.3%
associate-+l-56.0%
+-commutative56.0%
associate--l+56.0%
+-commutative56.0%
Simplified37.4%
Taylor expanded in t around inf 31.4%
+-commutative31.4%
+-commutative31.4%
associate--l+33.0%
Simplified33.0%
Taylor expanded in y around inf 17.5%
+-commutative17.5%
+-commutative17.5%
associate--l+30.8%
+-commutative30.8%
+-commutative30.8%
Simplified30.8%
Taylor expanded in z around inf 24.0%
Final simplification34.3%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (sqrt (+ 1.0 t)) (sqrt t))))
(if (<= y 1.7e-153)
(+ t_1 3.0)
(if (<= y 16.0) (+ t_1 2.0) (/ 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 + t)) - sqrt(t);
double tmp;
if (y <= 1.7e-153) {
tmp = t_1 + 3.0;
} else if (y <= 16.0) {
tmp = t_1 + 2.0;
} 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 + t)) - sqrt(t)
if (y <= 1.7d-153) then
tmp = t_1 + 3.0d0
else if (y <= 16.0d0) then
tmp = t_1 + 2.0d0
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 + t)) - Math.sqrt(t);
double tmp;
if (y <= 1.7e-153) {
tmp = t_1 + 3.0;
} else if (y <= 16.0) {
tmp = t_1 + 2.0;
} 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 + t)) - math.sqrt(t) tmp = 0 if y <= 1.7e-153: tmp = t_1 + 3.0 elif y <= 16.0: tmp = t_1 + 2.0 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 + t)) - sqrt(t)) tmp = 0.0 if (y <= 1.7e-153) tmp = Float64(t_1 + 3.0); elseif (y <= 16.0) tmp = Float64(t_1 + 2.0); 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 + t)) - sqrt(t);
tmp = 0.0;
if (y <= 1.7e-153)
tmp = t_1 + 3.0;
elseif (y <= 16.0)
tmp = t_1 + 2.0;
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 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 1.7e-153], N[(t$95$1 + 3.0), $MachinePrecision], If[LessEqual[y, 16.0], N[(t$95$1 + 2.0), $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 + t} - \sqrt{t}\\
\mathbf{if}\;y \leq 1.7 \cdot 10^{-153}:\\
\;\;\;\;t_1 + 3\\
\mathbf{elif}\;y \leq 16:\\
\;\;\;\;t_1 + 2\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{x} + \sqrt{1 + x}}\\
\end{array}
\end{array}
if y < 1.6999999999999999e-153Initial program 98.2%
associate-+l+98.2%
sub-neg98.2%
associate-+l+68.5%
associate-+l+63.6%
+-commutative63.6%
neg-sub063.6%
associate-+l-63.6%
neg-sub063.6%
Simplified31.9%
Taylor expanded in y around 0 31.9%
Taylor expanded in x around 0 17.9%
associate--l+59.2%
+-commutative59.2%
associate--l+49.8%
+-commutative49.8%
associate--r+49.8%
Simplified49.8%
Taylor expanded in z around 0 17.1%
associate--l+36.8%
Simplified36.8%
if 1.6999999999999999e-153 < y < 16Initial program 95.3%
associate-+l+95.4%
sub-neg95.4%
associate-+l+52.6%
associate-+l+46.6%
+-commutative46.6%
neg-sub046.6%
associate-+l-46.6%
neg-sub046.6%
Simplified25.9%
Taylor expanded in y around 0 25.3%
Taylor expanded in x around 0 20.5%
associate--l+52.8%
+-commutative52.8%
associate--l+42.0%
+-commutative42.0%
associate--r+42.0%
Simplified42.0%
Taylor expanded in z around inf 31.4%
associate--l+51.4%
Simplified51.4%
if 16 < y Initial program 89.4%
associate-+l+89.4%
+-commutative89.4%
associate-+r-88.3%
associate-+l-56.0%
+-commutative56.0%
associate--l+56.0%
+-commutative56.0%
Simplified37.4%
Taylor expanded in t around inf 31.4%
+-commutative31.4%
+-commutative31.4%
associate--l+33.0%
Simplified33.0%
Taylor expanded in y around inf 17.5%
+-commutative17.5%
+-commutative17.5%
associate--l+30.8%
+-commutative30.8%
+-commutative30.8%
Simplified30.8%
Taylor expanded in z around inf 24.0%
flip--91.7%
add-sqr-sqrt75.8%
add-sqr-sqrt92.4%
Applied egg-rr24.0%
associate--l+94.1%
+-inverses94.1%
metadata-eval94.1%
+-commutative94.1%
Simplified27.0%
Final simplification35.7%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (let* ((t_1 (- (sqrt (+ 1.0 x)) (sqrt x)))) (if (<= y 5.5) (+ 1.0 t_1) t_1)))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + x)) - sqrt(x);
double tmp;
if (y <= 5.5) {
tmp = 1.0 + t_1;
} else {
tmp = t_1;
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = sqrt((1.0d0 + x)) - sqrt(x)
if (y <= 5.5d0) then
tmp = 1.0d0 + t_1
else
tmp = t_1
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + x)) - Math.sqrt(x);
double tmp;
if (y <= 5.5) {
tmp = 1.0 + t_1;
} else {
tmp = t_1;
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + x)) - math.sqrt(x) tmp = 0 if y <= 5.5: tmp = 1.0 + t_1 else: tmp = t_1 return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = Float64(sqrt(Float64(1.0 + x)) - sqrt(x)) tmp = 0.0 if (y <= 5.5) tmp = Float64(1.0 + t_1); else tmp = t_1; end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + x)) - sqrt(x);
tmp = 0.0;
if (y <= 5.5)
tmp = 1.0 + t_1;
else
tmp = t_1;
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 5.5], N[(1.0 + t$95$1), $MachinePrecision], t$95$1]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + x} - \sqrt{x}\\
\mathbf{if}\;y \leq 5.5:\\
\;\;\;\;1 + t_1\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if y < 5.5Initial program 96.7%
associate-+l+96.8%
+-commutative96.8%
associate-+r-60.4%
associate-+l-55.0%
+-commutative55.0%
associate--l+55.0%
+-commutative55.0%
Simplified36.7%
Taylor expanded in t around inf 35.8%
+-commutative35.8%
+-commutative35.8%
associate--l+37.1%
Simplified37.1%
Taylor expanded in y around inf 7.8%
+-commutative7.8%
+-commutative7.8%
associate--l+12.3%
+-commutative12.3%
+-commutative12.3%
Simplified12.3%
Taylor expanded in z around 0 27.1%
associate--l+42.4%
Simplified42.4%
if 5.5 < y Initial program 89.4%
associate-+l+89.4%
+-commutative89.4%
associate-+r-88.3%
associate-+l-56.0%
+-commutative56.0%
associate--l+56.0%
+-commutative56.0%
Simplified37.4%
Taylor expanded in t around inf 31.4%
+-commutative31.4%
+-commutative31.4%
associate--l+33.0%
Simplified33.0%
Taylor expanded in y around inf 17.5%
+-commutative17.5%
+-commutative17.5%
associate--l+30.8%
+-commutative30.8%
+-commutative30.8%
Simplified30.8%
Taylor expanded in z around inf 24.0%
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 2.65) (+ (- (sqrt (+ 1.0 t)) (sqrt t)) 2.0) (- (sqrt (+ 1.0 x)) (sqrt x))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 2.65) {
tmp = (sqrt((1.0 + t)) - sqrt(t)) + 2.0;
} 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.65d0) then
tmp = (sqrt((1.0d0 + t)) - sqrt(t)) + 2.0d0
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.65) {
tmp = (Math.sqrt((1.0 + t)) - Math.sqrt(t)) + 2.0;
} 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.65: tmp = (math.sqrt((1.0 + t)) - math.sqrt(t)) + 2.0 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.65) tmp = Float64(Float64(sqrt(Float64(1.0 + t)) - sqrt(t)) + 2.0); 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.65)
tmp = (sqrt((1.0 + t)) - sqrt(t)) + 2.0;
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.65], N[(N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision] + 2.0), $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.65:\\
\;\;\;\;\left(\sqrt{1 + t} - \sqrt{t}\right) + 2\\
\mathbf{else}:\\
\;\;\;\;\sqrt{1 + x} - \sqrt{x}\\
\end{array}
\end{array}
if y < 2.64999999999999991Initial program 96.7%
associate-+l+96.8%
sub-neg96.8%
associate-+l+60.4%
associate-+l+55.0%
+-commutative55.0%
neg-sub055.0%
associate-+l-55.0%
neg-sub055.0%
Simplified28.8%
Taylor expanded in y around 0 28.6%
Taylor expanded in x around 0 19.2%
associate--l+56.0%
+-commutative56.0%
associate--l+45.8%
+-commutative45.8%
associate--r+45.8%
Simplified45.8%
Taylor expanded in z around inf 29.8%
associate--l+57.4%
Simplified57.4%
if 2.64999999999999991 < y Initial program 89.4%
associate-+l+89.4%
+-commutative89.4%
associate-+r-88.3%
associate-+l-56.0%
+-commutative56.0%
associate--l+56.0%
+-commutative56.0%
Simplified37.4%
Taylor expanded in t around inf 31.4%
+-commutative31.4%
+-commutative31.4%
associate--l+33.0%
Simplified33.0%
Taylor expanded in y around inf 17.5%
+-commutative17.5%
+-commutative17.5%
associate--l+30.8%
+-commutative30.8%
+-commutative30.8%
Simplified30.8%
Taylor expanded in z around inf 24.0%
Final simplification40.9%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (- (sqrt (+ 1.0 x)) (sqrt x)))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
return sqrt((1.0 + x)) - sqrt(x);
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = sqrt((1.0d0 + x)) - sqrt(x)
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
return Math.sqrt((1.0 + x)) - Math.sqrt(x);
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): return math.sqrt((1.0 + x)) - math.sqrt(x)
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) return Float64(sqrt(Float64(1.0 + x)) - sqrt(x)) end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp = code(x, y, z, t)
tmp = sqrt((1.0 + x)) - sqrt(x);
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := N[(N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\sqrt{1 + x} - \sqrt{x}
\end{array}
Initial program 93.1%
associate-+l+93.1%
+-commutative93.1%
associate-+r-74.2%
associate-+l-55.5%
+-commutative55.5%
associate--l+55.5%
+-commutative55.5%
Simplified37.1%
Taylor expanded in t around inf 33.6%
+-commutative33.6%
+-commutative33.6%
associate--l+35.1%
Simplified35.1%
Taylor expanded in y around inf 12.6%
+-commutative12.6%
+-commutative12.6%
associate--l+21.4%
+-commutative21.4%
+-commutative21.4%
Simplified21.4%
Taylor expanded in z around inf 17.2%
Final simplification17.2%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 1.0)
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
return 1.0;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = 1.0d0
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
return 1.0;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): return 1.0
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) return 1.0 end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp = code(x, y, z, t)
tmp = 1.0;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := 1.0
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
1
\end{array}
Initial program 93.1%
associate-+l+93.1%
+-commutative93.1%
associate-+r-74.2%
associate-+l-55.5%
+-commutative55.5%
associate--l+55.5%
+-commutative55.5%
Simplified37.1%
Taylor expanded in t around inf 33.6%
+-commutative33.6%
+-commutative33.6%
associate--l+35.1%
Simplified35.1%
Taylor expanded in y around inf 12.6%
+-commutative12.6%
+-commutative12.6%
associate--l+21.4%
+-commutative21.4%
+-commutative21.4%
Simplified21.4%
Taylor expanded in z around inf 17.2%
Taylor expanded in x around 0 35.8%
Final simplification35.8%
(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 2023221
(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))))