6 static inline void kahaninit(double * const sum
, double * const compensation
) {
11 static inline void kahanadd(double *sum
, double *compensation
, double input
) {
12 double compensated_input
= input
- *compensation
;
13 double nsum
= *sum
+ compensated_input
;
14 *compensation
= (nsum
- *sum
) - compensated_input
;
19 static inline void ckahaninit(complex double * const sum
, complex double * const compensation
) {
24 static inline void ckahanadd(complex double *sum
, complex double *compensation
, complex double input
) {
25 complex double compensated_input
= input
- *compensation
;
26 complex double nsum
= *sum
+ compensated_input
;
27 *compensation
= (nsum
- *sum
) - compensated_input
;