Function EndErfc broken

I’m using EndErfc to model a step function in some data (a muon range curve). The function erf or erfc isn’t in the restricted set available in UserFunction and it’s too much work for a one off fit to write my own Python function.

Expected behaviour

Should work as documented. With A negative the curve should drop from a higher to a lower value. Ideally the documented restriction that D>=0 should not be here, the user should have the choice to apply that constraint to the fit when appropriate.

Actual behavior

It’s OK with increasing data (A positive). With parameter A negative, the function returns a flat line with value dependent on A but not on the background term D. Therefore the fit fails on decreasing data.

Steps to reproduce the behavior

Find some data with a decreasing step function. Use this function to try to fit it. Use EvaluateFunction and play around with the parameters.

Platforms affected

Noticed in Mantid 3.9, Windows - not used it before.

Issue has been closed. Download the nightly build tomorrow for an updated UserFunction containing erc and erfc.

Thanks. I found a work around for the immediate problem. The discrepancy between the documentation of EndErfc and its actual behaviour probably remains, though. One or the other ought to be fixed to avoid confusing any other new users who think it might be useful for them.

The documentation of EndErfc is incomplete, I’ll fix it. I won’t modify the function though, because whoever created it wanted that particular functionality. erf and erfc from UserFunction should be used instead.