Complex division, imag part

Percentage Accurate: 61.7% → 82.4%
Time: 6.7s
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: 61.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: 82.4% accurate, 0.6× speedup?

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

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

\mathbf{elif}\;d \leq -2.6 \cdot 10^{-107}:\\
\;\;\;\;t\_0\\

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

\mathbf{elif}\;d \leq 4.5 \cdot 10^{+45}:\\
\;\;\;\;t\_0\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if d < -4.9999999999999996e124

    1. Initial program 21.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-*.f6466.0

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

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

        \[\leadsto \frac{\mathsf{fma}\left(\frac{c}{d}, b, -a\right)}{d} \]
      2. Step-by-step derivation
        1. Applied rewrites86.8%

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

        if -4.9999999999999996e124 < d < -2.6000000000000001e-107 or 3.40000000000000014e-137 < d < 4.4999999999999998e45

        1. Initial program 86.6%

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

        if -2.6000000000000001e-107 < d < 3.40000000000000014e-137

        1. Initial program 73.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 + -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-*.f6490.3

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

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

        if 4.4999999999999998e45 < d

        1. Initial program 43.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} + \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-*.f6479.4

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

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

            \[\leadsto \frac{\mathsf{fma}\left(\frac{c}{d}, b, -a\right)}{d} \]
          2. Step-by-step derivation
            1. Applied rewrites83.7%

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

            \[\leadsto \begin{array}{l} \mathbf{if}\;d \leq -5 \cdot 10^{+124}:\\ \;\;\;\;\frac{1}{\frac{d}{\mathsf{fma}\left(\frac{c}{d}, b, -a\right)}}\\ \mathbf{elif}\;d \leq -2.6 \cdot 10^{-107}:\\ \;\;\;\;\frac{c \cdot b - a \cdot d}{d \cdot d + c \cdot c}\\ \mathbf{elif}\;d \leq 3.4 \cdot 10^{-137}:\\ \;\;\;\;\frac{b - \frac{a \cdot d}{c}}{c}\\ \mathbf{elif}\;d \leq 4.5 \cdot 10^{+45}:\\ \;\;\;\;\frac{c \cdot b - a \cdot d}{d \cdot d + c \cdot c}\\ \mathbf{else}:\\ \;\;\;\;\frac{\mathsf{fma}\left(\frac{-1}{-d} \cdot c, b, -a\right)}{d}\\ \end{array} \]
          5. Add Preprocessing

          Alternative 2: 82.7% accurate, 0.6× speedup?

          \[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{c \cdot b - a \cdot d}{d \cdot d + c \cdot c}\\ \mathbf{if}\;d \leq -6.4 \cdot 10^{+122}:\\ \;\;\;\;\frac{\mathsf{fma}\left(c, \frac{b}{d}, -a\right)}{d}\\ \mathbf{elif}\;d \leq -2.6 \cdot 10^{-107}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;d \leq 3.4 \cdot 10^{-137}:\\ \;\;\;\;\frac{b - \frac{a \cdot d}{c}}{c}\\ \mathbf{elif}\;d \leq 4.5 \cdot 10^{+45}:\\ \;\;\;\;t\_0\\ \mathbf{else}:\\ \;\;\;\;\frac{\mathsf{fma}\left(\frac{-1}{-d} \cdot c, b, -a\right)}{d}\\ \end{array} \end{array} \]
          (FPCore (a b c d)
           :precision binary64
           (let* ((t_0 (/ (- (* c b) (* a d)) (+ (* d d) (* c c)))))
             (if (<= d -6.4e+122)
               (/ (fma c (/ b d) (- a)) d)
               (if (<= d -2.6e-107)
                 t_0
                 (if (<= d 3.4e-137)
                   (/ (- b (/ (* a d) c)) c)
                   (if (<= d 4.5e+45) t_0 (/ (fma (* (/ -1.0 (- d)) c) b (- a)) d)))))))
          double code(double a, double b, double c, double d) {
          	double t_0 = ((c * b) - (a * d)) / ((d * d) + (c * c));
          	double tmp;
          	if (d <= -6.4e+122) {
          		tmp = fma(c, (b / d), -a) / d;
          	} else if (d <= -2.6e-107) {
          		tmp = t_0;
          	} else if (d <= 3.4e-137) {
          		tmp = (b - ((a * d) / c)) / c;
          	} else if (d <= 4.5e+45) {
          		tmp = t_0;
          	} else {
          		tmp = fma(((-1.0 / -d) * c), b, -a) / d;
          	}
          	return tmp;
          }
          
          function code(a, b, c, d)
          	t_0 = Float64(Float64(Float64(c * b) - Float64(a * d)) / Float64(Float64(d * d) + Float64(c * c)))
          	tmp = 0.0
          	if (d <= -6.4e+122)
          		tmp = Float64(fma(c, Float64(b / d), Float64(-a)) / d);
          	elseif (d <= -2.6e-107)
          		tmp = t_0;
          	elseif (d <= 3.4e-137)
          		tmp = Float64(Float64(b - Float64(Float64(a * d) / c)) / c);
          	elseif (d <= 4.5e+45)
          		tmp = t_0;
          	else
          		tmp = Float64(fma(Float64(Float64(-1.0 / Float64(-d)) * c), b, Float64(-a)) / d);
          	end
          	return tmp
          end
          
          code[a_, b_, c_, d_] := Block[{t$95$0 = N[(N[(N[(c * b), $MachinePrecision] - N[(a * d), $MachinePrecision]), $MachinePrecision] / N[(N[(d * d), $MachinePrecision] + N[(c * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[d, -6.4e+122], N[(N[(c * N[(b / d), $MachinePrecision] + (-a)), $MachinePrecision] / d), $MachinePrecision], If[LessEqual[d, -2.6e-107], t$95$0, If[LessEqual[d, 3.4e-137], N[(N[(b - N[(N[(a * d), $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision], If[LessEqual[d, 4.5e+45], t$95$0, N[(N[(N[(N[(-1.0 / (-d)), $MachinePrecision] * c), $MachinePrecision] * b + (-a)), $MachinePrecision] / d), $MachinePrecision]]]]]]
          
          \begin{array}{l}
          
          \\
          \begin{array}{l}
          t_0 := \frac{c \cdot b - a \cdot d}{d \cdot d + c \cdot c}\\
          \mathbf{if}\;d \leq -6.4 \cdot 10^{+122}:\\
          \;\;\;\;\frac{\mathsf{fma}\left(c, \frac{b}{d}, -a\right)}{d}\\
          
          \mathbf{elif}\;d \leq -2.6 \cdot 10^{-107}:\\
          \;\;\;\;t\_0\\
          
          \mathbf{elif}\;d \leq 3.4 \cdot 10^{-137}:\\
          \;\;\;\;\frac{b - \frac{a \cdot d}{c}}{c}\\
          
          \mathbf{elif}\;d \leq 4.5 \cdot 10^{+45}:\\
          \;\;\;\;t\_0\\
          
          \mathbf{else}:\\
          \;\;\;\;\frac{\mathsf{fma}\left(\frac{-1}{-d} \cdot c, b, -a\right)}{d}\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 4 regimes
          2. if d < -6.40000000000000024e122

            1. Initial program 21.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-*.f6466.0

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

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

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

              if -6.40000000000000024e122 < d < -2.6000000000000001e-107 or 3.40000000000000014e-137 < d < 4.4999999999999998e45

              1. Initial program 86.6%

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

              if -2.6000000000000001e-107 < d < 3.40000000000000014e-137

              1. Initial program 73.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 + -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-*.f6490.3

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

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

              if 4.4999999999999998e45 < d

              1. Initial program 43.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} + \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-*.f6479.4

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

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

                  \[\leadsto \frac{\mathsf{fma}\left(\frac{c}{d}, b, -a\right)}{d} \]
                2. Step-by-step derivation
                  1. Applied rewrites83.7%

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

                  \[\leadsto \begin{array}{l} \mathbf{if}\;d \leq -6.4 \cdot 10^{+122}:\\ \;\;\;\;\frac{\mathsf{fma}\left(c, \frac{b}{d}, -a\right)}{d}\\ \mathbf{elif}\;d \leq -2.6 \cdot 10^{-107}:\\ \;\;\;\;\frac{c \cdot b - a \cdot d}{d \cdot d + c \cdot c}\\ \mathbf{elif}\;d \leq 3.4 \cdot 10^{-137}:\\ \;\;\;\;\frac{b - \frac{a \cdot d}{c}}{c}\\ \mathbf{elif}\;d \leq 4.5 \cdot 10^{+45}:\\ \;\;\;\;\frac{c \cdot b - a \cdot d}{d \cdot d + c \cdot c}\\ \mathbf{else}:\\ \;\;\;\;\frac{\mathsf{fma}\left(\frac{-1}{-d} \cdot c, b, -a\right)}{d}\\ \end{array} \]
                5. Add Preprocessing

                Alternative 3: 65.6% accurate, 0.6× speedup?

                \[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{-a}{d}\\ t_1 := \frac{c \cdot b - a \cdot d}{d \cdot d}\\ \mathbf{if}\;d \leq -2.8 \cdot 10^{+71}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;d \leq -0.009:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;d \leq -8.6 \cdot 10^{-106}:\\ \;\;\;\;\frac{d}{\mathsf{fma}\left(d, d, c \cdot c\right)} \cdot \left(-a\right)\\ \mathbf{elif}\;d \leq 1.8 \cdot 10^{-41}:\\ \;\;\;\;\frac{b}{c}\\ \mathbf{elif}\;d \leq 1.85 \cdot 10^{+159}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
                (FPCore (a b c d)
                 :precision binary64
                 (let* ((t_0 (/ (- a) d)) (t_1 (/ (- (* c b) (* a d)) (* d d))))
                   (if (<= d -2.8e+71)
                     t_0
                     (if (<= d -0.009)
                       t_1
                       (if (<= d -8.6e-106)
                         (* (/ d (fma d d (* c c))) (- a))
                         (if (<= d 1.8e-41) (/ b c) (if (<= d 1.85e+159) t_1 t_0)))))))
                double code(double a, double b, double c, double d) {
                	double t_0 = -a / d;
                	double t_1 = ((c * b) - (a * d)) / (d * d);
                	double tmp;
                	if (d <= -2.8e+71) {
                		tmp = t_0;
                	} else if (d <= -0.009) {
                		tmp = t_1;
                	} else if (d <= -8.6e-106) {
                		tmp = (d / fma(d, d, (c * c))) * -a;
                	} else if (d <= 1.8e-41) {
                		tmp = b / c;
                	} else if (d <= 1.85e+159) {
                		tmp = t_1;
                	} else {
                		tmp = t_0;
                	}
                	return tmp;
                }
                
                function code(a, b, c, d)
                	t_0 = Float64(Float64(-a) / d)
                	t_1 = Float64(Float64(Float64(c * b) - Float64(a * d)) / Float64(d * d))
                	tmp = 0.0
                	if (d <= -2.8e+71)
                		tmp = t_0;
                	elseif (d <= -0.009)
                		tmp = t_1;
                	elseif (d <= -8.6e-106)
                		tmp = Float64(Float64(d / fma(d, d, Float64(c * c))) * Float64(-a));
                	elseif (d <= 1.8e-41)
                		tmp = Float64(b / c);
                	elseif (d <= 1.85e+159)
                		tmp = t_1;
                	else
                		tmp = t_0;
                	end
                	return tmp
                end
                
                code[a_, b_, c_, d_] := Block[{t$95$0 = N[((-a) / d), $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[(c * b), $MachinePrecision] - N[(a * d), $MachinePrecision]), $MachinePrecision] / N[(d * d), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[d, -2.8e+71], t$95$0, If[LessEqual[d, -0.009], t$95$1, If[LessEqual[d, -8.6e-106], N[(N[(d / N[(d * d + N[(c * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * (-a)), $MachinePrecision], If[LessEqual[d, 1.8e-41], N[(b / c), $MachinePrecision], If[LessEqual[d, 1.85e+159], t$95$1, t$95$0]]]]]]]
                
                \begin{array}{l}
                
                \\
                \begin{array}{l}
                t_0 := \frac{-a}{d}\\
                t_1 := \frac{c \cdot b - a \cdot d}{d \cdot d}\\
                \mathbf{if}\;d \leq -2.8 \cdot 10^{+71}:\\
                \;\;\;\;t\_0\\
                
                \mathbf{elif}\;d \leq -0.009:\\
                \;\;\;\;t\_1\\
                
                \mathbf{elif}\;d \leq -8.6 \cdot 10^{-106}:\\
                \;\;\;\;\frac{d}{\mathsf{fma}\left(d, d, c \cdot c\right)} \cdot \left(-a\right)\\
                
                \mathbf{elif}\;d \leq 1.8 \cdot 10^{-41}:\\
                \;\;\;\;\frac{b}{c}\\
                
                \mathbf{elif}\;d \leq 1.85 \cdot 10^{+159}:\\
                \;\;\;\;t\_1\\
                
                \mathbf{else}:\\
                \;\;\;\;t\_0\\
                
                
                \end{array}
                \end{array}
                
                Derivation
                1. Split input into 4 regimes
                2. if d < -2.80000000000000002e71 or 1.85e159 < d

                  1. Initial program 27.4%

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

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

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

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

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

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

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

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

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

                  if -2.80000000000000002e71 < d < -0.00899999999999999932 or 1.8e-41 < d < 1.85e159

                  1. Initial program 78.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 \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-*.f6466.5

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

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

                  if -0.00899999999999999932 < d < -8.6000000000000004e-106

                  1. Initial program 90.3%

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

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

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

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

                      \[\leadsto \color{blue}{\left(-1 \cdot a\right) \cdot \frac{d}{{c}^{2} + {d}^{2}}} \]
                    4. mul-1-negN/A

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

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

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

                      \[\leadsto \left(-a\right) \cdot \frac{d}{\color{blue}{{d}^{2} + {c}^{2}}} \]
                    8. unpow2N/A

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

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

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

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

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

                  if -8.6000000000000004e-106 < d < 1.8e-41

                  1. Initial program 76.7%

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

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

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

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

                  \[\leadsto \begin{array}{l} \mathbf{if}\;d \leq -2.8 \cdot 10^{+71}:\\ \;\;\;\;\frac{-a}{d}\\ \mathbf{elif}\;d \leq -0.009:\\ \;\;\;\;\frac{c \cdot b - a \cdot d}{d \cdot d}\\ \mathbf{elif}\;d \leq -8.6 \cdot 10^{-106}:\\ \;\;\;\;\frac{d}{\mathsf{fma}\left(d, d, c \cdot c\right)} \cdot \left(-a\right)\\ \mathbf{elif}\;d \leq 1.8 \cdot 10^{-41}:\\ \;\;\;\;\frac{b}{c}\\ \mathbf{elif}\;d \leq 1.85 \cdot 10^{+159}:\\ \;\;\;\;\frac{c \cdot b - a \cdot d}{d \cdot d}\\ \mathbf{else}:\\ \;\;\;\;\frac{-a}{d}\\ \end{array} \]
                5. Add Preprocessing

                Alternative 4: 73.8% accurate, 0.7× speedup?

                \[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{-a}{d}\\ t_1 := \frac{c \cdot b - a \cdot d}{d \cdot d}\\ \mathbf{if}\;d \leq -2.8 \cdot 10^{+71}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;d \leq -4.5 \cdot 10^{-7}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;d \leq 1.4 \cdot 10^{-13}:\\ \;\;\;\;\frac{b - \frac{a \cdot d}{c}}{c}\\ \mathbf{elif}\;d \leq 1.85 \cdot 10^{+159}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
                (FPCore (a b c d)
                 :precision binary64
                 (let* ((t_0 (/ (- a) d)) (t_1 (/ (- (* c b) (* a d)) (* d d))))
                   (if (<= d -2.8e+71)
                     t_0
                     (if (<= d -4.5e-7)
                       t_1
                       (if (<= d 1.4e-13)
                         (/ (- b (/ (* a d) c)) c)
                         (if (<= d 1.85e+159) t_1 t_0))))))
                double code(double a, double b, double c, double d) {
                	double t_0 = -a / d;
                	double t_1 = ((c * b) - (a * d)) / (d * d);
                	double tmp;
                	if (d <= -2.8e+71) {
                		tmp = t_0;
                	} else if (d <= -4.5e-7) {
                		tmp = t_1;
                	} else if (d <= 1.4e-13) {
                		tmp = (b - ((a * d) / c)) / c;
                	} else if (d <= 1.85e+159) {
                		tmp = t_1;
                	} 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) :: t_1
                    real(8) :: tmp
                    t_0 = -a / d
                    t_1 = ((c * b) - (a * d)) / (d * d)
                    if (d <= (-2.8d+71)) then
                        tmp = t_0
                    else if (d <= (-4.5d-7)) then
                        tmp = t_1
                    else if (d <= 1.4d-13) then
                        tmp = (b - ((a * d) / c)) / c
                    else if (d <= 1.85d+159) then
                        tmp = t_1
                    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 t_1 = ((c * b) - (a * d)) / (d * d);
                	double tmp;
                	if (d <= -2.8e+71) {
                		tmp = t_0;
                	} else if (d <= -4.5e-7) {
                		tmp = t_1;
                	} else if (d <= 1.4e-13) {
                		tmp = (b - ((a * d) / c)) / c;
                	} else if (d <= 1.85e+159) {
                		tmp = t_1;
                	} else {
                		tmp = t_0;
                	}
                	return tmp;
                }
                
                def code(a, b, c, d):
                	t_0 = -a / d
                	t_1 = ((c * b) - (a * d)) / (d * d)
                	tmp = 0
                	if d <= -2.8e+71:
                		tmp = t_0
                	elif d <= -4.5e-7:
                		tmp = t_1
                	elif d <= 1.4e-13:
                		tmp = (b - ((a * d) / c)) / c
                	elif d <= 1.85e+159:
                		tmp = t_1
                	else:
                		tmp = t_0
                	return tmp
                
                function code(a, b, c, d)
                	t_0 = Float64(Float64(-a) / d)
                	t_1 = Float64(Float64(Float64(c * b) - Float64(a * d)) / Float64(d * d))
                	tmp = 0.0
                	if (d <= -2.8e+71)
                		tmp = t_0;
                	elseif (d <= -4.5e-7)
                		tmp = t_1;
                	elseif (d <= 1.4e-13)
                		tmp = Float64(Float64(b - Float64(Float64(a * d) / c)) / c);
                	elseif (d <= 1.85e+159)
                		tmp = t_1;
                	else
                		tmp = t_0;
                	end
                	return tmp
                end
                
                function tmp_2 = code(a, b, c, d)
                	t_0 = -a / d;
                	t_1 = ((c * b) - (a * d)) / (d * d);
                	tmp = 0.0;
                	if (d <= -2.8e+71)
                		tmp = t_0;
                	elseif (d <= -4.5e-7)
                		tmp = t_1;
                	elseif (d <= 1.4e-13)
                		tmp = (b - ((a * d) / c)) / c;
                	elseif (d <= 1.85e+159)
                		tmp = t_1;
                	else
                		tmp = t_0;
                	end
                	tmp_2 = tmp;
                end
                
                code[a_, b_, c_, d_] := Block[{t$95$0 = N[((-a) / d), $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[(c * b), $MachinePrecision] - N[(a * d), $MachinePrecision]), $MachinePrecision] / N[(d * d), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[d, -2.8e+71], t$95$0, If[LessEqual[d, -4.5e-7], t$95$1, If[LessEqual[d, 1.4e-13], N[(N[(b - N[(N[(a * d), $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision], If[LessEqual[d, 1.85e+159], t$95$1, t$95$0]]]]]]
                
                \begin{array}{l}
                
                \\
                \begin{array}{l}
                t_0 := \frac{-a}{d}\\
                t_1 := \frac{c \cdot b - a \cdot d}{d \cdot d}\\
                \mathbf{if}\;d \leq -2.8 \cdot 10^{+71}:\\
                \;\;\;\;t\_0\\
                
                \mathbf{elif}\;d \leq -4.5 \cdot 10^{-7}:\\
                \;\;\;\;t\_1\\
                
                \mathbf{elif}\;d \leq 1.4 \cdot 10^{-13}:\\
                \;\;\;\;\frac{b - \frac{a \cdot d}{c}}{c}\\
                
                \mathbf{elif}\;d \leq 1.85 \cdot 10^{+159}:\\
                \;\;\;\;t\_1\\
                
                \mathbf{else}:\\
                \;\;\;\;t\_0\\
                
                
                \end{array}
                \end{array}
                
                Derivation
                1. Split input into 3 regimes
                2. if d < -2.80000000000000002e71 or 1.85e159 < d

                  1. Initial program 27.4%

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

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

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

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

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

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

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

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

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

                  if -2.80000000000000002e71 < d < -4.4999999999999998e-7 or 1.4000000000000001e-13 < d < 1.85e159

                  1. Initial program 76.6%

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

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

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

                  if -4.4999999999999998e-7 < d < 1.4000000000000001e-13

                  1. Initial program 79.5%

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

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

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

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

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

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

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

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

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

                  \[\leadsto \begin{array}{l} \mathbf{if}\;d \leq -2.8 \cdot 10^{+71}:\\ \;\;\;\;\frac{-a}{d}\\ \mathbf{elif}\;d \leq -4.5 \cdot 10^{-7}:\\ \;\;\;\;\frac{c \cdot b - a \cdot d}{d \cdot d}\\ \mathbf{elif}\;d \leq 1.4 \cdot 10^{-13}:\\ \;\;\;\;\frac{b - \frac{a \cdot d}{c}}{c}\\ \mathbf{elif}\;d \leq 1.85 \cdot 10^{+159}:\\ \;\;\;\;\frac{c \cdot b - a \cdot d}{d \cdot d}\\ \mathbf{else}:\\ \;\;\;\;\frac{-a}{d}\\ \end{array} \]
                5. Add Preprocessing

                Alternative 5: 66.5% accurate, 0.7× speedup?

                \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;c \leq -1.7 \cdot 10^{+132}:\\ \;\;\;\;\frac{b}{c}\\ \mathbf{elif}\;c \leq -2.5 \cdot 10^{-84}:\\ \;\;\;\;\frac{c}{\mathsf{fma}\left(d, d, c \cdot c\right)} \cdot b\\ \mathbf{elif}\;c \leq 7.6 \cdot 10^{-65}:\\ \;\;\;\;\frac{-a}{d}\\ \mathbf{elif}\;c \leq 9.8 \cdot 10^{+61}:\\ \;\;\;\;\frac{c \cdot b - a \cdot d}{c \cdot c}\\ \mathbf{else}:\\ \;\;\;\;\frac{b}{c}\\ \end{array} \end{array} \]
                (FPCore (a b c d)
                 :precision binary64
                 (if (<= c -1.7e+132)
                   (/ b c)
                   (if (<= c -2.5e-84)
                     (* (/ c (fma d d (* c c))) b)
                     (if (<= c 7.6e-65)
                       (/ (- a) d)
                       (if (<= c 9.8e+61) (/ (- (* c b) (* a d)) (* c c)) (/ b c))))))
                double code(double a, double b, double c, double d) {
                	double tmp;
                	if (c <= -1.7e+132) {
                		tmp = b / c;
                	} else if (c <= -2.5e-84) {
                		tmp = (c / fma(d, d, (c * c))) * b;
                	} else if (c <= 7.6e-65) {
                		tmp = -a / d;
                	} else if (c <= 9.8e+61) {
                		tmp = ((c * b) - (a * d)) / (c * c);
                	} else {
                		tmp = b / c;
                	}
                	return tmp;
                }
                
                function code(a, b, c, d)
                	tmp = 0.0
                	if (c <= -1.7e+132)
                		tmp = Float64(b / c);
                	elseif (c <= -2.5e-84)
                		tmp = Float64(Float64(c / fma(d, d, Float64(c * c))) * b);
                	elseif (c <= 7.6e-65)
                		tmp = Float64(Float64(-a) / d);
                	elseif (c <= 9.8e+61)
                		tmp = Float64(Float64(Float64(c * b) - Float64(a * d)) / Float64(c * c));
                	else
                		tmp = Float64(b / c);
                	end
                	return tmp
                end
                
                code[a_, b_, c_, d_] := If[LessEqual[c, -1.7e+132], N[(b / c), $MachinePrecision], If[LessEqual[c, -2.5e-84], N[(N[(c / N[(d * d + N[(c * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * b), $MachinePrecision], If[LessEqual[c, 7.6e-65], N[((-a) / d), $MachinePrecision], If[LessEqual[c, 9.8e+61], N[(N[(N[(c * b), $MachinePrecision] - N[(a * d), $MachinePrecision]), $MachinePrecision] / N[(c * c), $MachinePrecision]), $MachinePrecision], N[(b / c), $MachinePrecision]]]]]
                
                \begin{array}{l}
                
                \\
                \begin{array}{l}
                \mathbf{if}\;c \leq -1.7 \cdot 10^{+132}:\\
                \;\;\;\;\frac{b}{c}\\
                
                \mathbf{elif}\;c \leq -2.5 \cdot 10^{-84}:\\
                \;\;\;\;\frac{c}{\mathsf{fma}\left(d, d, c \cdot c\right)} \cdot b\\
                
                \mathbf{elif}\;c \leq 7.6 \cdot 10^{-65}:\\
                \;\;\;\;\frac{-a}{d}\\
                
                \mathbf{elif}\;c \leq 9.8 \cdot 10^{+61}:\\
                \;\;\;\;\frac{c \cdot b - a \cdot d}{c \cdot c}\\
                
                \mathbf{else}:\\
                \;\;\;\;\frac{b}{c}\\
                
                
                \end{array}
                \end{array}
                
                Derivation
                1. Split input into 4 regimes
                2. if c < -1.70000000000000013e132 or 9.8000000000000005e61 < c

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

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

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

                  if -1.70000000000000013e132 < c < -2.5000000000000001e-84

                  1. Initial program 79.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. frac-2negN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

                      \[\leadsto \mathsf{fma}\left(-b, c, a \cdot d\right) \cdot \frac{\color{blue}{-1}}{c \cdot c + d \cdot d} \]
                    16. lower-/.f6479.5

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

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

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

                      \[\leadsto \mathsf{fma}\left(-b, c, a \cdot d\right) \cdot \frac{-1}{\color{blue}{d \cdot d} + c \cdot c} \]
                    20. lower-fma.f6479.5

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

                    \[\leadsto \color{blue}{\mathsf{fma}\left(-b, c, a \cdot d\right) \cdot \frac{-1}{\mathsf{fma}\left(d, d, c \cdot c\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-*.f6454.7

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

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

                  if -2.5000000000000001e-84 < c < 7.6000000000000003e-65

                  1. Initial program 72.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}} \]
                  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.f6468.0

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

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

                  if 7.6000000000000003e-65 < c < 9.8000000000000005e61

                  1. Initial program 92.4%

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

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

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

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

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

                  \[\leadsto \begin{array}{l} \mathbf{if}\;c \leq -1.7 \cdot 10^{+132}:\\ \;\;\;\;\frac{b}{c}\\ \mathbf{elif}\;c \leq -2.5 \cdot 10^{-84}:\\ \;\;\;\;\frac{c}{\mathsf{fma}\left(d, d, c \cdot c\right)} \cdot b\\ \mathbf{elif}\;c \leq 7.6 \cdot 10^{-65}:\\ \;\;\;\;\frac{-a}{d}\\ \mathbf{elif}\;c \leq 9.8 \cdot 10^{+61}:\\ \;\;\;\;\frac{c \cdot b - a \cdot d}{c \cdot c}\\ \mathbf{else}:\\ \;\;\;\;\frac{b}{c}\\ \end{array} \]
                5. Add Preprocessing

                Alternative 6: 78.9% accurate, 0.8× speedup?

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

                  1. Initial program 44.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-*.f6470.5

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

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

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

                    if -4.4999999999999998e-7 < d < 1.4000000000000001e-13

                    1. Initial program 79.5%

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

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

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

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

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

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

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

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

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

                    if 1.4000000000000001e-13 < d

                    1. Initial program 54.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-*.f6478.4

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

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

                        \[\leadsto \frac{\mathsf{fma}\left(\frac{c}{d}, b, -a\right)}{d} \]
                      2. Step-by-step derivation
                        1. Applied rewrites81.6%

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

                        \[\leadsto \begin{array}{l} \mathbf{if}\;d \leq -4.5 \cdot 10^{-7}:\\ \;\;\;\;\frac{\mathsf{fma}\left(c, \frac{b}{d}, -a\right)}{d}\\ \mathbf{elif}\;d \leq 1.4 \cdot 10^{-13}:\\ \;\;\;\;\frac{b - \frac{a \cdot d}{c}}{c}\\ \mathbf{else}:\\ \;\;\;\;\frac{\mathsf{fma}\left(\frac{-1}{-d} \cdot c, b, -a\right)}{d}\\ \end{array} \]
                      5. Add Preprocessing

                      Alternative 7: 79.0% accurate, 0.9× speedup?

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

                        1. Initial program 49.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-*.f6474.6

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

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

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

                          if -4.4999999999999998e-7 < d < 1.4000000000000001e-13

                          1. Initial program 79.5%

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

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

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

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

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

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

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

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

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

                        Alternative 8: 75.9% accurate, 0.9× speedup?

                        \[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{b - \frac{a \cdot d}{c}}{c}\\ \mathbf{if}\;c \leq -4.6 \cdot 10^{-39}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;c \leq 2.3 \cdot 10^{-64}:\\ \;\;\;\;\frac{\frac{c \cdot b}{d} - a}{d}\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
                        (FPCore (a b c d)
                         :precision binary64
                         (let* ((t_0 (/ (- b (/ (* a d) c)) c)))
                           (if (<= c -4.6e-39) t_0 (if (<= c 2.3e-64) (/ (- (/ (* c b) d) a) d) t_0))))
                        double code(double a, double b, double c, double d) {
                        	double t_0 = (b - ((a * d) / c)) / c;
                        	double tmp;
                        	if (c <= -4.6e-39) {
                        		tmp = t_0;
                        	} else if (c <= 2.3e-64) {
                        		tmp = (((c * b) / d) - a) / d;
                        	} 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 = (b - ((a * d) / c)) / c
                            if (c <= (-4.6d-39)) then
                                tmp = t_0
                            else if (c <= 2.3d-64) then
                                tmp = (((c * b) / d) - a) / d
                            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 = (b - ((a * d) / c)) / c;
                        	double tmp;
                        	if (c <= -4.6e-39) {
                        		tmp = t_0;
                        	} else if (c <= 2.3e-64) {
                        		tmp = (((c * b) / d) - a) / d;
                        	} else {
                        		tmp = t_0;
                        	}
                        	return tmp;
                        }
                        
                        def code(a, b, c, d):
                        	t_0 = (b - ((a * d) / c)) / c
                        	tmp = 0
                        	if c <= -4.6e-39:
                        		tmp = t_0
                        	elif c <= 2.3e-64:
                        		tmp = (((c * b) / d) - a) / d
                        	else:
                        		tmp = t_0
                        	return tmp
                        
                        function code(a, b, c, d)
                        	t_0 = Float64(Float64(b - Float64(Float64(a * d) / c)) / c)
                        	tmp = 0.0
                        	if (c <= -4.6e-39)
                        		tmp = t_0;
                        	elseif (c <= 2.3e-64)
                        		tmp = Float64(Float64(Float64(Float64(c * b) / d) - a) / d);
                        	else
                        		tmp = t_0;
                        	end
                        	return tmp
                        end
                        
                        function tmp_2 = code(a, b, c, d)
                        	t_0 = (b - ((a * d) / c)) / c;
                        	tmp = 0.0;
                        	if (c <= -4.6e-39)
                        		tmp = t_0;
                        	elseif (c <= 2.3e-64)
                        		tmp = (((c * b) / d) - a) / d;
                        	else
                        		tmp = t_0;
                        	end
                        	tmp_2 = tmp;
                        end
                        
                        code[a_, b_, c_, d_] := Block[{t$95$0 = N[(N[(b - N[(N[(a * d), $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision]}, If[LessEqual[c, -4.6e-39], t$95$0, If[LessEqual[c, 2.3e-64], N[(N[(N[(N[(c * b), $MachinePrecision] / d), $MachinePrecision] - a), $MachinePrecision] / d), $MachinePrecision], t$95$0]]]
                        
                        \begin{array}{l}
                        
                        \\
                        \begin{array}{l}
                        t_0 := \frac{b - \frac{a \cdot d}{c}}{c}\\
                        \mathbf{if}\;c \leq -4.6 \cdot 10^{-39}:\\
                        \;\;\;\;t\_0\\
                        
                        \mathbf{elif}\;c \leq 2.3 \cdot 10^{-64}:\\
                        \;\;\;\;\frac{\frac{c \cdot b}{d} - a}{d}\\
                        
                        \mathbf{else}:\\
                        \;\;\;\;t\_0\\
                        
                        
                        \end{array}
                        \end{array}
                        
                        Derivation
                        1. Split input into 2 regimes
                        2. if c < -4.60000000000000016e-39 or 2.3000000000000001e-64 < c

                          1. Initial program 57.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 + -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-*.f6472.5

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

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

                          if -4.60000000000000016e-39 < c < 2.3000000000000001e-64

                          1. Initial program 74.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-*.f6485.8

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

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

                          \[\leadsto \begin{array}{l} \mathbf{if}\;c \leq -4.6 \cdot 10^{-39}:\\ \;\;\;\;\frac{b - \frac{a \cdot d}{c}}{c}\\ \mathbf{elif}\;c \leq 2.3 \cdot 10^{-64}:\\ \;\;\;\;\frac{\frac{c \cdot b}{d} - a}{d}\\ \mathbf{else}:\\ \;\;\;\;\frac{b - \frac{a \cdot d}{c}}{c}\\ \end{array} \]
                        5. Add Preprocessing

                        Alternative 9: 65.2% accurate, 0.9× speedup?

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

                          1. Initial program 42.4%

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

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

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

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

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

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

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

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

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

                          if -1.50000000000000008e109 < d < -8.6000000000000004e-106

                          1. Initial program 87.9%

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

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

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

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

                              \[\leadsto \color{blue}{\left(-1 \cdot a\right) \cdot \frac{d}{{c}^{2} + {d}^{2}}} \]
                            4. mul-1-negN/A

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

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

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

                              \[\leadsto \left(-a\right) \cdot \frac{d}{\color{blue}{{d}^{2} + {c}^{2}}} \]
                            8. unpow2N/A

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

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

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

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

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

                          if -8.6000000000000004e-106 < d < 1.9000000000000001e-15

                          1. Initial program 77.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-/.f6469.0

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

                            \[\leadsto \color{blue}{\frac{b}{c}} \]
                        3. Recombined 3 regimes into one program.
                        4. Final simplification67.2%

                          \[\leadsto \begin{array}{l} \mathbf{if}\;d \leq -1.5 \cdot 10^{+109}:\\ \;\;\;\;\frac{-a}{d}\\ \mathbf{elif}\;d \leq -8.6 \cdot 10^{-106}:\\ \;\;\;\;\frac{d}{\mathsf{fma}\left(d, d, c \cdot c\right)} \cdot \left(-a\right)\\ \mathbf{elif}\;d \leq 1.9 \cdot 10^{-15}:\\ \;\;\;\;\frac{b}{c}\\ \mathbf{else}:\\ \;\;\;\;\frac{-a}{d}\\ \end{array} \]
                        5. Add Preprocessing

                        Alternative 10: 65.4% accurate, 0.9× speedup?

                        \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;c \leq -1.7 \cdot 10^{+132}:\\ \;\;\;\;\frac{b}{c}\\ \mathbf{elif}\;c \leq -2.5 \cdot 10^{-84}:\\ \;\;\;\;\frac{c}{\mathsf{fma}\left(d, d, c \cdot c\right)} \cdot b\\ \mathbf{elif}\;c \leq 2.9 \cdot 10^{-54}:\\ \;\;\;\;\frac{-a}{d}\\ \mathbf{else}:\\ \;\;\;\;\frac{b}{c}\\ \end{array} \end{array} \]
                        (FPCore (a b c d)
                         :precision binary64
                         (if (<= c -1.7e+132)
                           (/ b c)
                           (if (<= c -2.5e-84)
                             (* (/ c (fma d d (* c c))) b)
                             (if (<= c 2.9e-54) (/ (- a) d) (/ b c)))))
                        double code(double a, double b, double c, double d) {
                        	double tmp;
                        	if (c <= -1.7e+132) {
                        		tmp = b / c;
                        	} else if (c <= -2.5e-84) {
                        		tmp = (c / fma(d, d, (c * c))) * b;
                        	} else if (c <= 2.9e-54) {
                        		tmp = -a / d;
                        	} else {
                        		tmp = b / c;
                        	}
                        	return tmp;
                        }
                        
                        function code(a, b, c, d)
                        	tmp = 0.0
                        	if (c <= -1.7e+132)
                        		tmp = Float64(b / c);
                        	elseif (c <= -2.5e-84)
                        		tmp = Float64(Float64(c / fma(d, d, Float64(c * c))) * b);
                        	elseif (c <= 2.9e-54)
                        		tmp = Float64(Float64(-a) / d);
                        	else
                        		tmp = Float64(b / c);
                        	end
                        	return tmp
                        end
                        
                        code[a_, b_, c_, d_] := If[LessEqual[c, -1.7e+132], N[(b / c), $MachinePrecision], If[LessEqual[c, -2.5e-84], N[(N[(c / N[(d * d + N[(c * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * b), $MachinePrecision], If[LessEqual[c, 2.9e-54], N[((-a) / d), $MachinePrecision], N[(b / c), $MachinePrecision]]]]
                        
                        \begin{array}{l}
                        
                        \\
                        \begin{array}{l}
                        \mathbf{if}\;c \leq -1.7 \cdot 10^{+132}:\\
                        \;\;\;\;\frac{b}{c}\\
                        
                        \mathbf{elif}\;c \leq -2.5 \cdot 10^{-84}:\\
                        \;\;\;\;\frac{c}{\mathsf{fma}\left(d, d, c \cdot c\right)} \cdot b\\
                        
                        \mathbf{elif}\;c \leq 2.9 \cdot 10^{-54}:\\
                        \;\;\;\;\frac{-a}{d}\\
                        
                        \mathbf{else}:\\
                        \;\;\;\;\frac{b}{c}\\
                        
                        
                        \end{array}
                        \end{array}
                        
                        Derivation
                        1. Split input into 3 regimes
                        2. if c < -1.70000000000000013e132 or 2.90000000000000015e-54 < c

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

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

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

                          if -1.70000000000000013e132 < c < -2.5000000000000001e-84

                          1. Initial program 79.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. frac-2negN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

                              \[\leadsto \mathsf{fma}\left(-b, c, a \cdot d\right) \cdot \frac{\color{blue}{-1}}{c \cdot c + d \cdot d} \]
                            16. lower-/.f6479.5

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

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

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

                              \[\leadsto \mathsf{fma}\left(-b, c, a \cdot d\right) \cdot \frac{-1}{\color{blue}{d \cdot d} + c \cdot c} \]
                            20. lower-fma.f6479.5

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

                            \[\leadsto \color{blue}{\mathsf{fma}\left(-b, c, a \cdot d\right) \cdot \frac{-1}{\mathsf{fma}\left(d, d, c \cdot c\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-*.f6454.7

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

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

                          if -2.5000000000000001e-84 < c < 2.90000000000000015e-54

                          1. Initial program 71.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.f6467.7

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

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

                          \[\leadsto \begin{array}{l} \mathbf{if}\;c \leq -1.7 \cdot 10^{+132}:\\ \;\;\;\;\frac{b}{c}\\ \mathbf{elif}\;c \leq -2.5 \cdot 10^{-84}:\\ \;\;\;\;\frac{c}{\mathsf{fma}\left(d, d, c \cdot c\right)} \cdot b\\ \mathbf{elif}\;c \leq 2.9 \cdot 10^{-54}:\\ \;\;\;\;\frac{-a}{d}\\ \mathbf{else}:\\ \;\;\;\;\frac{b}{c}\\ \end{array} \]
                        5. Add Preprocessing

                        Alternative 11: 62.5% accurate, 1.5× speedup?

                        \[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{-a}{d}\\ \mathbf{if}\;d \leq -9 \cdot 10^{-106}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;d \leq 1.9 \cdot 10^{-15}:\\ \;\;\;\;\frac{b}{c}\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
                        (FPCore (a b c d)
                         :precision binary64
                         (let* ((t_0 (/ (- a) d)))
                           (if (<= d -9e-106) t_0 (if (<= d 1.9e-15) (/ b c) t_0))))
                        double code(double a, double b, double c, double d) {
                        	double t_0 = -a / d;
                        	double tmp;
                        	if (d <= -9e-106) {
                        		tmp = t_0;
                        	} else if (d <= 1.9e-15) {
                        		tmp = b / 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 <= (-9d-106)) then
                                tmp = t_0
                            else if (d <= 1.9d-15) then
                                tmp = b / 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 <= -9e-106) {
                        		tmp = t_0;
                        	} else if (d <= 1.9e-15) {
                        		tmp = b / c;
                        	} else {
                        		tmp = t_0;
                        	}
                        	return tmp;
                        }
                        
                        def code(a, b, c, d):
                        	t_0 = -a / d
                        	tmp = 0
                        	if d <= -9e-106:
                        		tmp = t_0
                        	elif d <= 1.9e-15:
                        		tmp = b / c
                        	else:
                        		tmp = t_0
                        	return tmp
                        
                        function code(a, b, c, d)
                        	t_0 = Float64(Float64(-a) / d)
                        	tmp = 0.0
                        	if (d <= -9e-106)
                        		tmp = t_0;
                        	elseif (d <= 1.9e-15)
                        		tmp = Float64(b / 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 <= -9e-106)
                        		tmp = t_0;
                        	elseif (d <= 1.9e-15)
                        		tmp = b / 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, -9e-106], t$95$0, If[LessEqual[d, 1.9e-15], N[(b / c), $MachinePrecision], t$95$0]]]
                        
                        \begin{array}{l}
                        
                        \\
                        \begin{array}{l}
                        t_0 := \frac{-a}{d}\\
                        \mathbf{if}\;d \leq -9 \cdot 10^{-106}:\\
                        \;\;\;\;t\_0\\
                        
                        \mathbf{elif}\;d \leq 1.9 \cdot 10^{-15}:\\
                        \;\;\;\;\frac{b}{c}\\
                        
                        \mathbf{else}:\\
                        \;\;\;\;t\_0\\
                        
                        
                        \end{array}
                        \end{array}
                        
                        Derivation
                        1. Split input into 2 regimes
                        2. if d < -8.99999999999999911e-106 or 1.9000000000000001e-15 < d

                          1. Initial program 55.6%

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

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

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

                          if -8.99999999999999911e-106 < d < 1.9000000000000001e-15

                          1. Initial program 77.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-/.f6469.0

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

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

                          \[\leadsto \begin{array}{l} \mathbf{if}\;d \leq -9 \cdot 10^{-106}:\\ \;\;\;\;\frac{-a}{d}\\ \mathbf{elif}\;d \leq 1.9 \cdot 10^{-15}:\\ \;\;\;\;\frac{b}{c}\\ \mathbf{else}:\\ \;\;\;\;\frac{-a}{d}\\ \end{array} \]
                        5. Add Preprocessing

                        Alternative 12: 43.3% 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 65.5%

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

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

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

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

                        Developer Target 1: 99.4% 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 2024331 
                        (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))))