I found a page that calculates the probability of an attacker subverting the blockchain with their own blocks at
http://web.archive.org/web/20200502141047/https://people.xiph.org/~greg/attack_success.html. This page is not on the original site anymore. Looks like it's on gmaxwell's old page?
The first parameter is the percentage of the network's hash power the attacker has, the second is the block depth which I think is the block at the depth an attacker wants to replace, along with all the other blocks above that depth.
I think the calculator is a little inaccurate, because with a large block depth the probability converges to 1 with hash power proportions lower than 0.5, e.g. AttackerSuccessProbability(hashpower=0.43, confirms=1000)=1. It also doesn't take into account that even with hash power greater than 0.5 it may take several years to catch up with the network when using large confirms value, which effectively decreases the probability. This calculator returns 1 for hashpower at least 0.5, for any confirms despite this.
Nevertheless, I scraped the code that computes this and put it here if any of you want to explore it and see how it works:
https://gist.github.com/ZenulAbidin/1f9aaa83453ab4c9e6c0992ee3fdad5d