File: cosh.go

package info (click to toggle)
golang-github-chewxy-math32 1.11.1-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 460 kB
  • sloc: asm: 388; makefile: 4
file content (10 lines) | stat: -rw-r--r-- 139 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
package math32

func Cosh(x float32) float32 {
	x = Abs(x)
	if x > 21 {
		return Exp(x) * 0.5
	}
	ex := Exp(x)
	return (ex + 1/ex) * 0.5
}