arrayfire / arrayfire-binary-python-wrapper

A python thin wrapper for ArrayFire library
https://arrayfire.com
BSD 3-Clause "New" or "Revised" License
2 stars 5 forks source link

Log and Exponent Testing #33

Closed AzeezIsh closed 4 months ago

AzeezIsh commented 5 months ago

The test suite validates mathematical operations for log and exponential functions within the mathematical functions directory. Tests are organized around several key functions: cube root (cbrt), error function (erf), complementary error function (erfc), exponentiation (exp), exponent minus one (expm1), factorial (fac), natural logarithm (log), base-10 logarithm (log10), natural logarithm of 1 plus input (log1p), base-2 logarithm (log2), power (pow), root, 2 raised to the power of input (pow2), reciprocal square root (rsqrt), square root (sqrt), gamma function (tgamma), and sigmoid. Each function has the following tests:

Functionality Across Shapes and Types: The library correctly handles arrays of varying dimensions—from scalars to four-dimensional arrays—across all supported data types in the dtype_map, including integers, floating-point numbers, and boolean types.

Error Handling for Unsupported Types: It robustly raises errors when attempting operations with unsupported data types, specifically complex numbers and 64-bit floats, ensuring the library's stability by preventing undefined behavior.

Precision: Each mathematical operation is verified to perform accurately across the supported input shapes and data types, with special attention to the handling of edge cases