Conversation
src/effects.js
Outdated
There was a problem hiding this comment.
0.0001 seems like a magic number here. Can we be certain that this condition gets met?
There was a problem hiding this comment.
It is a magic number, and... no. The choice of how good a fit to demand while protecting ourselves against nontrivial loops is arbitrary.
There was a problem hiding this comment.
My only other thought is that we might want to put in an iteration counter as a failsafe? Also arbitrary, but guaranteed to terminate.
There was a problem hiding this comment.
How many iterations would you make through here, and would the starting value get a lot better after dozens of iterations? If the infinite loop is the exception then a small failsafe loop counter might be easier to deal with and a heck of a lot less mysterious.
No new test because I'm not really sure how to identify potentially nonterminating inputs.
Sizes - compared to master @ 6bc2a87