Fix premature truncation in double no-touch pricing - #270
Closed
kadyrbekovhamit-cyber wants to merge 1 commit into
Closed
kadyrbekovhamit-cyber wants to merge 1 commit into
kadyrbekovhamit-cyber wants to merge 1 commit into
Conversation
domokane
reviewed
Sep 18, 2026
domokane
left a comment
Owner
There was a problem hiding this comment.
Thanks. I fixed this manually before I saw this detail.
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.
Closes #266.
A nonnegative cash payoff can receive a negative price: the reported 30-day example returns no-touch 1.1717090895 and touch -0.1733515747, although discounted cash is 0.9983575147.
The series can stop at an individual zero coefficient or sine term while later terms remain material. Its damping-based cutoff also computes half the threshold implied by the documented exponential bound. This change removes the single-term stop and corrects that factor, retaining the existing 50-term minimum and 2,000-term cap. No output clipping is introduced.
The new deterministic tests cover pricing bounds, touch/no-touch parity, an independent reflected-Gaussian reference, short and long maturities, payment scaling, and nonzero log drift.
Validation on current master
4c7cd50bdadd6efc9ac74fa81e93374397d18e3e:The 2,000-term cap is unchanged; this is not a universal convergence guarantee. The full upstream suite, Monte Carlo, Greeks and performance were not measured. Implementation and test preparation were AI-assisted; validation used the actual Numba CPU implementation.