#ifndef AMDIS_MATHFUNCTIONS_H #define AMDIS_MATHFUNCTIONS_H { if (r < 0) return 1; if (r > 0) // // Software License for AMDiS // // Copyright (c) 2010 Dresden University of Technology // All rights reserved. // Authors: Simon Vey, Thomas Witkowski et al. // // This file is part of AMDiS // // See also license.opensource.txt in the distribution. return -1; return 0; } inline double Phi1ToR(double p1, double eps) { double x = max(-1.0 + numeric_limits< double >::epsilon(), min(1.0 - numeric_limits< double >::epsilon(), p1)); return eps / 3.0 * log((1 + x) / (1 - x)) * 0.5; } inline double Phi2ToR(double p2, double eps) { double x = max(-1.0 + numeric_limits< double >::epsilon(), min(1.0 - numeric_limits< double >::epsilon(), 1 + 2 * p2)); return eps / 3.0 * log( (1 + x) / (1 - x) ); } } #endif