Repository navigation
Handle missing roots in holder-extensible calls - #3043
Open
Jackmeson1 wants to merge 1 commit into
Open
Jackmeson1 wants to merge 1 commit into
Jackmeson1 wants to merge 1 commit into
Conversation
With a negative dividend yield, c(S) - A - S + X1 can have no zero. The existing unbounded Newton search timed out on the regression inputs. Locate the minimum analytically and use an infinite upper critical price when exercise never beats extension. Reject unsupported call extension regions, including those bypassed by the vanilla shortcut. Bound all four Newton searches at 100 steps and reject non-finite residuals, invalid derivatives and non-positive or non-finite steps. Add price references and expected-error checks to the regression test. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JfvcPZyKcKQUG9fQGYfRMw Signed-off-by: Jackmeson1 <130693642+Jackmeson1@users.noreply.github.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.
AnalyticHolderExtensibleOptionEnginesearches for a zero ofc(S) - A - S + X1without bounding its Newton iterations. With anegative dividend yield this function can remain positive, so the
required root need not exist.
Locate its minimum analytically and use an infinite upper critical
price when exercise never beats extension. Reject call configurations
whose extension regions the current formula cannot represent,
including those that would otherwise take the vanilla-price shortcut.
Bound all four Newton searches at 100 steps and reject invalid steps.
On Linux with GCC 13.3.0:
84fbf0a0eWith this change all three match the quadrature values within the test's 1e-4 tolerance.
testHolderExtensibleOptionNegativeDividendYieldchecks supportedprices against numerical integration with mpmath 1.3.0 at an absolute
tolerance of 1e-4, and checks errors for unsupported call regions and
saturated Newton derivatives. Rejection intentionally replaces some
previously returned prices.
Checked on Ubuntu 24.04 with GCC 13.3.0, Boost 1.83.0, Release and
QL_COMPILE_WARNING_AS_ERROR=ON: all fourExtensibleOptionsTestscases pass in C++17 and C++20. With the production files at
84fbf0a0e, the new test does not finish (stopped after 300 s).This does not address the existing negative-yield put discrepancies
or change the absolute 0.001 Newton residual tolerance.
AI disclosure: this was prepared with AI assistance (Claude Opus 5.5 and Claude Sonnet 5.5).
🤖 Generated with Claude Code
https://claude.ai/code/session_01JfvcPZyKcKQUG9fQGYfRMw