pub struct Ball { /* private fields */ }Expand description
Enclosure mid ± rad used to certify that a rounded midpoint is unique.
Implementations§
Source§impl Ball
impl Ball
Sourcepub fn new(mid: ExactNum, rad: ExactNum) -> Self
pub fn new(mid: ExactNum, rad: ExactNum) -> Self
mid ± rad. The radius is taken in absolute value.
Sourcepub fn add(&self, other: &Self, p: usize, rm: RoundingMode) -> Self
pub fn add(&self, other: &Self, p: usize, rm: RoundingMode) -> Self
Sum of two balls: midpoint add at precision p, radius r1+r2 plus a rounding ulp.
Sourcepub fn mul(&self, other: &Self, p: usize, rm: RoundingMode) -> Self
pub fn mul(&self, other: &Self, p: usize, rm: RoundingMode) -> Self
Product of two balls with a first-order radius bound plus a rounding ulp.
Sourcepub fn exp(&self, p: usize, rm: RoundingMode, cc: &mut Consts) -> Self
pub fn exp(&self, p: usize, rm: RoundingMode, cc: &mut Consts) -> Self
Exponential of a ball. exp is increasing; the radius uses
(\lvert\exp(m)\rvert(e^{r}-1)) plus a rounding ulp (same Up convention as add/mul).
Sourcepub fn sin(&self, p: usize, rm: RoundingMode, cc: &mut Consts) -> Self
pub fn sin(&self, p: usize, rm: RoundingMode, cc: &mut Consts) -> Self
Sine of a ball. (\lvert\sin’\rvert\le 1), so the image radius is at most rad
plus a rounding ulp.
Sourcepub fn cos(&self, p: usize, rm: RoundingMode, cc: &mut Consts) -> Self
pub fn cos(&self, p: usize, rm: RoundingMode, cc: &mut Consts) -> Self
Cosine of a ball. (\lvert\cos’\rvert\le 1).
Sourcepub fn ln(&self, p: usize, rm: RoundingMode, cc: &mut Consts) -> Self
pub fn ln(&self, p: usize, rm: RoundingMode, cc: &mut Consts) -> Self
Natural log of a ball. Domain: the ball must lie in ((0,+\infty)). Lipschitz (\lvert\ln’\rvert=1/x\le 1/(m-r)).
Sourcepub fn sqrt(&self, p: usize, rm: RoundingMode) -> Self
pub fn sqrt(&self, p: usize, rm: RoundingMode) -> Self
Square root of a ball. Domain: the ball must lie in ((0,+\infty)). Lipschitz (1/(2\sqrt{x})\le 1/(2\sqrt{m-r})).
Sourcepub fn erf(&self, p: usize, rm: RoundingMode, cc: &mut Consts) -> Self
pub fn erf(&self, p: usize, rm: RoundingMode, cc: &mut Consts) -> Self
Error function of a ball. (\lvert\mathrm{erf}’\rvert\le 2/\sqrt{\pi}).
Sourcepub fn bessel_j0(&self, p: usize, rm: RoundingMode, cc: &mut Consts) -> Self
pub fn bessel_j0(&self, p: usize, rm: RoundingMode, cc: &mut Consts) -> Self
(J_0) of a ball. (\lvert J_0’\rvert=\lvert J_1\rvert\le 1).
Sourcepub fn bessel_j1(&self, p: usize, rm: RoundingMode, cc: &mut Consts) -> Self
pub fn bessel_j1(&self, p: usize, rm: RoundingMode, cc: &mut Consts) -> Self
(J_1) of a ball. (\lvert J_1’\rvert=\lvert J_0-J_1/x\rvert\le 1+1/(\lvert m\rvert-r)) when the ball excludes (0).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Ball
impl RefUnwindSafe for Ball
impl Send for Ball
impl Sync for Ball
impl Unpin for Ball
impl UnsafeUnpin for Ball
impl UnwindSafe for Ball
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more