Speed-up of the hyperbolic tangent function
As proposed by V. Mansanarez, we could use the function below, applied to 2*Val, instead of the function we currently have:
!**********************************************************************
FUNCTION tanHyp2(Val) ! Function that calculates the hyperbolic tangent of Val/2
!**********************************************************************
! Inputs
! Val ! Real, value
! Outputs
! tanHyp ! Real, value of the hyperbolic tangent
Implicit None
!! dummies
! in
doubleprecision, intent(in) :: Val
! out
doubleprecision :: tanHyp
!! locals
doubleprecision :: ValExp
ValExp=EXP(Val)
tanHyp=(ValExp - 1.)/(ValExp + 1.)
RETURN
ENDFUNCTION
!**********************************************************************