use once_cell::sync::Lazy;
use rug::{Complex, Float};
use std::{collections::HashSet, sync::OnceLock};
use super::primitive::{complex, float};
pub static ZERO: Lazy<Float> = Lazy::new(|| float(0));
pub static ONE: Lazy<Float> = Lazy::new(|| float(1));
pub static ONE_HALF: Lazy<Float> = Lazy::new(|| float(1) / float(2));
pub static TWO: Lazy<Float> = Lazy::new(|| float(2));
pub static TEN: Lazy<Float> = Lazy::new(|| float(10));
pub static I: Lazy<Complex> = Lazy::new(|| complex((0, 1)));
pub static E: Lazy<Float> = Lazy::new(|| float(1).exp());
pub static PHI: Lazy<Float> = Lazy::new(|| (float(1) + float(5).sqrt()) / float(2));
pub static PI: Lazy<Float> = Lazy::new(|| float(-1).acos());
pub static TAU: Lazy<Float> = Lazy::new(|| float(2) * &*PI);
#[cfg(feature = "numerical")]
pub fn all() -> &'static HashSet<&'static str> {
static CONSTS: OnceLock<HashSet<&'static str>> = OnceLock::new();
CONSTS.get_or_init(|| {
HashSet::from(["i", "e", "phi", "pi", "tau"])
})
}