
const k_1 = 0.206;
const k_2 = 0.03;
const k_3 = (1. + k_1) / (1. + k_2);

/**
 * toe function for L_r
 * @param {number} x
 * @return {number}
 */
export function toe(x){
    return 0.5 * (k_3 * x - k_1 + Math.sqrt((k_3 * x - k_1) * (k_3 * x - k_1) + 4 * k_2 * k_3 * x));
}

/**
 * inverse toe function for L_r
 * @param {number} x
 * @return {number}
 */
export function toe_inv(x){
    return (x * x + k_1 * x) / (k_3 * (x + k_2));
}
