If x 2 − y 2 is evaluated as (( x × x) − y × y) (following Kahan's suggested notation in which redundant parentheses direct the compiler to round the ( x × x) term first) using fused multiply–add, then the result may be negative even when x = y due to the first multiplication discarding low significance bits. However, William Kahan has pointed out that it can give problems if used unthinkingly. Multiplication in double-double arithmeticįused multiply–add can usually be relied on to give more accurate results.Convolutions and artificial neural networks.Newton's method for evaluating functions (from the inverse function).Polynomial evaluation (e.g., with Horner's rule).That is, where an unfused multiply–add would compute the product b × c, round it to N significant bits, add the result to a, and round back to N significant bits, a fused multiply–add would compute the entire expression a + ( b × c) to its full precision before rounding the final result down to N significant bits.Ī fast FMA can speed up and improve the accuracy of many computations that involve the accumulation of products: Is a floating-point multiply–add operation performed in one step, with a single rounding. IEEE 754-2008 specifies that it must be performed with one rounding, yielding a more accurate result. Therefore, it makes a difference to the result whether the multiply–add is performed with two roundings, or in one operation with a single rounding (a fused multiply–add). (See Floating point § Accuracy problems.) That is, digital floating-point arithmetic is generally not associative or distributive. However, floating-point numbers have only a certain amount of mathematical precision. When done with integers, the operation is typically exact (computed modulo some power of two). The first modern processors to be equipped with MAC units were digital signal processors, but the technique is now also common in general-purpose processors. Percy Ludgate was the first to conceive a MAC in his Analytical Machine of 1909, and the first to exploit a MAC for division (using multiplication seeded by reciprocal, via the convergent series (1+ x) −1). Combinational multipliers require a large amount of logic, but can compute a product much more quickly than the method of shifting and adding typical of earlier computers. The output of the register is fed back to one input of the adder, so that on each clock cycle, the output of the multiplier is added to the register. Modern computers may contain a dedicated MAC, consisting of a multiplier implemented in combinational logic followed by an adder and an accumulator register that stores the result. When performed with a single rounding, it is called a fused multiply–add ( FMA) or fused multiply–accumulate ( FMAC). When done with floating point numbers, it might be performed with two roundings (typical in many DSPs), or with a single rounding. The MAC operation modifies an accumulator a:Ī ← a + ( b × c ) The hardware unit that performs the operation is known as a multiplier–accumulator ( MAC unit) the operation itself is also often called a MAC or a MAD operation. In computing, especially digital signal processing, the multiply–accumulate ( MAC) or multiply-add ( MAD) operation is a common step that computes the product of two numbers and adds that product to an accumulator. Operation common in numerical signal processing
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |