tie、probabilistic / 非公式訳

/プラババスティク/

p.22

The second option, called round to nearest with ties rounded to nearest even, is more interesting; when a tie occurs, it rounds the result to the nearest even value (when rounding to an integer), or, more generally, to the nearest value whose rightmost bit is zero (hence the "round to even" designation). As shown in the examples of table1.1, 3.5 and 4.5 would both be rounded to 4. Because of this "probabilistic" up/down rounding, the accumulated error due to truncation in the case of successive computations gets reduced.

非公式訳:
もう1つの方式は「最近接偶数への丸め(一番近い値に丸めるが、どっちつかずの場合は一番近い偶数に丸める)」と呼ばれていて、このほうが、1つ目の方式よりも面白い。どっちつかずの状態になったら、(整数に丸めるときは)一番近い偶数値に丸めるという方式である。もっと一般化して表現すれば、右端ビットが0である最近値に丸めるということである(そこから「偶数への丸め」と呼ばれる)。表1.1の例に示したように、3.5、4.5はどちらも4に丸められる。このように、どっちつかずのときに切り上げと切り捨てとが同じ確率で出現するため、連続して計算する場合に、切り捨て(truncation)に起因する累積誤差が減る。

―――――――――――――――――――――――――――――

  • Python:
    偶数への丸め
    f:id:ti-nspire:20210317091333p:plain
    f:id:ti-nspire:20210316145057p:plain

  • C:
    roundは四捨五入
    nearbyintは偶数への丸め

#include <iostream>
#include <cmath>
using namespace std;
int main(void){
    float a = 3.5;
    float b = 4.5;
    float c = 5.5;
    printf("%.0f, %.0f, %.0f\n", round(a), round(b), round(c));
    printf("%.0f, %.0f, %.0f\n", nearbyint(a), nearbyint(b), nearbyint(c));
    
    return 0;
}

f:id:ti-nspire:20210316181110p:plain

  • LabVIEW:
    偶数への丸め
    f:id:ti-nspire:20210316182412p:plain

  • Wolfram:
    偶数への丸め
    f:id:ti-nspire:20210316182831p:plain

  • TI-Nspire:
    四捨五入
    f:id:ti-nspire:20210316183230p:plain

  • Excel:
    四捨五入
    f:id:ti-nspire:20210316190637p:plain