
(FPCore (x y) :precision binary64 (- (/ 2.0 (+ 1.0 (exp (* -2.0 x)))) 1.0))
double code(double x, double y) {
return (2.0 / (1.0 + exp((-2.0 * x)))) - 1.0;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = (2.0d0 / (1.0d0 + exp(((-2.0d0) * x)))) - 1.0d0
end function
public static double code(double x, double y) {
return (2.0 / (1.0 + Math.exp((-2.0 * x)))) - 1.0;
}
def code(x, y): return (2.0 / (1.0 + math.exp((-2.0 * x)))) - 1.0
function code(x, y) return Float64(Float64(2.0 / Float64(1.0 + exp(Float64(-2.0 * x)))) - 1.0) end
function tmp = code(x, y) tmp = (2.0 / (1.0 + exp((-2.0 * x)))) - 1.0; end
code[x_, y_] := N[(N[(2.0 / N[(1.0 + N[Exp[N[(-2.0 * x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 1.0), $MachinePrecision]
\begin{array}{l}
\\
\frac{2}{1 + e^{-2 \cdot x}} - 1
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 7 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y) :precision binary64 (- (/ 2.0 (+ 1.0 (exp (* -2.0 x)))) 1.0))
double code(double x, double y) {
return (2.0 / (1.0 + exp((-2.0 * x)))) - 1.0;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = (2.0d0 / (1.0d0 + exp(((-2.0d0) * x)))) - 1.0d0
end function
public static double code(double x, double y) {
return (2.0 / (1.0 + Math.exp((-2.0 * x)))) - 1.0;
}
def code(x, y): return (2.0 / (1.0 + math.exp((-2.0 * x)))) - 1.0
function code(x, y) return Float64(Float64(2.0 / Float64(1.0 + exp(Float64(-2.0 * x)))) - 1.0) end
function tmp = code(x, y) tmp = (2.0 / (1.0 + exp((-2.0 * x)))) - 1.0; end
code[x_, y_] := N[(N[(2.0 / N[(1.0 + N[Exp[N[(-2.0 * x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 1.0), $MachinePrecision]
\begin{array}{l}
\\
\frac{2}{1 + e^{-2 \cdot x}} - 1
\end{array}
(FPCore (x y) :precision binary64 (if (or (<= (* -2.0 x) -0.1) (not (<= (* -2.0 x) 4e-8))) (* 2.0 (log (exp (+ (/ 1.0 (+ 1.0 (pow (exp -2.0) x))) -0.5)))) x))
double code(double x, double y) {
double tmp;
if (((-2.0 * x) <= -0.1) || !((-2.0 * x) <= 4e-8)) {
tmp = 2.0 * log(exp(((1.0 / (1.0 + pow(exp(-2.0), x))) + -0.5)));
} else {
tmp = x;
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if ((((-2.0d0) * x) <= (-0.1d0)) .or. (.not. (((-2.0d0) * x) <= 4d-8))) then
tmp = 2.0d0 * log(exp(((1.0d0 / (1.0d0 + (exp((-2.0d0)) ** x))) + (-0.5d0))))
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (((-2.0 * x) <= -0.1) || !((-2.0 * x) <= 4e-8)) {
tmp = 2.0 * Math.log(Math.exp(((1.0 / (1.0 + Math.pow(Math.exp(-2.0), x))) + -0.5)));
} else {
tmp = x;
}
return tmp;
}
def code(x, y): tmp = 0 if ((-2.0 * x) <= -0.1) or not ((-2.0 * x) <= 4e-8): tmp = 2.0 * math.log(math.exp(((1.0 / (1.0 + math.pow(math.exp(-2.0), x))) + -0.5))) else: tmp = x return tmp
function code(x, y) tmp = 0.0 if ((Float64(-2.0 * x) <= -0.1) || !(Float64(-2.0 * x) <= 4e-8)) tmp = Float64(2.0 * log(exp(Float64(Float64(1.0 / Float64(1.0 + (exp(-2.0) ^ x))) + -0.5)))); else tmp = x; end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (((-2.0 * x) <= -0.1) || ~(((-2.0 * x) <= 4e-8))) tmp = 2.0 * log(exp(((1.0 / (1.0 + (exp(-2.0) ^ x))) + -0.5))); else tmp = x; end tmp_2 = tmp; end
code[x_, y_] := If[Or[LessEqual[N[(-2.0 * x), $MachinePrecision], -0.1], N[Not[LessEqual[N[(-2.0 * x), $MachinePrecision], 4e-8]], $MachinePrecision]], N[(2.0 * N[Log[N[Exp[N[(N[(1.0 / N[(1.0 + N[Power[N[Exp[-2.0], $MachinePrecision], x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + -0.5), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;-2 \cdot x \leq -0.1 \lor \neg \left(-2 \cdot x \leq 4 \cdot 10^{-8}\right):\\
\;\;\;\;2 \cdot \log \left(e^{\frac{1}{1 + {\left(e^{-2}\right)}^{x}} + -0.5}\right)\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if (*.f64 #s(literal -2 binary64) x) < -0.10000000000000001 or 4.0000000000000001e-8 < (*.f64 #s(literal -2 binary64) x) Initial program 99.9%
add-log-exp100.0%
add-sqr-sqrt100.0%
log-prod100.0%
sub-neg100.0%
exp-prod100.0%
metadata-eval100.0%
sub-neg100.0%
exp-prod100.0%
metadata-eval100.0%
Applied egg-rr100.0%
count-2100.0%
Simplified100.0%
Taylor expanded in x around inf 100.0%
Taylor expanded in x around inf 100.0%
exp-diff100.0%
associate-*r/100.0%
metadata-eval100.0%
exp-prod100.0%
div-exp100.0%
sub-neg100.0%
metadata-eval100.0%
unpow1/2100.0%
exp-prod100.0%
*-commutative100.0%
distribute-rgt-in100.0%
metadata-eval100.0%
exp-sum98.7%
Simplified100.0%
if -0.10000000000000001 < (*.f64 #s(literal -2 binary64) x) < 4.0000000000000001e-8Initial program 6.4%
Taylor expanded in x around 0 100.0%
Final simplification100.0%
(FPCore (x y)
:precision binary64
(if (<= (* -2.0 x) -0.1)
(log (exp (+ (/ 2.0 (+ 1.0 (pow (exp -2.0) x))) -1.0)))
(if (<= (* -2.0 x) 4e-8)
x
(+ (+ (+ 1.0 (/ 2.0 (+ 1.0 (exp (* -2.0 x))))) -1.0) -1.0))))
double code(double x, double y) {
double tmp;
if ((-2.0 * x) <= -0.1) {
tmp = log(exp(((2.0 / (1.0 + pow(exp(-2.0), x))) + -1.0)));
} else if ((-2.0 * x) <= 4e-8) {
tmp = x;
} else {
tmp = ((1.0 + (2.0 / (1.0 + exp((-2.0 * x))))) + -1.0) + -1.0;
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (((-2.0d0) * x) <= (-0.1d0)) then
tmp = log(exp(((2.0d0 / (1.0d0 + (exp((-2.0d0)) ** x))) + (-1.0d0))))
else if (((-2.0d0) * x) <= 4d-8) then
tmp = x
else
tmp = ((1.0d0 + (2.0d0 / (1.0d0 + exp(((-2.0d0) * x))))) + (-1.0d0)) + (-1.0d0)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if ((-2.0 * x) <= -0.1) {
tmp = Math.log(Math.exp(((2.0 / (1.0 + Math.pow(Math.exp(-2.0), x))) + -1.0)));
} else if ((-2.0 * x) <= 4e-8) {
tmp = x;
} else {
tmp = ((1.0 + (2.0 / (1.0 + Math.exp((-2.0 * x))))) + -1.0) + -1.0;
}
return tmp;
}
def code(x, y): tmp = 0 if (-2.0 * x) <= -0.1: tmp = math.log(math.exp(((2.0 / (1.0 + math.pow(math.exp(-2.0), x))) + -1.0))) elif (-2.0 * x) <= 4e-8: tmp = x else: tmp = ((1.0 + (2.0 / (1.0 + math.exp((-2.0 * x))))) + -1.0) + -1.0 return tmp
function code(x, y) tmp = 0.0 if (Float64(-2.0 * x) <= -0.1) tmp = log(exp(Float64(Float64(2.0 / Float64(1.0 + (exp(-2.0) ^ x))) + -1.0))); elseif (Float64(-2.0 * x) <= 4e-8) tmp = x; else tmp = Float64(Float64(Float64(1.0 + Float64(2.0 / Float64(1.0 + exp(Float64(-2.0 * x))))) + -1.0) + -1.0); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if ((-2.0 * x) <= -0.1) tmp = log(exp(((2.0 / (1.0 + (exp(-2.0) ^ x))) + -1.0))); elseif ((-2.0 * x) <= 4e-8) tmp = x; else tmp = ((1.0 + (2.0 / (1.0 + exp((-2.0 * x))))) + -1.0) + -1.0; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[N[(-2.0 * x), $MachinePrecision], -0.1], N[Log[N[Exp[N[(N[(2.0 / N[(1.0 + N[Power[N[Exp[-2.0], $MachinePrecision], x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]], $MachinePrecision]], $MachinePrecision], If[LessEqual[N[(-2.0 * x), $MachinePrecision], 4e-8], x, N[(N[(N[(1.0 + N[(2.0 / N[(1.0 + N[Exp[N[(-2.0 * x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision] + -1.0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;-2 \cdot x \leq -0.1:\\
\;\;\;\;\log \left(e^{\frac{2}{1 + {\left(e^{-2}\right)}^{x}} + -1}\right)\\
\mathbf{elif}\;-2 \cdot x \leq 4 \cdot 10^{-8}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;\left(\left(1 + \frac{2}{1 + e^{-2 \cdot x}}\right) + -1\right) + -1\\
\end{array}
\end{array}
if (*.f64 #s(literal -2 binary64) x) < -0.10000000000000001Initial program 99.9%
add-log-exp100.0%
sub-neg100.0%
exp-prod100.0%
metadata-eval100.0%
Applied egg-rr100.0%
if -0.10000000000000001 < (*.f64 #s(literal -2 binary64) x) < 4.0000000000000001e-8Initial program 6.4%
Taylor expanded in x around 0 100.0%
if 4.0000000000000001e-8 < (*.f64 #s(literal -2 binary64) x) Initial program 99.9%
expm1-log1p-u99.9%
expm1-undefine99.9%
log1p-undefine100.0%
+-commutative100.0%
add-exp-log100.0%
+-commutative100.0%
exp-prod100.0%
Applied egg-rr100.0%
Taylor expanded in x around inf 100.0%
Final simplification100.0%
(FPCore (x y)
:precision binary64
(let* ((t_0 (/ 2.0 (+ 1.0 (exp (* -2.0 x))))))
(if (<= (* -2.0 x) -0.1)
(+ t_0 -1.0)
(if (<= (* -2.0 x) 4e-8) x (+ (+ (+ 1.0 t_0) -1.0) -1.0)))))
double code(double x, double y) {
double t_0 = 2.0 / (1.0 + exp((-2.0 * x)));
double tmp;
if ((-2.0 * x) <= -0.1) {
tmp = t_0 + -1.0;
} else if ((-2.0 * x) <= 4e-8) {
tmp = x;
} else {
tmp = ((1.0 + t_0) + -1.0) + -1.0;
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: t_0
real(8) :: tmp
t_0 = 2.0d0 / (1.0d0 + exp(((-2.0d0) * x)))
if (((-2.0d0) * x) <= (-0.1d0)) then
tmp = t_0 + (-1.0d0)
else if (((-2.0d0) * x) <= 4d-8) then
tmp = x
else
tmp = ((1.0d0 + t_0) + (-1.0d0)) + (-1.0d0)
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = 2.0 / (1.0 + Math.exp((-2.0 * x)));
double tmp;
if ((-2.0 * x) <= -0.1) {
tmp = t_0 + -1.0;
} else if ((-2.0 * x) <= 4e-8) {
tmp = x;
} else {
tmp = ((1.0 + t_0) + -1.0) + -1.0;
}
return tmp;
}
def code(x, y): t_0 = 2.0 / (1.0 + math.exp((-2.0 * x))) tmp = 0 if (-2.0 * x) <= -0.1: tmp = t_0 + -1.0 elif (-2.0 * x) <= 4e-8: tmp = x else: tmp = ((1.0 + t_0) + -1.0) + -1.0 return tmp
function code(x, y) t_0 = Float64(2.0 / Float64(1.0 + exp(Float64(-2.0 * x)))) tmp = 0.0 if (Float64(-2.0 * x) <= -0.1) tmp = Float64(t_0 + -1.0); elseif (Float64(-2.0 * x) <= 4e-8) tmp = x; else tmp = Float64(Float64(Float64(1.0 + t_0) + -1.0) + -1.0); end return tmp end
function tmp_2 = code(x, y) t_0 = 2.0 / (1.0 + exp((-2.0 * x))); tmp = 0.0; if ((-2.0 * x) <= -0.1) tmp = t_0 + -1.0; elseif ((-2.0 * x) <= 4e-8) tmp = x; else tmp = ((1.0 + t_0) + -1.0) + -1.0; end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(2.0 / N[(1.0 + N[Exp[N[(-2.0 * x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(-2.0 * x), $MachinePrecision], -0.1], N[(t$95$0 + -1.0), $MachinePrecision], If[LessEqual[N[(-2.0 * x), $MachinePrecision], 4e-8], x, N[(N[(N[(1.0 + t$95$0), $MachinePrecision] + -1.0), $MachinePrecision] + -1.0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{2}{1 + e^{-2 \cdot x}}\\
\mathbf{if}\;-2 \cdot x \leq -0.1:\\
\;\;\;\;t\_0 + -1\\
\mathbf{elif}\;-2 \cdot x \leq 4 \cdot 10^{-8}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;\left(\left(1 + t\_0\right) + -1\right) + -1\\
\end{array}
\end{array}
if (*.f64 #s(literal -2 binary64) x) < -0.10000000000000001Initial program 99.9%
if -0.10000000000000001 < (*.f64 #s(literal -2 binary64) x) < 4.0000000000000001e-8Initial program 6.4%
Taylor expanded in x around 0 100.0%
if 4.0000000000000001e-8 < (*.f64 #s(literal -2 binary64) x) Initial program 99.9%
expm1-log1p-u99.9%
expm1-undefine99.9%
log1p-undefine100.0%
+-commutative100.0%
add-exp-log100.0%
+-commutative100.0%
exp-prod100.0%
Applied egg-rr100.0%
Taylor expanded in x around inf 100.0%
Final simplification100.0%
(FPCore (x y) :precision binary64 (if (or (<= (* -2.0 x) -0.1) (not (<= (* -2.0 x) 4e-8))) (+ (/ 2.0 (+ 1.0 (exp (* -2.0 x)))) -1.0) x))
double code(double x, double y) {
double tmp;
if (((-2.0 * x) <= -0.1) || !((-2.0 * x) <= 4e-8)) {
tmp = (2.0 / (1.0 + exp((-2.0 * x)))) + -1.0;
} else {
tmp = x;
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if ((((-2.0d0) * x) <= (-0.1d0)) .or. (.not. (((-2.0d0) * x) <= 4d-8))) then
tmp = (2.0d0 / (1.0d0 + exp(((-2.0d0) * x)))) + (-1.0d0)
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (((-2.0 * x) <= -0.1) || !((-2.0 * x) <= 4e-8)) {
tmp = (2.0 / (1.0 + Math.exp((-2.0 * x)))) + -1.0;
} else {
tmp = x;
}
return tmp;
}
def code(x, y): tmp = 0 if ((-2.0 * x) <= -0.1) or not ((-2.0 * x) <= 4e-8): tmp = (2.0 / (1.0 + math.exp((-2.0 * x)))) + -1.0 else: tmp = x return tmp
function code(x, y) tmp = 0.0 if ((Float64(-2.0 * x) <= -0.1) || !(Float64(-2.0 * x) <= 4e-8)) tmp = Float64(Float64(2.0 / Float64(1.0 + exp(Float64(-2.0 * x)))) + -1.0); else tmp = x; end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (((-2.0 * x) <= -0.1) || ~(((-2.0 * x) <= 4e-8))) tmp = (2.0 / (1.0 + exp((-2.0 * x)))) + -1.0; else tmp = x; end tmp_2 = tmp; end
code[x_, y_] := If[Or[LessEqual[N[(-2.0 * x), $MachinePrecision], -0.1], N[Not[LessEqual[N[(-2.0 * x), $MachinePrecision], 4e-8]], $MachinePrecision]], N[(N[(2.0 / N[(1.0 + N[Exp[N[(-2.0 * x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;-2 \cdot x \leq -0.1 \lor \neg \left(-2 \cdot x \leq 4 \cdot 10^{-8}\right):\\
\;\;\;\;\frac{2}{1 + e^{-2 \cdot x}} + -1\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if (*.f64 #s(literal -2 binary64) x) < -0.10000000000000001 or 4.0000000000000001e-8 < (*.f64 #s(literal -2 binary64) x) Initial program 99.9%
if -0.10000000000000001 < (*.f64 #s(literal -2 binary64) x) < 4.0000000000000001e-8Initial program 6.4%
Taylor expanded in x around 0 100.0%
Final simplification100.0%
(FPCore (x y) :precision binary64 (* (* x 2.0) (/ 1.0 (+ x 2.0))))
double code(double x, double y) {
return (x * 2.0) * (1.0 / (x + 2.0));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = (x * 2.0d0) * (1.0d0 / (x + 2.0d0))
end function
public static double code(double x, double y) {
return (x * 2.0) * (1.0 / (x + 2.0));
}
def code(x, y): return (x * 2.0) * (1.0 / (x + 2.0))
function code(x, y) return Float64(Float64(x * 2.0) * Float64(1.0 / Float64(x + 2.0))) end
function tmp = code(x, y) tmp = (x * 2.0) * (1.0 / (x + 2.0)); end
code[x_, y_] := N[(N[(x * 2.0), $MachinePrecision] * N[(1.0 / N[(x + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x \cdot 2\right) \cdot \frac{1}{x + 2}
\end{array}
Initial program 53.2%
Taylor expanded in x around 0 5.9%
+-commutative5.9%
Simplified5.9%
flip--5.7%
div-inv5.7%
metadata-eval5.7%
difference-of-sqr-15.7%
associate-+l+5.7%
metadata-eval5.7%
associate--l+52.5%
metadata-eval52.5%
+-rgt-identity52.5%
associate-+l+52.5%
metadata-eval52.5%
Applied egg-rr52.5%
Taylor expanded in x around 0 55.2%
*-commutative55.2%
Simplified55.2%
Final simplification55.2%
(FPCore (x y) :precision binary64 (if (<= x 2.0) x 2.0))
double code(double x, double y) {
double tmp;
if (x <= 2.0) {
tmp = x;
} else {
tmp = 2.0;
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= 2.0d0) then
tmp = x
else
tmp = 2.0d0
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= 2.0) {
tmp = x;
} else {
tmp = 2.0;
}
return tmp;
}
def code(x, y): tmp = 0 if x <= 2.0: tmp = x else: tmp = 2.0 return tmp
function code(x, y) tmp = 0.0 if (x <= 2.0) tmp = x; else tmp = 2.0; end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= 2.0) tmp = x; else tmp = 2.0; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, 2.0], x, 2.0]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 2:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;2\\
\end{array}
\end{array}
if x < 2Initial program 36.9%
Taylor expanded in x around 0 69.2%
if 2 < x Initial program 100.0%
Taylor expanded in x around 0 5.1%
+-commutative5.1%
Simplified5.1%
flip--4.7%
div-inv4.7%
metadata-eval4.7%
difference-of-sqr-14.7%
associate-+l+4.7%
metadata-eval4.7%
associate--l+4.7%
metadata-eval4.7%
+-rgt-identity4.7%
associate-+l+4.7%
metadata-eval4.7%
Applied egg-rr4.7%
Taylor expanded in x around 0 18.8%
*-commutative18.8%
Simplified18.8%
Taylor expanded in x around inf 18.8%
Final simplification56.2%
(FPCore (x y) :precision binary64 2.0)
double code(double x, double y) {
return 2.0;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = 2.0d0
end function
public static double code(double x, double y) {
return 2.0;
}
def code(x, y): return 2.0
function code(x, y) return 2.0 end
function tmp = code(x, y) tmp = 2.0; end
code[x_, y_] := 2.0
\begin{array}{l}
\\
2
\end{array}
Initial program 53.2%
Taylor expanded in x around 0 5.9%
+-commutative5.9%
Simplified5.9%
flip--5.7%
div-inv5.7%
metadata-eval5.7%
difference-of-sqr-15.7%
associate-+l+5.7%
metadata-eval5.7%
associate--l+52.5%
metadata-eval52.5%
+-rgt-identity52.5%
associate-+l+52.5%
metadata-eval52.5%
Applied egg-rr52.5%
Taylor expanded in x around 0 55.2%
*-commutative55.2%
Simplified55.2%
Taylor expanded in x around inf 7.1%
Final simplification7.1%
herbie shell --seed 2024080
(FPCore (x y)
:name "Logistic function from Lakshay Garg"
:precision binary64
(- (/ 2.0 (+ 1.0 (exp (* -2.0 x)))) 1.0))