condnb_sumcond — Computes the condition number of the sum function.
[c,y] = condnb_sumcond ( x )
a n-by-m matrix of doubles
a n-by-m matrix of doubles, the condition number
a n-by-m, matrix of doubles, the function values
Computes the condition number of the sum function. The sum function has a large condition number if the sum is small, but the values are of opposite sign and of very different magnitudes.
where
// A badly conditionned sum, with inaccurate result xl = 10^(1:15); x = [-xl xl+0.1]; [c,y] = condnb_sumcond ( x ) expected = 1.5 // A badly conditionned sum, with accurate result ! // The bad conditionning does not imply that the result is not accurate. xl = 10^(1:15); x = [-xl xl]; [c,y] = condnb_sumcond ( x ) expected = 0