
(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 20 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (+ (+ (+ (- (sqrt (+ x 1.0)) (sqrt x)) (- (sqrt (+ y 1.0)) (sqrt y))) (- (sqrt (+ z 1.0)) (sqrt z))) (- (sqrt (+ t 1.0)) (sqrt t))))
double code(double x, double y, double z, double t) {
return (((sqrt((x + 1.0)) - sqrt(x)) + (sqrt((y + 1.0)) - sqrt(y))) + (sqrt((z + 1.0)) - sqrt(z))) + (sqrt((t + 1.0)) - sqrt(t));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (((sqrt((x + 1.0d0)) - sqrt(x)) + (sqrt((y + 1.0d0)) - sqrt(y))) + (sqrt((z + 1.0d0)) - sqrt(z))) + (sqrt((t + 1.0d0)) - sqrt(t))
end function
public static double code(double x, double y, double z, double t) {
return (((Math.sqrt((x + 1.0)) - Math.sqrt(x)) + (Math.sqrt((y + 1.0)) - Math.sqrt(y))) + (Math.sqrt((z + 1.0)) - Math.sqrt(z))) + (Math.sqrt((t + 1.0)) - Math.sqrt(t));
}
def code(x, y, z, t): return (((math.sqrt((x + 1.0)) - math.sqrt(x)) + (math.sqrt((y + 1.0)) - math.sqrt(y))) + (math.sqrt((z + 1.0)) - math.sqrt(z))) + (math.sqrt((t + 1.0)) - math.sqrt(t))
function code(x, y, z, t) return Float64(Float64(Float64(Float64(sqrt(Float64(x + 1.0)) - sqrt(x)) + Float64(sqrt(Float64(y + 1.0)) - sqrt(y))) + Float64(sqrt(Float64(z + 1.0)) - sqrt(z))) + Float64(sqrt(Float64(t + 1.0)) - sqrt(t))) end
function tmp = code(x, y, z, t) tmp = (((sqrt((x + 1.0)) - sqrt(x)) + (sqrt((y + 1.0)) - sqrt(y))) + (sqrt((z + 1.0)) - sqrt(z))) + (sqrt((t + 1.0)) - sqrt(t)); end
code[x_, y_, z_, t_] := N[(N[(N[(N[(N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(z + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(t + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{y + 1} - \sqrt{y}\right)\right) + \left(\sqrt{z + 1} - \sqrt{z}\right)\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)
\end{array}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ 1.0 x)))
(t_2 (sqrt (+ 1.0 z)))
(t_3 (- t_2 (sqrt z)))
(t_4 (sqrt (+ 1.0 y))))
(if (<= t_3 0.002)
(+
(+ (/ 1.0 (+ (sqrt x) t_1)) (/ 1.0 (+ t_4 (sqrt y))))
(/ 1.0 (+ (sqrt z) t_2)))
(+
(- t_1 (sqrt x))
(+ (- t_4 (sqrt y)) (+ (/ 1.0 (+ (sqrt (+ 1.0 t)) (sqrt t))) t_3))))))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 = t_2 - sqrt(z);
double t_4 = sqrt((1.0 + y));
double tmp;
if (t_3 <= 0.002) {
tmp = ((1.0 / (sqrt(x) + t_1)) + (1.0 / (t_4 + sqrt(y)))) + (1.0 / (sqrt(z) + t_2));
} else {
tmp = (t_1 - sqrt(x)) + ((t_4 - sqrt(y)) + ((1.0 / (sqrt((1.0 + t)) + sqrt(t))) + t_3));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: tmp
t_1 = sqrt((1.0d0 + x))
t_2 = sqrt((1.0d0 + z))
t_3 = t_2 - sqrt(z)
t_4 = sqrt((1.0d0 + y))
if (t_3 <= 0.002d0) then
tmp = ((1.0d0 / (sqrt(x) + t_1)) + (1.0d0 / (t_4 + sqrt(y)))) + (1.0d0 / (sqrt(z) + t_2))
else
tmp = (t_1 - sqrt(x)) + ((t_4 - sqrt(y)) + ((1.0d0 / (sqrt((1.0d0 + t)) + sqrt(t))) + t_3))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + x));
double t_2 = Math.sqrt((1.0 + z));
double t_3 = t_2 - Math.sqrt(z);
double t_4 = Math.sqrt((1.0 + y));
double tmp;
if (t_3 <= 0.002) {
tmp = ((1.0 / (Math.sqrt(x) + t_1)) + (1.0 / (t_4 + Math.sqrt(y)))) + (1.0 / (Math.sqrt(z) + t_2));
} else {
tmp = (t_1 - Math.sqrt(x)) + ((t_4 - Math.sqrt(y)) + ((1.0 / (Math.sqrt((1.0 + t)) + Math.sqrt(t))) + t_3));
}
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 = t_2 - math.sqrt(z) t_4 = math.sqrt((1.0 + y)) tmp = 0 if t_3 <= 0.002: tmp = ((1.0 / (math.sqrt(x) + t_1)) + (1.0 / (t_4 + math.sqrt(y)))) + (1.0 / (math.sqrt(z) + t_2)) else: tmp = (t_1 - math.sqrt(x)) + ((t_4 - math.sqrt(y)) + ((1.0 / (math.sqrt((1.0 + t)) + math.sqrt(t))) + t_3)) 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 = Float64(t_2 - sqrt(z)) t_4 = sqrt(Float64(1.0 + y)) tmp = 0.0 if (t_3 <= 0.002) tmp = Float64(Float64(Float64(1.0 / Float64(sqrt(x) + t_1)) + Float64(1.0 / Float64(t_4 + sqrt(y)))) + Float64(1.0 / Float64(sqrt(z) + t_2))); else tmp = Float64(Float64(t_1 - sqrt(x)) + Float64(Float64(t_4 - sqrt(y)) + Float64(Float64(1.0 / Float64(sqrt(Float64(1.0 + t)) + sqrt(t))) + t_3))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + x));
t_2 = sqrt((1.0 + z));
t_3 = t_2 - sqrt(z);
t_4 = sqrt((1.0 + y));
tmp = 0.0;
if (t_3 <= 0.002)
tmp = ((1.0 / (sqrt(x) + t_1)) + (1.0 / (t_4 + sqrt(y)))) + (1.0 / (sqrt(z) + t_2));
else
tmp = (t_1 - sqrt(x)) + ((t_4 - sqrt(y)) + ((1.0 / (sqrt((1.0 + t)) + sqrt(t))) + t_3));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[(t$95$2 - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t$95$3, 0.002], N[(N[(N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(t$95$4 + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[z], $MachinePrecision] + t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(t$95$1 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$4 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 / N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] + N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + x}\\
t_2 := \sqrt{1 + z}\\
t_3 := t_2 - \sqrt{z}\\
t_4 := \sqrt{1 + y}\\
\mathbf{if}\;t_3 \leq 0.002:\\
\;\;\;\;\left(\frac{1}{\sqrt{x} + t_1} + \frac{1}{t_4 + \sqrt{y}}\right) + \frac{1}{\sqrt{z} + t_2}\\
\mathbf{else}:\\
\;\;\;\;\left(t_1 - \sqrt{x}\right) + \left(\left(t_4 - \sqrt{y}\right) + \left(\frac{1}{\sqrt{1 + t} + \sqrt{t}} + t_3\right)\right)\\
\end{array}
\end{array}
if (-.f64 (sqrt.f64 (+.f64 z 1)) (sqrt.f64 z)) < 2e-3Initial program 84.7%
associate-+l+84.7%
associate-+l+84.7%
+-commutative84.7%
+-commutative84.7%
+-commutative84.7%
Simplified84.7%
flip--84.9%
add-sqr-sqrt71.0%
add-sqr-sqrt85.3%
Applied egg-rr85.3%
+-commutative85.3%
associate--l+87.6%
+-inverses87.6%
metadata-eval87.6%
+-commutative87.6%
+-commutative87.6%
Simplified87.6%
flip--87.7%
add-sqr-sqrt73.8%
add-sqr-sqrt88.2%
Applied egg-rr88.2%
associate--l+91.4%
+-inverses91.4%
metadata-eval91.4%
Simplified91.4%
flip--91.6%
add-sqr-sqrt52.0%
add-sqr-sqrt91.9%
Applied egg-rr91.9%
associate--l+96.3%
+-inverses96.3%
metadata-eval96.3%
+-commutative96.3%
+-commutative96.3%
Simplified96.3%
Taylor expanded in t around inf 57.1%
associate-+r+57.1%
+-commutative57.1%
Simplified57.1%
if 2e-3 < (-.f64 (sqrt.f64 (+.f64 z 1)) (sqrt.f64 z)) Initial program 96.9%
associate-+l+96.9%
associate-+l+96.9%
+-commutative96.9%
+-commutative96.9%
+-commutative96.9%
Simplified96.9%
flip--97.1%
add-sqr-sqrt72.6%
add-sqr-sqrt97.2%
Applied egg-rr97.2%
associate--l+97.4%
+-inverses97.4%
metadata-eval97.4%
+-commutative97.4%
+-commutative97.4%
Simplified97.4%
Final simplification77.6%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ 1.0 x))) (t_2 (sqrt (+ 1.0 z))) (t_3 (- t_2 (sqrt z))))
(if (<= t_3 0.002)
(+
(+ (/ 1.0 (+ (sqrt x) t_1)) (/ 1.0 (+ (sqrt (+ 1.0 y)) (sqrt y))))
(/ 1.0 (+ (sqrt z) t_2)))
(+
(- t_1 (sqrt x))
(+
(+ (/ 1.0 (+ (sqrt (+ 1.0 t)) (sqrt t))) t_3)
(- (+ 1.0 (* y 0.5)) (sqrt y)))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + x));
double t_2 = sqrt((1.0 + z));
double t_3 = t_2 - sqrt(z);
double tmp;
if (t_3 <= 0.002) {
tmp = ((1.0 / (sqrt(x) + t_1)) + (1.0 / (sqrt((1.0 + y)) + sqrt(y)))) + (1.0 / (sqrt(z) + t_2));
} else {
tmp = (t_1 - sqrt(x)) + (((1.0 / (sqrt((1.0 + t)) + sqrt(t))) + t_3) + ((1.0 + (y * 0.5)) - sqrt(y)));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = sqrt((1.0d0 + x))
t_2 = sqrt((1.0d0 + z))
t_3 = t_2 - sqrt(z)
if (t_3 <= 0.002d0) then
tmp = ((1.0d0 / (sqrt(x) + t_1)) + (1.0d0 / (sqrt((1.0d0 + y)) + sqrt(y)))) + (1.0d0 / (sqrt(z) + t_2))
else
tmp = (t_1 - sqrt(x)) + (((1.0d0 / (sqrt((1.0d0 + t)) + sqrt(t))) + t_3) + ((1.0d0 + (y * 0.5d0)) - sqrt(y)))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + x));
double t_2 = Math.sqrt((1.0 + z));
double t_3 = t_2 - Math.sqrt(z);
double tmp;
if (t_3 <= 0.002) {
tmp = ((1.0 / (Math.sqrt(x) + t_1)) + (1.0 / (Math.sqrt((1.0 + y)) + Math.sqrt(y)))) + (1.0 / (Math.sqrt(z) + t_2));
} else {
tmp = (t_1 - Math.sqrt(x)) + (((1.0 / (Math.sqrt((1.0 + t)) + Math.sqrt(t))) + t_3) + ((1.0 + (y * 0.5)) - Math.sqrt(y)));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + x)) t_2 = math.sqrt((1.0 + z)) t_3 = t_2 - math.sqrt(z) tmp = 0 if t_3 <= 0.002: tmp = ((1.0 / (math.sqrt(x) + t_1)) + (1.0 / (math.sqrt((1.0 + y)) + math.sqrt(y)))) + (1.0 / (math.sqrt(z) + t_2)) else: tmp = (t_1 - math.sqrt(x)) + (((1.0 / (math.sqrt((1.0 + t)) + math.sqrt(t))) + t_3) + ((1.0 + (y * 0.5)) - math.sqrt(y))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(1.0 + x)) t_2 = sqrt(Float64(1.0 + z)) t_3 = Float64(t_2 - sqrt(z)) tmp = 0.0 if (t_3 <= 0.002) tmp = Float64(Float64(Float64(1.0 / Float64(sqrt(x) + t_1)) + Float64(1.0 / Float64(sqrt(Float64(1.0 + y)) + sqrt(y)))) + Float64(1.0 / Float64(sqrt(z) + t_2))); else tmp = Float64(Float64(t_1 - sqrt(x)) + Float64(Float64(Float64(1.0 / Float64(sqrt(Float64(1.0 + t)) + sqrt(t))) + t_3) + Float64(Float64(1.0 + Float64(y * 0.5)) - sqrt(y)))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + x));
t_2 = sqrt((1.0 + z));
t_3 = t_2 - sqrt(z);
tmp = 0.0;
if (t_3 <= 0.002)
tmp = ((1.0 / (sqrt(x) + t_1)) + (1.0 / (sqrt((1.0 + y)) + sqrt(y)))) + (1.0 / (sqrt(z) + t_2));
else
tmp = (t_1 - sqrt(x)) + (((1.0 / (sqrt((1.0 + t)) + sqrt(t))) + t_3) + ((1.0 + (y * 0.5)) - sqrt(y)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[(t$95$2 - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$3, 0.002], N[(N[(N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + t$95$1), $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[z], $MachinePrecision] + t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(t$95$1 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(N[(N[(1.0 / N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] + N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$3), $MachinePrecision] + N[(N[(1.0 + N[(y * 0.5), $MachinePrecision]), $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + x}\\
t_2 := \sqrt{1 + z}\\
t_3 := t_2 - \sqrt{z}\\
\mathbf{if}\;t_3 \leq 0.002:\\
\;\;\;\;\left(\frac{1}{\sqrt{x} + t_1} + \frac{1}{\sqrt{1 + y} + \sqrt{y}}\right) + \frac{1}{\sqrt{z} + t_2}\\
\mathbf{else}:\\
\;\;\;\;\left(t_1 - \sqrt{x}\right) + \left(\left(\frac{1}{\sqrt{1 + t} + \sqrt{t}} + t_3\right) + \left(\left(1 + y \cdot 0.5\right) - \sqrt{y}\right)\right)\\
\end{array}
\end{array}
if (-.f64 (sqrt.f64 (+.f64 z 1)) (sqrt.f64 z)) < 2e-3Initial program 84.7%
associate-+l+84.7%
associate-+l+84.7%
+-commutative84.7%
+-commutative84.7%
+-commutative84.7%
Simplified84.7%
flip--84.9%
add-sqr-sqrt71.0%
add-sqr-sqrt85.3%
Applied egg-rr85.3%
+-commutative85.3%
associate--l+87.6%
+-inverses87.6%
metadata-eval87.6%
+-commutative87.6%
+-commutative87.6%
Simplified87.6%
flip--87.7%
add-sqr-sqrt73.8%
add-sqr-sqrt88.2%
Applied egg-rr88.2%
associate--l+91.4%
+-inverses91.4%
metadata-eval91.4%
Simplified91.4%
flip--91.6%
add-sqr-sqrt52.0%
add-sqr-sqrt91.9%
Applied egg-rr91.9%
associate--l+96.3%
+-inverses96.3%
metadata-eval96.3%
+-commutative96.3%
+-commutative96.3%
Simplified96.3%
Taylor expanded in t around inf 57.1%
associate-+r+57.1%
+-commutative57.1%
Simplified57.1%
if 2e-3 < (-.f64 (sqrt.f64 (+.f64 z 1)) (sqrt.f64 z)) Initial program 96.9%
associate-+l+96.9%
associate-+l+96.9%
+-commutative96.9%
+-commutative96.9%
+-commutative96.9%
Simplified96.9%
flip--97.1%
add-sqr-sqrt72.6%
add-sqr-sqrt97.2%
Applied egg-rr97.2%
associate--l+97.4%
+-inverses97.4%
metadata-eval97.4%
+-commutative97.4%
+-commutative97.4%
Simplified97.4%
Taylor expanded in y around 0 50.1%
*-commutative50.1%
Simplified50.1%
Final simplification53.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 x) (sqrt (+ 1.0 x)))) (+ (/ 1.0 (+ (sqrt (+ 1.0 y)) (sqrt y))) (+ (- (sqrt (+ 1.0 t)) (sqrt t)) (/ 1.0 (+ (sqrt z) (sqrt (+ 1.0 z))))))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
return (1.0 / (sqrt(x) + sqrt((1.0 + x)))) + ((1.0 / (sqrt((1.0 + y)) + sqrt(y))) + ((sqrt((1.0 + t)) - sqrt(t)) + (1.0 / (sqrt(z) + sqrt((1.0 + z))))));
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (1.0d0 / (sqrt(x) + sqrt((1.0d0 + x)))) + ((1.0d0 / (sqrt((1.0d0 + y)) + sqrt(y))) + ((sqrt((1.0d0 + t)) - sqrt(t)) + (1.0d0 / (sqrt(z) + sqrt((1.0d0 + z))))))
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
return (1.0 / (Math.sqrt(x) + Math.sqrt((1.0 + x)))) + ((1.0 / (Math.sqrt((1.0 + y)) + Math.sqrt(y))) + ((Math.sqrt((1.0 + t)) - Math.sqrt(t)) + (1.0 / (Math.sqrt(z) + Math.sqrt((1.0 + z))))));
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): return (1.0 / (math.sqrt(x) + math.sqrt((1.0 + x)))) + ((1.0 / (math.sqrt((1.0 + y)) + math.sqrt(y))) + ((math.sqrt((1.0 + t)) - math.sqrt(t)) + (1.0 / (math.sqrt(z) + math.sqrt((1.0 + z))))))
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) return Float64(Float64(1.0 / Float64(sqrt(x) + sqrt(Float64(1.0 + x)))) + Float64(Float64(1.0 / Float64(sqrt(Float64(1.0 + y)) + sqrt(y))) + Float64(Float64(sqrt(Float64(1.0 + t)) - sqrt(t)) + Float64(1.0 / Float64(sqrt(z) + sqrt(Float64(1.0 + z))))))) end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp = code(x, y, z, t)
tmp = (1.0 / (sqrt(x) + sqrt((1.0 + x)))) + ((1.0 / (sqrt((1.0 + y)) + sqrt(y))) + ((sqrt((1.0 + t)) - sqrt(t)) + (1.0 / (sqrt(z) + sqrt((1.0 + z))))));
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := N[(N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 / N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[z], $MachinePrecision] + N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\frac{1}{\sqrt{x} + \sqrt{1 + x}} + \left(\frac{1}{\sqrt{1 + y} + \sqrt{y}} + \left(\left(\sqrt{1 + t} - \sqrt{t}\right) + \frac{1}{\sqrt{z} + \sqrt{1 + z}}\right)\right)
\end{array}
Initial program 90.9%
associate-+l+90.9%
associate-+l+90.9%
+-commutative90.9%
+-commutative90.9%
+-commutative90.9%
Simplified90.9%
flip--91.1%
add-sqr-sqrt72.6%
add-sqr-sqrt91.5%
Applied egg-rr91.5%
+-commutative91.5%
associate--l+92.9%
+-inverses92.9%
metadata-eval92.9%
+-commutative92.9%
+-commutative92.9%
Simplified92.9%
flip--93.1%
add-sqr-sqrt75.6%
add-sqr-sqrt93.5%
Applied egg-rr93.5%
associate--l+95.5%
+-inverses95.5%
metadata-eval95.5%
Simplified95.5%
flip--95.5%
add-sqr-sqrt76.0%
add-sqr-sqrt95.7%
Applied egg-rr95.7%
associate--l+97.9%
+-inverses97.9%
metadata-eval97.9%
+-commutative97.9%
+-commutative97.9%
Simplified97.9%
Final simplification97.9%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ 1.0 z))) (t_2 (sqrt (+ 1.0 x))))
(if (<= z 3.6e-10)
(+
(- t_2 (sqrt x))
(+ 1.0 (+ (/ 1.0 (+ (sqrt (+ 1.0 t)) (sqrt t))) (- t_1 (sqrt z)))))
(+
(+ (/ 1.0 (+ (sqrt x) t_2)) (/ 1.0 (+ (sqrt (+ 1.0 y)) (sqrt y))))
(/ 1.0 (+ (sqrt z) t_1))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + z));
double t_2 = sqrt((1.0 + x));
double tmp;
if (z <= 3.6e-10) {
tmp = (t_2 - sqrt(x)) + (1.0 + ((1.0 / (sqrt((1.0 + t)) + sqrt(t))) + (t_1 - sqrt(z))));
} else {
tmp = ((1.0 / (sqrt(x) + t_2)) + (1.0 / (sqrt((1.0 + y)) + sqrt(y)))) + (1.0 / (sqrt(z) + t_1));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = sqrt((1.0d0 + z))
t_2 = sqrt((1.0d0 + x))
if (z <= 3.6d-10) then
tmp = (t_2 - sqrt(x)) + (1.0d0 + ((1.0d0 / (sqrt((1.0d0 + t)) + sqrt(t))) + (t_1 - sqrt(z))))
else
tmp = ((1.0d0 / (sqrt(x) + t_2)) + (1.0d0 / (sqrt((1.0d0 + y)) + sqrt(y)))) + (1.0d0 / (sqrt(z) + t_1))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + z));
double t_2 = Math.sqrt((1.0 + x));
double tmp;
if (z <= 3.6e-10) {
tmp = (t_2 - Math.sqrt(x)) + (1.0 + ((1.0 / (Math.sqrt((1.0 + t)) + Math.sqrt(t))) + (t_1 - Math.sqrt(z))));
} else {
tmp = ((1.0 / (Math.sqrt(x) + t_2)) + (1.0 / (Math.sqrt((1.0 + y)) + Math.sqrt(y)))) + (1.0 / (Math.sqrt(z) + t_1));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + z)) t_2 = math.sqrt((1.0 + x)) tmp = 0 if z <= 3.6e-10: tmp = (t_2 - math.sqrt(x)) + (1.0 + ((1.0 / (math.sqrt((1.0 + t)) + math.sqrt(t))) + (t_1 - math.sqrt(z)))) else: tmp = ((1.0 / (math.sqrt(x) + t_2)) + (1.0 / (math.sqrt((1.0 + y)) + math.sqrt(y)))) + (1.0 / (math.sqrt(z) + t_1)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(1.0 + z)) t_2 = sqrt(Float64(1.0 + x)) tmp = 0.0 if (z <= 3.6e-10) tmp = Float64(Float64(t_2 - sqrt(x)) + Float64(1.0 + Float64(Float64(1.0 / Float64(sqrt(Float64(1.0 + t)) + sqrt(t))) + Float64(t_1 - sqrt(z))))); else tmp = Float64(Float64(Float64(1.0 / Float64(sqrt(x) + t_2)) + Float64(1.0 / Float64(sqrt(Float64(1.0 + y)) + sqrt(y)))) + Float64(1.0 / Float64(sqrt(z) + t_1))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + z));
t_2 = sqrt((1.0 + x));
tmp = 0.0;
if (z <= 3.6e-10)
tmp = (t_2 - sqrt(x)) + (1.0 + ((1.0 / (sqrt((1.0 + t)) + sqrt(t))) + (t_1 - sqrt(z))));
else
tmp = ((1.0 / (sqrt(x) + t_2)) + (1.0 / (sqrt((1.0 + y)) + sqrt(y)))) + (1.0 / (sqrt(z) + t_1));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[z, 3.6e-10], N[(N[(t$95$2 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(1.0 + N[(N[(1.0 / N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] + N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$1 - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + t$95$2), $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[z], $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + z}\\
t_2 := \sqrt{1 + x}\\
\mathbf{if}\;z \leq 3.6 \cdot 10^{-10}:\\
\;\;\;\;\left(t_2 - \sqrt{x}\right) + \left(1 + \left(\frac{1}{\sqrt{1 + t} + \sqrt{t}} + \left(t_1 - \sqrt{z}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{1}{\sqrt{x} + t_2} + \frac{1}{\sqrt{1 + y} + \sqrt{y}}\right) + \frac{1}{\sqrt{z} + t_1}\\
\end{array}
\end{array}
if z < 3.6e-10Initial program 96.9%
associate-+l+96.9%
associate-+l+96.9%
+-commutative96.9%
+-commutative96.9%
+-commutative96.9%
Simplified96.9%
flip--97.1%
add-sqr-sqrt72.7%
add-sqr-sqrt97.3%
Applied egg-rr97.3%
associate--l+97.4%
+-inverses97.4%
metadata-eval97.4%
+-commutative97.4%
+-commutative97.4%
Simplified97.4%
Taylor expanded in y around 0 54.3%
if 3.6e-10 < z Initial program 85.2%
associate-+l+85.2%
associate-+l+85.2%
+-commutative85.2%
+-commutative85.2%
+-commutative85.2%
Simplified85.2%
flip--85.6%
add-sqr-sqrt71.6%
add-sqr-sqrt85.9%
Applied egg-rr85.9%
+-commutative85.9%
associate--l+88.1%
+-inverses88.1%
metadata-eval88.1%
+-commutative88.1%
+-commutative88.1%
Simplified88.1%
flip--88.2%
add-sqr-sqrt75.0%
add-sqr-sqrt88.7%
Applied egg-rr88.7%
associate--l+91.8%
+-inverses91.8%
metadata-eval91.8%
Simplified91.8%
flip--92.0%
add-sqr-sqrt54.2%
add-sqr-sqrt92.3%
Applied egg-rr92.3%
associate--l+96.5%
+-inverses96.5%
metadata-eval96.5%
+-commutative96.5%
+-commutative96.5%
Simplified96.5%
Taylor expanded in t around inf 57.9%
associate-+r+57.9%
+-commutative57.9%
Simplified57.9%
Final simplification56.1%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (sqrt (+ 1.0 z)) (sqrt z))) (t_2 (sqrt (+ 1.0 x))))
(if (<= y 3.2e-34)
(+ (- t_2 (sqrt x)) (+ 1.0 (+ (/ 1.0 (+ (sqrt (+ 1.0 t)) (sqrt t))) t_1)))
(if (<= y 1.1e+55)
(+ t_2 (+ (/ 1.0 (+ (sqrt (+ 1.0 y)) (sqrt y))) (- t_1 (sqrt x))))
(/ 1.0 (+ (sqrt x) t_2))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + z)) - sqrt(z);
double t_2 = sqrt((1.0 + x));
double tmp;
if (y <= 3.2e-34) {
tmp = (t_2 - sqrt(x)) + (1.0 + ((1.0 / (sqrt((1.0 + t)) + sqrt(t))) + t_1));
} else if (y <= 1.1e+55) {
tmp = t_2 + ((1.0 / (sqrt((1.0 + y)) + sqrt(y))) + (t_1 - sqrt(x)));
} else {
tmp = 1.0 / (sqrt(x) + t_2);
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = sqrt((1.0d0 + z)) - sqrt(z)
t_2 = sqrt((1.0d0 + x))
if (y <= 3.2d-34) then
tmp = (t_2 - sqrt(x)) + (1.0d0 + ((1.0d0 / (sqrt((1.0d0 + t)) + sqrt(t))) + t_1))
else if (y <= 1.1d+55) then
tmp = t_2 + ((1.0d0 / (sqrt((1.0d0 + y)) + sqrt(y))) + (t_1 - sqrt(x)))
else
tmp = 1.0d0 / (sqrt(x) + t_2)
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + z)) - Math.sqrt(z);
double t_2 = Math.sqrt((1.0 + x));
double tmp;
if (y <= 3.2e-34) {
tmp = (t_2 - Math.sqrt(x)) + (1.0 + ((1.0 / (Math.sqrt((1.0 + t)) + Math.sqrt(t))) + t_1));
} else if (y <= 1.1e+55) {
tmp = t_2 + ((1.0 / (Math.sqrt((1.0 + y)) + Math.sqrt(y))) + (t_1 - Math.sqrt(x)));
} else {
tmp = 1.0 / (Math.sqrt(x) + t_2);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + z)) - math.sqrt(z) t_2 = math.sqrt((1.0 + x)) tmp = 0 if y <= 3.2e-34: tmp = (t_2 - math.sqrt(x)) + (1.0 + ((1.0 / (math.sqrt((1.0 + t)) + math.sqrt(t))) + t_1)) elif y <= 1.1e+55: tmp = t_2 + ((1.0 / (math.sqrt((1.0 + y)) + math.sqrt(y))) + (t_1 - math.sqrt(x))) else: tmp = 1.0 / (math.sqrt(x) + t_2) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = Float64(sqrt(Float64(1.0 + z)) - sqrt(z)) t_2 = sqrt(Float64(1.0 + x)) tmp = 0.0 if (y <= 3.2e-34) tmp = Float64(Float64(t_2 - sqrt(x)) + Float64(1.0 + Float64(Float64(1.0 / Float64(sqrt(Float64(1.0 + t)) + sqrt(t))) + t_1))); elseif (y <= 1.1e+55) tmp = Float64(t_2 + Float64(Float64(1.0 / Float64(sqrt(Float64(1.0 + y)) + sqrt(y))) + Float64(t_1 - sqrt(x)))); else tmp = Float64(1.0 / Float64(sqrt(x) + t_2)); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + z)) - sqrt(z);
t_2 = sqrt((1.0 + x));
tmp = 0.0;
if (y <= 3.2e-34)
tmp = (t_2 - sqrt(x)) + (1.0 + ((1.0 / (sqrt((1.0 + t)) + sqrt(t))) + t_1));
elseif (y <= 1.1e+55)
tmp = t_2 + ((1.0 / (sqrt((1.0 + y)) + sqrt(y))) + (t_1 - sqrt(x)));
else
tmp = 1.0 / (sqrt(x) + t_2);
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y, 3.2e-34], N[(N[(t$95$2 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(1.0 + N[(N[(1.0 / N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] + N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.1e+55], N[(t$95$2 + N[(N[(1.0 / N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$1 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + t$95$2), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + z} - \sqrt{z}\\
t_2 := \sqrt{1 + x}\\
\mathbf{if}\;y \leq 3.2 \cdot 10^{-34}:\\
\;\;\;\;\left(t_2 - \sqrt{x}\right) + \left(1 + \left(\frac{1}{\sqrt{1 + t} + \sqrt{t}} + t_1\right)\right)\\
\mathbf{elif}\;y \leq 1.1 \cdot 10^{+55}:\\
\;\;\;\;t_2 + \left(\frac{1}{\sqrt{1 + y} + \sqrt{y}} + \left(t_1 - \sqrt{x}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{x} + t_2}\\
\end{array}
\end{array}
if y < 3.20000000000000003e-34Initial program 97.0%
associate-+l+97.0%
associate-+l+97.0%
+-commutative97.0%
+-commutative97.0%
+-commutative97.0%
Simplified97.0%
flip--97.0%
add-sqr-sqrt74.7%
add-sqr-sqrt97.6%
Applied egg-rr97.6%
associate--l+97.6%
+-inverses97.6%
metadata-eval97.6%
+-commutative97.6%
+-commutative97.6%
Simplified97.6%
Taylor expanded in y around 0 97.6%
if 3.20000000000000003e-34 < y < 1.10000000000000005e55Initial program 89.9%
associate-+l+89.9%
+-commutative89.9%
associate-+r-69.5%
associate-+l-52.7%
+-commutative52.7%
+-commutative52.7%
associate--l+52.7%
Simplified33.0%
Taylor expanded in t around inf 32.1%
associate--l+33.5%
+-commutative33.5%
Simplified33.5%
flip--91.3%
add-sqr-sqrt72.7%
add-sqr-sqrt93.8%
Applied egg-rr35.0%
associate--l+98.8%
+-inverses98.8%
metadata-eval98.8%
Simplified35.5%
if 1.10000000000000005e55 < y Initial program 84.2%
associate-+l+84.2%
+-commutative84.2%
associate-+r-84.2%
associate-+l-54.4%
+-commutative54.4%
+-commutative54.4%
associate--l+54.4%
Simplified32.1%
Taylor expanded in t around inf 37.2%
associate--l+36.9%
+-commutative36.9%
Simplified36.9%
Taylor expanded in z around inf 23.2%
+-commutative23.2%
Simplified23.2%
Taylor expanded in y around inf 22.4%
flip--22.4%
add-sqr-sqrt22.7%
add-sqr-sqrt22.4%
+-commutative22.4%
Applied egg-rr22.4%
associate--l+26.2%
+-inverses26.2%
metadata-eval26.2%
Simplified26.2%
Final simplification59.3%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(if (<= t 3.5e+15)
(+
(+ (hypot 1.0 (sqrt t)) (hypot 1.0 (sqrt y)))
(- 2.0 (+ (sqrt y) (sqrt t))))
(+
(sqrt (+ 1.0 x))
(-
(- (sqrt (+ 1.0 y)) (sqrt y))
(+ (sqrt x) (/ -1.0 (+ (sqrt z) (sqrt (+ 1.0 z)))))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (t <= 3.5e+15) {
tmp = (hypot(1.0, sqrt(t)) + hypot(1.0, sqrt(y))) + (2.0 - (sqrt(y) + sqrt(t)));
} else {
tmp = sqrt((1.0 + x)) + ((sqrt((1.0 + y)) - sqrt(y)) - (sqrt(x) + (-1.0 / (sqrt(z) + sqrt((1.0 + z))))));
}
return tmp;
}
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (t <= 3.5e+15) {
tmp = (Math.hypot(1.0, Math.sqrt(t)) + Math.hypot(1.0, Math.sqrt(y))) + (2.0 - (Math.sqrt(y) + Math.sqrt(t)));
} else {
tmp = Math.sqrt((1.0 + x)) + ((Math.sqrt((1.0 + y)) - Math.sqrt(y)) - (Math.sqrt(x) + (-1.0 / (Math.sqrt(z) + Math.sqrt((1.0 + z))))));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if t <= 3.5e+15: tmp = (math.hypot(1.0, math.sqrt(t)) + math.hypot(1.0, math.sqrt(y))) + (2.0 - (math.sqrt(y) + math.sqrt(t))) else: tmp = math.sqrt((1.0 + x)) + ((math.sqrt((1.0 + y)) - math.sqrt(y)) - (math.sqrt(x) + (-1.0 / (math.sqrt(z) + math.sqrt((1.0 + z)))))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (t <= 3.5e+15) tmp = Float64(Float64(hypot(1.0, sqrt(t)) + hypot(1.0, sqrt(y))) + Float64(2.0 - Float64(sqrt(y) + sqrt(t)))); else tmp = Float64(sqrt(Float64(1.0 + x)) + Float64(Float64(sqrt(Float64(1.0 + y)) - sqrt(y)) - Float64(sqrt(x) + Float64(-1.0 / Float64(sqrt(z) + sqrt(Float64(1.0 + z))))))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (t <= 3.5e+15)
tmp = (hypot(1.0, sqrt(t)) + hypot(1.0, sqrt(y))) + (2.0 - (sqrt(y) + sqrt(t)));
else
tmp = sqrt((1.0 + x)) + ((sqrt((1.0 + y)) - sqrt(y)) - (sqrt(x) + (-1.0 / (sqrt(z) + sqrt((1.0 + z))))));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[t, 3.5e+15], N[(N[(N[Sqrt[1.0 ^ 2 + N[Sqrt[t], $MachinePrecision] ^ 2], $MachinePrecision] + N[Sqrt[1.0 ^ 2 + N[Sqrt[y], $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision] + N[(2.0 - N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision] + N[(N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[x], $MachinePrecision] + N[(-1.0 / N[(N[Sqrt[z], $MachinePrecision] + N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq 3.5 \cdot 10^{+15}:\\
\;\;\;\;\left(\mathsf{hypot}\left(1, \sqrt{t}\right) + \mathsf{hypot}\left(1, \sqrt{y}\right)\right) + \left(2 - \left(\sqrt{y} + \sqrt{t}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\sqrt{1 + x} + \left(\left(\sqrt{1 + y} - \sqrt{y}\right) - \left(\sqrt{x} + \frac{-1}{\sqrt{z} + \sqrt{1 + z}}\right)\right)\\
\end{array}
\end{array}
if t < 3.5e15Initial program 96.0%
associate-+l+96.0%
associate-+l+96.0%
+-commutative96.0%
+-commutative96.0%
+-commutative96.0%
Simplified96.0%
flip--96.0%
add-sqr-sqrt74.5%
add-sqr-sqrt96.5%
Applied egg-rr96.5%
+-commutative96.5%
associate--l+97.0%
+-inverses97.0%
metadata-eval97.0%
+-commutative97.0%
+-commutative97.0%
Simplified97.0%
Taylor expanded in x around 0 22.4%
associate--l+40.6%
associate--r+40.6%
associate-+r+40.6%
+-commutative40.6%
Simplified40.6%
Taylor expanded in z around 0 24.0%
+-commutative24.0%
associate--l+24.0%
rem-square-sqrt24.0%
hypot-1-def24.0%
rem-square-sqrt24.0%
hypot-1-def24.0%
+-commutative24.0%
Simplified24.0%
if 3.5e15 < t Initial program 86.1%
associate-+l+86.1%
+-commutative86.1%
associate-+r-70.3%
associate-+l-59.2%
+-commutative59.2%
+-commutative59.2%
associate--l+59.2%
Simplified18.6%
Taylor expanded in t around inf 57.2%
associate--l+59.2%
+-commutative59.2%
Simplified59.2%
flip--59.2%
add-sqr-sqrt46.6%
add-sqr-sqrt59.2%
+-commutative59.2%
+-commutative59.2%
Applied egg-rr59.2%
+-commutative59.2%
Simplified59.2%
Taylor expanded in z around 0 59.5%
Final simplification42.3%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(if (<= t 3.5e+15)
(+
(+ (hypot 1.0 (sqrt t)) (hypot 1.0 (sqrt y)))
(- 2.0 (+ (sqrt y) (sqrt t))))
(+
(sqrt (+ 1.0 x))
(+
(/ 1.0 (+ (sqrt (+ 1.0 y)) (sqrt y)))
(- (- (sqrt (+ 1.0 z)) (sqrt z)) (sqrt x))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (t <= 3.5e+15) {
tmp = (hypot(1.0, sqrt(t)) + hypot(1.0, sqrt(y))) + (2.0 - (sqrt(y) + sqrt(t)));
} else {
tmp = sqrt((1.0 + x)) + ((1.0 / (sqrt((1.0 + y)) + sqrt(y))) + ((sqrt((1.0 + z)) - sqrt(z)) - sqrt(x)));
}
return tmp;
}
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (t <= 3.5e+15) {
tmp = (Math.hypot(1.0, Math.sqrt(t)) + Math.hypot(1.0, Math.sqrt(y))) + (2.0 - (Math.sqrt(y) + Math.sqrt(t)));
} else {
tmp = Math.sqrt((1.0 + x)) + ((1.0 / (Math.sqrt((1.0 + y)) + Math.sqrt(y))) + ((Math.sqrt((1.0 + z)) - Math.sqrt(z)) - Math.sqrt(x)));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if t <= 3.5e+15: tmp = (math.hypot(1.0, math.sqrt(t)) + math.hypot(1.0, math.sqrt(y))) + (2.0 - (math.sqrt(y) + math.sqrt(t))) else: tmp = math.sqrt((1.0 + x)) + ((1.0 / (math.sqrt((1.0 + y)) + math.sqrt(y))) + ((math.sqrt((1.0 + z)) - math.sqrt(z)) - math.sqrt(x))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (t <= 3.5e+15) tmp = Float64(Float64(hypot(1.0, sqrt(t)) + hypot(1.0, sqrt(y))) + Float64(2.0 - Float64(sqrt(y) + sqrt(t)))); else tmp = Float64(sqrt(Float64(1.0 + x)) + Float64(Float64(1.0 / Float64(sqrt(Float64(1.0 + y)) + sqrt(y))) + Float64(Float64(sqrt(Float64(1.0 + z)) - sqrt(z)) - sqrt(x)))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (t <= 3.5e+15)
tmp = (hypot(1.0, sqrt(t)) + hypot(1.0, sqrt(y))) + (2.0 - (sqrt(y) + sqrt(t)));
else
tmp = sqrt((1.0 + x)) + ((1.0 / (sqrt((1.0 + y)) + sqrt(y))) + ((sqrt((1.0 + z)) - sqrt(z)) - sqrt(x)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[t, 3.5e+15], N[(N[(N[Sqrt[1.0 ^ 2 + N[Sqrt[t], $MachinePrecision] ^ 2], $MachinePrecision] + N[Sqrt[1.0 ^ 2 + N[Sqrt[y], $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision] + N[(2.0 - N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision] + N[(N[(1.0 / N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq 3.5 \cdot 10^{+15}:\\
\;\;\;\;\left(\mathsf{hypot}\left(1, \sqrt{t}\right) + \mathsf{hypot}\left(1, \sqrt{y}\right)\right) + \left(2 - \left(\sqrt{y} + \sqrt{t}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\sqrt{1 + x} + \left(\frac{1}{\sqrt{1 + y} + \sqrt{y}} + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) - \sqrt{x}\right)\right)\\
\end{array}
\end{array}
if t < 3.5e15Initial program 96.0%
associate-+l+96.0%
associate-+l+96.0%
+-commutative96.0%
+-commutative96.0%
+-commutative96.0%
Simplified96.0%
flip--96.0%
add-sqr-sqrt74.5%
add-sqr-sqrt96.5%
Applied egg-rr96.5%
+-commutative96.5%
associate--l+97.0%
+-inverses97.0%
metadata-eval97.0%
+-commutative97.0%
+-commutative97.0%
Simplified97.0%
Taylor expanded in x around 0 22.4%
associate--l+40.6%
associate--r+40.6%
associate-+r+40.6%
+-commutative40.6%
Simplified40.6%
Taylor expanded in z around 0 24.0%
+-commutative24.0%
associate--l+24.0%
rem-square-sqrt24.0%
hypot-1-def24.0%
rem-square-sqrt24.0%
hypot-1-def24.0%
+-commutative24.0%
Simplified24.0%
if 3.5e15 < t Initial program 86.1%
associate-+l+86.1%
+-commutative86.1%
associate-+r-70.3%
associate-+l-59.2%
+-commutative59.2%
+-commutative59.2%
associate--l+59.2%
Simplified18.6%
Taylor expanded in t around inf 57.2%
associate--l+59.2%
+-commutative59.2%
Simplified59.2%
flip--89.3%
add-sqr-sqrt73.1%
add-sqr-sqrt90.1%
Applied egg-rr59.7%
associate--l+93.3%
+-inverses93.3%
metadata-eval93.3%
Simplified59.8%
Final simplification42.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 (<= t 3.5e+15)
(+
(+ (hypot 1.0 (sqrt t)) (hypot 1.0 (sqrt y)))
(- 2.0 (+ (sqrt y) (sqrt t))))
(+
1.0
(+ (sqrt (+ 1.0 y)) (- (/ 1.0 (+ (sqrt z) (sqrt (+ 1.0 z)))) (sqrt y))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (t <= 3.5e+15) {
tmp = (hypot(1.0, sqrt(t)) + hypot(1.0, sqrt(y))) + (2.0 - (sqrt(y) + sqrt(t)));
} else {
tmp = 1.0 + (sqrt((1.0 + y)) + ((1.0 / (sqrt(z) + sqrt((1.0 + z)))) - sqrt(y)));
}
return tmp;
}
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (t <= 3.5e+15) {
tmp = (Math.hypot(1.0, Math.sqrt(t)) + Math.hypot(1.0, Math.sqrt(y))) + (2.0 - (Math.sqrt(y) + Math.sqrt(t)));
} else {
tmp = 1.0 + (Math.sqrt((1.0 + y)) + ((1.0 / (Math.sqrt(z) + Math.sqrt((1.0 + z)))) - Math.sqrt(y)));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if t <= 3.5e+15: tmp = (math.hypot(1.0, math.sqrt(t)) + math.hypot(1.0, math.sqrt(y))) + (2.0 - (math.sqrt(y) + math.sqrt(t))) else: tmp = 1.0 + (math.sqrt((1.0 + y)) + ((1.0 / (math.sqrt(z) + math.sqrt((1.0 + z)))) - math.sqrt(y))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (t <= 3.5e+15) tmp = Float64(Float64(hypot(1.0, sqrt(t)) + hypot(1.0, sqrt(y))) + Float64(2.0 - Float64(sqrt(y) + sqrt(t)))); else tmp = Float64(1.0 + Float64(sqrt(Float64(1.0 + y)) + Float64(Float64(1.0 / Float64(sqrt(z) + sqrt(Float64(1.0 + z)))) - sqrt(y)))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (t <= 3.5e+15)
tmp = (hypot(1.0, sqrt(t)) + hypot(1.0, sqrt(y))) + (2.0 - (sqrt(y) + sqrt(t)));
else
tmp = 1.0 + (sqrt((1.0 + y)) + ((1.0 / (sqrt(z) + sqrt((1.0 + z)))) - sqrt(y)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[t, 3.5e+15], N[(N[(N[Sqrt[1.0 ^ 2 + N[Sqrt[t], $MachinePrecision] ^ 2], $MachinePrecision] + N[Sqrt[1.0 ^ 2 + N[Sqrt[y], $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision] + N[(2.0 - N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] + N[(N[(1.0 / N[(N[Sqrt[z], $MachinePrecision] + N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq 3.5 \cdot 10^{+15}:\\
\;\;\;\;\left(\mathsf{hypot}\left(1, \sqrt{t}\right) + \mathsf{hypot}\left(1, \sqrt{y}\right)\right) + \left(2 - \left(\sqrt{y} + \sqrt{t}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;1 + \left(\sqrt{1 + y} + \left(\frac{1}{\sqrt{z} + \sqrt{1 + z}} - \sqrt{y}\right)\right)\\
\end{array}
\end{array}
if t < 3.5e15Initial program 96.0%
associate-+l+96.0%
associate-+l+96.0%
+-commutative96.0%
+-commutative96.0%
+-commutative96.0%
Simplified96.0%
flip--96.0%
add-sqr-sqrt74.5%
add-sqr-sqrt96.5%
Applied egg-rr96.5%
+-commutative96.5%
associate--l+97.0%
+-inverses97.0%
metadata-eval97.0%
+-commutative97.0%
+-commutative97.0%
Simplified97.0%
Taylor expanded in x around 0 22.4%
associate--l+40.6%
associate--r+40.6%
associate-+r+40.6%
+-commutative40.6%
Simplified40.6%
Taylor expanded in z around 0 24.0%
+-commutative24.0%
associate--l+24.0%
rem-square-sqrt24.0%
hypot-1-def24.0%
rem-square-sqrt24.0%
hypot-1-def24.0%
+-commutative24.0%
Simplified24.0%
if 3.5e15 < t Initial program 86.1%
associate-+l+86.1%
+-commutative86.1%
associate-+r-70.3%
associate-+l-59.2%
+-commutative59.2%
+-commutative59.2%
associate--l+59.2%
Simplified18.6%
Taylor expanded in t around inf 57.2%
associate--l+59.2%
+-commutative59.2%
Simplified59.2%
flip--59.2%
add-sqr-sqrt46.6%
add-sqr-sqrt59.2%
+-commutative59.2%
+-commutative59.2%
Applied egg-rr59.2%
+-commutative59.2%
Simplified59.2%
Taylor expanded in x around 0 35.8%
associate--l+58.8%
associate--l+58.8%
+-commutative58.8%
Simplified58.8%
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
(let* ((t_1 (sqrt (+ 1.0 z))))
(if (<= t 3.5e+15)
(+ 2.0 (+ (sqrt (+ 1.0 t)) (- t_1 (+ (sqrt z) (sqrt t)))))
(+ 1.0 (+ (sqrt (+ 1.0 y)) (- (/ 1.0 (+ (sqrt z) t_1)) (sqrt y)))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + z));
double tmp;
if (t <= 3.5e+15) {
tmp = 2.0 + (sqrt((1.0 + t)) + (t_1 - (sqrt(z) + sqrt(t))));
} else {
tmp = 1.0 + (sqrt((1.0 + y)) + ((1.0 / (sqrt(z) + t_1)) - sqrt(y)));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = sqrt((1.0d0 + z))
if (t <= 3.5d+15) then
tmp = 2.0d0 + (sqrt((1.0d0 + t)) + (t_1 - (sqrt(z) + sqrt(t))))
else
tmp = 1.0d0 + (sqrt((1.0d0 + y)) + ((1.0d0 / (sqrt(z) + t_1)) - sqrt(y)))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + z));
double tmp;
if (t <= 3.5e+15) {
tmp = 2.0 + (Math.sqrt((1.0 + t)) + (t_1 - (Math.sqrt(z) + Math.sqrt(t))));
} else {
tmp = 1.0 + (Math.sqrt((1.0 + y)) + ((1.0 / (Math.sqrt(z) + t_1)) - Math.sqrt(y)));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + z)) tmp = 0 if t <= 3.5e+15: tmp = 2.0 + (math.sqrt((1.0 + t)) + (t_1 - (math.sqrt(z) + math.sqrt(t)))) else: tmp = 1.0 + (math.sqrt((1.0 + y)) + ((1.0 / (math.sqrt(z) + t_1)) - math.sqrt(y))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(1.0 + z)) tmp = 0.0 if (t <= 3.5e+15) tmp = Float64(2.0 + Float64(sqrt(Float64(1.0 + t)) + Float64(t_1 - Float64(sqrt(z) + sqrt(t))))); else tmp = Float64(1.0 + Float64(sqrt(Float64(1.0 + y)) + Float64(Float64(1.0 / Float64(sqrt(z) + t_1)) - sqrt(y)))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + z));
tmp = 0.0;
if (t <= 3.5e+15)
tmp = 2.0 + (sqrt((1.0 + t)) + (t_1 - (sqrt(z) + sqrt(t))));
else
tmp = 1.0 + (sqrt((1.0 + y)) + ((1.0 / (sqrt(z) + t_1)) - sqrt(y)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t, 3.5e+15], N[(2.0 + N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] + N[(t$95$1 - N[(N[Sqrt[z], $MachinePrecision] + N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] + N[(N[(1.0 / N[(N[Sqrt[z], $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + z}\\
\mathbf{if}\;t \leq 3.5 \cdot 10^{+15}:\\
\;\;\;\;2 + \left(\sqrt{1 + t} + \left(t_1 - \left(\sqrt{z} + \sqrt{t}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;1 + \left(\sqrt{1 + y} + \left(\frac{1}{\sqrt{z} + t_1} - \sqrt{y}\right)\right)\\
\end{array}
\end{array}
if t < 3.5e15Initial program 96.0%
associate-+l+96.0%
associate-+l+96.0%
+-commutative96.0%
+-commutative96.0%
+-commutative96.0%
Simplified96.0%
flip--96.0%
add-sqr-sqrt74.5%
add-sqr-sqrt96.5%
Applied egg-rr96.5%
+-commutative96.5%
associate--l+97.0%
+-inverses97.0%
metadata-eval97.0%
+-commutative97.0%
+-commutative97.0%
Simplified97.0%
Taylor expanded in x around 0 22.4%
associate--l+40.6%
associate--r+40.6%
associate-+r+40.6%
+-commutative40.6%
Simplified40.6%
Taylor expanded in y around 0 25.0%
associate--l+47.6%
associate--l+40.0%
+-commutative40.0%
Simplified40.0%
if 3.5e15 < t Initial program 86.1%
associate-+l+86.1%
+-commutative86.1%
associate-+r-70.3%
associate-+l-59.2%
+-commutative59.2%
+-commutative59.2%
associate--l+59.2%
Simplified18.6%
Taylor expanded in t around inf 57.2%
associate--l+59.2%
+-commutative59.2%
Simplified59.2%
flip--59.2%
add-sqr-sqrt46.6%
add-sqr-sqrt59.2%
+-commutative59.2%
+-commutative59.2%
Applied egg-rr59.2%
+-commutative59.2%
Simplified59.2%
Taylor expanded in x around 0 35.8%
associate--l+58.8%
associate--l+58.8%
+-commutative58.8%
Simplified58.8%
Final simplification49.7%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ 1.0 x))) (t_2 (sqrt (+ 1.0 y))))
(if (<= z 1.3e+15)
(- (+ (sqrt (+ 1.0 z)) 2.0) (+ (sqrt y) (sqrt z)))
(if (<= z 1.05e+223)
(+ t_1 (- t_2 (+ (sqrt x) (sqrt y))))
(if (<= z 1.75e+253)
(/ 1.0 (+ (sqrt x) t_1))
(+ 1.0 (- t_2 (sqrt y))))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + x));
double t_2 = sqrt((1.0 + y));
double tmp;
if (z <= 1.3e+15) {
tmp = (sqrt((1.0 + z)) + 2.0) - (sqrt(y) + sqrt(z));
} else if (z <= 1.05e+223) {
tmp = t_1 + (t_2 - (sqrt(x) + sqrt(y)));
} else if (z <= 1.75e+253) {
tmp = 1.0 / (sqrt(x) + t_1);
} else {
tmp = 1.0 + (t_2 - sqrt(y));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = sqrt((1.0d0 + x))
t_2 = sqrt((1.0d0 + y))
if (z <= 1.3d+15) then
tmp = (sqrt((1.0d0 + z)) + 2.0d0) - (sqrt(y) + sqrt(z))
else if (z <= 1.05d+223) then
tmp = t_1 + (t_2 - (sqrt(x) + sqrt(y)))
else if (z <= 1.75d+253) then
tmp = 1.0d0 / (sqrt(x) + t_1)
else
tmp = 1.0d0 + (t_2 - sqrt(y))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + x));
double t_2 = Math.sqrt((1.0 + y));
double tmp;
if (z <= 1.3e+15) {
tmp = (Math.sqrt((1.0 + z)) + 2.0) - (Math.sqrt(y) + Math.sqrt(z));
} else if (z <= 1.05e+223) {
tmp = t_1 + (t_2 - (Math.sqrt(x) + Math.sqrt(y)));
} else if (z <= 1.75e+253) {
tmp = 1.0 / (Math.sqrt(x) + t_1);
} else {
tmp = 1.0 + (t_2 - Math.sqrt(y));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + x)) t_2 = math.sqrt((1.0 + y)) tmp = 0 if z <= 1.3e+15: tmp = (math.sqrt((1.0 + z)) + 2.0) - (math.sqrt(y) + math.sqrt(z)) elif z <= 1.05e+223: tmp = t_1 + (t_2 - (math.sqrt(x) + math.sqrt(y))) elif z <= 1.75e+253: tmp = 1.0 / (math.sqrt(x) + t_1) else: tmp = 1.0 + (t_2 - math.sqrt(y)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(1.0 + x)) t_2 = sqrt(Float64(1.0 + y)) tmp = 0.0 if (z <= 1.3e+15) tmp = Float64(Float64(sqrt(Float64(1.0 + z)) + 2.0) - Float64(sqrt(y) + sqrt(z))); elseif (z <= 1.05e+223) tmp = Float64(t_1 + Float64(t_2 - Float64(sqrt(x) + sqrt(y)))); elseif (z <= 1.75e+253) tmp = Float64(1.0 / Float64(sqrt(x) + t_1)); else tmp = Float64(1.0 + Float64(t_2 - sqrt(y))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + x));
t_2 = sqrt((1.0 + y));
tmp = 0.0;
if (z <= 1.3e+15)
tmp = (sqrt((1.0 + z)) + 2.0) - (sqrt(y) + sqrt(z));
elseif (z <= 1.05e+223)
tmp = t_1 + (t_2 - (sqrt(x) + sqrt(y)));
elseif (z <= 1.75e+253)
tmp = 1.0 / (sqrt(x) + t_1);
else
tmp = 1.0 + (t_2 - sqrt(y));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[z, 1.3e+15], N[(N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] + 2.0), $MachinePrecision] - N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.05e+223], N[(t$95$1 + N[(t$95$2 - N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.75e+253], N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(t$95$2 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + x}\\
t_2 := \sqrt{1 + y}\\
\mathbf{if}\;z \leq 1.3 \cdot 10^{+15}:\\
\;\;\;\;\left(\sqrt{1 + z} + 2\right) - \left(\sqrt{y} + \sqrt{z}\right)\\
\mathbf{elif}\;z \leq 1.05 \cdot 10^{+223}:\\
\;\;\;\;t_1 + \left(t_2 - \left(\sqrt{x} + \sqrt{y}\right)\right)\\
\mathbf{elif}\;z \leq 1.75 \cdot 10^{+253}:\\
\;\;\;\;\frac{1}{\sqrt{x} + t_1}\\
\mathbf{else}:\\
\;\;\;\;1 + \left(t_2 - \sqrt{y}\right)\\
\end{array}
\end{array}
if z < 1.3e15Initial program 96.5%
associate-+l+96.5%
+-commutative96.5%
associate-+r-82.3%
associate-+l-60.6%
+-commutative60.6%
+-commutative60.6%
associate--l+60.6%
Simplified37.9%
Taylor expanded in t around inf 37.7%
associate--l+37.7%
+-commutative37.7%
Simplified37.7%
Taylor expanded in y around 0 18.7%
Taylor expanded in x around 0 26.6%
if 1.3e15 < z < 1.04999999999999995e223Initial program 84.9%
associate-+l+84.9%
+-commutative84.9%
associate-+r-66.8%
associate-+l-56.3%
+-commutative56.3%
+-commutative56.3%
associate--l+56.3%
Simplified39.6%
Taylor expanded in t around inf 33.2%
associate--l+35.9%
+-commutative35.9%
Simplified35.9%
Taylor expanded in z around inf 35.8%
+-commutative35.8%
Simplified35.8%
if 1.04999999999999995e223 < z < 1.74999999999999989e253Initial program 80.7%
associate-+l+80.7%
+-commutative80.7%
associate-+r-68.8%
associate-+l-61.3%
+-commutative61.3%
+-commutative61.3%
associate--l+61.3%
Simplified34.9%
Taylor expanded in t around inf 41.0%
associate--l+39.9%
+-commutative39.9%
Simplified39.9%
Taylor expanded in z around inf 40.4%
+-commutative40.4%
Simplified40.4%
Taylor expanded in y around inf 28.7%
flip--28.7%
add-sqr-sqrt29.0%
add-sqr-sqrt28.7%
+-commutative28.7%
Applied egg-rr28.7%
associate--l+36.3%
+-inverses36.3%
metadata-eval36.3%
Simplified36.3%
if 1.74999999999999989e253 < z Initial program 86.8%
associate-+l+86.8%
+-commutative86.8%
associate-+r-66.8%
associate-+l-55.9%
+-commutative55.9%
+-commutative55.9%
associate--l+55.9%
Simplified28.7%
Taylor expanded in t around inf 35.5%
associate--l+36.6%
+-commutative36.6%
Simplified36.6%
Taylor expanded in z around inf 36.6%
+-commutative36.6%
Simplified36.6%
Taylor expanded in x around 0 41.3%
associate--l+59.0%
Simplified59.0%
Final simplification33.7%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ 1.0 x))) (t_2 (sqrt (+ 1.0 y))))
(if (<= y 3.45e-34)
(+ 1.0 (+ t_2 (- (sqrt (+ 1.0 z)) (+ (sqrt y) (sqrt z)))))
(if (<= y 7.8e+54)
(+ t_1 (- (- t_2 (sqrt y)) (sqrt x)))
(/ 1.0 (+ (sqrt x) t_1))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + x));
double t_2 = sqrt((1.0 + y));
double tmp;
if (y <= 3.45e-34) {
tmp = 1.0 + (t_2 + (sqrt((1.0 + z)) - (sqrt(y) + sqrt(z))));
} else if (y <= 7.8e+54) {
tmp = t_1 + ((t_2 - sqrt(y)) - sqrt(x));
} else {
tmp = 1.0 / (sqrt(x) + t_1);
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = sqrt((1.0d0 + x))
t_2 = sqrt((1.0d0 + y))
if (y <= 3.45d-34) then
tmp = 1.0d0 + (t_2 + (sqrt((1.0d0 + z)) - (sqrt(y) + sqrt(z))))
else if (y <= 7.8d+54) then
tmp = t_1 + ((t_2 - sqrt(y)) - sqrt(x))
else
tmp = 1.0d0 / (sqrt(x) + t_1)
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + x));
double t_2 = Math.sqrt((1.0 + y));
double tmp;
if (y <= 3.45e-34) {
tmp = 1.0 + (t_2 + (Math.sqrt((1.0 + z)) - (Math.sqrt(y) + Math.sqrt(z))));
} else if (y <= 7.8e+54) {
tmp = t_1 + ((t_2 - Math.sqrt(y)) - Math.sqrt(x));
} else {
tmp = 1.0 / (Math.sqrt(x) + t_1);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + x)) t_2 = math.sqrt((1.0 + y)) tmp = 0 if y <= 3.45e-34: tmp = 1.0 + (t_2 + (math.sqrt((1.0 + z)) - (math.sqrt(y) + math.sqrt(z)))) elif y <= 7.8e+54: tmp = t_1 + ((t_2 - math.sqrt(y)) - math.sqrt(x)) else: tmp = 1.0 / (math.sqrt(x) + t_1) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(1.0 + x)) t_2 = sqrt(Float64(1.0 + y)) tmp = 0.0 if (y <= 3.45e-34) tmp = Float64(1.0 + Float64(t_2 + Float64(sqrt(Float64(1.0 + z)) - Float64(sqrt(y) + sqrt(z))))); elseif (y <= 7.8e+54) tmp = Float64(t_1 + Float64(Float64(t_2 - sqrt(y)) - sqrt(x))); else tmp = Float64(1.0 / Float64(sqrt(x) + t_1)); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + x));
t_2 = sqrt((1.0 + y));
tmp = 0.0;
if (y <= 3.45e-34)
tmp = 1.0 + (t_2 + (sqrt((1.0 + z)) - (sqrt(y) + sqrt(z))));
elseif (y <= 7.8e+54)
tmp = t_1 + ((t_2 - sqrt(y)) - sqrt(x));
else
tmp = 1.0 / (sqrt(x) + t_1);
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y, 3.45e-34], N[(1.0 + N[(t$95$2 + N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 7.8e+54], N[(t$95$1 + N[(N[(t$95$2 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + x}\\
t_2 := \sqrt{1 + y}\\
\mathbf{if}\;y \leq 3.45 \cdot 10^{-34}:\\
\;\;\;\;1 + \left(t_2 + \left(\sqrt{1 + z} - \left(\sqrt{y} + \sqrt{z}\right)\right)\right)\\
\mathbf{elif}\;y \leq 7.8 \cdot 10^{+54}:\\
\;\;\;\;t_1 + \left(\left(t_2 - \sqrt{y}\right) - \sqrt{x}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{x} + t_1}\\
\end{array}
\end{array}
if y < 3.45e-34Initial program 97.0%
associate-+l+97.0%
+-commutative97.0%
associate-+r-69.1%
associate-+l-65.0%
+-commutative65.0%
+-commutative65.0%
associate--l+65.0%
Simplified43.3%
Taylor expanded in t around inf 37.2%
associate--l+38.8%
+-commutative38.8%
Simplified38.8%
Taylor expanded in x around 0 28.2%
associate--l+42.9%
associate--l+56.5%
Simplified56.5%
if 3.45e-34 < y < 7.8000000000000005e54Initial program 89.9%
associate-+l+89.9%
+-commutative89.9%
associate-+r-69.5%
associate-+l-52.7%
+-commutative52.7%
+-commutative52.7%
associate--l+52.7%
Simplified33.0%
Taylor expanded in t around inf 32.1%
associate--l+33.5%
+-commutative33.5%
Simplified33.5%
Taylor expanded in z around inf 19.1%
+-commutative19.1%
Simplified19.1%
sub-neg19.1%
+-commutative19.1%
Applied egg-rr19.1%
sub-neg19.1%
+-commutative19.1%
associate--r+19.5%
Simplified19.5%
if 7.8000000000000005e54 < y Initial program 84.2%
associate-+l+84.2%
+-commutative84.2%
associate-+r-84.2%
associate-+l-54.4%
+-commutative54.4%
+-commutative54.4%
associate--l+54.4%
Simplified32.1%
Taylor expanded in t around inf 37.2%
associate--l+36.9%
+-commutative36.9%
Simplified36.9%
Taylor expanded in z around inf 23.2%
+-commutative23.2%
Simplified23.2%
Taylor expanded in y around inf 22.4%
flip--22.4%
add-sqr-sqrt22.7%
add-sqr-sqrt22.4%
+-commutative22.4%
Applied egg-rr22.4%
associate--l+26.2%
+-inverses26.2%
metadata-eval26.2%
Simplified26.2%
Final simplification38.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 8.8e-7)
(+ t_1 (+ (- 1.0 (sqrt y)) (- (sqrt (+ 1.0 z)) (sqrt z))))
(if (<= y 1e+55)
(+ t_1 (- (- (sqrt (+ 1.0 y)) (sqrt y)) (sqrt x)))
(/ 1.0 (+ (sqrt x) t_1))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + x));
double tmp;
if (y <= 8.8e-7) {
tmp = t_1 + ((1.0 - sqrt(y)) + (sqrt((1.0 + z)) - sqrt(z)));
} else if (y <= 1e+55) {
tmp = t_1 + ((sqrt((1.0 + y)) - sqrt(y)) - sqrt(x));
} else {
tmp = 1.0 / (sqrt(x) + t_1);
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = sqrt((1.0d0 + x))
if (y <= 8.8d-7) then
tmp = t_1 + ((1.0d0 - sqrt(y)) + (sqrt((1.0d0 + z)) - sqrt(z)))
else if (y <= 1d+55) then
tmp = t_1 + ((sqrt((1.0d0 + y)) - sqrt(y)) - sqrt(x))
else
tmp = 1.0d0 / (sqrt(x) + t_1)
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + x));
double tmp;
if (y <= 8.8e-7) {
tmp = t_1 + ((1.0 - Math.sqrt(y)) + (Math.sqrt((1.0 + z)) - Math.sqrt(z)));
} else if (y <= 1e+55) {
tmp = t_1 + ((Math.sqrt((1.0 + y)) - Math.sqrt(y)) - Math.sqrt(x));
} else {
tmp = 1.0 / (Math.sqrt(x) + t_1);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + x)) tmp = 0 if y <= 8.8e-7: tmp = t_1 + ((1.0 - math.sqrt(y)) + (math.sqrt((1.0 + z)) - math.sqrt(z))) elif y <= 1e+55: tmp = t_1 + ((math.sqrt((1.0 + y)) - math.sqrt(y)) - math.sqrt(x)) else: tmp = 1.0 / (math.sqrt(x) + t_1) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(1.0 + x)) tmp = 0.0 if (y <= 8.8e-7) tmp = Float64(t_1 + Float64(Float64(1.0 - sqrt(y)) + Float64(sqrt(Float64(1.0 + z)) - sqrt(z)))); elseif (y <= 1e+55) tmp = Float64(t_1 + Float64(Float64(sqrt(Float64(1.0 + y)) - sqrt(y)) - sqrt(x))); else tmp = Float64(1.0 / Float64(sqrt(x) + t_1)); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + x));
tmp = 0.0;
if (y <= 8.8e-7)
tmp = t_1 + ((1.0 - sqrt(y)) + (sqrt((1.0 + z)) - sqrt(z)));
elseif (y <= 1e+55)
tmp = t_1 + ((sqrt((1.0 + y)) - sqrt(y)) - sqrt(x));
else
tmp = 1.0 / (sqrt(x) + t_1);
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y, 8.8e-7], N[(t$95$1 + N[(N[(1.0 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1e+55], 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[(N[Sqrt[x], $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + x}\\
\mathbf{if}\;y \leq 8.8 \cdot 10^{-7}:\\
\;\;\;\;t_1 + \left(\left(1 - \sqrt{y}\right) + \left(\sqrt{1 + z} - \sqrt{z}\right)\right)\\
\mathbf{elif}\;y \leq 10^{+55}:\\
\;\;\;\;t_1 + \left(\left(\sqrt{1 + y} - \sqrt{y}\right) - \sqrt{x}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{x} + t_1}\\
\end{array}
\end{array}
if y < 8.8000000000000004e-7Initial program 97.0%
associate-+l+97.0%
+-commutative97.0%
associate-+r-67.6%
associate-+l-63.3%
+-commutative63.3%
+-commutative63.3%
associate--l+63.3%
Simplified42.3%
Taylor expanded in t around inf 36.2%
associate--l+37.6%
+-commutative37.6%
Simplified37.6%
Taylor expanded in y around 0 37.6%
Taylor expanded in x around 0 36.0%
if 8.8000000000000004e-7 < y < 1.00000000000000001e55Initial program 87.7%
associate-+l+87.7%
+-commutative87.7%
associate-+r-75.2%
associate-+l-54.8%
+-commutative54.8%
+-commutative54.8%
associate--l+54.8%
Simplified33.4%
Taylor expanded in t around inf 34.1%
associate--l+36.1%
+-commutative36.1%
Simplified36.1%
Taylor expanded in z around inf 21.8%
+-commutative21.8%
Simplified21.8%
sub-neg21.8%
+-commutative21.8%
Applied egg-rr21.8%
sub-neg21.8%
+-commutative21.8%
associate--r+22.3%
Simplified22.3%
if 1.00000000000000001e55 < y Initial program 84.2%
associate-+l+84.2%
+-commutative84.2%
associate-+r-84.2%
associate-+l-54.4%
+-commutative54.4%
+-commutative54.4%
associate--l+54.4%
Simplified32.1%
Taylor expanded in t around inf 37.2%
associate--l+36.9%
+-commutative36.9%
Simplified36.9%
Taylor expanded in z around inf 23.2%
+-commutative23.2%
Simplified23.2%
Taylor expanded in y around inf 22.4%
flip--22.4%
add-sqr-sqrt22.7%
add-sqr-sqrt22.4%
+-commutative22.4%
Applied egg-rr22.4%
associate--l+26.2%
+-inverses26.2%
metadata-eval26.2%
Simplified26.2%
Final simplification30.4%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= z 1.2e+15) (- (+ (sqrt (+ 1.0 z)) 2.0) (+ (sqrt y) (sqrt z))) (+ (sqrt (+ 1.0 x)) (- (- (sqrt (+ 1.0 y)) (sqrt y)) (sqrt x)))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (z <= 1.2e+15) {
tmp = (sqrt((1.0 + z)) + 2.0) - (sqrt(y) + sqrt(z));
} else {
tmp = sqrt((1.0 + x)) + ((sqrt((1.0 + y)) - sqrt(y)) - sqrt(x));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (z <= 1.2d+15) then
tmp = (sqrt((1.0d0 + z)) + 2.0d0) - (sqrt(y) + sqrt(z))
else
tmp = sqrt((1.0d0 + x)) + ((sqrt((1.0d0 + y)) - sqrt(y)) - sqrt(x))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= 1.2e+15) {
tmp = (Math.sqrt((1.0 + z)) + 2.0) - (Math.sqrt(y) + Math.sqrt(z));
} else {
tmp = Math.sqrt((1.0 + x)) + ((Math.sqrt((1.0 + y)) - Math.sqrt(y)) - Math.sqrt(x));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if z <= 1.2e+15: tmp = (math.sqrt((1.0 + z)) + 2.0) - (math.sqrt(y) + math.sqrt(z)) else: tmp = math.sqrt((1.0 + x)) + ((math.sqrt((1.0 + y)) - math.sqrt(y)) - math.sqrt(x)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (z <= 1.2e+15) tmp = Float64(Float64(sqrt(Float64(1.0 + z)) + 2.0) - Float64(sqrt(y) + sqrt(z))); else tmp = Float64(sqrt(Float64(1.0 + x)) + Float64(Float64(sqrt(Float64(1.0 + y)) - sqrt(y)) - sqrt(x))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (z <= 1.2e+15)
tmp = (sqrt((1.0 + z)) + 2.0) - (sqrt(y) + sqrt(z));
else
tmp = sqrt((1.0 + x)) + ((sqrt((1.0 + y)) - sqrt(y)) - sqrt(x));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[z, 1.2e+15], N[(N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] + 2.0), $MachinePrecision] - N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision] + N[(N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq 1.2 \cdot 10^{+15}:\\
\;\;\;\;\left(\sqrt{1 + z} + 2\right) - \left(\sqrt{y} + \sqrt{z}\right)\\
\mathbf{else}:\\
\;\;\;\;\sqrt{1 + x} + \left(\left(\sqrt{1 + y} - \sqrt{y}\right) - \sqrt{x}\right)\\
\end{array}
\end{array}
if z < 1.2e15Initial program 96.5%
associate-+l+96.5%
+-commutative96.5%
associate-+r-82.3%
associate-+l-60.6%
+-commutative60.6%
+-commutative60.6%
associate--l+60.6%
Simplified37.9%
Taylor expanded in t around inf 37.7%
associate--l+37.7%
+-commutative37.7%
Simplified37.7%
Taylor expanded in y around 0 18.7%
Taylor expanded in x around 0 26.6%
if 1.2e15 < z Initial program 84.8%
associate-+l+84.8%
+-commutative84.8%
associate-+r-67.0%
associate-+l-56.8%
+-commutative56.8%
+-commutative56.8%
associate--l+56.8%
Simplified36.5%
Taylor expanded in t around inf 34.7%
associate--l+36.6%
+-commutative36.6%
Simplified36.6%
Taylor expanded in z around inf 36.5%
+-commutative36.5%
Simplified36.5%
sub-neg36.5%
+-commutative36.5%
Applied egg-rr36.5%
sub-neg36.5%
+-commutative36.5%
associate--r+36.6%
Simplified36.6%
Final simplification31.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 1.7e+15)
(+ (sqrt (+ 1.0 z)) (- 2.0 (+ (sqrt y) (sqrt z))))
(if (<= z 1.05e+223)
(+ 1.0 (- (hypot 1.0 (sqrt y)) (sqrt y)))
(if (<= z 1.75e+253)
(/ 1.0 (+ (sqrt x) (sqrt (+ 1.0 x))))
(+ 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 <= 1.7e+15) {
tmp = sqrt((1.0 + z)) + (2.0 - (sqrt(y) + sqrt(z)));
} else if (z <= 1.05e+223) {
tmp = 1.0 + (hypot(1.0, sqrt(y)) - sqrt(y));
} else if (z <= 1.75e+253) {
tmp = 1.0 / (sqrt(x) + sqrt((1.0 + x)));
} else {
tmp = 1.0 + (sqrt((1.0 + y)) - sqrt(y));
}
return tmp;
}
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= 1.7e+15) {
tmp = Math.sqrt((1.0 + z)) + (2.0 - (Math.sqrt(y) + Math.sqrt(z)));
} else if (z <= 1.05e+223) {
tmp = 1.0 + (Math.hypot(1.0, Math.sqrt(y)) - Math.sqrt(y));
} else if (z <= 1.75e+253) {
tmp = 1.0 / (Math.sqrt(x) + Math.sqrt((1.0 + x)));
} 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 <= 1.7e+15: tmp = math.sqrt((1.0 + z)) + (2.0 - (math.sqrt(y) + math.sqrt(z))) elif z <= 1.05e+223: tmp = 1.0 + (math.hypot(1.0, math.sqrt(y)) - math.sqrt(y)) elif z <= 1.75e+253: tmp = 1.0 / (math.sqrt(x) + math.sqrt((1.0 + x))) 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 <= 1.7e+15) tmp = Float64(sqrt(Float64(1.0 + z)) + Float64(2.0 - Float64(sqrt(y) + sqrt(z)))); elseif (z <= 1.05e+223) tmp = Float64(1.0 + Float64(hypot(1.0, sqrt(y)) - sqrt(y))); elseif (z <= 1.75e+253) tmp = Float64(1.0 / Float64(sqrt(x) + sqrt(Float64(1.0 + x)))); 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 <= 1.7e+15)
tmp = sqrt((1.0 + z)) + (2.0 - (sqrt(y) + sqrt(z)));
elseif (z <= 1.05e+223)
tmp = 1.0 + (hypot(1.0, sqrt(y)) - sqrt(y));
elseif (z <= 1.75e+253)
tmp = 1.0 / (sqrt(x) + sqrt((1.0 + x)));
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, 1.7e+15], N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] + N[(2.0 - N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.05e+223], N[(1.0 + N[(N[Sqrt[1.0 ^ 2 + N[Sqrt[y], $MachinePrecision] ^ 2], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.75e+253], N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq 1.7 \cdot 10^{+15}:\\
\;\;\;\;\sqrt{1 + z} + \left(2 - \left(\sqrt{y} + \sqrt{z}\right)\right)\\
\mathbf{elif}\;z \leq 1.05 \cdot 10^{+223}:\\
\;\;\;\;1 + \left(\mathsf{hypot}\left(1, \sqrt{y}\right) - \sqrt{y}\right)\\
\mathbf{elif}\;z \leq 1.75 \cdot 10^{+253}:\\
\;\;\;\;\frac{1}{\sqrt{x} + \sqrt{1 + x}}\\
\mathbf{else}:\\
\;\;\;\;1 + \left(\sqrt{1 + y} - \sqrt{y}\right)\\
\end{array}
\end{array}
if z < 1.7e15Initial program 96.5%
associate-+l+96.5%
+-commutative96.5%
associate-+r-82.3%
associate-+l-60.6%
+-commutative60.6%
+-commutative60.6%
associate--l+60.6%
Simplified37.9%
Taylor expanded in t around inf 37.7%
associate--l+37.7%
+-commutative37.7%
Simplified37.7%
Taylor expanded in y around 0 18.7%
Taylor expanded in x around 0 26.6%
+-commutative26.6%
associate--l+26.6%
Simplified26.6%
if 1.7e15 < z < 1.04999999999999995e223Initial program 84.9%
associate-+l+84.9%
+-commutative84.9%
associate-+r-66.8%
associate-+l-56.3%
+-commutative56.3%
+-commutative56.3%
associate--l+56.3%
Simplified39.6%
Taylor expanded in t around inf 33.2%
associate--l+35.9%
+-commutative35.9%
Simplified35.9%
add-cbrt-cube35.9%
pow135.9%
pow135.9%
pow-prod-up35.9%
metadata-eval35.9%
Applied egg-rr35.9%
Taylor expanded in z around inf 22.7%
+-commutative22.7%
+-commutative22.7%
Simplified22.7%
Taylor expanded in x around 0 33.6%
associate--l+56.3%
rem-square-sqrt56.3%
hypot-1-def56.3%
Simplified56.3%
if 1.04999999999999995e223 < z < 1.74999999999999989e253Initial program 80.7%
associate-+l+80.7%
+-commutative80.7%
associate-+r-68.8%
associate-+l-61.3%
+-commutative61.3%
+-commutative61.3%
associate--l+61.3%
Simplified34.9%
Taylor expanded in t around inf 41.0%
associate--l+39.9%
+-commutative39.9%
Simplified39.9%
Taylor expanded in z around inf 40.4%
+-commutative40.4%
Simplified40.4%
Taylor expanded in y around inf 28.7%
flip--28.7%
add-sqr-sqrt29.0%
add-sqr-sqrt28.7%
+-commutative28.7%
Applied egg-rr28.7%
associate--l+36.3%
+-inverses36.3%
metadata-eval36.3%
Simplified36.3%
if 1.74999999999999989e253 < z Initial program 86.8%
associate-+l+86.8%
+-commutative86.8%
associate-+r-66.8%
associate-+l-55.9%
+-commutative55.9%
+-commutative55.9%
associate--l+55.9%
Simplified28.7%
Taylor expanded in t around inf 35.5%
associate--l+36.6%
+-commutative36.6%
Simplified36.6%
Taylor expanded in z around inf 36.6%
+-commutative36.6%
Simplified36.6%
Taylor expanded in x around 0 41.3%
associate--l+59.0%
Simplified59.0%
Final simplification40.0%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(if (<= z 1.2e+15)
(- (+ (sqrt (+ 1.0 z)) 2.0) (+ (sqrt y) (sqrt z)))
(if (<= z 1.05e+223)
(+ 1.0 (- (hypot 1.0 (sqrt y)) (sqrt y)))
(if (<= z 1.75e+253)
(/ 1.0 (+ (sqrt x) (sqrt (+ 1.0 x))))
(+ 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 <= 1.2e+15) {
tmp = (sqrt((1.0 + z)) + 2.0) - (sqrt(y) + sqrt(z));
} else if (z <= 1.05e+223) {
tmp = 1.0 + (hypot(1.0, sqrt(y)) - sqrt(y));
} else if (z <= 1.75e+253) {
tmp = 1.0 / (sqrt(x) + sqrt((1.0 + x)));
} else {
tmp = 1.0 + (sqrt((1.0 + y)) - sqrt(y));
}
return tmp;
}
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= 1.2e+15) {
tmp = (Math.sqrt((1.0 + z)) + 2.0) - (Math.sqrt(y) + Math.sqrt(z));
} else if (z <= 1.05e+223) {
tmp = 1.0 + (Math.hypot(1.0, Math.sqrt(y)) - Math.sqrt(y));
} else if (z <= 1.75e+253) {
tmp = 1.0 / (Math.sqrt(x) + Math.sqrt((1.0 + x)));
} 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 <= 1.2e+15: tmp = (math.sqrt((1.0 + z)) + 2.0) - (math.sqrt(y) + math.sqrt(z)) elif z <= 1.05e+223: tmp = 1.0 + (math.hypot(1.0, math.sqrt(y)) - math.sqrt(y)) elif z <= 1.75e+253: tmp = 1.0 / (math.sqrt(x) + math.sqrt((1.0 + x))) 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 <= 1.2e+15) tmp = Float64(Float64(sqrt(Float64(1.0 + z)) + 2.0) - Float64(sqrt(y) + sqrt(z))); elseif (z <= 1.05e+223) tmp = Float64(1.0 + Float64(hypot(1.0, sqrt(y)) - sqrt(y))); elseif (z <= 1.75e+253) tmp = Float64(1.0 / Float64(sqrt(x) + sqrt(Float64(1.0 + x)))); 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 <= 1.2e+15)
tmp = (sqrt((1.0 + z)) + 2.0) - (sqrt(y) + sqrt(z));
elseif (z <= 1.05e+223)
tmp = 1.0 + (hypot(1.0, sqrt(y)) - sqrt(y));
elseif (z <= 1.75e+253)
tmp = 1.0 / (sqrt(x) + sqrt((1.0 + x)));
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, 1.2e+15], N[(N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] + 2.0), $MachinePrecision] - N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.05e+223], N[(1.0 + N[(N[Sqrt[1.0 ^ 2 + N[Sqrt[y], $MachinePrecision] ^ 2], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.75e+253], N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq 1.2 \cdot 10^{+15}:\\
\;\;\;\;\left(\sqrt{1 + z} + 2\right) - \left(\sqrt{y} + \sqrt{z}\right)\\
\mathbf{elif}\;z \leq 1.05 \cdot 10^{+223}:\\
\;\;\;\;1 + \left(\mathsf{hypot}\left(1, \sqrt{y}\right) - \sqrt{y}\right)\\
\mathbf{elif}\;z \leq 1.75 \cdot 10^{+253}:\\
\;\;\;\;\frac{1}{\sqrt{x} + \sqrt{1 + x}}\\
\mathbf{else}:\\
\;\;\;\;1 + \left(\sqrt{1 + y} - \sqrt{y}\right)\\
\end{array}
\end{array}
if z < 1.2e15Initial program 96.5%
associate-+l+96.5%
+-commutative96.5%
associate-+r-82.3%
associate-+l-60.6%
+-commutative60.6%
+-commutative60.6%
associate--l+60.6%
Simplified37.9%
Taylor expanded in t around inf 37.7%
associate--l+37.7%
+-commutative37.7%
Simplified37.7%
Taylor expanded in y around 0 18.7%
Taylor expanded in x around 0 26.6%
if 1.2e15 < z < 1.04999999999999995e223Initial program 84.9%
associate-+l+84.9%
+-commutative84.9%
associate-+r-66.8%
associate-+l-56.3%
+-commutative56.3%
+-commutative56.3%
associate--l+56.3%
Simplified39.6%
Taylor expanded in t around inf 33.2%
associate--l+35.9%
+-commutative35.9%
Simplified35.9%
add-cbrt-cube35.9%
pow135.9%
pow135.9%
pow-prod-up35.9%
metadata-eval35.9%
Applied egg-rr35.9%
Taylor expanded in z around inf 22.7%
+-commutative22.7%
+-commutative22.7%
Simplified22.7%
Taylor expanded in x around 0 33.6%
associate--l+56.3%
rem-square-sqrt56.3%
hypot-1-def56.3%
Simplified56.3%
if 1.04999999999999995e223 < z < 1.74999999999999989e253Initial program 80.7%
associate-+l+80.7%
+-commutative80.7%
associate-+r-68.8%
associate-+l-61.3%
+-commutative61.3%
+-commutative61.3%
associate--l+61.3%
Simplified34.9%
Taylor expanded in t around inf 41.0%
associate--l+39.9%
+-commutative39.9%
Simplified39.9%
Taylor expanded in z around inf 40.4%
+-commutative40.4%
Simplified40.4%
Taylor expanded in y around inf 28.7%
flip--28.7%
add-sqr-sqrt29.0%
add-sqr-sqrt28.7%
+-commutative28.7%
Applied egg-rr28.7%
associate--l+36.3%
+-inverses36.3%
metadata-eval36.3%
Simplified36.3%
if 1.74999999999999989e253 < z Initial program 86.8%
associate-+l+86.8%
+-commutative86.8%
associate-+r-66.8%
associate-+l-55.9%
+-commutative55.9%
+-commutative55.9%
associate--l+55.9%
Simplified28.7%
Taylor expanded in t around inf 35.5%
associate--l+36.6%
+-commutative36.6%
Simplified36.6%
Taylor expanded in z around inf 36.6%
+-commutative36.6%
Simplified36.6%
Taylor expanded in x around 0 41.3%
associate--l+59.0%
Simplified59.0%
Final simplification40.0%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= y 1.5e+16) (+ 1.0 (- (hypot 1.0 (sqrt y)) (sqrt y))) (/ 1.0 (+ (sqrt x) (sqrt (+ 1.0 x))))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 1.5e+16) {
tmp = 1.0 + (hypot(1.0, sqrt(y)) - sqrt(y));
} else {
tmp = 1.0 / (sqrt(x) + sqrt((1.0 + x)));
}
return tmp;
}
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= 1.5e+16) {
tmp = 1.0 + (Math.hypot(1.0, Math.sqrt(y)) - Math.sqrt(y));
} else {
tmp = 1.0 / (Math.sqrt(x) + Math.sqrt((1.0 + x)));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if y <= 1.5e+16: tmp = 1.0 + (math.hypot(1.0, math.sqrt(y)) - math.sqrt(y)) else: tmp = 1.0 / (math.sqrt(x) + math.sqrt((1.0 + x))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (y <= 1.5e+16) tmp = Float64(1.0 + Float64(hypot(1.0, sqrt(y)) - sqrt(y))); else tmp = Float64(1.0 / Float64(sqrt(x) + sqrt(Float64(1.0 + 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.5e+16)
tmp = 1.0 + (hypot(1.0, sqrt(y)) - sqrt(y));
else
tmp = 1.0 / (sqrt(x) + sqrt((1.0 + 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.5e+16], N[(1.0 + N[(N[Sqrt[1.0 ^ 2 + N[Sqrt[y], $MachinePrecision] ^ 2], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 1.5 \cdot 10^{+16}:\\
\;\;\;\;1 + \left(\mathsf{hypot}\left(1, \sqrt{y}\right) - \sqrt{y}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{x} + \sqrt{1 + x}}\\
\end{array}
\end{array}
if y < 1.5e16Initial program 96.1%
associate-+l+96.1%
+-commutative96.1%
associate-+r-67.0%
associate-+l-62.1%
+-commutative62.1%
+-commutative62.1%
associate--l+62.1%
Simplified39.8%
Taylor expanded in t around inf 36.6%
associate--l+38.2%
+-commutative38.2%
Simplified38.2%
add-cbrt-cube38.2%
pow138.2%
pow138.2%
pow-prod-up38.2%
metadata-eval38.2%
Applied egg-rr38.2%
Taylor expanded in z around inf 25.2%
+-commutative25.2%
+-commutative25.2%
Simplified25.2%
Taylor expanded in x around 0 44.8%
associate--l+44.8%
rem-square-sqrt44.8%
hypot-1-def44.8%
Simplified44.8%
if 1.5e16 < y Initial program 84.5%
associate-+l+84.5%
+-commutative84.5%
associate-+r-84.5%
associate-+l-54.8%
+-commutative54.8%
+-commutative54.8%
associate--l+54.8%
Simplified34.1%
Taylor expanded in t around inf 35.9%
associate--l+35.9%
+-commutative35.9%
Simplified35.9%
Taylor expanded in z around inf 23.2%
+-commutative23.2%
Simplified23.2%
Taylor expanded in y around inf 22.6%
flip--22.6%
add-sqr-sqrt23.1%
add-sqr-sqrt22.6%
+-commutative22.6%
Applied egg-rr22.6%
associate--l+26.1%
+-inverses26.1%
metadata-eval26.1%
Simplified26.1%
Final simplification36.4%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (let* ((t_1 (- (sqrt (+ 1.0 x)) (sqrt x)))) (if (<= y 1.15) (+ 1.0 t_1) t_1)))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + x)) - sqrt(x);
double tmp;
if (y <= 1.15) {
tmp = 1.0 + t_1;
} else {
tmp = t_1;
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = sqrt((1.0d0 + x)) - sqrt(x)
if (y <= 1.15d0) then
tmp = 1.0d0 + t_1
else
tmp = t_1
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + x)) - Math.sqrt(x);
double tmp;
if (y <= 1.15) {
tmp = 1.0 + t_1;
} else {
tmp = t_1;
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + x)) - math.sqrt(x) tmp = 0 if y <= 1.15: tmp = 1.0 + t_1 else: tmp = t_1 return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = Float64(sqrt(Float64(1.0 + x)) - sqrt(x)) tmp = 0.0 if (y <= 1.15) tmp = Float64(1.0 + t_1); else tmp = t_1; end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + x)) - sqrt(x);
tmp = 0.0;
if (y <= 1.15)
tmp = 1.0 + t_1;
else
tmp = t_1;
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 1.15], N[(1.0 + t$95$1), $MachinePrecision], t$95$1]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + x} - \sqrt{x}\\
\mathbf{if}\;y \leq 1.15:\\
\;\;\;\;1 + t_1\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if y < 1.1499999999999999Initial program 97.0%
associate-+l+97.0%
+-commutative97.0%
associate-+r-67.2%
associate-+l-62.9%
+-commutative62.9%
+-commutative62.9%
associate--l+62.9%
Simplified41.9%
Taylor expanded in t around inf 36.1%
associate--l+37.4%
+-commutative37.4%
Simplified37.4%
Taylor expanded in z around inf 25.4%
+-commutative25.4%
Simplified25.4%
Taylor expanded in y around 0 25.4%
associate--l+37.5%
Simplified37.5%
if 1.1499999999999999 < y Initial program 84.7%
associate-+l+84.7%
+-commutative84.7%
associate-+r-82.7%
associate-+l-54.7%
+-commutative54.7%
+-commutative54.7%
associate--l+54.7%
Simplified32.5%
Taylor expanded in t around inf 36.5%
associate--l+36.9%
+-commutative36.9%
Simplified36.9%
Taylor expanded in z around inf 23.2%
+-commutative23.2%
Simplified23.2%
Taylor expanded in y around inf 22.0%
Final simplification29.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 4.5e+15) (+ 1.0 (- (sqrt (+ 1.0 y)) (sqrt y))) (/ 1.0 (+ (sqrt x) (sqrt (+ 1.0 x))))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 4.5e+15) {
tmp = 1.0 + (sqrt((1.0 + y)) - sqrt(y));
} else {
tmp = 1.0 / (sqrt(x) + sqrt((1.0 + 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 <= 4.5d+15) then
tmp = 1.0d0 + (sqrt((1.0d0 + y)) - sqrt(y))
else
tmp = 1.0d0 / (sqrt(x) + sqrt((1.0d0 + 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 <= 4.5e+15) {
tmp = 1.0 + (Math.sqrt((1.0 + y)) - Math.sqrt(y));
} else {
tmp = 1.0 / (Math.sqrt(x) + Math.sqrt((1.0 + x)));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if y <= 4.5e+15: tmp = 1.0 + (math.sqrt((1.0 + y)) - math.sqrt(y)) else: tmp = 1.0 / (math.sqrt(x) + math.sqrt((1.0 + x))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (y <= 4.5e+15) tmp = Float64(1.0 + Float64(sqrt(Float64(1.0 + y)) - sqrt(y))); else tmp = Float64(1.0 / Float64(sqrt(x) + sqrt(Float64(1.0 + 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 <= 4.5e+15)
tmp = 1.0 + (sqrt((1.0 + y)) - sqrt(y));
else
tmp = 1.0 / (sqrt(x) + sqrt((1.0 + 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, 4.5e+15], N[(1.0 + N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 4.5 \cdot 10^{+15}:\\
\;\;\;\;1 + \left(\sqrt{1 + y} - \sqrt{y}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{x} + \sqrt{1 + x}}\\
\end{array}
\end{array}
if y < 4.5e15Initial program 96.1%
associate-+l+96.1%
+-commutative96.1%
associate-+r-67.0%
associate-+l-62.1%
+-commutative62.1%
+-commutative62.1%
associate--l+62.1%
Simplified39.8%
Taylor expanded in t around inf 36.6%
associate--l+38.2%
+-commutative38.2%
Simplified38.2%
Taylor expanded in z around inf 25.2%
+-commutative25.2%
Simplified25.2%
Taylor expanded in x around 0 44.8%
associate--l+44.8%
Simplified44.8%
if 4.5e15 < y Initial program 84.5%
associate-+l+84.5%
+-commutative84.5%
associate-+r-84.5%
associate-+l-54.8%
+-commutative54.8%
+-commutative54.8%
associate--l+54.8%
Simplified34.1%
Taylor expanded in t around inf 35.9%
associate--l+35.9%
+-commutative35.9%
Simplified35.9%
Taylor expanded in z around inf 23.2%
+-commutative23.2%
Simplified23.2%
Taylor expanded in y around inf 22.6%
flip--22.6%
add-sqr-sqrt23.1%
add-sqr-sqrt22.6%
+-commutative22.6%
Applied egg-rr22.6%
associate--l+26.1%
+-inverses26.1%
metadata-eval26.1%
Simplified26.1%
Final simplification36.4%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (+ 1.0 (- (sqrt (+ 1.0 y)) (sqrt y))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
return 1.0 + (sqrt((1.0 + y)) - sqrt(y));
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = 1.0d0 + (sqrt((1.0d0 + y)) - sqrt(y))
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
return 1.0 + (Math.sqrt((1.0 + y)) - Math.sqrt(y));
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): return 1.0 + (math.sqrt((1.0 + y)) - math.sqrt(y))
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) return Float64(1.0 + Float64(sqrt(Float64(1.0 + y)) - sqrt(y))) end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp = code(x, y, z, t)
tmp = 1.0 + (sqrt((1.0 + y)) - sqrt(y));
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := N[(1.0 + N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
1 + \left(\sqrt{1 + y} - \sqrt{y}\right)
\end{array}
Initial program 90.9%
associate-+l+90.9%
+-commutative90.9%
associate-+r-75.0%
associate-+l-58.8%
+-commutative58.8%
+-commutative58.8%
associate--l+58.8%
Simplified37.2%
Taylor expanded in t around inf 36.3%
associate--l+37.2%
+-commutative37.2%
Simplified37.2%
Taylor expanded in z around inf 24.3%
+-commutative24.3%
Simplified24.3%
Taylor expanded in x around 0 27.1%
associate--l+45.4%
Simplified45.4%
Final simplification45.4%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (- (sqrt (+ 1.0 x)) (sqrt x)))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
return sqrt((1.0 + x)) - sqrt(x);
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = sqrt((1.0d0 + x)) - sqrt(x)
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
return Math.sqrt((1.0 + x)) - Math.sqrt(x);
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): return math.sqrt((1.0 + x)) - math.sqrt(x)
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) return Float64(sqrt(Float64(1.0 + x)) - sqrt(x)) end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp = code(x, y, z, t)
tmp = sqrt((1.0 + x)) - sqrt(x);
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := N[(N[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])\\
\\
\sqrt{1 + x} - \sqrt{x}
\end{array}
Initial program 90.9%
associate-+l+90.9%
+-commutative90.9%
associate-+r-75.0%
associate-+l-58.8%
+-commutative58.8%
+-commutative58.8%
associate--l+58.8%
Simplified37.2%
Taylor expanded in t around inf 36.3%
associate--l+37.2%
+-commutative37.2%
Simplified37.2%
Taylor expanded in z around inf 24.3%
+-commutative24.3%
Simplified24.3%
Taylor expanded in y around inf 16.8%
Final simplification16.8%
(FPCore (x y z t)
:precision binary64
(+
(+
(+
(/ 1.0 (+ (sqrt (+ x 1.0)) (sqrt x)))
(/ 1.0 (+ (sqrt (+ y 1.0)) (sqrt y))))
(/ 1.0 (+ (sqrt (+ z 1.0)) (sqrt z))))
(- (sqrt (+ t 1.0)) (sqrt t))))
double code(double x, double y, double z, double t) {
return (((1.0 / (sqrt((x + 1.0)) + sqrt(x))) + (1.0 / (sqrt((y + 1.0)) + sqrt(y)))) + (1.0 / (sqrt((z + 1.0)) + sqrt(z)))) + (sqrt((t + 1.0)) - sqrt(t));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (((1.0d0 / (sqrt((x + 1.0d0)) + sqrt(x))) + (1.0d0 / (sqrt((y + 1.0d0)) + sqrt(y)))) + (1.0d0 / (sqrt((z + 1.0d0)) + sqrt(z)))) + (sqrt((t + 1.0d0)) - sqrt(t))
end function
public static double code(double x, double y, double z, double t) {
return (((1.0 / (Math.sqrt((x + 1.0)) + Math.sqrt(x))) + (1.0 / (Math.sqrt((y + 1.0)) + Math.sqrt(y)))) + (1.0 / (Math.sqrt((z + 1.0)) + Math.sqrt(z)))) + (Math.sqrt((t + 1.0)) - Math.sqrt(t));
}
def code(x, y, z, t): return (((1.0 / (math.sqrt((x + 1.0)) + math.sqrt(x))) + (1.0 / (math.sqrt((y + 1.0)) + math.sqrt(y)))) + (1.0 / (math.sqrt((z + 1.0)) + math.sqrt(z)))) + (math.sqrt((t + 1.0)) - math.sqrt(t))
function code(x, y, z, t) return Float64(Float64(Float64(Float64(1.0 / Float64(sqrt(Float64(x + 1.0)) + sqrt(x))) + Float64(1.0 / Float64(sqrt(Float64(y + 1.0)) + sqrt(y)))) + Float64(1.0 / Float64(sqrt(Float64(z + 1.0)) + sqrt(z)))) + Float64(sqrt(Float64(t + 1.0)) - sqrt(t))) end
function tmp = code(x, y, z, t) tmp = (((1.0 / (sqrt((x + 1.0)) + sqrt(x))) + (1.0 / (sqrt((y + 1.0)) + sqrt(y)))) + (1.0 / (sqrt((z + 1.0)) + sqrt(z)))) + (sqrt((t + 1.0)) - sqrt(t)); end
code[x_, y_, z_, t_] := N[(N[(N[(N[(1.0 / N[(N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[N[(z + 1.0), $MachinePrecision]], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(t + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\frac{1}{\sqrt{x + 1} + \sqrt{x}} + \frac{1}{\sqrt{y + 1} + \sqrt{y}}\right) + \frac{1}{\sqrt{z + 1} + \sqrt{z}}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)
\end{array}
herbie shell --seed 2023275
(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))))