
(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 y)))
(t_3 (sqrt (+ 1.0 t)))
(t_4 (sqrt (+ z 1.0))))
(if (<= z 1.1e+30)
(+
(/ 1.0 (+ (sqrt t) t_3))
(+ (+ (- t_1 (sqrt x)) (- t_2 (sqrt y))) (/ 1.0 (+ (sqrt z) t_4))))
(+
(- t_3 (sqrt t))
(+
(+ (/ 1.0 (+ (sqrt x) t_1)) (/ 1.0 (+ t_2 (sqrt y))))
(- t_4 (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 + x));
double t_2 = sqrt((1.0 + y));
double t_3 = sqrt((1.0 + t));
double t_4 = sqrt((z + 1.0));
double tmp;
if (z <= 1.1e+30) {
tmp = (1.0 / (sqrt(t) + t_3)) + (((t_1 - sqrt(x)) + (t_2 - sqrt(y))) + (1.0 / (sqrt(z) + t_4)));
} else {
tmp = (t_3 - sqrt(t)) + (((1.0 / (sqrt(x) + t_1)) + (1.0 / (t_2 + sqrt(y)))) + (t_4 - sqrt(z)));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: tmp
t_1 = sqrt((1.0d0 + x))
t_2 = sqrt((1.0d0 + y))
t_3 = sqrt((1.0d0 + t))
t_4 = sqrt((z + 1.0d0))
if (z <= 1.1d+30) then
tmp = (1.0d0 / (sqrt(t) + t_3)) + (((t_1 - sqrt(x)) + (t_2 - sqrt(y))) + (1.0d0 / (sqrt(z) + t_4)))
else
tmp = (t_3 - sqrt(t)) + (((1.0d0 / (sqrt(x) + t_1)) + (1.0d0 / (t_2 + sqrt(y)))) + (t_4 - 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 + x));
double t_2 = Math.sqrt((1.0 + y));
double t_3 = Math.sqrt((1.0 + t));
double t_4 = Math.sqrt((z + 1.0));
double tmp;
if (z <= 1.1e+30) {
tmp = (1.0 / (Math.sqrt(t) + t_3)) + (((t_1 - Math.sqrt(x)) + (t_2 - Math.sqrt(y))) + (1.0 / (Math.sqrt(z) + t_4)));
} else {
tmp = (t_3 - Math.sqrt(t)) + (((1.0 / (Math.sqrt(x) + t_1)) + (1.0 / (t_2 + Math.sqrt(y)))) + (t_4 - 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 + x)) t_2 = math.sqrt((1.0 + y)) t_3 = math.sqrt((1.0 + t)) t_4 = math.sqrt((z + 1.0)) tmp = 0 if z <= 1.1e+30: tmp = (1.0 / (math.sqrt(t) + t_3)) + (((t_1 - math.sqrt(x)) + (t_2 - math.sqrt(y))) + (1.0 / (math.sqrt(z) + t_4))) else: tmp = (t_3 - math.sqrt(t)) + (((1.0 / (math.sqrt(x) + t_1)) + (1.0 / (t_2 + math.sqrt(y)))) + (t_4 - 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 + x)) t_2 = sqrt(Float64(1.0 + y)) t_3 = sqrt(Float64(1.0 + t)) t_4 = sqrt(Float64(z + 1.0)) tmp = 0.0 if (z <= 1.1e+30) tmp = Float64(Float64(1.0 / Float64(sqrt(t) + t_3)) + Float64(Float64(Float64(t_1 - sqrt(x)) + Float64(t_2 - sqrt(y))) + Float64(1.0 / Float64(sqrt(z) + t_4)))); else tmp = Float64(Float64(t_3 - sqrt(t)) + Float64(Float64(Float64(1.0 / Float64(sqrt(x) + t_1)) + Float64(1.0 / Float64(t_2 + sqrt(y)))) + Float64(t_4 - 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 + x));
t_2 = sqrt((1.0 + y));
t_3 = sqrt((1.0 + t));
t_4 = sqrt((z + 1.0));
tmp = 0.0;
if (z <= 1.1e+30)
tmp = (1.0 / (sqrt(t) + t_3)) + (((t_1 - sqrt(x)) + (t_2 - sqrt(y))) + (1.0 / (sqrt(z) + t_4)));
else
tmp = (t_3 - sqrt(t)) + (((1.0 / (sqrt(x) + t_1)) + (1.0 / (t_2 + sqrt(y)))) + (t_4 - 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 + x), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$4 = N[Sqrt[N[(z + 1.0), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[z, 1.1e+30], N[(N[(1.0 / N[(N[Sqrt[t], $MachinePrecision] + t$95$3), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(t$95$1 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(t$95$2 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[z], $MachinePrecision] + t$95$4), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(t$95$3 - N[Sqrt[t], $MachinePrecision]), $MachinePrecision] + N[(N[(N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(t$95$2 + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$4 - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + x}\\
t_2 := \sqrt{1 + y}\\
t_3 := \sqrt{1 + t}\\
t_4 := \sqrt{z + 1}\\
\mathbf{if}\;z \leq 1.1 \cdot 10^{+30}:\\
\;\;\;\;\frac{1}{\sqrt{t} + t_3} + \left(\left(\left(t_1 - \sqrt{x}\right) + \left(t_2 - \sqrt{y}\right)\right) + \frac{1}{\sqrt{z} + t_4}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(t_3 - \sqrt{t}\right) + \left(\left(\frac{1}{\sqrt{x} + t_1} + \frac{1}{t_2 + \sqrt{y}}\right) + \left(t_4 - \sqrt{z}\right)\right)\\
\end{array}
\end{array}
if z < 1.1e30Initial program 95.5%
+-commutative95.5%
associate-+r-95.0%
+-commutative95.0%
associate-+r-95.5%
associate-+l+95.5%
Simplified95.5%
flip--95.8%
add-sqr-sqrt95.4%
add-sqr-sqrt96.6%
Applied egg-rr96.6%
associate--l+97.1%
+-inverses97.1%
metadata-eval97.1%
+-commutative97.1%
+-commutative97.1%
Simplified97.1%
flip--97.3%
add-sqr-sqrt79.4%
add-sqr-sqrt97.8%
Applied egg-rr97.8%
associate--l+98.2%
+-inverses98.2%
metadata-eval98.2%
+-commutative98.2%
+-commutative98.2%
Simplified98.2%
if 1.1e30 < z Initial program 86.5%
+-commutative86.5%
associate-+r-19.4%
+-commutative19.4%
associate-+r-86.5%
associate-+l+86.5%
Simplified86.5%
flip--86.5%
add-sqr-sqrt64.3%
add-sqr-sqrt87.3%
Applied egg-rr87.3%
+-commutative87.3%
associate--l+90.8%
+-inverses90.8%
metadata-eval90.8%
+-commutative90.8%
+-commutative90.8%
Simplified90.8%
flip--91.5%
add-sqr-sqrt70.4%
add-sqr-sqrt91.8%
Applied egg-rr91.8%
associate--l+93.3%
+-inverses93.3%
metadata-eval93.3%
Simplified93.3%
Final simplification96.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 t)))
(t_2 (sqrt (+ 1.0 x)))
(t_3 (- t_2 (sqrt x)))
(t_4 (sqrt (+ z 1.0)))
(t_5 (+ (sqrt z) t_4))
(t_6 (sqrt (+ 1.0 y)))
(t_7 (+ t_3 (- t_6 (sqrt y)))))
(if (<= t_7 0.1)
(+
(- t_1 (sqrt t))
(+
(- t_4 (sqrt z))
(+ (/ 1.0 (+ (sqrt x) t_2)) (/ 1.0 (+ (sqrt y) (+ 1.0 (* y 0.5)))))))
(if (<= t_7 2.0)
(+
t_2
(+ (/ 1.0 (+ t_6 (sqrt y))) (- (/ (+ 1.0 (- z z)) t_5) (sqrt x))))
(+ (/ 1.0 (+ (sqrt t) t_1)) (+ (/ 1.0 t_5) (+ 1.0 t_3)))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + t));
double t_2 = sqrt((1.0 + x));
double t_3 = t_2 - sqrt(x);
double t_4 = sqrt((z + 1.0));
double t_5 = sqrt(z) + t_4;
double t_6 = sqrt((1.0 + y));
double t_7 = t_3 + (t_6 - sqrt(y));
double tmp;
if (t_7 <= 0.1) {
tmp = (t_1 - sqrt(t)) + ((t_4 - sqrt(z)) + ((1.0 / (sqrt(x) + t_2)) + (1.0 / (sqrt(y) + (1.0 + (y * 0.5))))));
} else if (t_7 <= 2.0) {
tmp = t_2 + ((1.0 / (t_6 + sqrt(y))) + (((1.0 + (z - z)) / t_5) - sqrt(x)));
} else {
tmp = (1.0 / (sqrt(t) + t_1)) + ((1.0 / t_5) + (1.0 + t_3));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: t_5
real(8) :: t_6
real(8) :: t_7
real(8) :: tmp
t_1 = sqrt((1.0d0 + t))
t_2 = sqrt((1.0d0 + x))
t_3 = t_2 - sqrt(x)
t_4 = sqrt((z + 1.0d0))
t_5 = sqrt(z) + t_4
t_6 = sqrt((1.0d0 + y))
t_7 = t_3 + (t_6 - sqrt(y))
if (t_7 <= 0.1d0) then
tmp = (t_1 - sqrt(t)) + ((t_4 - sqrt(z)) + ((1.0d0 / (sqrt(x) + t_2)) + (1.0d0 / (sqrt(y) + (1.0d0 + (y * 0.5d0))))))
else if (t_7 <= 2.0d0) then
tmp = t_2 + ((1.0d0 / (t_6 + sqrt(y))) + (((1.0d0 + (z - z)) / t_5) - sqrt(x)))
else
tmp = (1.0d0 / (sqrt(t) + t_1)) + ((1.0d0 / t_5) + (1.0d0 + t_3))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + t));
double t_2 = Math.sqrt((1.0 + x));
double t_3 = t_2 - Math.sqrt(x);
double t_4 = Math.sqrt((z + 1.0));
double t_5 = Math.sqrt(z) + t_4;
double t_6 = Math.sqrt((1.0 + y));
double t_7 = t_3 + (t_6 - Math.sqrt(y));
double tmp;
if (t_7 <= 0.1) {
tmp = (t_1 - Math.sqrt(t)) + ((t_4 - Math.sqrt(z)) + ((1.0 / (Math.sqrt(x) + t_2)) + (1.0 / (Math.sqrt(y) + (1.0 + (y * 0.5))))));
} else if (t_7 <= 2.0) {
tmp = t_2 + ((1.0 / (t_6 + Math.sqrt(y))) + (((1.0 + (z - z)) / t_5) - Math.sqrt(x)));
} else {
tmp = (1.0 / (Math.sqrt(t) + t_1)) + ((1.0 / t_5) + (1.0 + t_3));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + t)) t_2 = math.sqrt((1.0 + x)) t_3 = t_2 - math.sqrt(x) t_4 = math.sqrt((z + 1.0)) t_5 = math.sqrt(z) + t_4 t_6 = math.sqrt((1.0 + y)) t_7 = t_3 + (t_6 - math.sqrt(y)) tmp = 0 if t_7 <= 0.1: tmp = (t_1 - math.sqrt(t)) + ((t_4 - math.sqrt(z)) + ((1.0 / (math.sqrt(x) + t_2)) + (1.0 / (math.sqrt(y) + (1.0 + (y * 0.5)))))) elif t_7 <= 2.0: tmp = t_2 + ((1.0 / (t_6 + math.sqrt(y))) + (((1.0 + (z - z)) / t_5) - math.sqrt(x))) else: tmp = (1.0 / (math.sqrt(t) + t_1)) + ((1.0 / t_5) + (1.0 + t_3)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(1.0 + t)) t_2 = sqrt(Float64(1.0 + x)) t_3 = Float64(t_2 - sqrt(x)) t_4 = sqrt(Float64(z + 1.0)) t_5 = Float64(sqrt(z) + t_4) t_6 = sqrt(Float64(1.0 + y)) t_7 = Float64(t_3 + Float64(t_6 - sqrt(y))) tmp = 0.0 if (t_7 <= 0.1) tmp = Float64(Float64(t_1 - sqrt(t)) + Float64(Float64(t_4 - sqrt(z)) + Float64(Float64(1.0 / Float64(sqrt(x) + t_2)) + Float64(1.0 / Float64(sqrt(y) + Float64(1.0 + Float64(y * 0.5))))))); elseif (t_7 <= 2.0) tmp = Float64(t_2 + Float64(Float64(1.0 / Float64(t_6 + sqrt(y))) + Float64(Float64(Float64(1.0 + Float64(z - z)) / t_5) - sqrt(x)))); else tmp = Float64(Float64(1.0 / Float64(sqrt(t) + t_1)) + Float64(Float64(1.0 / t_5) + Float64(1.0 + t_3))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + t));
t_2 = sqrt((1.0 + x));
t_3 = t_2 - sqrt(x);
t_4 = sqrt((z + 1.0));
t_5 = sqrt(z) + t_4;
t_6 = sqrt((1.0 + y));
t_7 = t_3 + (t_6 - sqrt(y));
tmp = 0.0;
if (t_7 <= 0.1)
tmp = (t_1 - sqrt(t)) + ((t_4 - sqrt(z)) + ((1.0 / (sqrt(x) + t_2)) + (1.0 / (sqrt(y) + (1.0 + (y * 0.5))))));
elseif (t_7 <= 2.0)
tmp = t_2 + ((1.0 / (t_6 + sqrt(y))) + (((1.0 + (z - z)) / t_5) - sqrt(x)));
else
tmp = (1.0 / (sqrt(t) + t_1)) + ((1.0 / t_5) + (1.0 + t_3));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[(t$95$2 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[Sqrt[N[(z + 1.0), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$5 = N[(N[Sqrt[z], $MachinePrecision] + t$95$4), $MachinePrecision]}, Block[{t$95$6 = N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$7 = N[(t$95$3 + N[(t$95$6 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$7, 0.1], N[(N[(t$95$1 - N[Sqrt[t], $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$4 - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + t$95$2), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[y], $MachinePrecision] + N[(1.0 + N[(y * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$7, 2.0], N[(t$95$2 + N[(N[(1.0 / N[(t$95$6 + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(1.0 + N[(z - z), $MachinePrecision]), $MachinePrecision] / t$95$5), $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[(N[Sqrt[t], $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 / t$95$5), $MachinePrecision] + N[(1.0 + t$95$3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + t}\\
t_2 := \sqrt{1 + x}\\
t_3 := t_2 - \sqrt{x}\\
t_4 := \sqrt{z + 1}\\
t_5 := \sqrt{z} + t_4\\
t_6 := \sqrt{1 + y}\\
t_7 := t_3 + \left(t_6 - \sqrt{y}\right)\\
\mathbf{if}\;t_7 \leq 0.1:\\
\;\;\;\;\left(t_1 - \sqrt{t}\right) + \left(\left(t_4 - \sqrt{z}\right) + \left(\frac{1}{\sqrt{x} + t_2} + \frac{1}{\sqrt{y} + \left(1 + y \cdot 0.5\right)}\right)\right)\\
\mathbf{elif}\;t_7 \leq 2:\\
\;\;\;\;t_2 + \left(\frac{1}{t_6 + \sqrt{y}} + \left(\frac{1 + \left(z - z\right)}{t_5} - \sqrt{x}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{t} + t_1} + \left(\frac{1}{t_5} + \left(1 + t_3\right)\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))) < 0.10000000000000001Initial program 76.1%
+-commutative76.1%
associate-+r-72.2%
+-commutative72.2%
associate-+r-76.1%
associate-+l+76.1%
Simplified76.1%
flip--76.1%
add-sqr-sqrt38.5%
add-sqr-sqrt77.5%
Applied egg-rr77.5%
+-commutative77.5%
associate--l+83.9%
+-inverses83.9%
metadata-eval83.9%
+-commutative83.9%
+-commutative83.9%
Simplified83.9%
flip--85.2%
add-sqr-sqrt39.7%
add-sqr-sqrt85.4%
Applied egg-rr85.4%
associate--l+89.1%
+-inverses89.1%
metadata-eval89.1%
Simplified89.1%
Taylor expanded in y around 0 81.6%
*-commutative81.6%
Simplified81.6%
if 0.10000000000000001 < (+.f64 (-.f64 (sqrt.f64 (+.f64 x 1)) (sqrt.f64 x)) (-.f64 (sqrt.f64 (+.f64 y 1)) (sqrt.f64 y))) < 2Initial program 96.6%
associate-+l+96.6%
+-commutative96.6%
associate-+r-67.7%
associate-+l-63.5%
+-commutative63.5%
+-commutative63.5%
associate--l+63.4%
Simplified43.4%
Taylor expanded in t around inf 37.5%
associate--l+38.2%
+-commutative38.2%
Simplified38.2%
flip--97.2%
add-sqr-sqrt79.9%
add-sqr-sqrt97.4%
Applied egg-rr38.4%
associate--l+97.5%
+-inverses97.5%
metadata-eval97.5%
Simplified38.4%
flip--38.6%
add-sqr-sqrt31.0%
add-sqr-sqrt38.7%
+-commutative38.7%
+-commutative38.7%
Applied egg-rr38.7%
+-commutative38.7%
associate--r+38.8%
+-commutative38.8%
Simplified38.8%
if 2 < (+.f64 (-.f64 (sqrt.f64 (+.f64 x 1)) (sqrt.f64 x)) (-.f64 (sqrt.f64 (+.f64 y 1)) (sqrt.f64 y))) Initial program 91.4%
+-commutative91.4%
associate-+r-60.7%
+-commutative60.7%
associate-+r-91.4%
associate-+l+91.4%
Simplified91.4%
flip--91.6%
add-sqr-sqrt72.4%
add-sqr-sqrt92.0%
Applied egg-rr92.0%
associate--l+92.8%
+-inverses92.8%
metadata-eval92.8%
+-commutative92.8%
+-commutative92.8%
Simplified92.8%
Taylor expanded in y around 0 55.3%
flip--93.1%
add-sqr-sqrt75.4%
add-sqr-sqrt93.5%
Applied egg-rr55.4%
associate--l+95.5%
+-inverses95.5%
metadata-eval95.5%
+-commutative95.5%
+-commutative95.5%
Simplified55.7%
Final simplification49.6%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ 1.0 t)))
(t_2 (sqrt (+ 1.0 x)))
(t_3 (- t_2 (sqrt x)))
(t_4 (sqrt (+ z 1.0)))
(t_5 (sqrt (+ 1.0 y)))
(t_6 (- t_5 (sqrt y)))
(t_7 (+ t_3 t_6))
(t_8 (+ (sqrt z) t_4)))
(if (<= t_7 0.1)
(+ (- t_1 (sqrt t)) (+ (- t_4 (sqrt z)) (+ t_6 (/ 1.0 (+ (sqrt x) t_2)))))
(if (<= t_7 2.0)
(+
t_2
(+ (/ 1.0 (+ t_5 (sqrt y))) (- (/ (+ 1.0 (- z z)) t_8) (sqrt x))))
(+ (/ 1.0 (+ (sqrt t) t_1)) (+ (/ 1.0 t_8) (+ 1.0 t_3)))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + t));
double t_2 = sqrt((1.0 + x));
double t_3 = t_2 - sqrt(x);
double t_4 = sqrt((z + 1.0));
double t_5 = sqrt((1.0 + y));
double t_6 = t_5 - sqrt(y);
double t_7 = t_3 + t_6;
double t_8 = sqrt(z) + t_4;
double tmp;
if (t_7 <= 0.1) {
tmp = (t_1 - sqrt(t)) + ((t_4 - sqrt(z)) + (t_6 + (1.0 / (sqrt(x) + t_2))));
} else if (t_7 <= 2.0) {
tmp = t_2 + ((1.0 / (t_5 + sqrt(y))) + (((1.0 + (z - z)) / t_8) - sqrt(x)));
} else {
tmp = (1.0 / (sqrt(t) + t_1)) + ((1.0 / t_8) + (1.0 + t_3));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: t_5
real(8) :: t_6
real(8) :: t_7
real(8) :: t_8
real(8) :: tmp
t_1 = sqrt((1.0d0 + t))
t_2 = sqrt((1.0d0 + x))
t_3 = t_2 - sqrt(x)
t_4 = sqrt((z + 1.0d0))
t_5 = sqrt((1.0d0 + y))
t_6 = t_5 - sqrt(y)
t_7 = t_3 + t_6
t_8 = sqrt(z) + t_4
if (t_7 <= 0.1d0) then
tmp = (t_1 - sqrt(t)) + ((t_4 - sqrt(z)) + (t_6 + (1.0d0 / (sqrt(x) + t_2))))
else if (t_7 <= 2.0d0) then
tmp = t_2 + ((1.0d0 / (t_5 + sqrt(y))) + (((1.0d0 + (z - z)) / t_8) - sqrt(x)))
else
tmp = (1.0d0 / (sqrt(t) + t_1)) + ((1.0d0 / t_8) + (1.0d0 + t_3))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + t));
double t_2 = Math.sqrt((1.0 + x));
double t_3 = t_2 - Math.sqrt(x);
double t_4 = Math.sqrt((z + 1.0));
double t_5 = Math.sqrt((1.0 + y));
double t_6 = t_5 - Math.sqrt(y);
double t_7 = t_3 + t_6;
double t_8 = Math.sqrt(z) + t_4;
double tmp;
if (t_7 <= 0.1) {
tmp = (t_1 - Math.sqrt(t)) + ((t_4 - Math.sqrt(z)) + (t_6 + (1.0 / (Math.sqrt(x) + t_2))));
} else if (t_7 <= 2.0) {
tmp = t_2 + ((1.0 / (t_5 + Math.sqrt(y))) + (((1.0 + (z - z)) / t_8) - Math.sqrt(x)));
} else {
tmp = (1.0 / (Math.sqrt(t) + t_1)) + ((1.0 / t_8) + (1.0 + t_3));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + t)) t_2 = math.sqrt((1.0 + x)) t_3 = t_2 - math.sqrt(x) t_4 = math.sqrt((z + 1.0)) t_5 = math.sqrt((1.0 + y)) t_6 = t_5 - math.sqrt(y) t_7 = t_3 + t_6 t_8 = math.sqrt(z) + t_4 tmp = 0 if t_7 <= 0.1: tmp = (t_1 - math.sqrt(t)) + ((t_4 - math.sqrt(z)) + (t_6 + (1.0 / (math.sqrt(x) + t_2)))) elif t_7 <= 2.0: tmp = t_2 + ((1.0 / (t_5 + math.sqrt(y))) + (((1.0 + (z - z)) / t_8) - math.sqrt(x))) else: tmp = (1.0 / (math.sqrt(t) + t_1)) + ((1.0 / t_8) + (1.0 + t_3)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(1.0 + t)) t_2 = sqrt(Float64(1.0 + x)) t_3 = Float64(t_2 - sqrt(x)) t_4 = sqrt(Float64(z + 1.0)) t_5 = sqrt(Float64(1.0 + y)) t_6 = Float64(t_5 - sqrt(y)) t_7 = Float64(t_3 + t_6) t_8 = Float64(sqrt(z) + t_4) tmp = 0.0 if (t_7 <= 0.1) tmp = Float64(Float64(t_1 - sqrt(t)) + Float64(Float64(t_4 - sqrt(z)) + Float64(t_6 + Float64(1.0 / Float64(sqrt(x) + t_2))))); elseif (t_7 <= 2.0) tmp = Float64(t_2 + Float64(Float64(1.0 / Float64(t_5 + sqrt(y))) + Float64(Float64(Float64(1.0 + Float64(z - z)) / t_8) - sqrt(x)))); else tmp = Float64(Float64(1.0 / Float64(sqrt(t) + t_1)) + Float64(Float64(1.0 / t_8) + Float64(1.0 + t_3))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + t));
t_2 = sqrt((1.0 + x));
t_3 = t_2 - sqrt(x);
t_4 = sqrt((z + 1.0));
t_5 = sqrt((1.0 + y));
t_6 = t_5 - sqrt(y);
t_7 = t_3 + t_6;
t_8 = sqrt(z) + t_4;
tmp = 0.0;
if (t_7 <= 0.1)
tmp = (t_1 - sqrt(t)) + ((t_4 - sqrt(z)) + (t_6 + (1.0 / (sqrt(x) + t_2))));
elseif (t_7 <= 2.0)
tmp = t_2 + ((1.0 / (t_5 + sqrt(y))) + (((1.0 + (z - z)) / t_8) - sqrt(x)));
else
tmp = (1.0 / (sqrt(t) + t_1)) + ((1.0 / t_8) + (1.0 + t_3));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[(t$95$2 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[Sqrt[N[(z + 1.0), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$5 = N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$6 = N[(t$95$5 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$7 = N[(t$95$3 + t$95$6), $MachinePrecision]}, Block[{t$95$8 = N[(N[Sqrt[z], $MachinePrecision] + t$95$4), $MachinePrecision]}, If[LessEqual[t$95$7, 0.1], N[(N[(t$95$1 - N[Sqrt[t], $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$4 - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] + N[(t$95$6 + N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$7, 2.0], N[(t$95$2 + N[(N[(1.0 / N[(t$95$5 + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(1.0 + N[(z - z), $MachinePrecision]), $MachinePrecision] / t$95$8), $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[(N[Sqrt[t], $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 / t$95$8), $MachinePrecision] + N[(1.0 + t$95$3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + t}\\
t_2 := \sqrt{1 + x}\\
t_3 := t_2 - \sqrt{x}\\
t_4 := \sqrt{z + 1}\\
t_5 := \sqrt{1 + y}\\
t_6 := t_5 - \sqrt{y}\\
t_7 := t_3 + t_6\\
t_8 := \sqrt{z} + t_4\\
\mathbf{if}\;t_7 \leq 0.1:\\
\;\;\;\;\left(t_1 - \sqrt{t}\right) + \left(\left(t_4 - \sqrt{z}\right) + \left(t_6 + \frac{1}{\sqrt{x} + t_2}\right)\right)\\
\mathbf{elif}\;t_7 \leq 2:\\
\;\;\;\;t_2 + \left(\frac{1}{t_5 + \sqrt{y}} + \left(\frac{1 + \left(z - z\right)}{t_8} - \sqrt{x}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{t} + t_1} + \left(\frac{1}{t_8} + \left(1 + t_3\right)\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))) < 0.10000000000000001Initial program 76.1%
+-commutative76.1%
associate-+r-72.2%
+-commutative72.2%
associate-+r-76.1%
associate-+l+76.1%
Simplified76.1%
flip--76.1%
add-sqr-sqrt38.5%
add-sqr-sqrt77.5%
Applied egg-rr77.5%
+-commutative77.5%
associate--l+83.9%
+-inverses83.9%
metadata-eval83.9%
+-commutative83.9%
+-commutative83.9%
Simplified83.9%
if 0.10000000000000001 < (+.f64 (-.f64 (sqrt.f64 (+.f64 x 1)) (sqrt.f64 x)) (-.f64 (sqrt.f64 (+.f64 y 1)) (sqrt.f64 y))) < 2Initial program 96.6%
associate-+l+96.6%
+-commutative96.6%
associate-+r-67.7%
associate-+l-63.5%
+-commutative63.5%
+-commutative63.5%
associate--l+63.4%
Simplified43.4%
Taylor expanded in t around inf 37.5%
associate--l+38.2%
+-commutative38.2%
Simplified38.2%
flip--97.2%
add-sqr-sqrt79.9%
add-sqr-sqrt97.4%
Applied egg-rr38.4%
associate--l+97.5%
+-inverses97.5%
metadata-eval97.5%
Simplified38.4%
flip--38.6%
add-sqr-sqrt31.0%
add-sqr-sqrt38.7%
+-commutative38.7%
+-commutative38.7%
Applied egg-rr38.7%
+-commutative38.7%
associate--r+38.8%
+-commutative38.8%
Simplified38.8%
if 2 < (+.f64 (-.f64 (sqrt.f64 (+.f64 x 1)) (sqrt.f64 x)) (-.f64 (sqrt.f64 (+.f64 y 1)) (sqrt.f64 y))) Initial program 91.4%
+-commutative91.4%
associate-+r-60.7%
+-commutative60.7%
associate-+r-91.4%
associate-+l+91.4%
Simplified91.4%
flip--91.6%
add-sqr-sqrt72.4%
add-sqr-sqrt92.0%
Applied egg-rr92.0%
associate--l+92.8%
+-inverses92.8%
metadata-eval92.8%
+-commutative92.8%
+-commutative92.8%
Simplified92.8%
Taylor expanded in y around 0 55.3%
flip--93.1%
add-sqr-sqrt75.4%
add-sqr-sqrt93.5%
Applied egg-rr55.4%
associate--l+95.5%
+-inverses95.5%
metadata-eval95.5%
+-commutative95.5%
+-commutative95.5%
Simplified55.7%
Final simplification50.2%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ z 1.0)))
(t_2 (sqrt (+ 1.0 x)))
(t_3 (- t_2 (sqrt x)))
(t_4 (sqrt (+ 1.0 y)))
(t_5 (- (sqrt (+ 1.0 t)) (sqrt t))))
(if (<= t_3 0.1)
(+ t_5 (+ (- t_1 (sqrt z)) (+ (- t_4 (sqrt y)) (/ 1.0 (+ (sqrt x) t_2)))))
(+ t_5 (+ (/ 1.0 (+ (sqrt z) t_1)) (+ t_3 (/ 1.0 (+ t_4 (sqrt y)))))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((z + 1.0));
double t_2 = sqrt((1.0 + x));
double t_3 = t_2 - sqrt(x);
double t_4 = sqrt((1.0 + y));
double t_5 = sqrt((1.0 + t)) - sqrt(t);
double tmp;
if (t_3 <= 0.1) {
tmp = t_5 + ((t_1 - sqrt(z)) + ((t_4 - sqrt(y)) + (1.0 / (sqrt(x) + t_2))));
} else {
tmp = t_5 + ((1.0 / (sqrt(z) + t_1)) + (t_3 + (1.0 / (t_4 + sqrt(y)))));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: t_5
real(8) :: tmp
t_1 = sqrt((z + 1.0d0))
t_2 = sqrt((1.0d0 + x))
t_3 = t_2 - sqrt(x)
t_4 = sqrt((1.0d0 + y))
t_5 = sqrt((1.0d0 + t)) - sqrt(t)
if (t_3 <= 0.1d0) then
tmp = t_5 + ((t_1 - sqrt(z)) + ((t_4 - sqrt(y)) + (1.0d0 / (sqrt(x) + t_2))))
else
tmp = t_5 + ((1.0d0 / (sqrt(z) + t_1)) + (t_3 + (1.0d0 / (t_4 + sqrt(y)))))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((z + 1.0));
double t_2 = Math.sqrt((1.0 + x));
double t_3 = t_2 - Math.sqrt(x);
double t_4 = Math.sqrt((1.0 + y));
double t_5 = Math.sqrt((1.0 + t)) - Math.sqrt(t);
double tmp;
if (t_3 <= 0.1) {
tmp = t_5 + ((t_1 - Math.sqrt(z)) + ((t_4 - Math.sqrt(y)) + (1.0 / (Math.sqrt(x) + t_2))));
} else {
tmp = t_5 + ((1.0 / (Math.sqrt(z) + t_1)) + (t_3 + (1.0 / (t_4 + Math.sqrt(y)))));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((z + 1.0)) t_2 = math.sqrt((1.0 + x)) t_3 = t_2 - math.sqrt(x) t_4 = math.sqrt((1.0 + y)) t_5 = math.sqrt((1.0 + t)) - math.sqrt(t) tmp = 0 if t_3 <= 0.1: tmp = t_5 + ((t_1 - math.sqrt(z)) + ((t_4 - math.sqrt(y)) + (1.0 / (math.sqrt(x) + t_2)))) else: tmp = t_5 + ((1.0 / (math.sqrt(z) + t_1)) + (t_3 + (1.0 / (t_4 + math.sqrt(y))))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(z + 1.0)) t_2 = sqrt(Float64(1.0 + x)) t_3 = Float64(t_2 - sqrt(x)) t_4 = sqrt(Float64(1.0 + y)) t_5 = Float64(sqrt(Float64(1.0 + t)) - sqrt(t)) tmp = 0.0 if (t_3 <= 0.1) tmp = Float64(t_5 + Float64(Float64(t_1 - sqrt(z)) + Float64(Float64(t_4 - sqrt(y)) + Float64(1.0 / Float64(sqrt(x) + t_2))))); else tmp = Float64(t_5 + Float64(Float64(1.0 / Float64(sqrt(z) + t_1)) + Float64(t_3 + Float64(1.0 / Float64(t_4 + sqrt(y)))))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((z + 1.0));
t_2 = sqrt((1.0 + x));
t_3 = t_2 - sqrt(x);
t_4 = sqrt((1.0 + y));
t_5 = sqrt((1.0 + t)) - sqrt(t);
tmp = 0.0;
if (t_3 <= 0.1)
tmp = t_5 + ((t_1 - sqrt(z)) + ((t_4 - sqrt(y)) + (1.0 / (sqrt(x) + t_2))));
else
tmp = t_5 + ((1.0 / (sqrt(z) + t_1)) + (t_3 + (1.0 / (t_4 + sqrt(y)))));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(z + 1.0), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[(t$95$2 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$5 = N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$3, 0.1], N[(t$95$5 + N[(N[(t$95$1 - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$4 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$5 + N[(N[(1.0 / N[(N[Sqrt[z], $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision] + N[(t$95$3 + N[(1.0 / N[(t$95$4 + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{z + 1}\\
t_2 := \sqrt{1 + x}\\
t_3 := t_2 - \sqrt{x}\\
t_4 := \sqrt{1 + y}\\
t_5 := \sqrt{1 + t} - \sqrt{t}\\
\mathbf{if}\;t_3 \leq 0.1:\\
\;\;\;\;t_5 + \left(\left(t_1 - \sqrt{z}\right) + \left(\left(t_4 - \sqrt{y}\right) + \frac{1}{\sqrt{x} + t_2}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_5 + \left(\frac{1}{\sqrt{z} + t_1} + \left(t_3 + \frac{1}{t_4 + \sqrt{y}}\right)\right)\\
\end{array}
\end{array}
if (-.f64 (sqrt.f64 (+.f64 x 1)) (sqrt.f64 x)) < 0.10000000000000001Initial program 86.8%
+-commutative86.8%
associate-+r-62.3%
+-commutative62.3%
associate-+r-86.8%
associate-+l+86.8%
Simplified86.8%
flip--87.0%
add-sqr-sqrt47.9%
add-sqr-sqrt88.0%
Applied egg-rr88.0%
+-commutative88.0%
associate--l+91.3%
+-inverses91.3%
metadata-eval91.3%
+-commutative91.3%
+-commutative91.3%
Simplified91.3%
if 0.10000000000000001 < (-.f64 (sqrt.f64 (+.f64 x 1)) (sqrt.f64 x)) Initial program 96.9%
+-commutative96.9%
associate-+r-58.8%
+-commutative58.8%
associate-+r-96.9%
associate-+l+96.9%
Simplified96.9%
flip--97.1%
add-sqr-sqrt76.6%
add-sqr-sqrt97.4%
Applied egg-rr97.4%
associate--l+97.6%
+-inverses97.6%
metadata-eval97.6%
+-commutative97.6%
+-commutative97.6%
Simplified97.6%
flip--96.9%
add-sqr-sqrt68.5%
add-sqr-sqrt97.2%
Applied egg-rr97.9%
associate--l+97.3%
+-inverses97.3%
metadata-eval97.3%
Simplified98.0%
Final simplification94.4%
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 t)) (sqrt t))
(+
(+
(/ 1.0 (+ (sqrt x) (sqrt (+ 1.0 x))))
(/ 1.0 (+ (sqrt (+ 1.0 y)) (sqrt y))))
(- (sqrt (+ z 1.0)) (sqrt z)))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
return (sqrt((1.0 + t)) - sqrt(t)) + (((1.0 / (sqrt(x) + sqrt((1.0 + x)))) + (1.0 / (sqrt((1.0 + y)) + sqrt(y)))) + (sqrt((z + 1.0)) - sqrt(z)));
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (sqrt((1.0d0 + t)) - sqrt(t)) + (((1.0d0 / (sqrt(x) + sqrt((1.0d0 + x)))) + (1.0d0 / (sqrt((1.0d0 + y)) + sqrt(y)))) + (sqrt((z + 1.0d0)) - sqrt(z)))
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 + t)) - Math.sqrt(t)) + (((1.0 / (Math.sqrt(x) + Math.sqrt((1.0 + x)))) + (1.0 / (Math.sqrt((1.0 + y)) + Math.sqrt(y)))) + (Math.sqrt((z + 1.0)) - Math.sqrt(z)));
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): return (math.sqrt((1.0 + t)) - math.sqrt(t)) + (((1.0 / (math.sqrt(x) + math.sqrt((1.0 + x)))) + (1.0 / (math.sqrt((1.0 + y)) + math.sqrt(y)))) + (math.sqrt((z + 1.0)) - math.sqrt(z)))
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) return Float64(Float64(sqrt(Float64(1.0 + t)) - sqrt(t)) + Float64(Float64(Float64(1.0 / Float64(sqrt(x) + sqrt(Float64(1.0 + x)))) + Float64(1.0 / Float64(sqrt(Float64(1.0 + y)) + sqrt(y)))) + Float64(sqrt(Float64(z + 1.0)) - sqrt(z)))) end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp = code(x, y, z, t)
tmp = (sqrt((1.0 + t)) - sqrt(t)) + (((1.0 / (sqrt(x) + sqrt((1.0 + x)))) + (1.0 / (sqrt((1.0 + y)) + sqrt(y)))) + (sqrt((z + 1.0)) - sqrt(z)));
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := N[(N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision] + N[(N[(N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(z + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\left(\sqrt{1 + t} - \sqrt{t}\right) + \left(\left(\frac{1}{\sqrt{x} + \sqrt{1 + x}} + \frac{1}{\sqrt{1 + y} + \sqrt{y}}\right) + \left(\sqrt{z + 1} - \sqrt{z}\right)\right)
\end{array}
Initial program 91.4%
+-commutative91.4%
associate-+r-60.7%
+-commutative60.7%
associate-+r-91.4%
associate-+l+91.4%
Simplified91.4%
flip--91.5%
add-sqr-sqrt70.3%
add-sqr-sqrt92.1%
Applied egg-rr92.1%
+-commutative92.1%
associate--l+93.9%
+-inverses93.9%
metadata-eval93.9%
+-commutative93.9%
+-commutative93.9%
Simplified93.9%
flip--94.2%
add-sqr-sqrt69.7%
add-sqr-sqrt94.4%
Applied egg-rr94.4%
associate--l+95.4%
+-inverses95.4%
metadata-eval95.4%
Simplified95.4%
Final simplification95.4%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (+ (sqrt z) (sqrt (+ z 1.0)))) (t_2 (sqrt (+ 1.0 x))))
(if (<= y 6.2e-34)
(+
(/ 1.0 (+ (sqrt t) (sqrt (+ 1.0 t))))
(+ (/ 1.0 t_1) (+ 1.0 (- t_2 (sqrt x)))))
(if (<= y 2.8e+37)
(+
t_2
(+
(/ 1.0 (+ (sqrt (+ 1.0 y)) (sqrt y)))
(- (/ (+ 1.0 (- z z)) t_1) (sqrt x))))
(/ 1.0 (+ (sqrt x) t_2))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt(z) + sqrt((z + 1.0));
double t_2 = sqrt((1.0 + x));
double tmp;
if (y <= 6.2e-34) {
tmp = (1.0 / (sqrt(t) + sqrt((1.0 + t)))) + ((1.0 / t_1) + (1.0 + (t_2 - sqrt(x))));
} else if (y <= 2.8e+37) {
tmp = t_2 + ((1.0 / (sqrt((1.0 + y)) + sqrt(y))) + (((1.0 + (z - z)) / t_1) - sqrt(x)));
} else {
tmp = 1.0 / (sqrt(x) + t_2);
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = sqrt(z) + sqrt((z + 1.0d0))
t_2 = sqrt((1.0d0 + x))
if (y <= 6.2d-34) then
tmp = (1.0d0 / (sqrt(t) + sqrt((1.0d0 + t)))) + ((1.0d0 / t_1) + (1.0d0 + (t_2 - sqrt(x))))
else if (y <= 2.8d+37) then
tmp = t_2 + ((1.0d0 / (sqrt((1.0d0 + y)) + sqrt(y))) + (((1.0d0 + (z - z)) / t_1) - sqrt(x)))
else
tmp = 1.0d0 / (sqrt(x) + t_2)
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt(z) + Math.sqrt((z + 1.0));
double t_2 = Math.sqrt((1.0 + x));
double tmp;
if (y <= 6.2e-34) {
tmp = (1.0 / (Math.sqrt(t) + Math.sqrt((1.0 + t)))) + ((1.0 / t_1) + (1.0 + (t_2 - Math.sqrt(x))));
} else if (y <= 2.8e+37) {
tmp = t_2 + ((1.0 / (Math.sqrt((1.0 + y)) + Math.sqrt(y))) + (((1.0 + (z - z)) / t_1) - Math.sqrt(x)));
} else {
tmp = 1.0 / (Math.sqrt(x) + t_2);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt(z) + math.sqrt((z + 1.0)) t_2 = math.sqrt((1.0 + x)) tmp = 0 if y <= 6.2e-34: tmp = (1.0 / (math.sqrt(t) + math.sqrt((1.0 + t)))) + ((1.0 / t_1) + (1.0 + (t_2 - math.sqrt(x)))) elif y <= 2.8e+37: tmp = t_2 + ((1.0 / (math.sqrt((1.0 + y)) + math.sqrt(y))) + (((1.0 + (z - z)) / t_1) - math.sqrt(x))) else: tmp = 1.0 / (math.sqrt(x) + t_2) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = Float64(sqrt(z) + sqrt(Float64(z + 1.0))) t_2 = sqrt(Float64(1.0 + x)) tmp = 0.0 if (y <= 6.2e-34) tmp = Float64(Float64(1.0 / Float64(sqrt(t) + sqrt(Float64(1.0 + t)))) + Float64(Float64(1.0 / t_1) + Float64(1.0 + Float64(t_2 - sqrt(x))))); elseif (y <= 2.8e+37) tmp = Float64(t_2 + Float64(Float64(1.0 / Float64(sqrt(Float64(1.0 + y)) + sqrt(y))) + Float64(Float64(Float64(1.0 + Float64(z - z)) / t_1) - sqrt(x)))); else tmp = Float64(1.0 / Float64(sqrt(x) + t_2)); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt(z) + sqrt((z + 1.0));
t_2 = sqrt((1.0 + x));
tmp = 0.0;
if (y <= 6.2e-34)
tmp = (1.0 / (sqrt(t) + sqrt((1.0 + t)))) + ((1.0 / t_1) + (1.0 + (t_2 - sqrt(x))));
elseif (y <= 2.8e+37)
tmp = t_2 + ((1.0 / (sqrt((1.0 + y)) + sqrt(y))) + (((1.0 + (z - z)) / t_1) - sqrt(x)));
else
tmp = 1.0 / (sqrt(x) + t_2);
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[Sqrt[z], $MachinePrecision] + N[Sqrt[N[(z + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y, 6.2e-34], N[(N[(1.0 / N[(N[Sqrt[t], $MachinePrecision] + N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 / t$95$1), $MachinePrecision] + N[(1.0 + N[(t$95$2 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.8e+37], N[(t$95$2 + N[(N[(1.0 / N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(1.0 + N[(z - z), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + t$95$2), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{z} + \sqrt{z + 1}\\
t_2 := \sqrt{1 + x}\\
\mathbf{if}\;y \leq 6.2 \cdot 10^{-34}:\\
\;\;\;\;\frac{1}{\sqrt{t} + \sqrt{1 + t}} + \left(\frac{1}{t_1} + \left(1 + \left(t_2 - \sqrt{x}\right)\right)\right)\\
\mathbf{elif}\;y \leq 2.8 \cdot 10^{+37}:\\
\;\;\;\;t_2 + \left(\frac{1}{\sqrt{1 + y} + \sqrt{y}} + \left(\frac{1 + \left(z - z\right)}{t_1} - \sqrt{x}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{x} + t_2}\\
\end{array}
\end{array}
if y < 6.1999999999999996e-34Initial program 97.6%
+-commutative97.6%
associate-+r-58.0%
+-commutative58.0%
associate-+r-97.6%
associate-+l+97.6%
Simplified97.6%
flip--97.5%
add-sqr-sqrt72.5%
add-sqr-sqrt97.9%
Applied egg-rr97.9%
associate--l+98.4%
+-inverses98.4%
metadata-eval98.4%
+-commutative98.4%
+-commutative98.4%
Simplified98.4%
Taylor expanded in y around 0 98.4%
flip--98.4%
add-sqr-sqrt77.6%
add-sqr-sqrt98.7%
Applied egg-rr98.7%
associate--l+99.2%
+-inverses99.2%
metadata-eval99.2%
+-commutative99.2%
+-commutative99.2%
Simplified99.2%
if 6.1999999999999996e-34 < y < 2.7999999999999998e37Initial program 83.9%
associate-+l+83.9%
+-commutative83.9%
associate-+r-54.4%
associate-+l-36.0%
+-commutative36.0%
+-commutative36.0%
associate--l+36.0%
Simplified26.2%
Taylor expanded in t around inf 20.7%
associate--l+20.3%
+-commutative20.3%
Simplified20.3%
flip--88.2%
add-sqr-sqrt79.8%
add-sqr-sqrt89.8%
Applied egg-rr21.5%
associate--l+97.3%
+-inverses97.3%
metadata-eval97.3%
Simplified21.5%
flip--21.5%
add-sqr-sqrt20.5%
add-sqr-sqrt21.5%
+-commutative21.5%
+-commutative21.5%
Applied egg-rr21.5%
+-commutative21.5%
associate--r+21.5%
+-commutative21.5%
Simplified21.5%
if 2.7999999999999998e37 < y Initial program 87.5%
associate-+l+87.5%
+-commutative87.5%
associate-+r-87.5%
associate-+l-53.8%
+-commutative53.8%
+-commutative53.8%
associate--l+53.8%
Simplified32.2%
Taylor expanded in t around inf 34.8%
associate--l+36.6%
+-commutative36.6%
Simplified36.6%
Taylor expanded in z around inf 3.2%
associate--l+22.0%
+-commutative22.0%
Simplified22.0%
Taylor expanded in y around inf 23.3%
flip--23.3%
add-sqr-sqrt23.4%
add-sqr-sqrt24.0%
+-commutative24.0%
Applied egg-rr24.0%
associate--l+28.5%
+-inverses28.5%
metadata-eval28.5%
Simplified28.5%
Final simplification58.3%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ z 1.0))) (t_2 (sqrt (+ 1.0 x))))
(if (<= y 1e-34)
(+
(/ 1.0 (+ (sqrt t) (sqrt (+ 1.0 t))))
(+ (/ 1.0 (+ (sqrt z) t_1)) (+ 1.0 (- t_2 (sqrt x)))))
(if (<= y 3.7e+37)
(+
t_2
(+
(/ 1.0 (+ (sqrt (+ 1.0 y)) (sqrt y)))
(- (- t_1 (sqrt z)) (sqrt x))))
(/ 1.0 (+ (sqrt x) t_2))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((z + 1.0));
double t_2 = sqrt((1.0 + x));
double tmp;
if (y <= 1e-34) {
tmp = (1.0 / (sqrt(t) + sqrt((1.0 + t)))) + ((1.0 / (sqrt(z) + t_1)) + (1.0 + (t_2 - sqrt(x))));
} else if (y <= 3.7e+37) {
tmp = t_2 + ((1.0 / (sqrt((1.0 + y)) + sqrt(y))) + ((t_1 - sqrt(z)) - sqrt(x)));
} else {
tmp = 1.0 / (sqrt(x) + t_2);
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = sqrt((z + 1.0d0))
t_2 = sqrt((1.0d0 + x))
if (y <= 1d-34) then
tmp = (1.0d0 / (sqrt(t) + sqrt((1.0d0 + t)))) + ((1.0d0 / (sqrt(z) + t_1)) + (1.0d0 + (t_2 - sqrt(x))))
else if (y <= 3.7d+37) then
tmp = t_2 + ((1.0d0 / (sqrt((1.0d0 + y)) + sqrt(y))) + ((t_1 - sqrt(z)) - sqrt(x)))
else
tmp = 1.0d0 / (sqrt(x) + t_2)
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((z + 1.0));
double t_2 = Math.sqrt((1.0 + x));
double tmp;
if (y <= 1e-34) {
tmp = (1.0 / (Math.sqrt(t) + Math.sqrt((1.0 + t)))) + ((1.0 / (Math.sqrt(z) + t_1)) + (1.0 + (t_2 - Math.sqrt(x))));
} else if (y <= 3.7e+37) {
tmp = t_2 + ((1.0 / (Math.sqrt((1.0 + y)) + Math.sqrt(y))) + ((t_1 - Math.sqrt(z)) - Math.sqrt(x)));
} else {
tmp = 1.0 / (Math.sqrt(x) + t_2);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((z + 1.0)) t_2 = math.sqrt((1.0 + x)) tmp = 0 if y <= 1e-34: tmp = (1.0 / (math.sqrt(t) + math.sqrt((1.0 + t)))) + ((1.0 / (math.sqrt(z) + t_1)) + (1.0 + (t_2 - math.sqrt(x)))) elif y <= 3.7e+37: tmp = t_2 + ((1.0 / (math.sqrt((1.0 + y)) + math.sqrt(y))) + ((t_1 - math.sqrt(z)) - math.sqrt(x))) else: tmp = 1.0 / (math.sqrt(x) + t_2) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(z + 1.0)) t_2 = sqrt(Float64(1.0 + x)) tmp = 0.0 if (y <= 1e-34) tmp = Float64(Float64(1.0 / Float64(sqrt(t) + sqrt(Float64(1.0 + t)))) + Float64(Float64(1.0 / Float64(sqrt(z) + t_1)) + Float64(1.0 + Float64(t_2 - sqrt(x))))); elseif (y <= 3.7e+37) tmp = Float64(t_2 + Float64(Float64(1.0 / Float64(sqrt(Float64(1.0 + y)) + sqrt(y))) + Float64(Float64(t_1 - sqrt(z)) - sqrt(x)))); else tmp = Float64(1.0 / Float64(sqrt(x) + t_2)); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((z + 1.0));
t_2 = sqrt((1.0 + x));
tmp = 0.0;
if (y <= 1e-34)
tmp = (1.0 / (sqrt(t) + sqrt((1.0 + t)))) + ((1.0 / (sqrt(z) + t_1)) + (1.0 + (t_2 - sqrt(x))));
elseif (y <= 3.7e+37)
tmp = t_2 + ((1.0 / (sqrt((1.0 + y)) + sqrt(y))) + ((t_1 - sqrt(z)) - sqrt(x)));
else
tmp = 1.0 / (sqrt(x) + t_2);
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(z + 1.0), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y, 1e-34], N[(N[(1.0 / N[(N[Sqrt[t], $MachinePrecision] + N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 / N[(N[Sqrt[z], $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision] + N[(1.0 + N[(t$95$2 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3.7e+37], N[(t$95$2 + N[(N[(1.0 / N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$1 - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + t$95$2), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{z + 1}\\
t_2 := \sqrt{1 + x}\\
\mathbf{if}\;y \leq 10^{-34}:\\
\;\;\;\;\frac{1}{\sqrt{t} + \sqrt{1 + t}} + \left(\frac{1}{\sqrt{z} + t_1} + \left(1 + \left(t_2 - \sqrt{x}\right)\right)\right)\\
\mathbf{elif}\;y \leq 3.7 \cdot 10^{+37}:\\
\;\;\;\;t_2 + \left(\frac{1}{\sqrt{1 + y} + \sqrt{y}} + \left(\left(t_1 - \sqrt{z}\right) - \sqrt{x}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{x} + t_2}\\
\end{array}
\end{array}
if y < 9.99999999999999928e-35Initial program 97.6%
+-commutative97.6%
associate-+r-58.0%
+-commutative58.0%
associate-+r-97.6%
associate-+l+97.6%
Simplified97.6%
flip--97.5%
add-sqr-sqrt72.5%
add-sqr-sqrt97.9%
Applied egg-rr97.9%
associate--l+98.4%
+-inverses98.4%
metadata-eval98.4%
+-commutative98.4%
+-commutative98.4%
Simplified98.4%
Taylor expanded in y around 0 98.4%
flip--98.4%
add-sqr-sqrt77.6%
add-sqr-sqrt98.7%
Applied egg-rr98.7%
associate--l+99.2%
+-inverses99.2%
metadata-eval99.2%
+-commutative99.2%
+-commutative99.2%
Simplified99.2%
if 9.99999999999999928e-35 < y < 3.6999999999999999e37Initial program 83.9%
associate-+l+83.9%
+-commutative83.9%
associate-+r-54.4%
associate-+l-36.0%
+-commutative36.0%
+-commutative36.0%
associate--l+36.0%
Simplified26.2%
Taylor expanded in t around inf 20.7%
associate--l+20.3%
+-commutative20.3%
Simplified20.3%
flip--88.2%
add-sqr-sqrt79.8%
add-sqr-sqrt89.8%
Applied egg-rr21.5%
associate--l+97.3%
+-inverses97.3%
metadata-eval97.3%
Simplified21.5%
if 3.6999999999999999e37 < y Initial program 87.5%
associate-+l+87.5%
+-commutative87.5%
associate-+r-87.5%
associate-+l-53.8%
+-commutative53.8%
+-commutative53.8%
associate--l+53.8%
Simplified32.2%
Taylor expanded in t around inf 34.8%
associate--l+36.6%
+-commutative36.6%
Simplified36.6%
Taylor expanded in z around inf 3.2%
associate--l+22.0%
+-commutative22.0%
Simplified22.0%
Taylor expanded in y around inf 23.3%
flip--23.3%
add-sqr-sqrt23.4%
add-sqr-sqrt24.0%
+-commutative24.0%
Applied egg-rr24.0%
associate--l+28.5%
+-inverses28.5%
metadata-eval28.5%
Simplified28.5%
Final simplification58.3%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ z 1.0))) (t_2 (sqrt (+ 1.0 x))))
(if (<= y 4.8e-34)
(+ (- (sqrt (+ 1.0 t)) (sqrt t)) (+ (/ 1.0 (+ (sqrt z) t_1)) 2.0))
(if (<= y 3.7e+37)
(+
t_2
(+
(/ 1.0 (+ (sqrt (+ 1.0 y)) (sqrt y)))
(- (- t_1 (sqrt z)) (sqrt x))))
(/ 1.0 (+ (sqrt x) t_2))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((z + 1.0));
double t_2 = sqrt((1.0 + x));
double tmp;
if (y <= 4.8e-34) {
tmp = (sqrt((1.0 + t)) - sqrt(t)) + ((1.0 / (sqrt(z) + t_1)) + 2.0);
} else if (y <= 3.7e+37) {
tmp = t_2 + ((1.0 / (sqrt((1.0 + y)) + sqrt(y))) + ((t_1 - sqrt(z)) - sqrt(x)));
} else {
tmp = 1.0 / (sqrt(x) + t_2);
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = sqrt((z + 1.0d0))
t_2 = sqrt((1.0d0 + x))
if (y <= 4.8d-34) then
tmp = (sqrt((1.0d0 + t)) - sqrt(t)) + ((1.0d0 / (sqrt(z) + t_1)) + 2.0d0)
else if (y <= 3.7d+37) then
tmp = t_2 + ((1.0d0 / (sqrt((1.0d0 + y)) + sqrt(y))) + ((t_1 - sqrt(z)) - sqrt(x)))
else
tmp = 1.0d0 / (sqrt(x) + t_2)
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((z + 1.0));
double t_2 = Math.sqrt((1.0 + x));
double tmp;
if (y <= 4.8e-34) {
tmp = (Math.sqrt((1.0 + t)) - Math.sqrt(t)) + ((1.0 / (Math.sqrt(z) + t_1)) + 2.0);
} else if (y <= 3.7e+37) {
tmp = t_2 + ((1.0 / (Math.sqrt((1.0 + y)) + Math.sqrt(y))) + ((t_1 - Math.sqrt(z)) - Math.sqrt(x)));
} else {
tmp = 1.0 / (Math.sqrt(x) + t_2);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((z + 1.0)) t_2 = math.sqrt((1.0 + x)) tmp = 0 if y <= 4.8e-34: tmp = (math.sqrt((1.0 + t)) - math.sqrt(t)) + ((1.0 / (math.sqrt(z) + t_1)) + 2.0) elif y <= 3.7e+37: tmp = t_2 + ((1.0 / (math.sqrt((1.0 + y)) + math.sqrt(y))) + ((t_1 - math.sqrt(z)) - math.sqrt(x))) else: tmp = 1.0 / (math.sqrt(x) + t_2) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(z + 1.0)) t_2 = sqrt(Float64(1.0 + x)) tmp = 0.0 if (y <= 4.8e-34) tmp = Float64(Float64(sqrt(Float64(1.0 + t)) - sqrt(t)) + Float64(Float64(1.0 / Float64(sqrt(z) + t_1)) + 2.0)); elseif (y <= 3.7e+37) tmp = Float64(t_2 + Float64(Float64(1.0 / Float64(sqrt(Float64(1.0 + y)) + sqrt(y))) + Float64(Float64(t_1 - sqrt(z)) - sqrt(x)))); else tmp = Float64(1.0 / Float64(sqrt(x) + t_2)); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((z + 1.0));
t_2 = sqrt((1.0 + x));
tmp = 0.0;
if (y <= 4.8e-34)
tmp = (sqrt((1.0 + t)) - sqrt(t)) + ((1.0 / (sqrt(z) + t_1)) + 2.0);
elseif (y <= 3.7e+37)
tmp = t_2 + ((1.0 / (sqrt((1.0 + y)) + sqrt(y))) + ((t_1 - sqrt(z)) - sqrt(x)));
else
tmp = 1.0 / (sqrt(x) + t_2);
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(z + 1.0), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y, 4.8e-34], N[(N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 / N[(N[Sqrt[z], $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3.7e+37], N[(t$95$2 + N[(N[(1.0 / N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$1 - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + t$95$2), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{z + 1}\\
t_2 := \sqrt{1 + x}\\
\mathbf{if}\;y \leq 4.8 \cdot 10^{-34}:\\
\;\;\;\;\left(\sqrt{1 + t} - \sqrt{t}\right) + \left(\frac{1}{\sqrt{z} + t_1} + 2\right)\\
\mathbf{elif}\;y \leq 3.7 \cdot 10^{+37}:\\
\;\;\;\;t_2 + \left(\frac{1}{\sqrt{1 + y} + \sqrt{y}} + \left(\left(t_1 - \sqrt{z}\right) - \sqrt{x}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{x} + t_2}\\
\end{array}
\end{array}
if y < 4.79999999999999982e-34Initial program 97.6%
+-commutative97.6%
associate-+r-58.0%
+-commutative58.0%
associate-+r-97.6%
associate-+l+97.6%
Simplified97.6%
flip--97.5%
add-sqr-sqrt72.5%
add-sqr-sqrt97.9%
Applied egg-rr97.9%
associate--l+98.4%
+-inverses98.4%
metadata-eval98.4%
+-commutative98.4%
+-commutative98.4%
Simplified98.4%
Taylor expanded in y around 0 98.4%
Taylor expanded in x around 0 53.7%
+-commutative53.7%
Simplified53.7%
if 4.79999999999999982e-34 < y < 3.6999999999999999e37Initial program 83.9%
associate-+l+83.9%
+-commutative83.9%
associate-+r-54.4%
associate-+l-36.0%
+-commutative36.0%
+-commutative36.0%
associate--l+36.0%
Simplified26.2%
Taylor expanded in t around inf 20.7%
associate--l+20.3%
+-commutative20.3%
Simplified20.3%
flip--88.2%
add-sqr-sqrt79.8%
add-sqr-sqrt89.8%
Applied egg-rr21.5%
associate--l+97.3%
+-inverses97.3%
metadata-eval97.3%
Simplified21.5%
if 3.6999999999999999e37 < y Initial program 87.5%
associate-+l+87.5%
+-commutative87.5%
associate-+r-87.5%
associate-+l-53.8%
+-commutative53.8%
+-commutative53.8%
associate--l+53.8%
Simplified32.2%
Taylor expanded in t around inf 34.8%
associate--l+36.6%
+-commutative36.6%
Simplified36.6%
Taylor expanded in z around inf 3.2%
associate--l+22.0%
+-commutative22.0%
Simplified22.0%
Taylor expanded in y around inf 23.3%
flip--23.3%
add-sqr-sqrt23.4%
add-sqr-sqrt24.0%
+-commutative24.0%
Applied egg-rr24.0%
associate--l+28.5%
+-inverses28.5%
metadata-eval28.5%
Simplified28.5%
Final simplification38.5%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ 1.0 x))))
(if (<= y 1.8e-26)
(+ (/ 1.0 (+ (sqrt z) (sqrt (+ z 1.0)))) 2.0)
(if (<= y 5e+29)
(- (+ 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 tmp;
if (y <= 1.8e-26) {
tmp = (1.0 / (sqrt(z) + sqrt((z + 1.0)))) + 2.0;
} else if (y <= 5e+29) {
tmp = (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) :: tmp
t_1 = sqrt((1.0d0 + x))
if (y <= 1.8d-26) then
tmp = (1.0d0 / (sqrt(z) + sqrt((z + 1.0d0)))) + 2.0d0
else if (y <= 5d+29) then
tmp = (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 tmp;
if (y <= 1.8e-26) {
tmp = (1.0 / (Math.sqrt(z) + Math.sqrt((z + 1.0)))) + 2.0;
} else if (y <= 5e+29) {
tmp = (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)) tmp = 0 if y <= 1.8e-26: tmp = (1.0 / (math.sqrt(z) + math.sqrt((z + 1.0)))) + 2.0 elif y <= 5e+29: tmp = (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)) tmp = 0.0 if (y <= 1.8e-26) tmp = Float64(Float64(1.0 / Float64(sqrt(z) + sqrt(Float64(z + 1.0)))) + 2.0); elseif (y <= 5e+29) tmp = Float64(Float64(t_1 + 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));
tmp = 0.0;
if (y <= 1.8e-26)
tmp = (1.0 / (sqrt(z) + sqrt((z + 1.0)))) + 2.0;
elseif (y <= 5e+29)
tmp = (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]}, If[LessEqual[y, 1.8e-26], N[(N[(1.0 / N[(N[Sqrt[z], $MachinePrecision] + N[Sqrt[N[(z + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision], If[LessEqual[y, 5e+29], N[(N[(t$95$1 + N[(1.0 / N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Sqrt[x], $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.8 \cdot 10^{-26}:\\
\;\;\;\;\frac{1}{\sqrt{z} + \sqrt{z + 1}} + 2\\
\mathbf{elif}\;y \leq 5 \cdot 10^{+29}:\\
\;\;\;\;\left(t_1 + \frac{1}{\sqrt{1 + y} + \sqrt{y}}\right) - \sqrt{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{x} + t_1}\\
\end{array}
\end{array}
if y < 1.8000000000000001e-26Initial program 97.6%
associate-+l+97.6%
+-commutative97.6%
associate-+r-55.6%
associate-+l-49.4%
+-commutative49.4%
+-commutative49.4%
associate--l+49.3%
Simplified37.0%
Taylor expanded in t around inf 27.5%
associate--l+27.7%
+-commutative27.7%
Simplified27.7%
Taylor expanded in x around 0 29.4%
Taylor expanded in y around 0 29.4%
associate--l+54.2%
rem-square-sqrt54.2%
hypot-1-def54.2%
Simplified54.2%
flip--54.1%
hypot-udef54.1%
metadata-eval54.1%
add-sqr-sqrt54.1%
hypot-udef54.1%
metadata-eval54.1%
add-sqr-sqrt54.1%
add-sqr-sqrt41.7%
add-sqr-sqrt54.2%
hypot-udef54.2%
metadata-eval54.2%
add-sqr-sqrt54.2%
Applied egg-rr54.2%
associate--l+54.6%
+-inverses54.6%
metadata-eval54.6%
+-commutative54.6%
Simplified54.6%
if 1.8000000000000001e-26 < y < 5.0000000000000001e29Initial program 84.9%
associate-+l+84.9%
+-commutative84.9%
associate-+r-53.0%
associate-+l-31.8%
+-commutative31.8%
+-commutative31.8%
associate--l+31.8%
Simplified26.0%
Taylor expanded in t around inf 16.6%
associate--l+16.3%
+-commutative16.3%
Simplified16.3%
flip--89.5%
add-sqr-sqrt79.6%
add-sqr-sqrt91.4%
Applied egg-rr17.6%
associate--l+96.8%
+-inverses96.8%
metadata-eval96.8%
Simplified17.7%
Taylor expanded in z around inf 11.7%
if 5.0000000000000001e29 < y Initial program 86.8%
associate-+l+86.8%
+-commutative86.8%
associate-+r-86.8%
associate-+l-53.6%
+-commutative53.6%
+-commutative53.6%
associate--l+53.6%
Simplified31.7%
Taylor expanded in t around inf 35.1%
associate--l+36.8%
+-commutative36.8%
Simplified36.8%
Taylor expanded in z around inf 3.2%
associate--l+21.7%
+-commutative21.7%
Simplified21.7%
Taylor expanded in y around inf 23.0%
flip--23.0%
add-sqr-sqrt23.2%
add-sqr-sqrt23.7%
+-commutative23.7%
Applied egg-rr23.7%
associate--l+28.2%
+-inverses28.2%
metadata-eval28.2%
Simplified28.2%
Final simplification38.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 2.15e-26)
(+
(- (sqrt (+ 1.0 t)) (sqrt t))
(+ (/ 1.0 (+ (sqrt z) (sqrt (+ z 1.0)))) 2.0))
(if (<= y 5e+33)
(- (+ 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 tmp;
if (y <= 2.15e-26) {
tmp = (sqrt((1.0 + t)) - sqrt(t)) + ((1.0 / (sqrt(z) + sqrt((z + 1.0)))) + 2.0);
} else if (y <= 5e+33) {
tmp = (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) :: tmp
t_1 = sqrt((1.0d0 + x))
if (y <= 2.15d-26) then
tmp = (sqrt((1.0d0 + t)) - sqrt(t)) + ((1.0d0 / (sqrt(z) + sqrt((z + 1.0d0)))) + 2.0d0)
else if (y <= 5d+33) then
tmp = (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 tmp;
if (y <= 2.15e-26) {
tmp = (Math.sqrt((1.0 + t)) - Math.sqrt(t)) + ((1.0 / (Math.sqrt(z) + Math.sqrt((z + 1.0)))) + 2.0);
} else if (y <= 5e+33) {
tmp = (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)) tmp = 0 if y <= 2.15e-26: tmp = (math.sqrt((1.0 + t)) - math.sqrt(t)) + ((1.0 / (math.sqrt(z) + math.sqrt((z + 1.0)))) + 2.0) elif y <= 5e+33: tmp = (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)) tmp = 0.0 if (y <= 2.15e-26) tmp = Float64(Float64(sqrt(Float64(1.0 + t)) - sqrt(t)) + Float64(Float64(1.0 / Float64(sqrt(z) + sqrt(Float64(z + 1.0)))) + 2.0)); elseif (y <= 5e+33) tmp = Float64(Float64(t_1 + 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));
tmp = 0.0;
if (y <= 2.15e-26)
tmp = (sqrt((1.0 + t)) - sqrt(t)) + ((1.0 / (sqrt(z) + sqrt((z + 1.0)))) + 2.0);
elseif (y <= 5e+33)
tmp = (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]}, If[LessEqual[y, 2.15e-26], N[(N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 / N[(N[Sqrt[z], $MachinePrecision] + N[Sqrt[N[(z + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 5e+33], N[(N[(t$95$1 + N[(1.0 / N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Sqrt[x], $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 2.15 \cdot 10^{-26}:\\
\;\;\;\;\left(\sqrt{1 + t} - \sqrt{t}\right) + \left(\frac{1}{\sqrt{z} + \sqrt{z + 1}} + 2\right)\\
\mathbf{elif}\;y \leq 5 \cdot 10^{+33}:\\
\;\;\;\;\left(t_1 + \frac{1}{\sqrt{1 + y} + \sqrt{y}}\right) - \sqrt{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{x} + t_1}\\
\end{array}
\end{array}
if y < 2.14999999999999994e-26Initial program 97.6%
+-commutative97.6%
associate-+r-58.4%
+-commutative58.4%
associate-+r-97.6%
associate-+l+97.6%
Simplified97.6%
flip--97.6%
add-sqr-sqrt73.2%
add-sqr-sqrt97.9%
Applied egg-rr97.9%
associate--l+98.4%
+-inverses98.4%
metadata-eval98.4%
+-commutative98.4%
+-commutative98.4%
Simplified98.4%
Taylor expanded in y around 0 98.3%
Taylor expanded in x around 0 54.1%
+-commutative54.1%
Simplified54.1%
if 2.14999999999999994e-26 < y < 4.99999999999999973e33Initial program 85.1%
associate-+l+85.1%
+-commutative85.1%
associate-+r-54.3%
associate-+l-33.9%
+-commutative33.9%
+-commutative33.9%
associate--l+33.9%
Simplified25.5%
Taylor expanded in t around inf 19.1%
associate--l+18.8%
+-commutative18.8%
Simplified18.8%
flip--89.8%
add-sqr-sqrt80.3%
add-sqr-sqrt91.7%
Applied egg-rr20.1%
associate--l+96.9%
+-inverses96.9%
metadata-eval96.9%
Simplified20.2%
Taylor expanded in z around inf 11.4%
if 4.99999999999999973e33 < y Initial program 86.8%
associate-+l+86.8%
+-commutative86.8%
associate-+r-86.8%
associate-+l-53.3%
+-commutative53.3%
+-commutative53.3%
associate--l+53.3%
Simplified31.9%
Taylor expanded in t around inf 34.6%
associate--l+36.3%
+-commutative36.3%
Simplified36.3%
Taylor expanded in z around inf 3.2%
associate--l+21.9%
+-commutative21.9%
Simplified21.9%
Taylor expanded in y around inf 23.1%
flip--23.1%
add-sqr-sqrt23.2%
add-sqr-sqrt23.8%
+-commutative23.8%
Applied egg-rr23.8%
associate--l+28.3%
+-inverses28.3%
metadata-eval28.3%
Simplified28.3%
Final simplification37.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 x))))
(if (<= y 2e-26)
(+ (/ 1.0 (+ (sqrt z) (sqrt (+ z 1.0)))) 2.0)
(if (<= y 5.8e+15)
(+ t_1 (- (sqrt (+ 1.0 y)) (+ (sqrt x) (sqrt y))))
(/ 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 <= 2e-26) {
tmp = (1.0 / (sqrt(z) + sqrt((z + 1.0)))) + 2.0;
} else if (y <= 5.8e+15) {
tmp = t_1 + (sqrt((1.0 + y)) - (sqrt(x) + sqrt(y)));
} 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 <= 2d-26) then
tmp = (1.0d0 / (sqrt(z) + sqrt((z + 1.0d0)))) + 2.0d0
else if (y <= 5.8d+15) then
tmp = t_1 + (sqrt((1.0d0 + y)) - (sqrt(x) + sqrt(y)))
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 <= 2e-26) {
tmp = (1.0 / (Math.sqrt(z) + Math.sqrt((z + 1.0)))) + 2.0;
} else if (y <= 5.8e+15) {
tmp = t_1 + (Math.sqrt((1.0 + y)) - (Math.sqrt(x) + Math.sqrt(y)));
} 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 <= 2e-26: tmp = (1.0 / (math.sqrt(z) + math.sqrt((z + 1.0)))) + 2.0 elif y <= 5.8e+15: tmp = t_1 + (math.sqrt((1.0 + y)) - (math.sqrt(x) + math.sqrt(y))) 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 <= 2e-26) tmp = Float64(Float64(1.0 / Float64(sqrt(z) + sqrt(Float64(z + 1.0)))) + 2.0); elseif (y <= 5.8e+15) tmp = Float64(t_1 + Float64(sqrt(Float64(1.0 + y)) - Float64(sqrt(x) + sqrt(y)))); 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 <= 2e-26)
tmp = (1.0 / (sqrt(z) + sqrt((z + 1.0)))) + 2.0;
elseif (y <= 5.8e+15)
tmp = t_1 + (sqrt((1.0 + y)) - (sqrt(x) + sqrt(y)));
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, 2e-26], N[(N[(1.0 / N[(N[Sqrt[z], $MachinePrecision] + N[Sqrt[N[(z + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision], If[LessEqual[y, 5.8e+15], N[(t$95$1 + N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] - N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(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 2 \cdot 10^{-26}:\\
\;\;\;\;\frac{1}{\sqrt{z} + \sqrt{z + 1}} + 2\\
\mathbf{elif}\;y \leq 5.8 \cdot 10^{+15}:\\
\;\;\;\;t_1 + \left(\sqrt{1 + y} - \left(\sqrt{x} + \sqrt{y}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{x} + t_1}\\
\end{array}
\end{array}
if y < 2.0000000000000001e-26Initial program 97.6%
associate-+l+97.6%
+-commutative97.6%
associate-+r-55.6%
associate-+l-49.4%
+-commutative49.4%
+-commutative49.4%
associate--l+49.3%
Simplified37.0%
Taylor expanded in t around inf 27.5%
associate--l+27.7%
+-commutative27.7%
Simplified27.7%
Taylor expanded in x around 0 29.4%
Taylor expanded in y around 0 29.4%
associate--l+54.2%
rem-square-sqrt54.2%
hypot-1-def54.2%
Simplified54.2%
flip--54.1%
hypot-udef54.1%
metadata-eval54.1%
add-sqr-sqrt54.1%
hypot-udef54.1%
metadata-eval54.1%
add-sqr-sqrt54.1%
add-sqr-sqrt41.7%
add-sqr-sqrt54.2%
hypot-udef54.2%
metadata-eval54.2%
add-sqr-sqrt54.2%
Applied egg-rr54.2%
associate--l+54.6%
+-inverses54.6%
metadata-eval54.6%
+-commutative54.6%
Simplified54.6%
if 2.0000000000000001e-26 < y < 5.8e15Initial program 89.5%
associate-+l+89.5%
+-commutative89.5%
associate-+r-44.7%
associate-+l-33.5%
+-commutative33.5%
+-commutative33.5%
associate--l+33.5%
Simplified29.9%
Taylor expanded in t around inf 16.0%
associate--l+15.2%
+-commutative15.2%
Simplified15.2%
Taylor expanded in z around inf 11.3%
associate--l+11.3%
+-commutative11.3%
Simplified11.3%
if 5.8e15 < y Initial program 86.0%
associate-+l+85.9%
+-commutative85.9%
associate-+r-86.0%
associate-+l-51.9%
+-commutative51.9%
+-commutative51.9%
associate--l+51.9%
Simplified30.7%
Taylor expanded in t around inf 33.9%
associate--l+35.6%
+-commutative35.6%
Simplified35.6%
Taylor expanded in z around inf 3.4%
associate--l+20.7%
+-commutative20.7%
Simplified20.7%
Taylor expanded in y around inf 22.0%
flip--22.0%
add-sqr-sqrt22.3%
add-sqr-sqrt22.8%
+-commutative22.8%
Applied egg-rr22.8%
associate--l+27.1%
+-inverses27.1%
metadata-eval27.1%
Simplified27.1%
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 x))))
(if (<= y 2.15e-26)
(+ (/ 1.0 (+ (sqrt z) (sqrt (+ z 1.0)))) 2.0)
(if (<= y 7.6e+15)
(+ t_1 (- (- (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 tmp;
if (y <= 2.15e-26) {
tmp = (1.0 / (sqrt(z) + sqrt((z + 1.0)))) + 2.0;
} else if (y <= 7.6e+15) {
tmp = t_1 + ((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) :: tmp
t_1 = sqrt((1.0d0 + x))
if (y <= 2.15d-26) then
tmp = (1.0d0 / (sqrt(z) + sqrt((z + 1.0d0)))) + 2.0d0
else if (y <= 7.6d+15) then
tmp = t_1 + ((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 tmp;
if (y <= 2.15e-26) {
tmp = (1.0 / (Math.sqrt(z) + Math.sqrt((z + 1.0)))) + 2.0;
} else if (y <= 7.6e+15) {
tmp = t_1 + ((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)) tmp = 0 if y <= 2.15e-26: tmp = (1.0 / (math.sqrt(z) + math.sqrt((z + 1.0)))) + 2.0 elif y <= 7.6e+15: tmp = t_1 + ((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)) tmp = 0.0 if (y <= 2.15e-26) tmp = Float64(Float64(1.0 / Float64(sqrt(z) + sqrt(Float64(z + 1.0)))) + 2.0); elseif (y <= 7.6e+15) tmp = Float64(t_1 + Float64(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));
tmp = 0.0;
if (y <= 2.15e-26)
tmp = (1.0 / (sqrt(z) + sqrt((z + 1.0)))) + 2.0;
elseif (y <= 7.6e+15)
tmp = t_1 + ((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]}, If[LessEqual[y, 2.15e-26], N[(N[(1.0 / N[(N[Sqrt[z], $MachinePrecision] + N[Sqrt[N[(z + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision], If[LessEqual[y, 7.6e+15], N[(t$95$1 + N[(N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] - 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 2.15 \cdot 10^{-26}:\\
\;\;\;\;\frac{1}{\sqrt{z} + \sqrt{z + 1}} + 2\\
\mathbf{elif}\;y \leq 7.6 \cdot 10^{+15}:\\
\;\;\;\;t_1 + \left(\left(\sqrt{1 + y} - \sqrt{y}\right) - \sqrt{x}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{x} + t_1}\\
\end{array}
\end{array}
if y < 2.14999999999999994e-26Initial program 97.6%
associate-+l+97.6%
+-commutative97.6%
associate-+r-55.6%
associate-+l-49.4%
+-commutative49.4%
+-commutative49.4%
associate--l+49.3%
Simplified37.0%
Taylor expanded in t around inf 27.5%
associate--l+27.7%
+-commutative27.7%
Simplified27.7%
Taylor expanded in x around 0 29.4%
Taylor expanded in y around 0 29.4%
associate--l+54.2%
rem-square-sqrt54.2%
hypot-1-def54.2%
Simplified54.2%
flip--54.1%
hypot-udef54.1%
metadata-eval54.1%
add-sqr-sqrt54.1%
hypot-udef54.1%
metadata-eval54.1%
add-sqr-sqrt54.1%
add-sqr-sqrt41.7%
add-sqr-sqrt54.2%
hypot-udef54.2%
metadata-eval54.2%
add-sqr-sqrt54.2%
Applied egg-rr54.2%
associate--l+54.6%
+-inverses54.6%
metadata-eval54.6%
+-commutative54.6%
Simplified54.6%
if 2.14999999999999994e-26 < y < 7.6e15Initial program 89.5%
associate-+l+89.5%
+-commutative89.5%
associate-+r-44.7%
associate-+l-33.5%
+-commutative33.5%
+-commutative33.5%
associate--l+33.5%
Simplified29.9%
Taylor expanded in t around inf 16.0%
associate--l+15.2%
+-commutative15.2%
Simplified15.2%
Taylor expanded in z around inf 11.3%
if 7.6e15 < y Initial program 86.0%
associate-+l+85.9%
+-commutative85.9%
associate-+r-86.0%
associate-+l-51.9%
+-commutative51.9%
+-commutative51.9%
associate--l+51.9%
Simplified30.7%
Taylor expanded in t around inf 33.9%
associate--l+35.6%
+-commutative35.6%
Simplified35.6%
Taylor expanded in z around inf 3.4%
associate--l+20.7%
+-commutative20.7%
Simplified20.7%
Taylor expanded in y around inf 22.0%
flip--22.0%
add-sqr-sqrt22.3%
add-sqr-sqrt22.8%
+-commutative22.8%
Applied egg-rr22.8%
associate--l+27.1%
+-inverses27.1%
metadata-eval27.1%
Simplified27.1%
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
(if (<= y 2.15e-26)
(+ (/ 1.0 (+ (sqrt z) (sqrt (+ z 1.0)))) 2.0)
(if (<= y 1.05e+15)
(+ 1.0 (- (hypot 1.0 (sqrt 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.15e-26) {
tmp = (1.0 / (sqrt(z) + sqrt((z + 1.0)))) + 2.0;
} else if (y <= 1.05e+15) {
tmp = 1.0 + (hypot(1.0, sqrt(y)) - sqrt(y));
} else {
tmp = 1.0 / (sqrt(x) + sqrt((1.0 + x)));
}
return tmp;
}
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= 2.15e-26) {
tmp = (1.0 / (Math.sqrt(z) + Math.sqrt((z + 1.0)))) + 2.0;
} else if (y <= 1.05e+15) {
tmp = 1.0 + (Math.hypot(1.0, Math.sqrt(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.15e-26: tmp = (1.0 / (math.sqrt(z) + math.sqrt((z + 1.0)))) + 2.0 elif y <= 1.05e+15: tmp = 1.0 + (math.hypot(1.0, math.sqrt(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.15e-26) tmp = Float64(Float64(1.0 / Float64(sqrt(z) + sqrt(Float64(z + 1.0)))) + 2.0); elseif (y <= 1.05e+15) tmp = Float64(1.0 + Float64(hypot(1.0, sqrt(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.15e-26)
tmp = (1.0 / (sqrt(z) + sqrt((z + 1.0)))) + 2.0;
elseif (y <= 1.05e+15)
tmp = 1.0 + (hypot(1.0, sqrt(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.15e-26], N[(N[(1.0 / N[(N[Sqrt[z], $MachinePrecision] + N[Sqrt[N[(z + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision], If[LessEqual[y, 1.05e+15], N[(1.0 + N[(N[Sqrt[1.0 ^ 2 + N[Sqrt[y], $MachinePrecision] ^ 2], $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.15 \cdot 10^{-26}:\\
\;\;\;\;\frac{1}{\sqrt{z} + \sqrt{z + 1}} + 2\\
\mathbf{elif}\;y \leq 1.05 \cdot 10^{+15}:\\
\;\;\;\;1 + \left(\mathsf{hypot}\left(1, \sqrt{y}\right) - \sqrt{y}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{x} + \sqrt{1 + x}}\\
\end{array}
\end{array}
if y < 2.14999999999999994e-26Initial program 97.6%
associate-+l+97.6%
+-commutative97.6%
associate-+r-55.6%
associate-+l-49.4%
+-commutative49.4%
+-commutative49.4%
associate--l+49.3%
Simplified37.0%
Taylor expanded in t around inf 27.5%
associate--l+27.7%
+-commutative27.7%
Simplified27.7%
Taylor expanded in x around 0 29.4%
Taylor expanded in y around 0 29.4%
associate--l+54.2%
rem-square-sqrt54.2%
hypot-1-def54.2%
Simplified54.2%
flip--54.1%
hypot-udef54.1%
metadata-eval54.1%
add-sqr-sqrt54.1%
hypot-udef54.1%
metadata-eval54.1%
add-sqr-sqrt54.1%
add-sqr-sqrt41.7%
add-sqr-sqrt54.2%
hypot-udef54.2%
metadata-eval54.2%
add-sqr-sqrt54.2%
Applied egg-rr54.2%
associate--l+54.6%
+-inverses54.6%
metadata-eval54.6%
+-commutative54.6%
Simplified54.6%
if 2.14999999999999994e-26 < y < 1.05e15Initial program 89.5%
associate-+l+89.5%
+-commutative89.5%
associate-+r-44.7%
associate-+l-33.5%
+-commutative33.5%
+-commutative33.5%
associate--l+33.5%
Simplified29.9%
Taylor expanded in t around inf 16.0%
associate--l+15.2%
+-commutative15.2%
Simplified15.2%
Taylor expanded in z around inf 11.3%
associate--l+11.3%
+-commutative11.3%
Simplified11.3%
Taylor expanded in x around 0 50.9%
associate--l+50.9%
rem-square-sqrt51.0%
hypot-1-def51.0%
Simplified51.0%
if 1.05e15 < y Initial program 86.0%
associate-+l+85.9%
+-commutative85.9%
associate-+r-86.0%
associate-+l-51.9%
+-commutative51.9%
+-commutative51.9%
associate--l+51.9%
Simplified30.7%
Taylor expanded in t around inf 33.9%
associate--l+35.6%
+-commutative35.6%
Simplified35.6%
Taylor expanded in z around inf 3.4%
associate--l+20.7%
+-commutative20.7%
Simplified20.7%
Taylor expanded in y around inf 22.0%
flip--22.0%
add-sqr-sqrt22.3%
add-sqr-sqrt22.8%
+-commutative22.8%
Applied egg-rr22.8%
associate--l+27.1%
+-inverses27.1%
metadata-eval27.1%
Simplified27.1%
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
(if (<= y 1.65e-26)
(+ (- (sqrt (+ z 1.0)) (sqrt z)) 2.0)
(if (<= y 1.05e+15)
(+ 1.0 (- (sqrt (+ 1.0 y)) (sqrt y)))
(- (sqrt (+ 1.0 x)) (sqrt x)))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 1.65e-26) {
tmp = (sqrt((z + 1.0)) - sqrt(z)) + 2.0;
} else if (y <= 1.05e+15) {
tmp = 1.0 + (sqrt((1.0 + y)) - sqrt(y));
} else {
tmp = sqrt((1.0 + x)) - sqrt(x);
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= 1.65d-26) then
tmp = (sqrt((z + 1.0d0)) - sqrt(z)) + 2.0d0
else if (y <= 1.05d+15) then
tmp = 1.0d0 + (sqrt((1.0d0 + y)) - sqrt(y))
else
tmp = sqrt((1.0d0 + x)) - sqrt(x)
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= 1.65e-26) {
tmp = (Math.sqrt((z + 1.0)) - Math.sqrt(z)) + 2.0;
} else if (y <= 1.05e+15) {
tmp = 1.0 + (Math.sqrt((1.0 + y)) - Math.sqrt(y));
} else {
tmp = Math.sqrt((1.0 + x)) - Math.sqrt(x);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if y <= 1.65e-26: tmp = (math.sqrt((z + 1.0)) - math.sqrt(z)) + 2.0 elif y <= 1.05e+15: tmp = 1.0 + (math.sqrt((1.0 + y)) - math.sqrt(y)) else: tmp = math.sqrt((1.0 + x)) - math.sqrt(x) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (y <= 1.65e-26) tmp = Float64(Float64(sqrt(Float64(z + 1.0)) - sqrt(z)) + 2.0); elseif (y <= 1.05e+15) tmp = Float64(1.0 + Float64(sqrt(Float64(1.0 + y)) - sqrt(y))); else tmp = Float64(sqrt(Float64(1.0 + x)) - sqrt(x)); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (y <= 1.65e-26)
tmp = (sqrt((z + 1.0)) - sqrt(z)) + 2.0;
elseif (y <= 1.05e+15)
tmp = 1.0 + (sqrt((1.0 + y)) - sqrt(y));
else
tmp = sqrt((1.0 + x)) - sqrt(x);
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[y, 1.65e-26], N[(N[(N[Sqrt[N[(z + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision], If[LessEqual[y, 1.05e+15], N[(1.0 + N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 1.65 \cdot 10^{-26}:\\
\;\;\;\;\left(\sqrt{z + 1} - \sqrt{z}\right) + 2\\
\mathbf{elif}\;y \leq 1.05 \cdot 10^{+15}:\\
\;\;\;\;1 + \left(\sqrt{1 + y} - \sqrt{y}\right)\\
\mathbf{else}:\\
\;\;\;\;\sqrt{1 + x} - \sqrt{x}\\
\end{array}
\end{array}
if y < 1.6499999999999999e-26Initial program 97.6%
associate-+l+97.6%
+-commutative97.6%
associate-+r-55.6%
associate-+l-49.4%
+-commutative49.4%
+-commutative49.4%
associate--l+49.3%
Simplified37.0%
Taylor expanded in t around inf 27.5%
associate--l+27.7%
+-commutative27.7%
Simplified27.7%
Taylor expanded in x around 0 29.4%
Taylor expanded in y around 0 29.4%
associate--l+54.2%
Simplified54.2%
if 1.6499999999999999e-26 < y < 1.05e15Initial program 89.5%
associate-+l+89.5%
+-commutative89.5%
associate-+r-44.7%
associate-+l-33.5%
+-commutative33.5%
+-commutative33.5%
associate--l+33.5%
Simplified29.9%
Taylor expanded in t around inf 16.0%
associate--l+15.2%
+-commutative15.2%
Simplified15.2%
Taylor expanded in z around inf 11.3%
associate--l+11.3%
+-commutative11.3%
Simplified11.3%
Taylor expanded in x around 0 50.9%
associate--l+50.9%
Simplified50.9%
if 1.05e15 < y Initial program 86.0%
associate-+l+85.9%
+-commutative85.9%
associate-+r-86.0%
associate-+l-51.9%
+-commutative51.9%
+-commutative51.9%
associate--l+51.9%
Simplified30.7%
Taylor expanded in t around inf 33.9%
associate--l+35.6%
+-commutative35.6%
Simplified35.6%
Taylor expanded in z around inf 3.4%
associate--l+20.7%
+-commutative20.7%
Simplified20.7%
Taylor expanded in y around inf 22.0%
Final simplification38.6%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(if (<= y 2.15e-26)
(+ (- (sqrt (+ z 1.0)) (sqrt z)) 2.0)
(if (<= y 9.6e+14)
(- (+ 1.0 (sqrt (+ 1.0 y))) (sqrt y))
(- (sqrt (+ 1.0 x)) (sqrt x)))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 2.15e-26) {
tmp = (sqrt((z + 1.0)) - sqrt(z)) + 2.0;
} else if (y <= 9.6e+14) {
tmp = (1.0 + sqrt((1.0 + y))) - sqrt(y);
} else {
tmp = sqrt((1.0 + x)) - sqrt(x);
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= 2.15d-26) then
tmp = (sqrt((z + 1.0d0)) - sqrt(z)) + 2.0d0
else if (y <= 9.6d+14) then
tmp = (1.0d0 + sqrt((1.0d0 + y))) - sqrt(y)
else
tmp = sqrt((1.0d0 + x)) - sqrt(x)
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= 2.15e-26) {
tmp = (Math.sqrt((z + 1.0)) - Math.sqrt(z)) + 2.0;
} else if (y <= 9.6e+14) {
tmp = (1.0 + Math.sqrt((1.0 + y))) - Math.sqrt(y);
} else {
tmp = Math.sqrt((1.0 + x)) - Math.sqrt(x);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if y <= 2.15e-26: tmp = (math.sqrt((z + 1.0)) - math.sqrt(z)) + 2.0 elif y <= 9.6e+14: tmp = (1.0 + math.sqrt((1.0 + y))) - math.sqrt(y) else: tmp = math.sqrt((1.0 + x)) - math.sqrt(x) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (y <= 2.15e-26) tmp = Float64(Float64(sqrt(Float64(z + 1.0)) - sqrt(z)) + 2.0); elseif (y <= 9.6e+14) tmp = Float64(Float64(1.0 + sqrt(Float64(1.0 + y))) - sqrt(y)); else tmp = Float64(sqrt(Float64(1.0 + x)) - sqrt(x)); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (y <= 2.15e-26)
tmp = (sqrt((z + 1.0)) - sqrt(z)) + 2.0;
elseif (y <= 9.6e+14)
tmp = (1.0 + sqrt((1.0 + y))) - sqrt(y);
else
tmp = sqrt((1.0 + x)) - sqrt(x);
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[y, 2.15e-26], N[(N[(N[Sqrt[N[(z + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision], If[LessEqual[y, 9.6e+14], N[(N[(1.0 + N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[Sqrt[y], $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.15 \cdot 10^{-26}:\\
\;\;\;\;\left(\sqrt{z + 1} - \sqrt{z}\right) + 2\\
\mathbf{elif}\;y \leq 9.6 \cdot 10^{+14}:\\
\;\;\;\;\left(1 + \sqrt{1 + y}\right) - \sqrt{y}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{1 + x} - \sqrt{x}\\
\end{array}
\end{array}
if y < 2.14999999999999994e-26Initial program 97.6%
associate-+l+97.6%
+-commutative97.6%
associate-+r-55.6%
associate-+l-49.4%
+-commutative49.4%
+-commutative49.4%
associate--l+49.3%
Simplified37.0%
Taylor expanded in t around inf 27.5%
associate--l+27.7%
+-commutative27.7%
Simplified27.7%
Taylor expanded in x around 0 29.4%
Taylor expanded in y around 0 29.4%
associate--l+54.2%
Simplified54.2%
if 2.14999999999999994e-26 < y < 9.6e14Initial program 89.5%
associate-+l+89.5%
+-commutative89.5%
associate-+r-44.7%
associate-+l-33.5%
+-commutative33.5%
+-commutative33.5%
associate--l+33.5%
Simplified29.9%
Taylor expanded in t around inf 16.0%
associate--l+15.2%
+-commutative15.2%
Simplified15.2%
Taylor expanded in z around inf 11.3%
associate--l+11.3%
+-commutative11.3%
Simplified11.3%
Taylor expanded in x around 0 50.9%
if 9.6e14 < y Initial program 86.0%
associate-+l+85.9%
+-commutative85.9%
associate-+r-86.0%
associate-+l-51.9%
+-commutative51.9%
+-commutative51.9%
associate--l+51.9%
Simplified30.7%
Taylor expanded in t around inf 33.9%
associate--l+35.6%
+-commutative35.6%
Simplified35.6%
Taylor expanded in z around inf 3.4%
associate--l+20.7%
+-commutative20.7%
Simplified20.7%
Taylor expanded in y around inf 22.0%
Final simplification38.6%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(if (<= y 1.65e-26)
(+ (- (sqrt (+ z 1.0)) (sqrt z)) 2.0)
(if (<= y 1.7e+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 <= 1.65e-26) {
tmp = (sqrt((z + 1.0)) - sqrt(z)) + 2.0;
} else if (y <= 1.7e+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 <= 1.65d-26) then
tmp = (sqrt((z + 1.0d0)) - sqrt(z)) + 2.0d0
else if (y <= 1.7d+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 <= 1.65e-26) {
tmp = (Math.sqrt((z + 1.0)) - Math.sqrt(z)) + 2.0;
} else if (y <= 1.7e+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 <= 1.65e-26: tmp = (math.sqrt((z + 1.0)) - math.sqrt(z)) + 2.0 elif y <= 1.7e+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 <= 1.65e-26) tmp = Float64(Float64(sqrt(Float64(z + 1.0)) - sqrt(z)) + 2.0); elseif (y <= 1.7e+15) tmp = 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 <= 1.65e-26)
tmp = (sqrt((z + 1.0)) - sqrt(z)) + 2.0;
elseif (y <= 1.7e+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, 1.65e-26], N[(N[(N[Sqrt[N[(z + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision], If[LessEqual[y, 1.7e+15], N[(N[(1.0 + N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[Sqrt[y], $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.65 \cdot 10^{-26}:\\
\;\;\;\;\left(\sqrt{z + 1} - \sqrt{z}\right) + 2\\
\mathbf{elif}\;y \leq 1.7 \cdot 10^{+15}:\\
\;\;\;\;\left(1 + \sqrt{1 + y}\right) - \sqrt{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{x} + \sqrt{1 + x}}\\
\end{array}
\end{array}
if y < 1.6499999999999999e-26Initial program 97.6%
associate-+l+97.6%
+-commutative97.6%
associate-+r-55.6%
associate-+l-49.4%
+-commutative49.4%
+-commutative49.4%
associate--l+49.3%
Simplified37.0%
Taylor expanded in t around inf 27.5%
associate--l+27.7%
+-commutative27.7%
Simplified27.7%
Taylor expanded in x around 0 29.4%
Taylor expanded in y around 0 29.4%
associate--l+54.2%
Simplified54.2%
if 1.6499999999999999e-26 < y < 1.7e15Initial program 89.5%
associate-+l+89.5%
+-commutative89.5%
associate-+r-44.7%
associate-+l-33.5%
+-commutative33.5%
+-commutative33.5%
associate--l+33.5%
Simplified29.9%
Taylor expanded in t around inf 16.0%
associate--l+15.2%
+-commutative15.2%
Simplified15.2%
Taylor expanded in z around inf 11.3%
associate--l+11.3%
+-commutative11.3%
Simplified11.3%
Taylor expanded in x around 0 50.9%
if 1.7e15 < y Initial program 86.0%
associate-+l+85.9%
+-commutative85.9%
associate-+r-86.0%
associate-+l-51.9%
+-commutative51.9%
+-commutative51.9%
associate--l+51.9%
Simplified30.7%
Taylor expanded in t around inf 33.9%
associate--l+35.6%
+-commutative35.6%
Simplified35.6%
Taylor expanded in z around inf 3.4%
associate--l+20.7%
+-commutative20.7%
Simplified20.7%
Taylor expanded in y around inf 22.0%
flip--22.0%
add-sqr-sqrt22.3%
add-sqr-sqrt22.8%
+-commutative22.8%
Applied egg-rr22.8%
associate--l+27.1%
+-inverses27.1%
metadata-eval27.1%
Simplified27.1%
Final simplification41.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 2.05e-26)
(+ (/ 1.0 (+ (sqrt z) (sqrt (+ z 1.0)))) 2.0)
(if (<= y 1.55e+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 <= 2.05e-26) {
tmp = (1.0 / (sqrt(z) + sqrt((z + 1.0)))) + 2.0;
} else if (y <= 1.55e+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 <= 2.05d-26) then
tmp = (1.0d0 / (sqrt(z) + sqrt((z + 1.0d0)))) + 2.0d0
else if (y <= 1.55d+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 <= 2.05e-26) {
tmp = (1.0 / (Math.sqrt(z) + Math.sqrt((z + 1.0)))) + 2.0;
} else if (y <= 1.55e+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 <= 2.05e-26: tmp = (1.0 / (math.sqrt(z) + math.sqrt((z + 1.0)))) + 2.0 elif y <= 1.55e+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 <= 2.05e-26) tmp = Float64(Float64(1.0 / Float64(sqrt(z) + sqrt(Float64(z + 1.0)))) + 2.0); elseif (y <= 1.55e+15) tmp = 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.05e-26)
tmp = (1.0 / (sqrt(z) + sqrt((z + 1.0)))) + 2.0;
elseif (y <= 1.55e+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, 2.05e-26], N[(N[(1.0 / N[(N[Sqrt[z], $MachinePrecision] + N[Sqrt[N[(z + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision], If[LessEqual[y, 1.55e+15], N[(N[(1.0 + N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[Sqrt[y], $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.05 \cdot 10^{-26}:\\
\;\;\;\;\frac{1}{\sqrt{z} + \sqrt{z + 1}} + 2\\
\mathbf{elif}\;y \leq 1.55 \cdot 10^{+15}:\\
\;\;\;\;\left(1 + \sqrt{1 + y}\right) - \sqrt{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{x} + \sqrt{1 + x}}\\
\end{array}
\end{array}
if y < 2.0499999999999999e-26Initial program 97.6%
associate-+l+97.6%
+-commutative97.6%
associate-+r-55.6%
associate-+l-49.4%
+-commutative49.4%
+-commutative49.4%
associate--l+49.3%
Simplified37.0%
Taylor expanded in t around inf 27.5%
associate--l+27.7%
+-commutative27.7%
Simplified27.7%
Taylor expanded in x around 0 29.4%
Taylor expanded in y around 0 29.4%
associate--l+54.2%
rem-square-sqrt54.2%
hypot-1-def54.2%
Simplified54.2%
flip--54.1%
hypot-udef54.1%
metadata-eval54.1%
add-sqr-sqrt54.1%
hypot-udef54.1%
metadata-eval54.1%
add-sqr-sqrt54.1%
add-sqr-sqrt41.7%
add-sqr-sqrt54.2%
hypot-udef54.2%
metadata-eval54.2%
add-sqr-sqrt54.2%
Applied egg-rr54.2%
associate--l+54.6%
+-inverses54.6%
metadata-eval54.6%
+-commutative54.6%
Simplified54.6%
if 2.0499999999999999e-26 < y < 1.55e15Initial program 89.5%
associate-+l+89.5%
+-commutative89.5%
associate-+r-44.7%
associate-+l-33.5%
+-commutative33.5%
+-commutative33.5%
associate--l+33.5%
Simplified29.9%
Taylor expanded in t around inf 16.0%
associate--l+15.2%
+-commutative15.2%
Simplified15.2%
Taylor expanded in z around inf 11.3%
associate--l+11.3%
+-commutative11.3%
Simplified11.3%
Taylor expanded in x around 0 50.9%
if 1.55e15 < y Initial program 86.0%
associate-+l+85.9%
+-commutative85.9%
associate-+r-86.0%
associate-+l-51.9%
+-commutative51.9%
+-commutative51.9%
associate--l+51.9%
Simplified30.7%
Taylor expanded in t around inf 33.9%
associate--l+35.6%
+-commutative35.6%
Simplified35.6%
Taylor expanded in z around inf 3.4%
associate--l+20.7%
+-commutative20.7%
Simplified20.7%
Taylor expanded in y around inf 22.0%
flip--22.0%
add-sqr-sqrt22.3%
add-sqr-sqrt22.8%
+-commutative22.8%
Applied egg-rr22.8%
associate--l+27.1%
+-inverses27.1%
metadata-eval27.1%
Simplified27.1%
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 (if (<= z 0.242) 3.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 <= 0.242) {
tmp = 3.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 <= 0.242d0) then
tmp = 3.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 <= 0.242) {
tmp = 3.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 <= 0.242: tmp = 3.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 <= 0.242) tmp = 3.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 <= 0.242)
tmp = 3.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, 0.242], 3.0, 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.242:\\
\;\;\;\;3\\
\mathbf{else}:\\
\;\;\;\;1 + \left(\sqrt{1 + y} - \sqrt{y}\right)\\
\end{array}
\end{array}
if z < 0.242Initial program 97.1%
associate-+l+97.1%
+-commutative97.1%
associate-+r-79.2%
associate-+l-52.9%
+-commutative52.9%
+-commutative52.9%
associate--l+52.9%
Simplified35.1%
Taylor expanded in t around inf 31.7%
associate--l+31.7%
+-commutative31.7%
Simplified31.7%
Taylor expanded in x around 0 29.2%
Taylor expanded in y around 0 40.9%
associate--l+40.9%
rem-square-sqrt40.9%
hypot-1-def40.9%
Simplified40.9%
Taylor expanded in z around 0 40.3%
if 0.242 < z Initial program 85.8%
associate-+l+85.8%
+-commutative85.8%
associate-+r-59.3%
associate-+l-45.9%
+-commutative45.9%
+-commutative45.9%
associate--l+45.9%
Simplified31.8%
Taylor expanded in t around inf 27.7%
associate--l+29.4%
+-commutative29.4%
Simplified29.4%
Taylor expanded in z around inf 14.8%
associate--l+27.2%
+-commutative27.2%
Simplified27.2%
Taylor expanded in x around 0 33.8%
associate--l+51.9%
Simplified51.9%
Final simplification46.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 0.215) 3.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 <= 0.215) {
tmp = 3.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 <= 0.215d0) then
tmp = 3.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 <= 0.215) {
tmp = 3.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 <= 0.215: tmp = 3.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 <= 0.215) tmp = 3.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 <= 0.215)
tmp = 3.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, 0.215], 3.0, 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 0.215:\\
\;\;\;\;3\\
\mathbf{else}:\\
\;\;\;\;\sqrt{1 + x} - \sqrt{x}\\
\end{array}
\end{array}
if y < 0.214999999999999997Initial program 97.3%
associate-+l+97.3%
+-commutative97.3%
associate-+r-55.0%
associate-+l-48.9%
+-commutative48.9%
+-commutative48.9%
associate--l+48.9%
Simplified37.6%
Taylor expanded in t around inf 26.2%
associate--l+26.3%
+-commutative26.3%
Simplified26.3%
Taylor expanded in x around 0 28.1%
Taylor expanded in y around 0 28.1%
associate--l+51.9%
rem-square-sqrt51.9%
hypot-1-def51.9%
Simplified51.9%
Taylor expanded in z around 0 41.7%
if 0.214999999999999997 < y Initial program 85.8%
associate-+l+85.8%
+-commutative85.8%
associate-+r-82.7%
associate-+l-49.8%
+-commutative49.8%
+-commutative49.8%
associate--l+49.8%
Simplified29.5%
Taylor expanded in t around inf 33.0%
associate--l+34.6%
+-commutative34.6%
Simplified34.6%
Taylor expanded in z around inf 4.0%
associate--l+20.1%
+-commutative20.1%
Simplified20.1%
Taylor expanded in y around inf 21.2%
Final simplification31.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 0.215) 3.0 (- (+ 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 <= 0.215) {
tmp = 3.0;
} 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 <= 0.215d0) then
tmp = 3.0d0
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 <= 0.215) {
tmp = 3.0;
} 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 <= 0.215: tmp = 3.0 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 <= 0.215) tmp = 3.0; 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 <= 0.215)
tmp = 3.0;
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, 0.215], 3.0, 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 0.215:\\
\;\;\;\;3\\
\mathbf{else}:\\
\;\;\;\;\left(1 + x \cdot 0.5\right) - \sqrt{x}\\
\end{array}
\end{array}
if y < 0.214999999999999997Initial program 97.3%
associate-+l+97.3%
+-commutative97.3%
associate-+r-55.0%
associate-+l-48.9%
+-commutative48.9%
+-commutative48.9%
associate--l+48.9%
Simplified37.6%
Taylor expanded in t around inf 26.2%
associate--l+26.3%
+-commutative26.3%
Simplified26.3%
Taylor expanded in x around 0 28.1%
Taylor expanded in y around 0 28.1%
associate--l+51.9%
rem-square-sqrt51.9%
hypot-1-def51.9%
Simplified51.9%
Taylor expanded in z around 0 41.7%
if 0.214999999999999997 < y Initial program 85.8%
associate-+l+85.8%
+-commutative85.8%
associate-+r-82.7%
associate-+l-49.8%
+-commutative49.8%
+-commutative49.8%
associate--l+49.8%
Simplified29.5%
Taylor expanded in t around inf 33.0%
associate--l+34.6%
+-commutative34.6%
Simplified34.6%
Taylor expanded in z around inf 4.0%
associate--l+20.1%
+-commutative20.1%
Simplified20.1%
Taylor expanded in y around inf 21.2%
Taylor expanded in x around 0 20.8%
*-commutative20.8%
Simplified20.8%
Final simplification31.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 0.122) 3.0 1.0))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 0.122) {
tmp = 3.0;
} else {
tmp = 1.0;
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= 0.122d0) then
tmp = 3.0d0
else
tmp = 1.0d0
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= 0.122) {
tmp = 3.0;
} else {
tmp = 1.0;
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if y <= 0.122: tmp = 3.0 else: tmp = 1.0 return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (y <= 0.122) tmp = 3.0; else tmp = 1.0; end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (y <= 0.122)
tmp = 3.0;
else
tmp = 1.0;
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[y, 0.122], 3.0, 1.0]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 0.122:\\
\;\;\;\;3\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if y < 0.122Initial program 97.3%
associate-+l+97.3%
+-commutative97.3%
associate-+r-55.0%
associate-+l-48.9%
+-commutative48.9%
+-commutative48.9%
associate--l+48.9%
Simplified37.6%
Taylor expanded in t around inf 26.2%
associate--l+26.3%
+-commutative26.3%
Simplified26.3%
Taylor expanded in x around 0 28.1%
Taylor expanded in y around 0 28.1%
associate--l+51.9%
rem-square-sqrt51.9%
hypot-1-def51.9%
Simplified51.9%
Taylor expanded in z around 0 41.7%
if 0.122 < y Initial program 85.8%
associate-+l+85.8%
+-commutative85.8%
associate-+r-82.7%
associate-+l-49.8%
+-commutative49.8%
+-commutative49.8%
associate--l+49.8%
Simplified29.5%
Taylor expanded in t around inf 33.0%
associate--l+34.6%
+-commutative34.6%
Simplified34.6%
Taylor expanded in z around inf 4.0%
associate--l+20.1%
+-commutative20.1%
Simplified20.1%
Taylor expanded in y around inf 21.2%
Taylor expanded in x around 0 40.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 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 91.4%
associate-+l+91.4%
+-commutative91.4%
associate-+r-69.2%
associate-+l-49.4%
+-commutative49.4%
+-commutative49.4%
associate--l+49.3%
Simplified33.4%
Taylor expanded in t around inf 29.7%
associate--l+30.5%
+-commutative30.5%
Simplified30.5%
Taylor expanded in z around inf 11.2%
associate--l+19.5%
+-commutative19.5%
Simplified19.5%
Taylor expanded in y around inf 15.7%
Taylor expanded in x around 0 34.1%
Final simplification34.1%
(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 2023290
(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))))