There's a reciprocal sqrt instruction in SSE (x86) that your compiler may be 
pattern matching to, depending on your compiler options.   You could 
disassemble to see what you get from the latter.

-----Original Message-----
From: Friam <[email protected]> On Behalf Of u?l? ???
Sent: Thursday, January 7, 2021 3:24 PM
To: FriAM <[email protected]>
Subject: [FRIAM] Q_rsqrt() vs 1/sqrt()

https://en.wikipedia.org/wiki/Fast_inverse_square_root

So, why is Q_rsqrt() *slower* than 1/sqrt()?

1/sqrt() took 0.294771 s
Q_rsqrt() took 0.51579 s

-- 
↙↙↙ uǝlƃ
- .... . -..-. . -. -.. -..-. .. ... -..-. .... . .-. .
FRIAM Applied Complexity Group listserv
Zoom Fridays 9:30a-12p Mtn GMT-6  bit.ly/virtualfriam
un/subscribe http://redfish.com/mailman/listinfo/friam_redfish.com
archives: http://friam.471366.n2.nabble.com/
FRIAM-COMIC http://friam-comic.blogspot.com/ 

Reply via email to