Are you planning to draw any current? How much?
A voltage divider only works if you draw no significant current from it. As soon as you use it to sink or source current, the two resistors will have non-matching currents, so the voltages across the resistors will no longer be in proportion to the ratio of their resistances.
You can use an op amp to buffer the voltage divider, so that it doesn't have to source or sink significant current, and then use the op amp's output to source or sink the required current. There are "rail splitter" ICs which are designed for this purpose, combining the voltage divider with an op-amp in one package, but they usually split the input voltage exactly in half.
There are various other possibilities, like zener diodes, linear regulators, switching regulators, charge pump voltage inverters, and more. The "best" solution depends on more detailed description of the requirements.
Does your input cover the entire voltage range required? IOW, if you want -2, +12, do you have at least a 14V supply? Is the supply floating? What are your current requirements on each rail? Do you have any particular low noise requirements?