#[cfg(feature = "std")]
#[inline]
pub(crate) fn sqrt(x: f64) -> f64 {
x.sqrt()
}
#[cfg(all(not(feature = "std"), feature = "libm"))]
#[inline]
pub(crate) fn sqrt(x: f64) -> f64 {
libm::sqrt(x)
}
#[cfg(feature = "std")]
#[inline]
pub(crate) fn ln(x: f64) -> f64 {
x.ln()
}
#[cfg(all(not(feature = "std"), feature = "libm"))]
#[inline]
pub(crate) fn ln(x: f64) -> f64 {
libm::log(x)
}
#[cfg(feature = "std")]
#[inline]
pub(crate) fn exp(x: f64) -> f64 {
x.exp()
}
#[cfg(all(not(feature = "std"), feature = "libm"))]
#[inline]
pub(crate) fn exp(x: f64) -> f64 {
libm::exp(x)
}
pub(crate) fn dot(a: &[f64], b: &[f64]) -> f64 {
a.iter().zip(b).map(|(a, b)| a * b).sum()
}