let log = Math.log;
let exp = Math.exp;
let abs = Math.abs;
let sgn = Math.sign;
let cval = (s, v) => s > 0 ? v : ~v + 1
let csgn = (l, r) => cval(-1, ~(~l ^ ~r));
let mul = (x, y) => cval(
csgn(sgn(x), sgn(y)), // the combined signs of the two numbers
exp(log(abs(x)) + log(abs(y))) // the actual equation
);