
(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 27 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 (+ x 1.0)))
(t_2 (- t_1 (sqrt x)))
(t_3 (sqrt (+ 1.0 z)))
(t_4 (+ t_3 (sqrt z)))
(t_5 (sqrt (+ 1.0 t)))
(t_6 (+ t_5 (sqrt t))))
(if (<= t_2 0.99)
(+
(+ (* 0.5 (sqrt (/ 1.0 y))) (/ 1.0 (+ (sqrt x) t_1)))
(+ (- t_3 (sqrt z)) (- t_5 (sqrt t))))
(+
t_2
(+ (/ 1.0 (+ (sqrt (+ 1.0 y)) (sqrt y))) (/ (+ t_6 t_4) (* t_6 t_4)))))))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 t_2 = t_1 - sqrt(x);
double t_3 = sqrt((1.0 + z));
double t_4 = t_3 + sqrt(z);
double t_5 = sqrt((1.0 + t));
double t_6 = t_5 + sqrt(t);
double tmp;
if (t_2 <= 0.99) {
tmp = ((0.5 * sqrt((1.0 / y))) + (1.0 / (sqrt(x) + t_1))) + ((t_3 - sqrt(z)) + (t_5 - sqrt(t)));
} else {
tmp = t_2 + ((1.0 / (sqrt((1.0 + y)) + sqrt(y))) + ((t_6 + t_4) / (t_6 * t_4)));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: t_5
real(8) :: t_6
real(8) :: tmp
t_1 = sqrt((x + 1.0d0))
t_2 = t_1 - sqrt(x)
t_3 = sqrt((1.0d0 + z))
t_4 = t_3 + sqrt(z)
t_5 = sqrt((1.0d0 + t))
t_6 = t_5 + sqrt(t)
if (t_2 <= 0.99d0) then
tmp = ((0.5d0 * sqrt((1.0d0 / y))) + (1.0d0 / (sqrt(x) + t_1))) + ((t_3 - sqrt(z)) + (t_5 - sqrt(t)))
else
tmp = t_2 + ((1.0d0 / (sqrt((1.0d0 + y)) + sqrt(y))) + ((t_6 + t_4) / (t_6 * t_4)))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((x + 1.0));
double t_2 = t_1 - Math.sqrt(x);
double t_3 = Math.sqrt((1.0 + z));
double t_4 = t_3 + Math.sqrt(z);
double t_5 = Math.sqrt((1.0 + t));
double t_6 = t_5 + Math.sqrt(t);
double tmp;
if (t_2 <= 0.99) {
tmp = ((0.5 * Math.sqrt((1.0 / y))) + (1.0 / (Math.sqrt(x) + t_1))) + ((t_3 - Math.sqrt(z)) + (t_5 - Math.sqrt(t)));
} else {
tmp = t_2 + ((1.0 / (Math.sqrt((1.0 + y)) + Math.sqrt(y))) + ((t_6 + t_4) / (t_6 * t_4)));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((x + 1.0)) t_2 = t_1 - math.sqrt(x) t_3 = math.sqrt((1.0 + z)) t_4 = t_3 + math.sqrt(z) t_5 = math.sqrt((1.0 + t)) t_6 = t_5 + math.sqrt(t) tmp = 0 if t_2 <= 0.99: tmp = ((0.5 * math.sqrt((1.0 / y))) + (1.0 / (math.sqrt(x) + t_1))) + ((t_3 - math.sqrt(z)) + (t_5 - math.sqrt(t))) else: tmp = t_2 + ((1.0 / (math.sqrt((1.0 + y)) + math.sqrt(y))) + ((t_6 + t_4) / (t_6 * t_4))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(x + 1.0)) t_2 = Float64(t_1 - sqrt(x)) t_3 = sqrt(Float64(1.0 + z)) t_4 = Float64(t_3 + sqrt(z)) t_5 = sqrt(Float64(1.0 + t)) t_6 = Float64(t_5 + sqrt(t)) tmp = 0.0 if (t_2 <= 0.99) tmp = Float64(Float64(Float64(0.5 * sqrt(Float64(1.0 / y))) + Float64(1.0 / Float64(sqrt(x) + t_1))) + Float64(Float64(t_3 - sqrt(z)) + Float64(t_5 - sqrt(t)))); else tmp = Float64(t_2 + Float64(Float64(1.0 / Float64(sqrt(Float64(1.0 + y)) + sqrt(y))) + Float64(Float64(t_6 + t_4) / Float64(t_6 * t_4)))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((x + 1.0));
t_2 = t_1 - sqrt(x);
t_3 = sqrt((1.0 + z));
t_4 = t_3 + sqrt(z);
t_5 = sqrt((1.0 + t));
t_6 = t_5 + sqrt(t);
tmp = 0.0;
if (t_2 <= 0.99)
tmp = ((0.5 * sqrt((1.0 / y))) + (1.0 / (sqrt(x) + t_1))) + ((t_3 - sqrt(z)) + (t_5 - sqrt(t)));
else
tmp = t_2 + ((1.0 / (sqrt((1.0 + y)) + sqrt(y))) + ((t_6 + t_4) / (t_6 * t_4)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(t$95$1 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$4 = N[(t$95$3 + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$6 = N[(t$95$5 + N[Sqrt[t], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, 0.99], N[(N[(N[(0.5 * N[Sqrt[N[(1.0 / y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$3 - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] + N[(t$95$5 - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$2 + N[(N[(1.0 / N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$6 + t$95$4), $MachinePrecision] / N[(t$95$6 * t$95$4), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{x + 1}\\
t_2 := t\_1 - \sqrt{x}\\
t_3 := \sqrt{1 + z}\\
t_4 := t\_3 + \sqrt{z}\\
t_5 := \sqrt{1 + t}\\
t_6 := t\_5 + \sqrt{t}\\
\mathbf{if}\;t\_2 \leq 0.99:\\
\;\;\;\;\left(0.5 \cdot \sqrt{\frac{1}{y}} + \frac{1}{\sqrt{x} + t\_1}\right) + \left(\left(t\_3 - \sqrt{z}\right) + \left(t\_5 - \sqrt{t}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_2 + \left(\frac{1}{\sqrt{1 + y} + \sqrt{y}} + \frac{t\_6 + t\_4}{t\_6 \cdot t\_4}\right)\\
\end{array}
\end{array}
if (-.f64 (sqrt.f64 (+.f64 x #s(literal 1 binary64))) (sqrt.f64 x)) < 0.98999999999999999Initial program 87.9%
associate-+l+87.9%
associate-+l-47.4%
associate-+l-87.9%
+-commutative87.9%
+-commutative87.9%
+-commutative87.9%
Simplified87.9%
flip--87.9%
flip--87.9%
frac-add87.9%
Applied egg-rr87.9%
Taylor expanded in y around inf 43.8%
if 0.98999999999999999 < (-.f64 (sqrt.f64 (+.f64 x #s(literal 1 binary64))) (sqrt.f64 x)) Initial program 96.0%
associate-+l+96.0%
associate-+l+96.0%
+-commutative96.0%
+-commutative96.0%
associate-+l-80.0%
+-commutative80.0%
+-commutative80.0%
Simplified80.0%
associate--r-96.0%
+-commutative96.0%
flip--96.1%
flip--96.2%
frac-add96.2%
Applied egg-rr97.4%
Simplified98.8%
flip--99.0%
add-sqr-sqrt76.9%
add-sqr-sqrt99.5%
Applied egg-rr99.5%
associate--l+99.9%
+-inverses99.9%
metadata-eval99.9%
Simplified99.9%
Final simplification73.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 t)))
(t_2 (sqrt (+ x 1.0)))
(t_3 (- t_2 (sqrt x)))
(t_4 (+ t_1 (sqrt t)))
(t_5 (- (sqrt (+ 1.0 y)) (sqrt y)))
(t_6 (sqrt (+ 1.0 z)))
(t_7 (+ t_6 (sqrt z))))
(if (<= (+ t_3 t_5) 1.00005)
(+
(+ (* 0.5 (sqrt (/ 1.0 y))) (/ 1.0 (+ (sqrt x) t_2)))
(+ (- t_6 (sqrt z)) (- t_1 (sqrt t))))
(+ t_3 (+ (/ (+ t_4 t_7) (* t_4 t_7)) t_5)))))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((x + 1.0));
double t_3 = t_2 - sqrt(x);
double t_4 = t_1 + sqrt(t);
double t_5 = sqrt((1.0 + y)) - sqrt(y);
double t_6 = sqrt((1.0 + z));
double t_7 = t_6 + sqrt(z);
double tmp;
if ((t_3 + t_5) <= 1.00005) {
tmp = ((0.5 * sqrt((1.0 / y))) + (1.0 / (sqrt(x) + t_2))) + ((t_6 - sqrt(z)) + (t_1 - sqrt(t)));
} else {
tmp = t_3 + (((t_4 + t_7) / (t_4 * t_7)) + t_5);
}
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) :: t_6
real(8) :: t_7
real(8) :: tmp
t_1 = sqrt((1.0d0 + t))
t_2 = sqrt((x + 1.0d0))
t_3 = t_2 - sqrt(x)
t_4 = t_1 + sqrt(t)
t_5 = sqrt((1.0d0 + y)) - sqrt(y)
t_6 = sqrt((1.0d0 + z))
t_7 = t_6 + sqrt(z)
if ((t_3 + t_5) <= 1.00005d0) then
tmp = ((0.5d0 * sqrt((1.0d0 / y))) + (1.0d0 / (sqrt(x) + t_2))) + ((t_6 - sqrt(z)) + (t_1 - sqrt(t)))
else
tmp = t_3 + (((t_4 + t_7) / (t_4 * t_7)) + t_5)
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((x + 1.0));
double t_3 = t_2 - Math.sqrt(x);
double t_4 = t_1 + Math.sqrt(t);
double t_5 = Math.sqrt((1.0 + y)) - Math.sqrt(y);
double t_6 = Math.sqrt((1.0 + z));
double t_7 = t_6 + Math.sqrt(z);
double tmp;
if ((t_3 + t_5) <= 1.00005) {
tmp = ((0.5 * Math.sqrt((1.0 / y))) + (1.0 / (Math.sqrt(x) + t_2))) + ((t_6 - Math.sqrt(z)) + (t_1 - Math.sqrt(t)));
} else {
tmp = t_3 + (((t_4 + t_7) / (t_4 * t_7)) + t_5);
}
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((x + 1.0)) t_3 = t_2 - math.sqrt(x) t_4 = t_1 + math.sqrt(t) t_5 = math.sqrt((1.0 + y)) - math.sqrt(y) t_6 = math.sqrt((1.0 + z)) t_7 = t_6 + math.sqrt(z) tmp = 0 if (t_3 + t_5) <= 1.00005: tmp = ((0.5 * math.sqrt((1.0 / y))) + (1.0 / (math.sqrt(x) + t_2))) + ((t_6 - math.sqrt(z)) + (t_1 - math.sqrt(t))) else: tmp = t_3 + (((t_4 + t_7) / (t_4 * t_7)) + t_5) 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(x + 1.0)) t_3 = Float64(t_2 - sqrt(x)) t_4 = Float64(t_1 + sqrt(t)) t_5 = Float64(sqrt(Float64(1.0 + y)) - sqrt(y)) t_6 = sqrt(Float64(1.0 + z)) t_7 = Float64(t_6 + sqrt(z)) tmp = 0.0 if (Float64(t_3 + t_5) <= 1.00005) tmp = Float64(Float64(Float64(0.5 * sqrt(Float64(1.0 / y))) + Float64(1.0 / Float64(sqrt(x) + t_2))) + Float64(Float64(t_6 - sqrt(z)) + Float64(t_1 - sqrt(t)))); else tmp = Float64(t_3 + Float64(Float64(Float64(t_4 + t_7) / Float64(t_4 * t_7)) + t_5)); 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((x + 1.0));
t_3 = t_2 - sqrt(x);
t_4 = t_1 + sqrt(t);
t_5 = sqrt((1.0 + y)) - sqrt(y);
t_6 = sqrt((1.0 + z));
t_7 = t_6 + sqrt(z);
tmp = 0.0;
if ((t_3 + t_5) <= 1.00005)
tmp = ((0.5 * sqrt((1.0 / y))) + (1.0 / (sqrt(x) + t_2))) + ((t_6 - sqrt(z)) + (t_1 - sqrt(t)));
else
tmp = t_3 + (((t_4 + t_7) / (t_4 * t_7)) + t_5);
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[(x + 1.0), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[(t$95$2 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(t$95$1 + N[Sqrt[t], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$6 = N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$7 = N[(t$95$6 + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(t$95$3 + t$95$5), $MachinePrecision], 1.00005], N[(N[(N[(0.5 * N[Sqrt[N[(1.0 / y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$6 - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] + N[(t$95$1 - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$3 + N[(N[(N[(t$95$4 + t$95$7), $MachinePrecision] / N[(t$95$4 * t$95$7), $MachinePrecision]), $MachinePrecision] + t$95$5), $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{x + 1}\\
t_3 := t\_2 - \sqrt{x}\\
t_4 := t\_1 + \sqrt{t}\\
t_5 := \sqrt{1 + y} - \sqrt{y}\\
t_6 := \sqrt{1 + z}\\
t_7 := t\_6 + \sqrt{z}\\
\mathbf{if}\;t\_3 + t\_5 \leq 1.00005:\\
\;\;\;\;\left(0.5 \cdot \sqrt{\frac{1}{y}} + \frac{1}{\sqrt{x} + t\_2}\right) + \left(\left(t\_6 - \sqrt{z}\right) + \left(t\_1 - \sqrt{t}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_3 + \left(\frac{t\_4 + t\_7}{t\_4 \cdot t\_7} + t\_5\right)\\
\end{array}
\end{array}
if (+.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))) < 1.00005000000000011Initial program 90.6%
associate-+l+90.6%
associate-+l-64.2%
associate-+l-90.6%
+-commutative90.6%
+-commutative90.6%
+-commutative90.6%
Simplified90.6%
flip--90.6%
flip--90.8%
frac-add90.8%
Applied egg-rr91.1%
Taylor expanded in y around inf 62.9%
if 1.00005000000000011 < (+.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))) Initial program 96.1%
associate-+l+96.1%
associate-+l+96.1%
+-commutative96.1%
+-commutative96.1%
associate-+l-79.1%
+-commutative79.1%
+-commutative79.1%
Simplified79.1%
associate--r-96.1%
+-commutative96.1%
flip--96.3%
flip--96.6%
frac-add96.6%
Applied egg-rr97.9%
Simplified99.7%
Final simplification73.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)) (sqrt y)))
(t_2 (sqrt (+ x 1.0)))
(t_3 (sqrt (+ 1.0 z)))
(t_4 (- (sqrt (+ 1.0 t)) (sqrt t))))
(if (<= t_1 5e-5)
(+
(+ (* 0.5 (sqrt (/ 1.0 y))) (/ 1.0 (+ (sqrt x) t_2)))
(+ (- t_3 (sqrt z)) t_4))
(+ (+ (- t_2 (sqrt x)) t_1) (+ t_4 (/ 1.0 (+ t_3 (sqrt z))))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + y)) - sqrt(y);
double t_2 = sqrt((x + 1.0));
double t_3 = sqrt((1.0 + z));
double t_4 = sqrt((1.0 + t)) - sqrt(t);
double tmp;
if (t_1 <= 5e-5) {
tmp = ((0.5 * sqrt((1.0 / y))) + (1.0 / (sqrt(x) + t_2))) + ((t_3 - sqrt(z)) + t_4);
} else {
tmp = ((t_2 - sqrt(x)) + t_1) + (t_4 + (1.0 / (t_3 + sqrt(z))));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: tmp
t_1 = sqrt((1.0d0 + y)) - sqrt(y)
t_2 = sqrt((x + 1.0d0))
t_3 = sqrt((1.0d0 + z))
t_4 = sqrt((1.0d0 + t)) - sqrt(t)
if (t_1 <= 5d-5) then
tmp = ((0.5d0 * sqrt((1.0d0 / y))) + (1.0d0 / (sqrt(x) + t_2))) + ((t_3 - sqrt(z)) + t_4)
else
tmp = ((t_2 - sqrt(x)) + t_1) + (t_4 + (1.0d0 / (t_3 + sqrt(z))))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + y)) - Math.sqrt(y);
double t_2 = Math.sqrt((x + 1.0));
double t_3 = Math.sqrt((1.0 + z));
double t_4 = Math.sqrt((1.0 + t)) - Math.sqrt(t);
double tmp;
if (t_1 <= 5e-5) {
tmp = ((0.5 * Math.sqrt((1.0 / y))) + (1.0 / (Math.sqrt(x) + t_2))) + ((t_3 - Math.sqrt(z)) + t_4);
} else {
tmp = ((t_2 - Math.sqrt(x)) + t_1) + (t_4 + (1.0 / (t_3 + Math.sqrt(z))));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + y)) - math.sqrt(y) t_2 = math.sqrt((x + 1.0)) t_3 = math.sqrt((1.0 + z)) t_4 = math.sqrt((1.0 + t)) - math.sqrt(t) tmp = 0 if t_1 <= 5e-5: tmp = ((0.5 * math.sqrt((1.0 / y))) + (1.0 / (math.sqrt(x) + t_2))) + ((t_3 - math.sqrt(z)) + t_4) else: tmp = ((t_2 - math.sqrt(x)) + t_1) + (t_4 + (1.0 / (t_3 + math.sqrt(z)))) 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 = sqrt(Float64(x + 1.0)) t_3 = sqrt(Float64(1.0 + z)) t_4 = Float64(sqrt(Float64(1.0 + t)) - sqrt(t)) tmp = 0.0 if (t_1 <= 5e-5) tmp = Float64(Float64(Float64(0.5 * sqrt(Float64(1.0 / y))) + Float64(1.0 / Float64(sqrt(x) + t_2))) + Float64(Float64(t_3 - sqrt(z)) + t_4)); else tmp = Float64(Float64(Float64(t_2 - sqrt(x)) + t_1) + Float64(t_4 + Float64(1.0 / Float64(t_3 + sqrt(z))))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + y)) - sqrt(y);
t_2 = sqrt((x + 1.0));
t_3 = sqrt((1.0 + z));
t_4 = sqrt((1.0 + t)) - sqrt(t);
tmp = 0.0;
if (t_1 <= 5e-5)
tmp = ((0.5 * sqrt((1.0 / y))) + (1.0 / (sqrt(x) + t_2))) + ((t_3 - sqrt(z)) + t_4);
else
tmp = ((t_2 - sqrt(x)) + t_1) + (t_4 + (1.0 / (t_3 + sqrt(z))));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$4 = N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, 5e-5], N[(N[(N[(0.5 * N[Sqrt[N[(1.0 / y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$3 - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] + t$95$4), $MachinePrecision]), $MachinePrecision], N[(N[(N[(t$95$2 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision] + N[(t$95$4 + N[(1.0 / N[(t$95$3 + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + y} - \sqrt{y}\\
t_2 := \sqrt{x + 1}\\
t_3 := \sqrt{1 + z}\\
t_4 := \sqrt{1 + t} - \sqrt{t}\\
\mathbf{if}\;t\_1 \leq 5 \cdot 10^{-5}:\\
\;\;\;\;\left(0.5 \cdot \sqrt{\frac{1}{y}} + \frac{1}{\sqrt{x} + t\_2}\right) + \left(\left(t\_3 - \sqrt{z}\right) + t\_4\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(t\_2 - \sqrt{x}\right) + t\_1\right) + \left(t\_4 + \frac{1}{t\_3 + \sqrt{z}}\right)\\
\end{array}
\end{array}
if (-.f64 (sqrt.f64 (+.f64 y #s(literal 1 binary64))) (sqrt.f64 y)) < 5.00000000000000024e-5Initial program 86.9%
associate-+l+86.9%
associate-+l-86.9%
associate-+l-86.9%
+-commutative86.9%
+-commutative86.9%
+-commutative86.9%
Simplified86.9%
flip--86.9%
flip--87.1%
frac-add87.1%
Applied egg-rr87.7%
Taylor expanded in y around inf 92.6%
if 5.00000000000000024e-5 < (-.f64 (sqrt.f64 (+.f64 y #s(literal 1 binary64))) (sqrt.f64 y)) Initial program 96.8%
associate-+l+96.8%
associate-+l-61.7%
associate-+l-96.8%
+-commutative96.8%
+-commutative96.8%
+-commutative96.8%
Simplified96.8%
flip--96.9%
add-sqr-sqrt81.1%
add-sqr-sqrt97.8%
Applied egg-rr97.8%
associate--l+98.1%
+-inverses98.1%
metadata-eval98.1%
Simplified98.1%
Final simplification95.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 (+ 1.0 z)))
(t_3 (- (sqrt (+ 1.0 t)) (sqrt t))))
(if (<= (- t_1 (sqrt y)) 5e-5)
(+
(+ (* 0.5 (sqrt (/ 1.0 y))) (/ 1.0 (+ (sqrt x) (sqrt (+ x 1.0)))))
(+ (- t_2 (sqrt z)) t_3))
(+
(+ t_3 (/ 1.0 (+ t_2 (sqrt z))))
(+ 1.0 (- t_1 (+ (sqrt x) (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((1.0 + z));
double t_3 = sqrt((1.0 + t)) - sqrt(t);
double tmp;
if ((t_1 - sqrt(y)) <= 5e-5) {
tmp = ((0.5 * sqrt((1.0 / y))) + (1.0 / (sqrt(x) + sqrt((x + 1.0))))) + ((t_2 - sqrt(z)) + t_3);
} else {
tmp = (t_3 + (1.0 / (t_2 + sqrt(z)))) + (1.0 + (t_1 - (sqrt(x) + sqrt(y))));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = sqrt((1.0d0 + y))
t_2 = sqrt((1.0d0 + z))
t_3 = sqrt((1.0d0 + t)) - sqrt(t)
if ((t_1 - sqrt(y)) <= 5d-5) then
tmp = ((0.5d0 * sqrt((1.0d0 / y))) + (1.0d0 / (sqrt(x) + sqrt((x + 1.0d0))))) + ((t_2 - sqrt(z)) + t_3)
else
tmp = (t_3 + (1.0d0 / (t_2 + sqrt(z)))) + (1.0d0 + (t_1 - (sqrt(x) + sqrt(y))))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + y));
double t_2 = Math.sqrt((1.0 + z));
double t_3 = Math.sqrt((1.0 + t)) - Math.sqrt(t);
double tmp;
if ((t_1 - Math.sqrt(y)) <= 5e-5) {
tmp = ((0.5 * Math.sqrt((1.0 / y))) + (1.0 / (Math.sqrt(x) + Math.sqrt((x + 1.0))))) + ((t_2 - Math.sqrt(z)) + t_3);
} else {
tmp = (t_3 + (1.0 / (t_2 + Math.sqrt(z)))) + (1.0 + (t_1 - (Math.sqrt(x) + 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((1.0 + z)) t_3 = math.sqrt((1.0 + t)) - math.sqrt(t) tmp = 0 if (t_1 - math.sqrt(y)) <= 5e-5: tmp = ((0.5 * math.sqrt((1.0 / y))) + (1.0 / (math.sqrt(x) + math.sqrt((x + 1.0))))) + ((t_2 - math.sqrt(z)) + t_3) else: tmp = (t_3 + (1.0 / (t_2 + math.sqrt(z)))) + (1.0 + (t_1 - (math.sqrt(x) + 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 = sqrt(Float64(1.0 + z)) t_3 = Float64(sqrt(Float64(1.0 + t)) - sqrt(t)) tmp = 0.0 if (Float64(t_1 - sqrt(y)) <= 5e-5) tmp = Float64(Float64(Float64(0.5 * sqrt(Float64(1.0 / y))) + Float64(1.0 / Float64(sqrt(x) + sqrt(Float64(x + 1.0))))) + Float64(Float64(t_2 - sqrt(z)) + t_3)); else tmp = Float64(Float64(t_3 + Float64(1.0 / Float64(t_2 + sqrt(z)))) + Float64(1.0 + Float64(t_1 - Float64(sqrt(x) + sqrt(y))))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + y));
t_2 = sqrt((1.0 + z));
t_3 = sqrt((1.0 + t)) - sqrt(t);
tmp = 0.0;
if ((t_1 - sqrt(y)) <= 5e-5)
tmp = ((0.5 * sqrt((1.0 / y))) + (1.0 / (sqrt(x) + sqrt((x + 1.0))))) + ((t_2 - sqrt(z)) + t_3);
else
tmp = (t_3 + (1.0 / (t_2 + sqrt(z)))) + (1.0 + (t_1 - (sqrt(x) + sqrt(y))));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(t$95$1 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision], 5e-5], N[(N[(N[(0.5 * N[Sqrt[N[(1.0 / y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$2 - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] + t$95$3), $MachinePrecision]), $MachinePrecision], N[(N[(t$95$3 + N[(1.0 / N[(t$95$2 + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 + N[(t$95$1 - N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + y}\\
t_2 := \sqrt{1 + z}\\
t_3 := \sqrt{1 + t} - \sqrt{t}\\
\mathbf{if}\;t\_1 - \sqrt{y} \leq 5 \cdot 10^{-5}:\\
\;\;\;\;\left(0.5 \cdot \sqrt{\frac{1}{y}} + \frac{1}{\sqrt{x} + \sqrt{x + 1}}\right) + \left(\left(t\_2 - \sqrt{z}\right) + t\_3\right)\\
\mathbf{else}:\\
\;\;\;\;\left(t\_3 + \frac{1}{t\_2 + \sqrt{z}}\right) + \left(1 + \left(t\_1 - \left(\sqrt{x} + \sqrt{y}\right)\right)\right)\\
\end{array}
\end{array}
if (-.f64 (sqrt.f64 (+.f64 y #s(literal 1 binary64))) (sqrt.f64 y)) < 5.00000000000000024e-5Initial program 86.9%
associate-+l+86.9%
associate-+l-86.9%
associate-+l-86.9%
+-commutative86.9%
+-commutative86.9%
+-commutative86.9%
Simplified86.9%
flip--86.9%
flip--87.1%
frac-add87.1%
Applied egg-rr87.7%
Taylor expanded in y around inf 92.6%
if 5.00000000000000024e-5 < (-.f64 (sqrt.f64 (+.f64 y #s(literal 1 binary64))) (sqrt.f64 y)) Initial program 96.8%
associate-+l+96.8%
associate-+l-61.7%
associate-+l-96.8%
+-commutative96.8%
+-commutative96.8%
+-commutative96.8%
Simplified96.8%
Taylor expanded in x around 0 51.3%
associate--l+51.3%
Simplified51.3%
flip--96.9%
add-sqr-sqrt81.1%
add-sqr-sqrt97.8%
Applied egg-rr51.7%
associate--l+98.1%
+-inverses98.1%
metadata-eval98.1%
Simplified51.9%
Final simplification70.8%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(if (<= x 1.2)
(+
(+ (- (sqrt (+ 1.0 t)) (sqrt t)) (/ 1.0 (+ (sqrt (+ 1.0 z)) (sqrt z))))
(+ 1.0 (- (sqrt (+ 1.0 y)) (+ (sqrt x) (sqrt y)))))
(/ (+ (* -0.125 (sqrt (/ 1.0 x))) (* (sqrt x) 0.5)) x)))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (x <= 1.2) {
tmp = ((sqrt((1.0 + t)) - sqrt(t)) + (1.0 / (sqrt((1.0 + z)) + sqrt(z)))) + (1.0 + (sqrt((1.0 + y)) - (sqrt(x) + sqrt(y))));
} else {
tmp = ((-0.125 * sqrt((1.0 / x))) + (sqrt(x) * 0.5)) / x;
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (x <= 1.2d0) then
tmp = ((sqrt((1.0d0 + t)) - sqrt(t)) + (1.0d0 / (sqrt((1.0d0 + z)) + sqrt(z)))) + (1.0d0 + (sqrt((1.0d0 + y)) - (sqrt(x) + sqrt(y))))
else
tmp = (((-0.125d0) * sqrt((1.0d0 / x))) + (sqrt(x) * 0.5d0)) / x
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (x <= 1.2) {
tmp = ((Math.sqrt((1.0 + t)) - Math.sqrt(t)) + (1.0 / (Math.sqrt((1.0 + z)) + Math.sqrt(z)))) + (1.0 + (Math.sqrt((1.0 + y)) - (Math.sqrt(x) + Math.sqrt(y))));
} else {
tmp = ((-0.125 * Math.sqrt((1.0 / x))) + (Math.sqrt(x) * 0.5)) / x;
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if x <= 1.2: tmp = ((math.sqrt((1.0 + t)) - math.sqrt(t)) + (1.0 / (math.sqrt((1.0 + z)) + math.sqrt(z)))) + (1.0 + (math.sqrt((1.0 + y)) - (math.sqrt(x) + math.sqrt(y)))) else: tmp = ((-0.125 * math.sqrt((1.0 / x))) + (math.sqrt(x) * 0.5)) / x return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (x <= 1.2) tmp = Float64(Float64(Float64(sqrt(Float64(1.0 + t)) - sqrt(t)) + Float64(1.0 / Float64(sqrt(Float64(1.0 + z)) + sqrt(z)))) + Float64(1.0 + Float64(sqrt(Float64(1.0 + y)) - Float64(sqrt(x) + sqrt(y))))); else tmp = Float64(Float64(Float64(-0.125 * sqrt(Float64(1.0 / x))) + Float64(sqrt(x) * 0.5)) / x); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (x <= 1.2)
tmp = ((sqrt((1.0 + t)) - sqrt(t)) + (1.0 / (sqrt((1.0 + z)) + sqrt(z)))) + (1.0 + (sqrt((1.0 + y)) - (sqrt(x) + sqrt(y))));
else
tmp = ((-0.125 * sqrt((1.0 / x))) + (sqrt(x) * 0.5)) / x;
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[x, 1.2], N[(N[(N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 + N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] - N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(-0.125 * N[Sqrt[N[(1.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[x], $MachinePrecision] * 0.5), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq 1.2:\\
\;\;\;\;\left(\left(\sqrt{1 + t} - \sqrt{t}\right) + \frac{1}{\sqrt{1 + z} + \sqrt{z}}\right) + \left(1 + \left(\sqrt{1 + y} - \left(\sqrt{x} + \sqrt{y}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{-0.125 \cdot \sqrt{\frac{1}{x}} + \sqrt{x} \cdot 0.5}{x}\\
\end{array}
\end{array}
if x < 1.19999999999999996Initial program 96.0%
associate-+l+96.0%
associate-+l-96.0%
associate-+l-96.0%
+-commutative96.0%
+-commutative96.0%
+-commutative96.0%
Simplified96.0%
Taylor expanded in x around 0 59.4%
associate--l+94.2%
Simplified94.2%
flip--96.1%
add-sqr-sqrt74.6%
add-sqr-sqrt96.8%
Applied egg-rr94.9%
associate--l+97.1%
+-inverses97.1%
metadata-eval97.1%
Simplified95.2%
if 1.19999999999999996 < x Initial program 87.8%
associate-+l+87.8%
associate-+l-46.9%
associate-+l-87.8%
+-commutative87.8%
+-commutative87.8%
+-commutative87.8%
Simplified87.8%
Taylor expanded in t around inf 3.7%
associate--l+5.4%
Simplified5.4%
Taylor expanded in x around inf 3.3%
mul-1-neg3.3%
Simplified3.3%
Taylor expanded in x around inf 9.0%
Final simplification55.5%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ 1.0 z))) (t_2 (sqrt (+ x 1.0))))
(if (<= t 7.2e+28)
(+
1.0
(-
(+ (+ t_2 t_1) (/ 1.0 (+ (sqrt (+ 1.0 t)) (sqrt t))))
(+ (sqrt z) (+ (sqrt x) (sqrt y)))))
(+
(- t_2 (sqrt x))
(+ (/ 1.0 (+ (sqrt (+ 1.0 y)) (sqrt y))) (/ 1.0 (+ t_1 (sqrt z))))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + z));
double t_2 = sqrt((x + 1.0));
double tmp;
if (t <= 7.2e+28) {
tmp = 1.0 + (((t_2 + t_1) + (1.0 / (sqrt((1.0 + t)) + sqrt(t)))) - (sqrt(z) + (sqrt(x) + sqrt(y))));
} else {
tmp = (t_2 - sqrt(x)) + ((1.0 / (sqrt((1.0 + y)) + sqrt(y))) + (1.0 / (t_1 + sqrt(z))));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = sqrt((1.0d0 + z))
t_2 = sqrt((x + 1.0d0))
if (t <= 7.2d+28) then
tmp = 1.0d0 + (((t_2 + t_1) + (1.0d0 / (sqrt((1.0d0 + t)) + sqrt(t)))) - (sqrt(z) + (sqrt(x) + sqrt(y))))
else
tmp = (t_2 - sqrt(x)) + ((1.0d0 / (sqrt((1.0d0 + y)) + sqrt(y))) + (1.0d0 / (t_1 + sqrt(z))))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + z));
double t_2 = Math.sqrt((x + 1.0));
double tmp;
if (t <= 7.2e+28) {
tmp = 1.0 + (((t_2 + t_1) + (1.0 / (Math.sqrt((1.0 + t)) + Math.sqrt(t)))) - (Math.sqrt(z) + (Math.sqrt(x) + Math.sqrt(y))));
} else {
tmp = (t_2 - Math.sqrt(x)) + ((1.0 / (Math.sqrt((1.0 + y)) + Math.sqrt(y))) + (1.0 / (t_1 + Math.sqrt(z))));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + z)) t_2 = math.sqrt((x + 1.0)) tmp = 0 if t <= 7.2e+28: tmp = 1.0 + (((t_2 + t_1) + (1.0 / (math.sqrt((1.0 + t)) + math.sqrt(t)))) - (math.sqrt(z) + (math.sqrt(x) + math.sqrt(y)))) else: tmp = (t_2 - math.sqrt(x)) + ((1.0 / (math.sqrt((1.0 + y)) + math.sqrt(y))) + (1.0 / (t_1 + math.sqrt(z)))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(1.0 + z)) t_2 = sqrt(Float64(x + 1.0)) tmp = 0.0 if (t <= 7.2e+28) tmp = Float64(1.0 + Float64(Float64(Float64(t_2 + t_1) + Float64(1.0 / Float64(sqrt(Float64(1.0 + t)) + sqrt(t)))) - Float64(sqrt(z) + Float64(sqrt(x) + sqrt(y))))); else tmp = Float64(Float64(t_2 - sqrt(x)) + Float64(Float64(1.0 / Float64(sqrt(Float64(1.0 + y)) + sqrt(y))) + Float64(1.0 / Float64(t_1 + sqrt(z))))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + z));
t_2 = sqrt((x + 1.0));
tmp = 0.0;
if (t <= 7.2e+28)
tmp = 1.0 + (((t_2 + t_1) + (1.0 / (sqrt((1.0 + t)) + sqrt(t)))) - (sqrt(z) + (sqrt(x) + sqrt(y))));
else
tmp = (t_2 - sqrt(x)) + ((1.0 / (sqrt((1.0 + y)) + sqrt(y))) + (1.0 / (t_1 + sqrt(z))));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t, 7.2e+28], N[(1.0 + N[(N[(N[(t$95$2 + t$95$1), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] + N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[z], $MachinePrecision] + N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(t$95$2 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 / N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(t$95$1 + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + z}\\
t_2 := \sqrt{x + 1}\\
\mathbf{if}\;t \leq 7.2 \cdot 10^{+28}:\\
\;\;\;\;1 + \left(\left(\left(t\_2 + t\_1\right) + \frac{1}{\sqrt{1 + t} + \sqrt{t}}\right) - \left(\sqrt{z} + \left(\sqrt{x} + \sqrt{y}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(t\_2 - \sqrt{x}\right) + \left(\frac{1}{\sqrt{1 + y} + \sqrt{y}} + \frac{1}{t\_1 + \sqrt{z}}\right)\\
\end{array}
\end{array}
if t < 7.1999999999999999e28Initial program 95.2%
associate-+l+95.2%
associate-+l-75.5%
associate-+l-95.2%
+-commutative95.2%
+-commutative95.2%
+-commutative95.2%
Simplified95.2%
flip--95.3%
add-sqr-sqrt94.1%
add-sqr-sqrt96.3%
Applied egg-rr96.3%
associate--l+98.0%
+-inverses98.0%
metadata-eval98.0%
Simplified98.0%
Taylor expanded in y around 0 18.4%
associate--l+30.3%
associate-+r+30.3%
+-commutative30.3%
associate-+r+30.3%
+-commutative30.3%
Simplified30.3%
if 7.1999999999999999e28 < t Initial program 88.2%
associate-+l+88.2%
associate-+l+88.2%
+-commutative88.2%
+-commutative88.2%
associate-+l-49.5%
+-commutative49.5%
+-commutative49.5%
Simplified49.5%
associate--r-88.2%
+-commutative88.2%
flip--88.2%
flip--88.2%
frac-add88.2%
Applied egg-rr88.9%
Simplified93.0%
flip--93.0%
add-sqr-sqrt73.4%
add-sqr-sqrt93.3%
Applied egg-rr93.3%
associate--l+95.6%
+-inverses95.6%
metadata-eval95.6%
Simplified95.6%
Taylor expanded in t around inf 91.7%
Final simplification56.5%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ 1.0 z))))
(if (<= t 7.2e+28)
(-
(+ 2.0 (+ t_1 (/ 1.0 (+ (sqrt (+ 1.0 t)) (sqrt t)))))
(+ (sqrt x) (+ (sqrt z) (sqrt y))))
(+
(- (sqrt (+ x 1.0)) (sqrt x))
(+ (/ 1.0 (+ (sqrt (+ 1.0 y)) (sqrt y))) (/ 1.0 (+ t_1 (sqrt z))))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + z));
double tmp;
if (t <= 7.2e+28) {
tmp = (2.0 + (t_1 + (1.0 / (sqrt((1.0 + t)) + sqrt(t))))) - (sqrt(x) + (sqrt(z) + sqrt(y)));
} else {
tmp = (sqrt((x + 1.0)) - sqrt(x)) + ((1.0 / (sqrt((1.0 + y)) + sqrt(y))) + (1.0 / (t_1 + sqrt(z))));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = sqrt((1.0d0 + z))
if (t <= 7.2d+28) then
tmp = (2.0d0 + (t_1 + (1.0d0 / (sqrt((1.0d0 + t)) + sqrt(t))))) - (sqrt(x) + (sqrt(z) + sqrt(y)))
else
tmp = (sqrt((x + 1.0d0)) - sqrt(x)) + ((1.0d0 / (sqrt((1.0d0 + y)) + sqrt(y))) + (1.0d0 / (t_1 + sqrt(z))))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + z));
double tmp;
if (t <= 7.2e+28) {
tmp = (2.0 + (t_1 + (1.0 / (Math.sqrt((1.0 + t)) + Math.sqrt(t))))) - (Math.sqrt(x) + (Math.sqrt(z) + Math.sqrt(y)));
} else {
tmp = (Math.sqrt((x + 1.0)) - Math.sqrt(x)) + ((1.0 / (Math.sqrt((1.0 + y)) + Math.sqrt(y))) + (1.0 / (t_1 + Math.sqrt(z))));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + z)) tmp = 0 if t <= 7.2e+28: tmp = (2.0 + (t_1 + (1.0 / (math.sqrt((1.0 + t)) + math.sqrt(t))))) - (math.sqrt(x) + (math.sqrt(z) + math.sqrt(y))) else: tmp = (math.sqrt((x + 1.0)) - math.sqrt(x)) + ((1.0 / (math.sqrt((1.0 + y)) + math.sqrt(y))) + (1.0 / (t_1 + math.sqrt(z)))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(1.0 + z)) tmp = 0.0 if (t <= 7.2e+28) tmp = Float64(Float64(2.0 + Float64(t_1 + Float64(1.0 / Float64(sqrt(Float64(1.0 + t)) + sqrt(t))))) - Float64(sqrt(x) + Float64(sqrt(z) + sqrt(y)))); else tmp = Float64(Float64(sqrt(Float64(x + 1.0)) - sqrt(x)) + Float64(Float64(1.0 / Float64(sqrt(Float64(1.0 + y)) + sqrt(y))) + Float64(1.0 / Float64(t_1 + sqrt(z))))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + z));
tmp = 0.0;
if (t <= 7.2e+28)
tmp = (2.0 + (t_1 + (1.0 / (sqrt((1.0 + t)) + sqrt(t))))) - (sqrt(x) + (sqrt(z) + sqrt(y)));
else
tmp = (sqrt((x + 1.0)) - sqrt(x)) + ((1.0 / (sqrt((1.0 + y)) + sqrt(y))) + (1.0 / (t_1 + sqrt(z))));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t, 7.2e+28], N[(N[(2.0 + N[(t$95$1 + N[(1.0 / N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] + N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[x], $MachinePrecision] + N[(N[Sqrt[z], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 / N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(t$95$1 + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + z}\\
\mathbf{if}\;t \leq 7.2 \cdot 10^{+28}:\\
\;\;\;\;\left(2 + \left(t\_1 + \frac{1}{\sqrt{1 + t} + \sqrt{t}}\right)\right) - \left(\sqrt{x} + \left(\sqrt{z} + \sqrt{y}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\frac{1}{\sqrt{1 + y} + \sqrt{y}} + \frac{1}{t\_1 + \sqrt{z}}\right)\\
\end{array}
\end{array}
if t < 7.1999999999999999e28Initial program 95.2%
associate-+l+95.2%
associate-+l-75.5%
associate-+l-95.2%
+-commutative95.2%
+-commutative95.2%
+-commutative95.2%
Simplified95.2%
flip--95.3%
add-sqr-sqrt94.1%
add-sqr-sqrt96.3%
Applied egg-rr96.3%
associate--l+98.0%
+-inverses98.0%
metadata-eval98.0%
Simplified98.0%
Taylor expanded in y around 0 18.4%
associate--l+30.3%
associate-+r+30.3%
+-commutative30.3%
associate-+r+30.3%
+-commutative30.3%
Simplified30.3%
Taylor expanded in x around 0 16.9%
if 7.1999999999999999e28 < t Initial program 88.2%
associate-+l+88.2%
associate-+l+88.2%
+-commutative88.2%
+-commutative88.2%
associate-+l-49.5%
+-commutative49.5%
+-commutative49.5%
Simplified49.5%
associate--r-88.2%
+-commutative88.2%
flip--88.2%
flip--88.2%
frac-add88.2%
Applied egg-rr88.9%
Simplified93.0%
flip--93.0%
add-sqr-sqrt73.4%
add-sqr-sqrt93.3%
Applied egg-rr93.3%
associate--l+95.6%
+-inverses95.6%
metadata-eval95.6%
Simplified95.6%
Taylor expanded in t around inf 91.7%
Final simplification48.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 (<= t 7.2e+28)
(-
(+ 2.0 (+ t_1 (/ 1.0 (+ (sqrt (+ 1.0 t)) (sqrt t)))))
(+ (sqrt x) (+ (sqrt z) (sqrt y))))
(+
(sqrt (+ x 1.0))
(-
(+ (/ 1.0 (+ (sqrt (+ 1.0 y)) (sqrt y))) (/ 1.0 (+ t_1 (sqrt z))))
(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 (t <= 7.2e+28) {
tmp = (2.0 + (t_1 + (1.0 / (sqrt((1.0 + t)) + sqrt(t))))) - (sqrt(x) + (sqrt(z) + sqrt(y)));
} else {
tmp = sqrt((x + 1.0)) + (((1.0 / (sqrt((1.0 + y)) + sqrt(y))) + (1.0 / (t_1 + sqrt(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((1.0d0 + z))
if (t <= 7.2d+28) then
tmp = (2.0d0 + (t_1 + (1.0d0 / (sqrt((1.0d0 + t)) + sqrt(t))))) - (sqrt(x) + (sqrt(z) + sqrt(y)))
else
tmp = sqrt((x + 1.0d0)) + (((1.0d0 / (sqrt((1.0d0 + y)) + sqrt(y))) + (1.0d0 / (t_1 + sqrt(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((1.0 + z));
double tmp;
if (t <= 7.2e+28) {
tmp = (2.0 + (t_1 + (1.0 / (Math.sqrt((1.0 + t)) + Math.sqrt(t))))) - (Math.sqrt(x) + (Math.sqrt(z) + Math.sqrt(y)));
} else {
tmp = Math.sqrt((x + 1.0)) + (((1.0 / (Math.sqrt((1.0 + y)) + Math.sqrt(y))) + (1.0 / (t_1 + Math.sqrt(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((1.0 + z)) tmp = 0 if t <= 7.2e+28: tmp = (2.0 + (t_1 + (1.0 / (math.sqrt((1.0 + t)) + math.sqrt(t))))) - (math.sqrt(x) + (math.sqrt(z) + math.sqrt(y))) else: tmp = math.sqrt((x + 1.0)) + (((1.0 / (math.sqrt((1.0 + y)) + math.sqrt(y))) + (1.0 / (t_1 + math.sqrt(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(1.0 + z)) tmp = 0.0 if (t <= 7.2e+28) tmp = Float64(Float64(2.0 + Float64(t_1 + Float64(1.0 / Float64(sqrt(Float64(1.0 + t)) + sqrt(t))))) - Float64(sqrt(x) + Float64(sqrt(z) + sqrt(y)))); else tmp = Float64(sqrt(Float64(x + 1.0)) + Float64(Float64(Float64(1.0 / Float64(sqrt(Float64(1.0 + y)) + sqrt(y))) + Float64(1.0 / Float64(t_1 + sqrt(z)))) - sqrt(x))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + z));
tmp = 0.0;
if (t <= 7.2e+28)
tmp = (2.0 + (t_1 + (1.0 / (sqrt((1.0 + t)) + sqrt(t))))) - (sqrt(x) + (sqrt(z) + sqrt(y)));
else
tmp = sqrt((x + 1.0)) + (((1.0 / (sqrt((1.0 + y)) + sqrt(y))) + (1.0 / (t_1 + sqrt(z)))) - sqrt(x));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t, 7.2e+28], N[(N[(2.0 + N[(t$95$1 + N[(1.0 / N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] + N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[x], $MachinePrecision] + N[(N[Sqrt[z], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision] + N[(N[(N[(1.0 / N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(t$95$1 + N[Sqrt[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{1 + z}\\
\mathbf{if}\;t \leq 7.2 \cdot 10^{+28}:\\
\;\;\;\;\left(2 + \left(t\_1 + \frac{1}{\sqrt{1 + t} + \sqrt{t}}\right)\right) - \left(\sqrt{x} + \left(\sqrt{z} + \sqrt{y}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\sqrt{x + 1} + \left(\left(\frac{1}{\sqrt{1 + y} + \sqrt{y}} + \frac{1}{t\_1 + \sqrt{z}}\right) - \sqrt{x}\right)\\
\end{array}
\end{array}
if t < 7.1999999999999999e28Initial program 95.2%
associate-+l+95.2%
associate-+l-75.5%
associate-+l-95.2%
+-commutative95.2%
+-commutative95.2%
+-commutative95.2%
Simplified95.2%
flip--95.3%
add-sqr-sqrt94.1%
add-sqr-sqrt96.3%
Applied egg-rr96.3%
associate--l+98.0%
+-inverses98.0%
metadata-eval98.0%
Simplified98.0%
Taylor expanded in y around 0 18.4%
associate--l+30.3%
associate-+r+30.3%
+-commutative30.3%
associate-+r+30.3%
+-commutative30.3%
Simplified30.3%
Taylor expanded in x around 0 16.9%
if 7.1999999999999999e28 < t Initial program 88.2%
associate-+l+88.2%
associate-+l+88.2%
+-commutative88.2%
+-commutative88.2%
associate-+l-49.5%
+-commutative49.5%
+-commutative49.5%
Simplified49.5%
associate--r-88.2%
+-commutative88.2%
flip--88.2%
flip--88.2%
frac-add88.2%
Applied egg-rr88.9%
Simplified93.0%
flip--93.0%
add-sqr-sqrt73.4%
add-sqr-sqrt93.3%
Applied egg-rr93.3%
associate--l+95.6%
+-inverses95.6%
metadata-eval95.6%
Simplified95.6%
Taylor expanded in t around inf 59.8%
associate--l+59.8%
Simplified59.8%
Final simplification35.2%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ 1.0 z))))
(if (<= t 7.2e+28)
(-
(+ 2.0 (+ t_1 (/ 1.0 (+ (sqrt (+ 1.0 t)) (sqrt t)))))
(+ (sqrt x) (+ (sqrt z) (sqrt y))))
(+
(- (sqrt (+ x 1.0)) (sqrt x))
(+ (- (sqrt (+ 1.0 y)) (sqrt y)) (/ 1.0 (+ t_1 (sqrt z))))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + z));
double tmp;
if (t <= 7.2e+28) {
tmp = (2.0 + (t_1 + (1.0 / (sqrt((1.0 + t)) + sqrt(t))))) - (sqrt(x) + (sqrt(z) + sqrt(y)));
} else {
tmp = (sqrt((x + 1.0)) - sqrt(x)) + ((sqrt((1.0 + y)) - sqrt(y)) + (1.0 / (t_1 + sqrt(z))));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = sqrt((1.0d0 + z))
if (t <= 7.2d+28) then
tmp = (2.0d0 + (t_1 + (1.0d0 / (sqrt((1.0d0 + t)) + sqrt(t))))) - (sqrt(x) + (sqrt(z) + sqrt(y)))
else
tmp = (sqrt((x + 1.0d0)) - sqrt(x)) + ((sqrt((1.0d0 + y)) - sqrt(y)) + (1.0d0 / (t_1 + sqrt(z))))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + z));
double tmp;
if (t <= 7.2e+28) {
tmp = (2.0 + (t_1 + (1.0 / (Math.sqrt((1.0 + t)) + Math.sqrt(t))))) - (Math.sqrt(x) + (Math.sqrt(z) + Math.sqrt(y)));
} else {
tmp = (Math.sqrt((x + 1.0)) - Math.sqrt(x)) + ((Math.sqrt((1.0 + y)) - Math.sqrt(y)) + (1.0 / (t_1 + Math.sqrt(z))));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + z)) tmp = 0 if t <= 7.2e+28: tmp = (2.0 + (t_1 + (1.0 / (math.sqrt((1.0 + t)) + math.sqrt(t))))) - (math.sqrt(x) + (math.sqrt(z) + math.sqrt(y))) else: tmp = (math.sqrt((x + 1.0)) - math.sqrt(x)) + ((math.sqrt((1.0 + y)) - math.sqrt(y)) + (1.0 / (t_1 + math.sqrt(z)))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(1.0 + z)) tmp = 0.0 if (t <= 7.2e+28) tmp = Float64(Float64(2.0 + Float64(t_1 + Float64(1.0 / Float64(sqrt(Float64(1.0 + t)) + sqrt(t))))) - Float64(sqrt(x) + Float64(sqrt(z) + sqrt(y)))); else tmp = Float64(Float64(sqrt(Float64(x + 1.0)) - sqrt(x)) + Float64(Float64(sqrt(Float64(1.0 + y)) - sqrt(y)) + Float64(1.0 / Float64(t_1 + sqrt(z))))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + z));
tmp = 0.0;
if (t <= 7.2e+28)
tmp = (2.0 + (t_1 + (1.0 / (sqrt((1.0 + t)) + sqrt(t))))) - (sqrt(x) + (sqrt(z) + sqrt(y)));
else
tmp = (sqrt((x + 1.0)) - sqrt(x)) + ((sqrt((1.0 + y)) - sqrt(y)) + (1.0 / (t_1 + sqrt(z))));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t, 7.2e+28], N[(N[(2.0 + N[(t$95$1 + N[(1.0 / N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] + N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[x], $MachinePrecision] + N[(N[Sqrt[z], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(t$95$1 + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + z}\\
\mathbf{if}\;t \leq 7.2 \cdot 10^{+28}:\\
\;\;\;\;\left(2 + \left(t\_1 + \frac{1}{\sqrt{1 + t} + \sqrt{t}}\right)\right) - \left(\sqrt{x} + \left(\sqrt{z} + \sqrt{y}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\left(\sqrt{1 + y} - \sqrt{y}\right) + \frac{1}{t\_1 + \sqrt{z}}\right)\\
\end{array}
\end{array}
if t < 7.1999999999999999e28Initial program 95.2%
associate-+l+95.2%
associate-+l-75.5%
associate-+l-95.2%
+-commutative95.2%
+-commutative95.2%
+-commutative95.2%
Simplified95.2%
flip--95.3%
add-sqr-sqrt94.1%
add-sqr-sqrt96.3%
Applied egg-rr96.3%
associate--l+98.0%
+-inverses98.0%
metadata-eval98.0%
Simplified98.0%
Taylor expanded in y around 0 18.4%
associate--l+30.3%
associate-+r+30.3%
+-commutative30.3%
associate-+r+30.3%
+-commutative30.3%
Simplified30.3%
Taylor expanded in x around 0 16.9%
if 7.1999999999999999e28 < t Initial program 88.2%
associate-+l+88.2%
associate-+l+88.2%
+-commutative88.2%
+-commutative88.2%
associate-+l-49.5%
+-commutative49.5%
+-commutative49.5%
Simplified49.5%
associate--r-88.2%
+-commutative88.2%
flip--88.2%
flip--88.2%
frac-add88.2%
Applied egg-rr88.9%
Simplified93.0%
Taylor expanded in t around inf 89.6%
Final simplification47.9%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ 1.0 z))) (t_2 (sqrt (+ x 1.0))))
(if (<= z 1.2e-30)
(+ 1.0 (- (+ (+ t_2 t_1) (/ 1.0 (+ (sqrt (+ 1.0 t)) (sqrt t)))) (sqrt y)))
(+
(- t_2 (sqrt x))
(+ (- (sqrt (+ 1.0 y)) (sqrt y)) (/ 1.0 (+ t_1 (sqrt z))))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + z));
double t_2 = sqrt((x + 1.0));
double tmp;
if (z <= 1.2e-30) {
tmp = 1.0 + (((t_2 + t_1) + (1.0 / (sqrt((1.0 + t)) + sqrt(t)))) - sqrt(y));
} else {
tmp = (t_2 - sqrt(x)) + ((sqrt((1.0 + y)) - sqrt(y)) + (1.0 / (t_1 + sqrt(z))));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = sqrt((1.0d0 + z))
t_2 = sqrt((x + 1.0d0))
if (z <= 1.2d-30) then
tmp = 1.0d0 + (((t_2 + t_1) + (1.0d0 / (sqrt((1.0d0 + t)) + sqrt(t)))) - sqrt(y))
else
tmp = (t_2 - sqrt(x)) + ((sqrt((1.0d0 + y)) - sqrt(y)) + (1.0d0 / (t_1 + sqrt(z))))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + z));
double t_2 = Math.sqrt((x + 1.0));
double tmp;
if (z <= 1.2e-30) {
tmp = 1.0 + (((t_2 + t_1) + (1.0 / (Math.sqrt((1.0 + t)) + Math.sqrt(t)))) - Math.sqrt(y));
} else {
tmp = (t_2 - Math.sqrt(x)) + ((Math.sqrt((1.0 + y)) - Math.sqrt(y)) + (1.0 / (t_1 + Math.sqrt(z))));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + z)) t_2 = math.sqrt((x + 1.0)) tmp = 0 if z <= 1.2e-30: tmp = 1.0 + (((t_2 + t_1) + (1.0 / (math.sqrt((1.0 + t)) + math.sqrt(t)))) - math.sqrt(y)) else: tmp = (t_2 - math.sqrt(x)) + ((math.sqrt((1.0 + y)) - math.sqrt(y)) + (1.0 / (t_1 + math.sqrt(z)))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(1.0 + z)) t_2 = sqrt(Float64(x + 1.0)) tmp = 0.0 if (z <= 1.2e-30) tmp = Float64(1.0 + Float64(Float64(Float64(t_2 + t_1) + Float64(1.0 / Float64(sqrt(Float64(1.0 + t)) + sqrt(t)))) - sqrt(y))); else tmp = Float64(Float64(t_2 - sqrt(x)) + Float64(Float64(sqrt(Float64(1.0 + y)) - sqrt(y)) + Float64(1.0 / Float64(t_1 + sqrt(z))))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + z));
t_2 = sqrt((x + 1.0));
tmp = 0.0;
if (z <= 1.2e-30)
tmp = 1.0 + (((t_2 + t_1) + (1.0 / (sqrt((1.0 + t)) + sqrt(t)))) - sqrt(y));
else
tmp = (t_2 - sqrt(x)) + ((sqrt((1.0 + y)) - sqrt(y)) + (1.0 / (t_1 + sqrt(z))));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[z, 1.2e-30], N[(1.0 + N[(N[(N[(t$95$2 + t$95$1), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] + N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(t$95$2 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(t$95$1 + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + z}\\
t_2 := \sqrt{x + 1}\\
\mathbf{if}\;z \leq 1.2 \cdot 10^{-30}:\\
\;\;\;\;1 + \left(\left(\left(t\_2 + t\_1\right) + \frac{1}{\sqrt{1 + t} + \sqrt{t}}\right) - \sqrt{y}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(t\_2 - \sqrt{x}\right) + \left(\left(\sqrt{1 + y} - \sqrt{y}\right) + \frac{1}{t\_1 + \sqrt{z}}\right)\\
\end{array}
\end{array}
if z < 1.19999999999999992e-30Initial program 97.7%
associate-+l+97.7%
associate-+l-80.4%
associate-+l-97.7%
+-commutative97.7%
+-commutative97.7%
+-commutative97.7%
Simplified97.7%
flip--97.7%
add-sqr-sqrt73.4%
add-sqr-sqrt98.1%
Applied egg-rr98.1%
associate--l+98.8%
+-inverses98.8%
metadata-eval98.8%
Simplified98.8%
Taylor expanded in y around 0 33.9%
associate--l+43.0%
associate-+r+43.0%
+-commutative43.0%
associate-+r+43.0%
+-commutative43.0%
Simplified43.0%
Taylor expanded in y around inf 33.4%
if 1.19999999999999992e-30 < z Initial program 88.2%
associate-+l+88.2%
associate-+l+88.2%
+-commutative88.2%
+-commutative88.2%
associate-+l-85.5%
+-commutative85.5%
+-commutative85.5%
Simplified85.5%
associate--r-88.2%
+-commutative88.2%
flip--88.2%
flip--88.3%
frac-add88.3%
Applied egg-rr90.2%
Simplified94.4%
Taylor expanded in t around inf 47.8%
Final simplification41.7%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ 1.0 z))) (t_2 (sqrt (+ x 1.0))))
(if (<= z 1.2e-30)
(+ 1.0 (- (+ (+ t_2 t_1) (/ 1.0 (+ (sqrt (+ 1.0 t)) (sqrt t)))) (sqrt y)))
(+ (- t_2 (sqrt x)) (+ (- t_1 (sqrt z)) (- (sqrt (+ 1.0 y)) (sqrt y)))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + z));
double t_2 = sqrt((x + 1.0));
double tmp;
if (z <= 1.2e-30) {
tmp = 1.0 + (((t_2 + t_1) + (1.0 / (sqrt((1.0 + t)) + sqrt(t)))) - sqrt(y));
} else {
tmp = (t_2 - sqrt(x)) + ((t_1 - sqrt(z)) + (sqrt((1.0 + y)) - sqrt(y)));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = sqrt((1.0d0 + z))
t_2 = sqrt((x + 1.0d0))
if (z <= 1.2d-30) then
tmp = 1.0d0 + (((t_2 + t_1) + (1.0d0 / (sqrt((1.0d0 + t)) + sqrt(t)))) - sqrt(y))
else
tmp = (t_2 - sqrt(x)) + ((t_1 - sqrt(z)) + (sqrt((1.0d0 + y)) - sqrt(y)))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + z));
double t_2 = Math.sqrt((x + 1.0));
double tmp;
if (z <= 1.2e-30) {
tmp = 1.0 + (((t_2 + t_1) + (1.0 / (Math.sqrt((1.0 + t)) + Math.sqrt(t)))) - Math.sqrt(y));
} else {
tmp = (t_2 - Math.sqrt(x)) + ((t_1 - Math.sqrt(z)) + (Math.sqrt((1.0 + y)) - Math.sqrt(y)));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + z)) t_2 = math.sqrt((x + 1.0)) tmp = 0 if z <= 1.2e-30: tmp = 1.0 + (((t_2 + t_1) + (1.0 / (math.sqrt((1.0 + t)) + math.sqrt(t)))) - math.sqrt(y)) else: tmp = (t_2 - math.sqrt(x)) + ((t_1 - math.sqrt(z)) + (math.sqrt((1.0 + y)) - math.sqrt(y))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(1.0 + z)) t_2 = sqrt(Float64(x + 1.0)) tmp = 0.0 if (z <= 1.2e-30) tmp = Float64(1.0 + Float64(Float64(Float64(t_2 + t_1) + Float64(1.0 / Float64(sqrt(Float64(1.0 + t)) + sqrt(t)))) - sqrt(y))); else tmp = Float64(Float64(t_2 - sqrt(x)) + Float64(Float64(t_1 - sqrt(z)) + Float64(sqrt(Float64(1.0 + y)) - sqrt(y)))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + z));
t_2 = sqrt((x + 1.0));
tmp = 0.0;
if (z <= 1.2e-30)
tmp = 1.0 + (((t_2 + t_1) + (1.0 / (sqrt((1.0 + t)) + sqrt(t)))) - sqrt(y));
else
tmp = (t_2 - sqrt(x)) + ((t_1 - sqrt(z)) + (sqrt((1.0 + y)) - sqrt(y)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[z, 1.2e-30], N[(1.0 + N[(N[(N[(t$95$2 + t$95$1), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] + N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(t$95$2 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$1 - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + z}\\
t_2 := \sqrt{x + 1}\\
\mathbf{if}\;z \leq 1.2 \cdot 10^{-30}:\\
\;\;\;\;1 + \left(\left(\left(t\_2 + t\_1\right) + \frac{1}{\sqrt{1 + t} + \sqrt{t}}\right) - \sqrt{y}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(t\_2 - \sqrt{x}\right) + \left(\left(t\_1 - \sqrt{z}\right) + \left(\sqrt{1 + y} - \sqrt{y}\right)\right)\\
\end{array}
\end{array}
if z < 1.19999999999999992e-30Initial program 97.7%
associate-+l+97.7%
associate-+l-80.4%
associate-+l-97.7%
+-commutative97.7%
+-commutative97.7%
+-commutative97.7%
Simplified97.7%
flip--97.7%
add-sqr-sqrt73.4%
add-sqr-sqrt98.1%
Applied egg-rr98.1%
associate--l+98.8%
+-inverses98.8%
metadata-eval98.8%
Simplified98.8%
Taylor expanded in y around 0 33.9%
associate--l+43.0%
associate-+r+43.0%
+-commutative43.0%
associate-+r+43.0%
+-commutative43.0%
Simplified43.0%
Taylor expanded in y around inf 33.4%
if 1.19999999999999992e-30 < z Initial program 88.2%
associate-+l+88.2%
associate-+l+88.2%
+-commutative88.2%
+-commutative88.2%
associate-+l-85.5%
+-commutative85.5%
+-commutative85.5%
Simplified85.5%
Taylor expanded in t around inf 46.5%
Final simplification40.9%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ 1.0 z))) (t_2 (sqrt (+ 1.0 y))))
(if (<= z 1.32e-30)
(+
1.0
(-
(+ (+ (sqrt (+ x 1.0)) t_1) (/ 1.0 (+ (sqrt (+ 1.0 t)) (sqrt t))))
(sqrt y)))
(if (<= z 36000000.0)
(+ 1.0 (+ t_2 (- t_1 (+ (sqrt z) (+ (sqrt x) (sqrt y))))))
(+
(- 1.0 (sqrt x))
(+ (- t_2 (sqrt y)) (* 0.5 (+ (sqrt (/ 1.0 t)) (sqrt (/ 1.0 z))))))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + z));
double t_2 = sqrt((1.0 + y));
double tmp;
if (z <= 1.32e-30) {
tmp = 1.0 + (((sqrt((x + 1.0)) + t_1) + (1.0 / (sqrt((1.0 + t)) + sqrt(t)))) - sqrt(y));
} else if (z <= 36000000.0) {
tmp = 1.0 + (t_2 + (t_1 - (sqrt(z) + (sqrt(x) + sqrt(y)))));
} else {
tmp = (1.0 - sqrt(x)) + ((t_2 - sqrt(y)) + (0.5 * (sqrt((1.0 / t)) + sqrt((1.0 / z)))));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = sqrt((1.0d0 + z))
t_2 = sqrt((1.0d0 + y))
if (z <= 1.32d-30) then
tmp = 1.0d0 + (((sqrt((x + 1.0d0)) + t_1) + (1.0d0 / (sqrt((1.0d0 + t)) + sqrt(t)))) - sqrt(y))
else if (z <= 36000000.0d0) then
tmp = 1.0d0 + (t_2 + (t_1 - (sqrt(z) + (sqrt(x) + sqrt(y)))))
else
tmp = (1.0d0 - sqrt(x)) + ((t_2 - sqrt(y)) + (0.5d0 * (sqrt((1.0d0 / t)) + sqrt((1.0d0 / z)))))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + z));
double t_2 = Math.sqrt((1.0 + y));
double tmp;
if (z <= 1.32e-30) {
tmp = 1.0 + (((Math.sqrt((x + 1.0)) + t_1) + (1.0 / (Math.sqrt((1.0 + t)) + Math.sqrt(t)))) - Math.sqrt(y));
} else if (z <= 36000000.0) {
tmp = 1.0 + (t_2 + (t_1 - (Math.sqrt(z) + (Math.sqrt(x) + Math.sqrt(y)))));
} else {
tmp = (1.0 - Math.sqrt(x)) + ((t_2 - Math.sqrt(y)) + (0.5 * (Math.sqrt((1.0 / t)) + Math.sqrt((1.0 / z)))));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + z)) t_2 = math.sqrt((1.0 + y)) tmp = 0 if z <= 1.32e-30: tmp = 1.0 + (((math.sqrt((x + 1.0)) + t_1) + (1.0 / (math.sqrt((1.0 + t)) + math.sqrt(t)))) - math.sqrt(y)) elif z <= 36000000.0: tmp = 1.0 + (t_2 + (t_1 - (math.sqrt(z) + (math.sqrt(x) + math.sqrt(y))))) else: tmp = (1.0 - math.sqrt(x)) + ((t_2 - math.sqrt(y)) + (0.5 * (math.sqrt((1.0 / t)) + math.sqrt((1.0 / z))))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(1.0 + z)) t_2 = sqrt(Float64(1.0 + y)) tmp = 0.0 if (z <= 1.32e-30) tmp = Float64(1.0 + Float64(Float64(Float64(sqrt(Float64(x + 1.0)) + t_1) + Float64(1.0 / Float64(sqrt(Float64(1.0 + t)) + sqrt(t)))) - sqrt(y))); elseif (z <= 36000000.0) tmp = Float64(1.0 + Float64(t_2 + Float64(t_1 - Float64(sqrt(z) + Float64(sqrt(x) + sqrt(y)))))); else tmp = Float64(Float64(1.0 - sqrt(x)) + Float64(Float64(t_2 - sqrt(y)) + Float64(0.5 * Float64(sqrt(Float64(1.0 / t)) + sqrt(Float64(1.0 / z)))))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + z));
t_2 = sqrt((1.0 + y));
tmp = 0.0;
if (z <= 1.32e-30)
tmp = 1.0 + (((sqrt((x + 1.0)) + t_1) + (1.0 / (sqrt((1.0 + t)) + sqrt(t)))) - sqrt(y));
elseif (z <= 36000000.0)
tmp = 1.0 + (t_2 + (t_1 - (sqrt(z) + (sqrt(x) + sqrt(y)))));
else
tmp = (1.0 - sqrt(x)) + ((t_2 - sqrt(y)) + (0.5 * (sqrt((1.0 / t)) + sqrt((1.0 / z)))));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[z, 1.32e-30], N[(1.0 + N[(N[(N[(N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision] + t$95$1), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] + N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 36000000.0], N[(1.0 + N[(t$95$2 + N[(t$95$1 - N[(N[Sqrt[z], $MachinePrecision] + N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$2 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision] + N[(0.5 * N[(N[Sqrt[N[(1.0 / t), $MachinePrecision]], $MachinePrecision] + N[Sqrt[N[(1.0 / z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + z}\\
t_2 := \sqrt{1 + y}\\
\mathbf{if}\;z \leq 1.32 \cdot 10^{-30}:\\
\;\;\;\;1 + \left(\left(\left(\sqrt{x + 1} + t\_1\right) + \frac{1}{\sqrt{1 + t} + \sqrt{t}}\right) - \sqrt{y}\right)\\
\mathbf{elif}\;z \leq 36000000:\\
\;\;\;\;1 + \left(t\_2 + \left(t\_1 - \left(\sqrt{z} + \left(\sqrt{x} + \sqrt{y}\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(1 - \sqrt{x}\right) + \left(\left(t\_2 - \sqrt{y}\right) + 0.5 \cdot \left(\sqrt{\frac{1}{t}} + \sqrt{\frac{1}{z}}\right)\right)\\
\end{array}
\end{array}
if z < 1.32e-30Initial program 97.7%
associate-+l+97.7%
associate-+l-80.4%
associate-+l-97.7%
+-commutative97.7%
+-commutative97.7%
+-commutative97.7%
Simplified97.7%
flip--97.7%
add-sqr-sqrt73.4%
add-sqr-sqrt98.1%
Applied egg-rr98.1%
associate--l+98.8%
+-inverses98.8%
metadata-eval98.8%
Simplified98.8%
Taylor expanded in y around 0 33.9%
associate--l+43.0%
associate-+r+43.0%
+-commutative43.0%
associate-+r+43.0%
+-commutative43.0%
Simplified43.0%
Taylor expanded in y around inf 33.4%
if 1.32e-30 < z < 3.6e7Initial program 94.9%
associate-+l+94.9%
associate-+l-72.9%
associate-+l-94.9%
+-commutative94.9%
+-commutative94.9%
+-commutative94.9%
Simplified94.9%
Taylor expanded in t around inf 12.5%
associate--l+17.1%
Simplified17.1%
Taylor expanded in x around 0 8.1%
associate--l+18.0%
associate-+r-18.0%
associate-+r+18.0%
+-commutative18.0%
Simplified18.0%
if 3.6e7 < z Initial program 87.2%
associate-+l+87.2%
associate-+l+87.2%
+-commutative87.2%
+-commutative87.2%
associate-+l-86.9%
+-commutative86.9%
+-commutative86.9%
Simplified86.9%
Taylor expanded in t around inf 44.2%
associate--l+44.2%
Simplified44.2%
Taylor expanded in z around inf 50.0%
distribute-lft-out50.0%
Simplified50.0%
Taylor expanded in x around 0 34.1%
Final simplification32.7%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ 1.0 z)))
(t_2 (+ (sqrt x) (sqrt y)))
(t_3 (sqrt (+ x 1.0)))
(t_4 (sqrt (+ 1.0 y))))
(if (<= z 1.22e-30)
(+ 1.0 (- (+ (+ t_3 t_1) (/ 1.0 (+ (sqrt (+ 1.0 t)) (sqrt t)))) (sqrt y)))
(if (<= z 62000000.0)
(+ 1.0 (+ t_4 (- t_1 (+ (sqrt z) t_2))))
(+ t_3 (- (+ t_4 (* 0.5 (sqrt (/ 1.0 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 + z));
double t_2 = sqrt(x) + sqrt(y);
double t_3 = sqrt((x + 1.0));
double t_4 = sqrt((1.0 + y));
double tmp;
if (z <= 1.22e-30) {
tmp = 1.0 + (((t_3 + t_1) + (1.0 / (sqrt((1.0 + t)) + sqrt(t)))) - sqrt(y));
} else if (z <= 62000000.0) {
tmp = 1.0 + (t_4 + (t_1 - (sqrt(z) + t_2)));
} else {
tmp = t_3 + ((t_4 + (0.5 * sqrt((1.0 / 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) :: t_3
real(8) :: t_4
real(8) :: tmp
t_1 = sqrt((1.0d0 + z))
t_2 = sqrt(x) + sqrt(y)
t_3 = sqrt((x + 1.0d0))
t_4 = sqrt((1.0d0 + y))
if (z <= 1.22d-30) then
tmp = 1.0d0 + (((t_3 + t_1) + (1.0d0 / (sqrt((1.0d0 + t)) + sqrt(t)))) - sqrt(y))
else if (z <= 62000000.0d0) then
tmp = 1.0d0 + (t_4 + (t_1 - (sqrt(z) + t_2)))
else
tmp = t_3 + ((t_4 + (0.5d0 * sqrt((1.0d0 / 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 + z));
double t_2 = Math.sqrt(x) + Math.sqrt(y);
double t_3 = Math.sqrt((x + 1.0));
double t_4 = Math.sqrt((1.0 + y));
double tmp;
if (z <= 1.22e-30) {
tmp = 1.0 + (((t_3 + t_1) + (1.0 / (Math.sqrt((1.0 + t)) + Math.sqrt(t)))) - Math.sqrt(y));
} else if (z <= 62000000.0) {
tmp = 1.0 + (t_4 + (t_1 - (Math.sqrt(z) + t_2)));
} else {
tmp = t_3 + ((t_4 + (0.5 * Math.sqrt((1.0 / 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 + z)) t_2 = math.sqrt(x) + math.sqrt(y) t_3 = math.sqrt((x + 1.0)) t_4 = math.sqrt((1.0 + y)) tmp = 0 if z <= 1.22e-30: tmp = 1.0 + (((t_3 + t_1) + (1.0 / (math.sqrt((1.0 + t)) + math.sqrt(t)))) - math.sqrt(y)) elif z <= 62000000.0: tmp = 1.0 + (t_4 + (t_1 - (math.sqrt(z) + t_2))) else: tmp = t_3 + ((t_4 + (0.5 * math.sqrt((1.0 / 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 + z)) t_2 = Float64(sqrt(x) + sqrt(y)) t_3 = sqrt(Float64(x + 1.0)) t_4 = sqrt(Float64(1.0 + y)) tmp = 0.0 if (z <= 1.22e-30) tmp = Float64(1.0 + Float64(Float64(Float64(t_3 + t_1) + Float64(1.0 / Float64(sqrt(Float64(1.0 + t)) + sqrt(t)))) - sqrt(y))); elseif (z <= 62000000.0) tmp = Float64(1.0 + Float64(t_4 + Float64(t_1 - Float64(sqrt(z) + t_2)))); else tmp = Float64(t_3 + Float64(Float64(t_4 + Float64(0.5 * sqrt(Float64(1.0 / 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 + z));
t_2 = sqrt(x) + sqrt(y);
t_3 = sqrt((x + 1.0));
t_4 = sqrt((1.0 + y));
tmp = 0.0;
if (z <= 1.22e-30)
tmp = 1.0 + (((t_3 + t_1) + (1.0 / (sqrt((1.0 + t)) + sqrt(t)))) - sqrt(y));
elseif (z <= 62000000.0)
tmp = 1.0 + (t_4 + (t_1 - (sqrt(z) + t_2)));
else
tmp = t_3 + ((t_4 + (0.5 * sqrt((1.0 / 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 + z), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$4 = N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[z, 1.22e-30], N[(1.0 + N[(N[(N[(t$95$3 + t$95$1), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] + N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 62000000.0], N[(1.0 + N[(t$95$4 + N[(t$95$1 - N[(N[Sqrt[z], $MachinePrecision] + t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$3 + N[(N[(t$95$4 + N[(0.5 * N[Sqrt[N[(1.0 / z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$2), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + z}\\
t_2 := \sqrt{x} + \sqrt{y}\\
t_3 := \sqrt{x + 1}\\
t_4 := \sqrt{1 + y}\\
\mathbf{if}\;z \leq 1.22 \cdot 10^{-30}:\\
\;\;\;\;1 + \left(\left(\left(t\_3 + t\_1\right) + \frac{1}{\sqrt{1 + t} + \sqrt{t}}\right) - \sqrt{y}\right)\\
\mathbf{elif}\;z \leq 62000000:\\
\;\;\;\;1 + \left(t\_4 + \left(t\_1 - \left(\sqrt{z} + t\_2\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_3 + \left(\left(t\_4 + 0.5 \cdot \sqrt{\frac{1}{z}}\right) - t\_2\right)\\
\end{array}
\end{array}
if z < 1.22e-30Initial program 97.7%
associate-+l+97.7%
associate-+l-80.4%
associate-+l-97.7%
+-commutative97.7%
+-commutative97.7%
+-commutative97.7%
Simplified97.7%
flip--97.7%
add-sqr-sqrt73.4%
add-sqr-sqrt98.1%
Applied egg-rr98.1%
associate--l+98.8%
+-inverses98.8%
metadata-eval98.8%
Simplified98.8%
Taylor expanded in y around 0 33.9%
associate--l+43.0%
associate-+r+43.0%
+-commutative43.0%
associate-+r+43.0%
+-commutative43.0%
Simplified43.0%
Taylor expanded in y around inf 33.4%
if 1.22e-30 < z < 6.2e7Initial program 94.9%
associate-+l+94.9%
associate-+l-72.9%
associate-+l-94.9%
+-commutative94.9%
+-commutative94.9%
+-commutative94.9%
Simplified94.9%
Taylor expanded in t around inf 12.5%
associate--l+17.1%
Simplified17.1%
Taylor expanded in x around 0 8.1%
associate--l+18.0%
associate-+r-18.0%
associate-+r+18.0%
+-commutative18.0%
Simplified18.0%
if 6.2e7 < z Initial program 87.2%
associate-+l+87.2%
associate-+l-67.5%
associate-+l-87.2%
+-commutative87.2%
+-commutative87.2%
+-commutative87.2%
Simplified87.2%
Taylor expanded in t around inf 4.3%
associate--l+25.2%
Simplified25.2%
Taylor expanded in z around inf 37.0%
Final simplification34.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 x) (sqrt y))) (t_2 (sqrt (+ 1.0 y))))
(if (<= z 62000000.0)
(+ 1.0 (+ t_2 (- (sqrt (+ 1.0 z)) (+ (sqrt z) t_1))))
(+ (sqrt (+ x 1.0)) (- (+ t_2 (* 0.5 (sqrt (/ 1.0 z)))) t_1)))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt(x) + sqrt(y);
double t_2 = sqrt((1.0 + y));
double tmp;
if (z <= 62000000.0) {
tmp = 1.0 + (t_2 + (sqrt((1.0 + z)) - (sqrt(z) + t_1)));
} else {
tmp = sqrt((x + 1.0)) + ((t_2 + (0.5 * sqrt((1.0 / 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(x) + sqrt(y)
t_2 = sqrt((1.0d0 + y))
if (z <= 62000000.0d0) then
tmp = 1.0d0 + (t_2 + (sqrt((1.0d0 + z)) - (sqrt(z) + t_1)))
else
tmp = sqrt((x + 1.0d0)) + ((t_2 + (0.5d0 * sqrt((1.0d0 / 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(x) + Math.sqrt(y);
double t_2 = Math.sqrt((1.0 + y));
double tmp;
if (z <= 62000000.0) {
tmp = 1.0 + (t_2 + (Math.sqrt((1.0 + z)) - (Math.sqrt(z) + t_1)));
} else {
tmp = Math.sqrt((x + 1.0)) + ((t_2 + (0.5 * Math.sqrt((1.0 / z)))) - t_1);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt(x) + math.sqrt(y) t_2 = math.sqrt((1.0 + y)) tmp = 0 if z <= 62000000.0: tmp = 1.0 + (t_2 + (math.sqrt((1.0 + z)) - (math.sqrt(z) + t_1))) else: tmp = math.sqrt((x + 1.0)) + ((t_2 + (0.5 * math.sqrt((1.0 / z)))) - t_1) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = Float64(sqrt(x) + sqrt(y)) t_2 = sqrt(Float64(1.0 + y)) tmp = 0.0 if (z <= 62000000.0) tmp = Float64(1.0 + Float64(t_2 + Float64(sqrt(Float64(1.0 + z)) - Float64(sqrt(z) + t_1)))); else tmp = Float64(sqrt(Float64(x + 1.0)) + Float64(Float64(t_2 + Float64(0.5 * sqrt(Float64(1.0 / 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(x) + sqrt(y);
t_2 = sqrt((1.0 + y));
tmp = 0.0;
if (z <= 62000000.0)
tmp = 1.0 + (t_2 + (sqrt((1.0 + z)) - (sqrt(z) + t_1)));
else
tmp = sqrt((x + 1.0)) + ((t_2 + (0.5 * sqrt((1.0 / 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[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[z, 62000000.0], N[(1.0 + N[(t$95$2 + N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[(N[Sqrt[z], $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision] + N[(N[(t$95$2 + N[(0.5 * N[Sqrt[N[(1.0 / z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{x} + \sqrt{y}\\
t_2 := \sqrt{1 + y}\\
\mathbf{if}\;z \leq 62000000:\\
\;\;\;\;1 + \left(t\_2 + \left(\sqrt{1 + z} - \left(\sqrt{z} + t\_1\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\sqrt{x + 1} + \left(\left(t\_2 + 0.5 \cdot \sqrt{\frac{1}{z}}\right) - t\_1\right)\\
\end{array}
\end{array}
if z < 6.2e7Initial program 97.3%
associate-+l+97.3%
associate-+l-79.4%
associate-+l-97.3%
+-commutative97.3%
+-commutative97.3%
+-commutative97.3%
Simplified97.3%
Taylor expanded in t around inf 22.1%
associate--l+25.4%
Simplified25.4%
Taylor expanded in x around 0 20.2%
associate--l+28.0%
associate-+r-28.0%
associate-+r+28.0%
+-commutative28.0%
Simplified28.0%
if 6.2e7 < z Initial program 87.2%
associate-+l+87.2%
associate-+l-67.5%
associate-+l-87.2%
+-commutative87.2%
+-commutative87.2%
+-commutative87.2%
Simplified87.2%
Taylor expanded in t around inf 4.3%
associate--l+25.2%
Simplified25.2%
Taylor expanded in z around inf 37.0%
Final simplification32.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 x) (sqrt y))) (t_2 (sqrt (+ 1.0 y))))
(if (<= z 5.8e+15)
(+ 1.0 (+ t_2 (- (sqrt (+ 1.0 z)) (+ (sqrt z) t_1))))
(+ (sqrt (+ x 1.0)) (- t_2 t_1)))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt(x) + sqrt(y);
double t_2 = sqrt((1.0 + y));
double tmp;
if (z <= 5.8e+15) {
tmp = 1.0 + (t_2 + (sqrt((1.0 + z)) - (sqrt(z) + t_1)));
} else {
tmp = sqrt((x + 1.0)) + (t_2 - t_1);
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = sqrt(x) + sqrt(y)
t_2 = sqrt((1.0d0 + y))
if (z <= 5.8d+15) then
tmp = 1.0d0 + (t_2 + (sqrt((1.0d0 + z)) - (sqrt(z) + t_1)))
else
tmp = sqrt((x + 1.0d0)) + (t_2 - t_1)
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt(x) + Math.sqrt(y);
double t_2 = Math.sqrt((1.0 + y));
double tmp;
if (z <= 5.8e+15) {
tmp = 1.0 + (t_2 + (Math.sqrt((1.0 + z)) - (Math.sqrt(z) + t_1)));
} else {
tmp = Math.sqrt((x + 1.0)) + (t_2 - t_1);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt(x) + math.sqrt(y) t_2 = math.sqrt((1.0 + y)) tmp = 0 if z <= 5.8e+15: tmp = 1.0 + (t_2 + (math.sqrt((1.0 + z)) - (math.sqrt(z) + t_1))) else: tmp = math.sqrt((x + 1.0)) + (t_2 - t_1) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = Float64(sqrt(x) + sqrt(y)) t_2 = sqrt(Float64(1.0 + y)) tmp = 0.0 if (z <= 5.8e+15) tmp = Float64(1.0 + Float64(t_2 + Float64(sqrt(Float64(1.0 + z)) - Float64(sqrt(z) + t_1)))); else tmp = Float64(sqrt(Float64(x + 1.0)) + Float64(t_2 - t_1)); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt(x) + sqrt(y);
t_2 = sqrt((1.0 + y));
tmp = 0.0;
if (z <= 5.8e+15)
tmp = 1.0 + (t_2 + (sqrt((1.0 + z)) - (sqrt(z) + t_1)));
else
tmp = sqrt((x + 1.0)) + (t_2 - t_1);
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[z, 5.8e+15], N[(1.0 + N[(t$95$2 + N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[(N[Sqrt[z], $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision] + N[(t$95$2 - t$95$1), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{x} + \sqrt{y}\\
t_2 := \sqrt{1 + y}\\
\mathbf{if}\;z \leq 5.8 \cdot 10^{+15}:\\
\;\;\;\;1 + \left(t\_2 + \left(\sqrt{1 + z} - \left(\sqrt{z} + t\_1\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\sqrt{x + 1} + \left(t\_2 - t\_1\right)\\
\end{array}
\end{array}
if z < 5.8e15Initial program 96.6%
associate-+l+96.6%
associate-+l-78.3%
associate-+l-96.6%
+-commutative96.6%
+-commutative96.6%
+-commutative96.6%
Simplified96.6%
Taylor expanded in t around inf 22.1%
associate--l+25.4%
Simplified25.4%
Taylor expanded in x around 0 20.2%
associate--l+27.8%
associate-+r-27.8%
associate-+r+27.8%
+-commutative27.8%
Simplified27.8%
if 5.8e15 < z Initial program 87.7%
associate-+l+87.7%
associate-+l-68.3%
associate-+l-87.7%
+-commutative87.7%
+-commutative87.7%
+-commutative87.7%
Simplified87.7%
Taylor expanded in t around inf 3.7%
associate--l+25.2%
Simplified25.2%
Taylor expanded in z around inf 20.6%
associate--l+37.0%
Simplified37.0%
Final simplification32.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 x) (sqrt y))))
(if (<= z 1200000000000.0)
(+ 2.0 (- (sqrt (+ 1.0 z)) (+ (sqrt z) t_1)))
(+ (sqrt (+ x 1.0)) (- (sqrt (+ 1.0 y)) t_1)))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt(x) + sqrt(y);
double tmp;
if (z <= 1200000000000.0) {
tmp = 2.0 + (sqrt((1.0 + z)) - (sqrt(z) + t_1));
} else {
tmp = sqrt((x + 1.0)) + (sqrt((1.0 + y)) - 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(x) + sqrt(y)
if (z <= 1200000000000.0d0) then
tmp = 2.0d0 + (sqrt((1.0d0 + z)) - (sqrt(z) + t_1))
else
tmp = sqrt((x + 1.0d0)) + (sqrt((1.0d0 + y)) - 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(x) + Math.sqrt(y);
double tmp;
if (z <= 1200000000000.0) {
tmp = 2.0 + (Math.sqrt((1.0 + z)) - (Math.sqrt(z) + t_1));
} else {
tmp = Math.sqrt((x + 1.0)) + (Math.sqrt((1.0 + y)) - t_1);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt(x) + math.sqrt(y) tmp = 0 if z <= 1200000000000.0: tmp = 2.0 + (math.sqrt((1.0 + z)) - (math.sqrt(z) + t_1)) else: tmp = math.sqrt((x + 1.0)) + (math.sqrt((1.0 + y)) - t_1) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = Float64(sqrt(x) + sqrt(y)) tmp = 0.0 if (z <= 1200000000000.0) tmp = Float64(2.0 + Float64(sqrt(Float64(1.0 + z)) - Float64(sqrt(z) + t_1))); else tmp = Float64(sqrt(Float64(x + 1.0)) + Float64(sqrt(Float64(1.0 + y)) - 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(x) + sqrt(y);
tmp = 0.0;
if (z <= 1200000000000.0)
tmp = 2.0 + (sqrt((1.0 + z)) - (sqrt(z) + t_1));
else
tmp = sqrt((x + 1.0)) + (sqrt((1.0 + y)) - t_1);
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, 1200000000000.0], N[(2.0 + N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[(N[Sqrt[z], $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision] + N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] - t$95$1), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{x} + \sqrt{y}\\
\mathbf{if}\;z \leq 1200000000000:\\
\;\;\;\;2 + \left(\sqrt{1 + z} - \left(\sqrt{z} + t\_1\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\sqrt{x + 1} + \left(\sqrt{1 + y} - t\_1\right)\\
\end{array}
\end{array}
if z < 1.2e12Initial program 96.6%
associate-+l+96.6%
associate-+l-78.3%
associate-+l-96.6%
+-commutative96.6%
+-commutative96.6%
+-commutative96.6%
Simplified96.6%
Taylor expanded in t around inf 22.1%
associate--l+25.4%
Simplified25.4%
Taylor expanded in y around 0 19.8%
associate-+r+19.8%
associate-+r+19.8%
+-commutative19.8%
Simplified19.8%
Taylor expanded in x around 0 17.9%
associate--l+17.9%
associate-+r+17.9%
+-commutative17.9%
+-commutative17.9%
Simplified17.9%
if 1.2e12 < z Initial program 87.7%
associate-+l+87.7%
associate-+l-68.3%
associate-+l-87.7%
+-commutative87.7%
+-commutative87.7%
+-commutative87.7%
Simplified87.7%
Taylor expanded in t around inf 3.7%
associate--l+25.2%
Simplified25.2%
Taylor expanded in z around inf 20.6%
associate--l+37.0%
Simplified37.0%
Final simplification27.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 (<= y 2.0) (+ 2.0 (- (sqrt (+ 1.0 z)) (+ (sqrt z) (+ (sqrt x) (sqrt y))))) (/ (- (+ x 1.0) x) (+ (sqrt x) (sqrt (+ x 1.0))))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 2.0) {
tmp = 2.0 + (sqrt((1.0 + z)) - (sqrt(z) + (sqrt(x) + sqrt(y))));
} else {
tmp = ((x + 1.0) - x) / (sqrt(x) + sqrt((x + 1.0)));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= 2.0d0) then
tmp = 2.0d0 + (sqrt((1.0d0 + z)) - (sqrt(z) + (sqrt(x) + sqrt(y))))
else
tmp = ((x + 1.0d0) - x) / (sqrt(x) + sqrt((x + 1.0d0)))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= 2.0) {
tmp = 2.0 + (Math.sqrt((1.0 + z)) - (Math.sqrt(z) + (Math.sqrt(x) + Math.sqrt(y))));
} else {
tmp = ((x + 1.0) - x) / (Math.sqrt(x) + Math.sqrt((x + 1.0)));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if y <= 2.0: tmp = 2.0 + (math.sqrt((1.0 + z)) - (math.sqrt(z) + (math.sqrt(x) + math.sqrt(y)))) else: tmp = ((x + 1.0) - x) / (math.sqrt(x) + math.sqrt((x + 1.0))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (y <= 2.0) tmp = Float64(2.0 + Float64(sqrt(Float64(1.0 + z)) - Float64(sqrt(z) + Float64(sqrt(x) + sqrt(y))))); else tmp = Float64(Float64(Float64(x + 1.0) - x) / Float64(sqrt(x) + sqrt(Float64(x + 1.0)))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (y <= 2.0)
tmp = 2.0 + (sqrt((1.0 + z)) - (sqrt(z) + (sqrt(x) + sqrt(y))));
else
tmp = ((x + 1.0) - x) / (sqrt(x) + sqrt((x + 1.0)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[y, 2.0], N[(2.0 + N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[(N[Sqrt[z], $MachinePrecision] + N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x + 1.0), $MachinePrecision] - x), $MachinePrecision] / N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 2:\\
\;\;\;\;2 + \left(\sqrt{1 + z} - \left(\sqrt{z} + \left(\sqrt{x} + \sqrt{y}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(x + 1\right) - x}{\sqrt{x} + \sqrt{x + 1}}\\
\end{array}
\end{array}
if y < 2Initial program 97.0%
associate-+l+97.0%
associate-+l-61.4%
associate-+l-97.0%
+-commutative97.0%
+-commutative97.0%
+-commutative97.0%
Simplified97.0%
Taylor expanded in t around inf 20.6%
associate--l+24.5%
Simplified24.5%
Taylor expanded in y around 0 20.5%
associate-+r+20.5%
associate-+r+20.5%
+-commutative20.5%
Simplified20.5%
Taylor expanded in x around 0 18.5%
associate--l+36.2%
associate-+r+36.2%
+-commutative36.2%
+-commutative36.2%
Simplified36.2%
if 2 < y Initial program 86.8%
associate-+l+86.8%
associate-+l-86.8%
associate-+l-86.8%
+-commutative86.8%
+-commutative86.8%
+-commutative86.8%
Simplified86.8%
Taylor expanded in t around inf 4.7%
associate--l+26.2%
Simplified26.2%
Taylor expanded in x around inf 24.8%
mul-1-neg24.8%
Simplified24.8%
+-commutative24.8%
sub-neg24.8%
flip--24.8%
add-sqr-sqrt24.8%
add-sqr-sqrt24.8%
Applied egg-rr24.8%
Final simplification30.8%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ x 1.0))))
(if (<= y 2.55e-225)
(- (+ (sqrt (+ 1.0 z)) (+ 1.0 t_1)) (sqrt y))
(if (<= y 0.95)
(- 2.0 (+ (sqrt x) (sqrt y)))
(/ (- (+ x 1.0) x) (+ (sqrt x) t_1))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((x + 1.0));
double tmp;
if (y <= 2.55e-225) {
tmp = (sqrt((1.0 + z)) + (1.0 + t_1)) - sqrt(y);
} else if (y <= 0.95) {
tmp = 2.0 - (sqrt(x) + sqrt(y));
} else {
tmp = ((x + 1.0) - x) / (sqrt(x) + t_1);
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = sqrt((x + 1.0d0))
if (y <= 2.55d-225) then
tmp = (sqrt((1.0d0 + z)) + (1.0d0 + t_1)) - sqrt(y)
else if (y <= 0.95d0) then
tmp = 2.0d0 - (sqrt(x) + sqrt(y))
else
tmp = ((x + 1.0d0) - x) / (sqrt(x) + t_1)
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((x + 1.0));
double tmp;
if (y <= 2.55e-225) {
tmp = (Math.sqrt((1.0 + z)) + (1.0 + t_1)) - Math.sqrt(y);
} else if (y <= 0.95) {
tmp = 2.0 - (Math.sqrt(x) + Math.sqrt(y));
} else {
tmp = ((x + 1.0) - x) / (Math.sqrt(x) + t_1);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((x + 1.0)) tmp = 0 if y <= 2.55e-225: tmp = (math.sqrt((1.0 + z)) + (1.0 + t_1)) - math.sqrt(y) elif y <= 0.95: tmp = 2.0 - (math.sqrt(x) + math.sqrt(y)) else: tmp = ((x + 1.0) - x) / (math.sqrt(x) + t_1) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(x + 1.0)) tmp = 0.0 if (y <= 2.55e-225) tmp = Float64(Float64(sqrt(Float64(1.0 + z)) + Float64(1.0 + t_1)) - sqrt(y)); elseif (y <= 0.95) tmp = Float64(2.0 - Float64(sqrt(x) + sqrt(y))); else tmp = Float64(Float64(Float64(x + 1.0) - x) / Float64(sqrt(x) + t_1)); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((x + 1.0));
tmp = 0.0;
if (y <= 2.55e-225)
tmp = (sqrt((1.0 + z)) + (1.0 + t_1)) - sqrt(y);
elseif (y <= 0.95)
tmp = 2.0 - (sqrt(x) + sqrt(y));
else
tmp = ((x + 1.0) - x) / (sqrt(x) + t_1);
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y, 2.55e-225], N[(N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] + N[(1.0 + t$95$1), $MachinePrecision]), $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 0.95], N[(2.0 - N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x + 1.0), $MachinePrecision] - x), $MachinePrecision] / N[(N[Sqrt[x], $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{x + 1}\\
\mathbf{if}\;y \leq 2.55 \cdot 10^{-225}:\\
\;\;\;\;\left(\sqrt{1 + z} + \left(1 + t\_1\right)\right) - \sqrt{y}\\
\mathbf{elif}\;y \leq 0.95:\\
\;\;\;\;2 - \left(\sqrt{x} + \sqrt{y}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(x + 1\right) - x}{\sqrt{x} + t\_1}\\
\end{array}
\end{array}
if y < 2.5499999999999999e-225Initial program 98.6%
associate-+l+98.6%
associate-+l-63.7%
associate-+l-98.6%
+-commutative98.6%
+-commutative98.6%
+-commutative98.6%
Simplified98.6%
Taylor expanded in t around inf 24.4%
associate--l+28.9%
Simplified28.9%
Taylor expanded in y around 0 24.4%
associate-+r+24.4%
associate-+r+24.4%
+-commutative24.4%
Simplified24.4%
Taylor expanded in y around inf 24.9%
if 2.5499999999999999e-225 < y < 0.94999999999999996Initial program 96.4%
associate-+l+96.4%
associate-+l-60.4%
associate-+l-96.4%
+-commutative96.4%
+-commutative96.4%
+-commutative96.4%
Simplified96.4%
Taylor expanded in t around inf 19.1%
associate--l+22.7%
Simplified22.7%
Taylor expanded in y around 0 18.9%
associate-+r+18.9%
associate-+r+18.9%
+-commutative18.9%
Simplified18.9%
Taylor expanded in z around inf 22.8%
associate--l+36.6%
+-commutative36.6%
Simplified36.6%
Taylor expanded in x around 0 19.7%
if 0.94999999999999996 < y Initial program 86.8%
associate-+l+86.8%
associate-+l-86.8%
associate-+l-86.8%
+-commutative86.8%
+-commutative86.8%
+-commutative86.8%
Simplified86.8%
Taylor expanded in t around inf 4.7%
associate--l+26.2%
Simplified26.2%
Taylor expanded in x around inf 24.8%
mul-1-neg24.8%
Simplified24.8%
+-commutative24.8%
sub-neg24.8%
flip--24.8%
add-sqr-sqrt24.8%
add-sqr-sqrt24.8%
Applied egg-rr24.8%
Final simplification22.9%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= y 1.0) (- 2.0 (+ (sqrt x) (sqrt y))) (/ (- (+ x 1.0) x) (+ (sqrt x) (sqrt (+ x 1.0))))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 1.0) {
tmp = 2.0 - (sqrt(x) + sqrt(y));
} else {
tmp = ((x + 1.0) - x) / (sqrt(x) + sqrt((x + 1.0)));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= 1.0d0) then
tmp = 2.0d0 - (sqrt(x) + sqrt(y))
else
tmp = ((x + 1.0d0) - x) / (sqrt(x) + sqrt((x + 1.0d0)))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= 1.0) {
tmp = 2.0 - (Math.sqrt(x) + Math.sqrt(y));
} else {
tmp = ((x + 1.0) - x) / (Math.sqrt(x) + Math.sqrt((x + 1.0)));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if y <= 1.0: tmp = 2.0 - (math.sqrt(x) + math.sqrt(y)) else: tmp = ((x + 1.0) - x) / (math.sqrt(x) + math.sqrt((x + 1.0))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (y <= 1.0) tmp = Float64(2.0 - Float64(sqrt(x) + sqrt(y))); else tmp = Float64(Float64(Float64(x + 1.0) - x) / Float64(sqrt(x) + sqrt(Float64(x + 1.0)))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (y <= 1.0)
tmp = 2.0 - (sqrt(x) + sqrt(y));
else
tmp = ((x + 1.0) - x) / (sqrt(x) + sqrt((x + 1.0)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[y, 1.0], N[(2.0 - N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x + 1.0), $MachinePrecision] - x), $MachinePrecision] / N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 1:\\
\;\;\;\;2 - \left(\sqrt{x} + \sqrt{y}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(x + 1\right) - x}{\sqrt{x} + \sqrt{x + 1}}\\
\end{array}
\end{array}
if y < 1Initial program 97.0%
associate-+l+97.0%
associate-+l-61.4%
associate-+l-97.0%
+-commutative97.0%
+-commutative97.0%
+-commutative97.0%
Simplified97.0%
Taylor expanded in t around inf 20.6%
associate--l+24.5%
Simplified24.5%
Taylor expanded in y around 0 20.5%
associate-+r+20.5%
associate-+r+20.5%
+-commutative20.5%
Simplified20.5%
Taylor expanded in z around inf 23.8%
associate--l+36.8%
+-commutative36.8%
Simplified36.8%
Taylor expanded in x around 0 21.4%
if 1 < y Initial program 86.8%
associate-+l+86.8%
associate-+l-86.8%
associate-+l-86.8%
+-commutative86.8%
+-commutative86.8%
+-commutative86.8%
Simplified86.8%
Taylor expanded in t around inf 4.7%
associate--l+26.2%
Simplified26.2%
Taylor expanded in x around inf 24.8%
mul-1-neg24.8%
Simplified24.8%
+-commutative24.8%
sub-neg24.8%
flip--24.8%
add-sqr-sqrt24.8%
add-sqr-sqrt24.8%
Applied egg-rr24.8%
Final simplification23.0%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= y 1.0) (- 2.0 (+ (sqrt x) (sqrt y))) (- (sqrt (+ x 1.0)) (sqrt x))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 1.0) {
tmp = 2.0 - (sqrt(x) + sqrt(y));
} else {
tmp = sqrt((x + 1.0)) - sqrt(x);
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= 1.0d0) then
tmp = 2.0d0 - (sqrt(x) + sqrt(y))
else
tmp = sqrt((x + 1.0d0)) - sqrt(x)
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= 1.0) {
tmp = 2.0 - (Math.sqrt(x) + Math.sqrt(y));
} else {
tmp = Math.sqrt((x + 1.0)) - Math.sqrt(x);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if y <= 1.0: tmp = 2.0 - (math.sqrt(x) + math.sqrt(y)) else: tmp = math.sqrt((x + 1.0)) - math.sqrt(x) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (y <= 1.0) tmp = Float64(2.0 - Float64(sqrt(x) + sqrt(y))); else tmp = Float64(sqrt(Float64(x + 1.0)) - sqrt(x)); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (y <= 1.0)
tmp = 2.0 - (sqrt(x) + sqrt(y));
else
tmp = sqrt((x + 1.0)) - sqrt(x);
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[y, 1.0], N[(2.0 - N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 1:\\
\;\;\;\;2 - \left(\sqrt{x} + \sqrt{y}\right)\\
\mathbf{else}:\\
\;\;\;\;\sqrt{x + 1} - \sqrt{x}\\
\end{array}
\end{array}
if y < 1Initial program 97.0%
associate-+l+97.0%
associate-+l-61.4%
associate-+l-97.0%
+-commutative97.0%
+-commutative97.0%
+-commutative97.0%
Simplified97.0%
Taylor expanded in t around inf 20.6%
associate--l+24.5%
Simplified24.5%
Taylor expanded in y around 0 20.5%
associate-+r+20.5%
associate-+r+20.5%
+-commutative20.5%
Simplified20.5%
Taylor expanded in z around inf 23.8%
associate--l+36.8%
+-commutative36.8%
Simplified36.8%
Taylor expanded in x around 0 21.4%
if 1 < y Initial program 86.8%
associate-+l+86.8%
associate-+l-86.8%
associate-+l-86.8%
+-commutative86.8%
+-commutative86.8%
+-commutative86.8%
Simplified86.8%
Taylor expanded in t around inf 4.7%
associate--l+26.2%
Simplified26.2%
Taylor expanded in x around inf 24.8%
mul-1-neg24.8%
Simplified24.8%
+-commutative24.8%
sub-neg24.8%
Applied egg-rr24.8%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= y 0.95) (- 2.0 (+ (sqrt x) (sqrt y))) (- (+ 1.0 (* x (+ 0.5 (* x (- (* x 0.0625) 0.125))))) (sqrt x))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 0.95) {
tmp = 2.0 - (sqrt(x) + sqrt(y));
} else {
tmp = (1.0 + (x * (0.5 + (x * ((x * 0.0625) - 0.125))))) - sqrt(x);
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= 0.95d0) then
tmp = 2.0d0 - (sqrt(x) + sqrt(y))
else
tmp = (1.0d0 + (x * (0.5d0 + (x * ((x * 0.0625d0) - 0.125d0))))) - sqrt(x)
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= 0.95) {
tmp = 2.0 - (Math.sqrt(x) + Math.sqrt(y));
} else {
tmp = (1.0 + (x * (0.5 + (x * ((x * 0.0625) - 0.125))))) - Math.sqrt(x);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if y <= 0.95: tmp = 2.0 - (math.sqrt(x) + math.sqrt(y)) else: tmp = (1.0 + (x * (0.5 + (x * ((x * 0.0625) - 0.125))))) - math.sqrt(x) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (y <= 0.95) tmp = Float64(2.0 - Float64(sqrt(x) + sqrt(y))); else tmp = Float64(Float64(1.0 + Float64(x * Float64(0.5 + Float64(x * Float64(Float64(x * 0.0625) - 0.125))))) - sqrt(x)); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (y <= 0.95)
tmp = 2.0 - (sqrt(x) + sqrt(y));
else
tmp = (1.0 + (x * (0.5 + (x * ((x * 0.0625) - 0.125))))) - sqrt(x);
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[y, 0.95], N[(2.0 - N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 + N[(x * N[(0.5 + N[(x * N[(N[(x * 0.0625), $MachinePrecision] - 0.125), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 0.95:\\
\;\;\;\;2 - \left(\sqrt{x} + \sqrt{y}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(1 + x \cdot \left(0.5 + x \cdot \left(x \cdot 0.0625 - 0.125\right)\right)\right) - \sqrt{x}\\
\end{array}
\end{array}
if y < 0.94999999999999996Initial program 97.0%
associate-+l+97.0%
associate-+l-61.4%
associate-+l-97.0%
+-commutative97.0%
+-commutative97.0%
+-commutative97.0%
Simplified97.0%
Taylor expanded in t around inf 20.6%
associate--l+24.5%
Simplified24.5%
Taylor expanded in y around 0 20.5%
associate-+r+20.5%
associate-+r+20.5%
+-commutative20.5%
Simplified20.5%
Taylor expanded in z around inf 23.8%
associate--l+36.8%
+-commutative36.8%
Simplified36.8%
Taylor expanded in x around 0 21.4%
if 0.94999999999999996 < y Initial program 86.8%
associate-+l+86.8%
associate-+l-86.8%
associate-+l-86.8%
+-commutative86.8%
+-commutative86.8%
+-commutative86.8%
Simplified86.8%
Taylor expanded in t around inf 4.7%
associate--l+26.2%
Simplified26.2%
Taylor expanded in x around inf 24.8%
mul-1-neg24.8%
Simplified24.8%
Taylor expanded in x around 0 25.0%
Final simplification23.1%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= x 1.3) (- (+ 1.0 (* x (+ 0.5 (* x (- (* x 0.0625) 0.125))))) (sqrt x)) (* 0.5 (sqrt (/ 1.0 x)))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (x <= 1.3) {
tmp = (1.0 + (x * (0.5 + (x * ((x * 0.0625) - 0.125))))) - sqrt(x);
} else {
tmp = 0.5 * sqrt((1.0 / x));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (x <= 1.3d0) then
tmp = (1.0d0 + (x * (0.5d0 + (x * ((x * 0.0625d0) - 0.125d0))))) - sqrt(x)
else
tmp = 0.5d0 * sqrt((1.0d0 / x))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (x <= 1.3) {
tmp = (1.0 + (x * (0.5 + (x * ((x * 0.0625) - 0.125))))) - Math.sqrt(x);
} else {
tmp = 0.5 * Math.sqrt((1.0 / x));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if x <= 1.3: tmp = (1.0 + (x * (0.5 + (x * ((x * 0.0625) - 0.125))))) - math.sqrt(x) else: tmp = 0.5 * math.sqrt((1.0 / x)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (x <= 1.3) tmp = Float64(Float64(1.0 + Float64(x * Float64(0.5 + Float64(x * Float64(Float64(x * 0.0625) - 0.125))))) - sqrt(x)); else tmp = Float64(0.5 * sqrt(Float64(1.0 / x))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (x <= 1.3)
tmp = (1.0 + (x * (0.5 + (x * ((x * 0.0625) - 0.125))))) - sqrt(x);
else
tmp = 0.5 * sqrt((1.0 / x));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[x, 1.3], N[(N[(1.0 + N[(x * N[(0.5 + N[(x * N[(N[(x * 0.0625), $MachinePrecision] - 0.125), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision], N[(0.5 * N[Sqrt[N[(1.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq 1.3:\\
\;\;\;\;\left(1 + x \cdot \left(0.5 + x \cdot \left(x \cdot 0.0625 - 0.125\right)\right)\right) - \sqrt{x}\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \sqrt{\frac{1}{x}}\\
\end{array}
\end{array}
if x < 1.30000000000000004Initial program 96.0%
associate-+l+96.0%
associate-+l-96.0%
associate-+l-96.0%
+-commutative96.0%
+-commutative96.0%
+-commutative96.0%
Simplified96.0%
Taylor expanded in t around inf 21.1%
associate--l+42.3%
Simplified42.3%
Taylor expanded in x around inf 29.7%
mul-1-neg29.7%
Simplified29.7%
Taylor expanded in x around 0 29.7%
if 1.30000000000000004 < x Initial program 87.8%
associate-+l+87.8%
associate-+l-46.9%
associate-+l-87.8%
+-commutative87.8%
+-commutative87.8%
+-commutative87.8%
Simplified87.8%
Taylor expanded in t around inf 3.7%
associate--l+5.4%
Simplified5.4%
Taylor expanded in x around inf 3.3%
mul-1-neg3.3%
Simplified3.3%
Taylor expanded in x around inf 9.0%
Final simplification20.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 (<= x 0.9) (- (+ 1.0 (* x (+ 0.5 (* x -0.125)))) (sqrt x)) (* 0.5 (sqrt (/ 1.0 x)))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (x <= 0.9) {
tmp = (1.0 + (x * (0.5 + (x * -0.125)))) - sqrt(x);
} else {
tmp = 0.5 * sqrt((1.0 / x));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (x <= 0.9d0) then
tmp = (1.0d0 + (x * (0.5d0 + (x * (-0.125d0))))) - sqrt(x)
else
tmp = 0.5d0 * sqrt((1.0d0 / x))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (x <= 0.9) {
tmp = (1.0 + (x * (0.5 + (x * -0.125)))) - Math.sqrt(x);
} else {
tmp = 0.5 * Math.sqrt((1.0 / x));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if x <= 0.9: tmp = (1.0 + (x * (0.5 + (x * -0.125)))) - math.sqrt(x) else: tmp = 0.5 * math.sqrt((1.0 / x)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (x <= 0.9) tmp = Float64(Float64(1.0 + Float64(x * Float64(0.5 + Float64(x * -0.125)))) - sqrt(x)); else tmp = Float64(0.5 * sqrt(Float64(1.0 / x))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (x <= 0.9)
tmp = (1.0 + (x * (0.5 + (x * -0.125)))) - sqrt(x);
else
tmp = 0.5 * sqrt((1.0 / x));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[x, 0.9], N[(N[(1.0 + N[(x * N[(0.5 + N[(x * -0.125), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision], N[(0.5 * N[Sqrt[N[(1.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq 0.9:\\
\;\;\;\;\left(1 + x \cdot \left(0.5 + x \cdot -0.125\right)\right) - \sqrt{x}\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \sqrt{\frac{1}{x}}\\
\end{array}
\end{array}
if x < 0.900000000000000022Initial program 96.0%
associate-+l+96.0%
associate-+l-96.0%
associate-+l-96.0%
+-commutative96.0%
+-commutative96.0%
+-commutative96.0%
Simplified96.0%
Taylor expanded in t around inf 21.1%
associate--l+42.3%
Simplified42.3%
Taylor expanded in x around inf 29.7%
mul-1-neg29.7%
Simplified29.7%
Taylor expanded in x around 0 29.6%
if 0.900000000000000022 < x Initial program 87.8%
associate-+l+87.8%
associate-+l-46.9%
associate-+l-87.8%
+-commutative87.8%
+-commutative87.8%
+-commutative87.8%
Simplified87.8%
Taylor expanded in t around inf 3.7%
associate--l+5.4%
Simplified5.4%
Taylor expanded in x around inf 3.3%
mul-1-neg3.3%
Simplified3.3%
Taylor expanded in x around inf 9.0%
Final simplification20.1%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= x 1.15) (+ 1.0 (- (* x 0.5) (sqrt x))) (* 0.5 (sqrt (/ 1.0 x)))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (x <= 1.15) {
tmp = 1.0 + ((x * 0.5) - sqrt(x));
} else {
tmp = 0.5 * sqrt((1.0 / x));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (x <= 1.15d0) then
tmp = 1.0d0 + ((x * 0.5d0) - sqrt(x))
else
tmp = 0.5d0 * sqrt((1.0d0 / x))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (x <= 1.15) {
tmp = 1.0 + ((x * 0.5) - Math.sqrt(x));
} else {
tmp = 0.5 * Math.sqrt((1.0 / x));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if x <= 1.15: tmp = 1.0 + ((x * 0.5) - math.sqrt(x)) else: tmp = 0.5 * math.sqrt((1.0 / x)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (x <= 1.15) tmp = Float64(1.0 + Float64(Float64(x * 0.5) - sqrt(x))); else tmp = Float64(0.5 * sqrt(Float64(1.0 / x))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (x <= 1.15)
tmp = 1.0 + ((x * 0.5) - sqrt(x));
else
tmp = 0.5 * sqrt((1.0 / x));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[x, 1.15], N[(1.0 + N[(N[(x * 0.5), $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.5 * N[Sqrt[N[(1.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq 1.15:\\
\;\;\;\;1 + \left(x \cdot 0.5 - \sqrt{x}\right)\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \sqrt{\frac{1}{x}}\\
\end{array}
\end{array}
if x < 1.1499999999999999Initial program 96.0%
associate-+l+96.0%
associate-+l-96.0%
associate-+l-96.0%
+-commutative96.0%
+-commutative96.0%
+-commutative96.0%
Simplified96.0%
Taylor expanded in t around inf 21.1%
associate--l+42.3%
Simplified42.3%
Taylor expanded in x around inf 29.7%
mul-1-neg29.7%
Simplified29.7%
Taylor expanded in x around 0 29.4%
associate--l+29.4%
*-commutative29.4%
Simplified29.4%
if 1.1499999999999999 < x Initial program 87.8%
associate-+l+87.8%
associate-+l-46.9%
associate-+l-87.8%
+-commutative87.8%
+-commutative87.8%
+-commutative87.8%
Simplified87.8%
Taylor expanded in t around inf 3.7%
associate--l+5.4%
Simplified5.4%
Taylor expanded in x around inf 3.3%
mul-1-neg3.3%
Simplified3.3%
Taylor expanded in x around inf 9.0%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= x 0.044) (- 1.0 (sqrt x)) (* 0.5 (sqrt (/ 1.0 x)))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (x <= 0.044) {
tmp = 1.0 - sqrt(x);
} else {
tmp = 0.5 * sqrt((1.0 / x));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (x <= 0.044d0) then
tmp = 1.0d0 - sqrt(x)
else
tmp = 0.5d0 * sqrt((1.0d0 / x))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (x <= 0.044) {
tmp = 1.0 - Math.sqrt(x);
} else {
tmp = 0.5 * Math.sqrt((1.0 / x));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if x <= 0.044: tmp = 1.0 - math.sqrt(x) else: tmp = 0.5 * math.sqrt((1.0 / x)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (x <= 0.044) tmp = Float64(1.0 - sqrt(x)); else tmp = Float64(0.5 * sqrt(Float64(1.0 / x))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (x <= 0.044)
tmp = 1.0 - sqrt(x);
else
tmp = 0.5 * sqrt((1.0 / x));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[x, 0.044], N[(1.0 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision], N[(0.5 * N[Sqrt[N[(1.0 / x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq 0.044:\\
\;\;\;\;1 - \sqrt{x}\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \sqrt{\frac{1}{x}}\\
\end{array}
\end{array}
if x < 0.043999999999999997Initial program 96.0%
associate-+l+96.0%
associate-+l-96.0%
associate-+l-96.0%
+-commutative96.0%
+-commutative96.0%
+-commutative96.0%
Simplified96.0%
Taylor expanded in t around inf 21.1%
associate--l+42.3%
Simplified42.3%
Taylor expanded in x around inf 29.7%
mul-1-neg29.7%
Simplified29.7%
Taylor expanded in x around 0 29.3%
if 0.043999999999999997 < x Initial program 87.8%
associate-+l+87.8%
associate-+l-46.9%
associate-+l-87.8%
+-commutative87.8%
+-commutative87.8%
+-commutative87.8%
Simplified87.8%
Taylor expanded in t around inf 3.7%
associate--l+5.4%
Simplified5.4%
Taylor expanded in x around inf 3.3%
mul-1-neg3.3%
Simplified3.3%
Taylor expanded in x around inf 9.0%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (- 1.0 (sqrt x)))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
return 1.0 - sqrt(x);
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = 1.0d0 - sqrt(x)
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
return 1.0 - Math.sqrt(x);
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): return 1.0 - math.sqrt(x)
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) return Float64(1.0 - sqrt(x)) end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp = code(x, y, z, t)
tmp = 1.0 - sqrt(x);
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := N[(1.0 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
1 - \sqrt{x}
\end{array}
Initial program 92.2%
associate-+l+92.2%
associate-+l-73.4%
associate-+l-92.2%
+-commutative92.2%
+-commutative92.2%
+-commutative92.2%
Simplified92.2%
Taylor expanded in t around inf 13.1%
associate--l+25.3%
Simplified25.3%
Taylor expanded in x around inf 17.5%
mul-1-neg17.5%
Simplified17.5%
Taylor expanded in x around 0 16.4%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (- (sqrt y)))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
return -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(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(y);
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): return -math.sqrt(y)
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) return Float64(-sqrt(y)) end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp = code(x, y, z, t)
tmp = -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[Sqrt[y], $MachinePrecision])
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
-\sqrt{y}
\end{array}
Initial program 92.2%
associate-+l+92.2%
associate-+l-73.4%
associate-+l-92.2%
+-commutative92.2%
+-commutative92.2%
+-commutative92.2%
Simplified92.2%
Taylor expanded in t around inf 13.1%
associate--l+25.3%
Simplified25.3%
Taylor expanded in y around 0 11.7%
associate-+r+11.7%
associate-+r+11.7%
+-commutative11.7%
Simplified11.7%
Taylor expanded in y around inf 1.6%
mul-1-neg1.6%
Simplified1.6%
(FPCore (x y z t)
:precision binary64
(+
(+
(+
(/ 1.0 (+ (sqrt (+ x 1.0)) (sqrt x)))
(/ 1.0 (+ (sqrt (+ y 1.0)) (sqrt y))))
(/ 1.0 (+ (sqrt (+ z 1.0)) (sqrt z))))
(- (sqrt (+ t 1.0)) (sqrt t))))
double code(double x, double y, double z, double t) {
return (((1.0 / (sqrt((x + 1.0)) + sqrt(x))) + (1.0 / (sqrt((y + 1.0)) + sqrt(y)))) + (1.0 / (sqrt((z + 1.0)) + sqrt(z)))) + (sqrt((t + 1.0)) - sqrt(t));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (((1.0d0 / (sqrt((x + 1.0d0)) + sqrt(x))) + (1.0d0 / (sqrt((y + 1.0d0)) + sqrt(y)))) + (1.0d0 / (sqrt((z + 1.0d0)) + sqrt(z)))) + (sqrt((t + 1.0d0)) - sqrt(t))
end function
public static double code(double x, double y, double z, double t) {
return (((1.0 / (Math.sqrt((x + 1.0)) + Math.sqrt(x))) + (1.0 / (Math.sqrt((y + 1.0)) + Math.sqrt(y)))) + (1.0 / (Math.sqrt((z + 1.0)) + Math.sqrt(z)))) + (Math.sqrt((t + 1.0)) - Math.sqrt(t));
}
def code(x, y, z, t): return (((1.0 / (math.sqrt((x + 1.0)) + math.sqrt(x))) + (1.0 / (math.sqrt((y + 1.0)) + math.sqrt(y)))) + (1.0 / (math.sqrt((z + 1.0)) + math.sqrt(z)))) + (math.sqrt((t + 1.0)) - math.sqrt(t))
function code(x, y, z, t) return Float64(Float64(Float64(Float64(1.0 / Float64(sqrt(Float64(x + 1.0)) + sqrt(x))) + Float64(1.0 / Float64(sqrt(Float64(y + 1.0)) + sqrt(y)))) + Float64(1.0 / Float64(sqrt(Float64(z + 1.0)) + sqrt(z)))) + Float64(sqrt(Float64(t + 1.0)) - sqrt(t))) end
function tmp = code(x, y, z, t) tmp = (((1.0 / (sqrt((x + 1.0)) + sqrt(x))) + (1.0 / (sqrt((y + 1.0)) + sqrt(y)))) + (1.0 / (sqrt((z + 1.0)) + sqrt(z)))) + (sqrt((t + 1.0)) - sqrt(t)); end
code[x_, y_, z_, t_] := N[(N[(N[(N[(1.0 / N[(N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[N[(z + 1.0), $MachinePrecision]], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(t + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\frac{1}{\sqrt{x + 1} + \sqrt{x}} + \frac{1}{\sqrt{y + 1} + \sqrt{y}}\right) + \frac{1}{\sqrt{z + 1} + \sqrt{z}}\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)
\end{array}
herbie shell --seed 2024144
(FPCore (x y z t)
:name "Main:z from "
:precision binary64
:alt
(! :herbie-platform default (+ (+ (+ (/ 1 (+ (sqrt (+ x 1)) (sqrt x))) (/ 1 (+ (sqrt (+ y 1)) (sqrt y)))) (/ 1 (+ (sqrt (+ z 1)) (sqrt z)))) (- (sqrt (+ t 1)) (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))))