Closed n3vu0r closed 5 months ago
im not sure i get why we need these?
I'm attempting to reduce rounding errors for functions accepting E: RealField
:
fn dummy_example<E: RealField>(x: E) -> E {
x.faer_mul_add(x, x)
}
Is this already possible somehow?
if you mean outside of faer, you can already do that by using your own trait that has faer::ComplexField
as a super-trait
Ok, at the moment I'm using E: RealField + MulAdd<Output = E>
where MulAdd
is my own trait and it works fine. But I thought this functionality is in general useful and if I understand the traits correctly it's currently not supported out of the box. It would complement the SIMD variants faer_simd_mul_adde
for non-SIMD types.
Feel free to close this PR if you don't think it's useful.
yeah, i don't think i want to add these. mul_add
needs to go through an indirect function call on x86, which makes it really slow.
Adds
faer_mul_add
andfaer_abs2_add
toComplexField
.