I briefly used the Heston analytic engine and something doesn't seem quite right.
One can look at the unit test "testAlanLewisReferencePrices" where the reference prices are matched to very high accuracy (1.e-12 or lower), with either laguerre or gaussLobatto integration. If we only change one parameter there (sigma, from 1 to 0.1), everything breaks down. Laguerre will give 16.83 where guassLobatto gives 15.84 (ATM call). Lobatto seems the one which is more wrong, but Laguerre is not too accurate either. By the way, reducing c_inf from the currently chosen value, brings Lobatto very close to Laguerre.
Any insights into this? Am I doing something wrong? Is there something that needs to be fine-tuned?
the small sigma value gives the Gauss-Lobatto algorithm a hard time to figure
out the Fourier integral of the characteristic function. All other adaptive
integration algorithms like Gauss-Konrod etc throw in the towel much earlier.
It was observed that a max value on the expression sqrt(1-rho^2)/w can improve
the numerical stability of the Gauss-Lobatto integration. Given your example
and some additional edge cases 1.0 seems to be a better max bound than the
10.0 currently being used. I've created a PR with the corresponding change,