You get it from
$$
fl(a+b)=(a+b)(1+\delta)
$$
with $|δ|\leϵ$ the quasi random relative error of the floating point execution of the operation.
In computing $s_n=\sum_{k=1}^n a_k$ via the partial sums $s_{m+1}=s_m+a_{m+1}$ each numerical step produces an error $Δs_m$ that accumulates as
$$
s_{m+1}+Δs_{m+1}=fl(s_m+Δs_m+a_{m+1})=(s_m+Δs_m+a_{m+1})(1+\delta_m)
$$
The errors are dominated by the first order terms, so that up to higher order terms after removing the exact terms one gets
$$
Δs_{m+1}=Δs_m+s_{m+1}\delta_m
$$
So in first order of approximation, the last error added to the sum is proportional to the sum up to date, which in total gives
$$
Δs_n=s_2\delta_1+s_3\delta_2+…+s_n\delta_{n-1}.
$$
The quasi random quantities $\delta_m$ are bound by a machine constant $ϵ$. The partial sums have the absolute sums as upper bound. Combining both one gets
$$
|Δs_n|\le \sum_{k=1}^n (n+1-k)·|a_k|\,·\,ϵ
$$
For the sum $\sum_{k=1}^n\frac1{k^2}$ summing from the front gives $a_k=\frac1{k^2}$ and the first order coefficient of the error term $$
\sum_{k=1}^n (n+1-k)·|a_k|=(n+1)\sum_{k=1}^n\frac1{k^2}-\sum_{k=1}^n\frac1k\le(n+1)\frac{\pi^2}6-\ln(n+1)=O(n)
$$
Summing from the end is encoded as $a_k=\frac1{(n+1-k)^2}$ which gives the first order coefficient of the error term as
$$
\sum_{k=1}^n\frac1{n+1-k}\le 1+\ln(n)=O(\log n)
$$
The identities used are
$$
\sum_{k=1}^n\frac1{k^2}\le\sum_{k=1}^\infty\frac1{k^2}=\frac{\pi^2}6
$$
and, as an easy consequence of $e^x\ge 1+x$ or bounds on $\int_{k-1}^k\frac1x\,dx$,
$$
\ln(k+1)-\ln(k)\le \frac1k\le \ln(k)-\ln(k-1)\\
\ln(n+1)-\ln(1)\le\sum_{k=1}^n\frac1k\le 1+\ln(n)-\ln(1)
$$