
(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 25 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (+ (+ (+ (- (sqrt (+ x 1.0)) (sqrt x)) (- (sqrt (+ y 1.0)) (sqrt y))) (- (sqrt (+ z 1.0)) (sqrt z))) (- (sqrt (+ t 1.0)) (sqrt t))))
double code(double x, double y, double z, double t) {
return (((sqrt((x + 1.0)) - sqrt(x)) + (sqrt((y + 1.0)) - sqrt(y))) + (sqrt((z + 1.0)) - sqrt(z))) + (sqrt((t + 1.0)) - sqrt(t));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (((sqrt((x + 1.0d0)) - sqrt(x)) + (sqrt((y + 1.0d0)) - sqrt(y))) + (sqrt((z + 1.0d0)) - sqrt(z))) + (sqrt((t + 1.0d0)) - sqrt(t))
end function
public static double code(double x, double y, double z, double t) {
return (((Math.sqrt((x + 1.0)) - Math.sqrt(x)) + (Math.sqrt((y + 1.0)) - Math.sqrt(y))) + (Math.sqrt((z + 1.0)) - Math.sqrt(z))) + (Math.sqrt((t + 1.0)) - Math.sqrt(t));
}
def code(x, y, z, t): return (((math.sqrt((x + 1.0)) - math.sqrt(x)) + (math.sqrt((y + 1.0)) - math.sqrt(y))) + (math.sqrt((z + 1.0)) - math.sqrt(z))) + (math.sqrt((t + 1.0)) - math.sqrt(t))
function code(x, y, z, t) return Float64(Float64(Float64(Float64(sqrt(Float64(x + 1.0)) - sqrt(x)) + Float64(sqrt(Float64(y + 1.0)) - sqrt(y))) + Float64(sqrt(Float64(z + 1.0)) - sqrt(z))) + Float64(sqrt(Float64(t + 1.0)) - sqrt(t))) end
function tmp = code(x, y, z, t) tmp = (((sqrt((x + 1.0)) - sqrt(x)) + (sqrt((y + 1.0)) - sqrt(y))) + (sqrt((z + 1.0)) - sqrt(z))) + (sqrt((t + 1.0)) - sqrt(t)); end
code[x_, y_, z_, t_] := N[(N[(N[(N[(N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(z + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(t + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{y + 1} - \sqrt{y}\right)\right) + \left(\sqrt{z + 1} - \sqrt{z}\right)\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)
\end{array}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ 1.0 x)))
(t_2 (- (sqrt (+ y 1.0)) (sqrt y)))
(t_3 (sqrt (+ 1.0 z))))
(if (<= t_2 2e-6)
(+ (+ (/ 1.0 (+ (sqrt x) t_1)) (* 0.5 (sqrt (/ 1.0 y)))) (- t_3 (sqrt z)))
(+
(+ (- t_1 (sqrt x)) t_2)
(+ (/ 1.0 (+ t_3 (sqrt z))) (/ 1.0 (+ (sqrt t) (sqrt (+ 1.0 t)))))))))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((y + 1.0)) - sqrt(y);
double t_3 = sqrt((1.0 + z));
double tmp;
if (t_2 <= 2e-6) {
tmp = ((1.0 / (sqrt(x) + t_1)) + (0.5 * sqrt((1.0 / y)))) + (t_3 - sqrt(z));
} else {
tmp = ((t_1 - sqrt(x)) + t_2) + ((1.0 / (t_3 + sqrt(z))) + (1.0 / (sqrt(t) + sqrt((1.0 + 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 + x))
t_2 = sqrt((y + 1.0d0)) - sqrt(y)
t_3 = sqrt((1.0d0 + z))
if (t_2 <= 2d-6) then
tmp = ((1.0d0 / (sqrt(x) + t_1)) + (0.5d0 * sqrt((1.0d0 / y)))) + (t_3 - sqrt(z))
else
tmp = ((t_1 - sqrt(x)) + t_2) + ((1.0d0 / (t_3 + sqrt(z))) + (1.0d0 / (sqrt(t) + sqrt((1.0d0 + 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 + x));
double t_2 = Math.sqrt((y + 1.0)) - Math.sqrt(y);
double t_3 = Math.sqrt((1.0 + z));
double tmp;
if (t_2 <= 2e-6) {
tmp = ((1.0 / (Math.sqrt(x) + t_1)) + (0.5 * Math.sqrt((1.0 / y)))) + (t_3 - Math.sqrt(z));
} else {
tmp = ((t_1 - Math.sqrt(x)) + t_2) + ((1.0 / (t_3 + Math.sqrt(z))) + (1.0 / (Math.sqrt(t) + Math.sqrt((1.0 + t)))));
}
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((y + 1.0)) - math.sqrt(y) t_3 = math.sqrt((1.0 + z)) tmp = 0 if t_2 <= 2e-6: tmp = ((1.0 / (math.sqrt(x) + t_1)) + (0.5 * math.sqrt((1.0 / y)))) + (t_3 - math.sqrt(z)) else: tmp = ((t_1 - math.sqrt(x)) + t_2) + ((1.0 / (t_3 + math.sqrt(z))) + (1.0 / (math.sqrt(t) + math.sqrt((1.0 + t))))) 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 = Float64(sqrt(Float64(y + 1.0)) - sqrt(y)) t_3 = sqrt(Float64(1.0 + z)) tmp = 0.0 if (t_2 <= 2e-6) tmp = Float64(Float64(Float64(1.0 / Float64(sqrt(x) + t_1)) + Float64(0.5 * sqrt(Float64(1.0 / y)))) + Float64(t_3 - sqrt(z))); else tmp = Float64(Float64(Float64(t_1 - sqrt(x)) + t_2) + Float64(Float64(1.0 / Float64(t_3 + sqrt(z))) + Float64(1.0 / Float64(sqrt(t) + sqrt(Float64(1.0 + 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 + x));
t_2 = sqrt((y + 1.0)) - sqrt(y);
t_3 = sqrt((1.0 + z));
tmp = 0.0;
if (t_2 <= 2e-6)
tmp = ((1.0 / (sqrt(x) + t_1)) + (0.5 * sqrt((1.0 / y)))) + (t_3 - sqrt(z));
else
tmp = ((t_1 - sqrt(x)) + t_2) + ((1.0 / (t_3 + sqrt(z))) + (1.0 / (sqrt(t) + sqrt((1.0 + 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 + x), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t$95$2, 2e-6], N[(N[(N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision] + N[(0.5 * N[Sqrt[N[(1.0 / y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$3 - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(t$95$1 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + t$95$2), $MachinePrecision] + N[(N[(1.0 / N[(t$95$3 + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[t], $MachinePrecision] + N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + x}\\
t_2 := \sqrt{y + 1} - \sqrt{y}\\
t_3 := \sqrt{1 + z}\\
\mathbf{if}\;t\_2 \leq 2 \cdot 10^{-6}:\\
\;\;\;\;\left(\frac{1}{\sqrt{x} + t\_1} + 0.5 \cdot \sqrt{\frac{1}{y}}\right) + \left(t\_3 - \sqrt{z}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(t\_1 - \sqrt{x}\right) + t\_2\right) + \left(\frac{1}{t\_3 + \sqrt{z}} + \frac{1}{\sqrt{t} + \sqrt{1 + t}}\right)\\
\end{array}
\end{array}
if (-.f64 (sqrt.f64 (+.f64 y #s(literal 1 binary64))) (sqrt.f64 y)) < 1.99999999999999991e-6Initial program 85.3%
associate-+l+85.3%
sub-neg85.3%
sub-neg85.3%
+-commutative85.3%
+-commutative85.3%
+-commutative85.3%
Simplified85.3%
flip--85.6%
div-inv85.6%
add-sqr-sqrt63.1%
+-commutative63.1%
add-sqr-sqrt86.1%
+-commutative86.1%
Applied egg-rr86.1%
associate--l+89.4%
+-inverses89.4%
metadata-eval89.4%
*-lft-identity89.4%
+-commutative89.4%
Simplified89.4%
Taylor expanded in t around inf 46.8%
Taylor expanded in y around inf 50.2%
if 1.99999999999999991e-6 < (-.f64 (sqrt.f64 (+.f64 y #s(literal 1 binary64))) (sqrt.f64 y)) Initial program 98.1%
associate-+l+98.1%
sub-neg98.1%
sub-neg98.1%
+-commutative98.1%
+-commutative98.1%
+-commutative98.1%
Simplified98.1%
flip--98.1%
div-inv98.1%
add-sqr-sqrt72.5%
+-commutative72.5%
add-sqr-sqrt98.1%
associate--l+98.1%
Applied egg-rr98.1%
associate-*r/98.1%
*-rgt-identity98.1%
associate-+r-98.1%
+-commutative98.1%
associate-+r-98.6%
+-inverses98.6%
metadata-eval98.6%
+-commutative98.6%
Simplified98.6%
flip--98.8%
div-inv98.8%
add-sqr-sqrt76.0%
add-sqr-sqrt99.4%
associate--l+99.5%
Applied egg-rr99.5%
+-inverses99.5%
metadata-eval99.5%
*-lft-identity99.5%
+-commutative99.5%
Simplified99.5%
Final simplification76.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 (+ y 1.0)) (sqrt y))) (t_2 (sqrt (+ 1.0 z))))
(if (<= t_1 2e-6)
(+
(+ (/ 1.0 (+ (sqrt x) (sqrt (+ 1.0 x)))) (* 0.5 (sqrt (/ 1.0 y))))
(- t_2 (sqrt z)))
(+
(+ t_1 (- 1.0 (sqrt x)))
(+ (/ 1.0 (+ t_2 (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) {
double t_1 = sqrt((y + 1.0)) - sqrt(y);
double t_2 = sqrt((1.0 + z));
double tmp;
if (t_1 <= 2e-6) {
tmp = ((1.0 / (sqrt(x) + sqrt((1.0 + x)))) + (0.5 * sqrt((1.0 / y)))) + (t_2 - sqrt(z));
} else {
tmp = (t_1 + (1.0 - sqrt(x))) + ((1.0 / (t_2 + sqrt(z))) + (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) :: tmp
t_1 = sqrt((y + 1.0d0)) - sqrt(y)
t_2 = sqrt((1.0d0 + z))
if (t_1 <= 2d-6) then
tmp = ((1.0d0 / (sqrt(x) + sqrt((1.0d0 + x)))) + (0.5d0 * sqrt((1.0d0 / y)))) + (t_2 - sqrt(z))
else
tmp = (t_1 + (1.0d0 - sqrt(x))) + ((1.0d0 / (t_2 + sqrt(z))) + (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((y + 1.0)) - Math.sqrt(y);
double t_2 = Math.sqrt((1.0 + z));
double tmp;
if (t_1 <= 2e-6) {
tmp = ((1.0 / (Math.sqrt(x) + Math.sqrt((1.0 + x)))) + (0.5 * Math.sqrt((1.0 / y)))) + (t_2 - Math.sqrt(z));
} else {
tmp = (t_1 + (1.0 - Math.sqrt(x))) + ((1.0 / (t_2 + Math.sqrt(z))) + (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((y + 1.0)) - math.sqrt(y) t_2 = math.sqrt((1.0 + z)) tmp = 0 if t_1 <= 2e-6: tmp = ((1.0 / (math.sqrt(x) + math.sqrt((1.0 + x)))) + (0.5 * math.sqrt((1.0 / y)))) + (t_2 - math.sqrt(z)) else: tmp = (t_1 + (1.0 - math.sqrt(x))) + ((1.0 / (t_2 + math.sqrt(z))) + (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 = Float64(sqrt(Float64(y + 1.0)) - sqrt(y)) t_2 = sqrt(Float64(1.0 + z)) tmp = 0.0 if (t_1 <= 2e-6) tmp = Float64(Float64(Float64(1.0 / Float64(sqrt(x) + sqrt(Float64(1.0 + x)))) + Float64(0.5 * sqrt(Float64(1.0 / y)))) + Float64(t_2 - sqrt(z))); else tmp = Float64(Float64(t_1 + Float64(1.0 - sqrt(x))) + Float64(Float64(1.0 / Float64(t_2 + sqrt(z))) + 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((y + 1.0)) - sqrt(y);
t_2 = sqrt((1.0 + z));
tmp = 0.0;
if (t_1 <= 2e-6)
tmp = ((1.0 / (sqrt(x) + sqrt((1.0 + x)))) + (0.5 * sqrt((1.0 / y)))) + (t_2 - sqrt(z));
else
tmp = (t_1 + (1.0 - sqrt(x))) + ((1.0 / (t_2 + sqrt(z))) + (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[(N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t$95$1, 2e-6], N[(N[(N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(0.5 * N[Sqrt[N[(1.0 / y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$2 - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(t$95$1 + N[(1.0 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 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]), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{y + 1} - \sqrt{y}\\
t_2 := \sqrt{1 + z}\\
\mathbf{if}\;t\_1 \leq 2 \cdot 10^{-6}:\\
\;\;\;\;\left(\frac{1}{\sqrt{x} + \sqrt{1 + x}} + 0.5 \cdot \sqrt{\frac{1}{y}}\right) + \left(t\_2 - \sqrt{z}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(t\_1 + \left(1 - \sqrt{x}\right)\right) + \left(\frac{1}{t\_2 + \sqrt{z}} + \left(\sqrt{1 + t} - \sqrt{t}\right)\right)\\
\end{array}
\end{array}
if (-.f64 (sqrt.f64 (+.f64 y #s(literal 1 binary64))) (sqrt.f64 y)) < 1.99999999999999991e-6Initial program 85.3%
associate-+l+85.3%
sub-neg85.3%
sub-neg85.3%
+-commutative85.3%
+-commutative85.3%
+-commutative85.3%
Simplified85.3%
flip--85.6%
div-inv85.6%
add-sqr-sqrt63.1%
+-commutative63.1%
add-sqr-sqrt86.1%
+-commutative86.1%
Applied egg-rr86.1%
associate--l+89.4%
+-inverses89.4%
metadata-eval89.4%
*-lft-identity89.4%
+-commutative89.4%
Simplified89.4%
Taylor expanded in t around inf 46.8%
Taylor expanded in y around inf 50.2%
if 1.99999999999999991e-6 < (-.f64 (sqrt.f64 (+.f64 y #s(literal 1 binary64))) (sqrt.f64 y)) Initial program 98.1%
associate-+l+98.1%
sub-neg98.1%
sub-neg98.1%
+-commutative98.1%
+-commutative98.1%
+-commutative98.1%
Simplified98.1%
Taylor expanded in x around 0 54.4%
flip--98.8%
div-inv98.8%
add-sqr-sqrt76.0%
add-sqr-sqrt99.4%
associate--l+99.5%
Applied egg-rr55.1%
+-inverses99.5%
metadata-eval99.5%
*-lft-identity99.5%
+-commutative99.5%
Simplified55.1%
Final simplification52.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 z)) (sqrt z))))
(if (<= y 210000000.0)
(+
(+ (- (sqrt (+ y 1.0)) (sqrt y)) (- 1.0 (sqrt x)))
(+ t_1 (- (sqrt (+ 1.0 t)) (sqrt t))))
(+
(+ (/ 1.0 (+ (sqrt x) (sqrt (+ 1.0 x)))) (* 0.5 (sqrt (/ 1.0 y))))
t_1))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + z)) - sqrt(z);
double tmp;
if (y <= 210000000.0) {
tmp = ((sqrt((y + 1.0)) - sqrt(y)) + (1.0 - sqrt(x))) + (t_1 + (sqrt((1.0 + t)) - sqrt(t)));
} else {
tmp = ((1.0 / (sqrt(x) + sqrt((1.0 + x)))) + (0.5 * sqrt((1.0 / y)))) + t_1;
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = sqrt((1.0d0 + z)) - sqrt(z)
if (y <= 210000000.0d0) then
tmp = ((sqrt((y + 1.0d0)) - sqrt(y)) + (1.0d0 - sqrt(x))) + (t_1 + (sqrt((1.0d0 + t)) - sqrt(t)))
else
tmp = ((1.0d0 / (sqrt(x) + sqrt((1.0d0 + x)))) + (0.5d0 * sqrt((1.0d0 / y)))) + t_1
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + z)) - Math.sqrt(z);
double tmp;
if (y <= 210000000.0) {
tmp = ((Math.sqrt((y + 1.0)) - Math.sqrt(y)) + (1.0 - Math.sqrt(x))) + (t_1 + (Math.sqrt((1.0 + t)) - Math.sqrt(t)));
} else {
tmp = ((1.0 / (Math.sqrt(x) + Math.sqrt((1.0 + x)))) + (0.5 * Math.sqrt((1.0 / y)))) + t_1;
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + z)) - math.sqrt(z) tmp = 0 if y <= 210000000.0: tmp = ((math.sqrt((y + 1.0)) - math.sqrt(y)) + (1.0 - math.sqrt(x))) + (t_1 + (math.sqrt((1.0 + t)) - math.sqrt(t))) else: tmp = ((1.0 / (math.sqrt(x) + math.sqrt((1.0 + x)))) + (0.5 * math.sqrt((1.0 / y)))) + t_1 return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = Float64(sqrt(Float64(1.0 + z)) - sqrt(z)) tmp = 0.0 if (y <= 210000000.0) tmp = Float64(Float64(Float64(sqrt(Float64(y + 1.0)) - sqrt(y)) + Float64(1.0 - sqrt(x))) + Float64(t_1 + Float64(sqrt(Float64(1.0 + t)) - sqrt(t)))); else tmp = Float64(Float64(Float64(1.0 / Float64(sqrt(x) + sqrt(Float64(1.0 + x)))) + Float64(0.5 * sqrt(Float64(1.0 / y)))) + t_1); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + z)) - sqrt(z);
tmp = 0.0;
if (y <= 210000000.0)
tmp = ((sqrt((y + 1.0)) - sqrt(y)) + (1.0 - sqrt(x))) + (t_1 + (sqrt((1.0 + t)) - sqrt(t)));
else
tmp = ((1.0 / (sqrt(x) + sqrt((1.0 + x)))) + (0.5 * sqrt((1.0 / y)))) + t_1;
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 210000000.0], N[(N[(N[(N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision] + N[(1.0 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$1 + N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(0.5 * N[Sqrt[N[(1.0 / y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + z} - \sqrt{z}\\
\mathbf{if}\;y \leq 210000000:\\
\;\;\;\;\left(\left(\sqrt{y + 1} - \sqrt{y}\right) + \left(1 - \sqrt{x}\right)\right) + \left(t\_1 + \left(\sqrt{1 + t} - \sqrt{t}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{1}{\sqrt{x} + \sqrt{1 + x}} + 0.5 \cdot \sqrt{\frac{1}{y}}\right) + t\_1\\
\end{array}
\end{array}
if y < 2.1e8Initial program 98.1%
associate-+l+98.1%
sub-neg98.1%
sub-neg98.1%
+-commutative98.1%
+-commutative98.1%
+-commutative98.1%
Simplified98.1%
Taylor expanded in x around 0 54.4%
if 2.1e8 < y Initial program 85.3%
associate-+l+85.3%
sub-neg85.3%
sub-neg85.3%
+-commutative85.3%
+-commutative85.3%
+-commutative85.3%
Simplified85.3%
flip--85.6%
div-inv85.6%
add-sqr-sqrt63.1%
+-commutative63.1%
add-sqr-sqrt86.1%
+-commutative86.1%
Applied egg-rr86.1%
associate--l+89.4%
+-inverses89.4%
metadata-eval89.4%
*-lft-identity89.4%
+-commutative89.4%
Simplified89.4%
Taylor expanded in t around inf 46.8%
Taylor expanded in y around inf 50.2%
Final simplification52.5%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ 1.0 z))) (t_2 (- t_1 (sqrt z))) (t_3 (- 1.0 (sqrt x))))
(if (<= y 3e-77)
(+
(+ t_3 (+ 1.0 (- (* y 0.5) (sqrt y))))
(+ t_2 (/ 1.0 (+ (sqrt t) (sqrt (+ 1.0 t))))))
(if (<= y 58000000.0)
(+ (/ 1.0 (+ t_1 (sqrt z))) (+ (- (sqrt (+ y 1.0)) (sqrt y)) t_3))
(+
(+ (/ 1.0 (+ (sqrt x) (sqrt (+ 1.0 x)))) (* 0.5 (sqrt (/ 1.0 y))))
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 + z));
double t_2 = t_1 - sqrt(z);
double t_3 = 1.0 - sqrt(x);
double tmp;
if (y <= 3e-77) {
tmp = (t_3 + (1.0 + ((y * 0.5) - sqrt(y)))) + (t_2 + (1.0 / (sqrt(t) + sqrt((1.0 + t)))));
} else if (y <= 58000000.0) {
tmp = (1.0 / (t_1 + sqrt(z))) + ((sqrt((y + 1.0)) - sqrt(y)) + t_3);
} else {
tmp = ((1.0 / (sqrt(x) + sqrt((1.0 + x)))) + (0.5 * sqrt((1.0 / y)))) + 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) :: t_3
real(8) :: tmp
t_1 = sqrt((1.0d0 + z))
t_2 = t_1 - sqrt(z)
t_3 = 1.0d0 - sqrt(x)
if (y <= 3d-77) then
tmp = (t_3 + (1.0d0 + ((y * 0.5d0) - sqrt(y)))) + (t_2 + (1.0d0 / (sqrt(t) + sqrt((1.0d0 + t)))))
else if (y <= 58000000.0d0) then
tmp = (1.0d0 / (t_1 + sqrt(z))) + ((sqrt((y + 1.0d0)) - sqrt(y)) + t_3)
else
tmp = ((1.0d0 / (sqrt(x) + sqrt((1.0d0 + x)))) + (0.5d0 * sqrt((1.0d0 / y)))) + 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 + z));
double t_2 = t_1 - Math.sqrt(z);
double t_3 = 1.0 - Math.sqrt(x);
double tmp;
if (y <= 3e-77) {
tmp = (t_3 + (1.0 + ((y * 0.5) - Math.sqrt(y)))) + (t_2 + (1.0 / (Math.sqrt(t) + Math.sqrt((1.0 + t)))));
} else if (y <= 58000000.0) {
tmp = (1.0 / (t_1 + Math.sqrt(z))) + ((Math.sqrt((y + 1.0)) - Math.sqrt(y)) + t_3);
} else {
tmp = ((1.0 / (Math.sqrt(x) + Math.sqrt((1.0 + x)))) + (0.5 * Math.sqrt((1.0 / y)))) + 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 + z)) t_2 = t_1 - math.sqrt(z) t_3 = 1.0 - math.sqrt(x) tmp = 0 if y <= 3e-77: tmp = (t_3 + (1.0 + ((y * 0.5) - math.sqrt(y)))) + (t_2 + (1.0 / (math.sqrt(t) + math.sqrt((1.0 + t))))) elif y <= 58000000.0: tmp = (1.0 / (t_1 + math.sqrt(z))) + ((math.sqrt((y + 1.0)) - math.sqrt(y)) + t_3) else: tmp = ((1.0 / (math.sqrt(x) + math.sqrt((1.0 + x)))) + (0.5 * math.sqrt((1.0 / y)))) + 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 + z)) t_2 = Float64(t_1 - sqrt(z)) t_3 = Float64(1.0 - sqrt(x)) tmp = 0.0 if (y <= 3e-77) tmp = Float64(Float64(t_3 + Float64(1.0 + Float64(Float64(y * 0.5) - sqrt(y)))) + Float64(t_2 + Float64(1.0 / Float64(sqrt(t) + sqrt(Float64(1.0 + t)))))); elseif (y <= 58000000.0) tmp = Float64(Float64(1.0 / Float64(t_1 + sqrt(z))) + Float64(Float64(sqrt(Float64(y + 1.0)) - sqrt(y)) + t_3)); else tmp = Float64(Float64(Float64(1.0 / Float64(sqrt(x) + sqrt(Float64(1.0 + x)))) + Float64(0.5 * sqrt(Float64(1.0 / y)))) + 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 + z));
t_2 = t_1 - sqrt(z);
t_3 = 1.0 - sqrt(x);
tmp = 0.0;
if (y <= 3e-77)
tmp = (t_3 + (1.0 + ((y * 0.5) - sqrt(y)))) + (t_2 + (1.0 / (sqrt(t) + sqrt((1.0 + t)))));
elseif (y <= 58000000.0)
tmp = (1.0 / (t_1 + sqrt(z))) + ((sqrt((y + 1.0)) - sqrt(y)) + t_3);
else
tmp = ((1.0 / (sqrt(x) + sqrt((1.0 + x)))) + (0.5 * sqrt((1.0 / y)))) + 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 + z), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(t$95$1 - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(1.0 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 3e-77], N[(N[(t$95$3 + N[(1.0 + N[(N[(y * 0.5), $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$2 + N[(1.0 / N[(N[Sqrt[t], $MachinePrecision] + N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 58000000.0], N[(N[(1.0 / N[(t$95$1 + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision] + t$95$3), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(0.5 * N[Sqrt[N[(1.0 / y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$2), $MachinePrecision]]]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + z}\\
t_2 := t\_1 - \sqrt{z}\\
t_3 := 1 - \sqrt{x}\\
\mathbf{if}\;y \leq 3 \cdot 10^{-77}:\\
\;\;\;\;\left(t\_3 + \left(1 + \left(y \cdot 0.5 - \sqrt{y}\right)\right)\right) + \left(t\_2 + \frac{1}{\sqrt{t} + \sqrt{1 + t}}\right)\\
\mathbf{elif}\;y \leq 58000000:\\
\;\;\;\;\frac{1}{t\_1 + \sqrt{z}} + \left(\left(\sqrt{y + 1} - \sqrt{y}\right) + t\_3\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{1}{\sqrt{x} + \sqrt{1 + x}} + 0.5 \cdot \sqrt{\frac{1}{y}}\right) + t\_2\\
\end{array}
\end{array}
if y < 3.00000000000000016e-77Initial program 98.5%
associate-+l+98.5%
sub-neg98.5%
sub-neg98.5%
+-commutative98.5%
+-commutative98.5%
+-commutative98.5%
Simplified98.5%
Taylor expanded in x around 0 59.3%
Taylor expanded in y around 0 59.3%
associate--l+59.3%
Simplified59.3%
flip--98.5%
div-inv98.5%
add-sqr-sqrt75.7%
+-commutative75.7%
add-sqr-sqrt98.5%
associate--l+98.5%
Applied egg-rr59.3%
associate-*r/98.5%
*-rgt-identity98.5%
associate-+r-98.5%
+-commutative98.5%
associate-+r-99.1%
+-inverses99.1%
metadata-eval99.1%
+-commutative99.1%
Simplified59.9%
if 3.00000000000000016e-77 < y < 5.8e7Initial program 96.9%
associate-+l+96.9%
sub-neg96.9%
sub-neg96.9%
+-commutative96.9%
+-commutative96.9%
+-commutative96.9%
Simplified96.9%
Taylor expanded in x around 0 39.0%
Taylor expanded in t around inf 23.2%
flip--97.1%
div-inv97.1%
add-sqr-sqrt70.5%
add-sqr-sqrt98.9%
associate--l+98.9%
Applied egg-rr23.2%
+-inverses98.9%
metadata-eval98.9%
*-lft-identity98.9%
+-commutative98.9%
Simplified23.2%
if 5.8e7 < y Initial program 85.3%
associate-+l+85.3%
sub-neg85.3%
sub-neg85.3%
+-commutative85.3%
+-commutative85.3%
+-commutative85.3%
Simplified85.3%
flip--85.6%
div-inv85.6%
add-sqr-sqrt63.1%
+-commutative63.1%
add-sqr-sqrt86.1%
+-commutative86.1%
Applied egg-rr86.1%
associate--l+89.4%
+-inverses89.4%
metadata-eval89.4%
*-lft-identity89.4%
+-commutative89.4%
Simplified89.4%
Taylor expanded in t around inf 46.8%
Taylor expanded in y around inf 50.2%
Final simplification50.7%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- 1.0 (sqrt x))) (t_2 (sqrt (+ 1.0 z))) (t_3 (- t_2 (sqrt z))))
(if (<= y 1e-77)
(+
(+ t_3 (- (sqrt (+ 1.0 t)) (sqrt t)))
(+ t_1 (+ 1.0 (- (* y 0.5) (sqrt y)))))
(if (<= y 68000000.0)
(+ (/ 1.0 (+ t_2 (sqrt z))) (+ (- (sqrt (+ y 1.0)) (sqrt y)) t_1))
(+
(+ (/ 1.0 (+ (sqrt x) (sqrt (+ 1.0 x)))) (* 0.5 (sqrt (/ 1.0 y))))
t_3)))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = 1.0 - sqrt(x);
double t_2 = sqrt((1.0 + z));
double t_3 = t_2 - sqrt(z);
double tmp;
if (y <= 1e-77) {
tmp = (t_3 + (sqrt((1.0 + t)) - sqrt(t))) + (t_1 + (1.0 + ((y * 0.5) - sqrt(y))));
} else if (y <= 68000000.0) {
tmp = (1.0 / (t_2 + sqrt(z))) + ((sqrt((y + 1.0)) - sqrt(y)) + t_1);
} else {
tmp = ((1.0 / (sqrt(x) + sqrt((1.0 + x)))) + (0.5 * sqrt((1.0 / y)))) + t_3;
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = 1.0d0 - sqrt(x)
t_2 = sqrt((1.0d0 + z))
t_3 = t_2 - sqrt(z)
if (y <= 1d-77) then
tmp = (t_3 + (sqrt((1.0d0 + t)) - sqrt(t))) + (t_1 + (1.0d0 + ((y * 0.5d0) - sqrt(y))))
else if (y <= 68000000.0d0) then
tmp = (1.0d0 / (t_2 + sqrt(z))) + ((sqrt((y + 1.0d0)) - sqrt(y)) + t_1)
else
tmp = ((1.0d0 / (sqrt(x) + sqrt((1.0d0 + x)))) + (0.5d0 * sqrt((1.0d0 / y)))) + t_3
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = 1.0 - Math.sqrt(x);
double t_2 = Math.sqrt((1.0 + z));
double t_3 = t_2 - Math.sqrt(z);
double tmp;
if (y <= 1e-77) {
tmp = (t_3 + (Math.sqrt((1.0 + t)) - Math.sqrt(t))) + (t_1 + (1.0 + ((y * 0.5) - Math.sqrt(y))));
} else if (y <= 68000000.0) {
tmp = (1.0 / (t_2 + Math.sqrt(z))) + ((Math.sqrt((y + 1.0)) - Math.sqrt(y)) + t_1);
} else {
tmp = ((1.0 / (Math.sqrt(x) + Math.sqrt((1.0 + x)))) + (0.5 * Math.sqrt((1.0 / y)))) + t_3;
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = 1.0 - math.sqrt(x) t_2 = math.sqrt((1.0 + z)) t_3 = t_2 - math.sqrt(z) tmp = 0 if y <= 1e-77: tmp = (t_3 + (math.sqrt((1.0 + t)) - math.sqrt(t))) + (t_1 + (1.0 + ((y * 0.5) - math.sqrt(y)))) elif y <= 68000000.0: tmp = (1.0 / (t_2 + math.sqrt(z))) + ((math.sqrt((y + 1.0)) - math.sqrt(y)) + t_1) else: tmp = ((1.0 / (math.sqrt(x) + math.sqrt((1.0 + x)))) + (0.5 * math.sqrt((1.0 / y)))) + t_3 return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = Float64(1.0 - sqrt(x)) t_2 = sqrt(Float64(1.0 + z)) t_3 = Float64(t_2 - sqrt(z)) tmp = 0.0 if (y <= 1e-77) tmp = Float64(Float64(t_3 + Float64(sqrt(Float64(1.0 + t)) - sqrt(t))) + Float64(t_1 + Float64(1.0 + Float64(Float64(y * 0.5) - sqrt(y))))); elseif (y <= 68000000.0) tmp = Float64(Float64(1.0 / Float64(t_2 + sqrt(z))) + Float64(Float64(sqrt(Float64(y + 1.0)) - sqrt(y)) + t_1)); else tmp = Float64(Float64(Float64(1.0 / Float64(sqrt(x) + sqrt(Float64(1.0 + x)))) + Float64(0.5 * sqrt(Float64(1.0 / y)))) + t_3); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = 1.0 - sqrt(x);
t_2 = sqrt((1.0 + z));
t_3 = t_2 - sqrt(z);
tmp = 0.0;
if (y <= 1e-77)
tmp = (t_3 + (sqrt((1.0 + t)) - sqrt(t))) + (t_1 + (1.0 + ((y * 0.5) - sqrt(y))));
elseif (y <= 68000000.0)
tmp = (1.0 / (t_2 + sqrt(z))) + ((sqrt((y + 1.0)) - sqrt(y)) + t_1);
else
tmp = ((1.0 / (sqrt(x) + sqrt((1.0 + x)))) + (0.5 * sqrt((1.0 / y)))) + t_3;
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(1.0 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[(t$95$2 - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 1e-77], N[(N[(t$95$3 + N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$1 + N[(1.0 + N[(N[(y * 0.5), $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 68000000.0], N[(N[(1.0 / N[(t$95$2 + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(0.5 * N[Sqrt[N[(1.0 / y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$3), $MachinePrecision]]]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := 1 - \sqrt{x}\\
t_2 := \sqrt{1 + z}\\
t_3 := t\_2 - \sqrt{z}\\
\mathbf{if}\;y \leq 10^{-77}:\\
\;\;\;\;\left(t\_3 + \left(\sqrt{1 + t} - \sqrt{t}\right)\right) + \left(t\_1 + \left(1 + \left(y \cdot 0.5 - \sqrt{y}\right)\right)\right)\\
\mathbf{elif}\;y \leq 68000000:\\
\;\;\;\;\frac{1}{t\_2 + \sqrt{z}} + \left(\left(\sqrt{y + 1} - \sqrt{y}\right) + t\_1\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{1}{\sqrt{x} + \sqrt{1 + x}} + 0.5 \cdot \sqrt{\frac{1}{y}}\right) + t\_3\\
\end{array}
\end{array}
if y < 9.9999999999999993e-78Initial program 98.5%
associate-+l+98.5%
sub-neg98.5%
sub-neg98.5%
+-commutative98.5%
+-commutative98.5%
+-commutative98.5%
Simplified98.5%
Taylor expanded in x around 0 59.3%
Taylor expanded in y around 0 59.3%
associate--l+59.3%
Simplified59.3%
if 9.9999999999999993e-78 < y < 6.8e7Initial program 96.9%
associate-+l+96.9%
sub-neg96.9%
sub-neg96.9%
+-commutative96.9%
+-commutative96.9%
+-commutative96.9%
Simplified96.9%
Taylor expanded in x around 0 39.0%
Taylor expanded in t around inf 23.2%
flip--97.1%
div-inv97.1%
add-sqr-sqrt70.5%
add-sqr-sqrt98.9%
associate--l+98.9%
Applied egg-rr23.2%
+-inverses98.9%
metadata-eval98.9%
*-lft-identity98.9%
+-commutative98.9%
Simplified23.2%
if 6.8e7 < y Initial program 85.3%
associate-+l+85.3%
sub-neg85.3%
sub-neg85.3%
+-commutative85.3%
+-commutative85.3%
+-commutative85.3%
Simplified85.3%
flip--85.6%
div-inv85.6%
add-sqr-sqrt63.1%
+-commutative63.1%
add-sqr-sqrt86.1%
+-commutative86.1%
Applied egg-rr86.1%
associate--l+89.4%
+-inverses89.4%
metadata-eval89.4%
*-lft-identity89.4%
+-commutative89.4%
Simplified89.4%
Taylor expanded in t around inf 46.8%
Taylor expanded in y around inf 50.2%
Final simplification50.4%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(if (<= t 1.1e+14)
(+
(+ (- 1.0 (sqrt x)) (+ 1.0 (- (* y 0.5) (sqrt y))))
(+ (- (sqrt (+ 1.0 t)) (sqrt t)) (- 1.0 (sqrt z))))
(+
(- (sqrt (+ 1.0 z)) (sqrt z))
(+ (/ 1.0 (+ (sqrt x) (sqrt (+ 1.0 x)))) (- (sqrt (+ y 1.0)) (sqrt y))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (t <= 1.1e+14) {
tmp = ((1.0 - sqrt(x)) + (1.0 + ((y * 0.5) - sqrt(y)))) + ((sqrt((1.0 + t)) - sqrt(t)) + (1.0 - sqrt(z)));
} else {
tmp = (sqrt((1.0 + z)) - sqrt(z)) + ((1.0 / (sqrt(x) + sqrt((1.0 + x)))) + (sqrt((y + 1.0)) - sqrt(y)));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (t <= 1.1d+14) then
tmp = ((1.0d0 - sqrt(x)) + (1.0d0 + ((y * 0.5d0) - sqrt(y)))) + ((sqrt((1.0d0 + t)) - sqrt(t)) + (1.0d0 - sqrt(z)))
else
tmp = (sqrt((1.0d0 + z)) - sqrt(z)) + ((1.0d0 / (sqrt(x) + sqrt((1.0d0 + x)))) + (sqrt((y + 1.0d0)) - sqrt(y)))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (t <= 1.1e+14) {
tmp = ((1.0 - Math.sqrt(x)) + (1.0 + ((y * 0.5) - Math.sqrt(y)))) + ((Math.sqrt((1.0 + t)) - Math.sqrt(t)) + (1.0 - Math.sqrt(z)));
} else {
tmp = (Math.sqrt((1.0 + z)) - Math.sqrt(z)) + ((1.0 / (Math.sqrt(x) + Math.sqrt((1.0 + x)))) + (Math.sqrt((y + 1.0)) - Math.sqrt(y)));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if t <= 1.1e+14: tmp = ((1.0 - math.sqrt(x)) + (1.0 + ((y * 0.5) - math.sqrt(y)))) + ((math.sqrt((1.0 + t)) - math.sqrt(t)) + (1.0 - math.sqrt(z))) else: tmp = (math.sqrt((1.0 + z)) - math.sqrt(z)) + ((1.0 / (math.sqrt(x) + math.sqrt((1.0 + x)))) + (math.sqrt((y + 1.0)) - math.sqrt(y))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (t <= 1.1e+14) tmp = Float64(Float64(Float64(1.0 - sqrt(x)) + Float64(1.0 + Float64(Float64(y * 0.5) - sqrt(y)))) + Float64(Float64(sqrt(Float64(1.0 + t)) - sqrt(t)) + Float64(1.0 - sqrt(z)))); else tmp = Float64(Float64(sqrt(Float64(1.0 + z)) - sqrt(z)) + Float64(Float64(1.0 / Float64(sqrt(x) + sqrt(Float64(1.0 + x)))) + Float64(sqrt(Float64(y + 1.0)) - sqrt(y)))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (t <= 1.1e+14)
tmp = ((1.0 - sqrt(x)) + (1.0 + ((y * 0.5) - sqrt(y)))) + ((sqrt((1.0 + t)) - sqrt(t)) + (1.0 - sqrt(z)));
else
tmp = (sqrt((1.0 + z)) - sqrt(z)) + ((1.0 / (sqrt(x) + sqrt((1.0 + x)))) + (sqrt((y + 1.0)) - sqrt(y)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[t, 1.1e+14], N[(N[(N[(1.0 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(1.0 + N[(N[(y * 0.5), $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision] + N[(1.0 - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq 1.1 \cdot 10^{+14}:\\
\;\;\;\;\left(\left(1 - \sqrt{x}\right) + \left(1 + \left(y \cdot 0.5 - \sqrt{y}\right)\right)\right) + \left(\left(\sqrt{1 + t} - \sqrt{t}\right) + \left(1 - \sqrt{z}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\frac{1}{\sqrt{x} + \sqrt{1 + x}} + \left(\sqrt{y + 1} - \sqrt{y}\right)\right)\\
\end{array}
\end{array}
if t < 1.1e14Initial program 97.7%
associate-+l+97.7%
sub-neg97.7%
sub-neg97.7%
+-commutative97.7%
+-commutative97.7%
+-commutative97.7%
Simplified97.7%
Taylor expanded in x around 0 44.8%
Taylor expanded in y around 0 26.6%
associate--l+26.6%
Simplified26.6%
Taylor expanded in z around 0 13.2%
if 1.1e14 < t Initial program 87.4%
associate-+l+87.4%
sub-neg87.4%
sub-neg87.4%
+-commutative87.4%
+-commutative87.4%
+-commutative87.4%
Simplified87.4%
flip--88.0%
div-inv88.0%
add-sqr-sqrt72.4%
+-commutative72.4%
add-sqr-sqrt88.3%
+-commutative88.3%
Applied egg-rr88.3%
associate--l+90.8%
+-inverses90.8%
metadata-eval90.8%
*-lft-identity90.8%
+-commutative90.8%
Simplified90.8%
Taylor expanded in t around inf 90.5%
Final simplification54.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 z))))
(if (<= y 16000000.0)
(+
(/ 1.0 (+ t_1 (sqrt z)))
(+ (- (sqrt (+ y 1.0)) (sqrt y)) (- 1.0 (sqrt x))))
(+
(+ (/ 1.0 (+ (sqrt x) (sqrt (+ 1.0 x)))) (* 0.5 (sqrt (/ 1.0 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 (y <= 16000000.0) {
tmp = (1.0 / (t_1 + sqrt(z))) + ((sqrt((y + 1.0)) - sqrt(y)) + (1.0 - sqrt(x)));
} else {
tmp = ((1.0 / (sqrt(x) + sqrt((1.0 + x)))) + (0.5 * sqrt((1.0 / 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 (y <= 16000000.0d0) then
tmp = (1.0d0 / (t_1 + sqrt(z))) + ((sqrt((y + 1.0d0)) - sqrt(y)) + (1.0d0 - sqrt(x)))
else
tmp = ((1.0d0 / (sqrt(x) + sqrt((1.0d0 + x)))) + (0.5d0 * sqrt((1.0d0 / 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 (y <= 16000000.0) {
tmp = (1.0 / (t_1 + Math.sqrt(z))) + ((Math.sqrt((y + 1.0)) - Math.sqrt(y)) + (1.0 - Math.sqrt(x)));
} else {
tmp = ((1.0 / (Math.sqrt(x) + Math.sqrt((1.0 + x)))) + (0.5 * Math.sqrt((1.0 / 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 y <= 16000000.0: tmp = (1.0 / (t_1 + math.sqrt(z))) + ((math.sqrt((y + 1.0)) - math.sqrt(y)) + (1.0 - math.sqrt(x))) else: tmp = ((1.0 / (math.sqrt(x) + math.sqrt((1.0 + x)))) + (0.5 * math.sqrt((1.0 / 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 (y <= 16000000.0) tmp = Float64(Float64(1.0 / Float64(t_1 + sqrt(z))) + Float64(Float64(sqrt(Float64(y + 1.0)) - sqrt(y)) + Float64(1.0 - sqrt(x)))); else tmp = Float64(Float64(Float64(1.0 / Float64(sqrt(x) + sqrt(Float64(1.0 + x)))) + Float64(0.5 * sqrt(Float64(1.0 / 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 (y <= 16000000.0)
tmp = (1.0 / (t_1 + sqrt(z))) + ((sqrt((y + 1.0)) - sqrt(y)) + (1.0 - sqrt(x)));
else
tmp = ((1.0 / (sqrt(x) + sqrt((1.0 + x)))) + (0.5 * sqrt((1.0 / 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[y, 16000000.0], N[(N[(1.0 / N[(t$95$1 + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision] + N[(1.0 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(0.5 * N[Sqrt[N[(1.0 / y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$1 - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + z}\\
\mathbf{if}\;y \leq 16000000:\\
\;\;\;\;\frac{1}{t\_1 + \sqrt{z}} + \left(\left(\sqrt{y + 1} - \sqrt{y}\right) + \left(1 - \sqrt{x}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{1}{\sqrt{x} + \sqrt{1 + x}} + 0.5 \cdot \sqrt{\frac{1}{y}}\right) + \left(t\_1 - \sqrt{z}\right)\\
\end{array}
\end{array}
if y < 1.6e7Initial program 98.1%
associate-+l+98.1%
sub-neg98.1%
sub-neg98.1%
+-commutative98.1%
+-commutative98.1%
+-commutative98.1%
Simplified98.1%
Taylor expanded in x around 0 54.4%
Taylor expanded in t around inf 37.5%
flip--98.8%
div-inv98.8%
add-sqr-sqrt76.0%
add-sqr-sqrt99.4%
associate--l+99.5%
Applied egg-rr37.6%
+-inverses99.5%
metadata-eval99.5%
*-lft-identity99.5%
+-commutative99.5%
Simplified37.6%
if 1.6e7 < y Initial program 85.3%
associate-+l+85.3%
sub-neg85.3%
sub-neg85.3%
+-commutative85.3%
+-commutative85.3%
+-commutative85.3%
Simplified85.3%
flip--85.6%
div-inv85.6%
add-sqr-sqrt63.1%
+-commutative63.1%
add-sqr-sqrt86.1%
+-commutative86.1%
Applied egg-rr86.1%
associate--l+89.4%
+-inverses89.4%
metadata-eval89.4%
*-lft-identity89.4%
+-commutative89.4%
Simplified89.4%
Taylor expanded in t around inf 46.8%
Taylor expanded in y around inf 50.2%
Final simplification43.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)) (sqrt z))))
(if (<= x 8.6e-22)
(+ t_1 (+ (- 1.0 (sqrt x)) (/ 1.0 (+ (sqrt y) (sqrt (+ y 1.0))))))
(+ (/ 1.0 (+ (sqrt x) (sqrt (+ 1.0 x)))) t_1))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + z)) - sqrt(z);
double tmp;
if (x <= 8.6e-22) {
tmp = t_1 + ((1.0 - sqrt(x)) + (1.0 / (sqrt(y) + sqrt((y + 1.0)))));
} else {
tmp = (1.0 / (sqrt(x) + sqrt((1.0 + x)))) + t_1;
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = sqrt((1.0d0 + z)) - sqrt(z)
if (x <= 8.6d-22) then
tmp = t_1 + ((1.0d0 - sqrt(x)) + (1.0d0 / (sqrt(y) + sqrt((y + 1.0d0)))))
else
tmp = (1.0d0 / (sqrt(x) + sqrt((1.0d0 + x)))) + t_1
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + z)) - Math.sqrt(z);
double tmp;
if (x <= 8.6e-22) {
tmp = t_1 + ((1.0 - Math.sqrt(x)) + (1.0 / (Math.sqrt(y) + Math.sqrt((y + 1.0)))));
} else {
tmp = (1.0 / (Math.sqrt(x) + Math.sqrt((1.0 + x)))) + t_1;
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + z)) - math.sqrt(z) tmp = 0 if x <= 8.6e-22: tmp = t_1 + ((1.0 - math.sqrt(x)) + (1.0 / (math.sqrt(y) + math.sqrt((y + 1.0))))) else: tmp = (1.0 / (math.sqrt(x) + math.sqrt((1.0 + x)))) + t_1 return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = Float64(sqrt(Float64(1.0 + z)) - sqrt(z)) tmp = 0.0 if (x <= 8.6e-22) tmp = Float64(t_1 + Float64(Float64(1.0 - sqrt(x)) + Float64(1.0 / Float64(sqrt(y) + sqrt(Float64(y + 1.0)))))); else tmp = Float64(Float64(1.0 / Float64(sqrt(x) + sqrt(Float64(1.0 + x)))) + t_1); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + z)) - sqrt(z);
tmp = 0.0;
if (x <= 8.6e-22)
tmp = t_1 + ((1.0 - sqrt(x)) + (1.0 / (sqrt(y) + sqrt((y + 1.0)))));
else
tmp = (1.0 / (sqrt(x) + sqrt((1.0 + x)))) + t_1;
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, 8.6e-22], N[(t$95$1 + N[(N[(1.0 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + z} - \sqrt{z}\\
\mathbf{if}\;x \leq 8.6 \cdot 10^{-22}:\\
\;\;\;\;t\_1 + \left(\left(1 - \sqrt{x}\right) + \frac{1}{\sqrt{y} + \sqrt{y + 1}}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{x} + \sqrt{1 + x}} + t\_1\\
\end{array}
\end{array}
if x < 8.60000000000000075e-22Initial program 97.7%
associate-+l+97.7%
sub-neg97.7%
sub-neg97.7%
+-commutative97.7%
+-commutative97.7%
+-commutative97.7%
Simplified97.7%
Taylor expanded in x around 0 97.7%
Taylor expanded in t around inf 63.6%
flip--63.6%
div-inv63.6%
add-sqr-sqrt51.5%
add-sqr-sqrt63.8%
associate--l+64.3%
Applied egg-rr64.3%
+-inverses64.3%
metadata-eval64.3%
*-lft-identity64.3%
+-commutative64.3%
Simplified64.3%
if 8.60000000000000075e-22 < x Initial program 87.2%
associate-+l+87.2%
sub-neg87.2%
sub-neg87.2%
+-commutative87.2%
+-commutative87.2%
+-commutative87.2%
Simplified87.2%
flip--87.8%
div-inv87.8%
add-sqr-sqrt44.4%
+-commutative44.4%
add-sqr-sqrt88.3%
+-commutative88.3%
Applied egg-rr88.3%
associate--l+91.2%
+-inverses91.2%
metadata-eval91.2%
*-lft-identity91.2%
+-commutative91.2%
Simplified91.2%
Taylor expanded in t around inf 50.5%
Taylor expanded in y around inf 25.3%
Final simplification43.9%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ 1.0 z))))
(if (<= x 8.6e-22)
(+
(/ 1.0 (+ t_1 (sqrt z)))
(+ (- (sqrt (+ y 1.0)) (sqrt y)) (- 1.0 (sqrt x))))
(+ (/ 1.0 (+ (sqrt x) (sqrt (+ 1.0 x)))) (- t_1 (sqrt z))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + z));
double tmp;
if (x <= 8.6e-22) {
tmp = (1.0 / (t_1 + sqrt(z))) + ((sqrt((y + 1.0)) - sqrt(y)) + (1.0 - sqrt(x)));
} else {
tmp = (1.0 / (sqrt(x) + sqrt((1.0 + x)))) + (t_1 - sqrt(z));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = sqrt((1.0d0 + z))
if (x <= 8.6d-22) then
tmp = (1.0d0 / (t_1 + sqrt(z))) + ((sqrt((y + 1.0d0)) - sqrt(y)) + (1.0d0 - sqrt(x)))
else
tmp = (1.0d0 / (sqrt(x) + sqrt((1.0d0 + x)))) + (t_1 - sqrt(z))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + z));
double tmp;
if (x <= 8.6e-22) {
tmp = (1.0 / (t_1 + Math.sqrt(z))) + ((Math.sqrt((y + 1.0)) - Math.sqrt(y)) + (1.0 - Math.sqrt(x)));
} else {
tmp = (1.0 / (Math.sqrt(x) + Math.sqrt((1.0 + x)))) + (t_1 - Math.sqrt(z));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + z)) tmp = 0 if x <= 8.6e-22: tmp = (1.0 / (t_1 + math.sqrt(z))) + ((math.sqrt((y + 1.0)) - math.sqrt(y)) + (1.0 - math.sqrt(x))) else: tmp = (1.0 / (math.sqrt(x) + math.sqrt((1.0 + x)))) + (t_1 - math.sqrt(z)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(1.0 + z)) tmp = 0.0 if (x <= 8.6e-22) tmp = Float64(Float64(1.0 / Float64(t_1 + sqrt(z))) + Float64(Float64(sqrt(Float64(y + 1.0)) - sqrt(y)) + Float64(1.0 - sqrt(x)))); else tmp = Float64(Float64(1.0 / Float64(sqrt(x) + sqrt(Float64(1.0 + x)))) + Float64(t_1 - sqrt(z))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + z));
tmp = 0.0;
if (x <= 8.6e-22)
tmp = (1.0 / (t_1 + sqrt(z))) + ((sqrt((y + 1.0)) - sqrt(y)) + (1.0 - sqrt(x)));
else
tmp = (1.0 / (sqrt(x) + sqrt((1.0 + x)))) + (t_1 - sqrt(z));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x, 8.6e-22], N[(N[(1.0 / N[(t$95$1 + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision] + N[(1.0 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$1 - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + z}\\
\mathbf{if}\;x \leq 8.6 \cdot 10^{-22}:\\
\;\;\;\;\frac{1}{t\_1 + \sqrt{z}} + \left(\left(\sqrt{y + 1} - \sqrt{y}\right) + \left(1 - \sqrt{x}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{x} + \sqrt{1 + x}} + \left(t\_1 - \sqrt{z}\right)\\
\end{array}
\end{array}
if x < 8.60000000000000075e-22Initial program 97.7%
associate-+l+97.7%
sub-neg97.7%
sub-neg97.7%
+-commutative97.7%
+-commutative97.7%
+-commutative97.7%
Simplified97.7%
Taylor expanded in x around 0 97.7%
Taylor expanded in t around inf 63.6%
flip--98.4%
div-inv98.4%
add-sqr-sqrt74.2%
add-sqr-sqrt98.8%
associate--l+99.2%
Applied egg-rr63.9%
+-inverses99.2%
metadata-eval99.2%
*-lft-identity99.2%
+-commutative99.2%
Simplified63.9%
if 8.60000000000000075e-22 < x Initial program 87.2%
associate-+l+87.2%
sub-neg87.2%
sub-neg87.2%
+-commutative87.2%
+-commutative87.2%
+-commutative87.2%
Simplified87.2%
flip--87.8%
div-inv87.8%
add-sqr-sqrt44.4%
+-commutative44.4%
add-sqr-sqrt88.3%
+-commutative88.3%
Applied egg-rr88.3%
associate--l+91.2%
+-inverses91.2%
metadata-eval91.2%
*-lft-identity91.2%
+-commutative91.2%
Simplified91.2%
Taylor expanded in t around inf 50.5%
Taylor expanded in y around inf 25.3%
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
(let* ((t_1 (- (sqrt (+ 1.0 z)) (sqrt z))))
(if (<= x 8.6e-22)
(+ t_1 (+ (- (sqrt (+ y 1.0)) (sqrt y)) (- 1.0 (sqrt x))))
(+ (/ 1.0 (+ (sqrt x) (sqrt (+ 1.0 x)))) t_1))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + z)) - sqrt(z);
double tmp;
if (x <= 8.6e-22) {
tmp = t_1 + ((sqrt((y + 1.0)) - sqrt(y)) + (1.0 - sqrt(x)));
} else {
tmp = (1.0 / (sqrt(x) + sqrt((1.0 + x)))) + t_1;
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = sqrt((1.0d0 + z)) - sqrt(z)
if (x <= 8.6d-22) then
tmp = t_1 + ((sqrt((y + 1.0d0)) - sqrt(y)) + (1.0d0 - sqrt(x)))
else
tmp = (1.0d0 / (sqrt(x) + sqrt((1.0d0 + x)))) + t_1
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + z)) - Math.sqrt(z);
double tmp;
if (x <= 8.6e-22) {
tmp = t_1 + ((Math.sqrt((y + 1.0)) - Math.sqrt(y)) + (1.0 - Math.sqrt(x)));
} else {
tmp = (1.0 / (Math.sqrt(x) + Math.sqrt((1.0 + x)))) + t_1;
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + z)) - math.sqrt(z) tmp = 0 if x <= 8.6e-22: tmp = t_1 + ((math.sqrt((y + 1.0)) - math.sqrt(y)) + (1.0 - math.sqrt(x))) else: tmp = (1.0 / (math.sqrt(x) + math.sqrt((1.0 + x)))) + t_1 return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = Float64(sqrt(Float64(1.0 + z)) - sqrt(z)) tmp = 0.0 if (x <= 8.6e-22) tmp = Float64(t_1 + Float64(Float64(sqrt(Float64(y + 1.0)) - sqrt(y)) + Float64(1.0 - sqrt(x)))); else tmp = Float64(Float64(1.0 / Float64(sqrt(x) + sqrt(Float64(1.0 + x)))) + t_1); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + z)) - sqrt(z);
tmp = 0.0;
if (x <= 8.6e-22)
tmp = t_1 + ((sqrt((y + 1.0)) - sqrt(y)) + (1.0 - sqrt(x)));
else
tmp = (1.0 / (sqrt(x) + sqrt((1.0 + x)))) + t_1;
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, 8.6e-22], N[(t$95$1 + N[(N[(N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision] + N[(1.0 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + z} - \sqrt{z}\\
\mathbf{if}\;x \leq 8.6 \cdot 10^{-22}:\\
\;\;\;\;t\_1 + \left(\left(\sqrt{y + 1} - \sqrt{y}\right) + \left(1 - \sqrt{x}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{x} + \sqrt{1 + x}} + t\_1\\
\end{array}
\end{array}
if x < 8.60000000000000075e-22Initial program 97.7%
associate-+l+97.7%
sub-neg97.7%
sub-neg97.7%
+-commutative97.7%
+-commutative97.7%
+-commutative97.7%
Simplified97.7%
Taylor expanded in x around 0 97.7%
Taylor expanded in t around inf 63.6%
if 8.60000000000000075e-22 < x Initial program 87.2%
associate-+l+87.2%
sub-neg87.2%
sub-neg87.2%
+-commutative87.2%
+-commutative87.2%
+-commutative87.2%
Simplified87.2%
flip--87.8%
div-inv87.8%
add-sqr-sqrt44.4%
+-commutative44.4%
add-sqr-sqrt88.3%
+-commutative88.3%
Applied egg-rr88.3%
associate--l+91.2%
+-inverses91.2%
metadata-eval91.2%
*-lft-identity91.2%
+-commutative91.2%
Simplified91.2%
Taylor expanded in t around inf 50.5%
Taylor expanded in y around inf 25.3%
Final simplification43.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 y) (sqrt x))) (t_2 (sqrt (+ 1.0 z))))
(if (<= y 9e-13)
(+ (/ 1.0 (+ t_2 (sqrt z))) (- (+ (* y 0.5) 2.0) t_1))
(if (<= y 5.1e+22)
(+ 1.0 (- (+ (sqrt (+ y 1.0)) (* 0.5 (sqrt (/ 1.0 z)))) t_1))
(+ (/ 1.0 (+ (sqrt x) (sqrt (+ 1.0 x)))) (- 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(y) + sqrt(x);
double t_2 = sqrt((1.0 + z));
double tmp;
if (y <= 9e-13) {
tmp = (1.0 / (t_2 + sqrt(z))) + (((y * 0.5) + 2.0) - t_1);
} else if (y <= 5.1e+22) {
tmp = 1.0 + ((sqrt((y + 1.0)) + (0.5 * sqrt((1.0 / z)))) - t_1);
} else {
tmp = (1.0 / (sqrt(x) + sqrt((1.0 + x)))) + (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(y) + sqrt(x)
t_2 = sqrt((1.0d0 + z))
if (y <= 9d-13) then
tmp = (1.0d0 / (t_2 + sqrt(z))) + (((y * 0.5d0) + 2.0d0) - t_1)
else if (y <= 5.1d+22) then
tmp = 1.0d0 + ((sqrt((y + 1.0d0)) + (0.5d0 * sqrt((1.0d0 / z)))) - t_1)
else
tmp = (1.0d0 / (sqrt(x) + sqrt((1.0d0 + x)))) + (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(y) + Math.sqrt(x);
double t_2 = Math.sqrt((1.0 + z));
double tmp;
if (y <= 9e-13) {
tmp = (1.0 / (t_2 + Math.sqrt(z))) + (((y * 0.5) + 2.0) - t_1);
} else if (y <= 5.1e+22) {
tmp = 1.0 + ((Math.sqrt((y + 1.0)) + (0.5 * Math.sqrt((1.0 / z)))) - t_1);
} else {
tmp = (1.0 / (Math.sqrt(x) + Math.sqrt((1.0 + x)))) + (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(y) + math.sqrt(x) t_2 = math.sqrt((1.0 + z)) tmp = 0 if y <= 9e-13: tmp = (1.0 / (t_2 + math.sqrt(z))) + (((y * 0.5) + 2.0) - t_1) elif y <= 5.1e+22: tmp = 1.0 + ((math.sqrt((y + 1.0)) + (0.5 * math.sqrt((1.0 / z)))) - t_1) else: tmp = (1.0 / (math.sqrt(x) + math.sqrt((1.0 + x)))) + (t_2 - math.sqrt(z)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = Float64(sqrt(y) + sqrt(x)) t_2 = sqrt(Float64(1.0 + z)) tmp = 0.0 if (y <= 9e-13) tmp = Float64(Float64(1.0 / Float64(t_2 + sqrt(z))) + Float64(Float64(Float64(y * 0.5) + 2.0) - t_1)); elseif (y <= 5.1e+22) tmp = Float64(1.0 + Float64(Float64(sqrt(Float64(y + 1.0)) + Float64(0.5 * sqrt(Float64(1.0 / z)))) - t_1)); else tmp = Float64(Float64(1.0 / Float64(sqrt(x) + sqrt(Float64(1.0 + x)))) + 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(y) + sqrt(x);
t_2 = sqrt((1.0 + z));
tmp = 0.0;
if (y <= 9e-13)
tmp = (1.0 / (t_2 + sqrt(z))) + (((y * 0.5) + 2.0) - t_1);
elseif (y <= 5.1e+22)
tmp = 1.0 + ((sqrt((y + 1.0)) + (0.5 * sqrt((1.0 / z)))) - t_1);
else
tmp = (1.0 / (sqrt(x) + sqrt((1.0 + x)))) + (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[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y, 9e-13], N[(N[(1.0 / N[(t$95$2 + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(y * 0.5), $MachinePrecision] + 2.0), $MachinePrecision] - t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 5.1e+22], N[(1.0 + N[(N[(N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision] + N[(0.5 * N[Sqrt[N[(1.0 / z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[N[(1.0 + x), $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{y} + \sqrt{x}\\
t_2 := \sqrt{1 + z}\\
\mathbf{if}\;y \leq 9 \cdot 10^{-13}:\\
\;\;\;\;\frac{1}{t\_2 + \sqrt{z}} + \left(\left(y \cdot 0.5 + 2\right) - t\_1\right)\\
\mathbf{elif}\;y \leq 5.1 \cdot 10^{+22}:\\
\;\;\;\;1 + \left(\left(\sqrt{y + 1} + 0.5 \cdot \sqrt{\frac{1}{z}}\right) - t\_1\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{x} + \sqrt{1 + x}} + \left(t\_2 - \sqrt{z}\right)\\
\end{array}
\end{array}
if y < 9e-13Initial program 98.3%
associate-+l+98.3%
sub-neg98.3%
sub-neg98.3%
+-commutative98.3%
+-commutative98.3%
+-commutative98.3%
Simplified98.3%
Taylor expanded in x around 0 54.3%
Taylor expanded in t around inf 37.6%
Taylor expanded in y around 0 37.6%
flip--99.0%
div-inv99.0%
add-sqr-sqrt75.7%
add-sqr-sqrt99.6%
associate--l+99.8%
Applied egg-rr37.7%
+-inverses99.8%
metadata-eval99.8%
*-lft-identity99.8%
+-commutative99.8%
Simplified37.7%
if 9e-13 < y < 5.1000000000000002e22Initial program 78.8%
associate-+l+78.8%
sub-neg78.8%
sub-neg78.8%
+-commutative78.8%
+-commutative78.8%
+-commutative78.8%
Simplified78.8%
Taylor expanded in x around 0 47.3%
Taylor expanded in t around inf 35.3%
Taylor expanded in z around inf 34.5%
associate--l+34.5%
+-commutative34.5%
Simplified34.5%
if 5.1000000000000002e22 < y Initial program 86.7%
associate-+l+86.7%
sub-neg86.7%
sub-neg86.7%
+-commutative86.7%
+-commutative86.7%
+-commutative86.7%
Simplified86.7%
flip--86.9%
div-inv86.9%
add-sqr-sqrt64.3%
+-commutative64.3%
add-sqr-sqrt87.4%
+-commutative87.4%
Applied egg-rr87.4%
associate--l+90.9%
+-inverses90.9%
metadata-eval90.9%
*-lft-identity90.9%
+-commutative90.9%
Simplified90.9%
Taylor expanded in t around inf 46.6%
Taylor expanded in y around inf 46.6%
Final simplification41.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 y) (sqrt x))) (t_2 (- (sqrt (+ 1.0 z)) (sqrt z))))
(if (<= y 9e-13)
(+ t_2 (- (+ (* y 0.5) 2.0) t_1))
(if (<= y 5.1e+22)
(+ 1.0 (- (+ (sqrt (+ y 1.0)) (* 0.5 (sqrt (/ 1.0 z)))) t_1))
(+ (/ 1.0 (+ (sqrt x) (sqrt (+ 1.0 x)))) t_2)))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt(y) + sqrt(x);
double t_2 = sqrt((1.0 + z)) - sqrt(z);
double tmp;
if (y <= 9e-13) {
tmp = t_2 + (((y * 0.5) + 2.0) - t_1);
} else if (y <= 5.1e+22) {
tmp = 1.0 + ((sqrt((y + 1.0)) + (0.5 * sqrt((1.0 / z)))) - t_1);
} else {
tmp = (1.0 / (sqrt(x) + sqrt((1.0 + x)))) + t_2;
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = sqrt(y) + sqrt(x)
t_2 = sqrt((1.0d0 + z)) - sqrt(z)
if (y <= 9d-13) then
tmp = t_2 + (((y * 0.5d0) + 2.0d0) - t_1)
else if (y <= 5.1d+22) then
tmp = 1.0d0 + ((sqrt((y + 1.0d0)) + (0.5d0 * sqrt((1.0d0 / z)))) - t_1)
else
tmp = (1.0d0 / (sqrt(x) + sqrt((1.0d0 + x)))) + t_2
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt(y) + Math.sqrt(x);
double t_2 = Math.sqrt((1.0 + z)) - Math.sqrt(z);
double tmp;
if (y <= 9e-13) {
tmp = t_2 + (((y * 0.5) + 2.0) - t_1);
} else if (y <= 5.1e+22) {
tmp = 1.0 + ((Math.sqrt((y + 1.0)) + (0.5 * Math.sqrt((1.0 / z)))) - t_1);
} else {
tmp = (1.0 / (Math.sqrt(x) + Math.sqrt((1.0 + x)))) + t_2;
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt(y) + math.sqrt(x) t_2 = math.sqrt((1.0 + z)) - math.sqrt(z) tmp = 0 if y <= 9e-13: tmp = t_2 + (((y * 0.5) + 2.0) - t_1) elif y <= 5.1e+22: tmp = 1.0 + ((math.sqrt((y + 1.0)) + (0.5 * math.sqrt((1.0 / z)))) - t_1) else: tmp = (1.0 / (math.sqrt(x) + math.sqrt((1.0 + x)))) + t_2 return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = Float64(sqrt(y) + sqrt(x)) t_2 = Float64(sqrt(Float64(1.0 + z)) - sqrt(z)) tmp = 0.0 if (y <= 9e-13) tmp = Float64(t_2 + Float64(Float64(Float64(y * 0.5) + 2.0) - t_1)); elseif (y <= 5.1e+22) tmp = Float64(1.0 + Float64(Float64(sqrt(Float64(y + 1.0)) + Float64(0.5 * sqrt(Float64(1.0 / z)))) - t_1)); else tmp = Float64(Float64(1.0 / Float64(sqrt(x) + sqrt(Float64(1.0 + x)))) + t_2); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt(y) + sqrt(x);
t_2 = sqrt((1.0 + z)) - sqrt(z);
tmp = 0.0;
if (y <= 9e-13)
tmp = t_2 + (((y * 0.5) + 2.0) - t_1);
elseif (y <= 5.1e+22)
tmp = 1.0 + ((sqrt((y + 1.0)) + (0.5 * sqrt((1.0 / z)))) - t_1);
else
tmp = (1.0 / (sqrt(x) + sqrt((1.0 + x)))) + t_2;
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 9e-13], N[(t$95$2 + N[(N[(N[(y * 0.5), $MachinePrecision] + 2.0), $MachinePrecision] - t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 5.1e+22], N[(1.0 + N[(N[(N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision] + N[(0.5 * N[Sqrt[N[(1.0 / z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$2), $MachinePrecision]]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{y} + \sqrt{x}\\
t_2 := \sqrt{1 + z} - \sqrt{z}\\
\mathbf{if}\;y \leq 9 \cdot 10^{-13}:\\
\;\;\;\;t\_2 + \left(\left(y \cdot 0.5 + 2\right) - t\_1\right)\\
\mathbf{elif}\;y \leq 5.1 \cdot 10^{+22}:\\
\;\;\;\;1 + \left(\left(\sqrt{y + 1} + 0.5 \cdot \sqrt{\frac{1}{z}}\right) - t\_1\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{x} + \sqrt{1 + x}} + t\_2\\
\end{array}
\end{array}
if y < 9e-13Initial program 98.3%
associate-+l+98.3%
sub-neg98.3%
sub-neg98.3%
+-commutative98.3%
+-commutative98.3%
+-commutative98.3%
Simplified98.3%
Taylor expanded in x around 0 54.3%
Taylor expanded in t around inf 37.6%
Taylor expanded in y around 0 37.6%
if 9e-13 < y < 5.1000000000000002e22Initial program 78.8%
associate-+l+78.8%
sub-neg78.8%
sub-neg78.8%
+-commutative78.8%
+-commutative78.8%
+-commutative78.8%
Simplified78.8%
Taylor expanded in x around 0 47.3%
Taylor expanded in t around inf 35.3%
Taylor expanded in z around inf 34.5%
associate--l+34.5%
+-commutative34.5%
Simplified34.5%
if 5.1000000000000002e22 < y Initial program 86.7%
associate-+l+86.7%
sub-neg86.7%
sub-neg86.7%
+-commutative86.7%
+-commutative86.7%
+-commutative86.7%
Simplified86.7%
flip--86.9%
div-inv86.9%
add-sqr-sqrt64.3%
+-commutative64.3%
add-sqr-sqrt87.4%
+-commutative87.4%
Applied egg-rr87.4%
associate--l+90.9%
+-inverses90.9%
metadata-eval90.9%
*-lft-identity90.9%
+-commutative90.9%
Simplified90.9%
Taylor expanded in t around inf 46.6%
Taylor expanded in y around inf 46.6%
Final simplification41.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 y) (sqrt x))) (t_2 (- (sqrt (+ 1.0 z)) (sqrt z))))
(if (<= y 4.4e-13)
(+ t_2 (- 2.0 t_1))
(if (<= y 5.1e+22)
(+ 1.0 (- (+ (sqrt (+ y 1.0)) (* 0.5 (sqrt (/ 1.0 z)))) t_1))
(+ (/ 1.0 (+ (sqrt x) (sqrt (+ 1.0 x)))) t_2)))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt(y) + sqrt(x);
double t_2 = sqrt((1.0 + z)) - sqrt(z);
double tmp;
if (y <= 4.4e-13) {
tmp = t_2 + (2.0 - t_1);
} else if (y <= 5.1e+22) {
tmp = 1.0 + ((sqrt((y + 1.0)) + (0.5 * sqrt((1.0 / z)))) - t_1);
} else {
tmp = (1.0 / (sqrt(x) + sqrt((1.0 + x)))) + t_2;
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = sqrt(y) + sqrt(x)
t_2 = sqrt((1.0d0 + z)) - sqrt(z)
if (y <= 4.4d-13) then
tmp = t_2 + (2.0d0 - t_1)
else if (y <= 5.1d+22) then
tmp = 1.0d0 + ((sqrt((y + 1.0d0)) + (0.5d0 * sqrt((1.0d0 / z)))) - t_1)
else
tmp = (1.0d0 / (sqrt(x) + sqrt((1.0d0 + x)))) + t_2
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt(y) + Math.sqrt(x);
double t_2 = Math.sqrt((1.0 + z)) - Math.sqrt(z);
double tmp;
if (y <= 4.4e-13) {
tmp = t_2 + (2.0 - t_1);
} else if (y <= 5.1e+22) {
tmp = 1.0 + ((Math.sqrt((y + 1.0)) + (0.5 * Math.sqrt((1.0 / z)))) - t_1);
} else {
tmp = (1.0 / (Math.sqrt(x) + Math.sqrt((1.0 + x)))) + t_2;
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt(y) + math.sqrt(x) t_2 = math.sqrt((1.0 + z)) - math.sqrt(z) tmp = 0 if y <= 4.4e-13: tmp = t_2 + (2.0 - t_1) elif y <= 5.1e+22: tmp = 1.0 + ((math.sqrt((y + 1.0)) + (0.5 * math.sqrt((1.0 / z)))) - t_1) else: tmp = (1.0 / (math.sqrt(x) + math.sqrt((1.0 + x)))) + t_2 return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = Float64(sqrt(y) + sqrt(x)) t_2 = Float64(sqrt(Float64(1.0 + z)) - sqrt(z)) tmp = 0.0 if (y <= 4.4e-13) tmp = Float64(t_2 + Float64(2.0 - t_1)); elseif (y <= 5.1e+22) tmp = Float64(1.0 + Float64(Float64(sqrt(Float64(y + 1.0)) + Float64(0.5 * sqrt(Float64(1.0 / z)))) - t_1)); else tmp = Float64(Float64(1.0 / Float64(sqrt(x) + sqrt(Float64(1.0 + x)))) + t_2); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt(y) + sqrt(x);
t_2 = sqrt((1.0 + z)) - sqrt(z);
tmp = 0.0;
if (y <= 4.4e-13)
tmp = t_2 + (2.0 - t_1);
elseif (y <= 5.1e+22)
tmp = 1.0 + ((sqrt((y + 1.0)) + (0.5 * sqrt((1.0 / z)))) - t_1);
else
tmp = (1.0 / (sqrt(x) + sqrt((1.0 + x)))) + t_2;
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 4.4e-13], N[(t$95$2 + N[(2.0 - t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 5.1e+22], N[(1.0 + N[(N[(N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision] + N[(0.5 * N[Sqrt[N[(1.0 / z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$2), $MachinePrecision]]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{y} + \sqrt{x}\\
t_2 := \sqrt{1 + z} - \sqrt{z}\\
\mathbf{if}\;y \leq 4.4 \cdot 10^{-13}:\\
\;\;\;\;t\_2 + \left(2 - t\_1\right)\\
\mathbf{elif}\;y \leq 5.1 \cdot 10^{+22}:\\
\;\;\;\;1 + \left(\left(\sqrt{y + 1} + 0.5 \cdot \sqrt{\frac{1}{z}}\right) - t\_1\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{x} + \sqrt{1 + x}} + t\_2\\
\end{array}
\end{array}
if y < 4.39999999999999993e-13Initial program 98.3%
associate-+l+98.3%
sub-neg98.3%
sub-neg98.3%
+-commutative98.3%
+-commutative98.3%
+-commutative98.3%
Simplified98.3%
Taylor expanded in x around 0 54.3%
Taylor expanded in t around inf 37.6%
Taylor expanded in y around 0 37.6%
if 4.39999999999999993e-13 < y < 5.1000000000000002e22Initial program 78.8%
associate-+l+78.8%
sub-neg78.8%
sub-neg78.8%
+-commutative78.8%
+-commutative78.8%
+-commutative78.8%
Simplified78.8%
Taylor expanded in x around 0 47.3%
Taylor expanded in t around inf 35.3%
Taylor expanded in z around inf 34.5%
associate--l+34.5%
+-commutative34.5%
Simplified34.5%
if 5.1000000000000002e22 < y Initial program 86.7%
associate-+l+86.7%
sub-neg86.7%
sub-neg86.7%
+-commutative86.7%
+-commutative86.7%
+-commutative86.7%
Simplified86.7%
flip--86.9%
div-inv86.9%
add-sqr-sqrt64.3%
+-commutative64.3%
add-sqr-sqrt87.4%
+-commutative87.4%
Applied egg-rr87.4%
associate--l+90.9%
+-inverses90.9%
metadata-eval90.9%
*-lft-identity90.9%
+-commutative90.9%
Simplified90.9%
Taylor expanded in t around inf 46.6%
Taylor expanded in y around inf 46.6%
Final simplification41.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 y) (sqrt x))) (t_2 (- (sqrt (+ 1.0 z)) (sqrt z))))
(if (<= y 1.15e-12)
(+ t_2 (- 2.0 t_1))
(if (<= y 2.6e+14)
(+ (sqrt (+ y 1.0)) (- 1.0 t_1))
(+ (/ 1.0 (+ (sqrt x) (sqrt (+ 1.0 x)))) t_2)))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt(y) + sqrt(x);
double t_2 = sqrt((1.0 + z)) - sqrt(z);
double tmp;
if (y <= 1.15e-12) {
tmp = t_2 + (2.0 - t_1);
} else if (y <= 2.6e+14) {
tmp = sqrt((y + 1.0)) + (1.0 - t_1);
} else {
tmp = (1.0 / (sqrt(x) + sqrt((1.0 + x)))) + t_2;
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = sqrt(y) + sqrt(x)
t_2 = sqrt((1.0d0 + z)) - sqrt(z)
if (y <= 1.15d-12) then
tmp = t_2 + (2.0d0 - t_1)
else if (y <= 2.6d+14) then
tmp = sqrt((y + 1.0d0)) + (1.0d0 - t_1)
else
tmp = (1.0d0 / (sqrt(x) + sqrt((1.0d0 + x)))) + t_2
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt(y) + Math.sqrt(x);
double t_2 = Math.sqrt((1.0 + z)) - Math.sqrt(z);
double tmp;
if (y <= 1.15e-12) {
tmp = t_2 + (2.0 - t_1);
} else if (y <= 2.6e+14) {
tmp = Math.sqrt((y + 1.0)) + (1.0 - t_1);
} else {
tmp = (1.0 / (Math.sqrt(x) + Math.sqrt((1.0 + x)))) + t_2;
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt(y) + math.sqrt(x) t_2 = math.sqrt((1.0 + z)) - math.sqrt(z) tmp = 0 if y <= 1.15e-12: tmp = t_2 + (2.0 - t_1) elif y <= 2.6e+14: tmp = math.sqrt((y + 1.0)) + (1.0 - t_1) else: tmp = (1.0 / (math.sqrt(x) + math.sqrt((1.0 + x)))) + t_2 return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = Float64(sqrt(y) + sqrt(x)) t_2 = Float64(sqrt(Float64(1.0 + z)) - sqrt(z)) tmp = 0.0 if (y <= 1.15e-12) tmp = Float64(t_2 + Float64(2.0 - t_1)); elseif (y <= 2.6e+14) tmp = Float64(sqrt(Float64(y + 1.0)) + Float64(1.0 - t_1)); else tmp = Float64(Float64(1.0 / Float64(sqrt(x) + sqrt(Float64(1.0 + x)))) + t_2); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt(y) + sqrt(x);
t_2 = sqrt((1.0 + z)) - sqrt(z);
tmp = 0.0;
if (y <= 1.15e-12)
tmp = t_2 + (2.0 - t_1);
elseif (y <= 2.6e+14)
tmp = sqrt((y + 1.0)) + (1.0 - t_1);
else
tmp = (1.0 / (sqrt(x) + sqrt((1.0 + x)))) + t_2;
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 1.15e-12], N[(t$95$2 + N[(2.0 - t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.6e+14], N[(N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision] + N[(1.0 - t$95$1), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$2), $MachinePrecision]]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{y} + \sqrt{x}\\
t_2 := \sqrt{1 + z} - \sqrt{z}\\
\mathbf{if}\;y \leq 1.15 \cdot 10^{-12}:\\
\;\;\;\;t\_2 + \left(2 - t\_1\right)\\
\mathbf{elif}\;y \leq 2.6 \cdot 10^{+14}:\\
\;\;\;\;\sqrt{y + 1} + \left(1 - t\_1\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{x} + \sqrt{1 + x}} + t\_2\\
\end{array}
\end{array}
if y < 1.14999999999999995e-12Initial program 98.1%
associate-+l+98.1%
sub-neg98.1%
sub-neg98.1%
+-commutative98.1%
+-commutative98.1%
+-commutative98.1%
Simplified98.1%
Taylor expanded in x around 0 53.9%
Taylor expanded in t around inf 37.4%
Taylor expanded in y around 0 37.4%
if 1.14999999999999995e-12 < y < 2.6e14Initial program 94.9%
associate-+l+94.9%
sub-neg94.9%
sub-neg94.9%
+-commutative94.9%
+-commutative94.9%
+-commutative94.9%
Simplified94.9%
Taylor expanded in x around 0 66.9%
Taylor expanded in t around inf 44.6%
Taylor expanded in z around inf 44.4%
+-commutative44.4%
associate--l+44.4%
Simplified44.4%
if 2.6e14 < y Initial program 85.5%
associate-+l+85.5%
sub-neg85.5%
sub-neg85.5%
+-commutative85.5%
+-commutative85.5%
+-commutative85.5%
Simplified85.5%
flip--85.7%
div-inv85.7%
add-sqr-sqrt63.0%
+-commutative63.0%
add-sqr-sqrt86.2%
+-commutative86.2%
Applied egg-rr86.2%
associate--l+89.5%
+-inverses89.5%
metadata-eval89.5%
*-lft-identity89.5%
+-commutative89.5%
Simplified89.5%
Taylor expanded in t around inf 46.6%
Taylor expanded in y around inf 46.6%
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 y) (sqrt x))) (t_2 (sqrt (+ 1.0 z))))
(if (<= y 6.2e-12)
(+ (- t_2 (sqrt z)) (- 2.0 t_1))
(if (<= y 2.7e+14)
(+ (sqrt (+ y 1.0)) (- 1.0 t_1))
(+ 1.0 (- t_2 (+ (sqrt x) (sqrt z))))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt(y) + sqrt(x);
double t_2 = sqrt((1.0 + z));
double tmp;
if (y <= 6.2e-12) {
tmp = (t_2 - sqrt(z)) + (2.0 - t_1);
} else if (y <= 2.7e+14) {
tmp = sqrt((y + 1.0)) + (1.0 - t_1);
} else {
tmp = 1.0 + (t_2 - (sqrt(x) + sqrt(z)));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = sqrt(y) + sqrt(x)
t_2 = sqrt((1.0d0 + z))
if (y <= 6.2d-12) then
tmp = (t_2 - sqrt(z)) + (2.0d0 - t_1)
else if (y <= 2.7d+14) then
tmp = sqrt((y + 1.0d0)) + (1.0d0 - t_1)
else
tmp = 1.0d0 + (t_2 - (sqrt(x) + sqrt(z)))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt(y) + Math.sqrt(x);
double t_2 = Math.sqrt((1.0 + z));
double tmp;
if (y <= 6.2e-12) {
tmp = (t_2 - Math.sqrt(z)) + (2.0 - t_1);
} else if (y <= 2.7e+14) {
tmp = Math.sqrt((y + 1.0)) + (1.0 - t_1);
} else {
tmp = 1.0 + (t_2 - (Math.sqrt(x) + Math.sqrt(z)));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt(y) + math.sqrt(x) t_2 = math.sqrt((1.0 + z)) tmp = 0 if y <= 6.2e-12: tmp = (t_2 - math.sqrt(z)) + (2.0 - t_1) elif y <= 2.7e+14: tmp = math.sqrt((y + 1.0)) + (1.0 - t_1) else: tmp = 1.0 + (t_2 - (math.sqrt(x) + math.sqrt(z))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = Float64(sqrt(y) + sqrt(x)) t_2 = sqrt(Float64(1.0 + z)) tmp = 0.0 if (y <= 6.2e-12) tmp = Float64(Float64(t_2 - sqrt(z)) + Float64(2.0 - t_1)); elseif (y <= 2.7e+14) tmp = Float64(sqrt(Float64(y + 1.0)) + Float64(1.0 - t_1)); else tmp = Float64(1.0 + Float64(t_2 - Float64(sqrt(x) + sqrt(z)))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt(y) + sqrt(x);
t_2 = sqrt((1.0 + z));
tmp = 0.0;
if (y <= 6.2e-12)
tmp = (t_2 - sqrt(z)) + (2.0 - t_1);
elseif (y <= 2.7e+14)
tmp = sqrt((y + 1.0)) + (1.0 - t_1);
else
tmp = 1.0 + (t_2 - (sqrt(x) + sqrt(z)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y, 6.2e-12], N[(N[(t$95$2 - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] + N[(2.0 - t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.7e+14], N[(N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision] + N[(1.0 - t$95$1), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(t$95$2 - N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{y} + \sqrt{x}\\
t_2 := \sqrt{1 + z}\\
\mathbf{if}\;y \leq 6.2 \cdot 10^{-12}:\\
\;\;\;\;\left(t\_2 - \sqrt{z}\right) + \left(2 - t\_1\right)\\
\mathbf{elif}\;y \leq 2.7 \cdot 10^{+14}:\\
\;\;\;\;\sqrt{y + 1} + \left(1 - t\_1\right)\\
\mathbf{else}:\\
\;\;\;\;1 + \left(t\_2 - \left(\sqrt{x} + \sqrt{z}\right)\right)\\
\end{array}
\end{array}
if y < 6.2000000000000002e-12Initial program 98.1%
associate-+l+98.1%
sub-neg98.1%
sub-neg98.1%
+-commutative98.1%
+-commutative98.1%
+-commutative98.1%
Simplified98.1%
Taylor expanded in x around 0 53.9%
Taylor expanded in t around inf 37.4%
Taylor expanded in y around 0 37.4%
if 6.2000000000000002e-12 < y < 2.7e14Initial program 94.9%
associate-+l+94.9%
sub-neg94.9%
sub-neg94.9%
+-commutative94.9%
+-commutative94.9%
+-commutative94.9%
Simplified94.9%
Taylor expanded in x around 0 66.9%
Taylor expanded in t around inf 44.6%
Taylor expanded in z around inf 44.4%
+-commutative44.4%
associate--l+44.4%
Simplified44.4%
if 2.7e14 < y Initial program 85.5%
associate-+l+85.5%
sub-neg85.5%
sub-neg85.5%
+-commutative85.5%
+-commutative85.5%
+-commutative85.5%
Simplified85.5%
Taylor expanded in x around 0 42.8%
Taylor expanded in t around inf 26.8%
Taylor expanded in y around inf 17.4%
associate--l+29.5%
+-commutative29.5%
Simplified29.5%
Final simplification34.0%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ 1.0 z))))
(if (<= y 5.2e-28)
(+ (- t_1 (sqrt z)) (- (+ (* y 0.5) 2.0) (sqrt x)))
(if (<= y 2.9e+14)
(+ (sqrt (+ y 1.0)) (- 1.0 (+ (sqrt y) (sqrt x))))
(+ 1.0 (- t_1 (+ (sqrt x) (sqrt z))))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + z));
double tmp;
if (y <= 5.2e-28) {
tmp = (t_1 - sqrt(z)) + (((y * 0.5) + 2.0) - sqrt(x));
} else if (y <= 2.9e+14) {
tmp = sqrt((y + 1.0)) + (1.0 - (sqrt(y) + sqrt(x)));
} else {
tmp = 1.0 + (t_1 - (sqrt(x) + sqrt(z)));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = sqrt((1.0d0 + z))
if (y <= 5.2d-28) then
tmp = (t_1 - sqrt(z)) + (((y * 0.5d0) + 2.0d0) - sqrt(x))
else if (y <= 2.9d+14) then
tmp = sqrt((y + 1.0d0)) + (1.0d0 - (sqrt(y) + sqrt(x)))
else
tmp = 1.0d0 + (t_1 - (sqrt(x) + sqrt(z)))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + z));
double tmp;
if (y <= 5.2e-28) {
tmp = (t_1 - Math.sqrt(z)) + (((y * 0.5) + 2.0) - Math.sqrt(x));
} else if (y <= 2.9e+14) {
tmp = Math.sqrt((y + 1.0)) + (1.0 - (Math.sqrt(y) + Math.sqrt(x)));
} else {
tmp = 1.0 + (t_1 - (Math.sqrt(x) + Math.sqrt(z)));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + z)) tmp = 0 if y <= 5.2e-28: tmp = (t_1 - math.sqrt(z)) + (((y * 0.5) + 2.0) - math.sqrt(x)) elif y <= 2.9e+14: tmp = math.sqrt((y + 1.0)) + (1.0 - (math.sqrt(y) + math.sqrt(x))) else: tmp = 1.0 + (t_1 - (math.sqrt(x) + math.sqrt(z))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(1.0 + z)) tmp = 0.0 if (y <= 5.2e-28) tmp = Float64(Float64(t_1 - sqrt(z)) + Float64(Float64(Float64(y * 0.5) + 2.0) - sqrt(x))); elseif (y <= 2.9e+14) tmp = Float64(sqrt(Float64(y + 1.0)) + Float64(1.0 - Float64(sqrt(y) + sqrt(x)))); else tmp = Float64(1.0 + Float64(t_1 - Float64(sqrt(x) + sqrt(z)))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + z));
tmp = 0.0;
if (y <= 5.2e-28)
tmp = (t_1 - sqrt(z)) + (((y * 0.5) + 2.0) - sqrt(x));
elseif (y <= 2.9e+14)
tmp = sqrt((y + 1.0)) + (1.0 - (sqrt(y) + sqrt(x)));
else
tmp = 1.0 + (t_1 - (sqrt(x) + sqrt(z)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y, 5.2e-28], N[(N[(t$95$1 - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] + N[(N[(N[(y * 0.5), $MachinePrecision] + 2.0), $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.9e+14], N[(N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision] + N[(1.0 - N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(t$95$1 - N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + z}\\
\mathbf{if}\;y \leq 5.2 \cdot 10^{-28}:\\
\;\;\;\;\left(t\_1 - \sqrt{z}\right) + \left(\left(y \cdot 0.5 + 2\right) - \sqrt{x}\right)\\
\mathbf{elif}\;y \leq 2.9 \cdot 10^{+14}:\\
\;\;\;\;\sqrt{y + 1} + \left(1 - \left(\sqrt{y} + \sqrt{x}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;1 + \left(t\_1 - \left(\sqrt{x} + \sqrt{z}\right)\right)\\
\end{array}
\end{array}
if y < 5.2e-28Initial program 98.2%
associate-+l+98.2%
sub-neg98.2%
sub-neg98.2%
+-commutative98.2%
+-commutative98.2%
+-commutative98.2%
Simplified98.2%
Taylor expanded in x around 0 55.6%
Taylor expanded in t around inf 38.9%
Taylor expanded in y around 0 38.9%
Taylor expanded in x around inf 38.9%
if 5.2e-28 < y < 2.9e14Initial program 94.9%
associate-+l+94.9%
sub-neg94.9%
sub-neg94.9%
+-commutative94.9%
+-commutative94.9%
+-commutative94.9%
Simplified94.9%
Taylor expanded in x around 0 44.3%
Taylor expanded in t around inf 26.1%
Taylor expanded in z around inf 26.0%
+-commutative26.0%
associate--l+26.0%
Simplified26.0%
if 2.9e14 < y Initial program 85.5%
associate-+l+85.5%
sub-neg85.5%
sub-neg85.5%
+-commutative85.5%
+-commutative85.5%
+-commutative85.5%
Simplified85.5%
Taylor expanded in x around 0 42.8%
Taylor expanded in t around inf 26.8%
Taylor expanded in y around inf 17.4%
associate--l+29.5%
+-commutative29.5%
Simplified29.5%
Final simplification34.0%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ 1.0 z))) (t_2 (+ (sqrt x) (sqrt z))))
(if (<= z 13500000000000.0)
(- (+ t_1 2.0) t_2)
(if (<= z 1.8e+198)
(- (+ 1.0 (sqrt (+ y 1.0))) (+ (sqrt y) (sqrt x)))
(+ 1.0 (- 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 + z));
double t_2 = sqrt(x) + sqrt(z);
double tmp;
if (z <= 13500000000000.0) {
tmp = (t_1 + 2.0) - t_2;
} else if (z <= 1.8e+198) {
tmp = (1.0 + sqrt((y + 1.0))) - (sqrt(y) + sqrt(x));
} else {
tmp = 1.0 + (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 + z))
t_2 = sqrt(x) + sqrt(z)
if (z <= 13500000000000.0d0) then
tmp = (t_1 + 2.0d0) - t_2
else if (z <= 1.8d+198) then
tmp = (1.0d0 + sqrt((y + 1.0d0))) - (sqrt(y) + sqrt(x))
else
tmp = 1.0d0 + (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 + z));
double t_2 = Math.sqrt(x) + Math.sqrt(z);
double tmp;
if (z <= 13500000000000.0) {
tmp = (t_1 + 2.0) - t_2;
} else if (z <= 1.8e+198) {
tmp = (1.0 + Math.sqrt((y + 1.0))) - (Math.sqrt(y) + Math.sqrt(x));
} else {
tmp = 1.0 + (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 + z)) t_2 = math.sqrt(x) + math.sqrt(z) tmp = 0 if z <= 13500000000000.0: tmp = (t_1 + 2.0) - t_2 elif z <= 1.8e+198: tmp = (1.0 + math.sqrt((y + 1.0))) - (math.sqrt(y) + math.sqrt(x)) else: tmp = 1.0 + (t_1 - 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 + z)) t_2 = Float64(sqrt(x) + sqrt(z)) tmp = 0.0 if (z <= 13500000000000.0) tmp = Float64(Float64(t_1 + 2.0) - t_2); elseif (z <= 1.8e+198) tmp = Float64(Float64(1.0 + sqrt(Float64(y + 1.0))) - Float64(sqrt(y) + sqrt(x))); else tmp = Float64(1.0 + 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 + z));
t_2 = sqrt(x) + sqrt(z);
tmp = 0.0;
if (z <= 13500000000000.0)
tmp = (t_1 + 2.0) - t_2;
elseif (z <= 1.8e+198)
tmp = (1.0 + sqrt((y + 1.0))) - (sqrt(y) + sqrt(x));
else
tmp = 1.0 + (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[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, 13500000000000.0], N[(N[(t$95$1 + 2.0), $MachinePrecision] - t$95$2), $MachinePrecision], If[LessEqual[z, 1.8e+198], N[(N[(1.0 + N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + 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 + z}\\
t_2 := \sqrt{x} + \sqrt{z}\\
\mathbf{if}\;z \leq 13500000000000:\\
\;\;\;\;\left(t\_1 + 2\right) - t\_2\\
\mathbf{elif}\;z \leq 1.8 \cdot 10^{+198}:\\
\;\;\;\;\left(1 + \sqrt{y + 1}\right) - \left(\sqrt{y} + \sqrt{x}\right)\\
\mathbf{else}:\\
\;\;\;\;1 + \left(t\_1 - t\_2\right)\\
\end{array}
\end{array}
if z < 1.35e13Initial program 97.9%
associate-+l+97.9%
sub-neg97.9%
sub-neg97.9%
+-commutative97.9%
+-commutative97.9%
+-commutative97.9%
Simplified97.9%
Taylor expanded in x around 0 46.7%
Taylor expanded in t around inf 32.0%
Taylor expanded in y around 0 18.6%
Taylor expanded in z around inf 27.6%
if 1.35e13 < z < 1.8000000000000001e198Initial program 83.0%
associate-+l+83.0%
sub-neg83.0%
sub-neg83.0%
+-commutative83.0%
+-commutative83.0%
+-commutative83.0%
Simplified83.0%
Taylor expanded in x around 0 46.3%
Taylor expanded in t around inf 28.5%
Taylor expanded in z around inf 22.7%
if 1.8000000000000001e198 < z Initial program 92.1%
associate-+l+92.1%
sub-neg92.1%
sub-neg92.1%
+-commutative92.1%
+-commutative92.1%
+-commutative92.1%
Simplified92.1%
Taylor expanded in x around 0 60.8%
Taylor expanded in t around inf 41.9%
Taylor expanded in y around inf 3.0%
associate--l+39.8%
+-commutative39.8%
Simplified39.8%
Final simplification28.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 (<= z 0.225)
(- 3.0 (+ (sqrt x) (+ (sqrt y) (sqrt z))))
(if (<= z 1.85e+198)
(- (+ 1.0 (sqrt (+ y 1.0))) (+ (sqrt y) (sqrt x)))
(+ 1.0 (- (sqrt (+ 1.0 z)) (+ (sqrt x) (sqrt z)))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (z <= 0.225) {
tmp = 3.0 - (sqrt(x) + (sqrt(y) + sqrt(z)));
} else if (z <= 1.85e+198) {
tmp = (1.0 + sqrt((y + 1.0))) - (sqrt(y) + sqrt(x));
} else {
tmp = 1.0 + (sqrt((1.0 + z)) - (sqrt(x) + sqrt(z)));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (z <= 0.225d0) then
tmp = 3.0d0 - (sqrt(x) + (sqrt(y) + sqrt(z)))
else if (z <= 1.85d+198) then
tmp = (1.0d0 + sqrt((y + 1.0d0))) - (sqrt(y) + sqrt(x))
else
tmp = 1.0d0 + (sqrt((1.0d0 + z)) - (sqrt(x) + sqrt(z)))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= 0.225) {
tmp = 3.0 - (Math.sqrt(x) + (Math.sqrt(y) + Math.sqrt(z)));
} else if (z <= 1.85e+198) {
tmp = (1.0 + Math.sqrt((y + 1.0))) - (Math.sqrt(y) + Math.sqrt(x));
} else {
tmp = 1.0 + (Math.sqrt((1.0 + z)) - (Math.sqrt(x) + Math.sqrt(z)));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if z <= 0.225: tmp = 3.0 - (math.sqrt(x) + (math.sqrt(y) + math.sqrt(z))) elif z <= 1.85e+198: tmp = (1.0 + math.sqrt((y + 1.0))) - (math.sqrt(y) + math.sqrt(x)) else: tmp = 1.0 + (math.sqrt((1.0 + z)) - (math.sqrt(x) + math.sqrt(z))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (z <= 0.225) tmp = Float64(3.0 - Float64(sqrt(x) + Float64(sqrt(y) + sqrt(z)))); elseif (z <= 1.85e+198) tmp = Float64(Float64(1.0 + sqrt(Float64(y + 1.0))) - Float64(sqrt(y) + sqrt(x))); else tmp = Float64(1.0 + Float64(sqrt(Float64(1.0 + z)) - Float64(sqrt(x) + sqrt(z)))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (z <= 0.225)
tmp = 3.0 - (sqrt(x) + (sqrt(y) + sqrt(z)));
elseif (z <= 1.85e+198)
tmp = (1.0 + sqrt((y + 1.0))) - (sqrt(y) + sqrt(x));
else
tmp = 1.0 + (sqrt((1.0 + z)) - (sqrt(x) + sqrt(z)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[z, 0.225], N[(3.0 - N[(N[Sqrt[x], $MachinePrecision] + N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.85e+198], N[(N[(1.0 + N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq 0.225:\\
\;\;\;\;3 - \left(\sqrt{x} + \left(\sqrt{y} + \sqrt{z}\right)\right)\\
\mathbf{elif}\;z \leq 1.85 \cdot 10^{+198}:\\
\;\;\;\;\left(1 + \sqrt{y + 1}\right) - \left(\sqrt{y} + \sqrt{x}\right)\\
\mathbf{else}:\\
\;\;\;\;1 + \left(\sqrt{1 + z} - \left(\sqrt{x} + \sqrt{z}\right)\right)\\
\end{array}
\end{array}
if z < 0.225000000000000006Initial program 98.3%
associate-+l+98.3%
sub-neg98.3%
sub-neg98.3%
+-commutative98.3%
+-commutative98.3%
+-commutative98.3%
Simplified98.3%
Taylor expanded in x around 0 46.1%
Taylor expanded in t around inf 32.4%
Taylor expanded in y around 0 18.3%
Taylor expanded in z around 0 18.3%
if 0.225000000000000006 < z < 1.8499999999999999e198Initial program 83.4%
associate-+l+83.4%
sub-neg83.4%
sub-neg83.4%
+-commutative83.4%
+-commutative83.4%
+-commutative83.4%
Simplified83.4%
Taylor expanded in x around 0 47.3%
Taylor expanded in t around inf 28.3%
Taylor expanded in z around inf 22.2%
if 1.8499999999999999e198 < z Initial program 92.1%
associate-+l+92.1%
sub-neg92.1%
sub-neg92.1%
+-commutative92.1%
+-commutative92.1%
+-commutative92.1%
Simplified92.1%
Taylor expanded in x around 0 60.8%
Taylor expanded in t around inf 41.9%
Taylor expanded in y around inf 3.0%
associate--l+39.8%
+-commutative39.8%
Simplified39.8%
Final simplification23.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 0.34)
(- 3.0 (+ (sqrt x) (+ (sqrt y) (sqrt z))))
(if (<= z 1.85e+198)
(+ (sqrt (+ y 1.0)) (- 1.0 (+ (sqrt y) (sqrt x))))
(+ 1.0 (- (sqrt (+ 1.0 z)) (+ (sqrt x) (sqrt z)))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (z <= 0.34) {
tmp = 3.0 - (sqrt(x) + (sqrt(y) + sqrt(z)));
} else if (z <= 1.85e+198) {
tmp = sqrt((y + 1.0)) + (1.0 - (sqrt(y) + sqrt(x)));
} else {
tmp = 1.0 + (sqrt((1.0 + z)) - (sqrt(x) + sqrt(z)));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (z <= 0.34d0) then
tmp = 3.0d0 - (sqrt(x) + (sqrt(y) + sqrt(z)))
else if (z <= 1.85d+198) then
tmp = sqrt((y + 1.0d0)) + (1.0d0 - (sqrt(y) + sqrt(x)))
else
tmp = 1.0d0 + (sqrt((1.0d0 + z)) - (sqrt(x) + sqrt(z)))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= 0.34) {
tmp = 3.0 - (Math.sqrt(x) + (Math.sqrt(y) + Math.sqrt(z)));
} else if (z <= 1.85e+198) {
tmp = Math.sqrt((y + 1.0)) + (1.0 - (Math.sqrt(y) + Math.sqrt(x)));
} else {
tmp = 1.0 + (Math.sqrt((1.0 + z)) - (Math.sqrt(x) + Math.sqrt(z)));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if z <= 0.34: tmp = 3.0 - (math.sqrt(x) + (math.sqrt(y) + math.sqrt(z))) elif z <= 1.85e+198: tmp = math.sqrt((y + 1.0)) + (1.0 - (math.sqrt(y) + math.sqrt(x))) else: tmp = 1.0 + (math.sqrt((1.0 + z)) - (math.sqrt(x) + math.sqrt(z))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (z <= 0.34) tmp = Float64(3.0 - Float64(sqrt(x) + Float64(sqrt(y) + sqrt(z)))); elseif (z <= 1.85e+198) tmp = Float64(sqrt(Float64(y + 1.0)) + Float64(1.0 - Float64(sqrt(y) + sqrt(x)))); else tmp = Float64(1.0 + Float64(sqrt(Float64(1.0 + z)) - Float64(sqrt(x) + sqrt(z)))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (z <= 0.34)
tmp = 3.0 - (sqrt(x) + (sqrt(y) + sqrt(z)));
elseif (z <= 1.85e+198)
tmp = sqrt((y + 1.0)) + (1.0 - (sqrt(y) + sqrt(x)));
else
tmp = 1.0 + (sqrt((1.0 + z)) - (sqrt(x) + sqrt(z)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[z, 0.34], N[(3.0 - N[(N[Sqrt[x], $MachinePrecision] + N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.85e+198], N[(N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision] + N[(1.0 - N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq 0.34:\\
\;\;\;\;3 - \left(\sqrt{x} + \left(\sqrt{y} + \sqrt{z}\right)\right)\\
\mathbf{elif}\;z \leq 1.85 \cdot 10^{+198}:\\
\;\;\;\;\sqrt{y + 1} + \left(1 - \left(\sqrt{y} + \sqrt{x}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;1 + \left(\sqrt{1 + z} - \left(\sqrt{x} + \sqrt{z}\right)\right)\\
\end{array}
\end{array}
if z < 0.340000000000000024Initial program 98.3%
associate-+l+98.3%
sub-neg98.3%
sub-neg98.3%
+-commutative98.3%
+-commutative98.3%
+-commutative98.3%
Simplified98.3%
Taylor expanded in x around 0 46.1%
Taylor expanded in t around inf 32.4%
Taylor expanded in y around 0 18.3%
Taylor expanded in z around 0 18.3%
if 0.340000000000000024 < z < 1.8499999999999999e198Initial program 83.4%
associate-+l+83.4%
sub-neg83.4%
sub-neg83.4%
+-commutative83.4%
+-commutative83.4%
+-commutative83.4%
Simplified83.4%
Taylor expanded in x around 0 47.3%
Taylor expanded in t around inf 28.3%
Taylor expanded in z around inf 22.2%
+-commutative22.2%
associate--l+22.2%
Simplified22.2%
if 1.8499999999999999e198 < z Initial program 92.1%
associate-+l+92.1%
sub-neg92.1%
sub-neg92.1%
+-commutative92.1%
+-commutative92.1%
+-commutative92.1%
Simplified92.1%
Taylor expanded in x around 0 60.8%
Taylor expanded in t around inf 41.9%
Taylor expanded in y around inf 3.0%
associate--l+39.8%
+-commutative39.8%
Simplified39.8%
Final simplification23.5%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= y 1.45) (- (+ (* y 0.5) 2.0) (+ (sqrt y) (sqrt x))) (+ 1.0 (- (sqrt (+ 1.0 z)) (+ (sqrt x) (sqrt z))))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 1.45) {
tmp = ((y * 0.5) + 2.0) - (sqrt(y) + sqrt(x));
} else {
tmp = 1.0 + (sqrt((1.0 + z)) - (sqrt(x) + sqrt(z)));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= 1.45d0) then
tmp = ((y * 0.5d0) + 2.0d0) - (sqrt(y) + sqrt(x))
else
tmp = 1.0d0 + (sqrt((1.0d0 + z)) - (sqrt(x) + sqrt(z)))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= 1.45) {
tmp = ((y * 0.5) + 2.0) - (Math.sqrt(y) + Math.sqrt(x));
} else {
tmp = 1.0 + (Math.sqrt((1.0 + z)) - (Math.sqrt(x) + Math.sqrt(z)));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if y <= 1.45: tmp = ((y * 0.5) + 2.0) - (math.sqrt(y) + math.sqrt(x)) else: tmp = 1.0 + (math.sqrt((1.0 + z)) - (math.sqrt(x) + math.sqrt(z))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (y <= 1.45) tmp = Float64(Float64(Float64(y * 0.5) + 2.0) - Float64(sqrt(y) + sqrt(x))); else tmp = Float64(1.0 + Float64(sqrt(Float64(1.0 + z)) - Float64(sqrt(x) + sqrt(z)))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (y <= 1.45)
tmp = ((y * 0.5) + 2.0) - (sqrt(y) + sqrt(x));
else
tmp = 1.0 + (sqrt((1.0 + z)) - (sqrt(x) + sqrt(z)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[y, 1.45], N[(N[(N[(y * 0.5), $MachinePrecision] + 2.0), $MachinePrecision] - N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 1.45:\\
\;\;\;\;\left(y \cdot 0.5 + 2\right) - \left(\sqrt{y} + \sqrt{x}\right)\\
\mathbf{else}:\\
\;\;\;\;1 + \left(\sqrt{1 + z} - \left(\sqrt{x} + \sqrt{z}\right)\right)\\
\end{array}
\end{array}
if y < 1.44999999999999996Initial program 98.1%
associate-+l+98.1%
sub-neg98.1%
sub-neg98.1%
+-commutative98.1%
+-commutative98.1%
+-commutative98.1%
Simplified98.1%
Taylor expanded in x around 0 53.8%
Taylor expanded in t around inf 37.2%
Taylor expanded in y around 0 36.9%
Taylor expanded in z around inf 25.4%
if 1.44999999999999996 < y Initial program 85.5%
associate-+l+85.5%
sub-neg85.5%
sub-neg85.5%
+-commutative85.5%
+-commutative85.5%
+-commutative85.5%
Simplified85.5%
Taylor expanded in x around 0 43.9%
Taylor expanded in t around inf 27.7%
Taylor expanded in y around inf 17.4%
associate--l+29.5%
+-commutative29.5%
Simplified29.5%
Final simplification27.4%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= z 0.34) (- 3.0 (+ (sqrt x) (+ (sqrt y) (sqrt z)))) (- (+ (* y 0.5) 2.0) (+ (sqrt y) (sqrt x)))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (z <= 0.34) {
tmp = 3.0 - (sqrt(x) + (sqrt(y) + sqrt(z)));
} else {
tmp = ((y * 0.5) + 2.0) - (sqrt(y) + sqrt(x));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (z <= 0.34d0) then
tmp = 3.0d0 - (sqrt(x) + (sqrt(y) + sqrt(z)))
else
tmp = ((y * 0.5d0) + 2.0d0) - (sqrt(y) + sqrt(x))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= 0.34) {
tmp = 3.0 - (Math.sqrt(x) + (Math.sqrt(y) + Math.sqrt(z)));
} else {
tmp = ((y * 0.5) + 2.0) - (Math.sqrt(y) + Math.sqrt(x));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if z <= 0.34: tmp = 3.0 - (math.sqrt(x) + (math.sqrt(y) + math.sqrt(z))) else: tmp = ((y * 0.5) + 2.0) - (math.sqrt(y) + math.sqrt(x)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (z <= 0.34) tmp = Float64(3.0 - Float64(sqrt(x) + Float64(sqrt(y) + sqrt(z)))); else tmp = Float64(Float64(Float64(y * 0.5) + 2.0) - Float64(sqrt(y) + sqrt(x))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (z <= 0.34)
tmp = 3.0 - (sqrt(x) + (sqrt(y) + sqrt(z)));
else
tmp = ((y * 0.5) + 2.0) - (sqrt(y) + sqrt(x));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[z, 0.34], N[(3.0 - N[(N[Sqrt[x], $MachinePrecision] + N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(y * 0.5), $MachinePrecision] + 2.0), $MachinePrecision] - N[(N[Sqrt[y], $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 0.34:\\
\;\;\;\;3 - \left(\sqrt{x} + \left(\sqrt{y} + \sqrt{z}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(y \cdot 0.5 + 2\right) - \left(\sqrt{y} + \sqrt{x}\right)\\
\end{array}
\end{array}
if z < 0.340000000000000024Initial program 98.3%
associate-+l+98.3%
sub-neg98.3%
sub-neg98.3%
+-commutative98.3%
+-commutative98.3%
+-commutative98.3%
Simplified98.3%
Taylor expanded in x around 0 46.1%
Taylor expanded in t around inf 32.4%
Taylor expanded in y around 0 18.3%
Taylor expanded in z around 0 18.3%
if 0.340000000000000024 < z Initial program 86.5%
associate-+l+86.5%
sub-neg86.5%
sub-neg86.5%
+-commutative86.5%
+-commutative86.5%
+-commutative86.5%
Simplified86.5%
Taylor expanded in x around 0 52.1%
Taylor expanded in t around inf 33.1%
Taylor expanded in y around 0 23.8%
Taylor expanded in z around inf 23.4%
Final simplification20.9%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= y 4.0) (- 2.0 (+ (sqrt y) (sqrt x))) (* y (- 0.5 (sqrt (/ 1.0 y))))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 4.0) {
tmp = 2.0 - (sqrt(y) + sqrt(x));
} else {
tmp = y * (0.5 - sqrt((1.0 / y)));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= 4.0d0) then
tmp = 2.0d0 - (sqrt(y) + sqrt(x))
else
tmp = y * (0.5d0 - sqrt((1.0d0 / y)))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= 4.0) {
tmp = 2.0 - (Math.sqrt(y) + Math.sqrt(x));
} else {
tmp = y * (0.5 - Math.sqrt((1.0 / y)));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if y <= 4.0: tmp = 2.0 - (math.sqrt(y) + math.sqrt(x)) else: tmp = y * (0.5 - math.sqrt((1.0 / y))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (y <= 4.0) tmp = Float64(2.0 - Float64(sqrt(y) + sqrt(x))); else tmp = Float64(y * Float64(0.5 - sqrt(Float64(1.0 / y)))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (y <= 4.0)
tmp = 2.0 - (sqrt(y) + sqrt(x));
else
tmp = y * (0.5 - sqrt((1.0 / y)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[y, 4.0], N[(2.0 - N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y * N[(0.5 - N[Sqrt[N[(1.0 / y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 4:\\
\;\;\;\;2 - \left(\sqrt{y} + \sqrt{x}\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(0.5 - \sqrt{\frac{1}{y}}\right)\\
\end{array}
\end{array}
if y < 4Initial program 98.1%
associate-+l+98.1%
sub-neg98.1%
sub-neg98.1%
+-commutative98.1%
+-commutative98.1%
+-commutative98.1%
Simplified98.1%
Taylor expanded in x around 0 53.8%
Taylor expanded in t around inf 37.2%
Taylor expanded in y around 0 18.8%
Taylor expanded in z around inf 25.2%
if 4 < y Initial program 85.5%
associate-+l+85.5%
sub-neg85.5%
sub-neg85.5%
+-commutative85.5%
+-commutative85.5%
+-commutative85.5%
Simplified85.5%
Taylor expanded in x around 0 43.9%
Taylor expanded in t around inf 27.7%
Taylor expanded in y around 0 4.7%
Taylor expanded in y around inf 5.3%
Final simplification15.9%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (- (+ (* y 0.5) 2.0) (+ (sqrt y) (sqrt x))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
return ((y * 0.5) + 2.0) - (sqrt(y) + sqrt(x));
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = ((y * 0.5d0) + 2.0d0) - (sqrt(y) + sqrt(x))
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
return ((y * 0.5) + 2.0) - (Math.sqrt(y) + Math.sqrt(x));
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): return ((y * 0.5) + 2.0) - (math.sqrt(y) + math.sqrt(x))
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) return Float64(Float64(Float64(y * 0.5) + 2.0) - Float64(sqrt(y) + sqrt(x))) end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp = code(x, y, z, t)
tmp = ((y * 0.5) + 2.0) - (sqrt(y) + sqrt(x));
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := N[(N[(N[(y * 0.5), $MachinePrecision] + 2.0), $MachinePrecision] - N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\left(y \cdot 0.5 + 2\right) - \left(\sqrt{y} + \sqrt{x}\right)
\end{array}
Initial program 92.2%
associate-+l+92.2%
sub-neg92.2%
sub-neg92.2%
+-commutative92.2%
+-commutative92.2%
+-commutative92.2%
Simplified92.2%
Taylor expanded in x around 0 49.2%
Taylor expanded in t around inf 32.8%
Taylor expanded in y around 0 21.8%
Taylor expanded in z around inf 15.7%
Final simplification15.7%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (* x (sqrt (/ 1.0 x))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
return x * sqrt((1.0 / x));
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = x * sqrt((1.0d0 / x))
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
return x * Math.sqrt((1.0 / x));
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): return x * math.sqrt((1.0 / x))
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) return Float64(x * sqrt(Float64(1.0 / x))) end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp = code(x, y, z, t)
tmp = x * sqrt((1.0 / x));
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := N[(x * N[Sqrt[N[(1.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
x \cdot \sqrt{\frac{1}{x}}
\end{array}
Initial program 92.2%
associate-+l+92.2%
sub-neg92.2%
sub-neg92.2%
+-commutative92.2%
+-commutative92.2%
+-commutative92.2%
Simplified92.2%
Taylor expanded in x around 0 49.2%
Taylor expanded in t around inf 32.8%
Taylor expanded in x around inf 11.1%
Taylor expanded in x around -inf 0.0%
mul-1-neg0.0%
unpow20.0%
rem-square-sqrt6.8%
distribute-rgt-neg-in6.8%
metadata-eval6.8%
*-rgt-identity6.8%
Simplified6.8%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (- (sqrt x)))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
return -sqrt(x);
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = -sqrt(x)
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
return -Math.sqrt(x);
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): return -math.sqrt(x)
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) return Float64(-sqrt(x)) end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp = code(x, y, z, t)
tmp = -sqrt(x);
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := (-N[Sqrt[x], $MachinePrecision])
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
-\sqrt{x}
\end{array}
Initial program 92.2%
associate-+l+92.2%
sub-neg92.2%
sub-neg92.2%
+-commutative92.2%
+-commutative92.2%
+-commutative92.2%
Simplified92.2%
Taylor expanded in x around 0 49.2%
Taylor expanded in t around inf 32.8%
Taylor expanded in x around inf 1.6%
mul-1-neg1.6%
Simplified1.6%
(FPCore (x y z t)
:precision binary64
(+
(+
(+
(/ 1.0 (+ (sqrt (+ x 1.0)) (sqrt x)))
(/ 1.0 (+ (sqrt (+ y 1.0)) (sqrt y))))
(/ 1.0 (+ (sqrt (+ z 1.0)) (sqrt z))))
(- (sqrt (+ t 1.0)) (sqrt t))))
double code(double x, double y, double z, double t) {
return (((1.0 / (sqrt((x + 1.0)) + sqrt(x))) + (1.0 / (sqrt((y + 1.0)) + sqrt(y)))) + (1.0 / (sqrt((z + 1.0)) + sqrt(z)))) + (sqrt((t + 1.0)) - sqrt(t));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (((1.0d0 / (sqrt((x + 1.0d0)) + sqrt(x))) + (1.0d0 / (sqrt((y + 1.0d0)) + sqrt(y)))) + (1.0d0 / (sqrt((z + 1.0d0)) + sqrt(z)))) + (sqrt((t + 1.0d0)) - sqrt(t))
end function
public static double code(double x, double y, double z, double t) {
return (((1.0 / (Math.sqrt((x + 1.0)) + Math.sqrt(x))) + (1.0 / (Math.sqrt((y + 1.0)) + Math.sqrt(y)))) + (1.0 / (Math.sqrt((z + 1.0)) + Math.sqrt(z)))) + (Math.sqrt((t + 1.0)) - Math.sqrt(t));
}
def code(x, y, z, t): return (((1.0 / (math.sqrt((x + 1.0)) + math.sqrt(x))) + (1.0 / (math.sqrt((y + 1.0)) + math.sqrt(y)))) + (1.0 / (math.sqrt((z + 1.0)) + math.sqrt(z)))) + (math.sqrt((t + 1.0)) - math.sqrt(t))
function code(x, y, z, t) return Float64(Float64(Float64(Float64(1.0 / Float64(sqrt(Float64(x + 1.0)) + sqrt(x))) + Float64(1.0 / Float64(sqrt(Float64(y + 1.0)) + sqrt(y)))) + Float64(1.0 / Float64(sqrt(Float64(z + 1.0)) + sqrt(z)))) + Float64(sqrt(Float64(t + 1.0)) - sqrt(t))) end
function tmp = code(x, y, z, t) tmp = (((1.0 / (sqrt((x + 1.0)) + sqrt(x))) + (1.0 / (sqrt((y + 1.0)) + sqrt(y)))) + (1.0 / (sqrt((z + 1.0)) + sqrt(z)))) + (sqrt((t + 1.0)) - sqrt(t)); end
code[x_, y_, z_, t_] := N[(N[(N[(N[(1.0 / N[(N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[N[(z + 1.0), $MachinePrecision]], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(t + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\frac{1}{\sqrt{x + 1} + \sqrt{x}} + \frac{1}{\sqrt{y + 1} + \sqrt{y}}\right) + \frac{1}{\sqrt{z + 1} + \sqrt{z}}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)
\end{array}
herbie shell --seed 2024085
(FPCore (x y z t)
:name "Main:z from "
:precision binary64
:alt
(+ (+ (+ (/ 1.0 (+ (sqrt (+ x 1.0)) (sqrt x))) (/ 1.0 (+ (sqrt (+ y 1.0)) (sqrt y)))) (/ 1.0 (+ (sqrt (+ z 1.0)) (sqrt z)))) (- (sqrt (+ t 1.0)) (sqrt t)))
(+ (+ (+ (- (sqrt (+ x 1.0)) (sqrt x)) (- (sqrt (+ y 1.0)) (sqrt y))) (- (sqrt (+ z 1.0)) (sqrt z))) (- (sqrt (+ t 1.0)) (sqrt t))))