numberOfRealRootsInInterval: Number of real roots in an interval

View source: R/numberOfRealRoots.R

numberOfRealRootsInIntervalR Documentation

Number of real roots in an interval

Description

Number of distinct real roots of a univariate polynomial in a given interval.

Usage

numberOfRealRootsInInterval(qspray, lower, upper, closed = TRUE)

Arguments

qspray

a univariate qspray polynomial

lower, upper

the bounds of the interval, bigq numbers or objects coercible to bigq numbers, and it is also possible to set lower = -Inf and upper = Inf

closed

Boolean, whether to consider the interval is closed or open

Value

An integer, the number of real roots of the polynomial in the interval.

Note

The roots are not counted with their multiplicity.

Examples

library(resultant)
x <- qlone(1)
P <- 2*x^4 + x^3 - 3*x^2 - x + 1
numberOfRealRootsInInterval(P, 0, 1)

resultant documentation built on Sept. 11, 2024, 8:01 p.m.