Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Alternative impl
let iterate c = Seq.unfold (fun z -> Some(z ** 2.0 + c, z ** 2.0 + c)) Complex.Zero
let countIterations startingPoint maxIterations =
iterate startingPoint
|> Seq.truncate maxIterations
|> Seq.takeWhile (fun z -> z.Magnitude < 2.0)
|> Seq.length
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment