# How to draw several regions using one function returning List of True's and False's?

This is what I want:

RegionPlot[
{
y < x^2,
y < 0.5 + 0.5 x
},
{x, 0, 2},
{y, 0, 4}
]


This code does not work (draws only one region):

rf[x_, y_] := {
y < x^2,
y < 0.5 + 0.5 x
};
RegionPlot[
rf[x, y],
{x, 0, 2},
{y, 0, 4}
]


Actual function rf is very complex (CPU consuming), and I don't want to calculate it twice like here:

(* it works, but calculates rf twice *)
rf[x_, y_] := {
y < x^2,
y < 0.5 + 0.5 x
};
RegionPlot[
{rf[x, y][[1]], rf[x, y][[2]]},
{x, 0, 2},
{y, 0, 4}
]


Using Map does not help:

rf[x_, y_] := {
y < x^2,
y < 0.5 + 0.5 x
};
RegionPlot[
{#[[1]], #[[2]]}& /@ rf[x, y],
{x, 0, 2},
{y, 0, 4}
]

ImplicitRegion::bcond: {y,x^2}&&{y,0.5 +0.5 x} should be a Boolean combination of equations, inequalities, and Element statements.

• RegionPlot[Evaluate@rf[x, y], {x, 0, 2}, {y, 0, 4}] – Kuba Aug 22 '19 at 9:21
• closely related: 113958 – Kuba Aug 22 '19 at 10:00

You can memoize the complex function so that it is only called once for a particular value of $$x$$ and $$y$$:
Clear[z];