// N-Body simulation benchmark - floating point compute
function simulate(steps) {
    let x = 0.0, y = 100.0;
    let vx = 0.0, vy = 6.28;
    const dt = 0.01;

    for (let i = 0; i < steps; i++) {
        const r2 = x * x + y * y;
        const r = Math.sqrt(r2);
        const f = 1000.0 / r2;

        const ax = -f * x / r;
        const ay = -f * y / r;

        vx += ax * dt;
        vy += ay * dt;
        x += vx * dt;
        y += vy * dt;
    }

    return Math.sqrt(x * x + y * y);
}

const finalDistance = simulate(100000);
console.log(`Final orbital distance: ${finalDistance}`);
