Questions tagged [exponential]

Exponential can refer to a mathematics function, a curve / graph / dataset that follows the growth of that function, the exponential distribution in statistics, or a format to represent floats.

Exponential can refer to a mathematics function, a curve / graph / dataset that follows the growth of that function, the exponential distribution in statistics, or a format to represent floats.

Definitions from wikipedia:

888 questions
101
votes
4 answers

Which function grows faster, exponential or factorial?

Which function grows faster, exponential (like 2^n, n^n, e^n etc) or factorial (n!)? Ps: I just read somewhere, n! grows faster than 2^n.
devsathish
  • 2,339
  • 2
  • 20
  • 16
53
votes
4 answers

Why do I get the 'loop of ufunc does not support argument 0 of type int' error for numpy.exp?

I have a dataframe and I'd like to perform exponential calculation on a subset of rows in a column. I've tried three versions of code and two of them worked. But I don't understand why one version gives me the error. import numpy as np Version 1…
user2830451
  • 2,126
  • 5
  • 25
  • 31
41
votes
5 answers

Real-world example of exponential time complexity

I'm looking for an intuitive, real-world example of a problem that takes (worst case) exponential time complexity to solve for a talk I am giving. Here are examples for other time complexities I have come up with (many of them taken from this SO…
del
  • 6,341
  • 10
  • 42
  • 45
37
votes
6 answers

Raise to the power in shell

How do you raise m to the power of n? I've searched for this everywhere. What I found was that writing m**n should work, but it doesn't. I'm using #!/bin/sh.
Linas
  • 560
  • 1
  • 5
  • 16
29
votes
4 answers

Exponential Operator in C++

I am taking a class in C++ and I noticed there are only a few math operators to use. I also noticed that C++ does not come with an exponential operator within its math library. Why must one always write a function for this? Is there a reason for…
James Hayek
  • 643
  • 3
  • 10
  • 35
24
votes
3 answers

Python Scientific Notation precision normalizing

My goal is simply to convert a string such as "1.2" to scientific notation without adding additional precision. The problem is that I always end up with superfluous 0s at the end of my output. >>> input = "1.2" >>> print…
Alex Pritchard
  • 4,260
  • 5
  • 33
  • 48
22
votes
2 answers

1e-9 or -1e9, which one is correct?

I am assigned some old code and when I was reading through it, I noticed it had these in the form of: float low = 1e-9; float high = 1e9; float lowB = 1e-9; float highB = 1e9; float lowL = 1e-9; float highL = 1e9; So I see that it's trying to…
Joan Venge
  • 315,713
  • 212
  • 479
  • 689
21
votes
4 answers

Does Pandas calculate ewm wrong?

When trying to calculate the exponential moving average (EMA) from financial data in a dataframe it seems that Pandas' ewm approach is incorrect. The basics are well explained in the following…
jeronimo
  • 241
  • 1
  • 2
  • 5
18
votes
2 answers

Estimating rate of occurrence of an event with exponential smoothing and irregular events

Imagine that I have a set of measurements of x that are taken by many processes x0 ... xN at times t0 ... tN. Let's assume that at time t I want to make an estimate of the current value of x, based on the assumption that there is no long term trend…
abligh
  • 24,573
  • 4
  • 47
  • 84
14
votes
5 answers

Fastest Implementation of Exponential Function Using AVX

I'm looking for an efficient (Fast) approximation of the exponential function operating on AVX elements (Single Precision Floating Point). Namely - __m256 _mm256_exp_ps( __m256 x ) without SVML. Relative Accuracy should be something like ~1e-6, or…
Royi
  • 4,640
  • 6
  • 46
  • 64
14
votes
1 answer

round exponential float to 2 decimals

I want to round exponential float to two decimal representation in Python. 4.311237638482733e-91 --> 4.31e-91 Do you know any quick trick to do that? Simple solutions like round(float, 2) and "%.2f"%float are not working with exponential…
Leszek
  • 1,290
  • 2
  • 11
  • 21
12
votes
1 answer

For three digit exponents Fortran drops the 'E' in the output

I'm just coming to Fortran90 from Python and, honestly, the hardest part so far has been getting used to the formatting codes for writing output. I've run across a formatting problem that I can't seem to google or fiddle my way out of, I have…
Dex
  • 345
  • 4
  • 13
11
votes
1 answer

Exponential Weighted Moving Average using Pandas

I need to confirm few thing related to pandas exponential weighted moving average function. If I have a data set df for which I need to find a 12 day exponential moving average, would the method below be…
user7616021
10
votes
2 answers

Pandas: Exponentially decaying sum with variable weights

Similar to this question Exponential Decay on Python Pandas DataFrame, I would like to quickly compute exponentially decaying sums for some columns in a data frame. However, the rows in the data frame are not evenly spaced in time. Hence while…
pythonic metaphor
  • 10,296
  • 18
  • 68
  • 110
10
votes
2 answers

why (0+0i)^{0} == (nan, nan) in c++

take a look at the code blew: #include #include int main() { std::cout << std::pow( std::complex(0,0), std::complex(0,0) ) << "\n"; std::cout << std::pow( std::complex(0,0), double(0) ) <<…
Feng Wang
  • 1,506
  • 15
  • 17
1
2 3
59 60