
(FPCore (x y z t) :precision binary64 (+ (+ (+ (- (sqrt (+ x 1.0)) (sqrt x)) (- (sqrt (+ y 1.0)) (sqrt y))) (- (sqrt (+ z 1.0)) (sqrt z))) (- (sqrt (+ t 1.0)) (sqrt t))))
double code(double x, double y, double z, double t) {
return (((sqrt((x + 1.0)) - sqrt(x)) + (sqrt((y + 1.0)) - sqrt(y))) + (sqrt((z + 1.0)) - sqrt(z))) + (sqrt((t + 1.0)) - sqrt(t));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (((sqrt((x + 1.0d0)) - sqrt(x)) + (sqrt((y + 1.0d0)) - sqrt(y))) + (sqrt((z + 1.0d0)) - sqrt(z))) + (sqrt((t + 1.0d0)) - sqrt(t))
end function
public static double code(double x, double y, double z, double t) {
return (((Math.sqrt((x + 1.0)) - Math.sqrt(x)) + (Math.sqrt((y + 1.0)) - Math.sqrt(y))) + (Math.sqrt((z + 1.0)) - Math.sqrt(z))) + (Math.sqrt((t + 1.0)) - Math.sqrt(t));
}
def code(x, y, z, t): return (((math.sqrt((x + 1.0)) - math.sqrt(x)) + (math.sqrt((y + 1.0)) - math.sqrt(y))) + (math.sqrt((z + 1.0)) - math.sqrt(z))) + (math.sqrt((t + 1.0)) - math.sqrt(t))
function code(x, y, z, t) return Float64(Float64(Float64(Float64(sqrt(Float64(x + 1.0)) - sqrt(x)) + Float64(sqrt(Float64(y + 1.0)) - sqrt(y))) + Float64(sqrt(Float64(z + 1.0)) - sqrt(z))) + Float64(sqrt(Float64(t + 1.0)) - sqrt(t))) end
function tmp = code(x, y, z, t) tmp = (((sqrt((x + 1.0)) - sqrt(x)) + (sqrt((y + 1.0)) - sqrt(y))) + (sqrt((z + 1.0)) - sqrt(z))) + (sqrt((t + 1.0)) - sqrt(t)); end
code[x_, y_, z_, t_] := N[(N[(N[(N[(N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(z + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(t + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{y + 1} - \sqrt{y}\right)\right) + \left(\sqrt{z + 1} - \sqrt{z}\right)\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 24 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (+ (+ (+ (- (sqrt (+ x 1.0)) (sqrt x)) (- (sqrt (+ y 1.0)) (sqrt y))) (- (sqrt (+ z 1.0)) (sqrt z))) (- (sqrt (+ t 1.0)) (sqrt t))))
double code(double x, double y, double z, double t) {
return (((sqrt((x + 1.0)) - sqrt(x)) + (sqrt((y + 1.0)) - sqrt(y))) + (sqrt((z + 1.0)) - sqrt(z))) + (sqrt((t + 1.0)) - sqrt(t));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (((sqrt((x + 1.0d0)) - sqrt(x)) + (sqrt((y + 1.0d0)) - sqrt(y))) + (sqrt((z + 1.0d0)) - sqrt(z))) + (sqrt((t + 1.0d0)) - sqrt(t))
end function
public static double code(double x, double y, double z, double t) {
return (((Math.sqrt((x + 1.0)) - Math.sqrt(x)) + (Math.sqrt((y + 1.0)) - Math.sqrt(y))) + (Math.sqrt((z + 1.0)) - Math.sqrt(z))) + (Math.sqrt((t + 1.0)) - Math.sqrt(t));
}
def code(x, y, z, t): return (((math.sqrt((x + 1.0)) - math.sqrt(x)) + (math.sqrt((y + 1.0)) - math.sqrt(y))) + (math.sqrt((z + 1.0)) - math.sqrt(z))) + (math.sqrt((t + 1.0)) - math.sqrt(t))
function code(x, y, z, t) return Float64(Float64(Float64(Float64(sqrt(Float64(x + 1.0)) - sqrt(x)) + Float64(sqrt(Float64(y + 1.0)) - sqrt(y))) + Float64(sqrt(Float64(z + 1.0)) - sqrt(z))) + Float64(sqrt(Float64(t + 1.0)) - sqrt(t))) end
function tmp = code(x, y, z, t) tmp = (((sqrt((x + 1.0)) - sqrt(x)) + (sqrt((y + 1.0)) - sqrt(y))) + (sqrt((z + 1.0)) - sqrt(z))) + (sqrt((t + 1.0)) - sqrt(t)); end
code[x_, y_, z_, t_] := N[(N[(N[(N[(N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(z + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(t + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\sqrt{y + 1} - \sqrt{y}\right)\right) + \left(\sqrt{z + 1} - \sqrt{z}\right)\right) + \left(\sqrt{t + 1} - \sqrt{t}\right)
\end{array}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ 1.0 t)))
(t_2 (sqrt (+ 1.0 z)))
(t_3 (- t_2 (sqrt z)))
(t_4 (sqrt (+ x 1.0)))
(t_5 (- t_4 (sqrt x)))
(t_6 (sqrt (+ 1.0 y)))
(t_7 (- t_6 (sqrt y)))
(t_8 (+ (+ t_5 t_7) t_3)))
(if (<= t_8 0.001)
(+
(/ (+ (* -0.125 (sqrt (/ 1.0 x))) (* (sqrt x) 0.5)) x)
(+ t_7 (/ 1.0 (+ t_2 (sqrt z)))))
(if (<= t_8 2.00005)
(+
(+ t_5 (/ 1.0 (+ t_6 (sqrt y))))
(+ (* 0.5 (sqrt (/ 1.0 z))) (- t_1 (sqrt t))))
(+
(- (+ 1.0 t_4) (+ (sqrt x) (sqrt y)))
(+ t_3 (/ 1.0 (+ t_1 (sqrt t)))))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + t));
double t_2 = sqrt((1.0 + z));
double t_3 = t_2 - sqrt(z);
double t_4 = sqrt((x + 1.0));
double t_5 = t_4 - sqrt(x);
double t_6 = sqrt((1.0 + y));
double t_7 = t_6 - sqrt(y);
double t_8 = (t_5 + t_7) + t_3;
double tmp;
if (t_8 <= 0.001) {
tmp = (((-0.125 * sqrt((1.0 / x))) + (sqrt(x) * 0.5)) / x) + (t_7 + (1.0 / (t_2 + sqrt(z))));
} else if (t_8 <= 2.00005) {
tmp = (t_5 + (1.0 / (t_6 + sqrt(y)))) + ((0.5 * sqrt((1.0 / z))) + (t_1 - sqrt(t)));
} else {
tmp = ((1.0 + t_4) - (sqrt(x) + sqrt(y))) + (t_3 + (1.0 / (t_1 + sqrt(t))));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: t_5
real(8) :: t_6
real(8) :: t_7
real(8) :: t_8
real(8) :: tmp
t_1 = sqrt((1.0d0 + t))
t_2 = sqrt((1.0d0 + z))
t_3 = t_2 - sqrt(z)
t_4 = sqrt((x + 1.0d0))
t_5 = t_4 - sqrt(x)
t_6 = sqrt((1.0d0 + y))
t_7 = t_6 - sqrt(y)
t_8 = (t_5 + t_7) + t_3
if (t_8 <= 0.001d0) then
tmp = ((((-0.125d0) * sqrt((1.0d0 / x))) + (sqrt(x) * 0.5d0)) / x) + (t_7 + (1.0d0 / (t_2 + sqrt(z))))
else if (t_8 <= 2.00005d0) then
tmp = (t_5 + (1.0d0 / (t_6 + sqrt(y)))) + ((0.5d0 * sqrt((1.0d0 / z))) + (t_1 - sqrt(t)))
else
tmp = ((1.0d0 + t_4) - (sqrt(x) + sqrt(y))) + (t_3 + (1.0d0 / (t_1 + sqrt(t))))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + t));
double t_2 = Math.sqrt((1.0 + z));
double t_3 = t_2 - Math.sqrt(z);
double t_4 = Math.sqrt((x + 1.0));
double t_5 = t_4 - Math.sqrt(x);
double t_6 = Math.sqrt((1.0 + y));
double t_7 = t_6 - Math.sqrt(y);
double t_8 = (t_5 + t_7) + t_3;
double tmp;
if (t_8 <= 0.001) {
tmp = (((-0.125 * Math.sqrt((1.0 / x))) + (Math.sqrt(x) * 0.5)) / x) + (t_7 + (1.0 / (t_2 + Math.sqrt(z))));
} else if (t_8 <= 2.00005) {
tmp = (t_5 + (1.0 / (t_6 + Math.sqrt(y)))) + ((0.5 * Math.sqrt((1.0 / z))) + (t_1 - Math.sqrt(t)));
} else {
tmp = ((1.0 + t_4) - (Math.sqrt(x) + Math.sqrt(y))) + (t_3 + (1.0 / (t_1 + Math.sqrt(t))));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + t)) t_2 = math.sqrt((1.0 + z)) t_3 = t_2 - math.sqrt(z) t_4 = math.sqrt((x + 1.0)) t_5 = t_4 - math.sqrt(x) t_6 = math.sqrt((1.0 + y)) t_7 = t_6 - math.sqrt(y) t_8 = (t_5 + t_7) + t_3 tmp = 0 if t_8 <= 0.001: tmp = (((-0.125 * math.sqrt((1.0 / x))) + (math.sqrt(x) * 0.5)) / x) + (t_7 + (1.0 / (t_2 + math.sqrt(z)))) elif t_8 <= 2.00005: tmp = (t_5 + (1.0 / (t_6 + math.sqrt(y)))) + ((0.5 * math.sqrt((1.0 / z))) + (t_1 - math.sqrt(t))) else: tmp = ((1.0 + t_4) - (math.sqrt(x) + math.sqrt(y))) + (t_3 + (1.0 / (t_1 + math.sqrt(t)))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(1.0 + t)) t_2 = sqrt(Float64(1.0 + z)) t_3 = Float64(t_2 - sqrt(z)) t_4 = sqrt(Float64(x + 1.0)) t_5 = Float64(t_4 - sqrt(x)) t_6 = sqrt(Float64(1.0 + y)) t_7 = Float64(t_6 - sqrt(y)) t_8 = Float64(Float64(t_5 + t_7) + t_3) tmp = 0.0 if (t_8 <= 0.001) tmp = Float64(Float64(Float64(Float64(-0.125 * sqrt(Float64(1.0 / x))) + Float64(sqrt(x) * 0.5)) / x) + Float64(t_7 + Float64(1.0 / Float64(t_2 + sqrt(z))))); elseif (t_8 <= 2.00005) tmp = Float64(Float64(t_5 + Float64(1.0 / Float64(t_6 + sqrt(y)))) + Float64(Float64(0.5 * sqrt(Float64(1.0 / z))) + Float64(t_1 - sqrt(t)))); else tmp = Float64(Float64(Float64(1.0 + t_4) - Float64(sqrt(x) + sqrt(y))) + Float64(t_3 + Float64(1.0 / Float64(t_1 + sqrt(t))))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + t));
t_2 = sqrt((1.0 + z));
t_3 = t_2 - sqrt(z);
t_4 = sqrt((x + 1.0));
t_5 = t_4 - sqrt(x);
t_6 = sqrt((1.0 + y));
t_7 = t_6 - sqrt(y);
t_8 = (t_5 + t_7) + t_3;
tmp = 0.0;
if (t_8 <= 0.001)
tmp = (((-0.125 * sqrt((1.0 / x))) + (sqrt(x) * 0.5)) / x) + (t_7 + (1.0 / (t_2 + sqrt(z))));
elseif (t_8 <= 2.00005)
tmp = (t_5 + (1.0 / (t_6 + sqrt(y)))) + ((0.5 * sqrt((1.0 / z))) + (t_1 - sqrt(t)));
else
tmp = ((1.0 + t_4) - (sqrt(x) + sqrt(y))) + (t_3 + (1.0 / (t_1 + sqrt(t))));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[(t$95$2 - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$5 = N[(t$95$4 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$6 = N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$7 = N[(t$95$6 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$8 = N[(N[(t$95$5 + t$95$7), $MachinePrecision] + t$95$3), $MachinePrecision]}, If[LessEqual[t$95$8, 0.001], N[(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] + N[(t$95$7 + N[(1.0 / N[(t$95$2 + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$8, 2.00005], N[(N[(t$95$5 + N[(1.0 / N[(t$95$6 + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(0.5 * N[Sqrt[N[(1.0 / z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(t$95$1 - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 + t$95$4), $MachinePrecision] - N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$3 + N[(1.0 / N[(t$95$1 + N[Sqrt[t], $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 + t}\\
t_2 := \sqrt{1 + z}\\
t_3 := t\_2 - \sqrt{z}\\
t_4 := \sqrt{x + 1}\\
t_5 := t\_4 - \sqrt{x}\\
t_6 := \sqrt{1 + y}\\
t_7 := t\_6 - \sqrt{y}\\
t_8 := \left(t\_5 + t\_7\right) + t\_3\\
\mathbf{if}\;t\_8 \leq 0.001:\\
\;\;\;\;\frac{-0.125 \cdot \sqrt{\frac{1}{x}} + \sqrt{x} \cdot 0.5}{x} + \left(t\_7 + \frac{1}{t\_2 + \sqrt{z}}\right)\\
\mathbf{elif}\;t\_8 \leq 2.00005:\\
\;\;\;\;\left(t\_5 + \frac{1}{t\_6 + \sqrt{y}}\right) + \left(0.5 \cdot \sqrt{\frac{1}{z}} + \left(t\_1 - \sqrt{t}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(1 + t\_4\right) - \left(\sqrt{x} + \sqrt{y}\right)\right) + \left(t\_3 + \frac{1}{t\_1 + \sqrt{t}}\right)\\
\end{array}
\end{array}
if (+.f64 (+.f64 (-.f64 (sqrt.f64 (+.f64 x #s(literal 1 binary64))) (sqrt.f64 x)) (-.f64 (sqrt.f64 (+.f64 y #s(literal 1 binary64))) (sqrt.f64 y))) (-.f64 (sqrt.f64 (+.f64 z #s(literal 1 binary64))) (sqrt.f64 z))) < 1e-3Initial program 41.6%
associate-+l+41.6%
associate-+l+41.6%
+-commutative41.6%
+-commutative41.6%
associate-+l-39.8%
+-commutative39.8%
+-commutative39.8%
Simplified39.8%
associate--r-41.6%
+-commutative41.6%
flip--41.5%
flip--41.5%
frac-add41.4%
Applied egg-rr44.4%
Simplified70.6%
Taylor expanded in t around inf 14.9%
Taylor expanded in x around inf 38.4%
if 1e-3 < (+.f64 (+.f64 (-.f64 (sqrt.f64 (+.f64 x #s(literal 1 binary64))) (sqrt.f64 x)) (-.f64 (sqrt.f64 (+.f64 y #s(literal 1 binary64))) (sqrt.f64 y))) (-.f64 (sqrt.f64 (+.f64 z #s(literal 1 binary64))) (sqrt.f64 z))) < 2.0000499999999999Initial program 96.1%
associate-+l+96.1%
sub-neg96.1%
sub-neg96.1%
+-commutative96.1%
+-commutative96.1%
+-commutative96.1%
Simplified96.1%
Taylor expanded in z around inf 55.6%
flip--55.7%
add-sqr-sqrt47.1%
add-sqr-sqrt55.8%
Applied egg-rr55.8%
associate--l+55.8%
+-inverses55.8%
metadata-eval55.8%
Simplified55.8%
if 2.0000499999999999 < (+.f64 (+.f64 (-.f64 (sqrt.f64 (+.f64 x #s(literal 1 binary64))) (sqrt.f64 x)) (-.f64 (sqrt.f64 (+.f64 y #s(literal 1 binary64))) (sqrt.f64 y))) (-.f64 (sqrt.f64 (+.f64 z #s(literal 1 binary64))) (sqrt.f64 z))) Initial program 97.2%
associate-+l+97.2%
sub-neg97.2%
sub-neg97.2%
+-commutative97.2%
+-commutative97.2%
+-commutative97.2%
Simplified97.2%
Taylor expanded in y around 0 89.9%
flip--90.5%
add-sqr-sqrt75.5%
add-sqr-sqrt90.5%
Applied egg-rr90.5%
associate--l+91.5%
+-inverses91.5%
metadata-eval91.5%
Simplified91.5%
Final simplification59.1%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (+ (sqrt (+ 1.0 t)) (sqrt t)))
(t_2 (+ (sqrt (+ 1.0 z)) (sqrt z)))
(t_3 (- (sqrt (+ 1.0 y)) (sqrt y))))
(if (<= x 165000.0)
(+ (- (sqrt (+ x 1.0)) (sqrt x)) (+ t_3 (/ (+ t_1 t_2) (* t_1 t_2))))
(+
(/ (+ (* -0.125 (sqrt (/ 1.0 x))) (* (sqrt x) 0.5)) x)
(+ t_3 (/ 1.0 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 + t)) + sqrt(t);
double t_2 = sqrt((1.0 + z)) + sqrt(z);
double t_3 = sqrt((1.0 + y)) - sqrt(y);
double tmp;
if (x <= 165000.0) {
tmp = (sqrt((x + 1.0)) - sqrt(x)) + (t_3 + ((t_1 + t_2) / (t_1 * t_2)));
} else {
tmp = (((-0.125 * sqrt((1.0 / x))) + (sqrt(x) * 0.5)) / x) + (t_3 + (1.0 / 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) :: tmp
t_1 = sqrt((1.0d0 + t)) + sqrt(t)
t_2 = sqrt((1.0d0 + z)) + sqrt(z)
t_3 = sqrt((1.0d0 + y)) - sqrt(y)
if (x <= 165000.0d0) then
tmp = (sqrt((x + 1.0d0)) - sqrt(x)) + (t_3 + ((t_1 + t_2) / (t_1 * t_2)))
else
tmp = ((((-0.125d0) * sqrt((1.0d0 / x))) + (sqrt(x) * 0.5d0)) / x) + (t_3 + (1.0d0 / 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 + t)) + Math.sqrt(t);
double t_2 = Math.sqrt((1.0 + z)) + Math.sqrt(z);
double t_3 = Math.sqrt((1.0 + y)) - Math.sqrt(y);
double tmp;
if (x <= 165000.0) {
tmp = (Math.sqrt((x + 1.0)) - Math.sqrt(x)) + (t_3 + ((t_1 + t_2) / (t_1 * t_2)));
} else {
tmp = (((-0.125 * Math.sqrt((1.0 / x))) + (Math.sqrt(x) * 0.5)) / x) + (t_3 + (1.0 / 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 + t)) + math.sqrt(t) t_2 = math.sqrt((1.0 + z)) + math.sqrt(z) t_3 = math.sqrt((1.0 + y)) - math.sqrt(y) tmp = 0 if x <= 165000.0: tmp = (math.sqrt((x + 1.0)) - math.sqrt(x)) + (t_3 + ((t_1 + t_2) / (t_1 * t_2))) else: tmp = (((-0.125 * math.sqrt((1.0 / x))) + (math.sqrt(x) * 0.5)) / x) + (t_3 + (1.0 / t_2)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = Float64(sqrt(Float64(1.0 + t)) + sqrt(t)) t_2 = Float64(sqrt(Float64(1.0 + z)) + sqrt(z)) t_3 = Float64(sqrt(Float64(1.0 + y)) - sqrt(y)) tmp = 0.0 if (x <= 165000.0) tmp = Float64(Float64(sqrt(Float64(x + 1.0)) - sqrt(x)) + Float64(t_3 + Float64(Float64(t_1 + t_2) / Float64(t_1 * t_2)))); else tmp = Float64(Float64(Float64(Float64(-0.125 * sqrt(Float64(1.0 / x))) + Float64(sqrt(x) * 0.5)) / x) + Float64(t_3 + Float64(1.0 / 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 + t)) + sqrt(t);
t_2 = sqrt((1.0 + z)) + sqrt(z);
t_3 = sqrt((1.0 + y)) - sqrt(y);
tmp = 0.0;
if (x <= 165000.0)
tmp = (sqrt((x + 1.0)) - sqrt(x)) + (t_3 + ((t_1 + t_2) / (t_1 * t_2)));
else
tmp = (((-0.125 * sqrt((1.0 / x))) + (sqrt(x) * 0.5)) / x) + (t_3 + (1.0 / t_2));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] + N[Sqrt[t], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, 165000.0], N[(N[(N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(t$95$3 + N[(N[(t$95$1 + t$95$2), $MachinePrecision] / N[(t$95$1 * t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(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] + N[(t$95$3 + N[(1.0 / t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + t} + \sqrt{t}\\
t_2 := \sqrt{1 + z} + \sqrt{z}\\
t_3 := \sqrt{1 + y} - \sqrt{y}\\
\mathbf{if}\;x \leq 165000:\\
\;\;\;\;\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(t\_3 + \frac{t\_1 + t\_2}{t\_1 \cdot t\_2}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{-0.125 \cdot \sqrt{\frac{1}{x}} + \sqrt{x} \cdot 0.5}{x} + \left(t\_3 + \frac{1}{t\_2}\right)\\
\end{array}
\end{array}
if x < 165000Initial program 96.6%
associate-+l+96.6%
associate-+l+96.6%
+-commutative96.6%
+-commutative96.6%
associate-+l-79.8%
+-commutative79.8%
+-commutative79.8%
Simplified79.8%
associate--r-96.6%
+-commutative96.6%
flip--97.1%
flip--97.2%
frac-add97.2%
Applied egg-rr98.3%
Simplified98.9%
if 165000 < x Initial program 83.2%
associate-+l+83.2%
associate-+l+83.2%
+-commutative83.2%
+-commutative83.2%
associate-+l-61.5%
+-commutative61.5%
+-commutative61.5%
Simplified61.5%
associate--r-83.2%
+-commutative83.2%
flip--83.3%
flip--83.2%
frac-add83.2%
Applied egg-rr84.5%
Simplified91.3%
Taylor expanded in t around inf 54.1%
Taylor expanded in x around inf 60.6%
Final simplification81.6%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (sqrt (+ 1.0 y)) (sqrt y))) (t_2 (sqrt (+ 1.0 z))))
(if (<= x 0.84)
(+
(+ t_1 (+ 1.0 (- (* x 0.5) (sqrt x))))
(+ (- (sqrt (+ 1.0 t)) (sqrt t)) (- t_2 (sqrt z))))
(+
(/ (+ (* -0.125 (sqrt (/ 1.0 x))) (* (sqrt x) 0.5)) x)
(+ t_1 (/ 1.0 (+ t_2 (sqrt z))))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + y)) - sqrt(y);
double t_2 = sqrt((1.0 + z));
double tmp;
if (x <= 0.84) {
tmp = (t_1 + (1.0 + ((x * 0.5) - sqrt(x)))) + ((sqrt((1.0 + t)) - sqrt(t)) + (t_2 - sqrt(z)));
} else {
tmp = (((-0.125 * sqrt((1.0 / x))) + (sqrt(x) * 0.5)) / x) + (t_1 + (1.0 / (t_2 + sqrt(z))));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = sqrt((1.0d0 + y)) - sqrt(y)
t_2 = sqrt((1.0d0 + z))
if (x <= 0.84d0) then
tmp = (t_1 + (1.0d0 + ((x * 0.5d0) - sqrt(x)))) + ((sqrt((1.0d0 + t)) - sqrt(t)) + (t_2 - sqrt(z)))
else
tmp = ((((-0.125d0) * sqrt((1.0d0 / x))) + (sqrt(x) * 0.5d0)) / x) + (t_1 + (1.0d0 / (t_2 + sqrt(z))))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + y)) - Math.sqrt(y);
double t_2 = Math.sqrt((1.0 + z));
double tmp;
if (x <= 0.84) {
tmp = (t_1 + (1.0 + ((x * 0.5) - Math.sqrt(x)))) + ((Math.sqrt((1.0 + t)) - Math.sqrt(t)) + (t_2 - Math.sqrt(z)));
} else {
tmp = (((-0.125 * Math.sqrt((1.0 / x))) + (Math.sqrt(x) * 0.5)) / x) + (t_1 + (1.0 / (t_2 + Math.sqrt(z))));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + y)) - math.sqrt(y) t_2 = math.sqrt((1.0 + z)) tmp = 0 if x <= 0.84: tmp = (t_1 + (1.0 + ((x * 0.5) - math.sqrt(x)))) + ((math.sqrt((1.0 + t)) - math.sqrt(t)) + (t_2 - math.sqrt(z))) else: tmp = (((-0.125 * math.sqrt((1.0 / x))) + (math.sqrt(x) * 0.5)) / x) + (t_1 + (1.0 / (t_2 + 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(1.0 + z)) tmp = 0.0 if (x <= 0.84) tmp = Float64(Float64(t_1 + Float64(1.0 + Float64(Float64(x * 0.5) - sqrt(x)))) + Float64(Float64(sqrt(Float64(1.0 + t)) - sqrt(t)) + Float64(t_2 - sqrt(z)))); else tmp = Float64(Float64(Float64(Float64(-0.125 * sqrt(Float64(1.0 / x))) + Float64(sqrt(x) * 0.5)) / x) + Float64(t_1 + Float64(1.0 / Float64(t_2 + sqrt(z))))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + y)) - sqrt(y);
t_2 = sqrt((1.0 + z));
tmp = 0.0;
if (x <= 0.84)
tmp = (t_1 + (1.0 + ((x * 0.5) - sqrt(x)))) + ((sqrt((1.0 + t)) - sqrt(t)) + (t_2 - sqrt(z)));
else
tmp = (((-0.125 * sqrt((1.0 / x))) + (sqrt(x) * 0.5)) / x) + (t_1 + (1.0 / (t_2 + sqrt(z))));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x, 0.84], N[(N[(t$95$1 + N[(1.0 + N[(N[(x * 0.5), $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision] + N[(t$95$2 - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(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] + N[(t$95$1 + N[(1.0 / N[(t$95$2 + 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{1 + z}\\
\mathbf{if}\;x \leq 0.84:\\
\;\;\;\;\left(t\_1 + \left(1 + \left(x \cdot 0.5 - \sqrt{x}\right)\right)\right) + \left(\left(\sqrt{1 + t} - \sqrt{t}\right) + \left(t\_2 - \sqrt{z}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{-0.125 \cdot \sqrt{\frac{1}{x}} + \sqrt{x} \cdot 0.5}{x} + \left(t\_1 + \frac{1}{t\_2 + \sqrt{z}}\right)\\
\end{array}
\end{array}
if x < 0.839999999999999969Initial program 96.8%
associate-+l+96.8%
sub-neg96.8%
sub-neg96.8%
+-commutative96.8%
+-commutative96.8%
+-commutative96.8%
Simplified96.8%
Taylor expanded in x around 0 96.1%
associate--l+96.1%
*-commutative96.1%
Simplified96.1%
if 0.839999999999999969 < x Initial program 83.3%
associate-+l+83.3%
associate-+l+83.3%
+-commutative83.3%
+-commutative83.3%
associate-+l-61.5%
+-commutative61.5%
+-commutative61.5%
Simplified61.5%
associate--r-83.3%
+-commutative83.3%
flip--83.4%
flip--83.3%
frac-add83.3%
Applied egg-rr84.9%
Simplified91.4%
Taylor expanded in t around inf 53.9%
Taylor expanded in x around inf 59.7%
Final simplification79.2%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1
(+
(- (sqrt (+ 1.0 y)) (sqrt y))
(/ 1.0 (+ (sqrt (+ 1.0 z)) (sqrt z))))))
(if (<= (- (sqrt (+ x 1.0)) (sqrt x)) 0.001)
(+ t_1 (* (sqrt (/ 1.0 x)) 0.5))
(+ t_1 (+ 1.0 (- (* x 0.5) (sqrt x)))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = (sqrt((1.0 + y)) - sqrt(y)) + (1.0 / (sqrt((1.0 + z)) + sqrt(z)));
double tmp;
if ((sqrt((x + 1.0)) - sqrt(x)) <= 0.001) {
tmp = t_1 + (sqrt((1.0 / x)) * 0.5);
} else {
tmp = t_1 + (1.0 + ((x * 0.5) - sqrt(x)));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = (sqrt((1.0d0 + y)) - sqrt(y)) + (1.0d0 / (sqrt((1.0d0 + z)) + sqrt(z)))
if ((sqrt((x + 1.0d0)) - sqrt(x)) <= 0.001d0) then
tmp = t_1 + (sqrt((1.0d0 / x)) * 0.5d0)
else
tmp = t_1 + (1.0d0 + ((x * 0.5d0) - sqrt(x)))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = (Math.sqrt((1.0 + y)) - Math.sqrt(y)) + (1.0 / (Math.sqrt((1.0 + z)) + Math.sqrt(z)));
double tmp;
if ((Math.sqrt((x + 1.0)) - Math.sqrt(x)) <= 0.001) {
tmp = t_1 + (Math.sqrt((1.0 / x)) * 0.5);
} else {
tmp = t_1 + (1.0 + ((x * 0.5) - Math.sqrt(x)));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = (math.sqrt((1.0 + y)) - math.sqrt(y)) + (1.0 / (math.sqrt((1.0 + z)) + math.sqrt(z))) tmp = 0 if (math.sqrt((x + 1.0)) - math.sqrt(x)) <= 0.001: tmp = t_1 + (math.sqrt((1.0 / x)) * 0.5) else: tmp = t_1 + (1.0 + ((x * 0.5) - math.sqrt(x))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = Float64(Float64(sqrt(Float64(1.0 + y)) - sqrt(y)) + Float64(1.0 / Float64(sqrt(Float64(1.0 + z)) + sqrt(z)))) tmp = 0.0 if (Float64(sqrt(Float64(x + 1.0)) - sqrt(x)) <= 0.001) tmp = Float64(t_1 + Float64(sqrt(Float64(1.0 / x)) * 0.5)); else tmp = Float64(t_1 + Float64(1.0 + Float64(Float64(x * 0.5) - sqrt(x)))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = (sqrt((1.0 + y)) - sqrt(y)) + (1.0 / (sqrt((1.0 + z)) + sqrt(z)));
tmp = 0.0;
if ((sqrt((x + 1.0)) - sqrt(x)) <= 0.001)
tmp = t_1 + (sqrt((1.0 / x)) * 0.5);
else
tmp = t_1 + (1.0 + ((x * 0.5) - sqrt(x)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision], 0.001], N[(t$95$1 + N[(N[Sqrt[N[(1.0 / x), $MachinePrecision]], $MachinePrecision] * 0.5), $MachinePrecision]), $MachinePrecision], N[(t$95$1 + N[(1.0 + N[(N[(x * 0.5), $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \left(\sqrt{1 + y} - \sqrt{y}\right) + \frac{1}{\sqrt{1 + z} + \sqrt{z}}\\
\mathbf{if}\;\sqrt{x + 1} - \sqrt{x} \leq 0.001:\\
\;\;\;\;t\_1 + \sqrt{\frac{1}{x}} \cdot 0.5\\
\mathbf{else}:\\
\;\;\;\;t\_1 + \left(1 + \left(x \cdot 0.5 - \sqrt{x}\right)\right)\\
\end{array}
\end{array}
if (-.f64 (sqrt.f64 (+.f64 x #s(literal 1 binary64))) (sqrt.f64 x)) < 1e-3Initial program 83.2%
associate-+l+83.2%
associate-+l+83.2%
+-commutative83.2%
+-commutative83.2%
associate-+l-61.5%
+-commutative61.5%
+-commutative61.5%
Simplified61.5%
associate--r-83.2%
+-commutative83.2%
flip--83.3%
flip--83.2%
frac-add83.2%
Applied egg-rr84.5%
Simplified91.3%
Taylor expanded in t around inf 54.1%
Taylor expanded in x around inf 60.6%
if 1e-3 < (-.f64 (sqrt.f64 (+.f64 x #s(literal 1 binary64))) (sqrt.f64 x)) Initial program 96.6%
associate-+l+96.6%
associate-+l+96.6%
+-commutative96.6%
+-commutative96.6%
associate-+l-79.8%
+-commutative79.8%
+-commutative79.8%
Simplified79.8%
associate--r-96.6%
+-commutative96.6%
flip--97.1%
flip--97.2%
frac-add97.2%
Applied egg-rr98.3%
Simplified98.9%
Taylor expanded in t around inf 55.4%
Taylor expanded in x around 0 54.5%
associate--l+94.4%
*-commutative94.4%
Simplified54.5%
Final simplification57.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 1.0)) (sqrt x)))
(t_2 (- (sqrt (+ 1.0 y)) (sqrt y))))
(if (<= t_1 5e-6)
(+ (+ t_2 (/ 1.0 (+ (sqrt (+ 1.0 z)) (sqrt z)))) (* (sqrt (/ 1.0 x)) 0.5))
(+ t_1 (+ t_2 (/ 1.0 (+ 1.0 (sqrt z))))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((x + 1.0)) - sqrt(x);
double t_2 = sqrt((1.0 + y)) - sqrt(y);
double tmp;
if (t_1 <= 5e-6) {
tmp = (t_2 + (1.0 / (sqrt((1.0 + z)) + sqrt(z)))) + (sqrt((1.0 / x)) * 0.5);
} else {
tmp = t_1 + (t_2 + (1.0 / (1.0 + 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((x + 1.0d0)) - sqrt(x)
t_2 = sqrt((1.0d0 + y)) - sqrt(y)
if (t_1 <= 5d-6) then
tmp = (t_2 + (1.0d0 / (sqrt((1.0d0 + z)) + sqrt(z)))) + (sqrt((1.0d0 / x)) * 0.5d0)
else
tmp = t_1 + (t_2 + (1.0d0 / (1.0d0 + 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((x + 1.0)) - Math.sqrt(x);
double t_2 = Math.sqrt((1.0 + y)) - Math.sqrt(y);
double tmp;
if (t_1 <= 5e-6) {
tmp = (t_2 + (1.0 / (Math.sqrt((1.0 + z)) + Math.sqrt(z)))) + (Math.sqrt((1.0 / x)) * 0.5);
} else {
tmp = t_1 + (t_2 + (1.0 / (1.0 + Math.sqrt(z))));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((x + 1.0)) - math.sqrt(x) t_2 = math.sqrt((1.0 + y)) - math.sqrt(y) tmp = 0 if t_1 <= 5e-6: tmp = (t_2 + (1.0 / (math.sqrt((1.0 + z)) + math.sqrt(z)))) + (math.sqrt((1.0 / x)) * 0.5) else: tmp = t_1 + (t_2 + (1.0 / (1.0 + 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(x + 1.0)) - sqrt(x)) t_2 = Float64(sqrt(Float64(1.0 + y)) - sqrt(y)) tmp = 0.0 if (t_1 <= 5e-6) tmp = Float64(Float64(t_2 + Float64(1.0 / Float64(sqrt(Float64(1.0 + z)) + sqrt(z)))) + Float64(sqrt(Float64(1.0 / x)) * 0.5)); else tmp = Float64(t_1 + Float64(t_2 + Float64(1.0 / Float64(1.0 + 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((x + 1.0)) - sqrt(x);
t_2 = sqrt((1.0 + y)) - sqrt(y);
tmp = 0.0;
if (t_1 <= 5e-6)
tmp = (t_2 + (1.0 / (sqrt((1.0 + z)) + sqrt(z)))) + (sqrt((1.0 / x)) * 0.5);
else
tmp = t_1 + (t_2 + (1.0 / (1.0 + 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[(x + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, 5e-6], N[(N[(t$95$2 + N[(1.0 / N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(1.0 / x), $MachinePrecision]], $MachinePrecision] * 0.5), $MachinePrecision]), $MachinePrecision], N[(t$95$1 + N[(t$95$2 + N[(1.0 / N[(1.0 + 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{x + 1} - \sqrt{x}\\
t_2 := \sqrt{1 + y} - \sqrt{y}\\
\mathbf{if}\;t\_1 \leq 5 \cdot 10^{-6}:\\
\;\;\;\;\left(t\_2 + \frac{1}{\sqrt{1 + z} + \sqrt{z}}\right) + \sqrt{\frac{1}{x}} \cdot 0.5\\
\mathbf{else}:\\
\;\;\;\;t\_1 + \left(t\_2 + \frac{1}{1 + \sqrt{z}}\right)\\
\end{array}
\end{array}
if (-.f64 (sqrt.f64 (+.f64 x #s(literal 1 binary64))) (sqrt.f64 x)) < 5.00000000000000041e-6Initial program 83.1%
associate-+l+83.1%
associate-+l+83.1%
+-commutative83.1%
+-commutative83.1%
associate-+l-61.9%
+-commutative61.9%
+-commutative61.9%
Simplified61.9%
associate--r-83.1%
+-commutative83.1%
flip--83.2%
flip--83.2%
frac-add83.2%
Applied egg-rr84.5%
Simplified91.5%
Taylor expanded in t around inf 54.2%
Taylor expanded in x around inf 60.7%
if 5.00000000000000041e-6 < (-.f64 (sqrt.f64 (+.f64 x #s(literal 1 binary64))) (sqrt.f64 x)) Initial program 96.3%
associate-+l+96.3%
associate-+l+96.3%
+-commutative96.3%
+-commutative96.3%
associate-+l-79.0%
+-commutative79.0%
+-commutative79.0%
Simplified79.0%
associate--r-96.3%
+-commutative96.3%
flip--96.8%
flip--96.9%
frac-add96.9%
Applied egg-rr97.9%
Simplified98.5%
Taylor expanded in t around inf 55.3%
Taylor expanded in z around 0 54.7%
Final simplification57.3%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ 1.0 z))) (t_2 (sqrt (+ 1.0 y))))
(if (<= x 0.48)
(+
(+ (- (sqrt (+ 1.0 t)) (sqrt t)) (- t_1 (sqrt z)))
(+ 1.0 (- t_2 (+ (sqrt x) (sqrt y)))))
(+
(/ (+ (* -0.125 (sqrt (/ 1.0 x))) (* (sqrt x) 0.5)) x)
(+ (- t_2 (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((1.0 + y));
double tmp;
if (x <= 0.48) {
tmp = ((sqrt((1.0 + t)) - sqrt(t)) + (t_1 - sqrt(z))) + (1.0 + (t_2 - (sqrt(x) + sqrt(y))));
} else {
tmp = (((-0.125 * sqrt((1.0 / x))) + (sqrt(x) * 0.5)) / x) + ((t_2 - 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((1.0d0 + y))
if (x <= 0.48d0) then
tmp = ((sqrt((1.0d0 + t)) - sqrt(t)) + (t_1 - sqrt(z))) + (1.0d0 + (t_2 - (sqrt(x) + sqrt(y))))
else
tmp = ((((-0.125d0) * sqrt((1.0d0 / x))) + (sqrt(x) * 0.5d0)) / x) + ((t_2 - 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((1.0 + y));
double tmp;
if (x <= 0.48) {
tmp = ((Math.sqrt((1.0 + t)) - Math.sqrt(t)) + (t_1 - Math.sqrt(z))) + (1.0 + (t_2 - (Math.sqrt(x) + Math.sqrt(y))));
} else {
tmp = (((-0.125 * Math.sqrt((1.0 / x))) + (Math.sqrt(x) * 0.5)) / x) + ((t_2 - 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((1.0 + y)) tmp = 0 if x <= 0.48: tmp = ((math.sqrt((1.0 + t)) - math.sqrt(t)) + (t_1 - math.sqrt(z))) + (1.0 + (t_2 - (math.sqrt(x) + math.sqrt(y)))) else: tmp = (((-0.125 * math.sqrt((1.0 / x))) + (math.sqrt(x) * 0.5)) / x) + ((t_2 - 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(1.0 + y)) tmp = 0.0 if (x <= 0.48) tmp = Float64(Float64(Float64(sqrt(Float64(1.0 + t)) - sqrt(t)) + Float64(t_1 - sqrt(z))) + Float64(1.0 + Float64(t_2 - Float64(sqrt(x) + sqrt(y))))); else tmp = Float64(Float64(Float64(Float64(-0.125 * sqrt(Float64(1.0 / x))) + Float64(sqrt(x) * 0.5)) / x) + Float64(Float64(t_2 - 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((1.0 + y));
tmp = 0.0;
if (x <= 0.48)
tmp = ((sqrt((1.0 + t)) - sqrt(t)) + (t_1 - sqrt(z))) + (1.0 + (t_2 - (sqrt(x) + sqrt(y))));
else
tmp = (((-0.125 * sqrt((1.0 / x))) + (sqrt(x) * 0.5)) / x) + ((t_2 - 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[(1.0 + y), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x, 0.48], N[(N[(N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision] + N[(t$95$1 - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 + N[(t$95$2 - N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(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] + N[(N[(t$95$2 - 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{1 + y}\\
\mathbf{if}\;x \leq 0.48:\\
\;\;\;\;\left(\left(\sqrt{1 + t} - \sqrt{t}\right) + \left(t\_1 - \sqrt{z}\right)\right) + \left(1 + \left(t\_2 - \left(\sqrt{x} + \sqrt{y}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{-0.125 \cdot \sqrt{\frac{1}{x}} + \sqrt{x} \cdot 0.5}{x} + \left(\left(t\_2 - \sqrt{y}\right) + \frac{1}{t\_1 + \sqrt{z}}\right)\\
\end{array}
\end{array}
if x < 0.47999999999999998Initial program 96.8%
associate-+l+96.8%
sub-neg96.8%
sub-neg96.8%
+-commutative96.8%
+-commutative96.8%
+-commutative96.8%
Simplified96.8%
Taylor expanded in x around 0 57.2%
associate--l+95.2%
Simplified95.2%
if 0.47999999999999998 < x Initial program 83.3%
associate-+l+83.3%
associate-+l+83.3%
+-commutative83.3%
+-commutative83.3%
associate-+l-61.5%
+-commutative61.5%
+-commutative61.5%
Simplified61.5%
associate--r-83.3%
+-commutative83.3%
flip--83.4%
flip--83.3%
frac-add83.3%
Applied egg-rr84.9%
Simplified91.4%
Taylor expanded in t around inf 53.9%
Taylor expanded in x around inf 59.7%
Final simplification78.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))))
(if (<= t 1.35e+21)
(+
2.0
(-
(+ (sqrt (+ 1.0 t)) t_1)
(+ (sqrt t) (+ (sqrt x) (+ (sqrt y) (sqrt z))))))
(+
(+ (- (sqrt (+ 1.0 y)) (sqrt y)) (/ 1.0 (+ t_1 (sqrt z))))
(/ (- (+ 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 t_1 = sqrt((1.0 + z));
double tmp;
if (t <= 1.35e+21) {
tmp = 2.0 + ((sqrt((1.0 + t)) + t_1) - (sqrt(t) + (sqrt(x) + (sqrt(y) + sqrt(z)))));
} else {
tmp = ((sqrt((1.0 + y)) - sqrt(y)) + (1.0 / (t_1 + sqrt(z)))) + (((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) :: t_1
real(8) :: tmp
t_1 = sqrt((1.0d0 + z))
if (t <= 1.35d+21) then
tmp = 2.0d0 + ((sqrt((1.0d0 + t)) + t_1) - (sqrt(t) + (sqrt(x) + (sqrt(y) + sqrt(z)))))
else
tmp = ((sqrt((1.0d0 + y)) - sqrt(y)) + (1.0d0 / (t_1 + sqrt(z)))) + (((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 t_1 = Math.sqrt((1.0 + z));
double tmp;
if (t <= 1.35e+21) {
tmp = 2.0 + ((Math.sqrt((1.0 + t)) + t_1) - (Math.sqrt(t) + (Math.sqrt(x) + (Math.sqrt(y) + Math.sqrt(z)))));
} else {
tmp = ((Math.sqrt((1.0 + y)) - Math.sqrt(y)) + (1.0 / (t_1 + Math.sqrt(z)))) + (((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): t_1 = math.sqrt((1.0 + z)) tmp = 0 if t <= 1.35e+21: tmp = 2.0 + ((math.sqrt((1.0 + t)) + t_1) - (math.sqrt(t) + (math.sqrt(x) + (math.sqrt(y) + math.sqrt(z))))) else: tmp = ((math.sqrt((1.0 + y)) - math.sqrt(y)) + (1.0 / (t_1 + math.sqrt(z)))) + (((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) t_1 = sqrt(Float64(1.0 + z)) tmp = 0.0 if (t <= 1.35e+21) tmp = Float64(2.0 + Float64(Float64(sqrt(Float64(1.0 + t)) + t_1) - Float64(sqrt(t) + Float64(sqrt(x) + Float64(sqrt(y) + sqrt(z)))))); else tmp = Float64(Float64(Float64(sqrt(Float64(1.0 + y)) - sqrt(y)) + Float64(1.0 / Float64(t_1 + sqrt(z)))) + 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)
t_1 = sqrt((1.0 + z));
tmp = 0.0;
if (t <= 1.35e+21)
tmp = 2.0 + ((sqrt((1.0 + t)) + t_1) - (sqrt(t) + (sqrt(x) + (sqrt(y) + sqrt(z)))));
else
tmp = ((sqrt((1.0 + y)) - sqrt(y)) + (1.0 / (t_1 + sqrt(z)))) + (((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_] := Block[{t$95$1 = N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t, 1.35e+21], N[(2.0 + N[(N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] + t$95$1), $MachinePrecision] - N[(N[Sqrt[t], $MachinePrecision] + N[(N[Sqrt[x], $MachinePrecision] + N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(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] + N[(N[(N[(x + 1.0), $MachinePrecision] - x), $MachinePrecision] / N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[N[(x + 1.0), $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 1.35 \cdot 10^{+21}:\\
\;\;\;\;2 + \left(\left(\sqrt{1 + t} + t\_1\right) - \left(\sqrt{t} + \left(\sqrt{x} + \left(\sqrt{y} + \sqrt{z}\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\sqrt{1 + y} - \sqrt{y}\right) + \frac{1}{t\_1 + \sqrt{z}}\right) + \frac{\left(x + 1\right) - x}{\sqrt{x} + \sqrt{x + 1}}\\
\end{array}
\end{array}
if t < 1.35e21Initial program 95.2%
associate-+l+95.2%
sub-neg95.2%
sub-neg95.2%
+-commutative95.2%
+-commutative95.2%
+-commutative95.2%
Simplified95.2%
Taylor expanded in y around 0 39.7%
Taylor expanded in x around 0 17.4%
associate--l+28.2%
+-commutative28.2%
Simplified28.2%
if 1.35e21 < t Initial program 85.8%
associate-+l+85.8%
associate-+l+85.8%
+-commutative85.8%
+-commutative85.8%
associate-+l-47.8%
+-commutative47.8%
+-commutative47.8%
Simplified47.8%
associate--r-85.8%
+-commutative85.8%
flip--85.8%
flip--85.8%
frac-add85.8%
Applied egg-rr87.2%
Simplified92.8%
Taylor expanded in t around inf 88.5%
flip--88.8%
add-sqr-sqrt66.7%
add-sqr-sqrt88.8%
Applied egg-rr88.8%
Final simplification58.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 1.35e+21)
(+
2.0
(-
(+ (sqrt (+ 1.0 t)) t_1)
(+ (sqrt t) (+ (sqrt x) (+ (sqrt y) (sqrt z))))))
(+
(- (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 <= 1.35e+21) {
tmp = 2.0 + ((sqrt((1.0 + t)) + t_1) - (sqrt(t) + (sqrt(x) + (sqrt(y) + sqrt(z)))));
} 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 <= 1.35d+21) then
tmp = 2.0d0 + ((sqrt((1.0d0 + t)) + t_1) - (sqrt(t) + (sqrt(x) + (sqrt(y) + sqrt(z)))))
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 <= 1.35e+21) {
tmp = 2.0 + ((Math.sqrt((1.0 + t)) + t_1) - (Math.sqrt(t) + (Math.sqrt(x) + (Math.sqrt(y) + Math.sqrt(z)))));
} 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 <= 1.35e+21: tmp = 2.0 + ((math.sqrt((1.0 + t)) + t_1) - (math.sqrt(t) + (math.sqrt(x) + (math.sqrt(y) + math.sqrt(z))))) 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 <= 1.35e+21) tmp = Float64(2.0 + Float64(Float64(sqrt(Float64(1.0 + t)) + t_1) - Float64(sqrt(t) + Float64(sqrt(x) + Float64(sqrt(y) + sqrt(z)))))); 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 <= 1.35e+21)
tmp = 2.0 + ((sqrt((1.0 + t)) + t_1) - (sqrt(t) + (sqrt(x) + (sqrt(y) + sqrt(z)))));
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, 1.35e+21], N[(2.0 + N[(N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] + t$95$1), $MachinePrecision] - N[(N[Sqrt[t], $MachinePrecision] + N[(N[Sqrt[x], $MachinePrecision] + N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $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 1.35 \cdot 10^{+21}:\\
\;\;\;\;2 + \left(\left(\sqrt{1 + t} + t\_1\right) - \left(\sqrt{t} + \left(\sqrt{x} + \left(\sqrt{y} + \sqrt{z}\right)\right)\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 < 1.35e21Initial program 95.2%
associate-+l+95.2%
sub-neg95.2%
sub-neg95.2%
+-commutative95.2%
+-commutative95.2%
+-commutative95.2%
Simplified95.2%
Taylor expanded in y around 0 39.7%
Taylor expanded in x around 0 17.4%
associate--l+28.2%
+-commutative28.2%
Simplified28.2%
if 1.35e21 < t Initial program 85.8%
associate-+l+85.8%
associate-+l+85.8%
+-commutative85.8%
+-commutative85.8%
associate-+l-47.8%
+-commutative47.8%
+-commutative47.8%
Simplified47.8%
associate--r-85.8%
+-commutative85.8%
flip--85.8%
flip--85.8%
frac-add85.8%
Applied egg-rr87.2%
Simplified92.8%
Taylor expanded in t around inf 88.5%
Final simplification58.3%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ 1.0 z))))
(if (<= t 1.35e+21)
(+
2.0
(-
(+ (sqrt (+ 1.0 t)) t_1)
(+ (sqrt t) (+ (sqrt x) (+ (sqrt y) (sqrt z))))))
(+
(+ (- (sqrt (+ 1.0 y)) (sqrt y)) (/ 1.0 (+ t_1 (sqrt z))))
(+ 1.0 (- (* x 0.5) (sqrt x)))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + z));
double tmp;
if (t <= 1.35e+21) {
tmp = 2.0 + ((sqrt((1.0 + t)) + t_1) - (sqrt(t) + (sqrt(x) + (sqrt(y) + sqrt(z)))));
} else {
tmp = ((sqrt((1.0 + y)) - sqrt(y)) + (1.0 / (t_1 + sqrt(z)))) + (1.0 + ((x * 0.5) - sqrt(x)));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = sqrt((1.0d0 + z))
if (t <= 1.35d+21) then
tmp = 2.0d0 + ((sqrt((1.0d0 + t)) + t_1) - (sqrt(t) + (sqrt(x) + (sqrt(y) + sqrt(z)))))
else
tmp = ((sqrt((1.0d0 + y)) - sqrt(y)) + (1.0d0 / (t_1 + sqrt(z)))) + (1.0d0 + ((x * 0.5d0) - sqrt(x)))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + z));
double tmp;
if (t <= 1.35e+21) {
tmp = 2.0 + ((Math.sqrt((1.0 + t)) + t_1) - (Math.sqrt(t) + (Math.sqrt(x) + (Math.sqrt(y) + Math.sqrt(z)))));
} else {
tmp = ((Math.sqrt((1.0 + y)) - Math.sqrt(y)) + (1.0 / (t_1 + Math.sqrt(z)))) + (1.0 + ((x * 0.5) - Math.sqrt(x)));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + z)) tmp = 0 if t <= 1.35e+21: tmp = 2.0 + ((math.sqrt((1.0 + t)) + t_1) - (math.sqrt(t) + (math.sqrt(x) + (math.sqrt(y) + math.sqrt(z))))) else: tmp = ((math.sqrt((1.0 + y)) - math.sqrt(y)) + (1.0 / (t_1 + math.sqrt(z)))) + (1.0 + ((x * 0.5) - math.sqrt(x))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(1.0 + z)) tmp = 0.0 if (t <= 1.35e+21) tmp = Float64(2.0 + Float64(Float64(sqrt(Float64(1.0 + t)) + t_1) - Float64(sqrt(t) + Float64(sqrt(x) + Float64(sqrt(y) + sqrt(z)))))); else tmp = Float64(Float64(Float64(sqrt(Float64(1.0 + y)) - sqrt(y)) + Float64(1.0 / Float64(t_1 + sqrt(z)))) + Float64(1.0 + Float64(Float64(x * 0.5) - sqrt(x)))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + z));
tmp = 0.0;
if (t <= 1.35e+21)
tmp = 2.0 + ((sqrt((1.0 + t)) + t_1) - (sqrt(t) + (sqrt(x) + (sqrt(y) + sqrt(z)))));
else
tmp = ((sqrt((1.0 + y)) - sqrt(y)) + (1.0 / (t_1 + sqrt(z)))) + (1.0 + ((x * 0.5) - sqrt(x)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t, 1.35e+21], N[(2.0 + N[(N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] + t$95$1), $MachinePrecision] - N[(N[Sqrt[t], $MachinePrecision] + N[(N[Sqrt[x], $MachinePrecision] + N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(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] + N[(1.0 + N[(N[(x * 0.5), $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + z}\\
\mathbf{if}\;t \leq 1.35 \cdot 10^{+21}:\\
\;\;\;\;2 + \left(\left(\sqrt{1 + t} + t\_1\right) - \left(\sqrt{t} + \left(\sqrt{x} + \left(\sqrt{y} + \sqrt{z}\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\sqrt{1 + y} - \sqrt{y}\right) + \frac{1}{t\_1 + \sqrt{z}}\right) + \left(1 + \left(x \cdot 0.5 - \sqrt{x}\right)\right)\\
\end{array}
\end{array}
if t < 1.35e21Initial program 95.2%
associate-+l+95.2%
sub-neg95.2%
sub-neg95.2%
+-commutative95.2%
+-commutative95.2%
+-commutative95.2%
Simplified95.2%
Taylor expanded in y around 0 39.7%
Taylor expanded in x around 0 17.4%
associate--l+28.2%
+-commutative28.2%
Simplified28.2%
if 1.35e21 < t Initial program 85.8%
associate-+l+85.8%
associate-+l+85.8%
+-commutative85.8%
+-commutative85.8%
associate-+l-47.8%
+-commutative47.8%
+-commutative47.8%
Simplified47.8%
associate--r-85.8%
+-commutative85.8%
flip--85.8%
flip--85.8%
frac-add85.8%
Applied egg-rr87.2%
Simplified92.8%
Taylor expanded in t around inf 88.5%
Taylor expanded in x around 0 48.6%
associate--l+48.1%
*-commutative48.1%
Simplified48.6%
Final simplification38.4%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ 1.0 y))))
(if (<= y 1.02e-7)
(-
(+ (/ 1.0 (+ (sqrt (+ 1.0 z)) (sqrt z))) (+ 1.0 t_1))
(+ (sqrt x) (sqrt y)))
(+
(- (sqrt (+ x 1.0)) (sqrt x))
(+ (- t_1 (sqrt y)) (/ 1.0 (+ 1.0 (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));
double tmp;
if (y <= 1.02e-7) {
tmp = ((1.0 / (sqrt((1.0 + z)) + sqrt(z))) + (1.0 + t_1)) - (sqrt(x) + sqrt(y));
} else {
tmp = (sqrt((x + 1.0)) - sqrt(x)) + ((t_1 - sqrt(y)) + (1.0 / (1.0 + 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 + y))
if (y <= 1.02d-7) then
tmp = ((1.0d0 / (sqrt((1.0d0 + z)) + sqrt(z))) + (1.0d0 + t_1)) - (sqrt(x) + sqrt(y))
else
tmp = (sqrt((x + 1.0d0)) - sqrt(x)) + ((t_1 - sqrt(y)) + (1.0d0 / (1.0d0 + 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));
double tmp;
if (y <= 1.02e-7) {
tmp = ((1.0 / (Math.sqrt((1.0 + z)) + Math.sqrt(z))) + (1.0 + t_1)) - (Math.sqrt(x) + Math.sqrt(y));
} else {
tmp = (Math.sqrt((x + 1.0)) - Math.sqrt(x)) + ((t_1 - Math.sqrt(y)) + (1.0 / (1.0 + 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)) tmp = 0 if y <= 1.02e-7: tmp = ((1.0 / (math.sqrt((1.0 + z)) + math.sqrt(z))) + (1.0 + t_1)) - (math.sqrt(x) + math.sqrt(y)) else: tmp = (math.sqrt((x + 1.0)) - math.sqrt(x)) + ((t_1 - math.sqrt(y)) + (1.0 / (1.0 + 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 + y)) tmp = 0.0 if (y <= 1.02e-7) tmp = Float64(Float64(Float64(1.0 / Float64(sqrt(Float64(1.0 + z)) + sqrt(z))) + Float64(1.0 + t_1)) - Float64(sqrt(x) + sqrt(y))); else tmp = Float64(Float64(sqrt(Float64(x + 1.0)) - sqrt(x)) + Float64(Float64(t_1 - sqrt(y)) + Float64(1.0 / Float64(1.0 + 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));
tmp = 0.0;
if (y <= 1.02e-7)
tmp = ((1.0 / (sqrt((1.0 + z)) + sqrt(z))) + (1.0 + t_1)) - (sqrt(x) + sqrt(y));
else
tmp = (sqrt((x + 1.0)) - sqrt(x)) + ((t_1 - sqrt(y)) + (1.0 / (1.0 + 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 + y), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y, 1.02e-7], N[(N[(N[(1.0 / N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 + t$95$1), $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$1 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(1.0 + 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}\\
\mathbf{if}\;y \leq 1.02 \cdot 10^{-7}:\\
\;\;\;\;\left(\frac{1}{\sqrt{1 + z} + \sqrt{z}} + \left(1 + t\_1\right)\right) - \left(\sqrt{x} + \sqrt{y}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\left(t\_1 - \sqrt{y}\right) + \frac{1}{1 + \sqrt{z}}\right)\\
\end{array}
\end{array}
if y < 1.02e-7Initial program 96.2%
associate-+l+96.2%
associate-+l+96.2%
+-commutative96.2%
+-commutative96.2%
associate-+l-79.2%
+-commutative79.2%
+-commutative79.2%
Simplified79.2%
associate--r-96.2%
+-commutative96.2%
flip--96.5%
flip--96.7%
frac-add96.7%
Applied egg-rr98.3%
Simplified99.3%
Taylor expanded in t around inf 61.5%
Taylor expanded in x around 0 27.5%
associate-+r+27.5%
Simplified27.5%
if 1.02e-7 < y Initial program 85.3%
associate-+l+85.3%
associate-+l+85.3%
+-commutative85.3%
+-commutative85.3%
associate-+l-64.4%
+-commutative64.4%
+-commutative64.4%
Simplified64.4%
associate--r-85.3%
+-commutative85.3%
flip--85.6%
flip--85.5%
frac-add85.5%
Applied egg-rr86.3%
Simplified91.9%
Taylor expanded in t around inf 48.6%
Taylor expanded in z around 0 47.0%
Final simplification37.7%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ 1.0 y))))
(if (<= y 1.48e-8)
(-
(+ 1.0 (+ t_1 (/ 1.0 (+ (sqrt (+ 1.0 z)) (sqrt z)))))
(+ (sqrt x) (sqrt y)))
(+
(- (sqrt (+ x 1.0)) (sqrt x))
(+ (- t_1 (sqrt y)) (/ 1.0 (+ 1.0 (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));
double tmp;
if (y <= 1.48e-8) {
tmp = (1.0 + (t_1 + (1.0 / (sqrt((1.0 + z)) + sqrt(z))))) - (sqrt(x) + sqrt(y));
} else {
tmp = (sqrt((x + 1.0)) - sqrt(x)) + ((t_1 - sqrt(y)) + (1.0 / (1.0 + 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 + y))
if (y <= 1.48d-8) then
tmp = (1.0d0 + (t_1 + (1.0d0 / (sqrt((1.0d0 + z)) + sqrt(z))))) - (sqrt(x) + sqrt(y))
else
tmp = (sqrt((x + 1.0d0)) - sqrt(x)) + ((t_1 - sqrt(y)) + (1.0d0 / (1.0d0 + 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));
double tmp;
if (y <= 1.48e-8) {
tmp = (1.0 + (t_1 + (1.0 / (Math.sqrt((1.0 + z)) + Math.sqrt(z))))) - (Math.sqrt(x) + Math.sqrt(y));
} else {
tmp = (Math.sqrt((x + 1.0)) - Math.sqrt(x)) + ((t_1 - Math.sqrt(y)) + (1.0 / (1.0 + 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)) tmp = 0 if y <= 1.48e-8: tmp = (1.0 + (t_1 + (1.0 / (math.sqrt((1.0 + z)) + math.sqrt(z))))) - (math.sqrt(x) + math.sqrt(y)) else: tmp = (math.sqrt((x + 1.0)) - math.sqrt(x)) + ((t_1 - math.sqrt(y)) + (1.0 / (1.0 + 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 + y)) tmp = 0.0 if (y <= 1.48e-8) tmp = Float64(Float64(1.0 + Float64(t_1 + Float64(1.0 / Float64(sqrt(Float64(1.0 + z)) + sqrt(z))))) - Float64(sqrt(x) + sqrt(y))); else tmp = Float64(Float64(sqrt(Float64(x + 1.0)) - sqrt(x)) + Float64(Float64(t_1 - sqrt(y)) + Float64(1.0 / Float64(1.0 + 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));
tmp = 0.0;
if (y <= 1.48e-8)
tmp = (1.0 + (t_1 + (1.0 / (sqrt((1.0 + z)) + sqrt(z))))) - (sqrt(x) + sqrt(y));
else
tmp = (sqrt((x + 1.0)) - sqrt(x)) + ((t_1 - sqrt(y)) + (1.0 / (1.0 + 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 + y), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y, 1.48e-8], N[(N[(1.0 + N[(t$95$1 + N[(1.0 / N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$1 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(1.0 + 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}\\
\mathbf{if}\;y \leq 1.48 \cdot 10^{-8}:\\
\;\;\;\;\left(1 + \left(t\_1 + \frac{1}{\sqrt{1 + z} + \sqrt{z}}\right)\right) - \left(\sqrt{x} + \sqrt{y}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\sqrt{x + 1} - \sqrt{x}\right) + \left(\left(t\_1 - \sqrt{y}\right) + \frac{1}{1 + \sqrt{z}}\right)\\
\end{array}
\end{array}
if y < 1.48e-8Initial program 96.2%
associate-+l+96.2%
associate-+l+96.2%
+-commutative96.2%
+-commutative96.2%
associate-+l-79.2%
+-commutative79.2%
+-commutative79.2%
Simplified79.2%
associate--r-96.2%
+-commutative96.2%
flip--96.5%
flip--96.7%
frac-add96.7%
Applied egg-rr98.3%
Simplified99.3%
Taylor expanded in t around inf 61.5%
Taylor expanded in x around 0 27.5%
if 1.48e-8 < y Initial program 85.3%
associate-+l+85.3%
associate-+l+85.3%
+-commutative85.3%
+-commutative85.3%
associate-+l-64.4%
+-commutative64.4%
+-commutative64.4%
Simplified64.4%
associate--r-85.3%
+-commutative85.3%
flip--85.6%
flip--85.5%
frac-add85.5%
Applied egg-rr86.3%
Simplified91.9%
Taylor expanded in t around inf 48.6%
Taylor expanded in z around 0 47.0%
Final simplification37.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 (+ x 1.0))))
(if (<= z 5.2e+27)
(+
(/ 1.0 (+ (sqrt (+ 1.0 z)) (sqrt z)))
(- (+ 1.0 t_1) (+ (sqrt x) (sqrt y))))
(+
(- t_1 (sqrt x))
(+ (- (sqrt (+ 1.0 y)) (sqrt y)) (/ 1.0 (+ 1.0 (sqrt z))))))))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 (z <= 5.2e+27) {
tmp = (1.0 / (sqrt((1.0 + z)) + sqrt(z))) + ((1.0 + t_1) - (sqrt(x) + sqrt(y)));
} else {
tmp = (t_1 - sqrt(x)) + ((sqrt((1.0 + y)) - sqrt(y)) + (1.0 / (1.0 + 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((x + 1.0d0))
if (z <= 5.2d+27) then
tmp = (1.0d0 / (sqrt((1.0d0 + z)) + sqrt(z))) + ((1.0d0 + t_1) - (sqrt(x) + sqrt(y)))
else
tmp = (t_1 - sqrt(x)) + ((sqrt((1.0d0 + y)) - sqrt(y)) + (1.0d0 / (1.0d0 + 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((x + 1.0));
double tmp;
if (z <= 5.2e+27) {
tmp = (1.0 / (Math.sqrt((1.0 + z)) + Math.sqrt(z))) + ((1.0 + t_1) - (Math.sqrt(x) + Math.sqrt(y)));
} else {
tmp = (t_1 - Math.sqrt(x)) + ((Math.sqrt((1.0 + y)) - Math.sqrt(y)) + (1.0 / (1.0 + Math.sqrt(z))));
}
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 z <= 5.2e+27: tmp = (1.0 / (math.sqrt((1.0 + z)) + math.sqrt(z))) + ((1.0 + t_1) - (math.sqrt(x) + math.sqrt(y))) else: tmp = (t_1 - math.sqrt(x)) + ((math.sqrt((1.0 + y)) - math.sqrt(y)) + (1.0 / (1.0 + math.sqrt(z)))) 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 (z <= 5.2e+27) tmp = Float64(Float64(1.0 / Float64(sqrt(Float64(1.0 + z)) + sqrt(z))) + Float64(Float64(1.0 + t_1) - Float64(sqrt(x) + sqrt(y)))); else tmp = Float64(Float64(t_1 - sqrt(x)) + Float64(Float64(sqrt(Float64(1.0 + y)) - sqrt(y)) + Float64(1.0 / Float64(1.0 + 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((x + 1.0));
tmp = 0.0;
if (z <= 5.2e+27)
tmp = (1.0 / (sqrt((1.0 + z)) + sqrt(z))) + ((1.0 + t_1) - (sqrt(x) + sqrt(y)));
else
tmp = (t_1 - sqrt(x)) + ((sqrt((1.0 + y)) - sqrt(y)) + (1.0 / (1.0 + 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[(x + 1.0), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[z, 5.2e+27], N[(N[(1.0 / N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 + t$95$1), $MachinePrecision] - N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(t$95$1 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(1.0 + 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{x + 1}\\
\mathbf{if}\;z \leq 5.2 \cdot 10^{+27}:\\
\;\;\;\;\frac{1}{\sqrt{1 + z} + \sqrt{z}} + \left(\left(1 + t\_1\right) - \left(\sqrt{x} + \sqrt{y}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(t\_1 - \sqrt{x}\right) + \left(\left(\sqrt{1 + y} - \sqrt{y}\right) + \frac{1}{1 + \sqrt{z}}\right)\\
\end{array}
\end{array}
if z < 5.20000000000000018e27Initial program 94.4%
associate-+l+94.4%
sub-neg94.4%
sub-neg94.4%
+-commutative94.4%
+-commutative94.4%
+-commutative94.4%
Simplified94.4%
Taylor expanded in y around 0 39.6%
Taylor expanded in t around inf 24.9%
flip--24.9%
add-sqr-sqrt24.9%
add-sqr-sqrt25.3%
Applied egg-rr25.3%
associate--l+25.3%
+-inverses25.3%
metadata-eval25.3%
Simplified25.3%
if 5.20000000000000018e27 < z Initial program 85.8%
associate-+l+85.8%
associate-+l+85.8%
+-commutative85.8%
+-commutative85.8%
associate-+l-85.8%
+-commutative85.8%
+-commutative85.8%
Simplified85.8%
associate--r-85.8%
+-commutative85.8%
flip--85.8%
flip--85.8%
frac-add85.8%
Applied egg-rr86.3%
Simplified92.5%
Taylor expanded in t around inf 51.9%
Taylor expanded in z around 0 51.2%
Final simplification36.9%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(if (<= z 2500000.0)
(-
(+ 1.0 (+ (sqrt (+ x 1.0)) (+ (sqrt (+ 1.0 z)) (* 0.5 (sqrt (/ 1.0 t))))))
(sqrt z))
(+
(* 0.5 (sqrt (/ 1.0 z)))
(+ (- (sqrt (+ 1.0 y)) (sqrt y)) (- 1.0 (sqrt x))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (z <= 2500000.0) {
tmp = (1.0 + (sqrt((x + 1.0)) + (sqrt((1.0 + z)) + (0.5 * sqrt((1.0 / t)))))) - sqrt(z);
} else {
tmp = (0.5 * sqrt((1.0 / z))) + ((sqrt((1.0 + y)) - sqrt(y)) + (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 (z <= 2500000.0d0) then
tmp = (1.0d0 + (sqrt((x + 1.0d0)) + (sqrt((1.0d0 + z)) + (0.5d0 * sqrt((1.0d0 / t)))))) - sqrt(z)
else
tmp = (0.5d0 * sqrt((1.0d0 / z))) + ((sqrt((1.0d0 + y)) - sqrt(y)) + (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 (z <= 2500000.0) {
tmp = (1.0 + (Math.sqrt((x + 1.0)) + (Math.sqrt((1.0 + z)) + (0.5 * Math.sqrt((1.0 / t)))))) - Math.sqrt(z);
} else {
tmp = (0.5 * Math.sqrt((1.0 / z))) + ((Math.sqrt((1.0 + y)) - Math.sqrt(y)) + (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 z <= 2500000.0: tmp = (1.0 + (math.sqrt((x + 1.0)) + (math.sqrt((1.0 + z)) + (0.5 * math.sqrt((1.0 / t)))))) - math.sqrt(z) else: tmp = (0.5 * math.sqrt((1.0 / z))) + ((math.sqrt((1.0 + y)) - math.sqrt(y)) + (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 (z <= 2500000.0) tmp = Float64(Float64(1.0 + Float64(sqrt(Float64(x + 1.0)) + Float64(sqrt(Float64(1.0 + z)) + Float64(0.5 * sqrt(Float64(1.0 / t)))))) - sqrt(z)); else tmp = Float64(Float64(0.5 * sqrt(Float64(1.0 / z))) + Float64(Float64(sqrt(Float64(1.0 + y)) - sqrt(y)) + Float64(1.0 - sqrt(x)))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (z <= 2500000.0)
tmp = (1.0 + (sqrt((x + 1.0)) + (sqrt((1.0 + z)) + (0.5 * sqrt((1.0 / t)))))) - sqrt(z);
else
tmp = (0.5 * sqrt((1.0 / z))) + ((sqrt((1.0 + y)) - sqrt(y)) + (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[z, 2500000.0], N[(N[(1.0 + N[(N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision] + N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] + N[(0.5 * N[Sqrt[N[(1.0 / t), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision], N[(N[(0.5 * N[Sqrt[N[(1.0 / z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision] + N[(1.0 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq 2500000:\\
\;\;\;\;\left(1 + \left(\sqrt{x + 1} + \left(\sqrt{1 + z} + 0.5 \cdot \sqrt{\frac{1}{t}}\right)\right)\right) - \sqrt{z}\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \sqrt{\frac{1}{z}} + \left(\left(\sqrt{1 + y} - \sqrt{y}\right) + \left(1 - \sqrt{x}\right)\right)\\
\end{array}
\end{array}
if z < 2.5e6Initial program 96.5%
associate-+l+96.5%
sub-neg96.5%
sub-neg96.5%
+-commutative96.5%
+-commutative96.5%
+-commutative96.5%
Simplified96.5%
Taylor expanded in y around 0 40.5%
Taylor expanded in t around inf 17.0%
+-commutative17.0%
Simplified17.0%
Taylor expanded in z around inf 19.4%
if 2.5e6 < z Initial program 84.7%
associate-+l+84.7%
sub-neg84.7%
sub-neg84.7%
+-commutative84.7%
+-commutative84.7%
+-commutative84.7%
Simplified84.7%
Taylor expanded in z around inf 88.1%
Taylor expanded in x around 0 50.4%
Taylor expanded in z around 0 28.8%
Final simplification24.2%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(if (<= z 27000000.0)
(+ (- (sqrt (+ 1.0 z)) (sqrt z)) (- 2.0 (+ (sqrt x) (sqrt y))))
(+
(* 0.5 (sqrt (/ 1.0 z)))
(+ (- (sqrt (+ 1.0 y)) (sqrt y)) (- 1.0 (sqrt x))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (z <= 27000000.0) {
tmp = (sqrt((1.0 + z)) - sqrt(z)) + (2.0 - (sqrt(x) + sqrt(y)));
} else {
tmp = (0.5 * sqrt((1.0 / z))) + ((sqrt((1.0 + y)) - sqrt(y)) + (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 (z <= 27000000.0d0) then
tmp = (sqrt((1.0d0 + z)) - sqrt(z)) + (2.0d0 - (sqrt(x) + sqrt(y)))
else
tmp = (0.5d0 * sqrt((1.0d0 / z))) + ((sqrt((1.0d0 + y)) - sqrt(y)) + (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 (z <= 27000000.0) {
tmp = (Math.sqrt((1.0 + z)) - Math.sqrt(z)) + (2.0 - (Math.sqrt(x) + Math.sqrt(y)));
} else {
tmp = (0.5 * Math.sqrt((1.0 / z))) + ((Math.sqrt((1.0 + y)) - Math.sqrt(y)) + (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 z <= 27000000.0: tmp = (math.sqrt((1.0 + z)) - math.sqrt(z)) + (2.0 - (math.sqrt(x) + math.sqrt(y))) else: tmp = (0.5 * math.sqrt((1.0 / z))) + ((math.sqrt((1.0 + y)) - math.sqrt(y)) + (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 (z <= 27000000.0) tmp = Float64(Float64(sqrt(Float64(1.0 + z)) - sqrt(z)) + Float64(2.0 - Float64(sqrt(x) + sqrt(y)))); else tmp = Float64(Float64(0.5 * sqrt(Float64(1.0 / z))) + Float64(Float64(sqrt(Float64(1.0 + y)) - sqrt(y)) + Float64(1.0 - sqrt(x)))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (z <= 27000000.0)
tmp = (sqrt((1.0 + z)) - sqrt(z)) + (2.0 - (sqrt(x) + sqrt(y)));
else
tmp = (0.5 * sqrt((1.0 / z))) + ((sqrt((1.0 + y)) - sqrt(y)) + (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[z, 27000000.0], N[(N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] + N[(2.0 - N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(0.5 * N[Sqrt[N[(1.0 / z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision] + N[(1.0 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq 27000000:\\
\;\;\;\;\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(2 - \left(\sqrt{x} + \sqrt{y}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \sqrt{\frac{1}{z}} + \left(\left(\sqrt{1 + y} - \sqrt{y}\right) + \left(1 - \sqrt{x}\right)\right)\\
\end{array}
\end{array}
if z < 2.7e7Initial program 96.5%
associate-+l+96.5%
sub-neg96.5%
sub-neg96.5%
+-commutative96.5%
+-commutative96.5%
+-commutative96.5%
Simplified96.5%
Taylor expanded in y around 0 40.2%
Taylor expanded in t around inf 25.4%
Taylor expanded in x around 0 14.6%
if 2.7e7 < z Initial program 84.6%
associate-+l+84.6%
sub-neg84.6%
sub-neg84.6%
+-commutative84.6%
+-commutative84.6%
+-commutative84.6%
Simplified84.6%
Taylor expanded in z around inf 88.2%
Taylor expanded in x around 0 50.1%
Taylor expanded in z around 0 28.9%
Final simplification21.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) (sqrt y))))
(if (<= z 8e+16)
(+ (- (sqrt (+ 1.0 z)) (sqrt z)) (- 2.0 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 <= 8e+16) {
tmp = (sqrt((1.0 + z)) - sqrt(z)) + (2.0 - 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 <= 8d+16) then
tmp = (sqrt((1.0d0 + z)) - sqrt(z)) + (2.0d0 - 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 <= 8e+16) {
tmp = (Math.sqrt((1.0 + z)) - Math.sqrt(z)) + (2.0 - 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 <= 8e+16: tmp = (math.sqrt((1.0 + z)) - math.sqrt(z)) + (2.0 - 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 <= 8e+16) tmp = Float64(Float64(sqrt(Float64(1.0 + z)) - sqrt(z)) + Float64(2.0 - 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 <= 8e+16)
tmp = (sqrt((1.0 + z)) - sqrt(z)) + (2.0 - 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, 8e+16], N[(N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] + N[(2.0 - t$95$1), $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 8 \cdot 10^{+16}:\\
\;\;\;\;\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(2 - t\_1\right)\\
\mathbf{else}:\\
\;\;\;\;\sqrt{x + 1} + \left(\sqrt{1 + y} - t\_1\right)\\
\end{array}
\end{array}
if z < 8e16Initial program 94.7%
associate-+l+94.7%
sub-neg94.7%
sub-neg94.7%
+-commutative94.7%
+-commutative94.7%
+-commutative94.7%
Simplified94.7%
Taylor expanded in y around 0 39.8%
Taylor expanded in t around inf 25.3%
Taylor expanded in x around 0 14.8%
if 8e16 < z Initial program 85.7%
associate-+l+85.7%
sub-neg85.7%
sub-neg85.7%
+-commutative85.7%
+-commutative85.7%
+-commutative85.7%
Simplified85.7%
Taylor expanded in t around inf 3.4%
associate--l+23.3%
Simplified23.3%
Taylor expanded in z around inf 17.7%
associate--l+32.1%
Simplified32.1%
Final simplification22.8%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= z 4.2e+14) (+ 2.0 (- (sqrt (+ 1.0 z)) (+ (sqrt x) (+ (sqrt y) (sqrt z))))) (+ (sqrt (+ x 1.0)) (- (sqrt (+ 1.0 y)) (+ (sqrt x) (sqrt y))))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (z <= 4.2e+14) {
tmp = 2.0 + (sqrt((1.0 + z)) - (sqrt(x) + (sqrt(y) + sqrt(z))));
} else {
tmp = sqrt((x + 1.0)) + (sqrt((1.0 + y)) - (sqrt(x) + sqrt(y)));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (z <= 4.2d+14) then
tmp = 2.0d0 + (sqrt((1.0d0 + z)) - (sqrt(x) + (sqrt(y) + sqrt(z))))
else
tmp = sqrt((x + 1.0d0)) + (sqrt((1.0d0 + y)) - (sqrt(x) + sqrt(y)))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= 4.2e+14) {
tmp = 2.0 + (Math.sqrt((1.0 + z)) - (Math.sqrt(x) + (Math.sqrt(y) + Math.sqrt(z))));
} else {
tmp = Math.sqrt((x + 1.0)) + (Math.sqrt((1.0 + y)) - (Math.sqrt(x) + Math.sqrt(y)));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if z <= 4.2e+14: tmp = 2.0 + (math.sqrt((1.0 + z)) - (math.sqrt(x) + (math.sqrt(y) + math.sqrt(z)))) else: tmp = math.sqrt((x + 1.0)) + (math.sqrt((1.0 + y)) - (math.sqrt(x) + math.sqrt(y))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (z <= 4.2e+14) tmp = Float64(2.0 + Float64(sqrt(Float64(1.0 + z)) - Float64(sqrt(x) + Float64(sqrt(y) + sqrt(z))))); else tmp = Float64(sqrt(Float64(x + 1.0)) + Float64(sqrt(Float64(1.0 + y)) - Float64(sqrt(x) + sqrt(y)))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (z <= 4.2e+14)
tmp = 2.0 + (sqrt((1.0 + z)) - (sqrt(x) + (sqrt(y) + sqrt(z))));
else
tmp = sqrt((x + 1.0)) + (sqrt((1.0 + y)) - (sqrt(x) + sqrt(y)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[z, 4.2e+14], N[(2.0 + N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[(N[Sqrt[x], $MachinePrecision] + N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision] + N[(N[Sqrt[N[(1.0 + y), $MachinePrecision]], $MachinePrecision] - N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq 4.2 \cdot 10^{+14}:\\
\;\;\;\;2 + \left(\sqrt{1 + z} - \left(\sqrt{x} + \left(\sqrt{y} + \sqrt{z}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\sqrt{x + 1} + \left(\sqrt{1 + y} - \left(\sqrt{x} + \sqrt{y}\right)\right)\\
\end{array}
\end{array}
if z < 4.2e14Initial program 94.7%
associate-+l+94.7%
sub-neg94.7%
sub-neg94.7%
+-commutative94.7%
+-commutative94.7%
+-commutative94.7%
Simplified94.7%
Taylor expanded in y around 0 39.8%
Taylor expanded in t around inf 25.3%
Taylor expanded in x around 0 14.8%
associate--l+14.8%
+-commutative14.8%
Simplified14.8%
if 4.2e14 < z Initial program 85.7%
associate-+l+85.7%
sub-neg85.7%
sub-neg85.7%
+-commutative85.7%
+-commutative85.7%
+-commutative85.7%
Simplified85.7%
Taylor expanded in t around inf 3.4%
associate--l+23.3%
Simplified23.3%
Taylor expanded in z around inf 17.7%
associate--l+32.1%
Simplified32.1%
Final simplification22.8%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= y 3.05) (+ 2.0 (- (sqrt (+ 1.0 z)) (+ (sqrt x) (+ (sqrt y) (sqrt z))))) (- (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 <= 3.05) {
tmp = 2.0 + (sqrt((1.0 + z)) - (sqrt(x) + (sqrt(y) + sqrt(z))));
} 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 <= 3.05d0) then
tmp = 2.0d0 + (sqrt((1.0d0 + z)) - (sqrt(x) + (sqrt(y) + sqrt(z))))
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 <= 3.05) {
tmp = 2.0 + (Math.sqrt((1.0 + z)) - (Math.sqrt(x) + (Math.sqrt(y) + Math.sqrt(z))));
} 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 <= 3.05: tmp = 2.0 + (math.sqrt((1.0 + z)) - (math.sqrt(x) + (math.sqrt(y) + math.sqrt(z)))) 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 <= 3.05) tmp = Float64(2.0 + Float64(sqrt(Float64(1.0 + z)) - Float64(sqrt(x) + Float64(sqrt(y) + sqrt(z))))); 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 <= 3.05)
tmp = 2.0 + (sqrt((1.0 + z)) - (sqrt(x) + (sqrt(y) + sqrt(z))));
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, 3.05], N[(2.0 + N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[(N[Sqrt[x], $MachinePrecision] + N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $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 3.05:\\
\;\;\;\;2 + \left(\sqrt{1 + z} - \left(\sqrt{x} + \left(\sqrt{y} + \sqrt{z}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\sqrt{x + 1} - \sqrt{x}\\
\end{array}
\end{array}
if y < 3.0499999999999998Initial program 96.2%
associate-+l+96.2%
sub-neg96.2%
sub-neg96.2%
+-commutative96.2%
+-commutative96.2%
+-commutative96.2%
Simplified96.2%
Taylor expanded in y around 0 58.8%
Taylor expanded in t around inf 34.9%
Taylor expanded in x around 0 17.1%
associate--l+31.4%
+-commutative31.4%
Simplified31.4%
if 3.0499999999999998 < y Initial program 85.2%
associate-+l+85.2%
sub-neg85.2%
sub-neg85.2%
+-commutative85.2%
+-commutative85.2%
+-commutative85.2%
Simplified85.2%
Taylor expanded in t around inf 5.6%
associate--l+24.0%
Simplified24.0%
Taylor expanded in x around inf 22.2%
mul-1-neg22.2%
Simplified22.2%
Final simplification26.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 1.0))))
(if (<= y 2.6e-131)
(+ 2.0 (- (+ t_1 (* z 0.5)) (sqrt z)))
(if (<= y 1.0) (- (+ 1.0 t_1) (+ (sqrt x) (sqrt y))) (- t_1 (sqrt x))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((x + 1.0));
double tmp;
if (y <= 2.6e-131) {
tmp = 2.0 + ((t_1 + (z * 0.5)) - sqrt(z));
} else if (y <= 1.0) {
tmp = (1.0 + t_1) - (sqrt(x) + sqrt(y));
} else {
tmp = t_1 - sqrt(x);
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = sqrt((x + 1.0d0))
if (y <= 2.6d-131) then
tmp = 2.0d0 + ((t_1 + (z * 0.5d0)) - sqrt(z))
else if (y <= 1.0d0) then
tmp = (1.0d0 + t_1) - (sqrt(x) + sqrt(y))
else
tmp = t_1 - sqrt(x)
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((x + 1.0));
double tmp;
if (y <= 2.6e-131) {
tmp = 2.0 + ((t_1 + (z * 0.5)) - Math.sqrt(z));
} else if (y <= 1.0) {
tmp = (1.0 + t_1) - (Math.sqrt(x) + Math.sqrt(y));
} else {
tmp = t_1 - Math.sqrt(x);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((x + 1.0)) tmp = 0 if y <= 2.6e-131: tmp = 2.0 + ((t_1 + (z * 0.5)) - math.sqrt(z)) elif y <= 1.0: tmp = (1.0 + t_1) - (math.sqrt(x) + math.sqrt(y)) else: tmp = t_1 - math.sqrt(x) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(x + 1.0)) tmp = 0.0 if (y <= 2.6e-131) tmp = Float64(2.0 + Float64(Float64(t_1 + Float64(z * 0.5)) - sqrt(z))); elseif (y <= 1.0) tmp = Float64(Float64(1.0 + t_1) - Float64(sqrt(x) + sqrt(y))); else tmp = Float64(t_1 - sqrt(x)); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((x + 1.0));
tmp = 0.0;
if (y <= 2.6e-131)
tmp = 2.0 + ((t_1 + (z * 0.5)) - sqrt(z));
elseif (y <= 1.0)
tmp = (1.0 + t_1) - (sqrt(x) + sqrt(y));
else
tmp = t_1 - sqrt(x);
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y, 2.6e-131], N[(2.0 + N[(N[(t$95$1 + N[(z * 0.5), $MachinePrecision]), $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.0], N[(N[(1.0 + t$95$1), $MachinePrecision] - N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 - N[Sqrt[x], $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.6 \cdot 10^{-131}:\\
\;\;\;\;2 + \left(\left(t\_1 + z \cdot 0.5\right) - \sqrt{z}\right)\\
\mathbf{elif}\;y \leq 1:\\
\;\;\;\;\left(1 + t\_1\right) - \left(\sqrt{x} + \sqrt{y}\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1 - \sqrt{x}\\
\end{array}
\end{array}
if y < 2.59999999999999996e-131Initial program 96.7%
associate-+l+96.7%
sub-neg96.7%
sub-neg96.7%
+-commutative96.7%
+-commutative96.7%
+-commutative96.7%
Simplified96.7%
Taylor expanded in y around 0 60.9%
Taylor expanded in t around inf 37.8%
Taylor expanded in z around 0 21.8%
associate--l+34.8%
*-commutative34.8%
+-commutative34.8%
Simplified34.8%
Taylor expanded in z around inf 19.6%
if 2.59999999999999996e-131 < y < 1Initial program 95.4%
associate-+l+95.4%
sub-neg95.4%
sub-neg95.4%
+-commutative95.4%
+-commutative95.4%
+-commutative95.4%
Simplified95.4%
Taylor expanded in y around 0 55.3%
Taylor expanded in t around inf 30.2%
Taylor expanded in z around inf 19.8%
if 1 < y Initial program 85.2%
associate-+l+85.2%
sub-neg85.2%
sub-neg85.2%
+-commutative85.2%
+-commutative85.2%
+-commutative85.2%
Simplified85.2%
Taylor expanded in t around inf 5.6%
associate--l+24.0%
Simplified24.0%
Taylor expanded in x around inf 22.2%
mul-1-neg22.2%
Simplified22.2%
Final simplification21.0%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ x 1.0))))
(if (<= y 2.6e-131)
(+ 2.0 (- (+ t_1 (* z 0.5)) (sqrt z)))
(if (<= y 1.42) (- 2.0 (sqrt y)) (- t_1 (sqrt x))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((x + 1.0));
double tmp;
if (y <= 2.6e-131) {
tmp = 2.0 + ((t_1 + (z * 0.5)) - sqrt(z));
} else if (y <= 1.42) {
tmp = 2.0 - sqrt(y);
} else {
tmp = t_1 - sqrt(x);
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = sqrt((x + 1.0d0))
if (y <= 2.6d-131) then
tmp = 2.0d0 + ((t_1 + (z * 0.5d0)) - sqrt(z))
else if (y <= 1.42d0) then
tmp = 2.0d0 - sqrt(y)
else
tmp = t_1 - sqrt(x)
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((x + 1.0));
double tmp;
if (y <= 2.6e-131) {
tmp = 2.0 + ((t_1 + (z * 0.5)) - Math.sqrt(z));
} else if (y <= 1.42) {
tmp = 2.0 - Math.sqrt(y);
} else {
tmp = t_1 - Math.sqrt(x);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((x + 1.0)) tmp = 0 if y <= 2.6e-131: tmp = 2.0 + ((t_1 + (z * 0.5)) - math.sqrt(z)) elif y <= 1.42: tmp = 2.0 - math.sqrt(y) else: tmp = t_1 - math.sqrt(x) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(x + 1.0)) tmp = 0.0 if (y <= 2.6e-131) tmp = Float64(2.0 + Float64(Float64(t_1 + Float64(z * 0.5)) - sqrt(z))); elseif (y <= 1.42) tmp = Float64(2.0 - sqrt(y)); else tmp = Float64(t_1 - sqrt(x)); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((x + 1.0));
tmp = 0.0;
if (y <= 2.6e-131)
tmp = 2.0 + ((t_1 + (z * 0.5)) - sqrt(z));
elseif (y <= 1.42)
tmp = 2.0 - sqrt(y);
else
tmp = t_1 - sqrt(x);
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y, 2.6e-131], N[(2.0 + N[(N[(t$95$1 + N[(z * 0.5), $MachinePrecision]), $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.42], N[(2.0 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision], N[(t$95$1 - N[Sqrt[x], $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.6 \cdot 10^{-131}:\\
\;\;\;\;2 + \left(\left(t\_1 + z \cdot 0.5\right) - \sqrt{z}\right)\\
\mathbf{elif}\;y \leq 1.42:\\
\;\;\;\;2 - \sqrt{y}\\
\mathbf{else}:\\
\;\;\;\;t\_1 - \sqrt{x}\\
\end{array}
\end{array}
if y < 2.59999999999999996e-131Initial program 96.7%
associate-+l+96.7%
sub-neg96.7%
sub-neg96.7%
+-commutative96.7%
+-commutative96.7%
+-commutative96.7%
Simplified96.7%
Taylor expanded in y around 0 60.9%
Taylor expanded in t around inf 37.8%
Taylor expanded in z around 0 21.8%
associate--l+34.8%
*-commutative34.8%
+-commutative34.8%
Simplified34.8%
Taylor expanded in z around inf 19.6%
if 2.59999999999999996e-131 < y < 1.4199999999999999Initial program 95.4%
associate-+l+95.4%
sub-neg95.4%
sub-neg95.4%
+-commutative95.4%
+-commutative95.4%
+-commutative95.4%
Simplified95.4%
Taylor expanded in y around 0 55.3%
Taylor expanded in t around inf 30.2%
Taylor expanded in z around 0 16.5%
associate--l+23.8%
*-commutative23.8%
+-commutative23.8%
Simplified23.8%
Taylor expanded in y around inf 41.0%
mul-1-neg41.0%
Simplified41.0%
if 1.4199999999999999 < y Initial program 85.2%
associate-+l+85.2%
sub-neg85.2%
sub-neg85.2%
+-commutative85.2%
+-commutative85.2%
+-commutative85.2%
Simplified85.2%
Taylor expanded in t around inf 5.6%
associate--l+24.0%
Simplified24.0%
Taylor expanded in x around inf 22.2%
mul-1-neg22.2%
Simplified22.2%
Final simplification24.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 (+ x 1.0))))
(if (<= y 2.6e-131)
(+ 2.0 (- (+ t_1 (* z 0.5)) (sqrt y)))
(if (<= y 1.45) (- 2.0 (sqrt y)) (- t_1 (sqrt x))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((x + 1.0));
double tmp;
if (y <= 2.6e-131) {
tmp = 2.0 + ((t_1 + (z * 0.5)) - sqrt(y));
} else if (y <= 1.45) {
tmp = 2.0 - sqrt(y);
} else {
tmp = t_1 - sqrt(x);
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = sqrt((x + 1.0d0))
if (y <= 2.6d-131) then
tmp = 2.0d0 + ((t_1 + (z * 0.5d0)) - sqrt(y))
else if (y <= 1.45d0) then
tmp = 2.0d0 - sqrt(y)
else
tmp = t_1 - sqrt(x)
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((x + 1.0));
double tmp;
if (y <= 2.6e-131) {
tmp = 2.0 + ((t_1 + (z * 0.5)) - Math.sqrt(y));
} else if (y <= 1.45) {
tmp = 2.0 - Math.sqrt(y);
} else {
tmp = t_1 - Math.sqrt(x);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((x + 1.0)) tmp = 0 if y <= 2.6e-131: tmp = 2.0 + ((t_1 + (z * 0.5)) - math.sqrt(y)) elif y <= 1.45: tmp = 2.0 - math.sqrt(y) else: tmp = t_1 - math.sqrt(x) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(x + 1.0)) tmp = 0.0 if (y <= 2.6e-131) tmp = Float64(2.0 + Float64(Float64(t_1 + Float64(z * 0.5)) - sqrt(y))); elseif (y <= 1.45) tmp = Float64(2.0 - sqrt(y)); else tmp = Float64(t_1 - sqrt(x)); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((x + 1.0));
tmp = 0.0;
if (y <= 2.6e-131)
tmp = 2.0 + ((t_1 + (z * 0.5)) - sqrt(y));
elseif (y <= 1.45)
tmp = 2.0 - sqrt(y);
else
tmp = t_1 - sqrt(x);
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(x + 1.0), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y, 2.6e-131], N[(2.0 + N[(N[(t$95$1 + N[(z * 0.5), $MachinePrecision]), $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.45], N[(2.0 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision], N[(t$95$1 - N[Sqrt[x], $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.6 \cdot 10^{-131}:\\
\;\;\;\;2 + \left(\left(t\_1 + z \cdot 0.5\right) - \sqrt{y}\right)\\
\mathbf{elif}\;y \leq 1.45:\\
\;\;\;\;2 - \sqrt{y}\\
\mathbf{else}:\\
\;\;\;\;t\_1 - \sqrt{x}\\
\end{array}
\end{array}
if y < 2.59999999999999996e-131Initial program 96.7%
associate-+l+96.7%
sub-neg96.7%
sub-neg96.7%
+-commutative96.7%
+-commutative96.7%
+-commutative96.7%
Simplified96.7%
Taylor expanded in y around 0 60.9%
Taylor expanded in t around inf 37.8%
Taylor expanded in z around 0 21.8%
associate--l+34.8%
*-commutative34.8%
+-commutative34.8%
Simplified34.8%
Taylor expanded in y around inf 19.6%
if 2.59999999999999996e-131 < y < 1.44999999999999996Initial program 95.4%
associate-+l+95.4%
sub-neg95.4%
sub-neg95.4%
+-commutative95.4%
+-commutative95.4%
+-commutative95.4%
Simplified95.4%
Taylor expanded in y around 0 55.3%
Taylor expanded in t around inf 30.2%
Taylor expanded in z around 0 16.5%
associate--l+23.8%
*-commutative23.8%
+-commutative23.8%
Simplified23.8%
Taylor expanded in y around inf 41.0%
mul-1-neg41.0%
Simplified41.0%
if 1.44999999999999996 < y Initial program 85.2%
associate-+l+85.2%
sub-neg85.2%
sub-neg85.2%
+-commutative85.2%
+-commutative85.2%
+-commutative85.2%
Simplified85.2%
Taylor expanded in t around inf 5.6%
associate--l+24.0%
Simplified24.0%
Taylor expanded in x around inf 22.2%
mul-1-neg22.2%
Simplified22.2%
Final simplification24.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.25) (- 2.0 (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.25) {
tmp = 2.0 - 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.25d0) then
tmp = 2.0d0 - 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.25) {
tmp = 2.0 - 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.25: tmp = 2.0 - 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.25) tmp = Float64(2.0 - 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.25)
tmp = 2.0 - 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.25], N[(2.0 - N[Sqrt[y], $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.25:\\
\;\;\;\;2 - \sqrt{y}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{x + 1} - \sqrt{x}\\
\end{array}
\end{array}
if y < 1.25Initial program 96.2%
associate-+l+96.2%
sub-neg96.2%
sub-neg96.2%
+-commutative96.2%
+-commutative96.2%
+-commutative96.2%
Simplified96.2%
Taylor expanded in y around 0 58.8%
Taylor expanded in t around inf 34.9%
Taylor expanded in z around 0 19.8%
associate--l+30.6%
*-commutative30.6%
+-commutative30.6%
Simplified30.6%
Taylor expanded in y around inf 40.3%
mul-1-neg40.3%
Simplified40.3%
if 1.25 < y Initial program 85.2%
associate-+l+85.2%
sub-neg85.2%
sub-neg85.2%
+-commutative85.2%
+-commutative85.2%
+-commutative85.2%
Simplified85.2%
Taylor expanded in t around inf 5.6%
associate--l+24.0%
Simplified24.0%
Taylor expanded in x around inf 22.2%
mul-1-neg22.2%
Simplified22.2%
Final simplification30.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 4.0) (- 2.0 (sqrt y)) (* (sqrt x) 2.0)))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 4.0) {
tmp = 2.0 - sqrt(y);
} else {
tmp = sqrt(x) * 2.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 <= 4.0d0) then
tmp = 2.0d0 - sqrt(y)
else
tmp = sqrt(x) * 2.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 <= 4.0) {
tmp = 2.0 - Math.sqrt(y);
} else {
tmp = Math.sqrt(x) * 2.0;
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if y <= 4.0: tmp = 2.0 - math.sqrt(y) else: tmp = math.sqrt(x) * 2.0 return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (y <= 4.0) tmp = Float64(2.0 - sqrt(y)); else tmp = Float64(sqrt(x) * 2.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 <= 4.0)
tmp = 2.0 - sqrt(y);
else
tmp = sqrt(x) * 2.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, 4.0], N[(2.0 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[x], $MachinePrecision] * 2.0), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 4:\\
\;\;\;\;2 - \sqrt{y}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{x} \cdot 2\\
\end{array}
\end{array}
if y < 4Initial program 96.2%
associate-+l+96.2%
sub-neg96.2%
sub-neg96.2%
+-commutative96.2%
+-commutative96.2%
+-commutative96.2%
Simplified96.2%
Taylor expanded in y around 0 58.8%
Taylor expanded in t around inf 34.9%
Taylor expanded in z around 0 19.8%
associate--l+30.6%
*-commutative30.6%
+-commutative30.6%
Simplified30.6%
Taylor expanded in y around inf 40.3%
mul-1-neg40.3%
Simplified40.3%
if 4 < y Initial program 85.2%
associate-+l+85.2%
sub-neg85.2%
sub-neg85.2%
+-commutative85.2%
+-commutative85.2%
+-commutative85.2%
Simplified85.2%
Taylor expanded in t around inf 5.6%
associate--l+24.0%
Simplified24.0%
Taylor expanded in x around inf 16.4%
distribute-lft-out16.4%
distribute-lft-out16.4%
+-commutative16.4%
Simplified16.4%
Taylor expanded in x around -inf 0.0%
*-commutative0.0%
unpow20.0%
rem-square-sqrt6.6%
neg-mul-16.6%
Simplified6.6%
Taylor expanded in x around 0 6.6%
*-commutative6.6%
Simplified6.6%
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 (* (sqrt x) 2.0))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
return sqrt(x) * 2.0;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = sqrt(x) * 2.0d0
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
return Math.sqrt(x) * 2.0;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): return math.sqrt(x) * 2.0
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) return Float64(sqrt(x) * 2.0) end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp = code(x, y, z, t)
tmp = sqrt(x) * 2.0;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := N[(N[Sqrt[x], $MachinePrecision] * 2.0), $MachinePrecision]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\sqrt{x} \cdot 2
\end{array}
Initial program 90.5%
associate-+l+90.5%
sub-neg90.5%
sub-neg90.5%
+-commutative90.5%
+-commutative90.5%
+-commutative90.5%
Simplified90.5%
Taylor expanded in t around inf 12.8%
associate--l+24.1%
Simplified24.1%
Taylor expanded in x around inf 19.8%
distribute-lft-out19.8%
distribute-lft-out19.8%
+-commutative19.8%
Simplified19.8%
Taylor expanded in x around -inf 0.0%
*-commutative0.0%
unpow20.0%
rem-square-sqrt6.9%
neg-mul-16.9%
Simplified6.9%
Taylor expanded in x around 0 6.9%
*-commutative6.9%
Simplified6.9%
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 90.5%
associate-+l+90.5%
sub-neg90.5%
sub-neg90.5%
+-commutative90.5%
+-commutative90.5%
+-commutative90.5%
Simplified90.5%
Taylor expanded in y around 0 34.9%
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 2024160
(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))))