66
77## Executive Summary
88
9- | Metric | Your Integrator | Gaussian | Chebyshev | Simpson | Romberg |
9+ | Metric | NumericalIntegrator | Gaussian | Chebyshev | Simpson | Romberg |
1010| --------| ---------| ----------| -----------| ---------| ---------|
1111| ** Smooth Function Accuracy** | 15-16 digits | 15-16 digits | 12-14 digits | 6-8 digits | 10-12 digits |
1212| ** Log Singularity Handling** | ** 5-6 digits ✓** | 2-3 digits ✗ | 3-4 digits ✗ | Fails ✗ | Fails ✗ |
2525
2626### 1. Singularity Handling
2727
28- #### Your Integrator
28+ #### NumericalIntegrator
2929- ✅ Auto-detects logarithmic singularities at boundaries
3030- ✅ Auto-detects power-law singularities (√-type)
3131- ✅ Detects internal poles via spike detection
@@ -69,7 +69,7 @@ double result = gaussianQuad(x -> 1/Math.sqrt(x), 0, 1);
6969
7070### 2. Large Domain Compression
7171
72- #### Your Integrator : [ 1, 200]
72+ #### NumericalIntegrator : [ 1, 200]
7373```
7474Interval size: 199 units
7575Strategy: Logarithmic map compresses [1,200] → [-1,1]
@@ -101,13 +101,13 @@ Accuracy: Error > 0.03 (50% wrong)
101101
102102| Method | Result | Error | Time | Status |
103103| --------| --------| -------| ------| --------|
104- | ** Your Integrator ** | 0.0650624 | 1e-7 | 1100ms | ✓ Converged |
104+ | ** NumericalIntegrator ** | 0.0650624 | 1e-7 | 1100ms | ✓ Converged |
105105| Gaussian Quadrature | 0.0312456 | 0.034 | >5000ms | ✗ Timeout |
106106| Chebyshev | (hangs) | — | >5000ms | ✗ Never converges |
107107| Simpson (1M points) | 0.0523891 | 0.0127 | >10000ms | ✗ Too slow |
108108| Romberg | Oscillates | undefined | — | ✗ Diverges |
109109
110- ** Why Your Integrator Wins:**
110+ ** Why NumericalIntegrator Wins:**
1111111 . Logarithmic map concentrates nodes where needed
1121122 . Aliasing detection catches undersampling
1131133 . Adaptive subdivision refines oscillatory regions
@@ -120,7 +120,7 @@ Accuracy: Error > 0.03 (50% wrong)
120120### Test 1: Smooth Function - ` ∫₀^π sin(x) dx = 2 `
121121
122122```
123- Your Integrator :
123+ NumericalIntegrator :
124124 Result: 2.0000000000000
125125 Error: 0.0
126126 Time: 250 ms
@@ -146,14 +146,14 @@ Romberg (1e-10):
146146```
147147
148148** Verdict:** Gaussian is fastest, but all deliver 16 digits.
149- ** Your integrator ** trades speed for ** robustness** on harder problems.
149+ ** NumericalIntegrator ** trades speed for ** robustness** on harder problems.
150150
151151---
152152
153153### Test 2: Logarithmic Singularity - ` ∫₀.₀₀₁^1 ln(x) dx ≈ -0.992 `
154154
155155```
156- Your Integrator :
156+ NumericalIntegrator :
157157 Result: -0.9920922447210182
158158 Error: 9.224472101820869e-5
159159 Time: 30 ms
@@ -194,7 +194,7 @@ Romberg (1e-10):
194194### Test 3: Power-Law Singularity - ` ∫₀.₀₀₁^1 1/√x dx ≈ 1.937 `
195195
196196```
197- Your Integrator :
197+ NumericalIntegrator :
198198 Result: 1.936754446796634
199199 Error: 0.00024555
200200 Time: 27 ms
@@ -235,7 +235,7 @@ Romberg (1e-10):
235235### Test 4: Internal Pole - ` ∫₀.₁^0.49 1/(x-0.5) dx ` (Pole at x=0.5)
236236
237237```
238- Your Integrator :
238+ NumericalIntegrator :
239239 Result: -3.688879454113936
240240 Error: —
241241 Time: 11 ms
@@ -290,7 +290,7 @@ YOUR INTEGRATOR ████████ ██████░░ ████
290290
291291### 1. Adaptive Coordinate Transformations
292292
293- Your integrator selects the optimal map based on function behavior:
293+ NumericalIntegrator selects the optimal map based on function behavior:
294294
295295| Scenario | Map Used | Why | Benefit |
296296| ----------| ----------| -----| ---------|
@@ -322,7 +322,7 @@ If initial tail error is > 1e6 but no poles detected:
322322### 3. Timeout Protection
323323
324324``` java
325- // Your integrator : Guaranteed to finish
325+ // NumericalIntegrator : Guaranteed to finish
326326integrate(f, 0 , 1 ); // Max 1.5 seconds
327327// Returns result or throws TimeoutException
328328
@@ -335,7 +335,7 @@ gaussianQuad(f, 0, 1); // May never return
335335
336336### 4. Pole Detection and Handling
337337
338- ** Your Integrator :**
338+ ** NumericalIntegrator :**
3393391 . Scans for internal poles (spike detection)
3403402 . Refines pole location (ternary search: 60 iterations, 1e-16 precision)
3413413 . Checks divergence (even vs. odd pole)
@@ -352,7 +352,7 @@ gaussianQuad(f, 0, 1); // May never return
352352### 5. Relative Threshold Deduplication
353353
354354``` java
355- // Your integrator
355+ // NumericalIntegrator
356356double threshold = (b - a) * 1e-11 ; // Scales with interval
357357// Prevents false duplicates on small intervals
358358// Prevents merging distinct poles on large intervals
@@ -393,7 +393,7 @@ double threshold = (b - a) * 1e-11; // Scales with interval
393393
394394** Example:** Archival/reference computations
395395
396- ### Use ** Your Integrator ** When:
396+ ### Use ** NumericalIntegrator ** When:
397397- ✅ Function behavior is unknown
398398- ✅ Must handle singularities
399399- ✅ Can't afford crashes (production systems)
@@ -420,17 +420,17 @@ Internal pole | 11 | Crash | Crash | Crash | Crash
420420Oscillatory [1,200] | 1100 | Timeout | Timeout | Timeout | Diverge
421421```
422422
423- ** Key insight:** Your integrator is slower on smooth functions (10-100x) but is the ** only** one on pathological inputs.
423+ ** Key insight:** NumericalIntegrator is slower on smooth functions (10-100x) but is the ** only** one on pathological inputs.
424424
425425---
426426
427427## Code Examples
428428
429- ### Example 1: Smooth Function (Your Integrator is Slower)
429+ ### Example 1: Smooth Function (NumericalIntegrator is Slower)
430430
431431``` java
432432// Smooth function: sin(x)
433- IntegrationCoordinator1 ic = new IntegrationCoordinator1 ();
433+ NumericalIntegrator ic = new NumericalIntegrator ();
434434double result = ic. integrate(x - > Math . sin(x), 0 , Math . PI );
435435// Time: 250 ms, Accuracy: 16 digits ✓
436436
@@ -439,11 +439,11 @@ double result_g = gaussianQuad(x -> Math.sin(x), 0, Math.PI);
439439// Time: 15 ms, Accuracy: 16 digits ✓
440440```
441441
442- ### Example 2: Singular Function (Your Integrator Dominates)
442+ ### Example 2: Singular Function (NumericalIntegrator Dominates)
443443
444444``` java
445445// Singular function: ln(x)
446- IntegrationCoordinator1 ic = new IntegrationCoordinator1 ();
446+ NumericalIntegrator ic = new NumericalIntegrator ();
447447double result = ic. integrate(x - > Math . log(x), 0.001 , 1.0 );
448448// Time: 30 ms, Accuracy: 5 digits ✓✓✓
449449
@@ -453,11 +453,11 @@ double result_g = gaussianQuad(x -> Math.log(x), 0.001, 1.0);
453453// Error: 0.015 (1.5% off)
454454```
455455
456- ### Example 3: Internal Pole (Your Integrator Only Works)
456+ ### Example 3: Internal Pole (NumericalIntegrator Only Works)
457457
458458``` java
459459// Function with internal pole at x=0.5
460- IntegrationCoordinator1 ic = new IntegrationCoordinator1 ();
460+ NumericalIntegrator ic = new NumericalIntegrator ();
461461double result = ic. integrate(x - > 1 / (x - 0.5 ), 0.1 , 0.49 );
462462// Time: 11 ms
463463// Result: -3.6889... ✓ (correctly integrated around pole)
@@ -477,7 +477,7 @@ double result_g = gaussianQuad(x -> 1/(x - 0.5), 0.1, 0.49);
477477- ** 5-6 digits** : 5-6 significant figures (1e-5 to 1e-6 relative error)
478478- ** 3-4 digits** : 3-4 significant figures (1e-3 to 1e-4 relative error)
479479
480- ### Your Integrator 's Accuracy Guarantees
480+ ### NumericalIntegrator 's Accuracy Guarantees
481481
482482```
483483Function Class | Guaranteed Accuracy | Method
@@ -493,7 +493,7 @@ Oscillatory (limited) | 2-4 digits | Adaptive subdivision
493493
494494## Computational Complexity
495495
496- ### Your Integrator
496+ ### NumericalIntegrator
497497
498498- ** Best case** (smooth): O(N log N) where N=256 nodes
499499- ** Worst case** (singular): O(2^d · N) where d ≤ 18 (max depth)
@@ -527,7 +527,7 @@ Oscillatory (limited) | 2-4 digits | Adaptive subdivision
527527- ** Gaussian Quadrature:** Golub & Welsch (1969), "Calculation of Gauss Quadrature Rules"
528528- ** Clenshaw-Curtis:** Clenshaw & Curtis (1960), "A method for numerical integration..."
529529- ** Adaptive Methods:** De Doncker et al., "Quadpack: A Subroutine Package for Automatic Integration"
530- - ** Your Integrator Inspiration:** GSL (GNU Scientific Library) quad integration
530+ - ** NumericalIntegrator Inspiration:** GSL (GNU Scientific Library) quad integration
531531
532532---
533533
@@ -551,7 +551,7 @@ Speed Smooth functions Pathological functions Robu
551551
552552### The Killer Quote
553553
554- > * "While Gaussian Quadrature is 10x faster on smooth integrands, IntegrationCoordinator1 is the ** only** integrator that handles singular, oscillatory, and pathological functions without crashing, timing out, or returning garbage. Choose speed when you know your function is well-behaved. Choose robustness when you don't."*
554+ > * "While Gaussian Quadrature is 10x faster on smooth integrands, NumericalIntegrator is the ** only** integrator that handles singular, oscillatory, and pathological functions without crashing, timing out, or returning garbage. Choose speed when you know your function is well-behaved. Choose robustness when you don't."*
555555
556556---
557557
@@ -572,4 +572,4 @@ Speed Smooth functions Pathological functions Robu
572572
573573---
574574
575- ** Conclusion:** Use Your Integrator for production systems where reliability matters more than raw speed. Use Gaussian if you know your function is smooth and speed is critical.
575+ ** Conclusion:** Use NumericalIntegrator for production systems where reliability matters more than raw speed. Use Gaussian if you know your function is smooth and speed is critical.
0 commit comments