Nerdamer 2.0.1 improvements
This page highlights the additions and changes introduced after 2.0.0. It supplements the existing Nerdamer Notation reference, JavaScript / TypeScript API, and 1.xx migration guide; it does not replace those references.
Connect external numerical functions
The root API now exposes nerdamer.connect(names, source); direct API users can import connectFunctions from nerdamer/core. The source is an already-loaded JavaScript object containing functions; Nerdamer does not automatically load the external package.
import nerdamer from 'nerdamer';
const helpers = { cube: x => x * x * x };
nerdamer.connect(['cube'], helpers);
nerdamer('cube(x)').text(); // cube(x)
nerdamer('cube(2)').evaluate().text(); // 8
Functions retain their symbolic form during normal parsing. Their connected implementations are used for numerical evaluation and compilation through buildFunction(). Use ['*'] to connect all own enumerable functions on the supplied object; non-function properties are skipped. Use wildcard connections selectively because utility functions from a broad library may not be meaningful as mathematical operations.
Use nerdamer.clearFunctions(['cube']) to remove a named user-defined function, or nerdamer.clearFunctions() to clear user functions without deleting built-in functions. See the user-defined functions guide.
Restored statistics and a dedicated module
Statistical operations are once again available through Nerdamer Notation and the full package. TypeScript and JavaScript users can import them from nerdamer/statistics, including the descriptive sampleVariance and sampleStandardDeviation exports.
mean([2,4,6]) // 4
median(1,7,3) // 3
mode(2,3,2,4) // 2
variance(1,2,3) // 2/3
smpvar(1,2,3) // 1
smpstdev(1,2,3) // 1
zscore(7,5,2) // 1
Available names include mean, median, mode, variance, smpvar, stdev, smpstdev, and zscore. The smp* names use sample denominators; the corresponding population functions use the full dataset size.
Special functions and complex-number operations
The dedicated nerdamer/special module exports gamma and incomplete-gamma operations, erf, erfc, sinc, and the supported sine, cosine, exponential, and logarithmic integral functions. The 2.0.1 implementation extends complex-argument evaluation for gamma, erf, Si, Ci, and Ei, improves complex identities and inverse functions, and fixes several principal-branch, derivative, undefined-value, and complex-logarithm cases.
The phase and magnitude names are aliases for arg and abs. Rounding of supported complex values is also improved. Significant-figure rounding is provided by significant(value, figures), separately from decimal-place rounding with round.
phase(1+i) // (1/4)*pi
magnitude(3+4*i) // 5
significant(1234.567,3) // 1230
gamma(1/2) // sqrt(pi)
Periodic solutions, intervals, and solver results
Equation solving now handles more complete periodic trigonometric families and exact intersections of compatible periodic families in systems. Improvements also include expression-inferred search bounds for certain trigonometric equations, better starting points for certain multivariate systems, and numerical root-finding improvements.
The realsolutions function returns real solutions in an inclusive interval. For system solutions, it requires a variable and returns that variable's values rather than the complete assignment dictionaries.
realsolutions(solve(sin(x),x),-2*pi,2*pi)
// {-2*pi, -pi, 0, pi, 2*pi}
realsolutions(solveeqs([x+y=3,x-y=1]),x,1,3)
// {2}
JavaScript and TypeScript callers can explicitly enumerate supported integer-indexed families with SolutionSet.generate(), specifying either index bounds or a real-value interval:
const solutions = nerdamer.solve('sin(x)', 'x');
solutions.generate({ indices: [-2, 2] }).text();
// {-2*pi, -pi, 0, pi, 2*pi}
solutions.generate({ interval: ['-2*pi', '2*pi'] }).text();
// {-2*pi, -pi, 0, pi, 2*pi}
The indices option limits the integer parameter, not the numerical values. The interval option limits real solutions by value. Unsupported or unbounded generation and requests exceeding safety limits are rejected; the operation is not a general-purpose enumeration of arbitrary infinite sets. See the SolutionSet API.
Algebra, calculus, and numerical extensions
Algebra now supports more polynomial operations with symbolic coefficients, exact polynomial GCDs with complex coefficients, exact comparisons involving radicals and powers, more symbolic assumptions and variable relationships, and exact algebraic assumption bounds. Additional vector support includes seven-dimensional cross products.
Finite and infinite sums and products have broader formula support, including geometric and telescoping cases. Integration improvements cover more rational forms, negative exponentials, Gaussian exponentials expressed using erf, and complex-valued definite integration. More Laplace-transform rules and precise handling of unresolved integrals have been added.
Nerdamer Notation also supports the != comparison operator. The parser accepts supported exact repeating-decimal forms; logarithmic and radical simplification, nested powers, equation arithmetic, TeX conversion of deeply nested expressions, and several complex-number calculations have been corrected.
1!=2 // 1
sum(2^k,k,0,3) // 15
product(k,k,1,4) // 24
Function groups, warnings, and compatibility
The immutable function-name categories TRIG, INVERSE_TRIG, HYPERBOLIC_TRIG, INVERSE_HYPERBOLIC_TRIG, STATISTICS, NUMBER_THEORY, and SPECIAL_FUNCTIONS are exposed from nerdamer/constants and through nerdamer.constants. They classify built-in names; they are not dynamic listings of user registrations.
Warnings now cover selected incomplete solver results and numerical calculation limits. The root API includes getWarnings(), clearWarnings(), setWarningHandler(), and setConsoleWarnings() for warning handling. Legacy setVar(name, 'delete') and setConstant(name, 'delete') removal forms issue deprecation warnings; prefer dedicated removal operations.
Reliability and performance
This release also fixes missing polynomial roots, logarithmic equations, absolute-value systems, incomplete trigonometric solutions, incorrect oscillatory limits, invalid equation arguments, incorrect vector operations, special-function derivatives, infinite-series results, and numerical root-finding edge cases. Further fixes address deep recursion, localized messages, rational integration, and the handling of variables absent from an equation.
Performance work reduces costs in numerical solving, integration, symbolic simplification, parsing, and expression processing. The regression suite and package-import and TypeScript validation were expanded alongside these changes.
