Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Continued Fraction #58

Open
diluculo opened this issue Oct 19, 2018 · 2 comments
Open

Continued Fraction #58

diluculo opened this issue Oct 19, 2018 · 2 comments

Comments

@diluculo
Copy link
Contributor

Is there any plan to support the continued fraction (CF)?

Examples I want to cover with CF:

  1. For rational number : p / q
    • ContinuedFraction( 1.23 ) => [1, 4, 2, 1, 7]
    • FromContinuedFraction ( [1, 4, 2, 1, 7] ) => 123 / 100 = 1.23
  2. 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
  3. 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:

  1. https://en.wikipedia.org/wiki/Continued_fraction
  2. https://rosettacode.org/wiki/Continued_fraction
  3. http://duckmaestro.com/2011/05/31/f-sharp-and-continued-fractions/
@FoggyFinder
Copy link
Contributor

probably this issue better fits for MathNet.Numerics project

@diluculo
Copy link
Contributor Author

diluculo commented Oct 19, 2018

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants