
(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 27 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (+ (+ (+ (- (sqrt (+ x 1.0)) (sqrt x)) (- (sqrt (+ y 1.0)) (sqrt y))) (- (sqrt (+ z 1.0)) (sqrt z))) (- (sqrt (+ t 1.0)) (sqrt t))))
double code(double x, double y, double z, double t) {
return (((sqrt((x + 1.0)) - sqrt(x)) + (sqrt((y + 1.0)) - sqrt(y))) + (sqrt((z + 1.0)) - sqrt(z))) + (sqrt((t + 1.0)) - sqrt(t));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (((sqrt((x + 1.0d0)) - sqrt(x)) + (sqrt((y + 1.0d0)) - sqrt(y))) + (sqrt((z + 1.0d0)) - sqrt(z))) + (sqrt((t + 1.0d0)) - sqrt(t))
end function
public static double code(double x, double y, double z, double t) {
return (((Math.sqrt((x + 1.0)) - Math.sqrt(x)) + (Math.sqrt((y + 1.0)) - Math.sqrt(y))) + (Math.sqrt((z + 1.0)) - Math.sqrt(z))) + (Math.sqrt((t + 1.0)) - Math.sqrt(t));
}
def code(x, y, z, t): return (((math.sqrt((x + 1.0)) - math.sqrt(x)) + (math.sqrt((y + 1.0)) - math.sqrt(y))) + (math.sqrt((z + 1.0)) - math.sqrt(z))) + (math.sqrt((t + 1.0)) - math.sqrt(t))
function code(x, y, z, t) return Float64(Float64(Float64(Float64(sqrt(Float64(x + 1.0)) - sqrt(x)) + Float64(sqrt(Float64(y + 1.0)) - sqrt(y))) + Float64(sqrt(Float64(z + 1.0)) - sqrt(z))) + Float64(sqrt(Float64(t + 1.0)) - sqrt(t))) end
function tmp = code(x, y, z, t) tmp = (((sqrt((x + 1.0)) - sqrt(x)) + (sqrt((y + 1.0)) - sqrt(y))) + (sqrt((z + 1.0)) - sqrt(z))) + (sqrt((t + 1.0)) - sqrt(t)); end
code[x_, y_, z_, t_] := N[(N[(N[(N[(N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(z + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(t + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{y + 1} - \sqrt{y}\right)\right) + \left(\sqrt{z + 1} - \sqrt{z}\right)\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)
\end{array}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ 1.0 z))) (t_2 (sqrt (+ 1.0 y))))
(if (<= z 3.4e+30)
(+
(+ (- 1.0 (sqrt x)) (- t_2 (sqrt y)))
(+ (- (sqrt (+ 1.0 t)) (sqrt t)) (/ 1.0 (+ t_1 (sqrt z)))))
(+
(+ (/ 1.0 (+ (sqrt x) (sqrt (+ 1.0 x)))) (/ 1.0 (+ (sqrt y) t_2)))
(- t_1 (sqrt z))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + z));
double t_2 = sqrt((1.0 + y));
double tmp;
if (z <= 3.4e+30) {
tmp = ((1.0 - sqrt(x)) + (t_2 - sqrt(y))) + ((sqrt((1.0 + t)) - sqrt(t)) + (1.0 / (t_1 + sqrt(z))));
} else {
tmp = ((1.0 / (sqrt(x) + sqrt((1.0 + x)))) + (1.0 / (sqrt(y) + t_2))) + (t_1 - sqrt(z));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = sqrt((1.0d0 + z))
t_2 = sqrt((1.0d0 + y))
if (z <= 3.4d+30) then
tmp = ((1.0d0 - sqrt(x)) + (t_2 - sqrt(y))) + ((sqrt((1.0d0 + t)) - sqrt(t)) + (1.0d0 / (t_1 + sqrt(z))))
else
tmp = ((1.0d0 / (sqrt(x) + sqrt((1.0d0 + x)))) + (1.0d0 / (sqrt(y) + t_2))) + (t_1 - sqrt(z))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + z));
double t_2 = Math.sqrt((1.0 + y));
double tmp;
if (z <= 3.4e+30) {
tmp = ((1.0 - Math.sqrt(x)) + (t_2 - Math.sqrt(y))) + ((Math.sqrt((1.0 + t)) - Math.sqrt(t)) + (1.0 / (t_1 + Math.sqrt(z))));
} else {
tmp = ((1.0 / (Math.sqrt(x) + Math.sqrt((1.0 + x)))) + (1.0 / (Math.sqrt(y) + t_2))) + (t_1 - Math.sqrt(z));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + z)) t_2 = math.sqrt((1.0 + y)) tmp = 0 if z <= 3.4e+30: tmp = ((1.0 - math.sqrt(x)) + (t_2 - math.sqrt(y))) + ((math.sqrt((1.0 + t)) - math.sqrt(t)) + (1.0 / (t_1 + math.sqrt(z)))) else: tmp = ((1.0 / (math.sqrt(x) + math.sqrt((1.0 + x)))) + (1.0 / (math.sqrt(y) + t_2))) + (t_1 - math.sqrt(z)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(1.0 + z)) t_2 = sqrt(Float64(1.0 + y)) tmp = 0.0 if (z <= 3.4e+30) tmp = Float64(Float64(Float64(1.0 - sqrt(x)) + Float64(t_2 - sqrt(y))) + Float64(Float64(sqrt(Float64(1.0 + t)) - sqrt(t)) + Float64(1.0 / Float64(t_1 + sqrt(z))))); else tmp = Float64(Float64(Float64(1.0 / Float64(sqrt(x) + sqrt(Float64(1.0 + x)))) + Float64(1.0 / Float64(sqrt(y) + t_2))) + Float64(t_1 - sqrt(z))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + z));
t_2 = sqrt((1.0 + y));
tmp = 0.0;
if (z <= 3.4e+30)
tmp = ((1.0 - sqrt(x)) + (t_2 - sqrt(y))) + ((sqrt((1.0 + t)) - sqrt(t)) + (1.0 / (t_1 + sqrt(z))));
else
tmp = ((1.0 / (sqrt(x) + sqrt((1.0 + x)))) + (1.0 / (sqrt(y) + t_2))) + (t_1 - sqrt(z));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[z, 3.4e+30], N[(N[(N[(1.0 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(t$95$2 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(t$95$1 + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $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[y], $MachinePrecision] + t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$1 - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + z}\\
t_2 := \sqrt{1 + y}\\
\mathbf{if}\;z \leq 3.4 \cdot 10^{+30}:\\
\;\;\;\;\left(\left(1 - \sqrt{x}\right) + \left(t\_2 - \sqrt{y}\right)\right) + \left(\left(\sqrt{1 + t} - \sqrt{t}\right) + \frac{1}{t\_1 + \sqrt{z}}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{1}{\sqrt{x} + \sqrt{1 + x}} + \frac{1}{\sqrt{y} + t\_2}\right) + \left(t\_1 - \sqrt{z}\right)\\
\end{array}
\end{array}
if z < 3.4000000000000002e30Initial program 95.2%
associate-+l+95.2%
sub-neg95.2%
sub-neg95.2%
+-commutative95.2%
+-commutative95.2%
+-commutative95.2%
Simplified95.2%
Taylor expanded in x around 0 49.5%
flip--49.8%
div-inv49.8%
add-sqr-sqrt49.2%
add-sqr-sqrt50.0%
associate--l+50.4%
Applied egg-rr50.4%
+-inverses50.4%
metadata-eval50.4%
*-lft-identity50.4%
+-commutative50.4%
Simplified50.4%
if 3.4000000000000002e30 < z Initial program 91.8%
associate-+l+91.8%
sub-neg91.8%
sub-neg91.8%
+-commutative91.8%
+-commutative91.8%
+-commutative91.8%
Simplified91.8%
flip--92.0%
div-inv92.0%
add-sqr-sqrt69.5%
+-commutative69.5%
add-sqr-sqrt92.5%
+-commutative92.5%
Applied egg-rr92.5%
associate--l+95.9%
+-inverses95.9%
metadata-eval95.9%
*-lft-identity95.9%
+-commutative95.9%
Simplified95.9%
flip--96.5%
div-inv96.5%
add-sqr-sqrt73.7%
add-sqr-sqrt96.5%
associate--l+99.1%
Applied egg-rr99.1%
+-inverses99.1%
metadata-eval99.1%
*-lft-identity99.1%
+-commutative99.1%
Simplified99.1%
Taylor expanded in t around inf 51.3%
Final simplification50.8%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (+ (+ (/ 1.0 (+ (sqrt x) (sqrt (+ 1.0 x)))) (/ 1.0 (+ (sqrt y) (sqrt (+ 1.0 y))))) (+ (- (sqrt (+ 1.0 z)) (sqrt z)) (- (sqrt (+ 1.0 t)) (sqrt t)))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
return ((1.0 / (sqrt(x) + sqrt((1.0 + x)))) + (1.0 / (sqrt(y) + sqrt((1.0 + y))))) + ((sqrt((1.0 + z)) - sqrt(z)) + (sqrt((1.0 + t)) - sqrt(t)));
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = ((1.0d0 / (sqrt(x) + sqrt((1.0d0 + x)))) + (1.0d0 / (sqrt(y) + sqrt((1.0d0 + y))))) + ((sqrt((1.0d0 + z)) - sqrt(z)) + (sqrt((1.0d0 + t)) - sqrt(t)))
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
return ((1.0 / (Math.sqrt(x) + Math.sqrt((1.0 + x)))) + (1.0 / (Math.sqrt(y) + Math.sqrt((1.0 + y))))) + ((Math.sqrt((1.0 + z)) - Math.sqrt(z)) + (Math.sqrt((1.0 + t)) - Math.sqrt(t)));
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): return ((1.0 / (math.sqrt(x) + math.sqrt((1.0 + x)))) + (1.0 / (math.sqrt(y) + math.sqrt((1.0 + y))))) + ((math.sqrt((1.0 + z)) - math.sqrt(z)) + (math.sqrt((1.0 + t)) - math.sqrt(t)))
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) return Float64(Float64(Float64(1.0 / Float64(sqrt(x) + sqrt(Float64(1.0 + x)))) + Float64(1.0 / Float64(sqrt(y) + sqrt(Float64(1.0 + y))))) + Float64(Float64(sqrt(Float64(1.0 + z)) - sqrt(z)) + Float64(sqrt(Float64(1.0 + t)) - sqrt(t)))) end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp = code(x, y, z, t)
tmp = ((1.0 / (sqrt(x) + sqrt((1.0 + x)))) + (1.0 / (sqrt(y) + sqrt((1.0 + y))))) + ((sqrt((1.0 + z)) - sqrt(z)) + (sqrt((1.0 + t)) - sqrt(t)));
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := N[(N[(N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\left(\frac{1}{\sqrt{x} + \sqrt{1 + x}} + \frac{1}{\sqrt{y} + \sqrt{1 + y}}\right) + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\sqrt{1 + t} - \sqrt{t}\right)\right)
\end{array}
Initial program 93.7%
associate-+l+93.7%
sub-neg93.7%
sub-neg93.7%
+-commutative93.7%
+-commutative93.7%
+-commutative93.7%
Simplified93.7%
flip--93.8%
div-inv93.8%
add-sqr-sqrt73.2%
+-commutative73.2%
add-sqr-sqrt94.1%
+-commutative94.1%
Applied egg-rr94.1%
associate--l+95.8%
+-inverses95.8%
metadata-eval95.8%
*-lft-identity95.8%
+-commutative95.8%
Simplified95.8%
flip--96.1%
div-inv96.1%
add-sqr-sqrt73.7%
add-sqr-sqrt96.3%
associate--l+97.5%
Applied egg-rr97.5%
+-inverses97.5%
metadata-eval97.5%
*-lft-identity97.5%
+-commutative97.5%
Simplified97.5%
Final simplification97.5%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (sqrt (+ 1.0 z)) (sqrt z))) (t_2 (sqrt (+ 1.0 y))))
(if (<= t 6e+30)
(+
(+ (- 1.0 (sqrt x)) (- t_2 (sqrt y)))
(+ t_1 (/ 1.0 (+ (sqrt (+ 1.0 t)) (sqrt t)))))
(+
(+ (/ 1.0 (+ (sqrt x) (sqrt (+ 1.0 x)))) (/ 1.0 (+ (sqrt y) t_2)))
t_1))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + z)) - sqrt(z);
double t_2 = sqrt((1.0 + y));
double tmp;
if (t <= 6e+30) {
tmp = ((1.0 - sqrt(x)) + (t_2 - sqrt(y))) + (t_1 + (1.0 / (sqrt((1.0 + t)) + sqrt(t))));
} else {
tmp = ((1.0 / (sqrt(x) + sqrt((1.0 + x)))) + (1.0 / (sqrt(y) + t_2))) + t_1;
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = sqrt((1.0d0 + z)) - sqrt(z)
t_2 = sqrt((1.0d0 + y))
if (t <= 6d+30) then
tmp = ((1.0d0 - sqrt(x)) + (t_2 - sqrt(y))) + (t_1 + (1.0d0 / (sqrt((1.0d0 + t)) + sqrt(t))))
else
tmp = ((1.0d0 / (sqrt(x) + sqrt((1.0d0 + x)))) + (1.0d0 / (sqrt(y) + t_2))) + t_1
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + z)) - Math.sqrt(z);
double t_2 = Math.sqrt((1.0 + y));
double tmp;
if (t <= 6e+30) {
tmp = ((1.0 - Math.sqrt(x)) + (t_2 - Math.sqrt(y))) + (t_1 + (1.0 / (Math.sqrt((1.0 + t)) + Math.sqrt(t))));
} else {
tmp = ((1.0 / (Math.sqrt(x) + Math.sqrt((1.0 + x)))) + (1.0 / (Math.sqrt(y) + t_2))) + t_1;
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + z)) - math.sqrt(z) t_2 = math.sqrt((1.0 + y)) tmp = 0 if t <= 6e+30: tmp = ((1.0 - math.sqrt(x)) + (t_2 - math.sqrt(y))) + (t_1 + (1.0 / (math.sqrt((1.0 + t)) + math.sqrt(t)))) else: tmp = ((1.0 / (math.sqrt(x) + math.sqrt((1.0 + x)))) + (1.0 / (math.sqrt(y) + t_2))) + t_1 return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = Float64(sqrt(Float64(1.0 + z)) - sqrt(z)) t_2 = sqrt(Float64(1.0 + y)) tmp = 0.0 if (t <= 6e+30) tmp = Float64(Float64(Float64(1.0 - sqrt(x)) + Float64(t_2 - sqrt(y))) + Float64(t_1 + Float64(1.0 / Float64(sqrt(Float64(1.0 + t)) + sqrt(t))))); else tmp = Float64(Float64(Float64(1.0 / Float64(sqrt(x) + sqrt(Float64(1.0 + x)))) + Float64(1.0 / Float64(sqrt(y) + t_2))) + t_1); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + z)) - sqrt(z);
t_2 = sqrt((1.0 + y));
tmp = 0.0;
if (t <= 6e+30)
tmp = ((1.0 - sqrt(x)) + (t_2 - sqrt(y))) + (t_1 + (1.0 / (sqrt((1.0 + t)) + sqrt(t))));
else
tmp = ((1.0 / (sqrt(x) + sqrt((1.0 + x)))) + (1.0 / (sqrt(y) + t_2))) + t_1;
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t, 6e+30], N[(N[(N[(1.0 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(t$95$2 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$1 + N[(1.0 / N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] + N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $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[y], $MachinePrecision] + t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + z} - \sqrt{z}\\
t_2 := \sqrt{1 + y}\\
\mathbf{if}\;t \leq 6 \cdot 10^{+30}:\\
\;\;\;\;\left(\left(1 - \sqrt{x}\right) + \left(t\_2 - \sqrt{y}\right)\right) + \left(t\_1 + \frac{1}{\sqrt{1 + t} + \sqrt{t}}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{1}{\sqrt{x} + \sqrt{1 + x}} + \frac{1}{\sqrt{y} + t\_2}\right) + t\_1\\
\end{array}
\end{array}
if t < 5.99999999999999956e30Initial program 96.9%
associate-+l+96.9%
sub-neg96.9%
sub-neg96.9%
+-commutative96.9%
+-commutative96.9%
+-commutative96.9%
Simplified96.9%
Taylor expanded in x around 0 53.9%
flip--27.1%
div-inv27.1%
add-sqr-sqrt26.6%
+-commutative26.6%
add-sqr-sqrt27.1%
associate--l+27.1%
Applied egg-rr54.0%
associate-*r/27.1%
*-rgt-identity27.1%
associate-+r-27.1%
+-commutative27.1%
associate-+r-27.2%
+-inverses27.2%
metadata-eval27.2%
+-commutative27.2%
Simplified54.5%
if 5.99999999999999956e30 < t Initial program 89.8%
associate-+l+89.8%
sub-neg89.8%
sub-neg89.8%
+-commutative89.8%
+-commutative89.8%
+-commutative89.8%
Simplified89.8%
flip--89.8%
div-inv89.8%
add-sqr-sqrt73.9%
+-commutative73.9%
add-sqr-sqrt90.2%
+-commutative90.2%
Applied egg-rr90.2%
associate--l+93.7%
+-inverses93.7%
metadata-eval93.7%
*-lft-identity93.7%
+-commutative93.7%
Simplified93.7%
flip--93.9%
div-inv93.9%
add-sqr-sqrt69.1%
add-sqr-sqrt94.1%
associate--l+96.7%
Applied egg-rr96.7%
+-inverses96.7%
metadata-eval96.7%
*-lft-identity96.7%
+-commutative96.7%
Simplified96.7%
Taylor expanded in t around inf 96.7%
Final simplification73.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 y))))
(if (<= z 4.8e-7)
(+
(+ (- 1.0 (sqrt x)) (- t_1 (sqrt y)))
(+ (/ 1.0 (+ (sqrt (+ 1.0 t)) (sqrt t))) (+ 1.0 (- (* z 0.5) (sqrt z)))))
(+
(+ (/ 1.0 (+ (sqrt x) (sqrt (+ 1.0 x)))) (/ 1.0 (+ (sqrt y) t_1)))
(- (sqrt (+ 1.0 z)) (sqrt z))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + y));
double tmp;
if (z <= 4.8e-7) {
tmp = ((1.0 - sqrt(x)) + (t_1 - sqrt(y))) + ((1.0 / (sqrt((1.0 + t)) + sqrt(t))) + (1.0 + ((z * 0.5) - sqrt(z))));
} else {
tmp = ((1.0 / (sqrt(x) + sqrt((1.0 + x)))) + (1.0 / (sqrt(y) + t_1))) + (sqrt((1.0 + z)) - sqrt(z));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = sqrt((1.0d0 + y))
if (z <= 4.8d-7) then
tmp = ((1.0d0 - sqrt(x)) + (t_1 - sqrt(y))) + ((1.0d0 / (sqrt((1.0d0 + t)) + sqrt(t))) + (1.0d0 + ((z * 0.5d0) - sqrt(z))))
else
tmp = ((1.0d0 / (sqrt(x) + sqrt((1.0d0 + x)))) + (1.0d0 / (sqrt(y) + t_1))) + (sqrt((1.0d0 + z)) - sqrt(z))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + y));
double tmp;
if (z <= 4.8e-7) {
tmp = ((1.0 - Math.sqrt(x)) + (t_1 - Math.sqrt(y))) + ((1.0 / (Math.sqrt((1.0 + t)) + Math.sqrt(t))) + (1.0 + ((z * 0.5) - Math.sqrt(z))));
} else {
tmp = ((1.0 / (Math.sqrt(x) + Math.sqrt((1.0 + x)))) + (1.0 / (Math.sqrt(y) + t_1))) + (Math.sqrt((1.0 + z)) - Math.sqrt(z));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + y)) tmp = 0 if z <= 4.8e-7: tmp = ((1.0 - math.sqrt(x)) + (t_1 - math.sqrt(y))) + ((1.0 / (math.sqrt((1.0 + t)) + math.sqrt(t))) + (1.0 + ((z * 0.5) - math.sqrt(z)))) else: tmp = ((1.0 / (math.sqrt(x) + math.sqrt((1.0 + x)))) + (1.0 / (math.sqrt(y) + t_1))) + (math.sqrt((1.0 + z)) - math.sqrt(z)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(1.0 + y)) tmp = 0.0 if (z <= 4.8e-7) tmp = Float64(Float64(Float64(1.0 - sqrt(x)) + Float64(t_1 - sqrt(y))) + Float64(Float64(1.0 / Float64(sqrt(Float64(1.0 + t)) + sqrt(t))) + Float64(1.0 + Float64(Float64(z * 0.5) - sqrt(z))))); else tmp = Float64(Float64(Float64(1.0 / Float64(sqrt(x) + sqrt(Float64(1.0 + x)))) + Float64(1.0 / Float64(sqrt(y) + t_1))) + Float64(sqrt(Float64(1.0 + z)) - sqrt(z))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + y));
tmp = 0.0;
if (z <= 4.8e-7)
tmp = ((1.0 - sqrt(x)) + (t_1 - sqrt(y))) + ((1.0 / (sqrt((1.0 + t)) + sqrt(t))) + (1.0 + ((z * 0.5) - sqrt(z))));
else
tmp = ((1.0 / (sqrt(x) + sqrt((1.0 + x)))) + (1.0 / (sqrt(y) + t_1))) + (sqrt((1.0 + z)) - sqrt(z));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[z, 4.8e-7], N[(N[(N[(1.0 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(t$95$1 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 / N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] + N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 + N[(N[(z * 0.5), $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $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[y], $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + y}\\
\mathbf{if}\;z \leq 4.8 \cdot 10^{-7}:\\
\;\;\;\;\left(\left(1 - \sqrt{x}\right) + \left(t\_1 - \sqrt{y}\right)\right) + \left(\frac{1}{\sqrt{1 + t} + \sqrt{t}} + \left(1 + \left(z \cdot 0.5 - \sqrt{z}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{1}{\sqrt{x} + \sqrt{1 + x}} + \frac{1}{\sqrt{y} + t\_1}\right) + \left(\sqrt{1 + z} - \sqrt{z}\right)\\
\end{array}
\end{array}
if z < 4.79999999999999957e-7Initial program 97.7%
associate-+l+97.7%
sub-neg97.7%
sub-neg97.7%
+-commutative97.7%
+-commutative97.7%
+-commutative97.7%
Simplified97.7%
Taylor expanded in x around 0 49.7%
Taylor expanded in z around 0 49.7%
associate--l+49.7%
Simplified49.7%
flip--49.8%
div-inv49.8%
add-sqr-sqrt37.5%
+-commutative37.5%
add-sqr-sqrt49.9%
associate--l+49.9%
Applied egg-rr49.9%
associate-*r/49.9%
*-rgt-identity49.9%
associate-+r-49.9%
+-commutative49.9%
associate-+r-50.0%
+-inverses50.0%
metadata-eval50.0%
+-commutative50.0%
Simplified50.0%
if 4.79999999999999957e-7 < z Initial program 89.8%
associate-+l+89.8%
sub-neg89.8%
sub-neg89.8%
+-commutative89.8%
+-commutative89.8%
+-commutative89.8%
Simplified89.8%
flip--90.0%
div-inv90.0%
add-sqr-sqrt69.2%
+-commutative69.2%
add-sqr-sqrt90.4%
+-commutative90.4%
Applied egg-rr90.4%
associate--l+93.4%
+-inverses93.4%
metadata-eval93.4%
*-lft-identity93.4%
+-commutative93.4%
Simplified93.4%
flip--93.9%
div-inv93.9%
add-sqr-sqrt70.4%
add-sqr-sqrt93.9%
associate--l+96.2%
Applied egg-rr96.2%
+-inverses96.2%
metadata-eval96.2%
*-lft-identity96.2%
+-commutative96.2%
Simplified96.2%
Taylor expanded in t around inf 50.4%
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
(if (<= z 2.3e-7)
(+
(- (- 2.0 (sqrt x)) (sqrt y))
(+ (- (sqrt (+ 1.0 t)) (sqrt t)) (+ 1.0 (- (* z 0.5) (sqrt z)))))
(+
(+
(/ 1.0 (+ (sqrt x) (sqrt (+ 1.0 x))))
(/ 1.0 (+ (sqrt y) (sqrt (+ 1.0 y)))))
(- (sqrt (+ 1.0 z)) (sqrt z)))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (z <= 2.3e-7) {
tmp = ((2.0 - sqrt(x)) - sqrt(y)) + ((sqrt((1.0 + t)) - sqrt(t)) + (1.0 + ((z * 0.5) - sqrt(z))));
} else {
tmp = ((1.0 / (sqrt(x) + sqrt((1.0 + x)))) + (1.0 / (sqrt(y) + sqrt((1.0 + y))))) + (sqrt((1.0 + z)) - 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) :: tmp
if (z <= 2.3d-7) then
tmp = ((2.0d0 - sqrt(x)) - sqrt(y)) + ((sqrt((1.0d0 + t)) - sqrt(t)) + (1.0d0 + ((z * 0.5d0) - sqrt(z))))
else
tmp = ((1.0d0 / (sqrt(x) + sqrt((1.0d0 + x)))) + (1.0d0 / (sqrt(y) + sqrt((1.0d0 + y))))) + (sqrt((1.0d0 + z)) - 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 tmp;
if (z <= 2.3e-7) {
tmp = ((2.0 - Math.sqrt(x)) - Math.sqrt(y)) + ((Math.sqrt((1.0 + t)) - Math.sqrt(t)) + (1.0 + ((z * 0.5) - Math.sqrt(z))));
} else {
tmp = ((1.0 / (Math.sqrt(x) + Math.sqrt((1.0 + x)))) + (1.0 / (Math.sqrt(y) + Math.sqrt((1.0 + y))))) + (Math.sqrt((1.0 + z)) - Math.sqrt(z));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if z <= 2.3e-7: tmp = ((2.0 - math.sqrt(x)) - math.sqrt(y)) + ((math.sqrt((1.0 + t)) - math.sqrt(t)) + (1.0 + ((z * 0.5) - math.sqrt(z)))) else: tmp = ((1.0 / (math.sqrt(x) + math.sqrt((1.0 + x)))) + (1.0 / (math.sqrt(y) + math.sqrt((1.0 + y))))) + (math.sqrt((1.0 + z)) - math.sqrt(z)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (z <= 2.3e-7) tmp = Float64(Float64(Float64(2.0 - sqrt(x)) - sqrt(y)) + Float64(Float64(sqrt(Float64(1.0 + t)) - sqrt(t)) + Float64(1.0 + Float64(Float64(z * 0.5) - sqrt(z))))); else tmp = Float64(Float64(Float64(1.0 / Float64(sqrt(x) + sqrt(Float64(1.0 + x)))) + Float64(1.0 / Float64(sqrt(y) + sqrt(Float64(1.0 + y))))) + Float64(sqrt(Float64(1.0 + z)) - sqrt(z))); 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 <= 2.3e-7)
tmp = ((2.0 - sqrt(x)) - sqrt(y)) + ((sqrt((1.0 + t)) - sqrt(t)) + (1.0 + ((z * 0.5) - sqrt(z))));
else
tmp = ((1.0 / (sqrt(x) + sqrt((1.0 + x)))) + (1.0 / (sqrt(y) + sqrt((1.0 + y))))) + (sqrt((1.0 + z)) - 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_] := If[LessEqual[z, 2.3e-7], N[(N[(N[(2.0 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision] + N[(N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision] + N[(1.0 + N[(N[(z * 0.5), $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $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[y], $MachinePrecision] + N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq 2.3 \cdot 10^{-7}:\\
\;\;\;\;\left(\left(2 - \sqrt{x}\right) - \sqrt{y}\right) + \left(\left(\sqrt{1 + t} - \sqrt{t}\right) + \left(1 + \left(z \cdot 0.5 - \sqrt{z}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{1}{\sqrt{x} + \sqrt{1 + x}} + \frac{1}{\sqrt{y} + \sqrt{1 + y}}\right) + \left(\sqrt{1 + z} - \sqrt{z}\right)\\
\end{array}
\end{array}
if z < 2.29999999999999995e-7Initial program 97.7%
associate-+l+97.7%
sub-neg97.7%
sub-neg97.7%
+-commutative97.7%
+-commutative97.7%
+-commutative97.7%
Simplified97.7%
Taylor expanded in x around 0 49.7%
Taylor expanded in z around 0 49.7%
associate--l+49.7%
Simplified49.7%
Taylor expanded in y around 0 22.8%
associate--r+22.8%
Simplified22.8%
if 2.29999999999999995e-7 < z Initial program 89.8%
associate-+l+89.8%
sub-neg89.8%
sub-neg89.8%
+-commutative89.8%
+-commutative89.8%
+-commutative89.8%
Simplified89.8%
flip--90.0%
div-inv90.0%
add-sqr-sqrt69.2%
+-commutative69.2%
add-sqr-sqrt90.4%
+-commutative90.4%
Applied egg-rr90.4%
associate--l+93.4%
+-inverses93.4%
metadata-eval93.4%
*-lft-identity93.4%
+-commutative93.4%
Simplified93.4%
flip--93.9%
div-inv93.9%
add-sqr-sqrt70.4%
add-sqr-sqrt93.9%
associate--l+96.2%
Applied egg-rr96.2%
+-inverses96.2%
metadata-eval96.2%
*-lft-identity96.2%
+-commutative96.2%
Simplified96.2%
Taylor expanded in t around inf 50.4%
Final simplification36.7%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (sqrt (+ 1.0 z)) (sqrt z))))
(if (<= y 1.4e-23)
(+
(+ t_1 (- (sqrt (+ 1.0 t)) (sqrt t)))
(+ (- 1.0 (sqrt x)) (- 1.0 (sqrt y))))
(if (<= y 7500000000.0)
(+
t_1
(+ (/ 1.0 (+ (sqrt y) (sqrt (+ 1.0 y)))) (/ 1.0 (+ 1.0 (sqrt x)))))
(+
t_1
(+ (/ 1.0 (+ (sqrt x) (sqrt (+ 1.0 x)))) (/ 1.0 (* (sqrt y) 2.0))))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + z)) - sqrt(z);
double tmp;
if (y <= 1.4e-23) {
tmp = (t_1 + (sqrt((1.0 + t)) - sqrt(t))) + ((1.0 - sqrt(x)) + (1.0 - sqrt(y)));
} else if (y <= 7500000000.0) {
tmp = t_1 + ((1.0 / (sqrt(y) + sqrt((1.0 + y)))) + (1.0 / (1.0 + sqrt(x))));
} else {
tmp = t_1 + ((1.0 / (sqrt(x) + sqrt((1.0 + x)))) + (1.0 / (sqrt(y) * 2.0)));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = sqrt((1.0d0 + z)) - sqrt(z)
if (y <= 1.4d-23) then
tmp = (t_1 + (sqrt((1.0d0 + t)) - sqrt(t))) + ((1.0d0 - sqrt(x)) + (1.0d0 - sqrt(y)))
else if (y <= 7500000000.0d0) then
tmp = t_1 + ((1.0d0 / (sqrt(y) + sqrt((1.0d0 + y)))) + (1.0d0 / (1.0d0 + sqrt(x))))
else
tmp = t_1 + ((1.0d0 / (sqrt(x) + sqrt((1.0d0 + x)))) + (1.0d0 / (sqrt(y) * 2.0d0)))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + z)) - Math.sqrt(z);
double tmp;
if (y <= 1.4e-23) {
tmp = (t_1 + (Math.sqrt((1.0 + t)) - Math.sqrt(t))) + ((1.0 - Math.sqrt(x)) + (1.0 - Math.sqrt(y)));
} else if (y <= 7500000000.0) {
tmp = t_1 + ((1.0 / (Math.sqrt(y) + Math.sqrt((1.0 + y)))) + (1.0 / (1.0 + Math.sqrt(x))));
} else {
tmp = t_1 + ((1.0 / (Math.sqrt(x) + Math.sqrt((1.0 + x)))) + (1.0 / (Math.sqrt(y) * 2.0)));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + z)) - math.sqrt(z) tmp = 0 if y <= 1.4e-23: tmp = (t_1 + (math.sqrt((1.0 + t)) - math.sqrt(t))) + ((1.0 - math.sqrt(x)) + (1.0 - math.sqrt(y))) elif y <= 7500000000.0: tmp = t_1 + ((1.0 / (math.sqrt(y) + math.sqrt((1.0 + y)))) + (1.0 / (1.0 + math.sqrt(x)))) else: tmp = t_1 + ((1.0 / (math.sqrt(x) + math.sqrt((1.0 + x)))) + (1.0 / (math.sqrt(y) * 2.0))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = Float64(sqrt(Float64(1.0 + z)) - sqrt(z)) tmp = 0.0 if (y <= 1.4e-23) tmp = Float64(Float64(t_1 + Float64(sqrt(Float64(1.0 + t)) - sqrt(t))) + Float64(Float64(1.0 - sqrt(x)) + Float64(1.0 - sqrt(y)))); elseif (y <= 7500000000.0) tmp = Float64(t_1 + Float64(Float64(1.0 / Float64(sqrt(y) + sqrt(Float64(1.0 + y)))) + Float64(1.0 / Float64(1.0 + sqrt(x))))); else tmp = Float64(t_1 + Float64(Float64(1.0 / Float64(sqrt(x) + sqrt(Float64(1.0 + x)))) + Float64(1.0 / Float64(sqrt(y) * 2.0)))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + z)) - sqrt(z);
tmp = 0.0;
if (y <= 1.4e-23)
tmp = (t_1 + (sqrt((1.0 + t)) - sqrt(t))) + ((1.0 - sqrt(x)) + (1.0 - sqrt(y)));
elseif (y <= 7500000000.0)
tmp = t_1 + ((1.0 / (sqrt(y) + sqrt((1.0 + y)))) + (1.0 / (1.0 + sqrt(x))));
else
tmp = t_1 + ((1.0 / (sqrt(x) + sqrt((1.0 + x)))) + (1.0 / (sqrt(y) * 2.0)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 1.4e-23], N[(N[(t$95$1 + N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(1.0 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 7500000000.0], N[(t$95$1 + N[(N[(1.0 / N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(1.0 + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 + 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[y], $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + z} - \sqrt{z}\\
\mathbf{if}\;y \leq 1.4 \cdot 10^{-23}:\\
\;\;\;\;\left(t\_1 + \left(\sqrt{1 + t} - \sqrt{t}\right)\right) + \left(\left(1 - \sqrt{x}\right) + \left(1 - \sqrt{y}\right)\right)\\
\mathbf{elif}\;y \leq 7500000000:\\
\;\;\;\;t\_1 + \left(\frac{1}{\sqrt{y} + \sqrt{1 + y}} + \frac{1}{1 + \sqrt{x}}\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1 + \left(\frac{1}{\sqrt{x} + \sqrt{1 + x}} + \frac{1}{\sqrt{y} \cdot 2}\right)\\
\end{array}
\end{array}
if y < 1.3999999999999999e-23Initial program 98.1%
associate-+l+98.1%
sub-neg98.1%
sub-neg98.1%
+-commutative98.1%
+-commutative98.1%
+-commutative98.1%
Simplified98.1%
Taylor expanded in x around 0 48.7%
Taylor expanded in y around 0 48.7%
if 1.3999999999999999e-23 < y < 7.5e9Initial program 96.6%
associate-+l+96.6%
sub-neg96.6%
sub-neg96.6%
+-commutative96.6%
+-commutative96.6%
+-commutative96.6%
Simplified96.6%
flip--96.6%
div-inv96.6%
add-sqr-sqrt82.2%
+-commutative82.2%
add-sqr-sqrt96.6%
+-commutative96.6%
Applied egg-rr96.6%
associate--l+96.6%
+-inverses96.6%
metadata-eval96.6%
*-lft-identity96.6%
+-commutative96.6%
Simplified96.6%
flip--98.0%
div-inv98.0%
add-sqr-sqrt99.4%
add-sqr-sqrt99.6%
associate--l+99.6%
Applied egg-rr99.6%
+-inverses99.6%
metadata-eval99.6%
*-lft-identity99.6%
+-commutative99.6%
Simplified99.6%
Taylor expanded in t around inf 55.9%
Taylor expanded in x around 0 55.9%
if 7.5e9 < y Initial program 89.4%
associate-+l+89.4%
sub-neg89.4%
sub-neg89.4%
+-commutative89.4%
+-commutative89.4%
+-commutative89.4%
Simplified89.4%
flip--89.6%
div-inv89.6%
add-sqr-sqrt72.2%
+-commutative72.2%
add-sqr-sqrt90.1%
+-commutative90.1%
Applied egg-rr90.1%
associate--l+93.1%
+-inverses93.1%
metadata-eval93.1%
*-lft-identity93.1%
+-commutative93.1%
Simplified93.1%
flip--93.5%
div-inv93.5%
add-sqr-sqrt48.6%
add-sqr-sqrt93.7%
associate--l+96.3%
Applied egg-rr96.3%
+-inverses96.3%
metadata-eval96.3%
*-lft-identity96.3%
+-commutative96.3%
Simplified96.3%
Taylor expanded in t around inf 55.1%
Taylor expanded in y around inf 55.1%
*-commutative55.1%
Simplified55.1%
Final simplification52.3%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(if (<= t 18500000000.0)
(+
3.0
(-
(+ (sqrt (+ 1.0 t)) (* z 0.5))
(+ (+ (sqrt x) (sqrt t)) (+ (sqrt y) (sqrt z)))))
(+
(- (sqrt (+ 1.0 z)) (sqrt z))
(+ (/ 1.0 (+ (sqrt y) (sqrt (+ 1.0 y)))) (/ 1.0 (+ 1.0 (sqrt x)))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (t <= 18500000000.0) {
tmp = 3.0 + ((sqrt((1.0 + t)) + (z * 0.5)) - ((sqrt(x) + sqrt(t)) + (sqrt(y) + sqrt(z))));
} else {
tmp = (sqrt((1.0 + z)) - sqrt(z)) + ((1.0 / (sqrt(y) + sqrt((1.0 + y)))) + (1.0 / (1.0 + sqrt(x))));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (t <= 18500000000.0d0) then
tmp = 3.0d0 + ((sqrt((1.0d0 + t)) + (z * 0.5d0)) - ((sqrt(x) + sqrt(t)) + (sqrt(y) + sqrt(z))))
else
tmp = (sqrt((1.0d0 + z)) - sqrt(z)) + ((1.0d0 / (sqrt(y) + sqrt((1.0d0 + y)))) + (1.0d0 / (1.0d0 + sqrt(x))))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (t <= 18500000000.0) {
tmp = 3.0 + ((Math.sqrt((1.0 + t)) + (z * 0.5)) - ((Math.sqrt(x) + Math.sqrt(t)) + (Math.sqrt(y) + Math.sqrt(z))));
} else {
tmp = (Math.sqrt((1.0 + z)) - Math.sqrt(z)) + ((1.0 / (Math.sqrt(y) + Math.sqrt((1.0 + y)))) + (1.0 / (1.0 + Math.sqrt(x))));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if t <= 18500000000.0: tmp = 3.0 + ((math.sqrt((1.0 + t)) + (z * 0.5)) - ((math.sqrt(x) + math.sqrt(t)) + (math.sqrt(y) + math.sqrt(z)))) else: tmp = (math.sqrt((1.0 + z)) - math.sqrt(z)) + ((1.0 / (math.sqrt(y) + math.sqrt((1.0 + y)))) + (1.0 / (1.0 + math.sqrt(x)))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (t <= 18500000000.0) tmp = Float64(3.0 + Float64(Float64(sqrt(Float64(1.0 + t)) + Float64(z * 0.5)) - Float64(Float64(sqrt(x) + sqrt(t)) + Float64(sqrt(y) + sqrt(z))))); else tmp = Float64(Float64(sqrt(Float64(1.0 + z)) - sqrt(z)) + Float64(Float64(1.0 / Float64(sqrt(y) + sqrt(Float64(1.0 + y)))) + Float64(1.0 / Float64(1.0 + sqrt(x))))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (t <= 18500000000.0)
tmp = 3.0 + ((sqrt((1.0 + t)) + (z * 0.5)) - ((sqrt(x) + sqrt(t)) + (sqrt(y) + sqrt(z))));
else
tmp = (sqrt((1.0 + z)) - sqrt(z)) + ((1.0 / (sqrt(y) + sqrt((1.0 + y)))) + (1.0 / (1.0 + sqrt(x))));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[t, 18500000000.0], N[(3.0 + N[(N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] + N[(z * 0.5), $MachinePrecision]), $MachinePrecision] - N[(N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[t], $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 / N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(1.0 + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq 18500000000:\\
\;\;\;\;3 + \left(\left(\sqrt{1 + t} + z \cdot 0.5\right) - \left(\left(\sqrt{x} + \sqrt{t}\right) + \left(\sqrt{y} + \sqrt{z}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\frac{1}{\sqrt{y} + \sqrt{1 + y}} + \frac{1}{1 + \sqrt{x}}\right)\\
\end{array}
\end{array}
if t < 1.85e10Initial program 97.7%
associate-+l+97.7%
sub-neg97.7%
sub-neg97.7%
+-commutative97.7%
+-commutative97.7%
+-commutative97.7%
Simplified97.7%
Taylor expanded in x around 0 54.1%
Taylor expanded in z around 0 27.2%
associate--l+27.2%
Simplified27.2%
Taylor expanded in y around 0 12.9%
associate--l+12.9%
+-commutative12.9%
associate-+r+12.9%
Simplified12.9%
if 1.85e10 < t Initial program 89.4%
associate-+l+89.4%
sub-neg89.4%
sub-neg89.4%
+-commutative89.4%
+-commutative89.4%
+-commutative89.4%
Simplified89.4%
flip--89.3%
div-inv89.3%
add-sqr-sqrt73.1%
+-commutative73.1%
add-sqr-sqrt89.7%
+-commutative89.7%
Applied egg-rr89.7%
associate--l+93.0%
+-inverses93.0%
metadata-eval93.0%
*-lft-identity93.0%
+-commutative93.0%
Simplified93.0%
flip--93.3%
div-inv93.3%
add-sqr-sqrt69.8%
add-sqr-sqrt93.4%
associate--l+95.9%
Applied egg-rr95.9%
+-inverses95.9%
metadata-eval95.9%
*-lft-identity95.9%
+-commutative95.9%
Simplified95.9%
Taylor expanded in t around inf 95.7%
Taylor expanded in x around 0 89.3%
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
(if (<= z 2.3e-7)
(+
(- (- 2.0 (sqrt x)) (sqrt y))
(+ (- (sqrt (+ 1.0 t)) (sqrt t)) (+ 1.0 (- (* z 0.5) (sqrt z)))))
(+
(- (sqrt (+ 1.0 z)) (sqrt z))
(+ (/ 1.0 (+ (sqrt y) (sqrt (+ 1.0 y)))) (/ 1.0 (+ 1.0 (sqrt x)))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (z <= 2.3e-7) {
tmp = ((2.0 - sqrt(x)) - sqrt(y)) + ((sqrt((1.0 + t)) - sqrt(t)) + (1.0 + ((z * 0.5) - sqrt(z))));
} else {
tmp = (sqrt((1.0 + z)) - sqrt(z)) + ((1.0 / (sqrt(y) + sqrt((1.0 + y)))) + (1.0 / (1.0 + sqrt(x))));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (z <= 2.3d-7) then
tmp = ((2.0d0 - sqrt(x)) - sqrt(y)) + ((sqrt((1.0d0 + t)) - sqrt(t)) + (1.0d0 + ((z * 0.5d0) - sqrt(z))))
else
tmp = (sqrt((1.0d0 + z)) - sqrt(z)) + ((1.0d0 / (sqrt(y) + sqrt((1.0d0 + y)))) + (1.0d0 / (1.0d0 + sqrt(x))))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= 2.3e-7) {
tmp = ((2.0 - Math.sqrt(x)) - Math.sqrt(y)) + ((Math.sqrt((1.0 + t)) - Math.sqrt(t)) + (1.0 + ((z * 0.5) - Math.sqrt(z))));
} else {
tmp = (Math.sqrt((1.0 + z)) - Math.sqrt(z)) + ((1.0 / (Math.sqrt(y) + Math.sqrt((1.0 + y)))) + (1.0 / (1.0 + Math.sqrt(x))));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if z <= 2.3e-7: tmp = ((2.0 - math.sqrt(x)) - math.sqrt(y)) + ((math.sqrt((1.0 + t)) - math.sqrt(t)) + (1.0 + ((z * 0.5) - math.sqrt(z)))) else: tmp = (math.sqrt((1.0 + z)) - math.sqrt(z)) + ((1.0 / (math.sqrt(y) + math.sqrt((1.0 + y)))) + (1.0 / (1.0 + math.sqrt(x)))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (z <= 2.3e-7) tmp = Float64(Float64(Float64(2.0 - sqrt(x)) - sqrt(y)) + Float64(Float64(sqrt(Float64(1.0 + t)) - sqrt(t)) + Float64(1.0 + Float64(Float64(z * 0.5) - sqrt(z))))); else tmp = Float64(Float64(sqrt(Float64(1.0 + z)) - sqrt(z)) + Float64(Float64(1.0 / Float64(sqrt(y) + sqrt(Float64(1.0 + y)))) + Float64(1.0 / Float64(1.0 + sqrt(x))))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (z <= 2.3e-7)
tmp = ((2.0 - sqrt(x)) - sqrt(y)) + ((sqrt((1.0 + t)) - sqrt(t)) + (1.0 + ((z * 0.5) - sqrt(z))));
else
tmp = (sqrt((1.0 + z)) - sqrt(z)) + ((1.0 / (sqrt(y) + sqrt((1.0 + y)))) + (1.0 / (1.0 + sqrt(x))));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[z, 2.3e-7], N[(N[(N[(2.0 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision] + N[(N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision] + N[(1.0 + N[(N[(z * 0.5), $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 / N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(1.0 + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq 2.3 \cdot 10^{-7}:\\
\;\;\;\;\left(\left(2 - \sqrt{x}\right) - \sqrt{y}\right) + \left(\left(\sqrt{1 + t} - \sqrt{t}\right) + \left(1 + \left(z \cdot 0.5 - \sqrt{z}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\frac{1}{\sqrt{y} + \sqrt{1 + y}} + \frac{1}{1 + \sqrt{x}}\right)\\
\end{array}
\end{array}
if z < 2.29999999999999995e-7Initial program 97.7%
associate-+l+97.7%
sub-neg97.7%
sub-neg97.7%
+-commutative97.7%
+-commutative97.7%
+-commutative97.7%
Simplified97.7%
Taylor expanded in x around 0 49.7%
Taylor expanded in z around 0 49.7%
associate--l+49.7%
Simplified49.7%
Taylor expanded in y around 0 22.8%
associate--r+22.8%
Simplified22.8%
if 2.29999999999999995e-7 < z Initial program 89.8%
associate-+l+89.8%
sub-neg89.8%
sub-neg89.8%
+-commutative89.8%
+-commutative89.8%
+-commutative89.8%
Simplified89.8%
flip--90.0%
div-inv90.0%
add-sqr-sqrt69.2%
+-commutative69.2%
add-sqr-sqrt90.4%
+-commutative90.4%
Applied egg-rr90.4%
associate--l+93.4%
+-inverses93.4%
metadata-eval93.4%
*-lft-identity93.4%
+-commutative93.4%
Simplified93.4%
flip--93.9%
div-inv93.9%
add-sqr-sqrt70.4%
add-sqr-sqrt93.9%
associate--l+96.2%
Applied egg-rr96.2%
+-inverses96.2%
metadata-eval96.2%
*-lft-identity96.2%
+-commutative96.2%
Simplified96.2%
Taylor expanded in t around inf 50.4%
Taylor expanded in x around 0 46.0%
Final simplification34.5%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(if (<= t 18500000000.0)
(+
3.0
(-
(+ (sqrt (+ 1.0 t)) (* z 0.5))
(+ (+ (sqrt x) (sqrt t)) (+ (sqrt y) (sqrt z)))))
(+
(- (sqrt (+ 1.0 z)) (sqrt z))
(+ (- 1.0 (sqrt x)) (- (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 (t <= 18500000000.0) {
tmp = 3.0 + ((sqrt((1.0 + t)) + (z * 0.5)) - ((sqrt(x) + sqrt(t)) + (sqrt(y) + sqrt(z))));
} else {
tmp = (sqrt((1.0 + z)) - sqrt(z)) + ((1.0 - sqrt(x)) + (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 (t <= 18500000000.0d0) then
tmp = 3.0d0 + ((sqrt((1.0d0 + t)) + (z * 0.5d0)) - ((sqrt(x) + sqrt(t)) + (sqrt(y) + sqrt(z))))
else
tmp = (sqrt((1.0d0 + z)) - sqrt(z)) + ((1.0d0 - sqrt(x)) + (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 (t <= 18500000000.0) {
tmp = 3.0 + ((Math.sqrt((1.0 + t)) + (z * 0.5)) - ((Math.sqrt(x) + Math.sqrt(t)) + (Math.sqrt(y) + Math.sqrt(z))));
} else {
tmp = (Math.sqrt((1.0 + z)) - Math.sqrt(z)) + ((1.0 - Math.sqrt(x)) + (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 t <= 18500000000.0: tmp = 3.0 + ((math.sqrt((1.0 + t)) + (z * 0.5)) - ((math.sqrt(x) + math.sqrt(t)) + (math.sqrt(y) + math.sqrt(z)))) else: tmp = (math.sqrt((1.0 + z)) - math.sqrt(z)) + ((1.0 - math.sqrt(x)) + (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 (t <= 18500000000.0) tmp = Float64(3.0 + Float64(Float64(sqrt(Float64(1.0 + t)) + Float64(z * 0.5)) - Float64(Float64(sqrt(x) + sqrt(t)) + Float64(sqrt(y) + sqrt(z))))); else tmp = Float64(Float64(sqrt(Float64(1.0 + z)) - sqrt(z)) + Float64(Float64(1.0 - sqrt(x)) + 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 (t <= 18500000000.0)
tmp = 3.0 + ((sqrt((1.0 + t)) + (z * 0.5)) - ((sqrt(x) + sqrt(t)) + (sqrt(y) + sqrt(z))));
else
tmp = (sqrt((1.0 + z)) - sqrt(z)) + ((1.0 - sqrt(x)) + (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[t, 18500000000.0], N[(3.0 + N[(N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] + N[(z * 0.5), $MachinePrecision]), $MachinePrecision] - N[(N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[t], $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq 18500000000:\\
\;\;\;\;3 + \left(\left(\sqrt{1 + t} + z \cdot 0.5\right) - \left(\left(\sqrt{x} + \sqrt{t}\right) + \left(\sqrt{y} + \sqrt{z}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\left(1 - \sqrt{x}\right) + \left(\sqrt{1 + y} - \sqrt{y}\right)\right)\\
\end{array}
\end{array}
if t < 1.85e10Initial program 97.7%
associate-+l+97.7%
sub-neg97.7%
sub-neg97.7%
+-commutative97.7%
+-commutative97.7%
+-commutative97.7%
Simplified97.7%
Taylor expanded in x around 0 54.1%
Taylor expanded in z around 0 27.2%
associate--l+27.2%
Simplified27.2%
Taylor expanded in y around 0 12.9%
associate--l+12.9%
+-commutative12.9%
associate-+r+12.9%
Simplified12.9%
if 1.85e10 < t Initial program 89.4%
associate-+l+89.4%
sub-neg89.4%
sub-neg89.4%
+-commutative89.4%
+-commutative89.4%
+-commutative89.4%
Simplified89.4%
Taylor expanded in x around 0 50.6%
Taylor expanded in t around inf 50.6%
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 (<= t 18500000000.0)
(+
3.0
(-
(+ (sqrt (+ 1.0 t)) (* z 0.5))
(+ (+ (sqrt x) (sqrt t)) (+ (sqrt y) (sqrt z)))))
(+
(+ (- 1.0 (sqrt x)) (- (sqrt (+ 1.0 y)) (sqrt y)))
(/ 1.0 (+ (sqrt (+ 1.0 z)) (sqrt z))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (t <= 18500000000.0) {
tmp = 3.0 + ((sqrt((1.0 + t)) + (z * 0.5)) - ((sqrt(x) + sqrt(t)) + (sqrt(y) + sqrt(z))));
} else {
tmp = ((1.0 - sqrt(x)) + (sqrt((1.0 + y)) - sqrt(y))) + (1.0 / (sqrt((1.0 + z)) + 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) :: tmp
if (t <= 18500000000.0d0) then
tmp = 3.0d0 + ((sqrt((1.0d0 + t)) + (z * 0.5d0)) - ((sqrt(x) + sqrt(t)) + (sqrt(y) + sqrt(z))))
else
tmp = ((1.0d0 - sqrt(x)) + (sqrt((1.0d0 + y)) - sqrt(y))) + (1.0d0 / (sqrt((1.0d0 + z)) + 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 tmp;
if (t <= 18500000000.0) {
tmp = 3.0 + ((Math.sqrt((1.0 + t)) + (z * 0.5)) - ((Math.sqrt(x) + Math.sqrt(t)) + (Math.sqrt(y) + Math.sqrt(z))));
} else {
tmp = ((1.0 - Math.sqrt(x)) + (Math.sqrt((1.0 + y)) - Math.sqrt(y))) + (1.0 / (Math.sqrt((1.0 + z)) + Math.sqrt(z)));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if t <= 18500000000.0: tmp = 3.0 + ((math.sqrt((1.0 + t)) + (z * 0.5)) - ((math.sqrt(x) + math.sqrt(t)) + (math.sqrt(y) + math.sqrt(z)))) else: tmp = ((1.0 - math.sqrt(x)) + (math.sqrt((1.0 + y)) - math.sqrt(y))) + (1.0 / (math.sqrt((1.0 + z)) + math.sqrt(z))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (t <= 18500000000.0) tmp = Float64(3.0 + Float64(Float64(sqrt(Float64(1.0 + t)) + Float64(z * 0.5)) - Float64(Float64(sqrt(x) + sqrt(t)) + Float64(sqrt(y) + sqrt(z))))); else tmp = Float64(Float64(Float64(1.0 - sqrt(x)) + Float64(sqrt(Float64(1.0 + y)) - sqrt(y))) + Float64(1.0 / Float64(sqrt(Float64(1.0 + z)) + sqrt(z)))); 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 (t <= 18500000000.0)
tmp = 3.0 + ((sqrt((1.0 + t)) + (z * 0.5)) - ((sqrt(x) + sqrt(t)) + (sqrt(y) + sqrt(z))));
else
tmp = ((1.0 - sqrt(x)) + (sqrt((1.0 + y)) - sqrt(y))) + (1.0 / (sqrt((1.0 + z)) + 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_] := If[LessEqual[t, 18500000000.0], N[(3.0 + N[(N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] + N[(z * 0.5), $MachinePrecision]), $MachinePrecision] - N[(N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[t], $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq 18500000000:\\
\;\;\;\;3 + \left(\left(\sqrt{1 + t} + z \cdot 0.5\right) - \left(\left(\sqrt{x} + \sqrt{t}\right) + \left(\sqrt{y} + \sqrt{z}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(1 - \sqrt{x}\right) + \left(\sqrt{1 + y} - \sqrt{y}\right)\right) + \frac{1}{\sqrt{1 + z} + \sqrt{z}}\\
\end{array}
\end{array}
if t < 1.85e10Initial program 97.7%
associate-+l+97.7%
sub-neg97.7%
sub-neg97.7%
+-commutative97.7%
+-commutative97.7%
+-commutative97.7%
Simplified97.7%
Taylor expanded in x around 0 54.1%
Taylor expanded in z around 0 27.2%
associate--l+27.2%
Simplified27.2%
Taylor expanded in y around 0 12.9%
associate--l+12.9%
+-commutative12.9%
associate-+r+12.9%
Simplified12.9%
if 1.85e10 < t Initial program 89.4%
associate-+l+89.4%
sub-neg89.4%
sub-neg89.4%
+-commutative89.4%
+-commutative89.4%
+-commutative89.4%
Simplified89.4%
Taylor expanded in x around 0 50.6%
flip--50.8%
div-inv50.8%
add-sqr-sqrt40.7%
add-sqr-sqrt51.1%
associate--l+51.2%
Applied egg-rr51.2%
+-inverses51.2%
metadata-eval51.2%
*-lft-identity51.2%
+-commutative51.2%
Simplified51.2%
Taylor expanded in t around inf 51.2%
+-commutative51.2%
Simplified51.2%
Final simplification31.3%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(if (<= t 18500000000.0)
(+
3.0
(-
(+ (sqrt (+ 1.0 t)) (* z 0.5))
(+ (+ (sqrt x) (sqrt t)) (+ (sqrt y) (sqrt z)))))
(+
(- (sqrt (+ 1.0 z)) (sqrt z))
(+ (/ 1.0 (+ (sqrt y) (sqrt (+ 1.0 y)))) (- 1.0 (sqrt x))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (t <= 18500000000.0) {
tmp = 3.0 + ((sqrt((1.0 + t)) + (z * 0.5)) - ((sqrt(x) + sqrt(t)) + (sqrt(y) + sqrt(z))));
} else {
tmp = (sqrt((1.0 + z)) - sqrt(z)) + ((1.0 / (sqrt(y) + sqrt((1.0 + y)))) + (1.0 - sqrt(x)));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (t <= 18500000000.0d0) then
tmp = 3.0d0 + ((sqrt((1.0d0 + t)) + (z * 0.5d0)) - ((sqrt(x) + sqrt(t)) + (sqrt(y) + sqrt(z))))
else
tmp = (sqrt((1.0d0 + z)) - sqrt(z)) + ((1.0d0 / (sqrt(y) + sqrt((1.0d0 + y)))) + (1.0d0 - sqrt(x)))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (t <= 18500000000.0) {
tmp = 3.0 + ((Math.sqrt((1.0 + t)) + (z * 0.5)) - ((Math.sqrt(x) + Math.sqrt(t)) + (Math.sqrt(y) + Math.sqrt(z))));
} else {
tmp = (Math.sqrt((1.0 + z)) - Math.sqrt(z)) + ((1.0 / (Math.sqrt(y) + Math.sqrt((1.0 + y)))) + (1.0 - Math.sqrt(x)));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if t <= 18500000000.0: tmp = 3.0 + ((math.sqrt((1.0 + t)) + (z * 0.5)) - ((math.sqrt(x) + math.sqrt(t)) + (math.sqrt(y) + math.sqrt(z)))) else: tmp = (math.sqrt((1.0 + z)) - math.sqrt(z)) + ((1.0 / (math.sqrt(y) + math.sqrt((1.0 + y)))) + (1.0 - math.sqrt(x))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (t <= 18500000000.0) tmp = Float64(3.0 + Float64(Float64(sqrt(Float64(1.0 + t)) + Float64(z * 0.5)) - Float64(Float64(sqrt(x) + sqrt(t)) + Float64(sqrt(y) + sqrt(z))))); else tmp = Float64(Float64(sqrt(Float64(1.0 + z)) - sqrt(z)) + Float64(Float64(1.0 / Float64(sqrt(y) + sqrt(Float64(1.0 + y)))) + Float64(1.0 - sqrt(x)))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (t <= 18500000000.0)
tmp = 3.0 + ((sqrt((1.0 + t)) + (z * 0.5)) - ((sqrt(x) + sqrt(t)) + (sqrt(y) + sqrt(z))));
else
tmp = (sqrt((1.0 + z)) - sqrt(z)) + ((1.0 / (sqrt(y) + sqrt((1.0 + y)))) + (1.0 - sqrt(x)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[t, 18500000000.0], N[(3.0 + N[(N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] + N[(z * 0.5), $MachinePrecision]), $MachinePrecision] - N[(N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[t], $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 / N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq 18500000000:\\
\;\;\;\;3 + \left(\left(\sqrt{1 + t} + z \cdot 0.5\right) - \left(\left(\sqrt{x} + \sqrt{t}\right) + \left(\sqrt{y} + \sqrt{z}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\frac{1}{\sqrt{y} + \sqrt{1 + y}} + \left(1 - \sqrt{x}\right)\right)\\
\end{array}
\end{array}
if t < 1.85e10Initial program 97.7%
associate-+l+97.7%
sub-neg97.7%
sub-neg97.7%
+-commutative97.7%
+-commutative97.7%
+-commutative97.7%
Simplified97.7%
Taylor expanded in x around 0 54.1%
Taylor expanded in z around 0 27.2%
associate--l+27.2%
Simplified27.2%
Taylor expanded in y around 0 12.9%
associate--l+12.9%
+-commutative12.9%
associate-+r+12.9%
Simplified12.9%
if 1.85e10 < t Initial program 89.4%
associate-+l+89.4%
sub-neg89.4%
sub-neg89.4%
+-commutative89.4%
+-commutative89.4%
+-commutative89.4%
Simplified89.4%
Taylor expanded in x around 0 50.6%
Taylor expanded in t around inf 50.6%
flip--93.3%
div-inv93.3%
add-sqr-sqrt69.8%
add-sqr-sqrt93.4%
associate--l+95.9%
Applied egg-rr51.0%
+-inverses95.9%
metadata-eval95.9%
*-lft-identity95.9%
+-commutative95.9%
Simplified51.0%
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 (<= z 2.5e-34)
(+ 3.0 (- (+ (sqrt (+ 1.0 t)) (* z 0.5)) (sqrt t)))
(+
(- (sqrt (+ 1.0 z)) (sqrt z))
(+ (- 1.0 (sqrt x)) (- (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 <= 2.5e-34) {
tmp = 3.0 + ((sqrt((1.0 + t)) + (z * 0.5)) - sqrt(t));
} else {
tmp = (sqrt((1.0 + z)) - sqrt(z)) + ((1.0 - sqrt(x)) + (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 <= 2.5d-34) then
tmp = 3.0d0 + ((sqrt((1.0d0 + t)) + (z * 0.5d0)) - sqrt(t))
else
tmp = (sqrt((1.0d0 + z)) - sqrt(z)) + ((1.0d0 - sqrt(x)) + (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 <= 2.5e-34) {
tmp = 3.0 + ((Math.sqrt((1.0 + t)) + (z * 0.5)) - Math.sqrt(t));
} else {
tmp = (Math.sqrt((1.0 + z)) - Math.sqrt(z)) + ((1.0 - Math.sqrt(x)) + (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 <= 2.5e-34: tmp = 3.0 + ((math.sqrt((1.0 + t)) + (z * 0.5)) - math.sqrt(t)) else: tmp = (math.sqrt((1.0 + z)) - math.sqrt(z)) + ((1.0 - math.sqrt(x)) + (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 <= 2.5e-34) tmp = Float64(3.0 + Float64(Float64(sqrt(Float64(1.0 + t)) + Float64(z * 0.5)) - sqrt(t))); else tmp = Float64(Float64(sqrt(Float64(1.0 + z)) - sqrt(z)) + Float64(Float64(1.0 - sqrt(x)) + 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 <= 2.5e-34)
tmp = 3.0 + ((sqrt((1.0 + t)) + (z * 0.5)) - sqrt(t));
else
tmp = (sqrt((1.0 + z)) - sqrt(z)) + ((1.0 - sqrt(x)) + (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, 2.5e-34], N[(3.0 + N[(N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] + N[(z * 0.5), $MachinePrecision]), $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq 2.5 \cdot 10^{-34}:\\
\;\;\;\;3 + \left(\left(\sqrt{1 + t} + z \cdot 0.5\right) - \sqrt{t}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\left(1 - \sqrt{x}\right) + \left(\sqrt{1 + y} - \sqrt{y}\right)\right)\\
\end{array}
\end{array}
if z < 2.5000000000000001e-34Initial program 97.8%
associate-+l+97.8%
sub-neg97.8%
sub-neg97.8%
+-commutative97.8%
+-commutative97.8%
+-commutative97.8%
Simplified97.8%
Taylor expanded in x around 0 50.1%
Taylor expanded in z around 0 50.1%
associate--l+50.1%
Simplified50.1%
Taylor expanded in y around 0 14.1%
associate--l+26.5%
+-commutative26.5%
associate-+r+26.5%
Simplified26.5%
Taylor expanded in t around inf 37.0%
if 2.5000000000000001e-34 < z Initial program 90.3%
associate-+l+90.3%
sub-neg90.3%
sub-neg90.3%
+-commutative90.3%
+-commutative90.3%
+-commutative90.3%
Simplified90.3%
Taylor expanded in x around 0 54.3%
Taylor expanded in t around inf 29.8%
Final simplification33.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 (<= z 1.05e-32)
(+ 3.0 (- (+ (sqrt (+ 1.0 t)) (* z 0.5)) (sqrt t)))
(if (<= z 660000000.0)
(+
(/ 1.0 (+ (sqrt (+ 1.0 z)) (sqrt z)))
(+ 2.0 (- (* y 0.5) (+ (sqrt x) (sqrt y)))))
(+
(+ (- 1.0 (sqrt x)) (- (sqrt (+ 1.0 y)) (sqrt y)))
(* 0.5 (sqrt (/ 1.0 z)))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (z <= 1.05e-32) {
tmp = 3.0 + ((sqrt((1.0 + t)) + (z * 0.5)) - sqrt(t));
} else if (z <= 660000000.0) {
tmp = (1.0 / (sqrt((1.0 + z)) + sqrt(z))) + (2.0 + ((y * 0.5) - (sqrt(x) + sqrt(y))));
} else {
tmp = ((1.0 - sqrt(x)) + (sqrt((1.0 + y)) - sqrt(y))) + (0.5 * sqrt((1.0 / 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) :: tmp
if (z <= 1.05d-32) then
tmp = 3.0d0 + ((sqrt((1.0d0 + t)) + (z * 0.5d0)) - sqrt(t))
else if (z <= 660000000.0d0) then
tmp = (1.0d0 / (sqrt((1.0d0 + z)) + sqrt(z))) + (2.0d0 + ((y * 0.5d0) - (sqrt(x) + sqrt(y))))
else
tmp = ((1.0d0 - sqrt(x)) + (sqrt((1.0d0 + y)) - sqrt(y))) + (0.5d0 * sqrt((1.0d0 / 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 tmp;
if (z <= 1.05e-32) {
tmp = 3.0 + ((Math.sqrt((1.0 + t)) + (z * 0.5)) - Math.sqrt(t));
} else if (z <= 660000000.0) {
tmp = (1.0 / (Math.sqrt((1.0 + z)) + Math.sqrt(z))) + (2.0 + ((y * 0.5) - (Math.sqrt(x) + Math.sqrt(y))));
} else {
tmp = ((1.0 - Math.sqrt(x)) + (Math.sqrt((1.0 + y)) - Math.sqrt(y))) + (0.5 * Math.sqrt((1.0 / z)));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if z <= 1.05e-32: tmp = 3.0 + ((math.sqrt((1.0 + t)) + (z * 0.5)) - math.sqrt(t)) elif z <= 660000000.0: tmp = (1.0 / (math.sqrt((1.0 + z)) + math.sqrt(z))) + (2.0 + ((y * 0.5) - (math.sqrt(x) + math.sqrt(y)))) else: tmp = ((1.0 - math.sqrt(x)) + (math.sqrt((1.0 + y)) - math.sqrt(y))) + (0.5 * math.sqrt((1.0 / z))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (z <= 1.05e-32) tmp = Float64(3.0 + Float64(Float64(sqrt(Float64(1.0 + t)) + Float64(z * 0.5)) - sqrt(t))); elseif (z <= 660000000.0) tmp = Float64(Float64(1.0 / Float64(sqrt(Float64(1.0 + z)) + sqrt(z))) + Float64(2.0 + Float64(Float64(y * 0.5) - Float64(sqrt(x) + sqrt(y))))); else tmp = Float64(Float64(Float64(1.0 - sqrt(x)) + Float64(sqrt(Float64(1.0 + y)) - sqrt(y))) + Float64(0.5 * sqrt(Float64(1.0 / z)))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (z <= 1.05e-32)
tmp = 3.0 + ((sqrt((1.0 + t)) + (z * 0.5)) - sqrt(t));
elseif (z <= 660000000.0)
tmp = (1.0 / (sqrt((1.0 + z)) + sqrt(z))) + (2.0 + ((y * 0.5) - (sqrt(x) + sqrt(y))));
else
tmp = ((1.0 - sqrt(x)) + (sqrt((1.0 + y)) - sqrt(y))) + (0.5 * sqrt((1.0 / 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_] := If[LessEqual[z, 1.05e-32], N[(3.0 + N[(N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] + N[(z * 0.5), $MachinePrecision]), $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 660000000.0], N[(N[(1.0 / N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(2.0 + N[(N[(y * 0.5), $MachinePrecision] - N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(0.5 * N[Sqrt[N[(1.0 / z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq 1.05 \cdot 10^{-32}:\\
\;\;\;\;3 + \left(\left(\sqrt{1 + t} + z \cdot 0.5\right) - \sqrt{t}\right)\\
\mathbf{elif}\;z \leq 660000000:\\
\;\;\;\;\frac{1}{\sqrt{1 + z} + \sqrt{z}} + \left(2 + \left(y \cdot 0.5 - \left(\sqrt{x} + \sqrt{y}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(1 - \sqrt{x}\right) + \left(\sqrt{1 + y} - \sqrt{y}\right)\right) + 0.5 \cdot \sqrt{\frac{1}{z}}\\
\end{array}
\end{array}
if z < 1.05e-32Initial program 97.8%
associate-+l+97.8%
sub-neg97.8%
sub-neg97.8%
+-commutative97.8%
+-commutative97.8%
+-commutative97.8%
Simplified97.8%
Taylor expanded in x around 0 50.1%
Taylor expanded in z around 0 50.1%
associate--l+50.1%
Simplified50.1%
Taylor expanded in y around 0 14.1%
associate--l+26.5%
+-commutative26.5%
associate-+r+26.5%
Simplified26.5%
Taylor expanded in t around inf 37.0%
if 1.05e-32 < z < 6.6e8Initial program 94.4%
associate-+l+94.4%
sub-neg94.4%
sub-neg94.4%
+-commutative94.4%
+-commutative94.4%
+-commutative94.4%
Simplified94.4%
Taylor expanded in x around 0 54.8%
Taylor expanded in t around inf 20.2%
Taylor expanded in y around 0 16.0%
associate--l+16.0%
*-commutative16.0%
+-commutative16.0%
Simplified16.0%
flip--55.1%
div-inv55.0%
add-sqr-sqrt54.3%
add-sqr-sqrt55.3%
associate--l+55.2%
Applied egg-rr16.0%
+-inverses55.2%
metadata-eval55.2%
*-lft-identity55.2%
+-commutative55.2%
Simplified16.0%
if 6.6e8 < z Initial program 89.7%
associate-+l+89.7%
sub-neg89.7%
sub-neg89.7%
+-commutative89.7%
+-commutative89.7%
+-commutative89.7%
Simplified89.7%
Taylor expanded in x around 0 54.3%
Taylor expanded in t around inf 31.2%
Taylor expanded in z around inf 31.8%
Final simplification33.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 (<= z 1.05e-32)
(+ 3.0 (- (+ (sqrt (+ 1.0 t)) (* z 0.5)) (sqrt t)))
(if (<= z 180000.0)
(- (+ (sqrt (+ 1.0 z)) 2.0) (+ (sqrt x) (+ (sqrt y) (sqrt z))))
(+
(+ (- 1.0 (sqrt x)) (- (sqrt (+ 1.0 y)) (sqrt y)))
(* 0.5 (sqrt (/ 1.0 z)))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (z <= 1.05e-32) {
tmp = 3.0 + ((sqrt((1.0 + t)) + (z * 0.5)) - sqrt(t));
} else if (z <= 180000.0) {
tmp = (sqrt((1.0 + z)) + 2.0) - (sqrt(x) + (sqrt(y) + sqrt(z)));
} else {
tmp = ((1.0 - sqrt(x)) + (sqrt((1.0 + y)) - sqrt(y))) + (0.5 * sqrt((1.0 / 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) :: tmp
if (z <= 1.05d-32) then
tmp = 3.0d0 + ((sqrt((1.0d0 + t)) + (z * 0.5d0)) - sqrt(t))
else if (z <= 180000.0d0) then
tmp = (sqrt((1.0d0 + z)) + 2.0d0) - (sqrt(x) + (sqrt(y) + sqrt(z)))
else
tmp = ((1.0d0 - sqrt(x)) + (sqrt((1.0d0 + y)) - sqrt(y))) + (0.5d0 * sqrt((1.0d0 / 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 tmp;
if (z <= 1.05e-32) {
tmp = 3.0 + ((Math.sqrt((1.0 + t)) + (z * 0.5)) - Math.sqrt(t));
} else if (z <= 180000.0) {
tmp = (Math.sqrt((1.0 + z)) + 2.0) - (Math.sqrt(x) + (Math.sqrt(y) + Math.sqrt(z)));
} else {
tmp = ((1.0 - Math.sqrt(x)) + (Math.sqrt((1.0 + y)) - Math.sqrt(y))) + (0.5 * Math.sqrt((1.0 / z)));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if z <= 1.05e-32: tmp = 3.0 + ((math.sqrt((1.0 + t)) + (z * 0.5)) - math.sqrt(t)) elif z <= 180000.0: tmp = (math.sqrt((1.0 + z)) + 2.0) - (math.sqrt(x) + (math.sqrt(y) + math.sqrt(z))) else: tmp = ((1.0 - math.sqrt(x)) + (math.sqrt((1.0 + y)) - math.sqrt(y))) + (0.5 * math.sqrt((1.0 / z))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (z <= 1.05e-32) tmp = Float64(3.0 + Float64(Float64(sqrt(Float64(1.0 + t)) + Float64(z * 0.5)) - sqrt(t))); elseif (z <= 180000.0) tmp = Float64(Float64(sqrt(Float64(1.0 + z)) + 2.0) - Float64(sqrt(x) + Float64(sqrt(y) + sqrt(z)))); else tmp = Float64(Float64(Float64(1.0 - sqrt(x)) + Float64(sqrt(Float64(1.0 + y)) - sqrt(y))) + Float64(0.5 * sqrt(Float64(1.0 / z)))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (z <= 1.05e-32)
tmp = 3.0 + ((sqrt((1.0 + t)) + (z * 0.5)) - sqrt(t));
elseif (z <= 180000.0)
tmp = (sqrt((1.0 + z)) + 2.0) - (sqrt(x) + (sqrt(y) + sqrt(z)));
else
tmp = ((1.0 - sqrt(x)) + (sqrt((1.0 + y)) - sqrt(y))) + (0.5 * sqrt((1.0 / 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_] := If[LessEqual[z, 1.05e-32], N[(3.0 + N[(N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] + N[(z * 0.5), $MachinePrecision]), $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 180000.0], N[(N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] + 2.0), $MachinePrecision] - N[(N[Sqrt[x], $MachinePrecision] + N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(0.5 * N[Sqrt[N[(1.0 / z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq 1.05 \cdot 10^{-32}:\\
\;\;\;\;3 + \left(\left(\sqrt{1 + t} + z \cdot 0.5\right) - \sqrt{t}\right)\\
\mathbf{elif}\;z \leq 180000:\\
\;\;\;\;\left(\sqrt{1 + z} + 2\right) - \left(\sqrt{x} + \left(\sqrt{y} + \sqrt{z}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(1 - \sqrt{x}\right) + \left(\sqrt{1 + y} - \sqrt{y}\right)\right) + 0.5 \cdot \sqrt{\frac{1}{z}}\\
\end{array}
\end{array}
if z < 1.05e-32Initial program 97.8%
associate-+l+97.8%
sub-neg97.8%
sub-neg97.8%
+-commutative97.8%
+-commutative97.8%
+-commutative97.8%
Simplified97.8%
Taylor expanded in x around 0 50.1%
Taylor expanded in z around 0 50.1%
associate--l+50.1%
Simplified50.1%
Taylor expanded in y around 0 14.1%
associate--l+26.5%
+-commutative26.5%
associate-+r+26.5%
Simplified26.5%
Taylor expanded in t around inf 37.0%
if 1.05e-32 < z < 1.8e5Initial program 96.6%
associate-+l+96.6%
sub-neg96.6%
sub-neg96.6%
+-commutative96.6%
+-commutative96.6%
+-commutative96.6%
Simplified96.6%
Taylor expanded in x around 0 55.7%
Taylor expanded in t around inf 21.4%
Taylor expanded in y around 0 14.4%
if 1.8e5 < z Initial program 89.4%
associate-+l+89.4%
sub-neg89.4%
sub-neg89.4%
+-commutative89.4%
+-commutative89.4%
+-commutative89.4%
Simplified89.4%
Taylor expanded in x around 0 54.2%
Taylor expanded in t around inf 30.8%
Taylor expanded in z around inf 31.5%
Final simplification32.9%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (sqrt (+ 1.0 z)) (sqrt z))))
(if (<= y 4e-6)
(+ t_1 (+ 2.0 (- (* y 0.5) (sqrt y))))
(if (<= y 1.35e+14)
(*
x
(+
(/ (sqrt (+ 1.0 y)) x)
(- (/ 1.0 x) (+ (sqrt (/ 1.0 x)) (/ (sqrt y) x)))))
(+ (/ 1.0 (+ (sqrt x) (sqrt (+ 1.0 x)))) t_1)))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + z)) - sqrt(z);
double tmp;
if (y <= 4e-6) {
tmp = t_1 + (2.0 + ((y * 0.5) - sqrt(y)));
} else if (y <= 1.35e+14) {
tmp = x * ((sqrt((1.0 + y)) / x) + ((1.0 / x) - (sqrt((1.0 / x)) + (sqrt(y) / x))));
} else {
tmp = (1.0 / (sqrt(x) + sqrt((1.0 + x)))) + t_1;
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = sqrt((1.0d0 + z)) - sqrt(z)
if (y <= 4d-6) then
tmp = t_1 + (2.0d0 + ((y * 0.5d0) - sqrt(y)))
else if (y <= 1.35d+14) then
tmp = x * ((sqrt((1.0d0 + y)) / x) + ((1.0d0 / x) - (sqrt((1.0d0 / x)) + (sqrt(y) / x))))
else
tmp = (1.0d0 / (sqrt(x) + sqrt((1.0d0 + x)))) + t_1
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + z)) - Math.sqrt(z);
double tmp;
if (y <= 4e-6) {
tmp = t_1 + (2.0 + ((y * 0.5) - Math.sqrt(y)));
} else if (y <= 1.35e+14) {
tmp = x * ((Math.sqrt((1.0 + y)) / x) + ((1.0 / x) - (Math.sqrt((1.0 / x)) + (Math.sqrt(y) / x))));
} else {
tmp = (1.0 / (Math.sqrt(x) + Math.sqrt((1.0 + x)))) + t_1;
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + z)) - math.sqrt(z) tmp = 0 if y <= 4e-6: tmp = t_1 + (2.0 + ((y * 0.5) - math.sqrt(y))) elif y <= 1.35e+14: tmp = x * ((math.sqrt((1.0 + y)) / x) + ((1.0 / x) - (math.sqrt((1.0 / x)) + (math.sqrt(y) / x)))) else: tmp = (1.0 / (math.sqrt(x) + math.sqrt((1.0 + x)))) + t_1 return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = Float64(sqrt(Float64(1.0 + z)) - sqrt(z)) tmp = 0.0 if (y <= 4e-6) tmp = Float64(t_1 + Float64(2.0 + Float64(Float64(y * 0.5) - sqrt(y)))); elseif (y <= 1.35e+14) tmp = Float64(x * Float64(Float64(sqrt(Float64(1.0 + y)) / x) + Float64(Float64(1.0 / x) - Float64(sqrt(Float64(1.0 / x)) + Float64(sqrt(y) / x))))); else tmp = Float64(Float64(1.0 / Float64(sqrt(x) + sqrt(Float64(1.0 + x)))) + t_1); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + z)) - sqrt(z);
tmp = 0.0;
if (y <= 4e-6)
tmp = t_1 + (2.0 + ((y * 0.5) - sqrt(y)));
elseif (y <= 1.35e+14)
tmp = x * ((sqrt((1.0 + y)) / x) + ((1.0 / x) - (sqrt((1.0 / x)) + (sqrt(y) / x))));
else
tmp = (1.0 / (sqrt(x) + sqrt((1.0 + x)))) + t_1;
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 4e-6], N[(t$95$1 + N[(2.0 + N[(N[(y * 0.5), $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.35e+14], N[(x * N[(N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] / x), $MachinePrecision] + N[(N[(1.0 / x), $MachinePrecision] - N[(N[Sqrt[N[(1.0 / x), $MachinePrecision]], $MachinePrecision] + N[(N[Sqrt[y], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + z} - \sqrt{z}\\
\mathbf{if}\;y \leq 4 \cdot 10^{-6}:\\
\;\;\;\;t\_1 + \left(2 + \left(y \cdot 0.5 - \sqrt{y}\right)\right)\\
\mathbf{elif}\;y \leq 1.35 \cdot 10^{+14}:\\
\;\;\;\;x \cdot \left(\frac{\sqrt{1 + y}}{x} + \left(\frac{1}{x} - \left(\sqrt{\frac{1}{x}} + \frac{\sqrt{y}}{x}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{x} + \sqrt{1 + x}} + t\_1\\
\end{array}
\end{array}
if y < 3.99999999999999982e-6Initial program 98.2%
associate-+l+98.2%
sub-neg98.2%
sub-neg98.2%
+-commutative98.2%
+-commutative98.2%
+-commutative98.2%
Simplified98.2%
Taylor expanded in x around 0 50.0%
Taylor expanded in t around inf 29.0%
Taylor expanded in y around 0 29.0%
associate--l+29.0%
*-commutative29.0%
+-commutative29.0%
Simplified29.0%
Taylor expanded in y around inf 56.4%
if 3.99999999999999982e-6 < y < 1.35e14Initial program 89.1%
associate-+l+89.1%
sub-neg89.1%
sub-neg89.1%
+-commutative89.1%
+-commutative89.1%
+-commutative89.1%
Simplified89.1%
Taylor expanded in x around 0 46.1%
Taylor expanded in t around inf 28.9%
Taylor expanded in x around inf 3.3%
Taylor expanded in z around inf 21.4%
associate--l+21.0%
associate-*l/21.0%
+-commutative21.0%
*-lft-identity21.0%
+-commutative21.0%
associate-*l/21.0%
*-lft-identity21.0%
Simplified21.0%
if 1.35e14 < y Initial program 89.8%
associate-+l+89.8%
sub-neg89.8%
sub-neg89.8%
+-commutative89.8%
+-commutative89.8%
+-commutative89.8%
Simplified89.8%
flip--89.9%
div-inv89.9%
add-sqr-sqrt72.2%
+-commutative72.2%
add-sqr-sqrt90.5%
+-commutative90.5%
Applied egg-rr90.5%
associate--l+93.6%
+-inverses93.6%
metadata-eval93.6%
*-lft-identity93.6%
+-commutative93.6%
Simplified93.6%
flip--93.6%
div-inv93.6%
add-sqr-sqrt47.6%
add-sqr-sqrt93.6%
associate--l+96.2%
Applied egg-rr96.2%
+-inverses96.2%
metadata-eval96.2%
*-lft-identity96.2%
+-commutative96.2%
Simplified96.2%
Taylor expanded in t around inf 55.3%
Taylor expanded in y around inf 52.8%
Final simplification53.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 (<= z 2e-33)
(+ 3.0 (- (+ (sqrt (+ 1.0 t)) (* z 0.5)) (sqrt t)))
(if (<= z 4.5)
(+ 3.0 (* z (- 0.5 (sqrt (/ 1.0 z)))))
(if (or (<= z 1.2e+122) (and (not (<= z 2.3e+144)) (<= z 5.4e+180)))
(+ 2.0 (- (* y 0.5) (+ (sqrt x) (sqrt y))))
(+ 1.0 (- (sqrt (+ 1.0 z)) (+ (sqrt x) (sqrt z))))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (z <= 2e-33) {
tmp = 3.0 + ((sqrt((1.0 + t)) + (z * 0.5)) - sqrt(t));
} else if (z <= 4.5) {
tmp = 3.0 + (z * (0.5 - sqrt((1.0 / z))));
} else if ((z <= 1.2e+122) || (!(z <= 2.3e+144) && (z <= 5.4e+180))) {
tmp = 2.0 + ((y * 0.5) - (sqrt(x) + sqrt(y)));
} else {
tmp = 1.0 + (sqrt((1.0 + z)) - (sqrt(x) + 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) :: tmp
if (z <= 2d-33) then
tmp = 3.0d0 + ((sqrt((1.0d0 + t)) + (z * 0.5d0)) - sqrt(t))
else if (z <= 4.5d0) then
tmp = 3.0d0 + (z * (0.5d0 - sqrt((1.0d0 / z))))
else if ((z <= 1.2d+122) .or. (.not. (z <= 2.3d+144)) .and. (z <= 5.4d+180)) then
tmp = 2.0d0 + ((y * 0.5d0) - (sqrt(x) + sqrt(y)))
else
tmp = 1.0d0 + (sqrt((1.0d0 + z)) - (sqrt(x) + 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 tmp;
if (z <= 2e-33) {
tmp = 3.0 + ((Math.sqrt((1.0 + t)) + (z * 0.5)) - Math.sqrt(t));
} else if (z <= 4.5) {
tmp = 3.0 + (z * (0.5 - Math.sqrt((1.0 / z))));
} else if ((z <= 1.2e+122) || (!(z <= 2.3e+144) && (z <= 5.4e+180))) {
tmp = 2.0 + ((y * 0.5) - (Math.sqrt(x) + Math.sqrt(y)));
} else {
tmp = 1.0 + (Math.sqrt((1.0 + z)) - (Math.sqrt(x) + Math.sqrt(z)));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if z <= 2e-33: tmp = 3.0 + ((math.sqrt((1.0 + t)) + (z * 0.5)) - math.sqrt(t)) elif z <= 4.5: tmp = 3.0 + (z * (0.5 - math.sqrt((1.0 / z)))) elif (z <= 1.2e+122) or (not (z <= 2.3e+144) and (z <= 5.4e+180)): tmp = 2.0 + ((y * 0.5) - (math.sqrt(x) + math.sqrt(y))) else: tmp = 1.0 + (math.sqrt((1.0 + z)) - (math.sqrt(x) + math.sqrt(z))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (z <= 2e-33) tmp = Float64(3.0 + Float64(Float64(sqrt(Float64(1.0 + t)) + Float64(z * 0.5)) - sqrt(t))); elseif (z <= 4.5) tmp = Float64(3.0 + Float64(z * Float64(0.5 - sqrt(Float64(1.0 / z))))); elseif ((z <= 1.2e+122) || (!(z <= 2.3e+144) && (z <= 5.4e+180))) tmp = Float64(2.0 + Float64(Float64(y * 0.5) - Float64(sqrt(x) + sqrt(y)))); else tmp = Float64(1.0 + Float64(sqrt(Float64(1.0 + z)) - Float64(sqrt(x) + sqrt(z)))); 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 <= 2e-33)
tmp = 3.0 + ((sqrt((1.0 + t)) + (z * 0.5)) - sqrt(t));
elseif (z <= 4.5)
tmp = 3.0 + (z * (0.5 - sqrt((1.0 / z))));
elseif ((z <= 1.2e+122) || (~((z <= 2.3e+144)) && (z <= 5.4e+180)))
tmp = 2.0 + ((y * 0.5) - (sqrt(x) + sqrt(y)));
else
tmp = 1.0 + (sqrt((1.0 + z)) - (sqrt(x) + 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_] := If[LessEqual[z, 2e-33], N[(3.0 + N[(N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] + N[(z * 0.5), $MachinePrecision]), $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 4.5], N[(3.0 + N[(z * N[(0.5 - N[Sqrt[N[(1.0 / z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[z, 1.2e+122], And[N[Not[LessEqual[z, 2.3e+144]], $MachinePrecision], LessEqual[z, 5.4e+180]]], N[(2.0 + N[(N[(y * 0.5), $MachinePrecision] - N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq 2 \cdot 10^{-33}:\\
\;\;\;\;3 + \left(\left(\sqrt{1 + t} + z \cdot 0.5\right) - \sqrt{t}\right)\\
\mathbf{elif}\;z \leq 4.5:\\
\;\;\;\;3 + z \cdot \left(0.5 - \sqrt{\frac{1}{z}}\right)\\
\mathbf{elif}\;z \leq 1.2 \cdot 10^{+122} \lor \neg \left(z \leq 2.3 \cdot 10^{+144}\right) \land z \leq 5.4 \cdot 10^{+180}:\\
\;\;\;\;2 + \left(y \cdot 0.5 - \left(\sqrt{x} + \sqrt{y}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;1 + \left(\sqrt{1 + z} - \left(\sqrt{x} + \sqrt{z}\right)\right)\\
\end{array}
\end{array}
if z < 2.0000000000000001e-33Initial program 97.8%
associate-+l+97.8%
sub-neg97.8%
sub-neg97.8%
+-commutative97.8%
+-commutative97.8%
+-commutative97.8%
Simplified97.8%
Taylor expanded in x around 0 50.1%
Taylor expanded in z around 0 50.1%
associate--l+50.1%
Simplified50.1%
Taylor expanded in y around 0 14.1%
associate--l+26.5%
+-commutative26.5%
associate-+r+26.5%
Simplified26.5%
Taylor expanded in t around inf 37.0%
if 2.0000000000000001e-33 < z < 4.5Initial program 96.3%
associate-+l+96.3%
sub-neg96.3%
sub-neg96.3%
+-commutative96.3%
+-commutative96.3%
+-commutative96.3%
Simplified96.3%
Taylor expanded in x around 0 49.5%
Taylor expanded in z around 0 41.9%
associate--l+41.9%
Simplified41.9%
Taylor expanded in y around 0 6.3%
associate--l+11.7%
+-commutative11.7%
associate-+r+11.7%
Simplified11.7%
Taylor expanded in z around inf 55.0%
if 4.5 < z < 1.2000000000000001e122 or 2.3000000000000001e144 < z < 5.40000000000000033e180Initial program 90.1%
associate-+l+90.1%
sub-neg90.1%
sub-neg90.1%
+-commutative90.1%
+-commutative90.1%
+-commutative90.1%
Simplified90.1%
Taylor expanded in x around 0 52.2%
Taylor expanded in t around inf 29.0%
Taylor expanded in y around 0 13.4%
associate--l+13.4%
*-commutative13.4%
+-commutative13.4%
Simplified13.4%
Taylor expanded in z around inf 13.2%
associate--l+13.2%
+-commutative13.2%
*-commutative13.2%
Simplified13.2%
if 1.2000000000000001e122 < z < 2.3000000000000001e144 or 5.40000000000000033e180 < z Initial program 89.0%
associate-+l+89.0%
sub-neg89.0%
sub-neg89.0%
+-commutative89.0%
+-commutative89.0%
+-commutative89.0%
Simplified89.0%
Taylor expanded in x around 0 57.8%
Taylor expanded in t around inf 32.4%
Taylor expanded in y around inf 2.9%
associate--l+32.8%
Simplified32.8%
Final simplification30.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 x) (sqrt y))))
(if (<= z 1.05e-32)
(+ 3.0 (- (+ (sqrt (+ 1.0 t)) (* z 0.5)) (sqrt t)))
(if (<= z 1.92)
(+ 3.0 (- (* z 0.5) (+ (sqrt z) t_1)))
(if (or (<= z 3.2e+122) (and (not (<= z 2.3e+144)) (<= z 6.5e+180)))
(+ 2.0 (- (* y 0.5) t_1))
(+ 1.0 (- (sqrt (+ 1.0 z)) (+ (sqrt x) (sqrt z)))))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt(x) + sqrt(y);
double tmp;
if (z <= 1.05e-32) {
tmp = 3.0 + ((sqrt((1.0 + t)) + (z * 0.5)) - sqrt(t));
} else if (z <= 1.92) {
tmp = 3.0 + ((z * 0.5) - (sqrt(z) + t_1));
} else if ((z <= 3.2e+122) || (!(z <= 2.3e+144) && (z <= 6.5e+180))) {
tmp = 2.0 + ((y * 0.5) - t_1);
} else {
tmp = 1.0 + (sqrt((1.0 + z)) - (sqrt(x) + sqrt(z)));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = sqrt(x) + sqrt(y)
if (z <= 1.05d-32) then
tmp = 3.0d0 + ((sqrt((1.0d0 + t)) + (z * 0.5d0)) - sqrt(t))
else if (z <= 1.92d0) then
tmp = 3.0d0 + ((z * 0.5d0) - (sqrt(z) + t_1))
else if ((z <= 3.2d+122) .or. (.not. (z <= 2.3d+144)) .and. (z <= 6.5d+180)) then
tmp = 2.0d0 + ((y * 0.5d0) - t_1)
else
tmp = 1.0d0 + (sqrt((1.0d0 + z)) - (sqrt(x) + 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(x) + Math.sqrt(y);
double tmp;
if (z <= 1.05e-32) {
tmp = 3.0 + ((Math.sqrt((1.0 + t)) + (z * 0.5)) - Math.sqrt(t));
} else if (z <= 1.92) {
tmp = 3.0 + ((z * 0.5) - (Math.sqrt(z) + t_1));
} else if ((z <= 3.2e+122) || (!(z <= 2.3e+144) && (z <= 6.5e+180))) {
tmp = 2.0 + ((y * 0.5) - t_1);
} else {
tmp = 1.0 + (Math.sqrt((1.0 + z)) - (Math.sqrt(x) + Math.sqrt(z)));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt(x) + math.sqrt(y) tmp = 0 if z <= 1.05e-32: tmp = 3.0 + ((math.sqrt((1.0 + t)) + (z * 0.5)) - math.sqrt(t)) elif z <= 1.92: tmp = 3.0 + ((z * 0.5) - (math.sqrt(z) + t_1)) elif (z <= 3.2e+122) or (not (z <= 2.3e+144) and (z <= 6.5e+180)): tmp = 2.0 + ((y * 0.5) - t_1) else: tmp = 1.0 + (math.sqrt((1.0 + z)) - (math.sqrt(x) + math.sqrt(z))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = Float64(sqrt(x) + sqrt(y)) tmp = 0.0 if (z <= 1.05e-32) tmp = Float64(3.0 + Float64(Float64(sqrt(Float64(1.0 + t)) + Float64(z * 0.5)) - sqrt(t))); elseif (z <= 1.92) tmp = Float64(3.0 + Float64(Float64(z * 0.5) - Float64(sqrt(z) + t_1))); elseif ((z <= 3.2e+122) || (!(z <= 2.3e+144) && (z <= 6.5e+180))) tmp = Float64(2.0 + Float64(Float64(y * 0.5) - t_1)); else tmp = Float64(1.0 + Float64(sqrt(Float64(1.0 + z)) - Float64(sqrt(x) + 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(x) + sqrt(y);
tmp = 0.0;
if (z <= 1.05e-32)
tmp = 3.0 + ((sqrt((1.0 + t)) + (z * 0.5)) - sqrt(t));
elseif (z <= 1.92)
tmp = 3.0 + ((z * 0.5) - (sqrt(z) + t_1));
elseif ((z <= 3.2e+122) || (~((z <= 2.3e+144)) && (z <= 6.5e+180)))
tmp = 2.0 + ((y * 0.5) - t_1);
else
tmp = 1.0 + (sqrt((1.0 + z)) - (sqrt(x) + 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[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, 1.05e-32], N[(3.0 + N[(N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] + N[(z * 0.5), $MachinePrecision]), $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.92], N[(3.0 + N[(N[(z * 0.5), $MachinePrecision] - N[(N[Sqrt[z], $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[z, 3.2e+122], And[N[Not[LessEqual[z, 2.3e+144]], $MachinePrecision], LessEqual[z, 6.5e+180]]], N[(2.0 + N[(N[(y * 0.5), $MachinePrecision] - t$95$1), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[(N[Sqrt[x], $MachinePrecision] + 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{x} + \sqrt{y}\\
\mathbf{if}\;z \leq 1.05 \cdot 10^{-32}:\\
\;\;\;\;3 + \left(\left(\sqrt{1 + t} + z \cdot 0.5\right) - \sqrt{t}\right)\\
\mathbf{elif}\;z \leq 1.92:\\
\;\;\;\;3 + \left(z \cdot 0.5 - \left(\sqrt{z} + t\_1\right)\right)\\
\mathbf{elif}\;z \leq 3.2 \cdot 10^{+122} \lor \neg \left(z \leq 2.3 \cdot 10^{+144}\right) \land z \leq 6.5 \cdot 10^{+180}:\\
\;\;\;\;2 + \left(y \cdot 0.5 - t\_1\right)\\
\mathbf{else}:\\
\;\;\;\;1 + \left(\sqrt{1 + z} - \left(\sqrt{x} + \sqrt{z}\right)\right)\\
\end{array}
\end{array}
if z < 1.05e-32Initial program 97.8%
associate-+l+97.8%
sub-neg97.8%
sub-neg97.8%
+-commutative97.8%
+-commutative97.8%
+-commutative97.8%
Simplified97.8%
Taylor expanded in x around 0 50.1%
Taylor expanded in z around 0 50.1%
associate--l+50.1%
Simplified50.1%
Taylor expanded in y around 0 14.1%
associate--l+26.5%
+-commutative26.5%
associate-+r+26.5%
Simplified26.5%
Taylor expanded in t around inf 37.0%
if 1.05e-32 < z < 1.9199999999999999Initial program 96.3%
associate-+l+96.3%
sub-neg96.3%
sub-neg96.3%
+-commutative96.3%
+-commutative96.3%
+-commutative96.3%
Simplified96.3%
Taylor expanded in x around 0 49.5%
Taylor expanded in z around 0 41.9%
associate--l+41.9%
Simplified41.9%
Taylor expanded in y around 0 6.3%
associate--l+11.7%
+-commutative11.7%
associate-+r+11.7%
Simplified11.7%
Taylor expanded in t around inf 13.2%
associate-+r+13.2%
+-commutative13.2%
Simplified13.2%
if 1.9199999999999999 < z < 3.20000000000000012e122 or 2.3000000000000001e144 < z < 6.5e180Initial program 90.3%
associate-+l+90.3%
sub-neg90.3%
sub-neg90.3%
+-commutative90.3%
+-commutative90.3%
+-commutative90.3%
Simplified90.3%
Taylor expanded in x around 0 52.9%
Taylor expanded in t around inf 30.1%
Taylor expanded in y around 0 14.7%
associate--l+14.7%
*-commutative14.7%
+-commutative14.7%
Simplified14.7%
Taylor expanded in z around inf 14.5%
associate--l+14.5%
+-commutative14.5%
*-commutative14.5%
Simplified14.5%
if 3.20000000000000012e122 < z < 2.3000000000000001e144 or 6.5e180 < z Initial program 88.8%
associate-+l+88.8%
sub-neg88.8%
sub-neg88.8%
+-commutative88.8%
+-commutative88.8%
+-commutative88.8%
Simplified88.8%
Taylor expanded in x around 0 57.0%
Taylor expanded in t around inf 31.3%
Taylor expanded in y around inf 2.9%
associate--l+33.0%
Simplified33.0%
Final simplification28.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 x) (sqrt y))))
(if (<= z 1.05e-32)
(+ 3.0 (- (+ (sqrt (+ 1.0 t)) (* z 0.5)) (sqrt t)))
(if (<= z 0.74)
(+ 3.0 (- (* z 0.5) (+ (sqrt z) t_1)))
(if (<= z 2.9e+122)
(+ 2.0 (- (* 0.5 (+ y (sqrt (/ 1.0 z)))) t_1))
(if (or (<= z 2.3e+144) (not (<= z 5.4e+180)))
(+ 1.0 (- (sqrt (+ 1.0 z)) (+ (sqrt x) (sqrt z))))
(+ 2.0 (- (* y 0.5) t_1))))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt(x) + sqrt(y);
double tmp;
if (z <= 1.05e-32) {
tmp = 3.0 + ((sqrt((1.0 + t)) + (z * 0.5)) - sqrt(t));
} else if (z <= 0.74) {
tmp = 3.0 + ((z * 0.5) - (sqrt(z) + t_1));
} else if (z <= 2.9e+122) {
tmp = 2.0 + ((0.5 * (y + sqrt((1.0 / z)))) - t_1);
} else if ((z <= 2.3e+144) || !(z <= 5.4e+180)) {
tmp = 1.0 + (sqrt((1.0 + z)) - (sqrt(x) + sqrt(z)));
} else {
tmp = 2.0 + ((y * 0.5) - 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(x) + sqrt(y)
if (z <= 1.05d-32) then
tmp = 3.0d0 + ((sqrt((1.0d0 + t)) + (z * 0.5d0)) - sqrt(t))
else if (z <= 0.74d0) then
tmp = 3.0d0 + ((z * 0.5d0) - (sqrt(z) + t_1))
else if (z <= 2.9d+122) then
tmp = 2.0d0 + ((0.5d0 * (y + sqrt((1.0d0 / z)))) - t_1)
else if ((z <= 2.3d+144) .or. (.not. (z <= 5.4d+180))) then
tmp = 1.0d0 + (sqrt((1.0d0 + z)) - (sqrt(x) + sqrt(z)))
else
tmp = 2.0d0 + ((y * 0.5d0) - 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(x) + Math.sqrt(y);
double tmp;
if (z <= 1.05e-32) {
tmp = 3.0 + ((Math.sqrt((1.0 + t)) + (z * 0.5)) - Math.sqrt(t));
} else if (z <= 0.74) {
tmp = 3.0 + ((z * 0.5) - (Math.sqrt(z) + t_1));
} else if (z <= 2.9e+122) {
tmp = 2.0 + ((0.5 * (y + Math.sqrt((1.0 / z)))) - t_1);
} else if ((z <= 2.3e+144) || !(z <= 5.4e+180)) {
tmp = 1.0 + (Math.sqrt((1.0 + z)) - (Math.sqrt(x) + Math.sqrt(z)));
} else {
tmp = 2.0 + ((y * 0.5) - t_1);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt(x) + math.sqrt(y) tmp = 0 if z <= 1.05e-32: tmp = 3.0 + ((math.sqrt((1.0 + t)) + (z * 0.5)) - math.sqrt(t)) elif z <= 0.74: tmp = 3.0 + ((z * 0.5) - (math.sqrt(z) + t_1)) elif z <= 2.9e+122: tmp = 2.0 + ((0.5 * (y + math.sqrt((1.0 / z)))) - t_1) elif (z <= 2.3e+144) or not (z <= 5.4e+180): tmp = 1.0 + (math.sqrt((1.0 + z)) - (math.sqrt(x) + math.sqrt(z))) else: tmp = 2.0 + ((y * 0.5) - t_1) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = Float64(sqrt(x) + sqrt(y)) tmp = 0.0 if (z <= 1.05e-32) tmp = Float64(3.0 + Float64(Float64(sqrt(Float64(1.0 + t)) + Float64(z * 0.5)) - sqrt(t))); elseif (z <= 0.74) tmp = Float64(3.0 + Float64(Float64(z * 0.5) - Float64(sqrt(z) + t_1))); elseif (z <= 2.9e+122) tmp = Float64(2.0 + Float64(Float64(0.5 * Float64(y + sqrt(Float64(1.0 / z)))) - t_1)); elseif ((z <= 2.3e+144) || !(z <= 5.4e+180)) tmp = Float64(1.0 + Float64(sqrt(Float64(1.0 + z)) - Float64(sqrt(x) + sqrt(z)))); else tmp = Float64(2.0 + Float64(Float64(y * 0.5) - 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(x) + sqrt(y);
tmp = 0.0;
if (z <= 1.05e-32)
tmp = 3.0 + ((sqrt((1.0 + t)) + (z * 0.5)) - sqrt(t));
elseif (z <= 0.74)
tmp = 3.0 + ((z * 0.5) - (sqrt(z) + t_1));
elseif (z <= 2.9e+122)
tmp = 2.0 + ((0.5 * (y + sqrt((1.0 / z)))) - t_1);
elseif ((z <= 2.3e+144) || ~((z <= 5.4e+180)))
tmp = 1.0 + (sqrt((1.0 + z)) - (sqrt(x) + sqrt(z)));
else
tmp = 2.0 + ((y * 0.5) - t_1);
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, 1.05e-32], N[(3.0 + N[(N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] + N[(z * 0.5), $MachinePrecision]), $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 0.74], N[(3.0 + N[(N[(z * 0.5), $MachinePrecision] - N[(N[Sqrt[z], $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.9e+122], N[(2.0 + N[(N[(0.5 * N[(y + N[Sqrt[N[(1.0 / z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[z, 2.3e+144], N[Not[LessEqual[z, 5.4e+180]], $MachinePrecision]], N[(1.0 + N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 + N[(N[(y * 0.5), $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{x} + \sqrt{y}\\
\mathbf{if}\;z \leq 1.05 \cdot 10^{-32}:\\
\;\;\;\;3 + \left(\left(\sqrt{1 + t} + z \cdot 0.5\right) - \sqrt{t}\right)\\
\mathbf{elif}\;z \leq 0.74:\\
\;\;\;\;3 + \left(z \cdot 0.5 - \left(\sqrt{z} + t\_1\right)\right)\\
\mathbf{elif}\;z \leq 2.9 \cdot 10^{+122}:\\
\;\;\;\;2 + \left(0.5 \cdot \left(y + \sqrt{\frac{1}{z}}\right) - t\_1\right)\\
\mathbf{elif}\;z \leq 2.3 \cdot 10^{+144} \lor \neg \left(z \leq 5.4 \cdot 10^{+180}\right):\\
\;\;\;\;1 + \left(\sqrt{1 + z} - \left(\sqrt{x} + \sqrt{z}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;2 + \left(y \cdot 0.5 - t\_1\right)\\
\end{array}
\end{array}
if z < 1.05e-32Initial program 97.8%
associate-+l+97.8%
sub-neg97.8%
sub-neg97.8%
+-commutative97.8%
+-commutative97.8%
+-commutative97.8%
Simplified97.8%
Taylor expanded in x around 0 50.1%
Taylor expanded in z around 0 50.1%
associate--l+50.1%
Simplified50.1%
Taylor expanded in y around 0 14.1%
associate--l+26.5%
+-commutative26.5%
associate-+r+26.5%
Simplified26.5%
Taylor expanded in t around inf 37.0%
if 1.05e-32 < z < 0.73999999999999999Initial program 96.3%
associate-+l+96.3%
sub-neg96.3%
sub-neg96.3%
+-commutative96.3%
+-commutative96.3%
+-commutative96.3%
Simplified96.3%
Taylor expanded in x around 0 49.5%
Taylor expanded in z around 0 41.9%
associate--l+41.9%
Simplified41.9%
Taylor expanded in y around 0 6.3%
associate--l+11.7%
+-commutative11.7%
associate-+r+11.7%
Simplified11.7%
Taylor expanded in t around inf 13.2%
associate-+r+13.2%
+-commutative13.2%
Simplified13.2%
if 0.73999999999999999 < z < 2.9000000000000001e122Initial program 90.1%
associate-+l+90.1%
sub-neg90.1%
sub-neg90.1%
+-commutative90.1%
+-commutative90.1%
+-commutative90.1%
Simplified90.1%
Taylor expanded in x around 0 55.7%
Taylor expanded in t around inf 29.8%
Taylor expanded in y around 0 13.8%
associate--l+13.8%
*-commutative13.8%
+-commutative13.8%
Simplified13.8%
Taylor expanded in z around inf 14.3%
associate--l+14.3%
distribute-lft-out14.3%
+-commutative14.3%
Simplified14.3%
if 2.9000000000000001e122 < z < 2.3000000000000001e144 or 5.40000000000000033e180 < z Initial program 88.8%
associate-+l+88.8%
sub-neg88.8%
sub-neg88.8%
+-commutative88.8%
+-commutative88.8%
+-commutative88.8%
Simplified88.8%
Taylor expanded in x around 0 57.0%
Taylor expanded in t around inf 31.3%
Taylor expanded in y around inf 2.9%
associate--l+33.0%
Simplified33.0%
if 2.3000000000000001e144 < z < 5.40000000000000033e180Initial program 91.0%
associate-+l+91.0%
sub-neg91.0%
sub-neg91.0%
+-commutative91.0%
+-commutative91.0%
+-commutative91.0%
Simplified91.0%
Taylor expanded in x around 0 42.5%
Taylor expanded in t around inf 31.1%
Taylor expanded in y around 0 18.3%
associate--l+18.3%
*-commutative18.3%
+-commutative18.3%
Simplified18.3%
Taylor expanded in z around inf 18.3%
associate--l+18.3%
+-commutative18.3%
*-commutative18.3%
Simplified18.3%
Final simplification29.1%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ 1.0 z))))
(if (<= y 2.65e-5)
(+ (- t_1 (sqrt z)) (+ 2.0 (- (* y 0.5) (sqrt y))))
(if (<= y 1.35e+14)
(*
x
(+
(/ (sqrt (+ 1.0 y)) x)
(- (/ 1.0 x) (+ (sqrt (/ 1.0 x)) (/ (sqrt y) x)))))
(+ 1.0 (- t_1 (+ (sqrt x) (sqrt z))))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + z));
double tmp;
if (y <= 2.65e-5) {
tmp = (t_1 - sqrt(z)) + (2.0 + ((y * 0.5) - sqrt(y)));
} else if (y <= 1.35e+14) {
tmp = x * ((sqrt((1.0 + y)) / x) + ((1.0 / x) - (sqrt((1.0 / x)) + (sqrt(y) / x))));
} else {
tmp = 1.0 + (t_1 - (sqrt(x) + sqrt(z)));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = sqrt((1.0d0 + z))
if (y <= 2.65d-5) then
tmp = (t_1 - sqrt(z)) + (2.0d0 + ((y * 0.5d0) - sqrt(y)))
else if (y <= 1.35d+14) then
tmp = x * ((sqrt((1.0d0 + y)) / x) + ((1.0d0 / x) - (sqrt((1.0d0 / x)) + (sqrt(y) / x))))
else
tmp = 1.0d0 + (t_1 - (sqrt(x) + sqrt(z)))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + z));
double tmp;
if (y <= 2.65e-5) {
tmp = (t_1 - Math.sqrt(z)) + (2.0 + ((y * 0.5) - Math.sqrt(y)));
} else if (y <= 1.35e+14) {
tmp = x * ((Math.sqrt((1.0 + y)) / x) + ((1.0 / x) - (Math.sqrt((1.0 / x)) + (Math.sqrt(y) / x))));
} else {
tmp = 1.0 + (t_1 - (Math.sqrt(x) + Math.sqrt(z)));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + z)) tmp = 0 if y <= 2.65e-5: tmp = (t_1 - math.sqrt(z)) + (2.0 + ((y * 0.5) - math.sqrt(y))) elif y <= 1.35e+14: tmp = x * ((math.sqrt((1.0 + y)) / x) + ((1.0 / x) - (math.sqrt((1.0 / x)) + (math.sqrt(y) / x)))) else: tmp = 1.0 + (t_1 - (math.sqrt(x) + math.sqrt(z))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(1.0 + z)) tmp = 0.0 if (y <= 2.65e-5) tmp = Float64(Float64(t_1 - sqrt(z)) + Float64(2.0 + Float64(Float64(y * 0.5) - sqrt(y)))); elseif (y <= 1.35e+14) tmp = Float64(x * Float64(Float64(sqrt(Float64(1.0 + y)) / x) + Float64(Float64(1.0 / x) - Float64(sqrt(Float64(1.0 / x)) + Float64(sqrt(y) / x))))); else tmp = Float64(1.0 + Float64(t_1 - Float64(sqrt(x) + sqrt(z)))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + z));
tmp = 0.0;
if (y <= 2.65e-5)
tmp = (t_1 - sqrt(z)) + (2.0 + ((y * 0.5) - sqrt(y)));
elseif (y <= 1.35e+14)
tmp = x * ((sqrt((1.0 + y)) / x) + ((1.0 / x) - (sqrt((1.0 / x)) + (sqrt(y) / x))));
else
tmp = 1.0 + (t_1 - (sqrt(x) + sqrt(z)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y, 2.65e-5], N[(N[(t$95$1 - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] + N[(2.0 + N[(N[(y * 0.5), $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.35e+14], N[(x * N[(N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] / x), $MachinePrecision] + N[(N[(1.0 / x), $MachinePrecision] - N[(N[Sqrt[N[(1.0 / x), $MachinePrecision]], $MachinePrecision] + N[(N[Sqrt[y], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(t$95$1 - N[(N[Sqrt[x], $MachinePrecision] + 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 + z}\\
\mathbf{if}\;y \leq 2.65 \cdot 10^{-5}:\\
\;\;\;\;\left(t\_1 - \sqrt{z}\right) + \left(2 + \left(y \cdot 0.5 - \sqrt{y}\right)\right)\\
\mathbf{elif}\;y \leq 1.35 \cdot 10^{+14}:\\
\;\;\;\;x \cdot \left(\frac{\sqrt{1 + y}}{x} + \left(\frac{1}{x} - \left(\sqrt{\frac{1}{x}} + \frac{\sqrt{y}}{x}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;1 + \left(t\_1 - \left(\sqrt{x} + \sqrt{z}\right)\right)\\
\end{array}
\end{array}
if y < 2.65e-5Initial program 98.2%
associate-+l+98.2%
sub-neg98.2%
sub-neg98.2%
+-commutative98.2%
+-commutative98.2%
+-commutative98.2%
Simplified98.2%
Taylor expanded in x around 0 50.0%
Taylor expanded in t around inf 29.0%
Taylor expanded in y around 0 29.0%
associate--l+29.0%
*-commutative29.0%
+-commutative29.0%
Simplified29.0%
Taylor expanded in y around inf 56.4%
if 2.65e-5 < y < 1.35e14Initial program 89.1%
associate-+l+89.1%
sub-neg89.1%
sub-neg89.1%
+-commutative89.1%
+-commutative89.1%
+-commutative89.1%
Simplified89.1%
Taylor expanded in x around 0 46.1%
Taylor expanded in t around inf 28.9%
Taylor expanded in x around inf 3.3%
Taylor expanded in z around inf 21.4%
associate--l+21.0%
associate-*l/21.0%
+-commutative21.0%
*-lft-identity21.0%
+-commutative21.0%
associate-*l/21.0%
*-lft-identity21.0%
Simplified21.0%
if 1.35e14 < y Initial program 89.8%
associate-+l+89.8%
sub-neg89.8%
sub-neg89.8%
+-commutative89.8%
+-commutative89.8%
+-commutative89.8%
Simplified89.8%
Taylor expanded in x around 0 55.3%
Taylor expanded in t around inf 32.0%
Taylor expanded in y around inf 18.2%
associate--l+35.5%
Simplified35.5%
Final simplification44.7%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ 1.0 z))))
(if (<= y 2.2)
(+ (- t_1 (sqrt z)) (+ 2.0 (- (* y 0.5) (sqrt y))))
(+ 1.0 (- t_1 (+ (sqrt x) (sqrt z)))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + z));
double tmp;
if (y <= 2.2) {
tmp = (t_1 - sqrt(z)) + (2.0 + ((y * 0.5) - sqrt(y)));
} else {
tmp = 1.0 + (t_1 - (sqrt(x) + sqrt(z)));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = sqrt((1.0d0 + z))
if (y <= 2.2d0) then
tmp = (t_1 - sqrt(z)) + (2.0d0 + ((y * 0.5d0) - sqrt(y)))
else
tmp = 1.0d0 + (t_1 - (sqrt(x) + sqrt(z)))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + z));
double tmp;
if (y <= 2.2) {
tmp = (t_1 - Math.sqrt(z)) + (2.0 + ((y * 0.5) - Math.sqrt(y)));
} else {
tmp = 1.0 + (t_1 - (Math.sqrt(x) + Math.sqrt(z)));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + z)) tmp = 0 if y <= 2.2: tmp = (t_1 - math.sqrt(z)) + (2.0 + ((y * 0.5) - math.sqrt(y))) else: tmp = 1.0 + (t_1 - (math.sqrt(x) + math.sqrt(z))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(1.0 + z)) tmp = 0.0 if (y <= 2.2) tmp = Float64(Float64(t_1 - sqrt(z)) + Float64(2.0 + Float64(Float64(y * 0.5) - sqrt(y)))); else tmp = Float64(1.0 + Float64(t_1 - Float64(sqrt(x) + sqrt(z)))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + z));
tmp = 0.0;
if (y <= 2.2)
tmp = (t_1 - sqrt(z)) + (2.0 + ((y * 0.5) - sqrt(y)));
else
tmp = 1.0 + (t_1 - (sqrt(x) + sqrt(z)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y, 2.2], N[(N[(t$95$1 - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] + N[(2.0 + N[(N[(y * 0.5), $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(t$95$1 - N[(N[Sqrt[x], $MachinePrecision] + 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 + z}\\
\mathbf{if}\;y \leq 2.2:\\
\;\;\;\;\left(t\_1 - \sqrt{z}\right) + \left(2 + \left(y \cdot 0.5 - \sqrt{y}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;1 + \left(t\_1 - \left(\sqrt{x} + \sqrt{z}\right)\right)\\
\end{array}
\end{array}
if y < 2.2000000000000002Initial program 98.2%
associate-+l+98.2%
sub-neg98.2%
sub-neg98.2%
+-commutative98.2%
+-commutative98.2%
+-commutative98.2%
Simplified98.2%
Taylor expanded in x around 0 49.2%
Taylor expanded in t around inf 28.2%
Taylor expanded in y around 0 28.2%
associate--l+28.2%
*-commutative28.2%
+-commutative28.2%
Simplified28.2%
Taylor expanded in y around inf 55.6%
if 2.2000000000000002 < y Initial program 89.4%
associate-+l+89.4%
sub-neg89.4%
sub-neg89.4%
+-commutative89.4%
+-commutative89.4%
+-commutative89.4%
Simplified89.4%
Taylor expanded in x around 0 55.4%
Taylor expanded in t around inf 32.5%
Taylor expanded in y around inf 17.8%
associate--l+35.1%
Simplified35.1%
Final simplification45.0%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(if (<= z 4e-34)
(+ 3.0 (- (+ (sqrt (+ 1.0 t)) (* z 0.5)) (sqrt t)))
(if (<= z 4.3)
(+ 3.0 (* z (- 0.5 (sqrt (/ 1.0 z)))))
(+ 2.0 (- (* y 0.5) (+ (sqrt x) (sqrt y)))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (z <= 4e-34) {
tmp = 3.0 + ((sqrt((1.0 + t)) + (z * 0.5)) - sqrt(t));
} else if (z <= 4.3) {
tmp = 3.0 + (z * (0.5 - sqrt((1.0 / z))));
} else {
tmp = 2.0 + ((y * 0.5) - (sqrt(x) + 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 <= 4d-34) then
tmp = 3.0d0 + ((sqrt((1.0d0 + t)) + (z * 0.5d0)) - sqrt(t))
else if (z <= 4.3d0) then
tmp = 3.0d0 + (z * (0.5d0 - sqrt((1.0d0 / z))))
else
tmp = 2.0d0 + ((y * 0.5d0) - (sqrt(x) + 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 <= 4e-34) {
tmp = 3.0 + ((Math.sqrt((1.0 + t)) + (z * 0.5)) - Math.sqrt(t));
} else if (z <= 4.3) {
tmp = 3.0 + (z * (0.5 - Math.sqrt((1.0 / z))));
} else {
tmp = 2.0 + ((y * 0.5) - (Math.sqrt(x) + Math.sqrt(y)));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if z <= 4e-34: tmp = 3.0 + ((math.sqrt((1.0 + t)) + (z * 0.5)) - math.sqrt(t)) elif z <= 4.3: tmp = 3.0 + (z * (0.5 - math.sqrt((1.0 / z)))) else: tmp = 2.0 + ((y * 0.5) - (math.sqrt(x) + 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 <= 4e-34) tmp = Float64(3.0 + Float64(Float64(sqrt(Float64(1.0 + t)) + Float64(z * 0.5)) - sqrt(t))); elseif (z <= 4.3) tmp = Float64(3.0 + Float64(z * Float64(0.5 - sqrt(Float64(1.0 / z))))); else tmp = Float64(2.0 + Float64(Float64(y * 0.5) - Float64(sqrt(x) + 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 <= 4e-34)
tmp = 3.0 + ((sqrt((1.0 + t)) + (z * 0.5)) - sqrt(t));
elseif (z <= 4.3)
tmp = 3.0 + (z * (0.5 - sqrt((1.0 / z))));
else
tmp = 2.0 + ((y * 0.5) - (sqrt(x) + 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, 4e-34], N[(3.0 + N[(N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] + N[(z * 0.5), $MachinePrecision]), $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 4.3], N[(3.0 + N[(z * N[(0.5 - N[Sqrt[N[(1.0 / z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 + N[(N[(y * 0.5), $MachinePrecision] - N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq 4 \cdot 10^{-34}:\\
\;\;\;\;3 + \left(\left(\sqrt{1 + t} + z \cdot 0.5\right) - \sqrt{t}\right)\\
\mathbf{elif}\;z \leq 4.3:\\
\;\;\;\;3 + z \cdot \left(0.5 - \sqrt{\frac{1}{z}}\right)\\
\mathbf{else}:\\
\;\;\;\;2 + \left(y \cdot 0.5 - \left(\sqrt{x} + \sqrt{y}\right)\right)\\
\end{array}
\end{array}
if z < 3.99999999999999971e-34Initial program 97.8%
associate-+l+97.8%
sub-neg97.8%
sub-neg97.8%
+-commutative97.8%
+-commutative97.8%
+-commutative97.8%
Simplified97.8%
Taylor expanded in x around 0 50.1%
Taylor expanded in z around 0 50.1%
associate--l+50.1%
Simplified50.1%
Taylor expanded in y around 0 14.1%
associate--l+26.5%
+-commutative26.5%
associate-+r+26.5%
Simplified26.5%
Taylor expanded in t around inf 37.0%
if 3.99999999999999971e-34 < z < 4.29999999999999982Initial program 96.3%
associate-+l+96.3%
sub-neg96.3%
sub-neg96.3%
+-commutative96.3%
+-commutative96.3%
+-commutative96.3%
Simplified96.3%
Taylor expanded in x around 0 49.5%
Taylor expanded in z around 0 41.9%
associate--l+41.9%
Simplified41.9%
Taylor expanded in y around 0 6.3%
associate--l+11.7%
+-commutative11.7%
associate-+r+11.7%
Simplified11.7%
Taylor expanded in z around inf 55.0%
if 4.29999999999999982 < z Initial program 89.6%
associate-+l+89.6%
sub-neg89.6%
sub-neg89.6%
+-commutative89.6%
+-commutative89.6%
+-commutative89.6%
Simplified89.6%
Taylor expanded in x around 0 54.9%
Taylor expanded in t around inf 30.7%
Taylor expanded in y around 0 14.8%
associate--l+14.8%
*-commutative14.8%
+-commutative14.8%
Simplified14.8%
Taylor expanded in z around inf 14.7%
associate--l+14.7%
+-commutative14.7%
*-commutative14.7%
Simplified14.7%
Final simplification27.0%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= z 3.3) (+ 3.0 (* z (- 0.5 (sqrt (/ 1.0 z))))) (+ 2.0 (- (* y 0.5) (+ (sqrt x) (sqrt y))))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (z <= 3.3) {
tmp = 3.0 + (z * (0.5 - sqrt((1.0 / z))));
} else {
tmp = 2.0 + ((y * 0.5) - (sqrt(x) + 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 <= 3.3d0) then
tmp = 3.0d0 + (z * (0.5d0 - sqrt((1.0d0 / z))))
else
tmp = 2.0d0 + ((y * 0.5d0) - (sqrt(x) + 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 <= 3.3) {
tmp = 3.0 + (z * (0.5 - Math.sqrt((1.0 / z))));
} else {
tmp = 2.0 + ((y * 0.5) - (Math.sqrt(x) + Math.sqrt(y)));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if z <= 3.3: tmp = 3.0 + (z * (0.5 - math.sqrt((1.0 / z)))) else: tmp = 2.0 + ((y * 0.5) - (math.sqrt(x) + 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 <= 3.3) tmp = Float64(3.0 + Float64(z * Float64(0.5 - sqrt(Float64(1.0 / z))))); else tmp = Float64(2.0 + Float64(Float64(y * 0.5) - Float64(sqrt(x) + 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 <= 3.3)
tmp = 3.0 + (z * (0.5 - sqrt((1.0 / z))));
else
tmp = 2.0 + ((y * 0.5) - (sqrt(x) + 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, 3.3], N[(3.0 + N[(z * N[(0.5 - N[Sqrt[N[(1.0 / z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 + N[(N[(y * 0.5), $MachinePrecision] - N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq 3.3:\\
\;\;\;\;3 + z \cdot \left(0.5 - \sqrt{\frac{1}{z}}\right)\\
\mathbf{else}:\\
\;\;\;\;2 + \left(y \cdot 0.5 - \left(\sqrt{x} + \sqrt{y}\right)\right)\\
\end{array}
\end{array}
if z < 3.2999999999999998Initial program 97.7%
associate-+l+97.7%
sub-neg97.7%
sub-neg97.7%
+-commutative97.7%
+-commutative97.7%
+-commutative97.7%
Simplified97.7%
Taylor expanded in x around 0 50.1%
Taylor expanded in z around 0 49.2%
associate--l+49.2%
Simplified49.2%
Taylor expanded in y around 0 13.2%
associate--l+24.9%
+-commutative24.9%
associate-+r+24.9%
Simplified24.9%
Taylor expanded in z around inf 47.6%
if 3.2999999999999998 < z Initial program 89.6%
associate-+l+89.6%
sub-neg89.6%
sub-neg89.6%
+-commutative89.6%
+-commutative89.6%
+-commutative89.6%
Simplified89.6%
Taylor expanded in x around 0 54.9%
Taylor expanded in t around inf 30.7%
Taylor expanded in y around 0 14.8%
associate--l+14.8%
*-commutative14.8%
+-commutative14.8%
Simplified14.8%
Taylor expanded in z around inf 14.7%
associate--l+14.7%
+-commutative14.7%
*-commutative14.7%
Simplified14.7%
Final simplification31.4%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= z 4.5) (+ 3.0 (* z (- 0.5 (sqrt (/ 1.0 z))))) (- 3.0 (sqrt y))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (z <= 4.5) {
tmp = 3.0 + (z * (0.5 - sqrt((1.0 / z))));
} else {
tmp = 3.0 - sqrt(y);
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (z <= 4.5d0) then
tmp = 3.0d0 + (z * (0.5d0 - sqrt((1.0d0 / z))))
else
tmp = 3.0d0 - sqrt(y)
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= 4.5) {
tmp = 3.0 + (z * (0.5 - Math.sqrt((1.0 / z))));
} else {
tmp = 3.0 - Math.sqrt(y);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if z <= 4.5: tmp = 3.0 + (z * (0.5 - math.sqrt((1.0 / z)))) else: tmp = 3.0 - 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 <= 4.5) tmp = Float64(3.0 + Float64(z * Float64(0.5 - sqrt(Float64(1.0 / z))))); else tmp = Float64(3.0 - sqrt(y)); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (z <= 4.5)
tmp = 3.0 + (z * (0.5 - sqrt((1.0 / z))));
else
tmp = 3.0 - sqrt(y);
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[z, 4.5], N[(3.0 + N[(z * N[(0.5 - N[Sqrt[N[(1.0 / z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(3.0 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq 4.5:\\
\;\;\;\;3 + z \cdot \left(0.5 - \sqrt{\frac{1}{z}}\right)\\
\mathbf{else}:\\
\;\;\;\;3 - \sqrt{y}\\
\end{array}
\end{array}
if z < 4.5Initial program 97.7%
associate-+l+97.7%
sub-neg97.7%
sub-neg97.7%
+-commutative97.7%
+-commutative97.7%
+-commutative97.7%
Simplified97.7%
Taylor expanded in x around 0 50.1%
Taylor expanded in z around 0 49.2%
associate--l+49.2%
Simplified49.2%
Taylor expanded in y around 0 13.2%
associate--l+24.9%
+-commutative24.9%
associate-+r+24.9%
Simplified24.9%
Taylor expanded in z around inf 47.6%
if 4.5 < z Initial program 89.6%
associate-+l+89.6%
sub-neg89.6%
sub-neg89.6%
+-commutative89.6%
+-commutative89.6%
+-commutative89.6%
Simplified89.6%
Taylor expanded in x around 0 54.9%
Taylor expanded in z around 0 4.6%
associate--l+4.6%
Simplified4.6%
Taylor expanded in y around 0 3.8%
associate--l+4.3%
+-commutative4.3%
associate-+r+4.3%
Simplified4.3%
Taylor expanded in y around inf 20.9%
mul-1-neg20.9%
Simplified20.9%
Final simplification34.5%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= y 6.0) (- 3.0 (sqrt y)) (* y (- 0.5 (sqrt (/ 1.0 y))))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 6.0) {
tmp = 3.0 - sqrt(y);
} else {
tmp = y * (0.5 - sqrt((1.0 / y)));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= 6.0d0) then
tmp = 3.0d0 - sqrt(y)
else
tmp = y * (0.5d0 - sqrt((1.0d0 / y)))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= 6.0) {
tmp = 3.0 - Math.sqrt(y);
} else {
tmp = y * (0.5 - Math.sqrt((1.0 / y)));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if y <= 6.0: tmp = 3.0 - math.sqrt(y) else: tmp = y * (0.5 - math.sqrt((1.0 / y))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (y <= 6.0) tmp = Float64(3.0 - sqrt(y)); else tmp = Float64(y * Float64(0.5 - sqrt(Float64(1.0 / y)))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (y <= 6.0)
tmp = 3.0 - sqrt(y);
else
tmp = y * (0.5 - sqrt((1.0 / y)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[y, 6.0], N[(3.0 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision], N[(y * N[(0.5 - N[Sqrt[N[(1.0 / y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 6:\\
\;\;\;\;3 - \sqrt{y}\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(0.5 - \sqrt{\frac{1}{y}}\right)\\
\end{array}
\end{array}
if y < 6Initial program 98.2%
associate-+l+98.2%
sub-neg98.2%
sub-neg98.2%
+-commutative98.2%
+-commutative98.2%
+-commutative98.2%
Simplified98.2%
Taylor expanded in x around 0 49.2%
Taylor expanded in z around 0 25.7%
associate--l+25.7%
Simplified25.7%
Taylor expanded in y around 0 15.2%
associate--l+26.1%
+-commutative26.1%
associate-+r+26.1%
Simplified26.1%
Taylor expanded in y around inf 48.1%
mul-1-neg48.1%
Simplified48.1%
if 6 < y Initial program 89.4%
associate-+l+89.4%
sub-neg89.4%
sub-neg89.4%
+-commutative89.4%
+-commutative89.4%
+-commutative89.4%
Simplified89.4%
Taylor expanded in x around 0 55.4%
Taylor expanded in t around inf 32.5%
Taylor expanded in y around 0 4.7%
associate--l+4.7%
*-commutative4.7%
+-commutative4.7%
Simplified4.7%
Taylor expanded in y around inf 5.6%
Final simplification26.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 9.0) (- 3.0 (sqrt y)) (* 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 <= 9.0) {
tmp = 3.0 - sqrt(y);
} else {
tmp = 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 <= 9.0d0) then
tmp = 3.0d0 - sqrt(y)
else
tmp = 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 <= 9.0) {
tmp = 3.0 - Math.sqrt(y);
} else {
tmp = 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 <= 9.0: tmp = 3.0 - math.sqrt(y) else: tmp = 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 <= 9.0) tmp = Float64(3.0 - sqrt(y)); else tmp = Float64(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 <= 9.0)
tmp = 3.0 - sqrt(y);
else
tmp = 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, 9.0], N[(3.0 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision], N[(x * N[Sqrt[N[(1.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 9:\\
\;\;\;\;3 - \sqrt{y}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \sqrt{\frac{1}{x}}\\
\end{array}
\end{array}
if y < 9Initial program 98.2%
associate-+l+98.2%
sub-neg98.2%
sub-neg98.2%
+-commutative98.2%
+-commutative98.2%
+-commutative98.2%
Simplified98.2%
Taylor expanded in x around 0 49.2%
Taylor expanded in z around 0 25.7%
associate--l+25.7%
Simplified25.7%
Taylor expanded in y around 0 15.2%
associate--l+26.1%
+-commutative26.1%
associate-+r+26.1%
Simplified26.1%
Taylor expanded in y around inf 48.1%
mul-1-neg48.1%
Simplified48.1%
if 9 < y Initial program 89.4%
associate-+l+89.4%
sub-neg89.4%
sub-neg89.4%
+-commutative89.4%
+-commutative89.4%
+-commutative89.4%
Simplified89.4%
Taylor expanded in x around 0 55.4%
Taylor expanded in t around inf 32.5%
Taylor expanded in x around inf 2.2%
Taylor expanded in x around -inf 0.0%
mul-1-neg0.0%
unpow20.0%
rem-square-sqrt6.8%
distribute-rgt-neg-in6.8%
metadata-eval6.8%
*-rgt-identity6.8%
Simplified6.8%
Final simplification26.8%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (- 3.0 (sqrt y)))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
return 3.0 - sqrt(y);
}
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 = 3.0d0 - sqrt(y)
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
return 3.0 - Math.sqrt(y);
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): return 3.0 - math.sqrt(y)
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) return Float64(3.0 - sqrt(y)) end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp = code(x, y, z, t)
tmp = 3.0 - sqrt(y);
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := N[(3.0 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
3 - \sqrt{y}
\end{array}
Initial program 93.7%
associate-+l+93.7%
sub-neg93.7%
sub-neg93.7%
+-commutative93.7%
+-commutative93.7%
+-commutative93.7%
Simplified93.7%
Taylor expanded in x around 0 52.4%
Taylor expanded in z around 0 27.3%
associate--l+27.3%
Simplified27.3%
Taylor expanded in y around 0 8.6%
associate--l+14.8%
+-commutative14.8%
associate-+r+14.8%
Simplified14.8%
Taylor expanded in y around inf 24.0%
mul-1-neg24.0%
Simplified24.0%
Final simplification24.0%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (- (sqrt x)))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
return -sqrt(x);
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = -sqrt(x)
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
return -Math.sqrt(x);
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): return -math.sqrt(x)
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) return Float64(-sqrt(x)) end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp = code(x, y, z, t)
tmp = -sqrt(x);
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := (-N[Sqrt[x], $MachinePrecision])
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
-\sqrt{x}
\end{array}
Initial program 93.7%
associate-+l+93.7%
sub-neg93.7%
sub-neg93.7%
+-commutative93.7%
+-commutative93.7%
+-commutative93.7%
Simplified93.7%
Taylor expanded in x around 0 52.4%
Taylor expanded in t around inf 30.4%
Taylor expanded in x around inf 6.0%
mul-1-neg6.0%
Simplified6.0%
Taylor expanded in x around inf 1.6%
neg-mul-11.6%
Simplified1.6%
Final simplification1.6%
(FPCore (x y z t)
:precision binary64
(+
(+
(+
(/ 1.0 (+ (sqrt (+ x 1.0)) (sqrt x)))
(/ 1.0 (+ (sqrt (+ y 1.0)) (sqrt y))))
(/ 1.0 (+ (sqrt (+ z 1.0)) (sqrt z))))
(- (sqrt (+ t 1.0)) (sqrt t))))
double code(double x, double y, double z, double t) {
return (((1.0 / (sqrt((x + 1.0)) + sqrt(x))) + (1.0 / (sqrt((y + 1.0)) + sqrt(y)))) + (1.0 / (sqrt((z + 1.0)) + sqrt(z)))) + (sqrt((t + 1.0)) - sqrt(t));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (((1.0d0 / (sqrt((x + 1.0d0)) + sqrt(x))) + (1.0d0 / (sqrt((y + 1.0d0)) + sqrt(y)))) + (1.0d0 / (sqrt((z + 1.0d0)) + sqrt(z)))) + (sqrt((t + 1.0d0)) - sqrt(t))
end function
public static double code(double x, double y, double z, double t) {
return (((1.0 / (Math.sqrt((x + 1.0)) + Math.sqrt(x))) + (1.0 / (Math.sqrt((y + 1.0)) + Math.sqrt(y)))) + (1.0 / (Math.sqrt((z + 1.0)) + Math.sqrt(z)))) + (Math.sqrt((t + 1.0)) - Math.sqrt(t));
}
def code(x, y, z, t): return (((1.0 / (math.sqrt((x + 1.0)) + math.sqrt(x))) + (1.0 / (math.sqrt((y + 1.0)) + math.sqrt(y)))) + (1.0 / (math.sqrt((z + 1.0)) + math.sqrt(z)))) + (math.sqrt((t + 1.0)) - math.sqrt(t))
function code(x, y, z, t) return Float64(Float64(Float64(Float64(1.0 / Float64(sqrt(Float64(x + 1.0)) + sqrt(x))) + Float64(1.0 / Float64(sqrt(Float64(y + 1.0)) + sqrt(y)))) + Float64(1.0 / Float64(sqrt(Float64(z + 1.0)) + sqrt(z)))) + Float64(sqrt(Float64(t + 1.0)) - sqrt(t))) end
function tmp = code(x, y, z, t) tmp = (((1.0 / (sqrt((x + 1.0)) + sqrt(x))) + (1.0 / (sqrt((y + 1.0)) + sqrt(y)))) + (1.0 / (sqrt((z + 1.0)) + sqrt(z)))) + (sqrt((t + 1.0)) - sqrt(t)); end
code[x_, y_, z_, t_] := N[(N[(N[(N[(1.0 / N[(N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[N[(z + 1.0), $MachinePrecision]], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(t + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\frac{1}{\sqrt{x + 1} + \sqrt{x}} + \frac{1}{\sqrt{y + 1} + \sqrt{y}}\right) + \frac{1}{\sqrt{z + 1} + \sqrt{z}}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)
\end{array}
herbie shell --seed 2024095
(FPCore (x y z t)
:name "Main:z from "
:precision binary64
:alt
(+ (+ (+ (/ 1.0 (+ (sqrt (+ x 1.0)) (sqrt x))) (/ 1.0 (+ (sqrt (+ y 1.0)) (sqrt y)))) (/ 1.0 (+ (sqrt (+ z 1.0)) (sqrt z)))) (- (sqrt (+ t 1.0)) (sqrt t)))
(+ (+ (+ (- (sqrt (+ x 1.0)) (sqrt x)) (- (sqrt (+ y 1.0)) (sqrt y))) (- (sqrt (+ z 1.0)) (sqrt z))) (- (sqrt (+ t 1.0)) (sqrt t))))