Should I decide research field base on my performance on qualifying exam? I'm about one year into a math Ph.D. program. With some scientific computing background in undergraduate and master study, my research interests are in numerical analysis/PDE or probability. All of them are analysis orientated.

Recently I took (written) qualifying exam in several subjects, and passed all of them. However, I noticed my real analysis score was bare minimum passing score (i.e. I would have failed had I lost one more point.) and my algebra score was more than 30 points (out of 100) above the require passing score.

That result makes me a little bit confuse. Should I stick to my original interest, where the exam result indicates my knowledge is mediocre at best, or should I switch to a more algebra orientated field, where I did well on the test but had almost no related research experience or elective courses in the past?

People who are not in mathematics are also welcome to answer the question in the title in the context of your department and research field.
The most important direction to choose is the one you feel a real passion for. Anything else is a waste of your life.

If real analysis (or numerical analysis) is really your passion, then stick with the subject you love, and be prepared to work hard to bring that love to fruition. Do not switch to algebra so that one day you can tell your grandchildren "I wasted my whole life doing something I have no interest in, because I seemed to be good at it".

You have to remember how little meaning exam results have. They indicate your performance, on a particular day, in certain artificial circumstances. They are no predictor of your ability to deal with the research tasks you may set yourself in the future. And there may not even be much overlap between the "real analysis" of examinations and the kind of analysis you need to use when you are following your interests.

Do not hurry to make a decision. The exam is almost irrelevant, but it may have told you a little about what you are good at, and you could listen to that. You could also reasonably ask yourself, "Can I fall in love with something more algebraic?" But answer that question on the basis of love, not utility.