josdejong/mathjs ? reverse-engineered prompt
Reverse engineered prompt
Build me a JavaScript math library for both Node and the browser that feels like a smarter version of Math. I want to be able to do normal calculations, but also work with big numbers, bigints, complex numbers, fractions, units, strings, arrays, and matrices, all in one place. It should have a flexible expression parser so I can type things like 12 / (2.3 + 0.7), 12 cm to inch, sin(45 deg) ^ 2, and det([-1, 2; 3, 1]), and it should also support simple chaining like chain(3).add(4).multiply(2).
Please make it easy to import individual functions too, like rounding, powers, square roots, derivatives, and constants such as pi and e. It should work cleanly in modern JavaScript, include good examples and documentation, and be structured so it can be extended later with new functions or types. If you need to check current docs or behavior online while building it, go ahead.
Are you gonna build this?
make sure you review the code using coderabbit