Complex division, imag part

Percentage Accurate: 60.7% → 83.3%
Time: 7.3s
Alternatives: 12
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 12 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: 60.7% 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: 83.3% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \mathsf{fma}\left(d, d, c \cdot c\right)\\ \mathbf{if}\;d \leq -3.5 \cdot 10^{+93}:\\ \;\;\;\;\frac{\mathsf{fma}\left(c, \frac{b}{d}, -a\right)}{d}\\ \mathbf{elif}\;d \leq -3.6 \cdot 10^{-124}:\\ \;\;\;\;\frac{b \cdot c - a \cdot d}{c \cdot c + d \cdot d}\\ \mathbf{elif}\;d \leq 1.52 \cdot 10^{-96}:\\ \;\;\;\;\frac{b - d \cdot \frac{a}{c}}{c}\\ \mathbf{elif}\;d \leq 1.05 \cdot 10^{+93}:\\ \;\;\;\;\mathsf{fma}\left(\frac{c}{t\_0}, b, \left(-d\right) \cdot \frac{a}{t\_0}\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\frac{c}{d}, \frac{b}{d}, \frac{-a}{d}\right)\\ \end{array} \end{array} \]
(FPCore (a b c d)
 :precision binary64
 (let* ((t_0 (fma d d (* c c))))
   (if (<= d -3.5e+93)
     (/ (fma c (/ b d) (- a)) d)
     (if (<= d -3.6e-124)
       (/ (- (* b c) (* a d)) (+ (* c c) (* d d)))
       (if (<= d 1.52e-96)
         (/ (- b (* d (/ a c))) c)
         (if (<= d 1.05e+93)
           (fma (/ c t_0) b (* (- d) (/ a t_0)))
           (fma (/ c d) (/ b d) (/ (- a) d))))))))
double code(double a, double b, double c, double d) {
	double t_0 = fma(d, d, (c * c));
	double tmp;
	if (d <= -3.5e+93) {
		tmp = fma(c, (b / d), -a) / d;
	} else if (d <= -3.6e-124) {
		tmp = ((b * c) - (a * d)) / ((c * c) + (d * d));
	} else if (d <= 1.52e-96) {
		tmp = (b - (d * (a / c))) / c;
	} else if (d <= 1.05e+93) {
		tmp = fma((c / t_0), b, (-d * (a / t_0)));
	} else {
		tmp = fma((c / d), (b / d), (-a / d));
	}
	return tmp;
}
function code(a, b, c, d)
	t_0 = fma(d, d, Float64(c * c))
	tmp = 0.0
	if (d <= -3.5e+93)
		tmp = Float64(fma(c, Float64(b / d), Float64(-a)) / d);
	elseif (d <= -3.6e-124)
		tmp = Float64(Float64(Float64(b * c) - Float64(a * d)) / Float64(Float64(c * c) + Float64(d * d)));
	elseif (d <= 1.52e-96)
		tmp = Float64(Float64(b - Float64(d * Float64(a / c))) / c);
	elseif (d <= 1.05e+93)
		tmp = fma(Float64(c / t_0), b, Float64(Float64(-d) * Float64(a / t_0)));
	else
		tmp = fma(Float64(c / d), Float64(b / d), Float64(Float64(-a) / d));
	end
	return tmp
end
code[a_, b_, c_, d_] := Block[{t$95$0 = N[(d * d + N[(c * c), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[d, -3.5e+93], N[(N[(c * N[(b / d), $MachinePrecision] + (-a)), $MachinePrecision] / d), $MachinePrecision], If[LessEqual[d, -3.6e-124], N[(N[(N[(b * c), $MachinePrecision] - N[(a * d), $MachinePrecision]), $MachinePrecision] / N[(N[(c * c), $MachinePrecision] + N[(d * d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 1.52e-96], N[(N[(b - N[(d * N[(a / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision], If[LessEqual[d, 1.05e+93], N[(N[(c / t$95$0), $MachinePrecision] * b + N[((-d) * N[(a / t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(c / d), $MachinePrecision] * N[(b / d), $MachinePrecision] + N[((-a) / d), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(d, d, c \cdot c\right)\\
\mathbf{if}\;d \leq -3.5 \cdot 10^{+93}:\\
\;\;\;\;\frac{\mathsf{fma}\left(c, \frac{b}{d}, -a\right)}{d}\\

\mathbf{elif}\;d \leq -3.6 \cdot 10^{-124}:\\
\;\;\;\;\frac{b \cdot c - a \cdot d}{c \cdot c + d \cdot d}\\

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

\mathbf{elif}\;d \leq 1.05 \cdot 10^{+93}:\\
\;\;\;\;\mathsf{fma}\left(\frac{c}{t\_0}, b, \left(-d\right) \cdot \frac{a}{t\_0}\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if d < -3.49999999999999998e93

    1. Initial program 34.8%

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

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

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

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

      if -3.49999999999999998e93 < d < -3.6000000000000001e-124

      1. Initial program 86.2%

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

      if -3.6000000000000001e-124 < d < 1.52e-96

      1. Initial program 73.0%

        \[\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-*.f6492.2

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

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

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

        if 1.52e-96 < d < 1.0499999999999999e93

        1. Initial program 73.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \mathsf{fma}\left(\frac{c}{\mathsf{fma}\left(d, d, c \cdot c\right)}, b, \mathsf{neg}\left(\frac{\color{blue}{d \cdot a}}{c \cdot c + d \cdot d}\right)\right) \]
          16. associate-/l*N/A

            \[\leadsto \mathsf{fma}\left(\frac{c}{\mathsf{fma}\left(d, d, c \cdot c\right)}, b, \mathsf{neg}\left(\color{blue}{d \cdot \frac{a}{c \cdot c + d \cdot d}}\right)\right) \]
        4. Applied rewrites78.2%

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

        if 1.0499999999999999e93 < d

        1. Initial program 26.7%

          \[\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-*.f6476.3

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

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

            \[\leadsto \mathsf{fma}\left(\frac{c}{d}, \color{blue}{\frac{b}{d}}, \frac{a}{-d}\right) \]
        7. Recombined 5 regimes into one program.
        8. Final simplification89.0%

          \[\leadsto \begin{array}{l} \mathbf{if}\;d \leq -3.5 \cdot 10^{+93}:\\ \;\;\;\;\frac{\mathsf{fma}\left(c, \frac{b}{d}, -a\right)}{d}\\ \mathbf{elif}\;d \leq -3.6 \cdot 10^{-124}:\\ \;\;\;\;\frac{b \cdot c - a \cdot d}{c \cdot c + d \cdot d}\\ \mathbf{elif}\;d \leq 1.52 \cdot 10^{-96}:\\ \;\;\;\;\frac{b - d \cdot \frac{a}{c}}{c}\\ \mathbf{elif}\;d \leq 1.05 \cdot 10^{+93}:\\ \;\;\;\;\mathsf{fma}\left(\frac{c}{\mathsf{fma}\left(d, d, c \cdot c\right)}, b, \left(-d\right) \cdot \frac{a}{\mathsf{fma}\left(d, d, c \cdot c\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\frac{c}{d}, \frac{b}{d}, \frac{-a}{d}\right)\\ \end{array} \]
        9. Add Preprocessing

        Alternative 2: 82.9% accurate, 0.6× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{b \cdot c - a \cdot d}{c \cdot c + d \cdot d}\\ \mathbf{if}\;d \leq -3.5 \cdot 10^{+93}:\\ \;\;\;\;\frac{\mathsf{fma}\left(c, \frac{b}{d}, -a\right)}{d}\\ \mathbf{elif}\;d \leq -3.6 \cdot 10^{-124}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;d \leq 3.8 \cdot 10^{-97}:\\ \;\;\;\;\frac{b - d \cdot \frac{a}{c}}{c}\\ \mathbf{elif}\;d \leq 2.6 \cdot 10^{+83}:\\ \;\;\;\;t\_0\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\frac{c}{d}, \frac{b}{d}, \frac{-a}{d}\right)\\ \end{array} \end{array} \]
        (FPCore (a b c d)
         :precision binary64
         (let* ((t_0 (/ (- (* b c) (* a d)) (+ (* c c) (* d d)))))
           (if (<= d -3.5e+93)
             (/ (fma c (/ b d) (- a)) d)
             (if (<= d -3.6e-124)
               t_0
               (if (<= d 3.8e-97)
                 (/ (- b (* d (/ a c))) c)
                 (if (<= d 2.6e+83) t_0 (fma (/ c d) (/ b d) (/ (- a) d))))))))
        double code(double a, double b, double c, double d) {
        	double t_0 = ((b * c) - (a * d)) / ((c * c) + (d * d));
        	double tmp;
        	if (d <= -3.5e+93) {
        		tmp = fma(c, (b / d), -a) / d;
        	} else if (d <= -3.6e-124) {
        		tmp = t_0;
        	} else if (d <= 3.8e-97) {
        		tmp = (b - (d * (a / c))) / c;
        	} else if (d <= 2.6e+83) {
        		tmp = t_0;
        	} else {
        		tmp = fma((c / d), (b / d), (-a / d));
        	}
        	return tmp;
        }
        
        function code(a, b, c, d)
        	t_0 = Float64(Float64(Float64(b * c) - Float64(a * d)) / Float64(Float64(c * c) + Float64(d * d)))
        	tmp = 0.0
        	if (d <= -3.5e+93)
        		tmp = Float64(fma(c, Float64(b / d), Float64(-a)) / d);
        	elseif (d <= -3.6e-124)
        		tmp = t_0;
        	elseif (d <= 3.8e-97)
        		tmp = Float64(Float64(b - Float64(d * Float64(a / c))) / c);
        	elseif (d <= 2.6e+83)
        		tmp = t_0;
        	else
        		tmp = fma(Float64(c / d), Float64(b / d), Float64(Float64(-a) / d));
        	end
        	return tmp
        end
        
        code[a_, b_, c_, d_] := Block[{t$95$0 = N[(N[(N[(b * c), $MachinePrecision] - N[(a * d), $MachinePrecision]), $MachinePrecision] / N[(N[(c * c), $MachinePrecision] + N[(d * d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[d, -3.5e+93], N[(N[(c * N[(b / d), $MachinePrecision] + (-a)), $MachinePrecision] / d), $MachinePrecision], If[LessEqual[d, -3.6e-124], t$95$0, If[LessEqual[d, 3.8e-97], N[(N[(b - N[(d * N[(a / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision], If[LessEqual[d, 2.6e+83], t$95$0, N[(N[(c / d), $MachinePrecision] * N[(b / d), $MachinePrecision] + N[((-a) / d), $MachinePrecision]), $MachinePrecision]]]]]]
        
        \begin{array}{l}
        
        \\
        \begin{array}{l}
        t_0 := \frac{b \cdot c - a \cdot d}{c \cdot c + d \cdot d}\\
        \mathbf{if}\;d \leq -3.5 \cdot 10^{+93}:\\
        \;\;\;\;\frac{\mathsf{fma}\left(c, \frac{b}{d}, -a\right)}{d}\\
        
        \mathbf{elif}\;d \leq -3.6 \cdot 10^{-124}:\\
        \;\;\;\;t\_0\\
        
        \mathbf{elif}\;d \leq 3.8 \cdot 10^{-97}:\\
        \;\;\;\;\frac{b - d \cdot \frac{a}{c}}{c}\\
        
        \mathbf{elif}\;d \leq 2.6 \cdot 10^{+83}:\\
        \;\;\;\;t\_0\\
        
        \mathbf{else}:\\
        \;\;\;\;\mathsf{fma}\left(\frac{c}{d}, \frac{b}{d}, \frac{-a}{d}\right)\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 4 regimes
        2. if d < -3.49999999999999998e93

          1. Initial program 34.8%

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

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

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

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

            if -3.49999999999999998e93 < d < -3.6000000000000001e-124 or 3.8000000000000001e-97 < d < 2.6000000000000001e83

            1. Initial program 79.8%

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

            if -3.6000000000000001e-124 < d < 3.8000000000000001e-97

            1. Initial program 73.0%

              \[\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-*.f6492.2

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

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

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

              if 2.6000000000000001e83 < d

              1. Initial program 26.7%

                \[\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-*.f6476.3

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

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

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

                \[\leadsto \begin{array}{l} \mathbf{if}\;d \leq -3.5 \cdot 10^{+93}:\\ \;\;\;\;\frac{\mathsf{fma}\left(c, \frac{b}{d}, -a\right)}{d}\\ \mathbf{elif}\;d \leq -3.6 \cdot 10^{-124}:\\ \;\;\;\;\frac{b \cdot c - a \cdot d}{c \cdot c + d \cdot d}\\ \mathbf{elif}\;d \leq 3.8 \cdot 10^{-97}:\\ \;\;\;\;\frac{b - d \cdot \frac{a}{c}}{c}\\ \mathbf{elif}\;d \leq 2.6 \cdot 10^{+83}:\\ \;\;\;\;\frac{b \cdot c - a \cdot d}{c \cdot c + d \cdot d}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\frac{c}{d}, \frac{b}{d}, \frac{-a}{d}\right)\\ \end{array} \]
              9. Add Preprocessing

              Alternative 3: 83.1% accurate, 0.6× speedup?

              \[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{b \cdot c - a \cdot d}{c \cdot c + d \cdot d}\\ t_1 := \frac{\mathsf{fma}\left(c, \frac{b}{d}, -a\right)}{d}\\ \mathbf{if}\;d \leq -3.5 \cdot 10^{+93}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;d \leq -3.6 \cdot 10^{-124}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;d \leq 3.8 \cdot 10^{-97}:\\ \;\;\;\;\frac{b - d \cdot \frac{a}{c}}{c}\\ \mathbf{elif}\;d \leq 2.6 \cdot 10^{+83}:\\ \;\;\;\;t\_0\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
              (FPCore (a b c d)
               :precision binary64
               (let* ((t_0 (/ (- (* b c) (* a d)) (+ (* c c) (* d d))))
                      (t_1 (/ (fma c (/ b d) (- a)) d)))
                 (if (<= d -3.5e+93)
                   t_1
                   (if (<= d -3.6e-124)
                     t_0
                     (if (<= d 3.8e-97)
                       (/ (- b (* d (/ a c))) c)
                       (if (<= d 2.6e+83) t_0 t_1))))))
              double code(double a, double b, double c, double d) {
              	double t_0 = ((b * c) - (a * d)) / ((c * c) + (d * d));
              	double t_1 = fma(c, (b / d), -a) / d;
              	double tmp;
              	if (d <= -3.5e+93) {
              		tmp = t_1;
              	} else if (d <= -3.6e-124) {
              		tmp = t_0;
              	} else if (d <= 3.8e-97) {
              		tmp = (b - (d * (a / c))) / c;
              	} else if (d <= 2.6e+83) {
              		tmp = t_0;
              	} else {
              		tmp = t_1;
              	}
              	return tmp;
              }
              
              function code(a, b, c, d)
              	t_0 = Float64(Float64(Float64(b * c) - Float64(a * d)) / Float64(Float64(c * c) + Float64(d * d)))
              	t_1 = Float64(fma(c, Float64(b / d), Float64(-a)) / d)
              	tmp = 0.0
              	if (d <= -3.5e+93)
              		tmp = t_1;
              	elseif (d <= -3.6e-124)
              		tmp = t_0;
              	elseif (d <= 3.8e-97)
              		tmp = Float64(Float64(b - Float64(d * Float64(a / c))) / c);
              	elseif (d <= 2.6e+83)
              		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[(a * d), $MachinePrecision]), $MachinePrecision] / N[(N[(c * c), $MachinePrecision] + N[(d * d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(c * N[(b / d), $MachinePrecision] + (-a)), $MachinePrecision] / d), $MachinePrecision]}, If[LessEqual[d, -3.5e+93], t$95$1, If[LessEqual[d, -3.6e-124], t$95$0, If[LessEqual[d, 3.8e-97], N[(N[(b - N[(d * N[(a / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision], If[LessEqual[d, 2.6e+83], t$95$0, t$95$1]]]]]]
              
              \begin{array}{l}
              
              \\
              \begin{array}{l}
              t_0 := \frac{b \cdot c - a \cdot d}{c \cdot c + d \cdot d}\\
              t_1 := \frac{\mathsf{fma}\left(c, \frac{b}{d}, -a\right)}{d}\\
              \mathbf{if}\;d \leq -3.5 \cdot 10^{+93}:\\
              \;\;\;\;t\_1\\
              
              \mathbf{elif}\;d \leq -3.6 \cdot 10^{-124}:\\
              \;\;\;\;t\_0\\
              
              \mathbf{elif}\;d \leq 3.8 \cdot 10^{-97}:\\
              \;\;\;\;\frac{b - d \cdot \frac{a}{c}}{c}\\
              
              \mathbf{elif}\;d \leq 2.6 \cdot 10^{+83}:\\
              \;\;\;\;t\_0\\
              
              \mathbf{else}:\\
              \;\;\;\;t\_1\\
              
              
              \end{array}
              \end{array}
              
              Derivation
              1. Split input into 3 regimes
              2. if d < -3.49999999999999998e93 or 2.6000000000000001e83 < d

                1. Initial program 31.1%

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

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

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

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

                  if -3.49999999999999998e93 < d < -3.6000000000000001e-124 or 3.8000000000000001e-97 < d < 2.6000000000000001e83

                  1. Initial program 79.8%

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

                  if -3.6000000000000001e-124 < d < 3.8000000000000001e-97

                  1. Initial program 73.0%

                    \[\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-*.f6492.2

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

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

                      \[\leadsto \frac{b - d \cdot \frac{a}{c}}{c} \]
                  7. Recombined 3 regimes into one program.
                  8. Add Preprocessing

                  Alternative 4: 72.0% accurate, 0.8× speedup?

                  \[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{-a}{d}\\ \mathbf{if}\;d \leq -2.05 \cdot 10^{+152}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;d \leq -1.65 \cdot 10^{-85}:\\ \;\;\;\;\frac{b \cdot c - a \cdot d}{d \cdot d}\\ \mathbf{elif}\;d \leq 6.2 \cdot 10^{+70}:\\ \;\;\;\;\frac{b - d \cdot \frac{a}{c}}{c}\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
                  (FPCore (a b c d)
                   :precision binary64
                   (let* ((t_0 (/ (- a) d)))
                     (if (<= d -2.05e+152)
                       t_0
                       (if (<= d -1.65e-85)
                         (/ (- (* b c) (* a d)) (* d d))
                         (if (<= d 6.2e+70) (/ (- b (* d (/ a c))) c) t_0)))))
                  double code(double a, double b, double c, double d) {
                  	double t_0 = -a / d;
                  	double tmp;
                  	if (d <= -2.05e+152) {
                  		tmp = t_0;
                  	} else if (d <= -1.65e-85) {
                  		tmp = ((b * c) - (a * d)) / (d * d);
                  	} else if (d <= 6.2e+70) {
                  		tmp = (b - (d * (a / c))) / c;
                  	} else {
                  		tmp = t_0;
                  	}
                  	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) :: tmp
                      t_0 = -a / d
                      if (d <= (-2.05d+152)) then
                          tmp = t_0
                      else if (d <= (-1.65d-85)) then
                          tmp = ((b * c) - (a * d)) / (d * d)
                      else if (d <= 6.2d+70) then
                          tmp = (b - (d * (a / c))) / c
                      else
                          tmp = t_0
                      end if
                      code = tmp
                  end function
                  
                  public static double code(double a, double b, double c, double d) {
                  	double t_0 = -a / d;
                  	double tmp;
                  	if (d <= -2.05e+152) {
                  		tmp = t_0;
                  	} else if (d <= -1.65e-85) {
                  		tmp = ((b * c) - (a * d)) / (d * d);
                  	} else if (d <= 6.2e+70) {
                  		tmp = (b - (d * (a / c))) / c;
                  	} else {
                  		tmp = t_0;
                  	}
                  	return tmp;
                  }
                  
                  def code(a, b, c, d):
                  	t_0 = -a / d
                  	tmp = 0
                  	if d <= -2.05e+152:
                  		tmp = t_0
                  	elif d <= -1.65e-85:
                  		tmp = ((b * c) - (a * d)) / (d * d)
                  	elif d <= 6.2e+70:
                  		tmp = (b - (d * (a / c))) / c
                  	else:
                  		tmp = t_0
                  	return tmp
                  
                  function code(a, b, c, d)
                  	t_0 = Float64(Float64(-a) / d)
                  	tmp = 0.0
                  	if (d <= -2.05e+152)
                  		tmp = t_0;
                  	elseif (d <= -1.65e-85)
                  		tmp = Float64(Float64(Float64(b * c) - Float64(a * d)) / Float64(d * d));
                  	elseif (d <= 6.2e+70)
                  		tmp = Float64(Float64(b - Float64(d * Float64(a / c))) / c);
                  	else
                  		tmp = t_0;
                  	end
                  	return tmp
                  end
                  
                  function tmp_2 = code(a, b, c, d)
                  	t_0 = -a / d;
                  	tmp = 0.0;
                  	if (d <= -2.05e+152)
                  		tmp = t_0;
                  	elseif (d <= -1.65e-85)
                  		tmp = ((b * c) - (a * d)) / (d * d);
                  	elseif (d <= 6.2e+70)
                  		tmp = (b - (d * (a / c))) / c;
                  	else
                  		tmp = t_0;
                  	end
                  	tmp_2 = tmp;
                  end
                  
                  code[a_, b_, c_, d_] := Block[{t$95$0 = N[((-a) / d), $MachinePrecision]}, If[LessEqual[d, -2.05e+152], t$95$0, If[LessEqual[d, -1.65e-85], N[(N[(N[(b * c), $MachinePrecision] - N[(a * d), $MachinePrecision]), $MachinePrecision] / N[(d * d), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 6.2e+70], N[(N[(b - N[(d * N[(a / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision], t$95$0]]]]
                  
                  \begin{array}{l}
                  
                  \\
                  \begin{array}{l}
                  t_0 := \frac{-a}{d}\\
                  \mathbf{if}\;d \leq -2.05 \cdot 10^{+152}:\\
                  \;\;\;\;t\_0\\
                  
                  \mathbf{elif}\;d \leq -1.65 \cdot 10^{-85}:\\
                  \;\;\;\;\frac{b \cdot c - a \cdot d}{d \cdot d}\\
                  
                  \mathbf{elif}\;d \leq 6.2 \cdot 10^{+70}:\\
                  \;\;\;\;\frac{b - d \cdot \frac{a}{c}}{c}\\
                  
                  \mathbf{else}:\\
                  \;\;\;\;t\_0\\
                  
                  
                  \end{array}
                  \end{array}
                  
                  Derivation
                  1. Split input into 3 regimes
                  2. if d < -2.0499999999999999e152 or 6.2000000000000006e70 < d

                    1. Initial program 26.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.f6475.0

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

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

                    if -2.0499999999999999e152 < d < -1.64999999999999986e-85

                    1. Initial program 77.7%

                      \[\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-*.f6462.3

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

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

                    if -1.64999999999999986e-85 < d < 6.2000000000000006e70

                    1. Initial program 74.8%

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

                        \[\leadsto \frac{b - \frac{\color{blue}{a \cdot d}}{c}}{c} \]
                    5. Applied rewrites80.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 \frac{a}{c}}{c} \]
                    7. Recombined 3 regimes into one program.
                    8. Final simplification78.3%

                      \[\leadsto \begin{array}{l} \mathbf{if}\;d \leq -2.05 \cdot 10^{+152}:\\ \;\;\;\;\frac{-a}{d}\\ \mathbf{elif}\;d \leq -1.65 \cdot 10^{-85}:\\ \;\;\;\;\frac{b \cdot c - a \cdot d}{d \cdot d}\\ \mathbf{elif}\;d \leq 6.2 \cdot 10^{+70}:\\ \;\;\;\;\frac{b - d \cdot \frac{a}{c}}{c}\\ \mathbf{else}:\\ \;\;\;\;\frac{-a}{d}\\ \end{array} \]
                    9. Add Preprocessing

                    Alternative 5: 64.6% accurate, 0.8× speedup?

                    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;c \leq -9.5 \cdot 10^{+125}:\\ \;\;\;\;\frac{b}{c}\\ \mathbf{elif}\;c \leq -1.08 \cdot 10^{-67}:\\ \;\;\;\;\frac{c}{\mathsf{fma}\left(d, d, c \cdot c\right)} \cdot b\\ \mathbf{elif}\;c \leq -3.5 \cdot 10^{-242}:\\ \;\;\;\;\frac{b \cdot c - a \cdot d}{d \cdot d}\\ \mathbf{elif}\;c \leq 8.2 \cdot 10^{+73}:\\ \;\;\;\;\frac{-a}{d}\\ \mathbf{else}:\\ \;\;\;\;\frac{b}{c}\\ \end{array} \end{array} \]
                    (FPCore (a b c d)
                     :precision binary64
                     (if (<= c -9.5e+125)
                       (/ b c)
                       (if (<= c -1.08e-67)
                         (* (/ c (fma d d (* c c))) b)
                         (if (<= c -3.5e-242)
                           (/ (- (* b c) (* a d)) (* d d))
                           (if (<= c 8.2e+73) (/ (- a) d) (/ b c))))))
                    double code(double a, double b, double c, double d) {
                    	double tmp;
                    	if (c <= -9.5e+125) {
                    		tmp = b / c;
                    	} else if (c <= -1.08e-67) {
                    		tmp = (c / fma(d, d, (c * c))) * b;
                    	} else if (c <= -3.5e-242) {
                    		tmp = ((b * c) - (a * d)) / (d * d);
                    	} else if (c <= 8.2e+73) {
                    		tmp = -a / d;
                    	} else {
                    		tmp = b / c;
                    	}
                    	return tmp;
                    }
                    
                    function code(a, b, c, d)
                    	tmp = 0.0
                    	if (c <= -9.5e+125)
                    		tmp = Float64(b / c);
                    	elseif (c <= -1.08e-67)
                    		tmp = Float64(Float64(c / fma(d, d, Float64(c * c))) * b);
                    	elseif (c <= -3.5e-242)
                    		tmp = Float64(Float64(Float64(b * c) - Float64(a * d)) / Float64(d * d));
                    	elseif (c <= 8.2e+73)
                    		tmp = Float64(Float64(-a) / d);
                    	else
                    		tmp = Float64(b / c);
                    	end
                    	return tmp
                    end
                    
                    code[a_, b_, c_, d_] := If[LessEqual[c, -9.5e+125], N[(b / c), $MachinePrecision], If[LessEqual[c, -1.08e-67], N[(N[(c / N[(d * d + N[(c * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * b), $MachinePrecision], If[LessEqual[c, -3.5e-242], N[(N[(N[(b * c), $MachinePrecision] - N[(a * d), $MachinePrecision]), $MachinePrecision] / N[(d * d), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 8.2e+73], N[((-a) / d), $MachinePrecision], N[(b / c), $MachinePrecision]]]]]
                    
                    \begin{array}{l}
                    
                    \\
                    \begin{array}{l}
                    \mathbf{if}\;c \leq -9.5 \cdot 10^{+125}:\\
                    \;\;\;\;\frac{b}{c}\\
                    
                    \mathbf{elif}\;c \leq -1.08 \cdot 10^{-67}:\\
                    \;\;\;\;\frac{c}{\mathsf{fma}\left(d, d, c \cdot c\right)} \cdot b\\
                    
                    \mathbf{elif}\;c \leq -3.5 \cdot 10^{-242}:\\
                    \;\;\;\;\frac{b \cdot c - a \cdot d}{d \cdot d}\\
                    
                    \mathbf{elif}\;c \leq 8.2 \cdot 10^{+73}:\\
                    \;\;\;\;\frac{-a}{d}\\
                    
                    \mathbf{else}:\\
                    \;\;\;\;\frac{b}{c}\\
                    
                    
                    \end{array}
                    \end{array}
                    
                    Derivation
                    1. Split input into 4 regimes
                    2. if c < -9.50000000000000041e125 or 8.1999999999999996e73 < c

                      1. Initial program 34.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}{c}} \]
                      4. Step-by-step derivation
                        1. lower-/.f6471.5

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

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

                      if -9.50000000000000041e125 < c < -1.0800000000000001e-67

                      1. Initial program 78.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                          \[\leadsto \mathsf{fma}\left(\frac{c}{\mathsf{fma}\left(d, d, c \cdot c\right)}, b, \mathsf{neg}\left(\frac{\color{blue}{d \cdot a}}{c \cdot c + d \cdot d}\right)\right) \]
                        16. associate-/l*N/A

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

                        \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{c}{\mathsf{fma}\left(d, d, c \cdot c\right)}, b, \left(-d\right) \cdot \frac{a}{\mathsf{fma}\left(d, d, c \cdot c\right)}\right)} \]
                      5. Taylor expanded in a around 0

                        \[\leadsto \color{blue}{\frac{b \cdot c}{{c}^{2} + {d}^{2}}} \]
                      6. 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}{\frac{c}{{c}^{2} + {d}^{2}} \cdot b} \]
                        3. lower-*.f64N/A

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

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

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

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

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

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

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

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

                      if -1.0800000000000001e-67 < c < -3.4999999999999999e-242

                      1. Initial program 86.0%

                        \[\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-*.f6483.9

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

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

                      if -3.4999999999999999e-242 < c < 8.1999999999999996e73

                      1. Initial program 72.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 \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.6

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

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

                      \[\leadsto \begin{array}{l} \mathbf{if}\;c \leq -9.5 \cdot 10^{+125}:\\ \;\;\;\;\frac{b}{c}\\ \mathbf{elif}\;c \leq -1.08 \cdot 10^{-67}:\\ \;\;\;\;\frac{c}{\mathsf{fma}\left(d, d, c \cdot c\right)} \cdot b\\ \mathbf{elif}\;c \leq -3.5 \cdot 10^{-242}:\\ \;\;\;\;\frac{b \cdot c - a \cdot d}{d \cdot d}\\ \mathbf{elif}\;c \leq 8.2 \cdot 10^{+73}:\\ \;\;\;\;\frac{-a}{d}\\ \mathbf{else}:\\ \;\;\;\;\frac{b}{c}\\ \end{array} \]
                    5. Add Preprocessing

                    Alternative 6: 76.6% accurate, 0.9× speedup?

                    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;d \leq -1.65 \cdot 10^{-85} \lor \neg \left(d \leq 6.2 \cdot 10^{+70}\right):\\ \;\;\;\;\frac{\mathsf{fma}\left(c, \frac{b}{d}, -a\right)}{d}\\ \mathbf{else}:\\ \;\;\;\;\frac{b - d \cdot \frac{a}{c}}{c}\\ \end{array} \end{array} \]
                    (FPCore (a b c d)
                     :precision binary64
                     (if (or (<= d -1.65e-85) (not (<= d 6.2e+70)))
                       (/ (fma c (/ b d) (- a)) d)
                       (/ (- b (* d (/ a c))) c)))
                    double code(double a, double b, double c, double d) {
                    	double tmp;
                    	if ((d <= -1.65e-85) || !(d <= 6.2e+70)) {
                    		tmp = fma(c, (b / d), -a) / d;
                    	} else {
                    		tmp = (b - (d * (a / c))) / c;
                    	}
                    	return tmp;
                    }
                    
                    function code(a, b, c, d)
                    	tmp = 0.0
                    	if ((d <= -1.65e-85) || !(d <= 6.2e+70))
                    		tmp = Float64(fma(c, Float64(b / d), Float64(-a)) / d);
                    	else
                    		tmp = Float64(Float64(b - Float64(d * Float64(a / c))) / c);
                    	end
                    	return tmp
                    end
                    
                    code[a_, b_, c_, d_] := If[Or[LessEqual[d, -1.65e-85], N[Not[LessEqual[d, 6.2e+70]], $MachinePrecision]], N[(N[(c * N[(b / d), $MachinePrecision] + (-a)), $MachinePrecision] / d), $MachinePrecision], N[(N[(b - N[(d * N[(a / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision]]
                    
                    \begin{array}{l}
                    
                    \\
                    \begin{array}{l}
                    \mathbf{if}\;d \leq -1.65 \cdot 10^{-85} \lor \neg \left(d \leq 6.2 \cdot 10^{+70}\right):\\
                    \;\;\;\;\frac{\mathsf{fma}\left(c, \frac{b}{d}, -a\right)}{d}\\
                    
                    \mathbf{else}:\\
                    \;\;\;\;\frac{b - d \cdot \frac{a}{c}}{c}\\
                    
                    
                    \end{array}
                    \end{array}
                    
                    Derivation
                    1. Split input into 2 regimes
                    2. if d < -1.64999999999999986e-85 or 6.2000000000000006e70 < d

                      1. Initial program 46.5%

                        \[\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-*.f6471.8

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

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

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

                        if -1.64999999999999986e-85 < d < 6.2000000000000006e70

                        1. Initial program 74.8%

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

                            \[\leadsto \frac{b - \frac{\color{blue}{a \cdot d}}{c}}{c} \]
                        5. Applied rewrites80.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 \frac{a}{c}}{c} \]
                        7. Recombined 2 regimes into one program.
                        8. Final simplification82.5%

                          \[\leadsto \begin{array}{l} \mathbf{if}\;d \leq -1.65 \cdot 10^{-85} \lor \neg \left(d \leq 6.2 \cdot 10^{+70}\right):\\ \;\;\;\;\frac{\mathsf{fma}\left(c, \frac{b}{d}, -a\right)}{d}\\ \mathbf{else}:\\ \;\;\;\;\frac{b - d \cdot \frac{a}{c}}{c}\\ \end{array} \]
                        9. Add Preprocessing

                        Alternative 7: 78.5% accurate, 0.9× speedup?

                        \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;c \leq -63 \lor \neg \left(c \leq 9.4 \cdot 10^{-14}\right):\\ \;\;\;\;\frac{b - d \cdot \frac{a}{c}}{c}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{b \cdot c}{d} - a}{d}\\ \end{array} \end{array} \]
                        (FPCore (a b c d)
                         :precision binary64
                         (if (or (<= c -63.0) (not (<= c 9.4e-14)))
                           (/ (- b (* d (/ a c))) c)
                           (/ (- (/ (* b c) d) a) d)))
                        double code(double a, double b, double c, double d) {
                        	double tmp;
                        	if ((c <= -63.0) || !(c <= 9.4e-14)) {
                        		tmp = (b - (d * (a / c))) / c;
                        	} else {
                        		tmp = (((b * c) / d) - a) / 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 ((c <= (-63.0d0)) .or. (.not. (c <= 9.4d-14))) then
                                tmp = (b - (d * (a / c))) / c
                            else
                                tmp = (((b * c) / d) - a) / d
                            end if
                            code = tmp
                        end function
                        
                        public static double code(double a, double b, double c, double d) {
                        	double tmp;
                        	if ((c <= -63.0) || !(c <= 9.4e-14)) {
                        		tmp = (b - (d * (a / c))) / c;
                        	} else {
                        		tmp = (((b * c) / d) - a) / d;
                        	}
                        	return tmp;
                        }
                        
                        def code(a, b, c, d):
                        	tmp = 0
                        	if (c <= -63.0) or not (c <= 9.4e-14):
                        		tmp = (b - (d * (a / c))) / c
                        	else:
                        		tmp = (((b * c) / d) - a) / d
                        	return tmp
                        
                        function code(a, b, c, d)
                        	tmp = 0.0
                        	if ((c <= -63.0) || !(c <= 9.4e-14))
                        		tmp = Float64(Float64(b - Float64(d * Float64(a / c))) / c);
                        	else
                        		tmp = Float64(Float64(Float64(Float64(b * c) / d) - a) / d);
                        	end
                        	return tmp
                        end
                        
                        function tmp_2 = code(a, b, c, d)
                        	tmp = 0.0;
                        	if ((c <= -63.0) || ~((c <= 9.4e-14)))
                        		tmp = (b - (d * (a / c))) / c;
                        	else
                        		tmp = (((b * c) / d) - a) / d;
                        	end
                        	tmp_2 = tmp;
                        end
                        
                        code[a_, b_, c_, d_] := If[Or[LessEqual[c, -63.0], N[Not[LessEqual[c, 9.4e-14]], $MachinePrecision]], N[(N[(b - N[(d * N[(a / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision], N[(N[(N[(N[(b * c), $MachinePrecision] / d), $MachinePrecision] - a), $MachinePrecision] / d), $MachinePrecision]]
                        
                        \begin{array}{l}
                        
                        \\
                        \begin{array}{l}
                        \mathbf{if}\;c \leq -63 \lor \neg \left(c \leq 9.4 \cdot 10^{-14}\right):\\
                        \;\;\;\;\frac{b - d \cdot \frac{a}{c}}{c}\\
                        
                        \mathbf{else}:\\
                        \;\;\;\;\frac{\frac{b \cdot c}{d} - a}{d}\\
                        
                        
                        \end{array}
                        \end{array}
                        
                        Derivation
                        1. Split input into 2 regimes
                        2. if c < -63 or 9.4000000000000003e-14 < c

                          1. Initial program 47.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-*.f6473.2

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

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

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

                            if -63 < c < 9.4000000000000003e-14

                            1. Initial program 78.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-*.f6485.6

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

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

                            \[\leadsto \begin{array}{l} \mathbf{if}\;c \leq -63 \lor \neg \left(c \leq 9.4 \cdot 10^{-14}\right):\\ \;\;\;\;\frac{b - d \cdot \frac{a}{c}}{c}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{b \cdot c}{d} - a}{d}\\ \end{array} \]
                          9. Add Preprocessing

                          Alternative 8: 63.3% accurate, 0.9× speedup?

                          \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;c \leq -2 \cdot 10^{+107}:\\ \;\;\;\;\frac{b}{c}\\ \mathbf{elif}\;c \leq -3.9 \cdot 10^{-163}:\\ \;\;\;\;\frac{b}{\mathsf{fma}\left(d, d, c \cdot c\right)} \cdot c\\ \mathbf{elif}\;c \leq 8.2 \cdot 10^{+73}:\\ \;\;\;\;\frac{-a}{d}\\ \mathbf{else}:\\ \;\;\;\;\frac{b}{c}\\ \end{array} \end{array} \]
                          (FPCore (a b c d)
                           :precision binary64
                           (if (<= c -2e+107)
                             (/ b c)
                             (if (<= c -3.9e-163)
                               (* (/ b (fma d d (* c c))) c)
                               (if (<= c 8.2e+73) (/ (- a) d) (/ b c)))))
                          double code(double a, double b, double c, double d) {
                          	double tmp;
                          	if (c <= -2e+107) {
                          		tmp = b / c;
                          	} else if (c <= -3.9e-163) {
                          		tmp = (b / fma(d, d, (c * c))) * c;
                          	} else if (c <= 8.2e+73) {
                          		tmp = -a / d;
                          	} else {
                          		tmp = b / c;
                          	}
                          	return tmp;
                          }
                          
                          function code(a, b, c, d)
                          	tmp = 0.0
                          	if (c <= -2e+107)
                          		tmp = Float64(b / c);
                          	elseif (c <= -3.9e-163)
                          		tmp = Float64(Float64(b / fma(d, d, Float64(c * c))) * c);
                          	elseif (c <= 8.2e+73)
                          		tmp = Float64(Float64(-a) / d);
                          	else
                          		tmp = Float64(b / c);
                          	end
                          	return tmp
                          end
                          
                          code[a_, b_, c_, d_] := If[LessEqual[c, -2e+107], N[(b / c), $MachinePrecision], If[LessEqual[c, -3.9e-163], N[(N[(b / N[(d * d + N[(c * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision], If[LessEqual[c, 8.2e+73], N[((-a) / d), $MachinePrecision], N[(b / c), $MachinePrecision]]]]
                          
                          \begin{array}{l}
                          
                          \\
                          \begin{array}{l}
                          \mathbf{if}\;c \leq -2 \cdot 10^{+107}:\\
                          \;\;\;\;\frac{b}{c}\\
                          
                          \mathbf{elif}\;c \leq -3.9 \cdot 10^{-163}:\\
                          \;\;\;\;\frac{b}{\mathsf{fma}\left(d, d, c \cdot c\right)} \cdot c\\
                          
                          \mathbf{elif}\;c \leq 8.2 \cdot 10^{+73}:\\
                          \;\;\;\;\frac{-a}{d}\\
                          
                          \mathbf{else}:\\
                          \;\;\;\;\frac{b}{c}\\
                          
                          
                          \end{array}
                          \end{array}
                          
                          Derivation
                          1. Split input into 3 regimes
                          2. if c < -1.9999999999999999e107 or 8.1999999999999996e73 < c

                            1. Initial program 36.6%

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

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

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

                            if -1.9999999999999999e107 < c < -3.9000000000000002e-163

                            1. Initial program 82.1%

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

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

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

                            if -3.9000000000000002e-163 < c < 8.1999999999999996e73

                            1. Initial program 73.8%

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

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

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

                            \[\leadsto \begin{array}{l} \mathbf{if}\;c \leq -2 \cdot 10^{+107}:\\ \;\;\;\;\frac{b}{c}\\ \mathbf{elif}\;c \leq -3.9 \cdot 10^{-163}:\\ \;\;\;\;\frac{b}{\mathsf{fma}\left(d, d, c \cdot c\right)} \cdot c\\ \mathbf{elif}\;c \leq 8.2 \cdot 10^{+73}:\\ \;\;\;\;\frac{-a}{d}\\ \mathbf{else}:\\ \;\;\;\;\frac{b}{c}\\ \end{array} \]
                          5. Add Preprocessing

                          Alternative 9: 64.1% accurate, 0.9× speedup?

                          \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;c \leq -9.5 \cdot 10^{+125}:\\ \;\;\;\;\frac{b}{c}\\ \mathbf{elif}\;c \leq -3.9 \cdot 10^{-163}:\\ \;\;\;\;\frac{c}{\mathsf{fma}\left(d, d, c \cdot c\right)} \cdot b\\ \mathbf{elif}\;c \leq 8.2 \cdot 10^{+73}:\\ \;\;\;\;\frac{-a}{d}\\ \mathbf{else}:\\ \;\;\;\;\frac{b}{c}\\ \end{array} \end{array} \]
                          (FPCore (a b c d)
                           :precision binary64
                           (if (<= c -9.5e+125)
                             (/ b c)
                             (if (<= c -3.9e-163)
                               (* (/ c (fma d d (* c c))) b)
                               (if (<= c 8.2e+73) (/ (- a) d) (/ b c)))))
                          double code(double a, double b, double c, double d) {
                          	double tmp;
                          	if (c <= -9.5e+125) {
                          		tmp = b / c;
                          	} else if (c <= -3.9e-163) {
                          		tmp = (c / fma(d, d, (c * c))) * b;
                          	} else if (c <= 8.2e+73) {
                          		tmp = -a / d;
                          	} else {
                          		tmp = b / c;
                          	}
                          	return tmp;
                          }
                          
                          function code(a, b, c, d)
                          	tmp = 0.0
                          	if (c <= -9.5e+125)
                          		tmp = Float64(b / c);
                          	elseif (c <= -3.9e-163)
                          		tmp = Float64(Float64(c / fma(d, d, Float64(c * c))) * b);
                          	elseif (c <= 8.2e+73)
                          		tmp = Float64(Float64(-a) / d);
                          	else
                          		tmp = Float64(b / c);
                          	end
                          	return tmp
                          end
                          
                          code[a_, b_, c_, d_] := If[LessEqual[c, -9.5e+125], N[(b / c), $MachinePrecision], If[LessEqual[c, -3.9e-163], N[(N[(c / N[(d * d + N[(c * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * b), $MachinePrecision], If[LessEqual[c, 8.2e+73], N[((-a) / d), $MachinePrecision], N[(b / c), $MachinePrecision]]]]
                          
                          \begin{array}{l}
                          
                          \\
                          \begin{array}{l}
                          \mathbf{if}\;c \leq -9.5 \cdot 10^{+125}:\\
                          \;\;\;\;\frac{b}{c}\\
                          
                          \mathbf{elif}\;c \leq -3.9 \cdot 10^{-163}:\\
                          \;\;\;\;\frac{c}{\mathsf{fma}\left(d, d, c \cdot c\right)} \cdot b\\
                          
                          \mathbf{elif}\;c \leq 8.2 \cdot 10^{+73}:\\
                          \;\;\;\;\frac{-a}{d}\\
                          
                          \mathbf{else}:\\
                          \;\;\;\;\frac{b}{c}\\
                          
                          
                          \end{array}
                          \end{array}
                          
                          Derivation
                          1. Split input into 3 regimes
                          2. if c < -9.50000000000000041e125 or 8.1999999999999996e73 < c

                            1. Initial program 34.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}{c}} \]
                            4. Step-by-step derivation
                              1. lower-/.f6471.5

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

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

                            if -9.50000000000000041e125 < c < -3.9000000000000002e-163

                            1. Initial program 81.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                \[\leadsto \mathsf{fma}\left(\frac{c}{\mathsf{fma}\left(d, d, c \cdot c\right)}, b, \mathsf{neg}\left(\frac{\color{blue}{d \cdot a}}{c \cdot c + d \cdot d}\right)\right) \]
                              16. associate-/l*N/A

                                \[\leadsto \mathsf{fma}\left(\frac{c}{\mathsf{fma}\left(d, d, c \cdot c\right)}, b, \mathsf{neg}\left(\color{blue}{d \cdot \frac{a}{c \cdot c + d \cdot d}}\right)\right) \]
                            4. Applied rewrites79.2%

                              \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{c}{\mathsf{fma}\left(d, d, c \cdot c\right)}, b, \left(-d\right) \cdot \frac{a}{\mathsf{fma}\left(d, d, c \cdot c\right)}\right)} \]
                            5. Taylor expanded in a around 0

                              \[\leadsto \color{blue}{\frac{b \cdot c}{{c}^{2} + {d}^{2}}} \]
                            6. 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}{\frac{c}{{c}^{2} + {d}^{2}} \cdot b} \]
                              3. lower-*.f64N/A

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

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

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

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

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

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

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

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

                            if -3.9000000000000002e-163 < c < 8.1999999999999996e73

                            1. Initial program 73.8%

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

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

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

                            \[\leadsto \begin{array}{l} \mathbf{if}\;c \leq -9.5 \cdot 10^{+125}:\\ \;\;\;\;\frac{b}{c}\\ \mathbf{elif}\;c \leq -3.9 \cdot 10^{-163}:\\ \;\;\;\;\frac{c}{\mathsf{fma}\left(d, d, c \cdot c\right)} \cdot b\\ \mathbf{elif}\;c \leq 8.2 \cdot 10^{+73}:\\ \;\;\;\;\frac{-a}{d}\\ \mathbf{else}:\\ \;\;\;\;\frac{b}{c}\\ \end{array} \]
                          5. Add Preprocessing

                          Alternative 10: 60.9% accurate, 1.1× speedup?

                          \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;c \leq -1.5 \cdot 10^{-67}:\\ \;\;\;\;\frac{b}{c}\\ \mathbf{elif}\;c \leq -3.9 \cdot 10^{-163}:\\ \;\;\;\;\frac{b}{d \cdot d} \cdot c\\ \mathbf{elif}\;c \leq 8.2 \cdot 10^{+73}:\\ \;\;\;\;\frac{-a}{d}\\ \mathbf{else}:\\ \;\;\;\;\frac{b}{c}\\ \end{array} \end{array} \]
                          (FPCore (a b c d)
                           :precision binary64
                           (if (<= c -1.5e-67)
                             (/ b c)
                             (if (<= c -3.9e-163)
                               (* (/ b (* d d)) c)
                               (if (<= c 8.2e+73) (/ (- a) d) (/ b c)))))
                          double code(double a, double b, double c, double d) {
                          	double tmp;
                          	if (c <= -1.5e-67) {
                          		tmp = b / c;
                          	} else if (c <= -3.9e-163) {
                          		tmp = (b / (d * d)) * c;
                          	} else if (c <= 8.2e+73) {
                          		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 <= (-1.5d-67)) then
                                  tmp = b / c
                              else if (c <= (-3.9d-163)) then
                                  tmp = (b / (d * d)) * c
                              else if (c <= 8.2d+73) 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 <= -1.5e-67) {
                          		tmp = b / c;
                          	} else if (c <= -3.9e-163) {
                          		tmp = (b / (d * d)) * c;
                          	} else if (c <= 8.2e+73) {
                          		tmp = -a / d;
                          	} else {
                          		tmp = b / c;
                          	}
                          	return tmp;
                          }
                          
                          def code(a, b, c, d):
                          	tmp = 0
                          	if c <= -1.5e-67:
                          		tmp = b / c
                          	elif c <= -3.9e-163:
                          		tmp = (b / (d * d)) * c
                          	elif c <= 8.2e+73:
                          		tmp = -a / d
                          	else:
                          		tmp = b / c
                          	return tmp
                          
                          function code(a, b, c, d)
                          	tmp = 0.0
                          	if (c <= -1.5e-67)
                          		tmp = Float64(b / c);
                          	elseif (c <= -3.9e-163)
                          		tmp = Float64(Float64(b / Float64(d * d)) * c);
                          	elseif (c <= 8.2e+73)
                          		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 <= -1.5e-67)
                          		tmp = b / c;
                          	elseif (c <= -3.9e-163)
                          		tmp = (b / (d * d)) * c;
                          	elseif (c <= 8.2e+73)
                          		tmp = -a / d;
                          	else
                          		tmp = b / c;
                          	end
                          	tmp_2 = tmp;
                          end
                          
                          code[a_, b_, c_, d_] := If[LessEqual[c, -1.5e-67], N[(b / c), $MachinePrecision], If[LessEqual[c, -3.9e-163], N[(N[(b / N[(d * d), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision], If[LessEqual[c, 8.2e+73], N[((-a) / d), $MachinePrecision], N[(b / c), $MachinePrecision]]]]
                          
                          \begin{array}{l}
                          
                          \\
                          \begin{array}{l}
                          \mathbf{if}\;c \leq -1.5 \cdot 10^{-67}:\\
                          \;\;\;\;\frac{b}{c}\\
                          
                          \mathbf{elif}\;c \leq -3.9 \cdot 10^{-163}:\\
                          \;\;\;\;\frac{b}{d \cdot d} \cdot c\\
                          
                          \mathbf{elif}\;c \leq 8.2 \cdot 10^{+73}:\\
                          \;\;\;\;\frac{-a}{d}\\
                          
                          \mathbf{else}:\\
                          \;\;\;\;\frac{b}{c}\\
                          
                          
                          \end{array}
                          \end{array}
                          
                          Derivation
                          1. Split input into 3 regimes
                          2. if c < -1.50000000000000016e-67 or 8.1999999999999996e73 < c

                            1. Initial program 48.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-/.f6465.2

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

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

                            if -1.50000000000000016e-67 < c < -3.9000000000000002e-163

                            1. Initial program 89.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-*.f6495.6

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

                              \[\leadsto \color{blue}{\frac{\frac{b \cdot c}{d} - a}{d}} \]
                            6. Taylor expanded in a around 0

                              \[\leadsto \frac{b \cdot c}{\color{blue}{{d}^{2}}} \]
                            7. Step-by-step derivation
                              1. Applied rewrites63.9%

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

                              if -3.9000000000000002e-163 < c < 8.1999999999999996e73

                              1. Initial program 73.8%

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

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

                                \[\leadsto \color{blue}{\frac{a}{-d}} \]
                            8. Recombined 3 regimes into one program.
                            9. Final simplification66.0%

                              \[\leadsto \begin{array}{l} \mathbf{if}\;c \leq -1.5 \cdot 10^{-67}:\\ \;\;\;\;\frac{b}{c}\\ \mathbf{elif}\;c \leq -3.9 \cdot 10^{-163}:\\ \;\;\;\;\frac{b}{d \cdot d} \cdot c\\ \mathbf{elif}\;c \leq 8.2 \cdot 10^{+73}:\\ \;\;\;\;\frac{-a}{d}\\ \mathbf{else}:\\ \;\;\;\;\frac{b}{c}\\ \end{array} \]
                            10. Add Preprocessing

                            Alternative 11: 60.8% accurate, 1.5× speedup?

                            \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;c \leq -3.9 \cdot 10^{-163} \lor \neg \left(c \leq 8.2 \cdot 10^{+73}\right):\\ \;\;\;\;\frac{b}{c}\\ \mathbf{else}:\\ \;\;\;\;\frac{-a}{d}\\ \end{array} \end{array} \]
                            (FPCore (a b c d)
                             :precision binary64
                             (if (or (<= c -3.9e-163) (not (<= c 8.2e+73))) (/ b c) (/ (- a) d)))
                            double code(double a, double b, double c, double d) {
                            	double tmp;
                            	if ((c <= -3.9e-163) || !(c <= 8.2e+73)) {
                            		tmp = b / c;
                            	} else {
                            		tmp = -a / 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 ((c <= (-3.9d-163)) .or. (.not. (c <= 8.2d+73))) then
                                    tmp = b / c
                                else
                                    tmp = -a / d
                                end if
                                code = tmp
                            end function
                            
                            public static double code(double a, double b, double c, double d) {
                            	double tmp;
                            	if ((c <= -3.9e-163) || !(c <= 8.2e+73)) {
                            		tmp = b / c;
                            	} else {
                            		tmp = -a / d;
                            	}
                            	return tmp;
                            }
                            
                            def code(a, b, c, d):
                            	tmp = 0
                            	if (c <= -3.9e-163) or not (c <= 8.2e+73):
                            		tmp = b / c
                            	else:
                            		tmp = -a / d
                            	return tmp
                            
                            function code(a, b, c, d)
                            	tmp = 0.0
                            	if ((c <= -3.9e-163) || !(c <= 8.2e+73))
                            		tmp = Float64(b / c);
                            	else
                            		tmp = Float64(Float64(-a) / d);
                            	end
                            	return tmp
                            end
                            
                            function tmp_2 = code(a, b, c, d)
                            	tmp = 0.0;
                            	if ((c <= -3.9e-163) || ~((c <= 8.2e+73)))
                            		tmp = b / c;
                            	else
                            		tmp = -a / d;
                            	end
                            	tmp_2 = tmp;
                            end
                            
                            code[a_, b_, c_, d_] := If[Or[LessEqual[c, -3.9e-163], N[Not[LessEqual[c, 8.2e+73]], $MachinePrecision]], N[(b / c), $MachinePrecision], N[((-a) / d), $MachinePrecision]]
                            
                            \begin{array}{l}
                            
                            \\
                            \begin{array}{l}
                            \mathbf{if}\;c \leq -3.9 \cdot 10^{-163} \lor \neg \left(c \leq 8.2 \cdot 10^{+73}\right):\\
                            \;\;\;\;\frac{b}{c}\\
                            
                            \mathbf{else}:\\
                            \;\;\;\;\frac{-a}{d}\\
                            
                            
                            \end{array}
                            \end{array}
                            
                            Derivation
                            1. Split input into 2 regimes
                            2. if c < -3.9000000000000002e-163 or 8.1999999999999996e73 < c

                              1. Initial program 53.6%

                                \[\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-/.f6461.5

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

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

                              if -3.9000000000000002e-163 < c < 8.1999999999999996e73

                              1. Initial program 73.8%

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

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

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

                              \[\leadsto \begin{array}{l} \mathbf{if}\;c \leq -3.9 \cdot 10^{-163} \lor \neg \left(c \leq 8.2 \cdot 10^{+73}\right):\\ \;\;\;\;\frac{b}{c}\\ \mathbf{else}:\\ \;\;\;\;\frac{-a}{d}\\ \end{array} \]
                            5. Add Preprocessing

                            Alternative 12: 43.5% 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.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-/.f6442.9

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

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