úÎPN“     Safe&A continued fraction. Constructed by  or . Not exported. See , the public constructor. Not exported. See , the public constructor. <Construct a continued fraction from its first term and the @ partial denominators in its canonical form, which is the form ) where all the partial numerators are 1.  cf a [b,c,d] corresponds to a + (b / (1 + (c / (1 + d)))),  or to GCF a [(1,b),(1,c),(1,d)]. AConstruct a continued fraction from its first term, its partial * numerators and its partial denominators. !gcf b0 [(a1,b1), (a2,b2), (a3,b3)] corresponds to   b0 + (a1 / (b1 + (a2 / (b2 + (a3 / b3))))) &Extract the partial denominators of a ", normalizing it if necessary so ( that all the partial numerators are 1. AExtract all the partial numerators and partial denominators of a .  Truncate a A to the specified number of partial numerators and denominators. KApply an equivalence transformation, multiplying each partial denominator G with the corresponding element of the supplied list and transforming K subsequent partial numerators and denominators as necessary. If the list  is too short, the rest of the  will be unscaled. HApply an equivalence transformation that sets the partial denominators  of a ? to the specfied values. If the input list is too short, the  rest of the  will be unscaled. FApply an equivalence transformation that sets the partial numerators  of a ? to the specfied values. If the input list is too short, the  rest of the  will be unscaled. 4Computes the even and odd parts, respectively, of a . These are new  As that have the even-indexed and odd-indexed convergents of the  original, respectively. Computes the even part of a  (that is, a new  whose convergents are 0 the even-indexed convergents of the original). Computes the odd part of a  (that is, a new  whose convergents are / the odd-indexed convergents of the original). GEvaluate the convergents of a continued fraction using the fundamental  recurrence formula: A0 = b0, B0 = 1 A1 = b1b0 + a1, B1 = b1 !A{n+1} = b{n+1}An + a{n+1}A{n-1} !B{n+1} = b{n+1}Bn + a{n+1}B{n-1}  The convergents are then Xn = An/Bn <Evaluate the convergents of a continued fraction using Steed' s method. J Only valid if the denominator in the following recurrence for D_i never - goes to zero. If this method blows up, try . D1 = 1/b1  D{i} = 1 / (b{i} + a{i} * D{i-1})  dx1 = a1 / b1 $dx{i} = (b{i} * D{i} - 1) * dx{i-1} x0 = b0 x{i} = x{i-1} + dx{i} The convergents are given by scanl (+) b0 dxs <Evaluate the convergents of a continued fraction using Lentz' s method. H Only valid if the denominators in the following recurrence never go to % zero. If this method blows up, try .  C1 = b1 + a1 / b0 D1 = 1/b1 C{n} = b{n} + a{n} / C{n-1}  D{n} = 1 / (b{n} + a{n} * D{n-1}) The convergents are given by  scanl (*) b0 (zipWith (*) cs ds) <Evaluate the convergents of a continued fraction using Lentz' s method, I mapping the terms in the final product to a new group before performing N the final multiplications. A useful group, for example, would be logarithms  under addition. In lentzWith f op inv, the arguments are:  f, a group homomorphism (eg, ) from {a,(*),} to the group 5 in which you want to perform the multiplications.  op", the group operation (eg., (+)).  inv, the group inverse (eg., ). The ? function, for example, is given by the identity homomorphism:  lentz = lentzWith id (*) recip. FThe original motivation for this function is to allow computation of J the natural log of very large numbers that would overflow with the naive  implementation in (. In this case, the arguments would be , (+),  and , respectively. KIn cases where terms of the product can be negative (i.e., the sequence of I convergents contains negative values), the following definitions could  be used instead: % signLog x = (signum x, log (abs x)) - addSignLog (xS,xL) (yS,yL) = (xS*yS, xL+yL) % negateSignLog (s,l) = (s, negate l) <Evaluate the convergents of a continued fraction using Lentz' s method,  (see ;) with the additional rule that if a denominator ever goes I to zero, it will be replaced by a (very small) number of your choosing, H typically 1e-30 or so (this modification was proposed by Thompson and  Barnett). FAdditionally splits the resulting list of convergents into sublists, $ starting a new list every time the ' modification' is invoked.  with a group homomorphism (see , it bears the  same relationship to  as this function does to , 0 and solves the same problems). Alternatively,  with the same # modification to the recurrence as . Euler's formula for computing sum (scanl1 (*) xs). ) Successive convergents of the resulting  are successive partial sums  in the series.           !continued-fractions-0.9.1.1Math.ContinuedFractionCFcfgcfasCFasGCF truncateCFequivsetDenominators setNumerators partitionCFevenCFoddCF convergentssteedlentz lentzWith modifiedLentzmodifiedLentzWithsumPartialProductsGCFbase GHC.FloatlogGHC.RealrecipGHC.NumnegatelentzRecurrencemodifiedLentzRecurrence $fFunctorCF$fShowCF