MathGroup Archive 2006

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

Search the Archive

Re: Evaluation of 1/(1/a + 1/b + 1/r)


Sseziwa, thanks so much. Diana

On 10/5/06, Sseziwa Mukasa <mukasa at jeol.com> wrote:
>
>
> On Oct 5, 2006, at 3:32 AM, Diana wrote:
>
> > Folks,
> >
> > I am trying to write a program to evaluate the sum of two continued
> > fractions, written in polynomials of T.
> >
> > I would like a short routine to evaluate 1/(1/a + 1/b + 1/r), just
> > working with a, b, and r if they are not equal to zero.
> >
> > So, if a = 0, then evaluate 1/(1/b + 1/r)
> >
> > If a, b, = 0, then evaluate 1/r
> >
> > If all of a, b, r = 0, give me 0 as output.
> >
> > If (1/a + 1/b + 1/r) = 0, give me 0 as output.
> >
> > Assume that a, b, r are arbitrary polynomials in T.
> >
> > Can someone help?
>
> You can use pattern matching
>
> sumFractions[a_,b_,r_]:=1/(1/a+1/b+1/r)
>
> sumFractions[0,b_,r_]:=1/(1/b+1/r)
>
> sumFractions[0,0,r_]:=1/r
>
> sumFractions[0,0,0]:=0
>
> As the number of patterns increases the typing can get tedious, you
> can write an expression to generate these expressions automatically
> but I don't see how 1/(1/a + 1/b + 1/r) -> 1/(1/b + 1/r) when a is
> zero or 1/r when a and b are zero.  If you know of an expression that
> can generate that sequence you can use it to save some typing.
>
> Regards,
>
> Ssezi
>
>
>


-- 
"God made the integers, all else is the work of man."
L. Kronecker, Jahresber. DMV 2, S. 19.



  • Prev by Date: Re: Smarter way to calculate middle-right terms of continued fraction partial sums
  • Next by Date: Mathematica Link for Excel 3 now available
  • Previous by thread: Re: Evaluation of 1/(1/a + 1/b + 1/r)
  • Next by thread: Re: Evaluation of 1/(1/a + 1/b + 1/r)