9 Commits

Author SHA1 Message Date
Paul Korzhyk
e0d56d2da7
fix: make derivative much faster (#3322) 2024-11-28 13:37:42 +01:00
David Contreras
367c0d3d1e
chore: improve performance of functions map, filter and forEach (#3256)
* Implement reduceCallback

* Add jsdocs

* implement simplifyCallback in other functions

* Moved recurse to array.js

* Format

* Separate transform callback

* forEach transform

* Renamed applyCallback to simplifyCallback

* Simplified index transform

* renamed to reducedCallback and simplifiedCallback to simpleCallback

* chore: fix linting issue

* Added forEach benchmark

* renamed simplifyCallback to optimizeCallback

---------

Co-authored-by: Jos de Jong <wjosdejong@gmail.com>
2024-09-11 11:32:17 +02:00
Jos de Jong
88a4b35e9d chore: add a benchmark testing DenseMatrix.map(...) and DenseMatrix.forEach(...) (see #3251) 2024-08-21 14:59:09 +02:00
Jos de Jong
1f05a35d68
chore: convert CJS files to ESM (#3204) 2024-05-22 08:46:14 +02:00
Jos de Jong
7d2497cc63 chore: add a benchmark to get a feel for how fast scope variables are resolved 2024-02-08 09:20:43 +01:00
Glen Whitney
f6d3e9ea8d
feat: add polynomialRoot function (#2839)
* feat: add polynomialRoot function

  This is intended as a benchmark for general arithmetic/basic algebra
  functionality of mathjs, but was chosen to be something of potential
  independent utility as well, worth adding to mathjs in its own right.

  Currently ol=nly computes the numerical roots for real or complex
  polynomials of degree three or less.

  As usual, adds documentation, embedded documentation, tests, TypeScript
  declaration, and TypeScript tests.

  Also updates doc.test.js to make it easier to specify an array of complex
  numbers as the expected output, and comapres with the appropriate fuzz
  in such cases.

  Finally, adds a benchmark that computes the roots of all cubics with
  nonnegative integer coefficients no larger than five.

* doc: fix typo in polynomialRoot embedded docs

Thanks, SamuelTLG

* style: avoid slightly cryptic Boolean flag stand-in
2022-11-18 15:53:45 +01:00
Jos de Jong
4f83b786ea Add benchmark to test loading time of a mathjs instance 2022-03-21 17:53:12 +01:00
jos
3526f651bf Add small benchmark for primes (see #1641) 2019-10-06 10:41:37 +02:00
jos
db4910bed4 Move all test related stuff in folder test 2019-06-05 11:45:02 +02:00