{
  "__type": "IngestedDoc",
  "__tag": 4010,
  "_content": {
    "Notes": {
      "__type": "Section",
      "__tag": 4015,
      "children": [
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "This function generalizes an algorithm found in pieces throughout the "
            },
            {
              "__type": "CrossRef",
              "__tag": 4002,
              "value": "scipy.stats",
              "reference": {
                "__type": "LocalRef",
                "__tag": 4022,
                "kind": "module",
                "path": "scipy.stats"
              },
              "kind": "module"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " codebase. The strategy is to iteratively grow the bracket "
            },
            {
              "__type": "InlineRole",
              "__tag": 4003,
              "value": "(l, r)",
              "domain": null,
              "role": null,
              "inventory": null
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " until "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "f(l) < 0 < f(r)"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " or "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "f(r) < 0 < f(l)"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": ". The bracket grows to the left as follows."
            }
          ]
        },
        {
          "__type": "BulletList",
          "__tag": 4053,
          "ordered": false,
          "start": 1,
          "children": [
            {
              "__type": "ListItem",
              "__tag": 4054,
              "children": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "If "
                    },
                    {
                      "__type": "ParamRef",
                      "__tag": 4071,
                      "name": "xmin"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " is not provided, the distance between "
                    },
                    {
                      "__type": "ParamRef",
                      "__tag": 4071,
                      "name": "xl0"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " and "
                    },
                    {
                      "__type": "InlineRole",
                      "__tag": 4003,
                      "value": "l",
                      "domain": null,
                      "role": null,
                      "inventory": null
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " is iteratively   increased by "
                    },
                    {
                      "__type": "ParamRef",
                      "__tag": 4071,
                      "name": "factor"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "."
                    }
                  ]
                }
              ]
            },
            {
              "__type": "ListItem",
              "__tag": 4054,
              "children": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "If "
                    },
                    {
                      "__type": "ParamRef",
                      "__tag": 4071,
                      "name": "xmin"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " is provided, the distance between "
                    },
                    {
                      "__type": "ParamRef",
                      "__tag": 4071,
                      "name": "xmin"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " and "
                    },
                    {
                      "__type": "InlineRole",
                      "__tag": 4003,
                      "value": "l",
                      "domain": null,
                      "role": null,
                      "inventory": null
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " is iteratively   decreased by "
                    },
                    {
                      "__type": "ParamRef",
                      "__tag": 4071,
                      "name": "factor"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": ". Note that this also "
                    },
                    {
                      "__type": "Emphasis",
                      "__tag": 4047,
                      "children": [
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": "increases"
                        }
                      ]
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " the bracket size."
                    }
                  ]
                }
              ]
            }
          ]
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "Growth of the bracket to the right is analogous."
            }
          ]
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "Growth of the bracket in one direction stops when the endpoint is no longer finite, the function value at the endpoint is no longer finite, or the endpoint reaches its limiting value ("
            },
            {
              "__type": "ParamRef",
              "__tag": 4071,
              "name": "xmin"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " or "
            },
            {
              "__type": "ParamRef",
              "__tag": 4071,
              "name": "xmax"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "). Iteration terminates when the bracket stops growing in both directions, the bracket surrounds the root, or a root is found (by chance)."
            }
          ]
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "If two brackets are found - that is, a bracket is found on both sides in the same iteration, the smaller of the two is returned."
            }
          ]
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "If roots of the function are found, both "
            },
            {
              "__type": "InlineRole",
              "__tag": 4003,
              "value": "xl",
              "domain": null,
              "role": null,
              "inventory": null
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " and "
            },
            {
              "__type": "InlineRole",
              "__tag": 4003,
              "value": "xr",
              "domain": null,
              "role": null,
              "inventory": null
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " are set to the leftmost root."
            }
          ]
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Strong",
              "__tag": 4048,
              "children": [
                {
                  "__type": "Text",
                  "__tag": 4046,
                  "value": "Array API Standard Support"
                }
              ]
            }
          ]
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "CrossRef",
              "__tag": 4002,
              "value": "bracket_root",
              "reference": {
                "__type": "LocalRef",
                "__tag": 4022,
                "kind": "module",
                "path": "scipy.optimize._elementwise:bracket_root"
              },
              "kind": "module"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " has experimental support for Python Array API Standard compatible backends in addition to NumPy. Please consider testing these features by setting an environment variable "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "SCIPY_ARRAY_API=1"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " and providing CuPy, PyTorch, JAX, or Dask arrays as array arguments. The following combinations of backend and device (or other capability) are supported."
            }
          ]
        },
        {
          "__type": "Code",
          "__tag": 4050,
          "value": "====================  ====================  ====================\nLibrary               CPU                   GPU\n====================  ====================  ====================\nNumPy                 ✅                     n/a                 \nCuPy                  n/a                   ✅                   \nPyTorch               ✅                     ✅                   \nJAX                   ⛔                     ⛔                   \nDask                  ⛔                     n/a                 \n====================  ====================  ====================",
          "execution_status": null,
          "out": ""
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "See "
            },
            {
              "__type": "CrossRef",
              "__tag": 4002,
              "value": "dev-arrayapi",
              "reference": {
                "__type": "LocalRef",
                "__tag": 4022,
                "kind": "docs",
                "path": "dev:api-dev:array_api"
              },
              "kind": "exists"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " for more information."
            }
          ]
        }
      ],
      "title": [],
      "level": 0,
      "target": null
    },
    "Warns": {
      "__type": "Section",
      "__tag": 4015,
      "children": [],
      "title": [],
      "level": 0,
      "target": null
    },
    "Raises": {
      "__type": "Section",
      "__tag": 4015,
      "children": [],
      "title": [],
      "level": 0,
      "target": null
    },
    "Yields": {
      "__type": "Section",
      "__tag": 4015,
      "children": [],
      "title": [],
      "level": 0,
      "target": null
    },
    "Methods": {
      "__type": "Section",
      "__tag": 4015,
      "children": [],
      "title": [],
      "level": 0,
      "target": null
    },
    "Returns": {
      "__type": "Section",
      "__tag": 4015,
      "children": [
        {
          "__type": "Parameters",
          "__tag": 4026,
          "children": [
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "res",
              "annotation": "_RichResult",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "An object similar to an instance of "
                    },
                    {
                      "__type": "CrossRef",
                      "__tag": 4002,
                      "value": "scipy.optimize.OptimizeResult",
                      "reference": {
                        "__type": "RefInfo",
                        "__tag": 4000,
                        "module": "scipy",
                        "version": "?",
                        "kind": "module",
                        "path": "scipy.optimize._optimize:OptimizeResult"
                      },
                      "kind": "module"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " with the following attributes. The descriptions are written as though the values will be scalars; however, if "
                    },
                    {
                      "__type": "ParamRef",
                      "__tag": 4071,
                      "name": "f"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " returns an array, the outputs will be arrays of the same shape."
                    }
                  ]
                },
                {
                  "__type": "DefList",
                  "__tag": 4033,
                  "children": [
                    {
                      "__type": "DefListItem",
                      "__tag": 4037,
                      "dt": {
                        "__type": "Paragraph",
                        "__tag": 4045,
                        "children": [
                          {
                            "__type": "Text",
                            "__tag": 4046,
                            "value": "success"
                          }
                        ]
                      },
                      "dd": [
                        {
                          "__type": "Paragraph",
                          "__tag": 4045,
                          "children": [
                            {
                              "__type": "InlineCode",
                              "__tag": 4051,
                              "value": "True"
                            },
                            {
                              "__type": "Text",
                              "__tag": 4046,
                              "value": " where the algorithm terminated successfully (status "
                            },
                            {
                              "__type": "InlineCode",
                              "__tag": 4051,
                              "value": "0"
                            },
                            {
                              "__type": "Text",
                              "__tag": 4046,
                              "value": ");     "
                            },
                            {
                              "__type": "InlineCode",
                              "__tag": 4051,
                              "value": "False"
                            },
                            {
                              "__type": "Text",
                              "__tag": 4046,
                              "value": " otherwise."
                            }
                          ]
                        }
                      ]
                    },
                    {
                      "__type": "DefListItem",
                      "__tag": 4037,
                      "dt": {
                        "__type": "Paragraph",
                        "__tag": 4045,
                        "children": [
                          {
                            "__type": "Text",
                            "__tag": 4046,
                            "value": "status"
                          }
                        ]
                      },
                      "dd": [
                        {
                          "__type": "Paragraph",
                          "__tag": 4045,
                          "children": [
                            {
                              "__type": "Text",
                              "__tag": 4046,
                              "value": "An integer representing the exit status of the algorithm."
                            }
                          ]
                        },
                        {
                          "__type": "BulletList",
                          "__tag": 4053,
                          "ordered": false,
                          "start": 1,
                          "children": [
                            {
                              "__type": "ListItem",
                              "__tag": 4054,
                              "children": [
                                {
                                  "__type": "Paragraph",
                                  "__tag": 4045,
                                  "children": [
                                    {
                                      "__type": "InlineCode",
                                      "__tag": 4051,
                                      "value": "0"
                                    },
                                    {
                                      "__type": "Text",
                                      "__tag": 4046,
                                      "value": "The algorithm produced a valid bracket."
                                    }
                                  ]
                                }
                              ]
                            },
                            {
                              "__type": "ListItem",
                              "__tag": 4054,
                              "children": [
                                {
                                  "__type": "Paragraph",
                                  "__tag": 4045,
                                  "children": [
                                    {
                                      "__type": "InlineCode",
                                      "__tag": 4051,
                                      "value": "-1"
                                    },
                                    {
                                      "__type": "Text",
                                      "__tag": 4046,
                                      "value": "The bracket expanded to the allowable limits without success."
                                    }
                                  ]
                                }
                              ]
                            },
                            {
                              "__type": "ListItem",
                              "__tag": 4054,
                              "children": [
                                {
                                  "__type": "Paragraph",
                                  "__tag": 4045,
                                  "children": [
                                    {
                                      "__type": "InlineCode",
                                      "__tag": 4051,
                                      "value": "-2"
                                    },
                                    {
                                      "__type": "Text",
                                      "__tag": 4046,
                                      "value": "The maximum number of iterations was reached."
                                    }
                                  ]
                                }
                              ]
                            },
                            {
                              "__type": "ListItem",
                              "__tag": 4054,
                              "children": [
                                {
                                  "__type": "Paragraph",
                                  "__tag": 4045,
                                  "children": [
                                    {
                                      "__type": "InlineCode",
                                      "__tag": 4051,
                                      "value": "-3"
                                    },
                                    {
                                      "__type": "Text",
                                      "__tag": 4046,
                                      "value": "A non-finite value was encountered."
                                    }
                                  ]
                                }
                              ]
                            },
                            {
                              "__type": "ListItem",
                              "__tag": 4054,
                              "children": [
                                {
                                  "__type": "Paragraph",
                                  "__tag": 4045,
                                  "children": [
                                    {
                                      "__type": "InlineCode",
                                      "__tag": 4051,
                                      "value": "-4"
                                    },
                                    {
                                      "__type": "Text",
                                      "__tag": 4046,
                                      "value": "Iteration was terminated by "
                                    },
                                    {
                                      "__type": "InlineRole",
                                      "__tag": 4003,
                                      "value": "callback",
                                      "domain": null,
                                      "role": null,
                                      "inventory": null
                                    },
                                    {
                                      "__type": "Text",
                                      "__tag": 4046,
                                      "value": "."
                                    }
                                  ]
                                }
                              ]
                            },
                            {
                              "__type": "ListItem",
                              "__tag": 4054,
                              "children": [
                                {
                                  "__type": "Paragraph",
                                  "__tag": 4045,
                                  "children": [
                                    {
                                      "__type": "InlineCode",
                                      "__tag": 4051,
                                      "value": "-5"
                                    },
                                    {
                                      "__type": "Text",
                                      "__tag": 4046,
                                      "value": ": The initial bracket does not satisfy`xmin <= xl0 < xr0 < xmax`."
                                    }
                                  ]
                                }
                              ]
                            }
                          ]
                        }
                      ]
                    },
                    {
                      "__type": "DefListItem",
                      "__tag": 4037,
                      "dt": {
                        "__type": "Paragraph",
                        "__tag": 4045,
                        "children": [
                          {
                            "__type": "Text",
                            "__tag": 4046,
                            "value": "bracket"
                          }
                        ]
                      },
                      "dd": [
                        {
                          "__type": "Paragraph",
                          "__tag": 4045,
                          "children": [
                            {
                              "__type": "Text",
                              "__tag": 4046,
                              "value": "The lower and upper endpoints of the bracket, if the algorithm     terminated successfully."
                            }
                          ]
                        }
                      ]
                    },
                    {
                      "__type": "DefListItem",
                      "__tag": 4037,
                      "dt": {
                        "__type": "Paragraph",
                        "__tag": 4045,
                        "children": [
                          {
                            "__type": "Text",
                            "__tag": 4046,
                            "value": "f_bracket"
                          }
                        ]
                      },
                      "dd": [
                        {
                          "__type": "Paragraph",
                          "__tag": 4045,
                          "children": [
                            {
                              "__type": "Text",
                              "__tag": 4046,
                              "value": "The values of "
                            },
                            {
                              "__type": "ParamRef",
                              "__tag": 4071,
                              "name": "f"
                            },
                            {
                              "__type": "Text",
                              "__tag": 4046,
                              "value": " evaluated at the endpoints of "
                            },
                            {
                              "__type": "InlineCode",
                              "__tag": 4051,
                              "value": "res.bracket"
                            },
                            {
                              "__type": "Text",
                              "__tag": 4046,
                              "value": ",     respectively."
                            }
                          ]
                        }
                      ]
                    },
                    {
                      "__type": "DefListItem",
                      "__tag": 4037,
                      "dt": {
                        "__type": "Paragraph",
                        "__tag": 4045,
                        "children": [
                          {
                            "__type": "Text",
                            "__tag": 4046,
                            "value": "nfev"
                          }
                        ]
                      },
                      "dd": [
                        {
                          "__type": "Paragraph",
                          "__tag": 4045,
                          "children": [
                            {
                              "__type": "Text",
                              "__tag": 4046,
                              "value": "The number of abscissae at which "
                            },
                            {
                              "__type": "ParamRef",
                              "__tag": 4071,
                              "name": "f"
                            },
                            {
                              "__type": "Text",
                              "__tag": 4046,
                              "value": " was evaluated to find the root.     This is distinct from the number of times "
                            },
                            {
                              "__type": "ParamRef",
                              "__tag": 4071,
                              "name": "f"
                            },
                            {
                              "__type": "Text",
                              "__tag": 4046,
                              "value": " is "
                            },
                            {
                              "__type": "Emphasis",
                              "__tag": 4047,
                              "children": [
                                {
                                  "__type": "Text",
                                  "__tag": 4046,
                                  "value": "called"
                                }
                              ]
                            },
                            {
                              "__type": "Text",
                              "__tag": 4046,
                              "value": " because the     the function may evaluated at multiple points in a single call."
                            }
                          ]
                        }
                      ]
                    },
                    {
                      "__type": "DefListItem",
                      "__tag": 4037,
                      "dt": {
                        "__type": "Paragraph",
                        "__tag": 4045,
                        "children": [
                          {
                            "__type": "Text",
                            "__tag": 4046,
                            "value": "nit"
                          }
                        ]
                      },
                      "dd": [
                        {
                          "__type": "Paragraph",
                          "__tag": 4045,
                          "children": [
                            {
                              "__type": "Text",
                              "__tag": 4046,
                              "value": "The number of iterations of the algorithm that were performed."
                            }
                          ]
                        }
                      ]
                    }
                  ]
                }
              ]
            }
          ]
        }
      ],
      "title": [],
      "level": 0,
      "target": null
    },
    "Summary": {
      "__type": "Section",
      "__tag": 4015,
      "children": [
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "Bracket the root of a monotonic, real-valued function of a real variable."
            }
          ]
        }
      ],
      "title": [],
      "level": 0,
      "target": null
    },
    "Receives": {
      "__type": "Section",
      "__tag": 4015,
      "children": [],
      "title": [],
      "level": 0,
      "target": null
    },
    "Warnings": {
      "__type": "Section",
      "__tag": 4015,
      "children": [],
      "title": [],
      "level": 0,
      "target": null
    },
    "Attributes": {
      "__type": "Section",
      "__tag": 4015,
      "children": [],
      "title": [],
      "level": 0,
      "target": null
    },
    "Parameters": {
      "__type": "Section",
      "__tag": 4015,
      "children": [
        {
          "__type": "Parameters",
          "__tag": 4026,
          "children": [
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "f",
              "annotation": "callable",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "The function for which the root is to be bracketed. The signature must be      "
                    }
                  ]
                },
                {
                  "__type": "Code",
                  "__tag": 4050,
                  "value": "f(x: array, *args) -> array",
                  "execution_status": null,
                  "out": ""
                },
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "where each element of "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "x"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " is a finite real and "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "args"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " is a tuple, which may contain an arbitrary number of arrays that are broadcastable with "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "x"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "."
                    }
                  ]
                },
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "ParamRef",
                      "__tag": 4071,
                      "name": "f"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " must be an elementwise function: each element "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "f(x)[i]"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " must equal "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "f(x[i])"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " for all indices "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "i"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": ". It must not mutate the array "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "x"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " or the arrays in "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "args"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "."
                    }
                  ]
                }
              ]
            },
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "xl0, xr0",
              "annotation": "float array_like",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "Starting guess of bracket, which need not contain a root. If "
                    },
                    {
                      "__type": "ParamRef",
                      "__tag": 4071,
                      "name": "xr0"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " is not provided, "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "xr0 = xl0 + 1"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": ". Must be broadcastable with all other array inputs."
                    }
                  ]
                }
              ]
            },
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "xmin, xmax",
              "annotation": "float array_like, optional",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "Minimum and maximum allowable endpoints of the bracket, inclusive. Must be broadcastable with all other array inputs."
                    }
                  ]
                }
              ]
            },
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "factor",
              "annotation": "float array_like, default: 2",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "The factor used to grow the bracket. See Notes."
                    }
                  ]
                }
              ]
            },
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "args",
              "annotation": "tuple of array_like, optional",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "Additional positional array arguments to be passed to "
                    },
                    {
                      "__type": "ParamRef",
                      "__tag": 4071,
                      "name": "f"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": ". If the callable for which the root is desired requires arguments that are not broadcastable with "
                    },
                    {
                      "__type": "InlineRole",
                      "__tag": 4003,
                      "value": "x",
                      "domain": null,
                      "role": null,
                      "inventory": null
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": ", wrap that callable with "
                    },
                    {
                      "__type": "ParamRef",
                      "__tag": 4071,
                      "name": "f"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " such that "
                    },
                    {
                      "__type": "ParamRef",
                      "__tag": 4071,
                      "name": "f"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " accepts only "
                    },
                    {
                      "__type": "InlineRole",
                      "__tag": 4003,
                      "value": "x",
                      "domain": null,
                      "role": null,
                      "inventory": null
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " and broadcastable "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "*args"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "."
                    }
                  ]
                }
              ]
            },
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "kwargs",
              "annotation": "dict of str:array_like, optional",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "Additional keyword arguments to be passed to "
                    },
                    {
                      "__type": "ParamRef",
                      "__tag": 4071,
                      "name": "f"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": ". See "
                    },
                    {
                      "__type": "ParamRef",
                      "__tag": 4071,
                      "name": "args"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "."
                    }
                  ]
                }
              ]
            },
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "maxiter",
              "annotation": "int, default: 1000",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "The maximum number of iterations of the algorithm to perform."
                    }
                  ]
                }
              ]
            }
          ]
        }
      ],
      "title": [],
      "level": 0,
      "target": null
    },
    "Extended Summary": {
      "__type": "Section",
      "__tag": 4015,
      "children": [
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "For each element of the output of "
            },
            {
              "__type": "ParamRef",
              "__tag": 4071,
              "name": "f"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": ", "
            },
            {
              "__type": "CrossRef",
              "__tag": 4002,
              "value": "bracket_root",
              "reference": {
                "__type": "LocalRef",
                "__tag": 4022,
                "kind": "module",
                "path": "scipy.optimize._elementwise:bracket_root"
              },
              "kind": "module"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " seeks the scalar bracket endpoints "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "xl"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " and "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "xr"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " such that "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "sign(f(xl)) == -sign(f(xr))"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " elementwise."
            }
          ]
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "The function is guaranteed to find a valid bracket if the function is monotonic, but it may find a bracket under other conditions."
            }
          ]
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "This function works elementwise when "
            },
            {
              "__type": "ParamRef",
              "__tag": 4071,
              "name": "xl0"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": ", "
            },
            {
              "__type": "ParamRef",
              "__tag": 4071,
              "name": "xr0"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": ", "
            },
            {
              "__type": "ParamRef",
              "__tag": 4071,
              "name": "xmin"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": ", "
            },
            {
              "__type": "ParamRef",
              "__tag": 4071,
              "name": "xmax"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": ", "
            },
            {
              "__type": "ParamRef",
              "__tag": 4071,
              "name": "factor"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": ", and the elements of "
            },
            {
              "__type": "ParamRef",
              "__tag": 4071,
              "name": "args"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " are (mutually broadcastable) arrays."
            }
          ]
        }
      ],
      "title": [],
      "level": 0,
      "target": null
    },
    "Other Parameters": {
      "__type": "Section",
      "__tag": 4015,
      "children": [],
      "title": [],
      "level": 0,
      "target": null
    }
  },
  "_ordered_sections": [
    "Summary",
    "Extended Summary",
    "Parameters",
    "Attributes",
    "Methods",
    "Returns",
    "Yields",
    "Receives",
    "Other Parameters",
    "Raises",
    "Warns",
    "Warnings",
    "Notes"
  ],
  "item_file": "/scipy/optimize/_elementwise.py",
  "item_line": 474,
  "item_type": "function",
  "aliases": [
    "scipy.optimize._elementwise.bracket_root"
  ],
  "example_section_data": {
    "__type": "Section",
    "__tag": 4015,
    "children": [
      {
        "__type": "Text",
        "__tag": 4046,
        "value": "Suppose we wish to find the root of the following function.\n\n"
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "def f(x, c=5):\n    return x**3 - 2*x - c\n",
        "execution_status": "success",
        "out": ""
      },
      {
        "__type": "Text",
        "__tag": 4046,
        "value": "\nFirst, we must find a valid bracket. The function is not monotonic,\nbut `bracket_root` may be able to provide a bracket.\n\n"
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "from scipy.optimize import elementwise\nres_bracket = elementwise.bracket_root(f, 0)\n",
        "execution_status": "success",
        "out": ""
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "res_bracket.success\nres_bracket.bracket\n",
        "execution_status": "failure",
        "out": "(np.float64(2.0), np.float64(4.0))\n"
      },
      {
        "__type": "Text",
        "__tag": 4046,
        "value": "\nIndeed, the values of the function at the bracket endpoints have\nopposite signs.\n\n"
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "res_bracket.f_bracket\n",
        "execution_status": "failure",
        "out": "(np.float64(-1.0), np.float64(51.0))\n"
      },
      {
        "__type": "Text",
        "__tag": 4046,
        "value": "\nOnce we have a valid bracket, `find_root` can be used to provide\na precise root.\n\n"
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "res_root = elementwise.find_root(f, res_bracket.bracket)\n",
        "execution_status": "success",
        "out": ""
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "res_root.x\n",
        "execution_status": "failure",
        "out": "np.float64(2.0945514815423265)\n"
      },
      {
        "__type": "Text",
        "__tag": 4046,
        "value": "\n`bracket_root` and `find_root` accept arrays for most arguments.\nFor instance, to find the root for a few values of the parameter ``c``\nat once:\n\n"
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "import numpy as np\nc = np.asarray([3, 4, 5])\nres_bracket = elementwise.bracket_root(f, 0, args=(c,))\nres_bracket.bracket\nres_root = elementwise.find_root(f, res_bracket.bracket, args=(c,))\n",
        "execution_status": "success",
        "out": ""
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "res_root.x\n",
        "execution_status": "failure",
        "out": "array([1.89329, 2.     , 2.09455])\n"
      }
    ],
    "title": [],
    "level": 0,
    "target": null
  },
  "see_also": [
    {
      "__type": "SeeAlsoItem",
      "__tag": 4028,
      "name": {
        "__type": "CrossRef",
        "__tag": 4002,
        "value": "find_root",
        "reference": {
          "__type": "LocalRef",
          "__tag": 4022,
          "kind": "module",
          "path": "scipy.optimize._elementwise:find_root"
        },
        "kind": "module"
      },
      "descriptions": [],
      "type": "func"
    }
  ],
  "signature": {
    "__type": "SignatureNode",
    "__tag": 4029,
    "kind": "function",
    "parameters": [
      {
        "__type": "SigParam",
        "__tag": 4030,
        "name": "f",
        "annotation": {
          "__type": "Empty",
          "__tag": 4031
        },
        "kind": "POSITIONAL_OR_KEYWORD",
        "default": {
          "__type": "Empty",
          "__tag": 4031
        }
      },
      {
        "__type": "SigParam",
        "__tag": 4030,
        "name": "xl0",
        "annotation": {
          "__type": "Empty",
          "__tag": 4031
        },
        "kind": "POSITIONAL_OR_KEYWORD",
        "default": {
          "__type": "Empty",
          "__tag": 4031
        }
      },
      {
        "__type": "SigParam",
        "__tag": 4030,
        "name": "xr0",
        "annotation": {
          "__type": "Empty",
          "__tag": 4031
        },
        "kind": "POSITIONAL_OR_KEYWORD",
        "default": "None"
      },
      {
        "__type": "SigParam",
        "__tag": 4030,
        "name": "xmin",
        "annotation": {
          "__type": "Empty",
          "__tag": 4031
        },
        "kind": "KEYWORD_ONLY",
        "default": "None"
      },
      {
        "__type": "SigParam",
        "__tag": 4030,
        "name": "xmax",
        "annotation": {
          "__type": "Empty",
          "__tag": 4031
        },
        "kind": "KEYWORD_ONLY",
        "default": "None"
      },
      {
        "__type": "SigParam",
        "__tag": 4030,
        "name": "factor",
        "annotation": {
          "__type": "Empty",
          "__tag": 4031
        },
        "kind": "KEYWORD_ONLY",
        "default": "None"
      },
      {
        "__type": "SigParam",
        "__tag": 4030,
        "name": "args",
        "annotation": {
          "__type": "Empty",
          "__tag": 4031
        },
        "kind": "KEYWORD_ONLY",
        "default": "()"
      },
      {
        "__type": "SigParam",
        "__tag": 4030,
        "name": "kwargs",
        "annotation": {
          "__type": "Empty",
          "__tag": 4031
        },
        "kind": "KEYWORD_ONLY",
        "default": "None"
      },
      {
        "__type": "SigParam",
        "__tag": 4030,
        "name": "maxiter",
        "annotation": {
          "__type": "Empty",
          "__tag": 4031
        },
        "kind": "KEYWORD_ONLY",
        "default": "1000"
      }
    ],
    "return_annotation": {
      "__type": "Empty",
      "__tag": 4031
    },
    "target_name": "bracket_root"
  },
  "references": null,
  "qa": "scipy.optimize._elementwise:bracket_root",
  "arbitrary": [],
  "local_refs": [
    "args",
    "f",
    "factor",
    "kwargs",
    "maxiter",
    "res",
    "xl0",
    "xmax",
    "xmin",
    "xr0"
  ]
}