demoAINumerics
Which root does Newton's method find?
Solve by Newton's method from every point of a square and color each start by the root it reaches. Near a root the answer is obvious. Along the lines between them it is a fractal: every boundary point touches all three basins.
Open in the workbenchDownload .vivOutputs below are from the site build’s run; Run all runs it again in your browser.
Look inside this program
- Atlas
The program’s map: every function and which calls which.
There’s no recorded run of this program yet.
Newton's step for is . It commutes with complex conjugation, so the picture is symmetric top to bottom, and the two complex roots must attract exactly the same number of grid points; the test checks that the counts are equal, not merely close.
Printed
Tests 3 of 3 pass
- each root is a fixed point of the Newton step (passes)
- every start on the grid has reached a root within 40 steps (passes)
- the two complex roots attract the same number of grid points, because the step commutes with conjugation (passes)