Skip to main content

c

Function c 

Source
pub(crate) fn c<L: Limbs>(
    a: &L,
    b: &(Choice, L),
    negative_discriminant_abs: &L,
) -> L
Expand description

Calculate c such that b^2 - 4ac = delta.

The following bounds are present:

  • delta < 0
  • There is an integer solution for c in b^2 - 4 a c = delta.
  • <_ as AsRef<[Limb]>>::as_ref(a).len() <= <_ as AsRef<[Limb]>>::as_ref(&b.1).len()
  • <_ as AsRef<[Limb]>>::as_ref(negative_discriminant_abs).len() <= 2 * <_ as AsRef<[Limb]>>::as_ref(&b.1).len()
  • b < 2a
  • $floor(log_2(|delta|)) + 1 < <_ as AsRef<Limb>>::as_ref(a).len() * Limb::BITS$
  • $floor(log_2(|a|)) + 1 < <_ as AsRef<Limb>>::as_ref(a).len() * Limb::BITS$

delta is specified via its absolute value in negative_discriminant_abs.