This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* @flow */ | |
// Derived from: https://en.wikipedia.org/wiki/Brent%27s_method#Algorithm | |
// Brent's method is a hybrid root-finding algorithm that combines the | |
// faster/less-reliable inverse quadradic interpolation and secant methods with | |
// the slower/more-reliable bisection method. | |
export function brent( | |
f: (x: number) => number, | |
lowerBound: number, |