Complex division, imag part

Percentage Accurate: 61.1% → 82.6%
Time: 6.7s
Alternatives: 15
Speedup: 1.5×

Specification

?
\[\begin{array}{l} \\ \frac{b \cdot c - a \cdot d}{c \cdot c + d \cdot d} \end{array} \]
(FPCore (a b c d)
 :precision binary64
 (/ (- (* b c) (* a d)) (+ (* c c) (* d d))))
double code(double a, double b, double c, double d) {
	return ((b * c) - (a * d)) / ((c * c) + (d * d));
}
real(8) function code(a, b, c, d)
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: d
    code = ((b * c) - (a * d)) / ((c * c) + (d * d))
end function
public static double code(double a, double b, double c, double d) {
	return ((b * c) - (a * d)) / ((c * c) + (d * d));
}
def code(a, b, c, d):
	return ((b * c) - (a * d)) / ((c * c) + (d * d))
function code(a, b, c, d)
	return Float64(Float64(Float64(b * c) - Float64(a * d)) / Float64(Float64(c * c) + Float64(d * d)))
end
function tmp = code(a, b, c, d)
	tmp = ((b * c) - (a * d)) / ((c * c) + (d * d));
end
code[a_, b_, c_, d_] := N[(N[(N[(b * c), $MachinePrecision] - N[(a * d), $MachinePrecision]), $MachinePrecision] / N[(N[(c * c), $MachinePrecision] + N[(d * d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\frac{b \cdot c - a \cdot d}{c \cdot c + d \cdot d}
\end{array}

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 15 alternatives:

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

Initial Program: 61.1% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \frac{b \cdot c - a \cdot d}{c \cdot c + d \cdot d} \end{array} \]
(FPCore (a b c d)
 :precision binary64
 (/ (- (* b c) (* a d)) (+ (* c c) (* d d))))
double code(double a, double b, double c, double d) {
	return ((b * c) - (a * d)) / ((c * c) + (d * d));
}
real(8) function code(a, b, c, d)
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: d
    code = ((b * c) - (a * d)) / ((c * c) + (d * d))
end function
public static double code(double a, double b, double c, double d) {
	return ((b * c) - (a * d)) / ((c * c) + (d * d));
}
def code(a, b, c, d):
	return ((b * c) - (a * d)) / ((c * c) + (d * d))
function code(a, b, c, d)
	return Float64(Float64(Float64(b * c) - Float64(a * d)) / Float64(Float64(c * c) + Float64(d * d)))
end
function tmp = code(a, b, c, d)
	tmp = ((b * c) - (a * d)) / ((c * c) + (d * d));
end
code[a_, b_, c_, d_] := N[(N[(N[(b * c), $MachinePrecision] - N[(a * d), $MachinePrecision]), $MachinePrecision] / N[(N[(c * c), $MachinePrecision] + N[(d * d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\frac{b \cdot c - a \cdot d}{c \cdot c + d \cdot d}
\end{array}

Alternative 1: 82.6% accurate, 0.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{b \cdot c - d \cdot a}{d \cdot d + c \cdot c}\\ \mathbf{if}\;c \leq -8 \cdot 10^{+101}:\\ \;\;\;\;\frac{b - \left({c}^{-1} \cdot a\right) \cdot d}{c}\\ \mathbf{elif}\;c \leq -9.5 \cdot 10^{-38}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;c \leq 1.22 \cdot 10^{-119}:\\ \;\;\;\;\frac{\frac{b \cdot c}{d} - a}{d}\\ \mathbf{elif}\;c \leq 5.6 \cdot 10^{+75}:\\ \;\;\;\;t\_0\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(\frac{a}{{c}^{4}} \cdot d - \frac{b}{{c}^{3}}, d, \frac{\frac{-a}{c}}{c}\right), d, \frac{b}{c}\right)\\ \end{array} \end{array} \]
(FPCore (a b c d)
 :precision binary64
 (let* ((t_0 (/ (- (* b c) (* d a)) (+ (* d d) (* c c)))))
   (if (<= c -8e+101)
     (/ (- b (* (* (pow c -1.0) a) d)) c)
     (if (<= c -9.5e-38)
       t_0
       (if (<= c 1.22e-119)
         (/ (- (/ (* b c) d) a) d)
         (if (<= c 5.6e+75)
           t_0
           (fma
            (fma
             (- (* (/ a (pow c 4.0)) d) (/ b (pow c 3.0)))
             d
             (/ (/ (- a) c) c))
            d
            (/ b c))))))))
double code(double a, double b, double c, double d) {
	double t_0 = ((b * c) - (d * a)) / ((d * d) + (c * c));
	double tmp;
	if (c <= -8e+101) {
		tmp = (b - ((pow(c, -1.0) * a) * d)) / c;
	} else if (c <= -9.5e-38) {
		tmp = t_0;
	} else if (c <= 1.22e-119) {
		tmp = (((b * c) / d) - a) / d;
	} else if (c <= 5.6e+75) {
		tmp = t_0;
	} else {
		tmp = fma(fma((((a / pow(c, 4.0)) * d) - (b / pow(c, 3.0))), d, ((-a / c) / c)), d, (b / c));
	}
	return tmp;
}
function code(a, b, c, d)
	t_0 = Float64(Float64(Float64(b * c) - Float64(d * a)) / Float64(Float64(d * d) + Float64(c * c)))
	tmp = 0.0
	if (c <= -8e+101)
		tmp = Float64(Float64(b - Float64(Float64((c ^ -1.0) * a) * d)) / c);
	elseif (c <= -9.5e-38)
		tmp = t_0;
	elseif (c <= 1.22e-119)
		tmp = Float64(Float64(Float64(Float64(b * c) / d) - a) / d);
	elseif (c <= 5.6e+75)
		tmp = t_0;
	else
		tmp = fma(fma(Float64(Float64(Float64(a / (c ^ 4.0)) * d) - Float64(b / (c ^ 3.0))), d, Float64(Float64(Float64(-a) / c) / c)), d, Float64(b / c));
	end
	return tmp
end
code[a_, b_, c_, d_] := Block[{t$95$0 = N[(N[(N[(b * c), $MachinePrecision] - N[(d * a), $MachinePrecision]), $MachinePrecision] / N[(N[(d * d), $MachinePrecision] + N[(c * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c, -8e+101], N[(N[(b - N[(N[(N[Power[c, -1.0], $MachinePrecision] * a), $MachinePrecision] * d), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision], If[LessEqual[c, -9.5e-38], t$95$0, If[LessEqual[c, 1.22e-119], N[(N[(N[(N[(b * c), $MachinePrecision] / d), $MachinePrecision] - a), $MachinePrecision] / d), $MachinePrecision], If[LessEqual[c, 5.6e+75], t$95$0, N[(N[(N[(N[(N[(a / N[Power[c, 4.0], $MachinePrecision]), $MachinePrecision] * d), $MachinePrecision] - N[(b / N[Power[c, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * d + N[(N[((-a) / c), $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision] * d + N[(b / c), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \frac{b \cdot c - d \cdot a}{d \cdot d + c \cdot c}\\
\mathbf{if}\;c \leq -8 \cdot 10^{+101}:\\
\;\;\;\;\frac{b - \left({c}^{-1} \cdot a\right) \cdot d}{c}\\

\mathbf{elif}\;c \leq -9.5 \cdot 10^{-38}:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;c \leq 1.22 \cdot 10^{-119}:\\
\;\;\;\;\frac{\frac{b \cdot c}{d} - a}{d}\\

\mathbf{elif}\;c \leq 5.6 \cdot 10^{+75}:\\
\;\;\;\;t\_0\\

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(\frac{a}{{c}^{4}} \cdot d - \frac{b}{{c}^{3}}, d, \frac{\frac{-a}{c}}{c}\right), d, \frac{b}{c}\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if c < -7.9999999999999998e101

    1. Initial program 39.1%

      \[\frac{b \cdot c - a \cdot d}{c \cdot c + d \cdot d} \]
    2. Add Preprocessing
    3. Taylor expanded in c around inf

      \[\leadsto \color{blue}{\frac{b + -1 \cdot \frac{a \cdot d}{c}}{c}} \]
    4. Step-by-step derivation
      1. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{b + -1 \cdot \frac{a \cdot d}{c}}{c}} \]
      2. mul-1-negN/A

        \[\leadsto \frac{b + \color{blue}{\left(\mathsf{neg}\left(\frac{a \cdot d}{c}\right)\right)}}{c} \]
      3. unsub-negN/A

        \[\leadsto \frac{\color{blue}{b - \frac{a \cdot d}{c}}}{c} \]
      4. lower--.f64N/A

        \[\leadsto \frac{\color{blue}{b - \frac{a \cdot d}{c}}}{c} \]
      5. lower-/.f64N/A

        \[\leadsto \frac{b - \color{blue}{\frac{a \cdot d}{c}}}{c} \]
      6. lower-*.f6480.9

        \[\leadsto \frac{b - \frac{\color{blue}{a \cdot d}}{c}}{c} \]
    5. Applied rewrites80.9%

      \[\leadsto \color{blue}{\frac{b - \frac{a \cdot d}{c}}{c}} \]
    6. Step-by-step derivation
      1. Applied rewrites86.1%

        \[\leadsto \frac{b - d \cdot \left(a \cdot {c}^{-1}\right)}{c} \]

      if -7.9999999999999998e101 < c < -9.5000000000000009e-38 or 1.22e-119 < c < 5.60000000000000023e75

      1. Initial program 86.7%

        \[\frac{b \cdot c - a \cdot d}{c \cdot c + d \cdot d} \]
      2. Add Preprocessing

      if -9.5000000000000009e-38 < c < 1.22e-119

      1. Initial program 71.3%

        \[\frac{b \cdot c - a \cdot d}{c \cdot c + d \cdot d} \]
      2. Add Preprocessing
      3. Taylor expanded in c around 0

        \[\leadsto \color{blue}{-1 \cdot \frac{a}{d} + \frac{b \cdot c}{{d}^{2}}} \]
      4. Step-by-step derivation
        1. +-commutativeN/A

          \[\leadsto \color{blue}{\frac{b \cdot c}{{d}^{2}} + -1 \cdot \frac{a}{d}} \]
        2. mul-1-negN/A

          \[\leadsto \frac{b \cdot c}{{d}^{2}} + \color{blue}{\left(\mathsf{neg}\left(\frac{a}{d}\right)\right)} \]
        3. unsub-negN/A

          \[\leadsto \color{blue}{\frac{b \cdot c}{{d}^{2}} - \frac{a}{d}} \]
        4. unpow2N/A

          \[\leadsto \frac{b \cdot c}{\color{blue}{d \cdot d}} - \frac{a}{d} \]
        5. associate-/r*N/A

          \[\leadsto \color{blue}{\frac{\frac{b \cdot c}{d}}{d}} - \frac{a}{d} \]
        6. div-subN/A

          \[\leadsto \color{blue}{\frac{\frac{b \cdot c}{d} - a}{d}} \]
        7. lower-/.f64N/A

          \[\leadsto \color{blue}{\frac{\frac{b \cdot c}{d} - a}{d}} \]
        8. lower--.f64N/A

          \[\leadsto \frac{\color{blue}{\frac{b \cdot c}{d} - a}}{d} \]
        9. lower-/.f64N/A

          \[\leadsto \frac{\color{blue}{\frac{b \cdot c}{d}} - a}{d} \]
        10. lower-*.f6492.7

          \[\leadsto \frac{\frac{\color{blue}{b \cdot c}}{d} - a}{d} \]
      5. Applied rewrites92.7%

        \[\leadsto \color{blue}{\frac{\frac{b \cdot c}{d} - a}{d}} \]

      if 5.60000000000000023e75 < c

      1. Initial program 44.5%

        \[\frac{b \cdot c - a \cdot d}{c \cdot c + d \cdot d} \]
      2. Add Preprocessing
      3. Taylor expanded in d around 0

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

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

          \[\leadsto \color{blue}{\mathsf{fma}\left(-1 \cdot \frac{a}{{c}^{2}} + d \cdot \left(\frac{a \cdot d}{{c}^{4}} - \frac{b}{{c}^{3}}\right), d, \frac{b}{c}\right)} \]
      5. Applied rewrites86.9%

        \[\leadsto \color{blue}{\mathsf{fma}\left(\mathsf{fma}\left(\frac{a}{{c}^{4}} \cdot d - \frac{b}{{c}^{3}}, d, \frac{\frac{-a}{c}}{c}\right), d, \frac{b}{c}\right)} \]
    7. Recombined 4 regimes into one program.
    8. Final simplification88.7%

      \[\leadsto \begin{array}{l} \mathbf{if}\;c \leq -8 \cdot 10^{+101}:\\ \;\;\;\;\frac{b - \left({c}^{-1} \cdot a\right) \cdot d}{c}\\ \mathbf{elif}\;c \leq -9.5 \cdot 10^{-38}:\\ \;\;\;\;\frac{b \cdot c - d \cdot a}{d \cdot d + c \cdot c}\\ \mathbf{elif}\;c \leq 1.22 \cdot 10^{-119}:\\ \;\;\;\;\frac{\frac{b \cdot c}{d} - a}{d}\\ \mathbf{elif}\;c \leq 5.6 \cdot 10^{+75}:\\ \;\;\;\;\frac{b \cdot c - d \cdot a}{d \cdot d + c \cdot c}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(\frac{a}{{c}^{4}} \cdot d - \frac{b}{{c}^{3}}, d, \frac{\frac{-a}{c}}{c}\right), d, \frac{b}{c}\right)\\ \end{array} \]
    9. Add Preprocessing

    Alternative 2: 82.9% accurate, 0.3× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{b \cdot c - d \cdot a}{d \cdot d + c \cdot c}\\ t_1 := \frac{b - \left({c}^{-1} \cdot a\right) \cdot d}{c}\\ \mathbf{if}\;c \leq -8 \cdot 10^{+101}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;c \leq -9.5 \cdot 10^{-38}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;c \leq 1.22 \cdot 10^{-119}:\\ \;\;\;\;\frac{\frac{b \cdot c}{d} - a}{d}\\ \mathbf{elif}\;c \leq 2.6 \cdot 10^{+63}:\\ \;\;\;\;t\_0\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
    (FPCore (a b c d)
     :precision binary64
     (let* ((t_0 (/ (- (* b c) (* d a)) (+ (* d d) (* c c))))
            (t_1 (/ (- b (* (* (pow c -1.0) a) d)) c)))
       (if (<= c -8e+101)
         t_1
         (if (<= c -9.5e-38)
           t_0
           (if (<= c 1.22e-119)
             (/ (- (/ (* b c) d) a) d)
             (if (<= c 2.6e+63) t_0 t_1))))))
    double code(double a, double b, double c, double d) {
    	double t_0 = ((b * c) - (d * a)) / ((d * d) + (c * c));
    	double t_1 = (b - ((pow(c, -1.0) * a) * d)) / c;
    	double tmp;
    	if (c <= -8e+101) {
    		tmp = t_1;
    	} else if (c <= -9.5e-38) {
    		tmp = t_0;
    	} else if (c <= 1.22e-119) {
    		tmp = (((b * c) / d) - a) / d;
    	} else if (c <= 2.6e+63) {
    		tmp = t_0;
    	} else {
    		tmp = t_1;
    	}
    	return tmp;
    }
    
    real(8) function code(a, b, c, d)
        real(8), intent (in) :: a
        real(8), intent (in) :: b
        real(8), intent (in) :: c
        real(8), intent (in) :: d
        real(8) :: t_0
        real(8) :: t_1
        real(8) :: tmp
        t_0 = ((b * c) - (d * a)) / ((d * d) + (c * c))
        t_1 = (b - (((c ** (-1.0d0)) * a) * d)) / c
        if (c <= (-8d+101)) then
            tmp = t_1
        else if (c <= (-9.5d-38)) then
            tmp = t_0
        else if (c <= 1.22d-119) then
            tmp = (((b * c) / d) - a) / d
        else if (c <= 2.6d+63) then
            tmp = t_0
        else
            tmp = t_1
        end if
        code = tmp
    end function
    
    public static double code(double a, double b, double c, double d) {
    	double t_0 = ((b * c) - (d * a)) / ((d * d) + (c * c));
    	double t_1 = (b - ((Math.pow(c, -1.0) * a) * d)) / c;
    	double tmp;
    	if (c <= -8e+101) {
    		tmp = t_1;
    	} else if (c <= -9.5e-38) {
    		tmp = t_0;
    	} else if (c <= 1.22e-119) {
    		tmp = (((b * c) / d) - a) / d;
    	} else if (c <= 2.6e+63) {
    		tmp = t_0;
    	} else {
    		tmp = t_1;
    	}
    	return tmp;
    }
    
    def code(a, b, c, d):
    	t_0 = ((b * c) - (d * a)) / ((d * d) + (c * c))
    	t_1 = (b - ((math.pow(c, -1.0) * a) * d)) / c
    	tmp = 0
    	if c <= -8e+101:
    		tmp = t_1
    	elif c <= -9.5e-38:
    		tmp = t_0
    	elif c <= 1.22e-119:
    		tmp = (((b * c) / d) - a) / d
    	elif c <= 2.6e+63:
    		tmp = t_0
    	else:
    		tmp = t_1
    	return tmp
    
    function code(a, b, c, d)
    	t_0 = Float64(Float64(Float64(b * c) - Float64(d * a)) / Float64(Float64(d * d) + Float64(c * c)))
    	t_1 = Float64(Float64(b - Float64(Float64((c ^ -1.0) * a) * d)) / c)
    	tmp = 0.0
    	if (c <= -8e+101)
    		tmp = t_1;
    	elseif (c <= -9.5e-38)
    		tmp = t_0;
    	elseif (c <= 1.22e-119)
    		tmp = Float64(Float64(Float64(Float64(b * c) / d) - a) / d);
    	elseif (c <= 2.6e+63)
    		tmp = t_0;
    	else
    		tmp = t_1;
    	end
    	return tmp
    end
    
    function tmp_2 = code(a, b, c, d)
    	t_0 = ((b * c) - (d * a)) / ((d * d) + (c * c));
    	t_1 = (b - (((c ^ -1.0) * a) * d)) / c;
    	tmp = 0.0;
    	if (c <= -8e+101)
    		tmp = t_1;
    	elseif (c <= -9.5e-38)
    		tmp = t_0;
    	elseif (c <= 1.22e-119)
    		tmp = (((b * c) / d) - a) / d;
    	elseif (c <= 2.6e+63)
    		tmp = t_0;
    	else
    		tmp = t_1;
    	end
    	tmp_2 = tmp;
    end
    
    code[a_, b_, c_, d_] := Block[{t$95$0 = N[(N[(N[(b * c), $MachinePrecision] - N[(d * a), $MachinePrecision]), $MachinePrecision] / N[(N[(d * d), $MachinePrecision] + N[(c * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(b - N[(N[(N[Power[c, -1.0], $MachinePrecision] * a), $MachinePrecision] * d), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision]}, If[LessEqual[c, -8e+101], t$95$1, If[LessEqual[c, -9.5e-38], t$95$0, If[LessEqual[c, 1.22e-119], N[(N[(N[(N[(b * c), $MachinePrecision] / d), $MachinePrecision] - a), $MachinePrecision] / d), $MachinePrecision], If[LessEqual[c, 2.6e+63], t$95$0, t$95$1]]]]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_0 := \frac{b \cdot c - d \cdot a}{d \cdot d + c \cdot c}\\
    t_1 := \frac{b - \left({c}^{-1} \cdot a\right) \cdot d}{c}\\
    \mathbf{if}\;c \leq -8 \cdot 10^{+101}:\\
    \;\;\;\;t\_1\\
    
    \mathbf{elif}\;c \leq -9.5 \cdot 10^{-38}:\\
    \;\;\;\;t\_0\\
    
    \mathbf{elif}\;c \leq 1.22 \cdot 10^{-119}:\\
    \;\;\;\;\frac{\frac{b \cdot c}{d} - a}{d}\\
    
    \mathbf{elif}\;c \leq 2.6 \cdot 10^{+63}:\\
    \;\;\;\;t\_0\\
    
    \mathbf{else}:\\
    \;\;\;\;t\_1\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 3 regimes
    2. if c < -7.9999999999999998e101 or 2.6000000000000001e63 < c

      1. Initial program 42.3%

        \[\frac{b \cdot c - a \cdot d}{c \cdot c + d \cdot d} \]
      2. Add Preprocessing
      3. Taylor expanded in c around inf

        \[\leadsto \color{blue}{\frac{b + -1 \cdot \frac{a \cdot d}{c}}{c}} \]
      4. Step-by-step derivation
        1. lower-/.f64N/A

          \[\leadsto \color{blue}{\frac{b + -1 \cdot \frac{a \cdot d}{c}}{c}} \]
        2. mul-1-negN/A

          \[\leadsto \frac{b + \color{blue}{\left(\mathsf{neg}\left(\frac{a \cdot d}{c}\right)\right)}}{c} \]
        3. unsub-negN/A

          \[\leadsto \frac{\color{blue}{b - \frac{a \cdot d}{c}}}{c} \]
        4. lower--.f64N/A

          \[\leadsto \frac{\color{blue}{b - \frac{a \cdot d}{c}}}{c} \]
        5. lower-/.f64N/A

          \[\leadsto \frac{b - \color{blue}{\frac{a \cdot d}{c}}}{c} \]
        6. lower-*.f6481.6

          \[\leadsto \frac{b - \frac{\color{blue}{a \cdot d}}{c}}{c} \]
      5. Applied rewrites81.6%

        \[\leadsto \color{blue}{\frac{b - \frac{a \cdot d}{c}}{c}} \]
      6. Step-by-step derivation
        1. Applied rewrites84.9%

          \[\leadsto \frac{b - d \cdot \left(a \cdot {c}^{-1}\right)}{c} \]

        if -7.9999999999999998e101 < c < -9.5000000000000009e-38 or 1.22e-119 < c < 2.6000000000000001e63

        1. Initial program 89.2%

          \[\frac{b \cdot c - a \cdot d}{c \cdot c + d \cdot d} \]
        2. Add Preprocessing

        if -9.5000000000000009e-38 < c < 1.22e-119

        1. Initial program 71.3%

          \[\frac{b \cdot c - a \cdot d}{c \cdot c + d \cdot d} \]
        2. Add Preprocessing
        3. Taylor expanded in c around 0

          \[\leadsto \color{blue}{-1 \cdot \frac{a}{d} + \frac{b \cdot c}{{d}^{2}}} \]
        4. Step-by-step derivation
          1. +-commutativeN/A

            \[\leadsto \color{blue}{\frac{b \cdot c}{{d}^{2}} + -1 \cdot \frac{a}{d}} \]
          2. mul-1-negN/A

            \[\leadsto \frac{b \cdot c}{{d}^{2}} + \color{blue}{\left(\mathsf{neg}\left(\frac{a}{d}\right)\right)} \]
          3. unsub-negN/A

            \[\leadsto \color{blue}{\frac{b \cdot c}{{d}^{2}} - \frac{a}{d}} \]
          4. unpow2N/A

            \[\leadsto \frac{b \cdot c}{\color{blue}{d \cdot d}} - \frac{a}{d} \]
          5. associate-/r*N/A

            \[\leadsto \color{blue}{\frac{\frac{b \cdot c}{d}}{d}} - \frac{a}{d} \]
          6. div-subN/A

            \[\leadsto \color{blue}{\frac{\frac{b \cdot c}{d} - a}{d}} \]
          7. lower-/.f64N/A

            \[\leadsto \color{blue}{\frac{\frac{b \cdot c}{d} - a}{d}} \]
          8. lower--.f64N/A

            \[\leadsto \frac{\color{blue}{\frac{b \cdot c}{d} - a}}{d} \]
          9. lower-/.f64N/A

            \[\leadsto \frac{\color{blue}{\frac{b \cdot c}{d}} - a}{d} \]
          10. lower-*.f6492.7

            \[\leadsto \frac{\frac{\color{blue}{b \cdot c}}{d} - a}{d} \]
        5. Applied rewrites92.7%

          \[\leadsto \color{blue}{\frac{\frac{b \cdot c}{d} - a}{d}} \]
      7. Recombined 3 regimes into one program.
      8. Final simplification88.5%

        \[\leadsto \begin{array}{l} \mathbf{if}\;c \leq -8 \cdot 10^{+101}:\\ \;\;\;\;\frac{b - \left({c}^{-1} \cdot a\right) \cdot d}{c}\\ \mathbf{elif}\;c \leq -9.5 \cdot 10^{-38}:\\ \;\;\;\;\frac{b \cdot c - d \cdot a}{d \cdot d + c \cdot c}\\ \mathbf{elif}\;c \leq 1.22 \cdot 10^{-119}:\\ \;\;\;\;\frac{\frac{b \cdot c}{d} - a}{d}\\ \mathbf{elif}\;c \leq 2.6 \cdot 10^{+63}:\\ \;\;\;\;\frac{b \cdot c - d \cdot a}{d \cdot d + c \cdot c}\\ \mathbf{else}:\\ \;\;\;\;\frac{b - \left({c}^{-1} \cdot a\right) \cdot d}{c}\\ \end{array} \]
      9. Add Preprocessing

      Alternative 3: 82.9% accurate, 0.6× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{b \cdot c - d \cdot a}{d \cdot d + c \cdot c}\\ t_1 := \frac{-1}{c} \cdot \mathsf{fma}\left(b, -1, \frac{a}{c} \cdot d\right)\\ \mathbf{if}\;c \leq -8 \cdot 10^{+101}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;c \leq -9.5 \cdot 10^{-38}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;c \leq 1.22 \cdot 10^{-119}:\\ \;\;\;\;\frac{\frac{b \cdot c}{d} - a}{d}\\ \mathbf{elif}\;c \leq 4.4 \cdot 10^{+86}:\\ \;\;\;\;t\_0\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
      (FPCore (a b c d)
       :precision binary64
       (let* ((t_0 (/ (- (* b c) (* d a)) (+ (* d d) (* c c))))
              (t_1 (* (/ -1.0 c) (fma b -1.0 (* (/ a c) d)))))
         (if (<= c -8e+101)
           t_1
           (if (<= c -9.5e-38)
             t_0
             (if (<= c 1.22e-119)
               (/ (- (/ (* b c) d) a) d)
               (if (<= c 4.4e+86) t_0 t_1))))))
      double code(double a, double b, double c, double d) {
      	double t_0 = ((b * c) - (d * a)) / ((d * d) + (c * c));
      	double t_1 = (-1.0 / c) * fma(b, -1.0, ((a / c) * d));
      	double tmp;
      	if (c <= -8e+101) {
      		tmp = t_1;
      	} else if (c <= -9.5e-38) {
      		tmp = t_0;
      	} else if (c <= 1.22e-119) {
      		tmp = (((b * c) / d) - a) / d;
      	} else if (c <= 4.4e+86) {
      		tmp = t_0;
      	} else {
      		tmp = t_1;
      	}
      	return tmp;
      }
      
      function code(a, b, c, d)
      	t_0 = Float64(Float64(Float64(b * c) - Float64(d * a)) / Float64(Float64(d * d) + Float64(c * c)))
      	t_1 = Float64(Float64(-1.0 / c) * fma(b, -1.0, Float64(Float64(a / c) * d)))
      	tmp = 0.0
      	if (c <= -8e+101)
      		tmp = t_1;
      	elseif (c <= -9.5e-38)
      		tmp = t_0;
      	elseif (c <= 1.22e-119)
      		tmp = Float64(Float64(Float64(Float64(b * c) / d) - a) / d);
      	elseif (c <= 4.4e+86)
      		tmp = t_0;
      	else
      		tmp = t_1;
      	end
      	return tmp
      end
      
      code[a_, b_, c_, d_] := Block[{t$95$0 = N[(N[(N[(b * c), $MachinePrecision] - N[(d * a), $MachinePrecision]), $MachinePrecision] / N[(N[(d * d), $MachinePrecision] + N[(c * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(-1.0 / c), $MachinePrecision] * N[(b * -1.0 + N[(N[(a / c), $MachinePrecision] * d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c, -8e+101], t$95$1, If[LessEqual[c, -9.5e-38], t$95$0, If[LessEqual[c, 1.22e-119], N[(N[(N[(N[(b * c), $MachinePrecision] / d), $MachinePrecision] - a), $MachinePrecision] / d), $MachinePrecision], If[LessEqual[c, 4.4e+86], t$95$0, t$95$1]]]]]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      t_0 := \frac{b \cdot c - d \cdot a}{d \cdot d + c \cdot c}\\
      t_1 := \frac{-1}{c} \cdot \mathsf{fma}\left(b, -1, \frac{a}{c} \cdot d\right)\\
      \mathbf{if}\;c \leq -8 \cdot 10^{+101}:\\
      \;\;\;\;t\_1\\
      
      \mathbf{elif}\;c \leq -9.5 \cdot 10^{-38}:\\
      \;\;\;\;t\_0\\
      
      \mathbf{elif}\;c \leq 1.22 \cdot 10^{-119}:\\
      \;\;\;\;\frac{\frac{b \cdot c}{d} - a}{d}\\
      
      \mathbf{elif}\;c \leq 4.4 \cdot 10^{+86}:\\
      \;\;\;\;t\_0\\
      
      \mathbf{else}:\\
      \;\;\;\;t\_1\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 3 regimes
      2. if c < -7.9999999999999998e101 or 4.40000000000000006e86 < c

        1. Initial program 41.4%

          \[\frac{b \cdot c - a \cdot d}{c \cdot c + d \cdot d} \]
        2. Add Preprocessing
        3. Taylor expanded in c around inf

          \[\leadsto \color{blue}{\frac{b + -1 \cdot \frac{a \cdot d}{c}}{c}} \]
        4. Step-by-step derivation
          1. lower-/.f64N/A

            \[\leadsto \color{blue}{\frac{b + -1 \cdot \frac{a \cdot d}{c}}{c}} \]
          2. mul-1-negN/A

            \[\leadsto \frac{b + \color{blue}{\left(\mathsf{neg}\left(\frac{a \cdot d}{c}\right)\right)}}{c} \]
          3. unsub-negN/A

            \[\leadsto \frac{\color{blue}{b - \frac{a \cdot d}{c}}}{c} \]
          4. lower--.f64N/A

            \[\leadsto \frac{\color{blue}{b - \frac{a \cdot d}{c}}}{c} \]
          5. lower-/.f64N/A

            \[\leadsto \frac{b - \color{blue}{\frac{a \cdot d}{c}}}{c} \]
          6. lower-*.f6482.6

            \[\leadsto \frac{b - \frac{\color{blue}{a \cdot d}}{c}}{c} \]
        5. Applied rewrites82.6%

          \[\leadsto \color{blue}{\frac{b - \frac{a \cdot d}{c}}{c}} \]
        6. Step-by-step derivation
          1. Applied rewrites86.0%

            \[\leadsto \frac{b - d \cdot \left(a \cdot {c}^{-1}\right)}{c} \]
          2. Step-by-step derivation
            1. Applied rewrites85.8%

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

            if -7.9999999999999998e101 < c < -9.5000000000000009e-38 or 1.22e-119 < c < 4.40000000000000006e86

            1. Initial program 86.9%

              \[\frac{b \cdot c - a \cdot d}{c \cdot c + d \cdot d} \]
            2. Add Preprocessing

            if -9.5000000000000009e-38 < c < 1.22e-119

            1. Initial program 71.3%

              \[\frac{b \cdot c - a \cdot d}{c \cdot c + d \cdot d} \]
            2. Add Preprocessing
            3. Taylor expanded in c around 0

              \[\leadsto \color{blue}{-1 \cdot \frac{a}{d} + \frac{b \cdot c}{{d}^{2}}} \]
            4. Step-by-step derivation
              1. +-commutativeN/A

                \[\leadsto \color{blue}{\frac{b \cdot c}{{d}^{2}} + -1 \cdot \frac{a}{d}} \]
              2. mul-1-negN/A

                \[\leadsto \frac{b \cdot c}{{d}^{2}} + \color{blue}{\left(\mathsf{neg}\left(\frac{a}{d}\right)\right)} \]
              3. unsub-negN/A

                \[\leadsto \color{blue}{\frac{b \cdot c}{{d}^{2}} - \frac{a}{d}} \]
              4. unpow2N/A

                \[\leadsto \frac{b \cdot c}{\color{blue}{d \cdot d}} - \frac{a}{d} \]
              5. associate-/r*N/A

                \[\leadsto \color{blue}{\frac{\frac{b \cdot c}{d}}{d}} - \frac{a}{d} \]
              6. div-subN/A

                \[\leadsto \color{blue}{\frac{\frac{b \cdot c}{d} - a}{d}} \]
              7. lower-/.f64N/A

                \[\leadsto \color{blue}{\frac{\frac{b \cdot c}{d} - a}{d}} \]
              8. lower--.f64N/A

                \[\leadsto \frac{\color{blue}{\frac{b \cdot c}{d} - a}}{d} \]
              9. lower-/.f64N/A

                \[\leadsto \frac{\color{blue}{\frac{b \cdot c}{d}} - a}{d} \]
              10. lower-*.f6492.7

                \[\leadsto \frac{\frac{\color{blue}{b \cdot c}}{d} - a}{d} \]
            5. Applied rewrites92.7%

              \[\leadsto \color{blue}{\frac{\frac{b \cdot c}{d} - a}{d}} \]
          3. Recombined 3 regimes into one program.
          4. Final simplification88.5%

            \[\leadsto \begin{array}{l} \mathbf{if}\;c \leq -8 \cdot 10^{+101}:\\ \;\;\;\;\frac{-1}{c} \cdot \mathsf{fma}\left(b, -1, \frac{a}{c} \cdot d\right)\\ \mathbf{elif}\;c \leq -9.5 \cdot 10^{-38}:\\ \;\;\;\;\frac{b \cdot c - d \cdot a}{d \cdot d + c \cdot c}\\ \mathbf{elif}\;c \leq 1.22 \cdot 10^{-119}:\\ \;\;\;\;\frac{\frac{b \cdot c}{d} - a}{d}\\ \mathbf{elif}\;c \leq 4.4 \cdot 10^{+86}:\\ \;\;\;\;\frac{b \cdot c - d \cdot a}{d \cdot d + c \cdot c}\\ \mathbf{else}:\\ \;\;\;\;\frac{-1}{c} \cdot \mathsf{fma}\left(b, -1, \frac{a}{c} \cdot d\right)\\ \end{array} \]
          5. Add Preprocessing

          Alternative 4: 80.7% accurate, 0.6× speedup?

          \[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{b \cdot c - d \cdot a}{d \cdot d + c \cdot c}\\ t_1 := \frac{b - \frac{d \cdot a}{c}}{c}\\ \mathbf{if}\;c \leq -3.4 \cdot 10^{+111}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;c \leq -9.5 \cdot 10^{-38}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;c \leq 1.22 \cdot 10^{-119}:\\ \;\;\;\;\frac{\frac{b \cdot c}{d} - a}{d}\\ \mathbf{elif}\;c \leq 2.6 \cdot 10^{+63}:\\ \;\;\;\;t\_0\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
          (FPCore (a b c d)
           :precision binary64
           (let* ((t_0 (/ (- (* b c) (* d a)) (+ (* d d) (* c c))))
                  (t_1 (/ (- b (/ (* d a) c)) c)))
             (if (<= c -3.4e+111)
               t_1
               (if (<= c -9.5e-38)
                 t_0
                 (if (<= c 1.22e-119)
                   (/ (- (/ (* b c) d) a) d)
                   (if (<= c 2.6e+63) t_0 t_1))))))
          double code(double a, double b, double c, double d) {
          	double t_0 = ((b * c) - (d * a)) / ((d * d) + (c * c));
          	double t_1 = (b - ((d * a) / c)) / c;
          	double tmp;
          	if (c <= -3.4e+111) {
          		tmp = t_1;
          	} else if (c <= -9.5e-38) {
          		tmp = t_0;
          	} else if (c <= 1.22e-119) {
          		tmp = (((b * c) / d) - a) / d;
          	} else if (c <= 2.6e+63) {
          		tmp = t_0;
          	} else {
          		tmp = t_1;
          	}
          	return tmp;
          }
          
          real(8) function code(a, b, c, d)
              real(8), intent (in) :: a
              real(8), intent (in) :: b
              real(8), intent (in) :: c
              real(8), intent (in) :: d
              real(8) :: t_0
              real(8) :: t_1
              real(8) :: tmp
              t_0 = ((b * c) - (d * a)) / ((d * d) + (c * c))
              t_1 = (b - ((d * a) / c)) / c
              if (c <= (-3.4d+111)) then
                  tmp = t_1
              else if (c <= (-9.5d-38)) then
                  tmp = t_0
              else if (c <= 1.22d-119) then
                  tmp = (((b * c) / d) - a) / d
              else if (c <= 2.6d+63) then
                  tmp = t_0
              else
                  tmp = t_1
              end if
              code = tmp
          end function
          
          public static double code(double a, double b, double c, double d) {
          	double t_0 = ((b * c) - (d * a)) / ((d * d) + (c * c));
          	double t_1 = (b - ((d * a) / c)) / c;
          	double tmp;
          	if (c <= -3.4e+111) {
          		tmp = t_1;
          	} else if (c <= -9.5e-38) {
          		tmp = t_0;
          	} else if (c <= 1.22e-119) {
          		tmp = (((b * c) / d) - a) / d;
          	} else if (c <= 2.6e+63) {
          		tmp = t_0;
          	} else {
          		tmp = t_1;
          	}
          	return tmp;
          }
          
          def code(a, b, c, d):
          	t_0 = ((b * c) - (d * a)) / ((d * d) + (c * c))
          	t_1 = (b - ((d * a) / c)) / c
          	tmp = 0
          	if c <= -3.4e+111:
          		tmp = t_1
          	elif c <= -9.5e-38:
          		tmp = t_0
          	elif c <= 1.22e-119:
          		tmp = (((b * c) / d) - a) / d
          	elif c <= 2.6e+63:
          		tmp = t_0
          	else:
          		tmp = t_1
          	return tmp
          
          function code(a, b, c, d)
          	t_0 = Float64(Float64(Float64(b * c) - Float64(d * a)) / Float64(Float64(d * d) + Float64(c * c)))
          	t_1 = Float64(Float64(b - Float64(Float64(d * a) / c)) / c)
          	tmp = 0.0
          	if (c <= -3.4e+111)
          		tmp = t_1;
          	elseif (c <= -9.5e-38)
          		tmp = t_0;
          	elseif (c <= 1.22e-119)
          		tmp = Float64(Float64(Float64(Float64(b * c) / d) - a) / d);
          	elseif (c <= 2.6e+63)
          		tmp = t_0;
          	else
          		tmp = t_1;
          	end
          	return tmp
          end
          
          function tmp_2 = code(a, b, c, d)
          	t_0 = ((b * c) - (d * a)) / ((d * d) + (c * c));
          	t_1 = (b - ((d * a) / c)) / c;
          	tmp = 0.0;
          	if (c <= -3.4e+111)
          		tmp = t_1;
          	elseif (c <= -9.5e-38)
          		tmp = t_0;
          	elseif (c <= 1.22e-119)
          		tmp = (((b * c) / d) - a) / d;
          	elseif (c <= 2.6e+63)
          		tmp = t_0;
          	else
          		tmp = t_1;
          	end
          	tmp_2 = tmp;
          end
          
          code[a_, b_, c_, d_] := Block[{t$95$0 = N[(N[(N[(b * c), $MachinePrecision] - N[(d * a), $MachinePrecision]), $MachinePrecision] / N[(N[(d * d), $MachinePrecision] + N[(c * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(b - N[(N[(d * a), $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision]}, If[LessEqual[c, -3.4e+111], t$95$1, If[LessEqual[c, -9.5e-38], t$95$0, If[LessEqual[c, 1.22e-119], N[(N[(N[(N[(b * c), $MachinePrecision] / d), $MachinePrecision] - a), $MachinePrecision] / d), $MachinePrecision], If[LessEqual[c, 2.6e+63], t$95$0, t$95$1]]]]]]
          
          \begin{array}{l}
          
          \\
          \begin{array}{l}
          t_0 := \frac{b \cdot c - d \cdot a}{d \cdot d + c \cdot c}\\
          t_1 := \frac{b - \frac{d \cdot a}{c}}{c}\\
          \mathbf{if}\;c \leq -3.4 \cdot 10^{+111}:\\
          \;\;\;\;t\_1\\
          
          \mathbf{elif}\;c \leq -9.5 \cdot 10^{-38}:\\
          \;\;\;\;t\_0\\
          
          \mathbf{elif}\;c \leq 1.22 \cdot 10^{-119}:\\
          \;\;\;\;\frac{\frac{b \cdot c}{d} - a}{d}\\
          
          \mathbf{elif}\;c \leq 2.6 \cdot 10^{+63}:\\
          \;\;\;\;t\_0\\
          
          \mathbf{else}:\\
          \;\;\;\;t\_1\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 3 regimes
          2. if c < -3.4000000000000001e111 or 2.6000000000000001e63 < c

            1. Initial program 42.5%

              \[\frac{b \cdot c - a \cdot d}{c \cdot c + d \cdot d} \]
            2. Add Preprocessing
            3. Taylor expanded in c around inf

              \[\leadsto \color{blue}{\frac{b + -1 \cdot \frac{a \cdot d}{c}}{c}} \]
            4. Step-by-step derivation
              1. lower-/.f64N/A

                \[\leadsto \color{blue}{\frac{b + -1 \cdot \frac{a \cdot d}{c}}{c}} \]
              2. mul-1-negN/A

                \[\leadsto \frac{b + \color{blue}{\left(\mathsf{neg}\left(\frac{a \cdot d}{c}\right)\right)}}{c} \]
              3. unsub-negN/A

                \[\leadsto \frac{\color{blue}{b - \frac{a \cdot d}{c}}}{c} \]
              4. lower--.f64N/A

                \[\leadsto \frac{\color{blue}{b - \frac{a \cdot d}{c}}}{c} \]
              5. lower-/.f64N/A

                \[\leadsto \frac{b - \color{blue}{\frac{a \cdot d}{c}}}{c} \]
              6. lower-*.f6483.8

                \[\leadsto \frac{b - \frac{\color{blue}{a \cdot d}}{c}}{c} \]
            5. Applied rewrites83.8%

              \[\leadsto \color{blue}{\frac{b - \frac{a \cdot d}{c}}{c}} \]

            if -3.4000000000000001e111 < c < -9.5000000000000009e-38 or 1.22e-119 < c < 2.6000000000000001e63

            1. Initial program 86.5%

              \[\frac{b \cdot c - a \cdot d}{c \cdot c + d \cdot d} \]
            2. Add Preprocessing

            if -9.5000000000000009e-38 < c < 1.22e-119

            1. Initial program 71.3%

              \[\frac{b \cdot c - a \cdot d}{c \cdot c + d \cdot d} \]
            2. Add Preprocessing
            3. Taylor expanded in c around 0

              \[\leadsto \color{blue}{-1 \cdot \frac{a}{d} + \frac{b \cdot c}{{d}^{2}}} \]
            4. Step-by-step derivation
              1. +-commutativeN/A

                \[\leadsto \color{blue}{\frac{b \cdot c}{{d}^{2}} + -1 \cdot \frac{a}{d}} \]
              2. mul-1-negN/A

                \[\leadsto \frac{b \cdot c}{{d}^{2}} + \color{blue}{\left(\mathsf{neg}\left(\frac{a}{d}\right)\right)} \]
              3. unsub-negN/A

                \[\leadsto \color{blue}{\frac{b \cdot c}{{d}^{2}} - \frac{a}{d}} \]
              4. unpow2N/A

                \[\leadsto \frac{b \cdot c}{\color{blue}{d \cdot d}} - \frac{a}{d} \]
              5. associate-/r*N/A

                \[\leadsto \color{blue}{\frac{\frac{b \cdot c}{d}}{d}} - \frac{a}{d} \]
              6. div-subN/A

                \[\leadsto \color{blue}{\frac{\frac{b \cdot c}{d} - a}{d}} \]
              7. lower-/.f64N/A

                \[\leadsto \color{blue}{\frac{\frac{b \cdot c}{d} - a}{d}} \]
              8. lower--.f64N/A

                \[\leadsto \frac{\color{blue}{\frac{b \cdot c}{d} - a}}{d} \]
              9. lower-/.f64N/A

                \[\leadsto \frac{\color{blue}{\frac{b \cdot c}{d}} - a}{d} \]
              10. lower-*.f6492.7

                \[\leadsto \frac{\frac{\color{blue}{b \cdot c}}{d} - a}{d} \]
            5. Applied rewrites92.7%

              \[\leadsto \color{blue}{\frac{\frac{b \cdot c}{d} - a}{d}} \]
          3. Recombined 3 regimes into one program.
          4. Final simplification87.5%

            \[\leadsto \begin{array}{l} \mathbf{if}\;c \leq -3.4 \cdot 10^{+111}:\\ \;\;\;\;\frac{b - \frac{d \cdot a}{c}}{c}\\ \mathbf{elif}\;c \leq -9.5 \cdot 10^{-38}:\\ \;\;\;\;\frac{b \cdot c - d \cdot a}{d \cdot d + c \cdot c}\\ \mathbf{elif}\;c \leq 1.22 \cdot 10^{-119}:\\ \;\;\;\;\frac{\frac{b \cdot c}{d} - a}{d}\\ \mathbf{elif}\;c \leq 2.6 \cdot 10^{+63}:\\ \;\;\;\;\frac{b \cdot c - d \cdot a}{d \cdot d + c \cdot c}\\ \mathbf{else}:\\ \;\;\;\;\frac{b - \frac{d \cdot a}{c}}{c}\\ \end{array} \]
          5. Add Preprocessing

          Alternative 5: 63.5% accurate, 0.7× speedup?

          \[\begin{array}{l} \\ \begin{array}{l} t_0 := \mathsf{fma}\left(-d, a, b \cdot c\right)\\ \mathbf{if}\;c \leq -1.25 \cdot 10^{+123}:\\ \;\;\;\;\frac{1}{\frac{c}{b}}\\ \mathbf{elif}\;c \leq -2.1 \cdot 10^{-14}:\\ \;\;\;\;\frac{b}{\mathsf{fma}\left(d, d, c \cdot c\right)} \cdot c\\ \mathbf{elif}\;c \leq 10^{-67}:\\ \;\;\;\;\frac{t\_0}{d \cdot d}\\ \mathbf{elif}\;c \leq 3.8 \cdot 10^{+88}:\\ \;\;\;\;\frac{t\_0}{c \cdot c}\\ \mathbf{else}:\\ \;\;\;\;\frac{b}{c}\\ \end{array} \end{array} \]
          (FPCore (a b c d)
           :precision binary64
           (let* ((t_0 (fma (- d) a (* b c))))
             (if (<= c -1.25e+123)
               (/ 1.0 (/ c b))
               (if (<= c -2.1e-14)
                 (* (/ b (fma d d (* c c))) c)
                 (if (<= c 1e-67)
                   (/ t_0 (* d d))
                   (if (<= c 3.8e+88) (/ t_0 (* c c)) (/ b c)))))))
          double code(double a, double b, double c, double d) {
          	double t_0 = fma(-d, a, (b * c));
          	double tmp;
          	if (c <= -1.25e+123) {
          		tmp = 1.0 / (c / b);
          	} else if (c <= -2.1e-14) {
          		tmp = (b / fma(d, d, (c * c))) * c;
          	} else if (c <= 1e-67) {
          		tmp = t_0 / (d * d);
          	} else if (c <= 3.8e+88) {
          		tmp = t_0 / (c * c);
          	} else {
          		tmp = b / c;
          	}
          	return tmp;
          }
          
          function code(a, b, c, d)
          	t_0 = fma(Float64(-d), a, Float64(b * c))
          	tmp = 0.0
          	if (c <= -1.25e+123)
          		tmp = Float64(1.0 / Float64(c / b));
          	elseif (c <= -2.1e-14)
          		tmp = Float64(Float64(b / fma(d, d, Float64(c * c))) * c);
          	elseif (c <= 1e-67)
          		tmp = Float64(t_0 / Float64(d * d));
          	elseif (c <= 3.8e+88)
          		tmp = Float64(t_0 / Float64(c * c));
          	else
          		tmp = Float64(b / c);
          	end
          	return tmp
          end
          
          code[a_, b_, c_, d_] := Block[{t$95$0 = N[((-d) * a + N[(b * c), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c, -1.25e+123], N[(1.0 / N[(c / b), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, -2.1e-14], N[(N[(b / N[(d * d + N[(c * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision], If[LessEqual[c, 1e-67], N[(t$95$0 / N[(d * d), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 3.8e+88], N[(t$95$0 / N[(c * c), $MachinePrecision]), $MachinePrecision], N[(b / c), $MachinePrecision]]]]]]
          
          \begin{array}{l}
          
          \\
          \begin{array}{l}
          t_0 := \mathsf{fma}\left(-d, a, b \cdot c\right)\\
          \mathbf{if}\;c \leq -1.25 \cdot 10^{+123}:\\
          \;\;\;\;\frac{1}{\frac{c}{b}}\\
          
          \mathbf{elif}\;c \leq -2.1 \cdot 10^{-14}:\\
          \;\;\;\;\frac{b}{\mathsf{fma}\left(d, d, c \cdot c\right)} \cdot c\\
          
          \mathbf{elif}\;c \leq 10^{-67}:\\
          \;\;\;\;\frac{t\_0}{d \cdot d}\\
          
          \mathbf{elif}\;c \leq 3.8 \cdot 10^{+88}:\\
          \;\;\;\;\frac{t\_0}{c \cdot c}\\
          
          \mathbf{else}:\\
          \;\;\;\;\frac{b}{c}\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 5 regimes
          2. if c < -1.24999999999999994e123

            1. Initial program 39.5%

              \[\frac{b \cdot c - a \cdot d}{c \cdot c + d \cdot d} \]
            2. Add Preprocessing
            3. Taylor expanded in c around inf

              \[\leadsto \color{blue}{\frac{b}{c}} \]
            4. Step-by-step derivation
              1. lower-/.f6476.7

                \[\leadsto \color{blue}{\frac{b}{c}} \]
            5. Applied rewrites76.7%

              \[\leadsto \color{blue}{\frac{b}{c}} \]
            6. Step-by-step derivation
              1. Applied rewrites77.5%

                \[\leadsto \frac{1}{\color{blue}{\frac{c}{b}}} \]

              if -1.24999999999999994e123 < c < -2.0999999999999999e-14

              1. Initial program 74.9%

                \[\frac{b \cdot c - a \cdot d}{c \cdot c + d \cdot d} \]
              2. Add Preprocessing
              3. Taylor expanded in a around 0

                \[\leadsto \color{blue}{\frac{b \cdot c}{{c}^{2} + {d}^{2}}} \]
              4. Step-by-step derivation
                1. *-commutativeN/A

                  \[\leadsto \frac{\color{blue}{c \cdot b}}{{c}^{2} + {d}^{2}} \]
                2. associate-/l*N/A

                  \[\leadsto \color{blue}{c \cdot \frac{b}{{c}^{2} + {d}^{2}}} \]
                3. *-commutativeN/A

                  \[\leadsto \color{blue}{\frac{b}{{c}^{2} + {d}^{2}} \cdot c} \]
                4. lower-*.f64N/A

                  \[\leadsto \color{blue}{\frac{b}{{c}^{2} + {d}^{2}} \cdot c} \]
                5. lower-/.f64N/A

                  \[\leadsto \color{blue}{\frac{b}{{c}^{2} + {d}^{2}}} \cdot c \]
                6. +-commutativeN/A

                  \[\leadsto \frac{b}{\color{blue}{{d}^{2} + {c}^{2}}} \cdot c \]
                7. unpow2N/A

                  \[\leadsto \frac{b}{\color{blue}{d \cdot d} + {c}^{2}} \cdot c \]
                8. lower-fma.f64N/A

                  \[\leadsto \frac{b}{\color{blue}{\mathsf{fma}\left(d, d, {c}^{2}\right)}} \cdot c \]
                9. unpow2N/A

                  \[\leadsto \frac{b}{\mathsf{fma}\left(d, d, \color{blue}{c \cdot c}\right)} \cdot c \]
                10. lower-*.f6480.9

                  \[\leadsto \frac{b}{\mathsf{fma}\left(d, d, \color{blue}{c \cdot c}\right)} \cdot c \]
              5. Applied rewrites80.9%

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

              if -2.0999999999999999e-14 < c < 9.99999999999999943e-68

              1. Initial program 74.2%

                \[\frac{b \cdot c - a \cdot d}{c \cdot c + d \cdot d} \]
              2. Add Preprocessing
              3. Taylor expanded in c around 0

                \[\leadsto \frac{b \cdot c - a \cdot d}{\color{blue}{{d}^{2}}} \]
              4. Step-by-step derivation
                1. unpow2N/A

                  \[\leadsto \frac{b \cdot c - a \cdot d}{\color{blue}{d \cdot d}} \]
                2. lower-*.f6467.7

                  \[\leadsto \frac{b \cdot c - a \cdot d}{\color{blue}{d \cdot d}} \]
              5. Applied rewrites67.7%

                \[\leadsto \frac{b \cdot c - a \cdot d}{\color{blue}{d \cdot d}} \]
              6. Step-by-step derivation
                1. lift--.f64N/A

                  \[\leadsto \frac{\color{blue}{b \cdot c - a \cdot d}}{d \cdot d} \]
                2. sub-negN/A

                  \[\leadsto \frac{\color{blue}{b \cdot c + \left(\mathsf{neg}\left(a \cdot d\right)\right)}}{d \cdot d} \]
                3. +-commutativeN/A

                  \[\leadsto \frac{\color{blue}{\left(\mathsf{neg}\left(a \cdot d\right)\right) + b \cdot c}}{d \cdot d} \]
                4. lift-*.f64N/A

                  \[\leadsto \frac{\left(\mathsf{neg}\left(\color{blue}{a \cdot d}\right)\right) + b \cdot c}{d \cdot d} \]
                5. *-commutativeN/A

                  \[\leadsto \frac{\left(\mathsf{neg}\left(\color{blue}{d \cdot a}\right)\right) + b \cdot c}{d \cdot d} \]
                6. distribute-lft-neg-inN/A

                  \[\leadsto \frac{\color{blue}{\left(\mathsf{neg}\left(d\right)\right) \cdot a} + b \cdot c}{d \cdot d} \]
                7. lower-fma.f64N/A

                  \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(\mathsf{neg}\left(d\right), a, b \cdot c\right)}}{d \cdot d} \]
                8. lower-neg.f6467.7

                  \[\leadsto \frac{\mathsf{fma}\left(\color{blue}{-d}, a, b \cdot c\right)}{d \cdot d} \]
                9. lift-*.f64N/A

                  \[\leadsto \frac{\mathsf{fma}\left(-d, a, \color{blue}{b \cdot c}\right)}{d \cdot d} \]
                10. *-commutativeN/A

                  \[\leadsto \frac{\mathsf{fma}\left(-d, a, \color{blue}{c \cdot b}\right)}{d \cdot d} \]
                11. lower-*.f6467.7

                  \[\leadsto \frac{\mathsf{fma}\left(-d, a, \color{blue}{c \cdot b}\right)}{d \cdot d} \]
              7. Applied rewrites67.7%

                \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(-d, a, c \cdot b\right)}}{d \cdot d} \]

              if 9.99999999999999943e-68 < c < 3.7999999999999997e88

              1. Initial program 88.7%

                \[\frac{b \cdot c - a \cdot d}{c \cdot c + d \cdot d} \]
              2. Add Preprocessing
              3. Taylor expanded in c around inf

                \[\leadsto \frac{b \cdot c - a \cdot d}{\color{blue}{{c}^{2}}} \]
              4. Step-by-step derivation
                1. unpow2N/A

                  \[\leadsto \frac{b \cdot c - a \cdot d}{\color{blue}{c \cdot c}} \]
                2. lower-*.f6475.3

                  \[\leadsto \frac{b \cdot c - a \cdot d}{\color{blue}{c \cdot c}} \]
              5. Applied rewrites75.3%

                \[\leadsto \frac{b \cdot c - a \cdot d}{\color{blue}{c \cdot c}} \]
              6. Step-by-step derivation
                1. lift--.f64N/A

                  \[\leadsto \frac{\color{blue}{b \cdot c - a \cdot d}}{c \cdot c} \]
                2. sub-negN/A

                  \[\leadsto \frac{\color{blue}{b \cdot c + \left(\mathsf{neg}\left(a \cdot d\right)\right)}}{c \cdot c} \]
                3. +-commutativeN/A

                  \[\leadsto \frac{\color{blue}{\left(\mathsf{neg}\left(a \cdot d\right)\right) + b \cdot c}}{c \cdot c} \]
                4. lift-*.f64N/A

                  \[\leadsto \frac{\left(\mathsf{neg}\left(\color{blue}{a \cdot d}\right)\right) + b \cdot c}{c \cdot c} \]
                5. *-commutativeN/A

                  \[\leadsto \frac{\left(\mathsf{neg}\left(\color{blue}{d \cdot a}\right)\right) + b \cdot c}{c \cdot c} \]
                6. distribute-lft-neg-outN/A

                  \[\leadsto \frac{\color{blue}{\left(\mathsf{neg}\left(d\right)\right) \cdot a} + b \cdot c}{c \cdot c} \]
                7. lift-neg.f64N/A

                  \[\leadsto \frac{\color{blue}{\left(-d\right)} \cdot a + b \cdot c}{c \cdot c} \]
                8. lower-fma.f6475.3

                  \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(-d, a, b \cdot c\right)}}{c \cdot c} \]
              7. Applied rewrites75.3%

                \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(-d, a, b \cdot c\right)}{c \cdot c}} \]

              if 3.7999999999999997e88 < c

              1. Initial program 43.5%

                \[\frac{b \cdot c - a \cdot d}{c \cdot c + d \cdot d} \]
              2. Add Preprocessing
              3. Taylor expanded in c around inf

                \[\leadsto \color{blue}{\frac{b}{c}} \]
              4. Step-by-step derivation
                1. lower-/.f6478.3

                  \[\leadsto \color{blue}{\frac{b}{c}} \]
              5. Applied rewrites78.3%

                \[\leadsto \color{blue}{\frac{b}{c}} \]
            7. Recombined 5 regimes into one program.
            8. Final simplification74.1%

              \[\leadsto \begin{array}{l} \mathbf{if}\;c \leq -1.25 \cdot 10^{+123}:\\ \;\;\;\;\frac{1}{\frac{c}{b}}\\ \mathbf{elif}\;c \leq -2.1 \cdot 10^{-14}:\\ \;\;\;\;\frac{b}{\mathsf{fma}\left(d, d, c \cdot c\right)} \cdot c\\ \mathbf{elif}\;c \leq 10^{-67}:\\ \;\;\;\;\frac{\mathsf{fma}\left(-d, a, b \cdot c\right)}{d \cdot d}\\ \mathbf{elif}\;c \leq 3.8 \cdot 10^{+88}:\\ \;\;\;\;\frac{\mathsf{fma}\left(-d, a, b \cdot c\right)}{c \cdot c}\\ \mathbf{else}:\\ \;\;\;\;\frac{b}{c}\\ \end{array} \]
            9. Add Preprocessing

            Alternative 6: 63.5% accurate, 0.7× speedup?

            \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;c \leq -1.25 \cdot 10^{+123}:\\ \;\;\;\;\frac{1}{\frac{c}{b}}\\ \mathbf{elif}\;c \leq -2.1 \cdot 10^{-14}:\\ \;\;\;\;\frac{b}{\mathsf{fma}\left(d, d, c \cdot c\right)} \cdot c\\ \mathbf{elif}\;c \leq 10^{-67}:\\ \;\;\;\;\frac{b \cdot c - d \cdot a}{d \cdot d}\\ \mathbf{elif}\;c \leq 3.8 \cdot 10^{+88}:\\ \;\;\;\;\frac{\mathsf{fma}\left(-d, a, b \cdot c\right)}{c \cdot c}\\ \mathbf{else}:\\ \;\;\;\;\frac{b}{c}\\ \end{array} \end{array} \]
            (FPCore (a b c d)
             :precision binary64
             (if (<= c -1.25e+123)
               (/ 1.0 (/ c b))
               (if (<= c -2.1e-14)
                 (* (/ b (fma d d (* c c))) c)
                 (if (<= c 1e-67)
                   (/ (- (* b c) (* d a)) (* d d))
                   (if (<= c 3.8e+88) (/ (fma (- d) a (* b c)) (* c c)) (/ b c))))))
            double code(double a, double b, double c, double d) {
            	double tmp;
            	if (c <= -1.25e+123) {
            		tmp = 1.0 / (c / b);
            	} else if (c <= -2.1e-14) {
            		tmp = (b / fma(d, d, (c * c))) * c;
            	} else if (c <= 1e-67) {
            		tmp = ((b * c) - (d * a)) / (d * d);
            	} else if (c <= 3.8e+88) {
            		tmp = fma(-d, a, (b * c)) / (c * c);
            	} else {
            		tmp = b / c;
            	}
            	return tmp;
            }
            
            function code(a, b, c, d)
            	tmp = 0.0
            	if (c <= -1.25e+123)
            		tmp = Float64(1.0 / Float64(c / b));
            	elseif (c <= -2.1e-14)
            		tmp = Float64(Float64(b / fma(d, d, Float64(c * c))) * c);
            	elseif (c <= 1e-67)
            		tmp = Float64(Float64(Float64(b * c) - Float64(d * a)) / Float64(d * d));
            	elseif (c <= 3.8e+88)
            		tmp = Float64(fma(Float64(-d), a, Float64(b * c)) / Float64(c * c));
            	else
            		tmp = Float64(b / c);
            	end
            	return tmp
            end
            
            code[a_, b_, c_, d_] := If[LessEqual[c, -1.25e+123], N[(1.0 / N[(c / b), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, -2.1e-14], N[(N[(b / N[(d * d + N[(c * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision], If[LessEqual[c, 1e-67], N[(N[(N[(b * c), $MachinePrecision] - N[(d * a), $MachinePrecision]), $MachinePrecision] / N[(d * d), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 3.8e+88], N[(N[((-d) * a + N[(b * c), $MachinePrecision]), $MachinePrecision] / N[(c * c), $MachinePrecision]), $MachinePrecision], N[(b / c), $MachinePrecision]]]]]
            
            \begin{array}{l}
            
            \\
            \begin{array}{l}
            \mathbf{if}\;c \leq -1.25 \cdot 10^{+123}:\\
            \;\;\;\;\frac{1}{\frac{c}{b}}\\
            
            \mathbf{elif}\;c \leq -2.1 \cdot 10^{-14}:\\
            \;\;\;\;\frac{b}{\mathsf{fma}\left(d, d, c \cdot c\right)} \cdot c\\
            
            \mathbf{elif}\;c \leq 10^{-67}:\\
            \;\;\;\;\frac{b \cdot c - d \cdot a}{d \cdot d}\\
            
            \mathbf{elif}\;c \leq 3.8 \cdot 10^{+88}:\\
            \;\;\;\;\frac{\mathsf{fma}\left(-d, a, b \cdot c\right)}{c \cdot c}\\
            
            \mathbf{else}:\\
            \;\;\;\;\frac{b}{c}\\
            
            
            \end{array}
            \end{array}
            
            Derivation
            1. Split input into 5 regimes
            2. if c < -1.24999999999999994e123

              1. Initial program 39.5%

                \[\frac{b \cdot c - a \cdot d}{c \cdot c + d \cdot d} \]
              2. Add Preprocessing
              3. Taylor expanded in c around inf

                \[\leadsto \color{blue}{\frac{b}{c}} \]
              4. Step-by-step derivation
                1. lower-/.f6476.7

                  \[\leadsto \color{blue}{\frac{b}{c}} \]
              5. Applied rewrites76.7%

                \[\leadsto \color{blue}{\frac{b}{c}} \]
              6. Step-by-step derivation
                1. Applied rewrites77.5%

                  \[\leadsto \frac{1}{\color{blue}{\frac{c}{b}}} \]

                if -1.24999999999999994e123 < c < -2.0999999999999999e-14

                1. Initial program 74.9%

                  \[\frac{b \cdot c - a \cdot d}{c \cdot c + d \cdot d} \]
                2. Add Preprocessing
                3. Taylor expanded in a around 0

                  \[\leadsto \color{blue}{\frac{b \cdot c}{{c}^{2} + {d}^{2}}} \]
                4. Step-by-step derivation
                  1. *-commutativeN/A

                    \[\leadsto \frac{\color{blue}{c \cdot b}}{{c}^{2} + {d}^{2}} \]
                  2. associate-/l*N/A

                    \[\leadsto \color{blue}{c \cdot \frac{b}{{c}^{2} + {d}^{2}}} \]
                  3. *-commutativeN/A

                    \[\leadsto \color{blue}{\frac{b}{{c}^{2} + {d}^{2}} \cdot c} \]
                  4. lower-*.f64N/A

                    \[\leadsto \color{blue}{\frac{b}{{c}^{2} + {d}^{2}} \cdot c} \]
                  5. lower-/.f64N/A

                    \[\leadsto \color{blue}{\frac{b}{{c}^{2} + {d}^{2}}} \cdot c \]
                  6. +-commutativeN/A

                    \[\leadsto \frac{b}{\color{blue}{{d}^{2} + {c}^{2}}} \cdot c \]
                  7. unpow2N/A

                    \[\leadsto \frac{b}{\color{blue}{d \cdot d} + {c}^{2}} \cdot c \]
                  8. lower-fma.f64N/A

                    \[\leadsto \frac{b}{\color{blue}{\mathsf{fma}\left(d, d, {c}^{2}\right)}} \cdot c \]
                  9. unpow2N/A

                    \[\leadsto \frac{b}{\mathsf{fma}\left(d, d, \color{blue}{c \cdot c}\right)} \cdot c \]
                  10. lower-*.f6480.9

                    \[\leadsto \frac{b}{\mathsf{fma}\left(d, d, \color{blue}{c \cdot c}\right)} \cdot c \]
                5. Applied rewrites80.9%

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

                if -2.0999999999999999e-14 < c < 9.99999999999999943e-68

                1. Initial program 74.2%

                  \[\frac{b \cdot c - a \cdot d}{c \cdot c + d \cdot d} \]
                2. Add Preprocessing
                3. Taylor expanded in c around 0

                  \[\leadsto \frac{b \cdot c - a \cdot d}{\color{blue}{{d}^{2}}} \]
                4. Step-by-step derivation
                  1. unpow2N/A

                    \[\leadsto \frac{b \cdot c - a \cdot d}{\color{blue}{d \cdot d}} \]
                  2. lower-*.f6467.7

                    \[\leadsto \frac{b \cdot c - a \cdot d}{\color{blue}{d \cdot d}} \]
                5. Applied rewrites67.7%

                  \[\leadsto \frac{b \cdot c - a \cdot d}{\color{blue}{d \cdot d}} \]

                if 9.99999999999999943e-68 < c < 3.7999999999999997e88

                1. Initial program 88.7%

                  \[\frac{b \cdot c - a \cdot d}{c \cdot c + d \cdot d} \]
                2. Add Preprocessing
                3. Taylor expanded in c around inf

                  \[\leadsto \frac{b \cdot c - a \cdot d}{\color{blue}{{c}^{2}}} \]
                4. Step-by-step derivation
                  1. unpow2N/A

                    \[\leadsto \frac{b \cdot c - a \cdot d}{\color{blue}{c \cdot c}} \]
                  2. lower-*.f6475.3

                    \[\leadsto \frac{b \cdot c - a \cdot d}{\color{blue}{c \cdot c}} \]
                5. Applied rewrites75.3%

                  \[\leadsto \frac{b \cdot c - a \cdot d}{\color{blue}{c \cdot c}} \]
                6. Step-by-step derivation
                  1. lift--.f64N/A

                    \[\leadsto \frac{\color{blue}{b \cdot c - a \cdot d}}{c \cdot c} \]
                  2. sub-negN/A

                    \[\leadsto \frac{\color{blue}{b \cdot c + \left(\mathsf{neg}\left(a \cdot d\right)\right)}}{c \cdot c} \]
                  3. +-commutativeN/A

                    \[\leadsto \frac{\color{blue}{\left(\mathsf{neg}\left(a \cdot d\right)\right) + b \cdot c}}{c \cdot c} \]
                  4. lift-*.f64N/A

                    \[\leadsto \frac{\left(\mathsf{neg}\left(\color{blue}{a \cdot d}\right)\right) + b \cdot c}{c \cdot c} \]
                  5. *-commutativeN/A

                    \[\leadsto \frac{\left(\mathsf{neg}\left(\color{blue}{d \cdot a}\right)\right) + b \cdot c}{c \cdot c} \]
                  6. distribute-lft-neg-outN/A

                    \[\leadsto \frac{\color{blue}{\left(\mathsf{neg}\left(d\right)\right) \cdot a} + b \cdot c}{c \cdot c} \]
                  7. lift-neg.f64N/A

                    \[\leadsto \frac{\color{blue}{\left(-d\right)} \cdot a + b \cdot c}{c \cdot c} \]
                  8. lower-fma.f6475.3

                    \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(-d, a, b \cdot c\right)}}{c \cdot c} \]
                7. Applied rewrites75.3%

                  \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(-d, a, b \cdot c\right)}{c \cdot c}} \]

                if 3.7999999999999997e88 < c

                1. Initial program 43.5%

                  \[\frac{b \cdot c - a \cdot d}{c \cdot c + d \cdot d} \]
                2. Add Preprocessing
                3. Taylor expanded in c around inf

                  \[\leadsto \color{blue}{\frac{b}{c}} \]
                4. Step-by-step derivation
                  1. lower-/.f6478.3

                    \[\leadsto \color{blue}{\frac{b}{c}} \]
                5. Applied rewrites78.3%

                  \[\leadsto \color{blue}{\frac{b}{c}} \]
              7. Recombined 5 regimes into one program.
              8. Final simplification74.0%

                \[\leadsto \begin{array}{l} \mathbf{if}\;c \leq -1.25 \cdot 10^{+123}:\\ \;\;\;\;\frac{1}{\frac{c}{b}}\\ \mathbf{elif}\;c \leq -2.1 \cdot 10^{-14}:\\ \;\;\;\;\frac{b}{\mathsf{fma}\left(d, d, c \cdot c\right)} \cdot c\\ \mathbf{elif}\;c \leq 10^{-67}:\\ \;\;\;\;\frac{b \cdot c - d \cdot a}{d \cdot d}\\ \mathbf{elif}\;c \leq 3.8 \cdot 10^{+88}:\\ \;\;\;\;\frac{\mathsf{fma}\left(-d, a, b \cdot c\right)}{c \cdot c}\\ \mathbf{else}:\\ \;\;\;\;\frac{b}{c}\\ \end{array} \]
              9. Add Preprocessing

              Alternative 7: 63.5% accurate, 0.7× speedup?

              \[\begin{array}{l} \\ \begin{array}{l} t_0 := b \cdot c - d \cdot a\\ \mathbf{if}\;c \leq -1.25 \cdot 10^{+123}:\\ \;\;\;\;\frac{1}{\frac{c}{b}}\\ \mathbf{elif}\;c \leq -2.1 \cdot 10^{-14}:\\ \;\;\;\;\frac{b}{\mathsf{fma}\left(d, d, c \cdot c\right)} \cdot c\\ \mathbf{elif}\;c \leq 10^{-67}:\\ \;\;\;\;\frac{t\_0}{d \cdot d}\\ \mathbf{elif}\;c \leq 3.8 \cdot 10^{+88}:\\ \;\;\;\;\frac{t\_0}{c \cdot c}\\ \mathbf{else}:\\ \;\;\;\;\frac{b}{c}\\ \end{array} \end{array} \]
              (FPCore (a b c d)
               :precision binary64
               (let* ((t_0 (- (* b c) (* d a))))
                 (if (<= c -1.25e+123)
                   (/ 1.0 (/ c b))
                   (if (<= c -2.1e-14)
                     (* (/ b (fma d d (* c c))) c)
                     (if (<= c 1e-67)
                       (/ t_0 (* d d))
                       (if (<= c 3.8e+88) (/ t_0 (* c c)) (/ b c)))))))
              double code(double a, double b, double c, double d) {
              	double t_0 = (b * c) - (d * a);
              	double tmp;
              	if (c <= -1.25e+123) {
              		tmp = 1.0 / (c / b);
              	} else if (c <= -2.1e-14) {
              		tmp = (b / fma(d, d, (c * c))) * c;
              	} else if (c <= 1e-67) {
              		tmp = t_0 / (d * d);
              	} else if (c <= 3.8e+88) {
              		tmp = t_0 / (c * c);
              	} else {
              		tmp = b / c;
              	}
              	return tmp;
              }
              
              function code(a, b, c, d)
              	t_0 = Float64(Float64(b * c) - Float64(d * a))
              	tmp = 0.0
              	if (c <= -1.25e+123)
              		tmp = Float64(1.0 / Float64(c / b));
              	elseif (c <= -2.1e-14)
              		tmp = Float64(Float64(b / fma(d, d, Float64(c * c))) * c);
              	elseif (c <= 1e-67)
              		tmp = Float64(t_0 / Float64(d * d));
              	elseif (c <= 3.8e+88)
              		tmp = Float64(t_0 / Float64(c * c));
              	else
              		tmp = Float64(b / c);
              	end
              	return tmp
              end
              
              code[a_, b_, c_, d_] := Block[{t$95$0 = N[(N[(b * c), $MachinePrecision] - N[(d * a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c, -1.25e+123], N[(1.0 / N[(c / b), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, -2.1e-14], N[(N[(b / N[(d * d + N[(c * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision], If[LessEqual[c, 1e-67], N[(t$95$0 / N[(d * d), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 3.8e+88], N[(t$95$0 / N[(c * c), $MachinePrecision]), $MachinePrecision], N[(b / c), $MachinePrecision]]]]]]
              
              \begin{array}{l}
              
              \\
              \begin{array}{l}
              t_0 := b \cdot c - d \cdot a\\
              \mathbf{if}\;c \leq -1.25 \cdot 10^{+123}:\\
              \;\;\;\;\frac{1}{\frac{c}{b}}\\
              
              \mathbf{elif}\;c \leq -2.1 \cdot 10^{-14}:\\
              \;\;\;\;\frac{b}{\mathsf{fma}\left(d, d, c \cdot c\right)} \cdot c\\
              
              \mathbf{elif}\;c \leq 10^{-67}:\\
              \;\;\;\;\frac{t\_0}{d \cdot d}\\
              
              \mathbf{elif}\;c \leq 3.8 \cdot 10^{+88}:\\
              \;\;\;\;\frac{t\_0}{c \cdot c}\\
              
              \mathbf{else}:\\
              \;\;\;\;\frac{b}{c}\\
              
              
              \end{array}
              \end{array}
              
              Derivation
              1. Split input into 5 regimes
              2. if c < -1.24999999999999994e123

                1. Initial program 39.5%

                  \[\frac{b \cdot c - a \cdot d}{c \cdot c + d \cdot d} \]
                2. Add Preprocessing
                3. Taylor expanded in c around inf

                  \[\leadsto \color{blue}{\frac{b}{c}} \]
                4. Step-by-step derivation
                  1. lower-/.f6476.7

                    \[\leadsto \color{blue}{\frac{b}{c}} \]
                5. Applied rewrites76.7%

                  \[\leadsto \color{blue}{\frac{b}{c}} \]
                6. Step-by-step derivation
                  1. Applied rewrites77.5%

                    \[\leadsto \frac{1}{\color{blue}{\frac{c}{b}}} \]

                  if -1.24999999999999994e123 < c < -2.0999999999999999e-14

                  1. Initial program 74.9%

                    \[\frac{b \cdot c - a \cdot d}{c \cdot c + d \cdot d} \]
                  2. Add Preprocessing
                  3. Taylor expanded in a around 0

                    \[\leadsto \color{blue}{\frac{b \cdot c}{{c}^{2} + {d}^{2}}} \]
                  4. Step-by-step derivation
                    1. *-commutativeN/A

                      \[\leadsto \frac{\color{blue}{c \cdot b}}{{c}^{2} + {d}^{2}} \]
                    2. associate-/l*N/A

                      \[\leadsto \color{blue}{c \cdot \frac{b}{{c}^{2} + {d}^{2}}} \]
                    3. *-commutativeN/A

                      \[\leadsto \color{blue}{\frac{b}{{c}^{2} + {d}^{2}} \cdot c} \]
                    4. lower-*.f64N/A

                      \[\leadsto \color{blue}{\frac{b}{{c}^{2} + {d}^{2}} \cdot c} \]
                    5. lower-/.f64N/A

                      \[\leadsto \color{blue}{\frac{b}{{c}^{2} + {d}^{2}}} \cdot c \]
                    6. +-commutativeN/A

                      \[\leadsto \frac{b}{\color{blue}{{d}^{2} + {c}^{2}}} \cdot c \]
                    7. unpow2N/A

                      \[\leadsto \frac{b}{\color{blue}{d \cdot d} + {c}^{2}} \cdot c \]
                    8. lower-fma.f64N/A

                      \[\leadsto \frac{b}{\color{blue}{\mathsf{fma}\left(d, d, {c}^{2}\right)}} \cdot c \]
                    9. unpow2N/A

                      \[\leadsto \frac{b}{\mathsf{fma}\left(d, d, \color{blue}{c \cdot c}\right)} \cdot c \]
                    10. lower-*.f6480.9

                      \[\leadsto \frac{b}{\mathsf{fma}\left(d, d, \color{blue}{c \cdot c}\right)} \cdot c \]
                  5. Applied rewrites80.9%

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

                  if -2.0999999999999999e-14 < c < 9.99999999999999943e-68

                  1. Initial program 74.2%

                    \[\frac{b \cdot c - a \cdot d}{c \cdot c + d \cdot d} \]
                  2. Add Preprocessing
                  3. Taylor expanded in c around 0

                    \[\leadsto \frac{b \cdot c - a \cdot d}{\color{blue}{{d}^{2}}} \]
                  4. Step-by-step derivation
                    1. unpow2N/A

                      \[\leadsto \frac{b \cdot c - a \cdot d}{\color{blue}{d \cdot d}} \]
                    2. lower-*.f6467.7

                      \[\leadsto \frac{b \cdot c - a \cdot d}{\color{blue}{d \cdot d}} \]
                  5. Applied rewrites67.7%

                    \[\leadsto \frac{b \cdot c - a \cdot d}{\color{blue}{d \cdot d}} \]

                  if 9.99999999999999943e-68 < c < 3.7999999999999997e88

                  1. Initial program 88.7%

                    \[\frac{b \cdot c - a \cdot d}{c \cdot c + d \cdot d} \]
                  2. Add Preprocessing
                  3. Taylor expanded in c around inf

                    \[\leadsto \frac{b \cdot c - a \cdot d}{\color{blue}{{c}^{2}}} \]
                  4. Step-by-step derivation
                    1. unpow2N/A

                      \[\leadsto \frac{b \cdot c - a \cdot d}{\color{blue}{c \cdot c}} \]
                    2. lower-*.f6475.3

                      \[\leadsto \frac{b \cdot c - a \cdot d}{\color{blue}{c \cdot c}} \]
                  5. Applied rewrites75.3%

                    \[\leadsto \frac{b \cdot c - a \cdot d}{\color{blue}{c \cdot c}} \]

                  if 3.7999999999999997e88 < c

                  1. Initial program 43.5%

                    \[\frac{b \cdot c - a \cdot d}{c \cdot c + d \cdot d} \]
                  2. Add Preprocessing
                  3. Taylor expanded in c around inf

                    \[\leadsto \color{blue}{\frac{b}{c}} \]
                  4. Step-by-step derivation
                    1. lower-/.f6478.3

                      \[\leadsto \color{blue}{\frac{b}{c}} \]
                  5. Applied rewrites78.3%

                    \[\leadsto \color{blue}{\frac{b}{c}} \]
                7. Recombined 5 regimes into one program.
                8. Final simplification74.0%

                  \[\leadsto \begin{array}{l} \mathbf{if}\;c \leq -1.25 \cdot 10^{+123}:\\ \;\;\;\;\frac{1}{\frac{c}{b}}\\ \mathbf{elif}\;c \leq -2.1 \cdot 10^{-14}:\\ \;\;\;\;\frac{b}{\mathsf{fma}\left(d, d, c \cdot c\right)} \cdot c\\ \mathbf{elif}\;c \leq 10^{-67}:\\ \;\;\;\;\frac{b \cdot c - d \cdot a}{d \cdot d}\\ \mathbf{elif}\;c \leq 3.8 \cdot 10^{+88}:\\ \;\;\;\;\frac{b \cdot c - d \cdot a}{c \cdot c}\\ \mathbf{else}:\\ \;\;\;\;\frac{b}{c}\\ \end{array} \]
                9. Add Preprocessing

                Alternative 8: 65.6% accurate, 0.7× speedup?

                \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;c \leq -1.25 \cdot 10^{+123}:\\ \;\;\;\;\frac{1}{\frac{c}{b}}\\ \mathbf{elif}\;c \leq -2.65 \cdot 10^{-14}:\\ \;\;\;\;\frac{b}{\mathsf{fma}\left(d, d, c \cdot c\right)} \cdot c\\ \mathbf{elif}\;c \leq 8 \cdot 10^{-74}:\\ \;\;\;\;\frac{-a}{d}\\ \mathbf{elif}\;c \leq 3.8 \cdot 10^{+88}:\\ \;\;\;\;\frac{b \cdot c - d \cdot a}{c \cdot c}\\ \mathbf{else}:\\ \;\;\;\;\frac{b}{c}\\ \end{array} \end{array} \]
                (FPCore (a b c d)
                 :precision binary64
                 (if (<= c -1.25e+123)
                   (/ 1.0 (/ c b))
                   (if (<= c -2.65e-14)
                     (* (/ b (fma d d (* c c))) c)
                     (if (<= c 8e-74)
                       (/ (- a) d)
                       (if (<= c 3.8e+88) (/ (- (* b c) (* d a)) (* c c)) (/ b c))))))
                double code(double a, double b, double c, double d) {
                	double tmp;
                	if (c <= -1.25e+123) {
                		tmp = 1.0 / (c / b);
                	} else if (c <= -2.65e-14) {
                		tmp = (b / fma(d, d, (c * c))) * c;
                	} else if (c <= 8e-74) {
                		tmp = -a / d;
                	} else if (c <= 3.8e+88) {
                		tmp = ((b * c) - (d * a)) / (c * c);
                	} else {
                		tmp = b / c;
                	}
                	return tmp;
                }
                
                function code(a, b, c, d)
                	tmp = 0.0
                	if (c <= -1.25e+123)
                		tmp = Float64(1.0 / Float64(c / b));
                	elseif (c <= -2.65e-14)
                		tmp = Float64(Float64(b / fma(d, d, Float64(c * c))) * c);
                	elseif (c <= 8e-74)
                		tmp = Float64(Float64(-a) / d);
                	elseif (c <= 3.8e+88)
                		tmp = Float64(Float64(Float64(b * c) - Float64(d * a)) / Float64(c * c));
                	else
                		tmp = Float64(b / c);
                	end
                	return tmp
                end
                
                code[a_, b_, c_, d_] := If[LessEqual[c, -1.25e+123], N[(1.0 / N[(c / b), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, -2.65e-14], N[(N[(b / N[(d * d + N[(c * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision], If[LessEqual[c, 8e-74], N[((-a) / d), $MachinePrecision], If[LessEqual[c, 3.8e+88], N[(N[(N[(b * c), $MachinePrecision] - N[(d * a), $MachinePrecision]), $MachinePrecision] / N[(c * c), $MachinePrecision]), $MachinePrecision], N[(b / c), $MachinePrecision]]]]]
                
                \begin{array}{l}
                
                \\
                \begin{array}{l}
                \mathbf{if}\;c \leq -1.25 \cdot 10^{+123}:\\
                \;\;\;\;\frac{1}{\frac{c}{b}}\\
                
                \mathbf{elif}\;c \leq -2.65 \cdot 10^{-14}:\\
                \;\;\;\;\frac{b}{\mathsf{fma}\left(d, d, c \cdot c\right)} \cdot c\\
                
                \mathbf{elif}\;c \leq 8 \cdot 10^{-74}:\\
                \;\;\;\;\frac{-a}{d}\\
                
                \mathbf{elif}\;c \leq 3.8 \cdot 10^{+88}:\\
                \;\;\;\;\frac{b \cdot c - d \cdot a}{c \cdot c}\\
                
                \mathbf{else}:\\
                \;\;\;\;\frac{b}{c}\\
                
                
                \end{array}
                \end{array}
                
                Derivation
                1. Split input into 5 regimes
                2. if c < -1.24999999999999994e123

                  1. Initial program 39.5%

                    \[\frac{b \cdot c - a \cdot d}{c \cdot c + d \cdot d} \]
                  2. Add Preprocessing
                  3. Taylor expanded in c around inf

                    \[\leadsto \color{blue}{\frac{b}{c}} \]
                  4. Step-by-step derivation
                    1. lower-/.f6476.7

                      \[\leadsto \color{blue}{\frac{b}{c}} \]
                  5. Applied rewrites76.7%

                    \[\leadsto \color{blue}{\frac{b}{c}} \]
                  6. Step-by-step derivation
                    1. Applied rewrites77.5%

                      \[\leadsto \frac{1}{\color{blue}{\frac{c}{b}}} \]

                    if -1.24999999999999994e123 < c < -2.6500000000000001e-14

                    1. Initial program 74.9%

                      \[\frac{b \cdot c - a \cdot d}{c \cdot c + d \cdot d} \]
                    2. Add Preprocessing
                    3. Taylor expanded in a around 0

                      \[\leadsto \color{blue}{\frac{b \cdot c}{{c}^{2} + {d}^{2}}} \]
                    4. Step-by-step derivation
                      1. *-commutativeN/A

                        \[\leadsto \frac{\color{blue}{c \cdot b}}{{c}^{2} + {d}^{2}} \]
                      2. associate-/l*N/A

                        \[\leadsto \color{blue}{c \cdot \frac{b}{{c}^{2} + {d}^{2}}} \]
                      3. *-commutativeN/A

                        \[\leadsto \color{blue}{\frac{b}{{c}^{2} + {d}^{2}} \cdot c} \]
                      4. lower-*.f64N/A

                        \[\leadsto \color{blue}{\frac{b}{{c}^{2} + {d}^{2}} \cdot c} \]
                      5. lower-/.f64N/A

                        \[\leadsto \color{blue}{\frac{b}{{c}^{2} + {d}^{2}}} \cdot c \]
                      6. +-commutativeN/A

                        \[\leadsto \frac{b}{\color{blue}{{d}^{2} + {c}^{2}}} \cdot c \]
                      7. unpow2N/A

                        \[\leadsto \frac{b}{\color{blue}{d \cdot d} + {c}^{2}} \cdot c \]
                      8. lower-fma.f64N/A

                        \[\leadsto \frac{b}{\color{blue}{\mathsf{fma}\left(d, d, {c}^{2}\right)}} \cdot c \]
                      9. unpow2N/A

                        \[\leadsto \frac{b}{\mathsf{fma}\left(d, d, \color{blue}{c \cdot c}\right)} \cdot c \]
                      10. lower-*.f6480.9

                        \[\leadsto \frac{b}{\mathsf{fma}\left(d, d, \color{blue}{c \cdot c}\right)} \cdot c \]
                    5. Applied rewrites80.9%

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

                    if -2.6500000000000001e-14 < c < 7.99999999999999966e-74

                    1. Initial program 73.9%

                      \[\frac{b \cdot c - a \cdot d}{c \cdot c + d \cdot d} \]
                    2. Add Preprocessing
                    3. Taylor expanded in c around 0

                      \[\leadsto \color{blue}{-1 \cdot \frac{a}{d}} \]
                    4. Step-by-step derivation
                      1. mul-1-negN/A

                        \[\leadsto \color{blue}{\mathsf{neg}\left(\frac{a}{d}\right)} \]
                      2. distribute-neg-frac2N/A

                        \[\leadsto \color{blue}{\frac{a}{\mathsf{neg}\left(d\right)}} \]
                      3. mul-1-negN/A

                        \[\leadsto \frac{a}{\color{blue}{-1 \cdot d}} \]
                      4. lower-/.f64N/A

                        \[\leadsto \color{blue}{\frac{a}{-1 \cdot d}} \]
                      5. mul-1-negN/A

                        \[\leadsto \frac{a}{\color{blue}{\mathsf{neg}\left(d\right)}} \]
                      6. lower-neg.f6465.3

                        \[\leadsto \frac{a}{\color{blue}{-d}} \]
                    5. Applied rewrites65.3%

                      \[\leadsto \color{blue}{\frac{a}{-d}} \]

                    if 7.99999999999999966e-74 < c < 3.7999999999999997e88

                    1. Initial program 89.2%

                      \[\frac{b \cdot c - a \cdot d}{c \cdot c + d \cdot d} \]
                    2. Add Preprocessing
                    3. Taylor expanded in c around inf

                      \[\leadsto \frac{b \cdot c - a \cdot d}{\color{blue}{{c}^{2}}} \]
                    4. Step-by-step derivation
                      1. unpow2N/A

                        \[\leadsto \frac{b \cdot c - a \cdot d}{\color{blue}{c \cdot c}} \]
                      2. lower-*.f6472.0

                        \[\leadsto \frac{b \cdot c - a \cdot d}{\color{blue}{c \cdot c}} \]
                    5. Applied rewrites72.0%

                      \[\leadsto \frac{b \cdot c - a \cdot d}{\color{blue}{c \cdot c}} \]

                    if 3.7999999999999997e88 < c

                    1. Initial program 43.5%

                      \[\frac{b \cdot c - a \cdot d}{c \cdot c + d \cdot d} \]
                    2. Add Preprocessing
                    3. Taylor expanded in c around inf

                      \[\leadsto \color{blue}{\frac{b}{c}} \]
                    4. Step-by-step derivation
                      1. lower-/.f6478.3

                        \[\leadsto \color{blue}{\frac{b}{c}} \]
                    5. Applied rewrites78.3%

                      \[\leadsto \color{blue}{\frac{b}{c}} \]
                  7. Recombined 5 regimes into one program.
                  8. Final simplification72.8%

                    \[\leadsto \begin{array}{l} \mathbf{if}\;c \leq -1.25 \cdot 10^{+123}:\\ \;\;\;\;\frac{1}{\frac{c}{b}}\\ \mathbf{elif}\;c \leq -2.65 \cdot 10^{-14}:\\ \;\;\;\;\frac{b}{\mathsf{fma}\left(d, d, c \cdot c\right)} \cdot c\\ \mathbf{elif}\;c \leq 8 \cdot 10^{-74}:\\ \;\;\;\;\frac{-a}{d}\\ \mathbf{elif}\;c \leq 3.8 \cdot 10^{+88}:\\ \;\;\;\;\frac{b \cdot c - d \cdot a}{c \cdot c}\\ \mathbf{else}:\\ \;\;\;\;\frac{b}{c}\\ \end{array} \]
                  9. Add Preprocessing

                  Alternative 9: 65.8% accurate, 0.7× speedup?

                  \[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{b}{\mathsf{fma}\left(d, d, c \cdot c\right)} \cdot c\\ \mathbf{if}\;c \leq -1.25 \cdot 10^{+123}:\\ \;\;\;\;\frac{1}{\frac{c}{b}}\\ \mathbf{elif}\;c \leq -2.65 \cdot 10^{-14}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;c \leq 1.12 \cdot 10^{-92}:\\ \;\;\;\;\frac{-a}{d}\\ \mathbf{elif}\;c \leq 4.1 \cdot 10^{+119}:\\ \;\;\;\;t\_0\\ \mathbf{else}:\\ \;\;\;\;\frac{b}{c}\\ \end{array} \end{array} \]
                  (FPCore (a b c d)
                   :precision binary64
                   (let* ((t_0 (* (/ b (fma d d (* c c))) c)))
                     (if (<= c -1.25e+123)
                       (/ 1.0 (/ c b))
                       (if (<= c -2.65e-14)
                         t_0
                         (if (<= c 1.12e-92) (/ (- a) d) (if (<= c 4.1e+119) t_0 (/ b c)))))))
                  double code(double a, double b, double c, double d) {
                  	double t_0 = (b / fma(d, d, (c * c))) * c;
                  	double tmp;
                  	if (c <= -1.25e+123) {
                  		tmp = 1.0 / (c / b);
                  	} else if (c <= -2.65e-14) {
                  		tmp = t_0;
                  	} else if (c <= 1.12e-92) {
                  		tmp = -a / d;
                  	} else if (c <= 4.1e+119) {
                  		tmp = t_0;
                  	} else {
                  		tmp = b / c;
                  	}
                  	return tmp;
                  }
                  
                  function code(a, b, c, d)
                  	t_0 = Float64(Float64(b / fma(d, d, Float64(c * c))) * c)
                  	tmp = 0.0
                  	if (c <= -1.25e+123)
                  		tmp = Float64(1.0 / Float64(c / b));
                  	elseif (c <= -2.65e-14)
                  		tmp = t_0;
                  	elseif (c <= 1.12e-92)
                  		tmp = Float64(Float64(-a) / d);
                  	elseif (c <= 4.1e+119)
                  		tmp = t_0;
                  	else
                  		tmp = Float64(b / c);
                  	end
                  	return tmp
                  end
                  
                  code[a_, b_, c_, d_] := Block[{t$95$0 = N[(N[(b / N[(d * d + N[(c * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision]}, If[LessEqual[c, -1.25e+123], N[(1.0 / N[(c / b), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, -2.65e-14], t$95$0, If[LessEqual[c, 1.12e-92], N[((-a) / d), $MachinePrecision], If[LessEqual[c, 4.1e+119], t$95$0, N[(b / c), $MachinePrecision]]]]]]
                  
                  \begin{array}{l}
                  
                  \\
                  \begin{array}{l}
                  t_0 := \frac{b}{\mathsf{fma}\left(d, d, c \cdot c\right)} \cdot c\\
                  \mathbf{if}\;c \leq -1.25 \cdot 10^{+123}:\\
                  \;\;\;\;\frac{1}{\frac{c}{b}}\\
                  
                  \mathbf{elif}\;c \leq -2.65 \cdot 10^{-14}:\\
                  \;\;\;\;t\_0\\
                  
                  \mathbf{elif}\;c \leq 1.12 \cdot 10^{-92}:\\
                  \;\;\;\;\frac{-a}{d}\\
                  
                  \mathbf{elif}\;c \leq 4.1 \cdot 10^{+119}:\\
                  \;\;\;\;t\_0\\
                  
                  \mathbf{else}:\\
                  \;\;\;\;\frac{b}{c}\\
                  
                  
                  \end{array}
                  \end{array}
                  
                  Derivation
                  1. Split input into 4 regimes
                  2. if c < -1.24999999999999994e123

                    1. Initial program 39.5%

                      \[\frac{b \cdot c - a \cdot d}{c \cdot c + d \cdot d} \]
                    2. Add Preprocessing
                    3. Taylor expanded in c around inf

                      \[\leadsto \color{blue}{\frac{b}{c}} \]
                    4. Step-by-step derivation
                      1. lower-/.f6476.7

                        \[\leadsto \color{blue}{\frac{b}{c}} \]
                    5. Applied rewrites76.7%

                      \[\leadsto \color{blue}{\frac{b}{c}} \]
                    6. Step-by-step derivation
                      1. Applied rewrites77.5%

                        \[\leadsto \frac{1}{\color{blue}{\frac{c}{b}}} \]

                      if -1.24999999999999994e123 < c < -2.6500000000000001e-14 or 1.11999999999999999e-92 < c < 4.0999999999999997e119

                      1. Initial program 77.2%

                        \[\frac{b \cdot c - a \cdot d}{c \cdot c + d \cdot d} \]
                      2. Add Preprocessing
                      3. Taylor expanded in a around 0

                        \[\leadsto \color{blue}{\frac{b \cdot c}{{c}^{2} + {d}^{2}}} \]
                      4. Step-by-step derivation
                        1. *-commutativeN/A

                          \[\leadsto \frac{\color{blue}{c \cdot b}}{{c}^{2} + {d}^{2}} \]
                        2. associate-/l*N/A

                          \[\leadsto \color{blue}{c \cdot \frac{b}{{c}^{2} + {d}^{2}}} \]
                        3. *-commutativeN/A

                          \[\leadsto \color{blue}{\frac{b}{{c}^{2} + {d}^{2}} \cdot c} \]
                        4. lower-*.f64N/A

                          \[\leadsto \color{blue}{\frac{b}{{c}^{2} + {d}^{2}} \cdot c} \]
                        5. lower-/.f64N/A

                          \[\leadsto \color{blue}{\frac{b}{{c}^{2} + {d}^{2}}} \cdot c \]
                        6. +-commutativeN/A

                          \[\leadsto \frac{b}{\color{blue}{{d}^{2} + {c}^{2}}} \cdot c \]
                        7. unpow2N/A

                          \[\leadsto \frac{b}{\color{blue}{d \cdot d} + {c}^{2}} \cdot c \]
                        8. lower-fma.f64N/A

                          \[\leadsto \frac{b}{\color{blue}{\mathsf{fma}\left(d, d, {c}^{2}\right)}} \cdot c \]
                        9. unpow2N/A

                          \[\leadsto \frac{b}{\mathsf{fma}\left(d, d, \color{blue}{c \cdot c}\right)} \cdot c \]
                        10. lower-*.f6472.8

                          \[\leadsto \frac{b}{\mathsf{fma}\left(d, d, \color{blue}{c \cdot c}\right)} \cdot c \]
                      5. Applied rewrites72.8%

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

                      if -2.6500000000000001e-14 < c < 1.11999999999999999e-92

                      1. Initial program 73.4%

                        \[\frac{b \cdot c - a \cdot d}{c \cdot c + d \cdot d} \]
                      2. Add Preprocessing
                      3. Taylor expanded in c around 0

                        \[\leadsto \color{blue}{-1 \cdot \frac{a}{d}} \]
                      4. Step-by-step derivation
                        1. mul-1-negN/A

                          \[\leadsto \color{blue}{\mathsf{neg}\left(\frac{a}{d}\right)} \]
                        2. distribute-neg-frac2N/A

                          \[\leadsto \color{blue}{\frac{a}{\mathsf{neg}\left(d\right)}} \]
                        3. mul-1-negN/A

                          \[\leadsto \frac{a}{\color{blue}{-1 \cdot d}} \]
                        4. lower-/.f64N/A

                          \[\leadsto \color{blue}{\frac{a}{-1 \cdot d}} \]
                        5. mul-1-negN/A

                          \[\leadsto \frac{a}{\color{blue}{\mathsf{neg}\left(d\right)}} \]
                        6. lower-neg.f6466.0

                          \[\leadsto \frac{a}{\color{blue}{-d}} \]
                      5. Applied rewrites66.0%

                        \[\leadsto \color{blue}{\frac{a}{-d}} \]

                      if 4.0999999999999997e119 < c

                      1. Initial program 42.2%

                        \[\frac{b \cdot c - a \cdot d}{c \cdot c + d \cdot d} \]
                      2. Add Preprocessing
                      3. Taylor expanded in c around inf

                        \[\leadsto \color{blue}{\frac{b}{c}} \]
                      4. Step-by-step derivation
                        1. lower-/.f6482.3

                          \[\leadsto \color{blue}{\frac{b}{c}} \]
                      5. Applied rewrites82.3%

                        \[\leadsto \color{blue}{\frac{b}{c}} \]
                    7. Recombined 4 regimes into one program.
                    8. Final simplification72.8%

                      \[\leadsto \begin{array}{l} \mathbf{if}\;c \leq -1.25 \cdot 10^{+123}:\\ \;\;\;\;\frac{1}{\frac{c}{b}}\\ \mathbf{elif}\;c \leq -2.65 \cdot 10^{-14}:\\ \;\;\;\;\frac{b}{\mathsf{fma}\left(d, d, c \cdot c\right)} \cdot c\\ \mathbf{elif}\;c \leq 1.12 \cdot 10^{-92}:\\ \;\;\;\;\frac{-a}{d}\\ \mathbf{elif}\;c \leq 4.1 \cdot 10^{+119}:\\ \;\;\;\;\frac{b}{\mathsf{fma}\left(d, d, c \cdot c\right)} \cdot c\\ \mathbf{else}:\\ \;\;\;\;\frac{b}{c}\\ \end{array} \]
                    9. Add Preprocessing

                    Alternative 10: 76.0% accurate, 0.8× speedup?

                    \[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{b - \frac{d \cdot a}{c}}{c}\\ \mathbf{if}\;c \leq -7.6 \cdot 10^{+121}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;c \leq -1.85 \cdot 10^{-8}:\\ \;\;\;\;\frac{b}{\mathsf{fma}\left(d, d, c \cdot c\right)} \cdot c\\ \mathbf{elif}\;c \leq 2 \cdot 10^{-67}:\\ \;\;\;\;\frac{\frac{b \cdot c}{d} - a}{d}\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
                    (FPCore (a b c d)
                     :precision binary64
                     (let* ((t_0 (/ (- b (/ (* d a) c)) c)))
                       (if (<= c -7.6e+121)
                         t_0
                         (if (<= c -1.85e-8)
                           (* (/ b (fma d d (* c c))) c)
                           (if (<= c 2e-67) (/ (- (/ (* b c) d) a) d) t_0)))))
                    double code(double a, double b, double c, double d) {
                    	double t_0 = (b - ((d * a) / c)) / c;
                    	double tmp;
                    	if (c <= -7.6e+121) {
                    		tmp = t_0;
                    	} else if (c <= -1.85e-8) {
                    		tmp = (b / fma(d, d, (c * c))) * c;
                    	} else if (c <= 2e-67) {
                    		tmp = (((b * c) / d) - a) / d;
                    	} else {
                    		tmp = t_0;
                    	}
                    	return tmp;
                    }
                    
                    function code(a, b, c, d)
                    	t_0 = Float64(Float64(b - Float64(Float64(d * a) / c)) / c)
                    	tmp = 0.0
                    	if (c <= -7.6e+121)
                    		tmp = t_0;
                    	elseif (c <= -1.85e-8)
                    		tmp = Float64(Float64(b / fma(d, d, Float64(c * c))) * c);
                    	elseif (c <= 2e-67)
                    		tmp = Float64(Float64(Float64(Float64(b * c) / d) - a) / d);
                    	else
                    		tmp = t_0;
                    	end
                    	return tmp
                    end
                    
                    code[a_, b_, c_, d_] := Block[{t$95$0 = N[(N[(b - N[(N[(d * a), $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision]}, If[LessEqual[c, -7.6e+121], t$95$0, If[LessEqual[c, -1.85e-8], N[(N[(b / N[(d * d + N[(c * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision], If[LessEqual[c, 2e-67], N[(N[(N[(N[(b * c), $MachinePrecision] / d), $MachinePrecision] - a), $MachinePrecision] / d), $MachinePrecision], t$95$0]]]]
                    
                    \begin{array}{l}
                    
                    \\
                    \begin{array}{l}
                    t_0 := \frac{b - \frac{d \cdot a}{c}}{c}\\
                    \mathbf{if}\;c \leq -7.6 \cdot 10^{+121}:\\
                    \;\;\;\;t\_0\\
                    
                    \mathbf{elif}\;c \leq -1.85 \cdot 10^{-8}:\\
                    \;\;\;\;\frac{b}{\mathsf{fma}\left(d, d, c \cdot c\right)} \cdot c\\
                    
                    \mathbf{elif}\;c \leq 2 \cdot 10^{-67}:\\
                    \;\;\;\;\frac{\frac{b \cdot c}{d} - a}{d}\\
                    
                    \mathbf{else}:\\
                    \;\;\;\;t\_0\\
                    
                    
                    \end{array}
                    \end{array}
                    
                    Derivation
                    1. Split input into 3 regimes
                    2. if c < -7.6e121 or 1.99999999999999989e-67 < c

                      1. Initial program 49.3%

                        \[\frac{b \cdot c - a \cdot d}{c \cdot c + d \cdot d} \]
                      2. Add Preprocessing
                      3. Taylor expanded in c around inf

                        \[\leadsto \color{blue}{\frac{b + -1 \cdot \frac{a \cdot d}{c}}{c}} \]
                      4. Step-by-step derivation
                        1. lower-/.f64N/A

                          \[\leadsto \color{blue}{\frac{b + -1 \cdot \frac{a \cdot d}{c}}{c}} \]
                        2. mul-1-negN/A

                          \[\leadsto \frac{b + \color{blue}{\left(\mathsf{neg}\left(\frac{a \cdot d}{c}\right)\right)}}{c} \]
                        3. unsub-negN/A

                          \[\leadsto \frac{\color{blue}{b - \frac{a \cdot d}{c}}}{c} \]
                        4. lower--.f64N/A

                          \[\leadsto \frac{\color{blue}{b - \frac{a \cdot d}{c}}}{c} \]
                        5. lower-/.f64N/A

                          \[\leadsto \frac{b - \color{blue}{\frac{a \cdot d}{c}}}{c} \]
                        6. lower-*.f6483.5

                          \[\leadsto \frac{b - \frac{\color{blue}{a \cdot d}}{c}}{c} \]
                      5. Applied rewrites83.5%

                        \[\leadsto \color{blue}{\frac{b - \frac{a \cdot d}{c}}{c}} \]

                      if -7.6e121 < c < -1.85e-8

                      1. Initial program 76.4%

                        \[\frac{b \cdot c - a \cdot d}{c \cdot c + d \cdot d} \]
                      2. Add Preprocessing
                      3. Taylor expanded in a around 0

                        \[\leadsto \color{blue}{\frac{b \cdot c}{{c}^{2} + {d}^{2}}} \]
                      4. Step-by-step derivation
                        1. *-commutativeN/A

                          \[\leadsto \frac{\color{blue}{c \cdot b}}{{c}^{2} + {d}^{2}} \]
                        2. associate-/l*N/A

                          \[\leadsto \color{blue}{c \cdot \frac{b}{{c}^{2} + {d}^{2}}} \]
                        3. *-commutativeN/A

                          \[\leadsto \color{blue}{\frac{b}{{c}^{2} + {d}^{2}} \cdot c} \]
                        4. lower-*.f64N/A

                          \[\leadsto \color{blue}{\frac{b}{{c}^{2} + {d}^{2}} \cdot c} \]
                        5. lower-/.f64N/A

                          \[\leadsto \color{blue}{\frac{b}{{c}^{2} + {d}^{2}}} \cdot c \]
                        6. +-commutativeN/A

                          \[\leadsto \frac{b}{\color{blue}{{d}^{2} + {c}^{2}}} \cdot c \]
                        7. unpow2N/A

                          \[\leadsto \frac{b}{\color{blue}{d \cdot d} + {c}^{2}} \cdot c \]
                        8. lower-fma.f64N/A

                          \[\leadsto \frac{b}{\color{blue}{\mathsf{fma}\left(d, d, {c}^{2}\right)}} \cdot c \]
                        9. unpow2N/A

                          \[\leadsto \frac{b}{\mathsf{fma}\left(d, d, \color{blue}{c \cdot c}\right)} \cdot c \]
                        10. lower-*.f6479.8

                          \[\leadsto \frac{b}{\mathsf{fma}\left(d, d, \color{blue}{c \cdot c}\right)} \cdot c \]
                      5. Applied rewrites79.8%

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

                      if -1.85e-8 < c < 1.99999999999999989e-67

                      1. Initial program 74.4%

                        \[\frac{b \cdot c - a \cdot d}{c \cdot c + d \cdot d} \]
                      2. Add Preprocessing
                      3. Taylor expanded in c around 0

                        \[\leadsto \color{blue}{-1 \cdot \frac{a}{d} + \frac{b \cdot c}{{d}^{2}}} \]
                      4. Step-by-step derivation
                        1. +-commutativeN/A

                          \[\leadsto \color{blue}{\frac{b \cdot c}{{d}^{2}} + -1 \cdot \frac{a}{d}} \]
                        2. mul-1-negN/A

                          \[\leadsto \frac{b \cdot c}{{d}^{2}} + \color{blue}{\left(\mathsf{neg}\left(\frac{a}{d}\right)\right)} \]
                        3. unsub-negN/A

                          \[\leadsto \color{blue}{\frac{b \cdot c}{{d}^{2}} - \frac{a}{d}} \]
                        4. unpow2N/A

                          \[\leadsto \frac{b \cdot c}{\color{blue}{d \cdot d}} - \frac{a}{d} \]
                        5. associate-/r*N/A

                          \[\leadsto \color{blue}{\frac{\frac{b \cdot c}{d}}{d}} - \frac{a}{d} \]
                        6. div-subN/A

                          \[\leadsto \color{blue}{\frac{\frac{b \cdot c}{d} - a}{d}} \]
                        7. lower-/.f64N/A

                          \[\leadsto \color{blue}{\frac{\frac{b \cdot c}{d} - a}{d}} \]
                        8. lower--.f64N/A

                          \[\leadsto \frac{\color{blue}{\frac{b \cdot c}{d} - a}}{d} \]
                        9. lower-/.f64N/A

                          \[\leadsto \frac{\color{blue}{\frac{b \cdot c}{d}} - a}{d} \]
                        10. lower-*.f6489.1

                          \[\leadsto \frac{\frac{\color{blue}{b \cdot c}}{d} - a}{d} \]
                      5. Applied rewrites89.1%

                        \[\leadsto \color{blue}{\frac{\frac{b \cdot c}{d} - a}{d}} \]
                    3. Recombined 3 regimes into one program.
                    4. Final simplification85.3%

                      \[\leadsto \begin{array}{l} \mathbf{if}\;c \leq -7.6 \cdot 10^{+121}:\\ \;\;\;\;\frac{b - \frac{d \cdot a}{c}}{c}\\ \mathbf{elif}\;c \leq -1.85 \cdot 10^{-8}:\\ \;\;\;\;\frac{b}{\mathsf{fma}\left(d, d, c \cdot c\right)} \cdot c\\ \mathbf{elif}\;c \leq 2 \cdot 10^{-67}:\\ \;\;\;\;\frac{\frac{b \cdot c}{d} - a}{d}\\ \mathbf{else}:\\ \;\;\;\;\frac{b - \frac{d \cdot a}{c}}{c}\\ \end{array} \]
                    5. Add Preprocessing

                    Alternative 11: 75.1% accurate, 0.8× speedup?

                    \[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{b - \frac{d \cdot a}{c}}{c}\\ \mathbf{if}\;c \leq -7.6 \cdot 10^{+121}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;c \leq -1.85 \cdot 10^{-8}:\\ \;\;\;\;\frac{b}{\mathsf{fma}\left(d, d, c \cdot c\right)} \cdot c\\ \mathbf{elif}\;c \leq 2 \cdot 10^{-67}:\\ \;\;\;\;\frac{\frac{b}{d} \cdot c - a}{d}\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
                    (FPCore (a b c d)
                     :precision binary64
                     (let* ((t_0 (/ (- b (/ (* d a) c)) c)))
                       (if (<= c -7.6e+121)
                         t_0
                         (if (<= c -1.85e-8)
                           (* (/ b (fma d d (* c c))) c)
                           (if (<= c 2e-67) (/ (- (* (/ b d) c) a) d) t_0)))))
                    double code(double a, double b, double c, double d) {
                    	double t_0 = (b - ((d * a) / c)) / c;
                    	double tmp;
                    	if (c <= -7.6e+121) {
                    		tmp = t_0;
                    	} else if (c <= -1.85e-8) {
                    		tmp = (b / fma(d, d, (c * c))) * c;
                    	} else if (c <= 2e-67) {
                    		tmp = (((b / d) * c) - a) / d;
                    	} else {
                    		tmp = t_0;
                    	}
                    	return tmp;
                    }
                    
                    function code(a, b, c, d)
                    	t_0 = Float64(Float64(b - Float64(Float64(d * a) / c)) / c)
                    	tmp = 0.0
                    	if (c <= -7.6e+121)
                    		tmp = t_0;
                    	elseif (c <= -1.85e-8)
                    		tmp = Float64(Float64(b / fma(d, d, Float64(c * c))) * c);
                    	elseif (c <= 2e-67)
                    		tmp = Float64(Float64(Float64(Float64(b / d) * c) - a) / d);
                    	else
                    		tmp = t_0;
                    	end
                    	return tmp
                    end
                    
                    code[a_, b_, c_, d_] := Block[{t$95$0 = N[(N[(b - N[(N[(d * a), $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision]}, If[LessEqual[c, -7.6e+121], t$95$0, If[LessEqual[c, -1.85e-8], N[(N[(b / N[(d * d + N[(c * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision], If[LessEqual[c, 2e-67], N[(N[(N[(N[(b / d), $MachinePrecision] * c), $MachinePrecision] - a), $MachinePrecision] / d), $MachinePrecision], t$95$0]]]]
                    
                    \begin{array}{l}
                    
                    \\
                    \begin{array}{l}
                    t_0 := \frac{b - \frac{d \cdot a}{c}}{c}\\
                    \mathbf{if}\;c \leq -7.6 \cdot 10^{+121}:\\
                    \;\;\;\;t\_0\\
                    
                    \mathbf{elif}\;c \leq -1.85 \cdot 10^{-8}:\\
                    \;\;\;\;\frac{b}{\mathsf{fma}\left(d, d, c \cdot c\right)} \cdot c\\
                    
                    \mathbf{elif}\;c \leq 2 \cdot 10^{-67}:\\
                    \;\;\;\;\frac{\frac{b}{d} \cdot c - a}{d}\\
                    
                    \mathbf{else}:\\
                    \;\;\;\;t\_0\\
                    
                    
                    \end{array}
                    \end{array}
                    
                    Derivation
                    1. Split input into 3 regimes
                    2. if c < -7.6e121 or 1.99999999999999989e-67 < c

                      1. Initial program 49.3%

                        \[\frac{b \cdot c - a \cdot d}{c \cdot c + d \cdot d} \]
                      2. Add Preprocessing
                      3. Taylor expanded in c around inf

                        \[\leadsto \color{blue}{\frac{b + -1 \cdot \frac{a \cdot d}{c}}{c}} \]
                      4. Step-by-step derivation
                        1. lower-/.f64N/A

                          \[\leadsto \color{blue}{\frac{b + -1 \cdot \frac{a \cdot d}{c}}{c}} \]
                        2. mul-1-negN/A

                          \[\leadsto \frac{b + \color{blue}{\left(\mathsf{neg}\left(\frac{a \cdot d}{c}\right)\right)}}{c} \]
                        3. unsub-negN/A

                          \[\leadsto \frac{\color{blue}{b - \frac{a \cdot d}{c}}}{c} \]
                        4. lower--.f64N/A

                          \[\leadsto \frac{\color{blue}{b - \frac{a \cdot d}{c}}}{c} \]
                        5. lower-/.f64N/A

                          \[\leadsto \frac{b - \color{blue}{\frac{a \cdot d}{c}}}{c} \]
                        6. lower-*.f6483.5

                          \[\leadsto \frac{b - \frac{\color{blue}{a \cdot d}}{c}}{c} \]
                      5. Applied rewrites83.5%

                        \[\leadsto \color{blue}{\frac{b - \frac{a \cdot d}{c}}{c}} \]

                      if -7.6e121 < c < -1.85e-8

                      1. Initial program 76.4%

                        \[\frac{b \cdot c - a \cdot d}{c \cdot c + d \cdot d} \]
                      2. Add Preprocessing
                      3. Taylor expanded in a around 0

                        \[\leadsto \color{blue}{\frac{b \cdot c}{{c}^{2} + {d}^{2}}} \]
                      4. Step-by-step derivation
                        1. *-commutativeN/A

                          \[\leadsto \frac{\color{blue}{c \cdot b}}{{c}^{2} + {d}^{2}} \]
                        2. associate-/l*N/A

                          \[\leadsto \color{blue}{c \cdot \frac{b}{{c}^{2} + {d}^{2}}} \]
                        3. *-commutativeN/A

                          \[\leadsto \color{blue}{\frac{b}{{c}^{2} + {d}^{2}} \cdot c} \]
                        4. lower-*.f64N/A

                          \[\leadsto \color{blue}{\frac{b}{{c}^{2} + {d}^{2}} \cdot c} \]
                        5. lower-/.f64N/A

                          \[\leadsto \color{blue}{\frac{b}{{c}^{2} + {d}^{2}}} \cdot c \]
                        6. +-commutativeN/A

                          \[\leadsto \frac{b}{\color{blue}{{d}^{2} + {c}^{2}}} \cdot c \]
                        7. unpow2N/A

                          \[\leadsto \frac{b}{\color{blue}{d \cdot d} + {c}^{2}} \cdot c \]
                        8. lower-fma.f64N/A

                          \[\leadsto \frac{b}{\color{blue}{\mathsf{fma}\left(d, d, {c}^{2}\right)}} \cdot c \]
                        9. unpow2N/A

                          \[\leadsto \frac{b}{\mathsf{fma}\left(d, d, \color{blue}{c \cdot c}\right)} \cdot c \]
                        10. lower-*.f6479.8

                          \[\leadsto \frac{b}{\mathsf{fma}\left(d, d, \color{blue}{c \cdot c}\right)} \cdot c \]
                      5. Applied rewrites79.8%

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

                      if -1.85e-8 < c < 1.99999999999999989e-67

                      1. Initial program 74.4%

                        \[\frac{b \cdot c - a \cdot d}{c \cdot c + d \cdot d} \]
                      2. Add Preprocessing
                      3. Taylor expanded in c around 0

                        \[\leadsto \color{blue}{-1 \cdot \frac{a}{d} + \frac{b \cdot c}{{d}^{2}}} \]
                      4. Step-by-step derivation
                        1. +-commutativeN/A

                          \[\leadsto \color{blue}{\frac{b \cdot c}{{d}^{2}} + -1 \cdot \frac{a}{d}} \]
                        2. mul-1-negN/A

                          \[\leadsto \frac{b \cdot c}{{d}^{2}} + \color{blue}{\left(\mathsf{neg}\left(\frac{a}{d}\right)\right)} \]
                        3. unsub-negN/A

                          \[\leadsto \color{blue}{\frac{b \cdot c}{{d}^{2}} - \frac{a}{d}} \]
                        4. unpow2N/A

                          \[\leadsto \frac{b \cdot c}{\color{blue}{d \cdot d}} - \frac{a}{d} \]
                        5. associate-/r*N/A

                          \[\leadsto \color{blue}{\frac{\frac{b \cdot c}{d}}{d}} - \frac{a}{d} \]
                        6. div-subN/A

                          \[\leadsto \color{blue}{\frac{\frac{b \cdot c}{d} - a}{d}} \]
                        7. lower-/.f64N/A

                          \[\leadsto \color{blue}{\frac{\frac{b \cdot c}{d} - a}{d}} \]
                        8. lower--.f64N/A

                          \[\leadsto \frac{\color{blue}{\frac{b \cdot c}{d} - a}}{d} \]
                        9. lower-/.f64N/A

                          \[\leadsto \frac{\color{blue}{\frac{b \cdot c}{d}} - a}{d} \]
                        10. lower-*.f6489.1

                          \[\leadsto \frac{\frac{\color{blue}{b \cdot c}}{d} - a}{d} \]
                      5. Applied rewrites89.1%

                        \[\leadsto \color{blue}{\frac{\frac{b \cdot c}{d} - a}{d}} \]
                      6. Step-by-step derivation
                        1. Applied rewrites86.4%

                          \[\leadsto \frac{c \cdot \frac{b}{d} - a}{d} \]
                      7. Recombined 3 regimes into one program.
                      8. Final simplification84.2%

                        \[\leadsto \begin{array}{l} \mathbf{if}\;c \leq -7.6 \cdot 10^{+121}:\\ \;\;\;\;\frac{b - \frac{d \cdot a}{c}}{c}\\ \mathbf{elif}\;c \leq -1.85 \cdot 10^{-8}:\\ \;\;\;\;\frac{b}{\mathsf{fma}\left(d, d, c \cdot c\right)} \cdot c\\ \mathbf{elif}\;c \leq 2 \cdot 10^{-67}:\\ \;\;\;\;\frac{\frac{b}{d} \cdot c - a}{d}\\ \mathbf{else}:\\ \;\;\;\;\frac{b - \frac{d \cdot a}{c}}{c}\\ \end{array} \]
                      9. Add Preprocessing

                      Alternative 12: 65.7% accurate, 0.8× speedup?

                      \[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{b - \frac{d \cdot a}{c}}{c}\\ \mathbf{if}\;c \leq -7.6 \cdot 10^{+121}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;c \leq -2.1 \cdot 10^{-14}:\\ \;\;\;\;\frac{b}{\mathsf{fma}\left(d, d, c \cdot c\right)} \cdot c\\ \mathbf{elif}\;c \leq 10^{-67}:\\ \;\;\;\;\frac{\mathsf{fma}\left(-d, a, b \cdot c\right)}{d \cdot d}\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
                      (FPCore (a b c d)
                       :precision binary64
                       (let* ((t_0 (/ (- b (/ (* d a) c)) c)))
                         (if (<= c -7.6e+121)
                           t_0
                           (if (<= c -2.1e-14)
                             (* (/ b (fma d d (* c c))) c)
                             (if (<= c 1e-67) (/ (fma (- d) a (* b c)) (* d d)) t_0)))))
                      double code(double a, double b, double c, double d) {
                      	double t_0 = (b - ((d * a) / c)) / c;
                      	double tmp;
                      	if (c <= -7.6e+121) {
                      		tmp = t_0;
                      	} else if (c <= -2.1e-14) {
                      		tmp = (b / fma(d, d, (c * c))) * c;
                      	} else if (c <= 1e-67) {
                      		tmp = fma(-d, a, (b * c)) / (d * d);
                      	} else {
                      		tmp = t_0;
                      	}
                      	return tmp;
                      }
                      
                      function code(a, b, c, d)
                      	t_0 = Float64(Float64(b - Float64(Float64(d * a) / c)) / c)
                      	tmp = 0.0
                      	if (c <= -7.6e+121)
                      		tmp = t_0;
                      	elseif (c <= -2.1e-14)
                      		tmp = Float64(Float64(b / fma(d, d, Float64(c * c))) * c);
                      	elseif (c <= 1e-67)
                      		tmp = Float64(fma(Float64(-d), a, Float64(b * c)) / Float64(d * d));
                      	else
                      		tmp = t_0;
                      	end
                      	return tmp
                      end
                      
                      code[a_, b_, c_, d_] := Block[{t$95$0 = N[(N[(b - N[(N[(d * a), $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision]}, If[LessEqual[c, -7.6e+121], t$95$0, If[LessEqual[c, -2.1e-14], N[(N[(b / N[(d * d + N[(c * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision], If[LessEqual[c, 1e-67], N[(N[((-d) * a + N[(b * c), $MachinePrecision]), $MachinePrecision] / N[(d * d), $MachinePrecision]), $MachinePrecision], t$95$0]]]]
                      
                      \begin{array}{l}
                      
                      \\
                      \begin{array}{l}
                      t_0 := \frac{b - \frac{d \cdot a}{c}}{c}\\
                      \mathbf{if}\;c \leq -7.6 \cdot 10^{+121}:\\
                      \;\;\;\;t\_0\\
                      
                      \mathbf{elif}\;c \leq -2.1 \cdot 10^{-14}:\\
                      \;\;\;\;\frac{b}{\mathsf{fma}\left(d, d, c \cdot c\right)} \cdot c\\
                      
                      \mathbf{elif}\;c \leq 10^{-67}:\\
                      \;\;\;\;\frac{\mathsf{fma}\left(-d, a, b \cdot c\right)}{d \cdot d}\\
                      
                      \mathbf{else}:\\
                      \;\;\;\;t\_0\\
                      
                      
                      \end{array}
                      \end{array}
                      
                      Derivation
                      1. Split input into 3 regimes
                      2. if c < -7.6e121 or 9.99999999999999943e-68 < c

                        1. Initial program 49.3%

                          \[\frac{b \cdot c - a \cdot d}{c \cdot c + d \cdot d} \]
                        2. Add Preprocessing
                        3. Taylor expanded in c around inf

                          \[\leadsto \color{blue}{\frac{b + -1 \cdot \frac{a \cdot d}{c}}{c}} \]
                        4. Step-by-step derivation
                          1. lower-/.f64N/A

                            \[\leadsto \color{blue}{\frac{b + -1 \cdot \frac{a \cdot d}{c}}{c}} \]
                          2. mul-1-negN/A

                            \[\leadsto \frac{b + \color{blue}{\left(\mathsf{neg}\left(\frac{a \cdot d}{c}\right)\right)}}{c} \]
                          3. unsub-negN/A

                            \[\leadsto \frac{\color{blue}{b - \frac{a \cdot d}{c}}}{c} \]
                          4. lower--.f64N/A

                            \[\leadsto \frac{\color{blue}{b - \frac{a \cdot d}{c}}}{c} \]
                          5. lower-/.f64N/A

                            \[\leadsto \frac{b - \color{blue}{\frac{a \cdot d}{c}}}{c} \]
                          6. lower-*.f6483.5

                            \[\leadsto \frac{b - \frac{\color{blue}{a \cdot d}}{c}}{c} \]
                        5. Applied rewrites83.5%

                          \[\leadsto \color{blue}{\frac{b - \frac{a \cdot d}{c}}{c}} \]

                        if -7.6e121 < c < -2.0999999999999999e-14

                        1. Initial program 77.0%

                          \[\frac{b \cdot c - a \cdot d}{c \cdot c + d \cdot d} \]
                        2. Add Preprocessing
                        3. Taylor expanded in a around 0

                          \[\leadsto \color{blue}{\frac{b \cdot c}{{c}^{2} + {d}^{2}}} \]
                        4. Step-by-step derivation
                          1. *-commutativeN/A

                            \[\leadsto \frac{\color{blue}{c \cdot b}}{{c}^{2} + {d}^{2}} \]
                          2. associate-/l*N/A

                            \[\leadsto \color{blue}{c \cdot \frac{b}{{c}^{2} + {d}^{2}}} \]
                          3. *-commutativeN/A

                            \[\leadsto \color{blue}{\frac{b}{{c}^{2} + {d}^{2}} \cdot c} \]
                          4. lower-*.f64N/A

                            \[\leadsto \color{blue}{\frac{b}{{c}^{2} + {d}^{2}} \cdot c} \]
                          5. lower-/.f64N/A

                            \[\leadsto \color{blue}{\frac{b}{{c}^{2} + {d}^{2}}} \cdot c \]
                          6. +-commutativeN/A

                            \[\leadsto \frac{b}{\color{blue}{{d}^{2} + {c}^{2}}} \cdot c \]
                          7. unpow2N/A

                            \[\leadsto \frac{b}{\color{blue}{d \cdot d} + {c}^{2}} \cdot c \]
                          8. lower-fma.f64N/A

                            \[\leadsto \frac{b}{\color{blue}{\mathsf{fma}\left(d, d, {c}^{2}\right)}} \cdot c \]
                          9. unpow2N/A

                            \[\leadsto \frac{b}{\mathsf{fma}\left(d, d, \color{blue}{c \cdot c}\right)} \cdot c \]
                          10. lower-*.f6480.4

                            \[\leadsto \frac{b}{\mathsf{fma}\left(d, d, \color{blue}{c \cdot c}\right)} \cdot c \]
                        5. Applied rewrites80.4%

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

                        if -2.0999999999999999e-14 < c < 9.99999999999999943e-68

                        1. Initial program 74.2%

                          \[\frac{b \cdot c - a \cdot d}{c \cdot c + d \cdot d} \]
                        2. Add Preprocessing
                        3. Taylor expanded in c around 0

                          \[\leadsto \frac{b \cdot c - a \cdot d}{\color{blue}{{d}^{2}}} \]
                        4. Step-by-step derivation
                          1. unpow2N/A

                            \[\leadsto \frac{b \cdot c - a \cdot d}{\color{blue}{d \cdot d}} \]
                          2. lower-*.f6467.7

                            \[\leadsto \frac{b \cdot c - a \cdot d}{\color{blue}{d \cdot d}} \]
                        5. Applied rewrites67.7%

                          \[\leadsto \frac{b \cdot c - a \cdot d}{\color{blue}{d \cdot d}} \]
                        6. Step-by-step derivation
                          1. lift--.f64N/A

                            \[\leadsto \frac{\color{blue}{b \cdot c - a \cdot d}}{d \cdot d} \]
                          2. sub-negN/A

                            \[\leadsto \frac{\color{blue}{b \cdot c + \left(\mathsf{neg}\left(a \cdot d\right)\right)}}{d \cdot d} \]
                          3. +-commutativeN/A

                            \[\leadsto \frac{\color{blue}{\left(\mathsf{neg}\left(a \cdot d\right)\right) + b \cdot c}}{d \cdot d} \]
                          4. lift-*.f64N/A

                            \[\leadsto \frac{\left(\mathsf{neg}\left(\color{blue}{a \cdot d}\right)\right) + b \cdot c}{d \cdot d} \]
                          5. *-commutativeN/A

                            \[\leadsto \frac{\left(\mathsf{neg}\left(\color{blue}{d \cdot a}\right)\right) + b \cdot c}{d \cdot d} \]
                          6. distribute-lft-neg-inN/A

                            \[\leadsto \frac{\color{blue}{\left(\mathsf{neg}\left(d\right)\right) \cdot a} + b \cdot c}{d \cdot d} \]
                          7. lower-fma.f64N/A

                            \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(\mathsf{neg}\left(d\right), a, b \cdot c\right)}}{d \cdot d} \]
                          8. lower-neg.f6467.7

                            \[\leadsto \frac{\mathsf{fma}\left(\color{blue}{-d}, a, b \cdot c\right)}{d \cdot d} \]
                          9. lift-*.f64N/A

                            \[\leadsto \frac{\mathsf{fma}\left(-d, a, \color{blue}{b \cdot c}\right)}{d \cdot d} \]
                          10. *-commutativeN/A

                            \[\leadsto \frac{\mathsf{fma}\left(-d, a, \color{blue}{c \cdot b}\right)}{d \cdot d} \]
                          11. lower-*.f6467.7

                            \[\leadsto \frac{\mathsf{fma}\left(-d, a, \color{blue}{c \cdot b}\right)}{d \cdot d} \]
                        7. Applied rewrites67.7%

                          \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(-d, a, c \cdot b\right)}}{d \cdot d} \]
                      3. Recombined 3 regimes into one program.
                      4. Final simplification76.8%

                        \[\leadsto \begin{array}{l} \mathbf{if}\;c \leq -7.6 \cdot 10^{+121}:\\ \;\;\;\;\frac{b - \frac{d \cdot a}{c}}{c}\\ \mathbf{elif}\;c \leq -2.1 \cdot 10^{-14}:\\ \;\;\;\;\frac{b}{\mathsf{fma}\left(d, d, c \cdot c\right)} \cdot c\\ \mathbf{elif}\;c \leq 10^{-67}:\\ \;\;\;\;\frac{\mathsf{fma}\left(-d, a, b \cdot c\right)}{d \cdot d}\\ \mathbf{else}:\\ \;\;\;\;\frac{b - \frac{d \cdot a}{c}}{c}\\ \end{array} \]
                      5. Add Preprocessing

                      Alternative 13: 63.2% accurate, 1.3× speedup?

                      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;c \leq -5.3 \cdot 10^{-14}:\\ \;\;\;\;\frac{1}{\frac{c}{b}}\\ \mathbf{elif}\;c \leq 8 \cdot 10^{-74}:\\ \;\;\;\;\frac{-a}{d}\\ \mathbf{else}:\\ \;\;\;\;\frac{b}{c}\\ \end{array} \end{array} \]
                      (FPCore (a b c d)
                       :precision binary64
                       (if (<= c -5.3e-14) (/ 1.0 (/ c b)) (if (<= c 8e-74) (/ (- a) d) (/ b c))))
                      double code(double a, double b, double c, double d) {
                      	double tmp;
                      	if (c <= -5.3e-14) {
                      		tmp = 1.0 / (c / b);
                      	} else if (c <= 8e-74) {
                      		tmp = -a / d;
                      	} else {
                      		tmp = b / c;
                      	}
                      	return tmp;
                      }
                      
                      real(8) function code(a, b, c, d)
                          real(8), intent (in) :: a
                          real(8), intent (in) :: b
                          real(8), intent (in) :: c
                          real(8), intent (in) :: d
                          real(8) :: tmp
                          if (c <= (-5.3d-14)) then
                              tmp = 1.0d0 / (c / b)
                          else if (c <= 8d-74) then
                              tmp = -a / d
                          else
                              tmp = b / c
                          end if
                          code = tmp
                      end function
                      
                      public static double code(double a, double b, double c, double d) {
                      	double tmp;
                      	if (c <= -5.3e-14) {
                      		tmp = 1.0 / (c / b);
                      	} else if (c <= 8e-74) {
                      		tmp = -a / d;
                      	} else {
                      		tmp = b / c;
                      	}
                      	return tmp;
                      }
                      
                      def code(a, b, c, d):
                      	tmp = 0
                      	if c <= -5.3e-14:
                      		tmp = 1.0 / (c / b)
                      	elif c <= 8e-74:
                      		tmp = -a / d
                      	else:
                      		tmp = b / c
                      	return tmp
                      
                      function code(a, b, c, d)
                      	tmp = 0.0
                      	if (c <= -5.3e-14)
                      		tmp = Float64(1.0 / Float64(c / b));
                      	elseif (c <= 8e-74)
                      		tmp = Float64(Float64(-a) / d);
                      	else
                      		tmp = Float64(b / c);
                      	end
                      	return tmp
                      end
                      
                      function tmp_2 = code(a, b, c, d)
                      	tmp = 0.0;
                      	if (c <= -5.3e-14)
                      		tmp = 1.0 / (c / b);
                      	elseif (c <= 8e-74)
                      		tmp = -a / d;
                      	else
                      		tmp = b / c;
                      	end
                      	tmp_2 = tmp;
                      end
                      
                      code[a_, b_, c_, d_] := If[LessEqual[c, -5.3e-14], N[(1.0 / N[(c / b), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 8e-74], N[((-a) / d), $MachinePrecision], N[(b / c), $MachinePrecision]]]
                      
                      \begin{array}{l}
                      
                      \\
                      \begin{array}{l}
                      \mathbf{if}\;c \leq -5.3 \cdot 10^{-14}:\\
                      \;\;\;\;\frac{1}{\frac{c}{b}}\\
                      
                      \mathbf{elif}\;c \leq 8 \cdot 10^{-74}:\\
                      \;\;\;\;\frac{-a}{d}\\
                      
                      \mathbf{else}:\\
                      \;\;\;\;\frac{b}{c}\\
                      
                      
                      \end{array}
                      \end{array}
                      
                      Derivation
                      1. Split input into 3 regimes
                      2. if c < -5.3000000000000001e-14

                        1. Initial program 55.2%

                          \[\frac{b \cdot c - a \cdot d}{c \cdot c + d \cdot d} \]
                        2. Add Preprocessing
                        3. Taylor expanded in c around inf

                          \[\leadsto \color{blue}{\frac{b}{c}} \]
                        4. Step-by-step derivation
                          1. lower-/.f6471.4

                            \[\leadsto \color{blue}{\frac{b}{c}} \]
                        5. Applied rewrites71.4%

                          \[\leadsto \color{blue}{\frac{b}{c}} \]
                        6. Step-by-step derivation
                          1. Applied rewrites71.6%

                            \[\leadsto \frac{1}{\color{blue}{\frac{c}{b}}} \]

                          if -5.3000000000000001e-14 < c < 7.99999999999999966e-74

                          1. Initial program 73.9%

                            \[\frac{b \cdot c - a \cdot d}{c \cdot c + d \cdot d} \]
                          2. Add Preprocessing
                          3. Taylor expanded in c around 0

                            \[\leadsto \color{blue}{-1 \cdot \frac{a}{d}} \]
                          4. Step-by-step derivation
                            1. mul-1-negN/A

                              \[\leadsto \color{blue}{\mathsf{neg}\left(\frac{a}{d}\right)} \]
                            2. distribute-neg-frac2N/A

                              \[\leadsto \color{blue}{\frac{a}{\mathsf{neg}\left(d\right)}} \]
                            3. mul-1-negN/A

                              \[\leadsto \frac{a}{\color{blue}{-1 \cdot d}} \]
                            4. lower-/.f64N/A

                              \[\leadsto \color{blue}{\frac{a}{-1 \cdot d}} \]
                            5. mul-1-negN/A

                              \[\leadsto \frac{a}{\color{blue}{\mathsf{neg}\left(d\right)}} \]
                            6. lower-neg.f6465.3

                              \[\leadsto \frac{a}{\color{blue}{-d}} \]
                          5. Applied rewrites65.3%

                            \[\leadsto \color{blue}{\frac{a}{-d}} \]

                          if 7.99999999999999966e-74 < c

                          1. Initial program 56.2%

                            \[\frac{b \cdot c - a \cdot d}{c \cdot c + d \cdot d} \]
                          2. Add Preprocessing
                          3. Taylor expanded in c around inf

                            \[\leadsto \color{blue}{\frac{b}{c}} \]
                          4. Step-by-step derivation
                            1. lower-/.f6470.5

                              \[\leadsto \color{blue}{\frac{b}{c}} \]
                          5. Applied rewrites70.5%

                            \[\leadsto \color{blue}{\frac{b}{c}} \]
                        7. Recombined 3 regimes into one program.
                        8. Final simplification68.8%

                          \[\leadsto \begin{array}{l} \mathbf{if}\;c \leq -5.3 \cdot 10^{-14}:\\ \;\;\;\;\frac{1}{\frac{c}{b}}\\ \mathbf{elif}\;c \leq 8 \cdot 10^{-74}:\\ \;\;\;\;\frac{-a}{d}\\ \mathbf{else}:\\ \;\;\;\;\frac{b}{c}\\ \end{array} \]
                        9. Add Preprocessing

                        Alternative 14: 63.3% accurate, 1.5× speedup?

                        \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;c \leq -5.3 \cdot 10^{-14}:\\ \;\;\;\;\frac{b}{c}\\ \mathbf{elif}\;c \leq 8 \cdot 10^{-74}:\\ \;\;\;\;\frac{-a}{d}\\ \mathbf{else}:\\ \;\;\;\;\frac{b}{c}\\ \end{array} \end{array} \]
                        (FPCore (a b c d)
                         :precision binary64
                         (if (<= c -5.3e-14) (/ b c) (if (<= c 8e-74) (/ (- a) d) (/ b c))))
                        double code(double a, double b, double c, double d) {
                        	double tmp;
                        	if (c <= -5.3e-14) {
                        		tmp = b / c;
                        	} else if (c <= 8e-74) {
                        		tmp = -a / d;
                        	} else {
                        		tmp = b / c;
                        	}
                        	return tmp;
                        }
                        
                        real(8) function code(a, b, c, d)
                            real(8), intent (in) :: a
                            real(8), intent (in) :: b
                            real(8), intent (in) :: c
                            real(8), intent (in) :: d
                            real(8) :: tmp
                            if (c <= (-5.3d-14)) then
                                tmp = b / c
                            else if (c <= 8d-74) then
                                tmp = -a / d
                            else
                                tmp = b / c
                            end if
                            code = tmp
                        end function
                        
                        public static double code(double a, double b, double c, double d) {
                        	double tmp;
                        	if (c <= -5.3e-14) {
                        		tmp = b / c;
                        	} else if (c <= 8e-74) {
                        		tmp = -a / d;
                        	} else {
                        		tmp = b / c;
                        	}
                        	return tmp;
                        }
                        
                        def code(a, b, c, d):
                        	tmp = 0
                        	if c <= -5.3e-14:
                        		tmp = b / c
                        	elif c <= 8e-74:
                        		tmp = -a / d
                        	else:
                        		tmp = b / c
                        	return tmp
                        
                        function code(a, b, c, d)
                        	tmp = 0.0
                        	if (c <= -5.3e-14)
                        		tmp = Float64(b / c);
                        	elseif (c <= 8e-74)
                        		tmp = Float64(Float64(-a) / d);
                        	else
                        		tmp = Float64(b / c);
                        	end
                        	return tmp
                        end
                        
                        function tmp_2 = code(a, b, c, d)
                        	tmp = 0.0;
                        	if (c <= -5.3e-14)
                        		tmp = b / c;
                        	elseif (c <= 8e-74)
                        		tmp = -a / d;
                        	else
                        		tmp = b / c;
                        	end
                        	tmp_2 = tmp;
                        end
                        
                        code[a_, b_, c_, d_] := If[LessEqual[c, -5.3e-14], N[(b / c), $MachinePrecision], If[LessEqual[c, 8e-74], N[((-a) / d), $MachinePrecision], N[(b / c), $MachinePrecision]]]
                        
                        \begin{array}{l}
                        
                        \\
                        \begin{array}{l}
                        \mathbf{if}\;c \leq -5.3 \cdot 10^{-14}:\\
                        \;\;\;\;\frac{b}{c}\\
                        
                        \mathbf{elif}\;c \leq 8 \cdot 10^{-74}:\\
                        \;\;\;\;\frac{-a}{d}\\
                        
                        \mathbf{else}:\\
                        \;\;\;\;\frac{b}{c}\\
                        
                        
                        \end{array}
                        \end{array}
                        
                        Derivation
                        1. Split input into 2 regimes
                        2. if c < -5.3000000000000001e-14 or 7.99999999999999966e-74 < c

                          1. Initial program 55.7%

                            \[\frac{b \cdot c - a \cdot d}{c \cdot c + d \cdot d} \]
                          2. Add Preprocessing
                          3. Taylor expanded in c around inf

                            \[\leadsto \color{blue}{\frac{b}{c}} \]
                          4. Step-by-step derivation
                            1. lower-/.f6471.0

                              \[\leadsto \color{blue}{\frac{b}{c}} \]
                          5. Applied rewrites71.0%

                            \[\leadsto \color{blue}{\frac{b}{c}} \]

                          if -5.3000000000000001e-14 < c < 7.99999999999999966e-74

                          1. Initial program 73.9%

                            \[\frac{b \cdot c - a \cdot d}{c \cdot c + d \cdot d} \]
                          2. Add Preprocessing
                          3. Taylor expanded in c around 0

                            \[\leadsto \color{blue}{-1 \cdot \frac{a}{d}} \]
                          4. Step-by-step derivation
                            1. mul-1-negN/A

                              \[\leadsto \color{blue}{\mathsf{neg}\left(\frac{a}{d}\right)} \]
                            2. distribute-neg-frac2N/A

                              \[\leadsto \color{blue}{\frac{a}{\mathsf{neg}\left(d\right)}} \]
                            3. mul-1-negN/A

                              \[\leadsto \frac{a}{\color{blue}{-1 \cdot d}} \]
                            4. lower-/.f64N/A

                              \[\leadsto \color{blue}{\frac{a}{-1 \cdot d}} \]
                            5. mul-1-negN/A

                              \[\leadsto \frac{a}{\color{blue}{\mathsf{neg}\left(d\right)}} \]
                            6. lower-neg.f6465.3

                              \[\leadsto \frac{a}{\color{blue}{-d}} \]
                          5. Applied rewrites65.3%

                            \[\leadsto \color{blue}{\frac{a}{-d}} \]
                        3. Recombined 2 regimes into one program.
                        4. Final simplification68.7%

                          \[\leadsto \begin{array}{l} \mathbf{if}\;c \leq -5.3 \cdot 10^{-14}:\\ \;\;\;\;\frac{b}{c}\\ \mathbf{elif}\;c \leq 8 \cdot 10^{-74}:\\ \;\;\;\;\frac{-a}{d}\\ \mathbf{else}:\\ \;\;\;\;\frac{b}{c}\\ \end{array} \]
                        5. Add Preprocessing

                        Alternative 15: 42.9% accurate, 3.2× speedup?

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

                          \[\frac{b \cdot c - a \cdot d}{c \cdot c + d \cdot d} \]
                        2. Add Preprocessing
                        3. Taylor expanded in c around inf

                          \[\leadsto \color{blue}{\frac{b}{c}} \]
                        4. Step-by-step derivation
                          1. lower-/.f6450.3

                            \[\leadsto \color{blue}{\frac{b}{c}} \]
                        5. Applied rewrites50.3%

                          \[\leadsto \color{blue}{\frac{b}{c}} \]
                        6. Add Preprocessing

                        Developer Target 1: 99.3% accurate, 0.6× speedup?

                        \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\left|d\right| < \left|c\right|:\\ \;\;\;\;\frac{b - a \cdot \frac{d}{c}}{c + d \cdot \frac{d}{c}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(-a\right) + b \cdot \frac{c}{d}}{d + c \cdot \frac{c}{d}}\\ \end{array} \end{array} \]
                        (FPCore (a b c d)
                         :precision binary64
                         (if (< (fabs d) (fabs c))
                           (/ (- b (* a (/ d c))) (+ c (* d (/ d c))))
                           (/ (+ (- a) (* b (/ c d))) (+ d (* c (/ c d))))))
                        double code(double a, double b, double c, double d) {
                        	double tmp;
                        	if (fabs(d) < fabs(c)) {
                        		tmp = (b - (a * (d / c))) / (c + (d * (d / c)));
                        	} else {
                        		tmp = (-a + (b * (c / d))) / (d + (c * (c / d)));
                        	}
                        	return tmp;
                        }
                        
                        real(8) function code(a, b, c, d)
                            real(8), intent (in) :: a
                            real(8), intent (in) :: b
                            real(8), intent (in) :: c
                            real(8), intent (in) :: d
                            real(8) :: tmp
                            if (abs(d) < abs(c)) then
                                tmp = (b - (a * (d / c))) / (c + (d * (d / c)))
                            else
                                tmp = (-a + (b * (c / d))) / (d + (c * (c / d)))
                            end if
                            code = tmp
                        end function
                        
                        public static double code(double a, double b, double c, double d) {
                        	double tmp;
                        	if (Math.abs(d) < Math.abs(c)) {
                        		tmp = (b - (a * (d / c))) / (c + (d * (d / c)));
                        	} else {
                        		tmp = (-a + (b * (c / d))) / (d + (c * (c / d)));
                        	}
                        	return tmp;
                        }
                        
                        def code(a, b, c, d):
                        	tmp = 0
                        	if math.fabs(d) < math.fabs(c):
                        		tmp = (b - (a * (d / c))) / (c + (d * (d / c)))
                        	else:
                        		tmp = (-a + (b * (c / d))) / (d + (c * (c / d)))
                        	return tmp
                        
                        function code(a, b, c, d)
                        	tmp = 0.0
                        	if (abs(d) < abs(c))
                        		tmp = Float64(Float64(b - Float64(a * Float64(d / c))) / Float64(c + Float64(d * Float64(d / c))));
                        	else
                        		tmp = Float64(Float64(Float64(-a) + Float64(b * Float64(c / d))) / Float64(d + Float64(c * Float64(c / d))));
                        	end
                        	return tmp
                        end
                        
                        function tmp_2 = code(a, b, c, d)
                        	tmp = 0.0;
                        	if (abs(d) < abs(c))
                        		tmp = (b - (a * (d / c))) / (c + (d * (d / c)));
                        	else
                        		tmp = (-a + (b * (c / d))) / (d + (c * (c / d)));
                        	end
                        	tmp_2 = tmp;
                        end
                        
                        code[a_, b_, c_, d_] := If[Less[N[Abs[d], $MachinePrecision], N[Abs[c], $MachinePrecision]], N[(N[(b - N[(a * N[(d / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(c + N[(d * N[(d / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[((-a) + N[(b * N[(c / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(d + N[(c * N[(c / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
                        
                        \begin{array}{l}
                        
                        \\
                        \begin{array}{l}
                        \mathbf{if}\;\left|d\right| < \left|c\right|:\\
                        \;\;\;\;\frac{b - a \cdot \frac{d}{c}}{c + d \cdot \frac{d}{c}}\\
                        
                        \mathbf{else}:\\
                        \;\;\;\;\frac{\left(-a\right) + b \cdot \frac{c}{d}}{d + c \cdot \frac{c}{d}}\\
                        
                        
                        \end{array}
                        \end{array}
                        

                        Reproduce

                        ?
                        herbie shell --seed 2024295 
                        (FPCore (a b c d)
                          :name "Complex division, imag part"
                          :precision binary64
                        
                          :alt
                          (! :herbie-platform default (if (< (fabs d) (fabs c)) (/ (- b (* a (/ d c))) (+ c (* d (/ d c)))) (/ (+ (- a) (* b (/ c d))) (+ d (* c (/ c d))))))
                        
                          (/ (- (* b c) (* a d)) (+ (* c c) (* d d))))