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: algebraic.rs
    path of file: ./repos/weld/weld/src/optimizer/transforms
    
    the code of the file until where you have to start completion: #![allow(clippy::comparison_chain)]

use num_integer;

use crate::ast::ExprKind::*;
use crate::ast::LiteralKind::*;
use crate::ast::Type::*;
use crate::ast::*;

use self::num_integer::Integer;

pub fn eliminate_redundant_negation(expr: &mut Expr) {
    expr.transform_kind(&mut eliminate_redundant_negation_impl)
}

fn eliminate_redundant_negation_impl(expr: &mut Expr) -> Option<ExprKind> {
    match expr.kind {
     
    
fn is_even(e: &Expr) -> bool {
    match e.kind {
        Literal(ref kind) => {
            use crate::ast::LiteralKind::*;
            match kind {
                BoolLiteral(_) => false,
                I8Literal(n) => n.is_even(),
                I16Literal(n) => n.is_even(),
                I32Literal(n) => n.is_even(),
                I64Literal(n) => n.is_even(),
                U8Literal(n) => n.is_even(),
                U16Literal(n) => n.is_even(),
                U32Literal(n) => n.is_even(),
                U64Literal(n) => n.is_even(),
                F32Literal(bits) => {
                    let n = f32::from_bits(*bits);
                    n % 2.0 == 0.0
                }
                F64Literal(bits) => {
                    let n = f64::from_bits(*bits);
                    n % 2.0 == 0.0
                }
                StringLiteral(_) => false,
            }
        }
        Ident(_) => false, // TODO might actually be true, but need to know the expression that produces that
        Negate(ref e) => is_even(e),
        BinOp {
            kind: ref k,
            left: ref l,
            right: ref r,
        } => {
            use crate::ast::BinOpKind::*;
            match k {
                Add | Subtract => is_even(l) && is_even(r), // TODO || (is_odd(l) && is_odd(r))
                Min | Max => is_even(l) && is_even(r),
                Multiply => is_even(l) || is_even(r),
                Pow => is_even(l),
                _ => false,
            }
        }
        UnaryOp { .. } => false,
        Cast {
            kind: ref k,
            child_expr: ref e,
        } => k.is_numeric() && is_even(e),
        If {
            cond: ref _c,
            on_true: ref te,
            on_false: ref fe,
        } => is_even(te) && is_even(fe),
        _ => false,
    }
}