Find which regions of the complex plane converge on a polynomial root, which do not, and what roots are found. Evaluate trajectories and generate images for Newton's method, Halley's method, and the secant method in the complex plane.
If you do have access to a graphic processing unit, see parallelized
for modules that implement root-finding methods using the torch
library. This is by far the fastest option, with hundreds of root finding iterations on a 2k by 2k array taking less than a second on an RTX 3060.
If you do not have a GPU, see optimized
for modules that have been optimized using numexpr
, capable of completing through tens of iterations on a 2k by 2k array per second on a mid-range CPU.
These methods yield maps of the number of root finding iterations required per region of the complex plane. For example, here is a map where light pixels take longer to settle on a root than dark, of x^13-x-1
using Halley's method: