
bfloat16 round-trip and range report (Geron Appendix B, morie.fn grbf16)
Source:R/geron_ml_native.R
morie_geron_bf16_range.RdSame ties-to-even rounding as morie_geron_bf16(), with grbf16's
range diagnostics: bf16 shares fp32's exponent range, so overflow is
rare and the cost is precision (machine epsilon 2^-7). NaN input is
rejected here, unlike hmbf16.
Value
List with bf16, abs_error, rel_error, max_rel_error,
machine_eps, max_normal, min_normal, n_overflow,
n_underflow, exact.
Examples
V <- c(1, 2, 3, 4, 5, 6, 7, 8)
morie_geron_bf16_range(V)
#> $bf16
#> [1] 1 2 3 4 5 6 7 8
#>
#> $abs_error
#> [1] 0 0 0 0 0 0 0 0
#>
#> $rel_error
#> [1] 0 0 0 0 0 0 0 0
#>
#> $max_rel_error
#> [1] 0
#>
#> $machine_eps
#> [1] 0.0078125
#>
#> $max_normal
#> [1] 3.389531e+38
#>
#> $min_normal
#> [1] 1.175494e-38
#>
#> $n_overflow
#> [1] 0
#>
#> $n_underflow
#> [1] 0
#>
#> $exact
#> [1] TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE
#>
#> $estimate
#> [1] 0
#>
#> $n
#> [1] 8
#>
#> $method
#> [1] "bfloat16 round-trip and range analysis"
#>