use crate::algos::trig;
use crate::support::rounding::RoundingMode;
use crate::types::widths::D18;
pub(crate) mod forward {
use crate::int::types::Int;
#[derive(Clone, Copy, PartialEq, Eq)]
pub(crate) enum Algorithm {
Series,
#[cfg(feature = "_wide-support")]
Tang,
#[allow(dead_code)]
Schoolbook,
}
#[derive(Clone, Copy)]
pub(crate) enum Select<const N: usize> {
ByAlgorithm(Algorithm),
#[allow(dead_code)]
ByValue(fn(&Int<N>) -> Algorithm),
}
pub(crate) const fn select<const N: usize, const SCALE: u32>() -> Select<N> {
match (N, SCALE) {
#[cfg(any(feature = "d57", feature = "wide"))]
(3, 44..=56) => Select::ByAlgorithm(Algorithm::Tang),
#[cfg(any(feature = "d153", feature = "wide"))]
(8, 70..=82) => Select::ByAlgorithm(Algorithm::Tang),
#[cfg(any(feature = "d307", feature = "wide", feature = "x-wide"))]
(16, 140..=160) => Select::ByAlgorithm(Algorithm::Tang),
#[cfg(any(feature = "d462", feature = "x-wide"))]
(24, 0..=461) => Select::ByAlgorithm(Algorithm::Tang),
_ => Select::ByAlgorithm(Algorithm::Series),
}
}
pub(crate) const fn select_tan<const N: usize, const SCALE: u32>() -> Select<N> {
match (N, SCALE) {
#[cfg(any(feature = "d153", feature = "wide"))]
(8, 70..=82) => Select::ByAlgorithm(Algorithm::Tang),
#[cfg(any(feature = "d307", feature = "wide", feature = "x-wide"))]
(16, 140..=160) => Select::ByAlgorithm(Algorithm::Tang),
#[cfg(any(feature = "d462", feature = "x-wide"))]
(24, 0..=461) => Select::ByAlgorithm(Algorithm::Tang),
_ => Select::ByAlgorithm(Algorithm::Series),
}
}
#[inline]
pub(crate) fn resolve<const N: usize, const SCALE: u32>(raw: &Int<N>) -> Algorithm {
match const { select::<N, SCALE>() } {
Select::ByAlgorithm(a) => a,
Select::ByValue(f) => f(raw),
}
}
#[inline]
pub(crate) fn resolve_tan<const N: usize, const SCALE: u32>(raw: &Int<N>) -> Algorithm {
match const { select_tan::<N, SCALE>() } {
Select::ByAlgorithm(a) => a,
Select::ByValue(f) => f(raw),
}
}
}
pub(crate) mod inverse {
use crate::int::types::Int;
#[derive(Clone, Copy, PartialEq, Eq)]
pub(crate) enum Algorithm {
Atan,
#[allow(dead_code)]
Schoolbook,
}
#[derive(Clone, Copy)]
pub(crate) enum Select<const N: usize> {
ByAlgorithm(Algorithm),
#[allow(dead_code)]
ByValue(fn(&Int<N>) -> Algorithm),
}
#[allow(clippy::match_single_binding)]
pub(crate) const fn select<const N: usize, const SCALE: u32>() -> Select<N> {
match (N, SCALE) {
_ => Select::ByAlgorithm(Algorithm::Atan),
}
}
#[inline]
pub(crate) fn resolve<const N: usize, const SCALE: u32>(raw: &Int<N>) -> Algorithm {
match const { select::<N, SCALE>() } {
Select::ByAlgorithm(a) => a,
Select::ByValue(f) => f(raw),
}
}
}
pub(crate) mod hyper {
use crate::int::types::Int;
#[derive(Clone, Copy, PartialEq, Eq)]
pub(crate) enum Algorithm {
ExpIdentity,
#[allow(dead_code)]
Schoolbook,
}
#[derive(Clone, Copy)]
pub(crate) enum Select<const N: usize> {
ByAlgorithm(Algorithm),
#[allow(dead_code)]
ByValue(fn(&Int<N>) -> Algorithm),
}
#[allow(clippy::match_single_binding)]
pub(crate) const fn select<const N: usize, const SCALE: u32>() -> Select<N> {
match (N, SCALE) {
_ => Select::ByAlgorithm(Algorithm::ExpIdentity),
}
}
#[inline]
pub(crate) fn resolve<const N: usize, const SCALE: u32>(raw: &Int<N>) -> Algorithm {
match const { select::<N, SCALE>() } {
Select::ByAlgorithm(a) => a,
Select::ByValue(f) => f(raw),
}
}
}
#[cfg(feature = "_wide-support")]
pub(crate) mod forward_rung {
use super::super::work_rung::{in_budget, rung_match, trig_rung, D_BUDGET};
use crate::algos::support::wide_trig_core::{
atan_series_g, cos_series_g, sin_series_g, tan_series_g, WideTrigCore,
};
use crate::int::types::compute_limbs::ComputeLimbs;
use crate::int::types::traits::BigInt;
use crate::support::rounding::RoundingMode;
#[inline]
pub(crate) fn sin_strict<C: WideTrigCore, const SCALE: u32, const GUARD: u32>(
raw: C::Storage,
mode: RoundingMode,
) -> C::Storage
where
<C::W as BigInt>::Scratch: ComputeLimbs,
{
if in_budget::<C::Storage, SCALE, D_BUDGET>(&raw) {
rung_match!(trig_rung, C, SCALE, sin_series_g, [SCALE, GUARD], raw, mode)
} else {
crate::algos::trig::sincos_narrow::sin_narrow_with_taylor::<C, SCALE, GUARD>(raw, mode)
}
}
#[inline]
pub(crate) fn cos_strict<C: WideTrigCore, const SCALE: u32, const GUARD: u32>(
raw: C::Storage,
mode: RoundingMode,
) -> C::Storage
where
<C::W as BigInt>::Scratch: ComputeLimbs,
{
if in_budget::<C::Storage, SCALE, D_BUDGET>(&raw) {
rung_match!(trig_rung, C, SCALE, cos_series_g, [SCALE, GUARD], raw, mode)
} else {
crate::algos::trig::sincos_narrow::cos_narrow_with_taylor::<C, SCALE, GUARD>(raw, mode)
}
}
#[inline]
pub(crate) fn tan_strict<
C: WideTrigCore,
const SCALE: u32,
const GUARD: u32,
const NEAR_POLE: bool,
const SUB_GUARD: bool,
>(
raw: C::Storage,
mode: RoundingMode,
) -> C::Storage
where
<C::W as BigInt>::Scratch: ComputeLimbs,
{
if in_budget::<C::Storage, SCALE, D_BUDGET>(&raw) {
rung_match!(trig_rung, C, SCALE, tan_series_g, [SCALE, GUARD, NEAR_POLE, SUB_GUARD], raw, mode)
} else if SUB_GUARD {
crate::algos::support::wide_trig_core::tan_series::<C, SCALE>(raw, mode)
} else {
crate::algos::trig::sincos_narrow::tan_narrow_with_taylor::<C, SCALE, GUARD, NEAR_POLE>(
raw, mode,
)
}
}
#[inline]
pub(crate) fn atan_strict<
C: WideTrigCore,
const SCALE: u32,
const GUARD: u32,
const DIRECTED: bool,
>(
raw: C::Storage,
mode: RoundingMode,
) -> C::Storage
where
<C::W as BigInt>::Scratch: ComputeLimbs,
{
if in_budget::<C::Storage, SCALE, D_BUDGET>(&raw) {
rung_match!(trig_rung, C, SCALE, atan_series_g, [SCALE, GUARD, DIRECTED], raw, mode)
} else if DIRECTED {
crate::algos::support::wide_trig_core::atan_series::<C, SCALE>(raw, mode)
} else {
crate::algos::support::wide_trig_core::atan_narrow::<C, SCALE, GUARD>(raw, mode)
}
}
}
#[cfg(feature = "_wide-support")]
pub(crate) mod inverse_rung {
use super::super::work_rung::{in_budget, rung_match, trig_rung, D_BUDGET};
use crate::algos::support::wide_trig_core::WideTrigCore;
use crate::algos::trig::inverse_schoolbook::{
acos_schoolbook_g, asin_schoolbook_g, atan2_schoolbook_g,
};
use crate::support::rounding::RoundingMode;
#[inline]
pub(crate) fn asin_strict<C: WideTrigCore, const SCALE: u32>(
raw: C::Storage,
mode: RoundingMode,
) -> C::Storage
where
<C::W as crate::int::types::traits::BigInt>::Scratch:
crate::int::types::compute_limbs::ComputeLimbs,
{
if in_budget::<C::Storage, SCALE, D_BUDGET>(&raw) {
rung_match!(trig_rung, C, SCALE, asin_schoolbook_g, [SCALE], raw, mode)
} else {
crate::algos::trig::inverse_schoolbook::asin_schoolbook::<C, SCALE>(raw, mode)
}
}
#[inline]
pub(crate) fn acos_strict<C: WideTrigCore, const SCALE: u32>(
raw: C::Storage,
mode: RoundingMode,
) -> C::Storage
where
<C::W as crate::int::types::traits::BigInt>::Scratch:
crate::int::types::compute_limbs::ComputeLimbs,
{
if in_budget::<C::Storage, SCALE, D_BUDGET>(&raw) {
rung_match!(trig_rung, C, SCALE, acos_schoolbook_g, [SCALE], raw, mode)
} else {
crate::algos::trig::inverse_schoolbook::acos_schoolbook::<C, SCALE>(raw, mode)
}
}
#[inline]
pub(crate) fn atan2_strict<C: WideTrigCore, const SCALE: u32>(
y_raw: C::Storage,
x_raw: C::Storage,
mode: RoundingMode,
) -> C::Storage
where
<C::W as crate::int::types::traits::BigInt>::Scratch:
crate::int::types::compute_limbs::ComputeLimbs,
{
if in_budget::<C::Storage, SCALE, D_BUDGET>(&y_raw) && in_budget::<C::Storage, SCALE, D_BUDGET>(&x_raw) {
rung_match!(trig_rung, C, SCALE, atan2_schoolbook_g, [SCALE], y_raw, x_raw, mode)
} else {
crate::algos::trig::inverse_schoolbook::atan2_schoolbook::<C, SCALE>(y_raw, x_raw, mode)
}
}
}
#[cfg(feature = "_wide-support")]
#[inline]
fn hyper_band_in_range<const N: usize, const SCALE: u32>(raw: &crate::int::types::Int<N>) -> bool {
let zero = crate::int::types::Int::<N>::ZERO;
let a = if *raw < zero { zero - *raw } else { *raw };
a <= crate::int::types::Int::<N>::from_i128(2)
* crate::consts::pow10::dispatch::<crate::int::types::Int<N>>(SCALE)
}
#[cfg(feature = "_wide-support")]
pub(crate) mod hyper_rung {
use super::super::work_rung::{in_budget, rung_match, trig_rung, EXP_ARG_BUDGET};
use crate::algos::support::wide_trig_core::WideTrigCore;
use crate::algos::trig::hyper_schoolbook::{
cosh_schoolbook_g, sinh_schoolbook_g, tanh_schoolbook_g,
};
use crate::int::types::compute_limbs::ComputeLimbs;
use crate::int::types::traits::BigInt;
use crate::support::rounding::RoundingMode;
#[inline]
pub(crate) fn sinh_strict<C: WideTrigCore, const SCALE: u32>(
raw: C::Storage,
mode: RoundingMode,
) -> C::Storage
where
<C::Wagm as BigInt>::Scratch: ComputeLimbs,
<C::Wexp as BigInt>::Scratch: ComputeLimbs,
{
if in_budget::<C::Storage, SCALE, EXP_ARG_BUDGET>(&raw) {
rung_match!(trig_rung, C, SCALE, sinh_schoolbook_g, [SCALE], raw, mode)
} else {
crate::algos::trig::hyper_schoolbook::sinh_schoolbook::<C, SCALE>(raw, mode)
}
}
#[inline]
pub(crate) fn cosh_strict<C: WideTrigCore, const SCALE: u32>(
raw: C::Storage,
mode: RoundingMode,
) -> C::Storage
where
<C::Wagm as BigInt>::Scratch: ComputeLimbs,
<C::Wexp as BigInt>::Scratch: ComputeLimbs,
{
if in_budget::<C::Storage, SCALE, EXP_ARG_BUDGET>(&raw) {
rung_match!(trig_rung, C, SCALE, cosh_schoolbook_g, [SCALE], raw, mode)
} else {
crate::algos::trig::hyper_schoolbook::cosh_schoolbook::<C, SCALE>(raw, mode)
}
}
#[inline]
pub(crate) fn tanh_strict<C: WideTrigCore, const SCALE: u32>(
raw: C::Storage,
mode: RoundingMode,
) -> C::Storage
where
<C::Wagm as BigInt>::Scratch: ComputeLimbs,
<C::Wexp as BigInt>::Scratch: ComputeLimbs,
{
if in_budget::<C::Storage, SCALE, EXP_ARG_BUDGET>(&raw) {
rung_match!(trig_rung, C, SCALE, tanh_schoolbook_g, [SCALE], raw, mode)
} else {
crate::algos::trig::hyper_schoolbook::tanh_schoolbook::<C, SCALE>(raw, mode)
}
}
}
#[cfg(feature = "_wide-support")]
pub(crate) mod extra_rung {
use super::super::work_rung::{in_budget, near_special_rung, rung_match, trig_rung, D_BUDGET};
use crate::algos::support::wide_trig_core::WideTrigCore;
use crate::algos::trig::hyper_schoolbook::{
acosh_schoolbook_g, asinh_schoolbook_g, atanh_schoolbook_g,
};
use crate::support::rounding::RoundingMode;
#[inline]
pub(crate) fn asinh_strict<C: WideTrigCore, const SCALE: u32>(
raw: C::Storage,
mode: RoundingMode,
) -> C::Storage
where
<C::Wagm as crate::int::types::traits::BigInt>::Scratch:
crate::int::types::compute_limbs::ComputeLimbs,
{
if in_budget::<C::Storage, SCALE, D_BUDGET>(&raw) {
rung_match!(trig_rung, C, SCALE, asinh_schoolbook_g, [SCALE], raw, mode)
} else {
crate::algos::trig::hyper_schoolbook::asinh_schoolbook::<C, SCALE>(raw, mode)
}
}
#[inline]
pub(crate) fn acosh_strict<C: WideTrigCore, const SCALE: u32>(
raw: C::Storage,
mode: RoundingMode,
) -> C::Storage
where
<C::Wagm as crate::int::types::traits::BigInt>::Scratch:
crate::int::types::compute_limbs::ComputeLimbs,
{
if in_budget::<C::Storage, SCALE, D_BUDGET>(&raw) {
rung_match!(near_special_rung, C, SCALE, acosh_schoolbook_g, [SCALE], raw, mode)
} else {
crate::algos::trig::hyper_schoolbook::acosh_schoolbook::<C, SCALE>(raw, mode)
}
}
#[inline]
pub(crate) fn atanh_strict<C: WideTrigCore, const SCALE: u32>(
raw: C::Storage,
mode: RoundingMode,
) -> C::Storage
where
<C::Wagm as crate::int::types::traits::BigInt>::Scratch:
crate::int::types::compute_limbs::ComputeLimbs,
{
if in_budget::<C::Storage, SCALE, D_BUDGET>(&raw) {
rung_match!(near_special_rung, C, SCALE, atanh_schoolbook_g, [SCALE], raw, mode)
} else {
crate::algos::trig::hyper_schoolbook::atanh_schoolbook::<C, SCALE>(raw, mode)
}
}
}
#[cfg(any(feature = "d57", feature = "wide"))]
mod borrow_d57 {
use crate::algos::support::wide_trig_core;
use crate::algos::trig;
use crate::int::types::Int;
use crate::support::rounding::RoundingMode;
use crate::types::widths::wide_trig_d57;
#[inline]
fn narrow<const SCALE: u32>(raw_wide: Int<3>, op: &'static str) -> Int<2> {
let wide = crate::D::<crate::int::types::Int<3>, SCALE>::from_bits(raw_wide);
let r: crate::D<crate::int::types::Int<2>, SCALE> = wide.try_into().unwrap_or_else(|_| {
panic!(
"{op}: result out of range — produced {wide}, D38<{SCALE}> represents only |x| < 1.7e{}",
38_i32 - SCALE as i32,
)
});
r.0
}
#[inline]
#[must_use]
pub(crate) fn atan_strict<const SCALE: u32>(raw: Int<2>, mode: RoundingMode) -> Int<2> {
let widened: crate::D<crate::int::types::Int<3>, SCALE> = crate::D::<crate::int::types::Int<2>, SCALE>::from_bits(raw).into();
let raw_wide = if matches!(SCALE, 18..=22) {
wide_trig_core::atan_narrow::<wide_trig_d57::Core, SCALE, 10>(widened.0, mode)
} else {
wide_trig_core::atan_series::<wide_trig_d57::Core, SCALE>(widened.0, mode)
};
narrow::<SCALE>(raw_wide, "atan_strict")
}
#[inline]
#[must_use]
pub(crate) fn asin_strict<const SCALE: u32>(raw: Int<2>, mode: RoundingMode) -> Int<2> {
let widened: crate::D<crate::int::types::Int<3>, SCALE> = crate::D::<crate::int::types::Int<2>, SCALE>::from_bits(raw).into();
let result_raw = if matches!(SCALE, 18..=22) {
trig::inverse_tang_3limb_s18_22::asin_strict::<SCALE>(widened.0, mode)
} else {
widened.asin_strict_with(mode).0
};
narrow::<SCALE>(result_raw, "asin_strict")
}
#[inline]
#[must_use]
pub(crate) fn acos_strict<const SCALE: u32>(raw: Int<2>, mode: RoundingMode) -> Int<2> {
let widened: crate::D<crate::int::types::Int<3>, SCALE> = crate::D::<crate::int::types::Int<2>, SCALE>::from_bits(raw).into();
let result_raw = if matches!(SCALE, 18..=22) {
trig::inverse_tang_3limb_s18_22::acos_strict::<SCALE>(widened.0, mode)
} else {
widened.acos_strict_with(mode).0
};
narrow::<SCALE>(result_raw, "acos_strict")
}
#[inline]
#[must_use]
pub(crate) fn atan2_strict<const SCALE: u32>(
y_raw: Int<2>,
x_raw: Int<2>,
mode: RoundingMode,
) -> Int<2> {
let y_wide: crate::D<crate::int::types::Int<3>, SCALE> = crate::D::<crate::int::types::Int<2>, SCALE>::from_bits(y_raw).into();
let x_wide: crate::D<crate::int::types::Int<3>, SCALE> = crate::D::<crate::int::types::Int<2>, SCALE>::from_bits(x_raw).into();
let result_raw = if matches!(SCALE, 18..=22) {
trig::inverse_tang_3limb_s18_22::atan2_strict::<SCALE>(y_wide.0, x_wide.0, mode)
} else {
y_wide.atan2_strict_with(x_wide, mode).0
};
narrow::<SCALE>(result_raw, "atan2_strict")
}
}
macro_rules! narrow_widen {
($name:ident, $kernel:ident, $err:literal) => {
#[inline]
#[must_use]
fn $name<const SCALE: u32>(v: $crate::D<$crate::int::types::Int<1>, SCALE>, mode: RoundingMode) -> $crate::D<$crate::int::types::Int<1>, SCALE> {
let widened: $crate::D<$crate::int::types::Int<2>, SCALE> = v.into();
let raw = trig::trig_series_2limb::$kernel::<SCALE>(widened.0, mode);
$crate::D::<$crate::int::types::Int<2>, SCALE>::from_bits(raw).try_into().expect($err)
}
};
}
macro_rules! narrow_widen_with {
($name:ident, $kernel:ident, $err:literal) => {
#[inline]
#[must_use]
fn $name<const SCALE: u32>(
v: $crate::D<$crate::int::types::Int<1>, SCALE>,
working_digits: u32,
mode: RoundingMode,
) -> $crate::D<$crate::int::types::Int<1>, SCALE> {
let widened: $crate::D<$crate::int::types::Int<2>, SCALE> = v.into();
let raw = trig::trig_series_2limb::$kernel::<SCALE>(widened.0, working_digits, mode);
$crate::D::<$crate::int::types::Int<2>, SCALE>::from_bits(raw).try_into().expect($err)
}
};
}
macro_rules! narrow_widen_binary {
($name:ident, $kernel:ident, $err:literal) => {
#[inline]
#[must_use]
fn $name<const SCALE: u32>(y: $crate::D<$crate::int::types::Int<1>, SCALE>, x: $crate::D<$crate::int::types::Int<1>, SCALE>, mode: RoundingMode) -> $crate::D<$crate::int::types::Int<1>, SCALE> {
let y_wide: $crate::D<$crate::int::types::Int<2>, SCALE> = y.into();
let x_wide: $crate::D<$crate::int::types::Int<2>, SCALE> = x.into();
let raw = trig::trig_series_2limb::$kernel::<SCALE>(y_wide.0, x_wide.0, mode);
$crate::D::<$crate::int::types::Int<2>, SCALE>::from_bits(raw).try_into().expect($err)
}
};
}
macro_rules! narrow_widen_binary_with {
($name:ident, $kernel:ident, $err:literal) => {
#[inline]
#[must_use]
fn $name<const SCALE: u32>(
y: $crate::D<$crate::int::types::Int<1>, SCALE>,
x: $crate::D<$crate::int::types::Int<1>, SCALE>,
working_digits: u32,
mode: RoundingMode,
) -> $crate::D<$crate::int::types::Int<1>, SCALE> {
let y_wide: $crate::D<$crate::int::types::Int<2>, SCALE> = y.into();
let x_wide: $crate::D<$crate::int::types::Int<2>, SCALE> = x.into();
let raw = trig::trig_series_2limb::$kernel::<SCALE>(y_wide.0, x_wide.0, working_digits, mode);
$crate::D::<$crate::int::types::Int<2>, SCALE>::from_bits(raw).try_into().expect($err)
}
};
}
narrow_widen!(sin_strict_d18, sin_strict, "sin_strict: result out of range");
narrow_widen_with!(sin_with_d18, sin_with, "sin_with: result out of range");
narrow_widen!(cos_strict_d18, cos_strict, "cos_strict: result out of range");
narrow_widen_with!(cos_with_d18, cos_with, "cos_with: result out of range");
narrow_widen!(tan_strict_d18, tan_strict, "tan_strict: result out of range");
narrow_widen_with!(tan_with_d18, tan_with, "tan_with: result out of range");
narrow_widen!(atan_strict_d18, atan_strict, "atan_strict: result out of range");
narrow_widen_with!(atan_with_d18, atan_with, "atan_with: result out of range");
narrow_widen!(asin_strict_d18, asin_strict, "asin_strict: result out of range");
narrow_widen_with!(asin_with_d18, asin_with, "asin_with: result out of range");
narrow_widen!(acos_strict_d18, acos_strict, "acos_strict: result out of range");
narrow_widen_with!(acos_with_d18, acos_with, "acos_with: result out of range");
narrow_widen_binary!(atan2_strict_d18, atan2_strict, "atan2_strict: result out of range");
narrow_widen_binary_with!(atan2_with_d18, atan2_with, "atan2_with: result out of range");
macro_rules! impl_narrow_trig {
($T:ident,
$sin_s:path, $sin_w:path,
$cos_s:path, $cos_w:path,
$tan_s:path, $tan_w:path,
$atan_s:path, $atan_w:path,
$asin_s:path, $asin_w:path,
$acos_s:path, $acos_w:path,
$atan2_s:path, $atan2_w:path
) => {
impl<const SCALE: u32> $T<SCALE> {
#[inline]
pub(crate) fn policy_sin(self, mode: RoundingMode) -> Self {
$sin_s(self, mode)
}
#[inline]
pub(crate) fn policy_sin_with(self, wd: u32, mode: RoundingMode) -> Self {
$sin_w(self, wd, mode)
}
#[inline]
pub(crate) fn policy_cos(self, mode: RoundingMode) -> Self {
$cos_s(self, mode)
}
#[inline]
pub(crate) fn policy_cos_with(self, wd: u32, mode: RoundingMode) -> Self {
$cos_w(self, wd, mode)
}
#[inline]
pub(crate) fn policy_tan(self, mode: RoundingMode) -> Self {
$tan_s(self, mode)
}
#[inline]
pub(crate) fn policy_tan_with(self, wd: u32, mode: RoundingMode) -> Self {
$tan_w(self, wd, mode)
}
#[inline]
pub(crate) fn policy_atan(self, mode: RoundingMode) -> Self {
$atan_s(self, mode)
}
#[inline]
pub(crate) fn policy_atan_with(self, wd: u32, mode: RoundingMode) -> Self {
$atan_w(self, wd, mode)
}
#[inline]
pub(crate) fn policy_asin(self, mode: RoundingMode) -> Self {
$asin_s(self, mode)
}
#[inline]
pub(crate) fn policy_asin_with(self, wd: u32, mode: RoundingMode) -> Self {
$asin_w(self, wd, mode)
}
#[inline]
pub(crate) fn policy_acos(self, mode: RoundingMode) -> Self {
$acos_s(self, mode)
}
#[inline]
pub(crate) fn policy_acos_with(self, wd: u32, mode: RoundingMode) -> Self {
$acos_w(self, wd, mode)
}
#[inline]
pub(crate) fn policy_atan2(self, other: Self, mode: RoundingMode) -> Self {
$atan2_s(self, other, mode)
}
#[inline]
pub(crate) fn policy_atan2_with(self, other: Self, wd: u32, mode: RoundingMode) -> Self {
$atan2_w(self, other, wd, mode)
}
#[inline]
pub(crate) fn policy_sinh(self, mode: RoundingMode) -> Self {
let wide: $crate::D<$crate::int::types::Int<2>, SCALE> = self.into();
::core::convert::TryInto::try_into(wide.sinh_strict_with(mode)).unwrap_or_else(
|_| {
crate::support::diagnostics::overflow_panic_with_scale(
concat!(stringify!($T), "::sinh"),
SCALE,
)
},
)
}
#[inline]
pub(crate) fn policy_sinh_with(self, wd: u32, mode: RoundingMode) -> Self {
let wide: $crate::D<$crate::int::types::Int<2>, SCALE> = self.into();
::core::convert::TryInto::try_into(wide.sinh_approx_with(wd, mode)).unwrap_or_else(
|_| {
crate::support::diagnostics::overflow_panic_with_scale(
concat!(stringify!($T), "::sinh"),
SCALE,
)
},
)
}
#[inline]
pub(crate) fn policy_cosh(self, mode: RoundingMode) -> Self {
let wide: $crate::D<$crate::int::types::Int<2>, SCALE> = self.into();
::core::convert::TryInto::try_into(wide.cosh_strict_with(mode)).unwrap_or_else(
|_| {
crate::support::diagnostics::overflow_panic_with_scale(
concat!(stringify!($T), "::cosh"),
SCALE,
)
},
)
}
#[inline]
pub(crate) fn policy_cosh_with(self, wd: u32, mode: RoundingMode) -> Self {
let wide: $crate::D<$crate::int::types::Int<2>, SCALE> = self.into();
::core::convert::TryInto::try_into(wide.cosh_approx_with(wd, mode)).unwrap_or_else(
|_| {
crate::support::diagnostics::overflow_panic_with_scale(
concat!(stringify!($T), "::cosh"),
SCALE,
)
},
)
}
#[inline]
pub(crate) fn policy_tanh(self, mode: RoundingMode) -> Self {
let wide: $crate::D<$crate::int::types::Int<2>, SCALE> = self.into();
::core::convert::TryInto::try_into(wide.tanh_strict_with(mode)).unwrap_or_else(
|_| {
crate::support::diagnostics::overflow_panic_with_scale(
concat!(stringify!($T), "::tanh"),
SCALE,
)
},
)
}
#[inline]
pub(crate) fn policy_tanh_with(self, wd: u32, mode: RoundingMode) -> Self {
let wide: $crate::D<$crate::int::types::Int<2>, SCALE> = self.into();
::core::convert::TryInto::try_into(wide.tanh_approx_with(wd, mode)).unwrap_or_else(
|_| {
crate::support::diagnostics::overflow_panic_with_scale(
concat!(stringify!($T), "::tanh"),
SCALE,
)
},
)
}
#[inline]
pub(crate) fn policy_asinh(self, mode: RoundingMode) -> Self {
let wide: $crate::D<$crate::int::types::Int<2>, SCALE> = self.into();
::core::convert::TryInto::try_into(wide.asinh_strict_with(mode)).unwrap_or_else(
|_| {
crate::support::diagnostics::overflow_panic_with_scale(
concat!(stringify!($T), "::asinh"),
SCALE,
)
},
)
}
#[inline]
pub(crate) fn policy_asinh_with(self, wd: u32, mode: RoundingMode) -> Self {
let wide: $crate::D<$crate::int::types::Int<2>, SCALE> = self.into();
::core::convert::TryInto::try_into(wide.asinh_approx_with(wd, mode)).unwrap_or_else(
|_| {
crate::support::diagnostics::overflow_panic_with_scale(
concat!(stringify!($T), "::asinh"),
SCALE,
)
},
)
}
#[inline]
pub(crate) fn policy_acosh(self, mode: RoundingMode) -> Self {
let wide: $crate::D<$crate::int::types::Int<2>, SCALE> = self.into();
::core::convert::TryInto::try_into(wide.acosh_strict_with(mode)).unwrap_or_else(
|_| {
crate::support::diagnostics::overflow_panic_with_scale(
concat!(stringify!($T), "::acosh"),
SCALE,
)
},
)
}
#[inline]
pub(crate) fn policy_acosh_with(self, wd: u32, mode: RoundingMode) -> Self {
let wide: $crate::D<$crate::int::types::Int<2>, SCALE> = self.into();
::core::convert::TryInto::try_into(wide.acosh_approx_with(wd, mode)).unwrap_or_else(
|_| {
crate::support::diagnostics::overflow_panic_with_scale(
concat!(stringify!($T), "::acosh"),
SCALE,
)
},
)
}
#[inline]
pub(crate) fn policy_atanh(self, mode: RoundingMode) -> Self {
let wide: $crate::D<$crate::int::types::Int<2>, SCALE> = self.into();
::core::convert::TryInto::try_into(wide.atanh_strict_with(mode)).unwrap_or_else(
|_| {
crate::support::diagnostics::overflow_panic_with_scale(
concat!(stringify!($T), "::atanh"),
SCALE,
)
},
)
}
#[inline]
pub(crate) fn policy_atanh_with(self, wd: u32, mode: RoundingMode) -> Self {
let wide: $crate::D<$crate::int::types::Int<2>, SCALE> = self.into();
::core::convert::TryInto::try_into(wide.atanh_approx_with(wd, mode)).unwrap_or_else(
|_| {
crate::support::diagnostics::overflow_panic_with_scale(
concat!(stringify!($T), "::atanh"),
SCALE,
)
},
)
}
#[inline]
pub(crate) fn policy_to_degrees(self, mode: RoundingMode) -> Self {
Self::from_bits(crate::policy::to_degrees::dispatch::<_, SCALE>(self.to_bits(), mode))
}
#[inline]
pub(crate) fn policy_to_degrees_with(self, wd: u32, mode: RoundingMode) -> Self {
let _ = wd;
Self::from_bits(crate::policy::to_degrees::dispatch::<_, SCALE>(self.to_bits(), mode))
}
#[inline]
pub(crate) fn policy_to_radians(self, mode: RoundingMode) -> Self {
Self::from_bits(crate::policy::to_radians::dispatch::<_, SCALE>(self.to_bits(), mode))
}
#[inline]
pub(crate) fn policy_to_radians_with(self, wd: u32, mode: RoundingMode) -> Self {
let _ = wd;
Self::from_bits(crate::policy::to_radians::dispatch::<_, SCALE>(self.to_bits(), mode))
}
}
};
}
impl_narrow_trig!(
D18,
sin_strict_d18,
sin_with_d18,
cos_strict_d18,
cos_with_d18,
tan_strict_d18,
tan_with_d18,
atan_strict_d18,
atan_with_d18,
asin_strict_d18,
asin_with_d18,
acos_strict_d18,
acos_with_d18,
atan2_strict_d18,
atan2_with_d18
);
macro_rules! d38_hyperbolic_and_angle {
() => {
#[inline]
pub(crate) fn policy_sinh(self, mode: RoundingMode) -> Self {
Self(match hyper::resolve::<2, SCALE>(&self.0) {
hyper::Algorithm::ExpIdentity => trig::trig_series_2limb::sinh_strict::<SCALE>(self.0, mode),
#[allow(dead_code)]
hyper::Algorithm::Schoolbook => trig::hyper_schoolbook::sinh_schoolbook_narrow::<SCALE>(self.0, mode),
})
}
#[inline]
pub(crate) fn policy_sinh_with(self, wd: u32, mode: RoundingMode) -> Self {
Self(trig::trig_series_2limb::sinh_with(self.0, SCALE, wd, mode))
}
#[inline]
pub(crate) fn policy_cosh(self, mode: RoundingMode) -> Self {
Self(match hyper::resolve::<2, SCALE>(&self.0) {
hyper::Algorithm::ExpIdentity => trig::trig_series_2limb::cosh_strict::<SCALE>(self.0, mode),
#[allow(dead_code)]
hyper::Algorithm::Schoolbook => trig::hyper_schoolbook::cosh_schoolbook_narrow::<SCALE>(self.0, mode),
})
}
#[inline]
pub(crate) fn policy_cosh_with(self, wd: u32, mode: RoundingMode) -> Self {
Self(trig::trig_series_2limb::cosh_with(self.0, SCALE, wd, mode))
}
#[inline]
pub(crate) fn policy_tanh(self, mode: RoundingMode) -> Self {
Self(match hyper::resolve::<2, SCALE>(&self.0) {
hyper::Algorithm::ExpIdentity => trig::trig_series_2limb::tanh_strict::<SCALE>(self.0, mode),
#[allow(dead_code)]
hyper::Algorithm::Schoolbook => trig::hyper_schoolbook::tanh_schoolbook_narrow::<SCALE>(self.0, mode),
})
}
#[inline]
pub(crate) fn policy_tanh_with(self, wd: u32, mode: RoundingMode) -> Self {
Self(trig::trig_series_2limb::tanh_with(self.0, SCALE, wd, mode))
}
#[inline]
pub(crate) fn policy_asinh(self, mode: RoundingMode) -> Self {
Self(trig::trig_series_2limb::asinh_strict::<SCALE>(self.0, mode))
}
#[inline]
pub(crate) fn policy_asinh_with(self, wd: u32, mode: RoundingMode) -> Self {
Self(trig::trig_series_2limb::asinh_with(self.0, SCALE, wd, mode))
}
#[inline]
pub(crate) fn policy_acosh(self, mode: RoundingMode) -> Self {
Self(trig::trig_series_2limb::acosh_strict::<SCALE>(self.0, mode))
}
#[inline]
pub(crate) fn policy_acosh_with(self, wd: u32, mode: RoundingMode) -> Self {
Self(trig::trig_series_2limb::acosh_with(self.0, SCALE, wd, mode))
}
#[inline]
pub(crate) fn policy_atanh(self, mode: RoundingMode) -> Self {
Self(trig::trig_series_2limb::atanh_strict::<SCALE>(self.0, mode))
}
#[inline]
pub(crate) fn policy_atanh_with(self, wd: u32, mode: RoundingMode) -> Self {
Self(trig::trig_series_2limb::atanh_with(self.0, SCALE, wd, mode))
}
#[inline]
pub(crate) fn policy_to_degrees(self, mode: RoundingMode) -> Self {
Self::from_bits(crate::policy::to_degrees::dispatch::<_, SCALE>(self.to_bits(), mode))
}
#[inline]
pub(crate) fn policy_to_degrees_with(self, wd: u32, mode: RoundingMode) -> Self {
let _ = wd;
Self::from_bits(crate::policy::to_degrees::dispatch::<_, SCALE>(self.to_bits(), mode))
}
#[inline]
pub(crate) fn policy_to_radians(self, mode: RoundingMode) -> Self {
Self::from_bits(crate::policy::to_radians::dispatch::<_, SCALE>(self.to_bits(), mode))
}
#[inline]
pub(crate) fn policy_to_radians_with(self, wd: u32, mode: RoundingMode) -> Self {
let _ = wd;
Self::from_bits(crate::policy::to_radians::dispatch::<_, SCALE>(self.to_bits(), mode))
}
};
}
macro_rules! d38_forward_fixed {
() => {
#[inline]
pub(crate) fn policy_sin(self, mode: RoundingMode) -> Self {
Self(match forward::resolve::<2, SCALE>(&self.0) {
forward::Algorithm::Series => trig::trig_series_2limb::sin_strict::<SCALE>(self.0, mode),
#[cfg(feature = "_wide-support")]
forward::Algorithm::Tang => trig::trig_series_2limb::sin_strict::<SCALE>(self.0, mode),
#[allow(dead_code)]
forward::Algorithm::Schoolbook => trig::trig_schoolbook::sin_schoolbook_narrow::<SCALE>(self.0, mode),
})
}
#[inline]
pub(crate) fn policy_sin_with(self, wd: u32, mode: RoundingMode) -> Self {
Self(trig::trig_series_2limb::sin_with::<SCALE>(self.0, wd, mode))
}
#[inline]
pub(crate) fn policy_cos(self, mode: RoundingMode) -> Self {
Self(match forward::resolve::<2, SCALE>(&self.0) {
forward::Algorithm::Series => trig::trig_series_2limb::cos_strict::<SCALE>(self.0, mode),
#[cfg(feature = "_wide-support")]
forward::Algorithm::Tang => trig::trig_series_2limb::cos_strict::<SCALE>(self.0, mode),
#[allow(dead_code)]
forward::Algorithm::Schoolbook => trig::trig_schoolbook::cos_schoolbook_narrow::<SCALE>(self.0, mode),
})
}
#[inline]
pub(crate) fn policy_cos_with(self, wd: u32, mode: RoundingMode) -> Self {
Self(trig::trig_series_2limb::cos_with::<SCALE>(self.0, wd, mode))
}
#[inline]
pub(crate) fn policy_tan(self, mode: RoundingMode) -> Self {
Self(match forward::resolve_tan::<2, SCALE>(&self.0) {
forward::Algorithm::Series => trig::trig_series_2limb::tan_strict::<SCALE>(self.0, mode),
#[cfg(feature = "_wide-support")]
forward::Algorithm::Tang => trig::trig_series_2limb::tan_strict::<SCALE>(self.0, mode),
#[allow(dead_code)]
forward::Algorithm::Schoolbook => trig::trig_schoolbook::tan_schoolbook_narrow::<SCALE>(self.0, mode),
})
}
#[inline]
pub(crate) fn policy_tan_with(self, wd: u32, mode: RoundingMode) -> Self {
Self(trig::trig_series_2limb::tan_with::<SCALE>(self.0, wd, mode))
}
};
}
#[cfg(any(feature = "d57", feature = "wide"))]
impl<const SCALE: u32> crate::D<crate::int::types::Int<2>, SCALE> {
d38_forward_fixed!();
#[inline]
pub(crate) fn policy_atan(self, mode: RoundingMode) -> Self {
Self(match inverse::resolve::<2, SCALE>(&self.0) {
inverse::Algorithm::Atan => borrow_d57::atan_strict::<SCALE>(self.0, mode),
#[allow(dead_code)]
inverse::Algorithm::Schoolbook => trig::trig_schoolbook::atan_schoolbook_narrow::<SCALE>(self.0, mode),
})
}
#[inline]
pub(crate) fn policy_atan_with(self, _wd: u32, mode: RoundingMode) -> Self {
Self(borrow_d57::atan_strict::<SCALE>(self.0, mode))
}
#[inline]
pub(crate) fn policy_asin(self, mode: RoundingMode) -> Self {
Self(match inverse::resolve::<2, SCALE>(&self.0) {
inverse::Algorithm::Atan => borrow_d57::asin_strict::<SCALE>(self.0, mode),
#[allow(dead_code)]
inverse::Algorithm::Schoolbook => trig::inverse_schoolbook::asin_schoolbook_narrow::<SCALE>(self.0, mode),
})
}
#[inline]
pub(crate) fn policy_asin_with(self, _wd: u32, mode: RoundingMode) -> Self {
Self(borrow_d57::asin_strict::<SCALE>(self.0, mode))
}
#[inline]
pub(crate) fn policy_acos(self, mode: RoundingMode) -> Self {
Self(match inverse::resolve::<2, SCALE>(&self.0) {
inverse::Algorithm::Atan => borrow_d57::acos_strict::<SCALE>(self.0, mode),
#[allow(dead_code)]
inverse::Algorithm::Schoolbook => trig::inverse_schoolbook::acos_schoolbook_narrow::<SCALE>(self.0, mode),
})
}
#[inline]
pub(crate) fn policy_acos_with(self, _wd: u32, mode: RoundingMode) -> Self {
Self(borrow_d57::acos_strict::<SCALE>(self.0, mode))
}
#[inline]
pub(crate) fn policy_atan2(self, other: Self, mode: RoundingMode) -> Self {
Self(match inverse::resolve::<2, SCALE>(&self.0) {
inverse::Algorithm::Atan => {
borrow_d57::atan2_strict::<SCALE>(self.0, other.0, mode)
}
#[allow(dead_code)]
inverse::Algorithm::Schoolbook => trig::inverse_schoolbook::atan2_schoolbook_narrow::<SCALE>(self.0, other.0, mode),
})
}
#[inline]
pub(crate) fn policy_atan2_with(self, other: Self, _wd: u32, mode: RoundingMode) -> Self {
Self(borrow_d57::atan2_strict::<SCALE>(self.0, other.0, mode))
}
d38_hyperbolic_and_angle!();
}
#[cfg(not(any(feature = "d57", feature = "wide")))]
impl<const SCALE: u32> crate::D<crate::int::types::Int<2>, SCALE> {
d38_forward_fixed!();
#[inline]
pub(crate) fn policy_atan(self, mode: RoundingMode) -> Self {
Self(match inverse::resolve::<2, SCALE>(&self.0) {
inverse::Algorithm::Atan => trig::trig_series_2limb::atan_strict::<SCALE>(self.0, mode),
#[allow(dead_code)]
inverse::Algorithm::Schoolbook => trig::trig_schoolbook::atan_schoolbook_narrow::<SCALE>(self.0, mode),
})
}
#[inline]
pub(crate) fn policy_atan_with(self, wd: u32, mode: RoundingMode) -> Self {
Self(trig::trig_series_2limb::atan_with::<SCALE>(self.0, wd, mode))
}
#[inline]
pub(crate) fn policy_asin(self, mode: RoundingMode) -> Self {
Self(match inverse::resolve::<2, SCALE>(&self.0) {
inverse::Algorithm::Atan => trig::trig_series_2limb::asin_strict::<SCALE>(self.0, mode),
#[allow(dead_code)]
inverse::Algorithm::Schoolbook => trig::inverse_schoolbook::asin_schoolbook_narrow::<SCALE>(self.0, mode),
})
}
#[inline]
pub(crate) fn policy_asin_with(self, wd: u32, mode: RoundingMode) -> Self {
Self(trig::trig_series_2limb::asin_with::<SCALE>(self.0, wd, mode))
}
#[inline]
pub(crate) fn policy_acos(self, mode: RoundingMode) -> Self {
Self(match inverse::resolve::<2, SCALE>(&self.0) {
inverse::Algorithm::Atan => trig::trig_series_2limb::acos_strict::<SCALE>(self.0, mode),
#[allow(dead_code)]
inverse::Algorithm::Schoolbook => trig::inverse_schoolbook::acos_schoolbook_narrow::<SCALE>(self.0, mode),
})
}
#[inline]
pub(crate) fn policy_acos_with(self, wd: u32, mode: RoundingMode) -> Self {
Self(trig::trig_series_2limb::acos_with::<SCALE>(self.0, wd, mode))
}
#[inline]
pub(crate) fn policy_atan2(self, other: Self, mode: RoundingMode) -> Self {
Self(match inverse::resolve::<2, SCALE>(&self.0) {
inverse::Algorithm::Atan => {
trig::trig_series_2limb::atan2_strict::<SCALE>(self.0, other.0, mode)
}
#[allow(dead_code)]
inverse::Algorithm::Schoolbook => trig::inverse_schoolbook::atan2_schoolbook_narrow::<SCALE>(self.0, other.0, mode),
})
}
#[inline]
pub(crate) fn policy_atan2_with(self, other: Self, wd: u32, mode: RoundingMode) -> Self {
Self(trig::trig_series_2limb::atan2_with::<SCALE>(self.0, other.0, wd, mode))
}
d38_hyperbolic_and_angle!();
}
#[allow(unused_macros)]
macro_rules! wide_trig_inverse_inherent {
($N:literal, $Core:ty) => {
#[inline]
pub(crate) fn policy_asin(self, mode: RoundingMode) -> Self {
match inverse::resolve::<$N, SCALE>(&self.0) {
inverse::Algorithm::Atan => Self(inverse_rung::asin_strict::<$Core, SCALE>(self.0, mode)),
#[allow(dead_code)]
inverse::Algorithm::Schoolbook => Self(crate::algos::trig::inverse_schoolbook::asin_schoolbook::<$Core, SCALE>(self.0, mode)),
}
}
#[inline]
pub(crate) fn policy_asin_with(self, _wd: u32, mode: RoundingMode) -> Self {
Self(inverse_rung::asin_strict::<$Core, SCALE>(self.0, mode))
}
#[inline]
pub(crate) fn policy_acos(self, mode: RoundingMode) -> Self {
match inverse::resolve::<$N, SCALE>(&self.0) {
inverse::Algorithm::Atan => Self(inverse_rung::acos_strict::<$Core, SCALE>(self.0, mode)),
#[allow(dead_code)]
inverse::Algorithm::Schoolbook => Self(crate::algos::trig::inverse_schoolbook::acos_schoolbook::<$Core, SCALE>(self.0, mode)),
}
}
#[inline]
pub(crate) fn policy_acos_with(self, _wd: u32, mode: RoundingMode) -> Self {
Self(inverse_rung::acos_strict::<$Core, SCALE>(self.0, mode))
}
#[inline]
pub(crate) fn policy_atan2(self, other: Self, mode: RoundingMode) -> Self {
match inverse::resolve::<$N, SCALE>(&self.0) {
inverse::Algorithm::Atan => Self(inverse_rung::atan2_strict::<$Core, SCALE>(self.0, other.0, mode)),
#[allow(dead_code)]
inverse::Algorithm::Schoolbook => Self(crate::algos::trig::inverse_schoolbook::atan2_schoolbook::<$Core, SCALE>(self.0, other.0, mode)),
}
}
#[inline]
pub(crate) fn policy_atan2_with(self, other: Self, _wd: u32, mode: RoundingMode) -> Self {
Self(inverse_rung::atan2_strict::<$Core, SCALE>(self.0, other.0, mode))
}
};
}
#[allow(unused_macros)]
macro_rules! wide_trig_extra_inherent {
($N:literal, $Core:ty) => {
#[inline]
pub(crate) fn policy_asinh(self, mode: RoundingMode) -> Self {
Self(extra_rung::asinh_strict::<$Core, SCALE>(self.0, mode))
}
#[inline]
pub(crate) fn policy_asinh_with(self, _wd: u32, mode: RoundingMode) -> Self {
Self(extra_rung::asinh_strict::<$Core, SCALE>(self.0, mode))
}
#[inline]
pub(crate) fn policy_acosh(self, mode: RoundingMode) -> Self {
Self(extra_rung::acosh_strict::<$Core, SCALE>(self.0, mode))
}
#[inline]
pub(crate) fn policy_acosh_with(self, _wd: u32, mode: RoundingMode) -> Self {
Self(extra_rung::acosh_strict::<$Core, SCALE>(self.0, mode))
}
#[inline]
pub(crate) fn policy_atanh(self, mode: RoundingMode) -> Self {
Self(extra_rung::atanh_strict::<$Core, SCALE>(self.0, mode))
}
#[inline]
pub(crate) fn policy_atanh_with(self, _wd: u32, mode: RoundingMode) -> Self {
Self(extra_rung::atanh_strict::<$Core, SCALE>(self.0, mode))
}
#[inline]
pub(crate) fn policy_to_degrees(self, mode: RoundingMode) -> Self {
Self::from_bits(crate::policy::to_degrees::dispatch::<_, SCALE>(self.to_bits(), mode))
}
#[inline]
pub(crate) fn policy_to_degrees_with(self, wd: u32, mode: RoundingMode) -> Self {
let _ = wd;
Self::from_bits(crate::policy::to_degrees::dispatch::<_, SCALE>(self.to_bits(), mode))
}
#[inline]
pub(crate) fn policy_to_radians(self, mode: RoundingMode) -> Self {
Self::from_bits(crate::policy::to_radians::dispatch::<_, SCALE>(self.to_bits(), mode))
}
#[inline]
pub(crate) fn policy_to_radians_with(self, wd: u32, mode: RoundingMode) -> Self {
let _ = wd;
Self::from_bits(crate::policy::to_radians::dispatch::<_, SCALE>(self.to_bits(), mode))
}
};
}
#[allow(unused_macros)]
macro_rules! wide_trig_hyper_inherent {
($N:literal, $Core:ty) => {
#[inline]
pub(crate) fn policy_sinh(self, mode: RoundingMode) -> Self {
match hyper::resolve::<$N, SCALE>(&self.0) {
hyper::Algorithm::ExpIdentity => Self(hyper_rung::sinh_strict::<$Core, SCALE>(self.0, mode)),
#[allow(dead_code)]
hyper::Algorithm::Schoolbook => Self(crate::algos::trig::hyper_schoolbook::sinh_schoolbook::<$Core, SCALE>(self.0, mode)),
}
}
#[inline]
pub(crate) fn policy_sinh_with(self, _wd: u32, mode: RoundingMode) -> Self {
Self(hyper_rung::sinh_strict::<$Core, SCALE>(self.0, mode))
}
#[inline]
pub(crate) fn policy_cosh(self, mode: RoundingMode) -> Self {
match hyper::resolve::<$N, SCALE>(&self.0) {
hyper::Algorithm::ExpIdentity => Self(hyper_rung::cosh_strict::<$Core, SCALE>(self.0, mode)),
#[allow(dead_code)]
hyper::Algorithm::Schoolbook => Self(crate::algos::trig::hyper_schoolbook::cosh_schoolbook::<$Core, SCALE>(self.0, mode)),
}
}
#[inline]
pub(crate) fn policy_cosh_with(self, _wd: u32, mode: RoundingMode) -> Self {
Self(hyper_rung::cosh_strict::<$Core, SCALE>(self.0, mode))
}
#[inline]
pub(crate) fn policy_tanh(self, mode: RoundingMode) -> Self {
match hyper::resolve::<$N, SCALE>(&self.0) {
hyper::Algorithm::ExpIdentity => Self(hyper_rung::tanh_strict::<$Core, SCALE>(self.0, mode)),
#[allow(dead_code)]
hyper::Algorithm::Schoolbook => Self(crate::algos::trig::hyper_schoolbook::tanh_schoolbook::<$Core, SCALE>(self.0, mode)),
}
}
#[inline]
pub(crate) fn policy_tanh_with(self, _wd: u32, mode: RoundingMode) -> Self {
Self(hyper_rung::tanh_strict::<$Core, SCALE>(self.0, mode))
}
};
}
#[allow(unused_macros)]
macro_rules! wide_trig_forward_series {
($N:literal, $Core:ty) => {
#[inline]
pub(crate) fn policy_sin(self, mode: RoundingMode) -> Self {
Self(match forward::resolve::<$N, SCALE>(&self.0) {
forward::Algorithm::Series => {
forward_rung::sin_strict::<$Core, SCALE, { <$Core as crate::algos::support::wide_trig_core::WideTrigCore>::GUARD }>(self.0, mode)
}
#[cfg(feature = "_wide-support")]
forward::Algorithm::Tang => {
forward_rung::sin_strict::<$Core, SCALE, { <$Core as crate::algos::support::wide_trig_core::WideTrigCore>::GUARD }>(self.0, mode)
}
#[allow(dead_code)]
forward::Algorithm::Schoolbook => crate::algos::trig::trig_schoolbook::sin_schoolbook::<$Core, SCALE>(self.0, mode),
})
}
#[inline]
pub(crate) fn policy_sin_with(self, _wd: u32, mode: RoundingMode) -> Self {
Self(forward_rung::sin_strict::<$Core, SCALE, { <$Core as crate::algos::support::wide_trig_core::WideTrigCore>::GUARD }>(self.0, mode))
}
#[inline]
pub(crate) fn policy_cos(self, mode: RoundingMode) -> Self {
Self(match forward::resolve::<$N, SCALE>(&self.0) {
forward::Algorithm::Series => {
forward_rung::cos_strict::<$Core, SCALE, { <$Core as crate::algos::support::wide_trig_core::WideTrigCore>::GUARD }>(self.0, mode)
}
#[cfg(feature = "_wide-support")]
forward::Algorithm::Tang => {
forward_rung::cos_strict::<$Core, SCALE, { <$Core as crate::algos::support::wide_trig_core::WideTrigCore>::GUARD }>(self.0, mode)
}
#[allow(dead_code)]
forward::Algorithm::Schoolbook => crate::algos::trig::trig_schoolbook::cos_schoolbook::<$Core, SCALE>(self.0, mode),
})
}
#[inline]
pub(crate) fn policy_cos_with(self, _wd: u32, mode: RoundingMode) -> Self {
Self(forward_rung::cos_strict::<$Core, SCALE, { <$Core as crate::algos::support::wide_trig_core::WideTrigCore>::GUARD }>(self.0, mode))
}
#[inline]
pub(crate) fn policy_tan(self, mode: RoundingMode) -> Self {
Self(match forward::resolve_tan::<$N, SCALE>(&self.0) {
forward::Algorithm::Series => {
forward_rung::tan_strict::<$Core, SCALE, { <$Core as crate::algos::support::wide_trig_core::WideTrigCore>::GUARD }, true, true>(self.0, mode)
}
#[cfg(feature = "_wide-support")]
forward::Algorithm::Tang => {
forward_rung::tan_strict::<$Core, SCALE, { <$Core as crate::algos::support::wide_trig_core::WideTrigCore>::GUARD }, true, true>(self.0, mode)
}
#[allow(dead_code)]
forward::Algorithm::Schoolbook => crate::algos::trig::trig_schoolbook::tan_schoolbook::<$Core, SCALE>(self.0, mode),
})
}
#[inline]
pub(crate) fn policy_tan_with(self, _wd: u32, mode: RoundingMode) -> Self {
Self(forward_rung::tan_strict::<$Core, SCALE, { <$Core as crate::algos::support::wide_trig_core::WideTrigCore>::GUARD }, true, true>(self.0, mode))
}
#[inline]
pub(crate) fn policy_atan(self, mode: RoundingMode) -> Self {
Self(match forward::resolve::<$N, SCALE>(&self.0) {
forward::Algorithm::Series => {
forward_rung::atan_strict::<$Core, SCALE, { <$Core as crate::algos::support::wide_trig_core::WideTrigCore>::GUARD }, true>(self.0, mode)
}
#[cfg(feature = "_wide-support")]
forward::Algorithm::Tang => {
forward_rung::atan_strict::<$Core, SCALE, { <$Core as crate::algos::support::wide_trig_core::WideTrigCore>::GUARD }, true>(self.0, mode)
}
#[allow(dead_code)]
forward::Algorithm::Schoolbook => crate::algos::trig::trig_schoolbook::atan_schoolbook::<$Core, SCALE>(self.0, mode),
})
}
#[inline]
pub(crate) fn policy_atan_with(self, _wd: u32, mode: RoundingMode) -> Self {
Self(forward_rung::atan_strict::<$Core, SCALE, { <$Core as crate::algos::support::wide_trig_core::WideTrigCore>::GUARD }, true>(self.0, mode))
}
};
}
#[cfg(any(feature = "d57", feature = "wide"))]
impl<const SCALE: u32> crate::D<crate::int::types::Int<3>, SCALE> {
#[inline]
pub(crate) fn policy_sin(self, mode: RoundingMode) -> Self {
Self(match forward::resolve::<3, SCALE>(&self.0) {
forward::Algorithm::Series => match SCALE {
18..=22 => forward_rung::sin_strict::<crate::types::widths::wide_trig_d57::Core, SCALE, 8>(self.0, mode),
_ => forward_rung::sin_strict::<crate::types::widths::wide_trig_d57::Core, SCALE, { <crate::types::widths::wide_trig_d57::Core as crate::algos::support::wide_trig_core::WideTrigCore>::GUARD }>(self.0, mode),
},
forward::Algorithm::Tang => {
trig::sincos_tang::sin_tang_with_taylor::<crate::types::widths::wide_trig_d57::Core, SCALE, 512>(self.0, mode)
}
#[allow(dead_code)]
forward::Algorithm::Schoolbook => crate::algos::trig::trig_schoolbook::sin_schoolbook::<crate::types::widths::wide_trig_d57::Core, SCALE>(self.0, mode),
})
}
#[inline]
pub(crate) fn policy_sin_with(self, _wd: u32, mode: RoundingMode) -> Self {
self.policy_sin(mode)
}
#[inline]
pub(crate) fn policy_cos(self, mode: RoundingMode) -> Self {
Self(match forward::resolve::<3, SCALE>(&self.0) {
forward::Algorithm::Series => match SCALE {
18..=22 => forward_rung::cos_strict::<crate::types::widths::wide_trig_d57::Core, SCALE, 8>(self.0, mode),
_ => forward_rung::cos_strict::<crate::types::widths::wide_trig_d57::Core, SCALE, { <crate::types::widths::wide_trig_d57::Core as crate::algos::support::wide_trig_core::WideTrigCore>::GUARD }>(self.0, mode),
},
forward::Algorithm::Tang => {
trig::sincos_tang::cos_tang_with_taylor::<crate::types::widths::wide_trig_d57::Core, SCALE, 512>(self.0, mode)
}
#[allow(dead_code)]
forward::Algorithm::Schoolbook => crate::algos::trig::trig_schoolbook::cos_schoolbook::<crate::types::widths::wide_trig_d57::Core, SCALE>(self.0, mode),
})
}
#[inline]
pub(crate) fn policy_cos_with(self, _wd: u32, mode: RoundingMode) -> Self {
self.policy_cos(mode)
}
#[inline]
pub(crate) fn policy_tan(self, mode: RoundingMode) -> Self {
Self(match forward::resolve_tan::<3, SCALE>(&self.0) {
forward::Algorithm::Series => match SCALE {
18..=22 => trig::sincos_tang_3limb_s18_22::tan_strict::<SCALE>(self.0, mode),
_ => forward_rung::tan_strict::<crate::types::widths::wide_trig_d57::Core, SCALE, { <crate::types::widths::wide_trig_d57::Core as crate::algos::support::wide_trig_core::WideTrigCore>::GUARD }, true, true>(self.0, mode),
},
forward::Algorithm::Tang => forward_rung::tan_strict::<crate::types::widths::wide_trig_d57::Core, SCALE, { <crate::types::widths::wide_trig_d57::Core as crate::algos::support::wide_trig_core::WideTrigCore>::GUARD }, true, true>(self.0, mode),
#[allow(dead_code)]
forward::Algorithm::Schoolbook => crate::algos::trig::trig_schoolbook::tan_schoolbook::<crate::types::widths::wide_trig_d57::Core, SCALE>(self.0, mode),
})
}
#[inline]
pub(crate) fn policy_tan_with(self, _wd: u32, mode: RoundingMode) -> Self {
self.policy_tan(mode)
}
#[inline]
pub(crate) fn policy_atan(self, mode: RoundingMode) -> Self {
Self(match forward::resolve::<3, SCALE>(&self.0) {
forward::Algorithm::Series => match SCALE {
18..=22 => forward_rung::atan_strict::<crate::types::widths::wide_trig_d57::Core, SCALE, 10, false>(self.0, mode),
_ => forward_rung::atan_strict::<crate::types::widths::wide_trig_d57::Core, SCALE, { <crate::types::widths::wide_trig_d57::Core as crate::algos::support::wide_trig_core::WideTrigCore>::GUARD }, true>(self.0, mode),
},
forward::Algorithm::Tang => {
trig::atan_tang_3limb_s44_56::atan_strict::<SCALE>(self.0, mode)
}
#[allow(dead_code)]
forward::Algorithm::Schoolbook => crate::algos::trig::trig_schoolbook::atan_schoolbook::<crate::types::widths::wide_trig_d57::Core, SCALE>(self.0, mode),
})
}
#[inline]
pub(crate) fn policy_atan_with(self, _wd: u32, mode: RoundingMode) -> Self {
self.policy_atan(mode)
}
#[inline]
pub(crate) fn policy_asin(self, mode: RoundingMode) -> Self {
Self(match inverse::resolve::<3, SCALE>(&self.0) {
inverse::Algorithm::Atan => match SCALE {
18..=22 => trig::inverse_tang_3limb_s18_22::asin_strict::<SCALE>(self.0, mode),
_ => return Self(inverse_rung::asin_strict::<crate::types::widths::wide_trig_d57::Core, SCALE>(self.0, mode)),
},
#[allow(dead_code)]
inverse::Algorithm::Schoolbook => trig::inverse_schoolbook::asin_schoolbook::<crate::types::widths::wide_trig_d57::Core, SCALE>(self.0, mode),
})
}
#[inline]
pub(crate) fn policy_asin_with(self, _wd: u32, mode: RoundingMode) -> Self {
self.policy_asin(mode)
}
#[inline]
pub(crate) fn policy_acos(self, mode: RoundingMode) -> Self {
Self(match inverse::resolve::<3, SCALE>(&self.0) {
inverse::Algorithm::Atan => match SCALE {
18..=22 => trig::inverse_tang_3limb_s18_22::acos_strict::<SCALE>(self.0, mode),
_ => return Self(inverse_rung::acos_strict::<crate::types::widths::wide_trig_d57::Core, SCALE>(self.0, mode)),
},
#[allow(dead_code)]
inverse::Algorithm::Schoolbook => trig::inverse_schoolbook::acos_schoolbook::<crate::types::widths::wide_trig_d57::Core, SCALE>(self.0, mode),
})
}
#[inline]
pub(crate) fn policy_acos_with(self, _wd: u32, mode: RoundingMode) -> Self {
self.policy_acos(mode)
}
#[inline]
pub(crate) fn policy_atan2(self, other: Self, mode: RoundingMode) -> Self {
Self(match inverse::resolve::<3, SCALE>(&self.0) {
inverse::Algorithm::Atan => match SCALE {
18..=22 => {
trig::inverse_tang_3limb_s18_22::atan2_strict::<SCALE>(self.0, other.0, mode)
}
_ => return Self(inverse_rung::atan2_strict::<crate::types::widths::wide_trig_d57::Core, SCALE>(self.0, other.0, mode)),
},
#[allow(dead_code)]
inverse::Algorithm::Schoolbook => trig::inverse_schoolbook::atan2_schoolbook::<crate::types::widths::wide_trig_d57::Core, SCALE>(self.0, other.0, mode),
})
}
#[inline]
pub(crate) fn policy_atan2_with(self, other: Self, _wd: u32, mode: RoundingMode) -> Self {
self.policy_atan2(other, mode)
}
#[inline]
pub(crate) fn policy_sinh(self, mode: RoundingMode) -> Self {
Self(match hyper::resolve::<3, SCALE>(&self.0) {
hyper::Algorithm::ExpIdentity => match SCALE {
18..=22 if hyper_band_in_range::<3, SCALE>(&self.0) => trig::hyper_exp_identity::sinh_exp_identity_with_tang::<crate::types::widths::wide_trig_d57::Core, SCALE, 8, 128, false>(self.0, mode),
_ => return Self(hyper_rung::sinh_strict::<crate::types::widths::wide_trig_d57::Core, SCALE>(self.0, mode)),
},
#[allow(dead_code)]
hyper::Algorithm::Schoolbook => trig::hyper_schoolbook::sinh_schoolbook::<crate::types::widths::wide_trig_d57::Core, SCALE>(self.0, mode),
})
}
#[inline]
pub(crate) fn policy_sinh_with(self, _wd: u32, mode: RoundingMode) -> Self {
self.policy_sinh(mode)
}
#[inline]
pub(crate) fn policy_cosh(self, mode: RoundingMode) -> Self {
Self(match hyper::resolve::<3, SCALE>(&self.0) {
hyper::Algorithm::ExpIdentity => match SCALE {
18..=22 if hyper_band_in_range::<3, SCALE>(&self.0) => trig::hyper_exp_identity::cosh_exp_identity_with_tang::<crate::types::widths::wide_trig_d57::Core, SCALE, 8, 128, false>(self.0, mode),
_ => return Self(hyper_rung::cosh_strict::<crate::types::widths::wide_trig_d57::Core, SCALE>(self.0, mode)),
},
#[allow(dead_code)]
hyper::Algorithm::Schoolbook => trig::hyper_schoolbook::cosh_schoolbook::<crate::types::widths::wide_trig_d57::Core, SCALE>(self.0, mode),
})
}
#[inline]
pub(crate) fn policy_cosh_with(self, _wd: u32, mode: RoundingMode) -> Self {
self.policy_cosh(mode)
}
#[inline]
pub(crate) fn policy_tanh(self, mode: RoundingMode) -> Self {
Self(match hyper::resolve::<3, SCALE>(&self.0) {
hyper::Algorithm::ExpIdentity => match SCALE {
18..=22 if hyper_band_in_range::<3, SCALE>(&self.0) => trig::hyper_exp_identity::tanh_exp_identity_with_tang::<crate::types::widths::wide_trig_d57::Core, SCALE, 8, 128, false>(self.0, mode),
_ => return Self(hyper_rung::tanh_strict::<crate::types::widths::wide_trig_d57::Core, SCALE>(self.0, mode)),
},
#[allow(dead_code)]
hyper::Algorithm::Schoolbook => trig::hyper_schoolbook::tanh_schoolbook::<crate::types::widths::wide_trig_d57::Core, SCALE>(self.0, mode),
})
}
#[inline]
pub(crate) fn policy_tanh_with(self, _wd: u32, mode: RoundingMode) -> Self {
self.policy_tanh(mode)
}
wide_trig_extra_inherent!(3, crate::types::widths::wide_trig_d57::Core);
}
#[cfg(any(feature = "d76", feature = "wide"))]
impl<const SCALE: u32> crate::D<crate::int::types::Int<4>, SCALE> {
wide_trig_forward_series!(4, crate::types::widths::wide_trig_d76::Core);
wide_trig_inverse_inherent!(4, crate::types::widths::wide_trig_d76::Core);
wide_trig_hyper_inherent!(4, crate::types::widths::wide_trig_d76::Core);
wide_trig_extra_inherent!(4, crate::types::widths::wide_trig_d76::Core);
}
#[cfg(any(feature = "d115", feature = "wide"))]
impl<const SCALE: u32> crate::D<crate::int::types::Int<6>, SCALE> {
wide_trig_forward_series!(6, crate::types::widths::wide_trig_d115::Core);
wide_trig_inverse_inherent!(6, crate::types::widths::wide_trig_d115::Core);
#[inline]
pub(crate) fn policy_sinh(self, mode: RoundingMode) -> Self {
Self(match hyper::resolve::<6, SCALE>(&self.0) {
hyper::Algorithm::ExpIdentity => match SCALE {
50..=60 if hyper_band_in_range::<6, SCALE>(&self.0) => trig::hyper_exp_identity::sinh_exp_identity_with_tang::<crate::types::widths::wide_trig_d115::Core, SCALE, 8, 128, false>(self.0, mode),
_ => return Self(crate::algos::trig::hyper_schoolbook::sinh_schoolbook::<crate::types::widths::wide_trig_d115::Core, SCALE>(self.0, mode)),
},
#[allow(dead_code)]
hyper::Algorithm::Schoolbook => trig::hyper_schoolbook::sinh_schoolbook::<crate::types::widths::wide_trig_d115::Core, SCALE>(self.0, mode),
})
}
#[inline]
pub(crate) fn policy_sinh_with(self, _wd: u32, mode: RoundingMode) -> Self {
self.policy_sinh(mode)
}
#[inline]
pub(crate) fn policy_cosh(self, mode: RoundingMode) -> Self {
Self(match hyper::resolve::<6, SCALE>(&self.0) {
hyper::Algorithm::ExpIdentity => match SCALE {
50..=60 if hyper_band_in_range::<6, SCALE>(&self.0) => trig::hyper_exp_identity::cosh_exp_identity_with_tang::<crate::types::widths::wide_trig_d115::Core, SCALE, 8, 128, false>(self.0, mode),
_ => return Self(crate::algos::trig::hyper_schoolbook::cosh_schoolbook::<crate::types::widths::wide_trig_d115::Core, SCALE>(self.0, mode)),
},
#[allow(dead_code)]
hyper::Algorithm::Schoolbook => trig::hyper_schoolbook::cosh_schoolbook::<crate::types::widths::wide_trig_d115::Core, SCALE>(self.0, mode),
})
}
#[inline]
pub(crate) fn policy_cosh_with(self, _wd: u32, mode: RoundingMode) -> Self {
self.policy_cosh(mode)
}
#[inline]
pub(crate) fn policy_tanh(self, mode: RoundingMode) -> Self {
Self(match hyper::resolve::<6, SCALE>(&self.0) {
hyper::Algorithm::ExpIdentity => match SCALE {
50..=60 if hyper_band_in_range::<6, SCALE>(&self.0) => trig::hyper_exp_identity::tanh_exp_identity_with_tang::<crate::types::widths::wide_trig_d115::Core, SCALE, 8, 128, false>(self.0, mode),
_ => return Self(crate::algos::trig::hyper_schoolbook::tanh_schoolbook::<crate::types::widths::wide_trig_d115::Core, SCALE>(self.0, mode)),
},
#[allow(dead_code)]
hyper::Algorithm::Schoolbook => trig::hyper_schoolbook::tanh_schoolbook::<crate::types::widths::wide_trig_d115::Core, SCALE>(self.0, mode),
})
}
#[inline]
pub(crate) fn policy_tanh_with(self, _wd: u32, mode: RoundingMode) -> Self {
self.policy_tanh(mode)
}
wide_trig_extra_inherent!(6, crate::types::widths::wide_trig_d115::Core);
}
#[cfg(any(feature = "d153", feature = "wide"))]
impl<const SCALE: u32> crate::D<crate::int::types::Int<8>, SCALE> {
#[inline]
pub(crate) fn policy_sin(self, mode: RoundingMode) -> Self {
Self(match forward::resolve::<8, SCALE>(&self.0) {
forward::Algorithm::Series => forward_rung::sin_strict::<crate::types::widths::wide_trig_d153::Core, SCALE, { <crate::types::widths::wide_trig_d153::Core as crate::algos::support::wide_trig_core::WideTrigCore>::GUARD }>(self.0, mode),
forward::Algorithm::Tang => {
forward_rung::sin_strict::<crate::types::widths::wide_trig_d153::Core, SCALE, 10>(self.0, mode)
}
#[allow(dead_code)]
forward::Algorithm::Schoolbook => crate::algos::trig::trig_schoolbook::sin_schoolbook::<crate::types::widths::wide_trig_d153::Core, SCALE>(self.0, mode),
})
}
#[inline]
pub(crate) fn policy_sin_with(self, _wd: u32, mode: RoundingMode) -> Self {
self.policy_sin(mode)
}
#[inline]
pub(crate) fn policy_cos(self, mode: RoundingMode) -> Self {
Self(match forward::resolve::<8, SCALE>(&self.0) {
forward::Algorithm::Series => forward_rung::cos_strict::<crate::types::widths::wide_trig_d153::Core, SCALE, { <crate::types::widths::wide_trig_d153::Core as crate::algos::support::wide_trig_core::WideTrigCore>::GUARD }>(self.0, mode),
forward::Algorithm::Tang => {
forward_rung::cos_strict::<crate::types::widths::wide_trig_d153::Core, SCALE, 10>(self.0, mode)
}
#[allow(dead_code)]
forward::Algorithm::Schoolbook => crate::algos::trig::trig_schoolbook::cos_schoolbook::<crate::types::widths::wide_trig_d153::Core, SCALE>(self.0, mode),
})
}
#[inline]
pub(crate) fn policy_cos_with(self, _wd: u32, mode: RoundingMode) -> Self {
self.policy_cos(mode)
}
#[inline]
pub(crate) fn policy_tan(self, mode: RoundingMode) -> Self {
Self(match forward::resolve_tan::<8, SCALE>(&self.0) {
forward::Algorithm::Series => forward_rung::tan_strict::<crate::types::widths::wide_trig_d153::Core, SCALE, { <crate::types::widths::wide_trig_d153::Core as crate::algos::support::wide_trig_core::WideTrigCore>::GUARD }, true, true>(self.0, mode),
forward::Algorithm::Tang => {
forward_rung::tan_strict::<crate::types::widths::wide_trig_d153::Core, SCALE, 10, true, false>(self.0, mode)
}
#[allow(dead_code)]
forward::Algorithm::Schoolbook => crate::algos::trig::trig_schoolbook::tan_schoolbook::<crate::types::widths::wide_trig_d153::Core, SCALE>(self.0, mode),
})
}
#[inline]
pub(crate) fn policy_tan_with(self, _wd: u32, mode: RoundingMode) -> Self {
self.policy_tan(mode)
}
#[inline]
pub(crate) fn policy_atan(self, mode: RoundingMode) -> Self {
Self(match forward::resolve::<8, SCALE>(&self.0) {
forward::Algorithm::Series => forward_rung::atan_strict::<crate::types::widths::wide_trig_d153::Core, SCALE, { <crate::types::widths::wide_trig_d153::Core as crate::algos::support::wide_trig_core::WideTrigCore>::GUARD }, true>(self.0, mode),
forward::Algorithm::Tang => {
forward_rung::atan_strict::<crate::types::widths::wide_trig_d153::Core, SCALE, 12, false>(self.0, mode)
}
#[allow(dead_code)]
forward::Algorithm::Schoolbook => crate::algos::trig::trig_schoolbook::atan_schoolbook::<crate::types::widths::wide_trig_d153::Core, SCALE>(self.0, mode),
})
}
#[inline]
pub(crate) fn policy_atan_with(self, _wd: u32, mode: RoundingMode) -> Self {
self.policy_atan(mode)
}
wide_trig_inverse_inherent!(8, crate::types::widths::wide_trig_d153::Core);
#[inline]
pub(crate) fn policy_sinh(self, mode: RoundingMode) -> Self {
Self(match hyper::resolve::<8, SCALE>(&self.0) {
hyper::Algorithm::ExpIdentity => match SCALE {
70..=82 if hyper_band_in_range::<8, SCALE>(&self.0) => trig::hyper_exp_identity::sinh_exp_identity_with_tang::<crate::types::widths::wide_trig_d153::Core, SCALE, 10, 128, true>(self.0, mode),
_ => return Self(hyper_rung::sinh_strict::<crate::types::widths::wide_trig_d153::Core, SCALE>(self.0, mode)),
},
#[allow(dead_code)]
hyper::Algorithm::Schoolbook => trig::hyper_schoolbook::sinh_schoolbook::<crate::types::widths::wide_trig_d153::Core, SCALE>(self.0, mode),
})
}
#[inline]
pub(crate) fn policy_sinh_with(self, _wd: u32, mode: RoundingMode) -> Self {
self.policy_sinh(mode)
}
#[inline]
pub(crate) fn policy_cosh(self, mode: RoundingMode) -> Self {
Self(match hyper::resolve::<8, SCALE>(&self.0) {
hyper::Algorithm::ExpIdentity => match SCALE {
70..=82 if hyper_band_in_range::<8, SCALE>(&self.0) => trig::hyper_exp_identity::cosh_exp_identity_with_tang::<crate::types::widths::wide_trig_d153::Core, SCALE, 10, 128, true>(self.0, mode),
_ => return Self(hyper_rung::cosh_strict::<crate::types::widths::wide_trig_d153::Core, SCALE>(self.0, mode)),
},
#[allow(dead_code)]
hyper::Algorithm::Schoolbook => trig::hyper_schoolbook::cosh_schoolbook::<crate::types::widths::wide_trig_d153::Core, SCALE>(self.0, mode),
})
}
#[inline]
pub(crate) fn policy_cosh_with(self, _wd: u32, mode: RoundingMode) -> Self {
self.policy_cosh(mode)
}
#[inline]
pub(crate) fn policy_tanh(self, mode: RoundingMode) -> Self {
Self(match hyper::resolve::<8, SCALE>(&self.0) {
hyper::Algorithm::ExpIdentity => match SCALE {
70..=82 if hyper_band_in_range::<8, SCALE>(&self.0) => trig::hyper_exp_identity::tanh_exp_identity_with_tang::<crate::types::widths::wide_trig_d153::Core, SCALE, 10, 128, true>(self.0, mode),
_ => return Self(hyper_rung::tanh_strict::<crate::types::widths::wide_trig_d153::Core, SCALE>(self.0, mode)),
},
#[allow(dead_code)]
hyper::Algorithm::Schoolbook => trig::hyper_schoolbook::tanh_schoolbook::<crate::types::widths::wide_trig_d153::Core, SCALE>(self.0, mode),
})
}
#[inline]
pub(crate) fn policy_tanh_with(self, _wd: u32, mode: RoundingMode) -> Self {
self.policy_tanh(mode)
}
wide_trig_extra_inherent!(8, crate::types::widths::wide_trig_d153::Core);
}
#[cfg(any(feature = "d230", feature = "wide"))]
impl<const SCALE: u32> crate::D<crate::int::types::Int<12>, SCALE> {
wide_trig_forward_series!(12, crate::types::widths::wide_trig_d230::Core);
wide_trig_inverse_inherent!(12, crate::types::widths::wide_trig_d230::Core);
wide_trig_hyper_inherent!(12, crate::types::widths::wide_trig_d230::Core);
wide_trig_extra_inherent!(12, crate::types::widths::wide_trig_d230::Core);
}
#[cfg(any(feature = "d307", feature = "wide", feature = "x-wide"))]
impl<const SCALE: u32> crate::D<crate::int::types::Int<16>, SCALE> {
#[inline]
pub(crate) fn policy_sin(self, mode: RoundingMode) -> Self {
Self(match forward::resolve::<16, SCALE>(&self.0) {
forward::Algorithm::Series => forward_rung::sin_strict::<crate::types::widths::wide_trig_d307::Core, SCALE, { <crate::types::widths::wide_trig_d307::Core as crate::algos::support::wide_trig_core::WideTrigCore>::GUARD }>(self.0, mode),
forward::Algorithm::Tang => {
forward_rung::sin_strict::<crate::types::widths::wide_trig_d307::Core, SCALE, 8>(self.0, mode)
}
#[allow(dead_code)]
forward::Algorithm::Schoolbook => crate::algos::trig::trig_schoolbook::sin_schoolbook::<crate::types::widths::wide_trig_d307::Core, SCALE>(self.0, mode),
})
}
#[inline]
pub(crate) fn policy_sin_with(self, _wd: u32, mode: RoundingMode) -> Self {
self.policy_sin(mode)
}
#[inline]
pub(crate) fn policy_cos(self, mode: RoundingMode) -> Self {
Self(match forward::resolve::<16, SCALE>(&self.0) {
forward::Algorithm::Series => forward_rung::cos_strict::<crate::types::widths::wide_trig_d307::Core, SCALE, { <crate::types::widths::wide_trig_d307::Core as crate::algos::support::wide_trig_core::WideTrigCore>::GUARD }>(self.0, mode),
forward::Algorithm::Tang => {
forward_rung::cos_strict::<crate::types::widths::wide_trig_d307::Core, SCALE, 8>(self.0, mode)
}
#[allow(dead_code)]
forward::Algorithm::Schoolbook => crate::algos::trig::trig_schoolbook::cos_schoolbook::<crate::types::widths::wide_trig_d307::Core, SCALE>(self.0, mode),
})
}
#[inline]
pub(crate) fn policy_cos_with(self, _wd: u32, mode: RoundingMode) -> Self {
self.policy_cos(mode)
}
#[inline]
pub(crate) fn policy_tan(self, mode: RoundingMode) -> Self {
Self(match forward::resolve_tan::<16, SCALE>(&self.0) {
forward::Algorithm::Series => forward_rung::tan_strict::<crate::types::widths::wide_trig_d307::Core, SCALE, { <crate::types::widths::wide_trig_d307::Core as crate::algos::support::wide_trig_core::WideTrigCore>::GUARD }, true, true>(self.0, mode),
forward::Algorithm::Tang => {
forward_rung::tan_strict::<crate::types::widths::wide_trig_d307::Core, SCALE, 8, true, false>(self.0, mode)
}
#[allow(dead_code)]
forward::Algorithm::Schoolbook => crate::algos::trig::trig_schoolbook::tan_schoolbook::<crate::types::widths::wide_trig_d307::Core, SCALE>(self.0, mode),
})
}
#[inline]
pub(crate) fn policy_tan_with(self, _wd: u32, mode: RoundingMode) -> Self {
self.policy_tan(mode)
}
#[inline]
pub(crate) fn policy_atan(self, mode: RoundingMode) -> Self {
Self(match forward::resolve::<16, SCALE>(&self.0) {
forward::Algorithm::Series => forward_rung::atan_strict::<crate::types::widths::wide_trig_d307::Core, SCALE, { <crate::types::widths::wide_trig_d307::Core as crate::algos::support::wide_trig_core::WideTrigCore>::GUARD }, true>(self.0, mode),
forward::Algorithm::Tang => {
forward_rung::atan_strict::<crate::types::widths::wide_trig_d307::Core, SCALE, 10, false>(self.0, mode)
}
#[allow(dead_code)]
forward::Algorithm::Schoolbook => crate::algos::trig::trig_schoolbook::atan_schoolbook::<crate::types::widths::wide_trig_d307::Core, SCALE>(self.0, mode),
})
}
#[inline]
pub(crate) fn policy_atan_with(self, _wd: u32, mode: RoundingMode) -> Self {
self.policy_atan(mode)
}
wide_trig_inverse_inherent!(16, crate::types::widths::wide_trig_d307::Core);
#[inline]
pub(crate) fn policy_sinh(self, mode: RoundingMode) -> Self {
Self(match hyper::resolve::<16, SCALE>(&self.0) {
hyper::Algorithm::ExpIdentity => match SCALE {
140..=160 if hyper_band_in_range::<16, SCALE>(&self.0) => trig::hyper_exp_identity::sinh_exp_identity_with_tang::<crate::types::widths::wide_trig_d307::Core, SCALE, 8, 128, false>(self.0, mode),
_ => return Self(hyper_rung::sinh_strict::<crate::types::widths::wide_trig_d307::Core, SCALE>(self.0, mode)),
},
#[allow(dead_code)]
hyper::Algorithm::Schoolbook => trig::hyper_schoolbook::sinh_schoolbook::<crate::types::widths::wide_trig_d307::Core, SCALE>(self.0, mode),
})
}
#[inline]
pub(crate) fn policy_sinh_with(self, _wd: u32, mode: RoundingMode) -> Self {
self.policy_sinh(mode)
}
#[inline]
pub(crate) fn policy_cosh(self, mode: RoundingMode) -> Self {
Self(match hyper::resolve::<16, SCALE>(&self.0) {
hyper::Algorithm::ExpIdentity => match SCALE {
140..=160 if hyper_band_in_range::<16, SCALE>(&self.0) => trig::hyper_exp_identity::cosh_exp_identity_with_tang::<crate::types::widths::wide_trig_d307::Core, SCALE, 8, 128, false>(self.0, mode),
_ => return Self(hyper_rung::cosh_strict::<crate::types::widths::wide_trig_d307::Core, SCALE>(self.0, mode)),
},
#[allow(dead_code)]
hyper::Algorithm::Schoolbook => trig::hyper_schoolbook::cosh_schoolbook::<crate::types::widths::wide_trig_d307::Core, SCALE>(self.0, mode),
})
}
#[inline]
pub(crate) fn policy_cosh_with(self, _wd: u32, mode: RoundingMode) -> Self {
self.policy_cosh(mode)
}
#[inline]
pub(crate) fn policy_tanh(self, mode: RoundingMode) -> Self {
Self(match hyper::resolve::<16, SCALE>(&self.0) {
hyper::Algorithm::ExpIdentity => match SCALE {
140..=160 if hyper_band_in_range::<16, SCALE>(&self.0) => trig::hyper_exp_identity::tanh_exp_identity_with_tang::<crate::types::widths::wide_trig_d307::Core, SCALE, 8, 128, false>(self.0, mode),
_ => return Self(hyper_rung::tanh_strict::<crate::types::widths::wide_trig_d307::Core, SCALE>(self.0, mode)),
},
#[allow(dead_code)]
hyper::Algorithm::Schoolbook => trig::hyper_schoolbook::tanh_schoolbook::<crate::types::widths::wide_trig_d307::Core, SCALE>(self.0, mode),
})
}
#[inline]
pub(crate) fn policy_tanh_with(self, _wd: u32, mode: RoundingMode) -> Self {
self.policy_tanh(mode)
}
wide_trig_extra_inherent!(16, crate::types::widths::wide_trig_d307::Core);
}
#[cfg(any(feature = "d462", feature = "x-wide"))]
impl<const SCALE: u32> crate::D<crate::int::types::Int<24>, SCALE> {
#[inline]
pub(crate) fn policy_sin(self, mode: RoundingMode) -> Self {
Self(match forward::resolve::<24, SCALE>(&self.0) {
forward::Algorithm::Series => forward_rung::sin_strict::<crate::types::widths::wide_trig_d462::Core, SCALE, { <crate::types::widths::wide_trig_d462::Core as crate::algos::support::wide_trig_core::WideTrigCore>::GUARD }>(self.0, mode),
forward::Algorithm::Tang => {
forward_rung::sin_strict::<crate::types::widths::wide_trig_d462::Core, SCALE, 10>(self.0, mode)
}
#[allow(dead_code)]
forward::Algorithm::Schoolbook => crate::algos::trig::trig_schoolbook::sin_schoolbook::<crate::types::widths::wide_trig_d462::Core, SCALE>(self.0, mode),
})
}
#[inline]
pub(crate) fn policy_sin_with(self, _wd: u32, mode: RoundingMode) -> Self {
self.policy_sin(mode)
}
#[inline]
pub(crate) fn policy_cos(self, mode: RoundingMode) -> Self {
Self(match forward::resolve::<24, SCALE>(&self.0) {
forward::Algorithm::Series => forward_rung::cos_strict::<crate::types::widths::wide_trig_d462::Core, SCALE, { <crate::types::widths::wide_trig_d462::Core as crate::algos::support::wide_trig_core::WideTrigCore>::GUARD }>(self.0, mode),
forward::Algorithm::Tang => {
forward_rung::cos_strict::<crate::types::widths::wide_trig_d462::Core, SCALE, 10>(self.0, mode)
}
#[allow(dead_code)]
forward::Algorithm::Schoolbook => crate::algos::trig::trig_schoolbook::cos_schoolbook::<crate::types::widths::wide_trig_d462::Core, SCALE>(self.0, mode),
})
}
#[inline]
pub(crate) fn policy_cos_with(self, _wd: u32, mode: RoundingMode) -> Self {
self.policy_cos(mode)
}
#[inline]
pub(crate) fn policy_tan(self, mode: RoundingMode) -> Self {
Self(match forward::resolve_tan::<24, SCALE>(&self.0) {
forward::Algorithm::Series => forward_rung::tan_strict::<crate::types::widths::wide_trig_d462::Core, SCALE, { <crate::types::widths::wide_trig_d462::Core as crate::algos::support::wide_trig_core::WideTrigCore>::GUARD }, true, true>(self.0, mode),
forward::Algorithm::Tang => {
forward_rung::tan_strict::<crate::types::widths::wide_trig_d462::Core, SCALE, 10, false, false>(self.0, mode)
}
#[allow(dead_code)]
forward::Algorithm::Schoolbook => crate::algos::trig::trig_schoolbook::tan_schoolbook::<crate::types::widths::wide_trig_d462::Core, SCALE>(self.0, mode),
})
}
#[inline]
pub(crate) fn policy_tan_with(self, _wd: u32, mode: RoundingMode) -> Self {
self.policy_tan(mode)
}
#[inline]
pub(crate) fn policy_atan(self, mode: RoundingMode) -> Self {
Self(match forward::resolve::<24, SCALE>(&self.0) {
forward::Algorithm::Series => forward_rung::atan_strict::<crate::types::widths::wide_trig_d462::Core, SCALE, { <crate::types::widths::wide_trig_d462::Core as crate::algos::support::wide_trig_core::WideTrigCore>::GUARD }, true>(self.0, mode),
forward::Algorithm::Tang => {
forward_rung::atan_strict::<crate::types::widths::wide_trig_d462::Core, SCALE, 12, false>(self.0, mode)
}
#[allow(dead_code)]
forward::Algorithm::Schoolbook => crate::algos::trig::trig_schoolbook::atan_schoolbook::<crate::types::widths::wide_trig_d462::Core, SCALE>(self.0, mode),
})
}
#[inline]
pub(crate) fn policy_atan_with(self, _wd: u32, mode: RoundingMode) -> Self {
self.policy_atan(mode)
}
wide_trig_inverse_inherent!(24, crate::types::widths::wide_trig_d462::Core);
wide_trig_hyper_inherent!(24, crate::types::widths::wide_trig_d462::Core);
wide_trig_extra_inherent!(24, crate::types::widths::wide_trig_d462::Core);
}
#[cfg(any(feature = "d616", feature = "x-wide"))]
impl<const SCALE: u32> crate::D<crate::int::types::Int<32>, SCALE> {
wide_trig_forward_series!(32, crate::types::widths::wide_trig_d616::Core);
wide_trig_inverse_inherent!(32, crate::types::widths::wide_trig_d616::Core);
wide_trig_hyper_inherent!(32, crate::types::widths::wide_trig_d616::Core);
wide_trig_extra_inherent!(32, crate::types::widths::wide_trig_d616::Core);
}
#[cfg(any(feature = "d924", feature = "xx-wide"))]
impl<const SCALE: u32> crate::D<crate::int::types::Int<48>, SCALE> {
wide_trig_forward_series!(48, crate::types::widths::wide_trig_d924::Core);
wide_trig_inverse_inherent!(48, crate::types::widths::wide_trig_d924::Core);
wide_trig_hyper_inherent!(48, crate::types::widths::wide_trig_d924::Core);
wide_trig_extra_inherent!(48, crate::types::widths::wide_trig_d924::Core);
}
#[cfg(any(feature = "d1232", feature = "xx-wide"))]
impl<const SCALE: u32> crate::D<crate::int::types::Int<64>, SCALE> {
wide_trig_forward_series!(64, crate::types::widths::wide_trig_d1232::Core);
wide_trig_inverse_inherent!(64, crate::types::widths::wide_trig_d1232::Core);
wide_trig_hyper_inherent!(64, crate::types::widths::wide_trig_d1232::Core);
wide_trig_extra_inherent!(64, crate::types::widths::wide_trig_d1232::Core);
}
use crate::int::types::traits::BigInt as _;
use crate::int::types::Int;
#[inline]
#[must_use]
pub(crate) fn sin_dispatch<const N: usize, const SCALE: u32>(raw: Int<N>, mode: RoundingMode) -> Int<N> {
match N {
1 => crate::D::<crate::int::types::Int<1>, SCALE>(raw.resize_to::<crate::int::types::Int<1>>()).policy_sin(mode).0.resize_to::<Int<N>>(),
2 => crate::D::<crate::int::types::Int<2>, SCALE>(raw.resize_to::<crate::int::types::Int<2>>()).policy_sin(mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d57", feature = "wide"))]
3 => crate::D::<crate::int::types::Int<3>, SCALE>(raw.resize_to::<crate::int::types::Int<3>>()).policy_sin(mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d76", feature = "wide"))]
4 => crate::D::<crate::int::types::Int<4>, SCALE>(raw.resize_to::<crate::int::types::Int<4>>()).policy_sin(mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d115", feature = "wide"))]
6 => crate::D::<crate::int::types::Int<6>, SCALE>(raw.resize_to::<crate::int::types::Int<6>>()).policy_sin(mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d153", feature = "wide"))]
8 => crate::D::<crate::int::types::Int<8>, SCALE>(raw.resize_to::<crate::int::types::Int<8>>()).policy_sin(mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d230", feature = "wide"))]
12 => crate::D::<crate::int::types::Int<12>, SCALE>(raw.resize_to::<crate::int::types::Int<12>>()).policy_sin(mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d307", feature = "wide", feature = "x-wide"))]
16 => crate::D::<crate::int::types::Int<16>, SCALE>(raw.resize_to::<crate::int::types::Int<16>>()).policy_sin(mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d462", feature = "x-wide"))]
24 => crate::D::<crate::int::types::Int<24>, SCALE>(raw.resize_to::<crate::int::types::Int<24>>()).policy_sin(mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d616", feature = "x-wide"))]
32 => crate::D::<crate::int::types::Int<32>, SCALE>(raw.resize_to::<crate::int::types::Int<32>>()).policy_sin(mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d924", feature = "xx-wide"))]
48 => crate::D::<crate::int::types::Int<48>, SCALE>(raw.resize_to::<crate::int::types::Int<48>>()).policy_sin(mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d1232", feature = "xx-wide"))]
64 => crate::D::<crate::int::types::Int<64>, SCALE>(raw.resize_to::<crate::int::types::Int<64>>()).policy_sin(mode).0.resize_to::<Int<N>>(),
_ => crate::D::<crate::int::types::Int<2>, SCALE>(raw.resize_to::<crate::int::types::Int<2>>()).policy_sin(mode).0.resize_to::<Int<N>>(),
}
}
#[inline]
#[must_use]
pub(crate) fn sin_dispatch_with<const N: usize, const SCALE: u32>(raw: Int<N>, wd: u32, mode: RoundingMode) -> Int<N> {
match N {
1 => crate::D::<crate::int::types::Int<1>, SCALE>(raw.resize_to::<crate::int::types::Int<1>>()).policy_sin_with(wd, mode).0.resize_to::<Int<N>>(),
2 => crate::D::<crate::int::types::Int<2>, SCALE>(raw.resize_to::<crate::int::types::Int<2>>()).policy_sin_with(wd, mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d57", feature = "wide"))]
3 => crate::D::<crate::int::types::Int<3>, SCALE>(raw.resize_to::<crate::int::types::Int<3>>()).policy_sin_with(wd, mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d76", feature = "wide"))]
4 => crate::D::<crate::int::types::Int<4>, SCALE>(raw.resize_to::<crate::int::types::Int<4>>()).policy_sin_with(wd, mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d115", feature = "wide"))]
6 => crate::D::<crate::int::types::Int<6>, SCALE>(raw.resize_to::<crate::int::types::Int<6>>()).policy_sin_with(wd, mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d153", feature = "wide"))]
8 => crate::D::<crate::int::types::Int<8>, SCALE>(raw.resize_to::<crate::int::types::Int<8>>()).policy_sin_with(wd, mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d230", feature = "wide"))]
12 => crate::D::<crate::int::types::Int<12>, SCALE>(raw.resize_to::<crate::int::types::Int<12>>()).policy_sin_with(wd, mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d307", feature = "wide", feature = "x-wide"))]
16 => crate::D::<crate::int::types::Int<16>, SCALE>(raw.resize_to::<crate::int::types::Int<16>>()).policy_sin_with(wd, mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d462", feature = "x-wide"))]
24 => crate::D::<crate::int::types::Int<24>, SCALE>(raw.resize_to::<crate::int::types::Int<24>>()).policy_sin_with(wd, mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d616", feature = "x-wide"))]
32 => crate::D::<crate::int::types::Int<32>, SCALE>(raw.resize_to::<crate::int::types::Int<32>>()).policy_sin_with(wd, mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d924", feature = "xx-wide"))]
48 => crate::D::<crate::int::types::Int<48>, SCALE>(raw.resize_to::<crate::int::types::Int<48>>()).policy_sin_with(wd, mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d1232", feature = "xx-wide"))]
64 => crate::D::<crate::int::types::Int<64>, SCALE>(raw.resize_to::<crate::int::types::Int<64>>()).policy_sin_with(wd, mode).0.resize_to::<Int<N>>(),
_ => crate::D::<crate::int::types::Int<2>, SCALE>(raw.resize_to::<crate::int::types::Int<2>>()).policy_sin_with(wd, mode).0.resize_to::<Int<N>>(),
}
}
#[inline]
#[must_use]
pub(crate) fn cos_dispatch<const N: usize, const SCALE: u32>(raw: Int<N>, mode: RoundingMode) -> Int<N> {
match N {
1 => crate::D::<crate::int::types::Int<1>, SCALE>(raw.resize_to::<crate::int::types::Int<1>>()).policy_cos(mode).0.resize_to::<Int<N>>(),
2 => crate::D::<crate::int::types::Int<2>, SCALE>(raw.resize_to::<crate::int::types::Int<2>>()).policy_cos(mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d57", feature = "wide"))]
3 => crate::D::<crate::int::types::Int<3>, SCALE>(raw.resize_to::<crate::int::types::Int<3>>()).policy_cos(mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d76", feature = "wide"))]
4 => crate::D::<crate::int::types::Int<4>, SCALE>(raw.resize_to::<crate::int::types::Int<4>>()).policy_cos(mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d115", feature = "wide"))]
6 => crate::D::<crate::int::types::Int<6>, SCALE>(raw.resize_to::<crate::int::types::Int<6>>()).policy_cos(mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d153", feature = "wide"))]
8 => crate::D::<crate::int::types::Int<8>, SCALE>(raw.resize_to::<crate::int::types::Int<8>>()).policy_cos(mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d230", feature = "wide"))]
12 => crate::D::<crate::int::types::Int<12>, SCALE>(raw.resize_to::<crate::int::types::Int<12>>()).policy_cos(mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d307", feature = "wide", feature = "x-wide"))]
16 => crate::D::<crate::int::types::Int<16>, SCALE>(raw.resize_to::<crate::int::types::Int<16>>()).policy_cos(mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d462", feature = "x-wide"))]
24 => crate::D::<crate::int::types::Int<24>, SCALE>(raw.resize_to::<crate::int::types::Int<24>>()).policy_cos(mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d616", feature = "x-wide"))]
32 => crate::D::<crate::int::types::Int<32>, SCALE>(raw.resize_to::<crate::int::types::Int<32>>()).policy_cos(mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d924", feature = "xx-wide"))]
48 => crate::D::<crate::int::types::Int<48>, SCALE>(raw.resize_to::<crate::int::types::Int<48>>()).policy_cos(mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d1232", feature = "xx-wide"))]
64 => crate::D::<crate::int::types::Int<64>, SCALE>(raw.resize_to::<crate::int::types::Int<64>>()).policy_cos(mode).0.resize_to::<Int<N>>(),
_ => crate::D::<crate::int::types::Int<2>, SCALE>(raw.resize_to::<crate::int::types::Int<2>>()).policy_cos(mode).0.resize_to::<Int<N>>(),
}
}
#[inline]
#[must_use]
pub(crate) fn cos_dispatch_with<const N: usize, const SCALE: u32>(raw: Int<N>, wd: u32, mode: RoundingMode) -> Int<N> {
match N {
1 => crate::D::<crate::int::types::Int<1>, SCALE>(raw.resize_to::<crate::int::types::Int<1>>()).policy_cos_with(wd, mode).0.resize_to::<Int<N>>(),
2 => crate::D::<crate::int::types::Int<2>, SCALE>(raw.resize_to::<crate::int::types::Int<2>>()).policy_cos_with(wd, mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d57", feature = "wide"))]
3 => crate::D::<crate::int::types::Int<3>, SCALE>(raw.resize_to::<crate::int::types::Int<3>>()).policy_cos_with(wd, mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d76", feature = "wide"))]
4 => crate::D::<crate::int::types::Int<4>, SCALE>(raw.resize_to::<crate::int::types::Int<4>>()).policy_cos_with(wd, mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d115", feature = "wide"))]
6 => crate::D::<crate::int::types::Int<6>, SCALE>(raw.resize_to::<crate::int::types::Int<6>>()).policy_cos_with(wd, mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d153", feature = "wide"))]
8 => crate::D::<crate::int::types::Int<8>, SCALE>(raw.resize_to::<crate::int::types::Int<8>>()).policy_cos_with(wd, mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d230", feature = "wide"))]
12 => crate::D::<crate::int::types::Int<12>, SCALE>(raw.resize_to::<crate::int::types::Int<12>>()).policy_cos_with(wd, mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d307", feature = "wide", feature = "x-wide"))]
16 => crate::D::<crate::int::types::Int<16>, SCALE>(raw.resize_to::<crate::int::types::Int<16>>()).policy_cos_with(wd, mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d462", feature = "x-wide"))]
24 => crate::D::<crate::int::types::Int<24>, SCALE>(raw.resize_to::<crate::int::types::Int<24>>()).policy_cos_with(wd, mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d616", feature = "x-wide"))]
32 => crate::D::<crate::int::types::Int<32>, SCALE>(raw.resize_to::<crate::int::types::Int<32>>()).policy_cos_with(wd, mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d924", feature = "xx-wide"))]
48 => crate::D::<crate::int::types::Int<48>, SCALE>(raw.resize_to::<crate::int::types::Int<48>>()).policy_cos_with(wd, mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d1232", feature = "xx-wide"))]
64 => crate::D::<crate::int::types::Int<64>, SCALE>(raw.resize_to::<crate::int::types::Int<64>>()).policy_cos_with(wd, mode).0.resize_to::<Int<N>>(),
_ => crate::D::<crate::int::types::Int<2>, SCALE>(raw.resize_to::<crate::int::types::Int<2>>()).policy_cos_with(wd, mode).0.resize_to::<Int<N>>(),
}
}
#[inline]
#[must_use]
pub(crate) fn tan_dispatch<const N: usize, const SCALE: u32>(raw: Int<N>, mode: RoundingMode) -> Int<N> {
match N {
1 => crate::D::<crate::int::types::Int<1>, SCALE>(raw.resize_to::<crate::int::types::Int<1>>()).policy_tan(mode).0.resize_to::<Int<N>>(),
2 => crate::D::<crate::int::types::Int<2>, SCALE>(raw.resize_to::<crate::int::types::Int<2>>()).policy_tan(mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d57", feature = "wide"))]
3 => crate::D::<crate::int::types::Int<3>, SCALE>(raw.resize_to::<crate::int::types::Int<3>>()).policy_tan(mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d76", feature = "wide"))]
4 => crate::D::<crate::int::types::Int<4>, SCALE>(raw.resize_to::<crate::int::types::Int<4>>()).policy_tan(mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d115", feature = "wide"))]
6 => crate::D::<crate::int::types::Int<6>, SCALE>(raw.resize_to::<crate::int::types::Int<6>>()).policy_tan(mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d153", feature = "wide"))]
8 => crate::D::<crate::int::types::Int<8>, SCALE>(raw.resize_to::<crate::int::types::Int<8>>()).policy_tan(mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d230", feature = "wide"))]
12 => crate::D::<crate::int::types::Int<12>, SCALE>(raw.resize_to::<crate::int::types::Int<12>>()).policy_tan(mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d307", feature = "wide", feature = "x-wide"))]
16 => crate::D::<crate::int::types::Int<16>, SCALE>(raw.resize_to::<crate::int::types::Int<16>>()).policy_tan(mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d462", feature = "x-wide"))]
24 => crate::D::<crate::int::types::Int<24>, SCALE>(raw.resize_to::<crate::int::types::Int<24>>()).policy_tan(mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d616", feature = "x-wide"))]
32 => crate::D::<crate::int::types::Int<32>, SCALE>(raw.resize_to::<crate::int::types::Int<32>>()).policy_tan(mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d924", feature = "xx-wide"))]
48 => crate::D::<crate::int::types::Int<48>, SCALE>(raw.resize_to::<crate::int::types::Int<48>>()).policy_tan(mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d1232", feature = "xx-wide"))]
64 => crate::D::<crate::int::types::Int<64>, SCALE>(raw.resize_to::<crate::int::types::Int<64>>()).policy_tan(mode).0.resize_to::<Int<N>>(),
_ => crate::D::<crate::int::types::Int<2>, SCALE>(raw.resize_to::<crate::int::types::Int<2>>()).policy_tan(mode).0.resize_to::<Int<N>>(),
}
}
#[inline]
#[must_use]
pub(crate) fn tan_dispatch_with<const N: usize, const SCALE: u32>(raw: Int<N>, wd: u32, mode: RoundingMode) -> Int<N> {
match N {
1 => crate::D::<crate::int::types::Int<1>, SCALE>(raw.resize_to::<crate::int::types::Int<1>>()).policy_tan_with(wd, mode).0.resize_to::<Int<N>>(),
2 => crate::D::<crate::int::types::Int<2>, SCALE>(raw.resize_to::<crate::int::types::Int<2>>()).policy_tan_with(wd, mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d57", feature = "wide"))]
3 => crate::D::<crate::int::types::Int<3>, SCALE>(raw.resize_to::<crate::int::types::Int<3>>()).policy_tan_with(wd, mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d76", feature = "wide"))]
4 => crate::D::<crate::int::types::Int<4>, SCALE>(raw.resize_to::<crate::int::types::Int<4>>()).policy_tan_with(wd, mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d115", feature = "wide"))]
6 => crate::D::<crate::int::types::Int<6>, SCALE>(raw.resize_to::<crate::int::types::Int<6>>()).policy_tan_with(wd, mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d153", feature = "wide"))]
8 => crate::D::<crate::int::types::Int<8>, SCALE>(raw.resize_to::<crate::int::types::Int<8>>()).policy_tan_with(wd, mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d230", feature = "wide"))]
12 => crate::D::<crate::int::types::Int<12>, SCALE>(raw.resize_to::<crate::int::types::Int<12>>()).policy_tan_with(wd, mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d307", feature = "wide", feature = "x-wide"))]
16 => crate::D::<crate::int::types::Int<16>, SCALE>(raw.resize_to::<crate::int::types::Int<16>>()).policy_tan_with(wd, mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d462", feature = "x-wide"))]
24 => crate::D::<crate::int::types::Int<24>, SCALE>(raw.resize_to::<crate::int::types::Int<24>>()).policy_tan_with(wd, mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d616", feature = "x-wide"))]
32 => crate::D::<crate::int::types::Int<32>, SCALE>(raw.resize_to::<crate::int::types::Int<32>>()).policy_tan_with(wd, mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d924", feature = "xx-wide"))]
48 => crate::D::<crate::int::types::Int<48>, SCALE>(raw.resize_to::<crate::int::types::Int<48>>()).policy_tan_with(wd, mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d1232", feature = "xx-wide"))]
64 => crate::D::<crate::int::types::Int<64>, SCALE>(raw.resize_to::<crate::int::types::Int<64>>()).policy_tan_with(wd, mode).0.resize_to::<Int<N>>(),
_ => crate::D::<crate::int::types::Int<2>, SCALE>(raw.resize_to::<crate::int::types::Int<2>>()).policy_tan_with(wd, mode).0.resize_to::<Int<N>>(),
}
}
#[inline]
#[must_use]
pub(crate) fn atan_dispatch<const N: usize, const SCALE: u32>(raw: Int<N>, mode: RoundingMode) -> Int<N> {
match N {
1 => crate::D::<crate::int::types::Int<1>, SCALE>(raw.resize_to::<crate::int::types::Int<1>>()).policy_atan(mode).0.resize_to::<Int<N>>(),
2 => crate::D::<crate::int::types::Int<2>, SCALE>(raw.resize_to::<crate::int::types::Int<2>>()).policy_atan(mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d57", feature = "wide"))]
3 => crate::D::<crate::int::types::Int<3>, SCALE>(raw.resize_to::<crate::int::types::Int<3>>()).policy_atan(mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d76", feature = "wide"))]
4 => crate::D::<crate::int::types::Int<4>, SCALE>(raw.resize_to::<crate::int::types::Int<4>>()).policy_atan(mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d115", feature = "wide"))]
6 => crate::D::<crate::int::types::Int<6>, SCALE>(raw.resize_to::<crate::int::types::Int<6>>()).policy_atan(mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d153", feature = "wide"))]
8 => crate::D::<crate::int::types::Int<8>, SCALE>(raw.resize_to::<crate::int::types::Int<8>>()).policy_atan(mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d230", feature = "wide"))]
12 => crate::D::<crate::int::types::Int<12>, SCALE>(raw.resize_to::<crate::int::types::Int<12>>()).policy_atan(mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d307", feature = "wide", feature = "x-wide"))]
16 => crate::D::<crate::int::types::Int<16>, SCALE>(raw.resize_to::<crate::int::types::Int<16>>()).policy_atan(mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d462", feature = "x-wide"))]
24 => crate::D::<crate::int::types::Int<24>, SCALE>(raw.resize_to::<crate::int::types::Int<24>>()).policy_atan(mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d616", feature = "x-wide"))]
32 => crate::D::<crate::int::types::Int<32>, SCALE>(raw.resize_to::<crate::int::types::Int<32>>()).policy_atan(mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d924", feature = "xx-wide"))]
48 => crate::D::<crate::int::types::Int<48>, SCALE>(raw.resize_to::<crate::int::types::Int<48>>()).policy_atan(mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d1232", feature = "xx-wide"))]
64 => crate::D::<crate::int::types::Int<64>, SCALE>(raw.resize_to::<crate::int::types::Int<64>>()).policy_atan(mode).0.resize_to::<Int<N>>(),
_ => crate::D::<crate::int::types::Int<2>, SCALE>(raw.resize_to::<crate::int::types::Int<2>>()).policy_atan(mode).0.resize_to::<Int<N>>(),
}
}
#[inline]
#[must_use]
pub(crate) fn atan_dispatch_with<const N: usize, const SCALE: u32>(raw: Int<N>, wd: u32, mode: RoundingMode) -> Int<N> {
match N {
1 => crate::D::<crate::int::types::Int<1>, SCALE>(raw.resize_to::<crate::int::types::Int<1>>()).policy_atan_with(wd, mode).0.resize_to::<Int<N>>(),
2 => crate::D::<crate::int::types::Int<2>, SCALE>(raw.resize_to::<crate::int::types::Int<2>>()).policy_atan_with(wd, mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d57", feature = "wide"))]
3 => crate::D::<crate::int::types::Int<3>, SCALE>(raw.resize_to::<crate::int::types::Int<3>>()).policy_atan_with(wd, mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d76", feature = "wide"))]
4 => crate::D::<crate::int::types::Int<4>, SCALE>(raw.resize_to::<crate::int::types::Int<4>>()).policy_atan_with(wd, mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d115", feature = "wide"))]
6 => crate::D::<crate::int::types::Int<6>, SCALE>(raw.resize_to::<crate::int::types::Int<6>>()).policy_atan_with(wd, mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d153", feature = "wide"))]
8 => crate::D::<crate::int::types::Int<8>, SCALE>(raw.resize_to::<crate::int::types::Int<8>>()).policy_atan_with(wd, mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d230", feature = "wide"))]
12 => crate::D::<crate::int::types::Int<12>, SCALE>(raw.resize_to::<crate::int::types::Int<12>>()).policy_atan_with(wd, mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d307", feature = "wide", feature = "x-wide"))]
16 => crate::D::<crate::int::types::Int<16>, SCALE>(raw.resize_to::<crate::int::types::Int<16>>()).policy_atan_with(wd, mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d462", feature = "x-wide"))]
24 => crate::D::<crate::int::types::Int<24>, SCALE>(raw.resize_to::<crate::int::types::Int<24>>()).policy_atan_with(wd, mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d616", feature = "x-wide"))]
32 => crate::D::<crate::int::types::Int<32>, SCALE>(raw.resize_to::<crate::int::types::Int<32>>()).policy_atan_with(wd, mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d924", feature = "xx-wide"))]
48 => crate::D::<crate::int::types::Int<48>, SCALE>(raw.resize_to::<crate::int::types::Int<48>>()).policy_atan_with(wd, mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d1232", feature = "xx-wide"))]
64 => crate::D::<crate::int::types::Int<64>, SCALE>(raw.resize_to::<crate::int::types::Int<64>>()).policy_atan_with(wd, mode).0.resize_to::<Int<N>>(),
_ => crate::D::<crate::int::types::Int<2>, SCALE>(raw.resize_to::<crate::int::types::Int<2>>()).policy_atan_with(wd, mode).0.resize_to::<Int<N>>(),
}
}
#[inline]
#[must_use]
pub(crate) fn asin_dispatch<const N: usize, const SCALE: u32>(raw: Int<N>, mode: RoundingMode) -> Int<N> {
match N {
1 => crate::D::<crate::int::types::Int<1>, SCALE>(raw.resize_to::<crate::int::types::Int<1>>()).policy_asin(mode).0.resize_to::<Int<N>>(),
2 => crate::D::<crate::int::types::Int<2>, SCALE>(raw.resize_to::<crate::int::types::Int<2>>()).policy_asin(mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d57", feature = "wide"))]
3 => crate::D::<crate::int::types::Int<3>, SCALE>(raw.resize_to::<crate::int::types::Int<3>>()).policy_asin(mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d76", feature = "wide"))]
4 => crate::D::<crate::int::types::Int<4>, SCALE>(raw.resize_to::<crate::int::types::Int<4>>()).policy_asin(mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d115", feature = "wide"))]
6 => crate::D::<crate::int::types::Int<6>, SCALE>(raw.resize_to::<crate::int::types::Int<6>>()).policy_asin(mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d153", feature = "wide"))]
8 => crate::D::<crate::int::types::Int<8>, SCALE>(raw.resize_to::<crate::int::types::Int<8>>()).policy_asin(mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d230", feature = "wide"))]
12 => crate::D::<crate::int::types::Int<12>, SCALE>(raw.resize_to::<crate::int::types::Int<12>>()).policy_asin(mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d307", feature = "wide", feature = "x-wide"))]
16 => crate::D::<crate::int::types::Int<16>, SCALE>(raw.resize_to::<crate::int::types::Int<16>>()).policy_asin(mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d462", feature = "x-wide"))]
24 => crate::D::<crate::int::types::Int<24>, SCALE>(raw.resize_to::<crate::int::types::Int<24>>()).policy_asin(mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d616", feature = "x-wide"))]
32 => crate::D::<crate::int::types::Int<32>, SCALE>(raw.resize_to::<crate::int::types::Int<32>>()).policy_asin(mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d924", feature = "xx-wide"))]
48 => crate::D::<crate::int::types::Int<48>, SCALE>(raw.resize_to::<crate::int::types::Int<48>>()).policy_asin(mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d1232", feature = "xx-wide"))]
64 => crate::D::<crate::int::types::Int<64>, SCALE>(raw.resize_to::<crate::int::types::Int<64>>()).policy_asin(mode).0.resize_to::<Int<N>>(),
_ => crate::D::<crate::int::types::Int<2>, SCALE>(raw.resize_to::<crate::int::types::Int<2>>()).policy_asin(mode).0.resize_to::<Int<N>>(),
}
}
#[inline]
#[must_use]
pub(crate) fn asin_dispatch_with<const N: usize, const SCALE: u32>(raw: Int<N>, wd: u32, mode: RoundingMode) -> Int<N> {
match N {
1 => crate::D::<crate::int::types::Int<1>, SCALE>(raw.resize_to::<crate::int::types::Int<1>>()).policy_asin_with(wd, mode).0.resize_to::<Int<N>>(),
2 => crate::D::<crate::int::types::Int<2>, SCALE>(raw.resize_to::<crate::int::types::Int<2>>()).policy_asin_with(wd, mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d57", feature = "wide"))]
3 => crate::D::<crate::int::types::Int<3>, SCALE>(raw.resize_to::<crate::int::types::Int<3>>()).policy_asin_with(wd, mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d76", feature = "wide"))]
4 => crate::D::<crate::int::types::Int<4>, SCALE>(raw.resize_to::<crate::int::types::Int<4>>()).policy_asin_with(wd, mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d115", feature = "wide"))]
6 => crate::D::<crate::int::types::Int<6>, SCALE>(raw.resize_to::<crate::int::types::Int<6>>()).policy_asin_with(wd, mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d153", feature = "wide"))]
8 => crate::D::<crate::int::types::Int<8>, SCALE>(raw.resize_to::<crate::int::types::Int<8>>()).policy_asin_with(wd, mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d230", feature = "wide"))]
12 => crate::D::<crate::int::types::Int<12>, SCALE>(raw.resize_to::<crate::int::types::Int<12>>()).policy_asin_with(wd, mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d307", feature = "wide", feature = "x-wide"))]
16 => crate::D::<crate::int::types::Int<16>, SCALE>(raw.resize_to::<crate::int::types::Int<16>>()).policy_asin_with(wd, mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d462", feature = "x-wide"))]
24 => crate::D::<crate::int::types::Int<24>, SCALE>(raw.resize_to::<crate::int::types::Int<24>>()).policy_asin_with(wd, mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d616", feature = "x-wide"))]
32 => crate::D::<crate::int::types::Int<32>, SCALE>(raw.resize_to::<crate::int::types::Int<32>>()).policy_asin_with(wd, mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d924", feature = "xx-wide"))]
48 => crate::D::<crate::int::types::Int<48>, SCALE>(raw.resize_to::<crate::int::types::Int<48>>()).policy_asin_with(wd, mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d1232", feature = "xx-wide"))]
64 => crate::D::<crate::int::types::Int<64>, SCALE>(raw.resize_to::<crate::int::types::Int<64>>()).policy_asin_with(wd, mode).0.resize_to::<Int<N>>(),
_ => crate::D::<crate::int::types::Int<2>, SCALE>(raw.resize_to::<crate::int::types::Int<2>>()).policy_asin_with(wd, mode).0.resize_to::<Int<N>>(),
}
}
#[inline]
#[must_use]
pub(crate) fn acos_dispatch<const N: usize, const SCALE: u32>(raw: Int<N>, mode: RoundingMode) -> Int<N> {
match N {
1 => crate::D::<crate::int::types::Int<1>, SCALE>(raw.resize_to::<crate::int::types::Int<1>>()).policy_acos(mode).0.resize_to::<Int<N>>(),
2 => crate::D::<crate::int::types::Int<2>, SCALE>(raw.resize_to::<crate::int::types::Int<2>>()).policy_acos(mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d57", feature = "wide"))]
3 => crate::D::<crate::int::types::Int<3>, SCALE>(raw.resize_to::<crate::int::types::Int<3>>()).policy_acos(mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d76", feature = "wide"))]
4 => crate::D::<crate::int::types::Int<4>, SCALE>(raw.resize_to::<crate::int::types::Int<4>>()).policy_acos(mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d115", feature = "wide"))]
6 => crate::D::<crate::int::types::Int<6>, SCALE>(raw.resize_to::<crate::int::types::Int<6>>()).policy_acos(mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d153", feature = "wide"))]
8 => crate::D::<crate::int::types::Int<8>, SCALE>(raw.resize_to::<crate::int::types::Int<8>>()).policy_acos(mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d230", feature = "wide"))]
12 => crate::D::<crate::int::types::Int<12>, SCALE>(raw.resize_to::<crate::int::types::Int<12>>()).policy_acos(mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d307", feature = "wide", feature = "x-wide"))]
16 => crate::D::<crate::int::types::Int<16>, SCALE>(raw.resize_to::<crate::int::types::Int<16>>()).policy_acos(mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d462", feature = "x-wide"))]
24 => crate::D::<crate::int::types::Int<24>, SCALE>(raw.resize_to::<crate::int::types::Int<24>>()).policy_acos(mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d616", feature = "x-wide"))]
32 => crate::D::<crate::int::types::Int<32>, SCALE>(raw.resize_to::<crate::int::types::Int<32>>()).policy_acos(mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d924", feature = "xx-wide"))]
48 => crate::D::<crate::int::types::Int<48>, SCALE>(raw.resize_to::<crate::int::types::Int<48>>()).policy_acos(mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d1232", feature = "xx-wide"))]
64 => crate::D::<crate::int::types::Int<64>, SCALE>(raw.resize_to::<crate::int::types::Int<64>>()).policy_acos(mode).0.resize_to::<Int<N>>(),
_ => crate::D::<crate::int::types::Int<2>, SCALE>(raw.resize_to::<crate::int::types::Int<2>>()).policy_acos(mode).0.resize_to::<Int<N>>(),
}
}
#[inline]
#[must_use]
pub(crate) fn acos_dispatch_with<const N: usize, const SCALE: u32>(raw: Int<N>, wd: u32, mode: RoundingMode) -> Int<N> {
match N {
1 => crate::D::<crate::int::types::Int<1>, SCALE>(raw.resize_to::<crate::int::types::Int<1>>()).policy_acos_with(wd, mode).0.resize_to::<Int<N>>(),
2 => crate::D::<crate::int::types::Int<2>, SCALE>(raw.resize_to::<crate::int::types::Int<2>>()).policy_acos_with(wd, mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d57", feature = "wide"))]
3 => crate::D::<crate::int::types::Int<3>, SCALE>(raw.resize_to::<crate::int::types::Int<3>>()).policy_acos_with(wd, mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d76", feature = "wide"))]
4 => crate::D::<crate::int::types::Int<4>, SCALE>(raw.resize_to::<crate::int::types::Int<4>>()).policy_acos_with(wd, mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d115", feature = "wide"))]
6 => crate::D::<crate::int::types::Int<6>, SCALE>(raw.resize_to::<crate::int::types::Int<6>>()).policy_acos_with(wd, mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d153", feature = "wide"))]
8 => crate::D::<crate::int::types::Int<8>, SCALE>(raw.resize_to::<crate::int::types::Int<8>>()).policy_acos_with(wd, mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d230", feature = "wide"))]
12 => crate::D::<crate::int::types::Int<12>, SCALE>(raw.resize_to::<crate::int::types::Int<12>>()).policy_acos_with(wd, mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d307", feature = "wide", feature = "x-wide"))]
16 => crate::D::<crate::int::types::Int<16>, SCALE>(raw.resize_to::<crate::int::types::Int<16>>()).policy_acos_with(wd, mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d462", feature = "x-wide"))]
24 => crate::D::<crate::int::types::Int<24>, SCALE>(raw.resize_to::<crate::int::types::Int<24>>()).policy_acos_with(wd, mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d616", feature = "x-wide"))]
32 => crate::D::<crate::int::types::Int<32>, SCALE>(raw.resize_to::<crate::int::types::Int<32>>()).policy_acos_with(wd, mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d924", feature = "xx-wide"))]
48 => crate::D::<crate::int::types::Int<48>, SCALE>(raw.resize_to::<crate::int::types::Int<48>>()).policy_acos_with(wd, mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d1232", feature = "xx-wide"))]
64 => crate::D::<crate::int::types::Int<64>, SCALE>(raw.resize_to::<crate::int::types::Int<64>>()).policy_acos_with(wd, mode).0.resize_to::<Int<N>>(),
_ => crate::D::<crate::int::types::Int<2>, SCALE>(raw.resize_to::<crate::int::types::Int<2>>()).policy_acos_with(wd, mode).0.resize_to::<Int<N>>(),
}
}
#[inline]
#[must_use]
pub(crate) fn sinh_dispatch<const N: usize, const SCALE: u32>(raw: Int<N>, mode: RoundingMode) -> Int<N> {
match N {
1 => crate::D::<crate::int::types::Int<1>, SCALE>(raw.resize_to::<crate::int::types::Int<1>>()).policy_sinh(mode).0.resize_to::<Int<N>>(),
2 => crate::D::<crate::int::types::Int<2>, SCALE>(raw.resize_to::<crate::int::types::Int<2>>()).policy_sinh(mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d57", feature = "wide"))]
3 => crate::D::<crate::int::types::Int<3>, SCALE>(raw.resize_to::<crate::int::types::Int<3>>()).policy_sinh(mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d76", feature = "wide"))]
4 => crate::D::<crate::int::types::Int<4>, SCALE>(raw.resize_to::<crate::int::types::Int<4>>()).policy_sinh(mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d115", feature = "wide"))]
6 => crate::D::<crate::int::types::Int<6>, SCALE>(raw.resize_to::<crate::int::types::Int<6>>()).policy_sinh(mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d153", feature = "wide"))]
8 => crate::D::<crate::int::types::Int<8>, SCALE>(raw.resize_to::<crate::int::types::Int<8>>()).policy_sinh(mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d230", feature = "wide"))]
12 => crate::D::<crate::int::types::Int<12>, SCALE>(raw.resize_to::<crate::int::types::Int<12>>()).policy_sinh(mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d307", feature = "wide", feature = "x-wide"))]
16 => crate::D::<crate::int::types::Int<16>, SCALE>(raw.resize_to::<crate::int::types::Int<16>>()).policy_sinh(mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d462", feature = "x-wide"))]
24 => crate::D::<crate::int::types::Int<24>, SCALE>(raw.resize_to::<crate::int::types::Int<24>>()).policy_sinh(mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d616", feature = "x-wide"))]
32 => crate::D::<crate::int::types::Int<32>, SCALE>(raw.resize_to::<crate::int::types::Int<32>>()).policy_sinh(mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d924", feature = "xx-wide"))]
48 => crate::D::<crate::int::types::Int<48>, SCALE>(raw.resize_to::<crate::int::types::Int<48>>()).policy_sinh(mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d1232", feature = "xx-wide"))]
64 => crate::D::<crate::int::types::Int<64>, SCALE>(raw.resize_to::<crate::int::types::Int<64>>()).policy_sinh(mode).0.resize_to::<Int<N>>(),
_ => crate::D::<crate::int::types::Int<2>, SCALE>(raw.resize_to::<crate::int::types::Int<2>>()).policy_sinh(mode).0.resize_to::<Int<N>>(),
}
}
#[inline]
#[must_use]
pub(crate) fn sinh_dispatch_with<const N: usize, const SCALE: u32>(raw: Int<N>, wd: u32, mode: RoundingMode) -> Int<N> {
match N {
1 => crate::D::<crate::int::types::Int<1>, SCALE>(raw.resize_to::<crate::int::types::Int<1>>()).policy_sinh_with(wd, mode).0.resize_to::<Int<N>>(),
2 => crate::D::<crate::int::types::Int<2>, SCALE>(raw.resize_to::<crate::int::types::Int<2>>()).policy_sinh_with(wd, mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d57", feature = "wide"))]
3 => crate::D::<crate::int::types::Int<3>, SCALE>(raw.resize_to::<crate::int::types::Int<3>>()).policy_sinh_with(wd, mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d76", feature = "wide"))]
4 => crate::D::<crate::int::types::Int<4>, SCALE>(raw.resize_to::<crate::int::types::Int<4>>()).policy_sinh_with(wd, mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d115", feature = "wide"))]
6 => crate::D::<crate::int::types::Int<6>, SCALE>(raw.resize_to::<crate::int::types::Int<6>>()).policy_sinh_with(wd, mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d153", feature = "wide"))]
8 => crate::D::<crate::int::types::Int<8>, SCALE>(raw.resize_to::<crate::int::types::Int<8>>()).policy_sinh_with(wd, mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d230", feature = "wide"))]
12 => crate::D::<crate::int::types::Int<12>, SCALE>(raw.resize_to::<crate::int::types::Int<12>>()).policy_sinh_with(wd, mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d307", feature = "wide", feature = "x-wide"))]
16 => crate::D::<crate::int::types::Int<16>, SCALE>(raw.resize_to::<crate::int::types::Int<16>>()).policy_sinh_with(wd, mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d462", feature = "x-wide"))]
24 => crate::D::<crate::int::types::Int<24>, SCALE>(raw.resize_to::<crate::int::types::Int<24>>()).policy_sinh_with(wd, mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d616", feature = "x-wide"))]
32 => crate::D::<crate::int::types::Int<32>, SCALE>(raw.resize_to::<crate::int::types::Int<32>>()).policy_sinh_with(wd, mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d924", feature = "xx-wide"))]
48 => crate::D::<crate::int::types::Int<48>, SCALE>(raw.resize_to::<crate::int::types::Int<48>>()).policy_sinh_with(wd, mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d1232", feature = "xx-wide"))]
64 => crate::D::<crate::int::types::Int<64>, SCALE>(raw.resize_to::<crate::int::types::Int<64>>()).policy_sinh_with(wd, mode).0.resize_to::<Int<N>>(),
_ => crate::D::<crate::int::types::Int<2>, SCALE>(raw.resize_to::<crate::int::types::Int<2>>()).policy_sinh_with(wd, mode).0.resize_to::<Int<N>>(),
}
}
#[inline]
#[must_use]
pub(crate) fn cosh_dispatch<const N: usize, const SCALE: u32>(raw: Int<N>, mode: RoundingMode) -> Int<N> {
match N {
1 => crate::D::<crate::int::types::Int<1>, SCALE>(raw.resize_to::<crate::int::types::Int<1>>()).policy_cosh(mode).0.resize_to::<Int<N>>(),
2 => crate::D::<crate::int::types::Int<2>, SCALE>(raw.resize_to::<crate::int::types::Int<2>>()).policy_cosh(mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d57", feature = "wide"))]
3 => crate::D::<crate::int::types::Int<3>, SCALE>(raw.resize_to::<crate::int::types::Int<3>>()).policy_cosh(mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d76", feature = "wide"))]
4 => crate::D::<crate::int::types::Int<4>, SCALE>(raw.resize_to::<crate::int::types::Int<4>>()).policy_cosh(mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d115", feature = "wide"))]
6 => crate::D::<crate::int::types::Int<6>, SCALE>(raw.resize_to::<crate::int::types::Int<6>>()).policy_cosh(mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d153", feature = "wide"))]
8 => crate::D::<crate::int::types::Int<8>, SCALE>(raw.resize_to::<crate::int::types::Int<8>>()).policy_cosh(mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d230", feature = "wide"))]
12 => crate::D::<crate::int::types::Int<12>, SCALE>(raw.resize_to::<crate::int::types::Int<12>>()).policy_cosh(mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d307", feature = "wide", feature = "x-wide"))]
16 => crate::D::<crate::int::types::Int<16>, SCALE>(raw.resize_to::<crate::int::types::Int<16>>()).policy_cosh(mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d462", feature = "x-wide"))]
24 => crate::D::<crate::int::types::Int<24>, SCALE>(raw.resize_to::<crate::int::types::Int<24>>()).policy_cosh(mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d616", feature = "x-wide"))]
32 => crate::D::<crate::int::types::Int<32>, SCALE>(raw.resize_to::<crate::int::types::Int<32>>()).policy_cosh(mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d924", feature = "xx-wide"))]
48 => crate::D::<crate::int::types::Int<48>, SCALE>(raw.resize_to::<crate::int::types::Int<48>>()).policy_cosh(mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d1232", feature = "xx-wide"))]
64 => crate::D::<crate::int::types::Int<64>, SCALE>(raw.resize_to::<crate::int::types::Int<64>>()).policy_cosh(mode).0.resize_to::<Int<N>>(),
_ => crate::D::<crate::int::types::Int<2>, SCALE>(raw.resize_to::<crate::int::types::Int<2>>()).policy_cosh(mode).0.resize_to::<Int<N>>(),
}
}
#[inline]
#[must_use]
pub(crate) fn cosh_dispatch_with<const N: usize, const SCALE: u32>(raw: Int<N>, wd: u32, mode: RoundingMode) -> Int<N> {
match N {
1 => crate::D::<crate::int::types::Int<1>, SCALE>(raw.resize_to::<crate::int::types::Int<1>>()).policy_cosh_with(wd, mode).0.resize_to::<Int<N>>(),
2 => crate::D::<crate::int::types::Int<2>, SCALE>(raw.resize_to::<crate::int::types::Int<2>>()).policy_cosh_with(wd, mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d57", feature = "wide"))]
3 => crate::D::<crate::int::types::Int<3>, SCALE>(raw.resize_to::<crate::int::types::Int<3>>()).policy_cosh_with(wd, mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d76", feature = "wide"))]
4 => crate::D::<crate::int::types::Int<4>, SCALE>(raw.resize_to::<crate::int::types::Int<4>>()).policy_cosh_with(wd, mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d115", feature = "wide"))]
6 => crate::D::<crate::int::types::Int<6>, SCALE>(raw.resize_to::<crate::int::types::Int<6>>()).policy_cosh_with(wd, mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d153", feature = "wide"))]
8 => crate::D::<crate::int::types::Int<8>, SCALE>(raw.resize_to::<crate::int::types::Int<8>>()).policy_cosh_with(wd, mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d230", feature = "wide"))]
12 => crate::D::<crate::int::types::Int<12>, SCALE>(raw.resize_to::<crate::int::types::Int<12>>()).policy_cosh_with(wd, mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d307", feature = "wide", feature = "x-wide"))]
16 => crate::D::<crate::int::types::Int<16>, SCALE>(raw.resize_to::<crate::int::types::Int<16>>()).policy_cosh_with(wd, mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d462", feature = "x-wide"))]
24 => crate::D::<crate::int::types::Int<24>, SCALE>(raw.resize_to::<crate::int::types::Int<24>>()).policy_cosh_with(wd, mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d616", feature = "x-wide"))]
32 => crate::D::<crate::int::types::Int<32>, SCALE>(raw.resize_to::<crate::int::types::Int<32>>()).policy_cosh_with(wd, mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d924", feature = "xx-wide"))]
48 => crate::D::<crate::int::types::Int<48>, SCALE>(raw.resize_to::<crate::int::types::Int<48>>()).policy_cosh_with(wd, mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d1232", feature = "xx-wide"))]
64 => crate::D::<crate::int::types::Int<64>, SCALE>(raw.resize_to::<crate::int::types::Int<64>>()).policy_cosh_with(wd, mode).0.resize_to::<Int<N>>(),
_ => crate::D::<crate::int::types::Int<2>, SCALE>(raw.resize_to::<crate::int::types::Int<2>>()).policy_cosh_with(wd, mode).0.resize_to::<Int<N>>(),
}
}
#[inline]
#[must_use]
pub(crate) fn tanh_dispatch<const N: usize, const SCALE: u32>(raw: Int<N>, mode: RoundingMode) -> Int<N> {
match N {
1 => crate::D::<crate::int::types::Int<1>, SCALE>(raw.resize_to::<crate::int::types::Int<1>>()).policy_tanh(mode).0.resize_to::<Int<N>>(),
2 => crate::D::<crate::int::types::Int<2>, SCALE>(raw.resize_to::<crate::int::types::Int<2>>()).policy_tanh(mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d57", feature = "wide"))]
3 => crate::D::<crate::int::types::Int<3>, SCALE>(raw.resize_to::<crate::int::types::Int<3>>()).policy_tanh(mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d76", feature = "wide"))]
4 => crate::D::<crate::int::types::Int<4>, SCALE>(raw.resize_to::<crate::int::types::Int<4>>()).policy_tanh(mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d115", feature = "wide"))]
6 => crate::D::<crate::int::types::Int<6>, SCALE>(raw.resize_to::<crate::int::types::Int<6>>()).policy_tanh(mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d153", feature = "wide"))]
8 => crate::D::<crate::int::types::Int<8>, SCALE>(raw.resize_to::<crate::int::types::Int<8>>()).policy_tanh(mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d230", feature = "wide"))]
12 => crate::D::<crate::int::types::Int<12>, SCALE>(raw.resize_to::<crate::int::types::Int<12>>()).policy_tanh(mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d307", feature = "wide", feature = "x-wide"))]
16 => crate::D::<crate::int::types::Int<16>, SCALE>(raw.resize_to::<crate::int::types::Int<16>>()).policy_tanh(mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d462", feature = "x-wide"))]
24 => crate::D::<crate::int::types::Int<24>, SCALE>(raw.resize_to::<crate::int::types::Int<24>>()).policy_tanh(mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d616", feature = "x-wide"))]
32 => crate::D::<crate::int::types::Int<32>, SCALE>(raw.resize_to::<crate::int::types::Int<32>>()).policy_tanh(mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d924", feature = "xx-wide"))]
48 => crate::D::<crate::int::types::Int<48>, SCALE>(raw.resize_to::<crate::int::types::Int<48>>()).policy_tanh(mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d1232", feature = "xx-wide"))]
64 => crate::D::<crate::int::types::Int<64>, SCALE>(raw.resize_to::<crate::int::types::Int<64>>()).policy_tanh(mode).0.resize_to::<Int<N>>(),
_ => crate::D::<crate::int::types::Int<2>, SCALE>(raw.resize_to::<crate::int::types::Int<2>>()).policy_tanh(mode).0.resize_to::<Int<N>>(),
}
}
#[inline]
#[must_use]
pub(crate) fn tanh_dispatch_with<const N: usize, const SCALE: u32>(raw: Int<N>, wd: u32, mode: RoundingMode) -> Int<N> {
match N {
1 => crate::D::<crate::int::types::Int<1>, SCALE>(raw.resize_to::<crate::int::types::Int<1>>()).policy_tanh_with(wd, mode).0.resize_to::<Int<N>>(),
2 => crate::D::<crate::int::types::Int<2>, SCALE>(raw.resize_to::<crate::int::types::Int<2>>()).policy_tanh_with(wd, mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d57", feature = "wide"))]
3 => crate::D::<crate::int::types::Int<3>, SCALE>(raw.resize_to::<crate::int::types::Int<3>>()).policy_tanh_with(wd, mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d76", feature = "wide"))]
4 => crate::D::<crate::int::types::Int<4>, SCALE>(raw.resize_to::<crate::int::types::Int<4>>()).policy_tanh_with(wd, mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d115", feature = "wide"))]
6 => crate::D::<crate::int::types::Int<6>, SCALE>(raw.resize_to::<crate::int::types::Int<6>>()).policy_tanh_with(wd, mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d153", feature = "wide"))]
8 => crate::D::<crate::int::types::Int<8>, SCALE>(raw.resize_to::<crate::int::types::Int<8>>()).policy_tanh_with(wd, mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d230", feature = "wide"))]
12 => crate::D::<crate::int::types::Int<12>, SCALE>(raw.resize_to::<crate::int::types::Int<12>>()).policy_tanh_with(wd, mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d307", feature = "wide", feature = "x-wide"))]
16 => crate::D::<crate::int::types::Int<16>, SCALE>(raw.resize_to::<crate::int::types::Int<16>>()).policy_tanh_with(wd, mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d462", feature = "x-wide"))]
24 => crate::D::<crate::int::types::Int<24>, SCALE>(raw.resize_to::<crate::int::types::Int<24>>()).policy_tanh_with(wd, mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d616", feature = "x-wide"))]
32 => crate::D::<crate::int::types::Int<32>, SCALE>(raw.resize_to::<crate::int::types::Int<32>>()).policy_tanh_with(wd, mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d924", feature = "xx-wide"))]
48 => crate::D::<crate::int::types::Int<48>, SCALE>(raw.resize_to::<crate::int::types::Int<48>>()).policy_tanh_with(wd, mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d1232", feature = "xx-wide"))]
64 => crate::D::<crate::int::types::Int<64>, SCALE>(raw.resize_to::<crate::int::types::Int<64>>()).policy_tanh_with(wd, mode).0.resize_to::<Int<N>>(),
_ => crate::D::<crate::int::types::Int<2>, SCALE>(raw.resize_to::<crate::int::types::Int<2>>()).policy_tanh_with(wd, mode).0.resize_to::<Int<N>>(),
}
}
#[inline]
#[must_use]
pub(crate) fn asinh_dispatch<const N: usize, const SCALE: u32>(raw: Int<N>, mode: RoundingMode) -> Int<N> {
match N {
1 => crate::D::<crate::int::types::Int<1>, SCALE>(raw.resize_to::<crate::int::types::Int<1>>()).policy_asinh(mode).0.resize_to::<Int<N>>(),
2 => crate::D::<crate::int::types::Int<2>, SCALE>(raw.resize_to::<crate::int::types::Int<2>>()).policy_asinh(mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d57", feature = "wide"))]
3 => crate::D::<crate::int::types::Int<3>, SCALE>(raw.resize_to::<crate::int::types::Int<3>>()).policy_asinh(mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d76", feature = "wide"))]
4 => crate::D::<crate::int::types::Int<4>, SCALE>(raw.resize_to::<crate::int::types::Int<4>>()).policy_asinh(mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d115", feature = "wide"))]
6 => crate::D::<crate::int::types::Int<6>, SCALE>(raw.resize_to::<crate::int::types::Int<6>>()).policy_asinh(mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d153", feature = "wide"))]
8 => crate::D::<crate::int::types::Int<8>, SCALE>(raw.resize_to::<crate::int::types::Int<8>>()).policy_asinh(mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d230", feature = "wide"))]
12 => crate::D::<crate::int::types::Int<12>, SCALE>(raw.resize_to::<crate::int::types::Int<12>>()).policy_asinh(mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d307", feature = "wide", feature = "x-wide"))]
16 => crate::D::<crate::int::types::Int<16>, SCALE>(raw.resize_to::<crate::int::types::Int<16>>()).policy_asinh(mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d462", feature = "x-wide"))]
24 => crate::D::<crate::int::types::Int<24>, SCALE>(raw.resize_to::<crate::int::types::Int<24>>()).policy_asinh(mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d616", feature = "x-wide"))]
32 => crate::D::<crate::int::types::Int<32>, SCALE>(raw.resize_to::<crate::int::types::Int<32>>()).policy_asinh(mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d924", feature = "xx-wide"))]
48 => crate::D::<crate::int::types::Int<48>, SCALE>(raw.resize_to::<crate::int::types::Int<48>>()).policy_asinh(mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d1232", feature = "xx-wide"))]
64 => crate::D::<crate::int::types::Int<64>, SCALE>(raw.resize_to::<crate::int::types::Int<64>>()).policy_asinh(mode).0.resize_to::<Int<N>>(),
_ => crate::D::<crate::int::types::Int<2>, SCALE>(raw.resize_to::<crate::int::types::Int<2>>()).policy_asinh(mode).0.resize_to::<Int<N>>(),
}
}
#[inline]
#[must_use]
pub(crate) fn asinh_dispatch_with<const N: usize, const SCALE: u32>(raw: Int<N>, wd: u32, mode: RoundingMode) -> Int<N> {
match N {
1 => crate::D::<crate::int::types::Int<1>, SCALE>(raw.resize_to::<crate::int::types::Int<1>>()).policy_asinh_with(wd, mode).0.resize_to::<Int<N>>(),
2 => crate::D::<crate::int::types::Int<2>, SCALE>(raw.resize_to::<crate::int::types::Int<2>>()).policy_asinh_with(wd, mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d57", feature = "wide"))]
3 => crate::D::<crate::int::types::Int<3>, SCALE>(raw.resize_to::<crate::int::types::Int<3>>()).policy_asinh_with(wd, mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d76", feature = "wide"))]
4 => crate::D::<crate::int::types::Int<4>, SCALE>(raw.resize_to::<crate::int::types::Int<4>>()).policy_asinh_with(wd, mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d115", feature = "wide"))]
6 => crate::D::<crate::int::types::Int<6>, SCALE>(raw.resize_to::<crate::int::types::Int<6>>()).policy_asinh_with(wd, mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d153", feature = "wide"))]
8 => crate::D::<crate::int::types::Int<8>, SCALE>(raw.resize_to::<crate::int::types::Int<8>>()).policy_asinh_with(wd, mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d230", feature = "wide"))]
12 => crate::D::<crate::int::types::Int<12>, SCALE>(raw.resize_to::<crate::int::types::Int<12>>()).policy_asinh_with(wd, mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d307", feature = "wide", feature = "x-wide"))]
16 => crate::D::<crate::int::types::Int<16>, SCALE>(raw.resize_to::<crate::int::types::Int<16>>()).policy_asinh_with(wd, mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d462", feature = "x-wide"))]
24 => crate::D::<crate::int::types::Int<24>, SCALE>(raw.resize_to::<crate::int::types::Int<24>>()).policy_asinh_with(wd, mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d616", feature = "x-wide"))]
32 => crate::D::<crate::int::types::Int<32>, SCALE>(raw.resize_to::<crate::int::types::Int<32>>()).policy_asinh_with(wd, mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d924", feature = "xx-wide"))]
48 => crate::D::<crate::int::types::Int<48>, SCALE>(raw.resize_to::<crate::int::types::Int<48>>()).policy_asinh_with(wd, mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d1232", feature = "xx-wide"))]
64 => crate::D::<crate::int::types::Int<64>, SCALE>(raw.resize_to::<crate::int::types::Int<64>>()).policy_asinh_with(wd, mode).0.resize_to::<Int<N>>(),
_ => crate::D::<crate::int::types::Int<2>, SCALE>(raw.resize_to::<crate::int::types::Int<2>>()).policy_asinh_with(wd, mode).0.resize_to::<Int<N>>(),
}
}
#[inline]
#[must_use]
pub(crate) fn acosh_dispatch<const N: usize, const SCALE: u32>(raw: Int<N>, mode: RoundingMode) -> Int<N> {
match N {
1 => crate::D::<crate::int::types::Int<1>, SCALE>(raw.resize_to::<crate::int::types::Int<1>>()).policy_acosh(mode).0.resize_to::<Int<N>>(),
2 => crate::D::<crate::int::types::Int<2>, SCALE>(raw.resize_to::<crate::int::types::Int<2>>()).policy_acosh(mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d57", feature = "wide"))]
3 => crate::D::<crate::int::types::Int<3>, SCALE>(raw.resize_to::<crate::int::types::Int<3>>()).policy_acosh(mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d76", feature = "wide"))]
4 => crate::D::<crate::int::types::Int<4>, SCALE>(raw.resize_to::<crate::int::types::Int<4>>()).policy_acosh(mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d115", feature = "wide"))]
6 => crate::D::<crate::int::types::Int<6>, SCALE>(raw.resize_to::<crate::int::types::Int<6>>()).policy_acosh(mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d153", feature = "wide"))]
8 => crate::D::<crate::int::types::Int<8>, SCALE>(raw.resize_to::<crate::int::types::Int<8>>()).policy_acosh(mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d230", feature = "wide"))]
12 => crate::D::<crate::int::types::Int<12>, SCALE>(raw.resize_to::<crate::int::types::Int<12>>()).policy_acosh(mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d307", feature = "wide", feature = "x-wide"))]
16 => crate::D::<crate::int::types::Int<16>, SCALE>(raw.resize_to::<crate::int::types::Int<16>>()).policy_acosh(mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d462", feature = "x-wide"))]
24 => crate::D::<crate::int::types::Int<24>, SCALE>(raw.resize_to::<crate::int::types::Int<24>>()).policy_acosh(mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d616", feature = "x-wide"))]
32 => crate::D::<crate::int::types::Int<32>, SCALE>(raw.resize_to::<crate::int::types::Int<32>>()).policy_acosh(mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d924", feature = "xx-wide"))]
48 => crate::D::<crate::int::types::Int<48>, SCALE>(raw.resize_to::<crate::int::types::Int<48>>()).policy_acosh(mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d1232", feature = "xx-wide"))]
64 => crate::D::<crate::int::types::Int<64>, SCALE>(raw.resize_to::<crate::int::types::Int<64>>()).policy_acosh(mode).0.resize_to::<Int<N>>(),
_ => crate::D::<crate::int::types::Int<2>, SCALE>(raw.resize_to::<crate::int::types::Int<2>>()).policy_acosh(mode).0.resize_to::<Int<N>>(),
}
}
#[inline]
#[must_use]
pub(crate) fn acosh_dispatch_with<const N: usize, const SCALE: u32>(raw: Int<N>, wd: u32, mode: RoundingMode) -> Int<N> {
match N {
1 => crate::D::<crate::int::types::Int<1>, SCALE>(raw.resize_to::<crate::int::types::Int<1>>()).policy_acosh_with(wd, mode).0.resize_to::<Int<N>>(),
2 => crate::D::<crate::int::types::Int<2>, SCALE>(raw.resize_to::<crate::int::types::Int<2>>()).policy_acosh_with(wd, mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d57", feature = "wide"))]
3 => crate::D::<crate::int::types::Int<3>, SCALE>(raw.resize_to::<crate::int::types::Int<3>>()).policy_acosh_with(wd, mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d76", feature = "wide"))]
4 => crate::D::<crate::int::types::Int<4>, SCALE>(raw.resize_to::<crate::int::types::Int<4>>()).policy_acosh_with(wd, mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d115", feature = "wide"))]
6 => crate::D::<crate::int::types::Int<6>, SCALE>(raw.resize_to::<crate::int::types::Int<6>>()).policy_acosh_with(wd, mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d153", feature = "wide"))]
8 => crate::D::<crate::int::types::Int<8>, SCALE>(raw.resize_to::<crate::int::types::Int<8>>()).policy_acosh_with(wd, mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d230", feature = "wide"))]
12 => crate::D::<crate::int::types::Int<12>, SCALE>(raw.resize_to::<crate::int::types::Int<12>>()).policy_acosh_with(wd, mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d307", feature = "wide", feature = "x-wide"))]
16 => crate::D::<crate::int::types::Int<16>, SCALE>(raw.resize_to::<crate::int::types::Int<16>>()).policy_acosh_with(wd, mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d462", feature = "x-wide"))]
24 => crate::D::<crate::int::types::Int<24>, SCALE>(raw.resize_to::<crate::int::types::Int<24>>()).policy_acosh_with(wd, mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d616", feature = "x-wide"))]
32 => crate::D::<crate::int::types::Int<32>, SCALE>(raw.resize_to::<crate::int::types::Int<32>>()).policy_acosh_with(wd, mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d924", feature = "xx-wide"))]
48 => crate::D::<crate::int::types::Int<48>, SCALE>(raw.resize_to::<crate::int::types::Int<48>>()).policy_acosh_with(wd, mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d1232", feature = "xx-wide"))]
64 => crate::D::<crate::int::types::Int<64>, SCALE>(raw.resize_to::<crate::int::types::Int<64>>()).policy_acosh_with(wd, mode).0.resize_to::<Int<N>>(),
_ => crate::D::<crate::int::types::Int<2>, SCALE>(raw.resize_to::<crate::int::types::Int<2>>()).policy_acosh_with(wd, mode).0.resize_to::<Int<N>>(),
}
}
#[inline]
#[must_use]
pub(crate) fn atanh_dispatch<const N: usize, const SCALE: u32>(raw: Int<N>, mode: RoundingMode) -> Int<N> {
match N {
1 => crate::D::<crate::int::types::Int<1>, SCALE>(raw.resize_to::<crate::int::types::Int<1>>()).policy_atanh(mode).0.resize_to::<Int<N>>(),
2 => crate::D::<crate::int::types::Int<2>, SCALE>(raw.resize_to::<crate::int::types::Int<2>>()).policy_atanh(mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d57", feature = "wide"))]
3 => crate::D::<crate::int::types::Int<3>, SCALE>(raw.resize_to::<crate::int::types::Int<3>>()).policy_atanh(mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d76", feature = "wide"))]
4 => crate::D::<crate::int::types::Int<4>, SCALE>(raw.resize_to::<crate::int::types::Int<4>>()).policy_atanh(mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d115", feature = "wide"))]
6 => crate::D::<crate::int::types::Int<6>, SCALE>(raw.resize_to::<crate::int::types::Int<6>>()).policy_atanh(mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d153", feature = "wide"))]
8 => crate::D::<crate::int::types::Int<8>, SCALE>(raw.resize_to::<crate::int::types::Int<8>>()).policy_atanh(mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d230", feature = "wide"))]
12 => crate::D::<crate::int::types::Int<12>, SCALE>(raw.resize_to::<crate::int::types::Int<12>>()).policy_atanh(mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d307", feature = "wide", feature = "x-wide"))]
16 => crate::D::<crate::int::types::Int<16>, SCALE>(raw.resize_to::<crate::int::types::Int<16>>()).policy_atanh(mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d462", feature = "x-wide"))]
24 => crate::D::<crate::int::types::Int<24>, SCALE>(raw.resize_to::<crate::int::types::Int<24>>()).policy_atanh(mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d616", feature = "x-wide"))]
32 => crate::D::<crate::int::types::Int<32>, SCALE>(raw.resize_to::<crate::int::types::Int<32>>()).policy_atanh(mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d924", feature = "xx-wide"))]
48 => crate::D::<crate::int::types::Int<48>, SCALE>(raw.resize_to::<crate::int::types::Int<48>>()).policy_atanh(mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d1232", feature = "xx-wide"))]
64 => crate::D::<crate::int::types::Int<64>, SCALE>(raw.resize_to::<crate::int::types::Int<64>>()).policy_atanh(mode).0.resize_to::<Int<N>>(),
_ => crate::D::<crate::int::types::Int<2>, SCALE>(raw.resize_to::<crate::int::types::Int<2>>()).policy_atanh(mode).0.resize_to::<Int<N>>(),
}
}
#[inline]
#[must_use]
pub(crate) fn atanh_dispatch_with<const N: usize, const SCALE: u32>(raw: Int<N>, wd: u32, mode: RoundingMode) -> Int<N> {
match N {
1 => crate::D::<crate::int::types::Int<1>, SCALE>(raw.resize_to::<crate::int::types::Int<1>>()).policy_atanh_with(wd, mode).0.resize_to::<Int<N>>(),
2 => crate::D::<crate::int::types::Int<2>, SCALE>(raw.resize_to::<crate::int::types::Int<2>>()).policy_atanh_with(wd, mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d57", feature = "wide"))]
3 => crate::D::<crate::int::types::Int<3>, SCALE>(raw.resize_to::<crate::int::types::Int<3>>()).policy_atanh_with(wd, mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d76", feature = "wide"))]
4 => crate::D::<crate::int::types::Int<4>, SCALE>(raw.resize_to::<crate::int::types::Int<4>>()).policy_atanh_with(wd, mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d115", feature = "wide"))]
6 => crate::D::<crate::int::types::Int<6>, SCALE>(raw.resize_to::<crate::int::types::Int<6>>()).policy_atanh_with(wd, mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d153", feature = "wide"))]
8 => crate::D::<crate::int::types::Int<8>, SCALE>(raw.resize_to::<crate::int::types::Int<8>>()).policy_atanh_with(wd, mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d230", feature = "wide"))]
12 => crate::D::<crate::int::types::Int<12>, SCALE>(raw.resize_to::<crate::int::types::Int<12>>()).policy_atanh_with(wd, mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d307", feature = "wide", feature = "x-wide"))]
16 => crate::D::<crate::int::types::Int<16>, SCALE>(raw.resize_to::<crate::int::types::Int<16>>()).policy_atanh_with(wd, mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d462", feature = "x-wide"))]
24 => crate::D::<crate::int::types::Int<24>, SCALE>(raw.resize_to::<crate::int::types::Int<24>>()).policy_atanh_with(wd, mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d616", feature = "x-wide"))]
32 => crate::D::<crate::int::types::Int<32>, SCALE>(raw.resize_to::<crate::int::types::Int<32>>()).policy_atanh_with(wd, mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d924", feature = "xx-wide"))]
48 => crate::D::<crate::int::types::Int<48>, SCALE>(raw.resize_to::<crate::int::types::Int<48>>()).policy_atanh_with(wd, mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d1232", feature = "xx-wide"))]
64 => crate::D::<crate::int::types::Int<64>, SCALE>(raw.resize_to::<crate::int::types::Int<64>>()).policy_atanh_with(wd, mode).0.resize_to::<Int<N>>(),
_ => crate::D::<crate::int::types::Int<2>, SCALE>(raw.resize_to::<crate::int::types::Int<2>>()).policy_atanh_with(wd, mode).0.resize_to::<Int<N>>(),
}
}
#[inline]
#[must_use]
pub(crate) fn to_degrees_dispatch<const N: usize, const SCALE: u32>(raw: Int<N>, mode: RoundingMode) -> Int<N> {
match N {
1 => crate::D::<crate::int::types::Int<1>, SCALE>(raw.resize_to::<crate::int::types::Int<1>>()).policy_to_degrees(mode).0.resize_to::<Int<N>>(),
2 => crate::D::<crate::int::types::Int<2>, SCALE>(raw.resize_to::<crate::int::types::Int<2>>()).policy_to_degrees(mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d57", feature = "wide"))]
3 => crate::D::<crate::int::types::Int<3>, SCALE>(raw.resize_to::<crate::int::types::Int<3>>()).policy_to_degrees(mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d76", feature = "wide"))]
4 => crate::D::<crate::int::types::Int<4>, SCALE>(raw.resize_to::<crate::int::types::Int<4>>()).policy_to_degrees(mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d115", feature = "wide"))]
6 => crate::D::<crate::int::types::Int<6>, SCALE>(raw.resize_to::<crate::int::types::Int<6>>()).policy_to_degrees(mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d153", feature = "wide"))]
8 => crate::D::<crate::int::types::Int<8>, SCALE>(raw.resize_to::<crate::int::types::Int<8>>()).policy_to_degrees(mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d230", feature = "wide"))]
12 => crate::D::<crate::int::types::Int<12>, SCALE>(raw.resize_to::<crate::int::types::Int<12>>()).policy_to_degrees(mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d307", feature = "wide", feature = "x-wide"))]
16 => crate::D::<crate::int::types::Int<16>, SCALE>(raw.resize_to::<crate::int::types::Int<16>>()).policy_to_degrees(mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d462", feature = "x-wide"))]
24 => crate::D::<crate::int::types::Int<24>, SCALE>(raw.resize_to::<crate::int::types::Int<24>>()).policy_to_degrees(mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d616", feature = "x-wide"))]
32 => crate::D::<crate::int::types::Int<32>, SCALE>(raw.resize_to::<crate::int::types::Int<32>>()).policy_to_degrees(mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d924", feature = "xx-wide"))]
48 => crate::D::<crate::int::types::Int<48>, SCALE>(raw.resize_to::<crate::int::types::Int<48>>()).policy_to_degrees(mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d1232", feature = "xx-wide"))]
64 => crate::D::<crate::int::types::Int<64>, SCALE>(raw.resize_to::<crate::int::types::Int<64>>()).policy_to_degrees(mode).0.resize_to::<Int<N>>(),
_ => crate::D::<crate::int::types::Int<2>, SCALE>(raw.resize_to::<crate::int::types::Int<2>>()).policy_to_degrees(mode).0.resize_to::<Int<N>>(),
}
}
#[inline]
#[must_use]
pub(crate) fn to_degrees_dispatch_with<const N: usize, const SCALE: u32>(raw: Int<N>, wd: u32, mode: RoundingMode) -> Int<N> {
match N {
1 => crate::D::<crate::int::types::Int<1>, SCALE>(raw.resize_to::<crate::int::types::Int<1>>()).policy_to_degrees_with(wd, mode).0.resize_to::<Int<N>>(),
2 => crate::D::<crate::int::types::Int<2>, SCALE>(raw.resize_to::<crate::int::types::Int<2>>()).policy_to_degrees_with(wd, mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d57", feature = "wide"))]
3 => crate::D::<crate::int::types::Int<3>, SCALE>(raw.resize_to::<crate::int::types::Int<3>>()).policy_to_degrees_with(wd, mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d76", feature = "wide"))]
4 => crate::D::<crate::int::types::Int<4>, SCALE>(raw.resize_to::<crate::int::types::Int<4>>()).policy_to_degrees_with(wd, mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d115", feature = "wide"))]
6 => crate::D::<crate::int::types::Int<6>, SCALE>(raw.resize_to::<crate::int::types::Int<6>>()).policy_to_degrees_with(wd, mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d153", feature = "wide"))]
8 => crate::D::<crate::int::types::Int<8>, SCALE>(raw.resize_to::<crate::int::types::Int<8>>()).policy_to_degrees_with(wd, mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d230", feature = "wide"))]
12 => crate::D::<crate::int::types::Int<12>, SCALE>(raw.resize_to::<crate::int::types::Int<12>>()).policy_to_degrees_with(wd, mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d307", feature = "wide", feature = "x-wide"))]
16 => crate::D::<crate::int::types::Int<16>, SCALE>(raw.resize_to::<crate::int::types::Int<16>>()).policy_to_degrees_with(wd, mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d462", feature = "x-wide"))]
24 => crate::D::<crate::int::types::Int<24>, SCALE>(raw.resize_to::<crate::int::types::Int<24>>()).policy_to_degrees_with(wd, mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d616", feature = "x-wide"))]
32 => crate::D::<crate::int::types::Int<32>, SCALE>(raw.resize_to::<crate::int::types::Int<32>>()).policy_to_degrees_with(wd, mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d924", feature = "xx-wide"))]
48 => crate::D::<crate::int::types::Int<48>, SCALE>(raw.resize_to::<crate::int::types::Int<48>>()).policy_to_degrees_with(wd, mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d1232", feature = "xx-wide"))]
64 => crate::D::<crate::int::types::Int<64>, SCALE>(raw.resize_to::<crate::int::types::Int<64>>()).policy_to_degrees_with(wd, mode).0.resize_to::<Int<N>>(),
_ => crate::D::<crate::int::types::Int<2>, SCALE>(raw.resize_to::<crate::int::types::Int<2>>()).policy_to_degrees_with(wd, mode).0.resize_to::<Int<N>>(),
}
}
#[inline]
#[must_use]
pub(crate) fn to_radians_dispatch<const N: usize, const SCALE: u32>(raw: Int<N>, mode: RoundingMode) -> Int<N> {
match N {
1 => crate::D::<crate::int::types::Int<1>, SCALE>(raw.resize_to::<crate::int::types::Int<1>>()).policy_to_radians(mode).0.resize_to::<Int<N>>(),
2 => crate::D::<crate::int::types::Int<2>, SCALE>(raw.resize_to::<crate::int::types::Int<2>>()).policy_to_radians(mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d57", feature = "wide"))]
3 => crate::D::<crate::int::types::Int<3>, SCALE>(raw.resize_to::<crate::int::types::Int<3>>()).policy_to_radians(mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d76", feature = "wide"))]
4 => crate::D::<crate::int::types::Int<4>, SCALE>(raw.resize_to::<crate::int::types::Int<4>>()).policy_to_radians(mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d115", feature = "wide"))]
6 => crate::D::<crate::int::types::Int<6>, SCALE>(raw.resize_to::<crate::int::types::Int<6>>()).policy_to_radians(mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d153", feature = "wide"))]
8 => crate::D::<crate::int::types::Int<8>, SCALE>(raw.resize_to::<crate::int::types::Int<8>>()).policy_to_radians(mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d230", feature = "wide"))]
12 => crate::D::<crate::int::types::Int<12>, SCALE>(raw.resize_to::<crate::int::types::Int<12>>()).policy_to_radians(mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d307", feature = "wide", feature = "x-wide"))]
16 => crate::D::<crate::int::types::Int<16>, SCALE>(raw.resize_to::<crate::int::types::Int<16>>()).policy_to_radians(mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d462", feature = "x-wide"))]
24 => crate::D::<crate::int::types::Int<24>, SCALE>(raw.resize_to::<crate::int::types::Int<24>>()).policy_to_radians(mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d616", feature = "x-wide"))]
32 => crate::D::<crate::int::types::Int<32>, SCALE>(raw.resize_to::<crate::int::types::Int<32>>()).policy_to_radians(mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d924", feature = "xx-wide"))]
48 => crate::D::<crate::int::types::Int<48>, SCALE>(raw.resize_to::<crate::int::types::Int<48>>()).policy_to_radians(mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d1232", feature = "xx-wide"))]
64 => crate::D::<crate::int::types::Int<64>, SCALE>(raw.resize_to::<crate::int::types::Int<64>>()).policy_to_radians(mode).0.resize_to::<Int<N>>(),
_ => crate::D::<crate::int::types::Int<2>, SCALE>(raw.resize_to::<crate::int::types::Int<2>>()).policy_to_radians(mode).0.resize_to::<Int<N>>(),
}
}
#[inline]
#[must_use]
pub(crate) fn to_radians_dispatch_with<const N: usize, const SCALE: u32>(raw: Int<N>, wd: u32, mode: RoundingMode) -> Int<N> {
match N {
1 => crate::D::<crate::int::types::Int<1>, SCALE>(raw.resize_to::<crate::int::types::Int<1>>()).policy_to_radians_with(wd, mode).0.resize_to::<Int<N>>(),
2 => crate::D::<crate::int::types::Int<2>, SCALE>(raw.resize_to::<crate::int::types::Int<2>>()).policy_to_radians_with(wd, mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d57", feature = "wide"))]
3 => crate::D::<crate::int::types::Int<3>, SCALE>(raw.resize_to::<crate::int::types::Int<3>>()).policy_to_radians_with(wd, mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d76", feature = "wide"))]
4 => crate::D::<crate::int::types::Int<4>, SCALE>(raw.resize_to::<crate::int::types::Int<4>>()).policy_to_radians_with(wd, mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d115", feature = "wide"))]
6 => crate::D::<crate::int::types::Int<6>, SCALE>(raw.resize_to::<crate::int::types::Int<6>>()).policy_to_radians_with(wd, mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d153", feature = "wide"))]
8 => crate::D::<crate::int::types::Int<8>, SCALE>(raw.resize_to::<crate::int::types::Int<8>>()).policy_to_radians_with(wd, mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d230", feature = "wide"))]
12 => crate::D::<crate::int::types::Int<12>, SCALE>(raw.resize_to::<crate::int::types::Int<12>>()).policy_to_radians_with(wd, mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d307", feature = "wide", feature = "x-wide"))]
16 => crate::D::<crate::int::types::Int<16>, SCALE>(raw.resize_to::<crate::int::types::Int<16>>()).policy_to_radians_with(wd, mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d462", feature = "x-wide"))]
24 => crate::D::<crate::int::types::Int<24>, SCALE>(raw.resize_to::<crate::int::types::Int<24>>()).policy_to_radians_with(wd, mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d616", feature = "x-wide"))]
32 => crate::D::<crate::int::types::Int<32>, SCALE>(raw.resize_to::<crate::int::types::Int<32>>()).policy_to_radians_with(wd, mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d924", feature = "xx-wide"))]
48 => crate::D::<crate::int::types::Int<48>, SCALE>(raw.resize_to::<crate::int::types::Int<48>>()).policy_to_radians_with(wd, mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d1232", feature = "xx-wide"))]
64 => crate::D::<crate::int::types::Int<64>, SCALE>(raw.resize_to::<crate::int::types::Int<64>>()).policy_to_radians_with(wd, mode).0.resize_to::<Int<N>>(),
_ => crate::D::<crate::int::types::Int<2>, SCALE>(raw.resize_to::<crate::int::types::Int<2>>()).policy_to_radians_with(wd, mode).0.resize_to::<Int<N>>(),
}
}
#[inline]
#[must_use]
pub(crate) fn atan2_dispatch<const N: usize, const SCALE: u32>(raw: Int<N>, other: Int<N>, mode: RoundingMode) -> Int<N> {
match N {
1 => crate::D::<crate::int::types::Int<1>, SCALE>(raw.resize_to::<crate::int::types::Int<1>>()).policy_atan2(crate::D::<crate::int::types::Int<1>, SCALE>(other.resize_to::<crate::int::types::Int<1>>()), mode).0.resize_to::<Int<N>>(),
2 => crate::D::<crate::int::types::Int<2>, SCALE>(raw.resize_to::<crate::int::types::Int<2>>()).policy_atan2(crate::D::<crate::int::types::Int<2>, SCALE>(other.resize_to::<crate::int::types::Int<2>>()), mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d57", feature = "wide"))]
3 => crate::D::<crate::int::types::Int<3>, SCALE>(raw.resize_to::<crate::int::types::Int<3>>()).policy_atan2(crate::D::<crate::int::types::Int<3>, SCALE>(other.resize_to::<crate::int::types::Int<3>>()), mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d76", feature = "wide"))]
4 => crate::D::<crate::int::types::Int<4>, SCALE>(raw.resize_to::<crate::int::types::Int<4>>()).policy_atan2(crate::D::<crate::int::types::Int<4>, SCALE>(other.resize_to::<crate::int::types::Int<4>>()), mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d115", feature = "wide"))]
6 => crate::D::<crate::int::types::Int<6>, SCALE>(raw.resize_to::<crate::int::types::Int<6>>()).policy_atan2(crate::D::<crate::int::types::Int<6>, SCALE>(other.resize_to::<crate::int::types::Int<6>>()), mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d153", feature = "wide"))]
8 => crate::D::<crate::int::types::Int<8>, SCALE>(raw.resize_to::<crate::int::types::Int<8>>()).policy_atan2(crate::D::<crate::int::types::Int<8>, SCALE>(other.resize_to::<crate::int::types::Int<8>>()), mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d230", feature = "wide"))]
12 => crate::D::<crate::int::types::Int<12>, SCALE>(raw.resize_to::<crate::int::types::Int<12>>()).policy_atan2(crate::D::<crate::int::types::Int<12>, SCALE>(other.resize_to::<crate::int::types::Int<12>>()), mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d307", feature = "wide", feature = "x-wide"))]
16 => crate::D::<crate::int::types::Int<16>, SCALE>(raw.resize_to::<crate::int::types::Int<16>>()).policy_atan2(crate::D::<crate::int::types::Int<16>, SCALE>(other.resize_to::<crate::int::types::Int<16>>()), mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d462", feature = "x-wide"))]
24 => crate::D::<crate::int::types::Int<24>, SCALE>(raw.resize_to::<crate::int::types::Int<24>>()).policy_atan2(crate::D::<crate::int::types::Int<24>, SCALE>(other.resize_to::<crate::int::types::Int<24>>()), mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d616", feature = "x-wide"))]
32 => crate::D::<crate::int::types::Int<32>, SCALE>(raw.resize_to::<crate::int::types::Int<32>>()).policy_atan2(crate::D::<crate::int::types::Int<32>, SCALE>(other.resize_to::<crate::int::types::Int<32>>()), mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d924", feature = "xx-wide"))]
48 => crate::D::<crate::int::types::Int<48>, SCALE>(raw.resize_to::<crate::int::types::Int<48>>()).policy_atan2(crate::D::<crate::int::types::Int<48>, SCALE>(other.resize_to::<crate::int::types::Int<48>>()), mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d1232", feature = "xx-wide"))]
64 => crate::D::<crate::int::types::Int<64>, SCALE>(raw.resize_to::<crate::int::types::Int<64>>()).policy_atan2(crate::D::<crate::int::types::Int<64>, SCALE>(other.resize_to::<crate::int::types::Int<64>>()), mode).0.resize_to::<Int<N>>(),
_ => crate::D::<crate::int::types::Int<2>, SCALE>(raw.resize_to::<crate::int::types::Int<2>>()).policy_atan2(crate::D::<crate::int::types::Int<2>, SCALE>(other.resize_to::<crate::int::types::Int<2>>()), mode).0.resize_to::<Int<N>>(),
}
}
#[inline]
#[must_use]
pub(crate) fn atan2_dispatch_with<const N: usize, const SCALE: u32>(raw: Int<N>, other: Int<N>, wd: u32, mode: RoundingMode) -> Int<N> {
match N {
1 => crate::D::<crate::int::types::Int<1>, SCALE>(raw.resize_to::<crate::int::types::Int<1>>()).policy_atan2_with(crate::D::<crate::int::types::Int<1>, SCALE>(other.resize_to::<crate::int::types::Int<1>>()), wd, mode).0.resize_to::<Int<N>>(),
2 => crate::D::<crate::int::types::Int<2>, SCALE>(raw.resize_to::<crate::int::types::Int<2>>()).policy_atan2_with(crate::D::<crate::int::types::Int<2>, SCALE>(other.resize_to::<crate::int::types::Int<2>>()), wd, mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d57", feature = "wide"))]
3 => crate::D::<crate::int::types::Int<3>, SCALE>(raw.resize_to::<crate::int::types::Int<3>>()).policy_atan2_with(crate::D::<crate::int::types::Int<3>, SCALE>(other.resize_to::<crate::int::types::Int<3>>()), wd, mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d76", feature = "wide"))]
4 => crate::D::<crate::int::types::Int<4>, SCALE>(raw.resize_to::<crate::int::types::Int<4>>()).policy_atan2_with(crate::D::<crate::int::types::Int<4>, SCALE>(other.resize_to::<crate::int::types::Int<4>>()), wd, mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d115", feature = "wide"))]
6 => crate::D::<crate::int::types::Int<6>, SCALE>(raw.resize_to::<crate::int::types::Int<6>>()).policy_atan2_with(crate::D::<crate::int::types::Int<6>, SCALE>(other.resize_to::<crate::int::types::Int<6>>()), wd, mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d153", feature = "wide"))]
8 => crate::D::<crate::int::types::Int<8>, SCALE>(raw.resize_to::<crate::int::types::Int<8>>()).policy_atan2_with(crate::D::<crate::int::types::Int<8>, SCALE>(other.resize_to::<crate::int::types::Int<8>>()), wd, mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d230", feature = "wide"))]
12 => crate::D::<crate::int::types::Int<12>, SCALE>(raw.resize_to::<crate::int::types::Int<12>>()).policy_atan2_with(crate::D::<crate::int::types::Int<12>, SCALE>(other.resize_to::<crate::int::types::Int<12>>()), wd, mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d307", feature = "wide", feature = "x-wide"))]
16 => crate::D::<crate::int::types::Int<16>, SCALE>(raw.resize_to::<crate::int::types::Int<16>>()).policy_atan2_with(crate::D::<crate::int::types::Int<16>, SCALE>(other.resize_to::<crate::int::types::Int<16>>()), wd, mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d462", feature = "x-wide"))]
24 => crate::D::<crate::int::types::Int<24>, SCALE>(raw.resize_to::<crate::int::types::Int<24>>()).policy_atan2_with(crate::D::<crate::int::types::Int<24>, SCALE>(other.resize_to::<crate::int::types::Int<24>>()), wd, mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d616", feature = "x-wide"))]
32 => crate::D::<crate::int::types::Int<32>, SCALE>(raw.resize_to::<crate::int::types::Int<32>>()).policy_atan2_with(crate::D::<crate::int::types::Int<32>, SCALE>(other.resize_to::<crate::int::types::Int<32>>()), wd, mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d924", feature = "xx-wide"))]
48 => crate::D::<crate::int::types::Int<48>, SCALE>(raw.resize_to::<crate::int::types::Int<48>>()).policy_atan2_with(crate::D::<crate::int::types::Int<48>, SCALE>(other.resize_to::<crate::int::types::Int<48>>()), wd, mode).0.resize_to::<Int<N>>(),
#[cfg(any(feature = "d1232", feature = "xx-wide"))]
64 => crate::D::<crate::int::types::Int<64>, SCALE>(raw.resize_to::<crate::int::types::Int<64>>()).policy_atan2_with(crate::D::<crate::int::types::Int<64>, SCALE>(other.resize_to::<crate::int::types::Int<64>>()), wd, mode).0.resize_to::<Int<N>>(),
_ => crate::D::<crate::int::types::Int<2>, SCALE>(raw.resize_to::<crate::int::types::Int<2>>()).policy_atan2_with(crate::D::<crate::int::types::Int<2>, SCALE>(other.resize_to::<crate::int::types::Int<2>>()), wd, mode).0.resize_to::<Int<N>>(),
}
}
macro_rules! checked_hop_dispatch {
($name:ident, $method:ident) => {
#[inline]
#[must_use]
pub(crate) fn $name<const N: usize, const SCALE: u32>(
raw: Int<N>,
mode: RoundingMode,
) -> Option<Int<N>> {
match N {
1 => super::narrow_fit::<N>(
crate::D::<crate::int::types::Int<2>, SCALE>(raw.resize_to::<crate::int::types::Int<2>>()).$method(mode).0,
),
2 => Some(crate::D::<crate::int::types::Int<2>, SCALE>(raw.resize_to::<crate::int::types::Int<2>>()).$method(mode).0.resize_to::<Int<N>>()),
#[cfg(any(feature = "d57", feature = "wide"))]
3 => Some(crate::D::<crate::int::types::Int<3>, SCALE>(raw.resize_to::<crate::int::types::Int<3>>()).$method(mode).0.resize_to::<Int<N>>()),
#[cfg(any(feature = "d76", feature = "wide"))]
4 => Some(crate::D::<crate::int::types::Int<4>, SCALE>(raw.resize_to::<crate::int::types::Int<4>>()).$method(mode).0.resize_to::<Int<N>>()),
#[cfg(any(feature = "d115", feature = "wide"))]
6 => Some(crate::D::<crate::int::types::Int<6>, SCALE>(raw.resize_to::<crate::int::types::Int<6>>()).$method(mode).0.resize_to::<Int<N>>()),
#[cfg(any(feature = "d153", feature = "wide"))]
8 => Some(crate::D::<crate::int::types::Int<8>, SCALE>(raw.resize_to::<crate::int::types::Int<8>>()).$method(mode).0.resize_to::<Int<N>>()),
#[cfg(any(feature = "d230", feature = "wide"))]
12 => Some(crate::D::<crate::int::types::Int<12>, SCALE>(raw.resize_to::<crate::int::types::Int<12>>()).$method(mode).0.resize_to::<Int<N>>()),
#[cfg(any(feature = "d307", feature = "wide", feature = "x-wide"))]
16 => Some(crate::D::<crate::int::types::Int<16>, SCALE>(raw.resize_to::<crate::int::types::Int<16>>()).$method(mode).0.resize_to::<Int<N>>()),
#[cfg(any(feature = "d462", feature = "x-wide"))]
24 => Some(crate::D::<crate::int::types::Int<24>, SCALE>(raw.resize_to::<crate::int::types::Int<24>>()).$method(mode).0.resize_to::<Int<N>>()),
#[cfg(any(feature = "d616", feature = "x-wide"))]
32 => Some(crate::D::<crate::int::types::Int<32>, SCALE>(raw.resize_to::<crate::int::types::Int<32>>()).$method(mode).0.resize_to::<Int<N>>()),
#[cfg(any(feature = "d924", feature = "xx-wide"))]
48 => Some(crate::D::<crate::int::types::Int<48>, SCALE>(raw.resize_to::<crate::int::types::Int<48>>()).$method(mode).0.resize_to::<Int<N>>()),
#[cfg(any(feature = "d1232", feature = "xx-wide"))]
64 => Some(crate::D::<crate::int::types::Int<64>, SCALE>(raw.resize_to::<crate::int::types::Int<64>>()).$method(mode).0.resize_to::<Int<N>>()),
_ => super::narrow_fit::<N>(
crate::D::<crate::int::types::Int<2>, SCALE>(raw.resize_to::<crate::int::types::Int<2>>()).$method(mode).0,
),
}
}
};
}
checked_hop_dispatch!(checked_sinh_dispatch, sinh_strict_with);
checked_hop_dispatch!(checked_cosh_dispatch, cosh_strict_with);
checked_hop_dispatch!(checked_tanh_dispatch, tanh_strict_with);
checked_hop_dispatch!(checked_asin_dispatch, asin_strict_with);
checked_hop_dispatch!(checked_acos_dispatch, acos_strict_with);
checked_hop_dispatch!(checked_asinh_dispatch, asinh_strict_with);
checked_hop_dispatch!(checked_acosh_dispatch, acosh_strict_with);
checked_hop_dispatch!(checked_atanh_dispatch, atanh_strict_with);
checked_hop_dispatch!(checked_to_degrees_dispatch, to_degrees_strict_with);
checked_hop_dispatch!(checked_to_radians_dispatch, to_radians_strict_with);
#[inline]
#[must_use]
pub(crate) fn checked_atan2_dispatch<const N: usize, const SCALE: u32>(
raw: Int<N>,
other: Int<N>,
mode: RoundingMode,
) -> Option<Int<N>> {
match N {
1 => super::narrow_fit::<N>(
crate::D::<crate::int::types::Int<2>, SCALE>(raw.resize_to::<crate::int::types::Int<2>>()).atan2_strict_with(crate::D::<crate::int::types::Int<2>, SCALE>(other.resize_to::<crate::int::types::Int<2>>()), mode).0,
),
2 => Some(crate::D::<crate::int::types::Int<2>, SCALE>(raw.resize_to::<crate::int::types::Int<2>>()).atan2_strict_with(crate::D::<crate::int::types::Int<2>, SCALE>(other.resize_to::<crate::int::types::Int<2>>()), mode).0.resize_to::<Int<N>>()),
#[cfg(any(feature = "d57", feature = "wide"))]
3 => Some(crate::D::<crate::int::types::Int<3>, SCALE>(raw.resize_to::<crate::int::types::Int<3>>()).atan2_strict_with(crate::D::<crate::int::types::Int<3>, SCALE>(other.resize_to::<crate::int::types::Int<3>>()), mode).0.resize_to::<Int<N>>()),
#[cfg(any(feature = "d76", feature = "wide"))]
4 => Some(crate::D::<crate::int::types::Int<4>, SCALE>(raw.resize_to::<crate::int::types::Int<4>>()).atan2_strict_with(crate::D::<crate::int::types::Int<4>, SCALE>(other.resize_to::<crate::int::types::Int<4>>()), mode).0.resize_to::<Int<N>>()),
#[cfg(any(feature = "d115", feature = "wide"))]
6 => Some(crate::D::<crate::int::types::Int<6>, SCALE>(raw.resize_to::<crate::int::types::Int<6>>()).atan2_strict_with(crate::D::<crate::int::types::Int<6>, SCALE>(other.resize_to::<crate::int::types::Int<6>>()), mode).0.resize_to::<Int<N>>()),
#[cfg(any(feature = "d153", feature = "wide"))]
8 => Some(crate::D::<crate::int::types::Int<8>, SCALE>(raw.resize_to::<crate::int::types::Int<8>>()).atan2_strict_with(crate::D::<crate::int::types::Int<8>, SCALE>(other.resize_to::<crate::int::types::Int<8>>()), mode).0.resize_to::<Int<N>>()),
#[cfg(any(feature = "d230", feature = "wide"))]
12 => Some(crate::D::<crate::int::types::Int<12>, SCALE>(raw.resize_to::<crate::int::types::Int<12>>()).atan2_strict_with(crate::D::<crate::int::types::Int<12>, SCALE>(other.resize_to::<crate::int::types::Int<12>>()), mode).0.resize_to::<Int<N>>()),
#[cfg(any(feature = "d307", feature = "wide", feature = "x-wide"))]
16 => Some(crate::D::<crate::int::types::Int<16>, SCALE>(raw.resize_to::<crate::int::types::Int<16>>()).atan2_strict_with(crate::D::<crate::int::types::Int<16>, SCALE>(other.resize_to::<crate::int::types::Int<16>>()), mode).0.resize_to::<Int<N>>()),
#[cfg(any(feature = "d462", feature = "x-wide"))]
24 => Some(crate::D::<crate::int::types::Int<24>, SCALE>(raw.resize_to::<crate::int::types::Int<24>>()).atan2_strict_with(crate::D::<crate::int::types::Int<24>, SCALE>(other.resize_to::<crate::int::types::Int<24>>()), mode).0.resize_to::<Int<N>>()),
#[cfg(any(feature = "d616", feature = "x-wide"))]
32 => Some(crate::D::<crate::int::types::Int<32>, SCALE>(raw.resize_to::<crate::int::types::Int<32>>()).atan2_strict_with(crate::D::<crate::int::types::Int<32>, SCALE>(other.resize_to::<crate::int::types::Int<32>>()), mode).0.resize_to::<Int<N>>()),
#[cfg(any(feature = "d924", feature = "xx-wide"))]
48 => Some(crate::D::<crate::int::types::Int<48>, SCALE>(raw.resize_to::<crate::int::types::Int<48>>()).atan2_strict_with(crate::D::<crate::int::types::Int<48>, SCALE>(other.resize_to::<crate::int::types::Int<48>>()), mode).0.resize_to::<Int<N>>()),
#[cfg(any(feature = "d1232", feature = "xx-wide"))]
64 => Some(crate::D::<crate::int::types::Int<64>, SCALE>(raw.resize_to::<crate::int::types::Int<64>>()).atan2_strict_with(crate::D::<crate::int::types::Int<64>, SCALE>(other.resize_to::<crate::int::types::Int<64>>()), mode).0.resize_to::<Int<N>>()),
_ => super::narrow_fit::<N>(
crate::D::<crate::int::types::Int<2>, SCALE>(raw.resize_to::<crate::int::types::Int<2>>()).atan2_strict_with(crate::D::<crate::int::types::Int<2>, SCALE>(other.resize_to::<crate::int::types::Int<2>>()), mode).0,
),
}
}
#[cfg(test)]
mod forward_rung_tests {
#[cfg(any(
feature = "d307",
feature = "d462",
feature = "d616",
feature = "d924",
feature = "d1232"
))]
const ALL_MODES: [crate::support::rounding::RoundingMode; 6] = [
crate::support::rounding::RoundingMode::HalfToEven,
crate::support::rounding::RoundingMode::HalfAwayFromZero,
crate::support::rounding::RoundingMode::HalfTowardZero,
crate::support::rounding::RoundingMode::Trunc,
crate::support::rounding::RoundingMode::Floor,
crate::support::rounding::RoundingMode::Ceiling,
];
#[test]
#[cfg(feature = "d307")]
fn d307_s0_rung_matches_tier_kernel() {
type Core = crate::types::widths::wide_trig_d307::Core;
const G: u32 =
<Core as crate::algos::support::wide_trig_core::WideTrigCore>::GUARD;
for v in ["1", "-1", "2", "3141", "-1570"] {
let x: crate::D307<0> = v.parse().unwrap();
for mode in ALL_MODES {
assert_eq!(
super::forward_rung::sin_strict::<Core, 0, G>(x.to_bits(), mode),
crate::algos::support::wide_trig_core::sin_series::<Core, 0>(x.to_bits(), mode),
"sin({v}) mode {mode:?}"
);
assert_eq!(
super::forward_rung::tan_strict::<Core, 0, G, true, true>(x.to_bits(), mode),
crate::algos::support::wide_trig_core::tan_series::<Core, 0>(x.to_bits(), mode),
"tan({v}) mode {mode:?}"
);
assert_eq!(
super::forward_rung::atan_strict::<Core, 0, G, true>(x.to_bits(), mode),
crate::algos::support::wide_trig_core::atan_series::<Core, 0>(x.to_bits(), mode),
"atan({v}) mode {mode:?}"
);
}
}
}
#[test]
#[cfg(feature = "d307")]
fn d307_band_atan_rung_matches_tier_narrow() {
type Core = crate::types::widths::wide_trig_d307::Core;
for v in ["1", "-1", "2", "3141"] {
let x: crate::D307<150> = v.parse().unwrap();
for mode in ALL_MODES {
assert_eq!(
super::forward_rung::atan_strict::<Core, 150, 10, false>(x.to_bits(), mode),
crate::algos::support::wide_trig_core::atan_narrow::<Core, 150, 10>(x.to_bits(), mode),
"atan({v}) band mode {mode:?}"
);
}
}
}
#[test]
#[cfg(feature = "d307")]
fn d307_s0_out_of_budget_falls_back_to_tier() {
type Core = crate::types::widths::wide_trig_d307::Core;
const G: u32 =
<Core as crate::algos::support::wide_trig_core::WideTrigCore>::GUARD;
let x: crate::D307<0> = "1000000000".parse().unwrap();
for mode in ALL_MODES {
assert_eq!(
super::forward_rung::sin_strict::<Core, 0, G>(x.to_bits(), mode),
crate::algos::support::wide_trig_core::sin_series::<Core, 0>(x.to_bits(), mode),
"sin(1e9) mode {mode:?}"
);
assert_eq!(
super::forward_rung::atan_strict::<Core, 0, G, true>(x.to_bits(), mode),
crate::algos::support::wide_trig_core::atan_series::<Core, 0>(x.to_bits(), mode),
"atan(1e9) mode {mode:?}"
);
}
}
#[test]
#[cfg(feature = "d307")]
fn d307_s153_tiny_argument_rung_matches_tier() {
type Core = crate::types::widths::wide_trig_d307::Core;
const G: u32 =
<Core as crate::algos::support::wide_trig_core::WideTrigCore>::GUARD;
let p36 = crate::int::types::Int::<16>::from_i128(10i128.pow(36));
let raws = [
crate::int::types::Int::<16>::from_i128(3 * 10i128.pow(35)),
p36,
crate::int::types::Int::<16>::from_i128(15 * 10i128.pow(35)),
crate::int::types::Int::<16>::from_i128(3141) * p36,
];
for raw in raws {
for mode in ALL_MODES {
assert_eq!(
super::forward_rung::sin_strict::<Core, 153, G>(raw, mode),
crate::algos::support::wide_trig_core::sin_series::<Core, 153>(raw, mode),
"sin raw={raw:?} mode {mode:?}"
);
assert_eq!(
super::forward_rung::cos_strict::<Core, 153, G>(raw, mode),
crate::algos::support::wide_trig_core::cos_series::<Core, 153>(raw, mode),
"cos raw={raw:?} mode {mode:?}"
);
assert_eq!(
super::forward_rung::tan_strict::<Core, 153, G, true, true>(raw, mode),
crate::algos::support::wide_trig_core::tan_series::<Core, 153>(raw, mode),
"tan raw={raw:?} mode {mode:?}"
);
assert_eq!(
super::forward_rung::atan_strict::<Core, 153, G, true>(raw, mode),
crate::algos::support::wide_trig_core::atan_series::<Core, 153>(raw, mode),
"atan raw={raw:?} mode {mode:?}"
);
assert_eq!(
super::inverse_rung::asin_strict::<Core, 153>(raw, mode),
crate::algos::trig::inverse_schoolbook::asin_schoolbook::<Core, 153>(raw, mode),
"asin raw={raw:?} mode {mode:?}"
);
assert_eq!(
super::hyper_rung::sinh_strict::<Core, 153>(raw, mode),
crate::algos::trig::hyper_schoolbook::sinh_schoolbook::<Core, 153>(raw, mode),
"sinh raw={raw:?} mode {mode:?}"
);
assert_eq!(
super::hyper_rung::tanh_strict::<Core, 153>(raw, mode),
crate::algos::trig::hyper_schoolbook::tanh_schoolbook::<Core, 153>(raw, mode),
"tanh raw={raw:?} mode {mode:?}"
);
assert_eq!(
super::extra_rung::asinh_strict::<Core, 153>(raw, mode),
crate::algos::trig::hyper_schoolbook::asinh_schoolbook::<Core, 153>(raw, mode),
"asinh raw={raw:?} mode {mode:?}"
);
assert_eq!(
super::extra_rung::atanh_strict::<Core, 153>(raw, mode),
crate::algos::trig::hyper_schoolbook::atanh_schoolbook::<Core, 153>(raw, mode),
"atanh raw={raw:?} mode {mode:?}"
);
assert_eq!(
crate::policy::exp::series_at_rung::<Core, 153>(raw, mode),
crate::algos::support::wide_trig_core::exp_series::<Core, 153>(raw, mode),
"exp raw={raw:?} mode {mode:?}"
);
}
}
}
#[test]
#[cfg(feature = "d1232")]
fn d1232_s616_tiny_argument_rung_matches_tier() {
type Core = crate::types::widths::wide_trig_d1232::Core;
const G: u32 =
<Core as crate::algos::support::wide_trig_core::WideTrigCore>::GUARD;
let p36 = crate::int::types::Int::<64>::from_i128(10i128.pow(36));
let raws = [
crate::int::types::Int::<64>::from_i128(3 * 10i128.pow(35)),
p36,
crate::int::types::Int::<64>::from_i128(15 * 10i128.pow(35)),
];
for raw in raws {
for mode in ALL_MODES {
assert_eq!(
super::forward_rung::sin_strict::<Core, 616, G>(raw, mode),
crate::algos::support::wide_trig_core::sin_series::<Core, 616>(raw, mode),
"sin raw={raw:?} mode {mode:?}"
);
assert_eq!(
super::forward_rung::atan_strict::<Core, 616, G, true>(raw, mode),
crate::algos::support::wide_trig_core::atan_series::<Core, 616>(raw, mode),
"atan raw={raw:?} mode {mode:?}"
);
assert_eq!(
super::hyper_rung::sinh_strict::<Core, 616>(raw, mode),
crate::algos::trig::hyper_schoolbook::sinh_schoolbook::<Core, 616>(raw, mode),
"sinh raw={raw:?} mode {mode:?}"
);
assert_eq!(
super::extra_rung::asinh_strict::<Core, 616>(raw, mode),
crate::algos::trig::hyper_schoolbook::asinh_schoolbook::<Core, 616>(raw, mode),
"asinh raw={raw:?} mode {mode:?}"
);
}
}
}
#[cfg(all(test, any(feature = "d307", feature = "d1232")))]
macro_rules! bench_grid_cell {
($Core:ty, $N:literal, $SCALE:literal, $with_big:expr) => {{
type C = $Core;
const G: u32 = <C as crate::algos::support::wide_trig_core::WideTrigCore>::GUARD;
let p = crate::int::types::Int::<$N>::from_i128(10i128).pow(($SCALE as u32).min(36));
let ten = crate::int::types::Int::<$N>::from_i128(10);
let i = |n: i128| crate::int::types::Int::<$N>::from_i128(n);
let mut fwd = vec![p * i(3) / ten, p, p + (p >> 1), p * i(3141)];
if $with_big {
fwd.push(p * i(1_000_000_000));
}
for raw in fwd {
for mode in ALL_MODES {
assert_eq!(
super::forward_rung::sin_strict::<C, $SCALE, G>(raw, mode),
crate::algos::support::wide_trig_core::sin_series::<C, $SCALE>(raw, mode),
"sin s{} raw={raw:?} mode {mode:?}", $SCALE
);
assert_eq!(
super::forward_rung::cos_strict::<C, $SCALE, G>(raw, mode),
crate::algos::support::wide_trig_core::cos_series::<C, $SCALE>(raw, mode),
"cos s{} raw={raw:?} mode {mode:?}", $SCALE
);
assert_eq!(
super::forward_rung::tan_strict::<C, $SCALE, G, true, true>(raw, mode),
crate::algos::support::wide_trig_core::tan_series::<C, $SCALE>(raw, mode),
"tan s{} raw={raw:?} mode {mode:?}", $SCALE
);
assert_eq!(
super::forward_rung::atan_strict::<C, $SCALE, G, true>(raw, mode),
crate::algos::support::wide_trig_core::atan_series::<C, $SCALE>(raw, mode),
"atan s{} raw={raw:?} mode {mode:?}", $SCALE
);
}
}
for raw in [p * i(3) / ten, p * i(9) / ten, p] {
for mode in ALL_MODES {
assert_eq!(
super::inverse_rung::asin_strict::<C, $SCALE>(raw, mode),
crate::algos::trig::inverse_schoolbook::asin_schoolbook::<C, $SCALE>(raw, mode),
"asin s{} raw={raw:?} mode {mode:?}", $SCALE
);
}
}
let mut small = vec![p * i(3) / ten, p, p + (p >> 1), p * i(9) + (p >> 1)];
if $with_big {
small.push(p * i(50));
}
for raw in small {
for mode in ALL_MODES {
assert_eq!(
super::hyper_rung::sinh_strict::<C, $SCALE>(raw, mode),
crate::algos::trig::hyper_schoolbook::sinh_schoolbook::<C, $SCALE>(raw, mode),
"sinh s{} raw={raw:?} mode {mode:?}", $SCALE
);
assert_eq!(
crate::policy::exp::series_at_rung::<C, $SCALE>(raw, mode),
crate::algos::support::wide_trig_core::exp_series::<C, $SCALE>(raw, mode),
"exp s{} raw={raw:?} mode {mode:?}", $SCALE
);
assert_eq!(
super::extra_rung::asinh_strict::<C, $SCALE>(raw, mode),
crate::algos::trig::hyper_schoolbook::asinh_schoolbook::<C, $SCALE>(raw, mode),
"asinh s{} raw={raw:?} mode {mode:?}", $SCALE
);
}
}
}};
}
#[test]
#[cfg(feature = "d307")]
fn d307_bench_grid_rung_matches_tier() {
type Core = crate::types::widths::wide_trig_d307::Core;
bench_grid_cell!(Core, 16, 0, true);
bench_grid_cell!(Core, 16, 76, false);
bench_grid_cell!(Core, 16, 153, false);
bench_grid_cell!(Core, 16, 229, false);
bench_grid_cell!(Core, 16, 306, false);
}
#[test]
#[cfg(feature = "d1232")]
fn d1232_bench_grid_rung_matches_tier() {
type Core = crate::types::widths::wide_trig_d1232::Core;
bench_grid_cell!(Core, 64, 0, true);
bench_grid_cell!(Core, 64, 308, false);
bench_grid_cell!(Core, 64, 616, false);
bench_grid_cell!(Core, 64, 924, false);
bench_grid_cell!(Core, 64, 1231, false);
}
#[test]
#[cfg(feature = "d462")]
fn d462_s461_hyper_deep_cubic_default_with_symmetry() {
use crate::int::types::Int;
let raw = Int::<24>::from_i128(10).pow(293);
let one = Int::<24>::from_i128(1);
let x = crate::D::<Int<24>, 461>(raw);
for mode in ALL_MODES {
let nearest = crate::support::rounding::is_nearest_mode(mode);
let expand = if nearest {
raw
} else {
match mode {
crate::support::rounding::RoundingMode::Ceiling => raw + one,
_ => raw,
}
};
let compress = if nearest {
raw
} else {
match mode {
crate::support::rounding::RoundingMode::Ceiling => raw,
_ => raw - one,
}
};
assert_eq!(x.sinh_strict_with(mode).0, expand, "sinh mode {mode:?}");
assert_eq!(super::sinh_dispatch::<24, 461>(raw, mode), expand, "sinh dispatch {mode:?}");
assert_eq!(x.tanh_strict_with(mode).0, compress, "tanh mode {mode:?}");
assert_eq!(super::tanh_dispatch::<24, 461>(raw, mode), compress, "tanh dispatch {mode:?}");
assert_eq!(x.asinh_strict_with(mode).0, compress, "asinh mode {mode:?}");
assert_eq!(super::asinh_dispatch::<24, 461>(raw, mode), compress, "asinh dispatch {mode:?}");
assert_eq!(x.atanh_strict_with(mode).0, expand, "atanh mode {mode:?}");
assert_eq!(super::atanh_dispatch::<24, 461>(raw, mode), expand, "atanh dispatch {mode:?}");
}
let half = Int::<24>::from_i128(5) * Int::<24>::from_i128(10).pow(460);
for v in [raw, half] {
let y = crate::D::<Int<24>, 461>(v);
let m = crate::support::rounding::DEFAULT_ROUNDING_MODE;
assert_eq!(y.sinh_strict(), y.sinh_strict_with(m), "sinh default");
assert_eq!(y.cosh_strict(), y.cosh_strict_with(m), "cosh default");
assert_eq!(y.tanh_strict(), y.tanh_strict_with(m), "tanh default");
assert_eq!(y.asinh_strict(), y.asinh_strict_with(m), "asinh default");
assert_eq!(y.atanh_strict(), y.atanh_strict_with(m), "atanh default");
let z = crate::D::<Int<24>, 461>(v + Int::<24>::from_i128(10).pow(461)); assert_eq!(z.acosh_strict(), z.acosh_strict_with(m), "acosh default");
}
}
#[test]
#[cfg(feature = "d307")]
fn d307_inverse_rung_matches_tier_kernels() {
type Core = crate::types::widths::wide_trig_d307::Core;
for v in ["0", "0.25", "0.6", "0.9", "1", "-0.6", "-1"] {
let x: crate::D307<19> = v.parse().unwrap();
for mode in ALL_MODES {
assert_eq!(
super::inverse_rung::asin_strict::<Core, 19>(x.to_bits(), mode),
crate::algos::trig::inverse_schoolbook::asin_schoolbook::<Core, 19>(x.to_bits(), mode),
"asin({v}) mode {mode:?}"
);
assert_eq!(
super::inverse_rung::acos_strict::<Core, 19>(x.to_bits(), mode),
crate::algos::trig::inverse_schoolbook::acos_schoolbook::<Core, 19>(x.to_bits(), mode),
"acos({v}) mode {mode:?}"
);
}
}
for (y, x) in [
("1", "1"),
("1", "-1"),
("-1", "1"),
("-1", "-1"),
("0.5", "2"),
("2", "0.5"),
("1", "0"),
("0", "1"),
("1000000000", "1"),
] {
let yd: crate::D307<19> = y.parse().unwrap();
let xd: crate::D307<19> = x.parse().unwrap();
for mode in ALL_MODES {
assert_eq!(
super::inverse_rung::atan2_strict::<Core, 19>(yd.to_bits(), xd.to_bits(), mode),
crate::algos::trig::inverse_schoolbook::atan2_schoolbook::<Core, 19>(yd.to_bits(), xd.to_bits(), mode),
"atan2({y}, {x}) mode {mode:?}"
);
}
}
}
#[test]
#[cfg(feature = "d307")]
fn d307_hyper_rung_matches_tier_kernels() {
type Core = crate::types::widths::wide_trig_d307::Core;
for v in ["0", "0.3", "1", "1.5", "9.9", "-1", "-9.9", "50"] {
let x: crate::D307<19> = v.parse().unwrap();
for mode in ALL_MODES {
assert_eq!(
super::hyper_rung::sinh_strict::<Core, 19>(x.to_bits(), mode),
crate::algos::trig::hyper_schoolbook::sinh_schoolbook::<Core, 19>(x.to_bits(), mode),
"sinh({v}) mode {mode:?}"
);
assert_eq!(
super::hyper_rung::cosh_strict::<Core, 19>(x.to_bits(), mode),
crate::algos::trig::hyper_schoolbook::cosh_schoolbook::<Core, 19>(x.to_bits(), mode),
"cosh({v}) mode {mode:?}"
);
assert_eq!(
super::hyper_rung::tanh_strict::<Core, 19>(x.to_bits(), mode),
crate::algos::trig::hyper_schoolbook::tanh_schoolbook::<Core, 19>(x.to_bits(), mode),
"tanh({v}) mode {mode:?}"
);
}
}
}
#[test]
#[cfg(feature = "d307")]
fn d307_extra_rung_matches_tier_kernels() {
type Core = crate::types::widths::wide_trig_d307::Core;
for v in ["0", "0.5", "1", "2", "1000000000", "-0.5", "-2"] {
let x: crate::D307<19> = v.parse().unwrap();
for mode in ALL_MODES {
assert_eq!(
super::extra_rung::asinh_strict::<Core, 19>(x.to_bits(), mode),
crate::algos::trig::hyper_schoolbook::asinh_schoolbook::<Core, 19>(x.to_bits(), mode),
"asinh({v}) mode {mode:?}"
);
}
}
for v in ["1", "1.0000000000000000001", "1.5", "2", "1000", "1000000000"] {
let x: crate::D307<19> = v.parse().unwrap();
for mode in ALL_MODES {
assert_eq!(
super::extra_rung::acosh_strict::<Core, 19>(x.to_bits(), mode),
crate::algos::trig::hyper_schoolbook::acosh_schoolbook::<Core, 19>(x.to_bits(), mode),
"acosh({v}) mode {mode:?}"
);
}
}
for v in ["0", "0.5", "0.9999999999999999999", "-0.9999999999999999999", "-0.5"] {
let x: crate::D307<19> = v.parse().unwrap();
for mode in ALL_MODES {
assert_eq!(
super::extra_rung::atanh_strict::<Core, 19>(x.to_bits(), mode),
crate::algos::trig::hyper_schoolbook::atanh_schoolbook::<Core, 19>(x.to_bits(), mode),
"atanh({v}) mode {mode:?}"
);
}
}
}
}