This entry is documented with its primary interface. Open the documentation →
nerdamer.solve
nerdamer.solve(input: Equation | ExpressionInput, variable?: ExpressionInput, onInterval?: Vector | FunctionSolverOptions, recursion?: SolveRecursionContext): SolutionSetSolves an equation or finds the zeros of an expression in one variable.
The solver normalizes the input to expression = 0, tries direct symbolic
transformations, factors numerator and denominator, and then applies
symbolic, polynomial-numeric, and limited-range function-numeric strategies to the
factors. Zeros of denominator factors are excluded from the result.
Numerical fallback is heuristic and normally scans [-10,10], so an empty result does not in general prove that no solution exists. A narrow affine-plus-bounded-trig form may supply a certified finite enclosure, but its non-monotone scan remains heuristic. Strategy and input errors are absorbed by this convenience entry point and produce the solutions collected before the failure. Decimal input marks returned solutions for decimal formatting. The optional interval limits only the numerical function scan. Symbolic and polynomial solutions remain unrestricted. Direct API callers may also use FunctionSolverOptions; explicit bounds override inferred numerical bounds.
Parameters
| Name | Type | Description |
|---|---|---|
input | Equation | ExpressionInput | Expression or equation to solve. |
variable | ExpressionInput | Variable to solve for. When omitted, input preparation infers it where possible. |
onInterval | Vector | FunctionSolverOptions | Optional [lower,upper] Vector for numerical search, or FunctionSolverOptions when called directly from TypeScript. |
recursion | SolveRecursionContext | — |
Returns
SolutionSet — A SolutionSet. The special all expression represents an
identity that is true for every value of the variable.
Examples
const roots = solve('x^2-1', 'x');