There is no specific formula, and it is not specific even to star rating or CP. Some players at level 30 or above might be able to solo Vaporeons if they have very good Pokémon suited for the battle, but likely no player will be able to at that level solo Jolteon.
This is in part because all raid bosses have the same number of hit points at any given star level - so Jolteon (usually a glass cannon with low hit points but high attack) has the same number of hitpoints as Vaporeon (tanky, with middling attack values but high hitpoints) while the attack values are not rebalanced.
Additionally, the comments in your question about not choosing types appropriate to the boss makes no sense; that's part of pokémon strategy, and if you don't pick appropriate types you'll have zero chance at anything above one star. It's not just the CP of the Pokémon; it's the specific moves, too. CP really is not terribly useful by itself, because it combines attack, defense, and hit points together; often only one or two of those matter compared to the others. (For example, in a Machamp raid, defense/hit points matters as you will have trouble surviving its hits, while in a Vaporeon raid, you need attack only, and don't care about hit points or defense.)
Whether you can solo them or not will depend on your Pokémon mix and level. In general, for a level 30 trainer:
Raid level 1 and 2 - soloable by most
Raid level 3:
Machamp is soloable with the right party, if it does not have dynamic punch. Probably not soloable with dynamic punch without the perfect party. Survivability is important vs. Machamp.
Vaporeon is soloable by many players, but takes a high DPS party.
Alakazam is soloable with a very good party at level 30.
Flareon and Jolteon are probably not soloable by most level 30 players.
Gengar is difficult, but soloable by most players with a well chosen party due to the normal type immunity to ghost moves.
Arcanine is difficult to solo at level 30.
Raid level 4:
It's unlikely for a level 30 player to be able to solo any raid level 4 pokémon. Of those pokémon, a Rhydon or a Venusaur might be doable by higher level players; Rhydon has a double type disadvantage, and Venusaur is vulnerable to high DPS fire moves.