{
  "name": "mpmath documented worked examples: findroot and quad outputs at stated precision",
  "description": "Calls from the official mpmath documentation for findroot and quad, with the working precision stated in the docs and the printed result, compiled to show how solver, method and interval choice change the digits returned.",
  "page": "https://casrai.org/guides/mpmath",
  "publisher": "CASRAI",
  "license": "https://creativecommons.org/licenses/by/4.0/",
  "dateModified": "2026-11-14T13:54:42Z",
  "temporalCoverage": "mpmath 1.4.x documentation",
  "spatialCoverage": null,
  "columns": [
    {
      "name": "Documented call",
      "unit": "",
      "description": ""
    },
    {
      "name": "Working precision",
      "unit": "decimal digits",
      "description": ""
    },
    {
      "name": "Documented result",
      "unit": "",
      "description": ""
    }
  ],
  "rows": [
    {
      "Documented call": "findroot(sin, 3)",
      "Working precision": 30,
      "Documented result": "3.14159265358979323846264338328"
    },
    {
      "Documented call": "findroot(lambda x: x**3+2*x+1, j)",
      "Working precision": 15,
      "Documented result": "(0.226698825758202 + 1.46771150871022j)"
    },
    {
      "Documented call": "findroot(zeta, 0.5+14j)",
      "Working precision": 30,
      "Documented result": "(0.5 + 14.1347251417346937904572519836j)"
    },
    {
      "Documented call": "findroot((x-1)**99, 0.9, verify=False)",
      "Working precision": 15,
      "Documented result": "0.918073542444929"
    },
    {
      "Documented call": "findroot((x-1)**99, -10, solver='mnewton')",
      "Working precision": 15,
      "Documented result": "1.0"
    },
    {
      "Documented call": "quad(sin, [0, pi])",
      "Working precision": 15,
      "Documented result": "2.0"
    },
    {
      "Documented call": "quad(lambda x: 2/(x**2+1), [0, inf])",
      "Working precision": 15,
      "Documented result": "3.14159265358979"
    },
    {
      "Documented call": "quad(log, [0, 1]), tanh-sinh",
      "Working precision": 15,
      "Documented result": "-1.0"
    },
    {
      "Documented call": "quad(log, [0, 1]), gauss-legendre",
      "Working precision": 15,
      "Documented result": "-0.999932197413801"
    },
    {
      "Documented call": "quad(lambda x: abs(sin(x)), [0, pi, 2*pi])",
      "Working precision": 15,
      "Documented result": "4.0"
    },
    {
      "Documented call": "quad(lambda x: abs(sin(x)), [0, 2*pi]) (unsplit)",
      "Working precision": 15,
      "Documented result": "3.99900894176779"
    },
    {
      "Documented call": "quad(sin, [0, 1000], maxdegree=10)",
      "Working precision": 15,
      "Documented result": "0.437620923709297"
    }
  ],
  "sources": [
    {
      "title": "mpmath documentation: Root-finding and optimization",
      "url": "https://mpmath.org/doc/current/calculus/optimization.html",
      "accessed": "2026-11-14"
    },
    {
      "title": "mpmath documentation: Numerical integration",
      "url": "https://mpmath.org/doc/current/calculus/integration.html",
      "accessed": "2026-11-14"
    }
  ]
}