// Example program
#include <iostream>
#include <string>
#include <cmath>

int main()
{
    double x = 0.5; // linear to frequency conversion
    
    const double d = 3.0; // decades per scale
    const double ten2d = std::pow (10, d);
    std::cout << x << "\n";
    
    x = (std::pow (ten2d, x) - 1) / (ten2d - 1);
    std::cout << x << "\n";
    
    x = 20.0 + (20000.0 - 20.0) * x;
    std::cout << x << "\n";
    
    x = (x - 20.0) / (20000.0 - 20.0);
    std::cout << x << "\n";
    
    x = (std::log10 ((x * (ten2d - 1)) + 1)) / std::log10 (ten2d); // inverse
    std::cout << x << "\n";
    
    
}