There is no general formula for isp that would provide accurate values all the propellant combinations and nozzle expansion ratios one might use. The NASA Chemical Equilibrium (CEA) program (do a google search)NASA Chemical Equilibrium (CEA) program can provide the information you are looking for and would be an answer to your question. It is useful for any of the common propellant systems and many exotic propellant systems, e.g., fluorine, metals, etc.
Extracted from nasa CEA webpage:
CEA is a program which calculates chemical equilibrium product concentrations from any set of reactants and determines thermodynamic and transport properties for the product mixture. Built-in applications include calculation of theoretical rocket performance (isp at any nozzle expansion ratio), Chapman-Jouguet detonation parameters, shock tube parameters, and combustion properties.
The code in fortran is freely available (check web site). This code is the "bible" for the rocket industry. I used this 50 years ago while working on the Apollo program and working on other rocket systems.
The program is very fast. You could set CEA up to be a call from your application or you could run a bunch of cases with the propellants you are most interested in and call a curvefit to the data for the specific situations you are looking at.