Continued Fraction
diluculo opened this issue · 2 comments
diluculo commented
Is there any plan to support the continued fraction (CF)?
Examples I want to cover with CF:
- For rational number : p / q
- ContinuedFraction( 1.23 ) => [1, 4, 2, 1, 7]
- FromContinuedFraction ( [1, 4, 2, 1, 7] ) => 123 / 100 = 1.23
- For quadratic irrational number : ( p + sqrt(d) ) / q
- ContinuedFraction( (1 + sqrt(2)) / 3 ) => [0, 1, [4, 8]] where [4, 8] is a periodic part
- FromContinuedFraction( [0, 1, [4, 8]] ) => (1 + sqrt(2)) / 3 ~ 0.804738
- Infinite CF : Personally, I'd like to calculate the Bessel Ratio, I(1, z) / I(0, z) which can be expressed with infinite CF.
- ContinuedFraction( I(1, 1) / I(0, 1), 10 ) => [0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22] where 10 is the number of terms
- FromContinuedFraction( [0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22] ) => 45164504281/101177239032 ~ 0.44639
References:
FoggyFinder commented
probably this issue better fits for MathNet.Numerics project
diluculo commented
@FoggyFinder You are right. The CF as a number theory can be added to the Numerics for numerical calculation and codes of Beta and ExponentialIntegral functions are based on the CF. However, I need the CF as Symbolic expression.