Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #10612

Continued fraction from rational polynomial?

From dr DanW <dmaxwarren@gmail.com>
Newsgroups comp.soft-sys.math.mathematica
Subject Continued fraction from rational polynomial?
Date 2012-06-23 08:24 +0000
Organization Steven M. Christensen and Associates, Inc and MathTensor, Inc.
Message-ID <js3uf9$vf$1@smc.vnet.net> (permalink)

Show all headers | View raw


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.

Daniel

Back to comp.soft-sys.math.mathematica | Previous | Next | Find similar | Unroll thread


Thread

Continued fraction from rational polynomial? dr DanW <dmaxwarren@gmail.com> - 2012-06-23 08:24 +0000

csiph-web