ãªããªã34æ¡ç®ã¾ã§åããã¨ããã®ã¯è¦å´ãä¼´ãã
ã¨ããããMathContextã«69æ¡ãããè¨å®ãããããªãã¨ãè¨ç®åºæ¥ãã£ã½ãã
å¹³æ¹æ ¹ã®è¨ç®ã§æ¤ç®ããªãããã£ã¦ã¿ãã
9.99999999999999999999999999999999999997E6144ã®å¹³æ¹æ ¹ã®é£æ度ãé«ãã
æ¤ç®(2ä¹)ããã¨å
é ãã68æ¡ç®ã«ããããªå·®ãåºãããã ã
68æ¡ç®ã¾ã§è¨ç®ãã¦ããã¨ï½¥ï½¥ï½¥ï½¥ã
åºæ¥ãã ã10é²æ°ã§è¨ç®ãããã®ã§å±éãã¦ãã
å²ãç®ãåä»ãªèª¤å·®ãçããã ãããªãã
ããããææ°é¢æ°ãJavaã§å®è£
ãã¦ãã
å½ç¶å²ãç®ãåºã¦ãããã誤差ã¯åºãã
ãããã対æ°é¢æ°ãå®è£
ãã¦ãã
ãã ããããã¯xã®ç¯å²ã«å¶éãããã®ã§ãã®è¨ç®ã¯åºæ¥ãªãã
ãæ±ããã®ã«ã¯ãã¡ãã®å¼ã使ã£ã¦æ±ãã¦ãã
ãã®å¼ã大äºã ãxã®å°æ°ç¹ä½ç½®ã調æ´ãããã¨ã§ãmãå°ãããã¦ãxã®ç¯å²ãããæ¹ã®è¨ç®å¼ã§ã¾ã¨ããããããã«ããã
ã¾ããå½ç¶ã®ãã¨ãªãããå
ã«è¨ç®ãã¦ãããã¨ã§ãå¤å°ã®æ¼ç®æéã®ç縮ãçããï¼ï¼
ãããã©ã¡ããã¨ããã¨ããäºåã«æºåãã¦ããã¨ããç¹æ§ãèãã¦ã
ã ããã¡ããã¡ãé«ã精度ã§è¨ç®ãæ¸ã¾ãã¦ãããã¨ã§ã精度ã®åä¸ã«ç¹ããã ããã
ãã¡ããæå¹æ¡100æ¡ã§è¨ç®ãããã¨ã«æåãã¦ããã®ã§ã
ãã®æååãã¹ããã¯ãã¦ãããã¨ã§ãJVMãããã度ã«è¨ç®ãç´ãå¿
è¦ã¯ãªããªãã ããã
ãã®è¨ç®å¼ã¯mã1ããå°ããå¤ã¾ã§å°æ°ç¹ã調æ´ããããã«èãã¦ããã®ã§ãã®è¨ç®çµæã¯å¿
ããã¤ãã¹å¤ã«ãªãã
ãµããã ããã©ãããã£ã¦ãã ãããã©ã34æ¡ç®ã«ç´çµããè¦ç´ ãæ¢ãã¦ãã ãã ã»ã»ã»ã
ææ°é¢æ°ã§ã®è¨ç®ããããæå¹æ¡æ°ã大äºãªãã ã¨æãã
ãã®å¼ã«ããã¦ãææ°é¨åã¯ãæ´æ°é¨ã¨å°æ°é¨ã«å解ããã
10ã®æ´æ°ä¹ã¯ã¹ã±ã¼ã«ã§è§£æ±ºåºæ¥ãã®ã§ãæå¹æ¡ã«ã¯ç´çµããªãã
ã¤ã¾ãã¯10ã®ç´¯ä¹ã«ãããææ°é¨åã1æªæºã®è¨ç®ã大äºã
å®ã¯ããã¯åºeã®ææ°é¢æ°ã«æ»ãã¦è¨ç®ãã¦ããã
ããã§eã®ææ°é¨åã«ããæ°åã®æ¡æ°æ¬¡ç¬¬ã§ãä½æ¡ç®ã¾ã§è¨ç®ãã¦ãã®ããå·¦å³ãããã
ããã¯ææ°é¢æ°ã®ä¸èº«ãè¦ãã°ãããã
èªåã®å ´åã¯æä½ã§ã34ãã©ã¹ã¢ã«ãã¡ã®æ¡ã§ä¸ãã¦ããã
2ä¹ã§68æ¡ã3ä¹ã§102æ¡ã4ä¹ã§136æ¡ã5ä¹ã§170æ¡ã6ä¹ã§204æ¡ã
ãã ãå
é 34æ¡ç®ã«å½±é¿ãä¸ããªãç´¯ä¹ã®æ°ã6ä¹ã§ååãã¨ããã¨ããã§ã¯ãªãã
0.9ã§èãã¦ã¿ãã
n= 0,x^n/n!=1
n= 1,x^n/n!=0.9
n= 2,x^n/n!=0.405
n= 3,x^n/n!=0.1215
n= 4,x^n/n!=0.0273375
n= 5,x^n/n!=0.00492075
n= 6,x^n/n!=0.0007381125
n= 7,x^n/n!=0.000094900178571428571428571428571429 (9.4900178571428571428571428571429e-5)
n= 8,x^n/n!=0.000010676270089285714285714285714286 (1.0676270089285714285714285714286e-5)
n= 9,x^n/n!=0.0000010676270089285714285714285714286 (1.0676270089285714285714285714286e-6)
n=10,x^n/n!=0.000000096086430803571428571428571428571 (9.6086430803571428571428571428571e-8)
n=11,x^n/n!=0.0000000078616170657467532467532467532468 (7.8616170657467532467532467532468e-9)
ããã¤ãã足ãã¦ããããã¤ç®æ¨ã®æå¹æ¡ã§ã®ä¸¸ãã«å·®ãåºãªãã¨ããã¾ã§è¨ç®ããã®ãã
éæ¹ãç¡ãã
å²ãåããªãã¦èª¤å·®ãåºã¦ãé¨åããããã ããªããã£ã¨ã
ãã¨è¨ã£ã¦ããã¡ãã®å
¬å¼ã§æ±ããã®ã¯éå¹çããããï¼
ããã»ã©ã®0.9ã®å®é¨ãããè¨ããã®ã ããnã10ãè¶
ããã¨ãå¿
ãæä½1æ¡ã¯æ¸ã£ã¦ããã
ã¨ããã¨ãn=34+10ã¨ãn=34+11ããããè¨ç®ãã¦ã丸ãã¦ã¿ãã¨ããã¢ãªãã
ãã¨ãçµé¨åã§ã¯ããããæå¹æ¡34æ¡ãç®åºããéã«ã¯3æ¡ä½åãªç²¾åº¦ãä¸ããã¨ã
大åã®è¨ç®ã¯æ£ããçããå°ãåºãããå®ç§ã«ã§ã¯ãªãã
ããã¯ãjava.math.BigDecimal#pow(int,MathContext)ã®èª¬æã®ä¸ã«ããã
mc.precision()+elength+1ã®å
容ã¨ä¸è´ãã¦ãããªã¨æããã
ãã ãããã¯æ´æ°ä¹ããããªãããã大åã®ç¢ºçãã ãã¶éãã®ã ããã
ãã®ã¡ã½ããã¯2ulp以å
ã®èª¤å·®ãè¿°ã¹ã¦ãããã©ã
ãã¾ã®ã¨ããåã®ã¯1ulpã®èª¤å·®ããã¾ã«è¦ã¤ããç¨åº¦ã ãå½ç¶ãã¡ããã¡ãè¨ç®ãã¦é
ãã®ã ãã
ã¾ã ã¾ã ãããªãã¨ãããªããã¨ã¯ããããã ã
xã®å¤ã1æªæºãªãexpm1ãå®è£
ãã¦ãããæ¹ãããããã ã
ã©ããããã ããã
ããããªã
ã¾ãããã£ã¦ã¿ããã