anchor.diff:              (fun t ->
                   let i = 
                       match Array.tryFindIndexBack (fun xs -> xs <= t) (x.InternalValues) with 
  -                    | Some x -> x 
  +                    | Some z -> if t = Seq.last x then h.Length-1 else z 
                       | None   -> failwith "The x-value is not part of the section used to estimate the spline coefficients, thus a monotone function progression can not be guaranteed"
                   evalAt i t
                   )
  
positive.code:                     |> List.map (fun ex -> {ex with Xvalue = Aux.roundToNext ex.Xvalue x})
                      |> List.distinct
  
          //let initEvalAtFstDerivativ (x:Vector<float>) (a:Vector<float>) (c:Vector<float>) =
          //    let n = x.Length
          //    //define interval stepwidths
          //    let h = Vector.init (n-1) (fun i -> x.[i+1] - x.[i] )
          //    // helper functions f(i,1-4)(t) for smoothing spline
          //    let calcF1 (h:Vector<float>) (x:Vector<float>) (i:int) (t:float) = (x.[i+1] - t) / h.[i]
          //    let calcF2 (h:Vector<float>) (x:Vector<float>) (i:int) (t:float) = (t - x.[i]) / h.[i]
          //    let calcF3 (h:Vector<float>) (x:Vector<float>) (i:int) (t:float) =
          //        (3. * (calcF1 h x i t) ** 2.0 * (calcF1 h x i t) - (calcF1 h x i t) ) * (h.[i]**2.0) / 6.0
          //    let calcF4 (h:Vector<float>) (x:Vector<float>) (i:int) (t:float) =
          //        ((calcF2 h x i t)**3.0 - (calcF2 h x i t) ) * (h.[i]**2.0) / 6.0 
          //    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)
          //    let evalAt =  calcS h x a c 
          //    (fun t ->
          //        let i = 
          //            match Array.tryFindIndexBack (fun xs -> xs <= t) (x.InternalValues) with 
          //            | Some x -> x 
          //            | None   -> failwith "The x-value is not part of the section used to estimate the spline coefficients, thus a monotone function progression can not be guaranteed"
          //        evalAt i t
          //        )
      
          [<Obsolete("Only applicable at equal x spacing. Use getExtrema instead")>]
          //calculates extrema with (type,x_value) where type is +1 for maxima and -1 for minima
          let getExtrema_equalSpacing (x:Vector<float>) (a:Vector<float>) (c:Vector<float>) =
  
negative.code:             
          /// gives smoothing spline function
          let initEvalAt (x:Vector<float>) (a:Vector<float>) (c:Vector<float>) =
              let n = x.Length
  
              //define interval stepwidths
  