tanh function

double tanh(
  1. double X
)

Oddly enough dart does not have hyperbolic functions built-in (yet?).

Implementation

double tanh(double X) {
  return -1.0 + 2.0 / (1 + pow(e, (-2 * X)));
}