pub(crate) mod const_api;
mod dispatch;
mod graph;
mod highp;
mod highp_data;
mod highp_dispatch;
mod highp_scalar;
#[cfg(any(
all(target_arch = "x86_64", target_feature = "sse2"),
target_arch = "aarch64",
target_arch = "wasm32"
))]
mod highp_simd;
mod options;
mod std_probe;
#[cfg(test)]
mod tests;
#[cfg(target_arch = "wasm32")]
mod wasm;
pub use const_api::{Powf, PowfRuntime};
pub use options::{MAX_EXP_BOUND, PowfDomain, PowfOptions, PowfPrecision};
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
#[non_exhaustive]
pub enum PowfErrorKind {
InvalidExponent,
InvalidBase,
OutsideApproximationRange,
UnsupportedWidth,
UnsupportedOptions,
}
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
pub struct PowfError {
pub kind: PowfErrorKind,
pub lane_mask: u16,
}
impl core::fmt::Display for PowfError {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
write!(f, "powf {:?}, lane mask {:#06x}", self.kind, self.lane_mask)
}
}
#[cfg(feature = "std")]
impl std::error::Error for PowfError {}
#[inline(always)]
pub fn try_powf(base: f32, exponent: f32) -> Result<f32, PowfError> {
<Powf>::scalar(base, exponent)
}
#[inline(always)]
pub fn try_powf_slice(
src: &[f32],
dst: &mut [f32],
exponent: f32,
) -> Result<(), crate::SliceError<PowfErrorKind>> {
<Powf>::slice(src, dst, exponent)
}