Skip to content

Commit d8b8ac0

Browse files
committed
Change name of rsqrt function and add doc string
1 parent 182c9c1 commit d8b8ac0

File tree

3 files changed

+14
-13
lines changed

3 files changed

+14
-13
lines changed

src/IntervalArithmetic.jl

+1-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ export
6262
midpoint_radius, interval_from_midpoint_radius,
6363
RoundTiesToEven, RoundTiesToAway,
6464
cancelminus, cancelplus, isunbounded,
65-
.., @I_str, ±, rsqrt,
65+
.., @I_str, ±, reciprocal_sqrt,
6666
pow, extended_div,
6767
setformat, @format
6868

src/intervals/functions.jl

+2-1
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,8 @@ for f in (:log, :log2, :log10, :log1p)
306306
end
307307
end
308308

309-
function rsqrt(a::Interval{T}) where T
309+
#computes the reciprocal of square root of an Interval
310+
function reciprocal_sqrt(a::Interval{T}) where T
310311
x = sqrt(a)
311312
isempty(x) && return emptyinterval(x)
312313
x.lo == zero(T) < x.hi && return @round(inv(x.hi), T(Inf))

test/ITF1788_tests/libieeep1788_tests_elem.jl

+11-11
Original file line numberDiff line numberDiff line change
@@ -996,17 +996,17 @@ end
996996
end
997997

998998
@testset "minimal_rsqrt_test" begin
999-
@test rsqrt(∅) ==
1000-
@test rsqrt(Interval(-Inf, Inf)) == 0 .. Inf
1001-
@test rsqrt(Interval(-Inf, -0x0.0000000000001p-1022)) ==
1002-
@test rsqrt(Interval(-1.0, 1.0)) == 1.0 .. Inf
1003-
@test rsqrt(Interval(0.0, 1.0)) == 1.0 .. Inf
1004-
@test rsqrt(Interval(-0.0, 1.0)) == 1.0 .. Inf
1005-
@test rsqrt(Interval(-5.0, 25.0)) == 0.2 .. Inf
1006-
@test rsqrt(Interval(0.0, 25.0)) == 0.2 .. Inf
1007-
@test rsqrt(Interval(-0.0, 25.0)) == 0.2 .. Inf
1008-
@test rsqrt(Interval(-5.0, Inf)) == 0.0 .. Inf
1009-
@test rsqrt(Interval(4.0, 25.0)) == 0.2 .. 0.5
999+
@test reciprocal_sqrt(∅) ==
1000+
@test reciprocal_sqrt(Interval(-Inf, Inf)) == 0 .. Inf
1001+
@test reciprocal_sqrt(Interval(-Inf, -0x0.0000000000001p-1022)) ==
1002+
@test reciprocal_sqrt(Interval(-1.0, 1.0)) == 1.0 .. Inf
1003+
@test reciprocal_sqrt(Interval(0.0, 1.0)) == 1.0 .. Inf
1004+
@test reciprocal_sqrt(Interval(-0.0, 1.0)) == 1.0 .. Inf
1005+
@test reciprocal_sqrt(Interval(-5.0, 25.0)) == 0.2 .. Inf
1006+
@test reciprocal_sqrt(Interval(0.0, 25.0)) == 0.2 .. Inf
1007+
@test reciprocal_sqrt(Interval(-0.0, 25.0)) == 0.2 .. Inf
1008+
@test reciprocal_sqrt(Interval(-5.0, Inf)) == 0.0 .. Inf
1009+
@test reciprocal_sqrt(Interval(4.0, 25.0)) == 0.2 .. 0.5
10101010
end
10111011

10121012
@testset "minimal_fma_test" begin

0 commit comments

Comments
 (0)