JuliaStats / LogExpFunctions.jl

Julia package for various special functions based on `log` and `exp`.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

`logabssinh`

longemen3000 opened this issue · comments

LogExpFunctions already has logcosh. normally, when those terms appear, there is also log(abs(sinh)) terms. In my specific field, that term appear in natural-gas properties:
image

logsinh can be expressed in terms of LogExpFunctions.log1mexp:

function logabssinh(x::Real)
    abs_x = abs(x)
    return abs_x + log1mexp(- 2 * abs_x) - IrrationalConstants.logtwo
end

Is it ok to have this function here?