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_e.asp
Python math.e Constant
Python Examples Python Compiler ... Bootcamp Python Certificate Python Training ... The math.e constant returns the Eular's number: 2.718281828459045....
🌐
Julia Programming Language
julialang.org
The Julia Programming Language
Build shared libraries and executables with PackageCompiler. Deploy on a webserver with HTTP.jl or embedded devices. Powerful shell integration make it easy to managing other processes. Julia has foreign function interfaces for C, Fortran, C++, Python, R, Java, Mathematica, Matlab, and many other languages.
🌐
W3Schools
w3schools.com › python › ref_math_exp.asp
Python math.exp() Method
Python Examples Python Compiler Python Exercises Python Quiz Python Challenges Python Server Python Syllabus Python Study Plan Python Interview Q&A Python Bootcamp Python Certificate Python Training ... #Import math Library import math #find the exponential of the specified value print(math.exp(65)) print(math.exp(-6.89)) Try it Yourself »
🌐
Interactive Chaos
interactivechaos.com › en › python › function › mathe
math.e | Interactive Chaos
Home > Educational Resources > Python Functions · Python · Python functions · Python methods and attributes · Python scenarios · Full name · math.e · Library · math · Syntax · math.e · Description · math.e returns the value of the mathematical constant e (2.718281828459045).
🌐
Tutorialspoint
tutorialspoint.com › home › python › python math e constant
Understanding Python's Math E Constant
February 21, 2009 - The Python math.e represents the mathematical constant e, which is approximately equal to 2.71828.
🌐
Python documentation
docs.python.org › 3 › library › random.html
random — Generate pseudo-random numbers
2 weeks ago - The mantissa comes from a uniform distribution of integers in the range 2⁵² ≤ mantissa < 2⁵³. The exponent comes from a geometric distribution where exponents smaller than -53 occur half as often as the next larger exponent. from random import Random from math import ldexp class FullRandom(Random): def random(self): mantissa = 0x10_0000_0000_0000 | self.getrandbits(52) exponent = -53 x = 0 while not x: x = self.getrandbits(32) exponent += x.bit_length() - 32 return ldexp(mantissa, exponent)
Find elsewhere
🌐
Real Python
realpython.com › python-math-module
The Python math Module: Everything You Need to Know – Real Python
October 21, 2023 - For straightforward mathematical calculations in Python, you can use the built-in mathematical operators, such as addition (+), subtraction (-), division (/), and multiplication (*).
🌐
Dataquest
dataquest.io › blog › python-math-module-and-functions
Simple Python Math Module Guide (22 Examples and 18 Functions)
March 6, 2023 - math is a built-in module in the Python 3 standard library that provides standard mathematical constants and functions. You can use the math module to perform various mathematical calculations, such as numeric, trigonometric, logarithmic, and ...
🌐
Learn Coding Fast
learncodingfast.com › home › e (euler’s number) in python
e (Euler’s number) in Python | Learn Coding Fast
September 28, 2020 - This module includes various constants (such as pi and e) that we can use in our Python scripts. To get the value of e, we type math.e.
🌐
Website-files
assets-global.website-files.com › 6723a8efc04bd3bf3401b490 › 6863d62af8e231514aa5c34c_lelimesedopukosuzidewana.pdf pdf
Math e python
The Python math.e represents the mathematical constant e, which is approximately equal to 2.71828. It is a predefined value available in Python's math module and is commonly used in mathematical · calculations involving exponential growth and decay, such as compound interest, population growth, ...
🌐
Scaler
scaler.com › home › topics › python math module
Python math Module - Scaler Topics
February 22, 2024 - The math module in Python equips programmers with essential tools for various mathematical operations, ranging from basic arithmetic to advanced functions like trigonometry and logarithms.
🌐
iO Flood
ioflood.com › blog › python-math
Python Math Module: A Detailed Walkthrough
February 12, 2024 - To use Python’s math module, you first need to import it using import math. Then, you can use its functions to perform mathematical operations, such as math.sqrt(16). For example, to calculate the square root of a number:
🌐
CodeHS
codehs.com › tutorial › ryan › math-module-in-python
Tutorial: Math Module in Python | CodeHS
Elementary · State Courses · Spanish Courses · Standards · Practice · Tutorials · Digital Textbooks · AP CSA Hub · New Sandbox Program · Javascript · Python · Java · HTML · C++ SQL · Karel · Grading · Differentiation · Elementary · Assessments ·
🌐
Pythonfordesigners
pythonfordesigners.com › chapters › transform-strings › 06.py
Python for designers
# we import the euler constant from the math module from math import e # then we print the constant value with two digits after the period print(f'euler: {e:.2f}') # euler: 2.71
🌐
Python
docs.python.org › 3 › library › math.html
math — Mathematical functions
2 weeks ago - In these cases, math.fma returns a NaN, and does not raise any exception. Added in version 3.13. ... Return the floating-point remainder of x / y, as defined by the platform C library function fmod(x, y). Note that the Python expression x % y may not return the same result.
🌐
scikit-learn
scikit-learn.org › stable › modules › tree.html
1.10. Decision Trees — scikit-learn 1.8.0 documentation
Regardless of the splitting strategy, after summing the cost over all internal nodes, the total complexity scales linearly with \(n_{nodes}=n_{leaves}-1\), which is \(\mathcal{O}(n_{samples})\) in the worst-case complexity, that is, when the tree is grown until each sample ends up in its own leaf.
🌐
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.