Quotient of sum of exps

Percentage Accurate: 99.0% → 99.2%
Time: 6.3s
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.2% 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 99.6%

    \[\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.f6499.6

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

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

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

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

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

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

Alternative 2: 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 99.6%

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

Alternative 3: 98.3% accurate, 1.3× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;e^{a} \leq 0.99995:\\
\;\;\;\;\frac{1}{\frac{1 + b}{e^{a}} + 1}\\

\mathbf{else}:\\
\;\;\;\;\frac{1}{1 + e^{b}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (exp.f64 a) < 0.999950000000000006

    1. Initial program 100.0%

      \[\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. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{1}{\frac{e^{a} + e^{b}}{e^{a}}}} \]
      4. lower-/.f64100.0

        \[\leadsto \frac{1}{\color{blue}{\frac{e^{a} + e^{b}}{e^{a}}}} \]
      5. lift-+.f64N/A

        \[\leadsto \frac{1}{\frac{\color{blue}{e^{a} + e^{b}}}{e^{a}}} \]
      6. +-commutativeN/A

        \[\leadsto \frac{1}{\frac{\color{blue}{e^{b} + e^{a}}}{e^{a}}} \]
      7. lower-+.f64100.0

        \[\leadsto \frac{1}{\frac{\color{blue}{e^{b} + e^{a}}}{e^{a}}} \]
    4. Applied rewrites100.0%

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

      \[\leadsto \frac{1}{\color{blue}{1 + \left(\frac{1}{e^{a}} + \frac{b}{e^{a}}\right)}} \]
    6. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto \frac{1}{\color{blue}{\left(\frac{1}{e^{a}} + \frac{b}{e^{a}}\right) + 1}} \]
      2. *-rgt-identityN/A

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

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

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

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

        \[\leadsto \frac{1}{\color{blue}{\mathsf{fma}\left(1 + b, \frac{1}{e^{a}}, 1\right)}} \]
      7. +-commutativeN/A

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

        \[\leadsto \frac{1}{\mathsf{fma}\left(\color{blue}{b + 1}, \frac{1}{e^{a}}, 1\right)} \]
      9. rec-expN/A

        \[\leadsto \frac{1}{\mathsf{fma}\left(b + 1, \color{blue}{e^{\mathsf{neg}\left(a\right)}}, 1\right)} \]
      10. mul-1-negN/A

        \[\leadsto \frac{1}{\mathsf{fma}\left(b + 1, e^{\color{blue}{-1 \cdot a}}, 1\right)} \]
      11. lower-exp.f64N/A

        \[\leadsto \frac{1}{\mathsf{fma}\left(b + 1, \color{blue}{e^{-1 \cdot a}}, 1\right)} \]
      12. mul-1-negN/A

        \[\leadsto \frac{1}{\mathsf{fma}\left(b + 1, e^{\color{blue}{\mathsf{neg}\left(a\right)}}, 1\right)} \]
      13. lower-neg.f64100.0

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

      \[\leadsto \frac{1}{\color{blue}{\mathsf{fma}\left(b + 1, e^{-a}, 1\right)}} \]
    8. Step-by-step derivation
      1. Applied rewrites100.0%

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

      if 0.999950000000000006 < (exp.f64 a)

      1. Initial program 99.4%

        \[\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. +-commutativeN/A

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

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

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

        \[\leadsto \color{blue}{\frac{1}{e^{b} + 1}} \]
    9. Recombined 2 regimes into one program.
    10. Final simplification99.1%

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

    Alternative 4: 98.3% accurate, 1.4× speedup?

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

      1. Initial program 100.0%

        \[\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. lower-/.f64N/A

          \[\leadsto \color{blue}{\frac{1}{\frac{e^{a} + e^{b}}{e^{a}}}} \]
        4. lower-/.f64100.0

          \[\leadsto \frac{1}{\color{blue}{\frac{e^{a} + e^{b}}{e^{a}}}} \]
        5. lift-+.f64N/A

          \[\leadsto \frac{1}{\frac{\color{blue}{e^{a} + e^{b}}}{e^{a}}} \]
        6. +-commutativeN/A

          \[\leadsto \frac{1}{\frac{\color{blue}{e^{b} + e^{a}}}{e^{a}}} \]
        7. lower-+.f64100.0

          \[\leadsto \frac{1}{\frac{\color{blue}{e^{b} + e^{a}}}{e^{a}}} \]
      4. Applied rewrites100.0%

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

        \[\leadsto \frac{1}{\color{blue}{1 + \left(\frac{1}{e^{a}} + \frac{b}{e^{a}}\right)}} \]
      6. Step-by-step derivation
        1. +-commutativeN/A

          \[\leadsto \frac{1}{\color{blue}{\left(\frac{1}{e^{a}} + \frac{b}{e^{a}}\right) + 1}} \]
        2. *-rgt-identityN/A

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

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

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

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

          \[\leadsto \frac{1}{\color{blue}{\mathsf{fma}\left(1 + b, \frac{1}{e^{a}}, 1\right)}} \]
        7. +-commutativeN/A

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

          \[\leadsto \frac{1}{\mathsf{fma}\left(\color{blue}{b + 1}, \frac{1}{e^{a}}, 1\right)} \]
        9. rec-expN/A

          \[\leadsto \frac{1}{\mathsf{fma}\left(b + 1, \color{blue}{e^{\mathsf{neg}\left(a\right)}}, 1\right)} \]
        10. mul-1-negN/A

          \[\leadsto \frac{1}{\mathsf{fma}\left(b + 1, e^{\color{blue}{-1 \cdot a}}, 1\right)} \]
        11. lower-exp.f64N/A

          \[\leadsto \frac{1}{\mathsf{fma}\left(b + 1, \color{blue}{e^{-1 \cdot a}}, 1\right)} \]
        12. mul-1-negN/A

          \[\leadsto \frac{1}{\mathsf{fma}\left(b + 1, e^{\color{blue}{\mathsf{neg}\left(a\right)}}, 1\right)} \]
        13. lower-neg.f64100.0

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

        \[\leadsto \frac{1}{\color{blue}{\mathsf{fma}\left(b + 1, e^{-a}, 1\right)}} \]
      8. Taylor expanded in b around 0

        \[\leadsto \frac{1}{1 + \color{blue}{e^{\mathsf{neg}\left(a\right)}}} \]
      9. Step-by-step derivation
        1. Applied rewrites100.0%

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

        if 0.999950000000000006 < (exp.f64 a)

        1. Initial program 99.4%

          \[\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. +-commutativeN/A

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

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

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

          \[\leadsto \color{blue}{\frac{1}{e^{b} + 1}} \]
      10. Recombined 2 regimes into one program.
      11. Final simplification99.1%

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

      Alternative 5: 98.0% accurate, 1.4× speedup?

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

        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 rewrites97.1%

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

            if 0.999950000000000006 < (exp.f64 a)

            1. Initial program 99.4%

              \[\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. +-commutativeN/A

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

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

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

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

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

          Alternative 6: 92.2% accurate, 2.6× speedup?

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

            1. Initial program 100.0%

              \[\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. lower-/.f64N/A

                \[\leadsto \color{blue}{\frac{1}{\frac{e^{a} + e^{b}}{e^{a}}}} \]
              4. lower-/.f64100.0

                \[\leadsto \frac{1}{\color{blue}{\frac{e^{a} + e^{b}}{e^{a}}}} \]
              5. lift-+.f64N/A

                \[\leadsto \frac{1}{\frac{\color{blue}{e^{a} + e^{b}}}{e^{a}}} \]
              6. +-commutativeN/A

                \[\leadsto \frac{1}{\frac{\color{blue}{e^{b} + e^{a}}}{e^{a}}} \]
              7. lower-+.f64100.0

                \[\leadsto \frac{1}{\frac{\color{blue}{e^{b} + e^{a}}}{e^{a}}} \]
            4. Applied rewrites100.0%

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

              \[\leadsto \frac{1}{\color{blue}{1 + \left(\frac{1}{e^{a}} + \frac{b}{e^{a}}\right)}} \]
            6. Step-by-step derivation
              1. +-commutativeN/A

                \[\leadsto \frac{1}{\color{blue}{\left(\frac{1}{e^{a}} + \frac{b}{e^{a}}\right) + 1}} \]
              2. *-rgt-identityN/A

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

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

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

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

                \[\leadsto \frac{1}{\color{blue}{\mathsf{fma}\left(1 + b, \frac{1}{e^{a}}, 1\right)}} \]
              7. +-commutativeN/A

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

                \[\leadsto \frac{1}{\mathsf{fma}\left(\color{blue}{b + 1}, \frac{1}{e^{a}}, 1\right)} \]
              9. rec-expN/A

                \[\leadsto \frac{1}{\mathsf{fma}\left(b + 1, \color{blue}{e^{\mathsf{neg}\left(a\right)}}, 1\right)} \]
              10. mul-1-negN/A

                \[\leadsto \frac{1}{\mathsf{fma}\left(b + 1, e^{\color{blue}{-1 \cdot a}}, 1\right)} \]
              11. lower-exp.f64N/A

                \[\leadsto \frac{1}{\mathsf{fma}\left(b + 1, \color{blue}{e^{-1 \cdot a}}, 1\right)} \]
              12. mul-1-negN/A

                \[\leadsto \frac{1}{\mathsf{fma}\left(b + 1, e^{\color{blue}{\mathsf{neg}\left(a\right)}}, 1\right)} \]
              13. lower-neg.f64100.0

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

              \[\leadsto \frac{1}{\color{blue}{\mathsf{fma}\left(b + 1, e^{-a}, 1\right)}} \]
            8. Taylor expanded in a around 0

              \[\leadsto \frac{1}{\mathsf{fma}\left(b + 1, 1 + \color{blue}{a \cdot \left(a \cdot \left(\frac{1}{2} + \frac{-1}{6} \cdot a\right) - 1\right)}, 1\right)} \]
            9. Step-by-step derivation
              1. Applied rewrites84.2%

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

              if -2.79999999999999988e47 < a

              1. Initial program 99.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. +-commutativeN/A

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

                  \[\leadsto \frac{1}{\color{blue}{e^{b} + 1}} \]
                4. lower-exp.f6493.8

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

                \[\leadsto \color{blue}{\frac{1}{e^{b} + 1}} \]
            10. Recombined 2 regimes into one program.
            11. Final simplification91.6%

              \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -2.8 \cdot 10^{+47}:\\ \;\;\;\;\frac{1}{\mathsf{fma}\left(1 + b, \mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(-0.16666666666666666, a, 0.5\right), a, -1\right), a, 1\right), 1\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{1 + e^{b}}\\ \end{array} \]
            12. Add Preprocessing

            Alternative 7: 72.0% accurate, 6.1× speedup?

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

              1. Initial program 99.5%

                \[\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 rewrites75.6%

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

                  \[\leadsto \frac{e^{a}}{\color{blue}{\left(1 + a \cdot \left(1 + a \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot a\right)\right)\right)} + 1} \]
                3. Step-by-step derivation
                  1. +-commutativeN/A

                    \[\leadsto \frac{e^{a}}{\color{blue}{\left(a \cdot \left(1 + a \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot a\right)\right) + 1\right)} + 1} \]
                  2. *-commutativeN/A

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

                    \[\leadsto \frac{e^{a}}{\color{blue}{\mathsf{fma}\left(1 + a \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot a\right), a, 1\right)} + 1} \]
                  4. +-commutativeN/A

                    \[\leadsto \frac{e^{a}}{\mathsf{fma}\left(\color{blue}{a \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot a\right) + 1}, a, 1\right) + 1} \]
                  5. *-commutativeN/A

                    \[\leadsto \frac{e^{a}}{\mathsf{fma}\left(\color{blue}{\left(\frac{1}{2} + \frac{1}{6} \cdot a\right) \cdot a} + 1, a, 1\right) + 1} \]
                  6. lower-fma.f64N/A

                    \[\leadsto \frac{e^{a}}{\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(\frac{1}{2} + \frac{1}{6} \cdot a, a, 1\right)}, a, 1\right) + 1} \]
                  7. +-commutativeN/A

                    \[\leadsto \frac{e^{a}}{\mathsf{fma}\left(\mathsf{fma}\left(\color{blue}{\frac{1}{6} \cdot a + \frac{1}{2}}, a, 1\right), a, 1\right) + 1} \]
                  8. lower-fma.f6474.7

                    \[\leadsto \frac{e^{a}}{\mathsf{fma}\left(\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(0.16666666666666666, a, 0.5\right)}, a, 1\right), a, 1\right) + 1} \]
                4. Applied rewrites74.7%

                  \[\leadsto \frac{e^{a}}{\color{blue}{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(0.16666666666666666, a, 0.5\right), a, 1\right), a, 1\right)} + 1} \]
                5. Taylor expanded in a around 0

                  \[\leadsto \frac{\color{blue}{1 + a}}{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\frac{1}{6}, a, \frac{1}{2}\right), a, 1\right), a, 1\right) + 1} \]
                6. Step-by-step derivation
                  1. lower-+.f6465.3

                    \[\leadsto \frac{\color{blue}{1 + a}}{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(0.16666666666666666, a, 0.5\right), a, 1\right), a, 1\right) + 1} \]
                7. Applied rewrites65.3%

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

                if 6.9999999999999997e64 < b

                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. +-commutativeN/A

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

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

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

                  \[\leadsto \color{blue}{\frac{1}{e^{b} + 1}} \]
                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 rewrites84.4%

                    \[\leadsto \frac{1}{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(0.16666666666666666, b, 0.5\right), b, 1\right), \color{blue}{b}, 2\right)} \]
                  2. Step-by-step derivation
                    1. Applied rewrites84.4%

                      \[\leadsto \frac{1}{\mathsf{fma}\left(\mathsf{fma}\left(\frac{\mathsf{fma}\left(0.027777777777777776, b \cdot b, -0.25\right)}{\mathsf{fma}\left(b, 0.16666666666666666, -0.5\right)}, b, 1\right), b, 2\right)} \]
                    2. Taylor expanded in b around 0

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

                        \[\leadsto \frac{1}{\mathsf{fma}\left(\mathsf{fma}\left(\frac{\mathsf{fma}\left(0.027777777777777776, b \cdot b, -0.25\right)}{-0.5}, b, 1\right), b, 2\right)} \]
                    4. Recombined 2 regimes into one program.
                    5. Add Preprocessing

                    Alternative 8: 70.4% accurate, 7.5× speedup?

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

                      1. Initial program 99.5%

                        \[\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 rewrites75.6%

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

                          \[\leadsto \frac{e^{a}}{\color{blue}{\left(1 + a \cdot \left(1 + a \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot a\right)\right)\right)} + 1} \]
                        3. Step-by-step derivation
                          1. +-commutativeN/A

                            \[\leadsto \frac{e^{a}}{\color{blue}{\left(a \cdot \left(1 + a \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot a\right)\right) + 1\right)} + 1} \]
                          2. *-commutativeN/A

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

                            \[\leadsto \frac{e^{a}}{\color{blue}{\mathsf{fma}\left(1 + a \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot a\right), a, 1\right)} + 1} \]
                          4. +-commutativeN/A

                            \[\leadsto \frac{e^{a}}{\mathsf{fma}\left(\color{blue}{a \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot a\right) + 1}, a, 1\right) + 1} \]
                          5. *-commutativeN/A

                            \[\leadsto \frac{e^{a}}{\mathsf{fma}\left(\color{blue}{\left(\frac{1}{2} + \frac{1}{6} \cdot a\right) \cdot a} + 1, a, 1\right) + 1} \]
                          6. lower-fma.f64N/A

                            \[\leadsto \frac{e^{a}}{\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(\frac{1}{2} + \frac{1}{6} \cdot a, a, 1\right)}, a, 1\right) + 1} \]
                          7. +-commutativeN/A

                            \[\leadsto \frac{e^{a}}{\mathsf{fma}\left(\mathsf{fma}\left(\color{blue}{\frac{1}{6} \cdot a + \frac{1}{2}}, a, 1\right), a, 1\right) + 1} \]
                          8. lower-fma.f6474.7

                            \[\leadsto \frac{e^{a}}{\mathsf{fma}\left(\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(0.16666666666666666, a, 0.5\right)}, a, 1\right), a, 1\right) + 1} \]
                        4. Applied rewrites74.7%

                          \[\leadsto \frac{e^{a}}{\color{blue}{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(0.16666666666666666, a, 0.5\right), a, 1\right), a, 1\right)} + 1} \]
                        5. Taylor expanded in a around 0

                          \[\leadsto \frac{\color{blue}{1 + a}}{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\frac{1}{6}, a, \frac{1}{2}\right), a, 1\right), a, 1\right) + 1} \]
                        6. Step-by-step derivation
                          1. lower-+.f6465.3

                            \[\leadsto \frac{\color{blue}{1 + a}}{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(0.16666666666666666, a, 0.5\right), a, 1\right), a, 1\right) + 1} \]
                        7. Applied rewrites65.3%

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

                        if 6.9999999999999997e64 < b

                        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. +-commutativeN/A

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

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

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

                          \[\leadsto \color{blue}{\frac{1}{e^{b} + 1}} \]
                        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 rewrites84.4%

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

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

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

                              \[\leadsto \frac{1}{\left(\left(\frac{1}{6} \cdot b\right) \cdot b\right) \cdot b} \]
                            3. Step-by-step derivation
                              1. Applied rewrites84.4%

                                \[\leadsto \frac{1}{\left(\left(0.16666666666666666 \cdot b\right) \cdot b\right) \cdot b} \]
                            4. Recombined 2 regimes into one program.
                            5. Add Preprocessing

                            Alternative 9: 70.0% accurate, 8.1× speedup?

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

                              1. Initial program 99.5%

                                \[\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 rewrites75.6%

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

                                  \[\leadsto \frac{e^{a}}{\color{blue}{\left(1 + a \cdot \left(1 + a \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot a\right)\right)\right)} + 1} \]
                                3. Step-by-step derivation
                                  1. +-commutativeN/A

                                    \[\leadsto \frac{e^{a}}{\color{blue}{\left(a \cdot \left(1 + a \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot a\right)\right) + 1\right)} + 1} \]
                                  2. *-commutativeN/A

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

                                    \[\leadsto \frac{e^{a}}{\color{blue}{\mathsf{fma}\left(1 + a \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot a\right), a, 1\right)} + 1} \]
                                  4. +-commutativeN/A

                                    \[\leadsto \frac{e^{a}}{\mathsf{fma}\left(\color{blue}{a \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot a\right) + 1}, a, 1\right) + 1} \]
                                  5. *-commutativeN/A

                                    \[\leadsto \frac{e^{a}}{\mathsf{fma}\left(\color{blue}{\left(\frac{1}{2} + \frac{1}{6} \cdot a\right) \cdot a} + 1, a, 1\right) + 1} \]
                                  6. lower-fma.f64N/A

                                    \[\leadsto \frac{e^{a}}{\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(\frac{1}{2} + \frac{1}{6} \cdot a, a, 1\right)}, a, 1\right) + 1} \]
                                  7. +-commutativeN/A

                                    \[\leadsto \frac{e^{a}}{\mathsf{fma}\left(\mathsf{fma}\left(\color{blue}{\frac{1}{6} \cdot a + \frac{1}{2}}, a, 1\right), a, 1\right) + 1} \]
                                  8. lower-fma.f6474.7

                                    \[\leadsto \frac{e^{a}}{\mathsf{fma}\left(\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(0.16666666666666666, a, 0.5\right)}, a, 1\right), a, 1\right) + 1} \]
                                4. Applied rewrites74.7%

                                  \[\leadsto \frac{e^{a}}{\color{blue}{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(0.16666666666666666, a, 0.5\right), a, 1\right), a, 1\right)} + 1} \]
                                5. Taylor expanded in a around 0

                                  \[\leadsto \frac{\color{blue}{1}}{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\frac{1}{6}, a, \frac{1}{2}\right), a, 1\right), a, 1\right) + 1} \]
                                6. Step-by-step derivation
                                  1. Applied rewrites64.4%

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

                                  if 6.9999999999999997e64 < b

                                  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. +-commutativeN/A

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

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

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

                                    \[\leadsto \color{blue}{\frac{1}{e^{b} + 1}} \]
                                  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 rewrites84.4%

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

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

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

                                        \[\leadsto \frac{1}{\left(\left(\frac{1}{6} \cdot b\right) \cdot b\right) \cdot b} \]
                                      3. Step-by-step derivation
                                        1. Applied rewrites84.4%

                                          \[\leadsto \frac{1}{\left(\left(0.16666666666666666 \cdot b\right) \cdot b\right) \cdot b} \]
                                      4. Recombined 2 regimes into one program.
                                      5. Add Preprocessing

                                      Alternative 10: 55.4% accurate, 8.7× speedup?

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

                                        1. Initial program 97.7%

                                          \[\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. +-commutativeN/A

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

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

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

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

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

                                            \[\leadsto 0.5 \]

                                          if -1.25 < b < 7.79999999999999966e153

                                          1. Initial program 100.0%

                                            \[\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. lower-/.f64N/A

                                              \[\leadsto \color{blue}{\frac{1}{\frac{e^{a} + e^{b}}{e^{a}}}} \]
                                            4. lower-/.f64100.0

                                              \[\leadsto \frac{1}{\color{blue}{\frac{e^{a} + e^{b}}{e^{a}}}} \]
                                            5. lift-+.f64N/A

                                              \[\leadsto \frac{1}{\frac{\color{blue}{e^{a} + e^{b}}}{e^{a}}} \]
                                            6. +-commutativeN/A

                                              \[\leadsto \frac{1}{\frac{\color{blue}{e^{b} + e^{a}}}{e^{a}}} \]
                                            7. lower-+.f64100.0

                                              \[\leadsto \frac{1}{\frac{\color{blue}{e^{b} + e^{a}}}{e^{a}}} \]
                                          4. Applied rewrites100.0%

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

                                            \[\leadsto \frac{1}{\color{blue}{1 + \left(\frac{1}{e^{a}} + \frac{b}{e^{a}}\right)}} \]
                                          6. Step-by-step derivation
                                            1. +-commutativeN/A

                                              \[\leadsto \frac{1}{\color{blue}{\left(\frac{1}{e^{a}} + \frac{b}{e^{a}}\right) + 1}} \]
                                            2. *-rgt-identityN/A

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

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

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

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

                                              \[\leadsto \frac{1}{\color{blue}{\mathsf{fma}\left(1 + b, \frac{1}{e^{a}}, 1\right)}} \]
                                            7. +-commutativeN/A

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

                                              \[\leadsto \frac{1}{\mathsf{fma}\left(\color{blue}{b + 1}, \frac{1}{e^{a}}, 1\right)} \]
                                            9. rec-expN/A

                                              \[\leadsto \frac{1}{\mathsf{fma}\left(b + 1, \color{blue}{e^{\mathsf{neg}\left(a\right)}}, 1\right)} \]
                                            10. mul-1-negN/A

                                              \[\leadsto \frac{1}{\mathsf{fma}\left(b + 1, e^{\color{blue}{-1 \cdot a}}, 1\right)} \]
                                            11. lower-exp.f64N/A

                                              \[\leadsto \frac{1}{\mathsf{fma}\left(b + 1, \color{blue}{e^{-1 \cdot a}}, 1\right)} \]
                                            12. mul-1-negN/A

                                              \[\leadsto \frac{1}{\mathsf{fma}\left(b + 1, e^{\color{blue}{\mathsf{neg}\left(a\right)}}, 1\right)} \]
                                            13. lower-neg.f6485.0

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

                                            \[\leadsto \frac{1}{\color{blue}{\mathsf{fma}\left(b + 1, e^{-a}, 1\right)}} \]
                                          8. Taylor expanded in a around 0

                                            \[\leadsto \frac{1}{\mathsf{fma}\left(b + 1, 1 + \color{blue}{-1 \cdot a}, 1\right)} \]
                                          9. Step-by-step derivation
                                            1. Applied rewrites52.6%

                                              \[\leadsto \frac{1}{\mathsf{fma}\left(b + 1, 1 - \color{blue}{a}, 1\right)} \]

                                            if 7.79999999999999966e153 < b

                                            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. +-commutativeN/A

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

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

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

                                              \[\leadsto \color{blue}{\frac{1}{e^{b} + 1}} \]
                                            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 rewrites100.0%

                                                \[\leadsto \frac{1}{\mathsf{fma}\left(\mathsf{fma}\left(0.5, b, 1\right), \color{blue}{b}, 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 rewrites100.0%

                                                  \[\leadsto \frac{1}{\left(b \cdot b\right) \cdot 0.5} \]
                                              4. Recombined 3 regimes into one program.
                                              5. Final simplification53.0%

                                                \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -1.25:\\ \;\;\;\;0.5\\ \mathbf{elif}\;b \leq 7.8 \cdot 10^{+153}:\\ \;\;\;\;\frac{1}{\mathsf{fma}\left(1 + b, 1 - a, 1\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\left(b \cdot b\right) \cdot 0.5}\\ \end{array} \]
                                              6. Add Preprocessing

                                              Alternative 11: 67.1% accurate, 9.5× speedup?

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

                                                1. Initial program 99.5%

                                                  \[\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 rewrites75.6%

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

                                                    \[\leadsto \frac{e^{a}}{\color{blue}{\left(1 + a \cdot \left(1 + a \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot a\right)\right)\right)} + 1} \]
                                                  3. Step-by-step derivation
                                                    1. +-commutativeN/A

                                                      \[\leadsto \frac{e^{a}}{\color{blue}{\left(a \cdot \left(1 + a \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot a\right)\right) + 1\right)} + 1} \]
                                                    2. *-commutativeN/A

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

                                                      \[\leadsto \frac{e^{a}}{\color{blue}{\mathsf{fma}\left(1 + a \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot a\right), a, 1\right)} + 1} \]
                                                    4. +-commutativeN/A

                                                      \[\leadsto \frac{e^{a}}{\mathsf{fma}\left(\color{blue}{a \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot a\right) + 1}, a, 1\right) + 1} \]
                                                    5. *-commutativeN/A

                                                      \[\leadsto \frac{e^{a}}{\mathsf{fma}\left(\color{blue}{\left(\frac{1}{2} + \frac{1}{6} \cdot a\right) \cdot a} + 1, a, 1\right) + 1} \]
                                                    6. lower-fma.f64N/A

                                                      \[\leadsto \frac{e^{a}}{\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(\frac{1}{2} + \frac{1}{6} \cdot a, a, 1\right)}, a, 1\right) + 1} \]
                                                    7. +-commutativeN/A

                                                      \[\leadsto \frac{e^{a}}{\mathsf{fma}\left(\mathsf{fma}\left(\color{blue}{\frac{1}{6} \cdot a + \frac{1}{2}}, a, 1\right), a, 1\right) + 1} \]
                                                    8. lower-fma.f6474.7

                                                      \[\leadsto \frac{e^{a}}{\mathsf{fma}\left(\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(0.16666666666666666, a, 0.5\right)}, a, 1\right), a, 1\right) + 1} \]
                                                  4. Applied rewrites74.7%

                                                    \[\leadsto \frac{e^{a}}{\color{blue}{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(0.16666666666666666, a, 0.5\right), a, 1\right), a, 1\right)} + 1} \]
                                                  5. Taylor expanded in a around 0

                                                    \[\leadsto \frac{\color{blue}{1}}{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\frac{1}{6}, a, \frac{1}{2}\right), a, 1\right), a, 1\right) + 1} \]
                                                  6. Step-by-step derivation
                                                    1. Applied rewrites64.4%

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

                                                      \[\leadsto \frac{1}{\color{blue}{\left(1 + a \cdot \left(1 + \frac{1}{2} \cdot a\right)\right)} + 1} \]
                                                    3. Step-by-step derivation
                                                      1. +-commutativeN/A

                                                        \[\leadsto \frac{1}{\color{blue}{\left(a \cdot \left(1 + \frac{1}{2} \cdot a\right) + 1\right)} + 1} \]
                                                      2. *-commutativeN/A

                                                        \[\leadsto \frac{1}{\left(\color{blue}{\left(1 + \frac{1}{2} \cdot a\right) \cdot a} + 1\right) + 1} \]
                                                      3. lower-fma.f64N/A

                                                        \[\leadsto \frac{1}{\color{blue}{\mathsf{fma}\left(1 + \frac{1}{2} \cdot a, a, 1\right)} + 1} \]
                                                      4. +-commutativeN/A

                                                        \[\leadsto \frac{1}{\mathsf{fma}\left(\color{blue}{\frac{1}{2} \cdot a + 1}, a, 1\right) + 1} \]
                                                      5. lower-fma.f6461.6

                                                        \[\leadsto \frac{1}{\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(0.5, a, 1\right)}, a, 1\right) + 1} \]
                                                    4. Applied rewrites61.6%

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

                                                    if 6.9999999999999997e64 < b

                                                    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. +-commutativeN/A

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

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

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

                                                      \[\leadsto \color{blue}{\frac{1}{e^{b} + 1}} \]
                                                    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 rewrites84.4%

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

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

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

                                                          \[\leadsto \frac{1}{\left(\left(\frac{1}{6} \cdot b\right) \cdot b\right) \cdot b} \]
                                                        3. Step-by-step derivation
                                                          1. Applied rewrites84.4%

                                                            \[\leadsto \frac{1}{\left(\left(0.16666666666666666 \cdot b\right) \cdot b\right) \cdot b} \]
                                                        4. Recombined 2 regimes into one program.
                                                        5. Add Preprocessing

                                                        Alternative 12: 57.5% accurate, 9.5× speedup?

                                                        \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq 7.5 \cdot 10^{+30}:\\ \;\;\;\;\frac{1}{\left(1 + a\right) + 1}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\left(\left(0.16666666666666666 \cdot b\right) \cdot b\right) \cdot b}\\ \end{array} \end{array} \]
                                                        (FPCore (a b)
                                                         :precision binary64
                                                         (if (<= b 7.5e+30)
                                                           (/ 1.0 (+ (+ 1.0 a) 1.0))
                                                           (/ 1.0 (* (* (* 0.16666666666666666 b) b) b))))
                                                        double code(double a, double b) {
                                                        	double tmp;
                                                        	if (b <= 7.5e+30) {
                                                        		tmp = 1.0 / ((1.0 + a) + 1.0);
                                                        	} else {
                                                        		tmp = 1.0 / (((0.16666666666666666 * b) * b) * b);
                                                        	}
                                                        	return tmp;
                                                        }
                                                        
                                                        real(8) function code(a, b)
                                                            real(8), intent (in) :: a
                                                            real(8), intent (in) :: b
                                                            real(8) :: tmp
                                                            if (b <= 7.5d+30) then
                                                                tmp = 1.0d0 / ((1.0d0 + a) + 1.0d0)
                                                            else
                                                                tmp = 1.0d0 / (((0.16666666666666666d0 * b) * b) * b)
                                                            end if
                                                            code = tmp
                                                        end function
                                                        
                                                        public static double code(double a, double b) {
                                                        	double tmp;
                                                        	if (b <= 7.5e+30) {
                                                        		tmp = 1.0 / ((1.0 + a) + 1.0);
                                                        	} else {
                                                        		tmp = 1.0 / (((0.16666666666666666 * b) * b) * b);
                                                        	}
                                                        	return tmp;
                                                        }
                                                        
                                                        def code(a, b):
                                                        	tmp = 0
                                                        	if b <= 7.5e+30:
                                                        		tmp = 1.0 / ((1.0 + a) + 1.0)
                                                        	else:
                                                        		tmp = 1.0 / (((0.16666666666666666 * b) * b) * b)
                                                        	return tmp
                                                        
                                                        function code(a, b)
                                                        	tmp = 0.0
                                                        	if (b <= 7.5e+30)
                                                        		tmp = Float64(1.0 / Float64(Float64(1.0 + a) + 1.0));
                                                        	else
                                                        		tmp = Float64(1.0 / Float64(Float64(Float64(0.16666666666666666 * b) * b) * b));
                                                        	end
                                                        	return tmp
                                                        end
                                                        
                                                        function tmp_2 = code(a, b)
                                                        	tmp = 0.0;
                                                        	if (b <= 7.5e+30)
                                                        		tmp = 1.0 / ((1.0 + a) + 1.0);
                                                        	else
                                                        		tmp = 1.0 / (((0.16666666666666666 * b) * b) * b);
                                                        	end
                                                        	tmp_2 = tmp;
                                                        end
                                                        
                                                        code[a_, b_] := If[LessEqual[b, 7.5e+30], N[(1.0 / N[(N[(1.0 + a), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(N[(N[(0.16666666666666666 * b), $MachinePrecision] * b), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]]
                                                        
                                                        \begin{array}{l}
                                                        
                                                        \\
                                                        \begin{array}{l}
                                                        \mathbf{if}\;b \leq 7.5 \cdot 10^{+30}:\\
                                                        \;\;\;\;\frac{1}{\left(1 + a\right) + 1}\\
                                                        
                                                        \mathbf{else}:\\
                                                        \;\;\;\;\frac{1}{\left(\left(0.16666666666666666 \cdot b\right) \cdot b\right) \cdot b}\\
                                                        
                                                        
                                                        \end{array}
                                                        \end{array}
                                                        
                                                        Derivation
                                                        1. Split input into 2 regimes
                                                        2. if b < 7.49999999999999973e30

                                                          1. Initial program 99.5%

                                                            \[\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 rewrites77.2%

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

                                                              \[\leadsto \frac{e^{a}}{\color{blue}{\left(1 + a \cdot \left(1 + a \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot a\right)\right)\right)} + 1} \]
                                                            3. Step-by-step derivation
                                                              1. +-commutativeN/A

                                                                \[\leadsto \frac{e^{a}}{\color{blue}{\left(a \cdot \left(1 + a \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot a\right)\right) + 1\right)} + 1} \]
                                                              2. *-commutativeN/A

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

                                                                \[\leadsto \frac{e^{a}}{\color{blue}{\mathsf{fma}\left(1 + a \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot a\right), a, 1\right)} + 1} \]
                                                              4. +-commutativeN/A

                                                                \[\leadsto \frac{e^{a}}{\mathsf{fma}\left(\color{blue}{a \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot a\right) + 1}, a, 1\right) + 1} \]
                                                              5. *-commutativeN/A

                                                                \[\leadsto \frac{e^{a}}{\mathsf{fma}\left(\color{blue}{\left(\frac{1}{2} + \frac{1}{6} \cdot a\right) \cdot a} + 1, a, 1\right) + 1} \]
                                                              6. lower-fma.f64N/A

                                                                \[\leadsto \frac{e^{a}}{\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(\frac{1}{2} + \frac{1}{6} \cdot a, a, 1\right)}, a, 1\right) + 1} \]
                                                              7. +-commutativeN/A

                                                                \[\leadsto \frac{e^{a}}{\mathsf{fma}\left(\mathsf{fma}\left(\color{blue}{\frac{1}{6} \cdot a + \frac{1}{2}}, a, 1\right), a, 1\right) + 1} \]
                                                              8. lower-fma.f6476.3

                                                                \[\leadsto \frac{e^{a}}{\mathsf{fma}\left(\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(0.16666666666666666, a, 0.5\right)}, a, 1\right), a, 1\right) + 1} \]
                                                            4. Applied rewrites76.3%

                                                              \[\leadsto \frac{e^{a}}{\color{blue}{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(0.16666666666666666, a, 0.5\right), a, 1\right), a, 1\right)} + 1} \]
                                                            5. Taylor expanded in a around 0

                                                              \[\leadsto \frac{\color{blue}{1}}{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\frac{1}{6}, a, \frac{1}{2}\right), a, 1\right), a, 1\right) + 1} \]
                                                            6. Step-by-step derivation
                                                              1. Applied rewrites66.1%

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

                                                                \[\leadsto \frac{1}{\color{blue}{\left(1 + a\right)} + 1} \]
                                                              3. Step-by-step derivation
                                                                1. lower-+.f6448.7

                                                                  \[\leadsto \frac{1}{\color{blue}{\left(1 + a\right)} + 1} \]
                                                              4. Applied rewrites48.7%

                                                                \[\leadsto \frac{1}{\color{blue}{\left(1 + a\right)} + 1} \]

                                                              if 7.49999999999999973e30 < b

                                                              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. +-commutativeN/A

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

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

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

                                                                \[\leadsto \color{blue}{\frac{1}{e^{b} + 1}} \]
                                                              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 rewrites75.2%

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

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

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

                                                                    \[\leadsto \frac{1}{\left(\left(\frac{1}{6} \cdot b\right) \cdot b\right) \cdot b} \]
                                                                  3. Step-by-step derivation
                                                                    1. Applied rewrites75.2%

                                                                      \[\leadsto \frac{1}{\left(\left(0.16666666666666666 \cdot b\right) \cdot b\right) \cdot b} \]
                                                                  4. Recombined 2 regimes into one program.
                                                                  5. Add Preprocessing

                                                                  Alternative 13: 53.5% accurate, 11.2× speedup?

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

                                                                    1. Initial program 99.5%

                                                                      \[\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 rewrites77.3%

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

                                                                        \[\leadsto \frac{e^{a}}{\color{blue}{\left(1 + a \cdot \left(1 + a \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot a\right)\right)\right)} + 1} \]
                                                                      3. Step-by-step derivation
                                                                        1. +-commutativeN/A

                                                                          \[\leadsto \frac{e^{a}}{\color{blue}{\left(a \cdot \left(1 + a \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot a\right)\right) + 1\right)} + 1} \]
                                                                        2. *-commutativeN/A

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

                                                                          \[\leadsto \frac{e^{a}}{\color{blue}{\mathsf{fma}\left(1 + a \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot a\right), a, 1\right)} + 1} \]
                                                                        4. +-commutativeN/A

                                                                          \[\leadsto \frac{e^{a}}{\mathsf{fma}\left(\color{blue}{a \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot a\right) + 1}, a, 1\right) + 1} \]
                                                                        5. *-commutativeN/A

                                                                          \[\leadsto \frac{e^{a}}{\mathsf{fma}\left(\color{blue}{\left(\frac{1}{2} + \frac{1}{6} \cdot a\right) \cdot a} + 1, a, 1\right) + 1} \]
                                                                        6. lower-fma.f64N/A

                                                                          \[\leadsto \frac{e^{a}}{\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(\frac{1}{2} + \frac{1}{6} \cdot a, a, 1\right)}, a, 1\right) + 1} \]
                                                                        7. +-commutativeN/A

                                                                          \[\leadsto \frac{e^{a}}{\mathsf{fma}\left(\mathsf{fma}\left(\color{blue}{\frac{1}{6} \cdot a + \frac{1}{2}}, a, 1\right), a, 1\right) + 1} \]
                                                                        8. lower-fma.f6476.4

                                                                          \[\leadsto \frac{e^{a}}{\mathsf{fma}\left(\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(0.16666666666666666, a, 0.5\right)}, a, 1\right), a, 1\right) + 1} \]
                                                                      4. Applied rewrites76.4%

                                                                        \[\leadsto \frac{e^{a}}{\color{blue}{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(0.16666666666666666, a, 0.5\right), a, 1\right), a, 1\right)} + 1} \]
                                                                      5. Taylor expanded in a around 0

                                                                        \[\leadsto \frac{\color{blue}{1}}{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\frac{1}{6}, a, \frac{1}{2}\right), a, 1\right), a, 1\right) + 1} \]
                                                                      6. Step-by-step derivation
                                                                        1. Applied rewrites65.8%

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

                                                                          \[\leadsto \frac{1}{\color{blue}{\left(1 + a\right)} + 1} \]
                                                                        3. Step-by-step derivation
                                                                          1. lower-+.f6448.4

                                                                            \[\leadsto \frac{1}{\color{blue}{\left(1 + a\right)} + 1} \]
                                                                        4. Applied rewrites48.4%

                                                                          \[\leadsto \frac{1}{\color{blue}{\left(1 + a\right)} + 1} \]

                                                                        if 2.2000000000000001e37 < b

                                                                        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. +-commutativeN/A

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

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

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

                                                                          \[\leadsto \color{blue}{\frac{1}{e^{b} + 1}} \]
                                                                        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 rewrites58.0%

                                                                            \[\leadsto \frac{1}{\mathsf{fma}\left(\mathsf{fma}\left(0.5, b, 1\right), \color{blue}{b}, 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 rewrites58.0%

                                                                              \[\leadsto \frac{1}{\left(b \cdot b\right) \cdot 0.5} \]
                                                                          4. Recombined 2 regimes into one program.
                                                                          5. Add Preprocessing

                                                                          Alternative 14: 39.9% accurate, 17.5× speedup?

                                                                          \[\begin{array}{l} \\ \frac{1}{\left(1 + a\right) + 1} \end{array} \]
                                                                          (FPCore (a b) :precision binary64 (/ 1.0 (+ (+ 1.0 a) 1.0)))
                                                                          double code(double a, double b) {
                                                                          	return 1.0 / ((1.0 + a) + 1.0);
                                                                          }
                                                                          
                                                                          real(8) function code(a, b)
                                                                              real(8), intent (in) :: a
                                                                              real(8), intent (in) :: b
                                                                              code = 1.0d0 / ((1.0d0 + a) + 1.0d0)
                                                                          end function
                                                                          
                                                                          public static double code(double a, double b) {
                                                                          	return 1.0 / ((1.0 + a) + 1.0);
                                                                          }
                                                                          
                                                                          def code(a, b):
                                                                          	return 1.0 / ((1.0 + a) + 1.0)
                                                                          
                                                                          function code(a, b)
                                                                          	return Float64(1.0 / Float64(Float64(1.0 + a) + 1.0))
                                                                          end
                                                                          
                                                                          function tmp = code(a, b)
                                                                          	tmp = 1.0 / ((1.0 + a) + 1.0);
                                                                          end
                                                                          
                                                                          code[a_, b_] := N[(1.0 / N[(N[(1.0 + a), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]
                                                                          
                                                                          \begin{array}{l}
                                                                          
                                                                          \\
                                                                          \frac{1}{\left(1 + a\right) + 1}
                                                                          \end{array}
                                                                          
                                                                          Derivation
                                                                          1. Initial program 99.6%

                                                                            \[\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 rewrites66.0%

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

                                                                              \[\leadsto \frac{e^{a}}{\color{blue}{\left(1 + a \cdot \left(1 + a \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot a\right)\right)\right)} + 1} \]
                                                                            3. Step-by-step derivation
                                                                              1. +-commutativeN/A

                                                                                \[\leadsto \frac{e^{a}}{\color{blue}{\left(a \cdot \left(1 + a \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot a\right)\right) + 1\right)} + 1} \]
                                                                              2. *-commutativeN/A

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

                                                                                \[\leadsto \frac{e^{a}}{\color{blue}{\mathsf{fma}\left(1 + a \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot a\right), a, 1\right)} + 1} \]
                                                                              4. +-commutativeN/A

                                                                                \[\leadsto \frac{e^{a}}{\mathsf{fma}\left(\color{blue}{a \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot a\right) + 1}, a, 1\right) + 1} \]
                                                                              5. *-commutativeN/A

                                                                                \[\leadsto \frac{e^{a}}{\mathsf{fma}\left(\color{blue}{\left(\frac{1}{2} + \frac{1}{6} \cdot a\right) \cdot a} + 1, a, 1\right) + 1} \]
                                                                              6. lower-fma.f64N/A

                                                                                \[\leadsto \frac{e^{a}}{\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(\frac{1}{2} + \frac{1}{6} \cdot a, a, 1\right)}, a, 1\right) + 1} \]
                                                                              7. +-commutativeN/A

                                                                                \[\leadsto \frac{e^{a}}{\mathsf{fma}\left(\mathsf{fma}\left(\color{blue}{\frac{1}{6} \cdot a + \frac{1}{2}}, a, 1\right), a, 1\right) + 1} \]
                                                                              8. lower-fma.f6465.3

                                                                                \[\leadsto \frac{e^{a}}{\mathsf{fma}\left(\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(0.16666666666666666, a, 0.5\right)}, a, 1\right), a, 1\right) + 1} \]
                                                                            4. Applied rewrites65.3%

                                                                              \[\leadsto \frac{e^{a}}{\color{blue}{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(0.16666666666666666, a, 0.5\right), a, 1\right), a, 1\right)} + 1} \]
                                                                            5. Taylor expanded in a around 0

                                                                              \[\leadsto \frac{\color{blue}{1}}{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\frac{1}{6}, a, \frac{1}{2}\right), a, 1\right), a, 1\right) + 1} \]
                                                                            6. Step-by-step derivation
                                                                              1. Applied rewrites54.6%

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

                                                                                \[\leadsto \frac{1}{\color{blue}{\left(1 + a\right)} + 1} \]
                                                                              3. Step-by-step derivation
                                                                                1. lower-+.f6437.9

                                                                                  \[\leadsto \frac{1}{\color{blue}{\left(1 + a\right)} + 1} \]
                                                                              4. Applied rewrites37.9%

                                                                                \[\leadsto \frac{1}{\color{blue}{\left(1 + a\right)} + 1} \]
                                                                              5. Add Preprocessing

                                                                              Alternative 15: 39.4% 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 99.6%

                                                                                \[\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. +-commutativeN/A

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

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

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

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

                                                                                \[\leadsto \frac{1}{2} \]
                                                                              7. Step-by-step derivation
                                                                                1. Applied rewrites37.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 2024278 
                                                                                (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))))