# Solving ax^2+bxy+cy^2=n fast?

Hi, I was wondering whether equations as ax^2+bxy+cy^2=n can be solved
*fast*. **Solve** is a general application with overhead.
I think of methods such as can be found on www.alpertron.com.ar/METHODS.HTM
by Dario Alejandro Alpern, or www.numbertheory.org/php/ by Keith
Matthews. It seems to me logic that for instance **BinaryQF** would facilitate this within Sage.

I wrote some routines using Python (like NZMATH cornacchiamodify, but these have to be optimized via Cython and GMP. Another source is the LMM algorithm. Before I take this route, I want to check that I'm not reinventing the wheel and/or I'm able to cooperate with someone.

Thanks in advance for your guidance! Roland

Are `a`, `b`, `c`, `n` all integers, and are you looking for integer solutions `(x,y)`?

Could you provide a link to the work you have already done?

Thanks for all replies! Yes, I'm looking at integers. A few months ago Thilina Rathnayake implemented routines in Sympy (http://thilinaatsympy.wordpress.com/2013/09/14/status-of-the-diophantine-module-2/). This seems to me a good start as Sympy is a standard package. I'll have a 2nd look at my routines and I'll provide a link within a few days (if that's still wanted). Roland