SINPI (The GNU Fortran Compiler)

### 8.262 `SINPI` — Circular sine function ¶

Description:

  `SINPI(X)` computes \sin(\pi x) without performing an explicit multiplication by \pi. This is achieved through argument reduction where |x| = n + r with n an integer and 0 \leq r \le 1. Due to the properties of floating-point arithmetic, the useful range for X is defined by `ABS(X) <= REAL(2,KIND(X))**DIGITS(X)`.

Standard:

  Fortran 2023

Class:

  Elemental function

Syntax:

  `RESULT = SINPI(X)`

Arguments:

  X | The type shall be `REAL`.

Return value:

  The return value is of the same type and kind as X. The result is in half-revolutions and satisfies -1 \leq \sinpi (x) \leq 1.

Example:

      program test_sinpi
        real :: x = 0.0
        x = sinpi(x)
      end program test_sinpi

See also:

  `ASINPI` — Circular arc sine function
  `SIN` — Sine function