Skip to content

Fix premature truncation in double no-touch pricing - #270

Closed
kadyrbekovhamit-cyber wants to merge 1 commit into
domokane:masterfrom
kadyrbekovhamit-cyber:gero-double-no-touch-20260917
Closed

kadyrbekovhamit-cyber wants to merge 1 commit into
domokane:masterfrom
kadyrbekovhamit-cyber:gero-double-no-touch-20260917

Conversation

@kadyrbekovhamit-cyber

Copy link
Copy Markdown
Contributor

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:

  • All 89 new cases pass; the original fails 56, removing only the early stop still fails 13, and restoring the original reproduces the same 56 failures. Released 1.1.2 also fails the same cases, with a test-only import alias for the renamed flat curve.
  • Exact PR files plus 14 existing adjacent FX tests: 103 passed.
  • A separate 480-scenario public-API matrix, with a freshly recomputed 60-decimal method-of-images oracle, reproduces the retained results: 360 failures originally, 48 after the first change, zero after both, and 360 after restoration.

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.

@domokane domokane left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. I fixed this manually before I saw this detail.

@domokane domokane closed this Sep 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Double no-touch series truncation produces prices outside the cash-payment bounds

2 participants