{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://www.calculatorx.com/schemas/math.numerical.optimize_1d/1.0.5/input.json",
  "title": "One-dimensional optimization — input",
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "method": {
      "type": "string",
      "description": "golden/golden_section/gss/golden_section_search; brent/brents/fminbound/bounded; case insensitive; hyphen/space normalize."
    },
    "mode": {
      "type": "string",
      "description": "Alias of method; supplied aliases must agree."
    },
    "integrand": {
      "type": "string",
      "description": "poly/polynomial, sin, exp/e^x; case insensitive."
    },
    "f": {
      "type": "string",
      "description": "Alias of integrand; supplied aliases must agree."
    },
    "a": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "string",
          "pattern": "^\\s*[+\\-−–—]?(?:\\d+(?:\\.\\d*)?|\\.\\d+)(?:[eE][+\\-]?\\d+)?\\s*$"
        }
      ],
      "description": "Finite decimal; conversion underflow is rejected before computation."
    },
    "lo": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "string",
          "pattern": "^\\s*[+\\-−–—]?(?:\\d+(?:\\.\\d*)?|\\.\\d+)(?:[eE][+\\-]?\\d+)?\\s*$"
        }
      ],
      "description": "Finite decimal; conversion underflow is rejected before computation."
    },
    "xmin": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "string",
          "pattern": "^\\s*[+\\-−–—]?(?:\\d+(?:\\.\\d*)?|\\.\\d+)(?:[eE][+\\-]?\\d+)?\\s*$"
        }
      ],
      "description": "Finite decimal; conversion underflow is rejected before computation."
    },
    "b": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "string",
          "pattern": "^\\s*[+\\-−–—]?(?:\\d+(?:\\.\\d*)?|\\.\\d+)(?:[eE][+\\-]?\\d+)?\\s*$"
        }
      ],
      "description": "Finite decimal; conversion underflow is rejected before computation."
    },
    "hi": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "string",
          "pattern": "^\\s*[+\\-−–—]?(?:\\d+(?:\\.\\d*)?|\\.\\d+)(?:[eE][+\\-]?\\d+)?\\s*$"
        }
      ],
      "description": "Finite decimal; conversion underflow is rejected before computation."
    },
    "xmax": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "string",
          "pattern": "^\\s*[+\\-−–—]?(?:\\d+(?:\\.\\d*)?|\\.\\d+)(?:[eE][+\\-]?\\d+)?\\s*$"
        }
      ],
      "description": "Finite decimal; conversion underflow is rejected before computation."
    },
    "coeffs": {
      "anyOf": [
        {
          "type": "string",
          "minLength": 1
        },
        {
          "type": "array",
          "items": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "string",
                "pattern": "^\\s*[+\\-−–—]?(?:\\d+(?:\\.\\d*)?|\\.\\d+)(?:[eE][+\\-]?\\d+)?\\s*$"
              }
            ],
            "description": "Finite decimal; conversion underflow is rejected before computation."
          },
          "minItems": 2,
          "maxItems": 9
        }
      ],
      "description": "Constant-first2–9 decimal coefficients; constants use c0,0. Default0,0,1 only when absent. Every explicitly supplied list must be valid, including for non-polynomial functions."
    },
    "tol": {
      "anyOf": [
        {
          "type": "number",
          "exclusiveMinimum": 0,
          "maximum": 1
        },
        {
          "type": "string",
          "pattern": "^\\s*[+\\-−–—]?(?:\\d+(?:\\.\\d*)?|\\.\\d+)(?:[eE][+\\-]?\\d+)?\\s*$"
        }
      ],
      "description": "Positive absolute bracket tolerance at most1; default1e-8 only absent. Not a global error bound."
    },
    "max_iter": {
      "anyOf": [
        {
          "type": "integer",
          "minimum": 1,
          "maximum": 100
        },
        {
          "type": "string",
          "pattern": "^\\s*[+\\-−–—]?(?:\\d+(?:\\.\\d*)?|\\.\\d+)(?:[eE][+\\-]?\\d+)?\\s*$"
        }
      ],
      "description": "Integer1–100, default100 only absent. Text numeric range/integrality checked at runtime."
    },
    "coefficients": {
      "anyOf": [
        {
          "type": "string",
          "minLength": 1
        },
        {
          "type": "array",
          "items": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "string",
                "pattern": "^\\s*[+\\-−–—]?(?:\\d+(?:\\.\\d*)?|\\.\\d+)(?:[eE][+\\-]?\\d+)?\\s*$"
              }
            ],
            "description": "Finite decimal; conversion underflow is rejected before computation."
          },
          "minItems": 2,
          "maxItems": 9
        }
      ],
      "description": "Alias of coeffs; supplied arrays/lists must agree after decimal normalization."
    }
  },
  "allOf": [
    {
      "anyOf": [
        {
          "required": [
            "a"
          ]
        },
        {
          "required": [
            "lo"
          ]
        },
        {
          "required": [
            "xmin"
          ]
        }
      ]
    },
    {
      "anyOf": [
        {
          "required": [
            "b"
          ]
        },
        {
          "required": [
            "hi"
          ]
        },
        {
          "required": [
            "xmax"
          ]
        }
      ]
    }
  ],
  "description": "Minimize a polynomial, sin, or exp on [a, b] by golden-section search or Brent. Not multivariate, not maximization, not CAS. (calculation_version 1.0.5)"
}
