{
  "aliases": null,
  "backlinks": null,
  "body": "\n## Statement\n\nLet $f \\colon [a, b] \\to \\R$ be continuous with $f(a) f(b) \u003c 0$, and let $\\varepsilon \u003e 0$ be a tolerance.\n*Brent's method* keeps at each step a bracket, an interval whose endpoints have values of opposite signs.\nAt each step it proposes a new point by [[inverse quadratic interpolation|NW1XQ95R5P]] or by the [[secant method|9ZC177PVPC]].\nIt falls back to a [[bisection|7VMYC7MB3Q]] step when the proposed point fails tests on its position or on the decrease of the bracket.\nThen:\n\n1. Every bracket contains a zero of $f$.\n2. The method stops after finitely many evaluations of $f$ with a bracket of length at most $\\varepsilon$, up to the rounding allowance in its tests.\n3. If bisection needs $N$ steps to reach the tolerance, Brent's method needs at most about $N^2$ evaluations of $f$.\n\n## Remarks\n\nClaim 1 follows from the [[intermediate value theorem|00KAFBR32E]], since the method only keeps brackets with a sign change.\nClaims 2 and 3 come from the safeguards: the tests force a bisection step whenever the interpolation steps have not shrunk the bracket enough over the last few steps.\nThe bound in claim 3 is a worst case.\nFor a smooth function with a simple zero, the method ends up taking interpolation steps only, and then it converges superlinearly.\nSo it combines the reliability of bisection with the speed of the interpolation methods.\nIt refines an earlier method of Dekker, which could take a very large number of tiny steps.\nIt is the standard root finder for one equation in many numerical libraries, for example as `fzero` in MATLAB.\n\n## Explanations\n\n### L1 human\n\nBisection is slow but cannot fail; interpolation is fast but can go wrong.\nBrent's method tries a fast interpolation step first and checks that it behaves.\nIf it does not, the method takes a safe bisection step instead, so the root stays trapped in a shrinking interval.\n\n### L2 human\n\nThe main design point is the bracket: the method never gives up the sign change, so convergence is guaranteed for every continuous $f$.\nFor well-behaved $f$ the interpolation steps dominate and the speed is close to that of inverse quadratic interpolation.\nTo use it, one needs a starting interval where $f$ changes sign.\n",
  "commit": "ff8a40749dc16545e3d2fc637f6b0196e81d0bfa",
  "front": {
    "about": [
      "TR4CNS5PMJ"
    ],
    "kind": "statement",
    "msc": [
      "65H05"
    ],
    "name": "Brent's method",
    "role": "theorem",
    "same_as": {
      "wikidata": "Q905988",
      "wikipedia": "Brent's method"
    },
    "sources": [
      {
        "url": "https://en.wikipedia.org/wiki/Brent%27s_method"
      }
    ],
    "tag": "5F76XA1ABC",
    "uses": [
      "00KAFBR32E",
      "7VMYC7MB3Q",
      "9ZC177PVPC",
      "NW1XQ95R5P"
    ]
  },
  "kind": "statement",
  "link": "https://tamnd.github.io/math2/node/5F76XA1ABC/",
  "links": [
    {
      "field": "about",
      "target": "TR4CNS5PMJ"
    },
    {
      "field": "uses",
      "target": "00KAFBR32E"
    },
    {
      "field": "uses",
      "target": "7VMYC7MB3Q"
    },
    {
      "field": "uses",
      "target": "9ZC177PVPC"
    },
    {
      "field": "uses",
      "target": "NW1XQ95R5P"
    }
  ],
  "markdown": "https://tamnd.github.io/math2/node/5F76XA1ABC.md",
  "msc": [
    "65H05"
  ],
  "name": "Brent's method",
  "prov": null,
  "role": "theorem",
  "source": "https://github.com/tamnd/math2/blob/main/nodes/5F7/5F76XA1ABC.md",
  "status": null,
  "tag": "5F76XA1ABC",
  "uri": "m2://5F76XA1ABC",
  "url": "https://tamnd.github.io/math2/wiki/brents-method/",
  "writing": {
    "tag": "5F76XA1ABC",
    "kind": "statement",
    "level": "W0",
    "next": [
      {
        "what": "a source with a locator",
        "have": 0,
        "want": 1
      }
    ]
  }
}
