I want to find all solutions to the problem of two squares equaling two other squares. $$a^2 + b^2 = c^2 + d^2 \qquad b \le N$$Clearly, without loss of generality, I can assume that $$gcd(a,b,c,d) = 1$$ and $c\le a \le b \le d$. But after that, I'm a bit stuck. I can see an $N^2$ solution doing a meet-in-the-middle algorithm but I'm not sure there isn't a better way to solve this. On a Diophantine equations website it listed this problem as something "which can be done completely" but didn't give a parameterization of HOW to do it completely. Is the meet-in-the-middle the best or is there some better way to go about this?
Thanks for any help!!