MCPcopy Create free account
hub / github.com/pydata/numexpr / nc_tan

Function nc_tan

numexpr3/complex_functions.hpp:1477–1514  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1475}
1476
1477static void
1478nc_tan( npy_intp n, npy_complex64 *x, npy_intp sb1, npy_complex64 *r)
1479{
1480 npy_float32 sr,cr,shi,chi;
1481 npy_float32 rs,is,rc,ic;
1482 npy_float32 d;
1483 if( sb1 == sizeof(npy_complex64) ) { // Aligned
1484 for( npy_intp I = 0; I < n; I++ ) {
1485 sr = sinf(x[I].real);
1486 cr = cosf(x[I].real);
1487 shi = sinhf(x[I].imag);
1488 chi = coshf(x[I].imag);
1489 rs = sr*chi;
1490 is = cr*shi;
1491 rc = cr*chi;
1492 ic = -sr*shi;
1493 d = rc*rc + ic*ic;
1494 r[I].real = (rs*rc+is*ic)/d;
1495 r[I].imag = (is*rc-rs*ic)/d;
1496 }
1497 }
1498 else {
1499 sb1 /= sizeof(npy_complex64);
1500 for( npy_intp I = 0; I < n; I++ ) {
1501 sr = sinf(x[I*sb1].real);
1502 cr = cosf(x[I*sb1].real);
1503 shi = sinhf(x[I*sb1].imag);
1504 chi = coshf(x[I*sb1].imag);
1505 rs = sr*chi;
1506 is = cr*shi;
1507 rc = cr*chi;
1508 ic = -sr*shi;
1509 d = rc*rc + ic*ic;
1510 r[I].real = (rs*rc+is*ic)/d;
1511 r[I].imag = (is*rc-rs*ic)/d;
1512 }
1513 }
1514}
1515
1516static void
1517nc_tan( npy_intp n, npy_complex128 *x, npy_intp sb1, npy_complex128 *r)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…