Skip to content

Latest commit

 

History

History
22 lines (15 loc) · 590 Bytes

README.md

File metadata and controls

22 lines (15 loc) · 590 Bytes

Cubic Equation Solver

Useful Information about the script :

  • Used as a subsitute of np.roots() function which utilizes Eigen Value Matrix Method for finding roots of the polynomial.

  • ~6x faster than np.roots but exclusive to cubic polynomials.

  • Manages the issue of inherent in the power basis representation of the polynomial in floating point numbers.

  • Time Complexity of snippet is O(1).

Algorithm Link

Sample Code

import CubicEquationSolver
CubicEquationSolver.solve(1, 0, 1, 0)
Output: [ 0.+0.j  0.+1.j -0.-1.j]