// Copyright Maksym Zhelyeznyakov 2025-2026. // Distributed under the Boost Software License, Version 1.0. // (See accompanying file LICENSE_1_0.txt or copy at // https://www.boost.org/LICENSE_1_0.txt) #ifndef REVERSE_MODE_AUTODIFF_COMPARISON_OPERATOR_OVERLOADS_HPP #define REVERSE_MODE_AUTODIFF_COMPARISON_OPERATOR_OVERLOADS_HPP #include namespace boost { namespace math { namespace differentiation { namespace reverse_mode { template bool operator==(const expression &lhs, const expression &rhs) { return lhs.evaluate() == rhs.evaluate(); } template::value>::type> bool operator==(const expression &lhs, const RealType2 &rhs) { return lhs.evaluate() == static_cast(rhs); } template::value>::type> bool operator==(const RealType2 &lhs, const expression &rhs) { return lhs == rhs.evaluate(); } template bool operator!=(const expression &lhs, const expression &rhs) { return lhs.evaluate() != rhs.evaluate(); } template::value>::type> bool operator!=(const expression &lhs, const RealType2 &rhs) { return lhs.evaluate() != rhs; } template::value>::type> bool operator!=(const RealType2 &lhs, const expression &rhs) { return lhs != rhs.evaluate(); } template bool operator<(const expression &lhs, const expression &rhs) { return lhs.evaluate() < rhs.evaluate(); } template::value>::type> bool operator<(const expression &lhs, const RealType2 &rhs) { return lhs.evaluate() < rhs; } template::value>::type> bool operator<(const RealType2 &lhs, const expression &rhs) { return lhs < rhs.evaluate(); } template bool operator>(const expression &lhs, const expression &rhs) { return lhs.evaluate() > rhs.evaluate(); } template::value>::type> bool operator>(const expression &lhs, const RealType2 &rhs) { return lhs.evaluate() > rhs; } template::value>::type> bool operator>(const RealType2 &lhs, const expression &rhs) { return lhs > rhs.evaluate(); } template bool operator<=(const expression &lhs, const expression &rhs) { return lhs.evaluate() <= rhs.evaluate(); } template::value>::type> bool operator<=(const expression &lhs, const RealType2 &rhs) { return lhs.evaluate() <= rhs; } template::value>::type> bool operator<=(const RealType2 &lhs, const expression &rhs) { return lhs <= rhs.evaluate(); } template bool operator>=(const expression &lhs, const expression &rhs) { return lhs.evaluate() >= rhs.evaluate(); } template::value>::type> bool operator>=(const expression &lhs, const RealType2 &rhs) { return lhs.evaluate() >= rhs; } template::value>::type> bool operator>=(const RealType2 &lhs, const expression &rhs) { return lhs >= rhs.evaluate(); } } // namespace reverse_mode } // namespace differentiation } // namespace math } // namespace boost #endif // REVERSE_MODE_AUTODIFF_COMPARISON_OPERATOR_OVERLOADS_HPP