# Compilation without MainEvaluate

I'm trying to avoid MainEvaluate in CompiledFunction. I've tried below but I couldn't get rid of it. I'd appreciate any help!!

Here f1 and f2 will be rank 1 list with real type.

decision[f1_, f2_] := And @@ Thread[LessEqual[f1, f2]] && Or @@ Thread[Less[f1, f2]];

dominates = Compile[{{f1, _Real, 1}, {f2, _Real, 1}},
decision[f1, f2], {{decision[_, _], True | False}},
CompilationOptions ->{"InlineCompiledFunctions" -> True}];
<< CompiledFunctionTools
CompilePrint[dominates]

• The expression in decision[] is not compilable. Try rewriting it using UnitStep[]. Oct 12, 2016 at 23:40
• So you want all the elements of f1 less than or equal to the corresponding element of f2 and at least one the pairs unequal? Oct 12, 2016 at 23:42

dominates = Compile[{{f1, _Real, 1}, {f2, _Real, 1}},
`