danielhstahl / black_scholes_rust

Rust for black scholes
https://danielhstahl.github.io/black_scholes_rust/dev/bench/
23 stars 8 forks source link

Add jaeckel IV calculation #12

Open Zarathustra2 opened 2 years ago

Zarathustra2 commented 2 years ago

Added the C++ version of www.jaeckel.org IV calculation and linked it.

danielhstahl commented 2 years ago

Thanks Dario! I'm guessing this is done for performance reasons? Do you have any benchmarks comparing native rust to the c++ implementation?

Zarathustra2 commented 2 years ago

I have not but the reason I did it is because I found the IV calculation of Jaeckel more accurate when comparing it with my local brokers. The rust one did not always give me results while Jaeckel gave me more constant results with the same params.

Let me try to add a benchmark, I will try to cycle back within the next days! :)

danielhstahl commented 2 years ago

Also I have a precision parameter which may cause the IV calculation to not run for the full 10000 iterations. Which could impact the accuracy vs the c code.

Zarathustra2 commented 2 years ago

@danielhstahl Sorry did not have the time yet; trying to do over the weekend hopefully!