npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

symbolicjs

v0.6.0

Published

MathJS-native symbolic equations with bounded real and finite complex solving.

Readme

symbolicjs

Computer algebra extensions for MathJS, beginning with first-class equations.

Early development release. The package API may change before 1.0.0.

Install

npm install symbolicjs mathjs

Quick start

import {all, create} from 'mathjs';
import {importsymbolicjs} from 'symbolicjs';

const math = importsymbolicjs(create(all));
const equation = math.parseEquation('x + 1 =:= y / 2');

equation.type;           // 'EqualityNode'
equation.lhs.toString(); // 'x + 1'
equation.rhs.toString(); // 'y / 2'
equation.toString();     // 'x + 1 =:= y / 2'
equation.toTex();        // MathJS LaTeX joined by '='

const result = math.solveEquation('x*x - 5*x + 6 =:= 0', 'x');
// result.kind === 'finite'; roots are 2 and 3

const periodic = math.solveEquation('sin(x) =:= 0', 'x');
// periodic.kind === 'parametric'; one complete integer-parameter family

const bounded = math.solveEquation('sin(x) =:= x/2', 'x', {
  numericFallback: true,
  interval: {lower: -2, upper: 2}
});
// bounded.kind === 'partial'; three verified roots in this interval

const complex = math.solveEquation('x^2 + 1 =:= 0', 'x', {
  domain: 'complex'
});
// complex.kind === 'finite'; roots are -i and i

The lower-level factory array can be imported directly when an application manages its own MathJS instance typing:

import {all, create} from 'mathjs';
import {symbolicjsFactories} from 'symbolicjs';

const math = create(all);
math.import([...symbolicjsFactories]);

Equality syntax

symbolicjs uses =:= as its canonical equation operator. This keeps mathematical equality distinct from MathJS assignment (=) and boolean comparison (==).

MathJS documents extension through math.import and factory functions, but it does not expose a supported API for adding an infix grammar token. For that reason, symbolicjs imports EqualityNode and parseEquation into a MathJS instance. parseEquation recognizes one top-level =:=, delegates each side to that instance's original MathJS parser, and returns:

EqualityNode {
  lhs: MathNode;
  rhs: MathNode;
}

The package does not monkey-patch or silently replace math.parse. Ordinary MathJS parsing, including assignment parsing, remains unchanged. Assignments and function assignments are rejected inside equation sides.

API

  • importsymbolicjs(math) imports the symbolicjs factories and returns the same instance with typed EqualityNode and parseEquation members.
  • symbolicjsFactories is the factory array for direct math.import.
  • EqualityNode is a MathJS node with lhs and rhs children.
  • splitEquation(expression) validates and splits one top-level =:=.
  • isEqualityNode(value) is the runtime type guard.
  • EQUALITY_OPERATOR is the canonical =:= token.
  • equationSymbols(equation) returns sorted free member symbols.
  • solveEquation(equation, target, options?) solves for one target.
  • solveEquationForAll(equation, options?) independently attempts every member symbol and returns an immutable result map.
  • instantiateFamily, materializeSolutions, and verifyParametricFamily consume parametric results without unbounded enumeration.
  • numericSolve is the lower-level, explicitly bounded real search function.

EqualityNode supports MathJS traversal, transformation, cloning, compilation, equality evaluation, string output, LaTeX output, HTML output, and its own JSON codec.

See the API guide, conformance report, algorithm guide, performance and limits guide, testing guide, and security guidance for result types, supported families, limits, and integration details.

Implemented solver scope

  • First-class equality nodes, parsing, formatting, and serialization.
  • Symbol discovery, immutable substitution, conservative simplification, domain conditions, candidate verification, and deterministic limits.
  • Single-occurrence isolation for arithmetic, powers, roots, exponential, logarithm, and absolute value.
  • Target-relative rational normalization and symbolic affine, quadratic, cubic, and quartic solving over the real domain.
  • Complete real periodic families for isolated and selected compound trigonometric equations.
  • Verified real roots of numeric polynomials through the configurable degree limit, tested through degree 100.
  • Explicitly bounded adaptive numeric fallback for otherwise unsupported real expressions.
  • Opt-in complete finite complex roots for numeric real-coefficient polynomials; conditional exact symbolic quadratic branches.
  • Typed finite, parametric, identity, contradiction, partial, unsupported, and limit results with explicit conditions, verification, and completeness scope.
  • Independent solve-for-all orchestration and opt-in diagnostics.

The default domain is real scalar equations. Simultaneous systems, inequalities, matrices, units, mixed-frequency trigonometric identities, unrestricted numeric search, complex transcendental families, and a general equivalence prover remain unsupported. See the 0.1 migration guide for the expanded result union and domain options.

Development

Requires Node 22 or newer.

npm install
npm run check
npm run pack:dry

The package is tested independently of any consuming application. MathJS is a peer dependency and is pinned to 15.2.0 in development so the node contract is tested against a known implementation.

The stable-release requirements are tracked in the release checklist.

License

MIT