Nodes: Lighten/Darken "Crossfader" What I seek

I'm not sure if "crossfader" is the best way to describe it, but imagine black on one end, white on the other, and a grayscale image in the center. You can lighten or darken the image with a single slider.

I am trying to create a node setup that will either lighten or darken grayscale values, depending on whether an input slider is above or below 0.5. So at a value above 0.5 it would become lighter (with 1.0 fully white), and at a value below 0.5 it would become darker (with 0.0 fully black). If at 0.5 it should remain unchanged.

I'm looking for a solution that will work universally in Cycles or Blender Render, so it shouldn't rely on Shader nodes or other engine-specific nodes, but rather only make use of nodes involving math and color.

Why I need it

I'm trying to emulate the functionality of the Layer Weight node's Blend slider.



I know I can emulate most of the functionality of this node using the technique explained by Jerryno here. This gives output equivalent to the default 0.5 value. However there is no way to lighten or darken the result the way the Blend slider does. 

Here is a comparison of the two node setups:



What I've tried

I first tried to use Math nodes to add or subtract from the 0.5 value and mix that, but I soon realized that's not the same process. Next, I tried using MixRGB nodes with Add and Multiply blend modes. I believe this is producing the correct result, but I can't figure out how to control them using a single slider centered at 0.5, since the lightening and darkening rely on different color blend modes. Here is a screen shot of my latest attempt:



The annotation "pretend this cannot be changed" is because, remember, the Layer Weight node will be replaced with the Blender Render incidence angle node setup, which has no Blend slider.

The annotation "how to combine" is because a simple mixing of color values will not suffice. Somehow Multiply must be used if less than 0.5 and Add must be used if higher than 0.5.

There's probably a simple mathematical solution I'm overlooking, but I'm stuck trying to figure out what it might be.

Hopefully I've explained this question well enough. Feel free to ask questions if anything is unclear.
Try this:



This mixes between the input and black (0) for the 0-.5 range, then mixes between the input and white (1) for the .5-1 range.

The "Lerp" nodegroup is as follows:



This multiplies one value by an inversion of the "Fac", and the other by the fac itself. Then adds the two together.

0 as the "Fac" returns the top input, while 1 as the "Fac" gives the bottom input. Values in between give a mix.

Note that this should work for extrapolating as well; "Fac" values outside of 0..1 will give a result "past" the input values. If you don't want that, clamp the Fac input to 0..1.