-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
from stdlib.ispc
#define RSQRTD(QUAL) \
__declspec(safe) static inline QUAL double __rsqrt_iterate_##QUAL##_double(QUAL double x, QUAL double y) { \
QUAL double xh = x * 0.5d; \
y += y * (0.5d - xh * y * y); \
y += y * (0.5d - xh * y * y); \
return y; \
} \
__declspec(safe) static inline QUAL double __rsqrt_safe_##QUAL##_double(QUAL double x) { \
if (x <= 1.0e+33d && x >= 1.0e-33d) \
return __rsqrt_iterate_##QUAL##_double(x, rsqrt((QUAL float)x)); \
QUAL int64 ex = intbits(x) & 0x7fe0000000000000; \
QUAL double exp = doublebits(0x7fd0000000000000 - ex); /* 1.0d/exponent */ \
QUAL double exph = doublebits(0x5fe0000000000000 - (ex >> 1)); /* 1.0d/sqrt(exponent) */ \
QUAL double y = rsqrt((QUAL float)(x * exp)); \
return __rsqrt_iterate_##QUAL##_double(x, y * exph); \
}
gives not hilited numbers
Metadata
Metadata
Assignees
Labels
No labels
