Fix Julia 1.13 DomainError in log1p test grid (followup to #45) - #47
Merged
Conversation
`vcat(..., -10.0 .^ -(0:0.02:300))` was parsing as `(-10.0) .^ (-(0:0.02:300))` — broadcasting `(-10.0)^y` over a non-integer range. Pre-1.13 each call returned `NaN` (with `countulp(NaN, NaN) == 0` so the test contributed no information), but Julia 1.13 changed `Base.:^(::Real, ::Real)` to throw `DomainError` on a negative base with non-integer exponent. The file then fails to even load on Julia 1.13+. Wrap as `-(10.0 .^ -(0:0.02:300))` instead. The resulting values are identical to what the previous expression produced on pre-1.13 (the operands `10.0^(-y)` are positive small floats; negating gives the intended fan of small negatives near 0 for `log1p`'s near-zero kernel), and avoids the negative-base `^` call entirely. #45 had the same fix shape for the `pow` test grid; this is the matching fix for the `log1p` grid that was missed. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
A second instance of the same Julia 1.13
Base.:^(::Real, ::Real) → DomainErrorissue that #45 fixed for thepowtest grid. This one is in thelog1ptest grid attest/accuracy.jl:146:The last term parses as
(-10.0) .^ (-(0:0.02:300))— broadcasting(-10.0)^yover a non-integer range. Pre-1.13 each call returnedNaN(andcountulp(NaN, NaN) == 0means it contributed nothing to the accuracy test); Julia 1.13 throwsDomainErrorand the test file fails to even load.This was the remaining failure on JuliaSIMD/VectorizationBase.jl#127's
SLEEFPirates.jl/Interface/prejob after #45 + the VB FMA release shipped.Fix
Wrap as
-(10.0 .^ -(0:0.02:300))so the negation applies to the result (a vector of small positives) rather than the base. Values are bitwise-identical to what pre-1.13 was producing for the valid entries, and the negative-base^call is gone.Test plan
test/accuracy.jlruns to completion (Float64 testset: 388 pass / 5 broken — same as before, no regression).pre/nightlyto confirm theDomainErroris gone.🤖 Generated with Claude Code