How would the Fibonacci’s closed form code look like in haskell?

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Trivially, Binet’s formula, from the Haskell wiki page is given in Haskell as:
Which includes sharing of the result of the square root. For example:
For arbitrary integers, you’ll need to be a bit more careful about the conversion to floating point values.
Note that Binet’s value differs from the recursive formula by quite a bit at this point:
You may need more precision 🙂