Skip to content

feat: Newton-Raphson + bisection root finding #33

Description

@bwyard

Context

No root-finding methods exist. These are fundamental numerical tools needed for optimization, inverse functions, and equation solving.

Proposed API

pub fn newton_raphson(f: fn(f32) -> f32, x0: f32, tol: f32, max_iter: u32) -> (f32, u32)
pub fn bisection(f: fn(f32) -> f32, a: f32, b: f32, tol: f32, max_iter: u32) -> (f32, u32)

Newton-Raphson uses central-difference numerical derivative. Bisection is slower but guaranteed convergence for continuous f with sign change.

Thesis alignment

  • Pure: inputs → (root, iterations)
  • ADVANCE-EXCEPTION: convergence loops bounded by max_iter
  • Uses derivative from this crate for Newton's Jacobian

Tests needed

  • sqrt(2) via x²-2=0
  • Cubic roots
  • Newton convergence count < bisection
  • Bisection guaranteed convergence

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions