
(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 (+ y 1.0)))
(t_2 (+ (sqrt y) t_1))
(t_3 (sqrt (+ 1.0 z)))
(t_4 (sqrt (+ 1.0 x)))
(t_5 (+ (sqrt x) t_4))
(t_6 (+ t_3 (sqrt z)))
(t_7 (sqrt (+ 1.0 t)))
(t_8 (+ t_7 (sqrt t))))
(if (<= (- t_3 (sqrt z)) 0.0)
(+
(/ (+ t_2 t_5) (* t_2 t_5))
(+ (- t_7 (sqrt t)) (* 0.5 (sqrt (/ 1.0 z)))))
(+ (- t_4 (sqrt x)) (+ (- t_1 (sqrt y)) (/ (+ t_8 t_6) (* t_8 t_6)))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((y + 1.0));
double t_2 = sqrt(y) + t_1;
double t_3 = sqrt((1.0 + z));
double t_4 = sqrt((1.0 + x));
double t_5 = sqrt(x) + t_4;
double t_6 = t_3 + sqrt(z);
double t_7 = sqrt((1.0 + t));
double t_8 = t_7 + sqrt(t);
double tmp;
if ((t_3 - sqrt(z)) <= 0.0) {
tmp = ((t_2 + t_5) / (t_2 * t_5)) + ((t_7 - sqrt(t)) + (0.5 * sqrt((1.0 / z))));
} else {
tmp = (t_4 - sqrt(x)) + ((t_1 - sqrt(y)) + ((t_8 + t_6) / (t_8 * t_6)));
}
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((y + 1.0d0))
t_2 = sqrt(y) + t_1
t_3 = sqrt((1.0d0 + z))
t_4 = sqrt((1.0d0 + x))
t_5 = sqrt(x) + t_4
t_6 = t_3 + sqrt(z)
t_7 = sqrt((1.0d0 + t))
t_8 = t_7 + sqrt(t)
if ((t_3 - sqrt(z)) <= 0.0d0) then
tmp = ((t_2 + t_5) / (t_2 * t_5)) + ((t_7 - sqrt(t)) + (0.5d0 * sqrt((1.0d0 / z))))
else
tmp = (t_4 - sqrt(x)) + ((t_1 - sqrt(y)) + ((t_8 + t_6) / (t_8 * t_6)))
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((y + 1.0));
double t_2 = Math.sqrt(y) + t_1;
double t_3 = Math.sqrt((1.0 + z));
double t_4 = Math.sqrt((1.0 + x));
double t_5 = Math.sqrt(x) + t_4;
double t_6 = t_3 + Math.sqrt(z);
double t_7 = Math.sqrt((1.0 + t));
double t_8 = t_7 + Math.sqrt(t);
double tmp;
if ((t_3 - Math.sqrt(z)) <= 0.0) {
tmp = ((t_2 + t_5) / (t_2 * t_5)) + ((t_7 - Math.sqrt(t)) + (0.5 * Math.sqrt((1.0 / z))));
} else {
tmp = (t_4 - Math.sqrt(x)) + ((t_1 - Math.sqrt(y)) + ((t_8 + t_6) / (t_8 * t_6)));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((y + 1.0)) t_2 = math.sqrt(y) + t_1 t_3 = math.sqrt((1.0 + z)) t_4 = math.sqrt((1.0 + x)) t_5 = math.sqrt(x) + t_4 t_6 = t_3 + math.sqrt(z) t_7 = math.sqrt((1.0 + t)) t_8 = t_7 + math.sqrt(t) tmp = 0 if (t_3 - math.sqrt(z)) <= 0.0: tmp = ((t_2 + t_5) / (t_2 * t_5)) + ((t_7 - math.sqrt(t)) + (0.5 * math.sqrt((1.0 / z)))) else: tmp = (t_4 - math.sqrt(x)) + ((t_1 - math.sqrt(y)) + ((t_8 + t_6) / (t_8 * t_6))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(y + 1.0)) t_2 = Float64(sqrt(y) + t_1) t_3 = sqrt(Float64(1.0 + z)) t_4 = sqrt(Float64(1.0 + x)) t_5 = Float64(sqrt(x) + t_4) t_6 = Float64(t_3 + sqrt(z)) t_7 = sqrt(Float64(1.0 + t)) t_8 = Float64(t_7 + sqrt(t)) tmp = 0.0 if (Float64(t_3 - sqrt(z)) <= 0.0) tmp = Float64(Float64(Float64(t_2 + t_5) / Float64(t_2 * t_5)) + Float64(Float64(t_7 - sqrt(t)) + Float64(0.5 * sqrt(Float64(1.0 / z))))); else tmp = Float64(Float64(t_4 - sqrt(x)) + Float64(Float64(t_1 - sqrt(y)) + Float64(Float64(t_8 + t_6) / Float64(t_8 * t_6)))); 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((y + 1.0));
t_2 = sqrt(y) + t_1;
t_3 = sqrt((1.0 + z));
t_4 = sqrt((1.0 + x));
t_5 = sqrt(x) + t_4;
t_6 = t_3 + sqrt(z);
t_7 = sqrt((1.0 + t));
t_8 = t_7 + sqrt(t);
tmp = 0.0;
if ((t_3 - sqrt(z)) <= 0.0)
tmp = ((t_2 + t_5) / (t_2 * t_5)) + ((t_7 - sqrt(t)) + (0.5 * sqrt((1.0 / z))));
else
tmp = (t_4 - sqrt(x)) + ((t_1 - sqrt(y)) + ((t_8 + t_6) / (t_8 * t_6)));
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[(y + 1.0), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(N[Sqrt[y], $MachinePrecision] + t$95$1), $MachinePrecision]}, Block[{t$95$3 = N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$4 = N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$5 = N[(N[Sqrt[x], $MachinePrecision] + t$95$4), $MachinePrecision]}, Block[{t$95$6 = N[(t$95$3 + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$7 = N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$8 = N[(t$95$7 + N[Sqrt[t], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(t$95$3 - N[Sqrt[z], $MachinePrecision]), $MachinePrecision], 0.0], N[(N[(N[(t$95$2 + t$95$5), $MachinePrecision] / N[(t$95$2 * t$95$5), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$7 - N[Sqrt[t], $MachinePrecision]), $MachinePrecision] + N[(0.5 * N[Sqrt[N[(1.0 / z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(t$95$4 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$1 - N[Sqrt[y], $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$8 + t$95$6), $MachinePrecision] / N[(t$95$8 * t$95$6), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{y + 1}\\
t_2 := \sqrt{y} + t\_1\\
t_3 := \sqrt{1 + z}\\
t_4 := \sqrt{1 + x}\\
t_5 := \sqrt{x} + t\_4\\
t_6 := t\_3 + \sqrt{z}\\
t_7 := \sqrt{1 + t}\\
t_8 := t\_7 + \sqrt{t}\\
\mathbf{if}\;t\_3 - \sqrt{z} \leq 0:\\
\;\;\;\;\frac{t\_2 + t\_5}{t\_2 \cdot t\_5} + \left(\left(t\_7 - \sqrt{t}\right) + 0.5 \cdot \sqrt{\frac{1}{z}}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(t\_4 - \sqrt{x}\right) + \left(\left(t\_1 - \sqrt{y}\right) + \frac{t\_8 + t\_6}{t\_8 \cdot t\_6}\right)\\
\end{array}
\end{array}
if (-.f64 (sqrt.f64 (+.f64 z #s(literal 1 binary64))) (sqrt.f64 z)) < 0.0Initial program 89.4%
associate-+l+89.4%
associate-+l-63.2%
associate-+l-89.4%
+-commutative89.4%
+-commutative89.4%
+-commutative89.4%
Simplified89.4%
+-commutative89.4%
flip--89.4%
flip--89.3%
frac-add89.3%
Applied egg-rr89.6%
Simplified94.0%
Taylor expanded in z around inf 97.2%
if 0.0 < (-.f64 (sqrt.f64 (+.f64 z #s(literal 1 binary64))) (sqrt.f64 z)) Initial program 97.1%
associate-+l+97.1%
associate-+l+97.1%
+-commutative97.1%
+-commutative97.1%
associate-+l-62.5%
+-commutative62.5%
+-commutative62.5%
Simplified62.5%
associate--r-97.1%
flip--97.0%
flip--97.0%
frac-add97.0%
Applied egg-rr97.2%
Simplified97.6%
Final simplification97.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 z)))
(t_2 (- t_1 (sqrt z)))
(t_3 (- (sqrt (+ 1.0 t)) (sqrt t)))
(t_4 (sqrt (+ 1.0 x)))
(t_5 (+ (- t_4 (sqrt x)) (- (sqrt (+ y 1.0)) (sqrt y)))))
(if (<= (+ t_2 t_5) 1.001)
(+ (+ t_2 t_3) (+ (* 0.5 (sqrt (/ 1.0 y))) (/ 1.0 (+ (sqrt x) t_4))))
(+ t_5 (+ t_3 (/ 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 = t_1 - sqrt(z);
double t_3 = sqrt((1.0 + t)) - sqrt(t);
double t_4 = sqrt((1.0 + x));
double t_5 = (t_4 - sqrt(x)) + (sqrt((y + 1.0)) - sqrt(y));
double tmp;
if ((t_2 + t_5) <= 1.001) {
tmp = (t_2 + t_3) + ((0.5 * sqrt((1.0 / y))) + (1.0 / (sqrt(x) + t_4)));
} else {
tmp = t_5 + (t_3 + (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) :: t_3
real(8) :: t_4
real(8) :: t_5
real(8) :: tmp
t_1 = sqrt((1.0d0 + z))
t_2 = t_1 - sqrt(z)
t_3 = sqrt((1.0d0 + t)) - sqrt(t)
t_4 = sqrt((1.0d0 + x))
t_5 = (t_4 - sqrt(x)) + (sqrt((y + 1.0d0)) - sqrt(y))
if ((t_2 + t_5) <= 1.001d0) then
tmp = (t_2 + t_3) + ((0.5d0 * sqrt((1.0d0 / y))) + (1.0d0 / (sqrt(x) + t_4)))
else
tmp = t_5 + (t_3 + (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 = t_1 - Math.sqrt(z);
double t_3 = Math.sqrt((1.0 + t)) - Math.sqrt(t);
double t_4 = Math.sqrt((1.0 + x));
double t_5 = (t_4 - Math.sqrt(x)) + (Math.sqrt((y + 1.0)) - Math.sqrt(y));
double tmp;
if ((t_2 + t_5) <= 1.001) {
tmp = (t_2 + t_3) + ((0.5 * Math.sqrt((1.0 / y))) + (1.0 / (Math.sqrt(x) + t_4)));
} else {
tmp = t_5 + (t_3 + (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 = t_1 - math.sqrt(z) t_3 = math.sqrt((1.0 + t)) - math.sqrt(t) t_4 = math.sqrt((1.0 + x)) t_5 = (t_4 - math.sqrt(x)) + (math.sqrt((y + 1.0)) - math.sqrt(y)) tmp = 0 if (t_2 + t_5) <= 1.001: tmp = (t_2 + t_3) + ((0.5 * math.sqrt((1.0 / y))) + (1.0 / (math.sqrt(x) + t_4))) else: tmp = t_5 + (t_3 + (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 = Float64(t_1 - sqrt(z)) t_3 = Float64(sqrt(Float64(1.0 + t)) - sqrt(t)) t_4 = sqrt(Float64(1.0 + x)) t_5 = Float64(Float64(t_4 - sqrt(x)) + Float64(sqrt(Float64(y + 1.0)) - sqrt(y))) tmp = 0.0 if (Float64(t_2 + t_5) <= 1.001) tmp = Float64(Float64(t_2 + t_3) + Float64(Float64(0.5 * sqrt(Float64(1.0 / y))) + Float64(1.0 / Float64(sqrt(x) + t_4)))); else tmp = Float64(t_5 + Float64(t_3 + 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 = t_1 - sqrt(z);
t_3 = sqrt((1.0 + t)) - sqrt(t);
t_4 = sqrt((1.0 + x));
t_5 = (t_4 - sqrt(x)) + (sqrt((y + 1.0)) - sqrt(y));
tmp = 0.0;
if ((t_2 + t_5) <= 1.001)
tmp = (t_2 + t_3) + ((0.5 * sqrt((1.0 / y))) + (1.0 / (sqrt(x) + t_4)));
else
tmp = t_5 + (t_3 + (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[(t$95$1 - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$5 = N[(N[(t$95$4 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(t$95$2 + t$95$5), $MachinePrecision], 1.001], N[(N[(t$95$2 + t$95$3), $MachinePrecision] + N[(N[(0.5 * N[Sqrt[N[(1.0 / y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + t$95$4), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$5 + N[(t$95$3 + 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 := t\_1 - \sqrt{z}\\
t_3 := \sqrt{1 + t} - \sqrt{t}\\
t_4 := \sqrt{1 + x}\\
t_5 := \left(t\_4 - \sqrt{x}\right) + \left(\sqrt{y + 1} - \sqrt{y}\right)\\
\mathbf{if}\;t\_2 + t\_5 \leq 1.001:\\
\;\;\;\;\left(t\_2 + t\_3\right) + \left(0.5 \cdot \sqrt{\frac{1}{y}} + \frac{1}{\sqrt{x} + t\_4}\right)\\
\mathbf{else}:\\
\;\;\;\;t\_5 + \left(t\_3 + \frac{1}{t\_1 + \sqrt{z}}\right)\\
\end{array}
\end{array}
if (+.f64 (+.f64 (-.f64 (sqrt.f64 (+.f64 x #s(literal 1 binary64))) (sqrt.f64 x)) (-.f64 (sqrt.f64 (+.f64 y #s(literal 1 binary64))) (sqrt.f64 y))) (-.f64 (sqrt.f64 (+.f64 z #s(literal 1 binary64))) (sqrt.f64 z))) < 1.0009999999999999Initial program 88.5%
associate-+l+88.5%
associate-+l-61.7%
associate-+l-88.5%
+-commutative88.5%
+-commutative88.5%
+-commutative88.5%
Simplified88.5%
+-commutative88.5%
flip--88.5%
flip--88.4%
frac-add88.4%
Applied egg-rr88.9%
Simplified94.0%
Taylor expanded in y around inf 65.4%
if 1.0009999999999999 < (+.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.7%
associate-+l+97.7%
associate-+l-77.3%
associate-+l-97.7%
+-commutative97.7%
+-commutative97.7%
+-commutative97.7%
Simplified97.7%
flip--97.7%
add-sqr-sqrt89.6%
add-sqr-sqrt97.9%
Applied egg-rr97.9%
associate--l+98.1%
+-inverses98.1%
metadata-eval98.1%
+-commutative98.1%
Simplified98.1%
Final simplification82.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 (+ y 1.0)))
(t_2 (+ (sqrt y) t_1))
(t_3 (+ (sqrt x) (sqrt (+ 1.0 x))))
(t_4 (- (sqrt (+ 1.0 z)) (sqrt z)))
(t_5 (sqrt (+ 1.0 t))))
(if (<= t_4 2e-5)
(+
(/ (+ t_2 t_3) (* t_2 t_3))
(+ (- t_5 (sqrt t)) (* 0.5 (sqrt (/ 1.0 z)))))
(+
(- (+ 1.0 t_1) (+ (sqrt y) (sqrt x)))
(+ t_4 (/ 1.0 (+ t_5 (sqrt t))))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((y + 1.0));
double t_2 = sqrt(y) + t_1;
double t_3 = sqrt(x) + sqrt((1.0 + x));
double t_4 = sqrt((1.0 + z)) - sqrt(z);
double t_5 = sqrt((1.0 + t));
double tmp;
if (t_4 <= 2e-5) {
tmp = ((t_2 + t_3) / (t_2 * t_3)) + ((t_5 - sqrt(t)) + (0.5 * sqrt((1.0 / z))));
} else {
tmp = ((1.0 + t_1) - (sqrt(y) + sqrt(x))) + (t_4 + (1.0 / (t_5 + 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) :: tmp
t_1 = sqrt((y + 1.0d0))
t_2 = sqrt(y) + t_1
t_3 = sqrt(x) + sqrt((1.0d0 + x))
t_4 = sqrt((1.0d0 + z)) - sqrt(z)
t_5 = sqrt((1.0d0 + t))
if (t_4 <= 2d-5) then
tmp = ((t_2 + t_3) / (t_2 * t_3)) + ((t_5 - sqrt(t)) + (0.5d0 * sqrt((1.0d0 / z))))
else
tmp = ((1.0d0 + t_1) - (sqrt(y) + sqrt(x))) + (t_4 + (1.0d0 / (t_5 + 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((y + 1.0));
double t_2 = Math.sqrt(y) + t_1;
double t_3 = Math.sqrt(x) + Math.sqrt((1.0 + x));
double t_4 = Math.sqrt((1.0 + z)) - Math.sqrt(z);
double t_5 = Math.sqrt((1.0 + t));
double tmp;
if (t_4 <= 2e-5) {
tmp = ((t_2 + t_3) / (t_2 * t_3)) + ((t_5 - Math.sqrt(t)) + (0.5 * Math.sqrt((1.0 / z))));
} else {
tmp = ((1.0 + t_1) - (Math.sqrt(y) + Math.sqrt(x))) + (t_4 + (1.0 / (t_5 + Math.sqrt(t))));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((y + 1.0)) t_2 = math.sqrt(y) + t_1 t_3 = math.sqrt(x) + math.sqrt((1.0 + x)) t_4 = math.sqrt((1.0 + z)) - math.sqrt(z) t_5 = math.sqrt((1.0 + t)) tmp = 0 if t_4 <= 2e-5: tmp = ((t_2 + t_3) / (t_2 * t_3)) + ((t_5 - math.sqrt(t)) + (0.5 * math.sqrt((1.0 / z)))) else: tmp = ((1.0 + t_1) - (math.sqrt(y) + math.sqrt(x))) + (t_4 + (1.0 / (t_5 + math.sqrt(t)))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(y + 1.0)) t_2 = Float64(sqrt(y) + t_1) t_3 = Float64(sqrt(x) + sqrt(Float64(1.0 + x))) t_4 = Float64(sqrt(Float64(1.0 + z)) - sqrt(z)) t_5 = sqrt(Float64(1.0 + t)) tmp = 0.0 if (t_4 <= 2e-5) tmp = Float64(Float64(Float64(t_2 + t_3) / Float64(t_2 * t_3)) + Float64(Float64(t_5 - sqrt(t)) + Float64(0.5 * sqrt(Float64(1.0 / z))))); else tmp = Float64(Float64(Float64(1.0 + t_1) - Float64(sqrt(y) + sqrt(x))) + Float64(t_4 + Float64(1.0 / Float64(t_5 + 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((y + 1.0));
t_2 = sqrt(y) + t_1;
t_3 = sqrt(x) + sqrt((1.0 + x));
t_4 = sqrt((1.0 + z)) - sqrt(z);
t_5 = sqrt((1.0 + t));
tmp = 0.0;
if (t_4 <= 2e-5)
tmp = ((t_2 + t_3) / (t_2 * t_3)) + ((t_5 - sqrt(t)) + (0.5 * sqrt((1.0 / z))));
else
tmp = ((1.0 + t_1) - (sqrt(y) + sqrt(x))) + (t_4 + (1.0 / (t_5 + 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[(y + 1.0), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(N[Sqrt[y], $MachinePrecision] + t$95$1), $MachinePrecision]}, Block[{t$95$3 = N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t$95$4, 2e-5], N[(N[(N[(t$95$2 + t$95$3), $MachinePrecision] / N[(t$95$2 * t$95$3), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$5 - N[Sqrt[t], $MachinePrecision]), $MachinePrecision] + N[(0.5 * N[Sqrt[N[(1.0 / z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 + t$95$1), $MachinePrecision] - N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$4 + N[(1.0 / N[(t$95$5 + 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{y + 1}\\
t_2 := \sqrt{y} + t\_1\\
t_3 := \sqrt{x} + \sqrt{1 + x}\\
t_4 := \sqrt{1 + z} - \sqrt{z}\\
t_5 := \sqrt{1 + t}\\
\mathbf{if}\;t\_4 \leq 2 \cdot 10^{-5}:\\
\;\;\;\;\frac{t\_2 + t\_3}{t\_2 \cdot t\_3} + \left(\left(t\_5 - \sqrt{t}\right) + 0.5 \cdot \sqrt{\frac{1}{z}}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(1 + t\_1\right) - \left(\sqrt{y} + \sqrt{x}\right)\right) + \left(t\_4 + \frac{1}{t\_5 + \sqrt{t}}\right)\\
\end{array}
\end{array}
if (-.f64 (sqrt.f64 (+.f64 z #s(literal 1 binary64))) (sqrt.f64 z)) < 2.00000000000000016e-5Initial program 89.3%
associate-+l+89.3%
associate-+l-63.3%
associate-+l-89.3%
+-commutative89.3%
+-commutative89.3%
+-commutative89.3%
Simplified89.3%
+-commutative89.3%
flip--89.3%
flip--89.3%
frac-add89.2%
Applied egg-rr89.5%
Simplified93.9%
Taylor expanded in z around inf 97.2%
if 2.00000000000000016e-5 < (-.f64 (sqrt.f64 (+.f64 z #s(literal 1 binary64))) (sqrt.f64 z)) Initial program 97.2%
associate-+l+97.2%
associate-+l-76.2%
associate-+l-97.2%
+-commutative97.2%
+-commutative97.2%
+-commutative97.2%
Simplified97.2%
Taylor expanded in x around 0 36.4%
+-commutative36.4%
Simplified36.4%
flip--36.4%
add-sqr-sqrt29.2%
add-sqr-sqrt36.4%
Applied egg-rr36.4%
associate--l+36.6%
+-inverses36.6%
metadata-eval36.6%
+-commutative36.6%
Simplified36.6%
Final simplification66.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 y) (sqrt (+ y 1.0))))
(t_2 (+ (sqrt x) (sqrt (+ 1.0 x)))))
(+
(/ (+ t_1 t_2) (* t_1 t_2))
(+ (- (sqrt (+ 1.0 z)) (sqrt z)) (- (sqrt (+ 1.0 t)) (sqrt t))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt(y) + sqrt((y + 1.0));
double t_2 = sqrt(x) + sqrt((1.0 + x));
return ((t_1 + t_2) / (t_1 * t_2)) + ((sqrt((1.0 + z)) - sqrt(z)) + (sqrt((1.0 + t)) - sqrt(t)));
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
t_1 = sqrt(y) + sqrt((y + 1.0d0))
t_2 = sqrt(x) + sqrt((1.0d0 + x))
code = ((t_1 + t_2) / (t_1 * t_2)) + ((sqrt((1.0d0 + z)) - sqrt(z)) + (sqrt((1.0d0 + t)) - sqrt(t)))
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt(y) + Math.sqrt((y + 1.0));
double t_2 = Math.sqrt(x) + Math.sqrt((1.0 + x));
return ((t_1 + t_2) / (t_1 * t_2)) + ((Math.sqrt((1.0 + z)) - Math.sqrt(z)) + (Math.sqrt((1.0 + t)) - Math.sqrt(t)));
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt(y) + math.sqrt((y + 1.0)) t_2 = math.sqrt(x) + math.sqrt((1.0 + x)) return ((t_1 + t_2) / (t_1 * t_2)) + ((math.sqrt((1.0 + z)) - math.sqrt(z)) + (math.sqrt((1.0 + t)) - math.sqrt(t)))
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = Float64(sqrt(y) + sqrt(Float64(y + 1.0))) t_2 = Float64(sqrt(x) + sqrt(Float64(1.0 + x))) return Float64(Float64(Float64(t_1 + t_2) / Float64(t_1 * t_2)) + Float64(Float64(sqrt(Float64(1.0 + z)) - sqrt(z)) + Float64(sqrt(Float64(1.0 + t)) - sqrt(t)))) end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp = code(x, y, z, t)
t_1 = sqrt(y) + sqrt((y + 1.0));
t_2 = sqrt(x) + sqrt((1.0 + x));
tmp = ((t_1 + t_2) / (t_1 * t_2)) + ((sqrt((1.0 + z)) - sqrt(z)) + (sqrt((1.0 + t)) - sqrt(t)));
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, N[(N[(N[(t$95$1 + t$95$2), $MachinePrecision] / N[(t$95$1 * t$95$2), $MachinePrecision]), $MachinePrecision] + N[(N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{y} + \sqrt{y + 1}\\
t_2 := \sqrt{x} + \sqrt{1 + x}\\
\frac{t\_1 + t\_2}{t\_1 \cdot t\_2} + \left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\sqrt{1 + t} - \sqrt{t}\right)\right)
\end{array}
\end{array}
Initial program 93.3%
associate-+l+93.3%
associate-+l-69.8%
associate-+l-93.3%
+-commutative93.3%
+-commutative93.3%
+-commutative93.3%
Simplified93.3%
+-commutative93.3%
flip--93.3%
flip--93.3%
frac-add93.3%
Applied egg-rr93.8%
Simplified96.6%
Final simplification96.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 t)))
(t_2 (sqrt (+ 1.0 x)))
(t_3 (- (sqrt (+ 1.0 z)) (sqrt z))))
(if (<= y 90000000.0)
(+
(+ t_3 (/ 1.0 (+ t_1 (sqrt t))))
(+ (- t_2 (sqrt x)) (- (sqrt (+ y 1.0)) (sqrt y))))
(+
(+ t_3 (- t_1 (sqrt t)))
(+ (* 0.5 (sqrt (/ 1.0 y))) (/ 1.0 (+ (sqrt x) t_2)))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + t));
double t_2 = sqrt((1.0 + x));
double t_3 = sqrt((1.0 + z)) - sqrt(z);
double tmp;
if (y <= 90000000.0) {
tmp = (t_3 + (1.0 / (t_1 + sqrt(t)))) + ((t_2 - sqrt(x)) + (sqrt((y + 1.0)) - sqrt(y)));
} else {
tmp = (t_3 + (t_1 - sqrt(t))) + ((0.5 * sqrt((1.0 / y))) + (1.0 / (sqrt(x) + t_2)));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = sqrt((1.0d0 + t))
t_2 = sqrt((1.0d0 + x))
t_3 = sqrt((1.0d0 + z)) - sqrt(z)
if (y <= 90000000.0d0) then
tmp = (t_3 + (1.0d0 / (t_1 + sqrt(t)))) + ((t_2 - sqrt(x)) + (sqrt((y + 1.0d0)) - sqrt(y)))
else
tmp = (t_3 + (t_1 - sqrt(t))) + ((0.5d0 * sqrt((1.0d0 / y))) + (1.0d0 / (sqrt(x) + t_2)))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + t));
double t_2 = Math.sqrt((1.0 + x));
double t_3 = Math.sqrt((1.0 + z)) - Math.sqrt(z);
double tmp;
if (y <= 90000000.0) {
tmp = (t_3 + (1.0 / (t_1 + Math.sqrt(t)))) + ((t_2 - Math.sqrt(x)) + (Math.sqrt((y + 1.0)) - Math.sqrt(y)));
} else {
tmp = (t_3 + (t_1 - Math.sqrt(t))) + ((0.5 * Math.sqrt((1.0 / y))) + (1.0 / (Math.sqrt(x) + t_2)));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + t)) t_2 = math.sqrt((1.0 + x)) t_3 = math.sqrt((1.0 + z)) - math.sqrt(z) tmp = 0 if y <= 90000000.0: tmp = (t_3 + (1.0 / (t_1 + math.sqrt(t)))) + ((t_2 - math.sqrt(x)) + (math.sqrt((y + 1.0)) - math.sqrt(y))) else: tmp = (t_3 + (t_1 - math.sqrt(t))) + ((0.5 * math.sqrt((1.0 / y))) + (1.0 / (math.sqrt(x) + t_2))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(1.0 + t)) t_2 = sqrt(Float64(1.0 + x)) t_3 = Float64(sqrt(Float64(1.0 + z)) - sqrt(z)) tmp = 0.0 if (y <= 90000000.0) tmp = Float64(Float64(t_3 + Float64(1.0 / Float64(t_1 + sqrt(t)))) + Float64(Float64(t_2 - sqrt(x)) + Float64(sqrt(Float64(y + 1.0)) - sqrt(y)))); else tmp = Float64(Float64(t_3 + Float64(t_1 - sqrt(t))) + Float64(Float64(0.5 * sqrt(Float64(1.0 / y))) + Float64(1.0 / Float64(sqrt(x) + t_2)))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + t));
t_2 = sqrt((1.0 + x));
t_3 = sqrt((1.0 + z)) - sqrt(z);
tmp = 0.0;
if (y <= 90000000.0)
tmp = (t_3 + (1.0 / (t_1 + sqrt(t)))) + ((t_2 - sqrt(x)) + (sqrt((y + 1.0)) - sqrt(y)));
else
tmp = (t_3 + (t_1 - sqrt(t))) + ((0.5 * sqrt((1.0 / y))) + (1.0 / (sqrt(x) + t_2)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 90000000.0], N[(N[(t$95$3 + N[(1.0 / N[(t$95$1 + N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$2 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(t$95$3 + N[(t$95$1 - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(0.5 * N[Sqrt[N[(1.0 / y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $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 + x}\\
t_3 := \sqrt{1 + z} - \sqrt{z}\\
\mathbf{if}\;y \leq 90000000:\\
\;\;\;\;\left(t\_3 + \frac{1}{t\_1 + \sqrt{t}}\right) + \left(\left(t\_2 - \sqrt{x}\right) + \left(\sqrt{y + 1} - \sqrt{y}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(t\_3 + \left(t\_1 - \sqrt{t}\right)\right) + \left(0.5 \cdot \sqrt{\frac{1}{y}} + \frac{1}{\sqrt{x} + t\_2}\right)\\
\end{array}
\end{array}
if y < 9e7Initial program 98.4%
associate-+l+98.4%
associate-+l-52.8%
associate-+l-98.4%
+-commutative98.4%
+-commutative98.4%
+-commutative98.4%
Simplified98.4%
flip--42.1%
add-sqr-sqrt36.2%
add-sqr-sqrt42.1%
Applied egg-rr98.4%
associate--l+42.2%
+-inverses42.2%
metadata-eval42.2%
+-commutative42.2%
Simplified98.4%
if 9e7 < y Initial program 87.9%
associate-+l+87.9%
associate-+l-87.9%
associate-+l-87.9%
+-commutative87.9%
+-commutative87.9%
+-commutative87.9%
Simplified87.9%
+-commutative87.9%
flip--87.9%
flip--87.8%
frac-add87.8%
Applied egg-rr88.8%
Simplified94.1%
Taylor expanded in y around inf 94.1%
Final simplification96.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 t)) (sqrt t))) (t_2 (sqrt (+ 1.0 z))))
(if (<= y 48000000.0)
(+
(- (+ 1.0 (sqrt (+ y 1.0))) (+ (sqrt y) (sqrt x)))
(+ t_1 (/ 1.0 (+ t_2 (sqrt z)))))
(+
(+ (- t_2 (sqrt z)) t_1)
(+ (* 0.5 (sqrt (/ 1.0 y))) (/ 1.0 (+ (sqrt x) (sqrt (+ 1.0 x)))))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + t)) - sqrt(t);
double t_2 = sqrt((1.0 + z));
double tmp;
if (y <= 48000000.0) {
tmp = ((1.0 + sqrt((y + 1.0))) - (sqrt(y) + sqrt(x))) + (t_1 + (1.0 / (t_2 + sqrt(z))));
} else {
tmp = ((t_2 - sqrt(z)) + t_1) + ((0.5 * sqrt((1.0 / y))) + (1.0 / (sqrt(x) + sqrt((1.0 + x)))));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = sqrt((1.0d0 + t)) - sqrt(t)
t_2 = sqrt((1.0d0 + z))
if (y <= 48000000.0d0) then
tmp = ((1.0d0 + sqrt((y + 1.0d0))) - (sqrt(y) + sqrt(x))) + (t_1 + (1.0d0 / (t_2 + sqrt(z))))
else
tmp = ((t_2 - sqrt(z)) + t_1) + ((0.5d0 * sqrt((1.0d0 / y))) + (1.0d0 / (sqrt(x) + sqrt((1.0d0 + x)))))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + t)) - Math.sqrt(t);
double t_2 = Math.sqrt((1.0 + z));
double tmp;
if (y <= 48000000.0) {
tmp = ((1.0 + Math.sqrt((y + 1.0))) - (Math.sqrt(y) + Math.sqrt(x))) + (t_1 + (1.0 / (t_2 + Math.sqrt(z))));
} else {
tmp = ((t_2 - Math.sqrt(z)) + t_1) + ((0.5 * Math.sqrt((1.0 / y))) + (1.0 / (Math.sqrt(x) + Math.sqrt((1.0 + x)))));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + t)) - math.sqrt(t) t_2 = math.sqrt((1.0 + z)) tmp = 0 if y <= 48000000.0: tmp = ((1.0 + math.sqrt((y + 1.0))) - (math.sqrt(y) + math.sqrt(x))) + (t_1 + (1.0 / (t_2 + math.sqrt(z)))) else: tmp = ((t_2 - math.sqrt(z)) + t_1) + ((0.5 * math.sqrt((1.0 / y))) + (1.0 / (math.sqrt(x) + math.sqrt((1.0 + x))))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = Float64(sqrt(Float64(1.0 + t)) - sqrt(t)) t_2 = sqrt(Float64(1.0 + z)) tmp = 0.0 if (y <= 48000000.0) tmp = Float64(Float64(Float64(1.0 + sqrt(Float64(y + 1.0))) - Float64(sqrt(y) + sqrt(x))) + Float64(t_1 + Float64(1.0 / Float64(t_2 + sqrt(z))))); else tmp = Float64(Float64(Float64(t_2 - sqrt(z)) + t_1) + Float64(Float64(0.5 * sqrt(Float64(1.0 / y))) + Float64(1.0 / Float64(sqrt(x) + sqrt(Float64(1.0 + x)))))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + t)) - sqrt(t);
t_2 = sqrt((1.0 + z));
tmp = 0.0;
if (y <= 48000000.0)
tmp = ((1.0 + sqrt((y + 1.0))) - (sqrt(y) + sqrt(x))) + (t_1 + (1.0 / (t_2 + sqrt(z))));
else
tmp = ((t_2 - sqrt(z)) + t_1) + ((0.5 * sqrt((1.0 / y))) + (1.0 / (sqrt(x) + sqrt((1.0 + x)))));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y, 48000000.0], N[(N[(N[(1.0 + N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$1 + N[(1.0 / N[(t$95$2 + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(t$95$2 - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision] + N[(N[(0.5 * N[Sqrt[N[(1.0 / y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + t} - \sqrt{t}\\
t_2 := \sqrt{1 + z}\\
\mathbf{if}\;y \leq 48000000:\\
\;\;\;\;\left(\left(1 + \sqrt{y + 1}\right) - \left(\sqrt{y} + \sqrt{x}\right)\right) + \left(t\_1 + \frac{1}{t\_2 + \sqrt{z}}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(t\_2 - \sqrt{z}\right) + t\_1\right) + \left(0.5 \cdot \sqrt{\frac{1}{y}} + \frac{1}{\sqrt{x} + \sqrt{1 + x}}\right)\\
\end{array}
\end{array}
if y < 4.8e7Initial program 98.4%
associate-+l+98.4%
associate-+l-52.8%
associate-+l-98.4%
+-commutative98.4%
+-commutative98.4%
+-commutative98.4%
Simplified98.4%
Taylor expanded in x around 0 42.1%
+-commutative42.1%
Simplified42.1%
flip--98.4%
add-sqr-sqrt75.6%
add-sqr-sqrt98.5%
Applied egg-rr42.3%
associate--l+99.0%
+-inverses99.0%
metadata-eval99.0%
+-commutative99.0%
Simplified42.5%
if 4.8e7 < y Initial program 87.9%
associate-+l+87.9%
associate-+l-87.9%
associate-+l-87.9%
+-commutative87.9%
+-commutative87.9%
+-commutative87.9%
Simplified87.9%
+-commutative87.9%
flip--87.9%
flip--87.8%
frac-add87.8%
Applied egg-rr88.8%
Simplified94.1%
Taylor expanded in y around inf 94.1%
Final simplification67.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 t)) (sqrt t))) (t_2 (sqrt (+ 1.0 z))))
(if (<= y 3.4e+16)
(+
(- (+ 1.0 (sqrt (+ y 1.0))) (+ (sqrt y) (sqrt x)))
(+ t_1 (/ 1.0 (+ t_2 (sqrt z)))))
(+ (+ (- t_2 (sqrt z)) t_1) (/ 1.0 (+ (sqrt x) (sqrt (+ 1.0 x))))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + t)) - sqrt(t);
double t_2 = sqrt((1.0 + z));
double tmp;
if (y <= 3.4e+16) {
tmp = ((1.0 + sqrt((y + 1.0))) - (sqrt(y) + sqrt(x))) + (t_1 + (1.0 / (t_2 + sqrt(z))));
} else {
tmp = ((t_2 - sqrt(z)) + t_1) + (1.0 / (sqrt(x) + sqrt((1.0 + x))));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = sqrt((1.0d0 + t)) - sqrt(t)
t_2 = sqrt((1.0d0 + z))
if (y <= 3.4d+16) then
tmp = ((1.0d0 + sqrt((y + 1.0d0))) - (sqrt(y) + sqrt(x))) + (t_1 + (1.0d0 / (t_2 + sqrt(z))))
else
tmp = ((t_2 - sqrt(z)) + t_1) + (1.0d0 / (sqrt(x) + sqrt((1.0d0 + x))))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + t)) - Math.sqrt(t);
double t_2 = Math.sqrt((1.0 + z));
double tmp;
if (y <= 3.4e+16) {
tmp = ((1.0 + Math.sqrt((y + 1.0))) - (Math.sqrt(y) + Math.sqrt(x))) + (t_1 + (1.0 / (t_2 + Math.sqrt(z))));
} else {
tmp = ((t_2 - Math.sqrt(z)) + t_1) + (1.0 / (Math.sqrt(x) + Math.sqrt((1.0 + x))));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + t)) - math.sqrt(t) t_2 = math.sqrt((1.0 + z)) tmp = 0 if y <= 3.4e+16: tmp = ((1.0 + math.sqrt((y + 1.0))) - (math.sqrt(y) + math.sqrt(x))) + (t_1 + (1.0 / (t_2 + math.sqrt(z)))) else: tmp = ((t_2 - math.sqrt(z)) + t_1) + (1.0 / (math.sqrt(x) + math.sqrt((1.0 + x)))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = Float64(sqrt(Float64(1.0 + t)) - sqrt(t)) t_2 = sqrt(Float64(1.0 + z)) tmp = 0.0 if (y <= 3.4e+16) tmp = Float64(Float64(Float64(1.0 + sqrt(Float64(y + 1.0))) - Float64(sqrt(y) + sqrt(x))) + Float64(t_1 + Float64(1.0 / Float64(t_2 + sqrt(z))))); else tmp = Float64(Float64(Float64(t_2 - sqrt(z)) + t_1) + Float64(1.0 / Float64(sqrt(x) + sqrt(Float64(1.0 + x))))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + t)) - sqrt(t);
t_2 = sqrt((1.0 + z));
tmp = 0.0;
if (y <= 3.4e+16)
tmp = ((1.0 + sqrt((y + 1.0))) - (sqrt(y) + sqrt(x))) + (t_1 + (1.0 / (t_2 + sqrt(z))));
else
tmp = ((t_2 - sqrt(z)) + t_1) + (1.0 / (sqrt(x) + sqrt((1.0 + x))));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y, 3.4e+16], N[(N[(N[(1.0 + N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$1 + N[(1.0 / N[(t$95$2 + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(t$95$2 - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + t} - \sqrt{t}\\
t_2 := \sqrt{1 + z}\\
\mathbf{if}\;y \leq 3.4 \cdot 10^{+16}:\\
\;\;\;\;\left(\left(1 + \sqrt{y + 1}\right) - \left(\sqrt{y} + \sqrt{x}\right)\right) + \left(t\_1 + \frac{1}{t\_2 + \sqrt{z}}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(t\_2 - \sqrt{z}\right) + t\_1\right) + \frac{1}{\sqrt{x} + \sqrt{1 + x}}\\
\end{array}
\end{array}
if y < 3.4e16Initial program 97.5%
associate-+l+97.5%
associate-+l-53.3%
associate-+l-97.5%
+-commutative97.5%
+-commutative97.5%
+-commutative97.5%
Simplified97.5%
Taylor expanded in x around 0 42.5%
+-commutative42.5%
Simplified42.5%
flip--97.5%
add-sqr-sqrt74.9%
add-sqr-sqrt97.7%
Applied egg-rr42.6%
associate--l+98.2%
+-inverses98.2%
metadata-eval98.2%
+-commutative98.2%
Simplified42.9%
if 3.4e16 < y Initial program 88.5%
associate-+l+88.5%
associate-+l-88.5%
associate-+l-88.5%
+-commutative88.5%
+-commutative88.5%
+-commutative88.5%
Simplified88.5%
+-commutative88.5%
flip--88.5%
flip--88.5%
frac-add88.5%
Applied egg-rr88.8%
Simplified93.9%
Taylor expanded in y around inf 89.9%
Final simplification64.9%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (sqrt (+ 1.0 z)) (sqrt z))) (t_2 (sqrt (+ 1.0 t))))
(if (<= y 2.8e+17)
(+
(- (+ 1.0 (sqrt (+ y 1.0))) (+ (sqrt y) (sqrt x)))
(+ t_1 (/ 1.0 (+ t_2 (sqrt t)))))
(+ (+ t_1 (- t_2 (sqrt t))) (/ 1.0 (+ (sqrt x) (sqrt (+ 1.0 x))))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + z)) - sqrt(z);
double t_2 = sqrt((1.0 + t));
double tmp;
if (y <= 2.8e+17) {
tmp = ((1.0 + sqrt((y + 1.0))) - (sqrt(y) + sqrt(x))) + (t_1 + (1.0 / (t_2 + sqrt(t))));
} else {
tmp = (t_1 + (t_2 - sqrt(t))) + (1.0 / (sqrt(x) + sqrt((1.0 + x))));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = sqrt((1.0d0 + z)) - sqrt(z)
t_2 = sqrt((1.0d0 + t))
if (y <= 2.8d+17) then
tmp = ((1.0d0 + sqrt((y + 1.0d0))) - (sqrt(y) + sqrt(x))) + (t_1 + (1.0d0 / (t_2 + sqrt(t))))
else
tmp = (t_1 + (t_2 - sqrt(t))) + (1.0d0 / (sqrt(x) + sqrt((1.0d0 + x))))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + z)) - Math.sqrt(z);
double t_2 = Math.sqrt((1.0 + t));
double tmp;
if (y <= 2.8e+17) {
tmp = ((1.0 + Math.sqrt((y + 1.0))) - (Math.sqrt(y) + Math.sqrt(x))) + (t_1 + (1.0 / (t_2 + Math.sqrt(t))));
} else {
tmp = (t_1 + (t_2 - Math.sqrt(t))) + (1.0 / (Math.sqrt(x) + Math.sqrt((1.0 + x))));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + z)) - math.sqrt(z) t_2 = math.sqrt((1.0 + t)) tmp = 0 if y <= 2.8e+17: tmp = ((1.0 + math.sqrt((y + 1.0))) - (math.sqrt(y) + math.sqrt(x))) + (t_1 + (1.0 / (t_2 + math.sqrt(t)))) else: tmp = (t_1 + (t_2 - math.sqrt(t))) + (1.0 / (math.sqrt(x) + math.sqrt((1.0 + x)))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = Float64(sqrt(Float64(1.0 + z)) - sqrt(z)) t_2 = sqrt(Float64(1.0 + t)) tmp = 0.0 if (y <= 2.8e+17) tmp = Float64(Float64(Float64(1.0 + sqrt(Float64(y + 1.0))) - Float64(sqrt(y) + sqrt(x))) + Float64(t_1 + Float64(1.0 / Float64(t_2 + sqrt(t))))); else tmp = Float64(Float64(t_1 + Float64(t_2 - sqrt(t))) + Float64(1.0 / Float64(sqrt(x) + sqrt(Float64(1.0 + x))))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + z)) - sqrt(z);
t_2 = sqrt((1.0 + t));
tmp = 0.0;
if (y <= 2.8e+17)
tmp = ((1.0 + sqrt((y + 1.0))) - (sqrt(y) + sqrt(x))) + (t_1 + (1.0 / (t_2 + sqrt(t))));
else
tmp = (t_1 + (t_2 - sqrt(t))) + (1.0 / (sqrt(x) + sqrt((1.0 + x))));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y, 2.8e+17], N[(N[(N[(1.0 + N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$1 + N[(1.0 / N[(t$95$2 + N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(t$95$1 + N[(t$95$2 - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + z} - \sqrt{z}\\
t_2 := \sqrt{1 + t}\\
\mathbf{if}\;y \leq 2.8 \cdot 10^{+17}:\\
\;\;\;\;\left(\left(1 + \sqrt{y + 1}\right) - \left(\sqrt{y} + \sqrt{x}\right)\right) + \left(t\_1 + \frac{1}{t\_2 + \sqrt{t}}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(t\_1 + \left(t\_2 - \sqrt{t}\right)\right) + \frac{1}{\sqrt{x} + \sqrt{1 + x}}\\
\end{array}
\end{array}
if y < 2.8e17Initial program 97.5%
associate-+l+97.5%
associate-+l-53.3%
associate-+l-97.5%
+-commutative97.5%
+-commutative97.5%
+-commutative97.5%
Simplified97.5%
Taylor expanded in x around 0 42.5%
+-commutative42.5%
Simplified42.5%
flip--42.5%
add-sqr-sqrt36.7%
add-sqr-sqrt42.5%
Applied egg-rr42.5%
associate--l+42.5%
+-inverses42.5%
metadata-eval42.5%
+-commutative42.5%
Simplified42.5%
if 2.8e17 < y Initial program 88.5%
associate-+l+88.5%
associate-+l-88.5%
associate-+l-88.5%
+-commutative88.5%
+-commutative88.5%
+-commutative88.5%
Simplified88.5%
+-commutative88.5%
flip--88.5%
flip--88.5%
frac-add88.5%
Applied egg-rr88.8%
Simplified93.9%
Taylor expanded in y around inf 89.9%
Final simplification64.8%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (+ (- (sqrt (+ 1.0 z)) (sqrt z)) (- (sqrt (+ 1.0 t)) (sqrt t)))))
(if (<= y 5e+16)
(+ t_1 (- (+ 1.0 (sqrt (+ y 1.0))) (+ (sqrt y) (sqrt x))))
(+ t_1 (/ 1.0 (+ (sqrt x) (sqrt (+ 1.0 x))))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = (sqrt((1.0 + z)) - sqrt(z)) + (sqrt((1.0 + t)) - sqrt(t));
double tmp;
if (y <= 5e+16) {
tmp = t_1 + ((1.0 + sqrt((y + 1.0))) - (sqrt(y) + sqrt(x)));
} else {
tmp = t_1 + (1.0 / (sqrt(x) + sqrt((1.0 + x))));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = (sqrt((1.0d0 + z)) - sqrt(z)) + (sqrt((1.0d0 + t)) - sqrt(t))
if (y <= 5d+16) then
tmp = t_1 + ((1.0d0 + sqrt((y + 1.0d0))) - (sqrt(y) + sqrt(x)))
else
tmp = t_1 + (1.0d0 / (sqrt(x) + sqrt((1.0d0 + x))))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = (Math.sqrt((1.0 + z)) - Math.sqrt(z)) + (Math.sqrt((1.0 + t)) - Math.sqrt(t));
double tmp;
if (y <= 5e+16) {
tmp = t_1 + ((1.0 + Math.sqrt((y + 1.0))) - (Math.sqrt(y) + Math.sqrt(x)));
} else {
tmp = t_1 + (1.0 / (Math.sqrt(x) + Math.sqrt((1.0 + x))));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = (math.sqrt((1.0 + z)) - math.sqrt(z)) + (math.sqrt((1.0 + t)) - math.sqrt(t)) tmp = 0 if y <= 5e+16: tmp = t_1 + ((1.0 + math.sqrt((y + 1.0))) - (math.sqrt(y) + math.sqrt(x))) else: tmp = t_1 + (1.0 / (math.sqrt(x) + math.sqrt((1.0 + x)))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = Float64(Float64(sqrt(Float64(1.0 + z)) - sqrt(z)) + Float64(sqrt(Float64(1.0 + t)) - sqrt(t))) tmp = 0.0 if (y <= 5e+16) tmp = Float64(t_1 + Float64(Float64(1.0 + sqrt(Float64(y + 1.0))) - Float64(sqrt(y) + sqrt(x)))); else tmp = Float64(t_1 + Float64(1.0 / Float64(sqrt(x) + sqrt(Float64(1.0 + x))))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = (sqrt((1.0 + z)) - sqrt(z)) + (sqrt((1.0 + t)) - sqrt(t));
tmp = 0.0;
if (y <= 5e+16)
tmp = t_1 + ((1.0 + sqrt((y + 1.0))) - (sqrt(y) + sqrt(x)));
else
tmp = t_1 + (1.0 / (sqrt(x) + sqrt((1.0 + x))));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 5e+16], N[(t$95$1 + N[(N[(1.0 + N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 + N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + N[Sqrt[N[(1.0 + x), $MachinePrecision]], $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 + z} - \sqrt{z}\right) + \left(\sqrt{1 + t} - \sqrt{t}\right)\\
\mathbf{if}\;y \leq 5 \cdot 10^{+16}:\\
\;\;\;\;t\_1 + \left(\left(1 + \sqrt{y + 1}\right) - \left(\sqrt{y} + \sqrt{x}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1 + \frac{1}{\sqrt{x} + \sqrt{1 + x}}\\
\end{array}
\end{array}
if y < 5e16Initial program 97.5%
associate-+l+97.5%
associate-+l-53.3%
associate-+l-97.5%
+-commutative97.5%
+-commutative97.5%
+-commutative97.5%
Simplified97.5%
Taylor expanded in x around 0 42.5%
+-commutative42.5%
Simplified42.5%
if 5e16 < y Initial program 88.5%
associate-+l+88.5%
associate-+l-88.5%
associate-+l-88.5%
+-commutative88.5%
+-commutative88.5%
+-commutative88.5%
Simplified88.5%
+-commutative88.5%
flip--88.5%
flip--88.5%
frac-add88.5%
Applied egg-rr88.8%
Simplified93.9%
Taylor expanded in y around inf 89.9%
Final simplification64.7%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ 1.0 z)))
(t_2 (sqrt (+ 1.0 x)))
(t_3 (+ (sqrt y) (sqrt x)))
(t_4 (- (sqrt (+ 1.0 t)) (sqrt t))))
(if (<= y 9.6e-23)
(+ (+ t_4 (/ 1.0 (+ t_1 (sqrt z)))) (- 2.0 t_3))
(if (<= y 3.3e+16)
(+ (+ (sqrt (+ y 1.0)) t_2) (- (* 0.5 (pow z -0.5)) t_3))
(+ (+ (- t_1 (sqrt z)) t_4) (/ 1.0 (+ (sqrt x) t_2)))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + z));
double t_2 = sqrt((1.0 + x));
double t_3 = sqrt(y) + sqrt(x);
double t_4 = sqrt((1.0 + t)) - sqrt(t);
double tmp;
if (y <= 9.6e-23) {
tmp = (t_4 + (1.0 / (t_1 + sqrt(z)))) + (2.0 - t_3);
} else if (y <= 3.3e+16) {
tmp = (sqrt((y + 1.0)) + t_2) + ((0.5 * pow(z, -0.5)) - t_3);
} else {
tmp = ((t_1 - sqrt(z)) + t_4) + (1.0 / (sqrt(x) + t_2));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: tmp
t_1 = sqrt((1.0d0 + z))
t_2 = sqrt((1.0d0 + x))
t_3 = sqrt(y) + sqrt(x)
t_4 = sqrt((1.0d0 + t)) - sqrt(t)
if (y <= 9.6d-23) then
tmp = (t_4 + (1.0d0 / (t_1 + sqrt(z)))) + (2.0d0 - t_3)
else if (y <= 3.3d+16) then
tmp = (sqrt((y + 1.0d0)) + t_2) + ((0.5d0 * (z ** (-0.5d0))) - t_3)
else
tmp = ((t_1 - sqrt(z)) + t_4) + (1.0d0 / (sqrt(x) + t_2))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + z));
double t_2 = Math.sqrt((1.0 + x));
double t_3 = Math.sqrt(y) + Math.sqrt(x);
double t_4 = Math.sqrt((1.0 + t)) - Math.sqrt(t);
double tmp;
if (y <= 9.6e-23) {
tmp = (t_4 + (1.0 / (t_1 + Math.sqrt(z)))) + (2.0 - t_3);
} else if (y <= 3.3e+16) {
tmp = (Math.sqrt((y + 1.0)) + t_2) + ((0.5 * Math.pow(z, -0.5)) - t_3);
} else {
tmp = ((t_1 - Math.sqrt(z)) + t_4) + (1.0 / (Math.sqrt(x) + t_2));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + z)) t_2 = math.sqrt((1.0 + x)) t_3 = math.sqrt(y) + math.sqrt(x) t_4 = math.sqrt((1.0 + t)) - math.sqrt(t) tmp = 0 if y <= 9.6e-23: tmp = (t_4 + (1.0 / (t_1 + math.sqrt(z)))) + (2.0 - t_3) elif y <= 3.3e+16: tmp = (math.sqrt((y + 1.0)) + t_2) + ((0.5 * math.pow(z, -0.5)) - t_3) else: tmp = ((t_1 - math.sqrt(z)) + t_4) + (1.0 / (math.sqrt(x) + t_2)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(1.0 + z)) t_2 = sqrt(Float64(1.0 + x)) t_3 = Float64(sqrt(y) + sqrt(x)) t_4 = Float64(sqrt(Float64(1.0 + t)) - sqrt(t)) tmp = 0.0 if (y <= 9.6e-23) tmp = Float64(Float64(t_4 + Float64(1.0 / Float64(t_1 + sqrt(z)))) + Float64(2.0 - t_3)); elseif (y <= 3.3e+16) tmp = Float64(Float64(sqrt(Float64(y + 1.0)) + t_2) + Float64(Float64(0.5 * (z ^ -0.5)) - t_3)); else tmp = Float64(Float64(Float64(t_1 - sqrt(z)) + t_4) + Float64(1.0 / Float64(sqrt(x) + t_2))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + z));
t_2 = sqrt((1.0 + x));
t_3 = sqrt(y) + sqrt(x);
t_4 = sqrt((1.0 + t)) - sqrt(t);
tmp = 0.0;
if (y <= 9.6e-23)
tmp = (t_4 + (1.0 / (t_1 + sqrt(z)))) + (2.0 - t_3);
elseif (y <= 3.3e+16)
tmp = (sqrt((y + 1.0)) + t_2) + ((0.5 * (z ^ -0.5)) - t_3);
else
tmp = ((t_1 - sqrt(z)) + t_4) + (1.0 / (sqrt(x) + t_2));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 9.6e-23], N[(N[(t$95$4 + N[(1.0 / N[(t$95$1 + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(2.0 - t$95$3), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3.3e+16], N[(N[(N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision] + t$95$2), $MachinePrecision] + N[(N[(0.5 * N[Power[z, -0.5], $MachinePrecision]), $MachinePrecision] - t$95$3), $MachinePrecision]), $MachinePrecision], N[(N[(N[(t$95$1 - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] + t$95$4), $MachinePrecision] + N[(1.0 / N[(N[Sqrt[x], $MachinePrecision] + 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 + z}\\
t_2 := \sqrt{1 + x}\\
t_3 := \sqrt{y} + \sqrt{x}\\
t_4 := \sqrt{1 + t} - \sqrt{t}\\
\mathbf{if}\;y \leq 9.6 \cdot 10^{-23}:\\
\;\;\;\;\left(t\_4 + \frac{1}{t\_1 + \sqrt{z}}\right) + \left(2 - t\_3\right)\\
\mathbf{elif}\;y \leq 3.3 \cdot 10^{+16}:\\
\;\;\;\;\left(\sqrt{y + 1} + t\_2\right) + \left(0.5 \cdot {z}^{-0.5} - t\_3\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(t\_1 - \sqrt{z}\right) + t\_4\right) + \frac{1}{\sqrt{x} + t\_2}\\
\end{array}
\end{array}
if y < 9.59999999999999986e-23Initial program 98.7%
associate-+l+98.7%
associate-+l-53.7%
associate-+l-98.7%
+-commutative98.7%
+-commutative98.7%
+-commutative98.7%
Simplified98.7%
Taylor expanded in x around 0 43.8%
+-commutative43.8%
Simplified43.8%
flip--98.7%
add-sqr-sqrt74.6%
add-sqr-sqrt98.7%
Applied egg-rr43.8%
associate--l+99.2%
+-inverses99.2%
metadata-eval99.2%
+-commutative99.2%
Simplified44.1%
Taylor expanded in y around 0 44.1%
if 9.59999999999999986e-23 < y < 3.3e16Initial program 84.1%
associate-+l+84.1%
associate-+l-49.4%
associate-+l-84.1%
+-commutative84.1%
+-commutative84.1%
+-commutative84.1%
Simplified84.1%
Taylor expanded in t around inf 19.5%
associate--l+24.5%
+-commutative24.5%
+-commutative24.5%
Simplified24.5%
Taylor expanded in z around inf 18.5%
associate-+r+18.5%
Simplified18.5%
associate--l+18.5%
+-commutative18.5%
pow1/218.5%
inv-pow18.5%
pow-pow18.5%
metadata-eval18.5%
Applied egg-rr18.5%
if 3.3e16 < y Initial program 88.5%
associate-+l+88.5%
associate-+l-88.5%
associate-+l-88.5%
+-commutative88.5%
+-commutative88.5%
+-commutative88.5%
Simplified88.5%
+-commutative88.5%
flip--88.5%
flip--88.5%
frac-add88.5%
Applied egg-rr88.8%
Simplified93.9%
Taylor expanded in y around inf 89.9%
Final simplification64.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 (<= y 5.4e-21)
(+
(+ (- (sqrt (+ 1.0 t)) (sqrt t)) (/ 1.0 (+ t_1 (sqrt z))))
(- 2.0 (+ (sqrt y) (sqrt x))))
(+
(- (sqrt (+ 1.0 x)) (sqrt x))
(+ (- t_1 (sqrt z)) (- (sqrt (+ y 1.0)) (sqrt y)))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + z));
double tmp;
if (y <= 5.4e-21) {
tmp = ((sqrt((1.0 + t)) - sqrt(t)) + (1.0 / (t_1 + sqrt(z)))) + (2.0 - (sqrt(y) + sqrt(x)));
} else {
tmp = (sqrt((1.0 + x)) - sqrt(x)) + ((t_1 - sqrt(z)) + (sqrt((y + 1.0)) - sqrt(y)));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = sqrt((1.0d0 + z))
if (y <= 5.4d-21) then
tmp = ((sqrt((1.0d0 + t)) - sqrt(t)) + (1.0d0 / (t_1 + sqrt(z)))) + (2.0d0 - (sqrt(y) + sqrt(x)))
else
tmp = (sqrt((1.0d0 + x)) - sqrt(x)) + ((t_1 - sqrt(z)) + (sqrt((y + 1.0d0)) - sqrt(y)))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + z));
double tmp;
if (y <= 5.4e-21) {
tmp = ((Math.sqrt((1.0 + t)) - Math.sqrt(t)) + (1.0 / (t_1 + Math.sqrt(z)))) + (2.0 - (Math.sqrt(y) + Math.sqrt(x)));
} else {
tmp = (Math.sqrt((1.0 + x)) - Math.sqrt(x)) + ((t_1 - Math.sqrt(z)) + (Math.sqrt((y + 1.0)) - Math.sqrt(y)));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + z)) tmp = 0 if y <= 5.4e-21: tmp = ((math.sqrt((1.0 + t)) - math.sqrt(t)) + (1.0 / (t_1 + math.sqrt(z)))) + (2.0 - (math.sqrt(y) + math.sqrt(x))) else: tmp = (math.sqrt((1.0 + x)) - math.sqrt(x)) + ((t_1 - math.sqrt(z)) + (math.sqrt((y + 1.0)) - math.sqrt(y))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(1.0 + z)) tmp = 0.0 if (y <= 5.4e-21) tmp = Float64(Float64(Float64(sqrt(Float64(1.0 + t)) - sqrt(t)) + Float64(1.0 / Float64(t_1 + sqrt(z)))) + Float64(2.0 - Float64(sqrt(y) + sqrt(x)))); else tmp = Float64(Float64(sqrt(Float64(1.0 + x)) - sqrt(x)) + Float64(Float64(t_1 - sqrt(z)) + Float64(sqrt(Float64(y + 1.0)) - sqrt(y)))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + z));
tmp = 0.0;
if (y <= 5.4e-21)
tmp = ((sqrt((1.0 + t)) - sqrt(t)) + (1.0 / (t_1 + sqrt(z)))) + (2.0 - (sqrt(y) + sqrt(x)));
else
tmp = (sqrt((1.0 + x)) - sqrt(x)) + ((t_1 - sqrt(z)) + (sqrt((y + 1.0)) - sqrt(y)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y, 5.4e-21], N[(N[(N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(t$95$1 + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(2.0 - N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$1 - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + z}\\
\mathbf{if}\;y \leq 5.4 \cdot 10^{-21}:\\
\;\;\;\;\left(\left(\sqrt{1 + t} - \sqrt{t}\right) + \frac{1}{t\_1 + \sqrt{z}}\right) + \left(2 - \left(\sqrt{y} + \sqrt{x}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\sqrt{1 + x} - \sqrt{x}\right) + \left(\left(t\_1 - \sqrt{z}\right) + \left(\sqrt{y + 1} - \sqrt{y}\right)\right)\\
\end{array}
\end{array}
if y < 5.4000000000000002e-21Initial program 98.5%
associate-+l+98.5%
associate-+l-53.6%
associate-+l-98.5%
+-commutative98.5%
+-commutative98.5%
+-commutative98.5%
Simplified98.5%
Taylor expanded in x around 0 43.1%
+-commutative43.1%
Simplified43.1%
flip--98.5%
add-sqr-sqrt74.8%
add-sqr-sqrt98.5%
Applied egg-rr43.1%
associate--l+99.0%
+-inverses99.0%
metadata-eval99.0%
+-commutative99.0%
Simplified43.4%
Taylor expanded in y around 0 43.4%
if 5.4000000000000002e-21 < y Initial program 88.1%
associate-+l+88.1%
associate-+l+88.1%
+-commutative88.1%
+-commutative88.1%
associate-+l-68.7%
+-commutative68.7%
+-commutative68.7%
Simplified68.7%
Taylor expanded in t around inf 45.0%
Final simplification44.2%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (sqrt (+ 1.0 z)) (sqrt z))))
(if (<= y 5e-23)
(+ (+ t_1 (- (sqrt (+ 1.0 t)) (sqrt t))) (- 2.0 (+ (sqrt y) (sqrt x))))
(+ (- (sqrt (+ 1.0 x)) (sqrt x)) (+ t_1 (- (sqrt (+ y 1.0)) (sqrt y)))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + z)) - sqrt(z);
double tmp;
if (y <= 5e-23) {
tmp = (t_1 + (sqrt((1.0 + t)) - sqrt(t))) + (2.0 - (sqrt(y) + sqrt(x)));
} else {
tmp = (sqrt((1.0 + x)) - sqrt(x)) + (t_1 + (sqrt((y + 1.0)) - sqrt(y)));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = sqrt((1.0d0 + z)) - sqrt(z)
if (y <= 5d-23) then
tmp = (t_1 + (sqrt((1.0d0 + t)) - sqrt(t))) + (2.0d0 - (sqrt(y) + sqrt(x)))
else
tmp = (sqrt((1.0d0 + x)) - sqrt(x)) + (t_1 + (sqrt((y + 1.0d0)) - sqrt(y)))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + z)) - Math.sqrt(z);
double tmp;
if (y <= 5e-23) {
tmp = (t_1 + (Math.sqrt((1.0 + t)) - Math.sqrt(t))) + (2.0 - (Math.sqrt(y) + Math.sqrt(x)));
} else {
tmp = (Math.sqrt((1.0 + x)) - Math.sqrt(x)) + (t_1 + (Math.sqrt((y + 1.0)) - Math.sqrt(y)));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + z)) - math.sqrt(z) tmp = 0 if y <= 5e-23: tmp = (t_1 + (math.sqrt((1.0 + t)) - math.sqrt(t))) + (2.0 - (math.sqrt(y) + math.sqrt(x))) else: tmp = (math.sqrt((1.0 + x)) - math.sqrt(x)) + (t_1 + (math.sqrt((y + 1.0)) - math.sqrt(y))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = Float64(sqrt(Float64(1.0 + z)) - sqrt(z)) tmp = 0.0 if (y <= 5e-23) tmp = Float64(Float64(t_1 + Float64(sqrt(Float64(1.0 + t)) - sqrt(t))) + Float64(2.0 - Float64(sqrt(y) + sqrt(x)))); else tmp = Float64(Float64(sqrt(Float64(1.0 + x)) - sqrt(x)) + Float64(t_1 + Float64(sqrt(Float64(y + 1.0)) - sqrt(y)))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + z)) - sqrt(z);
tmp = 0.0;
if (y <= 5e-23)
tmp = (t_1 + (sqrt((1.0 + t)) - sqrt(t))) + (2.0 - (sqrt(y) + sqrt(x)));
else
tmp = (sqrt((1.0 + x)) - sqrt(x)) + (t_1 + (sqrt((y + 1.0)) - sqrt(y)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 5e-23], N[(N[(t$95$1 + N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(2.0 - N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision] + N[(t$95$1 + N[(N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + z} - \sqrt{z}\\
\mathbf{if}\;y \leq 5 \cdot 10^{-23}:\\
\;\;\;\;\left(t\_1 + \left(\sqrt{1 + t} - \sqrt{t}\right)\right) + \left(2 - \left(\sqrt{y} + \sqrt{x}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\sqrt{1 + x} - \sqrt{x}\right) + \left(t\_1 + \left(\sqrt{y + 1} - \sqrt{y}\right)\right)\\
\end{array}
\end{array}
if y < 5.0000000000000002e-23Initial program 98.7%
associate-+l+98.7%
associate-+l-53.7%
associate-+l-98.7%
+-commutative98.7%
+-commutative98.7%
+-commutative98.7%
Simplified98.7%
Taylor expanded in x around 0 43.8%
+-commutative43.8%
Simplified43.8%
Taylor expanded in y around 0 43.8%
if 5.0000000000000002e-23 < y Initial program 88.1%
associate-+l+88.1%
associate-+l+88.1%
+-commutative88.1%
+-commutative88.1%
associate-+l-67.9%
+-commutative67.9%
+-commutative67.9%
Simplified67.9%
Taylor expanded in t around inf 45.7%
Final simplification44.8%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ 1.0 x))) (t_2 (+ (sqrt y) (sqrt x))))
(if (<= y 9.6e-23)
(+
(+ (- (sqrt (+ 1.0 z)) (sqrt z)) (- (sqrt (+ 1.0 t)) (sqrt t)))
(- 2.0 t_2))
(if (<= y 52000000.0)
(+ (+ (sqrt (+ y 1.0)) t_1) (- (* 0.5 (pow z -0.5)) t_2))
(- (+ t_1 (* 0.5 (+ (sqrt (/ 1.0 z)) (sqrt (/ 1.0 y))))) (sqrt x))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + x));
double t_2 = sqrt(y) + sqrt(x);
double tmp;
if (y <= 9.6e-23) {
tmp = ((sqrt((1.0 + z)) - sqrt(z)) + (sqrt((1.0 + t)) - sqrt(t))) + (2.0 - t_2);
} else if (y <= 52000000.0) {
tmp = (sqrt((y + 1.0)) + t_1) + ((0.5 * pow(z, -0.5)) - t_2);
} else {
tmp = (t_1 + (0.5 * (sqrt((1.0 / z)) + sqrt((1.0 / y))))) - sqrt(x);
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = sqrt((1.0d0 + x))
t_2 = sqrt(y) + sqrt(x)
if (y <= 9.6d-23) then
tmp = ((sqrt((1.0d0 + z)) - sqrt(z)) + (sqrt((1.0d0 + t)) - sqrt(t))) + (2.0d0 - t_2)
else if (y <= 52000000.0d0) then
tmp = (sqrt((y + 1.0d0)) + t_1) + ((0.5d0 * (z ** (-0.5d0))) - t_2)
else
tmp = (t_1 + (0.5d0 * (sqrt((1.0d0 / z)) + sqrt((1.0d0 / y))))) - sqrt(x)
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + x));
double t_2 = Math.sqrt(y) + Math.sqrt(x);
double tmp;
if (y <= 9.6e-23) {
tmp = ((Math.sqrt((1.0 + z)) - Math.sqrt(z)) + (Math.sqrt((1.0 + t)) - Math.sqrt(t))) + (2.0 - t_2);
} else if (y <= 52000000.0) {
tmp = (Math.sqrt((y + 1.0)) + t_1) + ((0.5 * Math.pow(z, -0.5)) - t_2);
} else {
tmp = (t_1 + (0.5 * (Math.sqrt((1.0 / z)) + Math.sqrt((1.0 / y))))) - Math.sqrt(x);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + x)) t_2 = math.sqrt(y) + math.sqrt(x) tmp = 0 if y <= 9.6e-23: tmp = ((math.sqrt((1.0 + z)) - math.sqrt(z)) + (math.sqrt((1.0 + t)) - math.sqrt(t))) + (2.0 - t_2) elif y <= 52000000.0: tmp = (math.sqrt((y + 1.0)) + t_1) + ((0.5 * math.pow(z, -0.5)) - t_2) else: tmp = (t_1 + (0.5 * (math.sqrt((1.0 / z)) + math.sqrt((1.0 / y))))) - math.sqrt(x) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(1.0 + x)) t_2 = Float64(sqrt(y) + sqrt(x)) tmp = 0.0 if (y <= 9.6e-23) tmp = Float64(Float64(Float64(sqrt(Float64(1.0 + z)) - sqrt(z)) + Float64(sqrt(Float64(1.0 + t)) - sqrt(t))) + Float64(2.0 - t_2)); elseif (y <= 52000000.0) tmp = Float64(Float64(sqrt(Float64(y + 1.0)) + t_1) + Float64(Float64(0.5 * (z ^ -0.5)) - t_2)); else tmp = Float64(Float64(t_1 + Float64(0.5 * Float64(sqrt(Float64(1.0 / z)) + sqrt(Float64(1.0 / y))))) - sqrt(x)); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + x));
t_2 = sqrt(y) + sqrt(x);
tmp = 0.0;
if (y <= 9.6e-23)
tmp = ((sqrt((1.0 + z)) - sqrt(z)) + (sqrt((1.0 + t)) - sqrt(t))) + (2.0 - t_2);
elseif (y <= 52000000.0)
tmp = (sqrt((y + 1.0)) + t_1) + ((0.5 * (z ^ -0.5)) - t_2);
else
tmp = (t_1 + (0.5 * (sqrt((1.0 / z)) + sqrt((1.0 / y))))) - sqrt(x);
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 9.6e-23], N[(N[(N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] - N[Sqrt[z], $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(1.0 + t), $MachinePrecision]], $MachinePrecision] - N[Sqrt[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(2.0 - t$95$2), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 52000000.0], N[(N[(N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision] + t$95$1), $MachinePrecision] + N[(N[(0.5 * N[Power[z, -0.5], $MachinePrecision]), $MachinePrecision] - t$95$2), $MachinePrecision]), $MachinePrecision], N[(N[(t$95$1 + N[(0.5 * N[(N[Sqrt[N[(1.0 / z), $MachinePrecision]], $MachinePrecision] + N[Sqrt[N[(1.0 / y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + x}\\
t_2 := \sqrt{y} + \sqrt{x}\\
\mathbf{if}\;y \leq 9.6 \cdot 10^{-23}:\\
\;\;\;\;\left(\left(\sqrt{1 + z} - \sqrt{z}\right) + \left(\sqrt{1 + t} - \sqrt{t}\right)\right) + \left(2 - t\_2\right)\\
\mathbf{elif}\;y \leq 52000000:\\
\;\;\;\;\left(\sqrt{y + 1} + t\_1\right) + \left(0.5 \cdot {z}^{-0.5} - t\_2\right)\\
\mathbf{else}:\\
\;\;\;\;\left(t\_1 + 0.5 \cdot \left(\sqrt{\frac{1}{z}} + \sqrt{\frac{1}{y}}\right)\right) - \sqrt{x}\\
\end{array}
\end{array}
if y < 9.59999999999999986e-23Initial program 98.7%
associate-+l+98.7%
associate-+l-53.7%
associate-+l-98.7%
+-commutative98.7%
+-commutative98.7%
+-commutative98.7%
Simplified98.7%
Taylor expanded in x around 0 43.8%
+-commutative43.8%
Simplified43.8%
Taylor expanded in y around 0 43.8%
if 9.59999999999999986e-23 < y < 5.2e7Initial program 92.5%
associate-+l+92.5%
associate-+l-38.0%
associate-+l-92.5%
+-commutative92.5%
+-commutative92.5%
+-commutative92.5%
Simplified92.5%
Taylor expanded in t around inf 23.9%
associate--l+23.9%
+-commutative23.9%
+-commutative23.9%
Simplified23.9%
Taylor expanded in z around inf 17.2%
associate-+r+17.2%
Simplified17.2%
associate--l+17.2%
+-commutative17.2%
pow1/217.2%
inv-pow17.2%
pow-pow17.2%
metadata-eval17.2%
Applied egg-rr17.2%
if 5.2e7 < y Initial program 87.9%
associate-+l+87.9%
associate-+l-87.9%
associate-+l-87.9%
+-commutative87.9%
+-commutative87.9%
+-commutative87.9%
Simplified87.9%
Taylor expanded in t around inf 4.3%
associate--l+22.6%
+-commutative22.6%
+-commutative22.6%
Simplified22.6%
Taylor expanded in z around inf 4.4%
associate-+r+4.4%
Simplified4.4%
Taylor expanded in y around inf 19.7%
distribute-lft-out19.7%
Simplified19.7%
Final simplification31.4%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (+ 1.0 x))))
(if (<= y 2.45e-33)
(+ 2.0 (- (sqrt (+ 1.0 z)) (+ (sqrt x) (+ (sqrt y) (sqrt z)))))
(if (<= y 52000000.0)
(+
(+ (sqrt (+ y 1.0)) t_1)
(- (* 0.5 (pow z -0.5)) (+ (sqrt y) (sqrt x))))
(- (+ t_1 (* 0.5 (+ (sqrt (/ 1.0 z)) (sqrt (/ 1.0 y))))) (sqrt x))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 + x));
double tmp;
if (y <= 2.45e-33) {
tmp = 2.0 + (sqrt((1.0 + z)) - (sqrt(x) + (sqrt(y) + sqrt(z))));
} else if (y <= 52000000.0) {
tmp = (sqrt((y + 1.0)) + t_1) + ((0.5 * pow(z, -0.5)) - (sqrt(y) + sqrt(x)));
} else {
tmp = (t_1 + (0.5 * (sqrt((1.0 / z)) + sqrt((1.0 / y))))) - sqrt(x);
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = sqrt((1.0d0 + x))
if (y <= 2.45d-33) then
tmp = 2.0d0 + (sqrt((1.0d0 + z)) - (sqrt(x) + (sqrt(y) + sqrt(z))))
else if (y <= 52000000.0d0) then
tmp = (sqrt((y + 1.0d0)) + t_1) + ((0.5d0 * (z ** (-0.5d0))) - (sqrt(y) + sqrt(x)))
else
tmp = (t_1 + (0.5d0 * (sqrt((1.0d0 / z)) + sqrt((1.0d0 / y))))) - sqrt(x)
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 + x));
double tmp;
if (y <= 2.45e-33) {
tmp = 2.0 + (Math.sqrt((1.0 + z)) - (Math.sqrt(x) + (Math.sqrt(y) + Math.sqrt(z))));
} else if (y <= 52000000.0) {
tmp = (Math.sqrt((y + 1.0)) + t_1) + ((0.5 * Math.pow(z, -0.5)) - (Math.sqrt(y) + Math.sqrt(x)));
} else {
tmp = (t_1 + (0.5 * (Math.sqrt((1.0 / z)) + Math.sqrt((1.0 / y))))) - Math.sqrt(x);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 + x)) tmp = 0 if y <= 2.45e-33: tmp = 2.0 + (math.sqrt((1.0 + z)) - (math.sqrt(x) + (math.sqrt(y) + math.sqrt(z)))) elif y <= 52000000.0: tmp = (math.sqrt((y + 1.0)) + t_1) + ((0.5 * math.pow(z, -0.5)) - (math.sqrt(y) + math.sqrt(x))) else: tmp = (t_1 + (0.5 * (math.sqrt((1.0 / z)) + math.sqrt((1.0 / y))))) - math.sqrt(x) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(1.0 + x)) tmp = 0.0 if (y <= 2.45e-33) tmp = Float64(2.0 + Float64(sqrt(Float64(1.0 + z)) - Float64(sqrt(x) + Float64(sqrt(y) + sqrt(z))))); elseif (y <= 52000000.0) tmp = Float64(Float64(sqrt(Float64(y + 1.0)) + t_1) + Float64(Float64(0.5 * (z ^ -0.5)) - Float64(sqrt(y) + sqrt(x)))); else tmp = Float64(Float64(t_1 + Float64(0.5 * Float64(sqrt(Float64(1.0 / z)) + sqrt(Float64(1.0 / y))))) - sqrt(x)); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 + x));
tmp = 0.0;
if (y <= 2.45e-33)
tmp = 2.0 + (sqrt((1.0 + z)) - (sqrt(x) + (sqrt(y) + sqrt(z))));
elseif (y <= 52000000.0)
tmp = (sqrt((y + 1.0)) + t_1) + ((0.5 * (z ^ -0.5)) - (sqrt(y) + sqrt(x)));
else
tmp = (t_1 + (0.5 * (sqrt((1.0 / z)) + sqrt((1.0 / y))))) - sqrt(x);
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y, 2.45e-33], 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], If[LessEqual[y, 52000000.0], N[(N[(N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision] + t$95$1), $MachinePrecision] + N[(N[(0.5 * N[Power[z, -0.5], $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(t$95$1 + N[(0.5 * N[(N[Sqrt[N[(1.0 / z), $MachinePrecision]], $MachinePrecision] + N[Sqrt[N[(1.0 / y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{1 + x}\\
\mathbf{if}\;y \leq 2.45 \cdot 10^{-33}:\\
\;\;\;\;2 + \left(\sqrt{1 + z} - \left(\sqrt{x} + \left(\sqrt{y} + \sqrt{z}\right)\right)\right)\\
\mathbf{elif}\;y \leq 52000000:\\
\;\;\;\;\left(\sqrt{y + 1} + t\_1\right) + \left(0.5 \cdot {z}^{-0.5} - \left(\sqrt{y} + \sqrt{x}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(t\_1 + 0.5 \cdot \left(\sqrt{\frac{1}{z}} + \sqrt{\frac{1}{y}}\right)\right) - \sqrt{x}\\
\end{array}
\end{array}
if y < 2.4499999999999999e-33Initial program 98.6%
associate-+l+98.6%
associate-+l-53.1%
associate-+l-98.6%
+-commutative98.6%
+-commutative98.6%
+-commutative98.6%
Simplified98.6%
Taylor expanded in t around inf 14.1%
associate--l+18.2%
+-commutative18.2%
+-commutative18.2%
Simplified18.2%
Taylor expanded in x around 0 12.4%
associate-+r+12.4%
Simplified12.4%
Taylor expanded in y around 0 12.4%
associate--l+32.2%
+-commutative32.2%
Simplified32.2%
if 2.4499999999999999e-33 < y < 5.2e7Initial program 95.5%
associate-+l+95.5%
associate-+l-50.4%
associate-+l-95.5%
+-commutative95.5%
+-commutative95.5%
+-commutative95.5%
Simplified95.5%
Taylor expanded in t around inf 23.3%
associate--l+25.8%
+-commutative25.8%
+-commutative25.8%
Simplified25.8%
Taylor expanded in z around inf 28.2%
associate-+r+28.2%
Simplified28.2%
associate--l+28.2%
+-commutative28.2%
pow1/228.2%
inv-pow28.2%
pow-pow28.2%
metadata-eval28.2%
Applied egg-rr28.2%
if 5.2e7 < y Initial program 87.9%
associate-+l+87.9%
associate-+l-87.9%
associate-+l-87.9%
+-commutative87.9%
+-commutative87.9%
+-commutative87.9%
Simplified87.9%
Taylor expanded in t around inf 4.3%
associate--l+22.6%
+-commutative22.6%
+-commutative22.6%
Simplified22.6%
Taylor expanded in z around inf 4.4%
associate-+r+4.4%
Simplified4.4%
Taylor expanded in y around inf 19.7%
distribute-lft-out19.7%
Simplified19.7%
Final simplification25.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 4300000000000.0)
(-
(+ 1.0 (+ (sqrt (+ y 1.0)) (/ 1.0 (+ (sqrt (+ 1.0 z)) (sqrt z)))))
(+ (sqrt y) (sqrt x)))
(-
(+ (sqrt (+ 1.0 x)) (* 0.5 (+ (sqrt (/ 1.0 z)) (sqrt (/ 1.0 y)))))
(sqrt x))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 4300000000000.0) {
tmp = (1.0 + (sqrt((y + 1.0)) + (1.0 / (sqrt((1.0 + z)) + sqrt(z))))) - (sqrt(y) + sqrt(x));
} else {
tmp = (sqrt((1.0 + x)) + (0.5 * (sqrt((1.0 / z)) + sqrt((1.0 / y))))) - sqrt(x);
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= 4300000000000.0d0) then
tmp = (1.0d0 + (sqrt((y + 1.0d0)) + (1.0d0 / (sqrt((1.0d0 + z)) + sqrt(z))))) - (sqrt(y) + sqrt(x))
else
tmp = (sqrt((1.0d0 + x)) + (0.5d0 * (sqrt((1.0d0 / z)) + sqrt((1.0d0 / y))))) - sqrt(x)
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= 4300000000000.0) {
tmp = (1.0 + (Math.sqrt((y + 1.0)) + (1.0 / (Math.sqrt((1.0 + z)) + Math.sqrt(z))))) - (Math.sqrt(y) + Math.sqrt(x));
} else {
tmp = (Math.sqrt((1.0 + x)) + (0.5 * (Math.sqrt((1.0 / z)) + Math.sqrt((1.0 / y))))) - Math.sqrt(x);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if y <= 4300000000000.0: tmp = (1.0 + (math.sqrt((y + 1.0)) + (1.0 / (math.sqrt((1.0 + z)) + math.sqrt(z))))) - (math.sqrt(y) + math.sqrt(x)) else: tmp = (math.sqrt((1.0 + x)) + (0.5 * (math.sqrt((1.0 / z)) + math.sqrt((1.0 / y))))) - math.sqrt(x) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (y <= 4300000000000.0) tmp = Float64(Float64(1.0 + Float64(sqrt(Float64(y + 1.0)) + Float64(1.0 / Float64(sqrt(Float64(1.0 + z)) + sqrt(z))))) - Float64(sqrt(y) + sqrt(x))); else tmp = Float64(Float64(sqrt(Float64(1.0 + x)) + Float64(0.5 * Float64(sqrt(Float64(1.0 / z)) + sqrt(Float64(1.0 / y))))) - sqrt(x)); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (y <= 4300000000000.0)
tmp = (1.0 + (sqrt((y + 1.0)) + (1.0 / (sqrt((1.0 + z)) + sqrt(z))))) - (sqrt(y) + sqrt(x));
else
tmp = (sqrt((1.0 + x)) + (0.5 * (sqrt((1.0 / z)) + sqrt((1.0 / y))))) - sqrt(x);
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[y, 4300000000000.0], N[(N[(1.0 + N[(N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision] + N[(1.0 / N[(N[Sqrt[N[(1.0 + z), $MachinePrecision]], $MachinePrecision] + N[Sqrt[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision] + N[(0.5 * N[(N[Sqrt[N[(1.0 / z), $MachinePrecision]], $MachinePrecision] + N[Sqrt[N[(1.0 / y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 4300000000000:\\
\;\;\;\;\left(1 + \left(\sqrt{y + 1} + \frac{1}{\sqrt{1 + z} + \sqrt{z}}\right)\right) - \left(\sqrt{y} + \sqrt{x}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\sqrt{1 + x} + 0.5 \cdot \left(\sqrt{\frac{1}{z}} + \sqrt{\frac{1}{y}}\right)\right) - \sqrt{x}\\
\end{array}
\end{array}
if y < 4.3e12Initial program 98.2%
associate-+l+98.2%
associate-+l-53.0%
associate-+l-98.2%
+-commutative98.2%
+-commutative98.2%
+-commutative98.2%
Simplified98.2%
Taylor expanded in x around 0 42.4%
+-commutative42.4%
Simplified42.4%
flip--98.2%
add-sqr-sqrt75.6%
add-sqr-sqrt98.4%
Applied egg-rr42.5%
associate--l+98.9%
+-inverses98.9%
metadata-eval98.9%
+-commutative98.9%
Simplified42.8%
Taylor expanded in t around inf 23.4%
if 4.3e12 < y Initial program 88.0%
associate-+l+88.0%
associate-+l-88.0%
associate-+l-88.0%
+-commutative88.0%
+-commutative88.0%
+-commutative88.0%
Simplified88.0%
Taylor expanded in t around inf 4.2%
associate--l+22.6%
+-commutative22.6%
+-commutative22.6%
Simplified22.6%
Taylor expanded in z around inf 4.4%
associate-+r+4.4%
Simplified4.4%
Taylor expanded in y around inf 19.8%
distribute-lft-out19.8%
Simplified19.8%
Final simplification21.6%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (sqrt (/ 1.0 z))))
(if (<= y 2.45e-33)
(+ 2.0 (- (sqrt (+ 1.0 z)) (+ (sqrt x) (+ (sqrt y) (sqrt z)))))
(if (<= y 50000000.0)
(- (+ 1.0 (+ (sqrt (+ y 1.0)) (* 0.5 t_1))) (+ (sqrt y) (sqrt x)))
(- (+ (sqrt (+ 1.0 x)) (* 0.5 (+ t_1 (sqrt (/ 1.0 y))))) (sqrt x))))))assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double t_1 = sqrt((1.0 / z));
double tmp;
if (y <= 2.45e-33) {
tmp = 2.0 + (sqrt((1.0 + z)) - (sqrt(x) + (sqrt(y) + sqrt(z))));
} else if (y <= 50000000.0) {
tmp = (1.0 + (sqrt((y + 1.0)) + (0.5 * t_1))) - (sqrt(y) + sqrt(x));
} else {
tmp = (sqrt((1.0 + x)) + (0.5 * (t_1 + sqrt((1.0 / y))))) - sqrt(x);
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = sqrt((1.0d0 / z))
if (y <= 2.45d-33) then
tmp = 2.0d0 + (sqrt((1.0d0 + z)) - (sqrt(x) + (sqrt(y) + sqrt(z))))
else if (y <= 50000000.0d0) then
tmp = (1.0d0 + (sqrt((y + 1.0d0)) + (0.5d0 * t_1))) - (sqrt(y) + sqrt(x))
else
tmp = (sqrt((1.0d0 + x)) + (0.5d0 * (t_1 + sqrt((1.0d0 / y))))) - sqrt(x)
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double t_1 = Math.sqrt((1.0 / z));
double tmp;
if (y <= 2.45e-33) {
tmp = 2.0 + (Math.sqrt((1.0 + z)) - (Math.sqrt(x) + (Math.sqrt(y) + Math.sqrt(z))));
} else if (y <= 50000000.0) {
tmp = (1.0 + (Math.sqrt((y + 1.0)) + (0.5 * t_1))) - (Math.sqrt(y) + Math.sqrt(x));
} else {
tmp = (Math.sqrt((1.0 + x)) + (0.5 * (t_1 + Math.sqrt((1.0 / y))))) - Math.sqrt(x);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): t_1 = math.sqrt((1.0 / z)) tmp = 0 if y <= 2.45e-33: tmp = 2.0 + (math.sqrt((1.0 + z)) - (math.sqrt(x) + (math.sqrt(y) + math.sqrt(z)))) elif y <= 50000000.0: tmp = (1.0 + (math.sqrt((y + 1.0)) + (0.5 * t_1))) - (math.sqrt(y) + math.sqrt(x)) else: tmp = (math.sqrt((1.0 + x)) + (0.5 * (t_1 + math.sqrt((1.0 / y))))) - math.sqrt(x) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) t_1 = sqrt(Float64(1.0 / z)) tmp = 0.0 if (y <= 2.45e-33) tmp = Float64(2.0 + Float64(sqrt(Float64(1.0 + z)) - Float64(sqrt(x) + Float64(sqrt(y) + sqrt(z))))); elseif (y <= 50000000.0) tmp = Float64(Float64(1.0 + Float64(sqrt(Float64(y + 1.0)) + Float64(0.5 * t_1))) - Float64(sqrt(y) + sqrt(x))); else tmp = Float64(Float64(sqrt(Float64(1.0 + x)) + Float64(0.5 * Float64(t_1 + sqrt(Float64(1.0 / y))))) - sqrt(x)); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
t_1 = sqrt((1.0 / z));
tmp = 0.0;
if (y <= 2.45e-33)
tmp = 2.0 + (sqrt((1.0 + z)) - (sqrt(x) + (sqrt(y) + sqrt(z))));
elseif (y <= 50000000.0)
tmp = (1.0 + (sqrt((y + 1.0)) + (0.5 * t_1))) - (sqrt(y) + sqrt(x));
else
tmp = (sqrt((1.0 + x)) + (0.5 * (t_1 + sqrt((1.0 / y))))) - sqrt(x);
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_] := Block[{t$95$1 = N[Sqrt[N[(1.0 / z), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y, 2.45e-33], 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], If[LessEqual[y, 50000000.0], N[(N[(1.0 + N[(N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision] + N[(0.5 * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision] + N[(0.5 * N[(t$95$1 + N[Sqrt[N[(1.0 / y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
t_1 := \sqrt{\frac{1}{z}}\\
\mathbf{if}\;y \leq 2.45 \cdot 10^{-33}:\\
\;\;\;\;2 + \left(\sqrt{1 + z} - \left(\sqrt{x} + \left(\sqrt{y} + \sqrt{z}\right)\right)\right)\\
\mathbf{elif}\;y \leq 50000000:\\
\;\;\;\;\left(1 + \left(\sqrt{y + 1} + 0.5 \cdot t\_1\right)\right) - \left(\sqrt{y} + \sqrt{x}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\sqrt{1 + x} + 0.5 \cdot \left(t\_1 + \sqrt{\frac{1}{y}}\right)\right) - \sqrt{x}\\
\end{array}
\end{array}
if y < 2.4499999999999999e-33Initial program 98.6%
associate-+l+98.6%
associate-+l-53.1%
associate-+l-98.6%
+-commutative98.6%
+-commutative98.6%
+-commutative98.6%
Simplified98.6%
Taylor expanded in t around inf 14.1%
associate--l+18.2%
+-commutative18.2%
+-commutative18.2%
Simplified18.2%
Taylor expanded in x around 0 12.4%
associate-+r+12.4%
Simplified12.4%
Taylor expanded in y around 0 12.4%
associate--l+32.2%
+-commutative32.2%
Simplified32.2%
if 2.4499999999999999e-33 < y < 5e7Initial program 95.5%
associate-+l+95.5%
associate-+l-50.4%
associate-+l-95.5%
+-commutative95.5%
+-commutative95.5%
+-commutative95.5%
Simplified95.5%
Taylor expanded in t around inf 23.3%
associate--l+25.8%
+-commutative25.8%
+-commutative25.8%
Simplified25.8%
Taylor expanded in x around 0 16.1%
associate-+r+16.1%
Simplified16.1%
Taylor expanded in z around inf 25.3%
if 5e7 < y Initial program 87.9%
associate-+l+87.9%
associate-+l-87.9%
associate-+l-87.9%
+-commutative87.9%
+-commutative87.9%
+-commutative87.9%
Simplified87.9%
Taylor expanded in t around inf 4.3%
associate--l+22.6%
+-commutative22.6%
+-commutative22.6%
Simplified22.6%
Taylor expanded in z around inf 4.4%
associate-+r+4.4%
Simplified4.4%
Taylor expanded in y around inf 19.7%
distribute-lft-out19.7%
Simplified19.7%
Final simplification25.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 1.46e+20) (+ 2.0 (- (sqrt (+ 1.0 z)) (+ (sqrt x) (+ (sqrt y) (sqrt z))))) (+ (sqrt (+ 1.0 x)) (- (sqrt (+ y 1.0)) (+ (sqrt y) (sqrt x))))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (z <= 1.46e+20) {
tmp = 2.0 + (sqrt((1.0 + z)) - (sqrt(x) + (sqrt(y) + sqrt(z))));
} else {
tmp = sqrt((1.0 + x)) + (sqrt((y + 1.0)) - (sqrt(y) + sqrt(x)));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (z <= 1.46d+20) then
tmp = 2.0d0 + (sqrt((1.0d0 + z)) - (sqrt(x) + (sqrt(y) + sqrt(z))))
else
tmp = sqrt((1.0d0 + x)) + (sqrt((y + 1.0d0)) - (sqrt(y) + sqrt(x)))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= 1.46e+20) {
tmp = 2.0 + (Math.sqrt((1.0 + z)) - (Math.sqrt(x) + (Math.sqrt(y) + Math.sqrt(z))));
} else {
tmp = Math.sqrt((1.0 + x)) + (Math.sqrt((y + 1.0)) - (Math.sqrt(y) + Math.sqrt(x)));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if z <= 1.46e+20: tmp = 2.0 + (math.sqrt((1.0 + z)) - (math.sqrt(x) + (math.sqrt(y) + math.sqrt(z)))) else: tmp = math.sqrt((1.0 + x)) + (math.sqrt((y + 1.0)) - (math.sqrt(y) + math.sqrt(x))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (z <= 1.46e+20) tmp = Float64(2.0 + Float64(sqrt(Float64(1.0 + z)) - Float64(sqrt(x) + Float64(sqrt(y) + sqrt(z))))); else tmp = Float64(sqrt(Float64(1.0 + x)) + Float64(sqrt(Float64(y + 1.0)) - Float64(sqrt(y) + sqrt(x)))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (z <= 1.46e+20)
tmp = 2.0 + (sqrt((1.0 + z)) - (sqrt(x) + (sqrt(y) + sqrt(z))));
else
tmp = sqrt((1.0 + x)) + (sqrt((y + 1.0)) - (sqrt(y) + sqrt(x)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[z, 1.46e+20], 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[(1.0 + x), $MachinePrecision]], $MachinePrecision] + N[(N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision] - N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq 1.46 \cdot 10^{+20}:\\
\;\;\;\;2 + \left(\sqrt{1 + z} - \left(\sqrt{x} + \left(\sqrt{y} + \sqrt{z}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\sqrt{1 + x} + \left(\sqrt{y + 1} - \left(\sqrt{y} + \sqrt{x}\right)\right)\\
\end{array}
\end{array}
if z < 1.46e20Initial program 96.4%
associate-+l+96.4%
associate-+l-75.7%
associate-+l-96.4%
+-commutative96.4%
+-commutative96.4%
+-commutative96.4%
Simplified96.4%
Taylor expanded in t around inf 15.9%
associate--l+20.3%
+-commutative20.3%
+-commutative20.3%
Simplified20.3%
Taylor expanded in x around 0 13.8%
associate-+r+13.8%
Simplified13.8%
Taylor expanded in y around 0 11.8%
associate--l+11.8%
+-commutative11.8%
Simplified11.8%
if 1.46e20 < z Initial program 89.9%
associate-+l+89.9%
associate-+l-63.5%
associate-+l-89.9%
+-commutative89.9%
+-commutative89.9%
+-commutative89.9%
Simplified89.9%
Taylor expanded in t around inf 3.2%
associate--l+21.1%
+-commutative21.1%
+-commutative21.1%
Simplified21.1%
Taylor expanded in z around inf 28.7%
Final simplification19.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 1.46e+20) (+ 2.0 (- (sqrt (+ 1.0 z)) (+ (sqrt x) (+ (sqrt y) (sqrt z))))) (+ 1.0 (- (sqrt (+ y 1.0)) (+ (sqrt y) (sqrt x))))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (z <= 1.46e+20) {
tmp = 2.0 + (sqrt((1.0 + z)) - (sqrt(x) + (sqrt(y) + sqrt(z))));
} else {
tmp = 1.0 + (sqrt((y + 1.0)) - (sqrt(y) + sqrt(x)));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (z <= 1.46d+20) then
tmp = 2.0d0 + (sqrt((1.0d0 + z)) - (sqrt(x) + (sqrt(y) + sqrt(z))))
else
tmp = 1.0d0 + (sqrt((y + 1.0d0)) - (sqrt(y) + sqrt(x)))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= 1.46e+20) {
tmp = 2.0 + (Math.sqrt((1.0 + z)) - (Math.sqrt(x) + (Math.sqrt(y) + Math.sqrt(z))));
} else {
tmp = 1.0 + (Math.sqrt((y + 1.0)) - (Math.sqrt(y) + Math.sqrt(x)));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if z <= 1.46e+20: tmp = 2.0 + (math.sqrt((1.0 + z)) - (math.sqrt(x) + (math.sqrt(y) + math.sqrt(z)))) else: tmp = 1.0 + (math.sqrt((y + 1.0)) - (math.sqrt(y) + math.sqrt(x))) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (z <= 1.46e+20) tmp = Float64(2.0 + Float64(sqrt(Float64(1.0 + z)) - Float64(sqrt(x) + Float64(sqrt(y) + sqrt(z))))); else tmp = Float64(1.0 + Float64(sqrt(Float64(y + 1.0)) - Float64(sqrt(y) + sqrt(x)))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (z <= 1.46e+20)
tmp = 2.0 + (sqrt((1.0 + z)) - (sqrt(x) + (sqrt(y) + sqrt(z))));
else
tmp = 1.0 + (sqrt((y + 1.0)) - (sqrt(y) + sqrt(x)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[z, 1.46e+20], 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[(1.0 + N[(N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision] - N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq 1.46 \cdot 10^{+20}:\\
\;\;\;\;2 + \left(\sqrt{1 + z} - \left(\sqrt{x} + \left(\sqrt{y} + \sqrt{z}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;1 + \left(\sqrt{y + 1} - \left(\sqrt{y} + \sqrt{x}\right)\right)\\
\end{array}
\end{array}
if z < 1.46e20Initial program 96.4%
associate-+l+96.4%
associate-+l-75.7%
associate-+l-96.4%
+-commutative96.4%
+-commutative96.4%
+-commutative96.4%
Simplified96.4%
Taylor expanded in t around inf 15.9%
associate--l+20.3%
+-commutative20.3%
+-commutative20.3%
Simplified20.3%
Taylor expanded in x around 0 13.8%
associate-+r+13.8%
Simplified13.8%
Taylor expanded in y around 0 11.8%
associate--l+11.8%
+-commutative11.8%
Simplified11.8%
if 1.46e20 < z Initial program 89.9%
associate-+l+89.9%
associate-+l-63.5%
associate-+l-89.9%
+-commutative89.9%
+-commutative89.9%
+-commutative89.9%
Simplified89.9%
Taylor expanded in t around inf 3.2%
associate--l+21.1%
+-commutative21.1%
+-commutative21.1%
Simplified21.1%
Taylor expanded in x around 0 2.6%
associate-+r+2.6%
Simplified2.6%
Taylor expanded in z around inf 14.3%
associate--l+30.5%
Simplified30.5%
Final simplification20.8%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (+ 1.0 (- (sqrt (+ y 1.0)) (+ (sqrt y) (sqrt x)))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
return 1.0 + (sqrt((y + 1.0)) - (sqrt(y) + sqrt(x)));
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = 1.0d0 + (sqrt((y + 1.0d0)) - (sqrt(y) + sqrt(x)))
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
return 1.0 + (Math.sqrt((y + 1.0)) - (Math.sqrt(y) + Math.sqrt(x)));
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): return 1.0 + (math.sqrt((y + 1.0)) - (math.sqrt(y) + math.sqrt(x)))
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) return Float64(1.0 + Float64(sqrt(Float64(y + 1.0)) - Float64(sqrt(y) + sqrt(x)))) end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp = code(x, y, z, t)
tmp = 1.0 + (sqrt((y + 1.0)) - (sqrt(y) + sqrt(x)));
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := N[(1.0 + N[(N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision] - N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
1 + \left(\sqrt{y + 1} - \left(\sqrt{y} + \sqrt{x}\right)\right)
\end{array}
Initial program 93.3%
associate-+l+93.3%
associate-+l-69.8%
associate-+l-93.3%
+-commutative93.3%
+-commutative93.3%
+-commutative93.3%
Simplified93.3%
Taylor expanded in t around inf 9.8%
associate--l+20.7%
+-commutative20.7%
+-commutative20.7%
Simplified20.7%
Taylor expanded in x around 0 8.4%
associate-+r+8.4%
Simplified8.4%
Taylor expanded in z around inf 10.2%
associate--l+22.7%
Simplified22.7%
Final simplification22.7%
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 5e+24) (- (+ 1.0 (sqrt (+ y 1.0))) (sqrt y)) (- (sqrt (+ 1.0 x)) (sqrt x))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 5e+24) {
tmp = (1.0 + sqrt((y + 1.0))) - sqrt(y);
} else {
tmp = sqrt((1.0 + x)) - sqrt(x);
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= 5d+24) then
tmp = (1.0d0 + sqrt((y + 1.0d0))) - sqrt(y)
else
tmp = sqrt((1.0d0 + x)) - sqrt(x)
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= 5e+24) {
tmp = (1.0 + Math.sqrt((y + 1.0))) - Math.sqrt(y);
} else {
tmp = Math.sqrt((1.0 + x)) - Math.sqrt(x);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if y <= 5e+24: tmp = (1.0 + math.sqrt((y + 1.0))) - math.sqrt(y) else: tmp = math.sqrt((1.0 + x)) - math.sqrt(x) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (y <= 5e+24) tmp = Float64(Float64(1.0 + sqrt(Float64(y + 1.0))) - sqrt(y)); else tmp = Float64(sqrt(Float64(1.0 + x)) - sqrt(x)); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (y <= 5e+24)
tmp = (1.0 + sqrt((y + 1.0))) - sqrt(y);
else
tmp = sqrt((1.0 + x)) - sqrt(x);
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[y, 5e+24], N[(N[(1.0 + N[Sqrt[N[(y + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[Sqrt[y], $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 5 \cdot 10^{+24}:\\
\;\;\;\;\left(1 + \sqrt{y + 1}\right) - \sqrt{y}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{1 + x} - \sqrt{x}\\
\end{array}
\end{array}
if y < 5.00000000000000045e24Initial program 97.1%
associate-+l+97.1%
associate-+l-53.6%
associate-+l-97.1%
+-commutative97.1%
+-commutative97.1%
+-commutative97.1%
Simplified97.1%
Taylor expanded in t around inf 14.8%
associate--l+19.0%
+-commutative19.0%
+-commutative19.0%
Simplified19.0%
Taylor expanded in x around 0 12.7%
associate-+r+12.7%
Simplified12.7%
Taylor expanded in z around inf 16.5%
Taylor expanded in y around inf 49.1%
if 5.00000000000000045e24 < y Initial program 88.8%
associate-+l+88.8%
associate-+l-88.8%
associate-+l-88.8%
+-commutative88.8%
+-commutative88.8%
+-commutative88.8%
Simplified88.8%
Taylor expanded in t around inf 4.0%
associate--l+22.6%
+-commutative22.6%
+-commutative22.6%
Simplified22.6%
Taylor expanded in x around inf 21.9%
mul-1-neg21.9%
Simplified21.9%
Final simplification36.6%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= y 0.95) (- 2.0 (+ (sqrt y) (sqrt x))) (- (sqrt (+ 1.0 x)) (sqrt x))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 0.95) {
tmp = 2.0 - (sqrt(y) + sqrt(x));
} else {
tmp = sqrt((1.0 + x)) - sqrt(x);
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= 0.95d0) then
tmp = 2.0d0 - (sqrt(y) + sqrt(x))
else
tmp = sqrt((1.0d0 + x)) - sqrt(x)
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= 0.95) {
tmp = 2.0 - (Math.sqrt(y) + Math.sqrt(x));
} else {
tmp = Math.sqrt((1.0 + x)) - Math.sqrt(x);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if y <= 0.95: tmp = 2.0 - (math.sqrt(y) + math.sqrt(x)) else: tmp = math.sqrt((1.0 + x)) - math.sqrt(x) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (y <= 0.95) tmp = Float64(2.0 - Float64(sqrt(y) + sqrt(x))); else tmp = Float64(sqrt(Float64(1.0 + x)) - sqrt(x)); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (y <= 0.95)
tmp = 2.0 - (sqrt(y) + sqrt(x));
else
tmp = sqrt((1.0 + x)) - sqrt(x);
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[y, 0.95], N[(2.0 - N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[N[(1.0 + x), $MachinePrecision]], $MachinePrecision] - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 0.95:\\
\;\;\;\;2 - \left(\sqrt{y} + \sqrt{x}\right)\\
\mathbf{else}:\\
\;\;\;\;\sqrt{1 + x} - \sqrt{x}\\
\end{array}
\end{array}
if y < 0.94999999999999996Initial program 98.4%
associate-+l+98.4%
associate-+l-53.2%
associate-+l-98.4%
+-commutative98.4%
+-commutative98.4%
+-commutative98.4%
Simplified98.4%
Taylor expanded in t around inf 15.1%
associate--l+19.2%
+-commutative19.2%
+-commutative19.2%
Simplified19.2%
Taylor expanded in x around 0 12.9%
associate-+r+12.9%
Simplified12.9%
Taylor expanded in z around inf 16.6%
Taylor expanded in y around 0 16.6%
if 0.94999999999999996 < y Initial program 88.0%
associate-+l+88.0%
associate-+l-86.9%
associate-+l-88.0%
+-commutative88.0%
+-commutative88.0%
+-commutative88.0%
Simplified88.0%
Taylor expanded in t around inf 4.3%
associate--l+22.3%
+-commutative22.3%
+-commutative22.3%
Simplified22.3%
Taylor expanded in x around inf 21.5%
mul-1-neg21.5%
Simplified21.5%
Final simplification19.0%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= y 1.0) (- 2.0 (+ (sqrt y) (sqrt x))) (- 1.0 (sqrt x))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 1.0) {
tmp = 2.0 - (sqrt(y) + sqrt(x));
} else {
tmp = 1.0 - sqrt(x);
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= 1.0d0) then
tmp = 2.0d0 - (sqrt(y) + sqrt(x))
else
tmp = 1.0d0 - sqrt(x)
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= 1.0) {
tmp = 2.0 - (Math.sqrt(y) + Math.sqrt(x));
} else {
tmp = 1.0 - Math.sqrt(x);
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if y <= 1.0: tmp = 2.0 - (math.sqrt(y) + math.sqrt(x)) else: tmp = 1.0 - math.sqrt(x) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (y <= 1.0) tmp = Float64(2.0 - Float64(sqrt(y) + sqrt(x))); else tmp = Float64(1.0 - sqrt(x)); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (y <= 1.0)
tmp = 2.0 - (sqrt(y) + sqrt(x));
else
tmp = 1.0 - sqrt(x);
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[y, 1.0], N[(2.0 - N[(N[Sqrt[y], $MachinePrecision] + N[Sqrt[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 1:\\
\;\;\;\;2 - \left(\sqrt{y} + \sqrt{x}\right)\\
\mathbf{else}:\\
\;\;\;\;1 - \sqrt{x}\\
\end{array}
\end{array}
if y < 1Initial program 98.4%
associate-+l+98.4%
associate-+l-53.2%
associate-+l-98.4%
+-commutative98.4%
+-commutative98.4%
+-commutative98.4%
Simplified98.4%
Taylor expanded in t around inf 15.1%
associate--l+19.2%
+-commutative19.2%
+-commutative19.2%
Simplified19.2%
Taylor expanded in x around 0 12.9%
associate-+r+12.9%
Simplified12.9%
Taylor expanded in z around inf 16.6%
Taylor expanded in y around 0 16.6%
if 1 < y Initial program 88.0%
associate-+l+88.0%
associate-+l-86.9%
associate-+l-88.0%
+-commutative88.0%
+-commutative88.0%
+-commutative88.0%
Simplified88.0%
Taylor expanded in t around inf 4.3%
associate--l+22.3%
+-commutative22.3%
+-commutative22.3%
Simplified22.3%
Taylor expanded in x around 0 3.8%
associate-+r+3.8%
Simplified3.8%
Taylor expanded in z around inf 3.6%
Taylor expanded in y around inf 20.3%
Final simplification18.4%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (- 1.0 (sqrt x)))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
return 1.0 - sqrt(x);
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = 1.0d0 - sqrt(x)
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
return 1.0 - Math.sqrt(x);
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): return 1.0 - math.sqrt(x)
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) return Float64(1.0 - sqrt(x)) end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp = code(x, y, z, t)
tmp = 1.0 - sqrt(x);
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := N[(1.0 - N[Sqrt[x], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
1 - \sqrt{x}
\end{array}
Initial program 93.3%
associate-+l+93.3%
associate-+l-69.8%
associate-+l-93.3%
+-commutative93.3%
+-commutative93.3%
+-commutative93.3%
Simplified93.3%
Taylor expanded in t around inf 9.8%
associate--l+20.7%
+-commutative20.7%
+-commutative20.7%
Simplified20.7%
Taylor expanded in x around 0 8.4%
associate-+r+8.4%
Simplified8.4%
Taylor expanded in z around inf 10.2%
Taylor expanded in y around inf 14.3%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (- (sqrt x)))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
return -sqrt(x);
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = -sqrt(x)
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
return -Math.sqrt(x);
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): return -math.sqrt(x)
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) return Float64(-sqrt(x)) end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp = code(x, y, z, t)
tmp = -sqrt(x);
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := (-N[Sqrt[x], $MachinePrecision])
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
-\sqrt{x}
\end{array}
Initial program 93.3%
associate-+l+93.3%
associate-+l-69.8%
associate-+l-93.3%
+-commutative93.3%
+-commutative93.3%
+-commutative93.3%
Simplified93.3%
Taylor expanded in t around inf 9.8%
associate--l+20.7%
+-commutative20.7%
+-commutative20.7%
Simplified20.7%
Taylor expanded in x around 0 8.4%
associate-+r+8.4%
Simplified8.4%
Taylor expanded in x 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 2024118
(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))))