Claude/gaussian newton methods f p nsz#44
Open
hozblok wants to merge 7 commits into
Open
Conversation
Ray r(t)=O+t*d reduces F(x,y,z)=0 to g(t)=F(O+t*d); all intersections are the real roots of g on [t_min, t_max]. Pluggable backends behind RaySurface: - sampling: safeguarded Newton/bisection reference oracle - sturm: exact all-roots via interpolation, square-free, Sturm isolation; complex surfaces via gcd of Re g and Im g - interval/chebyshev: placeholders for later phases Reuses Solver.evaluate/get_derivative for g and grad F . d. Tests pending local extension build. https://claude.ai/code/session_015PRdmeBfg6J5JZdsAvXvRT
- Fix Newton divided-difference denominator (xs[i]-xs[i-j]) in interpolation - Add Number.__neg__, .precision, .is_complex, .parts(), .wrap() public API - Refactor backends to use the public Number API; pylint 10/10, isort clean - All 12 intersection tests pass; full suite 739 passed https://claude.ai/code/session_015PRdmeBfg6J5JZdsAvXvRT
g is fitted with a Chebyshev interpolant (Chebyshev-Gauss nodes), converted to a monomial proxy, isolated via the shared Sturm machinery (_isolate.py), then simple roots polished on the true g by Newton. auto now routes transcendental real surfaces here instead of sampling. Captures even-multiplicity roots. Extract _isolate.py (sturm_chain/variations/isolate/bisect/sign) shared by the sturm and chebyshev backends. pylint 10/10; full suite 742 passed. https://claude.ai/code/session_015PRdmeBfg6J5JZdsAvXvRT
- subdivision.py: adaptive Taylor-bound exclusion (|g(m)| <= |g'(m)|h + M2/2 h^2) with M2 estimated from g'; refines simple roots (rtsafe) and tangencies (g'=0), rejecting turning points where g != 0. Pure Python, real surfaces. - Chebyshev now self-validates: escalates degree until the spectral tail converges, so oscillatory walls a low degree would miss are captured. Fit reduced to O(m^2). - Move shared rtsafe into _isolate; sampling/subdivision reuse it. - Tests: corrugated capillary wall x^2+y^2-(1+0.3 sin 4z)^2 (12 roots at k*pi/4), Chebyshev self-validation parity, tangent double roots, polynomial parity, complex-rejection. 21 intersection tests; full suite 748 passed. https://claude.ai/code/session_015PRdmeBfg6J5JZdsAvXvRT
…rwise auto now reconciles both general backends for non-polynomial real surfaces: Chebyshev (precise on smooth roots) is backed up by subdivision (the safety net), returning their deduped union so neither method's blind spot drops a root. Drop the now-unused surface arg from get_backend. Test: auto on the corrugated wall returns all 12 roots. Full suite 749 passed. https://claude.ai/code/session_015PRdmeBfg6J5JZdsAvXvRT
Add a section covering the ray->g(t) reduction, the method table (auto/sturm/chebyshev/subdivision/sampling), tangent-root recovery, complex support via sturm, and the practical-vs-rigorous caveat for subdivision. https://claude.ai/code/session_015PRdmeBfg6J5JZdsAvXvRT
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.
No description provided.