To travel and spend time with their family and just not work a job knowing that their stake/share is likely worth millions and maybe one day billions.
while (true) {
mid = Math.floor((start + end) / 2);
midAccuracy = await tryit(col, mid);
if ((end - start) <= 2) {
const max = Math.max([startAccuracy, midAccuracy, endAccuracy]);
if (startAccuracy == max) await tryit(col, start);
else if (midAccuracy == max) await tryit(col, mid);
else await tryit(col, end);
return;
}
if (endAccuracy > startAccuracy) {
start = mid;
startAccuracy = midAccuracy;
} else {
end = mid;
endAccuracy = midAccuracy;
}
}
}
async function findOptimalCombination() {
for (const col of [rin, gin, bin]) {
await binarySearch(col);
}
/* rounding */
for (const col of [rin, gin, bin]) {
const mid = col.valueAsNumber;
const score = await tryit(col, mid);
const left = await tryit(col, mid - 1);
if (score >= left) {
const right = await tryit(col, mid + 1);
if (score >= right) await tryit(col, mid);
}
}
console.log("Optimization complete");
}