ashvardanian / SimSIMD

Up to 200x Faster Inner Products and Vector Similarity — for Python, JavaScript, Rust, C, and Swift, supporting f64, f32, f16 real & complex, i8, and binary vectors using SIMD for both x86 AVX2 & AVX-512 and Arm NEON & SVE 📐
https://ashvardanian.com/posts/simsimd-faster-scipy/
Apache License 2.0
797 stars 42 forks source link

-31 instead of 32? #48

Closed sroussey closed 6 months ago

sroussey commented 6 months ago

https://github.com/ashvardanian/SimSIMD/blob/a29f68a0eb08214d5cbdf6bb9e1be3857d27598c/javascript/test/simsimd.test.js#L41

Why is the dot product not 32?

ashvardanian commented 6 months ago

@sroussey because that's the inner-product distance, not just the inner product. It's computed as $1 - ab$.

sroussey commented 6 months ago

Ah, got it! Thx.