#include <iostream>
#include <math.h>
 
double f(double & x)
{
    if(x < 1)
        return 2*x;
 
    return x*x;
}
 
int main()
{
    double const x_min = -5.0;
    double const x_max = 2.0;
    double const dx = 0.1;
 
    double x = x_min;
 
    std::cout.precision(20);
    while(x < x_max)
    {
        std::cout << x << "\t" << f(x) << std::endl;
        x += dx;
    }
}