Complex division, imag part

Percentage Accurate: 61.4% → 83.2%
Time: 8.1s
Alternatives: 16
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 16 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.4% accurate, 1.0× speedup?

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

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

Alternative 1: 83.2% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \mathsf{fma}\left(d, d, c \cdot c\right)\\ t_1 := \mathsf{fma}\left(\frac{c}{t\_0}, b, \frac{a}{t\_0} \cdot \left(-d\right)\right)\\ \mathbf{if}\;c \leq -3.1 \cdot 10^{+125}:\\ \;\;\;\;\frac{b - \frac{a}{c} \cdot d}{c}\\ \mathbf{elif}\;c \leq -1.1 \cdot 10^{+108}:\\ \;\;\;\;\frac{\mathsf{fma}\left(\frac{c}{d}, b, \frac{a}{d} \cdot \frac{c \cdot c}{d}\right) - a}{d}\\ \mathbf{elif}\;c \leq -1.05 \cdot 10^{-104}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;c \leq 1.85 \cdot 10^{-148}:\\ \;\;\;\;\frac{\frac{b \cdot c}{d} - a}{d}\\ \mathbf{elif}\;c \leq 4.4 \cdot 10^{+91}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\frac{-a}{c}, \frac{d}{c}, \frac{b}{c}\right)\\ \end{array} \end{array} \]
(FPCore (a b c d)
 :precision binary64
 (let* ((t_0 (fma d d (* c c))) (t_1 (fma (/ c t_0) b (* (/ a t_0) (- d)))))
   (if (<= c -3.1e+125)
     (/ (- b (* (/ a c) d)) c)
     (if (<= c -1.1e+108)
       (/ (- (fma (/ c d) b (* (/ a d) (/ (* c c) d))) a) d)
       (if (<= c -1.05e-104)
         t_1
         (if (<= c 1.85e-148)
           (/ (- (/ (* b c) d) a) d)
           (if (<= c 4.4e+91) t_1 (fma (/ (- a) c) (/ d c) (/ b c)))))))))
double code(double a, double b, double c, double d) {
	double t_0 = fma(d, d, (c * c));
	double t_1 = fma((c / t_0), b, ((a / t_0) * -d));
	double tmp;
	if (c <= -3.1e+125) {
		tmp = (b - ((a / c) * d)) / c;
	} else if (c <= -1.1e+108) {
		tmp = (fma((c / d), b, ((a / d) * ((c * c) / d))) - a) / d;
	} else if (c <= -1.05e-104) {
		tmp = t_1;
	} else if (c <= 1.85e-148) {
		tmp = (((b * c) / d) - a) / d;
	} else if (c <= 4.4e+91) {
		tmp = t_1;
	} else {
		tmp = fma((-a / c), (d / c), (b / c));
	}
	return tmp;
}
function code(a, b, c, d)
	t_0 = fma(d, d, Float64(c * c))
	t_1 = fma(Float64(c / t_0), b, Float64(Float64(a / t_0) * Float64(-d)))
	tmp = 0.0
	if (c <= -3.1e+125)
		tmp = Float64(Float64(b - Float64(Float64(a / c) * d)) / c);
	elseif (c <= -1.1e+108)
		tmp = Float64(Float64(fma(Float64(c / d), b, Float64(Float64(a / d) * Float64(Float64(c * c) / d))) - a) / d);
	elseif (c <= -1.05e-104)
		tmp = t_1;
	elseif (c <= 1.85e-148)
		tmp = Float64(Float64(Float64(Float64(b * c) / d) - a) / d);
	elseif (c <= 4.4e+91)
		tmp = t_1;
	else
		tmp = fma(Float64(Float64(-a) / c), Float64(d / c), Float64(b / c));
	end
	return tmp
end
code[a_, b_, c_, d_] := Block[{t$95$0 = N[(d * d + N[(c * c), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(c / t$95$0), $MachinePrecision] * b + N[(N[(a / t$95$0), $MachinePrecision] * (-d)), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c, -3.1e+125], N[(N[(b - N[(N[(a / c), $MachinePrecision] * d), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision], If[LessEqual[c, -1.1e+108], N[(N[(N[(N[(c / d), $MachinePrecision] * b + N[(N[(a / d), $MachinePrecision] * N[(N[(c * c), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - a), $MachinePrecision] / d), $MachinePrecision], If[LessEqual[c, -1.05e-104], t$95$1, If[LessEqual[c, 1.85e-148], N[(N[(N[(N[(b * c), $MachinePrecision] / d), $MachinePrecision] - a), $MachinePrecision] / d), $MachinePrecision], If[LessEqual[c, 4.4e+91], t$95$1, N[(N[((-a) / c), $MachinePrecision] * N[(d / c), $MachinePrecision] + N[(b / c), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}

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

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

\mathbf{elif}\;c \leq -1.05 \cdot 10^{-104}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;c \leq 4.4 \cdot 10^{+91}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if c < -3.1e125

    1. Initial program 47.0%

      \[\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-/.f6447.0

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

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

      \[\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 d around 0

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

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

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

        \[\leadsto \frac{\left(-1 \cdot a\right) \cdot d}{\color{blue}{c \cdot c}} + \frac{b}{c} \]
      4. times-fracN/A

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{b + -1 \cdot \frac{a \cdot d}{c}}{c}} \]
    9. 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. *-commutativeN/A

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

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

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

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

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

    if -3.1e125 < c < -1.1000000000000001e108

    1. Initial program 12.9%

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{\frac{\left(b \cdot c\right) \cdot \left(c \cdot c + d \cdot d\right) - \left(c \cdot c + d \cdot d\right) \cdot \left(a \cdot d\right)}{c \cdot c + d \cdot d}}{c \cdot c + d \cdot d}} \]
    4. Applied rewrites0.3%

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

      \[\leadsto \color{blue}{-1 \cdot \frac{a + -1 \cdot \frac{-1 \cdot \frac{a \cdot {c}^{2} - 2 \cdot \left(a \cdot {c}^{2}\right)}{d} + b \cdot c}{d}}{d}} \]
    6. Applied rewrites87.4%

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

    if -1.1000000000000001e108 < c < -1.04999999999999999e-104 or 1.85000000000000017e-148 < c < 4.39999999999999999e91

    1. Initial program 77.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.04999999999999999e-104 < c < 1.85000000000000017e-148

    1. Initial program 66.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 4.39999999999999999e91 < c

    1. Initial program 37.1%

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

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

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

      \[\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 d around 0

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

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

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

        \[\leadsto \frac{\left(-1 \cdot a\right) \cdot d}{\color{blue}{c \cdot c}} + \frac{b}{c} \]
      4. times-fracN/A

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\frac{-a}{c}, \color{blue}{\frac{d}{c}}, \frac{b}{c}\right) \]
      10. lower-/.f6491.0

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;c \leq -3.1 \cdot 10^{+125}:\\ \;\;\;\;\frac{b - \frac{a}{c} \cdot d}{c}\\ \mathbf{elif}\;c \leq -1.1 \cdot 10^{+108}:\\ \;\;\;\;\frac{\mathsf{fma}\left(\frac{c}{d}, b, \frac{a}{d} \cdot \frac{c \cdot c}{d}\right) - a}{d}\\ \mathbf{elif}\;c \leq -1.05 \cdot 10^{-104}:\\ \;\;\;\;\mathsf{fma}\left(\frac{c}{\mathsf{fma}\left(d, d, c \cdot c\right)}, b, \frac{a}{\mathsf{fma}\left(d, d, c \cdot c\right)} \cdot \left(-d\right)\right)\\ \mathbf{elif}\;c \leq 1.85 \cdot 10^{-148}:\\ \;\;\;\;\frac{\frac{b \cdot c}{d} - a}{d}\\ \mathbf{elif}\;c \leq 4.4 \cdot 10^{+91}:\\ \;\;\;\;\mathsf{fma}\left(\frac{c}{\mathsf{fma}\left(d, d, c \cdot c\right)}, b, \frac{a}{\mathsf{fma}\left(d, d, c \cdot c\right)} \cdot \left(-d\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\frac{-a}{c}, \frac{d}{c}, \frac{b}{c}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 2: 83.2% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \mathsf{fma}\left(d, d, c \cdot c\right)\\ t_1 := \mathsf{fma}\left(\frac{c}{t\_0}, b, \frac{a}{t\_0} \cdot \left(-d\right)\right)\\ \mathbf{if}\;c \leq -3.1 \cdot 10^{+125}:\\ \;\;\;\;\frac{b - \frac{a}{c} \cdot d}{c}\\ \mathbf{elif}\;c \leq -1.1 \cdot 10^{+108}:\\ \;\;\;\;\frac{\mathsf{fma}\left(\frac{b}{d}, c, -a\right)}{d}\\ \mathbf{elif}\;c \leq -1.05 \cdot 10^{-104}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;c \leq 1.85 \cdot 10^{-148}:\\ \;\;\;\;\frac{\frac{b \cdot c}{d} - a}{d}\\ \mathbf{elif}\;c \leq 4.4 \cdot 10^{+91}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\frac{-a}{c}, \frac{d}{c}, \frac{b}{c}\right)\\ \end{array} \end{array} \]
(FPCore (a b c d)
 :precision binary64
 (let* ((t_0 (fma d d (* c c))) (t_1 (fma (/ c t_0) b (* (/ a t_0) (- d)))))
   (if (<= c -3.1e+125)
     (/ (- b (* (/ a c) d)) c)
     (if (<= c -1.1e+108)
       (/ (fma (/ b d) c (- a)) d)
       (if (<= c -1.05e-104)
         t_1
         (if (<= c 1.85e-148)
           (/ (- (/ (* b c) d) a) d)
           (if (<= c 4.4e+91) t_1 (fma (/ (- a) c) (/ d c) (/ b c)))))))))
double code(double a, double b, double c, double d) {
	double t_0 = fma(d, d, (c * c));
	double t_1 = fma((c / t_0), b, ((a / t_0) * -d));
	double tmp;
	if (c <= -3.1e+125) {
		tmp = (b - ((a / c) * d)) / c;
	} else if (c <= -1.1e+108) {
		tmp = fma((b / d), c, -a) / d;
	} else if (c <= -1.05e-104) {
		tmp = t_1;
	} else if (c <= 1.85e-148) {
		tmp = (((b * c) / d) - a) / d;
	} else if (c <= 4.4e+91) {
		tmp = t_1;
	} else {
		tmp = fma((-a / c), (d / c), (b / c));
	}
	return tmp;
}
function code(a, b, c, d)
	t_0 = fma(d, d, Float64(c * c))
	t_1 = fma(Float64(c / t_0), b, Float64(Float64(a / t_0) * Float64(-d)))
	tmp = 0.0
	if (c <= -3.1e+125)
		tmp = Float64(Float64(b - Float64(Float64(a / c) * d)) / c);
	elseif (c <= -1.1e+108)
		tmp = Float64(fma(Float64(b / d), c, Float64(-a)) / d);
	elseif (c <= -1.05e-104)
		tmp = t_1;
	elseif (c <= 1.85e-148)
		tmp = Float64(Float64(Float64(Float64(b * c) / d) - a) / d);
	elseif (c <= 4.4e+91)
		tmp = t_1;
	else
		tmp = fma(Float64(Float64(-a) / c), Float64(d / c), Float64(b / c));
	end
	return tmp
end
code[a_, b_, c_, d_] := Block[{t$95$0 = N[(d * d + N[(c * c), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(c / t$95$0), $MachinePrecision] * b + N[(N[(a / t$95$0), $MachinePrecision] * (-d)), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c, -3.1e+125], N[(N[(b - N[(N[(a / c), $MachinePrecision] * d), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision], If[LessEqual[c, -1.1e+108], N[(N[(N[(b / d), $MachinePrecision] * c + (-a)), $MachinePrecision] / d), $MachinePrecision], If[LessEqual[c, -1.05e-104], t$95$1, If[LessEqual[c, 1.85e-148], N[(N[(N[(N[(b * c), $MachinePrecision] / d), $MachinePrecision] - a), $MachinePrecision] / d), $MachinePrecision], If[LessEqual[c, 4.4e+91], t$95$1, N[(N[((-a) / c), $MachinePrecision] * N[(d / c), $MachinePrecision] + N[(b / c), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}

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

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

\mathbf{elif}\;c \leq -1.05 \cdot 10^{-104}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;c \leq 4.4 \cdot 10^{+91}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if c < -3.1e125

    1. Initial program 47.0%

      \[\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-/.f6447.0

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

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

      \[\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 d around 0

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

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

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

        \[\leadsto \frac{\left(-1 \cdot a\right) \cdot d}{\color{blue}{c \cdot c}} + \frac{b}{c} \]
      4. times-fracN/A

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{b + -1 \cdot \frac{a \cdot d}{c}}{c}} \]
    9. 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. *-commutativeN/A

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

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

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

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

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

    if -3.1e125 < c < -1.1000000000000001e108

    1. Initial program 12.9%

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

        \[\leadsto \color{blue}{\frac{b \cdot c - a \cdot d}{c \cdot c + d \cdot d}} \]
      2. 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-/.f6413.0

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

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

      \[\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 d around 0

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

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

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

        \[\leadsto \frac{\left(-1 \cdot a\right) \cdot d}{\color{blue}{c \cdot c}} + \frac{b}{c} \]
      4. times-fracN/A

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\frac{-a}{c}, \color{blue}{\frac{d}{c}}, \frac{b}{c}\right) \]
      10. lower-/.f6417.0

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

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

      \[\leadsto \color{blue}{-1 \cdot \frac{a}{d} + \frac{b \cdot c}{{d}^{2}}} \]
    9. 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. sub-negN/A

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

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

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

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

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

        \[\leadsto \frac{\mathsf{fma}\left(\frac{b}{d}, c, \color{blue}{\mathsf{neg}\left(a\right)}\right)}{d} \]
      14. lower-neg.f6487.4

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

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

    if -1.1000000000000001e108 < c < -1.04999999999999999e-104 or 1.85000000000000017e-148 < c < 4.39999999999999999e91

    1. Initial program 77.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.04999999999999999e-104 < c < 1.85000000000000017e-148

    1. Initial program 66.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 4.39999999999999999e91 < c

    1. Initial program 37.1%

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

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

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

      \[\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 d around 0

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

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

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

        \[\leadsto \frac{\left(-1 \cdot a\right) \cdot d}{\color{blue}{c \cdot c}} + \frac{b}{c} \]
      4. times-fracN/A

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\frac{-a}{c}, \color{blue}{\frac{d}{c}}, \frac{b}{c}\right) \]
      10. lower-/.f6491.0

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;c \leq -3.1 \cdot 10^{+125}:\\ \;\;\;\;\frac{b - \frac{a}{c} \cdot d}{c}\\ \mathbf{elif}\;c \leq -1.1 \cdot 10^{+108}:\\ \;\;\;\;\frac{\mathsf{fma}\left(\frac{b}{d}, c, -a\right)}{d}\\ \mathbf{elif}\;c \leq -1.05 \cdot 10^{-104}:\\ \;\;\;\;\mathsf{fma}\left(\frac{c}{\mathsf{fma}\left(d, d, c \cdot c\right)}, b, \frac{a}{\mathsf{fma}\left(d, d, c \cdot c\right)} \cdot \left(-d\right)\right)\\ \mathbf{elif}\;c \leq 1.85 \cdot 10^{-148}:\\ \;\;\;\;\frac{\frac{b \cdot c}{d} - a}{d}\\ \mathbf{elif}\;c \leq 4.4 \cdot 10^{+91}:\\ \;\;\;\;\mathsf{fma}\left(\frac{c}{\mathsf{fma}\left(d, d, c \cdot c\right)}, b, \frac{a}{\mathsf{fma}\left(d, d, c \cdot c\right)} \cdot \left(-d\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\frac{-a}{c}, \frac{d}{c}, \frac{b}{c}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 82.1% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;c \leq -3.1 \cdot 10^{+125}:\\ \;\;\;\;\frac{b - \frac{a}{c} \cdot d}{c}\\ \mathbf{elif}\;c \leq -1.1 \cdot 10^{+108}:\\ \;\;\;\;\frac{\mathsf{fma}\left(\frac{b}{d}, c, -a\right)}{d}\\ \mathbf{elif}\;c \leq -6.5 \cdot 10^{-80}:\\ \;\;\;\;\frac{-1}{\mathsf{fma}\left(d, d, c \cdot c\right)} \cdot \mathsf{fma}\left(-b, c, d \cdot a\right)\\ \mathbf{elif}\;c \leq 1.35 \cdot 10^{-71}:\\ \;\;\;\;\frac{\frac{b \cdot c}{d} - a}{d}\\ \mathbf{elif}\;c \leq 2.5 \cdot 10^{+85}:\\ \;\;\;\;\frac{b \cdot c - d \cdot a}{d \cdot d + c \cdot c}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\frac{-a}{c}, \frac{d}{c}, \frac{b}{c}\right)\\ \end{array} \end{array} \]
(FPCore (a b c d)
 :precision binary64
 (if (<= c -3.1e+125)
   (/ (- b (* (/ a c) d)) c)
   (if (<= c -1.1e+108)
     (/ (fma (/ b d) c (- a)) d)
     (if (<= c -6.5e-80)
       (* (/ -1.0 (fma d d (* c c))) (fma (- b) c (* d a)))
       (if (<= c 1.35e-71)
         (/ (- (/ (* b c) d) a) d)
         (if (<= c 2.5e+85)
           (/ (- (* b c) (* d a)) (+ (* d d) (* c c)))
           (fma (/ (- a) c) (/ d c) (/ b c))))))))
double code(double a, double b, double c, double d) {
	double tmp;
	if (c <= -3.1e+125) {
		tmp = (b - ((a / c) * d)) / c;
	} else if (c <= -1.1e+108) {
		tmp = fma((b / d), c, -a) / d;
	} else if (c <= -6.5e-80) {
		tmp = (-1.0 / fma(d, d, (c * c))) * fma(-b, c, (d * a));
	} else if (c <= 1.35e-71) {
		tmp = (((b * c) / d) - a) / d;
	} else if (c <= 2.5e+85) {
		tmp = ((b * c) - (d * a)) / ((d * d) + (c * c));
	} else {
		tmp = fma((-a / c), (d / c), (b / c));
	}
	return tmp;
}
function code(a, b, c, d)
	tmp = 0.0
	if (c <= -3.1e+125)
		tmp = Float64(Float64(b - Float64(Float64(a / c) * d)) / c);
	elseif (c <= -1.1e+108)
		tmp = Float64(fma(Float64(b / d), c, Float64(-a)) / d);
	elseif (c <= -6.5e-80)
		tmp = Float64(Float64(-1.0 / fma(d, d, Float64(c * c))) * fma(Float64(-b), c, Float64(d * a)));
	elseif (c <= 1.35e-71)
		tmp = Float64(Float64(Float64(Float64(b * c) / d) - a) / d);
	elseif (c <= 2.5e+85)
		tmp = Float64(Float64(Float64(b * c) - Float64(d * a)) / Float64(Float64(d * d) + Float64(c * c)));
	else
		tmp = fma(Float64(Float64(-a) / c), Float64(d / c), Float64(b / c));
	end
	return tmp
end
code[a_, b_, c_, d_] := If[LessEqual[c, -3.1e+125], N[(N[(b - N[(N[(a / c), $MachinePrecision] * d), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision], If[LessEqual[c, -1.1e+108], N[(N[(N[(b / d), $MachinePrecision] * c + (-a)), $MachinePrecision] / d), $MachinePrecision], If[LessEqual[c, -6.5e-80], N[(N[(-1.0 / N[(d * d + N[(c * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[((-b) * c + N[(d * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 1.35e-71], N[(N[(N[(N[(b * c), $MachinePrecision] / d), $MachinePrecision] - a), $MachinePrecision] / d), $MachinePrecision], If[LessEqual[c, 2.5e+85], N[(N[(N[(b * c), $MachinePrecision] - N[(d * a), $MachinePrecision]), $MachinePrecision] / N[(N[(d * d), $MachinePrecision] + N[(c * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[((-a) / c), $MachinePrecision] * N[(d / c), $MachinePrecision] + N[(b / c), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;c \leq -3.1 \cdot 10^{+125}:\\
\;\;\;\;\frac{b - \frac{a}{c} \cdot d}{c}\\

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

\mathbf{elif}\;c \leq -6.5 \cdot 10^{-80}:\\
\;\;\;\;\frac{-1}{\mathsf{fma}\left(d, d, c \cdot c\right)} \cdot \mathsf{fma}\left(-b, c, d \cdot a\right)\\

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 6 regimes
  2. if c < -3.1e125

    1. Initial program 47.0%

      \[\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-/.f6447.0

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

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

      \[\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 d around 0

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

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

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

        \[\leadsto \frac{\left(-1 \cdot a\right) \cdot d}{\color{blue}{c \cdot c}} + \frac{b}{c} \]
      4. times-fracN/A

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{b + -1 \cdot \frac{a \cdot d}{c}}{c}} \]
    9. 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. *-commutativeN/A

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

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

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

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

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

    if -3.1e125 < c < -1.1000000000000001e108

    1. Initial program 12.9%

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

        \[\leadsto \color{blue}{\frac{b \cdot c - a \cdot d}{c \cdot c + d \cdot d}} \]
      2. 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-/.f6413.0

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

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

      \[\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 d around 0

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

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

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

        \[\leadsto \frac{\left(-1 \cdot a\right) \cdot d}{\color{blue}{c \cdot c}} + \frac{b}{c} \]
      4. times-fracN/A

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\frac{-a}{c}, \color{blue}{\frac{d}{c}}, \frac{b}{c}\right) \]
      10. lower-/.f6417.0

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

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

      \[\leadsto \color{blue}{-1 \cdot \frac{a}{d} + \frac{b \cdot c}{{d}^{2}}} \]
    9. 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. sub-negN/A

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

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

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

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

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

        \[\leadsto \frac{\mathsf{fma}\left(\frac{b}{d}, c, \color{blue}{\mathsf{neg}\left(a\right)}\right)}{d} \]
      14. lower-neg.f6487.4

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

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

    if -1.1000000000000001e108 < c < -6.49999999999999984e-80

    1. Initial program 75.0%

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

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

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

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

    if -6.49999999999999984e-80 < c < 1.3500000000000001e-71

    1. Initial program 66.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.3500000000000001e-71 < c < 2.5e85

    1. Initial program 84.8%

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

    if 2.5e85 < c

    1. Initial program 36.4%

      \[\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-/.f6436.4

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

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

      \[\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 d around 0

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

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

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

        \[\leadsto \frac{\left(-1 \cdot a\right) \cdot d}{\color{blue}{c \cdot c}} + \frac{b}{c} \]
      4. times-fracN/A

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\frac{-a}{c}, \color{blue}{\frac{d}{c}}, \frac{b}{c}\right) \]
      10. lower-/.f6489.0

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;c \leq -3.1 \cdot 10^{+125}:\\ \;\;\;\;\frac{b - \frac{a}{c} \cdot d}{c}\\ \mathbf{elif}\;c \leq -1.1 \cdot 10^{+108}:\\ \;\;\;\;\frac{\mathsf{fma}\left(\frac{b}{d}, c, -a\right)}{d}\\ \mathbf{elif}\;c \leq -6.5 \cdot 10^{-80}:\\ \;\;\;\;\frac{-1}{\mathsf{fma}\left(d, d, c \cdot c\right)} \cdot \mathsf{fma}\left(-b, c, d \cdot a\right)\\ \mathbf{elif}\;c \leq 1.35 \cdot 10^{-71}:\\ \;\;\;\;\frac{\frac{b \cdot c}{d} - a}{d}\\ \mathbf{elif}\;c \leq 2.5 \cdot 10^{+85}:\\ \;\;\;\;\frac{b \cdot c - d \cdot a}{d \cdot d + c \cdot c}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\frac{-a}{c}, \frac{d}{c}, \frac{b}{c}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 81.2% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;c \leq -3.1 \cdot 10^{+125}:\\ \;\;\;\;\frac{b - \frac{a}{c} \cdot d}{c}\\ \mathbf{elif}\;c \leq -1.1 \cdot 10^{+108}:\\ \;\;\;\;\frac{\mathsf{fma}\left(\frac{b}{d}, c, -a\right)}{d}\\ \mathbf{elif}\;c \leq -6.5 \cdot 10^{-80}:\\ \;\;\;\;\frac{-1}{\mathsf{fma}\left(d, d, c \cdot c\right)} \cdot \mathsf{fma}\left(-b, c, d \cdot a\right)\\ \mathbf{elif}\;c \leq 1.35 \cdot 10^{-71}:\\ \;\;\;\;\frac{\frac{b \cdot c}{d} - a}{d}\\ \mathbf{elif}\;c \leq 2.5 \cdot 10^{+85}:\\ \;\;\;\;\frac{b \cdot c - d \cdot a}{d \cdot d + c \cdot c}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(-a, \frac{\frac{d}{c}}{c}, \frac{b}{c}\right)\\ \end{array} \end{array} \]
(FPCore (a b c d)
 :precision binary64
 (if (<= c -3.1e+125)
   (/ (- b (* (/ a c) d)) c)
   (if (<= c -1.1e+108)
     (/ (fma (/ b d) c (- a)) d)
     (if (<= c -6.5e-80)
       (* (/ -1.0 (fma d d (* c c))) (fma (- b) c (* d a)))
       (if (<= c 1.35e-71)
         (/ (- (/ (* b c) d) a) d)
         (if (<= c 2.5e+85)
           (/ (- (* b c) (* d a)) (+ (* d d) (* c c)))
           (fma (- a) (/ (/ d c) c) (/ b c))))))))
double code(double a, double b, double c, double d) {
	double tmp;
	if (c <= -3.1e+125) {
		tmp = (b - ((a / c) * d)) / c;
	} else if (c <= -1.1e+108) {
		tmp = fma((b / d), c, -a) / d;
	} else if (c <= -6.5e-80) {
		tmp = (-1.0 / fma(d, d, (c * c))) * fma(-b, c, (d * a));
	} else if (c <= 1.35e-71) {
		tmp = (((b * c) / d) - a) / d;
	} else if (c <= 2.5e+85) {
		tmp = ((b * c) - (d * a)) / ((d * d) + (c * c));
	} else {
		tmp = fma(-a, ((d / c) / c), (b / c));
	}
	return tmp;
}
function code(a, b, c, d)
	tmp = 0.0
	if (c <= -3.1e+125)
		tmp = Float64(Float64(b - Float64(Float64(a / c) * d)) / c);
	elseif (c <= -1.1e+108)
		tmp = Float64(fma(Float64(b / d), c, Float64(-a)) / d);
	elseif (c <= -6.5e-80)
		tmp = Float64(Float64(-1.0 / fma(d, d, Float64(c * c))) * fma(Float64(-b), c, Float64(d * a)));
	elseif (c <= 1.35e-71)
		tmp = Float64(Float64(Float64(Float64(b * c) / d) - a) / d);
	elseif (c <= 2.5e+85)
		tmp = Float64(Float64(Float64(b * c) - Float64(d * a)) / Float64(Float64(d * d) + Float64(c * c)));
	else
		tmp = fma(Float64(-a), Float64(Float64(d / c) / c), Float64(b / c));
	end
	return tmp
end
code[a_, b_, c_, d_] := If[LessEqual[c, -3.1e+125], N[(N[(b - N[(N[(a / c), $MachinePrecision] * d), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision], If[LessEqual[c, -1.1e+108], N[(N[(N[(b / d), $MachinePrecision] * c + (-a)), $MachinePrecision] / d), $MachinePrecision], If[LessEqual[c, -6.5e-80], N[(N[(-1.0 / N[(d * d + N[(c * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[((-b) * c + N[(d * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 1.35e-71], N[(N[(N[(N[(b * c), $MachinePrecision] / d), $MachinePrecision] - a), $MachinePrecision] / d), $MachinePrecision], If[LessEqual[c, 2.5e+85], N[(N[(N[(b * c), $MachinePrecision] - N[(d * a), $MachinePrecision]), $MachinePrecision] / N[(N[(d * d), $MachinePrecision] + N[(c * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[((-a) * N[(N[(d / c), $MachinePrecision] / c), $MachinePrecision] + N[(b / c), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;c \leq -3.1 \cdot 10^{+125}:\\
\;\;\;\;\frac{b - \frac{a}{c} \cdot d}{c}\\

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

\mathbf{elif}\;c \leq -6.5 \cdot 10^{-80}:\\
\;\;\;\;\frac{-1}{\mathsf{fma}\left(d, d, c \cdot c\right)} \cdot \mathsf{fma}\left(-b, c, d \cdot a\right)\\

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 6 regimes
  2. if c < -3.1e125

    1. Initial program 47.0%

      \[\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-/.f6447.0

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

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

      \[\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 d around 0

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

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

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

        \[\leadsto \frac{\left(-1 \cdot a\right) \cdot d}{\color{blue}{c \cdot c}} + \frac{b}{c} \]
      4. times-fracN/A

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{b + -1 \cdot \frac{a \cdot d}{c}}{c}} \]
    9. 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. *-commutativeN/A

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

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

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

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

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

    if -3.1e125 < c < -1.1000000000000001e108

    1. Initial program 12.9%

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

        \[\leadsto \color{blue}{\frac{b \cdot c - a \cdot d}{c \cdot c + d \cdot d}} \]
      2. 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-/.f6413.0

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

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

      \[\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 d around 0

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

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

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

        \[\leadsto \frac{\left(-1 \cdot a\right) \cdot d}{\color{blue}{c \cdot c}} + \frac{b}{c} \]
      4. times-fracN/A

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\frac{-a}{c}, \color{blue}{\frac{d}{c}}, \frac{b}{c}\right) \]
      10. lower-/.f6417.0

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

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

      \[\leadsto \color{blue}{-1 \cdot \frac{a}{d} + \frac{b \cdot c}{{d}^{2}}} \]
    9. 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. sub-negN/A

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

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

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

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

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

        \[\leadsto \frac{\mathsf{fma}\left(\frac{b}{d}, c, \color{blue}{\mathsf{neg}\left(a\right)}\right)}{d} \]
      14. lower-neg.f6487.4

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

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

    if -1.1000000000000001e108 < c < -6.49999999999999984e-80

    1. Initial program 75.0%

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

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

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

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

    if -6.49999999999999984e-80 < c < 1.3500000000000001e-71

    1. Initial program 66.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.3500000000000001e-71 < c < 2.5e85

    1. Initial program 84.8%

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

    if 2.5e85 < c

    1. Initial program 36.4%

      \[\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-/.f6436.4

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

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

      \[\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 d around 0

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

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

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

        \[\leadsto \frac{\left(-1 \cdot a\right) \cdot d}{\color{blue}{c \cdot c}} + \frac{b}{c} \]
      4. times-fracN/A

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\frac{-a}{c}, \color{blue}{\frac{d}{c}}, \frac{b}{c}\right) \]
      10. lower-/.f6489.0

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

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

        \[\leadsto \mathsf{fma}\left(-a, \color{blue}{\frac{\frac{d}{c}}{c}}, \frac{b}{c}\right) \]
    9. Recombined 6 regimes into one program.
    10. Final simplification87.6%

      \[\leadsto \begin{array}{l} \mathbf{if}\;c \leq -3.1 \cdot 10^{+125}:\\ \;\;\;\;\frac{b - \frac{a}{c} \cdot d}{c}\\ \mathbf{elif}\;c \leq -1.1 \cdot 10^{+108}:\\ \;\;\;\;\frac{\mathsf{fma}\left(\frac{b}{d}, c, -a\right)}{d}\\ \mathbf{elif}\;c \leq -6.5 \cdot 10^{-80}:\\ \;\;\;\;\frac{-1}{\mathsf{fma}\left(d, d, c \cdot c\right)} \cdot \mathsf{fma}\left(-b, c, d \cdot a\right)\\ \mathbf{elif}\;c \leq 1.35 \cdot 10^{-71}:\\ \;\;\;\;\frac{\frac{b \cdot c}{d} - a}{d}\\ \mathbf{elif}\;c \leq 2.5 \cdot 10^{+85}:\\ \;\;\;\;\frac{b \cdot c - d \cdot a}{d \cdot d + c \cdot c}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(-a, \frac{\frac{d}{c}}{c}, \frac{b}{c}\right)\\ \end{array} \]
    11. Add Preprocessing

    Alternative 5: 82.2% accurate, 0.6× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{b - \frac{a}{c} \cdot d}{c}\\ \mathbf{if}\;c \leq -3.1 \cdot 10^{+125}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;c \leq -1.1 \cdot 10^{+108}:\\ \;\;\;\;\frac{\mathsf{fma}\left(\frac{b}{d}, c, -a\right)}{d}\\ \mathbf{elif}\;c \leq -6.5 \cdot 10^{-80}:\\ \;\;\;\;\frac{-1}{\mathsf{fma}\left(d, d, c \cdot c\right)} \cdot \mathsf{fma}\left(-b, c, d \cdot a\right)\\ \mathbf{elif}\;c \leq 1.35 \cdot 10^{-71}:\\ \;\;\;\;\frac{\frac{b \cdot c}{d} - a}{d}\\ \mathbf{elif}\;c \leq 2.5 \cdot 10^{+85}:\\ \;\;\;\;\frac{b \cdot c - d \cdot a}{d \cdot d + c \cdot c}\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
    (FPCore (a b c d)
     :precision binary64
     (let* ((t_0 (/ (- b (* (/ a c) d)) c)))
       (if (<= c -3.1e+125)
         t_0
         (if (<= c -1.1e+108)
           (/ (fma (/ b d) c (- a)) d)
           (if (<= c -6.5e-80)
             (* (/ -1.0 (fma d d (* c c))) (fma (- b) c (* d a)))
             (if (<= c 1.35e-71)
               (/ (- (/ (* b c) d) a) d)
               (if (<= c 2.5e+85)
                 (/ (- (* b c) (* d a)) (+ (* d d) (* c c)))
                 t_0)))))))
    double code(double a, double b, double c, double d) {
    	double t_0 = (b - ((a / c) * d)) / c;
    	double tmp;
    	if (c <= -3.1e+125) {
    		tmp = t_0;
    	} else if (c <= -1.1e+108) {
    		tmp = fma((b / d), c, -a) / d;
    	} else if (c <= -6.5e-80) {
    		tmp = (-1.0 / fma(d, d, (c * c))) * fma(-b, c, (d * a));
    	} else if (c <= 1.35e-71) {
    		tmp = (((b * c) / d) - a) / d;
    	} else if (c <= 2.5e+85) {
    		tmp = ((b * c) - (d * a)) / ((d * d) + (c * c));
    	} else {
    		tmp = t_0;
    	}
    	return tmp;
    }
    
    function code(a, b, c, d)
    	t_0 = Float64(Float64(b - Float64(Float64(a / c) * d)) / c)
    	tmp = 0.0
    	if (c <= -3.1e+125)
    		tmp = t_0;
    	elseif (c <= -1.1e+108)
    		tmp = Float64(fma(Float64(b / d), c, Float64(-a)) / d);
    	elseif (c <= -6.5e-80)
    		tmp = Float64(Float64(-1.0 / fma(d, d, Float64(c * c))) * fma(Float64(-b), c, Float64(d * a)));
    	elseif (c <= 1.35e-71)
    		tmp = Float64(Float64(Float64(Float64(b * c) / d) - a) / d);
    	elseif (c <= 2.5e+85)
    		tmp = Float64(Float64(Float64(b * c) - Float64(d * a)) / Float64(Float64(d * d) + Float64(c * c)));
    	else
    		tmp = t_0;
    	end
    	return tmp
    end
    
    code[a_, b_, c_, d_] := Block[{t$95$0 = N[(N[(b - N[(N[(a / c), $MachinePrecision] * d), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision]}, If[LessEqual[c, -3.1e+125], t$95$0, If[LessEqual[c, -1.1e+108], N[(N[(N[(b / d), $MachinePrecision] * c + (-a)), $MachinePrecision] / d), $MachinePrecision], If[LessEqual[c, -6.5e-80], N[(N[(-1.0 / N[(d * d + N[(c * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[((-b) * c + N[(d * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 1.35e-71], N[(N[(N[(N[(b * c), $MachinePrecision] / d), $MachinePrecision] - a), $MachinePrecision] / d), $MachinePrecision], If[LessEqual[c, 2.5e+85], N[(N[(N[(b * c), $MachinePrecision] - N[(d * a), $MachinePrecision]), $MachinePrecision] / N[(N[(d * d), $MachinePrecision] + N[(c * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_0 := \frac{b - \frac{a}{c} \cdot d}{c}\\
    \mathbf{if}\;c \leq -3.1 \cdot 10^{+125}:\\
    \;\;\;\;t\_0\\
    
    \mathbf{elif}\;c \leq -1.1 \cdot 10^{+108}:\\
    \;\;\;\;\frac{\mathsf{fma}\left(\frac{b}{d}, c, -a\right)}{d}\\
    
    \mathbf{elif}\;c \leq -6.5 \cdot 10^{-80}:\\
    \;\;\;\;\frac{-1}{\mathsf{fma}\left(d, d, c \cdot c\right)} \cdot \mathsf{fma}\left(-b, c, d \cdot a\right)\\
    
    \mathbf{elif}\;c \leq 1.35 \cdot 10^{-71}:\\
    \;\;\;\;\frac{\frac{b \cdot c}{d} - a}{d}\\
    
    \mathbf{elif}\;c \leq 2.5 \cdot 10^{+85}:\\
    \;\;\;\;\frac{b \cdot c - d \cdot a}{d \cdot d + c \cdot c}\\
    
    \mathbf{else}:\\
    \;\;\;\;t\_0\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 5 regimes
    2. if c < -3.1e125 or 2.5e85 < c

      1. Initial program 41.4%

        \[\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-/.f6441.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.f6441.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 rewrites41.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 d around 0

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

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

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

          \[\leadsto \frac{\left(-1 \cdot a\right) \cdot d}{\color{blue}{c \cdot c}} + \frac{b}{c} \]
        4. times-fracN/A

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{b + -1 \cdot \frac{a \cdot d}{c}}{c}} \]
      9. 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. *-commutativeN/A

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

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

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

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

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

      if -3.1e125 < c < -1.1000000000000001e108

      1. Initial program 12.9%

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

          \[\leadsto \color{blue}{\frac{b \cdot c - a \cdot d}{c \cdot c + d \cdot d}} \]
        2. 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-/.f6413.0

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

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

        \[\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 d around 0

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

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

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

          \[\leadsto \frac{\left(-1 \cdot a\right) \cdot d}{\color{blue}{c \cdot c}} + \frac{b}{c} \]
        4. times-fracN/A

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

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

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

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

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

          \[\leadsto \mathsf{fma}\left(\frac{-a}{c}, \color{blue}{\frac{d}{c}}, \frac{b}{c}\right) \]
        10. lower-/.f6417.0

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

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

        \[\leadsto \color{blue}{-1 \cdot \frac{a}{d} + \frac{b \cdot c}{{d}^{2}}} \]
      9. 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. sub-negN/A

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

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

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

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

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

          \[\leadsto \frac{\mathsf{fma}\left(\frac{b}{d}, c, \color{blue}{\mathsf{neg}\left(a\right)}\right)}{d} \]
        14. lower-neg.f6487.4

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

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

      if -1.1000000000000001e108 < c < -6.49999999999999984e-80

      1. Initial program 75.0%

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

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

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

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

      if -6.49999999999999984e-80 < c < 1.3500000000000001e-71

      1. Initial program 66.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

      if 1.3500000000000001e-71 < c < 2.5e85

      1. Initial program 84.8%

        \[\frac{b \cdot c - a \cdot d}{c \cdot c + d \cdot d} \]
      2. Add Preprocessing
    3. Recombined 5 regimes into one program.
    4. Final simplification87.6%

      \[\leadsto \begin{array}{l} \mathbf{if}\;c \leq -3.1 \cdot 10^{+125}:\\ \;\;\;\;\frac{b - \frac{a}{c} \cdot d}{c}\\ \mathbf{elif}\;c \leq -1.1 \cdot 10^{+108}:\\ \;\;\;\;\frac{\mathsf{fma}\left(\frac{b}{d}, c, -a\right)}{d}\\ \mathbf{elif}\;c \leq -6.5 \cdot 10^{-80}:\\ \;\;\;\;\frac{-1}{\mathsf{fma}\left(d, d, c \cdot c\right)} \cdot \mathsf{fma}\left(-b, c, d \cdot a\right)\\ \mathbf{elif}\;c \leq 1.35 \cdot 10^{-71}:\\ \;\;\;\;\frac{\frac{b \cdot c}{d} - a}{d}\\ \mathbf{elif}\;c \leq 2.5 \cdot 10^{+85}:\\ \;\;\;\;\frac{b \cdot c - d \cdot a}{d \cdot d + c \cdot c}\\ \mathbf{else}:\\ \;\;\;\;\frac{b - \frac{a}{c} \cdot d}{c}\\ \end{array} \]
    5. Add Preprocessing

    Alternative 6: 82.2% accurate, 0.6× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{b - \frac{a}{c} \cdot d}{c}\\ t_1 := \frac{b \cdot c - d \cdot a}{d \cdot d + c \cdot c}\\ \mathbf{if}\;c \leq -3.1 \cdot 10^{+125}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;c \leq -1.1 \cdot 10^{+108}:\\ \;\;\;\;\frac{\mathsf{fma}\left(\frac{b}{d}, c, -a\right)}{d}\\ \mathbf{elif}\;c \leq -6.5 \cdot 10^{-80}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;c \leq 1.35 \cdot 10^{-71}:\\ \;\;\;\;\frac{\frac{b \cdot c}{d} - a}{d}\\ \mathbf{elif}\;c \leq 2.5 \cdot 10^{+85}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
    (FPCore (a b c d)
     :precision binary64
     (let* ((t_0 (/ (- b (* (/ a c) d)) c))
            (t_1 (/ (- (* b c) (* d a)) (+ (* d d) (* c c)))))
       (if (<= c -3.1e+125)
         t_0
         (if (<= c -1.1e+108)
           (/ (fma (/ b d) c (- a)) d)
           (if (<= c -6.5e-80)
             t_1
             (if (<= c 1.35e-71)
               (/ (- (/ (* b c) d) a) d)
               (if (<= c 2.5e+85) t_1 t_0)))))))
    double code(double a, double b, double c, double d) {
    	double t_0 = (b - ((a / c) * d)) / c;
    	double t_1 = ((b * c) - (d * a)) / ((d * d) + (c * c));
    	double tmp;
    	if (c <= -3.1e+125) {
    		tmp = t_0;
    	} else if (c <= -1.1e+108) {
    		tmp = fma((b / d), c, -a) / d;
    	} else if (c <= -6.5e-80) {
    		tmp = t_1;
    	} else if (c <= 1.35e-71) {
    		tmp = (((b * c) / d) - a) / d;
    	} else if (c <= 2.5e+85) {
    		tmp = t_1;
    	} else {
    		tmp = t_0;
    	}
    	return tmp;
    }
    
    function code(a, b, c, d)
    	t_0 = Float64(Float64(b - Float64(Float64(a / c) * d)) / c)
    	t_1 = Float64(Float64(Float64(b * c) - Float64(d * a)) / Float64(Float64(d * d) + Float64(c * c)))
    	tmp = 0.0
    	if (c <= -3.1e+125)
    		tmp = t_0;
    	elseif (c <= -1.1e+108)
    		tmp = Float64(fma(Float64(b / d), c, Float64(-a)) / d);
    	elseif (c <= -6.5e-80)
    		tmp = t_1;
    	elseif (c <= 1.35e-71)
    		tmp = Float64(Float64(Float64(Float64(b * c) / d) - a) / d);
    	elseif (c <= 2.5e+85)
    		tmp = t_1;
    	else
    		tmp = t_0;
    	end
    	return tmp
    end
    
    code[a_, b_, c_, d_] := Block[{t$95$0 = N[(N[(b - N[(N[(a / c), $MachinePrecision] * d), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[(b * c), $MachinePrecision] - N[(d * a), $MachinePrecision]), $MachinePrecision] / N[(N[(d * d), $MachinePrecision] + N[(c * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c, -3.1e+125], t$95$0, If[LessEqual[c, -1.1e+108], N[(N[(N[(b / d), $MachinePrecision] * c + (-a)), $MachinePrecision] / d), $MachinePrecision], If[LessEqual[c, -6.5e-80], t$95$1, If[LessEqual[c, 1.35e-71], N[(N[(N[(N[(b * c), $MachinePrecision] / d), $MachinePrecision] - a), $MachinePrecision] / d), $MachinePrecision], If[LessEqual[c, 2.5e+85], t$95$1, t$95$0]]]]]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_0 := \frac{b - \frac{a}{c} \cdot d}{c}\\
    t_1 := \frac{b \cdot c - d \cdot a}{d \cdot d + c \cdot c}\\
    \mathbf{if}\;c \leq -3.1 \cdot 10^{+125}:\\
    \;\;\;\;t\_0\\
    
    \mathbf{elif}\;c \leq -1.1 \cdot 10^{+108}:\\
    \;\;\;\;\frac{\mathsf{fma}\left(\frac{b}{d}, c, -a\right)}{d}\\
    
    \mathbf{elif}\;c \leq -6.5 \cdot 10^{-80}:\\
    \;\;\;\;t\_1\\
    
    \mathbf{elif}\;c \leq 1.35 \cdot 10^{-71}:\\
    \;\;\;\;\frac{\frac{b \cdot c}{d} - a}{d}\\
    
    \mathbf{elif}\;c \leq 2.5 \cdot 10^{+85}:\\
    \;\;\;\;t\_1\\
    
    \mathbf{else}:\\
    \;\;\;\;t\_0\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 4 regimes
    2. if c < -3.1e125 or 2.5e85 < c

      1. Initial program 41.4%

        \[\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-/.f6441.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.f6441.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 rewrites41.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 d around 0

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

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

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

          \[\leadsto \frac{\left(-1 \cdot a\right) \cdot d}{\color{blue}{c \cdot c}} + \frac{b}{c} \]
        4. times-fracN/A

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{b + -1 \cdot \frac{a \cdot d}{c}}{c}} \]
      9. 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. *-commutativeN/A

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

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

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

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

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

      if -3.1e125 < c < -1.1000000000000001e108

      1. Initial program 12.9%

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

          \[\leadsto \color{blue}{\frac{b \cdot c - a \cdot d}{c \cdot c + d \cdot d}} \]
        2. 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-/.f6413.0

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

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

        \[\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 d around 0

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

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

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

          \[\leadsto \frac{\left(-1 \cdot a\right) \cdot d}{\color{blue}{c \cdot c}} + \frac{b}{c} \]
        4. times-fracN/A

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

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

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

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

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

          \[\leadsto \mathsf{fma}\left(\frac{-a}{c}, \color{blue}{\frac{d}{c}}, \frac{b}{c}\right) \]
        10. lower-/.f6417.0

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

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

        \[\leadsto \color{blue}{-1 \cdot \frac{a}{d} + \frac{b \cdot c}{{d}^{2}}} \]
      9. 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. sub-negN/A

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

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

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

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

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

          \[\leadsto \frac{\mathsf{fma}\left(\frac{b}{d}, c, \color{blue}{\mathsf{neg}\left(a\right)}\right)}{d} \]
        14. lower-neg.f6487.4

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

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

      if -1.1000000000000001e108 < c < -6.49999999999999984e-80 or 1.3500000000000001e-71 < c < 2.5e85

      1. Initial program 79.8%

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

      if -6.49999999999999984e-80 < c < 1.3500000000000001e-71

      1. Initial program 66.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \begin{array}{l} \mathbf{if}\;c \leq -3.1 \cdot 10^{+125}:\\ \;\;\;\;\frac{b - \frac{a}{c} \cdot d}{c}\\ \mathbf{elif}\;c \leq -1.1 \cdot 10^{+108}:\\ \;\;\;\;\frac{\mathsf{fma}\left(\frac{b}{d}, c, -a\right)}{d}\\ \mathbf{elif}\;c \leq -6.5 \cdot 10^{-80}:\\ \;\;\;\;\frac{b \cdot c - d \cdot a}{d \cdot d + c \cdot c}\\ \mathbf{elif}\;c \leq 1.35 \cdot 10^{-71}:\\ \;\;\;\;\frac{\frac{b \cdot c}{d} - a}{d}\\ \mathbf{elif}\;c \leq 2.5 \cdot 10^{+85}:\\ \;\;\;\;\frac{b \cdot c - d \cdot a}{d \cdot d + c \cdot c}\\ \mathbf{else}:\\ \;\;\;\;\frac{b - \frac{a}{c} \cdot d}{c}\\ \end{array} \]
    5. Add Preprocessing

    Alternative 7: 66.4% accurate, 0.7× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_0 := \mathsf{fma}\left(d, d, c \cdot c\right)\\ t_1 := \frac{-a}{d}\\ \mathbf{if}\;d \leq -8.5 \cdot 10^{+170}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;d \leq -1.2 \cdot 10^{-80}:\\ \;\;\;\;\frac{d}{t\_0} \cdot \left(-a\right)\\ \mathbf{elif}\;d \leq 1.52 \cdot 10^{-64}:\\ \;\;\;\;\frac{b}{c}\\ \mathbf{elif}\;d \leq 3.6 \cdot 10^{+73}:\\ \;\;\;\;\frac{\left(-a\right) \cdot d}{t\_0}\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
    (FPCore (a b c d)
     :precision binary64
     (let* ((t_0 (fma d d (* c c))) (t_1 (/ (- a) d)))
       (if (<= d -8.5e+170)
         t_1
         (if (<= d -1.2e-80)
           (* (/ d t_0) (- a))
           (if (<= d 1.52e-64)
             (/ b c)
             (if (<= d 3.6e+73) (/ (* (- a) d) t_0) t_1))))))
    double code(double a, double b, double c, double d) {
    	double t_0 = fma(d, d, (c * c));
    	double t_1 = -a / d;
    	double tmp;
    	if (d <= -8.5e+170) {
    		tmp = t_1;
    	} else if (d <= -1.2e-80) {
    		tmp = (d / t_0) * -a;
    	} else if (d <= 1.52e-64) {
    		tmp = b / c;
    	} else if (d <= 3.6e+73) {
    		tmp = (-a * d) / t_0;
    	} else {
    		tmp = t_1;
    	}
    	return tmp;
    }
    
    function code(a, b, c, d)
    	t_0 = fma(d, d, Float64(c * c))
    	t_1 = Float64(Float64(-a) / d)
    	tmp = 0.0
    	if (d <= -8.5e+170)
    		tmp = t_1;
    	elseif (d <= -1.2e-80)
    		tmp = Float64(Float64(d / t_0) * Float64(-a));
    	elseif (d <= 1.52e-64)
    		tmp = Float64(b / c);
    	elseif (d <= 3.6e+73)
    		tmp = Float64(Float64(Float64(-a) * d) / t_0);
    	else
    		tmp = t_1;
    	end
    	return tmp
    end
    
    code[a_, b_, c_, d_] := Block[{t$95$0 = N[(d * d + N[(c * c), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[((-a) / d), $MachinePrecision]}, If[LessEqual[d, -8.5e+170], t$95$1, If[LessEqual[d, -1.2e-80], N[(N[(d / t$95$0), $MachinePrecision] * (-a)), $MachinePrecision], If[LessEqual[d, 1.52e-64], N[(b / c), $MachinePrecision], If[LessEqual[d, 3.6e+73], N[(N[((-a) * d), $MachinePrecision] / t$95$0), $MachinePrecision], t$95$1]]]]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_0 := \mathsf{fma}\left(d, d, c \cdot c\right)\\
    t_1 := \frac{-a}{d}\\
    \mathbf{if}\;d \leq -8.5 \cdot 10^{+170}:\\
    \;\;\;\;t\_1\\
    
    \mathbf{elif}\;d \leq -1.2 \cdot 10^{-80}:\\
    \;\;\;\;\frac{d}{t\_0} \cdot \left(-a\right)\\
    
    \mathbf{elif}\;d \leq 1.52 \cdot 10^{-64}:\\
    \;\;\;\;\frac{b}{c}\\
    
    \mathbf{elif}\;d \leq 3.6 \cdot 10^{+73}:\\
    \;\;\;\;\frac{\left(-a\right) \cdot d}{t\_0}\\
    
    \mathbf{else}:\\
    \;\;\;\;t\_1\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 4 regimes
    2. if d < -8.5000000000000004e170 or 3.5999999999999999e73 < d

      1. Initial program 33.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.f6468.8

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

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

      if -8.5000000000000004e170 < d < -1.2e-80

      1. Initial program 65.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-*.f6459.9

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

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

      if -1.2e-80 < d < 1.5200000000000001e-64

      1. Initial program 75.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-/.f6478.6

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

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

      if 1.5200000000000001e-64 < d < 3.5999999999999999e73

      1. Initial program 85.0%

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

        \[\leadsto \frac{\color{blue}{-1 \cdot \left(a \cdot d\right)}}{c \cdot c + d \cdot d} \]
      4. Step-by-step derivation
        1. associate-*r*N/A

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

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

          \[\leadsto \frac{\color{blue}{\left(\mathsf{neg}\left(a\right)\right)} \cdot d}{c \cdot c + d \cdot d} \]
        4. lower-neg.f6463.9

          \[\leadsto \frac{\color{blue}{\left(-a\right)} \cdot d}{c \cdot c + d \cdot d} \]
      5. Applied rewrites63.9%

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

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

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

          \[\leadsto \frac{\left(-a\right) \cdot d}{\color{blue}{d \cdot d} + c \cdot c} \]
        4. lift-fma.f6463.9

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

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

      \[\leadsto \begin{array}{l} \mathbf{if}\;d \leq -8.5 \cdot 10^{+170}:\\ \;\;\;\;\frac{-a}{d}\\ \mathbf{elif}\;d \leq -1.2 \cdot 10^{-80}:\\ \;\;\;\;\frac{d}{\mathsf{fma}\left(d, d, c \cdot c\right)} \cdot \left(-a\right)\\ \mathbf{elif}\;d \leq 1.52 \cdot 10^{-64}:\\ \;\;\;\;\frac{b}{c}\\ \mathbf{elif}\;d \leq 3.6 \cdot 10^{+73}:\\ \;\;\;\;\frac{\left(-a\right) \cdot d}{\mathsf{fma}\left(d, d, c \cdot c\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{-a}{d}\\ \end{array} \]
    5. Add Preprocessing

    Alternative 8: 66.6% accurate, 0.7× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{-a}{d}\\ t_1 := \frac{d}{\mathsf{fma}\left(d, d, c \cdot c\right)} \cdot \left(-a\right)\\ \mathbf{if}\;d \leq -8.5 \cdot 10^{+170}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;d \leq -1.2 \cdot 10^{-80}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;d \leq 1.52 \cdot 10^{-64}:\\ \;\;\;\;\frac{b}{c}\\ \mathbf{elif}\;d \leq 3.8 \cdot 10^{+77}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
    (FPCore (a b c d)
     :precision binary64
     (let* ((t_0 (/ (- a) d)) (t_1 (* (/ d (fma d d (* c c))) (- a))))
       (if (<= d -8.5e+170)
         t_0
         (if (<= d -1.2e-80)
           t_1
           (if (<= d 1.52e-64) (/ b c) (if (<= d 3.8e+77) t_1 t_0))))))
    double code(double a, double b, double c, double d) {
    	double t_0 = -a / d;
    	double t_1 = (d / fma(d, d, (c * c))) * -a;
    	double tmp;
    	if (d <= -8.5e+170) {
    		tmp = t_0;
    	} else if (d <= -1.2e-80) {
    		tmp = t_1;
    	} else if (d <= 1.52e-64) {
    		tmp = b / c;
    	} else if (d <= 3.8e+77) {
    		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(d / fma(d, d, Float64(c * c))) * Float64(-a))
    	tmp = 0.0
    	if (d <= -8.5e+170)
    		tmp = t_0;
    	elseif (d <= -1.2e-80)
    		tmp = t_1;
    	elseif (d <= 1.52e-64)
    		tmp = Float64(b / c);
    	elseif (d <= 3.8e+77)
    		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[(d / N[(d * d + N[(c * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * (-a)), $MachinePrecision]}, If[LessEqual[d, -8.5e+170], t$95$0, If[LessEqual[d, -1.2e-80], t$95$1, If[LessEqual[d, 1.52e-64], N[(b / c), $MachinePrecision], If[LessEqual[d, 3.8e+77], t$95$1, t$95$0]]]]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_0 := \frac{-a}{d}\\
    t_1 := \frac{d}{\mathsf{fma}\left(d, d, c \cdot c\right)} \cdot \left(-a\right)\\
    \mathbf{if}\;d \leq -8.5 \cdot 10^{+170}:\\
    \;\;\;\;t\_0\\
    
    \mathbf{elif}\;d \leq -1.2 \cdot 10^{-80}:\\
    \;\;\;\;t\_1\\
    
    \mathbf{elif}\;d \leq 1.52 \cdot 10^{-64}:\\
    \;\;\;\;\frac{b}{c}\\
    
    \mathbf{elif}\;d \leq 3.8 \cdot 10^{+77}:\\
    \;\;\;\;t\_1\\
    
    \mathbf{else}:\\
    \;\;\;\;t\_0\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 3 regimes
    2. if d < -8.5000000000000004e170 or 3.8000000000000001e77 < d

      1. Initial program 34.7%

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

        \[\leadsto \color{blue}{-1 \cdot \frac{a}{d}} \]
      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.f6469.2

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

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

      if -8.5000000000000004e170 < d < -1.2e-80 or 1.5200000000000001e-64 < d < 3.8000000000000001e77

      1. Initial program 71.1%

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

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

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

      if -1.2e-80 < d < 1.5200000000000001e-64

      1. Initial program 75.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-/.f6478.6

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

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

      \[\leadsto \begin{array}{l} \mathbf{if}\;d \leq -8.5 \cdot 10^{+170}:\\ \;\;\;\;\frac{-a}{d}\\ \mathbf{elif}\;d \leq -1.2 \cdot 10^{-80}:\\ \;\;\;\;\frac{d}{\mathsf{fma}\left(d, d, c \cdot c\right)} \cdot \left(-a\right)\\ \mathbf{elif}\;d \leq 1.52 \cdot 10^{-64}:\\ \;\;\;\;\frac{b}{c}\\ \mathbf{elif}\;d \leq 3.8 \cdot 10^{+77}:\\ \;\;\;\;\frac{d}{\mathsf{fma}\left(d, d, c \cdot c\right)} \cdot \left(-a\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{-a}{d}\\ \end{array} \]
    5. Add Preprocessing

    Alternative 9: 64.3% accurate, 0.8× speedup?

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

      1. Initial program 45.1%

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

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

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

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

      if -1.1e46 < c < 1.74999999999999987e-70

      1. Initial program 69.0%

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

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

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

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

      if 1.74999999999999987e-70 < c < 4.00000000000000012e83

      1. Initial program 83.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 \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-*.f6468.6

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

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

      \[\leadsto \begin{array}{l} \mathbf{if}\;c \leq -1.1 \cdot 10^{+46}:\\ \;\;\;\;\frac{b}{c}\\ \mathbf{elif}\;c \leq 1.75 \cdot 10^{-70}:\\ \;\;\;\;\frac{-a}{d}\\ \mathbf{elif}\;c \leq 4 \cdot 10^{+83}:\\ \;\;\;\;\frac{b \cdot c - d \cdot a}{c \cdot c}\\ \mathbf{else}:\\ \;\;\;\;\frac{b}{c}\\ \end{array} \]
    5. Add Preprocessing

    Alternative 10: 65.0% accurate, 0.8× speedup?

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

      1. Initial program 43.5%

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

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

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

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

      if -1.1e46 < c < 1.11999999999999992e-68

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

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

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

      if 1.11999999999999992e-68 < c < 1.49999999999999988e86

      1. Initial program 84.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \begin{array}{l} \mathbf{if}\;c \leq -1.1 \cdot 10^{+46}:\\ \;\;\;\;\frac{b}{c}\\ \mathbf{elif}\;c \leq 1.12 \cdot 10^{-68}:\\ \;\;\;\;\frac{-a}{d}\\ \mathbf{elif}\;c \leq 1.5 \cdot 10^{+86}:\\ \;\;\;\;\frac{c}{\mathsf{fma}\left(d, d, c \cdot c\right)} \cdot b\\ \mathbf{else}:\\ \;\;\;\;\frac{b}{c}\\ \end{array} \]
    5. Add Preprocessing

    Alternative 11: 77.4% accurate, 0.9× speedup?

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

      1. Initial program 53.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-/.f6453.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.f6453.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 rewrites53.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 d around 0

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

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

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

          \[\leadsto \frac{\left(-1 \cdot a\right) \cdot d}{\color{blue}{c \cdot c}} + \frac{b}{c} \]
        4. times-fracN/A

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

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

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

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

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

          \[\leadsto \mathsf{fma}\left(\frac{-a}{c}, \color{blue}{\frac{d}{c}}, \frac{b}{c}\right) \]
        10. lower-/.f6481.0

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

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

        \[\leadsto \color{blue}{\frac{b + -1 \cdot \frac{a \cdot d}{c}}{c}} \]
      9. 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. *-commutativeN/A

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

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

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

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

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

      if -2.1999999999999999e40 < c < 7.8000000000000004e-53

      1. Initial program 70.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-*.f6484.3

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

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

      \[\leadsto \begin{array}{l} \mathbf{if}\;c \leq -2.2 \cdot 10^{+40}:\\ \;\;\;\;\frac{b - \frac{a}{c} \cdot d}{c}\\ \mathbf{elif}\;c \leq 7.8 \cdot 10^{-53}:\\ \;\;\;\;\frac{\frac{b \cdot c}{d} - a}{d}\\ \mathbf{else}:\\ \;\;\;\;\frac{b - \frac{a}{c} \cdot d}{c}\\ \end{array} \]
    5. Add Preprocessing

    Alternative 12: 76.5% accurate, 0.9× speedup?

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

      1. Initial program 53.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-/.f6453.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.f6453.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 rewrites53.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 d around 0

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

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

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

          \[\leadsto \frac{\left(-1 \cdot a\right) \cdot d}{\color{blue}{c \cdot c}} + \frac{b}{c} \]
        4. times-fracN/A

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

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

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

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

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

          \[\leadsto \mathsf{fma}\left(\frac{-a}{c}, \color{blue}{\frac{d}{c}}, \frac{b}{c}\right) \]
        10. lower-/.f6481.0

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

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

        \[\leadsto \color{blue}{\frac{b + -1 \cdot \frac{a \cdot d}{c}}{c}} \]
      9. 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. *-commutativeN/A

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

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

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

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

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

      if -2.1999999999999999e40 < c < 7.8000000000000004e-53

      1. Initial program 70.1%

        \[\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-/.f6470.0

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

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

        \[\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 d around 0

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

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

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

          \[\leadsto \frac{\left(-1 \cdot a\right) \cdot d}{\color{blue}{c \cdot c}} + \frac{b}{c} \]
        4. times-fracN/A

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

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

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

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

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

          \[\leadsto \mathsf{fma}\left(\frac{-a}{c}, \color{blue}{\frac{d}{c}}, \frac{b}{c}\right) \]
        10. lower-/.f6424.5

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

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

        \[\leadsto \color{blue}{-1 \cdot \frac{a}{d} + \frac{b \cdot c}{{d}^{2}}} \]
      9. 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. sub-negN/A

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

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

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

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

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

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

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

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

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

    Alternative 13: 72.1% accurate, 0.9× speedup?

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

      1. Initial program 38.7%

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

        \[\leadsto \color{blue}{-1 \cdot \frac{a}{d}} \]
      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.f6470.1

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

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

      if -4.3e52 < d < 1.85e84

      1. Initial program 74.9%

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

          \[\leadsto \color{blue}{\frac{b \cdot c - a \cdot d}{c \cdot c + d \cdot d}} \]
        2. 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-/.f6474.9

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

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

        \[\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 d around 0

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

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

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

          \[\leadsto \frac{\left(-1 \cdot a\right) \cdot d}{\color{blue}{c \cdot c}} + \frac{b}{c} \]
        4. times-fracN/A

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{b + -1 \cdot \frac{a \cdot d}{c}}{c}} \]
      9. 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. *-commutativeN/A

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

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

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

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

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

      \[\leadsto \begin{array}{l} \mathbf{if}\;d \leq -4.3 \cdot 10^{+52}:\\ \;\;\;\;\frac{-a}{d}\\ \mathbf{elif}\;d \leq 1.85 \cdot 10^{+84}:\\ \;\;\;\;\frac{b - \frac{a}{c} \cdot d}{c}\\ \mathbf{else}:\\ \;\;\;\;\frac{-a}{d}\\ \end{array} \]
    5. Add Preprocessing

    Alternative 14: 63.1% accurate, 1.1× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;d \leq -1.6 \cdot 10^{+51}:\\ \;\;\;\;\frac{-a}{d}\\ \mathbf{elif}\;d \leq 3.6 \cdot 10^{-63}:\\ \;\;\;\;\frac{b}{c}\\ \mathbf{else}:\\ \;\;\;\;\frac{-1}{\frac{d}{a}}\\ \end{array} \end{array} \]
    (FPCore (a b c d)
     :precision binary64
     (if (<= d -1.6e+51) (/ (- a) d) (if (<= d 3.6e-63) (/ b c) (/ -1.0 (/ d a)))))
    double code(double a, double b, double c, double d) {
    	double tmp;
    	if (d <= -1.6e+51) {
    		tmp = -a / d;
    	} else if (d <= 3.6e-63) {
    		tmp = b / c;
    	} else {
    		tmp = -1.0 / (d / a);
    	}
    	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 (d <= (-1.6d+51)) then
            tmp = -a / d
        else if (d <= 3.6d-63) then
            tmp = b / c
        else
            tmp = (-1.0d0) / (d / a)
        end if
        code = tmp
    end function
    
    public static double code(double a, double b, double c, double d) {
    	double tmp;
    	if (d <= -1.6e+51) {
    		tmp = -a / d;
    	} else if (d <= 3.6e-63) {
    		tmp = b / c;
    	} else {
    		tmp = -1.0 / (d / a);
    	}
    	return tmp;
    }
    
    def code(a, b, c, d):
    	tmp = 0
    	if d <= -1.6e+51:
    		tmp = -a / d
    	elif d <= 3.6e-63:
    		tmp = b / c
    	else:
    		tmp = -1.0 / (d / a)
    	return tmp
    
    function code(a, b, c, d)
    	tmp = 0.0
    	if (d <= -1.6e+51)
    		tmp = Float64(Float64(-a) / d);
    	elseif (d <= 3.6e-63)
    		tmp = Float64(b / c);
    	else
    		tmp = Float64(-1.0 / Float64(d / a));
    	end
    	return tmp
    end
    
    function tmp_2 = code(a, b, c, d)
    	tmp = 0.0;
    	if (d <= -1.6e+51)
    		tmp = -a / d;
    	elseif (d <= 3.6e-63)
    		tmp = b / c;
    	else
    		tmp = -1.0 / (d / a);
    	end
    	tmp_2 = tmp;
    end
    
    code[a_, b_, c_, d_] := If[LessEqual[d, -1.6e+51], N[((-a) / d), $MachinePrecision], If[LessEqual[d, 3.6e-63], N[(b / c), $MachinePrecision], N[(-1.0 / N[(d / a), $MachinePrecision]), $MachinePrecision]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    \mathbf{if}\;d \leq -1.6 \cdot 10^{+51}:\\
    \;\;\;\;\frac{-a}{d}\\
    
    \mathbf{elif}\;d \leq 3.6 \cdot 10^{-63}:\\
    \;\;\;\;\frac{b}{c}\\
    
    \mathbf{else}:\\
    \;\;\;\;\frac{-1}{\frac{d}{a}}\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 3 regimes
    2. if d < -1.6000000000000001e51

      1. Initial program 31.1%

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

        \[\leadsto \color{blue}{-1 \cdot \frac{a}{d}} \]
      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.f6470.7

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

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

      if -1.6000000000000001e51 < d < 3.60000000000000008e-63

      1. Initial program 74.1%

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

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

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

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

      if 3.60000000000000008e-63 < d

      1. Initial program 57.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.f6458.8

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

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

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

        \[\leadsto \begin{array}{l} \mathbf{if}\;d \leq -1.6 \cdot 10^{+51}:\\ \;\;\;\;\frac{-a}{d}\\ \mathbf{elif}\;d \leq 3.6 \cdot 10^{-63}:\\ \;\;\;\;\frac{b}{c}\\ \mathbf{else}:\\ \;\;\;\;\frac{-1}{\frac{d}{a}}\\ \end{array} \]
      9. Add Preprocessing

      Alternative 15: 63.2% accurate, 1.5× speedup?

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

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

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

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

        if -1.1e46 < c < 1.9500000000000001e-53

        1. Initial program 70.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}} \]
        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.4

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

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

        \[\leadsto \begin{array}{l} \mathbf{if}\;c \leq -1.1 \cdot 10^{+46}:\\ \;\;\;\;\frac{b}{c}\\ \mathbf{elif}\;c \leq 1.95 \cdot 10^{-53}:\\ \;\;\;\;\frac{-a}{d}\\ \mathbf{else}:\\ \;\;\;\;\frac{b}{c}\\ \end{array} \]
      5. Add Preprocessing

      Alternative 16: 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 61.1%

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

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

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

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