1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
use necsim_core::cogs::MathsCore;

#[derive(Clone, Debug)]
#[allow(clippy::module_name_repetitions)]
pub enum ReproducibleMathsCore {}

impl MathsCore for ReproducibleMathsCore {
    #[inline]
    fn floor(x: f64) -> f64 {
        libm::floor(x)
    }

    #[inline]
    fn ceil(x: f64) -> f64 {
        libm::ceil(x)
    }

    #[inline]
    fn ln(x: f64) -> f64 {
        libm::log(x)
    }

    #[inline]
    fn exp(x: f64) -> f64 {
        libm::exp(x)
    }

    #[inline]
    fn sqrt(x: f64) -> f64 {
        libm::sqrt(x)
    }

    #[inline]
    fn pow(x: f64, exp: f64) -> f64 {
        libm::pow(x, exp)
    }

    #[inline]
    fn sin(x: f64) -> f64 {
        libm::sin(x)
    }

    #[inline]
    fn cos(x: f64) -> f64 {
        libm::cos(x)
    }

    #[inline]
    fn round(x: f64) -> f64 {
        libm::round(x)
    }
}