September 2019
Intermediate to advanced
816 pages
18h 47m
English
The mathematical computation (a * b) + c is heavily exploited in matrix multiplications, which are frequently used in High-Performance Computing (HPC), AI applications, machine learning, deep learning, neural networks, and so on.
The simplest way to implement this computation relies directly on the * and + operators, as follows:
double x = 49.29d;double y = -28.58d;double z = 33.63d;double q = (x * y) + z;
The main problem of this implementation consists of low accuracy and performance caused by two rounding errors (one for the multiply operation and one for the addition operation).
But thanks to Intel AVX's instructions for performing SIMD operations and to JDK 9, which added the Math.fma() method, this computation ...