import math


def betalambda(mass, freq, w):
    """Return value of beta*lambda of beam.

    Arguments:
       mass(double): mc^2 of beam particle in MeV
       freq(double): frequency in MHz
       w(double): Kinetic energy in MeV
    """
    c = 2.99792458e8 # m/s
    wavelength = c / (freq * 1.0e6)
    gamma = 1.0 + w / mass
    beta = math.sqrt(1.0 - 1/(gamma * gamma))
    return beta * wavelength