This adds in a relatively complex series of traits and generic wrapper structs.
The immediate benefit is that we can make the iterative root-finding driver generic rather than copy/paste for NR and Halley.
This becomes a bigger deal after I add in "safe" variants of both which keep the solver inside a bracket.
Finally, it also allows for a pie-in-sky optimization where NR actually takes something which computes f/df in a single go, allowing for potential optimization via analytic term cancellation and numeric term reuse.
This adds in a relatively complex series of traits and generic wrapper structs.
The immediate benefit is that we can make the iterative root-finding driver generic rather than copy/paste for NR and Halley.
This becomes a bigger deal after I add in "safe" variants of both which keep the solver inside a bracket.
Finally, it also allows for a pie-in-sky optimization where NR actually takes something which computes f/df in a single go, allowing for potential optimization via analytic term cancellation and numeric term reuse.
Closes https://github.com/nieksand/rootfind/issues/3