Write a NumPy program to compute logarithm of the sum of exponentiations of the inputs, sum of exponentiations of the inputs in base-2
- برمجة بايثون
- 2021-09-13
- mhanasmh00489829403
الأجوبة
import numpy as np
l1 = np.log(1e-50)
l2 = np.log(2.5e-50)
print("Logarithm of the sum of exponentiations:")
print(np.logaddexp(l1, l2))
print("Logarithm of the sum of exponentiations of the inputs in base-2:")
print(np.logaddexp2(l1, l2))
Sample Output:
Logarithm of the sum of exponentiations: -113.876491681 Logarithm of the sum of exponentiations of the inputs in base-2: -113.599555228
أسئلة مشابهة
القوائم الدراسية التي ينتمي لها السؤال