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