Quotient of sum of exps

Percentage Accurate: 98.9% → 99.2%
Time: 8.7s
Alternatives: 17
Speedup: 1.3×

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 17 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.2% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := a \cdot \left(1 + a \cdot \left(0.5 + a \cdot 0.16666666666666666\right)\right)\\ \mathbf{if}\;e^{a} \leq 0.9999:\\ \;\;\;\;\frac{e^{a}}{e^{a} + 1}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 + t\_0}{t\_0 + \left(e^{b} + 1\right)}\\ \end{array} \end{array} \]
(FPCore (a b)
 :precision binary64
 (let* ((t_0 (* a (+ 1.0 (* a (+ 0.5 (* a 0.16666666666666666)))))))
   (if (<= (exp a) 0.9999)
     (/ (exp a) (+ (exp a) 1.0))
     (/ (+ 1.0 t_0) (+ t_0 (+ (exp b) 1.0))))))
double code(double a, double b) {
	double t_0 = a * (1.0 + (a * (0.5 + (a * 0.16666666666666666))));
	double tmp;
	if (exp(a) <= 0.9999) {
		tmp = exp(a) / (exp(a) + 1.0);
	} else {
		tmp = (1.0 + t_0) / (t_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) :: t_0
    real(8) :: tmp
    t_0 = a * (1.0d0 + (a * (0.5d0 + (a * 0.16666666666666666d0))))
    if (exp(a) <= 0.9999d0) then
        tmp = exp(a) / (exp(a) + 1.0d0)
    else
        tmp = (1.0d0 + t_0) / (t_0 + (exp(b) + 1.0d0))
    end if
    code = tmp
end function
public static double code(double a, double b) {
	double t_0 = a * (1.0 + (a * (0.5 + (a * 0.16666666666666666))));
	double tmp;
	if (Math.exp(a) <= 0.9999) {
		tmp = Math.exp(a) / (Math.exp(a) + 1.0);
	} else {
		tmp = (1.0 + t_0) / (t_0 + (Math.exp(b) + 1.0));
	}
	return tmp;
}
def code(a, b):
	t_0 = a * (1.0 + (a * (0.5 + (a * 0.16666666666666666))))
	tmp = 0
	if math.exp(a) <= 0.9999:
		tmp = math.exp(a) / (math.exp(a) + 1.0)
	else:
		tmp = (1.0 + t_0) / (t_0 + (math.exp(b) + 1.0))
	return tmp
function code(a, b)
	t_0 = Float64(a * Float64(1.0 + Float64(a * Float64(0.5 + Float64(a * 0.16666666666666666)))))
	tmp = 0.0
	if (exp(a) <= 0.9999)
		tmp = Float64(exp(a) / Float64(exp(a) + 1.0));
	else
		tmp = Float64(Float64(1.0 + t_0) / Float64(t_0 + Float64(exp(b) + 1.0)));
	end
	return tmp
end
function tmp_2 = code(a, b)
	t_0 = a * (1.0 + (a * (0.5 + (a * 0.16666666666666666))));
	tmp = 0.0;
	if (exp(a) <= 0.9999)
		tmp = exp(a) / (exp(a) + 1.0);
	else
		tmp = (1.0 + t_0) / (t_0 + (exp(b) + 1.0));
	end
	tmp_2 = tmp;
end
code[a_, b_] := Block[{t$95$0 = N[(a * N[(1.0 + N[(a * N[(0.5 + N[(a * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[Exp[a], $MachinePrecision], 0.9999], N[(N[Exp[a], $MachinePrecision] / N[(N[Exp[a], $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 + t$95$0), $MachinePrecision] / N[(t$95$0 + N[(N[Exp[b], $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := a \cdot \left(1 + a \cdot \left(0.5 + a \cdot 0.16666666666666666\right)\right)\\
\mathbf{if}\;e^{a} \leq 0.9999:\\
\;\;\;\;\frac{e^{a}}{e^{a} + 1}\\

\mathbf{else}:\\
\;\;\;\;\frac{1 + t\_0}{t\_0 + \left(e^{b} + 1\right)}\\


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

    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}} \]

      if 0.99990000000000001 < (exp.f64 a)

      1. Initial program 98.9%

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{exp.f64}\left(a\right), \color{blue}{\left(1 + \left(e^{b} + a \cdot \left(1 + a \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot a\right)\right)\right)\right)}\right) \]
      4. Step-by-step derivation
        1. associate-+r+N/A

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

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

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

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

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

          \[\leadsto \mathsf{/.f64}\left(\mathsf{exp.f64}\left(a\right), \mathsf{+.f64}\left(\mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(b\right)\right), \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(1, \color{blue}{\left(a \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot a\right)\right)}\right)\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{exp.f64}\left(b\right)\right), \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(a, \color{blue}{\left(\frac{1}{2} + \frac{1}{6} \cdot a\right)}\right)\right)\right)\right)\right) \]
        8. +-lowering-+.f64N/A

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

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

          \[\leadsto \mathsf{/.f64}\left(\mathsf{exp.f64}\left(a\right), \mathsf{+.f64}\left(\mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(b\right)\right), \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(a, \color{blue}{\frac{1}{6}}\right)\right)\right)\right)\right)\right)\right) \]
      5. Simplified97.9%

        \[\leadsto \frac{e^{a}}{\color{blue}{\left(1 + e^{b}\right) + a \cdot \left(1 + a \cdot \left(0.5 + a \cdot 0.16666666666666666\right)\right)}} \]
      6. Taylor expanded in a around 0

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

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

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

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

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

          \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(\frac{1}{2}, \left(\frac{1}{6} \cdot a\right)\right)\right)\right)\right)\right), \mathsf{+.f64}\left(\mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(b\right)\right), \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(a, \frac{1}{6}\right)\right)\right)\right)\right)\right)\right) \]
        6. *-lowering-*.f6499.3%

          \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\frac{1}{6}, a\right)\right)\right)\right)\right)\right), \mathsf{+.f64}\left(\mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(b\right)\right), \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(a, \frac{1}{6}\right)\right)\right)\right)\right)\right)\right) \]
      8. Simplified99.3%

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

      \[\leadsto \begin{array}{l} \mathbf{if}\;e^{a} \leq 0.9999:\\ \;\;\;\;\frac{e^{a}}{e^{a} + 1}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 + a \cdot \left(1 + a \cdot \left(0.5 + a \cdot 0.16666666666666666\right)\right)}{a \cdot \left(1 + a \cdot \left(0.5 + a \cdot 0.16666666666666666\right)\right) + \left(e^{b} + 1\right)}\\ \end{array} \]
    7. Add Preprocessing

    Alternative 2: 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 3: 99.4% accurate, 1.3× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_0 := a \cdot \left(1 + a \cdot \left(0.5 + a \cdot 0.16666666666666666\right)\right)\\ \mathbf{if}\;e^{a} \leq 0:\\ \;\;\;\;\frac{e^{a}}{2}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 + t\_0}{t\_0 + \left(e^{b} + 1\right)}\\ \end{array} \end{array} \]
    (FPCore (a b)
     :precision binary64
     (let* ((t_0 (* a (+ 1.0 (* a (+ 0.5 (* a 0.16666666666666666)))))))
       (if (<= (exp a) 0.0)
         (/ (exp a) 2.0)
         (/ (+ 1.0 t_0) (+ t_0 (+ (exp b) 1.0))))))
    double code(double a, double b) {
    	double t_0 = a * (1.0 + (a * (0.5 + (a * 0.16666666666666666))));
    	double tmp;
    	if (exp(a) <= 0.0) {
    		tmp = exp(a) / 2.0;
    	} else {
    		tmp = (1.0 + t_0) / (t_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) :: t_0
        real(8) :: tmp
        t_0 = a * (1.0d0 + (a * (0.5d0 + (a * 0.16666666666666666d0))))
        if (exp(a) <= 0.0d0) then
            tmp = exp(a) / 2.0d0
        else
            tmp = (1.0d0 + t_0) / (t_0 + (exp(b) + 1.0d0))
        end if
        code = tmp
    end function
    
    public static double code(double a, double b) {
    	double t_0 = a * (1.0 + (a * (0.5 + (a * 0.16666666666666666))));
    	double tmp;
    	if (Math.exp(a) <= 0.0) {
    		tmp = Math.exp(a) / 2.0;
    	} else {
    		tmp = (1.0 + t_0) / (t_0 + (Math.exp(b) + 1.0));
    	}
    	return tmp;
    }
    
    def code(a, b):
    	t_0 = a * (1.0 + (a * (0.5 + (a * 0.16666666666666666))))
    	tmp = 0
    	if math.exp(a) <= 0.0:
    		tmp = math.exp(a) / 2.0
    	else:
    		tmp = (1.0 + t_0) / (t_0 + (math.exp(b) + 1.0))
    	return tmp
    
    function code(a, b)
    	t_0 = Float64(a * Float64(1.0 + Float64(a * Float64(0.5 + Float64(a * 0.16666666666666666)))))
    	tmp = 0.0
    	if (exp(a) <= 0.0)
    		tmp = Float64(exp(a) / 2.0);
    	else
    		tmp = Float64(Float64(1.0 + t_0) / Float64(t_0 + Float64(exp(b) + 1.0)));
    	end
    	return tmp
    end
    
    function tmp_2 = code(a, b)
    	t_0 = a * (1.0 + (a * (0.5 + (a * 0.16666666666666666))));
    	tmp = 0.0;
    	if (exp(a) <= 0.0)
    		tmp = exp(a) / 2.0;
    	else
    		tmp = (1.0 + t_0) / (t_0 + (exp(b) + 1.0));
    	end
    	tmp_2 = tmp;
    end
    
    code[a_, b_] := Block[{t$95$0 = N[(a * N[(1.0 + N[(a * N[(0.5 + N[(a * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[Exp[a], $MachinePrecision], 0.0], N[(N[Exp[a], $MachinePrecision] / 2.0), $MachinePrecision], N[(N[(1.0 + t$95$0), $MachinePrecision] / N[(t$95$0 + N[(N[Exp[b], $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_0 := a \cdot \left(1 + a \cdot \left(0.5 + a \cdot 0.16666666666666666\right)\right)\\
    \mathbf{if}\;e^{a} \leq 0:\\
    \;\;\;\;\frac{e^{a}}{2}\\
    
    \mathbf{else}:\\
    \;\;\;\;\frac{1 + t\_0}{t\_0 + \left(e^{b} + 1\right)}\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if (exp.f64 a) < 0.0

      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 \mathsf{/.f64}\left(\mathsf{exp.f64}\left(a\right), \color{blue}{2}\right) \]
        3. Step-by-step derivation
          1. Simplified100.0%

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

          if 0.0 < (exp.f64 a)

          1. Initial program 98.9%

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

            \[\leadsto \mathsf{/.f64}\left(\mathsf{exp.f64}\left(a\right), \color{blue}{\left(1 + \left(e^{b} + a \cdot \left(1 + a \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot a\right)\right)\right)\right)}\right) \]
          4. Step-by-step derivation
            1. associate-+r+N/A

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

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

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

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

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

              \[\leadsto \mathsf{/.f64}\left(\mathsf{exp.f64}\left(a\right), \mathsf{+.f64}\left(\mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(b\right)\right), \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(1, \color{blue}{\left(a \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot a\right)\right)}\right)\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{exp.f64}\left(b\right)\right), \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(a, \color{blue}{\left(\frac{1}{2} + \frac{1}{6} \cdot a\right)}\right)\right)\right)\right)\right) \]
            8. +-lowering-+.f64N/A

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

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

              \[\leadsto \mathsf{/.f64}\left(\mathsf{exp.f64}\left(a\right), \mathsf{+.f64}\left(\mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(b\right)\right), \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(a, \color{blue}{\frac{1}{6}}\right)\right)\right)\right)\right)\right)\right) \]
          5. Simplified97.9%

            \[\leadsto \frac{e^{a}}{\color{blue}{\left(1 + e^{b}\right) + a \cdot \left(1 + a \cdot \left(0.5 + a \cdot 0.16666666666666666\right)\right)}} \]
          6. Taylor expanded in a around 0

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

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

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

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

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

              \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(\frac{1}{2}, \left(\frac{1}{6} \cdot a\right)\right)\right)\right)\right)\right), \mathsf{+.f64}\left(\mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(b\right)\right), \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(a, \frac{1}{6}\right)\right)\right)\right)\right)\right)\right) \]
            6. *-lowering-*.f6499.3%

              \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\frac{1}{6}, a\right)\right)\right)\right)\right)\right), \mathsf{+.f64}\left(\mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(b\right)\right), \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(a, \frac{1}{6}\right)\right)\right)\right)\right)\right)\right) \]
          8. Simplified99.3%

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

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

        Alternative 4: 98.2% accurate, 1.5× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;e^{a} \leq 0.99996:\\ \;\;\;\;\frac{e^{a}}{2}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{e^{b} + 1}\\ \end{array} \end{array} \]
        (FPCore (a b)
         :precision binary64
         (if (<= (exp a) 0.99996) (/ (exp a) 2.0) (/ 1.0 (+ (exp b) 1.0))))
        double code(double a, double b) {
        	double tmp;
        	if (exp(a) <= 0.99996) {
        		tmp = exp(a) / 2.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.99996d0) then
                tmp = exp(a) / 2.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.99996) {
        		tmp = Math.exp(a) / 2.0;
        	} else {
        		tmp = 1.0 / (Math.exp(b) + 1.0);
        	}
        	return tmp;
        }
        
        def code(a, b):
        	tmp = 0
        	if math.exp(a) <= 0.99996:
        		tmp = math.exp(a) / 2.0
        	else:
        		tmp = 1.0 / (math.exp(b) + 1.0)
        	return tmp
        
        function code(a, b)
        	tmp = 0.0
        	if (exp(a) <= 0.99996)
        		tmp = Float64(exp(a) / 2.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.99996)
        		tmp = exp(a) / 2.0;
        	else
        		tmp = 1.0 / (exp(b) + 1.0);
        	end
        	tmp_2 = tmp;
        end
        
        code[a_, b_] := If[LessEqual[N[Exp[a], $MachinePrecision], 0.99996], N[(N[Exp[a], $MachinePrecision] / 2.0), $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.99996:\\
        \;\;\;\;\frac{e^{a}}{2}\\
        
        \mathbf{else}:\\
        \;\;\;\;\frac{1}{e^{b} + 1}\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 2 regimes
        2. if (exp.f64 a) < 0.99995999999999996

          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 \mathsf{/.f64}\left(\mathsf{exp.f64}\left(a\right), \color{blue}{2}\right) \]
            3. Step-by-step derivation
              1. Simplified98.3%

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

              if 0.99995999999999996 < (exp.f64 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.f6497.7%

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

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

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

            Alternative 5: 94.6% accurate, 2.7× speedup?

            \[\begin{array}{l} \\ \begin{array}{l} t_0 := b \cdot \left(0.5 + b \cdot 0.16666666666666666\right)\\ \mathbf{if}\;b \leq -17.5:\\ \;\;\;\;1\\ \mathbf{elif}\;b \leq 4.8 \cdot 10^{+45}:\\ \;\;\;\;\frac{e^{a}}{2}\\ \mathbf{elif}\;b \leq 5 \cdot 10^{+102}:\\ \;\;\;\;\frac{2 + b \cdot \left(-1 + b \cdot \left(-0.5 + b \cdot -0.16666666666666666\right)\right)}{4 + \left(b \cdot \left(1 + t\_0\right)\right) \cdot \left(b \cdot \left(-1 - t\_0\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{-4}{b \cdot \left(b \cdot b\right)}\\ \end{array} \end{array} \]
            (FPCore (a b)
             :precision binary64
             (let* ((t_0 (* b (+ 0.5 (* b 0.16666666666666666)))))
               (if (<= b -17.5)
                 1.0
                 (if (<= b 4.8e+45)
                   (/ (exp a) 2.0)
                   (if (<= b 5e+102)
                     (/
                      (+ 2.0 (* b (+ -1.0 (* b (+ -0.5 (* b -0.16666666666666666))))))
                      (+ 4.0 (* (* b (+ 1.0 t_0)) (* b (- -1.0 t_0)))))
                     (/ -4.0 (* b (* b b))))))))
            double code(double a, double b) {
            	double t_0 = b * (0.5 + (b * 0.16666666666666666));
            	double tmp;
            	if (b <= -17.5) {
            		tmp = 1.0;
            	} else if (b <= 4.8e+45) {
            		tmp = exp(a) / 2.0;
            	} else if (b <= 5e+102) {
            		tmp = (2.0 + (b * (-1.0 + (b * (-0.5 + (b * -0.16666666666666666)))))) / (4.0 + ((b * (1.0 + t_0)) * (b * (-1.0 - t_0))));
            	} else {
            		tmp = -4.0 / (b * (b * b));
            	}
            	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.5d0 + (b * 0.16666666666666666d0))
                if (b <= (-17.5d0)) then
                    tmp = 1.0d0
                else if (b <= 4.8d+45) then
                    tmp = exp(a) / 2.0d0
                else if (b <= 5d+102) then
                    tmp = (2.0d0 + (b * ((-1.0d0) + (b * ((-0.5d0) + (b * (-0.16666666666666666d0))))))) / (4.0d0 + ((b * (1.0d0 + t_0)) * (b * ((-1.0d0) - t_0))))
                else
                    tmp = (-4.0d0) / (b * (b * b))
                end if
                code = tmp
            end function
            
            public static double code(double a, double b) {
            	double t_0 = b * (0.5 + (b * 0.16666666666666666));
            	double tmp;
            	if (b <= -17.5) {
            		tmp = 1.0;
            	} else if (b <= 4.8e+45) {
            		tmp = Math.exp(a) / 2.0;
            	} else if (b <= 5e+102) {
            		tmp = (2.0 + (b * (-1.0 + (b * (-0.5 + (b * -0.16666666666666666)))))) / (4.0 + ((b * (1.0 + t_0)) * (b * (-1.0 - t_0))));
            	} else {
            		tmp = -4.0 / (b * (b * b));
            	}
            	return tmp;
            }
            
            def code(a, b):
            	t_0 = b * (0.5 + (b * 0.16666666666666666))
            	tmp = 0
            	if b <= -17.5:
            		tmp = 1.0
            	elif b <= 4.8e+45:
            		tmp = math.exp(a) / 2.0
            	elif b <= 5e+102:
            		tmp = (2.0 + (b * (-1.0 + (b * (-0.5 + (b * -0.16666666666666666)))))) / (4.0 + ((b * (1.0 + t_0)) * (b * (-1.0 - t_0))))
            	else:
            		tmp = -4.0 / (b * (b * b))
            	return tmp
            
            function code(a, b)
            	t_0 = Float64(b * Float64(0.5 + Float64(b * 0.16666666666666666)))
            	tmp = 0.0
            	if (b <= -17.5)
            		tmp = 1.0;
            	elseif (b <= 4.8e+45)
            		tmp = Float64(exp(a) / 2.0);
            	elseif (b <= 5e+102)
            		tmp = Float64(Float64(2.0 + Float64(b * Float64(-1.0 + Float64(b * Float64(-0.5 + Float64(b * -0.16666666666666666)))))) / Float64(4.0 + Float64(Float64(b * Float64(1.0 + t_0)) * Float64(b * Float64(-1.0 - t_0)))));
            	else
            		tmp = Float64(-4.0 / Float64(b * Float64(b * b)));
            	end
            	return tmp
            end
            
            function tmp_2 = code(a, b)
            	t_0 = b * (0.5 + (b * 0.16666666666666666));
            	tmp = 0.0;
            	if (b <= -17.5)
            		tmp = 1.0;
            	elseif (b <= 4.8e+45)
            		tmp = exp(a) / 2.0;
            	elseif (b <= 5e+102)
            		tmp = (2.0 + (b * (-1.0 + (b * (-0.5 + (b * -0.16666666666666666)))))) / (4.0 + ((b * (1.0 + t_0)) * (b * (-1.0 - t_0))));
            	else
            		tmp = -4.0 / (b * (b * b));
            	end
            	tmp_2 = tmp;
            end
            
            code[a_, b_] := Block[{t$95$0 = N[(b * N[(0.5 + N[(b * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -17.5], 1.0, If[LessEqual[b, 4.8e+45], N[(N[Exp[a], $MachinePrecision] / 2.0), $MachinePrecision], If[LessEqual[b, 5e+102], N[(N[(2.0 + N[(b * N[(-1.0 + N[(b * N[(-0.5 + N[(b * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(4.0 + N[(N[(b * N[(1.0 + t$95$0), $MachinePrecision]), $MachinePrecision] * N[(b * N[(-1.0 - t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-4.0 / N[(b * N[(b * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
            
            \begin{array}{l}
            
            \\
            \begin{array}{l}
            t_0 := b \cdot \left(0.5 + b \cdot 0.16666666666666666\right)\\
            \mathbf{if}\;b \leq -17.5:\\
            \;\;\;\;1\\
            
            \mathbf{elif}\;b \leq 4.8 \cdot 10^{+45}:\\
            \;\;\;\;\frac{e^{a}}{2}\\
            
            \mathbf{elif}\;b \leq 5 \cdot 10^{+102}:\\
            \;\;\;\;\frac{2 + b \cdot \left(-1 + b \cdot \left(-0.5 + b \cdot -0.16666666666666666\right)\right)}{4 + \left(b \cdot \left(1 + t\_0\right)\right) \cdot \left(b \cdot \left(-1 - t\_0\right)\right)}\\
            
            \mathbf{else}:\\
            \;\;\;\;\frac{-4}{b \cdot \left(b \cdot b\right)}\\
            
            
            \end{array}
            \end{array}
            
            Derivation
            1. Split input into 4 regimes
            2. if b < -17.5

              1. Initial program 100.0%

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

                \[\leadsto \mathsf{/.f64}\left(\mathsf{exp.f64}\left(a\right), \color{blue}{\left(1 + \left(e^{b} + a \cdot \left(1 + a \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot a\right)\right)\right)\right)}\right) \]
              4. Step-by-step derivation
                1. associate-+r+N/A

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

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

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

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

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

                  \[\leadsto \mathsf{/.f64}\left(\mathsf{exp.f64}\left(a\right), \mathsf{+.f64}\left(\mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(b\right)\right), \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(1, \color{blue}{\left(a \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot a\right)\right)}\right)\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{exp.f64}\left(b\right)\right), \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(a, \color{blue}{\left(\frac{1}{2} + \frac{1}{6} \cdot a\right)}\right)\right)\right)\right)\right) \]
                8. +-lowering-+.f64N/A

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

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

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

                \[\leadsto \frac{e^{a}}{\color{blue}{\left(1 + e^{b}\right) + a \cdot \left(1 + a \cdot \left(0.5 + a \cdot 0.16666666666666666\right)\right)}} \]
              6. Taylor expanded in a around 0

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

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

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

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

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

                  \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(\frac{1}{2}, \left(\frac{1}{6} \cdot a\right)\right)\right)\right)\right)\right), \mathsf{+.f64}\left(\mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(b\right)\right), \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(a, \frac{1}{6}\right)\right)\right)\right)\right)\right)\right) \]
                6. *-lowering-*.f64100.0%

                  \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\frac{1}{6}, a\right)\right)\right)\right)\right)\right), \mathsf{+.f64}\left(\mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(b\right)\right), \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(a, \frac{1}{6}\right)\right)\right)\right)\right)\right)\right) \]
              8. Simplified100.0%

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

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

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

                if -17.5 < b < 4.79999999999999979e45

                1. Initial program 99.3%

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

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

                    \[\leadsto \mathsf{/.f64}\left(\mathsf{exp.f64}\left(a\right), \color{blue}{2}\right) \]
                  3. Step-by-step derivation
                    1. Simplified92.2%

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

                    if 4.79999999999999979e45 < b < 5e102

                    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.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-*.f645.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. Simplified5.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. flip-+N/A

                        \[\leadsto \frac{1}{\frac{2 \cdot 2 - \left(b \cdot \left(1 + b \cdot \left(\frac{1}{2} + b \cdot \frac{1}{6}\right)\right)\right) \cdot \left(b \cdot \left(1 + b \cdot \left(\frac{1}{2} + b \cdot \frac{1}{6}\right)\right)\right)}{\color{blue}{2 - b \cdot \left(1 + b \cdot \left(\frac{1}{2} + b \cdot \frac{1}{6}\right)\right)}}} \]
                      2. clear-numN/A

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

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

                      \[\leadsto \color{blue}{\frac{2 + b \cdot \left(-1 + b \cdot \left(-0.5 + b \cdot -0.16666666666666666\right)\right)}{4 - \left(b \cdot \left(1 + b \cdot \left(0.5 + b \cdot 0.16666666666666666\right)\right)\right) \cdot \left(b \cdot \left(1 + b \cdot \left(0.5 + b \cdot 0.16666666666666666\right)\right)\right)}} \]

                    if 5e102 < b

                    1. Initial program 97.6%

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

                      \[\leadsto \color{blue}{\frac{1}{1 + e^{b}}} \]
                    4. Step-by-step derivation
                      1. /-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 + \frac{1}{2} \cdot b\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 + \frac{1}{2} \cdot b\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 + \frac{1}{2} \cdot b\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(\frac{1}{2} \cdot b\right)}\right)\right)\right)\right) \]
                      4. *-lowering-*.f6468.6%

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

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

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

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

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

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

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

                        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(2, \left(\mathsf{neg}\left(\frac{4}{b}\right)\right)\right), \left({b}^{2}\right)\right) \]
                      6. distribute-neg-fracN/A

                        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(2, \left(\frac{\mathsf{neg}\left(4\right)}{b}\right)\right), \left({b}^{2}\right)\right) \]
                      7. /-lowering-/.f64N/A

                        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(2, \mathsf{/.f64}\left(\left(\mathsf{neg}\left(4\right)\right), b\right)\right), \left({b}^{2}\right)\right) \]
                      8. metadata-evalN/A

                        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(2, \mathsf{/.f64}\left(-4, b\right)\right), \left({b}^{2}\right)\right) \]
                      9. unpow2N/A

                        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(2, \mathsf{/.f64}\left(-4, b\right)\right), \left(b \cdot \color{blue}{b}\right)\right) \]
                      10. *-lowering-*.f6468.6%

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

                      \[\leadsto \color{blue}{\frac{2 + \frac{-4}{b}}{b \cdot b}} \]
                    12. Taylor expanded in b around 0

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

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

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

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

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

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

                        \[\leadsto \mathsf{/.f64}\left(-4, \mathsf{*.f64}\left(b, \mathsf{*.f64}\left(b, \color{blue}{b}\right)\right)\right) \]
                    14. Simplified100.0%

                      \[\leadsto \color{blue}{\frac{-4}{b \cdot \left(b \cdot b\right)}} \]
                  4. Recombined 4 regimes into one program.
                  5. Final simplification94.8%

                    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -17.5:\\ \;\;\;\;1\\ \mathbf{elif}\;b \leq 4.8 \cdot 10^{+45}:\\ \;\;\;\;\frac{e^{a}}{2}\\ \mathbf{elif}\;b \leq 5 \cdot 10^{+102}:\\ \;\;\;\;\frac{2 + b \cdot \left(-1 + b \cdot \left(-0.5 + b \cdot -0.16666666666666666\right)\right)}{4 + \left(b \cdot \left(1 + b \cdot \left(0.5 + b \cdot 0.16666666666666666\right)\right)\right) \cdot \left(b \cdot \left(-1 - b \cdot \left(0.5 + b \cdot 0.16666666666666666\right)\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{-4}{b \cdot \left(b \cdot b\right)}\\ \end{array} \]
                  6. Add Preprocessing

                  Alternative 6: 75.5% accurate, 5.0× speedup?

                  \[\begin{array}{l} \\ \begin{array}{l} t_0 := 0.5 + b \cdot 0.16666666666666666\\ t_1 := b \cdot t\_0\\ \mathbf{if}\;b \leq -1.55:\\ \;\;\;\;1\\ \mathbf{elif}\;b \leq 2.8 \cdot 10^{+77}:\\ \;\;\;\;\frac{1}{2 + \frac{b \cdot \left(1 + \left(b \cdot t\_1\right) \cdot \left(b \cdot \left(t\_0 \cdot t\_0\right)\right)\right)}{1 + t\_1 \cdot \left(-1 + t\_1\right)}}\\ \mathbf{else}:\\ \;\;\;\;\frac{-4}{b \cdot \left(b \cdot b\right)}\\ \end{array} \end{array} \]
                  (FPCore (a b)
                   :precision binary64
                   (let* ((t_0 (+ 0.5 (* b 0.16666666666666666))) (t_1 (* b t_0)))
                     (if (<= b -1.55)
                       1.0
                       (if (<= b 2.8e+77)
                         (/
                          1.0
                          (+
                           2.0
                           (/
                            (* b (+ 1.0 (* (* b t_1) (* b (* t_0 t_0)))))
                            (+ 1.0 (* t_1 (+ -1.0 t_1))))))
                         (/ -4.0 (* b (* b b)))))))
                  double code(double a, double b) {
                  	double t_0 = 0.5 + (b * 0.16666666666666666);
                  	double t_1 = b * t_0;
                  	double tmp;
                  	if (b <= -1.55) {
                  		tmp = 1.0;
                  	} else if (b <= 2.8e+77) {
                  		tmp = 1.0 / (2.0 + ((b * (1.0 + ((b * t_1) * (b * (t_0 * t_0))))) / (1.0 + (t_1 * (-1.0 + t_1)))));
                  	} else {
                  		tmp = -4.0 / (b * (b * b));
                  	}
                  	return tmp;
                  }
                  
                  real(8) function code(a, b)
                      real(8), intent (in) :: a
                      real(8), intent (in) :: b
                      real(8) :: t_0
                      real(8) :: t_1
                      real(8) :: tmp
                      t_0 = 0.5d0 + (b * 0.16666666666666666d0)
                      t_1 = b * t_0
                      if (b <= (-1.55d0)) then
                          tmp = 1.0d0
                      else if (b <= 2.8d+77) then
                          tmp = 1.0d0 / (2.0d0 + ((b * (1.0d0 + ((b * t_1) * (b * (t_0 * t_0))))) / (1.0d0 + (t_1 * ((-1.0d0) + t_1)))))
                      else
                          tmp = (-4.0d0) / (b * (b * b))
                      end if
                      code = tmp
                  end function
                  
                  public static double code(double a, double b) {
                  	double t_0 = 0.5 + (b * 0.16666666666666666);
                  	double t_1 = b * t_0;
                  	double tmp;
                  	if (b <= -1.55) {
                  		tmp = 1.0;
                  	} else if (b <= 2.8e+77) {
                  		tmp = 1.0 / (2.0 + ((b * (1.0 + ((b * t_1) * (b * (t_0 * t_0))))) / (1.0 + (t_1 * (-1.0 + t_1)))));
                  	} else {
                  		tmp = -4.0 / (b * (b * b));
                  	}
                  	return tmp;
                  }
                  
                  def code(a, b):
                  	t_0 = 0.5 + (b * 0.16666666666666666)
                  	t_1 = b * t_0
                  	tmp = 0
                  	if b <= -1.55:
                  		tmp = 1.0
                  	elif b <= 2.8e+77:
                  		tmp = 1.0 / (2.0 + ((b * (1.0 + ((b * t_1) * (b * (t_0 * t_0))))) / (1.0 + (t_1 * (-1.0 + t_1)))))
                  	else:
                  		tmp = -4.0 / (b * (b * b))
                  	return tmp
                  
                  function code(a, b)
                  	t_0 = Float64(0.5 + Float64(b * 0.16666666666666666))
                  	t_1 = Float64(b * t_0)
                  	tmp = 0.0
                  	if (b <= -1.55)
                  		tmp = 1.0;
                  	elseif (b <= 2.8e+77)
                  		tmp = Float64(1.0 / Float64(2.0 + Float64(Float64(b * Float64(1.0 + Float64(Float64(b * t_1) * Float64(b * Float64(t_0 * t_0))))) / Float64(1.0 + Float64(t_1 * Float64(-1.0 + t_1))))));
                  	else
                  		tmp = Float64(-4.0 / Float64(b * Float64(b * b)));
                  	end
                  	return tmp
                  end
                  
                  function tmp_2 = code(a, b)
                  	t_0 = 0.5 + (b * 0.16666666666666666);
                  	t_1 = b * t_0;
                  	tmp = 0.0;
                  	if (b <= -1.55)
                  		tmp = 1.0;
                  	elseif (b <= 2.8e+77)
                  		tmp = 1.0 / (2.0 + ((b * (1.0 + ((b * t_1) * (b * (t_0 * t_0))))) / (1.0 + (t_1 * (-1.0 + t_1)))));
                  	else
                  		tmp = -4.0 / (b * (b * b));
                  	end
                  	tmp_2 = tmp;
                  end
                  
                  code[a_, b_] := Block[{t$95$0 = N[(0.5 + N[(b * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(b * t$95$0), $MachinePrecision]}, If[LessEqual[b, -1.55], 1.0, If[LessEqual[b, 2.8e+77], N[(1.0 / N[(2.0 + N[(N[(b * N[(1.0 + N[(N[(b * t$95$1), $MachinePrecision] * N[(b * N[(t$95$0 * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(1.0 + N[(t$95$1 * N[(-1.0 + t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-4.0 / N[(b * N[(b * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
                  
                  \begin{array}{l}
                  
                  \\
                  \begin{array}{l}
                  t_0 := 0.5 + b \cdot 0.16666666666666666\\
                  t_1 := b \cdot t\_0\\
                  \mathbf{if}\;b \leq -1.55:\\
                  \;\;\;\;1\\
                  
                  \mathbf{elif}\;b \leq 2.8 \cdot 10^{+77}:\\
                  \;\;\;\;\frac{1}{2 + \frac{b \cdot \left(1 + \left(b \cdot t\_1\right) \cdot \left(b \cdot \left(t\_0 \cdot t\_0\right)\right)\right)}{1 + t\_1 \cdot \left(-1 + t\_1\right)}}\\
                  
                  \mathbf{else}:\\
                  \;\;\;\;\frac{-4}{b \cdot \left(b \cdot b\right)}\\
                  
                  
                  \end{array}
                  \end{array}
                  
                  Derivation
                  1. Split input into 3 regimes
                  2. if b < -1.55000000000000004

                    1. Initial program 100.0%

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

                      \[\leadsto \mathsf{/.f64}\left(\mathsf{exp.f64}\left(a\right), \color{blue}{\left(1 + \left(e^{b} + a \cdot \left(1 + a \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot a\right)\right)\right)\right)}\right) \]
                    4. Step-by-step derivation
                      1. associate-+r+N/A

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

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

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

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

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

                        \[\leadsto \mathsf{/.f64}\left(\mathsf{exp.f64}\left(a\right), \mathsf{+.f64}\left(\mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(b\right)\right), \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(1, \color{blue}{\left(a \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot a\right)\right)}\right)\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{exp.f64}\left(b\right)\right), \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(a, \color{blue}{\left(\frac{1}{2} + \frac{1}{6} \cdot a\right)}\right)\right)\right)\right)\right) \]
                      8. +-lowering-+.f64N/A

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

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

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

                      \[\leadsto \frac{e^{a}}{\color{blue}{\left(1 + e^{b}\right) + a \cdot \left(1 + a \cdot \left(0.5 + a \cdot 0.16666666666666666\right)\right)}} \]
                    6. Taylor expanded in a around 0

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

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

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

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

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

                        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(\frac{1}{2}, \left(\frac{1}{6} \cdot a\right)\right)\right)\right)\right)\right), \mathsf{+.f64}\left(\mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(b\right)\right), \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(a, \frac{1}{6}\right)\right)\right)\right)\right)\right)\right) \]
                      6. *-lowering-*.f64100.0%

                        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\frac{1}{6}, a\right)\right)\right)\right)\right)\right), \mathsf{+.f64}\left(\mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(b\right)\right), \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(a, \frac{1}{6}\right)\right)\right)\right)\right)\right)\right) \]
                    8. Simplified100.0%

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

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

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

                      if -1.55000000000000004 < b < 2.8e77

                      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.f6466.6%

                          \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(b\right)\right)\right) \]
                      5. Simplified66.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-*.f6457.9%

                          \[\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. Simplified57.9%

                        \[\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, \left(\left(1 + b \cdot \left(\frac{1}{2} + b \cdot \frac{1}{6}\right)\right) \cdot \color{blue}{b}\right)\right)\right) \]
                        2. flip3-+N/A

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

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

                          \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(2, \mathsf{/.f64}\left(\left(\left({1}^{3} + {\left(b \cdot \left(\frac{1}{2} + b \cdot \frac{1}{6}\right)\right)}^{3}\right) \cdot b\right), \color{blue}{\left(1 \cdot 1 + \left(\left(b \cdot \left(\frac{1}{2} + b \cdot \frac{1}{6}\right)\right) \cdot \left(b \cdot \left(\frac{1}{2} + b \cdot \frac{1}{6}\right)\right) - 1 \cdot \left(b \cdot \left(\frac{1}{2} + b \cdot \frac{1}{6}\right)\right)\right)\right)}\right)\right)\right) \]
                      10. Applied egg-rr62.5%

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

                      if 2.8e77 < b

                      1. Initial program 97.7%

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

                        \[\leadsto \color{blue}{\frac{1}{1 + e^{b}}} \]
                      4. Step-by-step derivation
                        1. /-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 + \frac{1}{2} \cdot b\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 + \frac{1}{2} \cdot b\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 + \frac{1}{2} \cdot b\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(\frac{1}{2} \cdot b\right)}\right)\right)\right)\right) \]
                        4. *-lowering-*.f6464.2%

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

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

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

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

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

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

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

                          \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(2, \left(\mathsf{neg}\left(\frac{4}{b}\right)\right)\right), \left({b}^{2}\right)\right) \]
                        6. distribute-neg-fracN/A

                          \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(2, \left(\frac{\mathsf{neg}\left(4\right)}{b}\right)\right), \left({b}^{2}\right)\right) \]
                        7. /-lowering-/.f64N/A

                          \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(2, \mathsf{/.f64}\left(\left(\mathsf{neg}\left(4\right)\right), b\right)\right), \left({b}^{2}\right)\right) \]
                        8. metadata-evalN/A

                          \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(2, \mathsf{/.f64}\left(-4, b\right)\right), \left({b}^{2}\right)\right) \]
                        9. unpow2N/A

                          \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(2, \mathsf{/.f64}\left(-4, b\right)\right), \left(b \cdot \color{blue}{b}\right)\right) \]
                        10. *-lowering-*.f6464.2%

                          \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(2, \mathsf{/.f64}\left(-4, b\right)\right), \mathsf{*.f64}\left(b, \color{blue}{b}\right)\right) \]
                      11. Simplified64.2%

                        \[\leadsto \color{blue}{\frac{2 + \frac{-4}{b}}{b \cdot b}} \]
                      12. Taylor expanded in b around 0

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

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

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

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

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

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

                          \[\leadsto \mathsf{/.f64}\left(-4, \mathsf{*.f64}\left(b, \mathsf{*.f64}\left(b, \color{blue}{b}\right)\right)\right) \]
                      14. Simplified93.6%

                        \[\leadsto \color{blue}{\frac{-4}{b \cdot \left(b \cdot b\right)}} \]
                    11. Recombined 3 regimes into one program.
                    12. Final simplification74.9%

                      \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -1.55:\\ \;\;\;\;1\\ \mathbf{elif}\;b \leq 2.8 \cdot 10^{+77}:\\ \;\;\;\;\frac{1}{2 + \frac{b \cdot \left(1 + \left(b \cdot \left(b \cdot \left(0.5 + b \cdot 0.16666666666666666\right)\right)\right) \cdot \left(b \cdot \left(\left(0.5 + b \cdot 0.16666666666666666\right) \cdot \left(0.5 + b \cdot 0.16666666666666666\right)\right)\right)\right)}{1 + \left(b \cdot \left(0.5 + b \cdot 0.16666666666666666\right)\right) \cdot \left(-1 + b \cdot \left(0.5 + b \cdot 0.16666666666666666\right)\right)}}\\ \mathbf{else}:\\ \;\;\;\;\frac{-4}{b \cdot \left(b \cdot b\right)}\\ \end{array} \]
                    13. Add Preprocessing

                    Alternative 7: 76.8% accurate, 6.2× speedup?

                    \[\begin{array}{l} \\ \begin{array}{l} t_0 := b \cdot \left(0.5 + b \cdot 0.16666666666666666\right)\\ \mathbf{if}\;b \leq -1.25:\\ \;\;\;\;1\\ \mathbf{elif}\;b \leq 5 \cdot 10^{+102}:\\ \;\;\;\;\frac{2 + b \cdot \left(-1 + b \cdot \left(-0.5 + b \cdot -0.16666666666666666\right)\right)}{4 + \left(b \cdot \left(1 + t\_0\right)\right) \cdot \left(b \cdot \left(-1 - t\_0\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{-4}{b \cdot \left(b \cdot b\right)}\\ \end{array} \end{array} \]
                    (FPCore (a b)
                     :precision binary64
                     (let* ((t_0 (* b (+ 0.5 (* b 0.16666666666666666)))))
                       (if (<= b -1.25)
                         1.0
                         (if (<= b 5e+102)
                           (/
                            (+ 2.0 (* b (+ -1.0 (* b (+ -0.5 (* b -0.16666666666666666))))))
                            (+ 4.0 (* (* b (+ 1.0 t_0)) (* b (- -1.0 t_0)))))
                           (/ -4.0 (* b (* b b)))))))
                    double code(double a, double b) {
                    	double t_0 = b * (0.5 + (b * 0.16666666666666666));
                    	double tmp;
                    	if (b <= -1.25) {
                    		tmp = 1.0;
                    	} else if (b <= 5e+102) {
                    		tmp = (2.0 + (b * (-1.0 + (b * (-0.5 + (b * -0.16666666666666666)))))) / (4.0 + ((b * (1.0 + t_0)) * (b * (-1.0 - t_0))));
                    	} else {
                    		tmp = -4.0 / (b * (b * b));
                    	}
                    	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.5d0 + (b * 0.16666666666666666d0))
                        if (b <= (-1.25d0)) then
                            tmp = 1.0d0
                        else if (b <= 5d+102) then
                            tmp = (2.0d0 + (b * ((-1.0d0) + (b * ((-0.5d0) + (b * (-0.16666666666666666d0))))))) / (4.0d0 + ((b * (1.0d0 + t_0)) * (b * ((-1.0d0) - t_0))))
                        else
                            tmp = (-4.0d0) / (b * (b * b))
                        end if
                        code = tmp
                    end function
                    
                    public static double code(double a, double b) {
                    	double t_0 = b * (0.5 + (b * 0.16666666666666666));
                    	double tmp;
                    	if (b <= -1.25) {
                    		tmp = 1.0;
                    	} else if (b <= 5e+102) {
                    		tmp = (2.0 + (b * (-1.0 + (b * (-0.5 + (b * -0.16666666666666666)))))) / (4.0 + ((b * (1.0 + t_0)) * (b * (-1.0 - t_0))));
                    	} else {
                    		tmp = -4.0 / (b * (b * b));
                    	}
                    	return tmp;
                    }
                    
                    def code(a, b):
                    	t_0 = b * (0.5 + (b * 0.16666666666666666))
                    	tmp = 0
                    	if b <= -1.25:
                    		tmp = 1.0
                    	elif b <= 5e+102:
                    		tmp = (2.0 + (b * (-1.0 + (b * (-0.5 + (b * -0.16666666666666666)))))) / (4.0 + ((b * (1.0 + t_0)) * (b * (-1.0 - t_0))))
                    	else:
                    		tmp = -4.0 / (b * (b * b))
                    	return tmp
                    
                    function code(a, b)
                    	t_0 = Float64(b * Float64(0.5 + Float64(b * 0.16666666666666666)))
                    	tmp = 0.0
                    	if (b <= -1.25)
                    		tmp = 1.0;
                    	elseif (b <= 5e+102)
                    		tmp = Float64(Float64(2.0 + Float64(b * Float64(-1.0 + Float64(b * Float64(-0.5 + Float64(b * -0.16666666666666666)))))) / Float64(4.0 + Float64(Float64(b * Float64(1.0 + t_0)) * Float64(b * Float64(-1.0 - t_0)))));
                    	else
                    		tmp = Float64(-4.0 / Float64(b * Float64(b * b)));
                    	end
                    	return tmp
                    end
                    
                    function tmp_2 = code(a, b)
                    	t_0 = b * (0.5 + (b * 0.16666666666666666));
                    	tmp = 0.0;
                    	if (b <= -1.25)
                    		tmp = 1.0;
                    	elseif (b <= 5e+102)
                    		tmp = (2.0 + (b * (-1.0 + (b * (-0.5 + (b * -0.16666666666666666)))))) / (4.0 + ((b * (1.0 + t_0)) * (b * (-1.0 - t_0))));
                    	else
                    		tmp = -4.0 / (b * (b * b));
                    	end
                    	tmp_2 = tmp;
                    end
                    
                    code[a_, b_] := Block[{t$95$0 = N[(b * N[(0.5 + N[(b * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -1.25], 1.0, If[LessEqual[b, 5e+102], N[(N[(2.0 + N[(b * N[(-1.0 + N[(b * N[(-0.5 + N[(b * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(4.0 + N[(N[(b * N[(1.0 + t$95$0), $MachinePrecision]), $MachinePrecision] * N[(b * N[(-1.0 - t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-4.0 / N[(b * N[(b * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
                    
                    \begin{array}{l}
                    
                    \\
                    \begin{array}{l}
                    t_0 := b \cdot \left(0.5 + b \cdot 0.16666666666666666\right)\\
                    \mathbf{if}\;b \leq -1.25:\\
                    \;\;\;\;1\\
                    
                    \mathbf{elif}\;b \leq 5 \cdot 10^{+102}:\\
                    \;\;\;\;\frac{2 + b \cdot \left(-1 + b \cdot \left(-0.5 + b \cdot -0.16666666666666666\right)\right)}{4 + \left(b \cdot \left(1 + t\_0\right)\right) \cdot \left(b \cdot \left(-1 - t\_0\right)\right)}\\
                    
                    \mathbf{else}:\\
                    \;\;\;\;\frac{-4}{b \cdot \left(b \cdot b\right)}\\
                    
                    
                    \end{array}
                    \end{array}
                    
                    Derivation
                    1. Split input into 3 regimes
                    2. if b < -1.25

                      1. Initial program 100.0%

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

                        \[\leadsto \mathsf{/.f64}\left(\mathsf{exp.f64}\left(a\right), \color{blue}{\left(1 + \left(e^{b} + a \cdot \left(1 + a \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot a\right)\right)\right)\right)}\right) \]
                      4. Step-by-step derivation
                        1. associate-+r+N/A

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

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

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

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

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

                          \[\leadsto \mathsf{/.f64}\left(\mathsf{exp.f64}\left(a\right), \mathsf{+.f64}\left(\mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(b\right)\right), \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(1, \color{blue}{\left(a \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot a\right)\right)}\right)\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{exp.f64}\left(b\right)\right), \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(a, \color{blue}{\left(\frac{1}{2} + \frac{1}{6} \cdot a\right)}\right)\right)\right)\right)\right) \]
                        8. +-lowering-+.f64N/A

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

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

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

                        \[\leadsto \frac{e^{a}}{\color{blue}{\left(1 + e^{b}\right) + a \cdot \left(1 + a \cdot \left(0.5 + a \cdot 0.16666666666666666\right)\right)}} \]
                      6. Taylor expanded in a around 0

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

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

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

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

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

                          \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(\frac{1}{2}, \left(\frac{1}{6} \cdot a\right)\right)\right)\right)\right)\right), \mathsf{+.f64}\left(\mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(b\right)\right), \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(a, \frac{1}{6}\right)\right)\right)\right)\right)\right)\right) \]
                        6. *-lowering-*.f64100.0%

                          \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\frac{1}{6}, a\right)\right)\right)\right)\right)\right), \mathsf{+.f64}\left(\mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(b\right)\right), \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(a, \frac{1}{6}\right)\right)\right)\right)\right)\right)\right) \]
                      8. Simplified100.0%

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

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

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

                        if -1.25 < b < 5e102

                        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.f6467.2%

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

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

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

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

                            \[\leadsto \frac{1}{\frac{2 \cdot 2 - \left(b \cdot \left(1 + b \cdot \left(\frac{1}{2} + b \cdot \frac{1}{6}\right)\right)\right) \cdot \left(b \cdot \left(1 + b \cdot \left(\frac{1}{2} + b \cdot \frac{1}{6}\right)\right)\right)}{\color{blue}{2 - b \cdot \left(1 + b \cdot \left(\frac{1}{2} + b \cdot \frac{1}{6}\right)\right)}}} \]
                          2. clear-numN/A

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

                            \[\leadsto \mathsf{/.f64}\left(\left(2 - b \cdot \left(1 + b \cdot \left(\frac{1}{2} + b \cdot \frac{1}{6}\right)\right)\right), \color{blue}{\left(2 \cdot 2 - \left(b \cdot \left(1 + b \cdot \left(\frac{1}{2} + b \cdot \frac{1}{6}\right)\right)\right) \cdot \left(b \cdot \left(1 + b \cdot \left(\frac{1}{2} + b \cdot \frac{1}{6}\right)\right)\right)\right)}\right) \]
                        10. Applied egg-rr61.5%

                          \[\leadsto \color{blue}{\frac{2 + b \cdot \left(-1 + b \cdot \left(-0.5 + b \cdot -0.16666666666666666\right)\right)}{4 - \left(b \cdot \left(1 + b \cdot \left(0.5 + b \cdot 0.16666666666666666\right)\right)\right) \cdot \left(b \cdot \left(1 + b \cdot \left(0.5 + b \cdot 0.16666666666666666\right)\right)\right)}} \]

                        if 5e102 < b

                        1. Initial program 97.6%

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

                          \[\leadsto \color{blue}{\frac{1}{1 + e^{b}}} \]
                        4. Step-by-step derivation
                          1. /-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 + \frac{1}{2} \cdot b\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 + \frac{1}{2} \cdot b\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 + \frac{1}{2} \cdot b\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(\frac{1}{2} \cdot b\right)}\right)\right)\right)\right) \]
                          4. *-lowering-*.f6468.6%

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

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

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

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

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

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

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

                            \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(2, \left(\mathsf{neg}\left(\frac{4}{b}\right)\right)\right), \left({b}^{2}\right)\right) \]
                          6. distribute-neg-fracN/A

                            \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(2, \left(\frac{\mathsf{neg}\left(4\right)}{b}\right)\right), \left({b}^{2}\right)\right) \]
                          7. /-lowering-/.f64N/A

                            \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(2, \mathsf{/.f64}\left(\left(\mathsf{neg}\left(4\right)\right), b\right)\right), \left({b}^{2}\right)\right) \]
                          8. metadata-evalN/A

                            \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(2, \mathsf{/.f64}\left(-4, b\right)\right), \left({b}^{2}\right)\right) \]
                          9. unpow2N/A

                            \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(2, \mathsf{/.f64}\left(-4, b\right)\right), \left(b \cdot \color{blue}{b}\right)\right) \]
                          10. *-lowering-*.f6468.6%

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

                          \[\leadsto \color{blue}{\frac{2 + \frac{-4}{b}}{b \cdot b}} \]
                        12. Taylor expanded in b around 0

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

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

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

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

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

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

                            \[\leadsto \mathsf{/.f64}\left(-4, \mathsf{*.f64}\left(b, \mathsf{*.f64}\left(b, \color{blue}{b}\right)\right)\right) \]
                        14. Simplified100.0%

                          \[\leadsto \color{blue}{\frac{-4}{b \cdot \left(b \cdot b\right)}} \]
                      11. Recombined 3 regimes into one program.
                      12. Final simplification74.9%

                        \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -1.25:\\ \;\;\;\;1\\ \mathbf{elif}\;b \leq 5 \cdot 10^{+102}:\\ \;\;\;\;\frac{2 + b \cdot \left(-1 + b \cdot \left(-0.5 + b \cdot -0.16666666666666666\right)\right)}{4 + \left(b \cdot \left(1 + b \cdot \left(0.5 + b \cdot 0.16666666666666666\right)\right)\right) \cdot \left(b \cdot \left(-1 - b \cdot \left(0.5 + b \cdot 0.16666666666666666\right)\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{-4}{b \cdot \left(b \cdot b\right)}\\ \end{array} \]
                      13. Add Preprocessing

                      Alternative 8: 75.7% accurate, 13.8× speedup?

                      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq -2.4:\\ \;\;\;\;1\\ \mathbf{elif}\;b \leq 420:\\ \;\;\;\;0.5 + b \cdot \left(-0.25 + b \cdot \left(b \cdot 0.020833333333333332\right)\right)\\ \mathbf{elif}\;b \leq 1.08 \cdot 10^{+80}:\\ \;\;\;\;a \cdot \left(\left(a \cdot a\right) \cdot -0.020833333333333332\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{-4}{b \cdot \left(b \cdot b\right)}\\ \end{array} \end{array} \]
                      (FPCore (a b)
                       :precision binary64
                       (if (<= b -2.4)
                         1.0
                         (if (<= b 420.0)
                           (+ 0.5 (* b (+ -0.25 (* b (* b 0.020833333333333332)))))
                           (if (<= b 1.08e+80)
                             (* a (* (* a a) -0.020833333333333332))
                             (/ -4.0 (* b (* b b)))))))
                      double code(double a, double b) {
                      	double tmp;
                      	if (b <= -2.4) {
                      		tmp = 1.0;
                      	} else if (b <= 420.0) {
                      		tmp = 0.5 + (b * (-0.25 + (b * (b * 0.020833333333333332))));
                      	} else if (b <= 1.08e+80) {
                      		tmp = a * ((a * a) * -0.020833333333333332);
                      	} else {
                      		tmp = -4.0 / (b * (b * b));
                      	}
                      	return tmp;
                      }
                      
                      real(8) function code(a, b)
                          real(8), intent (in) :: a
                          real(8), intent (in) :: b
                          real(8) :: tmp
                          if (b <= (-2.4d0)) then
                              tmp = 1.0d0
                          else if (b <= 420.0d0) then
                              tmp = 0.5d0 + (b * ((-0.25d0) + (b * (b * 0.020833333333333332d0))))
                          else if (b <= 1.08d+80) then
                              tmp = a * ((a * a) * (-0.020833333333333332d0))
                          else
                              tmp = (-4.0d0) / (b * (b * b))
                          end if
                          code = tmp
                      end function
                      
                      public static double code(double a, double b) {
                      	double tmp;
                      	if (b <= -2.4) {
                      		tmp = 1.0;
                      	} else if (b <= 420.0) {
                      		tmp = 0.5 + (b * (-0.25 + (b * (b * 0.020833333333333332))));
                      	} else if (b <= 1.08e+80) {
                      		tmp = a * ((a * a) * -0.020833333333333332);
                      	} else {
                      		tmp = -4.0 / (b * (b * b));
                      	}
                      	return tmp;
                      }
                      
                      def code(a, b):
                      	tmp = 0
                      	if b <= -2.4:
                      		tmp = 1.0
                      	elif b <= 420.0:
                      		tmp = 0.5 + (b * (-0.25 + (b * (b * 0.020833333333333332))))
                      	elif b <= 1.08e+80:
                      		tmp = a * ((a * a) * -0.020833333333333332)
                      	else:
                      		tmp = -4.0 / (b * (b * b))
                      	return tmp
                      
                      function code(a, b)
                      	tmp = 0.0
                      	if (b <= -2.4)
                      		tmp = 1.0;
                      	elseif (b <= 420.0)
                      		tmp = Float64(0.5 + Float64(b * Float64(-0.25 + Float64(b * Float64(b * 0.020833333333333332)))));
                      	elseif (b <= 1.08e+80)
                      		tmp = Float64(a * Float64(Float64(a * a) * -0.020833333333333332));
                      	else
                      		tmp = Float64(-4.0 / Float64(b * Float64(b * b)));
                      	end
                      	return tmp
                      end
                      
                      function tmp_2 = code(a, b)
                      	tmp = 0.0;
                      	if (b <= -2.4)
                      		tmp = 1.0;
                      	elseif (b <= 420.0)
                      		tmp = 0.5 + (b * (-0.25 + (b * (b * 0.020833333333333332))));
                      	elseif (b <= 1.08e+80)
                      		tmp = a * ((a * a) * -0.020833333333333332);
                      	else
                      		tmp = -4.0 / (b * (b * b));
                      	end
                      	tmp_2 = tmp;
                      end
                      
                      code[a_, b_] := If[LessEqual[b, -2.4], 1.0, If[LessEqual[b, 420.0], N[(0.5 + N[(b * N[(-0.25 + N[(b * N[(b * 0.020833333333333332), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 1.08e+80], N[(a * N[(N[(a * a), $MachinePrecision] * -0.020833333333333332), $MachinePrecision]), $MachinePrecision], N[(-4.0 / N[(b * N[(b * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
                      
                      \begin{array}{l}
                      
                      \\
                      \begin{array}{l}
                      \mathbf{if}\;b \leq -2.4:\\
                      \;\;\;\;1\\
                      
                      \mathbf{elif}\;b \leq 420:\\
                      \;\;\;\;0.5 + b \cdot \left(-0.25 + b \cdot \left(b \cdot 0.020833333333333332\right)\right)\\
                      
                      \mathbf{elif}\;b \leq 1.08 \cdot 10^{+80}:\\
                      \;\;\;\;a \cdot \left(\left(a \cdot a\right) \cdot -0.020833333333333332\right)\\
                      
                      \mathbf{else}:\\
                      \;\;\;\;\frac{-4}{b \cdot \left(b \cdot b\right)}\\
                      
                      
                      \end{array}
                      \end{array}
                      
                      Derivation
                      1. Split input into 4 regimes
                      2. if 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 \mathsf{/.f64}\left(\mathsf{exp.f64}\left(a\right), \color{blue}{\left(1 + \left(e^{b} + a \cdot \left(1 + a \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot a\right)\right)\right)\right)}\right) \]
                        4. Step-by-step derivation
                          1. associate-+r+N/A

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

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

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

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

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

                            \[\leadsto \mathsf{/.f64}\left(\mathsf{exp.f64}\left(a\right), \mathsf{+.f64}\left(\mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(b\right)\right), \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(1, \color{blue}{\left(a \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot a\right)\right)}\right)\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{exp.f64}\left(b\right)\right), \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(a, \color{blue}{\left(\frac{1}{2} + \frac{1}{6} \cdot a\right)}\right)\right)\right)\right)\right) \]
                          8. +-lowering-+.f64N/A

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

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

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

                          \[\leadsto \frac{e^{a}}{\color{blue}{\left(1 + e^{b}\right) + a \cdot \left(1 + a \cdot \left(0.5 + a \cdot 0.16666666666666666\right)\right)}} \]
                        6. Taylor expanded in a around 0

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

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

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

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

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

                            \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(\frac{1}{2}, \left(\frac{1}{6} \cdot a\right)\right)\right)\right)\right)\right), \mathsf{+.f64}\left(\mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(b\right)\right), \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(a, \frac{1}{6}\right)\right)\right)\right)\right)\right)\right) \]
                          6. *-lowering-*.f64100.0%

                            \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\frac{1}{6}, a\right)\right)\right)\right)\right)\right), \mathsf{+.f64}\left(\mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(b\right)\right), \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(a, \frac{1}{6}\right)\right)\right)\right)\right)\right)\right) \]
                        8. Simplified100.0%

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

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

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

                          if -2.39999999999999991 < b < 420

                          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.f6463.5%

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

                            \[\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-*.f6463.1%

                              \[\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. Simplified63.1%

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

                          if 420 < b < 1.08e80

                          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. Simplified35.5%

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

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

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

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

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

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

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

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

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

                              \[\leadsto \color{blue}{\frac{-1}{48} \cdot {a}^{3}} \]
                            6. Step-by-step derivation
                              1. unpow3N/A

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

                                \[\leadsto \frac{-1}{48} \cdot \left({a}^{2} \cdot a\right) \]
                              3. associate-*r*N/A

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

                                \[\leadsto a \cdot \color{blue}{\left(\frac{-1}{48} \cdot {a}^{2}\right)} \]
                              5. *-lowering-*.f64N/A

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

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

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

                                \[\leadsto \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(\left(a \cdot a\right), \frac{-1}{48}\right)\right) \]
                              9. *-lowering-*.f6435.7%

                                \[\leadsto \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(\mathsf{*.f64}\left(a, a\right), \frac{-1}{48}\right)\right) \]
                            7. Simplified35.7%

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

                            if 1.08e80 < b

                            1. Initial program 97.7%

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

                              \[\leadsto \color{blue}{\frac{1}{1 + e^{b}}} \]
                            4. Step-by-step derivation
                              1. /-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 + \frac{1}{2} \cdot b\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 + \frac{1}{2} \cdot b\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 + \frac{1}{2} \cdot b\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(\frac{1}{2} \cdot b\right)}\right)\right)\right)\right) \]
                              4. *-lowering-*.f6465.6%

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

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

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

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

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

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

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

                                \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(2, \left(\mathsf{neg}\left(\frac{4}{b}\right)\right)\right), \left({b}^{2}\right)\right) \]
                              6. distribute-neg-fracN/A

                                \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(2, \left(\frac{\mathsf{neg}\left(4\right)}{b}\right)\right), \left({b}^{2}\right)\right) \]
                              7. /-lowering-/.f64N/A

                                \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(2, \mathsf{/.f64}\left(\left(\mathsf{neg}\left(4\right)\right), b\right)\right), \left({b}^{2}\right)\right) \]
                              8. metadata-evalN/A

                                \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(2, \mathsf{/.f64}\left(-4, b\right)\right), \left({b}^{2}\right)\right) \]
                              9. unpow2N/A

                                \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(2, \mathsf{/.f64}\left(-4, b\right)\right), \left(b \cdot \color{blue}{b}\right)\right) \]
                              10. *-lowering-*.f6465.6%

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

                              \[\leadsto \color{blue}{\frac{2 + \frac{-4}{b}}{b \cdot b}} \]
                            12. Taylor expanded in b around 0

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

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

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

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

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

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

                                \[\leadsto \mathsf{/.f64}\left(-4, \mathsf{*.f64}\left(b, \mathsf{*.f64}\left(b, \color{blue}{b}\right)\right)\right) \]
                            14. Simplified95.7%

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

                          Alternative 9: 75.4% accurate, 13.8× speedup?

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

                            1. Initial program 100.0%

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

                              \[\leadsto \mathsf{/.f64}\left(\mathsf{exp.f64}\left(a\right), \color{blue}{\left(1 + \left(e^{b} + a \cdot \left(1 + a \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot a\right)\right)\right)\right)}\right) \]
                            4. Step-by-step derivation
                              1. associate-+r+N/A

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

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

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

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

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

                                \[\leadsto \mathsf{/.f64}\left(\mathsf{exp.f64}\left(a\right), \mathsf{+.f64}\left(\mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(b\right)\right), \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(1, \color{blue}{\left(a \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot a\right)\right)}\right)\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{exp.f64}\left(b\right)\right), \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(a, \color{blue}{\left(\frac{1}{2} + \frac{1}{6} \cdot a\right)}\right)\right)\right)\right)\right) \]
                              8. +-lowering-+.f64N/A

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

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

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

                              \[\leadsto \frac{e^{a}}{\color{blue}{\left(1 + e^{b}\right) + a \cdot \left(1 + a \cdot \left(0.5 + a \cdot 0.16666666666666666\right)\right)}} \]
                            6. Taylor expanded in a around 0

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

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

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

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

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

                                \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(\frac{1}{2}, \left(\frac{1}{6} \cdot a\right)\right)\right)\right)\right)\right), \mathsf{+.f64}\left(\mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(b\right)\right), \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(a, \frac{1}{6}\right)\right)\right)\right)\right)\right)\right) \]
                              6. *-lowering-*.f6498.0%

                                \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\frac{1}{6}, a\right)\right)\right)\right)\right)\right), \mathsf{+.f64}\left(\mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(b\right)\right), \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(a, \frac{1}{6}\right)\right)\right)\right)\right)\right)\right) \]
                            8. Simplified98.0%

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

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

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

                              if -0.060999999999999999 < b < 350

                              1. Initial program 99.3%

                                \[\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. Simplified97.5%

                                  \[\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. *-lowering-*.f6463.4%

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

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

                                if 350 < b < 1.08e80

                                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. Simplified35.5%

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

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

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

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

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

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

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

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

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

                                    \[\leadsto \color{blue}{\frac{-1}{48} \cdot {a}^{3}} \]
                                  6. Step-by-step derivation
                                    1. unpow3N/A

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

                                      \[\leadsto \frac{-1}{48} \cdot \left({a}^{2} \cdot a\right) \]
                                    3. associate-*r*N/A

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

                                      \[\leadsto a \cdot \color{blue}{\left(\frac{-1}{48} \cdot {a}^{2}\right)} \]
                                    5. *-lowering-*.f64N/A

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

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

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

                                      \[\leadsto \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(\left(a \cdot a\right), \frac{-1}{48}\right)\right) \]
                                    9. *-lowering-*.f6435.7%

                                      \[\leadsto \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(\mathsf{*.f64}\left(a, a\right), \frac{-1}{48}\right)\right) \]
                                  7. Simplified35.7%

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

                                  if 1.08e80 < b

                                  1. Initial program 97.7%

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

                                    \[\leadsto \color{blue}{\frac{1}{1 + e^{b}}} \]
                                  4. Step-by-step derivation
                                    1. /-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 + \frac{1}{2} \cdot b\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 + \frac{1}{2} \cdot b\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 + \frac{1}{2} \cdot b\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(\frac{1}{2} \cdot b\right)}\right)\right)\right)\right) \]
                                    4. *-lowering-*.f6465.6%

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

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

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

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

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

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

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

                                      \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(2, \left(\mathsf{neg}\left(\frac{4}{b}\right)\right)\right), \left({b}^{2}\right)\right) \]
                                    6. distribute-neg-fracN/A

                                      \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(2, \left(\frac{\mathsf{neg}\left(4\right)}{b}\right)\right), \left({b}^{2}\right)\right) \]
                                    7. /-lowering-/.f64N/A

                                      \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(2, \mathsf{/.f64}\left(\left(\mathsf{neg}\left(4\right)\right), b\right)\right), \left({b}^{2}\right)\right) \]
                                    8. metadata-evalN/A

                                      \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(2, \mathsf{/.f64}\left(-4, b\right)\right), \left({b}^{2}\right)\right) \]
                                    9. unpow2N/A

                                      \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(2, \mathsf{/.f64}\left(-4, b\right)\right), \left(b \cdot \color{blue}{b}\right)\right) \]
                                    10. *-lowering-*.f6465.6%

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

                                    \[\leadsto \color{blue}{\frac{2 + \frac{-4}{b}}{b \cdot b}} \]
                                  12. Taylor expanded in b around 0

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

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

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

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

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

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

                                      \[\leadsto \mathsf{/.f64}\left(-4, \mathsf{*.f64}\left(b, \mathsf{*.f64}\left(b, \color{blue}{b}\right)\right)\right) \]
                                  14. Simplified95.7%

                                    \[\leadsto \color{blue}{\frac{-4}{b \cdot \left(b \cdot b\right)}} \]
                                5. Recombined 4 regimes into one program.
                                6. Final simplification73.8%

                                  \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -0.061:\\ \;\;\;\;1\\ \mathbf{elif}\;b \leq 350:\\ \;\;\;\;0.5 + a \cdot 0.25\\ \mathbf{elif}\;b \leq 1.08 \cdot 10^{+80}:\\ \;\;\;\;a \cdot \left(\left(a \cdot a\right) \cdot -0.020833333333333332\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{-4}{b \cdot \left(b \cdot b\right)}\\ \end{array} \]
                                7. Add Preprocessing

                                Alternative 10: 73.4% accurate, 13.8× speedup?

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

                                  1. Initial program 100.0%

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

                                    \[\leadsto \mathsf{/.f64}\left(\mathsf{exp.f64}\left(a\right), \color{blue}{\left(1 + \left(e^{b} + a \cdot \left(1 + a \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot a\right)\right)\right)\right)}\right) \]
                                  4. Step-by-step derivation
                                    1. associate-+r+N/A

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

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

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

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

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

                                      \[\leadsto \mathsf{/.f64}\left(\mathsf{exp.f64}\left(a\right), \mathsf{+.f64}\left(\mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(b\right)\right), \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(1, \color{blue}{\left(a \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot a\right)\right)}\right)\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{exp.f64}\left(b\right)\right), \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(a, \color{blue}{\left(\frac{1}{2} + \frac{1}{6} \cdot a\right)}\right)\right)\right)\right)\right) \]
                                    8. +-lowering-+.f64N/A

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

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

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

                                    \[\leadsto \frac{e^{a}}{\color{blue}{\left(1 + e^{b}\right) + a \cdot \left(1 + a \cdot \left(0.5 + a \cdot 0.16666666666666666\right)\right)}} \]
                                  6. Taylor expanded in a around 0

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

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

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

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

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

                                      \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(\frac{1}{2}, \left(\frac{1}{6} \cdot a\right)\right)\right)\right)\right)\right), \mathsf{+.f64}\left(\mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(b\right)\right), \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(a, \frac{1}{6}\right)\right)\right)\right)\right)\right)\right) \]
                                    6. *-lowering-*.f6498.0%

                                      \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\frac{1}{6}, a\right)\right)\right)\right)\right)\right), \mathsf{+.f64}\left(\mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(b\right)\right), \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(a, \frac{1}{6}\right)\right)\right)\right)\right)\right)\right) \]
                                  8. Simplified98.0%

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

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

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

                                    if -0.0749999999999999972 < b < 410

                                    1. Initial program 99.3%

                                      \[\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. Simplified97.5%

                                        \[\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. *-lowering-*.f6463.4%

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

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

                                      if 410 < b < 1.8499999999999999e151

                                      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. Simplified33.2%

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

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

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

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

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

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

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

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

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

                                          \[\leadsto \color{blue}{\frac{-1}{48} \cdot {a}^{3}} \]
                                        6. Step-by-step derivation
                                          1. unpow3N/A

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

                                            \[\leadsto \frac{-1}{48} \cdot \left({a}^{2} \cdot a\right) \]
                                          3. associate-*r*N/A

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

                                            \[\leadsto a \cdot \color{blue}{\left(\frac{-1}{48} \cdot {a}^{2}\right)} \]
                                          5. *-lowering-*.f64N/A

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

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

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

                                            \[\leadsto \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(\left(a \cdot a\right), \frac{-1}{48}\right)\right) \]
                                          9. *-lowering-*.f6438.9%

                                            \[\leadsto \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(\mathsf{*.f64}\left(a, a\right), \frac{-1}{48}\right)\right) \]
                                        7. Simplified38.9%

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

                                        if 1.8499999999999999e151 < b

                                        1. Initial program 96.6%

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

                                          \[\leadsto \color{blue}{\frac{1}{1 + e^{b}}} \]
                                        4. Step-by-step derivation
                                          1. /-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 + \frac{1}{2} \cdot b\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 + \frac{1}{2} \cdot b\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 + \frac{1}{2} \cdot b\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(\frac{1}{2} \cdot b\right)}\right)\right)\right)\right) \]
                                          4. *-lowering-*.f6494.0%

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

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

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

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

                                            \[\leadsto \mathsf{/.f64}\left(2, \left(b \cdot \color{blue}{b}\right)\right) \]
                                          3. *-lowering-*.f6494.0%

                                            \[\leadsto \mathsf{/.f64}\left(2, \mathsf{*.f64}\left(b, \color{blue}{b}\right)\right) \]
                                        11. Simplified94.0%

                                          \[\leadsto \color{blue}{\frac{2}{b \cdot b}} \]
                                      5. Recombined 4 regimes into one program.
                                      6. Final simplification70.7%

                                        \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -0.075:\\ \;\;\;\;1\\ \mathbf{elif}\;b \leq 410:\\ \;\;\;\;0.5 + a \cdot 0.25\\ \mathbf{elif}\;b \leq 1.85 \cdot 10^{+151}:\\ \;\;\;\;a \cdot \left(\left(a \cdot a\right) \cdot -0.020833333333333332\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{b \cdot b}\\ \end{array} \]
                                      7. Add Preprocessing

                                      Alternative 11: 73.0% accurate, 15.2× speedup?

                                      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq -1.55:\\ \;\;\;\;1\\ \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 -1.55)
                                         1.0
                                         (/ 1.0 (+ 2.0 (* b (+ 1.0 (* b (+ 0.5 (* b 0.16666666666666666)))))))))
                                      double code(double a, double b) {
                                      	double tmp;
                                      	if (b <= -1.55) {
                                      		tmp = 1.0;
                                      	} 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 <= (-1.55d0)) then
                                              tmp = 1.0d0
                                          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 <= -1.55) {
                                      		tmp = 1.0;
                                      	} 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 <= -1.55:
                                      		tmp = 1.0
                                      	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 <= -1.55)
                                      		tmp = 1.0;
                                      	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 <= -1.55)
                                      		tmp = 1.0;
                                      	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, -1.55], 1.0, 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 -1.55:\\
                                      \;\;\;\;1\\
                                      
                                      \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 2 regimes
                                      2. if b < -1.55000000000000004

                                        1. Initial program 100.0%

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

                                          \[\leadsto \mathsf{/.f64}\left(\mathsf{exp.f64}\left(a\right), \color{blue}{\left(1 + \left(e^{b} + a \cdot \left(1 + a \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot a\right)\right)\right)\right)}\right) \]
                                        4. Step-by-step derivation
                                          1. associate-+r+N/A

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

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

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

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

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

                                            \[\leadsto \mathsf{/.f64}\left(\mathsf{exp.f64}\left(a\right), \mathsf{+.f64}\left(\mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(b\right)\right), \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(1, \color{blue}{\left(a \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot a\right)\right)}\right)\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{exp.f64}\left(b\right)\right), \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(a, \color{blue}{\left(\frac{1}{2} + \frac{1}{6} \cdot a\right)}\right)\right)\right)\right)\right) \]
                                          8. +-lowering-+.f64N/A

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

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

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

                                          \[\leadsto \frac{e^{a}}{\color{blue}{\left(1 + e^{b}\right) + a \cdot \left(1 + a \cdot \left(0.5 + a \cdot 0.16666666666666666\right)\right)}} \]
                                        6. Taylor expanded in a around 0

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

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

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

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

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

                                            \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(\frac{1}{2}, \left(\frac{1}{6} \cdot a\right)\right)\right)\right)\right)\right), \mathsf{+.f64}\left(\mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(b\right)\right), \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(a, \frac{1}{6}\right)\right)\right)\right)\right)\right)\right) \]
                                          6. *-lowering-*.f64100.0%

                                            \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\frac{1}{6}, a\right)\right)\right)\right)\right)\right), \mathsf{+.f64}\left(\mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(b\right)\right), \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(a, \frac{1}{6}\right)\right)\right)\right)\right)\right)\right) \]
                                        8. Simplified100.0%

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

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

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

                                          if -1.55000000000000004 < b

                                          1. Initial program 99.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.f6473.7%

                                              \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(b\right)\right)\right) \]
                                          5. Simplified73.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-*.f6465.4%

                                              \[\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. Simplified65.4%

                                            \[\leadsto \frac{1}{\color{blue}{2 + b \cdot \left(1 + b \cdot \left(0.5 + b \cdot 0.16666666666666666\right)\right)}} \]
                                        11. Recombined 2 regimes into one program.
                                        12. Add Preprocessing

                                        Alternative 12: 68.2% accurate, 20.3× speedup?

                                        \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq -0.061:\\ \;\;\;\;1\\ \mathbf{elif}\;b \leq 1.75:\\ \;\;\;\;0.5 + a \cdot 0.25\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{b \cdot b}\\ \end{array} \end{array} \]
                                        (FPCore (a b)
                                         :precision binary64
                                         (if (<= b -0.061) 1.0 (if (<= b 1.75) (+ 0.5 (* a 0.25)) (/ 2.0 (* b b)))))
                                        double code(double a, double b) {
                                        	double tmp;
                                        	if (b <= -0.061) {
                                        		tmp = 1.0;
                                        	} else if (b <= 1.75) {
                                        		tmp = 0.5 + (a * 0.25);
                                        	} else {
                                        		tmp = 2.0 / (b * b);
                                        	}
                                        	return tmp;
                                        }
                                        
                                        real(8) function code(a, b)
                                            real(8), intent (in) :: a
                                            real(8), intent (in) :: b
                                            real(8) :: tmp
                                            if (b <= (-0.061d0)) then
                                                tmp = 1.0d0
                                            else if (b <= 1.75d0) then
                                                tmp = 0.5d0 + (a * 0.25d0)
                                            else
                                                tmp = 2.0d0 / (b * b)
                                            end if
                                            code = tmp
                                        end function
                                        
                                        public static double code(double a, double b) {
                                        	double tmp;
                                        	if (b <= -0.061) {
                                        		tmp = 1.0;
                                        	} else if (b <= 1.75) {
                                        		tmp = 0.5 + (a * 0.25);
                                        	} else {
                                        		tmp = 2.0 / (b * b);
                                        	}
                                        	return tmp;
                                        }
                                        
                                        def code(a, b):
                                        	tmp = 0
                                        	if b <= -0.061:
                                        		tmp = 1.0
                                        	elif b <= 1.75:
                                        		tmp = 0.5 + (a * 0.25)
                                        	else:
                                        		tmp = 2.0 / (b * b)
                                        	return tmp
                                        
                                        function code(a, b)
                                        	tmp = 0.0
                                        	if (b <= -0.061)
                                        		tmp = 1.0;
                                        	elseif (b <= 1.75)
                                        		tmp = Float64(0.5 + Float64(a * 0.25));
                                        	else
                                        		tmp = Float64(2.0 / Float64(b * b));
                                        	end
                                        	return tmp
                                        end
                                        
                                        function tmp_2 = code(a, b)
                                        	tmp = 0.0;
                                        	if (b <= -0.061)
                                        		tmp = 1.0;
                                        	elseif (b <= 1.75)
                                        		tmp = 0.5 + (a * 0.25);
                                        	else
                                        		tmp = 2.0 / (b * b);
                                        	end
                                        	tmp_2 = tmp;
                                        end
                                        
                                        code[a_, b_] := If[LessEqual[b, -0.061], 1.0, If[LessEqual[b, 1.75], N[(0.5 + N[(a * 0.25), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(b * b), $MachinePrecision]), $MachinePrecision]]]
                                        
                                        \begin{array}{l}
                                        
                                        \\
                                        \begin{array}{l}
                                        \mathbf{if}\;b \leq -0.061:\\
                                        \;\;\;\;1\\
                                        
                                        \mathbf{elif}\;b \leq 1.75:\\
                                        \;\;\;\;0.5 + a \cdot 0.25\\
                                        
                                        \mathbf{else}:\\
                                        \;\;\;\;\frac{2}{b \cdot b}\\
                                        
                                        
                                        \end{array}
                                        \end{array}
                                        
                                        Derivation
                                        1. Split input into 3 regimes
                                        2. if b < -0.060999999999999999

                                          1. Initial program 100.0%

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

                                            \[\leadsto \mathsf{/.f64}\left(\mathsf{exp.f64}\left(a\right), \color{blue}{\left(1 + \left(e^{b} + a \cdot \left(1 + a \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot a\right)\right)\right)\right)}\right) \]
                                          4. Step-by-step derivation
                                            1. associate-+r+N/A

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

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

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

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

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

                                              \[\leadsto \mathsf{/.f64}\left(\mathsf{exp.f64}\left(a\right), \mathsf{+.f64}\left(\mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(b\right)\right), \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(1, \color{blue}{\left(a \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot a\right)\right)}\right)\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{exp.f64}\left(b\right)\right), \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(a, \color{blue}{\left(\frac{1}{2} + \frac{1}{6} \cdot a\right)}\right)\right)\right)\right)\right) \]
                                            8. +-lowering-+.f64N/A

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

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

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

                                            \[\leadsto \frac{e^{a}}{\color{blue}{\left(1 + e^{b}\right) + a \cdot \left(1 + a \cdot \left(0.5 + a \cdot 0.16666666666666666\right)\right)}} \]
                                          6. Taylor expanded in a around 0

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

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

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

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

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

                                              \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(\frac{1}{2}, \left(\frac{1}{6} \cdot a\right)\right)\right)\right)\right)\right), \mathsf{+.f64}\left(\mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(b\right)\right), \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(a, \frac{1}{6}\right)\right)\right)\right)\right)\right)\right) \]
                                            6. *-lowering-*.f6498.0%

                                              \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\frac{1}{6}, a\right)\right)\right)\right)\right)\right), \mathsf{+.f64}\left(\mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(b\right)\right), \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(a, \frac{1}{6}\right)\right)\right)\right)\right)\right)\right) \]
                                          8. Simplified98.0%

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

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

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

                                            if -0.060999999999999999 < b < 1.75

                                            1. Initial program 99.3%

                                              \[\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. Simplified97.5%

                                                \[\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. *-lowering-*.f6463.4%

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

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

                                              if 1.75 < b

                                              1. Initial program 98.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.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 + \frac{1}{2} \cdot b\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 + \frac{1}{2} \cdot b\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 + \frac{1}{2} \cdot b\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(\frac{1}{2} \cdot b\right)}\right)\right)\right)\right) \]
                                                4. *-lowering-*.f6449.6%

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

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

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

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

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

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

                                                \[\leadsto \color{blue}{\frac{2}{b \cdot b}} \]
                                            5. Recombined 3 regimes into one program.
                                            6. Final simplification66.9%

                                              \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -0.061:\\ \;\;\;\;1\\ \mathbf{elif}\;b \leq 1.75:\\ \;\;\;\;0.5 + a \cdot 0.25\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{b \cdot b}\\ \end{array} \]
                                            7. Add Preprocessing

                                            Alternative 13: 55.7% accurate, 30.5× speedup?

                                            \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq -0.95:\\ \;\;\;\;1\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{b + 2}\\ \end{array} \end{array} \]
                                            (FPCore (a b) :precision binary64 (if (<= b -0.95) 1.0 (/ 1.0 (+ b 2.0))))
                                            double code(double a, double b) {
                                            	double tmp;
                                            	if (b <= -0.95) {
                                            		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 <= (-0.95d0)) 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 <= -0.95) {
                                            		tmp = 1.0;
                                            	} else {
                                            		tmp = 1.0 / (b + 2.0);
                                            	}
                                            	return tmp;
                                            }
                                            
                                            def code(a, b):
                                            	tmp = 0
                                            	if b <= -0.95:
                                            		tmp = 1.0
                                            	else:
                                            		tmp = 1.0 / (b + 2.0)
                                            	return tmp
                                            
                                            function code(a, b)
                                            	tmp = 0.0
                                            	if (b <= -0.95)
                                            		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 <= -0.95)
                                            		tmp = 1.0;
                                            	else
                                            		tmp = 1.0 / (b + 2.0);
                                            	end
                                            	tmp_2 = tmp;
                                            end
                                            
                                            code[a_, b_] := If[LessEqual[b, -0.95], 1.0, N[(1.0 / N[(b + 2.0), $MachinePrecision]), $MachinePrecision]]
                                            
                                            \begin{array}{l}
                                            
                                            \\
                                            \begin{array}{l}
                                            \mathbf{if}\;b \leq -0.95:\\
                                            \;\;\;\;1\\
                                            
                                            \mathbf{else}:\\
                                            \;\;\;\;\frac{1}{b + 2}\\
                                            
                                            
                                            \end{array}
                                            \end{array}
                                            
                                            Derivation
                                            1. Split input into 2 regimes
                                            2. if b < -0.94999999999999996

                                              1. Initial program 100.0%

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

                                                \[\leadsto \mathsf{/.f64}\left(\mathsf{exp.f64}\left(a\right), \color{blue}{\left(1 + \left(e^{b} + a \cdot \left(1 + a \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot a\right)\right)\right)\right)}\right) \]
                                              4. Step-by-step derivation
                                                1. associate-+r+N/A

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

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

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

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

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

                                                  \[\leadsto \mathsf{/.f64}\left(\mathsf{exp.f64}\left(a\right), \mathsf{+.f64}\left(\mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(b\right)\right), \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(1, \color{blue}{\left(a \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot a\right)\right)}\right)\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{exp.f64}\left(b\right)\right), \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(a, \color{blue}{\left(\frac{1}{2} + \frac{1}{6} \cdot a\right)}\right)\right)\right)\right)\right) \]
                                                8. +-lowering-+.f64N/A

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

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

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

                                                \[\leadsto \frac{e^{a}}{\color{blue}{\left(1 + e^{b}\right) + a \cdot \left(1 + a \cdot \left(0.5 + a \cdot 0.16666666666666666\right)\right)}} \]
                                              6. Taylor expanded in a around 0

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

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

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

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

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

                                                  \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(\frac{1}{2}, \left(\frac{1}{6} \cdot a\right)\right)\right)\right)\right)\right), \mathsf{+.f64}\left(\mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(b\right)\right), \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(a, \frac{1}{6}\right)\right)\right)\right)\right)\right)\right) \]
                                                6. *-lowering-*.f64100.0%

                                                  \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\frac{1}{6}, a\right)\right)\right)\right)\right)\right), \mathsf{+.f64}\left(\mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(b\right)\right), \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(a, \frac{1}{6}\right)\right)\right)\right)\right)\right)\right) \]
                                              8. Simplified100.0%

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

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

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

                                                if -0.94999999999999996 < b

                                                1. Initial program 99.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.f6473.7%

                                                    \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(b\right)\right)\right) \]
                                                5. Simplified73.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\right)}\right) \]
                                                7. Step-by-step derivation
                                                  1. +-commutativeN/A

                                                    \[\leadsto \mathsf{/.f64}\left(1, \left(b + \color{blue}{2}\right)\right) \]
                                                  2. +-lowering-+.f6446.4%

                                                    \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(b, \color{blue}{2}\right)\right) \]
                                                8. Simplified46.4%

                                                  \[\leadsto \frac{1}{\color{blue}{b + 2}} \]
                                              11. Recombined 2 regimes into one program.
                                              12. Add Preprocessing

                                              Alternative 14: 54.9% accurate, 30.5× speedup?

                                              \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq -0.075:\\ \;\;\;\;1\\ \mathbf{else}:\\ \;\;\;\;0.5 + a \cdot 0.25\\ \end{array} \end{array} \]
                                              (FPCore (a b) :precision binary64 (if (<= b -0.075) 1.0 (+ 0.5 (* a 0.25))))
                                              double code(double a, double b) {
                                              	double tmp;
                                              	if (b <= -0.075) {
                                              		tmp = 1.0;
                                              	} else {
                                              		tmp = 0.5 + (a * 0.25);
                                              	}
                                              	return tmp;
                                              }
                                              
                                              real(8) function code(a, b)
                                                  real(8), intent (in) :: a
                                                  real(8), intent (in) :: b
                                                  real(8) :: tmp
                                                  if (b <= (-0.075d0)) then
                                                      tmp = 1.0d0
                                                  else
                                                      tmp = 0.5d0 + (a * 0.25d0)
                                                  end if
                                                  code = tmp
                                              end function
                                              
                                              public static double code(double a, double b) {
                                              	double tmp;
                                              	if (b <= -0.075) {
                                              		tmp = 1.0;
                                              	} else {
                                              		tmp = 0.5 + (a * 0.25);
                                              	}
                                              	return tmp;
                                              }
                                              
                                              def code(a, b):
                                              	tmp = 0
                                              	if b <= -0.075:
                                              		tmp = 1.0
                                              	else:
                                              		tmp = 0.5 + (a * 0.25)
                                              	return tmp
                                              
                                              function code(a, b)
                                              	tmp = 0.0
                                              	if (b <= -0.075)
                                              		tmp = 1.0;
                                              	else
                                              		tmp = Float64(0.5 + Float64(a * 0.25));
                                              	end
                                              	return tmp
                                              end
                                              
                                              function tmp_2 = code(a, b)
                                              	tmp = 0.0;
                                              	if (b <= -0.075)
                                              		tmp = 1.0;
                                              	else
                                              		tmp = 0.5 + (a * 0.25);
                                              	end
                                              	tmp_2 = tmp;
                                              end
                                              
                                              code[a_, b_] := If[LessEqual[b, -0.075], 1.0, N[(0.5 + N[(a * 0.25), $MachinePrecision]), $MachinePrecision]]
                                              
                                              \begin{array}{l}
                                              
                                              \\
                                              \begin{array}{l}
                                              \mathbf{if}\;b \leq -0.075:\\
                                              \;\;\;\;1\\
                                              
                                              \mathbf{else}:\\
                                              \;\;\;\;0.5 + a \cdot 0.25\\
                                              
                                              
                                              \end{array}
                                              \end{array}
                                              
                                              Derivation
                                              1. Split input into 2 regimes
                                              2. if b < -0.0749999999999999972

                                                1. Initial program 100.0%

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

                                                  \[\leadsto \mathsf{/.f64}\left(\mathsf{exp.f64}\left(a\right), \color{blue}{\left(1 + \left(e^{b} + a \cdot \left(1 + a \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot a\right)\right)\right)\right)}\right) \]
                                                4. Step-by-step derivation
                                                  1. associate-+r+N/A

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

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

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

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

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

                                                    \[\leadsto \mathsf{/.f64}\left(\mathsf{exp.f64}\left(a\right), \mathsf{+.f64}\left(\mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(b\right)\right), \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(1, \color{blue}{\left(a \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot a\right)\right)}\right)\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{exp.f64}\left(b\right)\right), \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(a, \color{blue}{\left(\frac{1}{2} + \frac{1}{6} \cdot a\right)}\right)\right)\right)\right)\right) \]
                                                  8. +-lowering-+.f64N/A

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

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

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

                                                  \[\leadsto \frac{e^{a}}{\color{blue}{\left(1 + e^{b}\right) + a \cdot \left(1 + a \cdot \left(0.5 + a \cdot 0.16666666666666666\right)\right)}} \]
                                                6. Taylor expanded in a around 0

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

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

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

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

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

                                                    \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(\frac{1}{2}, \left(\frac{1}{6} \cdot a\right)\right)\right)\right)\right)\right), \mathsf{+.f64}\left(\mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(b\right)\right), \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(a, \frac{1}{6}\right)\right)\right)\right)\right)\right)\right) \]
                                                  6. *-lowering-*.f6498.0%

                                                    \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\frac{1}{6}, a\right)\right)\right)\right)\right)\right), \mathsf{+.f64}\left(\mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(b\right)\right), \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(a, \frac{1}{6}\right)\right)\right)\right)\right)\right)\right) \]
                                                8. Simplified98.0%

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

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

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

                                                  if -0.0749999999999999972 < b

                                                  1. Initial program 99.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. Simplified79.4%

                                                      \[\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. *-lowering-*.f6446.4%

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

                                                      \[\leadsto \color{blue}{0.5 + 0.25 \cdot a} \]
                                                  5. Recombined 2 regimes into one program.
                                                  6. Final simplification56.3%

                                                    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -0.075:\\ \;\;\;\;1\\ \mathbf{else}:\\ \;\;\;\;0.5 + a \cdot 0.25\\ \end{array} \]
                                                  7. Add Preprocessing

                                                  Alternative 15: 55.0% accurate, 30.5× speedup?

                                                  \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq -1.8:\\ \;\;\;\;1\\ \mathbf{else}:\\ \;\;\;\;0.5 + b \cdot -0.25\\ \end{array} \end{array} \]
                                                  (FPCore (a b) :precision binary64 (if (<= b -1.8) 1.0 (+ 0.5 (* b -0.25))))
                                                  double code(double a, double b) {
                                                  	double tmp;
                                                  	if (b <= -1.8) {
                                                  		tmp = 1.0;
                                                  	} else {
                                                  		tmp = 0.5 + (b * -0.25);
                                                  	}
                                                  	return tmp;
                                                  }
                                                  
                                                  real(8) function code(a, b)
                                                      real(8), intent (in) :: a
                                                      real(8), intent (in) :: b
                                                      real(8) :: tmp
                                                      if (b <= (-1.8d0)) then
                                                          tmp = 1.0d0
                                                      else
                                                          tmp = 0.5d0 + (b * (-0.25d0))
                                                      end if
                                                      code = tmp
                                                  end function
                                                  
                                                  public static double code(double a, double b) {
                                                  	double tmp;
                                                  	if (b <= -1.8) {
                                                  		tmp = 1.0;
                                                  	} else {
                                                  		tmp = 0.5 + (b * -0.25);
                                                  	}
                                                  	return tmp;
                                                  }
                                                  
                                                  def code(a, b):
                                                  	tmp = 0
                                                  	if b <= -1.8:
                                                  		tmp = 1.0
                                                  	else:
                                                  		tmp = 0.5 + (b * -0.25)
                                                  	return tmp
                                                  
                                                  function code(a, b)
                                                  	tmp = 0.0
                                                  	if (b <= -1.8)
                                                  		tmp = 1.0;
                                                  	else
                                                  		tmp = Float64(0.5 + Float64(b * -0.25));
                                                  	end
                                                  	return tmp
                                                  end
                                                  
                                                  function tmp_2 = code(a, b)
                                                  	tmp = 0.0;
                                                  	if (b <= -1.8)
                                                  		tmp = 1.0;
                                                  	else
                                                  		tmp = 0.5 + (b * -0.25);
                                                  	end
                                                  	tmp_2 = tmp;
                                                  end
                                                  
                                                  code[a_, b_] := If[LessEqual[b, -1.8], 1.0, N[(0.5 + N[(b * -0.25), $MachinePrecision]), $MachinePrecision]]
                                                  
                                                  \begin{array}{l}
                                                  
                                                  \\
                                                  \begin{array}{l}
                                                  \mathbf{if}\;b \leq -1.8:\\
                                                  \;\;\;\;1\\
                                                  
                                                  \mathbf{else}:\\
                                                  \;\;\;\;0.5 + b \cdot -0.25\\
                                                  
                                                  
                                                  \end{array}
                                                  \end{array}
                                                  
                                                  Derivation
                                                  1. Split input into 2 regimes
                                                  2. if b < -1.80000000000000004

                                                    1. Initial program 100.0%

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

                                                      \[\leadsto \mathsf{/.f64}\left(\mathsf{exp.f64}\left(a\right), \color{blue}{\left(1 + \left(e^{b} + a \cdot \left(1 + a \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot a\right)\right)\right)\right)}\right) \]
                                                    4. Step-by-step derivation
                                                      1. associate-+r+N/A

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

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

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

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

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

                                                        \[\leadsto \mathsf{/.f64}\left(\mathsf{exp.f64}\left(a\right), \mathsf{+.f64}\left(\mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(b\right)\right), \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(1, \color{blue}{\left(a \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot a\right)\right)}\right)\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{exp.f64}\left(b\right)\right), \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(a, \color{blue}{\left(\frac{1}{2} + \frac{1}{6} \cdot a\right)}\right)\right)\right)\right)\right) \]
                                                      8. +-lowering-+.f64N/A

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

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

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

                                                      \[\leadsto \frac{e^{a}}{\color{blue}{\left(1 + e^{b}\right) + a \cdot \left(1 + a \cdot \left(0.5 + a \cdot 0.16666666666666666\right)\right)}} \]
                                                    6. Taylor expanded in a around 0

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

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

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

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

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

                                                        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(\frac{1}{2}, \left(\frac{1}{6} \cdot a\right)\right)\right)\right)\right)\right), \mathsf{+.f64}\left(\mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(b\right)\right), \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(a, \frac{1}{6}\right)\right)\right)\right)\right)\right)\right) \]
                                                      6. *-lowering-*.f64100.0%

                                                        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\frac{1}{6}, a\right)\right)\right)\right)\right)\right), \mathsf{+.f64}\left(\mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(b\right)\right), \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(a, \frac{1}{6}\right)\right)\right)\right)\right)\right)\right) \]
                                                    8. Simplified100.0%

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

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

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

                                                      if -1.80000000000000004 < b

                                                      1. Initial program 99.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.f6473.7%

                                                          \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(b\right)\right)\right) \]
                                                      5. Simplified73.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. *-lowering-*.f6445.8%

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

                                                        \[\leadsto \color{blue}{0.5 + -0.25 \cdot b} \]
                                                    11. Recombined 2 regimes into one program.
                                                    12. Final simplification56.0%

                                                      \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -1.8:\\ \;\;\;\;1\\ \mathbf{else}:\\ \;\;\;\;0.5 + b \cdot -0.25\\ \end{array} \]
                                                    13. Add Preprocessing

                                                    Alternative 16: 54.7% accurate, 50.7× speedup?

                                                    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq -0.94:\\ \;\;\;\;1\\ \mathbf{else}:\\ \;\;\;\;0.5\\ \end{array} \end{array} \]
                                                    (FPCore (a b) :precision binary64 (if (<= b -0.94) 1.0 0.5))
                                                    double code(double a, double b) {
                                                    	double tmp;
                                                    	if (b <= -0.94) {
                                                    		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 <= (-0.94d0)) 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 <= -0.94) {
                                                    		tmp = 1.0;
                                                    	} else {
                                                    		tmp = 0.5;
                                                    	}
                                                    	return tmp;
                                                    }
                                                    
                                                    def code(a, b):
                                                    	tmp = 0
                                                    	if b <= -0.94:
                                                    		tmp = 1.0
                                                    	else:
                                                    		tmp = 0.5
                                                    	return tmp
                                                    
                                                    function code(a, b)
                                                    	tmp = 0.0
                                                    	if (b <= -0.94)
                                                    		tmp = 1.0;
                                                    	else
                                                    		tmp = 0.5;
                                                    	end
                                                    	return tmp
                                                    end
                                                    
                                                    function tmp_2 = code(a, b)
                                                    	tmp = 0.0;
                                                    	if (b <= -0.94)
                                                    		tmp = 1.0;
                                                    	else
                                                    		tmp = 0.5;
                                                    	end
                                                    	tmp_2 = tmp;
                                                    end
                                                    
                                                    code[a_, b_] := If[LessEqual[b, -0.94], 1.0, 0.5]
                                                    
                                                    \begin{array}{l}
                                                    
                                                    \\
                                                    \begin{array}{l}
                                                    \mathbf{if}\;b \leq -0.94:\\
                                                    \;\;\;\;1\\
                                                    
                                                    \mathbf{else}:\\
                                                    \;\;\;\;0.5\\
                                                    
                                                    
                                                    \end{array}
                                                    \end{array}
                                                    
                                                    Derivation
                                                    1. Split input into 2 regimes
                                                    2. if b < -0.93999999999999995

                                                      1. Initial program 100.0%

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

                                                        \[\leadsto \mathsf{/.f64}\left(\mathsf{exp.f64}\left(a\right), \color{blue}{\left(1 + \left(e^{b} + a \cdot \left(1 + a \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot a\right)\right)\right)\right)}\right) \]
                                                      4. Step-by-step derivation
                                                        1. associate-+r+N/A

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

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

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

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

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

                                                          \[\leadsto \mathsf{/.f64}\left(\mathsf{exp.f64}\left(a\right), \mathsf{+.f64}\left(\mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(b\right)\right), \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(1, \color{blue}{\left(a \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot a\right)\right)}\right)\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{exp.f64}\left(b\right)\right), \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(a, \color{blue}{\left(\frac{1}{2} + \frac{1}{6} \cdot a\right)}\right)\right)\right)\right)\right) \]
                                                        8. +-lowering-+.f64N/A

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

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

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

                                                        \[\leadsto \frac{e^{a}}{\color{blue}{\left(1 + e^{b}\right) + a \cdot \left(1 + a \cdot \left(0.5 + a \cdot 0.16666666666666666\right)\right)}} \]
                                                      6. Taylor expanded in a around 0

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

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

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

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

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

                                                          \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(\frac{1}{2}, \left(\frac{1}{6} \cdot a\right)\right)\right)\right)\right)\right), \mathsf{+.f64}\left(\mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(b\right)\right), \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(a, \frac{1}{6}\right)\right)\right)\right)\right)\right)\right) \]
                                                        6. *-lowering-*.f64100.0%

                                                          \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\frac{1}{6}, a\right)\right)\right)\right)\right)\right), \mathsf{+.f64}\left(\mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(b\right)\right), \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(a, \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(a, \frac{1}{6}\right)\right)\right)\right)\right)\right)\right) \]
                                                      8. Simplified100.0%

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

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

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

                                                        if -0.93999999999999995 < b

                                                        1. Initial program 99.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.f6473.7%

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

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

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

                                                        Alternative 17: 39.7% 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.f6478.6%

                                                            \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(b\right)\right)\right) \]
                                                        5. Simplified78.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. Simplified40.3%

                                                            \[\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 2024192 
                                                          (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))))