datafusion_functions/math/
bounds.rsuse datafusion_common::ScalarValue;
use datafusion_expr::interval_arithmetic::Interval;
pub(super) fn unbounded_bounds(input: &[&Interval]) -> crate::Result<Interval> {
let data_type = input[0].data_type();
Interval::make_unbounded(&data_type)
}
pub(super) fn sin_bounds(input: &[&Interval]) -> crate::Result<Interval> {
let data_type = input[0].data_type();
Interval::make_symmetric_unit_interval(&data_type)
}
pub(super) fn asin_bounds(input: &[&Interval]) -> crate::Result<Interval> {
let data_type = input[0].data_type();
Interval::make_symmetric_half_pi_interval(&data_type)
}
pub(super) fn atan_bounds(input: &[&Interval]) -> crate::Result<Interval> {
let data_type = input[0].data_type();
Interval::make_symmetric_half_pi_interval(&data_type)
}
pub(super) fn acos_bounds(input: &[&Interval]) -> crate::Result<Interval> {
let data_type = input[0].data_type();
Interval::try_new(
ScalarValue::new_zero(&data_type)?,
ScalarValue::new_pi_upper(&data_type)?,
)
}
pub(super) fn acosh_bounds(input: &[&Interval]) -> crate::Result<Interval> {
let data_type = input[0].data_type();
Interval::make_non_negative_infinity_interval(&data_type)
}
pub(super) fn cos_bounds(input: &[&Interval]) -> crate::Result<Interval> {
let data_type = input[0].data_type();
Interval::make_symmetric_unit_interval(&data_type)
}
pub(super) fn cosh_bounds(input: &[&Interval]) -> crate::Result<Interval> {
let data_type = input[0].data_type();
Interval::try_new(
ScalarValue::new_one(&data_type)?,
ScalarValue::try_from(&data_type)?,
)
}
pub(super) fn exp_bounds(input: &[&Interval]) -> crate::Result<Interval> {
let data_type = input[0].data_type();
Interval::make_non_negative_infinity_interval(&data_type)
}
pub(super) fn radians_bounds(input: &[&Interval]) -> crate::Result<Interval> {
let data_type = input[0].data_type();
Interval::make_symmetric_pi_interval(&data_type)
}
pub(super) fn sqrt_bounds(input: &[&Interval]) -> crate::Result<Interval> {
let data_type = input[0].data_type();
Interval::make_non_negative_infinity_interval(&data_type)
}
pub(super) fn tanh_bounds(input: &[&Interval]) -> crate::Result<Interval> {
let data_type = input[0].data_type();
Interval::make_symmetric_unit_interval(&data_type)
}