projects
/
vector-math.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
ec11576
)
fix build error
author
Jacob Lifshay
<programmerjake@gmail.com>
Fri, 21 May 2021 00:40:38 +0000
(17:40 -0700)
committer
Jacob Lifshay
<programmerjake@gmail.com>
Fri, 21 May 2021 00:40:38 +0000
(17:40 -0700)
src/algorithms/base.rs
patch
|
blob
|
history
diff --git
a/src/algorithms/base.rs
b/src/algorithms/base.rs
index 255b7ebc0ee0732ecf5d73934725b896d560c5c1..b6e342604962cf666677a7454a47e450fd8f2f29 100644
(file)
--- a/
src/algorithms/base.rs
+++ b/
src/algorithms/base.rs
@@
-147,7
+147,7
@@
pub fn sqrt_rsqrt_kernel<
v: VecF,
iteration_count: usize,
) -> (VecF, VecF) {
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());
let y = initial_rsqrt_approximation(ctx, v);
let mut x = v * y;
let one_half: VecF = ctx.make(0.5.to());
@@
-157,7
+157,7
@@
pub fn sqrt_rsqrt_kernel<
x = x.mul_add_fast(r, x);
neg_h = neg_h.mul_add_fast(r, neg_h);
}
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)]
}
#[cfg(test)]