SingleRangeLimitTransform implements ParameterLimitsTransform { @Override public double transformGradient(final double x) { Validate.isTrue(_sign * x >= _sign * _limit, "x not in limit"); final double r = _sign * (x - _limit); if (r > EXP_MAX) { return 1.0; } final double temp = Math.exp(r); return _sign * temp / (temp - 1); } SingleRangeLimitTransform(final double a, final LimitType limitType); @Override double inverseTransform(final double y); @Override double transform(final double x); @Override double inverseTransformGradient(final double y); @Override double transformGradient(final double x); @Override int hashCode(); @Override boolean equals(final Object obj);  }
@Test(expectedExceptions = IllegalArgumentException.class) public void testOutOfRange3() { LOWER_LIMIT.transformGradient(-3); }
@Test(expectedExceptions = IllegalArgumentException.class) public void testOutOfRange4() { UPPER_LIMIT.transformGradient(1.01); }