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