
(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 26 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 (/ 1.0 (+ (sqrt y) (sqrt (+ 1.0 y)))))
(t_2 (- (sqrt (+ x 1.0)) (sqrt x)))
(t_3
(+
(/ 1.0 (+ (sqrt z) (sqrt (+ 1.0 z))))
(- (sqrt (+ 1.0 t)) (sqrt t)))))
(if (<= t_2 1e-7)
(+ (+ (* 0.5 (sqrt (/ 1.0 x))) t_1) t_3)
(+ t_3 (+ t_2 t_1)))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = 1.0 / (sqrt(y) + sqrt((1.0 + y)));
double t_2 = sqrt((x + 1.0)) - sqrt(x);
double t_3 = (1.0 / (sqrt(z) + sqrt((1.0 + z)))) + (sqrt((1.0 + t)) - sqrt(t));
double tmp;
if (t_2 <= 1e-7) {
tmp = ((0.5 * sqrt((1.0 / x))) + t_1) + t_3;
} else {
tmp = t_3 + (t_2 + t_1);
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = 1.0d0 / (sqrt(y) + sqrt((1.0d0 + y)))
t_2 = sqrt((x + 1.0d0)) - sqrt(x)
t_3 = (1.0d0 / (sqrt(z) + sqrt((1.0d0 + z)))) + (sqrt((1.0d0 + t)) - sqrt(t))
if (t_2 <= 1d-7) then
tmp = ((0.5d0 * sqrt((1.0d0 / x))) + t_1) + t_3
else
tmp = t_3 + (t_2 + t_1)
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = 1.0 / (Math.sqrt(y) + Math.sqrt((1.0 + y)));
double t_2 = Math.sqrt((x + 1.0)) - Math.sqrt(x);
double t_3 = (1.0 / (Math.sqrt(z) + Math.sqrt((1.0 + z)))) + (Math.sqrt((1.0 + t)) - Math.sqrt(t));
double tmp;
if (t_2 <= 1e-7) {
tmp = ((0.5 * Math.sqrt((1.0 / x))) + t_1) + t_3;
} else {
tmp = t_3 + (t_2 + t_1);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = 1.0 / (math.sqrt(y) + math.sqrt((1.0 + y))) t_2 = math.sqrt((x + 1.0)) - math.sqrt(x) t_3 = (1.0 / (math.sqrt(z) + math.sqrt((1.0 + z)))) + (math.sqrt((1.0 + t)) - math.sqrt(t)) tmp = 0 if t_2 <= 1e-7: tmp = ((0.5 * math.sqrt((1.0 / x))) + t_1) + t_3 else: tmp = t_3 + (t_2 + t_1) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = Float64(1.0 / Float64(sqrt(y) + sqrt(Float64(1.0 + y)))) t_2 = Float64(sqrt(Float64(x + 1.0)) - sqrt(x)) t_3 = Float64(Float64(1.0 / Float64(sqrt(z) + sqrt(Float64(1.0 + z)))) + Float64(sqrt(Float64(1.0 + t)) - sqrt(t))) tmp = 0.0 if (t_2 <= 1e-7) tmp = Float64(Float64(Float64(0.5 * sqrt(Float64(1.0 / x))) + t_1) + t_3); else tmp = Float64(t_3 + Float64(t_2 + t_1)); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = 1.0 / (sqrt(y) + sqrt((1.0 + y)));
t_2 = sqrt((x + 1.0)) - sqrt(x);
t_3 = (1.0 / (sqrt(z) + sqrt((1.0 + z)))) + (sqrt((1.0 + t)) - sqrt(t));
tmp = 0.0;
if (t_2 <= 1e-7)
tmp = ((0.5 * sqrt((1.0 / x))) + t_1) + t_3;
else
tmp = t_3 + (t_2 + t_1);
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(1.0 / N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(1.0 / N[(N[Sqrt[z], $MachinePrecision] + N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, 1e-7], N[(N[(N[(0.5 * N[Sqrt[N[(1.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision] + t$95$3), $MachinePrecision], N[(t$95$3 + N[(t$95$2 + t$95$1), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \frac{1}{\sqrt{y} + \sqrt{1 + y}}\\
t_2 := \sqrt{x + 1} - \sqrt{x}\\
t_3 := \frac{1}{\sqrt{z} + \sqrt{1 + z}} + \left(\sqrt{1 + t} - \sqrt{t}\right)\\
\mathbf{if}\;t\_2 \leq 10^{-7}:\\
\;\;\;\;\left(0.5 \cdot \sqrt{\frac{1}{x}} + t\_1\right) + t\_3\\
\mathbf{else}:\\
\;\;\;\;t\_3 + \left(t\_2 + t\_1\right)\\
\end{array}
\end{array}
if (-.f64 (sqrt.f64 (+.f64 x #s(literal 1 binary64))) (sqrt.f64 x)) < 9.9999999999999995e-8Initial program 83.3%
associate-+l+83.3%
sub-neg83.3%
sub-neg83.3%
+-commutative83.3%
+-commutative83.3%
+-commutative83.3%
Simplified83.3%
flip--83.3%
div-inv83.3%
add-sqr-sqrt62.1%
add-sqr-sqrt83.7%
associate--l+86.7%
Applied egg-rr86.7%
+-inverses86.7%
metadata-eval86.7%
*-lft-identity86.7%
+-commutative86.7%
Simplified86.7%
flip--86.9%
div-inv86.9%
add-sqr-sqrt71.7%
add-sqr-sqrt87.9%
associate--l+94.1%
Applied egg-rr94.1%
+-inverses94.1%
metadata-eval94.1%
*-lft-identity94.1%
+-commutative94.1%
Simplified94.1%
Taylor expanded in x around inf 97.0%
if 9.9999999999999995e-8 < (-.f64 (sqrt.f64 (+.f64 x #s(literal 1 binary64))) (sqrt.f64 x)) Initial program 96.9%
associate-+l+96.9%
sub-neg96.9%
sub-neg96.9%
+-commutative96.9%
+-commutative96.9%
+-commutative96.9%
Simplified96.9%
flip--96.9%
div-inv96.9%
add-sqr-sqrt70.4%
add-sqr-sqrt97.2%
associate--l+98.1%
Applied egg-rr98.1%
+-inverses98.1%
metadata-eval98.1%
*-lft-identity98.1%
+-commutative98.1%
Simplified98.1%
flip--98.3%
div-inv98.3%
add-sqr-sqrt75.8%
add-sqr-sqrt98.6%
associate--l+98.6%
Applied egg-rr98.6%
+-inverses98.6%
metadata-eval98.6%
*-lft-identity98.6%
+-commutative98.6%
Simplified98.6%
Final simplification97.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 (/ 1.0 (+ (sqrt y) (sqrt (+ 1.0 y)))))
(t_2
(+
(/ 1.0 (+ (sqrt z) (sqrt (+ 1.0 z))))
(- (sqrt (+ 1.0 t)) (sqrt t)))))
(if (<= (- (sqrt (+ x 1.0)) (sqrt x)) 0.6)
(+ (+ (* 0.5 (sqrt (/ 1.0 x))) t_1) t_2)
(+ t_2 (+ t_1 (- 1.0 (sqrt x)))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = 1.0 / (sqrt(y) + sqrt((1.0 + y)));
double t_2 = (1.0 / (sqrt(z) + sqrt((1.0 + z)))) + (sqrt((1.0 + t)) - sqrt(t));
double tmp;
if ((sqrt((x + 1.0)) - sqrt(x)) <= 0.6) {
tmp = ((0.5 * sqrt((1.0 / x))) + t_1) + t_2;
} else {
tmp = t_2 + (t_1 + (1.0 - sqrt(x)));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = 1.0d0 / (sqrt(y) + sqrt((1.0d0 + y)))
t_2 = (1.0d0 / (sqrt(z) + sqrt((1.0d0 + z)))) + (sqrt((1.0d0 + t)) - sqrt(t))
if ((sqrt((x + 1.0d0)) - sqrt(x)) <= 0.6d0) then
tmp = ((0.5d0 * sqrt((1.0d0 / x))) + t_1) + t_2
else
tmp = t_2 + (t_1 + (1.0d0 - sqrt(x)))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = 1.0 / (Math.sqrt(y) + Math.sqrt((1.0 + y)));
double t_2 = (1.0 / (Math.sqrt(z) + Math.sqrt((1.0 + z)))) + (Math.sqrt((1.0 + t)) - Math.sqrt(t));
double tmp;
if ((Math.sqrt((x + 1.0)) - Math.sqrt(x)) <= 0.6) {
tmp = ((0.5 * Math.sqrt((1.0 / x))) + t_1) + t_2;
} else {
tmp = t_2 + (t_1 + (1.0 - Math.sqrt(x)));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = 1.0 / (math.sqrt(y) + math.sqrt((1.0 + y))) t_2 = (1.0 / (math.sqrt(z) + math.sqrt((1.0 + z)))) + (math.sqrt((1.0 + t)) - math.sqrt(t)) tmp = 0 if (math.sqrt((x + 1.0)) - math.sqrt(x)) <= 0.6: tmp = ((0.5 * math.sqrt((1.0 / x))) + t_1) + t_2 else: tmp = t_2 + (t_1 + (1.0 - math.sqrt(x))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = Float64(1.0 / Float64(sqrt(y) + sqrt(Float64(1.0 + y)))) t_2 = Float64(Float64(1.0 / Float64(sqrt(z) + sqrt(Float64(1.0 + z)))) + Float64(sqrt(Float64(1.0 + t)) - sqrt(t))) tmp = 0.0 if (Float64(sqrt(Float64(x + 1.0)) - sqrt(x)) <= 0.6) tmp = Float64(Float64(Float64(0.5 * sqrt(Float64(1.0 / x))) + t_1) + t_2); else tmp = Float64(t_2 + Float64(t_1 + Float64(1.0 - sqrt(x)))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = 1.0 / (sqrt(y) + sqrt((1.0 + y)));
t_2 = (1.0 / (sqrt(z) + sqrt((1.0 + z)))) + (sqrt((1.0 + t)) - sqrt(t));
tmp = 0.0;
if ((sqrt((x + 1.0)) - sqrt(x)) <= 0.6)
tmp = ((0.5 * sqrt((1.0 / x))) + t_1) + t_2;
else
tmp = t_2 + (t_1 + (1.0 - sqrt(x)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(1.0 / N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(1.0 / N[(N[Sqrt[z], $MachinePrecision] + N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision], 0.6], N[(N[(N[(0.5 * N[Sqrt[N[(1.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision] + t$95$2), $MachinePrecision], N[(t$95$2 + N[(t$95$1 + N[(1.0 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \frac{1}{\sqrt{y} + \sqrt{1 + y}}\\
t_2 := \frac{1}{\sqrt{z} + \sqrt{1 + z}} + \left(\sqrt{1 + t} - \sqrt{t}\right)\\
\mathbf{if}\;\sqrt{x + 1} - \sqrt{x} \leq 0.6:\\
\;\;\;\;\left(0.5 \cdot \sqrt{\frac{1}{x}} + t\_1\right) + t\_2\\
\mathbf{else}:\\
\;\;\;\;t\_2 + \left(t\_1 + \left(1 - \sqrt{x}\right)\right)\\
\end{array}
\end{array}
if (-.f64 (sqrt.f64 (+.f64 x #s(literal 1 binary64))) (sqrt.f64 x)) < 0.599999999999999978Initial program 83.7%
associate-+l+83.7%
sub-neg83.7%
sub-neg83.7%
+-commutative83.7%
+-commutative83.7%
+-commutative83.7%
Simplified83.7%
flip--83.7%
div-inv83.7%
add-sqr-sqrt63.4%
add-sqr-sqrt84.0%
associate--l+86.8%
Applied egg-rr86.8%
+-inverses86.8%
metadata-eval86.8%
*-lft-identity86.8%
+-commutative86.8%
Simplified86.8%
flip--87.0%
div-inv87.0%
add-sqr-sqrt70.4%
add-sqr-sqrt87.9%
associate--l+93.6%
Applied egg-rr93.6%
+-inverses93.6%
metadata-eval93.6%
*-lft-identity93.6%
+-commutative93.6%
Simplified93.6%
Taylor expanded in x around inf 94.2%
if 0.599999999999999978 < (-.f64 (sqrt.f64 (+.f64 x #s(literal 1 binary64))) (sqrt.f64 x)) Initial program 97.6%
associate-+l+97.6%
sub-neg97.6%
sub-neg97.6%
+-commutative97.6%
+-commutative97.6%
+-commutative97.6%
Simplified97.6%
flip--97.5%
div-inv97.5%
add-sqr-sqrt69.8%
add-sqr-sqrt97.9%
associate--l+98.9%
Applied egg-rr98.9%
+-inverses98.9%
metadata-eval98.9%
*-lft-identity98.9%
+-commutative98.9%
Simplified98.9%
flip--99.1%
div-inv99.1%
add-sqr-sqrt77.3%
add-sqr-sqrt99.3%
associate--l+99.3%
Applied egg-rr99.3%
+-inverses99.3%
metadata-eval99.3%
*-lft-identity99.3%
+-commutative99.3%
Simplified99.3%
Taylor expanded in x around 0 97.0%
Final simplification95.6%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ 1.0 z))))
(if (<= (- (sqrt (+ x 1.0)) (sqrt x)) 0.6)
(+
(+ (* 0.5 (sqrt (/ 1.0 x))) (* 0.5 (sqrt (/ 1.0 y))))
(+ (- t_1 (sqrt z)) (* 0.5 (sqrt (/ 1.0 t)))))
(+
(+ (/ 1.0 (+ (sqrt z) t_1)) (- (sqrt (+ 1.0 t)) (sqrt t)))
(+ (/ 1.0 (+ (sqrt y) (sqrt (+ 1.0 y)))) (- 1.0 (sqrt x)))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + z));
double tmp;
if ((sqrt((x + 1.0)) - sqrt(x)) <= 0.6) {
tmp = ((0.5 * sqrt((1.0 / x))) + (0.5 * sqrt((1.0 / y)))) + ((t_1 - sqrt(z)) + (0.5 * sqrt((1.0 / t))));
} else {
tmp = ((1.0 / (sqrt(z) + t_1)) + (sqrt((1.0 + t)) - sqrt(t))) + ((1.0 / (sqrt(y) + sqrt((1.0 + y)))) + (1.0 - sqrt(x)));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = sqrt((1.0d0 + z))
if ((sqrt((x + 1.0d0)) - sqrt(x)) <= 0.6d0) then
tmp = ((0.5d0 * sqrt((1.0d0 / x))) + (0.5d0 * sqrt((1.0d0 / y)))) + ((t_1 - sqrt(z)) + (0.5d0 * sqrt((1.0d0 / t))))
else
tmp = ((1.0d0 / (sqrt(z) + t_1)) + (sqrt((1.0d0 + t)) - sqrt(t))) + ((1.0d0 / (sqrt(y) + sqrt((1.0d0 + y)))) + (1.0d0 - sqrt(x)))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + z));
double tmp;
if ((Math.sqrt((x + 1.0)) - Math.sqrt(x)) <= 0.6) {
tmp = ((0.5 * Math.sqrt((1.0 / x))) + (0.5 * Math.sqrt((1.0 / y)))) + ((t_1 - Math.sqrt(z)) + (0.5 * Math.sqrt((1.0 / t))));
} else {
tmp = ((1.0 / (Math.sqrt(z) + t_1)) + (Math.sqrt((1.0 + t)) - Math.sqrt(t))) + ((1.0 / (Math.sqrt(y) + Math.sqrt((1.0 + y)))) + (1.0 - Math.sqrt(x)));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + z)) tmp = 0 if (math.sqrt((x + 1.0)) - math.sqrt(x)) <= 0.6: tmp = ((0.5 * math.sqrt((1.0 / x))) + (0.5 * math.sqrt((1.0 / y)))) + ((t_1 - math.sqrt(z)) + (0.5 * math.sqrt((1.0 / t)))) else: tmp = ((1.0 / (math.sqrt(z) + t_1)) + (math.sqrt((1.0 + t)) - math.sqrt(t))) + ((1.0 / (math.sqrt(y) + math.sqrt((1.0 + y)))) + (1.0 - math.sqrt(x))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(1.0 + z)) tmp = 0.0 if (Float64(sqrt(Float64(x + 1.0)) - sqrt(x)) <= 0.6) tmp = Float64(Float64(Float64(0.5 * sqrt(Float64(1.0 / x))) + Float64(0.5 * sqrt(Float64(1.0 / y)))) + Float64(Float64(t_1 - sqrt(z)) + Float64(0.5 * sqrt(Float64(1.0 / t))))); else tmp = Float64(Float64(Float64(1.0 / Float64(sqrt(z) + t_1)) + Float64(sqrt(Float64(1.0 + t)) - sqrt(t))) + Float64(Float64(1.0 / Float64(sqrt(y) + sqrt(Float64(1.0 + y)))) + Float64(1.0 - sqrt(x)))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + z));
tmp = 0.0;
if ((sqrt((x + 1.0)) - sqrt(x)) <= 0.6)
tmp = ((0.5 * sqrt((1.0 / x))) + (0.5 * sqrt((1.0 / y)))) + ((t_1 - sqrt(z)) + (0.5 * sqrt((1.0 / t))));
else
tmp = ((1.0 / (sqrt(z) + t_1)) + (sqrt((1.0 + t)) - sqrt(t))) + ((1.0 / (sqrt(y) + sqrt((1.0 + y)))) + (1.0 - sqrt(x)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision], 0.6], N[(N[(N[(0.5 * N[Sqrt[N[(1.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(0.5 * N[Sqrt[N[(1.0 / y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$1 - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] + N[(0.5 * N[Sqrt[N[(1.0 / t), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 / N[(N[Sqrt[z], $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 / N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + z}\\
\mathbf{if}\;\sqrt{x + 1} - \sqrt{x} \leq 0.6:\\
\;\;\;\;\left(0.5 \cdot \sqrt{\frac{1}{x}} + 0.5 \cdot \sqrt{\frac{1}{y}}\right) + \left(\left(t\_1 - \sqrt{z}\right) + 0.5 \cdot \sqrt{\frac{1}{t}}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{1}{\sqrt{z} + t\_1} + \left(\sqrt{1 + t} - \sqrt{t}\right)\right) + \left(\frac{1}{\sqrt{y} + \sqrt{1 + y}} + \left(1 - \sqrt{x}\right)\right)\\
\end{array}
\end{array}
if (-.f64 (sqrt.f64 (+.f64 x #s(literal 1 binary64))) (sqrt.f64 x)) < 0.599999999999999978Initial program 83.7%
associate-+l+83.7%
sub-neg83.7%
sub-neg83.7%
+-commutative83.7%
+-commutative83.7%
+-commutative83.7%
Simplified83.7%
Taylor expanded in t around inf 39.5%
Taylor expanded in x around inf 39.4%
Taylor expanded in y around inf 23.0%
if 0.599999999999999978 < (-.f64 (sqrt.f64 (+.f64 x #s(literal 1 binary64))) (sqrt.f64 x)) Initial program 97.6%
associate-+l+97.6%
sub-neg97.6%
sub-neg97.6%
+-commutative97.6%
+-commutative97.6%
+-commutative97.6%
Simplified97.6%
flip--97.5%
div-inv97.5%
add-sqr-sqrt69.8%
add-sqr-sqrt97.9%
associate--l+98.9%
Applied egg-rr98.9%
+-inverses98.9%
metadata-eval98.9%
*-lft-identity98.9%
+-commutative98.9%
Simplified98.9%
flip--99.1%
div-inv99.1%
add-sqr-sqrt77.3%
add-sqr-sqrt99.3%
associate--l+99.3%
Applied egg-rr99.3%
+-inverses99.3%
metadata-eval99.3%
*-lft-identity99.3%
+-commutative99.3%
Simplified99.3%
Taylor expanded in x around 0 97.0%
Final simplification61.7%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ 1.0 z))))
(if (<= (- (sqrt (+ x 1.0)) (sqrt x)) 0.6)
(+
(+ (* 0.5 (sqrt (/ 1.0 x))) (* 0.5 (sqrt (/ 1.0 y))))
(+ (- t_1 (sqrt z)) (* 0.5 (sqrt (/ 1.0 t)))))
(+
(+ (/ 1.0 (+ (sqrt z) t_1)) (- (sqrt (+ 1.0 t)) (sqrt t)))
(+ (- 1.0 (sqrt x)) (- (sqrt (+ 1.0 y)) (sqrt y)))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + z));
double tmp;
if ((sqrt((x + 1.0)) - sqrt(x)) <= 0.6) {
tmp = ((0.5 * sqrt((1.0 / x))) + (0.5 * sqrt((1.0 / y)))) + ((t_1 - sqrt(z)) + (0.5 * sqrt((1.0 / t))));
} else {
tmp = ((1.0 / (sqrt(z) + t_1)) + (sqrt((1.0 + t)) - sqrt(t))) + ((1.0 - sqrt(x)) + (sqrt((1.0 + y)) - sqrt(y)));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = sqrt((1.0d0 + z))
if ((sqrt((x + 1.0d0)) - sqrt(x)) <= 0.6d0) then
tmp = ((0.5d0 * sqrt((1.0d0 / x))) + (0.5d0 * sqrt((1.0d0 / y)))) + ((t_1 - sqrt(z)) + (0.5d0 * sqrt((1.0d0 / t))))
else
tmp = ((1.0d0 / (sqrt(z) + t_1)) + (sqrt((1.0d0 + t)) - sqrt(t))) + ((1.0d0 - sqrt(x)) + (sqrt((1.0d0 + y)) - sqrt(y)))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + z));
double tmp;
if ((Math.sqrt((x + 1.0)) - Math.sqrt(x)) <= 0.6) {
tmp = ((0.5 * Math.sqrt((1.0 / x))) + (0.5 * Math.sqrt((1.0 / y)))) + ((t_1 - Math.sqrt(z)) + (0.5 * Math.sqrt((1.0 / t))));
} else {
tmp = ((1.0 / (Math.sqrt(z) + t_1)) + (Math.sqrt((1.0 + t)) - Math.sqrt(t))) + ((1.0 - Math.sqrt(x)) + (Math.sqrt((1.0 + y)) - Math.sqrt(y)));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + z)) tmp = 0 if (math.sqrt((x + 1.0)) - math.sqrt(x)) <= 0.6: tmp = ((0.5 * math.sqrt((1.0 / x))) + (0.5 * math.sqrt((1.0 / y)))) + ((t_1 - math.sqrt(z)) + (0.5 * math.sqrt((1.0 / t)))) else: tmp = ((1.0 / (math.sqrt(z) + t_1)) + (math.sqrt((1.0 + t)) - math.sqrt(t))) + ((1.0 - math.sqrt(x)) + (math.sqrt((1.0 + y)) - math.sqrt(y))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(1.0 + z)) tmp = 0.0 if (Float64(sqrt(Float64(x + 1.0)) - sqrt(x)) <= 0.6) tmp = Float64(Float64(Float64(0.5 * sqrt(Float64(1.0 / x))) + Float64(0.5 * sqrt(Float64(1.0 / y)))) + Float64(Float64(t_1 - sqrt(z)) + Float64(0.5 * sqrt(Float64(1.0 / t))))); else tmp = Float64(Float64(Float64(1.0 / Float64(sqrt(z) + t_1)) + Float64(sqrt(Float64(1.0 + t)) - sqrt(t))) + Float64(Float64(1.0 - sqrt(x)) + Float64(sqrt(Float64(1.0 + y)) - sqrt(y)))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + z));
tmp = 0.0;
if ((sqrt((x + 1.0)) - sqrt(x)) <= 0.6)
tmp = ((0.5 * sqrt((1.0 / x))) + (0.5 * sqrt((1.0 / y)))) + ((t_1 - sqrt(z)) + (0.5 * sqrt((1.0 / t))));
else
tmp = ((1.0 / (sqrt(z) + t_1)) + (sqrt((1.0 + t)) - sqrt(t))) + ((1.0 - sqrt(x)) + (sqrt((1.0 + y)) - sqrt(y)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision], 0.6], N[(N[(N[(0.5 * N[Sqrt[N[(1.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(0.5 * N[Sqrt[N[(1.0 / y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$1 - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] + N[(0.5 * N[Sqrt[N[(1.0 / t), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 / N[(N[Sqrt[z], $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + z}\\
\mathbf{if}\;\sqrt{x + 1} - \sqrt{x} \leq 0.6:\\
\;\;\;\;\left(0.5 \cdot \sqrt{\frac{1}{x}} + 0.5 \cdot \sqrt{\frac{1}{y}}\right) + \left(\left(t\_1 - \sqrt{z}\right) + 0.5 \cdot \sqrt{\frac{1}{t}}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{1}{\sqrt{z} + t\_1} + \left(\sqrt{1 + t} - \sqrt{t}\right)\right) + \left(\left(1 - \sqrt{x}\right) + \left(\sqrt{1 + y} - \sqrt{y}\right)\right)\\
\end{array}
\end{array}
if (-.f64 (sqrt.f64 (+.f64 x #s(literal 1 binary64))) (sqrt.f64 x)) < 0.599999999999999978Initial program 83.7%
associate-+l+83.7%
sub-neg83.7%
sub-neg83.7%
+-commutative83.7%
+-commutative83.7%
+-commutative83.7%
Simplified83.7%
Taylor expanded in t around inf 39.5%
Taylor expanded in x around inf 39.4%
Taylor expanded in y around inf 23.0%
if 0.599999999999999978 < (-.f64 (sqrt.f64 (+.f64 x #s(literal 1 binary64))) (sqrt.f64 x)) Initial program 97.6%
associate-+l+97.6%
sub-neg97.6%
sub-neg97.6%
+-commutative97.6%
+-commutative97.6%
+-commutative97.6%
Simplified97.6%
Taylor expanded in x around 0 95.2%
flip--99.1%
div-inv99.1%
add-sqr-sqrt77.3%
add-sqr-sqrt99.3%
associate--l+99.3%
Applied egg-rr95.7%
+-inverses99.3%
metadata-eval99.3%
*-lft-identity99.3%
+-commutative99.3%
Simplified95.7%
Final simplification61.1%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (sqrt (+ 1.0 z)) (sqrt z))))
(if (<= (- (sqrt (+ x 1.0)) (sqrt x)) 0.6)
(+
(+ (* 0.5 (sqrt (/ 1.0 x))) (* 0.5 (sqrt (/ 1.0 y))))
(+ t_1 (* 0.5 (sqrt (/ 1.0 t)))))
(+
(+ (- 1.0 (sqrt x)) (- (sqrt (+ 1.0 y)) (sqrt y)))
(+ (- (sqrt (+ 1.0 t)) (sqrt t)) 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 ((sqrt((x + 1.0)) - sqrt(x)) <= 0.6) {
tmp = ((0.5 * sqrt((1.0 / x))) + (0.5 * sqrt((1.0 / y)))) + (t_1 + (0.5 * sqrt((1.0 / t))));
} else {
tmp = ((1.0 - sqrt(x)) + (sqrt((1.0 + y)) - sqrt(y))) + ((sqrt((1.0 + t)) - sqrt(t)) + 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 ((sqrt((x + 1.0d0)) - sqrt(x)) <= 0.6d0) then
tmp = ((0.5d0 * sqrt((1.0d0 / x))) + (0.5d0 * sqrt((1.0d0 / y)))) + (t_1 + (0.5d0 * sqrt((1.0d0 / t))))
else
tmp = ((1.0d0 - sqrt(x)) + (sqrt((1.0d0 + y)) - sqrt(y))) + ((sqrt((1.0d0 + t)) - sqrt(t)) + 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 ((Math.sqrt((x + 1.0)) - Math.sqrt(x)) <= 0.6) {
tmp = ((0.5 * Math.sqrt((1.0 / x))) + (0.5 * Math.sqrt((1.0 / y)))) + (t_1 + (0.5 * Math.sqrt((1.0 / t))));
} else {
tmp = ((1.0 - Math.sqrt(x)) + (Math.sqrt((1.0 + y)) - Math.sqrt(y))) + ((Math.sqrt((1.0 + t)) - Math.sqrt(t)) + 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 (math.sqrt((x + 1.0)) - math.sqrt(x)) <= 0.6: tmp = ((0.5 * math.sqrt((1.0 / x))) + (0.5 * math.sqrt((1.0 / y)))) + (t_1 + (0.5 * math.sqrt((1.0 / t)))) else: tmp = ((1.0 - math.sqrt(x)) + (math.sqrt((1.0 + y)) - math.sqrt(y))) + ((math.sqrt((1.0 + t)) - math.sqrt(t)) + 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 (Float64(sqrt(Float64(x + 1.0)) - sqrt(x)) <= 0.6) tmp = Float64(Float64(Float64(0.5 * sqrt(Float64(1.0 / x))) + Float64(0.5 * sqrt(Float64(1.0 / y)))) + Float64(t_1 + Float64(0.5 * sqrt(Float64(1.0 / t))))); else tmp = Float64(Float64(Float64(1.0 - sqrt(x)) + Float64(sqrt(Float64(1.0 + y)) - sqrt(y))) + Float64(Float64(sqrt(Float64(1.0 + t)) - sqrt(t)) + 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 ((sqrt((x + 1.0)) - sqrt(x)) <= 0.6)
tmp = ((0.5 * sqrt((1.0 / x))) + (0.5 * sqrt((1.0 / y)))) + (t_1 + (0.5 * sqrt((1.0 / t))));
else
tmp = ((1.0 - sqrt(x)) + (sqrt((1.0 + y)) - sqrt(y))) + ((sqrt((1.0 + t)) - sqrt(t)) + 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[N[(N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision], 0.6], N[(N[(N[(0.5 * N[Sqrt[N[(1.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(0.5 * N[Sqrt[N[(1.0 / y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$1 + N[(0.5 * N[Sqrt[N[(1.0 / t), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + z} - \sqrt{z}\\
\mathbf{if}\;\sqrt{x + 1} - \sqrt{x} \leq 0.6:\\
\;\;\;\;\left(0.5 \cdot \sqrt{\frac{1}{x}} + 0.5 \cdot \sqrt{\frac{1}{y}}\right) + \left(t\_1 + 0.5 \cdot \sqrt{\frac{1}{t}}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(1 - \sqrt{x}\right) + \left(\sqrt{1 + y} - \sqrt{y}\right)\right) + \left(\left(\sqrt{1 + t} - \sqrt{t}\right) + t\_1\right)\\
\end{array}
\end{array}
if (-.f64 (sqrt.f64 (+.f64 x #s(literal 1 binary64))) (sqrt.f64 x)) < 0.599999999999999978Initial program 83.7%
associate-+l+83.7%
sub-neg83.7%
sub-neg83.7%
+-commutative83.7%
+-commutative83.7%
+-commutative83.7%
Simplified83.7%
Taylor expanded in t around inf 39.5%
Taylor expanded in x around inf 39.4%
Taylor expanded in y around inf 23.0%
if 0.599999999999999978 < (-.f64 (sqrt.f64 (+.f64 x #s(literal 1 binary64))) (sqrt.f64 x)) Initial program 97.6%
associate-+l+97.6%
sub-neg97.6%
sub-neg97.6%
+-commutative97.6%
+-commutative97.6%
+-commutative97.6%
Simplified97.6%
Taylor expanded in x around 0 95.2%
Final simplification60.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)))
(t_2 (- t_1 (sqrt z)))
(t_3 (- 1.0 (sqrt x)))
(t_4 (sqrt (+ 1.0 y))))
(if (<= y 8e-92)
(+
(+ (- (sqrt (+ 1.0 t)) (sqrt t)) t_2)
(+ t_3 (+ 1.0 (- (* 0.5 y) (sqrt y)))))
(if (<= y 1.75e+31)
(+ (/ 1.0 (+ (sqrt z) t_1)) (+ (/ 1.0 (+ (sqrt y) t_4)) t_3))
(+ t_2 (+ (- t_4 (sqrt y)) (/ 1.0 (+ (sqrt x) (sqrt (+ x 1.0))))))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + z));
double t_2 = t_1 - sqrt(z);
double t_3 = 1.0 - sqrt(x);
double t_4 = sqrt((1.0 + y));
double tmp;
if (y <= 8e-92) {
tmp = ((sqrt((1.0 + t)) - sqrt(t)) + t_2) + (t_3 + (1.0 + ((0.5 * y) - sqrt(y))));
} else if (y <= 1.75e+31) {
tmp = (1.0 / (sqrt(z) + t_1)) + ((1.0 / (sqrt(y) + t_4)) + t_3);
} else {
tmp = t_2 + ((t_4 - sqrt(y)) + (1.0 / (sqrt(x) + sqrt((x + 1.0)))));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: tmp
t_1 = sqrt((1.0d0 + z))
t_2 = t_1 - sqrt(z)
t_3 = 1.0d0 - sqrt(x)
t_4 = sqrt((1.0d0 + y))
if (y <= 8d-92) then
tmp = ((sqrt((1.0d0 + t)) - sqrt(t)) + t_2) + (t_3 + (1.0d0 + ((0.5d0 * y) - sqrt(y))))
else if (y <= 1.75d+31) then
tmp = (1.0d0 / (sqrt(z) + t_1)) + ((1.0d0 / (sqrt(y) + t_4)) + t_3)
else
tmp = t_2 + ((t_4 - sqrt(y)) + (1.0d0 / (sqrt(x) + sqrt((x + 1.0d0)))))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + z));
double t_2 = t_1 - Math.sqrt(z);
double t_3 = 1.0 - Math.sqrt(x);
double t_4 = Math.sqrt((1.0 + y));
double tmp;
if (y <= 8e-92) {
tmp = ((Math.sqrt((1.0 + t)) - Math.sqrt(t)) + t_2) + (t_3 + (1.0 + ((0.5 * y) - Math.sqrt(y))));
} else if (y <= 1.75e+31) {
tmp = (1.0 / (Math.sqrt(z) + t_1)) + ((1.0 / (Math.sqrt(y) + t_4)) + t_3);
} else {
tmp = t_2 + ((t_4 - Math.sqrt(y)) + (1.0 / (Math.sqrt(x) + Math.sqrt((x + 1.0)))));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + z)) t_2 = t_1 - math.sqrt(z) t_3 = 1.0 - math.sqrt(x) t_4 = math.sqrt((1.0 + y)) tmp = 0 if y <= 8e-92: tmp = ((math.sqrt((1.0 + t)) - math.sqrt(t)) + t_2) + (t_3 + (1.0 + ((0.5 * y) - math.sqrt(y)))) elif y <= 1.75e+31: tmp = (1.0 / (math.sqrt(z) + t_1)) + ((1.0 / (math.sqrt(y) + t_4)) + t_3) else: tmp = t_2 + ((t_4 - math.sqrt(y)) + (1.0 / (math.sqrt(x) + math.sqrt((x + 1.0))))) 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)) t_4 = sqrt(Float64(1.0 + y)) tmp = 0.0 if (y <= 8e-92) tmp = Float64(Float64(Float64(sqrt(Float64(1.0 + t)) - sqrt(t)) + t_2) + Float64(t_3 + Float64(1.0 + Float64(Float64(0.5 * y) - sqrt(y))))); elseif (y <= 1.75e+31) tmp = Float64(Float64(1.0 / Float64(sqrt(z) + t_1)) + Float64(Float64(1.0 / Float64(sqrt(y) + t_4)) + t_3)); else tmp = Float64(t_2 + Float64(Float64(t_4 - sqrt(y)) + Float64(1.0 / Float64(sqrt(x) + sqrt(Float64(x + 1.0)))))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + z));
t_2 = t_1 - sqrt(z);
t_3 = 1.0 - sqrt(x);
t_4 = sqrt((1.0 + y));
tmp = 0.0;
if (y <= 8e-92)
tmp = ((sqrt((1.0 + t)) - sqrt(t)) + t_2) + (t_3 + (1.0 + ((0.5 * y) - sqrt(y))));
elseif (y <= 1.75e+31)
tmp = (1.0 / (sqrt(z) + t_1)) + ((1.0 / (sqrt(y) + t_4)) + t_3);
else
tmp = t_2 + ((t_4 - sqrt(y)) + (1.0 / (sqrt(x) + sqrt((x + 1.0)))));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := 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]}, Block[{t$95$4 = N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y, 8e-92], N[(N[(N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision] + t$95$2), $MachinePrecision] + N[(t$95$3 + N[(1.0 + N[(N[(0.5 * y), $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.75e+31], N[(N[(1.0 / N[(N[Sqrt[z], $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 / N[(N[Sqrt[y], $MachinePrecision] + t$95$4), $MachinePrecision]), $MachinePrecision] + t$95$3), $MachinePrecision]), $MachinePrecision], N[(t$95$2 + N[(N[(t$95$4 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[N[(x + 1.0), $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 + z}\\
t_2 := t\_1 - \sqrt{z}\\
t_3 := 1 - \sqrt{x}\\
t_4 := \sqrt{1 + y}\\
\mathbf{if}\;y \leq 8 \cdot 10^{-92}:\\
\;\;\;\;\left(\left(\sqrt{1 + t} - \sqrt{t}\right) + t\_2\right) + \left(t\_3 + \left(1 + \left(0.5 \cdot y - \sqrt{y}\right)\right)\right)\\
\mathbf{elif}\;y \leq 1.75 \cdot 10^{+31}:\\
\;\;\;\;\frac{1}{\sqrt{z} + t\_1} + \left(\frac{1}{\sqrt{y} + t\_4} + t\_3\right)\\
\mathbf{else}:\\
\;\;\;\;t\_2 + \left(\left(t\_4 - \sqrt{y}\right) + \frac{1}{\sqrt{x} + \sqrt{x + 1}}\right)\\
\end{array}
\end{array}
if y < 7.9999999999999999e-92Initial program 98.0%
associate-+l+98.0%
sub-neg98.0%
sub-neg98.0%
+-commutative98.0%
+-commutative98.0%
+-commutative98.0%
Simplified98.0%
Taylor expanded in x around 0 53.4%
Taylor expanded in y around 0 53.4%
associate--l+53.4%
Simplified53.4%
if 7.9999999999999999e-92 < y < 1.75e31Initial program 91.2%
associate-+l+91.2%
sub-neg91.2%
sub-neg91.2%
+-commutative91.2%
+-commutative91.2%
+-commutative91.2%
Simplified91.2%
flip--91.1%
div-inv91.1%
add-sqr-sqrt87.9%
add-sqr-sqrt92.5%
associate--l+96.6%
Applied egg-rr96.6%
+-inverses96.6%
metadata-eval96.6%
*-lft-identity96.6%
+-commutative96.6%
Simplified96.6%
flip--97.1%
div-inv97.1%
add-sqr-sqrt80.4%
add-sqr-sqrt98.3%
associate--l+98.3%
Applied egg-rr98.3%
+-inverses98.3%
metadata-eval98.3%
*-lft-identity98.3%
+-commutative98.3%
Simplified98.3%
Taylor expanded in x around 0 58.2%
Taylor expanded in t around inf 35.0%
if 1.75e31 < y Initial program 86.1%
associate-+l+86.1%
sub-neg86.1%
sub-neg86.1%
+-commutative86.1%
+-commutative86.1%
+-commutative86.1%
Simplified86.1%
flip--86.3%
div-inv86.3%
add-sqr-sqrt71.6%
+-commutative71.6%
add-sqr-sqrt86.3%
+-commutative86.3%
Applied egg-rr86.3%
associate--l+88.0%
+-inverses88.0%
metadata-eval88.0%
*-lft-identity88.0%
+-commutative88.0%
Simplified88.0%
Taylor expanded in t around inf 46.7%
Final simplification46.1%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (sqrt (+ 1.0 y)) (sqrt y))))
(if (<= t 3.8e+18)
(+
(+ (- 1.0 (sqrt x)) t_1)
(- (+ 1.0 (sqrt (+ 1.0 t))) (+ (sqrt z) (sqrt t))))
(+
(- (sqrt (+ 1.0 z)) (sqrt z))
(+ t_1 (/ 1.0 (+ (sqrt x) (sqrt (+ x 1.0)))))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + y)) - sqrt(y);
double tmp;
if (t <= 3.8e+18) {
tmp = ((1.0 - sqrt(x)) + t_1) + ((1.0 + sqrt((1.0 + t))) - (sqrt(z) + sqrt(t)));
} else {
tmp = (sqrt((1.0 + z)) - sqrt(z)) + (t_1 + (1.0 / (sqrt(x) + sqrt((x + 1.0)))));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = sqrt((1.0d0 + y)) - sqrt(y)
if (t <= 3.8d+18) then
tmp = ((1.0d0 - sqrt(x)) + t_1) + ((1.0d0 + sqrt((1.0d0 + t))) - (sqrt(z) + sqrt(t)))
else
tmp = (sqrt((1.0d0 + z)) - sqrt(z)) + (t_1 + (1.0d0 / (sqrt(x) + sqrt((x + 1.0d0)))))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + y)) - Math.sqrt(y);
double tmp;
if (t <= 3.8e+18) {
tmp = ((1.0 - Math.sqrt(x)) + t_1) + ((1.0 + Math.sqrt((1.0 + t))) - (Math.sqrt(z) + Math.sqrt(t)));
} else {
tmp = (Math.sqrt((1.0 + z)) - Math.sqrt(z)) + (t_1 + (1.0 / (Math.sqrt(x) + Math.sqrt((x + 1.0)))));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + y)) - math.sqrt(y) tmp = 0 if t <= 3.8e+18: tmp = ((1.0 - math.sqrt(x)) + t_1) + ((1.0 + math.sqrt((1.0 + t))) - (math.sqrt(z) + math.sqrt(t))) else: tmp = (math.sqrt((1.0 + z)) - math.sqrt(z)) + (t_1 + (1.0 / (math.sqrt(x) + math.sqrt((x + 1.0))))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = Float64(sqrt(Float64(1.0 + y)) - sqrt(y)) tmp = 0.0 if (t <= 3.8e+18) tmp = Float64(Float64(Float64(1.0 - sqrt(x)) + t_1) + Float64(Float64(1.0 + sqrt(Float64(1.0 + t))) - Float64(sqrt(z) + sqrt(t)))); else tmp = Float64(Float64(sqrt(Float64(1.0 + z)) - sqrt(z)) + Float64(t_1 + Float64(1.0 / Float64(sqrt(x) + sqrt(Float64(x + 1.0)))))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + y)) - sqrt(y);
tmp = 0.0;
if (t <= 3.8e+18)
tmp = ((1.0 - sqrt(x)) + t_1) + ((1.0 + sqrt((1.0 + t))) - (sqrt(z) + sqrt(t)));
else
tmp = (sqrt((1.0 + z)) - sqrt(z)) + (t_1 + (1.0 / (sqrt(x) + sqrt((x + 1.0)))));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, 3.8e+18], N[(N[(N[(1.0 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision] + N[(N[(1.0 + N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[z], $MachinePrecision] + N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] + N[(t$95$1 + N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[N[(x + 1.0), $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 + y} - \sqrt{y}\\
\mathbf{if}\;t \leq 3.8 \cdot 10^{+18}:\\
\;\;\;\;\left(\left(1 - \sqrt{x}\right) + t\_1\right) + \left(\left(1 + \sqrt{1 + t}\right) - \left(\sqrt{z} + \sqrt{t}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(t\_1 + \frac{1}{\sqrt{x} + \sqrt{x + 1}}\right)\\
\end{array}
\end{array}
if t < 3.8e18Initial program 96.7%
associate-+l+96.7%
sub-neg96.7%
sub-neg96.7%
+-commutative96.7%
+-commutative96.7%
+-commutative96.7%
Simplified96.7%
Taylor expanded in x around 0 50.3%
Taylor expanded in z around 0 25.9%
if 3.8e18 < t Initial program 84.5%
associate-+l+84.5%
sub-neg84.5%
sub-neg84.5%
+-commutative84.5%
+-commutative84.5%
+-commutative84.5%
Simplified84.5%
flip--84.7%
div-inv84.7%
add-sqr-sqrt76.5%
+-commutative76.5%
add-sqr-sqrt85.0%
+-commutative85.0%
Applied egg-rr85.0%
associate--l+86.7%
+-inverses86.7%
metadata-eval86.7%
*-lft-identity86.7%
+-commutative86.7%
Simplified86.7%
Taylor expanded in t around inf 86.7%
Final simplification54.4%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ 1.0 z))))
(if (<= x 0.36)
(+
(/ 1.0 (+ (sqrt z) t_1))
(+ (/ 1.0 (+ (sqrt y) (sqrt (+ 1.0 y)))) (- 1.0 (sqrt x))))
(+
(+ (* 0.5 (sqrt (/ 1.0 x))) (* 0.5 (sqrt (/ 1.0 y))))
(+ (- t_1 (sqrt z)) (* 0.5 (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 + z));
double tmp;
if (x <= 0.36) {
tmp = (1.0 / (sqrt(z) + t_1)) + ((1.0 / (sqrt(y) + sqrt((1.0 + y)))) + (1.0 - sqrt(x)));
} else {
tmp = ((0.5 * sqrt((1.0 / x))) + (0.5 * sqrt((1.0 / y)))) + ((t_1 - sqrt(z)) + (0.5 * 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) :: tmp
t_1 = sqrt((1.0d0 + z))
if (x <= 0.36d0) then
tmp = (1.0d0 / (sqrt(z) + t_1)) + ((1.0d0 / (sqrt(y) + sqrt((1.0d0 + y)))) + (1.0d0 - sqrt(x)))
else
tmp = ((0.5d0 * sqrt((1.0d0 / x))) + (0.5d0 * sqrt((1.0d0 / y)))) + ((t_1 - sqrt(z)) + (0.5d0 * 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 + z));
double tmp;
if (x <= 0.36) {
tmp = (1.0 / (Math.sqrt(z) + t_1)) + ((1.0 / (Math.sqrt(y) + Math.sqrt((1.0 + y)))) + (1.0 - Math.sqrt(x)));
} else {
tmp = ((0.5 * Math.sqrt((1.0 / x))) + (0.5 * Math.sqrt((1.0 / y)))) + ((t_1 - Math.sqrt(z)) + (0.5 * 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 + z)) tmp = 0 if x <= 0.36: tmp = (1.0 / (math.sqrt(z) + t_1)) + ((1.0 / (math.sqrt(y) + math.sqrt((1.0 + y)))) + (1.0 - math.sqrt(x))) else: tmp = ((0.5 * math.sqrt((1.0 / x))) + (0.5 * math.sqrt((1.0 / y)))) + ((t_1 - math.sqrt(z)) + (0.5 * 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 + z)) tmp = 0.0 if (x <= 0.36) tmp = Float64(Float64(1.0 / Float64(sqrt(z) + t_1)) + Float64(Float64(1.0 / Float64(sqrt(y) + sqrt(Float64(1.0 + y)))) + Float64(1.0 - sqrt(x)))); else tmp = Float64(Float64(Float64(0.5 * sqrt(Float64(1.0 / x))) + Float64(0.5 * sqrt(Float64(1.0 / y)))) + Float64(Float64(t_1 - sqrt(z)) + Float64(0.5 * 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 + z));
tmp = 0.0;
if (x <= 0.36)
tmp = (1.0 / (sqrt(z) + t_1)) + ((1.0 / (sqrt(y) + sqrt((1.0 + y)))) + (1.0 - sqrt(x)));
else
tmp = ((0.5 * sqrt((1.0 / x))) + (0.5 * sqrt((1.0 / y)))) + ((t_1 - sqrt(z)) + (0.5 * 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 + z), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x, 0.36], N[(N[(1.0 / N[(N[Sqrt[z], $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 / N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(0.5 * N[Sqrt[N[(1.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(0.5 * N[Sqrt[N[(1.0 / y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$1 - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] + N[(0.5 * N[Sqrt[N[(1.0 / t), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + z}\\
\mathbf{if}\;x \leq 0.36:\\
\;\;\;\;\frac{1}{\sqrt{z} + t\_1} + \left(\frac{1}{\sqrt{y} + \sqrt{1 + y}} + \left(1 - \sqrt{x}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(0.5 \cdot \sqrt{\frac{1}{x}} + 0.5 \cdot \sqrt{\frac{1}{y}}\right) + \left(\left(t\_1 - \sqrt{z}\right) + 0.5 \cdot \sqrt{\frac{1}{t}}\right)\\
\end{array}
\end{array}
if x < 0.35999999999999999Initial program 97.6%
associate-+l+97.6%
sub-neg97.6%
sub-neg97.6%
+-commutative97.6%
+-commutative97.6%
+-commutative97.6%
Simplified97.6%
flip--97.6%
div-inv97.6%
add-sqr-sqrt70.0%
add-sqr-sqrt97.9%
associate--l+98.9%
Applied egg-rr98.9%
+-inverses98.9%
metadata-eval98.9%
*-lft-identity98.9%
+-commutative98.9%
Simplified98.9%
flip--99.1%
div-inv99.1%
add-sqr-sqrt76.7%
add-sqr-sqrt99.3%
associate--l+99.3%
Applied egg-rr99.3%
+-inverses99.3%
metadata-eval99.3%
*-lft-identity99.3%
+-commutative99.3%
Simplified99.3%
Taylor expanded in x around 0 96.4%
Taylor expanded in t around inf 57.1%
if 0.35999999999999999 < x Initial program 83.6%
associate-+l+83.6%
sub-neg83.6%
sub-neg83.6%
+-commutative83.6%
+-commutative83.6%
+-commutative83.6%
Simplified83.6%
Taylor expanded in t around inf 39.0%
Taylor expanded in x around inf 39.5%
Taylor expanded in y around inf 23.2%
Final simplification41.0%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (+ (/ 1.0 (+ (sqrt z) (sqrt (+ 1.0 z)))) (+ (/ 1.0 (+ (sqrt y) (sqrt (+ 1.0 y)))) (- 1.0 (sqrt x)))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
return (1.0 / (sqrt(z) + sqrt((1.0 + z)))) + ((1.0 / (sqrt(y) + sqrt((1.0 + y)))) + (1.0 - 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 = (1.0d0 / (sqrt(z) + sqrt((1.0d0 + z)))) + ((1.0d0 / (sqrt(y) + sqrt((1.0d0 + y)))) + (1.0d0 - sqrt(x)))
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
return (1.0 / (Math.sqrt(z) + Math.sqrt((1.0 + z)))) + ((1.0 / (Math.sqrt(y) + Math.sqrt((1.0 + y)))) + (1.0 - Math.sqrt(x)));
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): return (1.0 / (math.sqrt(z) + math.sqrt((1.0 + z)))) + ((1.0 / (math.sqrt(y) + math.sqrt((1.0 + y)))) + (1.0 - math.sqrt(x)))
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) return Float64(Float64(1.0 / Float64(sqrt(z) + sqrt(Float64(1.0 + z)))) + Float64(Float64(1.0 / Float64(sqrt(y) + sqrt(Float64(1.0 + y)))) + Float64(1.0 - sqrt(x)))) end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp = code(x, y, z, t)
tmp = (1.0 / (sqrt(z) + sqrt((1.0 + z)))) + ((1.0 / (sqrt(y) + sqrt((1.0 + y)))) + (1.0 - 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[(1.0 / N[(N[Sqrt[z], $MachinePrecision] + N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 / N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\frac{1}{\sqrt{z} + \sqrt{1 + z}} + \left(\frac{1}{\sqrt{y} + \sqrt{1 + y}} + \left(1 - \sqrt{x}\right)\right)
\end{array}
Initial program 91.0%
associate-+l+91.0%
sub-neg91.0%
sub-neg91.0%
+-commutative91.0%
+-commutative91.0%
+-commutative91.0%
Simplified91.0%
flip--91.0%
div-inv91.0%
add-sqr-sqrt66.7%
add-sqr-sqrt91.3%
associate--l+93.1%
Applied egg-rr93.1%
+-inverses93.1%
metadata-eval93.1%
*-lft-identity93.1%
+-commutative93.1%
Simplified93.1%
flip--93.3%
div-inv93.3%
add-sqr-sqrt74.0%
add-sqr-sqrt93.9%
associate--l+96.6%
Applied egg-rr96.6%
+-inverses96.6%
metadata-eval96.6%
*-lft-identity96.6%
+-commutative96.6%
Simplified96.6%
Taylor expanded in x around 0 51.5%
Taylor expanded in t around inf 30.8%
Final simplification30.8%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (+ (+ (/ 1.0 (+ (sqrt y) (sqrt (+ 1.0 y)))) (- 1.0 (sqrt x))) (- (sqrt (+ 1.0 z)) (sqrt z))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
return ((1.0 / (sqrt(y) + sqrt((1.0 + y)))) + (1.0 - sqrt(x))) + (sqrt((1.0 + z)) - sqrt(z));
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = ((1.0d0 / (sqrt(y) + sqrt((1.0d0 + y)))) + (1.0d0 - sqrt(x))) + (sqrt((1.0d0 + z)) - sqrt(z))
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
return ((1.0 / (Math.sqrt(y) + Math.sqrt((1.0 + y)))) + (1.0 - Math.sqrt(x))) + (Math.sqrt((1.0 + z)) - Math.sqrt(z));
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): return ((1.0 / (math.sqrt(y) + math.sqrt((1.0 + y)))) + (1.0 - math.sqrt(x))) + (math.sqrt((1.0 + z)) - math.sqrt(z))
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) return Float64(Float64(Float64(1.0 / Float64(sqrt(y) + sqrt(Float64(1.0 + y)))) + Float64(1.0 - sqrt(x))) + Float64(sqrt(Float64(1.0 + z)) - sqrt(z))) end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp = code(x, y, z, t)
tmp = ((1.0 / (sqrt(y) + sqrt((1.0 + y)))) + (1.0 - sqrt(x))) + (sqrt((1.0 + z)) - sqrt(z));
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := N[(N[(N[(1.0 / N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\left(\frac{1}{\sqrt{y} + \sqrt{1 + y}} + \left(1 - \sqrt{x}\right)\right) + \left(\sqrt{1 + z} - \sqrt{z}\right)
\end{array}
Initial program 91.0%
associate-+l+91.0%
sub-neg91.0%
sub-neg91.0%
+-commutative91.0%
+-commutative91.0%
+-commutative91.0%
Simplified91.0%
Taylor expanded in x around 0 50.6%
Taylor expanded in t around inf 30.2%
flip--91.0%
div-inv91.0%
add-sqr-sqrt66.7%
add-sqr-sqrt91.3%
associate--l+93.1%
Applied egg-rr30.5%
+-inverses93.1%
metadata-eval93.1%
*-lft-identity93.1%
+-commutative93.1%
Simplified30.5%
Final simplification30.5%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (+ (/ 1.0 (+ (sqrt z) (sqrt (+ 1.0 z)))) (+ (- 1.0 (sqrt x)) (- (sqrt (+ 1.0 y)) (sqrt y)))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
return (1.0 / (sqrt(z) + sqrt((1.0 + z)))) + ((1.0 - sqrt(x)) + (sqrt((1.0 + y)) - sqrt(y)));
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (1.0d0 / (sqrt(z) + sqrt((1.0d0 + z)))) + ((1.0d0 - sqrt(x)) + (sqrt((1.0d0 + y)) - sqrt(y)))
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
return (1.0 / (Math.sqrt(z) + Math.sqrt((1.0 + z)))) + ((1.0 - Math.sqrt(x)) + (Math.sqrt((1.0 + y)) - Math.sqrt(y)));
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): return (1.0 / (math.sqrt(z) + math.sqrt((1.0 + z)))) + ((1.0 - math.sqrt(x)) + (math.sqrt((1.0 + y)) - math.sqrt(y)))
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) return Float64(Float64(1.0 / Float64(sqrt(z) + sqrt(Float64(1.0 + z)))) + Float64(Float64(1.0 - sqrt(x)) + Float64(sqrt(Float64(1.0 + y)) - sqrt(y)))) end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp = code(x, y, z, t)
tmp = (1.0 / (sqrt(z) + sqrt((1.0 + z)))) + ((1.0 - sqrt(x)) + (sqrt((1.0 + y)) - sqrt(y)));
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := N[(N[(1.0 / N[(N[Sqrt[z], $MachinePrecision] + N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\frac{1}{\sqrt{z} + \sqrt{1 + z}} + \left(\left(1 - \sqrt{x}\right) + \left(\sqrt{1 + y} - \sqrt{y}\right)\right)
\end{array}
Initial program 91.0%
associate-+l+91.0%
sub-neg91.0%
sub-neg91.0%
+-commutative91.0%
+-commutative91.0%
+-commutative91.0%
Simplified91.0%
Taylor expanded in x around 0 50.6%
Taylor expanded in t around inf 30.2%
flip--93.3%
div-inv93.3%
add-sqr-sqrt74.0%
add-sqr-sqrt93.9%
associate--l+96.6%
Applied egg-rr30.4%
+-inverses96.6%
metadata-eval96.6%
*-lft-identity96.6%
+-commutative96.6%
Simplified30.4%
Final simplification30.4%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (+ (- (sqrt (+ 1.0 z)) (sqrt z)) (+ 1.0 (- (sqrt (+ 1.0 y)) (+ (sqrt x) (sqrt y))))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
return (sqrt((1.0 + z)) - sqrt(z)) + (1.0 + (sqrt((1.0 + y)) - (sqrt(x) + sqrt(y))));
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (sqrt((1.0d0 + z)) - sqrt(z)) + (1.0d0 + (sqrt((1.0d0 + y)) - (sqrt(x) + sqrt(y))))
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
return (Math.sqrt((1.0 + z)) - Math.sqrt(z)) + (1.0 + (Math.sqrt((1.0 + y)) - (Math.sqrt(x) + Math.sqrt(y))));
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): return (math.sqrt((1.0 + z)) - math.sqrt(z)) + (1.0 + (math.sqrt((1.0 + y)) - (math.sqrt(x) + math.sqrt(y))))
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) return Float64(Float64(sqrt(Float64(1.0 + z)) - sqrt(z)) + Float64(1.0 + Float64(sqrt(Float64(1.0 + y)) - Float64(sqrt(x) + sqrt(y))))) end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp = code(x, y, z, t)
tmp = (sqrt((1.0 + z)) - sqrt(z)) + (1.0 + (sqrt((1.0 + y)) - (sqrt(x) + sqrt(y))));
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := N[(N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] + N[(1.0 + N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] - N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(1 + \left(\sqrt{1 + y} - \left(\sqrt{x} + \sqrt{y}\right)\right)\right)
\end{array}
Initial program 91.0%
associate-+l+91.0%
sub-neg91.0%
sub-neg91.0%
+-commutative91.0%
+-commutative91.0%
+-commutative91.0%
Simplified91.0%
Taylor expanded in x around 0 50.6%
Taylor expanded in t around inf 30.2%
Taylor expanded in x around 0 21.3%
associate--l+37.1%
Simplified37.1%
Final simplification37.1%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(if (<= y 7.4e-11)
(+
(/ 1.0 (+ (sqrt z) (sqrt (+ 1.0 z))))
(+ (- 1.0 (sqrt x)) (+ 1.0 (- (* 0.5 y) (sqrt y)))))
(+
(* 0.5 (sqrt (/ 1.0 t)))
(+ (- (sqrt (+ 1.0 y)) (sqrt y)) (+ 1.0 (- (* x 0.5) (sqrt x)))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 7.4e-11) {
tmp = (1.0 / (sqrt(z) + sqrt((1.0 + z)))) + ((1.0 - sqrt(x)) + (1.0 + ((0.5 * y) - sqrt(y))));
} else {
tmp = (0.5 * sqrt((1.0 / t))) + ((sqrt((1.0 + y)) - sqrt(y)) + (1.0 + ((x * 0.5) - sqrt(x))));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= 7.4d-11) then
tmp = (1.0d0 / (sqrt(z) + sqrt((1.0d0 + z)))) + ((1.0d0 - sqrt(x)) + (1.0d0 + ((0.5d0 * y) - sqrt(y))))
else
tmp = (0.5d0 * sqrt((1.0d0 / t))) + ((sqrt((1.0d0 + y)) - sqrt(y)) + (1.0d0 + ((x * 0.5d0) - sqrt(x))))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= 7.4e-11) {
tmp = (1.0 / (Math.sqrt(z) + Math.sqrt((1.0 + z)))) + ((1.0 - Math.sqrt(x)) + (1.0 + ((0.5 * y) - Math.sqrt(y))));
} else {
tmp = (0.5 * Math.sqrt((1.0 / t))) + ((Math.sqrt((1.0 + y)) - Math.sqrt(y)) + (1.0 + ((x * 0.5) - Math.sqrt(x))));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if y <= 7.4e-11: tmp = (1.0 / (math.sqrt(z) + math.sqrt((1.0 + z)))) + ((1.0 - math.sqrt(x)) + (1.0 + ((0.5 * y) - math.sqrt(y)))) else: tmp = (0.5 * math.sqrt((1.0 / t))) + ((math.sqrt((1.0 + y)) - math.sqrt(y)) + (1.0 + ((x * 0.5) - math.sqrt(x)))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (y <= 7.4e-11) tmp = Float64(Float64(1.0 / Float64(sqrt(z) + sqrt(Float64(1.0 + z)))) + Float64(Float64(1.0 - sqrt(x)) + Float64(1.0 + Float64(Float64(0.5 * y) - sqrt(y))))); else tmp = Float64(Float64(0.5 * sqrt(Float64(1.0 / t))) + Float64(Float64(sqrt(Float64(1.0 + y)) - sqrt(y)) + Float64(1.0 + Float64(Float64(x * 0.5) - sqrt(x))))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (y <= 7.4e-11)
tmp = (1.0 / (sqrt(z) + sqrt((1.0 + z)))) + ((1.0 - sqrt(x)) + (1.0 + ((0.5 * y) - sqrt(y))));
else
tmp = (0.5 * sqrt((1.0 / t))) + ((sqrt((1.0 + y)) - sqrt(y)) + (1.0 + ((x * 0.5) - sqrt(x))));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[y, 7.4e-11], N[(N[(1.0 / N[(N[Sqrt[z], $MachinePrecision] + N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(1.0 + N[(N[(0.5 * y), $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(0.5 * N[Sqrt[N[(1.0 / t), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision] + N[(1.0 + N[(N[(x * 0.5), $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 7.4 \cdot 10^{-11}:\\
\;\;\;\;\frac{1}{\sqrt{z} + \sqrt{1 + z}} + \left(\left(1 - \sqrt{x}\right) + \left(1 + \left(0.5 \cdot y - \sqrt{y}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \sqrt{\frac{1}{t}} + \left(\left(\sqrt{1 + y} - \sqrt{y}\right) + \left(1 + \left(x \cdot 0.5 - \sqrt{x}\right)\right)\right)\\
\end{array}
\end{array}
if y < 7.4000000000000003e-11Initial program 97.2%
associate-+l+97.2%
sub-neg97.2%
sub-neg97.2%
+-commutative97.2%
+-commutative97.2%
+-commutative97.2%
Simplified97.2%
Taylor expanded in x around 0 53.0%
Taylor expanded in t around inf 28.9%
Taylor expanded in y around 0 28.9%
associate--l+53.0%
Simplified28.9%
flip--97.7%
div-inv97.7%
add-sqr-sqrt75.5%
add-sqr-sqrt98.2%
associate--l+98.4%
Applied egg-rr29.4%
+-inverses98.4%
metadata-eval98.4%
*-lft-identity98.4%
+-commutative98.4%
Simplified29.4%
if 7.4000000000000003e-11 < y Initial program 85.7%
associate-+l+85.7%
sub-neg85.7%
sub-neg85.7%
+-commutative85.7%
+-commutative85.7%
+-commutative85.7%
Simplified85.7%
Taylor expanded in t around inf 44.9%
Taylor expanded in x around 0 31.6%
associate--l+31.6%
Simplified31.6%
Taylor expanded in z around inf 19.8%
Final simplification24.2%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(if (<= z 16000000.0)
(+ 2.0 (- (sqrt (+ 1.0 z)) (+ (sqrt x) (+ (sqrt y) (sqrt z)))))
(+
(+ (- 1.0 (sqrt x)) (- (sqrt (+ 1.0 y)) (sqrt y)))
(* 0.5 (sqrt (/ 1.0 z))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (z <= 16000000.0) {
tmp = 2.0 + (sqrt((1.0 + z)) - (sqrt(x) + (sqrt(y) + sqrt(z))));
} else {
tmp = ((1.0 - sqrt(x)) + (sqrt((1.0 + y)) - sqrt(y))) + (0.5 * sqrt((1.0 / z)));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (z <= 16000000.0d0) then
tmp = 2.0d0 + (sqrt((1.0d0 + z)) - (sqrt(x) + (sqrt(y) + sqrt(z))))
else
tmp = ((1.0d0 - sqrt(x)) + (sqrt((1.0d0 + y)) - sqrt(y))) + (0.5d0 * sqrt((1.0d0 / z)))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= 16000000.0) {
tmp = 2.0 + (Math.sqrt((1.0 + z)) - (Math.sqrt(x) + (Math.sqrt(y) + Math.sqrt(z))));
} else {
tmp = ((1.0 - Math.sqrt(x)) + (Math.sqrt((1.0 + y)) - Math.sqrt(y))) + (0.5 * Math.sqrt((1.0 / z)));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if z <= 16000000.0: tmp = 2.0 + (math.sqrt((1.0 + z)) - (math.sqrt(x) + (math.sqrt(y) + math.sqrt(z)))) else: tmp = ((1.0 - math.sqrt(x)) + (math.sqrt((1.0 + y)) - math.sqrt(y))) + (0.5 * math.sqrt((1.0 / z))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (z <= 16000000.0) tmp = Float64(2.0 + Float64(sqrt(Float64(1.0 + z)) - Float64(sqrt(x) + Float64(sqrt(y) + sqrt(z))))); else tmp = Float64(Float64(Float64(1.0 - sqrt(x)) + Float64(sqrt(Float64(1.0 + y)) - sqrt(y))) + Float64(0.5 * sqrt(Float64(1.0 / z)))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (z <= 16000000.0)
tmp = 2.0 + (sqrt((1.0 + z)) - (sqrt(x) + (sqrt(y) + sqrt(z))));
else
tmp = ((1.0 - sqrt(x)) + (sqrt((1.0 + y)) - sqrt(y))) + (0.5 * sqrt((1.0 / z)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[z, 16000000.0], N[(2.0 + N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[(N[Sqrt[x], $MachinePrecision] + N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(0.5 * N[Sqrt[N[(1.0 / z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq 16000000:\\
\;\;\;\;2 + \left(\sqrt{1 + z} - \left(\sqrt{x} + \left(\sqrt{y} + \sqrt{z}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(1 - \sqrt{x}\right) + \left(\sqrt{1 + y} - \sqrt{y}\right)\right) + 0.5 \cdot \sqrt{\frac{1}{z}}\\
\end{array}
\end{array}
if z < 1.6e7Initial program 98.4%
associate-+l+98.4%
sub-neg98.4%
sub-neg98.4%
+-commutative98.4%
+-commutative98.4%
+-commutative98.4%
Simplified98.4%
Taylor expanded in x around 0 51.7%
Taylor expanded in t around inf 30.6%
Taylor expanded in y around 0 15.5%
associate--l+25.4%
Simplified15.5%
Taylor expanded in y around 0 13.4%
associate--l+13.4%
+-commutative13.4%
Simplified13.4%
if 1.6e7 < z Initial program 83.1%
associate-+l+83.1%
sub-neg83.1%
sub-neg83.1%
+-commutative83.1%
+-commutative83.1%
+-commutative83.1%
Simplified83.1%
Taylor expanded in x around 0 49.5%
Taylor expanded in t around inf 29.8%
Taylor expanded in z around inf 30.3%
Final simplification21.6%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (sqrt (+ 1.0 z)) (sqrt z))))
(if (<= y 0.44)
(+ t_1 (- 2.0 (+ (sqrt x) (sqrt y))))
(+ t_1 (+ (- 1.0 (sqrt x)) (* 0.5 (sqrt (/ 1.0 y))))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + z)) - sqrt(z);
double tmp;
if (y <= 0.44) {
tmp = t_1 + (2.0 - (sqrt(x) + sqrt(y)));
} else {
tmp = t_1 + ((1.0 - sqrt(x)) + (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) :: t_1
real(8) :: tmp
t_1 = sqrt((1.0d0 + z)) - sqrt(z)
if (y <= 0.44d0) then
tmp = t_1 + (2.0d0 - (sqrt(x) + sqrt(y)))
else
tmp = t_1 + ((1.0d0 - sqrt(x)) + (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 t_1 = Math.sqrt((1.0 + z)) - Math.sqrt(z);
double tmp;
if (y <= 0.44) {
tmp = t_1 + (2.0 - (Math.sqrt(x) + Math.sqrt(y)));
} else {
tmp = t_1 + ((1.0 - Math.sqrt(x)) + (0.5 * Math.sqrt((1.0 / y))));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + z)) - math.sqrt(z) tmp = 0 if y <= 0.44: tmp = t_1 + (2.0 - (math.sqrt(x) + math.sqrt(y))) else: tmp = t_1 + ((1.0 - math.sqrt(x)) + (0.5 * math.sqrt((1.0 / y)))) 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 <= 0.44) tmp = Float64(t_1 + Float64(2.0 - Float64(sqrt(x) + sqrt(y)))); else tmp = Float64(t_1 + Float64(Float64(1.0 - sqrt(x)) + 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)
t_1 = sqrt((1.0 + z)) - sqrt(z);
tmp = 0.0;
if (y <= 0.44)
tmp = t_1 + (2.0 - (sqrt(x) + sqrt(y)));
else
tmp = t_1 + ((1.0 - sqrt(x)) + (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_] := Block[{t$95$1 = N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 0.44], N[(t$95$1 + N[(2.0 - N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 + N[(N[(1.0 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(0.5 * N[Sqrt[N[(1.0 / y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + z} - \sqrt{z}\\
\mathbf{if}\;y \leq 0.44:\\
\;\;\;\;t\_1 + \left(2 - \left(\sqrt{x} + \sqrt{y}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1 + \left(\left(1 - \sqrt{x}\right) + 0.5 \cdot \sqrt{\frac{1}{y}}\right)\\
\end{array}
\end{array}
if y < 0.440000000000000002Initial program 97.2%
associate-+l+97.2%
sub-neg97.2%
sub-neg97.2%
+-commutative97.2%
+-commutative97.2%
+-commutative97.2%
Simplified97.2%
Taylor expanded in x around 0 53.9%
Taylor expanded in t around inf 29.9%
Taylor expanded in y around 0 28.9%
if 0.440000000000000002 < y Initial program 85.3%
associate-+l+85.3%
sub-neg85.3%
sub-neg85.3%
+-commutative85.3%
+-commutative85.3%
+-commutative85.3%
Simplified85.3%
Taylor expanded in x around 0 47.6%
Taylor expanded in t around inf 30.5%
Taylor expanded in y around inf 31.1%
Final simplification30.1%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (sqrt (+ 1.0 z)) (sqrt z))))
(if (<= y 1.0)
(+ t_1 (- 2.0 (+ (sqrt x) (sqrt y))))
(+ (- 1.0 (sqrt x)) t_1))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + z)) - sqrt(z);
double tmp;
if (y <= 1.0) {
tmp = t_1 + (2.0 - (sqrt(x) + sqrt(y)));
} else {
tmp = (1.0 - sqrt(x)) + t_1;
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = sqrt((1.0d0 + z)) - sqrt(z)
if (y <= 1.0d0) then
tmp = t_1 + (2.0d0 - (sqrt(x) + sqrt(y)))
else
tmp = (1.0d0 - sqrt(x)) + t_1
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + z)) - Math.sqrt(z);
double tmp;
if (y <= 1.0) {
tmp = t_1 + (2.0 - (Math.sqrt(x) + Math.sqrt(y)));
} else {
tmp = (1.0 - Math.sqrt(x)) + t_1;
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + z)) - math.sqrt(z) tmp = 0 if y <= 1.0: tmp = t_1 + (2.0 - (math.sqrt(x) + math.sqrt(y))) else: tmp = (1.0 - math.sqrt(x)) + t_1 return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = Float64(sqrt(Float64(1.0 + z)) - sqrt(z)) tmp = 0.0 if (y <= 1.0) tmp = Float64(t_1 + Float64(2.0 - Float64(sqrt(x) + sqrt(y)))); else tmp = Float64(Float64(1.0 - sqrt(x)) + t_1); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + z)) - sqrt(z);
tmp = 0.0;
if (y <= 1.0)
tmp = t_1 + (2.0 - (sqrt(x) + sqrt(y)));
else
tmp = (1.0 - sqrt(x)) + t_1;
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 1.0], N[(t$95$1 + N[(2.0 - N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - N[Sqrt[x], $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 1:\\
\;\;\;\;t\_1 + \left(2 - \left(\sqrt{x} + \sqrt{y}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(1 - \sqrt{x}\right) + t\_1\\
\end{array}
\end{array}
if y < 1Initial program 97.2%
associate-+l+97.2%
sub-neg97.2%
sub-neg97.2%
+-commutative97.2%
+-commutative97.2%
+-commutative97.2%
Simplified97.2%
Taylor expanded in x around 0 53.9%
Taylor expanded in t around inf 29.9%
Taylor expanded in y around 0 28.9%
if 1 < y Initial program 85.3%
associate-+l+85.3%
sub-neg85.3%
sub-neg85.3%
+-commutative85.3%
+-commutative85.3%
+-commutative85.3%
Simplified85.3%
Taylor expanded in x around 0 47.6%
Taylor expanded in t around inf 30.5%
Taylor expanded in y around inf 30.3%
Final simplification29.6%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ 1.0 z))))
(if (<= y 8.8e-21)
(+ 2.0 (- t_1 (+ (sqrt x) (+ (sqrt y) (sqrt z)))))
(if (<= y 0.45)
(+ 2.0 (- (* 0.5 (+ y (sqrt (/ 1.0 z)))) (+ (sqrt x) (sqrt y))))
(+ (- 1.0 (sqrt 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 (y <= 8.8e-21) {
tmp = 2.0 + (t_1 - (sqrt(x) + (sqrt(y) + sqrt(z))));
} else if (y <= 0.45) {
tmp = 2.0 + ((0.5 * (y + sqrt((1.0 / z)))) - (sqrt(x) + sqrt(y)));
} else {
tmp = (1.0 - sqrt(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 (y <= 8.8d-21) then
tmp = 2.0d0 + (t_1 - (sqrt(x) + (sqrt(y) + sqrt(z))))
else if (y <= 0.45d0) then
tmp = 2.0d0 + ((0.5d0 * (y + sqrt((1.0d0 / z)))) - (sqrt(x) + sqrt(y)))
else
tmp = (1.0d0 - sqrt(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 (y <= 8.8e-21) {
tmp = 2.0 + (t_1 - (Math.sqrt(x) + (Math.sqrt(y) + Math.sqrt(z))));
} else if (y <= 0.45) {
tmp = 2.0 + ((0.5 * (y + Math.sqrt((1.0 / z)))) - (Math.sqrt(x) + Math.sqrt(y)));
} else {
tmp = (1.0 - Math.sqrt(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 y <= 8.8e-21: tmp = 2.0 + (t_1 - (math.sqrt(x) + (math.sqrt(y) + math.sqrt(z)))) elif y <= 0.45: tmp = 2.0 + ((0.5 * (y + math.sqrt((1.0 / z)))) - (math.sqrt(x) + math.sqrt(y))) else: tmp = (1.0 - math.sqrt(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 (y <= 8.8e-21) tmp = Float64(2.0 + Float64(t_1 - Float64(sqrt(x) + Float64(sqrt(y) + sqrt(z))))); elseif (y <= 0.45) tmp = Float64(2.0 + Float64(Float64(0.5 * Float64(y + sqrt(Float64(1.0 / z)))) - Float64(sqrt(x) + sqrt(y)))); else tmp = Float64(Float64(1.0 - sqrt(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 (y <= 8.8e-21)
tmp = 2.0 + (t_1 - (sqrt(x) + (sqrt(y) + sqrt(z))));
elseif (y <= 0.45)
tmp = 2.0 + ((0.5 * (y + sqrt((1.0 / z)))) - (sqrt(x) + sqrt(y)));
else
tmp = (1.0 - sqrt(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[y, 8.8e-21], N[(2.0 + N[(t$95$1 - N[(N[Sqrt[x], $MachinePrecision] + N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 0.45], N[(2.0 + N[(N[(0.5 * N[(y + N[Sqrt[N[(1.0 / z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - N[Sqrt[x], $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 8.8 \cdot 10^{-21}:\\
\;\;\;\;2 + \left(t\_1 - \left(\sqrt{x} + \left(\sqrt{y} + \sqrt{z}\right)\right)\right)\\
\mathbf{elif}\;y \leq 0.45:\\
\;\;\;\;2 + \left(0.5 \cdot \left(y + \sqrt{\frac{1}{z}}\right) - \left(\sqrt{x} + \sqrt{y}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(1 - \sqrt{x}\right) + \left(t\_1 - \sqrt{z}\right)\\
\end{array}
\end{array}
if y < 8.8000000000000002e-21Initial program 97.5%
associate-+l+97.5%
sub-neg97.5%
sub-neg97.5%
+-commutative97.5%
+-commutative97.5%
+-commutative97.5%
Simplified97.5%
Taylor expanded in x around 0 54.9%
Taylor expanded in t around inf 29.5%
Taylor expanded in y around 0 29.5%
associate--l+54.9%
Simplified29.5%
Taylor expanded in y around 0 17.2%
associate--l+32.1%
+-commutative32.1%
Simplified32.1%
if 8.8000000000000002e-21 < y < 0.450000000000000011Initial program 94.6%
associate-+l+94.6%
sub-neg94.6%
sub-neg94.6%
+-commutative94.6%
+-commutative94.6%
+-commutative94.6%
Simplified94.6%
Taylor expanded in x around 0 44.5%
Taylor expanded in t around inf 33.7%
Taylor expanded in y around 0 31.4%
associate--l+41.7%
Simplified31.4%
Taylor expanded in z around inf 15.3%
associate--l+15.4%
distribute-lft-out15.4%
Simplified15.4%
if 0.450000000000000011 < y Initial program 85.3%
associate-+l+85.3%
sub-neg85.3%
sub-neg85.3%
+-commutative85.3%
+-commutative85.3%
+-commutative85.3%
Simplified85.3%
Taylor expanded in x around 0 47.6%
Taylor expanded in t around inf 30.5%
Taylor expanded in y around inf 30.3%
Final simplification30.4%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(if (<= y 4.6e-165)
(+ 3.0 (- (* 0.5 (+ y z)) (+ (sqrt x) (+ (sqrt y) (sqrt z)))))
(if (<= y 0.9)
(+ 2.0 (- (* 0.5 (+ y (sqrt (/ 1.0 z)))) (+ (sqrt x) (sqrt y))))
(+ (- 1.0 (sqrt x)) (- (sqrt (+ 1.0 z)) (sqrt z))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 4.6e-165) {
tmp = 3.0 + ((0.5 * (y + z)) - (sqrt(x) + (sqrt(y) + sqrt(z))));
} else if (y <= 0.9) {
tmp = 2.0 + ((0.5 * (y + sqrt((1.0 / z)))) - (sqrt(x) + sqrt(y)));
} else {
tmp = (1.0 - sqrt(x)) + (sqrt((1.0 + z)) - sqrt(z));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= 4.6d-165) then
tmp = 3.0d0 + ((0.5d0 * (y + z)) - (sqrt(x) + (sqrt(y) + sqrt(z))))
else if (y <= 0.9d0) then
tmp = 2.0d0 + ((0.5d0 * (y + sqrt((1.0d0 / z)))) - (sqrt(x) + sqrt(y)))
else
tmp = (1.0d0 - sqrt(x)) + (sqrt((1.0d0 + z)) - sqrt(z))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= 4.6e-165) {
tmp = 3.0 + ((0.5 * (y + z)) - (Math.sqrt(x) + (Math.sqrt(y) + Math.sqrt(z))));
} else if (y <= 0.9) {
tmp = 2.0 + ((0.5 * (y + Math.sqrt((1.0 / z)))) - (Math.sqrt(x) + Math.sqrt(y)));
} else {
tmp = (1.0 - Math.sqrt(x)) + (Math.sqrt((1.0 + z)) - Math.sqrt(z));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if y <= 4.6e-165: tmp = 3.0 + ((0.5 * (y + z)) - (math.sqrt(x) + (math.sqrt(y) + math.sqrt(z)))) elif y <= 0.9: tmp = 2.0 + ((0.5 * (y + math.sqrt((1.0 / z)))) - (math.sqrt(x) + math.sqrt(y))) else: tmp = (1.0 - math.sqrt(x)) + (math.sqrt((1.0 + z)) - math.sqrt(z)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (y <= 4.6e-165) tmp = Float64(3.0 + Float64(Float64(0.5 * Float64(y + z)) - Float64(sqrt(x) + Float64(sqrt(y) + sqrt(z))))); elseif (y <= 0.9) tmp = Float64(2.0 + Float64(Float64(0.5 * Float64(y + sqrt(Float64(1.0 / z)))) - Float64(sqrt(x) + sqrt(y)))); else tmp = Float64(Float64(1.0 - sqrt(x)) + Float64(sqrt(Float64(1.0 + z)) - sqrt(z))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (y <= 4.6e-165)
tmp = 3.0 + ((0.5 * (y + z)) - (sqrt(x) + (sqrt(y) + sqrt(z))));
elseif (y <= 0.9)
tmp = 2.0 + ((0.5 * (y + sqrt((1.0 / z)))) - (sqrt(x) + sqrt(y)));
else
tmp = (1.0 - sqrt(x)) + (sqrt((1.0 + z)) - sqrt(z));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[y, 4.6e-165], N[(3.0 + N[(N[(0.5 * N[(y + z), $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[x], $MachinePrecision] + N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 0.9], N[(2.0 + N[(N[(0.5 * N[(y + N[Sqrt[N[(1.0 / z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 4.6 \cdot 10^{-165}:\\
\;\;\;\;3 + \left(0.5 \cdot \left(y + z\right) - \left(\sqrt{x} + \left(\sqrt{y} + \sqrt{z}\right)\right)\right)\\
\mathbf{elif}\;y \leq 0.9:\\
\;\;\;\;2 + \left(0.5 \cdot \left(y + \sqrt{\frac{1}{z}}\right) - \left(\sqrt{x} + \sqrt{y}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(1 - \sqrt{x}\right) + \left(\sqrt{1 + z} - \sqrt{z}\right)\\
\end{array}
\end{array}
if y < 4.6000000000000001e-165Initial program 97.8%
associate-+l+97.8%
sub-neg97.8%
sub-neg97.8%
+-commutative97.8%
+-commutative97.8%
+-commutative97.8%
Simplified97.8%
Taylor expanded in x around 0 57.6%
Taylor expanded in t around inf 32.0%
Taylor expanded in y around 0 32.0%
associate--l+57.6%
Simplified32.0%
Taylor expanded in z around 0 20.6%
associate--l+20.6%
distribute-lft-out20.6%
+-commutative20.6%
Simplified20.6%
if 4.6000000000000001e-165 < y < 0.900000000000000022Initial program 96.8%
associate-+l+96.8%
sub-neg96.8%
sub-neg96.8%
+-commutative96.8%
+-commutative96.8%
+-commutative96.8%
Simplified96.8%
Taylor expanded in x around 0 51.2%
Taylor expanded in t around inf 28.2%
Taylor expanded in y around 0 27.8%
associate--l+50.7%
Simplified27.8%
Taylor expanded in z around inf 19.9%
associate--l+20.0%
distribute-lft-out20.0%
Simplified20.0%
if 0.900000000000000022 < y Initial program 85.3%
associate-+l+85.3%
sub-neg85.3%
sub-neg85.3%
+-commutative85.3%
+-commutative85.3%
+-commutative85.3%
Simplified85.3%
Taylor expanded in x around 0 47.6%
Taylor expanded in t around inf 30.5%
Taylor expanded in y around inf 30.3%
Final simplification25.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 4.6e-165)
(+ 3.0 (- (* 0.5 y) (+ (sqrt x) (+ (sqrt y) (sqrt z)))))
(if (<= y 0.5)
(+ 2.0 (- (* 0.5 (+ y (sqrt (/ 1.0 z)))) (+ (sqrt x) (sqrt y))))
(+ (- 1.0 (sqrt x)) (- (sqrt (+ 1.0 z)) (sqrt z))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 4.6e-165) {
tmp = 3.0 + ((0.5 * y) - (sqrt(x) + (sqrt(y) + sqrt(z))));
} else if (y <= 0.5) {
tmp = 2.0 + ((0.5 * (y + sqrt((1.0 / z)))) - (sqrt(x) + sqrt(y)));
} else {
tmp = (1.0 - sqrt(x)) + (sqrt((1.0 + z)) - sqrt(z));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= 4.6d-165) then
tmp = 3.0d0 + ((0.5d0 * y) - (sqrt(x) + (sqrt(y) + sqrt(z))))
else if (y <= 0.5d0) then
tmp = 2.0d0 + ((0.5d0 * (y + sqrt((1.0d0 / z)))) - (sqrt(x) + sqrt(y)))
else
tmp = (1.0d0 - sqrt(x)) + (sqrt((1.0d0 + z)) - sqrt(z))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= 4.6e-165) {
tmp = 3.0 + ((0.5 * y) - (Math.sqrt(x) + (Math.sqrt(y) + Math.sqrt(z))));
} else if (y <= 0.5) {
tmp = 2.0 + ((0.5 * (y + Math.sqrt((1.0 / z)))) - (Math.sqrt(x) + Math.sqrt(y)));
} else {
tmp = (1.0 - Math.sqrt(x)) + (Math.sqrt((1.0 + z)) - Math.sqrt(z));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if y <= 4.6e-165: tmp = 3.0 + ((0.5 * y) - (math.sqrt(x) + (math.sqrt(y) + math.sqrt(z)))) elif y <= 0.5: tmp = 2.0 + ((0.5 * (y + math.sqrt((1.0 / z)))) - (math.sqrt(x) + math.sqrt(y))) else: tmp = (1.0 - math.sqrt(x)) + (math.sqrt((1.0 + z)) - math.sqrt(z)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (y <= 4.6e-165) tmp = Float64(3.0 + Float64(Float64(0.5 * y) - Float64(sqrt(x) + Float64(sqrt(y) + sqrt(z))))); elseif (y <= 0.5) tmp = Float64(2.0 + Float64(Float64(0.5 * Float64(y + sqrt(Float64(1.0 / z)))) - Float64(sqrt(x) + sqrt(y)))); else tmp = Float64(Float64(1.0 - sqrt(x)) + Float64(sqrt(Float64(1.0 + z)) - sqrt(z))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (y <= 4.6e-165)
tmp = 3.0 + ((0.5 * y) - (sqrt(x) + (sqrt(y) + sqrt(z))));
elseif (y <= 0.5)
tmp = 2.0 + ((0.5 * (y + sqrt((1.0 / z)))) - (sqrt(x) + sqrt(y)));
else
tmp = (1.0 - sqrt(x)) + (sqrt((1.0 + z)) - sqrt(z));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[y, 4.6e-165], N[(3.0 + N[(N[(0.5 * y), $MachinePrecision] - N[(N[Sqrt[x], $MachinePrecision] + N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 0.5], N[(2.0 + N[(N[(0.5 * N[(y + N[Sqrt[N[(1.0 / z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 4.6 \cdot 10^{-165}:\\
\;\;\;\;3 + \left(0.5 \cdot y - \left(\sqrt{x} + \left(\sqrt{y} + \sqrt{z}\right)\right)\right)\\
\mathbf{elif}\;y \leq 0.5:\\
\;\;\;\;2 + \left(0.5 \cdot \left(y + \sqrt{\frac{1}{z}}\right) - \left(\sqrt{x} + \sqrt{y}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(1 - \sqrt{x}\right) + \left(\sqrt{1 + z} - \sqrt{z}\right)\\
\end{array}
\end{array}
if y < 4.6000000000000001e-165Initial program 97.8%
associate-+l+97.8%
sub-neg97.8%
sub-neg97.8%
+-commutative97.8%
+-commutative97.8%
+-commutative97.8%
Simplified97.8%
Taylor expanded in x around 0 57.6%
Taylor expanded in t around inf 32.0%
Taylor expanded in y around 0 32.0%
associate--l+57.6%
Simplified32.0%
Taylor expanded in z around 0 18.7%
associate--l+18.7%
+-commutative18.7%
Simplified18.7%
if 4.6000000000000001e-165 < y < 0.5Initial program 96.8%
associate-+l+96.8%
sub-neg96.8%
sub-neg96.8%
+-commutative96.8%
+-commutative96.8%
+-commutative96.8%
Simplified96.8%
Taylor expanded in x around 0 51.2%
Taylor expanded in t around inf 28.2%
Taylor expanded in y around 0 27.8%
associate--l+50.7%
Simplified27.8%
Taylor expanded in z around inf 19.9%
associate--l+20.0%
distribute-lft-out20.0%
Simplified20.0%
if 0.5 < y Initial program 85.3%
associate-+l+85.3%
sub-neg85.3%
sub-neg85.3%
+-commutative85.3%
+-commutative85.3%
+-commutative85.3%
Simplified85.3%
Taylor expanded in x around 0 47.6%
Taylor expanded in t around inf 30.5%
Taylor expanded in y around inf 30.3%
Final simplification25.1%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(if (<= y 5.2e-165)
(+ 3.0 (- (* 0.5 y) (+ (sqrt x) (+ (sqrt y) (sqrt z)))))
(if (<= y 1.85)
(- (+ (* 0.5 y) 2.0) (+ (sqrt x) (sqrt y)))
(+ (- 1.0 (sqrt x)) (- (sqrt (+ 1.0 z)) (sqrt z))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 5.2e-165) {
tmp = 3.0 + ((0.5 * y) - (sqrt(x) + (sqrt(y) + sqrt(z))));
} else if (y <= 1.85) {
tmp = ((0.5 * y) + 2.0) - (sqrt(x) + sqrt(y));
} else {
tmp = (1.0 - sqrt(x)) + (sqrt((1.0 + z)) - sqrt(z));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= 5.2d-165) then
tmp = 3.0d0 + ((0.5d0 * y) - (sqrt(x) + (sqrt(y) + sqrt(z))))
else if (y <= 1.85d0) then
tmp = ((0.5d0 * y) + 2.0d0) - (sqrt(x) + sqrt(y))
else
tmp = (1.0d0 - sqrt(x)) + (sqrt((1.0d0 + z)) - sqrt(z))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= 5.2e-165) {
tmp = 3.0 + ((0.5 * y) - (Math.sqrt(x) + (Math.sqrt(y) + Math.sqrt(z))));
} else if (y <= 1.85) {
tmp = ((0.5 * y) + 2.0) - (Math.sqrt(x) + Math.sqrt(y));
} else {
tmp = (1.0 - Math.sqrt(x)) + (Math.sqrt((1.0 + z)) - Math.sqrt(z));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if y <= 5.2e-165: tmp = 3.0 + ((0.5 * y) - (math.sqrt(x) + (math.sqrt(y) + math.sqrt(z)))) elif y <= 1.85: tmp = ((0.5 * y) + 2.0) - (math.sqrt(x) + math.sqrt(y)) else: tmp = (1.0 - math.sqrt(x)) + (math.sqrt((1.0 + z)) - math.sqrt(z)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (y <= 5.2e-165) tmp = Float64(3.0 + Float64(Float64(0.5 * y) - Float64(sqrt(x) + Float64(sqrt(y) + sqrt(z))))); elseif (y <= 1.85) tmp = Float64(Float64(Float64(0.5 * y) + 2.0) - Float64(sqrt(x) + sqrt(y))); else tmp = Float64(Float64(1.0 - sqrt(x)) + Float64(sqrt(Float64(1.0 + z)) - sqrt(z))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (y <= 5.2e-165)
tmp = 3.0 + ((0.5 * y) - (sqrt(x) + (sqrt(y) + sqrt(z))));
elseif (y <= 1.85)
tmp = ((0.5 * y) + 2.0) - (sqrt(x) + sqrt(y));
else
tmp = (1.0 - sqrt(x)) + (sqrt((1.0 + z)) - sqrt(z));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[y, 5.2e-165], N[(3.0 + N[(N[(0.5 * y), $MachinePrecision] - N[(N[Sqrt[x], $MachinePrecision] + N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.85], N[(N[(N[(0.5 * y), $MachinePrecision] + 2.0), $MachinePrecision] - N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 5.2 \cdot 10^{-165}:\\
\;\;\;\;3 + \left(0.5 \cdot y - \left(\sqrt{x} + \left(\sqrt{y} + \sqrt{z}\right)\right)\right)\\
\mathbf{elif}\;y \leq 1.85:\\
\;\;\;\;\left(0.5 \cdot y + 2\right) - \left(\sqrt{x} + \sqrt{y}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(1 - \sqrt{x}\right) + \left(\sqrt{1 + z} - \sqrt{z}\right)\\
\end{array}
\end{array}
if y < 5.20000000000000015e-165Initial program 97.8%
associate-+l+97.8%
sub-neg97.8%
sub-neg97.8%
+-commutative97.8%
+-commutative97.8%
+-commutative97.8%
Simplified97.8%
Taylor expanded in x around 0 57.6%
Taylor expanded in t around inf 32.0%
Taylor expanded in y around 0 32.0%
associate--l+57.6%
Simplified32.0%
Taylor expanded in z around 0 18.7%
associate--l+18.7%
+-commutative18.7%
Simplified18.7%
if 5.20000000000000015e-165 < y < 1.8500000000000001Initial program 96.8%
associate-+l+96.8%
sub-neg96.8%
sub-neg96.8%
+-commutative96.8%
+-commutative96.8%
+-commutative96.8%
Simplified96.8%
Taylor expanded in x around 0 51.2%
Taylor expanded in t around inf 28.2%
Taylor expanded in y around 0 27.8%
associate--l+50.7%
Simplified27.8%
Taylor expanded in z around inf 21.1%
if 1.8500000000000001 < y Initial program 85.3%
associate-+l+85.3%
sub-neg85.3%
sub-neg85.3%
+-commutative85.3%
+-commutative85.3%
+-commutative85.3%
Simplified85.3%
Taylor expanded in x around 0 47.6%
Taylor expanded in t around inf 30.5%
Taylor expanded in y around inf 30.3%
Final simplification25.4%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= y 1.95) (- (+ (* 0.5 y) 2.0) (+ (sqrt x) (sqrt y))) (+ (- 1.0 (sqrt x)) (- (sqrt (+ 1.0 z)) (sqrt z)))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 1.95) {
tmp = ((0.5 * y) + 2.0) - (sqrt(x) + sqrt(y));
} else {
tmp = (1.0 - sqrt(x)) + (sqrt((1.0 + z)) - sqrt(z));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= 1.95d0) then
tmp = ((0.5d0 * y) + 2.0d0) - (sqrt(x) + sqrt(y))
else
tmp = (1.0d0 - sqrt(x)) + (sqrt((1.0d0 + z)) - sqrt(z))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= 1.95) {
tmp = ((0.5 * y) + 2.0) - (Math.sqrt(x) + Math.sqrt(y));
} else {
tmp = (1.0 - Math.sqrt(x)) + (Math.sqrt((1.0 + z)) - Math.sqrt(z));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if y <= 1.95: tmp = ((0.5 * y) + 2.0) - (math.sqrt(x) + math.sqrt(y)) else: tmp = (1.0 - math.sqrt(x)) + (math.sqrt((1.0 + z)) - math.sqrt(z)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (y <= 1.95) tmp = Float64(Float64(Float64(0.5 * y) + 2.0) - Float64(sqrt(x) + sqrt(y))); else tmp = Float64(Float64(1.0 - sqrt(x)) + Float64(sqrt(Float64(1.0 + z)) - sqrt(z))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (y <= 1.95)
tmp = ((0.5 * y) + 2.0) - (sqrt(x) + sqrt(y));
else
tmp = (1.0 - sqrt(x)) + (sqrt((1.0 + z)) - sqrt(z));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[y, 1.95], N[(N[(N[(0.5 * y), $MachinePrecision] + 2.0), $MachinePrecision] - N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 1.95:\\
\;\;\;\;\left(0.5 \cdot y + 2\right) - \left(\sqrt{x} + \sqrt{y}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(1 - \sqrt{x}\right) + \left(\sqrt{1 + z} - \sqrt{z}\right)\\
\end{array}
\end{array}
if y < 1.94999999999999996Initial program 97.2%
associate-+l+97.2%
sub-neg97.2%
sub-neg97.2%
+-commutative97.2%
+-commutative97.2%
+-commutative97.2%
Simplified97.2%
Taylor expanded in x around 0 53.9%
Taylor expanded in t around inf 29.9%
Taylor expanded in y around 0 29.6%
associate--l+53.7%
Simplified29.6%
Taylor expanded in z around inf 20.5%
if 1.94999999999999996 < y Initial program 85.3%
associate-+l+85.3%
sub-neg85.3%
sub-neg85.3%
+-commutative85.3%
+-commutative85.3%
+-commutative85.3%
Simplified85.3%
Taylor expanded in x around 0 47.6%
Taylor expanded in t around inf 30.5%
Taylor expanded in y around inf 30.3%
Final simplification25.6%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= z 0.0038) (- (- 1.0 (sqrt x)) (sqrt z)) (- (* 0.5 (sqrt (/ 1.0 z))) (sqrt x))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (z <= 0.0038) {
tmp = (1.0 - sqrt(x)) - sqrt(z);
} else {
tmp = (0.5 * sqrt((1.0 / z))) - 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.0038d0) then
tmp = (1.0d0 - sqrt(x)) - sqrt(z)
else
tmp = (0.5d0 * sqrt((1.0d0 / z))) - 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.0038) {
tmp = (1.0 - Math.sqrt(x)) - Math.sqrt(z);
} else {
tmp = (0.5 * Math.sqrt((1.0 / z))) - 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.0038: tmp = (1.0 - math.sqrt(x)) - math.sqrt(z) else: tmp = (0.5 * math.sqrt((1.0 / z))) - 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.0038) tmp = Float64(Float64(1.0 - sqrt(x)) - sqrt(z)); else tmp = Float64(Float64(0.5 * sqrt(Float64(1.0 / z))) - 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.0038)
tmp = (1.0 - sqrt(x)) - sqrt(z);
else
tmp = (0.5 * sqrt((1.0 / z))) - 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.0038], N[(N[(1.0 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision], N[(N[(0.5 * N[Sqrt[N[(1.0 / z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq 0.0038:\\
\;\;\;\;\left(1 - \sqrt{x}\right) - \sqrt{z}\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \sqrt{\frac{1}{z}} - \sqrt{x}\\
\end{array}
\end{array}
if z < 0.00379999999999999999Initial 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 51.9%
Taylor expanded in t around inf 30.9%
Taylor expanded in x around inf 10.3%
mul-1-neg10.3%
Simplified10.3%
Taylor expanded in z around 0 10.3%
associate--r+10.3%
Simplified10.3%
if 0.00379999999999999999 < z Initial program 83.7%
associate-+l+83.7%
sub-neg83.7%
sub-neg83.7%
+-commutative83.7%
+-commutative83.7%
+-commutative83.7%
Simplified83.7%
Taylor expanded in x around 0 49.4%
Taylor expanded in t around inf 29.5%
Taylor expanded in x around inf 2.2%
mul-1-neg2.2%
Simplified2.2%
Taylor expanded in z around inf 3.5%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (- (+ (* 0.5 y) 2.0) (+ (sqrt x) (sqrt y))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
return ((0.5 * y) + 2.0) - (sqrt(x) + sqrt(y));
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = ((0.5d0 * y) + 2.0d0) - (sqrt(x) + sqrt(y))
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
return ((0.5 * y) + 2.0) - (Math.sqrt(x) + Math.sqrt(y));
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): return ((0.5 * y) + 2.0) - (math.sqrt(x) + math.sqrt(y))
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) return Float64(Float64(Float64(0.5 * y) + 2.0) - Float64(sqrt(x) + sqrt(y))) end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp = code(x, y, z, t)
tmp = ((0.5 * y) + 2.0) - (sqrt(x) + sqrt(y));
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := N[(N[(N[(0.5 * y), $MachinePrecision] + 2.0), $MachinePrecision] - N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\left(0.5 \cdot y + 2\right) - \left(\sqrt{x} + \sqrt{y}\right)
\end{array}
Initial program 91.0%
associate-+l+91.0%
sub-neg91.0%
sub-neg91.0%
+-commutative91.0%
+-commutative91.0%
+-commutative91.0%
Simplified91.0%
Taylor expanded in x around 0 50.6%
Taylor expanded in t around inf 30.2%
Taylor expanded in y around 0 16.4%
associate--l+27.9%
Simplified16.4%
Taylor expanded in z around inf 12.1%
Final simplification12.1%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (- (+ 1.0 (* 0.5 z)) (+ (sqrt x) (sqrt z))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
return (1.0 + (0.5 * z)) - (sqrt(x) + sqrt(z));
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (1.0d0 + (0.5d0 * z)) - (sqrt(x) + sqrt(z))
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
return (1.0 + (0.5 * z)) - (Math.sqrt(x) + Math.sqrt(z));
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): return (1.0 + (0.5 * z)) - (math.sqrt(x) + math.sqrt(z))
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) return Float64(Float64(1.0 + Float64(0.5 * z)) - Float64(sqrt(x) + sqrt(z))) end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp = code(x, y, z, t)
tmp = (1.0 + (0.5 * z)) - (sqrt(x) + sqrt(z));
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := N[(N[(1.0 + N[(0.5 * z), $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\left(1 + 0.5 \cdot z\right) - \left(\sqrt{x} + \sqrt{z}\right)
\end{array}
Initial program 91.0%
associate-+l+91.0%
sub-neg91.0%
sub-neg91.0%
+-commutative91.0%
+-commutative91.0%
+-commutative91.0%
Simplified91.0%
Taylor expanded in x around 0 50.6%
Taylor expanded in t around inf 30.2%
Taylor expanded in x around inf 6.2%
mul-1-neg6.2%
Simplified6.2%
Taylor expanded in z around 0 7.5%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (- (- 1.0 (sqrt x)) (sqrt z)))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
return (1.0 - sqrt(x)) - sqrt(z);
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (1.0d0 - sqrt(x)) - sqrt(z)
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
return (1.0 - Math.sqrt(x)) - Math.sqrt(z);
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): return (1.0 - math.sqrt(x)) - math.sqrt(z)
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) return Float64(Float64(1.0 - sqrt(x)) - sqrt(z)) end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp = code(x, y, z, t)
tmp = (1.0 - sqrt(x)) - sqrt(z);
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := N[(N[(1.0 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\left(1 - \sqrt{x}\right) - \sqrt{z}
\end{array}
Initial program 91.0%
associate-+l+91.0%
sub-neg91.0%
sub-neg91.0%
+-commutative91.0%
+-commutative91.0%
+-commutative91.0%
Simplified91.0%
Taylor expanded in x around 0 50.6%
Taylor expanded in t around inf 30.2%
Taylor expanded in x around inf 6.2%
mul-1-neg6.2%
Simplified6.2%
Taylor expanded in z around 0 5.7%
associate--r+5.7%
Simplified5.7%
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 91.0%
associate-+l+91.0%
sub-neg91.0%
sub-neg91.0%
+-commutative91.0%
+-commutative91.0%
+-commutative91.0%
Simplified91.0%
Taylor expanded in x around 0 50.6%
Taylor expanded in t around inf 30.2%
Taylor expanded in x around inf 6.2%
mul-1-neg6.2%
Simplified6.2%
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 2024089
(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))))