josdejong/mathjs — pull request #247 by pavpanchekha (2014-12-12 20:20:05+00:00)
Title: Accuracy of sinh and complex cos/sin

The `sin` and `cos` function for complex arguments, and the `sinh` function for real arguments, are inaccurate when the inputs are very small. This is because `Math.exp(x) - Math.exp(-x)` returns zero for small x, instead of the more accurate `2x`.

This patch replaces `sinh` by a Taylor expansion when the input is small, which increases accuracy.