Quotient of sum of exps

Percentage Accurate: 98.9% → 99.0%
Time: 9.2s
Alternatives: 21
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 21 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: 98.9% 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.0% accurate, 0.8× speedup?

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

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

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

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

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

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

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

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

      \[\leadsto \mathsf{exp.f64}\left(\left(\log \left(e^{a} + e^{b}\right) \cdot -1 + a\right)\right) \]
    7. +-lowering-+.f64N/A

      \[\leadsto \mathsf{exp.f64}\left(\mathsf{+.f64}\left(\left(\log \left(e^{a} + e^{b}\right) \cdot -1\right), a\right)\right) \]
    8. *-lowering-*.f64N/A

      \[\leadsto \mathsf{exp.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\log \left(e^{a} + e^{b}\right), -1\right), a\right)\right) \]
    9. log-lowering-log.f64N/A

      \[\leadsto \mathsf{exp.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{log.f64}\left(\left(e^{a} + e^{b}\right)\right), -1\right), a\right)\right) \]
    10. +-lowering-+.f64N/A

      \[\leadsto \mathsf{exp.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(\left(e^{a}\right), \left(e^{b}\right)\right)\right), -1\right), a\right)\right) \]
    11. exp-lowering-exp.f64N/A

      \[\leadsto \mathsf{exp.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(a\right), \left(e^{b}\right)\right)\right), -1\right), a\right)\right) \]
    12. exp-lowering-exp.f6499.6%

      \[\leadsto \mathsf{exp.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(a\right), \mathsf{exp.f64}\left(b\right)\right)\right), -1\right), a\right)\right) \]
  4. Applied egg-rr99.6%

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

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

Alternative 2: 98.3% accurate, 1.0× speedup?

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

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

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


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

    1. Initial program 98.8%

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

      \[\leadsto \mathsf{/.f64}\left(\mathsf{exp.f64}\left(a\right), \mathsf{+.f64}\left(\mathsf{exp.f64}\left(a\right), \color{blue}{1}\right)\right) \]
    4. Step-by-step derivation
      1. Simplified98.8%

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

      if 0.99999999995 < (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. /-lowering-/.f64N/A

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

          \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \color{blue}{\left(e^{b}\right)}\right)\right) \]
        3. exp-lowering-exp.f6499.7%

          \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(b\right)\right)\right) \]
      5. Simplified99.7%

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

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

    Alternative 3: 98.9% accurate, 1.0× speedup?

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{exp.f64}\left(a\right), \mathsf{+.f64}\left(\left({\left(e^{a}\right)}^{1}\right), \mathsf{exp.f64}\left(\color{blue}{b}\right)\right)\right) \]
      2. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{exp.f64}\left(a\right), \mathsf{+.f64}\left(\left({\left(e^{a}\right)}^{\left(-1 \cdot -1\right)}\right), \mathsf{exp.f64}\left(b\right)\right)\right) \]
      3. pow-powN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{exp.f64}\left(a\right), \mathsf{+.f64}\left(\left({\left({\left(e^{a}\right)}^{-1}\right)}^{-1}\right), \mathsf{exp.f64}\left(\color{blue}{b}\right)\right)\right) \]
      4. inv-powN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{exp.f64}\left(a\right), \mathsf{+.f64}\left(\left({\left(\frac{1}{e^{a}}\right)}^{-1}\right), \mathsf{exp.f64}\left(b\right)\right)\right) \]
      5. unpow-1N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{exp.f64}\left(a\right), \mathsf{+.f64}\left(\left(\frac{1}{\frac{1}{e^{a}}}\right), \mathsf{exp.f64}\left(\color{blue}{b}\right)\right)\right) \]
      6. /-lowering-/.f64N/A

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{exp.f64}\left(a\right), \mathsf{+.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(1, \left(e^{a}\right)\right)\right), \mathsf{exp.f64}\left(b\right)\right)\right) \]
      8. exp-lowering-exp.f6499.2%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{exp.f64}\left(a\right), \mathsf{+.f64}\left(\mathsf{/.f64}\left(1, \mathsf{/.f64}\left(1, \mathsf{exp.f64}\left(a\right)\right)\right), \mathsf{exp.f64}\left(b\right)\right)\right) \]
    4. Applied egg-rr99.2%

      \[\leadsto \frac{e^{a}}{\color{blue}{\frac{1}{\frac{1}{e^{a}}}} + e^{b}} \]
    5. Final simplification99.2%

      \[\leadsto \frac{e^{a}}{e^{b} + \frac{1}{\frac{1}{e^{a}}}} \]
    6. Add Preprocessing

    Alternative 4: 98.9% 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.2%

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

    Alternative 5: 98.3% accurate, 2.8× speedup?

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

      1. Initial program 100.0%

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

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

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

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

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

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

          \[\leadsto \mathsf{exp.f64}\left(\left(\log \left(e^{a} + e^{b}\right) \cdot -1 + a\right)\right) \]
        7. +-lowering-+.f64N/A

          \[\leadsto \mathsf{exp.f64}\left(\mathsf{+.f64}\left(\left(\log \left(e^{a} + e^{b}\right) \cdot -1\right), a\right)\right) \]
        8. *-lowering-*.f64N/A

          \[\leadsto \mathsf{exp.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\log \left(e^{a} + e^{b}\right), -1\right), a\right)\right) \]
        9. log-lowering-log.f64N/A

          \[\leadsto \mathsf{exp.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{log.f64}\left(\left(e^{a} + e^{b}\right)\right), -1\right), a\right)\right) \]
        10. +-lowering-+.f64N/A

          \[\leadsto \mathsf{exp.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(\left(e^{a}\right), \left(e^{b}\right)\right)\right), -1\right), a\right)\right) \]
        11. exp-lowering-exp.f64N/A

          \[\leadsto \mathsf{exp.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(a\right), \left(e^{b}\right)\right)\right), -1\right), a\right)\right) \]
        12. exp-lowering-exp.f64100.0%

          \[\leadsto \mathsf{exp.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(a\right), \mathsf{exp.f64}\left(b\right)\right)\right), -1\right), a\right)\right) \]
      4. Applied egg-rr100.0%

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

        \[\leadsto \mathsf{exp.f64}\left(\color{blue}{a}\right) \]
      6. Step-by-step derivation
        1. Simplified100.0%

          \[\leadsto e^{\color{blue}{a}} \]

        if -7.5e7 < a

        1. Initial program 98.9%

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

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

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

            \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \color{blue}{\left(e^{b}\right)}\right)\right) \]
          3. exp-lowering-exp.f6499.0%

            \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(b\right)\right)\right) \]
        5. Simplified99.0%

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

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

      Alternative 6: 76.5% accurate, 2.9× speedup?

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

        1. Initial program 98.8%

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

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

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

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

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

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

            \[\leadsto \mathsf{exp.f64}\left(\left(\log \left(e^{a} + e^{b}\right) \cdot -1 + a\right)\right) \]
          7. +-lowering-+.f64N/A

            \[\leadsto \mathsf{exp.f64}\left(\mathsf{+.f64}\left(\left(\log \left(e^{a} + e^{b}\right) \cdot -1\right), a\right)\right) \]
          8. *-lowering-*.f64N/A

            \[\leadsto \mathsf{exp.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\log \left(e^{a} + e^{b}\right), -1\right), a\right)\right) \]
          9. log-lowering-log.f64N/A

            \[\leadsto \mathsf{exp.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{log.f64}\left(\left(e^{a} + e^{b}\right)\right), -1\right), a\right)\right) \]
          10. +-lowering-+.f64N/A

            \[\leadsto \mathsf{exp.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(\left(e^{a}\right), \left(e^{b}\right)\right)\right), -1\right), a\right)\right) \]
          11. exp-lowering-exp.f64N/A

            \[\leadsto \mathsf{exp.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(a\right), \left(e^{b}\right)\right)\right), -1\right), a\right)\right) \]
          12. exp-lowering-exp.f6498.9%

            \[\leadsto \mathsf{exp.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(a\right), \mathsf{exp.f64}\left(b\right)\right)\right), -1\right), a\right)\right) \]
        4. Applied egg-rr98.9%

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

          \[\leadsto \mathsf{exp.f64}\left(\color{blue}{a}\right) \]
        6. Step-by-step derivation
          1. Simplified96.9%

            \[\leadsto e^{\color{blue}{a}} \]

          if -5.09999999999999973e-36 < 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. /-lowering-/.f64N/A

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

              \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \color{blue}{\left(e^{b}\right)}\right)\right) \]
            3. exp-lowering-exp.f6499.7%

              \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(b\right)\right)\right) \]
          5. Simplified99.7%

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

            \[\leadsto \mathsf{/.f64}\left(1, \color{blue}{\left(2 + b \cdot \left(1 + b \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot b\right)\right)\right)}\right) \]
          7. Step-by-step derivation
            1. +-lowering-+.f64N/A

              \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \color{blue}{\left(b \cdot \left(1 + b \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot b\right)\right)\right)}\right)\right) \]
            2. *-lowering-*.f64N/A

              \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \color{blue}{\left(1 + b \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot b\right)\right)}\right)\right)\right) \]
            3. +-lowering-+.f64N/A

              \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(1, \color{blue}{\left(b \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot b\right)\right)}\right)\right)\right)\right) \]
            4. *-lowering-*.f64N/A

              \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(b, \color{blue}{\left(\frac{1}{2} + \frac{1}{6} \cdot b\right)}\right)\right)\right)\right)\right) \]
            5. +-lowering-+.f64N/A

              \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(\frac{1}{2}, \color{blue}{\left(\frac{1}{6} \cdot b\right)}\right)\right)\right)\right)\right)\right) \]
            6. *-commutativeN/A

              \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(\frac{1}{2}, \left(b \cdot \color{blue}{\frac{1}{6}}\right)\right)\right)\right)\right)\right)\right) \]
            7. *-lowering-*.f6467.8%

              \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(b, \color{blue}{\frac{1}{6}}\right)\right)\right)\right)\right)\right)\right) \]
          8. Simplified67.8%

            \[\leadsto \frac{1}{\color{blue}{2 + b \cdot \left(1 + b \cdot \left(0.5 + b \cdot 0.16666666666666666\right)\right)}} \]
          9. Step-by-step derivation
            1. *-commutativeN/A

              \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(1, \left(\left(\frac{1}{2} + b \cdot \frac{1}{6}\right) \cdot \color{blue}{b}\right)\right)\right)\right)\right) \]
            2. flip-+N/A

              \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(1, \left(\frac{\frac{1}{2} \cdot \frac{1}{2} - \left(b \cdot \frac{1}{6}\right) \cdot \left(b \cdot \frac{1}{6}\right)}{\frac{1}{2} - b \cdot \frac{1}{6}} \cdot b\right)\right)\right)\right)\right) \]
            3. associate-*l/N/A

              \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(1, \left(\frac{\left(\frac{1}{2} \cdot \frac{1}{2} - \left(b \cdot \frac{1}{6}\right) \cdot \left(b \cdot \frac{1}{6}\right)\right) \cdot b}{\color{blue}{\frac{1}{2} - b \cdot \frac{1}{6}}}\right)\right)\right)\right)\right) \]
            4. div-invN/A

              \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(1, \left(\left(\left(\frac{1}{2} \cdot \frac{1}{2} - \left(b \cdot \frac{1}{6}\right) \cdot \left(b \cdot \frac{1}{6}\right)\right) \cdot b\right) \cdot \color{blue}{\frac{1}{\frac{1}{2} - b \cdot \frac{1}{6}}}\right)\right)\right)\right)\right) \]
            5. *-lowering-*.f64N/A

              \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\left(\left(\frac{1}{2} \cdot \frac{1}{2} - \left(b \cdot \frac{1}{6}\right) \cdot \left(b \cdot \frac{1}{6}\right)\right) \cdot b\right), \color{blue}{\left(\frac{1}{\frac{1}{2} - b \cdot \frac{1}{6}}\right)}\right)\right)\right)\right)\right) \]
            6. *-lowering-*.f64N/A

              \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(\frac{1}{2} \cdot \frac{1}{2} - \left(b \cdot \frac{1}{6}\right) \cdot \left(b \cdot \frac{1}{6}\right)\right), b\right), \left(\frac{\color{blue}{1}}{\frac{1}{2} - b \cdot \frac{1}{6}}\right)\right)\right)\right)\right)\right) \]
            7. --lowering--.f64N/A

              \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(\left(\frac{1}{2} \cdot \frac{1}{2}\right), \left(\left(b \cdot \frac{1}{6}\right) \cdot \left(b \cdot \frac{1}{6}\right)\right)\right), b\right), \left(\frac{1}{\frac{1}{2} - b \cdot \frac{1}{6}}\right)\right)\right)\right)\right)\right) \]
            8. metadata-evalN/A

              \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(\frac{1}{4}, \left(\left(b \cdot \frac{1}{6}\right) \cdot \left(b \cdot \frac{1}{6}\right)\right)\right), b\right), \left(\frac{1}{\frac{1}{2} - b \cdot \frac{1}{6}}\right)\right)\right)\right)\right)\right) \]
            9. swap-sqrN/A

              \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(\frac{1}{4}, \left(\left(b \cdot b\right) \cdot \left(\frac{1}{6} \cdot \frac{1}{6}\right)\right)\right), b\right), \left(\frac{1}{\frac{1}{2} - b \cdot \frac{1}{6}}\right)\right)\right)\right)\right)\right) \]
            10. *-lowering-*.f64N/A

              \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(\frac{1}{4}, \mathsf{*.f64}\left(\left(b \cdot b\right), \left(\frac{1}{6} \cdot \frac{1}{6}\right)\right)\right), b\right), \left(\frac{1}{\frac{1}{2} - b \cdot \frac{1}{6}}\right)\right)\right)\right)\right)\right) \]
            11. *-lowering-*.f64N/A

              \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(\frac{1}{4}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(\frac{1}{6} \cdot \frac{1}{6}\right)\right)\right), b\right), \left(\frac{1}{\frac{1}{2} - b \cdot \frac{1}{6}}\right)\right)\right)\right)\right)\right) \]
            12. metadata-evalN/A

              \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(\frac{1}{4}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\right), \frac{1}{36}\right)\right), b\right), \left(\frac{1}{\frac{1}{2} - b \cdot \frac{1}{6}}\right)\right)\right)\right)\right)\right) \]
            13. /-lowering-/.f64N/A

              \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(\frac{1}{4}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\right), \frac{1}{36}\right)\right), b\right), \mathsf{/.f64}\left(1, \color{blue}{\left(\frac{1}{2} - b \cdot \frac{1}{6}\right)}\right)\right)\right)\right)\right)\right) \]
            14. --lowering--.f64N/A

              \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(\frac{1}{4}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\right), \frac{1}{36}\right)\right), b\right), \mathsf{/.f64}\left(1, \mathsf{\_.f64}\left(\frac{1}{2}, \color{blue}{\left(b \cdot \frac{1}{6}\right)}\right)\right)\right)\right)\right)\right)\right) \]
            15. *-lowering-*.f6467.8%

              \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(\frac{1}{4}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\right), \frac{1}{36}\right)\right), b\right), \mathsf{/.f64}\left(1, \mathsf{\_.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(b, \color{blue}{\frac{1}{6}}\right)\right)\right)\right)\right)\right)\right)\right) \]
          10. Applied egg-rr67.8%

            \[\leadsto \frac{1}{2 + b \cdot \left(1 + \color{blue}{\left(\left(0.25 - \left(b \cdot b\right) \cdot 0.027777777777777776\right) \cdot b\right) \cdot \frac{1}{0.5 - b \cdot 0.16666666666666666}}\right)} \]
          11. Taylor expanded in b around 0

            \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(\frac{1}{4}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\right), \frac{1}{36}\right)\right), b\right), \color{blue}{\left(2 + b \cdot \left(\frac{2}{3} + b \cdot \left(\frac{2}{9} + \frac{2}{27} \cdot b\right)\right)\right)}\right)\right)\right)\right)\right) \]
          12. Step-by-step derivation
            1. +-lowering-+.f64N/A

              \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(\frac{1}{4}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\right), \frac{1}{36}\right)\right), b\right), \mathsf{+.f64}\left(2, \color{blue}{\left(b \cdot \left(\frac{2}{3} + b \cdot \left(\frac{2}{9} + \frac{2}{27} \cdot b\right)\right)\right)}\right)\right)\right)\right)\right)\right) \]
            2. *-lowering-*.f64N/A

              \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(\frac{1}{4}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\right), \frac{1}{36}\right)\right), b\right), \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \color{blue}{\left(\frac{2}{3} + b \cdot \left(\frac{2}{9} + \frac{2}{27} \cdot b\right)\right)}\right)\right)\right)\right)\right)\right)\right) \]
            3. +-lowering-+.f64N/A

              \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(\frac{1}{4}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\right), \frac{1}{36}\right)\right), b\right), \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(\frac{2}{3}, \color{blue}{\left(b \cdot \left(\frac{2}{9} + \frac{2}{27} \cdot b\right)\right)}\right)\right)\right)\right)\right)\right)\right)\right) \]
            4. *-lowering-*.f64N/A

              \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(\frac{1}{4}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\right), \frac{1}{36}\right)\right), b\right), \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(\frac{2}{3}, \mathsf{*.f64}\left(b, \color{blue}{\left(\frac{2}{9} + \frac{2}{27} \cdot b\right)}\right)\right)\right)\right)\right)\right)\right)\right)\right) \]
            5. +-lowering-+.f64N/A

              \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(\frac{1}{4}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\right), \frac{1}{36}\right)\right), b\right), \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(\frac{2}{3}, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(\frac{2}{9}, \color{blue}{\left(\frac{2}{27} \cdot b\right)}\right)\right)\right)\right)\right)\right)\right)\right)\right)\right) \]
            6. *-commutativeN/A

              \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(\frac{1}{4}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\right), \frac{1}{36}\right)\right), b\right), \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(\frac{2}{3}, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(\frac{2}{9}, \left(b \cdot \color{blue}{\frac{2}{27}}\right)\right)\right)\right)\right)\right)\right)\right)\right)\right)\right) \]
            7. *-lowering-*.f6473.9%

              \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(\frac{1}{4}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\right), \frac{1}{36}\right)\right), b\right), \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(\frac{2}{3}, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(\frac{2}{9}, \mathsf{*.f64}\left(b, \color{blue}{\frac{2}{27}}\right)\right)\right)\right)\right)\right)\right)\right)\right)\right)\right) \]
          13. Simplified73.9%

            \[\leadsto \frac{1}{2 + b \cdot \left(1 + \left(\left(0.25 - \left(b \cdot b\right) \cdot 0.027777777777777776\right) \cdot b\right) \cdot \color{blue}{\left(2 + b \cdot \left(0.6666666666666666 + b \cdot \left(0.2222222222222222 + b \cdot 0.07407407407407407\right)\right)\right)}\right)} \]
        7. Recombined 2 regimes into one program.
        8. Final simplification81.8%

          \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -5.1 \cdot 10^{-36}:\\ \;\;\;\;e^{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{2 + b \cdot \left(1 + \left(b \cdot \left(0.25 - \left(b \cdot b\right) \cdot 0.027777777777777776\right)\right) \cdot \left(2 + b \cdot \left(0.6666666666666666 + b \cdot \left(0.2222222222222222 + b \cdot 0.07407407407407407\right)\right)\right)\right)}\\ \end{array} \]
        9. Add Preprocessing

        Alternative 7: 70.2% accurate, 6.3× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} t_0 := b \cdot \left(0.25 - \left(b \cdot b\right) \cdot 0.027777777777777776\right)\\ \mathbf{if}\;b \leq -1.1:\\ \;\;\;\;1\\ \mathbf{elif}\;b \leq -4.3 \cdot 10^{-72}:\\ \;\;\;\;0.5\\ \mathbf{elif}\;b \leq -1.6 \cdot 10^{-289}:\\ \;\;\;\;\frac{1}{2 + b \cdot \left(1 + t\_0 \cdot \frac{-6 + \frac{-18 - \frac{54 + \frac{162}{b}}{b}}{b}}{b}\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{2 + b \cdot \left(1 + t\_0 \cdot \left(2 + b \cdot \left(0.6666666666666666 + b \cdot \left(0.2222222222222222 + b \cdot 0.07407407407407407\right)\right)\right)\right)}\\ \end{array} \end{array} \]
        (FPCore (a b)
         :precision binary64
         (let* ((t_0 (* b (- 0.25 (* (* b b) 0.027777777777777776)))))
           (if (<= b -1.1)
             1.0
             (if (<= b -4.3e-72)
               0.5
               (if (<= b -1.6e-289)
                 (/
                  1.0
                  (+
                   2.0
                   (*
                    b
                    (+
                     1.0
                     (*
                      t_0
                      (/ (+ -6.0 (/ (- -18.0 (/ (+ 54.0 (/ 162.0 b)) b)) b)) b))))))
                 (/
                  1.0
                  (+
                   2.0
                   (*
                    b
                    (+
                     1.0
                     (*
                      t_0
                      (+
                       2.0
                       (*
                        b
                        (+
                         0.6666666666666666
                         (*
                          b
                          (+
                           0.2222222222222222
                           (* b 0.07407407407407407))))))))))))))))
        double code(double a, double b) {
        	double t_0 = b * (0.25 - ((b * b) * 0.027777777777777776));
        	double tmp;
        	if (b <= -1.1) {
        		tmp = 1.0;
        	} else if (b <= -4.3e-72) {
        		tmp = 0.5;
        	} else if (b <= -1.6e-289) {
        		tmp = 1.0 / (2.0 + (b * (1.0 + (t_0 * ((-6.0 + ((-18.0 - ((54.0 + (162.0 / b)) / b)) / b)) / b)))));
        	} else {
        		tmp = 1.0 / (2.0 + (b * (1.0 + (t_0 * (2.0 + (b * (0.6666666666666666 + (b * (0.2222222222222222 + (b * 0.07407407407407407))))))))));
        	}
        	return tmp;
        }
        
        real(8) function code(a, b)
            real(8), intent (in) :: a
            real(8), intent (in) :: b
            real(8) :: t_0
            real(8) :: tmp
            t_0 = b * (0.25d0 - ((b * b) * 0.027777777777777776d0))
            if (b <= (-1.1d0)) then
                tmp = 1.0d0
            else if (b <= (-4.3d-72)) then
                tmp = 0.5d0
            else if (b <= (-1.6d-289)) then
                tmp = 1.0d0 / (2.0d0 + (b * (1.0d0 + (t_0 * (((-6.0d0) + (((-18.0d0) - ((54.0d0 + (162.0d0 / b)) / b)) / b)) / b)))))
            else
                tmp = 1.0d0 / (2.0d0 + (b * (1.0d0 + (t_0 * (2.0d0 + (b * (0.6666666666666666d0 + (b * (0.2222222222222222d0 + (b * 0.07407407407407407d0))))))))))
            end if
            code = tmp
        end function
        
        public static double code(double a, double b) {
        	double t_0 = b * (0.25 - ((b * b) * 0.027777777777777776));
        	double tmp;
        	if (b <= -1.1) {
        		tmp = 1.0;
        	} else if (b <= -4.3e-72) {
        		tmp = 0.5;
        	} else if (b <= -1.6e-289) {
        		tmp = 1.0 / (2.0 + (b * (1.0 + (t_0 * ((-6.0 + ((-18.0 - ((54.0 + (162.0 / b)) / b)) / b)) / b)))));
        	} else {
        		tmp = 1.0 / (2.0 + (b * (1.0 + (t_0 * (2.0 + (b * (0.6666666666666666 + (b * (0.2222222222222222 + (b * 0.07407407407407407))))))))));
        	}
        	return tmp;
        }
        
        def code(a, b):
        	t_0 = b * (0.25 - ((b * b) * 0.027777777777777776))
        	tmp = 0
        	if b <= -1.1:
        		tmp = 1.0
        	elif b <= -4.3e-72:
        		tmp = 0.5
        	elif b <= -1.6e-289:
        		tmp = 1.0 / (2.0 + (b * (1.0 + (t_0 * ((-6.0 + ((-18.0 - ((54.0 + (162.0 / b)) / b)) / b)) / b)))))
        	else:
        		tmp = 1.0 / (2.0 + (b * (1.0 + (t_0 * (2.0 + (b * (0.6666666666666666 + (b * (0.2222222222222222 + (b * 0.07407407407407407))))))))))
        	return tmp
        
        function code(a, b)
        	t_0 = Float64(b * Float64(0.25 - Float64(Float64(b * b) * 0.027777777777777776)))
        	tmp = 0.0
        	if (b <= -1.1)
        		tmp = 1.0;
        	elseif (b <= -4.3e-72)
        		tmp = 0.5;
        	elseif (b <= -1.6e-289)
        		tmp = Float64(1.0 / Float64(2.0 + Float64(b * Float64(1.0 + Float64(t_0 * Float64(Float64(-6.0 + Float64(Float64(-18.0 - Float64(Float64(54.0 + Float64(162.0 / b)) / b)) / b)) / b))))));
        	else
        		tmp = Float64(1.0 / Float64(2.0 + Float64(b * Float64(1.0 + Float64(t_0 * Float64(2.0 + Float64(b * Float64(0.6666666666666666 + Float64(b * Float64(0.2222222222222222 + Float64(b * 0.07407407407407407)))))))))));
        	end
        	return tmp
        end
        
        function tmp_2 = code(a, b)
        	t_0 = b * (0.25 - ((b * b) * 0.027777777777777776));
        	tmp = 0.0;
        	if (b <= -1.1)
        		tmp = 1.0;
        	elseif (b <= -4.3e-72)
        		tmp = 0.5;
        	elseif (b <= -1.6e-289)
        		tmp = 1.0 / (2.0 + (b * (1.0 + (t_0 * ((-6.0 + ((-18.0 - ((54.0 + (162.0 / b)) / b)) / b)) / b)))));
        	else
        		tmp = 1.0 / (2.0 + (b * (1.0 + (t_0 * (2.0 + (b * (0.6666666666666666 + (b * (0.2222222222222222 + (b * 0.07407407407407407))))))))));
        	end
        	tmp_2 = tmp;
        end
        
        code[a_, b_] := Block[{t$95$0 = N[(b * N[(0.25 - N[(N[(b * b), $MachinePrecision] * 0.027777777777777776), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -1.1], 1.0, If[LessEqual[b, -4.3e-72], 0.5, If[LessEqual[b, -1.6e-289], N[(1.0 / N[(2.0 + N[(b * N[(1.0 + N[(t$95$0 * N[(N[(-6.0 + N[(N[(-18.0 - N[(N[(54.0 + N[(162.0 / b), $MachinePrecision]), $MachinePrecision] / b), $MachinePrecision]), $MachinePrecision] / b), $MachinePrecision]), $MachinePrecision] / b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(2.0 + N[(b * N[(1.0 + N[(t$95$0 * N[(2.0 + N[(b * N[(0.6666666666666666 + N[(b * N[(0.2222222222222222 + N[(b * 0.07407407407407407), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
        
        \begin{array}{l}
        
        \\
        \begin{array}{l}
        t_0 := b \cdot \left(0.25 - \left(b \cdot b\right) \cdot 0.027777777777777776\right)\\
        \mathbf{if}\;b \leq -1.1:\\
        \;\;\;\;1\\
        
        \mathbf{elif}\;b \leq -4.3 \cdot 10^{-72}:\\
        \;\;\;\;0.5\\
        
        \mathbf{elif}\;b \leq -1.6 \cdot 10^{-289}:\\
        \;\;\;\;\frac{1}{2 + b \cdot \left(1 + t\_0 \cdot \frac{-6 + \frac{-18 - \frac{54 + \frac{162}{b}}{b}}{b}}{b}\right)}\\
        
        \mathbf{else}:\\
        \;\;\;\;\frac{1}{2 + b \cdot \left(1 + t\_0 \cdot \left(2 + b \cdot \left(0.6666666666666666 + b \cdot \left(0.2222222222222222 + b \cdot 0.07407407407407407\right)\right)\right)\right)}\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 4 regimes
        2. if b < -1.1000000000000001

          1. Initial program 97.9%

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

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

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

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

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

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

              \[\leadsto \mathsf{exp.f64}\left(\left(\log \left(e^{a} + e^{b}\right) \cdot -1 + a\right)\right) \]
            7. +-lowering-+.f64N/A

              \[\leadsto \mathsf{exp.f64}\left(\mathsf{+.f64}\left(\left(\log \left(e^{a} + e^{b}\right) \cdot -1\right), a\right)\right) \]
            8. *-lowering-*.f64N/A

              \[\leadsto \mathsf{exp.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\log \left(e^{a} + e^{b}\right), -1\right), a\right)\right) \]
            9. log-lowering-log.f64N/A

              \[\leadsto \mathsf{exp.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{log.f64}\left(\left(e^{a} + e^{b}\right)\right), -1\right), a\right)\right) \]
            10. +-lowering-+.f64N/A

              \[\leadsto \mathsf{exp.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(\left(e^{a}\right), \left(e^{b}\right)\right)\right), -1\right), a\right)\right) \]
            11. exp-lowering-exp.f64N/A

              \[\leadsto \mathsf{exp.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(a\right), \left(e^{b}\right)\right)\right), -1\right), a\right)\right) \]
            12. exp-lowering-exp.f6497.9%

              \[\leadsto \mathsf{exp.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(a\right), \mathsf{exp.f64}\left(b\right)\right)\right), -1\right), a\right)\right) \]
          4. Applied egg-rr97.9%

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

            \[\leadsto \mathsf{exp.f64}\left(\color{blue}{a}\right) \]
          6. Step-by-step derivation
            1. Simplified97.6%

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

              \[\leadsto \color{blue}{1} \]
            3. Step-by-step derivation
              1. Simplified100.0%

                \[\leadsto \color{blue}{1} \]

              if -1.1000000000000001 < b < -4.2999999999999999e-72

              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. /-lowering-/.f64N/A

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

                  \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \color{blue}{\left(e^{b}\right)}\right)\right) \]
                3. exp-lowering-exp.f6462.3%

                  \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(b\right)\right)\right) \]
              5. Simplified62.3%

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

                \[\leadsto \color{blue}{\frac{1}{2}} \]
              7. Step-by-step derivation
                1. Simplified62.3%

                  \[\leadsto \color{blue}{0.5} \]

                if -4.2999999999999999e-72 < b < -1.6000000000000001e-289

                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. /-lowering-/.f64N/A

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

                    \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \color{blue}{\left(e^{b}\right)}\right)\right) \]
                  3. exp-lowering-exp.f6440.6%

                    \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(b\right)\right)\right) \]
                5. Simplified40.6%

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

                  \[\leadsto \mathsf{/.f64}\left(1, \color{blue}{\left(2 + b \cdot \left(1 + b \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot b\right)\right)\right)}\right) \]
                7. Step-by-step derivation
                  1. +-lowering-+.f64N/A

                    \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \color{blue}{\left(b \cdot \left(1 + b \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot b\right)\right)\right)}\right)\right) \]
                  2. *-lowering-*.f64N/A

                    \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \color{blue}{\left(1 + b \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot b\right)\right)}\right)\right)\right) \]
                  3. +-lowering-+.f64N/A

                    \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(1, \color{blue}{\left(b \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot b\right)\right)}\right)\right)\right)\right) \]
                  4. *-lowering-*.f64N/A

                    \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(b, \color{blue}{\left(\frac{1}{2} + \frac{1}{6} \cdot b\right)}\right)\right)\right)\right)\right) \]
                  5. +-lowering-+.f64N/A

                    \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(\frac{1}{2}, \color{blue}{\left(\frac{1}{6} \cdot b\right)}\right)\right)\right)\right)\right)\right) \]
                  6. *-commutativeN/A

                    \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(\frac{1}{2}, \left(b \cdot \color{blue}{\frac{1}{6}}\right)\right)\right)\right)\right)\right)\right) \]
                  7. *-lowering-*.f6440.6%

                    \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(b, \color{blue}{\frac{1}{6}}\right)\right)\right)\right)\right)\right)\right) \]
                8. Simplified40.6%

                  \[\leadsto \frac{1}{\color{blue}{2 + b \cdot \left(1 + b \cdot \left(0.5 + b \cdot 0.16666666666666666\right)\right)}} \]
                9. Step-by-step derivation
                  1. *-commutativeN/A

                    \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(1, \left(\left(\frac{1}{2} + b \cdot \frac{1}{6}\right) \cdot \color{blue}{b}\right)\right)\right)\right)\right) \]
                  2. flip-+N/A

                    \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(1, \left(\frac{\frac{1}{2} \cdot \frac{1}{2} - \left(b \cdot \frac{1}{6}\right) \cdot \left(b \cdot \frac{1}{6}\right)}{\frac{1}{2} - b \cdot \frac{1}{6}} \cdot b\right)\right)\right)\right)\right) \]
                  3. associate-*l/N/A

                    \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(1, \left(\frac{\left(\frac{1}{2} \cdot \frac{1}{2} - \left(b \cdot \frac{1}{6}\right) \cdot \left(b \cdot \frac{1}{6}\right)\right) \cdot b}{\color{blue}{\frac{1}{2} - b \cdot \frac{1}{6}}}\right)\right)\right)\right)\right) \]
                  4. div-invN/A

                    \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(1, \left(\left(\left(\frac{1}{2} \cdot \frac{1}{2} - \left(b \cdot \frac{1}{6}\right) \cdot \left(b \cdot \frac{1}{6}\right)\right) \cdot b\right) \cdot \color{blue}{\frac{1}{\frac{1}{2} - b \cdot \frac{1}{6}}}\right)\right)\right)\right)\right) \]
                  5. *-lowering-*.f64N/A

                    \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\left(\left(\frac{1}{2} \cdot \frac{1}{2} - \left(b \cdot \frac{1}{6}\right) \cdot \left(b \cdot \frac{1}{6}\right)\right) \cdot b\right), \color{blue}{\left(\frac{1}{\frac{1}{2} - b \cdot \frac{1}{6}}\right)}\right)\right)\right)\right)\right) \]
                  6. *-lowering-*.f64N/A

                    \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(\frac{1}{2} \cdot \frac{1}{2} - \left(b \cdot \frac{1}{6}\right) \cdot \left(b \cdot \frac{1}{6}\right)\right), b\right), \left(\frac{\color{blue}{1}}{\frac{1}{2} - b \cdot \frac{1}{6}}\right)\right)\right)\right)\right)\right) \]
                  7. --lowering--.f64N/A

                    \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(\left(\frac{1}{2} \cdot \frac{1}{2}\right), \left(\left(b \cdot \frac{1}{6}\right) \cdot \left(b \cdot \frac{1}{6}\right)\right)\right), b\right), \left(\frac{1}{\frac{1}{2} - b \cdot \frac{1}{6}}\right)\right)\right)\right)\right)\right) \]
                  8. metadata-evalN/A

                    \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(\frac{1}{4}, \left(\left(b \cdot \frac{1}{6}\right) \cdot \left(b \cdot \frac{1}{6}\right)\right)\right), b\right), \left(\frac{1}{\frac{1}{2} - b \cdot \frac{1}{6}}\right)\right)\right)\right)\right)\right) \]
                  9. swap-sqrN/A

                    \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(\frac{1}{4}, \left(\left(b \cdot b\right) \cdot \left(\frac{1}{6} \cdot \frac{1}{6}\right)\right)\right), b\right), \left(\frac{1}{\frac{1}{2} - b \cdot \frac{1}{6}}\right)\right)\right)\right)\right)\right) \]
                  10. *-lowering-*.f64N/A

                    \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(\frac{1}{4}, \mathsf{*.f64}\left(\left(b \cdot b\right), \left(\frac{1}{6} \cdot \frac{1}{6}\right)\right)\right), b\right), \left(\frac{1}{\frac{1}{2} - b \cdot \frac{1}{6}}\right)\right)\right)\right)\right)\right) \]
                  11. *-lowering-*.f64N/A

                    \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(\frac{1}{4}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(\frac{1}{6} \cdot \frac{1}{6}\right)\right)\right), b\right), \left(\frac{1}{\frac{1}{2} - b \cdot \frac{1}{6}}\right)\right)\right)\right)\right)\right) \]
                  12. metadata-evalN/A

                    \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(\frac{1}{4}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\right), \frac{1}{36}\right)\right), b\right), \left(\frac{1}{\frac{1}{2} - b \cdot \frac{1}{6}}\right)\right)\right)\right)\right)\right) \]
                  13. /-lowering-/.f64N/A

                    \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(\frac{1}{4}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\right), \frac{1}{36}\right)\right), b\right), \mathsf{/.f64}\left(1, \color{blue}{\left(\frac{1}{2} - b \cdot \frac{1}{6}\right)}\right)\right)\right)\right)\right)\right) \]
                  14. --lowering--.f64N/A

                    \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(\frac{1}{4}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\right), \frac{1}{36}\right)\right), b\right), \mathsf{/.f64}\left(1, \mathsf{\_.f64}\left(\frac{1}{2}, \color{blue}{\left(b \cdot \frac{1}{6}\right)}\right)\right)\right)\right)\right)\right)\right) \]
                  15. *-lowering-*.f6440.6%

                    \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(\frac{1}{4}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\right), \frac{1}{36}\right)\right), b\right), \mathsf{/.f64}\left(1, \mathsf{\_.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(b, \color{blue}{\frac{1}{6}}\right)\right)\right)\right)\right)\right)\right)\right) \]
                10. Applied egg-rr40.6%

                  \[\leadsto \frac{1}{2 + b \cdot \left(1 + \color{blue}{\left(\left(0.25 - \left(b \cdot b\right) \cdot 0.027777777777777776\right) \cdot b\right) \cdot \frac{1}{0.5 - b \cdot 0.16666666666666666}}\right)} \]
                11. Taylor expanded in b around inf

                  \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(\frac{1}{4}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\right), \frac{1}{36}\right)\right), b\right), \color{blue}{\left(\frac{-1 \cdot \frac{54 + 162 \cdot \frac{1}{b}}{{b}^{2}} - \left(6 + 18 \cdot \frac{1}{b}\right)}{b}\right)}\right)\right)\right)\right)\right) \]
                12. Step-by-step derivation
                  1. /-lowering-/.f64N/A

                    \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(\frac{1}{4}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\right), \frac{1}{36}\right)\right), b\right), \mathsf{/.f64}\left(\left(-1 \cdot \frac{54 + 162 \cdot \frac{1}{b}}{{b}^{2}} - \left(6 + 18 \cdot \frac{1}{b}\right)\right), \color{blue}{b}\right)\right)\right)\right)\right)\right) \]
                13. Simplified57.7%

                  \[\leadsto \frac{1}{2 + b \cdot \left(1 + \left(\left(0.25 - \left(b \cdot b\right) \cdot 0.027777777777777776\right) \cdot b\right) \cdot \color{blue}{\frac{-6 + \frac{-18 - \frac{54 + \frac{162}{b}}{b}}{b}}{b}}\right)} \]

                if -1.6000000000000001e-289 < b

                1. Initial program 99.3%

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

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

                    \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \color{blue}{\left(e^{b}\right)}\right)\right) \]
                  3. exp-lowering-exp.f6482.8%

                    \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(b\right)\right)\right) \]
                5. Simplified82.8%

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

                  \[\leadsto \mathsf{/.f64}\left(1, \color{blue}{\left(2 + b \cdot \left(1 + b \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot b\right)\right)\right)}\right) \]
                7. Step-by-step derivation
                  1. +-lowering-+.f64N/A

                    \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \color{blue}{\left(b \cdot \left(1 + b \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot b\right)\right)\right)}\right)\right) \]
                  2. *-lowering-*.f64N/A

                    \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \color{blue}{\left(1 + b \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot b\right)\right)}\right)\right)\right) \]
                  3. +-lowering-+.f64N/A

                    \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(1, \color{blue}{\left(b \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot b\right)\right)}\right)\right)\right)\right) \]
                  4. *-lowering-*.f64N/A

                    \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(b, \color{blue}{\left(\frac{1}{2} + \frac{1}{6} \cdot b\right)}\right)\right)\right)\right)\right) \]
                  5. +-lowering-+.f64N/A

                    \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(\frac{1}{2}, \color{blue}{\left(\frac{1}{6} \cdot b\right)}\right)\right)\right)\right)\right)\right) \]
                  6. *-commutativeN/A

                    \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(\frac{1}{2}, \left(b \cdot \color{blue}{\frac{1}{6}}\right)\right)\right)\right)\right)\right)\right) \]
                  7. *-lowering-*.f6471.2%

                    \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(b, \color{blue}{\frac{1}{6}}\right)\right)\right)\right)\right)\right)\right) \]
                8. Simplified71.2%

                  \[\leadsto \frac{1}{\color{blue}{2 + b \cdot \left(1 + b \cdot \left(0.5 + b \cdot 0.16666666666666666\right)\right)}} \]
                9. Step-by-step derivation
                  1. *-commutativeN/A

                    \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(1, \left(\left(\frac{1}{2} + b \cdot \frac{1}{6}\right) \cdot \color{blue}{b}\right)\right)\right)\right)\right) \]
                  2. flip-+N/A

                    \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(1, \left(\frac{\frac{1}{2} \cdot \frac{1}{2} - \left(b \cdot \frac{1}{6}\right) \cdot \left(b \cdot \frac{1}{6}\right)}{\frac{1}{2} - b \cdot \frac{1}{6}} \cdot b\right)\right)\right)\right)\right) \]
                  3. associate-*l/N/A

                    \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(1, \left(\frac{\left(\frac{1}{2} \cdot \frac{1}{2} - \left(b \cdot \frac{1}{6}\right) \cdot \left(b \cdot \frac{1}{6}\right)\right) \cdot b}{\color{blue}{\frac{1}{2} - b \cdot \frac{1}{6}}}\right)\right)\right)\right)\right) \]
                  4. div-invN/A

                    \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(1, \left(\left(\left(\frac{1}{2} \cdot \frac{1}{2} - \left(b \cdot \frac{1}{6}\right) \cdot \left(b \cdot \frac{1}{6}\right)\right) \cdot b\right) \cdot \color{blue}{\frac{1}{\frac{1}{2} - b \cdot \frac{1}{6}}}\right)\right)\right)\right)\right) \]
                  5. *-lowering-*.f64N/A

                    \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\left(\left(\frac{1}{2} \cdot \frac{1}{2} - \left(b \cdot \frac{1}{6}\right) \cdot \left(b \cdot \frac{1}{6}\right)\right) \cdot b\right), \color{blue}{\left(\frac{1}{\frac{1}{2} - b \cdot \frac{1}{6}}\right)}\right)\right)\right)\right)\right) \]
                  6. *-lowering-*.f64N/A

                    \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(\frac{1}{2} \cdot \frac{1}{2} - \left(b \cdot \frac{1}{6}\right) \cdot \left(b \cdot \frac{1}{6}\right)\right), b\right), \left(\frac{\color{blue}{1}}{\frac{1}{2} - b \cdot \frac{1}{6}}\right)\right)\right)\right)\right)\right) \]
                  7. --lowering--.f64N/A

                    \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(\left(\frac{1}{2} \cdot \frac{1}{2}\right), \left(\left(b \cdot \frac{1}{6}\right) \cdot \left(b \cdot \frac{1}{6}\right)\right)\right), b\right), \left(\frac{1}{\frac{1}{2} - b \cdot \frac{1}{6}}\right)\right)\right)\right)\right)\right) \]
                  8. metadata-evalN/A

                    \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(\frac{1}{4}, \left(\left(b \cdot \frac{1}{6}\right) \cdot \left(b \cdot \frac{1}{6}\right)\right)\right), b\right), \left(\frac{1}{\frac{1}{2} - b \cdot \frac{1}{6}}\right)\right)\right)\right)\right)\right) \]
                  9. swap-sqrN/A

                    \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(\frac{1}{4}, \left(\left(b \cdot b\right) \cdot \left(\frac{1}{6} \cdot \frac{1}{6}\right)\right)\right), b\right), \left(\frac{1}{\frac{1}{2} - b \cdot \frac{1}{6}}\right)\right)\right)\right)\right)\right) \]
                  10. *-lowering-*.f64N/A

                    \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(\frac{1}{4}, \mathsf{*.f64}\left(\left(b \cdot b\right), \left(\frac{1}{6} \cdot \frac{1}{6}\right)\right)\right), b\right), \left(\frac{1}{\frac{1}{2} - b \cdot \frac{1}{6}}\right)\right)\right)\right)\right)\right) \]
                  11. *-lowering-*.f64N/A

                    \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(\frac{1}{4}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(\frac{1}{6} \cdot \frac{1}{6}\right)\right)\right), b\right), \left(\frac{1}{\frac{1}{2} - b \cdot \frac{1}{6}}\right)\right)\right)\right)\right)\right) \]
                  12. metadata-evalN/A

                    \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(\frac{1}{4}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\right), \frac{1}{36}\right)\right), b\right), \left(\frac{1}{\frac{1}{2} - b \cdot \frac{1}{6}}\right)\right)\right)\right)\right)\right) \]
                  13. /-lowering-/.f64N/A

                    \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(\frac{1}{4}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\right), \frac{1}{36}\right)\right), b\right), \mathsf{/.f64}\left(1, \color{blue}{\left(\frac{1}{2} - b \cdot \frac{1}{6}\right)}\right)\right)\right)\right)\right)\right) \]
                  14. --lowering--.f64N/A

                    \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(\frac{1}{4}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\right), \frac{1}{36}\right)\right), b\right), \mathsf{/.f64}\left(1, \mathsf{\_.f64}\left(\frac{1}{2}, \color{blue}{\left(b \cdot \frac{1}{6}\right)}\right)\right)\right)\right)\right)\right)\right) \]
                  15. *-lowering-*.f6471.2%

                    \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(\frac{1}{4}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\right), \frac{1}{36}\right)\right), b\right), \mathsf{/.f64}\left(1, \mathsf{\_.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(b, \color{blue}{\frac{1}{6}}\right)\right)\right)\right)\right)\right)\right)\right) \]
                10. Applied egg-rr71.2%

                  \[\leadsto \frac{1}{2 + b \cdot \left(1 + \color{blue}{\left(\left(0.25 - \left(b \cdot b\right) \cdot 0.027777777777777776\right) \cdot b\right) \cdot \frac{1}{0.5 - b \cdot 0.16666666666666666}}\right)} \]
                11. Taylor expanded in b around 0

                  \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(\frac{1}{4}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\right), \frac{1}{36}\right)\right), b\right), \color{blue}{\left(2 + b \cdot \left(\frac{2}{3} + b \cdot \left(\frac{2}{9} + \frac{2}{27} \cdot b\right)\right)\right)}\right)\right)\right)\right)\right) \]
                12. Step-by-step derivation
                  1. +-lowering-+.f64N/A

                    \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(\frac{1}{4}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\right), \frac{1}{36}\right)\right), b\right), \mathsf{+.f64}\left(2, \color{blue}{\left(b \cdot \left(\frac{2}{3} + b \cdot \left(\frac{2}{9} + \frac{2}{27} \cdot b\right)\right)\right)}\right)\right)\right)\right)\right)\right) \]
                  2. *-lowering-*.f64N/A

                    \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(\frac{1}{4}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\right), \frac{1}{36}\right)\right), b\right), \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \color{blue}{\left(\frac{2}{3} + b \cdot \left(\frac{2}{9} + \frac{2}{27} \cdot b\right)\right)}\right)\right)\right)\right)\right)\right)\right) \]
                  3. +-lowering-+.f64N/A

                    \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(\frac{1}{4}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\right), \frac{1}{36}\right)\right), b\right), \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(\frac{2}{3}, \color{blue}{\left(b \cdot \left(\frac{2}{9} + \frac{2}{27} \cdot b\right)\right)}\right)\right)\right)\right)\right)\right)\right)\right) \]
                  4. *-lowering-*.f64N/A

                    \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(\frac{1}{4}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\right), \frac{1}{36}\right)\right), b\right), \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(\frac{2}{3}, \mathsf{*.f64}\left(b, \color{blue}{\left(\frac{2}{9} + \frac{2}{27} \cdot b\right)}\right)\right)\right)\right)\right)\right)\right)\right)\right) \]
                  5. +-lowering-+.f64N/A

                    \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(\frac{1}{4}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\right), \frac{1}{36}\right)\right), b\right), \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(\frac{2}{3}, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(\frac{2}{9}, \color{blue}{\left(\frac{2}{27} \cdot b\right)}\right)\right)\right)\right)\right)\right)\right)\right)\right)\right) \]
                  6. *-commutativeN/A

                    \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(\frac{1}{4}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\right), \frac{1}{36}\right)\right), b\right), \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(\frac{2}{3}, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(\frac{2}{9}, \left(b \cdot \color{blue}{\frac{2}{27}}\right)\right)\right)\right)\right)\right)\right)\right)\right)\right)\right) \]
                  7. *-lowering-*.f6479.6%

                    \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(\frac{1}{4}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\right), \frac{1}{36}\right)\right), b\right), \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(\frac{2}{3}, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(\frac{2}{9}, \mathsf{*.f64}\left(b, \color{blue}{\frac{2}{27}}\right)\right)\right)\right)\right)\right)\right)\right)\right)\right)\right) \]
                13. Simplified79.6%

                  \[\leadsto \frac{1}{2 + b \cdot \left(1 + \left(\left(0.25 - \left(b \cdot b\right) \cdot 0.027777777777777776\right) \cdot b\right) \cdot \color{blue}{\left(2 + b \cdot \left(0.6666666666666666 + b \cdot \left(0.2222222222222222 + b \cdot 0.07407407407407407\right)\right)\right)}\right)} \]
              8. Recombined 4 regimes into one program.
              9. Final simplification78.0%

                \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -1.1:\\ \;\;\;\;1\\ \mathbf{elif}\;b \leq -4.3 \cdot 10^{-72}:\\ \;\;\;\;0.5\\ \mathbf{elif}\;b \leq -1.6 \cdot 10^{-289}:\\ \;\;\;\;\frac{1}{2 + b \cdot \left(1 + \left(b \cdot \left(0.25 - \left(b \cdot b\right) \cdot 0.027777777777777776\right)\right) \cdot \frac{-6 + \frac{-18 - \frac{54 + \frac{162}{b}}{b}}{b}}{b}\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{2 + b \cdot \left(1 + \left(b \cdot \left(0.25 - \left(b \cdot b\right) \cdot 0.027777777777777776\right)\right) \cdot \left(2 + b \cdot \left(0.6666666666666666 + b \cdot \left(0.2222222222222222 + b \cdot 0.07407407407407407\right)\right)\right)\right)}\\ \end{array} \]
              10. Add Preprocessing

              Alternative 8: 74.0% accurate, 6.6× speedup?

              \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq -6.5 \cdot 10^{-9}:\\ \;\;\;\;1\\ \mathbf{elif}\;b \leq -9.6 \cdot 10^{-204}:\\ \;\;\;\;0.5 + a \cdot 0.25\\ \mathbf{elif}\;b \leq -5 \cdot 10^{-289}:\\ \;\;\;\;0.020833333333333332 \cdot \left(b \cdot \left(b \cdot b\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{2 + b \cdot \left(1 + \left(b \cdot \left(0.25 - \left(b \cdot b\right) \cdot 0.027777777777777776\right)\right) \cdot \left(2 + b \cdot \left(0.6666666666666666 + b \cdot \left(0.2222222222222222 + b \cdot 0.07407407407407407\right)\right)\right)\right)}\\ \end{array} \end{array} \]
              (FPCore (a b)
               :precision binary64
               (if (<= b -6.5e-9)
                 1.0
                 (if (<= b -9.6e-204)
                   (+ 0.5 (* a 0.25))
                   (if (<= b -5e-289)
                     (* 0.020833333333333332 (* b (* b b)))
                     (/
                      1.0
                      (+
                       2.0
                       (*
                        b
                        (+
                         1.0
                         (*
                          (* b (- 0.25 (* (* b b) 0.027777777777777776)))
                          (+
                           2.0
                           (*
                            b
                            (+
                             0.6666666666666666
                             (*
                              b
                              (+ 0.2222222222222222 (* b 0.07407407407407407)))))))))))))))
              double code(double a, double b) {
              	double tmp;
              	if (b <= -6.5e-9) {
              		tmp = 1.0;
              	} else if (b <= -9.6e-204) {
              		tmp = 0.5 + (a * 0.25);
              	} else if (b <= -5e-289) {
              		tmp = 0.020833333333333332 * (b * (b * b));
              	} else {
              		tmp = 1.0 / (2.0 + (b * (1.0 + ((b * (0.25 - ((b * b) * 0.027777777777777776))) * (2.0 + (b * (0.6666666666666666 + (b * (0.2222222222222222 + (b * 0.07407407407407407))))))))));
              	}
              	return tmp;
              }
              
              real(8) function code(a, b)
                  real(8), intent (in) :: a
                  real(8), intent (in) :: b
                  real(8) :: tmp
                  if (b <= (-6.5d-9)) then
                      tmp = 1.0d0
                  else if (b <= (-9.6d-204)) then
                      tmp = 0.5d0 + (a * 0.25d0)
                  else if (b <= (-5d-289)) then
                      tmp = 0.020833333333333332d0 * (b * (b * b))
                  else
                      tmp = 1.0d0 / (2.0d0 + (b * (1.0d0 + ((b * (0.25d0 - ((b * b) * 0.027777777777777776d0))) * (2.0d0 + (b * (0.6666666666666666d0 + (b * (0.2222222222222222d0 + (b * 0.07407407407407407d0))))))))))
                  end if
                  code = tmp
              end function
              
              public static double code(double a, double b) {
              	double tmp;
              	if (b <= -6.5e-9) {
              		tmp = 1.0;
              	} else if (b <= -9.6e-204) {
              		tmp = 0.5 + (a * 0.25);
              	} else if (b <= -5e-289) {
              		tmp = 0.020833333333333332 * (b * (b * b));
              	} else {
              		tmp = 1.0 / (2.0 + (b * (1.0 + ((b * (0.25 - ((b * b) * 0.027777777777777776))) * (2.0 + (b * (0.6666666666666666 + (b * (0.2222222222222222 + (b * 0.07407407407407407))))))))));
              	}
              	return tmp;
              }
              
              def code(a, b):
              	tmp = 0
              	if b <= -6.5e-9:
              		tmp = 1.0
              	elif b <= -9.6e-204:
              		tmp = 0.5 + (a * 0.25)
              	elif b <= -5e-289:
              		tmp = 0.020833333333333332 * (b * (b * b))
              	else:
              		tmp = 1.0 / (2.0 + (b * (1.0 + ((b * (0.25 - ((b * b) * 0.027777777777777776))) * (2.0 + (b * (0.6666666666666666 + (b * (0.2222222222222222 + (b * 0.07407407407407407))))))))))
              	return tmp
              
              function code(a, b)
              	tmp = 0.0
              	if (b <= -6.5e-9)
              		tmp = 1.0;
              	elseif (b <= -9.6e-204)
              		tmp = Float64(0.5 + Float64(a * 0.25));
              	elseif (b <= -5e-289)
              		tmp = Float64(0.020833333333333332 * Float64(b * Float64(b * b)));
              	else
              		tmp = Float64(1.0 / Float64(2.0 + Float64(b * Float64(1.0 + Float64(Float64(b * Float64(0.25 - Float64(Float64(b * b) * 0.027777777777777776))) * Float64(2.0 + Float64(b * Float64(0.6666666666666666 + Float64(b * Float64(0.2222222222222222 + Float64(b * 0.07407407407407407)))))))))));
              	end
              	return tmp
              end
              
              function tmp_2 = code(a, b)
              	tmp = 0.0;
              	if (b <= -6.5e-9)
              		tmp = 1.0;
              	elseif (b <= -9.6e-204)
              		tmp = 0.5 + (a * 0.25);
              	elseif (b <= -5e-289)
              		tmp = 0.020833333333333332 * (b * (b * b));
              	else
              		tmp = 1.0 / (2.0 + (b * (1.0 + ((b * (0.25 - ((b * b) * 0.027777777777777776))) * (2.0 + (b * (0.6666666666666666 + (b * (0.2222222222222222 + (b * 0.07407407407407407))))))))));
              	end
              	tmp_2 = tmp;
              end
              
              code[a_, b_] := If[LessEqual[b, -6.5e-9], 1.0, If[LessEqual[b, -9.6e-204], N[(0.5 + N[(a * 0.25), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, -5e-289], N[(0.020833333333333332 * N[(b * N[(b * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(2.0 + N[(b * N[(1.0 + N[(N[(b * N[(0.25 - N[(N[(b * b), $MachinePrecision] * 0.027777777777777776), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(2.0 + N[(b * N[(0.6666666666666666 + N[(b * N[(0.2222222222222222 + N[(b * 0.07407407407407407), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
              
              \begin{array}{l}
              
              \\
              \begin{array}{l}
              \mathbf{if}\;b \leq -6.5 \cdot 10^{-9}:\\
              \;\;\;\;1\\
              
              \mathbf{elif}\;b \leq -9.6 \cdot 10^{-204}:\\
              \;\;\;\;0.5 + a \cdot 0.25\\
              
              \mathbf{elif}\;b \leq -5 \cdot 10^{-289}:\\
              \;\;\;\;0.020833333333333332 \cdot \left(b \cdot \left(b \cdot b\right)\right)\\
              
              \mathbf{else}:\\
              \;\;\;\;\frac{1}{2 + b \cdot \left(1 + \left(b \cdot \left(0.25 - \left(b \cdot b\right) \cdot 0.027777777777777776\right)\right) \cdot \left(2 + b \cdot \left(0.6666666666666666 + b \cdot \left(0.2222222222222222 + b \cdot 0.07407407407407407\right)\right)\right)\right)}\\
              
              
              \end{array}
              \end{array}
              
              Derivation
              1. Split input into 4 regimes
              2. if b < -6.5000000000000003e-9

                1. Initial program 97.9%

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

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

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

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

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

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

                    \[\leadsto \mathsf{exp.f64}\left(\left(\log \left(e^{a} + e^{b}\right) \cdot -1 + a\right)\right) \]
                  7. +-lowering-+.f64N/A

                    \[\leadsto \mathsf{exp.f64}\left(\mathsf{+.f64}\left(\left(\log \left(e^{a} + e^{b}\right) \cdot -1\right), a\right)\right) \]
                  8. *-lowering-*.f64N/A

                    \[\leadsto \mathsf{exp.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\log \left(e^{a} + e^{b}\right), -1\right), a\right)\right) \]
                  9. log-lowering-log.f64N/A

                    \[\leadsto \mathsf{exp.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{log.f64}\left(\left(e^{a} + e^{b}\right)\right), -1\right), a\right)\right) \]
                  10. +-lowering-+.f64N/A

                    \[\leadsto \mathsf{exp.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(\left(e^{a}\right), \left(e^{b}\right)\right)\right), -1\right), a\right)\right) \]
                  11. exp-lowering-exp.f64N/A

                    \[\leadsto \mathsf{exp.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(a\right), \left(e^{b}\right)\right)\right), -1\right), a\right)\right) \]
                  12. exp-lowering-exp.f6498.0%

                    \[\leadsto \mathsf{exp.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(a\right), \mathsf{exp.f64}\left(b\right)\right)\right), -1\right), a\right)\right) \]
                4. Applied egg-rr98.0%

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

                  \[\leadsto \mathsf{exp.f64}\left(\color{blue}{a}\right) \]
                6. Step-by-step derivation
                  1. Simplified97.7%

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

                    \[\leadsto \color{blue}{1} \]
                  3. Step-by-step derivation
                    1. Simplified98.0%

                      \[\leadsto \color{blue}{1} \]

                    if -6.5000000000000003e-9 < b < -9.6e-204

                    1. Initial program 100.0%

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

                      \[\leadsto \mathsf{/.f64}\left(\mathsf{exp.f64}\left(a\right), \mathsf{+.f64}\left(\mathsf{exp.f64}\left(a\right), \color{blue}{1}\right)\right) \]
                    4. Step-by-step derivation
                      1. Simplified100.0%

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

                        \[\leadsto \color{blue}{\frac{1}{2} + \frac{1}{4} \cdot a} \]
                      3. Step-by-step derivation
                        1. +-lowering-+.f64N/A

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

                          \[\leadsto \mathsf{+.f64}\left(\frac{1}{2}, \left(a \cdot \color{blue}{\frac{1}{4}}\right)\right) \]
                        3. *-lowering-*.f6454.8%

                          \[\leadsto \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(a, \color{blue}{\frac{1}{4}}\right)\right) \]
                      4. Simplified54.8%

                        \[\leadsto \color{blue}{0.5 + a \cdot 0.25} \]

                      if -9.6e-204 < b < -5.00000000000000029e-289

                      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. /-lowering-/.f64N/A

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

                          \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \color{blue}{\left(e^{b}\right)}\right)\right) \]
                        3. exp-lowering-exp.f6436.7%

                          \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(b\right)\right)\right) \]
                      5. Simplified36.7%

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

                        \[\leadsto \color{blue}{\frac{1}{2} + b \cdot \left(\frac{1}{48} \cdot {b}^{2} - \frac{1}{4}\right)} \]
                      7. Step-by-step derivation
                        1. +-lowering-+.f64N/A

                          \[\leadsto \mathsf{+.f64}\left(\frac{1}{2}, \color{blue}{\left(b \cdot \left(\frac{1}{48} \cdot {b}^{2} - \frac{1}{4}\right)\right)}\right) \]
                        2. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(b, \color{blue}{\left(\frac{1}{48} \cdot {b}^{2} - \frac{1}{4}\right)}\right)\right) \]
                        3. sub-negN/A

                          \[\leadsto \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(b, \left(\frac{1}{48} \cdot {b}^{2} + \color{blue}{\left(\mathsf{neg}\left(\frac{1}{4}\right)\right)}\right)\right)\right) \]
                        4. metadata-evalN/A

                          \[\leadsto \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(b, \left(\frac{1}{48} \cdot {b}^{2} + \frac{-1}{4}\right)\right)\right) \]
                        5. +-commutativeN/A

                          \[\leadsto \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(b, \left(\frac{-1}{4} + \color{blue}{\frac{1}{48} \cdot {b}^{2}}\right)\right)\right) \]
                        6. +-lowering-+.f64N/A

                          \[\leadsto \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(\frac{-1}{4}, \color{blue}{\left(\frac{1}{48} \cdot {b}^{2}\right)}\right)\right)\right) \]
                        7. *-commutativeN/A

                          \[\leadsto \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(\frac{-1}{4}, \left({b}^{2} \cdot \color{blue}{\frac{1}{48}}\right)\right)\right)\right) \]
                        8. unpow2N/A

                          \[\leadsto \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(\frac{-1}{4}, \left(\left(b \cdot b\right) \cdot \frac{1}{48}\right)\right)\right)\right) \]
                        9. associate-*l*N/A

                          \[\leadsto \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(\frac{-1}{4}, \left(b \cdot \color{blue}{\left(b \cdot \frac{1}{48}\right)}\right)\right)\right)\right) \]
                        10. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(\frac{-1}{4}, \mathsf{*.f64}\left(b, \color{blue}{\left(b \cdot \frac{1}{48}\right)}\right)\right)\right)\right) \]
                        11. *-lowering-*.f6436.7%

                          \[\leadsto \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(\frac{-1}{4}, \mathsf{*.f64}\left(b, \mathsf{*.f64}\left(b, \color{blue}{\frac{1}{48}}\right)\right)\right)\right)\right) \]
                      8. Simplified36.7%

                        \[\leadsto \color{blue}{0.5 + b \cdot \left(-0.25 + b \cdot \left(b \cdot 0.020833333333333332\right)\right)} \]
                      9. Taylor expanded in b around inf

                        \[\leadsto \color{blue}{\frac{1}{48} \cdot {b}^{3}} \]
                      10. Step-by-step derivation
                        1. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{*.f64}\left(\frac{1}{48}, \color{blue}{\left({b}^{3}\right)}\right) \]
                        2. cube-multN/A

                          \[\leadsto \mathsf{*.f64}\left(\frac{1}{48}, \left(b \cdot \color{blue}{\left(b \cdot b\right)}\right)\right) \]
                        3. unpow2N/A

                          \[\leadsto \mathsf{*.f64}\left(\frac{1}{48}, \left(b \cdot {b}^{\color{blue}{2}}\right)\right) \]
                        4. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{*.f64}\left(\frac{1}{48}, \mathsf{*.f64}\left(b, \color{blue}{\left({b}^{2}\right)}\right)\right) \]
                        5. unpow2N/A

                          \[\leadsto \mathsf{*.f64}\left(\frac{1}{48}, \mathsf{*.f64}\left(b, \left(b \cdot \color{blue}{b}\right)\right)\right) \]
                        6. *-lowering-*.f6466.5%

                          \[\leadsto \mathsf{*.f64}\left(\frac{1}{48}, \mathsf{*.f64}\left(b, \mathsf{*.f64}\left(b, \color{blue}{b}\right)\right)\right) \]
                      11. Simplified66.5%

                        \[\leadsto \color{blue}{0.020833333333333332 \cdot \left(b \cdot \left(b \cdot b\right)\right)} \]

                      if -5.00000000000000029e-289 < b

                      1. Initial program 99.3%

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

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

                          \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \color{blue}{\left(e^{b}\right)}\right)\right) \]
                        3. exp-lowering-exp.f6482.8%

                          \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(b\right)\right)\right) \]
                      5. Simplified82.8%

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

                        \[\leadsto \mathsf{/.f64}\left(1, \color{blue}{\left(2 + b \cdot \left(1 + b \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot b\right)\right)\right)}\right) \]
                      7. Step-by-step derivation
                        1. +-lowering-+.f64N/A

                          \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \color{blue}{\left(b \cdot \left(1 + b \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot b\right)\right)\right)}\right)\right) \]
                        2. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \color{blue}{\left(1 + b \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot b\right)\right)}\right)\right)\right) \]
                        3. +-lowering-+.f64N/A

                          \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(1, \color{blue}{\left(b \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot b\right)\right)}\right)\right)\right)\right) \]
                        4. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(b, \color{blue}{\left(\frac{1}{2} + \frac{1}{6} \cdot b\right)}\right)\right)\right)\right)\right) \]
                        5. +-lowering-+.f64N/A

                          \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(\frac{1}{2}, \color{blue}{\left(\frac{1}{6} \cdot b\right)}\right)\right)\right)\right)\right)\right) \]
                        6. *-commutativeN/A

                          \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(\frac{1}{2}, \left(b \cdot \color{blue}{\frac{1}{6}}\right)\right)\right)\right)\right)\right)\right) \]
                        7. *-lowering-*.f6471.2%

                          \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(b, \color{blue}{\frac{1}{6}}\right)\right)\right)\right)\right)\right)\right) \]
                      8. Simplified71.2%

                        \[\leadsto \frac{1}{\color{blue}{2 + b \cdot \left(1 + b \cdot \left(0.5 + b \cdot 0.16666666666666666\right)\right)}} \]
                      9. Step-by-step derivation
                        1. *-commutativeN/A

                          \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(1, \left(\left(\frac{1}{2} + b \cdot \frac{1}{6}\right) \cdot \color{blue}{b}\right)\right)\right)\right)\right) \]
                        2. flip-+N/A

                          \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(1, \left(\frac{\frac{1}{2} \cdot \frac{1}{2} - \left(b \cdot \frac{1}{6}\right) \cdot \left(b \cdot \frac{1}{6}\right)}{\frac{1}{2} - b \cdot \frac{1}{6}} \cdot b\right)\right)\right)\right)\right) \]
                        3. associate-*l/N/A

                          \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(1, \left(\frac{\left(\frac{1}{2} \cdot \frac{1}{2} - \left(b \cdot \frac{1}{6}\right) \cdot \left(b \cdot \frac{1}{6}\right)\right) \cdot b}{\color{blue}{\frac{1}{2} - b \cdot \frac{1}{6}}}\right)\right)\right)\right)\right) \]
                        4. div-invN/A

                          \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(1, \left(\left(\left(\frac{1}{2} \cdot \frac{1}{2} - \left(b \cdot \frac{1}{6}\right) \cdot \left(b \cdot \frac{1}{6}\right)\right) \cdot b\right) \cdot \color{blue}{\frac{1}{\frac{1}{2} - b \cdot \frac{1}{6}}}\right)\right)\right)\right)\right) \]
                        5. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\left(\left(\frac{1}{2} \cdot \frac{1}{2} - \left(b \cdot \frac{1}{6}\right) \cdot \left(b \cdot \frac{1}{6}\right)\right) \cdot b\right), \color{blue}{\left(\frac{1}{\frac{1}{2} - b \cdot \frac{1}{6}}\right)}\right)\right)\right)\right)\right) \]
                        6. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(\frac{1}{2} \cdot \frac{1}{2} - \left(b \cdot \frac{1}{6}\right) \cdot \left(b \cdot \frac{1}{6}\right)\right), b\right), \left(\frac{\color{blue}{1}}{\frac{1}{2} - b \cdot \frac{1}{6}}\right)\right)\right)\right)\right)\right) \]
                        7. --lowering--.f64N/A

                          \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(\left(\frac{1}{2} \cdot \frac{1}{2}\right), \left(\left(b \cdot \frac{1}{6}\right) \cdot \left(b \cdot \frac{1}{6}\right)\right)\right), b\right), \left(\frac{1}{\frac{1}{2} - b \cdot \frac{1}{6}}\right)\right)\right)\right)\right)\right) \]
                        8. metadata-evalN/A

                          \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(\frac{1}{4}, \left(\left(b \cdot \frac{1}{6}\right) \cdot \left(b \cdot \frac{1}{6}\right)\right)\right), b\right), \left(\frac{1}{\frac{1}{2} - b \cdot \frac{1}{6}}\right)\right)\right)\right)\right)\right) \]
                        9. swap-sqrN/A

                          \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(\frac{1}{4}, \left(\left(b \cdot b\right) \cdot \left(\frac{1}{6} \cdot \frac{1}{6}\right)\right)\right), b\right), \left(\frac{1}{\frac{1}{2} - b \cdot \frac{1}{6}}\right)\right)\right)\right)\right)\right) \]
                        10. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(\frac{1}{4}, \mathsf{*.f64}\left(\left(b \cdot b\right), \left(\frac{1}{6} \cdot \frac{1}{6}\right)\right)\right), b\right), \left(\frac{1}{\frac{1}{2} - b \cdot \frac{1}{6}}\right)\right)\right)\right)\right)\right) \]
                        11. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(\frac{1}{4}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(\frac{1}{6} \cdot \frac{1}{6}\right)\right)\right), b\right), \left(\frac{1}{\frac{1}{2} - b \cdot \frac{1}{6}}\right)\right)\right)\right)\right)\right) \]
                        12. metadata-evalN/A

                          \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(\frac{1}{4}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\right), \frac{1}{36}\right)\right), b\right), \left(\frac{1}{\frac{1}{2} - b \cdot \frac{1}{6}}\right)\right)\right)\right)\right)\right) \]
                        13. /-lowering-/.f64N/A

                          \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(\frac{1}{4}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\right), \frac{1}{36}\right)\right), b\right), \mathsf{/.f64}\left(1, \color{blue}{\left(\frac{1}{2} - b \cdot \frac{1}{6}\right)}\right)\right)\right)\right)\right)\right) \]
                        14. --lowering--.f64N/A

                          \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(\frac{1}{4}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\right), \frac{1}{36}\right)\right), b\right), \mathsf{/.f64}\left(1, \mathsf{\_.f64}\left(\frac{1}{2}, \color{blue}{\left(b \cdot \frac{1}{6}\right)}\right)\right)\right)\right)\right)\right)\right) \]
                        15. *-lowering-*.f6471.2%

                          \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(\frac{1}{4}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\right), \frac{1}{36}\right)\right), b\right), \mathsf{/.f64}\left(1, \mathsf{\_.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(b, \color{blue}{\frac{1}{6}}\right)\right)\right)\right)\right)\right)\right)\right) \]
                      10. Applied egg-rr71.2%

                        \[\leadsto \frac{1}{2 + b \cdot \left(1 + \color{blue}{\left(\left(0.25 - \left(b \cdot b\right) \cdot 0.027777777777777776\right) \cdot b\right) \cdot \frac{1}{0.5 - b \cdot 0.16666666666666666}}\right)} \]
                      11. Taylor expanded in b around 0

                        \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(\frac{1}{4}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\right), \frac{1}{36}\right)\right), b\right), \color{blue}{\left(2 + b \cdot \left(\frac{2}{3} + b \cdot \left(\frac{2}{9} + \frac{2}{27} \cdot b\right)\right)\right)}\right)\right)\right)\right)\right) \]
                      12. Step-by-step derivation
                        1. +-lowering-+.f64N/A

                          \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(\frac{1}{4}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\right), \frac{1}{36}\right)\right), b\right), \mathsf{+.f64}\left(2, \color{blue}{\left(b \cdot \left(\frac{2}{3} + b \cdot \left(\frac{2}{9} + \frac{2}{27} \cdot b\right)\right)\right)}\right)\right)\right)\right)\right)\right) \]
                        2. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(\frac{1}{4}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\right), \frac{1}{36}\right)\right), b\right), \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \color{blue}{\left(\frac{2}{3} + b \cdot \left(\frac{2}{9} + \frac{2}{27} \cdot b\right)\right)}\right)\right)\right)\right)\right)\right)\right) \]
                        3. +-lowering-+.f64N/A

                          \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(\frac{1}{4}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\right), \frac{1}{36}\right)\right), b\right), \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(\frac{2}{3}, \color{blue}{\left(b \cdot \left(\frac{2}{9} + \frac{2}{27} \cdot b\right)\right)}\right)\right)\right)\right)\right)\right)\right)\right) \]
                        4. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(\frac{1}{4}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\right), \frac{1}{36}\right)\right), b\right), \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(\frac{2}{3}, \mathsf{*.f64}\left(b, \color{blue}{\left(\frac{2}{9} + \frac{2}{27} \cdot b\right)}\right)\right)\right)\right)\right)\right)\right)\right)\right) \]
                        5. +-lowering-+.f64N/A

                          \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(\frac{1}{4}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\right), \frac{1}{36}\right)\right), b\right), \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(\frac{2}{3}, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(\frac{2}{9}, \color{blue}{\left(\frac{2}{27} \cdot b\right)}\right)\right)\right)\right)\right)\right)\right)\right)\right)\right) \]
                        6. *-commutativeN/A

                          \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(\frac{1}{4}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\right), \frac{1}{36}\right)\right), b\right), \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(\frac{2}{3}, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(\frac{2}{9}, \left(b \cdot \color{blue}{\frac{2}{27}}\right)\right)\right)\right)\right)\right)\right)\right)\right)\right)\right) \]
                        7. *-lowering-*.f6479.6%

                          \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(\frac{1}{4}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\right), \frac{1}{36}\right)\right), b\right), \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(\frac{2}{3}, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(\frac{2}{9}, \mathsf{*.f64}\left(b, \color{blue}{\frac{2}{27}}\right)\right)\right)\right)\right)\right)\right)\right)\right)\right)\right) \]
                      13. Simplified79.6%

                        \[\leadsto \frac{1}{2 + b \cdot \left(1 + \left(\left(0.25 - \left(b \cdot b\right) \cdot 0.027777777777777776\right) \cdot b\right) \cdot \color{blue}{\left(2 + b \cdot \left(0.6666666666666666 + b \cdot \left(0.2222222222222222 + b \cdot 0.07407407407407407\right)\right)\right)}\right)} \]
                    5. Recombined 4 regimes into one program.
                    6. Final simplification77.9%

                      \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -6.5 \cdot 10^{-9}:\\ \;\;\;\;1\\ \mathbf{elif}\;b \leq -9.6 \cdot 10^{-204}:\\ \;\;\;\;0.5 + a \cdot 0.25\\ \mathbf{elif}\;b \leq -5 \cdot 10^{-289}:\\ \;\;\;\;0.020833333333333332 \cdot \left(b \cdot \left(b \cdot b\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{2 + b \cdot \left(1 + \left(b \cdot \left(0.25 - \left(b \cdot b\right) \cdot 0.027777777777777776\right)\right) \cdot \left(2 + b \cdot \left(0.6666666666666666 + b \cdot \left(0.2222222222222222 + b \cdot 0.07407407407407407\right)\right)\right)\right)}\\ \end{array} \]
                    7. Add Preprocessing

                    Alternative 9: 73.5% accurate, 7.3× speedup?

                    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq -6.5 \cdot 10^{-9}:\\ \;\;\;\;1\\ \mathbf{elif}\;b \leq -9.6 \cdot 10^{-204}:\\ \;\;\;\;0.5 + a \cdot 0.25\\ \mathbf{elif}\;b \leq -8 \cdot 10^{-289}:\\ \;\;\;\;0.020833333333333332 \cdot \left(b \cdot \left(b \cdot b\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{2 + b \cdot \left(1 + \left(b \cdot \left(0.25 - \left(b \cdot b\right) \cdot 0.027777777777777776\right)\right) \cdot \left(2 + b \cdot \left(0.6666666666666666 + b \cdot 0.2222222222222222\right)\right)\right)}\\ \end{array} \end{array} \]
                    (FPCore (a b)
                     :precision binary64
                     (if (<= b -6.5e-9)
                       1.0
                       (if (<= b -9.6e-204)
                         (+ 0.5 (* a 0.25))
                         (if (<= b -8e-289)
                           (* 0.020833333333333332 (* b (* b b)))
                           (/
                            1.0
                            (+
                             2.0
                             (*
                              b
                              (+
                               1.0
                               (*
                                (* b (- 0.25 (* (* b b) 0.027777777777777776)))
                                (+
                                 2.0
                                 (* b (+ 0.6666666666666666 (* b 0.2222222222222222)))))))))))))
                    double code(double a, double b) {
                    	double tmp;
                    	if (b <= -6.5e-9) {
                    		tmp = 1.0;
                    	} else if (b <= -9.6e-204) {
                    		tmp = 0.5 + (a * 0.25);
                    	} else if (b <= -8e-289) {
                    		tmp = 0.020833333333333332 * (b * (b * b));
                    	} else {
                    		tmp = 1.0 / (2.0 + (b * (1.0 + ((b * (0.25 - ((b * b) * 0.027777777777777776))) * (2.0 + (b * (0.6666666666666666 + (b * 0.2222222222222222))))))));
                    	}
                    	return tmp;
                    }
                    
                    real(8) function code(a, b)
                        real(8), intent (in) :: a
                        real(8), intent (in) :: b
                        real(8) :: tmp
                        if (b <= (-6.5d-9)) then
                            tmp = 1.0d0
                        else if (b <= (-9.6d-204)) then
                            tmp = 0.5d0 + (a * 0.25d0)
                        else if (b <= (-8d-289)) then
                            tmp = 0.020833333333333332d0 * (b * (b * b))
                        else
                            tmp = 1.0d0 / (2.0d0 + (b * (1.0d0 + ((b * (0.25d0 - ((b * b) * 0.027777777777777776d0))) * (2.0d0 + (b * (0.6666666666666666d0 + (b * 0.2222222222222222d0))))))))
                        end if
                        code = tmp
                    end function
                    
                    public static double code(double a, double b) {
                    	double tmp;
                    	if (b <= -6.5e-9) {
                    		tmp = 1.0;
                    	} else if (b <= -9.6e-204) {
                    		tmp = 0.5 + (a * 0.25);
                    	} else if (b <= -8e-289) {
                    		tmp = 0.020833333333333332 * (b * (b * b));
                    	} else {
                    		tmp = 1.0 / (2.0 + (b * (1.0 + ((b * (0.25 - ((b * b) * 0.027777777777777776))) * (2.0 + (b * (0.6666666666666666 + (b * 0.2222222222222222))))))));
                    	}
                    	return tmp;
                    }
                    
                    def code(a, b):
                    	tmp = 0
                    	if b <= -6.5e-9:
                    		tmp = 1.0
                    	elif b <= -9.6e-204:
                    		tmp = 0.5 + (a * 0.25)
                    	elif b <= -8e-289:
                    		tmp = 0.020833333333333332 * (b * (b * b))
                    	else:
                    		tmp = 1.0 / (2.0 + (b * (1.0 + ((b * (0.25 - ((b * b) * 0.027777777777777776))) * (2.0 + (b * (0.6666666666666666 + (b * 0.2222222222222222))))))))
                    	return tmp
                    
                    function code(a, b)
                    	tmp = 0.0
                    	if (b <= -6.5e-9)
                    		tmp = 1.0;
                    	elseif (b <= -9.6e-204)
                    		tmp = Float64(0.5 + Float64(a * 0.25));
                    	elseif (b <= -8e-289)
                    		tmp = Float64(0.020833333333333332 * Float64(b * Float64(b * b)));
                    	else
                    		tmp = Float64(1.0 / Float64(2.0 + Float64(b * Float64(1.0 + Float64(Float64(b * Float64(0.25 - Float64(Float64(b * b) * 0.027777777777777776))) * Float64(2.0 + Float64(b * Float64(0.6666666666666666 + Float64(b * 0.2222222222222222)))))))));
                    	end
                    	return tmp
                    end
                    
                    function tmp_2 = code(a, b)
                    	tmp = 0.0;
                    	if (b <= -6.5e-9)
                    		tmp = 1.0;
                    	elseif (b <= -9.6e-204)
                    		tmp = 0.5 + (a * 0.25);
                    	elseif (b <= -8e-289)
                    		tmp = 0.020833333333333332 * (b * (b * b));
                    	else
                    		tmp = 1.0 / (2.0 + (b * (1.0 + ((b * (0.25 - ((b * b) * 0.027777777777777776))) * (2.0 + (b * (0.6666666666666666 + (b * 0.2222222222222222))))))));
                    	end
                    	tmp_2 = tmp;
                    end
                    
                    code[a_, b_] := If[LessEqual[b, -6.5e-9], 1.0, If[LessEqual[b, -9.6e-204], N[(0.5 + N[(a * 0.25), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, -8e-289], N[(0.020833333333333332 * N[(b * N[(b * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(2.0 + N[(b * N[(1.0 + N[(N[(b * N[(0.25 - N[(N[(b * b), $MachinePrecision] * 0.027777777777777776), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(2.0 + N[(b * N[(0.6666666666666666 + N[(b * 0.2222222222222222), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
                    
                    \begin{array}{l}
                    
                    \\
                    \begin{array}{l}
                    \mathbf{if}\;b \leq -6.5 \cdot 10^{-9}:\\
                    \;\;\;\;1\\
                    
                    \mathbf{elif}\;b \leq -9.6 \cdot 10^{-204}:\\
                    \;\;\;\;0.5 + a \cdot 0.25\\
                    
                    \mathbf{elif}\;b \leq -8 \cdot 10^{-289}:\\
                    \;\;\;\;0.020833333333333332 \cdot \left(b \cdot \left(b \cdot b\right)\right)\\
                    
                    \mathbf{else}:\\
                    \;\;\;\;\frac{1}{2 + b \cdot \left(1 + \left(b \cdot \left(0.25 - \left(b \cdot b\right) \cdot 0.027777777777777776\right)\right) \cdot \left(2 + b \cdot \left(0.6666666666666666 + b \cdot 0.2222222222222222\right)\right)\right)}\\
                    
                    
                    \end{array}
                    \end{array}
                    
                    Derivation
                    1. Split input into 4 regimes
                    2. if b < -6.5000000000000003e-9

                      1. Initial program 97.9%

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

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

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

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

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

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

                          \[\leadsto \mathsf{exp.f64}\left(\left(\log \left(e^{a} + e^{b}\right) \cdot -1 + a\right)\right) \]
                        7. +-lowering-+.f64N/A

                          \[\leadsto \mathsf{exp.f64}\left(\mathsf{+.f64}\left(\left(\log \left(e^{a} + e^{b}\right) \cdot -1\right), a\right)\right) \]
                        8. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{exp.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\log \left(e^{a} + e^{b}\right), -1\right), a\right)\right) \]
                        9. log-lowering-log.f64N/A

                          \[\leadsto \mathsf{exp.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{log.f64}\left(\left(e^{a} + e^{b}\right)\right), -1\right), a\right)\right) \]
                        10. +-lowering-+.f64N/A

                          \[\leadsto \mathsf{exp.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(\left(e^{a}\right), \left(e^{b}\right)\right)\right), -1\right), a\right)\right) \]
                        11. exp-lowering-exp.f64N/A

                          \[\leadsto \mathsf{exp.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(a\right), \left(e^{b}\right)\right)\right), -1\right), a\right)\right) \]
                        12. exp-lowering-exp.f6498.0%

                          \[\leadsto \mathsf{exp.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(a\right), \mathsf{exp.f64}\left(b\right)\right)\right), -1\right), a\right)\right) \]
                      4. Applied egg-rr98.0%

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

                        \[\leadsto \mathsf{exp.f64}\left(\color{blue}{a}\right) \]
                      6. Step-by-step derivation
                        1. Simplified97.7%

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

                          \[\leadsto \color{blue}{1} \]
                        3. Step-by-step derivation
                          1. Simplified98.0%

                            \[\leadsto \color{blue}{1} \]

                          if -6.5000000000000003e-9 < b < -9.6e-204

                          1. Initial program 100.0%

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

                            \[\leadsto \mathsf{/.f64}\left(\mathsf{exp.f64}\left(a\right), \mathsf{+.f64}\left(\mathsf{exp.f64}\left(a\right), \color{blue}{1}\right)\right) \]
                          4. Step-by-step derivation
                            1. Simplified100.0%

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

                              \[\leadsto \color{blue}{\frac{1}{2} + \frac{1}{4} \cdot a} \]
                            3. Step-by-step derivation
                              1. +-lowering-+.f64N/A

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

                                \[\leadsto \mathsf{+.f64}\left(\frac{1}{2}, \left(a \cdot \color{blue}{\frac{1}{4}}\right)\right) \]
                              3. *-lowering-*.f6454.8%

                                \[\leadsto \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(a, \color{blue}{\frac{1}{4}}\right)\right) \]
                            4. Simplified54.8%

                              \[\leadsto \color{blue}{0.5 + a \cdot 0.25} \]

                            if -9.6e-204 < b < -8.0000000000000001e-289

                            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. /-lowering-/.f64N/A

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

                                \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \color{blue}{\left(e^{b}\right)}\right)\right) \]
                              3. exp-lowering-exp.f6436.7%

                                \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(b\right)\right)\right) \]
                            5. Simplified36.7%

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

                              \[\leadsto \color{blue}{\frac{1}{2} + b \cdot \left(\frac{1}{48} \cdot {b}^{2} - \frac{1}{4}\right)} \]
                            7. Step-by-step derivation
                              1. +-lowering-+.f64N/A

                                \[\leadsto \mathsf{+.f64}\left(\frac{1}{2}, \color{blue}{\left(b \cdot \left(\frac{1}{48} \cdot {b}^{2} - \frac{1}{4}\right)\right)}\right) \]
                              2. *-lowering-*.f64N/A

                                \[\leadsto \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(b, \color{blue}{\left(\frac{1}{48} \cdot {b}^{2} - \frac{1}{4}\right)}\right)\right) \]
                              3. sub-negN/A

                                \[\leadsto \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(b, \left(\frac{1}{48} \cdot {b}^{2} + \color{blue}{\left(\mathsf{neg}\left(\frac{1}{4}\right)\right)}\right)\right)\right) \]
                              4. metadata-evalN/A

                                \[\leadsto \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(b, \left(\frac{1}{48} \cdot {b}^{2} + \frac{-1}{4}\right)\right)\right) \]
                              5. +-commutativeN/A

                                \[\leadsto \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(b, \left(\frac{-1}{4} + \color{blue}{\frac{1}{48} \cdot {b}^{2}}\right)\right)\right) \]
                              6. +-lowering-+.f64N/A

                                \[\leadsto \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(\frac{-1}{4}, \color{blue}{\left(\frac{1}{48} \cdot {b}^{2}\right)}\right)\right)\right) \]
                              7. *-commutativeN/A

                                \[\leadsto \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(\frac{-1}{4}, \left({b}^{2} \cdot \color{blue}{\frac{1}{48}}\right)\right)\right)\right) \]
                              8. unpow2N/A

                                \[\leadsto \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(\frac{-1}{4}, \left(\left(b \cdot b\right) \cdot \frac{1}{48}\right)\right)\right)\right) \]
                              9. associate-*l*N/A

                                \[\leadsto \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(\frac{-1}{4}, \left(b \cdot \color{blue}{\left(b \cdot \frac{1}{48}\right)}\right)\right)\right)\right) \]
                              10. *-lowering-*.f64N/A

                                \[\leadsto \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(\frac{-1}{4}, \mathsf{*.f64}\left(b, \color{blue}{\left(b \cdot \frac{1}{48}\right)}\right)\right)\right)\right) \]
                              11. *-lowering-*.f6436.7%

                                \[\leadsto \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(\frac{-1}{4}, \mathsf{*.f64}\left(b, \mathsf{*.f64}\left(b, \color{blue}{\frac{1}{48}}\right)\right)\right)\right)\right) \]
                            8. Simplified36.7%

                              \[\leadsto \color{blue}{0.5 + b \cdot \left(-0.25 + b \cdot \left(b \cdot 0.020833333333333332\right)\right)} \]
                            9. Taylor expanded in b around inf

                              \[\leadsto \color{blue}{\frac{1}{48} \cdot {b}^{3}} \]
                            10. Step-by-step derivation
                              1. *-lowering-*.f64N/A

                                \[\leadsto \mathsf{*.f64}\left(\frac{1}{48}, \color{blue}{\left({b}^{3}\right)}\right) \]
                              2. cube-multN/A

                                \[\leadsto \mathsf{*.f64}\left(\frac{1}{48}, \left(b \cdot \color{blue}{\left(b \cdot b\right)}\right)\right) \]
                              3. unpow2N/A

                                \[\leadsto \mathsf{*.f64}\left(\frac{1}{48}, \left(b \cdot {b}^{\color{blue}{2}}\right)\right) \]
                              4. *-lowering-*.f64N/A

                                \[\leadsto \mathsf{*.f64}\left(\frac{1}{48}, \mathsf{*.f64}\left(b, \color{blue}{\left({b}^{2}\right)}\right)\right) \]
                              5. unpow2N/A

                                \[\leadsto \mathsf{*.f64}\left(\frac{1}{48}, \mathsf{*.f64}\left(b, \left(b \cdot \color{blue}{b}\right)\right)\right) \]
                              6. *-lowering-*.f6466.5%

                                \[\leadsto \mathsf{*.f64}\left(\frac{1}{48}, \mathsf{*.f64}\left(b, \mathsf{*.f64}\left(b, \color{blue}{b}\right)\right)\right) \]
                            11. Simplified66.5%

                              \[\leadsto \color{blue}{0.020833333333333332 \cdot \left(b \cdot \left(b \cdot b\right)\right)} \]

                            if -8.0000000000000001e-289 < b

                            1. Initial program 99.3%

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

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

                                \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \color{blue}{\left(e^{b}\right)}\right)\right) \]
                              3. exp-lowering-exp.f6482.8%

                                \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(b\right)\right)\right) \]
                            5. Simplified82.8%

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

                              \[\leadsto \mathsf{/.f64}\left(1, \color{blue}{\left(2 + b \cdot \left(1 + b \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot b\right)\right)\right)}\right) \]
                            7. Step-by-step derivation
                              1. +-lowering-+.f64N/A

                                \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \color{blue}{\left(b \cdot \left(1 + b \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot b\right)\right)\right)}\right)\right) \]
                              2. *-lowering-*.f64N/A

                                \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \color{blue}{\left(1 + b \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot b\right)\right)}\right)\right)\right) \]
                              3. +-lowering-+.f64N/A

                                \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(1, \color{blue}{\left(b \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot b\right)\right)}\right)\right)\right)\right) \]
                              4. *-lowering-*.f64N/A

                                \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(b, \color{blue}{\left(\frac{1}{2} + \frac{1}{6} \cdot b\right)}\right)\right)\right)\right)\right) \]
                              5. +-lowering-+.f64N/A

                                \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(\frac{1}{2}, \color{blue}{\left(\frac{1}{6} \cdot b\right)}\right)\right)\right)\right)\right)\right) \]
                              6. *-commutativeN/A

                                \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(\frac{1}{2}, \left(b \cdot \color{blue}{\frac{1}{6}}\right)\right)\right)\right)\right)\right)\right) \]
                              7. *-lowering-*.f6471.2%

                                \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(b, \color{blue}{\frac{1}{6}}\right)\right)\right)\right)\right)\right)\right) \]
                            8. Simplified71.2%

                              \[\leadsto \frac{1}{\color{blue}{2 + b \cdot \left(1 + b \cdot \left(0.5 + b \cdot 0.16666666666666666\right)\right)}} \]
                            9. Step-by-step derivation
                              1. *-commutativeN/A

                                \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(1, \left(\left(\frac{1}{2} + b \cdot \frac{1}{6}\right) \cdot \color{blue}{b}\right)\right)\right)\right)\right) \]
                              2. flip-+N/A

                                \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(1, \left(\frac{\frac{1}{2} \cdot \frac{1}{2} - \left(b \cdot \frac{1}{6}\right) \cdot \left(b \cdot \frac{1}{6}\right)}{\frac{1}{2} - b \cdot \frac{1}{6}} \cdot b\right)\right)\right)\right)\right) \]
                              3. associate-*l/N/A

                                \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(1, \left(\frac{\left(\frac{1}{2} \cdot \frac{1}{2} - \left(b \cdot \frac{1}{6}\right) \cdot \left(b \cdot \frac{1}{6}\right)\right) \cdot b}{\color{blue}{\frac{1}{2} - b \cdot \frac{1}{6}}}\right)\right)\right)\right)\right) \]
                              4. div-invN/A

                                \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(1, \left(\left(\left(\frac{1}{2} \cdot \frac{1}{2} - \left(b \cdot \frac{1}{6}\right) \cdot \left(b \cdot \frac{1}{6}\right)\right) \cdot b\right) \cdot \color{blue}{\frac{1}{\frac{1}{2} - b \cdot \frac{1}{6}}}\right)\right)\right)\right)\right) \]
                              5. *-lowering-*.f64N/A

                                \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\left(\left(\frac{1}{2} \cdot \frac{1}{2} - \left(b \cdot \frac{1}{6}\right) \cdot \left(b \cdot \frac{1}{6}\right)\right) \cdot b\right), \color{blue}{\left(\frac{1}{\frac{1}{2} - b \cdot \frac{1}{6}}\right)}\right)\right)\right)\right)\right) \]
                              6. *-lowering-*.f64N/A

                                \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(\frac{1}{2} \cdot \frac{1}{2} - \left(b \cdot \frac{1}{6}\right) \cdot \left(b \cdot \frac{1}{6}\right)\right), b\right), \left(\frac{\color{blue}{1}}{\frac{1}{2} - b \cdot \frac{1}{6}}\right)\right)\right)\right)\right)\right) \]
                              7. --lowering--.f64N/A

                                \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(\left(\frac{1}{2} \cdot \frac{1}{2}\right), \left(\left(b \cdot \frac{1}{6}\right) \cdot \left(b \cdot \frac{1}{6}\right)\right)\right), b\right), \left(\frac{1}{\frac{1}{2} - b \cdot \frac{1}{6}}\right)\right)\right)\right)\right)\right) \]
                              8. metadata-evalN/A

                                \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(\frac{1}{4}, \left(\left(b \cdot \frac{1}{6}\right) \cdot \left(b \cdot \frac{1}{6}\right)\right)\right), b\right), \left(\frac{1}{\frac{1}{2} - b \cdot \frac{1}{6}}\right)\right)\right)\right)\right)\right) \]
                              9. swap-sqrN/A

                                \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(\frac{1}{4}, \left(\left(b \cdot b\right) \cdot \left(\frac{1}{6} \cdot \frac{1}{6}\right)\right)\right), b\right), \left(\frac{1}{\frac{1}{2} - b \cdot \frac{1}{6}}\right)\right)\right)\right)\right)\right) \]
                              10. *-lowering-*.f64N/A

                                \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(\frac{1}{4}, \mathsf{*.f64}\left(\left(b \cdot b\right), \left(\frac{1}{6} \cdot \frac{1}{6}\right)\right)\right), b\right), \left(\frac{1}{\frac{1}{2} - b \cdot \frac{1}{6}}\right)\right)\right)\right)\right)\right) \]
                              11. *-lowering-*.f64N/A

                                \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(\frac{1}{4}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(\frac{1}{6} \cdot \frac{1}{6}\right)\right)\right), b\right), \left(\frac{1}{\frac{1}{2} - b \cdot \frac{1}{6}}\right)\right)\right)\right)\right)\right) \]
                              12. metadata-evalN/A

                                \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(\frac{1}{4}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\right), \frac{1}{36}\right)\right), b\right), \left(\frac{1}{\frac{1}{2} - b \cdot \frac{1}{6}}\right)\right)\right)\right)\right)\right) \]
                              13. /-lowering-/.f64N/A

                                \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(\frac{1}{4}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\right), \frac{1}{36}\right)\right), b\right), \mathsf{/.f64}\left(1, \color{blue}{\left(\frac{1}{2} - b \cdot \frac{1}{6}\right)}\right)\right)\right)\right)\right)\right) \]
                              14. --lowering--.f64N/A

                                \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(\frac{1}{4}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\right), \frac{1}{36}\right)\right), b\right), \mathsf{/.f64}\left(1, \mathsf{\_.f64}\left(\frac{1}{2}, \color{blue}{\left(b \cdot \frac{1}{6}\right)}\right)\right)\right)\right)\right)\right)\right) \]
                              15. *-lowering-*.f6471.2%

                                \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(\frac{1}{4}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\right), \frac{1}{36}\right)\right), b\right), \mathsf{/.f64}\left(1, \mathsf{\_.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(b, \color{blue}{\frac{1}{6}}\right)\right)\right)\right)\right)\right)\right)\right) \]
                            10. Applied egg-rr71.2%

                              \[\leadsto \frac{1}{2 + b \cdot \left(1 + \color{blue}{\left(\left(0.25 - \left(b \cdot b\right) \cdot 0.027777777777777776\right) \cdot b\right) \cdot \frac{1}{0.5 - b \cdot 0.16666666666666666}}\right)} \]
                            11. Taylor expanded in b around 0

                              \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(\frac{1}{4}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\right), \frac{1}{36}\right)\right), b\right), \color{blue}{\left(2 + b \cdot \left(\frac{2}{3} + \frac{2}{9} \cdot b\right)\right)}\right)\right)\right)\right)\right) \]
                            12. Step-by-step derivation
                              1. +-lowering-+.f64N/A

                                \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(\frac{1}{4}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\right), \frac{1}{36}\right)\right), b\right), \mathsf{+.f64}\left(2, \color{blue}{\left(b \cdot \left(\frac{2}{3} + \frac{2}{9} \cdot b\right)\right)}\right)\right)\right)\right)\right)\right) \]
                              2. *-lowering-*.f64N/A

                                \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(\frac{1}{4}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\right), \frac{1}{36}\right)\right), b\right), \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \color{blue}{\left(\frac{2}{3} + \frac{2}{9} \cdot b\right)}\right)\right)\right)\right)\right)\right)\right) \]
                              3. +-lowering-+.f64N/A

                                \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(\frac{1}{4}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\right), \frac{1}{36}\right)\right), b\right), \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(\frac{2}{3}, \color{blue}{\left(\frac{2}{9} \cdot b\right)}\right)\right)\right)\right)\right)\right)\right)\right) \]
                              4. *-commutativeN/A

                                \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(\frac{1}{4}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\right), \frac{1}{36}\right)\right), b\right), \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(\frac{2}{3}, \left(b \cdot \color{blue}{\frac{2}{9}}\right)\right)\right)\right)\right)\right)\right)\right)\right) \]
                              5. *-lowering-*.f6478.3%

                                \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(\frac{1}{4}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\right), \frac{1}{36}\right)\right), b\right), \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(\frac{2}{3}, \mathsf{*.f64}\left(b, \color{blue}{\frac{2}{9}}\right)\right)\right)\right)\right)\right)\right)\right)\right) \]
                            13. Simplified78.3%

                              \[\leadsto \frac{1}{2 + b \cdot \left(1 + \left(\left(0.25 - \left(b \cdot b\right) \cdot 0.027777777777777776\right) \cdot b\right) \cdot \color{blue}{\left(2 + b \cdot \left(0.6666666666666666 + b \cdot 0.2222222222222222\right)\right)}\right)} \]
                          5. Recombined 4 regimes into one program.
                          6. Final simplification77.2%

                            \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -6.5 \cdot 10^{-9}:\\ \;\;\;\;1\\ \mathbf{elif}\;b \leq -9.6 \cdot 10^{-204}:\\ \;\;\;\;0.5 + a \cdot 0.25\\ \mathbf{elif}\;b \leq -8 \cdot 10^{-289}:\\ \;\;\;\;0.020833333333333332 \cdot \left(b \cdot \left(b \cdot b\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{2 + b \cdot \left(1 + \left(b \cdot \left(0.25 - \left(b \cdot b\right) \cdot 0.027777777777777776\right)\right) \cdot \left(2 + b \cdot \left(0.6666666666666666 + b \cdot 0.2222222222222222\right)\right)\right)}\\ \end{array} \]
                          7. Add Preprocessing

                          Alternative 10: 72.6% accurate, 8.0× speedup?

                          \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq -6.5 \cdot 10^{-9}:\\ \;\;\;\;1\\ \mathbf{elif}\;b \leq -1.2 \cdot 10^{-203}:\\ \;\;\;\;0.5 + a \cdot 0.25\\ \mathbf{elif}\;b \leq -8.1 \cdot 10^{-289}:\\ \;\;\;\;0.020833333333333332 \cdot \left(b \cdot \left(b \cdot b\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{2 + b \cdot \left(1 + \left(b \cdot \left(0.25 - \left(b \cdot b\right) \cdot 0.027777777777777776\right)\right) \cdot \left(2 + b \cdot 0.6666666666666666\right)\right)}\\ \end{array} \end{array} \]
                          (FPCore (a b)
                           :precision binary64
                           (if (<= b -6.5e-9)
                             1.0
                             (if (<= b -1.2e-203)
                               (+ 0.5 (* a 0.25))
                               (if (<= b -8.1e-289)
                                 (* 0.020833333333333332 (* b (* b b)))
                                 (/
                                  1.0
                                  (+
                                   2.0
                                   (*
                                    b
                                    (+
                                     1.0
                                     (*
                                      (* b (- 0.25 (* (* b b) 0.027777777777777776)))
                                      (+ 2.0 (* b 0.6666666666666666)))))))))))
                          double code(double a, double b) {
                          	double tmp;
                          	if (b <= -6.5e-9) {
                          		tmp = 1.0;
                          	} else if (b <= -1.2e-203) {
                          		tmp = 0.5 + (a * 0.25);
                          	} else if (b <= -8.1e-289) {
                          		tmp = 0.020833333333333332 * (b * (b * b));
                          	} else {
                          		tmp = 1.0 / (2.0 + (b * (1.0 + ((b * (0.25 - ((b * b) * 0.027777777777777776))) * (2.0 + (b * 0.6666666666666666))))));
                          	}
                          	return tmp;
                          }
                          
                          real(8) function code(a, b)
                              real(8), intent (in) :: a
                              real(8), intent (in) :: b
                              real(8) :: tmp
                              if (b <= (-6.5d-9)) then
                                  tmp = 1.0d0
                              else if (b <= (-1.2d-203)) then
                                  tmp = 0.5d0 + (a * 0.25d0)
                              else if (b <= (-8.1d-289)) then
                                  tmp = 0.020833333333333332d0 * (b * (b * b))
                              else
                                  tmp = 1.0d0 / (2.0d0 + (b * (1.0d0 + ((b * (0.25d0 - ((b * b) * 0.027777777777777776d0))) * (2.0d0 + (b * 0.6666666666666666d0))))))
                              end if
                              code = tmp
                          end function
                          
                          public static double code(double a, double b) {
                          	double tmp;
                          	if (b <= -6.5e-9) {
                          		tmp = 1.0;
                          	} else if (b <= -1.2e-203) {
                          		tmp = 0.5 + (a * 0.25);
                          	} else if (b <= -8.1e-289) {
                          		tmp = 0.020833333333333332 * (b * (b * b));
                          	} else {
                          		tmp = 1.0 / (2.0 + (b * (1.0 + ((b * (0.25 - ((b * b) * 0.027777777777777776))) * (2.0 + (b * 0.6666666666666666))))));
                          	}
                          	return tmp;
                          }
                          
                          def code(a, b):
                          	tmp = 0
                          	if b <= -6.5e-9:
                          		tmp = 1.0
                          	elif b <= -1.2e-203:
                          		tmp = 0.5 + (a * 0.25)
                          	elif b <= -8.1e-289:
                          		tmp = 0.020833333333333332 * (b * (b * b))
                          	else:
                          		tmp = 1.0 / (2.0 + (b * (1.0 + ((b * (0.25 - ((b * b) * 0.027777777777777776))) * (2.0 + (b * 0.6666666666666666))))))
                          	return tmp
                          
                          function code(a, b)
                          	tmp = 0.0
                          	if (b <= -6.5e-9)
                          		tmp = 1.0;
                          	elseif (b <= -1.2e-203)
                          		tmp = Float64(0.5 + Float64(a * 0.25));
                          	elseif (b <= -8.1e-289)
                          		tmp = Float64(0.020833333333333332 * Float64(b * Float64(b * b)));
                          	else
                          		tmp = Float64(1.0 / Float64(2.0 + Float64(b * Float64(1.0 + Float64(Float64(b * Float64(0.25 - Float64(Float64(b * b) * 0.027777777777777776))) * Float64(2.0 + Float64(b * 0.6666666666666666)))))));
                          	end
                          	return tmp
                          end
                          
                          function tmp_2 = code(a, b)
                          	tmp = 0.0;
                          	if (b <= -6.5e-9)
                          		tmp = 1.0;
                          	elseif (b <= -1.2e-203)
                          		tmp = 0.5 + (a * 0.25);
                          	elseif (b <= -8.1e-289)
                          		tmp = 0.020833333333333332 * (b * (b * b));
                          	else
                          		tmp = 1.0 / (2.0 + (b * (1.0 + ((b * (0.25 - ((b * b) * 0.027777777777777776))) * (2.0 + (b * 0.6666666666666666))))));
                          	end
                          	tmp_2 = tmp;
                          end
                          
                          code[a_, b_] := If[LessEqual[b, -6.5e-9], 1.0, If[LessEqual[b, -1.2e-203], N[(0.5 + N[(a * 0.25), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, -8.1e-289], N[(0.020833333333333332 * N[(b * N[(b * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(2.0 + N[(b * N[(1.0 + N[(N[(b * N[(0.25 - N[(N[(b * b), $MachinePrecision] * 0.027777777777777776), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(2.0 + N[(b * 0.6666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
                          
                          \begin{array}{l}
                          
                          \\
                          \begin{array}{l}
                          \mathbf{if}\;b \leq -6.5 \cdot 10^{-9}:\\
                          \;\;\;\;1\\
                          
                          \mathbf{elif}\;b \leq -1.2 \cdot 10^{-203}:\\
                          \;\;\;\;0.5 + a \cdot 0.25\\
                          
                          \mathbf{elif}\;b \leq -8.1 \cdot 10^{-289}:\\
                          \;\;\;\;0.020833333333333332 \cdot \left(b \cdot \left(b \cdot b\right)\right)\\
                          
                          \mathbf{else}:\\
                          \;\;\;\;\frac{1}{2 + b \cdot \left(1 + \left(b \cdot \left(0.25 - \left(b \cdot b\right) \cdot 0.027777777777777776\right)\right) \cdot \left(2 + b \cdot 0.6666666666666666\right)\right)}\\
                          
                          
                          \end{array}
                          \end{array}
                          
                          Derivation
                          1. Split input into 4 regimes
                          2. if b < -6.5000000000000003e-9

                            1. Initial program 97.9%

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

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

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

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

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

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

                                \[\leadsto \mathsf{exp.f64}\left(\left(\log \left(e^{a} + e^{b}\right) \cdot -1 + a\right)\right) \]
                              7. +-lowering-+.f64N/A

                                \[\leadsto \mathsf{exp.f64}\left(\mathsf{+.f64}\left(\left(\log \left(e^{a} + e^{b}\right) \cdot -1\right), a\right)\right) \]
                              8. *-lowering-*.f64N/A

                                \[\leadsto \mathsf{exp.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\log \left(e^{a} + e^{b}\right), -1\right), a\right)\right) \]
                              9. log-lowering-log.f64N/A

                                \[\leadsto \mathsf{exp.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{log.f64}\left(\left(e^{a} + e^{b}\right)\right), -1\right), a\right)\right) \]
                              10. +-lowering-+.f64N/A

                                \[\leadsto \mathsf{exp.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(\left(e^{a}\right), \left(e^{b}\right)\right)\right), -1\right), a\right)\right) \]
                              11. exp-lowering-exp.f64N/A

                                \[\leadsto \mathsf{exp.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(a\right), \left(e^{b}\right)\right)\right), -1\right), a\right)\right) \]
                              12. exp-lowering-exp.f6498.0%

                                \[\leadsto \mathsf{exp.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(a\right), \mathsf{exp.f64}\left(b\right)\right)\right), -1\right), a\right)\right) \]
                            4. Applied egg-rr98.0%

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

                              \[\leadsto \mathsf{exp.f64}\left(\color{blue}{a}\right) \]
                            6. Step-by-step derivation
                              1. Simplified97.7%

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

                                \[\leadsto \color{blue}{1} \]
                              3. Step-by-step derivation
                                1. Simplified98.0%

                                  \[\leadsto \color{blue}{1} \]

                                if -6.5000000000000003e-9 < b < -1.1999999999999999e-203

                                1. Initial program 100.0%

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

                                  \[\leadsto \mathsf{/.f64}\left(\mathsf{exp.f64}\left(a\right), \mathsf{+.f64}\left(\mathsf{exp.f64}\left(a\right), \color{blue}{1}\right)\right) \]
                                4. Step-by-step derivation
                                  1. Simplified100.0%

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

                                    \[\leadsto \color{blue}{\frac{1}{2} + \frac{1}{4} \cdot a} \]
                                  3. Step-by-step derivation
                                    1. +-lowering-+.f64N/A

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

                                      \[\leadsto \mathsf{+.f64}\left(\frac{1}{2}, \left(a \cdot \color{blue}{\frac{1}{4}}\right)\right) \]
                                    3. *-lowering-*.f6454.8%

                                      \[\leadsto \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(a, \color{blue}{\frac{1}{4}}\right)\right) \]
                                  4. Simplified54.8%

                                    \[\leadsto \color{blue}{0.5 + a \cdot 0.25} \]

                                  if -1.1999999999999999e-203 < b < -8.1000000000000003e-289

                                  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. /-lowering-/.f64N/A

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

                                      \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \color{blue}{\left(e^{b}\right)}\right)\right) \]
                                    3. exp-lowering-exp.f6436.7%

                                      \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(b\right)\right)\right) \]
                                  5. Simplified36.7%

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

                                    \[\leadsto \color{blue}{\frac{1}{2} + b \cdot \left(\frac{1}{48} \cdot {b}^{2} - \frac{1}{4}\right)} \]
                                  7. Step-by-step derivation
                                    1. +-lowering-+.f64N/A

                                      \[\leadsto \mathsf{+.f64}\left(\frac{1}{2}, \color{blue}{\left(b \cdot \left(\frac{1}{48} \cdot {b}^{2} - \frac{1}{4}\right)\right)}\right) \]
                                    2. *-lowering-*.f64N/A

                                      \[\leadsto \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(b, \color{blue}{\left(\frac{1}{48} \cdot {b}^{2} - \frac{1}{4}\right)}\right)\right) \]
                                    3. sub-negN/A

                                      \[\leadsto \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(b, \left(\frac{1}{48} \cdot {b}^{2} + \color{blue}{\left(\mathsf{neg}\left(\frac{1}{4}\right)\right)}\right)\right)\right) \]
                                    4. metadata-evalN/A

                                      \[\leadsto \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(b, \left(\frac{1}{48} \cdot {b}^{2} + \frac{-1}{4}\right)\right)\right) \]
                                    5. +-commutativeN/A

                                      \[\leadsto \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(b, \left(\frac{-1}{4} + \color{blue}{\frac{1}{48} \cdot {b}^{2}}\right)\right)\right) \]
                                    6. +-lowering-+.f64N/A

                                      \[\leadsto \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(\frac{-1}{4}, \color{blue}{\left(\frac{1}{48} \cdot {b}^{2}\right)}\right)\right)\right) \]
                                    7. *-commutativeN/A

                                      \[\leadsto \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(\frac{-1}{4}, \left({b}^{2} \cdot \color{blue}{\frac{1}{48}}\right)\right)\right)\right) \]
                                    8. unpow2N/A

                                      \[\leadsto \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(\frac{-1}{4}, \left(\left(b \cdot b\right) \cdot \frac{1}{48}\right)\right)\right)\right) \]
                                    9. associate-*l*N/A

                                      \[\leadsto \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(\frac{-1}{4}, \left(b \cdot \color{blue}{\left(b \cdot \frac{1}{48}\right)}\right)\right)\right)\right) \]
                                    10. *-lowering-*.f64N/A

                                      \[\leadsto \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(\frac{-1}{4}, \mathsf{*.f64}\left(b, \color{blue}{\left(b \cdot \frac{1}{48}\right)}\right)\right)\right)\right) \]
                                    11. *-lowering-*.f6436.7%

                                      \[\leadsto \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(\frac{-1}{4}, \mathsf{*.f64}\left(b, \mathsf{*.f64}\left(b, \color{blue}{\frac{1}{48}}\right)\right)\right)\right)\right) \]
                                  8. Simplified36.7%

                                    \[\leadsto \color{blue}{0.5 + b \cdot \left(-0.25 + b \cdot \left(b \cdot 0.020833333333333332\right)\right)} \]
                                  9. Taylor expanded in b around inf

                                    \[\leadsto \color{blue}{\frac{1}{48} \cdot {b}^{3}} \]
                                  10. Step-by-step derivation
                                    1. *-lowering-*.f64N/A

                                      \[\leadsto \mathsf{*.f64}\left(\frac{1}{48}, \color{blue}{\left({b}^{3}\right)}\right) \]
                                    2. cube-multN/A

                                      \[\leadsto \mathsf{*.f64}\left(\frac{1}{48}, \left(b \cdot \color{blue}{\left(b \cdot b\right)}\right)\right) \]
                                    3. unpow2N/A

                                      \[\leadsto \mathsf{*.f64}\left(\frac{1}{48}, \left(b \cdot {b}^{\color{blue}{2}}\right)\right) \]
                                    4. *-lowering-*.f64N/A

                                      \[\leadsto \mathsf{*.f64}\left(\frac{1}{48}, \mathsf{*.f64}\left(b, \color{blue}{\left({b}^{2}\right)}\right)\right) \]
                                    5. unpow2N/A

                                      \[\leadsto \mathsf{*.f64}\left(\frac{1}{48}, \mathsf{*.f64}\left(b, \left(b \cdot \color{blue}{b}\right)\right)\right) \]
                                    6. *-lowering-*.f6466.5%

                                      \[\leadsto \mathsf{*.f64}\left(\frac{1}{48}, \mathsf{*.f64}\left(b, \mathsf{*.f64}\left(b, \color{blue}{b}\right)\right)\right) \]
                                  11. Simplified66.5%

                                    \[\leadsto \color{blue}{0.020833333333333332 \cdot \left(b \cdot \left(b \cdot b\right)\right)} \]

                                  if -8.1000000000000003e-289 < b

                                  1. Initial program 99.3%

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

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

                                      \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \color{blue}{\left(e^{b}\right)}\right)\right) \]
                                    3. exp-lowering-exp.f6482.8%

                                      \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(b\right)\right)\right) \]
                                  5. Simplified82.8%

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

                                    \[\leadsto \mathsf{/.f64}\left(1, \color{blue}{\left(2 + b \cdot \left(1 + b \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot b\right)\right)\right)}\right) \]
                                  7. Step-by-step derivation
                                    1. +-lowering-+.f64N/A

                                      \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \color{blue}{\left(b \cdot \left(1 + b \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot b\right)\right)\right)}\right)\right) \]
                                    2. *-lowering-*.f64N/A

                                      \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \color{blue}{\left(1 + b \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot b\right)\right)}\right)\right)\right) \]
                                    3. +-lowering-+.f64N/A

                                      \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(1, \color{blue}{\left(b \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot b\right)\right)}\right)\right)\right)\right) \]
                                    4. *-lowering-*.f64N/A

                                      \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(b, \color{blue}{\left(\frac{1}{2} + \frac{1}{6} \cdot b\right)}\right)\right)\right)\right)\right) \]
                                    5. +-lowering-+.f64N/A

                                      \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(\frac{1}{2}, \color{blue}{\left(\frac{1}{6} \cdot b\right)}\right)\right)\right)\right)\right)\right) \]
                                    6. *-commutativeN/A

                                      \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(\frac{1}{2}, \left(b \cdot \color{blue}{\frac{1}{6}}\right)\right)\right)\right)\right)\right)\right) \]
                                    7. *-lowering-*.f6471.2%

                                      \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(b, \color{blue}{\frac{1}{6}}\right)\right)\right)\right)\right)\right)\right) \]
                                  8. Simplified71.2%

                                    \[\leadsto \frac{1}{\color{blue}{2 + b \cdot \left(1 + b \cdot \left(0.5 + b \cdot 0.16666666666666666\right)\right)}} \]
                                  9. Step-by-step derivation
                                    1. *-commutativeN/A

                                      \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(1, \left(\left(\frac{1}{2} + b \cdot \frac{1}{6}\right) \cdot \color{blue}{b}\right)\right)\right)\right)\right) \]
                                    2. flip-+N/A

                                      \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(1, \left(\frac{\frac{1}{2} \cdot \frac{1}{2} - \left(b \cdot \frac{1}{6}\right) \cdot \left(b \cdot \frac{1}{6}\right)}{\frac{1}{2} - b \cdot \frac{1}{6}} \cdot b\right)\right)\right)\right)\right) \]
                                    3. associate-*l/N/A

                                      \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(1, \left(\frac{\left(\frac{1}{2} \cdot \frac{1}{2} - \left(b \cdot \frac{1}{6}\right) \cdot \left(b \cdot \frac{1}{6}\right)\right) \cdot b}{\color{blue}{\frac{1}{2} - b \cdot \frac{1}{6}}}\right)\right)\right)\right)\right) \]
                                    4. div-invN/A

                                      \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(1, \left(\left(\left(\frac{1}{2} \cdot \frac{1}{2} - \left(b \cdot \frac{1}{6}\right) \cdot \left(b \cdot \frac{1}{6}\right)\right) \cdot b\right) \cdot \color{blue}{\frac{1}{\frac{1}{2} - b \cdot \frac{1}{6}}}\right)\right)\right)\right)\right) \]
                                    5. *-lowering-*.f64N/A

                                      \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\left(\left(\frac{1}{2} \cdot \frac{1}{2} - \left(b \cdot \frac{1}{6}\right) \cdot \left(b \cdot \frac{1}{6}\right)\right) \cdot b\right), \color{blue}{\left(\frac{1}{\frac{1}{2} - b \cdot \frac{1}{6}}\right)}\right)\right)\right)\right)\right) \]
                                    6. *-lowering-*.f64N/A

                                      \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(\frac{1}{2} \cdot \frac{1}{2} - \left(b \cdot \frac{1}{6}\right) \cdot \left(b \cdot \frac{1}{6}\right)\right), b\right), \left(\frac{\color{blue}{1}}{\frac{1}{2} - b \cdot \frac{1}{6}}\right)\right)\right)\right)\right)\right) \]
                                    7. --lowering--.f64N/A

                                      \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(\left(\frac{1}{2} \cdot \frac{1}{2}\right), \left(\left(b \cdot \frac{1}{6}\right) \cdot \left(b \cdot \frac{1}{6}\right)\right)\right), b\right), \left(\frac{1}{\frac{1}{2} - b \cdot \frac{1}{6}}\right)\right)\right)\right)\right)\right) \]
                                    8. metadata-evalN/A

                                      \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(\frac{1}{4}, \left(\left(b \cdot \frac{1}{6}\right) \cdot \left(b \cdot \frac{1}{6}\right)\right)\right), b\right), \left(\frac{1}{\frac{1}{2} - b \cdot \frac{1}{6}}\right)\right)\right)\right)\right)\right) \]
                                    9. swap-sqrN/A

                                      \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(\frac{1}{4}, \left(\left(b \cdot b\right) \cdot \left(\frac{1}{6} \cdot \frac{1}{6}\right)\right)\right), b\right), \left(\frac{1}{\frac{1}{2} - b \cdot \frac{1}{6}}\right)\right)\right)\right)\right)\right) \]
                                    10. *-lowering-*.f64N/A

                                      \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(\frac{1}{4}, \mathsf{*.f64}\left(\left(b \cdot b\right), \left(\frac{1}{6} \cdot \frac{1}{6}\right)\right)\right), b\right), \left(\frac{1}{\frac{1}{2} - b \cdot \frac{1}{6}}\right)\right)\right)\right)\right)\right) \]
                                    11. *-lowering-*.f64N/A

                                      \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(\frac{1}{4}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(\frac{1}{6} \cdot \frac{1}{6}\right)\right)\right), b\right), \left(\frac{1}{\frac{1}{2} - b \cdot \frac{1}{6}}\right)\right)\right)\right)\right)\right) \]
                                    12. metadata-evalN/A

                                      \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(\frac{1}{4}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\right), \frac{1}{36}\right)\right), b\right), \left(\frac{1}{\frac{1}{2} - b \cdot \frac{1}{6}}\right)\right)\right)\right)\right)\right) \]
                                    13. /-lowering-/.f64N/A

                                      \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(\frac{1}{4}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\right), \frac{1}{36}\right)\right), b\right), \mathsf{/.f64}\left(1, \color{blue}{\left(\frac{1}{2} - b \cdot \frac{1}{6}\right)}\right)\right)\right)\right)\right)\right) \]
                                    14. --lowering--.f64N/A

                                      \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(\frac{1}{4}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\right), \frac{1}{36}\right)\right), b\right), \mathsf{/.f64}\left(1, \mathsf{\_.f64}\left(\frac{1}{2}, \color{blue}{\left(b \cdot \frac{1}{6}\right)}\right)\right)\right)\right)\right)\right)\right) \]
                                    15. *-lowering-*.f6471.2%

                                      \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(\frac{1}{4}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\right), \frac{1}{36}\right)\right), b\right), \mathsf{/.f64}\left(1, \mathsf{\_.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(b, \color{blue}{\frac{1}{6}}\right)\right)\right)\right)\right)\right)\right)\right) \]
                                  10. Applied egg-rr71.2%

                                    \[\leadsto \frac{1}{2 + b \cdot \left(1 + \color{blue}{\left(\left(0.25 - \left(b \cdot b\right) \cdot 0.027777777777777776\right) \cdot b\right) \cdot \frac{1}{0.5 - b \cdot 0.16666666666666666}}\right)} \]
                                  11. Taylor expanded in b around 0

                                    \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(\frac{1}{4}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\right), \frac{1}{36}\right)\right), b\right), \color{blue}{\left(2 + \frac{2}{3} \cdot b\right)}\right)\right)\right)\right)\right) \]
                                  12. Step-by-step derivation
                                    1. +-lowering-+.f64N/A

                                      \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(\frac{1}{4}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\right), \frac{1}{36}\right)\right), b\right), \mathsf{+.f64}\left(2, \color{blue}{\left(\frac{2}{3} \cdot b\right)}\right)\right)\right)\right)\right)\right) \]
                                    2. *-commutativeN/A

                                      \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(\frac{1}{4}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\right), \frac{1}{36}\right)\right), b\right), \mathsf{+.f64}\left(2, \left(b \cdot \color{blue}{\frac{2}{3}}\right)\right)\right)\right)\right)\right)\right) \]
                                    3. *-lowering-*.f6478.2%

                                      \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(\frac{1}{4}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\right), \frac{1}{36}\right)\right), b\right), \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \color{blue}{\frac{2}{3}}\right)\right)\right)\right)\right)\right)\right) \]
                                  13. Simplified78.2%

                                    \[\leadsto \frac{1}{2 + b \cdot \left(1 + \left(\left(0.25 - \left(b \cdot b\right) \cdot 0.027777777777777776\right) \cdot b\right) \cdot \color{blue}{\left(2 + b \cdot 0.6666666666666666\right)}\right)} \]
                                5. Recombined 4 regimes into one program.
                                6. Final simplification77.2%

                                  \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -6.5 \cdot 10^{-9}:\\ \;\;\;\;1\\ \mathbf{elif}\;b \leq -1.2 \cdot 10^{-203}:\\ \;\;\;\;0.5 + a \cdot 0.25\\ \mathbf{elif}\;b \leq -8.1 \cdot 10^{-289}:\\ \;\;\;\;0.020833333333333332 \cdot \left(b \cdot \left(b \cdot b\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{2 + b \cdot \left(1 + \left(b \cdot \left(0.25 - \left(b \cdot b\right) \cdot 0.027777777777777776\right)\right) \cdot \left(2 + b \cdot 0.6666666666666666\right)\right)}\\ \end{array} \]
                                7. Add Preprocessing

                                Alternative 11: 71.3% accurate, 9.0× speedup?

                                \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq -6.5 \cdot 10^{-9}:\\ \;\;\;\;1\\ \mathbf{elif}\;b \leq -2.4 \cdot 10^{-202}:\\ \;\;\;\;0.5 + a \cdot 0.25\\ \mathbf{elif}\;b \leq -4.9 \cdot 10^{-289}:\\ \;\;\;\;0.020833333333333332 \cdot \left(b \cdot \left(b \cdot b\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{2 + b \cdot \left(1 + 2 \cdot \left(b \cdot \left(0.25 - \left(b \cdot b\right) \cdot 0.027777777777777776\right)\right)\right)}\\ \end{array} \end{array} \]
                                (FPCore (a b)
                                 :precision binary64
                                 (if (<= b -6.5e-9)
                                   1.0
                                   (if (<= b -2.4e-202)
                                     (+ 0.5 (* a 0.25))
                                     (if (<= b -4.9e-289)
                                       (* 0.020833333333333332 (* b (* b b)))
                                       (/
                                        1.0
                                        (+
                                         2.0
                                         (*
                                          b
                                          (+
                                           1.0
                                           (* 2.0 (* b (- 0.25 (* (* b b) 0.027777777777777776))))))))))))
                                double code(double a, double b) {
                                	double tmp;
                                	if (b <= -6.5e-9) {
                                		tmp = 1.0;
                                	} else if (b <= -2.4e-202) {
                                		tmp = 0.5 + (a * 0.25);
                                	} else if (b <= -4.9e-289) {
                                		tmp = 0.020833333333333332 * (b * (b * b));
                                	} else {
                                		tmp = 1.0 / (2.0 + (b * (1.0 + (2.0 * (b * (0.25 - ((b * b) * 0.027777777777777776)))))));
                                	}
                                	return tmp;
                                }
                                
                                real(8) function code(a, b)
                                    real(8), intent (in) :: a
                                    real(8), intent (in) :: b
                                    real(8) :: tmp
                                    if (b <= (-6.5d-9)) then
                                        tmp = 1.0d0
                                    else if (b <= (-2.4d-202)) then
                                        tmp = 0.5d0 + (a * 0.25d0)
                                    else if (b <= (-4.9d-289)) then
                                        tmp = 0.020833333333333332d0 * (b * (b * b))
                                    else
                                        tmp = 1.0d0 / (2.0d0 + (b * (1.0d0 + (2.0d0 * (b * (0.25d0 - ((b * b) * 0.027777777777777776d0)))))))
                                    end if
                                    code = tmp
                                end function
                                
                                public static double code(double a, double b) {
                                	double tmp;
                                	if (b <= -6.5e-9) {
                                		tmp = 1.0;
                                	} else if (b <= -2.4e-202) {
                                		tmp = 0.5 + (a * 0.25);
                                	} else if (b <= -4.9e-289) {
                                		tmp = 0.020833333333333332 * (b * (b * b));
                                	} else {
                                		tmp = 1.0 / (2.0 + (b * (1.0 + (2.0 * (b * (0.25 - ((b * b) * 0.027777777777777776)))))));
                                	}
                                	return tmp;
                                }
                                
                                def code(a, b):
                                	tmp = 0
                                	if b <= -6.5e-9:
                                		tmp = 1.0
                                	elif b <= -2.4e-202:
                                		tmp = 0.5 + (a * 0.25)
                                	elif b <= -4.9e-289:
                                		tmp = 0.020833333333333332 * (b * (b * b))
                                	else:
                                		tmp = 1.0 / (2.0 + (b * (1.0 + (2.0 * (b * (0.25 - ((b * b) * 0.027777777777777776)))))))
                                	return tmp
                                
                                function code(a, b)
                                	tmp = 0.0
                                	if (b <= -6.5e-9)
                                		tmp = 1.0;
                                	elseif (b <= -2.4e-202)
                                		tmp = Float64(0.5 + Float64(a * 0.25));
                                	elseif (b <= -4.9e-289)
                                		tmp = Float64(0.020833333333333332 * Float64(b * Float64(b * b)));
                                	else
                                		tmp = Float64(1.0 / Float64(2.0 + Float64(b * Float64(1.0 + Float64(2.0 * Float64(b * Float64(0.25 - Float64(Float64(b * b) * 0.027777777777777776))))))));
                                	end
                                	return tmp
                                end
                                
                                function tmp_2 = code(a, b)
                                	tmp = 0.0;
                                	if (b <= -6.5e-9)
                                		tmp = 1.0;
                                	elseif (b <= -2.4e-202)
                                		tmp = 0.5 + (a * 0.25);
                                	elseif (b <= -4.9e-289)
                                		tmp = 0.020833333333333332 * (b * (b * b));
                                	else
                                		tmp = 1.0 / (2.0 + (b * (1.0 + (2.0 * (b * (0.25 - ((b * b) * 0.027777777777777776)))))));
                                	end
                                	tmp_2 = tmp;
                                end
                                
                                code[a_, b_] := If[LessEqual[b, -6.5e-9], 1.0, If[LessEqual[b, -2.4e-202], N[(0.5 + N[(a * 0.25), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, -4.9e-289], N[(0.020833333333333332 * N[(b * N[(b * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(2.0 + N[(b * N[(1.0 + N[(2.0 * N[(b * N[(0.25 - N[(N[(b * b), $MachinePrecision] * 0.027777777777777776), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
                                
                                \begin{array}{l}
                                
                                \\
                                \begin{array}{l}
                                \mathbf{if}\;b \leq -6.5 \cdot 10^{-9}:\\
                                \;\;\;\;1\\
                                
                                \mathbf{elif}\;b \leq -2.4 \cdot 10^{-202}:\\
                                \;\;\;\;0.5 + a \cdot 0.25\\
                                
                                \mathbf{elif}\;b \leq -4.9 \cdot 10^{-289}:\\
                                \;\;\;\;0.020833333333333332 \cdot \left(b \cdot \left(b \cdot b\right)\right)\\
                                
                                \mathbf{else}:\\
                                \;\;\;\;\frac{1}{2 + b \cdot \left(1 + 2 \cdot \left(b \cdot \left(0.25 - \left(b \cdot b\right) \cdot 0.027777777777777776\right)\right)\right)}\\
                                
                                
                                \end{array}
                                \end{array}
                                
                                Derivation
                                1. Split input into 4 regimes
                                2. if b < -6.5000000000000003e-9

                                  1. Initial program 97.9%

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

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

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

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

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

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

                                      \[\leadsto \mathsf{exp.f64}\left(\left(\log \left(e^{a} + e^{b}\right) \cdot -1 + a\right)\right) \]
                                    7. +-lowering-+.f64N/A

                                      \[\leadsto \mathsf{exp.f64}\left(\mathsf{+.f64}\left(\left(\log \left(e^{a} + e^{b}\right) \cdot -1\right), a\right)\right) \]
                                    8. *-lowering-*.f64N/A

                                      \[\leadsto \mathsf{exp.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\log \left(e^{a} + e^{b}\right), -1\right), a\right)\right) \]
                                    9. log-lowering-log.f64N/A

                                      \[\leadsto \mathsf{exp.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{log.f64}\left(\left(e^{a} + e^{b}\right)\right), -1\right), a\right)\right) \]
                                    10. +-lowering-+.f64N/A

                                      \[\leadsto \mathsf{exp.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(\left(e^{a}\right), \left(e^{b}\right)\right)\right), -1\right), a\right)\right) \]
                                    11. exp-lowering-exp.f64N/A

                                      \[\leadsto \mathsf{exp.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(a\right), \left(e^{b}\right)\right)\right), -1\right), a\right)\right) \]
                                    12. exp-lowering-exp.f6498.0%

                                      \[\leadsto \mathsf{exp.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(a\right), \mathsf{exp.f64}\left(b\right)\right)\right), -1\right), a\right)\right) \]
                                  4. Applied egg-rr98.0%

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

                                    \[\leadsto \mathsf{exp.f64}\left(\color{blue}{a}\right) \]
                                  6. Step-by-step derivation
                                    1. Simplified97.7%

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

                                      \[\leadsto \color{blue}{1} \]
                                    3. Step-by-step derivation
                                      1. Simplified98.0%

                                        \[\leadsto \color{blue}{1} \]

                                      if -6.5000000000000003e-9 < b < -2.4000000000000001e-202

                                      1. Initial program 100.0%

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

                                        \[\leadsto \mathsf{/.f64}\left(\mathsf{exp.f64}\left(a\right), \mathsf{+.f64}\left(\mathsf{exp.f64}\left(a\right), \color{blue}{1}\right)\right) \]
                                      4. Step-by-step derivation
                                        1. Simplified100.0%

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

                                          \[\leadsto \color{blue}{\frac{1}{2} + \frac{1}{4} \cdot a} \]
                                        3. Step-by-step derivation
                                          1. +-lowering-+.f64N/A

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

                                            \[\leadsto \mathsf{+.f64}\left(\frac{1}{2}, \left(a \cdot \color{blue}{\frac{1}{4}}\right)\right) \]
                                          3. *-lowering-*.f6454.8%

                                            \[\leadsto \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(a, \color{blue}{\frac{1}{4}}\right)\right) \]
                                        4. Simplified54.8%

                                          \[\leadsto \color{blue}{0.5 + a \cdot 0.25} \]

                                        if -2.4000000000000001e-202 < b < -4.90000000000000008e-289

                                        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. /-lowering-/.f64N/A

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

                                            \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \color{blue}{\left(e^{b}\right)}\right)\right) \]
                                          3. exp-lowering-exp.f6436.7%

                                            \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(b\right)\right)\right) \]
                                        5. Simplified36.7%

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

                                          \[\leadsto \color{blue}{\frac{1}{2} + b \cdot \left(\frac{1}{48} \cdot {b}^{2} - \frac{1}{4}\right)} \]
                                        7. Step-by-step derivation
                                          1. +-lowering-+.f64N/A

                                            \[\leadsto \mathsf{+.f64}\left(\frac{1}{2}, \color{blue}{\left(b \cdot \left(\frac{1}{48} \cdot {b}^{2} - \frac{1}{4}\right)\right)}\right) \]
                                          2. *-lowering-*.f64N/A

                                            \[\leadsto \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(b, \color{blue}{\left(\frac{1}{48} \cdot {b}^{2} - \frac{1}{4}\right)}\right)\right) \]
                                          3. sub-negN/A

                                            \[\leadsto \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(b, \left(\frac{1}{48} \cdot {b}^{2} + \color{blue}{\left(\mathsf{neg}\left(\frac{1}{4}\right)\right)}\right)\right)\right) \]
                                          4. metadata-evalN/A

                                            \[\leadsto \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(b, \left(\frac{1}{48} \cdot {b}^{2} + \frac{-1}{4}\right)\right)\right) \]
                                          5. +-commutativeN/A

                                            \[\leadsto \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(b, \left(\frac{-1}{4} + \color{blue}{\frac{1}{48} \cdot {b}^{2}}\right)\right)\right) \]
                                          6. +-lowering-+.f64N/A

                                            \[\leadsto \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(\frac{-1}{4}, \color{blue}{\left(\frac{1}{48} \cdot {b}^{2}\right)}\right)\right)\right) \]
                                          7. *-commutativeN/A

                                            \[\leadsto \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(\frac{-1}{4}, \left({b}^{2} \cdot \color{blue}{\frac{1}{48}}\right)\right)\right)\right) \]
                                          8. unpow2N/A

                                            \[\leadsto \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(\frac{-1}{4}, \left(\left(b \cdot b\right) \cdot \frac{1}{48}\right)\right)\right)\right) \]
                                          9. associate-*l*N/A

                                            \[\leadsto \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(\frac{-1}{4}, \left(b \cdot \color{blue}{\left(b \cdot \frac{1}{48}\right)}\right)\right)\right)\right) \]
                                          10. *-lowering-*.f64N/A

                                            \[\leadsto \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(\frac{-1}{4}, \mathsf{*.f64}\left(b, \color{blue}{\left(b \cdot \frac{1}{48}\right)}\right)\right)\right)\right) \]
                                          11. *-lowering-*.f6436.7%

                                            \[\leadsto \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(\frac{-1}{4}, \mathsf{*.f64}\left(b, \mathsf{*.f64}\left(b, \color{blue}{\frac{1}{48}}\right)\right)\right)\right)\right) \]
                                        8. Simplified36.7%

                                          \[\leadsto \color{blue}{0.5 + b \cdot \left(-0.25 + b \cdot \left(b \cdot 0.020833333333333332\right)\right)} \]
                                        9. Taylor expanded in b around inf

                                          \[\leadsto \color{blue}{\frac{1}{48} \cdot {b}^{3}} \]
                                        10. Step-by-step derivation
                                          1. *-lowering-*.f64N/A

                                            \[\leadsto \mathsf{*.f64}\left(\frac{1}{48}, \color{blue}{\left({b}^{3}\right)}\right) \]
                                          2. cube-multN/A

                                            \[\leadsto \mathsf{*.f64}\left(\frac{1}{48}, \left(b \cdot \color{blue}{\left(b \cdot b\right)}\right)\right) \]
                                          3. unpow2N/A

                                            \[\leadsto \mathsf{*.f64}\left(\frac{1}{48}, \left(b \cdot {b}^{\color{blue}{2}}\right)\right) \]
                                          4. *-lowering-*.f64N/A

                                            \[\leadsto \mathsf{*.f64}\left(\frac{1}{48}, \mathsf{*.f64}\left(b, \color{blue}{\left({b}^{2}\right)}\right)\right) \]
                                          5. unpow2N/A

                                            \[\leadsto \mathsf{*.f64}\left(\frac{1}{48}, \mathsf{*.f64}\left(b, \left(b \cdot \color{blue}{b}\right)\right)\right) \]
                                          6. *-lowering-*.f6466.5%

                                            \[\leadsto \mathsf{*.f64}\left(\frac{1}{48}, \mathsf{*.f64}\left(b, \mathsf{*.f64}\left(b, \color{blue}{b}\right)\right)\right) \]
                                        11. Simplified66.5%

                                          \[\leadsto \color{blue}{0.020833333333333332 \cdot \left(b \cdot \left(b \cdot b\right)\right)} \]

                                        if -4.90000000000000008e-289 < b

                                        1. Initial program 99.3%

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

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

                                            \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \color{blue}{\left(e^{b}\right)}\right)\right) \]
                                          3. exp-lowering-exp.f6482.8%

                                            \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(b\right)\right)\right) \]
                                        5. Simplified82.8%

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

                                          \[\leadsto \mathsf{/.f64}\left(1, \color{blue}{\left(2 + b \cdot \left(1 + b \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot b\right)\right)\right)}\right) \]
                                        7. Step-by-step derivation
                                          1. +-lowering-+.f64N/A

                                            \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \color{blue}{\left(b \cdot \left(1 + b \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot b\right)\right)\right)}\right)\right) \]
                                          2. *-lowering-*.f64N/A

                                            \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \color{blue}{\left(1 + b \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot b\right)\right)}\right)\right)\right) \]
                                          3. +-lowering-+.f64N/A

                                            \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(1, \color{blue}{\left(b \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot b\right)\right)}\right)\right)\right)\right) \]
                                          4. *-lowering-*.f64N/A

                                            \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(b, \color{blue}{\left(\frac{1}{2} + \frac{1}{6} \cdot b\right)}\right)\right)\right)\right)\right) \]
                                          5. +-lowering-+.f64N/A

                                            \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(\frac{1}{2}, \color{blue}{\left(\frac{1}{6} \cdot b\right)}\right)\right)\right)\right)\right)\right) \]
                                          6. *-commutativeN/A

                                            \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(\frac{1}{2}, \left(b \cdot \color{blue}{\frac{1}{6}}\right)\right)\right)\right)\right)\right)\right) \]
                                          7. *-lowering-*.f6471.2%

                                            \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(b, \color{blue}{\frac{1}{6}}\right)\right)\right)\right)\right)\right)\right) \]
                                        8. Simplified71.2%

                                          \[\leadsto \frac{1}{\color{blue}{2 + b \cdot \left(1 + b \cdot \left(0.5 + b \cdot 0.16666666666666666\right)\right)}} \]
                                        9. Step-by-step derivation
                                          1. *-commutativeN/A

                                            \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(1, \left(\left(\frac{1}{2} + b \cdot \frac{1}{6}\right) \cdot \color{blue}{b}\right)\right)\right)\right)\right) \]
                                          2. flip-+N/A

                                            \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(1, \left(\frac{\frac{1}{2} \cdot \frac{1}{2} - \left(b \cdot \frac{1}{6}\right) \cdot \left(b \cdot \frac{1}{6}\right)}{\frac{1}{2} - b \cdot \frac{1}{6}} \cdot b\right)\right)\right)\right)\right) \]
                                          3. associate-*l/N/A

                                            \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(1, \left(\frac{\left(\frac{1}{2} \cdot \frac{1}{2} - \left(b \cdot \frac{1}{6}\right) \cdot \left(b \cdot \frac{1}{6}\right)\right) \cdot b}{\color{blue}{\frac{1}{2} - b \cdot \frac{1}{6}}}\right)\right)\right)\right)\right) \]
                                          4. div-invN/A

                                            \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(1, \left(\left(\left(\frac{1}{2} \cdot \frac{1}{2} - \left(b \cdot \frac{1}{6}\right) \cdot \left(b \cdot \frac{1}{6}\right)\right) \cdot b\right) \cdot \color{blue}{\frac{1}{\frac{1}{2} - b \cdot \frac{1}{6}}}\right)\right)\right)\right)\right) \]
                                          5. *-lowering-*.f64N/A

                                            \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\left(\left(\frac{1}{2} \cdot \frac{1}{2} - \left(b \cdot \frac{1}{6}\right) \cdot \left(b \cdot \frac{1}{6}\right)\right) \cdot b\right), \color{blue}{\left(\frac{1}{\frac{1}{2} - b \cdot \frac{1}{6}}\right)}\right)\right)\right)\right)\right) \]
                                          6. *-lowering-*.f64N/A

                                            \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(\frac{1}{2} \cdot \frac{1}{2} - \left(b \cdot \frac{1}{6}\right) \cdot \left(b \cdot \frac{1}{6}\right)\right), b\right), \left(\frac{\color{blue}{1}}{\frac{1}{2} - b \cdot \frac{1}{6}}\right)\right)\right)\right)\right)\right) \]
                                          7. --lowering--.f64N/A

                                            \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(\left(\frac{1}{2} \cdot \frac{1}{2}\right), \left(\left(b \cdot \frac{1}{6}\right) \cdot \left(b \cdot \frac{1}{6}\right)\right)\right), b\right), \left(\frac{1}{\frac{1}{2} - b \cdot \frac{1}{6}}\right)\right)\right)\right)\right)\right) \]
                                          8. metadata-evalN/A

                                            \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(\frac{1}{4}, \left(\left(b \cdot \frac{1}{6}\right) \cdot \left(b \cdot \frac{1}{6}\right)\right)\right), b\right), \left(\frac{1}{\frac{1}{2} - b \cdot \frac{1}{6}}\right)\right)\right)\right)\right)\right) \]
                                          9. swap-sqrN/A

                                            \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(\frac{1}{4}, \left(\left(b \cdot b\right) \cdot \left(\frac{1}{6} \cdot \frac{1}{6}\right)\right)\right), b\right), \left(\frac{1}{\frac{1}{2} - b \cdot \frac{1}{6}}\right)\right)\right)\right)\right)\right) \]
                                          10. *-lowering-*.f64N/A

                                            \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(\frac{1}{4}, \mathsf{*.f64}\left(\left(b \cdot b\right), \left(\frac{1}{6} \cdot \frac{1}{6}\right)\right)\right), b\right), \left(\frac{1}{\frac{1}{2} - b \cdot \frac{1}{6}}\right)\right)\right)\right)\right)\right) \]
                                          11. *-lowering-*.f64N/A

                                            \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(\frac{1}{4}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(\frac{1}{6} \cdot \frac{1}{6}\right)\right)\right), b\right), \left(\frac{1}{\frac{1}{2} - b \cdot \frac{1}{6}}\right)\right)\right)\right)\right)\right) \]
                                          12. metadata-evalN/A

                                            \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(\frac{1}{4}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\right), \frac{1}{36}\right)\right), b\right), \left(\frac{1}{\frac{1}{2} - b \cdot \frac{1}{6}}\right)\right)\right)\right)\right)\right) \]
                                          13. /-lowering-/.f64N/A

                                            \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(\frac{1}{4}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\right), \frac{1}{36}\right)\right), b\right), \mathsf{/.f64}\left(1, \color{blue}{\left(\frac{1}{2} - b \cdot \frac{1}{6}\right)}\right)\right)\right)\right)\right)\right) \]
                                          14. --lowering--.f64N/A

                                            \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(\frac{1}{4}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\right), \frac{1}{36}\right)\right), b\right), \mathsf{/.f64}\left(1, \mathsf{\_.f64}\left(\frac{1}{2}, \color{blue}{\left(b \cdot \frac{1}{6}\right)}\right)\right)\right)\right)\right)\right)\right) \]
                                          15. *-lowering-*.f6471.2%

                                            \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(\frac{1}{4}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\right), \frac{1}{36}\right)\right), b\right), \mathsf{/.f64}\left(1, \mathsf{\_.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(b, \color{blue}{\frac{1}{6}}\right)\right)\right)\right)\right)\right)\right)\right) \]
                                        10. Applied egg-rr71.2%

                                          \[\leadsto \frac{1}{2 + b \cdot \left(1 + \color{blue}{\left(\left(0.25 - \left(b \cdot b\right) \cdot 0.027777777777777776\right) \cdot b\right) \cdot \frac{1}{0.5 - b \cdot 0.16666666666666666}}\right)} \]
                                        11. Taylor expanded in b around 0

                                          \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(\frac{1}{4}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\right), \frac{1}{36}\right)\right), b\right), \color{blue}{2}\right)\right)\right)\right)\right) \]
                                        12. Step-by-step derivation
                                          1. Simplified76.2%

                                            \[\leadsto \frac{1}{2 + b \cdot \left(1 + \left(\left(0.25 - \left(b \cdot b\right) \cdot 0.027777777777777776\right) \cdot b\right) \cdot \color{blue}{2}\right)} \]
                                        13. Recombined 4 regimes into one program.
                                        14. Final simplification76.1%

                                          \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -6.5 \cdot 10^{-9}:\\ \;\;\;\;1\\ \mathbf{elif}\;b \leq -2.4 \cdot 10^{-202}:\\ \;\;\;\;0.5 + a \cdot 0.25\\ \mathbf{elif}\;b \leq -4.9 \cdot 10^{-289}:\\ \;\;\;\;0.020833333333333332 \cdot \left(b \cdot \left(b \cdot b\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{2 + b \cdot \left(1 + 2 \cdot \left(b \cdot \left(0.25 - \left(b \cdot b\right) \cdot 0.027777777777777776\right)\right)\right)}\\ \end{array} \]
                                        15. Add Preprocessing

                                        Alternative 12: 69.0% accurate, 9.8× speedup?

                                        \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq -6.5 \cdot 10^{-9}:\\ \;\;\;\;1\\ \mathbf{elif}\;b \leq -2.5 \cdot 10^{-203}:\\ \;\;\;\;0.5 + a \cdot 0.25\\ \mathbf{elif}\;b \leq -5 \cdot 10^{-289}:\\ \;\;\;\;0.020833333333333332 \cdot \left(b \cdot \left(b \cdot b\right)\right)\\ \mathbf{elif}\;b \leq 2.4:\\ \;\;\;\;0.5 + b \cdot \left(-0.25 + b \cdot \left(b \cdot 0.020833333333333332\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\left(b \cdot b\right) \cdot \left(0.5 + b \cdot 0.16666666666666666\right)}\\ \end{array} \end{array} \]
                                        (FPCore (a b)
                                         :precision binary64
                                         (if (<= b -6.5e-9)
                                           1.0
                                           (if (<= b -2.5e-203)
                                             (+ 0.5 (* a 0.25))
                                             (if (<= b -5e-289)
                                               (* 0.020833333333333332 (* b (* b b)))
                                               (if (<= b 2.4)
                                                 (+ 0.5 (* b (+ -0.25 (* b (* b 0.020833333333333332)))))
                                                 (/ 1.0 (* (* b b) (+ 0.5 (* b 0.16666666666666666)))))))))
                                        double code(double a, double b) {
                                        	double tmp;
                                        	if (b <= -6.5e-9) {
                                        		tmp = 1.0;
                                        	} else if (b <= -2.5e-203) {
                                        		tmp = 0.5 + (a * 0.25);
                                        	} else if (b <= -5e-289) {
                                        		tmp = 0.020833333333333332 * (b * (b * b));
                                        	} else if (b <= 2.4) {
                                        		tmp = 0.5 + (b * (-0.25 + (b * (b * 0.020833333333333332))));
                                        	} else {
                                        		tmp = 1.0 / ((b * b) * (0.5 + (b * 0.16666666666666666)));
                                        	}
                                        	return tmp;
                                        }
                                        
                                        real(8) function code(a, b)
                                            real(8), intent (in) :: a
                                            real(8), intent (in) :: b
                                            real(8) :: tmp
                                            if (b <= (-6.5d-9)) then
                                                tmp = 1.0d0
                                            else if (b <= (-2.5d-203)) then
                                                tmp = 0.5d0 + (a * 0.25d0)
                                            else if (b <= (-5d-289)) then
                                                tmp = 0.020833333333333332d0 * (b * (b * b))
                                            else if (b <= 2.4d0) then
                                                tmp = 0.5d0 + (b * ((-0.25d0) + (b * (b * 0.020833333333333332d0))))
                                            else
                                                tmp = 1.0d0 / ((b * b) * (0.5d0 + (b * 0.16666666666666666d0)))
                                            end if
                                            code = tmp
                                        end function
                                        
                                        public static double code(double a, double b) {
                                        	double tmp;
                                        	if (b <= -6.5e-9) {
                                        		tmp = 1.0;
                                        	} else if (b <= -2.5e-203) {
                                        		tmp = 0.5 + (a * 0.25);
                                        	} else if (b <= -5e-289) {
                                        		tmp = 0.020833333333333332 * (b * (b * b));
                                        	} else if (b <= 2.4) {
                                        		tmp = 0.5 + (b * (-0.25 + (b * (b * 0.020833333333333332))));
                                        	} else {
                                        		tmp = 1.0 / ((b * b) * (0.5 + (b * 0.16666666666666666)));
                                        	}
                                        	return tmp;
                                        }
                                        
                                        def code(a, b):
                                        	tmp = 0
                                        	if b <= -6.5e-9:
                                        		tmp = 1.0
                                        	elif b <= -2.5e-203:
                                        		tmp = 0.5 + (a * 0.25)
                                        	elif b <= -5e-289:
                                        		tmp = 0.020833333333333332 * (b * (b * b))
                                        	elif b <= 2.4:
                                        		tmp = 0.5 + (b * (-0.25 + (b * (b * 0.020833333333333332))))
                                        	else:
                                        		tmp = 1.0 / ((b * b) * (0.5 + (b * 0.16666666666666666)))
                                        	return tmp
                                        
                                        function code(a, b)
                                        	tmp = 0.0
                                        	if (b <= -6.5e-9)
                                        		tmp = 1.0;
                                        	elseif (b <= -2.5e-203)
                                        		tmp = Float64(0.5 + Float64(a * 0.25));
                                        	elseif (b <= -5e-289)
                                        		tmp = Float64(0.020833333333333332 * Float64(b * Float64(b * b)));
                                        	elseif (b <= 2.4)
                                        		tmp = Float64(0.5 + Float64(b * Float64(-0.25 + Float64(b * Float64(b * 0.020833333333333332)))));
                                        	else
                                        		tmp = Float64(1.0 / Float64(Float64(b * b) * Float64(0.5 + Float64(b * 0.16666666666666666))));
                                        	end
                                        	return tmp
                                        end
                                        
                                        function tmp_2 = code(a, b)
                                        	tmp = 0.0;
                                        	if (b <= -6.5e-9)
                                        		tmp = 1.0;
                                        	elseif (b <= -2.5e-203)
                                        		tmp = 0.5 + (a * 0.25);
                                        	elseif (b <= -5e-289)
                                        		tmp = 0.020833333333333332 * (b * (b * b));
                                        	elseif (b <= 2.4)
                                        		tmp = 0.5 + (b * (-0.25 + (b * (b * 0.020833333333333332))));
                                        	else
                                        		tmp = 1.0 / ((b * b) * (0.5 + (b * 0.16666666666666666)));
                                        	end
                                        	tmp_2 = tmp;
                                        end
                                        
                                        code[a_, b_] := If[LessEqual[b, -6.5e-9], 1.0, If[LessEqual[b, -2.5e-203], N[(0.5 + N[(a * 0.25), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, -5e-289], N[(0.020833333333333332 * N[(b * N[(b * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 2.4], N[(0.5 + N[(b * N[(-0.25 + N[(b * N[(b * 0.020833333333333332), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(N[(b * b), $MachinePrecision] * N[(0.5 + N[(b * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
                                        
                                        \begin{array}{l}
                                        
                                        \\
                                        \begin{array}{l}
                                        \mathbf{if}\;b \leq -6.5 \cdot 10^{-9}:\\
                                        \;\;\;\;1\\
                                        
                                        \mathbf{elif}\;b \leq -2.5 \cdot 10^{-203}:\\
                                        \;\;\;\;0.5 + a \cdot 0.25\\
                                        
                                        \mathbf{elif}\;b \leq -5 \cdot 10^{-289}:\\
                                        \;\;\;\;0.020833333333333332 \cdot \left(b \cdot \left(b \cdot b\right)\right)\\
                                        
                                        \mathbf{elif}\;b \leq 2.4:\\
                                        \;\;\;\;0.5 + b \cdot \left(-0.25 + b \cdot \left(b \cdot 0.020833333333333332\right)\right)\\
                                        
                                        \mathbf{else}:\\
                                        \;\;\;\;\frac{1}{\left(b \cdot b\right) \cdot \left(0.5 + b \cdot 0.16666666666666666\right)}\\
                                        
                                        
                                        \end{array}
                                        \end{array}
                                        
                                        Derivation
                                        1. Split input into 5 regimes
                                        2. if b < -6.5000000000000003e-9

                                          1. Initial program 97.9%

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

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

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

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

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

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

                                              \[\leadsto \mathsf{exp.f64}\left(\left(\log \left(e^{a} + e^{b}\right) \cdot -1 + a\right)\right) \]
                                            7. +-lowering-+.f64N/A

                                              \[\leadsto \mathsf{exp.f64}\left(\mathsf{+.f64}\left(\left(\log \left(e^{a} + e^{b}\right) \cdot -1\right), a\right)\right) \]
                                            8. *-lowering-*.f64N/A

                                              \[\leadsto \mathsf{exp.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\log \left(e^{a} + e^{b}\right), -1\right), a\right)\right) \]
                                            9. log-lowering-log.f64N/A

                                              \[\leadsto \mathsf{exp.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{log.f64}\left(\left(e^{a} + e^{b}\right)\right), -1\right), a\right)\right) \]
                                            10. +-lowering-+.f64N/A

                                              \[\leadsto \mathsf{exp.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(\left(e^{a}\right), \left(e^{b}\right)\right)\right), -1\right), a\right)\right) \]
                                            11. exp-lowering-exp.f64N/A

                                              \[\leadsto \mathsf{exp.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(a\right), \left(e^{b}\right)\right)\right), -1\right), a\right)\right) \]
                                            12. exp-lowering-exp.f6498.0%

                                              \[\leadsto \mathsf{exp.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(a\right), \mathsf{exp.f64}\left(b\right)\right)\right), -1\right), a\right)\right) \]
                                          4. Applied egg-rr98.0%

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

                                            \[\leadsto \mathsf{exp.f64}\left(\color{blue}{a}\right) \]
                                          6. Step-by-step derivation
                                            1. Simplified97.7%

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

                                              \[\leadsto \color{blue}{1} \]
                                            3. Step-by-step derivation
                                              1. Simplified98.0%

                                                \[\leadsto \color{blue}{1} \]

                                              if -6.5000000000000003e-9 < b < -2.5000000000000001e-203

                                              1. Initial program 100.0%

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

                                                \[\leadsto \mathsf{/.f64}\left(\mathsf{exp.f64}\left(a\right), \mathsf{+.f64}\left(\mathsf{exp.f64}\left(a\right), \color{blue}{1}\right)\right) \]
                                              4. Step-by-step derivation
                                                1. Simplified100.0%

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

                                                  \[\leadsto \color{blue}{\frac{1}{2} + \frac{1}{4} \cdot a} \]
                                                3. Step-by-step derivation
                                                  1. +-lowering-+.f64N/A

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

                                                    \[\leadsto \mathsf{+.f64}\left(\frac{1}{2}, \left(a \cdot \color{blue}{\frac{1}{4}}\right)\right) \]
                                                  3. *-lowering-*.f6454.8%

                                                    \[\leadsto \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(a, \color{blue}{\frac{1}{4}}\right)\right) \]
                                                4. Simplified54.8%

                                                  \[\leadsto \color{blue}{0.5 + a \cdot 0.25} \]

                                                if -2.5000000000000001e-203 < b < -5.00000000000000029e-289

                                                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. /-lowering-/.f64N/A

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

                                                    \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \color{blue}{\left(e^{b}\right)}\right)\right) \]
                                                  3. exp-lowering-exp.f6436.7%

                                                    \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(b\right)\right)\right) \]
                                                5. Simplified36.7%

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

                                                  \[\leadsto \color{blue}{\frac{1}{2} + b \cdot \left(\frac{1}{48} \cdot {b}^{2} - \frac{1}{4}\right)} \]
                                                7. Step-by-step derivation
                                                  1. +-lowering-+.f64N/A

                                                    \[\leadsto \mathsf{+.f64}\left(\frac{1}{2}, \color{blue}{\left(b \cdot \left(\frac{1}{48} \cdot {b}^{2} - \frac{1}{4}\right)\right)}\right) \]
                                                  2. *-lowering-*.f64N/A

                                                    \[\leadsto \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(b, \color{blue}{\left(\frac{1}{48} \cdot {b}^{2} - \frac{1}{4}\right)}\right)\right) \]
                                                  3. sub-negN/A

                                                    \[\leadsto \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(b, \left(\frac{1}{48} \cdot {b}^{2} + \color{blue}{\left(\mathsf{neg}\left(\frac{1}{4}\right)\right)}\right)\right)\right) \]
                                                  4. metadata-evalN/A

                                                    \[\leadsto \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(b, \left(\frac{1}{48} \cdot {b}^{2} + \frac{-1}{4}\right)\right)\right) \]
                                                  5. +-commutativeN/A

                                                    \[\leadsto \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(b, \left(\frac{-1}{4} + \color{blue}{\frac{1}{48} \cdot {b}^{2}}\right)\right)\right) \]
                                                  6. +-lowering-+.f64N/A

                                                    \[\leadsto \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(\frac{-1}{4}, \color{blue}{\left(\frac{1}{48} \cdot {b}^{2}\right)}\right)\right)\right) \]
                                                  7. *-commutativeN/A

                                                    \[\leadsto \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(\frac{-1}{4}, \left({b}^{2} \cdot \color{blue}{\frac{1}{48}}\right)\right)\right)\right) \]
                                                  8. unpow2N/A

                                                    \[\leadsto \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(\frac{-1}{4}, \left(\left(b \cdot b\right) \cdot \frac{1}{48}\right)\right)\right)\right) \]
                                                  9. associate-*l*N/A

                                                    \[\leadsto \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(\frac{-1}{4}, \left(b \cdot \color{blue}{\left(b \cdot \frac{1}{48}\right)}\right)\right)\right)\right) \]
                                                  10. *-lowering-*.f64N/A

                                                    \[\leadsto \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(\frac{-1}{4}, \mathsf{*.f64}\left(b, \color{blue}{\left(b \cdot \frac{1}{48}\right)}\right)\right)\right)\right) \]
                                                  11. *-lowering-*.f6436.7%

                                                    \[\leadsto \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(\frac{-1}{4}, \mathsf{*.f64}\left(b, \mathsf{*.f64}\left(b, \color{blue}{\frac{1}{48}}\right)\right)\right)\right)\right) \]
                                                8. Simplified36.7%

                                                  \[\leadsto \color{blue}{0.5 + b \cdot \left(-0.25 + b \cdot \left(b \cdot 0.020833333333333332\right)\right)} \]
                                                9. Taylor expanded in b around inf

                                                  \[\leadsto \color{blue}{\frac{1}{48} \cdot {b}^{3}} \]
                                                10. Step-by-step derivation
                                                  1. *-lowering-*.f64N/A

                                                    \[\leadsto \mathsf{*.f64}\left(\frac{1}{48}, \color{blue}{\left({b}^{3}\right)}\right) \]
                                                  2. cube-multN/A

                                                    \[\leadsto \mathsf{*.f64}\left(\frac{1}{48}, \left(b \cdot \color{blue}{\left(b \cdot b\right)}\right)\right) \]
                                                  3. unpow2N/A

                                                    \[\leadsto \mathsf{*.f64}\left(\frac{1}{48}, \left(b \cdot {b}^{\color{blue}{2}}\right)\right) \]
                                                  4. *-lowering-*.f64N/A

                                                    \[\leadsto \mathsf{*.f64}\left(\frac{1}{48}, \mathsf{*.f64}\left(b, \color{blue}{\left({b}^{2}\right)}\right)\right) \]
                                                  5. unpow2N/A

                                                    \[\leadsto \mathsf{*.f64}\left(\frac{1}{48}, \mathsf{*.f64}\left(b, \left(b \cdot \color{blue}{b}\right)\right)\right) \]
                                                  6. *-lowering-*.f6466.5%

                                                    \[\leadsto \mathsf{*.f64}\left(\frac{1}{48}, \mathsf{*.f64}\left(b, \mathsf{*.f64}\left(b, \color{blue}{b}\right)\right)\right) \]
                                                11. Simplified66.5%

                                                  \[\leadsto \color{blue}{0.020833333333333332 \cdot \left(b \cdot \left(b \cdot b\right)\right)} \]

                                                if -5.00000000000000029e-289 < b < 2.39999999999999991

                                                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. /-lowering-/.f64N/A

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

                                                    \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \color{blue}{\left(e^{b}\right)}\right)\right) \]
                                                  3. exp-lowering-exp.f6467.7%

                                                    \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(b\right)\right)\right) \]
                                                5. Simplified67.7%

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

                                                  \[\leadsto \color{blue}{\frac{1}{2} + b \cdot \left(\frac{1}{48} \cdot {b}^{2} - \frac{1}{4}\right)} \]
                                                7. Step-by-step derivation
                                                  1. +-lowering-+.f64N/A

                                                    \[\leadsto \mathsf{+.f64}\left(\frac{1}{2}, \color{blue}{\left(b \cdot \left(\frac{1}{48} \cdot {b}^{2} - \frac{1}{4}\right)\right)}\right) \]
                                                  2. *-lowering-*.f64N/A

                                                    \[\leadsto \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(b, \color{blue}{\left(\frac{1}{48} \cdot {b}^{2} - \frac{1}{4}\right)}\right)\right) \]
                                                  3. sub-negN/A

                                                    \[\leadsto \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(b, \left(\frac{1}{48} \cdot {b}^{2} + \color{blue}{\left(\mathsf{neg}\left(\frac{1}{4}\right)\right)}\right)\right)\right) \]
                                                  4. metadata-evalN/A

                                                    \[\leadsto \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(b, \left(\frac{1}{48} \cdot {b}^{2} + \frac{-1}{4}\right)\right)\right) \]
                                                  5. +-commutativeN/A

                                                    \[\leadsto \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(b, \left(\frac{-1}{4} + \color{blue}{\frac{1}{48} \cdot {b}^{2}}\right)\right)\right) \]
                                                  6. +-lowering-+.f64N/A

                                                    \[\leadsto \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(\frac{-1}{4}, \color{blue}{\left(\frac{1}{48} \cdot {b}^{2}\right)}\right)\right)\right) \]
                                                  7. *-commutativeN/A

                                                    \[\leadsto \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(\frac{-1}{4}, \left({b}^{2} \cdot \color{blue}{\frac{1}{48}}\right)\right)\right)\right) \]
                                                  8. unpow2N/A

                                                    \[\leadsto \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(\frac{-1}{4}, \left(\left(b \cdot b\right) \cdot \frac{1}{48}\right)\right)\right)\right) \]
                                                  9. associate-*l*N/A

                                                    \[\leadsto \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(\frac{-1}{4}, \left(b \cdot \color{blue}{\left(b \cdot \frac{1}{48}\right)}\right)\right)\right)\right) \]
                                                  10. *-lowering-*.f64N/A

                                                    \[\leadsto \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(\frac{-1}{4}, \mathsf{*.f64}\left(b, \color{blue}{\left(b \cdot \frac{1}{48}\right)}\right)\right)\right)\right) \]
                                                  11. *-lowering-*.f6467.8%

                                                    \[\leadsto \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(\frac{-1}{4}, \mathsf{*.f64}\left(b, \mathsf{*.f64}\left(b, \color{blue}{\frac{1}{48}}\right)\right)\right)\right)\right) \]
                                                8. Simplified67.8%

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

                                                if 2.39999999999999991 < b

                                                1. Initial program 98.5%

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

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

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

                                                    \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \color{blue}{\left(e^{b}\right)}\right)\right) \]
                                                  3. exp-lowering-exp.f64100.0%

                                                    \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(b\right)\right)\right) \]
                                                5. Simplified100.0%

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

                                                  \[\leadsto \mathsf{/.f64}\left(1, \color{blue}{\left(2 + b \cdot \left(1 + b \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot b\right)\right)\right)}\right) \]
                                                7. Step-by-step derivation
                                                  1. +-lowering-+.f64N/A

                                                    \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \color{blue}{\left(b \cdot \left(1 + b \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot b\right)\right)\right)}\right)\right) \]
                                                  2. *-lowering-*.f64N/A

                                                    \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \color{blue}{\left(1 + b \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot b\right)\right)}\right)\right)\right) \]
                                                  3. +-lowering-+.f64N/A

                                                    \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(1, \color{blue}{\left(b \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot b\right)\right)}\right)\right)\right)\right) \]
                                                  4. *-lowering-*.f64N/A

                                                    \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(b, \color{blue}{\left(\frac{1}{2} + \frac{1}{6} \cdot b\right)}\right)\right)\right)\right)\right) \]
                                                  5. +-lowering-+.f64N/A

                                                    \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(\frac{1}{2}, \color{blue}{\left(\frac{1}{6} \cdot b\right)}\right)\right)\right)\right)\right)\right) \]
                                                  6. *-commutativeN/A

                                                    \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(\frac{1}{2}, \left(b \cdot \color{blue}{\frac{1}{6}}\right)\right)\right)\right)\right)\right)\right) \]
                                                  7. *-lowering-*.f6475.1%

                                                    \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(b, \color{blue}{\frac{1}{6}}\right)\right)\right)\right)\right)\right)\right) \]
                                                8. Simplified75.1%

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

                                                  \[\leadsto \mathsf{/.f64}\left(1, \color{blue}{\left({b}^{3} \cdot \left(\frac{1}{6} + \frac{1}{2} \cdot \frac{1}{b}\right)\right)}\right) \]
                                                10. Step-by-step derivation
                                                  1. unpow3N/A

                                                    \[\leadsto \mathsf{/.f64}\left(1, \left(\left(\left(b \cdot b\right) \cdot b\right) \cdot \left(\color{blue}{\frac{1}{6}} + \frac{1}{2} \cdot \frac{1}{b}\right)\right)\right) \]
                                                  2. unpow2N/A

                                                    \[\leadsto \mathsf{/.f64}\left(1, \left(\left({b}^{2} \cdot b\right) \cdot \left(\frac{1}{6} + \frac{1}{2} \cdot \frac{1}{b}\right)\right)\right) \]
                                                  3. associate-*l*N/A

                                                    \[\leadsto \mathsf{/.f64}\left(1, \left({b}^{2} \cdot \color{blue}{\left(b \cdot \left(\frac{1}{6} + \frac{1}{2} \cdot \frac{1}{b}\right)\right)}\right)\right) \]
                                                  4. *-lowering-*.f64N/A

                                                    \[\leadsto \mathsf{/.f64}\left(1, \mathsf{*.f64}\left(\left({b}^{2}\right), \color{blue}{\left(b \cdot \left(\frac{1}{6} + \frac{1}{2} \cdot \frac{1}{b}\right)\right)}\right)\right) \]
                                                  5. unpow2N/A

                                                    \[\leadsto \mathsf{/.f64}\left(1, \mathsf{*.f64}\left(\left(b \cdot b\right), \left(\color{blue}{b} \cdot \left(\frac{1}{6} + \frac{1}{2} \cdot \frac{1}{b}\right)\right)\right)\right) \]
                                                  6. *-lowering-*.f64N/A

                                                    \[\leadsto \mathsf{/.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(\color{blue}{b} \cdot \left(\frac{1}{6} + \frac{1}{2} \cdot \frac{1}{b}\right)\right)\right)\right) \]
                                                  7. +-commutativeN/A

                                                    \[\leadsto \mathsf{/.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(b \cdot \left(\frac{1}{2} \cdot \frac{1}{b} + \color{blue}{\frac{1}{6}}\right)\right)\right)\right) \]
                                                  8. distribute-rgt-inN/A

                                                    \[\leadsto \mathsf{/.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(\left(\frac{1}{2} \cdot \frac{1}{b}\right) \cdot b + \color{blue}{\frac{1}{6} \cdot b}\right)\right)\right) \]
                                                  9. associate-*l*N/A

                                                    \[\leadsto \mathsf{/.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(\frac{1}{2} \cdot \left(\frac{1}{b} \cdot b\right) + \color{blue}{\frac{1}{6}} \cdot b\right)\right)\right) \]
                                                  10. lft-mult-inverseN/A

                                                    \[\leadsto \mathsf{/.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(\frac{1}{2} \cdot 1 + \frac{1}{6} \cdot b\right)\right)\right) \]
                                                  11. metadata-evalN/A

                                                    \[\leadsto \mathsf{/.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(\frac{1}{2} + \color{blue}{\frac{1}{6}} \cdot b\right)\right)\right) \]
                                                  12. +-lowering-+.f64N/A

                                                    \[\leadsto \mathsf{/.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{+.f64}\left(\frac{1}{2}, \color{blue}{\left(\frac{1}{6} \cdot b\right)}\right)\right)\right) \]
                                                  13. *-lowering-*.f6475.1%

                                                    \[\leadsto \mathsf{/.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\frac{1}{6}, \color{blue}{b}\right)\right)\right)\right) \]
                                                11. Simplified75.1%

                                                  \[\leadsto \frac{1}{\color{blue}{\left(b \cdot b\right) \cdot \left(0.5 + 0.16666666666666666 \cdot b\right)}} \]
                                              5. Recombined 5 regimes into one program.
                                              6. Final simplification73.2%

                                                \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -6.5 \cdot 10^{-9}:\\ \;\;\;\;1\\ \mathbf{elif}\;b \leq -2.5 \cdot 10^{-203}:\\ \;\;\;\;0.5 + a \cdot 0.25\\ \mathbf{elif}\;b \leq -5 \cdot 10^{-289}:\\ \;\;\;\;0.020833333333333332 \cdot \left(b \cdot \left(b \cdot b\right)\right)\\ \mathbf{elif}\;b \leq 2.4:\\ \;\;\;\;0.5 + b \cdot \left(-0.25 + b \cdot \left(b \cdot 0.020833333333333332\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\left(b \cdot b\right) \cdot \left(0.5 + b \cdot 0.16666666666666666\right)}\\ \end{array} \]
                                              7. Add Preprocessing

                                              Alternative 13: 69.0% accurate, 9.8× speedup?

                                              \[\begin{array}{l} \\ \begin{array}{l} t_0 := b \cdot \left(b \cdot b\right)\\ \mathbf{if}\;b \leq -6.5 \cdot 10^{-9}:\\ \;\;\;\;1\\ \mathbf{elif}\;b \leq -9.6 \cdot 10^{-204}:\\ \;\;\;\;0.5 + a \cdot 0.25\\ \mathbf{elif}\;b \leq -8.1 \cdot 10^{-289}:\\ \;\;\;\;0.020833333333333332 \cdot t\_0\\ \mathbf{elif}\;b \leq 2.85:\\ \;\;\;\;0.5 + b \cdot \left(-0.25 + b \cdot \left(b \cdot 0.020833333333333332\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{6}{t\_0}\\ \end{array} \end{array} \]
                                              (FPCore (a b)
                                               :precision binary64
                                               (let* ((t_0 (* b (* b b))))
                                                 (if (<= b -6.5e-9)
                                                   1.0
                                                   (if (<= b -9.6e-204)
                                                     (+ 0.5 (* a 0.25))
                                                     (if (<= b -8.1e-289)
                                                       (* 0.020833333333333332 t_0)
                                                       (if (<= b 2.85)
                                                         (+ 0.5 (* b (+ -0.25 (* b (* b 0.020833333333333332)))))
                                                         (/ 6.0 t_0)))))))
                                              double code(double a, double b) {
                                              	double t_0 = b * (b * b);
                                              	double tmp;
                                              	if (b <= -6.5e-9) {
                                              		tmp = 1.0;
                                              	} else if (b <= -9.6e-204) {
                                              		tmp = 0.5 + (a * 0.25);
                                              	} else if (b <= -8.1e-289) {
                                              		tmp = 0.020833333333333332 * t_0;
                                              	} else if (b <= 2.85) {
                                              		tmp = 0.5 + (b * (-0.25 + (b * (b * 0.020833333333333332))));
                                              	} else {
                                              		tmp = 6.0 / t_0;
                                              	}
                                              	return tmp;
                                              }
                                              
                                              real(8) function code(a, b)
                                                  real(8), intent (in) :: a
                                                  real(8), intent (in) :: b
                                                  real(8) :: t_0
                                                  real(8) :: tmp
                                                  t_0 = b * (b * b)
                                                  if (b <= (-6.5d-9)) then
                                                      tmp = 1.0d0
                                                  else if (b <= (-9.6d-204)) then
                                                      tmp = 0.5d0 + (a * 0.25d0)
                                                  else if (b <= (-8.1d-289)) then
                                                      tmp = 0.020833333333333332d0 * t_0
                                                  else if (b <= 2.85d0) then
                                                      tmp = 0.5d0 + (b * ((-0.25d0) + (b * (b * 0.020833333333333332d0))))
                                                  else
                                                      tmp = 6.0d0 / t_0
                                                  end if
                                                  code = tmp
                                              end function
                                              
                                              public static double code(double a, double b) {
                                              	double t_0 = b * (b * b);
                                              	double tmp;
                                              	if (b <= -6.5e-9) {
                                              		tmp = 1.0;
                                              	} else if (b <= -9.6e-204) {
                                              		tmp = 0.5 + (a * 0.25);
                                              	} else if (b <= -8.1e-289) {
                                              		tmp = 0.020833333333333332 * t_0;
                                              	} else if (b <= 2.85) {
                                              		tmp = 0.5 + (b * (-0.25 + (b * (b * 0.020833333333333332))));
                                              	} else {
                                              		tmp = 6.0 / t_0;
                                              	}
                                              	return tmp;
                                              }
                                              
                                              def code(a, b):
                                              	t_0 = b * (b * b)
                                              	tmp = 0
                                              	if b <= -6.5e-9:
                                              		tmp = 1.0
                                              	elif b <= -9.6e-204:
                                              		tmp = 0.5 + (a * 0.25)
                                              	elif b <= -8.1e-289:
                                              		tmp = 0.020833333333333332 * t_0
                                              	elif b <= 2.85:
                                              		tmp = 0.5 + (b * (-0.25 + (b * (b * 0.020833333333333332))))
                                              	else:
                                              		tmp = 6.0 / t_0
                                              	return tmp
                                              
                                              function code(a, b)
                                              	t_0 = Float64(b * Float64(b * b))
                                              	tmp = 0.0
                                              	if (b <= -6.5e-9)
                                              		tmp = 1.0;
                                              	elseif (b <= -9.6e-204)
                                              		tmp = Float64(0.5 + Float64(a * 0.25));
                                              	elseif (b <= -8.1e-289)
                                              		tmp = Float64(0.020833333333333332 * t_0);
                                              	elseif (b <= 2.85)
                                              		tmp = Float64(0.5 + Float64(b * Float64(-0.25 + Float64(b * Float64(b * 0.020833333333333332)))));
                                              	else
                                              		tmp = Float64(6.0 / t_0);
                                              	end
                                              	return tmp
                                              end
                                              
                                              function tmp_2 = code(a, b)
                                              	t_0 = b * (b * b);
                                              	tmp = 0.0;
                                              	if (b <= -6.5e-9)
                                              		tmp = 1.0;
                                              	elseif (b <= -9.6e-204)
                                              		tmp = 0.5 + (a * 0.25);
                                              	elseif (b <= -8.1e-289)
                                              		tmp = 0.020833333333333332 * t_0;
                                              	elseif (b <= 2.85)
                                              		tmp = 0.5 + (b * (-0.25 + (b * (b * 0.020833333333333332))));
                                              	else
                                              		tmp = 6.0 / t_0;
                                              	end
                                              	tmp_2 = tmp;
                                              end
                                              
                                              code[a_, b_] := Block[{t$95$0 = N[(b * N[(b * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -6.5e-9], 1.0, If[LessEqual[b, -9.6e-204], N[(0.5 + N[(a * 0.25), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, -8.1e-289], N[(0.020833333333333332 * t$95$0), $MachinePrecision], If[LessEqual[b, 2.85], N[(0.5 + N[(b * N[(-0.25 + N[(b * N[(b * 0.020833333333333332), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(6.0 / t$95$0), $MachinePrecision]]]]]]
                                              
                                              \begin{array}{l}
                                              
                                              \\
                                              \begin{array}{l}
                                              t_0 := b \cdot \left(b \cdot b\right)\\
                                              \mathbf{if}\;b \leq -6.5 \cdot 10^{-9}:\\
                                              \;\;\;\;1\\
                                              
                                              \mathbf{elif}\;b \leq -9.6 \cdot 10^{-204}:\\
                                              \;\;\;\;0.5 + a \cdot 0.25\\
                                              
                                              \mathbf{elif}\;b \leq -8.1 \cdot 10^{-289}:\\
                                              \;\;\;\;0.020833333333333332 \cdot t\_0\\
                                              
                                              \mathbf{elif}\;b \leq 2.85:\\
                                              \;\;\;\;0.5 + b \cdot \left(-0.25 + b \cdot \left(b \cdot 0.020833333333333332\right)\right)\\
                                              
                                              \mathbf{else}:\\
                                              \;\;\;\;\frac{6}{t\_0}\\
                                              
                                              
                                              \end{array}
                                              \end{array}
                                              
                                              Derivation
                                              1. Split input into 5 regimes
                                              2. if b < -6.5000000000000003e-9

                                                1. Initial program 97.9%

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

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

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

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

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

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

                                                    \[\leadsto \mathsf{exp.f64}\left(\left(\log \left(e^{a} + e^{b}\right) \cdot -1 + a\right)\right) \]
                                                  7. +-lowering-+.f64N/A

                                                    \[\leadsto \mathsf{exp.f64}\left(\mathsf{+.f64}\left(\left(\log \left(e^{a} + e^{b}\right) \cdot -1\right), a\right)\right) \]
                                                  8. *-lowering-*.f64N/A

                                                    \[\leadsto \mathsf{exp.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\log \left(e^{a} + e^{b}\right), -1\right), a\right)\right) \]
                                                  9. log-lowering-log.f64N/A

                                                    \[\leadsto \mathsf{exp.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{log.f64}\left(\left(e^{a} + e^{b}\right)\right), -1\right), a\right)\right) \]
                                                  10. +-lowering-+.f64N/A

                                                    \[\leadsto \mathsf{exp.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(\left(e^{a}\right), \left(e^{b}\right)\right)\right), -1\right), a\right)\right) \]
                                                  11. exp-lowering-exp.f64N/A

                                                    \[\leadsto \mathsf{exp.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(a\right), \left(e^{b}\right)\right)\right), -1\right), a\right)\right) \]
                                                  12. exp-lowering-exp.f6498.0%

                                                    \[\leadsto \mathsf{exp.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(a\right), \mathsf{exp.f64}\left(b\right)\right)\right), -1\right), a\right)\right) \]
                                                4. Applied egg-rr98.0%

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

                                                  \[\leadsto \mathsf{exp.f64}\left(\color{blue}{a}\right) \]
                                                6. Step-by-step derivation
                                                  1. Simplified97.7%

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

                                                    \[\leadsto \color{blue}{1} \]
                                                  3. Step-by-step derivation
                                                    1. Simplified98.0%

                                                      \[\leadsto \color{blue}{1} \]

                                                    if -6.5000000000000003e-9 < b < -9.6e-204

                                                    1. Initial program 100.0%

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

                                                      \[\leadsto \mathsf{/.f64}\left(\mathsf{exp.f64}\left(a\right), \mathsf{+.f64}\left(\mathsf{exp.f64}\left(a\right), \color{blue}{1}\right)\right) \]
                                                    4. Step-by-step derivation
                                                      1. Simplified100.0%

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

                                                        \[\leadsto \color{blue}{\frac{1}{2} + \frac{1}{4} \cdot a} \]
                                                      3. Step-by-step derivation
                                                        1. +-lowering-+.f64N/A

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

                                                          \[\leadsto \mathsf{+.f64}\left(\frac{1}{2}, \left(a \cdot \color{blue}{\frac{1}{4}}\right)\right) \]
                                                        3. *-lowering-*.f6454.8%

                                                          \[\leadsto \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(a, \color{blue}{\frac{1}{4}}\right)\right) \]
                                                      4. Simplified54.8%

                                                        \[\leadsto \color{blue}{0.5 + a \cdot 0.25} \]

                                                      if -9.6e-204 < b < -8.1000000000000003e-289

                                                      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. /-lowering-/.f64N/A

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

                                                          \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \color{blue}{\left(e^{b}\right)}\right)\right) \]
                                                        3. exp-lowering-exp.f6436.7%

                                                          \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(b\right)\right)\right) \]
                                                      5. Simplified36.7%

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

                                                        \[\leadsto \color{blue}{\frac{1}{2} + b \cdot \left(\frac{1}{48} \cdot {b}^{2} - \frac{1}{4}\right)} \]
                                                      7. Step-by-step derivation
                                                        1. +-lowering-+.f64N/A

                                                          \[\leadsto \mathsf{+.f64}\left(\frac{1}{2}, \color{blue}{\left(b \cdot \left(\frac{1}{48} \cdot {b}^{2} - \frac{1}{4}\right)\right)}\right) \]
                                                        2. *-lowering-*.f64N/A

                                                          \[\leadsto \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(b, \color{blue}{\left(\frac{1}{48} \cdot {b}^{2} - \frac{1}{4}\right)}\right)\right) \]
                                                        3. sub-negN/A

                                                          \[\leadsto \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(b, \left(\frac{1}{48} \cdot {b}^{2} + \color{blue}{\left(\mathsf{neg}\left(\frac{1}{4}\right)\right)}\right)\right)\right) \]
                                                        4. metadata-evalN/A

                                                          \[\leadsto \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(b, \left(\frac{1}{48} \cdot {b}^{2} + \frac{-1}{4}\right)\right)\right) \]
                                                        5. +-commutativeN/A

                                                          \[\leadsto \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(b, \left(\frac{-1}{4} + \color{blue}{\frac{1}{48} \cdot {b}^{2}}\right)\right)\right) \]
                                                        6. +-lowering-+.f64N/A

                                                          \[\leadsto \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(\frac{-1}{4}, \color{blue}{\left(\frac{1}{48} \cdot {b}^{2}\right)}\right)\right)\right) \]
                                                        7. *-commutativeN/A

                                                          \[\leadsto \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(\frac{-1}{4}, \left({b}^{2} \cdot \color{blue}{\frac{1}{48}}\right)\right)\right)\right) \]
                                                        8. unpow2N/A

                                                          \[\leadsto \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(\frac{-1}{4}, \left(\left(b \cdot b\right) \cdot \frac{1}{48}\right)\right)\right)\right) \]
                                                        9. associate-*l*N/A

                                                          \[\leadsto \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(\frac{-1}{4}, \left(b \cdot \color{blue}{\left(b \cdot \frac{1}{48}\right)}\right)\right)\right)\right) \]
                                                        10. *-lowering-*.f64N/A

                                                          \[\leadsto \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(\frac{-1}{4}, \mathsf{*.f64}\left(b, \color{blue}{\left(b \cdot \frac{1}{48}\right)}\right)\right)\right)\right) \]
                                                        11. *-lowering-*.f6436.7%

                                                          \[\leadsto \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(\frac{-1}{4}, \mathsf{*.f64}\left(b, \mathsf{*.f64}\left(b, \color{blue}{\frac{1}{48}}\right)\right)\right)\right)\right) \]
                                                      8. Simplified36.7%

                                                        \[\leadsto \color{blue}{0.5 + b \cdot \left(-0.25 + b \cdot \left(b \cdot 0.020833333333333332\right)\right)} \]
                                                      9. Taylor expanded in b around inf

                                                        \[\leadsto \color{blue}{\frac{1}{48} \cdot {b}^{3}} \]
                                                      10. Step-by-step derivation
                                                        1. *-lowering-*.f64N/A

                                                          \[\leadsto \mathsf{*.f64}\left(\frac{1}{48}, \color{blue}{\left({b}^{3}\right)}\right) \]
                                                        2. cube-multN/A

                                                          \[\leadsto \mathsf{*.f64}\left(\frac{1}{48}, \left(b \cdot \color{blue}{\left(b \cdot b\right)}\right)\right) \]
                                                        3. unpow2N/A

                                                          \[\leadsto \mathsf{*.f64}\left(\frac{1}{48}, \left(b \cdot {b}^{\color{blue}{2}}\right)\right) \]
                                                        4. *-lowering-*.f64N/A

                                                          \[\leadsto \mathsf{*.f64}\left(\frac{1}{48}, \mathsf{*.f64}\left(b, \color{blue}{\left({b}^{2}\right)}\right)\right) \]
                                                        5. unpow2N/A

                                                          \[\leadsto \mathsf{*.f64}\left(\frac{1}{48}, \mathsf{*.f64}\left(b, \left(b \cdot \color{blue}{b}\right)\right)\right) \]
                                                        6. *-lowering-*.f6466.5%

                                                          \[\leadsto \mathsf{*.f64}\left(\frac{1}{48}, \mathsf{*.f64}\left(b, \mathsf{*.f64}\left(b, \color{blue}{b}\right)\right)\right) \]
                                                      11. Simplified66.5%

                                                        \[\leadsto \color{blue}{0.020833333333333332 \cdot \left(b \cdot \left(b \cdot b\right)\right)} \]

                                                      if -8.1000000000000003e-289 < b < 2.85000000000000009

                                                      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. /-lowering-/.f64N/A

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

                                                          \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \color{blue}{\left(e^{b}\right)}\right)\right) \]
                                                        3. exp-lowering-exp.f6467.7%

                                                          \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(b\right)\right)\right) \]
                                                      5. Simplified67.7%

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

                                                        \[\leadsto \color{blue}{\frac{1}{2} + b \cdot \left(\frac{1}{48} \cdot {b}^{2} - \frac{1}{4}\right)} \]
                                                      7. Step-by-step derivation
                                                        1. +-lowering-+.f64N/A

                                                          \[\leadsto \mathsf{+.f64}\left(\frac{1}{2}, \color{blue}{\left(b \cdot \left(\frac{1}{48} \cdot {b}^{2} - \frac{1}{4}\right)\right)}\right) \]
                                                        2. *-lowering-*.f64N/A

                                                          \[\leadsto \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(b, \color{blue}{\left(\frac{1}{48} \cdot {b}^{2} - \frac{1}{4}\right)}\right)\right) \]
                                                        3. sub-negN/A

                                                          \[\leadsto \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(b, \left(\frac{1}{48} \cdot {b}^{2} + \color{blue}{\left(\mathsf{neg}\left(\frac{1}{4}\right)\right)}\right)\right)\right) \]
                                                        4. metadata-evalN/A

                                                          \[\leadsto \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(b, \left(\frac{1}{48} \cdot {b}^{2} + \frac{-1}{4}\right)\right)\right) \]
                                                        5. +-commutativeN/A

                                                          \[\leadsto \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(b, \left(\frac{-1}{4} + \color{blue}{\frac{1}{48} \cdot {b}^{2}}\right)\right)\right) \]
                                                        6. +-lowering-+.f64N/A

                                                          \[\leadsto \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(\frac{-1}{4}, \color{blue}{\left(\frac{1}{48} \cdot {b}^{2}\right)}\right)\right)\right) \]
                                                        7. *-commutativeN/A

                                                          \[\leadsto \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(\frac{-1}{4}, \left({b}^{2} \cdot \color{blue}{\frac{1}{48}}\right)\right)\right)\right) \]
                                                        8. unpow2N/A

                                                          \[\leadsto \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(\frac{-1}{4}, \left(\left(b \cdot b\right) \cdot \frac{1}{48}\right)\right)\right)\right) \]
                                                        9. associate-*l*N/A

                                                          \[\leadsto \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(\frac{-1}{4}, \left(b \cdot \color{blue}{\left(b \cdot \frac{1}{48}\right)}\right)\right)\right)\right) \]
                                                        10. *-lowering-*.f64N/A

                                                          \[\leadsto \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(\frac{-1}{4}, \mathsf{*.f64}\left(b, \color{blue}{\left(b \cdot \frac{1}{48}\right)}\right)\right)\right)\right) \]
                                                        11. *-lowering-*.f6467.8%

                                                          \[\leadsto \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(\frac{-1}{4}, \mathsf{*.f64}\left(b, \mathsf{*.f64}\left(b, \color{blue}{\frac{1}{48}}\right)\right)\right)\right)\right) \]
                                                      8. Simplified67.8%

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

                                                      if 2.85000000000000009 < b

                                                      1. Initial program 98.5%

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

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

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

                                                          \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \color{blue}{\left(e^{b}\right)}\right)\right) \]
                                                        3. exp-lowering-exp.f64100.0%

                                                          \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(b\right)\right)\right) \]
                                                      5. Simplified100.0%

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

                                                        \[\leadsto \mathsf{/.f64}\left(1, \color{blue}{\left(2 + b \cdot \left(1 + b \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot b\right)\right)\right)}\right) \]
                                                      7. Step-by-step derivation
                                                        1. +-lowering-+.f64N/A

                                                          \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \color{blue}{\left(b \cdot \left(1 + b \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot b\right)\right)\right)}\right)\right) \]
                                                        2. *-lowering-*.f64N/A

                                                          \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \color{blue}{\left(1 + b \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot b\right)\right)}\right)\right)\right) \]
                                                        3. +-lowering-+.f64N/A

                                                          \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(1, \color{blue}{\left(b \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot b\right)\right)}\right)\right)\right)\right) \]
                                                        4. *-lowering-*.f64N/A

                                                          \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(b, \color{blue}{\left(\frac{1}{2} + \frac{1}{6} \cdot b\right)}\right)\right)\right)\right)\right) \]
                                                        5. +-lowering-+.f64N/A

                                                          \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(\frac{1}{2}, \color{blue}{\left(\frac{1}{6} \cdot b\right)}\right)\right)\right)\right)\right)\right) \]
                                                        6. *-commutativeN/A

                                                          \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(\frac{1}{2}, \left(b \cdot \color{blue}{\frac{1}{6}}\right)\right)\right)\right)\right)\right)\right) \]
                                                        7. *-lowering-*.f6475.1%

                                                          \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(b, \color{blue}{\frac{1}{6}}\right)\right)\right)\right)\right)\right)\right) \]
                                                      8. Simplified75.1%

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

                                                        \[\leadsto \color{blue}{\frac{6}{{b}^{3}}} \]
                                                      10. Step-by-step derivation
                                                        1. /-lowering-/.f64N/A

                                                          \[\leadsto \mathsf{/.f64}\left(6, \color{blue}{\left({b}^{3}\right)}\right) \]
                                                        2. cube-multN/A

                                                          \[\leadsto \mathsf{/.f64}\left(6, \left(b \cdot \color{blue}{\left(b \cdot b\right)}\right)\right) \]
                                                        3. unpow2N/A

                                                          \[\leadsto \mathsf{/.f64}\left(6, \left(b \cdot {b}^{\color{blue}{2}}\right)\right) \]
                                                        4. *-lowering-*.f64N/A

                                                          \[\leadsto \mathsf{/.f64}\left(6, \mathsf{*.f64}\left(b, \color{blue}{\left({b}^{2}\right)}\right)\right) \]
                                                        5. unpow2N/A

                                                          \[\leadsto \mathsf{/.f64}\left(6, \mathsf{*.f64}\left(b, \left(b \cdot \color{blue}{b}\right)\right)\right) \]
                                                        6. *-lowering-*.f6475.1%

                                                          \[\leadsto \mathsf{/.f64}\left(6, \mathsf{*.f64}\left(b, \mathsf{*.f64}\left(b, \color{blue}{b}\right)\right)\right) \]
                                                      11. Simplified75.1%

                                                        \[\leadsto \color{blue}{\frac{6}{b \cdot \left(b \cdot b\right)}} \]
                                                    5. Recombined 5 regimes into one program.
                                                    6. Add Preprocessing

                                                    Alternative 14: 69.0% accurate, 10.2× speedup?

                                                    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq -6.5 \cdot 10^{-9}:\\ \;\;\;\;1\\ \mathbf{elif}\;b \leq -9.6 \cdot 10^{-204}:\\ \;\;\;\;0.5 + a \cdot 0.25\\ \mathbf{elif}\;b \leq -7 \cdot 10^{-289}:\\ \;\;\;\;0.020833333333333332 \cdot \left(b \cdot \left(b \cdot b\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{2 + b \cdot \left(1 + b \cdot \left(0.5 + b \cdot 0.16666666666666666\right)\right)}\\ \end{array} \end{array} \]
                                                    (FPCore (a b)
                                                     :precision binary64
                                                     (if (<= b -6.5e-9)
                                                       1.0
                                                       (if (<= b -9.6e-204)
                                                         (+ 0.5 (* a 0.25))
                                                         (if (<= b -7e-289)
                                                           (* 0.020833333333333332 (* b (* b b)))
                                                           (/
                                                            1.0
                                                            (+ 2.0 (* b (+ 1.0 (* b (+ 0.5 (* b 0.16666666666666666)))))))))))
                                                    double code(double a, double b) {
                                                    	double tmp;
                                                    	if (b <= -6.5e-9) {
                                                    		tmp = 1.0;
                                                    	} else if (b <= -9.6e-204) {
                                                    		tmp = 0.5 + (a * 0.25);
                                                    	} else if (b <= -7e-289) {
                                                    		tmp = 0.020833333333333332 * (b * (b * b));
                                                    	} else {
                                                    		tmp = 1.0 / (2.0 + (b * (1.0 + (b * (0.5 + (b * 0.16666666666666666))))));
                                                    	}
                                                    	return tmp;
                                                    }
                                                    
                                                    real(8) function code(a, b)
                                                        real(8), intent (in) :: a
                                                        real(8), intent (in) :: b
                                                        real(8) :: tmp
                                                        if (b <= (-6.5d-9)) then
                                                            tmp = 1.0d0
                                                        else if (b <= (-9.6d-204)) then
                                                            tmp = 0.5d0 + (a * 0.25d0)
                                                        else if (b <= (-7d-289)) then
                                                            tmp = 0.020833333333333332d0 * (b * (b * b))
                                                        else
                                                            tmp = 1.0d0 / (2.0d0 + (b * (1.0d0 + (b * (0.5d0 + (b * 0.16666666666666666d0))))))
                                                        end if
                                                        code = tmp
                                                    end function
                                                    
                                                    public static double code(double a, double b) {
                                                    	double tmp;
                                                    	if (b <= -6.5e-9) {
                                                    		tmp = 1.0;
                                                    	} else if (b <= -9.6e-204) {
                                                    		tmp = 0.5 + (a * 0.25);
                                                    	} else if (b <= -7e-289) {
                                                    		tmp = 0.020833333333333332 * (b * (b * b));
                                                    	} else {
                                                    		tmp = 1.0 / (2.0 + (b * (1.0 + (b * (0.5 + (b * 0.16666666666666666))))));
                                                    	}
                                                    	return tmp;
                                                    }
                                                    
                                                    def code(a, b):
                                                    	tmp = 0
                                                    	if b <= -6.5e-9:
                                                    		tmp = 1.0
                                                    	elif b <= -9.6e-204:
                                                    		tmp = 0.5 + (a * 0.25)
                                                    	elif b <= -7e-289:
                                                    		tmp = 0.020833333333333332 * (b * (b * b))
                                                    	else:
                                                    		tmp = 1.0 / (2.0 + (b * (1.0 + (b * (0.5 + (b * 0.16666666666666666))))))
                                                    	return tmp
                                                    
                                                    function code(a, b)
                                                    	tmp = 0.0
                                                    	if (b <= -6.5e-9)
                                                    		tmp = 1.0;
                                                    	elseif (b <= -9.6e-204)
                                                    		tmp = Float64(0.5 + Float64(a * 0.25));
                                                    	elseif (b <= -7e-289)
                                                    		tmp = Float64(0.020833333333333332 * Float64(b * Float64(b * b)));
                                                    	else
                                                    		tmp = Float64(1.0 / Float64(2.0 + Float64(b * Float64(1.0 + Float64(b * Float64(0.5 + Float64(b * 0.16666666666666666)))))));
                                                    	end
                                                    	return tmp
                                                    end
                                                    
                                                    function tmp_2 = code(a, b)
                                                    	tmp = 0.0;
                                                    	if (b <= -6.5e-9)
                                                    		tmp = 1.0;
                                                    	elseif (b <= -9.6e-204)
                                                    		tmp = 0.5 + (a * 0.25);
                                                    	elseif (b <= -7e-289)
                                                    		tmp = 0.020833333333333332 * (b * (b * b));
                                                    	else
                                                    		tmp = 1.0 / (2.0 + (b * (1.0 + (b * (0.5 + (b * 0.16666666666666666))))));
                                                    	end
                                                    	tmp_2 = tmp;
                                                    end
                                                    
                                                    code[a_, b_] := If[LessEqual[b, -6.5e-9], 1.0, If[LessEqual[b, -9.6e-204], N[(0.5 + N[(a * 0.25), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, -7e-289], N[(0.020833333333333332 * N[(b * N[(b * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(2.0 + N[(b * N[(1.0 + N[(b * N[(0.5 + N[(b * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
                                                    
                                                    \begin{array}{l}
                                                    
                                                    \\
                                                    \begin{array}{l}
                                                    \mathbf{if}\;b \leq -6.5 \cdot 10^{-9}:\\
                                                    \;\;\;\;1\\
                                                    
                                                    \mathbf{elif}\;b \leq -9.6 \cdot 10^{-204}:\\
                                                    \;\;\;\;0.5 + a \cdot 0.25\\
                                                    
                                                    \mathbf{elif}\;b \leq -7 \cdot 10^{-289}:\\
                                                    \;\;\;\;0.020833333333333332 \cdot \left(b \cdot \left(b \cdot b\right)\right)\\
                                                    
                                                    \mathbf{else}:\\
                                                    \;\;\;\;\frac{1}{2 + b \cdot \left(1 + b \cdot \left(0.5 + b \cdot 0.16666666666666666\right)\right)}\\
                                                    
                                                    
                                                    \end{array}
                                                    \end{array}
                                                    
                                                    Derivation
                                                    1. Split input into 4 regimes
                                                    2. if b < -6.5000000000000003e-9

                                                      1. Initial program 97.9%

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

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

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

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

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

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

                                                          \[\leadsto \mathsf{exp.f64}\left(\left(\log \left(e^{a} + e^{b}\right) \cdot -1 + a\right)\right) \]
                                                        7. +-lowering-+.f64N/A

                                                          \[\leadsto \mathsf{exp.f64}\left(\mathsf{+.f64}\left(\left(\log \left(e^{a} + e^{b}\right) \cdot -1\right), a\right)\right) \]
                                                        8. *-lowering-*.f64N/A

                                                          \[\leadsto \mathsf{exp.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\log \left(e^{a} + e^{b}\right), -1\right), a\right)\right) \]
                                                        9. log-lowering-log.f64N/A

                                                          \[\leadsto \mathsf{exp.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{log.f64}\left(\left(e^{a} + e^{b}\right)\right), -1\right), a\right)\right) \]
                                                        10. +-lowering-+.f64N/A

                                                          \[\leadsto \mathsf{exp.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(\left(e^{a}\right), \left(e^{b}\right)\right)\right), -1\right), a\right)\right) \]
                                                        11. exp-lowering-exp.f64N/A

                                                          \[\leadsto \mathsf{exp.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(a\right), \left(e^{b}\right)\right)\right), -1\right), a\right)\right) \]
                                                        12. exp-lowering-exp.f6498.0%

                                                          \[\leadsto \mathsf{exp.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(a\right), \mathsf{exp.f64}\left(b\right)\right)\right), -1\right), a\right)\right) \]
                                                      4. Applied egg-rr98.0%

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

                                                        \[\leadsto \mathsf{exp.f64}\left(\color{blue}{a}\right) \]
                                                      6. Step-by-step derivation
                                                        1. Simplified97.7%

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

                                                          \[\leadsto \color{blue}{1} \]
                                                        3. Step-by-step derivation
                                                          1. Simplified98.0%

                                                            \[\leadsto \color{blue}{1} \]

                                                          if -6.5000000000000003e-9 < b < -9.6e-204

                                                          1. Initial program 100.0%

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

                                                            \[\leadsto \mathsf{/.f64}\left(\mathsf{exp.f64}\left(a\right), \mathsf{+.f64}\left(\mathsf{exp.f64}\left(a\right), \color{blue}{1}\right)\right) \]
                                                          4. Step-by-step derivation
                                                            1. Simplified100.0%

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

                                                              \[\leadsto \color{blue}{\frac{1}{2} + \frac{1}{4} \cdot a} \]
                                                            3. Step-by-step derivation
                                                              1. +-lowering-+.f64N/A

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

                                                                \[\leadsto \mathsf{+.f64}\left(\frac{1}{2}, \left(a \cdot \color{blue}{\frac{1}{4}}\right)\right) \]
                                                              3. *-lowering-*.f6454.8%

                                                                \[\leadsto \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(a, \color{blue}{\frac{1}{4}}\right)\right) \]
                                                            4. Simplified54.8%

                                                              \[\leadsto \color{blue}{0.5 + a \cdot 0.25} \]

                                                            if -9.6e-204 < b < -6.9999999999999999e-289

                                                            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. /-lowering-/.f64N/A

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

                                                                \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \color{blue}{\left(e^{b}\right)}\right)\right) \]
                                                              3. exp-lowering-exp.f6436.7%

                                                                \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(b\right)\right)\right) \]
                                                            5. Simplified36.7%

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

                                                              \[\leadsto \color{blue}{\frac{1}{2} + b \cdot \left(\frac{1}{48} \cdot {b}^{2} - \frac{1}{4}\right)} \]
                                                            7. Step-by-step derivation
                                                              1. +-lowering-+.f64N/A

                                                                \[\leadsto \mathsf{+.f64}\left(\frac{1}{2}, \color{blue}{\left(b \cdot \left(\frac{1}{48} \cdot {b}^{2} - \frac{1}{4}\right)\right)}\right) \]
                                                              2. *-lowering-*.f64N/A

                                                                \[\leadsto \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(b, \color{blue}{\left(\frac{1}{48} \cdot {b}^{2} - \frac{1}{4}\right)}\right)\right) \]
                                                              3. sub-negN/A

                                                                \[\leadsto \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(b, \left(\frac{1}{48} \cdot {b}^{2} + \color{blue}{\left(\mathsf{neg}\left(\frac{1}{4}\right)\right)}\right)\right)\right) \]
                                                              4. metadata-evalN/A

                                                                \[\leadsto \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(b, \left(\frac{1}{48} \cdot {b}^{2} + \frac{-1}{4}\right)\right)\right) \]
                                                              5. +-commutativeN/A

                                                                \[\leadsto \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(b, \left(\frac{-1}{4} + \color{blue}{\frac{1}{48} \cdot {b}^{2}}\right)\right)\right) \]
                                                              6. +-lowering-+.f64N/A

                                                                \[\leadsto \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(\frac{-1}{4}, \color{blue}{\left(\frac{1}{48} \cdot {b}^{2}\right)}\right)\right)\right) \]
                                                              7. *-commutativeN/A

                                                                \[\leadsto \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(\frac{-1}{4}, \left({b}^{2} \cdot \color{blue}{\frac{1}{48}}\right)\right)\right)\right) \]
                                                              8. unpow2N/A

                                                                \[\leadsto \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(\frac{-1}{4}, \left(\left(b \cdot b\right) \cdot \frac{1}{48}\right)\right)\right)\right) \]
                                                              9. associate-*l*N/A

                                                                \[\leadsto \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(\frac{-1}{4}, \left(b \cdot \color{blue}{\left(b \cdot \frac{1}{48}\right)}\right)\right)\right)\right) \]
                                                              10. *-lowering-*.f64N/A

                                                                \[\leadsto \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(\frac{-1}{4}, \mathsf{*.f64}\left(b, \color{blue}{\left(b \cdot \frac{1}{48}\right)}\right)\right)\right)\right) \]
                                                              11. *-lowering-*.f6436.7%

                                                                \[\leadsto \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(\frac{-1}{4}, \mathsf{*.f64}\left(b, \mathsf{*.f64}\left(b, \color{blue}{\frac{1}{48}}\right)\right)\right)\right)\right) \]
                                                            8. Simplified36.7%

                                                              \[\leadsto \color{blue}{0.5 + b \cdot \left(-0.25 + b \cdot \left(b \cdot 0.020833333333333332\right)\right)} \]
                                                            9. Taylor expanded in b around inf

                                                              \[\leadsto \color{blue}{\frac{1}{48} \cdot {b}^{3}} \]
                                                            10. Step-by-step derivation
                                                              1. *-lowering-*.f64N/A

                                                                \[\leadsto \mathsf{*.f64}\left(\frac{1}{48}, \color{blue}{\left({b}^{3}\right)}\right) \]
                                                              2. cube-multN/A

                                                                \[\leadsto \mathsf{*.f64}\left(\frac{1}{48}, \left(b \cdot \color{blue}{\left(b \cdot b\right)}\right)\right) \]
                                                              3. unpow2N/A

                                                                \[\leadsto \mathsf{*.f64}\left(\frac{1}{48}, \left(b \cdot {b}^{\color{blue}{2}}\right)\right) \]
                                                              4. *-lowering-*.f64N/A

                                                                \[\leadsto \mathsf{*.f64}\left(\frac{1}{48}, \mathsf{*.f64}\left(b, \color{blue}{\left({b}^{2}\right)}\right)\right) \]
                                                              5. unpow2N/A

                                                                \[\leadsto \mathsf{*.f64}\left(\frac{1}{48}, \mathsf{*.f64}\left(b, \left(b \cdot \color{blue}{b}\right)\right)\right) \]
                                                              6. *-lowering-*.f6466.5%

                                                                \[\leadsto \mathsf{*.f64}\left(\frac{1}{48}, \mathsf{*.f64}\left(b, \mathsf{*.f64}\left(b, \color{blue}{b}\right)\right)\right) \]
                                                            11. Simplified66.5%

                                                              \[\leadsto \color{blue}{0.020833333333333332 \cdot \left(b \cdot \left(b \cdot b\right)\right)} \]

                                                            if -6.9999999999999999e-289 < b

                                                            1. Initial program 99.3%

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

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

                                                                \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \color{blue}{\left(e^{b}\right)}\right)\right) \]
                                                              3. exp-lowering-exp.f6482.8%

                                                                \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(b\right)\right)\right) \]
                                                            5. Simplified82.8%

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

                                                              \[\leadsto \mathsf{/.f64}\left(1, \color{blue}{\left(2 + b \cdot \left(1 + b \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot b\right)\right)\right)}\right) \]
                                                            7. Step-by-step derivation
                                                              1. +-lowering-+.f64N/A

                                                                \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \color{blue}{\left(b \cdot \left(1 + b \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot b\right)\right)\right)}\right)\right) \]
                                                              2. *-lowering-*.f64N/A

                                                                \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \color{blue}{\left(1 + b \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot b\right)\right)}\right)\right)\right) \]
                                                              3. +-lowering-+.f64N/A

                                                                \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(1, \color{blue}{\left(b \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot b\right)\right)}\right)\right)\right)\right) \]
                                                              4. *-lowering-*.f64N/A

                                                                \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(b, \color{blue}{\left(\frac{1}{2} + \frac{1}{6} \cdot b\right)}\right)\right)\right)\right)\right) \]
                                                              5. +-lowering-+.f64N/A

                                                                \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(\frac{1}{2}, \color{blue}{\left(\frac{1}{6} \cdot b\right)}\right)\right)\right)\right)\right)\right) \]
                                                              6. *-commutativeN/A

                                                                \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(\frac{1}{2}, \left(b \cdot \color{blue}{\frac{1}{6}}\right)\right)\right)\right)\right)\right)\right) \]
                                                              7. *-lowering-*.f6471.2%

                                                                \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(b, \color{blue}{\frac{1}{6}}\right)\right)\right)\right)\right)\right)\right) \]
                                                            8. Simplified71.2%

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

                                                          Alternative 15: 69.0% accurate, 10.5× speedup?

                                                          \[\begin{array}{l} \\ \begin{array}{l} t_0 := b \cdot \left(b \cdot b\right)\\ \mathbf{if}\;b \leq -6.5 \cdot 10^{-9}:\\ \;\;\;\;1\\ \mathbf{elif}\;b \leq -2.5 \cdot 10^{-203}:\\ \;\;\;\;0.5 + a \cdot 0.25\\ \mathbf{elif}\;b \leq -8.1 \cdot 10^{-289}:\\ \;\;\;\;0.020833333333333332 \cdot t\_0\\ \mathbf{elif}\;b \leq 1.92:\\ \;\;\;\;\frac{1}{\frac{1}{0.5 + b \cdot -0.25}}\\ \mathbf{else}:\\ \;\;\;\;\frac{6}{t\_0}\\ \end{array} \end{array} \]
                                                          (FPCore (a b)
                                                           :precision binary64
                                                           (let* ((t_0 (* b (* b b))))
                                                             (if (<= b -6.5e-9)
                                                               1.0
                                                               (if (<= b -2.5e-203)
                                                                 (+ 0.5 (* a 0.25))
                                                                 (if (<= b -8.1e-289)
                                                                   (* 0.020833333333333332 t_0)
                                                                   (if (<= b 1.92) (/ 1.0 (/ 1.0 (+ 0.5 (* b -0.25)))) (/ 6.0 t_0)))))))
                                                          double code(double a, double b) {
                                                          	double t_0 = b * (b * b);
                                                          	double tmp;
                                                          	if (b <= -6.5e-9) {
                                                          		tmp = 1.0;
                                                          	} else if (b <= -2.5e-203) {
                                                          		tmp = 0.5 + (a * 0.25);
                                                          	} else if (b <= -8.1e-289) {
                                                          		tmp = 0.020833333333333332 * t_0;
                                                          	} else if (b <= 1.92) {
                                                          		tmp = 1.0 / (1.0 / (0.5 + (b * -0.25)));
                                                          	} else {
                                                          		tmp = 6.0 / t_0;
                                                          	}
                                                          	return tmp;
                                                          }
                                                          
                                                          real(8) function code(a, b)
                                                              real(8), intent (in) :: a
                                                              real(8), intent (in) :: b
                                                              real(8) :: t_0
                                                              real(8) :: tmp
                                                              t_0 = b * (b * b)
                                                              if (b <= (-6.5d-9)) then
                                                                  tmp = 1.0d0
                                                              else if (b <= (-2.5d-203)) then
                                                                  tmp = 0.5d0 + (a * 0.25d0)
                                                              else if (b <= (-8.1d-289)) then
                                                                  tmp = 0.020833333333333332d0 * t_0
                                                              else if (b <= 1.92d0) then
                                                                  tmp = 1.0d0 / (1.0d0 / (0.5d0 + (b * (-0.25d0))))
                                                              else
                                                                  tmp = 6.0d0 / t_0
                                                              end if
                                                              code = tmp
                                                          end function
                                                          
                                                          public static double code(double a, double b) {
                                                          	double t_0 = b * (b * b);
                                                          	double tmp;
                                                          	if (b <= -6.5e-9) {
                                                          		tmp = 1.0;
                                                          	} else if (b <= -2.5e-203) {
                                                          		tmp = 0.5 + (a * 0.25);
                                                          	} else if (b <= -8.1e-289) {
                                                          		tmp = 0.020833333333333332 * t_0;
                                                          	} else if (b <= 1.92) {
                                                          		tmp = 1.0 / (1.0 / (0.5 + (b * -0.25)));
                                                          	} else {
                                                          		tmp = 6.0 / t_0;
                                                          	}
                                                          	return tmp;
                                                          }
                                                          
                                                          def code(a, b):
                                                          	t_0 = b * (b * b)
                                                          	tmp = 0
                                                          	if b <= -6.5e-9:
                                                          		tmp = 1.0
                                                          	elif b <= -2.5e-203:
                                                          		tmp = 0.5 + (a * 0.25)
                                                          	elif b <= -8.1e-289:
                                                          		tmp = 0.020833333333333332 * t_0
                                                          	elif b <= 1.92:
                                                          		tmp = 1.0 / (1.0 / (0.5 + (b * -0.25)))
                                                          	else:
                                                          		tmp = 6.0 / t_0
                                                          	return tmp
                                                          
                                                          function code(a, b)
                                                          	t_0 = Float64(b * Float64(b * b))
                                                          	tmp = 0.0
                                                          	if (b <= -6.5e-9)
                                                          		tmp = 1.0;
                                                          	elseif (b <= -2.5e-203)
                                                          		tmp = Float64(0.5 + Float64(a * 0.25));
                                                          	elseif (b <= -8.1e-289)
                                                          		tmp = Float64(0.020833333333333332 * t_0);
                                                          	elseif (b <= 1.92)
                                                          		tmp = Float64(1.0 / Float64(1.0 / Float64(0.5 + Float64(b * -0.25))));
                                                          	else
                                                          		tmp = Float64(6.0 / t_0);
                                                          	end
                                                          	return tmp
                                                          end
                                                          
                                                          function tmp_2 = code(a, b)
                                                          	t_0 = b * (b * b);
                                                          	tmp = 0.0;
                                                          	if (b <= -6.5e-9)
                                                          		tmp = 1.0;
                                                          	elseif (b <= -2.5e-203)
                                                          		tmp = 0.5 + (a * 0.25);
                                                          	elseif (b <= -8.1e-289)
                                                          		tmp = 0.020833333333333332 * t_0;
                                                          	elseif (b <= 1.92)
                                                          		tmp = 1.0 / (1.0 / (0.5 + (b * -0.25)));
                                                          	else
                                                          		tmp = 6.0 / t_0;
                                                          	end
                                                          	tmp_2 = tmp;
                                                          end
                                                          
                                                          code[a_, b_] := Block[{t$95$0 = N[(b * N[(b * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -6.5e-9], 1.0, If[LessEqual[b, -2.5e-203], N[(0.5 + N[(a * 0.25), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, -8.1e-289], N[(0.020833333333333332 * t$95$0), $MachinePrecision], If[LessEqual[b, 1.92], N[(1.0 / N[(1.0 / N[(0.5 + N[(b * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(6.0 / t$95$0), $MachinePrecision]]]]]]
                                                          
                                                          \begin{array}{l}
                                                          
                                                          \\
                                                          \begin{array}{l}
                                                          t_0 := b \cdot \left(b \cdot b\right)\\
                                                          \mathbf{if}\;b \leq -6.5 \cdot 10^{-9}:\\
                                                          \;\;\;\;1\\
                                                          
                                                          \mathbf{elif}\;b \leq -2.5 \cdot 10^{-203}:\\
                                                          \;\;\;\;0.5 + a \cdot 0.25\\
                                                          
                                                          \mathbf{elif}\;b \leq -8.1 \cdot 10^{-289}:\\
                                                          \;\;\;\;0.020833333333333332 \cdot t\_0\\
                                                          
                                                          \mathbf{elif}\;b \leq 1.92:\\
                                                          \;\;\;\;\frac{1}{\frac{1}{0.5 + b \cdot -0.25}}\\
                                                          
                                                          \mathbf{else}:\\
                                                          \;\;\;\;\frac{6}{t\_0}\\
                                                          
                                                          
                                                          \end{array}
                                                          \end{array}
                                                          
                                                          Derivation
                                                          1. Split input into 5 regimes
                                                          2. if b < -6.5000000000000003e-9

                                                            1. Initial program 97.9%

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

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

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

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

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

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

                                                                \[\leadsto \mathsf{exp.f64}\left(\left(\log \left(e^{a} + e^{b}\right) \cdot -1 + a\right)\right) \]
                                                              7. +-lowering-+.f64N/A

                                                                \[\leadsto \mathsf{exp.f64}\left(\mathsf{+.f64}\left(\left(\log \left(e^{a} + e^{b}\right) \cdot -1\right), a\right)\right) \]
                                                              8. *-lowering-*.f64N/A

                                                                \[\leadsto \mathsf{exp.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\log \left(e^{a} + e^{b}\right), -1\right), a\right)\right) \]
                                                              9. log-lowering-log.f64N/A

                                                                \[\leadsto \mathsf{exp.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{log.f64}\left(\left(e^{a} + e^{b}\right)\right), -1\right), a\right)\right) \]
                                                              10. +-lowering-+.f64N/A

                                                                \[\leadsto \mathsf{exp.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(\left(e^{a}\right), \left(e^{b}\right)\right)\right), -1\right), a\right)\right) \]
                                                              11. exp-lowering-exp.f64N/A

                                                                \[\leadsto \mathsf{exp.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(a\right), \left(e^{b}\right)\right)\right), -1\right), a\right)\right) \]
                                                              12. exp-lowering-exp.f6498.0%

                                                                \[\leadsto \mathsf{exp.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(a\right), \mathsf{exp.f64}\left(b\right)\right)\right), -1\right), a\right)\right) \]
                                                            4. Applied egg-rr98.0%

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

                                                              \[\leadsto \mathsf{exp.f64}\left(\color{blue}{a}\right) \]
                                                            6. Step-by-step derivation
                                                              1. Simplified97.7%

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

                                                                \[\leadsto \color{blue}{1} \]
                                                              3. Step-by-step derivation
                                                                1. Simplified98.0%

                                                                  \[\leadsto \color{blue}{1} \]

                                                                if -6.5000000000000003e-9 < b < -2.5000000000000001e-203

                                                                1. Initial program 100.0%

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

                                                                  \[\leadsto \mathsf{/.f64}\left(\mathsf{exp.f64}\left(a\right), \mathsf{+.f64}\left(\mathsf{exp.f64}\left(a\right), \color{blue}{1}\right)\right) \]
                                                                4. Step-by-step derivation
                                                                  1. Simplified100.0%

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

                                                                    \[\leadsto \color{blue}{\frac{1}{2} + \frac{1}{4} \cdot a} \]
                                                                  3. Step-by-step derivation
                                                                    1. +-lowering-+.f64N/A

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

                                                                      \[\leadsto \mathsf{+.f64}\left(\frac{1}{2}, \left(a \cdot \color{blue}{\frac{1}{4}}\right)\right) \]
                                                                    3. *-lowering-*.f6454.8%

                                                                      \[\leadsto \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(a, \color{blue}{\frac{1}{4}}\right)\right) \]
                                                                  4. Simplified54.8%

                                                                    \[\leadsto \color{blue}{0.5 + a \cdot 0.25} \]

                                                                  if -2.5000000000000001e-203 < b < -8.1000000000000003e-289

                                                                  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. /-lowering-/.f64N/A

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

                                                                      \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \color{blue}{\left(e^{b}\right)}\right)\right) \]
                                                                    3. exp-lowering-exp.f6436.7%

                                                                      \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(b\right)\right)\right) \]
                                                                  5. Simplified36.7%

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

                                                                    \[\leadsto \color{blue}{\frac{1}{2} + b \cdot \left(\frac{1}{48} \cdot {b}^{2} - \frac{1}{4}\right)} \]
                                                                  7. Step-by-step derivation
                                                                    1. +-lowering-+.f64N/A

                                                                      \[\leadsto \mathsf{+.f64}\left(\frac{1}{2}, \color{blue}{\left(b \cdot \left(\frac{1}{48} \cdot {b}^{2} - \frac{1}{4}\right)\right)}\right) \]
                                                                    2. *-lowering-*.f64N/A

                                                                      \[\leadsto \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(b, \color{blue}{\left(\frac{1}{48} \cdot {b}^{2} - \frac{1}{4}\right)}\right)\right) \]
                                                                    3. sub-negN/A

                                                                      \[\leadsto \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(b, \left(\frac{1}{48} \cdot {b}^{2} + \color{blue}{\left(\mathsf{neg}\left(\frac{1}{4}\right)\right)}\right)\right)\right) \]
                                                                    4. metadata-evalN/A

                                                                      \[\leadsto \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(b, \left(\frac{1}{48} \cdot {b}^{2} + \frac{-1}{4}\right)\right)\right) \]
                                                                    5. +-commutativeN/A

                                                                      \[\leadsto \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(b, \left(\frac{-1}{4} + \color{blue}{\frac{1}{48} \cdot {b}^{2}}\right)\right)\right) \]
                                                                    6. +-lowering-+.f64N/A

                                                                      \[\leadsto \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(\frac{-1}{4}, \color{blue}{\left(\frac{1}{48} \cdot {b}^{2}\right)}\right)\right)\right) \]
                                                                    7. *-commutativeN/A

                                                                      \[\leadsto \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(\frac{-1}{4}, \left({b}^{2} \cdot \color{blue}{\frac{1}{48}}\right)\right)\right)\right) \]
                                                                    8. unpow2N/A

                                                                      \[\leadsto \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(\frac{-1}{4}, \left(\left(b \cdot b\right) \cdot \frac{1}{48}\right)\right)\right)\right) \]
                                                                    9. associate-*l*N/A

                                                                      \[\leadsto \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(\frac{-1}{4}, \left(b \cdot \color{blue}{\left(b \cdot \frac{1}{48}\right)}\right)\right)\right)\right) \]
                                                                    10. *-lowering-*.f64N/A

                                                                      \[\leadsto \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(\frac{-1}{4}, \mathsf{*.f64}\left(b, \color{blue}{\left(b \cdot \frac{1}{48}\right)}\right)\right)\right)\right) \]
                                                                    11. *-lowering-*.f6436.7%

                                                                      \[\leadsto \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(\frac{-1}{4}, \mathsf{*.f64}\left(b, \mathsf{*.f64}\left(b, \color{blue}{\frac{1}{48}}\right)\right)\right)\right)\right) \]
                                                                  8. Simplified36.7%

                                                                    \[\leadsto \color{blue}{0.5 + b \cdot \left(-0.25 + b \cdot \left(b \cdot 0.020833333333333332\right)\right)} \]
                                                                  9. Taylor expanded in b around inf

                                                                    \[\leadsto \color{blue}{\frac{1}{48} \cdot {b}^{3}} \]
                                                                  10. Step-by-step derivation
                                                                    1. *-lowering-*.f64N/A

                                                                      \[\leadsto \mathsf{*.f64}\left(\frac{1}{48}, \color{blue}{\left({b}^{3}\right)}\right) \]
                                                                    2. cube-multN/A

                                                                      \[\leadsto \mathsf{*.f64}\left(\frac{1}{48}, \left(b \cdot \color{blue}{\left(b \cdot b\right)}\right)\right) \]
                                                                    3. unpow2N/A

                                                                      \[\leadsto \mathsf{*.f64}\left(\frac{1}{48}, \left(b \cdot {b}^{\color{blue}{2}}\right)\right) \]
                                                                    4. *-lowering-*.f64N/A

                                                                      \[\leadsto \mathsf{*.f64}\left(\frac{1}{48}, \mathsf{*.f64}\left(b, \color{blue}{\left({b}^{2}\right)}\right)\right) \]
                                                                    5. unpow2N/A

                                                                      \[\leadsto \mathsf{*.f64}\left(\frac{1}{48}, \mathsf{*.f64}\left(b, \left(b \cdot \color{blue}{b}\right)\right)\right) \]
                                                                    6. *-lowering-*.f6466.5%

                                                                      \[\leadsto \mathsf{*.f64}\left(\frac{1}{48}, \mathsf{*.f64}\left(b, \mathsf{*.f64}\left(b, \color{blue}{b}\right)\right)\right) \]
                                                                  11. Simplified66.5%

                                                                    \[\leadsto \color{blue}{0.020833333333333332 \cdot \left(b \cdot \left(b \cdot b\right)\right)} \]

                                                                  if -8.1000000000000003e-289 < b < 1.9199999999999999

                                                                  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. /-lowering-/.f64N/A

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

                                                                      \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \color{blue}{\left(e^{b}\right)}\right)\right) \]
                                                                    3. exp-lowering-exp.f6467.7%

                                                                      \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(b\right)\right)\right) \]
                                                                  5. Simplified67.7%

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

                                                                    \[\leadsto \color{blue}{\frac{1}{2} + \frac{-1}{4} \cdot b} \]
                                                                  7. Step-by-step derivation
                                                                    1. +-lowering-+.f64N/A

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

                                                                      \[\leadsto \mathsf{+.f64}\left(\frac{1}{2}, \left(b \cdot \color{blue}{\frac{-1}{4}}\right)\right) \]
                                                                    3. *-lowering-*.f6467.6%

                                                                      \[\leadsto \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(b, \color{blue}{\frac{-1}{4}}\right)\right) \]
                                                                  8. Simplified67.6%

                                                                    \[\leadsto \color{blue}{0.5 + b \cdot -0.25} \]
                                                                  9. Step-by-step derivation
                                                                    1. flip-+N/A

                                                                      \[\leadsto \frac{\frac{1}{2} \cdot \frac{1}{2} - \left(b \cdot \frac{-1}{4}\right) \cdot \left(b \cdot \frac{-1}{4}\right)}{\color{blue}{\frac{1}{2} - b \cdot \frac{-1}{4}}} \]
                                                                    2. clear-numN/A

                                                                      \[\leadsto \frac{1}{\color{blue}{\frac{\frac{1}{2} - b \cdot \frac{-1}{4}}{\frac{1}{2} \cdot \frac{1}{2} - \left(b \cdot \frac{-1}{4}\right) \cdot \left(b \cdot \frac{-1}{4}\right)}}} \]
                                                                    3. /-lowering-/.f64N/A

                                                                      \[\leadsto \mathsf{/.f64}\left(1, \color{blue}{\left(\frac{\frac{1}{2} - b \cdot \frac{-1}{4}}{\frac{1}{2} \cdot \frac{1}{2} - \left(b \cdot \frac{-1}{4}\right) \cdot \left(b \cdot \frac{-1}{4}\right)}\right)}\right) \]
                                                                    4. clear-numN/A

                                                                      \[\leadsto \mathsf{/.f64}\left(1, \left(\frac{1}{\color{blue}{\frac{\frac{1}{2} \cdot \frac{1}{2} - \left(b \cdot \frac{-1}{4}\right) \cdot \left(b \cdot \frac{-1}{4}\right)}{\frac{1}{2} - b \cdot \frac{-1}{4}}}}\right)\right) \]
                                                                    5. flip-+N/A

                                                                      \[\leadsto \mathsf{/.f64}\left(1, \left(\frac{1}{\frac{1}{2} + \color{blue}{b \cdot \frac{-1}{4}}}\right)\right) \]
                                                                    6. /-lowering-/.f64N/A

                                                                      \[\leadsto \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(1, \color{blue}{\left(\frac{1}{2} + b \cdot \frac{-1}{4}\right)}\right)\right) \]
                                                                    7. +-lowering-+.f64N/A

                                                                      \[\leadsto \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(\frac{1}{2}, \color{blue}{\left(b \cdot \frac{-1}{4}\right)}\right)\right)\right) \]
                                                                    8. *-lowering-*.f6467.6%

                                                                      \[\leadsto \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(b, \color{blue}{\frac{-1}{4}}\right)\right)\right)\right) \]
                                                                  10. Applied egg-rr67.6%

                                                                    \[\leadsto \color{blue}{\frac{1}{\frac{1}{0.5 + b \cdot -0.25}}} \]

                                                                  if 1.9199999999999999 < b

                                                                  1. Initial program 98.5%

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

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

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

                                                                      \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \color{blue}{\left(e^{b}\right)}\right)\right) \]
                                                                    3. exp-lowering-exp.f64100.0%

                                                                      \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(b\right)\right)\right) \]
                                                                  5. Simplified100.0%

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

                                                                    \[\leadsto \mathsf{/.f64}\left(1, \color{blue}{\left(2 + b \cdot \left(1 + b \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot b\right)\right)\right)}\right) \]
                                                                  7. Step-by-step derivation
                                                                    1. +-lowering-+.f64N/A

                                                                      \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \color{blue}{\left(b \cdot \left(1 + b \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot b\right)\right)\right)}\right)\right) \]
                                                                    2. *-lowering-*.f64N/A

                                                                      \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \color{blue}{\left(1 + b \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot b\right)\right)}\right)\right)\right) \]
                                                                    3. +-lowering-+.f64N/A

                                                                      \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(1, \color{blue}{\left(b \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot b\right)\right)}\right)\right)\right)\right) \]
                                                                    4. *-lowering-*.f64N/A

                                                                      \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(b, \color{blue}{\left(\frac{1}{2} + \frac{1}{6} \cdot b\right)}\right)\right)\right)\right)\right) \]
                                                                    5. +-lowering-+.f64N/A

                                                                      \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(\frac{1}{2}, \color{blue}{\left(\frac{1}{6} \cdot b\right)}\right)\right)\right)\right)\right)\right) \]
                                                                    6. *-commutativeN/A

                                                                      \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(\frac{1}{2}, \left(b \cdot \color{blue}{\frac{1}{6}}\right)\right)\right)\right)\right)\right)\right) \]
                                                                    7. *-lowering-*.f6475.1%

                                                                      \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(b, \color{blue}{\frac{1}{6}}\right)\right)\right)\right)\right)\right)\right) \]
                                                                  8. Simplified75.1%

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

                                                                    \[\leadsto \color{blue}{\frac{6}{{b}^{3}}} \]
                                                                  10. Step-by-step derivation
                                                                    1. /-lowering-/.f64N/A

                                                                      \[\leadsto \mathsf{/.f64}\left(6, \color{blue}{\left({b}^{3}\right)}\right) \]
                                                                    2. cube-multN/A

                                                                      \[\leadsto \mathsf{/.f64}\left(6, \left(b \cdot \color{blue}{\left(b \cdot b\right)}\right)\right) \]
                                                                    3. unpow2N/A

                                                                      \[\leadsto \mathsf{/.f64}\left(6, \left(b \cdot {b}^{\color{blue}{2}}\right)\right) \]
                                                                    4. *-lowering-*.f64N/A

                                                                      \[\leadsto \mathsf{/.f64}\left(6, \mathsf{*.f64}\left(b, \color{blue}{\left({b}^{2}\right)}\right)\right) \]
                                                                    5. unpow2N/A

                                                                      \[\leadsto \mathsf{/.f64}\left(6, \mathsf{*.f64}\left(b, \left(b \cdot \color{blue}{b}\right)\right)\right) \]
                                                                    6. *-lowering-*.f6475.1%

                                                                      \[\leadsto \mathsf{/.f64}\left(6, \mathsf{*.f64}\left(b, \mathsf{*.f64}\left(b, \color{blue}{b}\right)\right)\right) \]
                                                                  11. Simplified75.1%

                                                                    \[\leadsto \color{blue}{\frac{6}{b \cdot \left(b \cdot b\right)}} \]
                                                                5. Recombined 5 regimes into one program.
                                                                6. Add Preprocessing

                                                                Alternative 16: 69.0% accurate, 11.3× speedup?

                                                                \[\begin{array}{l} \\ \begin{array}{l} t_0 := b \cdot \left(b \cdot b\right)\\ \mathbf{if}\;b \leq -6.5 \cdot 10^{-9}:\\ \;\;\;\;1\\ \mathbf{elif}\;b \leq -9.6 \cdot 10^{-204}:\\ \;\;\;\;0.5 + a \cdot 0.25\\ \mathbf{elif}\;b \leq -8.1 \cdot 10^{-289}:\\ \;\;\;\;0.020833333333333332 \cdot t\_0\\ \mathbf{elif}\;b \leq 1.92:\\ \;\;\;\;0.5 + b \cdot -0.25\\ \mathbf{else}:\\ \;\;\;\;\frac{6}{t\_0}\\ \end{array} \end{array} \]
                                                                (FPCore (a b)
                                                                 :precision binary64
                                                                 (let* ((t_0 (* b (* b b))))
                                                                   (if (<= b -6.5e-9)
                                                                     1.0
                                                                     (if (<= b -9.6e-204)
                                                                       (+ 0.5 (* a 0.25))
                                                                       (if (<= b -8.1e-289)
                                                                         (* 0.020833333333333332 t_0)
                                                                         (if (<= b 1.92) (+ 0.5 (* b -0.25)) (/ 6.0 t_0)))))))
                                                                double code(double a, double b) {
                                                                	double t_0 = b * (b * b);
                                                                	double tmp;
                                                                	if (b <= -6.5e-9) {
                                                                		tmp = 1.0;
                                                                	} else if (b <= -9.6e-204) {
                                                                		tmp = 0.5 + (a * 0.25);
                                                                	} else if (b <= -8.1e-289) {
                                                                		tmp = 0.020833333333333332 * t_0;
                                                                	} else if (b <= 1.92) {
                                                                		tmp = 0.5 + (b * -0.25);
                                                                	} else {
                                                                		tmp = 6.0 / t_0;
                                                                	}
                                                                	return tmp;
                                                                }
                                                                
                                                                real(8) function code(a, b)
                                                                    real(8), intent (in) :: a
                                                                    real(8), intent (in) :: b
                                                                    real(8) :: t_0
                                                                    real(8) :: tmp
                                                                    t_0 = b * (b * b)
                                                                    if (b <= (-6.5d-9)) then
                                                                        tmp = 1.0d0
                                                                    else if (b <= (-9.6d-204)) then
                                                                        tmp = 0.5d0 + (a * 0.25d0)
                                                                    else if (b <= (-8.1d-289)) then
                                                                        tmp = 0.020833333333333332d0 * t_0
                                                                    else if (b <= 1.92d0) then
                                                                        tmp = 0.5d0 + (b * (-0.25d0))
                                                                    else
                                                                        tmp = 6.0d0 / t_0
                                                                    end if
                                                                    code = tmp
                                                                end function
                                                                
                                                                public static double code(double a, double b) {
                                                                	double t_0 = b * (b * b);
                                                                	double tmp;
                                                                	if (b <= -6.5e-9) {
                                                                		tmp = 1.0;
                                                                	} else if (b <= -9.6e-204) {
                                                                		tmp = 0.5 + (a * 0.25);
                                                                	} else if (b <= -8.1e-289) {
                                                                		tmp = 0.020833333333333332 * t_0;
                                                                	} else if (b <= 1.92) {
                                                                		tmp = 0.5 + (b * -0.25);
                                                                	} else {
                                                                		tmp = 6.0 / t_0;
                                                                	}
                                                                	return tmp;
                                                                }
                                                                
                                                                def code(a, b):
                                                                	t_0 = b * (b * b)
                                                                	tmp = 0
                                                                	if b <= -6.5e-9:
                                                                		tmp = 1.0
                                                                	elif b <= -9.6e-204:
                                                                		tmp = 0.5 + (a * 0.25)
                                                                	elif b <= -8.1e-289:
                                                                		tmp = 0.020833333333333332 * t_0
                                                                	elif b <= 1.92:
                                                                		tmp = 0.5 + (b * -0.25)
                                                                	else:
                                                                		tmp = 6.0 / t_0
                                                                	return tmp
                                                                
                                                                function code(a, b)
                                                                	t_0 = Float64(b * Float64(b * b))
                                                                	tmp = 0.0
                                                                	if (b <= -6.5e-9)
                                                                		tmp = 1.0;
                                                                	elseif (b <= -9.6e-204)
                                                                		tmp = Float64(0.5 + Float64(a * 0.25));
                                                                	elseif (b <= -8.1e-289)
                                                                		tmp = Float64(0.020833333333333332 * t_0);
                                                                	elseif (b <= 1.92)
                                                                		tmp = Float64(0.5 + Float64(b * -0.25));
                                                                	else
                                                                		tmp = Float64(6.0 / t_0);
                                                                	end
                                                                	return tmp
                                                                end
                                                                
                                                                function tmp_2 = code(a, b)
                                                                	t_0 = b * (b * b);
                                                                	tmp = 0.0;
                                                                	if (b <= -6.5e-9)
                                                                		tmp = 1.0;
                                                                	elseif (b <= -9.6e-204)
                                                                		tmp = 0.5 + (a * 0.25);
                                                                	elseif (b <= -8.1e-289)
                                                                		tmp = 0.020833333333333332 * t_0;
                                                                	elseif (b <= 1.92)
                                                                		tmp = 0.5 + (b * -0.25);
                                                                	else
                                                                		tmp = 6.0 / t_0;
                                                                	end
                                                                	tmp_2 = tmp;
                                                                end
                                                                
                                                                code[a_, b_] := Block[{t$95$0 = N[(b * N[(b * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -6.5e-9], 1.0, If[LessEqual[b, -9.6e-204], N[(0.5 + N[(a * 0.25), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, -8.1e-289], N[(0.020833333333333332 * t$95$0), $MachinePrecision], If[LessEqual[b, 1.92], N[(0.5 + N[(b * -0.25), $MachinePrecision]), $MachinePrecision], N[(6.0 / t$95$0), $MachinePrecision]]]]]]
                                                                
                                                                \begin{array}{l}
                                                                
                                                                \\
                                                                \begin{array}{l}
                                                                t_0 := b \cdot \left(b \cdot b\right)\\
                                                                \mathbf{if}\;b \leq -6.5 \cdot 10^{-9}:\\
                                                                \;\;\;\;1\\
                                                                
                                                                \mathbf{elif}\;b \leq -9.6 \cdot 10^{-204}:\\
                                                                \;\;\;\;0.5 + a \cdot 0.25\\
                                                                
                                                                \mathbf{elif}\;b \leq -8.1 \cdot 10^{-289}:\\
                                                                \;\;\;\;0.020833333333333332 \cdot t\_0\\
                                                                
                                                                \mathbf{elif}\;b \leq 1.92:\\
                                                                \;\;\;\;0.5 + b \cdot -0.25\\
                                                                
                                                                \mathbf{else}:\\
                                                                \;\;\;\;\frac{6}{t\_0}\\
                                                                
                                                                
                                                                \end{array}
                                                                \end{array}
                                                                
                                                                Derivation
                                                                1. Split input into 5 regimes
                                                                2. if b < -6.5000000000000003e-9

                                                                  1. Initial program 97.9%

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

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

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

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

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

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

                                                                      \[\leadsto \mathsf{exp.f64}\left(\left(\log \left(e^{a} + e^{b}\right) \cdot -1 + a\right)\right) \]
                                                                    7. +-lowering-+.f64N/A

                                                                      \[\leadsto \mathsf{exp.f64}\left(\mathsf{+.f64}\left(\left(\log \left(e^{a} + e^{b}\right) \cdot -1\right), a\right)\right) \]
                                                                    8. *-lowering-*.f64N/A

                                                                      \[\leadsto \mathsf{exp.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\log \left(e^{a} + e^{b}\right), -1\right), a\right)\right) \]
                                                                    9. log-lowering-log.f64N/A

                                                                      \[\leadsto \mathsf{exp.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{log.f64}\left(\left(e^{a} + e^{b}\right)\right), -1\right), a\right)\right) \]
                                                                    10. +-lowering-+.f64N/A

                                                                      \[\leadsto \mathsf{exp.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(\left(e^{a}\right), \left(e^{b}\right)\right)\right), -1\right), a\right)\right) \]
                                                                    11. exp-lowering-exp.f64N/A

                                                                      \[\leadsto \mathsf{exp.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(a\right), \left(e^{b}\right)\right)\right), -1\right), a\right)\right) \]
                                                                    12. exp-lowering-exp.f6498.0%

                                                                      \[\leadsto \mathsf{exp.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(a\right), \mathsf{exp.f64}\left(b\right)\right)\right), -1\right), a\right)\right) \]
                                                                  4. Applied egg-rr98.0%

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

                                                                    \[\leadsto \mathsf{exp.f64}\left(\color{blue}{a}\right) \]
                                                                  6. Step-by-step derivation
                                                                    1. Simplified97.7%

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

                                                                      \[\leadsto \color{blue}{1} \]
                                                                    3. Step-by-step derivation
                                                                      1. Simplified98.0%

                                                                        \[\leadsto \color{blue}{1} \]

                                                                      if -6.5000000000000003e-9 < b < -9.6e-204

                                                                      1. Initial program 100.0%

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

                                                                        \[\leadsto \mathsf{/.f64}\left(\mathsf{exp.f64}\left(a\right), \mathsf{+.f64}\left(\mathsf{exp.f64}\left(a\right), \color{blue}{1}\right)\right) \]
                                                                      4. Step-by-step derivation
                                                                        1. Simplified100.0%

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

                                                                          \[\leadsto \color{blue}{\frac{1}{2} + \frac{1}{4} \cdot a} \]
                                                                        3. Step-by-step derivation
                                                                          1. +-lowering-+.f64N/A

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

                                                                            \[\leadsto \mathsf{+.f64}\left(\frac{1}{2}, \left(a \cdot \color{blue}{\frac{1}{4}}\right)\right) \]
                                                                          3. *-lowering-*.f6454.8%

                                                                            \[\leadsto \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(a, \color{blue}{\frac{1}{4}}\right)\right) \]
                                                                        4. Simplified54.8%

                                                                          \[\leadsto \color{blue}{0.5 + a \cdot 0.25} \]

                                                                        if -9.6e-204 < b < -8.1000000000000003e-289

                                                                        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. /-lowering-/.f64N/A

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

                                                                            \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \color{blue}{\left(e^{b}\right)}\right)\right) \]
                                                                          3. exp-lowering-exp.f6436.7%

                                                                            \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(b\right)\right)\right) \]
                                                                        5. Simplified36.7%

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

                                                                          \[\leadsto \color{blue}{\frac{1}{2} + b \cdot \left(\frac{1}{48} \cdot {b}^{2} - \frac{1}{4}\right)} \]
                                                                        7. Step-by-step derivation
                                                                          1. +-lowering-+.f64N/A

                                                                            \[\leadsto \mathsf{+.f64}\left(\frac{1}{2}, \color{blue}{\left(b \cdot \left(\frac{1}{48} \cdot {b}^{2} - \frac{1}{4}\right)\right)}\right) \]
                                                                          2. *-lowering-*.f64N/A

                                                                            \[\leadsto \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(b, \color{blue}{\left(\frac{1}{48} \cdot {b}^{2} - \frac{1}{4}\right)}\right)\right) \]
                                                                          3. sub-negN/A

                                                                            \[\leadsto \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(b, \left(\frac{1}{48} \cdot {b}^{2} + \color{blue}{\left(\mathsf{neg}\left(\frac{1}{4}\right)\right)}\right)\right)\right) \]
                                                                          4. metadata-evalN/A

                                                                            \[\leadsto \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(b, \left(\frac{1}{48} \cdot {b}^{2} + \frac{-1}{4}\right)\right)\right) \]
                                                                          5. +-commutativeN/A

                                                                            \[\leadsto \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(b, \left(\frac{-1}{4} + \color{blue}{\frac{1}{48} \cdot {b}^{2}}\right)\right)\right) \]
                                                                          6. +-lowering-+.f64N/A

                                                                            \[\leadsto \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(\frac{-1}{4}, \color{blue}{\left(\frac{1}{48} \cdot {b}^{2}\right)}\right)\right)\right) \]
                                                                          7. *-commutativeN/A

                                                                            \[\leadsto \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(\frac{-1}{4}, \left({b}^{2} \cdot \color{blue}{\frac{1}{48}}\right)\right)\right)\right) \]
                                                                          8. unpow2N/A

                                                                            \[\leadsto \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(\frac{-1}{4}, \left(\left(b \cdot b\right) \cdot \frac{1}{48}\right)\right)\right)\right) \]
                                                                          9. associate-*l*N/A

                                                                            \[\leadsto \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(\frac{-1}{4}, \left(b \cdot \color{blue}{\left(b \cdot \frac{1}{48}\right)}\right)\right)\right)\right) \]
                                                                          10. *-lowering-*.f64N/A

                                                                            \[\leadsto \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(\frac{-1}{4}, \mathsf{*.f64}\left(b, \color{blue}{\left(b \cdot \frac{1}{48}\right)}\right)\right)\right)\right) \]
                                                                          11. *-lowering-*.f6436.7%

                                                                            \[\leadsto \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(\frac{-1}{4}, \mathsf{*.f64}\left(b, \mathsf{*.f64}\left(b, \color{blue}{\frac{1}{48}}\right)\right)\right)\right)\right) \]
                                                                        8. Simplified36.7%

                                                                          \[\leadsto \color{blue}{0.5 + b \cdot \left(-0.25 + b \cdot \left(b \cdot 0.020833333333333332\right)\right)} \]
                                                                        9. Taylor expanded in b around inf

                                                                          \[\leadsto \color{blue}{\frac{1}{48} \cdot {b}^{3}} \]
                                                                        10. Step-by-step derivation
                                                                          1. *-lowering-*.f64N/A

                                                                            \[\leadsto \mathsf{*.f64}\left(\frac{1}{48}, \color{blue}{\left({b}^{3}\right)}\right) \]
                                                                          2. cube-multN/A

                                                                            \[\leadsto \mathsf{*.f64}\left(\frac{1}{48}, \left(b \cdot \color{blue}{\left(b \cdot b\right)}\right)\right) \]
                                                                          3. unpow2N/A

                                                                            \[\leadsto \mathsf{*.f64}\left(\frac{1}{48}, \left(b \cdot {b}^{\color{blue}{2}}\right)\right) \]
                                                                          4. *-lowering-*.f64N/A

                                                                            \[\leadsto \mathsf{*.f64}\left(\frac{1}{48}, \mathsf{*.f64}\left(b, \color{blue}{\left({b}^{2}\right)}\right)\right) \]
                                                                          5. unpow2N/A

                                                                            \[\leadsto \mathsf{*.f64}\left(\frac{1}{48}, \mathsf{*.f64}\left(b, \left(b \cdot \color{blue}{b}\right)\right)\right) \]
                                                                          6. *-lowering-*.f6466.5%

                                                                            \[\leadsto \mathsf{*.f64}\left(\frac{1}{48}, \mathsf{*.f64}\left(b, \mathsf{*.f64}\left(b, \color{blue}{b}\right)\right)\right) \]
                                                                        11. Simplified66.5%

                                                                          \[\leadsto \color{blue}{0.020833333333333332 \cdot \left(b \cdot \left(b \cdot b\right)\right)} \]

                                                                        if -8.1000000000000003e-289 < b < 1.9199999999999999

                                                                        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. /-lowering-/.f64N/A

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

                                                                            \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \color{blue}{\left(e^{b}\right)}\right)\right) \]
                                                                          3. exp-lowering-exp.f6467.7%

                                                                            \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(b\right)\right)\right) \]
                                                                        5. Simplified67.7%

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

                                                                          \[\leadsto \color{blue}{\frac{1}{2} + \frac{-1}{4} \cdot b} \]
                                                                        7. Step-by-step derivation
                                                                          1. +-lowering-+.f64N/A

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

                                                                            \[\leadsto \mathsf{+.f64}\left(\frac{1}{2}, \left(b \cdot \color{blue}{\frac{-1}{4}}\right)\right) \]
                                                                          3. *-lowering-*.f6467.6%

                                                                            \[\leadsto \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(b, \color{blue}{\frac{-1}{4}}\right)\right) \]
                                                                        8. Simplified67.6%

                                                                          \[\leadsto \color{blue}{0.5 + b \cdot -0.25} \]

                                                                        if 1.9199999999999999 < b

                                                                        1. Initial program 98.5%

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

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

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

                                                                            \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \color{blue}{\left(e^{b}\right)}\right)\right) \]
                                                                          3. exp-lowering-exp.f64100.0%

                                                                            \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(b\right)\right)\right) \]
                                                                        5. Simplified100.0%

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

                                                                          \[\leadsto \mathsf{/.f64}\left(1, \color{blue}{\left(2 + b \cdot \left(1 + b \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot b\right)\right)\right)}\right) \]
                                                                        7. Step-by-step derivation
                                                                          1. +-lowering-+.f64N/A

                                                                            \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \color{blue}{\left(b \cdot \left(1 + b \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot b\right)\right)\right)}\right)\right) \]
                                                                          2. *-lowering-*.f64N/A

                                                                            \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \color{blue}{\left(1 + b \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot b\right)\right)}\right)\right)\right) \]
                                                                          3. +-lowering-+.f64N/A

                                                                            \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(1, \color{blue}{\left(b \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot b\right)\right)}\right)\right)\right)\right) \]
                                                                          4. *-lowering-*.f64N/A

                                                                            \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(b, \color{blue}{\left(\frac{1}{2} + \frac{1}{6} \cdot b\right)}\right)\right)\right)\right)\right) \]
                                                                          5. +-lowering-+.f64N/A

                                                                            \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(\frac{1}{2}, \color{blue}{\left(\frac{1}{6} \cdot b\right)}\right)\right)\right)\right)\right)\right) \]
                                                                          6. *-commutativeN/A

                                                                            \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(\frac{1}{2}, \left(b \cdot \color{blue}{\frac{1}{6}}\right)\right)\right)\right)\right)\right)\right) \]
                                                                          7. *-lowering-*.f6475.1%

                                                                            \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(b, \color{blue}{\frac{1}{6}}\right)\right)\right)\right)\right)\right)\right) \]
                                                                        8. Simplified75.1%

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

                                                                          \[\leadsto \color{blue}{\frac{6}{{b}^{3}}} \]
                                                                        10. Step-by-step derivation
                                                                          1. /-lowering-/.f64N/A

                                                                            \[\leadsto \mathsf{/.f64}\left(6, \color{blue}{\left({b}^{3}\right)}\right) \]
                                                                          2. cube-multN/A

                                                                            \[\leadsto \mathsf{/.f64}\left(6, \left(b \cdot \color{blue}{\left(b \cdot b\right)}\right)\right) \]
                                                                          3. unpow2N/A

                                                                            \[\leadsto \mathsf{/.f64}\left(6, \left(b \cdot {b}^{\color{blue}{2}}\right)\right) \]
                                                                          4. *-lowering-*.f64N/A

                                                                            \[\leadsto \mathsf{/.f64}\left(6, \mathsf{*.f64}\left(b, \color{blue}{\left({b}^{2}\right)}\right)\right) \]
                                                                          5. unpow2N/A

                                                                            \[\leadsto \mathsf{/.f64}\left(6, \mathsf{*.f64}\left(b, \left(b \cdot \color{blue}{b}\right)\right)\right) \]
                                                                          6. *-lowering-*.f6475.1%

                                                                            \[\leadsto \mathsf{/.f64}\left(6, \mathsf{*.f64}\left(b, \mathsf{*.f64}\left(b, \color{blue}{b}\right)\right)\right) \]
                                                                        11. Simplified75.1%

                                                                          \[\leadsto \color{blue}{\frac{6}{b \cdot \left(b \cdot b\right)}} \]
                                                                      5. Recombined 5 regimes into one program.
                                                                      6. Add Preprocessing

                                                                      Alternative 17: 68.8% accurate, 11.7× speedup?

                                                                      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq -6.5 \cdot 10^{-9}:\\ \;\;\;\;1\\ \mathbf{elif}\;b \leq -1.08 \cdot 10^{-203}:\\ \;\;\;\;0.5 + a \cdot 0.25\\ \mathbf{elif}\;b \leq -8 \cdot 10^{-289}:\\ \;\;\;\;0.020833333333333332 \cdot \left(b \cdot \left(b \cdot b\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{2 + b \cdot \left(\left(b \cdot b\right) \cdot 0.16666666666666666\right)}\\ \end{array} \end{array} \]
                                                                      (FPCore (a b)
                                                                       :precision binary64
                                                                       (if (<= b -6.5e-9)
                                                                         1.0
                                                                         (if (<= b -1.08e-203)
                                                                           (+ 0.5 (* a 0.25))
                                                                           (if (<= b -8e-289)
                                                                             (* 0.020833333333333332 (* b (* b b)))
                                                                             (/ 1.0 (+ 2.0 (* b (* (* b b) 0.16666666666666666))))))))
                                                                      double code(double a, double b) {
                                                                      	double tmp;
                                                                      	if (b <= -6.5e-9) {
                                                                      		tmp = 1.0;
                                                                      	} else if (b <= -1.08e-203) {
                                                                      		tmp = 0.5 + (a * 0.25);
                                                                      	} else if (b <= -8e-289) {
                                                                      		tmp = 0.020833333333333332 * (b * (b * b));
                                                                      	} else {
                                                                      		tmp = 1.0 / (2.0 + (b * ((b * b) * 0.16666666666666666)));
                                                                      	}
                                                                      	return tmp;
                                                                      }
                                                                      
                                                                      real(8) function code(a, b)
                                                                          real(8), intent (in) :: a
                                                                          real(8), intent (in) :: b
                                                                          real(8) :: tmp
                                                                          if (b <= (-6.5d-9)) then
                                                                              tmp = 1.0d0
                                                                          else if (b <= (-1.08d-203)) then
                                                                              tmp = 0.5d0 + (a * 0.25d0)
                                                                          else if (b <= (-8d-289)) then
                                                                              tmp = 0.020833333333333332d0 * (b * (b * b))
                                                                          else
                                                                              tmp = 1.0d0 / (2.0d0 + (b * ((b * b) * 0.16666666666666666d0)))
                                                                          end if
                                                                          code = tmp
                                                                      end function
                                                                      
                                                                      public static double code(double a, double b) {
                                                                      	double tmp;
                                                                      	if (b <= -6.5e-9) {
                                                                      		tmp = 1.0;
                                                                      	} else if (b <= -1.08e-203) {
                                                                      		tmp = 0.5 + (a * 0.25);
                                                                      	} else if (b <= -8e-289) {
                                                                      		tmp = 0.020833333333333332 * (b * (b * b));
                                                                      	} else {
                                                                      		tmp = 1.0 / (2.0 + (b * ((b * b) * 0.16666666666666666)));
                                                                      	}
                                                                      	return tmp;
                                                                      }
                                                                      
                                                                      def code(a, b):
                                                                      	tmp = 0
                                                                      	if b <= -6.5e-9:
                                                                      		tmp = 1.0
                                                                      	elif b <= -1.08e-203:
                                                                      		tmp = 0.5 + (a * 0.25)
                                                                      	elif b <= -8e-289:
                                                                      		tmp = 0.020833333333333332 * (b * (b * b))
                                                                      	else:
                                                                      		tmp = 1.0 / (2.0 + (b * ((b * b) * 0.16666666666666666)))
                                                                      	return tmp
                                                                      
                                                                      function code(a, b)
                                                                      	tmp = 0.0
                                                                      	if (b <= -6.5e-9)
                                                                      		tmp = 1.0;
                                                                      	elseif (b <= -1.08e-203)
                                                                      		tmp = Float64(0.5 + Float64(a * 0.25));
                                                                      	elseif (b <= -8e-289)
                                                                      		tmp = Float64(0.020833333333333332 * Float64(b * Float64(b * b)));
                                                                      	else
                                                                      		tmp = Float64(1.0 / Float64(2.0 + Float64(b * Float64(Float64(b * b) * 0.16666666666666666))));
                                                                      	end
                                                                      	return tmp
                                                                      end
                                                                      
                                                                      function tmp_2 = code(a, b)
                                                                      	tmp = 0.0;
                                                                      	if (b <= -6.5e-9)
                                                                      		tmp = 1.0;
                                                                      	elseif (b <= -1.08e-203)
                                                                      		tmp = 0.5 + (a * 0.25);
                                                                      	elseif (b <= -8e-289)
                                                                      		tmp = 0.020833333333333332 * (b * (b * b));
                                                                      	else
                                                                      		tmp = 1.0 / (2.0 + (b * ((b * b) * 0.16666666666666666)));
                                                                      	end
                                                                      	tmp_2 = tmp;
                                                                      end
                                                                      
                                                                      code[a_, b_] := If[LessEqual[b, -6.5e-9], 1.0, If[LessEqual[b, -1.08e-203], N[(0.5 + N[(a * 0.25), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, -8e-289], N[(0.020833333333333332 * N[(b * N[(b * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(2.0 + N[(b * N[(N[(b * b), $MachinePrecision] * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
                                                                      
                                                                      \begin{array}{l}
                                                                      
                                                                      \\
                                                                      \begin{array}{l}
                                                                      \mathbf{if}\;b \leq -6.5 \cdot 10^{-9}:\\
                                                                      \;\;\;\;1\\
                                                                      
                                                                      \mathbf{elif}\;b \leq -1.08 \cdot 10^{-203}:\\
                                                                      \;\;\;\;0.5 + a \cdot 0.25\\
                                                                      
                                                                      \mathbf{elif}\;b \leq -8 \cdot 10^{-289}:\\
                                                                      \;\;\;\;0.020833333333333332 \cdot \left(b \cdot \left(b \cdot b\right)\right)\\
                                                                      
                                                                      \mathbf{else}:\\
                                                                      \;\;\;\;\frac{1}{2 + b \cdot \left(\left(b \cdot b\right) \cdot 0.16666666666666666\right)}\\
                                                                      
                                                                      
                                                                      \end{array}
                                                                      \end{array}
                                                                      
                                                                      Derivation
                                                                      1. Split input into 4 regimes
                                                                      2. if b < -6.5000000000000003e-9

                                                                        1. Initial program 97.9%

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

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

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

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

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

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

                                                                            \[\leadsto \mathsf{exp.f64}\left(\left(\log \left(e^{a} + e^{b}\right) \cdot -1 + a\right)\right) \]
                                                                          7. +-lowering-+.f64N/A

                                                                            \[\leadsto \mathsf{exp.f64}\left(\mathsf{+.f64}\left(\left(\log \left(e^{a} + e^{b}\right) \cdot -1\right), a\right)\right) \]
                                                                          8. *-lowering-*.f64N/A

                                                                            \[\leadsto \mathsf{exp.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\log \left(e^{a} + e^{b}\right), -1\right), a\right)\right) \]
                                                                          9. log-lowering-log.f64N/A

                                                                            \[\leadsto \mathsf{exp.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{log.f64}\left(\left(e^{a} + e^{b}\right)\right), -1\right), a\right)\right) \]
                                                                          10. +-lowering-+.f64N/A

                                                                            \[\leadsto \mathsf{exp.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(\left(e^{a}\right), \left(e^{b}\right)\right)\right), -1\right), a\right)\right) \]
                                                                          11. exp-lowering-exp.f64N/A

                                                                            \[\leadsto \mathsf{exp.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(a\right), \left(e^{b}\right)\right)\right), -1\right), a\right)\right) \]
                                                                          12. exp-lowering-exp.f6498.0%

                                                                            \[\leadsto \mathsf{exp.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(a\right), \mathsf{exp.f64}\left(b\right)\right)\right), -1\right), a\right)\right) \]
                                                                        4. Applied egg-rr98.0%

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

                                                                          \[\leadsto \mathsf{exp.f64}\left(\color{blue}{a}\right) \]
                                                                        6. Step-by-step derivation
                                                                          1. Simplified97.7%

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

                                                                            \[\leadsto \color{blue}{1} \]
                                                                          3. Step-by-step derivation
                                                                            1. Simplified98.0%

                                                                              \[\leadsto \color{blue}{1} \]

                                                                            if -6.5000000000000003e-9 < b < -1.07999999999999997e-203

                                                                            1. Initial program 100.0%

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

                                                                              \[\leadsto \mathsf{/.f64}\left(\mathsf{exp.f64}\left(a\right), \mathsf{+.f64}\left(\mathsf{exp.f64}\left(a\right), \color{blue}{1}\right)\right) \]
                                                                            4. Step-by-step derivation
                                                                              1. Simplified100.0%

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

                                                                                \[\leadsto \color{blue}{\frac{1}{2} + \frac{1}{4} \cdot a} \]
                                                                              3. Step-by-step derivation
                                                                                1. +-lowering-+.f64N/A

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

                                                                                  \[\leadsto \mathsf{+.f64}\left(\frac{1}{2}, \left(a \cdot \color{blue}{\frac{1}{4}}\right)\right) \]
                                                                                3. *-lowering-*.f6454.8%

                                                                                  \[\leadsto \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(a, \color{blue}{\frac{1}{4}}\right)\right) \]
                                                                              4. Simplified54.8%

                                                                                \[\leadsto \color{blue}{0.5 + a \cdot 0.25} \]

                                                                              if -1.07999999999999997e-203 < b < -8.0000000000000001e-289

                                                                              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. /-lowering-/.f64N/A

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

                                                                                  \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \color{blue}{\left(e^{b}\right)}\right)\right) \]
                                                                                3. exp-lowering-exp.f6436.7%

                                                                                  \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(b\right)\right)\right) \]
                                                                              5. Simplified36.7%

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

                                                                                \[\leadsto \color{blue}{\frac{1}{2} + b \cdot \left(\frac{1}{48} \cdot {b}^{2} - \frac{1}{4}\right)} \]
                                                                              7. Step-by-step derivation
                                                                                1. +-lowering-+.f64N/A

                                                                                  \[\leadsto \mathsf{+.f64}\left(\frac{1}{2}, \color{blue}{\left(b \cdot \left(\frac{1}{48} \cdot {b}^{2} - \frac{1}{4}\right)\right)}\right) \]
                                                                                2. *-lowering-*.f64N/A

                                                                                  \[\leadsto \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(b, \color{blue}{\left(\frac{1}{48} \cdot {b}^{2} - \frac{1}{4}\right)}\right)\right) \]
                                                                                3. sub-negN/A

                                                                                  \[\leadsto \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(b, \left(\frac{1}{48} \cdot {b}^{2} + \color{blue}{\left(\mathsf{neg}\left(\frac{1}{4}\right)\right)}\right)\right)\right) \]
                                                                                4. metadata-evalN/A

                                                                                  \[\leadsto \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(b, \left(\frac{1}{48} \cdot {b}^{2} + \frac{-1}{4}\right)\right)\right) \]
                                                                                5. +-commutativeN/A

                                                                                  \[\leadsto \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(b, \left(\frac{-1}{4} + \color{blue}{\frac{1}{48} \cdot {b}^{2}}\right)\right)\right) \]
                                                                                6. +-lowering-+.f64N/A

                                                                                  \[\leadsto \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(\frac{-1}{4}, \color{blue}{\left(\frac{1}{48} \cdot {b}^{2}\right)}\right)\right)\right) \]
                                                                                7. *-commutativeN/A

                                                                                  \[\leadsto \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(\frac{-1}{4}, \left({b}^{2} \cdot \color{blue}{\frac{1}{48}}\right)\right)\right)\right) \]
                                                                                8. unpow2N/A

                                                                                  \[\leadsto \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(\frac{-1}{4}, \left(\left(b \cdot b\right) \cdot \frac{1}{48}\right)\right)\right)\right) \]
                                                                                9. associate-*l*N/A

                                                                                  \[\leadsto \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(\frac{-1}{4}, \left(b \cdot \color{blue}{\left(b \cdot \frac{1}{48}\right)}\right)\right)\right)\right) \]
                                                                                10. *-lowering-*.f64N/A

                                                                                  \[\leadsto \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(\frac{-1}{4}, \mathsf{*.f64}\left(b, \color{blue}{\left(b \cdot \frac{1}{48}\right)}\right)\right)\right)\right) \]
                                                                                11. *-lowering-*.f6436.7%

                                                                                  \[\leadsto \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(\frac{-1}{4}, \mathsf{*.f64}\left(b, \mathsf{*.f64}\left(b, \color{blue}{\frac{1}{48}}\right)\right)\right)\right)\right) \]
                                                                              8. Simplified36.7%

                                                                                \[\leadsto \color{blue}{0.5 + b \cdot \left(-0.25 + b \cdot \left(b \cdot 0.020833333333333332\right)\right)} \]
                                                                              9. Taylor expanded in b around inf

                                                                                \[\leadsto \color{blue}{\frac{1}{48} \cdot {b}^{3}} \]
                                                                              10. Step-by-step derivation
                                                                                1. *-lowering-*.f64N/A

                                                                                  \[\leadsto \mathsf{*.f64}\left(\frac{1}{48}, \color{blue}{\left({b}^{3}\right)}\right) \]
                                                                                2. cube-multN/A

                                                                                  \[\leadsto \mathsf{*.f64}\left(\frac{1}{48}, \left(b \cdot \color{blue}{\left(b \cdot b\right)}\right)\right) \]
                                                                                3. unpow2N/A

                                                                                  \[\leadsto \mathsf{*.f64}\left(\frac{1}{48}, \left(b \cdot {b}^{\color{blue}{2}}\right)\right) \]
                                                                                4. *-lowering-*.f64N/A

                                                                                  \[\leadsto \mathsf{*.f64}\left(\frac{1}{48}, \mathsf{*.f64}\left(b, \color{blue}{\left({b}^{2}\right)}\right)\right) \]
                                                                                5. unpow2N/A

                                                                                  \[\leadsto \mathsf{*.f64}\left(\frac{1}{48}, \mathsf{*.f64}\left(b, \left(b \cdot \color{blue}{b}\right)\right)\right) \]
                                                                                6. *-lowering-*.f6466.5%

                                                                                  \[\leadsto \mathsf{*.f64}\left(\frac{1}{48}, \mathsf{*.f64}\left(b, \mathsf{*.f64}\left(b, \color{blue}{b}\right)\right)\right) \]
                                                                              11. Simplified66.5%

                                                                                \[\leadsto \color{blue}{0.020833333333333332 \cdot \left(b \cdot \left(b \cdot b\right)\right)} \]

                                                                              if -8.0000000000000001e-289 < b

                                                                              1. Initial program 99.3%

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

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

                                                                                  \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \color{blue}{\left(e^{b}\right)}\right)\right) \]
                                                                                3. exp-lowering-exp.f6482.8%

                                                                                  \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(b\right)\right)\right) \]
                                                                              5. Simplified82.8%

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

                                                                                \[\leadsto \mathsf{/.f64}\left(1, \color{blue}{\left(2 + b \cdot \left(1 + b \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot b\right)\right)\right)}\right) \]
                                                                              7. Step-by-step derivation
                                                                                1. +-lowering-+.f64N/A

                                                                                  \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \color{blue}{\left(b \cdot \left(1 + b \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot b\right)\right)\right)}\right)\right) \]
                                                                                2. *-lowering-*.f64N/A

                                                                                  \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \color{blue}{\left(1 + b \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot b\right)\right)}\right)\right)\right) \]
                                                                                3. +-lowering-+.f64N/A

                                                                                  \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(1, \color{blue}{\left(b \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot b\right)\right)}\right)\right)\right)\right) \]
                                                                                4. *-lowering-*.f64N/A

                                                                                  \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(b, \color{blue}{\left(\frac{1}{2} + \frac{1}{6} \cdot b\right)}\right)\right)\right)\right)\right) \]
                                                                                5. +-lowering-+.f64N/A

                                                                                  \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(\frac{1}{2}, \color{blue}{\left(\frac{1}{6} \cdot b\right)}\right)\right)\right)\right)\right)\right) \]
                                                                                6. *-commutativeN/A

                                                                                  \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(\frac{1}{2}, \left(b \cdot \color{blue}{\frac{1}{6}}\right)\right)\right)\right)\right)\right)\right) \]
                                                                                7. *-lowering-*.f6471.2%

                                                                                  \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(b, \color{blue}{\frac{1}{6}}\right)\right)\right)\right)\right)\right)\right) \]
                                                                              8. Simplified71.2%

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

                                                                                \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \color{blue}{\left(\frac{1}{6} \cdot {b}^{2}\right)}\right)\right)\right) \]
                                                                              10. Step-by-step derivation
                                                                                1. *-lowering-*.f64N/A

                                                                                  \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{*.f64}\left(\frac{1}{6}, \color{blue}{\left({b}^{2}\right)}\right)\right)\right)\right) \]
                                                                                2. unpow2N/A

                                                                                  \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{*.f64}\left(\frac{1}{6}, \left(b \cdot \color{blue}{b}\right)\right)\right)\right)\right) \]
                                                                                3. *-lowering-*.f6470.8%

                                                                                  \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(b, \mathsf{*.f64}\left(\frac{1}{6}, \mathsf{*.f64}\left(b, \color{blue}{b}\right)\right)\right)\right)\right) \]
                                                                              11. Simplified70.8%

                                                                                \[\leadsto \frac{1}{2 + b \cdot \color{blue}{\left(0.16666666666666666 \cdot \left(b \cdot b\right)\right)}} \]
                                                                            5. Recombined 4 regimes into one program.
                                                                            6. Final simplification73.0%

                                                                              \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -6.5 \cdot 10^{-9}:\\ \;\;\;\;1\\ \mathbf{elif}\;b \leq -1.08 \cdot 10^{-203}:\\ \;\;\;\;0.5 + a \cdot 0.25\\ \mathbf{elif}\;b \leq -8 \cdot 10^{-289}:\\ \;\;\;\;0.020833333333333332 \cdot \left(b \cdot \left(b \cdot b\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{2 + b \cdot \left(\left(b \cdot b\right) \cdot 0.16666666666666666\right)}\\ \end{array} \]
                                                                            7. Add Preprocessing

                                                                            Alternative 18: 52.3% accurate, 13.8× speedup?

                                                                            \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq -6.5 \cdot 10^{-9}:\\ \;\;\;\;1\\ \mathbf{elif}\;b \leq -9.6 \cdot 10^{-204}:\\ \;\;\;\;0.5 + a \cdot 0.25\\ \mathbf{elif}\;b \leq -8.1 \cdot 10^{-289}:\\ \;\;\;\;0.020833333333333332 \cdot \left(b \cdot \left(b \cdot b\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{b + 2}\\ \end{array} \end{array} \]
                                                                            (FPCore (a b)
                                                                             :precision binary64
                                                                             (if (<= b -6.5e-9)
                                                                               1.0
                                                                               (if (<= b -9.6e-204)
                                                                                 (+ 0.5 (* a 0.25))
                                                                                 (if (<= b -8.1e-289)
                                                                                   (* 0.020833333333333332 (* b (* b b)))
                                                                                   (/ 1.0 (+ b 2.0))))))
                                                                            double code(double a, double b) {
                                                                            	double tmp;
                                                                            	if (b <= -6.5e-9) {
                                                                            		tmp = 1.0;
                                                                            	} else if (b <= -9.6e-204) {
                                                                            		tmp = 0.5 + (a * 0.25);
                                                                            	} else if (b <= -8.1e-289) {
                                                                            		tmp = 0.020833333333333332 * (b * (b * b));
                                                                            	} else {
                                                                            		tmp = 1.0 / (b + 2.0);
                                                                            	}
                                                                            	return tmp;
                                                                            }
                                                                            
                                                                            real(8) function code(a, b)
                                                                                real(8), intent (in) :: a
                                                                                real(8), intent (in) :: b
                                                                                real(8) :: tmp
                                                                                if (b <= (-6.5d-9)) then
                                                                                    tmp = 1.0d0
                                                                                else if (b <= (-9.6d-204)) then
                                                                                    tmp = 0.5d0 + (a * 0.25d0)
                                                                                else if (b <= (-8.1d-289)) then
                                                                                    tmp = 0.020833333333333332d0 * (b * (b * b))
                                                                                else
                                                                                    tmp = 1.0d0 / (b + 2.0d0)
                                                                                end if
                                                                                code = tmp
                                                                            end function
                                                                            
                                                                            public static double code(double a, double b) {
                                                                            	double tmp;
                                                                            	if (b <= -6.5e-9) {
                                                                            		tmp = 1.0;
                                                                            	} else if (b <= -9.6e-204) {
                                                                            		tmp = 0.5 + (a * 0.25);
                                                                            	} else if (b <= -8.1e-289) {
                                                                            		tmp = 0.020833333333333332 * (b * (b * b));
                                                                            	} else {
                                                                            		tmp = 1.0 / (b + 2.0);
                                                                            	}
                                                                            	return tmp;
                                                                            }
                                                                            
                                                                            def code(a, b):
                                                                            	tmp = 0
                                                                            	if b <= -6.5e-9:
                                                                            		tmp = 1.0
                                                                            	elif b <= -9.6e-204:
                                                                            		tmp = 0.5 + (a * 0.25)
                                                                            	elif b <= -8.1e-289:
                                                                            		tmp = 0.020833333333333332 * (b * (b * b))
                                                                            	else:
                                                                            		tmp = 1.0 / (b + 2.0)
                                                                            	return tmp
                                                                            
                                                                            function code(a, b)
                                                                            	tmp = 0.0
                                                                            	if (b <= -6.5e-9)
                                                                            		tmp = 1.0;
                                                                            	elseif (b <= -9.6e-204)
                                                                            		tmp = Float64(0.5 + Float64(a * 0.25));
                                                                            	elseif (b <= -8.1e-289)
                                                                            		tmp = Float64(0.020833333333333332 * Float64(b * Float64(b * b)));
                                                                            	else
                                                                            		tmp = Float64(1.0 / Float64(b + 2.0));
                                                                            	end
                                                                            	return tmp
                                                                            end
                                                                            
                                                                            function tmp_2 = code(a, b)
                                                                            	tmp = 0.0;
                                                                            	if (b <= -6.5e-9)
                                                                            		tmp = 1.0;
                                                                            	elseif (b <= -9.6e-204)
                                                                            		tmp = 0.5 + (a * 0.25);
                                                                            	elseif (b <= -8.1e-289)
                                                                            		tmp = 0.020833333333333332 * (b * (b * b));
                                                                            	else
                                                                            		tmp = 1.0 / (b + 2.0);
                                                                            	end
                                                                            	tmp_2 = tmp;
                                                                            end
                                                                            
                                                                            code[a_, b_] := If[LessEqual[b, -6.5e-9], 1.0, If[LessEqual[b, -9.6e-204], N[(0.5 + N[(a * 0.25), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, -8.1e-289], N[(0.020833333333333332 * N[(b * N[(b * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(b + 2.0), $MachinePrecision]), $MachinePrecision]]]]
                                                                            
                                                                            \begin{array}{l}
                                                                            
                                                                            \\
                                                                            \begin{array}{l}
                                                                            \mathbf{if}\;b \leq -6.5 \cdot 10^{-9}:\\
                                                                            \;\;\;\;1\\
                                                                            
                                                                            \mathbf{elif}\;b \leq -9.6 \cdot 10^{-204}:\\
                                                                            \;\;\;\;0.5 + a \cdot 0.25\\
                                                                            
                                                                            \mathbf{elif}\;b \leq -8.1 \cdot 10^{-289}:\\
                                                                            \;\;\;\;0.020833333333333332 \cdot \left(b \cdot \left(b \cdot b\right)\right)\\
                                                                            
                                                                            \mathbf{else}:\\
                                                                            \;\;\;\;\frac{1}{b + 2}\\
                                                                            
                                                                            
                                                                            \end{array}
                                                                            \end{array}
                                                                            
                                                                            Derivation
                                                                            1. Split input into 4 regimes
                                                                            2. if b < -6.5000000000000003e-9

                                                                              1. Initial program 97.9%

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

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

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

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

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

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

                                                                                  \[\leadsto \mathsf{exp.f64}\left(\left(\log \left(e^{a} + e^{b}\right) \cdot -1 + a\right)\right) \]
                                                                                7. +-lowering-+.f64N/A

                                                                                  \[\leadsto \mathsf{exp.f64}\left(\mathsf{+.f64}\left(\left(\log \left(e^{a} + e^{b}\right) \cdot -1\right), a\right)\right) \]
                                                                                8. *-lowering-*.f64N/A

                                                                                  \[\leadsto \mathsf{exp.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\log \left(e^{a} + e^{b}\right), -1\right), a\right)\right) \]
                                                                                9. log-lowering-log.f64N/A

                                                                                  \[\leadsto \mathsf{exp.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{log.f64}\left(\left(e^{a} + e^{b}\right)\right), -1\right), a\right)\right) \]
                                                                                10. +-lowering-+.f64N/A

                                                                                  \[\leadsto \mathsf{exp.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(\left(e^{a}\right), \left(e^{b}\right)\right)\right), -1\right), a\right)\right) \]
                                                                                11. exp-lowering-exp.f64N/A

                                                                                  \[\leadsto \mathsf{exp.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(a\right), \left(e^{b}\right)\right)\right), -1\right), a\right)\right) \]
                                                                                12. exp-lowering-exp.f6498.0%

                                                                                  \[\leadsto \mathsf{exp.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(a\right), \mathsf{exp.f64}\left(b\right)\right)\right), -1\right), a\right)\right) \]
                                                                              4. Applied egg-rr98.0%

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

                                                                                \[\leadsto \mathsf{exp.f64}\left(\color{blue}{a}\right) \]
                                                                              6. Step-by-step derivation
                                                                                1. Simplified97.7%

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

                                                                                  \[\leadsto \color{blue}{1} \]
                                                                                3. Step-by-step derivation
                                                                                  1. Simplified98.0%

                                                                                    \[\leadsto \color{blue}{1} \]

                                                                                  if -6.5000000000000003e-9 < b < -9.6e-204

                                                                                  1. Initial program 100.0%

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

                                                                                    \[\leadsto \mathsf{/.f64}\left(\mathsf{exp.f64}\left(a\right), \mathsf{+.f64}\left(\mathsf{exp.f64}\left(a\right), \color{blue}{1}\right)\right) \]
                                                                                  4. Step-by-step derivation
                                                                                    1. Simplified100.0%

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

                                                                                      \[\leadsto \color{blue}{\frac{1}{2} + \frac{1}{4} \cdot a} \]
                                                                                    3. Step-by-step derivation
                                                                                      1. +-lowering-+.f64N/A

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

                                                                                        \[\leadsto \mathsf{+.f64}\left(\frac{1}{2}, \left(a \cdot \color{blue}{\frac{1}{4}}\right)\right) \]
                                                                                      3. *-lowering-*.f6454.8%

                                                                                        \[\leadsto \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(a, \color{blue}{\frac{1}{4}}\right)\right) \]
                                                                                    4. Simplified54.8%

                                                                                      \[\leadsto \color{blue}{0.5 + a \cdot 0.25} \]

                                                                                    if -9.6e-204 < b < -8.1000000000000003e-289

                                                                                    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. /-lowering-/.f64N/A

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

                                                                                        \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \color{blue}{\left(e^{b}\right)}\right)\right) \]
                                                                                      3. exp-lowering-exp.f6436.7%

                                                                                        \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(b\right)\right)\right) \]
                                                                                    5. Simplified36.7%

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

                                                                                      \[\leadsto \color{blue}{\frac{1}{2} + b \cdot \left(\frac{1}{48} \cdot {b}^{2} - \frac{1}{4}\right)} \]
                                                                                    7. Step-by-step derivation
                                                                                      1. +-lowering-+.f64N/A

                                                                                        \[\leadsto \mathsf{+.f64}\left(\frac{1}{2}, \color{blue}{\left(b \cdot \left(\frac{1}{48} \cdot {b}^{2} - \frac{1}{4}\right)\right)}\right) \]
                                                                                      2. *-lowering-*.f64N/A

                                                                                        \[\leadsto \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(b, \color{blue}{\left(\frac{1}{48} \cdot {b}^{2} - \frac{1}{4}\right)}\right)\right) \]
                                                                                      3. sub-negN/A

                                                                                        \[\leadsto \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(b, \left(\frac{1}{48} \cdot {b}^{2} + \color{blue}{\left(\mathsf{neg}\left(\frac{1}{4}\right)\right)}\right)\right)\right) \]
                                                                                      4. metadata-evalN/A

                                                                                        \[\leadsto \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(b, \left(\frac{1}{48} \cdot {b}^{2} + \frac{-1}{4}\right)\right)\right) \]
                                                                                      5. +-commutativeN/A

                                                                                        \[\leadsto \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(b, \left(\frac{-1}{4} + \color{blue}{\frac{1}{48} \cdot {b}^{2}}\right)\right)\right) \]
                                                                                      6. +-lowering-+.f64N/A

                                                                                        \[\leadsto \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(\frac{-1}{4}, \color{blue}{\left(\frac{1}{48} \cdot {b}^{2}\right)}\right)\right)\right) \]
                                                                                      7. *-commutativeN/A

                                                                                        \[\leadsto \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(\frac{-1}{4}, \left({b}^{2} \cdot \color{blue}{\frac{1}{48}}\right)\right)\right)\right) \]
                                                                                      8. unpow2N/A

                                                                                        \[\leadsto \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(\frac{-1}{4}, \left(\left(b \cdot b\right) \cdot \frac{1}{48}\right)\right)\right)\right) \]
                                                                                      9. associate-*l*N/A

                                                                                        \[\leadsto \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(\frac{-1}{4}, \left(b \cdot \color{blue}{\left(b \cdot \frac{1}{48}\right)}\right)\right)\right)\right) \]
                                                                                      10. *-lowering-*.f64N/A

                                                                                        \[\leadsto \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(\frac{-1}{4}, \mathsf{*.f64}\left(b, \color{blue}{\left(b \cdot \frac{1}{48}\right)}\right)\right)\right)\right) \]
                                                                                      11. *-lowering-*.f6436.7%

                                                                                        \[\leadsto \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(b, \mathsf{+.f64}\left(\frac{-1}{4}, \mathsf{*.f64}\left(b, \mathsf{*.f64}\left(b, \color{blue}{\frac{1}{48}}\right)\right)\right)\right)\right) \]
                                                                                    8. Simplified36.7%

                                                                                      \[\leadsto \color{blue}{0.5 + b \cdot \left(-0.25 + b \cdot \left(b \cdot 0.020833333333333332\right)\right)} \]
                                                                                    9. Taylor expanded in b around inf

                                                                                      \[\leadsto \color{blue}{\frac{1}{48} \cdot {b}^{3}} \]
                                                                                    10. Step-by-step derivation
                                                                                      1. *-lowering-*.f64N/A

                                                                                        \[\leadsto \mathsf{*.f64}\left(\frac{1}{48}, \color{blue}{\left({b}^{3}\right)}\right) \]
                                                                                      2. cube-multN/A

                                                                                        \[\leadsto \mathsf{*.f64}\left(\frac{1}{48}, \left(b \cdot \color{blue}{\left(b \cdot b\right)}\right)\right) \]
                                                                                      3. unpow2N/A

                                                                                        \[\leadsto \mathsf{*.f64}\left(\frac{1}{48}, \left(b \cdot {b}^{\color{blue}{2}}\right)\right) \]
                                                                                      4. *-lowering-*.f64N/A

                                                                                        \[\leadsto \mathsf{*.f64}\left(\frac{1}{48}, \mathsf{*.f64}\left(b, \color{blue}{\left({b}^{2}\right)}\right)\right) \]
                                                                                      5. unpow2N/A

                                                                                        \[\leadsto \mathsf{*.f64}\left(\frac{1}{48}, \mathsf{*.f64}\left(b, \left(b \cdot \color{blue}{b}\right)\right)\right) \]
                                                                                      6. *-lowering-*.f6466.5%

                                                                                        \[\leadsto \mathsf{*.f64}\left(\frac{1}{48}, \mathsf{*.f64}\left(b, \mathsf{*.f64}\left(b, \color{blue}{b}\right)\right)\right) \]
                                                                                    11. Simplified66.5%

                                                                                      \[\leadsto \color{blue}{0.020833333333333332 \cdot \left(b \cdot \left(b \cdot b\right)\right)} \]

                                                                                    if -8.1000000000000003e-289 < b

                                                                                    1. Initial program 99.3%

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

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

                                                                                        \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \color{blue}{\left(e^{b}\right)}\right)\right) \]
                                                                                      3. exp-lowering-exp.f6482.8%

                                                                                        \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(b\right)\right)\right) \]
                                                                                    5. Simplified82.8%

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

                                                                                      \[\leadsto \mathsf{/.f64}\left(1, \color{blue}{\left(2 + b\right)}\right) \]
                                                                                    7. Step-by-step derivation
                                                                                      1. +-commutativeN/A

                                                                                        \[\leadsto \mathsf{/.f64}\left(1, \left(b + \color{blue}{2}\right)\right) \]
                                                                                      2. +-lowering-+.f6438.6%

                                                                                        \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(b, \color{blue}{2}\right)\right) \]
                                                                                    8. Simplified38.6%

                                                                                      \[\leadsto \frac{1}{\color{blue}{b + 2}} \]
                                                                                  5. Recombined 4 regimes into one program.
                                                                                  6. Add Preprocessing

                                                                                  Alternative 19: 54.8% accurate, 30.5× speedup?

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

                                                                                    1. Initial program 97.9%

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

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

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

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

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

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

                                                                                        \[\leadsto \mathsf{exp.f64}\left(\left(\log \left(e^{a} + e^{b}\right) \cdot -1 + a\right)\right) \]
                                                                                      7. +-lowering-+.f64N/A

                                                                                        \[\leadsto \mathsf{exp.f64}\left(\mathsf{+.f64}\left(\left(\log \left(e^{a} + e^{b}\right) \cdot -1\right), a\right)\right) \]
                                                                                      8. *-lowering-*.f64N/A

                                                                                        \[\leadsto \mathsf{exp.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\log \left(e^{a} + e^{b}\right), -1\right), a\right)\right) \]
                                                                                      9. log-lowering-log.f64N/A

                                                                                        \[\leadsto \mathsf{exp.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{log.f64}\left(\left(e^{a} + e^{b}\right)\right), -1\right), a\right)\right) \]
                                                                                      10. +-lowering-+.f64N/A

                                                                                        \[\leadsto \mathsf{exp.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(\left(e^{a}\right), \left(e^{b}\right)\right)\right), -1\right), a\right)\right) \]
                                                                                      11. exp-lowering-exp.f64N/A

                                                                                        \[\leadsto \mathsf{exp.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(a\right), \left(e^{b}\right)\right)\right), -1\right), a\right)\right) \]
                                                                                      12. exp-lowering-exp.f6497.9%

                                                                                        \[\leadsto \mathsf{exp.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(a\right), \mathsf{exp.f64}\left(b\right)\right)\right), -1\right), a\right)\right) \]
                                                                                    4. Applied egg-rr97.9%

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

                                                                                      \[\leadsto \mathsf{exp.f64}\left(\color{blue}{a}\right) \]
                                                                                    6. Step-by-step derivation
                                                                                      1. Simplified97.6%

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

                                                                                        \[\leadsto \color{blue}{1} \]
                                                                                      3. Step-by-step derivation
                                                                                        1. Simplified100.0%

                                                                                          \[\leadsto \color{blue}{1} \]

                                                                                        if -1 < b

                                                                                        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. /-lowering-/.f64N/A

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

                                                                                            \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \color{blue}{\left(e^{b}\right)}\right)\right) \]
                                                                                          3. exp-lowering-exp.f6471.4%

                                                                                            \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(b\right)\right)\right) \]
                                                                                        5. Simplified71.4%

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

                                                                                          \[\leadsto \mathsf{/.f64}\left(1, \color{blue}{\left(2 + b\right)}\right) \]
                                                                                        7. Step-by-step derivation
                                                                                          1. +-commutativeN/A

                                                                                            \[\leadsto \mathsf{/.f64}\left(1, \left(b + \color{blue}{2}\right)\right) \]
                                                                                          2. +-lowering-+.f6441.1%

                                                                                            \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(b, \color{blue}{2}\right)\right) \]
                                                                                        8. Simplified41.1%

                                                                                          \[\leadsto \frac{1}{\color{blue}{b + 2}} \]
                                                                                      4. Recombined 2 regimes into one program.
                                                                                      5. Add Preprocessing

                                                                                      Alternative 20: 53.8% accurate, 50.7× speedup?

                                                                                      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq -1.1:\\ \;\;\;\;1\\ \mathbf{else}:\\ \;\;\;\;0.5\\ \end{array} \end{array} \]
                                                                                      (FPCore (a b) :precision binary64 (if (<= b -1.1) 1.0 0.5))
                                                                                      double code(double a, double b) {
                                                                                      	double tmp;
                                                                                      	if (b <= -1.1) {
                                                                                      		tmp = 1.0;
                                                                                      	} else {
                                                                                      		tmp = 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 <= (-1.1d0)) then
                                                                                              tmp = 1.0d0
                                                                                          else
                                                                                              tmp = 0.5d0
                                                                                          end if
                                                                                          code = tmp
                                                                                      end function
                                                                                      
                                                                                      public static double code(double a, double b) {
                                                                                      	double tmp;
                                                                                      	if (b <= -1.1) {
                                                                                      		tmp = 1.0;
                                                                                      	} else {
                                                                                      		tmp = 0.5;
                                                                                      	}
                                                                                      	return tmp;
                                                                                      }
                                                                                      
                                                                                      def code(a, b):
                                                                                      	tmp = 0
                                                                                      	if b <= -1.1:
                                                                                      		tmp = 1.0
                                                                                      	else:
                                                                                      		tmp = 0.5
                                                                                      	return tmp
                                                                                      
                                                                                      function code(a, b)
                                                                                      	tmp = 0.0
                                                                                      	if (b <= -1.1)
                                                                                      		tmp = 1.0;
                                                                                      	else
                                                                                      		tmp = 0.5;
                                                                                      	end
                                                                                      	return tmp
                                                                                      end
                                                                                      
                                                                                      function tmp_2 = code(a, b)
                                                                                      	tmp = 0.0;
                                                                                      	if (b <= -1.1)
                                                                                      		tmp = 1.0;
                                                                                      	else
                                                                                      		tmp = 0.5;
                                                                                      	end
                                                                                      	tmp_2 = tmp;
                                                                                      end
                                                                                      
                                                                                      code[a_, b_] := If[LessEqual[b, -1.1], 1.0, 0.5]
                                                                                      
                                                                                      \begin{array}{l}
                                                                                      
                                                                                      \\
                                                                                      \begin{array}{l}
                                                                                      \mathbf{if}\;b \leq -1.1:\\
                                                                                      \;\;\;\;1\\
                                                                                      
                                                                                      \mathbf{else}:\\
                                                                                      \;\;\;\;0.5\\
                                                                                      
                                                                                      
                                                                                      \end{array}
                                                                                      \end{array}
                                                                                      
                                                                                      Derivation
                                                                                      1. Split input into 2 regimes
                                                                                      2. if b < -1.1000000000000001

                                                                                        1. Initial program 97.9%

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

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

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

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

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

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

                                                                                            \[\leadsto \mathsf{exp.f64}\left(\left(\log \left(e^{a} + e^{b}\right) \cdot -1 + a\right)\right) \]
                                                                                          7. +-lowering-+.f64N/A

                                                                                            \[\leadsto \mathsf{exp.f64}\left(\mathsf{+.f64}\left(\left(\log \left(e^{a} + e^{b}\right) \cdot -1\right), a\right)\right) \]
                                                                                          8. *-lowering-*.f64N/A

                                                                                            \[\leadsto \mathsf{exp.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\log \left(e^{a} + e^{b}\right), -1\right), a\right)\right) \]
                                                                                          9. log-lowering-log.f64N/A

                                                                                            \[\leadsto \mathsf{exp.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{log.f64}\left(\left(e^{a} + e^{b}\right)\right), -1\right), a\right)\right) \]
                                                                                          10. +-lowering-+.f64N/A

                                                                                            \[\leadsto \mathsf{exp.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(\left(e^{a}\right), \left(e^{b}\right)\right)\right), -1\right), a\right)\right) \]
                                                                                          11. exp-lowering-exp.f64N/A

                                                                                            \[\leadsto \mathsf{exp.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(a\right), \left(e^{b}\right)\right)\right), -1\right), a\right)\right) \]
                                                                                          12. exp-lowering-exp.f6497.9%

                                                                                            \[\leadsto \mathsf{exp.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{log.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(a\right), \mathsf{exp.f64}\left(b\right)\right)\right), -1\right), a\right)\right) \]
                                                                                        4. Applied egg-rr97.9%

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

                                                                                          \[\leadsto \mathsf{exp.f64}\left(\color{blue}{a}\right) \]
                                                                                        6. Step-by-step derivation
                                                                                          1. Simplified97.6%

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

                                                                                            \[\leadsto \color{blue}{1} \]
                                                                                          3. Step-by-step derivation
                                                                                            1. Simplified100.0%

                                                                                              \[\leadsto \color{blue}{1} \]

                                                                                            if -1.1000000000000001 < b

                                                                                            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. /-lowering-/.f64N/A

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

                                                                                                \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \color{blue}{\left(e^{b}\right)}\right)\right) \]
                                                                                              3. exp-lowering-exp.f6471.4%

                                                                                                \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(b\right)\right)\right) \]
                                                                                            5. Simplified71.4%

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

                                                                                              \[\leadsto \color{blue}{\frac{1}{2}} \]
                                                                                            7. Step-by-step derivation
                                                                                              1. Simplified40.0%

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

                                                                                            Alternative 21: 38.8% accurate, 305.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.2%

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

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

                                                                                                \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \color{blue}{\left(e^{b}\right)}\right)\right) \]
                                                                                              3. exp-lowering-exp.f6476.6%

                                                                                                \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(b\right)\right)\right) \]
                                                                                            5. Simplified76.6%

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

                                                                                              \[\leadsto \color{blue}{\frac{1}{2}} \]
                                                                                            7. Step-by-step derivation
                                                                                              1. Simplified36.1%

                                                                                                \[\leadsto \color{blue}{0.5} \]
                                                                                              2. Add Preprocessing

                                                                                              Developer Target 1: 100.0% accurate, 2.9× 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 2024152 
                                                                                              (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))))