I'm performing matrix calculations (e.g. computing determinants, eigenvalues, inverse matrices) in JavaScript using Math.js. I would like the computations to be performed more rapidly (it's computing them on 2X2 matrices, but it should be performing many every second, and it now causes noticeable delay), but precision isn't of that great importance (I think a couple decimal places of precision would be more than enough). Is there a way of specifying how precise the computation should be? Thanks!
Here is an example computation:
var A = [[3.5, 9], [9, 1]]
for (let x=0;x<10**5;x++){
math.eigs(A)
math.inv(A)
math.det(A)
}
<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjs/8.1.0/math.js" integrity="sha512-ne87j5uORxbrU7+bsqeJJWfWj5in65R9PCjaQL161xtH5cesZgULVbeVAkzAAN7hnYOcrHeBas9Wbd/Lm8gXFA==" crossorigin="anonymous"></script>
In reality, I'm having these computations done every time a slider position is changed (and of course with a different matrix each time).