Skip to content

Commit a5fe900

Browse files
authored
improve codegen
1 parent b30a4b9 commit a5fe900

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/basicfuns.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -292,8 +292,8 @@ This will fall back to the naive calculation for argument types different from `
292292
"""
293293
log1pmx(x::Real) = log1p(x) - x # Naive fallback
294294

295-
function log1pmx(x::Union{Float32, Float64})
296-
if !(-0.425 < x < 0.4) # accurate within 2 ULPs when log2(abs(log1p(x))) > 1.5
295+
function log1pmx(x::T) where T <: Union{Float32, Float64}
296+
if !(T(-0.425) < x < T(0.4)) # accurate within 2 ULPs when log2(abs(log1p(x))) > 1.5
297297
return log1p(x) - x
298298
else
299299
return _log1pmx_ker(x)

0 commit comments

Comments
 (0)