Logo ROOT   6.30.04
Reference Guide
 All Namespaces Files Pages
RooVDTHeaders.h
Go to the documentation of this file.
1 // Author: Stephan Hageboeck, CERN 2 Sep 2019
2 
3 /*****************************************************************************
4  * RooFit
5  * Authors: *
6  * WV, Wouter Verkerke, UC Santa Barbara, verkerke@slac.stanford.edu *
7  * DK, David Kirkby, UC Irvine, dkirkby@uci.edu *
8  * *
9  * Copyright (c) 2000-2019, Regents of the University of California *
10  * and Stanford University. All rights reserved. *
11  * *
12  * Redistribution and use in source and binary forms, *
13  * with or without modification, are permitted according to the terms *
14  * listed in LICENSE (http://roofit.sourceforge.net/license.txt) *
15  *****************************************************************************/
16 
17 #ifndef ROOFIT_ROOFITCORE_ROOVDTHEADERS_H_
18 #define ROOFIT_ROOFITCORE_ROOVDTHEADERS_H_
19 
20 /**
21  * VDT headers for RooFit. Since RooFit cannot directly depend on VDT (it might not be available),
22  * this layer can be used to switch between different implementations.
23  */
24 
25 #include "ROOT/RConfig.hxx"
26 
27 #if defined(R__HAS_VDT)
28 #include "vdt/exp.h"
29 #include "vdt/log.h"
30 #include "vdt/sqrt.h"
31 
32 inline double _rf_fast_exp(double x) {
33  return vdt::fast_exp(x);
34 }
35 
36 inline double _rf_fast_log(double x) {
37  return vdt::fast_log(x);
38 }
39 
40 inline double _rf_fast_isqrt(double x) {
41  return vdt::fast_isqrt(x);
42 }
43 
44 #else
45 #include <cmath>
46 
47 inline double _rf_fast_exp(double x) {
48  return std::exp(x);
49 }
50 
51 inline double _rf_fast_log(double x) {
52  return std::exp(x);
53 }
54 
55 inline double _rf_fast_isqrt(double x) {
56  return 1/std::sqrt(x);
57 }
58 
59 #endif
60 
61 
62 #endif /* ROOFIT_ROOFITCORE_ROOVDTHEADERS_H_ */