GiNaC-WASM
WebAssembly bindings for the GiNaC computer algebra system
Demo frontend: https://daninet.github.io/ginac-wasm
Usage
const { initGiNaC, getFactory } = require('ginac-wasm');
(async () => {
const GiNaC = await initGiNaC('ginac-wasm/dist/ginac.wasm');
const g = getFactory();
console.log(
GiNaC([
g.mul(g.numeric('2'), g.numeric('3')),
g.add(g.symbol('x'), g.mul(g.numeric('2'), g.symbol('x'))),
g.diff(g.mul(g.numeric('2'), g.sin(g.symbol('x'))), g.symbol('x')),
g.parse('x^3 + 3*x + 1')
]),
);
console.log(
GiNaC([
g.numeric('2'),
g.numeric('3'),
g.mul(g.ref(0), g.ref(1))
]),
);
console.dir(
GiNaC([
g.mul(g.numeric('2'), g.sin(g.symbol('x'))),
], { json: true }),
{ depth: null }
);
})();
For more details, see the source code of the demo frontend app.