moves mid_pred() into mathops.h (with arch specific code split by directory)