{"id":312385,"date":"2020-11-01T15:00:27","date_gmt":"2020-11-01T15:00:27","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=312385"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=312385","title":{"rendered":"\u0422\u043e\u0447\u043d\u044b\u0435 \u0438 \u0431\u044b\u0441\u0442\u0440\u044b\u0435 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f \u0434\u043b\u044f \u0447\u0438\u0441\u0435\u043b \u0441 \u043f\u043b\u0430\u0432\u0430\u044e\u0449\u0435\u0439 \u0442\u043e\u0447\u043a\u043e\u0439 \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0441\u0438\u043d\u0443\u0441\u0430. \u0412\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u0438 \u0447\u0430\u0441\u0442\u044c 1"},"content":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\">\u0412\u043d\u0438\u043c\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u043b \u043e\u0447\u0435\u043d\u044c \u0445\u043e\u0440\u043e\u0448\u0438\u0435 \u0441\u0442\u0430\u0442\u044c\u0438 \u043e\u0442 <a href=\"https:\/\/habr.com\/ru\/users\/artemkaravaev\/\" class=\"user_link\">ArtemKaravaev<\/a> \u043f\u043e \u0441\u043b\u043e\u0436\u0435\u043d\u0438\u044e \u0447\u0438\u0441\u0435\u043b \u0441 \u043f\u043b\u0430\u0432\u0430\u044e\u0449\u0435\u0439 \u0442\u043e\u0447\u043a\u043e\u0439. \u0422\u0435\u043c\u0430 \u043e\u0447\u0435\u043d\u044c \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u0430\u044f \u0438 \u0445\u043e\u0447\u0435\u0442\u0441\u044f \u0435\u0451 \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0438\u0442\u044c \u0438 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0430\u0445, \u043a\u0430\u043a \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u0447\u0438\u0441\u043b\u0430\u043c\u0438 \u0441 \u043f\u043b\u0430\u0432\u0430\u044e\u0449\u0435\u0439 \u0442\u043e\u0447\u043a\u043e\u0439 \u043d\u0430 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435. \u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u044d\u0442\u0430\u043b\u043e\u043d\u0430 \u0432\u043e\u0437\u044c\u043c\u0451\u043c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 GNU glibc (libm). \u0410 \u0447\u0442\u043e\u0431\u044b \u0441\u0442\u0430\u0442\u044c\u044f \u043d\u0435 \u0431\u044b\u043b\u0430 \u0443\u0436 \u0441\u043a\u0443\u0447\u043d\u043e\u0439, \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0441\u043e\u0440\u0435\u0432\u043d\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u0443\u044e \u0441\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0449\u0443\u044e: \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u0432\u0442\u043e\u0440\u0438\u0442\u044c, \u043d\u043e \u0438 \u0443\u043b\u0443\u0447\u0448\u0438\u0442\u044c \u043a\u043e\u0434 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438, \u0441\u0434\u0435\u043b\u0430\u0432 \u0435\u0433\u043e \u0431\u043e\u043b\u0435\u0435 \u0431\u044b\u0441\u0442\u0440\u044b\u043c\/\u0442\u043e\u0447\u043d\u044b\u043c.<\/p>\n<p>  \u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u044f \u0432\u044b\u0431\u0440\u0430\u043b \u0442\u0440\u0438\u0433\u043e\u043d\u043e\u043c\u0435\u0442\u0440\u0438\u0447\u0435\u0441\u043a\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0441\u0438\u043d\u0443\u0441\u0430. \u042d\u0442\u043e \u0448\u0438\u0440\u043e\u043a\u043e \u0440\u0430\u0441\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0451\u043d\u043d\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f, \u043c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u043a\u0430 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0445\u043e\u0440\u043e\u0448\u043e \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u0430 \u0441\u043e \u0448\u043a\u043e\u043b\u044b \u0438 \u0443\u043d\u0438\u0432\u0435\u0440\u0441\u0438\u0442\u0435\u0442\u0430. \u0412 \u0442\u043e\u0436\u0435 \u0432\u0440\u0435\u043c\u044f \u043f\u0440\u0438 \u0435\u0451 \u0438\u043c\u043f\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 \u043f\u043e\u044f\u0432\u044f\u0442\u0441\u044f \u043c\u043d\u043e\u0433\u043e \u044f\u0440\u043a\u0438\u0445 \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432 \u00ab\u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e\u0439\u00bb \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0447\u0438\u0441\u043b\u0430\u043c\u0438. \u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0447\u0438\u0441\u043b\u0430 \u0441 \u043f\u043b\u0430\u0432\u0430\u044e\u0449\u0435\u0439 \u0442\u043e\u0447\u043a\u043e\u0439 \u044f \u0431\u0443\u0434\u0443 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c double.<\/p>\n<p>  \u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u0446\u0438\u043a\u043b\u0435 \u0441\u0442\u0430\u0442\u0435\u0439 \u043f\u043b\u0430\u043d\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u043c\u043d\u043e\u0433\u043e \u0432\u0441\u0435\u0433\u043e \u043d\u0430\u0447\u0438\u043d\u0430\u044f \u043e\u0442 \u043c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u043a\u0438, \u0437\u0430\u043a\u0430\u043d\u0447\u0438\u0432\u0430\u044f \u043c\u0430\u0448\u0438\u043d\u043d\u044b\u043c\u0438 \u043a\u043e\u0434\u0430\u043c\u0438 \u0438 \u043e\u043f\u0446\u0438\u044f\u043c\u0438 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0430. \u042f\u0437\u044b\u043a \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0441\u0442\u0430\u0442\u044c\u0438 \u0421++, \u043d\u043e \u0431\u0435\u0437 \u00ab\u0438\u0437\u043b\u0438\u0448\u0435\u0441\u0442\u0432\u00bb. \u0412 \u043e\u0442\u043b\u0438\u0447\u0438\u0438 \u043e\u0442 \u0421 \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0449\u0438\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u044b \u0431\u0443\u0434\u0443\u0442 \u0431\u043e\u043b\u0435\u0435 \u0443\u0434\u043e\u0431\u043e\u0447\u0438\u0442\u0430\u0435\u043c\u044b\u043c\u0438 \u0434\u0430\u0436\u0435 \u0434\u043b\u044f \u043b\u044e\u0434\u0435\u0439 \u043d\u0435 \u0437\u043d\u0430\u043a\u043e\u043c\u044b\u043c \u0441 \u044d\u0442\u0438\u043c \u044f\u0437\u044b\u043a\u043e\u043c \u0438 \u0437\u0430\u043d\u0438\u043c\u0430\u0442\u044c \u043c\u0435\u043d\u044c\u0448\u0435 \u0441\u0442\u0440\u043e\u043a.<\/p>\n<p>  \u0421\u0442\u0430\u0442\u044c\u0438 \u0431\u0443\u0434\u0443\u0442 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u044b \u043c\u0435\u0442\u043e\u0434\u043e\u043c \u043f\u043e\u0433\u0440\u0443\u0436\u0435\u043d\u0438\u044f. \u0411\u0443\u0434\u0443\u0442 \u043e\u0431\u0441\u0443\u0436\u0434\u0430\u0442\u044c\u0441\u044f \u043f\u043e\u0434\u0437\u0430\u0434\u0430\u0447\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u043e\u0442\u043e\u043c \u0441\u043e\u0431\u0435\u0440\u0443\u0442\u0441\u044f \u0432\u043c\u0435\u0441\u0442\u0435 \u0432 \u0435\u0434\u0438\u043d\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b.<br \/>  <a name=\"habracut\"><\/a>  <\/p>\n<h2>\u0420\u0430\u0437\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0441\u0438\u043d\u0443\u0441\u0430 \u0432 \u0440\u044f\u0434 \u0422\u0435\u0439\u043b\u043e\u0440\u0430.<\/h2>\n<p>  \u0424\u0443\u043d\u043a\u0446\u0438\u044f \u0441\u0438\u043d\u0443\u0441\u0430 \u0440\u0430\u0441\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0432 \u0431\u0435\u0441\u043a\u043e\u043d\u0435\u0447\u043d\u044b\u0439 \u0440\u044f\u0434 \u0422\u0435\u0439\u043b\u043e\u0440\u0430. <\/p>\n<p><math>$$display$$\\sin(x)=x-{\\frac {x^{3}}{3!}}+{\\frac {x^{5}}{5!}}-{\\frac {x^{7}}{7!}}+{\\frac {x^{9}}{9!}}-\\cdots $$display$$<\/math><\/p>\n<p>  \u041f\u043e\u043d\u044f\u0442\u043d\u043e, \u0447\u0442\u043e \u0431\u0435\u0441\u043a\u043e\u043d\u0435\u0447\u043d\u044b\u0439 \u0440\u044f\u0434 \u043c\u044b \u043f\u043e\u0441\u0447\u0438\u0442\u0430\u0442\u044c \u043d\u0435 \u043c\u043e\u0436\u0435\u043c, \u043a\u0440\u043e\u043c\u0435 \u0441\u043b\u0443\u0447\u0430\u0435\u0432, \u043a\u043e\u0433\u0434\u0430 \u0435\u0441\u0442\u044c \u0430\u043d\u0430\u043b\u0438\u0442\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u0444\u043e\u0440\u043c\u0443\u043b\u0430 \u0431\u0435\u0441\u043a\u043e\u043d\u0435\u0447\u043d\u043e\u0439 \u0441\u0443\u043c\u043c\u044b. \u041d\u043e \u044d\u0442\u043e \u043d\u0435 \u043d\u0430\u0448 \u0441\u043b\u0443\u0447\u0430\u0439))) \u041f\u0440\u0435\u0434\u043f\u043e\u043b\u043e\u0436\u0438\u043c, \u0447\u0442\u043e \u043c\u044b \u0445\u043e\u0442\u0438\u043c \u043f\u043e\u0441\u0447\u0438\u0442\u0430\u0442\u044c \u0441\u0438\u043d\u0443\u0441 \u0432 \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b\u0435 <math>$inline$[0, \\frac{\\pi}{2}]$inline$<\/math>. \u0411\u043e\u043b\u0435\u0435 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0443 \u0441 \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b\u0430\u043c\u0438 \u043e\u0431\u0441\u0443\u0434\u0438\u043c \u0432 \u0447\u0430\u0441\u0442\u0438 3. \u0417\u043d\u0430\u044f, \u0447\u0442\u043e <math>$inline$\\sin(\\frac{\\pi}{2})=1$inline$<\/math> \u043e\u0446\u0435\u043d\u0438\u043c \u043d\u0430\u0439\u0434\u0451\u043c \u043f\u0435\u0440\u0432\u044b\u0439 \u0447\u043b\u0435\u043d \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u043e\u0436\u043d\u043e \u043e\u0442\u0431\u0440\u043e\u0441\u0438\u0442\u044c \u0438\u0441\u0445\u043e\u0434\u044f \u0438\u0437 \u0443\u0441\u043b\u043e\u0432\u0438\u044f, \u0447\u0442\u043e <math>$inline$\\frac{(\\pi\/2)^n}{n!}&lt;e$inline$<\/math>, \u0433\u0434\u0435 <math>$inline$e$inline$<\/math> \u044d\u0442\u043e \u0440\u0430\u0437\u043d\u0438\u0446\u0430 \u043c\u0435\u0436\u0434\u0443 \u0447\u0438\u0441\u043b\u043e\u043c 1 \u0438 \u043d\u0430\u0438\u043c\u0435\u043d\u044c\u0448\u0435\u043c \u0447\u0438\u0441\u043b\u043e\u043c, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0431\u043e\u043b\u044c\u0448\u0435 1. \u0413\u0440\u0443\u0431\u043e \u0433\u043e\u0432\u043e\u0440\u044f \u044d\u0442\u043e \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439 \u0431\u0438\u0442 \u043c\u0430\u043d\u0442\u0438\u0441\u0441\u044b (<a href=\"https:\/\/ru.wikipedia.org\/wiki\/%D0%A7%D0%B8%D1%81%D0%BB%D0%BE_%D0%B4%D0%B2%D0%BE%D0%B9%D0%BD%D0%BE%D0%B9_%D1%82%D0%BE%D1%87%D0%BD%D0%BE%D1%81%D1%82%D0%B8\">wiki<\/a>). \u0420\u0435\u0448\u0438\u0442\u044c \u0434\u0430\u043d\u043d\u043e\u0435 \u0443\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435 \u043f\u0440\u043e\u0449\u0435 \u043f\u0435\u0440\u0435\u0431\u043e\u0440\u043e\u043c. \u0414\u043b\u044f <math>$inline$e \\approx 2.22\\times10^{-16}$inline$<\/math>. \u0423 \u043c\u0435\u043d\u044f \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c <math>$inline$n=23$inline$<\/math> \u0443\u0436\u0435 \u043c\u043e\u0436\u043d\u043e \u043e\u0442\u0431\u0440\u043e\u0441\u0438\u0442\u044c. \u041f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u0439 \u0432\u044b\u0431\u043e\u0440 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u0441\u043b\u0430\u0433\u0430\u0435\u043c\u044b\u0445 \u0431\u0443\u0434\u0435\u0442 \u043e\u0431\u0441\u0443\u0436\u0434\u0435\u043d\u043e \u0432 \u043e\u0434\u043d\u043e\u0439 \u0438\u0437 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u0447\u0430\u0441\u0442\u0435\u0439, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043d\u0430 \u0441\u0435\u0433\u043e\u0434\u043d\u044f \u00ab\u043f\u0435\u0440\u0435\u0441\u0442\u0440\u0430\u0445\u0443\u0435\u043c\u0441\u044f\u00bb \u0438 \u0432\u043e\u0437\u044c\u043c\u0451\u043c \u0441\u043b\u0430\u0433\u0430\u0435\u043c\u044b\u0445 \u0434\u043e <math>$inline$n=25$inline$<\/math> \u0432\u043a\u043b\u044e\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e. <br \/>  \u041f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0435 \u0441\u043b\u0430\u0433\u0430\u0435\u043c\u043e\u0435 \u043f\u0440\u0438\u0431\u043b\u0438\u0437\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0432 10000 \u0440\u0430\u0437 \u043c\u0435\u043d\u044c\u0448\u0435, \u0447\u0435\u043c <math>$inline$e$inline$<\/math>.<\/p>\n<h2>\u041f\u0440\u043e\u0441\u0442\u0435\u0439\u0448\u0435\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435<\/h2>\n<p>  \u0420\u0443\u043a\u0438 \u0443\u0436\u0435 \u0447\u0435\u0448\u0443\u0442\u0441\u044f, \u043f\u0438\u0448\u0435\u043c:<\/p>\n<div class=\"spoiler\" role=\"button\" tabindex=\"0\">                         <b class=\"spoiler_title\">\u041f\u043e\u043b\u043d\u044b\u0439 \u0442\u0435\u043a\u0441\u0442 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u0434\u043b\u044f \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f<\/b>                         <\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"cpp\">#include &lt;iostream&gt; #include &lt;iomanip&gt; #include &lt;cmath&gt; #include &lt;array&gt; #include &lt;bitset&gt; #include &lt;quadmath.h&gt; \/\/ \u041f\u043e\u043b\u043d\u044b\u0439 \u043f\u0443\u0442\u044c \u043a \u0444\u0430\u0439\u043b\u0443 \u0434\u043b\u044f clang \/\/#include &quot;\/usr\/lib\/gcc\/x86_64-linux-gnu\/10\/include\/quadmath.h&quot; #include &lt;numeric&gt; #include &lt;limits&gt; #include &lt;vector&gt;  #include &lt;boost\/timer\/timer.hpp&gt; #include &lt;boost\/math\/special_functions\/factorials.hpp&gt;  namespace bm = boost::math;  using namespace std;  typedef union { uint32_t i[2]; double x; } mynumber;  array&lt;double, 25&gt; fc;  double sin_e1(double x) {   double result = 0;   int sign = 1;   for(int i = 1; i &lt; 25; i += 2) {     result += sign * pow(x, i) \/ bm::unchecked_factorial&lt;double&gt;(i);     sign = -sign;   }   return result; }  double sin_e2(double x) {   double result = 0;   int sign = 1;   double xx = x * x;   double pw = x;   double fti = 1.0;   for(int i = 1; i &lt; 25; i += 2) {     fti \/= i;     result += sign * pw * fti;     fti \/= ( i + 1 );     sign = -sign;     pw  *= xx;   }   return result; }  double sin_e3(double x) {   double result = 0;   for(int i = 25; i &gt;= 1; i -= 2) {     result += (((i - 1) % 4 == 0) ? 1 : -1 ) * pow(x, i) \/ bm::unchecked_factorial&lt;double&gt;(i);   }   return result; }  double sin_e4(double x) {   double xx = x * x;   double res = fc[25];   for(int i = 23; i &gt;= 1; i -= 2) {     res = fc[i] + xx * res;   }   return x * res; }  double sin_e5(double x) {   double xx = x * x;   double res = fc[25];   for(int i = 23; i &gt;= 3; i -= 2) {     res = fc[i] + xx * res;   }   return x + x * xx * res; }  #define SIN(a) sin_e5(a) \/\/ ^^ \u0418\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0434\u043b\u044f \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f \u0437\u0434\u0435\u0441\u044c. ^^  int main() {    __uint128_t ft = 1;   fc[1] = 1.0; \/\/3 * 5;   for(int i = 2; i &lt; fc.size(); i++) {     ft *= i;     \/\/ factorial with sign for Taylor series     fc[i] = (1.0 \/ ft) * (( (i - 2) % 4 &lt; 2) ? -1 : 1);   }   vector&lt;double&gt; xv;   xv.resize(8 * 2000000);   \/\/ \u041b\u0438\u043d\u0435\u0439\u043d\u043e\u0435 \u0437\u0430\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u043c\u0430\u0441\u0441\u0438\u0432\u0430 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u043c\u0438 \u043e\u0442 0 \u0434\u043e M_PI\/2   for (int i = 0; i &lt; xv.size(); i++) {     \/\/ \u041c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0432 \u043c\u0430\u0441\u0441\u0438\u0432\u0435 \u0438\u0437\u043c\u0435\u043d\u044f\u0442\u044c \u0437\u0434\u0435\u0441\u044c.     xv[i] = (M_PI \/ 2) * i \/ double(xv.size());   }    {     boost::timer::auto_cpu_timer at;     double res = 0;     for(int i = 0; i &lt; xv.size(); i++) {       res += SIN(xv[i]);     }   }    int co = 0, cn = 0;   \/\/ \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0447\u0438\u0441\u043b\u0430 \u0447\u0435\u0442\u0432\u0435\u0440\u043d\u043e\u0439 \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u0438 \u043a\u0430\u043a \u044d\u0442\u0430\u043b\u043e\u043d.   __float128 avg = 0.0, div = 0.0;   for(int i = 0; i &lt; xv.size(); i++) {     mynumber dold, dnew;     dold.x = sin(xv[i]);     dnew.x = SIN(xv[i]);     __float128 q = sinq(xv[i]); \/\/ &lt;= sinq \u0441\u0447\u0438\u0442\u0430\u0435\u043c \u044d\u0442\u0430\u043b\u043e\u043d\u043e\u043c.     __float128 dd = __float128(dnew.x) - q;     \/\/ \u0412\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u043c \u0441\u0440\u0435\u0434\u043d\u0435\u0435 \u0438 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0435 \u043e\u0442\u043a\u043b\u043e\u043d\u0435\u043d\u0438\u0435.     div += dd * dd;     avg += dd;     \/\/ \u0421\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u0435\u043c \u043f\u043e\u0431\u0438\u0442\u043e\u0432\u043e, \u0447\u0442\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0441\u0438\u043d\u0443\u0441\u0430 \u043e\u0442 \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0438 \u043e\u0442 \u043d\u0430\u0448\u0435\u0439.     \/\/ \u0415\u0441\u043b\u0438 \u043e\u043d\u0438 \u0440\u0430\u0437\u043b\u0438\u0447\u0430\u044e\u0442\u0441\u044f, \u0442\u043e \u0432\u044b\u044f\u0441\u043d\u044f\u0435\u043c \u043a\u0430\u043a\u0430\u044f \u0438\u0437 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0434\u0430\u0451\u0442 \u0431\u043e\u043b\u0435\u0435 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442.     if( dold.i[0] != dnew.i[0] || dold.i[1] != dnew.i[1] ) {       if( fabsq(q - dold.x) &lt;= fabsq(q - dnew.x) )         co++;       else         cn++;     }   }   avg \/= xv.size();   div \/= xv.size();    \/\/ \u041a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0441\u043b\u0443\u0447\u0430\u0435\u0432, \u043a\u043e\u0433\u0434\u0430 \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u044f\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0434\u0430\u043b\u0430 \u0431\u043e\u043b\u0435\u0435 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043a \u043e\u0431\u0449\u0435\u043c\u0443 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0443 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0439.   cout &lt;&lt; &quot;Better libm: &quot; &lt;&lt;  co &lt;&lt; &quot; \/ &quot; &lt;&lt; xv.size() &lt;&lt; &quot;(&quot; &lt;&lt; 100.0 * co \/ xv.size() &lt;&lt; &quot;%)&quot; &lt;&lt; endl;    \/\/ \u041a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0441\u043b\u0443\u0447\u0430\u0435\u0432, \u043a\u043e\u0433\u0434\u0430 &quot;\u043d\u0430\u0448\u0430&quot; \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0434\u0430\u043b\u0430 \u0431\u043e\u043b\u0435\u0435 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043a \u043e\u0431\u0449\u0435\u043c\u0443 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0443 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0439.   cout &lt;&lt; &quot;Better new: &quot; &lt;&lt;  cn &lt;&lt; &quot; \/ &quot; &lt;&lt; xv.size() &lt;&lt; &quot;(&quot; &lt;&lt; 100.0 * cn \/ xv.size() &lt;&lt; &quot;%)&quot; &lt;&lt; endl;    \/\/ \u0421\u0440\u0435\u0434\u043d\u0435\u0435 \u043e\u0442\u043a\u043b\u043e\u043d\u0435\u043d\u0438\u044f \u0438 \u043e\u0442\u043a\u043b\u043e\u043d\u0435\u043d\u0438\u0435 \u043e\u0442\u043a\u043b\u043e\u043d\u0435\u043d\u0438\u044f \u043d\u0430\u0448\u0435\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043e\u0442 \u044d\u0442\u0430\u043b\u043e\u043d\u0430.   cout &lt;&lt; &quot;  Avg \/ std new: &quot; &lt;&lt; double(avg) &lt;&lt; &quot; \/ &quot; &lt;&lt; double(sqrtq( div - avg * avg )) &lt;&lt; endl;   return 0; } <\/code><\/pre>\n<\/p><\/div>\n<\/p><\/div>\n<pre><code class=\"cpp\">double sin_e1(double x) {   double result = 0;   int sign = 1;   for(int i = 1; i &lt; 25; i += 2) {     result += sign * pow(x, i) \/ bm::factorial&lt;double&gt;(i);     sign = -sign;   }   return result; } <\/code><\/pre>\n<p>  \u041a\u0430\u043a \u0443\u0441\u043a\u043e\u0440\u0438\u0442\u044c \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0443 \u044f \u0434\u0443\u043c\u0430\u044e, \u0447\u0442\u043e \u043c\u043d\u043e\u0433\u0438\u0435 \u0441\u043e\u043e\u0431\u0440\u0430\u0437\u0438\u043b\u0438 \u0441\u0440\u0430\u0437\u0443. \u041a\u0430\u043a \u0432\u044b \u0434\u0443\u043c\u0430\u0435\u0442\u0435, \u0432\u043e \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0440\u0430\u0437 \u0432\u0430\u0448\u0438 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u043c\u043e\u0433\u0443\u0442 \u0443\u0441\u043a\u043e\u0440\u0438\u0442\u044c \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0443? \u041e\u043f\u0442\u0438\u043c\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u0430\u044f \u0432\u0435\u0440\u0441\u0438\u044f \u0438 \u043e\u0442\u0432\u0435\u0442 \u043d\u0430 \u0432\u043e\u043f\u0440\u043e\u0441 \u043f\u043e\u0434 \u0441\u043f\u043e\u0439\u043b\u0435\u0440\u043e\u043c.<\/p>\n<div class=\"spoiler\" role=\"button\" tabindex=\"0\">                         <b class=\"spoiler_title\">\u041e\u043f\u0442\u0438\u043c\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u0430\u044f \u0432\u0435\u0440\u0441\u0438\u044f \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b.<\/b>                         <\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"cpp\">double sin_e2(double x) {   double result = 0;   int sign = 1;   double xx = x * x;   double pw = x;   double fti = 1.0;   for(int i = 1; i &lt; 25; i += 2) {     fti \/= i;     result += sign * pw * fti;     fti \/= ( i + 1 );     sign = -sign;     pw  *= xx;   }   return result; } <\/code><\/pre>\n<p>  \u0423\u0441\u043a\u043e\u0440\u0435\u043d\u0438\u0435 \u0431\u043e\u043b\u044c\u0448\u0435 \u0447\u0435\u043c \u0432 10000 \u0440\u0430\u0437 (GNU C++ v10; -O2)   <\/div>\n<\/p><\/div>\n<p>  <\/p>\n<h2>\u0423\u043b\u0443\u0447\u0448\u0435\u043d\u0438\u0435 \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u0438<\/h2>\n<p>  <\/p>\n<h3>\u041c\u0435\u0442\u043e\u0434\u0438\u043a\u0430<\/h3>\n<p>  \u0422\u043e\u0447\u043d\u043e\u0441\u0442\u044c \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0431\u0443\u0434\u0435\u043c \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0442\u044c 2-\u043c\u044f \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u043c\u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c\u0438. <\/p>\n<p>  \u0421\u0440\u0435\u0434\u043d\u0435\u043a\u0432\u0430\u0434\u0440\u0430\u0442\u0438\u0447\u043d\u043e\u0435 \u043e\u0442\u043a\u043b\u043e\u043d\u0435\u043d\u0438\u0435 \u043e\u0442 \u0438\u0441\u0442\u0438\u043d\u043d\u043e\u0433\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f sin(float128) \u0438 \u0441\u0440\u0435\u0434\u043d\u0435\u0435 \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u043e\u0442\u043a\u043b\u043e\u043d\u0435\u043d\u0438\u044f. \u041f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u043c\u043e\u0436\u0435\u0442 \u0434\u0430\u0442\u044c \u0432\u0430\u0436\u043d\u0443\u044e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e \u0442\u043e\u043c, \u043a\u0430\u043a \u0432\u0435\u0434\u0451\u0442 \u0441\u0435\u0431\u044f \u043d\u0430\u0448\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f. \u041e\u043d\u0430 \u043c\u043e\u0436\u0435\u0442 \u0441\u0438\u0441\u0442\u0435\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0437\u0430\u043d\u0438\u0436\u0430\u0442\u044c \u0438\u043b\u0438 \u0437\u0430\u0432\u044b\u0448\u0430\u0442\u044c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442.<\/p>\n<p>  \u0412 \u0434\u043e\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u043a \u0434\u0430\u043d\u043d\u044b\u043c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c \u0432\u0432\u0451\u0434\u0451\u043c \u0435\u0449\u0435 \u0434\u0432\u0430. \u0412\u043c\u0435\u0441\u0442\u0435 \u0441 \u043d\u0430\u0448\u0435\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043c\u044b \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u043c \u0435\u0449\u0451 \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u0443\u044e \u0432 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 \u0444\u0443\u043d\u043a\u0446\u0438\u044e sin(double). \u0415\u0441\u043b\u0438 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u0434\u0432\u0443\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439: \u043d\u0430\u0448\u0435\u0439 \u0438 \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u043e\u0439 \u043d\u0435 \u0441\u043e\u0432\u043f\u0430\u0434\u0430\u044e\u0442 (\u043f\u043e\u0431\u0438\u0442\u043e\u0432\u043e), \u0442\u043e \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0432 \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0443, \u043a\u0430\u043a\u0430\u044f \u0438\u0437 \u0434\u0432\u0443\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0434\u0430\u043b\u044c\u0448\u0435 \u043e\u0442 \u0438\u0441\u0442\u0438\u043d\u043d\u043e\u0433\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f. <\/p>\n<h3>\u041f\u043e\u0440\u044f\u0434\u043e\u043a \u0441\u0443\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f<\/h3>\n<p>  \u0412\u0435\u0440\u043d\u0451\u043c\u0441\u044f \u0441\u043d\u043e\u0432\u0430 \u043a \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u043c\u0443 \u043f\u0440\u0438\u043c\u0435\u0440\u0443. \u041a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0442\u044c \u0435\u0433\u043e \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c \u00ab\u043f\u043e-\u0431\u044b\u0441\u0442\u0440\u0435\u043d\u044c\u043a\u043e\u043c\u0443\u00bb? \u0422\u0435, \u043a\u0442\u043e \u0432\u043d\u0438\u043c\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0447\u0438\u0442\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u044e <a href=\"https:\/\/habr.com\/ru\/post\/525090\/\">\u041c\u043e\u0436\u043d\u043e \u043b\u0438 \u0441\u043b\u043e\u0436\u0438\u0442\u044c N \u0447\u0438\u0441\u0435\u043b \u0442\u0438\u043f\u0430 double \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u0442\u043e\u0447\u043d\u043e?<\/a> \u0441\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e \u0434\u0430\u0434\u0443\u0442 \u043e\u0442\u0432\u0435\u0442 \u0441\u0440\u0430\u0437\u0443. \u041d\u0430\u0434\u043e \u043a\u0440\u0443\u0442\u0438\u0442\u044c \u0446\u0438\u043a\u043b \u0432 \u043e\u0431\u0440\u0430\u0442\u043d\u0443\u044e \u0441\u0442\u043e\u0440\u043e\u043d\u0443. \u0427\u0442\u043e\u0431\u044b \u0441\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u0442\u044c \u043e\u0442 \u043d\u0430\u0438\u043c\u0435\u043d\u044c\u0448\u0438\u0445 \u043f\u043e-\u043c\u043e\u0434\u0443\u043b\u044e, \u043a \u043d\u0430\u0438\u0431\u043e\u043b\u044c\u0448\u0438\u043c.<\/p>\n<pre><code class=\"cpp\">double sin_e3(double x) {   double result = 0;   for(int i = 25; i &gt;= 1; i -= 2) {     result += (((i - 1) % 4 == 0) ? 1 : -1 ) * pow(x, i) \/ bm::unchecked_factorial&lt;double&gt;(i);   }   return result; } <\/code><\/pre>\n<p>  \u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u044b \u0432 \u0442\u0430\u0431\u043b\u0438\u0447\u043a\u0435.<\/p>\n<div class=\"scrollable-table\">\n<table border=\"1\">\n<tbody>\n<tr>\n<td><b>\u0424\u0443\u043d\u043a\u0446\u0438\u044f<\/b><\/td>\n<td><b>\u0421\u0440\u0435\u0434\u043d\u0435\u0435 \u043e\u0448\u0438\u0431\u043a\u0438<\/b><\/td>\n<td><b>STD<\/b><\/td>\n<td><b>\u041b\u0443\u0447\u0448\u0435 \u043d\u0430\u0448\u0430<\/b><\/td>\n<td><b>\u041b\u0443\u0447\u0448\u0435 libm<\/b><\/td>\n<\/tr>\n<tr>\n<td>sin_e1<\/td>\n<td>-1.28562e-18<\/td>\n<td>8.25717e-17<\/td>\n<td>0.0588438%<\/td>\n<td>53.5466%<\/td>\n<\/tr>\n<tr>\n<td>sin_e3<\/td>\n<td>-3.4074e-21<\/td>\n<td>3.39727e-17<\/td>\n<td>0.0423%<\/td>\n<td>10.8049%<\/td>\n<\/tr>\n<tr>\n<td>sin_e4<\/td>\n<td>8.79046e-18<\/td>\n<td>4.77326e-17<\/td>\n<td>0.0686%<\/td>\n<td>27.6594%<\/td>\n<\/tr>\n<tr>\n<td>sin_e5<\/td>\n<td>8.78307e-18<\/td>\n<td>3.69995e-17<\/td>\n<td>0.0477062%<\/td>\n<td>13.5105%<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p>  \u041c\u043e\u0436\u0435\u0442 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c\u0441\u044f, \u0447\u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u043e\u0432 \u00ab\u0443\u043c\u043d\u043e\u0433\u043e\u00bb \u0441\u0443\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0443\u0431\u0435\u0440\u0451\u0442 \u043e\u0448\u0438\u0431\u043a\u0443 \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0434\u043e 0, \u043d\u043e \u044d\u0442\u043e \u043d\u0435 \u0442\u0430\u043a. \u041a\u043e\u043d\u0435\u0447\u043d\u043e \u044d\u0442\u0438 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u044b \u0434\u0430\u0434\u0443\u0442 \u0443\u0432\u0435\u043b\u0438\u0447\u0435\u043d\u0438\u0435 \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u0438, \u043d\u043e \u0434\u043b\u044f \u043f\u043e\u043b\u043d\u043e\u0433\u043e \u0438\u0437\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043e\u0442 \u043e\u0448\u0438\u0431\u043e\u043a \u0442\u0440\u0435\u0431\u0443\u044e\u0442\u0441\u044f \u0435\u0449\u0451 \u0438 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u044b \u0443\u043c\u043d\u043e\u0433\u043e \u0443\u043c\u043d\u043e\u0436\u0435\u043d\u0438\u044f. \u041e\u043d\u0438 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0442, \u043d\u043e \u043e\u0447\u0435\u043d\u044c \u043d\u0430\u043a\u043b\u0430\u0434\u043d\u044b: \u043e\u0447\u0435\u043d\u044c \u043c\u043d\u043e\u0433\u043e \u043b\u0438\u0448\u043d\u0438\u0445 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439. \u041f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0438\u0445 \u0437\u0434\u0435\u0441\u044c \u043d\u0435 \u043e\u043f\u0440\u0430\u0432\u0434\u0430\u043d\u043e. \u0412\u043f\u0440\u043e\u0447\u0435\u043c \u043f\u043e\u0437\u0434\u043d\u0435\u0435 \u043c\u044b \u043a \u043d\u0438\u043c \u0432\u0435\u0440\u043d\u0451\u043c\u0441\u044f \u0432 \u0434\u0440\u0443\u0433\u043e\u043c \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0435.<\/p>\n<p>  \u041e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u0441\u043e\u0432\u0441\u0435\u043c \u043d\u0435\u043c\u043d\u043e\u0433\u043e. \u041e\u0431\u044a\u0435\u0434\u0438\u043d\u0438\u0442\u044c \u0431\u044b\u0441\u0442\u0440\u044b\u0439 \u0438 \u0442\u043e\u0447\u043d\u044b\u0439 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u044b. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0441\u043d\u043e\u0432\u0430 \u0432\u0435\u0440\u043d\u0451\u043c\u0441\u044f \u043a \u0440\u044f\u0434\u0443 \u0422\u0435\u0439\u043b\u043e\u0440\u0430. \u041e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043c \u0435\u0433\u043e \u0434\u043b\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u0430 4-\u043c\u044f \u0447\u043b\u0435\u043d\u0430\u043c\u0438 \u0438 \u0441\u0434\u0435\u043b\u0430\u0435\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u0435.<\/p>\n<p><math>$$display$$\\sin(x)\\approx x(1+x^2(-1\/3!+x^2(1\/5!+x^2(-1\/7!+x^2\\cdot1\/9!))))$$display$$<\/math><\/p>\n<p>  \u041c\u043e\u0436\u043d\u043e \u0440\u0430\u0441\u043a\u0440\u044b\u0442\u044c \u0441\u043a\u043e\u0431\u043a\u0438 \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c, \u0447\u0442\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u0435 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435. \u0422\u0430\u043a\u043e\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043e\u0447\u0435\u043d\u044c \u043f\u0440\u043e\u0441\u0442\u043e \u043b\u043e\u0436\u0438\u0442\u0441\u044f \u043d\u0430 \u0446\u0438\u043a\u043b.<\/p>\n<pre><code class=\"cpp\">double sin_e4(double x) {   double xx = x * x;   double res = fc[25];   for(int i = 23; i &gt;= 1; i -= 2) {     res = fc[i] + xx * res;   }   return x * res; } <\/code><\/pre>\n<p>  \u0420\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0431\u044b\u0441\u0442\u0440\u043e, \u043d\u043e \u043f\u043e\u0442\u0435\u0440\u044f\u043b\u0438 \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c, \u043f\u043e \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044e \u0441 e3. \u041e\u043f\u044f\u0442\u044c \u0436\u0435 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0432 \u043e\u043a\u0440\u0443\u0433\u043b\u0435\u043d\u0438\u0438. \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439 \u0448\u0430\u0433 \u0446\u0438\u043a\u043b\u0430 \u0438 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u0443\u0435\u043c \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u0435 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435   <\/p>\n<p><math>$$display$$\\sin(x)\\approx x+x \\cdot x^2(-1\/3!+ \\cdots))$$display$$<\/math><\/p>\n<p>  \u0418 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0439 \u043a\u043e\u0434.<\/p>\n<pre><code class=\"cpp\">double sin_e5(double x) {   double xx = x * x;   double res = fc[25];   for(int i = 23; i &gt;= 3; i -= 2) {     res = fc[i] + xx * res;   }   return x + x * xx * res; } <\/code><\/pre>\n<p>  \u0422\u043e\u0447\u043d\u043e\u0441\u0442\u044c \u0432 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0438 \u0441 libm \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u043b\u0430\u0441\u044c \u0432 2 \u0440\u0430\u0437\u0430. \u0415\u0441\u043b\u0438 \u0434\u043e\u0433\u0430\u0434\u044b\u0432\u0430\u0435\u0442\u0435\u0441\u044c \u043f\u043e\u0447\u0435\u043c\u0443 \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u043b\u0430\u0441\u044c, \u043f\u0438\u0448\u0438\u0442\u0435 \u0432 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u0445. \u041a \u0442\u043e\u043c\u0443 \u0436\u0435 \u0435\u0441\u0442\u044c \u0435\u0449\u0451 \u043e\u0434\u043d\u0430, \u0433\u043e\u0440\u0430\u0437\u0434\u043e \u0431\u043e\u043b\u0435\u0435 \u043d\u0435\u043f\u0440\u0438\u044f\u0442\u043d\u0430\u044f \u0432\u0435\u0449\u044c \u0443 sin_e4, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u0443 sin_e5, \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u0430\u044f \u0441 \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c\u044e. \u041f\u043e\u043f\u0440\u043e\u0431\u0443\u0439\u0442\u0435 \u0434\u043e\u0433\u0430\u0434\u0430\u0442\u044c\u0441\u044f \u0432 \u0447\u0451\u043c \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430. \u0412 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u0447\u0430\u0441\u0442\u0438 \u044f \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u043e \u043d\u0435\u0439 \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e.<\/p>\n<p>  \u0415\u0441\u043b\u0438 \u0441\u0442\u0430\u0442\u044c\u044f \u0412\u0430\u043c \u043f\u043e\u043d\u0440\u0430\u0432\u0438\u0442\u0441\u044f, \u0442\u043e \u0432 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u044f \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443, \u043a\u0430\u043a \u0432 GNU libc \u0441\u0447\u0438\u0442\u0430\u0435\u0442\u0441\u044f \u0441\u0438\u043d\u0443\u0441 \u0441 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u043c ULP \u0432 0.548.<\/p><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/post\/526000\/\"> https:\/\/habr.com\/ru\/post\/526000\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\">\u0412\u043d\u0438\u043c\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u043b \u043e\u0447\u0435\u043d\u044c \u0445\u043e\u0440\u043e\u0448\u0438\u0435 \u0441\u0442\u0430\u0442\u044c\u0438 \u043e\u0442 <a href=\"https:\/\/habr.com\/ru\/users\/artemkaravaev\/\" class=\"user_link\">ArtemKaravaev<\/a> \u043f\u043e \u0441\u043b\u043e\u0436\u0435\u043d\u0438\u044e \u0447\u0438\u0441\u0435\u043b \u0441 \u043f\u043b\u0430\u0432\u0430\u044e\u0449\u0435\u0439 \u0442\u043e\u0447\u043a\u043e\u0439. \u0422\u0435\u043c\u0430 \u043e\u0447\u0435\u043d\u044c \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u0430\u044f \u0438 \u0445\u043e\u0447\u0435\u0442\u0441\u044f \u0435\u0451 \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0438\u0442\u044c \u0438 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0430\u0445, \u043a\u0430\u043a \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u0447\u0438\u0441\u043b\u0430\u043c\u0438 \u0441 \u043f\u043b\u0430\u0432\u0430\u044e\u0449\u0435\u0439 \u0442\u043e\u0447\u043a\u043e\u0439 \u043d\u0430 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435. \u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u044d\u0442\u0430\u043b\u043e\u043d\u0430 \u0432\u043e\u0437\u044c\u043c\u0451\u043c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 GNU glibc (libm). \u0410 \u0447\u0442\u043e\u0431\u044b \u0441\u0442\u0430\u0442\u044c\u044f \u043d\u0435 \u0431\u044b\u043b\u0430 \u0443\u0436 \u0441\u043a\u0443\u0447\u043d\u043e\u0439, \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0441\u043e\u0440\u0435\u0432\u043d\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u0443\u044e \u0441\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0449\u0443\u044e: \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u0432\u0442\u043e\u0440\u0438\u0442\u044c, \u043d\u043e \u0438 \u0443\u043b\u0443\u0447\u0448\u0438\u0442\u044c \u043a\u043e\u0434 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438, \u0441\u0434\u0435\u043b\u0430\u0432 \u0435\u0433\u043e \u0431\u043e\u043b\u0435\u0435 \u0431\u044b\u0441\u0442\u0440\u044b\u043c\/\u0442\u043e\u0447\u043d\u044b\u043c.<\/p>\n<p>  \u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u044f \u0432\u044b\u0431\u0440\u0430\u043b \u0442\u0440\u0438\u0433\u043e\u043d\u043e\u043c\u0435\u0442\u0440\u0438\u0447\u0435\u0441\u043a\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0441\u0438\u043d\u0443\u0441\u0430. \u042d\u0442\u043e \u0448\u0438\u0440\u043e\u043a\u043e \u0440\u0430\u0441\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0451\u043d\u043d\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f, \u043c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u043a\u0430 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0445\u043e\u0440\u043e\u0448\u043e \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u0430 \u0441\u043e \u0448\u043a\u043e\u043b\u044b \u0438 \u0443\u043d\u0438\u0432\u0435\u0440\u0441\u0438\u0442\u0435\u0442\u0430. \u0412 \u0442\u043e\u0436\u0435 \u0432\u0440\u0435\u043c\u044f \u043f\u0440\u0438 \u0435\u0451 \u0438\u043c\u043f\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 \u043f\u043e\u044f\u0432\u044f\u0442\u0441\u044f \u043c\u043d\u043e\u0433\u043e \u044f\u0440\u043a\u0438\u0445 \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432 \u00ab\u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e\u0439\u00bb \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0447\u0438\u0441\u043b\u0430\u043c\u0438. \u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0447\u0438\u0441\u043b\u0430 \u0441 \u043f\u043b\u0430\u0432\u0430\u044e\u0449\u0435\u0439 \u0442\u043e\u0447\u043a\u043e\u0439 \u044f \u0431\u0443\u0434\u0443 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c double.<\/p>\n<p>  \u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u0446\u0438\u043a\u043b\u0435 \u0441\u0442\u0430\u0442\u0435\u0439 \u043f\u043b\u0430\u043d\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u043c\u043d\u043e\u0433\u043e \u0432\u0441\u0435\u0433\u043e \u043d\u0430\u0447\u0438\u043d\u0430\u044f \u043e\u0442 \u043c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u043a\u0438, \u0437\u0430\u043a\u0430\u043d\u0447\u0438\u0432\u0430\u044f \u043c\u0430\u0448\u0438\u043d\u043d\u044b\u043c\u0438 \u043a\u043e\u0434\u0430\u043c\u0438 \u0438 \u043e\u043f\u0446\u0438\u044f\u043c\u0438 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0430. \u042f\u0437\u044b\u043a \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0441\u0442\u0430\u0442\u044c\u0438 \u0421++, \u043d\u043e \u0431\u0435\u0437 \u00ab\u0438\u0437\u043b\u0438\u0448\u0435\u0441\u0442\u0432\u00bb. \u0412 \u043e\u0442\u043b\u0438\u0447\u0438\u0438 \u043e\u0442 \u0421 \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0449\u0438\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u044b \u0431\u0443\u0434\u0443\u0442 \u0431\u043e\u043b\u0435\u0435 \u0443\u0434\u043e\u0431\u043e\u0447\u0438\u0442\u0430\u0435\u043c\u044b\u043c\u0438 \u0434\u0430\u0436\u0435 \u0434\u043b\u044f \u043b\u044e\u0434\u0435\u0439 \u043d\u0435 \u0437\u043d\u0430\u043a\u043e\u043c\u044b\u043c \u0441 \u044d\u0442\u0438\u043c \u044f\u0437\u044b\u043a\u043e\u043c \u0438 \u0437\u0430\u043d\u0438\u043c\u0430\u0442\u044c \u043c\u0435\u043d\u044c\u0448\u0435 \u0441\u0442\u0440\u043e\u043a.<\/p>\n<p>  \u0421\u0442\u0430\u0442\u044c\u0438 \u0431\u0443\u0434\u0443\u0442 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u044b \u043c\u0435\u0442\u043e\u0434\u043e\u043c \u043f\u043e\u0433\u0440\u0443\u0436\u0435\u043d\u0438\u044f. \u0411\u0443\u0434\u0443\u0442 \u043e\u0431\u0441\u0443\u0436\u0434\u0430\u0442\u044c\u0441\u044f \u043f\u043e\u0434\u0437\u0430\u0434\u0430\u0447\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u043e\u0442\u043e\u043c \u0441\u043e\u0431\u0435\u0440\u0443\u0442\u0441\u044f \u0432\u043c\u0435\u0441\u0442\u0435 \u0432 \u0435\u0434\u0438\u043d\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b.  <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-312385","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/312385","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=312385"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/312385\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=312385"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=312385"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=312385"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}