Brahmagupta, an ancient Indian Mathematician, gave an pretty efficient algorithm for finding integer solutions to the famous Pell's Equation, far before Fermat propounded this before the European mathematicians' community.
Brahmagupta's Identity:
If $(x_1,y_1)$ is a solution to $Dx^2+m=y^2$ and $(x_2,y_2)$ is a solution to $Dx^2+n=y^2$, then $(x_1y_2\pm x_2y_1,y_1y_2\pm D x_1x_2)$ is a solution to the equation $Dx^2+mn=y^2$.
Famous mathematician André Weil denoted this more efficiently by $$(x_1,y_1;m)\oplus (x_2,y_2;n)=(x_1y_2\pm x_2y_1,y_1y_2\pm D x_1x_2;mn)$$
One can easily prove this by writing $m=y_1^2-Dx_1^2$ and $n=y_2^2-Dx_2^2$, and then multiplying them $$mn=(y_1^2-Dx_1^2)(y_2^2-Dx_2^2)=(y_1y_2\pm D x_1x_2)^2-D(x_1y_2\pm x_2y_1)^2$$ and also notice that it is a group. A $600 AD$ mathematician is solving problems using Group Theory!
I am giving an example, integer solutions to $83x^2+1=y^2$.
We know that, $$83\times 1^2-2=9^2. $$
So, we here get $$(1,9;-2)\oplus (1,9;-2)=(18,81+83;4)=(18,164;4).$$
So, we get the equation, $$\begin{align} &83(18)^2+4=(164)^2\\ \implies &83\left(\frac {18}2\right)^2+1=\left(\frac {164}2\right)^2\\ \implies &83\times 9^2+1=82^2 \end{align}$$
Now, we have, if $Da^2+1=b^2$, then, $$\frac ba-\sqrt D=\frac {b-\sqrt D a}a=\frac {b^2-Da^2}{a(b+\sqrt D a)}=\frac 1{a(b+\sqrt D a)} $$
So, for sufficiently large $(a,b)$, $\frac ba$ is a good approximation for $\sqrt D$.
One, can verify by finding solutions to $2a^2+1=b^2$, i.e. $(2,3),(12,17),\dots$. So $$\color{red}{\sqrt 2\approx \frac 32,\frac {17}{12},\frac {577}{408}}.$$
So, I was trying to approximate $\sqrt \pi$ or $e$ or $\pi$ using this identity, but could not came to result. I am trying my way, but you folks please help me sharing your idea.
As, $\pi$ is irrational, we can't have $\pi =D$, so, I used $3\lt \pi\lt 4$, so $\sqrt 3\lt \sqrt \pi\lt 2$, so, $1\lt \sqrt \pi \lt 2$,
But feeling some difficulty.
The procedure for calculating the square root of the number can be used to calculate the number $\pi$ to arbitrary precision. You can use the ratio $$\tan\dfrac x2 = \dfrac{\tan x} {\sqrt{\tan^2 x+1} + 1}$$ with initial data $\tan{\dfrac{\pi}4} = 1$.
After $n$ iterations you will have $\tan\dfrac{\pi}{2^{n+2}}$ and then can use the formula $$\pi=\lim\limits_{n\to\infty} 2^{n+2}\tan\dfrac{\pi}{2^{n+2}}$$ or Maclaurin series for the arctangent function: $$\pi=2^{n+2}\left(\tan\dfrac{\pi}{2^{n+2}}-\dfrac13\left(\tan\dfrac{\pi}{2^{n+2}}\right)^3+\dots\right)$$