UNPKG

double-double

Version:

Pure double-double precision functions *with strict error bounds*.

1 lines 5.65 kB
(window.webpackJsonp=window.webpackJsonp||[]).push([[46],{182:function(e,t,r){"use strict";r.r(t),r.d(t,"frontMatter",(function(){return b})),r.d(t,"metadata",(function(){return c})),r.d(t,"rightToc",(function(){return l})),r.d(t,"default",(function(){return i}));var n=r(2),a=r(9),o=(r(0),r(207)),b={id:"_basic_two_product_",title:"twoProduct",sidebar_label:"twoProduct"},c={id:"modules/_basic_two_product_",isDocsHomePage:!1,title:"twoProduct",description:"twoProduct(a number): number[]",source:"@site/docs\\modules\\_basic_two_product_.md",permalink:"/double-double/docs/modules/_basic_two_product_",sidebar_label:"twoProduct",sidebar:"sidebar",previous:{title:"twoDiff",permalink:"/double-double/docs/modules/_basic_two_diff_"},next:{title:"twoSquare",permalink:"/double-double/docs/modules/_basic_two_square_"}},l=[],u={rightToc:l};function i(e){var t=e.components,r=Object(a.a)(e,["components"]);return Object(o.b)("wrapper",Object(n.a)({},u,r,{components:t,mdxType:"MDXLayout"}),Object(o.b)("p",null,Object(o.b)("strong",{parentName:"p"},"twoProduct"),"(",Object(o.b)("inlineCode",{parentName:"p"},"a"),": number, ",Object(o.b)("inlineCode",{parentName:"p"},"b"),": number): ",Object(o.b)("em",{parentName:"p"},"number[]")),Object(o.b)("p",null,Object(o.b)("em",{parentName:"p"},"Defined in ",Object(o.b)("a",Object(n.a)({parentName:"em"},{href:"https://github.com/FlorisSteenkamp/double-double/blob/d35ae52/src/basic/two-product.ts#L21"}),"basic/two-product.ts:21"))),Object(o.b)("p",null,"Returns the exact result of multiplying two doubles."),Object(o.b)("ul",null,Object(o.b)("li",{parentName:"ul"},"the resulting array is the reverse of the standard twoSum in the literature.")),Object(o.b)("p",null,"Theorem 18 (Shewchuk): Let a and b be p-bit floating-point numbers, where\np >= 6. Then the following algorithm will produce a nonoverlapping expansion\nx + y such that ab = x + y, where x is an approximation to ab and y\nrepresents the roundoff error in the calculation of x. Furthermore, if\nround-to-even tiebreaking is used, x and y are non-adjacent."),Object(o.b)("p",null,"See ",Object(o.b)("a",Object(n.a)({parentName:"p"},{href:"https://people.eecs.berkeley.edu/~jrs/papers/robustr.pdf"}),"https://people.eecs.berkeley.edu/~jrs/papers/robustr.pdf")),Object(o.b)("p",null,Object(o.b)("strong",{parentName:"p"},"Parameters:")),Object(o.b)("table",null,Object(o.b)("thead",{parentName:"table"},Object(o.b)("tr",{parentName:"thead"},Object(o.b)("th",Object(n.a)({parentName:"tr"},{align:null}),"Name"),Object(o.b)("th",Object(n.a)({parentName:"tr"},{align:null}),"Type"),Object(o.b)("th",Object(n.a)({parentName:"tr"},{align:null}),"Description"))),Object(o.b)("tbody",{parentName:"table"},Object(o.b)("tr",{parentName:"tbody"},Object(o.b)("td",Object(n.a)({parentName:"tr"},{align:null}),Object(o.b)("inlineCode",{parentName:"td"},"a")),Object(o.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"number"),Object(o.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"A double")),Object(o.b)("tr",{parentName:"tbody"},Object(o.b)("td",Object(n.a)({parentName:"tr"},{align:null}),Object(o.b)("inlineCode",{parentName:"td"},"b")),Object(o.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"number"),Object(o.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"Another double")))),Object(o.b)("p",null,Object(o.b)("strong",{parentName:"p"},"Returns:")," ",Object(o.b)("em",{parentName:"p"},"number[]")))}i.isMDXComponent=!0},207:function(e,t,r){"use strict";r.d(t,"a",(function(){return p})),r.d(t,"b",(function(){return m}));var n=r(0),a=r.n(n);function o(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function b(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function c(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?b(Object(r),!0).forEach((function(t){o(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):b(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function l(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}var u=a.a.createContext({}),i=function(e){var t=a.a.useContext(u),r=t;return e&&(r="function"==typeof e?e(t):c(c({},t),e)),r},p=function(e){var t=i(e.components);return a.a.createElement(u.Provider,{value:t},e.children)},d={inlineCode:"code",wrapper:function(e){var t=e.children;return a.a.createElement(a.a.Fragment,{},t)}},s=a.a.forwardRef((function(e,t){var r=e.components,n=e.mdxType,o=e.originalType,b=e.parentName,u=l(e,["components","mdxType","originalType","parentName"]),p=i(r),s=n,m=p["".concat(b,".").concat(s)]||p[s]||d[s]||o;return r?a.a.createElement(m,c(c({ref:t},u),{},{components:r})):a.a.createElement(m,c({ref:t},u))}));function m(e,t){var r=arguments,n=t&&t.mdxType;if("string"==typeof e||n){var o=r.length,b=new Array(o);b[0]=s;var c={};for(var l in t)hasOwnProperty.call(t,l)&&(c[l]=t[l]);c.originalType=e,c.mdxType="string"==typeof e?e:n,b[1]=c;for(var u=2;u<o;u++)b[u]=r[u];return a.a.createElement.apply(null,b)}return a.a.createElement.apply(null,r)}s.displayName="MDXCreateElement"}}]);