// Standard C++ <cmath> header
// Copyright (C) Florian Negele

// This file is part of the Eigen Compiler Suite.

// The ECS is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.

// The ECS is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.

// Under Section 7 of the GNU General Public License version 3,
// the copyright holder grants you additional permissions to use
// this file as described in the ECS Runtime Support Exception.

// You should have received a copy of the GNU General Public License
// and a copy of the ECS Runtime Support Exception along with
// the ECS.  If not, see <https://www.gnu.org/licenses/>.

#ifndef ECS_CPP_CMATH_HEADER_INCLUDED
#define ECS_CPP_CMATH_HEADER_INCLUDED

#define __cpp_lib_constexpr_cmath 202202L
#define __cpp_lib_hypot 201603L
#define __cpp_lib_interpolate 201902L
#define __cpp_lib_math_special_functions 201603L

namespace std
{
	extern "C" auto copysign [[ecs::pure]] (double, double) -> double;
	extern "C" auto copysignf [[ecs::pure]] (float, float) -> float;
	extern "C" auto copysignl [[ecs::pure]] (long double, long double) -> long double;
	extern "C" auto cos [[ecs::pure]] (double) -> double;
	extern "C" auto cosf [[ecs::pure]] (float) -> float;
	extern "C" auto cosl [[ecs::pure]] (long double) -> long double;
	extern "C" auto fabs [[ecs::pure]] (double) -> double;
	extern "C" auto fabsf [[ecs::pure]] (float) -> float;
	extern "C" auto fabsl [[ecs::pure]] (long double) -> long double;
	extern "C" auto floor [[ecs::pure]] (double) -> double;
	extern "C" auto floorf [[ecs::pure]] (float) -> float;
	extern "C" auto floorl [[ecs::pure]] (long double) -> long double;
	extern "C" auto fma [[ecs::pure]] (double, double, double) -> double;
	extern "C" auto fmaf [[ecs::pure]] (float, float, float) -> float;
	extern "C" auto fmal [[ecs::pure]] (long double, long double, long double) -> long double;
	extern "C" auto fmax [[ecs::pure]] (double, double) -> double;
	extern "C" auto fmaxf [[ecs::pure]] (float, float) -> float;
	extern "C" auto fmaxl [[ecs::pure]] (long double, long double) -> long double;
	extern "C" auto fmin [[ecs::pure]] (double, double) -> double;
	extern "C" auto fminf [[ecs::pure]] (float, float) -> float;
	extern "C" auto fminl [[ecs::pure]] (long double, long double) -> long double;
	extern "C" auto sin [[ecs::pure]] (double) -> double;
	extern "C" auto sinf [[ecs::pure]] (float) -> float;
	extern "C" auto sinl [[ecs::pure]] (long double) -> long double;
	extern "C" auto sqrt [[ecs::pure]] (double) -> double;
	extern "C" auto sqrtf [[ecs::pure]] (float) -> float;
	extern "C" auto sqrtl [[ecs::pure]] (long double) -> long double;
	extern "C" auto tan [[ecs::pure]] (double) -> double;
	extern "C" auto tanf [[ecs::pure]] (float) -> float;
	extern "C" auto tanl [[ecs::pure]] (long double) -> long double;

	auto isfinite [[ecs::pure]] (double) -> bool;
	auto isfinite [[ecs::pure]] (float) -> bool;
	auto isfinite [[ecs::pure]] (long double) -> bool;
	auto isinf [[ecs::pure]] (double) -> bool;
	auto isinf [[ecs::pure]] (float) -> bool;
	auto isinf [[ecs::pure]] (long double) -> bool;
	auto isnan [[ecs::pure]] (double) -> bool;
	auto isnan [[ecs::pure]] (float) -> bool;
	auto isnan [[ecs::pure]] (long double) -> bool;
	auto isnormal [[ecs::pure]] (double) -> bool;
	auto isnormal [[ecs::pure]] (float) -> bool;
	auto isnormal [[ecs::pure]] (long double) -> bool;
	auto signbit [[ecs::pure]] (double) -> bool;
	auto signbit [[ecs::pure]] (float) -> bool;
	auto signbit [[ecs::pure]] (long double) -> bool;
}

#endif // ECS_CPP_CMATH_HEADER_INCLUDED
