I have two eqution (blue / green), composed them using a simple if (black).

Blue: (2x)^2 / 2
Green: 0.5 + (1 - (2(1-x))^2) / 2
Black: (x < 0.5) ? (2x)^2 / 2 : 0.5 + (1 - (2(1-x))^2) / 2
See it in action on Fooplot: http://fooplot.com/plot/7knnh3zxis
Question is how can I simplify / extract the if statement?
Seemingly this is a single eqution offset by 0.5, 0.5 from the origin. Can someone shed a light on how to simplify this? I have some other similar equtions I am to simplify.
I'm not a math ninja, so explain with care if you can. :)
Sorry if this is a noob question here at math.stackexchange.com, this is the first time I ask here.
UPDATE: I expressed as a single function, than it turned out that this all above can be simplified to a surprisingly simple function, like:
-(4(x-0.5)abs((x-0.5))-4(x-0.5)-1)/2