You can use exp(x) function of math library, which is same as e^x. Hence you may write your code as:

import math
x.append(1 - math.exp( -0.5 * (value1*value2)**2))

I have modified the equation by replacing 1/2 as 0.5. Else for Python <2.7, we'll have to explicitly type cast the division value to float because Python round of the result of division of two int as integer. For example: 1/2 gives 0 in python 2.7 and below.

Answer from Moinuddin Quadri on Stack Overflow
🌐
W3Schools
w3schools.com › python › ref_math_exp.asp
Python math.exp() Method
The math.exp() method returns E raised to the power of x (Ex).
🌐
Python
docs.python.org › 3 › library › math.html
math — Mathematical functions
2 weeks ago - >>> from math import exp, expm1 >>> exp(1e-5) - 1 # gives result accurate to 11 places 1.0000050000069649e-05 >>> expm1(1e-5) # result accurate to full precision 1.0000050000166668e-05
Discussions

python - How can I use "e" (Euler's number) and power operation? - Stack Overflow
For example: 1/2 gives 0 in python 2.7 and below. ... Sign up to request clarification or add additional context in comments. ... Just saying: numpy has this too. So no need to import math if you already did import numpy as np: ... The Numpy version has the advantage of using vectorisation when using Numpy arrays. 2022-05-12T11:12:40.95Z+00:00 ... You should use math.exp... More on stackoverflow.com
🌐 stackoverflow.com
Python math.exp function Syntax - Stack Overflow
I have an issue after using an the exponent function. it keeps throwing syntax errors on the line underneath. I am wondering if I am using "math.exp()" properly. as an example set of code case = 1 More on stackoverflow.com
🌐 stackoverflow.com
Where in the python source code is math.exp() defined? - Stack Overflow
I had search on google before ask this question. I could not find the math.exp() function source code. so... ... This one is actually hard to find, but it would have helped if you showed where you looked an failed to find it. It's defined in C; the entry for the Python structure is in the ... More on stackoverflow.com
🌐 stackoverflow.com
What np.exp() does?
"np" is the most commonly used import alias for numpy, the Python numerical library (just in case you were not taking this for granted in your question) i.e. with: import numpy as np numpy.exp does the same mathematical operation as the math library's math.exp, except that it can also operate element-wise on numpy arrays, as "Unbalenced_Life" pointed out in their post. "e" which is Euler's number, roughly 2.718, raised to the power of the input number. It's the inverse operation to the natural logarithm, so exp is also known as the "natural antilogarithm". The examples that puzzled you might somehow be using logarithms for calculations. >>> import numpy as np >>> np.exp(np.log(12)) 12.0 If it doesn't seem to involve logarithms, you could post a link to the example, and maybe one of the mathematically-inclined people here could tell you what it's for. More on reddit.com
🌐 r/learnpython
3
3
November 29, 2019
🌐
GeeksforGeeks
geeksforgeeks.org › python › python-math-library-exp-method
Python math library | exp() method - GeeksforGeeks
February 7, 2023 - Python has math library and has many functions regarding it. One such function is exp(). This method is used to calculate the power of e i.e. e^y or we can say exponential of y.
🌐
Codecademy
codecademy.com › docs › python:numpy › math methods › .exp()
Python:NumPy | Math Methods | .exp() | Codecademy
April 17, 2025 - The exponential function, np.exp(x), returns e^x, where e is Euler’s number with an approximate value of 2.71828. As a part of NumPy, a widely used library for numerical computing in Python, this function is particularly useful in scientific computations where exponential functions are common.
🌐
DataCamp
datacamp.com › tutorial › exponents-in-python
Exponents in Python: A Comprehensive Guide for Beginners | DataCamp
November 25, 2024 - Python offers multiple ways to calculate exponents: **: The double asterisk operator (**) is the simplest and basic option for exponentiation. For example, x ** y computes x raised to the power of y. pow(): This built-in function takes two arguments: the base and the exponent.
🌐
Tutorialspoint
tutorialspoint.com › home › python › python number exponential function
Python Number Exponential Function
February 21, 2009 - The Python math.exp() method is used to compute the Euler's number 'e' raised to the power of a numeric value.
Find elsewhere
🌐
Educative
educative.io › answers › calculating-the-exponential-value-in-python
Calculating the exponential value in Python
The exp() function in Python allows users to calculate the exponential value with the base set to e. ... e is a Mathematical constant known as Euler’s number, with a value approximately equal to 2.71828.
🌐
Note.nkmk.me
note.nkmk.me › home › python
Power and Logarithmic Functions in Python: exp, log, log10, log2 | note.nkmk.me
August 10, 2023 - math.exp() — Mathematical functions — Python 3.11.4 documentation
🌐
Trymito
trymito.io › excel-to-python › functions › math › EXP
Excel to Python: EXP, POWER Function - A Complete Guide | Mito
Math · EXP · Related FunctionsSQRT · Excel's EXP function calculates the exponential of a given number, using the constant 'e' as the base. This function plays a vital role in various fields such as finance, engineering, and statistics.
🌐
Stack Overflow
stackoverflow.com › questions › 46765056 › python-math-exp-function-syntax
Python math.exp function Syntax - Stack Overflow
case = 1 Dref = [1,2,3,4] i = 2 j = 1 t = 1 m = 1 Temp = 320 import math D[case] = (Dref[case]*((50/ t)^ m )) * ( math.exp((20/6)*((1/295) - (1/Temp))): print (D[case]) The code is for a numerical model and so I will need to use exp on a formula full of variables. any help would be appreciated! python ·
🌐
W3Schools
w3schools.com › python › module_math.asp
Python math Module
Python has a built-in module that you can use for mathematical tasks.
🌐
Codecademy
codecademy.com › docs › python › math module › math.exp()
Python | Math Module | math.exp() | Codecademy
March 17, 2024 - The math.exp() method returns e raised to the power of a number. ... Looking for an introduction to the theory behind programming? Master Python while learning data structures, algorithms, and more!
🌐
Python.org
discuss.python.org › ideas
`math.exp` and `math.log` delegate to `__exp__` and `__log__` methods? - Page 3 - Ideas - Discussions on Python.org
December 16, 2024 - SciPy 1.15 is slated to support basic mathematical operations on random variables. For instance, if X is an object representing a normal random variable, it will support operations like 3*abs(X)**2 + 1; the resulting ran…
🌐
NumPy
numpy.org › doc › 2.1 › reference › generated › numpy.exp.html
numpy.exp — NumPy v2.1 Manual
It is approximately 2.718281, and is the base of the natural logarithm, ln (this means that, if \(x = \ln y = \log_e y\), then \(e^x = y\). For real input, exp(x) is always positive. For complex arguments, x = a + ib, we can write \(e^x = e^a e^{ib}\). The first term, \(e^a\), is already known (it is the real argument, described above). The second term, \(e^{ib}\), is \(\cos b + i \sin b\), a function with magnitude 1 and a periodic phase. ... M. Abramovitz and I. A. Stegun, “Handbook of Mathematical Functions with Formulas, Graphs, and Mathematical Tables,” Dover, 1964, p.
🌐
Real Python
realpython.com › lessons › exponential-functions-math-exp
Exponential Functions: math.exp() (Video) – Real Python
Now, the exponential function being e to the power of x means that if we evaluate the exponential function at 1, it should be pretty close to the value of e in the math module. 02:55 e to the power of 1—so in other words, the exponential function evaluated at 1—e to the 1 is e, so we should either get True or we can test this with the isclose() function. 03:07 But go ahead and see what happens when you do this. We get True. Python’s doing a good job in being consistent that e to the power of 1 is exactly e, and so the value in the e constant in the math module does evaluate exactly to the exponential function evaluated at 1.
Published   August 24, 2021
🌐
Pynerds
pynerds.com › python-math-exp-function
Python math.exp() Function
The math.exp() function calculates the value of e (the base of natural logarithms) raised to the power of a given number. This value is known the "exp
🌐
Vultr Docs
docs.vultr.com › python › third-party › numpy › exp
Python Numpy exp() - Calculate Exponential | Vultr Docs
November 18, 2024 - This code computes e raised to the power of 2 (e²). The result is approximately 7.389056, showcasing how exp() calculates exponential values. Recognize that Python's floating point numbers have limitations in precision.