Coder Social home page Coder Social logo

p3n9u1n / superacid Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 1.64 MB

An experimental polynomial solver that finds nearing values of roots in O(n^2)

License: MIT License

JavaScript 97.49% TypeScript 2.19% HTML 0.11% CSS 0.20%
root-finding polynomial polynomials polynom roots root roots-counting newton newton-raphson newton-raphson-algorithm

superacid's Introduction

Superacid

An algorithm that finds nearing values for roots of polynomials. It uses root isolation based on stationary points. The function is seperated into intervals from -infinity, to the first stationary point, in between neigbouring stationary points, and from the last stationary point to +infinity. Within each interval, the sign of the derivate is constant because it is never zero. There may exist at most 1 root in each interval, because If the function crosses the x-axis within an interval, the sign of the derivate would have to change, in order for the function to cross the x-axis again. If f(interval start) and f(interval end) have different signs, there is exactly one root, otherwise there is none. The stationary points of a given polynomial that define the intervals and enable solving the polynomial are located at the roots of the derivate. The roots of all derivatives are needed first, so the algorithm starts solving the derivative of degree 1 and works its way up to the target polynomial, finding roots by applying the Newton method or bisecting to the intervals.

What can it do?

  • Find most or all roots within reasonable input values (experimental)
  • Solve Wilkinson's Polynomial

Problems

Like other methods for calculating nearing values of roots, there can be accuracy issues, like:

  • Not finding a root
  • Distinguishing very close roots
  • Falsely finding roots where a turning point is very close to the x-axis

GUI

There is a GUI for testing: https://p3n9u1n.github.io/superacid/gui/index.html

The usage should be straightforward. There is a JSXGraph based plotter included, with following controls:

  • SHIFT+Drag mouse: move
  • SHIFT+Mouse Wheel: Control zoom

superacid's People

Contributors

p3n9u1n avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.