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:

765 questions
74
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,080
  • 1
  • 19
  • 15
35
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
  • 5,560
  • 8
  • 38
  • 44
31
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
  • 490
  • 1
  • 4
  • 15
24
votes
5 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
  • 573
  • 2
  • 6
  • 23
20
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,092
  • 5
  • 29
  • 44
18
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
  • 269,545
  • 201
  • 440
  • 653
17
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
  • 23,144
  • 3
  • 41
  • 81
14
votes
3 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
  • 1,474
  • 3
  • 18
  • 24
14
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
  • 171
  • 1
  • 1
  • 5
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
4 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,153
  • 5
  • 36
  • 53
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,168
  • 12
  • 16
10
votes
3 answers

calculating a function in matlab with very small values

I am making a function in matlab to compute the following function: for this function we have: This is my implementation in matlab of the function: function [b]= exponential(e) %b = ? b= (exp (e) -1)/e; When I test the function with very small…
franvergara66
  • 9,675
  • 17
  • 51
  • 98
9
votes
4 answers

Calculating e^x without using any functions

We are supposed to calculate e^x using this kind of formula: e^x = 1 + (x ^ 1 / 1!) + (x ^ 2 / 2!) ...... I have this code so far: while (result >= 1.0E-20 ) { power = power * input; factorial = factorial * counter; result = power /…
Charles Khunt
  • 2,175
  • 5
  • 23
  • 24
9
votes
1 answer

geom_smooth and exponential fits

I am new to R and I'm having some difficulty plotting an exponential curve using ggplot2. I have a set of data below. DATA X Y x y 1 0.6168111 37.20637 0.6168111 37.20637 2 0.5478698 24.17084 0.5478698…
maherman
  • 93
  • 1
  • 1
  • 4
1
2 3
50 51