Harley's example

Percentage Accurate: 90.4% → 96.0%
Time: 57.6s
Alternatives: 11
Speedup: 64.0×

Specification

?
\[0 < c\_p \land 0 < c\_n\]
\[\begin{array}{l} t_1 := \frac{1}{1 + e^{-t}}\\ t_2 := \frac{1}{1 + e^{-s}}\\ \frac{{t\_2}^{c\_p} \cdot {\left(1 - t\_2\right)}^{c\_n}}{{t\_1}^{c\_p} \cdot {\left(1 - t\_1\right)}^{c\_n}} \end{array} \]
(FPCore (c_p c_n t s)
  :precision binary64
  (let* ((t_1 (/ 1 (+ 1 (exp (- t))))) (t_2 (/ 1 (+ 1 (exp (- s))))))
  (/
   (* (pow t_2 c_p) (pow (- 1 t_2) c_n))
   (* (pow t_1 c_p) (pow (- 1 t_1) c_n)))))
double code(double c_p, double c_n, double t, double s) {
	double t_1 = 1.0 / (1.0 + exp(-t));
	double t_2 = 1.0 / (1.0 + exp(-s));
	return (pow(t_2, c_p) * pow((1.0 - t_2), c_n)) / (pow(t_1, c_p) * pow((1.0 - t_1), c_n));
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

real(8) function code(c_p, c_n, t, s)
use fmin_fmax_functions
    real(8), intent (in) :: c_p
    real(8), intent (in) :: c_n
    real(8), intent (in) :: t
    real(8), intent (in) :: s
    real(8) :: t_1
    real(8) :: t_2
    t_1 = 1.0d0 / (1.0d0 + exp(-t))
    t_2 = 1.0d0 / (1.0d0 + exp(-s))
    code = ((t_2 ** c_p) * ((1.0d0 - t_2) ** c_n)) / ((t_1 ** c_p) * ((1.0d0 - t_1) ** c_n))
end function
public static double code(double c_p, double c_n, double t, double s) {
	double t_1 = 1.0 / (1.0 + Math.exp(-t));
	double t_2 = 1.0 / (1.0 + Math.exp(-s));
	return (Math.pow(t_2, c_p) * Math.pow((1.0 - t_2), c_n)) / (Math.pow(t_1, c_p) * Math.pow((1.0 - t_1), c_n));
}
def code(c_p, c_n, t, s):
	t_1 = 1.0 / (1.0 + math.exp(-t))
	t_2 = 1.0 / (1.0 + math.exp(-s))
	return (math.pow(t_2, c_p) * math.pow((1.0 - t_2), c_n)) / (math.pow(t_1, c_p) * math.pow((1.0 - t_1), c_n))
function code(c_p, c_n, t, s)
	t_1 = Float64(1.0 / Float64(1.0 + exp(Float64(-t))))
	t_2 = Float64(1.0 / Float64(1.0 + exp(Float64(-s))))
	return Float64(Float64((t_2 ^ c_p) * (Float64(1.0 - t_2) ^ c_n)) / Float64((t_1 ^ c_p) * (Float64(1.0 - t_1) ^ c_n)))
end
function tmp = code(c_p, c_n, t, s)
	t_1 = 1.0 / (1.0 + exp(-t));
	t_2 = 1.0 / (1.0 + exp(-s));
	tmp = ((t_2 ^ c_p) * ((1.0 - t_2) ^ c_n)) / ((t_1 ^ c_p) * ((1.0 - t_1) ^ c_n));
end
code[c$95$p_, c$95$n_, t_, s_] := Block[{t$95$1 = N[(1 / N[(1 + N[Exp[(-t)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(1 / N[(1 + N[Exp[(-s)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(N[(N[Power[t$95$2, c$95$p], $MachinePrecision] * N[Power[N[(1 - t$95$2), $MachinePrecision], c$95$n], $MachinePrecision]), $MachinePrecision] / N[(N[Power[t$95$1, c$95$p], $MachinePrecision] * N[Power[N[(1 - t$95$1), $MachinePrecision], c$95$n], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
t_1 := \frac{1}{1 + e^{-t}}\\
t_2 := \frac{1}{1 + e^{-s}}\\
\frac{{t\_2}^{c\_p} \cdot {\left(1 - t\_2\right)}^{c\_n}}{{t\_1}^{c\_p} \cdot {\left(1 - t\_1\right)}^{c\_n}}
\end{array}

Local Percentage Accuracy vs ?

The average percentage accuracy by input value. Horizontal axis shows value of an input variable; the variable is choosen in the title. Vertical axis is accuracy; higher is better. Red represent the original program, while blue represents Herbie's suggestion. These can be toggled with buttons below the plot. The line is an average while dots represent individual samples.

Accuracy vs Speed?

Herbie found 11 alternatives:

AlternativeAccuracySpeedup
The accuracy (vertical axis) and speed (horizontal axis) of each alternatives. Up and to the right is better. The red square shows the initial program, and each blue circle shows an alternative.The line shows the best available speed-accuracy tradeoffs.

Initial Program: 90.4% accurate, 1.0× speedup?

\[\begin{array}{l} t_1 := \frac{1}{1 + e^{-t}}\\ t_2 := \frac{1}{1 + e^{-s}}\\ \frac{{t\_2}^{c\_p} \cdot {\left(1 - t\_2\right)}^{c\_n}}{{t\_1}^{c\_p} \cdot {\left(1 - t\_1\right)}^{c\_n}} \end{array} \]
(FPCore (c_p c_n t s)
  :precision binary64
  (let* ((t_1 (/ 1 (+ 1 (exp (- t))))) (t_2 (/ 1 (+ 1 (exp (- s))))))
  (/
   (* (pow t_2 c_p) (pow (- 1 t_2) c_n))
   (* (pow t_1 c_p) (pow (- 1 t_1) c_n)))))
double code(double c_p, double c_n, double t, double s) {
	double t_1 = 1.0 / (1.0 + exp(-t));
	double t_2 = 1.0 / (1.0 + exp(-s));
	return (pow(t_2, c_p) * pow((1.0 - t_2), c_n)) / (pow(t_1, c_p) * pow((1.0 - t_1), c_n));
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

real(8) function code(c_p, c_n, t, s)
use fmin_fmax_functions
    real(8), intent (in) :: c_p
    real(8), intent (in) :: c_n
    real(8), intent (in) :: t
    real(8), intent (in) :: s
    real(8) :: t_1
    real(8) :: t_2
    t_1 = 1.0d0 / (1.0d0 + exp(-t))
    t_2 = 1.0d0 / (1.0d0 + exp(-s))
    code = ((t_2 ** c_p) * ((1.0d0 - t_2) ** c_n)) / ((t_1 ** c_p) * ((1.0d0 - t_1) ** c_n))
end function
public static double code(double c_p, double c_n, double t, double s) {
	double t_1 = 1.0 / (1.0 + Math.exp(-t));
	double t_2 = 1.0 / (1.0 + Math.exp(-s));
	return (Math.pow(t_2, c_p) * Math.pow((1.0 - t_2), c_n)) / (Math.pow(t_1, c_p) * Math.pow((1.0 - t_1), c_n));
}
def code(c_p, c_n, t, s):
	t_1 = 1.0 / (1.0 + math.exp(-t))
	t_2 = 1.0 / (1.0 + math.exp(-s))
	return (math.pow(t_2, c_p) * math.pow((1.0 - t_2), c_n)) / (math.pow(t_1, c_p) * math.pow((1.0 - t_1), c_n))
function code(c_p, c_n, t, s)
	t_1 = Float64(1.0 / Float64(1.0 + exp(Float64(-t))))
	t_2 = Float64(1.0 / Float64(1.0 + exp(Float64(-s))))
	return Float64(Float64((t_2 ^ c_p) * (Float64(1.0 - t_2) ^ c_n)) / Float64((t_1 ^ c_p) * (Float64(1.0 - t_1) ^ c_n)))
end
function tmp = code(c_p, c_n, t, s)
	t_1 = 1.0 / (1.0 + exp(-t));
	t_2 = 1.0 / (1.0 + exp(-s));
	tmp = ((t_2 ^ c_p) * ((1.0 - t_2) ^ c_n)) / ((t_1 ^ c_p) * ((1.0 - t_1) ^ c_n));
end
code[c$95$p_, c$95$n_, t_, s_] := Block[{t$95$1 = N[(1 / N[(1 + N[Exp[(-t)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(1 / N[(1 + N[Exp[(-s)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(N[(N[Power[t$95$2, c$95$p], $MachinePrecision] * N[Power[N[(1 - t$95$2), $MachinePrecision], c$95$n], $MachinePrecision]), $MachinePrecision] / N[(N[Power[t$95$1, c$95$p], $MachinePrecision] * N[Power[N[(1 - t$95$1), $MachinePrecision], c$95$n], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
t_1 := \frac{1}{1 + e^{-t}}\\
t_2 := \frac{1}{1 + e^{-s}}\\
\frac{{t\_2}^{c\_p} \cdot {\left(1 - t\_2\right)}^{c\_n}}{{t\_1}^{c\_p} \cdot {\left(1 - t\_1\right)}^{c\_n}}
\end{array}

Alternative 1: 96.0% accurate, 2.0× speedup?

\[\begin{array}{l} t_1 := \frac{1}{1 + e^{-t}}\\ t_2 := \frac{1}{1 + e^{-s}}\\ \mathbf{if}\;s \leq -3700000000000000158015604916224:\\ \;\;\;\;\frac{{t\_2}^{c\_p}}{1 + c\_p \cdot \log t\_1}\\ \mathbf{else}:\\ \;\;\;\;\frac{{\left(1 - t\_2\right)}^{c\_n}}{{\left(1 - t\_1\right)}^{c\_n}}\\ \end{array} \]
(FPCore (c_p c_n t s)
  :precision binary64
  (let* ((t_1 (/ 1 (+ 1 (exp (- t))))) (t_2 (/ 1 (+ 1 (exp (- s))))))
  (if (<= s -3700000000000000158015604916224)
    (/ (pow t_2 c_p) (+ 1 (* c_p (log t_1))))
    (/ (pow (- 1 t_2) c_n) (pow (- 1 t_1) c_n)))))
double code(double c_p, double c_n, double t, double s) {
	double t_1 = 1.0 / (1.0 + exp(-t));
	double t_2 = 1.0 / (1.0 + exp(-s));
	double tmp;
	if (s <= -3.7e+30) {
		tmp = pow(t_2, c_p) / (1.0 + (c_p * log(t_1)));
	} else {
		tmp = pow((1.0 - t_2), c_n) / pow((1.0 - t_1), c_n);
	}
	return tmp;
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

real(8) function code(c_p, c_n, t, s)
use fmin_fmax_functions
    real(8), intent (in) :: c_p
    real(8), intent (in) :: c_n
    real(8), intent (in) :: t
    real(8), intent (in) :: s
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = 1.0d0 / (1.0d0 + exp(-t))
    t_2 = 1.0d0 / (1.0d0 + exp(-s))
    if (s <= (-3.7d+30)) then
        tmp = (t_2 ** c_p) / (1.0d0 + (c_p * log(t_1)))
    else
        tmp = ((1.0d0 - t_2) ** c_n) / ((1.0d0 - t_1) ** c_n)
    end if
    code = tmp
end function
public static double code(double c_p, double c_n, double t, double s) {
	double t_1 = 1.0 / (1.0 + Math.exp(-t));
	double t_2 = 1.0 / (1.0 + Math.exp(-s));
	double tmp;
	if (s <= -3.7e+30) {
		tmp = Math.pow(t_2, c_p) / (1.0 + (c_p * Math.log(t_1)));
	} else {
		tmp = Math.pow((1.0 - t_2), c_n) / Math.pow((1.0 - t_1), c_n);
	}
	return tmp;
}
def code(c_p, c_n, t, s):
	t_1 = 1.0 / (1.0 + math.exp(-t))
	t_2 = 1.0 / (1.0 + math.exp(-s))
	tmp = 0
	if s <= -3.7e+30:
		tmp = math.pow(t_2, c_p) / (1.0 + (c_p * math.log(t_1)))
	else:
		tmp = math.pow((1.0 - t_2), c_n) / math.pow((1.0 - t_1), c_n)
	return tmp
function code(c_p, c_n, t, s)
	t_1 = Float64(1.0 / Float64(1.0 + exp(Float64(-t))))
	t_2 = Float64(1.0 / Float64(1.0 + exp(Float64(-s))))
	tmp = 0.0
	if (s <= -3.7e+30)
		tmp = Float64((t_2 ^ c_p) / Float64(1.0 + Float64(c_p * log(t_1))));
	else
		tmp = Float64((Float64(1.0 - t_2) ^ c_n) / (Float64(1.0 - t_1) ^ c_n));
	end
	return tmp
end
function tmp_2 = code(c_p, c_n, t, s)
	t_1 = 1.0 / (1.0 + exp(-t));
	t_2 = 1.0 / (1.0 + exp(-s));
	tmp = 0.0;
	if (s <= -3.7e+30)
		tmp = (t_2 ^ c_p) / (1.0 + (c_p * log(t_1)));
	else
		tmp = ((1.0 - t_2) ^ c_n) / ((1.0 - t_1) ^ c_n);
	end
	tmp_2 = tmp;
end
code[c$95$p_, c$95$n_, t_, s_] := Block[{t$95$1 = N[(1 / N[(1 + N[Exp[(-t)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(1 / N[(1 + N[Exp[(-s)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[s, -3700000000000000158015604916224], N[(N[Power[t$95$2, c$95$p], $MachinePrecision] / N[(1 + N[(c$95$p * N[Log[t$95$1], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Power[N[(1 - t$95$2), $MachinePrecision], c$95$n], $MachinePrecision] / N[Power[N[(1 - t$95$1), $MachinePrecision], c$95$n], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
t_1 := \frac{1}{1 + e^{-t}}\\
t_2 := \frac{1}{1 + e^{-s}}\\
\mathbf{if}\;s \leq -3700000000000000158015604916224:\\
\;\;\;\;\frac{{t\_2}^{c\_p}}{1 + c\_p \cdot \log t\_1}\\

\mathbf{else}:\\
\;\;\;\;\frac{{\left(1 - t\_2\right)}^{c\_n}}{{\left(1 - t\_1\right)}^{c\_n}}\\


\end{array}
Derivation
  1. Split input into 2 regimes
  2. if s < -3.7000000000000002e30

    1. Initial program 90.4%

      \[\frac{{\left(\frac{1}{1 + e^{-s}}\right)}^{c\_p} \cdot {\left(1 - \frac{1}{1 + e^{-s}}\right)}^{c\_n}}{{\left(\frac{1}{1 + e^{-t}}\right)}^{c\_p} \cdot {\left(1 - \frac{1}{1 + e^{-t}}\right)}^{c\_n}} \]
    2. Taylor expanded in c_n around 0

      \[\leadsto \color{blue}{\frac{{\left(\frac{1}{1 + e^{\mathsf{neg}\left(s\right)}}\right)}^{c\_p}}{{\left(\frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}^{c\_p}}} \]
    3. Step-by-step derivation
      1. lower-/.f64N/A

        \[\leadsto \frac{{\left(\frac{1}{1 + e^{\mathsf{neg}\left(s\right)}}\right)}^{c\_p}}{\color{blue}{{\left(\frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}^{c\_p}}} \]
      2. lower-pow.f64N/A

        \[\leadsto \frac{{\left(\frac{1}{1 + e^{\mathsf{neg}\left(s\right)}}\right)}^{c\_p}}{{\color{blue}{\left(\frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}}^{c\_p}} \]
      3. lower-/.f64N/A

        \[\leadsto \frac{{\left(\frac{1}{1 + e^{\mathsf{neg}\left(s\right)}}\right)}^{c\_p}}{{\left(\frac{\color{blue}{1}}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}^{c\_p}} \]
      4. lower-+.f64N/A

        \[\leadsto \frac{{\left(\frac{1}{1 + e^{\mathsf{neg}\left(s\right)}}\right)}^{c\_p}}{{\left(\frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}^{c\_p}} \]
      5. lower-exp.f64N/A

        \[\leadsto \frac{{\left(\frac{1}{1 + e^{\mathsf{neg}\left(s\right)}}\right)}^{c\_p}}{{\left(\frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}^{c\_p}} \]
      6. lower-neg.f64N/A

        \[\leadsto \frac{{\left(\frac{1}{1 + e^{-s}}\right)}^{c\_p}}{{\left(\frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}^{c\_p}} \]
      7. lower-pow.f64N/A

        \[\leadsto \frac{{\left(\frac{1}{1 + e^{-s}}\right)}^{c\_p}}{{\left(\frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}^{\color{blue}{c\_p}}} \]
    4. Applied rewrites92.6%

      \[\leadsto \color{blue}{\frac{{\left(\frac{1}{1 + e^{-s}}\right)}^{c\_p}}{{\left(\frac{1}{1 + e^{-t}}\right)}^{c\_p}}} \]
    5. Taylor expanded in c_p around 0

      \[\leadsto \frac{{\left(\frac{1}{1 + e^{-s}}\right)}^{c\_p}}{1 + \color{blue}{c\_p \cdot \log \left(\frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}} \]
    6. Step-by-step derivation
      1. lower-+.f64N/A

        \[\leadsto \frac{{\left(\frac{1}{1 + e^{-s}}\right)}^{c\_p}}{1 + c\_p \cdot \color{blue}{\log \left(\frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}} \]
      2. lower-*.f64N/A

        \[\leadsto \frac{{\left(\frac{1}{1 + e^{-s}}\right)}^{c\_p}}{1 + c\_p \cdot \log \left(\frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)} \]
      3. lower-log.f64N/A

        \[\leadsto \frac{{\left(\frac{1}{1 + e^{-s}}\right)}^{c\_p}}{1 + c\_p \cdot \log \left(\frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)} \]
      4. lower-/.f64N/A

        \[\leadsto \frac{{\left(\frac{1}{1 + e^{-s}}\right)}^{c\_p}}{1 + c\_p \cdot \log \left(\frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)} \]
      5. lower-+.f64N/A

        \[\leadsto \frac{{\left(\frac{1}{1 + e^{-s}}\right)}^{c\_p}}{1 + c\_p \cdot \log \left(\frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)} \]
      6. lower-exp.f64N/A

        \[\leadsto \frac{{\left(\frac{1}{1 + e^{-s}}\right)}^{c\_p}}{1 + c\_p \cdot \log \left(\frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)} \]
      7. lower-neg.f6493.2%

        \[\leadsto \frac{{\left(\frac{1}{1 + e^{-s}}\right)}^{c\_p}}{1 + c\_p \cdot \log \left(\frac{1}{1 + e^{-t}}\right)} \]
    7. Applied rewrites93.2%

      \[\leadsto \frac{{\left(\frac{1}{1 + e^{-s}}\right)}^{c\_p}}{1 + \color{blue}{c\_p \cdot \log \left(\frac{1}{1 + e^{-t}}\right)}} \]

    if -3.7000000000000002e30 < s

    1. Initial program 90.4%

      \[\frac{{\left(\frac{1}{1 + e^{-s}}\right)}^{c\_p} \cdot {\left(1 - \frac{1}{1 + e^{-s}}\right)}^{c\_n}}{{\left(\frac{1}{1 + e^{-t}}\right)}^{c\_p} \cdot {\left(1 - \frac{1}{1 + e^{-t}}\right)}^{c\_n}} \]
    2. Taylor expanded in c_p around 0

      \[\leadsto \color{blue}{\frac{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(s\right)}}\right)}^{c\_n}}{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}^{c\_n}}} \]
    3. Step-by-step derivation
      1. lower-/.f64N/A

        \[\leadsto \frac{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(s\right)}}\right)}^{c\_n}}{\color{blue}{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}^{c\_n}}} \]
      2. lower-pow.f64N/A

        \[\leadsto \frac{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(s\right)}}\right)}^{c\_n}}{{\color{blue}{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}}^{c\_n}} \]
      3. lower--.f64N/A

        \[\leadsto \frac{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(s\right)}}\right)}^{c\_n}}{{\left(\color{blue}{1} - \frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}^{c\_n}} \]
      4. lower-/.f64N/A

        \[\leadsto \frac{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(s\right)}}\right)}^{c\_n}}{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}^{c\_n}} \]
      5. lower-+.f64N/A

        \[\leadsto \frac{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(s\right)}}\right)}^{c\_n}}{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}^{c\_n}} \]
      6. lower-exp.f64N/A

        \[\leadsto \frac{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(s\right)}}\right)}^{c\_n}}{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}^{c\_n}} \]
      7. lower-neg.f64N/A

        \[\leadsto \frac{{\left(1 - \frac{1}{1 + e^{-s}}\right)}^{c\_n}}{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}^{c\_n}} \]
      8. lower-pow.f64N/A

        \[\leadsto \frac{{\left(1 - \frac{1}{1 + e^{-s}}\right)}^{c\_n}}{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}^{\color{blue}{c\_n}}} \]
    4. Applied rewrites94.2%

      \[\leadsto \color{blue}{\frac{{\left(1 - \frac{1}{1 + e^{-s}}\right)}^{c\_n}}{{\left(1 - \frac{1}{1 + e^{-t}}\right)}^{c\_n}}} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 2: 95.9% accurate, 2.6× speedup?

\[\begin{array}{l} t_1 := \frac{1}{1 + e^{-s}}\\ \mathbf{if}\;s \leq -3700000000000000158015604916224:\\ \;\;\;\;\frac{{t\_1}^{c\_p}}{{\frac{1}{2}}^{c\_p}}\\ \mathbf{elif}\;s \leq \frac{35681192317649}{713623846352979940529142984724747568191373312}:\\ \;\;\;\;\frac{{\frac{1}{2}}^{c\_n}}{{\left(1 - \frac{1}{1 + e^{-t}}\right)}^{c\_n}}\\ \mathbf{else}:\\ \;\;\;\;\frac{{\left(1 - t\_1\right)}^{c\_n}}{1 + c\_n \cdot \mathsf{30\_log1z0}\left(\frac{1}{2}\right)}\\ \end{array} \]
(FPCore (c_p c_n t s)
  :precision binary64
  (let* ((t_1 (/ 1 (+ 1 (exp (- s))))))
  (if (<= s -3700000000000000158015604916224)
    (/ (pow t_1 c_p) (pow 1/2 c_p))
    (if (<=
         s
         35681192317649/713623846352979940529142984724747568191373312)
      (/ (pow 1/2 c_n) (pow (- 1 (/ 1 (+ 1 (exp (- t))))) c_n))
      (/ (pow (- 1 t_1) c_n) (+ 1 (* c_n (30-log1z0 1/2))))))))
\begin{array}{l}
t_1 := \frac{1}{1 + e^{-s}}\\
\mathbf{if}\;s \leq -3700000000000000158015604916224:\\
\;\;\;\;\frac{{t\_1}^{c\_p}}{{\frac{1}{2}}^{c\_p}}\\

\mathbf{elif}\;s \leq \frac{35681192317649}{713623846352979940529142984724747568191373312}:\\
\;\;\;\;\frac{{\frac{1}{2}}^{c\_n}}{{\left(1 - \frac{1}{1 + e^{-t}}\right)}^{c\_n}}\\

\mathbf{else}:\\
\;\;\;\;\frac{{\left(1 - t\_1\right)}^{c\_n}}{1 + c\_n \cdot \mathsf{30\_log1z0}\left(\frac{1}{2}\right)}\\


\end{array}
Derivation
  1. Split input into 3 regimes
  2. if s < -3.7000000000000002e30

    1. Initial program 90.4%

      \[\frac{{\left(\frac{1}{1 + e^{-s}}\right)}^{c\_p} \cdot {\left(1 - \frac{1}{1 + e^{-s}}\right)}^{c\_n}}{{\left(\frac{1}{1 + e^{-t}}\right)}^{c\_p} \cdot {\left(1 - \frac{1}{1 + e^{-t}}\right)}^{c\_n}} \]
    2. Taylor expanded in c_n around 0

      \[\leadsto \color{blue}{\frac{{\left(\frac{1}{1 + e^{\mathsf{neg}\left(s\right)}}\right)}^{c\_p}}{{\left(\frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}^{c\_p}}} \]
    3. Step-by-step derivation
      1. lower-/.f64N/A

        \[\leadsto \frac{{\left(\frac{1}{1 + e^{\mathsf{neg}\left(s\right)}}\right)}^{c\_p}}{\color{blue}{{\left(\frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}^{c\_p}}} \]
      2. lower-pow.f64N/A

        \[\leadsto \frac{{\left(\frac{1}{1 + e^{\mathsf{neg}\left(s\right)}}\right)}^{c\_p}}{{\color{blue}{\left(\frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}}^{c\_p}} \]
      3. lower-/.f64N/A

        \[\leadsto \frac{{\left(\frac{1}{1 + e^{\mathsf{neg}\left(s\right)}}\right)}^{c\_p}}{{\left(\frac{\color{blue}{1}}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}^{c\_p}} \]
      4. lower-+.f64N/A

        \[\leadsto \frac{{\left(\frac{1}{1 + e^{\mathsf{neg}\left(s\right)}}\right)}^{c\_p}}{{\left(\frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}^{c\_p}} \]
      5. lower-exp.f64N/A

        \[\leadsto \frac{{\left(\frac{1}{1 + e^{\mathsf{neg}\left(s\right)}}\right)}^{c\_p}}{{\left(\frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}^{c\_p}} \]
      6. lower-neg.f64N/A

        \[\leadsto \frac{{\left(\frac{1}{1 + e^{-s}}\right)}^{c\_p}}{{\left(\frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}^{c\_p}} \]
      7. lower-pow.f64N/A

        \[\leadsto \frac{{\left(\frac{1}{1 + e^{-s}}\right)}^{c\_p}}{{\left(\frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}^{\color{blue}{c\_p}}} \]
    4. Applied rewrites92.6%

      \[\leadsto \color{blue}{\frac{{\left(\frac{1}{1 + e^{-s}}\right)}^{c\_p}}{{\left(\frac{1}{1 + e^{-t}}\right)}^{c\_p}}} \]
    5. Taylor expanded in t around 0

      \[\leadsto \frac{{\left(\frac{1}{1 + e^{-s}}\right)}^{c\_p}}{{\frac{1}{2}}^{c\_p}} \]
    6. Step-by-step derivation
      1. Applied rewrites93.2%

        \[\leadsto \frac{{\left(\frac{1}{1 + e^{-s}}\right)}^{c\_p}}{{\frac{1}{2}}^{c\_p}} \]

      if -3.7000000000000002e30 < s < 5.0000000000000004e-32

      1. Initial program 90.4%

        \[\frac{{\left(\frac{1}{1 + e^{-s}}\right)}^{c\_p} \cdot {\left(1 - \frac{1}{1 + e^{-s}}\right)}^{c\_n}}{{\left(\frac{1}{1 + e^{-t}}\right)}^{c\_p} \cdot {\left(1 - \frac{1}{1 + e^{-t}}\right)}^{c\_n}} \]
      2. Taylor expanded in c_p around 0

        \[\leadsto \color{blue}{\frac{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(s\right)}}\right)}^{c\_n}}{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}^{c\_n}}} \]
      3. Step-by-step derivation
        1. lower-/.f64N/A

          \[\leadsto \frac{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(s\right)}}\right)}^{c\_n}}{\color{blue}{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}^{c\_n}}} \]
        2. lower-pow.f64N/A

          \[\leadsto \frac{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(s\right)}}\right)}^{c\_n}}{{\color{blue}{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}}^{c\_n}} \]
        3. lower--.f64N/A

          \[\leadsto \frac{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(s\right)}}\right)}^{c\_n}}{{\left(\color{blue}{1} - \frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}^{c\_n}} \]
        4. lower-/.f64N/A

          \[\leadsto \frac{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(s\right)}}\right)}^{c\_n}}{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}^{c\_n}} \]
        5. lower-+.f64N/A

          \[\leadsto \frac{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(s\right)}}\right)}^{c\_n}}{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}^{c\_n}} \]
        6. lower-exp.f64N/A

          \[\leadsto \frac{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(s\right)}}\right)}^{c\_n}}{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}^{c\_n}} \]
        7. lower-neg.f64N/A

          \[\leadsto \frac{{\left(1 - \frac{1}{1 + e^{-s}}\right)}^{c\_n}}{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}^{c\_n}} \]
        8. lower-pow.f64N/A

          \[\leadsto \frac{{\left(1 - \frac{1}{1 + e^{-s}}\right)}^{c\_n}}{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}^{\color{blue}{c\_n}}} \]
      4. Applied rewrites94.2%

        \[\leadsto \color{blue}{\frac{{\left(1 - \frac{1}{1 + e^{-s}}\right)}^{c\_n}}{{\left(1 - \frac{1}{1 + e^{-t}}\right)}^{c\_n}}} \]
      5. Taylor expanded in s around 0

        \[\leadsto \frac{{\frac{1}{2}}^{c\_n}}{\color{blue}{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}^{c\_n}}} \]
      6. Step-by-step derivation
        1. lower-/.f64N/A

          \[\leadsto \frac{{\frac{1}{2}}^{c\_n}}{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}^{\color{blue}{c\_n}}} \]
        2. lower-pow.f64N/A

          \[\leadsto \frac{{\frac{1}{2}}^{c\_n}}{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}^{c\_n}} \]
        3. lower-pow.f64N/A

          \[\leadsto \frac{{\frac{1}{2}}^{c\_n}}{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}^{c\_n}} \]
        4. lower--.f64N/A

          \[\leadsto \frac{{\frac{1}{2}}^{c\_n}}{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}^{c\_n}} \]
        5. lower-/.f64N/A

          \[\leadsto \frac{{\frac{1}{2}}^{c\_n}}{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}^{c\_n}} \]
        6. lower-+.f64N/A

          \[\leadsto \frac{{\frac{1}{2}}^{c\_n}}{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}^{c\_n}} \]
        7. lower-exp.f64N/A

          \[\leadsto \frac{{\frac{1}{2}}^{c\_n}}{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}^{c\_n}} \]
        8. lower-neg.f6494.0%

          \[\leadsto \frac{{\frac{1}{2}}^{c\_n}}{{\left(1 - \frac{1}{1 + e^{-t}}\right)}^{c\_n}} \]
      7. Applied rewrites94.0%

        \[\leadsto \frac{{\frac{1}{2}}^{c\_n}}{\color{blue}{{\left(1 - \frac{1}{1 + e^{-t}}\right)}^{c\_n}}} \]

      if 5.0000000000000004e-32 < s

      1. Initial program 90.4%

        \[\frac{{\left(\frac{1}{1 + e^{-s}}\right)}^{c\_p} \cdot {\left(1 - \frac{1}{1 + e^{-s}}\right)}^{c\_n}}{{\left(\frac{1}{1 + e^{-t}}\right)}^{c\_p} \cdot {\left(1 - \frac{1}{1 + e^{-t}}\right)}^{c\_n}} \]
      2. Taylor expanded in c_p around 0

        \[\leadsto \color{blue}{\frac{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(s\right)}}\right)}^{c\_n}}{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}^{c\_n}}} \]
      3. Step-by-step derivation
        1. lower-/.f64N/A

          \[\leadsto \frac{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(s\right)}}\right)}^{c\_n}}{\color{blue}{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}^{c\_n}}} \]
        2. lower-pow.f64N/A

          \[\leadsto \frac{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(s\right)}}\right)}^{c\_n}}{{\color{blue}{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}}^{c\_n}} \]
        3. lower--.f64N/A

          \[\leadsto \frac{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(s\right)}}\right)}^{c\_n}}{{\left(\color{blue}{1} - \frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}^{c\_n}} \]
        4. lower-/.f64N/A

          \[\leadsto \frac{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(s\right)}}\right)}^{c\_n}}{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}^{c\_n}} \]
        5. lower-+.f64N/A

          \[\leadsto \frac{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(s\right)}}\right)}^{c\_n}}{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}^{c\_n}} \]
        6. lower-exp.f64N/A

          \[\leadsto \frac{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(s\right)}}\right)}^{c\_n}}{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}^{c\_n}} \]
        7. lower-neg.f64N/A

          \[\leadsto \frac{{\left(1 - \frac{1}{1 + e^{-s}}\right)}^{c\_n}}{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}^{c\_n}} \]
        8. lower-pow.f64N/A

          \[\leadsto \frac{{\left(1 - \frac{1}{1 + e^{-s}}\right)}^{c\_n}}{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}^{\color{blue}{c\_n}}} \]
      4. Applied rewrites94.2%

        \[\leadsto \color{blue}{\frac{{\left(1 - \frac{1}{1 + e^{-s}}\right)}^{c\_n}}{{\left(1 - \frac{1}{1 + e^{-t}}\right)}^{c\_n}}} \]
      5. Taylor expanded in c_n around 0

        \[\leadsto \frac{{\left(1 - \frac{1}{1 + e^{-s}}\right)}^{c\_n}}{1 + \color{blue}{c\_n \cdot \log \left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}} \]
      6. Step-by-step derivation
        1. lower-+.f64N/A

          \[\leadsto \frac{{\left(1 - \frac{1}{1 + e^{-s}}\right)}^{c\_n}}{1 + c\_n \cdot \color{blue}{\log \left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}} \]
        2. lower-*.f64N/A

          \[\leadsto \frac{{\left(1 - \frac{1}{1 + e^{-s}}\right)}^{c\_n}}{1 + c\_n \cdot \log \left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)} \]
        3. lower-30-log1z0N/A

          \[\leadsto \frac{{\left(1 - \frac{1}{1 + e^{-s}}\right)}^{c\_n}}{1 + c\_n \cdot \mathsf{30\_log1z0}\left(\left(\frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)\right)} \]
        4. lower-/.f64N/A

          \[\leadsto \frac{{\left(1 - \frac{1}{1 + e^{-s}}\right)}^{c\_n}}{1 + c\_n \cdot \mathsf{30\_log1z0}\left(\left(\frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)\right)} \]
        5. lower-+.f64N/A

          \[\leadsto \frac{{\left(1 - \frac{1}{1 + e^{-s}}\right)}^{c\_n}}{1 + c\_n \cdot \mathsf{30\_log1z0}\left(\left(\frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)\right)} \]
        6. lower-exp.f64N/A

          \[\leadsto \frac{{\left(1 - \frac{1}{1 + e^{-s}}\right)}^{c\_n}}{1 + c\_n \cdot \mathsf{30\_log1z0}\left(\left(\frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)\right)} \]
        7. lower-neg.f6493.3%

          \[\leadsto \frac{{\left(1 - \frac{1}{1 + e^{-s}}\right)}^{c\_n}}{1 + c\_n \cdot \mathsf{30\_log1z0}\left(\left(\frac{1}{1 + e^{-t}}\right)\right)} \]
      7. Applied rewrites93.3%

        \[\leadsto \frac{{\left(1 - \frac{1}{1 + e^{-s}}\right)}^{c\_n}}{1 + \color{blue}{c\_n \cdot \mathsf{30\_log1z0}\left(\left(\frac{1}{1 + e^{-t}}\right)\right)}} \]
      8. Taylor expanded in t around 0

        \[\leadsto \frac{{\left(1 - \frac{1}{1 + e^{-s}}\right)}^{c\_n}}{1 + c\_n \cdot \mathsf{30\_log1z0}\left(\frac{1}{2}\right)} \]
      9. Step-by-step derivation
        1. Applied rewrites93.7%

          \[\leadsto \frac{{\left(1 - \frac{1}{1 + e^{-s}}\right)}^{c\_n}}{1 + c\_n \cdot \mathsf{30\_log1z0}\left(\frac{1}{2}\right)} \]
      10. Recombined 3 regimes into one program.
      11. Add Preprocessing

      Alternative 3: 95.8% accurate, 2.7× speedup?

      \[\begin{array}{l} t_1 := \frac{1}{1 + e^{-s}}\\ \mathbf{if}\;s \leq -3700000000000000158015604916224:\\ \;\;\;\;\frac{{t\_1}^{c\_p}}{{\frac{1}{2}}^{c\_p}}\\ \mathbf{elif}\;s \leq \frac{35681192317649}{713623846352979940529142984724747568191373312}:\\ \;\;\;\;\frac{{\frac{1}{2}}^{c\_n}}{{\left(\frac{1}{2} + \frac{-1}{4} \cdot t\right)}^{c\_n}}\\ \mathbf{else}:\\ \;\;\;\;\frac{{\left(1 - t\_1\right)}^{c\_n}}{1 + c\_n \cdot \mathsf{30\_log1z0}\left(\frac{1}{2}\right)}\\ \end{array} \]
      (FPCore (c_p c_n t s)
        :precision binary64
        (let* ((t_1 (/ 1 (+ 1 (exp (- s))))))
        (if (<= s -3700000000000000158015604916224)
          (/ (pow t_1 c_p) (pow 1/2 c_p))
          (if (<=
               s
               35681192317649/713623846352979940529142984724747568191373312)
            (/ (pow 1/2 c_n) (pow (+ 1/2 (* -1/4 t)) c_n))
            (/ (pow (- 1 t_1) c_n) (+ 1 (* c_n (30-log1z0 1/2))))))))
      \begin{array}{l}
      t_1 := \frac{1}{1 + e^{-s}}\\
      \mathbf{if}\;s \leq -3700000000000000158015604916224:\\
      \;\;\;\;\frac{{t\_1}^{c\_p}}{{\frac{1}{2}}^{c\_p}}\\
      
      \mathbf{elif}\;s \leq \frac{35681192317649}{713623846352979940529142984724747568191373312}:\\
      \;\;\;\;\frac{{\frac{1}{2}}^{c\_n}}{{\left(\frac{1}{2} + \frac{-1}{4} \cdot t\right)}^{c\_n}}\\
      
      \mathbf{else}:\\
      \;\;\;\;\frac{{\left(1 - t\_1\right)}^{c\_n}}{1 + c\_n \cdot \mathsf{30\_log1z0}\left(\frac{1}{2}\right)}\\
      
      
      \end{array}
      
      Derivation
      1. Split input into 3 regimes
      2. if s < -3.7000000000000002e30

        1. Initial program 90.4%

          \[\frac{{\left(\frac{1}{1 + e^{-s}}\right)}^{c\_p} \cdot {\left(1 - \frac{1}{1 + e^{-s}}\right)}^{c\_n}}{{\left(\frac{1}{1 + e^{-t}}\right)}^{c\_p} \cdot {\left(1 - \frac{1}{1 + e^{-t}}\right)}^{c\_n}} \]
        2. Taylor expanded in c_n around 0

          \[\leadsto \color{blue}{\frac{{\left(\frac{1}{1 + e^{\mathsf{neg}\left(s\right)}}\right)}^{c\_p}}{{\left(\frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}^{c\_p}}} \]
        3. Step-by-step derivation
          1. lower-/.f64N/A

            \[\leadsto \frac{{\left(\frac{1}{1 + e^{\mathsf{neg}\left(s\right)}}\right)}^{c\_p}}{\color{blue}{{\left(\frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}^{c\_p}}} \]
          2. lower-pow.f64N/A

            \[\leadsto \frac{{\left(\frac{1}{1 + e^{\mathsf{neg}\left(s\right)}}\right)}^{c\_p}}{{\color{blue}{\left(\frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}}^{c\_p}} \]
          3. lower-/.f64N/A

            \[\leadsto \frac{{\left(\frac{1}{1 + e^{\mathsf{neg}\left(s\right)}}\right)}^{c\_p}}{{\left(\frac{\color{blue}{1}}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}^{c\_p}} \]
          4. lower-+.f64N/A

            \[\leadsto \frac{{\left(\frac{1}{1 + e^{\mathsf{neg}\left(s\right)}}\right)}^{c\_p}}{{\left(\frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}^{c\_p}} \]
          5. lower-exp.f64N/A

            \[\leadsto \frac{{\left(\frac{1}{1 + e^{\mathsf{neg}\left(s\right)}}\right)}^{c\_p}}{{\left(\frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}^{c\_p}} \]
          6. lower-neg.f64N/A

            \[\leadsto \frac{{\left(\frac{1}{1 + e^{-s}}\right)}^{c\_p}}{{\left(\frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}^{c\_p}} \]
          7. lower-pow.f64N/A

            \[\leadsto \frac{{\left(\frac{1}{1 + e^{-s}}\right)}^{c\_p}}{{\left(\frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}^{\color{blue}{c\_p}}} \]
        4. Applied rewrites92.6%

          \[\leadsto \color{blue}{\frac{{\left(\frac{1}{1 + e^{-s}}\right)}^{c\_p}}{{\left(\frac{1}{1 + e^{-t}}\right)}^{c\_p}}} \]
        5. Taylor expanded in t around 0

          \[\leadsto \frac{{\left(\frac{1}{1 + e^{-s}}\right)}^{c\_p}}{{\frac{1}{2}}^{c\_p}} \]
        6. Step-by-step derivation
          1. Applied rewrites93.2%

            \[\leadsto \frac{{\left(\frac{1}{1 + e^{-s}}\right)}^{c\_p}}{{\frac{1}{2}}^{c\_p}} \]

          if -3.7000000000000002e30 < s < 5.0000000000000004e-32

          1. Initial program 90.4%

            \[\frac{{\left(\frac{1}{1 + e^{-s}}\right)}^{c\_p} \cdot {\left(1 - \frac{1}{1 + e^{-s}}\right)}^{c\_n}}{{\left(\frac{1}{1 + e^{-t}}\right)}^{c\_p} \cdot {\left(1 - \frac{1}{1 + e^{-t}}\right)}^{c\_n}} \]
          2. Taylor expanded in c_p around 0

            \[\leadsto \color{blue}{\frac{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(s\right)}}\right)}^{c\_n}}{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}^{c\_n}}} \]
          3. Step-by-step derivation
            1. lower-/.f64N/A

              \[\leadsto \frac{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(s\right)}}\right)}^{c\_n}}{\color{blue}{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}^{c\_n}}} \]
            2. lower-pow.f64N/A

              \[\leadsto \frac{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(s\right)}}\right)}^{c\_n}}{{\color{blue}{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}}^{c\_n}} \]
            3. lower--.f64N/A

              \[\leadsto \frac{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(s\right)}}\right)}^{c\_n}}{{\left(\color{blue}{1} - \frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}^{c\_n}} \]
            4. lower-/.f64N/A

              \[\leadsto \frac{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(s\right)}}\right)}^{c\_n}}{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}^{c\_n}} \]
            5. lower-+.f64N/A

              \[\leadsto \frac{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(s\right)}}\right)}^{c\_n}}{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}^{c\_n}} \]
            6. lower-exp.f64N/A

              \[\leadsto \frac{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(s\right)}}\right)}^{c\_n}}{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}^{c\_n}} \]
            7. lower-neg.f64N/A

              \[\leadsto \frac{{\left(1 - \frac{1}{1 + e^{-s}}\right)}^{c\_n}}{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}^{c\_n}} \]
            8. lower-pow.f64N/A

              \[\leadsto \frac{{\left(1 - \frac{1}{1 + e^{-s}}\right)}^{c\_n}}{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}^{\color{blue}{c\_n}}} \]
          4. Applied rewrites94.2%

            \[\leadsto \color{blue}{\frac{{\left(1 - \frac{1}{1 + e^{-s}}\right)}^{c\_n}}{{\left(1 - \frac{1}{1 + e^{-t}}\right)}^{c\_n}}} \]
          5. Taylor expanded in s around 0

            \[\leadsto \frac{{\frac{1}{2}}^{c\_n}}{\color{blue}{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}^{c\_n}}} \]
          6. Step-by-step derivation
            1. lower-/.f64N/A

              \[\leadsto \frac{{\frac{1}{2}}^{c\_n}}{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}^{\color{blue}{c\_n}}} \]
            2. lower-pow.f64N/A

              \[\leadsto \frac{{\frac{1}{2}}^{c\_n}}{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}^{c\_n}} \]
            3. lower-pow.f64N/A

              \[\leadsto \frac{{\frac{1}{2}}^{c\_n}}{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}^{c\_n}} \]
            4. lower--.f64N/A

              \[\leadsto \frac{{\frac{1}{2}}^{c\_n}}{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}^{c\_n}} \]
            5. lower-/.f64N/A

              \[\leadsto \frac{{\frac{1}{2}}^{c\_n}}{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}^{c\_n}} \]
            6. lower-+.f64N/A

              \[\leadsto \frac{{\frac{1}{2}}^{c\_n}}{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}^{c\_n}} \]
            7. lower-exp.f64N/A

              \[\leadsto \frac{{\frac{1}{2}}^{c\_n}}{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}^{c\_n}} \]
            8. lower-neg.f6494.0%

              \[\leadsto \frac{{\frac{1}{2}}^{c\_n}}{{\left(1 - \frac{1}{1 + e^{-t}}\right)}^{c\_n}} \]
          7. Applied rewrites94.0%

            \[\leadsto \frac{{\frac{1}{2}}^{c\_n}}{\color{blue}{{\left(1 - \frac{1}{1 + e^{-t}}\right)}^{c\_n}}} \]
          8. Taylor expanded in t around 0

            \[\leadsto \frac{{\frac{1}{2}}^{c\_n}}{{\left(\frac{1}{2} + \frac{-1}{4} \cdot t\right)}^{c\_n}} \]
          9. Step-by-step derivation
            1. lower-+.f64N/A

              \[\leadsto \frac{{\frac{1}{2}}^{c\_n}}{{\left(\frac{1}{2} + \frac{-1}{4} \cdot t\right)}^{c\_n}} \]
            2. lower-*.f6493.7%

              \[\leadsto \frac{{\frac{1}{2}}^{c\_n}}{{\left(\frac{1}{2} + \frac{-1}{4} \cdot t\right)}^{c\_n}} \]
          10. Applied rewrites93.7%

            \[\leadsto \frac{{\frac{1}{2}}^{c\_n}}{{\left(\frac{1}{2} + \frac{-1}{4} \cdot t\right)}^{c\_n}} \]

          if 5.0000000000000004e-32 < s

          1. Initial program 90.4%

            \[\frac{{\left(\frac{1}{1 + e^{-s}}\right)}^{c\_p} \cdot {\left(1 - \frac{1}{1 + e^{-s}}\right)}^{c\_n}}{{\left(\frac{1}{1 + e^{-t}}\right)}^{c\_p} \cdot {\left(1 - \frac{1}{1 + e^{-t}}\right)}^{c\_n}} \]
          2. Taylor expanded in c_p around 0

            \[\leadsto \color{blue}{\frac{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(s\right)}}\right)}^{c\_n}}{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}^{c\_n}}} \]
          3. Step-by-step derivation
            1. lower-/.f64N/A

              \[\leadsto \frac{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(s\right)}}\right)}^{c\_n}}{\color{blue}{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}^{c\_n}}} \]
            2. lower-pow.f64N/A

              \[\leadsto \frac{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(s\right)}}\right)}^{c\_n}}{{\color{blue}{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}}^{c\_n}} \]
            3. lower--.f64N/A

              \[\leadsto \frac{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(s\right)}}\right)}^{c\_n}}{{\left(\color{blue}{1} - \frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}^{c\_n}} \]
            4. lower-/.f64N/A

              \[\leadsto \frac{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(s\right)}}\right)}^{c\_n}}{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}^{c\_n}} \]
            5. lower-+.f64N/A

              \[\leadsto \frac{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(s\right)}}\right)}^{c\_n}}{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}^{c\_n}} \]
            6. lower-exp.f64N/A

              \[\leadsto \frac{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(s\right)}}\right)}^{c\_n}}{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}^{c\_n}} \]
            7. lower-neg.f64N/A

              \[\leadsto \frac{{\left(1 - \frac{1}{1 + e^{-s}}\right)}^{c\_n}}{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}^{c\_n}} \]
            8. lower-pow.f64N/A

              \[\leadsto \frac{{\left(1 - \frac{1}{1 + e^{-s}}\right)}^{c\_n}}{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}^{\color{blue}{c\_n}}} \]
          4. Applied rewrites94.2%

            \[\leadsto \color{blue}{\frac{{\left(1 - \frac{1}{1 + e^{-s}}\right)}^{c\_n}}{{\left(1 - \frac{1}{1 + e^{-t}}\right)}^{c\_n}}} \]
          5. Taylor expanded in c_n around 0

            \[\leadsto \frac{{\left(1 - \frac{1}{1 + e^{-s}}\right)}^{c\_n}}{1 + \color{blue}{c\_n \cdot \log \left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}} \]
          6. Step-by-step derivation
            1. lower-+.f64N/A

              \[\leadsto \frac{{\left(1 - \frac{1}{1 + e^{-s}}\right)}^{c\_n}}{1 + c\_n \cdot \color{blue}{\log \left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}} \]
            2. lower-*.f64N/A

              \[\leadsto \frac{{\left(1 - \frac{1}{1 + e^{-s}}\right)}^{c\_n}}{1 + c\_n \cdot \log \left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)} \]
            3. lower-30-log1z0N/A

              \[\leadsto \frac{{\left(1 - \frac{1}{1 + e^{-s}}\right)}^{c\_n}}{1 + c\_n \cdot \mathsf{30\_log1z0}\left(\left(\frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)\right)} \]
            4. lower-/.f64N/A

              \[\leadsto \frac{{\left(1 - \frac{1}{1 + e^{-s}}\right)}^{c\_n}}{1 + c\_n \cdot \mathsf{30\_log1z0}\left(\left(\frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)\right)} \]
            5. lower-+.f64N/A

              \[\leadsto \frac{{\left(1 - \frac{1}{1 + e^{-s}}\right)}^{c\_n}}{1 + c\_n \cdot \mathsf{30\_log1z0}\left(\left(\frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)\right)} \]
            6. lower-exp.f64N/A

              \[\leadsto \frac{{\left(1 - \frac{1}{1 + e^{-s}}\right)}^{c\_n}}{1 + c\_n \cdot \mathsf{30\_log1z0}\left(\left(\frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)\right)} \]
            7. lower-neg.f6493.3%

              \[\leadsto \frac{{\left(1 - \frac{1}{1 + e^{-s}}\right)}^{c\_n}}{1 + c\_n \cdot \mathsf{30\_log1z0}\left(\left(\frac{1}{1 + e^{-t}}\right)\right)} \]
          7. Applied rewrites93.3%

            \[\leadsto \frac{{\left(1 - \frac{1}{1 + e^{-s}}\right)}^{c\_n}}{1 + \color{blue}{c\_n \cdot \mathsf{30\_log1z0}\left(\left(\frac{1}{1 + e^{-t}}\right)\right)}} \]
          8. Taylor expanded in t around 0

            \[\leadsto \frac{{\left(1 - \frac{1}{1 + e^{-s}}\right)}^{c\_n}}{1 + c\_n \cdot \mathsf{30\_log1z0}\left(\frac{1}{2}\right)} \]
          9. Step-by-step derivation
            1. Applied rewrites93.7%

              \[\leadsto \frac{{\left(1 - \frac{1}{1 + e^{-s}}\right)}^{c\_n}}{1 + c\_n \cdot \mathsf{30\_log1z0}\left(\frac{1}{2}\right)} \]
          10. Recombined 3 regimes into one program.
          11. Add Preprocessing

          Alternative 4: 95.6% accurate, 2.0× speedup?

          \[\begin{array}{l} t_1 := \frac{1}{1 + e^{-t}}\\ t_2 := \frac{1}{1 + e^{-s}}\\ \mathbf{if}\;s \leq -3700000000000000158015604916224:\\ \;\;\;\;\frac{{t\_2}^{c\_p}}{{t\_1}^{c\_p}}\\ \mathbf{else}:\\ \;\;\;\;\frac{{\left(1 - t\_2\right)}^{c\_n}}{{\left(1 - t\_1\right)}^{c\_n}}\\ \end{array} \]
          (FPCore (c_p c_n t s)
            :precision binary64
            (let* ((t_1 (/ 1 (+ 1 (exp (- t))))) (t_2 (/ 1 (+ 1 (exp (- s))))))
            (if (<= s -3700000000000000158015604916224)
              (/ (pow t_2 c_p) (pow t_1 c_p))
              (/ (pow (- 1 t_2) c_n) (pow (- 1 t_1) c_n)))))
          double code(double c_p, double c_n, double t, double s) {
          	double t_1 = 1.0 / (1.0 + exp(-t));
          	double t_2 = 1.0 / (1.0 + exp(-s));
          	double tmp;
          	if (s <= -3.7e+30) {
          		tmp = pow(t_2, c_p) / pow(t_1, c_p);
          	} else {
          		tmp = pow((1.0 - t_2), c_n) / pow((1.0 - t_1), c_n);
          	}
          	return tmp;
          }
          
          module fmin_fmax_functions
              implicit none
              private
              public fmax
              public fmin
          
              interface fmax
                  module procedure fmax88
                  module procedure fmax44
                  module procedure fmax84
                  module procedure fmax48
              end interface
              interface fmin
                  module procedure fmin88
                  module procedure fmin44
                  module procedure fmin84
                  module procedure fmin48
              end interface
          contains
              real(8) function fmax88(x, y) result (res)
                  real(8), intent (in) :: x
                  real(8), intent (in) :: y
                  res = merge(y, merge(x, max(x, y), y /= y), x /= x)
              end function
              real(4) function fmax44(x, y) result (res)
                  real(4), intent (in) :: x
                  real(4), intent (in) :: y
                  res = merge(y, merge(x, max(x, y), y /= y), x /= x)
              end function
              real(8) function fmax84(x, y) result(res)
                  real(8), intent (in) :: x
                  real(4), intent (in) :: y
                  res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
              end function
              real(8) function fmax48(x, y) result(res)
                  real(4), intent (in) :: x
                  real(8), intent (in) :: y
                  res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
              end function
              real(8) function fmin88(x, y) result (res)
                  real(8), intent (in) :: x
                  real(8), intent (in) :: y
                  res = merge(y, merge(x, min(x, y), y /= y), x /= x)
              end function
              real(4) function fmin44(x, y) result (res)
                  real(4), intent (in) :: x
                  real(4), intent (in) :: y
                  res = merge(y, merge(x, min(x, y), y /= y), x /= x)
              end function
              real(8) function fmin84(x, y) result(res)
                  real(8), intent (in) :: x
                  real(4), intent (in) :: y
                  res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
              end function
              real(8) function fmin48(x, y) result(res)
                  real(4), intent (in) :: x
                  real(8), intent (in) :: y
                  res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
              end function
          end module
          
          real(8) function code(c_p, c_n, t, s)
          use fmin_fmax_functions
              real(8), intent (in) :: c_p
              real(8), intent (in) :: c_n
              real(8), intent (in) :: t
              real(8), intent (in) :: s
              real(8) :: t_1
              real(8) :: t_2
              real(8) :: tmp
              t_1 = 1.0d0 / (1.0d0 + exp(-t))
              t_2 = 1.0d0 / (1.0d0 + exp(-s))
              if (s <= (-3.7d+30)) then
                  tmp = (t_2 ** c_p) / (t_1 ** c_p)
              else
                  tmp = ((1.0d0 - t_2) ** c_n) / ((1.0d0 - t_1) ** c_n)
              end if
              code = tmp
          end function
          
          public static double code(double c_p, double c_n, double t, double s) {
          	double t_1 = 1.0 / (1.0 + Math.exp(-t));
          	double t_2 = 1.0 / (1.0 + Math.exp(-s));
          	double tmp;
          	if (s <= -3.7e+30) {
          		tmp = Math.pow(t_2, c_p) / Math.pow(t_1, c_p);
          	} else {
          		tmp = Math.pow((1.0 - t_2), c_n) / Math.pow((1.0 - t_1), c_n);
          	}
          	return tmp;
          }
          
          def code(c_p, c_n, t, s):
          	t_1 = 1.0 / (1.0 + math.exp(-t))
          	t_2 = 1.0 / (1.0 + math.exp(-s))
          	tmp = 0
          	if s <= -3.7e+30:
          		tmp = math.pow(t_2, c_p) / math.pow(t_1, c_p)
          	else:
          		tmp = math.pow((1.0 - t_2), c_n) / math.pow((1.0 - t_1), c_n)
          	return tmp
          
          function code(c_p, c_n, t, s)
          	t_1 = Float64(1.0 / Float64(1.0 + exp(Float64(-t))))
          	t_2 = Float64(1.0 / Float64(1.0 + exp(Float64(-s))))
          	tmp = 0.0
          	if (s <= -3.7e+30)
          		tmp = Float64((t_2 ^ c_p) / (t_1 ^ c_p));
          	else
          		tmp = Float64((Float64(1.0 - t_2) ^ c_n) / (Float64(1.0 - t_1) ^ c_n));
          	end
          	return tmp
          end
          
          function tmp_2 = code(c_p, c_n, t, s)
          	t_1 = 1.0 / (1.0 + exp(-t));
          	t_2 = 1.0 / (1.0 + exp(-s));
          	tmp = 0.0;
          	if (s <= -3.7e+30)
          		tmp = (t_2 ^ c_p) / (t_1 ^ c_p);
          	else
          		tmp = ((1.0 - t_2) ^ c_n) / ((1.0 - t_1) ^ c_n);
          	end
          	tmp_2 = tmp;
          end
          
          code[c$95$p_, c$95$n_, t_, s_] := Block[{t$95$1 = N[(1 / N[(1 + N[Exp[(-t)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(1 / N[(1 + N[Exp[(-s)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[s, -3700000000000000158015604916224], N[(N[Power[t$95$2, c$95$p], $MachinePrecision] / N[Power[t$95$1, c$95$p], $MachinePrecision]), $MachinePrecision], N[(N[Power[N[(1 - t$95$2), $MachinePrecision], c$95$n], $MachinePrecision] / N[Power[N[(1 - t$95$1), $MachinePrecision], c$95$n], $MachinePrecision]), $MachinePrecision]]]]
          
          \begin{array}{l}
          t_1 := \frac{1}{1 + e^{-t}}\\
          t_2 := \frac{1}{1 + e^{-s}}\\
          \mathbf{if}\;s \leq -3700000000000000158015604916224:\\
          \;\;\;\;\frac{{t\_2}^{c\_p}}{{t\_1}^{c\_p}}\\
          
          \mathbf{else}:\\
          \;\;\;\;\frac{{\left(1 - t\_2\right)}^{c\_n}}{{\left(1 - t\_1\right)}^{c\_n}}\\
          
          
          \end{array}
          
          Derivation
          1. Split input into 2 regimes
          2. if s < -3.7000000000000002e30

            1. Initial program 90.4%

              \[\frac{{\left(\frac{1}{1 + e^{-s}}\right)}^{c\_p} \cdot {\left(1 - \frac{1}{1 + e^{-s}}\right)}^{c\_n}}{{\left(\frac{1}{1 + e^{-t}}\right)}^{c\_p} \cdot {\left(1 - \frac{1}{1 + e^{-t}}\right)}^{c\_n}} \]
            2. Taylor expanded in c_n around 0

              \[\leadsto \color{blue}{\frac{{\left(\frac{1}{1 + e^{\mathsf{neg}\left(s\right)}}\right)}^{c\_p}}{{\left(\frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}^{c\_p}}} \]
            3. Step-by-step derivation
              1. lower-/.f64N/A

                \[\leadsto \frac{{\left(\frac{1}{1 + e^{\mathsf{neg}\left(s\right)}}\right)}^{c\_p}}{\color{blue}{{\left(\frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}^{c\_p}}} \]
              2. lower-pow.f64N/A

                \[\leadsto \frac{{\left(\frac{1}{1 + e^{\mathsf{neg}\left(s\right)}}\right)}^{c\_p}}{{\color{blue}{\left(\frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}}^{c\_p}} \]
              3. lower-/.f64N/A

                \[\leadsto \frac{{\left(\frac{1}{1 + e^{\mathsf{neg}\left(s\right)}}\right)}^{c\_p}}{{\left(\frac{\color{blue}{1}}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}^{c\_p}} \]
              4. lower-+.f64N/A

                \[\leadsto \frac{{\left(\frac{1}{1 + e^{\mathsf{neg}\left(s\right)}}\right)}^{c\_p}}{{\left(\frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}^{c\_p}} \]
              5. lower-exp.f64N/A

                \[\leadsto \frac{{\left(\frac{1}{1 + e^{\mathsf{neg}\left(s\right)}}\right)}^{c\_p}}{{\left(\frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}^{c\_p}} \]
              6. lower-neg.f64N/A

                \[\leadsto \frac{{\left(\frac{1}{1 + e^{-s}}\right)}^{c\_p}}{{\left(\frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}^{c\_p}} \]
              7. lower-pow.f64N/A

                \[\leadsto \frac{{\left(\frac{1}{1 + e^{-s}}\right)}^{c\_p}}{{\left(\frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}^{\color{blue}{c\_p}}} \]
            4. Applied rewrites92.6%

              \[\leadsto \color{blue}{\frac{{\left(\frac{1}{1 + e^{-s}}\right)}^{c\_p}}{{\left(\frac{1}{1 + e^{-t}}\right)}^{c\_p}}} \]

            if -3.7000000000000002e30 < s

            1. Initial program 90.4%

              \[\frac{{\left(\frac{1}{1 + e^{-s}}\right)}^{c\_p} \cdot {\left(1 - \frac{1}{1 + e^{-s}}\right)}^{c\_n}}{{\left(\frac{1}{1 + e^{-t}}\right)}^{c\_p} \cdot {\left(1 - \frac{1}{1 + e^{-t}}\right)}^{c\_n}} \]
            2. Taylor expanded in c_p around 0

              \[\leadsto \color{blue}{\frac{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(s\right)}}\right)}^{c\_n}}{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}^{c\_n}}} \]
            3. Step-by-step derivation
              1. lower-/.f64N/A

                \[\leadsto \frac{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(s\right)}}\right)}^{c\_n}}{\color{blue}{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}^{c\_n}}} \]
              2. lower-pow.f64N/A

                \[\leadsto \frac{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(s\right)}}\right)}^{c\_n}}{{\color{blue}{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}}^{c\_n}} \]
              3. lower--.f64N/A

                \[\leadsto \frac{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(s\right)}}\right)}^{c\_n}}{{\left(\color{blue}{1} - \frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}^{c\_n}} \]
              4. lower-/.f64N/A

                \[\leadsto \frac{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(s\right)}}\right)}^{c\_n}}{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}^{c\_n}} \]
              5. lower-+.f64N/A

                \[\leadsto \frac{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(s\right)}}\right)}^{c\_n}}{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}^{c\_n}} \]
              6. lower-exp.f64N/A

                \[\leadsto \frac{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(s\right)}}\right)}^{c\_n}}{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}^{c\_n}} \]
              7. lower-neg.f64N/A

                \[\leadsto \frac{{\left(1 - \frac{1}{1 + e^{-s}}\right)}^{c\_n}}{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}^{c\_n}} \]
              8. lower-pow.f64N/A

                \[\leadsto \frac{{\left(1 - \frac{1}{1 + e^{-s}}\right)}^{c\_n}}{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}^{\color{blue}{c\_n}}} \]
            4. Applied rewrites94.2%

              \[\leadsto \color{blue}{\frac{{\left(1 - \frac{1}{1 + e^{-s}}\right)}^{c\_n}}{{\left(1 - \frac{1}{1 + e^{-t}}\right)}^{c\_n}}} \]
          3. Recombined 2 regimes into one program.
          4. Add Preprocessing

          Alternative 5: 95.4% accurate, 0.7× speedup?

          \[\begin{array}{l} t_1 := \frac{1}{1 + e^{-t}}\\ t_2 := {t\_1}^{c\_p}\\ t_3 := \frac{1}{1 + e^{-s}}\\ t_4 := {\left(1 - t\_3\right)}^{c\_n}\\ \mathbf{if}\;\frac{{t\_3}^{c\_p} \cdot t\_4}{t\_2 \cdot {\left(1 - t\_1\right)}^{c\_n}} \leq \frac{4503599852550477}{4503599627370496}:\\ \;\;\;\;\frac{{\left(\frac{1}{2 + s \cdot \left(\frac{1}{2} \cdot s - 1\right)}\right)}^{c\_p}}{t\_2}\\ \mathbf{else}:\\ \;\;\;\;\frac{t\_4}{1 + c\_n \cdot \mathsf{30\_log1z0}\left(\frac{1}{2}\right)}\\ \end{array} \]
          (FPCore (c_p c_n t s)
            :precision binary64
            (let* ((t_1 (/ 1 (+ 1 (exp (- t)))))
                 (t_2 (pow t_1 c_p))
                 (t_3 (/ 1 (+ 1 (exp (- s)))))
                 (t_4 (pow (- 1 t_3) c_n)))
            (if (<=
                 (/ (* (pow t_3 c_p) t_4) (* t_2 (pow (- 1 t_1) c_n)))
                 4503599852550477/4503599627370496)
              (/ (pow (/ 1 (+ 2 (* s (- (* 1/2 s) 1)))) c_p) t_2)
              (/ t_4 (+ 1 (* c_n (30-log1z0 1/2)))))))
          \begin{array}{l}
          t_1 := \frac{1}{1 + e^{-t}}\\
          t_2 := {t\_1}^{c\_p}\\
          t_3 := \frac{1}{1 + e^{-s}}\\
          t_4 := {\left(1 - t\_3\right)}^{c\_n}\\
          \mathbf{if}\;\frac{{t\_3}^{c\_p} \cdot t\_4}{t\_2 \cdot {\left(1 - t\_1\right)}^{c\_n}} \leq \frac{4503599852550477}{4503599627370496}:\\
          \;\;\;\;\frac{{\left(\frac{1}{2 + s \cdot \left(\frac{1}{2} \cdot s - 1\right)}\right)}^{c\_p}}{t\_2}\\
          
          \mathbf{else}:\\
          \;\;\;\;\frac{t\_4}{1 + c\_n \cdot \mathsf{30\_log1z0}\left(\frac{1}{2}\right)}\\
          
          
          \end{array}
          
          Derivation
          1. Split input into 2 regimes
          2. if (/.f64 (*.f64 (pow.f64 (/.f64 #s(literal 1 binary64) (+.f64 #s(literal 1 binary64) (exp.f64 (neg.f64 s)))) c_p) (pow.f64 (-.f64 #s(literal 1 binary64) (/.f64 #s(literal 1 binary64) (+.f64 #s(literal 1 binary64) (exp.f64 (neg.f64 s))))) c_n)) (*.f64 (pow.f64 (/.f64 #s(literal 1 binary64) (+.f64 #s(literal 1 binary64) (exp.f64 (neg.f64 t)))) c_p) (pow.f64 (-.f64 #s(literal 1 binary64) (/.f64 #s(literal 1 binary64) (+.f64 #s(literal 1 binary64) (exp.f64 (neg.f64 t))))) c_n))) < 1.0000000499999999

            1. Initial program 90.4%

              \[\frac{{\left(\frac{1}{1 + e^{-s}}\right)}^{c\_p} \cdot {\left(1 - \frac{1}{1 + e^{-s}}\right)}^{c\_n}}{{\left(\frac{1}{1 + e^{-t}}\right)}^{c\_p} \cdot {\left(1 - \frac{1}{1 + e^{-t}}\right)}^{c\_n}} \]
            2. Taylor expanded in c_n around 0

              \[\leadsto \color{blue}{\frac{{\left(\frac{1}{1 + e^{\mathsf{neg}\left(s\right)}}\right)}^{c\_p}}{{\left(\frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}^{c\_p}}} \]
            3. Step-by-step derivation
              1. lower-/.f64N/A

                \[\leadsto \frac{{\left(\frac{1}{1 + e^{\mathsf{neg}\left(s\right)}}\right)}^{c\_p}}{\color{blue}{{\left(\frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}^{c\_p}}} \]
              2. lower-pow.f64N/A

                \[\leadsto \frac{{\left(\frac{1}{1 + e^{\mathsf{neg}\left(s\right)}}\right)}^{c\_p}}{{\color{blue}{\left(\frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}}^{c\_p}} \]
              3. lower-/.f64N/A

                \[\leadsto \frac{{\left(\frac{1}{1 + e^{\mathsf{neg}\left(s\right)}}\right)}^{c\_p}}{{\left(\frac{\color{blue}{1}}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}^{c\_p}} \]
              4. lower-+.f64N/A

                \[\leadsto \frac{{\left(\frac{1}{1 + e^{\mathsf{neg}\left(s\right)}}\right)}^{c\_p}}{{\left(\frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}^{c\_p}} \]
              5. lower-exp.f64N/A

                \[\leadsto \frac{{\left(\frac{1}{1 + e^{\mathsf{neg}\left(s\right)}}\right)}^{c\_p}}{{\left(\frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}^{c\_p}} \]
              6. lower-neg.f64N/A

                \[\leadsto \frac{{\left(\frac{1}{1 + e^{-s}}\right)}^{c\_p}}{{\left(\frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}^{c\_p}} \]
              7. lower-pow.f64N/A

                \[\leadsto \frac{{\left(\frac{1}{1 + e^{-s}}\right)}^{c\_p}}{{\left(\frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}^{\color{blue}{c\_p}}} \]
            4. Applied rewrites92.6%

              \[\leadsto \color{blue}{\frac{{\left(\frac{1}{1 + e^{-s}}\right)}^{c\_p}}{{\left(\frac{1}{1 + e^{-t}}\right)}^{c\_p}}} \]
            5. Taylor expanded in s around 0

              \[\leadsto \frac{{\left(\frac{1}{2 + s \cdot \left(\frac{1}{2} \cdot s - 1\right)}\right)}^{c\_p}}{{\left(\frac{1}{1 + e^{-t}}\right)}^{c\_p}} \]
            6. Step-by-step derivation
              1. lower-+.f64N/A

                \[\leadsto \frac{{\left(\frac{1}{2 + s \cdot \left(\frac{1}{2} \cdot s - 1\right)}\right)}^{c\_p}}{{\left(\frac{1}{1 + e^{-t}}\right)}^{c\_p}} \]
              2. lower-*.f64N/A

                \[\leadsto \frac{{\left(\frac{1}{2 + s \cdot \left(\frac{1}{2} \cdot s - 1\right)}\right)}^{c\_p}}{{\left(\frac{1}{1 + e^{-t}}\right)}^{c\_p}} \]
              3. lower--.f64N/A

                \[\leadsto \frac{{\left(\frac{1}{2 + s \cdot \left(\frac{1}{2} \cdot s - 1\right)}\right)}^{c\_p}}{{\left(\frac{1}{1 + e^{-t}}\right)}^{c\_p}} \]
              4. lower-*.f6493.4%

                \[\leadsto \frac{{\left(\frac{1}{2 + s \cdot \left(\frac{1}{2} \cdot s - 1\right)}\right)}^{c\_p}}{{\left(\frac{1}{1 + e^{-t}}\right)}^{c\_p}} \]
            7. Applied rewrites93.4%

              \[\leadsto \frac{{\left(\frac{1}{2 + s \cdot \left(\frac{1}{2} \cdot s - 1\right)}\right)}^{c\_p}}{{\left(\frac{1}{1 + e^{-t}}\right)}^{c\_p}} \]

            if 1.0000000499999999 < (/.f64 (*.f64 (pow.f64 (/.f64 #s(literal 1 binary64) (+.f64 #s(literal 1 binary64) (exp.f64 (neg.f64 s)))) c_p) (pow.f64 (-.f64 #s(literal 1 binary64) (/.f64 #s(literal 1 binary64) (+.f64 #s(literal 1 binary64) (exp.f64 (neg.f64 s))))) c_n)) (*.f64 (pow.f64 (/.f64 #s(literal 1 binary64) (+.f64 #s(literal 1 binary64) (exp.f64 (neg.f64 t)))) c_p) (pow.f64 (-.f64 #s(literal 1 binary64) (/.f64 #s(literal 1 binary64) (+.f64 #s(literal 1 binary64) (exp.f64 (neg.f64 t))))) c_n)))

            1. Initial program 90.4%

              \[\frac{{\left(\frac{1}{1 + e^{-s}}\right)}^{c\_p} \cdot {\left(1 - \frac{1}{1 + e^{-s}}\right)}^{c\_n}}{{\left(\frac{1}{1 + e^{-t}}\right)}^{c\_p} \cdot {\left(1 - \frac{1}{1 + e^{-t}}\right)}^{c\_n}} \]
            2. Taylor expanded in c_p around 0

              \[\leadsto \color{blue}{\frac{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(s\right)}}\right)}^{c\_n}}{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}^{c\_n}}} \]
            3. Step-by-step derivation
              1. lower-/.f64N/A

                \[\leadsto \frac{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(s\right)}}\right)}^{c\_n}}{\color{blue}{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}^{c\_n}}} \]
              2. lower-pow.f64N/A

                \[\leadsto \frac{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(s\right)}}\right)}^{c\_n}}{{\color{blue}{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}}^{c\_n}} \]
              3. lower--.f64N/A

                \[\leadsto \frac{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(s\right)}}\right)}^{c\_n}}{{\left(\color{blue}{1} - \frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}^{c\_n}} \]
              4. lower-/.f64N/A

                \[\leadsto \frac{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(s\right)}}\right)}^{c\_n}}{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}^{c\_n}} \]
              5. lower-+.f64N/A

                \[\leadsto \frac{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(s\right)}}\right)}^{c\_n}}{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}^{c\_n}} \]
              6. lower-exp.f64N/A

                \[\leadsto \frac{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(s\right)}}\right)}^{c\_n}}{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}^{c\_n}} \]
              7. lower-neg.f64N/A

                \[\leadsto \frac{{\left(1 - \frac{1}{1 + e^{-s}}\right)}^{c\_n}}{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}^{c\_n}} \]
              8. lower-pow.f64N/A

                \[\leadsto \frac{{\left(1 - \frac{1}{1 + e^{-s}}\right)}^{c\_n}}{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}^{\color{blue}{c\_n}}} \]
            4. Applied rewrites94.2%

              \[\leadsto \color{blue}{\frac{{\left(1 - \frac{1}{1 + e^{-s}}\right)}^{c\_n}}{{\left(1 - \frac{1}{1 + e^{-t}}\right)}^{c\_n}}} \]
            5. Taylor expanded in c_n around 0

              \[\leadsto \frac{{\left(1 - \frac{1}{1 + e^{-s}}\right)}^{c\_n}}{1 + \color{blue}{c\_n \cdot \log \left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}} \]
            6. Step-by-step derivation
              1. lower-+.f64N/A

                \[\leadsto \frac{{\left(1 - \frac{1}{1 + e^{-s}}\right)}^{c\_n}}{1 + c\_n \cdot \color{blue}{\log \left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}} \]
              2. lower-*.f64N/A

                \[\leadsto \frac{{\left(1 - \frac{1}{1 + e^{-s}}\right)}^{c\_n}}{1 + c\_n \cdot \log \left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)} \]
              3. lower-30-log1z0N/A

                \[\leadsto \frac{{\left(1 - \frac{1}{1 + e^{-s}}\right)}^{c\_n}}{1 + c\_n \cdot \mathsf{30\_log1z0}\left(\left(\frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)\right)} \]
              4. lower-/.f64N/A

                \[\leadsto \frac{{\left(1 - \frac{1}{1 + e^{-s}}\right)}^{c\_n}}{1 + c\_n \cdot \mathsf{30\_log1z0}\left(\left(\frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)\right)} \]
              5. lower-+.f64N/A

                \[\leadsto \frac{{\left(1 - \frac{1}{1 + e^{-s}}\right)}^{c\_n}}{1 + c\_n \cdot \mathsf{30\_log1z0}\left(\left(\frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)\right)} \]
              6. lower-exp.f64N/A

                \[\leadsto \frac{{\left(1 - \frac{1}{1 + e^{-s}}\right)}^{c\_n}}{1 + c\_n \cdot \mathsf{30\_log1z0}\left(\left(\frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)\right)} \]
              7. lower-neg.f6493.3%

                \[\leadsto \frac{{\left(1 - \frac{1}{1 + e^{-s}}\right)}^{c\_n}}{1 + c\_n \cdot \mathsf{30\_log1z0}\left(\left(\frac{1}{1 + e^{-t}}\right)\right)} \]
            7. Applied rewrites93.3%

              \[\leadsto \frac{{\left(1 - \frac{1}{1 + e^{-s}}\right)}^{c\_n}}{1 + \color{blue}{c\_n \cdot \mathsf{30\_log1z0}\left(\left(\frac{1}{1 + e^{-t}}\right)\right)}} \]
            8. Taylor expanded in t around 0

              \[\leadsto \frac{{\left(1 - \frac{1}{1 + e^{-s}}\right)}^{c\_n}}{1 + c\_n \cdot \mathsf{30\_log1z0}\left(\frac{1}{2}\right)} \]
            9. Step-by-step derivation
              1. Applied rewrites93.7%

                \[\leadsto \frac{{\left(1 - \frac{1}{1 + e^{-s}}\right)}^{c\_n}}{1 + c\_n \cdot \mathsf{30\_log1z0}\left(\frac{1}{2}\right)} \]
            10. Recombined 2 regimes into one program.
            11. Add Preprocessing

            Alternative 6: 95.2% accurate, 3.2× speedup?

            \[\begin{array}{l} t_1 := \mathsf{30\_log1z0}\left(\left(\frac{1}{1 + e^{-t}}\right)\right)\\ \mathbf{if}\;c\_n \leq 27000:\\ \;\;\;\;1 + c\_n \cdot \left(\mathsf{30\_log1z0}\left(\left(\frac{1}{1 + e^{-s}}\right)\right) - t\_1\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{{\frac{1}{2}}^{c\_n}}{1 + c\_n \cdot t\_1}\\ \end{array} \]
            (FPCore (c_p c_n t s)
              :precision binary64
              (let* ((t_1 (30-log1z0 (/ 1 (+ 1 (exp (- t)))))))
              (if (<= c_n 27000)
                (+ 1 (* c_n (- (30-log1z0 (/ 1 (+ 1 (exp (- s))))) t_1)))
                (/ (pow 1/2 c_n) (+ 1 (* c_n t_1))))))
            \begin{array}{l}
            t_1 := \mathsf{30\_log1z0}\left(\left(\frac{1}{1 + e^{-t}}\right)\right)\\
            \mathbf{if}\;c\_n \leq 27000:\\
            \;\;\;\;1 + c\_n \cdot \left(\mathsf{30\_log1z0}\left(\left(\frac{1}{1 + e^{-s}}\right)\right) - t\_1\right)\\
            
            \mathbf{else}:\\
            \;\;\;\;\frac{{\frac{1}{2}}^{c\_n}}{1 + c\_n \cdot t\_1}\\
            
            
            \end{array}
            
            Derivation
            1. Split input into 2 regimes
            2. if c_n < 27000

              1. Initial program 90.4%

                \[\frac{{\left(\frac{1}{1 + e^{-s}}\right)}^{c\_p} \cdot {\left(1 - \frac{1}{1 + e^{-s}}\right)}^{c\_n}}{{\left(\frac{1}{1 + e^{-t}}\right)}^{c\_p} \cdot {\left(1 - \frac{1}{1 + e^{-t}}\right)}^{c\_n}} \]
              2. Taylor expanded in c_p around 0

                \[\leadsto \color{blue}{\frac{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(s\right)}}\right)}^{c\_n}}{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}^{c\_n}}} \]
              3. Step-by-step derivation
                1. lower-/.f64N/A

                  \[\leadsto \frac{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(s\right)}}\right)}^{c\_n}}{\color{blue}{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}^{c\_n}}} \]
                2. lower-pow.f64N/A

                  \[\leadsto \frac{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(s\right)}}\right)}^{c\_n}}{{\color{blue}{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}}^{c\_n}} \]
                3. lower--.f64N/A

                  \[\leadsto \frac{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(s\right)}}\right)}^{c\_n}}{{\left(\color{blue}{1} - \frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}^{c\_n}} \]
                4. lower-/.f64N/A

                  \[\leadsto \frac{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(s\right)}}\right)}^{c\_n}}{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}^{c\_n}} \]
                5. lower-+.f64N/A

                  \[\leadsto \frac{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(s\right)}}\right)}^{c\_n}}{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}^{c\_n}} \]
                6. lower-exp.f64N/A

                  \[\leadsto \frac{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(s\right)}}\right)}^{c\_n}}{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}^{c\_n}} \]
                7. lower-neg.f64N/A

                  \[\leadsto \frac{{\left(1 - \frac{1}{1 + e^{-s}}\right)}^{c\_n}}{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}^{c\_n}} \]
                8. lower-pow.f64N/A

                  \[\leadsto \frac{{\left(1 - \frac{1}{1 + e^{-s}}\right)}^{c\_n}}{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}^{\color{blue}{c\_n}}} \]
              4. Applied rewrites94.2%

                \[\leadsto \color{blue}{\frac{{\left(1 - \frac{1}{1 + e^{-s}}\right)}^{c\_n}}{{\left(1 - \frac{1}{1 + e^{-t}}\right)}^{c\_n}}} \]
              5. Taylor expanded in c_n around 0

                \[\leadsto 1 + \color{blue}{c\_n \cdot \left(\log \left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(s\right)}}\right) - \log \left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)\right)} \]
              6. Step-by-step derivation
                1. lower-+.f64N/A

                  \[\leadsto 1 + c\_n \cdot \color{blue}{\left(\log \left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(s\right)}}\right) - \log \left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)\right)} \]
                2. lower-*.f64N/A

                  \[\leadsto 1 + c\_n \cdot \left(\log \left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(s\right)}}\right) - \color{blue}{\log \left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}\right) \]
                3. lower--.f64N/A

                  \[\leadsto 1 + c\_n \cdot \left(\log \left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(s\right)}}\right) - \log \left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)\right) \]
                4. lower-30-log1z0N/A

                  \[\leadsto 1 + c\_n \cdot \left(\mathsf{30\_log1z0}\left(\left(\frac{1}{1 + e^{\mathsf{neg}\left(s\right)}}\right)\right) - \log \left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)\right) \]
                5. lower-/.f64N/A

                  \[\leadsto 1 + c\_n \cdot \left(\mathsf{30\_log1z0}\left(\left(\frac{1}{1 + e^{\mathsf{neg}\left(s\right)}}\right)\right) - \log \left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)\right) \]
                6. lower-+.f64N/A

                  \[\leadsto 1 + c\_n \cdot \left(\mathsf{30\_log1z0}\left(\left(\frac{1}{1 + e^{\mathsf{neg}\left(s\right)}}\right)\right) - \log \left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)\right) \]
                7. lower-exp.f64N/A

                  \[\leadsto 1 + c\_n \cdot \left(\mathsf{30\_log1z0}\left(\left(\frac{1}{1 + e^{\mathsf{neg}\left(s\right)}}\right)\right) - \log \left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)\right) \]
                8. lower-neg.f64N/A

                  \[\leadsto 1 + c\_n \cdot \left(\mathsf{30\_log1z0}\left(\left(\frac{1}{1 + e^{-s}}\right)\right) - \log \left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)\right) \]
                9. lower-30-log1z0N/A

                  \[\leadsto 1 + c\_n \cdot \left(\mathsf{30\_log1z0}\left(\left(\frac{1}{1 + e^{-s}}\right)\right) - \mathsf{30\_log1z0}\left(\left(\frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)\right)\right) \]
              7. Applied rewrites93.7%

                \[\leadsto 1 + \color{blue}{c\_n \cdot \left(\mathsf{30\_log1z0}\left(\left(\frac{1}{1 + e^{-s}}\right)\right) - \mathsf{30\_log1z0}\left(\left(\frac{1}{1 + e^{-t}}\right)\right)\right)} \]

              if 27000 < c_n

              1. Initial program 90.4%

                \[\frac{{\left(\frac{1}{1 + e^{-s}}\right)}^{c\_p} \cdot {\left(1 - \frac{1}{1 + e^{-s}}\right)}^{c\_n}}{{\left(\frac{1}{1 + e^{-t}}\right)}^{c\_p} \cdot {\left(1 - \frac{1}{1 + e^{-t}}\right)}^{c\_n}} \]
              2. Taylor expanded in c_p around 0

                \[\leadsto \color{blue}{\frac{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(s\right)}}\right)}^{c\_n}}{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}^{c\_n}}} \]
              3. Step-by-step derivation
                1. lower-/.f64N/A

                  \[\leadsto \frac{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(s\right)}}\right)}^{c\_n}}{\color{blue}{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}^{c\_n}}} \]
                2. lower-pow.f64N/A

                  \[\leadsto \frac{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(s\right)}}\right)}^{c\_n}}{{\color{blue}{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}}^{c\_n}} \]
                3. lower--.f64N/A

                  \[\leadsto \frac{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(s\right)}}\right)}^{c\_n}}{{\left(\color{blue}{1} - \frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}^{c\_n}} \]
                4. lower-/.f64N/A

                  \[\leadsto \frac{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(s\right)}}\right)}^{c\_n}}{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}^{c\_n}} \]
                5. lower-+.f64N/A

                  \[\leadsto \frac{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(s\right)}}\right)}^{c\_n}}{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}^{c\_n}} \]
                6. lower-exp.f64N/A

                  \[\leadsto \frac{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(s\right)}}\right)}^{c\_n}}{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}^{c\_n}} \]
                7. lower-neg.f64N/A

                  \[\leadsto \frac{{\left(1 - \frac{1}{1 + e^{-s}}\right)}^{c\_n}}{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}^{c\_n}} \]
                8. lower-pow.f64N/A

                  \[\leadsto \frac{{\left(1 - \frac{1}{1 + e^{-s}}\right)}^{c\_n}}{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}^{\color{blue}{c\_n}}} \]
              4. Applied rewrites94.2%

                \[\leadsto \color{blue}{\frac{{\left(1 - \frac{1}{1 + e^{-s}}\right)}^{c\_n}}{{\left(1 - \frac{1}{1 + e^{-t}}\right)}^{c\_n}}} \]
              5. Taylor expanded in s around 0

                \[\leadsto \frac{{\frac{1}{2}}^{c\_n}}{\color{blue}{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}^{c\_n}}} \]
              6. Step-by-step derivation
                1. lower-/.f64N/A

                  \[\leadsto \frac{{\frac{1}{2}}^{c\_n}}{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}^{\color{blue}{c\_n}}} \]
                2. lower-pow.f64N/A

                  \[\leadsto \frac{{\frac{1}{2}}^{c\_n}}{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}^{c\_n}} \]
                3. lower-pow.f64N/A

                  \[\leadsto \frac{{\frac{1}{2}}^{c\_n}}{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}^{c\_n}} \]
                4. lower--.f64N/A

                  \[\leadsto \frac{{\frac{1}{2}}^{c\_n}}{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}^{c\_n}} \]
                5. lower-/.f64N/A

                  \[\leadsto \frac{{\frac{1}{2}}^{c\_n}}{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}^{c\_n}} \]
                6. lower-+.f64N/A

                  \[\leadsto \frac{{\frac{1}{2}}^{c\_n}}{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}^{c\_n}} \]
                7. lower-exp.f64N/A

                  \[\leadsto \frac{{\frac{1}{2}}^{c\_n}}{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}^{c\_n}} \]
                8. lower-neg.f6494.0%

                  \[\leadsto \frac{{\frac{1}{2}}^{c\_n}}{{\left(1 - \frac{1}{1 + e^{-t}}\right)}^{c\_n}} \]
              7. Applied rewrites94.0%

                \[\leadsto \frac{{\frac{1}{2}}^{c\_n}}{\color{blue}{{\left(1 - \frac{1}{1 + e^{-t}}\right)}^{c\_n}}} \]
              8. Taylor expanded in c_n around 0

                \[\leadsto \frac{{\frac{1}{2}}^{c\_n}}{1 + c\_n \cdot \color{blue}{\log \left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}} \]
              9. Step-by-step derivation
                1. lower-+.f64N/A

                  \[\leadsto \frac{{\frac{1}{2}}^{c\_n}}{1 + c\_n \cdot \log \left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)} \]
                2. lower-*.f64N/A

                  \[\leadsto \frac{{\frac{1}{2}}^{c\_n}}{1 + c\_n \cdot \log \left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)} \]
                3. lower-30-log1z0N/A

                  \[\leadsto \frac{{\frac{1}{2}}^{c\_n}}{1 + c\_n \cdot \mathsf{30\_log1z0}\left(\left(\frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)\right)} \]
                4. lower-/.f64N/A

                  \[\leadsto \frac{{\frac{1}{2}}^{c\_n}}{1 + c\_n \cdot \mathsf{30\_log1z0}\left(\left(\frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)\right)} \]
                5. lower-+.f64N/A

                  \[\leadsto \frac{{\frac{1}{2}}^{c\_n}}{1 + c\_n \cdot \mathsf{30\_log1z0}\left(\left(\frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)\right)} \]
                6. lower-exp.f64N/A

                  \[\leadsto \frac{{\frac{1}{2}}^{c\_n}}{1 + c\_n \cdot \mathsf{30\_log1z0}\left(\left(\frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)\right)} \]
                7. lower-neg.f6493.2%

                  \[\leadsto \frac{{\frac{1}{2}}^{c\_n}}{1 + c\_n \cdot \mathsf{30\_log1z0}\left(\left(\frac{1}{1 + e^{-t}}\right)\right)} \]
              10. Applied rewrites93.2%

                \[\leadsto \frac{{\frac{1}{2}}^{c\_n}}{1 + c\_n \cdot \color{blue}{\mathsf{30\_log1z0}\left(\left(\frac{1}{1 + e^{-t}}\right)\right)}} \]
            3. Recombined 2 regimes into one program.
            4. Add Preprocessing

            Alternative 7: 94.7% accurate, 3.5× speedup?

            \[\begin{array}{l} \mathbf{if}\;c\_n \leq 27000:\\ \;\;\;\;1 + \frac{-1}{2} \cdot \left(c\_p \cdot t\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{{\frac{1}{2}}^{c\_n}}{1 + c\_n \cdot \mathsf{30\_log1z0}\left(\left(\frac{1}{1 + e^{-t}}\right)\right)}\\ \end{array} \]
            (FPCore (c_p c_n t s)
              :precision binary64
              (if (<= c_n 27000)
              (+ 1 (* -1/2 (* c_p t)))
              (/ (pow 1/2 c_n) (+ 1 (* c_n (30-log1z0 (/ 1 (+ 1 (exp (- t))))))))))
            \begin{array}{l}
            \mathbf{if}\;c\_n \leq 27000:\\
            \;\;\;\;1 + \frac{-1}{2} \cdot \left(c\_p \cdot t\right)\\
            
            \mathbf{else}:\\
            \;\;\;\;\frac{{\frac{1}{2}}^{c\_n}}{1 + c\_n \cdot \mathsf{30\_log1z0}\left(\left(\frac{1}{1 + e^{-t}}\right)\right)}\\
            
            
            \end{array}
            
            Derivation
            1. Split input into 2 regimes
            2. if c_n < 27000

              1. Initial program 90.4%

                \[\frac{{\left(\frac{1}{1 + e^{-s}}\right)}^{c\_p} \cdot {\left(1 - \frac{1}{1 + e^{-s}}\right)}^{c\_n}}{{\left(\frac{1}{1 + e^{-t}}\right)}^{c\_p} \cdot {\left(1 - \frac{1}{1 + e^{-t}}\right)}^{c\_n}} \]
              2. Taylor expanded in c_n around 0

                \[\leadsto \color{blue}{\frac{{\left(\frac{1}{1 + e^{\mathsf{neg}\left(s\right)}}\right)}^{c\_p}}{{\left(\frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}^{c\_p}}} \]
              3. Step-by-step derivation
                1. lower-/.f64N/A

                  \[\leadsto \frac{{\left(\frac{1}{1 + e^{\mathsf{neg}\left(s\right)}}\right)}^{c\_p}}{\color{blue}{{\left(\frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}^{c\_p}}} \]
                2. lower-pow.f64N/A

                  \[\leadsto \frac{{\left(\frac{1}{1 + e^{\mathsf{neg}\left(s\right)}}\right)}^{c\_p}}{{\color{blue}{\left(\frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}}^{c\_p}} \]
                3. lower-/.f64N/A

                  \[\leadsto \frac{{\left(\frac{1}{1 + e^{\mathsf{neg}\left(s\right)}}\right)}^{c\_p}}{{\left(\frac{\color{blue}{1}}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}^{c\_p}} \]
                4. lower-+.f64N/A

                  \[\leadsto \frac{{\left(\frac{1}{1 + e^{\mathsf{neg}\left(s\right)}}\right)}^{c\_p}}{{\left(\frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}^{c\_p}} \]
                5. lower-exp.f64N/A

                  \[\leadsto \frac{{\left(\frac{1}{1 + e^{\mathsf{neg}\left(s\right)}}\right)}^{c\_p}}{{\left(\frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}^{c\_p}} \]
                6. lower-neg.f64N/A

                  \[\leadsto \frac{{\left(\frac{1}{1 + e^{-s}}\right)}^{c\_p}}{{\left(\frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}^{c\_p}} \]
                7. lower-pow.f64N/A

                  \[\leadsto \frac{{\left(\frac{1}{1 + e^{-s}}\right)}^{c\_p}}{{\left(\frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}^{\color{blue}{c\_p}}} \]
              4. Applied rewrites92.6%

                \[\leadsto \color{blue}{\frac{{\left(\frac{1}{1 + e^{-s}}\right)}^{c\_p}}{{\left(\frac{1}{1 + e^{-t}}\right)}^{c\_p}}} \]
              5. Taylor expanded in s around 0

                \[\leadsto \frac{{\frac{1}{2}}^{c\_p}}{\color{blue}{{\left(\frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}^{c\_p}}} \]
              6. Step-by-step derivation
                1. lower-/.f64N/A

                  \[\leadsto \frac{{\frac{1}{2}}^{c\_p}}{{\left(\frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}^{\color{blue}{c\_p}}} \]
                2. lower-pow.f64N/A

                  \[\leadsto \frac{{\frac{1}{2}}^{c\_p}}{{\left(\frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}^{c\_p}} \]
                3. lower-pow.f64N/A

                  \[\leadsto \frac{{\frac{1}{2}}^{c\_p}}{{\left(\frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}^{c\_p}} \]
                4. lower-/.f64N/A

                  \[\leadsto \frac{{\frac{1}{2}}^{c\_p}}{{\left(\frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}^{c\_p}} \]
                5. lower-+.f64N/A

                  \[\leadsto \frac{{\frac{1}{2}}^{c\_p}}{{\left(\frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}^{c\_p}} \]
                6. lower-exp.f64N/A

                  \[\leadsto \frac{{\frac{1}{2}}^{c\_p}}{{\left(\frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}^{c\_p}} \]
                7. lower-neg.f6492.2%

                  \[\leadsto \frac{{\frac{1}{2}}^{c\_p}}{{\left(\frac{1}{1 + e^{-t}}\right)}^{c\_p}} \]
              7. Applied rewrites92.2%

                \[\leadsto \frac{{\frac{1}{2}}^{c\_p}}{\color{blue}{{\left(\frac{1}{1 + e^{-t}}\right)}^{c\_p}}} \]
              8. Taylor expanded in t around 0

                \[\leadsto 1 + \frac{-1}{2} \cdot \color{blue}{\left(c\_p \cdot t\right)} \]
              9. Step-by-step derivation
                1. lower-+.f64N/A

                  \[\leadsto 1 + \frac{-1}{2} \cdot \left(c\_p \cdot \color{blue}{t}\right) \]
                2. lower-*.f64N/A

                  \[\leadsto 1 + \frac{-1}{2} \cdot \left(c\_p \cdot t\right) \]
                3. lower-*.f6494.4%

                  \[\leadsto 1 + \frac{-1}{2} \cdot \left(c\_p \cdot t\right) \]
              10. Applied rewrites94.4%

                \[\leadsto 1 + \frac{-1}{2} \cdot \color{blue}{\left(c\_p \cdot t\right)} \]

              if 27000 < c_n

              1. Initial program 90.4%

                \[\frac{{\left(\frac{1}{1 + e^{-s}}\right)}^{c\_p} \cdot {\left(1 - \frac{1}{1 + e^{-s}}\right)}^{c\_n}}{{\left(\frac{1}{1 + e^{-t}}\right)}^{c\_p} \cdot {\left(1 - \frac{1}{1 + e^{-t}}\right)}^{c\_n}} \]
              2. Taylor expanded in c_p around 0

                \[\leadsto \color{blue}{\frac{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(s\right)}}\right)}^{c\_n}}{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}^{c\_n}}} \]
              3. Step-by-step derivation
                1. lower-/.f64N/A

                  \[\leadsto \frac{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(s\right)}}\right)}^{c\_n}}{\color{blue}{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}^{c\_n}}} \]
                2. lower-pow.f64N/A

                  \[\leadsto \frac{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(s\right)}}\right)}^{c\_n}}{{\color{blue}{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}}^{c\_n}} \]
                3. lower--.f64N/A

                  \[\leadsto \frac{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(s\right)}}\right)}^{c\_n}}{{\left(\color{blue}{1} - \frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}^{c\_n}} \]
                4. lower-/.f64N/A

                  \[\leadsto \frac{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(s\right)}}\right)}^{c\_n}}{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}^{c\_n}} \]
                5. lower-+.f64N/A

                  \[\leadsto \frac{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(s\right)}}\right)}^{c\_n}}{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}^{c\_n}} \]
                6. lower-exp.f64N/A

                  \[\leadsto \frac{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(s\right)}}\right)}^{c\_n}}{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}^{c\_n}} \]
                7. lower-neg.f64N/A

                  \[\leadsto \frac{{\left(1 - \frac{1}{1 + e^{-s}}\right)}^{c\_n}}{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}^{c\_n}} \]
                8. lower-pow.f64N/A

                  \[\leadsto \frac{{\left(1 - \frac{1}{1 + e^{-s}}\right)}^{c\_n}}{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}^{\color{blue}{c\_n}}} \]
              4. Applied rewrites94.2%

                \[\leadsto \color{blue}{\frac{{\left(1 - \frac{1}{1 + e^{-s}}\right)}^{c\_n}}{{\left(1 - \frac{1}{1 + e^{-t}}\right)}^{c\_n}}} \]
              5. Taylor expanded in s around 0

                \[\leadsto \frac{{\frac{1}{2}}^{c\_n}}{\color{blue}{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}^{c\_n}}} \]
              6. Step-by-step derivation
                1. lower-/.f64N/A

                  \[\leadsto \frac{{\frac{1}{2}}^{c\_n}}{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}^{\color{blue}{c\_n}}} \]
                2. lower-pow.f64N/A

                  \[\leadsto \frac{{\frac{1}{2}}^{c\_n}}{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}^{c\_n}} \]
                3. lower-pow.f64N/A

                  \[\leadsto \frac{{\frac{1}{2}}^{c\_n}}{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}^{c\_n}} \]
                4. lower--.f64N/A

                  \[\leadsto \frac{{\frac{1}{2}}^{c\_n}}{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}^{c\_n}} \]
                5. lower-/.f64N/A

                  \[\leadsto \frac{{\frac{1}{2}}^{c\_n}}{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}^{c\_n}} \]
                6. lower-+.f64N/A

                  \[\leadsto \frac{{\frac{1}{2}}^{c\_n}}{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}^{c\_n}} \]
                7. lower-exp.f64N/A

                  \[\leadsto \frac{{\frac{1}{2}}^{c\_n}}{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}^{c\_n}} \]
                8. lower-neg.f6494.0%

                  \[\leadsto \frac{{\frac{1}{2}}^{c\_n}}{{\left(1 - \frac{1}{1 + e^{-t}}\right)}^{c\_n}} \]
              7. Applied rewrites94.0%

                \[\leadsto \frac{{\frac{1}{2}}^{c\_n}}{\color{blue}{{\left(1 - \frac{1}{1 + e^{-t}}\right)}^{c\_n}}} \]
              8. Taylor expanded in c_n around 0

                \[\leadsto \frac{{\frac{1}{2}}^{c\_n}}{1 + c\_n \cdot \color{blue}{\log \left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}} \]
              9. Step-by-step derivation
                1. lower-+.f64N/A

                  \[\leadsto \frac{{\frac{1}{2}}^{c\_n}}{1 + c\_n \cdot \log \left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)} \]
                2. lower-*.f64N/A

                  \[\leadsto \frac{{\frac{1}{2}}^{c\_n}}{1 + c\_n \cdot \log \left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)} \]
                3. lower-30-log1z0N/A

                  \[\leadsto \frac{{\frac{1}{2}}^{c\_n}}{1 + c\_n \cdot \mathsf{30\_log1z0}\left(\left(\frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)\right)} \]
                4. lower-/.f64N/A

                  \[\leadsto \frac{{\frac{1}{2}}^{c\_n}}{1 + c\_n \cdot \mathsf{30\_log1z0}\left(\left(\frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)\right)} \]
                5. lower-+.f64N/A

                  \[\leadsto \frac{{\frac{1}{2}}^{c\_n}}{1 + c\_n \cdot \mathsf{30\_log1z0}\left(\left(\frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)\right)} \]
                6. lower-exp.f64N/A

                  \[\leadsto \frac{{\frac{1}{2}}^{c\_n}}{1 + c\_n \cdot \mathsf{30\_log1z0}\left(\left(\frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)\right)} \]
                7. lower-neg.f6493.2%

                  \[\leadsto \frac{{\frac{1}{2}}^{c\_n}}{1 + c\_n \cdot \mathsf{30\_log1z0}\left(\left(\frac{1}{1 + e^{-t}}\right)\right)} \]
              10. Applied rewrites93.2%

                \[\leadsto \frac{{\frac{1}{2}}^{c\_n}}{1 + c\_n \cdot \color{blue}{\mathsf{30\_log1z0}\left(\left(\frac{1}{1 + e^{-t}}\right)\right)}} \]
            3. Recombined 2 regimes into one program.
            4. Add Preprocessing

            Alternative 8: 94.4% accurate, 4.0× speedup?

            \[\frac{{\frac{1}{2}}^{c\_n}}{{\left(\frac{1}{2} + \frac{-1}{4} \cdot t\right)}^{c\_n}} \]
            (FPCore (c_p c_n t s)
              :precision binary64
              (/ (pow 1/2 c_n) (pow (+ 1/2 (* -1/4 t)) c_n)))
            double code(double c_p, double c_n, double t, double s) {
            	return pow(0.5, c_n) / pow((0.5 + (-0.25 * t)), c_n);
            }
            
            module fmin_fmax_functions
                implicit none
                private
                public fmax
                public fmin
            
                interface fmax
                    module procedure fmax88
                    module procedure fmax44
                    module procedure fmax84
                    module procedure fmax48
                end interface
                interface fmin
                    module procedure fmin88
                    module procedure fmin44
                    module procedure fmin84
                    module procedure fmin48
                end interface
            contains
                real(8) function fmax88(x, y) result (res)
                    real(8), intent (in) :: x
                    real(8), intent (in) :: y
                    res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                end function
                real(4) function fmax44(x, y) result (res)
                    real(4), intent (in) :: x
                    real(4), intent (in) :: y
                    res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                end function
                real(8) function fmax84(x, y) result(res)
                    real(8), intent (in) :: x
                    real(4), intent (in) :: y
                    res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                end function
                real(8) function fmax48(x, y) result(res)
                    real(4), intent (in) :: x
                    real(8), intent (in) :: y
                    res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                end function
                real(8) function fmin88(x, y) result (res)
                    real(8), intent (in) :: x
                    real(8), intent (in) :: y
                    res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                end function
                real(4) function fmin44(x, y) result (res)
                    real(4), intent (in) :: x
                    real(4), intent (in) :: y
                    res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                end function
                real(8) function fmin84(x, y) result(res)
                    real(8), intent (in) :: x
                    real(4), intent (in) :: y
                    res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                end function
                real(8) function fmin48(x, y) result(res)
                    real(4), intent (in) :: x
                    real(8), intent (in) :: y
                    res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                end function
            end module
            
            real(8) function code(c_p, c_n, t, s)
            use fmin_fmax_functions
                real(8), intent (in) :: c_p
                real(8), intent (in) :: c_n
                real(8), intent (in) :: t
                real(8), intent (in) :: s
                code = (0.5d0 ** c_n) / ((0.5d0 + ((-0.25d0) * t)) ** c_n)
            end function
            
            public static double code(double c_p, double c_n, double t, double s) {
            	return Math.pow(0.5, c_n) / Math.pow((0.5 + (-0.25 * t)), c_n);
            }
            
            def code(c_p, c_n, t, s):
            	return math.pow(0.5, c_n) / math.pow((0.5 + (-0.25 * t)), c_n)
            
            function code(c_p, c_n, t, s)
            	return Float64((0.5 ^ c_n) / (Float64(0.5 + Float64(-0.25 * t)) ^ c_n))
            end
            
            function tmp = code(c_p, c_n, t, s)
            	tmp = (0.5 ^ c_n) / ((0.5 + (-0.25 * t)) ^ c_n);
            end
            
            code[c$95$p_, c$95$n_, t_, s_] := N[(N[Power[1/2, c$95$n], $MachinePrecision] / N[Power[N[(1/2 + N[(-1/4 * t), $MachinePrecision]), $MachinePrecision], c$95$n], $MachinePrecision]), $MachinePrecision]
            
            \frac{{\frac{1}{2}}^{c\_n}}{{\left(\frac{1}{2} + \frac{-1}{4} \cdot t\right)}^{c\_n}}
            
            Derivation
            1. Initial program 90.4%

              \[\frac{{\left(\frac{1}{1 + e^{-s}}\right)}^{c\_p} \cdot {\left(1 - \frac{1}{1 + e^{-s}}\right)}^{c\_n}}{{\left(\frac{1}{1 + e^{-t}}\right)}^{c\_p} \cdot {\left(1 - \frac{1}{1 + e^{-t}}\right)}^{c\_n}} \]
            2. Taylor expanded in c_p around 0

              \[\leadsto \color{blue}{\frac{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(s\right)}}\right)}^{c\_n}}{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}^{c\_n}}} \]
            3. Step-by-step derivation
              1. lower-/.f64N/A

                \[\leadsto \frac{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(s\right)}}\right)}^{c\_n}}{\color{blue}{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}^{c\_n}}} \]
              2. lower-pow.f64N/A

                \[\leadsto \frac{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(s\right)}}\right)}^{c\_n}}{{\color{blue}{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}}^{c\_n}} \]
              3. lower--.f64N/A

                \[\leadsto \frac{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(s\right)}}\right)}^{c\_n}}{{\left(\color{blue}{1} - \frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}^{c\_n}} \]
              4. lower-/.f64N/A

                \[\leadsto \frac{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(s\right)}}\right)}^{c\_n}}{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}^{c\_n}} \]
              5. lower-+.f64N/A

                \[\leadsto \frac{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(s\right)}}\right)}^{c\_n}}{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}^{c\_n}} \]
              6. lower-exp.f64N/A

                \[\leadsto \frac{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(s\right)}}\right)}^{c\_n}}{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}^{c\_n}} \]
              7. lower-neg.f64N/A

                \[\leadsto \frac{{\left(1 - \frac{1}{1 + e^{-s}}\right)}^{c\_n}}{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}^{c\_n}} \]
              8. lower-pow.f64N/A

                \[\leadsto \frac{{\left(1 - \frac{1}{1 + e^{-s}}\right)}^{c\_n}}{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}^{\color{blue}{c\_n}}} \]
            4. Applied rewrites94.2%

              \[\leadsto \color{blue}{\frac{{\left(1 - \frac{1}{1 + e^{-s}}\right)}^{c\_n}}{{\left(1 - \frac{1}{1 + e^{-t}}\right)}^{c\_n}}} \]
            5. Taylor expanded in s around 0

              \[\leadsto \frac{{\frac{1}{2}}^{c\_n}}{\color{blue}{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}^{c\_n}}} \]
            6. Step-by-step derivation
              1. lower-/.f64N/A

                \[\leadsto \frac{{\frac{1}{2}}^{c\_n}}{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}^{\color{blue}{c\_n}}} \]
              2. lower-pow.f64N/A

                \[\leadsto \frac{{\frac{1}{2}}^{c\_n}}{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}^{c\_n}} \]
              3. lower-pow.f64N/A

                \[\leadsto \frac{{\frac{1}{2}}^{c\_n}}{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}^{c\_n}} \]
              4. lower--.f64N/A

                \[\leadsto \frac{{\frac{1}{2}}^{c\_n}}{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}^{c\_n}} \]
              5. lower-/.f64N/A

                \[\leadsto \frac{{\frac{1}{2}}^{c\_n}}{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}^{c\_n}} \]
              6. lower-+.f64N/A

                \[\leadsto \frac{{\frac{1}{2}}^{c\_n}}{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}^{c\_n}} \]
              7. lower-exp.f64N/A

                \[\leadsto \frac{{\frac{1}{2}}^{c\_n}}{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}^{c\_n}} \]
              8. lower-neg.f6494.0%

                \[\leadsto \frac{{\frac{1}{2}}^{c\_n}}{{\left(1 - \frac{1}{1 + e^{-t}}\right)}^{c\_n}} \]
            7. Applied rewrites94.0%

              \[\leadsto \frac{{\frac{1}{2}}^{c\_n}}{\color{blue}{{\left(1 - \frac{1}{1 + e^{-t}}\right)}^{c\_n}}} \]
            8. Taylor expanded in t around 0

              \[\leadsto \frac{{\frac{1}{2}}^{c\_n}}{{\left(\frac{1}{2} + \frac{-1}{4} \cdot t\right)}^{c\_n}} \]
            9. Step-by-step derivation
              1. lower-+.f64N/A

                \[\leadsto \frac{{\frac{1}{2}}^{c\_n}}{{\left(\frac{1}{2} + \frac{-1}{4} \cdot t\right)}^{c\_n}} \]
              2. lower-*.f6493.7%

                \[\leadsto \frac{{\frac{1}{2}}^{c\_n}}{{\left(\frac{1}{2} + \frac{-1}{4} \cdot t\right)}^{c\_n}} \]
            10. Applied rewrites93.7%

              \[\leadsto \frac{{\frac{1}{2}}^{c\_n}}{{\left(\frac{1}{2} + \frac{-1}{4} \cdot t\right)}^{c\_n}} \]
            11. Add Preprocessing

            Alternative 9: 94.4% accurate, 4.1× speedup?

            \[{\left(\frac{-1}{4} \cdot t - \frac{-1}{2}\right)}^{\left(-c\_n\right)} \cdot {\frac{1}{2}}^{c\_n} \]
            (FPCore (c_p c_n t s)
              :precision binary64
              (* (pow (- (* -1/4 t) -1/2) (- c_n)) (pow 1/2 c_n)))
            double code(double c_p, double c_n, double t, double s) {
            	return pow(((-0.25 * t) - -0.5), -c_n) * pow(0.5, c_n);
            }
            
            module fmin_fmax_functions
                implicit none
                private
                public fmax
                public fmin
            
                interface fmax
                    module procedure fmax88
                    module procedure fmax44
                    module procedure fmax84
                    module procedure fmax48
                end interface
                interface fmin
                    module procedure fmin88
                    module procedure fmin44
                    module procedure fmin84
                    module procedure fmin48
                end interface
            contains
                real(8) function fmax88(x, y) result (res)
                    real(8), intent (in) :: x
                    real(8), intent (in) :: y
                    res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                end function
                real(4) function fmax44(x, y) result (res)
                    real(4), intent (in) :: x
                    real(4), intent (in) :: y
                    res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                end function
                real(8) function fmax84(x, y) result(res)
                    real(8), intent (in) :: x
                    real(4), intent (in) :: y
                    res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                end function
                real(8) function fmax48(x, y) result(res)
                    real(4), intent (in) :: x
                    real(8), intent (in) :: y
                    res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                end function
                real(8) function fmin88(x, y) result (res)
                    real(8), intent (in) :: x
                    real(8), intent (in) :: y
                    res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                end function
                real(4) function fmin44(x, y) result (res)
                    real(4), intent (in) :: x
                    real(4), intent (in) :: y
                    res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                end function
                real(8) function fmin84(x, y) result(res)
                    real(8), intent (in) :: x
                    real(4), intent (in) :: y
                    res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                end function
                real(8) function fmin48(x, y) result(res)
                    real(4), intent (in) :: x
                    real(8), intent (in) :: y
                    res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                end function
            end module
            
            real(8) function code(c_p, c_n, t, s)
            use fmin_fmax_functions
                real(8), intent (in) :: c_p
                real(8), intent (in) :: c_n
                real(8), intent (in) :: t
                real(8), intent (in) :: s
                code = ((((-0.25d0) * t) - (-0.5d0)) ** -c_n) * (0.5d0 ** c_n)
            end function
            
            public static double code(double c_p, double c_n, double t, double s) {
            	return Math.pow(((-0.25 * t) - -0.5), -c_n) * Math.pow(0.5, c_n);
            }
            
            def code(c_p, c_n, t, s):
            	return math.pow(((-0.25 * t) - -0.5), -c_n) * math.pow(0.5, c_n)
            
            function code(c_p, c_n, t, s)
            	return Float64((Float64(Float64(-0.25 * t) - -0.5) ^ Float64(-c_n)) * (0.5 ^ c_n))
            end
            
            function tmp = code(c_p, c_n, t, s)
            	tmp = (((-0.25 * t) - -0.5) ^ -c_n) * (0.5 ^ c_n);
            end
            
            code[c$95$p_, c$95$n_, t_, s_] := N[(N[Power[N[(N[(-1/4 * t), $MachinePrecision] - -1/2), $MachinePrecision], (-c$95$n)], $MachinePrecision] * N[Power[1/2, c$95$n], $MachinePrecision]), $MachinePrecision]
            
            {\left(\frac{-1}{4} \cdot t - \frac{-1}{2}\right)}^{\left(-c\_n\right)} \cdot {\frac{1}{2}}^{c\_n}
            
            Derivation
            1. Initial program 90.4%

              \[\frac{{\left(\frac{1}{1 + e^{-s}}\right)}^{c\_p} \cdot {\left(1 - \frac{1}{1 + e^{-s}}\right)}^{c\_n}}{{\left(\frac{1}{1 + e^{-t}}\right)}^{c\_p} \cdot {\left(1 - \frac{1}{1 + e^{-t}}\right)}^{c\_n}} \]
            2. Taylor expanded in c_p around 0

              \[\leadsto \color{blue}{\frac{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(s\right)}}\right)}^{c\_n}}{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}^{c\_n}}} \]
            3. Step-by-step derivation
              1. lower-/.f64N/A

                \[\leadsto \frac{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(s\right)}}\right)}^{c\_n}}{\color{blue}{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}^{c\_n}}} \]
              2. lower-pow.f64N/A

                \[\leadsto \frac{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(s\right)}}\right)}^{c\_n}}{{\color{blue}{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}}^{c\_n}} \]
              3. lower--.f64N/A

                \[\leadsto \frac{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(s\right)}}\right)}^{c\_n}}{{\left(\color{blue}{1} - \frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}^{c\_n}} \]
              4. lower-/.f64N/A

                \[\leadsto \frac{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(s\right)}}\right)}^{c\_n}}{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}^{c\_n}} \]
              5. lower-+.f64N/A

                \[\leadsto \frac{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(s\right)}}\right)}^{c\_n}}{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}^{c\_n}} \]
              6. lower-exp.f64N/A

                \[\leadsto \frac{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(s\right)}}\right)}^{c\_n}}{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}^{c\_n}} \]
              7. lower-neg.f64N/A

                \[\leadsto \frac{{\left(1 - \frac{1}{1 + e^{-s}}\right)}^{c\_n}}{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}^{c\_n}} \]
              8. lower-pow.f64N/A

                \[\leadsto \frac{{\left(1 - \frac{1}{1 + e^{-s}}\right)}^{c\_n}}{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}^{\color{blue}{c\_n}}} \]
            4. Applied rewrites94.2%

              \[\leadsto \color{blue}{\frac{{\left(1 - \frac{1}{1 + e^{-s}}\right)}^{c\_n}}{{\left(1 - \frac{1}{1 + e^{-t}}\right)}^{c\_n}}} \]
            5. Taylor expanded in s around 0

              \[\leadsto \frac{{\frac{1}{2}}^{c\_n}}{\color{blue}{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}^{c\_n}}} \]
            6. Step-by-step derivation
              1. lower-/.f64N/A

                \[\leadsto \frac{{\frac{1}{2}}^{c\_n}}{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}^{\color{blue}{c\_n}}} \]
              2. lower-pow.f64N/A

                \[\leadsto \frac{{\frac{1}{2}}^{c\_n}}{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}^{c\_n}} \]
              3. lower-pow.f64N/A

                \[\leadsto \frac{{\frac{1}{2}}^{c\_n}}{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}^{c\_n}} \]
              4. lower--.f64N/A

                \[\leadsto \frac{{\frac{1}{2}}^{c\_n}}{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}^{c\_n}} \]
              5. lower-/.f64N/A

                \[\leadsto \frac{{\frac{1}{2}}^{c\_n}}{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}^{c\_n}} \]
              6. lower-+.f64N/A

                \[\leadsto \frac{{\frac{1}{2}}^{c\_n}}{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}^{c\_n}} \]
              7. lower-exp.f64N/A

                \[\leadsto \frac{{\frac{1}{2}}^{c\_n}}{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}^{c\_n}} \]
              8. lower-neg.f6494.0%

                \[\leadsto \frac{{\frac{1}{2}}^{c\_n}}{{\left(1 - \frac{1}{1 + e^{-t}}\right)}^{c\_n}} \]
            7. Applied rewrites94.0%

              \[\leadsto \frac{{\frac{1}{2}}^{c\_n}}{\color{blue}{{\left(1 - \frac{1}{1 + e^{-t}}\right)}^{c\_n}}} \]
            8. Taylor expanded in t around 0

              \[\leadsto \frac{{\frac{1}{2}}^{c\_n}}{{\left(\frac{1}{2} + \frac{-1}{4} \cdot t\right)}^{c\_n}} \]
            9. Step-by-step derivation
              1. lower-+.f64N/A

                \[\leadsto \frac{{\frac{1}{2}}^{c\_n}}{{\left(\frac{1}{2} + \frac{-1}{4} \cdot t\right)}^{c\_n}} \]
              2. lower-*.f6493.7%

                \[\leadsto \frac{{\frac{1}{2}}^{c\_n}}{{\left(\frac{1}{2} + \frac{-1}{4} \cdot t\right)}^{c\_n}} \]
            10. Applied rewrites93.7%

              \[\leadsto \frac{{\frac{1}{2}}^{c\_n}}{{\left(\frac{1}{2} + \frac{-1}{4} \cdot t\right)}^{c\_n}} \]
            11. Step-by-step derivation
              1. lift-/.f64N/A

                \[\leadsto \frac{{\frac{1}{2}}^{c\_n}}{{\left(\frac{1}{2} + \frac{-1}{4} \cdot t\right)}^{\color{blue}{c\_n}}} \]
              2. mult-flipN/A

                \[\leadsto {\frac{1}{2}}^{c\_n} \cdot \frac{1}{\color{blue}{{\left(\frac{1}{2} + \frac{-1}{4} \cdot t\right)}^{c\_n}}} \]
              3. *-commutativeN/A

                \[\leadsto \frac{1}{{\left(\frac{1}{2} + \frac{-1}{4} \cdot t\right)}^{c\_n}} \cdot {\frac{1}{2}}^{\color{blue}{c\_n}} \]
              4. lower-*.f64N/A

                \[\leadsto \frac{1}{{\left(\frac{1}{2} + \frac{-1}{4} \cdot t\right)}^{c\_n}} \cdot {\frac{1}{2}}^{\color{blue}{c\_n}} \]
              5. lift-pow.f64N/A

                \[\leadsto \frac{1}{{\left(\frac{1}{2} + \frac{-1}{4} \cdot t\right)}^{c\_n}} \cdot {\frac{1}{2}}^{c\_n} \]
              6. pow-flipN/A

                \[\leadsto {\left(\frac{1}{2} + \frac{-1}{4} \cdot t\right)}^{\left(\mathsf{neg}\left(c\_n\right)\right)} \cdot {\frac{1}{2}}^{c\_n} \]
              7. lower-pow.f64N/A

                \[\leadsto {\left(\frac{1}{2} + \frac{-1}{4} \cdot t\right)}^{\left(\mathsf{neg}\left(c\_n\right)\right)} \cdot {\frac{1}{2}}^{c\_n} \]
              8. lift-+.f64N/A

                \[\leadsto {\left(\frac{1}{2} + \frac{-1}{4} \cdot t\right)}^{\left(\mathsf{neg}\left(c\_n\right)\right)} \cdot {\frac{1}{2}}^{c\_n} \]
              9. +-commutativeN/A

                \[\leadsto {\left(\frac{-1}{4} \cdot t + \frac{1}{2}\right)}^{\left(\mathsf{neg}\left(c\_n\right)\right)} \cdot {\frac{1}{2}}^{c\_n} \]
              10. add-flipN/A

                \[\leadsto {\left(\frac{-1}{4} \cdot t - \left(\mathsf{neg}\left(\frac{1}{2}\right)\right)\right)}^{\left(\mathsf{neg}\left(c\_n\right)\right)} \cdot {\frac{1}{2}}^{c\_n} \]
              11. lower--.f64N/A

                \[\leadsto {\left(\frac{-1}{4} \cdot t - \left(\mathsf{neg}\left(\frac{1}{2}\right)\right)\right)}^{\left(\mathsf{neg}\left(c\_n\right)\right)} \cdot {\frac{1}{2}}^{c\_n} \]
              12. metadata-evalN/A

                \[\leadsto {\left(\frac{-1}{4} \cdot t - \frac{-1}{2}\right)}^{\left(\mathsf{neg}\left(c\_n\right)\right)} \cdot {\frac{1}{2}}^{c\_n} \]
              13. metadata-evalN/A

                \[\leadsto {\left(\frac{-1}{4} \cdot t - \frac{-1}{2}\right)}^{\mathsf{Rewrite=>}\left(lower-neg.f64, \left(-c\_n\right)\right)} \cdot {\frac{1}{2}}^{c\_n} \]
            12. Applied rewrites93.7%

              \[\leadsto {\left(\frac{-1}{4} \cdot t - \frac{-1}{2}\right)}^{\left(-c\_n\right)} \cdot {\frac{1}{2}}^{\color{blue}{c\_n}} \]
            13. Add Preprocessing

            Alternative 10: 93.7% accurate, 64.0× speedup?

            \[1 + \frac{-1}{2} \cdot \left(c\_p \cdot t\right) \]
            (FPCore (c_p c_n t s)
              :precision binary64
              (+ 1 (* -1/2 (* c_p t))))
            double code(double c_p, double c_n, double t, double s) {
            	return 1.0 + (-0.5 * (c_p * t));
            }
            
            module fmin_fmax_functions
                implicit none
                private
                public fmax
                public fmin
            
                interface fmax
                    module procedure fmax88
                    module procedure fmax44
                    module procedure fmax84
                    module procedure fmax48
                end interface
                interface fmin
                    module procedure fmin88
                    module procedure fmin44
                    module procedure fmin84
                    module procedure fmin48
                end interface
            contains
                real(8) function fmax88(x, y) result (res)
                    real(8), intent (in) :: x
                    real(8), intent (in) :: y
                    res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                end function
                real(4) function fmax44(x, y) result (res)
                    real(4), intent (in) :: x
                    real(4), intent (in) :: y
                    res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                end function
                real(8) function fmax84(x, y) result(res)
                    real(8), intent (in) :: x
                    real(4), intent (in) :: y
                    res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                end function
                real(8) function fmax48(x, y) result(res)
                    real(4), intent (in) :: x
                    real(8), intent (in) :: y
                    res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                end function
                real(8) function fmin88(x, y) result (res)
                    real(8), intent (in) :: x
                    real(8), intent (in) :: y
                    res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                end function
                real(4) function fmin44(x, y) result (res)
                    real(4), intent (in) :: x
                    real(4), intent (in) :: y
                    res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                end function
                real(8) function fmin84(x, y) result(res)
                    real(8), intent (in) :: x
                    real(4), intent (in) :: y
                    res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                end function
                real(8) function fmin48(x, y) result(res)
                    real(4), intent (in) :: x
                    real(8), intent (in) :: y
                    res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                end function
            end module
            
            real(8) function code(c_p, c_n, t, s)
            use fmin_fmax_functions
                real(8), intent (in) :: c_p
                real(8), intent (in) :: c_n
                real(8), intent (in) :: t
                real(8), intent (in) :: s
                code = 1.0d0 + ((-0.5d0) * (c_p * t))
            end function
            
            public static double code(double c_p, double c_n, double t, double s) {
            	return 1.0 + (-0.5 * (c_p * t));
            }
            
            def code(c_p, c_n, t, s):
            	return 1.0 + (-0.5 * (c_p * t))
            
            function code(c_p, c_n, t, s)
            	return Float64(1.0 + Float64(-0.5 * Float64(c_p * t)))
            end
            
            function tmp = code(c_p, c_n, t, s)
            	tmp = 1.0 + (-0.5 * (c_p * t));
            end
            
            code[c$95$p_, c$95$n_, t_, s_] := N[(1 + N[(-1/2 * N[(c$95$p * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
            
            1 + \frac{-1}{2} \cdot \left(c\_p \cdot t\right)
            
            Derivation
            1. Initial program 90.4%

              \[\frac{{\left(\frac{1}{1 + e^{-s}}\right)}^{c\_p} \cdot {\left(1 - \frac{1}{1 + e^{-s}}\right)}^{c\_n}}{{\left(\frac{1}{1 + e^{-t}}\right)}^{c\_p} \cdot {\left(1 - \frac{1}{1 + e^{-t}}\right)}^{c\_n}} \]
            2. Taylor expanded in c_n around 0

              \[\leadsto \color{blue}{\frac{{\left(\frac{1}{1 + e^{\mathsf{neg}\left(s\right)}}\right)}^{c\_p}}{{\left(\frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}^{c\_p}}} \]
            3. Step-by-step derivation
              1. lower-/.f64N/A

                \[\leadsto \frac{{\left(\frac{1}{1 + e^{\mathsf{neg}\left(s\right)}}\right)}^{c\_p}}{\color{blue}{{\left(\frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}^{c\_p}}} \]
              2. lower-pow.f64N/A

                \[\leadsto \frac{{\left(\frac{1}{1 + e^{\mathsf{neg}\left(s\right)}}\right)}^{c\_p}}{{\color{blue}{\left(\frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}}^{c\_p}} \]
              3. lower-/.f64N/A

                \[\leadsto \frac{{\left(\frac{1}{1 + e^{\mathsf{neg}\left(s\right)}}\right)}^{c\_p}}{{\left(\frac{\color{blue}{1}}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}^{c\_p}} \]
              4. lower-+.f64N/A

                \[\leadsto \frac{{\left(\frac{1}{1 + e^{\mathsf{neg}\left(s\right)}}\right)}^{c\_p}}{{\left(\frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}^{c\_p}} \]
              5. lower-exp.f64N/A

                \[\leadsto \frac{{\left(\frac{1}{1 + e^{\mathsf{neg}\left(s\right)}}\right)}^{c\_p}}{{\left(\frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}^{c\_p}} \]
              6. lower-neg.f64N/A

                \[\leadsto \frac{{\left(\frac{1}{1 + e^{-s}}\right)}^{c\_p}}{{\left(\frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}^{c\_p}} \]
              7. lower-pow.f64N/A

                \[\leadsto \frac{{\left(\frac{1}{1 + e^{-s}}\right)}^{c\_p}}{{\left(\frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}^{\color{blue}{c\_p}}} \]
            4. Applied rewrites92.6%

              \[\leadsto \color{blue}{\frac{{\left(\frac{1}{1 + e^{-s}}\right)}^{c\_p}}{{\left(\frac{1}{1 + e^{-t}}\right)}^{c\_p}}} \]
            5. Taylor expanded in s around 0

              \[\leadsto \frac{{\frac{1}{2}}^{c\_p}}{\color{blue}{{\left(\frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}^{c\_p}}} \]
            6. Step-by-step derivation
              1. lower-/.f64N/A

                \[\leadsto \frac{{\frac{1}{2}}^{c\_p}}{{\left(\frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}^{\color{blue}{c\_p}}} \]
              2. lower-pow.f64N/A

                \[\leadsto \frac{{\frac{1}{2}}^{c\_p}}{{\left(\frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}^{c\_p}} \]
              3. lower-pow.f64N/A

                \[\leadsto \frac{{\frac{1}{2}}^{c\_p}}{{\left(\frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}^{c\_p}} \]
              4. lower-/.f64N/A

                \[\leadsto \frac{{\frac{1}{2}}^{c\_p}}{{\left(\frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}^{c\_p}} \]
              5. lower-+.f64N/A

                \[\leadsto \frac{{\frac{1}{2}}^{c\_p}}{{\left(\frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}^{c\_p}} \]
              6. lower-exp.f64N/A

                \[\leadsto \frac{{\frac{1}{2}}^{c\_p}}{{\left(\frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}^{c\_p}} \]
              7. lower-neg.f6492.2%

                \[\leadsto \frac{{\frac{1}{2}}^{c\_p}}{{\left(\frac{1}{1 + e^{-t}}\right)}^{c\_p}} \]
            7. Applied rewrites92.2%

              \[\leadsto \frac{{\frac{1}{2}}^{c\_p}}{\color{blue}{{\left(\frac{1}{1 + e^{-t}}\right)}^{c\_p}}} \]
            8. Taylor expanded in t around 0

              \[\leadsto 1 + \frac{-1}{2} \cdot \color{blue}{\left(c\_p \cdot t\right)} \]
            9. Step-by-step derivation
              1. lower-+.f64N/A

                \[\leadsto 1 + \frac{-1}{2} \cdot \left(c\_p \cdot \color{blue}{t}\right) \]
              2. lower-*.f64N/A

                \[\leadsto 1 + \frac{-1}{2} \cdot \left(c\_p \cdot t\right) \]
              3. lower-*.f6494.4%

                \[\leadsto 1 + \frac{-1}{2} \cdot \left(c\_p \cdot t\right) \]
            10. Applied rewrites94.4%

              \[\leadsto 1 + \frac{-1}{2} \cdot \color{blue}{\left(c\_p \cdot t\right)} \]
            11. Add Preprocessing

            Alternative 11: 93.7% accurate, 64.0× speedup?

            \[1 + \frac{1}{2} \cdot \left(c\_n \cdot t\right) \]
            (FPCore (c_p c_n t s)
              :precision binary64
              (+ 1 (* 1/2 (* c_n t))))
            double code(double c_p, double c_n, double t, double s) {
            	return 1.0 + (0.5 * (c_n * t));
            }
            
            module fmin_fmax_functions
                implicit none
                private
                public fmax
                public fmin
            
                interface fmax
                    module procedure fmax88
                    module procedure fmax44
                    module procedure fmax84
                    module procedure fmax48
                end interface
                interface fmin
                    module procedure fmin88
                    module procedure fmin44
                    module procedure fmin84
                    module procedure fmin48
                end interface
            contains
                real(8) function fmax88(x, y) result (res)
                    real(8), intent (in) :: x
                    real(8), intent (in) :: y
                    res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                end function
                real(4) function fmax44(x, y) result (res)
                    real(4), intent (in) :: x
                    real(4), intent (in) :: y
                    res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                end function
                real(8) function fmax84(x, y) result(res)
                    real(8), intent (in) :: x
                    real(4), intent (in) :: y
                    res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                end function
                real(8) function fmax48(x, y) result(res)
                    real(4), intent (in) :: x
                    real(8), intent (in) :: y
                    res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                end function
                real(8) function fmin88(x, y) result (res)
                    real(8), intent (in) :: x
                    real(8), intent (in) :: y
                    res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                end function
                real(4) function fmin44(x, y) result (res)
                    real(4), intent (in) :: x
                    real(4), intent (in) :: y
                    res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                end function
                real(8) function fmin84(x, y) result(res)
                    real(8), intent (in) :: x
                    real(4), intent (in) :: y
                    res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                end function
                real(8) function fmin48(x, y) result(res)
                    real(4), intent (in) :: x
                    real(8), intent (in) :: y
                    res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                end function
            end module
            
            real(8) function code(c_p, c_n, t, s)
            use fmin_fmax_functions
                real(8), intent (in) :: c_p
                real(8), intent (in) :: c_n
                real(8), intent (in) :: t
                real(8), intent (in) :: s
                code = 1.0d0 + (0.5d0 * (c_n * t))
            end function
            
            public static double code(double c_p, double c_n, double t, double s) {
            	return 1.0 + (0.5 * (c_n * t));
            }
            
            def code(c_p, c_n, t, s):
            	return 1.0 + (0.5 * (c_n * t))
            
            function code(c_p, c_n, t, s)
            	return Float64(1.0 + Float64(0.5 * Float64(c_n * t)))
            end
            
            function tmp = code(c_p, c_n, t, s)
            	tmp = 1.0 + (0.5 * (c_n * t));
            end
            
            code[c$95$p_, c$95$n_, t_, s_] := N[(1 + N[(1/2 * N[(c$95$n * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
            
            1 + \frac{1}{2} \cdot \left(c\_n \cdot t\right)
            
            Derivation
            1. Initial program 90.4%

              \[\frac{{\left(\frac{1}{1 + e^{-s}}\right)}^{c\_p} \cdot {\left(1 - \frac{1}{1 + e^{-s}}\right)}^{c\_n}}{{\left(\frac{1}{1 + e^{-t}}\right)}^{c\_p} \cdot {\left(1 - \frac{1}{1 + e^{-t}}\right)}^{c\_n}} \]
            2. Taylor expanded in c_p around 0

              \[\leadsto \color{blue}{\frac{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(s\right)}}\right)}^{c\_n}}{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}^{c\_n}}} \]
            3. Step-by-step derivation
              1. lower-/.f64N/A

                \[\leadsto \frac{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(s\right)}}\right)}^{c\_n}}{\color{blue}{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}^{c\_n}}} \]
              2. lower-pow.f64N/A

                \[\leadsto \frac{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(s\right)}}\right)}^{c\_n}}{{\color{blue}{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}}^{c\_n}} \]
              3. lower--.f64N/A

                \[\leadsto \frac{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(s\right)}}\right)}^{c\_n}}{{\left(\color{blue}{1} - \frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}^{c\_n}} \]
              4. lower-/.f64N/A

                \[\leadsto \frac{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(s\right)}}\right)}^{c\_n}}{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}^{c\_n}} \]
              5. lower-+.f64N/A

                \[\leadsto \frac{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(s\right)}}\right)}^{c\_n}}{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}^{c\_n}} \]
              6. lower-exp.f64N/A

                \[\leadsto \frac{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(s\right)}}\right)}^{c\_n}}{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}^{c\_n}} \]
              7. lower-neg.f64N/A

                \[\leadsto \frac{{\left(1 - \frac{1}{1 + e^{-s}}\right)}^{c\_n}}{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}^{c\_n}} \]
              8. lower-pow.f64N/A

                \[\leadsto \frac{{\left(1 - \frac{1}{1 + e^{-s}}\right)}^{c\_n}}{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}^{\color{blue}{c\_n}}} \]
            4. Applied rewrites94.2%

              \[\leadsto \color{blue}{\frac{{\left(1 - \frac{1}{1 + e^{-s}}\right)}^{c\_n}}{{\left(1 - \frac{1}{1 + e^{-t}}\right)}^{c\_n}}} \]
            5. Taylor expanded in s around 0

              \[\leadsto \frac{{\frac{1}{2}}^{c\_n}}{\color{blue}{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}^{c\_n}}} \]
            6. Step-by-step derivation
              1. lower-/.f64N/A

                \[\leadsto \frac{{\frac{1}{2}}^{c\_n}}{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}^{\color{blue}{c\_n}}} \]
              2. lower-pow.f64N/A

                \[\leadsto \frac{{\frac{1}{2}}^{c\_n}}{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}^{c\_n}} \]
              3. lower-pow.f64N/A

                \[\leadsto \frac{{\frac{1}{2}}^{c\_n}}{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}^{c\_n}} \]
              4. lower--.f64N/A

                \[\leadsto \frac{{\frac{1}{2}}^{c\_n}}{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}^{c\_n}} \]
              5. lower-/.f64N/A

                \[\leadsto \frac{{\frac{1}{2}}^{c\_n}}{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}^{c\_n}} \]
              6. lower-+.f64N/A

                \[\leadsto \frac{{\frac{1}{2}}^{c\_n}}{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}^{c\_n}} \]
              7. lower-exp.f64N/A

                \[\leadsto \frac{{\frac{1}{2}}^{c\_n}}{{\left(1 - \frac{1}{1 + e^{\mathsf{neg}\left(t\right)}}\right)}^{c\_n}} \]
              8. lower-neg.f6494.0%

                \[\leadsto \frac{{\frac{1}{2}}^{c\_n}}{{\left(1 - \frac{1}{1 + e^{-t}}\right)}^{c\_n}} \]
            7. Applied rewrites94.0%

              \[\leadsto \frac{{\frac{1}{2}}^{c\_n}}{\color{blue}{{\left(1 - \frac{1}{1 + e^{-t}}\right)}^{c\_n}}} \]
            8. Taylor expanded in t around 0

              \[\leadsto 1 + \frac{1}{2} \cdot \color{blue}{\left(c\_n \cdot t\right)} \]
            9. Step-by-step derivation
              1. lower-+.f64N/A

                \[\leadsto 1 + \frac{1}{2} \cdot \left(c\_n \cdot \color{blue}{t}\right) \]
              2. lower-*.f64N/A

                \[\leadsto 1 + \frac{1}{2} \cdot \left(c\_n \cdot t\right) \]
              3. lower-*.f6494.4%

                \[\leadsto 1 + \frac{1}{2} \cdot \left(c\_n \cdot t\right) \]
            10. Applied rewrites94.4%

              \[\leadsto 1 + \frac{1}{2} \cdot \color{blue}{\left(c\_n \cdot t\right)} \]
            11. Add Preprocessing

            Reproduce

            ?
            herbie shell --seed 2025271 -o generate:evaluate
            (FPCore (c_p c_n t s)
              :name "Harley's example"
              :precision binary64
              :pre (and (< 0 c_p) (< 0 c_n))
              (/ (* (pow (/ 1 (+ 1 (exp (- s)))) c_p) (pow (- 1 (/ 1 (+ 1 (exp (- s))))) c_n)) (* (pow (/ 1 (+ 1 (exp (- t)))) c_p) (pow (- 1 (/ 1 (+ 1 (exp (- t))))) c_n))))