v: VecF,
iteration_count: usize,
) -> (VecF, VecF) {
- /// based on second algorithm of https://en.wikipedia.org/wiki/Methods_of_computing_square_roots#Goldschmidt%E2%80%99s_algorithm
+ // based on second algorithm of https://en.wikipedia.org/wiki/Methods_of_computing_square_roots#Goldschmidt%E2%80%99s_algorithm
let y = initial_rsqrt_approximation(ctx, v);
let mut x = v * y;
let one_half: VecF = ctx.make(0.5.to());
x = x.mul_add_fast(r, x);
neg_h = neg_h.mul_add_fast(r, neg_h);
}
- (x, neg_h * ctx.make(-2.to()))
+ (x, neg_h * ctx.make(PrimF::cvt_from(-2)))
}
#[cfg(test)]