Closed lballabio closed 8 years ago
Interesting. Did you get that from some compiler diagnostics?
The website given as a reference in the code contains a summary of the paper and Fortran code for download. The Fortran code shows the same peculiarity regarding caux and ccaux (lines 200 and 201 in Fmain.f90). The full paper can be downloaded here:
Formula 36 seems to be the function v implemented in pertubativebarrieroptionengine.cpp, L393. The loop starting at L163 seems to compute the integral of formula 34. Lines 172-173 correspond to [E(τ, t, x, x∗,γ)− E(τ, t, −x, x∗,γ) + E(τ, t, x, −x∗,γ)− E(τ, t, −x, −x∗,γ)]
(see lines 4 to 6 of formula 34 in the paper).
If this is all true, we would have to replace caux by ccaux in L172 and would be fine.
We should probably send the corresponding fix of the Fortran implementation to the authors of the paper. Maybe they can confirm that it is correct. Do you know them ?
I got this from clang's static analysis tools (http://clang-analyzer.llvm.org/scan-build.html).
I still have the email of one of the authors. I'll reach out to him and ask for confirmation.
that's good, thank you
Hmm, I take that back--the email I had is no longer valid.
Ok, I'm doing the change anyway.
I am confident that this is ok.
In
ql/experimental/barrieroption/perturbativebarrieroptionengine.cpp
, the value assigned tocaux
at line 172 is never used. It might be just a dead assignment (in which acse we can delete it) but since there's another variable calledccaux
and used in the rest of the function, it's also possible that the wrong variable was assigned or used. We should check the implementation based on the reference quoted in the header file.