@@ -1362,4 +1362,54 @@ impl f128 {
13621362 // SAFETY: this is actually a safe intrinsic
13631363 unsafe { intrinsics:: copysignf128 ( self , sign) }
13641364 }
1365+
1366+ /// Float addition that allows optimizations based on algebraic rules.
1367+ ///
1368+ /// See [algebraic operators](primitive@f32#algebraic-operators) for more info.
1369+ #[ must_use = "method returns a new number and does not mutate the original value" ]
1370+ #[ unstable( feature = "float_algebraic" , issue = "136469" ) ]
1371+ #[ inline]
1372+ pub fn algebraic_add ( self , rhs : f128 ) -> f128 {
1373+ intrinsics:: fadd_algebraic ( self , rhs)
1374+ }
1375+
1376+ /// Float subtraction that allows optimizations based on algebraic rules.
1377+ ///
1378+ /// See [algebraic operators](primitive@f32#algebraic-operators) for more info.
1379+ #[ must_use = "method returns a new number and does not mutate the original value" ]
1380+ #[ unstable( feature = "float_algebraic" , issue = "136469" ) ]
1381+ #[ inline]
1382+ pub fn algebraic_sub ( self , rhs : f128 ) -> f128 {
1383+ intrinsics:: fsub_algebraic ( self , rhs)
1384+ }
1385+
1386+ /// Float multiplication that allows optimizations based on algebraic rules.
1387+ ///
1388+ /// See [algebraic operators](primitive@f32#algebraic-operators) for more info.
1389+ #[ must_use = "method returns a new number and does not mutate the original value" ]
1390+ #[ unstable( feature = "float_algebraic" , issue = "136469" ) ]
1391+ #[ inline]
1392+ pub fn algebraic_mul ( self , rhs : f128 ) -> f128 {
1393+ intrinsics:: fmul_algebraic ( self , rhs)
1394+ }
1395+
1396+ /// Float division that allows optimizations based on algebraic rules.
1397+ ///
1398+ /// See [algebraic operators](primitive@f32#algebraic-operators) for more info.
1399+ #[ must_use = "method returns a new number and does not mutate the original value" ]
1400+ #[ unstable( feature = "float_algebraic" , issue = "136469" ) ]
1401+ #[ inline]
1402+ pub fn algebraic_div ( self , rhs : f128 ) -> f128 {
1403+ intrinsics:: fdiv_algebraic ( self , rhs)
1404+ }
1405+
1406+ /// Float remainder that allows optimizations based on algebraic rules.
1407+ ///
1408+ /// See [algebraic operators](primitive@f32#algebraic-operators) for more info.
1409+ #[ must_use = "method returns a new number and does not mutate the original value" ]
1410+ #[ unstable( feature = "float_algebraic" , issue = "136469" ) ]
1411+ #[ inline]
1412+ pub fn algebraic_rem ( self , rhs : f128 ) -> f128 {
1413+ intrinsics:: frem_algebraic ( self , rhs)
1414+ }
13651415}
0 commit comments