I’d definitely go with the 9950x unless you have a specific reason to want an Apple machine (such as strongly preferring MacOS or wanting this machine to be a laptop with reasonable battery life).
A lot of people have been complaing about Zen 5 being a small improvement over Zen 4, but if you care about linear algebra, the AVX 512 improvements to Zen 5 are going to be a huge difference maker. The 9950x has full on AVX 512 and unlike Intel, can do it without downclocking.
There’s some nice benchmark results here comparing it to the 7950x: https://www.phoronix.com/review/amd-zen5-avx-512-9950x.
Intel’s 14900k is almost as fast as the 9950x for linear-algebra like tasks, but has potentially fatal hardware flaws (Intel is now claiming they have a fix to stop further degradation but who knows, I wouldn’t bet on it), and uses way more power so I don’t really think it’s worth considering unless you have a specific reason to want to go with Intel.
Maybe check the price of a modern GPU with 64GB of VRAM and float64 support and then compare it to a 9950x.