Skip to main content

div_f64

Function div_f64 

Source
pub fn div_f64(z: Complex<f64>, w: Complex<f64>) -> Complex<f64>
Expand description

The quotient of two double _Complex values (C99 6.5.5, Annex G.5.1).

Smith’s algorithm: there is no wider format to compute c² + d² in, so the division is carried out through the ratio of the divisor’s two parts, which keeps the denominator in range whenever the quotient itself is.

The ratio.abs() > f64::MIN_POSITIVE test is Smith’s algorithm’s one weak spot, closed the way Baudin and Smith describe: when the ratio is subnormal it has already lost bits, so multiplying by it throws away precision the operands still had. a · (d/c) and (a/c) · d are the same number, and the second one keeps it, so the second one is used exactly where the first would not do.