Appendix B. Built-In Functions

The OpenGL ES shading language built-in functions described in this appendix are copyrighted by Khronos and are reprinted with permission. The latest OpenGL ES 2.0 specification can be downloaded from www.khronos.org/opengles/2_X/.

The OpenGL ES shading language defines an assortment of built-in convenience functions for scalar and vector operations. Many of these built-in functions can be used in more than one type of shader, but some are intended to provide a direct mapping to hardware and so are available only for a specific type of shader.

The built-in functions basically fall into three categories:

  • They expose some necessary hardware functionality in a convenient way such as accessing a texture map. There is no way in the language for these functions to be emulated by a shader.

  • They represent a trivial operation (clamp, mix, etc.) that is very simple for the user to write, but they are very common and might have direct hardware support. It is a very hard problem for the compiler to map expressions to complex assembler instructions.

  • They represent an operation graphics hardware that is likely to accelerate at some point. The trigonometry functions fall into this category.

Many of the functions are similar to the same named ones in common C libraries, but they support vector input as well as the more traditional scalar input.

Applications should be encouraged to use the built-in functions rather than do the equivalent computations in their own shader code because the built-in functions are assumed to be optimal (e.g., perhaps supported directly in hardware).

User code can overload the built-in functions but cannot redefine them. When the built-in functions are specified here, where the input arguments (and corresponding output) can be float, vec2, vec3, or vec4, genType is used as the argument. For any specific use of a function, the actual type has to be the same for all arguments and for the return type. Similarly for mat, which can be a mat2, mat3, or mat4. Precision qualifiers for parameters and return values are not shown. For the texture functions, the precision of the return type matches the precision of the sampler type.

uniform lowp sampler2D sampler;

highp vec2 coord;

...

lowp vec4 col = texture2D(sampler, coord); // texture2D returns lowp

The precision qualification of other built-in function formal parameters is irrelevant. A call to these built-in functions will return a precision qualification matching the highest precision qualification of the call’s input arguments.

Angle and Trigonometry Functions

Table B-1 describes the built-in angle and trigonometry functions. These functions can be used within vertex and fragment shaders. The function parameters specified as angle are assumed to be in units of radians. In no case will any of these functions result in a divide by zero error. If the divisor of a ratio is 0, then results will be undefined. These all operate component-wise.

Table B-1. Angle and Trigonometry Functions

Syntax

Description

float radians (float degrees)vec2 radians (vec2 degrees)vec3 radians (vec3 degrees)vec4 radians (vec4 degrees)

Converts degrees to radians, i.e., π / 180 * degrees.

float degrees (float radians)vec2 degrees (vec2 radians)vec3 degrees (vec3 radians)vec4 degrees (vec4 radians)

Converts radians to degrees, i.e., 180 / π * radians.

float sin (float angle)vec2 sin (vec2 angle)vec3 sin (vec3 angle)vec4 sin (vec4 angle)

The standard trigonometric sine function. Returns values are in the range [–1, 1].

float cos (float angle)vec2 cos (vec2 angle)vec3 cos (vec3 angle)vec4 cos (vec4 angle)

The standard trigonometric cosine function. Returns values are in the range [– 1, 1].

float tan (float angle)vec2 tan (vec2 angle)vec3 tan (vec3 angle)vec4 tan (vec4 angle)

The standard trigonometric tangent function.

float asin (float x)vec2 asin (vec2 x)vec3 asin (vec3 x)vec4 asin (vec4 x)

Arc sine. Returns an angle whose sine is x. The range of values returned by this function is [–π/2, π/2]. Results are undefined if |x| > 1.

float acos (float x)vec2 acos (vec2 x)vec3 acos (vec3 x)vec4 acos (vec4 x)

Arc cosine. Returns an angle with cosine x. The range of values returned by this function is [0, π]. Results are undefined if |x|>1.

float atan (float y, float x)vec2 atan (vec2 y, vec2 x)vec3 atan (vec3 y, vec3 x)vec4 atan (vec4 y, vec4 x)

Arc tangent. Returns an angle with tangent y/x. The signs of x and y are used to determine what quadrant the angle is in. The range of values returned by this function is [-π, π]. Results are undefined if x and y are both 0.

float atan (float y_over_x)vec2 atan (vec2 y_over_x)vec3 atan (vec3 y_over_x)vec4 atan (vec4 y_over_x)

Arc tangent. Returns an angle with tangent y_over_x. The range of values returned by this function is [– π/2, π/2].

Exponential Functions

Table B-2 describes the built-in exponential functions. These functions can be used within vertex and fragment shaders. These functions operate component-wise.

Table B-2. Exponential Functions

Syntax

Description

float pow (float x, float y)vec2 pow (vec2 x, vec2 y)vec3 pow (vec3 x, vec3 y)vec4 pow (vec4 x, vec4 y)

Returns x raised to the y power, i.e., xy. Results are undefined if x < 0. Results are undefined if x = 0 and y <= 0.

float exp (float x)vec2 exp (vec2 x)vec3 exp (vec3 x)vec4 exp (vec4 x)

Returns the natural exponentiation of x, i.e., ex.

float log (float angle)vec2 log (vec2 angle)vec3 log (vec3 angle)vec4 log (vec4 angle)

Returns the natural logarithm of x, i.e., returns the value y, which satisfies the equation x = ey. Results are undefined if x <= 0.

float exp2 (float angle)vec2 exp2 (vec2 angle)vec3 exp2 (vec3 angle)vec4 exp2 (vec4 angle)

Returns 2 raised to the x power, i.e., 2x.

float log2 (float angle)vec2 log2 (vec2 angle)vec3 log2 (vec3 angle)vec4 log2 (vec4 angle)

Returns the base 2 logarithm of x, i.e., returns the value y, which satisfies the equation x = 2y. Results are undefined if x <= 0.

float sqrt (float x)vec2 sqrt (vec2 x)vec3 sqrt (vec3 x)vec4 sqrt (vec4 x)

Returns the positive square root of x. Results are undefined if x < 0.

float inversesqrt (float x)vec2 inversesqrt (vec2 x)vec3 inversesqrt (vec3 x)vec4 inversesqrt (vec4 x)

Returns the reciprocal of the positive square root of x. Results are undefined if x <= 0.

Common Functions

Table B-3 describes the built-in common functions. These functions can be used within vertex and fragment shaders. These functions operate component-wise.

Table B-3. Common Functions

Syntax

Description

float abs (float x)vec2 abs (vec2 x)vec3 abs (vec3 x)vec4 abs (vec4 x)

Returns x if x >= 0, otherwise it returns – x.

float sign (float x)vec2 sign (vec2 x)vec3 sign (vec3 x)vec4 sign (vec4 x)

Returns 1.0 if x > 0, 0.0 if x = 0, or – 1.0 if x < 0.

float floor (float x)vec2 floor (vec2 x)vec3 floor (vec3 x)vec4 floor (vec4 x)

Returns a value equal to the nearest integer that is less than or equal to x.

float ceil (float x)vec2 ceil (vec2 x)vec3 ceil (vec3 x)vec4 ceil (vec4 x)

Returns a value equal to the nearest integer that is greater than or equal to x.

float fract (float x)vec2 fract (vec2 x)vec3 fract (vec3 x)vec4 fract (vec4 x)

Returns xfloor (x).

float mod (float x, float y)vec2 mod (vec2 x, vec2 y)vec3 mod (vec3 x, vec3 y)vec4 mod (vec4 x, vec4 y)

Modulus (modulo). Returns xy * floor (x/y).

float mod (float x, float y)vec2 mod (vec2 x, float y)vec3 mod (vec3 x, float y)vec4 mod (vec4 x, float y)

Modulus (modulo). Returns xy * floor(x/y).

float min (float x, float y)vec2 min (vec2 x, vec2 y)vec3 min (vec3 x, vec3 y)vec4 min (vec4 x, vec4 y)

Returns y if y < x, otherwise it returns x.

float min (float x, float y)vec2 min (vec2 x, float y)vec3 min (vec3 x, float y)vec4 min (vec4 x, float y)

Returns y if y < x, otherwise it returns x.

float max (float x, float y)vec2 max (vec2 x, vec2 y)vec3 max (vec3 x, vec3 y)vec4 max (vec4 x, vec4 y)

Returns y if x < y, otherwise it returns x.

float max (float x, float y)vec2 max (vec2 x, float y)vec3 max (vec3 x, float y)vec4 max (vec4 x, float y)

Returns y if x < y, otherwise it returns x.

float clamp (float x, float y)vec2 clamp (vec2 x, vec2 y)vec3 clamp (vec3 x, vec3 y)vec4 clamp (vec4 x, vec4 y)

Returns min (max (x, minVal), maxVal) Results are undefined if minVal > maxVal.

float clamp (float x, float y)vec2 clamp (vec2 x, float y)vec3 clamp (vec3 x, float y)vec4 clamp (vec4 x, float y)

Returns min (max (x, minVal), maxVal) Results are undefined if minVal > maxVal.

float mix (float x, float y)vec2 mix (vec2 x, vec2 y)vec3 mix (vec3 x, vec3 y)vec4 mix (vec4 x, vec4 y)

Returns the linear blend of x and y, i.e., x * (1– a) + y * a.

float mix (float x, float y)vec2 mix (vec2 x, float y)vec3 mix (vec3 x, float y)vec4 mix (vec4 x, float y)

Returns the linear blend of x and y, i.e., x * (1– a) + y * a.

float step (float edge, float x)vec2 step (vec2 edge, vec2 x)vec3 step (vec3 edge, vec3 x)vec4 step (vec4 edge, vec4 x)

Returns 0.0 if x < edge, otherwise it returns 1.0.

floatstep (float edge, float x)vec2 step (float edge, vec2 x)vec3 step (float edge, vec3 x)vec4 step (float edge, vec4 x)

Returns 0.0 if x < edge, otherwise it returns 1.0.

float smoothstep (float edge0, float edge1, float x)vec2 smoothstep (vec2 edge0, vec2 edge1, vec2 x)vec3 smoothstep (vec3 edge0, vec3 edge1, vec3 x)vec4 smoothstep (vec4 edge0, vec4 edge1, vec4 x)

Returns 0.0 if x <= edge0 and 1.0 if x >= edge1 and performs smooth Hermite interpolation between 0 and 1 when edge0 < x < edge1. This is useful in cases where you would want a threshold function with a smooth transition. This is equivalent to:

// genType is float, vec2, vec3,
// or vec4
genType t;
t = clamp((x - edge0)/
   (edge1 - edge0), 0, 1);
return t * t * (3 - 2 * t);

Results are undefined if edge0 >= edge1.

float smoothstep (float edge0, float edge1, float x)vec2 smoothstep (float edge0, float edge1, vec2 x)vec3 smoothstep (float edge0, float edge1, vec3 x)vec4 smoothstep (float edge0, float edge1, vec4 x)

Returns 0.0 if x <= edge0 and 1.0 if x >= edge1 and performs smooth Hermite interpolation between 0 and 1 when edge0 < x < edge1. This is useful in cases where you would want a threshold function with a smooth transition. This is equivalent to:

// genType is float, vec2, vec3,
// or vec4
genType t;
t = clamp((x - edge0)/
   (edge1 - edge0), 0, 1);
return t * t * (3 - 2 * t);

Results are undefined if edge0 >= edge1.

Geometric Functions

Table B-4 describes the built-in geometric functions. These functions can be used within vertex and fragment shaders. These functions operate on vectors as vectors, not component-wise.

Table B-4. Geometric Functions

Syntax

Description

float length (float x)float length (vec2 x)float length (vec3 x)float length (vec4 x)

Returns the length of vector x, Geometric Functions

float distance (float p0, float p1)float distance (vec2 p0, vec2 p1)float distance (vec3 p0, vec3 p1)float distance (vec4 p0, vec4 p1)

Returns the distance between p0 and p1,i.e., length (p0 – p1).

float dot (float x, float y)float dot (vec2 x, vec2 y)float dot (vec3 x, vec3 y)float dot (vec4 x, vec4 y)

Returns the dot product of x and y,i.e., x[0] * y[0] + x[1] * y[1] + ...

vec3 cross (vec3 x, vec3 y)

Returns the cross product of x and y, i.e., result[0] = x[1] * y[2] – y[1] * x[2]result[1] = x[2] * y[0] – y[2] * x[0] result[2] = x[0] * y[1] – y[0] * x[1]

float normalize (float x)vec2 normalize (vec2 x)vec3 normalize (vec3 x)vec4 normalize (vec4 x)

Returns a vector in the same direction as x but with a length of 1. Returns x / length (x).

float faceforward (float N, float I, float Nref)vec2 faceforward (vec2 N, vec2 I, vec2 Nref)vec3 faceforward (vec3 N, vec3 I, vec3 Nref)vec4 faceforward (vec4 N, vec4 I, vec4 Nref)

If dot(Nref, I) < 0 return N, otherwise return – N.

float reflect (float I, float N)vec2 reflect (vec2 I, vec2 N)vec3 reflect (vec3 I, vec3 N)vec4 reflect (vec4 I, vec4 N)

For the incident vector I and surface orientation N, returns the reflection direction:

I - 2 * dot(N, I) * N

N must already be normalized to achieve the desired result.

float refract (float I, float N, float eta)vec2 refract (vec2 I, vec2 N, float eta)vec3 refract (vec3 I, vec3 N, float eta)vec4 refract (vec4 I, vec4 N, float eta)

For the incident vector I and surface normal N, and the ratio of indices of refraction eta, return the refraction vector. The result is computed by

k = 1.0 - eta * eta *
   (1.0 - dot(N, I) * dot(N, I))
if (k < 0.0)
   // genType is float, vec2,
   // vec3, or vec4
   return genType(0.0)
else
   return eta * I - (eta *
      dot(N, I) + sqrt(k)) *  N

Input parameters for the incident vector I and the surface normal N must already be normalized to get the desired results.

Note

The float version of length, distance, and normalize functions are not very useful but are defined by the shading language for completeness. length(float x) returns |x|, distance(float p0, float p1) returns |p0p1| and normalize(float x) returns 1.

The faceforward function makes sure that the normal vector is pointing in the right direction. The corrected normal will typically be used for lighting.

The reflect function computes a reflection vector R given an incident vector I and the normal N. The reflection vector is computed using the following equation:

R = I – 2 * (N . I) * N

where . is the dot operator

If the vectors I and N are normalized, the computed reflection vector R will also be a normalized vector.

R.R

= (I – 2 * (N . I) * N) . (I – 2 * (N . I) * N)

 

= (I . I) – (2 * (I . N) * (N . I)) – (2 * (I . N) * (N . I) + (4 * (N . I) * (N . I) * (N . N))

 

= 1 – 4 * (N . I)2 + 4 * (N . I)2 // (I . I) and (N . N) = 1

 

= 1

Matrix Functions

Table B-5 describes the built-in matrix functions. These functions can be used within vertex and fragment shaders. These functions operate on vectors as vectors, not component-wise.

Table B-5. Matrix Functions

Syntax

Description

mat2 matrixCompMult (mat2 x, mat2 y)mat3 matrixCompMult (mat3 x, mat3 y)mat4 matrixCompMult (mat4 x, mat4 y)

Multiply matrix x by matrix y component-wise, i.e., result[i][j] is the scalar product of x[i][j] and y[i][j].

Note: To get linear algebraic matrix multiplication, use the multiply operator (*).

matrixCompMult performs a component-wise multiplication. For example, let m_a and m_b be two mat3 matrices described as follows:

Matrix Functions

matrixCompMult will return a mat3 matrix with the following components:

Matrix Functions

This is quite different from a matrix multiplication. To multiply the two matrices m_a and m_b we use the expression m_r = m_a * m_b.

Matrix Functions

then m_r = m_a * m_b is given as:

Matrix Functions

Vector Relational Functions

Table B-6 describes the built-in vector relational functions. These functions can be used within vertex and fragment shaders. Relational and equality operators (<, <=, >, >=, ==, !=) are defined (or reserved) to produce scalar boolean results. For vector results, use the built-in functions given in Table B-6.

Table B-6. Vector Relational Functions

Syntax

Description

bvec2 lessThan (vec2 x, vec2 y)bvec3 lessThan (vec3 x, vec3 y)bvec4 lessThan (vec4 x, vec4 y)bvec2 lessThan (ivec2 x, ivec2 y)bvec3 lessThan (ivec3 x, ivec3 y)bvec4 lessThan (ivec4 x, ivec4 y)

Returns the component-wise compare of x < y.

bvec2 lessThanEqual (vec2 x, vec2 y)bvec3 lessThanEqual (vec3 x, vec3 y)bvec4 lessThanEqual (vec4 x, vec4 y)bvec2 lessThanEqual (ivec2 x, ivec2 y)bvec3 lessThanEqual (ivec3 x, ivec3 y)bvec4 lessThanEqual (ivec4 x, ivec4 y)

Returns the component-wise compare of x <= y.

bvec2 greaterThan (vec2 x, vec2 y)bvec3 greaterThan (vec3 x, vec3 y)bvec4 greaterThan (vec4 x, vec4 y)bvec2 greaterThan (ivec2 x, ivec2 y)bvec3 greaterThan (ivec3 x, ivec3 y)bvec4 greaterThan (ivec4 x, ivec4 y)

Returns the component-wise compare of x > y.

bvec2 greaterThanEqual (vec2 x, vec2 y)bvec3 greaterThanEqual (vec3 x, vec3 y)bvec4 greaterThanEqual (vec4 x, vec4 y)bvec2 greaterThanEqual (ivec2 x, ivec2 y)bvec3 greaterThanEqual (ivec3 x, ivec3 y)bvec4 greaterThanEqual (ivec4 x, ivec4 y)

Returns the component-wise compare of x >= y.

bvec2 equal (vec2 x, vec2 y)bvec3 equal (vec3 x, vec3 y)bvec4 equal (vec4 x, vec4 y)bvec2 equal (ivec2 x, ivec2 y)bvec3 equal (ivec3 x, ivec3 y)bvec4 equal (ivec4 x, ivec4 y)

Returns the component-wise compare of x == y.

bvec2 notEqual (vec2 x, vec2 y)bvec3 notEqual (vec3 x, vec3 y)bvec4 notEqual (vec4 x, vec4 y)bvec2 notEqual (ivec2 x, ivec2 y)bvec3 notEqual (ivec3 x, ivec3 y)bvec4 notEqual (ivec4 x, ivec4 y)

Returns the component-wise compare of x != y.

bool any (bvec2 x)bool any (bvec3 x)bool any (bvec4 x)

Returns true if any component of x is true.

bool all (bvec2 x)bool all (bvec3 x)bool all (bvec4 x)

Returns true only if all components of x are true.

bvec2 not (bvec2 x)bvec3 not (bvec3 x)bvec4 not(bvec4 x)

Returns the component-wise logical complement of x.

Texture Lookup Functions

Table B-7 describes the built-in texture lookup functions. Texture lookup functions are available to both vertex and fragment shaders. However, the level of detail is not computed by fixed functionality for vertex shaders, so there are some differences in operation between vertex and fragment texture lookups. The functions in Table B-7 provide access to textures through samplers, as set up through the OpenGL ES API. Texture properties such as size, pixel format, number of dimensions, filtering method, number of mipmap levels, depth comparison, and so on, are also defined by OpenGL ES API calls. Such properties are taken into account as the texture is accessed via the built-in functions defined in Table B-7.

Table B-7. Texture Lookup Functions

Syntax

Description

vec4 texture2D (sampler2D sampler, vec2 coord)vec4 texture2D (sampler2D sampler, vec2 coord, float bias)vec4 texture2DProj (sampler2D sampler, vec3 coord)vec4 texture2DProj (sampler2D sampler, vec3 coord, float bias)vec4 texture2DProj (sampler2D sampler, vec4 coord)vec4 texture2DProj (sampler2D sampler, vec4 coord, float bias)vec4 texture2DLod (sampler2D sampler, vec2 coord, float lod)vec4 texture2DProjLod (sampler2D sampler, vec3 coord, float lod)vec4 texture2DProjLod (sampler2D sampler, vec4 coord, float lod)

Use the texture coordinate coord to do a texture lookup in the 2D texture currently bound to sampler. For the projective (“Proj”) versions, the texture coordinate (coord.s, coord.t) is divided by the last component of coord. The third component of coord is ignored for the vec4 coord variant.

vec4 textureCube (samplerCube sampler, vec3 coord)vec4 textureCube (samplerCube sampler, vec3 coord, float bias)vec4 textureCubeLod (samplerCube sampler, vec3 coord, float lod)

Use the texture coordinate coord to do a texture lookup in the cubemap texture currently bound to sampler. The direction of coord is used to select which face to do a 2D texture lookup in, as described in section 3.8.6 in version 2.0 of the OpenGL specification.

vec4 texture3D (sampler3D sampler, vec3 coord)vec4 texture3D (sampler2D sampler, vec3 coord, float bias)vec4 texture3DProj (sampler2D sampler, vec4 coord)vec4 texture3DProj (sampler2D sampler, vec4 coord, float bias)vec4 texture3DLod (sampler3D sampler, vec3 coord, float lod)vec4 texture3DProjLod (sampler3D sampler, vec4 coord, float lod)

Use the texture coordinate coord to do a texture lookup in the 3D texture currently bound to sampler. For the projective (Proj) versions, the texture coordinate (coord.s, coord.t, coord.r) is divided by the last component of coord.

Functions containing the bias parameter are available only in the fragment shader. If bias is present, it is added to the calculated level of detail prior to performing the texture access operation. If the bias parameter is not provided, then the implementation automatically selects level of detail: For a texture that is not mipmapped, the texture is used directly. If it is mipmapped and running in a fragment shader, the LOD computed by the implementation is used to do the texture lookup. If it is mipmapped and running on the vertex shader, then the base texture is used.

The built-ins suffixed with “Lod” are allowed only in a vertex shader. For the “Lod” functions, lod is directly used as the level of detail.

The texture3D, texture3DProj, texture3DLod, and texture3DProjLod functions defined in Table B-7 are only available if the #extension GL_OES_texture_3d directive is set to enable and the OpenGL ES implementation supports this extension.

Derivative Functions

Table B-8 describes the built-in derivative functions. The derivative functions can only be used inside fragment shaders. These functions are available if the #extension GL_OES_standard_derivatives directive is set to enable and the OpenGL ES implementation supports this extension.

Table B-8. Derivative Functions

Syntax

Description

float dFdx (float p)vec2 dFdx (vec2 p)vec3 dFdx (vec3 p)vec4 dFdx (vec4 p)

Returns the derivative in x using local differencing for the input argument p.

float dFdy (float p)vec2 dFdy (vec2 p)vec3 dFdy (vec3 p)vec4 dFdy (vec4 p)

Returns the derivative in y using local differencing for the input argument p.

float fwidth (float p)vec2 fwidth (vec2 p)vec3 fwidth (vec3 p)vec4 fwidth (vec4 p)

Returns the sum of the absolute derivative in x and y using local differencing for the input argument p, i.e.,

result = abs (dFdx (p)) + abs (dFdy (p));

Derivatives might be computationally expensive and numerically unstable. Therefore, an OpenGL ES implementation can approximate the true derivatives by using a fast but not entirely accurate derivative computation.

The expected behavior of a derivative is specified using forward–backward differencing.

Forward differencing:

F(x + dx) – F(x) ~ dFdx(x) * dx

dFdx ~ ( F(x + dx) – F(x) ) / dx

Backward differencing:

F(x – dx) – F(x) ~ –dFdx(x) * dx

dFdx ~ ( F(x) – F(x – dx) ) / dx

With single-sample rasterization, dx <= 1.0 in the preceding equations. For multisample rasterization, dx < 2.0 in the preceding equations.

dFdy is approximated similarly, with y replacing x.

An OpenGL ES implementation can use the preceding or other methods to perform the calculation, subject to the following conditions:

  • The method can use piecewise linear approximations. Such linear approximations imply that higher order derivatives, dFdx(dFdx(x)) and above, are undefined.

  • The method can assume that the function evaluated is continuous. Therefore derivatives within the body of a nonuniform conditional are undefined.

  • The method can differ per fragment, subject to the constraint that the method can vary by window coordinates, not screen coordinates. The invariance requirement is relaxed for derivative calculations, because the method can be a function of fragment location.

Other properties that are desirable, but not required, are:

  • Functions should be evaluated within the interior of a primitive (interpolated, not extrapolated).

  • Functions for dFdx should be evaluated while holding y constant. Functions for dFdy should be evaluated while holding x constant. However, mixed higher order derivatives, like dFdx(dFdy(y)) and dFdy(dFdx(x)) are undefined.

  • Derivatives of constant arguments should be 0.

In some implementations, varying degrees of derivative accuracy can be obtained by providing hints using glHint(GL_FRAGMENT_SHADER_DERIVATIVE_HINT), allowing a user to make an image quality versus speed trade-off.

dFdx and dFdy are commonly used to estimate the filter width used to antialias procedural textures. We are assuming that the expression is being evaluated in parallel on an SIMD array so that at any given point in time the value of the function is known at the grid points represented by the SIMD array. Local differencing between SIMD array elements can therefore be used to calculate these derivatives.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset