Thanks for the library Rob.
If you recall my old post about adding new core functions, I made a new map function with the aid of Pyro and useful criticism of Mark and Robin.
I never posted it, but here is my modified map version.
template< typename A, typename B, typename C, typename D, typename E >
auto map( const A &x, B &&in_min, C &&in_max, D &&out_min, E &&out_max ) -> decltype( A() * B() * C() * D() * E() )
{
typedef decltype( A() * B() * C() * D() * E() ) T_out;
//((x < in_min)? in_min : ((x > in_max)? in_max : x)) -> constrain without overhead
return (T_out)( ((x < in_min)? in_min : ((x > in_max)? in_max : x)) - in_min) * (out_max - out_min) / (in_max - in_min) + out_min;
}