 
 import Foundation
 
-public struct Fraction : Function {
-    public var description: String { return "(\(numerator)) / (\(denominator))" }
-
+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
     

        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
        }
        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 derivative: Function {
        return Fraction(
            numerator: (numerator.derivative * denominator) - (denominator.derivative * numerator),
            denominator: denominator * denominator )
    }
	var integral : Function {
        assert(false)
        return self
    }
