@@ -26,13 +26,6 @@ arb_fma_arf(arb_t res, const arb_t x, const arf_t y, const arb_t z, slong prec)
2626 else
2727 mag_set (arb_radref (res ), arb_radref (z ));
2828 }
29- else if (arf_is_inf (y ) && arb_is_nonzero (x ))
30- {
31- if (arf_sgn (arb_midref (x )) > 0 )
32- arb_add_arf (res , z , y , prec );
33- else
34- arb_sub_arf (res , z , y , prec );
35- }
3629 else if (ARB_IS_LAGOM (res ) && ARB_IS_LAGOM (x ) && ARF_IS_LAGOM (y ) && ARB_IS_LAGOM (z ))
3730 {
3831 mag_t tm ;
@@ -46,6 +39,13 @@ arb_fma_arf(arb_t res, const arb_t x, const arf_t y, const arb_t z, slong prec)
4639 if (inexact )
4740 arf_mag_fast_add_ulp (arb_radref (res ), arb_radref (res ), arb_midref (res ), prec );
4841 }
42+ else if (arf_is_inf (y ) && arb_is_nonzero (x ))
43+ {
44+ if (arf_sgn (arb_midref (x )) > 0 )
45+ arb_add_arf (res , z , y , prec );
46+ else
47+ arb_sub_arf (res , z , y , prec );
48+ }
4949 else
5050 {
5151 mag_t tm ;
@@ -80,20 +80,6 @@ arb_fma(arb_t res, const arb_t x, const arb_t y, const arb_t z, slong prec)
8080 {
8181 arb_fma_arf (res , y , arb_midref (x ), z , prec );
8282 }
83- else if (arf_is_inf (arb_midref (x )) && mag_is_finite (arb_radref (x )) && arb_is_nonzero (y ))
84- {
85- if (arf_sgn (arb_midref (y )) > 0 )
86- arb_add_arf (res , z , arb_midref (x ), prec );
87- else
88- arb_sub_arf (res , z , arb_midref (x ), prec );
89- }
90- else if (arf_is_inf (arb_midref (y )) && mag_is_finite (arb_radref (y )) && arb_is_nonzero (x ))
91- {
92- if (arf_sgn (arb_midref (x )) > 0 )
93- arb_add_arf (res , z , arb_midref (y ), prec );
94- else
95- arb_sub_arf (res , z , arb_midref (y ), prec );
96- }
9783 else if (ARB_IS_LAGOM (res ) && ARB_IS_LAGOM (x ) && ARB_IS_LAGOM (y ) && ARB_IS_LAGOM (z ))
9884 {
9985 mag_fast_init_set_arf (xm , arb_midref (x ));
@@ -112,6 +98,20 @@ arb_fma(arb_t res, const arb_t x, const arb_t y, const arb_t z, slong prec)
11298
11399 * arb_radref (res ) = * zr ;
114100 }
101+ else if (arf_is_inf (arb_midref (x )) && mag_is_finite (arb_radref (x )) && arb_is_nonzero (y ))
102+ {
103+ if (arf_sgn (arb_midref (y )) > 0 )
104+ arb_add_arf (res , z , arb_midref (x ), prec );
105+ else
106+ arb_sub_arf (res , z , arb_midref (x ), prec );
107+ }
108+ else if (arf_is_inf (arb_midref (y )) && mag_is_finite (arb_radref (y )) && arb_is_nonzero (x ))
109+ {
110+ if (arf_sgn (arb_midref (x )) > 0 )
111+ arb_add_arf (res , z , arb_midref (y ), prec );
112+ else
113+ arb_sub_arf (res , z , arb_midref (y ), prec );
114+ }
115115 else
116116 {
117117 mag_init_set_arf (xm , arb_midref (x ));
0 commit comments