JSFiddle - React, Tailwind, and code Playground

JavaScript

width_px = 500
function frequencty_to_px(frequency) {
    var min_f = Math.log(1) / Math.log(10),
        max_f = Math.log(160000) / Math.log(10),
        range = max_f - min_f,
        position_px = (Math.log(frequency) / Math.log(10) - min_f) / range  
        return frequency + " Hz => " + position_px + " px"
}
while(i<1000);
i=i*2;
document.write(frequencty_to_px(count) + "<br />")
}