The accuracy from left to right and that from right to left of the floating point arithmetic sums 
Question 1 Show that floating point arithmetic sums
  $$s_n=\sum_{k=1}^n\frac{1}{k^2} = 1+\frac{1}{2^2}+\frac{1}{3^2}+\dotsb+\frac{1}{n^2}$$
  with accuracy $\mathcal O(n)\epsilon$ from left to right, while summing from right to left gives accuracy $\mathcal O(\log n)\epsilon$.

Source.
There is an example of summing 5, 10, 15
$\left(\left(5+10\right)\left(1+\epsilon\right)+15\right)\left(1+\epsilon\right) =30+45\epsilon$
$\left(\left(15+10\right)\left(1+\epsilon\right)+5\right)\left(1+\epsilon\right)  = 30+55\epsilon$
Where does the form $\left(1+\epsilon\right)$ come from? And any suggestion on how to approach this problem? thanks!
 A: 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)
$$
