stdBLAS
stdBLAS copied to clipboard
P1673: `vector_norm2`: should `init` be inside or outside the `sqrt`?
In the impl we have:
// Compute the sum of squares using an algorithm that avoids
// underflow and overflow by scaling.
auto ssq_res = vector_sum_of_squares(exec, x, ssq_init);
using std::sqrt;
return init + ssq_res.scaling_factor * sqrt(ssq_res.scaled_sum_of_squares);
}
but in the spec we have:
For N equal to v.extent(0), the mathematical expression for the algorithm is sqrt(init + s),
In P1673R7 (to be submitted tonight), I added wording to the spec to clarify init.