{"id":312856,"date":"2020-11-10T03:00:35","date_gmt":"2020-11-10T03:00:35","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=312856"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=312856","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. \u0427\u0430\u0441\u0442\u044c 3: fixed-point"},"content":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\">\u041f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u0435\u043c \u0446\u0438\u043a\u043b \u043b\u0435\u043a\u0446\u0438\u0439 (<a href=\"https:\/\/habr.com\/ru\/post\/526000\/\">\u0447\u0430\u0441\u0442\u044c 1<\/a> \u0438 <a href=\"https:\/\/habr.com\/ru\/post\/526518\/\">\u0447\u0430\u0441\u0442\u044c 2<\/a>). \u0412 \u0447\u0430\u0441\u0442\u0438 2 \u043c\u044b \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u043b\u0438, \u0447\u0442\u043e \u0432\u043d\u0443\u0442\u0440\u0438 \u0443 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 libm \u0438 \u0432 \u0434\u0430\u043d\u043d\u043e\u0439 \u0440\u0430\u0431\u043e\u0442\u0435 \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043f\u0435\u0440\u0435\u0434\u0435\u043b\u0430\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u044e do_sin, \u0447\u0442\u043e\u0431\u044b \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0442\u044c \u0435\u0451 \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c \u0438 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u044b. \u041f\u0440\u0438\u0432\u0435\u0434\u0443 \u044d\u0442\u0443 \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0435\u0449\u0451 \u0440\u0430\u0437 <a href=\"https:\/\/github.com\/bminor\/glibc\/blob\/fd0981e4028b79b061b458acbc10315e05972ada\/sysdeps\/ieee754\/dbl-64\/s_sin.c#L120\" rel=\"nofollow\">do_sin<\/a>):<br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/et\/05\/_h\/et05_hcfeh1trrrwq4vibhs41sg.png\" alt=\"image\"><br \/>  \u041a\u0430\u043a \u0431\u044b\u043b\u043e \u043f\u043e\u043a\u0430\u0437\u0430\u043d\u043e \u0432 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u0447\u0430\u0441\u0442\u044c 132-145. \u0412\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u0434\u043b\u044f x \u0432 \u043f\u0440\u0435\u0434\u0435\u043b\u0430\u0445 [0.126, 0.855469]. \u041d\u0443 \u0447\u0442\u043e. \u041f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u044e, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0432 \u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u0440\u0435\u0434\u0435\u043b\u0430\u0445 \u0431\u0443\u0434\u0435\u0442 \u0442\u043e\u0447\u043d\u0435\u0435 \u0438, \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u0431\u044b\u0441\u0442\u0440\u0435\u0435.<br \/>  <a name=\"habracut\"><\/a><br \/>  \u0421\u043f\u043e\u0441\u043e\u0431, \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u043c\u044b \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u0441\u044f \u2014 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043e\u0447\u0435\u0432\u0438\u0434\u043d\u044b\u0439. \u041d\u0430\u0434\u043e \u0440\u0430\u0441\u0448\u0438\u0440\u0438\u0442\u044c \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0439, \u0447\u0442\u043e\u0431\u044b \u0432\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0431\u043e\u043b\u044c\u0448\u0435 \u0437\u043d\u0430\u043a\u043e\u0432 \u043f\u043e\u0441\u043b\u0435 \u0437\u0430\u043f\u044f\u0442\u043e\u0439. \u041e\u0447\u0435\u0432\u0438\u0434\u043d\u044b\u043c \u0440\u0435\u0448\u0435\u043d\u0438\u0435\u043c \u0431\u044b\u043b\u043e \u0431\u044b \u0432\u044b\u0431\u0440\u0430\u0442\u044c \u0442\u0438\u043f long double, \u043f\u043e\u0441\u0447\u0438\u0442\u0430\u0442\u044c \u0432 \u043d\u0451\u043c, \u0430 \u043f\u043e\u0442\u043e\u043c \u0441\u043a\u043e\u043d\u0432\u0435\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043e\u0431\u0440\u0430\u0442\u043d\u043e. \u0421 \u0442\u043e\u0447\u043a\u0438 \u0437\u0440\u0435\u043d\u0438\u044f \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u0438 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u0445\u043e\u0440\u043e\u0448\u0438\u043c, \u043d\u043e \u0441 \u0442\u043e\u0447\u043a\u0438 \u0437\u0440\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b. \u0412\u0441\u0451-\u0442\u0430\u043a\u0438 long double \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u044d\u043a\u0437\u043e\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0432\u0438\u0434 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438 \u0435\u0433\u043e \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 \u0432 \u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u0430\u0445 \u043d\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442\u043d\u043e\u0439. \u041d\u0430 x86_64 SSE\/AVX \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 \u0441 \u0434\u0430\u043d\u043d\u044b\u043c \u0442\u0438\u043f\u043e\u043c \u0434\u0430\u043d\u043d\u044b\u0445 \u043d\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442. \u0411\u0443\u0434\u0435\u0442 \u00ab\u043e\u0442\u0434\u0443\u0432\u0430\u0442\u044c\u0441\u044f\u00bb \u043c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0441\u043e\u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440.<\/p>\n<p>  \u0427\u0442\u043e \u0436\u0435 \u0442\u043e\u0433\u0434\u0430 \u0432\u044b\u0431\u0440\u0430\u0442\u044c? \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0435\u0449\u0451 \u0440\u0430\u0437 \u0432\u043d\u0438\u043c\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u043f\u0440\u0435\u0434\u0435\u043b\u044b \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0430 \u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0438. \u041e\u043d\u0438 \u043d\u0430\u0445\u043e\u0434\u044f\u0442\u0441\u044f \u0432 \u0440\u0430\u0439\u043e\u043d\u0435 1.0. \u0422.\u0435. \u043f\u043e \u0441\u0443\u0442\u0438 \u043f\u043b\u0430\u0432\u0430\u044e\u0449\u0430\u044f \u0442\u043e\u0447\u043a\u0430 \u043d\u0430\u043c \u043d\u0435 \u043d\u0443\u0436\u043d\u0430. \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u0440\u0438 \u0440\u0430\u0441\u0447\u0451\u0442\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u0441\u044f 64-\u0431\u0438\u0442\u043d\u044b\u043c \u0446\u0435\u043b\u044b\u043c. \u042d\u0442\u043e \u0434\u0430\u0441\u0442 \u043d\u0430\u043c \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e 10-11 \u0434\u0432\u043e\u0438\u0447\u043d\u044b\u0445 \u0440\u0430\u0437\u0440\u044f\u0434\u043e\u0432 \u043a \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u0439 \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u0438. \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0440\u0430\u0437\u0431\u0438\u0440\u0430\u0442\u044c\u0441\u044f, \u043a\u0430\u043a \u0436\u0435 \u0441 \u044d\u0442\u0438\u043c\u0438 \u0447\u0438\u0441\u043b\u0430\u043c\u0438 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c. \u0427\u0438\u0441\u043b\u043e \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u0444\u043e\u0440\u043c\u0430\u0442\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0432 \u0432\u0438\u0434\u0435 <i>a\/d<\/i>, \u0433\u0434\u0435 <i>a<\/i> \u044d\u0442\u043e \u0446\u0435\u043b\u043e\u0435 \u0447\u0438\u0441\u043b\u043e, \u0430 <i>d<\/i> \u044d\u0442\u043e \u0434\u0435\u043b\u0438\u0442\u0435\u043b\u044c, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u044b \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u043c \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u044b\u043c \u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u0438 \u0445\u0440\u0430\u043d\u0438\u043c \u00ab\u0443 \u0441\u0435\u0431\u044f \u0432 \u043f\u0430\u043c\u044f\u0442\u0438\u00bb, \u0430 \u043d\u0435 \u0432 \u043f\u0430\u043c\u044f\u0442\u0438 \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u0430. \u041d\u0438\u0436\u0435 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u044b \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u0434\u043b\u044f \u0442\u0430\u043a\u0438\u0445 \u0447\u0438\u0441\u0435\u043b:  <\/p>\n<p><math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/7d0\/c15\/698\/7d0c156981ddc81330e755f375eb6e3a.svg\" alt=\"$\\frac{c}{d}=\\frac{a}{d}\\pm\\frac{b}{d}=\\frac{a\\pm b}{d}\\\\ \\frac{c}{d}=\\frac{a}{d}\\cdot\\frac{b}{d}=\\frac{a \\cdot b}{d^2}\\\\ \\frac{c}{d}=\\frac{a}{d}\\cdot x=\\frac{a \\cdot x}{d}$\" data-tex=\"display\"><\/math><\/p>\n<p>  \u041a\u0430\u043a \u0432\u0438\u0434\u0438\u0442\u0435, \u043d\u0438\u0447\u0435\u0433\u043e \u0441\u043b\u043e\u0436\u043d\u043e\u0433\u043e \u0432 \u044d\u0442\u043e\u043c \u043d\u0435\u0442. \u041f\u043e\u0441\u043b\u0435\u0434\u043d\u044f\u044f \u0444\u043e\u0440\u043c\u0443\u043b\u0430 \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u0443\u043c\u043d\u043e\u0436\u0435\u043d\u0438\u0435 \u043d\u0430 \u043b\u044e\u0431\u043e\u0435 \u0446\u0435\u043b\u043e\u0435 \u0447\u0438\u0441\u043b\u043e. \u0417\u0430\u043c\u0435\u0442\u0438\u043c \u0442\u0430\u043a \u0436\u0435 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043e\u0447\u0435\u0432\u0438\u0434\u043d\u0443\u044e \u0432\u0435\u0449\u044c, \u0447\u0442\u043e \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0443\u043c\u043d\u043e\u0436\u0435\u043d\u0438\u044f \u0434\u0432\u0443\u0445 \u0431\u0435\u0437\u0437\u043d\u0430\u043a\u043e\u0432\u044b\u0445 \u0446\u0435\u043b\u044b\u0445 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u0440\u0430\u0437\u043c\u0435\u0440\u0430 N \u044d\u0442\u043e \u0447\u0430\u0449\u0435 \u0447\u0438\u0441\u043b\u043e \u0440\u0430\u0437\u043c\u0435\u0440\u0430 \u0434\u043e 2 * N \u0432\u043a\u043b\u044e\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e. \u0421\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0436\u0435 \u043c\u043e\u0436\u0435\u0442 \u0432\u044b\u0437\u0432\u0430\u0442\u044c \u043f\u0435\u0440\u0435\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u043c\u0430\u043a\u0441\u0438\u043c\u0443\u043c \u043d\u0430 1 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u0431\u0438\u0442.<\/p>\n<p>  \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u0432\u044b\u0431\u0440\u0430\u0442\u044c \u0434\u0435\u043b\u0438\u0442\u0435\u043b\u044c <i>d<\/i>. \u041e\u0447\u0435\u0432\u0438\u0434\u043d\u043e, \u0447\u0442\u043e \u0432 \u0434\u0432\u043e\u0438\u0447\u043d\u043e\u043c \u043c\u0438\u0440\u0435 \u043b\u0443\u0447\u0448\u0435 \u0432\u0441\u0435\u0433\u043e \u0435\u0433\u043e \u0432\u044b\u0431\u0440\u0430\u0442\u044c \u0441\u0442\u0435\u043f\u0435\u043d\u044c\u044e \u0434\u0432\u043e\u0439\u043a\u0438, \u0447\u0442\u043e\u0431\u044b \u043d\u0435 \u0434\u0435\u043b\u0438\u0442\u044c, \u0430 \u043f\u0440\u043e\u0441\u0442\u043e \u0434\u0432\u0438\u0433\u0430\u0442\u044c \u0440\u0435\u0433\u0438\u0441\u0442\u0440, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440. \u041a\u0430\u043a\u0443\u044e \u0436\u0435 \u0441\u0442\u0435\u043f\u0435\u043d\u044c \u0434\u0432\u043e\u0439\u043a\u0438 \u0432\u044b\u0431\u0440\u0430\u0442\u044c? \u041f\u043e\u0434\u0441\u043a\u0430\u0437\u043a\u0443 \u043d\u0430\u0439\u0434\u0451\u043c \u0432 \u043c\u0430\u0448\u0438\u043d\u043d\u044b\u0445 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f\u0445 \u0443\u043c\u043d\u043e\u0436\u0435\u043d\u0438\u044f. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u0430\u044f \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f MUL \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u0435 x86 \u0443\u043c\u043d\u043e\u0436\u0430\u0435\u0442 2 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430 \u0438 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442 \u0442\u043e\u0436\u0435 \u0432 2 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430, \u0433\u0434\u0435 1 \u0438\u0437 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u043e\u0432 \u044d\u0442\u043e \u00ab\u0432\u0435\u0440\u0445\u043d\u044f\u044f \u0447\u0430\u0441\u0442\u044c\u00bb \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430, \u0430 \u0432\u0442\u043e\u0440\u043e\u0439 \u2014 \u043d\u0438\u0436\u043d\u044f\u044f \u0447\u0430\u0441\u0442\u044c. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0435\u0441\u043b\u0438 \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c 2 64-\u0431\u0438\u0442\u043d\u044b\u0445 \u0447\u0438\u0441\u043b\u0430, \u0442\u043e \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u043c \u0431\u0443\u0434\u0435\u0442 128-\u0431\u0438\u0442\u043d\u043e\u0435 \u0447\u0438\u0441\u043b\u043e, \u0437\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u043e\u0435 \u0432 \u0434\u0432\u0430 64-\u0431\u0438\u0442\u043d\u044b\u0445 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430. \u041d\u0430\u0437\u043e\u0432\u0451\u043c RH \u2014 \u00ab\u0432\u0435\u0440\u0445\u043d\u0438\u0439\u00bb \u0440\u0435\u0433\u0438\u0441\u0442\u0440, \u0430 RL \u2014 \u00ab\u043d\u0438\u0436\u043d\u0438\u0439\u00bb \u0440\u0435\u0433\u0438\u0441\u0442\u0440 <sup>1<\/sup>. \u0422\u043e\u0433\u0434\u0430, \u043c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438, \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0432 \u0432\u0438\u0434\u0435 <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/f5b\/4e9\/cae\/f5b4e9cae0a4549ff6156bfe89056a70.svg\" alt=\"$R=R_H \\cdot 2^{64}+R_L$\" data-tex=\"inline\"><\/math>. \u0422\u0435\u043f\u0435\u0440\u044c \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u0441\u044f \u0444\u043e\u0440\u043c\u0443\u043b\u0430\u043c\u0438 \u0441\u0432\u0435\u0440\u0445\u0443 \u0438 \u043d\u0430\u043f\u0438\u0448\u0435\u043c \u0443\u043c\u043d\u043e\u0436\u0435\u043d\u0438\u0435 \u0434\u043b\u044f <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/da3\/d42\/f60\/da3d42f60cef53f746390aa3f0b592c7.svg\" alt=\"$d=2^{-64}$\" data-tex=\"inline\"><\/math>  <\/p>\n<p><math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/169\/51b\/e0f\/16951be0f36bfe65b542f80e6be05ee7.svg\" alt=\"$\\frac{c}{d}=\\frac{a}{2^{64}}\\cdot\\frac{b}{2^{64}}=\\frac{a \\cdot b}{2^{128}}=\\frac{R_H \\cdot 2^{64} + R_L}{2^{128}}=\\frac{R_H + R_L \\cdot 2^{-64}}{2^{64}}$\" data-tex=\"display\"><\/math><\/p>\n<p>  \u0418 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u043c \u0443\u043c\u043d\u043e\u0436\u0435\u043d\u0438\u044f \u044d\u0442\u0438\u0445 \u0434\u0432\u0443\u0445 \u0447\u0438\u0441\u0435\u043b \u0441 \u0444\u0438\u043a\u0441\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0439 \u0442\u043e\u0447\u043a\u043e\u0439 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0440\u0435\u0433\u0438\u0441\u0442\u0440 <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/5f1\/a1b\/a4e\/5f1a1ba4edbd31bdbbb9bdfa2eb2d4ae.svg\" alt=\"$R=R_H$\" data-tex=\"inline\"><\/math>.<br \/>  \u0414\u043b\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u044b Aarch64 \u0432\u0441\u0451 \u0435\u0449\u0451 \u043f\u0440\u043e\u0449\u0435. \u041a\u043e\u043c\u0430\u043d\u0434\u0430 \u00abUMULH\u00bb \u0443\u043c\u043d\u043e\u0436\u0430\u0435\u0442 \u0434\u0432\u0430 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430 \u0438 \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442 \u0432 3-\u0438\u0439 \u0440\u0435\u0433\u0438\u0441\u0442\u0440 \u00ab\u0432\u0435\u0440\u0445\u043d\u044e\u044e\u00bb \u0447\u0430\u0441\u0442\u044c \u0443\u043c\u043d\u043e\u0436\u0435\u043d\u0438\u044f.<\/p>\n<p>  \u041d\u0443 \u0447\u0442\u043e \u0436\u0435. \u0427\u0438\u0441\u043b\u043e \u0441 \u0444\u0438\u043a\u0441\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0439 \u0442\u043e\u0447\u043a\u043e\u0439 \u043c\u044b \u0437\u0430\u0434\u0430\u043b\u0438, \u043d\u043e \u043e\u0441\u0442\u0430\u0451\u0442\u0441\u044f \u0435\u0449\u0451 \u043e\u0434\u043d\u0430 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430. \u041e\u0442\u0440\u0438\u0446\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0447\u0438\u0441\u043b\u0430. \u0412 \u0440\u044f\u0434\u0443 \u0422\u0435\u0439\u043b\u043e\u0440\u0430 \u0440\u0430\u0437\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0438\u0434\u0451\u0442 \u0441 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u043c \u0437\u043d\u0430\u043a\u043e\u043c. \u0427\u0442\u043e\u0431\u044b \u0441\u043f\u0440\u0430\u0432\u0438\u0442\u0441\u044f \u0441 \u044d\u0442\u043e\u0439 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u043e\u0439 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u0443\u0435\u043c \u0444\u043e\u0440\u043c\u0443\u043b\u0443 \u0440\u0430\u0441\u0447\u0451\u0442\u0430 \u043f\u043e\u043b\u0438\u043d\u043e\u043c\u0430 \u043f\u043e \u043c\u0435\u0442\u043e\u0434\u0443 \u0413\u043e\u043d\u0435\u0440\u0430, \u043a \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c\u0443 \u0432\u0438\u0434\u0443:  <\/p>\n<p><math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/663\/213\/ddb\/663213ddbfcf05f621769c0c45513857.svg\" alt=\"$\\sin(x)\\approx x(1-x^2(1\/3!-x^2(1\/5!-x^2(1\/7!-x^2\\cdot1\/9!))))$\" data-tex=\"display\"><\/math><\/p>\n<p>  \u041f\u0440\u043e\u0432\u0435\u0440\u044c\u0442\u0435, \u0447\u0442\u043e \u043e\u043d\u0430 \u0441 \u043c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0442\u043e\u0447\u043a\u0438 \u0437\u0440\u0435\u043d\u0438\u044f \u0430\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u043e \u0442\u0430\u043a\u0430\u044f \u0436\u0435, \u043a\u0430\u043a \u0438 \u0438\u0441\u0445\u043e\u0434\u043d\u0430\u044f \u0444\u043e\u0440\u043c\u0443\u043b\u0430. \u041d\u043e \u0432 \u043a\u0430\u0436\u0434\u043e\u0439 \u0441\u043a\u043e\u0431\u043a\u0435 \u0447\u0438\u0441\u043b\u043e \u0432\u0438\u0434\u0430 <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/57b\/fcd\/b6d\/57bfcdb6df6f6cf76f04f8affae4ca9a.svg\" alt=\"$1\/(2n + 1)! - x^2\\cdot(\\cdots)$\" data-tex=\"inline\"><\/math> \u0432\u0441\u0435\u0433\u0434\u0430 \u043f\u043e\u043b\u043e\u0436\u0438\u0442\u0435\u043b\u044c\u043d\u043e. \u0422.\u0435. \u0442\u0430\u043a\u043e\u0435 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0440\u0430\u0441\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0442\u044c \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0432 \u0431\u0435\u0437\u0437\u043d\u0430\u043a\u043e\u0432\u044b\u0445 \u0446\u0435\u043b\u044b\u0445 \u0447\u0438\u0441\u043b\u0430\u0445.<\/p>\n<pre><code class=\"cpp\">constexpr mynumber toint    = {{0x00000000, 0x43F00000}};  \/*  18446744073709551616 = 2^64     *\/ constexpr mynumber todouble = {{0x00000000, 0x3BF00000}};  \/*  ~5.42101086242752217003726400434E-20 = 2^-64     *\/  double sin_e7(double xd) {   uint64_t x = xd * toint.x;   uint64_t xx = mul2(x, x);   uint64_t res = tsx[19];    for(int i = 17; i &gt;= 3; i -= 2) {     res = tsx[i] - mul2(res, xx);   }   res = mul2(res, xx);   res = x - mul2(x, res);   return res * todouble.x; } <\/code><\/pre>\n<div class=\"spoiler\" role=\"button\" tabindex=\"0\">                         <b class=\"spoiler_title\">\u0417\u043d\u0430\u0447\u0435\u043d\u0438\u044f tsx[i]<\/b>                         <\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"cpp\">constexpr array&lt;uint64_t, 18&gt; tsx = { \/\/ 2^64\/i!     0x0000000000000000LL,     0x0000000000000000LL,     0x8000000000000000LL,     0x2aaaaaaaaaaaaaaaLL, \/\/ Change to 0x2aaaaaaaaaaaaaafLL and check.     0x0aaaaaaaaaaaaaaaLL,     0x0222222222222222LL,     0x005b05b05b05b05bLL,     0x000d00d00d00d00dLL,     0x0001a01a01a01a01LL,     0x00002e3bc74aad8eLL,     0x0000049f93edde27LL,     0x0000006b99159fd5LL,     0x00000008f76c77fcLL,     0x00000000b092309dLL,     0x000000000c9cba54LL,     0x0000000000d73f9fLL,     0x00000000000d73f9LL,     0x000000000000ca96LL }; <\/code><\/pre>\n<p>  <\/div>\n<\/p><\/div>\n<p>  \u0413\u0434\u0435 <math><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/0b4\/220\/e48\/0b4220e48ee7d836f7ec713eaf0cf8ba.svg\" alt=\"$tsx[i]=1\/i!$\" data-tex=\"inline\"><\/math> \u0432 \u0444\u043e\u0440\u043c\u0430\u0442\u0435 \u0441 \u0444\u0438\u043a\u0441\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0439 \u0442\u043e\u0447\u043a\u043e\u0439. \u0412 \u044d\u0442\u043e\u0442 \u0440\u0430\u0437 \u0434\u043b\u044f \u0443\u0434\u043e\u0431\u0441\u0442\u0432\u0430 \u044f \u0432\u044b\u043b\u043e\u0436\u0438\u043b \u0432\u0435\u0441\u044c \u043a\u043e\u0434 \u043d\u0430 \u0433\u0438\u0442\u0445\u0430\u0431 <a href=\"https:\/\/github.com\/orex\/fast_sine\/blob\/master\/main.cpp\" rel=\"nofollow\">fast_sine<\/a>, \u0438\u0437\u0431\u0430\u0432\u0438\u043b\u0441\u044f \u043e\u0442 quadmath \u0434\u043b\u044f \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u043e\u0441\u0442\u0438 \u0441 clang \u0438 arm. \u0418 \u043f\u043e\u043c\u0435\u043d\u044f\u043b \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043c\u0435\u0442\u043e\u0434\u0438\u043a\u0443 \u0440\u0430\u0441\u0447\u0451\u0442\u0430 \u043f\u043e\u0433\u0440\u0435\u0448\u043d\u043e\u0441\u0442\u0438.<\/p>\n<p>  \u0414\u0430\u043d\u043d\u044b\u0435 \u043f\u043e \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044e \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0441\u0438\u043d\u0443\u0441\u0430 \u0438 fixed point \u0434\u0430\u043d\u044b \u0432 \u0434\u0432\u0443\u0445 \u0442\u0430\u0431\u043b\u0438\u0446\u0430\u0445 \u043d\u0438\u0436\u0435. \u0412 \u043f\u0435\u0440\u0432\u043e\u0439 \u0442\u0430\u0431\u043b\u0438\u0446\u0435 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u0430 \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c \u0440\u0430\u0441\u0447\u0451\u0442\u043e\u0432 (\u043e\u043d\u0430 \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u0441\u043e\u0432\u043f\u0430\u0434\u0430\u0435\u0442 \u0434\u043b\u044f x86_64 \u0438 ARM). \u0412\u043e \u0432\u0442\u043e\u0440\u043e\u0439 \u0442\u0430\u0431\u043b\u0438\u0446\u0435 \u2014 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438.<\/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>\u041a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043e\u0448\u0438\u0431\u043e\u043a<\/b><\/td>\n<td><b>\u041c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 ULP<\/b><\/td>\n<td><b>\u0421\u0440\u0435\u0434\u043d\u0435\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043e\u0442\u043a\u043b\u043e\u043d\u0435\u043d\u0438\u044f<\/b><\/td>\n<\/tr>\n<tr>\n<td>sin_e7<\/td>\n<td>0.0822187%<\/td>\n<td>0.504787<\/td>\n<td>7.10578e-20<\/td>\n<\/tr>\n<tr>\n<td>sin_e7a<\/td>\n<td>0.0560688%<\/td>\n<td>0.503336<\/td>\n<td>2.0985e-20<\/td>\n<\/tr>\n<tr>\n<td>std::sin<\/td>\n<td>0.234681%<\/td>\n<td>0.515376<\/td>\n<td>&#8212;<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p>  \u041f\u0440\u0438 \u043f\u0440\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u00ab\u0438\u0441\u0442\u0438\u043d\u043d\u043e\u0435\u00bb \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0441\u0438\u043d\u0443\u0441\u0430 \u0441\u0447\u0438\u0442\u0430\u043b\u043e\u0441\u044c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 <a href=\"https:\/\/www.mpfr.org\/\" rel=\"nofollow\">MPFR<\/a>. \u041c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 ULP \u0441\u0447\u0438\u0442\u0430\u043b\u043e\u0441\u044c, \u043a\u0430\u043a \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0435 \u043e\u0442\u043a\u043b\u043e\u043d\u0435\u043d\u0438\u0435 \u043e\u0442 \u00ab\u0438\u0441\u0442\u0438\u043d\u043d\u043e\u0433\u043e\u00bb \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f. \u041f\u0440\u043e\u0446\u0435\u043d\u0442 \u043e\u0448\u0438\u0431\u043e\u043a \u2014 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0441\u043b\u0443\u0447\u0430\u0435\u0432, \u043a\u043e\u0433\u0434\u0430 \u0440\u0430\u0441\u0441\u0447\u0438\u0442\u0430\u043d\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0441\u0438\u043d\u0443\u0441\u0430 \u043d\u0430\u043c\u0438 \u0438\u043b\u0438 libm \u0431\u0438\u043d\u0430\u0440\u043d\u043e \u043d\u0435 \u0441\u043e\u0432\u043f\u0430\u0434\u0430\u043b\u043e \u0441 \u043e\u043a\u0440\u0443\u0433\u043b\u0451\u043d\u043d\u044b\u043c \u0434\u043e double \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435\u043c \u0441\u0438\u043d\u0443\u0441\u0430. \u0421\u0440\u0435\u0434\u043d\u0435\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043e\u0442\u043a\u043b\u043e\u043d\u0435\u043d\u0438\u044f \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u00ab\u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435\u00bb \u043e\u0448\u0438\u0431\u043a\u0438 \u0440\u0430\u0441\u0447\u0451\u0442\u043e\u0432: \u0437\u0430\u0432\u044b\u0448\u0435\u043d\u0438\u0435 \u0438\u043b\u0438 \u0437\u0430\u043d\u0438\u0436\u0435\u043d\u0438\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f. \u041a\u0430\u043a \u0432\u0438\u0434\u043d\u043e \u0438\u0437 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u043d\u0430\u0448\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0441\u043a\u043b\u043e\u043d\u043d\u0430 \u0437\u0430\u0432\u044b\u0448\u0430\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0441\u0438\u043d\u0443\u0441\u0430. \u042d\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043f\u0440\u0430\u0432\u0438\u0442\u044c! \u041a\u0442\u043e \u0441\u043a\u0430\u0437\u0430\u043b, \u0447\u0442\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f tsx \u0434\u043e\u043b\u0436\u043d\u044b \u0431\u044b\u0442\u044c \u0440\u0430\u0432\u043d\u044b \u0442\u043e\u0447\u043d\u043e \u043a\u043e\u044d\u0444\u0444\u0438\u0446\u0438\u0435\u043d\u0442\u0430\u043c \u0440\u044f\u0434\u0430 \u0422\u0435\u0439\u043b\u043e\u0440\u0430. \u041d\u0430\u043f\u0440\u0430\u0448\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043e\u0447\u0435\u0432\u0438\u0434\u043d\u0430\u044f \u0438\u0434\u0435\u044f \u043f\u0440\u043e\u0432\u0430\u0440\u044c\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043a\u043e\u044d\u0444\u0444\u0438\u0446\u0438\u0435\u043d\u0442\u043e\u0432, \u0447\u0442\u043e\u0431\u044b \u0443\u043b\u0443\u0447\u0448\u0438\u0442\u044c \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c \u0430\u043f\u043f\u0440\u043e\u043a\u0441\u0438\u043c\u0430\u0446\u0438\u0438 \u0438 \u0443\u0431\u0440\u0430\u0442\u044c \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u0443\u044e \u0441\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0449\u0443\u044e \u043e\u0448\u0438\u0431\u043a\u0438. \u0413\u0440\u0430\u043c\u043e\u0442\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0442\u0430\u043a\u0443\u044e \u0432\u0430\u0440\u0438\u0430\u0446\u0438\u044e \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0441\u043b\u043e\u0436\u043d\u043e. \u041d\u043e \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c \u043c\u044b \u043c\u043e\u0436\u0435\u043c. \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0432\u043e\u0437\u044c\u043c\u0435\u043c, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, 4-\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0438\u0437 \u043c\u0430\u0441\u0441\u0438\u0432\u0430 \u043a\u043e\u044d\u0444\u0444\u0438\u0446\u0438\u0435\u043d\u0442\u043e\u0432 tsx (tsx[3]) \u0438 \u043f\u043e\u043c\u0435\u043d\u044f\u0435\u043c \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0435 \u0447\u0438\u0441\u043b\u043e a \u043d\u0430 f. \u041f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u0442\u0438\u043c \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0443 \u0438 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0430 \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c (sin_e7a). \u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u0442\u0435, \u043e\u043d\u0430 \u043d\u0435\u043c\u043d\u043e\u0433\u043e, \u043d\u043e \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u043b\u0430\u0441\u044c! \u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0432 \u043d\u0430\u0448\u0443 \u043a\u043e\u043f\u0438\u043b\u043a\u0443 \u0438 \u044d\u0442\u043e\u0442 \u0441\u043f\u043e\u0441\u043e\u0431.<\/p>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u0447\u0442\u043e \u0441 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c\u044e. \u0414\u043b\u044f \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u044f \u0432\u0437\u044f\u043b \u0447\u0442\u043e \u0431\u044b\u043b\u043e \u043f\u043e\u0434 \u0440\u0443\u043a\u043e\u0439 i5 mobile \u0438 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0440\u0430\u0437\u043e\u0433\u043d\u0430\u043d\u043d\u0443\u044e \u0447\u0435\u0442\u0432\u0451\u0440\u0442\u0443\u044e \u043c\u0430\u043b\u0438\u043d\u043a\u0443 (Raspberry PI 4 8GB), GCC10 \u0438\u0437 \u0434\u0438\u0441\u0442\u0440\u0438\u0431\u0443\u0442\u0438\u0432\u0430 Ubuntu 20.04 x64 \u0434\u043b\u044f \u043e\u0431\u043e\u0438\u0445 \u0441\u0438\u0441\u0442\u0435\u043c.<\/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>x86_64 \u0432\u0440\u0435\u043c\u044f, c <\/b><\/td>\n<td><b>ARM \u0432\u0440\u0435\u043c\u044f, c<\/b><\/td>\n<\/tr>\n<tr>\n<td>sin_e7<\/td>\n<td>0.174371<\/td>\n<td>0.469210<\/td>\n<\/tr>\n<tr>\n<td>std::sin<\/td>\n<td>0.154805<\/td>\n<td>0.447807<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p>  \u042f \u043d\u0435 \u043f\u0440\u0435\u0442\u0435\u043d\u0434\u0443\u044e \u043d\u0430 \u0431\u043e\u043b\u044c\u0448\u0443\u044e \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0445 \u0438\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u0439. \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u044b \u0432\u0430\u0440\u0438\u0430\u0446\u0438\u0438 \u0432 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0434\u0435\u0441\u044f\u0442\u043a\u043e\u0432 \u043f\u0440\u043e\u0446\u0435\u043d\u0442\u043e\u0432 \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043d\u043d\u043e\u0441\u0442\u0438 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u0430. \u041e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u0432\u044b\u0432\u043e\u0434 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043c\u043e\u0436\u043d\u043e \u0438 \u0442\u0430\u043a. \u041f\u0435\u0440\u0435\u0445\u043e\u0434 \u043d\u0430 \u0446\u0435\u043b\u043e\u0447\u0438\u0441\u043b\u0435\u043d\u043d\u0443\u044e \u0430\u0440\u0438\u0444\u043c\u0435\u0442\u0438\u043a\u0443 \u043d\u0435 \u0434\u0430\u0451\u0442 \u0432\u044b\u0438\u0433\u0440\u044b\u0448 \u0432 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u043d\u0430 \u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u0430\u0445<sup>2<\/sup>. \u041d\u0435\u0432\u043e\u043e\u0431\u0440\u0430\u0437\u0438\u043c\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0442\u0440\u0430\u043d\u0437\u0438\u0441\u0442\u043e\u0440\u043e\u0432 \u0432 \u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u0430\u0445 \u0434\u0435\u043b\u0430\u0435\u0442 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u043c \u0431\u044b\u0441\u0442\u0440\u043e \u0434\u0435\u043b\u0430\u0442\u044c \u0441\u043b\u043e\u0436\u043d\u044b\u0435 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f. \u041d\u043e, \u044f \u0434\u0443\u043c\u0430\u044e, \u0447\u0442\u043e \u043d\u0430 \u0442\u0430\u043a\u0438\u0445 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u0430\u0445, \u043a\u0430\u043a Intel Atom, \u0430 \u0442\u0430\u043a \u0436\u0435 \u043d\u0430 \u0441\u043b\u0430\u0431\u044b\u0445 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430\u0445 \u0434\u0430\u043d\u043d\u044b\u0439 \u043f\u043e\u0434\u0445\u043e\u0434 \u043c\u043e\u0436\u0435\u0442 \u0434\u0430\u0442\u044c \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 \u043f\u0440\u0438\u0440\u043e\u0441\u0442 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438. \u0410 \u0432\u044b \u0447\u0442\u043e \u0434\u0443\u043c\u0430\u0435\u0442\u0435?<\/p>\n<p>  \u0425\u043e\u0442\u044f \u0434\u0430\u043d\u043d\u044b\u0439 \u043f\u043e\u0434\u0445\u043e\u0434 \u0434\u0430\u043b \u043f\u0440\u0438\u0440\u043e\u0441\u0442 \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u0438, \u0432\u0441\u0451 \u0442\u0430\u043a\u0438 \u044d\u0442\u043e\u0442 \u043f\u0440\u0438\u0440\u043e\u0441\u0442 \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u0438 \u043a\u0430\u0436\u0435\u0442\u0441\u044f \u0431\u043e\u043b\u0435\u0435 \u043b\u044e\u0431\u043e\u043f\u044b\u0442\u043d\u044b\u043c, \u0447\u0435\u043c \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u043c. \u041f\u043e \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0434\u0430\u043d\u043d\u044b\u0439 \u043f\u043e\u0434\u0445\u043e\u0434 \u043c\u043e\u0436\u0435\u0442 \u0441\u0435\u0431\u044f \u043d\u0430\u0439\u0442\u0438, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0432 IoT. \u041d\u043e \u0434\u043b\u044f \u0432\u044b\u0441\u043e\u043a\u043e\u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0439 \u043e\u043d \u0443\u0436\u0435 \u0441\u043e\u0432\u0441\u0435\u043c \u043d\u0435 \u043c\u0430\u0438\u043d\u0441\u0442\u0440\u0438\u043c. \u0412 \u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u043c \u043c\u0438\u0440\u0435 SSE\/AVX\/CUDA \u043f\u0440\u0435\u0434\u043f\u043e\u0447\u0438\u0442\u0430\u044e\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u044b\u0439 \u0440\u0430\u0441\u0447\u0451\u0442 \u0444\u0443\u043d\u043a\u0446\u0438\u0439. \u041f\u0440\u0438\u0447\u0435\u043c \u0432 \u0430\u0440\u0438\u0444\u043c\u0435\u0442\u0438\u043a\u0435 \u0441 \u043f\u043b\u0430\u0432\u0430\u044e\u0449\u0435\u0439 \u0442\u043e\u0447\u043a\u043e\u0439. \u041f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u044b\u0445 \u0430\u043d\u0430\u043b\u043e\u0433\u043e\u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 MUL \u043d\u0435\u0442. \u0421\u0430\u043c\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u044d\u0442\u043e \u0443\u0436\u0435 \u0441\u043a\u043e\u0440\u0435\u0435 \u0434\u0430\u043d\u044c \u0442\u0440\u0430\u0434\u0438\u0446\u0438\u0438.<\/p>\n<p>  \u0412 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u0433\u043b\u0430\u0432\u0435 \u044f \u043e\u043f\u0438\u0448\u0443, \u043a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c AVX \u0434\u043b\u044f \u0440\u0430\u0441\u0447\u0451\u0442\u043e\u0432. \u041e\u043f\u044f\u0442\u044c \u0436\u0435 \u0437\u0430\u043b\u0435\u0437\u0435\u043c \u0432 \u043a\u043e\u0434 libm \u0438 \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u0435\u0433\u043e \u0443\u043b\u0443\u0447\u0448\u0438\u0442\u044c.<\/p>\n<p>  <sup>1<\/sup> \u0420\u0435\u0433\u0438\u0441\u0442\u0440\u043e\u0432 \u0441 \u0442\u0430\u043a\u0438\u043c\u0438 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044f\u043c\u0438 \u0432 \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b\u0445 \u043c\u043d\u0435 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u0430\u0445 \u043d\u0435\u0442. \u0418\u043c\u0435\u043d\u0430 \u0431\u044b\u043b\u0438 \u0432\u044b\u0431\u0440\u0430\u043d\u044b, \u0434\u043b\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u0430.<br \/>  <sup>2<\/sup> \u0422\u0443\u0442 \u043d\u0430\u0434\u043e \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u043c\u043e\u0439 ARM \u043e\u0431\u043e\u0440\u0443\u0434\u043e\u0432\u0430\u043d \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0439 \u0432\u0435\u0440\u0441\u0438\u0435\u0439 \u043c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0441\u043e\u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u0430. \u0415\u0441\u043b\u0438 \u0431\u044b \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440 \u044d\u043c\u0443\u043b\u0438\u0440\u043e\u0432\u0430\u043b \u0431\u044b \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f \u0441 \u043f\u043b\u0430\u0432\u0430\u044e\u0449\u0435\u0439 \u0442\u043e\u0447\u043a\u043e\u0439, \u0442\u043e \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u043c\u043e\u0433\u043b\u0438 \u0431\u044b \u0440\u0430\u0437\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0440\u0430\u0437\u043b\u0438\u0447\u0430\u0442\u044c\u0441\u044f.<\/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\/527226\/\"> https:\/\/habr.com\/ru\/post\/527226\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\">\u041f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u0435\u043c \u0446\u0438\u043a\u043b \u043b\u0435\u043a\u0446\u0438\u0439 (<a href=\"https:\/\/habr.com\/ru\/post\/526000\/\">\u0447\u0430\u0441\u0442\u044c 1<\/a> \u0438 <a href=\"https:\/\/habr.com\/ru\/post\/526518\/\">\u0447\u0430\u0441\u0442\u044c 2<\/a>). \u0412 \u0447\u0430\u0441\u0442\u0438 2 \u043c\u044b \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u043b\u0438, \u0447\u0442\u043e \u0432\u043d\u0443\u0442\u0440\u0438 \u0443 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 libm \u0438 \u0432 \u0434\u0430\u043d\u043d\u043e\u0439 \u0440\u0430\u0431\u043e\u0442\u0435 \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043f\u0435\u0440\u0435\u0434\u0435\u043b\u0430\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u044e do_sin, \u0447\u0442\u043e\u0431\u044b \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0442\u044c \u0435\u0451 \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c \u0438 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u044b. \u041f\u0440\u0438\u0432\u0435\u0434\u0443 \u044d\u0442\u0443 \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0435\u0449\u0451 \u0440\u0430\u0437 <a href=\"https:\/\/github.com\/bminor\/glibc\/blob\/fd0981e4028b79b061b458acbc10315e05972ada\/sysdeps\/ieee754\/dbl-64\/s_sin.c#L120\" rel=\"nofollow\">do_sin<\/a>):<br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/et\/05\/_h\/et05_hcfeh1trrrwq4vibhs41sg.png\" alt=\"image\"><br \/>  \u041a\u0430\u043a \u0431\u044b\u043b\u043e \u043f\u043e\u043a\u0430\u0437\u0430\u043d\u043e \u0432 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u0447\u0430\u0441\u0442\u044c 132-145. \u0412\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u0434\u043b\u044f x \u0432 \u043f\u0440\u0435\u0434\u0435\u043b\u0430\u0445 [0.126, 0.855469]. \u041d\u0443 \u0447\u0442\u043e. \u041f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u044e, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0432 \u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u0440\u0435\u0434\u0435\u043b\u0430\u0445 \u0431\u0443\u0434\u0435\u0442 \u0442\u043e\u0447\u043d\u0435\u0435 \u0438, \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u0431\u044b\u0441\u0442\u0440\u0435\u0435.  <\/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-312856","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/312856","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=312856"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/312856\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=312856"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=312856"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=312856"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}