In one of Srinivasa Ramanujan's writings, he discusses the perimeter of an ellipse, $p$. He finds two approximations (page 39):
16. The following approximations for $p$ were obtained empirically: $$p=\pi\left[3(a+b)-\sqrt{(a+3b)(3a+b)}+\epsilon\right]\tag{49}$$ where $\epsilon$ is about $ak^{12}/1048576$; $$p=\pi\left\{(a+b)+\frac{3(a-b)^2}{10(a+b)+\sqrt{a^2+14ab^+b^2}}+\epsilon\right\}\tag{50}$$ where $\epsilon$ is about $3ak^{20}/68719476736$.
Here, $a$ and $b$ are the semi-major and semi-minor axes, and $k$ is the eccentricity.
How did Ramanujan "empirically" find these error values? Did he use geometric measurements, numerical analysis, or something completely different?