@@ -1355,15 +1355,15 @@ def cumlogsumexp(
1355
1355
)
1356
1356
1357
1357
1358
- _LOG_DOCSTRING = """
1359
- Computes the natural logarithm for each element `x_i` of input array `x`.
1358
+ _LOG_DOCSTRING = r """
1359
+ Computes the natural logarithm for each element :math: `x_i` of input array `x`.
1360
1360
1361
1361
For full documentation refer to :obj:`numpy.log`.
1362
1362
1363
1363
Parameters
1364
1364
----------
1365
1365
x : {dpnp.ndarray, usm_ndarray}
1366
- Input array, expected to have numeric data type.
1366
+ Input array, expected to have a floating-point data type.
1367
1367
out : {None, dpnp.ndarray, usm_ndarray}, optional
1368
1368
Output array to populate.
1369
1369
Array must have the correct shape and the expected data type.
@@ -1377,9 +1377,8 @@ def cumlogsumexp(
1377
1377
Returns
1378
1378
-------
1379
1379
out : dpnp.ndarray
1380
- An array containing the element-wise natural logarithm values.
1381
- The data type of the returned array is determined by the Type
1382
- Promotion Rules.
1380
+ An array containing the element-wise natural logarithm values. The data
1381
+ type of the returned array is determined by the Type Promotion Rules.
1383
1382
1384
1383
Limitations
1385
1384
-----------
@@ -1389,11 +1388,27 @@ def cumlogsumexp(
1389
1388
1390
1389
See Also
1391
1390
--------
1392
- :obj:`dpnp.log10` : Return the base 10 logarithm of the input array,
1393
- element-wise.
1394
- :obj:`dpnp.log2` : Base-2 logarithm of x.
1395
- :obj:`dpnp.log1p` : Return the natural logarithm of one plus
1396
- the input array, element-wise.
1391
+ :obj:`dpnp.log10` : Calculate :math:`\log_{10}(x)`, element-wise.
1392
+ :obj:`dpnp.log2` : Calculate :math:`\log_2(x)`, element-wise.
1393
+ :obj:`dpnp.log1p` : Calculate :math:`\log(1 + x)`, element-wise.
1394
+
1395
+ Notes
1396
+ -----
1397
+ :obj:`dpnp.log` is a multivalued function: for each `x` there are infinitely
1398
+ many numbers `z` such that :math:`e^z = x`. The convention is to return the `z`
1399
+ whose the imaginary part lies in the interval :math:`[-\pi, \pi]`.
1400
+
1401
+ For real-valued floating-point input data types, :obj:`dpnp.log` always returns
1402
+ real output. For each value that cannot be expressed as a real number or
1403
+ nfinity, it yields ``NaN``.
1404
+
1405
+ For complex floating-point input data types, :obj:`dpnp.log` is a complex
1406
+ analytic function that has, by convention, the branch cuts
1407
+ :math:`(-\infty, 0)` and is continuous from above on it.
1408
+
1409
+ In the cases where the input has a negative real part and a very small negative
1410
+ complex part (approaching 0), the result is so close to :math:`-\pi` that it
1411
+ evaluates to exactly :math:`-\pi`.
1397
1412
1398
1413
Examples
1399
1414
--------
@@ -1414,15 +1429,15 @@ def cumlogsumexp(
1414
1429
)
1415
1430
1416
1431
1417
- _LOG10_DOCSTRING = """
1418
- Computes the base-10 logarithm for each element `x_i` of input array `x`.
1432
+ _LOG10_DOCSTRING = r """
1433
+ Computes the base-10 logarithm for each element :math: `x_i` of input array `x`.
1419
1434
1420
1435
For full documentation refer to :obj:`numpy.log10`.
1421
1436
1422
1437
Parameters
1423
1438
----------
1424
1439
x : {dpnp.ndarray, usm_ndarray}
1425
- Input array, expected to have numeric data type.
1440
+ Input array, expected to have a floating-point data type.
1426
1441
out : {None, dpnp.ndarray, usm_ndarray}, optional
1427
1442
Output array to populate.
1428
1443
Array must have the correct shape and the expected data type.
@@ -1436,9 +1451,8 @@ def cumlogsumexp(
1436
1451
Returns
1437
1452
-------
1438
1453
out : dpnp.ndarray
1439
- An array containing the element-wise base-10 logarithm of `x`.
1440
- The data type of the returned array is determined by the
1441
- Type Promotion Rules.
1454
+ An array containing the element-wise base-10 logarithm of `x`. The data
1455
+ type of the returned array is determined by the Type Promotion Rules.
1442
1456
1443
1457
Limitations
1444
1458
-----------
@@ -1448,9 +1462,27 @@ def cumlogsumexp(
1448
1462
1449
1463
See Also
1450
1464
--------
1451
- :obj:`dpnp.log` : Natural logarithm, element-wise.
1452
- :obj:`dpnp.log2` : Return the base-2 logarithm of the input array, element-wise.
1453
- :obj:`dpnp.log1p` : Return the natural logarithm of one plus the input array, element-wise.
1465
+ :obj:`dpnp.log` : Calculate :math:`\log(x)`, element-wise.
1466
+ :obj:`dpnp.log2` : Calculate :math:`\log_2(x)`, element-wise.
1467
+ :obj:`dpnp.log1p` : Calculate :math:`\log(1 + x)`, element-wise.
1468
+
1469
+ Notes
1470
+ -----
1471
+ :obj:`dpnp.log10` is a multivalued function: for each `x` there are infinitely
1472
+ many numbers `z` such that :math:`10^z = x`. The convention is to return the `z`
1473
+ whose the imaginary part lies in the interval :math:`[-\pi, \pi]`.
1474
+
1475
+ For real-valued floating-point input data types, :obj:`dpnp.log10` always
1476
+ returns real output. For each value that cannot be expressed as a real number
1477
+ or nfinity, it yields ``NaN``.
1478
+
1479
+ For complex floating-point input data types, :obj:`dpnp.log10` is a complex
1480
+ analytic function that has, by convention, the branch cuts
1481
+ :math:`(-\infty, 0)` and is continuous from above on it.
1482
+
1483
+ In the cases where the input has a negative real part and a very small negative
1484
+ complex part (approaching 0), the result is so close to :math:`-\pi` that it
1485
+ evaluates to exactly :math:`-\pi`.
1454
1486
1455
1487
Examples
1456
1488
--------
@@ -1474,18 +1506,16 @@ def cumlogsumexp(
1474
1506
)
1475
1507
1476
1508
1477
- _LOG1P_DOCSTRING = """
1478
- Computes the natural logarithm of (1 + `x`) for each element `x_i` of input
1479
- array `x`.
1480
-
1481
- This function calculates `log(1 + x)` more accurately for small values of `x`.
1509
+ _LOG1P_DOCSTRING = r"""
1510
+ Computes the natural logarithm of (1 + `x`) for each element :math:`x_i` of
1511
+ input array `x`.
1482
1512
1483
1513
For full documentation refer to :obj:`numpy.log1p`.
1484
1514
1485
1515
Parameters
1486
1516
----------
1487
1517
x : {dpnp.ndarray, usm_ndarray}
1488
- Input array, expected to have numeric data type.
1518
+ Input array, expected to have a floating-point data type.
1489
1519
out : {None, dpnp.ndarray, usm_ndarray}, optional
1490
1520
Output array to populate.
1491
1521
Array must have the correct shape and the expected data type.
@@ -1499,8 +1529,8 @@ def cumlogsumexp(
1499
1529
Returns
1500
1530
-------
1501
1531
out : dpnp.ndarray
1502
- An array containing the element-wise ` log(1 + x)` results. The data type
1503
- of the returned array is determined by the Type Promotion Rules.
1532
+ An array containing the element-wise :math:`\ log(1 + x)` results. The data
1533
+ type of the returned array is determined by the Type Promotion Rules.
1504
1534
1505
1535
Limitations
1506
1536
-----------
@@ -1510,10 +1540,29 @@ def cumlogsumexp(
1510
1540
1511
1541
See Also
1512
1542
--------
1513
- :obj:`dpnp.expm1` : ``exp(x) - 1``, the inverse of :obj:`dpnp.log1p`.
1514
- :obj:`dpnp.log` : Natural logarithm, element-wise.
1515
- :obj:`dpnp.log10` : Return the base 10 logarithm of the input array, element-wise.
1516
- :obj:`dpnp.log2` : Return the base-2 logarithm of the input array, element-wise.
1543
+ :obj:`dpnp.expm1` : Calculate :math:`e^x - 1`, element-wise,
1544
+ the inverse of :obj:`dpnp.log1p`.
1545
+ :obj:`dpnp.log` : Calculate :math:`\log(x)`, element-wise.
1546
+ :obj:`dpnp.log10` : Calculate :math:`\log_{10}(x)`, element-wise.
1547
+ :obj:`dpnp.log2` : Calculate :math:`\log_2(x)`, element-wise.
1548
+
1549
+ Notes
1550
+ -----
1551
+ For real-valued floating-point input data types, :obj:`dpnp.log1p` provides
1552
+ greater precision than :math:`\log(1 + x)` for `x` so small that
1553
+ :math:`1 + x == 1`.
1554
+
1555
+ :obj:`dpnp.log1p` is a multivalued function: for each `x` there are infinitely
1556
+ many numbers `z` such that :math:`e^z = 1 + x`. The convention is to return the
1557
+ `z` whose the imaginary part lies in the interval :math:`[-\pi, \pi]`.
1558
+
1559
+ For real-valued floating-point input data types, :obj:`dpnp.log1p` always
1560
+ returns real output. For each value that cannot be expressed as a real number
1561
+ or nfinity, it yields ``NaN``.
1562
+
1563
+ For complex floating-point input data types, :obj:`dpnp.log1p` is a complex
1564
+ analytic function that has, by convention, the branch cuts
1565
+ :math:`(-\infty, 0)` and is continuous from above on it.
1517
1566
1518
1567
Examples
1519
1568
--------
@@ -1540,15 +1589,15 @@ def cumlogsumexp(
1540
1589
)
1541
1590
1542
1591
1543
- _LOG2_DOCSTRING = """
1544
- Computes the base-2 logarithm for each element `x_i` of input array `x`.
1592
+ _LOG2_DOCSTRING = r """
1593
+ Computes the base-2 logarithm for each element :math: `x_i` of input array `x`.
1545
1594
1546
1595
For full documentation refer to :obj:`numpy.log2`.
1547
1596
1548
1597
Parameters
1549
1598
----------
1550
1599
x : {dpnp.ndarray, usm_ndarray}
1551
- Input array, expected to have numeric data type.
1600
+ Input array, expected to have a floating-point data type.
1552
1601
out : {None, dpnp.ndarray, usm_ndarray}, optional
1553
1602
Output array to populate.
1554
1603
Array must have the correct shape and the expected data type.
@@ -1562,9 +1611,8 @@ def cumlogsumexp(
1562
1611
Returns
1563
1612
-------
1564
1613
out : dpnp.ndarray
1565
- An array containing the element-wise base-2 logarithm of `x`.
1566
- The data type of the returned array is determined by the
1567
- Type Promotion Rules.
1614
+ An array containing the element-wise base-2 logarithm of `x`. The data type
1615
+ of the returned array is determined by the Type Promotion Rules.
1568
1616
1569
1617
Limitations
1570
1618
-----------
@@ -1574,9 +1622,27 @@ def cumlogsumexp(
1574
1622
1575
1623
See Also
1576
1624
--------
1577
- :obj:`dpnp.log` : Natural logarithm, element-wise.
1578
- :obj:`dpnp.log10` : Return the base 10 logarithm of the input array, element-wise.
1579
- :obj:`dpnp.log1p` : Return the natural logarithm of one plus the input array, element-wise.
1625
+ :obj:`dpnp.log` : Calculate :math:`\log(x)`, element-wise.
1626
+ :obj:`dpnp.log10` : Calculate :math:`\log_{10}(x)`, element-wise.
1627
+ :obj:`dpnp.log1p` : Calculate :math:`\log(1 + x)`, element-wise.
1628
+
1629
+ Notes
1630
+ -----
1631
+ :obj:`dpnp.log2` is a multivalued function: for each `x` there are infinitely
1632
+ many numbers `z` such that :math:`2^z = x`. The convention is to return the `z`
1633
+ whose the imaginary part lies in the interval :math:`[-\pi, \pi]`.
1634
+
1635
+ For real-valued floating-point input data types, :obj:`dpnp.log2` always
1636
+ returns real output. For each value that cannot be expressed as a real number
1637
+ or nfinity, it yields ``NaN``.
1638
+
1639
+ For complex floating-point input data types, :obj:`dpnp.log2` is a complex
1640
+ analytic function that has, by convention, the branch cuts
1641
+ :math:`(-\infty, 0)` and is continuous from above on it.
1642
+
1643
+ In the cases where the input has a negative real part and a very small negative
1644
+ complex part (approaching 0), the result is so close to :math:`-\pi` that it
1645
+ evaluates to exactly :math:`-\pi`.
1580
1646
1581
1647
Examples
1582
1648
--------
0 commit comments