{"ScriptPreparationCode":"function multiply(out, a, b) {\r\n\t\tlet b0 = b[0]\r\n\t\tlet b1 = b[1]\r\n\t\tlet b2 = b[2]\r\n\t\tlet b3 = b[3]\r\n\t\t\r\n\t\tout[0] = b0 * a[0] \u002B b1 * a[4] \u002B b2 * a[8] \u002B b3 * a[12]\r\n\t\tout[1] = b0 * a[1] \u002B b1 * a[5] \u002B b2 * a[9] \u002B b3 * a[13]\r\n\t\tout[2] = b0 * a[2] \u002B b1 * a[6] \u002B b2 * a[10] \u002B b3 * a[14]\r\n\t\tout[3] = b0 * a[3] \u002B b1 * a[7] \u002B b2 * a[11] \u002B b3 * a[15]\r\n\r\n\t\tb0 = b[4]\r\n\t\tb1 = b[5]\r\n\t\tb2 = b[6]\r\n\t\tb3 = b[7]\r\n\t\t\r\n\t\tout[4] = b0 * a[0] \u002B b1 * a[4] \u002B b2 * a[8] \u002B b3 * a[12]\r\n\t\tout[5] = b0 * a[1] \u002B b1 * a[5] \u002B b2 * a[9] \u002B b3 * a[13]\r\n\t\tout[6] = b0 * a[2] \u002B b1 * a[6] \u002B b2 * a[10] \u002B b3 * a[14]\r\n\t\tout[7] = b0 * a[3] \u002B b1 * a[7] \u002B b2 * a[11] \u002B b3 * a[15]\r\n\r\n\t\tb0 = b[8]\r\n\t\tb1 = b[9]\r\n\t\tb2 = b[10]\r\n\t\tb3 = b[11]\r\n\r\n\t\tout[8] = b0 * a[0] \u002B b1 * a[4] \u002B b2 * a[8] \u002B b3 * a[12]\r\n\t\tout[9] = b0 * a[1] \u002B b1 * a[5] \u002B b2 * a[9] \u002B b3 * a[13]\r\n\t\tout[10] = b0 * a[2] \u002B b1 * a[6] \u002B b2 * a[10] \u002B b3 * a[14]\r\n\t\tout[11] = b0 * a[3] \u002B b1 * a[7] \u002B b2 * a[11] \u002B b3 * a[15]\r\n\r\n\t\tb0 = b[12]\r\n\t\tb1 = b[13]\r\n\t\tb2 = b[14]\r\n\t\tb3 = b[15]\r\n\r\n\t\tout[12] = b0 * a[0] \u002B b1 * a[4] \u002B b2 * a[8] \u002B b3 * a[12]\r\n\t\tout[13] = b0 * a[1] \u002B b1 * a[5] \u002B b2 * a[9] \u002B b3 * a[13]\r\n\t\tout[14] = b0 * a[2] \u002B b1 * a[6] \u002B b2 * a[10] \u002B b3 * a[14]\r\n\t\tout[15] = b0 * a[3] \u002B b1 * a[7] \u002B b2 * a[11] \u002B b3 * a[15]\r\n\t\t\r\n\t\treturn out\r\n\t}\r\n\r\nfunction multiplyCached(out, a, b) {\r\n let a00 = a[0],\r\n a01 = a[1],\r\n a02 = a[2],\r\n a03 = a[3];\r\n let a10 = a[4],\r\n a11 = a[5],\r\n a12 = a[6],\r\n a13 = a[7];\r\n let a20 = a[8],\r\n a21 = a[9],\r\n a22 = a[10],\r\n a23 = a[11];\r\n let a30 = a[12],\r\n a31 = a[13],\r\n a32 = a[14],\r\n a33 = a[15];\r\n\r\n // Cache only the current line of the second matrix\r\n let b0 = b[0],\r\n b1 = b[1],\r\n b2 = b[2],\r\n b3 = b[3];\r\n out[0] = b0 * a00 \u002B b1 * a10 \u002B b2 * a20 \u002B b3 * a30;\r\n out[1] = b0 * a01 \u002B b1 * a11 \u002B b2 * a21 \u002B b3 * a31;\r\n out[2] = b0 * a02 \u002B b1 * a12 \u002B b2 * a22 \u002B b3 * a32;\r\n out[3] = b0 * a03 \u002B b1 * a13 \u002B b2 * a23 \u002B b3 * a33;\r\n\r\n b0 = b[4];\r\n b1 = b[5];\r\n b2 = b[6];\r\n b3 = b[7];\r\n out[4] = b0 * a00 \u002B b1 * a10 \u002B b2 * a20 \u002B b3 * a30;\r\n out[5] = b0 * a01 \u002B b1 * a11 \u002B b2 * a21 \u002B b3 * a31;\r\n out[6] = b0 * a02 \u002B b1 * a12 \u002B b2 * a22 \u002B b3 * a32;\r\n out[7] = b0 * a03 \u002B b1 * a13 \u002B b2 * a23 \u002B b3 * a33;\r\n\r\n b0 = b[8];\r\n b1 = b[9];\r\n b2 = b[10];\r\n b3 = b[11];\r\n out[8] = b0 * a00 \u002B b1 * a10 \u002B b2 * a20 \u002B b3 * a30;\r\n out[9] = b0 * a01 \u002B b1 * a11 \u002B b2 * a21 \u002B b3 * a31;\r\n out[10] = b0 * a02 \u002B b1 * a12 \u002B b2 * a22 \u002B b3 * a32;\r\n out[11] = b0 * a03 \u002B b1 * a13 \u002B b2 * a23 \u002B b3 * a33;\r\n\r\n b0 = b[12];\r\n b1 = b[13];\r\n b2 = b[14];\r\n b3 = b[15];\r\n out[12] = b0 * a00 \u002B b1 * a10 \u002B b2 * a20 \u002B b3 * a30;\r\n out[13] = b0 * a01 \u002B b1 * a11 \u002B b2 * a21 \u002B b3 * a31;\r\n out[14] = b0 * a02 \u002B b1 * a12 \u002B b2 * a22 \u002B b3 * a32;\r\n out[15] = b0 * a03 \u002B b1 * a13 \u002B b2 * a23 \u002B b3 * a33;\r\n return out;\r\n}","TestCases":[{"Name":"With cache","Code":"let result = [0, 0, 0, 0]\r\nmultiplyCached(result, [123.12, 131.31, 143.12, 0.123], [143.12, 0.123, 123.12, 131.31])","IsDeferred":false},{"Name":"Without cache","Code":"let result = [0, 0, 0, 0]\r\nmultiply(result, [123.12, 131.31, 143.12, 0.123], [143.12, 0.123, 123.12, 131.31])","IsDeferred":false}]}