How to resolve the algorithm Feigenbaum constant calculation step by step in the F# programming language
Published on 12 May 2024 09:40 PM
How to resolve the algorithm Feigenbaum constant calculation step by step in the F# programming language
Table of Contents
Problem Statement
Calculate the Feigenbaum constant.
Let's start with the solution:
Step by Step solution about How to resolve the algorithm Feigenbaum constant calculation step by step in the F# programming language
Source code in the fsharp programming language
open System
[<EntryPoint>]
let main _ =
let maxIt = 13
let maxItJ = 10
let mutable a1 = 1.0
let mutable a2 = 0.0
let mutable d1 = 3.2
Console.WriteLine(" i d")
for i in 2 .. maxIt do
let mutable a = a1 + (a1 - a2) / d1
for j in 1 .. maxItJ do
let mutable x = 0.0
let mutable y = 0.0
for _ in 1 .. (1 <<< i) do
y <- 1.0 - 2.0 * y * x
x <- a - x * x
a <- a - x / y
let d = (a1 - a2) / (a - a1)
Console.WriteLine("{0,2:d} {1:f8}", i, d)
d1 <- d
a2 <- a1
a1 <- a
0 // return an integer exit code
You may also check:How to resolve the algorithm Zero to the zero power step by step in the MiniScript programming language
You may also check:How to resolve the algorithm Comments step by step in the SSEM programming language
You may also check:How to resolve the algorithm Fusc sequence step by step in the 11l programming language
You may also check:How to resolve the algorithm Topological sort step by step in the Phix programming language
You may also check:How to resolve the algorithm Null object step by step in the Oz programming language