My heart goes out to you OP, I can't imagine how distressing this must be for you. To find out that your daughter was struggling with this and you didn't know is hard enough, but to know the situation is ongoing and to feel powerless to stop it . . . that's terrible.
I can understand that your urge would be to throw everything you have at this and get your daughter the best possible treatment right now. That's commendable. However, inpatient treatment isn't always the magic bullet people hope it will be.
First of all, if the ED sufferer doesn't proactively want recovery, there's only so much good it will. They will monitor her for the duration of her stay there, get her weight back up, and try their level best to help her - but there's a good chance she will simply lapse back into her old habits once released.
Second, there's a danger she'll learn bad habits from other patients in a residential setting, and will cling more fiercely to the disorder as a way of life. I don't want to scare you but it's not at all uncommon for an anorexic to become a purger after time spent around bulimia sufferers in treatment, for instance, or for a purger to graduate to abuse of laxatives. If there is any chance your daughter might use treatment as a "training ground" in this way, I would be very hesitant about sending her anywhere.
Thirdly, it's much harder for a person to recover when they feel their eating disorder defines them or has become a part of their personality. Pulling your daughter out of school and sending her to specialist residential care very much risks giving her this impression. Your daughter should absolutely remain under the close care of a GP, and seek outpatient counselling or group therapy immediately.
However, I agree with the posters recommending you retain some semblance of normality in her life. It will help her recovery if she has a clear sense of who she is and what her life could be without the disease, and if she knows that she has your love and support regardless. (Teenagers are delicate, emotionally speaking, and there is a risk she would interpret being sent away as you wanting to be rid of her or passing her problems onto someone else.)
There is a usually an underlying cause with eating disorders far beyond simple exam stress or a desire to be thin. You need to try and puzzle out what is driving your daughter to feel such a need for control, and help her find healthier coping mechanisms. Her behaviour is scary, but it's just a manifestation of a much deeper pain, which will find another outlet if it isn't addressed.
There is a forum for parents of sufferers trying to treat them at home. Around the Dinner Table, I think it's called. You may find it helps to read their stories and get some tips on how to handle this.
If residential treatment is necessary, then it's necessary, but please don't think it's your daughter's only hope for recovery. Being surrounded by love in a place she feels safe is a fantastic first step
Best wishes. You (both) can do this 