{"id":1245,"date":"2012-02-08T20:34:54","date_gmt":"2012-02-08T12:34:54","guid":{"rendered":"http:\/\/leybreeze.com\/blog\/?p=1245"},"modified":"2012-02-08T20:34:54","modified_gmt":"2012-02-08T12:34:54","slug":"go-for-it-2-%e5%ae%9f%e6%95%b0%e3%81%ae%e9%9a%8e%e4%b9%97","status":"publish","type":"post","link":"http:\/\/leybreeze.com\/blog\/?p=1245","title":{"rendered":"[ GO FOR IT ] 2) \u5b9f\u6570\u306e\u968e\u4e57"},"content":{"rendered":"<p><strong>\u554f\u984c\uff1a<\/strong><\/p>\n<p>\u3042\u308b\u691c\u7d22\u30b5\u30a4\u30c8\u306b5!\u3068\u5165\u529b\u3059\u308b\u3068\u305d\u306e\u8a08\u7b97\u7d50\u679c\u3067\u3042\u308b120\u304c\u8868\u793a\u3055\u308c\u307e\u3059\u3002<br \/>\n\u305d\u306e\u691c\u7d22\u30b5\u30a4\u30c8\u306b2.5!\u3068\u5165\u529b\u3059\u308b\u3068\u306a\u3093\u30683.32335097\u3068\u8868\u793a\u3055\u308c\u307e\u3059\u3002<br \/>\n\u3055\u3089\u306b\u305d\u306e\u691c\u7d22\u30b5\u30a4\u30c8\u306b(-1.9)!\u3068\u5165\u529b\u3059\u308b\u3068-10.5705641\u3068\u8868\u793a\u3055\u308c\u307e\u3059\u3002<br \/>\n\u304d\u3063\u3068\u305d\u308c\u3089\u306e\u4ed5\u7d44\u307f\u306f\u3068\u3066\u3082\u96e3\u3057\u304f\u3066\u4f01\u696d\u79d8\u5bc6\u306b\u9055\u3044\u306a\u3044\u306e\u3067\u662f\u975e\u3068\u3082\u3053\u308c\u3089\u3092\u5b9f\u884c\u3059\u308b\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u4f5c\u3063\u3066\u307b\u3057\u3044\u3002<br \/>\n\u305f\u3060\u3057\u3001\u541b\u306ePC\u306f\u53e4\u3044\u306e\u3067\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u3084\u4fbf\u5229\u3067\u9ad8\u5ea6\u306a\u6570\u5b66\u95a2\u6570\u306f\u5165\u3063\u3066\u3044\u307e\u305b\u3093\u3002<br \/>\n\u5165\u3063\u3066\u3044\u308b\u6570\u5b66\u95a2\u6570\u306fsin,cos,tan,log,pow,floor\u306a\u3069\u306e\u521d\u6b69\u7684\u306a\u95a2\u6570\u306e\u307f\u3067\u3059\u3001\u6b8b\u5ff5\u306a\u304c\u3089\u3002 <\/p>\n<p>i)\u5165\u529b\u3055\u308c\u305f\u6574\u6570a(0<=a<=10)\u306e\u968e\u4e57\u3092\u6c42\u3081\u308b\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u4f5c\u3063\u3066\u304f\u3060\u3055\u3044\u3002\nii)\u5165\u529b\u3055\u308c\u305f\u5b9f\u6570a(0<=a<=10)\u306e\u968e\u4e57\u3092\u6c42\u3081\u308b\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u4f5c\u3063\u3066\u304f\u3060\u3055\u3044\u3002\niii)\u5165\u529b\u3055\u308c\u305f\u5b9f\u6570a(-1.9<=a<=-1.1)\u306e\u968e\u4e57\u3092\u6c42\u3081\u308b\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u4f5c\u3063\u3066\u304f\u3060\u3055\u3044\u3002\n\n<strong>\u56de\u7b54\uff08C++\u30d7\u30ed\u30b0\u30e9\u30e0\u30b3\u30fc\u30c9\uff09\uff1a<\/strong><\/p>\n<pre lang=\"Cpp\">\r\n#include<cstdio>\r\n#include<cmath>\r\n#include<cstdlib>\r\n#include<iostream>\r\n#include <complex>\r\n\r\nusing namespace std;\r\n\r\n\/\/ define the constants\r\nstatic const int g=7;\r\nstatic const double pi =3.1415926535897932384626433832795028841972 ;\r\nstatic const double p[g+2] = {0.99999999999980993, 676.5203681218851,\r\n-1259.1392167224028, 771.32342877765313, -176.61502916214059,\r\n12.507343278686905, -0.13857109526572012, 9.9843695780195716e-6,\r\n1.5056327351493116e-7};\r\n\r\n\/\/ define the Lanczos_approximation of gamma function\r\ncomplex<double> gamma( complex<double> z)\r\n{\r\n\tif ( real(z)<0.5 ) \r\n\t{\r\n\t\treturn pi \/ (sin(pi*z)*gamma(1.0-z));\r\n\t}\r\n\tz -= 1.0;\r\n\tcomplex<double> x=p[0];\r\n\tfor (int i=1; i<g+2; i++) \r\n\t{\r\n\t\tx += p[i]\/(z+complex<double>(i,0));\r\n\t}\r\n\tcomplex<double> t = z + (g + 0.5);\r\n\treturn sqrt(2*pi) * pow(t,z+0.5) * exp(-t) * x;\r\n}\r\n\r\nint main()\r\n{\r\n\tdouble r,i;\r\n\tcout<<\"Please input the real part of the complex number:\"<<endl;\r\n\tcin>>r;\r\n\tcout<<\"Please input the imaginary number of the complex number:\"<<endl;\r\n\tcin>>i;\r\n\tcout << \"The factorial of \"<<complex<double>(r,i)<<\" is \"<<gamma(complex<double>(r+1,i)) << endl; \r\n\tsystem(\"PAUSE\");\r\n\treturn 0;\r\n}\r\n<\/pre>\n<p><strong>\u30d7\u30ed\u30b0\u30e9\u30e0\u30b3\u30fc\u30c9\uff1aLifeClock.cpp<\/strong><br \/>\nURL: http:\/\/leybreeze.com\/blog\/wp-content\/uploads\/2012\/02\/RealNumberFactorial.cpp<\/p>\n<p><strong>\u56de\u7b54\u3067\u304d\u305f\u554f\u984c\u306e\u51fa\u529b\uff1a<\/strong><br \/>\n\u5165\u529b\u306b\u3088\u3063\u3066\u9055\u3044\u307e\u3059\u3002<\/p>\n<p><strong>\u30a2\u30eb\u30b4\u30ea\u30ba\u30e0\u306e\u7c21\u5358\u306a\u8aac\u660e\uff1a<\/strong><br \/>\n\u5b9f\u6570\u306e\u968e\u4e57\u3068\u8a00\u3046\u3068\u3001\u30ac\u30f3\u30de\u95a2\u6570\u306e\u3053\u3068\u3067\u3059\u3002<br \/>\n\u4f7f\u7528\u53ef\u80fd\u306a\u6570\u5b66\u95a2\u6570\u306fsin,cos,tan,log,pow,floor\u306a\u3069\u306e\u521d\u6b69\u7684\u306a\u95a2\u6570\u306e\u307f\u3067\u3059\u304b\u3089\u3001Lanczos approximation\u3068\u3044\u3046\u306e\u8fd1\u4f3c\u6cd5\u306f\u4f7f\u3048\u307e\u3059\u3002<br \/>\n(\u3054\u53c2\u8003\u307e\u3067\uff1ahttp:\/\/en.wikipedia.org\/wiki\/Lanczos_approximation\u3000)<\/p>\n<p><strong>\u5b9f\u884c\u65b9\u6cd5\uff1a<\/strong>RealNumberFactorial.exe\u3000\uff08msvcp100d.dll\u306f\u5fc5\u8981\u3067\u3059\u3002\uff09\u5b9f\u884c\u3057\u3066\u5b9f\u6570\u306e\u5b9f\u90e8\u3068\u865a\u90e8\u3092\u5165\u529b\u3057\u3066\u304f\u3060\u3055\u3044<br \/>\nURL: http:\/\/leybreeze.com\/blog\/wp-content\/uploads\/2012\/02\/RealNumberFactorial.exe<\/p>\n<p><strong>\u5b9f\u884c\u74b0\u5883\uff1a<\/strong>Windows XP\/Vista\/7<\/p>\n<p><strong>\u30e9\u30a4\u30bb\u30f3\u30b9\uff1a<\/strong>GPLv3<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u554f\u984c\uff1a \u3042\u308b\u691c\u7d22\u30b5\u30a4\u30c8\u306b5!\u3068\u5165\u529b\u3059\u308b\u3068\u305d\u306e\u8a08\u7b97\u7d50\u679c\u3067\u3042\u308b120\u304c\u8868\u793a\u3055\u308c\u307e\u3059\u3002 \u305d\u306e\u691c\u7d22\u30b5\u30a4\u30c8\u306b2.5!\u3068\u5165 &hellip; <a href=\"http:\/\/leybreeze.com\/blog\/?p=1245\" class=\"more-link\">\u7ee7\u7eed\u9605\u8bfb<span class=\"screen-reader-text\">\u201c[ GO FOR IT ] 2) \u5b9f\u6570\u306e\u968e\u4e57\u201d<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[103],"_links":{"self":[{"href":"http:\/\/leybreeze.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/1245"}],"collection":[{"href":"http:\/\/leybreeze.com\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/leybreeze.com\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/leybreeze.com\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/leybreeze.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1245"}],"version-history":[{"count":3,"href":"http:\/\/leybreeze.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/1245\/revisions"}],"predecessor-version":[{"id":1250,"href":"http:\/\/leybreeze.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/1245\/revisions\/1250"}],"wp:attachment":[{"href":"http:\/\/leybreeze.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1245"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/leybreeze.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1245"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/leybreeze.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1245"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}