The quadratic formula (r1)

Percentage Accurate: 52.9% → 86.2%
Time: 15.1s
Alternatives: 8
Speedup: 19.1×

Specification

?
\[\begin{array}{l} \\ \frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a} \end{array} \]
(FPCore (a b c)
 :precision binary64
 (/ (+ (- b) (sqrt (- (* b b) (* (* 4.0 a) c)))) (* 2.0 a)))
double code(double a, double b, double c) {
	return (-b + sqrt(((b * b) - ((4.0 * a) * c)))) / (2.0 * a);
}
real(8) function code(a, b, c)
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    code = (-b + sqrt(((b * b) - ((4.0d0 * a) * c)))) / (2.0d0 * a)
end function
public static double code(double a, double b, double c) {
	return (-b + Math.sqrt(((b * b) - ((4.0 * a) * c)))) / (2.0 * a);
}
def code(a, b, c):
	return (-b + math.sqrt(((b * b) - ((4.0 * a) * c)))) / (2.0 * a)
function code(a, b, c)
	return Float64(Float64(Float64(-b) + sqrt(Float64(Float64(b * b) - Float64(Float64(4.0 * a) * c)))) / Float64(2.0 * a))
end
function tmp = code(a, b, c)
	tmp = (-b + sqrt(((b * b) - ((4.0 * a) * c)))) / (2.0 * a);
end
code[a_, b_, c_] := N[(N[((-b) + N[Sqrt[N[(N[(b * b), $MachinePrecision] - N[(N[(4.0 * a), $MachinePrecision] * c), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[(2.0 * a), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}
\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 8 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: 52.9% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a} \end{array} \]
(FPCore (a b c)
 :precision binary64
 (/ (+ (- b) (sqrt (- (* b b) (* (* 4.0 a) c)))) (* 2.0 a)))
double code(double a, double b, double c) {
	return (-b + sqrt(((b * b) - ((4.0 * a) * c)))) / (2.0 * a);
}
real(8) function code(a, b, c)
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    code = (-b + sqrt(((b * b) - ((4.0d0 * a) * c)))) / (2.0d0 * a)
end function
public static double code(double a, double b, double c) {
	return (-b + Math.sqrt(((b * b) - ((4.0 * a) * c)))) / (2.0 * a);
}
def code(a, b, c):
	return (-b + math.sqrt(((b * b) - ((4.0 * a) * c)))) / (2.0 * a)
function code(a, b, c)
	return Float64(Float64(Float64(-b) + sqrt(Float64(Float64(b * b) - Float64(Float64(4.0 * a) * c)))) / Float64(2.0 * a))
end
function tmp = code(a, b, c)
	tmp = (-b + sqrt(((b * b) - ((4.0 * a) * c)))) / (2.0 * a);
end
code[a_, b_, c_] := N[(N[((-b) + N[Sqrt[N[(N[(b * b), $MachinePrecision] - N[(N[(4.0 * a), $MachinePrecision] * c), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[(2.0 * a), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}
\end{array}

Alternative 1: 86.2% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq -2.8 \cdot 10^{+139}:\\ \;\;\;\;\frac{-b}{a}\\ \mathbf{elif}\;b \leq 1.2 \cdot 10^{-50}:\\ \;\;\;\;\frac{\sqrt{b \cdot b - \left(a \cdot 4\right) \cdot c} - b}{a \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\frac{a}{b} - \frac{b}{c}}\\ \end{array} \end{array} \]
(FPCore (a b c)
 :precision binary64
 (if (<= b -2.8e+139)
   (/ (- b) a)
   (if (<= b 1.2e-50)
     (/ (- (sqrt (- (* b b) (* (* a 4.0) c))) b) (* a 2.0))
     (/ 1.0 (- (/ a b) (/ b c))))))
double code(double a, double b, double c) {
	double tmp;
	if (b <= -2.8e+139) {
		tmp = -b / a;
	} else if (b <= 1.2e-50) {
		tmp = (sqrt(((b * b) - ((a * 4.0) * c))) - b) / (a * 2.0);
	} else {
		tmp = 1.0 / ((a / b) - (b / c));
	}
	return tmp;
}
real(8) function code(a, b, c)
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8) :: tmp
    if (b <= (-2.8d+139)) then
        tmp = -b / a
    else if (b <= 1.2d-50) then
        tmp = (sqrt(((b * b) - ((a * 4.0d0) * c))) - b) / (a * 2.0d0)
    else
        tmp = 1.0d0 / ((a / b) - (b / c))
    end if
    code = tmp
end function
public static double code(double a, double b, double c) {
	double tmp;
	if (b <= -2.8e+139) {
		tmp = -b / a;
	} else if (b <= 1.2e-50) {
		tmp = (Math.sqrt(((b * b) - ((a * 4.0) * c))) - b) / (a * 2.0);
	} else {
		tmp = 1.0 / ((a / b) - (b / c));
	}
	return tmp;
}
def code(a, b, c):
	tmp = 0
	if b <= -2.8e+139:
		tmp = -b / a
	elif b <= 1.2e-50:
		tmp = (math.sqrt(((b * b) - ((a * 4.0) * c))) - b) / (a * 2.0)
	else:
		tmp = 1.0 / ((a / b) - (b / c))
	return tmp
function code(a, b, c)
	tmp = 0.0
	if (b <= -2.8e+139)
		tmp = Float64(Float64(-b) / a);
	elseif (b <= 1.2e-50)
		tmp = Float64(Float64(sqrt(Float64(Float64(b * b) - Float64(Float64(a * 4.0) * c))) - b) / Float64(a * 2.0));
	else
		tmp = Float64(1.0 / Float64(Float64(a / b) - Float64(b / c)));
	end
	return tmp
end
function tmp_2 = code(a, b, c)
	tmp = 0.0;
	if (b <= -2.8e+139)
		tmp = -b / a;
	elseif (b <= 1.2e-50)
		tmp = (sqrt(((b * b) - ((a * 4.0) * c))) - b) / (a * 2.0);
	else
		tmp = 1.0 / ((a / b) - (b / c));
	end
	tmp_2 = tmp;
end
code[a_, b_, c_] := If[LessEqual[b, -2.8e+139], N[((-b) / a), $MachinePrecision], If[LessEqual[b, 1.2e-50], N[(N[(N[Sqrt[N[(N[(b * b), $MachinePrecision] - N[(N[(a * 4.0), $MachinePrecision] * c), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision] / N[(a * 2.0), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(N[(a / b), $MachinePrecision] - N[(b / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;b \leq -2.8 \cdot 10^{+139}:\\
\;\;\;\;\frac{-b}{a}\\

\mathbf{elif}\;b \leq 1.2 \cdot 10^{-50}:\\
\;\;\;\;\frac{\sqrt{b \cdot b - \left(a \cdot 4\right) \cdot c} - b}{a \cdot 2}\\

\mathbf{else}:\\
\;\;\;\;\frac{1}{\frac{a}{b} - \frac{b}{c}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if b < -2.7999999999999998e139

    1. Initial program 41.9%

      \[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a} \]
    2. Step-by-step derivation
      1. *-commutative41.9%

        \[\leadsto \frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{\color{blue}{a \cdot 2}} \]
    3. Simplified41.9%

      \[\leadsto \color{blue}{\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{a \cdot 2}} \]
    4. Add Preprocessing
    5. Taylor expanded in b around -inf 94.9%

      \[\leadsto \color{blue}{-1 \cdot \frac{b}{a}} \]
    6. Step-by-step derivation
      1. associate-*r/94.9%

        \[\leadsto \color{blue}{\frac{-1 \cdot b}{a}} \]
      2. mul-1-neg94.9%

        \[\leadsto \frac{\color{blue}{-b}}{a} \]
    7. Simplified94.9%

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

    if -2.7999999999999998e139 < b < 1.20000000000000001e-50

    1. Initial program 81.0%

      \[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a} \]
    2. Add Preprocessing

    if 1.20000000000000001e-50 < b

    1. Initial program 16.1%

      \[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a} \]
    2. Step-by-step derivation
      1. *-commutative16.1%

        \[\leadsto \frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{\color{blue}{a \cdot 2}} \]
    3. Simplified16.1%

      \[\leadsto \color{blue}{\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{a \cdot 2}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. prod-diff15.8%

        \[\leadsto \frac{\left(-b\right) + \sqrt{\color{blue}{\mathsf{fma}\left(b, b, -c \cdot \left(4 \cdot a\right)\right) + \mathsf{fma}\left(-c, 4 \cdot a, c \cdot \left(4 \cdot a\right)\right)}}}{a \cdot 2} \]
      2. *-commutative15.8%

        \[\leadsto \frac{\left(-b\right) + \sqrt{\mathsf{fma}\left(b, b, -\color{blue}{\left(4 \cdot a\right) \cdot c}\right) + \mathsf{fma}\left(-c, 4 \cdot a, c \cdot \left(4 \cdot a\right)\right)}}{a \cdot 2} \]
      3. fma-def15.8%

        \[\leadsto \frac{\left(-b\right) + \sqrt{\color{blue}{\left(b \cdot b + \left(-\left(4 \cdot a\right) \cdot c\right)\right)} + \mathsf{fma}\left(-c, 4 \cdot a, c \cdot \left(4 \cdot a\right)\right)}}{a \cdot 2} \]
      4. associate-+l+15.8%

        \[\leadsto \frac{\left(-b\right) + \sqrt{\color{blue}{b \cdot b + \left(\left(-\left(4 \cdot a\right) \cdot c\right) + \mathsf{fma}\left(-c, 4 \cdot a, c \cdot \left(4 \cdot a\right)\right)\right)}}}{a \cdot 2} \]
      5. pow215.8%

        \[\leadsto \frac{\left(-b\right) + \sqrt{\color{blue}{{b}^{2}} + \left(\left(-\left(4 \cdot a\right) \cdot c\right) + \mathsf{fma}\left(-c, 4 \cdot a, c \cdot \left(4 \cdot a\right)\right)\right)}}{a \cdot 2} \]
      6. distribute-lft-neg-in15.8%

        \[\leadsto \frac{\left(-b\right) + \sqrt{{b}^{2} + \left(\color{blue}{\left(-4 \cdot a\right) \cdot c} + \mathsf{fma}\left(-c, 4 \cdot a, c \cdot \left(4 \cdot a\right)\right)\right)}}{a \cdot 2} \]
      7. *-commutative15.8%

        \[\leadsto \frac{\left(-b\right) + \sqrt{{b}^{2} + \left(\left(-\color{blue}{a \cdot 4}\right) \cdot c + \mathsf{fma}\left(-c, 4 \cdot a, c \cdot \left(4 \cdot a\right)\right)\right)}}{a \cdot 2} \]
      8. distribute-rgt-neg-in15.8%

        \[\leadsto \frac{\left(-b\right) + \sqrt{{b}^{2} + \left(\color{blue}{\left(a \cdot \left(-4\right)\right)} \cdot c + \mathsf{fma}\left(-c, 4 \cdot a, c \cdot \left(4 \cdot a\right)\right)\right)}}{a \cdot 2} \]
      9. metadata-eval15.8%

        \[\leadsto \frac{\left(-b\right) + \sqrt{{b}^{2} + \left(\left(a \cdot \color{blue}{-4}\right) \cdot c + \mathsf{fma}\left(-c, 4 \cdot a, c \cdot \left(4 \cdot a\right)\right)\right)}}{a \cdot 2} \]
      10. associate-*r*15.8%

        \[\leadsto \frac{\left(-b\right) + \sqrt{{b}^{2} + \left(\color{blue}{a \cdot \left(-4 \cdot c\right)} + \mathsf{fma}\left(-c, 4 \cdot a, c \cdot \left(4 \cdot a\right)\right)\right)}}{a \cdot 2} \]
      11. *-commutative15.8%

        \[\leadsto \frac{\left(-b\right) + \sqrt{{b}^{2} + \left(a \cdot \color{blue}{\left(c \cdot -4\right)} + \mathsf{fma}\left(-c, 4 \cdot a, c \cdot \left(4 \cdot a\right)\right)\right)}}{a \cdot 2} \]
      12. *-commutative15.8%

        \[\leadsto \frac{\left(-b\right) + \sqrt{{b}^{2} + \left(a \cdot \left(c \cdot -4\right) + \mathsf{fma}\left(-c, 4 \cdot a, \color{blue}{\left(4 \cdot a\right) \cdot c}\right)\right)}}{a \cdot 2} \]
      13. fma-udef15.8%

        \[\leadsto \frac{\left(-b\right) + \sqrt{{b}^{2} + \left(a \cdot \left(c \cdot -4\right) + \color{blue}{\left(\left(-c\right) \cdot \left(4 \cdot a\right) + \left(4 \cdot a\right) \cdot c\right)}\right)}}{a \cdot 2} \]
    6. Applied egg-rr15.8%

      \[\leadsto \frac{\left(-b\right) + \sqrt{\color{blue}{{b}^{2} + \left(a \cdot \left(c \cdot -4\right) + \left(a \cdot \left(c \cdot -4\right) + \left(c \cdot 4\right) \cdot a\right)\right)}}}{a \cdot 2} \]
    7. Step-by-step derivation
      1. +-commutative15.8%

        \[\leadsto \frac{\left(-b\right) + \sqrt{\color{blue}{\left(a \cdot \left(c \cdot -4\right) + \left(a \cdot \left(c \cdot -4\right) + \left(c \cdot 4\right) \cdot a\right)\right) + {b}^{2}}}}{a \cdot 2} \]
      2. associate-+r+15.8%

        \[\leadsto \frac{\left(-b\right) + \sqrt{\color{blue}{\left(\left(a \cdot \left(c \cdot -4\right) + a \cdot \left(c \cdot -4\right)\right) + \left(c \cdot 4\right) \cdot a\right)} + {b}^{2}}}{a \cdot 2} \]
      3. associate-+l+15.8%

        \[\leadsto \frac{\left(-b\right) + \sqrt{\color{blue}{\left(a \cdot \left(c \cdot -4\right) + a \cdot \left(c \cdot -4\right)\right) + \left(\left(c \cdot 4\right) \cdot a + {b}^{2}\right)}}}{a \cdot 2} \]
      4. associate-*r*15.8%

        \[\leadsto \frac{\left(-b\right) + \sqrt{\left(\color{blue}{\left(a \cdot c\right) \cdot -4} + a \cdot \left(c \cdot -4\right)\right) + \left(\left(c \cdot 4\right) \cdot a + {b}^{2}\right)}}{a \cdot 2} \]
      5. associate-*r*15.8%

        \[\leadsto \frac{\left(-b\right) + \sqrt{\left(\left(a \cdot c\right) \cdot -4 + \color{blue}{\left(a \cdot c\right) \cdot -4}\right) + \left(\left(c \cdot 4\right) \cdot a + {b}^{2}\right)}}{a \cdot 2} \]
      6. distribute-lft-out15.8%

        \[\leadsto \frac{\left(-b\right) + \sqrt{\color{blue}{\left(a \cdot c\right) \cdot \left(-4 + -4\right)} + \left(\left(c \cdot 4\right) \cdot a + {b}^{2}\right)}}{a \cdot 2} \]
      7. metadata-eval15.8%

        \[\leadsto \frac{\left(-b\right) + \sqrt{\left(a \cdot c\right) \cdot \color{blue}{-8} + \left(\left(c \cdot 4\right) \cdot a + {b}^{2}\right)}}{a \cdot 2} \]
      8. +-commutative15.8%

        \[\leadsto \frac{\left(-b\right) + \sqrt{\left(a \cdot c\right) \cdot -8 + \color{blue}{\left({b}^{2} + \left(c \cdot 4\right) \cdot a\right)}}}{a \cdot 2} \]
      9. unpow215.8%

        \[\leadsto \frac{\left(-b\right) + \sqrt{\left(a \cdot c\right) \cdot -8 + \left(\color{blue}{b \cdot b} + \left(c \cdot 4\right) \cdot a\right)}}{a \cdot 2} \]
      10. fma-udef15.8%

        \[\leadsto \frac{\left(-b\right) + \sqrt{\left(a \cdot c\right) \cdot -8 + \color{blue}{\mathsf{fma}\left(b, b, \left(c \cdot 4\right) \cdot a\right)}}}{a \cdot 2} \]
      11. associate-*l*15.8%

        \[\leadsto \frac{\left(-b\right) + \sqrt{\left(a \cdot c\right) \cdot -8 + \mathsf{fma}\left(b, b, \color{blue}{c \cdot \left(4 \cdot a\right)}\right)}}{a \cdot 2} \]
      12. *-commutative15.8%

        \[\leadsto \frac{\left(-b\right) + \sqrt{\left(a \cdot c\right) \cdot -8 + \mathsf{fma}\left(b, b, c \cdot \color{blue}{\left(a \cdot 4\right)}\right)}}{a \cdot 2} \]
    8. Simplified15.8%

      \[\leadsto \frac{\left(-b\right) + \sqrt{\color{blue}{\left(a \cdot c\right) \cdot -8 + \mathsf{fma}\left(b, b, c \cdot \left(a \cdot 4\right)\right)}}}{a \cdot 2} \]
    9. Step-by-step derivation
      1. associate-*l*15.8%

        \[\leadsto \frac{\left(-b\right) + \sqrt{\color{blue}{a \cdot \left(c \cdot -8\right)} + \mathsf{fma}\left(b, b, c \cdot \left(a \cdot 4\right)\right)}}{a \cdot 2} \]
      2. fma-def15.8%

        \[\leadsto \frac{\left(-b\right) + \sqrt{\color{blue}{\mathsf{fma}\left(a, c \cdot -8, \mathsf{fma}\left(b, b, c \cdot \left(a \cdot 4\right)\right)\right)}}}{a \cdot 2} \]
    10. Applied egg-rr15.8%

      \[\leadsto \frac{\left(-b\right) + \sqrt{\color{blue}{\mathsf{fma}\left(a, c \cdot -8, \mathsf{fma}\left(b, b, c \cdot \left(a \cdot 4\right)\right)\right)}}}{a \cdot 2} \]
    11. Step-by-step derivation
      1. clear-num15.8%

        \[\leadsto \color{blue}{\frac{1}{\frac{a \cdot 2}{\left(-b\right) + \sqrt{\mathsf{fma}\left(a, c \cdot -8, \mathsf{fma}\left(b, b, c \cdot \left(a \cdot 4\right)\right)\right)}}}} \]
      2. inv-pow15.8%

        \[\leadsto \color{blue}{{\left(\frac{a \cdot 2}{\left(-b\right) + \sqrt{\mathsf{fma}\left(a, c \cdot -8, \mathsf{fma}\left(b, b, c \cdot \left(a \cdot 4\right)\right)\right)}}\right)}^{-1}} \]
      3. neg-mul-115.8%

        \[\leadsto {\left(\frac{a \cdot 2}{\color{blue}{-1 \cdot b} + \sqrt{\mathsf{fma}\left(a, c \cdot -8, \mathsf{fma}\left(b, b, c \cdot \left(a \cdot 4\right)\right)\right)}}\right)}^{-1} \]
      4. fma-def15.8%

        \[\leadsto {\left(\frac{a \cdot 2}{\color{blue}{\mathsf{fma}\left(-1, b, \sqrt{\mathsf{fma}\left(a, c \cdot -8, \mathsf{fma}\left(b, b, c \cdot \left(a \cdot 4\right)\right)\right)}\right)}}\right)}^{-1} \]
    12. Applied egg-rr15.8%

      \[\leadsto \color{blue}{{\left(\frac{a \cdot 2}{\mathsf{fma}\left(-1, b, \sqrt{\mathsf{fma}\left(a, c \cdot -8, \mathsf{fma}\left(b, b, c \cdot \left(a \cdot 4\right)\right)\right)}\right)}\right)}^{-1}} \]
    13. Step-by-step derivation
      1. unpow-115.8%

        \[\leadsto \color{blue}{\frac{1}{\frac{a \cdot 2}{\mathsf{fma}\left(-1, b, \sqrt{\mathsf{fma}\left(a, c \cdot -8, \mathsf{fma}\left(b, b, c \cdot \left(a \cdot 4\right)\right)\right)}\right)}}} \]
      2. *-lft-identity15.8%

        \[\leadsto \frac{1}{\frac{a \cdot 2}{\color{blue}{1 \cdot \mathsf{fma}\left(-1, b, \sqrt{\mathsf{fma}\left(a, c \cdot -8, \mathsf{fma}\left(b, b, c \cdot \left(a \cdot 4\right)\right)\right)}\right)}}} \]
      3. times-frac15.8%

        \[\leadsto \frac{1}{\color{blue}{\frac{a}{1} \cdot \frac{2}{\mathsf{fma}\left(-1, b, \sqrt{\mathsf{fma}\left(a, c \cdot -8, \mathsf{fma}\left(b, b, c \cdot \left(a \cdot 4\right)\right)\right)}\right)}}} \]
      4. /-rgt-identity15.8%

        \[\leadsto \frac{1}{\color{blue}{a} \cdot \frac{2}{\mathsf{fma}\left(-1, b, \sqrt{\mathsf{fma}\left(a, c \cdot -8, \mathsf{fma}\left(b, b, c \cdot \left(a \cdot 4\right)\right)\right)}\right)}} \]
      5. fma-udef15.8%

        \[\leadsto \frac{1}{a \cdot \frac{2}{\color{blue}{-1 \cdot b + \sqrt{\mathsf{fma}\left(a, c \cdot -8, \mathsf{fma}\left(b, b, c \cdot \left(a \cdot 4\right)\right)\right)}}}} \]
      6. *-commutative15.8%

        \[\leadsto \frac{1}{a \cdot \frac{2}{\color{blue}{b \cdot -1} + \sqrt{\mathsf{fma}\left(a, c \cdot -8, \mathsf{fma}\left(b, b, c \cdot \left(a \cdot 4\right)\right)\right)}}} \]
      7. fma-def15.8%

        \[\leadsto \frac{1}{a \cdot \frac{2}{\color{blue}{\mathsf{fma}\left(b, -1, \sqrt{\mathsf{fma}\left(a, c \cdot -8, \mathsf{fma}\left(b, b, c \cdot \left(a \cdot 4\right)\right)\right)}\right)}}} \]
      8. fma-def15.8%

        \[\leadsto \frac{1}{a \cdot \frac{2}{\mathsf{fma}\left(b, -1, \sqrt{\color{blue}{a \cdot \left(c \cdot -8\right) + \mathsf{fma}\left(b, b, c \cdot \left(a \cdot 4\right)\right)}}\right)}} \]
      9. associate-*r*15.8%

        \[\leadsto \frac{1}{a \cdot \frac{2}{\mathsf{fma}\left(b, -1, \sqrt{\color{blue}{\left(a \cdot c\right) \cdot -8} + \mathsf{fma}\left(b, b, c \cdot \left(a \cdot 4\right)\right)}\right)}} \]
      10. *-commutative15.8%

        \[\leadsto \frac{1}{a \cdot \frac{2}{\mathsf{fma}\left(b, -1, \sqrt{\color{blue}{-8 \cdot \left(a \cdot c\right)} + \mathsf{fma}\left(b, b, c \cdot \left(a \cdot 4\right)\right)}\right)}} \]
      11. fma-udef15.8%

        \[\leadsto \frac{1}{a \cdot \frac{2}{\mathsf{fma}\left(b, -1, \sqrt{-8 \cdot \left(a \cdot c\right) + \color{blue}{\left(b \cdot b + c \cdot \left(a \cdot 4\right)\right)}}\right)}} \]
      12. unpow215.8%

        \[\leadsto \frac{1}{a \cdot \frac{2}{\mathsf{fma}\left(b, -1, \sqrt{-8 \cdot \left(a \cdot c\right) + \left(\color{blue}{{b}^{2}} + c \cdot \left(a \cdot 4\right)\right)}\right)}} \]
      13. associate-*r*15.8%

        \[\leadsto \frac{1}{a \cdot \frac{2}{\mathsf{fma}\left(b, -1, \sqrt{-8 \cdot \left(a \cdot c\right) + \left({b}^{2} + \color{blue}{\left(c \cdot a\right) \cdot 4}\right)}\right)}} \]
      14. *-commutative15.8%

        \[\leadsto \frac{1}{a \cdot \frac{2}{\mathsf{fma}\left(b, -1, \sqrt{-8 \cdot \left(a \cdot c\right) + \left({b}^{2} + \color{blue}{\left(a \cdot c\right)} \cdot 4\right)}\right)}} \]
      15. *-commutative15.8%

        \[\leadsto \frac{1}{a \cdot \frac{2}{\mathsf{fma}\left(b, -1, \sqrt{-8 \cdot \left(a \cdot c\right) + \left({b}^{2} + \color{blue}{4 \cdot \left(a \cdot c\right)}\right)}\right)}} \]
      16. +-commutative15.8%

        \[\leadsto \frac{1}{a \cdot \frac{2}{\mathsf{fma}\left(b, -1, \sqrt{-8 \cdot \left(a \cdot c\right) + \color{blue}{\left(4 \cdot \left(a \cdot c\right) + {b}^{2}\right)}}\right)}} \]
    14. Simplified16.1%

      \[\leadsto \color{blue}{\frac{1}{a \cdot \frac{2}{\mathsf{fma}\left(b, -1, \sqrt{\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)}\right)}}} \]
    15. Taylor expanded in b around inf 83.0%

      \[\leadsto \frac{1}{\color{blue}{-1 \cdot \frac{b}{c} + \frac{a}{b}}} \]
    16. Step-by-step derivation
      1. +-commutative83.0%

        \[\leadsto \frac{1}{\color{blue}{\frac{a}{b} + -1 \cdot \frac{b}{c}}} \]
      2. mul-1-neg83.0%

        \[\leadsto \frac{1}{\frac{a}{b} + \color{blue}{\left(-\frac{b}{c}\right)}} \]
      3. unsub-neg83.0%

        \[\leadsto \frac{1}{\color{blue}{\frac{a}{b} - \frac{b}{c}}} \]
    17. Simplified83.0%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -2.8 \cdot 10^{+139}:\\ \;\;\;\;\frac{-b}{a}\\ \mathbf{elif}\;b \leq 1.2 \cdot 10^{-50}:\\ \;\;\;\;\frac{\sqrt{b \cdot b - \left(a \cdot 4\right) \cdot c} - b}{a \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\frac{a}{b} - \frac{b}{c}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 2: 77.1% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{c}{b} - \frac{b}{a}\\ t_1 := \frac{\sqrt{c \cdot \left(a \cdot -4\right)} - b}{a \cdot 2}\\ \mathbf{if}\;b \leq -1.18 \cdot 10^{+80}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;b \leq -7.2 \cdot 10^{+14}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;b \leq -2.1 \cdot 10^{-8}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;b \leq 2.8 \cdot 10^{-53}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\frac{a}{b} - \frac{b}{c}}\\ \end{array} \end{array} \]
(FPCore (a b c)
 :precision binary64
 (let* ((t_0 (- (/ c b) (/ b a)))
        (t_1 (/ (- (sqrt (* c (* a -4.0))) b) (* a 2.0))))
   (if (<= b -1.18e+80)
     t_0
     (if (<= b -7.2e+14)
       t_1
       (if (<= b -2.1e-8)
         t_0
         (if (<= b 2.8e-53) t_1 (/ 1.0 (- (/ a b) (/ b c)))))))))
double code(double a, double b, double c) {
	double t_0 = (c / b) - (b / a);
	double t_1 = (sqrt((c * (a * -4.0))) - b) / (a * 2.0);
	double tmp;
	if (b <= -1.18e+80) {
		tmp = t_0;
	} else if (b <= -7.2e+14) {
		tmp = t_1;
	} else if (b <= -2.1e-8) {
		tmp = t_0;
	} else if (b <= 2.8e-53) {
		tmp = t_1;
	} else {
		tmp = 1.0 / ((a / b) - (b / c));
	}
	return tmp;
}
real(8) function code(a, b, c)
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: tmp
    t_0 = (c / b) - (b / a)
    t_1 = (sqrt((c * (a * (-4.0d0)))) - b) / (a * 2.0d0)
    if (b <= (-1.18d+80)) then
        tmp = t_0
    else if (b <= (-7.2d+14)) then
        tmp = t_1
    else if (b <= (-2.1d-8)) then
        tmp = t_0
    else if (b <= 2.8d-53) then
        tmp = t_1
    else
        tmp = 1.0d0 / ((a / b) - (b / c))
    end if
    code = tmp
end function
public static double code(double a, double b, double c) {
	double t_0 = (c / b) - (b / a);
	double t_1 = (Math.sqrt((c * (a * -4.0))) - b) / (a * 2.0);
	double tmp;
	if (b <= -1.18e+80) {
		tmp = t_0;
	} else if (b <= -7.2e+14) {
		tmp = t_1;
	} else if (b <= -2.1e-8) {
		tmp = t_0;
	} else if (b <= 2.8e-53) {
		tmp = t_1;
	} else {
		tmp = 1.0 / ((a / b) - (b / c));
	}
	return tmp;
}
def code(a, b, c):
	t_0 = (c / b) - (b / a)
	t_1 = (math.sqrt((c * (a * -4.0))) - b) / (a * 2.0)
	tmp = 0
	if b <= -1.18e+80:
		tmp = t_0
	elif b <= -7.2e+14:
		tmp = t_1
	elif b <= -2.1e-8:
		tmp = t_0
	elif b <= 2.8e-53:
		tmp = t_1
	else:
		tmp = 1.0 / ((a / b) - (b / c))
	return tmp
function code(a, b, c)
	t_0 = Float64(Float64(c / b) - Float64(b / a))
	t_1 = Float64(Float64(sqrt(Float64(c * Float64(a * -4.0))) - b) / Float64(a * 2.0))
	tmp = 0.0
	if (b <= -1.18e+80)
		tmp = t_0;
	elseif (b <= -7.2e+14)
		tmp = t_1;
	elseif (b <= -2.1e-8)
		tmp = t_0;
	elseif (b <= 2.8e-53)
		tmp = t_1;
	else
		tmp = Float64(1.0 / Float64(Float64(a / b) - Float64(b / c)));
	end
	return tmp
end
function tmp_2 = code(a, b, c)
	t_0 = (c / b) - (b / a);
	t_1 = (sqrt((c * (a * -4.0))) - b) / (a * 2.0);
	tmp = 0.0;
	if (b <= -1.18e+80)
		tmp = t_0;
	elseif (b <= -7.2e+14)
		tmp = t_1;
	elseif (b <= -2.1e-8)
		tmp = t_0;
	elseif (b <= 2.8e-53)
		tmp = t_1;
	else
		tmp = 1.0 / ((a / b) - (b / c));
	end
	tmp_2 = tmp;
end
code[a_, b_, c_] := Block[{t$95$0 = N[(N[(c / b), $MachinePrecision] - N[(b / a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[Sqrt[N[(c * N[(a * -4.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision] / N[(a * 2.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -1.18e+80], t$95$0, If[LessEqual[b, -7.2e+14], t$95$1, If[LessEqual[b, -2.1e-8], t$95$0, If[LessEqual[b, 2.8e-53], t$95$1, N[(1.0 / N[(N[(a / b), $MachinePrecision] - N[(b / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \frac{c}{b} - \frac{b}{a}\\
t_1 := \frac{\sqrt{c \cdot \left(a \cdot -4\right)} - b}{a \cdot 2}\\
\mathbf{if}\;b \leq -1.18 \cdot 10^{+80}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;b \leq -7.2 \cdot 10^{+14}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;b \leq -2.1 \cdot 10^{-8}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;b \leq 2.8 \cdot 10^{-53}:\\
\;\;\;\;t_1\\

\mathbf{else}:\\
\;\;\;\;\frac{1}{\frac{a}{b} - \frac{b}{c}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if b < -1.18e80 or -7.2e14 < b < -2.09999999999999994e-8

    1. Initial program 60.9%

      \[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a} \]
    2. Step-by-step derivation
      1. *-commutative60.9%

        \[\leadsto \frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{\color{blue}{a \cdot 2}} \]
    3. Simplified60.9%

      \[\leadsto \color{blue}{\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{a \cdot 2}} \]
    4. Add Preprocessing
    5. Taylor expanded in b around -inf 94.8%

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

        \[\leadsto \color{blue}{\frac{c}{b} + -1 \cdot \frac{b}{a}} \]
      2. mul-1-neg94.8%

        \[\leadsto \frac{c}{b} + \color{blue}{\left(-\frac{b}{a}\right)} \]
      3. unsub-neg94.8%

        \[\leadsto \color{blue}{\frac{c}{b} - \frac{b}{a}} \]
    7. Simplified94.8%

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

    if -1.18e80 < b < -7.2e14 or -2.09999999999999994e-8 < b < 2.79999999999999985e-53

    1. Initial program 78.2%

      \[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a} \]
    2. Step-by-step derivation
      1. *-commutative78.2%

        \[\leadsto \frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{\color{blue}{a \cdot 2}} \]
    3. Simplified78.2%

      \[\leadsto \color{blue}{\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{a \cdot 2}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. prod-diff78.0%

        \[\leadsto \frac{\left(-b\right) + \sqrt{\color{blue}{\mathsf{fma}\left(b, b, -c \cdot \left(4 \cdot a\right)\right) + \mathsf{fma}\left(-c, 4 \cdot a, c \cdot \left(4 \cdot a\right)\right)}}}{a \cdot 2} \]
      2. *-commutative78.0%

        \[\leadsto \frac{\left(-b\right) + \sqrt{\mathsf{fma}\left(b, b, -\color{blue}{\left(4 \cdot a\right) \cdot c}\right) + \mathsf{fma}\left(-c, 4 \cdot a, c \cdot \left(4 \cdot a\right)\right)}}{a \cdot 2} \]
      3. fma-def78.0%

        \[\leadsto \frac{\left(-b\right) + \sqrt{\color{blue}{\left(b \cdot b + \left(-\left(4 \cdot a\right) \cdot c\right)\right)} + \mathsf{fma}\left(-c, 4 \cdot a, c \cdot \left(4 \cdot a\right)\right)}}{a \cdot 2} \]
      4. associate-+l+78.0%

        \[\leadsto \frac{\left(-b\right) + \sqrt{\color{blue}{b \cdot b + \left(\left(-\left(4 \cdot a\right) \cdot c\right) + \mathsf{fma}\left(-c, 4 \cdot a, c \cdot \left(4 \cdot a\right)\right)\right)}}}{a \cdot 2} \]
      5. pow278.0%

        \[\leadsto \frac{\left(-b\right) + \sqrt{\color{blue}{{b}^{2}} + \left(\left(-\left(4 \cdot a\right) \cdot c\right) + \mathsf{fma}\left(-c, 4 \cdot a, c \cdot \left(4 \cdot a\right)\right)\right)}}{a \cdot 2} \]
      6. distribute-lft-neg-in78.0%

        \[\leadsto \frac{\left(-b\right) + \sqrt{{b}^{2} + \left(\color{blue}{\left(-4 \cdot a\right) \cdot c} + \mathsf{fma}\left(-c, 4 \cdot a, c \cdot \left(4 \cdot a\right)\right)\right)}}{a \cdot 2} \]
      7. *-commutative78.0%

        \[\leadsto \frac{\left(-b\right) + \sqrt{{b}^{2} + \left(\left(-\color{blue}{a \cdot 4}\right) \cdot c + \mathsf{fma}\left(-c, 4 \cdot a, c \cdot \left(4 \cdot a\right)\right)\right)}}{a \cdot 2} \]
      8. distribute-rgt-neg-in78.0%

        \[\leadsto \frac{\left(-b\right) + \sqrt{{b}^{2} + \left(\color{blue}{\left(a \cdot \left(-4\right)\right)} \cdot c + \mathsf{fma}\left(-c, 4 \cdot a, c \cdot \left(4 \cdot a\right)\right)\right)}}{a \cdot 2} \]
      9. metadata-eval78.0%

        \[\leadsto \frac{\left(-b\right) + \sqrt{{b}^{2} + \left(\left(a \cdot \color{blue}{-4}\right) \cdot c + \mathsf{fma}\left(-c, 4 \cdot a, c \cdot \left(4 \cdot a\right)\right)\right)}}{a \cdot 2} \]
      10. associate-*r*78.0%

        \[\leadsto \frac{\left(-b\right) + \sqrt{{b}^{2} + \left(\color{blue}{a \cdot \left(-4 \cdot c\right)} + \mathsf{fma}\left(-c, 4 \cdot a, c \cdot \left(4 \cdot a\right)\right)\right)}}{a \cdot 2} \]
      11. *-commutative78.0%

        \[\leadsto \frac{\left(-b\right) + \sqrt{{b}^{2} + \left(a \cdot \color{blue}{\left(c \cdot -4\right)} + \mathsf{fma}\left(-c, 4 \cdot a, c \cdot \left(4 \cdot a\right)\right)\right)}}{a \cdot 2} \]
      12. *-commutative78.0%

        \[\leadsto \frac{\left(-b\right) + \sqrt{{b}^{2} + \left(a \cdot \left(c \cdot -4\right) + \mathsf{fma}\left(-c, 4 \cdot a, \color{blue}{\left(4 \cdot a\right) \cdot c}\right)\right)}}{a \cdot 2} \]
      13. fma-udef78.0%

        \[\leadsto \frac{\left(-b\right) + \sqrt{{b}^{2} + \left(a \cdot \left(c \cdot -4\right) + \color{blue}{\left(\left(-c\right) \cdot \left(4 \cdot a\right) + \left(4 \cdot a\right) \cdot c\right)}\right)}}{a \cdot 2} \]
    6. Applied egg-rr78.0%

      \[\leadsto \frac{\left(-b\right) + \sqrt{\color{blue}{{b}^{2} + \left(a \cdot \left(c \cdot -4\right) + \left(a \cdot \left(c \cdot -4\right) + \left(c \cdot 4\right) \cdot a\right)\right)}}}{a \cdot 2} \]
    7. Step-by-step derivation
      1. +-commutative78.0%

        \[\leadsto \frac{\left(-b\right) + \sqrt{\color{blue}{\left(a \cdot \left(c \cdot -4\right) + \left(a \cdot \left(c \cdot -4\right) + \left(c \cdot 4\right) \cdot a\right)\right) + {b}^{2}}}}{a \cdot 2} \]
      2. associate-+r+78.0%

        \[\leadsto \frac{\left(-b\right) + \sqrt{\color{blue}{\left(\left(a \cdot \left(c \cdot -4\right) + a \cdot \left(c \cdot -4\right)\right) + \left(c \cdot 4\right) \cdot a\right)} + {b}^{2}}}{a \cdot 2} \]
      3. associate-+l+78.0%

        \[\leadsto \frac{\left(-b\right) + \sqrt{\color{blue}{\left(a \cdot \left(c \cdot -4\right) + a \cdot \left(c \cdot -4\right)\right) + \left(\left(c \cdot 4\right) \cdot a + {b}^{2}\right)}}}{a \cdot 2} \]
      4. associate-*r*78.0%

        \[\leadsto \frac{\left(-b\right) + \sqrt{\left(\color{blue}{\left(a \cdot c\right) \cdot -4} + a \cdot \left(c \cdot -4\right)\right) + \left(\left(c \cdot 4\right) \cdot a + {b}^{2}\right)}}{a \cdot 2} \]
      5. associate-*r*78.0%

        \[\leadsto \frac{\left(-b\right) + \sqrt{\left(\left(a \cdot c\right) \cdot -4 + \color{blue}{\left(a \cdot c\right) \cdot -4}\right) + \left(\left(c \cdot 4\right) \cdot a + {b}^{2}\right)}}{a \cdot 2} \]
      6. distribute-lft-out78.0%

        \[\leadsto \frac{\left(-b\right) + \sqrt{\color{blue}{\left(a \cdot c\right) \cdot \left(-4 + -4\right)} + \left(\left(c \cdot 4\right) \cdot a + {b}^{2}\right)}}{a \cdot 2} \]
      7. metadata-eval78.0%

        \[\leadsto \frac{\left(-b\right) + \sqrt{\left(a \cdot c\right) \cdot \color{blue}{-8} + \left(\left(c \cdot 4\right) \cdot a + {b}^{2}\right)}}{a \cdot 2} \]
      8. +-commutative78.0%

        \[\leadsto \frac{\left(-b\right) + \sqrt{\left(a \cdot c\right) \cdot -8 + \color{blue}{\left({b}^{2} + \left(c \cdot 4\right) \cdot a\right)}}}{a \cdot 2} \]
      9. unpow278.0%

        \[\leadsto \frac{\left(-b\right) + \sqrt{\left(a \cdot c\right) \cdot -8 + \left(\color{blue}{b \cdot b} + \left(c \cdot 4\right) \cdot a\right)}}{a \cdot 2} \]
      10. fma-udef78.0%

        \[\leadsto \frac{\left(-b\right) + \sqrt{\left(a \cdot c\right) \cdot -8 + \color{blue}{\mathsf{fma}\left(b, b, \left(c \cdot 4\right) \cdot a\right)}}}{a \cdot 2} \]
      11. associate-*l*78.0%

        \[\leadsto \frac{\left(-b\right) + \sqrt{\left(a \cdot c\right) \cdot -8 + \mathsf{fma}\left(b, b, \color{blue}{c \cdot \left(4 \cdot a\right)}\right)}}{a \cdot 2} \]
      12. *-commutative78.0%

        \[\leadsto \frac{\left(-b\right) + \sqrt{\left(a \cdot c\right) \cdot -8 + \mathsf{fma}\left(b, b, c \cdot \color{blue}{\left(a \cdot 4\right)}\right)}}{a \cdot 2} \]
    8. Simplified78.0%

      \[\leadsto \frac{\left(-b\right) + \sqrt{\color{blue}{\left(a \cdot c\right) \cdot -8 + \mathsf{fma}\left(b, b, c \cdot \left(a \cdot 4\right)\right)}}}{a \cdot 2} \]
    9. Taylor expanded in b around 0 70.0%

      \[\leadsto \frac{\color{blue}{\sqrt{-8 \cdot \left(a \cdot c\right) + 4 \cdot \left(a \cdot c\right)} + -1 \cdot b}}{a \cdot 2} \]
    10. Step-by-step derivation
      1. mul-1-neg70.0%

        \[\leadsto \frac{\sqrt{-8 \cdot \left(a \cdot c\right) + 4 \cdot \left(a \cdot c\right)} + \color{blue}{\left(-b\right)}}{a \cdot 2} \]
      2. unsub-neg70.0%

        \[\leadsto \frac{\color{blue}{\sqrt{-8 \cdot \left(a \cdot c\right) + 4 \cdot \left(a \cdot c\right)} - b}}{a \cdot 2} \]
      3. associate-*r*70.0%

        \[\leadsto \frac{\sqrt{\color{blue}{\left(-8 \cdot a\right) \cdot c} + 4 \cdot \left(a \cdot c\right)} - b}{a \cdot 2} \]
      4. associate-*r*70.0%

        \[\leadsto \frac{\sqrt{\left(-8 \cdot a\right) \cdot c + \color{blue}{\left(4 \cdot a\right) \cdot c}} - b}{a \cdot 2} \]
      5. distribute-rgt-in70.2%

        \[\leadsto \frac{\sqrt{\color{blue}{c \cdot \left(-8 \cdot a + 4 \cdot a\right)}} - b}{a \cdot 2} \]
      6. distribute-rgt-out70.2%

        \[\leadsto \frac{\sqrt{c \cdot \color{blue}{\left(a \cdot \left(-8 + 4\right)\right)}} - b}{a \cdot 2} \]
      7. metadata-eval70.2%

        \[\leadsto \frac{\sqrt{c \cdot \left(a \cdot \color{blue}{-4}\right)} - b}{a \cdot 2} \]
    11. Simplified70.2%

      \[\leadsto \frac{\color{blue}{\sqrt{c \cdot \left(a \cdot -4\right)} - b}}{a \cdot 2} \]

    if 2.79999999999999985e-53 < b

    1. Initial program 16.1%

      \[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a} \]
    2. Step-by-step derivation
      1. *-commutative16.1%

        \[\leadsto \frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{\color{blue}{a \cdot 2}} \]
    3. Simplified16.1%

      \[\leadsto \color{blue}{\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{a \cdot 2}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. prod-diff15.8%

        \[\leadsto \frac{\left(-b\right) + \sqrt{\color{blue}{\mathsf{fma}\left(b, b, -c \cdot \left(4 \cdot a\right)\right) + \mathsf{fma}\left(-c, 4 \cdot a, c \cdot \left(4 \cdot a\right)\right)}}}{a \cdot 2} \]
      2. *-commutative15.8%

        \[\leadsto \frac{\left(-b\right) + \sqrt{\mathsf{fma}\left(b, b, -\color{blue}{\left(4 \cdot a\right) \cdot c}\right) + \mathsf{fma}\left(-c, 4 \cdot a, c \cdot \left(4 \cdot a\right)\right)}}{a \cdot 2} \]
      3. fma-def15.8%

        \[\leadsto \frac{\left(-b\right) + \sqrt{\color{blue}{\left(b \cdot b + \left(-\left(4 \cdot a\right) \cdot c\right)\right)} + \mathsf{fma}\left(-c, 4 \cdot a, c \cdot \left(4 \cdot a\right)\right)}}{a \cdot 2} \]
      4. associate-+l+15.8%

        \[\leadsto \frac{\left(-b\right) + \sqrt{\color{blue}{b \cdot b + \left(\left(-\left(4 \cdot a\right) \cdot c\right) + \mathsf{fma}\left(-c, 4 \cdot a, c \cdot \left(4 \cdot a\right)\right)\right)}}}{a \cdot 2} \]
      5. pow215.8%

        \[\leadsto \frac{\left(-b\right) + \sqrt{\color{blue}{{b}^{2}} + \left(\left(-\left(4 \cdot a\right) \cdot c\right) + \mathsf{fma}\left(-c, 4 \cdot a, c \cdot \left(4 \cdot a\right)\right)\right)}}{a \cdot 2} \]
      6. distribute-lft-neg-in15.8%

        \[\leadsto \frac{\left(-b\right) + \sqrt{{b}^{2} + \left(\color{blue}{\left(-4 \cdot a\right) \cdot c} + \mathsf{fma}\left(-c, 4 \cdot a, c \cdot \left(4 \cdot a\right)\right)\right)}}{a \cdot 2} \]
      7. *-commutative15.8%

        \[\leadsto \frac{\left(-b\right) + \sqrt{{b}^{2} + \left(\left(-\color{blue}{a \cdot 4}\right) \cdot c + \mathsf{fma}\left(-c, 4 \cdot a, c \cdot \left(4 \cdot a\right)\right)\right)}}{a \cdot 2} \]
      8. distribute-rgt-neg-in15.8%

        \[\leadsto \frac{\left(-b\right) + \sqrt{{b}^{2} + \left(\color{blue}{\left(a \cdot \left(-4\right)\right)} \cdot c + \mathsf{fma}\left(-c, 4 \cdot a, c \cdot \left(4 \cdot a\right)\right)\right)}}{a \cdot 2} \]
      9. metadata-eval15.8%

        \[\leadsto \frac{\left(-b\right) + \sqrt{{b}^{2} + \left(\left(a \cdot \color{blue}{-4}\right) \cdot c + \mathsf{fma}\left(-c, 4 \cdot a, c \cdot \left(4 \cdot a\right)\right)\right)}}{a \cdot 2} \]
      10. associate-*r*15.8%

        \[\leadsto \frac{\left(-b\right) + \sqrt{{b}^{2} + \left(\color{blue}{a \cdot \left(-4 \cdot c\right)} + \mathsf{fma}\left(-c, 4 \cdot a, c \cdot \left(4 \cdot a\right)\right)\right)}}{a \cdot 2} \]
      11. *-commutative15.8%

        \[\leadsto \frac{\left(-b\right) + \sqrt{{b}^{2} + \left(a \cdot \color{blue}{\left(c \cdot -4\right)} + \mathsf{fma}\left(-c, 4 \cdot a, c \cdot \left(4 \cdot a\right)\right)\right)}}{a \cdot 2} \]
      12. *-commutative15.8%

        \[\leadsto \frac{\left(-b\right) + \sqrt{{b}^{2} + \left(a \cdot \left(c \cdot -4\right) + \mathsf{fma}\left(-c, 4 \cdot a, \color{blue}{\left(4 \cdot a\right) \cdot c}\right)\right)}}{a \cdot 2} \]
      13. fma-udef15.8%

        \[\leadsto \frac{\left(-b\right) + \sqrt{{b}^{2} + \left(a \cdot \left(c \cdot -4\right) + \color{blue}{\left(\left(-c\right) \cdot \left(4 \cdot a\right) + \left(4 \cdot a\right) \cdot c\right)}\right)}}{a \cdot 2} \]
    6. Applied egg-rr15.8%

      \[\leadsto \frac{\left(-b\right) + \sqrt{\color{blue}{{b}^{2} + \left(a \cdot \left(c \cdot -4\right) + \left(a \cdot \left(c \cdot -4\right) + \left(c \cdot 4\right) \cdot a\right)\right)}}}{a \cdot 2} \]
    7. Step-by-step derivation
      1. +-commutative15.8%

        \[\leadsto \frac{\left(-b\right) + \sqrt{\color{blue}{\left(a \cdot \left(c \cdot -4\right) + \left(a \cdot \left(c \cdot -4\right) + \left(c \cdot 4\right) \cdot a\right)\right) + {b}^{2}}}}{a \cdot 2} \]
      2. associate-+r+15.8%

        \[\leadsto \frac{\left(-b\right) + \sqrt{\color{blue}{\left(\left(a \cdot \left(c \cdot -4\right) + a \cdot \left(c \cdot -4\right)\right) + \left(c \cdot 4\right) \cdot a\right)} + {b}^{2}}}{a \cdot 2} \]
      3. associate-+l+15.8%

        \[\leadsto \frac{\left(-b\right) + \sqrt{\color{blue}{\left(a \cdot \left(c \cdot -4\right) + a \cdot \left(c \cdot -4\right)\right) + \left(\left(c \cdot 4\right) \cdot a + {b}^{2}\right)}}}{a \cdot 2} \]
      4. associate-*r*15.8%

        \[\leadsto \frac{\left(-b\right) + \sqrt{\left(\color{blue}{\left(a \cdot c\right) \cdot -4} + a \cdot \left(c \cdot -4\right)\right) + \left(\left(c \cdot 4\right) \cdot a + {b}^{2}\right)}}{a \cdot 2} \]
      5. associate-*r*15.8%

        \[\leadsto \frac{\left(-b\right) + \sqrt{\left(\left(a \cdot c\right) \cdot -4 + \color{blue}{\left(a \cdot c\right) \cdot -4}\right) + \left(\left(c \cdot 4\right) \cdot a + {b}^{2}\right)}}{a \cdot 2} \]
      6. distribute-lft-out15.8%

        \[\leadsto \frac{\left(-b\right) + \sqrt{\color{blue}{\left(a \cdot c\right) \cdot \left(-4 + -4\right)} + \left(\left(c \cdot 4\right) \cdot a + {b}^{2}\right)}}{a \cdot 2} \]
      7. metadata-eval15.8%

        \[\leadsto \frac{\left(-b\right) + \sqrt{\left(a \cdot c\right) \cdot \color{blue}{-8} + \left(\left(c \cdot 4\right) \cdot a + {b}^{2}\right)}}{a \cdot 2} \]
      8. +-commutative15.8%

        \[\leadsto \frac{\left(-b\right) + \sqrt{\left(a \cdot c\right) \cdot -8 + \color{blue}{\left({b}^{2} + \left(c \cdot 4\right) \cdot a\right)}}}{a \cdot 2} \]
      9. unpow215.8%

        \[\leadsto \frac{\left(-b\right) + \sqrt{\left(a \cdot c\right) \cdot -8 + \left(\color{blue}{b \cdot b} + \left(c \cdot 4\right) \cdot a\right)}}{a \cdot 2} \]
      10. fma-udef15.8%

        \[\leadsto \frac{\left(-b\right) + \sqrt{\left(a \cdot c\right) \cdot -8 + \color{blue}{\mathsf{fma}\left(b, b, \left(c \cdot 4\right) \cdot a\right)}}}{a \cdot 2} \]
      11. associate-*l*15.8%

        \[\leadsto \frac{\left(-b\right) + \sqrt{\left(a \cdot c\right) \cdot -8 + \mathsf{fma}\left(b, b, \color{blue}{c \cdot \left(4 \cdot a\right)}\right)}}{a \cdot 2} \]
      12. *-commutative15.8%

        \[\leadsto \frac{\left(-b\right) + \sqrt{\left(a \cdot c\right) \cdot -8 + \mathsf{fma}\left(b, b, c \cdot \color{blue}{\left(a \cdot 4\right)}\right)}}{a \cdot 2} \]
    8. Simplified15.8%

      \[\leadsto \frac{\left(-b\right) + \sqrt{\color{blue}{\left(a \cdot c\right) \cdot -8 + \mathsf{fma}\left(b, b, c \cdot \left(a \cdot 4\right)\right)}}}{a \cdot 2} \]
    9. Step-by-step derivation
      1. associate-*l*15.8%

        \[\leadsto \frac{\left(-b\right) + \sqrt{\color{blue}{a \cdot \left(c \cdot -8\right)} + \mathsf{fma}\left(b, b, c \cdot \left(a \cdot 4\right)\right)}}{a \cdot 2} \]
      2. fma-def15.8%

        \[\leadsto \frac{\left(-b\right) + \sqrt{\color{blue}{\mathsf{fma}\left(a, c \cdot -8, \mathsf{fma}\left(b, b, c \cdot \left(a \cdot 4\right)\right)\right)}}}{a \cdot 2} \]
    10. Applied egg-rr15.8%

      \[\leadsto \frac{\left(-b\right) + \sqrt{\color{blue}{\mathsf{fma}\left(a, c \cdot -8, \mathsf{fma}\left(b, b, c \cdot \left(a \cdot 4\right)\right)\right)}}}{a \cdot 2} \]
    11. Step-by-step derivation
      1. clear-num15.8%

        \[\leadsto \color{blue}{\frac{1}{\frac{a \cdot 2}{\left(-b\right) + \sqrt{\mathsf{fma}\left(a, c \cdot -8, \mathsf{fma}\left(b, b, c \cdot \left(a \cdot 4\right)\right)\right)}}}} \]
      2. inv-pow15.8%

        \[\leadsto \color{blue}{{\left(\frac{a \cdot 2}{\left(-b\right) + \sqrt{\mathsf{fma}\left(a, c \cdot -8, \mathsf{fma}\left(b, b, c \cdot \left(a \cdot 4\right)\right)\right)}}\right)}^{-1}} \]
      3. neg-mul-115.8%

        \[\leadsto {\left(\frac{a \cdot 2}{\color{blue}{-1 \cdot b} + \sqrt{\mathsf{fma}\left(a, c \cdot -8, \mathsf{fma}\left(b, b, c \cdot \left(a \cdot 4\right)\right)\right)}}\right)}^{-1} \]
      4. fma-def15.8%

        \[\leadsto {\left(\frac{a \cdot 2}{\color{blue}{\mathsf{fma}\left(-1, b, \sqrt{\mathsf{fma}\left(a, c \cdot -8, \mathsf{fma}\left(b, b, c \cdot \left(a \cdot 4\right)\right)\right)}\right)}}\right)}^{-1} \]
    12. Applied egg-rr15.8%

      \[\leadsto \color{blue}{{\left(\frac{a \cdot 2}{\mathsf{fma}\left(-1, b, \sqrt{\mathsf{fma}\left(a, c \cdot -8, \mathsf{fma}\left(b, b, c \cdot \left(a \cdot 4\right)\right)\right)}\right)}\right)}^{-1}} \]
    13. Step-by-step derivation
      1. unpow-115.8%

        \[\leadsto \color{blue}{\frac{1}{\frac{a \cdot 2}{\mathsf{fma}\left(-1, b, \sqrt{\mathsf{fma}\left(a, c \cdot -8, \mathsf{fma}\left(b, b, c \cdot \left(a \cdot 4\right)\right)\right)}\right)}}} \]
      2. *-lft-identity15.8%

        \[\leadsto \frac{1}{\frac{a \cdot 2}{\color{blue}{1 \cdot \mathsf{fma}\left(-1, b, \sqrt{\mathsf{fma}\left(a, c \cdot -8, \mathsf{fma}\left(b, b, c \cdot \left(a \cdot 4\right)\right)\right)}\right)}}} \]
      3. times-frac15.8%

        \[\leadsto \frac{1}{\color{blue}{\frac{a}{1} \cdot \frac{2}{\mathsf{fma}\left(-1, b, \sqrt{\mathsf{fma}\left(a, c \cdot -8, \mathsf{fma}\left(b, b, c \cdot \left(a \cdot 4\right)\right)\right)}\right)}}} \]
      4. /-rgt-identity15.8%

        \[\leadsto \frac{1}{\color{blue}{a} \cdot \frac{2}{\mathsf{fma}\left(-1, b, \sqrt{\mathsf{fma}\left(a, c \cdot -8, \mathsf{fma}\left(b, b, c \cdot \left(a \cdot 4\right)\right)\right)}\right)}} \]
      5. fma-udef15.8%

        \[\leadsto \frac{1}{a \cdot \frac{2}{\color{blue}{-1 \cdot b + \sqrt{\mathsf{fma}\left(a, c \cdot -8, \mathsf{fma}\left(b, b, c \cdot \left(a \cdot 4\right)\right)\right)}}}} \]
      6. *-commutative15.8%

        \[\leadsto \frac{1}{a \cdot \frac{2}{\color{blue}{b \cdot -1} + \sqrt{\mathsf{fma}\left(a, c \cdot -8, \mathsf{fma}\left(b, b, c \cdot \left(a \cdot 4\right)\right)\right)}}} \]
      7. fma-def15.8%

        \[\leadsto \frac{1}{a \cdot \frac{2}{\color{blue}{\mathsf{fma}\left(b, -1, \sqrt{\mathsf{fma}\left(a, c \cdot -8, \mathsf{fma}\left(b, b, c \cdot \left(a \cdot 4\right)\right)\right)}\right)}}} \]
      8. fma-def15.8%

        \[\leadsto \frac{1}{a \cdot \frac{2}{\mathsf{fma}\left(b, -1, \sqrt{\color{blue}{a \cdot \left(c \cdot -8\right) + \mathsf{fma}\left(b, b, c \cdot \left(a \cdot 4\right)\right)}}\right)}} \]
      9. associate-*r*15.8%

        \[\leadsto \frac{1}{a \cdot \frac{2}{\mathsf{fma}\left(b, -1, \sqrt{\color{blue}{\left(a \cdot c\right) \cdot -8} + \mathsf{fma}\left(b, b, c \cdot \left(a \cdot 4\right)\right)}\right)}} \]
      10. *-commutative15.8%

        \[\leadsto \frac{1}{a \cdot \frac{2}{\mathsf{fma}\left(b, -1, \sqrt{\color{blue}{-8 \cdot \left(a \cdot c\right)} + \mathsf{fma}\left(b, b, c \cdot \left(a \cdot 4\right)\right)}\right)}} \]
      11. fma-udef15.8%

        \[\leadsto \frac{1}{a \cdot \frac{2}{\mathsf{fma}\left(b, -1, \sqrt{-8 \cdot \left(a \cdot c\right) + \color{blue}{\left(b \cdot b + c \cdot \left(a \cdot 4\right)\right)}}\right)}} \]
      12. unpow215.8%

        \[\leadsto \frac{1}{a \cdot \frac{2}{\mathsf{fma}\left(b, -1, \sqrt{-8 \cdot \left(a \cdot c\right) + \left(\color{blue}{{b}^{2}} + c \cdot \left(a \cdot 4\right)\right)}\right)}} \]
      13. associate-*r*15.8%

        \[\leadsto \frac{1}{a \cdot \frac{2}{\mathsf{fma}\left(b, -1, \sqrt{-8 \cdot \left(a \cdot c\right) + \left({b}^{2} + \color{blue}{\left(c \cdot a\right) \cdot 4}\right)}\right)}} \]
      14. *-commutative15.8%

        \[\leadsto \frac{1}{a \cdot \frac{2}{\mathsf{fma}\left(b, -1, \sqrt{-8 \cdot \left(a \cdot c\right) + \left({b}^{2} + \color{blue}{\left(a \cdot c\right)} \cdot 4\right)}\right)}} \]
      15. *-commutative15.8%

        \[\leadsto \frac{1}{a \cdot \frac{2}{\mathsf{fma}\left(b, -1, \sqrt{-8 \cdot \left(a \cdot c\right) + \left({b}^{2} + \color{blue}{4 \cdot \left(a \cdot c\right)}\right)}\right)}} \]
      16. +-commutative15.8%

        \[\leadsto \frac{1}{a \cdot \frac{2}{\mathsf{fma}\left(b, -1, \sqrt{-8 \cdot \left(a \cdot c\right) + \color{blue}{\left(4 \cdot \left(a \cdot c\right) + {b}^{2}\right)}}\right)}} \]
    14. Simplified16.1%

      \[\leadsto \color{blue}{\frac{1}{a \cdot \frac{2}{\mathsf{fma}\left(b, -1, \sqrt{\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)}\right)}}} \]
    15. Taylor expanded in b around inf 83.0%

      \[\leadsto \frac{1}{\color{blue}{-1 \cdot \frac{b}{c} + \frac{a}{b}}} \]
    16. Step-by-step derivation
      1. +-commutative83.0%

        \[\leadsto \frac{1}{\color{blue}{\frac{a}{b} + -1 \cdot \frac{b}{c}}} \]
      2. mul-1-neg83.0%

        \[\leadsto \frac{1}{\frac{a}{b} + \color{blue}{\left(-\frac{b}{c}\right)}} \]
      3. unsub-neg83.0%

        \[\leadsto \frac{1}{\color{blue}{\frac{a}{b} - \frac{b}{c}}} \]
    17. Simplified83.0%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -1.18 \cdot 10^{+80}:\\ \;\;\;\;\frac{c}{b} - \frac{b}{a}\\ \mathbf{elif}\;b \leq -7.2 \cdot 10^{+14}:\\ \;\;\;\;\frac{\sqrt{c \cdot \left(a \cdot -4\right)} - b}{a \cdot 2}\\ \mathbf{elif}\;b \leq -2.1 \cdot 10^{-8}:\\ \;\;\;\;\frac{c}{b} - \frac{b}{a}\\ \mathbf{elif}\;b \leq 2.8 \cdot 10^{-53}:\\ \;\;\;\;\frac{\sqrt{c \cdot \left(a \cdot -4\right)} - b}{a \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\frac{a}{b} - \frac{b}{c}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 78.7% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{c}{b} - \frac{b}{a}\\ t_1 := 0.5 \cdot \frac{\sqrt{c \cdot \left(a \cdot -4\right)}}{a}\\ \mathbf{if}\;b \leq -8.6 \cdot 10^{+38}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;b \leq -7.2 \cdot 10^{+14}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;b \leq -1.3 \cdot 10^{-8}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;b \leq 2.55 \cdot 10^{-51}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\frac{a}{b} - \frac{b}{c}}\\ \end{array} \end{array} \]
(FPCore (a b c)
 :precision binary64
 (let* ((t_0 (- (/ c b) (/ b a))) (t_1 (* 0.5 (/ (sqrt (* c (* a -4.0))) a))))
   (if (<= b -8.6e+38)
     t_0
     (if (<= b -7.2e+14)
       t_1
       (if (<= b -1.3e-8)
         t_0
         (if (<= b 2.55e-51) t_1 (/ 1.0 (- (/ a b) (/ b c)))))))))
double code(double a, double b, double c) {
	double t_0 = (c / b) - (b / a);
	double t_1 = 0.5 * (sqrt((c * (a * -4.0))) / a);
	double tmp;
	if (b <= -8.6e+38) {
		tmp = t_0;
	} else if (b <= -7.2e+14) {
		tmp = t_1;
	} else if (b <= -1.3e-8) {
		tmp = t_0;
	} else if (b <= 2.55e-51) {
		tmp = t_1;
	} else {
		tmp = 1.0 / ((a / b) - (b / c));
	}
	return tmp;
}
real(8) function code(a, b, c)
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: tmp
    t_0 = (c / b) - (b / a)
    t_1 = 0.5d0 * (sqrt((c * (a * (-4.0d0)))) / a)
    if (b <= (-8.6d+38)) then
        tmp = t_0
    else if (b <= (-7.2d+14)) then
        tmp = t_1
    else if (b <= (-1.3d-8)) then
        tmp = t_0
    else if (b <= 2.55d-51) then
        tmp = t_1
    else
        tmp = 1.0d0 / ((a / b) - (b / c))
    end if
    code = tmp
end function
public static double code(double a, double b, double c) {
	double t_0 = (c / b) - (b / a);
	double t_1 = 0.5 * (Math.sqrt((c * (a * -4.0))) / a);
	double tmp;
	if (b <= -8.6e+38) {
		tmp = t_0;
	} else if (b <= -7.2e+14) {
		tmp = t_1;
	} else if (b <= -1.3e-8) {
		tmp = t_0;
	} else if (b <= 2.55e-51) {
		tmp = t_1;
	} else {
		tmp = 1.0 / ((a / b) - (b / c));
	}
	return tmp;
}
def code(a, b, c):
	t_0 = (c / b) - (b / a)
	t_1 = 0.5 * (math.sqrt((c * (a * -4.0))) / a)
	tmp = 0
	if b <= -8.6e+38:
		tmp = t_0
	elif b <= -7.2e+14:
		tmp = t_1
	elif b <= -1.3e-8:
		tmp = t_0
	elif b <= 2.55e-51:
		tmp = t_1
	else:
		tmp = 1.0 / ((a / b) - (b / c))
	return tmp
function code(a, b, c)
	t_0 = Float64(Float64(c / b) - Float64(b / a))
	t_1 = Float64(0.5 * Float64(sqrt(Float64(c * Float64(a * -4.0))) / a))
	tmp = 0.0
	if (b <= -8.6e+38)
		tmp = t_0;
	elseif (b <= -7.2e+14)
		tmp = t_1;
	elseif (b <= -1.3e-8)
		tmp = t_0;
	elseif (b <= 2.55e-51)
		tmp = t_1;
	else
		tmp = Float64(1.0 / Float64(Float64(a / b) - Float64(b / c)));
	end
	return tmp
end
function tmp_2 = code(a, b, c)
	t_0 = (c / b) - (b / a);
	t_1 = 0.5 * (sqrt((c * (a * -4.0))) / a);
	tmp = 0.0;
	if (b <= -8.6e+38)
		tmp = t_0;
	elseif (b <= -7.2e+14)
		tmp = t_1;
	elseif (b <= -1.3e-8)
		tmp = t_0;
	elseif (b <= 2.55e-51)
		tmp = t_1;
	else
		tmp = 1.0 / ((a / b) - (b / c));
	end
	tmp_2 = tmp;
end
code[a_, b_, c_] := Block[{t$95$0 = N[(N[(c / b), $MachinePrecision] - N[(b / a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(0.5 * N[(N[Sqrt[N[(c * N[(a * -4.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -8.6e+38], t$95$0, If[LessEqual[b, -7.2e+14], t$95$1, If[LessEqual[b, -1.3e-8], t$95$0, If[LessEqual[b, 2.55e-51], t$95$1, N[(1.0 / N[(N[(a / b), $MachinePrecision] - N[(b / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \frac{c}{b} - \frac{b}{a}\\
t_1 := 0.5 \cdot \frac{\sqrt{c \cdot \left(a \cdot -4\right)}}{a}\\
\mathbf{if}\;b \leq -8.6 \cdot 10^{+38}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;b \leq -7.2 \cdot 10^{+14}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;b \leq -1.3 \cdot 10^{-8}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;b \leq 2.55 \cdot 10^{-51}:\\
\;\;\;\;t_1\\

\mathbf{else}:\\
\;\;\;\;\frac{1}{\frac{a}{b} - \frac{b}{c}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if b < -8.5999999999999994e38 or -7.2e14 < b < -1.3000000000000001e-8

    1. Initial program 64.1%

      \[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a} \]
    2. Step-by-step derivation
      1. *-commutative64.1%

        \[\leadsto \frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{\color{blue}{a \cdot 2}} \]
    3. Simplified64.1%

      \[\leadsto \color{blue}{\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{a \cdot 2}} \]
    4. Add Preprocessing
    5. Taylor expanded in b around -inf 92.2%

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

        \[\leadsto \color{blue}{\frac{c}{b} + -1 \cdot \frac{b}{a}} \]
      2. mul-1-neg92.2%

        \[\leadsto \frac{c}{b} + \color{blue}{\left(-\frac{b}{a}\right)} \]
      3. unsub-neg92.2%

        \[\leadsto \color{blue}{\frac{c}{b} - \frac{b}{a}} \]
    7. Simplified92.2%

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

    if -8.5999999999999994e38 < b < -7.2e14 or -1.3000000000000001e-8 < b < 2.5499999999999999e-51

    1. Initial program 77.2%

      \[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a} \]
    2. Step-by-step derivation
      1. *-commutative77.2%

        \[\leadsto \frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{\color{blue}{a \cdot 2}} \]
    3. Simplified77.2%

      \[\leadsto \color{blue}{\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{a \cdot 2}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. prod-diff76.9%

        \[\leadsto \frac{\left(-b\right) + \sqrt{\color{blue}{\mathsf{fma}\left(b, b, -c \cdot \left(4 \cdot a\right)\right) + \mathsf{fma}\left(-c, 4 \cdot a, c \cdot \left(4 \cdot a\right)\right)}}}{a \cdot 2} \]
      2. *-commutative76.9%

        \[\leadsto \frac{\left(-b\right) + \sqrt{\mathsf{fma}\left(b, b, -\color{blue}{\left(4 \cdot a\right) \cdot c}\right) + \mathsf{fma}\left(-c, 4 \cdot a, c \cdot \left(4 \cdot a\right)\right)}}{a \cdot 2} \]
      3. fma-def76.9%

        \[\leadsto \frac{\left(-b\right) + \sqrt{\color{blue}{\left(b \cdot b + \left(-\left(4 \cdot a\right) \cdot c\right)\right)} + \mathsf{fma}\left(-c, 4 \cdot a, c \cdot \left(4 \cdot a\right)\right)}}{a \cdot 2} \]
      4. associate-+l+76.9%

        \[\leadsto \frac{\left(-b\right) + \sqrt{\color{blue}{b \cdot b + \left(\left(-\left(4 \cdot a\right) \cdot c\right) + \mathsf{fma}\left(-c, 4 \cdot a, c \cdot \left(4 \cdot a\right)\right)\right)}}}{a \cdot 2} \]
      5. pow276.9%

        \[\leadsto \frac{\left(-b\right) + \sqrt{\color{blue}{{b}^{2}} + \left(\left(-\left(4 \cdot a\right) \cdot c\right) + \mathsf{fma}\left(-c, 4 \cdot a, c \cdot \left(4 \cdot a\right)\right)\right)}}{a \cdot 2} \]
      6. distribute-lft-neg-in76.9%

        \[\leadsto \frac{\left(-b\right) + \sqrt{{b}^{2} + \left(\color{blue}{\left(-4 \cdot a\right) \cdot c} + \mathsf{fma}\left(-c, 4 \cdot a, c \cdot \left(4 \cdot a\right)\right)\right)}}{a \cdot 2} \]
      7. *-commutative76.9%

        \[\leadsto \frac{\left(-b\right) + \sqrt{{b}^{2} + \left(\left(-\color{blue}{a \cdot 4}\right) \cdot c + \mathsf{fma}\left(-c, 4 \cdot a, c \cdot \left(4 \cdot a\right)\right)\right)}}{a \cdot 2} \]
      8. distribute-rgt-neg-in76.9%

        \[\leadsto \frac{\left(-b\right) + \sqrt{{b}^{2} + \left(\color{blue}{\left(a \cdot \left(-4\right)\right)} \cdot c + \mathsf{fma}\left(-c, 4 \cdot a, c \cdot \left(4 \cdot a\right)\right)\right)}}{a \cdot 2} \]
      9. metadata-eval76.9%

        \[\leadsto \frac{\left(-b\right) + \sqrt{{b}^{2} + \left(\left(a \cdot \color{blue}{-4}\right) \cdot c + \mathsf{fma}\left(-c, 4 \cdot a, c \cdot \left(4 \cdot a\right)\right)\right)}}{a \cdot 2} \]
      10. associate-*r*76.9%

        \[\leadsto \frac{\left(-b\right) + \sqrt{{b}^{2} + \left(\color{blue}{a \cdot \left(-4 \cdot c\right)} + \mathsf{fma}\left(-c, 4 \cdot a, c \cdot \left(4 \cdot a\right)\right)\right)}}{a \cdot 2} \]
      11. *-commutative76.9%

        \[\leadsto \frac{\left(-b\right) + \sqrt{{b}^{2} + \left(a \cdot \color{blue}{\left(c \cdot -4\right)} + \mathsf{fma}\left(-c, 4 \cdot a, c \cdot \left(4 \cdot a\right)\right)\right)}}{a \cdot 2} \]
      12. *-commutative76.9%

        \[\leadsto \frac{\left(-b\right) + \sqrt{{b}^{2} + \left(a \cdot \left(c \cdot -4\right) + \mathsf{fma}\left(-c, 4 \cdot a, \color{blue}{\left(4 \cdot a\right) \cdot c}\right)\right)}}{a \cdot 2} \]
      13. fma-udef76.9%

        \[\leadsto \frac{\left(-b\right) + \sqrt{{b}^{2} + \left(a \cdot \left(c \cdot -4\right) + \color{blue}{\left(\left(-c\right) \cdot \left(4 \cdot a\right) + \left(4 \cdot a\right) \cdot c\right)}\right)}}{a \cdot 2} \]
    6. Applied egg-rr76.9%

      \[\leadsto \frac{\left(-b\right) + \sqrt{\color{blue}{{b}^{2} + \left(a \cdot \left(c \cdot -4\right) + \left(a \cdot \left(c \cdot -4\right) + \left(c \cdot 4\right) \cdot a\right)\right)}}}{a \cdot 2} \]
    7. Step-by-step derivation
      1. +-commutative76.9%

        \[\leadsto \frac{\left(-b\right) + \sqrt{\color{blue}{\left(a \cdot \left(c \cdot -4\right) + \left(a \cdot \left(c \cdot -4\right) + \left(c \cdot 4\right) \cdot a\right)\right) + {b}^{2}}}}{a \cdot 2} \]
      2. associate-+r+76.9%

        \[\leadsto \frac{\left(-b\right) + \sqrt{\color{blue}{\left(\left(a \cdot \left(c \cdot -4\right) + a \cdot \left(c \cdot -4\right)\right) + \left(c \cdot 4\right) \cdot a\right)} + {b}^{2}}}{a \cdot 2} \]
      3. associate-+l+76.9%

        \[\leadsto \frac{\left(-b\right) + \sqrt{\color{blue}{\left(a \cdot \left(c \cdot -4\right) + a \cdot \left(c \cdot -4\right)\right) + \left(\left(c \cdot 4\right) \cdot a + {b}^{2}\right)}}}{a \cdot 2} \]
      4. associate-*r*76.9%

        \[\leadsto \frac{\left(-b\right) + \sqrt{\left(\color{blue}{\left(a \cdot c\right) \cdot -4} + a \cdot \left(c \cdot -4\right)\right) + \left(\left(c \cdot 4\right) \cdot a + {b}^{2}\right)}}{a \cdot 2} \]
      5. associate-*r*76.9%

        \[\leadsto \frac{\left(-b\right) + \sqrt{\left(\left(a \cdot c\right) \cdot -4 + \color{blue}{\left(a \cdot c\right) \cdot -4}\right) + \left(\left(c \cdot 4\right) \cdot a + {b}^{2}\right)}}{a \cdot 2} \]
      6. distribute-lft-out76.9%

        \[\leadsto \frac{\left(-b\right) + \sqrt{\color{blue}{\left(a \cdot c\right) \cdot \left(-4 + -4\right)} + \left(\left(c \cdot 4\right) \cdot a + {b}^{2}\right)}}{a \cdot 2} \]
      7. metadata-eval76.9%

        \[\leadsto \frac{\left(-b\right) + \sqrt{\left(a \cdot c\right) \cdot \color{blue}{-8} + \left(\left(c \cdot 4\right) \cdot a + {b}^{2}\right)}}{a \cdot 2} \]
      8. +-commutative76.9%

        \[\leadsto \frac{\left(-b\right) + \sqrt{\left(a \cdot c\right) \cdot -8 + \color{blue}{\left({b}^{2} + \left(c \cdot 4\right) \cdot a\right)}}}{a \cdot 2} \]
      9. unpow276.9%

        \[\leadsto \frac{\left(-b\right) + \sqrt{\left(a \cdot c\right) \cdot -8 + \left(\color{blue}{b \cdot b} + \left(c \cdot 4\right) \cdot a\right)}}{a \cdot 2} \]
      10. fma-udef76.9%

        \[\leadsto \frac{\left(-b\right) + \sqrt{\left(a \cdot c\right) \cdot -8 + \color{blue}{\mathsf{fma}\left(b, b, \left(c \cdot 4\right) \cdot a\right)}}}{a \cdot 2} \]
      11. associate-*l*76.9%

        \[\leadsto \frac{\left(-b\right) + \sqrt{\left(a \cdot c\right) \cdot -8 + \mathsf{fma}\left(b, b, \color{blue}{c \cdot \left(4 \cdot a\right)}\right)}}{a \cdot 2} \]
      12. *-commutative76.9%

        \[\leadsto \frac{\left(-b\right) + \sqrt{\left(a \cdot c\right) \cdot -8 + \mathsf{fma}\left(b, b, c \cdot \color{blue}{\left(a \cdot 4\right)}\right)}}{a \cdot 2} \]
    8. Simplified76.9%

      \[\leadsto \frac{\left(-b\right) + \sqrt{\color{blue}{\left(a \cdot c\right) \cdot -8 + \mathsf{fma}\left(b, b, c \cdot \left(a \cdot 4\right)\right)}}}{a \cdot 2} \]
    9. Taylor expanded in b around 0 68.1%

      \[\leadsto \color{blue}{0.5 \cdot \left(\frac{1}{a} \cdot \sqrt{-8 \cdot \left(a \cdot c\right) + 4 \cdot \left(a \cdot c\right)}\right)} \]
    10. Step-by-step derivation
      1. associate-*l/68.3%

        \[\leadsto 0.5 \cdot \color{blue}{\frac{1 \cdot \sqrt{-8 \cdot \left(a \cdot c\right) + 4 \cdot \left(a \cdot c\right)}}{a}} \]
      2. *-lft-identity68.3%

        \[\leadsto 0.5 \cdot \frac{\color{blue}{\sqrt{-8 \cdot \left(a \cdot c\right) + 4 \cdot \left(a \cdot c\right)}}}{a} \]
      3. associate-*r*68.3%

        \[\leadsto 0.5 \cdot \frac{\sqrt{\color{blue}{\left(-8 \cdot a\right) \cdot c} + 4 \cdot \left(a \cdot c\right)}}{a} \]
      4. associate-*r*68.3%

        \[\leadsto 0.5 \cdot \frac{\sqrt{\left(-8 \cdot a\right) \cdot c + \color{blue}{\left(4 \cdot a\right) \cdot c}}}{a} \]
      5. distribute-rgt-in68.6%

        \[\leadsto 0.5 \cdot \frac{\sqrt{\color{blue}{c \cdot \left(-8 \cdot a + 4 \cdot a\right)}}}{a} \]
      6. distribute-rgt-out68.6%

        \[\leadsto 0.5 \cdot \frac{\sqrt{c \cdot \color{blue}{\left(a \cdot \left(-8 + 4\right)\right)}}}{a} \]
      7. metadata-eval68.6%

        \[\leadsto 0.5 \cdot \frac{\sqrt{c \cdot \left(a \cdot \color{blue}{-4}\right)}}{a} \]
    11. Simplified68.6%

      \[\leadsto \color{blue}{0.5 \cdot \frac{\sqrt{c \cdot \left(a \cdot -4\right)}}{a}} \]

    if 2.5499999999999999e-51 < b

    1. Initial program 16.1%

      \[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a} \]
    2. Step-by-step derivation
      1. *-commutative16.1%

        \[\leadsto \frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{\color{blue}{a \cdot 2}} \]
    3. Simplified16.1%

      \[\leadsto \color{blue}{\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{a \cdot 2}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. prod-diff15.8%

        \[\leadsto \frac{\left(-b\right) + \sqrt{\color{blue}{\mathsf{fma}\left(b, b, -c \cdot \left(4 \cdot a\right)\right) + \mathsf{fma}\left(-c, 4 \cdot a, c \cdot \left(4 \cdot a\right)\right)}}}{a \cdot 2} \]
      2. *-commutative15.8%

        \[\leadsto \frac{\left(-b\right) + \sqrt{\mathsf{fma}\left(b, b, -\color{blue}{\left(4 \cdot a\right) \cdot c}\right) + \mathsf{fma}\left(-c, 4 \cdot a, c \cdot \left(4 \cdot a\right)\right)}}{a \cdot 2} \]
      3. fma-def15.8%

        \[\leadsto \frac{\left(-b\right) + \sqrt{\color{blue}{\left(b \cdot b + \left(-\left(4 \cdot a\right) \cdot c\right)\right)} + \mathsf{fma}\left(-c, 4 \cdot a, c \cdot \left(4 \cdot a\right)\right)}}{a \cdot 2} \]
      4. associate-+l+15.8%

        \[\leadsto \frac{\left(-b\right) + \sqrt{\color{blue}{b \cdot b + \left(\left(-\left(4 \cdot a\right) \cdot c\right) + \mathsf{fma}\left(-c, 4 \cdot a, c \cdot \left(4 \cdot a\right)\right)\right)}}}{a \cdot 2} \]
      5. pow215.8%

        \[\leadsto \frac{\left(-b\right) + \sqrt{\color{blue}{{b}^{2}} + \left(\left(-\left(4 \cdot a\right) \cdot c\right) + \mathsf{fma}\left(-c, 4 \cdot a, c \cdot \left(4 \cdot a\right)\right)\right)}}{a \cdot 2} \]
      6. distribute-lft-neg-in15.8%

        \[\leadsto \frac{\left(-b\right) + \sqrt{{b}^{2} + \left(\color{blue}{\left(-4 \cdot a\right) \cdot c} + \mathsf{fma}\left(-c, 4 \cdot a, c \cdot \left(4 \cdot a\right)\right)\right)}}{a \cdot 2} \]
      7. *-commutative15.8%

        \[\leadsto \frac{\left(-b\right) + \sqrt{{b}^{2} + \left(\left(-\color{blue}{a \cdot 4}\right) \cdot c + \mathsf{fma}\left(-c, 4 \cdot a, c \cdot \left(4 \cdot a\right)\right)\right)}}{a \cdot 2} \]
      8. distribute-rgt-neg-in15.8%

        \[\leadsto \frac{\left(-b\right) + \sqrt{{b}^{2} + \left(\color{blue}{\left(a \cdot \left(-4\right)\right)} \cdot c + \mathsf{fma}\left(-c, 4 \cdot a, c \cdot \left(4 \cdot a\right)\right)\right)}}{a \cdot 2} \]
      9. metadata-eval15.8%

        \[\leadsto \frac{\left(-b\right) + \sqrt{{b}^{2} + \left(\left(a \cdot \color{blue}{-4}\right) \cdot c + \mathsf{fma}\left(-c, 4 \cdot a, c \cdot \left(4 \cdot a\right)\right)\right)}}{a \cdot 2} \]
      10. associate-*r*15.8%

        \[\leadsto \frac{\left(-b\right) + \sqrt{{b}^{2} + \left(\color{blue}{a \cdot \left(-4 \cdot c\right)} + \mathsf{fma}\left(-c, 4 \cdot a, c \cdot \left(4 \cdot a\right)\right)\right)}}{a \cdot 2} \]
      11. *-commutative15.8%

        \[\leadsto \frac{\left(-b\right) + \sqrt{{b}^{2} + \left(a \cdot \color{blue}{\left(c \cdot -4\right)} + \mathsf{fma}\left(-c, 4 \cdot a, c \cdot \left(4 \cdot a\right)\right)\right)}}{a \cdot 2} \]
      12. *-commutative15.8%

        \[\leadsto \frac{\left(-b\right) + \sqrt{{b}^{2} + \left(a \cdot \left(c \cdot -4\right) + \mathsf{fma}\left(-c, 4 \cdot a, \color{blue}{\left(4 \cdot a\right) \cdot c}\right)\right)}}{a \cdot 2} \]
      13. fma-udef15.8%

        \[\leadsto \frac{\left(-b\right) + \sqrt{{b}^{2} + \left(a \cdot \left(c \cdot -4\right) + \color{blue}{\left(\left(-c\right) \cdot \left(4 \cdot a\right) + \left(4 \cdot a\right) \cdot c\right)}\right)}}{a \cdot 2} \]
    6. Applied egg-rr15.8%

      \[\leadsto \frac{\left(-b\right) + \sqrt{\color{blue}{{b}^{2} + \left(a \cdot \left(c \cdot -4\right) + \left(a \cdot \left(c \cdot -4\right) + \left(c \cdot 4\right) \cdot a\right)\right)}}}{a \cdot 2} \]
    7. Step-by-step derivation
      1. +-commutative15.8%

        \[\leadsto \frac{\left(-b\right) + \sqrt{\color{blue}{\left(a \cdot \left(c \cdot -4\right) + \left(a \cdot \left(c \cdot -4\right) + \left(c \cdot 4\right) \cdot a\right)\right) + {b}^{2}}}}{a \cdot 2} \]
      2. associate-+r+15.8%

        \[\leadsto \frac{\left(-b\right) + \sqrt{\color{blue}{\left(\left(a \cdot \left(c \cdot -4\right) + a \cdot \left(c \cdot -4\right)\right) + \left(c \cdot 4\right) \cdot a\right)} + {b}^{2}}}{a \cdot 2} \]
      3. associate-+l+15.8%

        \[\leadsto \frac{\left(-b\right) + \sqrt{\color{blue}{\left(a \cdot \left(c \cdot -4\right) + a \cdot \left(c \cdot -4\right)\right) + \left(\left(c \cdot 4\right) \cdot a + {b}^{2}\right)}}}{a \cdot 2} \]
      4. associate-*r*15.8%

        \[\leadsto \frac{\left(-b\right) + \sqrt{\left(\color{blue}{\left(a \cdot c\right) \cdot -4} + a \cdot \left(c \cdot -4\right)\right) + \left(\left(c \cdot 4\right) \cdot a + {b}^{2}\right)}}{a \cdot 2} \]
      5. associate-*r*15.8%

        \[\leadsto \frac{\left(-b\right) + \sqrt{\left(\left(a \cdot c\right) \cdot -4 + \color{blue}{\left(a \cdot c\right) \cdot -4}\right) + \left(\left(c \cdot 4\right) \cdot a + {b}^{2}\right)}}{a \cdot 2} \]
      6. distribute-lft-out15.8%

        \[\leadsto \frac{\left(-b\right) + \sqrt{\color{blue}{\left(a \cdot c\right) \cdot \left(-4 + -4\right)} + \left(\left(c \cdot 4\right) \cdot a + {b}^{2}\right)}}{a \cdot 2} \]
      7. metadata-eval15.8%

        \[\leadsto \frac{\left(-b\right) + \sqrt{\left(a \cdot c\right) \cdot \color{blue}{-8} + \left(\left(c \cdot 4\right) \cdot a + {b}^{2}\right)}}{a \cdot 2} \]
      8. +-commutative15.8%

        \[\leadsto \frac{\left(-b\right) + \sqrt{\left(a \cdot c\right) \cdot -8 + \color{blue}{\left({b}^{2} + \left(c \cdot 4\right) \cdot a\right)}}}{a \cdot 2} \]
      9. unpow215.8%

        \[\leadsto \frac{\left(-b\right) + \sqrt{\left(a \cdot c\right) \cdot -8 + \left(\color{blue}{b \cdot b} + \left(c \cdot 4\right) \cdot a\right)}}{a \cdot 2} \]
      10. fma-udef15.8%

        \[\leadsto \frac{\left(-b\right) + \sqrt{\left(a \cdot c\right) \cdot -8 + \color{blue}{\mathsf{fma}\left(b, b, \left(c \cdot 4\right) \cdot a\right)}}}{a \cdot 2} \]
      11. associate-*l*15.8%

        \[\leadsto \frac{\left(-b\right) + \sqrt{\left(a \cdot c\right) \cdot -8 + \mathsf{fma}\left(b, b, \color{blue}{c \cdot \left(4 \cdot a\right)}\right)}}{a \cdot 2} \]
      12. *-commutative15.8%

        \[\leadsto \frac{\left(-b\right) + \sqrt{\left(a \cdot c\right) \cdot -8 + \mathsf{fma}\left(b, b, c \cdot \color{blue}{\left(a \cdot 4\right)}\right)}}{a \cdot 2} \]
    8. Simplified15.8%

      \[\leadsto \frac{\left(-b\right) + \sqrt{\color{blue}{\left(a \cdot c\right) \cdot -8 + \mathsf{fma}\left(b, b, c \cdot \left(a \cdot 4\right)\right)}}}{a \cdot 2} \]
    9. Step-by-step derivation
      1. associate-*l*15.8%

        \[\leadsto \frac{\left(-b\right) + \sqrt{\color{blue}{a \cdot \left(c \cdot -8\right)} + \mathsf{fma}\left(b, b, c \cdot \left(a \cdot 4\right)\right)}}{a \cdot 2} \]
      2. fma-def15.8%

        \[\leadsto \frac{\left(-b\right) + \sqrt{\color{blue}{\mathsf{fma}\left(a, c \cdot -8, \mathsf{fma}\left(b, b, c \cdot \left(a \cdot 4\right)\right)\right)}}}{a \cdot 2} \]
    10. Applied egg-rr15.8%

      \[\leadsto \frac{\left(-b\right) + \sqrt{\color{blue}{\mathsf{fma}\left(a, c \cdot -8, \mathsf{fma}\left(b, b, c \cdot \left(a \cdot 4\right)\right)\right)}}}{a \cdot 2} \]
    11. Step-by-step derivation
      1. clear-num15.8%

        \[\leadsto \color{blue}{\frac{1}{\frac{a \cdot 2}{\left(-b\right) + \sqrt{\mathsf{fma}\left(a, c \cdot -8, \mathsf{fma}\left(b, b, c \cdot \left(a \cdot 4\right)\right)\right)}}}} \]
      2. inv-pow15.8%

        \[\leadsto \color{blue}{{\left(\frac{a \cdot 2}{\left(-b\right) + \sqrt{\mathsf{fma}\left(a, c \cdot -8, \mathsf{fma}\left(b, b, c \cdot \left(a \cdot 4\right)\right)\right)}}\right)}^{-1}} \]
      3. neg-mul-115.8%

        \[\leadsto {\left(\frac{a \cdot 2}{\color{blue}{-1 \cdot b} + \sqrt{\mathsf{fma}\left(a, c \cdot -8, \mathsf{fma}\left(b, b, c \cdot \left(a \cdot 4\right)\right)\right)}}\right)}^{-1} \]
      4. fma-def15.8%

        \[\leadsto {\left(\frac{a \cdot 2}{\color{blue}{\mathsf{fma}\left(-1, b, \sqrt{\mathsf{fma}\left(a, c \cdot -8, \mathsf{fma}\left(b, b, c \cdot \left(a \cdot 4\right)\right)\right)}\right)}}\right)}^{-1} \]
    12. Applied egg-rr15.8%

      \[\leadsto \color{blue}{{\left(\frac{a \cdot 2}{\mathsf{fma}\left(-1, b, \sqrt{\mathsf{fma}\left(a, c \cdot -8, \mathsf{fma}\left(b, b, c \cdot \left(a \cdot 4\right)\right)\right)}\right)}\right)}^{-1}} \]
    13. Step-by-step derivation
      1. unpow-115.8%

        \[\leadsto \color{blue}{\frac{1}{\frac{a \cdot 2}{\mathsf{fma}\left(-1, b, \sqrt{\mathsf{fma}\left(a, c \cdot -8, \mathsf{fma}\left(b, b, c \cdot \left(a \cdot 4\right)\right)\right)}\right)}}} \]
      2. *-lft-identity15.8%

        \[\leadsto \frac{1}{\frac{a \cdot 2}{\color{blue}{1 \cdot \mathsf{fma}\left(-1, b, \sqrt{\mathsf{fma}\left(a, c \cdot -8, \mathsf{fma}\left(b, b, c \cdot \left(a \cdot 4\right)\right)\right)}\right)}}} \]
      3. times-frac15.8%

        \[\leadsto \frac{1}{\color{blue}{\frac{a}{1} \cdot \frac{2}{\mathsf{fma}\left(-1, b, \sqrt{\mathsf{fma}\left(a, c \cdot -8, \mathsf{fma}\left(b, b, c \cdot \left(a \cdot 4\right)\right)\right)}\right)}}} \]
      4. /-rgt-identity15.8%

        \[\leadsto \frac{1}{\color{blue}{a} \cdot \frac{2}{\mathsf{fma}\left(-1, b, \sqrt{\mathsf{fma}\left(a, c \cdot -8, \mathsf{fma}\left(b, b, c \cdot \left(a \cdot 4\right)\right)\right)}\right)}} \]
      5. fma-udef15.8%

        \[\leadsto \frac{1}{a \cdot \frac{2}{\color{blue}{-1 \cdot b + \sqrt{\mathsf{fma}\left(a, c \cdot -8, \mathsf{fma}\left(b, b, c \cdot \left(a \cdot 4\right)\right)\right)}}}} \]
      6. *-commutative15.8%

        \[\leadsto \frac{1}{a \cdot \frac{2}{\color{blue}{b \cdot -1} + \sqrt{\mathsf{fma}\left(a, c \cdot -8, \mathsf{fma}\left(b, b, c \cdot \left(a \cdot 4\right)\right)\right)}}} \]
      7. fma-def15.8%

        \[\leadsto \frac{1}{a \cdot \frac{2}{\color{blue}{\mathsf{fma}\left(b, -1, \sqrt{\mathsf{fma}\left(a, c \cdot -8, \mathsf{fma}\left(b, b, c \cdot \left(a \cdot 4\right)\right)\right)}\right)}}} \]
      8. fma-def15.8%

        \[\leadsto \frac{1}{a \cdot \frac{2}{\mathsf{fma}\left(b, -1, \sqrt{\color{blue}{a \cdot \left(c \cdot -8\right) + \mathsf{fma}\left(b, b, c \cdot \left(a \cdot 4\right)\right)}}\right)}} \]
      9. associate-*r*15.8%

        \[\leadsto \frac{1}{a \cdot \frac{2}{\mathsf{fma}\left(b, -1, \sqrt{\color{blue}{\left(a \cdot c\right) \cdot -8} + \mathsf{fma}\left(b, b, c \cdot \left(a \cdot 4\right)\right)}\right)}} \]
      10. *-commutative15.8%

        \[\leadsto \frac{1}{a \cdot \frac{2}{\mathsf{fma}\left(b, -1, \sqrt{\color{blue}{-8 \cdot \left(a \cdot c\right)} + \mathsf{fma}\left(b, b, c \cdot \left(a \cdot 4\right)\right)}\right)}} \]
      11. fma-udef15.8%

        \[\leadsto \frac{1}{a \cdot \frac{2}{\mathsf{fma}\left(b, -1, \sqrt{-8 \cdot \left(a \cdot c\right) + \color{blue}{\left(b \cdot b + c \cdot \left(a \cdot 4\right)\right)}}\right)}} \]
      12. unpow215.8%

        \[\leadsto \frac{1}{a \cdot \frac{2}{\mathsf{fma}\left(b, -1, \sqrt{-8 \cdot \left(a \cdot c\right) + \left(\color{blue}{{b}^{2}} + c \cdot \left(a \cdot 4\right)\right)}\right)}} \]
      13. associate-*r*15.8%

        \[\leadsto \frac{1}{a \cdot \frac{2}{\mathsf{fma}\left(b, -1, \sqrt{-8 \cdot \left(a \cdot c\right) + \left({b}^{2} + \color{blue}{\left(c \cdot a\right) \cdot 4}\right)}\right)}} \]
      14. *-commutative15.8%

        \[\leadsto \frac{1}{a \cdot \frac{2}{\mathsf{fma}\left(b, -1, \sqrt{-8 \cdot \left(a \cdot c\right) + \left({b}^{2} + \color{blue}{\left(a \cdot c\right)} \cdot 4\right)}\right)}} \]
      15. *-commutative15.8%

        \[\leadsto \frac{1}{a \cdot \frac{2}{\mathsf{fma}\left(b, -1, \sqrt{-8 \cdot \left(a \cdot c\right) + \left({b}^{2} + \color{blue}{4 \cdot \left(a \cdot c\right)}\right)}\right)}} \]
      16. +-commutative15.8%

        \[\leadsto \frac{1}{a \cdot \frac{2}{\mathsf{fma}\left(b, -1, \sqrt{-8 \cdot \left(a \cdot c\right) + \color{blue}{\left(4 \cdot \left(a \cdot c\right) + {b}^{2}\right)}}\right)}} \]
    14. Simplified16.1%

      \[\leadsto \color{blue}{\frac{1}{a \cdot \frac{2}{\mathsf{fma}\left(b, -1, \sqrt{\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)}\right)}}} \]
    15. Taylor expanded in b around inf 83.0%

      \[\leadsto \frac{1}{\color{blue}{-1 \cdot \frac{b}{c} + \frac{a}{b}}} \]
    16. Step-by-step derivation
      1. +-commutative83.0%

        \[\leadsto \frac{1}{\color{blue}{\frac{a}{b} + -1 \cdot \frac{b}{c}}} \]
      2. mul-1-neg83.0%

        \[\leadsto \frac{1}{\frac{a}{b} + \color{blue}{\left(-\frac{b}{c}\right)}} \]
      3. unsub-neg83.0%

        \[\leadsto \frac{1}{\color{blue}{\frac{a}{b} - \frac{b}{c}}} \]
    17. Simplified83.0%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -8.6 \cdot 10^{+38}:\\ \;\;\;\;\frac{c}{b} - \frac{b}{a}\\ \mathbf{elif}\;b \leq -7.2 \cdot 10^{+14}:\\ \;\;\;\;0.5 \cdot \frac{\sqrt{c \cdot \left(a \cdot -4\right)}}{a}\\ \mathbf{elif}\;b \leq -1.3 \cdot 10^{-8}:\\ \;\;\;\;\frac{c}{b} - \frac{b}{a}\\ \mathbf{elif}\;b \leq 2.55 \cdot 10^{-51}:\\ \;\;\;\;0.5 \cdot \frac{\sqrt{c \cdot \left(a \cdot -4\right)}}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\frac{a}{b} - \frac{b}{c}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 68.3% accurate, 10.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq -5 \cdot 10^{-310}:\\ \;\;\;\;\frac{c}{b} - \frac{b}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\frac{a}{b} - \frac{b}{c}}\\ \end{array} \end{array} \]
(FPCore (a b c)
 :precision binary64
 (if (<= b -5e-310) (- (/ c b) (/ b a)) (/ 1.0 (- (/ a b) (/ b c)))))
double code(double a, double b, double c) {
	double tmp;
	if (b <= -5e-310) {
		tmp = (c / b) - (b / a);
	} else {
		tmp = 1.0 / ((a / b) - (b / c));
	}
	return tmp;
}
real(8) function code(a, b, c)
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8) :: tmp
    if (b <= (-5d-310)) then
        tmp = (c / b) - (b / a)
    else
        tmp = 1.0d0 / ((a / b) - (b / c))
    end if
    code = tmp
end function
public static double code(double a, double b, double c) {
	double tmp;
	if (b <= -5e-310) {
		tmp = (c / b) - (b / a);
	} else {
		tmp = 1.0 / ((a / b) - (b / c));
	}
	return tmp;
}
def code(a, b, c):
	tmp = 0
	if b <= -5e-310:
		tmp = (c / b) - (b / a)
	else:
		tmp = 1.0 / ((a / b) - (b / c))
	return tmp
function code(a, b, c)
	tmp = 0.0
	if (b <= -5e-310)
		tmp = Float64(Float64(c / b) - Float64(b / a));
	else
		tmp = Float64(1.0 / Float64(Float64(a / b) - Float64(b / c)));
	end
	return tmp
end
function tmp_2 = code(a, b, c)
	tmp = 0.0;
	if (b <= -5e-310)
		tmp = (c / b) - (b / a);
	else
		tmp = 1.0 / ((a / b) - (b / c));
	end
	tmp_2 = tmp;
end
code[a_, b_, c_] := If[LessEqual[b, -5e-310], N[(N[(c / b), $MachinePrecision] - N[(b / a), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(N[(a / b), $MachinePrecision] - N[(b / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;b \leq -5 \cdot 10^{-310}:\\
\;\;\;\;\frac{c}{b} - \frac{b}{a}\\

\mathbf{else}:\\
\;\;\;\;\frac{1}{\frac{a}{b} - \frac{b}{c}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if b < -4.999999999999985e-310

    1. Initial program 74.5%

      \[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a} \]
    2. Step-by-step derivation
      1. *-commutative74.5%

        \[\leadsto \frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{\color{blue}{a \cdot 2}} \]
    3. Simplified74.5%

      \[\leadsto \color{blue}{\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{a \cdot 2}} \]
    4. Add Preprocessing
    5. Taylor expanded in b around -inf 62.3%

      \[\leadsto \color{blue}{-1 \cdot \frac{b}{a} + \frac{c}{b}} \]
    6. Step-by-step derivation
      1. +-commutative62.3%

        \[\leadsto \color{blue}{\frac{c}{b} + -1 \cdot \frac{b}{a}} \]
      2. mul-1-neg62.3%

        \[\leadsto \frac{c}{b} + \color{blue}{\left(-\frac{b}{a}\right)} \]
      3. unsub-neg62.3%

        \[\leadsto \color{blue}{\frac{c}{b} - \frac{b}{a}} \]
    7. Simplified62.3%

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

    if -4.999999999999985e-310 < b

    1. Initial program 33.6%

      \[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a} \]
    2. Step-by-step derivation
      1. *-commutative33.6%

        \[\leadsto \frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{\color{blue}{a \cdot 2}} \]
    3. Simplified33.6%

      \[\leadsto \color{blue}{\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{a \cdot 2}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. prod-diff33.2%

        \[\leadsto \frac{\left(-b\right) + \sqrt{\color{blue}{\mathsf{fma}\left(b, b, -c \cdot \left(4 \cdot a\right)\right) + \mathsf{fma}\left(-c, 4 \cdot a, c \cdot \left(4 \cdot a\right)\right)}}}{a \cdot 2} \]
      2. *-commutative33.2%

        \[\leadsto \frac{\left(-b\right) + \sqrt{\mathsf{fma}\left(b, b, -\color{blue}{\left(4 \cdot a\right) \cdot c}\right) + \mathsf{fma}\left(-c, 4 \cdot a, c \cdot \left(4 \cdot a\right)\right)}}{a \cdot 2} \]
      3. fma-def33.2%

        \[\leadsto \frac{\left(-b\right) + \sqrt{\color{blue}{\left(b \cdot b + \left(-\left(4 \cdot a\right) \cdot c\right)\right)} + \mathsf{fma}\left(-c, 4 \cdot a, c \cdot \left(4 \cdot a\right)\right)}}{a \cdot 2} \]
      4. associate-+l+33.2%

        \[\leadsto \frac{\left(-b\right) + \sqrt{\color{blue}{b \cdot b + \left(\left(-\left(4 \cdot a\right) \cdot c\right) + \mathsf{fma}\left(-c, 4 \cdot a, c \cdot \left(4 \cdot a\right)\right)\right)}}}{a \cdot 2} \]
      5. pow233.2%

        \[\leadsto \frac{\left(-b\right) + \sqrt{\color{blue}{{b}^{2}} + \left(\left(-\left(4 \cdot a\right) \cdot c\right) + \mathsf{fma}\left(-c, 4 \cdot a, c \cdot \left(4 \cdot a\right)\right)\right)}}{a \cdot 2} \]
      6. distribute-lft-neg-in33.2%

        \[\leadsto \frac{\left(-b\right) + \sqrt{{b}^{2} + \left(\color{blue}{\left(-4 \cdot a\right) \cdot c} + \mathsf{fma}\left(-c, 4 \cdot a, c \cdot \left(4 \cdot a\right)\right)\right)}}{a \cdot 2} \]
      7. *-commutative33.2%

        \[\leadsto \frac{\left(-b\right) + \sqrt{{b}^{2} + \left(\left(-\color{blue}{a \cdot 4}\right) \cdot c + \mathsf{fma}\left(-c, 4 \cdot a, c \cdot \left(4 \cdot a\right)\right)\right)}}{a \cdot 2} \]
      8. distribute-rgt-neg-in33.2%

        \[\leadsto \frac{\left(-b\right) + \sqrt{{b}^{2} + \left(\color{blue}{\left(a \cdot \left(-4\right)\right)} \cdot c + \mathsf{fma}\left(-c, 4 \cdot a, c \cdot \left(4 \cdot a\right)\right)\right)}}{a \cdot 2} \]
      9. metadata-eval33.2%

        \[\leadsto \frac{\left(-b\right) + \sqrt{{b}^{2} + \left(\left(a \cdot \color{blue}{-4}\right) \cdot c + \mathsf{fma}\left(-c, 4 \cdot a, c \cdot \left(4 \cdot a\right)\right)\right)}}{a \cdot 2} \]
      10. associate-*r*33.2%

        \[\leadsto \frac{\left(-b\right) + \sqrt{{b}^{2} + \left(\color{blue}{a \cdot \left(-4 \cdot c\right)} + \mathsf{fma}\left(-c, 4 \cdot a, c \cdot \left(4 \cdot a\right)\right)\right)}}{a \cdot 2} \]
      11. *-commutative33.2%

        \[\leadsto \frac{\left(-b\right) + \sqrt{{b}^{2} + \left(a \cdot \color{blue}{\left(c \cdot -4\right)} + \mathsf{fma}\left(-c, 4 \cdot a, c \cdot \left(4 \cdot a\right)\right)\right)}}{a \cdot 2} \]
      12. *-commutative33.2%

        \[\leadsto \frac{\left(-b\right) + \sqrt{{b}^{2} + \left(a \cdot \left(c \cdot -4\right) + \mathsf{fma}\left(-c, 4 \cdot a, \color{blue}{\left(4 \cdot a\right) \cdot c}\right)\right)}}{a \cdot 2} \]
      13. fma-udef33.2%

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

      \[\leadsto \frac{\left(-b\right) + \sqrt{\color{blue}{{b}^{2} + \left(a \cdot \left(c \cdot -4\right) + \left(a \cdot \left(c \cdot -4\right) + \left(c \cdot 4\right) \cdot a\right)\right)}}}{a \cdot 2} \]
    7. Step-by-step derivation
      1. +-commutative33.2%

        \[\leadsto \frac{\left(-b\right) + \sqrt{\color{blue}{\left(a \cdot \left(c \cdot -4\right) + \left(a \cdot \left(c \cdot -4\right) + \left(c \cdot 4\right) \cdot a\right)\right) + {b}^{2}}}}{a \cdot 2} \]
      2. associate-+r+33.2%

        \[\leadsto \frac{\left(-b\right) + \sqrt{\color{blue}{\left(\left(a \cdot \left(c \cdot -4\right) + a \cdot \left(c \cdot -4\right)\right) + \left(c \cdot 4\right) \cdot a\right)} + {b}^{2}}}{a \cdot 2} \]
      3. associate-+l+33.2%

        \[\leadsto \frac{\left(-b\right) + \sqrt{\color{blue}{\left(a \cdot \left(c \cdot -4\right) + a \cdot \left(c \cdot -4\right)\right) + \left(\left(c \cdot 4\right) \cdot a + {b}^{2}\right)}}}{a \cdot 2} \]
      4. associate-*r*33.2%

        \[\leadsto \frac{\left(-b\right) + \sqrt{\left(\color{blue}{\left(a \cdot c\right) \cdot -4} + a \cdot \left(c \cdot -4\right)\right) + \left(\left(c \cdot 4\right) \cdot a + {b}^{2}\right)}}{a \cdot 2} \]
      5. associate-*r*33.2%

        \[\leadsto \frac{\left(-b\right) + \sqrt{\left(\left(a \cdot c\right) \cdot -4 + \color{blue}{\left(a \cdot c\right) \cdot -4}\right) + \left(\left(c \cdot 4\right) \cdot a + {b}^{2}\right)}}{a \cdot 2} \]
      6. distribute-lft-out33.2%

        \[\leadsto \frac{\left(-b\right) + \sqrt{\color{blue}{\left(a \cdot c\right) \cdot \left(-4 + -4\right)} + \left(\left(c \cdot 4\right) \cdot a + {b}^{2}\right)}}{a \cdot 2} \]
      7. metadata-eval33.2%

        \[\leadsto \frac{\left(-b\right) + \sqrt{\left(a \cdot c\right) \cdot \color{blue}{-8} + \left(\left(c \cdot 4\right) \cdot a + {b}^{2}\right)}}{a \cdot 2} \]
      8. +-commutative33.2%

        \[\leadsto \frac{\left(-b\right) + \sqrt{\left(a \cdot c\right) \cdot -8 + \color{blue}{\left({b}^{2} + \left(c \cdot 4\right) \cdot a\right)}}}{a \cdot 2} \]
      9. unpow233.2%

        \[\leadsto \frac{\left(-b\right) + \sqrt{\left(a \cdot c\right) \cdot -8 + \left(\color{blue}{b \cdot b} + \left(c \cdot 4\right) \cdot a\right)}}{a \cdot 2} \]
      10. fma-udef33.2%

        \[\leadsto \frac{\left(-b\right) + \sqrt{\left(a \cdot c\right) \cdot -8 + \color{blue}{\mathsf{fma}\left(b, b, \left(c \cdot 4\right) \cdot a\right)}}}{a \cdot 2} \]
      11. associate-*l*33.2%

        \[\leadsto \frac{\left(-b\right) + \sqrt{\left(a \cdot c\right) \cdot -8 + \mathsf{fma}\left(b, b, \color{blue}{c \cdot \left(4 \cdot a\right)}\right)}}{a \cdot 2} \]
      12. *-commutative33.2%

        \[\leadsto \frac{\left(-b\right) + \sqrt{\left(a \cdot c\right) \cdot -8 + \mathsf{fma}\left(b, b, c \cdot \color{blue}{\left(a \cdot 4\right)}\right)}}{a \cdot 2} \]
    8. Simplified33.2%

      \[\leadsto \frac{\left(-b\right) + \sqrt{\color{blue}{\left(a \cdot c\right) \cdot -8 + \mathsf{fma}\left(b, b, c \cdot \left(a \cdot 4\right)\right)}}}{a \cdot 2} \]
    9. Step-by-step derivation
      1. associate-*l*33.2%

        \[\leadsto \frac{\left(-b\right) + \sqrt{\color{blue}{a \cdot \left(c \cdot -8\right)} + \mathsf{fma}\left(b, b, c \cdot \left(a \cdot 4\right)\right)}}{a \cdot 2} \]
      2. fma-def33.2%

        \[\leadsto \frac{\left(-b\right) + \sqrt{\color{blue}{\mathsf{fma}\left(a, c \cdot -8, \mathsf{fma}\left(b, b, c \cdot \left(a \cdot 4\right)\right)\right)}}}{a \cdot 2} \]
    10. Applied egg-rr33.2%

      \[\leadsto \frac{\left(-b\right) + \sqrt{\color{blue}{\mathsf{fma}\left(a, c \cdot -8, \mathsf{fma}\left(b, b, c \cdot \left(a \cdot 4\right)\right)\right)}}}{a \cdot 2} \]
    11. Step-by-step derivation
      1. clear-num33.1%

        \[\leadsto \color{blue}{\frac{1}{\frac{a \cdot 2}{\left(-b\right) + \sqrt{\mathsf{fma}\left(a, c \cdot -8, \mathsf{fma}\left(b, b, c \cdot \left(a \cdot 4\right)\right)\right)}}}} \]
      2. inv-pow33.1%

        \[\leadsto \color{blue}{{\left(\frac{a \cdot 2}{\left(-b\right) + \sqrt{\mathsf{fma}\left(a, c \cdot -8, \mathsf{fma}\left(b, b, c \cdot \left(a \cdot 4\right)\right)\right)}}\right)}^{-1}} \]
      3. neg-mul-133.1%

        \[\leadsto {\left(\frac{a \cdot 2}{\color{blue}{-1 \cdot b} + \sqrt{\mathsf{fma}\left(a, c \cdot -8, \mathsf{fma}\left(b, b, c \cdot \left(a \cdot 4\right)\right)\right)}}\right)}^{-1} \]
      4. fma-def33.1%

        \[\leadsto {\left(\frac{a \cdot 2}{\color{blue}{\mathsf{fma}\left(-1, b, \sqrt{\mathsf{fma}\left(a, c \cdot -8, \mathsf{fma}\left(b, b, c \cdot \left(a \cdot 4\right)\right)\right)}\right)}}\right)}^{-1} \]
    12. Applied egg-rr33.1%

      \[\leadsto \color{blue}{{\left(\frac{a \cdot 2}{\mathsf{fma}\left(-1, b, \sqrt{\mathsf{fma}\left(a, c \cdot -8, \mathsf{fma}\left(b, b, c \cdot \left(a \cdot 4\right)\right)\right)}\right)}\right)}^{-1}} \]
    13. Step-by-step derivation
      1. unpow-133.1%

        \[\leadsto \color{blue}{\frac{1}{\frac{a \cdot 2}{\mathsf{fma}\left(-1, b, \sqrt{\mathsf{fma}\left(a, c \cdot -8, \mathsf{fma}\left(b, b, c \cdot \left(a \cdot 4\right)\right)\right)}\right)}}} \]
      2. *-lft-identity33.1%

        \[\leadsto \frac{1}{\frac{a \cdot 2}{\color{blue}{1 \cdot \mathsf{fma}\left(-1, b, \sqrt{\mathsf{fma}\left(a, c \cdot -8, \mathsf{fma}\left(b, b, c \cdot \left(a \cdot 4\right)\right)\right)}\right)}}} \]
      3. times-frac33.1%

        \[\leadsto \frac{1}{\color{blue}{\frac{a}{1} \cdot \frac{2}{\mathsf{fma}\left(-1, b, \sqrt{\mathsf{fma}\left(a, c \cdot -8, \mathsf{fma}\left(b, b, c \cdot \left(a \cdot 4\right)\right)\right)}\right)}}} \]
      4. /-rgt-identity33.1%

        \[\leadsto \frac{1}{\color{blue}{a} \cdot \frac{2}{\mathsf{fma}\left(-1, b, \sqrt{\mathsf{fma}\left(a, c \cdot -8, \mathsf{fma}\left(b, b, c \cdot \left(a \cdot 4\right)\right)\right)}\right)}} \]
      5. fma-udef33.1%

        \[\leadsto \frac{1}{a \cdot \frac{2}{\color{blue}{-1 \cdot b + \sqrt{\mathsf{fma}\left(a, c \cdot -8, \mathsf{fma}\left(b, b, c \cdot \left(a \cdot 4\right)\right)\right)}}}} \]
      6. *-commutative33.1%

        \[\leadsto \frac{1}{a \cdot \frac{2}{\color{blue}{b \cdot -1} + \sqrt{\mathsf{fma}\left(a, c \cdot -8, \mathsf{fma}\left(b, b, c \cdot \left(a \cdot 4\right)\right)\right)}}} \]
      7. fma-def33.1%

        \[\leadsto \frac{1}{a \cdot \frac{2}{\color{blue}{\mathsf{fma}\left(b, -1, \sqrt{\mathsf{fma}\left(a, c \cdot -8, \mathsf{fma}\left(b, b, c \cdot \left(a \cdot 4\right)\right)\right)}\right)}}} \]
      8. fma-def33.2%

        \[\leadsto \frac{1}{a \cdot \frac{2}{\mathsf{fma}\left(b, -1, \sqrt{\color{blue}{a \cdot \left(c \cdot -8\right) + \mathsf{fma}\left(b, b, c \cdot \left(a \cdot 4\right)\right)}}\right)}} \]
      9. associate-*r*33.2%

        \[\leadsto \frac{1}{a \cdot \frac{2}{\mathsf{fma}\left(b, -1, \sqrt{\color{blue}{\left(a \cdot c\right) \cdot -8} + \mathsf{fma}\left(b, b, c \cdot \left(a \cdot 4\right)\right)}\right)}} \]
      10. *-commutative33.2%

        \[\leadsto \frac{1}{a \cdot \frac{2}{\mathsf{fma}\left(b, -1, \sqrt{\color{blue}{-8 \cdot \left(a \cdot c\right)} + \mathsf{fma}\left(b, b, c \cdot \left(a \cdot 4\right)\right)}\right)}} \]
      11. fma-udef33.1%

        \[\leadsto \frac{1}{a \cdot \frac{2}{\mathsf{fma}\left(b, -1, \sqrt{-8 \cdot \left(a \cdot c\right) + \color{blue}{\left(b \cdot b + c \cdot \left(a \cdot 4\right)\right)}}\right)}} \]
      12. unpow233.1%

        \[\leadsto \frac{1}{a \cdot \frac{2}{\mathsf{fma}\left(b, -1, \sqrt{-8 \cdot \left(a \cdot c\right) + \left(\color{blue}{{b}^{2}} + c \cdot \left(a \cdot 4\right)\right)}\right)}} \]
      13. associate-*r*33.1%

        \[\leadsto \frac{1}{a \cdot \frac{2}{\mathsf{fma}\left(b, -1, \sqrt{-8 \cdot \left(a \cdot c\right) + \left({b}^{2} + \color{blue}{\left(c \cdot a\right) \cdot 4}\right)}\right)}} \]
      14. *-commutative33.1%

        \[\leadsto \frac{1}{a \cdot \frac{2}{\mathsf{fma}\left(b, -1, \sqrt{-8 \cdot \left(a \cdot c\right) + \left({b}^{2} + \color{blue}{\left(a \cdot c\right)} \cdot 4\right)}\right)}} \]
      15. *-commutative33.1%

        \[\leadsto \frac{1}{a \cdot \frac{2}{\mathsf{fma}\left(b, -1, \sqrt{-8 \cdot \left(a \cdot c\right) + \left({b}^{2} + \color{blue}{4 \cdot \left(a \cdot c\right)}\right)}\right)}} \]
      16. +-commutative33.1%

        \[\leadsto \frac{1}{a \cdot \frac{2}{\mathsf{fma}\left(b, -1, \sqrt{-8 \cdot \left(a \cdot c\right) + \color{blue}{\left(4 \cdot \left(a \cdot c\right) + {b}^{2}\right)}}\right)}} \]
    14. Simplified33.5%

      \[\leadsto \color{blue}{\frac{1}{a \cdot \frac{2}{\mathsf{fma}\left(b, -1, \sqrt{\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)}\right)}}} \]
    15. Taylor expanded in b around inf 63.4%

      \[\leadsto \frac{1}{\color{blue}{-1 \cdot \frac{b}{c} + \frac{a}{b}}} \]
    16. Step-by-step derivation
      1. +-commutative63.4%

        \[\leadsto \frac{1}{\color{blue}{\frac{a}{b} + -1 \cdot \frac{b}{c}}} \]
      2. mul-1-neg63.4%

        \[\leadsto \frac{1}{\frac{a}{b} + \color{blue}{\left(-\frac{b}{c}\right)}} \]
      3. unsub-neg63.4%

        \[\leadsto \frac{1}{\color{blue}{\frac{a}{b} - \frac{b}{c}}} \]
    17. Simplified63.4%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -5 \cdot 10^{-310}:\\ \;\;\;\;\frac{c}{b} - \frac{b}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\frac{a}{b} - \frac{b}{c}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 68.6% accurate, 12.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq -5 \cdot 10^{-310}:\\ \;\;\;\;\frac{c}{b} - \frac{b}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{-c}{b}\\ \end{array} \end{array} \]
(FPCore (a b c)
 :precision binary64
 (if (<= b -5e-310) (- (/ c b) (/ b a)) (/ (- c) b)))
double code(double a, double b, double c) {
	double tmp;
	if (b <= -5e-310) {
		tmp = (c / b) - (b / a);
	} else {
		tmp = -c / b;
	}
	return tmp;
}
real(8) function code(a, b, c)
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8) :: tmp
    if (b <= (-5d-310)) then
        tmp = (c / b) - (b / a)
    else
        tmp = -c / b
    end if
    code = tmp
end function
public static double code(double a, double b, double c) {
	double tmp;
	if (b <= -5e-310) {
		tmp = (c / b) - (b / a);
	} else {
		tmp = -c / b;
	}
	return tmp;
}
def code(a, b, c):
	tmp = 0
	if b <= -5e-310:
		tmp = (c / b) - (b / a)
	else:
		tmp = -c / b
	return tmp
function code(a, b, c)
	tmp = 0.0
	if (b <= -5e-310)
		tmp = Float64(Float64(c / b) - Float64(b / a));
	else
		tmp = Float64(Float64(-c) / b);
	end
	return tmp
end
function tmp_2 = code(a, b, c)
	tmp = 0.0;
	if (b <= -5e-310)
		tmp = (c / b) - (b / a);
	else
		tmp = -c / b;
	end
	tmp_2 = tmp;
end
code[a_, b_, c_] := If[LessEqual[b, -5e-310], N[(N[(c / b), $MachinePrecision] - N[(b / a), $MachinePrecision]), $MachinePrecision], N[((-c) / b), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;b \leq -5 \cdot 10^{-310}:\\
\;\;\;\;\frac{c}{b} - \frac{b}{a}\\

\mathbf{else}:\\
\;\;\;\;\frac{-c}{b}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if b < -4.999999999999985e-310

    1. Initial program 74.5%

      \[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a} \]
    2. Step-by-step derivation
      1. *-commutative74.5%

        \[\leadsto \frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{\color{blue}{a \cdot 2}} \]
    3. Simplified74.5%

      \[\leadsto \color{blue}{\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{a \cdot 2}} \]
    4. Add Preprocessing
    5. Taylor expanded in b around -inf 62.3%

      \[\leadsto \color{blue}{-1 \cdot \frac{b}{a} + \frac{c}{b}} \]
    6. Step-by-step derivation
      1. +-commutative62.3%

        \[\leadsto \color{blue}{\frac{c}{b} + -1 \cdot \frac{b}{a}} \]
      2. mul-1-neg62.3%

        \[\leadsto \frac{c}{b} + \color{blue}{\left(-\frac{b}{a}\right)} \]
      3. unsub-neg62.3%

        \[\leadsto \color{blue}{\frac{c}{b} - \frac{b}{a}} \]
    7. Simplified62.3%

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

    if -4.999999999999985e-310 < b

    1. Initial program 33.6%

      \[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a} \]
    2. Step-by-step derivation
      1. *-commutative33.6%

        \[\leadsto \frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{\color{blue}{a \cdot 2}} \]
    3. Simplified33.6%

      \[\leadsto \color{blue}{\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{a \cdot 2}} \]
    4. Add Preprocessing
    5. Taylor expanded in b around inf 63.2%

      \[\leadsto \color{blue}{-1 \cdot \frac{c}{b}} \]
    6. Step-by-step derivation
      1. mul-1-neg63.2%

        \[\leadsto \color{blue}{-\frac{c}{b}} \]
      2. distribute-neg-frac63.2%

        \[\leadsto \color{blue}{\frac{-c}{b}} \]
    7. Simplified63.2%

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

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

Alternative 6: 45.1% accurate, 19.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq -5 \cdot 10^{-310}:\\ \;\;\;\;\frac{-b}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{0}{a}\\ \end{array} \end{array} \]
(FPCore (a b c) :precision binary64 (if (<= b -5e-310) (/ (- b) a) (/ 0.0 a)))
double code(double a, double b, double c) {
	double tmp;
	if (b <= -5e-310) {
		tmp = -b / a;
	} else {
		tmp = 0.0 / a;
	}
	return tmp;
}
real(8) function code(a, b, c)
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8) :: tmp
    if (b <= (-5d-310)) then
        tmp = -b / a
    else
        tmp = 0.0d0 / a
    end if
    code = tmp
end function
public static double code(double a, double b, double c) {
	double tmp;
	if (b <= -5e-310) {
		tmp = -b / a;
	} else {
		tmp = 0.0 / a;
	}
	return tmp;
}
def code(a, b, c):
	tmp = 0
	if b <= -5e-310:
		tmp = -b / a
	else:
		tmp = 0.0 / a
	return tmp
function code(a, b, c)
	tmp = 0.0
	if (b <= -5e-310)
		tmp = Float64(Float64(-b) / a);
	else
		tmp = Float64(0.0 / a);
	end
	return tmp
end
function tmp_2 = code(a, b, c)
	tmp = 0.0;
	if (b <= -5e-310)
		tmp = -b / a;
	else
		tmp = 0.0 / a;
	end
	tmp_2 = tmp;
end
code[a_, b_, c_] := If[LessEqual[b, -5e-310], N[((-b) / a), $MachinePrecision], N[(0.0 / a), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;b \leq -5 \cdot 10^{-310}:\\
\;\;\;\;\frac{-b}{a}\\

\mathbf{else}:\\
\;\;\;\;\frac{0}{a}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if b < -4.999999999999985e-310

    1. Initial program 74.5%

      \[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a} \]
    2. Step-by-step derivation
      1. *-commutative74.5%

        \[\leadsto \frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{\color{blue}{a \cdot 2}} \]
    3. Simplified74.5%

      \[\leadsto \color{blue}{\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{a \cdot 2}} \]
    4. Add Preprocessing
    5. Taylor expanded in b around -inf 62.0%

      \[\leadsto \color{blue}{-1 \cdot \frac{b}{a}} \]
    6. Step-by-step derivation
      1. associate-*r/62.0%

        \[\leadsto \color{blue}{\frac{-1 \cdot b}{a}} \]
      2. mul-1-neg62.0%

        \[\leadsto \frac{\color{blue}{-b}}{a} \]
    7. Simplified62.0%

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

    if -4.999999999999985e-310 < b

    1. Initial program 33.6%

      \[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a} \]
    2. Step-by-step derivation
      1. *-commutative33.6%

        \[\leadsto \frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{\color{blue}{a \cdot 2}} \]
    3. Simplified33.6%

      \[\leadsto \color{blue}{\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{a \cdot 2}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. prod-diff33.2%

        \[\leadsto \frac{\left(-b\right) + \sqrt{\color{blue}{\mathsf{fma}\left(b, b, -c \cdot \left(4 \cdot a\right)\right) + \mathsf{fma}\left(-c, 4 \cdot a, c \cdot \left(4 \cdot a\right)\right)}}}{a \cdot 2} \]
      2. *-commutative33.2%

        \[\leadsto \frac{\left(-b\right) + \sqrt{\mathsf{fma}\left(b, b, -\color{blue}{\left(4 \cdot a\right) \cdot c}\right) + \mathsf{fma}\left(-c, 4 \cdot a, c \cdot \left(4 \cdot a\right)\right)}}{a \cdot 2} \]
      3. fma-def33.2%

        \[\leadsto \frac{\left(-b\right) + \sqrt{\color{blue}{\left(b \cdot b + \left(-\left(4 \cdot a\right) \cdot c\right)\right)} + \mathsf{fma}\left(-c, 4 \cdot a, c \cdot \left(4 \cdot a\right)\right)}}{a \cdot 2} \]
      4. associate-+l+33.2%

        \[\leadsto \frac{\left(-b\right) + \sqrt{\color{blue}{b \cdot b + \left(\left(-\left(4 \cdot a\right) \cdot c\right) + \mathsf{fma}\left(-c, 4 \cdot a, c \cdot \left(4 \cdot a\right)\right)\right)}}}{a \cdot 2} \]
      5. pow233.2%

        \[\leadsto \frac{\left(-b\right) + \sqrt{\color{blue}{{b}^{2}} + \left(\left(-\left(4 \cdot a\right) \cdot c\right) + \mathsf{fma}\left(-c, 4 \cdot a, c \cdot \left(4 \cdot a\right)\right)\right)}}{a \cdot 2} \]
      6. distribute-lft-neg-in33.2%

        \[\leadsto \frac{\left(-b\right) + \sqrt{{b}^{2} + \left(\color{blue}{\left(-4 \cdot a\right) \cdot c} + \mathsf{fma}\left(-c, 4 \cdot a, c \cdot \left(4 \cdot a\right)\right)\right)}}{a \cdot 2} \]
      7. *-commutative33.2%

        \[\leadsto \frac{\left(-b\right) + \sqrt{{b}^{2} + \left(\left(-\color{blue}{a \cdot 4}\right) \cdot c + \mathsf{fma}\left(-c, 4 \cdot a, c \cdot \left(4 \cdot a\right)\right)\right)}}{a \cdot 2} \]
      8. distribute-rgt-neg-in33.2%

        \[\leadsto \frac{\left(-b\right) + \sqrt{{b}^{2} + \left(\color{blue}{\left(a \cdot \left(-4\right)\right)} \cdot c + \mathsf{fma}\left(-c, 4 \cdot a, c \cdot \left(4 \cdot a\right)\right)\right)}}{a \cdot 2} \]
      9. metadata-eval33.2%

        \[\leadsto \frac{\left(-b\right) + \sqrt{{b}^{2} + \left(\left(a \cdot \color{blue}{-4}\right) \cdot c + \mathsf{fma}\left(-c, 4 \cdot a, c \cdot \left(4 \cdot a\right)\right)\right)}}{a \cdot 2} \]
      10. associate-*r*33.2%

        \[\leadsto \frac{\left(-b\right) + \sqrt{{b}^{2} + \left(\color{blue}{a \cdot \left(-4 \cdot c\right)} + \mathsf{fma}\left(-c, 4 \cdot a, c \cdot \left(4 \cdot a\right)\right)\right)}}{a \cdot 2} \]
      11. *-commutative33.2%

        \[\leadsto \frac{\left(-b\right) + \sqrt{{b}^{2} + \left(a \cdot \color{blue}{\left(c \cdot -4\right)} + \mathsf{fma}\left(-c, 4 \cdot a, c \cdot \left(4 \cdot a\right)\right)\right)}}{a \cdot 2} \]
      12. *-commutative33.2%

        \[\leadsto \frac{\left(-b\right) + \sqrt{{b}^{2} + \left(a \cdot \left(c \cdot -4\right) + \mathsf{fma}\left(-c, 4 \cdot a, \color{blue}{\left(4 \cdot a\right) \cdot c}\right)\right)}}{a \cdot 2} \]
      13. fma-udef33.2%

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

      \[\leadsto \frac{\left(-b\right) + \sqrt{\color{blue}{{b}^{2} + \left(a \cdot \left(c \cdot -4\right) + \left(a \cdot \left(c \cdot -4\right) + \left(c \cdot 4\right) \cdot a\right)\right)}}}{a \cdot 2} \]
    7. Step-by-step derivation
      1. +-commutative33.2%

        \[\leadsto \frac{\left(-b\right) + \sqrt{\color{blue}{\left(a \cdot \left(c \cdot -4\right) + \left(a \cdot \left(c \cdot -4\right) + \left(c \cdot 4\right) \cdot a\right)\right) + {b}^{2}}}}{a \cdot 2} \]
      2. associate-+r+33.2%

        \[\leadsto \frac{\left(-b\right) + \sqrt{\color{blue}{\left(\left(a \cdot \left(c \cdot -4\right) + a \cdot \left(c \cdot -4\right)\right) + \left(c \cdot 4\right) \cdot a\right)} + {b}^{2}}}{a \cdot 2} \]
      3. associate-+l+33.2%

        \[\leadsto \frac{\left(-b\right) + \sqrt{\color{blue}{\left(a \cdot \left(c \cdot -4\right) + a \cdot \left(c \cdot -4\right)\right) + \left(\left(c \cdot 4\right) \cdot a + {b}^{2}\right)}}}{a \cdot 2} \]
      4. associate-*r*33.2%

        \[\leadsto \frac{\left(-b\right) + \sqrt{\left(\color{blue}{\left(a \cdot c\right) \cdot -4} + a \cdot \left(c \cdot -4\right)\right) + \left(\left(c \cdot 4\right) \cdot a + {b}^{2}\right)}}{a \cdot 2} \]
      5. associate-*r*33.2%

        \[\leadsto \frac{\left(-b\right) + \sqrt{\left(\left(a \cdot c\right) \cdot -4 + \color{blue}{\left(a \cdot c\right) \cdot -4}\right) + \left(\left(c \cdot 4\right) \cdot a + {b}^{2}\right)}}{a \cdot 2} \]
      6. distribute-lft-out33.2%

        \[\leadsto \frac{\left(-b\right) + \sqrt{\color{blue}{\left(a \cdot c\right) \cdot \left(-4 + -4\right)} + \left(\left(c \cdot 4\right) \cdot a + {b}^{2}\right)}}{a \cdot 2} \]
      7. metadata-eval33.2%

        \[\leadsto \frac{\left(-b\right) + \sqrt{\left(a \cdot c\right) \cdot \color{blue}{-8} + \left(\left(c \cdot 4\right) \cdot a + {b}^{2}\right)}}{a \cdot 2} \]
      8. +-commutative33.2%

        \[\leadsto \frac{\left(-b\right) + \sqrt{\left(a \cdot c\right) \cdot -8 + \color{blue}{\left({b}^{2} + \left(c \cdot 4\right) \cdot a\right)}}}{a \cdot 2} \]
      9. unpow233.2%

        \[\leadsto \frac{\left(-b\right) + \sqrt{\left(a \cdot c\right) \cdot -8 + \left(\color{blue}{b \cdot b} + \left(c \cdot 4\right) \cdot a\right)}}{a \cdot 2} \]
      10. fma-udef33.2%

        \[\leadsto \frac{\left(-b\right) + \sqrt{\left(a \cdot c\right) \cdot -8 + \color{blue}{\mathsf{fma}\left(b, b, \left(c \cdot 4\right) \cdot a\right)}}}{a \cdot 2} \]
      11. associate-*l*33.2%

        \[\leadsto \frac{\left(-b\right) + \sqrt{\left(a \cdot c\right) \cdot -8 + \mathsf{fma}\left(b, b, \color{blue}{c \cdot \left(4 \cdot a\right)}\right)}}{a \cdot 2} \]
      12. *-commutative33.2%

        \[\leadsto \frac{\left(-b\right) + \sqrt{\left(a \cdot c\right) \cdot -8 + \mathsf{fma}\left(b, b, c \cdot \color{blue}{\left(a \cdot 4\right)}\right)}}{a \cdot 2} \]
    8. Simplified33.2%

      \[\leadsto \frac{\left(-b\right) + \sqrt{\color{blue}{\left(a \cdot c\right) \cdot -8 + \mathsf{fma}\left(b, b, c \cdot \left(a \cdot 4\right)\right)}}}{a \cdot 2} \]
    9. Step-by-step derivation
      1. associate-*l*33.2%

        \[\leadsto \frac{\left(-b\right) + \sqrt{\color{blue}{a \cdot \left(c \cdot -8\right)} + \mathsf{fma}\left(b, b, c \cdot \left(a \cdot 4\right)\right)}}{a \cdot 2} \]
      2. fma-def33.2%

        \[\leadsto \frac{\left(-b\right) + \sqrt{\color{blue}{\mathsf{fma}\left(a, c \cdot -8, \mathsf{fma}\left(b, b, c \cdot \left(a \cdot 4\right)\right)\right)}}}{a \cdot 2} \]
    10. Applied egg-rr33.2%

      \[\leadsto \frac{\left(-b\right) + \sqrt{\color{blue}{\mathsf{fma}\left(a, c \cdot -8, \mathsf{fma}\left(b, b, c \cdot \left(a \cdot 4\right)\right)\right)}}}{a \cdot 2} \]
    11. Step-by-step derivation
      1. clear-num33.1%

        \[\leadsto \color{blue}{\frac{1}{\frac{a \cdot 2}{\left(-b\right) + \sqrt{\mathsf{fma}\left(a, c \cdot -8, \mathsf{fma}\left(b, b, c \cdot \left(a \cdot 4\right)\right)\right)}}}} \]
      2. inv-pow33.1%

        \[\leadsto \color{blue}{{\left(\frac{a \cdot 2}{\left(-b\right) + \sqrt{\mathsf{fma}\left(a, c \cdot -8, \mathsf{fma}\left(b, b, c \cdot \left(a \cdot 4\right)\right)\right)}}\right)}^{-1}} \]
      3. neg-mul-133.1%

        \[\leadsto {\left(\frac{a \cdot 2}{\color{blue}{-1 \cdot b} + \sqrt{\mathsf{fma}\left(a, c \cdot -8, \mathsf{fma}\left(b, b, c \cdot \left(a \cdot 4\right)\right)\right)}}\right)}^{-1} \]
      4. fma-def33.1%

        \[\leadsto {\left(\frac{a \cdot 2}{\color{blue}{\mathsf{fma}\left(-1, b, \sqrt{\mathsf{fma}\left(a, c \cdot -8, \mathsf{fma}\left(b, b, c \cdot \left(a \cdot 4\right)\right)\right)}\right)}}\right)}^{-1} \]
    12. Applied egg-rr33.1%

      \[\leadsto \color{blue}{{\left(\frac{a \cdot 2}{\mathsf{fma}\left(-1, b, \sqrt{\mathsf{fma}\left(a, c \cdot -8, \mathsf{fma}\left(b, b, c \cdot \left(a \cdot 4\right)\right)\right)}\right)}\right)}^{-1}} \]
    13. Step-by-step derivation
      1. unpow-133.1%

        \[\leadsto \color{blue}{\frac{1}{\frac{a \cdot 2}{\mathsf{fma}\left(-1, b, \sqrt{\mathsf{fma}\left(a, c \cdot -8, \mathsf{fma}\left(b, b, c \cdot \left(a \cdot 4\right)\right)\right)}\right)}}} \]
      2. *-lft-identity33.1%

        \[\leadsto \frac{1}{\frac{a \cdot 2}{\color{blue}{1 \cdot \mathsf{fma}\left(-1, b, \sqrt{\mathsf{fma}\left(a, c \cdot -8, \mathsf{fma}\left(b, b, c \cdot \left(a \cdot 4\right)\right)\right)}\right)}}} \]
      3. times-frac33.1%

        \[\leadsto \frac{1}{\color{blue}{\frac{a}{1} \cdot \frac{2}{\mathsf{fma}\left(-1, b, \sqrt{\mathsf{fma}\left(a, c \cdot -8, \mathsf{fma}\left(b, b, c \cdot \left(a \cdot 4\right)\right)\right)}\right)}}} \]
      4. /-rgt-identity33.1%

        \[\leadsto \frac{1}{\color{blue}{a} \cdot \frac{2}{\mathsf{fma}\left(-1, b, \sqrt{\mathsf{fma}\left(a, c \cdot -8, \mathsf{fma}\left(b, b, c \cdot \left(a \cdot 4\right)\right)\right)}\right)}} \]
      5. fma-udef33.1%

        \[\leadsto \frac{1}{a \cdot \frac{2}{\color{blue}{-1 \cdot b + \sqrt{\mathsf{fma}\left(a, c \cdot -8, \mathsf{fma}\left(b, b, c \cdot \left(a \cdot 4\right)\right)\right)}}}} \]
      6. *-commutative33.1%

        \[\leadsto \frac{1}{a \cdot \frac{2}{\color{blue}{b \cdot -1} + \sqrt{\mathsf{fma}\left(a, c \cdot -8, \mathsf{fma}\left(b, b, c \cdot \left(a \cdot 4\right)\right)\right)}}} \]
      7. fma-def33.1%

        \[\leadsto \frac{1}{a \cdot \frac{2}{\color{blue}{\mathsf{fma}\left(b, -1, \sqrt{\mathsf{fma}\left(a, c \cdot -8, \mathsf{fma}\left(b, b, c \cdot \left(a \cdot 4\right)\right)\right)}\right)}}} \]
      8. fma-def33.2%

        \[\leadsto \frac{1}{a \cdot \frac{2}{\mathsf{fma}\left(b, -1, \sqrt{\color{blue}{a \cdot \left(c \cdot -8\right) + \mathsf{fma}\left(b, b, c \cdot \left(a \cdot 4\right)\right)}}\right)}} \]
      9. associate-*r*33.2%

        \[\leadsto \frac{1}{a \cdot \frac{2}{\mathsf{fma}\left(b, -1, \sqrt{\color{blue}{\left(a \cdot c\right) \cdot -8} + \mathsf{fma}\left(b, b, c \cdot \left(a \cdot 4\right)\right)}\right)}} \]
      10. *-commutative33.2%

        \[\leadsto \frac{1}{a \cdot \frac{2}{\mathsf{fma}\left(b, -1, \sqrt{\color{blue}{-8 \cdot \left(a \cdot c\right)} + \mathsf{fma}\left(b, b, c \cdot \left(a \cdot 4\right)\right)}\right)}} \]
      11. fma-udef33.1%

        \[\leadsto \frac{1}{a \cdot \frac{2}{\mathsf{fma}\left(b, -1, \sqrt{-8 \cdot \left(a \cdot c\right) + \color{blue}{\left(b \cdot b + c \cdot \left(a \cdot 4\right)\right)}}\right)}} \]
      12. unpow233.1%

        \[\leadsto \frac{1}{a \cdot \frac{2}{\mathsf{fma}\left(b, -1, \sqrt{-8 \cdot \left(a \cdot c\right) + \left(\color{blue}{{b}^{2}} + c \cdot \left(a \cdot 4\right)\right)}\right)}} \]
      13. associate-*r*33.1%

        \[\leadsto \frac{1}{a \cdot \frac{2}{\mathsf{fma}\left(b, -1, \sqrt{-8 \cdot \left(a \cdot c\right) + \left({b}^{2} + \color{blue}{\left(c \cdot a\right) \cdot 4}\right)}\right)}} \]
      14. *-commutative33.1%

        \[\leadsto \frac{1}{a \cdot \frac{2}{\mathsf{fma}\left(b, -1, \sqrt{-8 \cdot \left(a \cdot c\right) + \left({b}^{2} + \color{blue}{\left(a \cdot c\right)} \cdot 4\right)}\right)}} \]
      15. *-commutative33.1%

        \[\leadsto \frac{1}{a \cdot \frac{2}{\mathsf{fma}\left(b, -1, \sqrt{-8 \cdot \left(a \cdot c\right) + \left({b}^{2} + \color{blue}{4 \cdot \left(a \cdot c\right)}\right)}\right)}} \]
      16. +-commutative33.1%

        \[\leadsto \frac{1}{a \cdot \frac{2}{\mathsf{fma}\left(b, -1, \sqrt{-8 \cdot \left(a \cdot c\right) + \color{blue}{\left(4 \cdot \left(a \cdot c\right) + {b}^{2}\right)}}\right)}} \]
    14. Simplified33.5%

      \[\leadsto \color{blue}{\frac{1}{a \cdot \frac{2}{\mathsf{fma}\left(b, -1, \sqrt{\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)}\right)}}} \]
    15. Taylor expanded in a around 0 16.1%

      \[\leadsto \color{blue}{0.5 \cdot \frac{b + -1 \cdot b}{a}} \]
    16. Step-by-step derivation
      1. associate-*r/16.1%

        \[\leadsto \color{blue}{\frac{0.5 \cdot \left(b + -1 \cdot b\right)}{a}} \]
      2. distribute-rgt1-in16.1%

        \[\leadsto \frac{0.5 \cdot \color{blue}{\left(\left(-1 + 1\right) \cdot b\right)}}{a} \]
      3. metadata-eval16.1%

        \[\leadsto \frac{0.5 \cdot \left(\color{blue}{0} \cdot b\right)}{a} \]
      4. mul0-lft16.1%

        \[\leadsto \frac{0.5 \cdot \color{blue}{0}}{a} \]
      5. metadata-eval16.1%

        \[\leadsto \frac{\color{blue}{0}}{a} \]
    17. Simplified16.1%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -5 \cdot 10^{-310}:\\ \;\;\;\;\frac{-b}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{0}{a}\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 68.4% accurate, 19.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq 1.35 \cdot 10^{-290}:\\ \;\;\;\;\frac{-b}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{-c}{b}\\ \end{array} \end{array} \]
(FPCore (a b c)
 :precision binary64
 (if (<= b 1.35e-290) (/ (- b) a) (/ (- c) b)))
double code(double a, double b, double c) {
	double tmp;
	if (b <= 1.35e-290) {
		tmp = -b / a;
	} else {
		tmp = -c / b;
	}
	return tmp;
}
real(8) function code(a, b, c)
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8) :: tmp
    if (b <= 1.35d-290) then
        tmp = -b / a
    else
        tmp = -c / b
    end if
    code = tmp
end function
public static double code(double a, double b, double c) {
	double tmp;
	if (b <= 1.35e-290) {
		tmp = -b / a;
	} else {
		tmp = -c / b;
	}
	return tmp;
}
def code(a, b, c):
	tmp = 0
	if b <= 1.35e-290:
		tmp = -b / a
	else:
		tmp = -c / b
	return tmp
function code(a, b, c)
	tmp = 0.0
	if (b <= 1.35e-290)
		tmp = Float64(Float64(-b) / a);
	else
		tmp = Float64(Float64(-c) / b);
	end
	return tmp
end
function tmp_2 = code(a, b, c)
	tmp = 0.0;
	if (b <= 1.35e-290)
		tmp = -b / a;
	else
		tmp = -c / b;
	end
	tmp_2 = tmp;
end
code[a_, b_, c_] := If[LessEqual[b, 1.35e-290], N[((-b) / a), $MachinePrecision], N[((-c) / b), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;b \leq 1.35 \cdot 10^{-290}:\\
\;\;\;\;\frac{-b}{a}\\

\mathbf{else}:\\
\;\;\;\;\frac{-c}{b}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if b < 1.34999999999999999e-290

    1. Initial program 74.3%

      \[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a} \]
    2. Step-by-step derivation
      1. *-commutative74.3%

        \[\leadsto \frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{\color{blue}{a \cdot 2}} \]
    3. Simplified74.3%

      \[\leadsto \color{blue}{\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{a \cdot 2}} \]
    4. Add Preprocessing
    5. Taylor expanded in b around -inf 60.5%

      \[\leadsto \color{blue}{-1 \cdot \frac{b}{a}} \]
    6. Step-by-step derivation
      1. associate-*r/60.5%

        \[\leadsto \color{blue}{\frac{-1 \cdot b}{a}} \]
      2. mul-1-neg60.5%

        \[\leadsto \frac{\color{blue}{-b}}{a} \]
    7. Simplified60.5%

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

    if 1.34999999999999999e-290 < b

    1. Initial program 32.9%

      \[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a} \]
    2. Step-by-step derivation
      1. *-commutative32.9%

        \[\leadsto \frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{\color{blue}{a \cdot 2}} \]
    3. Simplified32.9%

      \[\leadsto \color{blue}{\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{a \cdot 2}} \]
    4. Add Preprocessing
    5. Taylor expanded in b around inf 64.5%

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

        \[\leadsto \color{blue}{-\frac{c}{b}} \]
      2. distribute-neg-frac64.5%

        \[\leadsto \color{blue}{\frac{-c}{b}} \]
    7. Simplified64.5%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq 1.35 \cdot 10^{-290}:\\ \;\;\;\;\frac{-b}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{-c}{b}\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 11.1% accurate, 38.7× speedup?

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

\\
\frac{0}{a}
\end{array}
Derivation
  1. Initial program 51.2%

    \[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a} \]
  2. Step-by-step derivation
    1. *-commutative51.2%

      \[\leadsto \frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{\color{blue}{a \cdot 2}} \]
  3. Simplified51.2%

    \[\leadsto \color{blue}{\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{a \cdot 2}} \]
  4. Add Preprocessing
  5. Step-by-step derivation
    1. prod-diff50.9%

      \[\leadsto \frac{\left(-b\right) + \sqrt{\color{blue}{\mathsf{fma}\left(b, b, -c \cdot \left(4 \cdot a\right)\right) + \mathsf{fma}\left(-c, 4 \cdot a, c \cdot \left(4 \cdot a\right)\right)}}}{a \cdot 2} \]
    2. *-commutative50.9%

      \[\leadsto \frac{\left(-b\right) + \sqrt{\mathsf{fma}\left(b, b, -\color{blue}{\left(4 \cdot a\right) \cdot c}\right) + \mathsf{fma}\left(-c, 4 \cdot a, c \cdot \left(4 \cdot a\right)\right)}}{a \cdot 2} \]
    3. fma-def50.9%

      \[\leadsto \frac{\left(-b\right) + \sqrt{\color{blue}{\left(b \cdot b + \left(-\left(4 \cdot a\right) \cdot c\right)\right)} + \mathsf{fma}\left(-c, 4 \cdot a, c \cdot \left(4 \cdot a\right)\right)}}{a \cdot 2} \]
    4. associate-+l+50.9%

      \[\leadsto \frac{\left(-b\right) + \sqrt{\color{blue}{b \cdot b + \left(\left(-\left(4 \cdot a\right) \cdot c\right) + \mathsf{fma}\left(-c, 4 \cdot a, c \cdot \left(4 \cdot a\right)\right)\right)}}}{a \cdot 2} \]
    5. pow250.9%

      \[\leadsto \frac{\left(-b\right) + \sqrt{\color{blue}{{b}^{2}} + \left(\left(-\left(4 \cdot a\right) \cdot c\right) + \mathsf{fma}\left(-c, 4 \cdot a, c \cdot \left(4 \cdot a\right)\right)\right)}}{a \cdot 2} \]
    6. distribute-lft-neg-in50.9%

      \[\leadsto \frac{\left(-b\right) + \sqrt{{b}^{2} + \left(\color{blue}{\left(-4 \cdot a\right) \cdot c} + \mathsf{fma}\left(-c, 4 \cdot a, c \cdot \left(4 \cdot a\right)\right)\right)}}{a \cdot 2} \]
    7. *-commutative50.9%

      \[\leadsto \frac{\left(-b\right) + \sqrt{{b}^{2} + \left(\left(-\color{blue}{a \cdot 4}\right) \cdot c + \mathsf{fma}\left(-c, 4 \cdot a, c \cdot \left(4 \cdot a\right)\right)\right)}}{a \cdot 2} \]
    8. distribute-rgt-neg-in50.9%

      \[\leadsto \frac{\left(-b\right) + \sqrt{{b}^{2} + \left(\color{blue}{\left(a \cdot \left(-4\right)\right)} \cdot c + \mathsf{fma}\left(-c, 4 \cdot a, c \cdot \left(4 \cdot a\right)\right)\right)}}{a \cdot 2} \]
    9. metadata-eval50.9%

      \[\leadsto \frac{\left(-b\right) + \sqrt{{b}^{2} + \left(\left(a \cdot \color{blue}{-4}\right) \cdot c + \mathsf{fma}\left(-c, 4 \cdot a, c \cdot \left(4 \cdot a\right)\right)\right)}}{a \cdot 2} \]
    10. associate-*r*50.9%

      \[\leadsto \frac{\left(-b\right) + \sqrt{{b}^{2} + \left(\color{blue}{a \cdot \left(-4 \cdot c\right)} + \mathsf{fma}\left(-c, 4 \cdot a, c \cdot \left(4 \cdot a\right)\right)\right)}}{a \cdot 2} \]
    11. *-commutative50.9%

      \[\leadsto \frac{\left(-b\right) + \sqrt{{b}^{2} + \left(a \cdot \color{blue}{\left(c \cdot -4\right)} + \mathsf{fma}\left(-c, 4 \cdot a, c \cdot \left(4 \cdot a\right)\right)\right)}}{a \cdot 2} \]
    12. *-commutative50.9%

      \[\leadsto \frac{\left(-b\right) + \sqrt{{b}^{2} + \left(a \cdot \left(c \cdot -4\right) + \mathsf{fma}\left(-c, 4 \cdot a, \color{blue}{\left(4 \cdot a\right) \cdot c}\right)\right)}}{a \cdot 2} \]
    13. fma-udef50.9%

      \[\leadsto \frac{\left(-b\right) + \sqrt{{b}^{2} + \left(a \cdot \left(c \cdot -4\right) + \color{blue}{\left(\left(-c\right) \cdot \left(4 \cdot a\right) + \left(4 \cdot a\right) \cdot c\right)}\right)}}{a \cdot 2} \]
  6. Applied egg-rr50.9%

    \[\leadsto \frac{\left(-b\right) + \sqrt{\color{blue}{{b}^{2} + \left(a \cdot \left(c \cdot -4\right) + \left(a \cdot \left(c \cdot -4\right) + \left(c \cdot 4\right) \cdot a\right)\right)}}}{a \cdot 2} \]
  7. Step-by-step derivation
    1. +-commutative50.9%

      \[\leadsto \frac{\left(-b\right) + \sqrt{\color{blue}{\left(a \cdot \left(c \cdot -4\right) + \left(a \cdot \left(c \cdot -4\right) + \left(c \cdot 4\right) \cdot a\right)\right) + {b}^{2}}}}{a \cdot 2} \]
    2. associate-+r+50.9%

      \[\leadsto \frac{\left(-b\right) + \sqrt{\color{blue}{\left(\left(a \cdot \left(c \cdot -4\right) + a \cdot \left(c \cdot -4\right)\right) + \left(c \cdot 4\right) \cdot a\right)} + {b}^{2}}}{a \cdot 2} \]
    3. associate-+l+50.9%

      \[\leadsto \frac{\left(-b\right) + \sqrt{\color{blue}{\left(a \cdot \left(c \cdot -4\right) + a \cdot \left(c \cdot -4\right)\right) + \left(\left(c \cdot 4\right) \cdot a + {b}^{2}\right)}}}{a \cdot 2} \]
    4. associate-*r*50.9%

      \[\leadsto \frac{\left(-b\right) + \sqrt{\left(\color{blue}{\left(a \cdot c\right) \cdot -4} + a \cdot \left(c \cdot -4\right)\right) + \left(\left(c \cdot 4\right) \cdot a + {b}^{2}\right)}}{a \cdot 2} \]
    5. associate-*r*50.9%

      \[\leadsto \frac{\left(-b\right) + \sqrt{\left(\left(a \cdot c\right) \cdot -4 + \color{blue}{\left(a \cdot c\right) \cdot -4}\right) + \left(\left(c \cdot 4\right) \cdot a + {b}^{2}\right)}}{a \cdot 2} \]
    6. distribute-lft-out50.9%

      \[\leadsto \frac{\left(-b\right) + \sqrt{\color{blue}{\left(a \cdot c\right) \cdot \left(-4 + -4\right)} + \left(\left(c \cdot 4\right) \cdot a + {b}^{2}\right)}}{a \cdot 2} \]
    7. metadata-eval50.9%

      \[\leadsto \frac{\left(-b\right) + \sqrt{\left(a \cdot c\right) \cdot \color{blue}{-8} + \left(\left(c \cdot 4\right) \cdot a + {b}^{2}\right)}}{a \cdot 2} \]
    8. +-commutative50.9%

      \[\leadsto \frac{\left(-b\right) + \sqrt{\left(a \cdot c\right) \cdot -8 + \color{blue}{\left({b}^{2} + \left(c \cdot 4\right) \cdot a\right)}}}{a \cdot 2} \]
    9. unpow250.9%

      \[\leadsto \frac{\left(-b\right) + \sqrt{\left(a \cdot c\right) \cdot -8 + \left(\color{blue}{b \cdot b} + \left(c \cdot 4\right) \cdot a\right)}}{a \cdot 2} \]
    10. fma-udef50.9%

      \[\leadsto \frac{\left(-b\right) + \sqrt{\left(a \cdot c\right) \cdot -8 + \color{blue}{\mathsf{fma}\left(b, b, \left(c \cdot 4\right) \cdot a\right)}}}{a \cdot 2} \]
    11. associate-*l*50.9%

      \[\leadsto \frac{\left(-b\right) + \sqrt{\left(a \cdot c\right) \cdot -8 + \mathsf{fma}\left(b, b, \color{blue}{c \cdot \left(4 \cdot a\right)}\right)}}{a \cdot 2} \]
    12. *-commutative50.9%

      \[\leadsto \frac{\left(-b\right) + \sqrt{\left(a \cdot c\right) \cdot -8 + \mathsf{fma}\left(b, b, c \cdot \color{blue}{\left(a \cdot 4\right)}\right)}}{a \cdot 2} \]
  8. Simplified50.9%

    \[\leadsto \frac{\left(-b\right) + \sqrt{\color{blue}{\left(a \cdot c\right) \cdot -8 + \mathsf{fma}\left(b, b, c \cdot \left(a \cdot 4\right)\right)}}}{a \cdot 2} \]
  9. Step-by-step derivation
    1. associate-*l*50.9%

      \[\leadsto \frac{\left(-b\right) + \sqrt{\color{blue}{a \cdot \left(c \cdot -8\right)} + \mathsf{fma}\left(b, b, c \cdot \left(a \cdot 4\right)\right)}}{a \cdot 2} \]
    2. fma-def50.9%

      \[\leadsto \frac{\left(-b\right) + \sqrt{\color{blue}{\mathsf{fma}\left(a, c \cdot -8, \mathsf{fma}\left(b, b, c \cdot \left(a \cdot 4\right)\right)\right)}}}{a \cdot 2} \]
  10. Applied egg-rr50.9%

    \[\leadsto \frac{\left(-b\right) + \sqrt{\color{blue}{\mathsf{fma}\left(a, c \cdot -8, \mathsf{fma}\left(b, b, c \cdot \left(a \cdot 4\right)\right)\right)}}}{a \cdot 2} \]
  11. Step-by-step derivation
    1. clear-num50.7%

      \[\leadsto \color{blue}{\frac{1}{\frac{a \cdot 2}{\left(-b\right) + \sqrt{\mathsf{fma}\left(a, c \cdot -8, \mathsf{fma}\left(b, b, c \cdot \left(a \cdot 4\right)\right)\right)}}}} \]
    2. inv-pow50.7%

      \[\leadsto \color{blue}{{\left(\frac{a \cdot 2}{\left(-b\right) + \sqrt{\mathsf{fma}\left(a, c \cdot -8, \mathsf{fma}\left(b, b, c \cdot \left(a \cdot 4\right)\right)\right)}}\right)}^{-1}} \]
    3. neg-mul-150.7%

      \[\leadsto {\left(\frac{a \cdot 2}{\color{blue}{-1 \cdot b} + \sqrt{\mathsf{fma}\left(a, c \cdot -8, \mathsf{fma}\left(b, b, c \cdot \left(a \cdot 4\right)\right)\right)}}\right)}^{-1} \]
    4. fma-def50.7%

      \[\leadsto {\left(\frac{a \cdot 2}{\color{blue}{\mathsf{fma}\left(-1, b, \sqrt{\mathsf{fma}\left(a, c \cdot -8, \mathsf{fma}\left(b, b, c \cdot \left(a \cdot 4\right)\right)\right)}\right)}}\right)}^{-1} \]
  12. Applied egg-rr50.7%

    \[\leadsto \color{blue}{{\left(\frac{a \cdot 2}{\mathsf{fma}\left(-1, b, \sqrt{\mathsf{fma}\left(a, c \cdot -8, \mathsf{fma}\left(b, b, c \cdot \left(a \cdot 4\right)\right)\right)}\right)}\right)}^{-1}} \]
  13. Step-by-step derivation
    1. unpow-150.7%

      \[\leadsto \color{blue}{\frac{1}{\frac{a \cdot 2}{\mathsf{fma}\left(-1, b, \sqrt{\mathsf{fma}\left(a, c \cdot -8, \mathsf{fma}\left(b, b, c \cdot \left(a \cdot 4\right)\right)\right)}\right)}}} \]
    2. *-lft-identity50.7%

      \[\leadsto \frac{1}{\frac{a \cdot 2}{\color{blue}{1 \cdot \mathsf{fma}\left(-1, b, \sqrt{\mathsf{fma}\left(a, c \cdot -8, \mathsf{fma}\left(b, b, c \cdot \left(a \cdot 4\right)\right)\right)}\right)}}} \]
    3. times-frac50.7%

      \[\leadsto \frac{1}{\color{blue}{\frac{a}{1} \cdot \frac{2}{\mathsf{fma}\left(-1, b, \sqrt{\mathsf{fma}\left(a, c \cdot -8, \mathsf{fma}\left(b, b, c \cdot \left(a \cdot 4\right)\right)\right)}\right)}}} \]
    4. /-rgt-identity50.7%

      \[\leadsto \frac{1}{\color{blue}{a} \cdot \frac{2}{\mathsf{fma}\left(-1, b, \sqrt{\mathsf{fma}\left(a, c \cdot -8, \mathsf{fma}\left(b, b, c \cdot \left(a \cdot 4\right)\right)\right)}\right)}} \]
    5. fma-udef50.7%

      \[\leadsto \frac{1}{a \cdot \frac{2}{\color{blue}{-1 \cdot b + \sqrt{\mathsf{fma}\left(a, c \cdot -8, \mathsf{fma}\left(b, b, c \cdot \left(a \cdot 4\right)\right)\right)}}}} \]
    6. *-commutative50.7%

      \[\leadsto \frac{1}{a \cdot \frac{2}{\color{blue}{b \cdot -1} + \sqrt{\mathsf{fma}\left(a, c \cdot -8, \mathsf{fma}\left(b, b, c \cdot \left(a \cdot 4\right)\right)\right)}}} \]
    7. fma-def50.7%

      \[\leadsto \frac{1}{a \cdot \frac{2}{\color{blue}{\mathsf{fma}\left(b, -1, \sqrt{\mathsf{fma}\left(a, c \cdot -8, \mathsf{fma}\left(b, b, c \cdot \left(a \cdot 4\right)\right)\right)}\right)}}} \]
    8. fma-def50.7%

      \[\leadsto \frac{1}{a \cdot \frac{2}{\mathsf{fma}\left(b, -1, \sqrt{\color{blue}{a \cdot \left(c \cdot -8\right) + \mathsf{fma}\left(b, b, c \cdot \left(a \cdot 4\right)\right)}}\right)}} \]
    9. associate-*r*50.7%

      \[\leadsto \frac{1}{a \cdot \frac{2}{\mathsf{fma}\left(b, -1, \sqrt{\color{blue}{\left(a \cdot c\right) \cdot -8} + \mathsf{fma}\left(b, b, c \cdot \left(a \cdot 4\right)\right)}\right)}} \]
    10. *-commutative50.7%

      \[\leadsto \frac{1}{a \cdot \frac{2}{\mathsf{fma}\left(b, -1, \sqrt{\color{blue}{-8 \cdot \left(a \cdot c\right)} + \mathsf{fma}\left(b, b, c \cdot \left(a \cdot 4\right)\right)}\right)}} \]
    11. fma-udef50.7%

      \[\leadsto \frac{1}{a \cdot \frac{2}{\mathsf{fma}\left(b, -1, \sqrt{-8 \cdot \left(a \cdot c\right) + \color{blue}{\left(b \cdot b + c \cdot \left(a \cdot 4\right)\right)}}\right)}} \]
    12. unpow250.7%

      \[\leadsto \frac{1}{a \cdot \frac{2}{\mathsf{fma}\left(b, -1, \sqrt{-8 \cdot \left(a \cdot c\right) + \left(\color{blue}{{b}^{2}} + c \cdot \left(a \cdot 4\right)\right)}\right)}} \]
    13. associate-*r*50.7%

      \[\leadsto \frac{1}{a \cdot \frac{2}{\mathsf{fma}\left(b, -1, \sqrt{-8 \cdot \left(a \cdot c\right) + \left({b}^{2} + \color{blue}{\left(c \cdot a\right) \cdot 4}\right)}\right)}} \]
    14. *-commutative50.7%

      \[\leadsto \frac{1}{a \cdot \frac{2}{\mathsf{fma}\left(b, -1, \sqrt{-8 \cdot \left(a \cdot c\right) + \left({b}^{2} + \color{blue}{\left(a \cdot c\right)} \cdot 4\right)}\right)}} \]
    15. *-commutative50.7%

      \[\leadsto \frac{1}{a \cdot \frac{2}{\mathsf{fma}\left(b, -1, \sqrt{-8 \cdot \left(a \cdot c\right) + \left({b}^{2} + \color{blue}{4 \cdot \left(a \cdot c\right)}\right)}\right)}} \]
    16. +-commutative50.7%

      \[\leadsto \frac{1}{a \cdot \frac{2}{\mathsf{fma}\left(b, -1, \sqrt{-8 \cdot \left(a \cdot c\right) + \color{blue}{\left(4 \cdot \left(a \cdot c\right) + {b}^{2}\right)}}\right)}} \]
  14. Simplified51.0%

    \[\leadsto \color{blue}{\frac{1}{a \cdot \frac{2}{\mathsf{fma}\left(b, -1, \sqrt{\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)}\right)}}} \]
  15. Taylor expanded in a around 0 10.3%

    \[\leadsto \color{blue}{0.5 \cdot \frac{b + -1 \cdot b}{a}} \]
  16. Step-by-step derivation
    1. associate-*r/10.3%

      \[\leadsto \color{blue}{\frac{0.5 \cdot \left(b + -1 \cdot b\right)}{a}} \]
    2. distribute-rgt1-in10.3%

      \[\leadsto \frac{0.5 \cdot \color{blue}{\left(\left(-1 + 1\right) \cdot b\right)}}{a} \]
    3. metadata-eval10.3%

      \[\leadsto \frac{0.5 \cdot \left(\color{blue}{0} \cdot b\right)}{a} \]
    4. mul0-lft10.3%

      \[\leadsto \frac{0.5 \cdot \color{blue}{0}}{a} \]
    5. metadata-eval10.3%

      \[\leadsto \frac{\color{blue}{0}}{a} \]
  17. Simplified10.3%

    \[\leadsto \color{blue}{\frac{0}{a}} \]
  18. Final simplification10.3%

    \[\leadsto \frac{0}{a} \]
  19. Add Preprocessing

Developer target: 71.4% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}\\ \mathbf{if}\;b < 0:\\ \;\;\;\;\frac{\left(-b\right) + t_0}{2 \cdot a}\\ \mathbf{else}:\\ \;\;\;\;\frac{c}{a \cdot \frac{\left(-b\right) - t_0}{2 \cdot a}}\\ \end{array} \end{array} \]
(FPCore (a b c)
 :precision binary64
 (let* ((t_0 (sqrt (- (* b b) (* (* 4.0 a) c)))))
   (if (< b 0.0)
     (/ (+ (- b) t_0) (* 2.0 a))
     (/ c (* a (/ (- (- b) t_0) (* 2.0 a)))))))
double code(double a, double b, double c) {
	double t_0 = sqrt(((b * b) - ((4.0 * a) * c)));
	double tmp;
	if (b < 0.0) {
		tmp = (-b + t_0) / (2.0 * a);
	} else {
		tmp = c / (a * ((-b - t_0) / (2.0 * a)));
	}
	return tmp;
}
real(8) function code(a, b, c)
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8) :: t_0
    real(8) :: tmp
    t_0 = sqrt(((b * b) - ((4.0d0 * a) * c)))
    if (b < 0.0d0) then
        tmp = (-b + t_0) / (2.0d0 * a)
    else
        tmp = c / (a * ((-b - t_0) / (2.0d0 * a)))
    end if
    code = tmp
end function
public static double code(double a, double b, double c) {
	double t_0 = Math.sqrt(((b * b) - ((4.0 * a) * c)));
	double tmp;
	if (b < 0.0) {
		tmp = (-b + t_0) / (2.0 * a);
	} else {
		tmp = c / (a * ((-b - t_0) / (2.0 * a)));
	}
	return tmp;
}
def code(a, b, c):
	t_0 = math.sqrt(((b * b) - ((4.0 * a) * c)))
	tmp = 0
	if b < 0.0:
		tmp = (-b + t_0) / (2.0 * a)
	else:
		tmp = c / (a * ((-b - t_0) / (2.0 * a)))
	return tmp
function code(a, b, c)
	t_0 = sqrt(Float64(Float64(b * b) - Float64(Float64(4.0 * a) * c)))
	tmp = 0.0
	if (b < 0.0)
		tmp = Float64(Float64(Float64(-b) + t_0) / Float64(2.0 * a));
	else
		tmp = Float64(c / Float64(a * Float64(Float64(Float64(-b) - t_0) / Float64(2.0 * a))));
	end
	return tmp
end
function tmp_2 = code(a, b, c)
	t_0 = sqrt(((b * b) - ((4.0 * a) * c)));
	tmp = 0.0;
	if (b < 0.0)
		tmp = (-b + t_0) / (2.0 * a);
	else
		tmp = c / (a * ((-b - t_0) / (2.0 * a)));
	end
	tmp_2 = tmp;
end
code[a_, b_, c_] := Block[{t$95$0 = N[Sqrt[N[(N[(b * b), $MachinePrecision] - N[(N[(4.0 * a), $MachinePrecision] * c), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[Less[b, 0.0], N[(N[((-b) + t$95$0), $MachinePrecision] / N[(2.0 * a), $MachinePrecision]), $MachinePrecision], N[(c / N[(a * N[(N[((-b) - t$95$0), $MachinePrecision] / N[(2.0 * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}\\
\mathbf{if}\;b < 0:\\
\;\;\;\;\frac{\left(-b\right) + t_0}{2 \cdot a}\\

\mathbf{else}:\\
\;\;\;\;\frac{c}{a \cdot \frac{\left(-b\right) - t_0}{2 \cdot a}}\\


\end{array}
\end{array}

Reproduce

?
herbie shell --seed 2024019 
(FPCore (a b c)
  :name "The quadratic formula (r1)"
  :precision binary64

  :herbie-target
  (if (< b 0.0) (/ (+ (- b) (sqrt (- (* b b) (* (* 4.0 a) c)))) (* 2.0 a)) (/ c (* a (/ (- (- b) (sqrt (- (* b b) (* (* 4.0 a) c)))) (* 2.0 a)))))

  (/ (+ (- b) (sqrt (- (* b b) (* (* 4.0 a) c)))) (* 2.0 a)))