erfc_simd

Function erfc_simd 

Source
pub fn erfc_simd<F>(x: &ArrayView1<'_, F>) -> Array1<F>
where F: Float + SimdUnifiedOps,
Expand description

Element-wise complementary error function erfc(x) = 1 - erf(x)

More numerically stable than computing 1 - erf(x) directly for large x. Uses SIMD acceleration when available for optimal performance.

§Properties

  • erfc(0) = 1
  • erfc(∞) = 0, erfc(-∞) = 2
  • erfc(x) = 1 - erf(x)
  • erfc(-x) = 2 - erfc(x)

§Examples

use scirs2_core::ndarray_ext::elementwise::erfc_simd;
use scirs2_core::ndarray::array;

let x = array![0.0f64, 1.0, 2.0, 3.0];
let result = erfc_simd(&x.view());
assert!((result[0] - 1.0).abs() < 1e-10);  // erfc(0) = 1
assert!((result[1] - 0.1572992070502852).abs() < 1e-6);  // erfc(1)