AMD k6-2 可能存在反正切函数(atan)的计算bug!
AMD k6-2 可能存在反正切函数(atan)的计算bug,之所以强调是Bug,而非误差,因为<BR>这种误差是一般的科学及工程运算所不允许的。<BR>有AMD k6-2配置(或其他AMD CPU)的朋友可以用下面的VB程序检测:<BR>//////////////////////////////////<BR>Option ExplicitPrivate Sub Form_Load()<BR>Dim tmp As Double<BR>Dim i As Integer
For i = 2 To 9<BR> tmp = Atn(i)<BR> Debug.Print "Atn("; i; ")="; tmp<BR>Next<BR>For i = 2 To 9<BR> tmp = Atn(1# / i)<BR> Debug.Print "Atn(1/"; i; ")="; tmp<BR>Next<BR>End Sub<BR>////////////////////////////////////////<BR>结果如下的话,说明存在问题。<BR>'Atn(2) = 1.10450485840703 准确值应为:1.1071487177940905030170654601785<BR>'Atn(3) = 1.25168963178531 准确值应为:1.2490457723982544258299170772811<BR>'Atn(4) = 1.3269608858051 准确值应为:1.3258176636680324650592392104285<BR>'Atn(5) = 1.37399179476569 准确值应为:1.373400766945015860861271926445<BR>'Atn(6) = 1.40599130001239 准确值应为:1.4056476493802697809521934019958<BR>'Atn(7) = 1.429116256735 准确值应为:1.4288992721907326964184700745372<BR>'Atn(8) = 1.44658693326198 准确值应为:1.4464413322481351841999668424759<BR>'Atn(9) = 1.46024147677083 准确值应为:1.4601391056210009726721818194297<BR>'Atn(1 / 2) = 0.466291468387864 准确值应为:0.46364760900080611621425623146121<BR>'Atn(1 / 3) = 0.319106695009585 准确值应为:0.32175055439664219340140461435866<BR>'Atn(1 / 4) = 0.243835440989801 准确值应为:0.24497866312686415417208248121128<BR>'Atn(1 / 5) = 0.196804532029208 准确值应为:0.19739555984988075837004976519479<BR>'Atn(1 / 6) = 0.164805026782504 准确值应为:0.16514867741462683827912828964394<BR>'Atn(1 / 7) = 0.141680070059894 准确值应为:0.14189705460416392281285161710255<BR>'Atn(1 / 8) = 0.124209393532913 准确值应为:0.12435499454676143503135484916387<BR>'Atn(1 / 9) = 0.110554850024066 准确值应为:0.11065722117389564655913987221006<BR>
页:
[1]