auto-differentiation / QuantLib-Risks-Cpp

Fast risks with QuantLib in C++
https://auto-differentiation.github.io
15 stars 10 forks source link

New samples, tests, and benchmarks #4

Closed auto-differentiation-dev closed 1 year ago

auto-differentiation-dev commented 1 year ago

New Samples

This PR adds a set of new samples for calculating sensitivities with XAD in QuantLib. They are adaptions of the original QuantLib Examples to demonstrate XAD usage.

Benchmarking

Further, benchmarking performance versus the plain double version of the same sample is now possible for 4 of the samples. Performance for plain pricing as well as sensitivities calculation is measured, averaged over a number of iterations. Using the added CMake option QLXAD_DISABLE_AAD allows to switch to double-only mode, where the same sample is compiled without XAD support. Therefore, performance versus plain double evaluation and also versus a finite-difference based sensitivity calculation can be measured.

New Tests

The adjoint test suite has also been extended to include more pricers, comparing XAD-based sensitivities to finite difference to ensure correct results.

CI/CD

The CI/CD workflow has been adapted to build on all platforms with both XAD enabled and disabled, to ensure the code is working in call cases.