Derivate function with precalculs and constants parameters