# ?

Average Error: 29.2 → 11.8
Time: 48.2s
Precision: binary64
Cost: 94033

# ?

$\left(\left(-10 \leq w1p \land w1p \leq 10\right) \land \left(-10 \leq ws \land ws \leq 10\right)\right) \land \left(-1000 \leq x \land x \leq 1000\right)$
$\frac{1}{1 + e^{\frac{\left(-2\right) \cdot \log 99}{\frac{w1p}{1 + ws}} \cdot \left(x - \left(\frac{-w1p}{2} + \frac{\frac{w1p}{1 + ws}}{2}\right)\right)}} - \frac{1}{1 + e^{\frac{\left(-2\right) \cdot \log 99}{\frac{w1p}{1 + ws}} \cdot \left(x - \left(\frac{w1p}{2} - \frac{\frac{w1p}{1 + ws}}{2}\right)\right)}}$
$\begin{array}{l} t_0 := \frac{\log 99 \cdot x}{w1p}\\ t_1 := -2 \cdot t_0\\ t_2 := e^{t_1}\\ t_3 := {\left(t_2 + 1\right)}^{2}\\ t_4 := \left(\frac{\left(\log 99 + t_1\right) \cdot t_2}{t_3} + -2 \cdot \frac{t_2 \cdot \left(\log 99 \cdot -0.5 - t_0\right)}{t_3}\right) \cdot ws\\ t_5 := \frac{w1p}{1 + ws}\\ \mathbf{if}\;w1p \leq -7.6 \cdot 10^{-172}:\\ \;\;\;\;t_4\\ \mathbf{elif}\;w1p \leq -1.6 \cdot 10^{-200}:\\ \;\;\;\;\frac{1}{1 + e^{-2 \cdot \frac{\log 99 \cdot \left(\left(1 + ws\right) \cdot \left(x + \left(w1p \cdot 0.5 + -0.5 \cdot t_5\right)\right)\right)}{w1p}}} + \frac{-1}{1 + e^{-2 \cdot \frac{\log 99 \cdot \left(\left(1 + ws\right) \cdot \left(w1p \cdot -0.5 + \left(x + 0.5 \cdot t_5\right)\right)\right)}{w1p}}}\\ \mathbf{elif}\;w1p \leq -2.1 \cdot 10^{-234} \lor \neg \left(w1p \leq 2.8 \cdot 10^{-152}\right):\\ \;\;\;\;t_4\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{1 + e^{\frac{\log 99 \cdot -2}{t_5} \cdot \left(x + \left(\frac{w1p}{2} - \frac{t_5}{2}\right)\right)}} + \frac{-1}{1 + e^{\left(\left(1 + ws\right) \cdot \left(\log 99 \cdot \frac{-2}{w1p}\right)\right) \cdot \left(x + \frac{t_5 - w1p}{2}\right)}}\\ \end{array}$
(FPCore (w1p ws x)
:precision binary64
(-
(/
1.0
(+
1.0
(exp
(*
(/ (* (- 2.0) (log 99.0)) (/ w1p (+ 1.0 ws)))
(- x (+ (/ (- w1p) 2.0) (/ (/ w1p (+ 1.0 ws)) 2.0)))))))
(/
1.0
(+
1.0
(exp
(*
(/ (* (- 2.0) (log 99.0)) (/ w1p (+ 1.0 ws)))
(- x (- (/ w1p 2.0) (/ (/ w1p (+ 1.0 ws)) 2.0)))))))))
(FPCore (w1p ws x)
:precision binary64
(let* ((t_0 (/ (* (log 99.0) x) w1p))
(t_1 (* -2.0 t_0))
(t_2 (exp t_1))
(t_3 (pow (+ t_2 1.0) 2.0))
(t_4
(*
(+
(/ (* (+ (log 99.0) t_1) t_2) t_3)
(* -2.0 (/ (* t_2 (- (* (log 99.0) -0.5) t_0)) t_3)))
ws))
(t_5 (/ w1p (+ 1.0 ws))))
(if (<= w1p -7.6e-172)
t_4
(if (<= w1p -1.6e-200)
(+
(/
1.0
(+
1.0
(exp
(*
-2.0
(/
(* (log 99.0) (* (+ 1.0 ws) (+ x (+ (* w1p 0.5) (* -0.5 t_5)))))
w1p)))))
(/
-1.0
(+
1.0
(exp
(*
-2.0
(/
(* (log 99.0) (* (+ 1.0 ws) (+ (* w1p -0.5) (+ x (* 0.5 t_5)))))
w1p))))))
(if (or (<= w1p -2.1e-234) (not (<= w1p 2.8e-152)))
t_4
(+
(/
1.0
(+
1.0
(exp
(*
(/ (* (log 99.0) -2.0) t_5)
(+ x (- (/ w1p 2.0) (/ t_5 2.0)))))))
(/
-1.0
(+
1.0
(exp
(*
(* (+ 1.0 ws) (* (log 99.0) (/ -2.0 w1p)))
(+ x (/ (- t_5 w1p) 2.0))))))))))))
double code(double w1p, double ws, double x) {
return (1.0 / (1.0 + exp((((-2.0 * log(99.0)) / (w1p / (1.0 + ws))) * (x - ((-w1p / 2.0) + ((w1p / (1.0 + ws)) / 2.0))))))) - (1.0 / (1.0 + exp((((-2.0 * log(99.0)) / (w1p / (1.0 + ws))) * (x - ((w1p / 2.0) - ((w1p / (1.0 + ws)) / 2.0)))))));
}

double code(double w1p, double ws, double x) {
double t_0 = (log(99.0) * x) / w1p;
double t_1 = -2.0 * t_0;
double t_2 = exp(t_1);
double t_3 = pow((t_2 + 1.0), 2.0);
double t_4 = ((((log(99.0) + t_1) * t_2) / t_3) + (-2.0 * ((t_2 * ((log(99.0) * -0.5) - t_0)) / t_3))) * ws;
double t_5 = w1p / (1.0 + ws);
double tmp;
if (w1p <= -7.6e-172) {
tmp = t_4;
} else if (w1p <= -1.6e-200) {
tmp = (1.0 / (1.0 + exp((-2.0 * ((log(99.0) * ((1.0 + ws) * (x + ((w1p * 0.5) + (-0.5 * t_5))))) / w1p))))) + (-1.0 / (1.0 + exp((-2.0 * ((log(99.0) * ((1.0 + ws) * ((w1p * -0.5) + (x + (0.5 * t_5))))) / w1p)))));
} else if ((w1p <= -2.1e-234) || !(w1p <= 2.8e-152)) {
tmp = t_4;
} else {
tmp = (1.0 / (1.0 + exp((((log(99.0) * -2.0) / t_5) * (x + ((w1p / 2.0) - (t_5 / 2.0))))))) + (-1.0 / (1.0 + exp((((1.0 + ws) * (log(99.0) * (-2.0 / w1p))) * (x + ((t_5 - w1p) / 2.0))))));
}
return tmp;
}

real(8) function code(w1p, ws, x)
real(8), intent (in) :: w1p
real(8), intent (in) :: ws
real(8), intent (in) :: x
code = (1.0d0 / (1.0d0 + exp((((-2.0d0 * log(99.0d0)) / (w1p / (1.0d0 + ws))) * (x - ((-w1p / 2.0d0) + ((w1p / (1.0d0 + ws)) / 2.0d0))))))) - (1.0d0 / (1.0d0 + exp((((-2.0d0 * log(99.0d0)) / (w1p / (1.0d0 + ws))) * (x - ((w1p / 2.0d0) - ((w1p / (1.0d0 + ws)) / 2.0d0)))))))
end function

real(8) function code(w1p, ws, x)
real(8), intent (in) :: w1p
real(8), intent (in) :: ws
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: t_5
real(8) :: tmp
t_0 = (log(99.0d0) * x) / w1p
t_1 = (-2.0d0) * t_0
t_2 = exp(t_1)
t_3 = (t_2 + 1.0d0) ** 2.0d0
t_4 = ((((log(99.0d0) + t_1) * t_2) / t_3) + ((-2.0d0) * ((t_2 * ((log(99.0d0) * (-0.5d0)) - t_0)) / t_3))) * ws
t_5 = w1p / (1.0d0 + ws)
if (w1p <= (-7.6d-172)) then
tmp = t_4
else if (w1p <= (-1.6d-200)) then
tmp = (1.0d0 / (1.0d0 + exp(((-2.0d0) * ((log(99.0d0) * ((1.0d0 + ws) * (x + ((w1p * 0.5d0) + ((-0.5d0) * t_5))))) / w1p))))) + ((-1.0d0) / (1.0d0 + exp(((-2.0d0) * ((log(99.0d0) * ((1.0d0 + ws) * ((w1p * (-0.5d0)) + (x + (0.5d0 * t_5))))) / w1p)))))
else if ((w1p <= (-2.1d-234)) .or. (.not. (w1p <= 2.8d-152))) then
tmp = t_4
else
tmp = (1.0d0 / (1.0d0 + exp((((log(99.0d0) * (-2.0d0)) / t_5) * (x + ((w1p / 2.0d0) - (t_5 / 2.0d0))))))) + ((-1.0d0) / (1.0d0 + exp((((1.0d0 + ws) * (log(99.0d0) * ((-2.0d0) / w1p))) * (x + ((t_5 - w1p) / 2.0d0))))))
end if
code = tmp
end function

public static double code(double w1p, double ws, double x) {
return (1.0 / (1.0 + Math.exp((((-2.0 * Math.log(99.0)) / (w1p / (1.0 + ws))) * (x - ((-w1p / 2.0) + ((w1p / (1.0 + ws)) / 2.0))))))) - (1.0 / (1.0 + Math.exp((((-2.0 * Math.log(99.0)) / (w1p / (1.0 + ws))) * (x - ((w1p / 2.0) - ((w1p / (1.0 + ws)) / 2.0)))))));
}

public static double code(double w1p, double ws, double x) {
double t_0 = (Math.log(99.0) * x) / w1p;
double t_1 = -2.0 * t_0;
double t_2 = Math.exp(t_1);
double t_3 = Math.pow((t_2 + 1.0), 2.0);
double t_4 = ((((Math.log(99.0) + t_1) * t_2) / t_3) + (-2.0 * ((t_2 * ((Math.log(99.0) * -0.5) - t_0)) / t_3))) * ws;
double t_5 = w1p / (1.0 + ws);
double tmp;
if (w1p <= -7.6e-172) {
tmp = t_4;
} else if (w1p <= -1.6e-200) {
tmp = (1.0 / (1.0 + Math.exp((-2.0 * ((Math.log(99.0) * ((1.0 + ws) * (x + ((w1p * 0.5) + (-0.5 * t_5))))) / w1p))))) + (-1.0 / (1.0 + Math.exp((-2.0 * ((Math.log(99.0) * ((1.0 + ws) * ((w1p * -0.5) + (x + (0.5 * t_5))))) / w1p)))));
} else if ((w1p <= -2.1e-234) || !(w1p <= 2.8e-152)) {
tmp = t_4;
} else {
tmp = (1.0 / (1.0 + Math.exp((((Math.log(99.0) * -2.0) / t_5) * (x + ((w1p / 2.0) - (t_5 / 2.0))))))) + (-1.0 / (1.0 + Math.exp((((1.0 + ws) * (Math.log(99.0) * (-2.0 / w1p))) * (x + ((t_5 - w1p) / 2.0))))));
}
return tmp;
}

def code(w1p, ws, x):
return (1.0 / (1.0 + math.exp((((-2.0 * math.log(99.0)) / (w1p / (1.0 + ws))) * (x - ((-w1p / 2.0) + ((w1p / (1.0 + ws)) / 2.0))))))) - (1.0 / (1.0 + math.exp((((-2.0 * math.log(99.0)) / (w1p / (1.0 + ws))) * (x - ((w1p / 2.0) - ((w1p / (1.0 + ws)) / 2.0)))))))

def code(w1p, ws, x):
t_0 = (math.log(99.0) * x) / w1p
t_1 = -2.0 * t_0
t_2 = math.exp(t_1)
t_3 = math.pow((t_2 + 1.0), 2.0)
t_4 = ((((math.log(99.0) + t_1) * t_2) / t_3) + (-2.0 * ((t_2 * ((math.log(99.0) * -0.5) - t_0)) / t_3))) * ws
t_5 = w1p / (1.0 + ws)
tmp = 0
if w1p <= -7.6e-172:
tmp = t_4
elif w1p <= -1.6e-200:
tmp = (1.0 / (1.0 + math.exp((-2.0 * ((math.log(99.0) * ((1.0 + ws) * (x + ((w1p * 0.5) + (-0.5 * t_5))))) / w1p))))) + (-1.0 / (1.0 + math.exp((-2.0 * ((math.log(99.0) * ((1.0 + ws) * ((w1p * -0.5) + (x + (0.5 * t_5))))) / w1p)))))
elif (w1p <= -2.1e-234) or not (w1p <= 2.8e-152):
tmp = t_4
else:
tmp = (1.0 / (1.0 + math.exp((((math.log(99.0) * -2.0) / t_5) * (x + ((w1p / 2.0) - (t_5 / 2.0))))))) + (-1.0 / (1.0 + math.exp((((1.0 + ws) * (math.log(99.0) * (-2.0 / w1p))) * (x + ((t_5 - w1p) / 2.0))))))
return tmp

function code(w1p, ws, x)
return Float64(Float64(1.0 / Float64(1.0 + exp(Float64(Float64(Float64(Float64(-2.0) * log(99.0)) / Float64(w1p / Float64(1.0 + ws))) * Float64(x - Float64(Float64(Float64(-w1p) / 2.0) + Float64(Float64(w1p / Float64(1.0 + ws)) / 2.0))))))) - Float64(1.0 / Float64(1.0 + exp(Float64(Float64(Float64(Float64(-2.0) * log(99.0)) / Float64(w1p / Float64(1.0 + ws))) * Float64(x - Float64(Float64(w1p / 2.0) - Float64(Float64(w1p / Float64(1.0 + ws)) / 2.0))))))))
end

function code(w1p, ws, x)
t_0 = Float64(Float64(log(99.0) * x) / w1p)
t_1 = Float64(-2.0 * t_0)
t_2 = exp(t_1)
t_3 = Float64(t_2 + 1.0) ^ 2.0
t_4 = Float64(Float64(Float64(Float64(Float64(log(99.0) + t_1) * t_2) / t_3) + Float64(-2.0 * Float64(Float64(t_2 * Float64(Float64(log(99.0) * -0.5) - t_0)) / t_3))) * ws)
t_5 = Float64(w1p / Float64(1.0 + ws))
tmp = 0.0
if (w1p <= -7.6e-172)
tmp = t_4;
elseif (w1p <= -1.6e-200)
tmp = Float64(Float64(1.0 / Float64(1.0 + exp(Float64(-2.0 * Float64(Float64(log(99.0) * Float64(Float64(1.0 + ws) * Float64(x + Float64(Float64(w1p * 0.5) + Float64(-0.5 * t_5))))) / w1p))))) + Float64(-1.0 / Float64(1.0 + exp(Float64(-2.0 * Float64(Float64(log(99.0) * Float64(Float64(1.0 + ws) * Float64(Float64(w1p * -0.5) + Float64(x + Float64(0.5 * t_5))))) / w1p))))));
elseif ((w1p <= -2.1e-234) || !(w1p <= 2.8e-152))
tmp = t_4;
else
tmp = Float64(Float64(1.0 / Float64(1.0 + exp(Float64(Float64(Float64(log(99.0) * -2.0) / t_5) * Float64(x + Float64(Float64(w1p / 2.0) - Float64(t_5 / 2.0))))))) + Float64(-1.0 / Float64(1.0 + exp(Float64(Float64(Float64(1.0 + ws) * Float64(log(99.0) * Float64(-2.0 / w1p))) * Float64(x + Float64(Float64(t_5 - w1p) / 2.0)))))));
end
return tmp
end

function tmp = code(w1p, ws, x)
tmp = (1.0 / (1.0 + exp((((-2.0 * log(99.0)) / (w1p / (1.0 + ws))) * (x - ((-w1p / 2.0) + ((w1p / (1.0 + ws)) / 2.0))))))) - (1.0 / (1.0 + exp((((-2.0 * log(99.0)) / (w1p / (1.0 + ws))) * (x - ((w1p / 2.0) - ((w1p / (1.0 + ws)) / 2.0)))))));
end

function tmp_2 = code(w1p, ws, x)
t_0 = (log(99.0) * x) / w1p;
t_1 = -2.0 * t_0;
t_2 = exp(t_1);
t_3 = (t_2 + 1.0) ^ 2.0;
t_4 = ((((log(99.0) + t_1) * t_2) / t_3) + (-2.0 * ((t_2 * ((log(99.0) * -0.5) - t_0)) / t_3))) * ws;
t_5 = w1p / (1.0 + ws);
tmp = 0.0;
if (w1p <= -7.6e-172)
tmp = t_4;
elseif (w1p <= -1.6e-200)
tmp = (1.0 / (1.0 + exp((-2.0 * ((log(99.0) * ((1.0 + ws) * (x + ((w1p * 0.5) + (-0.5 * t_5))))) / w1p))))) + (-1.0 / (1.0 + exp((-2.0 * ((log(99.0) * ((1.0 + ws) * ((w1p * -0.5) + (x + (0.5 * t_5))))) / w1p)))));
elseif ((w1p <= -2.1e-234) || ~((w1p <= 2.8e-152)))
tmp = t_4;
else
tmp = (1.0 / (1.0 + exp((((log(99.0) * -2.0) / t_5) * (x + ((w1p / 2.0) - (t_5 / 2.0))))))) + (-1.0 / (1.0 + exp((((1.0 + ws) * (log(99.0) * (-2.0 / w1p))) * (x + ((t_5 - w1p) / 2.0))))));
end
tmp_2 = tmp;
end

code[w1p_, ws_, x_] := N[(N[(1.0 / N[(1.0 + N[Exp[N[(N[(N[((-2.0) * N[Log[99.0], $MachinePrecision]),$MachinePrecision] / N[(w1p / N[(1.0 + ws), $MachinePrecision]),$MachinePrecision]), $MachinePrecision] * N[(x - N[(N[((-w1p) / 2.0),$MachinePrecision] + N[(N[(w1p / N[(1.0 + ws), $MachinePrecision]),$MachinePrecision] / 2.0), $MachinePrecision]),$MachinePrecision]), $MachinePrecision]),$MachinePrecision]], $MachinePrecision]),$MachinePrecision]), $MachinePrecision] - N[(1.0 / N[(1.0 + N[Exp[N[(N[(N[((-2.0) * N[Log[99.0],$MachinePrecision]), $MachinePrecision] / N[(w1p / N[(1.0 + ws),$MachinePrecision]), $MachinePrecision]),$MachinePrecision] * N[(x - N[(N[(w1p / 2.0), $MachinePrecision] - N[(N[(w1p / N[(1.0 + ws),$MachinePrecision]), $MachinePrecision] / 2.0),$MachinePrecision]), $MachinePrecision]),$MachinePrecision]), $MachinePrecision]],$MachinePrecision]), $MachinePrecision]),$MachinePrecision]), $MachinePrecision]  code[w1p_, ws_, x_] := Block[{t$95$0 = N[(N[(N[Log[99.0],$MachinePrecision] * x), $MachinePrecision] / w1p),$MachinePrecision]}, Block[{t$95$1 = N[(-2.0 * t$95$0), $MachinePrecision]}, Block[{t$95$2 = N[Exp[t$95$1],$MachinePrecision]}, Block[{t$95$3 = N[Power[N[(t$95$2 + 1.0), $MachinePrecision], 2.0],$MachinePrecision]}, Block[{t$95$4 = N[(N[(N[(N[(N[(N[Log[99.0], $MachinePrecision] + t$95$1),$MachinePrecision] * t$95$2), $MachinePrecision] / t$95$3),$MachinePrecision] + N[(-2.0 * N[(N[(t$95$2 * N[(N[(N[Log[99.0], $MachinePrecision] * -0.5),$MachinePrecision] - t$95$0), $MachinePrecision]),$MachinePrecision] / t$95$3), $MachinePrecision]),$MachinePrecision]), $MachinePrecision] * ws),$MachinePrecision]}, Block[{t$95$5 = N[(w1p / N[(1.0 + ws), $MachinePrecision]),$MachinePrecision]}, If[LessEqual[w1p, -7.6e-172], t$95$4, If[LessEqual[w1p, -1.6e-200], N[(N[(1.0 / N[(1.0 + N[Exp[N[(-2.0 * N[(N[(N[Log[99.0], $MachinePrecision] * N[(N[(1.0 + ws),$MachinePrecision] * N[(x + N[(N[(w1p * 0.5), $MachinePrecision] + N[(-0.5 * t$95$5),$MachinePrecision]), $MachinePrecision]),$MachinePrecision]), $MachinePrecision]),$MachinePrecision] / w1p), $MachinePrecision]),$MachinePrecision]], $MachinePrecision]),$MachinePrecision]), $MachinePrecision] + N[(-1.0 / N[(1.0 + N[Exp[N[(-2.0 * N[(N[(N[Log[99.0],$MachinePrecision] * N[(N[(1.0 + ws), $MachinePrecision] * N[(N[(w1p * -0.5),$MachinePrecision] + N[(x + N[(0.5 * t$95$5), $MachinePrecision]),$MachinePrecision]), $MachinePrecision]),$MachinePrecision]), $MachinePrecision] / w1p),$MachinePrecision]), $MachinePrecision]],$MachinePrecision]), $MachinePrecision]),$MachinePrecision]), $MachinePrecision], If[Or[LessEqual[w1p, -2.1e-234], N[Not[LessEqual[w1p, 2.8e-152]],$MachinePrecision]], t$95$4, N[(N[(1.0 / N[(1.0 + N[Exp[N[(N[(N[(N[Log[99.0], $MachinePrecision] * -2.0),$MachinePrecision] / t$95$5), $MachinePrecision] * N[(x + N[(N[(w1p / 2.0),$MachinePrecision] - N[(t$95$5 / 2.0), $MachinePrecision]),$MachinePrecision]), $MachinePrecision]),$MachinePrecision]], $MachinePrecision]),$MachinePrecision]), $MachinePrecision] + N[(-1.0 / N[(1.0 + N[Exp[N[(N[(N[(1.0 + ws),$MachinePrecision] * N[(N[Log[99.0], $MachinePrecision] * N[(-2.0 / w1p),$MachinePrecision]), $MachinePrecision]),$MachinePrecision] * N[(x + N[(N[(t$95$5 - w1p), $MachinePrecision] / 2.0),$MachinePrecision]), $MachinePrecision]),$MachinePrecision]], $MachinePrecision]),$MachinePrecision]), $MachinePrecision]),$MachinePrecision]]]]]]]]]]

\frac{1}{1 + e^{\frac{\left(-2\right) \cdot \log 99}{\frac{w1p}{1 + ws}} \cdot \left(x - \left(\frac{-w1p}{2} + \frac{\frac{w1p}{1 + ws}}{2}\right)\right)}} - \frac{1}{1 + e^{\frac{\left(-2\right) \cdot \log 99}{\frac{w1p}{1 + ws}} \cdot \left(x - \left(\frac{w1p}{2} - \frac{\frac{w1p}{1 + ws}}{2}\right)\right)}}

\begin{array}{l}
t_0 := \frac{\log 99 \cdot x}{w1p}\\
t_1 := -2 \cdot t_0\\
t_2 := e^{t_1}\\
t_3 := {\left(t_2 + 1\right)}^{2}\\
t_4 := \left(\frac{\left(\log 99 + t_1\right) \cdot t_2}{t_3} + -2 \cdot \frac{t_2 \cdot \left(\log 99 \cdot -0.5 - t_0\right)}{t_3}\right) \cdot ws\\
t_5 := \frac{w1p}{1 + ws}\\
\mathbf{if}\;w1p \leq -7.6 \cdot 10^{-172}:\\
\;\;\;\;t_4\\

\mathbf{elif}\;w1p \leq -1.6 \cdot 10^{-200}:\\
\;\;\;\;\frac{1}{1 + e^{-2 \cdot \frac{\log 99 \cdot \left(\left(1 + ws\right) \cdot \left(x + \left(w1p \cdot 0.5 + -0.5 \cdot t_5\right)\right)\right)}{w1p}}} + \frac{-1}{1 + e^{-2 \cdot \frac{\log 99 \cdot \left(\left(1 + ws\right) \cdot \left(w1p \cdot -0.5 + \left(x + 0.5 \cdot t_5\right)\right)\right)}{w1p}}}\\

\mathbf{elif}\;w1p \leq -2.1 \cdot 10^{-234} \lor \neg \left(w1p \leq 2.8 \cdot 10^{-152}\right):\\
\;\;\;\;t_4\\

\mathbf{else}:\\
\;\;\;\;\frac{1}{1 + e^{\frac{\log 99 \cdot -2}{t_5} \cdot \left(x + \left(\frac{w1p}{2} - \frac{t_5}{2}\right)\right)}} + \frac{-1}{1 + e^{\left(\left(1 + ws\right) \cdot \left(\log 99 \cdot \frac{-2}{w1p}\right)\right) \cdot \left(x + \frac{t_5 - w1p}{2}\right)}}\\

\end{array}


# Try it out?

Results

 In Out
Enter valid numbers for all inputs

# Derivation?

1. Split input into 3 regimes
2. ## if w1p < -7.59999999999999974e-172 or -1.59999999999999991e-200 < w1p < -2.09999999999999991e-234 or 2.79999999999999984e-152 < w1p

1. Initial program 40.7

$\frac{1}{1 + e^{\frac{\left(-2\right) \cdot \log 99}{\frac{w1p}{1 + ws}} \cdot \left(x - \left(\frac{-w1p}{2} + \frac{\frac{w1p}{1 + ws}}{2}\right)\right)}} - \frac{1}{1 + e^{\frac{\left(-2\right) \cdot \log 99}{\frac{w1p}{1 + ws}} \cdot \left(x - \left(\frac{w1p}{2} - \frac{\frac{w1p}{1 + ws}}{2}\right)\right)}}$
2. Simplified41.8

$\leadsto \color{blue}{\frac{1}{1 + e^{\left(\frac{-2 \cdot \log 99}{w1p} \cdot \left(1 + ws\right)\right) \cdot \left(x - \left(\frac{-w1p}{2} + \frac{w1p}{2 \cdot \left(1 + ws\right)}\right)\right)}} - \frac{1}{1 + {\left(e^{\frac{-2 \cdot \log 99}{w1p} \cdot \left(1 + ws\right)}\right)}^{\left(\left(x - \frac{w1p}{2}\right) + \frac{w1p}{2 \cdot \left(1 + ws\right)}\right)}}}$
Proof
[Start]40.7 $\frac{1}{1 + e^{\frac{\left(-2\right) \cdot \log 99}{\frac{w1p}{1 + ws}} \cdot \left(x - \left(\frac{-w1p}{2} + \frac{\frac{w1p}{1 + ws}}{2}\right)\right)}} - \frac{1}{1 + e^{\frac{\left(-2\right) \cdot \log 99}{\frac{w1p}{1 + ws}} \cdot \left(x - \left(\frac{w1p}{2} - \frac{\frac{w1p}{1 + ws}}{2}\right)\right)}}$
3. Applied egg-rr41.9

$\leadsto \frac{1}{1 + e^{\left(\frac{-2 \cdot \log 99}{w1p} \cdot \left(1 + ws\right)\right) \cdot \left(x - \color{blue}{\frac{2 + \left(2 \cdot \frac{1 + ws}{w1p}\right) \cdot \left(-w1p\right)}{\left(2 \cdot \frac{1 + ws}{w1p}\right) \cdot 2}}\right)}} - \frac{1}{1 + {\left(e^{\frac{-2 \cdot \log 99}{w1p} \cdot \left(1 + ws\right)}\right)}^{\left(\left(x - \frac{w1p}{2}\right) + \frac{w1p}{2 \cdot \left(1 + ws\right)}\right)}}$
4. Simplified41.9

$\leadsto \frac{1}{1 + e^{\left(\frac{-2 \cdot \log 99}{w1p} \cdot \left(1 + ws\right)\right) \cdot \left(x - \color{blue}{\frac{2 + \left(w1p \cdot -2\right) \cdot \frac{1 + ws}{w1p}}{\frac{1 + ws}{\frac{w1p}{4}}}}\right)}} - \frac{1}{1 + {\left(e^{\frac{-2 \cdot \log 99}{w1p} \cdot \left(1 + ws\right)}\right)}^{\left(\left(x - \frac{w1p}{2}\right) + \frac{w1p}{2 \cdot \left(1 + ws\right)}\right)}}$
Proof
[Start]41.9 $\frac{1}{1 + e^{\left(\frac{-2 \cdot \log 99}{w1p} \cdot \left(1 + ws\right)\right) \cdot \left(x - \frac{2 + \left(2 \cdot \frac{1 + ws}{w1p}\right) \cdot \left(-w1p\right)}{\left(2 \cdot \frac{1 + ws}{w1p}\right) \cdot 2}\right)}} - \frac{1}{1 + {\left(e^{\frac{-2 \cdot \log 99}{w1p} \cdot \left(1 + ws\right)}\right)}^{\left(\left(x - \frac{w1p}{2}\right) + \frac{w1p}{2 \cdot \left(1 + ws\right)}\right)}}$ $\frac{1}{1 + e^{\left(\frac{-2 \cdot \log 99}{w1p} \cdot \left(1 + ws\right)\right) \cdot \left(x - \frac{2 + \color{blue}{\left(-w1p\right) \cdot \left(2 \cdot \frac{1 + ws}{w1p}\right)}}{\left(2 \cdot \frac{1 + ws}{w1p}\right) \cdot 2}\right)}} - \frac{1}{1 + {\left(e^{\frac{-2 \cdot \log 99}{w1p} \cdot \left(1 + ws\right)}\right)}^{\left(\left(x - \frac{w1p}{2}\right) + \frac{w1p}{2 \cdot \left(1 + ws\right)}\right)}}$ $\frac{1}{1 + e^{\left(\frac{-2 \cdot \log 99}{w1p} \cdot \left(1 + ws\right)\right) \cdot \left(x - \frac{2 + \color{blue}{\left(\left(-w1p\right) \cdot 2\right) \cdot \frac{1 + ws}{w1p}}}{\left(2 \cdot \frac{1 + ws}{w1p}\right) \cdot 2}\right)}} - \frac{1}{1 + {\left(e^{\frac{-2 \cdot \log 99}{w1p} \cdot \left(1 + ws\right)}\right)}^{\left(\left(x - \frac{w1p}{2}\right) + \frac{w1p}{2 \cdot \left(1 + ws\right)}\right)}}$ $\frac{1}{1 + e^{\left(\frac{-2 \cdot \log 99}{w1p} \cdot \left(1 + ws\right)\right) \cdot \left(x - \frac{2 + \color{blue}{\left(-w1p \cdot 2\right)} \cdot \frac{1 + ws}{w1p}}{\left(2 \cdot \frac{1 + ws}{w1p}\right) \cdot 2}\right)}} - \frac{1}{1 + {\left(e^{\frac{-2 \cdot \log 99}{w1p} \cdot \left(1 + ws\right)}\right)}^{\left(\left(x - \frac{w1p}{2}\right) + \frac{w1p}{2 \cdot \left(1 + ws\right)}\right)}}$ $\frac{1}{1 + e^{\left(\frac{-2 \cdot \log 99}{w1p} \cdot \left(1 + ws\right)\right) \cdot \left(x - \frac{2 + \color{blue}{\left(w1p \cdot \left(-2\right)\right)} \cdot \frac{1 + ws}{w1p}}{\left(2 \cdot \frac{1 + ws}{w1p}\right) \cdot 2}\right)}} - \frac{1}{1 + {\left(e^{\frac{-2 \cdot \log 99}{w1p} \cdot \left(1 + ws\right)}\right)}^{\left(\left(x - \frac{w1p}{2}\right) + \frac{w1p}{2 \cdot \left(1 + ws\right)}\right)}}$ $\frac{1}{1 + e^{\left(\frac{-2 \cdot \log 99}{w1p} \cdot \left(1 + ws\right)\right) \cdot \left(x - \frac{2 + \left(w1p \cdot \color{blue}{-2}\right) \cdot \frac{1 + ws}{w1p}}{\left(2 \cdot \frac{1 + ws}{w1p}\right) \cdot 2}\right)}} - \frac{1}{1 + {\left(e^{\frac{-2 \cdot \log 99}{w1p} \cdot \left(1 + ws\right)}\right)}^{\left(\left(x - \frac{w1p}{2}\right) + \frac{w1p}{2 \cdot \left(1 + ws\right)}\right)}}$ $\frac{1}{1 + e^{\left(\frac{-2 \cdot \log 99}{w1p} \cdot \left(1 + ws\right)\right) \cdot \left(x - \frac{2 + \left(w1p \cdot -2\right) \cdot \frac{1 + ws}{w1p}}{\color{blue}{2 \cdot \left(2 \cdot \frac{1 + ws}{w1p}\right)}}\right)}} - \frac{1}{1 + {\left(e^{\frac{-2 \cdot \log 99}{w1p} \cdot \left(1 + ws\right)}\right)}^{\left(\left(x - \frac{w1p}{2}\right) + \frac{w1p}{2 \cdot \left(1 + ws\right)}\right)}}$ $\frac{1}{1 + e^{\left(\frac{-2 \cdot \log 99}{w1p} \cdot \left(1 + ws\right)\right) \cdot \left(x - \frac{2 + \left(w1p \cdot -2\right) \cdot \frac{1 + ws}{w1p}}{\color{blue}{\left(2 \cdot 2\right) \cdot \frac{1 + ws}{w1p}}}\right)}} - \frac{1}{1 + {\left(e^{\frac{-2 \cdot \log 99}{w1p} \cdot \left(1 + ws\right)}\right)}^{\left(\left(x - \frac{w1p}{2}\right) + \frac{w1p}{2 \cdot \left(1 + ws\right)}\right)}}$ $\frac{1}{1 + e^{\left(\frac{-2 \cdot \log 99}{w1p} \cdot \left(1 + ws\right)\right) \cdot \left(x - \frac{2 + \left(w1p \cdot -2\right) \cdot \frac{1 + ws}{w1p}}{\color{blue}{4} \cdot \frac{1 + ws}{w1p}}\right)}} - \frac{1}{1 + {\left(e^{\frac{-2 \cdot \log 99}{w1p} \cdot \left(1 + ws\right)}\right)}^{\left(\left(x - \frac{w1p}{2}\right) + \frac{w1p}{2 \cdot \left(1 + ws\right)}\right)}}$ $\frac{1}{1 + e^{\left(\frac{-2 \cdot \log 99}{w1p} \cdot \left(1 + ws\right)\right) \cdot \left(x - \frac{2 + \left(w1p \cdot -2\right) \cdot \frac{1 + ws}{w1p}}{\color{blue}{\frac{4 \cdot \left(1 + ws\right)}{w1p}}}\right)}} - \frac{1}{1 + {\left(e^{\frac{-2 \cdot \log 99}{w1p} \cdot \left(1 + ws\right)}\right)}^{\left(\left(x - \frac{w1p}{2}\right) + \frac{w1p}{2 \cdot \left(1 + ws\right)}\right)}}$ $\frac{1}{1 + e^{\left(\frac{-2 \cdot \log 99}{w1p} \cdot \left(1 + ws\right)\right) \cdot \left(x - \frac{2 + \left(w1p \cdot -2\right) \cdot \frac{1 + ws}{w1p}}{\frac{\color{blue}{\left(1 + ws\right) \cdot 4}}{w1p}}\right)}} - \frac{1}{1 + {\left(e^{\frac{-2 \cdot \log 99}{w1p} \cdot \left(1 + ws\right)}\right)}^{\left(\left(x - \frac{w1p}{2}\right) + \frac{w1p}{2 \cdot \left(1 + ws\right)}\right)}}$ $\frac{1}{1 + e^{\left(\frac{-2 \cdot \log 99}{w1p} \cdot \left(1 + ws\right)\right) \cdot \left(x - \frac{2 + \left(w1p \cdot -2\right) \cdot \frac{1 + ws}{w1p}}{\color{blue}{\frac{1 + ws}{\frac{w1p}{4}}}}\right)}} - \frac{1}{1 + {\left(e^{\frac{-2 \cdot \log 99}{w1p} \cdot \left(1 + ws\right)}\right)}^{\left(\left(x - \frac{w1p}{2}\right) + \frac{w1p}{2 \cdot \left(1 + ws\right)}\right)}}$
5. Taylor expanded in ws around 0 10.4

$\leadsto \color{blue}{\left(\frac{\left(\log 99 + -2 \cdot \frac{\log 99 \cdot x}{w1p}\right) \cdot e^{-2 \cdot \frac{\log 99 \cdot x}{w1p}}}{{\left(1 + e^{-2 \cdot \frac{\log 99 \cdot x}{w1p}}\right)}^{2}} - -2 \cdot \frac{\left(\frac{\log 99 \cdot x}{w1p} + 0.5 \cdot \log 99\right) \cdot e^{-2 \cdot \frac{\log 99 \cdot x}{w1p}}}{{\left(1 + e^{-2 \cdot \frac{\log 99 \cdot x}{w1p}}\right)}^{2}}\right) \cdot ws}$

## if -7.59999999999999974e-172 < w1p < -1.59999999999999991e-200

1. Initial program 24.0

$\frac{1}{1 + e^{\frac{\left(-2\right) \cdot \log 99}{\frac{w1p}{1 + ws}} \cdot \left(x - \left(\frac{-w1p}{2} + \frac{\frac{w1p}{1 + ws}}{2}\right)\right)}} - \frac{1}{1 + e^{\frac{\left(-2\right) \cdot \log 99}{\frac{w1p}{1 + ws}} \cdot \left(x - \left(\frac{w1p}{2} - \frac{\frac{w1p}{1 + ws}}{2}\right)\right)}}$
2. Taylor expanded in w1p around 0 24.0

$\leadsto \color{blue}{\frac{1}{1 + e^{-2 \cdot \frac{\log 99 \cdot \left(\left(x - \left(-0.5 \cdot w1p + 0.5 \cdot \frac{w1p}{1 + ws}\right)\right) \cdot \left(1 + ws\right)\right)}{w1p}}} - \frac{1}{1 + e^{-2 \cdot \frac{\log 99 \cdot \left(\left(1 + ws\right) \cdot \left(\left(0.5 \cdot \frac{w1p}{1 + ws} + x\right) - 0.5 \cdot w1p\right)\right)}{w1p}}}}$

## if -2.09999999999999991e-234 < w1p < 2.79999999999999984e-152

1. Initial program 12.3

$\frac{1}{1 + e^{\frac{\left(-2\right) \cdot \log 99}{\frac{w1p}{1 + ws}} \cdot \left(x - \left(\frac{-w1p}{2} + \frac{\frac{w1p}{1 + ws}}{2}\right)\right)}} - \frac{1}{1 + e^{\frac{\left(-2\right) \cdot \log 99}{\frac{w1p}{1 + ws}} \cdot \left(x - \left(\frac{w1p}{2} - \frac{\frac{w1p}{1 + ws}}{2}\right)\right)}}$
2. Applied egg-rr12.3

$\leadsto \frac{1}{1 + e^{\frac{\left(-2\right) \cdot \log 99}{\frac{w1p}{1 + ws}} \cdot \left(x - \left(\frac{-w1p}{2} + \frac{\frac{w1p}{1 + ws}}{2}\right)\right)}} - \frac{1}{1 + e^{\color{blue}{{\left(\left(\left(1 + ws\right) \cdot \frac{-2 \cdot \log 99}{w1p}\right) \cdot \left(x - \frac{w1p - \frac{w1p}{1 + ws}}{2}\right)\right)}^{1}}}}$
3. Simplified12.3

$\leadsto \frac{1}{1 + e^{\frac{\left(-2\right) \cdot \log 99}{\frac{w1p}{1 + ws}} \cdot \left(x - \left(\frac{-w1p}{2} + \frac{\frac{w1p}{1 + ws}}{2}\right)\right)}} - \frac{1}{1 + e^{\color{blue}{\left(\left(1 + ws\right) \cdot \left(\frac{-2}{w1p} \cdot \log 99\right)\right) \cdot \left(x - \frac{w1p - \frac{w1p}{1 + ws}}{2}\right)}}}$
Proof
[Start]12.3 $\frac{1}{1 + e^{\frac{\left(-2\right) \cdot \log 99}{\frac{w1p}{1 + ws}} \cdot \left(x - \left(\frac{-w1p}{2} + \frac{\frac{w1p}{1 + ws}}{2}\right)\right)}} - \frac{1}{1 + e^{{\left(\left(\left(1 + ws\right) \cdot \frac{-2 \cdot \log 99}{w1p}\right) \cdot \left(x - \frac{w1p - \frac{w1p}{1 + ws}}{2}\right)\right)}^{1}}}$ $\frac{1}{1 + e^{\frac{\left(-2\right) \cdot \log 99}{\frac{w1p}{1 + ws}} \cdot \left(x - \left(\frac{-w1p}{2} + \frac{\frac{w1p}{1 + ws}}{2}\right)\right)}} - \frac{1}{1 + e^{\color{blue}{\left(\left(1 + ws\right) \cdot \frac{-2 \cdot \log 99}{w1p}\right) \cdot \left(x - \frac{w1p - \frac{w1p}{1 + ws}}{2}\right)}}}$ $\frac{1}{1 + e^{\frac{\left(-2\right) \cdot \log 99}{\frac{w1p}{1 + ws}} \cdot \left(x - \left(\frac{-w1p}{2} + \frac{\frac{w1p}{1 + ws}}{2}\right)\right)}} - \frac{1}{1 + e^{\left(\left(1 + ws\right) \cdot \color{blue}{\frac{-2}{\frac{w1p}{\log 99}}}\right) \cdot \left(x - \frac{w1p - \frac{w1p}{1 + ws}}{2}\right)}}$ $\frac{1}{1 + e^{\frac{\left(-2\right) \cdot \log 99}{\frac{w1p}{1 + ws}} \cdot \left(x - \left(\frac{-w1p}{2} + \frac{\frac{w1p}{1 + ws}}{2}\right)\right)}} - \frac{1}{1 + e^{\left(\left(1 + ws\right) \cdot \color{blue}{\left(\frac{-2}{w1p} \cdot \log 99\right)}\right) \cdot \left(x - \frac{w1p - \frac{w1p}{1 + ws}}{2}\right)}}$
3. Recombined 3 regimes into one program.
4. Final simplification11.8

$\leadsto \begin{array}{l} \mathbf{if}\;w1p \leq -7.6 \cdot 10^{-172}:\\ \;\;\;\;\left(\frac{\left(\log 99 + -2 \cdot \frac{\log 99 \cdot x}{w1p}\right) \cdot e^{-2 \cdot \frac{\log 99 \cdot x}{w1p}}}{{\left(e^{-2 \cdot \frac{\log 99 \cdot x}{w1p}} + 1\right)}^{2}} + -2 \cdot \frac{e^{-2 \cdot \frac{\log 99 \cdot x}{w1p}} \cdot \left(\log 99 \cdot -0.5 - \frac{\log 99 \cdot x}{w1p}\right)}{{\left(e^{-2 \cdot \frac{\log 99 \cdot x}{w1p}} + 1\right)}^{2}}\right) \cdot ws\\ \mathbf{elif}\;w1p \leq -1.6 \cdot 10^{-200}:\\ \;\;\;\;\frac{1}{1 + e^{-2 \cdot \frac{\log 99 \cdot \left(\left(1 + ws\right) \cdot \left(x + \left(w1p \cdot 0.5 + -0.5 \cdot \frac{w1p}{1 + ws}\right)\right)\right)}{w1p}}} + \frac{-1}{1 + e^{-2 \cdot \frac{\log 99 \cdot \left(\left(1 + ws\right) \cdot \left(w1p \cdot -0.5 + \left(x + 0.5 \cdot \frac{w1p}{1 + ws}\right)\right)\right)}{w1p}}}\\ \mathbf{elif}\;w1p \leq -2.1 \cdot 10^{-234} \lor \neg \left(w1p \leq 2.8 \cdot 10^{-152}\right):\\ \;\;\;\;\left(\frac{\left(\log 99 + -2 \cdot \frac{\log 99 \cdot x}{w1p}\right) \cdot e^{-2 \cdot \frac{\log 99 \cdot x}{w1p}}}{{\left(e^{-2 \cdot \frac{\log 99 \cdot x}{w1p}} + 1\right)}^{2}} + -2 \cdot \frac{e^{-2 \cdot \frac{\log 99 \cdot x}{w1p}} \cdot \left(\log 99 \cdot -0.5 - \frac{\log 99 \cdot x}{w1p}\right)}{{\left(e^{-2 \cdot \frac{\log 99 \cdot x}{w1p}} + 1\right)}^{2}}\right) \cdot ws\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{1 + e^{\frac{\log 99 \cdot -2}{\frac{w1p}{1 + ws}} \cdot \left(x + \left(\frac{w1p}{2} - \frac{\frac{w1p}{1 + ws}}{2}\right)\right)}} + \frac{-1}{1 + e^{\left(\left(1 + ws\right) \cdot \left(\log 99 \cdot \frac{-2}{w1p}\right)\right) \cdot \left(x + \frac{\frac{w1p}{1 + ws} - w1p}{2}\right)}}\\ \end{array}$

# Alternatives

Alternative 1
Error29.3
Cost29120
$\begin{array}{l} t_0 := \frac{w1p}{1 + ws}\\ \frac{1}{1 + e^{-2 \cdot \frac{\log 99 \cdot \left(\left(1 + ws\right) \cdot \left(x + \left(w1p \cdot 0.5 + -0.5 \cdot t_0\right)\right)\right)}{w1p}}} + \frac{-1}{1 + e^{-2 \cdot \frac{\log 99 \cdot \left(\left(1 + ws\right) \cdot \left(w1p \cdot -0.5 + \left(x + 0.5 \cdot t_0\right)\right)\right)}{w1p}}} \end{array}$
Alternative 2
Error29.9
Cost28480
$\begin{array}{l} t_0 := \frac{w1p}{1 + ws}\\ \frac{1}{1 + e^{\frac{\log 99 \cdot -2}{t_0} \cdot \left(x + w1p \cdot 0\right)}} + \frac{-1}{1 + e^{\left(\left(1 + ws\right) \cdot \left(\log 99 \cdot \frac{-2}{w1p}\right)\right) \cdot \left(x + \frac{t_0 - w1p}{2}\right)}} \end{array}$
Alternative 3
Error29.9
Cost28096
$\frac{1}{1 + e^{\left(\left(1 + ws\right) \cdot \frac{\log 99 \cdot -2}{w1p}\right) \cdot \left(x + \left(\frac{w1p}{2} - \frac{w1p}{2 \cdot \left(1 + ws\right)}\right)\right)}} + \frac{-1}{e^{-2 \cdot \frac{\log 99 \cdot x}{w1p}} + 1}$
Alternative 4
Error30.1
Cost27072
$\begin{array}{l} t_0 := \frac{1}{e^{-2 \cdot \frac{\log 99 \cdot x}{w1p}} + 1}\\ t_0 - t_0 \end{array}$
Alternative 5
Error30.9
Cost21504
$\frac{1}{1 + e^{\left(-1 + -2 \cdot \frac{-0.5}{1 + ws}\right) \cdot \left(\log 99 \cdot \left(1 + ws\right)\right)}} + \frac{-1}{1 + {99}^{\left(\left(1 + ws\right) \cdot \left(1 + \frac{-1}{1 + ws}\right)\right)}}$
Alternative 6
Error61.3
Cost13632
$0.5 + \frac{-1}{e^{-2 \cdot \frac{\log 99 \cdot x}{w1p}} + 1}$

# Reproduce?

herbie shell --seed 1
(FPCore (w1p ws x)
:name "1/(1 + exp(-2*log(99.0)/( w1p/(1+ws))*(x-(-w1p/2.0 +  w1p/(1+ws)/2)))) - 1/(1 + exp(-2*log(99.0)/( w1p/(1+ws))*(x-(w1p/2.0 -  w1p/(1+ws)/2))))"
:precision binary64
:pre (and (and (and (<= -10.0 w1p) (<= w1p 10.0)) (and (<= -10.0 ws) (<= ws 10.0))) (and (<= -1000.0 x) (<= x 1000.0)))
(- (/ 1.0 (+ 1.0 (exp (* (/ (* (- 2.0) (log 99.0)) (/ w1p (+ 1.0 ws))) (- x (+ (/ (- w1p) 2.0) (/ (/ w1p (+ 1.0 ws)) 2.0))))))) (/ 1.0 (+ 1.0 (exp (* (/ (* (- 2.0) (log 99.0)) (/ w1p (+ 1.0 ws))) (- x (- (/ w1p 2.0) (/ (/ w1p (+ 1.0 ws)) 2.0)))))))))