1vrsqrt_(3MVEC) Vector Math Library Functions vrsqrt_(3MVEC)
2
3
4
6 vrsqrt_, vrsqrtf_ - vector reciprocal square root functions
7
9 cc [ flag... ] file... -lmvec [ library... ]
10
11 void vrsqrt_(int *n, double * restrict x, int *stridex,
12 double * restrict y, int *stridey);
13
14
15 void vrsqrtf_(int *n, float * restrict x, int *stridex,
16 float * restrict y, int *stridey);
17
18
20 These functions evaluate the function rsqrt(x), defined by rsqrt(x) = 1
21 / sqrt(x), for an entire vector of values at once. The first parameter
22 specifies the number of values to compute. Subsequent parameters spec‐
23 ify the argument and result vectors. Each vector is described by a
24 pointer to the first element and a stride, which is the increment
25 between successive elements.
26
27
28 Specifically, vrsqrt_(n, x, sx, y, sy) computes y[i * *sy] = rsqrt(x[i
29 * *sx]) for each i = 0, 1, ..., *n - 1. The vrsqrtf_() function per‐
30 forms the same computation for single precision data.
31
32
33 These functions are not guaranteed to deliver results that are identi‐
34 cal to the results of evaluating 1.0 / sqrt(x) given the same argu‐
35 ments. Non-exceptional results, however, are accurate to within a unit
36 in the last place.
37
39 The element count *n must be greater than zero. The strides for the
40 argument and result arrays can be arbitrary integers, but the arrays
41 themselves must not be the same or overlap. A zero stride effectively
42 collapses an entire vector into a single element. A negative stride
43 causes a vector to be accessed in descending memory order, but note
44 that the corresponding pointer must still point to the first element of
45 the vector to be used; if the stride is negative, this will be the
46 highest-addressed element in memory. This convention differs from the
47 Level 1 BLAS, in which array parameters always refer to the lowest-
48 addressed element in memory even when negative increments are used.
49
50
51 These functions assume that the default round-to-nearest rounding
52 direction mode is in effect. On x86, these functions also assume that
53 the default round-to-64-bit rounding precision mode is in effect. The
54 result of calling a vector function with a non-default rounding mode in
55 effect is undefined.
56
57
58 These functions handle special cases and exceptions in the spirit of
59 IEEE 754. In particular,
60
61 o if x < 0, rsqrt(x) is NaN, and an invalid operation excep‐
62 tion is raised,
63
64 o rsqrt(NaN) is NaN,
65
66 o rsqrt(+Inf) is +0,
67
68 o rsqrt(±0) is ±Inf, and a division-by-zero exception is
69 raised.
70
71
72 An application wanting to check for exceptions should call feclearex‐
73 cept(FE_ALL_EXCEPT) before calling these functions. On return, if
74 fetestexcept(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW) is
75 non-zero, an exception has been raised. The application can then exam‐
76 ine the result or argument vectors for exceptional values. Some vector
77 functions can raise the inexact exception even if all elements of the
78 argument array are such that the numerical results are exact.
79
81 See attributes(5) for descriptions of the following attributes:
82
83
84
85
86 ┌─────────────────────────────┬─────────────────────────────┐
87 │ ATTRIBUTE TYPE │ ATTRIBUTE VALUE │
88 ├─────────────────────────────┼─────────────────────────────┤
89 │Interface Stability │Committed │
90 ├─────────────────────────────┼─────────────────────────────┤
91 │MT-Level │MT-Safe │
92 └─────────────────────────────┴─────────────────────────────┘
93
95 sqrt(3M), feclearexcept(3M), fetestexcept(3M), attributes(5)
96
97
98
99SunOS 5.11 14 Dec 2007 vrsqrt_(3MVEC)