Math.js vs Algebrite (v3)

Revision 3 of this benchmark created on


Preparation HTML

<script>
  // Cargar Math.js
  var mathJsScript = document.createElement('script');
  mathJsScript.src = 'https://cdnjs.cloudflare.com/ajax/libs/mathjs/9.4.4/math.min.js';
  document.head.appendChild(mathJsScript);
  
  // Cargar Algebrite
  var algebriteScript = document.createElement('script');
  algebriteScript.src = 'https://cdnjs.cloudflare.com/ajax/libs/algebrite/0.14.0/algebrite.bundle-for-browser.js';
  document.head.appendChild(algebriteScript);
</script>

Setup

const expression = '2 * x + 3'; // Expresión matemática
const xValue = 5; // Valor de x


Test runner

Ready to run.

Testing in
TestOps/sec
Math.js
function deriveExpressionMathJS() {
  return math.derivative('x^2 + 2*x + 1', 'x');
}
ready
Algebrite
function deriveExpressionAlgebrite() {
  return Algebrite.run('d(' + 'x^2 + 2*x + 1'+ ')/d' + 'x');
}
ready

Revisions

You can edit these tests or add more tests to this page by appending /edit to the URL.