pub(crate) const EPS: f64 = f64::EPSILON;
pub(crate) const REALMIN: f64 = f64::MIN_POSITIVE;
pub(crate) const REALMAX: f64 = f64::MAX;
pub(crate) const FUNCMAX: f64 = 1.0e30;
pub(crate) const BOUNDMAX: f64 = 0.25 * REALMAX;
#[allow(dead_code)] pub(crate) const SYMTOL: f64 = 1.0e-10;
pub(crate) const RHOBEG_DFT: f64 = 1.0;
pub(crate) const RHOEND_DFT: f64 = 1.0e-6;
pub(crate) const MAXFUN_DIM_DFT: usize = 500;
pub(crate) const ETA1_DFT: f64 = 0.1; pub(crate) const ETA2_DFT: f64 = 0.7; pub(crate) const GAMMA1_DFT: f64 = 0.5; pub(crate) const GAMMA2_DFT: f64 = 2.0;
pub(crate) const INFO_DFT: i32 = 0;
pub(crate) const SMALL_TR_RADIUS: i32 = 0; pub(crate) const FTARGET_ACHIEVED: i32 = 1;
#[allow(dead_code)] pub(crate) const TRSUBP_FAILED: i32 = 2;
pub(crate) const MAXFUN_REACHED: i32 = 3;
pub(crate) const MAXTR_REACHED: i32 = 20;
pub(crate) const NAN_INF_X: i32 = -1;
pub(crate) const NAN_INF_F: i32 = -2;
pub(crate) const NAN_INF_MODEL: i32 = -3;
#[allow(dead_code)] pub(crate) const NO_SPACE_BETWEEN_BOUNDS: i32 = 6;
pub(crate) const DAMAGING_ROUNDING: i32 = 7;
#[cfg(test)]
mod tests {
use super::*;
#[test]
#[allow(clippy::manual_clamp, clippy::unnecessary_min_or_max)]
fn funcmax_matches_the_fortran_formula_for_f64() {
assert_eq!(FUNCMAX, 10.0_f64.powi(30.min(307 / 2).max(4)));
}
#[test]
fn boundmax_is_a_quarter_of_realmax() {
assert_eq!(BOUNDMAX, f64::MAX / 4.0);
}
}