@@ -2835,10 +2835,6 @@ long_add_would_overflow(long a, long b)
2835
2835
Double and triple length extended precision floating point arithmetic
2836
2836
based on:
2837
2837
2838
- A Floating-Point Technique for Extending the Available Precision
2839
- by T. J. Dekker
2840
- https://csclub.uwaterloo.ca/~pbarfuss/dekker1971.pdf
2841
-
2842
2838
Accurate Sum and Dot Product
2843
2839
by Takeshi Ogita, Siegfried M. Rump, and Shin’Ichi Oishi
2844
2840
https://doi.org/10.1137/030601818
@@ -2858,26 +2854,12 @@ twosum(double a, double b)
2858
2854
return (DoubleLength ) {x , y };
2859
2855
}
2860
2856
2861
- static inline DoubleLength
2862
- dl_split (double x ) {
2863
- // Rump Algorithm 3.2 Error-free splitting of a floating point number
2864
- // Dekker (5.5) and (5.6).
2865
- double t = x * 134217729.0 ; // Veltkamp constant = 2.0 ** 27 + 1
2866
- double hi = t - (t - x );
2867
- double lo = x - hi ;
2868
- return (DoubleLength ) {hi , lo };
2869
- }
2870
-
2871
2857
static inline DoubleLength
2872
2858
dl_mul (double x , double y )
2873
2859
{
2874
- // Dekker (5.12) and mul12()
2875
- DoubleLength xx = dl_split (x );
2876
- DoubleLength yy = dl_split (y );
2877
- double p = xx .hi * yy .hi ;
2878
- double q = xx .hi * yy .lo + xx .lo * yy .hi ;
2879
- double z = p + q ;
2880
- double zz = p - z + q + xx .lo * yy .lo ;
2860
+ // Rump Algorithm 3.5. Error-free transformation of a product
2861
+ double z = x * y ;
2862
+ double zz = fma (x , y , - z );
2881
2863
return (DoubleLength ) {z , zz };
2882
2864
}
2883
2865
0 commit comments