assert_is_derivative

Macro assert_is_derivative 

Source
macro_rules! assert_is_derivative {
    ($f:expr, $f_prime:expr, $norm:expr, $domain:expr $(, f_lbl = $f_lbl:literal)? $(, fprime_lbl = $fprime_lbl:literal)?) => { ... };
}
Expand description

Asserts that one polynomial is the derivative of another over a specified domain.

This macro checks that the derivative of f matches f_prime at multiple points within the given domain.

If the assertion fails, a plot showing both functions will be generated in <target/test_output>.

§Arguments

  • $f - The original polynomial function.
  • $f_prime - The polynomial function that should be the derivative of $f.
  • $norm - The domain normalizer used for both polynomials. Use DomainNormalizer::default() if none.
  • $domain - The range of x-values over which to check the derivative relationship. (inclusive range)

§Panics

Panics if the derivative relationship does not hold within a reasonable tolerance.