#include <math.h>
#include <assert.h>
Go to the source code of this file.
◆ sqrt()
Definition at line 13 of file sqrt.c.
15{
16 const double threehalfs = 1.5;
17 const double x2 =
x * 0.5;
20
21
23 {
25 }
27 {
29 }
30
31
32 bits = *(
long long *)&
x;
33
34
35 if ((
bits & 0x7ff7ffffffffffffLL) == 0x7ff0000000000000LL)
36 {
38 }
39
40
41
42 bits = 0x5fe6eb50c7b537a9ll - (
bits >> 1);
43 inv = *(
double*)&
bits;
44
45
46 inv = inv * (threehalfs - (
x2 * inv * inv));
47 inv = inv * (threehalfs - (
x2 * inv * inv));
48 inv = inv * (threehalfs - (
x2 * inv * inv));
49
50
51
52
53 y = ((1 / inv) + (
x * inv)) * 0.5;
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
70}
GLint GLint GLint GLint GLint x
GLint GLint GLint GLint GLint GLint y
GLenum GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * bits
_In_ CLIPOBJ _In_ BRUSHOBJ _In_ LONG _In_ LONG _In_ LONG x2