hayden4r4 / blackscholes-rust

A Black-Scholes pricing model built in Rust
MIT License
11 stars 6 forks source link

Drop: Replace erf_cody with Standard Library's erf #7

Closed day01 closed 3 months ago

day01 commented 3 months ago

Context:
In the previous performance analysis, I found that the standard library's erf function consistently outperforms custom erf_cody function. The performance tests showed that erf won in 3501 cases, while erf_cody won in 2735 cases. Additionally, the total execution time for erf was less than that for erf_cody (261666 nanoseconds for erf vs 293012 nanoseconds for erf_cody).

Changes: This Pull Request implements the transition from using our custom erf_cody function to the standard library's erf function. The changes include:

Impact: This refactor is expected to improve the performance of our code and reduce the maintenance overhead of our custom implementation. It will also make our code more standard and easier to understand for developers familiar with the C++ standard library.

Tests: All test n confirmation of correct implementation we can find here: https://github.com/hayden4r4/blackscholes-rust/pull/6

hayden4r4 commented 3 months ago

this is awesome, really appreciate you digging into this. I love increasing the performance without overly complicating the code, so this is right on target.