SingleRangeLimitTransform implements ParameterLimitsTransform { @Override public double transform(final double x) { Validate.isTrue(_sign * x >= _sign * _limit, "x not in limit"); if (x == _limit) { return -EXP_MAX; } final double r = _sign * (x - _limit); if (r > EXP_MAX) { return r; } return Math.log(Math.exp(r) - 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 testOutOfRange1() { LOWER_LIMIT.transform(-3); }
@Test(expectedExceptions = IllegalArgumentException.class) public void testOutOfRange2() { UPPER_LIMIT.transform(1.01); }