{"ScriptPreparationCode":"function triangular(a, b, c) {\r\n const f = (c - a)/(b - a);\r\n const rand = Math.random();\r\n let x;\r\n if (rand \u003C f) {\r\n x = a \u002B Math.sqrt(rand*(b - a)*(c - a))\r\n } else {\r\n x = b - Math.sqrt((1 - rand)*(b - a)*(b - c))\r\n }\r\n return x;\r\n}\r\n\r\nfunction linear(mean, radius) {\r\n let result = undefined;\r\n while (!result) {\r\n //const rand1 = Math.random()*2*radius - radius \u002B mean;\r\n const rand1 = Math.random()*2 - 1;\r\n const x = rand1*radius \u002B mean\r\n const rand2 = Math.random();\r\n if (Math.random() \u003E Math.abs(rand1)) {\r\n result = x;\r\n }\r\n }\r\n return result;\r\n}","TestCases":[{"Name":"Rejection","Code":"linear(0, 1)","IsDeferred":false},{"Name":"Formula","Code":"triangular(-1, 1, 0)","IsDeferred":false}]}