#![cfg(any(feature = "d1232", feature = "xx-wide"))]
#![allow(dead_code)]
use crate::types::widths::wide_trig_d1232 as core;
use crate::support::rounding::RoundingMode;
use crate::wide_int::Int4096;
const GUARD_NARROW: u32 = crate::algos::exp::lookup_d1232_s610_620_tang::GUARD_FOR_HYPER;
#[inline]
fn ex_enx(v: core::W, w: u32) -> (core::W, core::W) {
let ex = crate::algos::exp::lookup_d1232_s610_620_tang::tang_exp_fixed(v, w);
let one_w = core::one(w);
let enx = core::div(one_w, ex, w);
(ex, enx)
}
#[inline]
#[must_use]
pub(crate) fn sinh_strict<const SCALE: u32>(raw: Int4096, mode: RoundingMode) -> Int4096 {
let w = SCALE + GUARD_NARROW;
let v = core::to_work_w(raw, GUARD_NARROW);
let (ex, enx) = ex_enx(v, w);
let two = core::lit(2);
let r = (ex - enx) / two;
core::round_to_storage_with(r, w, SCALE, mode)
}
#[inline]
#[must_use]
pub(crate) fn cosh_strict<const SCALE: u32>(raw: Int4096, mode: RoundingMode) -> Int4096 {
let w = SCALE + GUARD_NARROW;
let v = core::to_work_w(raw, GUARD_NARROW);
let (ex, enx) = ex_enx(v, w);
let two = core::lit(2);
let r = (ex + enx) / two;
core::round_to_storage_with(r, w, SCALE, mode)
}
#[inline]
#[must_use]
pub(crate) fn tanh_strict<const SCALE: u32>(raw: Int4096, mode: RoundingMode) -> Int4096 {
let w = SCALE + GUARD_NARROW;
let v = core::to_work_w(raw, GUARD_NARROW);
let (ex, enx) = ex_enx(v, w);
let r = core::div(ex - enx, ex + enx, w);
core::round_to_storage_with(r, w, SCALE, mode)
}