MathGroup Archive 2012

[Date Index] [Thread Index] [Author Index]

Search the Archive

Continued fraction from rational polynomial?

  • To: mathgroup at
  • Subject: [mg127007] Continued fraction from rational polynomial?
  • From: dr DanW <dmaxwarren at>
  • Date: Sat, 23 Jun 2012 04:16:27 -0400 (EDT)
  • Delivered-to:

Does Mathematica have a function to develop a continued fraction from a rational polynomial?  I have managed to implement the Euclidian Algorithm for polynomials as below:

PolynomialContinuedFraction[a_, b_, s_Symbol] /; PolynomialQ[a, s] && PolynomialQ[b, s] :=
  Block[{q, r},
   Flatten[Reap[NestWhile[Function[ab, {q, r} = PolynomialQuotientRemainder[ab[[1]], ab[[2]], s];
          Sow[q]; {ab[[2]], r}], {a, b}, Function[ab, ab[[2]] =!= 0]]; ][[2]]]]

but I cannot shake the feeling that this is something the Mathematica can already do and I just don't know what it is called.  ContinuedFraction[] only works with numbers.  Interestingly, FromContinuedFraction[] works just fine with the symbolic output of my function.


  • Prev by Date: Re: some Experience with webMathematica
  • Next by Date: Re: How to make Excel import symbolically
  • Previous by thread: DirectedInfinity when solving limit
  • Next by thread: Error estimates in the Gauss-Kronrod rule