@@ -2844,20 +2844,20 @@ based on:
2844
2844
2845
2845
typedef struct { double hi ; double lo ; } DoubleLength ;
2846
2846
2847
- static inline DoubleLength
2848
- twosum (double a , double b )
2847
+ static DoubleLength
2848
+ dl_sum (double a , double b )
2849
2849
{
2850
- // Rump Algorithm 3.1 Error-free transformation of the sum
2850
+ // Algorithm 3.1 Error-free transformation of the sum
2851
2851
double x = a + b ;
2852
2852
double z = x - a ;
2853
2853
double y = (a - (x - z )) + (b - z );
2854
2854
return (DoubleLength ) {x , y };
2855
2855
}
2856
2856
2857
- static inline DoubleLength
2857
+ static DoubleLength
2858
2858
dl_mul (double x , double y )
2859
2859
{
2860
- // Rump Algorithm 3.5. Error-free transformation of a product
2860
+ // Algorithm 3.5. Error-free transformation of a product
2861
2861
double z = x * y ;
2862
2862
double zz = fma (x , y , - z );
2863
2863
return (DoubleLength ) {z , zz };
@@ -2867,21 +2867,21 @@ typedef struct { double hi; double lo; double tiny; } TripleLength;
2867
2867
2868
2868
static const TripleLength tl_zero = {0.0 , 0.0 , 0.0 };
2869
2869
2870
- static inline TripleLength
2870
+ static TripleLength
2871
2871
tl_fma (TripleLength total , double x , double y )
2872
2872
{
2873
- // Rump Algorithm 5.10 with K=3 and using SumKVert
2873
+ // Algorithm 5.10 with SumKVert for K=3
2874
2874
DoubleLength pr = dl_mul (x , y );
2875
- DoubleLength sm = twosum (total .hi , pr .hi );
2876
- DoubleLength r1 = twosum (total .lo , pr .lo );
2877
- DoubleLength r2 = twosum (r1 .hi , sm .lo );
2875
+ DoubleLength sm = dl_sum (total .hi , pr .hi );
2876
+ DoubleLength r1 = dl_sum (total .lo , pr .lo );
2877
+ DoubleLength r2 = dl_sum (r1 .hi , sm .lo );
2878
2878
return (TripleLength ) {sm .hi , r2 .hi , total .tiny + r1 .lo + r2 .lo };
2879
2879
}
2880
2880
2881
- static inline double
2881
+ static double
2882
2882
tl_to_d (TripleLength total )
2883
2883
{
2884
- DoubleLength last = twosum (total .lo , total .hi );
2884
+ DoubleLength last = dl_sum (total .lo , total .hi );
2885
2885
return total .tiny + last .lo + last .hi ;
2886
2886
}
2887
2887
0 commit comments