The use of erfcx instead of direct erfc or CDF in a Black-Scholes implied volatility solver leads to gain in accuracy and performance in general. But which erfcx should we use? This note compares practical erfcx implementations for Rust implied volatility solvers: Commons: the local Rust port of Apache Commons Numbers BoostErf.erfcx Cody: the Cody rational approximation exposed by the jaeckel = 0.2.0 crate during this comparison, originally coming from Netlib SLATEC library . Johnson: Steven G. Johnson’s Faddeeva implementation, as exposed by errorfunctions = 0.2.0 , faddeeva-sys = 0.1.0 , and Julia SpecialFunctions.erfcx(::Float64) The Commons-style implementation is a local Rust port of the Apache Commons Numbers/BoostErf approach . It computes the small central region through the local erf rational approximation and uses exp_m1(x*x) to avoid cancellation in exp(x^2) * erfc(x) near zero. For positive inputs it uses several rational subintervals: a central polynomial/rational erf branch, erfc-style rational branches around 0.5..1.5 , 1.5..2.5 , and 2.5..4 , and a rational function taken from Rational Chebyshev approximations for the error function by W. J. Cody, Math. Comp., 1969, PP. 631-638 beyond that. For very large positive x , it returns 1 / (sqrt(pi) * x) . For negative x , it uses the reflected form with a split-square exponential, returns Inf below the finite overflow cutoff, and otherwise computes 2 exp(x^2) - erfcx(|x|) in a way that preserves more bits near the overflow boundary.


