diff --git a/base/deprecated.jl b/base/deprecated.jl index d4f817492a544..d22a2f418c6b3 100644 --- a/base/deprecated.jl +++ b/base/deprecated.jl @@ -1365,6 +1365,11 @@ end link_pipe!(pipe, reader_supports_async = julia_only_read, writer_supports_async = julia_only_write), false) +# Remember to delete the module when removing this +@eval Base.Math module JuliaLibm + Base.@deprecate log Base.log +end + # END 0.7 deprecations # BEGIN 1.0 deprecations diff --git a/base/math.jl b/base/math.jl index 1aece123751ff..6b4c7ec77500a 100644 --- a/base/math.jl +++ b/base/math.jl @@ -376,9 +376,6 @@ atanh(x::Number) Compute the natural logarithm of `x`. Throws [`DomainError`](@ref) for negative [`Real`](@ref) arguments. Use complex negative arguments to obtain complex results. - -There is an experimental variant in the `Base.Math.JuliaLibm` module, which is typically -faster and more accurate. """ log(x::Number) @@ -422,9 +419,6 @@ log10(x) Accurate natural logarithm of `1+x`. Throws [`DomainError`](@ref) for [`Real`](@ref) arguments less than -1. -There is an experimental variant in the `Base.Math.JuliaLibm` module, which is typically -faster and more accurate. - # Examples ```jldoctest julia> log1p(-0.5) @@ -435,7 +429,7 @@ julia> log1p(0) ``` """ log1p(x) -for f in (:acosh, :atanh, :log, :log2, :log10, :lgamma, :log1p) +for f in (:acosh, :atanh, :log2, :log10, :lgamma) @eval begin @inline ($f)(x::Float64) = nan_dom_err(ccall(($(string(f)), libm), Float64, (Float64,), x), x) @inline ($f)(x::Float32) = nan_dom_err(ccall(($(string(f, "f")), libm), Float32, (Float32,), x), x) @@ -988,9 +982,6 @@ include(joinpath("special", "exp10.jl")) include(joinpath("special", "trig.jl")) include(joinpath("special", "gamma.jl")) include(joinpath("special", "rem_pio2.jl")) - -module JuliaLibm include(joinpath("special", "log.jl")) -end end # module diff --git a/test/math.jl b/test/math.jl index a6f070166f34f..43cf3afbd42a7 100644 --- a/test/math.jl +++ b/test/math.jl @@ -564,7 +564,7 @@ end end @testset "log/log1p" begin - # if using Tang's algorithm, should be accurate to within 0.56 ulps + # using Tang's algorithm, should be accurate to within 0.56 ulps X = rand(100) for x in X for n = -5:5 @@ -573,16 +573,16 @@ end for T in (Float32,Float64) xt = T(x) - y = Base.Math.JuliaLibm.log(xt) + y = log(xt) yb = log(big(xt)) @test abs(y-yb) <= 0.56*eps(T(yb)) - y = Base.Math.JuliaLibm.log1p(xt) + y = log1p(xt) yb = log1p(big(xt)) @test abs(y-yb) <= 0.56*eps(T(yb)) if n <= 0 - y = Base.Math.JuliaLibm.log1p(-xt) + y = log1p(-xt) yb = log1p(big(-xt)) @test abs(y-yb) <= 0.56*eps(T(yb)) end