Math.js improvement