
(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 19 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (+ (+ (+ (- (sqrt (+ x 1.0)) (sqrt x)) (- (sqrt (+ y 1.0)) (sqrt y))) (- (sqrt (+ z 1.0)) (sqrt z))) (- (sqrt (+ t 1.0)) (sqrt t))))
double code(double x, double y, double z, double t) {
return (((sqrt((x + 1.0)) - sqrt(x)) + (sqrt((y + 1.0)) - sqrt(y))) + (sqrt((z + 1.0)) - sqrt(z))) + (sqrt((t + 1.0)) - sqrt(t));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (((sqrt((x + 1.0d0)) - sqrt(x)) + (sqrt((y + 1.0d0)) - sqrt(y))) + (sqrt((z + 1.0d0)) - sqrt(z))) + (sqrt((t + 1.0d0)) - sqrt(t))
end function
public static double code(double x, double y, double z, double t) {
return (((Math.sqrt((x + 1.0)) - Math.sqrt(x)) + (Math.sqrt((y + 1.0)) - Math.sqrt(y))) + (Math.sqrt((z + 1.0)) - Math.sqrt(z))) + (Math.sqrt((t + 1.0)) - Math.sqrt(t));
}
def code(x, y, z, t): return (((math.sqrt((x + 1.0)) - math.sqrt(x)) + (math.sqrt((y + 1.0)) - math.sqrt(y))) + (math.sqrt((z + 1.0)) - math.sqrt(z))) + (math.sqrt((t + 1.0)) - math.sqrt(t))
function code(x, y, z, t) return Float64(Float64(Float64(Float64(sqrt(Float64(x + 1.0)) - sqrt(x)) + Float64(sqrt(Float64(y + 1.0)) - sqrt(y))) + Float64(sqrt(Float64(z + 1.0)) - sqrt(z))) + Float64(sqrt(Float64(t + 1.0)) - sqrt(t))) end
function tmp = code(x, y, z, t) tmp = (((sqrt((x + 1.0)) - sqrt(x)) + (sqrt((y + 1.0)) - sqrt(y))) + (sqrt((z + 1.0)) - sqrt(z))) + (sqrt((t + 1.0)) - sqrt(t)); end
code[x_, y_, z_, t_] := N[(N[(N[(N[(N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(z + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(t + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{y + 1} - \sqrt{y}\right)\right) + \left(\sqrt{z + 1} - \sqrt{z}\right)\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)
\end{array}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ 1.0 x))) (t_2 (sqrt (+ 1.0 z))) (t_3 (sqrt (+ 1.0 y))))
(if (<= z 2.5e+32)
(+
(+ (- t_3 (sqrt y)) (- t_1 (sqrt x)))
(+ (/ 1.0 (+ t_2 (sqrt z))) (/ 1.0 (+ (sqrt (+ 1.0 t)) (sqrt t)))))
(+
(+ (/ 1.0 (+ t_1 (sqrt x))) (/ 1.0 (+ t_3 (sqrt y))))
(- t_2 (sqrt z))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + x));
double t_2 = sqrt((1.0 + z));
double t_3 = sqrt((1.0 + y));
double tmp;
if (z <= 2.5e+32) {
tmp = ((t_3 - sqrt(y)) + (t_1 - sqrt(x))) + ((1.0 / (t_2 + sqrt(z))) + (1.0 / (sqrt((1.0 + t)) + sqrt(t))));
} else {
tmp = ((1.0 / (t_1 + sqrt(x))) + (1.0 / (t_3 + sqrt(y)))) + (t_2 - sqrt(z));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = sqrt((1.0d0 + x))
t_2 = sqrt((1.0d0 + z))
t_3 = sqrt((1.0d0 + y))
if (z <= 2.5d+32) then
tmp = ((t_3 - sqrt(y)) + (t_1 - sqrt(x))) + ((1.0d0 / (t_2 + sqrt(z))) + (1.0d0 / (sqrt((1.0d0 + t)) + sqrt(t))))
else
tmp = ((1.0d0 / (t_1 + sqrt(x))) + (1.0d0 / (t_3 + sqrt(y)))) + (t_2 - sqrt(z))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + x));
double t_2 = Math.sqrt((1.0 + z));
double t_3 = Math.sqrt((1.0 + y));
double tmp;
if (z <= 2.5e+32) {
tmp = ((t_3 - Math.sqrt(y)) + (t_1 - Math.sqrt(x))) + ((1.0 / (t_2 + Math.sqrt(z))) + (1.0 / (Math.sqrt((1.0 + t)) + Math.sqrt(t))));
} else {
tmp = ((1.0 / (t_1 + Math.sqrt(x))) + (1.0 / (t_3 + Math.sqrt(y)))) + (t_2 - Math.sqrt(z));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + x)) t_2 = math.sqrt((1.0 + z)) t_3 = math.sqrt((1.0 + y)) tmp = 0 if z <= 2.5e+32: tmp = ((t_3 - math.sqrt(y)) + (t_1 - math.sqrt(x))) + ((1.0 / (t_2 + math.sqrt(z))) + (1.0 / (math.sqrt((1.0 + t)) + math.sqrt(t)))) else: tmp = ((1.0 / (t_1 + math.sqrt(x))) + (1.0 / (t_3 + math.sqrt(y)))) + (t_2 - math.sqrt(z)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(1.0 + x)) t_2 = sqrt(Float64(1.0 + z)) t_3 = sqrt(Float64(1.0 + y)) tmp = 0.0 if (z <= 2.5e+32) tmp = Float64(Float64(Float64(t_3 - sqrt(y)) + Float64(t_1 - sqrt(x))) + Float64(Float64(1.0 / Float64(t_2 + sqrt(z))) + Float64(1.0 / Float64(sqrt(Float64(1.0 + t)) + sqrt(t))))); else tmp = Float64(Float64(Float64(1.0 / Float64(t_1 + sqrt(x))) + Float64(1.0 / Float64(t_3 + sqrt(y)))) + Float64(t_2 - sqrt(z))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + x));
t_2 = sqrt((1.0 + z));
t_3 = sqrt((1.0 + y));
tmp = 0.0;
if (z <= 2.5e+32)
tmp = ((t_3 - sqrt(y)) + (t_1 - sqrt(x))) + ((1.0 / (t_2 + sqrt(z))) + (1.0 / (sqrt((1.0 + t)) + sqrt(t))));
else
tmp = ((1.0 / (t_1 + sqrt(x))) + (1.0 / (t_3 + sqrt(y)))) + (t_2 - sqrt(z));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[z, 2.5e+32], N[(N[(N[(t$95$3 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision] + N[(t$95$1 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 / N[(t$95$2 + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] + N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 / N[(t$95$1 + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(t$95$3 + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$2 - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + x}\\
t_2 := \sqrt{1 + z}\\
t_3 := \sqrt{1 + y}\\
\mathbf{if}\;z \leq 2.5 \cdot 10^{+32}:\\
\;\;\;\;\left(\left(t_3 - \sqrt{y}\right) + \left(t_1 - \sqrt{x}\right)\right) + \left(\frac{1}{t_2 + \sqrt{z}} + \frac{1}{\sqrt{1 + t} + \sqrt{t}}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{1}{t_1 + \sqrt{x}} + \frac{1}{t_3 + \sqrt{y}}\right) + \left(t_2 - \sqrt{z}\right)\\
\end{array}
\end{array}
if z < 2.4999999999999999e32Initial program 96.4%
associate-+l+96.4%
associate-+l-80.9%
associate-+l-96.4%
sub-neg96.4%
sub-neg96.4%
+-commutative96.4%
+-commutative96.4%
+-commutative96.4%
Simplified96.4%
flip--96.6%
add-sqr-sqrt96.0%
add-sqr-sqrt97.0%
Applied egg-rr97.0%
associate--l+97.8%
+-inverses97.8%
metadata-eval97.8%
Simplified97.8%
flip--97.8%
add-sqr-sqrt78.5%
add-sqr-sqrt97.9%
Applied egg-rr97.9%
associate--l+98.4%
+-inverses98.4%
metadata-eval98.4%
Simplified98.4%
if 2.4999999999999999e32 < z Initial program 89.2%
associate-+l+89.2%
associate-+l-64.8%
associate-+l-89.2%
sub-neg89.2%
sub-neg89.2%
+-commutative89.2%
+-commutative89.2%
+-commutative89.2%
Simplified89.2%
flip--89.9%
add-sqr-sqrt67.0%
+-commutative67.0%
add-sqr-sqrt90.1%
+-commutative90.1%
Applied egg-rr90.1%
associate--l+92.1%
+-inverses92.1%
metadata-eval92.1%
Simplified92.1%
flip--92.4%
add-sqr-sqrt79.2%
add-sqr-sqrt93.2%
Applied egg-rr93.2%
associate--l+95.9%
+-inverses95.9%
metadata-eval95.9%
Simplified95.9%
Taylor expanded in t around inf 57.0%
Final simplification81.5%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ 1.0 x))) (t_2 (sqrt (+ 1.0 y))) (t_3 (sqrt (+ 1.0 z))))
(if (<= (- t_2 (sqrt y)) 0.9999999999999998)
(+ (+ (/ 1.0 (+ t_1 (sqrt x))) (/ 1.0 (+ t_2 (sqrt y)))) (- t_3 (sqrt z)))
(+
(+ (- (sqrt (+ 1.0 t)) (sqrt t)) (/ 1.0 (+ t_3 (sqrt z))))
(+ 1.0 (- t_1 (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 + x));
double t_2 = sqrt((1.0 + y));
double t_3 = sqrt((1.0 + z));
double tmp;
if ((t_2 - sqrt(y)) <= 0.9999999999999998) {
tmp = ((1.0 / (t_1 + sqrt(x))) + (1.0 / (t_2 + sqrt(y)))) + (t_3 - sqrt(z));
} else {
tmp = ((sqrt((1.0 + t)) - sqrt(t)) + (1.0 / (t_3 + sqrt(z)))) + (1.0 + (t_1 - 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) :: t_3
real(8) :: tmp
t_1 = sqrt((1.0d0 + x))
t_2 = sqrt((1.0d0 + y))
t_3 = sqrt((1.0d0 + z))
if ((t_2 - sqrt(y)) <= 0.9999999999999998d0) then
tmp = ((1.0d0 / (t_1 + sqrt(x))) + (1.0d0 / (t_2 + sqrt(y)))) + (t_3 - sqrt(z))
else
tmp = ((sqrt((1.0d0 + t)) - sqrt(t)) + (1.0d0 / (t_3 + sqrt(z)))) + (1.0d0 + (t_1 - 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 + x));
double t_2 = Math.sqrt((1.0 + y));
double t_3 = Math.sqrt((1.0 + z));
double tmp;
if ((t_2 - Math.sqrt(y)) <= 0.9999999999999998) {
tmp = ((1.0 / (t_1 + Math.sqrt(x))) + (1.0 / (t_2 + Math.sqrt(y)))) + (t_3 - Math.sqrt(z));
} else {
tmp = ((Math.sqrt((1.0 + t)) - Math.sqrt(t)) + (1.0 / (t_3 + Math.sqrt(z)))) + (1.0 + (t_1 - 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 + x)) t_2 = math.sqrt((1.0 + y)) t_3 = math.sqrt((1.0 + z)) tmp = 0 if (t_2 - math.sqrt(y)) <= 0.9999999999999998: tmp = ((1.0 / (t_1 + math.sqrt(x))) + (1.0 / (t_2 + math.sqrt(y)))) + (t_3 - math.sqrt(z)) else: tmp = ((math.sqrt((1.0 + t)) - math.sqrt(t)) + (1.0 / (t_3 + math.sqrt(z)))) + (1.0 + (t_1 - 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 + x)) t_2 = sqrt(Float64(1.0 + y)) t_3 = sqrt(Float64(1.0 + z)) tmp = 0.0 if (Float64(t_2 - sqrt(y)) <= 0.9999999999999998) tmp = Float64(Float64(Float64(1.0 / Float64(t_1 + sqrt(x))) + Float64(1.0 / Float64(t_2 + sqrt(y)))) + Float64(t_3 - sqrt(z))); else tmp = Float64(Float64(Float64(sqrt(Float64(1.0 + t)) - sqrt(t)) + Float64(1.0 / Float64(t_3 + sqrt(z)))) + Float64(1.0 + Float64(t_1 - 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 + x));
t_2 = sqrt((1.0 + y));
t_3 = sqrt((1.0 + z));
tmp = 0.0;
if ((t_2 - sqrt(y)) <= 0.9999999999999998)
tmp = ((1.0 / (t_1 + sqrt(x))) + (1.0 / (t_2 + sqrt(y)))) + (t_3 - sqrt(z));
else
tmp = ((sqrt((1.0 + t)) - sqrt(t)) + (1.0 / (t_3 + sqrt(z)))) + (1.0 + (t_1 - 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 + x), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(t$95$2 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision], 0.9999999999999998], N[(N[(N[(1.0 / N[(t$95$1 + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(t$95$2 + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$3 - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(t$95$3 + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 + N[(t$95$1 - 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 + x}\\
t_2 := \sqrt{1 + y}\\
t_3 := \sqrt{1 + z}\\
\mathbf{if}\;t_2 - \sqrt{y} \leq 0.9999999999999998:\\
\;\;\;\;\left(\frac{1}{t_1 + \sqrt{x}} + \frac{1}{t_2 + \sqrt{y}}\right) + \left(t_3 - \sqrt{z}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\sqrt{1 + t} - \sqrt{t}\right) + \frac{1}{t_3 + \sqrt{z}}\right) + \left(1 + \left(t_1 - \sqrt{x}\right)\right)\\
\end{array}
\end{array}
if (-.f64 (sqrt.f64 (+.f64 y 1)) (sqrt.f64 y)) < 0.99999999999999978Initial program 89.4%
associate-+l+89.4%
associate-+l-81.7%
associate-+l-89.4%
sub-neg89.4%
sub-neg89.4%
+-commutative89.4%
+-commutative89.4%
+-commutative89.4%
Simplified89.4%
flip--89.9%
add-sqr-sqrt67.4%
+-commutative67.4%
add-sqr-sqrt90.1%
+-commutative90.1%
Applied egg-rr90.1%
associate--l+91.7%
+-inverses91.7%
metadata-eval91.7%
Simplified91.7%
flip--92.4%
add-sqr-sqrt62.1%
add-sqr-sqrt93.6%
Applied egg-rr93.6%
associate--l+96.0%
+-inverses96.0%
metadata-eval96.0%
Simplified96.0%
Taylor expanded in t around inf 49.7%
if 0.99999999999999978 < (-.f64 (sqrt.f64 (+.f64 y 1)) (sqrt.f64 y)) Initial program 98.2%
associate-+l+98.2%
associate-+l-65.8%
associate-+l-98.2%
sub-neg98.2%
sub-neg98.2%
+-commutative98.2%
+-commutative98.2%
+-commutative98.2%
Simplified98.2%
flip--98.5%
add-sqr-sqrt77.5%
add-sqr-sqrt98.9%
Applied egg-rr98.9%
associate--l+99.5%
+-inverses99.5%
metadata-eval99.5%
Simplified99.5%
flip--98.4%
add-sqr-sqrt98.4%
add-sqr-sqrt98.4%
Applied egg-rr99.5%
associate--l+98.4%
+-inverses98.4%
metadata-eval98.4%
Simplified99.5%
Taylor expanded in y around 0 99.5%
Final simplification72.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 x))) (t_2 (sqrt (+ 1.0 y))) (t_3 (sqrt (+ 1.0 z))))
(if (<= z 3.1e+32)
(+
(+ (- t_2 (sqrt y)) (- t_1 (sqrt x)))
(+ (- (sqrt (+ 1.0 t)) (sqrt t)) (/ 1.0 (+ t_3 (sqrt z)))))
(+
(+ (/ 1.0 (+ t_1 (sqrt x))) (/ 1.0 (+ t_2 (sqrt y))))
(- t_3 (sqrt z))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + x));
double t_2 = sqrt((1.0 + y));
double t_3 = sqrt((1.0 + z));
double tmp;
if (z <= 3.1e+32) {
tmp = ((t_2 - sqrt(y)) + (t_1 - sqrt(x))) + ((sqrt((1.0 + t)) - sqrt(t)) + (1.0 / (t_3 + sqrt(z))));
} else {
tmp = ((1.0 / (t_1 + sqrt(x))) + (1.0 / (t_2 + sqrt(y)))) + (t_3 - sqrt(z));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = sqrt((1.0d0 + x))
t_2 = sqrt((1.0d0 + y))
t_3 = sqrt((1.0d0 + z))
if (z <= 3.1d+32) then
tmp = ((t_2 - sqrt(y)) + (t_1 - sqrt(x))) + ((sqrt((1.0d0 + t)) - sqrt(t)) + (1.0d0 / (t_3 + sqrt(z))))
else
tmp = ((1.0d0 / (t_1 + sqrt(x))) + (1.0d0 / (t_2 + sqrt(y)))) + (t_3 - sqrt(z))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + x));
double t_2 = Math.sqrt((1.0 + y));
double t_3 = Math.sqrt((1.0 + z));
double tmp;
if (z <= 3.1e+32) {
tmp = ((t_2 - Math.sqrt(y)) + (t_1 - Math.sqrt(x))) + ((Math.sqrt((1.0 + t)) - Math.sqrt(t)) + (1.0 / (t_3 + Math.sqrt(z))));
} else {
tmp = ((1.0 / (t_1 + Math.sqrt(x))) + (1.0 / (t_2 + Math.sqrt(y)))) + (t_3 - Math.sqrt(z));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + x)) t_2 = math.sqrt((1.0 + y)) t_3 = math.sqrt((1.0 + z)) tmp = 0 if z <= 3.1e+32: tmp = ((t_2 - math.sqrt(y)) + (t_1 - math.sqrt(x))) + ((math.sqrt((1.0 + t)) - math.sqrt(t)) + (1.0 / (t_3 + math.sqrt(z)))) else: tmp = ((1.0 / (t_1 + math.sqrt(x))) + (1.0 / (t_2 + math.sqrt(y)))) + (t_3 - math.sqrt(z)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(1.0 + x)) t_2 = sqrt(Float64(1.0 + y)) t_3 = sqrt(Float64(1.0 + z)) tmp = 0.0 if (z <= 3.1e+32) tmp = Float64(Float64(Float64(t_2 - sqrt(y)) + Float64(t_1 - sqrt(x))) + Float64(Float64(sqrt(Float64(1.0 + t)) - sqrt(t)) + Float64(1.0 / Float64(t_3 + sqrt(z))))); else tmp = Float64(Float64(Float64(1.0 / Float64(t_1 + sqrt(x))) + Float64(1.0 / Float64(t_2 + sqrt(y)))) + Float64(t_3 - sqrt(z))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + x));
t_2 = sqrt((1.0 + y));
t_3 = sqrt((1.0 + z));
tmp = 0.0;
if (z <= 3.1e+32)
tmp = ((t_2 - sqrt(y)) + (t_1 - sqrt(x))) + ((sqrt((1.0 + t)) - sqrt(t)) + (1.0 / (t_3 + sqrt(z))));
else
tmp = ((1.0 / (t_1 + sqrt(x))) + (1.0 / (t_2 + sqrt(y)))) + (t_3 - sqrt(z));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[z, 3.1e+32], N[(N[(N[(t$95$2 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision] + N[(t$95$1 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(t$95$3 + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 / N[(t$95$1 + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(t$95$2 + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$3 - 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 + x}\\
t_2 := \sqrt{1 + y}\\
t_3 := \sqrt{1 + z}\\
\mathbf{if}\;z \leq 3.1 \cdot 10^{+32}:\\
\;\;\;\;\left(\left(t_2 - \sqrt{y}\right) + \left(t_1 - \sqrt{x}\right)\right) + \left(\left(\sqrt{1 + t} - \sqrt{t}\right) + \frac{1}{t_3 + \sqrt{z}}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{1}{t_1 + \sqrt{x}} + \frac{1}{t_2 + \sqrt{y}}\right) + \left(t_3 - \sqrt{z}\right)\\
\end{array}
\end{array}
if z < 3.09999999999999993e32Initial program 96.4%
associate-+l+96.4%
associate-+l-80.9%
associate-+l-96.4%
sub-neg96.4%
sub-neg96.4%
+-commutative96.4%
+-commutative96.4%
+-commutative96.4%
Simplified96.4%
flip--96.6%
add-sqr-sqrt96.0%
add-sqr-sqrt97.0%
Applied egg-rr97.0%
associate--l+97.8%
+-inverses97.8%
metadata-eval97.8%
Simplified97.8%
if 3.09999999999999993e32 < z Initial program 89.2%
associate-+l+89.2%
associate-+l-64.8%
associate-+l-89.2%
sub-neg89.2%
sub-neg89.2%
+-commutative89.2%
+-commutative89.2%
+-commutative89.2%
Simplified89.2%
flip--89.9%
add-sqr-sqrt67.0%
+-commutative67.0%
add-sqr-sqrt90.1%
+-commutative90.1%
Applied egg-rr90.1%
associate--l+92.1%
+-inverses92.1%
metadata-eval92.1%
Simplified92.1%
flip--92.4%
add-sqr-sqrt79.2%
add-sqr-sqrt93.2%
Applied egg-rr93.2%
associate--l+95.9%
+-inverses95.9%
metadata-eval95.9%
Simplified95.9%
Taylor expanded in t around inf 57.0%
Final simplification81.2%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (+ (+ (/ 1.0 (+ (sqrt (+ 1.0 x)) (sqrt x))) (/ 1.0 (+ (sqrt (+ 1.0 y)) (sqrt y)))) (+ (- (sqrt (+ 1.0 z)) (sqrt z)) (- (sqrt (+ 1.0 t)) (sqrt t)))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
return ((1.0 / (sqrt((1.0 + x)) + sqrt(x))) + (1.0 / (sqrt((1.0 + y)) + sqrt(y)))) + ((sqrt((1.0 + z)) - sqrt(z)) + (sqrt((1.0 + t)) - sqrt(t)));
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = ((1.0d0 / (sqrt((1.0d0 + x)) + sqrt(x))) + (1.0d0 / (sqrt((1.0d0 + y)) + sqrt(y)))) + ((sqrt((1.0d0 + z)) - sqrt(z)) + (sqrt((1.0d0 + t)) - sqrt(t)))
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
return ((1.0 / (Math.sqrt((1.0 + x)) + Math.sqrt(x))) + (1.0 / (Math.sqrt((1.0 + y)) + Math.sqrt(y)))) + ((Math.sqrt((1.0 + z)) - Math.sqrt(z)) + (Math.sqrt((1.0 + t)) - Math.sqrt(t)));
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): return ((1.0 / (math.sqrt((1.0 + x)) + math.sqrt(x))) + (1.0 / (math.sqrt((1.0 + y)) + math.sqrt(y)))) + ((math.sqrt((1.0 + z)) - math.sqrt(z)) + (math.sqrt((1.0 + t)) - math.sqrt(t)))
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) return Float64(Float64(Float64(1.0 / Float64(sqrt(Float64(1.0 + x)) + sqrt(x))) + Float64(1.0 / Float64(sqrt(Float64(1.0 + y)) + sqrt(y)))) + Float64(Float64(sqrt(Float64(1.0 + z)) - sqrt(z)) + Float64(sqrt(Float64(1.0 + t)) - sqrt(t)))) end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp = code(x, y, z, t)
tmp = ((1.0 / (sqrt((1.0 + x)) + sqrt(x))) + (1.0 / (sqrt((1.0 + y)) + sqrt(y)))) + ((sqrt((1.0 + z)) - sqrt(z)) + (sqrt((1.0 + t)) - sqrt(t)));
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := N[(N[(N[(1.0 / N[(N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\left(\frac{1}{\sqrt{1 + x} + \sqrt{x}} + \frac{1}{\sqrt{1 + y} + \sqrt{y}}\right) + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\sqrt{1 + t} - \sqrt{t}\right)\right)
\end{array}
Initial program 93.5%
associate-+l+93.5%
associate-+l-74.4%
associate-+l-93.5%
sub-neg93.5%
sub-neg93.5%
+-commutative93.5%
+-commutative93.5%
+-commutative93.5%
Simplified93.5%
flip--93.7%
add-sqr-sqrt71.3%
+-commutative71.3%
add-sqr-sqrt93.9%
+-commutative93.9%
Applied egg-rr93.9%
associate--l+94.8%
+-inverses94.8%
metadata-eval94.8%
Simplified94.8%
flip--95.1%
add-sqr-sqrt78.8%
add-sqr-sqrt95.8%
Applied egg-rr95.8%
associate--l+97.1%
+-inverses97.1%
metadata-eval97.1%
Simplified97.1%
Final simplification97.1%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ 1.0 z))) (t_2 (sqrt (+ 1.0 x))))
(if (<= y 5.8e-32)
(+
(+ (- (sqrt (+ 1.0 t)) (sqrt t)) (/ 1.0 (+ t_1 (sqrt z))))
(+ 1.0 (- t_2 (sqrt x))))
(+
(- t_1 (sqrt z))
(+ (/ 1.0 (+ t_2 (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 t_2 = sqrt((1.0 + x));
double tmp;
if (y <= 5.8e-32) {
tmp = ((sqrt((1.0 + t)) - sqrt(t)) + (1.0 / (t_1 + sqrt(z)))) + (1.0 + (t_2 - sqrt(x)));
} else {
tmp = (t_1 - sqrt(z)) + ((1.0 / (t_2 + 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) :: t_2
real(8) :: tmp
t_1 = sqrt((1.0d0 + z))
t_2 = sqrt((1.0d0 + x))
if (y <= 5.8d-32) then
tmp = ((sqrt((1.0d0 + t)) - sqrt(t)) + (1.0d0 / (t_1 + sqrt(z)))) + (1.0d0 + (t_2 - sqrt(x)))
else
tmp = (t_1 - sqrt(z)) + ((1.0d0 / (t_2 + 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 t_2 = Math.sqrt((1.0 + x));
double tmp;
if (y <= 5.8e-32) {
tmp = ((Math.sqrt((1.0 + t)) - Math.sqrt(t)) + (1.0 / (t_1 + Math.sqrt(z)))) + (1.0 + (t_2 - Math.sqrt(x)));
} else {
tmp = (t_1 - Math.sqrt(z)) + ((1.0 / (t_2 + 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)) t_2 = math.sqrt((1.0 + x)) tmp = 0 if y <= 5.8e-32: tmp = ((math.sqrt((1.0 + t)) - math.sqrt(t)) + (1.0 / (t_1 + math.sqrt(z)))) + (1.0 + (t_2 - math.sqrt(x))) else: tmp = (t_1 - math.sqrt(z)) + ((1.0 / (t_2 + 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)) t_2 = sqrt(Float64(1.0 + x)) tmp = 0.0 if (y <= 5.8e-32) tmp = Float64(Float64(Float64(sqrt(Float64(1.0 + t)) - sqrt(t)) + Float64(1.0 / Float64(t_1 + sqrt(z)))) + Float64(1.0 + Float64(t_2 - sqrt(x)))); else tmp = Float64(Float64(t_1 - sqrt(z)) + Float64(Float64(1.0 / Float64(t_2 + 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));
t_2 = sqrt((1.0 + x));
tmp = 0.0;
if (y <= 5.8e-32)
tmp = ((sqrt((1.0 + t)) - sqrt(t)) + (1.0 / (t_1 + sqrt(z)))) + (1.0 + (t_2 - sqrt(x)));
else
tmp = (t_1 - sqrt(z)) + ((1.0 / (t_2 + 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]}, Block[{t$95$2 = N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y, 5.8e-32], N[(N[(N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(t$95$1 + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 + N[(t$95$2 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(t$95$1 - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 / N[(t$95$2 + N[Sqrt[x], $MachinePrecision]), $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}\\
t_2 := \sqrt{1 + x}\\
\mathbf{if}\;y \leq 5.8 \cdot 10^{-32}:\\
\;\;\;\;\left(\left(\sqrt{1 + t} - \sqrt{t}\right) + \frac{1}{t_1 + \sqrt{z}}\right) + \left(1 + \left(t_2 - \sqrt{x}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(t_1 - \sqrt{z}\right) + \left(\frac{1}{t_2 + \sqrt{x}} + \left(\sqrt{1 + y} - \sqrt{y}\right)\right)\\
\end{array}
\end{array}
if y < 5.79999999999999991e-32Initial program 98.2%
associate-+l+98.2%
associate-+l-65.8%
associate-+l-98.2%
sub-neg98.2%
sub-neg98.2%
+-commutative98.2%
+-commutative98.2%
+-commutative98.2%
Simplified98.2%
flip--98.5%
add-sqr-sqrt77.5%
add-sqr-sqrt98.9%
Applied egg-rr98.9%
associate--l+99.5%
+-inverses99.5%
metadata-eval99.5%
Simplified99.5%
flip--98.4%
add-sqr-sqrt98.4%
add-sqr-sqrt98.4%
Applied egg-rr99.5%
associate--l+98.4%
+-inverses98.4%
metadata-eval98.4%
Simplified99.5%
Taylor expanded in y around 0 99.5%
if 5.79999999999999991e-32 < y Initial program 89.4%
associate-+l+89.4%
associate-+l-81.7%
associate-+l-89.4%
sub-neg89.4%
sub-neg89.4%
+-commutative89.4%
+-commutative89.4%
+-commutative89.4%
Simplified89.4%
flip--89.9%
add-sqr-sqrt67.4%
+-commutative67.4%
add-sqr-sqrt90.1%
+-commutative90.1%
Applied egg-rr90.1%
associate--l+91.7%
+-inverses91.7%
metadata-eval91.7%
Simplified91.7%
Taylor expanded in t around inf 46.0%
Final simplification70.6%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ 1.0 y))))
(if (<= t 1.3e+15)
(+
t_1
(+ 1.0 (- (- (+ 1.0 (sqrt (+ 1.0 t))) (sqrt t)) (+ (sqrt z) (sqrt y)))))
(+
(- (sqrt (+ 1.0 z)) (sqrt z))
(+ (/ 1.0 (+ (sqrt (+ 1.0 x)) (sqrt x))) (- t_1 (sqrt y)))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + y));
double tmp;
if (t <= 1.3e+15) {
tmp = t_1 + (1.0 + (((1.0 + sqrt((1.0 + t))) - sqrt(t)) - (sqrt(z) + sqrt(y))));
} else {
tmp = (sqrt((1.0 + z)) - sqrt(z)) + ((1.0 / (sqrt((1.0 + x)) + sqrt(x))) + (t_1 - sqrt(y)));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = sqrt((1.0d0 + y))
if (t <= 1.3d+15) then
tmp = t_1 + (1.0d0 + (((1.0d0 + sqrt((1.0d0 + t))) - sqrt(t)) - (sqrt(z) + sqrt(y))))
else
tmp = (sqrt((1.0d0 + z)) - sqrt(z)) + ((1.0d0 / (sqrt((1.0d0 + x)) + sqrt(x))) + (t_1 - sqrt(y)))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + y));
double tmp;
if (t <= 1.3e+15) {
tmp = t_1 + (1.0 + (((1.0 + Math.sqrt((1.0 + t))) - Math.sqrt(t)) - (Math.sqrt(z) + Math.sqrt(y))));
} else {
tmp = (Math.sqrt((1.0 + z)) - Math.sqrt(z)) + ((1.0 / (Math.sqrt((1.0 + x)) + Math.sqrt(x))) + (t_1 - Math.sqrt(y)));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + y)) tmp = 0 if t <= 1.3e+15: tmp = t_1 + (1.0 + (((1.0 + math.sqrt((1.0 + t))) - math.sqrt(t)) - (math.sqrt(z) + math.sqrt(y)))) else: tmp = (math.sqrt((1.0 + z)) - math.sqrt(z)) + ((1.0 / (math.sqrt((1.0 + x)) + math.sqrt(x))) + (t_1 - math.sqrt(y))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(1.0 + y)) tmp = 0.0 if (t <= 1.3e+15) tmp = Float64(t_1 + Float64(1.0 + Float64(Float64(Float64(1.0 + sqrt(Float64(1.0 + t))) - sqrt(t)) - Float64(sqrt(z) + sqrt(y))))); else tmp = Float64(Float64(sqrt(Float64(1.0 + z)) - sqrt(z)) + Float64(Float64(1.0 / Float64(sqrt(Float64(1.0 + x)) + sqrt(x))) + Float64(t_1 - sqrt(y)))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + y));
tmp = 0.0;
if (t <= 1.3e+15)
tmp = t_1 + (1.0 + (((1.0 + sqrt((1.0 + t))) - sqrt(t)) - (sqrt(z) + sqrt(y))));
else
tmp = (sqrt((1.0 + z)) - sqrt(z)) + ((1.0 / (sqrt((1.0 + x)) + sqrt(x))) + (t_1 - sqrt(y)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t, 1.3e+15], N[(t$95$1 + N[(1.0 + N[(N[(N[(1.0 + N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[z], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 / N[(N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$1 - 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 + y}\\
\mathbf{if}\;t \leq 1.3 \cdot 10^{+15}:\\
\;\;\;\;t_1 + \left(1 + \left(\left(\left(1 + \sqrt{1 + t}\right) - \sqrt{t}\right) - \left(\sqrt{z} + \sqrt{y}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\frac{1}{\sqrt{1 + x} + \sqrt{x}} + \left(t_1 - \sqrt{y}\right)\right)\\
\end{array}
\end{array}
if t < 1.3e15Initial program 97.7%
associate-+l+97.7%
+-commutative97.7%
associate-+l+97.7%
+-commutative97.7%
associate-+l+97.7%
+-commutative97.7%
associate-+r-50.3%
Simplified49.3%
add-cube-cbrt48.8%
pow348.6%
Applied egg-rr48.6%
Taylor expanded in x around 0 22.3%
pow-base-122.3%
associate--l+28.8%
associate--r+28.8%
+-commutative28.8%
Simplified28.8%
Taylor expanded in z around 0 16.6%
if 1.3e15 < t Initial program 89.2%
associate-+l+89.2%
associate-+l-69.1%
associate-+l-89.2%
sub-neg89.2%
sub-neg89.2%
+-commutative89.2%
+-commutative89.2%
+-commutative89.2%
Simplified89.2%
flip--89.7%
add-sqr-sqrt70.6%
+-commutative70.6%
add-sqr-sqrt89.9%
+-commutative89.9%
Applied egg-rr89.9%
associate--l+91.7%
+-inverses91.7%
metadata-eval91.7%
Simplified91.7%
Taylor expanded in t around inf 91.6%
Final simplification54.1%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ 1.0 x))))
(if (<= y 1.75e+19)
(+
(sqrt (+ 1.0 y))
(- (+ t_1 (- (- (sqrt (+ 1.0 z)) (sqrt z)) (sqrt x))) (sqrt y)))
(/ 1.0 (+ t_1 (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 + x));
double tmp;
if (y <= 1.75e+19) {
tmp = sqrt((1.0 + y)) + ((t_1 + ((sqrt((1.0 + z)) - sqrt(z)) - sqrt(x))) - sqrt(y));
} else {
tmp = 1.0 / (t_1 + 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 + x))
if (y <= 1.75d+19) then
tmp = sqrt((1.0d0 + y)) + ((t_1 + ((sqrt((1.0d0 + z)) - sqrt(z)) - sqrt(x))) - sqrt(y))
else
tmp = 1.0d0 / (t_1 + 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 + x));
double tmp;
if (y <= 1.75e+19) {
tmp = Math.sqrt((1.0 + y)) + ((t_1 + ((Math.sqrt((1.0 + z)) - Math.sqrt(z)) - Math.sqrt(x))) - Math.sqrt(y));
} else {
tmp = 1.0 / (t_1 + 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 + x)) tmp = 0 if y <= 1.75e+19: tmp = math.sqrt((1.0 + y)) + ((t_1 + ((math.sqrt((1.0 + z)) - math.sqrt(z)) - math.sqrt(x))) - math.sqrt(y)) else: tmp = 1.0 / (t_1 + 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 + x)) tmp = 0.0 if (y <= 1.75e+19) tmp = Float64(sqrt(Float64(1.0 + y)) + Float64(Float64(t_1 + Float64(Float64(sqrt(Float64(1.0 + z)) - sqrt(z)) - sqrt(x))) - sqrt(y))); else tmp = Float64(1.0 / Float64(t_1 + 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 + x));
tmp = 0.0;
if (y <= 1.75e+19)
tmp = sqrt((1.0 + y)) + ((t_1 + ((sqrt((1.0 + z)) - sqrt(z)) - sqrt(x))) - sqrt(y));
else
tmp = 1.0 / (t_1 + 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 + x), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y, 1.75e+19], N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] + N[(N[(t$95$1 + N[(N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(t$95$1 + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + x}\\
\mathbf{if}\;y \leq 1.75 \cdot 10^{+19}:\\
\;\;\;\;\sqrt{1 + y} + \left(\left(t_1 + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) - \sqrt{x}\right)\right) - \sqrt{y}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{t_1 + \sqrt{x}}\\
\end{array}
\end{array}
if y < 1.75e19Initial program 96.2%
associate-+l+96.2%
+-commutative96.2%
associate-+l+96.2%
+-commutative96.2%
associate-+l+96.2%
+-commutative96.2%
associate-+r-96.2%
Simplified57.1%
Taylor expanded in t around inf 44.4%
associate--l+49.6%
+-commutative49.6%
associate--r+54.5%
Simplified54.5%
if 1.75e19 < y Initial program 89.9%
associate-+l+89.9%
+-commutative89.9%
associate-+l+89.9%
+-commutative89.9%
associate-+l+89.9%
+-commutative89.9%
associate-+r-5.3%
Simplified4.1%
Taylor expanded in t around inf 3.3%
associate--l+20.6%
+-commutative20.6%
associate--l+26.5%
+-commutative26.5%
Simplified26.5%
Taylor expanded in y around inf 30.0%
associate--r+30.0%
Simplified30.0%
Taylor expanded in z around inf 20.8%
flip--21.4%
add-sqr-sqrt22.0%
add-sqr-sqrt21.6%
Applied egg-rr21.6%
associate--l+24.9%
+-inverses24.9%
metadata-eval24.9%
Simplified24.9%
Final simplification41.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 y))))
(if (<= y 6.8e-23)
(+ 1.0 (+ t_1 (- (sqrt (+ 1.0 z)) (+ (sqrt y) (sqrt z)))))
(if (<= y 5e+15)
(+ t_1 (- 1.0 (sqrt y)))
(/ 1.0 (+ (sqrt (+ 1.0 x)) (sqrt x)))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + y));
double tmp;
if (y <= 6.8e-23) {
tmp = 1.0 + (t_1 + (sqrt((1.0 + z)) - (sqrt(y) + sqrt(z))));
} else if (y <= 5e+15) {
tmp = t_1 + (1.0 - sqrt(y));
} else {
tmp = 1.0 / (sqrt((1.0 + x)) + sqrt(x));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = sqrt((1.0d0 + y))
if (y <= 6.8d-23) then
tmp = 1.0d0 + (t_1 + (sqrt((1.0d0 + z)) - (sqrt(y) + sqrt(z))))
else if (y <= 5d+15) then
tmp = t_1 + (1.0d0 - sqrt(y))
else
tmp = 1.0d0 / (sqrt((1.0d0 + x)) + sqrt(x))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + y));
double tmp;
if (y <= 6.8e-23) {
tmp = 1.0 + (t_1 + (Math.sqrt((1.0 + z)) - (Math.sqrt(y) + Math.sqrt(z))));
} else if (y <= 5e+15) {
tmp = t_1 + (1.0 - Math.sqrt(y));
} else {
tmp = 1.0 / (Math.sqrt((1.0 + x)) + Math.sqrt(x));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + y)) tmp = 0 if y <= 6.8e-23: tmp = 1.0 + (t_1 + (math.sqrt((1.0 + z)) - (math.sqrt(y) + math.sqrt(z)))) elif y <= 5e+15: tmp = t_1 + (1.0 - math.sqrt(y)) else: tmp = 1.0 / (math.sqrt((1.0 + x)) + math.sqrt(x)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(1.0 + y)) tmp = 0.0 if (y <= 6.8e-23) tmp = Float64(1.0 + Float64(t_1 + Float64(sqrt(Float64(1.0 + z)) - Float64(sqrt(y) + sqrt(z))))); elseif (y <= 5e+15) tmp = Float64(t_1 + Float64(1.0 - sqrt(y))); else tmp = Float64(1.0 / Float64(sqrt(Float64(1.0 + x)) + sqrt(x))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + y));
tmp = 0.0;
if (y <= 6.8e-23)
tmp = 1.0 + (t_1 + (sqrt((1.0 + z)) - (sqrt(y) + sqrt(z))));
elseif (y <= 5e+15)
tmp = t_1 + (1.0 - sqrt(y));
else
tmp = 1.0 / (sqrt((1.0 + x)) + sqrt(x));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y, 6.8e-23], N[(1.0 + N[(t$95$1 + N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 5e+15], N[(t$95$1 + N[(1.0 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + y}\\
\mathbf{if}\;y \leq 6.8 \cdot 10^{-23}:\\
\;\;\;\;1 + \left(t_1 + \left(\sqrt{1 + z} - \left(\sqrt{y} + \sqrt{z}\right)\right)\right)\\
\mathbf{elif}\;y \leq 5 \cdot 10^{+15}:\\
\;\;\;\;t_1 + \left(1 - \sqrt{y}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{1 + x} + \sqrt{x}}\\
\end{array}
\end{array}
if y < 6.8000000000000001e-23Initial program 98.0%
associate-+l+98.0%
+-commutative98.0%
associate-+l+98.0%
+-commutative98.0%
associate-+l+98.0%
+-commutative98.0%
associate-+r-98.0%
Simplified56.9%
Taylor expanded in t around inf 27.0%
associate--l+30.6%
+-commutative30.6%
associate--l+30.6%
+-commutative30.6%
Simplified30.6%
Taylor expanded in x around 0 36.4%
associate--l+52.0%
associate--l+58.6%
+-commutative58.6%
Simplified58.6%
if 6.8000000000000001e-23 < y < 5e15Initial program 87.8%
associate-+l+87.8%
+-commutative87.8%
associate-+l+87.8%
+-commutative87.8%
associate-+l+87.8%
+-commutative87.8%
associate-+r-87.4%
Simplified60.2%
Taylor expanded in t around inf 20.2%
associate--l+23.0%
+-commutative23.0%
associate--l+23.0%
+-commutative23.0%
Simplified23.0%
Taylor expanded in x around 0 32.4%
Taylor expanded in z around inf 42.2%
+-commutative42.2%
associate--l+42.3%
Simplified42.3%
if 5e15 < y Initial program 89.7%
associate-+l+89.7%
+-commutative89.7%
associate-+l+89.7%
+-commutative89.7%
associate-+l+89.7%
+-commutative89.7%
associate-+r-5.9%
Simplified4.1%
Taylor expanded in t around inf 3.3%
associate--l+20.4%
+-commutative20.4%
associate--l+26.3%
+-commutative26.3%
Simplified26.3%
Taylor expanded in y around inf 29.7%
associate--r+29.7%
Simplified29.7%
Taylor expanded in z around inf 20.7%
flip--21.3%
add-sqr-sqrt21.8%
add-sqr-sqrt21.4%
Applied egg-rr21.4%
associate--l+24.7%
+-inverses24.7%
metadata-eval24.7%
Simplified24.7%
Final simplification42.4%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(if (<= z 34000000000000.0)
(+
(+ 1.0 (+ 1.0 (+ (sqrt (+ 1.0 z)) (* y 0.5))))
(/ (- y z) (- (sqrt z) (sqrt y))))
(+ (sqrt (+ 1.0 x)) (- (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) {
double tmp;
if (z <= 34000000000000.0) {
tmp = (1.0 + (1.0 + (sqrt((1.0 + z)) + (y * 0.5)))) + ((y - z) / (sqrt(z) - sqrt(y)));
} else {
tmp = sqrt((1.0 + x)) + (sqrt((1.0 + y)) - (sqrt(x) + sqrt(y)));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (z <= 34000000000000.0d0) then
tmp = (1.0d0 + (1.0d0 + (sqrt((1.0d0 + z)) + (y * 0.5d0)))) + ((y - z) / (sqrt(z) - sqrt(y)))
else
tmp = sqrt((1.0d0 + x)) + (sqrt((1.0d0 + y)) - (sqrt(x) + sqrt(y)))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= 34000000000000.0) {
tmp = (1.0 + (1.0 + (Math.sqrt((1.0 + z)) + (y * 0.5)))) + ((y - z) / (Math.sqrt(z) - Math.sqrt(y)));
} else {
tmp = Math.sqrt((1.0 + x)) + (Math.sqrt((1.0 + y)) - (Math.sqrt(x) + Math.sqrt(y)));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if z <= 34000000000000.0: tmp = (1.0 + (1.0 + (math.sqrt((1.0 + z)) + (y * 0.5)))) + ((y - z) / (math.sqrt(z) - math.sqrt(y))) else: tmp = math.sqrt((1.0 + x)) + (math.sqrt((1.0 + y)) - (math.sqrt(x) + math.sqrt(y))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (z <= 34000000000000.0) tmp = Float64(Float64(1.0 + Float64(1.0 + Float64(sqrt(Float64(1.0 + z)) + Float64(y * 0.5)))) + Float64(Float64(y - z) / Float64(sqrt(z) - sqrt(y)))); else tmp = Float64(sqrt(Float64(1.0 + x)) + Float64(sqrt(Float64(1.0 + y)) - Float64(sqrt(x) + sqrt(y)))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (z <= 34000000000000.0)
tmp = (1.0 + (1.0 + (sqrt((1.0 + z)) + (y * 0.5)))) + ((y - z) / (sqrt(z) - sqrt(y)));
else
tmp = sqrt((1.0 + x)) + (sqrt((1.0 + y)) - (sqrt(x) + sqrt(y)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[z, 34000000000000.0], N[(N[(1.0 + N[(1.0 + N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] + N[(y * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(y - z), $MachinePrecision] / N[(N[Sqrt[z], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision] + N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] - N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq 34000000000000:\\
\;\;\;\;\left(1 + \left(1 + \left(\sqrt{1 + z} + y \cdot 0.5\right)\right)\right) + \frac{y - z}{\sqrt{z} - \sqrt{y}}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{1 + x} + \left(\sqrt{1 + y} - \left(\sqrt{x} + \sqrt{y}\right)\right)\\
\end{array}
\end{array}
if z < 3.4e13Initial program 97.2%
associate-+l+97.2%
+-commutative97.2%
associate-+l+97.2%
+-commutative97.2%
associate-+l+97.2%
+-commutative97.2%
associate-+r-54.6%
Simplified29.2%
Taylor expanded in t around inf 25.4%
associate--l+29.5%
+-commutative29.5%
associate--l+35.7%
+-commutative35.7%
Simplified35.7%
Taylor expanded in x around 0 35.2%
Taylor expanded in y around 0 32.4%
*-commutative32.4%
Simplified32.4%
+-commutative32.4%
flip-+32.4%
add-sqr-sqrt32.4%
add-sqr-sqrt32.4%
Applied egg-rr32.4%
if 3.4e13 < z Initial program 88.5%
associate-+l+88.5%
+-commutative88.5%
associate-+l+88.5%
+-commutative88.5%
associate-+l+88.5%
+-commutative88.5%
associate-+r-59.7%
Simplified40.6%
Taylor expanded in t around inf 3.6%
associate--l+20.2%
+-commutative20.2%
associate--l+18.0%
+-commutative18.0%
Simplified18.0%
Taylor expanded in z around inf 22.7%
associate--l+33.3%
+-commutative33.3%
Simplified33.3%
Final simplification32.8%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(if (<= z 1.25e+15)
(+
(+ 1.0 (+ 1.0 (+ (sqrt (+ 1.0 z)) (* y 0.5))))
(/ (- y z) (- (sqrt z) (sqrt y))))
(if (or (<= z 4.5e+127) (and (not (<= z 3.8e+141)) (<= z 4.25e+173)))
(+ (sqrt (+ 1.0 y)) (- 1.0 (sqrt y)))
(/ 1.0 (+ (sqrt (+ 1.0 x)) (sqrt x))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (z <= 1.25e+15) {
tmp = (1.0 + (1.0 + (sqrt((1.0 + z)) + (y * 0.5)))) + ((y - z) / (sqrt(z) - sqrt(y)));
} else if ((z <= 4.5e+127) || (!(z <= 3.8e+141) && (z <= 4.25e+173))) {
tmp = sqrt((1.0 + y)) + (1.0 - sqrt(y));
} else {
tmp = 1.0 / (sqrt((1.0 + x)) + sqrt(x));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (z <= 1.25d+15) then
tmp = (1.0d0 + (1.0d0 + (sqrt((1.0d0 + z)) + (y * 0.5d0)))) + ((y - z) / (sqrt(z) - sqrt(y)))
else if ((z <= 4.5d+127) .or. (.not. (z <= 3.8d+141)) .and. (z <= 4.25d+173)) then
tmp = sqrt((1.0d0 + y)) + (1.0d0 - sqrt(y))
else
tmp = 1.0d0 / (sqrt((1.0d0 + x)) + sqrt(x))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= 1.25e+15) {
tmp = (1.0 + (1.0 + (Math.sqrt((1.0 + z)) + (y * 0.5)))) + ((y - z) / (Math.sqrt(z) - Math.sqrt(y)));
} else if ((z <= 4.5e+127) || (!(z <= 3.8e+141) && (z <= 4.25e+173))) {
tmp = Math.sqrt((1.0 + y)) + (1.0 - Math.sqrt(y));
} else {
tmp = 1.0 / (Math.sqrt((1.0 + x)) + Math.sqrt(x));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if z <= 1.25e+15: tmp = (1.0 + (1.0 + (math.sqrt((1.0 + z)) + (y * 0.5)))) + ((y - z) / (math.sqrt(z) - math.sqrt(y))) elif (z <= 4.5e+127) or (not (z <= 3.8e+141) and (z <= 4.25e+173)): tmp = math.sqrt((1.0 + y)) + (1.0 - math.sqrt(y)) else: tmp = 1.0 / (math.sqrt((1.0 + x)) + math.sqrt(x)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (z <= 1.25e+15) tmp = Float64(Float64(1.0 + Float64(1.0 + Float64(sqrt(Float64(1.0 + z)) + Float64(y * 0.5)))) + Float64(Float64(y - z) / Float64(sqrt(z) - sqrt(y)))); elseif ((z <= 4.5e+127) || (!(z <= 3.8e+141) && (z <= 4.25e+173))) tmp = Float64(sqrt(Float64(1.0 + y)) + Float64(1.0 - sqrt(y))); else tmp = Float64(1.0 / Float64(sqrt(Float64(1.0 + x)) + sqrt(x))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (z <= 1.25e+15)
tmp = (1.0 + (1.0 + (sqrt((1.0 + z)) + (y * 0.5)))) + ((y - z) / (sqrt(z) - sqrt(y)));
elseif ((z <= 4.5e+127) || (~((z <= 3.8e+141)) && (z <= 4.25e+173)))
tmp = sqrt((1.0 + y)) + (1.0 - sqrt(y));
else
tmp = 1.0 / (sqrt((1.0 + x)) + sqrt(x));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[z, 1.25e+15], N[(N[(1.0 + N[(1.0 + N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] + N[(y * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(y - z), $MachinePrecision] / N[(N[Sqrt[z], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[z, 4.5e+127], And[N[Not[LessEqual[z, 3.8e+141]], $MachinePrecision], LessEqual[z, 4.25e+173]]], N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] + N[(1.0 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq 1.25 \cdot 10^{+15}:\\
\;\;\;\;\left(1 + \left(1 + \left(\sqrt{1 + z} + y \cdot 0.5\right)\right)\right) + \frac{y - z}{\sqrt{z} - \sqrt{y}}\\
\mathbf{elif}\;z \leq 4.5 \cdot 10^{+127} \lor \neg \left(z \leq 3.8 \cdot 10^{+141}\right) \land z \leq 4.25 \cdot 10^{+173}:\\
\;\;\;\;\sqrt{1 + y} + \left(1 - \sqrt{y}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{1 + x} + \sqrt{x}}\\
\end{array}
\end{array}
if z < 1.25e15Initial program 97.2%
associate-+l+97.2%
+-commutative97.2%
associate-+l+97.2%
+-commutative97.2%
associate-+l+97.2%
+-commutative97.2%
associate-+r-54.6%
Simplified29.2%
Taylor expanded in t around inf 25.4%
associate--l+29.5%
+-commutative29.5%
associate--l+35.7%
+-commutative35.7%
Simplified35.7%
Taylor expanded in x around 0 35.2%
Taylor expanded in y around 0 32.4%
*-commutative32.4%
Simplified32.4%
+-commutative32.4%
flip-+32.4%
add-sqr-sqrt32.4%
add-sqr-sqrt32.4%
Applied egg-rr32.4%
if 1.25e15 < z < 4.50000000000000034e127 or 3.79999999999999976e141 < z < 4.2500000000000001e173Initial program 84.4%
associate-+l+84.4%
+-commutative84.4%
associate-+l+84.4%
+-commutative84.4%
associate-+l+84.4%
+-commutative84.4%
associate-+r-65.0%
Simplified50.4%
Taylor expanded in t around inf 4.0%
associate--l+15.4%
+-commutative15.4%
associate--l+13.5%
+-commutative13.5%
Simplified13.5%
Taylor expanded in x around 0 4.1%
Taylor expanded in z around inf 35.0%
+-commutative35.0%
associate--l+35.1%
Simplified35.1%
if 4.50000000000000034e127 < z < 3.79999999999999976e141 or 4.2500000000000001e173 < z Initial program 92.6%
associate-+l+92.6%
+-commutative92.6%
associate-+l+92.6%
+-commutative92.6%
associate-+l+92.6%
+-commutative92.6%
associate-+r-54.4%
Simplified30.7%
Taylor expanded in t around inf 3.1%
associate--l+24.9%
+-commutative24.9%
associate--l+22.5%
+-commutative22.5%
Simplified22.5%
Taylor expanded in y around inf 24.9%
associate--r+24.9%
Simplified24.9%
Taylor expanded in z around inf 24.3%
flip--25.5%
add-sqr-sqrt25.5%
add-sqr-sqrt25.5%
Applied egg-rr25.5%
associate--l+28.5%
+-inverses28.5%
metadata-eval28.5%
Simplified28.5%
Final simplification32.1%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(if (<= z 1.5e+17)
(- (+ 1.0 (+ 1.0 (+ (sqrt (+ 1.0 z)) (* y 0.5)))) (+ (sqrt z) (sqrt y)))
(if (or (<= z 1.25e+128) (and (not (<= z 3.8e+141)) (<= z 4.25e+173)))
(+ (sqrt (+ 1.0 y)) (- 1.0 (sqrt y)))
(/ 1.0 (+ (sqrt (+ 1.0 x)) (sqrt x))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (z <= 1.5e+17) {
tmp = (1.0 + (1.0 + (sqrt((1.0 + z)) + (y * 0.5)))) - (sqrt(z) + sqrt(y));
} else if ((z <= 1.25e+128) || (!(z <= 3.8e+141) && (z <= 4.25e+173))) {
tmp = sqrt((1.0 + y)) + (1.0 - sqrt(y));
} else {
tmp = 1.0 / (sqrt((1.0 + x)) + sqrt(x));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (z <= 1.5d+17) then
tmp = (1.0d0 + (1.0d0 + (sqrt((1.0d0 + z)) + (y * 0.5d0)))) - (sqrt(z) + sqrt(y))
else if ((z <= 1.25d+128) .or. (.not. (z <= 3.8d+141)) .and. (z <= 4.25d+173)) then
tmp = sqrt((1.0d0 + y)) + (1.0d0 - sqrt(y))
else
tmp = 1.0d0 / (sqrt((1.0d0 + x)) + sqrt(x))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= 1.5e+17) {
tmp = (1.0 + (1.0 + (Math.sqrt((1.0 + z)) + (y * 0.5)))) - (Math.sqrt(z) + Math.sqrt(y));
} else if ((z <= 1.25e+128) || (!(z <= 3.8e+141) && (z <= 4.25e+173))) {
tmp = Math.sqrt((1.0 + y)) + (1.0 - Math.sqrt(y));
} else {
tmp = 1.0 / (Math.sqrt((1.0 + x)) + Math.sqrt(x));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if z <= 1.5e+17: tmp = (1.0 + (1.0 + (math.sqrt((1.0 + z)) + (y * 0.5)))) - (math.sqrt(z) + math.sqrt(y)) elif (z <= 1.25e+128) or (not (z <= 3.8e+141) and (z <= 4.25e+173)): tmp = math.sqrt((1.0 + y)) + (1.0 - math.sqrt(y)) else: tmp = 1.0 / (math.sqrt((1.0 + x)) + math.sqrt(x)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (z <= 1.5e+17) tmp = Float64(Float64(1.0 + Float64(1.0 + Float64(sqrt(Float64(1.0 + z)) + Float64(y * 0.5)))) - Float64(sqrt(z) + sqrt(y))); elseif ((z <= 1.25e+128) || (!(z <= 3.8e+141) && (z <= 4.25e+173))) tmp = Float64(sqrt(Float64(1.0 + y)) + Float64(1.0 - sqrt(y))); else tmp = Float64(1.0 / Float64(sqrt(Float64(1.0 + x)) + sqrt(x))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (z <= 1.5e+17)
tmp = (1.0 + (1.0 + (sqrt((1.0 + z)) + (y * 0.5)))) - (sqrt(z) + sqrt(y));
elseif ((z <= 1.25e+128) || (~((z <= 3.8e+141)) && (z <= 4.25e+173)))
tmp = sqrt((1.0 + y)) + (1.0 - sqrt(y));
else
tmp = 1.0 / (sqrt((1.0 + x)) + sqrt(x));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[z, 1.5e+17], N[(N[(1.0 + N[(1.0 + N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] + N[(y * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[z], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[z, 1.25e+128], And[N[Not[LessEqual[z, 3.8e+141]], $MachinePrecision], LessEqual[z, 4.25e+173]]], N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] + N[(1.0 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq 1.5 \cdot 10^{+17}:\\
\;\;\;\;\left(1 + \left(1 + \left(\sqrt{1 + z} + y \cdot 0.5\right)\right)\right) - \left(\sqrt{z} + \sqrt{y}\right)\\
\mathbf{elif}\;z \leq 1.25 \cdot 10^{+128} \lor \neg \left(z \leq 3.8 \cdot 10^{+141}\right) \land z \leq 4.25 \cdot 10^{+173}:\\
\;\;\;\;\sqrt{1 + y} + \left(1 - \sqrt{y}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{1 + x} + \sqrt{x}}\\
\end{array}
\end{array}
if z < 1.5e17Initial program 97.2%
associate-+l+97.2%
+-commutative97.2%
associate-+l+97.2%
+-commutative97.2%
associate-+l+97.2%
+-commutative97.2%
associate-+r-54.6%
Simplified29.2%
Taylor expanded in t around inf 25.4%
associate--l+29.5%
+-commutative29.5%
associate--l+35.7%
+-commutative35.7%
Simplified35.7%
Taylor expanded in x around 0 35.2%
Taylor expanded in y around 0 32.4%
*-commutative32.4%
Simplified32.4%
if 1.5e17 < z < 1.25e128 or 3.79999999999999976e141 < z < 4.2500000000000001e173Initial program 84.4%
associate-+l+84.4%
+-commutative84.4%
associate-+l+84.4%
+-commutative84.4%
associate-+l+84.4%
+-commutative84.4%
associate-+r-65.0%
Simplified50.4%
Taylor expanded in t around inf 4.0%
associate--l+15.4%
+-commutative15.4%
associate--l+13.5%
+-commutative13.5%
Simplified13.5%
Taylor expanded in x around 0 4.1%
Taylor expanded in z around inf 35.0%
+-commutative35.0%
associate--l+35.1%
Simplified35.1%
if 1.25e128 < z < 3.79999999999999976e141 or 4.2500000000000001e173 < z Initial program 92.6%
associate-+l+92.6%
+-commutative92.6%
associate-+l+92.6%
+-commutative92.6%
associate-+l+92.6%
+-commutative92.6%
associate-+r-54.4%
Simplified30.7%
Taylor expanded in t around inf 3.1%
associate--l+24.9%
+-commutative24.9%
associate--l+22.5%
+-commutative22.5%
Simplified22.5%
Taylor expanded in y around inf 24.9%
associate--r+24.9%
Simplified24.9%
Taylor expanded in z around inf 24.3%
flip--25.5%
add-sqr-sqrt25.5%
add-sqr-sqrt25.5%
Applied egg-rr25.5%
associate--l+28.5%
+-inverses28.5%
metadata-eval28.5%
Simplified28.5%
Final simplification32.1%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(if (<= z 4.4e+15)
(- (+ 1.0 (+ 1.0 (sqrt (+ 1.0 z)))) (+ (sqrt z) (sqrt y)))
(if (or (<= z 1.1e+128) (and (not (<= z 1.1e+142)) (<= z 4.25e+173)))
(+ (sqrt (+ 1.0 y)) (- 1.0 (sqrt y)))
(/ 1.0 (+ (sqrt (+ 1.0 x)) (sqrt x))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (z <= 4.4e+15) {
tmp = (1.0 + (1.0 + sqrt((1.0 + z)))) - (sqrt(z) + sqrt(y));
} else if ((z <= 1.1e+128) || (!(z <= 1.1e+142) && (z <= 4.25e+173))) {
tmp = sqrt((1.0 + y)) + (1.0 - sqrt(y));
} else {
tmp = 1.0 / (sqrt((1.0 + x)) + sqrt(x));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (z <= 4.4d+15) then
tmp = (1.0d0 + (1.0d0 + sqrt((1.0d0 + z)))) - (sqrt(z) + sqrt(y))
else if ((z <= 1.1d+128) .or. (.not. (z <= 1.1d+142)) .and. (z <= 4.25d+173)) then
tmp = sqrt((1.0d0 + y)) + (1.0d0 - sqrt(y))
else
tmp = 1.0d0 / (sqrt((1.0d0 + x)) + sqrt(x))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= 4.4e+15) {
tmp = (1.0 + (1.0 + Math.sqrt((1.0 + z)))) - (Math.sqrt(z) + Math.sqrt(y));
} else if ((z <= 1.1e+128) || (!(z <= 1.1e+142) && (z <= 4.25e+173))) {
tmp = Math.sqrt((1.0 + y)) + (1.0 - Math.sqrt(y));
} else {
tmp = 1.0 / (Math.sqrt((1.0 + x)) + Math.sqrt(x));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if z <= 4.4e+15: tmp = (1.0 + (1.0 + math.sqrt((1.0 + z)))) - (math.sqrt(z) + math.sqrt(y)) elif (z <= 1.1e+128) or (not (z <= 1.1e+142) and (z <= 4.25e+173)): tmp = math.sqrt((1.0 + y)) + (1.0 - math.sqrt(y)) else: tmp = 1.0 / (math.sqrt((1.0 + x)) + math.sqrt(x)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (z <= 4.4e+15) tmp = Float64(Float64(1.0 + Float64(1.0 + sqrt(Float64(1.0 + z)))) - Float64(sqrt(z) + sqrt(y))); elseif ((z <= 1.1e+128) || (!(z <= 1.1e+142) && (z <= 4.25e+173))) tmp = Float64(sqrt(Float64(1.0 + y)) + Float64(1.0 - sqrt(y))); else tmp = Float64(1.0 / Float64(sqrt(Float64(1.0 + x)) + sqrt(x))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (z <= 4.4e+15)
tmp = (1.0 + (1.0 + sqrt((1.0 + z)))) - (sqrt(z) + sqrt(y));
elseif ((z <= 1.1e+128) || (~((z <= 1.1e+142)) && (z <= 4.25e+173)))
tmp = sqrt((1.0 + y)) + (1.0 - sqrt(y));
else
tmp = 1.0 / (sqrt((1.0 + x)) + sqrt(x));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[z, 4.4e+15], N[(N[(1.0 + N[(1.0 + N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[z], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[z, 1.1e+128], And[N[Not[LessEqual[z, 1.1e+142]], $MachinePrecision], LessEqual[z, 4.25e+173]]], N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] + N[(1.0 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq 4.4 \cdot 10^{+15}:\\
\;\;\;\;\left(1 + \left(1 + \sqrt{1 + z}\right)\right) - \left(\sqrt{z} + \sqrt{y}\right)\\
\mathbf{elif}\;z \leq 1.1 \cdot 10^{+128} \lor \neg \left(z \leq 1.1 \cdot 10^{+142}\right) \land z \leq 4.25 \cdot 10^{+173}:\\
\;\;\;\;\sqrt{1 + y} + \left(1 - \sqrt{y}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{1 + x} + \sqrt{x}}\\
\end{array}
\end{array}
if z < 4.4e15Initial program 97.2%
associate-+l+97.2%
+-commutative97.2%
associate-+l+97.2%
+-commutative97.2%
associate-+l+97.2%
+-commutative97.2%
associate-+r-54.6%
Simplified29.2%
Taylor expanded in t around inf 25.4%
associate--l+29.5%
+-commutative29.5%
associate--l+35.7%
+-commutative35.7%
Simplified35.7%
Taylor expanded in x around 0 35.2%
Taylor expanded in y around 0 30.0%
if 4.4e15 < z < 1.10000000000000008e128 or 1.09999999999999993e142 < z < 4.2500000000000001e173Initial program 84.4%
associate-+l+84.4%
+-commutative84.4%
associate-+l+84.4%
+-commutative84.4%
associate-+l+84.4%
+-commutative84.4%
associate-+r-65.0%
Simplified50.4%
Taylor expanded in t around inf 4.0%
associate--l+15.4%
+-commutative15.4%
associate--l+13.5%
+-commutative13.5%
Simplified13.5%
Taylor expanded in x around 0 4.1%
Taylor expanded in z around inf 35.0%
+-commutative35.0%
associate--l+35.1%
Simplified35.1%
if 1.10000000000000008e128 < z < 1.09999999999999993e142 or 4.2500000000000001e173 < z Initial program 92.6%
associate-+l+92.6%
+-commutative92.6%
associate-+l+92.6%
+-commutative92.6%
associate-+l+92.6%
+-commutative92.6%
associate-+r-54.4%
Simplified30.7%
Taylor expanded in t around inf 3.1%
associate--l+24.9%
+-commutative24.9%
associate--l+22.5%
+-commutative22.5%
Simplified22.5%
Taylor expanded in y around inf 24.9%
associate--r+24.9%
Simplified24.9%
Taylor expanded in z around inf 24.3%
flip--25.5%
add-sqr-sqrt25.5%
add-sqr-sqrt25.5%
Applied egg-rr25.5%
associate--l+28.5%
+-inverses28.5%
metadata-eval28.5%
Simplified28.5%
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
(if (<= z 5.8e+15)
(+ (sqrt (+ 1.0 z)) (- 2.0 (sqrt z)))
(if (or (<= z 1.1e+128) (and (not (<= z 5.2e+136)) (<= z 4.25e+173)))
(+ (sqrt (+ 1.0 y)) (- 1.0 (sqrt y)))
(- (sqrt (+ 1.0 x)) (sqrt x)))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (z <= 5.8e+15) {
tmp = sqrt((1.0 + z)) + (2.0 - sqrt(z));
} else if ((z <= 1.1e+128) || (!(z <= 5.2e+136) && (z <= 4.25e+173))) {
tmp = sqrt((1.0 + y)) + (1.0 - sqrt(y));
} else {
tmp = sqrt((1.0 + x)) - sqrt(x);
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (z <= 5.8d+15) then
tmp = sqrt((1.0d0 + z)) + (2.0d0 - sqrt(z))
else if ((z <= 1.1d+128) .or. (.not. (z <= 5.2d+136)) .and. (z <= 4.25d+173)) then
tmp = sqrt((1.0d0 + y)) + (1.0d0 - sqrt(y))
else
tmp = sqrt((1.0d0 + x)) - sqrt(x)
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= 5.8e+15) {
tmp = Math.sqrt((1.0 + z)) + (2.0 - Math.sqrt(z));
} else if ((z <= 1.1e+128) || (!(z <= 5.2e+136) && (z <= 4.25e+173))) {
tmp = Math.sqrt((1.0 + y)) + (1.0 - Math.sqrt(y));
} else {
tmp = Math.sqrt((1.0 + x)) - Math.sqrt(x);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if z <= 5.8e+15: tmp = math.sqrt((1.0 + z)) + (2.0 - math.sqrt(z)) elif (z <= 1.1e+128) or (not (z <= 5.2e+136) and (z <= 4.25e+173)): tmp = math.sqrt((1.0 + y)) + (1.0 - math.sqrt(y)) else: tmp = math.sqrt((1.0 + x)) - math.sqrt(x) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (z <= 5.8e+15) tmp = Float64(sqrt(Float64(1.0 + z)) + Float64(2.0 - sqrt(z))); elseif ((z <= 1.1e+128) || (!(z <= 5.2e+136) && (z <= 4.25e+173))) tmp = Float64(sqrt(Float64(1.0 + y)) + Float64(1.0 - sqrt(y))); else tmp = Float64(sqrt(Float64(1.0 + x)) - sqrt(x)); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (z <= 5.8e+15)
tmp = sqrt((1.0 + z)) + (2.0 - sqrt(z));
elseif ((z <= 1.1e+128) || (~((z <= 5.2e+136)) && (z <= 4.25e+173)))
tmp = sqrt((1.0 + y)) + (1.0 - sqrt(y));
else
tmp = sqrt((1.0 + x)) - sqrt(x);
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[z, 5.8e+15], N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] + N[(2.0 - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[z, 1.1e+128], And[N[Not[LessEqual[z, 5.2e+136]], $MachinePrecision], LessEqual[z, 4.25e+173]]], N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] + N[(1.0 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq 5.8 \cdot 10^{+15}:\\
\;\;\;\;\sqrt{1 + z} + \left(2 - \sqrt{z}\right)\\
\mathbf{elif}\;z \leq 1.1 \cdot 10^{+128} \lor \neg \left(z \leq 5.2 \cdot 10^{+136}\right) \land z \leq 4.25 \cdot 10^{+173}:\\
\;\;\;\;\sqrt{1 + y} + \left(1 - \sqrt{y}\right)\\
\mathbf{else}:\\
\;\;\;\;\sqrt{1 + x} - \sqrt{x}\\
\end{array}
\end{array}
if z < 5.8e15Initial program 97.2%
associate-+l+97.2%
+-commutative97.2%
associate-+l+97.2%
+-commutative97.2%
associate-+l+97.2%
+-commutative97.2%
associate-+r-54.6%
Simplified29.2%
Taylor expanded in t around inf 25.4%
associate--l+29.5%
+-commutative29.5%
associate--l+35.7%
+-commutative35.7%
Simplified35.7%
Taylor expanded in x around 0 35.2%
Taylor expanded in y around 0 51.6%
+-commutative51.6%
associate--l+51.5%
Simplified51.5%
if 5.8e15 < z < 1.10000000000000008e128 or 5.2000000000000003e136 < z < 4.2500000000000001e173Initial program 84.6%
associate-+l+84.6%
+-commutative84.6%
associate-+l+84.6%
+-commutative84.6%
associate-+l+84.6%
+-commutative84.6%
associate-+r-63.9%
Simplified49.6%
Taylor expanded in t around inf 4.0%
associate--l+15.5%
+-commutative15.5%
associate--l+13.4%
+-commutative13.4%
Simplified13.4%
Taylor expanded in x around 0 4.0%
Taylor expanded in z around inf 34.4%
+-commutative34.4%
associate--l+34.5%
Simplified34.5%
if 1.10000000000000008e128 < z < 5.2000000000000003e136 or 4.2500000000000001e173 < z Initial program 92.4%
associate-+l+92.4%
+-commutative92.4%
associate-+l+92.4%
+-commutative92.4%
associate-+l+92.4%
+-commutative92.4%
associate-+r-55.3%
Simplified31.2%
Taylor expanded in t around inf 3.1%
associate--l+25.0%
+-commutative25.0%
associate--l+22.7%
+-commutative22.7%
Simplified22.7%
Taylor expanded in y around inf 25.0%
associate--r+25.0%
Simplified25.0%
Taylor expanded in z around inf 24.4%
Final simplification42.1%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(if (<= z 6.2e+16)
(+ (sqrt (+ 1.0 z)) (- 2.0 (sqrt z)))
(if (or (<= z 1.25e+128) (and (not (<= z 3.8e+141)) (<= z 4.25e+173)))
(+ (sqrt (+ 1.0 y)) (- 1.0 (sqrt y)))
(/ 1.0 (+ (sqrt (+ 1.0 x)) (sqrt x))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (z <= 6.2e+16) {
tmp = sqrt((1.0 + z)) + (2.0 - sqrt(z));
} else if ((z <= 1.25e+128) || (!(z <= 3.8e+141) && (z <= 4.25e+173))) {
tmp = sqrt((1.0 + y)) + (1.0 - sqrt(y));
} else {
tmp = 1.0 / (sqrt((1.0 + x)) + sqrt(x));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (z <= 6.2d+16) then
tmp = sqrt((1.0d0 + z)) + (2.0d0 - sqrt(z))
else if ((z <= 1.25d+128) .or. (.not. (z <= 3.8d+141)) .and. (z <= 4.25d+173)) then
tmp = sqrt((1.0d0 + y)) + (1.0d0 - sqrt(y))
else
tmp = 1.0d0 / (sqrt((1.0d0 + x)) + sqrt(x))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= 6.2e+16) {
tmp = Math.sqrt((1.0 + z)) + (2.0 - Math.sqrt(z));
} else if ((z <= 1.25e+128) || (!(z <= 3.8e+141) && (z <= 4.25e+173))) {
tmp = Math.sqrt((1.0 + y)) + (1.0 - Math.sqrt(y));
} else {
tmp = 1.0 / (Math.sqrt((1.0 + x)) + Math.sqrt(x));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if z <= 6.2e+16: tmp = math.sqrt((1.0 + z)) + (2.0 - math.sqrt(z)) elif (z <= 1.25e+128) or (not (z <= 3.8e+141) and (z <= 4.25e+173)): tmp = math.sqrt((1.0 + y)) + (1.0 - math.sqrt(y)) else: tmp = 1.0 / (math.sqrt((1.0 + x)) + math.sqrt(x)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (z <= 6.2e+16) tmp = Float64(sqrt(Float64(1.0 + z)) + Float64(2.0 - sqrt(z))); elseif ((z <= 1.25e+128) || (!(z <= 3.8e+141) && (z <= 4.25e+173))) tmp = Float64(sqrt(Float64(1.0 + y)) + Float64(1.0 - sqrt(y))); else tmp = Float64(1.0 / Float64(sqrt(Float64(1.0 + x)) + sqrt(x))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (z <= 6.2e+16)
tmp = sqrt((1.0 + z)) + (2.0 - sqrt(z));
elseif ((z <= 1.25e+128) || (~((z <= 3.8e+141)) && (z <= 4.25e+173)))
tmp = sqrt((1.0 + y)) + (1.0 - sqrt(y));
else
tmp = 1.0 / (sqrt((1.0 + x)) + sqrt(x));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[z, 6.2e+16], N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] + N[(2.0 - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[z, 1.25e+128], And[N[Not[LessEqual[z, 3.8e+141]], $MachinePrecision], LessEqual[z, 4.25e+173]]], N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] + N[(1.0 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq 6.2 \cdot 10^{+16}:\\
\;\;\;\;\sqrt{1 + z} + \left(2 - \sqrt{z}\right)\\
\mathbf{elif}\;z \leq 1.25 \cdot 10^{+128} \lor \neg \left(z \leq 3.8 \cdot 10^{+141}\right) \land z \leq 4.25 \cdot 10^{+173}:\\
\;\;\;\;\sqrt{1 + y} + \left(1 - \sqrt{y}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{1 + x} + \sqrt{x}}\\
\end{array}
\end{array}
if z < 6.2e16Initial program 97.2%
associate-+l+97.2%
+-commutative97.2%
associate-+l+97.2%
+-commutative97.2%
associate-+l+97.2%
+-commutative97.2%
associate-+r-54.6%
Simplified29.2%
Taylor expanded in t around inf 25.4%
associate--l+29.5%
+-commutative29.5%
associate--l+35.7%
+-commutative35.7%
Simplified35.7%
Taylor expanded in x around 0 35.2%
Taylor expanded in y around 0 51.6%
+-commutative51.6%
associate--l+51.5%
Simplified51.5%
if 6.2e16 < z < 1.25e128 or 3.79999999999999976e141 < z < 4.2500000000000001e173Initial program 84.4%
associate-+l+84.4%
+-commutative84.4%
associate-+l+84.4%
+-commutative84.4%
associate-+l+84.4%
+-commutative84.4%
associate-+r-65.0%
Simplified50.4%
Taylor expanded in t around inf 4.0%
associate--l+15.4%
+-commutative15.4%
associate--l+13.5%
+-commutative13.5%
Simplified13.5%
Taylor expanded in x around 0 4.1%
Taylor expanded in z around inf 35.0%
+-commutative35.0%
associate--l+35.1%
Simplified35.1%
if 1.25e128 < z < 3.79999999999999976e141 or 4.2500000000000001e173 < z Initial program 92.6%
associate-+l+92.6%
+-commutative92.6%
associate-+l+92.6%
+-commutative92.6%
associate-+l+92.6%
+-commutative92.6%
associate-+r-54.4%
Simplified30.7%
Taylor expanded in t around inf 3.1%
associate--l+24.9%
+-commutative24.9%
associate--l+22.5%
+-commutative22.5%
Simplified22.5%
Taylor expanded in y around inf 24.9%
associate--r+24.9%
Simplified24.9%
Taylor expanded in z around inf 24.3%
flip--25.5%
add-sqr-sqrt25.5%
add-sqr-sqrt25.5%
Applied egg-rr25.5%
associate--l+28.5%
+-inverses28.5%
metadata-eval28.5%
Simplified28.5%
Final simplification43.0%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(if (<= y 3.3e-155)
(- (+ 3.0 (* y 0.5)) (sqrt y))
(if (<= y 1.5e+17)
(+ (sqrt (+ 1.0 y)) (- 1.0 (sqrt y)))
(- (sqrt (+ 1.0 x)) (sqrt x)))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 3.3e-155) {
tmp = (3.0 + (y * 0.5)) - sqrt(y);
} else if (y <= 1.5e+17) {
tmp = sqrt((1.0 + y)) + (1.0 - sqrt(y));
} else {
tmp = sqrt((1.0 + x)) - sqrt(x);
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= 3.3d-155) then
tmp = (3.0d0 + (y * 0.5d0)) - sqrt(y)
else if (y <= 1.5d+17) then
tmp = sqrt((1.0d0 + y)) + (1.0d0 - sqrt(y))
else
tmp = sqrt((1.0d0 + x)) - sqrt(x)
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= 3.3e-155) {
tmp = (3.0 + (y * 0.5)) - Math.sqrt(y);
} else if (y <= 1.5e+17) {
tmp = Math.sqrt((1.0 + y)) + (1.0 - Math.sqrt(y));
} else {
tmp = Math.sqrt((1.0 + x)) - Math.sqrt(x);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if y <= 3.3e-155: tmp = (3.0 + (y * 0.5)) - math.sqrt(y) elif y <= 1.5e+17: tmp = math.sqrt((1.0 + y)) + (1.0 - math.sqrt(y)) else: tmp = math.sqrt((1.0 + x)) - math.sqrt(x) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (y <= 3.3e-155) tmp = Float64(Float64(3.0 + Float64(y * 0.5)) - sqrt(y)); elseif (y <= 1.5e+17) tmp = Float64(sqrt(Float64(1.0 + y)) + Float64(1.0 - sqrt(y))); else tmp = Float64(sqrt(Float64(1.0 + x)) - sqrt(x)); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (y <= 3.3e-155)
tmp = (3.0 + (y * 0.5)) - sqrt(y);
elseif (y <= 1.5e+17)
tmp = sqrt((1.0 + y)) + (1.0 - sqrt(y));
else
tmp = sqrt((1.0 + x)) - sqrt(x);
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[y, 3.3e-155], N[(N[(3.0 + N[(y * 0.5), $MachinePrecision]), $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.5e+17], N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] + N[(1.0 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 3.3 \cdot 10^{-155}:\\
\;\;\;\;\left(3 + y \cdot 0.5\right) - \sqrt{y}\\
\mathbf{elif}\;y \leq 1.5 \cdot 10^{+17}:\\
\;\;\;\;\sqrt{1 + y} + \left(1 - \sqrt{y}\right)\\
\mathbf{else}:\\
\;\;\;\;\sqrt{1 + x} - \sqrt{x}\\
\end{array}
\end{array}
if y < 3.29999999999999986e-155Initial program 98.2%
associate-+l+98.2%
+-commutative98.2%
associate-+l+98.2%
+-commutative98.2%
associate-+l+98.2%
+-commutative98.2%
associate-+r-98.2%
Simplified57.1%
Taylor expanded in t around inf 27.7%
associate--l+31.7%
+-commutative31.7%
associate--l+31.7%
+-commutative31.7%
Simplified31.7%
Taylor expanded in x around 0 36.2%
Taylor expanded in y around 0 36.2%
*-commutative36.2%
Simplified36.2%
Taylor expanded in z around 0 47.1%
if 3.29999999999999986e-155 < y < 1.5e17Initial program 95.2%
associate-+l+95.2%
+-commutative95.2%
associate-+l+95.2%
+-commutative95.2%
associate-+l+95.2%
+-commutative95.2%
associate-+r-95.1%
Simplified57.6%
Taylor expanded in t around inf 24.7%
associate--l+27.9%
+-commutative27.9%
associate--l+27.9%
+-commutative27.9%
Simplified27.9%
Taylor expanded in x around 0 35.5%
Taylor expanded in z around inf 44.5%
+-commutative44.5%
associate--l+44.5%
Simplified44.5%
if 1.5e17 < y Initial program 89.7%
associate-+l+89.7%
+-commutative89.7%
associate-+l+89.7%
+-commutative89.7%
associate-+l+89.7%
+-commutative89.7%
associate-+r-5.9%
Simplified4.1%
Taylor expanded in t around inf 3.3%
associate--l+20.4%
+-commutative20.4%
associate--l+26.3%
+-commutative26.3%
Simplified26.3%
Taylor expanded in y around inf 29.7%
associate--r+29.7%
Simplified29.7%
Taylor expanded in z around inf 20.7%
Final simplification34.7%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(if (<= y 2.2e-155)
(- (+ 3.0 (* y 0.5)) (sqrt y))
(if (<= y 6.0)
(- (+ 2.0 (* y 0.5)) (sqrt y))
(- (sqrt (+ 1.0 x)) (sqrt x)))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 2.2e-155) {
tmp = (3.0 + (y * 0.5)) - sqrt(y);
} else if (y <= 6.0) {
tmp = (2.0 + (y * 0.5)) - sqrt(y);
} else {
tmp = sqrt((1.0 + x)) - sqrt(x);
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= 2.2d-155) then
tmp = (3.0d0 + (y * 0.5d0)) - sqrt(y)
else if (y <= 6.0d0) then
tmp = (2.0d0 + (y * 0.5d0)) - sqrt(y)
else
tmp = sqrt((1.0d0 + x)) - sqrt(x)
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= 2.2e-155) {
tmp = (3.0 + (y * 0.5)) - Math.sqrt(y);
} else if (y <= 6.0) {
tmp = (2.0 + (y * 0.5)) - Math.sqrt(y);
} else {
tmp = Math.sqrt((1.0 + x)) - Math.sqrt(x);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if y <= 2.2e-155: tmp = (3.0 + (y * 0.5)) - math.sqrt(y) elif y <= 6.0: tmp = (2.0 + (y * 0.5)) - math.sqrt(y) else: tmp = math.sqrt((1.0 + x)) - math.sqrt(x) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (y <= 2.2e-155) tmp = Float64(Float64(3.0 + Float64(y * 0.5)) - sqrt(y)); elseif (y <= 6.0) tmp = Float64(Float64(2.0 + Float64(y * 0.5)) - sqrt(y)); else tmp = Float64(sqrt(Float64(1.0 + x)) - sqrt(x)); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (y <= 2.2e-155)
tmp = (3.0 + (y * 0.5)) - sqrt(y);
elseif (y <= 6.0)
tmp = (2.0 + (y * 0.5)) - sqrt(y);
else
tmp = sqrt((1.0 + x)) - sqrt(x);
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[y, 2.2e-155], N[(N[(3.0 + N[(y * 0.5), $MachinePrecision]), $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 6.0], N[(N[(2.0 + N[(y * 0.5), $MachinePrecision]), $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 2.2 \cdot 10^{-155}:\\
\;\;\;\;\left(3 + y \cdot 0.5\right) - \sqrt{y}\\
\mathbf{elif}\;y \leq 6:\\
\;\;\;\;\left(2 + y \cdot 0.5\right) - \sqrt{y}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{1 + x} - \sqrt{x}\\
\end{array}
\end{array}
if y < 2.1999999999999999e-155Initial program 98.2%
associate-+l+98.2%
+-commutative98.2%
associate-+l+98.2%
+-commutative98.2%
associate-+l+98.2%
+-commutative98.2%
associate-+r-98.2%
Simplified57.1%
Taylor expanded in t around inf 27.7%
associate--l+31.7%
+-commutative31.7%
associate--l+31.7%
+-commutative31.7%
Simplified31.7%
Taylor expanded in x around 0 36.2%
Taylor expanded in y around 0 36.2%
*-commutative36.2%
Simplified36.2%
Taylor expanded in z around 0 47.1%
if 2.1999999999999999e-155 < y < 6Initial program 98.0%
associate-+l+98.0%
+-commutative98.0%
associate-+l+98.0%
+-commutative98.0%
associate-+l+98.0%
+-commutative98.0%
associate-+r-97.9%
Simplified59.6%
Taylor expanded in t around inf 23.6%
associate--l+27.2%
+-commutative27.2%
associate--l+27.2%
+-commutative27.2%
Simplified27.2%
Taylor expanded in x around 0 34.2%
Taylor expanded in y around 0 33.1%
*-commutative33.1%
Simplified33.1%
Taylor expanded in z around inf 47.0%
if 6 < y Initial program 88.6%
associate-+l+88.6%
+-commutative88.6%
associate-+l+88.6%
+-commutative88.6%
associate-+l+88.6%
+-commutative88.6%
associate-+r-13.5%
Simplified8.5%
Taylor expanded in t around inf 6.1%
associate--l+21.6%
+-commutative21.6%
associate--l+26.8%
+-commutative26.8%
Simplified26.8%
Taylor expanded in y around inf 28.6%
associate--r+28.6%
Simplified28.6%
Taylor expanded in z around inf 19.6%
Final simplification33.6%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= y 6.8e-155) (- (+ 3.0 (* y 0.5)) (sqrt y)) (if (<= y 5.2) (- (+ 2.0 (* y 0.5)) (sqrt y)) 1.0)))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 6.8e-155) {
tmp = (3.0 + (y * 0.5)) - sqrt(y);
} else if (y <= 5.2) {
tmp = (2.0 + (y * 0.5)) - sqrt(y);
} else {
tmp = 1.0;
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= 6.8d-155) then
tmp = (3.0d0 + (y * 0.5d0)) - sqrt(y)
else if (y <= 5.2d0) then
tmp = (2.0d0 + (y * 0.5d0)) - sqrt(y)
else
tmp = 1.0d0
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= 6.8e-155) {
tmp = (3.0 + (y * 0.5)) - Math.sqrt(y);
} else if (y <= 5.2) {
tmp = (2.0 + (y * 0.5)) - Math.sqrt(y);
} else {
tmp = 1.0;
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if y <= 6.8e-155: tmp = (3.0 + (y * 0.5)) - math.sqrt(y) elif y <= 5.2: tmp = (2.0 + (y * 0.5)) - math.sqrt(y) else: tmp = 1.0 return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (y <= 6.8e-155) tmp = Float64(Float64(3.0 + Float64(y * 0.5)) - sqrt(y)); elseif (y <= 5.2) tmp = Float64(Float64(2.0 + Float64(y * 0.5)) - sqrt(y)); else tmp = 1.0; end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (y <= 6.8e-155)
tmp = (3.0 + (y * 0.5)) - sqrt(y);
elseif (y <= 5.2)
tmp = (2.0 + (y * 0.5)) - sqrt(y);
else
tmp = 1.0;
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[y, 6.8e-155], N[(N[(3.0 + N[(y * 0.5), $MachinePrecision]), $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 5.2], N[(N[(2.0 + N[(y * 0.5), $MachinePrecision]), $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision], 1.0]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 6.8 \cdot 10^{-155}:\\
\;\;\;\;\left(3 + y \cdot 0.5\right) - \sqrt{y}\\
\mathbf{elif}\;y \leq 5.2:\\
\;\;\;\;\left(2 + y \cdot 0.5\right) - \sqrt{y}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if y < 6.8e-155Initial program 98.2%
associate-+l+98.2%
+-commutative98.2%
associate-+l+98.2%
+-commutative98.2%
associate-+l+98.2%
+-commutative98.2%
associate-+r-98.2%
Simplified57.1%
Taylor expanded in t around inf 27.7%
associate--l+31.7%
+-commutative31.7%
associate--l+31.7%
+-commutative31.7%
Simplified31.7%
Taylor expanded in x around 0 36.2%
Taylor expanded in y around 0 36.2%
*-commutative36.2%
Simplified36.2%
Taylor expanded in z around 0 47.1%
if 6.8e-155 < y < 5.20000000000000018Initial program 98.0%
associate-+l+98.0%
+-commutative98.0%
associate-+l+98.0%
+-commutative98.0%
associate-+l+98.0%
+-commutative98.0%
associate-+r-97.9%
Simplified59.1%
Taylor expanded in t around inf 23.9%
associate--l+27.3%
+-commutative27.3%
associate--l+27.3%
+-commutative27.3%
Simplified27.3%
Taylor expanded in x around 0 34.7%
Taylor expanded in y around 0 33.6%
*-commutative33.6%
Simplified33.6%
Taylor expanded in z around inf 47.3%
if 5.20000000000000018 < y Initial program 88.7%
associate-+l+88.7%
+-commutative88.7%
associate-+l+88.7%
+-commutative88.7%
associate-+l+88.7%
+-commutative88.7%
associate-+r-14.2%
Simplified9.3%
Taylor expanded in t around inf 6.1%
associate--l+21.5%
+-commutative21.5%
associate--l+26.8%
+-commutative26.8%
Simplified26.8%
Taylor expanded in y around inf 28.5%
associate--r+28.5%
Simplified28.5%
Taylor expanded in z around inf 19.6%
Taylor expanded in x around 0 39.5%
Final simplification43.4%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= y 5.3) (- (+ 2.0 (* y 0.5)) (sqrt y)) 1.0))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 5.3) {
tmp = (2.0 + (y * 0.5)) - sqrt(y);
} else {
tmp = 1.0;
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= 5.3d0) then
tmp = (2.0d0 + (y * 0.5d0)) - sqrt(y)
else
tmp = 1.0d0
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= 5.3) {
tmp = (2.0 + (y * 0.5)) - Math.sqrt(y);
} else {
tmp = 1.0;
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if y <= 5.3: tmp = (2.0 + (y * 0.5)) - math.sqrt(y) else: tmp = 1.0 return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (y <= 5.3) tmp = Float64(Float64(2.0 + Float64(y * 0.5)) - sqrt(y)); else tmp = 1.0; end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (y <= 5.3)
tmp = (2.0 + (y * 0.5)) - sqrt(y);
else
tmp = 1.0;
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[y, 5.3], N[(N[(2.0 + N[(y * 0.5), $MachinePrecision]), $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision], 1.0]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 5.3:\\
\;\;\;\;\left(2 + y \cdot 0.5\right) - \sqrt{y}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if y < 5.29999999999999982Initial program 98.1%
associate-+l+98.1%
+-commutative98.1%
associate-+l+98.1%
+-commutative98.1%
associate-+l+98.1%
+-commutative98.1%
associate-+r-98.1%
Simplified58.5%
Taylor expanded in t around inf 25.5%
associate--l+29.3%
+-commutative29.3%
associate--l+29.3%
+-commutative29.3%
Simplified29.3%
Taylor expanded in x around 0 35.1%
Taylor expanded in y around 0 34.5%
*-commutative34.5%
Simplified34.5%
Taylor expanded in z around inf 44.7%
if 5.29999999999999982 < y Initial program 88.6%
associate-+l+88.6%
+-commutative88.6%
associate-+l+88.6%
+-commutative88.6%
associate-+l+88.6%
+-commutative88.6%
associate-+r-13.5%
Simplified8.5%
Taylor expanded in t around inf 6.1%
associate--l+21.6%
+-commutative21.6%
associate--l+26.8%
+-commutative26.8%
Simplified26.8%
Taylor expanded in y around inf 28.6%
associate--r+28.6%
Simplified28.6%
Taylor expanded in z around inf 19.6%
Taylor expanded in x around 0 39.7%
Final simplification42.3%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 1.0)
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
return 1.0;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = 1.0d0
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
return 1.0;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): return 1.0
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) return 1.0 end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp = code(x, y, z, t)
tmp = 1.0;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := 1.0
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
1
\end{array}
Initial program 93.5%
associate-+l+93.5%
+-commutative93.5%
associate-+l+93.5%
+-commutative93.5%
associate-+l+93.5%
+-commutative93.5%
associate-+r-56.8%
Simplified34.1%
Taylor expanded in t around inf 16.0%
associate--l+25.5%
+-commutative25.5%
associate--l+28.1%
+-commutative28.1%
Simplified28.1%
Taylor expanded in y around inf 20.4%
associate--r+20.4%
Simplified20.4%
Taylor expanded in z around inf 15.6%
Taylor expanded in x around 0 33.2%
Final simplification33.2%
(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 2023308
(FPCore (x y z t)
:name "Main:z from "
:precision binary64
:herbie-target
(+ (+ (+ (/ 1.0 (+ (sqrt (+ x 1.0)) (sqrt x))) (/ 1.0 (+ (sqrt (+ y 1.0)) (sqrt y)))) (/ 1.0 (+ (sqrt (+ z 1.0)) (sqrt z)))) (- (sqrt (+ t 1.0)) (sqrt t)))
(+ (+ (+ (- (sqrt (+ x 1.0)) (sqrt x)) (- (sqrt (+ y 1.0)) (sqrt y))) (- (sqrt (+ z 1.0)) (sqrt z))) (- (sqrt (+ t 1.0)) (sqrt t))))