vec_nmadd

Purpose

Returns a vector containing the results of performing a negative multiply-add operation on the given vectors.

Syntax

d=vec_nmadd(a, b, c)

Result and argument types

The following table describes the types of the returned value and the function arguments.

d a b c
vector4double vector4double vector4double vector4double

Result value

The value of each element of the result is the product of the corresponding elements of a and b, added to the corresponding elements of c, and then multiplied by -1.0.

Formula

d[0] = - ( ( a[0] × b[0] ) + c[0] )
d[1] = - ( ( a[1] × b[1] ) + c[1] )
d[2] = - ( ( a[2] × b[2] ) + c[2] )
d[3] = - ( ( a[3] × b[3] ) + c[3] )

Example

a =  ( 10.0,  10.0,  10.0,  10.0)
b =  (  1.0,   2.0,   3.0,   4.0)
c =  ( 20.0,  20.0,  20.0,  20.0)
d: (-30.0, -40.0, -50.0, -60.0)