Skip to content

Commit 2ff3ffe

Browse files
Merge pull request #47 from JuliaSIMD/fix/log1p-test-grid-julia113
Fix Julia 1.13 DomainError in log1p test grid (followup to #45)
2 parents 3dc2055 + 2c2efb3 commit 2ff3ffe

1 file changed

Lines changed: 13 additions & 1 deletion

File tree

test/accuracy.jl

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,9 +141,21 @@
141141
test_acc(T, fun_table, xx, tol)
142142

143143

144+
# `-10.0 .^ -(0:0.02:300)` parses as `(-10.0) .^ (-(0:0.02:300))` —
145+
# broadcasting `(-10.0)^y` with non-integer `y`. Pre-1.13 returned `NaN`
146+
# (with `countulp(NaN, NaN) == 0` it contributed no information), but
147+
# Julia 1.13 made `Base.:^(::Real, ::Real)` throw `DomainError` on a
148+
# negative base with non-integer exponent. Negate the result instead so
149+
# the intent (a fan of small negative inputs near 0 to exercise
150+
# `log1p`'s near-zero kernel) is preserved.
144151
xx = map(
145152
T,
146-
vcat(0.0001:0.0001:10, 0.0001:0.1:10000, 10.0 .^ -(0:0.02:300), -10.0 .^ -(0:0.02:300)),
153+
vcat(
154+
0.0001:0.0001:10,
155+
0.0001:0.1:10000,
156+
10.0 .^ -(0:0.02:300),
157+
-(10.0 .^ -(0:0.02:300)),
158+
),
147159
)
148160
fun_table = Dict(SLEEFPirates.log1p => Base.log1p)
149161
tol = 1

0 commit comments

Comments
 (0)