{
  "__type": "IngestedDoc",
  "__tag": 4010,
  "_content": {
    "Notes": {
      "__type": "Section",
      "__tag": 4015,
      "children": [
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "Similar to "
            },
            {
              "__type": "CrossRef",
              "__tag": 4002,
              "value": "scipy.optimize.bracket",
              "reference": {
                "__type": "RefInfo",
                "__tag": 4000,
                "module": "scipy",
                "version": "?",
                "kind": "module",
                "path": "scipy.optimize._optimize:bracket"
              },
              "kind": "module"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": ", this function seeks to find real points "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "xl < xm < xr"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " such that "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "f(xl) >= f(xm)"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " and "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "f(xr) >= f(xm)"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": ", where at least one of the inequalities is strict. Unlike "
            },
            {
              "__type": "CrossRef",
              "__tag": 4002,
              "value": "scipy.optimize.bracket",
              "reference": {
                "__type": "RefInfo",
                "__tag": 4000,
                "module": "scipy",
                "version": "?",
                "kind": "module",
                "path": "scipy.optimize._optimize:bracket"
              },
              "kind": "module"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": ", this function can operate in a vectorized manner on array input, so long as the input arrays are broadcastable with each other. Also unlike "
            },
            {
              "__type": "CrossRef",
              "__tag": 4002,
              "value": "scipy.optimize.bracket",
              "reference": {
                "__type": "RefInfo",
                "__tag": 4000,
                "module": "scipy",
                "version": "?",
                "kind": "module",
                "path": "scipy.optimize._optimize:bracket"
              },
              "kind": "module"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": ", users may specify minimum and maximum endpoints for the desired bracket."
            }
          ]
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "Given an initial trio of points "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "xl = xl0"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": ", "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "xm = xm0"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": ", "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "xr = xr0"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": ", the algorithm checks if these points already give a valid bracket. If not, a new endpoint, "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "w"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " is chosen in the \"downhill\" direction, "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "xm"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " becomes the new opposite endpoint, and either "
            },
            {
              "__type": "InlineRole",
              "__tag": 4003,
              "value": "xl",
              "domain": null,
              "role": null,
              "inventory": null
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " or "
            },
            {
              "__type": "InlineRole",
              "__tag": 4003,
              "value": "xr",
              "domain": null,
              "role": null,
              "inventory": null
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " becomes the new middle point, depending on which direction is downhill. The algorithm repeats from here."
            }
          ]
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "The new endpoint "
            },
            {
              "__type": "InlineRole",
              "__tag": 4003,
              "value": "w",
              "domain": null,
              "role": null,
              "inventory": null
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " is chosen differently depending on whether or not a boundary "
            },
            {
              "__type": "ParamRef",
              "__tag": 4071,
              "name": "xmin"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " or "
            },
            {
              "__type": "ParamRef",
              "__tag": 4071,
              "name": "xmax"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " has been set in the downhill direction. Without loss of generality, suppose the downhill direction is to the right, so that "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "f(xl) > f(xm) > f(xr)"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": ". If there is no boundary to the right, then "
            },
            {
              "__type": "InlineRole",
              "__tag": 4003,
              "value": "w",
              "domain": null,
              "role": null,
              "inventory": null
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " is chosen to be "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "xr + factor * (xr - xm)"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " where "
            },
            {
              "__type": "ParamRef",
              "__tag": 4071,
              "name": "factor"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " is controlled by the user (defaults to 2.0) so that step sizes increase in geometric proportion. If there is a boundary, "
            },
            {
              "__type": "ParamRef",
              "__tag": 4071,
              "name": "xmax"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " in this case, then "
            },
            {
              "__type": "InlineRole",
              "__tag": 4003,
              "value": "w",
              "domain": null,
              "role": null,
              "inventory": null
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " is chosen to be "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "xmax - (xmax - xr)/factor"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": ", with steps slowing to a stop at "
            },
            {
              "__type": "ParamRef",
              "__tag": 4071,
              "name": "xmax"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": ". This cautious approach ensures that a minimum near but distinct from the boundary isn't missed while also detecting whether or not the "
            },
            {
              "__type": "ParamRef",
              "__tag": 4071,
              "name": "xmax"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " is a minimizer when "
            },
            {
              "__type": "ParamRef",
              "__tag": 4071,
              "name": "xmax"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " is reached after a finite number of steps."
            }
          ]
        },
        {
          "__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_minimum",
              "reference": {
                "__type": "LocalRef",
                "__tag": 4022,
                "kind": "module",
                "path": "scipy.optimize._elementwise:bracket_minimum"
              },
              "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. Assuming       unimodality, this implies the endpoint at the limit is a minimizer."
                                    }
                                  ]
                                }
                              ]
                            },
                            {
                              "__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": "InlineCode",
                                      "__tag": 4051,
                                      "value": "None"
                                    },
                                    {
                                      "__type": "Text",
                                      "__tag": 4046,
                                      "value": " shall pass."
                                    }
                                  ]
                                }
                              ]
                            },
                            {
                              "__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       "
                                    },
                                    {
                                      "__type": "InlineRole",
                                      "__tag": 4003,
                                      "value": "xmin <= xl0 < xm0 < xr0 <= xmax",
                                      "domain": null,
                                      "role": null,
                                      "inventory": null
                                    },
                                    {
                                      "__type": "Text",
                                      "__tag": 4046,
                                      "value": "."
                                    }
                                  ]
                                }
                              ]
                            }
                          ]
                        }
                      ]
                    },
                    {
                      "__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 left, middle, and right points 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 function value at the left, middle, and right points of the bracket."
                            }
                          ]
                        }
                      ]
                    },
                    {
                      "__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 minimum of a unimodal, 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": "xm0",
              "annotation": "float array_like",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "Starting guess for middle point of bracket."
                    }
                  ]
                }
              ]
            },
            {
              "__type": "DocParam",
              "__tag": 4016,
              "name": "xl0, xr0",
              "annotation": "float array_like, optional",
              "desc": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "Starting guesses for left and right endpoints of the bracket. 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_minimum",
              "reference": {
                "__type": "LocalRef",
                "__tag": 4022,
                "kind": "module",
                "path": "scipy.optimize._elementwise:bracket_minimum"
              },
              "kind": "module"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " seeks the scalar bracket points "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "xl < xm < xr"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " such that "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "fl >= fm <= fr"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " where one of the inequalities is strict."
            }
          ]
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "The function is guaranteed to find a valid bracket if the function is strongly unimodal, 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": "xm0"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": ", "
            },
            {
              "__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": 645,
  "item_type": "function",
  "aliases": [
    "scipy.optimize._elementwise.bracket_minimum"
  ],
  "example_section_data": {
    "__type": "Section",
    "__tag": 4015,
    "children": [
      {
        "__type": "Text",
        "__tag": 4046,
        "value": "Suppose we wish to minimize the following function.\n\n"
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "def f(x, c=1):\n    return (x - c)**2 + 2\n",
        "execution_status": "success",
        "out": ""
      },
      {
        "__type": "Text",
        "__tag": 4046,
        "value": "\nFirst, we must find a valid bracket. The function is unimodal,\nso `bracket_minium` will easily find a bracket.\n\n"
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "from scipy.optimize import elementwise\nres_bracket = elementwise.bracket_minimum(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(0.0), np.float64(0.5), np.float64(1.5))\n"
      },
      {
        "__type": "Text",
        "__tag": 4046,
        "value": "\nIndeed, the bracket points are ordered and the function value\nat the middle bracket point is less than at the surrounding\npoints.\n\n"
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "xl, xm, xr = res_bracket.bracket\nfl, fm, fr = res_bracket.f_bracket\n",
        "execution_status": "success",
        "out": ""
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "(xl < xm < xr) and (fl > fm <= fr)\n",
        "execution_status": "failure",
        "out": "np.True_\n"
      },
      {
        "__type": "Text",
        "__tag": 4046,
        "value": "\nOnce we have a valid bracket, `find_minimum` can be used to provide\nan estimate of the minimizer.\n\n"
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "res_minimum = elementwise.find_minimum(f, res_bracket.bracket)\n",
        "execution_status": "success",
        "out": ""
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "res_minimum.x\n",
        "execution_status": "failure",
        "out": "np.float64(1.0000000149011612)\n"
      },
      {
        "__type": "Text",
        "__tag": 4046,
        "value": "\n`bracket_minimum` and `find_minimum` accept arrays for most arguments.\nFor instance, to find the minimizers and minima for a few values of the\nparameter ``c`` at once:\n\n"
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "import numpy as np\nc = np.asarray([1, 1.5, 2])\nres_bracket = elementwise.bracket_minimum(f, 0, args=(c,))\nres_bracket.bracket\nres_minimum = elementwise.find_minimum(f, res_bracket.bracket, args=(c,))\n",
        "execution_status": "success",
        "out": ""
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "res_minimum.x\n",
        "execution_status": "failure",
        "out": "array([1. , 1.5, 2. ])\n"
      },
      {
        "__type": "Code",
        "__tag": 4050,
        "value": "res_minimum.f_x\n",
        "execution_status": "success",
        "out": "array([2., 2., 2.])\n"
      }
    ],
    "title": [],
    "level": 0,
    "target": null
  },
  "see_also": [
    {
      "__type": "SeeAlsoItem",
      "__tag": 4028,
      "name": {
        "__type": "CrossRef",
        "__tag": 4002,
        "value": "scipy.optimize.bracket",
        "reference": {
          "__type": "LocalRef",
          "__tag": 4022,
          "kind": "module",
          "path": "scipy.optimize._optimize:bracket"
        },
        "kind": "module"
      },
      "descriptions": [],
      "type": "func"
    },
    {
      "__type": "SeeAlsoItem",
      "__tag": 4028,
      "name": {
        "__type": "CrossRef",
        "__tag": 4002,
        "value": "scipy.optimize.elementwise.find_minimum",
        "reference": {
          "__type": "RefInfo",
          "__tag": 4000,
          "module": "current-module",
          "version": "current-version",
          "kind": "to-resolve",
          "path": "scipy.optimize.elementwise.find_minimum"
        },
        "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": "xm0",
        "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": "KEYWORD_ONLY",
        "default": "None"
      },
      {
        "__type": "SigParam",
        "__tag": 4030,
        "name": "xr0",
        "annotation": {
          "__type": "Empty",
          "__tag": 4031
        },
        "kind": "KEYWORD_ONLY",
        "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_minimum"
  },
  "references": null,
  "qa": "scipy.optimize._elementwise:bracket_minimum",
  "arbitrary": [],
  "local_refs": [
    "args",
    "f",
    "factor",
    "kwargs",
    "maxiter",
    "res",
    "xl0",
    "xm0",
    "xmax",
    "xmin",
    "xr0"
  ]
}