A port of fdlibm to Javascript