DoubleRangeLimitTransform implements ParameterLimitsTransform { @Override public double transform(final double x) { Validate.isTrue(x <= _upper && x >= _lower, "parameter out of range"); if (x == _upper) { return TANH_MAX; } else if (x == _lower) { return -TANH_MAX; } return TrigonometricFunctionUtils.atanh((x - _mid) / _scale); } DoubleRangeLimitTransform(final double lower, final double upper); @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() { RANGE_LIMITS.transform(-3); }
@Test(expectedExceptions = IllegalArgumentException.class) public void testOutOfRange2() { RANGE_LIMITS.transform(1.01); }