diff --git a/src/inverse.jl b/src/inverse.jl index 3f5ccbf..99b4cdf 100644 --- a/src/inverse.jl +++ b/src/inverse.jl @@ -143,6 +143,18 @@ inverse(::typeof(log10)) = exp10 inverse(::typeof(expm1)) = log1p inverse(::typeof(log1p)) = expm1 + +inverse(::typeof(sinh)) = asinh +inverse(::typeof(tanh)) = atanh +inverse(::typeof(coth)) = acoth +inverse(::typeof(csch)) = acsch + +inverse(::typeof(asinh)) = sinh +inverse(::typeof(atanh)) = tanh +inverse(::typeof(acoth)) = coth +inverse(::typeof(acsch)) = csch + + inverse(::typeof(sqrt)) = square inverse(::typeof(square)) = sqrt diff --git a/test/test_inverse.jl b/test/test_inverse.jl index 5798127..9983628 100644 --- a/test/test_inverse.jl +++ b/test/test_inverse.jl @@ -54,6 +54,7 @@ end end for f in ( +, -, exp, exp2, exp10, expm1, cbrt, deg2rad, rad2deg, conj, + sinh, tanh, coth, csch, asinh, atanh, acoth ∘ Base.Fix1(+, 2), acsch, # all invertible hyperbolic functions; acoth is only defined for |x| > 1 Base.Fix1(+, rand()), Base.Fix2(+, rand()), Base.Fix1(-, rand()), Base.Fix2(-, rand()), Base.Fix1(*, rand()), Base.Fix2(*, rand()), Base.Fix1(/, rand()), Base.Fix2(/, rand()), Base.Fix1(\, rand()), Base.Fix2(\, rand()), Base.Fix2(^, rand(-11:2:11)), @@ -61,6 +62,7 @@ end InverseFunctions.test_inverse(f, x) InverseFunctions.test_inverse(f, -x) end + InverseFunctions.test_inverse(conj, 2 - 3im) InverseFunctions.test_inverse(reverse, [10, 20, 30])