fn erfc1(x: f32) -> f32 { let s: f32; let p: f32; let q: f32;
s = fabsf(x) - 1.0;
p = PA0 + s * (PA1 + s * (PA2 + s * (PA3 + s * (PA4 + s * (PA5 + s * PA6)))));
q = 1.0 + s * (QA1 + s * (QA2 + s * (QA3 + s * (QA4 + s * (QA5 + s * QA6))))); return1.0 - ERX - p / q;
}
fn erfc2(mut ix: u32, mut x: f32) -> f32 { let s: f32; let r: f32; let big_s: f32; let z: f32;
if ix < 0x3fa00000 { /* |x| < 1.25 */ return erfc1(x);
}
x = fabsf(x);
s = 1.0 / (x * x); if ix < 0x4036db6d { /* |x| < 1/0.35 */
r = RA0 + s * (RA1 + s * (RA2 + s * (RA3 + s * (RA4 + s * (RA5 + s * (RA6 + s * RA7))))));
big_s = 1.0
+ s * (SA1
+ s * (SA2 + s * (SA3 + s * (SA4 + s * (SA5 + s * (SA6 + s * (SA7 + s * SA8)))))));
} else { /* |x| >= 1/0.35 */
r = RB0 + s * (RB1 + s * (RB2 + s * (RB3 + s * (RB4 + s * (RB5 + s * RB6)))));
big_s = 1.0 + s * (SB1 + s * (SB2 + s * (SB3 + s * (SB4 + s * (SB5 + s * (SB6 + s * SB7))))));
}
ix = x.to_bits();
z = f32::from_bits(ix & 0xffffe000);
expf(-z * z - 0.5625) * expf((z - x) * (z + x) + r / big_s) / x
}
/// Error function (f32) /// /// Calculates an approximation to the “error function”, which estimates /// the probability that an observation will fall within x standard /// deviations of the mean (assuming a normal distribution). #[cfg_attr(all(test, assert_no_panic), no_panic::no_panic)] pubfn erff(x: f32) -> f32 { let r: f32; let s: f32; let z: f32; let y: f32; letmut ix: u32; let sign: usize;
ix = x.to_bits();
sign = (ix >> 31) as usize;
ix &= 0x7fffffff; if ix >= 0x7f800000 { /* erf(nan)=nan, erf(+-inf)=+-1 */ return1.0 - 2.0 * (sign as f32) + 1.0 / x;
} if ix < 0x3f580000 { /* |x| < 0.84375 */ if ix < 0x31800000 { /* |x| < 2**-28 */ /*avoid underflow */ return0.125 * (8.0 * x + EFX8 * x);
}
z = x * x;
r = PP0 + z * (PP1 + z * (PP2 + z * (PP3 + z * PP4)));
s = 1.0 + z * (QQ1 + z * (QQ2 + z * (QQ3 + z * (QQ4 + z * QQ5))));
y = r / s; return x + x * y;
} if ix < 0x40c00000 { /* |x| < 6 */
y = 1.0 - erfc2(ix, x);
} else { let x1p_120 = f32::from_bits(0x03800000);
y = 1.0 - x1p_120;
}
if sign != 0 {
-y
} else {
y
}
}
/// Error function (f32) /// /// Calculates the complementary probability. /// Is `1 - erf(x)`. Is computed directly, so that you can use it to avoid /// the loss of precision that would result from subtracting /// large probabilities (on large `x`) from 1. pubfn erfcf(x: f32) -> f32 { let r: f32; let s: f32; let z: f32; let y: f32; letmut ix: u32; let sign: usize;
ix = x.to_bits();
sign = (ix >> 31) as usize;
ix &= 0x7fffffff; if ix >= 0x7f800000 { /* erfc(nan)=nan, erfc(+-inf)=0,2 */ return2.0 * (sign as f32) + 1.0 / x;
}
if ix < 0x3f580000 { /* |x| < 0.84375 */ if ix < 0x23800000 { /* |x| < 2**-56 */ return1.0 - x;
}
z = x * x;
r = PP0 + z * (PP1 + z * (PP2 + z * (PP3 + z * PP4)));
s = 1.0 + z * (QQ1 + z * (QQ2 + z * (QQ3 + z * (QQ4 + z * QQ5))));
y = r / s; if sign != 0 || ix < 0x3e800000 { /* x < 1/4 */ return1.0 - (x + x * y);
} return0.5 - (x - 0.5 + x * y);
} if ix < 0x41e00000 { /* |x| < 28 */ if sign != 0 { return2.0 - erfc2(ix, x);
} else { return erfc2(ix, x);
}
}
let x1p_120 = f32::from_bits(0x03800000); if sign != 0 { 2.0 - x1p_120
} else {
x1p_120 * x1p_120
}
}
Messung V0.5 in Prozent
¤ Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.0.14Bemerkung:
(vorverarbeitet am 2026-06-18)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.