<s>[INST] In a triangle $\triangle ABC$, the sum of two sides is $x$, and their product is $y$. If $x^2-c^2=y$, find $\frac{r}{R}$ in terms of $x, c, y$ This problem comes from a previous JEE Advanced examination, the problem is as follows:

In a triangle $\triangle ABC$, the sum of two sides is $x$, and their product is $y$. If $x^2-c^2=y$ where $c$ is the third side, find the ratio of the inradius to the circumradius in terms of $x, c, y$

This is indeed a pretty challenging and tricky problem. Upon initial examination, spamming algebra seems to not lead anywhere. I found a solution using some angle chasing, which I'll share below, please share your own approaches as well!
Let $a+b=x$ and $ab=y$
We know that:
$$x^2-c^2=y$$
$$(a+b)^2-c^2=ab$$
$$a^2+b^2-c^2=-ab$$
Dividing by $2ab$ and exploiting the Law of Cosines, we can say that:
$$\frac{a^2+b^2-c^2}{2ab}=-\frac{1}{2}$$
Now, this implies that $\angle C=120^\circ$
Now, using the Law of Sines, we get:
$$\frac{1}{2R}=\frac{\sin{C}}{c}$$
$$\frac{c}{2R}=\frac{\sqrt3}{2}$$
$$R=\frac{c}{\sqrt3}$$
We also know that:
$$\Delta= \frac{1}{2}ab\sin{C}$$
$$\Delta=\frac{\sqrt{3}y}{4}$$
Further, we can note that:
$$s=\frac{a+b+c}{2}$$
$$s=\frac{x+c}{2}$$
Also, $r=\frac{\Delta}{s}$, therefore:
$$\frac{2\sqrt{3}y}{4(x+c)}=r$$
$$r=\frac{\sqrt{3}y}{2(x+c)}$$
Finally:
$$\frac{r}{R}=(\frac{\sqrt{3}y}{2(x+c)})(\frac{\sqrt{3}}{c})$$
$$\frac{r}{R}=\frac{3y}{2c(x+c)}$$
 [/INST] From Law of Cosine, replace cosine with accurate haversine.
$c^2 = a^2 + b^2 - 2ab×\cos(C) = (a-b)^2 + 4ab×hav(C)$
Let $\displaystyle z = ab×hav(C) = \frac{(c-(a-b)(c+(a-b))}{4}$
$→ z = (s-a)(s-b)$
$→ (a\,b-z) = s(s-c)$
$Δ = \sqrt{s(s-a)(s-b)(s-c)} = \sqrt{(ab-z)\,z}$
If c is the smallest side, (a-b) is exact, RHS area formula is very accurate.

Back to the oringal problem, without "angle chasing"
$\displaystyle z = \frac{c^2 - (a-b)^2}{4} 
= \frac{(x^2 - y) - (x^2 - 4y)}{4} 
= \frac{3y}{4}$
$\displaystyle Δ = \sqrt{(ab-z)\,z} 
= \sqrt{\left(y-\frac{3y}{4}\right) \left(\frac{3y}{4}\right)}
= \frac{\sqrt{3}\,y}{4}$
$\displaystyle \frac{r}{R}
= \frac{Δ}{s} ÷ \frac{a\,b\,c}{4Δ}
= \frac{4Δ^2}{s\,a\,b\,c}
= \frac{3y^2/4} {\left( \frac{x+c}{2} \right)y\,c}
= \frac{3y}{2c(x+c)}
$
</s>