
(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 24 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 (/ 1.0 (+ (sqrt (+ 1.0 y)) (sqrt y))))
(t_3 (sqrt (+ 1.0 z))))
(if (<= z 7.5e+30)
(+
(+ t_2 (- t_1 (sqrt x)))
(+ (- (sqrt (+ 1.0 t)) (sqrt t)) (/ 1.0 (+ t_3 (sqrt z)))))
(+ (+ t_2 (/ 1.0 (+ t_1 (sqrt x)))) (- 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 = 1.0 / (sqrt((1.0 + y)) + sqrt(y));
double t_3 = sqrt((1.0 + z));
double tmp;
if (z <= 7.5e+30) {
tmp = (t_2 + (t_1 - sqrt(x))) + ((sqrt((1.0 + t)) - sqrt(t)) + (1.0 / (t_3 + sqrt(z))));
} else {
tmp = (t_2 + (1.0 / (t_1 + sqrt(x)))) + (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 = 1.0d0 / (sqrt((1.0d0 + y)) + sqrt(y))
t_3 = sqrt((1.0d0 + z))
if (z <= 7.5d+30) then
tmp = (t_2 + (t_1 - sqrt(x))) + ((sqrt((1.0d0 + t)) - sqrt(t)) + (1.0d0 / (t_3 + sqrt(z))))
else
tmp = (t_2 + (1.0d0 / (t_1 + sqrt(x)))) + (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 = 1.0 / (Math.sqrt((1.0 + y)) + Math.sqrt(y));
double t_3 = Math.sqrt((1.0 + z));
double tmp;
if (z <= 7.5e+30) {
tmp = (t_2 + (t_1 - Math.sqrt(x))) + ((Math.sqrt((1.0 + t)) - Math.sqrt(t)) + (1.0 / (t_3 + Math.sqrt(z))));
} else {
tmp = (t_2 + (1.0 / (t_1 + Math.sqrt(x)))) + (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 = 1.0 / (math.sqrt((1.0 + y)) + math.sqrt(y)) t_3 = math.sqrt((1.0 + z)) tmp = 0 if z <= 7.5e+30: tmp = (t_2 + (t_1 - math.sqrt(x))) + ((math.sqrt((1.0 + t)) - math.sqrt(t)) + (1.0 / (t_3 + math.sqrt(z)))) else: tmp = (t_2 + (1.0 / (t_1 + math.sqrt(x)))) + (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 = Float64(1.0 / Float64(sqrt(Float64(1.0 + y)) + sqrt(y))) t_3 = sqrt(Float64(1.0 + z)) tmp = 0.0 if (z <= 7.5e+30) tmp = Float64(Float64(t_2 + 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(t_2 + Float64(1.0 / Float64(t_1 + sqrt(x)))) + 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 = 1.0 / (sqrt((1.0 + y)) + sqrt(y));
t_3 = sqrt((1.0 + z));
tmp = 0.0;
if (z <= 7.5e+30)
tmp = (t_2 + (t_1 - sqrt(x))) + ((sqrt((1.0 + t)) - sqrt(t)) + (1.0 / (t_3 + sqrt(z))));
else
tmp = (t_2 + (1.0 / (t_1 + sqrt(x)))) + (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[(1.0 / N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[z, 7.5e+30], N[(N[(t$95$2 + 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[(t$95$2 + N[(1.0 / N[(t$95$1 + N[Sqrt[x], $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 := \frac{1}{\sqrt{1 + y} + \sqrt{y}}\\
t_3 := \sqrt{1 + z}\\
\mathbf{if}\;z \leq 7.5 \cdot 10^{+30}:\\
\;\;\;\;\left(t_2 + \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(t_2 + \frac{1}{t_1 + \sqrt{x}}\right) + \left(t_3 - \sqrt{z}\right)\\
\end{array}
\end{array}
if z < 7.49999999999999973e30Initial program 94.7%
associate-+l+94.7%
+-commutative94.7%
+-commutative94.7%
+-commutative94.7%
Simplified94.7%
flip--94.7%
add-sqr-sqrt94.2%
add-sqr-sqrt95.3%
Applied egg-rr95.3%
associate--l+97.5%
+-inverses97.5%
metadata-eval97.5%
Simplified97.5%
flip--97.7%
add-sqr-sqrt79.4%
add-sqr-sqrt98.1%
Applied egg-rr98.1%
associate--l+98.8%
+-inverses98.8%
metadata-eval98.8%
Simplified98.8%
if 7.49999999999999973e30 < z Initial program 92.3%
associate-+l+92.3%
+-commutative92.3%
+-commutative92.3%
+-commutative92.3%
Simplified92.3%
flip--92.3%
add-sqr-sqrt73.1%
+-commutative73.1%
add-sqr-sqrt92.9%
+-commutative92.9%
Applied egg-rr92.9%
associate--l+94.1%
+-inverses94.1%
metadata-eval94.1%
Simplified94.1%
flip--94.1%
add-sqr-sqrt78.0%
add-sqr-sqrt94.5%
Applied egg-rr95.2%
associate--l+97.0%
+-inverses97.0%
metadata-eval97.0%
Simplified97.2%
Taylor expanded in t around inf 53.5%
Final simplification78.3%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ 1.0 x)))
(t_2 (sqrt (+ 1.0 z)))
(t_3 (sqrt (+ 1.0 y)))
(t_4 (+ (- t_1 (sqrt x)) (- t_3 (sqrt y)))))
(if (<= t_4 1.85)
(+ (+ (/ 1.0 (+ t_3 (sqrt y))) (/ 1.0 (+ t_1 (sqrt x)))) (- t_2 (sqrt z)))
(+ (+ (- (sqrt (+ 1.0 t)) (sqrt t)) (/ 1.0 (+ t_2 (sqrt z)))) t_4))))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 t_4 = (t_1 - sqrt(x)) + (t_3 - sqrt(y));
double tmp;
if (t_4 <= 1.85) {
tmp = ((1.0 / (t_3 + sqrt(y))) + (1.0 / (t_1 + sqrt(x)))) + (t_2 - sqrt(z));
} else {
tmp = ((sqrt((1.0 + t)) - sqrt(t)) + (1.0 / (t_2 + sqrt(z)))) + t_4;
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: tmp
t_1 = sqrt((1.0d0 + x))
t_2 = sqrt((1.0d0 + z))
t_3 = sqrt((1.0d0 + y))
t_4 = (t_1 - sqrt(x)) + (t_3 - sqrt(y))
if (t_4 <= 1.85d0) then
tmp = ((1.0d0 / (t_3 + sqrt(y))) + (1.0d0 / (t_1 + sqrt(x)))) + (t_2 - sqrt(z))
else
tmp = ((sqrt((1.0d0 + t)) - sqrt(t)) + (1.0d0 / (t_2 + sqrt(z)))) + t_4
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 t_4 = (t_1 - Math.sqrt(x)) + (t_3 - Math.sqrt(y));
double tmp;
if (t_4 <= 1.85) {
tmp = ((1.0 / (t_3 + Math.sqrt(y))) + (1.0 / (t_1 + Math.sqrt(x)))) + (t_2 - Math.sqrt(z));
} else {
tmp = ((Math.sqrt((1.0 + t)) - Math.sqrt(t)) + (1.0 / (t_2 + Math.sqrt(z)))) + t_4;
}
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)) t_4 = (t_1 - math.sqrt(x)) + (t_3 - math.sqrt(y)) tmp = 0 if t_4 <= 1.85: tmp = ((1.0 / (t_3 + math.sqrt(y))) + (1.0 / (t_1 + math.sqrt(x)))) + (t_2 - math.sqrt(z)) else: tmp = ((math.sqrt((1.0 + t)) - math.sqrt(t)) + (1.0 / (t_2 + math.sqrt(z)))) + t_4 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)) t_4 = Float64(Float64(t_1 - sqrt(x)) + Float64(t_3 - sqrt(y))) tmp = 0.0 if (t_4 <= 1.85) tmp = Float64(Float64(Float64(1.0 / Float64(t_3 + sqrt(y))) + Float64(1.0 / Float64(t_1 + sqrt(x)))) + Float64(t_2 - sqrt(z))); else tmp = Float64(Float64(Float64(sqrt(Float64(1.0 + t)) - sqrt(t)) + Float64(1.0 / Float64(t_2 + sqrt(z)))) + t_4); 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));
t_4 = (t_1 - sqrt(x)) + (t_3 - sqrt(y));
tmp = 0.0;
if (t_4 <= 1.85)
tmp = ((1.0 / (t_3 + sqrt(y))) + (1.0 / (t_1 + sqrt(x)))) + (t_2 - sqrt(z));
else
tmp = ((sqrt((1.0 + t)) - sqrt(t)) + (1.0 / (t_2 + sqrt(z)))) + t_4;
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]}, Block[{t$95$4 = N[(N[(t$95$1 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(t$95$3 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$4, 1.85], N[(N[(N[(1.0 / N[(t$95$3 + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(t$95$1 + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$2 - 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$2 + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$4), $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}\\
t_4 := \left(t_1 - \sqrt{x}\right) + \left(t_3 - \sqrt{y}\right)\\
\mathbf{if}\;t_4 \leq 1.85:\\
\;\;\;\;\left(\frac{1}{t_3 + \sqrt{y}} + \frac{1}{t_1 + \sqrt{x}}\right) + \left(t_2 - \sqrt{z}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\sqrt{1 + t} - \sqrt{t}\right) + \frac{1}{t_2 + \sqrt{z}}\right) + t_4\\
\end{array}
\end{array}
if (+.f64 (-.f64 (sqrt.f64 (+.f64 x 1)) (sqrt.f64 x)) (-.f64 (sqrt.f64 (+.f64 y 1)) (sqrt.f64 y))) < 1.8500000000000001Initial program 91.8%
associate-+l+91.8%
+-commutative91.8%
+-commutative91.8%
+-commutative91.8%
Simplified91.8%
flip--91.8%
add-sqr-sqrt65.4%
+-commutative65.4%
add-sqr-sqrt92.1%
+-commutative92.1%
Applied egg-rr92.1%
associate--l+93.2%
+-inverses93.2%
metadata-eval93.2%
Simplified93.2%
flip--94.9%
add-sqr-sqrt72.1%
add-sqr-sqrt95.5%
Applied egg-rr94.3%
associate--l+97.5%
+-inverses97.5%
metadata-eval97.5%
Simplified96.0%
Taylor expanded in t around inf 56.1%
if 1.8500000000000001 < (+.f64 (-.f64 (sqrt.f64 (+.f64 x 1)) (sqrt.f64 x)) (-.f64 (sqrt.f64 (+.f64 y 1)) (sqrt.f64 y))) Initial program 99.4%
associate-+l+99.4%
+-commutative99.4%
+-commutative99.4%
+-commutative99.4%
Simplified99.4%
flip--99.4%
add-sqr-sqrt68.7%
add-sqr-sqrt99.4%
Applied egg-rr99.4%
associate--l+99.6%
+-inverses99.6%
metadata-eval99.6%
Simplified99.6%
Final simplification66.6%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (+ (+ (/ 1.0 (+ (sqrt (+ 1.0 y)) (sqrt y))) (/ 1.0 (+ (sqrt (+ 1.0 x)) (sqrt x)))) (+ (- (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 + y)) + sqrt(y))) + (1.0 / (sqrt((1.0 + x)) + sqrt(x)))) + ((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 + y)) + sqrt(y))) + (1.0d0 / (sqrt((1.0d0 + x)) + sqrt(x)))) + ((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 + y)) + Math.sqrt(y))) + (1.0 / (Math.sqrt((1.0 + x)) + Math.sqrt(x)))) + ((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 + y)) + math.sqrt(y))) + (1.0 / (math.sqrt((1.0 + x)) + math.sqrt(x)))) + ((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 + y)) + sqrt(y))) + Float64(1.0 / Float64(sqrt(Float64(1.0 + x)) + sqrt(x)))) + 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 + y)) + sqrt(y))) + (1.0 / (sqrt((1.0 + x)) + sqrt(x)))) + ((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 + y), $MachinePrecision]], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $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 + y} + \sqrt{y}} + \frac{1}{\sqrt{1 + x} + \sqrt{x}}\right) + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\sqrt{1 + t} - \sqrt{t}\right)\right)
\end{array}
Initial program 93.6%
associate-+l+93.6%
+-commutative93.6%
+-commutative93.6%
+-commutative93.6%
Simplified93.6%
flip--93.6%
add-sqr-sqrt73.6%
+-commutative73.6%
add-sqr-sqrt93.9%
+-commutative93.9%
Applied egg-rr93.9%
associate--l+94.7%
+-inverses94.7%
metadata-eval94.7%
Simplified94.7%
flip--96.0%
add-sqr-sqrt78.8%
add-sqr-sqrt96.5%
Applied egg-rr95.5%
associate--l+98.0%
+-inverses98.0%
metadata-eval98.0%
Simplified96.9%
Final simplification96.9%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ 1.0 z))) (t_2 (/ 1.0 (+ (sqrt (+ 1.0 y)) (sqrt y)))))
(if (<= z 4e+31)
(+ (+ (- (sqrt (+ 1.0 t)) (sqrt t)) (/ 1.0 (+ t_1 (sqrt z)))) (+ 1.0 t_2))
(+ (+ t_2 (/ 1.0 (+ (sqrt (+ 1.0 x)) (sqrt x)))) (- t_1 (sqrt z))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + z));
double t_2 = 1.0 / (sqrt((1.0 + y)) + sqrt(y));
double tmp;
if (z <= 4e+31) {
tmp = ((sqrt((1.0 + t)) - sqrt(t)) + (1.0 / (t_1 + sqrt(z)))) + (1.0 + t_2);
} else {
tmp = (t_2 + (1.0 / (sqrt((1.0 + x)) + sqrt(x)))) + (t_1 - sqrt(z));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = sqrt((1.0d0 + z))
t_2 = 1.0d0 / (sqrt((1.0d0 + y)) + sqrt(y))
if (z <= 4d+31) then
tmp = ((sqrt((1.0d0 + t)) - sqrt(t)) + (1.0d0 / (t_1 + sqrt(z)))) + (1.0d0 + t_2)
else
tmp = (t_2 + (1.0d0 / (sqrt((1.0d0 + x)) + sqrt(x)))) + (t_1 - sqrt(z))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + z));
double t_2 = 1.0 / (Math.sqrt((1.0 + y)) + Math.sqrt(y));
double tmp;
if (z <= 4e+31) {
tmp = ((Math.sqrt((1.0 + t)) - Math.sqrt(t)) + (1.0 / (t_1 + Math.sqrt(z)))) + (1.0 + t_2);
} else {
tmp = (t_2 + (1.0 / (Math.sqrt((1.0 + x)) + Math.sqrt(x)))) + (t_1 - Math.sqrt(z));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + z)) t_2 = 1.0 / (math.sqrt((1.0 + y)) + math.sqrt(y)) tmp = 0 if z <= 4e+31: tmp = ((math.sqrt((1.0 + t)) - math.sqrt(t)) + (1.0 / (t_1 + math.sqrt(z)))) + (1.0 + t_2) else: tmp = (t_2 + (1.0 / (math.sqrt((1.0 + x)) + math.sqrt(x)))) + (t_1 - math.sqrt(z)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(1.0 + z)) t_2 = Float64(1.0 / Float64(sqrt(Float64(1.0 + y)) + sqrt(y))) tmp = 0.0 if (z <= 4e+31) tmp = Float64(Float64(Float64(sqrt(Float64(1.0 + t)) - sqrt(t)) + Float64(1.0 / Float64(t_1 + sqrt(z)))) + Float64(1.0 + t_2)); else tmp = Float64(Float64(t_2 + Float64(1.0 / Float64(sqrt(Float64(1.0 + x)) + sqrt(x)))) + Float64(t_1 - sqrt(z))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + z));
t_2 = 1.0 / (sqrt((1.0 + y)) + sqrt(y));
tmp = 0.0;
if (z <= 4e+31)
tmp = ((sqrt((1.0 + t)) - sqrt(t)) + (1.0 / (t_1 + sqrt(z)))) + (1.0 + t_2);
else
tmp = (t_2 + (1.0 / (sqrt((1.0 + x)) + sqrt(x)))) + (t_1 - sqrt(z));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(1.0 / N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, 4e+31], 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 + t$95$2), $MachinePrecision]), $MachinePrecision], N[(N[(t$95$2 + N[(1.0 / N[(N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$1 - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + z}\\
t_2 := \frac{1}{\sqrt{1 + y} + \sqrt{y}}\\
\mathbf{if}\;z \leq 4 \cdot 10^{+31}:\\
\;\;\;\;\left(\left(\sqrt{1 + t} - \sqrt{t}\right) + \frac{1}{t_1 + \sqrt{z}}\right) + \left(1 + t_2\right)\\
\mathbf{else}:\\
\;\;\;\;\left(t_2 + \frac{1}{\sqrt{1 + x} + \sqrt{x}}\right) + \left(t_1 - \sqrt{z}\right)\\
\end{array}
\end{array}
if z < 3.9999999999999999e31Initial program 94.7%
associate-+l+94.7%
+-commutative94.7%
+-commutative94.7%
+-commutative94.7%
Simplified94.7%
flip--94.7%
add-sqr-sqrt94.2%
add-sqr-sqrt95.3%
Applied egg-rr95.3%
associate--l+97.5%
+-inverses97.5%
metadata-eval97.5%
Simplified97.5%
flip--97.7%
add-sqr-sqrt79.4%
add-sqr-sqrt98.1%
Applied egg-rr98.1%
associate--l+98.8%
+-inverses98.8%
metadata-eval98.8%
Simplified98.8%
Taylor expanded in x around 0 55.2%
if 3.9999999999999999e31 < z Initial program 92.3%
associate-+l+92.3%
+-commutative92.3%
+-commutative92.3%
+-commutative92.3%
Simplified92.3%
flip--92.3%
add-sqr-sqrt73.1%
+-commutative73.1%
add-sqr-sqrt92.9%
+-commutative92.9%
Applied egg-rr92.9%
associate--l+94.1%
+-inverses94.1%
metadata-eval94.1%
Simplified94.1%
flip--94.1%
add-sqr-sqrt78.0%
add-sqr-sqrt94.5%
Applied egg-rr95.2%
associate--l+97.0%
+-inverses97.0%
metadata-eval97.0%
Simplified97.2%
Taylor expanded in t around inf 53.5%
Final simplification54.5%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (sqrt (+ 1.0 z)) (sqrt z)))
(t_2 (- (sqrt (+ 1.0 y)) (sqrt y))))
(if (<= t 5.8e+29)
(+ (+ 1.0 t_2) (+ t_1 (/ 1.0 (+ (sqrt (+ 1.0 t)) (sqrt t)))))
(+ t_1 (+ t_2 (/ 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 + z)) - sqrt(z);
double t_2 = sqrt((1.0 + y)) - sqrt(y);
double tmp;
if (t <= 5.8e+29) {
tmp = (1.0 + t_2) + (t_1 + (1.0 / (sqrt((1.0 + t)) + sqrt(t))));
} else {
tmp = t_1 + (t_2 + (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) :: t_2
real(8) :: tmp
t_1 = sqrt((1.0d0 + z)) - sqrt(z)
t_2 = sqrt((1.0d0 + y)) - sqrt(y)
if (t <= 5.8d+29) then
tmp = (1.0d0 + t_2) + (t_1 + (1.0d0 / (sqrt((1.0d0 + t)) + sqrt(t))))
else
tmp = t_1 + (t_2 + (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 + z)) - Math.sqrt(z);
double t_2 = Math.sqrt((1.0 + y)) - Math.sqrt(y);
double tmp;
if (t <= 5.8e+29) {
tmp = (1.0 + t_2) + (t_1 + (1.0 / (Math.sqrt((1.0 + t)) + Math.sqrt(t))));
} else {
tmp = t_1 + (t_2 + (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 + z)) - math.sqrt(z) t_2 = math.sqrt((1.0 + y)) - math.sqrt(y) tmp = 0 if t <= 5.8e+29: tmp = (1.0 + t_2) + (t_1 + (1.0 / (math.sqrt((1.0 + t)) + math.sqrt(t)))) else: tmp = t_1 + (t_2 + (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 = Float64(sqrt(Float64(1.0 + z)) - sqrt(z)) t_2 = Float64(sqrt(Float64(1.0 + y)) - sqrt(y)) tmp = 0.0 if (t <= 5.8e+29) tmp = Float64(Float64(1.0 + t_2) + Float64(t_1 + Float64(1.0 / Float64(sqrt(Float64(1.0 + t)) + sqrt(t))))); else tmp = Float64(t_1 + Float64(t_2 + 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 + z)) - sqrt(z);
t_2 = sqrt((1.0 + y)) - sqrt(y);
tmp = 0.0;
if (t <= 5.8e+29)
tmp = (1.0 + t_2) + (t_1 + (1.0 / (sqrt((1.0 + t)) + sqrt(t))));
else
tmp = t_1 + (t_2 + (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[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, 5.8e+29], N[(N[(1.0 + t$95$2), $MachinePrecision] + N[(t$95$1 + N[(1.0 / N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] + N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 + N[(t$95$2 + N[(1.0 / N[(N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + z} - \sqrt{z}\\
t_2 := \sqrt{1 + y} - \sqrt{y}\\
\mathbf{if}\;t \leq 5.8 \cdot 10^{+29}:\\
\;\;\;\;\left(1 + t_2\right) + \left(t_1 + \frac{1}{\sqrt{1 + t} + \sqrt{t}}\right)\\
\mathbf{else}:\\
\;\;\;\;t_1 + \left(t_2 + \frac{1}{\sqrt{1 + x} + \sqrt{x}}\right)\\
\end{array}
\end{array}
if t < 5.7999999999999999e29Initial program 96.5%
associate-+l+96.5%
+-commutative96.5%
+-commutative96.5%
+-commutative96.5%
Simplified96.5%
flip--96.5%
add-sqr-sqrt96.1%
+-commutative96.1%
add-sqr-sqrt96.9%
+-commutative96.9%
Applied egg-rr96.9%
+-commutative96.9%
+-commutative96.9%
associate--l+97.5%
+-inverses97.5%
metadata-eval97.5%
+-commutative97.5%
Simplified97.5%
Taylor expanded in x around 0 56.6%
if 5.7999999999999999e29 < t Initial program 90.7%
associate-+l+90.7%
+-commutative90.7%
+-commutative90.7%
+-commutative90.7%
Simplified90.7%
flip--90.7%
add-sqr-sqrt72.4%
+-commutative72.4%
add-sqr-sqrt90.9%
+-commutative90.9%
Applied egg-rr90.9%
associate--l+92.1%
+-inverses92.1%
metadata-eval92.1%
Simplified92.1%
Taylor expanded in t around inf 92.1%
Final simplification74.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 y)) (sqrt y))))
(if (<= z 3.1e+47)
(+ (+ (- (sqrt (+ 1.0 t)) (sqrt t)) (/ 1.0 (+ t_1 (sqrt z)))) (+ 1.0 t_2))
(+ (- t_1 (sqrt z)) (+ t_2 (/ 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 + z));
double t_2 = sqrt((1.0 + y)) - sqrt(y);
double tmp;
if (z <= 3.1e+47) {
tmp = ((sqrt((1.0 + t)) - sqrt(t)) + (1.0 / (t_1 + sqrt(z)))) + (1.0 + t_2);
} else {
tmp = (t_1 - sqrt(z)) + (t_2 + (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) :: t_2
real(8) :: tmp
t_1 = sqrt((1.0d0 + z))
t_2 = sqrt((1.0d0 + y)) - sqrt(y)
if (z <= 3.1d+47) then
tmp = ((sqrt((1.0d0 + t)) - sqrt(t)) + (1.0d0 / (t_1 + sqrt(z)))) + (1.0d0 + t_2)
else
tmp = (t_1 - sqrt(z)) + (t_2 + (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 + z));
double t_2 = Math.sqrt((1.0 + y)) - Math.sqrt(y);
double tmp;
if (z <= 3.1e+47) {
tmp = ((Math.sqrt((1.0 + t)) - Math.sqrt(t)) + (1.0 / (t_1 + Math.sqrt(z)))) + (1.0 + t_2);
} else {
tmp = (t_1 - Math.sqrt(z)) + (t_2 + (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 + z)) t_2 = math.sqrt((1.0 + y)) - math.sqrt(y) tmp = 0 if z <= 3.1e+47: tmp = ((math.sqrt((1.0 + t)) - math.sqrt(t)) + (1.0 / (t_1 + math.sqrt(z)))) + (1.0 + t_2) else: tmp = (t_1 - math.sqrt(z)) + (t_2 + (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 + z)) t_2 = Float64(sqrt(Float64(1.0 + y)) - sqrt(y)) tmp = 0.0 if (z <= 3.1e+47) tmp = Float64(Float64(Float64(sqrt(Float64(1.0 + t)) - sqrt(t)) + Float64(1.0 / Float64(t_1 + sqrt(z)))) + Float64(1.0 + t_2)); else tmp = Float64(Float64(t_1 - sqrt(z)) + Float64(t_2 + 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 + z));
t_2 = sqrt((1.0 + y)) - sqrt(y);
tmp = 0.0;
if (z <= 3.1e+47)
tmp = ((sqrt((1.0 + t)) - sqrt(t)) + (1.0 / (t_1 + sqrt(z)))) + (1.0 + t_2);
else
tmp = (t_1 - sqrt(z)) + (t_2 + (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 + z), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, 3.1e+47], 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 + t$95$2), $MachinePrecision]), $MachinePrecision], N[(N[(t$95$1 - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] + N[(t$95$2 + N[(1.0 / N[(N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + z}\\
t_2 := \sqrt{1 + y} - \sqrt{y}\\
\mathbf{if}\;z \leq 3.1 \cdot 10^{+47}:\\
\;\;\;\;\left(\left(\sqrt{1 + t} - \sqrt{t}\right) + \frac{1}{t_1 + \sqrt{z}}\right) + \left(1 + t_2\right)\\
\mathbf{else}:\\
\;\;\;\;\left(t_1 - \sqrt{z}\right) + \left(t_2 + \frac{1}{\sqrt{1 + x} + \sqrt{x}}\right)\\
\end{array}
\end{array}
if z < 3.1000000000000001e47Initial program 94.1%
associate-+l+94.1%
+-commutative94.1%
+-commutative94.1%
+-commutative94.1%
Simplified94.1%
flip--94.1%
add-sqr-sqrt92.5%
add-sqr-sqrt94.7%
Applied egg-rr94.7%
associate--l+96.9%
+-inverses96.9%
metadata-eval96.9%
Simplified96.9%
Taylor expanded in x around 0 55.1%
if 3.1000000000000001e47 < z Initial program 93.0%
associate-+l+93.0%
+-commutative93.0%
+-commutative93.0%
+-commutative93.0%
Simplified93.0%
flip--93.0%
add-sqr-sqrt73.6%
+-commutative73.6%
add-sqr-sqrt93.6%
+-commutative93.6%
Applied egg-rr93.6%
associate--l+94.8%
+-inverses94.8%
metadata-eval94.8%
Simplified94.8%
Taylor expanded in t around inf 50.9%
Final simplification53.3%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ 1.0 z))) (t_2 (- (sqrt (+ 1.0 y)) (sqrt y))))
(if (<= z 3.3e-9)
(+ (+ 1.0 t_2) (+ (- t_1 (sqrt z)) (/ 1.0 (+ (sqrt (+ 1.0 t)) (sqrt t)))))
(+
(/ 1.0 (+ t_1 (sqrt z)))
(+ t_2 (/ 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 + z));
double t_2 = sqrt((1.0 + y)) - sqrt(y);
double tmp;
if (z <= 3.3e-9) {
tmp = (1.0 + t_2) + ((t_1 - sqrt(z)) + (1.0 / (sqrt((1.0 + t)) + sqrt(t))));
} else {
tmp = (1.0 / (t_1 + sqrt(z))) + (t_2 + (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) :: t_2
real(8) :: tmp
t_1 = sqrt((1.0d0 + z))
t_2 = sqrt((1.0d0 + y)) - sqrt(y)
if (z <= 3.3d-9) then
tmp = (1.0d0 + t_2) + ((t_1 - sqrt(z)) + (1.0d0 / (sqrt((1.0d0 + t)) + sqrt(t))))
else
tmp = (1.0d0 / (t_1 + sqrt(z))) + (t_2 + (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 + z));
double t_2 = Math.sqrt((1.0 + y)) - Math.sqrt(y);
double tmp;
if (z <= 3.3e-9) {
tmp = (1.0 + t_2) + ((t_1 - Math.sqrt(z)) + (1.0 / (Math.sqrt((1.0 + t)) + Math.sqrt(t))));
} else {
tmp = (1.0 / (t_1 + Math.sqrt(z))) + (t_2 + (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 + z)) t_2 = math.sqrt((1.0 + y)) - math.sqrt(y) tmp = 0 if z <= 3.3e-9: tmp = (1.0 + t_2) + ((t_1 - math.sqrt(z)) + (1.0 / (math.sqrt((1.0 + t)) + math.sqrt(t)))) else: tmp = (1.0 / (t_1 + math.sqrt(z))) + (t_2 + (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 + z)) t_2 = Float64(sqrt(Float64(1.0 + y)) - sqrt(y)) tmp = 0.0 if (z <= 3.3e-9) tmp = Float64(Float64(1.0 + t_2) + Float64(Float64(t_1 - sqrt(z)) + Float64(1.0 / Float64(sqrt(Float64(1.0 + t)) + sqrt(t))))); else tmp = Float64(Float64(1.0 / Float64(t_1 + sqrt(z))) + Float64(t_2 + 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 + z));
t_2 = sqrt((1.0 + y)) - sqrt(y);
tmp = 0.0;
if (z <= 3.3e-9)
tmp = (1.0 + t_2) + ((t_1 - sqrt(z)) + (1.0 / (sqrt((1.0 + t)) + sqrt(t))));
else
tmp = (1.0 / (t_1 + sqrt(z))) + (t_2 + (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 + z), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, 3.3e-9], N[(N[(1.0 + t$95$2), $MachinePrecision] + N[(N[(t$95$1 - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] + N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[(t$95$1 + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$2 + N[(1.0 / N[(N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + z}\\
t_2 := \sqrt{1 + y} - \sqrt{y}\\
\mathbf{if}\;z \leq 3.3 \cdot 10^{-9}:\\
\;\;\;\;\left(1 + t_2\right) + \left(\left(t_1 - \sqrt{z}\right) + \frac{1}{\sqrt{1 + t} + \sqrt{t}}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{t_1 + \sqrt{z}} + \left(t_2 + \frac{1}{\sqrt{1 + x} + \sqrt{x}}\right)\\
\end{array}
\end{array}
if z < 3.30000000000000018e-9Initial program 97.6%
associate-+l+97.6%
+-commutative97.6%
+-commutative97.6%
+-commutative97.6%
Simplified97.6%
flip--97.6%
add-sqr-sqrt67.5%
+-commutative67.5%
add-sqr-sqrt97.6%
+-commutative97.6%
Applied egg-rr97.6%
+-commutative97.6%
+-commutative97.6%
associate--l+97.9%
+-inverses97.9%
metadata-eval97.9%
+-commutative97.9%
Simplified97.9%
Taylor expanded in x around 0 58.3%
if 3.30000000000000018e-9 < z Initial program 90.0%
associate-+l+90.0%
+-commutative90.0%
+-commutative90.0%
+-commutative90.0%
Simplified90.0%
flip--90.0%
add-sqr-sqrt71.7%
+-commutative71.7%
add-sqr-sqrt90.5%
+-commutative90.5%
Applied egg-rr90.5%
associate--l+91.5%
+-inverses91.5%
metadata-eval91.5%
Simplified91.5%
Taylor expanded in t around inf 48.2%
flip--90.0%
add-sqr-sqrt46.2%
add-sqr-sqrt90.6%
Applied egg-rr48.2%
associate--l+93.9%
+-inverses93.9%
metadata-eval93.9%
Simplified51.1%
Final simplification54.6%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ 1.0 z))) (t_2 (sqrt (+ 1.0 y))))
(if (<= z 2.5e+25)
(+
(+ (- (sqrt (+ 1.0 t)) (sqrt t)) (/ 1.0 (+ t_1 (sqrt z))))
(+ 1.0 (- t_2 (sqrt y))))
(+
(+ (/ 1.0 (+ t_2 (sqrt y))) (/ 1.0 (+ (sqrt (+ 1.0 x)) (sqrt x))))
(- t_1 (sqrt z))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + z));
double t_2 = sqrt((1.0 + y));
double tmp;
if (z <= 2.5e+25) {
tmp = ((sqrt((1.0 + t)) - sqrt(t)) + (1.0 / (t_1 + sqrt(z)))) + (1.0 + (t_2 - sqrt(y)));
} else {
tmp = ((1.0 / (t_2 + sqrt(y))) + (1.0 / (sqrt((1.0 + x)) + sqrt(x)))) + (t_1 - sqrt(z));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = sqrt((1.0d0 + z))
t_2 = sqrt((1.0d0 + y))
if (z <= 2.5d+25) then
tmp = ((sqrt((1.0d0 + t)) - sqrt(t)) + (1.0d0 / (t_1 + sqrt(z)))) + (1.0d0 + (t_2 - sqrt(y)))
else
tmp = ((1.0d0 / (t_2 + sqrt(y))) + (1.0d0 / (sqrt((1.0d0 + x)) + sqrt(x)))) + (t_1 - sqrt(z))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + z));
double t_2 = Math.sqrt((1.0 + y));
double tmp;
if (z <= 2.5e+25) {
tmp = ((Math.sqrt((1.0 + t)) - Math.sqrt(t)) + (1.0 / (t_1 + Math.sqrt(z)))) + (1.0 + (t_2 - Math.sqrt(y)));
} else {
tmp = ((1.0 / (t_2 + Math.sqrt(y))) + (1.0 / (Math.sqrt((1.0 + x)) + Math.sqrt(x)))) + (t_1 - Math.sqrt(z));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + z)) t_2 = math.sqrt((1.0 + y)) tmp = 0 if z <= 2.5e+25: tmp = ((math.sqrt((1.0 + t)) - math.sqrt(t)) + (1.0 / (t_1 + math.sqrt(z)))) + (1.0 + (t_2 - math.sqrt(y))) else: tmp = ((1.0 / (t_2 + math.sqrt(y))) + (1.0 / (math.sqrt((1.0 + x)) + math.sqrt(x)))) + (t_1 - math.sqrt(z)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(1.0 + z)) t_2 = sqrt(Float64(1.0 + y)) tmp = 0.0 if (z <= 2.5e+25) 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(y)))); else tmp = Float64(Float64(Float64(1.0 / Float64(t_2 + sqrt(y))) + Float64(1.0 / Float64(sqrt(Float64(1.0 + x)) + sqrt(x)))) + Float64(t_1 - sqrt(z))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + z));
t_2 = sqrt((1.0 + y));
tmp = 0.0;
if (z <= 2.5e+25)
tmp = ((sqrt((1.0 + t)) - sqrt(t)) + (1.0 / (t_1 + sqrt(z)))) + (1.0 + (t_2 - sqrt(y)));
else
tmp = ((1.0 / (t_2 + sqrt(y))) + (1.0 / (sqrt((1.0 + x)) + sqrt(x)))) + (t_1 - sqrt(z));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[z, 2.5e+25], 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[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 / N[(t$95$2 + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$1 - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + z}\\
t_2 := \sqrt{1 + y}\\
\mathbf{if}\;z \leq 2.5 \cdot 10^{+25}:\\
\;\;\;\;\left(\left(\sqrt{1 + t} - \sqrt{t}\right) + \frac{1}{t_1 + \sqrt{z}}\right) + \left(1 + \left(t_2 - \sqrt{y}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{1}{t_2 + \sqrt{y}} + \frac{1}{\sqrt{1 + x} + \sqrt{x}}\right) + \left(t_1 - \sqrt{z}\right)\\
\end{array}
\end{array}
if z < 2.50000000000000012e25Initial program 94.9%
associate-+l+94.9%
+-commutative94.9%
+-commutative94.9%
+-commutative94.9%
Simplified94.9%
flip--94.9%
add-sqr-sqrt94.9%
add-sqr-sqrt95.5%
Applied egg-rr95.5%
associate--l+97.7%
+-inverses97.7%
metadata-eval97.7%
Simplified97.7%
Taylor expanded in x around 0 55.5%
if 2.50000000000000012e25 < z Initial program 92.2%
associate-+l+92.2%
+-commutative92.2%
+-commutative92.2%
+-commutative92.2%
Simplified92.2%
flip--92.2%
add-sqr-sqrt73.2%
+-commutative73.2%
add-sqr-sqrt92.7%
+-commutative92.7%
Applied egg-rr92.7%
associate--l+93.8%
+-inverses93.8%
metadata-eval93.8%
Simplified93.8%
flip--93.9%
add-sqr-sqrt78.1%
add-sqr-sqrt94.4%
Applied egg-rr95.0%
associate--l+96.8%
+-inverses96.8%
metadata-eval96.8%
Simplified97.0%
Taylor expanded in t around inf 53.2%
Final simplification54.5%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(if (<= y 5.5e+14)
(+
(+ (- (sqrt (+ 1.0 z)) (sqrt z)) (- (sqrt (+ 1.0 t)) (sqrt t)))
(+ 1.0 (- (sqrt (+ 1.0 y)) (sqrt y))))
(/ 1.0 (+ (sqrt (+ 1.0 x)) (sqrt x)))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 5.5e+14) {
tmp = ((sqrt((1.0 + z)) - sqrt(z)) + (sqrt((1.0 + t)) - sqrt(t))) + (1.0 + (sqrt((1.0 + y)) - sqrt(y)));
} else {
tmp = 1.0 / (sqrt((1.0 + x)) + sqrt(x));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= 5.5d+14) then
tmp = ((sqrt((1.0d0 + z)) - sqrt(z)) + (sqrt((1.0d0 + t)) - sqrt(t))) + (1.0d0 + (sqrt((1.0d0 + y)) - sqrt(y)))
else
tmp = 1.0d0 / (sqrt((1.0d0 + x)) + sqrt(x))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= 5.5e+14) {
tmp = ((Math.sqrt((1.0 + z)) - Math.sqrt(z)) + (Math.sqrt((1.0 + t)) - Math.sqrt(t))) + (1.0 + (Math.sqrt((1.0 + y)) - Math.sqrt(y)));
} else {
tmp = 1.0 / (Math.sqrt((1.0 + x)) + Math.sqrt(x));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if y <= 5.5e+14: tmp = ((math.sqrt((1.0 + z)) - math.sqrt(z)) + (math.sqrt((1.0 + t)) - math.sqrt(t))) + (1.0 + (math.sqrt((1.0 + y)) - math.sqrt(y))) else: tmp = 1.0 / (math.sqrt((1.0 + x)) + math.sqrt(x)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (y <= 5.5e+14) tmp = Float64(Float64(Float64(sqrt(Float64(1.0 + z)) - sqrt(z)) + Float64(sqrt(Float64(1.0 + t)) - sqrt(t))) + Float64(1.0 + Float64(sqrt(Float64(1.0 + y)) - sqrt(y)))); else tmp = Float64(1.0 / Float64(sqrt(Float64(1.0 + x)) + sqrt(x))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (y <= 5.5e+14)
tmp = ((sqrt((1.0 + z)) - sqrt(z)) + (sqrt((1.0 + t)) - sqrt(t))) + (1.0 + (sqrt((1.0 + y)) - sqrt(y)));
else
tmp = 1.0 / (sqrt((1.0 + x)) + sqrt(x));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[y, 5.5e+14], N[(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] + N[(1.0 + N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 5.5 \cdot 10^{+14}:\\
\;\;\;\;\left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\sqrt{1 + t} - \sqrt{t}\right)\right) + \left(1 + \left(\sqrt{1 + y} - \sqrt{y}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{1 + x} + \sqrt{x}}\\
\end{array}
\end{array}
if y < 5.5e14Initial program 96.7%
associate-+l+96.7%
+-commutative96.7%
+-commutative96.7%
+-commutative96.7%
Simplified96.7%
Taylor expanded in x around 0 52.9%
if 5.5e14 < y Initial program 89.9%
+-commutative89.9%
associate-+r+89.9%
associate-+r-44.4%
associate-+l-24.4%
associate-+r-6.8%
Simplified6.3%
Taylor expanded in t around inf 3.3%
associate--l+21.9%
+-commutative21.9%
associate--l+26.0%
+-commutative26.0%
associate-+r+26.0%
Simplified26.0%
Taylor expanded in z around inf 21.9%
Taylor expanded in y around inf 21.2%
flip--21.2%
add-sqr-sqrt21.2%
add-sqr-sqrt21.2%
Applied egg-rr21.2%
associate--l+23.4%
+-inverses23.4%
metadata-eval23.4%
+-commutative23.4%
Simplified23.4%
Final simplification39.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)) (sqrt y)))
(t_2 (- (sqrt (+ 1.0 z)) (sqrt z))))
(if (<= z 5e+22)
(+ (+ t_2 (- (sqrt (+ 1.0 t)) (sqrt t))) (+ 1.0 t_1))
(+ t_2 (+ t_1 (/ 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)) - sqrt(y);
double t_2 = sqrt((1.0 + z)) - sqrt(z);
double tmp;
if (z <= 5e+22) {
tmp = (t_2 + (sqrt((1.0 + t)) - sqrt(t))) + (1.0 + t_1);
} else {
tmp = t_2 + (t_1 + (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) :: t_2
real(8) :: tmp
t_1 = sqrt((1.0d0 + y)) - sqrt(y)
t_2 = sqrt((1.0d0 + z)) - sqrt(z)
if (z <= 5d+22) then
tmp = (t_2 + (sqrt((1.0d0 + t)) - sqrt(t))) + (1.0d0 + t_1)
else
tmp = t_2 + (t_1 + (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)) - Math.sqrt(y);
double t_2 = Math.sqrt((1.0 + z)) - Math.sqrt(z);
double tmp;
if (z <= 5e+22) {
tmp = (t_2 + (Math.sqrt((1.0 + t)) - Math.sqrt(t))) + (1.0 + t_1);
} else {
tmp = t_2 + (t_1 + (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)) - math.sqrt(y) t_2 = math.sqrt((1.0 + z)) - math.sqrt(z) tmp = 0 if z <= 5e+22: tmp = (t_2 + (math.sqrt((1.0 + t)) - math.sqrt(t))) + (1.0 + t_1) else: tmp = t_2 + (t_1 + (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 = Float64(sqrt(Float64(1.0 + y)) - sqrt(y)) t_2 = Float64(sqrt(Float64(1.0 + z)) - sqrt(z)) tmp = 0.0 if (z <= 5e+22) tmp = Float64(Float64(t_2 + Float64(sqrt(Float64(1.0 + t)) - sqrt(t))) + Float64(1.0 + t_1)); else tmp = Float64(t_2 + Float64(t_1 + 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)) - sqrt(y);
t_2 = sqrt((1.0 + z)) - sqrt(z);
tmp = 0.0;
if (z <= 5e+22)
tmp = (t_2 + (sqrt((1.0 + t)) - sqrt(t))) + (1.0 + t_1);
else
tmp = t_2 + (t_1 + (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[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, 5e+22], N[(N[(t$95$2 + N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 + t$95$1), $MachinePrecision]), $MachinePrecision], N[(t$95$2 + N[(t$95$1 + N[(1.0 / N[(N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + y} - \sqrt{y}\\
t_2 := \sqrt{1 + z} - \sqrt{z}\\
\mathbf{if}\;z \leq 5 \cdot 10^{+22}:\\
\;\;\;\;\left(t_2 + \left(\sqrt{1 + t} - \sqrt{t}\right)\right) + \left(1 + t_1\right)\\
\mathbf{else}:\\
\;\;\;\;t_2 + \left(t_1 + \frac{1}{\sqrt{1 + x} + \sqrt{x}}\right)\\
\end{array}
\end{array}
if z < 4.9999999999999996e22Initial program 95.8%
associate-+l+95.8%
+-commutative95.8%
+-commutative95.8%
+-commutative95.8%
Simplified95.8%
Taylor expanded in x around 0 56.0%
if 4.9999999999999996e22 < z Initial program 91.3%
associate-+l+91.3%
+-commutative91.3%
+-commutative91.3%
+-commutative91.3%
Simplified91.3%
flip--91.2%
add-sqr-sqrt72.9%
+-commutative72.9%
add-sqr-sqrt91.8%
+-commutative91.8%
Applied egg-rr91.8%
associate--l+92.9%
+-inverses92.9%
metadata-eval92.9%
Simplified92.9%
Taylor expanded in t around inf 49.0%
Final simplification52.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 6e+20)
(+
(- (sqrt (+ 1.0 z)) (sqrt z))
(+ (- (sqrt (+ 1.0 y)) (sqrt y)) (/ 1.0 (+ (sqrt x) (+ 1.0 (* x 0.5))))))
(/ 1.0 (+ (sqrt (+ 1.0 x)) (sqrt x)))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 6e+20) {
tmp = (sqrt((1.0 + z)) - sqrt(z)) + ((sqrt((1.0 + y)) - sqrt(y)) + (1.0 / (sqrt(x) + (1.0 + (x * 0.5)))));
} else {
tmp = 1.0 / (sqrt((1.0 + x)) + sqrt(x));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= 6d+20) then
tmp = (sqrt((1.0d0 + z)) - sqrt(z)) + ((sqrt((1.0d0 + y)) - sqrt(y)) + (1.0d0 / (sqrt(x) + (1.0d0 + (x * 0.5d0)))))
else
tmp = 1.0d0 / (sqrt((1.0d0 + x)) + sqrt(x))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= 6e+20) {
tmp = (Math.sqrt((1.0 + z)) - Math.sqrt(z)) + ((Math.sqrt((1.0 + y)) - Math.sqrt(y)) + (1.0 / (Math.sqrt(x) + (1.0 + (x * 0.5)))));
} else {
tmp = 1.0 / (Math.sqrt((1.0 + x)) + Math.sqrt(x));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if y <= 6e+20: tmp = (math.sqrt((1.0 + z)) - math.sqrt(z)) + ((math.sqrt((1.0 + y)) - math.sqrt(y)) + (1.0 / (math.sqrt(x) + (1.0 + (x * 0.5))))) else: tmp = 1.0 / (math.sqrt((1.0 + x)) + math.sqrt(x)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (y <= 6e+20) tmp = Float64(Float64(sqrt(Float64(1.0 + z)) - sqrt(z)) + Float64(Float64(sqrt(Float64(1.0 + y)) - sqrt(y)) + Float64(1.0 / Float64(sqrt(x) + Float64(1.0 + Float64(x * 0.5)))))); else tmp = Float64(1.0 / Float64(sqrt(Float64(1.0 + x)) + sqrt(x))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (y <= 6e+20)
tmp = (sqrt((1.0 + z)) - sqrt(z)) + ((sqrt((1.0 + y)) - sqrt(y)) + (1.0 / (sqrt(x) + (1.0 + (x * 0.5)))));
else
tmp = 1.0 / (sqrt((1.0 + x)) + sqrt(x));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[y, 6e+20], N[(N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] + N[(N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + N[(1.0 + N[(x * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 6 \cdot 10^{+20}:\\
\;\;\;\;\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\left(\sqrt{1 + y} - \sqrt{y}\right) + \frac{1}{\sqrt{x} + \left(1 + x \cdot 0.5\right)}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{1 + x} + \sqrt{x}}\\
\end{array}
\end{array}
if y < 6e20Initial program 95.8%
associate-+l+95.8%
+-commutative95.8%
+-commutative95.8%
+-commutative95.8%
Simplified95.8%
flip--95.7%
add-sqr-sqrt74.4%
+-commutative74.4%
add-sqr-sqrt96.2%
+-commutative96.2%
Applied egg-rr96.2%
associate--l+96.6%
+-inverses96.6%
metadata-eval96.6%
Simplified96.6%
Taylor expanded in t around inf 60.7%
Taylor expanded in x around 0 60.1%
if 6e20 < y Initial program 90.9%
+-commutative90.9%
associate-+r+90.9%
associate-+r-44.3%
associate-+l-23.7%
associate-+r-5.6%
Simplified5.1%
Taylor expanded in t around inf 3.3%
associate--l+22.4%
+-commutative22.4%
associate--l+26.5%
+-commutative26.5%
associate-+r+26.5%
Simplified26.5%
Taylor expanded in z around inf 22.4%
Taylor expanded in y around inf 21.6%
flip--21.6%
add-sqr-sqrt21.7%
add-sqr-sqrt21.6%
Applied egg-rr21.6%
associate--l+23.9%
+-inverses23.9%
metadata-eval23.9%
+-commutative23.9%
Simplified23.9%
Final simplification44.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.38e-14)
(+ 2.0 (- (- (sqrt (+ 1.0 z)) (sqrt z)) (sqrt y)))
(if (<= y 1e+18)
(+ t_1 (- (sqrt (+ 1.0 y)) (+ (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.38e-14) {
tmp = 2.0 + ((sqrt((1.0 + z)) - sqrt(z)) - sqrt(y));
} else if (y <= 1e+18) {
tmp = t_1 + (sqrt((1.0 + y)) - (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.38d-14) then
tmp = 2.0d0 + ((sqrt((1.0d0 + z)) - sqrt(z)) - sqrt(y))
else if (y <= 1d+18) then
tmp = t_1 + (sqrt((1.0d0 + y)) - (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.38e-14) {
tmp = 2.0 + ((Math.sqrt((1.0 + z)) - Math.sqrt(z)) - Math.sqrt(y));
} else if (y <= 1e+18) {
tmp = t_1 + (Math.sqrt((1.0 + y)) - (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.38e-14: tmp = 2.0 + ((math.sqrt((1.0 + z)) - math.sqrt(z)) - math.sqrt(y)) elif y <= 1e+18: tmp = t_1 + (math.sqrt((1.0 + y)) - (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.38e-14) tmp = Float64(2.0 + Float64(Float64(sqrt(Float64(1.0 + z)) - sqrt(z)) - sqrt(y))); elseif (y <= 1e+18) tmp = Float64(t_1 + Float64(sqrt(Float64(1.0 + y)) - Float64(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.38e-14)
tmp = 2.0 + ((sqrt((1.0 + z)) - sqrt(z)) - sqrt(y));
elseif (y <= 1e+18)
tmp = t_1 + (sqrt((1.0 + y)) - (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.38e-14], N[(2.0 + N[(N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1e+18], N[(t$95$1 + N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] - N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $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.38 \cdot 10^{-14}:\\
\;\;\;\;2 + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) - \sqrt{y}\right)\\
\mathbf{elif}\;y \leq 10^{+18}:\\
\;\;\;\;t_1 + \left(\sqrt{1 + y} - \left(\sqrt{x} + \sqrt{y}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{t_1 + \sqrt{x}}\\
\end{array}
\end{array}
if y < 1.38000000000000002e-14Initial program 98.0%
+-commutative98.0%
associate-+r+98.0%
associate-+r-98.0%
associate-+l-98.0%
associate-+r-98.0%
Simplified75.1%
Taylor expanded in t around inf 18.4%
associate--l+23.3%
+-commutative23.3%
associate--l+23.3%
+-commutative23.3%
associate-+r+23.3%
Simplified23.3%
Taylor expanded in x around 0 30.3%
Taylor expanded in y around 0 30.3%
associate--l+46.9%
Applied egg-rr46.9%
associate--l+57.3%
associate-+r+57.3%
metadata-eval57.3%
+-commutative57.3%
associate--r+57.8%
Simplified57.8%
if 1.38000000000000002e-14 < y < 1e18Initial program 82.2%
+-commutative82.2%
associate-+r+82.2%
associate-+r-82.1%
associate-+l-82.0%
associate-+r-82.1%
Simplified77.8%
Taylor expanded in t around inf 15.3%
associate--l+17.4%
+-commutative17.4%
associate--l+17.4%
+-commutative17.4%
associate-+r+17.4%
Simplified17.4%
Taylor expanded in z around inf 14.1%
if 1e18 < y Initial program 90.9%
+-commutative90.9%
associate-+r+90.9%
associate-+r-44.3%
associate-+l-23.7%
associate-+r-5.6%
Simplified5.1%
Taylor expanded in t around inf 3.3%
associate--l+22.4%
+-commutative22.4%
associate--l+26.5%
+-commutative26.5%
associate-+r+26.5%
Simplified26.5%
Taylor expanded in z around inf 22.4%
Taylor expanded in y around inf 21.6%
flip--21.6%
add-sqr-sqrt21.7%
add-sqr-sqrt21.6%
Applied egg-rr21.6%
associate--l+23.9%
+-inverses23.9%
metadata-eval23.9%
+-commutative23.9%
Simplified23.9%
Final simplification39.4%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ 1.0 x))))
(if (<= y 9.6e-15)
(+ 2.0 (- (- (sqrt (+ 1.0 z)) (sqrt z)) (sqrt y)))
(if (<= y 1e+18)
(+ t_1 (- (- (sqrt (+ 1.0 y)) (sqrt y)) (sqrt x)))
(/ 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 <= 9.6e-15) {
tmp = 2.0 + ((sqrt((1.0 + z)) - sqrt(z)) - sqrt(y));
} else if (y <= 1e+18) {
tmp = t_1 + ((sqrt((1.0 + y)) - sqrt(y)) - sqrt(x));
} 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 <= 9.6d-15) then
tmp = 2.0d0 + ((sqrt((1.0d0 + z)) - sqrt(z)) - sqrt(y))
else if (y <= 1d+18) then
tmp = t_1 + ((sqrt((1.0d0 + y)) - sqrt(y)) - sqrt(x))
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 <= 9.6e-15) {
tmp = 2.0 + ((Math.sqrt((1.0 + z)) - Math.sqrt(z)) - Math.sqrt(y));
} else if (y <= 1e+18) {
tmp = t_1 + ((Math.sqrt((1.0 + y)) - Math.sqrt(y)) - Math.sqrt(x));
} 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 <= 9.6e-15: tmp = 2.0 + ((math.sqrt((1.0 + z)) - math.sqrt(z)) - math.sqrt(y)) elif y <= 1e+18: tmp = t_1 + ((math.sqrt((1.0 + y)) - math.sqrt(y)) - math.sqrt(x)) 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 <= 9.6e-15) tmp = Float64(2.0 + Float64(Float64(sqrt(Float64(1.0 + z)) - sqrt(z)) - sqrt(y))); elseif (y <= 1e+18) tmp = Float64(t_1 + Float64(Float64(sqrt(Float64(1.0 + y)) - sqrt(y)) - sqrt(x))); 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 <= 9.6e-15)
tmp = 2.0 + ((sqrt((1.0 + z)) - sqrt(z)) - sqrt(y));
elseif (y <= 1e+18)
tmp = t_1 + ((sqrt((1.0 + y)) - sqrt(y)) - sqrt(x));
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, 9.6e-15], N[(2.0 + N[(N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1e+18], N[(t$95$1 + N[(N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision] - N[Sqrt[x], $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 9.6 \cdot 10^{-15}:\\
\;\;\;\;2 + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) - \sqrt{y}\right)\\
\mathbf{elif}\;y \leq 10^{+18}:\\
\;\;\;\;t_1 + \left(\left(\sqrt{1 + y} - \sqrt{y}\right) - \sqrt{x}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{t_1 + \sqrt{x}}\\
\end{array}
\end{array}
if y < 9.5999999999999998e-15Initial program 98.0%
+-commutative98.0%
associate-+r+98.0%
associate-+r-98.0%
associate-+l-98.0%
associate-+r-98.0%
Simplified75.1%
Taylor expanded in t around inf 18.4%
associate--l+23.3%
+-commutative23.3%
associate--l+23.3%
+-commutative23.3%
associate-+r+23.3%
Simplified23.3%
Taylor expanded in x around 0 30.3%
Taylor expanded in y around 0 30.3%
associate--l+46.9%
Applied egg-rr46.9%
associate--l+57.3%
associate-+r+57.3%
metadata-eval57.3%
+-commutative57.3%
associate--r+57.8%
Simplified57.8%
if 9.5999999999999998e-15 < y < 1e18Initial program 82.2%
+-commutative82.2%
associate-+r+82.2%
associate-+r-82.1%
associate-+l-82.0%
associate-+r-82.1%
Simplified77.8%
Taylor expanded in t around inf 15.3%
associate--l+17.4%
+-commutative17.4%
associate--l+17.4%
+-commutative17.4%
associate-+r+17.4%
Simplified17.4%
Taylor expanded in z around inf 14.1%
sub-neg14.1%
+-commutative14.1%
Applied egg-rr14.1%
sub-neg14.1%
associate--r+14.1%
Simplified14.1%
if 1e18 < y Initial program 90.9%
+-commutative90.9%
associate-+r+90.9%
associate-+r-44.3%
associate-+l-23.7%
associate-+r-5.6%
Simplified5.1%
Taylor expanded in t around inf 3.3%
associate--l+22.4%
+-commutative22.4%
associate--l+26.5%
+-commutative26.5%
associate-+r+26.5%
Simplified26.5%
Taylor expanded in z around inf 22.4%
Taylor expanded in y around inf 21.6%
flip--21.6%
add-sqr-sqrt21.7%
add-sqr-sqrt21.6%
Applied egg-rr21.6%
associate--l+23.9%
+-inverses23.9%
metadata-eval23.9%
+-commutative23.9%
Simplified23.9%
Final simplification39.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 9e-24)
(+ 2.0 (- (sqrt (+ 1.0 z)) (+ (sqrt y) (sqrt z))))
(if (<= y 5.5e+14)
(+ 1.0 (- (sqrt (+ 1.0 y)) (sqrt y)))
(/ 1.0 (+ (sqrt (+ 1.0 x)) (sqrt x))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 9e-24) {
tmp = 2.0 + (sqrt((1.0 + z)) - (sqrt(y) + sqrt(z)));
} else if (y <= 5.5e+14) {
tmp = 1.0 + (sqrt((1.0 + y)) - sqrt(y));
} else {
tmp = 1.0 / (sqrt((1.0 + x)) + sqrt(x));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= 9d-24) then
tmp = 2.0d0 + (sqrt((1.0d0 + z)) - (sqrt(y) + sqrt(z)))
else if (y <= 5.5d+14) then
tmp = 1.0d0 + (sqrt((1.0d0 + y)) - sqrt(y))
else
tmp = 1.0d0 / (sqrt((1.0d0 + x)) + sqrt(x))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= 9e-24) {
tmp = 2.0 + (Math.sqrt((1.0 + z)) - (Math.sqrt(y) + Math.sqrt(z)));
} else if (y <= 5.5e+14) {
tmp = 1.0 + (Math.sqrt((1.0 + y)) - Math.sqrt(y));
} else {
tmp = 1.0 / (Math.sqrt((1.0 + x)) + Math.sqrt(x));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if y <= 9e-24: tmp = 2.0 + (math.sqrt((1.0 + z)) - (math.sqrt(y) + math.sqrt(z))) elif y <= 5.5e+14: tmp = 1.0 + (math.sqrt((1.0 + y)) - math.sqrt(y)) else: tmp = 1.0 / (math.sqrt((1.0 + x)) + math.sqrt(x)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (y <= 9e-24) tmp = Float64(2.0 + Float64(sqrt(Float64(1.0 + z)) - Float64(sqrt(y) + sqrt(z)))); elseif (y <= 5.5e+14) tmp = Float64(1.0 + Float64(sqrt(Float64(1.0 + y)) - sqrt(y))); else tmp = Float64(1.0 / Float64(sqrt(Float64(1.0 + x)) + sqrt(x))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (y <= 9e-24)
tmp = 2.0 + (sqrt((1.0 + z)) - (sqrt(y) + sqrt(z)));
elseif (y <= 5.5e+14)
tmp = 1.0 + (sqrt((1.0 + y)) - sqrt(y));
else
tmp = 1.0 / (sqrt((1.0 + x)) + sqrt(x));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[y, 9e-24], N[(2.0 + N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 5.5e+14], N[(1.0 + N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 9 \cdot 10^{-24}:\\
\;\;\;\;2 + \left(\sqrt{1 + z} - \left(\sqrt{y} + \sqrt{z}\right)\right)\\
\mathbf{elif}\;y \leq 5.5 \cdot 10^{+14}:\\
\;\;\;\;1 + \left(\sqrt{1 + y} - \sqrt{y}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{1 + x} + \sqrt{x}}\\
\end{array}
\end{array}
if y < 8.9999999999999995e-24Initial program 97.9%
+-commutative97.9%
associate-+r+97.9%
associate-+r-97.9%
associate-+l-97.9%
associate-+r-97.9%
Simplified75.4%
Taylor expanded in t around inf 18.7%
associate--l+23.5%
+-commutative23.5%
associate--l+23.5%
+-commutative23.5%
associate-+r+23.5%
Simplified23.5%
Taylor expanded in x around 0 30.7%
Taylor expanded in y around 0 30.7%
associate--l+47.3%
Applied egg-rr47.3%
associate--l+57.6%
associate-+r+57.6%
metadata-eval57.6%
Simplified57.6%
if 8.9999999999999995e-24 < y < 5.5e14Initial program 88.8%
+-commutative88.8%
associate-+r+88.8%
associate-+r-88.7%
associate-+l-88.7%
associate-+r-88.9%
Simplified80.0%
Taylor expanded in t around inf 15.9%
associate--l+18.8%
+-commutative18.8%
associate--l+18.8%
+-commutative18.8%
associate-+r+18.8%
Simplified18.8%
Taylor expanded in z around inf 19.8%
Taylor expanded in x around 0 53.5%
associate--l+53.5%
Simplified53.5%
if 5.5e14 < y Initial program 89.9%
+-commutative89.9%
associate-+r+89.9%
associate-+r-44.4%
associate-+l-24.4%
associate-+r-6.8%
Simplified6.3%
Taylor expanded in t around inf 3.3%
associate--l+21.9%
+-commutative21.9%
associate--l+26.0%
+-commutative26.0%
associate-+r+26.0%
Simplified26.0%
Taylor expanded in z around inf 21.9%
Taylor expanded in y around inf 21.2%
flip--21.2%
add-sqr-sqrt21.2%
add-sqr-sqrt21.2%
Applied egg-rr21.2%
associate--l+23.4%
+-inverses23.4%
metadata-eval23.4%
+-commutative23.4%
Simplified23.4%
Final simplification41.8%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(if (<= y 1.38e-14)
(+ 2.0 (- (- (sqrt (+ 1.0 z)) (sqrt z)) (sqrt y)))
(if (<= y 5.5e+14)
(+ 1.0 (- (sqrt (+ 1.0 y)) (sqrt y)))
(/ 1.0 (+ (sqrt (+ 1.0 x)) (sqrt x))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 1.38e-14) {
tmp = 2.0 + ((sqrt((1.0 + z)) - sqrt(z)) - sqrt(y));
} else if (y <= 5.5e+14) {
tmp = 1.0 + (sqrt((1.0 + y)) - sqrt(y));
} else {
tmp = 1.0 / (sqrt((1.0 + x)) + sqrt(x));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= 1.38d-14) then
tmp = 2.0d0 + ((sqrt((1.0d0 + z)) - sqrt(z)) - sqrt(y))
else if (y <= 5.5d+14) then
tmp = 1.0d0 + (sqrt((1.0d0 + y)) - sqrt(y))
else
tmp = 1.0d0 / (sqrt((1.0d0 + x)) + sqrt(x))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= 1.38e-14) {
tmp = 2.0 + ((Math.sqrt((1.0 + z)) - Math.sqrt(z)) - Math.sqrt(y));
} else if (y <= 5.5e+14) {
tmp = 1.0 + (Math.sqrt((1.0 + y)) - Math.sqrt(y));
} else {
tmp = 1.0 / (Math.sqrt((1.0 + x)) + Math.sqrt(x));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if y <= 1.38e-14: tmp = 2.0 + ((math.sqrt((1.0 + z)) - math.sqrt(z)) - math.sqrt(y)) elif y <= 5.5e+14: tmp = 1.0 + (math.sqrt((1.0 + y)) - math.sqrt(y)) else: tmp = 1.0 / (math.sqrt((1.0 + x)) + math.sqrt(x)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (y <= 1.38e-14) tmp = Float64(2.0 + Float64(Float64(sqrt(Float64(1.0 + z)) - sqrt(z)) - sqrt(y))); elseif (y <= 5.5e+14) tmp = Float64(1.0 + Float64(sqrt(Float64(1.0 + y)) - sqrt(y))); else tmp = Float64(1.0 / Float64(sqrt(Float64(1.0 + x)) + sqrt(x))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (y <= 1.38e-14)
tmp = 2.0 + ((sqrt((1.0 + z)) - sqrt(z)) - sqrt(y));
elseif (y <= 5.5e+14)
tmp = 1.0 + (sqrt((1.0 + y)) - sqrt(y));
else
tmp = 1.0 / (sqrt((1.0 + x)) + sqrt(x));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[y, 1.38e-14], N[(2.0 + N[(N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 5.5e+14], N[(1.0 + N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 1.38 \cdot 10^{-14}:\\
\;\;\;\;2 + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) - \sqrt{y}\right)\\
\mathbf{elif}\;y \leq 5.5 \cdot 10^{+14}:\\
\;\;\;\;1 + \left(\sqrt{1 + y} - \sqrt{y}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{1 + x} + \sqrt{x}}\\
\end{array}
\end{array}
if y < 1.38000000000000002e-14Initial program 98.0%
+-commutative98.0%
associate-+r+98.0%
associate-+r-98.0%
associate-+l-98.0%
associate-+r-98.0%
Simplified75.1%
Taylor expanded in t around inf 18.4%
associate--l+23.3%
+-commutative23.3%
associate--l+23.3%
+-commutative23.3%
associate-+r+23.3%
Simplified23.3%
Taylor expanded in x around 0 30.3%
Taylor expanded in y around 0 30.3%
associate--l+46.9%
Applied egg-rr46.9%
associate--l+57.3%
associate-+r+57.3%
metadata-eval57.3%
+-commutative57.3%
associate--r+57.8%
Simplified57.8%
if 1.38000000000000002e-14 < y < 5.5e14Initial program 87.6%
+-commutative87.6%
associate-+r+87.6%
associate-+r-87.5%
associate-+l-87.5%
associate-+r-87.7%
Simplified82.6%
Taylor expanded in t around inf 17.4%
associate--l+19.7%
+-commutative19.7%
associate--l+19.7%
+-commutative19.7%
associate-+r+19.7%
Simplified19.7%
Taylor expanded in z around inf 16.1%
Taylor expanded in x around 0 52.8%
associate--l+52.8%
Simplified52.8%
if 5.5e14 < y Initial program 89.9%
+-commutative89.9%
associate-+r+89.9%
associate-+r-44.4%
associate-+l-24.4%
associate-+r-6.8%
Simplified6.3%
Taylor expanded in t around inf 3.3%
associate--l+21.9%
+-commutative21.9%
associate--l+26.0%
+-commutative26.0%
associate-+r+26.0%
Simplified26.0%
Taylor expanded in z around inf 21.9%
Taylor expanded in y around inf 21.2%
flip--21.2%
add-sqr-sqrt21.2%
add-sqr-sqrt21.2%
Applied egg-rr21.2%
associate--l+23.4%
+-inverses23.4%
metadata-eval23.4%
+-commutative23.4%
Simplified23.4%
Final simplification41.9%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(if (<= y 1e-23)
(+ (- (sqrt (+ 1.0 z)) (sqrt z)) 2.0)
(if (<= y 5.5e+14)
(+ 1.0 (- (sqrt (+ 1.0 y)) (sqrt y)))
(/ 1.0 (+ (sqrt (+ 1.0 x)) (sqrt x))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 1e-23) {
tmp = (sqrt((1.0 + z)) - sqrt(z)) + 2.0;
} else if (y <= 5.5e+14) {
tmp = 1.0 + (sqrt((1.0 + y)) - sqrt(y));
} else {
tmp = 1.0 / (sqrt((1.0 + x)) + sqrt(x));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= 1d-23) then
tmp = (sqrt((1.0d0 + z)) - sqrt(z)) + 2.0d0
else if (y <= 5.5d+14) then
tmp = 1.0d0 + (sqrt((1.0d0 + y)) - sqrt(y))
else
tmp = 1.0d0 / (sqrt((1.0d0 + x)) + sqrt(x))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= 1e-23) {
tmp = (Math.sqrt((1.0 + z)) - Math.sqrt(z)) + 2.0;
} else if (y <= 5.5e+14) {
tmp = 1.0 + (Math.sqrt((1.0 + y)) - Math.sqrt(y));
} else {
tmp = 1.0 / (Math.sqrt((1.0 + x)) + Math.sqrt(x));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if y <= 1e-23: tmp = (math.sqrt((1.0 + z)) - math.sqrt(z)) + 2.0 elif y <= 5.5e+14: tmp = 1.0 + (math.sqrt((1.0 + y)) - math.sqrt(y)) else: tmp = 1.0 / (math.sqrt((1.0 + x)) + math.sqrt(x)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (y <= 1e-23) tmp = Float64(Float64(sqrt(Float64(1.0 + z)) - sqrt(z)) + 2.0); elseif (y <= 5.5e+14) tmp = Float64(1.0 + Float64(sqrt(Float64(1.0 + y)) - sqrt(y))); else tmp = Float64(1.0 / Float64(sqrt(Float64(1.0 + x)) + sqrt(x))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (y <= 1e-23)
tmp = (sqrt((1.0 + z)) - sqrt(z)) + 2.0;
elseif (y <= 5.5e+14)
tmp = 1.0 + (sqrt((1.0 + y)) - sqrt(y));
else
tmp = 1.0 / (sqrt((1.0 + x)) + sqrt(x));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[y, 1e-23], N[(N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision], If[LessEqual[y, 5.5e+14], N[(1.0 + N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 10^{-23}:\\
\;\;\;\;\left(\sqrt{1 + z} - \sqrt{z}\right) + 2\\
\mathbf{elif}\;y \leq 5.5 \cdot 10^{+14}:\\
\;\;\;\;1 + \left(\sqrt{1 + y} - \sqrt{y}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{1 + x} + \sqrt{x}}\\
\end{array}
\end{array}
if y < 9.9999999999999996e-24Initial program 97.9%
+-commutative97.9%
associate-+r+97.9%
associate-+r-97.9%
associate-+l-97.9%
associate-+r-97.9%
Simplified75.4%
Taylor expanded in t around inf 18.7%
associate--l+23.5%
+-commutative23.5%
associate--l+23.5%
+-commutative23.5%
associate-+r+23.5%
Simplified23.5%
Taylor expanded in x around 0 30.7%
Taylor expanded in y around 0 30.7%
associate--l+57.6%
Simplified57.6%
if 9.9999999999999996e-24 < y < 5.5e14Initial program 88.8%
+-commutative88.8%
associate-+r+88.8%
associate-+r-88.7%
associate-+l-88.7%
associate-+r-88.9%
Simplified80.0%
Taylor expanded in t around inf 15.9%
associate--l+18.8%
+-commutative18.8%
associate--l+18.8%
+-commutative18.8%
associate-+r+18.8%
Simplified18.8%
Taylor expanded in z around inf 19.8%
Taylor expanded in x around 0 53.5%
associate--l+53.5%
Simplified53.5%
if 5.5e14 < y Initial program 89.9%
+-commutative89.9%
associate-+r+89.9%
associate-+r-44.4%
associate-+l-24.4%
associate-+r-6.8%
Simplified6.3%
Taylor expanded in t around inf 3.3%
associate--l+21.9%
+-commutative21.9%
associate--l+26.0%
+-commutative26.0%
associate-+r+26.0%
Simplified26.0%
Taylor expanded in z around inf 21.9%
Taylor expanded in y around inf 21.2%
flip--21.2%
add-sqr-sqrt21.2%
add-sqr-sqrt21.2%
Applied egg-rr21.2%
associate--l+23.4%
+-inverses23.4%
metadata-eval23.4%
+-commutative23.4%
Simplified23.4%
Final simplification41.8%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= y 1.05e-198) (- 3.0 (sqrt y)) (if (<= y 1.5) (- 2.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 <= 1.05e-198) {
tmp = 3.0 - sqrt(y);
} else if (y <= 1.5) {
tmp = 2.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 <= 1.05d-198) then
tmp = 3.0d0 - sqrt(y)
else if (y <= 1.5d0) then
tmp = 2.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 <= 1.05e-198) {
tmp = 3.0 - Math.sqrt(y);
} else if (y <= 1.5) {
tmp = 2.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 <= 1.05e-198: tmp = 3.0 - math.sqrt(y) elif y <= 1.5: tmp = 2.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 <= 1.05e-198) tmp = Float64(3.0 - sqrt(y)); elseif (y <= 1.5) tmp = Float64(2.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 <= 1.05e-198)
tmp = 3.0 - sqrt(y);
elseif (y <= 1.5)
tmp = 2.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, 1.05e-198], N[(3.0 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.5], N[(2.0 - 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 1.05 \cdot 10^{-198}:\\
\;\;\;\;3 - \sqrt{y}\\
\mathbf{elif}\;y \leq 1.5:\\
\;\;\;\;2 - \sqrt{y}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{1 + x} - \sqrt{x}\\
\end{array}
\end{array}
if y < 1.04999999999999996e-198Initial program 99.2%
+-commutative99.2%
associate-+r+99.2%
associate-+r-99.2%
associate-+l-99.2%
associate-+r-99.2%
Simplified74.8%
Taylor expanded in t around inf 13.0%
associate--l+18.6%
+-commutative18.6%
associate--l+18.6%
+-commutative18.6%
associate-+r+18.6%
Simplified18.6%
Taylor expanded in x around 0 29.9%
Taylor expanded in y around 0 29.9%
Taylor expanded in z around 0 53.4%
if 1.04999999999999996e-198 < y < 1.5Initial program 96.7%
+-commutative96.7%
associate-+r+96.7%
associate-+r-96.7%
associate-+l-96.7%
associate-+r-96.6%
Simplified77.2%
Taylor expanded in t around inf 21.2%
associate--l+25.5%
+-commutative25.5%
associate--l+25.5%
+-commutative25.5%
associate-+r+25.5%
Simplified25.5%
Taylor expanded in x around 0 29.4%
Taylor expanded in y around 0 29.3%
Taylor expanded in z around inf 54.3%
if 1.5 < y Initial program 89.4%
+-commutative89.4%
associate-+r+89.4%
associate-+r-46.5%
associate-+l-27.6%
associate-+r-11.0%
Simplified9.9%
Taylor expanded in t around inf 4.0%
associate--l+21.8%
+-commutative21.8%
associate--l+25.5%
+-commutative25.5%
associate-+r+25.5%
Simplified25.5%
Taylor expanded in z around inf 21.9%
Taylor expanded in y around inf 20.5%
Final simplification37.9%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= z 0.006) (- 3.0 (sqrt y)) (+ 1.0 (- (sqrt (+ 1.0 y)) (sqrt y)))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (z <= 0.006) {
tmp = 3.0 - sqrt(y);
} else {
tmp = 1.0 + (sqrt((1.0 + y)) - sqrt(y));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (z <= 0.006d0) then
tmp = 3.0d0 - sqrt(y)
else
tmp = 1.0d0 + (sqrt((1.0d0 + y)) - sqrt(y))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= 0.006) {
tmp = 3.0 - Math.sqrt(y);
} else {
tmp = 1.0 + (Math.sqrt((1.0 + y)) - Math.sqrt(y));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if z <= 0.006: tmp = 3.0 - math.sqrt(y) else: tmp = 1.0 + (math.sqrt((1.0 + y)) - math.sqrt(y)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (z <= 0.006) tmp = Float64(3.0 - sqrt(y)); else tmp = Float64(1.0 + Float64(sqrt(Float64(1.0 + y)) - sqrt(y))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (z <= 0.006)
tmp = 3.0 - sqrt(y);
else
tmp = 1.0 + (sqrt((1.0 + y)) - sqrt(y));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[z, 0.006], N[(3.0 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq 0.006:\\
\;\;\;\;3 - \sqrt{y}\\
\mathbf{else}:\\
\;\;\;\;1 + \left(\sqrt{1 + y} - \sqrt{y}\right)\\
\end{array}
\end{array}
if z < 0.0060000000000000001Initial program 97.6%
+-commutative97.6%
associate-+r+97.6%
associate-+r-75.3%
associate-+l-67.5%
associate-+r-52.1%
Simplified52.2%
Taylor expanded in t around inf 19.3%
associate--l+24.0%
+-commutative24.0%
associate--l+34.8%
+-commutative34.8%
associate-+r+34.8%
Simplified34.8%
Taylor expanded in x around 0 30.6%
Taylor expanded in y around 0 27.5%
Taylor expanded in z around 0 26.6%
if 0.0060000000000000001 < z Initial program 89.8%
+-commutative89.8%
associate-+r+89.8%
associate-+r-70.8%
associate-+l-60.4%
associate-+r-59.7%
Simplified36.9%
Taylor expanded in t around inf 3.9%
associate--l+21.0%
+-commutative21.0%
associate--l+14.0%
+-commutative14.0%
associate-+r+14.0%
Simplified14.0%
Taylor expanded in z around inf 32.8%
Taylor expanded in x around 0 34.3%
associate--l+53.8%
Simplified53.8%
Final simplification40.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 3e+14) (+ (- (sqrt (+ 1.0 z)) (sqrt z)) 2.0) (+ 1.0 (- (sqrt (+ 1.0 y)) (sqrt y)))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (z <= 3e+14) {
tmp = (sqrt((1.0 + z)) - sqrt(z)) + 2.0;
} else {
tmp = 1.0 + (sqrt((1.0 + y)) - sqrt(y));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (z <= 3d+14) then
tmp = (sqrt((1.0d0 + z)) - sqrt(z)) + 2.0d0
else
tmp = 1.0d0 + (sqrt((1.0d0 + y)) - sqrt(y))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= 3e+14) {
tmp = (Math.sqrt((1.0 + z)) - Math.sqrt(z)) + 2.0;
} else {
tmp = 1.0 + (Math.sqrt((1.0 + y)) - Math.sqrt(y));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if z <= 3e+14: tmp = (math.sqrt((1.0 + z)) - math.sqrt(z)) + 2.0 else: tmp = 1.0 + (math.sqrt((1.0 + y)) - math.sqrt(y)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (z <= 3e+14) tmp = Float64(Float64(sqrt(Float64(1.0 + z)) - sqrt(z)) + 2.0); else tmp = Float64(1.0 + Float64(sqrt(Float64(1.0 + y)) - sqrt(y))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (z <= 3e+14)
tmp = (sqrt((1.0 + z)) - sqrt(z)) + 2.0;
else
tmp = 1.0 + (sqrt((1.0 + y)) - sqrt(y));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[z, 3e+14], N[(N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision], N[(1.0 + N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq 3 \cdot 10^{+14}:\\
\;\;\;\;\left(\sqrt{1 + z} - \sqrt{z}\right) + 2\\
\mathbf{else}:\\
\;\;\;\;1 + \left(\sqrt{1 + y} - \sqrt{y}\right)\\
\end{array}
\end{array}
if z < 3e14Initial program 97.3%
+-commutative97.3%
associate-+r+97.3%
associate-+r-75.2%
associate-+l-67.1%
associate-+r-51.6%
Simplified51.8%
Taylor expanded in t around inf 18.8%
associate--l+23.4%
+-commutative23.4%
associate--l+33.8%
+-commutative33.8%
associate-+r+33.8%
Simplified33.8%
Taylor expanded in x around 0 30.2%
Taylor expanded in y around 0 47.6%
associate--l+47.6%
Simplified47.6%
if 3e14 < z Initial program 89.7%
+-commutative89.7%
associate-+r+89.7%
associate-+r-70.8%
associate-+l-60.6%
associate-+r-60.5%
Simplified36.7%
Taylor expanded in t around inf 3.8%
associate--l+21.5%
+-commutative21.5%
associate--l+14.3%
+-commutative14.3%
associate-+r+14.3%
Simplified14.3%
Taylor expanded in z around inf 33.8%
Taylor expanded in x around 0 34.8%
associate--l+54.8%
Simplified54.8%
Final simplification51.1%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= y 2e-197) (- 3.0 (sqrt y)) (if (<= y 1.0) (- 2.0 (sqrt y)) (- (+ 1.0 (* x 0.5)) (sqrt x)))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 2e-197) {
tmp = 3.0 - sqrt(y);
} else if (y <= 1.0) {
tmp = 2.0 - sqrt(y);
} else {
tmp = (1.0 + (x * 0.5)) - sqrt(x);
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= 2d-197) then
tmp = 3.0d0 - sqrt(y)
else if (y <= 1.0d0) then
tmp = 2.0d0 - sqrt(y)
else
tmp = (1.0d0 + (x * 0.5d0)) - sqrt(x)
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= 2e-197) {
tmp = 3.0 - Math.sqrt(y);
} else if (y <= 1.0) {
tmp = 2.0 - Math.sqrt(y);
} else {
tmp = (1.0 + (x * 0.5)) - Math.sqrt(x);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if y <= 2e-197: tmp = 3.0 - math.sqrt(y) elif y <= 1.0: tmp = 2.0 - math.sqrt(y) else: tmp = (1.0 + (x * 0.5)) - math.sqrt(x) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (y <= 2e-197) tmp = Float64(3.0 - sqrt(y)); elseif (y <= 1.0) tmp = Float64(2.0 - sqrt(y)); else tmp = Float64(Float64(1.0 + Float64(x * 0.5)) - sqrt(x)); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (y <= 2e-197)
tmp = 3.0 - sqrt(y);
elseif (y <= 1.0)
tmp = 2.0 - sqrt(y);
else
tmp = (1.0 + (x * 0.5)) - sqrt(x);
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[y, 2e-197], N[(3.0 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.0], N[(2.0 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision], N[(N[(1.0 + N[(x * 0.5), $MachinePrecision]), $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 2 \cdot 10^{-197}:\\
\;\;\;\;3 - \sqrt{y}\\
\mathbf{elif}\;y \leq 1:\\
\;\;\;\;2 - \sqrt{y}\\
\mathbf{else}:\\
\;\;\;\;\left(1 + x \cdot 0.5\right) - \sqrt{x}\\
\end{array}
\end{array}
if y < 2e-197Initial program 99.2%
+-commutative99.2%
associate-+r+99.2%
associate-+r-99.2%
associate-+l-99.2%
associate-+r-99.2%
Simplified73.6%
Taylor expanded in t around inf 12.8%
associate--l+18.6%
+-commutative18.6%
associate--l+18.6%
+-commutative18.6%
associate-+r+18.6%
Simplified18.6%
Taylor expanded in x around 0 29.3%
Taylor expanded in y around 0 29.3%
Taylor expanded in z around 0 52.7%
if 2e-197 < y < 1Initial program 96.6%
+-commutative96.6%
associate-+r+96.6%
associate-+r-96.6%
associate-+l-96.6%
associate-+r-96.6%
Simplified77.9%
Taylor expanded in t around inf 21.4%
associate--l+25.6%
+-commutative25.6%
associate--l+25.6%
+-commutative25.6%
associate-+r+25.6%
Simplified25.6%
Taylor expanded in x around 0 29.7%
Taylor expanded in y around 0 29.6%
Taylor expanded in z around inf 53.7%
if 1 < y Initial program 89.4%
+-commutative89.4%
associate-+r+89.4%
associate-+r-46.5%
associate-+l-27.6%
associate-+r-11.0%
Simplified9.9%
Taylor expanded in t around inf 4.0%
associate--l+21.8%
+-commutative21.8%
associate--l+25.5%
+-commutative25.5%
associate-+r+25.5%
Simplified25.5%
Taylor expanded in z around inf 21.9%
Taylor expanded in y around inf 20.5%
Taylor expanded in x around 0 21.3%
Final simplification37.9%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= y 1.05e-198) (- 3.0 (sqrt y)) (if (<= y 1.05) (- 2.0 (sqrt y)) (- 1.0 (sqrt x)))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 1.05e-198) {
tmp = 3.0 - sqrt(y);
} else if (y <= 1.05) {
tmp = 2.0 - sqrt(y);
} else {
tmp = 1.0 - sqrt(x);
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= 1.05d-198) then
tmp = 3.0d0 - sqrt(y)
else if (y <= 1.05d0) then
tmp = 2.0d0 - sqrt(y)
else
tmp = 1.0d0 - sqrt(x)
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= 1.05e-198) {
tmp = 3.0 - Math.sqrt(y);
} else if (y <= 1.05) {
tmp = 2.0 - Math.sqrt(y);
} else {
tmp = 1.0 - Math.sqrt(x);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if y <= 1.05e-198: tmp = 3.0 - math.sqrt(y) elif y <= 1.05: tmp = 2.0 - math.sqrt(y) else: tmp = 1.0 - math.sqrt(x) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (y <= 1.05e-198) tmp = Float64(3.0 - sqrt(y)); elseif (y <= 1.05) tmp = Float64(2.0 - sqrt(y)); else tmp = Float64(1.0 - sqrt(x)); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (y <= 1.05e-198)
tmp = 3.0 - sqrt(y);
elseif (y <= 1.05)
tmp = 2.0 - sqrt(y);
else
tmp = 1.0 - sqrt(x);
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[y, 1.05e-198], N[(3.0 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.05], N[(2.0 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision], N[(1.0 - 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 1.05 \cdot 10^{-198}:\\
\;\;\;\;3 - \sqrt{y}\\
\mathbf{elif}\;y \leq 1.05:\\
\;\;\;\;2 - \sqrt{y}\\
\mathbf{else}:\\
\;\;\;\;1 - \sqrt{x}\\
\end{array}
\end{array}
if y < 1.04999999999999996e-198Initial program 99.2%
+-commutative99.2%
associate-+r+99.2%
associate-+r-99.2%
associate-+l-99.2%
associate-+r-99.2%
Simplified74.8%
Taylor expanded in t around inf 13.0%
associate--l+18.6%
+-commutative18.6%
associate--l+18.6%
+-commutative18.6%
associate-+r+18.6%
Simplified18.6%
Taylor expanded in x around 0 29.9%
Taylor expanded in y around 0 29.9%
Taylor expanded in z around 0 53.4%
if 1.04999999999999996e-198 < y < 1.05000000000000004Initial program 96.7%
+-commutative96.7%
associate-+r+96.7%
associate-+r-96.7%
associate-+l-96.7%
associate-+r-96.6%
Simplified77.2%
Taylor expanded in t around inf 21.2%
associate--l+25.5%
+-commutative25.5%
associate--l+25.5%
+-commutative25.5%
associate-+r+25.5%
Simplified25.5%
Taylor expanded in x around 0 29.4%
Taylor expanded in y around 0 29.3%
Taylor expanded in z around inf 54.3%
if 1.05000000000000004 < y Initial program 89.4%
+-commutative89.4%
associate-+r+89.4%
associate-+r-46.5%
associate-+l-27.6%
associate-+r-11.0%
Simplified9.9%
Taylor expanded in t around inf 4.0%
associate--l+21.8%
+-commutative21.8%
associate--l+25.5%
+-commutative25.5%
associate-+r+25.5%
Simplified25.5%
Taylor expanded in z around inf 21.9%
Taylor expanded in y around inf 20.5%
Taylor expanded in x around 0 19.7%
Final simplification37.5%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= y 1.0) (- 2.0 (sqrt y)) (- 1.0 (sqrt x))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 1.0) {
tmp = 2.0 - sqrt(y);
} else {
tmp = 1.0 - sqrt(x);
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= 1.0d0) then
tmp = 2.0d0 - sqrt(y)
else
tmp = 1.0d0 - sqrt(x)
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= 1.0) {
tmp = 2.0 - Math.sqrt(y);
} else {
tmp = 1.0 - Math.sqrt(x);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if y <= 1.0: tmp = 2.0 - math.sqrt(y) else: tmp = 1.0 - math.sqrt(x) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (y <= 1.0) tmp = Float64(2.0 - sqrt(y)); else tmp = Float64(1.0 - sqrt(x)); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (y <= 1.0)
tmp = 2.0 - sqrt(y);
else
tmp = 1.0 - sqrt(x);
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[y, 1.0], N[(2.0 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision], N[(1.0 - 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 1:\\
\;\;\;\;2 - \sqrt{y}\\
\mathbf{else}:\\
\;\;\;\;1 - \sqrt{x}\\
\end{array}
\end{array}
if y < 1Initial program 97.5%
+-commutative97.5%
associate-+r+97.5%
associate-+r-97.5%
associate-+l-97.5%
associate-+r-97.5%
Simplified76.4%
Taylor expanded in t around inf 18.4%
associate--l+23.1%
+-commutative23.1%
associate--l+23.1%
+-commutative23.1%
associate-+r+23.1%
Simplified23.1%
Taylor expanded in x around 0 29.6%
Taylor expanded in y around 0 29.5%
Taylor expanded in z around inf 49.5%
if 1 < y Initial program 89.4%
+-commutative89.4%
associate-+r+89.4%
associate-+r-46.5%
associate-+l-27.6%
associate-+r-11.0%
Simplified9.9%
Taylor expanded in t around inf 4.0%
associate--l+21.8%
+-commutative21.8%
associate--l+25.5%
+-commutative25.5%
associate-+r+25.5%
Simplified25.5%
Taylor expanded in z around inf 21.9%
Taylor expanded in y around inf 20.5%
Taylor expanded in x around 0 19.7%
Final simplification35.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 x)))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
return 1.0 - sqrt(x);
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = 1.0d0 - sqrt(x)
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
return 1.0 - Math.sqrt(x);
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): return 1.0 - math.sqrt(x)
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) return Float64(1.0 - sqrt(x)) end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp = code(x, y, z, t)
tmp = 1.0 - sqrt(x);
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := N[(1.0 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
1 - \sqrt{x}
\end{array}
Initial program 93.6%
+-commutative93.6%
associate-+r+93.6%
associate-+r-73.0%
associate-+l-63.9%
associate-+r-56.0%
Simplified44.4%
Taylor expanded in t around inf 11.5%
associate--l+22.5%
+-commutative22.5%
associate--l+24.3%
+-commutative24.3%
associate-+r+24.3%
Simplified24.3%
Taylor expanded in z around inf 22.4%
Taylor expanded in y around inf 15.2%
Taylor expanded in x around 0 14.2%
Final simplification14.2%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (* y 0.5))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
return y * 0.5;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = y * 0.5d0
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
return y * 0.5;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): return y * 0.5
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) return Float64(y * 0.5) end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp = code(x, y, z, t)
tmp = y * 0.5;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := N[(y * 0.5), $MachinePrecision]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
y \cdot 0.5
\end{array}
Initial program 93.6%
associate-+l+93.6%
+-commutative93.6%
+-commutative93.6%
+-commutative93.6%
Simplified93.6%
flip--93.6%
add-sqr-sqrt73.6%
+-commutative73.6%
add-sqr-sqrt93.9%
+-commutative93.9%
Applied egg-rr93.9%
associate--l+94.7%
+-inverses94.7%
metadata-eval94.7%
Simplified94.7%
Taylor expanded in y around 0 53.4%
*-commutative53.4%
Simplified53.4%
Taylor expanded in z around 0 28.9%
Taylor expanded in y around inf 5.5%
Final simplification5.5%
(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 2024024
(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))))