Find a rational approximation to x within tolerance defined by tol using a continued fraction expansion. E.g,
rat(pi) = 3 + 1/(7 + 1/16) = 355/113 rat(e) = 3 + 1/(-4 + 1/(2 + 1/(5 + 1/(-2 + 1/(-7))))) = 1457/536Called with two arguments returns the numerator and denominator separately as two matrices.