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

emltree

v0.1.3

Published

Compile elementary functions into pure EML form — exp/ln Sheffer-operator trees, eml(x, y) = exp(x) - ln(y) (arXiv:2603.21852). Zero dependencies.

Readme

emltree

Compile elementary functions into pure EML form — binary trees built from the single Sheffer-like operator

eml(x, y) = exp(x) - ln(y)

plus the constant 1. Odrzywołek (arXiv:2603.21852) showed this one operator generates every function on a scientific calculator — the NAND gate of continuous mathematics.

Zero dependencies. JS port of the Python emltree package (same identities, same tree shapes).

Install

npm install emltree

Usage

import { compile, evaluate, toNested, toRpn, asciiTree } from 'emltree';

const tree = compile('sin(x)^2 + cos(x)^2');
evaluate(tree, { x: 1.37 });   // { re: 1.0000000…, im: ~0 }

toNested(compile('exp(x)'));   // 'eml(x, 1)'
toRpn(compile('log(x)'));      // '1 1 x E 1 E E'   (paper eq. 5)

Builders are exported too, if you'd rather skip the parser:

import { variable, sin, pow, add, integer, evaluate } from 'emltree';

const x = variable('x');
const tree = add(pow(sin(x), integer(2)), integer(1));

Evaluation is complex throughout ({ re, im }) — trig and the constants pi / I flow through complex intermediates even for real inputs, exactly as in the paper.

CLI

npx emltree "sin(x)" -f rpn
npx emltree "exp(x) - log(y)" --stats --eval x=0.3,y=2.5
npx emltree "pi" -f tree

Supported syntax: + - * / ^ **, sqrt exp log ln sin cos tan asin acos atan sinh cosh tanh asinh acosh atanh sigmoid, two-arg log(x, base), constants pi E I.

Caveats

  • Branch cuts: outside their real domains (asin(2), acosh(-2), log of negatives, …) results flow through complex branch cuts and may land on a non-principal branch — or, where float fuzz compounds, off-sheet entirely (paper §4.1). On the usual real domains everything matches to ~1e-7.
  • Addition overflow: add's expansion applies exp() to its second operand, so adding values past ~709 overflows float64. Integer/decimal constants avoid this internally (binary decomposition, multiplicative odd step), but x + y with huge y is an inherent ceiling of the encoding.

Canonical identities

exp(x) = eml(x, 1)
ln(x)  = eml(1, eml(eml(1, x), 1))      # paper eq. (5)
x - y  = eml(ln(x), exp(y))

Everything else is built compositionally on top of these three. The resulting trees are not optimised for size — the paper's direct search finds much shorter forms; this package prioritises correctness and coverage.

License

MIT