
(FPCore (x y z t) :precision binary64 (+ (+ (+ (- (sqrt (+ x 1.0)) (sqrt x)) (- (sqrt (+ y 1.0)) (sqrt y))) (- (sqrt (+ z 1.0)) (sqrt z))) (- (sqrt (+ t 1.0)) (sqrt t))))
double code(double x, double y, double z, double t) {
return (((sqrt((x + 1.0)) - sqrt(x)) + (sqrt((y + 1.0)) - sqrt(y))) + (sqrt((z + 1.0)) - sqrt(z))) + (sqrt((t + 1.0)) - sqrt(t));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (((sqrt((x + 1.0d0)) - sqrt(x)) + (sqrt((y + 1.0d0)) - sqrt(y))) + (sqrt((z + 1.0d0)) - sqrt(z))) + (sqrt((t + 1.0d0)) - sqrt(t))
end function
public static double code(double x, double y, double z, double t) {
return (((Math.sqrt((x + 1.0)) - Math.sqrt(x)) + (Math.sqrt((y + 1.0)) - Math.sqrt(y))) + (Math.sqrt((z + 1.0)) - Math.sqrt(z))) + (Math.sqrt((t + 1.0)) - Math.sqrt(t));
}
def code(x, y, z, t): return (((math.sqrt((x + 1.0)) - math.sqrt(x)) + (math.sqrt((y + 1.0)) - math.sqrt(y))) + (math.sqrt((z + 1.0)) - math.sqrt(z))) + (math.sqrt((t + 1.0)) - math.sqrt(t))
function code(x, y, z, t) return Float64(Float64(Float64(Float64(sqrt(Float64(x + 1.0)) - sqrt(x)) + Float64(sqrt(Float64(y + 1.0)) - sqrt(y))) + Float64(sqrt(Float64(z + 1.0)) - sqrt(z))) + Float64(sqrt(Float64(t + 1.0)) - sqrt(t))) end
function tmp = code(x, y, z, t) tmp = (((sqrt((x + 1.0)) - sqrt(x)) + (sqrt((y + 1.0)) - sqrt(y))) + (sqrt((z + 1.0)) - sqrt(z))) + (sqrt((t + 1.0)) - sqrt(t)); end
code[x_, y_, z_, t_] := N[(N[(N[(N[(N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(z + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(t + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{y + 1} - \sqrt{y}\right)\right) + \left(\sqrt{z + 1} - \sqrt{z}\right)\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 24 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (+ (+ (+ (- (sqrt (+ x 1.0)) (sqrt x)) (- (sqrt (+ y 1.0)) (sqrt y))) (- (sqrt (+ z 1.0)) (sqrt z))) (- (sqrt (+ t 1.0)) (sqrt t))))
double code(double x, double y, double z, double t) {
return (((sqrt((x + 1.0)) - sqrt(x)) + (sqrt((y + 1.0)) - sqrt(y))) + (sqrt((z + 1.0)) - sqrt(z))) + (sqrt((t + 1.0)) - sqrt(t));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (((sqrt((x + 1.0d0)) - sqrt(x)) + (sqrt((y + 1.0d0)) - sqrt(y))) + (sqrt((z + 1.0d0)) - sqrt(z))) + (sqrt((t + 1.0d0)) - sqrt(t))
end function
public static double code(double x, double y, double z, double t) {
return (((Math.sqrt((x + 1.0)) - Math.sqrt(x)) + (Math.sqrt((y + 1.0)) - Math.sqrt(y))) + (Math.sqrt((z + 1.0)) - Math.sqrt(z))) + (Math.sqrt((t + 1.0)) - Math.sqrt(t));
}
def code(x, y, z, t): return (((math.sqrt((x + 1.0)) - math.sqrt(x)) + (math.sqrt((y + 1.0)) - math.sqrt(y))) + (math.sqrt((z + 1.0)) - math.sqrt(z))) + (math.sqrt((t + 1.0)) - math.sqrt(t))
function code(x, y, z, t) return Float64(Float64(Float64(Float64(sqrt(Float64(x + 1.0)) - sqrt(x)) + Float64(sqrt(Float64(y + 1.0)) - sqrt(y))) + Float64(sqrt(Float64(z + 1.0)) - sqrt(z))) + Float64(sqrt(Float64(t + 1.0)) - sqrt(t))) end
function tmp = code(x, y, z, t) tmp = (((sqrt((x + 1.0)) - sqrt(x)) + (sqrt((y + 1.0)) - sqrt(y))) + (sqrt((z + 1.0)) - sqrt(z))) + (sqrt((t + 1.0)) - sqrt(t)); end
code[x_, y_, z_, t_] := N[(N[(N[(N[(N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(z + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(t + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{y + 1} - \sqrt{y}\right)\right) + \left(\sqrt{z + 1} - \sqrt{z}\right)\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)
\end{array}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ 1.0 t)))
(t_2 (sqrt (+ 1.0 y)))
(t_3 (sqrt (+ z 1.0)))
(t_4 (- (sqrt (+ x 1.0)) (sqrt x)))
(t_5 (+ (- t_3 (sqrt z)) (+ t_4 (- t_2 (sqrt y))))))
(if (<= t_5 0.0001)
(+
(* 0.5 (sqrt (/ 1.0 x)))
(+ (- t_1 (+ (sqrt t) (- (sqrt z) t_3))) (* 0.5 (sqrt (/ 1.0 y)))))
(if (<= t_5 2.001)
(+ t_4 (+ (/ 1.0 (+ (sqrt z) t_3)) (/ 1.0 (+ t_2 (sqrt y)))))
(+
t_2
(+ (+ t_3 (- t_4 (sqrt z))) (- (/ 1.0 (+ t_1 (sqrt t))) (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 + t));
double t_2 = sqrt((1.0 + y));
double t_3 = sqrt((z + 1.0));
double t_4 = sqrt((x + 1.0)) - sqrt(x);
double t_5 = (t_3 - sqrt(z)) + (t_4 + (t_2 - sqrt(y)));
double tmp;
if (t_5 <= 0.0001) {
tmp = (0.5 * sqrt((1.0 / x))) + ((t_1 - (sqrt(t) + (sqrt(z) - t_3))) + (0.5 * sqrt((1.0 / y))));
} else if (t_5 <= 2.001) {
tmp = t_4 + ((1.0 / (sqrt(z) + t_3)) + (1.0 / (t_2 + sqrt(y))));
} else {
tmp = t_2 + ((t_3 + (t_4 - sqrt(z))) + ((1.0 / (t_1 + sqrt(t))) - 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) :: t_4
real(8) :: t_5
real(8) :: tmp
t_1 = sqrt((1.0d0 + t))
t_2 = sqrt((1.0d0 + y))
t_3 = sqrt((z + 1.0d0))
t_4 = sqrt((x + 1.0d0)) - sqrt(x)
t_5 = (t_3 - sqrt(z)) + (t_4 + (t_2 - sqrt(y)))
if (t_5 <= 0.0001d0) then
tmp = (0.5d0 * sqrt((1.0d0 / x))) + ((t_1 - (sqrt(t) + (sqrt(z) - t_3))) + (0.5d0 * sqrt((1.0d0 / y))))
else if (t_5 <= 2.001d0) then
tmp = t_4 + ((1.0d0 / (sqrt(z) + t_3)) + (1.0d0 / (t_2 + sqrt(y))))
else
tmp = t_2 + ((t_3 + (t_4 - sqrt(z))) + ((1.0d0 / (t_1 + sqrt(t))) - 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 + t));
double t_2 = Math.sqrt((1.0 + y));
double t_3 = Math.sqrt((z + 1.0));
double t_4 = Math.sqrt((x + 1.0)) - Math.sqrt(x);
double t_5 = (t_3 - Math.sqrt(z)) + (t_4 + (t_2 - Math.sqrt(y)));
double tmp;
if (t_5 <= 0.0001) {
tmp = (0.5 * Math.sqrt((1.0 / x))) + ((t_1 - (Math.sqrt(t) + (Math.sqrt(z) - t_3))) + (0.5 * Math.sqrt((1.0 / y))));
} else if (t_5 <= 2.001) {
tmp = t_4 + ((1.0 / (Math.sqrt(z) + t_3)) + (1.0 / (t_2 + Math.sqrt(y))));
} else {
tmp = t_2 + ((t_3 + (t_4 - Math.sqrt(z))) + ((1.0 / (t_1 + Math.sqrt(t))) - 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 + t)) t_2 = math.sqrt((1.0 + y)) t_3 = math.sqrt((z + 1.0)) t_4 = math.sqrt((x + 1.0)) - math.sqrt(x) t_5 = (t_3 - math.sqrt(z)) + (t_4 + (t_2 - math.sqrt(y))) tmp = 0 if t_5 <= 0.0001: tmp = (0.5 * math.sqrt((1.0 / x))) + ((t_1 - (math.sqrt(t) + (math.sqrt(z) - t_3))) + (0.5 * math.sqrt((1.0 / y)))) elif t_5 <= 2.001: tmp = t_4 + ((1.0 / (math.sqrt(z) + t_3)) + (1.0 / (t_2 + math.sqrt(y)))) else: tmp = t_2 + ((t_3 + (t_4 - math.sqrt(z))) + ((1.0 / (t_1 + math.sqrt(t))) - 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 + t)) t_2 = sqrt(Float64(1.0 + y)) t_3 = sqrt(Float64(z + 1.0)) t_4 = Float64(sqrt(Float64(x + 1.0)) - sqrt(x)) t_5 = Float64(Float64(t_3 - sqrt(z)) + Float64(t_4 + Float64(t_2 - sqrt(y)))) tmp = 0.0 if (t_5 <= 0.0001) tmp = Float64(Float64(0.5 * sqrt(Float64(1.0 / x))) + Float64(Float64(t_1 - Float64(sqrt(t) + Float64(sqrt(z) - t_3))) + Float64(0.5 * sqrt(Float64(1.0 / y))))); elseif (t_5 <= 2.001) tmp = Float64(t_4 + Float64(Float64(1.0 / Float64(sqrt(z) + t_3)) + Float64(1.0 / Float64(t_2 + sqrt(y))))); else tmp = Float64(t_2 + Float64(Float64(t_3 + Float64(t_4 - sqrt(z))) + Float64(Float64(1.0 / Float64(t_1 + sqrt(t))) - 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 + t));
t_2 = sqrt((1.0 + y));
t_3 = sqrt((z + 1.0));
t_4 = sqrt((x + 1.0)) - sqrt(x);
t_5 = (t_3 - sqrt(z)) + (t_4 + (t_2 - sqrt(y)));
tmp = 0.0;
if (t_5 <= 0.0001)
tmp = (0.5 * sqrt((1.0 / x))) + ((t_1 - (sqrt(t) + (sqrt(z) - t_3))) + (0.5 * sqrt((1.0 / y))));
elseif (t_5 <= 2.001)
tmp = t_4 + ((1.0 / (sqrt(z) + t_3)) + (1.0 / (t_2 + sqrt(y))));
else
tmp = t_2 + ((t_3 + (t_4 - sqrt(z))) + ((1.0 / (t_1 + sqrt(t))) - 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 + t), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[Sqrt[N[(z + 1.0), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$4 = N[(N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[(N[(t$95$3 - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] + N[(t$95$4 + N[(t$95$2 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$5, 0.0001], N[(N[(0.5 * N[Sqrt[N[(1.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$1 - N[(N[Sqrt[t], $MachinePrecision] + N[(N[Sqrt[z], $MachinePrecision] - t$95$3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(0.5 * N[Sqrt[N[(1.0 / y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$5, 2.001], N[(t$95$4 + N[(N[(1.0 / N[(N[Sqrt[z], $MachinePrecision] + t$95$3), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(t$95$2 + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$2 + N[(N[(t$95$3 + N[(t$95$4 - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 / N[(t$95$1 + N[Sqrt[t], $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}
t_1 := \sqrt{1 + t}\\
t_2 := \sqrt{1 + y}\\
t_3 := \sqrt{z + 1}\\
t_4 := \sqrt{x + 1} - \sqrt{x}\\
t_5 := \left(t\_3 - \sqrt{z}\right) + \left(t\_4 + \left(t\_2 - \sqrt{y}\right)\right)\\
\mathbf{if}\;t\_5 \leq 0.0001:\\
\;\;\;\;0.5 \cdot \sqrt{\frac{1}{x}} + \left(\left(t\_1 - \left(\sqrt{t} + \left(\sqrt{z} - t\_3\right)\right)\right) + 0.5 \cdot \sqrt{\frac{1}{y}}\right)\\
\mathbf{elif}\;t\_5 \leq 2.001:\\
\;\;\;\;t\_4 + \left(\frac{1}{\sqrt{z} + t\_3} + \frac{1}{t\_2 + \sqrt{y}}\right)\\
\mathbf{else}:\\
\;\;\;\;t\_2 + \left(\left(t\_3 + \left(t\_4 - \sqrt{z}\right)\right) + \left(\frac{1}{t\_1 + \sqrt{t}} - \sqrt{y}\right)\right)\\
\end{array}
\end{array}
if (+.f64 (+.f64 (-.f64 (sqrt.f64 (+.f64 x #s(literal 1 binary64))) (sqrt.f64 x)) (-.f64 (sqrt.f64 (+.f64 y #s(literal 1 binary64))) (sqrt.f64 y))) (-.f64 (sqrt.f64 (+.f64 z #s(literal 1 binary64))) (sqrt.f64 z))) < 1.00000000000000005e-4Initial program 48.8%
associate-+l+48.8%
associate-+l+48.8%
+-commutative48.8%
+-commutative48.8%
associate-+l-46.6%
+-commutative46.6%
+-commutative46.6%
Simplified46.6%
Taylor expanded in x around inf 60.2%
Taylor expanded in y around inf 73.2%
if 1.00000000000000005e-4 < (+.f64 (+.f64 (-.f64 (sqrt.f64 (+.f64 x #s(literal 1 binary64))) (sqrt.f64 x)) (-.f64 (sqrt.f64 (+.f64 y #s(literal 1 binary64))) (sqrt.f64 y))) (-.f64 (sqrt.f64 (+.f64 z #s(literal 1 binary64))) (sqrt.f64 z))) < 2.00099999999999989Initial program 96.6%
associate-+l+96.6%
associate-+l+96.6%
+-commutative96.6%
+-commutative96.6%
associate-+l-76.7%
+-commutative76.7%
+-commutative76.7%
Simplified76.7%
add-log-exp76.7%
associate--r-96.6%
+-commutative96.6%
Applied egg-rr96.6%
flip--96.6%
add-sqr-sqrt76.1%
add-sqr-sqrt96.8%
Applied egg-rr96.8%
associate--l+96.9%
+-inverses96.9%
metadata-eval96.9%
+-commutative96.9%
Simplified96.9%
Taylor expanded in t around inf 57.0%
flip--76.7%
add-sqr-sqrt58.4%
add-sqr-sqrt76.9%
Applied egg-rr57.2%
associate--l+57.4%
+-inverses57.4%
metadata-eval57.4%
+-commutative57.4%
Simplified57.4%
if 2.00099999999999989 < (+.f64 (+.f64 (-.f64 (sqrt.f64 (+.f64 x #s(literal 1 binary64))) (sqrt.f64 x)) (-.f64 (sqrt.f64 (+.f64 y #s(literal 1 binary64))) (sqrt.f64 y))) (-.f64 (sqrt.f64 (+.f64 z #s(literal 1 binary64))) (sqrt.f64 z))) Initial program 99.6%
+-commutative99.6%
associate-+r+99.6%
associate-+r-99.6%
associate-+l-99.5%
associate-+r-99.5%
Simplified99.5%
flip--99.5%
add-sqr-sqrt79.5%
add-sqr-sqrt99.5%
+-commutative99.5%
+-commutative99.5%
Applied egg-rr99.5%
associate--r+99.9%
+-inverses99.9%
metadata-eval99.9%
Simplified99.9%
Final simplification65.0%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ 1.0 t)))
(t_2 (sqrt (+ 1.0 y)))
(t_3 (sqrt (+ z 1.0)))
(t_4 (- (sqrt (+ x 1.0)) (sqrt x)))
(t_5 (+ (- t_3 (sqrt z)) (+ t_4 (- t_2 (sqrt y))))))
(if (<= t_5 0.0001)
(+
(* 0.5 (sqrt (/ 1.0 x)))
(+ (- t_1 (+ (sqrt t) (- (sqrt z) t_3))) (* 0.5 (sqrt (/ 1.0 y)))))
(if (<= t_5 2.001)
(+ t_4 (+ (/ 1.0 (+ (sqrt z) t_3)) (/ 1.0 (+ t_2 (sqrt y)))))
(+
t_2
(+
(- (+ 1.0 t_3) (+ (sqrt x) (sqrt z)))
(- (/ 1.0 (+ t_1 (sqrt t))) (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 + t));
double t_2 = sqrt((1.0 + y));
double t_3 = sqrt((z + 1.0));
double t_4 = sqrt((x + 1.0)) - sqrt(x);
double t_5 = (t_3 - sqrt(z)) + (t_4 + (t_2 - sqrt(y)));
double tmp;
if (t_5 <= 0.0001) {
tmp = (0.5 * sqrt((1.0 / x))) + ((t_1 - (sqrt(t) + (sqrt(z) - t_3))) + (0.5 * sqrt((1.0 / y))));
} else if (t_5 <= 2.001) {
tmp = t_4 + ((1.0 / (sqrt(z) + t_3)) + (1.0 / (t_2 + sqrt(y))));
} else {
tmp = t_2 + (((1.0 + t_3) - (sqrt(x) + sqrt(z))) + ((1.0 / (t_1 + sqrt(t))) - 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) :: t_4
real(8) :: t_5
real(8) :: tmp
t_1 = sqrt((1.0d0 + t))
t_2 = sqrt((1.0d0 + y))
t_3 = sqrt((z + 1.0d0))
t_4 = sqrt((x + 1.0d0)) - sqrt(x)
t_5 = (t_3 - sqrt(z)) + (t_4 + (t_2 - sqrt(y)))
if (t_5 <= 0.0001d0) then
tmp = (0.5d0 * sqrt((1.0d0 / x))) + ((t_1 - (sqrt(t) + (sqrt(z) - t_3))) + (0.5d0 * sqrt((1.0d0 / y))))
else if (t_5 <= 2.001d0) then
tmp = t_4 + ((1.0d0 / (sqrt(z) + t_3)) + (1.0d0 / (t_2 + sqrt(y))))
else
tmp = t_2 + (((1.0d0 + t_3) - (sqrt(x) + sqrt(z))) + ((1.0d0 / (t_1 + sqrt(t))) - 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 + t));
double t_2 = Math.sqrt((1.0 + y));
double t_3 = Math.sqrt((z + 1.0));
double t_4 = Math.sqrt((x + 1.0)) - Math.sqrt(x);
double t_5 = (t_3 - Math.sqrt(z)) + (t_4 + (t_2 - Math.sqrt(y)));
double tmp;
if (t_5 <= 0.0001) {
tmp = (0.5 * Math.sqrt((1.0 / x))) + ((t_1 - (Math.sqrt(t) + (Math.sqrt(z) - t_3))) + (0.5 * Math.sqrt((1.0 / y))));
} else if (t_5 <= 2.001) {
tmp = t_4 + ((1.0 / (Math.sqrt(z) + t_3)) + (1.0 / (t_2 + Math.sqrt(y))));
} else {
tmp = t_2 + (((1.0 + t_3) - (Math.sqrt(x) + Math.sqrt(z))) + ((1.0 / (t_1 + Math.sqrt(t))) - 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 + t)) t_2 = math.sqrt((1.0 + y)) t_3 = math.sqrt((z + 1.0)) t_4 = math.sqrt((x + 1.0)) - math.sqrt(x) t_5 = (t_3 - math.sqrt(z)) + (t_4 + (t_2 - math.sqrt(y))) tmp = 0 if t_5 <= 0.0001: tmp = (0.5 * math.sqrt((1.0 / x))) + ((t_1 - (math.sqrt(t) + (math.sqrt(z) - t_3))) + (0.5 * math.sqrt((1.0 / y)))) elif t_5 <= 2.001: tmp = t_4 + ((1.0 / (math.sqrt(z) + t_3)) + (1.0 / (t_2 + math.sqrt(y)))) else: tmp = t_2 + (((1.0 + t_3) - (math.sqrt(x) + math.sqrt(z))) + ((1.0 / (t_1 + math.sqrt(t))) - 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 + t)) t_2 = sqrt(Float64(1.0 + y)) t_3 = sqrt(Float64(z + 1.0)) t_4 = Float64(sqrt(Float64(x + 1.0)) - sqrt(x)) t_5 = Float64(Float64(t_3 - sqrt(z)) + Float64(t_4 + Float64(t_2 - sqrt(y)))) tmp = 0.0 if (t_5 <= 0.0001) tmp = Float64(Float64(0.5 * sqrt(Float64(1.0 / x))) + Float64(Float64(t_1 - Float64(sqrt(t) + Float64(sqrt(z) - t_3))) + Float64(0.5 * sqrt(Float64(1.0 / y))))); elseif (t_5 <= 2.001) tmp = Float64(t_4 + Float64(Float64(1.0 / Float64(sqrt(z) + t_3)) + Float64(1.0 / Float64(t_2 + sqrt(y))))); else tmp = Float64(t_2 + Float64(Float64(Float64(1.0 + t_3) - Float64(sqrt(x) + sqrt(z))) + Float64(Float64(1.0 / Float64(t_1 + sqrt(t))) - 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 + t));
t_2 = sqrt((1.0 + y));
t_3 = sqrt((z + 1.0));
t_4 = sqrt((x + 1.0)) - sqrt(x);
t_5 = (t_3 - sqrt(z)) + (t_4 + (t_2 - sqrt(y)));
tmp = 0.0;
if (t_5 <= 0.0001)
tmp = (0.5 * sqrt((1.0 / x))) + ((t_1 - (sqrt(t) + (sqrt(z) - t_3))) + (0.5 * sqrt((1.0 / y))));
elseif (t_5 <= 2.001)
tmp = t_4 + ((1.0 / (sqrt(z) + t_3)) + (1.0 / (t_2 + sqrt(y))));
else
tmp = t_2 + (((1.0 + t_3) - (sqrt(x) + sqrt(z))) + ((1.0 / (t_1 + sqrt(t))) - 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 + t), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[Sqrt[N[(z + 1.0), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$4 = N[(N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[(N[(t$95$3 - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] + N[(t$95$4 + N[(t$95$2 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$5, 0.0001], N[(N[(0.5 * N[Sqrt[N[(1.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$1 - N[(N[Sqrt[t], $MachinePrecision] + N[(N[Sqrt[z], $MachinePrecision] - t$95$3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(0.5 * N[Sqrt[N[(1.0 / y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$5, 2.001], N[(t$95$4 + N[(N[(1.0 / N[(N[Sqrt[z], $MachinePrecision] + t$95$3), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(t$95$2 + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$2 + N[(N[(N[(1.0 + t$95$3), $MachinePrecision] - N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 / N[(t$95$1 + N[Sqrt[t], $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}
t_1 := \sqrt{1 + t}\\
t_2 := \sqrt{1 + y}\\
t_3 := \sqrt{z + 1}\\
t_4 := \sqrt{x + 1} - \sqrt{x}\\
t_5 := \left(t\_3 - \sqrt{z}\right) + \left(t\_4 + \left(t\_2 - \sqrt{y}\right)\right)\\
\mathbf{if}\;t\_5 \leq 0.0001:\\
\;\;\;\;0.5 \cdot \sqrt{\frac{1}{x}} + \left(\left(t\_1 - \left(\sqrt{t} + \left(\sqrt{z} - t\_3\right)\right)\right) + 0.5 \cdot \sqrt{\frac{1}{y}}\right)\\
\mathbf{elif}\;t\_5 \leq 2.001:\\
\;\;\;\;t\_4 + \left(\frac{1}{\sqrt{z} + t\_3} + \frac{1}{t\_2 + \sqrt{y}}\right)\\
\mathbf{else}:\\
\;\;\;\;t\_2 + \left(\left(\left(1 + t\_3\right) - \left(\sqrt{x} + \sqrt{z}\right)\right) + \left(\frac{1}{t\_1 + \sqrt{t}} - \sqrt{y}\right)\right)\\
\end{array}
\end{array}
if (+.f64 (+.f64 (-.f64 (sqrt.f64 (+.f64 x #s(literal 1 binary64))) (sqrt.f64 x)) (-.f64 (sqrt.f64 (+.f64 y #s(literal 1 binary64))) (sqrt.f64 y))) (-.f64 (sqrt.f64 (+.f64 z #s(literal 1 binary64))) (sqrt.f64 z))) < 1.00000000000000005e-4Initial program 48.8%
associate-+l+48.8%
associate-+l+48.8%
+-commutative48.8%
+-commutative48.8%
associate-+l-46.6%
+-commutative46.6%
+-commutative46.6%
Simplified46.6%
Taylor expanded in x around inf 60.2%
Taylor expanded in y around inf 73.2%
if 1.00000000000000005e-4 < (+.f64 (+.f64 (-.f64 (sqrt.f64 (+.f64 x #s(literal 1 binary64))) (sqrt.f64 x)) (-.f64 (sqrt.f64 (+.f64 y #s(literal 1 binary64))) (sqrt.f64 y))) (-.f64 (sqrt.f64 (+.f64 z #s(literal 1 binary64))) (sqrt.f64 z))) < 2.00099999999999989Initial program 96.6%
associate-+l+96.6%
associate-+l+96.6%
+-commutative96.6%
+-commutative96.6%
associate-+l-76.7%
+-commutative76.7%
+-commutative76.7%
Simplified76.7%
add-log-exp76.7%
associate--r-96.6%
+-commutative96.6%
Applied egg-rr96.6%
flip--96.6%
add-sqr-sqrt76.1%
add-sqr-sqrt96.8%
Applied egg-rr96.8%
associate--l+96.9%
+-inverses96.9%
metadata-eval96.9%
+-commutative96.9%
Simplified96.9%
Taylor expanded in t around inf 57.0%
flip--76.7%
add-sqr-sqrt58.4%
add-sqr-sqrt76.9%
Applied egg-rr57.2%
associate--l+57.4%
+-inverses57.4%
metadata-eval57.4%
+-commutative57.4%
Simplified57.4%
if 2.00099999999999989 < (+.f64 (+.f64 (-.f64 (sqrt.f64 (+.f64 x #s(literal 1 binary64))) (sqrt.f64 x)) (-.f64 (sqrt.f64 (+.f64 y #s(literal 1 binary64))) (sqrt.f64 y))) (-.f64 (sqrt.f64 (+.f64 z #s(literal 1 binary64))) (sqrt.f64 z))) Initial program 99.6%
+-commutative99.6%
associate-+r+99.6%
associate-+r-99.6%
associate-+l-99.5%
associate-+r-99.5%
Simplified99.5%
flip--99.5%
add-sqr-sqrt79.5%
add-sqr-sqrt99.5%
+-commutative99.5%
+-commutative99.5%
Applied egg-rr99.5%
associate--r+99.9%
+-inverses99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in x around 0 97.2%
Final simplification64.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 (+ z 1.0)))
(t_2 (sqrt (+ 1.0 y)))
(t_3 (sqrt (+ 1.0 t)))
(t_4 (sqrt (+ x 1.0))))
(if (<= z 5.8e+29)
(+
(- t_4 (sqrt x))
(+
(- t_2 (sqrt y))
(log (exp (+ (- t_3 (sqrt t)) (/ 1.0 (+ (sqrt z) t_1)))))))
(+
(/ 1.0 (+ (sqrt x) t_4))
(+
(/ (- (+ 1.0 y) y) (+ t_2 (sqrt y)))
(- t_3 (+ (sqrt t) (- (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((z + 1.0));
double t_2 = sqrt((1.0 + y));
double t_3 = sqrt((1.0 + t));
double t_4 = sqrt((x + 1.0));
double tmp;
if (z <= 5.8e+29) {
tmp = (t_4 - sqrt(x)) + ((t_2 - sqrt(y)) + log(exp(((t_3 - sqrt(t)) + (1.0 / (sqrt(z) + t_1))))));
} else {
tmp = (1.0 / (sqrt(x) + t_4)) + ((((1.0 + y) - y) / (t_2 + sqrt(y))) + (t_3 - (sqrt(t) + (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) :: t_3
real(8) :: t_4
real(8) :: tmp
t_1 = sqrt((z + 1.0d0))
t_2 = sqrt((1.0d0 + y))
t_3 = sqrt((1.0d0 + t))
t_4 = sqrt((x + 1.0d0))
if (z <= 5.8d+29) then
tmp = (t_4 - sqrt(x)) + ((t_2 - sqrt(y)) + log(exp(((t_3 - sqrt(t)) + (1.0d0 / (sqrt(z) + t_1))))))
else
tmp = (1.0d0 / (sqrt(x) + t_4)) + ((((1.0d0 + y) - y) / (t_2 + sqrt(y))) + (t_3 - (sqrt(t) + (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((z + 1.0));
double t_2 = Math.sqrt((1.0 + y));
double t_3 = Math.sqrt((1.0 + t));
double t_4 = Math.sqrt((x + 1.0));
double tmp;
if (z <= 5.8e+29) {
tmp = (t_4 - Math.sqrt(x)) + ((t_2 - Math.sqrt(y)) + Math.log(Math.exp(((t_3 - Math.sqrt(t)) + (1.0 / (Math.sqrt(z) + t_1))))));
} else {
tmp = (1.0 / (Math.sqrt(x) + t_4)) + ((((1.0 + y) - y) / (t_2 + Math.sqrt(y))) + (t_3 - (Math.sqrt(t) + (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((z + 1.0)) t_2 = math.sqrt((1.0 + y)) t_3 = math.sqrt((1.0 + t)) t_4 = math.sqrt((x + 1.0)) tmp = 0 if z <= 5.8e+29: tmp = (t_4 - math.sqrt(x)) + ((t_2 - math.sqrt(y)) + math.log(math.exp(((t_3 - math.sqrt(t)) + (1.0 / (math.sqrt(z) + t_1)))))) else: tmp = (1.0 / (math.sqrt(x) + t_4)) + ((((1.0 + y) - y) / (t_2 + math.sqrt(y))) + (t_3 - (math.sqrt(t) + (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(z + 1.0)) t_2 = sqrt(Float64(1.0 + y)) t_3 = sqrt(Float64(1.0 + t)) t_4 = sqrt(Float64(x + 1.0)) tmp = 0.0 if (z <= 5.8e+29) tmp = Float64(Float64(t_4 - sqrt(x)) + Float64(Float64(t_2 - sqrt(y)) + log(exp(Float64(Float64(t_3 - sqrt(t)) + Float64(1.0 / Float64(sqrt(z) + t_1))))))); else tmp = Float64(Float64(1.0 / Float64(sqrt(x) + t_4)) + Float64(Float64(Float64(Float64(1.0 + y) - y) / Float64(t_2 + sqrt(y))) + Float64(t_3 - Float64(sqrt(t) + 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((z + 1.0));
t_2 = sqrt((1.0 + y));
t_3 = sqrt((1.0 + t));
t_4 = sqrt((x + 1.0));
tmp = 0.0;
if (z <= 5.8e+29)
tmp = (t_4 - sqrt(x)) + ((t_2 - sqrt(y)) + log(exp(((t_3 - sqrt(t)) + (1.0 / (sqrt(z) + t_1))))));
else
tmp = (1.0 / (sqrt(x) + t_4)) + ((((1.0 + y) - y) / (t_2 + sqrt(y))) + (t_3 - (sqrt(t) + (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[(z + 1.0), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$4 = N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[z, 5.8e+29], N[(N[(t$95$4 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$2 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision] + N[Log[N[Exp[N[(N[(t$95$3 - N[Sqrt[t], $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[z], $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + t$95$4), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(N[(1.0 + y), $MachinePrecision] - y), $MachinePrecision] / N[(t$95$2 + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$3 - N[(N[Sqrt[t], $MachinePrecision] + N[(N[Sqrt[z], $MachinePrecision] - t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{z + 1}\\
t_2 := \sqrt{1 + y}\\
t_3 := \sqrt{1 + t}\\
t_4 := \sqrt{x + 1}\\
\mathbf{if}\;z \leq 5.8 \cdot 10^{+29}:\\
\;\;\;\;\left(t\_4 - \sqrt{x}\right) + \left(\left(t\_2 - \sqrt{y}\right) + \log \left(e^{\left(t\_3 - \sqrt{t}\right) + \frac{1}{\sqrt{z} + t\_1}}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{x} + t\_4} + \left(\frac{\left(1 + y\right) - y}{t\_2 + \sqrt{y}} + \left(t\_3 - \left(\sqrt{t} + \left(\sqrt{z} - t\_1\right)\right)\right)\right)\\
\end{array}
\end{array}
if z < 5.7999999999999999e29Initial program 95.5%
associate-+l+95.5%
associate-+l+95.5%
+-commutative95.5%
+-commutative95.5%
associate-+l-60.4%
+-commutative60.4%
+-commutative60.4%
Simplified60.4%
add-log-exp60.4%
associate--r-95.5%
+-commutative95.5%
Applied egg-rr95.5%
flip--95.6%
add-sqr-sqrt95.1%
add-sqr-sqrt96.0%
Applied egg-rr96.0%
associate--l+96.3%
+-inverses96.3%
metadata-eval96.3%
+-commutative96.3%
Simplified96.3%
if 5.7999999999999999e29 < z Initial program 87.6%
associate-+l+87.6%
associate-+l+87.6%
+-commutative87.6%
+-commutative87.6%
associate-+l-87.6%
+-commutative87.6%
+-commutative87.6%
Simplified87.6%
flip--87.7%
add-sqr-sqrt70.7%
add-sqr-sqrt88.1%
Applied egg-rr88.1%
flip--88.3%
add-sqr-sqrt73.6%
+-commutative73.6%
add-sqr-sqrt88.5%
+-commutative88.5%
Applied egg-rr88.5%
associate--l+91.9%
+-inverses91.9%
metadata-eval91.9%
Simplified91.9%
Final simplification94.5%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ 1.0 y)))
(t_2 (- (sqrt (+ x 1.0)) (sqrt x)))
(t_3 (/ 1.0 (+ (sqrt z) (sqrt (+ z 1.0))))))
(if (<= t_2 1e-5)
(+ (* 0.5 (sqrt (/ 1.0 x))) (+ (- t_1 (sqrt y)) t_3))
(+ t_2 (+ t_3 (/ 1.0 (+ t_1 (sqrt y))))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + y));
double t_2 = sqrt((x + 1.0)) - sqrt(x);
double t_3 = 1.0 / (sqrt(z) + sqrt((z + 1.0)));
double tmp;
if (t_2 <= 1e-5) {
tmp = (0.5 * sqrt((1.0 / x))) + ((t_1 - sqrt(y)) + t_3);
} else {
tmp = t_2 + (t_3 + (1.0 / (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) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = sqrt((1.0d0 + y))
t_2 = sqrt((x + 1.0d0)) - sqrt(x)
t_3 = 1.0d0 / (sqrt(z) + sqrt((z + 1.0d0)))
if (t_2 <= 1d-5) then
tmp = (0.5d0 * sqrt((1.0d0 / x))) + ((t_1 - sqrt(y)) + t_3)
else
tmp = t_2 + (t_3 + (1.0d0 / (t_1 + sqrt(y))))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + y));
double t_2 = Math.sqrt((x + 1.0)) - Math.sqrt(x);
double t_3 = 1.0 / (Math.sqrt(z) + Math.sqrt((z + 1.0)));
double tmp;
if (t_2 <= 1e-5) {
tmp = (0.5 * Math.sqrt((1.0 / x))) + ((t_1 - Math.sqrt(y)) + t_3);
} else {
tmp = t_2 + (t_3 + (1.0 / (t_1 + Math.sqrt(y))));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + y)) t_2 = math.sqrt((x + 1.0)) - math.sqrt(x) t_3 = 1.0 / (math.sqrt(z) + math.sqrt((z + 1.0))) tmp = 0 if t_2 <= 1e-5: tmp = (0.5 * math.sqrt((1.0 / x))) + ((t_1 - math.sqrt(y)) + t_3) else: tmp = t_2 + (t_3 + (1.0 / (t_1 + math.sqrt(y)))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(1.0 + y)) t_2 = Float64(sqrt(Float64(x + 1.0)) - sqrt(x)) t_3 = Float64(1.0 / Float64(sqrt(z) + sqrt(Float64(z + 1.0)))) tmp = 0.0 if (t_2 <= 1e-5) tmp = Float64(Float64(0.5 * sqrt(Float64(1.0 / x))) + Float64(Float64(t_1 - sqrt(y)) + t_3)); else tmp = Float64(t_2 + Float64(t_3 + Float64(1.0 / Float64(t_1 + sqrt(y))))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + y));
t_2 = sqrt((x + 1.0)) - sqrt(x);
t_3 = 1.0 / (sqrt(z) + sqrt((z + 1.0)));
tmp = 0.0;
if (t_2 <= 1e-5)
tmp = (0.5 * sqrt((1.0 / x))) + ((t_1 - sqrt(y)) + t_3);
else
tmp = t_2 + (t_3 + (1.0 / (t_1 + sqrt(y))));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(1.0 / N[(N[Sqrt[z], $MachinePrecision] + N[Sqrt[N[(z + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, 1e-5], N[(N[(0.5 * N[Sqrt[N[(1.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$1 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision] + t$95$3), $MachinePrecision]), $MachinePrecision], N[(t$95$2 + N[(t$95$3 + N[(1.0 / N[(t$95$1 + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + y}\\
t_2 := \sqrt{x + 1} - \sqrt{x}\\
t_3 := \frac{1}{\sqrt{z} + \sqrt{z + 1}}\\
\mathbf{if}\;t\_2 \leq 10^{-5}:\\
\;\;\;\;0.5 \cdot \sqrt{\frac{1}{x}} + \left(\left(t\_1 - \sqrt{y}\right) + t\_3\right)\\
\mathbf{else}:\\
\;\;\;\;t\_2 + \left(t\_3 + \frac{1}{t\_1 + \sqrt{y}}\right)\\
\end{array}
\end{array}
if (-.f64 (sqrt.f64 (+.f64 x #s(literal 1 binary64))) (sqrt.f64 x)) < 1.00000000000000008e-5Initial program 86.3%
associate-+l+86.3%
associate-+l+86.3%
+-commutative86.3%
+-commutative86.3%
associate-+l-66.7%
+-commutative66.7%
+-commutative66.7%
Simplified66.7%
add-log-exp66.7%
associate--r-86.3%
+-commutative86.3%
Applied egg-rr86.3%
flip--86.4%
add-sqr-sqrt75.7%
add-sqr-sqrt86.6%
Applied egg-rr86.6%
associate--l+86.7%
+-inverses86.7%
metadata-eval86.7%
+-commutative86.7%
Simplified86.7%
Taylor expanded in t around inf 45.2%
Taylor expanded in x around inf 47.9%
if 1.00000000000000008e-5 < (-.f64 (sqrt.f64 (+.f64 x #s(literal 1 binary64))) (sqrt.f64 x)) Initial program 97.6%
associate-+l+97.6%
associate-+l+97.6%
+-commutative97.6%
+-commutative97.6%
associate-+l-76.6%
+-commutative76.6%
+-commutative76.6%
Simplified76.6%
add-log-exp76.6%
associate--r-97.6%
+-commutative97.6%
Applied egg-rr97.6%
flip--97.6%
add-sqr-sqrt73.5%
add-sqr-sqrt97.9%
Applied egg-rr97.9%
associate--l+98.1%
+-inverses98.1%
metadata-eval98.1%
+-commutative98.1%
Simplified98.1%
Taylor expanded in t around inf 61.1%
flip--76.6%
add-sqr-sqrt56.7%
add-sqr-sqrt76.7%
Applied egg-rr61.1%
associate--l+61.1%
+-inverses61.1%
metadata-eval61.1%
+-commutative61.1%
Simplified61.1%
Final simplification54.8%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ z 1.0))) (t_2 (sqrt (+ x 1.0))))
(if (<= t 2950000000000.0)
(+
(- t_2 (sqrt x))
(+ (- (sqrt (+ 1.0 t)) (+ (sqrt t) (- (sqrt z) t_1))) (- 1.0 (sqrt y))))
(+
(/ 1.0 (+ (sqrt x) t_2))
(+ (- (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((z + 1.0));
double t_2 = sqrt((x + 1.0));
double tmp;
if (t <= 2950000000000.0) {
tmp = (t_2 - sqrt(x)) + ((sqrt((1.0 + t)) - (sqrt(t) + (sqrt(z) - t_1))) + (1.0 - sqrt(y)));
} else {
tmp = (1.0 / (sqrt(x) + t_2)) + ((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((z + 1.0d0))
t_2 = sqrt((x + 1.0d0))
if (t <= 2950000000000.0d0) then
tmp = (t_2 - sqrt(x)) + ((sqrt((1.0d0 + t)) - (sqrt(t) + (sqrt(z) - t_1))) + (1.0d0 - sqrt(y)))
else
tmp = (1.0d0 / (sqrt(x) + t_2)) + ((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((z + 1.0));
double t_2 = Math.sqrt((x + 1.0));
double tmp;
if (t <= 2950000000000.0) {
tmp = (t_2 - Math.sqrt(x)) + ((Math.sqrt((1.0 + t)) - (Math.sqrt(t) + (Math.sqrt(z) - t_1))) + (1.0 - Math.sqrt(y)));
} else {
tmp = (1.0 / (Math.sqrt(x) + t_2)) + ((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((z + 1.0)) t_2 = math.sqrt((x + 1.0)) tmp = 0 if t <= 2950000000000.0: tmp = (t_2 - math.sqrt(x)) + ((math.sqrt((1.0 + t)) - (math.sqrt(t) + (math.sqrt(z) - t_1))) + (1.0 - math.sqrt(y))) else: tmp = (1.0 / (math.sqrt(x) + t_2)) + ((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(z + 1.0)) t_2 = sqrt(Float64(x + 1.0)) tmp = 0.0 if (t <= 2950000000000.0) tmp = Float64(Float64(t_2 - sqrt(x)) + Float64(Float64(sqrt(Float64(1.0 + t)) - Float64(sqrt(t) + Float64(sqrt(z) - t_1))) + Float64(1.0 - sqrt(y)))); else tmp = Float64(Float64(1.0 / Float64(sqrt(x) + t_2)) + Float64(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((z + 1.0));
t_2 = sqrt((x + 1.0));
tmp = 0.0;
if (t <= 2950000000000.0)
tmp = (t_2 - sqrt(x)) + ((sqrt((1.0 + t)) - (sqrt(t) + (sqrt(z) - t_1))) + (1.0 - sqrt(y)));
else
tmp = (1.0 / (sqrt(x) + t_2)) + ((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[(z + 1.0), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t, 2950000000000.0], N[(N[(t$95$2 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[(N[Sqrt[t], $MachinePrecision] + N[(N[Sqrt[z], $MachinePrecision] - t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + t$95$2), $MachinePrecision]), $MachinePrecision] + N[(N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[z], $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{z + 1}\\
t_2 := \sqrt{x + 1}\\
\mathbf{if}\;t \leq 2950000000000:\\
\;\;\;\;\left(t\_2 - \sqrt{x}\right) + \left(\left(\sqrt{1 + t} - \left(\sqrt{t} + \left(\sqrt{z} - t\_1\right)\right)\right) + \left(1 - \sqrt{y}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{x} + t\_2} + \left(\left(\sqrt{1 + y} - \sqrt{y}\right) + \frac{1}{\sqrt{z} + t\_1}\right)\\
\end{array}
\end{array}
if t < 2.95e12Initial program 96.6%
associate-+l+96.6%
associate-+l+96.6%
+-commutative96.6%
+-commutative96.6%
associate-+l-96.6%
+-commutative96.6%
+-commutative96.6%
Simplified96.6%
Taylor expanded in y around 0 50.5%
if 2.95e12 < t Initial program 87.4%
associate-+l+87.4%
associate-+l+87.4%
+-commutative87.4%
+-commutative87.4%
associate-+l-45.5%
+-commutative45.5%
+-commutative45.5%
Simplified45.5%
add-log-exp45.5%
associate--r-87.4%
+-commutative87.4%
Applied egg-rr87.4%
flip--87.4%
add-sqr-sqrt69.6%
add-sqr-sqrt87.9%
Applied egg-rr87.9%
associate--l+88.1%
+-inverses88.1%
metadata-eval88.1%
+-commutative88.1%
Simplified88.1%
Taylor expanded in t around inf 90.1%
flip--46.0%
add-sqr-sqrt40.7%
+-commutative40.7%
add-sqr-sqrt46.1%
+-commutative46.1%
Applied egg-rr91.1%
associate--l+49.2%
+-inverses49.2%
metadata-eval49.2%
Simplified93.4%
Final simplification71.3%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ 1.0 y))) (t_2 (sqrt (+ z 1.0))))
(if (<= t 3.3e+24)
(+
t_1
(+
(+ t_2 (- (- 1.0 (sqrt x)) (sqrt z)))
(- (- (sqrt (+ 1.0 t)) (sqrt t)) (sqrt y))))
(+
(/ 1.0 (+ (sqrt x) (sqrt (+ x 1.0))))
(+ (- t_1 (sqrt y)) (/ 1.0 (+ (sqrt z) 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 + y));
double t_2 = sqrt((z + 1.0));
double tmp;
if (t <= 3.3e+24) {
tmp = t_1 + ((t_2 + ((1.0 - sqrt(x)) - sqrt(z))) + ((sqrt((1.0 + t)) - sqrt(t)) - sqrt(y)));
} else {
tmp = (1.0 / (sqrt(x) + sqrt((x + 1.0)))) + ((t_1 - sqrt(y)) + (1.0 / (sqrt(z) + 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 + y))
t_2 = sqrt((z + 1.0d0))
if (t <= 3.3d+24) then
tmp = t_1 + ((t_2 + ((1.0d0 - sqrt(x)) - sqrt(z))) + ((sqrt((1.0d0 + t)) - sqrt(t)) - sqrt(y)))
else
tmp = (1.0d0 / (sqrt(x) + sqrt((x + 1.0d0)))) + ((t_1 - sqrt(y)) + (1.0d0 / (sqrt(z) + 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 + y));
double t_2 = Math.sqrt((z + 1.0));
double tmp;
if (t <= 3.3e+24) {
tmp = t_1 + ((t_2 + ((1.0 - Math.sqrt(x)) - Math.sqrt(z))) + ((Math.sqrt((1.0 + t)) - Math.sqrt(t)) - Math.sqrt(y)));
} else {
tmp = (1.0 / (Math.sqrt(x) + Math.sqrt((x + 1.0)))) + ((t_1 - Math.sqrt(y)) + (1.0 / (Math.sqrt(z) + 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 + y)) t_2 = math.sqrt((z + 1.0)) tmp = 0 if t <= 3.3e+24: tmp = t_1 + ((t_2 + ((1.0 - math.sqrt(x)) - math.sqrt(z))) + ((math.sqrt((1.0 + t)) - math.sqrt(t)) - math.sqrt(y))) else: tmp = (1.0 / (math.sqrt(x) + math.sqrt((x + 1.0)))) + ((t_1 - math.sqrt(y)) + (1.0 / (math.sqrt(z) + t_2))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(1.0 + y)) t_2 = sqrt(Float64(z + 1.0)) tmp = 0.0 if (t <= 3.3e+24) tmp = Float64(t_1 + Float64(Float64(t_2 + Float64(Float64(1.0 - sqrt(x)) - sqrt(z))) + Float64(Float64(sqrt(Float64(1.0 + t)) - sqrt(t)) - sqrt(y)))); else tmp = Float64(Float64(1.0 / Float64(sqrt(x) + sqrt(Float64(x + 1.0)))) + Float64(Float64(t_1 - sqrt(y)) + Float64(1.0 / Float64(sqrt(z) + 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 + y));
t_2 = sqrt((z + 1.0));
tmp = 0.0;
if (t <= 3.3e+24)
tmp = t_1 + ((t_2 + ((1.0 - sqrt(x)) - sqrt(z))) + ((sqrt((1.0 + t)) - sqrt(t)) - sqrt(y)));
else
tmp = (1.0 / (sqrt(x) + sqrt((x + 1.0)))) + ((t_1 - sqrt(y)) + (1.0 / (sqrt(z) + t_2)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(z + 1.0), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t, 3.3e+24], N[(t$95$1 + N[(N[(t$95$2 + N[(N[(1.0 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$1 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[z], $MachinePrecision] + t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + y}\\
t_2 := \sqrt{z + 1}\\
\mathbf{if}\;t \leq 3.3 \cdot 10^{+24}:\\
\;\;\;\;t\_1 + \left(\left(t\_2 + \left(\left(1 - \sqrt{x}\right) - \sqrt{z}\right)\right) + \left(\left(\sqrt{1 + t} - \sqrt{t}\right) - \sqrt{y}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{x} + \sqrt{x + 1}} + \left(\left(t\_1 - \sqrt{y}\right) + \frac{1}{\sqrt{z} + t\_2}\right)\\
\end{array}
\end{array}
if t < 3.2999999999999999e24Initial program 96.0%
+-commutative96.0%
associate-+r+96.0%
associate-+r-79.6%
associate-+l-63.6%
associate-+r-59.3%
Simplified50.3%
Taylor expanded in x around 0 23.0%
if 3.2999999999999999e24 < t Initial program 87.9%
associate-+l+87.9%
associate-+l+87.9%
+-commutative87.9%
+-commutative87.9%
associate-+l-44.9%
+-commutative44.9%
+-commutative44.9%
Simplified44.9%
add-log-exp44.9%
associate--r-87.8%
+-commutative87.8%
Applied egg-rr87.8%
flip--87.8%
add-sqr-sqrt70.1%
add-sqr-sqrt88.3%
Applied egg-rr88.3%
associate--l+88.6%
+-inverses88.6%
metadata-eval88.6%
+-commutative88.6%
Simplified88.6%
Taylor expanded in t around inf 90.6%
flip--45.4%
add-sqr-sqrt41.1%
+-commutative41.1%
add-sqr-sqrt45.6%
+-commutative45.6%
Applied egg-rr91.7%
associate--l+48.7%
+-inverses48.7%
metadata-eval48.7%
Simplified94.0%
Final simplification56.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 (+ z 1.0))) (t_2 (sqrt (+ x 1.0))))
(if (<= t 160000000000.0)
(+
1.0
(-
(+ t_2 (+ (sqrt (+ 1.0 t)) t_1))
(+ (sqrt t) (+ (sqrt z) (+ (sqrt x) (sqrt y))))))
(+
(/ 1.0 (+ (sqrt x) t_2))
(+ (- (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((z + 1.0));
double t_2 = sqrt((x + 1.0));
double tmp;
if (t <= 160000000000.0) {
tmp = 1.0 + ((t_2 + (sqrt((1.0 + t)) + t_1)) - (sqrt(t) + (sqrt(z) + (sqrt(x) + sqrt(y)))));
} else {
tmp = (1.0 / (sqrt(x) + t_2)) + ((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((z + 1.0d0))
t_2 = sqrt((x + 1.0d0))
if (t <= 160000000000.0d0) then
tmp = 1.0d0 + ((t_2 + (sqrt((1.0d0 + t)) + t_1)) - (sqrt(t) + (sqrt(z) + (sqrt(x) + sqrt(y)))))
else
tmp = (1.0d0 / (sqrt(x) + t_2)) + ((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((z + 1.0));
double t_2 = Math.sqrt((x + 1.0));
double tmp;
if (t <= 160000000000.0) {
tmp = 1.0 + ((t_2 + (Math.sqrt((1.0 + t)) + t_1)) - (Math.sqrt(t) + (Math.sqrt(z) + (Math.sqrt(x) + Math.sqrt(y)))));
} else {
tmp = (1.0 / (Math.sqrt(x) + t_2)) + ((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((z + 1.0)) t_2 = math.sqrt((x + 1.0)) tmp = 0 if t <= 160000000000.0: tmp = 1.0 + ((t_2 + (math.sqrt((1.0 + t)) + t_1)) - (math.sqrt(t) + (math.sqrt(z) + (math.sqrt(x) + math.sqrt(y))))) else: tmp = (1.0 / (math.sqrt(x) + t_2)) + ((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(z + 1.0)) t_2 = sqrt(Float64(x + 1.0)) tmp = 0.0 if (t <= 160000000000.0) tmp = Float64(1.0 + Float64(Float64(t_2 + Float64(sqrt(Float64(1.0 + t)) + t_1)) - Float64(sqrt(t) + Float64(sqrt(z) + Float64(sqrt(x) + sqrt(y)))))); else tmp = Float64(Float64(1.0 / Float64(sqrt(x) + t_2)) + Float64(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((z + 1.0));
t_2 = sqrt((x + 1.0));
tmp = 0.0;
if (t <= 160000000000.0)
tmp = 1.0 + ((t_2 + (sqrt((1.0 + t)) + t_1)) - (sqrt(t) + (sqrt(z) + (sqrt(x) + sqrt(y)))));
else
tmp = (1.0 / (sqrt(x) + t_2)) + ((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[(z + 1.0), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t, 160000000000.0], N[(1.0 + N[(N[(t$95$2 + N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[t], $MachinePrecision] + N[(N[Sqrt[z], $MachinePrecision] + N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + t$95$2), $MachinePrecision]), $MachinePrecision] + N[(N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[z], $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{z + 1}\\
t_2 := \sqrt{x + 1}\\
\mathbf{if}\;t \leq 160000000000:\\
\;\;\;\;1 + \left(\left(t\_2 + \left(\sqrt{1 + t} + t\_1\right)\right) - \left(\sqrt{t} + \left(\sqrt{z} + \left(\sqrt{x} + \sqrt{y}\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{x} + t\_2} + \left(\left(\sqrt{1 + y} - \sqrt{y}\right) + \frac{1}{\sqrt{z} + t\_1}\right)\\
\end{array}
\end{array}
if t < 1.6e11Initial program 96.6%
+-commutative96.6%
associate-+r+96.6%
associate-+r-80.4%
associate-+l-64.0%
associate-+r-60.0%
Simplified50.9%
Taylor expanded in y around 0 16.3%
associate--l+26.5%
+-commutative26.5%
associate-+r+26.5%
+-commutative26.5%
associate-+r+26.5%
Simplified26.5%
if 1.6e11 < t Initial program 87.4%
associate-+l+87.4%
associate-+l+87.4%
+-commutative87.4%
+-commutative87.4%
associate-+l-45.5%
+-commutative45.5%
+-commutative45.5%
Simplified45.5%
add-log-exp45.5%
associate--r-87.4%
+-commutative87.4%
Applied egg-rr87.4%
flip--87.4%
add-sqr-sqrt69.6%
add-sqr-sqrt87.9%
Applied egg-rr87.9%
associate--l+88.1%
+-inverses88.1%
metadata-eval88.1%
+-commutative88.1%
Simplified88.1%
Taylor expanded in t around inf 90.1%
flip--46.0%
add-sqr-sqrt40.7%
+-commutative40.7%
add-sqr-sqrt46.1%
+-commutative46.1%
Applied egg-rr91.1%
associate--l+49.2%
+-inverses49.2%
metadata-eval49.2%
Simplified93.4%
Final simplification58.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 (+ z 1.0))))
(if (<= x 41000000.0)
(+
(- (sqrt (+ x 1.0)) (sqrt x))
(+ (/ 1.0 (+ (sqrt z) t_1)) (/ 1.0 (+ (sqrt (+ 1.0 y)) (sqrt y)))))
(+
(* 0.5 (sqrt (/ 1.0 x)))
(+
(- (sqrt (+ 1.0 t)) (+ (sqrt t) (- (sqrt z) t_1)))
(* 0.5 (sqrt (/ 1.0 y))))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((z + 1.0));
double tmp;
if (x <= 41000000.0) {
tmp = (sqrt((x + 1.0)) - sqrt(x)) + ((1.0 / (sqrt(z) + t_1)) + (1.0 / (sqrt((1.0 + y)) + sqrt(y))));
} else {
tmp = (0.5 * sqrt((1.0 / x))) + ((sqrt((1.0 + t)) - (sqrt(t) + (sqrt(z) - t_1))) + (0.5 * sqrt((1.0 / y))));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = sqrt((z + 1.0d0))
if (x <= 41000000.0d0) then
tmp = (sqrt((x + 1.0d0)) - sqrt(x)) + ((1.0d0 / (sqrt(z) + t_1)) + (1.0d0 / (sqrt((1.0d0 + y)) + sqrt(y))))
else
tmp = (0.5d0 * sqrt((1.0d0 / x))) + ((sqrt((1.0d0 + t)) - (sqrt(t) + (sqrt(z) - t_1))) + (0.5d0 * sqrt((1.0d0 / y))))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((z + 1.0));
double tmp;
if (x <= 41000000.0) {
tmp = (Math.sqrt((x + 1.0)) - Math.sqrt(x)) + ((1.0 / (Math.sqrt(z) + t_1)) + (1.0 / (Math.sqrt((1.0 + y)) + Math.sqrt(y))));
} else {
tmp = (0.5 * Math.sqrt((1.0 / x))) + ((Math.sqrt((1.0 + t)) - (Math.sqrt(t) + (Math.sqrt(z) - t_1))) + (0.5 * Math.sqrt((1.0 / y))));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((z + 1.0)) tmp = 0 if x <= 41000000.0: tmp = (math.sqrt((x + 1.0)) - math.sqrt(x)) + ((1.0 / (math.sqrt(z) + t_1)) + (1.0 / (math.sqrt((1.0 + y)) + math.sqrt(y)))) else: tmp = (0.5 * math.sqrt((1.0 / x))) + ((math.sqrt((1.0 + t)) - (math.sqrt(t) + (math.sqrt(z) - t_1))) + (0.5 * math.sqrt((1.0 / y)))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(z + 1.0)) tmp = 0.0 if (x <= 41000000.0) tmp = Float64(Float64(sqrt(Float64(x + 1.0)) - sqrt(x)) + Float64(Float64(1.0 / Float64(sqrt(z) + t_1)) + Float64(1.0 / Float64(sqrt(Float64(1.0 + y)) + sqrt(y))))); else tmp = Float64(Float64(0.5 * sqrt(Float64(1.0 / x))) + Float64(Float64(sqrt(Float64(1.0 + t)) - Float64(sqrt(t) + Float64(sqrt(z) - t_1))) + Float64(0.5 * sqrt(Float64(1.0 / y))))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((z + 1.0));
tmp = 0.0;
if (x <= 41000000.0)
tmp = (sqrt((x + 1.0)) - sqrt(x)) + ((1.0 / (sqrt(z) + t_1)) + (1.0 / (sqrt((1.0 + y)) + sqrt(y))));
else
tmp = (0.5 * sqrt((1.0 / x))) + ((sqrt((1.0 + t)) - (sqrt(t) + (sqrt(z) - t_1))) + (0.5 * sqrt((1.0 / y))));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(z + 1.0), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x, 41000000.0], N[(N[(N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 / N[(N[Sqrt[z], $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]), $MachinePrecision], N[(N[(0.5 * N[Sqrt[N[(1.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[(N[Sqrt[t], $MachinePrecision] + N[(N[Sqrt[z], $MachinePrecision] - t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(0.5 * N[Sqrt[N[(1.0 / y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{z + 1}\\
\mathbf{if}\;x \leq 41000000:\\
\;\;\;\;\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\frac{1}{\sqrt{z} + t\_1} + \frac{1}{\sqrt{1 + y} + \sqrt{y}}\right)\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \sqrt{\frac{1}{x}} + \left(\left(\sqrt{1 + t} - \left(\sqrt{t} + \left(\sqrt{z} - t\_1\right)\right)\right) + 0.5 \cdot \sqrt{\frac{1}{y}}\right)\\
\end{array}
\end{array}
if x < 4.1e7Initial program 98.4%
associate-+l+98.4%
associate-+l+98.4%
+-commutative98.4%
+-commutative98.4%
associate-+l-77.3%
+-commutative77.3%
+-commutative77.3%
Simplified77.3%
add-log-exp77.3%
associate--r-98.4%
+-commutative98.4%
Applied egg-rr98.4%
flip--98.4%
add-sqr-sqrt74.2%
add-sqr-sqrt98.7%
Applied egg-rr98.7%
associate--l+98.9%
+-inverses98.9%
metadata-eval98.9%
+-commutative98.9%
Simplified98.9%
Taylor expanded in t around inf 60.8%
flip--77.2%
add-sqr-sqrt56.9%
add-sqr-sqrt77.4%
Applied egg-rr60.8%
associate--l+60.8%
+-inverses60.8%
metadata-eval60.8%
+-commutative60.8%
Simplified60.8%
if 4.1e7 < x Initial program 85.8%
associate-+l+85.8%
associate-+l+85.8%
+-commutative85.8%
+-commutative85.8%
associate-+l-66.4%
+-commutative66.4%
+-commutative66.4%
Simplified66.4%
Taylor expanded in x around inf 70.6%
Taylor expanded in y around inf 35.5%
Final simplification48.2%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (sqrt (+ 1.0 y)) (sqrt y)))
(t_2 (/ 1.0 (+ (sqrt z) (sqrt (+ z 1.0))))))
(if (<= x 2000000000.0)
(+ t_2 (+ (- (sqrt (+ x 1.0)) (sqrt x)) t_1))
(+ (* 0.5 (sqrt (/ 1.0 x))) (+ t_1 t_2)))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + y)) - sqrt(y);
double t_2 = 1.0 / (sqrt(z) + sqrt((z + 1.0)));
double tmp;
if (x <= 2000000000.0) {
tmp = t_2 + ((sqrt((x + 1.0)) - sqrt(x)) + t_1);
} else {
tmp = (0.5 * sqrt((1.0 / x))) + (t_1 + t_2);
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = sqrt((1.0d0 + y)) - sqrt(y)
t_2 = 1.0d0 / (sqrt(z) + sqrt((z + 1.0d0)))
if (x <= 2000000000.0d0) then
tmp = t_2 + ((sqrt((x + 1.0d0)) - sqrt(x)) + t_1)
else
tmp = (0.5d0 * sqrt((1.0d0 / x))) + (t_1 + t_2)
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + y)) - Math.sqrt(y);
double t_2 = 1.0 / (Math.sqrt(z) + Math.sqrt((z + 1.0)));
double tmp;
if (x <= 2000000000.0) {
tmp = t_2 + ((Math.sqrt((x + 1.0)) - Math.sqrt(x)) + t_1);
} else {
tmp = (0.5 * Math.sqrt((1.0 / x))) + (t_1 + t_2);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + y)) - math.sqrt(y) t_2 = 1.0 / (math.sqrt(z) + math.sqrt((z + 1.0))) tmp = 0 if x <= 2000000000.0: tmp = t_2 + ((math.sqrt((x + 1.0)) - math.sqrt(x)) + t_1) else: tmp = (0.5 * math.sqrt((1.0 / x))) + (t_1 + 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 + y)) - sqrt(y)) t_2 = Float64(1.0 / Float64(sqrt(z) + sqrt(Float64(z + 1.0)))) tmp = 0.0 if (x <= 2000000000.0) tmp = Float64(t_2 + Float64(Float64(sqrt(Float64(x + 1.0)) - sqrt(x)) + t_1)); else tmp = Float64(Float64(0.5 * sqrt(Float64(1.0 / x))) + Float64(t_1 + t_2)); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + y)) - sqrt(y);
t_2 = 1.0 / (sqrt(z) + sqrt((z + 1.0)));
tmp = 0.0;
if (x <= 2000000000.0)
tmp = t_2 + ((sqrt((x + 1.0)) - sqrt(x)) + t_1);
else
tmp = (0.5 * sqrt((1.0 / x))) + (t_1 + t_2);
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(1.0 / N[(N[Sqrt[z], $MachinePrecision] + N[Sqrt[N[(z + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, 2000000000.0], N[(t$95$2 + N[(N[(N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision], N[(N[(0.5 * N[Sqrt[N[(1.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(t$95$1 + t$95$2), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + y} - \sqrt{y}\\
t_2 := \frac{1}{\sqrt{z} + \sqrt{z + 1}}\\
\mathbf{if}\;x \leq 2000000000:\\
\;\;\;\;t\_2 + \left(\left(\sqrt{x + 1} - \sqrt{x}\right) + t\_1\right)\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \sqrt{\frac{1}{x}} + \left(t\_1 + t\_2\right)\\
\end{array}
\end{array}
if x < 2e9Initial program 97.6%
associate-+l+97.6%
associate-+l+97.6%
+-commutative97.6%
+-commutative97.6%
associate-+l-76.6%
+-commutative76.6%
+-commutative76.6%
Simplified76.6%
add-log-exp76.6%
associate--r-97.6%
+-commutative97.6%
Applied egg-rr97.6%
flip--97.6%
add-sqr-sqrt73.5%
add-sqr-sqrt97.9%
Applied egg-rr97.9%
associate--l+98.1%
+-inverses98.1%
metadata-eval98.1%
+-commutative98.1%
Simplified98.1%
Taylor expanded in t around inf 61.1%
associate-+l-61.1%
+-commutative61.1%
+-commutative61.1%
Applied egg-rr61.1%
associate-+l-61.1%
+-commutative61.1%
associate-+l+61.1%
Simplified61.1%
if 2e9 < x Initial program 86.3%
associate-+l+86.3%
associate-+l+86.3%
+-commutative86.3%
+-commutative86.3%
associate-+l-66.7%
+-commutative66.7%
+-commutative66.7%
Simplified66.7%
add-log-exp66.7%
associate--r-86.3%
+-commutative86.3%
Applied egg-rr86.3%
flip--86.4%
add-sqr-sqrt75.7%
add-sqr-sqrt86.6%
Applied egg-rr86.6%
associate--l+86.7%
+-inverses86.7%
metadata-eval86.7%
+-commutative86.7%
Simplified86.7%
Taylor expanded in t around inf 45.2%
Taylor expanded in x around inf 47.9%
Final simplification54.8%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1
(+
(- (sqrt (+ 1.0 y)) (sqrt y))
(/ 1.0 (+ (sqrt z) (sqrt (+ z 1.0)))))))
(if (<= x 2000000000.0)
(+ (- (sqrt (+ x 1.0)) (sqrt x)) t_1)
(+ (* 0.5 (sqrt (/ 1.0 x))) t_1))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = (sqrt((1.0 + y)) - sqrt(y)) + (1.0 / (sqrt(z) + sqrt((z + 1.0))));
double tmp;
if (x <= 2000000000.0) {
tmp = (sqrt((x + 1.0)) - sqrt(x)) + t_1;
} else {
tmp = (0.5 * sqrt((1.0 / x))) + t_1;
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = (sqrt((1.0d0 + y)) - sqrt(y)) + (1.0d0 / (sqrt(z) + sqrt((z + 1.0d0))))
if (x <= 2000000000.0d0) then
tmp = (sqrt((x + 1.0d0)) - sqrt(x)) + t_1
else
tmp = (0.5d0 * sqrt((1.0d0 / x))) + t_1
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = (Math.sqrt((1.0 + y)) - Math.sqrt(y)) + (1.0 / (Math.sqrt(z) + Math.sqrt((z + 1.0))));
double tmp;
if (x <= 2000000000.0) {
tmp = (Math.sqrt((x + 1.0)) - Math.sqrt(x)) + t_1;
} else {
tmp = (0.5 * Math.sqrt((1.0 / x))) + t_1;
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = (math.sqrt((1.0 + y)) - math.sqrt(y)) + (1.0 / (math.sqrt(z) + math.sqrt((z + 1.0)))) tmp = 0 if x <= 2000000000.0: tmp = (math.sqrt((x + 1.0)) - math.sqrt(x)) + t_1 else: tmp = (0.5 * math.sqrt((1.0 / x))) + t_1 return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = Float64(Float64(sqrt(Float64(1.0 + y)) - sqrt(y)) + Float64(1.0 / Float64(sqrt(z) + sqrt(Float64(z + 1.0))))) tmp = 0.0 if (x <= 2000000000.0) tmp = Float64(Float64(sqrt(Float64(x + 1.0)) - sqrt(x)) + t_1); else tmp = Float64(Float64(0.5 * sqrt(Float64(1.0 / x))) + t_1); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = (sqrt((1.0 + y)) - sqrt(y)) + (1.0 / (sqrt(z) + sqrt((z + 1.0))));
tmp = 0.0;
if (x <= 2000000000.0)
tmp = (sqrt((x + 1.0)) - sqrt(x)) + t_1;
else
tmp = (0.5 * sqrt((1.0 / x))) + t_1;
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[z], $MachinePrecision] + N[Sqrt[N[(z + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, 2000000000.0], N[(N[(N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision], N[(N[(0.5 * N[Sqrt[N[(1.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \left(\sqrt{1 + y} - \sqrt{y}\right) + \frac{1}{\sqrt{z} + \sqrt{z + 1}}\\
\mathbf{if}\;x \leq 2000000000:\\
\;\;\;\;\left(\sqrt{x + 1} - \sqrt{x}\right) + t\_1\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \sqrt{\frac{1}{x}} + t\_1\\
\end{array}
\end{array}
if x < 2e9Initial program 97.6%
associate-+l+97.6%
associate-+l+97.6%
+-commutative97.6%
+-commutative97.6%
associate-+l-76.6%
+-commutative76.6%
+-commutative76.6%
Simplified76.6%
add-log-exp76.6%
associate--r-97.6%
+-commutative97.6%
Applied egg-rr97.6%
flip--97.6%
add-sqr-sqrt73.5%
add-sqr-sqrt97.9%
Applied egg-rr97.9%
associate--l+98.1%
+-inverses98.1%
metadata-eval98.1%
+-commutative98.1%
Simplified98.1%
Taylor expanded in t around inf 61.1%
if 2e9 < x Initial program 86.3%
associate-+l+86.3%
associate-+l+86.3%
+-commutative86.3%
+-commutative86.3%
associate-+l-66.7%
+-commutative66.7%
+-commutative66.7%
Simplified66.7%
add-log-exp66.7%
associate--r-86.3%
+-commutative86.3%
Applied egg-rr86.3%
flip--86.4%
add-sqr-sqrt75.7%
add-sqr-sqrt86.6%
Applied egg-rr86.6%
associate--l+86.7%
+-inverses86.7%
metadata-eval86.7%
+-commutative86.7%
Simplified86.7%
Taylor expanded in t around inf 45.2%
Taylor expanded in x around inf 47.9%
Final simplification54.8%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (+ (/ 1.0 (+ (sqrt x) (sqrt (+ x 1.0)))) (+ (- (sqrt (+ 1.0 y)) (sqrt y)) (/ 1.0 (+ (sqrt z) (sqrt (+ z 1.0)))))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
return (1.0 / (sqrt(x) + sqrt((x + 1.0)))) + ((sqrt((1.0 + y)) - sqrt(y)) + (1.0 / (sqrt(z) + sqrt((z + 1.0)))));
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (1.0d0 / (sqrt(x) + sqrt((x + 1.0d0)))) + ((sqrt((1.0d0 + y)) - sqrt(y)) + (1.0d0 / (sqrt(z) + sqrt((z + 1.0d0)))))
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
return (1.0 / (Math.sqrt(x) + Math.sqrt((x + 1.0)))) + ((Math.sqrt((1.0 + y)) - Math.sqrt(y)) + (1.0 / (Math.sqrt(z) + Math.sqrt((z + 1.0)))));
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): return (1.0 / (math.sqrt(x) + math.sqrt((x + 1.0)))) + ((math.sqrt((1.0 + y)) - math.sqrt(y)) + (1.0 / (math.sqrt(z) + math.sqrt((z + 1.0)))))
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(x + 1.0)))) + Float64(Float64(sqrt(Float64(1.0 + y)) - sqrt(y)) + Float64(1.0 / Float64(sqrt(z) + sqrt(Float64(z + 1.0)))))) end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp = code(x, y, z, t)
tmp = (1.0 / (sqrt(x) + sqrt((x + 1.0)))) + ((sqrt((1.0 + y)) - sqrt(y)) + (1.0 / (sqrt(z) + sqrt((z + 1.0)))));
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[(x + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[z], $MachinePrecision] + N[Sqrt[N[(z + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\frac{1}{\sqrt{x} + \sqrt{x + 1}} + \left(\left(\sqrt{1 + y} - \sqrt{y}\right) + \frac{1}{\sqrt{z} + \sqrt{z + 1}}\right)
\end{array}
Initial program 92.2%
associate-+l+92.2%
associate-+l+92.2%
+-commutative92.2%
+-commutative92.2%
associate-+l-71.9%
+-commutative71.9%
+-commutative71.9%
Simplified71.9%
add-log-exp71.9%
associate--r-92.2%
+-commutative92.2%
Applied egg-rr92.2%
flip--92.2%
add-sqr-sqrt74.6%
add-sqr-sqrt92.5%
Applied egg-rr92.5%
associate--l+92.6%
+-inverses92.6%
metadata-eval92.6%
+-commutative92.6%
Simplified92.6%
Taylor expanded in t around inf 53.5%
flip--72.4%
add-sqr-sqrt58.2%
+-commutative58.2%
add-sqr-sqrt72.7%
+-commutative72.7%
Applied egg-rr54.0%
associate--l+74.5%
+-inverses74.5%
metadata-eval74.5%
Simplified55.1%
Final simplification55.1%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1
(+
(- (sqrt (+ 1.0 y)) (sqrt y))
(/ 1.0 (+ (sqrt z) (sqrt (+ z 1.0)))))))
(if (<= x 1.0)
(+ t_1 (+ 1.0 (- (* x 0.5) (sqrt x))))
(+ (* 0.5 (sqrt (/ 1.0 x))) t_1))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = (sqrt((1.0 + y)) - sqrt(y)) + (1.0 / (sqrt(z) + sqrt((z + 1.0))));
double tmp;
if (x <= 1.0) {
tmp = t_1 + (1.0 + ((x * 0.5) - sqrt(x)));
} else {
tmp = (0.5 * sqrt((1.0 / x))) + t_1;
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = (sqrt((1.0d0 + y)) - sqrt(y)) + (1.0d0 / (sqrt(z) + sqrt((z + 1.0d0))))
if (x <= 1.0d0) then
tmp = t_1 + (1.0d0 + ((x * 0.5d0) - sqrt(x)))
else
tmp = (0.5d0 * sqrt((1.0d0 / x))) + t_1
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = (Math.sqrt((1.0 + y)) - Math.sqrt(y)) + (1.0 / (Math.sqrt(z) + Math.sqrt((z + 1.0))));
double tmp;
if (x <= 1.0) {
tmp = t_1 + (1.0 + ((x * 0.5) - Math.sqrt(x)));
} else {
tmp = (0.5 * Math.sqrt((1.0 / x))) + t_1;
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = (math.sqrt((1.0 + y)) - math.sqrt(y)) + (1.0 / (math.sqrt(z) + math.sqrt((z + 1.0)))) tmp = 0 if x <= 1.0: tmp = t_1 + (1.0 + ((x * 0.5) - math.sqrt(x))) else: tmp = (0.5 * math.sqrt((1.0 / x))) + t_1 return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = Float64(Float64(sqrt(Float64(1.0 + y)) - sqrt(y)) + Float64(1.0 / Float64(sqrt(z) + sqrt(Float64(z + 1.0))))) tmp = 0.0 if (x <= 1.0) tmp = Float64(t_1 + Float64(1.0 + Float64(Float64(x * 0.5) - sqrt(x)))); else tmp = Float64(Float64(0.5 * sqrt(Float64(1.0 / x))) + t_1); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = (sqrt((1.0 + y)) - sqrt(y)) + (1.0 / (sqrt(z) + sqrt((z + 1.0))));
tmp = 0.0;
if (x <= 1.0)
tmp = t_1 + (1.0 + ((x * 0.5) - sqrt(x)));
else
tmp = (0.5 * sqrt((1.0 / x))) + t_1;
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[z], $MachinePrecision] + N[Sqrt[N[(z + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, 1.0], N[(t$95$1 + N[(1.0 + N[(N[(x * 0.5), $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(0.5 * N[Sqrt[N[(1.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \left(\sqrt{1 + y} - \sqrt{y}\right) + \frac{1}{\sqrt{z} + \sqrt{z + 1}}\\
\mathbf{if}\;x \leq 1:\\
\;\;\;\;t\_1 + \left(1 + \left(x \cdot 0.5 - \sqrt{x}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \sqrt{\frac{1}{x}} + t\_1\\
\end{array}
\end{array}
if x < 1Initial program 98.6%
associate-+l+98.6%
associate-+l+98.6%
+-commutative98.6%
+-commutative98.6%
associate-+l-78.0%
+-commutative78.0%
+-commutative78.0%
Simplified78.0%
add-log-exp78.0%
associate--r-98.5%
+-commutative98.5%
Applied egg-rr98.5%
flip--98.5%
add-sqr-sqrt73.6%
add-sqr-sqrt98.9%
Applied egg-rr98.9%
associate--l+99.0%
+-inverses99.0%
metadata-eval99.0%
+-commutative99.0%
Simplified99.0%
Taylor expanded in t around inf 60.9%
Taylor expanded in x around 0 60.6%
associate--l+60.6%
Simplified60.6%
if 1 < x Initial program 86.1%
associate-+l+86.1%
associate-+l+86.1%
+-commutative86.1%
+-commutative86.1%
associate-+l-66.0%
+-commutative66.0%
+-commutative66.0%
Simplified66.0%
add-log-exp66.0%
associate--r-86.1%
+-commutative86.1%
Applied egg-rr86.1%
flip--86.2%
add-sqr-sqrt75.5%
add-sqr-sqrt86.4%
Applied egg-rr86.4%
associate--l+86.5%
+-inverses86.5%
metadata-eval86.5%
+-commutative86.5%
Simplified86.5%
Taylor expanded in t around inf 46.4%
Taylor expanded in x around inf 48.8%
Final simplification54.6%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1
(+
(- (sqrt (+ 1.0 y)) (sqrt y))
(/ 1.0 (+ (sqrt z) (sqrt (+ z 1.0)))))))
(if (<= x 0.38) (+ t_1 (- 1.0 (sqrt x))) (+ (* 0.5 (sqrt (/ 1.0 x))) t_1))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = (sqrt((1.0 + y)) - sqrt(y)) + (1.0 / (sqrt(z) + sqrt((z + 1.0))));
double tmp;
if (x <= 0.38) {
tmp = t_1 + (1.0 - sqrt(x));
} else {
tmp = (0.5 * sqrt((1.0 / x))) + t_1;
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = (sqrt((1.0d0 + y)) - sqrt(y)) + (1.0d0 / (sqrt(z) + sqrt((z + 1.0d0))))
if (x <= 0.38d0) then
tmp = t_1 + (1.0d0 - sqrt(x))
else
tmp = (0.5d0 * sqrt((1.0d0 / x))) + t_1
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = (Math.sqrt((1.0 + y)) - Math.sqrt(y)) + (1.0 / (Math.sqrt(z) + Math.sqrt((z + 1.0))));
double tmp;
if (x <= 0.38) {
tmp = t_1 + (1.0 - Math.sqrt(x));
} else {
tmp = (0.5 * Math.sqrt((1.0 / x))) + t_1;
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = (math.sqrt((1.0 + y)) - math.sqrt(y)) + (1.0 / (math.sqrt(z) + math.sqrt((z + 1.0)))) tmp = 0 if x <= 0.38: tmp = t_1 + (1.0 - math.sqrt(x)) else: tmp = (0.5 * math.sqrt((1.0 / x))) + t_1 return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = Float64(Float64(sqrt(Float64(1.0 + y)) - sqrt(y)) + Float64(1.0 / Float64(sqrt(z) + sqrt(Float64(z + 1.0))))) tmp = 0.0 if (x <= 0.38) tmp = Float64(t_1 + Float64(1.0 - sqrt(x))); else tmp = Float64(Float64(0.5 * sqrt(Float64(1.0 / x))) + t_1); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = (sqrt((1.0 + y)) - sqrt(y)) + (1.0 / (sqrt(z) + sqrt((z + 1.0))));
tmp = 0.0;
if (x <= 0.38)
tmp = t_1 + (1.0 - sqrt(x));
else
tmp = (0.5 * sqrt((1.0 / x))) + t_1;
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[z], $MachinePrecision] + N[Sqrt[N[(z + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, 0.38], N[(t$95$1 + N[(1.0 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(0.5 * N[Sqrt[N[(1.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \left(\sqrt{1 + y} - \sqrt{y}\right) + \frac{1}{\sqrt{z} + \sqrt{z + 1}}\\
\mathbf{if}\;x \leq 0.38:\\
\;\;\;\;t\_1 + \left(1 - \sqrt{x}\right)\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \sqrt{\frac{1}{x}} + t\_1\\
\end{array}
\end{array}
if x < 0.38Initial program 98.6%
associate-+l+98.6%
associate-+l+98.6%
+-commutative98.6%
+-commutative98.6%
associate-+l-78.0%
+-commutative78.0%
+-commutative78.0%
Simplified78.0%
add-log-exp78.0%
associate--r-98.5%
+-commutative98.5%
Applied egg-rr98.5%
flip--98.5%
add-sqr-sqrt73.6%
add-sqr-sqrt98.9%
Applied egg-rr98.9%
associate--l+99.0%
+-inverses99.0%
metadata-eval99.0%
+-commutative99.0%
Simplified99.0%
Taylor expanded in t around inf 60.9%
Taylor expanded in x around 0 59.8%
if 0.38 < x Initial program 86.1%
associate-+l+86.1%
associate-+l+86.1%
+-commutative86.1%
+-commutative86.1%
associate-+l-66.0%
+-commutative66.0%
+-commutative66.0%
Simplified66.0%
add-log-exp66.0%
associate--r-86.1%
+-commutative86.1%
Applied egg-rr86.1%
flip--86.2%
add-sqr-sqrt75.5%
add-sqr-sqrt86.4%
Applied egg-rr86.4%
associate--l+86.5%
+-inverses86.5%
metadata-eval86.5%
+-commutative86.5%
Simplified86.5%
Taylor expanded in t around inf 46.4%
Taylor expanded in x around inf 48.8%
Final simplification54.2%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (sqrt (+ 1.0 y)) (sqrt y))))
(if (<= x 0.45)
(+ (+ t_1 (/ 1.0 (+ (sqrt z) (sqrt (+ z 1.0))))) (- 1.0 (sqrt x)))
(+ (* 0.5 (sqrt (/ 1.0 x))) (+ t_1 (- (sqrt (+ 1.0 t)) (sqrt t)))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + y)) - sqrt(y);
double tmp;
if (x <= 0.45) {
tmp = (t_1 + (1.0 / (sqrt(z) + sqrt((z + 1.0))))) + (1.0 - sqrt(x));
} else {
tmp = (0.5 * sqrt((1.0 / x))) + (t_1 + (sqrt((1.0 + t)) - sqrt(t)));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = sqrt((1.0d0 + y)) - sqrt(y)
if (x <= 0.45d0) then
tmp = (t_1 + (1.0d0 / (sqrt(z) + sqrt((z + 1.0d0))))) + (1.0d0 - sqrt(x))
else
tmp = (0.5d0 * sqrt((1.0d0 / x))) + (t_1 + (sqrt((1.0d0 + t)) - sqrt(t)))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + y)) - Math.sqrt(y);
double tmp;
if (x <= 0.45) {
tmp = (t_1 + (1.0 / (Math.sqrt(z) + Math.sqrt((z + 1.0))))) + (1.0 - Math.sqrt(x));
} else {
tmp = (0.5 * Math.sqrt((1.0 / x))) + (t_1 + (Math.sqrt((1.0 + t)) - Math.sqrt(t)));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + y)) - math.sqrt(y) tmp = 0 if x <= 0.45: tmp = (t_1 + (1.0 / (math.sqrt(z) + math.sqrt((z + 1.0))))) + (1.0 - math.sqrt(x)) else: tmp = (0.5 * math.sqrt((1.0 / x))) + (t_1 + (math.sqrt((1.0 + t)) - math.sqrt(t))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = Float64(sqrt(Float64(1.0 + y)) - sqrt(y)) tmp = 0.0 if (x <= 0.45) tmp = Float64(Float64(t_1 + Float64(1.0 / Float64(sqrt(z) + sqrt(Float64(z + 1.0))))) + Float64(1.0 - sqrt(x))); else tmp = Float64(Float64(0.5 * sqrt(Float64(1.0 / x))) + Float64(t_1 + Float64(sqrt(Float64(1.0 + t)) - sqrt(t)))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + y)) - sqrt(y);
tmp = 0.0;
if (x <= 0.45)
tmp = (t_1 + (1.0 / (sqrt(z) + sqrt((z + 1.0))))) + (1.0 - sqrt(x));
else
tmp = (0.5 * sqrt((1.0 / x))) + (t_1 + (sqrt((1.0 + t)) - sqrt(t)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, 0.45], N[(N[(t$95$1 + N[(1.0 / N[(N[Sqrt[z], $MachinePrecision] + N[Sqrt[N[(z + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(0.5 * N[Sqrt[N[(1.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(t$95$1 + N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + y} - \sqrt{y}\\
\mathbf{if}\;x \leq 0.45:\\
\;\;\;\;\left(t\_1 + \frac{1}{\sqrt{z} + \sqrt{z + 1}}\right) + \left(1 - \sqrt{x}\right)\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \sqrt{\frac{1}{x}} + \left(t\_1 + \left(\sqrt{1 + t} - \sqrt{t}\right)\right)\\
\end{array}
\end{array}
if x < 0.450000000000000011Initial program 98.6%
associate-+l+98.6%
associate-+l+98.6%
+-commutative98.6%
+-commutative98.6%
associate-+l-78.0%
+-commutative78.0%
+-commutative78.0%
Simplified78.0%
add-log-exp78.0%
associate--r-98.5%
+-commutative98.5%
Applied egg-rr98.5%
flip--98.5%
add-sqr-sqrt73.6%
add-sqr-sqrt98.9%
Applied egg-rr98.9%
associate--l+99.0%
+-inverses99.0%
metadata-eval99.0%
+-commutative99.0%
Simplified99.0%
Taylor expanded in t around inf 60.9%
Taylor expanded in x around 0 59.8%
if 0.450000000000000011 < x Initial program 86.1%
associate-+l+86.1%
associate-+l+86.1%
+-commutative86.1%
+-commutative86.1%
associate-+l-66.0%
+-commutative66.0%
+-commutative66.0%
Simplified66.0%
Taylor expanded in x around inf 69.3%
Taylor expanded in z around inf 44.6%
+-commutative44.6%
Simplified44.6%
Final simplification52.0%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ 1.0 y))))
(if (<= z 5.8e+17)
(+ 1.0 (+ t_1 (- (sqrt (+ z 1.0)) (+ (sqrt z) (+ (sqrt x) (sqrt y))))))
(+ (sqrt (+ x 1.0)) (/ 1.0 (+ t_1 (sqrt y)))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + y));
double tmp;
if (z <= 5.8e+17) {
tmp = 1.0 + (t_1 + (sqrt((z + 1.0)) - (sqrt(z) + (sqrt(x) + sqrt(y)))));
} else {
tmp = sqrt((x + 1.0)) + (1.0 / (t_1 + sqrt(y)));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = sqrt((1.0d0 + y))
if (z <= 5.8d+17) then
tmp = 1.0d0 + (t_1 + (sqrt((z + 1.0d0)) - (sqrt(z) + (sqrt(x) + sqrt(y)))))
else
tmp = sqrt((x + 1.0d0)) + (1.0d0 / (t_1 + sqrt(y)))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + y));
double tmp;
if (z <= 5.8e+17) {
tmp = 1.0 + (t_1 + (Math.sqrt((z + 1.0)) - (Math.sqrt(z) + (Math.sqrt(x) + Math.sqrt(y)))));
} else {
tmp = Math.sqrt((x + 1.0)) + (1.0 / (t_1 + Math.sqrt(y)));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + y)) tmp = 0 if z <= 5.8e+17: tmp = 1.0 + (t_1 + (math.sqrt((z + 1.0)) - (math.sqrt(z) + (math.sqrt(x) + math.sqrt(y))))) else: tmp = math.sqrt((x + 1.0)) + (1.0 / (t_1 + math.sqrt(y))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(1.0 + y)) tmp = 0.0 if (z <= 5.8e+17) tmp = Float64(1.0 + Float64(t_1 + Float64(sqrt(Float64(z + 1.0)) - Float64(sqrt(z) + Float64(sqrt(x) + sqrt(y)))))); else tmp = Float64(sqrt(Float64(x + 1.0)) + Float64(1.0 / Float64(t_1 + sqrt(y)))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + y));
tmp = 0.0;
if (z <= 5.8e+17)
tmp = 1.0 + (t_1 + (sqrt((z + 1.0)) - (sqrt(z) + (sqrt(x) + sqrt(y)))));
else
tmp = sqrt((x + 1.0)) + (1.0 / (t_1 + sqrt(y)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[z, 5.8e+17], N[(1.0 + N[(t$95$1 + N[(N[Sqrt[N[(z + 1.0), $MachinePrecision]], $MachinePrecision] - N[(N[Sqrt[z], $MachinePrecision] + N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision] + N[(1.0 / N[(t$95$1 + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + y}\\
\mathbf{if}\;z \leq 5.8 \cdot 10^{+17}:\\
\;\;\;\;1 + \left(t\_1 + \left(\sqrt{z + 1} - \left(\sqrt{z} + \left(\sqrt{x} + \sqrt{y}\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\sqrt{x + 1} + \frac{1}{t\_1 + \sqrt{y}}\\
\end{array}
\end{array}
if z < 5.8e17Initial program 96.3%
+-commutative96.3%
associate-+r+96.3%
associate-+r-77.1%
associate-+l-68.8%
associate-+r-51.6%
Simplified51.6%
Taylor expanded in t around inf 18.7%
associate--l+22.8%
associate--l+22.8%
associate-+r+22.8%
Simplified22.8%
Taylor expanded in x around 0 16.4%
associate--l+23.1%
associate-+r+23.1%
+-commutative23.1%
associate--l+23.1%
Simplified23.1%
if 5.8e17 < z Initial program 86.9%
+-commutative86.9%
associate-+r+86.9%
associate-+r-62.4%
associate-+l-53.7%
associate-+r-53.7%
Simplified35.0%
Taylor expanded in t around inf 3.2%
associate--l+26.1%
associate--l+24.9%
associate-+r+24.9%
Simplified24.9%
Taylor expanded in y around inf 33.9%
neg-mul-133.9%
Simplified33.9%
flip-+33.9%
add-sqr-sqrt24.6%
pow224.6%
Applied egg-rr24.6%
associate--l+24.6%
unpow224.6%
sqr-neg24.6%
rem-square-sqrt33.9%
+-inverses33.9%
metadata-eval33.9%
sub-neg33.9%
remove-double-neg33.9%
Simplified33.9%
Final simplification27.8%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (/ 1.0 z))))
(if (<= y 3.1e-21)
(+ 2.0 (- (sqrt (+ z 1.0)) (+ (sqrt y) (+ (sqrt x) (sqrt z)))))
(if (<= y 95000000.0)
(+ 1.0 (- (+ (sqrt (+ 1.0 y)) (* 0.5 (+ x t_1))) (+ (sqrt x) (sqrt y))))
(+ (sqrt (+ x 1.0)) (- (* 0.5 (+ (sqrt (/ 1.0 y)) t_1)) (sqrt x)))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 / z));
double tmp;
if (y <= 3.1e-21) {
tmp = 2.0 + (sqrt((z + 1.0)) - (sqrt(y) + (sqrt(x) + sqrt(z))));
} else if (y <= 95000000.0) {
tmp = 1.0 + ((sqrt((1.0 + y)) + (0.5 * (x + t_1))) - (sqrt(x) + sqrt(y)));
} else {
tmp = sqrt((x + 1.0)) + ((0.5 * (sqrt((1.0 / y)) + t_1)) - sqrt(x));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = sqrt((1.0d0 / z))
if (y <= 3.1d-21) then
tmp = 2.0d0 + (sqrt((z + 1.0d0)) - (sqrt(y) + (sqrt(x) + sqrt(z))))
else if (y <= 95000000.0d0) then
tmp = 1.0d0 + ((sqrt((1.0d0 + y)) + (0.5d0 * (x + t_1))) - (sqrt(x) + sqrt(y)))
else
tmp = sqrt((x + 1.0d0)) + ((0.5d0 * (sqrt((1.0d0 / y)) + t_1)) - sqrt(x))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 / z));
double tmp;
if (y <= 3.1e-21) {
tmp = 2.0 + (Math.sqrt((z + 1.0)) - (Math.sqrt(y) + (Math.sqrt(x) + Math.sqrt(z))));
} else if (y <= 95000000.0) {
tmp = 1.0 + ((Math.sqrt((1.0 + y)) + (0.5 * (x + t_1))) - (Math.sqrt(x) + Math.sqrt(y)));
} else {
tmp = Math.sqrt((x + 1.0)) + ((0.5 * (Math.sqrt((1.0 / y)) + t_1)) - Math.sqrt(x));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 / z)) tmp = 0 if y <= 3.1e-21: tmp = 2.0 + (math.sqrt((z + 1.0)) - (math.sqrt(y) + (math.sqrt(x) + math.sqrt(z)))) elif y <= 95000000.0: tmp = 1.0 + ((math.sqrt((1.0 + y)) + (0.5 * (x + t_1))) - (math.sqrt(x) + math.sqrt(y))) else: tmp = math.sqrt((x + 1.0)) + ((0.5 * (math.sqrt((1.0 / y)) + t_1)) - math.sqrt(x)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(1.0 / z)) tmp = 0.0 if (y <= 3.1e-21) tmp = Float64(2.0 + Float64(sqrt(Float64(z + 1.0)) - Float64(sqrt(y) + Float64(sqrt(x) + sqrt(z))))); elseif (y <= 95000000.0) tmp = Float64(1.0 + Float64(Float64(sqrt(Float64(1.0 + y)) + Float64(0.5 * Float64(x + t_1))) - Float64(sqrt(x) + sqrt(y)))); else tmp = Float64(sqrt(Float64(x + 1.0)) + Float64(Float64(0.5 * Float64(sqrt(Float64(1.0 / y)) + t_1)) - sqrt(x))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 / z));
tmp = 0.0;
if (y <= 3.1e-21)
tmp = 2.0 + (sqrt((z + 1.0)) - (sqrt(y) + (sqrt(x) + sqrt(z))));
elseif (y <= 95000000.0)
tmp = 1.0 + ((sqrt((1.0 + y)) + (0.5 * (x + t_1))) - (sqrt(x) + sqrt(y)));
else
tmp = sqrt((x + 1.0)) + ((0.5 * (sqrt((1.0 / y)) + t_1)) - sqrt(x));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(1.0 / z), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y, 3.1e-21], N[(2.0 + N[(N[Sqrt[N[(z + 1.0), $MachinePrecision]], $MachinePrecision] - N[(N[Sqrt[y], $MachinePrecision] + N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 95000000.0], N[(1.0 + N[(N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] + N[(0.5 * N[(x + t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision] + N[(N[(0.5 * N[(N[Sqrt[N[(1.0 / y), $MachinePrecision]], $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{\frac{1}{z}}\\
\mathbf{if}\;y \leq 3.1 \cdot 10^{-21}:\\
\;\;\;\;2 + \left(\sqrt{z + 1} - \left(\sqrt{y} + \left(\sqrt{x} + \sqrt{z}\right)\right)\right)\\
\mathbf{elif}\;y \leq 95000000:\\
\;\;\;\;1 + \left(\left(\sqrt{1 + y} + 0.5 \cdot \left(x + t\_1\right)\right) - \left(\sqrt{x} + \sqrt{y}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\sqrt{x + 1} + \left(0.5 \cdot \left(\sqrt{\frac{1}{y}} + t\_1\right) - \sqrt{x}\right)\\
\end{array}
\end{array}
if y < 3.0999999999999998e-21Initial program 98.6%
+-commutative98.6%
associate-+r+98.6%
associate-+r-98.6%
associate-+l-98.6%
associate-+r-98.6%
Simplified80.0%
Taylor expanded in t around inf 20.8%
associate--l+24.8%
associate--l+32.0%
associate-+r+32.0%
Simplified32.0%
Taylor expanded in x around 0 18.2%
Taylor expanded in y around 0 18.2%
associate--l+33.7%
associate-+r+33.7%
+-commutative33.7%
associate-+l+33.7%
+-commutative33.7%
Simplified33.7%
if 3.0999999999999998e-21 < y < 9.5e7Initial program 94.2%
+-commutative94.2%
associate-+r+94.2%
associate-+r-94.2%
associate-+l-94.2%
associate-+r-94.1%
Simplified94.1%
Taylor expanded in t around inf 14.1%
associate--l+14.6%
associate--l+14.6%
associate-+r+14.6%
Simplified14.6%
Taylor expanded in z around inf 4.5%
Taylor expanded in x around 0 5.1%
associate--l+5.1%
distribute-lft-out5.1%
Simplified5.1%
if 9.5e7 < y Initial program 86.4%
+-commutative86.4%
associate-+r+86.4%
associate-+r-44.1%
associate-+l-27.5%
associate-+r-8.4%
Simplified8.1%
Taylor expanded in t around inf 4.0%
associate--l+24.8%
associate--l+17.7%
associate-+r+17.7%
Simplified17.7%
Taylor expanded in z around inf 4.2%
Taylor expanded in y around inf 22.0%
associate--l+22.0%
distribute-lft-out22.0%
Simplified22.0%
Final simplification26.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))))
(if (<= y 3.25e-21)
(+ 2.0 (- (sqrt (+ z 1.0)) (+ (sqrt y) (+ (sqrt x) (sqrt z)))))
(if (<= y 36000000.0)
(- (+ 1.0 (+ (sqrt (+ 1.0 y)) (* 0.5 t_1))) (+ (sqrt x) (sqrt y)))
(+ (sqrt (+ x 1.0)) (- (* 0.5 (+ (sqrt (/ 1.0 y)) t_1)) (sqrt x)))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 / z));
double tmp;
if (y <= 3.25e-21) {
tmp = 2.0 + (sqrt((z + 1.0)) - (sqrt(y) + (sqrt(x) + sqrt(z))));
} else if (y <= 36000000.0) {
tmp = (1.0 + (sqrt((1.0 + y)) + (0.5 * t_1))) - (sqrt(x) + sqrt(y));
} else {
tmp = sqrt((x + 1.0)) + ((0.5 * (sqrt((1.0 / y)) + t_1)) - sqrt(x));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = sqrt((1.0d0 / z))
if (y <= 3.25d-21) then
tmp = 2.0d0 + (sqrt((z + 1.0d0)) - (sqrt(y) + (sqrt(x) + sqrt(z))))
else if (y <= 36000000.0d0) then
tmp = (1.0d0 + (sqrt((1.0d0 + y)) + (0.5d0 * t_1))) - (sqrt(x) + sqrt(y))
else
tmp = sqrt((x + 1.0d0)) + ((0.5d0 * (sqrt((1.0d0 / y)) + t_1)) - sqrt(x))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 / z));
double tmp;
if (y <= 3.25e-21) {
tmp = 2.0 + (Math.sqrt((z + 1.0)) - (Math.sqrt(y) + (Math.sqrt(x) + Math.sqrt(z))));
} else if (y <= 36000000.0) {
tmp = (1.0 + (Math.sqrt((1.0 + y)) + (0.5 * t_1))) - (Math.sqrt(x) + Math.sqrt(y));
} else {
tmp = Math.sqrt((x + 1.0)) + ((0.5 * (Math.sqrt((1.0 / y)) + t_1)) - Math.sqrt(x));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 / z)) tmp = 0 if y <= 3.25e-21: tmp = 2.0 + (math.sqrt((z + 1.0)) - (math.sqrt(y) + (math.sqrt(x) + math.sqrt(z)))) elif y <= 36000000.0: tmp = (1.0 + (math.sqrt((1.0 + y)) + (0.5 * t_1))) - (math.sqrt(x) + math.sqrt(y)) else: tmp = math.sqrt((x + 1.0)) + ((0.5 * (math.sqrt((1.0 / y)) + t_1)) - math.sqrt(x)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(1.0 / z)) tmp = 0.0 if (y <= 3.25e-21) tmp = Float64(2.0 + Float64(sqrt(Float64(z + 1.0)) - Float64(sqrt(y) + Float64(sqrt(x) + sqrt(z))))); elseif (y <= 36000000.0) tmp = Float64(Float64(1.0 + Float64(sqrt(Float64(1.0 + y)) + Float64(0.5 * t_1))) - Float64(sqrt(x) + sqrt(y))); else tmp = Float64(sqrt(Float64(x + 1.0)) + Float64(Float64(0.5 * Float64(sqrt(Float64(1.0 / y)) + t_1)) - sqrt(x))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 / z));
tmp = 0.0;
if (y <= 3.25e-21)
tmp = 2.0 + (sqrt((z + 1.0)) - (sqrt(y) + (sqrt(x) + sqrt(z))));
elseif (y <= 36000000.0)
tmp = (1.0 + (sqrt((1.0 + y)) + (0.5 * t_1))) - (sqrt(x) + sqrt(y));
else
tmp = sqrt((x + 1.0)) + ((0.5 * (sqrt((1.0 / y)) + t_1)) - sqrt(x));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(1.0 / z), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y, 3.25e-21], N[(2.0 + N[(N[Sqrt[N[(z + 1.0), $MachinePrecision]], $MachinePrecision] - N[(N[Sqrt[y], $MachinePrecision] + N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 36000000.0], N[(N[(1.0 + N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] + N[(0.5 * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision] + N[(N[(0.5 * N[(N[Sqrt[N[(1.0 / y), $MachinePrecision]], $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{\frac{1}{z}}\\
\mathbf{if}\;y \leq 3.25 \cdot 10^{-21}:\\
\;\;\;\;2 + \left(\sqrt{z + 1} - \left(\sqrt{y} + \left(\sqrt{x} + \sqrt{z}\right)\right)\right)\\
\mathbf{elif}\;y \leq 36000000:\\
\;\;\;\;\left(1 + \left(\sqrt{1 + y} + 0.5 \cdot t\_1\right)\right) - \left(\sqrt{x} + \sqrt{y}\right)\\
\mathbf{else}:\\
\;\;\;\;\sqrt{x + 1} + \left(0.5 \cdot \left(\sqrt{\frac{1}{y}} + t\_1\right) - \sqrt{x}\right)\\
\end{array}
\end{array}
if y < 3.24999999999999993e-21Initial program 98.6%
+-commutative98.6%
associate-+r+98.6%
associate-+r-98.6%
associate-+l-98.6%
associate-+r-98.6%
Simplified80.0%
Taylor expanded in t around inf 20.8%
associate--l+24.8%
associate--l+32.0%
associate-+r+32.0%
Simplified32.0%
Taylor expanded in x around 0 18.2%
Taylor expanded in y around 0 18.2%
associate--l+33.7%
associate-+r+33.7%
+-commutative33.7%
associate-+l+33.7%
+-commutative33.7%
Simplified33.7%
if 3.24999999999999993e-21 < y < 3.6e7Initial program 94.2%
+-commutative94.2%
associate-+r+94.2%
associate-+r-94.2%
associate-+l-94.2%
associate-+r-94.1%
Simplified94.1%
Taylor expanded in t around inf 14.1%
associate--l+14.6%
associate--l+14.6%
associate-+r+14.6%
Simplified14.6%
Taylor expanded in z around inf 4.5%
Taylor expanded in x around 0 3.2%
if 3.6e7 < y Initial program 86.4%
+-commutative86.4%
associate-+r+86.4%
associate-+r-44.1%
associate-+l-27.5%
associate-+r-8.4%
Simplified8.1%
Taylor expanded in t around inf 4.0%
associate--l+24.8%
associate--l+17.7%
associate-+r+17.7%
Simplified17.7%
Taylor expanded in z around inf 4.2%
Taylor expanded in y around inf 22.0%
associate--l+22.0%
distribute-lft-out22.0%
Simplified22.0%
Final simplification26.0%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ x 1.0))))
(if (<= y 3.25e-21)
(+ 2.0 (- (sqrt (+ z 1.0)) (+ (sqrt y) (+ (sqrt x) (sqrt z)))))
(if (<= y 105000000.0)
(- (+ (sqrt (+ 1.0 y)) t_1) (+ (sqrt x) (sqrt y)))
(+ t_1 (- (* 0.5 (+ (sqrt (/ 1.0 y)) (sqrt (/ 1.0 z)))) (sqrt x)))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((x + 1.0));
double tmp;
if (y <= 3.25e-21) {
tmp = 2.0 + (sqrt((z + 1.0)) - (sqrt(y) + (sqrt(x) + sqrt(z))));
} else if (y <= 105000000.0) {
tmp = (sqrt((1.0 + y)) + t_1) - (sqrt(x) + sqrt(y));
} else {
tmp = t_1 + ((0.5 * (sqrt((1.0 / y)) + sqrt((1.0 / z)))) - sqrt(x));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = sqrt((x + 1.0d0))
if (y <= 3.25d-21) then
tmp = 2.0d0 + (sqrt((z + 1.0d0)) - (sqrt(y) + (sqrt(x) + sqrt(z))))
else if (y <= 105000000.0d0) then
tmp = (sqrt((1.0d0 + y)) + t_1) - (sqrt(x) + sqrt(y))
else
tmp = t_1 + ((0.5d0 * (sqrt((1.0d0 / y)) + sqrt((1.0d0 / z)))) - sqrt(x))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((x + 1.0));
double tmp;
if (y <= 3.25e-21) {
tmp = 2.0 + (Math.sqrt((z + 1.0)) - (Math.sqrt(y) + (Math.sqrt(x) + Math.sqrt(z))));
} else if (y <= 105000000.0) {
tmp = (Math.sqrt((1.0 + y)) + t_1) - (Math.sqrt(x) + Math.sqrt(y));
} else {
tmp = t_1 + ((0.5 * (Math.sqrt((1.0 / y)) + Math.sqrt((1.0 / z)))) - Math.sqrt(x));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((x + 1.0)) tmp = 0 if y <= 3.25e-21: tmp = 2.0 + (math.sqrt((z + 1.0)) - (math.sqrt(y) + (math.sqrt(x) + math.sqrt(z)))) elif y <= 105000000.0: tmp = (math.sqrt((1.0 + y)) + t_1) - (math.sqrt(x) + math.sqrt(y)) else: tmp = t_1 + ((0.5 * (math.sqrt((1.0 / y)) + math.sqrt((1.0 / z)))) - math.sqrt(x)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(x + 1.0)) tmp = 0.0 if (y <= 3.25e-21) tmp = Float64(2.0 + Float64(sqrt(Float64(z + 1.0)) - Float64(sqrt(y) + Float64(sqrt(x) + sqrt(z))))); elseif (y <= 105000000.0) tmp = Float64(Float64(sqrt(Float64(1.0 + y)) + t_1) - Float64(sqrt(x) + sqrt(y))); else tmp = Float64(t_1 + Float64(Float64(0.5 * Float64(sqrt(Float64(1.0 / y)) + sqrt(Float64(1.0 / z)))) - sqrt(x))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((x + 1.0));
tmp = 0.0;
if (y <= 3.25e-21)
tmp = 2.0 + (sqrt((z + 1.0)) - (sqrt(y) + (sqrt(x) + sqrt(z))));
elseif (y <= 105000000.0)
tmp = (sqrt((1.0 + y)) + t_1) - (sqrt(x) + sqrt(y));
else
tmp = t_1 + ((0.5 * (sqrt((1.0 / y)) + sqrt((1.0 / z)))) - sqrt(x));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y, 3.25e-21], N[(2.0 + N[(N[Sqrt[N[(z + 1.0), $MachinePrecision]], $MachinePrecision] - N[(N[Sqrt[y], $MachinePrecision] + N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 105000000.0], N[(N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] + t$95$1), $MachinePrecision] - N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 + N[(N[(0.5 * N[(N[Sqrt[N[(1.0 / y), $MachinePrecision]], $MachinePrecision] + N[Sqrt[N[(1.0 / z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{x + 1}\\
\mathbf{if}\;y \leq 3.25 \cdot 10^{-21}:\\
\;\;\;\;2 + \left(\sqrt{z + 1} - \left(\sqrt{y} + \left(\sqrt{x} + \sqrt{z}\right)\right)\right)\\
\mathbf{elif}\;y \leq 105000000:\\
\;\;\;\;\left(\sqrt{1 + y} + t\_1\right) - \left(\sqrt{x} + \sqrt{y}\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1 + \left(0.5 \cdot \left(\sqrt{\frac{1}{y}} + \sqrt{\frac{1}{z}}\right) - \sqrt{x}\right)\\
\end{array}
\end{array}
if y < 3.24999999999999993e-21Initial program 98.6%
+-commutative98.6%
associate-+r+98.6%
associate-+r-98.6%
associate-+l-98.6%
associate-+r-98.6%
Simplified80.0%
Taylor expanded in t around inf 20.8%
associate--l+24.8%
associate--l+32.0%
associate-+r+32.0%
Simplified32.0%
Taylor expanded in x around 0 18.2%
Taylor expanded in y around 0 18.2%
associate--l+33.7%
associate-+r+33.7%
+-commutative33.7%
associate-+l+33.7%
+-commutative33.7%
Simplified33.7%
if 3.24999999999999993e-21 < y < 1.05e8Initial program 94.2%
+-commutative94.2%
associate-+r+94.2%
associate-+r-94.2%
associate-+l-94.2%
associate-+r-94.1%
Simplified94.1%
Taylor expanded in t around inf 14.1%
associate--l+14.6%
associate--l+14.6%
associate-+r+14.6%
Simplified14.6%
Taylor expanded in z around inf 7.9%
if 1.05e8 < y Initial program 86.4%
+-commutative86.4%
associate-+r+86.4%
associate-+r-44.1%
associate-+l-27.5%
associate-+r-8.4%
Simplified8.1%
Taylor expanded in t around inf 4.0%
associate--l+24.8%
associate--l+17.7%
associate-+r+17.7%
Simplified17.7%
Taylor expanded in z around inf 4.2%
Taylor expanded in y around inf 22.0%
associate--l+22.0%
distribute-lft-out22.0%
Simplified22.0%
Final simplification26.2%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(if (<= z 58000000000000.0)
(+
2.0
(+ (- (sqrt (+ z 1.0)) (+ (sqrt y) (+ (sqrt x) (sqrt z)))) (* y 0.5)))
(+ (sqrt (+ x 1.0)) (/ 1.0 (+ (sqrt (+ 1.0 y)) (sqrt y))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (z <= 58000000000000.0) {
tmp = 2.0 + ((sqrt((z + 1.0)) - (sqrt(y) + (sqrt(x) + sqrt(z)))) + (y * 0.5));
} else {
tmp = sqrt((x + 1.0)) + (1.0 / (sqrt((1.0 + y)) + sqrt(y)));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (z <= 58000000000000.0d0) then
tmp = 2.0d0 + ((sqrt((z + 1.0d0)) - (sqrt(y) + (sqrt(x) + sqrt(z)))) + (y * 0.5d0))
else
tmp = sqrt((x + 1.0d0)) + (1.0d0 / (sqrt((1.0d0 + y)) + sqrt(y)))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= 58000000000000.0) {
tmp = 2.0 + ((Math.sqrt((z + 1.0)) - (Math.sqrt(y) + (Math.sqrt(x) + Math.sqrt(z)))) + (y * 0.5));
} else {
tmp = Math.sqrt((x + 1.0)) + (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 <= 58000000000000.0: tmp = 2.0 + ((math.sqrt((z + 1.0)) - (math.sqrt(y) + (math.sqrt(x) + math.sqrt(z)))) + (y * 0.5)) else: tmp = math.sqrt((x + 1.0)) + (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 <= 58000000000000.0) tmp = Float64(2.0 + Float64(Float64(sqrt(Float64(z + 1.0)) - Float64(sqrt(y) + Float64(sqrt(x) + sqrt(z)))) + Float64(y * 0.5))); else tmp = Float64(sqrt(Float64(x + 1.0)) + 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 <= 58000000000000.0)
tmp = 2.0 + ((sqrt((z + 1.0)) - (sqrt(y) + (sqrt(x) + sqrt(z)))) + (y * 0.5));
else
tmp = sqrt((x + 1.0)) + (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, 58000000000000.0], N[(2.0 + N[(N[(N[Sqrt[N[(z + 1.0), $MachinePrecision]], $MachinePrecision] - N[(N[Sqrt[y], $MachinePrecision] + N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(y * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision] + N[(1.0 / N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq 58000000000000:\\
\;\;\;\;2 + \left(\left(\sqrt{z + 1} - \left(\sqrt{y} + \left(\sqrt{x} + \sqrt{z}\right)\right)\right) + y \cdot 0.5\right)\\
\mathbf{else}:\\
\;\;\;\;\sqrt{x + 1} + \frac{1}{\sqrt{1 + y} + \sqrt{y}}\\
\end{array}
\end{array}
if z < 5.8e13Initial program 96.5%
+-commutative96.5%
associate-+r+96.5%
associate-+r-77.6%
associate-+l-69.3%
associate-+r-51.9%
Simplified51.9%
Taylor expanded in t around inf 18.8%
associate--l+22.7%
associate--l+22.7%
associate-+r+22.7%
Simplified22.7%
Taylor expanded in x around 0 16.4%
Taylor expanded in y around 0 16.1%
associate--l+16.0%
+-commutative16.0%
+-commutative16.0%
associate--l+16.0%
+-commutative16.0%
associate-+r+16.0%
+-commutative16.0%
associate-+l+16.0%
+-commutative16.0%
Simplified16.0%
if 5.8e13 < z Initial program 86.7%
+-commutative86.7%
associate-+r+86.7%
associate-+r-61.9%
associate-+l-53.3%
associate-+r-53.3%
Simplified34.7%
Taylor expanded in t around inf 3.2%
associate--l+26.1%
associate--l+25.0%
associate-+r+25.0%
Simplified25.0%
Taylor expanded in y around inf 33.9%
neg-mul-133.9%
Simplified33.9%
flip-+33.9%
add-sqr-sqrt24.4%
pow224.4%
Applied egg-rr24.4%
associate--l+24.4%
unpow224.4%
sqr-neg24.4%
rem-square-sqrt33.9%
+-inverses33.9%
metadata-eval33.9%
sub-neg33.9%
remove-double-neg33.9%
Simplified33.9%
Final simplification23.9%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= z 5.8e+17) (+ 2.0 (- (sqrt (+ z 1.0)) (+ (sqrt y) (+ (sqrt x) (sqrt z))))) (+ (sqrt (+ x 1.0)) (/ 1.0 (+ (sqrt (+ 1.0 y)) (sqrt y))))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (z <= 5.8e+17) {
tmp = 2.0 + (sqrt((z + 1.0)) - (sqrt(y) + (sqrt(x) + sqrt(z))));
} else {
tmp = sqrt((x + 1.0)) + (1.0 / (sqrt((1.0 + y)) + sqrt(y)));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (z <= 5.8d+17) then
tmp = 2.0d0 + (sqrt((z + 1.0d0)) - (sqrt(y) + (sqrt(x) + sqrt(z))))
else
tmp = sqrt((x + 1.0d0)) + (1.0d0 / (sqrt((1.0d0 + y)) + sqrt(y)))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= 5.8e+17) {
tmp = 2.0 + (Math.sqrt((z + 1.0)) - (Math.sqrt(y) + (Math.sqrt(x) + Math.sqrt(z))));
} else {
tmp = Math.sqrt((x + 1.0)) + (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 <= 5.8e+17: tmp = 2.0 + (math.sqrt((z + 1.0)) - (math.sqrt(y) + (math.sqrt(x) + math.sqrt(z)))) else: tmp = math.sqrt((x + 1.0)) + (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 <= 5.8e+17) tmp = Float64(2.0 + Float64(sqrt(Float64(z + 1.0)) - Float64(sqrt(y) + Float64(sqrt(x) + sqrt(z))))); else tmp = Float64(sqrt(Float64(x + 1.0)) + 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 <= 5.8e+17)
tmp = 2.0 + (sqrt((z + 1.0)) - (sqrt(y) + (sqrt(x) + sqrt(z))));
else
tmp = sqrt((x + 1.0)) + (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, 5.8e+17], N[(2.0 + N[(N[Sqrt[N[(z + 1.0), $MachinePrecision]], $MachinePrecision] - N[(N[Sqrt[y], $MachinePrecision] + N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision] + N[(1.0 / N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq 5.8 \cdot 10^{+17}:\\
\;\;\;\;2 + \left(\sqrt{z + 1} - \left(\sqrt{y} + \left(\sqrt{x} + \sqrt{z}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\sqrt{x + 1} + \frac{1}{\sqrt{1 + y} + \sqrt{y}}\\
\end{array}
\end{array}
if z < 5.8e17Initial program 96.3%
+-commutative96.3%
associate-+r+96.3%
associate-+r-77.1%
associate-+l-68.8%
associate-+r-51.6%
Simplified51.6%
Taylor expanded in t around inf 18.7%
associate--l+22.8%
associate--l+22.8%
associate-+r+22.8%
Simplified22.8%
Taylor expanded in x around 0 16.4%
Taylor expanded in y around 0 14.2%
associate--l+14.2%
associate-+r+14.2%
+-commutative14.2%
associate-+l+14.2%
+-commutative14.2%
Simplified14.2%
if 5.8e17 < z Initial program 86.9%
+-commutative86.9%
associate-+r+86.9%
associate-+r-62.4%
associate-+l-53.7%
associate-+r-53.7%
Simplified35.0%
Taylor expanded in t around inf 3.2%
associate--l+26.1%
associate--l+24.9%
associate-+r+24.9%
Simplified24.9%
Taylor expanded in y around inf 33.9%
neg-mul-133.9%
Simplified33.9%
flip-+33.9%
add-sqr-sqrt24.6%
pow224.6%
Applied egg-rr24.6%
associate--l+24.6%
unpow224.6%
sqr-neg24.6%
rem-square-sqrt33.9%
+-inverses33.9%
metadata-eval33.9%
sub-neg33.9%
remove-double-neg33.9%
Simplified33.9%
Final simplification22.8%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (+ (sqrt (+ x 1.0)) (/ 1.0 (+ (sqrt (+ 1.0 y)) (sqrt y)))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
return sqrt((x + 1.0)) + (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 = sqrt((x + 1.0d0)) + (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 Math.sqrt((x + 1.0)) + (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 math.sqrt((x + 1.0)) + (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(sqrt(Float64(x + 1.0)) + 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 = sqrt((x + 1.0)) + (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[(N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision] + N[(1.0 / N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\sqrt{x + 1} + \frac{1}{\sqrt{1 + y} + \sqrt{y}}
\end{array}
Initial program 92.2%
+-commutative92.2%
associate-+r+92.2%
associate-+r-70.7%
associate-+l-62.2%
associate-+r-52.5%
Simplified44.3%
Taylor expanded in t around inf 11.9%
associate--l+24.2%
associate--l+23.7%
associate-+r+23.7%
Simplified23.7%
Taylor expanded in y around inf 22.1%
neg-mul-122.1%
Simplified22.1%
flip-+22.1%
add-sqr-sqrt16.8%
pow216.8%
Applied egg-rr16.8%
associate--l+16.8%
unpow216.8%
sqr-neg16.8%
rem-square-sqrt22.1%
+-inverses22.1%
metadata-eval22.1%
sub-neg22.1%
remove-double-neg22.1%
Simplified22.1%
Final simplification22.1%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (+ 1.0 (- (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 92.2%
+-commutative92.2%
associate-+r+92.2%
associate-+r-70.7%
associate-+l-62.2%
associate-+r-52.5%
Simplified44.3%
Taylor expanded in t around inf 11.9%
associate--l+24.2%
associate--l+23.7%
associate-+r+23.7%
Simplified23.7%
Taylor expanded in y around inf 22.1%
neg-mul-122.1%
Simplified22.1%
Taylor expanded in x around 0 23.3%
associate--l+43.5%
Simplified43.5%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (sqrt (+ x 1.0)))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
return sqrt((x + 1.0));
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = sqrt((x + 1.0d0))
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
return Math.sqrt((x + 1.0));
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): return math.sqrt((x + 1.0))
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) return sqrt(Float64(x + 1.0)) end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp = code(x, y, z, t)
tmp = sqrt((x + 1.0));
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\sqrt{x + 1}
\end{array}
Initial program 92.2%
+-commutative92.2%
associate-+r+92.2%
associate-+r-70.7%
associate-+l-62.2%
associate-+r-52.5%
Simplified44.3%
Taylor expanded in t around inf 11.9%
associate--l+24.2%
associate--l+23.7%
associate-+r+23.7%
Simplified23.7%
Taylor expanded in y around inf 22.1%
neg-mul-122.1%
Simplified22.1%
Taylor expanded in y around inf 18.7%
Final simplification18.7%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (sqrt x))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
return sqrt(x);
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = sqrt(x)
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
return Math.sqrt(x);
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): return math.sqrt(x)
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) return sqrt(x) end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp = code(x, y, z, t)
tmp = sqrt(x);
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := N[Sqrt[x], $MachinePrecision]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\sqrt{x}
\end{array}
Initial program 92.2%
+-commutative92.2%
associate-+r+92.2%
associate-+r-70.7%
associate-+l-62.2%
associate-+r-52.5%
Simplified44.3%
Taylor expanded in t around inf 11.9%
associate--l+24.2%
associate--l+23.7%
associate-+r+23.7%
Simplified23.7%
Taylor expanded in y around inf 22.1%
neg-mul-122.1%
Simplified22.1%
Taylor expanded in x around inf 7.0%
(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 2024086
(FPCore (x y z t)
:name "Main:z from "
:precision binary64
:alt
(+ (+ (+ (/ 1.0 (+ (sqrt (+ x 1.0)) (sqrt x))) (/ 1.0 (+ (sqrt (+ y 1.0)) (sqrt y)))) (/ 1.0 (+ (sqrt (+ z 1.0)) (sqrt z)))) (- (sqrt (+ t 1.0)) (sqrt t)))
(+ (+ (+ (- (sqrt (+ x 1.0)) (sqrt x)) (- (sqrt (+ y 1.0)) (sqrt y))) (- (sqrt (+ z 1.0)) (sqrt z))) (- (sqrt (+ t 1.0)) (sqrt t))))