tanH function

Matrix tanH(
  1. Matrix matrix
)

tanh of a matrix

  • matrix The matrix to find the tanh
  • Returns The new matrix

Implementation

Matrix tanH(Matrix matrix) {
  return matrix.performFunction((x) => (exp(2 * x) - 1) / (exp(2 * x) + 1));
}