package gsl

  1. Overview
  2. Docs

Module Gsl.PolySource

Polynomials

Sourcetype poly = float array

Polynomial Evaluation

Sourceval eval : poly -> float -> float

eval p x returns p.(0) +. p.(1) *. x +. p.(2) *. x**2 +. ... +. p.(n) *. x**n where n = Array.length p.

Quadratic Equations

Sourcetype quad_sol =
  1. | Quad_0
  2. | Quad_2 of float * float
Sourceval solve_quadratic : a:float -> b:float -> c:float -> quad_sol
Sourceval complex_solve_quadratic : a:float -> b:float -> c:float -> Gsl_complex.complex * Gsl_complex.complex

Cubic Equations

Sourcetype cubic_sol =
  1. | Cubic_0
  2. | Cubic_1 of float
  3. | Cubic_3 of float * float * float
Sourceval solve_cubic : a:float -> b:float -> c:float -> cubic_sol
Sourceval complex_solve_cubic : a:float -> b:float -> c:float -> Gsl_complex.complex * Gsl_complex.complex * Gsl_complex.complex

General Polynomial Equations

OCaml

Innovation. Community. Security.