atanh

Compute the arc hyperbolic tangent of x.

Base.atanhFunction
atanh(x)

Compute the inverse hyperbolic tangent of x.

source
atanh(A::AbstractMatrix)

Compute the inverse hyperbolic matrix tangent of a square matrix A. For the theory and logarithmic formulas used to compute this function, see [AH16_6].

Methods

julia> methods(atanh, (Any,), [Base, Base.Math, Base.MathConstants, Base.MPFR])# 7 methods for generic function "atanh" from Base:
 [1] atanh(a::ComplexF16)
     @ math.jl:1527
 [2] atanh(::Missing)
     @ math.jl:1548
 [3] atanh(x::BigFloat)
     @ mpfr.jl:946
 [4] atanh(a::Float16)
     @ math.jl:1526
 [5] atanh(z::Complex{T}) where T
     @ complex.jl:1037
 [6] atanh(x::T) where T<:Union{Float32, Float64}
     @ special/hyperbolic.jl:241
 [7] atanh(x::Real)
     @ math.jl:1543

Examples

julia> using UnicodePlots
julia> lineplot(-1, 1, atanh) ┌────────────────────────────────────────┐ 3 ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ atanh(x) ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣀⡤⠋⠀⠀ ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣀⡤⠖⠋⠁⠀⠀⠀⠀ ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡇⠀⠀⠀⣀⣀⠤⠔⠒⠋⠉⠀⠀⠀⠀⠀⠀⠀⠀⠀ f(x) ⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⣤⣤⡤⠤⡷⠶⠭⠭⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤ ⠀⠀⠀⠀⠀⠀⠀⠀⠀⣀⣀⠤⠔⠒⠋⠉⠁⠀⠀⠀⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ ⠀⠀⠀⠀⠀⣀⠤⠒⠉⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ ⠀⠀⣀⠞⠉⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ ⢸⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ -3 ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ └────────────────────────────────────────┘-1⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀1⠀ ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀x⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀

Real Numbers

julia> atanh(0)
0.0

julia> atanh(-0.0)
-0.0

julia> atanh(0.76)
0.9962150823451031

julia> atanh(2)
ERROR: DomainError with 2.0:
atanh(x) is only defined for |x| ≤ 1.
Stacktrace:
[...]

Complex

julia> atanh(0+0im)
0.0 + 0.0im

Tips

See Also

Extended Inputs

Matrix

With Array like input:

julia> methods(atanh, (Any,), [LinearAlgebra])# 5 methods for generic function "atanh" from Base:
 [1] atanh(D::Diagonal)
     @ /opt/hostedtoolcache/julia/1.12.2/x64/share/julia/stdlib/v1.12/LinearAlgebra/src/diagonal.jl:879
 [2] atanh(J::UniformScaling)
     @ /opt/hostedtoolcache/julia/1.12.2/x64/share/julia/stdlib/v1.12/LinearAlgebra/src/uniformscaling.jl:176
 [3] atanh(A::Hermitian{var"#s4811", S} where {var"#s4811"<:Complex, S<:(AbstractMatrix{<:var"#s4811"})})
     @ /opt/hostedtoolcache/julia/1.12.2/x64/share/julia/stdlib/v1.12/LinearAlgebra/src/symmetric.jl:898
 [4] atanh(A::Union{Hermitian{T, S} where S, SymTridiagonal{T, V} where V<:AbstractVector{T}, Symmetric{T, S} where S} where T<:Real)
     @ /opt/hostedtoolcache/julia/1.12.2/x64/share/julia/stdlib/v1.12/LinearAlgebra/src/symmetric.jl:894
 [5] atanh(A::AbstractMatrix)
     @ /opt/hostedtoolcache/julia/1.12.2/x64/share/julia/stdlib/v1.12/LinearAlgebra/src/dense.jl:1474

Tech Notes

  • atanh(::Real): by pure julia
  • atanh(::BigFloat): by MPFR

Version History

Introduced in Julia v1.0 (2018)