let (|Trig|_|) x =
match x with
| Function (Sin, t) | Function (Cos, t)
| Function (Tan, t) | Function (Cot, t)
| Function (Sec, t) | Function (Csc, t)
| Function (Cosh, t) | Function (Sinh, t)
| Function (Tanh, t) | Function (Asin, t)
| Function (Acos, t) | Function (Atan, t) ->
Some x
| _ -> None
let fromDegreeToRad (degree : Expression) =
degree * (System.Math.PI / 180.0)
let rec mapFunction f test =
match test with
| Sum ax -> sum <| List.map (mapFunction f) ax