@@ -1229,6 +1229,7 @@ impl f128 {
12291229 #[ inline]
12301230 #[ rustc_allow_incoherent_impl]
12311231 #[ unstable( feature = "f128" , issue = "116909" ) ]
1232+ // #[unstable(feature = "float_gamma", issue = "99842")]
12321233 #[ must_use = "method returns a new number and does not mutate the original value" ]
12331234 pub fn gamma ( self ) -> f128 {
12341235 unsafe { cmath:: tgammaf128 ( self ) }
@@ -1263,10 +1264,74 @@ impl f128 {
12631264 #[ inline]
12641265 #[ rustc_allow_incoherent_impl]
12651266 #[ unstable( feature = "f128" , issue = "116909" ) ]
1267+ // #[unstable(feature = "float_gamma", issue = "99842")]
12661268 #[ must_use = "method returns a new number and does not mutate the original value" ]
12671269 pub fn ln_gamma ( self ) -> ( f128 , i32 ) {
12681270 let mut signgamp: i32 = 0 ;
12691271 let x = unsafe { cmath:: lgammaf128_r ( self , & mut signgamp) } ;
12701272 ( x, signgamp)
12711273 }
1274+
1275+ /// Error function.
1276+ ///
1277+ /// # Unspecified precision
1278+ ///
1279+ /// The precision of this function is non-deterministic. This means it varies by platform, Rust version, and
1280+ /// can even differ within the same execution from one invocation to the next.
1281+ /// This function currently corresponds to the `erff128` from libc on Unix
1282+ /// and Windows. Note that this might change in the future.
1283+ ///
1284+ /// # Examples
1285+ ///
1286+ /// ```
1287+ /// #![feature(f128)]
1288+ /// #![feature(float_erf)]
1289+ /// # #[cfg(reliable_f128_math)] {
1290+ /// let x: f128 = 1.0;
1291+ ///
1292+ /// let abs_difference = (x.erf() - 0.8427007929497148693412206350826093).abs();
1293+ ///
1294+ /// assert!(abs_difference <= f128::EPSILON);
1295+ /// # }
1296+ /// ```
1297+ #[ rustc_allow_incoherent_impl]
1298+ #[ must_use = "method returns a new number and does not mutate the original value" ]
1299+ #[ unstable( feature = "f128" , issue = "116909" ) ]
1300+ // #[unstable(feature = "float_erf", issue = "136321")]
1301+ #[ inline]
1302+ pub fn erf ( self ) -> f128 {
1303+ unsafe { cmath:: erff128 ( self ) }
1304+ }
1305+
1306+ /// Complementary error function.
1307+ ///
1308+ /// # Unspecified precision
1309+ ///
1310+ /// The precision of this function is non-deterministic. This means it varies by platform, Rust version, and
1311+ /// can even differ within the same execution from one invocation to the next.
1312+ /// This function currently corresponds to the `erfcf128` from libc on Unix
1313+ /// and Windows. Note that this might change in the future.
1314+ ///
1315+ /// # Examples
1316+ ///
1317+ /// ```
1318+ /// #![feature(f128)]
1319+ /// #![feature(float_erf)]
1320+ /// # #[cfg(reliable_f128_math)] {
1321+ /// let x: f128 = 0.123;
1322+ ///
1323+ /// let one = x.erf() + x.erfc();
1324+ /// let abs_difference = (one - 1.0).abs();
1325+ ///
1326+ /// assert!(abs_difference <= f128::EPSILON);
1327+ /// # }
1328+ /// ```
1329+ #[ rustc_allow_incoherent_impl]
1330+ #[ must_use = "method returns a new number and does not mutate the original value" ]
1331+ #[ unstable( feature = "f128" , issue = "116909" ) ]
1332+ // #[unstable(feature = "float_erf", issue = "136321")]
1333+ #[ inline]
1334+ pub fn erfc ( self ) -> f128 {
1335+ unsafe { cmath:: erfcf128 ( self ) }
1336+ }
12721337}
0 commit comments