Charles Stross’ Laundry series is basically this concept set in the present day: magic is a branch of mathematics, which means it can be computed and programmed.
It is perhaps worth noting at this point the series genre is cosmic horror.
The gender is actually Lovecraftian, spy thriller, science fiction, and workplace humour source.
It’s seriously the best thing I have read in a decade.
Edit: genre I guess 😅 (have been learning French lately so sometimes it messes it all up!).
God help the poor mathematical geniuses who accidentally discover that math. If they’re lucky, they end up working for the Laundry.
If they’re really lucky, they’ll end up working for the Laundry only once. Residual Human Resources is a bad way to go out.