]> www.ginac.de Git - cln.git/blob - src/real/misc/cl_R_contagion.cc
a02d460b15f27c89808466733fca6fc2c1db9346
[cln.git] / src / real / misc / cl_R_contagion.cc
1 // contagion().
2
3 // General includes.
4 #include "cl_sysdep.h"
5
6 // Specification.
7 #include "cl_R.h"
8
9
10 // Implementation.
11
12 #include "cl_LF.h"
13
14 const cl_R contagion (const cl_R& x, const cl_R& y)
15 {
16 #define X  { return x; }
17 #define Y  { return y; }
18 #if 0
19         if (R_rationalp(x)) Y
20         elif (R_rationalp(y)) X
21         else
22                 floattypecase(x
23                 , X // floattypecase(y, X,X,X,X)
24                 , floattypecase(y, Y,X,X,X)
25                 , floattypecase(y, Y,Y,X,X)
26                 , floattypecase(y, Y,Y,Y,
27                         if (TheLfloat(x)->len <= TheLfloat(y)->len) X else Y
28                         )
29                 );
30 #else // faster type dispatch
31         realtypecase(x
32         ,       Y
33         ,       Y
34         ,       Y
35         ,       X // realtypecase(y, X,X,X, X,X,X,X)
36         ,       realtypecase(y, X,X,X, Y,X,X,X)
37         ,       realtypecase(y, X,X,X, Y,Y,X,X)
38         ,       realtypecase(y, X,X,X, Y,Y,Y,
39                         if (TheLfloat(x)->len <= TheLfloat(y)->len) X else Y
40                         )
41         );
42 #endif
43 }