Quotient of sum of exps

Percentage Accurate: 99.0% → 99.1%
Time: 8.4s
Alternatives: 15
Speedup: 1.0×

Specification

?
\[\begin{array}{l} \\ \frac{e^{a}}{e^{a} + e^{b}} \end{array} \]
(FPCore (a b) :precision binary64 (/ (exp a) (+ (exp a) (exp b))))
double code(double a, double b) {
	return exp(a) / (exp(a) + exp(b));
}
real(8) function code(a, b)
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    code = exp(a) / (exp(a) + exp(b))
end function
public static double code(double a, double b) {
	return Math.exp(a) / (Math.exp(a) + Math.exp(b));
}
def code(a, b):
	return math.exp(a) / (math.exp(a) + math.exp(b))
function code(a, b)
	return Float64(exp(a) / Float64(exp(a) + exp(b)))
end
function tmp = code(a, b)
	tmp = exp(a) / (exp(a) + exp(b));
end
code[a_, b_] := N[(N[Exp[a], $MachinePrecision] / N[(N[Exp[a], $MachinePrecision] + N[Exp[b], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\frac{e^{a}}{e^{a} + e^{b}}
\end{array}

Sampling outcomes in binary64 precision:

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 15 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: 99.0% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \frac{e^{a}}{e^{a} + e^{b}} \end{array} \]
(FPCore (a b) :precision binary64 (/ (exp a) (+ (exp a) (exp b))))
double code(double a, double b) {
	return exp(a) / (exp(a) + exp(b));
}
real(8) function code(a, b)
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    code = exp(a) / (exp(a) + exp(b))
end function
public static double code(double a, double b) {
	return Math.exp(a) / (Math.exp(a) + Math.exp(b));
}
def code(a, b):
	return math.exp(a) / (math.exp(a) + math.exp(b))
function code(a, b)
	return Float64(exp(a) / Float64(exp(a) + exp(b)))
end
function tmp = code(a, b)
	tmp = exp(a) / (exp(a) + exp(b));
end
code[a_, b_] := N[(N[Exp[a], $MachinePrecision] / N[(N[Exp[a], $MachinePrecision] + N[Exp[b], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\frac{e^{a}}{e^{a} + e^{b}}
\end{array}

Alternative 1: 99.1% accurate, 0.8× speedup?

\[\begin{array}{l} \\ e^{\mathsf{fma}\left(\log \left(e^{a} + e^{b}\right), -1, a\right)} \end{array} \]
(FPCore (a b) :precision binary64 (exp (fma (log (+ (exp a) (exp b))) -1.0 a)))
double code(double a, double b) {
	return exp(fma(log((exp(a) + exp(b))), -1.0, a));
}
function code(a, b)
	return exp(fma(log(Float64(exp(a) + exp(b))), -1.0, a))
end
code[a_, b_] := N[Exp[N[(N[Log[N[(N[Exp[a], $MachinePrecision] + N[Exp[b], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * -1.0 + a), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}

\\
e^{\mathsf{fma}\left(\log \left(e^{a} + e^{b}\right), -1, a\right)}
\end{array}
Derivation
  1. Initial program 98.8%

    \[\frac{e^{a}}{e^{a} + e^{b}} \]
  2. Add Preprocessing
  3. Step-by-step derivation
    1. lift-/.f64N/A

      \[\leadsto \color{blue}{\frac{e^{a}}{e^{a} + e^{b}}} \]
    2. clear-numN/A

      \[\leadsto \color{blue}{\frac{1}{\frac{e^{a} + e^{b}}{e^{a}}}} \]
    3. associate-/r/N/A

      \[\leadsto \color{blue}{\frac{1}{e^{a} + e^{b}} \cdot e^{a}} \]
    4. inv-powN/A

      \[\leadsto \color{blue}{{\left(e^{a} + e^{b}\right)}^{-1}} \cdot e^{a} \]
    5. pow-to-expN/A

      \[\leadsto \color{blue}{e^{\log \left(e^{a} + e^{b}\right) \cdot -1}} \cdot e^{a} \]
    6. lift-exp.f64N/A

      \[\leadsto e^{\log \left(e^{a} + e^{b}\right) \cdot -1} \cdot \color{blue}{e^{a}} \]
    7. prod-expN/A

      \[\leadsto \color{blue}{e^{\log \left(e^{a} + e^{b}\right) \cdot -1 + a}} \]
    8. lower-exp.f64N/A

      \[\leadsto \color{blue}{e^{\log \left(e^{a} + e^{b}\right) \cdot -1 + a}} \]
    9. lower-fma.f64N/A

      \[\leadsto e^{\color{blue}{\mathsf{fma}\left(\log \left(e^{a} + e^{b}\right), -1, a\right)}} \]
    10. lower-log.f6498.8

      \[\leadsto e^{\mathsf{fma}\left(\color{blue}{\log \left(e^{a} + e^{b}\right)}, -1, a\right)} \]
  4. Applied rewrites98.8%

    \[\leadsto \color{blue}{e^{\mathsf{fma}\left(\log \left(e^{a} + e^{b}\right), -1, a\right)}} \]
  5. Add Preprocessing

Alternative 2: 68.8% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{e^{a}}{e^{a} + e^{b}}\\ \mathbf{if}\;t\_0 \leq 0.002:\\ \;\;\;\;\frac{1}{\mathsf{fma}\left(0.5, b \cdot b, b\right)}\\ \mathbf{elif}\;t\_0 \leq 0.505506018332186:\\ \;\;\;\;\mathsf{fma}\left(b, \mathsf{fma}\left(0.020833333333333332, b \cdot b, -0.25\right), 0.5\right)\\ \mathbf{else}:\\ \;\;\;\;1\\ \end{array} \end{array} \]
(FPCore (a b)
 :precision binary64
 (let* ((t_0 (/ (exp a) (+ (exp a) (exp b)))))
   (if (<= t_0 0.002)
     (/ 1.0 (fma 0.5 (* b b) b))
     (if (<= t_0 0.505506018332186)
       (fma b (fma 0.020833333333333332 (* b b) -0.25) 0.5)
       1.0))))
double code(double a, double b) {
	double t_0 = exp(a) / (exp(a) + exp(b));
	double tmp;
	if (t_0 <= 0.002) {
		tmp = 1.0 / fma(0.5, (b * b), b);
	} else if (t_0 <= 0.505506018332186) {
		tmp = fma(b, fma(0.020833333333333332, (b * b), -0.25), 0.5);
	} else {
		tmp = 1.0;
	}
	return tmp;
}
function code(a, b)
	t_0 = Float64(exp(a) / Float64(exp(a) + exp(b)))
	tmp = 0.0
	if (t_0 <= 0.002)
		tmp = Float64(1.0 / fma(0.5, Float64(b * b), b));
	elseif (t_0 <= 0.505506018332186)
		tmp = fma(b, fma(0.020833333333333332, Float64(b * b), -0.25), 0.5);
	else
		tmp = 1.0;
	end
	return tmp
end
code[a_, b_] := Block[{t$95$0 = N[(N[Exp[a], $MachinePrecision] / N[(N[Exp[a], $MachinePrecision] + N[Exp[b], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 0.002], N[(1.0 / N[(0.5 * N[(b * b), $MachinePrecision] + b), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 0.505506018332186], N[(b * N[(0.020833333333333332 * N[(b * b), $MachinePrecision] + -0.25), $MachinePrecision] + 0.5), $MachinePrecision], 1.0]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \frac{e^{a}}{e^{a} + e^{b}}\\
\mathbf{if}\;t\_0 \leq 0.002:\\
\;\;\;\;\frac{1}{\mathsf{fma}\left(0.5, b \cdot b, b\right)}\\

\mathbf{elif}\;t\_0 \leq 0.505506018332186:\\
\;\;\;\;\mathsf{fma}\left(b, \mathsf{fma}\left(0.020833333333333332, b \cdot b, -0.25\right), 0.5\right)\\

\mathbf{else}:\\
\;\;\;\;1\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (/.f64 (exp.f64 a) (+.f64 (exp.f64 a) (exp.f64 b))) < 2e-3

    1. Initial program 100.0%

      \[\frac{e^{a}}{e^{a} + e^{b}} \]
    2. Add Preprocessing
    3. Taylor expanded in a around 0

      \[\leadsto \color{blue}{\frac{1}{1 + e^{b}}} \]
    4. Step-by-step derivation
      1. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{1}{1 + e^{b}}} \]
      2. lower-+.f64N/A

        \[\leadsto \frac{1}{\color{blue}{1 + e^{b}}} \]
      3. lower-exp.f6464.9

        \[\leadsto \frac{1}{1 + \color{blue}{e^{b}}} \]
    5. Applied rewrites64.9%

      \[\leadsto \color{blue}{\frac{1}{1 + e^{b}}} \]
    6. Taylor expanded in b around 0

      \[\leadsto \frac{1}{2 + \color{blue}{b \cdot \left(1 + \frac{1}{2} \cdot b\right)}} \]
    7. Step-by-step derivation
      1. Applied rewrites34.0%

        \[\leadsto \frac{1}{\mathsf{fma}\left(b, \color{blue}{\mathsf{fma}\left(0.5, b, 1\right)}, 2\right)} \]
      2. Taylor expanded in b around inf

        \[\leadsto \frac{1}{{b}^{2} \cdot \left(\frac{1}{2} + \color{blue}{\frac{1}{b}}\right)} \]
      3. Step-by-step derivation
        1. Applied rewrites33.7%

          \[\leadsto \frac{1}{\mathsf{fma}\left(0.5, b \cdot \color{blue}{b}, b\right)} \]

        if 2e-3 < (/.f64 (exp.f64 a) (+.f64 (exp.f64 a) (exp.f64 b))) < 0.505506018332186

        1. Initial program 99.9%

          \[\frac{e^{a}}{e^{a} + e^{b}} \]
        2. Add Preprocessing
        3. Taylor expanded in a around 0

          \[\leadsto \color{blue}{\frac{1}{1 + e^{b}}} \]
        4. Step-by-step derivation
          1. lower-/.f64N/A

            \[\leadsto \color{blue}{\frac{1}{1 + e^{b}}} \]
          2. lower-+.f64N/A

            \[\leadsto \frac{1}{\color{blue}{1 + e^{b}}} \]
          3. lower-exp.f6498.1

            \[\leadsto \frac{1}{1 + \color{blue}{e^{b}}} \]
        5. Applied rewrites98.1%

          \[\leadsto \color{blue}{\frac{1}{1 + e^{b}}} \]
        6. Taylor expanded in b around 0

          \[\leadsto \frac{1}{2} + \color{blue}{b \cdot \left(\frac{1}{48} \cdot {b}^{2} - \frac{1}{4}\right)} \]
        7. Step-by-step derivation
          1. Applied rewrites97.0%

            \[\leadsto \mathsf{fma}\left(b, \color{blue}{\mathsf{fma}\left(0.020833333333333332, b \cdot b, -0.25\right)}, 0.5\right) \]

          if 0.505506018332186 < (/.f64 (exp.f64 a) (+.f64 (exp.f64 a) (exp.f64 b)))

          1. Initial program 94.8%

            \[\frac{e^{a}}{e^{a} + e^{b}} \]
          2. Add Preprocessing
          3. Step-by-step derivation
            1. lift-/.f64N/A

              \[\leadsto \color{blue}{\frac{e^{a}}{e^{a} + e^{b}}} \]
            2. clear-numN/A

              \[\leadsto \color{blue}{\frac{1}{\frac{e^{a} + e^{b}}{e^{a}}}} \]
            3. associate-/r/N/A

              \[\leadsto \color{blue}{\frac{1}{e^{a} + e^{b}} \cdot e^{a}} \]
            4. inv-powN/A

              \[\leadsto \color{blue}{{\left(e^{a} + e^{b}\right)}^{-1}} \cdot e^{a} \]
            5. pow-to-expN/A

              \[\leadsto \color{blue}{e^{\log \left(e^{a} + e^{b}\right) \cdot -1}} \cdot e^{a} \]
            6. lift-exp.f64N/A

              \[\leadsto e^{\log \left(e^{a} + e^{b}\right) \cdot -1} \cdot \color{blue}{e^{a}} \]
            7. prod-expN/A

              \[\leadsto \color{blue}{e^{\log \left(e^{a} + e^{b}\right) \cdot -1 + a}} \]
            8. lower-exp.f64N/A

              \[\leadsto \color{blue}{e^{\log \left(e^{a} + e^{b}\right) \cdot -1 + a}} \]
            9. lower-fma.f64N/A

              \[\leadsto e^{\color{blue}{\mathsf{fma}\left(\log \left(e^{a} + e^{b}\right), -1, a\right)}} \]
            10. lower-log.f6495.0

              \[\leadsto e^{\mathsf{fma}\left(\color{blue}{\log \left(e^{a} + e^{b}\right)}, -1, a\right)} \]
          4. Applied rewrites95.0%

            \[\leadsto \color{blue}{e^{\mathsf{fma}\left(\log \left(e^{a} + e^{b}\right), -1, a\right)}} \]
          5. Step-by-step derivation
            1. lift-exp.f64N/A

              \[\leadsto \color{blue}{e^{\mathsf{fma}\left(\log \left(e^{a} + e^{b}\right), -1, a\right)}} \]
            2. lift-fma.f64N/A

              \[\leadsto e^{\color{blue}{\log \left(e^{a} + e^{b}\right) \cdot -1 + a}} \]
            3. flip-+N/A

              \[\leadsto e^{\color{blue}{\frac{\left(\log \left(e^{a} + e^{b}\right) \cdot -1\right) \cdot \left(\log \left(e^{a} + e^{b}\right) \cdot -1\right) - a \cdot a}{\log \left(e^{a} + e^{b}\right) \cdot -1 - a}}} \]
            4. div-invN/A

              \[\leadsto e^{\color{blue}{\left(\left(\log \left(e^{a} + e^{b}\right) \cdot -1\right) \cdot \left(\log \left(e^{a} + e^{b}\right) \cdot -1\right) - a \cdot a\right) \cdot \frac{1}{\log \left(e^{a} + e^{b}\right) \cdot -1 - a}}} \]
            5. exp-prodN/A

              \[\leadsto \color{blue}{{\left(e^{\left(\log \left(e^{a} + e^{b}\right) \cdot -1\right) \cdot \left(\log \left(e^{a} + e^{b}\right) \cdot -1\right) - a \cdot a}\right)}^{\left(\frac{1}{\log \left(e^{a} + e^{b}\right) \cdot -1 - a}\right)}} \]
            6. lower-pow.f64N/A

              \[\leadsto \color{blue}{{\left(e^{\left(\log \left(e^{a} + e^{b}\right) \cdot -1\right) \cdot \left(\log \left(e^{a} + e^{b}\right) \cdot -1\right) - a \cdot a}\right)}^{\left(\frac{1}{\log \left(e^{a} + e^{b}\right) \cdot -1 - a}\right)}} \]
          6. Applied rewrites100.0%

            \[\leadsto \color{blue}{{\left(e^{{\log \left(e^{a} + e^{b}\right)}^{2} - a \cdot a}\right)}^{\left(\frac{1}{\left(-\log \left(e^{a} + e^{b}\right)\right) - a}\right)}} \]
          7. Taylor expanded in a around inf

            \[\leadsto \color{blue}{1} \]
          8. Step-by-step derivation
            1. Applied rewrites100.0%

              \[\leadsto \color{blue}{1} \]
          9. Recombined 3 regimes into one program.
          10. Add Preprocessing

          Alternative 3: 68.8% accurate, 0.5× speedup?

          \[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{e^{a}}{e^{a} + e^{b}}\\ \mathbf{if}\;t\_0 \leq 0.002:\\ \;\;\;\;\frac{1}{0.5 \cdot \left(b \cdot b\right)}\\ \mathbf{elif}\;t\_0 \leq 0.505506018332186:\\ \;\;\;\;\mathsf{fma}\left(b, \mathsf{fma}\left(0.020833333333333332, b \cdot b, -0.25\right), 0.5\right)\\ \mathbf{else}:\\ \;\;\;\;1\\ \end{array} \end{array} \]
          (FPCore (a b)
           :precision binary64
           (let* ((t_0 (/ (exp a) (+ (exp a) (exp b)))))
             (if (<= t_0 0.002)
               (/ 1.0 (* 0.5 (* b b)))
               (if (<= t_0 0.505506018332186)
                 (fma b (fma 0.020833333333333332 (* b b) -0.25) 0.5)
                 1.0))))
          double code(double a, double b) {
          	double t_0 = exp(a) / (exp(a) + exp(b));
          	double tmp;
          	if (t_0 <= 0.002) {
          		tmp = 1.0 / (0.5 * (b * b));
          	} else if (t_0 <= 0.505506018332186) {
          		tmp = fma(b, fma(0.020833333333333332, (b * b), -0.25), 0.5);
          	} else {
          		tmp = 1.0;
          	}
          	return tmp;
          }
          
          function code(a, b)
          	t_0 = Float64(exp(a) / Float64(exp(a) + exp(b)))
          	tmp = 0.0
          	if (t_0 <= 0.002)
          		tmp = Float64(1.0 / Float64(0.5 * Float64(b * b)));
          	elseif (t_0 <= 0.505506018332186)
          		tmp = fma(b, fma(0.020833333333333332, Float64(b * b), -0.25), 0.5);
          	else
          		tmp = 1.0;
          	end
          	return tmp
          end
          
          code[a_, b_] := Block[{t$95$0 = N[(N[Exp[a], $MachinePrecision] / N[(N[Exp[a], $MachinePrecision] + N[Exp[b], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 0.002], N[(1.0 / N[(0.5 * N[(b * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 0.505506018332186], N[(b * N[(0.020833333333333332 * N[(b * b), $MachinePrecision] + -0.25), $MachinePrecision] + 0.5), $MachinePrecision], 1.0]]]
          
          \begin{array}{l}
          
          \\
          \begin{array}{l}
          t_0 := \frac{e^{a}}{e^{a} + e^{b}}\\
          \mathbf{if}\;t\_0 \leq 0.002:\\
          \;\;\;\;\frac{1}{0.5 \cdot \left(b \cdot b\right)}\\
          
          \mathbf{elif}\;t\_0 \leq 0.505506018332186:\\
          \;\;\;\;\mathsf{fma}\left(b, \mathsf{fma}\left(0.020833333333333332, b \cdot b, -0.25\right), 0.5\right)\\
          
          \mathbf{else}:\\
          \;\;\;\;1\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 3 regimes
          2. if (/.f64 (exp.f64 a) (+.f64 (exp.f64 a) (exp.f64 b))) < 2e-3

            1. Initial program 100.0%

              \[\frac{e^{a}}{e^{a} + e^{b}} \]
            2. Add Preprocessing
            3. Taylor expanded in a around 0

              \[\leadsto \color{blue}{\frac{1}{1 + e^{b}}} \]
            4. Step-by-step derivation
              1. lower-/.f64N/A

                \[\leadsto \color{blue}{\frac{1}{1 + e^{b}}} \]
              2. lower-+.f64N/A

                \[\leadsto \frac{1}{\color{blue}{1 + e^{b}}} \]
              3. lower-exp.f6464.9

                \[\leadsto \frac{1}{1 + \color{blue}{e^{b}}} \]
            5. Applied rewrites64.9%

              \[\leadsto \color{blue}{\frac{1}{1 + e^{b}}} \]
            6. Taylor expanded in b around 0

              \[\leadsto \frac{1}{2 + \color{blue}{b \cdot \left(1 + \frac{1}{2} \cdot b\right)}} \]
            7. Step-by-step derivation
              1. Applied rewrites34.0%

                \[\leadsto \frac{1}{\mathsf{fma}\left(b, \color{blue}{\mathsf{fma}\left(0.5, b, 1\right)}, 2\right)} \]
              2. Taylor expanded in b around inf

                \[\leadsto \frac{1}{\frac{1}{2} \cdot {b}^{\color{blue}{2}}} \]
              3. Step-by-step derivation
                1. Applied rewrites33.5%

                  \[\leadsto \frac{1}{0.5 \cdot \left(b \cdot \color{blue}{b}\right)} \]

                if 2e-3 < (/.f64 (exp.f64 a) (+.f64 (exp.f64 a) (exp.f64 b))) < 0.505506018332186

                1. Initial program 99.9%

                  \[\frac{e^{a}}{e^{a} + e^{b}} \]
                2. Add Preprocessing
                3. Taylor expanded in a around 0

                  \[\leadsto \color{blue}{\frac{1}{1 + e^{b}}} \]
                4. Step-by-step derivation
                  1. lower-/.f64N/A

                    \[\leadsto \color{blue}{\frac{1}{1 + e^{b}}} \]
                  2. lower-+.f64N/A

                    \[\leadsto \frac{1}{\color{blue}{1 + e^{b}}} \]
                  3. lower-exp.f6498.1

                    \[\leadsto \frac{1}{1 + \color{blue}{e^{b}}} \]
                5. Applied rewrites98.1%

                  \[\leadsto \color{blue}{\frac{1}{1 + e^{b}}} \]
                6. Taylor expanded in b around 0

                  \[\leadsto \frac{1}{2} + \color{blue}{b \cdot \left(\frac{1}{48} \cdot {b}^{2} - \frac{1}{4}\right)} \]
                7. Step-by-step derivation
                  1. Applied rewrites97.0%

                    \[\leadsto \mathsf{fma}\left(b, \color{blue}{\mathsf{fma}\left(0.020833333333333332, b \cdot b, -0.25\right)}, 0.5\right) \]

                  if 0.505506018332186 < (/.f64 (exp.f64 a) (+.f64 (exp.f64 a) (exp.f64 b)))

                  1. Initial program 94.8%

                    \[\frac{e^{a}}{e^{a} + e^{b}} \]
                  2. Add Preprocessing
                  3. Step-by-step derivation
                    1. lift-/.f64N/A

                      \[\leadsto \color{blue}{\frac{e^{a}}{e^{a} + e^{b}}} \]
                    2. clear-numN/A

                      \[\leadsto \color{blue}{\frac{1}{\frac{e^{a} + e^{b}}{e^{a}}}} \]
                    3. associate-/r/N/A

                      \[\leadsto \color{blue}{\frac{1}{e^{a} + e^{b}} \cdot e^{a}} \]
                    4. inv-powN/A

                      \[\leadsto \color{blue}{{\left(e^{a} + e^{b}\right)}^{-1}} \cdot e^{a} \]
                    5. pow-to-expN/A

                      \[\leadsto \color{blue}{e^{\log \left(e^{a} + e^{b}\right) \cdot -1}} \cdot e^{a} \]
                    6. lift-exp.f64N/A

                      \[\leadsto e^{\log \left(e^{a} + e^{b}\right) \cdot -1} \cdot \color{blue}{e^{a}} \]
                    7. prod-expN/A

                      \[\leadsto \color{blue}{e^{\log \left(e^{a} + e^{b}\right) \cdot -1 + a}} \]
                    8. lower-exp.f64N/A

                      \[\leadsto \color{blue}{e^{\log \left(e^{a} + e^{b}\right) \cdot -1 + a}} \]
                    9. lower-fma.f64N/A

                      \[\leadsto e^{\color{blue}{\mathsf{fma}\left(\log \left(e^{a} + e^{b}\right), -1, a\right)}} \]
                    10. lower-log.f6495.0

                      \[\leadsto e^{\mathsf{fma}\left(\color{blue}{\log \left(e^{a} + e^{b}\right)}, -1, a\right)} \]
                  4. Applied rewrites95.0%

                    \[\leadsto \color{blue}{e^{\mathsf{fma}\left(\log \left(e^{a} + e^{b}\right), -1, a\right)}} \]
                  5. Step-by-step derivation
                    1. lift-exp.f64N/A

                      \[\leadsto \color{blue}{e^{\mathsf{fma}\left(\log \left(e^{a} + e^{b}\right), -1, a\right)}} \]
                    2. lift-fma.f64N/A

                      \[\leadsto e^{\color{blue}{\log \left(e^{a} + e^{b}\right) \cdot -1 + a}} \]
                    3. flip-+N/A

                      \[\leadsto e^{\color{blue}{\frac{\left(\log \left(e^{a} + e^{b}\right) \cdot -1\right) \cdot \left(\log \left(e^{a} + e^{b}\right) \cdot -1\right) - a \cdot a}{\log \left(e^{a} + e^{b}\right) \cdot -1 - a}}} \]
                    4. div-invN/A

                      \[\leadsto e^{\color{blue}{\left(\left(\log \left(e^{a} + e^{b}\right) \cdot -1\right) \cdot \left(\log \left(e^{a} + e^{b}\right) \cdot -1\right) - a \cdot a\right) \cdot \frac{1}{\log \left(e^{a} + e^{b}\right) \cdot -1 - a}}} \]
                    5. exp-prodN/A

                      \[\leadsto \color{blue}{{\left(e^{\left(\log \left(e^{a} + e^{b}\right) \cdot -1\right) \cdot \left(\log \left(e^{a} + e^{b}\right) \cdot -1\right) - a \cdot a}\right)}^{\left(\frac{1}{\log \left(e^{a} + e^{b}\right) \cdot -1 - a}\right)}} \]
                    6. lower-pow.f64N/A

                      \[\leadsto \color{blue}{{\left(e^{\left(\log \left(e^{a} + e^{b}\right) \cdot -1\right) \cdot \left(\log \left(e^{a} + e^{b}\right) \cdot -1\right) - a \cdot a}\right)}^{\left(\frac{1}{\log \left(e^{a} + e^{b}\right) \cdot -1 - a}\right)}} \]
                  6. Applied rewrites100.0%

                    \[\leadsto \color{blue}{{\left(e^{{\log \left(e^{a} + e^{b}\right)}^{2} - a \cdot a}\right)}^{\left(\frac{1}{\left(-\log \left(e^{a} + e^{b}\right)\right) - a}\right)}} \]
                  7. Taylor expanded in a around inf

                    \[\leadsto \color{blue}{1} \]
                  8. Step-by-step derivation
                    1. Applied rewrites100.0%

                      \[\leadsto \color{blue}{1} \]
                  9. Recombined 3 regimes into one program.
                  10. Add Preprocessing

                  Alternative 4: 77.2% accurate, 0.8× speedup?

                  \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\frac{e^{a}}{e^{a} + e^{b}} \leq 0.505506018332186:\\ \;\;\;\;\frac{1}{\frac{64 - \left(b \cdot b\right) \cdot \left(\left(b \cdot b\right) \cdot \left(b \cdot b\right)\right)}{\mathsf{fma}\left(b, -16, 32\right)}}\\ \mathbf{else}:\\ \;\;\;\;1\\ \end{array} \end{array} \]
                  (FPCore (a b)
                   :precision binary64
                   (if (<= (/ (exp a) (+ (exp a) (exp b))) 0.505506018332186)
                     (/ 1.0 (/ (- 64.0 (* (* b b) (* (* b b) (* b b)))) (fma b -16.0 32.0)))
                     1.0))
                  double code(double a, double b) {
                  	double tmp;
                  	if ((exp(a) / (exp(a) + exp(b))) <= 0.505506018332186) {
                  		tmp = 1.0 / ((64.0 - ((b * b) * ((b * b) * (b * b)))) / fma(b, -16.0, 32.0));
                  	} else {
                  		tmp = 1.0;
                  	}
                  	return tmp;
                  }
                  
                  function code(a, b)
                  	tmp = 0.0
                  	if (Float64(exp(a) / Float64(exp(a) + exp(b))) <= 0.505506018332186)
                  		tmp = Float64(1.0 / Float64(Float64(64.0 - Float64(Float64(b * b) * Float64(Float64(b * b) * Float64(b * b)))) / fma(b, -16.0, 32.0)));
                  	else
                  		tmp = 1.0;
                  	end
                  	return tmp
                  end
                  
                  code[a_, b_] := If[LessEqual[N[(N[Exp[a], $MachinePrecision] / N[(N[Exp[a], $MachinePrecision] + N[Exp[b], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.505506018332186], N[(1.0 / N[(N[(64.0 - N[(N[(b * b), $MachinePrecision] * N[(N[(b * b), $MachinePrecision] * N[(b * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(b * -16.0 + 32.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1.0]
                  
                  \begin{array}{l}
                  
                  \\
                  \begin{array}{l}
                  \mathbf{if}\;\frac{e^{a}}{e^{a} + e^{b}} \leq 0.505506018332186:\\
                  \;\;\;\;\frac{1}{\frac{64 - \left(b \cdot b\right) \cdot \left(\left(b \cdot b\right) \cdot \left(b \cdot b\right)\right)}{\mathsf{fma}\left(b, -16, 32\right)}}\\
                  
                  \mathbf{else}:\\
                  \;\;\;\;1\\
                  
                  
                  \end{array}
                  \end{array}
                  
                  Derivation
                  1. Split input into 2 regimes
                  2. if (/.f64 (exp.f64 a) (+.f64 (exp.f64 a) (exp.f64 b))) < 0.505506018332186

                    1. Initial program 100.0%

                      \[\frac{e^{a}}{e^{a} + e^{b}} \]
                    2. Add Preprocessing
                    3. Taylor expanded in a around 0

                      \[\leadsto \color{blue}{\frac{1}{1 + e^{b}}} \]
                    4. Step-by-step derivation
                      1. lower-/.f64N/A

                        \[\leadsto \color{blue}{\frac{1}{1 + e^{b}}} \]
                      2. lower-+.f64N/A

                        \[\leadsto \frac{1}{\color{blue}{1 + e^{b}}} \]
                      3. lower-exp.f6478.7

                        \[\leadsto \frac{1}{1 + \color{blue}{e^{b}}} \]
                    5. Applied rewrites78.7%

                      \[\leadsto \color{blue}{\frac{1}{1 + e^{b}}} \]
                    6. Taylor expanded in b around 0

                      \[\leadsto \frac{1}{2 + \color{blue}{b}} \]
                    7. Step-by-step derivation
                      1. Applied rewrites42.6%

                        \[\leadsto \frac{1}{2 + \color{blue}{b}} \]
                      2. Step-by-step derivation
                        1. Applied rewrites42.4%

                          \[\leadsto \frac{1}{\frac{\left(64 - \left(b \cdot b\right) \cdot \left(\left(b \cdot b\right) \cdot \left(b \cdot b\right)\right)\right) \cdot 1}{\left(8 - b \cdot \left(b \cdot b\right)\right) \cdot \color{blue}{\mathsf{fma}\left(b, b - 2, 4\right)}}} \]
                        2. Taylor expanded in b around 0

                          \[\leadsto \frac{1}{\frac{\left(64 - \left(b \cdot b\right) \cdot \left(\left(b \cdot b\right) \cdot \left(b \cdot b\right)\right)\right) \cdot 1}{32 + -16 \cdot \color{blue}{b}}} \]
                        3. Step-by-step derivation
                          1. Applied rewrites71.4%

                            \[\leadsto \frac{1}{\frac{\left(64 - \left(b \cdot b\right) \cdot \left(\left(b \cdot b\right) \cdot \left(b \cdot b\right)\right)\right) \cdot 1}{\mathsf{fma}\left(b, -16, 32\right)}} \]

                          if 0.505506018332186 < (/.f64 (exp.f64 a) (+.f64 (exp.f64 a) (exp.f64 b)))

                          1. Initial program 94.8%

                            \[\frac{e^{a}}{e^{a} + e^{b}} \]
                          2. Add Preprocessing
                          3. Step-by-step derivation
                            1. lift-/.f64N/A

                              \[\leadsto \color{blue}{\frac{e^{a}}{e^{a} + e^{b}}} \]
                            2. clear-numN/A

                              \[\leadsto \color{blue}{\frac{1}{\frac{e^{a} + e^{b}}{e^{a}}}} \]
                            3. associate-/r/N/A

                              \[\leadsto \color{blue}{\frac{1}{e^{a} + e^{b}} \cdot e^{a}} \]
                            4. inv-powN/A

                              \[\leadsto \color{blue}{{\left(e^{a} + e^{b}\right)}^{-1}} \cdot e^{a} \]
                            5. pow-to-expN/A

                              \[\leadsto \color{blue}{e^{\log \left(e^{a} + e^{b}\right) \cdot -1}} \cdot e^{a} \]
                            6. lift-exp.f64N/A

                              \[\leadsto e^{\log \left(e^{a} + e^{b}\right) \cdot -1} \cdot \color{blue}{e^{a}} \]
                            7. prod-expN/A

                              \[\leadsto \color{blue}{e^{\log \left(e^{a} + e^{b}\right) \cdot -1 + a}} \]
                            8. lower-exp.f64N/A

                              \[\leadsto \color{blue}{e^{\log \left(e^{a} + e^{b}\right) \cdot -1 + a}} \]
                            9. lower-fma.f64N/A

                              \[\leadsto e^{\color{blue}{\mathsf{fma}\left(\log \left(e^{a} + e^{b}\right), -1, a\right)}} \]
                            10. lower-log.f6495.0

                              \[\leadsto e^{\mathsf{fma}\left(\color{blue}{\log \left(e^{a} + e^{b}\right)}, -1, a\right)} \]
                          4. Applied rewrites95.0%

                            \[\leadsto \color{blue}{e^{\mathsf{fma}\left(\log \left(e^{a} + e^{b}\right), -1, a\right)}} \]
                          5. Step-by-step derivation
                            1. lift-exp.f64N/A

                              \[\leadsto \color{blue}{e^{\mathsf{fma}\left(\log \left(e^{a} + e^{b}\right), -1, a\right)}} \]
                            2. lift-fma.f64N/A

                              \[\leadsto e^{\color{blue}{\log \left(e^{a} + e^{b}\right) \cdot -1 + a}} \]
                            3. flip-+N/A

                              \[\leadsto e^{\color{blue}{\frac{\left(\log \left(e^{a} + e^{b}\right) \cdot -1\right) \cdot \left(\log \left(e^{a} + e^{b}\right) \cdot -1\right) - a \cdot a}{\log \left(e^{a} + e^{b}\right) \cdot -1 - a}}} \]
                            4. div-invN/A

                              \[\leadsto e^{\color{blue}{\left(\left(\log \left(e^{a} + e^{b}\right) \cdot -1\right) \cdot \left(\log \left(e^{a} + e^{b}\right) \cdot -1\right) - a \cdot a\right) \cdot \frac{1}{\log \left(e^{a} + e^{b}\right) \cdot -1 - a}}} \]
                            5. exp-prodN/A

                              \[\leadsto \color{blue}{{\left(e^{\left(\log \left(e^{a} + e^{b}\right) \cdot -1\right) \cdot \left(\log \left(e^{a} + e^{b}\right) \cdot -1\right) - a \cdot a}\right)}^{\left(\frac{1}{\log \left(e^{a} + e^{b}\right) \cdot -1 - a}\right)}} \]
                            6. lower-pow.f64N/A

                              \[\leadsto \color{blue}{{\left(e^{\left(\log \left(e^{a} + e^{b}\right) \cdot -1\right) \cdot \left(\log \left(e^{a} + e^{b}\right) \cdot -1\right) - a \cdot a}\right)}^{\left(\frac{1}{\log \left(e^{a} + e^{b}\right) \cdot -1 - a}\right)}} \]
                          6. Applied rewrites100.0%

                            \[\leadsto \color{blue}{{\left(e^{{\log \left(e^{a} + e^{b}\right)}^{2} - a \cdot a}\right)}^{\left(\frac{1}{\left(-\log \left(e^{a} + e^{b}\right)\right) - a}\right)}} \]
                          7. Taylor expanded in a around inf

                            \[\leadsto \color{blue}{1} \]
                          8. Step-by-step derivation
                            1. Applied rewrites100.0%

                              \[\leadsto \color{blue}{1} \]
                          9. Recombined 2 regimes into one program.
                          10. Final simplification77.9%

                            \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{e^{a}}{e^{a} + e^{b}} \leq 0.505506018332186:\\ \;\;\;\;\frac{1}{\frac{64 - \left(b \cdot b\right) \cdot \left(\left(b \cdot b\right) \cdot \left(b \cdot b\right)\right)}{\mathsf{fma}\left(b, -16, 32\right)}}\\ \mathbf{else}:\\ \;\;\;\;1\\ \end{array} \]
                          11. Add Preprocessing

                          Alternative 5: 77.0% accurate, 0.8× speedup?

                          \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\frac{e^{a}}{e^{a} + e^{b}} \leq 0.505506018332186:\\ \;\;\;\;\frac{1}{\frac{64 - \left(b \cdot b\right) \cdot \left(\left(b \cdot b\right) \cdot \left(b \cdot b\right)\right)}{32}}\\ \mathbf{else}:\\ \;\;\;\;1\\ \end{array} \end{array} \]
                          (FPCore (a b)
                           :precision binary64
                           (if (<= (/ (exp a) (+ (exp a) (exp b))) 0.505506018332186)
                             (/ 1.0 (/ (- 64.0 (* (* b b) (* (* b b) (* b b)))) 32.0))
                             1.0))
                          double code(double a, double b) {
                          	double tmp;
                          	if ((exp(a) / (exp(a) + exp(b))) <= 0.505506018332186) {
                          		tmp = 1.0 / ((64.0 - ((b * b) * ((b * b) * (b * b)))) / 32.0);
                          	} else {
                          		tmp = 1.0;
                          	}
                          	return tmp;
                          }
                          
                          real(8) function code(a, b)
                              real(8), intent (in) :: a
                              real(8), intent (in) :: b
                              real(8) :: tmp
                              if ((exp(a) / (exp(a) + exp(b))) <= 0.505506018332186d0) then
                                  tmp = 1.0d0 / ((64.0d0 - ((b * b) * ((b * b) * (b * b)))) / 32.0d0)
                              else
                                  tmp = 1.0d0
                              end if
                              code = tmp
                          end function
                          
                          public static double code(double a, double b) {
                          	double tmp;
                          	if ((Math.exp(a) / (Math.exp(a) + Math.exp(b))) <= 0.505506018332186) {
                          		tmp = 1.0 / ((64.0 - ((b * b) * ((b * b) * (b * b)))) / 32.0);
                          	} else {
                          		tmp = 1.0;
                          	}
                          	return tmp;
                          }
                          
                          def code(a, b):
                          	tmp = 0
                          	if (math.exp(a) / (math.exp(a) + math.exp(b))) <= 0.505506018332186:
                          		tmp = 1.0 / ((64.0 - ((b * b) * ((b * b) * (b * b)))) / 32.0)
                          	else:
                          		tmp = 1.0
                          	return tmp
                          
                          function code(a, b)
                          	tmp = 0.0
                          	if (Float64(exp(a) / Float64(exp(a) + exp(b))) <= 0.505506018332186)
                          		tmp = Float64(1.0 / Float64(Float64(64.0 - Float64(Float64(b * b) * Float64(Float64(b * b) * Float64(b * b)))) / 32.0));
                          	else
                          		tmp = 1.0;
                          	end
                          	return tmp
                          end
                          
                          function tmp_2 = code(a, b)
                          	tmp = 0.0;
                          	if ((exp(a) / (exp(a) + exp(b))) <= 0.505506018332186)
                          		tmp = 1.0 / ((64.0 - ((b * b) * ((b * b) * (b * b)))) / 32.0);
                          	else
                          		tmp = 1.0;
                          	end
                          	tmp_2 = tmp;
                          end
                          
                          code[a_, b_] := If[LessEqual[N[(N[Exp[a], $MachinePrecision] / N[(N[Exp[a], $MachinePrecision] + N[Exp[b], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.505506018332186], N[(1.0 / N[(N[(64.0 - N[(N[(b * b), $MachinePrecision] * N[(N[(b * b), $MachinePrecision] * N[(b * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 32.0), $MachinePrecision]), $MachinePrecision], 1.0]
                          
                          \begin{array}{l}
                          
                          \\
                          \begin{array}{l}
                          \mathbf{if}\;\frac{e^{a}}{e^{a} + e^{b}} \leq 0.505506018332186:\\
                          \;\;\;\;\frac{1}{\frac{64 - \left(b \cdot b\right) \cdot \left(\left(b \cdot b\right) \cdot \left(b \cdot b\right)\right)}{32}}\\
                          
                          \mathbf{else}:\\
                          \;\;\;\;1\\
                          
                          
                          \end{array}
                          \end{array}
                          
                          Derivation
                          1. Split input into 2 regimes
                          2. if (/.f64 (exp.f64 a) (+.f64 (exp.f64 a) (exp.f64 b))) < 0.505506018332186

                            1. Initial program 100.0%

                              \[\frac{e^{a}}{e^{a} + e^{b}} \]
                            2. Add Preprocessing
                            3. Taylor expanded in a around 0

                              \[\leadsto \color{blue}{\frac{1}{1 + e^{b}}} \]
                            4. Step-by-step derivation
                              1. lower-/.f64N/A

                                \[\leadsto \color{blue}{\frac{1}{1 + e^{b}}} \]
                              2. lower-+.f64N/A

                                \[\leadsto \frac{1}{\color{blue}{1 + e^{b}}} \]
                              3. lower-exp.f6478.7

                                \[\leadsto \frac{1}{1 + \color{blue}{e^{b}}} \]
                            5. Applied rewrites78.7%

                              \[\leadsto \color{blue}{\frac{1}{1 + e^{b}}} \]
                            6. Taylor expanded in b around 0

                              \[\leadsto \frac{1}{2 + \color{blue}{b}} \]
                            7. Step-by-step derivation
                              1. Applied rewrites42.6%

                                \[\leadsto \frac{1}{2 + \color{blue}{b}} \]
                              2. Step-by-step derivation
                                1. Applied rewrites42.4%

                                  \[\leadsto \frac{1}{\frac{\left(64 - \left(b \cdot b\right) \cdot \left(\left(b \cdot b\right) \cdot \left(b \cdot b\right)\right)\right) \cdot 1}{\left(8 - b \cdot \left(b \cdot b\right)\right) \cdot \color{blue}{\mathsf{fma}\left(b, b - 2, 4\right)}}} \]
                                2. Taylor expanded in b around 0

                                  \[\leadsto \frac{1}{\frac{\left(64 - \left(b \cdot b\right) \cdot \left(\left(b \cdot b\right) \cdot \left(b \cdot b\right)\right)\right) \cdot 1}{32}} \]
                                3. Step-by-step derivation
                                  1. Applied rewrites71.0%

                                    \[\leadsto \frac{1}{\frac{\left(64 - \left(b \cdot b\right) \cdot \left(\left(b \cdot b\right) \cdot \left(b \cdot b\right)\right)\right) \cdot 1}{32}} \]

                                  if 0.505506018332186 < (/.f64 (exp.f64 a) (+.f64 (exp.f64 a) (exp.f64 b)))

                                  1. Initial program 94.8%

                                    \[\frac{e^{a}}{e^{a} + e^{b}} \]
                                  2. Add Preprocessing
                                  3. Step-by-step derivation
                                    1. lift-/.f64N/A

                                      \[\leadsto \color{blue}{\frac{e^{a}}{e^{a} + e^{b}}} \]
                                    2. clear-numN/A

                                      \[\leadsto \color{blue}{\frac{1}{\frac{e^{a} + e^{b}}{e^{a}}}} \]
                                    3. associate-/r/N/A

                                      \[\leadsto \color{blue}{\frac{1}{e^{a} + e^{b}} \cdot e^{a}} \]
                                    4. inv-powN/A

                                      \[\leadsto \color{blue}{{\left(e^{a} + e^{b}\right)}^{-1}} \cdot e^{a} \]
                                    5. pow-to-expN/A

                                      \[\leadsto \color{blue}{e^{\log \left(e^{a} + e^{b}\right) \cdot -1}} \cdot e^{a} \]
                                    6. lift-exp.f64N/A

                                      \[\leadsto e^{\log \left(e^{a} + e^{b}\right) \cdot -1} \cdot \color{blue}{e^{a}} \]
                                    7. prod-expN/A

                                      \[\leadsto \color{blue}{e^{\log \left(e^{a} + e^{b}\right) \cdot -1 + a}} \]
                                    8. lower-exp.f64N/A

                                      \[\leadsto \color{blue}{e^{\log \left(e^{a} + e^{b}\right) \cdot -1 + a}} \]
                                    9. lower-fma.f64N/A

                                      \[\leadsto e^{\color{blue}{\mathsf{fma}\left(\log \left(e^{a} + e^{b}\right), -1, a\right)}} \]
                                    10. lower-log.f6495.0

                                      \[\leadsto e^{\mathsf{fma}\left(\color{blue}{\log \left(e^{a} + e^{b}\right)}, -1, a\right)} \]
                                  4. Applied rewrites95.0%

                                    \[\leadsto \color{blue}{e^{\mathsf{fma}\left(\log \left(e^{a} + e^{b}\right), -1, a\right)}} \]
                                  5. Step-by-step derivation
                                    1. lift-exp.f64N/A

                                      \[\leadsto \color{blue}{e^{\mathsf{fma}\left(\log \left(e^{a} + e^{b}\right), -1, a\right)}} \]
                                    2. lift-fma.f64N/A

                                      \[\leadsto e^{\color{blue}{\log \left(e^{a} + e^{b}\right) \cdot -1 + a}} \]
                                    3. flip-+N/A

                                      \[\leadsto e^{\color{blue}{\frac{\left(\log \left(e^{a} + e^{b}\right) \cdot -1\right) \cdot \left(\log \left(e^{a} + e^{b}\right) \cdot -1\right) - a \cdot a}{\log \left(e^{a} + e^{b}\right) \cdot -1 - a}}} \]
                                    4. div-invN/A

                                      \[\leadsto e^{\color{blue}{\left(\left(\log \left(e^{a} + e^{b}\right) \cdot -1\right) \cdot \left(\log \left(e^{a} + e^{b}\right) \cdot -1\right) - a \cdot a\right) \cdot \frac{1}{\log \left(e^{a} + e^{b}\right) \cdot -1 - a}}} \]
                                    5. exp-prodN/A

                                      \[\leadsto \color{blue}{{\left(e^{\left(\log \left(e^{a} + e^{b}\right) \cdot -1\right) \cdot \left(\log \left(e^{a} + e^{b}\right) \cdot -1\right) - a \cdot a}\right)}^{\left(\frac{1}{\log \left(e^{a} + e^{b}\right) \cdot -1 - a}\right)}} \]
                                    6. lower-pow.f64N/A

                                      \[\leadsto \color{blue}{{\left(e^{\left(\log \left(e^{a} + e^{b}\right) \cdot -1\right) \cdot \left(\log \left(e^{a} + e^{b}\right) \cdot -1\right) - a \cdot a}\right)}^{\left(\frac{1}{\log \left(e^{a} + e^{b}\right) \cdot -1 - a}\right)}} \]
                                  6. Applied rewrites100.0%

                                    \[\leadsto \color{blue}{{\left(e^{{\log \left(e^{a} + e^{b}\right)}^{2} - a \cdot a}\right)}^{\left(\frac{1}{\left(-\log \left(e^{a} + e^{b}\right)\right) - a}\right)}} \]
                                  7. Taylor expanded in a around inf

                                    \[\leadsto \color{blue}{1} \]
                                  8. Step-by-step derivation
                                    1. Applied rewrites100.0%

                                      \[\leadsto \color{blue}{1} \]
                                  9. Recombined 2 regimes into one program.
                                  10. Final simplification77.5%

                                    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{e^{a}}{e^{a} + e^{b}} \leq 0.505506018332186:\\ \;\;\;\;\frac{1}{\frac{64 - \left(b \cdot b\right) \cdot \left(\left(b \cdot b\right) \cdot \left(b \cdot b\right)\right)}{32}}\\ \mathbf{else}:\\ \;\;\;\;1\\ \end{array} \]
                                  11. Add Preprocessing

                                  Alternative 6: 73.2% accurate, 0.9× speedup?

                                  \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\frac{e^{a}}{e^{a} + e^{b}} \leq 0.505506018332186:\\ \;\;\;\;\frac{1}{\mathsf{fma}\left(b, \mathsf{fma}\left(b, \mathsf{fma}\left(b, 0.16666666666666666, 0.5\right), 1\right), 2\right)}\\ \mathbf{else}:\\ \;\;\;\;1\\ \end{array} \end{array} \]
                                  (FPCore (a b)
                                   :precision binary64
                                   (if (<= (/ (exp a) (+ (exp a) (exp b))) 0.505506018332186)
                                     (/ 1.0 (fma b (fma b (fma b 0.16666666666666666 0.5) 1.0) 2.0))
                                     1.0))
                                  double code(double a, double b) {
                                  	double tmp;
                                  	if ((exp(a) / (exp(a) + exp(b))) <= 0.505506018332186) {
                                  		tmp = 1.0 / fma(b, fma(b, fma(b, 0.16666666666666666, 0.5), 1.0), 2.0);
                                  	} else {
                                  		tmp = 1.0;
                                  	}
                                  	return tmp;
                                  }
                                  
                                  function code(a, b)
                                  	tmp = 0.0
                                  	if (Float64(exp(a) / Float64(exp(a) + exp(b))) <= 0.505506018332186)
                                  		tmp = Float64(1.0 / fma(b, fma(b, fma(b, 0.16666666666666666, 0.5), 1.0), 2.0));
                                  	else
                                  		tmp = 1.0;
                                  	end
                                  	return tmp
                                  end
                                  
                                  code[a_, b_] := If[LessEqual[N[(N[Exp[a], $MachinePrecision] / N[(N[Exp[a], $MachinePrecision] + N[Exp[b], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.505506018332186], N[(1.0 / N[(b * N[(b * N[(b * 0.16666666666666666 + 0.5), $MachinePrecision] + 1.0), $MachinePrecision] + 2.0), $MachinePrecision]), $MachinePrecision], 1.0]
                                  
                                  \begin{array}{l}
                                  
                                  \\
                                  \begin{array}{l}
                                  \mathbf{if}\;\frac{e^{a}}{e^{a} + e^{b}} \leq 0.505506018332186:\\
                                  \;\;\;\;\frac{1}{\mathsf{fma}\left(b, \mathsf{fma}\left(b, \mathsf{fma}\left(b, 0.16666666666666666, 0.5\right), 1\right), 2\right)}\\
                                  
                                  \mathbf{else}:\\
                                  \;\;\;\;1\\
                                  
                                  
                                  \end{array}
                                  \end{array}
                                  
                                  Derivation
                                  1. Split input into 2 regimes
                                  2. if (/.f64 (exp.f64 a) (+.f64 (exp.f64 a) (exp.f64 b))) < 0.505506018332186

                                    1. Initial program 100.0%

                                      \[\frac{e^{a}}{e^{a} + e^{b}} \]
                                    2. Add Preprocessing
                                    3. Taylor expanded in a around 0

                                      \[\leadsto \color{blue}{\frac{1}{1 + e^{b}}} \]
                                    4. Step-by-step derivation
                                      1. lower-/.f64N/A

                                        \[\leadsto \color{blue}{\frac{1}{1 + e^{b}}} \]
                                      2. lower-+.f64N/A

                                        \[\leadsto \frac{1}{\color{blue}{1 + e^{b}}} \]
                                      3. lower-exp.f6478.7

                                        \[\leadsto \frac{1}{1 + \color{blue}{e^{b}}} \]
                                    5. Applied rewrites78.7%

                                      \[\leadsto \color{blue}{\frac{1}{1 + e^{b}}} \]
                                    6. Taylor expanded in b around 0

                                      \[\leadsto \frac{1}{2 + \color{blue}{b \cdot \left(1 + b \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot b\right)\right)}} \]
                                    7. Step-by-step derivation
                                      1. Applied rewrites66.2%

                                        \[\leadsto \frac{1}{\mathsf{fma}\left(b, \color{blue}{\mathsf{fma}\left(b, \mathsf{fma}\left(b, 0.16666666666666666, 0.5\right), 1\right)}, 2\right)} \]

                                      if 0.505506018332186 < (/.f64 (exp.f64 a) (+.f64 (exp.f64 a) (exp.f64 b)))

                                      1. Initial program 94.8%

                                        \[\frac{e^{a}}{e^{a} + e^{b}} \]
                                      2. Add Preprocessing
                                      3. Step-by-step derivation
                                        1. lift-/.f64N/A

                                          \[\leadsto \color{blue}{\frac{e^{a}}{e^{a} + e^{b}}} \]
                                        2. clear-numN/A

                                          \[\leadsto \color{blue}{\frac{1}{\frac{e^{a} + e^{b}}{e^{a}}}} \]
                                        3. associate-/r/N/A

                                          \[\leadsto \color{blue}{\frac{1}{e^{a} + e^{b}} \cdot e^{a}} \]
                                        4. inv-powN/A

                                          \[\leadsto \color{blue}{{\left(e^{a} + e^{b}\right)}^{-1}} \cdot e^{a} \]
                                        5. pow-to-expN/A

                                          \[\leadsto \color{blue}{e^{\log \left(e^{a} + e^{b}\right) \cdot -1}} \cdot e^{a} \]
                                        6. lift-exp.f64N/A

                                          \[\leadsto e^{\log \left(e^{a} + e^{b}\right) \cdot -1} \cdot \color{blue}{e^{a}} \]
                                        7. prod-expN/A

                                          \[\leadsto \color{blue}{e^{\log \left(e^{a} + e^{b}\right) \cdot -1 + a}} \]
                                        8. lower-exp.f64N/A

                                          \[\leadsto \color{blue}{e^{\log \left(e^{a} + e^{b}\right) \cdot -1 + a}} \]
                                        9. lower-fma.f64N/A

                                          \[\leadsto e^{\color{blue}{\mathsf{fma}\left(\log \left(e^{a} + e^{b}\right), -1, a\right)}} \]
                                        10. lower-log.f6495.0

                                          \[\leadsto e^{\mathsf{fma}\left(\color{blue}{\log \left(e^{a} + e^{b}\right)}, -1, a\right)} \]
                                      4. Applied rewrites95.0%

                                        \[\leadsto \color{blue}{e^{\mathsf{fma}\left(\log \left(e^{a} + e^{b}\right), -1, a\right)}} \]
                                      5. Step-by-step derivation
                                        1. lift-exp.f64N/A

                                          \[\leadsto \color{blue}{e^{\mathsf{fma}\left(\log \left(e^{a} + e^{b}\right), -1, a\right)}} \]
                                        2. lift-fma.f64N/A

                                          \[\leadsto e^{\color{blue}{\log \left(e^{a} + e^{b}\right) \cdot -1 + a}} \]
                                        3. flip-+N/A

                                          \[\leadsto e^{\color{blue}{\frac{\left(\log \left(e^{a} + e^{b}\right) \cdot -1\right) \cdot \left(\log \left(e^{a} + e^{b}\right) \cdot -1\right) - a \cdot a}{\log \left(e^{a} + e^{b}\right) \cdot -1 - a}}} \]
                                        4. div-invN/A

                                          \[\leadsto e^{\color{blue}{\left(\left(\log \left(e^{a} + e^{b}\right) \cdot -1\right) \cdot \left(\log \left(e^{a} + e^{b}\right) \cdot -1\right) - a \cdot a\right) \cdot \frac{1}{\log \left(e^{a} + e^{b}\right) \cdot -1 - a}}} \]
                                        5. exp-prodN/A

                                          \[\leadsto \color{blue}{{\left(e^{\left(\log \left(e^{a} + e^{b}\right) \cdot -1\right) \cdot \left(\log \left(e^{a} + e^{b}\right) \cdot -1\right) - a \cdot a}\right)}^{\left(\frac{1}{\log \left(e^{a} + e^{b}\right) \cdot -1 - a}\right)}} \]
                                        6. lower-pow.f64N/A

                                          \[\leadsto \color{blue}{{\left(e^{\left(\log \left(e^{a} + e^{b}\right) \cdot -1\right) \cdot \left(\log \left(e^{a} + e^{b}\right) \cdot -1\right) - a \cdot a}\right)}^{\left(\frac{1}{\log \left(e^{a} + e^{b}\right) \cdot -1 - a}\right)}} \]
                                      6. Applied rewrites100.0%

                                        \[\leadsto \color{blue}{{\left(e^{{\log \left(e^{a} + e^{b}\right)}^{2} - a \cdot a}\right)}^{\left(\frac{1}{\left(-\log \left(e^{a} + e^{b}\right)\right) - a}\right)}} \]
                                      7. Taylor expanded in a around inf

                                        \[\leadsto \color{blue}{1} \]
                                      8. Step-by-step derivation
                                        1. Applied rewrites100.0%

                                          \[\leadsto \color{blue}{1} \]
                                      9. Recombined 2 regimes into one program.
                                      10. Add Preprocessing

                                      Alternative 7: 68.9% accurate, 0.9× speedup?

                                      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\frac{e^{a}}{e^{a} + e^{b}} \leq 0.505506018332186:\\ \;\;\;\;\frac{1}{\mathsf{fma}\left(b, \mathsf{fma}\left(0.5, b, 1\right), 2\right)}\\ \mathbf{else}:\\ \;\;\;\;1\\ \end{array} \end{array} \]
                                      (FPCore (a b)
                                       :precision binary64
                                       (if (<= (/ (exp a) (+ (exp a) (exp b))) 0.505506018332186)
                                         (/ 1.0 (fma b (fma 0.5 b 1.0) 2.0))
                                         1.0))
                                      double code(double a, double b) {
                                      	double tmp;
                                      	if ((exp(a) / (exp(a) + exp(b))) <= 0.505506018332186) {
                                      		tmp = 1.0 / fma(b, fma(0.5, b, 1.0), 2.0);
                                      	} else {
                                      		tmp = 1.0;
                                      	}
                                      	return tmp;
                                      }
                                      
                                      function code(a, b)
                                      	tmp = 0.0
                                      	if (Float64(exp(a) / Float64(exp(a) + exp(b))) <= 0.505506018332186)
                                      		tmp = Float64(1.0 / fma(b, fma(0.5, b, 1.0), 2.0));
                                      	else
                                      		tmp = 1.0;
                                      	end
                                      	return tmp
                                      end
                                      
                                      code[a_, b_] := If[LessEqual[N[(N[Exp[a], $MachinePrecision] / N[(N[Exp[a], $MachinePrecision] + N[Exp[b], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.505506018332186], N[(1.0 / N[(b * N[(0.5 * b + 1.0), $MachinePrecision] + 2.0), $MachinePrecision]), $MachinePrecision], 1.0]
                                      
                                      \begin{array}{l}
                                      
                                      \\
                                      \begin{array}{l}
                                      \mathbf{if}\;\frac{e^{a}}{e^{a} + e^{b}} \leq 0.505506018332186:\\
                                      \;\;\;\;\frac{1}{\mathsf{fma}\left(b, \mathsf{fma}\left(0.5, b, 1\right), 2\right)}\\
                                      
                                      \mathbf{else}:\\
                                      \;\;\;\;1\\
                                      
                                      
                                      \end{array}
                                      \end{array}
                                      
                                      Derivation
                                      1. Split input into 2 regimes
                                      2. if (/.f64 (exp.f64 a) (+.f64 (exp.f64 a) (exp.f64 b))) < 0.505506018332186

                                        1. Initial program 100.0%

                                          \[\frac{e^{a}}{e^{a} + e^{b}} \]
                                        2. Add Preprocessing
                                        3. Taylor expanded in a around 0

                                          \[\leadsto \color{blue}{\frac{1}{1 + e^{b}}} \]
                                        4. Step-by-step derivation
                                          1. lower-/.f64N/A

                                            \[\leadsto \color{blue}{\frac{1}{1 + e^{b}}} \]
                                          2. lower-+.f64N/A

                                            \[\leadsto \frac{1}{\color{blue}{1 + e^{b}}} \]
                                          3. lower-exp.f6478.7

                                            \[\leadsto \frac{1}{1 + \color{blue}{e^{b}}} \]
                                        5. Applied rewrites78.7%

                                          \[\leadsto \color{blue}{\frac{1}{1 + e^{b}}} \]
                                        6. Taylor expanded in b around 0

                                          \[\leadsto \frac{1}{2 + \color{blue}{b \cdot \left(1 + \frac{1}{2} \cdot b\right)}} \]
                                        7. Step-by-step derivation
                                          1. Applied rewrites59.9%

                                            \[\leadsto \frac{1}{\mathsf{fma}\left(b, \color{blue}{\mathsf{fma}\left(0.5, b, 1\right)}, 2\right)} \]

                                          if 0.505506018332186 < (/.f64 (exp.f64 a) (+.f64 (exp.f64 a) (exp.f64 b)))

                                          1. Initial program 94.8%

                                            \[\frac{e^{a}}{e^{a} + e^{b}} \]
                                          2. Add Preprocessing
                                          3. Step-by-step derivation
                                            1. lift-/.f64N/A

                                              \[\leadsto \color{blue}{\frac{e^{a}}{e^{a} + e^{b}}} \]
                                            2. clear-numN/A

                                              \[\leadsto \color{blue}{\frac{1}{\frac{e^{a} + e^{b}}{e^{a}}}} \]
                                            3. associate-/r/N/A

                                              \[\leadsto \color{blue}{\frac{1}{e^{a} + e^{b}} \cdot e^{a}} \]
                                            4. inv-powN/A

                                              \[\leadsto \color{blue}{{\left(e^{a} + e^{b}\right)}^{-1}} \cdot e^{a} \]
                                            5. pow-to-expN/A

                                              \[\leadsto \color{blue}{e^{\log \left(e^{a} + e^{b}\right) \cdot -1}} \cdot e^{a} \]
                                            6. lift-exp.f64N/A

                                              \[\leadsto e^{\log \left(e^{a} + e^{b}\right) \cdot -1} \cdot \color{blue}{e^{a}} \]
                                            7. prod-expN/A

                                              \[\leadsto \color{blue}{e^{\log \left(e^{a} + e^{b}\right) \cdot -1 + a}} \]
                                            8. lower-exp.f64N/A

                                              \[\leadsto \color{blue}{e^{\log \left(e^{a} + e^{b}\right) \cdot -1 + a}} \]
                                            9. lower-fma.f64N/A

                                              \[\leadsto e^{\color{blue}{\mathsf{fma}\left(\log \left(e^{a} + e^{b}\right), -1, a\right)}} \]
                                            10. lower-log.f6495.0

                                              \[\leadsto e^{\mathsf{fma}\left(\color{blue}{\log \left(e^{a} + e^{b}\right)}, -1, a\right)} \]
                                          4. Applied rewrites95.0%

                                            \[\leadsto \color{blue}{e^{\mathsf{fma}\left(\log \left(e^{a} + e^{b}\right), -1, a\right)}} \]
                                          5. Step-by-step derivation
                                            1. lift-exp.f64N/A

                                              \[\leadsto \color{blue}{e^{\mathsf{fma}\left(\log \left(e^{a} + e^{b}\right), -1, a\right)}} \]
                                            2. lift-fma.f64N/A

                                              \[\leadsto e^{\color{blue}{\log \left(e^{a} + e^{b}\right) \cdot -1 + a}} \]
                                            3. flip-+N/A

                                              \[\leadsto e^{\color{blue}{\frac{\left(\log \left(e^{a} + e^{b}\right) \cdot -1\right) \cdot \left(\log \left(e^{a} + e^{b}\right) \cdot -1\right) - a \cdot a}{\log \left(e^{a} + e^{b}\right) \cdot -1 - a}}} \]
                                            4. div-invN/A

                                              \[\leadsto e^{\color{blue}{\left(\left(\log \left(e^{a} + e^{b}\right) \cdot -1\right) \cdot \left(\log \left(e^{a} + e^{b}\right) \cdot -1\right) - a \cdot a\right) \cdot \frac{1}{\log \left(e^{a} + e^{b}\right) \cdot -1 - a}}} \]
                                            5. exp-prodN/A

                                              \[\leadsto \color{blue}{{\left(e^{\left(\log \left(e^{a} + e^{b}\right) \cdot -1\right) \cdot \left(\log \left(e^{a} + e^{b}\right) \cdot -1\right) - a \cdot a}\right)}^{\left(\frac{1}{\log \left(e^{a} + e^{b}\right) \cdot -1 - a}\right)}} \]
                                            6. lower-pow.f64N/A

                                              \[\leadsto \color{blue}{{\left(e^{\left(\log \left(e^{a} + e^{b}\right) \cdot -1\right) \cdot \left(\log \left(e^{a} + e^{b}\right) \cdot -1\right) - a \cdot a}\right)}^{\left(\frac{1}{\log \left(e^{a} + e^{b}\right) \cdot -1 - a}\right)}} \]
                                          6. Applied rewrites100.0%

                                            \[\leadsto \color{blue}{{\left(e^{{\log \left(e^{a} + e^{b}\right)}^{2} - a \cdot a}\right)}^{\left(\frac{1}{\left(-\log \left(e^{a} + e^{b}\right)\right) - a}\right)}} \]
                                          7. Taylor expanded in a around inf

                                            \[\leadsto \color{blue}{1} \]
                                          8. Step-by-step derivation
                                            1. Applied rewrites100.0%

                                              \[\leadsto \color{blue}{1} \]
                                          9. Recombined 2 regimes into one program.
                                          10. Add Preprocessing

                                          Alternative 8: 68.5% accurate, 0.9× speedup?

                                          \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\frac{e^{a}}{e^{a} + e^{b}} \leq 0.505506018332186:\\ \;\;\;\;\frac{1}{\mathsf{fma}\left(b, b \cdot 0.5, 2\right)}\\ \mathbf{else}:\\ \;\;\;\;1\\ \end{array} \end{array} \]
                                          (FPCore (a b)
                                           :precision binary64
                                           (if (<= (/ (exp a) (+ (exp a) (exp b))) 0.505506018332186)
                                             (/ 1.0 (fma b (* b 0.5) 2.0))
                                             1.0))
                                          double code(double a, double b) {
                                          	double tmp;
                                          	if ((exp(a) / (exp(a) + exp(b))) <= 0.505506018332186) {
                                          		tmp = 1.0 / fma(b, (b * 0.5), 2.0);
                                          	} else {
                                          		tmp = 1.0;
                                          	}
                                          	return tmp;
                                          }
                                          
                                          function code(a, b)
                                          	tmp = 0.0
                                          	if (Float64(exp(a) / Float64(exp(a) + exp(b))) <= 0.505506018332186)
                                          		tmp = Float64(1.0 / fma(b, Float64(b * 0.5), 2.0));
                                          	else
                                          		tmp = 1.0;
                                          	end
                                          	return tmp
                                          end
                                          
                                          code[a_, b_] := If[LessEqual[N[(N[Exp[a], $MachinePrecision] / N[(N[Exp[a], $MachinePrecision] + N[Exp[b], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.505506018332186], N[(1.0 / N[(b * N[(b * 0.5), $MachinePrecision] + 2.0), $MachinePrecision]), $MachinePrecision], 1.0]
                                          
                                          \begin{array}{l}
                                          
                                          \\
                                          \begin{array}{l}
                                          \mathbf{if}\;\frac{e^{a}}{e^{a} + e^{b}} \leq 0.505506018332186:\\
                                          \;\;\;\;\frac{1}{\mathsf{fma}\left(b, b \cdot 0.5, 2\right)}\\
                                          
                                          \mathbf{else}:\\
                                          \;\;\;\;1\\
                                          
                                          
                                          \end{array}
                                          \end{array}
                                          
                                          Derivation
                                          1. Split input into 2 regimes
                                          2. if (/.f64 (exp.f64 a) (+.f64 (exp.f64 a) (exp.f64 b))) < 0.505506018332186

                                            1. Initial program 100.0%

                                              \[\frac{e^{a}}{e^{a} + e^{b}} \]
                                            2. Add Preprocessing
                                            3. Taylor expanded in a around 0

                                              \[\leadsto \color{blue}{\frac{1}{1 + e^{b}}} \]
                                            4. Step-by-step derivation
                                              1. lower-/.f64N/A

                                                \[\leadsto \color{blue}{\frac{1}{1 + e^{b}}} \]
                                              2. lower-+.f64N/A

                                                \[\leadsto \frac{1}{\color{blue}{1 + e^{b}}} \]
                                              3. lower-exp.f6478.7

                                                \[\leadsto \frac{1}{1 + \color{blue}{e^{b}}} \]
                                            5. Applied rewrites78.7%

                                              \[\leadsto \color{blue}{\frac{1}{1 + e^{b}}} \]
                                            6. Taylor expanded in b around 0

                                              \[\leadsto \frac{1}{2 + \color{blue}{b \cdot \left(1 + \frac{1}{2} \cdot b\right)}} \]
                                            7. Step-by-step derivation
                                              1. Applied rewrites59.9%

                                                \[\leadsto \frac{1}{\mathsf{fma}\left(b, \color{blue}{\mathsf{fma}\left(0.5, b, 1\right)}, 2\right)} \]
                                              2. Taylor expanded in b around inf

                                                \[\leadsto \frac{1}{\mathsf{fma}\left(b, \frac{1}{2} \cdot b, 2\right)} \]
                                              3. Step-by-step derivation
                                                1. Applied rewrites59.5%

                                                  \[\leadsto \frac{1}{\mathsf{fma}\left(b, 0.5 \cdot b, 2\right)} \]

                                                if 0.505506018332186 < (/.f64 (exp.f64 a) (+.f64 (exp.f64 a) (exp.f64 b)))

                                                1. Initial program 94.8%

                                                  \[\frac{e^{a}}{e^{a} + e^{b}} \]
                                                2. Add Preprocessing
                                                3. Step-by-step derivation
                                                  1. lift-/.f64N/A

                                                    \[\leadsto \color{blue}{\frac{e^{a}}{e^{a} + e^{b}}} \]
                                                  2. clear-numN/A

                                                    \[\leadsto \color{blue}{\frac{1}{\frac{e^{a} + e^{b}}{e^{a}}}} \]
                                                  3. associate-/r/N/A

                                                    \[\leadsto \color{blue}{\frac{1}{e^{a} + e^{b}} \cdot e^{a}} \]
                                                  4. inv-powN/A

                                                    \[\leadsto \color{blue}{{\left(e^{a} + e^{b}\right)}^{-1}} \cdot e^{a} \]
                                                  5. pow-to-expN/A

                                                    \[\leadsto \color{blue}{e^{\log \left(e^{a} + e^{b}\right) \cdot -1}} \cdot e^{a} \]
                                                  6. lift-exp.f64N/A

                                                    \[\leadsto e^{\log \left(e^{a} + e^{b}\right) \cdot -1} \cdot \color{blue}{e^{a}} \]
                                                  7. prod-expN/A

                                                    \[\leadsto \color{blue}{e^{\log \left(e^{a} + e^{b}\right) \cdot -1 + a}} \]
                                                  8. lower-exp.f64N/A

                                                    \[\leadsto \color{blue}{e^{\log \left(e^{a} + e^{b}\right) \cdot -1 + a}} \]
                                                  9. lower-fma.f64N/A

                                                    \[\leadsto e^{\color{blue}{\mathsf{fma}\left(\log \left(e^{a} + e^{b}\right), -1, a\right)}} \]
                                                  10. lower-log.f6495.0

                                                    \[\leadsto e^{\mathsf{fma}\left(\color{blue}{\log \left(e^{a} + e^{b}\right)}, -1, a\right)} \]
                                                4. Applied rewrites95.0%

                                                  \[\leadsto \color{blue}{e^{\mathsf{fma}\left(\log \left(e^{a} + e^{b}\right), -1, a\right)}} \]
                                                5. Step-by-step derivation
                                                  1. lift-exp.f64N/A

                                                    \[\leadsto \color{blue}{e^{\mathsf{fma}\left(\log \left(e^{a} + e^{b}\right), -1, a\right)}} \]
                                                  2. lift-fma.f64N/A

                                                    \[\leadsto e^{\color{blue}{\log \left(e^{a} + e^{b}\right) \cdot -1 + a}} \]
                                                  3. flip-+N/A

                                                    \[\leadsto e^{\color{blue}{\frac{\left(\log \left(e^{a} + e^{b}\right) \cdot -1\right) \cdot \left(\log \left(e^{a} + e^{b}\right) \cdot -1\right) - a \cdot a}{\log \left(e^{a} + e^{b}\right) \cdot -1 - a}}} \]
                                                  4. div-invN/A

                                                    \[\leadsto e^{\color{blue}{\left(\left(\log \left(e^{a} + e^{b}\right) \cdot -1\right) \cdot \left(\log \left(e^{a} + e^{b}\right) \cdot -1\right) - a \cdot a\right) \cdot \frac{1}{\log \left(e^{a} + e^{b}\right) \cdot -1 - a}}} \]
                                                  5. exp-prodN/A

                                                    \[\leadsto \color{blue}{{\left(e^{\left(\log \left(e^{a} + e^{b}\right) \cdot -1\right) \cdot \left(\log \left(e^{a} + e^{b}\right) \cdot -1\right) - a \cdot a}\right)}^{\left(\frac{1}{\log \left(e^{a} + e^{b}\right) \cdot -1 - a}\right)}} \]
                                                  6. lower-pow.f64N/A

                                                    \[\leadsto \color{blue}{{\left(e^{\left(\log \left(e^{a} + e^{b}\right) \cdot -1\right) \cdot \left(\log \left(e^{a} + e^{b}\right) \cdot -1\right) - a \cdot a}\right)}^{\left(\frac{1}{\log \left(e^{a} + e^{b}\right) \cdot -1 - a}\right)}} \]
                                                6. Applied rewrites100.0%

                                                  \[\leadsto \color{blue}{{\left(e^{{\log \left(e^{a} + e^{b}\right)}^{2} - a \cdot a}\right)}^{\left(\frac{1}{\left(-\log \left(e^{a} + e^{b}\right)\right) - a}\right)}} \]
                                                7. Taylor expanded in a around inf

                                                  \[\leadsto \color{blue}{1} \]
                                                8. Step-by-step derivation
                                                  1. Applied rewrites100.0%

                                                    \[\leadsto \color{blue}{1} \]
                                                9. Recombined 2 regimes into one program.
                                                10. Final simplification68.7%

                                                  \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{e^{a}}{e^{a} + e^{b}} \leq 0.505506018332186:\\ \;\;\;\;\frac{1}{\mathsf{fma}\left(b, b \cdot 0.5, 2\right)}\\ \mathbf{else}:\\ \;\;\;\;1\\ \end{array} \]
                                                11. Add Preprocessing

                                                Alternative 9: 56.1% accurate, 0.9× speedup?

                                                \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\frac{e^{a}}{e^{a} + e^{b}} \leq 0.505506018332186:\\ \;\;\;\;\frac{1}{b + 2}\\ \mathbf{else}:\\ \;\;\;\;1\\ \end{array} \end{array} \]
                                                (FPCore (a b)
                                                 :precision binary64
                                                 (if (<= (/ (exp a) (+ (exp a) (exp b))) 0.505506018332186)
                                                   (/ 1.0 (+ b 2.0))
                                                   1.0))
                                                double code(double a, double b) {
                                                	double tmp;
                                                	if ((exp(a) / (exp(a) + exp(b))) <= 0.505506018332186) {
                                                		tmp = 1.0 / (b + 2.0);
                                                	} else {
                                                		tmp = 1.0;
                                                	}
                                                	return tmp;
                                                }
                                                
                                                real(8) function code(a, b)
                                                    real(8), intent (in) :: a
                                                    real(8), intent (in) :: b
                                                    real(8) :: tmp
                                                    if ((exp(a) / (exp(a) + exp(b))) <= 0.505506018332186d0) then
                                                        tmp = 1.0d0 / (b + 2.0d0)
                                                    else
                                                        tmp = 1.0d0
                                                    end if
                                                    code = tmp
                                                end function
                                                
                                                public static double code(double a, double b) {
                                                	double tmp;
                                                	if ((Math.exp(a) / (Math.exp(a) + Math.exp(b))) <= 0.505506018332186) {
                                                		tmp = 1.0 / (b + 2.0);
                                                	} else {
                                                		tmp = 1.0;
                                                	}
                                                	return tmp;
                                                }
                                                
                                                def code(a, b):
                                                	tmp = 0
                                                	if (math.exp(a) / (math.exp(a) + math.exp(b))) <= 0.505506018332186:
                                                		tmp = 1.0 / (b + 2.0)
                                                	else:
                                                		tmp = 1.0
                                                	return tmp
                                                
                                                function code(a, b)
                                                	tmp = 0.0
                                                	if (Float64(exp(a) / Float64(exp(a) + exp(b))) <= 0.505506018332186)
                                                		tmp = Float64(1.0 / Float64(b + 2.0));
                                                	else
                                                		tmp = 1.0;
                                                	end
                                                	return tmp
                                                end
                                                
                                                function tmp_2 = code(a, b)
                                                	tmp = 0.0;
                                                	if ((exp(a) / (exp(a) + exp(b))) <= 0.505506018332186)
                                                		tmp = 1.0 / (b + 2.0);
                                                	else
                                                		tmp = 1.0;
                                                	end
                                                	tmp_2 = tmp;
                                                end
                                                
                                                code[a_, b_] := If[LessEqual[N[(N[Exp[a], $MachinePrecision] / N[(N[Exp[a], $MachinePrecision] + N[Exp[b], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.505506018332186], N[(1.0 / N[(b + 2.0), $MachinePrecision]), $MachinePrecision], 1.0]
                                                
                                                \begin{array}{l}
                                                
                                                \\
                                                \begin{array}{l}
                                                \mathbf{if}\;\frac{e^{a}}{e^{a} + e^{b}} \leq 0.505506018332186:\\
                                                \;\;\;\;\frac{1}{b + 2}\\
                                                
                                                \mathbf{else}:\\
                                                \;\;\;\;1\\
                                                
                                                
                                                \end{array}
                                                \end{array}
                                                
                                                Derivation
                                                1. Split input into 2 regimes
                                                2. if (/.f64 (exp.f64 a) (+.f64 (exp.f64 a) (exp.f64 b))) < 0.505506018332186

                                                  1. Initial program 100.0%

                                                    \[\frac{e^{a}}{e^{a} + e^{b}} \]
                                                  2. Add Preprocessing
                                                  3. Taylor expanded in a around 0

                                                    \[\leadsto \color{blue}{\frac{1}{1 + e^{b}}} \]
                                                  4. Step-by-step derivation
                                                    1. lower-/.f64N/A

                                                      \[\leadsto \color{blue}{\frac{1}{1 + e^{b}}} \]
                                                    2. lower-+.f64N/A

                                                      \[\leadsto \frac{1}{\color{blue}{1 + e^{b}}} \]
                                                    3. lower-exp.f6478.7

                                                      \[\leadsto \frac{1}{1 + \color{blue}{e^{b}}} \]
                                                  5. Applied rewrites78.7%

                                                    \[\leadsto \color{blue}{\frac{1}{1 + e^{b}}} \]
                                                  6. Taylor expanded in b around 0

                                                    \[\leadsto \frac{1}{2 + \color{blue}{b}} \]
                                                  7. Step-by-step derivation
                                                    1. Applied rewrites42.6%

                                                      \[\leadsto \frac{1}{2 + \color{blue}{b}} \]

                                                    if 0.505506018332186 < (/.f64 (exp.f64 a) (+.f64 (exp.f64 a) (exp.f64 b)))

                                                    1. Initial program 94.8%

                                                      \[\frac{e^{a}}{e^{a} + e^{b}} \]
                                                    2. Add Preprocessing
                                                    3. Step-by-step derivation
                                                      1. lift-/.f64N/A

                                                        \[\leadsto \color{blue}{\frac{e^{a}}{e^{a} + e^{b}}} \]
                                                      2. clear-numN/A

                                                        \[\leadsto \color{blue}{\frac{1}{\frac{e^{a} + e^{b}}{e^{a}}}} \]
                                                      3. associate-/r/N/A

                                                        \[\leadsto \color{blue}{\frac{1}{e^{a} + e^{b}} \cdot e^{a}} \]
                                                      4. inv-powN/A

                                                        \[\leadsto \color{blue}{{\left(e^{a} + e^{b}\right)}^{-1}} \cdot e^{a} \]
                                                      5. pow-to-expN/A

                                                        \[\leadsto \color{blue}{e^{\log \left(e^{a} + e^{b}\right) \cdot -1}} \cdot e^{a} \]
                                                      6. lift-exp.f64N/A

                                                        \[\leadsto e^{\log \left(e^{a} + e^{b}\right) \cdot -1} \cdot \color{blue}{e^{a}} \]
                                                      7. prod-expN/A

                                                        \[\leadsto \color{blue}{e^{\log \left(e^{a} + e^{b}\right) \cdot -1 + a}} \]
                                                      8. lower-exp.f64N/A

                                                        \[\leadsto \color{blue}{e^{\log \left(e^{a} + e^{b}\right) \cdot -1 + a}} \]
                                                      9. lower-fma.f64N/A

                                                        \[\leadsto e^{\color{blue}{\mathsf{fma}\left(\log \left(e^{a} + e^{b}\right), -1, a\right)}} \]
                                                      10. lower-log.f6495.0

                                                        \[\leadsto e^{\mathsf{fma}\left(\color{blue}{\log \left(e^{a} + e^{b}\right)}, -1, a\right)} \]
                                                    4. Applied rewrites95.0%

                                                      \[\leadsto \color{blue}{e^{\mathsf{fma}\left(\log \left(e^{a} + e^{b}\right), -1, a\right)}} \]
                                                    5. Step-by-step derivation
                                                      1. lift-exp.f64N/A

                                                        \[\leadsto \color{blue}{e^{\mathsf{fma}\left(\log \left(e^{a} + e^{b}\right), -1, a\right)}} \]
                                                      2. lift-fma.f64N/A

                                                        \[\leadsto e^{\color{blue}{\log \left(e^{a} + e^{b}\right) \cdot -1 + a}} \]
                                                      3. flip-+N/A

                                                        \[\leadsto e^{\color{blue}{\frac{\left(\log \left(e^{a} + e^{b}\right) \cdot -1\right) \cdot \left(\log \left(e^{a} + e^{b}\right) \cdot -1\right) - a \cdot a}{\log \left(e^{a} + e^{b}\right) \cdot -1 - a}}} \]
                                                      4. div-invN/A

                                                        \[\leadsto e^{\color{blue}{\left(\left(\log \left(e^{a} + e^{b}\right) \cdot -1\right) \cdot \left(\log \left(e^{a} + e^{b}\right) \cdot -1\right) - a \cdot a\right) \cdot \frac{1}{\log \left(e^{a} + e^{b}\right) \cdot -1 - a}}} \]
                                                      5. exp-prodN/A

                                                        \[\leadsto \color{blue}{{\left(e^{\left(\log \left(e^{a} + e^{b}\right) \cdot -1\right) \cdot \left(\log \left(e^{a} + e^{b}\right) \cdot -1\right) - a \cdot a}\right)}^{\left(\frac{1}{\log \left(e^{a} + e^{b}\right) \cdot -1 - a}\right)}} \]
                                                      6. lower-pow.f64N/A

                                                        \[\leadsto \color{blue}{{\left(e^{\left(\log \left(e^{a} + e^{b}\right) \cdot -1\right) \cdot \left(\log \left(e^{a} + e^{b}\right) \cdot -1\right) - a \cdot a}\right)}^{\left(\frac{1}{\log \left(e^{a} + e^{b}\right) \cdot -1 - a}\right)}} \]
                                                    6. Applied rewrites100.0%

                                                      \[\leadsto \color{blue}{{\left(e^{{\log \left(e^{a} + e^{b}\right)}^{2} - a \cdot a}\right)}^{\left(\frac{1}{\left(-\log \left(e^{a} + e^{b}\right)\right) - a}\right)}} \]
                                                    7. Taylor expanded in a around inf

                                                      \[\leadsto \color{blue}{1} \]
                                                    8. Step-by-step derivation
                                                      1. Applied rewrites100.0%

                                                        \[\leadsto \color{blue}{1} \]
                                                    9. Recombined 2 regimes into one program.
                                                    10. Final simplification55.6%

                                                      \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{e^{a}}{e^{a} + e^{b}} \leq 0.505506018332186:\\ \;\;\;\;\frac{1}{b + 2}\\ \mathbf{else}:\\ \;\;\;\;1\\ \end{array} \]
                                                    11. Add Preprocessing

                                                    Alternative 10: 55.3% accurate, 1.0× speedup?

                                                    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\frac{e^{a}}{e^{a} + e^{b}} \leq 0.505506018332186:\\ \;\;\;\;\mathsf{fma}\left(b, -0.25, 0.5\right)\\ \mathbf{else}:\\ \;\;\;\;1\\ \end{array} \end{array} \]
                                                    (FPCore (a b)
                                                     :precision binary64
                                                     (if (<= (/ (exp a) (+ (exp a) (exp b))) 0.505506018332186)
                                                       (fma b -0.25 0.5)
                                                       1.0))
                                                    double code(double a, double b) {
                                                    	double tmp;
                                                    	if ((exp(a) / (exp(a) + exp(b))) <= 0.505506018332186) {
                                                    		tmp = fma(b, -0.25, 0.5);
                                                    	} else {
                                                    		tmp = 1.0;
                                                    	}
                                                    	return tmp;
                                                    }
                                                    
                                                    function code(a, b)
                                                    	tmp = 0.0
                                                    	if (Float64(exp(a) / Float64(exp(a) + exp(b))) <= 0.505506018332186)
                                                    		tmp = fma(b, -0.25, 0.5);
                                                    	else
                                                    		tmp = 1.0;
                                                    	end
                                                    	return tmp
                                                    end
                                                    
                                                    code[a_, b_] := If[LessEqual[N[(N[Exp[a], $MachinePrecision] / N[(N[Exp[a], $MachinePrecision] + N[Exp[b], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.505506018332186], N[(b * -0.25 + 0.5), $MachinePrecision], 1.0]
                                                    
                                                    \begin{array}{l}
                                                    
                                                    \\
                                                    \begin{array}{l}
                                                    \mathbf{if}\;\frac{e^{a}}{e^{a} + e^{b}} \leq 0.505506018332186:\\
                                                    \;\;\;\;\mathsf{fma}\left(b, -0.25, 0.5\right)\\
                                                    
                                                    \mathbf{else}:\\
                                                    \;\;\;\;1\\
                                                    
                                                    
                                                    \end{array}
                                                    \end{array}
                                                    
                                                    Derivation
                                                    1. Split input into 2 regimes
                                                    2. if (/.f64 (exp.f64 a) (+.f64 (exp.f64 a) (exp.f64 b))) < 0.505506018332186

                                                      1. Initial program 100.0%

                                                        \[\frac{e^{a}}{e^{a} + e^{b}} \]
                                                      2. Add Preprocessing
                                                      3. Taylor expanded in a around 0

                                                        \[\leadsto \color{blue}{\frac{1}{1 + e^{b}}} \]
                                                      4. Step-by-step derivation
                                                        1. lower-/.f64N/A

                                                          \[\leadsto \color{blue}{\frac{1}{1 + e^{b}}} \]
                                                        2. lower-+.f64N/A

                                                          \[\leadsto \frac{1}{\color{blue}{1 + e^{b}}} \]
                                                        3. lower-exp.f6478.7

                                                          \[\leadsto \frac{1}{1 + \color{blue}{e^{b}}} \]
                                                      5. Applied rewrites78.7%

                                                        \[\leadsto \color{blue}{\frac{1}{1 + e^{b}}} \]
                                                      6. Taylor expanded in b around 0

                                                        \[\leadsto \frac{1}{2} + \color{blue}{\frac{-1}{4} \cdot b} \]
                                                      7. Step-by-step derivation
                                                        1. Applied rewrites41.5%

                                                          \[\leadsto \mathsf{fma}\left(b, \color{blue}{-0.25}, 0.5\right) \]

                                                        if 0.505506018332186 < (/.f64 (exp.f64 a) (+.f64 (exp.f64 a) (exp.f64 b)))

                                                        1. Initial program 94.8%

                                                          \[\frac{e^{a}}{e^{a} + e^{b}} \]
                                                        2. Add Preprocessing
                                                        3. Step-by-step derivation
                                                          1. lift-/.f64N/A

                                                            \[\leadsto \color{blue}{\frac{e^{a}}{e^{a} + e^{b}}} \]
                                                          2. clear-numN/A

                                                            \[\leadsto \color{blue}{\frac{1}{\frac{e^{a} + e^{b}}{e^{a}}}} \]
                                                          3. associate-/r/N/A

                                                            \[\leadsto \color{blue}{\frac{1}{e^{a} + e^{b}} \cdot e^{a}} \]
                                                          4. inv-powN/A

                                                            \[\leadsto \color{blue}{{\left(e^{a} + e^{b}\right)}^{-1}} \cdot e^{a} \]
                                                          5. pow-to-expN/A

                                                            \[\leadsto \color{blue}{e^{\log \left(e^{a} + e^{b}\right) \cdot -1}} \cdot e^{a} \]
                                                          6. lift-exp.f64N/A

                                                            \[\leadsto e^{\log \left(e^{a} + e^{b}\right) \cdot -1} \cdot \color{blue}{e^{a}} \]
                                                          7. prod-expN/A

                                                            \[\leadsto \color{blue}{e^{\log \left(e^{a} + e^{b}\right) \cdot -1 + a}} \]
                                                          8. lower-exp.f64N/A

                                                            \[\leadsto \color{blue}{e^{\log \left(e^{a} + e^{b}\right) \cdot -1 + a}} \]
                                                          9. lower-fma.f64N/A

                                                            \[\leadsto e^{\color{blue}{\mathsf{fma}\left(\log \left(e^{a} + e^{b}\right), -1, a\right)}} \]
                                                          10. lower-log.f6495.0

                                                            \[\leadsto e^{\mathsf{fma}\left(\color{blue}{\log \left(e^{a} + e^{b}\right)}, -1, a\right)} \]
                                                        4. Applied rewrites95.0%

                                                          \[\leadsto \color{blue}{e^{\mathsf{fma}\left(\log \left(e^{a} + e^{b}\right), -1, a\right)}} \]
                                                        5. Step-by-step derivation
                                                          1. lift-exp.f64N/A

                                                            \[\leadsto \color{blue}{e^{\mathsf{fma}\left(\log \left(e^{a} + e^{b}\right), -1, a\right)}} \]
                                                          2. lift-fma.f64N/A

                                                            \[\leadsto e^{\color{blue}{\log \left(e^{a} + e^{b}\right) \cdot -1 + a}} \]
                                                          3. flip-+N/A

                                                            \[\leadsto e^{\color{blue}{\frac{\left(\log \left(e^{a} + e^{b}\right) \cdot -1\right) \cdot \left(\log \left(e^{a} + e^{b}\right) \cdot -1\right) - a \cdot a}{\log \left(e^{a} + e^{b}\right) \cdot -1 - a}}} \]
                                                          4. div-invN/A

                                                            \[\leadsto e^{\color{blue}{\left(\left(\log \left(e^{a} + e^{b}\right) \cdot -1\right) \cdot \left(\log \left(e^{a} + e^{b}\right) \cdot -1\right) - a \cdot a\right) \cdot \frac{1}{\log \left(e^{a} + e^{b}\right) \cdot -1 - a}}} \]
                                                          5. exp-prodN/A

                                                            \[\leadsto \color{blue}{{\left(e^{\left(\log \left(e^{a} + e^{b}\right) \cdot -1\right) \cdot \left(\log \left(e^{a} + e^{b}\right) \cdot -1\right) - a \cdot a}\right)}^{\left(\frac{1}{\log \left(e^{a} + e^{b}\right) \cdot -1 - a}\right)}} \]
                                                          6. lower-pow.f64N/A

                                                            \[\leadsto \color{blue}{{\left(e^{\left(\log \left(e^{a} + e^{b}\right) \cdot -1\right) \cdot \left(\log \left(e^{a} + e^{b}\right) \cdot -1\right) - a \cdot a}\right)}^{\left(\frac{1}{\log \left(e^{a} + e^{b}\right) \cdot -1 - a}\right)}} \]
                                                        6. Applied rewrites100.0%

                                                          \[\leadsto \color{blue}{{\left(e^{{\log \left(e^{a} + e^{b}\right)}^{2} - a \cdot a}\right)}^{\left(\frac{1}{\left(-\log \left(e^{a} + e^{b}\right)\right) - a}\right)}} \]
                                                        7. Taylor expanded in a around inf

                                                          \[\leadsto \color{blue}{1} \]
                                                        8. Step-by-step derivation
                                                          1. Applied rewrites100.0%

                                                            \[\leadsto \color{blue}{1} \]
                                                        9. Recombined 2 regimes into one program.
                                                        10. Add Preprocessing

                                                        Alternative 11: 55.1% accurate, 1.0× speedup?

                                                        \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\frac{e^{a}}{e^{a} + e^{b}} \leq 0.505506018332186:\\ \;\;\;\;0.5\\ \mathbf{else}:\\ \;\;\;\;1\\ \end{array} \end{array} \]
                                                        (FPCore (a b)
                                                         :precision binary64
                                                         (if (<= (/ (exp a) (+ (exp a) (exp b))) 0.505506018332186) 0.5 1.0))
                                                        double code(double a, double b) {
                                                        	double tmp;
                                                        	if ((exp(a) / (exp(a) + exp(b))) <= 0.505506018332186) {
                                                        		tmp = 0.5;
                                                        	} else {
                                                        		tmp = 1.0;
                                                        	}
                                                        	return tmp;
                                                        }
                                                        
                                                        real(8) function code(a, b)
                                                            real(8), intent (in) :: a
                                                            real(8), intent (in) :: b
                                                            real(8) :: tmp
                                                            if ((exp(a) / (exp(a) + exp(b))) <= 0.505506018332186d0) then
                                                                tmp = 0.5d0
                                                            else
                                                                tmp = 1.0d0
                                                            end if
                                                            code = tmp
                                                        end function
                                                        
                                                        public static double code(double a, double b) {
                                                        	double tmp;
                                                        	if ((Math.exp(a) / (Math.exp(a) + Math.exp(b))) <= 0.505506018332186) {
                                                        		tmp = 0.5;
                                                        	} else {
                                                        		tmp = 1.0;
                                                        	}
                                                        	return tmp;
                                                        }
                                                        
                                                        def code(a, b):
                                                        	tmp = 0
                                                        	if (math.exp(a) / (math.exp(a) + math.exp(b))) <= 0.505506018332186:
                                                        		tmp = 0.5
                                                        	else:
                                                        		tmp = 1.0
                                                        	return tmp
                                                        
                                                        function code(a, b)
                                                        	tmp = 0.0
                                                        	if (Float64(exp(a) / Float64(exp(a) + exp(b))) <= 0.505506018332186)
                                                        		tmp = 0.5;
                                                        	else
                                                        		tmp = 1.0;
                                                        	end
                                                        	return tmp
                                                        end
                                                        
                                                        function tmp_2 = code(a, b)
                                                        	tmp = 0.0;
                                                        	if ((exp(a) / (exp(a) + exp(b))) <= 0.505506018332186)
                                                        		tmp = 0.5;
                                                        	else
                                                        		tmp = 1.0;
                                                        	end
                                                        	tmp_2 = tmp;
                                                        end
                                                        
                                                        code[a_, b_] := If[LessEqual[N[(N[Exp[a], $MachinePrecision] / N[(N[Exp[a], $MachinePrecision] + N[Exp[b], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.505506018332186], 0.5, 1.0]
                                                        
                                                        \begin{array}{l}
                                                        
                                                        \\
                                                        \begin{array}{l}
                                                        \mathbf{if}\;\frac{e^{a}}{e^{a} + e^{b}} \leq 0.505506018332186:\\
                                                        \;\;\;\;0.5\\
                                                        
                                                        \mathbf{else}:\\
                                                        \;\;\;\;1\\
                                                        
                                                        
                                                        \end{array}
                                                        \end{array}
                                                        
                                                        Derivation
                                                        1. Split input into 2 regimes
                                                        2. if (/.f64 (exp.f64 a) (+.f64 (exp.f64 a) (exp.f64 b))) < 0.505506018332186

                                                          1. Initial program 100.0%

                                                            \[\frac{e^{a}}{e^{a} + e^{b}} \]
                                                          2. Add Preprocessing
                                                          3. Taylor expanded in a around 0

                                                            \[\leadsto \color{blue}{\frac{1}{1 + e^{b}}} \]
                                                          4. Step-by-step derivation
                                                            1. lower-/.f64N/A

                                                              \[\leadsto \color{blue}{\frac{1}{1 + e^{b}}} \]
                                                            2. lower-+.f64N/A

                                                              \[\leadsto \frac{1}{\color{blue}{1 + e^{b}}} \]
                                                            3. lower-exp.f6478.7

                                                              \[\leadsto \frac{1}{1 + \color{blue}{e^{b}}} \]
                                                          5. Applied rewrites78.7%

                                                            \[\leadsto \color{blue}{\frac{1}{1 + e^{b}}} \]
                                                          6. Taylor expanded in b around 0

                                                            \[\leadsto \frac{1}{2} \]
                                                          7. Step-by-step derivation
                                                            1. Applied rewrites41.5%

                                                              \[\leadsto 0.5 \]

                                                            if 0.505506018332186 < (/.f64 (exp.f64 a) (+.f64 (exp.f64 a) (exp.f64 b)))

                                                            1. Initial program 94.8%

                                                              \[\frac{e^{a}}{e^{a} + e^{b}} \]
                                                            2. Add Preprocessing
                                                            3. Step-by-step derivation
                                                              1. lift-/.f64N/A

                                                                \[\leadsto \color{blue}{\frac{e^{a}}{e^{a} + e^{b}}} \]
                                                              2. clear-numN/A

                                                                \[\leadsto \color{blue}{\frac{1}{\frac{e^{a} + e^{b}}{e^{a}}}} \]
                                                              3. associate-/r/N/A

                                                                \[\leadsto \color{blue}{\frac{1}{e^{a} + e^{b}} \cdot e^{a}} \]
                                                              4. inv-powN/A

                                                                \[\leadsto \color{blue}{{\left(e^{a} + e^{b}\right)}^{-1}} \cdot e^{a} \]
                                                              5. pow-to-expN/A

                                                                \[\leadsto \color{blue}{e^{\log \left(e^{a} + e^{b}\right) \cdot -1}} \cdot e^{a} \]
                                                              6. lift-exp.f64N/A

                                                                \[\leadsto e^{\log \left(e^{a} + e^{b}\right) \cdot -1} \cdot \color{blue}{e^{a}} \]
                                                              7. prod-expN/A

                                                                \[\leadsto \color{blue}{e^{\log \left(e^{a} + e^{b}\right) \cdot -1 + a}} \]
                                                              8. lower-exp.f64N/A

                                                                \[\leadsto \color{blue}{e^{\log \left(e^{a} + e^{b}\right) \cdot -1 + a}} \]
                                                              9. lower-fma.f64N/A

                                                                \[\leadsto e^{\color{blue}{\mathsf{fma}\left(\log \left(e^{a} + e^{b}\right), -1, a\right)}} \]
                                                              10. lower-log.f6495.0

                                                                \[\leadsto e^{\mathsf{fma}\left(\color{blue}{\log \left(e^{a} + e^{b}\right)}, -1, a\right)} \]
                                                            4. Applied rewrites95.0%

                                                              \[\leadsto \color{blue}{e^{\mathsf{fma}\left(\log \left(e^{a} + e^{b}\right), -1, a\right)}} \]
                                                            5. Step-by-step derivation
                                                              1. lift-exp.f64N/A

                                                                \[\leadsto \color{blue}{e^{\mathsf{fma}\left(\log \left(e^{a} + e^{b}\right), -1, a\right)}} \]
                                                              2. lift-fma.f64N/A

                                                                \[\leadsto e^{\color{blue}{\log \left(e^{a} + e^{b}\right) \cdot -1 + a}} \]
                                                              3. flip-+N/A

                                                                \[\leadsto e^{\color{blue}{\frac{\left(\log \left(e^{a} + e^{b}\right) \cdot -1\right) \cdot \left(\log \left(e^{a} + e^{b}\right) \cdot -1\right) - a \cdot a}{\log \left(e^{a} + e^{b}\right) \cdot -1 - a}}} \]
                                                              4. div-invN/A

                                                                \[\leadsto e^{\color{blue}{\left(\left(\log \left(e^{a} + e^{b}\right) \cdot -1\right) \cdot \left(\log \left(e^{a} + e^{b}\right) \cdot -1\right) - a \cdot a\right) \cdot \frac{1}{\log \left(e^{a} + e^{b}\right) \cdot -1 - a}}} \]
                                                              5. exp-prodN/A

                                                                \[\leadsto \color{blue}{{\left(e^{\left(\log \left(e^{a} + e^{b}\right) \cdot -1\right) \cdot \left(\log \left(e^{a} + e^{b}\right) \cdot -1\right) - a \cdot a}\right)}^{\left(\frac{1}{\log \left(e^{a} + e^{b}\right) \cdot -1 - a}\right)}} \]
                                                              6. lower-pow.f64N/A

                                                                \[\leadsto \color{blue}{{\left(e^{\left(\log \left(e^{a} + e^{b}\right) \cdot -1\right) \cdot \left(\log \left(e^{a} + e^{b}\right) \cdot -1\right) - a \cdot a}\right)}^{\left(\frac{1}{\log \left(e^{a} + e^{b}\right) \cdot -1 - a}\right)}} \]
                                                            6. Applied rewrites100.0%

                                                              \[\leadsto \color{blue}{{\left(e^{{\log \left(e^{a} + e^{b}\right)}^{2} - a \cdot a}\right)}^{\left(\frac{1}{\left(-\log \left(e^{a} + e^{b}\right)\right) - a}\right)}} \]
                                                            7. Taylor expanded in a around inf

                                                              \[\leadsto \color{blue}{1} \]
                                                            8. Step-by-step derivation
                                                              1. Applied rewrites100.0%

                                                                \[\leadsto \color{blue}{1} \]
                                                            9. Recombined 2 regimes into one program.
                                                            10. Add Preprocessing

                                                            Alternative 12: 99.0% accurate, 1.0× speedup?

                                                            \[\begin{array}{l} \\ \frac{e^{a}}{e^{a} + e^{b}} \end{array} \]
                                                            (FPCore (a b) :precision binary64 (/ (exp a) (+ (exp a) (exp b))))
                                                            double code(double a, double b) {
                                                            	return exp(a) / (exp(a) + exp(b));
                                                            }
                                                            
                                                            real(8) function code(a, b)
                                                                real(8), intent (in) :: a
                                                                real(8), intent (in) :: b
                                                                code = exp(a) / (exp(a) + exp(b))
                                                            end function
                                                            
                                                            public static double code(double a, double b) {
                                                            	return Math.exp(a) / (Math.exp(a) + Math.exp(b));
                                                            }
                                                            
                                                            def code(a, b):
                                                            	return math.exp(a) / (math.exp(a) + math.exp(b))
                                                            
                                                            function code(a, b)
                                                            	return Float64(exp(a) / Float64(exp(a) + exp(b)))
                                                            end
                                                            
                                                            function tmp = code(a, b)
                                                            	tmp = exp(a) / (exp(a) + exp(b));
                                                            end
                                                            
                                                            code[a_, b_] := N[(N[Exp[a], $MachinePrecision] / N[(N[Exp[a], $MachinePrecision] + N[Exp[b], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
                                                            
                                                            \begin{array}{l}
                                                            
                                                            \\
                                                            \frac{e^{a}}{e^{a} + e^{b}}
                                                            \end{array}
                                                            
                                                            Derivation
                                                            1. Initial program 98.8%

                                                              \[\frac{e^{a}}{e^{a} + e^{b}} \]
                                                            2. Add Preprocessing
                                                            3. Add Preprocessing

                                                            Alternative 13: 98.5% accurate, 2.6× speedup?

                                                            \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \leq -480000000:\\ \;\;\;\;\frac{e^{a}}{1 + 1}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{e^{b} + 1}\\ \end{array} \end{array} \]
                                                            (FPCore (a b)
                                                             :precision binary64
                                                             (if (<= a -480000000.0) (/ (exp a) (+ 1.0 1.0)) (/ 1.0 (+ (exp b) 1.0))))
                                                            double code(double a, double b) {
                                                            	double tmp;
                                                            	if (a <= -480000000.0) {
                                                            		tmp = exp(a) / (1.0 + 1.0);
                                                            	} else {
                                                            		tmp = 1.0 / (exp(b) + 1.0);
                                                            	}
                                                            	return tmp;
                                                            }
                                                            
                                                            real(8) function code(a, b)
                                                                real(8), intent (in) :: a
                                                                real(8), intent (in) :: b
                                                                real(8) :: tmp
                                                                if (a <= (-480000000.0d0)) then
                                                                    tmp = exp(a) / (1.0d0 + 1.0d0)
                                                                else
                                                                    tmp = 1.0d0 / (exp(b) + 1.0d0)
                                                                end if
                                                                code = tmp
                                                            end function
                                                            
                                                            public static double code(double a, double b) {
                                                            	double tmp;
                                                            	if (a <= -480000000.0) {
                                                            		tmp = Math.exp(a) / (1.0 + 1.0);
                                                            	} else {
                                                            		tmp = 1.0 / (Math.exp(b) + 1.0);
                                                            	}
                                                            	return tmp;
                                                            }
                                                            
                                                            def code(a, b):
                                                            	tmp = 0
                                                            	if a <= -480000000.0:
                                                            		tmp = math.exp(a) / (1.0 + 1.0)
                                                            	else:
                                                            		tmp = 1.0 / (math.exp(b) + 1.0)
                                                            	return tmp
                                                            
                                                            function code(a, b)
                                                            	tmp = 0.0
                                                            	if (a <= -480000000.0)
                                                            		tmp = Float64(exp(a) / Float64(1.0 + 1.0));
                                                            	else
                                                            		tmp = Float64(1.0 / Float64(exp(b) + 1.0));
                                                            	end
                                                            	return tmp
                                                            end
                                                            
                                                            function tmp_2 = code(a, b)
                                                            	tmp = 0.0;
                                                            	if (a <= -480000000.0)
                                                            		tmp = exp(a) / (1.0 + 1.0);
                                                            	else
                                                            		tmp = 1.0 / (exp(b) + 1.0);
                                                            	end
                                                            	tmp_2 = tmp;
                                                            end
                                                            
                                                            code[a_, b_] := If[LessEqual[a, -480000000.0], N[(N[Exp[a], $MachinePrecision] / N[(1.0 + 1.0), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(N[Exp[b], $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]]
                                                            
                                                            \begin{array}{l}
                                                            
                                                            \\
                                                            \begin{array}{l}
                                                            \mathbf{if}\;a \leq -480000000:\\
                                                            \;\;\;\;\frac{e^{a}}{1 + 1}\\
                                                            
                                                            \mathbf{else}:\\
                                                            \;\;\;\;\frac{1}{e^{b} + 1}\\
                                                            
                                                            
                                                            \end{array}
                                                            \end{array}
                                                            
                                                            Derivation
                                                            1. Split input into 2 regimes
                                                            2. if a < -4.8e8

                                                              1. Initial program 100.0%

                                                                \[\frac{e^{a}}{e^{a} + e^{b}} \]
                                                              2. Add Preprocessing
                                                              3. Taylor expanded in b around 0

                                                                \[\leadsto \frac{e^{a}}{e^{a} + \color{blue}{1}} \]
                                                              4. Step-by-step derivation
                                                                1. Applied rewrites100.0%

                                                                  \[\leadsto \frac{e^{a}}{e^{a} + \color{blue}{1}} \]
                                                                2. Taylor expanded in a around 0

                                                                  \[\leadsto \frac{e^{a}}{\color{blue}{1} + 1} \]
                                                                3. Step-by-step derivation
                                                                  1. Applied rewrites100.0%

                                                                    \[\leadsto \frac{e^{a}}{\color{blue}{1} + 1} \]

                                                                  if -4.8e8 < a

                                                                  1. Initial program 98.5%

                                                                    \[\frac{e^{a}}{e^{a} + e^{b}} \]
                                                                  2. Add Preprocessing
                                                                  3. Taylor expanded in a around 0

                                                                    \[\leadsto \color{blue}{\frac{1}{1 + e^{b}}} \]
                                                                  4. Step-by-step derivation
                                                                    1. lower-/.f64N/A

                                                                      \[\leadsto \color{blue}{\frac{1}{1 + e^{b}}} \]
                                                                    2. lower-+.f64N/A

                                                                      \[\leadsto \frac{1}{\color{blue}{1 + e^{b}}} \]
                                                                    3. lower-exp.f6498.0

                                                                      \[\leadsto \frac{1}{1 + \color{blue}{e^{b}}} \]
                                                                  5. Applied rewrites98.0%

                                                                    \[\leadsto \color{blue}{\frac{1}{1 + e^{b}}} \]
                                                                4. Recombined 2 regimes into one program.
                                                                5. Final simplification98.4%

                                                                  \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -480000000:\\ \;\;\;\;\frac{e^{a}}{1 + 1}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{e^{b} + 1}\\ \end{array} \]
                                                                6. Add Preprocessing

                                                                Alternative 14: 86.6% accurate, 2.6× speedup?

                                                                \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \leq -3500000000:\\ \;\;\;\;-0.0020833333333333333 \cdot {b}^{5}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{e^{b} + 1}\\ \end{array} \end{array} \]
                                                                (FPCore (a b)
                                                                 :precision binary64
                                                                 (if (<= a -3500000000.0)
                                                                   (* -0.0020833333333333333 (pow b 5.0))
                                                                   (/ 1.0 (+ (exp b) 1.0))))
                                                                double code(double a, double b) {
                                                                	double tmp;
                                                                	if (a <= -3500000000.0) {
                                                                		tmp = -0.0020833333333333333 * pow(b, 5.0);
                                                                	} else {
                                                                		tmp = 1.0 / (exp(b) + 1.0);
                                                                	}
                                                                	return tmp;
                                                                }
                                                                
                                                                real(8) function code(a, b)
                                                                    real(8), intent (in) :: a
                                                                    real(8), intent (in) :: b
                                                                    real(8) :: tmp
                                                                    if (a <= (-3500000000.0d0)) then
                                                                        tmp = (-0.0020833333333333333d0) * (b ** 5.0d0)
                                                                    else
                                                                        tmp = 1.0d0 / (exp(b) + 1.0d0)
                                                                    end if
                                                                    code = tmp
                                                                end function
                                                                
                                                                public static double code(double a, double b) {
                                                                	double tmp;
                                                                	if (a <= -3500000000.0) {
                                                                		tmp = -0.0020833333333333333 * Math.pow(b, 5.0);
                                                                	} else {
                                                                		tmp = 1.0 / (Math.exp(b) + 1.0);
                                                                	}
                                                                	return tmp;
                                                                }
                                                                
                                                                def code(a, b):
                                                                	tmp = 0
                                                                	if a <= -3500000000.0:
                                                                		tmp = -0.0020833333333333333 * math.pow(b, 5.0)
                                                                	else:
                                                                		tmp = 1.0 / (math.exp(b) + 1.0)
                                                                	return tmp
                                                                
                                                                function code(a, b)
                                                                	tmp = 0.0
                                                                	if (a <= -3500000000.0)
                                                                		tmp = Float64(-0.0020833333333333333 * (b ^ 5.0));
                                                                	else
                                                                		tmp = Float64(1.0 / Float64(exp(b) + 1.0));
                                                                	end
                                                                	return tmp
                                                                end
                                                                
                                                                function tmp_2 = code(a, b)
                                                                	tmp = 0.0;
                                                                	if (a <= -3500000000.0)
                                                                		tmp = -0.0020833333333333333 * (b ^ 5.0);
                                                                	else
                                                                		tmp = 1.0 / (exp(b) + 1.0);
                                                                	end
                                                                	tmp_2 = tmp;
                                                                end
                                                                
                                                                code[a_, b_] := If[LessEqual[a, -3500000000.0], N[(-0.0020833333333333333 * N[Power[b, 5.0], $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(N[Exp[b], $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]]
                                                                
                                                                \begin{array}{l}
                                                                
                                                                \\
                                                                \begin{array}{l}
                                                                \mathbf{if}\;a \leq -3500000000:\\
                                                                \;\;\;\;-0.0020833333333333333 \cdot {b}^{5}\\
                                                                
                                                                \mathbf{else}:\\
                                                                \;\;\;\;\frac{1}{e^{b} + 1}\\
                                                                
                                                                
                                                                \end{array}
                                                                \end{array}
                                                                
                                                                Derivation
                                                                1. Split input into 2 regimes
                                                                2. if a < -3.5e9

                                                                  1. Initial program 100.0%

                                                                    \[\frac{e^{a}}{e^{a} + e^{b}} \]
                                                                  2. Add Preprocessing
                                                                  3. Taylor expanded in a around 0

                                                                    \[\leadsto \color{blue}{\frac{1}{1 + e^{b}}} \]
                                                                  4. Step-by-step derivation
                                                                    1. lower-/.f64N/A

                                                                      \[\leadsto \color{blue}{\frac{1}{1 + e^{b}}} \]
                                                                    2. lower-+.f64N/A

                                                                      \[\leadsto \frac{1}{\color{blue}{1 + e^{b}}} \]
                                                                    3. lower-exp.f6426.0

                                                                      \[\leadsto \frac{1}{1 + \color{blue}{e^{b}}} \]
                                                                  5. Applied rewrites26.0%

                                                                    \[\leadsto \color{blue}{\frac{1}{1 + e^{b}}} \]
                                                                  6. Taylor expanded in b around 0

                                                                    \[\leadsto \frac{1}{2} + \color{blue}{b \cdot \left({b}^{2} \cdot \left(\frac{1}{48} + \frac{-1}{480} \cdot {b}^{2}\right) - \frac{1}{4}\right)} \]
                                                                  7. Step-by-step derivation
                                                                    1. Applied rewrites2.8%

                                                                      \[\leadsto \mathsf{fma}\left(b, \color{blue}{\mathsf{fma}\left(b \cdot b, \mathsf{fma}\left(b \cdot b, -0.0020833333333333333, 0.020833333333333332\right), -0.25\right)}, 0.5\right) \]
                                                                    2. Taylor expanded in b around inf

                                                                      \[\leadsto \frac{-1}{480} \cdot {b}^{\color{blue}{5}} \]
                                                                    3. Step-by-step derivation
                                                                      1. Applied rewrites61.2%

                                                                        \[\leadsto -0.0020833333333333333 \cdot {b}^{\color{blue}{5}} \]

                                                                      if -3.5e9 < a

                                                                      1. Initial program 98.5%

                                                                        \[\frac{e^{a}}{e^{a} + e^{b}} \]
                                                                      2. Add Preprocessing
                                                                      3. Taylor expanded in a around 0

                                                                        \[\leadsto \color{blue}{\frac{1}{1 + e^{b}}} \]
                                                                      4. Step-by-step derivation
                                                                        1. lower-/.f64N/A

                                                                          \[\leadsto \color{blue}{\frac{1}{1 + e^{b}}} \]
                                                                        2. lower-+.f64N/A

                                                                          \[\leadsto \frac{1}{\color{blue}{1 + e^{b}}} \]
                                                                        3. lower-exp.f6498.0

                                                                          \[\leadsto \frac{1}{1 + \color{blue}{e^{b}}} \]
                                                                      5. Applied rewrites98.0%

                                                                        \[\leadsto \color{blue}{\frac{1}{1 + e^{b}}} \]
                                                                    4. Recombined 2 regimes into one program.
                                                                    5. Final simplification90.1%

                                                                      \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -3500000000:\\ \;\;\;\;-0.0020833333333333333 \cdot {b}^{5}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{e^{b} + 1}\\ \end{array} \]
                                                                    6. Add Preprocessing

                                                                    Alternative 15: 39.7% accurate, 315.0× speedup?

                                                                    \[\begin{array}{l} \\ 0.5 \end{array} \]
                                                                    (FPCore (a b) :precision binary64 0.5)
                                                                    double code(double a, double b) {
                                                                    	return 0.5;
                                                                    }
                                                                    
                                                                    real(8) function code(a, b)
                                                                        real(8), intent (in) :: a
                                                                        real(8), intent (in) :: b
                                                                        code = 0.5d0
                                                                    end function
                                                                    
                                                                    public static double code(double a, double b) {
                                                                    	return 0.5;
                                                                    }
                                                                    
                                                                    def code(a, b):
                                                                    	return 0.5
                                                                    
                                                                    function code(a, b)
                                                                    	return 0.5
                                                                    end
                                                                    
                                                                    function tmp = code(a, b)
                                                                    	tmp = 0.5;
                                                                    end
                                                                    
                                                                    code[a_, b_] := 0.5
                                                                    
                                                                    \begin{array}{l}
                                                                    
                                                                    \\
                                                                    0.5
                                                                    \end{array}
                                                                    
                                                                    Derivation
                                                                    1. Initial program 98.8%

                                                                      \[\frac{e^{a}}{e^{a} + e^{b}} \]
                                                                    2. Add Preprocessing
                                                                    3. Taylor expanded in a around 0

                                                                      \[\leadsto \color{blue}{\frac{1}{1 + e^{b}}} \]
                                                                    4. Step-by-step derivation
                                                                      1. lower-/.f64N/A

                                                                        \[\leadsto \color{blue}{\frac{1}{1 + e^{b}}} \]
                                                                      2. lower-+.f64N/A

                                                                        \[\leadsto \frac{1}{\color{blue}{1 + e^{b}}} \]
                                                                      3. lower-exp.f6482.6

                                                                        \[\leadsto \frac{1}{1 + \color{blue}{e^{b}}} \]
                                                                    5. Applied rewrites82.6%

                                                                      \[\leadsto \color{blue}{\frac{1}{1 + e^{b}}} \]
                                                                    6. Taylor expanded in b around 0

                                                                      \[\leadsto \frac{1}{2} \]
                                                                    7. Step-by-step derivation
                                                                      1. Applied rewrites36.4%

                                                                        \[\leadsto 0.5 \]
                                                                      2. Add Preprocessing

                                                                      Developer Target 1: 100.0% accurate, 2.7× speedup?

                                                                      \[\begin{array}{l} \\ \frac{1}{1 + e^{b - a}} \end{array} \]
                                                                      (FPCore (a b) :precision binary64 (/ 1.0 (+ 1.0 (exp (- b a)))))
                                                                      double code(double a, double b) {
                                                                      	return 1.0 / (1.0 + exp((b - a)));
                                                                      }
                                                                      
                                                                      real(8) function code(a, b)
                                                                          real(8), intent (in) :: a
                                                                          real(8), intent (in) :: b
                                                                          code = 1.0d0 / (1.0d0 + exp((b - a)))
                                                                      end function
                                                                      
                                                                      public static double code(double a, double b) {
                                                                      	return 1.0 / (1.0 + Math.exp((b - a)));
                                                                      }
                                                                      
                                                                      def code(a, b):
                                                                      	return 1.0 / (1.0 + math.exp((b - a)))
                                                                      
                                                                      function code(a, b)
                                                                      	return Float64(1.0 / Float64(1.0 + exp(Float64(b - a))))
                                                                      end
                                                                      
                                                                      function tmp = code(a, b)
                                                                      	tmp = 1.0 / (1.0 + exp((b - a)));
                                                                      end
                                                                      
                                                                      code[a_, b_] := N[(1.0 / N[(1.0 + N[Exp[N[(b - a), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
                                                                      
                                                                      \begin{array}{l}
                                                                      
                                                                      \\
                                                                      \frac{1}{1 + e^{b - a}}
                                                                      \end{array}
                                                                      

                                                                      Reproduce

                                                                      ?
                                                                      herbie shell --seed 2024223 
                                                                      (FPCore (a b)
                                                                        :name "Quotient of sum of exps"
                                                                        :precision binary64
                                                                      
                                                                        :alt
                                                                        (! :herbie-platform default (/ 1 (+ 1 (exp (- b a)))))
                                                                      
                                                                        (/ (exp a) (+ (exp a) (exp b))))