anchor.diff:              )
           |> Array.filter (fun x -> x <> [])
           |> List.concat
  -        |> List.distinctBy (fun (indicator,xVal) -> round 2 xVal )
  +        |> List.distinctBy (fun (indicator,xVal) -> roundToNext xVal x) //round necessary when root is small and f'(x)=0 at 1.02 and 1.04 because of floating point issues in the root (must be 0)
  +        //possibility to ignore exrema if max and min are present within 0.2 x Values
   
       type Condition =
           | In0 //monotonically increasing
  
positive.code:         let extrema = getExtrema x a c
          let extremaCount = extrema.Length
          let n = a.Length
          if extremaCount = 0 then
              if a.[0] < a.[n-1] then In0
              else De0
          elif extremaCount = 1 then
              if fst extrema.[0] = 1. then In1
              else De1
          elif extremaCount = 2 then
              if fst extrema.[0] = 1. && fst extrema.[1] = -1. then In2
              else De2
          elif extremaCount = 3 then
              if fst extrema.[0] = 1. && fst extrema.[1] = -1. then In3
              else De3
          elif extremaCount = 4 then
              if fst extrema.[0] = 1. && fst extrema.[1] = -1. then In4
              else De4
          else Complex
  
      //check the spline for the predefined condition
      let checkshape (x:Vector<float>) (a:Vector<float>) (c:Vector<float>) (con:Condition)=
  
negative.code:         let calcS (h:Vector<float>) (x:Vector<float>) (a:Vector<float>) (c:Vector<float>) (i:int) (t:float) =
              a.[i] * (calcF1 h x i t) + a.[i+1] * (calcF2 h x i t) + c.[i] * (calcF3 h x i t) + c.[i+1] * (calcF4 h x i t)
  
          //function: a * ((y - t) / h) + b * (t - x) / h + c * ((((y - t) / h)^3.0 - ((y - t) / h) ) * (h^2.0) / 6.0  )+ d * ((((t - x) / h)^3.0 - ((t - x) / h) ) * (h^2.0) / 6.0) where b = a.[i+1] ...
          let evalAt =  calcS h x a c 
          
          (fun t ->
              let i = 
                  match Array.tryFindIndexBack (fun xs -> xs <= t) (x.InternalValues) with 
  