1
1
function sinh (x:: DoubleFloat{T} ) where {T<: IEEEFloat }
2
- isinf (x) && return x
2
+ HI (x) >= 709.0 && return DoubleFloat {T} ( copysign ( Inf , HI (x)))
3
3
x < 0 && return - sinh (- x)
4
4
iszero (x) && return zero (x)
5
5
! isfinite (x) && return nan (typeof (x))
@@ -10,7 +10,7 @@ function sinh(x::DoubleFloat{T}) where {T<:IEEEFloat}
10
10
end
11
11
12
12
function cosh (x:: DoubleFloat{T} ) where {T<: IEEEFloat }
13
- isinf (x) && return abs (x )
13
+ HI ( abs (x)) >= 709.0 && return DoubleFloat {T} ( Inf )
14
14
x < 0 && return cosh (- x)
15
15
iszero (x) && return one (x)
16
16
! isfinite (x) && return nan (typeof (x))
@@ -21,7 +21,7 @@ function cosh(x::DoubleFloat{T}) where {T<:IEEEFloat}
21
21
end
22
22
23
23
function tanh (x:: DoubleFloat{T} ) where {T<: IEEEFloat }
24
- isinf (x) && return copysign (one (DoubleFloat{T}), x)
24
+ HI ( abs (x)) >= 709.0 && return copysign (one (DoubleFloat{T}), x)
25
25
return sinh (x) / cosh (x)
26
26
end
27
27
#=
37
37
=#
38
38
39
39
function csch (x:: DoubleFloat{T} ) where {T<: IEEEFloat }
40
- isinf (x) && return copysign (zero (DoubleFloat{T}), x)
40
+ HI ( abs (x)) >= 709.0 && return copysign (zero (DoubleFloat{T}), x)
41
41
return inv (sinh (x))
42
42
end
43
43
44
44
function sech (x:: DoubleFloat{T} ) where {T<: IEEEFloat }
45
- isinf (x) && return zero (DoubleFloat{T})
45
+ HI ( abs (x)) >= 709.0 && return zero (DoubleFloat{T})
46
46
return inv (cosh (x))
47
47
end
48
48
49
49
function coth (x:: DoubleFloat{T} ) where {T<: IEEEFloat }
50
- isinf (x) && return copysign (one (DoubleFloat{T}), x)
50
+ HI ( abs (x)) >= 709.0 && return copysign (one (DoubleFloat{T}), x)
51
51
return cosh (x) / sinh (x)
52
52
end
0 commit comments