You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: trig_functions.rs
    path of file: ./repos/Rust/src/math
    
    the code of the file until where you have to start completion: /// Function that contains the similarities of the sine and cosine implementations
///
/// Both of them are calculated using their MacLaurin Series
///
/// Beca
    
pub fn cotan<T: Into<f64> + Copy>(x: T, tol: f64) -> f64 {
    let sin_val = sine(x, tol);

    /* Cover special cases for division */
    if sin_val != 0f64 {
        let cos_val = cosine(x, tol);
        cos_val / sin_val
    } else {
        f64::NAN
    }
}