/**
 * Dot product of vectors
 */
float dot_product(float *x, const int length, ...) {
    va_list w;
    float product = 0.0;

    va_start(w, length);

    for (uint16_t i = 0; i < length; i++)
        product += x[i] * va_arg(w, float);

    return product;
}