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:
Addition of erf_std.cpp file, which contain the standard erf, erfc, and erfcx functions.
Replacement of all instances of erf_cody, erfc_cody, and erfcx_cody with erf_std, erfc_std, and erfcx_std respectively in the codebase.
drop of erf_cody.cpp file.
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.
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.
Context:
In the previous performance analysis, I found that the standard library's
erf
function consistently outperforms customerf_cody
function. The performance tests showed thaterf
won in 3501 cases, whileerf_cody
won in 2735 cases. Additionally, the total execution time forerf
was less than that forerf_cody
(261666 nanoseconds forerf
vs 293012 nanoseconds forerf_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:
erf
,erfc
, anderfcx
functions.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