I've developed an algorithm that predicts the future of mankind...and it doesn't look good

Oh pish-posh

You don’t need AI. Calculating the expected end date of humankind is a trivial application of probability theory and Bayesian reasoning.

Humanity gained the ability to destroy itself, roughly speaking, in 1945 with the advent of nuclear weapons. So far almost 80 years have gone by without an extinction event. So we’re 0 for 80. Using the rule of three, we can be 95% sure that the per year odds of extinction is somewhere between zero and 3/80 (0-3.75%). So at the lower bond we’ll never go extinct and at the higher bound we have a 50-50 chance of making it past July 2043.

Using roughly similar reasoning, Gott (1993) calculated that we have about 200,000 to 8,000,000 years left and that we are unlikely to colonize the galaxy. (More accessible article here, in both senses of the word.)

Others have challenged Gott’s calculations. But I think there’s a broad consensus on this question, at least within 6 orders of magnitude.