nieksand / rootfind

Root finding in Rust.
The Unlicense
7 stars 1 forks source link

Crazy fn types #49

Closed nieksand closed 6 years ago

nieksand commented 6 years ago

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