         let denominator = self.denominator.reduced
         let numerator   = self.numerator.reduced
         if let d = denominator.reduced as? ConstantFunction {
-            return Term(numerator, ConstantFunction(value: 1.0/d.value)).reduced
+            return Term(numerator, Constant(1.0/d.value)).reduced
         }
         if let n = numerator as? PolynomialFunction, let d = denominator as? PolynomialFunction {
             let frac = n.polynomial /% d.polynomial

    func call(x: Double) -> Double {
        return numerator.call(x: x) / denominator.call(x: x)
    }
    var derivate: Function {
        return Fraction(
            numerator: (numerator.derivate * denominator) - (denominator.derivate * numerator),
            denominator: denominator * denominator )
    }
    func integral(c: Double) -> Function {
        assert(false)
        return self
    }


import Foundation

struct Fraction : Function {
	var description: String { return "(\(numerator)) / (\(denominator))" }
	var latex: String { return "\\frac{\(numerator.latex)}{\(denominator.latex)}" } // \frac{n}{d}
    var numerator: Function
    var denominator : Function
    
