Source File
tanh.go
Belonging Package
math
package math
func ( float64) float64
func ( float64) float64 {
const = 8.8029691931113054295988e+01 // log(2**127)
:= Abs()
switch {
case > 0.5*:
if < 0 {
return -1
}
return 1
case >= 0.625:
:= Exp(2 * )
= 1 - 2/(+1)
if < 0 {
= -
}
default:
if == 0 {
return
}
:= *
= + **((tanhP[0]*+tanhP[1])*+tanhP[2])/(((+tanhQ[0])*+tanhQ[1])*+tanhQ[2])
}
return
![]() |
The pages are generated with Golds v0.3.2-preview. (GOOS=darwin GOARCH=amd64) Golds is a Go 101 project developed by Tapir Liu. PR and bug reports are welcome and can be submitted to the issue list. Please follow @Go100and1 (reachable from the left QR code) to get the latest news of Golds. |