Minor fixes and cleanup

Former-commit-id: 362dcbcaa40ad64c42fec541fff855d69bc4372a
This commit is contained in:
2023-10-14 10:44:57 -07:00
parent 5538fd2e4e
commit 48bc018adb
6 changed files with 47 additions and 20 deletions

View File

@@ -163,7 +163,7 @@ static inline int __fpclassifyd(double x) {
#define isinf(x) (fpclassify(x) == FP_INFINITE)
#define isfinite(x) ((fpclassify(x) > FP_INFINITE))
static inline float sqrtf(float x) {
_MATH_INLINE float sqrtf(float x) {
const double _half = .5;
const double _three = 3.0;
volatile float y;
@@ -182,7 +182,7 @@ static inline float sqrtf(float x) {
return x;
}
static inline double sqrt(double x) {
_MATH_INLINE double sqrt(double x) {
if (x > 0.0) {
double guess = __frsqrte(x); /* returns an approximation to */
guess = .5 * guess * (3.0 - guess * guess * x); /* now have 8 sig bits */