Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

© 2026 Open-Awesome. Curated for the developer elite.

TermsPrivacyAboutGitHubRSS
  1. Home
  2. JavaScript
  3. Polynomial.js

Polynomial.js

MITTypeScript

A JavaScript library for creating, manipulating, and performing arithmetic on polynomials over various mathematical fields.

GitHubGitHub
135 stars16 forks0 contributors

What is Polynomial.js?

Polynomial.js is a JavaScript library for creating and manipulating polynomials. It enables developers to perform arithmetic operations, calculus (derivatives and integrals), and evaluations on polynomials over various mathematical fields like real numbers, rational numbers, complex numbers, and finite fields. It solves the problem of handling polynomial mathematics in JavaScript applications without relying on external math software.

Target Audience

JavaScript developers, educators, and researchers who need to perform polynomial calculations in web applications, educational tools, or scientific computing projects.

Value Proposition

Developers choose Polynomial.js for its comprehensive feature set, support for multiple mathematical fields, and lightweight design optimized for compression and performance in both browser and Node.js environments.

Overview

The RAW JavaScript library to work with polynomials

Use Cases

Best For

  • Performing polynomial arithmetic (addition, multiplication, division) in JavaScript applications
  • Computing derivatives and integrals of polynomials programmatically
  • Working with polynomials over complex numbers or rational numbers
  • Implementing polynomial-based algorithms in educational or scientific software
  • Generating LaTeX representations of polynomials from code
  • Handling polynomials in finite fields for cryptographic or algebraic applications

Not Ideal For

  • Projects requiring symbolic algebra beyond polynomials, such as equation solving or transcendental functions
  • High-performance numerical computing with large datasets where optimized native libraries (e.g., WebAssembly) are preferred
  • Applications with strict dependency minimization, as it requires external libraries for full field support
  • Multi-tenant systems where global state management (via setField) could lead to conflicts

Pros & Cons

Pros

Broad Field Support

Supports real, rational, complex, quaternions, and finite fields, seamlessly integrating with Fraction.js and Complex.js for extended mathematical operations.

Flexible Input Parsing

Allows polynomial creation from strings, arrays, objects, or numbers, with examples showing support for complex and rational coefficients via direct parsing.

Comprehensive Operations

Includes arithmetic, calculus (derive and integrate), GCD, fromRoots, and multiple representations like LaTeX and Horner scheme, as detailed in the functions list.

Optimized for Compression

Designed with a coding style that minimizes size after compression with Google Closure Compiler, ensuring a lightweight footprint as per the philosophy.

Cons

External Dependencies

Requires Fraction.js and Complex.js for rational and complex number support, adding setup complexity and increasing bundle size, as noted in the installation section.

Parsing Limitations

The string parser does not handle white-spaces or brackets recursively, which can cause errors if input is not meticulously formatted, as warned in the README.

Global State Management

Uses a global setField() method for configuring fields, which may lead to side effects in applications with multiple polynomial contexts or concurrent operations.

Frequently Asked Questions

Quick Stats

Stars135
Forks16
Contributors0
Open Issues3
Last commit29 days ago
CreatedSince 2015

Tags

#calculus#polynomials#mathematical-computing#rational-numbers#math#complex-numbers#javascript-library#numerical-analysis#javascript#algebra

Built With

J
JavaScript

Included in

JavaScript34.9k
Auto-fetched 5 hours ago

Related Projects

Numeral-jsNumeral-js

A javascript library for formatting and manipulating numbers.

Stars9,699
Forks906
Last commit7 months ago
odometerodometer

Smoothly transitions numbers with ease. #hubspot-open-source

Stars7,288
Forks694
Last commit8 years ago
chance.jschance.js

Chance - Random generator helper for JavaScript

Stars6,533
Forks461
Last commit1 year ago
Fraction.jsFraction.js

The RAW rational numbers library written in JavaScript

Stars695
Forks77
Last commit1 year ago
Community-curated · Updated weekly · 100% open source

Found a gem we're missing?

Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.

Submit a projectStar on GitHub