
(FPCore (x y z t) :precision binary64 (+ (+ (+ (- (sqrt (+ x 1.0)) (sqrt x)) (- (sqrt (+ y 1.0)) (sqrt y))) (- (sqrt (+ z 1.0)) (sqrt z))) (- (sqrt (+ t 1.0)) (sqrt t))))
double code(double x, double y, double z, double t) {
return (((sqrt((x + 1.0)) - sqrt(x)) + (sqrt((y + 1.0)) - sqrt(y))) + (sqrt((z + 1.0)) - sqrt(z))) + (sqrt((t + 1.0)) - sqrt(t));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (((sqrt((x + 1.0d0)) - sqrt(x)) + (sqrt((y + 1.0d0)) - sqrt(y))) + (sqrt((z + 1.0d0)) - sqrt(z))) + (sqrt((t + 1.0d0)) - sqrt(t))
end function
public static double code(double x, double y, double z, double t) {
return (((Math.sqrt((x + 1.0)) - Math.sqrt(x)) + (Math.sqrt((y + 1.0)) - Math.sqrt(y))) + (Math.sqrt((z + 1.0)) - Math.sqrt(z))) + (Math.sqrt((t + 1.0)) - Math.sqrt(t));
}
def code(x, y, z, t): return (((math.sqrt((x + 1.0)) - math.sqrt(x)) + (math.sqrt((y + 1.0)) - math.sqrt(y))) + (math.sqrt((z + 1.0)) - math.sqrt(z))) + (math.sqrt((t + 1.0)) - math.sqrt(t))
function code(x, y, z, t) return Float64(Float64(Float64(Float64(sqrt(Float64(x + 1.0)) - sqrt(x)) + Float64(sqrt(Float64(y + 1.0)) - sqrt(y))) + Float64(sqrt(Float64(z + 1.0)) - sqrt(z))) + Float64(sqrt(Float64(t + 1.0)) - sqrt(t))) end
function tmp = code(x, y, z, t) tmp = (((sqrt((x + 1.0)) - sqrt(x)) + (sqrt((y + 1.0)) - sqrt(y))) + (sqrt((z + 1.0)) - sqrt(z))) + (sqrt((t + 1.0)) - sqrt(t)); end
code[x_, y_, z_, t_] := N[(N[(N[(N[(N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(z + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(t + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{y + 1} - \sqrt{y}\right)\right) + \left(\sqrt{z + 1} - \sqrt{z}\right)\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 22 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (+ (+ (+ (- (sqrt (+ x 1.0)) (sqrt x)) (- (sqrt (+ y 1.0)) (sqrt y))) (- (sqrt (+ z 1.0)) (sqrt z))) (- (sqrt (+ t 1.0)) (sqrt t))))
double code(double x, double y, double z, double t) {
return (((sqrt((x + 1.0)) - sqrt(x)) + (sqrt((y + 1.0)) - sqrt(y))) + (sqrt((z + 1.0)) - sqrt(z))) + (sqrt((t + 1.0)) - sqrt(t));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (((sqrt((x + 1.0d0)) - sqrt(x)) + (sqrt((y + 1.0d0)) - sqrt(y))) + (sqrt((z + 1.0d0)) - sqrt(z))) + (sqrt((t + 1.0d0)) - sqrt(t))
end function
public static double code(double x, double y, double z, double t) {
return (((Math.sqrt((x + 1.0)) - Math.sqrt(x)) + (Math.sqrt((y + 1.0)) - Math.sqrt(y))) + (Math.sqrt((z + 1.0)) - Math.sqrt(z))) + (Math.sqrt((t + 1.0)) - Math.sqrt(t));
}
def code(x, y, z, t): return (((math.sqrt((x + 1.0)) - math.sqrt(x)) + (math.sqrt((y + 1.0)) - math.sqrt(y))) + (math.sqrt((z + 1.0)) - math.sqrt(z))) + (math.sqrt((t + 1.0)) - math.sqrt(t))
function code(x, y, z, t) return Float64(Float64(Float64(Float64(sqrt(Float64(x + 1.0)) - sqrt(x)) + Float64(sqrt(Float64(y + 1.0)) - sqrt(y))) + Float64(sqrt(Float64(z + 1.0)) - sqrt(z))) + Float64(sqrt(Float64(t + 1.0)) - sqrt(t))) end
function tmp = code(x, y, z, t) tmp = (((sqrt((x + 1.0)) - sqrt(x)) + (sqrt((y + 1.0)) - sqrt(y))) + (sqrt((z + 1.0)) - sqrt(z))) + (sqrt((t + 1.0)) - sqrt(t)); end
code[x_, y_, z_, t_] := N[(N[(N[(N[(N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(z + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(t + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{y + 1} - \sqrt{y}\right)\right) + \left(\sqrt{z + 1} - \sqrt{z}\right)\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)
\end{array}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ 1.0 z))) (t_2 (- t_1 (sqrt z))) (t_3 (sqrt (+ 1.0 y))))
(if (<= t_2 0.01)
(+
(+ (/ 1.0 (+ (sqrt (+ 1.0 x)) (sqrt x))) (/ 1.0 (+ t_3 (sqrt y))))
(/ 1.0 (+ t_1 (sqrt z))))
(+
(+ 1.0 (- t_3 (sqrt y)))
(+ t_2 (/ 1.0 (+ (sqrt (+ 1.0 t)) (sqrt t))))))))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 = t_1 - sqrt(z);
double t_3 = sqrt((1.0 + y));
double tmp;
if (t_2 <= 0.01) {
tmp = ((1.0 / (sqrt((1.0 + x)) + sqrt(x))) + (1.0 / (t_3 + sqrt(y)))) + (1.0 / (t_1 + sqrt(z)));
} else {
tmp = (1.0 + (t_3 - sqrt(y))) + (t_2 + (1.0 / (sqrt((1.0 + t)) + sqrt(t))));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = sqrt((1.0d0 + z))
t_2 = t_1 - sqrt(z)
t_3 = sqrt((1.0d0 + y))
if (t_2 <= 0.01d0) then
tmp = ((1.0d0 / (sqrt((1.0d0 + x)) + sqrt(x))) + (1.0d0 / (t_3 + sqrt(y)))) + (1.0d0 / (t_1 + sqrt(z)))
else
tmp = (1.0d0 + (t_3 - sqrt(y))) + (t_2 + (1.0d0 / (sqrt((1.0d0 + t)) + sqrt(t))))
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 = t_1 - Math.sqrt(z);
double t_3 = Math.sqrt((1.0 + y));
double tmp;
if (t_2 <= 0.01) {
tmp = ((1.0 / (Math.sqrt((1.0 + x)) + Math.sqrt(x))) + (1.0 / (t_3 + Math.sqrt(y)))) + (1.0 / (t_1 + Math.sqrt(z)));
} else {
tmp = (1.0 + (t_3 - Math.sqrt(y))) + (t_2 + (1.0 / (Math.sqrt((1.0 + t)) + Math.sqrt(t))));
}
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 = t_1 - math.sqrt(z) t_3 = math.sqrt((1.0 + y)) tmp = 0 if t_2 <= 0.01: tmp = ((1.0 / (math.sqrt((1.0 + x)) + math.sqrt(x))) + (1.0 / (t_3 + math.sqrt(y)))) + (1.0 / (t_1 + math.sqrt(z))) else: tmp = (1.0 + (t_3 - math.sqrt(y))) + (t_2 + (1.0 / (math.sqrt((1.0 + t)) + math.sqrt(t)))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(1.0 + z)) t_2 = Float64(t_1 - sqrt(z)) t_3 = sqrt(Float64(1.0 + y)) tmp = 0.0 if (t_2 <= 0.01) tmp = Float64(Float64(Float64(1.0 / Float64(sqrt(Float64(1.0 + x)) + sqrt(x))) + Float64(1.0 / Float64(t_3 + sqrt(y)))) + Float64(1.0 / Float64(t_1 + sqrt(z)))); else tmp = Float64(Float64(1.0 + Float64(t_3 - sqrt(y))) + Float64(t_2 + Float64(1.0 / Float64(sqrt(Float64(1.0 + t)) + sqrt(t))))); 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 = t_1 - sqrt(z);
t_3 = sqrt((1.0 + y));
tmp = 0.0;
if (t_2 <= 0.01)
tmp = ((1.0 / (sqrt((1.0 + x)) + sqrt(x))) + (1.0 / (t_3 + sqrt(y)))) + (1.0 / (t_1 + sqrt(z)));
else
tmp = (1.0 + (t_3 - sqrt(y))) + (t_2 + (1.0 / (sqrt((1.0 + t)) + sqrt(t))));
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[(t$95$1 - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t$95$2, 0.01], N[(N[(N[(1.0 / N[(N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(t$95$3 + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(t$95$1 + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 + N[(t$95$3 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$2 + N[(1.0 / N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] + N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + z}\\
t_2 := t\_1 - \sqrt{z}\\
t_3 := \sqrt{1 + y}\\
\mathbf{if}\;t\_2 \leq 0.01:\\
\;\;\;\;\left(\frac{1}{\sqrt{1 + x} + \sqrt{x}} + \frac{1}{t\_3 + \sqrt{y}}\right) + \frac{1}{t\_1 + \sqrt{z}}\\
\mathbf{else}:\\
\;\;\;\;\left(1 + \left(t\_3 - \sqrt{y}\right)\right) + \left(t\_2 + \frac{1}{\sqrt{1 + t} + \sqrt{t}}\right)\\
\end{array}
\end{array}
if (-.f64 (sqrt.f64 (+.f64 z 1)) (sqrt.f64 z)) < 0.0100000000000000002Initial program 87.2%
associate-+l+87.2%
+-commutative87.2%
+-commutative87.2%
+-commutative87.2%
Simplified87.2%
flip--87.3%
add-sqr-sqrt73.4%
add-sqr-sqrt87.6%
Applied egg-rr87.6%
associate--l+88.9%
+-inverses88.9%
metadata-eval88.9%
Simplified88.9%
flip--89.1%
add-sqr-sqrt74.7%
+-commutative74.7%
add-sqr-sqrt89.2%
+-commutative89.2%
Applied egg-rr89.2%
associate--l+91.6%
+-inverses91.6%
metadata-eval91.6%
Simplified91.6%
flip--91.8%
add-sqr-sqrt53.8%
add-sqr-sqrt92.8%
Applied egg-rr92.8%
associate--l+98.0%
+-inverses98.0%
metadata-eval98.0%
Simplified98.0%
Taylor expanded in t around inf 56.9%
if 0.0100000000000000002 < (-.f64 (sqrt.f64 (+.f64 z 1)) (sqrt.f64 z)) Initial program 97.3%
associate-+l+97.2%
+-commutative97.2%
+-commutative97.2%
+-commutative97.2%
Simplified97.2%
Taylor expanded in x around 0 59.3%
flip--59.3%
add-sqr-sqrt45.0%
+-commutative45.0%
add-sqr-sqrt59.6%
+-commutative59.6%
Applied egg-rr59.6%
+-commutative59.6%
associate--l+60.0%
+-inverses60.0%
metadata-eval60.0%
+-commutative60.0%
+-commutative60.0%
Simplified60.0%
Final simplification58.6%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (+ (+ (/ 1.0 (+ (sqrt (+ 1.0 x)) (sqrt x))) (/ 1.0 (+ (sqrt (+ 1.0 y)) (sqrt y)))) (+ (/ 1.0 (+ (sqrt (+ 1.0 z)) (sqrt z))) (- (sqrt (+ 1.0 t)) (sqrt t)))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
return ((1.0 / (sqrt((1.0 + x)) + sqrt(x))) + (1.0 / (sqrt((1.0 + y)) + sqrt(y)))) + ((1.0 / (sqrt((1.0 + z)) + sqrt(z))) + (sqrt((1.0 + t)) - sqrt(t)));
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = ((1.0d0 / (sqrt((1.0d0 + x)) + sqrt(x))) + (1.0d0 / (sqrt((1.0d0 + y)) + sqrt(y)))) + ((1.0d0 / (sqrt((1.0d0 + z)) + sqrt(z))) + (sqrt((1.0d0 + t)) - sqrt(t)))
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
return ((1.0 / (Math.sqrt((1.0 + x)) + Math.sqrt(x))) + (1.0 / (Math.sqrt((1.0 + y)) + Math.sqrt(y)))) + ((1.0 / (Math.sqrt((1.0 + z)) + Math.sqrt(z))) + (Math.sqrt((1.0 + t)) - Math.sqrt(t)));
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): return ((1.0 / (math.sqrt((1.0 + x)) + math.sqrt(x))) + (1.0 / (math.sqrt((1.0 + y)) + math.sqrt(y)))) + ((1.0 / (math.sqrt((1.0 + z)) + math.sqrt(z))) + (math.sqrt((1.0 + t)) - math.sqrt(t)))
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) return Float64(Float64(Float64(1.0 / Float64(sqrt(Float64(1.0 + x)) + sqrt(x))) + Float64(1.0 / Float64(sqrt(Float64(1.0 + y)) + sqrt(y)))) + Float64(Float64(1.0 / Float64(sqrt(Float64(1.0 + z)) + sqrt(z))) + Float64(sqrt(Float64(1.0 + t)) - sqrt(t)))) end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp = code(x, y, z, t)
tmp = ((1.0 / (sqrt((1.0 + x)) + sqrt(x))) + (1.0 / (sqrt((1.0 + y)) + sqrt(y)))) + ((1.0 / (sqrt((1.0 + z)) + sqrt(z))) + (sqrt((1.0 + t)) - sqrt(t)));
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := N[(N[(N[(1.0 / N[(N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 / N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\left(\frac{1}{\sqrt{1 + x} + \sqrt{x}} + \frac{1}{\sqrt{1 + y} + \sqrt{y}}\right) + \left(\frac{1}{\sqrt{1 + z} + \sqrt{z}} + \left(\sqrt{1 + t} - \sqrt{t}\right)\right)
\end{array}
Initial program 92.6%
associate-+l+92.6%
+-commutative92.6%
+-commutative92.6%
+-commutative92.6%
Simplified92.6%
flip--92.6%
add-sqr-sqrt73.0%
add-sqr-sqrt93.0%
Applied egg-rr93.0%
associate--l+93.8%
+-inverses93.8%
metadata-eval93.8%
Simplified93.8%
flip--93.9%
add-sqr-sqrt76.4%
+-commutative76.4%
add-sqr-sqrt94.0%
+-commutative94.0%
Applied egg-rr94.0%
associate--l+95.1%
+-inverses95.1%
metadata-eval95.1%
Simplified95.1%
flip--95.2%
add-sqr-sqrt77.7%
add-sqr-sqrt95.7%
Applied egg-rr95.7%
associate--l+98.1%
+-inverses98.1%
metadata-eval98.1%
Simplified98.1%
Final simplification98.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)))
(t_2 (sqrt (+ 1.0 x)))
(t_3 (sqrt (+ 1.0 t)))
(t_4 (sqrt (+ 1.0 y)))
(t_5 (- t_4 (sqrt y))))
(if (<= z 1.9e-5)
(+ (+ 1.0 t_5) (+ (- t_1 (sqrt z)) (/ 1.0 (+ t_3 (sqrt t)))))
(if (<= z 3.1e+150)
(+
(/ 1.0 (+ t_1 (sqrt z)))
(+ (/ 1.0 (+ t_4 (sqrt y))) (- t_2 (sqrt x))))
(+ (/ 1.0 (+ t_2 (sqrt x))) (+ (- t_3 (sqrt t)) t_5))))))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 + x));
double t_3 = sqrt((1.0 + t));
double t_4 = sqrt((1.0 + y));
double t_5 = t_4 - sqrt(y);
double tmp;
if (z <= 1.9e-5) {
tmp = (1.0 + t_5) + ((t_1 - sqrt(z)) + (1.0 / (t_3 + sqrt(t))));
} else if (z <= 3.1e+150) {
tmp = (1.0 / (t_1 + sqrt(z))) + ((1.0 / (t_4 + sqrt(y))) + (t_2 - sqrt(x)));
} else {
tmp = (1.0 / (t_2 + sqrt(x))) + ((t_3 - sqrt(t)) + t_5);
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: t_5
real(8) :: tmp
t_1 = sqrt((1.0d0 + z))
t_2 = sqrt((1.0d0 + x))
t_3 = sqrt((1.0d0 + t))
t_4 = sqrt((1.0d0 + y))
t_5 = t_4 - sqrt(y)
if (z <= 1.9d-5) then
tmp = (1.0d0 + t_5) + ((t_1 - sqrt(z)) + (1.0d0 / (t_3 + sqrt(t))))
else if (z <= 3.1d+150) then
tmp = (1.0d0 / (t_1 + sqrt(z))) + ((1.0d0 / (t_4 + sqrt(y))) + (t_2 - sqrt(x)))
else
tmp = (1.0d0 / (t_2 + sqrt(x))) + ((t_3 - sqrt(t)) + t_5)
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 + x));
double t_3 = Math.sqrt((1.0 + t));
double t_4 = Math.sqrt((1.0 + y));
double t_5 = t_4 - Math.sqrt(y);
double tmp;
if (z <= 1.9e-5) {
tmp = (1.0 + t_5) + ((t_1 - Math.sqrt(z)) + (1.0 / (t_3 + Math.sqrt(t))));
} else if (z <= 3.1e+150) {
tmp = (1.0 / (t_1 + Math.sqrt(z))) + ((1.0 / (t_4 + Math.sqrt(y))) + (t_2 - Math.sqrt(x)));
} else {
tmp = (1.0 / (t_2 + Math.sqrt(x))) + ((t_3 - Math.sqrt(t)) + t_5);
}
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 + x)) t_3 = math.sqrt((1.0 + t)) t_4 = math.sqrt((1.0 + y)) t_5 = t_4 - math.sqrt(y) tmp = 0 if z <= 1.9e-5: tmp = (1.0 + t_5) + ((t_1 - math.sqrt(z)) + (1.0 / (t_3 + math.sqrt(t)))) elif z <= 3.1e+150: tmp = (1.0 / (t_1 + math.sqrt(z))) + ((1.0 / (t_4 + math.sqrt(y))) + (t_2 - math.sqrt(x))) else: tmp = (1.0 / (t_2 + math.sqrt(x))) + ((t_3 - math.sqrt(t)) + t_5) 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 + x)) t_3 = sqrt(Float64(1.0 + t)) t_4 = sqrt(Float64(1.0 + y)) t_5 = Float64(t_4 - sqrt(y)) tmp = 0.0 if (z <= 1.9e-5) tmp = Float64(Float64(1.0 + t_5) + Float64(Float64(t_1 - sqrt(z)) + Float64(1.0 / Float64(t_3 + sqrt(t))))); elseif (z <= 3.1e+150) tmp = Float64(Float64(1.0 / Float64(t_1 + sqrt(z))) + Float64(Float64(1.0 / Float64(t_4 + sqrt(y))) + Float64(t_2 - sqrt(x)))); else tmp = Float64(Float64(1.0 / Float64(t_2 + sqrt(x))) + Float64(Float64(t_3 - sqrt(t)) + t_5)); 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 + x));
t_3 = sqrt((1.0 + t));
t_4 = sqrt((1.0 + y));
t_5 = t_4 - sqrt(y);
tmp = 0.0;
if (z <= 1.9e-5)
tmp = (1.0 + t_5) + ((t_1 - sqrt(z)) + (1.0 / (t_3 + sqrt(t))));
elseif (z <= 3.1e+150)
tmp = (1.0 / (t_1 + sqrt(z))) + ((1.0 / (t_4 + sqrt(y))) + (t_2 - sqrt(x)));
else
tmp = (1.0 / (t_2 + sqrt(x))) + ((t_3 - sqrt(t)) + t_5);
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 + x), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$4 = N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$5 = N[(t$95$4 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, 1.9e-5], N[(N[(1.0 + t$95$5), $MachinePrecision] + N[(N[(t$95$1 - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(t$95$3 + N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.1e+150], N[(N[(1.0 / N[(t$95$1 + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 / N[(t$95$4 + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$2 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[(t$95$2 + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$3 - N[Sqrt[t], $MachinePrecision]), $MachinePrecision] + t$95$5), $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 + x}\\
t_3 := \sqrt{1 + t}\\
t_4 := \sqrt{1 + y}\\
t_5 := t\_4 - \sqrt{y}\\
\mathbf{if}\;z \leq 1.9 \cdot 10^{-5}:\\
\;\;\;\;\left(1 + t\_5\right) + \left(\left(t\_1 - \sqrt{z}\right) + \frac{1}{t\_3 + \sqrt{t}}\right)\\
\mathbf{elif}\;z \leq 3.1 \cdot 10^{+150}:\\
\;\;\;\;\frac{1}{t\_1 + \sqrt{z}} + \left(\frac{1}{t\_4 + \sqrt{y}} + \left(t\_2 - \sqrt{x}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{t\_2 + \sqrt{x}} + \left(\left(t\_3 - \sqrt{t}\right) + t\_5\right)\\
\end{array}
\end{array}
if z < 1.9000000000000001e-5Initial program 97.3%
associate-+l+97.2%
+-commutative97.2%
+-commutative97.2%
+-commutative97.2%
Simplified97.2%
Taylor expanded in x around 0 59.3%
flip--59.3%
add-sqr-sqrt45.0%
+-commutative45.0%
add-sqr-sqrt59.6%
+-commutative59.6%
Applied egg-rr59.6%
+-commutative59.6%
associate--l+60.0%
+-inverses60.0%
metadata-eval60.0%
+-commutative60.0%
+-commutative60.0%
Simplified60.0%
if 1.9000000000000001e-5 < z < 3.10000000000000014e150Initial program 84.9%
associate-+l+84.9%
+-commutative84.9%
+-commutative84.9%
+-commutative84.9%
Simplified84.9%
flip--85.1%
add-sqr-sqrt67.4%
add-sqr-sqrt85.5%
Applied egg-rr85.5%
associate--l+86.0%
+-inverses86.0%
metadata-eval86.0%
Simplified86.0%
Taylor expanded in t around inf 47.9%
flip--88.5%
add-sqr-sqrt55.6%
add-sqr-sqrt90.4%
Applied egg-rr48.5%
associate--l+98.4%
+-inverses98.4%
metadata-eval98.4%
Simplified54.7%
if 3.10000000000000014e150 < z Initial program 90.2%
associate-+l+90.2%
associate-+l+90.2%
+-commutative90.2%
+-commutative90.2%
associate-+l-90.2%
+-commutative90.2%
+-commutative90.2%
Simplified90.2%
Taylor expanded in z around inf 90.2%
flip--92.6%
add-sqr-sqrt77.4%
+-commutative77.4%
add-sqr-sqrt92.6%
+-commutative92.6%
Applied egg-rr90.2%
associate--l+96.0%
+-inverses96.0%
metadata-eval96.0%
Simplified93.7%
Final simplification65.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 t))) (t_2 (- (sqrt (+ 1.0 y)) (sqrt y))))
(if (<= z 1.4e+27)
(+ (+ 1.0 t_2) (+ (- (sqrt (+ 1.0 z)) (sqrt z)) (/ 1.0 (+ t_1 (sqrt t)))))
(+ (/ 1.0 (+ (sqrt (+ 1.0 x)) (sqrt x))) (+ (- t_1 (sqrt t)) t_2)))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + t));
double t_2 = sqrt((1.0 + y)) - sqrt(y);
double tmp;
if (z <= 1.4e+27) {
tmp = (1.0 + t_2) + ((sqrt((1.0 + z)) - sqrt(z)) + (1.0 / (t_1 + sqrt(t))));
} else {
tmp = (1.0 / (sqrt((1.0 + x)) + sqrt(x))) + ((t_1 - sqrt(t)) + t_2);
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = sqrt((1.0d0 + t))
t_2 = sqrt((1.0d0 + y)) - sqrt(y)
if (z <= 1.4d+27) then
tmp = (1.0d0 + t_2) + ((sqrt((1.0d0 + z)) - sqrt(z)) + (1.0d0 / (t_1 + sqrt(t))))
else
tmp = (1.0d0 / (sqrt((1.0d0 + x)) + sqrt(x))) + ((t_1 - sqrt(t)) + t_2)
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + t));
double t_2 = Math.sqrt((1.0 + y)) - Math.sqrt(y);
double tmp;
if (z <= 1.4e+27) {
tmp = (1.0 + t_2) + ((Math.sqrt((1.0 + z)) - Math.sqrt(z)) + (1.0 / (t_1 + Math.sqrt(t))));
} else {
tmp = (1.0 / (Math.sqrt((1.0 + x)) + Math.sqrt(x))) + ((t_1 - Math.sqrt(t)) + t_2);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + t)) t_2 = math.sqrt((1.0 + y)) - math.sqrt(y) tmp = 0 if z <= 1.4e+27: tmp = (1.0 + t_2) + ((math.sqrt((1.0 + z)) - math.sqrt(z)) + (1.0 / (t_1 + math.sqrt(t)))) else: tmp = (1.0 / (math.sqrt((1.0 + x)) + math.sqrt(x))) + ((t_1 - math.sqrt(t)) + t_2) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(1.0 + t)) t_2 = Float64(sqrt(Float64(1.0 + y)) - sqrt(y)) tmp = 0.0 if (z <= 1.4e+27) tmp = Float64(Float64(1.0 + t_2) + Float64(Float64(sqrt(Float64(1.0 + z)) - sqrt(z)) + Float64(1.0 / Float64(t_1 + sqrt(t))))); else tmp = Float64(Float64(1.0 / Float64(sqrt(Float64(1.0 + x)) + sqrt(x))) + Float64(Float64(t_1 - sqrt(t)) + t_2)); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + t));
t_2 = sqrt((1.0 + y)) - sqrt(y);
tmp = 0.0;
if (z <= 1.4e+27)
tmp = (1.0 + t_2) + ((sqrt((1.0 + z)) - sqrt(z)) + (1.0 / (t_1 + sqrt(t))));
else
tmp = (1.0 / (sqrt((1.0 + x)) + sqrt(x))) + ((t_1 - sqrt(t)) + t_2);
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, 1.4e+27], N[(N[(1.0 + t$95$2), $MachinePrecision] + N[(N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(t$95$1 + N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[(N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$1 - N[Sqrt[t], $MachinePrecision]), $MachinePrecision] + t$95$2), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + t}\\
t_2 := \sqrt{1 + y} - \sqrt{y}\\
\mathbf{if}\;z \leq 1.4 \cdot 10^{+27}:\\
\;\;\;\;\left(1 + t\_2\right) + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \frac{1}{t\_1 + \sqrt{t}}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{1 + x} + \sqrt{x}} + \left(\left(t\_1 - \sqrt{t}\right) + t\_2\right)\\
\end{array}
\end{array}
if z < 1.4e27Initial program 94.4%
associate-+l+94.4%
+-commutative94.4%
+-commutative94.4%
+-commutative94.4%
Simplified94.4%
Taylor expanded in x around 0 57.5%
flip--57.5%
add-sqr-sqrt43.4%
+-commutative43.4%
add-sqr-sqrt57.8%
+-commutative57.8%
Applied egg-rr57.8%
+-commutative57.8%
associate--l+58.1%
+-inverses58.1%
metadata-eval58.1%
+-commutative58.1%
+-commutative58.1%
Simplified58.1%
if 1.4e27 < z Initial program 90.1%
associate-+l+90.1%
associate-+l+90.1%
+-commutative90.1%
+-commutative90.1%
associate-+l-90.1%
+-commutative90.1%
+-commutative90.1%
Simplified90.1%
Taylor expanded in z around inf 90.1%
flip--92.1%
add-sqr-sqrt78.0%
+-commutative78.0%
add-sqr-sqrt92.2%
+-commutative92.2%
Applied egg-rr90.5%
associate--l+94.8%
+-inverses94.8%
metadata-eval94.8%
Simplified93.3%
Final simplification72.4%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (sqrt (+ 1.0 t)) (sqrt t)))
(t_2 (- (sqrt (+ 1.0 y)) (sqrt y))))
(if (<= z 8.2e+30)
(+ (+ (/ 1.0 (+ (sqrt (+ 1.0 z)) (sqrt z))) t_1) (+ 1.0 t_2))
(+ (/ 1.0 (+ (sqrt (+ 1.0 x)) (sqrt x))) (+ t_1 t_2)))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + t)) - sqrt(t);
double t_2 = sqrt((1.0 + y)) - sqrt(y);
double tmp;
if (z <= 8.2e+30) {
tmp = ((1.0 / (sqrt((1.0 + z)) + sqrt(z))) + t_1) + (1.0 + t_2);
} else {
tmp = (1.0 / (sqrt((1.0 + x)) + sqrt(x))) + (t_1 + t_2);
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = sqrt((1.0d0 + t)) - sqrt(t)
t_2 = sqrt((1.0d0 + y)) - sqrt(y)
if (z <= 8.2d+30) then
tmp = ((1.0d0 / (sqrt((1.0d0 + z)) + sqrt(z))) + t_1) + (1.0d0 + t_2)
else
tmp = (1.0d0 / (sqrt((1.0d0 + x)) + sqrt(x))) + (t_1 + t_2)
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + t)) - Math.sqrt(t);
double t_2 = Math.sqrt((1.0 + y)) - Math.sqrt(y);
double tmp;
if (z <= 8.2e+30) {
tmp = ((1.0 / (Math.sqrt((1.0 + z)) + Math.sqrt(z))) + t_1) + (1.0 + t_2);
} else {
tmp = (1.0 / (Math.sqrt((1.0 + x)) + Math.sqrt(x))) + (t_1 + t_2);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + t)) - math.sqrt(t) t_2 = math.sqrt((1.0 + y)) - math.sqrt(y) tmp = 0 if z <= 8.2e+30: tmp = ((1.0 / (math.sqrt((1.0 + z)) + math.sqrt(z))) + t_1) + (1.0 + t_2) else: tmp = (1.0 / (math.sqrt((1.0 + x)) + math.sqrt(x))) + (t_1 + t_2) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = Float64(sqrt(Float64(1.0 + t)) - sqrt(t)) t_2 = Float64(sqrt(Float64(1.0 + y)) - sqrt(y)) tmp = 0.0 if (z <= 8.2e+30) tmp = Float64(Float64(Float64(1.0 / Float64(sqrt(Float64(1.0 + z)) + sqrt(z))) + t_1) + Float64(1.0 + t_2)); else tmp = Float64(Float64(1.0 / Float64(sqrt(Float64(1.0 + x)) + sqrt(x))) + Float64(t_1 + t_2)); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + t)) - sqrt(t);
t_2 = sqrt((1.0 + y)) - sqrt(y);
tmp = 0.0;
if (z <= 8.2e+30)
tmp = ((1.0 / (sqrt((1.0 + z)) + sqrt(z))) + t_1) + (1.0 + t_2);
else
tmp = (1.0 / (sqrt((1.0 + x)) + sqrt(x))) + (t_1 + t_2);
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, 8.2e+30], N[(N[(N[(1.0 / N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision] + N[(1.0 + t$95$2), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[(N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$1 + t$95$2), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + t} - \sqrt{t}\\
t_2 := \sqrt{1 + y} - \sqrt{y}\\
\mathbf{if}\;z \leq 8.2 \cdot 10^{+30}:\\
\;\;\;\;\left(\frac{1}{\sqrt{1 + z} + \sqrt{z}} + t\_1\right) + \left(1 + t\_2\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{1 + x} + \sqrt{x}} + \left(t\_1 + t\_2\right)\\
\end{array}
\end{array}
if z < 8.20000000000000011e30Initial program 94.4%
associate-+l+94.4%
+-commutative94.4%
+-commutative94.4%
+-commutative94.4%
Simplified94.4%
Taylor expanded in x around 0 57.5%
flip--95.5%
add-sqr-sqrt94.7%
add-sqr-sqrt96.3%
Applied egg-rr58.0%
associate--l+98.3%
+-inverses98.3%
metadata-eval98.3%
Simplified58.4%
if 8.20000000000000011e30 < z Initial program 90.0%
associate-+l+90.0%
associate-+l+90.0%
+-commutative90.0%
+-commutative90.0%
associate-+l-90.0%
+-commutative90.0%
+-commutative90.0%
Simplified90.0%
Taylor expanded in z around inf 90.0%
flip--92.0%
add-sqr-sqrt77.7%
+-commutative77.7%
add-sqr-sqrt92.1%
+-commutative92.1%
Applied egg-rr90.4%
associate--l+94.8%
+-inverses94.8%
metadata-eval94.8%
Simplified93.3%
Final simplification72.3%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ 1.0 y))) (t_2 (sqrt (+ 1.0 z))))
(if (<= y 16000.0)
(+
(+ (/ 1.0 (+ t_2 (sqrt z))) (- (sqrt (+ 1.0 t)) (sqrt t)))
(+ 1.0 (- t_1 (sqrt y))))
(+
(+ (/ 1.0 (+ (sqrt (+ 1.0 x)) (sqrt x))) (/ 1.0 (+ t_1 (sqrt y))))
(- t_2 (sqrt z))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + y));
double t_2 = sqrt((1.0 + z));
double tmp;
if (y <= 16000.0) {
tmp = ((1.0 / (t_2 + sqrt(z))) + (sqrt((1.0 + t)) - sqrt(t))) + (1.0 + (t_1 - sqrt(y)));
} else {
tmp = ((1.0 / (sqrt((1.0 + x)) + sqrt(x))) + (1.0 / (t_1 + sqrt(y)))) + (t_2 - sqrt(z));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = sqrt((1.0d0 + y))
t_2 = sqrt((1.0d0 + z))
if (y <= 16000.0d0) then
tmp = ((1.0d0 / (t_2 + sqrt(z))) + (sqrt((1.0d0 + t)) - sqrt(t))) + (1.0d0 + (t_1 - sqrt(y)))
else
tmp = ((1.0d0 / (sqrt((1.0d0 + x)) + sqrt(x))) + (1.0d0 / (t_1 + sqrt(y)))) + (t_2 - sqrt(z))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + y));
double t_2 = Math.sqrt((1.0 + z));
double tmp;
if (y <= 16000.0) {
tmp = ((1.0 / (t_2 + Math.sqrt(z))) + (Math.sqrt((1.0 + t)) - Math.sqrt(t))) + (1.0 + (t_1 - Math.sqrt(y)));
} else {
tmp = ((1.0 / (Math.sqrt((1.0 + x)) + Math.sqrt(x))) + (1.0 / (t_1 + Math.sqrt(y)))) + (t_2 - Math.sqrt(z));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + y)) t_2 = math.sqrt((1.0 + z)) tmp = 0 if y <= 16000.0: tmp = ((1.0 / (t_2 + math.sqrt(z))) + (math.sqrt((1.0 + t)) - math.sqrt(t))) + (1.0 + (t_1 - math.sqrt(y))) else: tmp = ((1.0 / (math.sqrt((1.0 + x)) + math.sqrt(x))) + (1.0 / (t_1 + math.sqrt(y)))) + (t_2 - math.sqrt(z)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(1.0 + y)) t_2 = sqrt(Float64(1.0 + z)) tmp = 0.0 if (y <= 16000.0) tmp = Float64(Float64(Float64(1.0 / Float64(t_2 + sqrt(z))) + Float64(sqrt(Float64(1.0 + t)) - sqrt(t))) + Float64(1.0 + Float64(t_1 - sqrt(y)))); else tmp = Float64(Float64(Float64(1.0 / Float64(sqrt(Float64(1.0 + x)) + sqrt(x))) + Float64(1.0 / Float64(t_1 + sqrt(y)))) + Float64(t_2 - sqrt(z))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + y));
t_2 = sqrt((1.0 + z));
tmp = 0.0;
if (y <= 16000.0)
tmp = ((1.0 / (t_2 + sqrt(z))) + (sqrt((1.0 + t)) - sqrt(t))) + (1.0 + (t_1 - sqrt(y)));
else
tmp = ((1.0 / (sqrt((1.0 + x)) + sqrt(x))) + (1.0 / (t_1 + sqrt(y)))) + (t_2 - sqrt(z));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y, 16000.0], N[(N[(N[(1.0 / N[(t$95$2 + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 + N[(t$95$1 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 / N[(N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(t$95$1 + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$2 - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + y}\\
t_2 := \sqrt{1 + z}\\
\mathbf{if}\;y \leq 16000:\\
\;\;\;\;\left(\frac{1}{t\_2 + \sqrt{z}} + \left(\sqrt{1 + t} - \sqrt{t}\right)\right) + \left(1 + \left(t\_1 - \sqrt{y}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{1}{\sqrt{1 + x} + \sqrt{x}} + \frac{1}{t\_1 + \sqrt{y}}\right) + \left(t\_2 - \sqrt{z}\right)\\
\end{array}
\end{array}
if y < 16000Initial program 97.5%
associate-+l+97.5%
+-commutative97.5%
+-commutative97.5%
+-commutative97.5%
Simplified97.5%
Taylor expanded in x around 0 60.1%
flip--98.0%
add-sqr-sqrt80.3%
add-sqr-sqrt98.2%
Applied egg-rr60.1%
associate--l+98.8%
+-inverses98.8%
metadata-eval98.8%
Simplified60.5%
if 16000 < y Initial program 88.0%
associate-+l+88.0%
+-commutative88.0%
+-commutative88.0%
+-commutative88.0%
Simplified88.0%
flip--88.1%
add-sqr-sqrt49.7%
add-sqr-sqrt88.5%
Applied egg-rr88.5%
associate--l+90.1%
+-inverses90.1%
metadata-eval90.1%
Simplified90.1%
flip--90.1%
add-sqr-sqrt69.5%
+-commutative69.5%
add-sqr-sqrt90.4%
+-commutative90.4%
Applied egg-rr90.4%
associate--l+92.4%
+-inverses92.4%
metadata-eval92.4%
Simplified92.4%
Taylor expanded in t around inf 52.0%
Final simplification56.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 1.6e+16)
(+
(+ 1.0 (- (sqrt (+ 1.0 y)) (sqrt y)))
(+ (- (sqrt (+ 1.0 t)) (sqrt t)) (- (sqrt (+ 1.0 z)) (sqrt z))))
(/ 1.0 (+ (sqrt (+ 1.0 x)) (sqrt x)))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 1.6e+16) {
tmp = (1.0 + (sqrt((1.0 + y)) - sqrt(y))) + ((sqrt((1.0 + t)) - sqrt(t)) + (sqrt((1.0 + z)) - sqrt(z)));
} else {
tmp = 1.0 / (sqrt((1.0 + x)) + sqrt(x));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= 1.6d+16) then
tmp = (1.0d0 + (sqrt((1.0d0 + y)) - sqrt(y))) + ((sqrt((1.0d0 + t)) - sqrt(t)) + (sqrt((1.0d0 + z)) - sqrt(z)))
else
tmp = 1.0d0 / (sqrt((1.0d0 + x)) + sqrt(x))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= 1.6e+16) {
tmp = (1.0 + (Math.sqrt((1.0 + y)) - Math.sqrt(y))) + ((Math.sqrt((1.0 + t)) - Math.sqrt(t)) + (Math.sqrt((1.0 + z)) - Math.sqrt(z)));
} else {
tmp = 1.0 / (Math.sqrt((1.0 + x)) + Math.sqrt(x));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if y <= 1.6e+16: tmp = (1.0 + (math.sqrt((1.0 + y)) - math.sqrt(y))) + ((math.sqrt((1.0 + t)) - math.sqrt(t)) + (math.sqrt((1.0 + z)) - math.sqrt(z))) else: tmp = 1.0 / (math.sqrt((1.0 + x)) + math.sqrt(x)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (y <= 1.6e+16) tmp = Float64(Float64(1.0 + Float64(sqrt(Float64(1.0 + y)) - sqrt(y))) + Float64(Float64(sqrt(Float64(1.0 + t)) - sqrt(t)) + Float64(sqrt(Float64(1.0 + z)) - sqrt(z)))); else tmp = Float64(1.0 / Float64(sqrt(Float64(1.0 + x)) + sqrt(x))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (y <= 1.6e+16)
tmp = (1.0 + (sqrt((1.0 + y)) - sqrt(y))) + ((sqrt((1.0 + t)) - sqrt(t)) + (sqrt((1.0 + z)) - sqrt(z)));
else
tmp = 1.0 / (sqrt((1.0 + x)) + sqrt(x));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[y, 1.6e+16], N[(N[(1.0 + N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 1.6 \cdot 10^{+16}:\\
\;\;\;\;\left(1 + \left(\sqrt{1 + y} - \sqrt{y}\right)\right) + \left(\left(\sqrt{1 + t} - \sqrt{t}\right) + \left(\sqrt{1 + z} - \sqrt{z}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{1 + x} + \sqrt{x}}\\
\end{array}
\end{array}
if y < 1.6e16Initial program 97.1%
associate-+l+97.0%
+-commutative97.0%
+-commutative97.0%
+-commutative97.0%
Simplified97.0%
Taylor expanded in x around 0 60.3%
if 1.6e16 < y Initial program 88.1%
+-commutative88.1%
associate-+r+88.1%
associate-+r-50.3%
associate-+l-27.7%
associate-+r-6.7%
Simplified6.4%
Taylor expanded in t around inf 5.1%
associate--l+21.1%
associate--l+17.5%
+-commutative17.5%
associate-+r+17.5%
Simplified17.5%
Taylor expanded in z around inf 19.5%
Taylor expanded in y around inf 19.3%
flip--19.3%
add-sqr-sqrt19.5%
add-sqr-sqrt19.4%
Applied egg-rr19.4%
associate--l+22.9%
+-inverses22.9%
metadata-eval22.9%
+-commutative22.9%
Simplified22.9%
Final simplification41.8%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (sqrt (+ 1.0 t)) (sqrt t)))
(t_2 (- (sqrt (+ 1.0 y)) (sqrt y))))
(if (<= z 5e+30)
(+ (+ 1.0 t_2) (+ t_1 (- (sqrt (+ 1.0 z)) (sqrt z))))
(+ (/ 1.0 (+ (sqrt (+ 1.0 x)) (sqrt x))) (+ t_1 t_2)))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + t)) - sqrt(t);
double t_2 = sqrt((1.0 + y)) - sqrt(y);
double tmp;
if (z <= 5e+30) {
tmp = (1.0 + t_2) + (t_1 + (sqrt((1.0 + z)) - sqrt(z)));
} else {
tmp = (1.0 / (sqrt((1.0 + x)) + sqrt(x))) + (t_1 + t_2);
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = sqrt((1.0d0 + t)) - sqrt(t)
t_2 = sqrt((1.0d0 + y)) - sqrt(y)
if (z <= 5d+30) then
tmp = (1.0d0 + t_2) + (t_1 + (sqrt((1.0d0 + z)) - sqrt(z)))
else
tmp = (1.0d0 / (sqrt((1.0d0 + x)) + sqrt(x))) + (t_1 + t_2)
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + t)) - Math.sqrt(t);
double t_2 = Math.sqrt((1.0 + y)) - Math.sqrt(y);
double tmp;
if (z <= 5e+30) {
tmp = (1.0 + t_2) + (t_1 + (Math.sqrt((1.0 + z)) - Math.sqrt(z)));
} else {
tmp = (1.0 / (Math.sqrt((1.0 + x)) + Math.sqrt(x))) + (t_1 + t_2);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + t)) - math.sqrt(t) t_2 = math.sqrt((1.0 + y)) - math.sqrt(y) tmp = 0 if z <= 5e+30: tmp = (1.0 + t_2) + (t_1 + (math.sqrt((1.0 + z)) - math.sqrt(z))) else: tmp = (1.0 / (math.sqrt((1.0 + x)) + math.sqrt(x))) + (t_1 + t_2) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = Float64(sqrt(Float64(1.0 + t)) - sqrt(t)) t_2 = Float64(sqrt(Float64(1.0 + y)) - sqrt(y)) tmp = 0.0 if (z <= 5e+30) tmp = Float64(Float64(1.0 + t_2) + Float64(t_1 + Float64(sqrt(Float64(1.0 + z)) - sqrt(z)))); else tmp = Float64(Float64(1.0 / Float64(sqrt(Float64(1.0 + x)) + sqrt(x))) + Float64(t_1 + t_2)); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + t)) - sqrt(t);
t_2 = sqrt((1.0 + y)) - sqrt(y);
tmp = 0.0;
if (z <= 5e+30)
tmp = (1.0 + t_2) + (t_1 + (sqrt((1.0 + z)) - sqrt(z)));
else
tmp = (1.0 / (sqrt((1.0 + x)) + sqrt(x))) + (t_1 + t_2);
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, 5e+30], N[(N[(1.0 + t$95$2), $MachinePrecision] + N[(t$95$1 + N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[(N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$1 + t$95$2), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + t} - \sqrt{t}\\
t_2 := \sqrt{1 + y} - \sqrt{y}\\
\mathbf{if}\;z \leq 5 \cdot 10^{+30}:\\
\;\;\;\;\left(1 + t\_2\right) + \left(t\_1 + \left(\sqrt{1 + z} - \sqrt{z}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{1 + x} + \sqrt{x}} + \left(t\_1 + t\_2\right)\\
\end{array}
\end{array}
if z < 4.9999999999999998e30Initial program 94.4%
associate-+l+94.4%
+-commutative94.4%
+-commutative94.4%
+-commutative94.4%
Simplified94.4%
Taylor expanded in x around 0 57.5%
if 4.9999999999999998e30 < z Initial program 90.0%
associate-+l+90.0%
associate-+l+90.0%
+-commutative90.0%
+-commutative90.0%
associate-+l-90.0%
+-commutative90.0%
+-commutative90.0%
Simplified90.0%
Taylor expanded in z around inf 90.0%
flip--92.0%
add-sqr-sqrt77.7%
+-commutative77.7%
add-sqr-sqrt92.1%
+-commutative92.1%
Applied egg-rr90.4%
associate--l+94.8%
+-inverses94.8%
metadata-eval94.8%
Simplified93.3%
Final simplification71.8%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ 1.0 x))) (t_2 (sqrt (+ 1.0 y))))
(if (<= z 9.5e-24)
(+ (- (sqrt (+ 1.0 t)) (sqrt t)) 3.0)
(if (<= z 9500000000.0)
(+ 1.0 (+ (sqrt (+ 1.0 z)) (- 1.0 (+ (sqrt y) (sqrt z)))))
(if (<= z 4e+223)
(+ t_1 (- t_2 (+ (sqrt x) (sqrt y))))
(if (<= z 2.8e+257)
(/ 1.0 (+ t_1 (sqrt x)))
(+ 1.0 (- t_2 (sqrt y)))))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + x));
double t_2 = sqrt((1.0 + y));
double tmp;
if (z <= 9.5e-24) {
tmp = (sqrt((1.0 + t)) - sqrt(t)) + 3.0;
} else if (z <= 9500000000.0) {
tmp = 1.0 + (sqrt((1.0 + z)) + (1.0 - (sqrt(y) + sqrt(z))));
} else if (z <= 4e+223) {
tmp = t_1 + (t_2 - (sqrt(x) + sqrt(y)));
} else if (z <= 2.8e+257) {
tmp = 1.0 / (t_1 + sqrt(x));
} else {
tmp = 1.0 + (t_2 - sqrt(y));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = sqrt((1.0d0 + x))
t_2 = sqrt((1.0d0 + y))
if (z <= 9.5d-24) then
tmp = (sqrt((1.0d0 + t)) - sqrt(t)) + 3.0d0
else if (z <= 9500000000.0d0) then
tmp = 1.0d0 + (sqrt((1.0d0 + z)) + (1.0d0 - (sqrt(y) + sqrt(z))))
else if (z <= 4d+223) then
tmp = t_1 + (t_2 - (sqrt(x) + sqrt(y)))
else if (z <= 2.8d+257) then
tmp = 1.0d0 / (t_1 + sqrt(x))
else
tmp = 1.0d0 + (t_2 - sqrt(y))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + x));
double t_2 = Math.sqrt((1.0 + y));
double tmp;
if (z <= 9.5e-24) {
tmp = (Math.sqrt((1.0 + t)) - Math.sqrt(t)) + 3.0;
} else if (z <= 9500000000.0) {
tmp = 1.0 + (Math.sqrt((1.0 + z)) + (1.0 - (Math.sqrt(y) + Math.sqrt(z))));
} else if (z <= 4e+223) {
tmp = t_1 + (t_2 - (Math.sqrt(x) + Math.sqrt(y)));
} else if (z <= 2.8e+257) {
tmp = 1.0 / (t_1 + Math.sqrt(x));
} else {
tmp = 1.0 + (t_2 - Math.sqrt(y));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + x)) t_2 = math.sqrt((1.0 + y)) tmp = 0 if z <= 9.5e-24: tmp = (math.sqrt((1.0 + t)) - math.sqrt(t)) + 3.0 elif z <= 9500000000.0: tmp = 1.0 + (math.sqrt((1.0 + z)) + (1.0 - (math.sqrt(y) + math.sqrt(z)))) elif z <= 4e+223: tmp = t_1 + (t_2 - (math.sqrt(x) + math.sqrt(y))) elif z <= 2.8e+257: tmp = 1.0 / (t_1 + math.sqrt(x)) else: tmp = 1.0 + (t_2 - math.sqrt(y)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(1.0 + x)) t_2 = sqrt(Float64(1.0 + y)) tmp = 0.0 if (z <= 9.5e-24) tmp = Float64(Float64(sqrt(Float64(1.0 + t)) - sqrt(t)) + 3.0); elseif (z <= 9500000000.0) tmp = Float64(1.0 + Float64(sqrt(Float64(1.0 + z)) + Float64(1.0 - Float64(sqrt(y) + sqrt(z))))); elseif (z <= 4e+223) tmp = Float64(t_1 + Float64(t_2 - Float64(sqrt(x) + sqrt(y)))); elseif (z <= 2.8e+257) tmp = Float64(1.0 / Float64(t_1 + sqrt(x))); else tmp = Float64(1.0 + Float64(t_2 - sqrt(y))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + x));
t_2 = sqrt((1.0 + y));
tmp = 0.0;
if (z <= 9.5e-24)
tmp = (sqrt((1.0 + t)) - sqrt(t)) + 3.0;
elseif (z <= 9500000000.0)
tmp = 1.0 + (sqrt((1.0 + z)) + (1.0 - (sqrt(y) + sqrt(z))));
elseif (z <= 4e+223)
tmp = t_1 + (t_2 - (sqrt(x) + sqrt(y)));
elseif (z <= 2.8e+257)
tmp = 1.0 / (t_1 + sqrt(x));
else
tmp = 1.0 + (t_2 - sqrt(y));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[z, 9.5e-24], N[(N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision] + 3.0), $MachinePrecision], If[LessEqual[z, 9500000000.0], N[(1.0 + N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] + N[(1.0 - N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 4e+223], N[(t$95$1 + N[(t$95$2 - N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.8e+257], N[(1.0 / N[(t$95$1 + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(t$95$2 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + x}\\
t_2 := \sqrt{1 + y}\\
\mathbf{if}\;z \leq 9.5 \cdot 10^{-24}:\\
\;\;\;\;\left(\sqrt{1 + t} - \sqrt{t}\right) + 3\\
\mathbf{elif}\;z \leq 9500000000:\\
\;\;\;\;1 + \left(\sqrt{1 + z} + \left(1 - \left(\sqrt{y} + \sqrt{z}\right)\right)\right)\\
\mathbf{elif}\;z \leq 4 \cdot 10^{+223}:\\
\;\;\;\;t\_1 + \left(t\_2 - \left(\sqrt{x} + \sqrt{y}\right)\right)\\
\mathbf{elif}\;z \leq 2.8 \cdot 10^{+257}:\\
\;\;\;\;\frac{1}{t\_1 + \sqrt{x}}\\
\mathbf{else}:\\
\;\;\;\;1 + \left(t\_2 - \sqrt{y}\right)\\
\end{array}
\end{array}
if z < 9.50000000000000029e-24Initial program 97.6%
associate-+l+97.6%
+-commutative97.6%
+-commutative97.6%
+-commutative97.6%
Simplified97.6%
Taylor expanded in x around 0 59.2%
Taylor expanded in z around 0 56.3%
associate--l+59.2%
Simplified59.2%
Taylor expanded in y around 0 23.5%
associate--l+39.6%
Simplified39.6%
if 9.50000000000000029e-24 < z < 9.5e9Initial program 90.8%
+-commutative90.8%
associate-+r+90.8%
associate-+r-64.8%
associate-+l-56.2%
associate-+r-39.5%
Simplified39.6%
Taylor expanded in t around inf 6.9%
associate--l+13.7%
associate--l+13.7%
+-commutative13.7%
associate-+r+13.7%
Simplified13.7%
Taylor expanded in x around 0 19.6%
associate--l+34.3%
+-commutative34.3%
+-commutative34.3%
associate--l+28.5%
+-commutative28.5%
Simplified28.5%
Taylor expanded in y around 0 16.3%
if 9.5e9 < z < 4.00000000000000019e223Initial program 86.9%
+-commutative86.9%
associate-+r+86.9%
associate-+r-66.8%
associate-+l-54.4%
associate-+r-54.1%
Simplified35.8%
Taylor expanded in t around inf 5.3%
associate--l+21.6%
associate--l+25.5%
+-commutative25.5%
associate-+r+25.5%
Simplified25.5%
Taylor expanded in z around inf 32.2%
if 4.00000000000000019e223 < z < 2.7999999999999998e257Initial program 73.8%
+-commutative73.8%
associate-+r+73.8%
associate-+r-65.0%
associate-+l-47.4%
associate-+r-47.4%
Simplified11.1%
Taylor expanded in t around inf 3.3%
associate--l+19.6%
associate--l+20.5%
+-commutative20.5%
associate-+r+20.7%
Simplified20.7%
Taylor expanded in z around inf 19.9%
Taylor expanded in y around inf 18.8%
flip--18.8%
add-sqr-sqrt18.3%
add-sqr-sqrt18.8%
Applied egg-rr18.8%
associate--l+25.4%
+-inverses25.4%
metadata-eval25.4%
+-commutative25.4%
Simplified25.4%
if 2.7999999999999998e257 < z Initial program 99.0%
+-commutative99.0%
associate-+r+99.0%
associate-+r-75.3%
associate-+l-60.3%
associate-+r-60.3%
Simplified44.1%
Taylor expanded in t around inf 3.1%
associate--l+23.0%
associate--l+24.1%
+-commutative24.1%
associate-+r+24.1%
Simplified24.1%
Taylor expanded in z around inf 33.2%
Taylor expanded in x around 0 25.9%
associate-+r-53.9%
Simplified53.9%
Final simplification36.4%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ 1.0 x))) (t_2 (sqrt (+ 1.0 y))))
(if (<= z 2.55e-24)
(+ (- (sqrt (+ 1.0 t)) (sqrt t)) 3.0)
(if (<= z 4.3e+15)
(+ 1.0 (+ (sqrt (+ 1.0 z)) (- t_2 (+ (sqrt y) (sqrt z)))))
(if (<= z 4e+223)
(+ t_1 (- t_2 (+ (sqrt x) (sqrt y))))
(if (<= z 2.8e+257)
(/ 1.0 (+ t_1 (sqrt x)))
(+ 1.0 (- t_2 (sqrt y)))))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + x));
double t_2 = sqrt((1.0 + y));
double tmp;
if (z <= 2.55e-24) {
tmp = (sqrt((1.0 + t)) - sqrt(t)) + 3.0;
} else if (z <= 4.3e+15) {
tmp = 1.0 + (sqrt((1.0 + z)) + (t_2 - (sqrt(y) + sqrt(z))));
} else if (z <= 4e+223) {
tmp = t_1 + (t_2 - (sqrt(x) + sqrt(y)));
} else if (z <= 2.8e+257) {
tmp = 1.0 / (t_1 + sqrt(x));
} else {
tmp = 1.0 + (t_2 - sqrt(y));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = sqrt((1.0d0 + x))
t_2 = sqrt((1.0d0 + y))
if (z <= 2.55d-24) then
tmp = (sqrt((1.0d0 + t)) - sqrt(t)) + 3.0d0
else if (z <= 4.3d+15) then
tmp = 1.0d0 + (sqrt((1.0d0 + z)) + (t_2 - (sqrt(y) + sqrt(z))))
else if (z <= 4d+223) then
tmp = t_1 + (t_2 - (sqrt(x) + sqrt(y)))
else if (z <= 2.8d+257) then
tmp = 1.0d0 / (t_1 + sqrt(x))
else
tmp = 1.0d0 + (t_2 - sqrt(y))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + x));
double t_2 = Math.sqrt((1.0 + y));
double tmp;
if (z <= 2.55e-24) {
tmp = (Math.sqrt((1.0 + t)) - Math.sqrt(t)) + 3.0;
} else if (z <= 4.3e+15) {
tmp = 1.0 + (Math.sqrt((1.0 + z)) + (t_2 - (Math.sqrt(y) + Math.sqrt(z))));
} else if (z <= 4e+223) {
tmp = t_1 + (t_2 - (Math.sqrt(x) + Math.sqrt(y)));
} else if (z <= 2.8e+257) {
tmp = 1.0 / (t_1 + Math.sqrt(x));
} else {
tmp = 1.0 + (t_2 - Math.sqrt(y));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + x)) t_2 = math.sqrt((1.0 + y)) tmp = 0 if z <= 2.55e-24: tmp = (math.sqrt((1.0 + t)) - math.sqrt(t)) + 3.0 elif z <= 4.3e+15: tmp = 1.0 + (math.sqrt((1.0 + z)) + (t_2 - (math.sqrt(y) + math.sqrt(z)))) elif z <= 4e+223: tmp = t_1 + (t_2 - (math.sqrt(x) + math.sqrt(y))) elif z <= 2.8e+257: tmp = 1.0 / (t_1 + math.sqrt(x)) else: tmp = 1.0 + (t_2 - math.sqrt(y)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(1.0 + x)) t_2 = sqrt(Float64(1.0 + y)) tmp = 0.0 if (z <= 2.55e-24) tmp = Float64(Float64(sqrt(Float64(1.0 + t)) - sqrt(t)) + 3.0); elseif (z <= 4.3e+15) tmp = Float64(1.0 + Float64(sqrt(Float64(1.0 + z)) + Float64(t_2 - Float64(sqrt(y) + sqrt(z))))); elseif (z <= 4e+223) tmp = Float64(t_1 + Float64(t_2 - Float64(sqrt(x) + sqrt(y)))); elseif (z <= 2.8e+257) tmp = Float64(1.0 / Float64(t_1 + sqrt(x))); else tmp = Float64(1.0 + Float64(t_2 - sqrt(y))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + x));
t_2 = sqrt((1.0 + y));
tmp = 0.0;
if (z <= 2.55e-24)
tmp = (sqrt((1.0 + t)) - sqrt(t)) + 3.0;
elseif (z <= 4.3e+15)
tmp = 1.0 + (sqrt((1.0 + z)) + (t_2 - (sqrt(y) + sqrt(z))));
elseif (z <= 4e+223)
tmp = t_1 + (t_2 - (sqrt(x) + sqrt(y)));
elseif (z <= 2.8e+257)
tmp = 1.0 / (t_1 + sqrt(x));
else
tmp = 1.0 + (t_2 - sqrt(y));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[z, 2.55e-24], N[(N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision] + 3.0), $MachinePrecision], If[LessEqual[z, 4.3e+15], N[(1.0 + N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] + N[(t$95$2 - N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 4e+223], N[(t$95$1 + N[(t$95$2 - N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.8e+257], N[(1.0 / N[(t$95$1 + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(t$95$2 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + x}\\
t_2 := \sqrt{1 + y}\\
\mathbf{if}\;z \leq 2.55 \cdot 10^{-24}:\\
\;\;\;\;\left(\sqrt{1 + t} - \sqrt{t}\right) + 3\\
\mathbf{elif}\;z \leq 4.3 \cdot 10^{+15}:\\
\;\;\;\;1 + \left(\sqrt{1 + z} + \left(t\_2 - \left(\sqrt{y} + \sqrt{z}\right)\right)\right)\\
\mathbf{elif}\;z \leq 4 \cdot 10^{+223}:\\
\;\;\;\;t\_1 + \left(t\_2 - \left(\sqrt{x} + \sqrt{y}\right)\right)\\
\mathbf{elif}\;z \leq 2.8 \cdot 10^{+257}:\\
\;\;\;\;\frac{1}{t\_1 + \sqrt{x}}\\
\mathbf{else}:\\
\;\;\;\;1 + \left(t\_2 - \sqrt{y}\right)\\
\end{array}
\end{array}
if z < 2.55000000000000013e-24Initial program 97.6%
associate-+l+97.6%
+-commutative97.6%
+-commutative97.6%
+-commutative97.6%
Simplified97.6%
Taylor expanded in x around 0 59.2%
Taylor expanded in z around 0 56.3%
associate--l+59.2%
Simplified59.2%
Taylor expanded in y around 0 23.5%
associate--l+39.6%
Simplified39.6%
if 2.55000000000000013e-24 < z < 4.3e15Initial program 84.1%
+-commutative84.1%
associate-+r+84.1%
associate-+r-56.5%
associate-+l-46.9%
associate-+r-33.4%
Simplified33.5%
Taylor expanded in t around inf 5.8%
associate--l+16.0%
associate--l+16.0%
+-commutative16.0%
associate-+r+16.0%
Simplified16.0%
Taylor expanded in x around 0 16.8%
associate--l+35.4%
+-commutative35.4%
+-commutative35.4%
associate--l+24.9%
+-commutative24.9%
Simplified24.9%
if 4.3e15 < z < 4.00000000000000019e223Initial program 87.7%
+-commutative87.7%
associate-+r+87.7%
associate-+r-68.2%
associate-+l-55.7%
associate-+r-55.7%
Simplified36.5%
Taylor expanded in t around inf 5.4%
associate--l+21.7%
associate--l+25.7%
+-commutative25.7%
associate-+r+25.7%
Simplified25.7%
Taylor expanded in z around inf 32.7%
if 4.00000000000000019e223 < z < 2.7999999999999998e257Initial program 73.8%
+-commutative73.8%
associate-+r+73.8%
associate-+r-65.0%
associate-+l-47.4%
associate-+r-47.4%
Simplified11.1%
Taylor expanded in t around inf 3.3%
associate--l+19.6%
associate--l+20.5%
+-commutative20.5%
associate-+r+20.7%
Simplified20.7%
Taylor expanded in z around inf 19.9%
Taylor expanded in y around inf 18.8%
flip--18.8%
add-sqr-sqrt18.3%
add-sqr-sqrt18.8%
Applied egg-rr18.8%
associate--l+25.4%
+-inverses25.4%
metadata-eval25.4%
+-commutative25.4%
Simplified25.4%
if 2.7999999999999998e257 < z Initial program 99.0%
+-commutative99.0%
associate-+r+99.0%
associate-+r-75.3%
associate-+l-60.3%
associate-+r-60.3%
Simplified44.1%
Taylor expanded in t around inf 3.1%
associate--l+23.0%
associate--l+24.1%
+-commutative24.1%
associate-+r+24.1%
Simplified24.1%
Taylor expanded in z around inf 33.2%
Taylor expanded in x around 0 25.9%
associate-+r-53.9%
Simplified53.9%
Final simplification36.8%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ 1.0 x))) (t_2 (sqrt (+ 1.0 z))) (t_3 (sqrt (+ 1.0 y))))
(if (<= z 2.55e-24)
(+ 2.0 (+ t_2 (- (sqrt (+ 1.0 t)) (+ (sqrt z) (sqrt t)))))
(if (<= z 4.1e+15)
(+ 1.0 (+ t_2 (- t_3 (+ (sqrt y) (sqrt z)))))
(if (<= z 4e+223)
(+ t_1 (- t_3 (+ (sqrt x) (sqrt y))))
(if (<= z 2.8e+257)
(/ 1.0 (+ t_1 (sqrt x)))
(+ 1.0 (- t_3 (sqrt y)))))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + x));
double t_2 = sqrt((1.0 + z));
double t_3 = sqrt((1.0 + y));
double tmp;
if (z <= 2.55e-24) {
tmp = 2.0 + (t_2 + (sqrt((1.0 + t)) - (sqrt(z) + sqrt(t))));
} else if (z <= 4.1e+15) {
tmp = 1.0 + (t_2 + (t_3 - (sqrt(y) + sqrt(z))));
} else if (z <= 4e+223) {
tmp = t_1 + (t_3 - (sqrt(x) + sqrt(y)));
} else if (z <= 2.8e+257) {
tmp = 1.0 / (t_1 + sqrt(x));
} else {
tmp = 1.0 + (t_3 - sqrt(y));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = sqrt((1.0d0 + x))
t_2 = sqrt((1.0d0 + z))
t_3 = sqrt((1.0d0 + y))
if (z <= 2.55d-24) then
tmp = 2.0d0 + (t_2 + (sqrt((1.0d0 + t)) - (sqrt(z) + sqrt(t))))
else if (z <= 4.1d+15) then
tmp = 1.0d0 + (t_2 + (t_3 - (sqrt(y) + sqrt(z))))
else if (z <= 4d+223) then
tmp = t_1 + (t_3 - (sqrt(x) + sqrt(y)))
else if (z <= 2.8d+257) then
tmp = 1.0d0 / (t_1 + sqrt(x))
else
tmp = 1.0d0 + (t_3 - sqrt(y))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + x));
double t_2 = Math.sqrt((1.0 + z));
double t_3 = Math.sqrt((1.0 + y));
double tmp;
if (z <= 2.55e-24) {
tmp = 2.0 + (t_2 + (Math.sqrt((1.0 + t)) - (Math.sqrt(z) + Math.sqrt(t))));
} else if (z <= 4.1e+15) {
tmp = 1.0 + (t_2 + (t_3 - (Math.sqrt(y) + Math.sqrt(z))));
} else if (z <= 4e+223) {
tmp = t_1 + (t_3 - (Math.sqrt(x) + Math.sqrt(y)));
} else if (z <= 2.8e+257) {
tmp = 1.0 / (t_1 + Math.sqrt(x));
} else {
tmp = 1.0 + (t_3 - Math.sqrt(y));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + x)) t_2 = math.sqrt((1.0 + z)) t_3 = math.sqrt((1.0 + y)) tmp = 0 if z <= 2.55e-24: tmp = 2.0 + (t_2 + (math.sqrt((1.0 + t)) - (math.sqrt(z) + math.sqrt(t)))) elif z <= 4.1e+15: tmp = 1.0 + (t_2 + (t_3 - (math.sqrt(y) + math.sqrt(z)))) elif z <= 4e+223: tmp = t_1 + (t_3 - (math.sqrt(x) + math.sqrt(y))) elif z <= 2.8e+257: tmp = 1.0 / (t_1 + math.sqrt(x)) else: tmp = 1.0 + (t_3 - math.sqrt(y)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(1.0 + x)) t_2 = sqrt(Float64(1.0 + z)) t_3 = sqrt(Float64(1.0 + y)) tmp = 0.0 if (z <= 2.55e-24) tmp = Float64(2.0 + Float64(t_2 + Float64(sqrt(Float64(1.0 + t)) - Float64(sqrt(z) + sqrt(t))))); elseif (z <= 4.1e+15) tmp = Float64(1.0 + Float64(t_2 + Float64(t_3 - Float64(sqrt(y) + sqrt(z))))); elseif (z <= 4e+223) tmp = Float64(t_1 + Float64(t_3 - Float64(sqrt(x) + sqrt(y)))); elseif (z <= 2.8e+257) tmp = Float64(1.0 / Float64(t_1 + sqrt(x))); else tmp = Float64(1.0 + Float64(t_3 - sqrt(y))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + x));
t_2 = sqrt((1.0 + z));
t_3 = sqrt((1.0 + y));
tmp = 0.0;
if (z <= 2.55e-24)
tmp = 2.0 + (t_2 + (sqrt((1.0 + t)) - (sqrt(z) + sqrt(t))));
elseif (z <= 4.1e+15)
tmp = 1.0 + (t_2 + (t_3 - (sqrt(y) + sqrt(z))));
elseif (z <= 4e+223)
tmp = t_1 + (t_3 - (sqrt(x) + sqrt(y)));
elseif (z <= 2.8e+257)
tmp = 1.0 / (t_1 + sqrt(x));
else
tmp = 1.0 + (t_3 - sqrt(y));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[z, 2.55e-24], N[(2.0 + N[(t$95$2 + N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[(N[Sqrt[z], $MachinePrecision] + N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 4.1e+15], N[(1.0 + N[(t$95$2 + N[(t$95$3 - N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 4e+223], N[(t$95$1 + N[(t$95$3 - N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.8e+257], N[(1.0 / N[(t$95$1 + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(t$95$3 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + x}\\
t_2 := \sqrt{1 + z}\\
t_3 := \sqrt{1 + y}\\
\mathbf{if}\;z \leq 2.55 \cdot 10^{-24}:\\
\;\;\;\;2 + \left(t\_2 + \left(\sqrt{1 + t} - \left(\sqrt{z} + \sqrt{t}\right)\right)\right)\\
\mathbf{elif}\;z \leq 4.1 \cdot 10^{+15}:\\
\;\;\;\;1 + \left(t\_2 + \left(t\_3 - \left(\sqrt{y} + \sqrt{z}\right)\right)\right)\\
\mathbf{elif}\;z \leq 4 \cdot 10^{+223}:\\
\;\;\;\;t\_1 + \left(t\_3 - \left(\sqrt{x} + \sqrt{y}\right)\right)\\
\mathbf{elif}\;z \leq 2.8 \cdot 10^{+257}:\\
\;\;\;\;\frac{1}{t\_1 + \sqrt{x}}\\
\mathbf{else}:\\
\;\;\;\;1 + \left(t\_3 - \sqrt{y}\right)\\
\end{array}
\end{array}
if z < 2.55000000000000013e-24Initial program 97.6%
+-commutative97.6%
associate-+r+97.6%
associate-+r-79.9%
associate-+l-70.3%
associate-+r-51.3%
Simplified51.3%
Taylor expanded in x around 0 20.0%
Taylor expanded in y around 0 23.5%
associate--l+46.0%
+-commutative46.0%
associate--l+39.6%
+-commutative39.6%
Simplified39.6%
if 2.55000000000000013e-24 < z < 4.1e15Initial program 84.1%
+-commutative84.1%
associate-+r+84.1%
associate-+r-56.5%
associate-+l-46.9%
associate-+r-33.4%
Simplified33.5%
Taylor expanded in t around inf 5.8%
associate--l+16.0%
associate--l+16.0%
+-commutative16.0%
associate-+r+16.0%
Simplified16.0%
Taylor expanded in x around 0 16.8%
associate--l+35.4%
+-commutative35.4%
+-commutative35.4%
associate--l+24.9%
+-commutative24.9%
Simplified24.9%
if 4.1e15 < z < 4.00000000000000019e223Initial program 87.7%
+-commutative87.7%
associate-+r+87.7%
associate-+r-68.2%
associate-+l-55.7%
associate-+r-55.7%
Simplified36.5%
Taylor expanded in t around inf 5.4%
associate--l+21.7%
associate--l+25.7%
+-commutative25.7%
associate-+r+25.7%
Simplified25.7%
Taylor expanded in z around inf 32.7%
if 4.00000000000000019e223 < z < 2.7999999999999998e257Initial program 73.8%
+-commutative73.8%
associate-+r+73.8%
associate-+r-65.0%
associate-+l-47.4%
associate-+r-47.4%
Simplified11.1%
Taylor expanded in t around inf 3.3%
associate--l+19.6%
associate--l+20.5%
+-commutative20.5%
associate-+r+20.7%
Simplified20.7%
Taylor expanded in z around inf 19.9%
Taylor expanded in y around inf 18.8%
flip--18.8%
add-sqr-sqrt18.3%
add-sqr-sqrt18.8%
Applied egg-rr18.8%
associate--l+25.4%
+-inverses25.4%
metadata-eval25.4%
+-commutative25.4%
Simplified25.4%
if 2.7999999999999998e257 < z Initial program 99.0%
+-commutative99.0%
associate-+r+99.0%
associate-+r-75.3%
associate-+l-60.3%
associate-+r-60.3%
Simplified44.1%
Taylor expanded in t around inf 3.1%
associate--l+23.0%
associate--l+24.1%
+-commutative24.1%
associate-+r+24.1%
Simplified24.1%
Taylor expanded in z around inf 33.2%
Taylor expanded in x around 0 25.9%
associate-+r-53.9%
Simplified53.9%
Final simplification36.8%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ 1.0 y))))
(if (<= t 2.1e+17)
(+ (+ 1.0 (- t_1 (sqrt y))) (+ 1.0 (/ 1.0 (+ (sqrt (+ 1.0 t)) (sqrt t)))))
(+ (- (sqrt (+ 1.0 z)) (sqrt z)) (+ 1.0 (/ 1.0 (+ t_1 (sqrt y))))))))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 (t <= 2.1e+17) {
tmp = (1.0 + (t_1 - sqrt(y))) + (1.0 + (1.0 / (sqrt((1.0 + t)) + sqrt(t))));
} else {
tmp = (sqrt((1.0 + z)) - sqrt(z)) + (1.0 + (1.0 / (t_1 + sqrt(y))));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = sqrt((1.0d0 + y))
if (t <= 2.1d+17) then
tmp = (1.0d0 + (t_1 - sqrt(y))) + (1.0d0 + (1.0d0 / (sqrt((1.0d0 + t)) + sqrt(t))))
else
tmp = (sqrt((1.0d0 + z)) - sqrt(z)) + (1.0d0 + (1.0d0 / (t_1 + sqrt(y))))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + y));
double tmp;
if (t <= 2.1e+17) {
tmp = (1.0 + (t_1 - Math.sqrt(y))) + (1.0 + (1.0 / (Math.sqrt((1.0 + t)) + Math.sqrt(t))));
} else {
tmp = (Math.sqrt((1.0 + z)) - Math.sqrt(z)) + (1.0 + (1.0 / (t_1 + Math.sqrt(y))));
}
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 t <= 2.1e+17: tmp = (1.0 + (t_1 - math.sqrt(y))) + (1.0 + (1.0 / (math.sqrt((1.0 + t)) + math.sqrt(t)))) else: tmp = (math.sqrt((1.0 + z)) - math.sqrt(z)) + (1.0 + (1.0 / (t_1 + math.sqrt(y)))) 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 (t <= 2.1e+17) tmp = Float64(Float64(1.0 + Float64(t_1 - sqrt(y))) + Float64(1.0 + Float64(1.0 / Float64(sqrt(Float64(1.0 + t)) + sqrt(t))))); else tmp = Float64(Float64(sqrt(Float64(1.0 + z)) - sqrt(z)) + Float64(1.0 + Float64(1.0 / Float64(t_1 + sqrt(y))))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + y));
tmp = 0.0;
if (t <= 2.1e+17)
tmp = (1.0 + (t_1 - sqrt(y))) + (1.0 + (1.0 / (sqrt((1.0 + t)) + sqrt(t))));
else
tmp = (sqrt((1.0 + z)) - sqrt(z)) + (1.0 + (1.0 / (t_1 + sqrt(y))));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t, 2.1e+17], N[(N[(1.0 + N[(t$95$1 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 + N[(1.0 / N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] + N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] + N[(1.0 + N[(1.0 / N[(t$95$1 + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + y}\\
\mathbf{if}\;t \leq 2.1 \cdot 10^{+17}:\\
\;\;\;\;\left(1 + \left(t\_1 - \sqrt{y}\right)\right) + \left(1 + \frac{1}{\sqrt{1 + t} + \sqrt{t}}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(1 + \frac{1}{t\_1 + \sqrt{y}}\right)\\
\end{array}
\end{array}
if t < 2.1e17Initial program 96.3%
associate-+l+96.3%
+-commutative96.3%
+-commutative96.3%
+-commutative96.3%
Simplified96.3%
Taylor expanded in x around 0 58.5%
Taylor expanded in z around 0 40.3%
associate--l+40.3%
Simplified40.3%
flip--58.6%
add-sqr-sqrt58.8%
+-commutative58.8%
add-sqr-sqrt59.1%
+-commutative59.1%
Applied egg-rr40.6%
+-commutative59.1%
associate--l+59.4%
+-inverses59.4%
metadata-eval59.4%
+-commutative59.4%
+-commutative59.4%
Simplified40.8%
if 2.1e17 < t Initial program 88.7%
associate-+l+88.7%
+-commutative88.7%
+-commutative88.7%
+-commutative88.7%
Simplified88.7%
flip--88.7%
add-sqr-sqrt70.7%
add-sqr-sqrt89.0%
Applied egg-rr89.0%
associate--l+90.6%
+-inverses90.6%
metadata-eval90.6%
Simplified90.6%
Taylor expanded in t around inf 90.6%
Taylor expanded in x around 0 56.8%
Final simplification48.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 z))))
(if (<= t 64000000000000.0)
(+ 2.0 (+ t_1 (- (sqrt (+ 1.0 t)) (+ (sqrt z) (sqrt t)))))
(+ (- t_1 (sqrt z)) (+ 1.0 (/ 1.0 (+ (sqrt (+ 1.0 y)) (sqrt y))))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + z));
double tmp;
if (t <= 64000000000000.0) {
tmp = 2.0 + (t_1 + (sqrt((1.0 + t)) - (sqrt(z) + sqrt(t))));
} else {
tmp = (t_1 - sqrt(z)) + (1.0 + (1.0 / (sqrt((1.0 + y)) + sqrt(y))));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = sqrt((1.0d0 + z))
if (t <= 64000000000000.0d0) then
tmp = 2.0d0 + (t_1 + (sqrt((1.0d0 + t)) - (sqrt(z) + sqrt(t))))
else
tmp = (t_1 - sqrt(z)) + (1.0d0 + (1.0d0 / (sqrt((1.0d0 + y)) + sqrt(y))))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + z));
double tmp;
if (t <= 64000000000000.0) {
tmp = 2.0 + (t_1 + (Math.sqrt((1.0 + t)) - (Math.sqrt(z) + Math.sqrt(t))));
} else {
tmp = (t_1 - Math.sqrt(z)) + (1.0 + (1.0 / (Math.sqrt((1.0 + y)) + Math.sqrt(y))));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + z)) tmp = 0 if t <= 64000000000000.0: tmp = 2.0 + (t_1 + (math.sqrt((1.0 + t)) - (math.sqrt(z) + math.sqrt(t)))) else: tmp = (t_1 - math.sqrt(z)) + (1.0 + (1.0 / (math.sqrt((1.0 + y)) + math.sqrt(y)))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(1.0 + z)) tmp = 0.0 if (t <= 64000000000000.0) tmp = Float64(2.0 + Float64(t_1 + Float64(sqrt(Float64(1.0 + t)) - Float64(sqrt(z) + sqrt(t))))); else tmp = Float64(Float64(t_1 - sqrt(z)) + Float64(1.0 + Float64(1.0 / Float64(sqrt(Float64(1.0 + y)) + sqrt(y))))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + z));
tmp = 0.0;
if (t <= 64000000000000.0)
tmp = 2.0 + (t_1 + (sqrt((1.0 + t)) - (sqrt(z) + sqrt(t))));
else
tmp = (t_1 - sqrt(z)) + (1.0 + (1.0 / (sqrt((1.0 + y)) + sqrt(y))));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t, 64000000000000.0], N[(2.0 + N[(t$95$1 + N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[(N[Sqrt[z], $MachinePrecision] + N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(t$95$1 - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] + N[(1.0 + N[(1.0 / N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + z}\\
\mathbf{if}\;t \leq 64000000000000:\\
\;\;\;\;2 + \left(t\_1 + \left(\sqrt{1 + t} - \left(\sqrt{z} + \sqrt{t}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(t\_1 - \sqrt{z}\right) + \left(1 + \frac{1}{\sqrt{1 + y} + \sqrt{y}}\right)\\
\end{array}
\end{array}
if t < 6.4e13Initial program 97.3%
+-commutative97.3%
associate-+r+97.3%
associate-+r-79.3%
associate-+l-57.0%
associate-+r-52.8%
Simplified42.6%
Taylor expanded in x around 0 21.1%
Taylor expanded in y around 0 24.8%
associate--l+42.2%
+-commutative42.2%
associate--l+42.2%
+-commutative42.2%
Simplified42.2%
if 6.4e13 < t Initial program 88.0%
associate-+l+88.0%
+-commutative88.0%
+-commutative88.0%
+-commutative88.0%
Simplified88.0%
flip--87.9%
add-sqr-sqrt70.1%
add-sqr-sqrt88.2%
Applied egg-rr88.2%
associate--l+89.7%
+-inverses89.7%
metadata-eval89.7%
Simplified89.7%
Taylor expanded in t around inf 89.7%
Taylor expanded in x around 0 56.7%
Final simplification49.4%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ 1.0 z))))
(if (<= t 2.1e+14)
(+ 2.0 (+ t_1 (- (sqrt (+ 1.0 t)) (+ (sqrt z) (sqrt t)))))
(+ (+ 1.0 (- (sqrt (+ 1.0 y)) (sqrt y))) (- t_1 (sqrt z))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + z));
double tmp;
if (t <= 2.1e+14) {
tmp = 2.0 + (t_1 + (sqrt((1.0 + t)) - (sqrt(z) + sqrt(t))));
} else {
tmp = (1.0 + (sqrt((1.0 + y)) - sqrt(y))) + (t_1 - sqrt(z));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = sqrt((1.0d0 + z))
if (t <= 2.1d+14) then
tmp = 2.0d0 + (t_1 + (sqrt((1.0d0 + t)) - (sqrt(z) + sqrt(t))))
else
tmp = (1.0d0 + (sqrt((1.0d0 + y)) - sqrt(y))) + (t_1 - sqrt(z))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + z));
double tmp;
if (t <= 2.1e+14) {
tmp = 2.0 + (t_1 + (Math.sqrt((1.0 + t)) - (Math.sqrt(z) + Math.sqrt(t))));
} else {
tmp = (1.0 + (Math.sqrt((1.0 + y)) - Math.sqrt(y))) + (t_1 - Math.sqrt(z));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + z)) tmp = 0 if t <= 2.1e+14: tmp = 2.0 + (t_1 + (math.sqrt((1.0 + t)) - (math.sqrt(z) + math.sqrt(t)))) else: tmp = (1.0 + (math.sqrt((1.0 + y)) - math.sqrt(y))) + (t_1 - math.sqrt(z)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(1.0 + z)) tmp = 0.0 if (t <= 2.1e+14) tmp = Float64(2.0 + Float64(t_1 + Float64(sqrt(Float64(1.0 + t)) - Float64(sqrt(z) + sqrt(t))))); else tmp = Float64(Float64(1.0 + Float64(sqrt(Float64(1.0 + y)) - sqrt(y))) + Float64(t_1 - sqrt(z))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + z));
tmp = 0.0;
if (t <= 2.1e+14)
tmp = 2.0 + (t_1 + (sqrt((1.0 + t)) - (sqrt(z) + sqrt(t))));
else
tmp = (1.0 + (sqrt((1.0 + y)) - sqrt(y))) + (t_1 - sqrt(z));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t, 2.1e+14], N[(2.0 + N[(t$95$1 + N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[(N[Sqrt[z], $MachinePrecision] + N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 + N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $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}\\
\mathbf{if}\;t \leq 2.1 \cdot 10^{+14}:\\
\;\;\;\;2 + \left(t\_1 + \left(\sqrt{1 + t} - \left(\sqrt{z} + \sqrt{t}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(1 + \left(\sqrt{1 + y} - \sqrt{y}\right)\right) + \left(t\_1 - \sqrt{z}\right)\\
\end{array}
\end{array}
if t < 2.1e14Initial program 97.3%
+-commutative97.3%
associate-+r+97.3%
associate-+r-79.3%
associate-+l-57.0%
associate-+r-52.8%
Simplified42.6%
Taylor expanded in x around 0 21.1%
Taylor expanded in y around 0 24.8%
associate--l+42.2%
+-commutative42.2%
associate--l+42.2%
+-commutative42.2%
Simplified42.2%
if 2.1e14 < t Initial program 88.0%
associate-+l+88.0%
+-commutative88.0%
+-commutative88.0%
+-commutative88.0%
Simplified88.0%
Taylor expanded in x around 0 56.2%
Taylor expanded in t around inf 56.1%
Final simplification49.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 3.05e-24)
(+ (- (sqrt (+ 1.0 t)) (sqrt t)) 3.0)
(if (<= z 1020000000.0)
(+ 1.0 (+ (sqrt (+ 1.0 z)) (- 1.0 (+ (sqrt y) (sqrt z)))))
(if (or (<= z 4e+223) (not (<= z 2.8e+257)))
(+ 1.0 (- (sqrt (+ 1.0 y)) (sqrt y)))
(/ 1.0 (+ (sqrt (+ 1.0 x)) (sqrt x)))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (z <= 3.05e-24) {
tmp = (sqrt((1.0 + t)) - sqrt(t)) + 3.0;
} else if (z <= 1020000000.0) {
tmp = 1.0 + (sqrt((1.0 + z)) + (1.0 - (sqrt(y) + sqrt(z))));
} else if ((z <= 4e+223) || !(z <= 2.8e+257)) {
tmp = 1.0 + (sqrt((1.0 + y)) - sqrt(y));
} else {
tmp = 1.0 / (sqrt((1.0 + x)) + sqrt(x));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (z <= 3.05d-24) then
tmp = (sqrt((1.0d0 + t)) - sqrt(t)) + 3.0d0
else if (z <= 1020000000.0d0) then
tmp = 1.0d0 + (sqrt((1.0d0 + z)) + (1.0d0 - (sqrt(y) + sqrt(z))))
else if ((z <= 4d+223) .or. (.not. (z <= 2.8d+257))) then
tmp = 1.0d0 + (sqrt((1.0d0 + y)) - sqrt(y))
else
tmp = 1.0d0 / (sqrt((1.0d0 + x)) + sqrt(x))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= 3.05e-24) {
tmp = (Math.sqrt((1.0 + t)) - Math.sqrt(t)) + 3.0;
} else if (z <= 1020000000.0) {
tmp = 1.0 + (Math.sqrt((1.0 + z)) + (1.0 - (Math.sqrt(y) + Math.sqrt(z))));
} else if ((z <= 4e+223) || !(z <= 2.8e+257)) {
tmp = 1.0 + (Math.sqrt((1.0 + y)) - Math.sqrt(y));
} else {
tmp = 1.0 / (Math.sqrt((1.0 + x)) + Math.sqrt(x));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if z <= 3.05e-24: tmp = (math.sqrt((1.0 + t)) - math.sqrt(t)) + 3.0 elif z <= 1020000000.0: tmp = 1.0 + (math.sqrt((1.0 + z)) + (1.0 - (math.sqrt(y) + math.sqrt(z)))) elif (z <= 4e+223) or not (z <= 2.8e+257): tmp = 1.0 + (math.sqrt((1.0 + y)) - math.sqrt(y)) else: tmp = 1.0 / (math.sqrt((1.0 + x)) + math.sqrt(x)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (z <= 3.05e-24) tmp = Float64(Float64(sqrt(Float64(1.0 + t)) - sqrt(t)) + 3.0); elseif (z <= 1020000000.0) tmp = Float64(1.0 + Float64(sqrt(Float64(1.0 + z)) + Float64(1.0 - Float64(sqrt(y) + sqrt(z))))); elseif ((z <= 4e+223) || !(z <= 2.8e+257)) tmp = Float64(1.0 + Float64(sqrt(Float64(1.0 + y)) - sqrt(y))); else tmp = Float64(1.0 / Float64(sqrt(Float64(1.0 + x)) + sqrt(x))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (z <= 3.05e-24)
tmp = (sqrt((1.0 + t)) - sqrt(t)) + 3.0;
elseif (z <= 1020000000.0)
tmp = 1.0 + (sqrt((1.0 + z)) + (1.0 - (sqrt(y) + sqrt(z))));
elseif ((z <= 4e+223) || ~((z <= 2.8e+257)))
tmp = 1.0 + (sqrt((1.0 + y)) - sqrt(y));
else
tmp = 1.0 / (sqrt((1.0 + x)) + sqrt(x));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[z, 3.05e-24], N[(N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision] + 3.0), $MachinePrecision], If[LessEqual[z, 1020000000.0], N[(1.0 + N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] + N[(1.0 - N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[z, 4e+223], N[Not[LessEqual[z, 2.8e+257]], $MachinePrecision]], N[(1.0 + N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq 3.05 \cdot 10^{-24}:\\
\;\;\;\;\left(\sqrt{1 + t} - \sqrt{t}\right) + 3\\
\mathbf{elif}\;z \leq 1020000000:\\
\;\;\;\;1 + \left(\sqrt{1 + z} + \left(1 - \left(\sqrt{y} + \sqrt{z}\right)\right)\right)\\
\mathbf{elif}\;z \leq 4 \cdot 10^{+223} \lor \neg \left(z \leq 2.8 \cdot 10^{+257}\right):\\
\;\;\;\;1 + \left(\sqrt{1 + y} - \sqrt{y}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{1 + x} + \sqrt{x}}\\
\end{array}
\end{array}
if z < 3.05000000000000018e-24Initial program 97.6%
associate-+l+97.6%
+-commutative97.6%
+-commutative97.6%
+-commutative97.6%
Simplified97.6%
Taylor expanded in x around 0 59.2%
Taylor expanded in z around 0 56.3%
associate--l+59.2%
Simplified59.2%
Taylor expanded in y around 0 23.5%
associate--l+39.6%
Simplified39.6%
if 3.05000000000000018e-24 < z < 1.02e9Initial program 90.8%
+-commutative90.8%
associate-+r+90.8%
associate-+r-64.8%
associate-+l-56.2%
associate-+r-39.5%
Simplified39.6%
Taylor expanded in t around inf 6.9%
associate--l+13.7%
associate--l+13.7%
+-commutative13.7%
associate-+r+13.7%
Simplified13.7%
Taylor expanded in x around 0 19.6%
associate--l+34.3%
+-commutative34.3%
+-commutative34.3%
associate--l+28.5%
+-commutative28.5%
Simplified28.5%
Taylor expanded in y around 0 16.3%
if 1.02e9 < z < 4.00000000000000019e223 or 2.7999999999999998e257 < z Initial program 88.6%
+-commutative88.6%
associate-+r+88.6%
associate-+r-68.0%
associate-+l-55.3%
associate-+r-55.0%
Simplified37.0%
Taylor expanded in t around inf 5.0%
associate--l+21.8%
associate--l+25.3%
+-commutative25.3%
associate-+r+25.3%
Simplified25.3%
Taylor expanded in z around inf 32.3%
Taylor expanded in x around 0 29.9%
associate-+r-53.0%
Simplified53.0%
if 4.00000000000000019e223 < z < 2.7999999999999998e257Initial program 73.8%
+-commutative73.8%
associate-+r+73.8%
associate-+r-65.0%
associate-+l-47.4%
associate-+r-47.4%
Simplified11.1%
Taylor expanded in t around inf 3.3%
associate--l+19.6%
associate--l+20.5%
+-commutative20.5%
associate-+r+20.7%
Simplified20.7%
Taylor expanded in z around inf 19.9%
Taylor expanded in y around inf 18.8%
flip--18.8%
add-sqr-sqrt18.3%
add-sqr-sqrt18.8%
Applied egg-rr18.8%
associate--l+25.4%
+-inverses25.4%
metadata-eval25.4%
+-commutative25.4%
Simplified25.4%
Final simplification43.7%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(if (<= z 3e-24)
(+ (- (sqrt (+ 1.0 t)) (sqrt t)) 3.0)
(if (<= z 7200000000.0)
(+ (sqrt (+ 1.0 z)) (- 2.0 (sqrt z)))
(if (or (<= z 4e+223) (not (<= z 2.8e+257)))
(+ 1.0 (- (sqrt (+ 1.0 y)) (sqrt y)))
(/ 1.0 (+ (sqrt (+ 1.0 x)) (sqrt x)))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (z <= 3e-24) {
tmp = (sqrt((1.0 + t)) - sqrt(t)) + 3.0;
} else if (z <= 7200000000.0) {
tmp = sqrt((1.0 + z)) + (2.0 - sqrt(z));
} else if ((z <= 4e+223) || !(z <= 2.8e+257)) {
tmp = 1.0 + (sqrt((1.0 + y)) - sqrt(y));
} else {
tmp = 1.0 / (sqrt((1.0 + x)) + sqrt(x));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (z <= 3d-24) then
tmp = (sqrt((1.0d0 + t)) - sqrt(t)) + 3.0d0
else if (z <= 7200000000.0d0) then
tmp = sqrt((1.0d0 + z)) + (2.0d0 - sqrt(z))
else if ((z <= 4d+223) .or. (.not. (z <= 2.8d+257))) then
tmp = 1.0d0 + (sqrt((1.0d0 + y)) - sqrt(y))
else
tmp = 1.0d0 / (sqrt((1.0d0 + x)) + sqrt(x))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= 3e-24) {
tmp = (Math.sqrt((1.0 + t)) - Math.sqrt(t)) + 3.0;
} else if (z <= 7200000000.0) {
tmp = Math.sqrt((1.0 + z)) + (2.0 - Math.sqrt(z));
} else if ((z <= 4e+223) || !(z <= 2.8e+257)) {
tmp = 1.0 + (Math.sqrt((1.0 + y)) - Math.sqrt(y));
} else {
tmp = 1.0 / (Math.sqrt((1.0 + x)) + Math.sqrt(x));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if z <= 3e-24: tmp = (math.sqrt((1.0 + t)) - math.sqrt(t)) + 3.0 elif z <= 7200000000.0: tmp = math.sqrt((1.0 + z)) + (2.0 - math.sqrt(z)) elif (z <= 4e+223) or not (z <= 2.8e+257): tmp = 1.0 + (math.sqrt((1.0 + y)) - math.sqrt(y)) else: tmp = 1.0 / (math.sqrt((1.0 + x)) + math.sqrt(x)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (z <= 3e-24) tmp = Float64(Float64(sqrt(Float64(1.0 + t)) - sqrt(t)) + 3.0); elseif (z <= 7200000000.0) tmp = Float64(sqrt(Float64(1.0 + z)) + Float64(2.0 - sqrt(z))); elseif ((z <= 4e+223) || !(z <= 2.8e+257)) tmp = Float64(1.0 + Float64(sqrt(Float64(1.0 + y)) - sqrt(y))); else tmp = Float64(1.0 / Float64(sqrt(Float64(1.0 + x)) + sqrt(x))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (z <= 3e-24)
tmp = (sqrt((1.0 + t)) - sqrt(t)) + 3.0;
elseif (z <= 7200000000.0)
tmp = sqrt((1.0 + z)) + (2.0 - sqrt(z));
elseif ((z <= 4e+223) || ~((z <= 2.8e+257)))
tmp = 1.0 + (sqrt((1.0 + y)) - sqrt(y));
else
tmp = 1.0 / (sqrt((1.0 + x)) + sqrt(x));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[z, 3e-24], N[(N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision] + 3.0), $MachinePrecision], If[LessEqual[z, 7200000000.0], N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] + N[(2.0 - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[z, 4e+223], N[Not[LessEqual[z, 2.8e+257]], $MachinePrecision]], N[(1.0 + N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq 3 \cdot 10^{-24}:\\
\;\;\;\;\left(\sqrt{1 + t} - \sqrt{t}\right) + 3\\
\mathbf{elif}\;z \leq 7200000000:\\
\;\;\;\;\sqrt{1 + z} + \left(2 - \sqrt{z}\right)\\
\mathbf{elif}\;z \leq 4 \cdot 10^{+223} \lor \neg \left(z \leq 2.8 \cdot 10^{+257}\right):\\
\;\;\;\;1 + \left(\sqrt{1 + y} - \sqrt{y}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{1 + x} + \sqrt{x}}\\
\end{array}
\end{array}
if z < 2.99999999999999995e-24Initial program 97.6%
associate-+l+97.6%
+-commutative97.6%
+-commutative97.6%
+-commutative97.6%
Simplified97.6%
Taylor expanded in x around 0 59.2%
Taylor expanded in z around 0 56.3%
associate--l+59.2%
Simplified59.2%
Taylor expanded in y around 0 23.5%
associate--l+39.6%
Simplified39.6%
if 2.99999999999999995e-24 < z < 7.2e9Initial program 90.8%
+-commutative90.8%
associate-+r+90.8%
associate-+r-64.8%
associate-+l-56.2%
associate-+r-39.5%
Simplified39.6%
Taylor expanded in t around inf 6.9%
associate--l+13.7%
associate--l+13.7%
+-commutative13.7%
associate-+r+13.7%
Simplified13.7%
Taylor expanded in x around 0 19.6%
associate--l+34.3%
+-commutative34.3%
+-commutative34.3%
associate--l+28.5%
+-commutative28.5%
Simplified28.5%
Taylor expanded in y around 0 39.2%
+-commutative39.2%
associate--l+39.4%
Simplified39.4%
if 7.2e9 < z < 4.00000000000000019e223 or 2.7999999999999998e257 < z Initial program 88.6%
+-commutative88.6%
associate-+r+88.6%
associate-+r-68.0%
associate-+l-55.3%
associate-+r-55.0%
Simplified37.0%
Taylor expanded in t around inf 5.0%
associate--l+21.8%
associate--l+25.3%
+-commutative25.3%
associate-+r+25.3%
Simplified25.3%
Taylor expanded in z around inf 32.3%
Taylor expanded in x around 0 29.9%
associate-+r-53.0%
Simplified53.0%
if 4.00000000000000019e223 < z < 2.7999999999999998e257Initial program 73.8%
+-commutative73.8%
associate-+r+73.8%
associate-+r-65.0%
associate-+l-47.4%
associate-+r-47.4%
Simplified11.1%
Taylor expanded in t around inf 3.3%
associate--l+19.6%
associate--l+20.5%
+-commutative20.5%
associate-+r+20.7%
Simplified20.7%
Taylor expanded in z around inf 19.9%
Taylor expanded in y around inf 18.8%
flip--18.8%
add-sqr-sqrt18.3%
add-sqr-sqrt18.8%
Applied egg-rr18.8%
associate--l+25.4%
+-inverses25.4%
metadata-eval25.4%
+-commutative25.4%
Simplified25.4%
Final simplification44.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 (<= z 4e-24)
(+ (- (sqrt (+ 1.0 t)) (sqrt t)) 3.0)
(if (<= z 1200000000.0)
(+ (sqrt (+ 1.0 z)) (- 2.0 (sqrt z)))
(+ 1.0 (- (sqrt (+ 1.0 y)) (sqrt y))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (z <= 4e-24) {
tmp = (sqrt((1.0 + t)) - sqrt(t)) + 3.0;
} else if (z <= 1200000000.0) {
tmp = sqrt((1.0 + z)) + (2.0 - sqrt(z));
} else {
tmp = 1.0 + (sqrt((1.0 + y)) - sqrt(y));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (z <= 4d-24) then
tmp = (sqrt((1.0d0 + t)) - sqrt(t)) + 3.0d0
else if (z <= 1200000000.0d0) then
tmp = sqrt((1.0d0 + z)) + (2.0d0 - sqrt(z))
else
tmp = 1.0d0 + (sqrt((1.0d0 + y)) - sqrt(y))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= 4e-24) {
tmp = (Math.sqrt((1.0 + t)) - Math.sqrt(t)) + 3.0;
} else if (z <= 1200000000.0) {
tmp = Math.sqrt((1.0 + z)) + (2.0 - Math.sqrt(z));
} else {
tmp = 1.0 + (Math.sqrt((1.0 + y)) - Math.sqrt(y));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if z <= 4e-24: tmp = (math.sqrt((1.0 + t)) - math.sqrt(t)) + 3.0 elif z <= 1200000000.0: tmp = math.sqrt((1.0 + z)) + (2.0 - math.sqrt(z)) else: tmp = 1.0 + (math.sqrt((1.0 + y)) - math.sqrt(y)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (z <= 4e-24) tmp = Float64(Float64(sqrt(Float64(1.0 + t)) - sqrt(t)) + 3.0); elseif (z <= 1200000000.0) tmp = Float64(sqrt(Float64(1.0 + z)) + Float64(2.0 - sqrt(z))); else tmp = Float64(1.0 + Float64(sqrt(Float64(1.0 + y)) - sqrt(y))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (z <= 4e-24)
tmp = (sqrt((1.0 + t)) - sqrt(t)) + 3.0;
elseif (z <= 1200000000.0)
tmp = sqrt((1.0 + z)) + (2.0 - sqrt(z));
else
tmp = 1.0 + (sqrt((1.0 + y)) - sqrt(y));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[z, 4e-24], N[(N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision] + 3.0), $MachinePrecision], If[LessEqual[z, 1200000000.0], N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] + N[(2.0 - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq 4 \cdot 10^{-24}:\\
\;\;\;\;\left(\sqrt{1 + t} - \sqrt{t}\right) + 3\\
\mathbf{elif}\;z \leq 1200000000:\\
\;\;\;\;\sqrt{1 + z} + \left(2 - \sqrt{z}\right)\\
\mathbf{else}:\\
\;\;\;\;1 + \left(\sqrt{1 + y} - \sqrt{y}\right)\\
\end{array}
\end{array}
if z < 3.99999999999999969e-24Initial program 97.6%
associate-+l+97.6%
+-commutative97.6%
+-commutative97.6%
+-commutative97.6%
Simplified97.6%
Taylor expanded in x around 0 59.2%
Taylor expanded in z around 0 56.3%
associate--l+59.2%
Simplified59.2%
Taylor expanded in y around 0 23.5%
associate--l+39.6%
Simplified39.6%
if 3.99999999999999969e-24 < z < 1.2e9Initial program 90.8%
+-commutative90.8%
associate-+r+90.8%
associate-+r-64.8%
associate-+l-56.2%
associate-+r-39.5%
Simplified39.6%
Taylor expanded in t around inf 6.9%
associate--l+13.7%
associate--l+13.7%
+-commutative13.7%
associate-+r+13.7%
Simplified13.7%
Taylor expanded in x around 0 19.6%
associate--l+34.3%
+-commutative34.3%
+-commutative34.3%
associate--l+28.5%
+-commutative28.5%
Simplified28.5%
Taylor expanded in y around 0 39.2%
+-commutative39.2%
associate--l+39.4%
Simplified39.4%
if 1.2e9 < z Initial program 87.2%
+-commutative87.2%
associate-+r+87.2%
associate-+r-67.7%
associate-+l-54.5%
associate-+r-54.3%
Simplified34.5%
Taylor expanded in t around inf 4.8%
associate--l+21.6%
associate--l+24.8%
+-commutative24.8%
associate-+r+24.8%
Simplified24.8%
Taylor expanded in z around inf 31.1%
Taylor expanded in x around 0 28.2%
associate-+r-51.6%
Simplified51.6%
Final simplification45.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 0.3) (+ (- (sqrt (+ 1.0 t)) (sqrt t)) 3.0) (+ 1.0 (- (sqrt (+ 1.0 y)) (sqrt y)))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (z <= 0.3) {
tmp = (sqrt((1.0 + t)) - sqrt(t)) + 3.0;
} else {
tmp = 1.0 + (sqrt((1.0 + y)) - sqrt(y));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (z <= 0.3d0) then
tmp = (sqrt((1.0d0 + t)) - sqrt(t)) + 3.0d0
else
tmp = 1.0d0 + (sqrt((1.0d0 + y)) - sqrt(y))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= 0.3) {
tmp = (Math.sqrt((1.0 + t)) - Math.sqrt(t)) + 3.0;
} else {
tmp = 1.0 + (Math.sqrt((1.0 + y)) - Math.sqrt(y));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if z <= 0.3: tmp = (math.sqrt((1.0 + t)) - math.sqrt(t)) + 3.0 else: tmp = 1.0 + (math.sqrt((1.0 + y)) - math.sqrt(y)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (z <= 0.3) tmp = Float64(Float64(sqrt(Float64(1.0 + t)) - sqrt(t)) + 3.0); else tmp = Float64(1.0 + Float64(sqrt(Float64(1.0 + y)) - sqrt(y))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (z <= 0.3)
tmp = (sqrt((1.0 + t)) - sqrt(t)) + 3.0;
else
tmp = 1.0 + (sqrt((1.0 + y)) - sqrt(y));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[z, 0.3], N[(N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision] + 3.0), $MachinePrecision], N[(1.0 + N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq 0.3:\\
\;\;\;\;\left(\sqrt{1 + t} - \sqrt{t}\right) + 3\\
\mathbf{else}:\\
\;\;\;\;1 + \left(\sqrt{1 + y} - \sqrt{y}\right)\\
\end{array}
\end{array}
if z < 0.299999999999999989Initial program 97.3%
associate-+l+97.2%
+-commutative97.2%
+-commutative97.2%
+-commutative97.2%
Simplified97.2%
Taylor expanded in x around 0 59.3%
Taylor expanded in z around 0 55.3%
associate--l+58.0%
Simplified58.0%
Taylor expanded in y around 0 23.4%
associate--l+39.0%
Simplified39.0%
if 0.299999999999999989 < z Initial program 87.2%
+-commutative87.2%
associate-+r+87.2%
associate-+r-67.5%
associate-+l-53.8%
associate-+r-53.4%
Simplified34.0%
Taylor expanded in t around inf 4.8%
associate--l+21.6%
associate--l+24.7%
+-commutative24.7%
associate-+r+24.7%
Simplified24.7%
Taylor expanded in z around inf 30.9%
Taylor expanded in x around 0 27.8%
associate-+r-51.4%
Simplified51.4%
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 (if (<= y 6.5) (+ 2.0 (- (* y 0.5) (sqrt y))) (- (sqrt (+ 1.0 x)) (sqrt x))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 6.5) {
tmp = 2.0 + ((y * 0.5) - sqrt(y));
} else {
tmp = sqrt((1.0 + x)) - sqrt(x);
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= 6.5d0) then
tmp = 2.0d0 + ((y * 0.5d0) - sqrt(y))
else
tmp = sqrt((1.0d0 + x)) - sqrt(x)
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= 6.5) {
tmp = 2.0 + ((y * 0.5) - Math.sqrt(y));
} else {
tmp = Math.sqrt((1.0 + x)) - Math.sqrt(x);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if y <= 6.5: tmp = 2.0 + ((y * 0.5) - math.sqrt(y)) else: tmp = math.sqrt((1.0 + x)) - math.sqrt(x) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (y <= 6.5) tmp = Float64(2.0 + Float64(Float64(y * 0.5) - sqrt(y))); else tmp = Float64(sqrt(Float64(1.0 + x)) - sqrt(x)); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (y <= 6.5)
tmp = 2.0 + ((y * 0.5) - sqrt(y));
else
tmp = sqrt((1.0 + x)) - sqrt(x);
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[y, 6.5], N[(2.0 + N[(N[(y * 0.5), $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 6.5:\\
\;\;\;\;2 + \left(y \cdot 0.5 - \sqrt{y}\right)\\
\mathbf{else}:\\
\;\;\;\;\sqrt{1 + x} - \sqrt{x}\\
\end{array}
\end{array}
if y < 6.5Initial program 97.6%
+-commutative97.6%
associate-+r+97.7%
associate-+r-97.7%
associate-+l-97.7%
associate-+r-97.6%
Simplified80.0%
Taylor expanded in t around inf 20.7%
associate--l+24.4%
associate--l+31.1%
+-commutative31.1%
associate-+r+31.1%
Simplified31.1%
Taylor expanded in z around inf 22.4%
Taylor expanded in y around 0 21.6%
*-commutative21.6%
Simplified21.6%
Taylor expanded in x around 0 39.8%
associate--l+39.8%
Simplified39.8%
if 6.5 < y Initial program 87.9%
+-commutative87.9%
associate-+r+87.9%
associate-+r-51.5%
associate-+l-29.8%
associate-+r-9.5%
Simplified8.7%
Taylor expanded in t around inf 5.8%
associate--l+21.4%
associate--l+17.8%
+-commutative17.8%
associate-+r+17.9%
Simplified17.9%
Taylor expanded in z around inf 19.2%
Taylor expanded in y around inf 19.0%
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 (+ 1.0 (- (sqrt (+ 1.0 y)) (sqrt y))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
return 1.0 + (sqrt((1.0 + y)) - 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 = 1.0d0 + (sqrt((1.0d0 + y)) - sqrt(y))
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
return 1.0 + (Math.sqrt((1.0 + y)) - Math.sqrt(y));
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): return 1.0 + (math.sqrt((1.0 + y)) - math.sqrt(y))
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) return Float64(1.0 + Float64(sqrt(Float64(1.0 + y)) - sqrt(y))) end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp = code(x, y, z, t)
tmp = 1.0 + (sqrt((1.0 + y)) - sqrt(y));
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := N[(1.0 + N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
1 + \left(\sqrt{1 + y} - \sqrt{y}\right)
\end{array}
Initial program 92.6%
+-commutative92.6%
associate-+r+92.6%
associate-+r-73.9%
associate-+l-62.7%
associate-+r-52.2%
Simplified43.3%
Taylor expanded in t around inf 13.0%
associate--l+22.8%
associate--l+24.3%
+-commutative24.3%
associate-+r+24.3%
Simplified24.3%
Taylor expanded in z around inf 20.8%
Taylor expanded in x around 0 22.3%
associate-+r-43.3%
Simplified43.3%
Final simplification43.3%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= y 5.2) (+ 2.0 (- (* y 0.5) (sqrt y))) (- (+ 1.0 (* x 0.5)) (sqrt x))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 5.2) {
tmp = 2.0 + ((y * 0.5) - sqrt(y));
} else {
tmp = (1.0 + (x * 0.5)) - sqrt(x);
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= 5.2d0) then
tmp = 2.0d0 + ((y * 0.5d0) - sqrt(y))
else
tmp = (1.0d0 + (x * 0.5d0)) - sqrt(x)
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= 5.2) {
tmp = 2.0 + ((y * 0.5) - Math.sqrt(y));
} else {
tmp = (1.0 + (x * 0.5)) - Math.sqrt(x);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if y <= 5.2: tmp = 2.0 + ((y * 0.5) - math.sqrt(y)) else: tmp = (1.0 + (x * 0.5)) - math.sqrt(x) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (y <= 5.2) tmp = Float64(2.0 + Float64(Float64(y * 0.5) - sqrt(y))); else tmp = Float64(Float64(1.0 + Float64(x * 0.5)) - sqrt(x)); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (y <= 5.2)
tmp = 2.0 + ((y * 0.5) - sqrt(y));
else
tmp = (1.0 + (x * 0.5)) - sqrt(x);
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[y, 5.2], N[(2.0 + N[(N[(y * 0.5), $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 + N[(x * 0.5), $MachinePrecision]), $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 5.2:\\
\;\;\;\;2 + \left(y \cdot 0.5 - \sqrt{y}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(1 + x \cdot 0.5\right) - \sqrt{x}\\
\end{array}
\end{array}
if y < 5.20000000000000018Initial program 97.6%
+-commutative97.6%
associate-+r+97.7%
associate-+r-97.7%
associate-+l-97.7%
associate-+r-97.6%
Simplified80.0%
Taylor expanded in t around inf 20.7%
associate--l+24.4%
associate--l+31.1%
+-commutative31.1%
associate-+r+31.1%
Simplified31.1%
Taylor expanded in z around inf 22.4%
Taylor expanded in y around 0 21.6%
*-commutative21.6%
Simplified21.6%
Taylor expanded in x around 0 39.8%
associate--l+39.8%
Simplified39.8%
if 5.20000000000000018 < y Initial program 87.9%
+-commutative87.9%
associate-+r+87.9%
associate-+r-51.5%
associate-+l-29.8%
associate-+r-9.5%
Simplified8.7%
Taylor expanded in t around inf 5.8%
associate--l+21.4%
associate--l+17.8%
+-commutative17.8%
associate-+r+17.9%
Simplified17.9%
Taylor expanded in z around inf 19.2%
Taylor expanded in y around inf 19.0%
Taylor expanded in x around 0 19.2%
Final simplification29.2%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (+ 2.0 (- (* y 0.5) (sqrt y))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
return 2.0 + ((y * 0.5) - 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 = 2.0d0 + ((y * 0.5d0) - sqrt(y))
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
return 2.0 + ((y * 0.5) - Math.sqrt(y));
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): return 2.0 + ((y * 0.5) - math.sqrt(y))
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) return Float64(2.0 + Float64(Float64(y * 0.5) - sqrt(y))) end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp = code(x, y, z, t)
tmp = 2.0 + ((y * 0.5) - 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[(2.0 + N[(N[(y * 0.5), $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
2 + \left(y \cdot 0.5 - \sqrt{y}\right)
\end{array}
Initial program 92.6%
+-commutative92.6%
associate-+r+92.6%
associate-+r-73.9%
associate-+l-62.7%
associate-+r-52.2%
Simplified43.3%
Taylor expanded in t around inf 13.0%
associate--l+22.8%
associate--l+24.3%
+-commutative24.3%
associate-+r+24.3%
Simplified24.3%
Taylor expanded in z around inf 20.8%
Taylor expanded in y around 0 12.9%
*-commutative12.9%
Simplified12.9%
Taylor expanded in x around 0 21.8%
associate--l+21.8%
Simplified21.8%
Final simplification21.8%
(FPCore (x y z t)
:precision binary64
(+
(+
(+
(/ 1.0 (+ (sqrt (+ x 1.0)) (sqrt x)))
(/ 1.0 (+ (sqrt (+ y 1.0)) (sqrt y))))
(/ 1.0 (+ (sqrt (+ z 1.0)) (sqrt z))))
(- (sqrt (+ t 1.0)) (sqrt t))))
double code(double x, double y, double z, double t) {
return (((1.0 / (sqrt((x + 1.0)) + sqrt(x))) + (1.0 / (sqrt((y + 1.0)) + sqrt(y)))) + (1.0 / (sqrt((z + 1.0)) + sqrt(z)))) + (sqrt((t + 1.0)) - sqrt(t));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (((1.0d0 / (sqrt((x + 1.0d0)) + sqrt(x))) + (1.0d0 / (sqrt((y + 1.0d0)) + sqrt(y)))) + (1.0d0 / (sqrt((z + 1.0d0)) + sqrt(z)))) + (sqrt((t + 1.0d0)) - sqrt(t))
end function
public static double code(double x, double y, double z, double t) {
return (((1.0 / (Math.sqrt((x + 1.0)) + Math.sqrt(x))) + (1.0 / (Math.sqrt((y + 1.0)) + Math.sqrt(y)))) + (1.0 / (Math.sqrt((z + 1.0)) + Math.sqrt(z)))) + (Math.sqrt((t + 1.0)) - Math.sqrt(t));
}
def code(x, y, z, t): return (((1.0 / (math.sqrt((x + 1.0)) + math.sqrt(x))) + (1.0 / (math.sqrt((y + 1.0)) + math.sqrt(y)))) + (1.0 / (math.sqrt((z + 1.0)) + math.sqrt(z)))) + (math.sqrt((t + 1.0)) - math.sqrt(t))
function code(x, y, z, t) return Float64(Float64(Float64(Float64(1.0 / Float64(sqrt(Float64(x + 1.0)) + sqrt(x))) + Float64(1.0 / Float64(sqrt(Float64(y + 1.0)) + sqrt(y)))) + Float64(1.0 / Float64(sqrt(Float64(z + 1.0)) + sqrt(z)))) + Float64(sqrt(Float64(t + 1.0)) - sqrt(t))) end
function tmp = code(x, y, z, t) tmp = (((1.0 / (sqrt((x + 1.0)) + sqrt(x))) + (1.0 / (sqrt((y + 1.0)) + sqrt(y)))) + (1.0 / (sqrt((z + 1.0)) + sqrt(z)))) + (sqrt((t + 1.0)) - sqrt(t)); end
code[x_, y_, z_, t_] := N[(N[(N[(N[(1.0 / N[(N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[N[(z + 1.0), $MachinePrecision]], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(t + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\frac{1}{\sqrt{x + 1} + \sqrt{x}} + \frac{1}{\sqrt{y + 1} + \sqrt{y}}\right) + \frac{1}{\sqrt{z + 1} + \sqrt{z}}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)
\end{array}
herbie shell --seed 2024026
(FPCore (x y z t)
:name "Main:z from "
:precision binary64
:herbie-target
(+ (+ (+ (/ 1.0 (+ (sqrt (+ x 1.0)) (sqrt x))) (/ 1.0 (+ (sqrt (+ y 1.0)) (sqrt y)))) (/ 1.0 (+ (sqrt (+ z 1.0)) (sqrt z)))) (- (sqrt (+ t 1.0)) (sqrt t)))
(+ (+ (+ (- (sqrt (+ x 1.0)) (sqrt x)) (- (sqrt (+ y 1.0)) (sqrt y))) (- (sqrt (+ z 1.0)) (sqrt z))) (- (sqrt (+ t 1.0)) (sqrt t))))