Optimizing math in Buddhabrot Generator