Linux.com: How did you figure out the underlying implementations were not accurate, performant, and/or correct? How does this affect users when they work with this library?
For many common application tasks, minor deviations in precision are unlikely to have a significant effect. However, for numeric computing and applications requiring high precision, poor precision does have a significant effect due to accumulated error. Especially since the built-in Math functions are frequently used by higher-order functions, small deviations compounded many times can lead to significant drift from the “true” value.
Additionally, the ECMAScript specification for many Math functions does not require either a specific algorithm or a minimum precision. Algorithms are at the discretion of those implementing the specification, which means that browser vendors frequently implement different algorithms. Some vendors choose speed over precision, while others choose precision over speed. Because of cross-browser variability, applications cannot guarantee consistent numerical results, thus affecting portability.
Linux.com: What are some efforts taking place to fix this issue and/or what improvements are being made?
Athan Reines: Over the past several years, various individuals on the ECMAScript technical committee (TC39) have raised the issue that the built-in Math library is underspecified. However, an updated specification does not seem likely anytime soon. While vendors seem open to a minimum precision requirement, they want to retain the ability to choose the underlying implementation.
Over the past two years, both the Firefox and Chrome teams have made efforts to standardize their Math implementations. Both teams chose FDLIBM for reference implementations. While these efforts are a step in the right direction, unless all vendors implement the same algorithm, individuals developing portable numeric compute applications must develop for the lowest common denominator; i.e., the vendor with the least precise and/or slowest algorithm.
Linux.com: Is there anyway for people to get more involved in these efforts or to stay in the loop on what’s being done here?
Athan Reines: The easiest way to stay in the loop is to follow development of stdlib, as we continue to develop facilities for numeric computation. To contribute, feel free to reach out to either me or Philipp Burckhardt, and we will be happy to get you started. To keep up-to-date with TC39, follow TC39 meeting agendas and Rick Waldron’s corresponding notes.