// @(#)root/mathmore:$Id$ // Author: L. Moneta 2009 // Implementation file for all the MinimizerVariableTransormation's // (implementations taken from minuit2 classes) #include "Math/MinimizerVariableTransformation.h" #include #include namespace ROOT { namespace Math { // implementations for the class SinVariableTransformation double SinVariableTransformation::Int2ext(double value, double lower, double upper) const { // transformation from internal (unlimited) to external values (limited by lower/upper ) return lower + 0.5*(upper - lower)*(std::sin(value) + 1.); } double SinVariableTransformation::Ext2int(double value, double lower, double upper) const { // transformation from external (limited by lower/upper ) to internal (unlimited) values given the lower/upper limits double piby2 = 2.*std::atan(1.); static const double eps = std::numeric_limits::epsilon(); double distnn = 8.*std::sqrt(eps); double vlimhi = piby2 - distnn; double vlimlo = -piby2 + distnn; double yy = 2.*(value - lower)/(upper - lower) - 1.; double yy2 = yy*yy; if(yy2 > (1. - 8 * eps) ) { if(yy < 0.) { // lower limit // std::cout<<"SinVariableTransformation warning: is at its lower allowed limit. "<