Hi,
I didn't check your function, but from your email it looks like you are worried by the individual points -1+h and 1-h right?
These are individual floating point numbers that will actually be never observed, unless you initialize from there.
I checked the code and if you hit that point the step function will be set to 1.0. However, the derivative will be infinite. Thus, if you do:
a(x) = f(x)*step(x) + g(x)*step(-x)
with f(x) and g(x) chosen so that their derivative in x=0 is identical (and thus it should be possible to compute the derivative of a(x) at x=0), the derivative of a(x) at x=0 will be nan I think (+infty-infty). If you really want to include the boundaries you should use a soft version of the theta function. Notice that you can add your own functions with a syntax like this:
titaij: CUSTOM ...
ARG=ij,h VAR=x,h
FUNC={
mystep(x+1-h)*mystep(1-h-x)+mystep(x-1+h)*mystep(1+h-x)*(0.5-(3*(x-1))/(4*h)+((x-1)^3)/(4*(h^3)))+mystep(x+1+h)*mystep(-1+h-x)*(0.5+(3*(x+1))/(4*h)-((x+1)^3)/(4*(h^3))) ;
mystep=0.5*(erf(50*x)+1)
}
...
In this manner, at the boundary the result will be the *average* between the two definitions, and derivatives will be well defined.
Giovanni