Questions tagged [exp]

The Exponential - aka exp(x) function

The vast majority of the 21 posts tagged [exp] relate to the Exponential function i.e. f(x) = e^x where e is the number which is approximately 2.71828. This function is very important in statistics and many other fields.

235 questions
6
votes
1 answer

How to convert scalar code of the double version of VDT's Pade Exp fast_ex() approx into SSE2?

Here's the code I'm trying to convert: the double version of VDT's Pade Exp fast_ex() approx (here's the old repo resource): inline double fast_exp(double initial_x){ double x = initial_x; double px=details::fpfloor(details::LOG2E * x…
markzzz
  • 47,390
  • 120
  • 299
  • 507
6
votes
2 answers

Calculating log-sum-exp function in c++

Are there any functions in the c++ standard library that calculate the log of the sum of exponentials? If not, how should I go about writing my own? Do you have any suggestions not mentioned in this wiki article? I am concerned specifically with the…
Taylor
  • 1,797
  • 4
  • 26
  • 51
6
votes
2 answers

Perform numpy exp function in-place

As in title, I need to perform numpy.exp on a very large ndarray, let's say ar, and store the result in ar itself. Can this operation be performed in-place?
aretor
  • 2,379
  • 2
  • 22
  • 38
6
votes
1 answer

Taking logs and adding versus multiplying

If I want to take the product of a list of floating point numbers, what's the worst-case/average-case precision lost by adding their logs and then taking exp of the sum as opposed to just multiplying them. Is there ever a case when this is actually…
dspyz
  • 5,280
  • 2
  • 25
  • 63
5
votes
1 answer

Something really weird with C++ exp() function

When tying to implement mySqrt function in C++, I used the exp() function like this: int mySqrt(int x) { // For x = 2147395600 cout << exp(0.5*log(x)) << " "; // It prints 46340 return exp(0.5*log(x)); // But returns…
Rakshak
  • 73
  • 6
5
votes
1 answer

Expo FileSystem.moveAsync location is not moveable?

I'm working on react native App using expo API, the App basically takes a picture then the App crop it using ImageEditor.cropImage, finally copy the picture from cache to another location. the code: takePicture = async function() { if…
adnanmuttaleb
  • 3,388
  • 1
  • 29
  • 46
5
votes
4 answers

(the first 10-digit prime in e).com python google challenge 2004

I just come up to one of challenges that claimed to be used by google 2004 (the first 10-digit prime in e).com independent from that, I wanted to take the challenge and solve it with python >>> '%0.52f' %…
Elteroooo
  • 2,913
  • 3
  • 33
  • 40
5
votes
2 answers

Calculating exp(x) with the use of recursion in Python

I'm attempting to calculate e^x using recursion, e^x = e^(x/2)*e^(x/2), and the third order Maclaurin expansion for e^x and the script keeps returning 1. I'm not looking for a higher accuracy solution, just simply to understand where the script goes…
Skentuey
  • 53
  • 4
5
votes
2 answers

RuntimeWarning: overflow encountered in np.exp(x**2)

I need to calculate exp(x**2) where x = numpy.arange(30,90). This raises the warning: RuntimeWarning: overflow encountered in exp inf I cannot safely ignore this warning, but neither SymPy nor mpmath is a solution and I need to perform array…
AKG
  • 1,799
  • 4
  • 13
  • 23
4
votes
3 answers

exp function using c++

I can't figure out why I keep getting the result 1.#INF from my_exp() when I give it 1 as input. Here is the code: double factorial(const int k) { int prod = 1; for(int i=1; i<=k; i++) prod = i * prod; return prod; } double…
Sean
  • 957
  • 2
  • 11
  • 15
4
votes
0 answers

how to add react native expo Av seek bar

I was building a music app in react native expo cli using expo av package I have built the basic funtionality like playing and pause. Now I want to implement seek bar but I'm not sure How I can do that? Please have a look at this code and please…
4
votes
1 answer

Exponential moving average in J

I currently am going through some examples of J, and am trying to do an exponential moving average. For the simple moving average I have done as follows: sma =: +/%[ With the following given: 5 sma 1 2 3 4 5 1.2 1.4 1.6 1.8 2 After some more…
user10553952
4
votes
1 answer

Simple explanation of the Ankerl fast exponent algorithm

Recently, I was looking for a faster alternative to the math exp(x) function. I found something that suited me very well, most often this solution is called Ankerl algorithm. Refs…
Dmytro Dadyka
  • 2,208
  • 5
  • 18
  • 31
4
votes
2 answers

Difference between Expo vs Exp on command line

I've been using expo/exp for a while to build React Native applications and can't seem to find clear documentation on what the diffeence between exp and expo is on the command line. Could someone please elaborate?
PrimeTimeTran
  • 1,807
  • 2
  • 17
  • 29
4
votes
1 answer

OpenCL Intel Iris Integrated Graphics exits with Abort Trap 6: Timeout Issue

I am attempting to write a program that executes Monte Carlo simulations using OpenCL. I have run into an issue involving exponentials. When the value of the variable steps becomes large, approximately 20000, the calculation of the exponent fails…
Nick
  • 75
  • 6
1
2
3
15 16