unum: posit transcendental edge-case sweep#60
Merged
Conversation
Adds tests/lib/unum-edge (28 cases), the %unum analogue of complex-edge: - exact identities (exp0=1, cos0=1, sqt4=2, fact5=120, log1=0, acos1=0, ...) - sign (exp(-1)=1/e, atan(-1)=-pi/4) - NaR propagation (exp/sin/sqt/factorial of NaR -> NaR) - domain -> NaR (sqrt(-1)) - a posit8 cross-width spot (identity + NaR propagation) - large-argument breakdown / saturation, locked as DOCUMENTED limitations: exp(10)~21991 vs 22026; exp(50)/exp(100) saturate near maxpos; sin(10) blows up out of [-1,1] (no range reduction); log (atanh) holds up (log(100)~4.605). No bug found (the unum domain guards from the transcendental PR already hold); posits round-to-nearest-even so there is no rounding-mode axis to sweep. The large-arg cases are the #18 hazard made explicit, not asserted as correct. Co-Authored-By: Claude Opus 4.8 <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.
Follow-on to the edge-case work (stacked on #59). The
%unumanalogue ofcomplex-edge.tests/lib/unum-edge(28 cases, validated vs mpmath):exp0=1,cos0=1,sin0=0,tan0=0,log1=0,sqt0=0,sqt1=1,sqt4=2,fact0=1,fact5=120,atan0=0,asin0=0,acos1=0.exp(−1)=1/e,atan(−1)=−π/4(odd).exp/sin/sqt/factorialof NaR → NaR.sqrt(−1).exp(10)≈21991vs22026;exp(50)/exp(100)saturate near maxpos;sin(10)blows up out of [−1,1] (no range reduction);log(atanh form) holds up —log(100)≈4.605.No new bug (the domain guards from the transcendental PR already hold). Posits round-to-nearest-even, so unlike
%cplxthere's no rounding-mode axis to sweep. The large-arg cases make the #18 hazard explicit.🤖 Generated with Claude Code