The quadratic formula (r1)

Percentage Accurate: 53.3% → 90.4%
Time: 11.5s
Alternatives: 9
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 9 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: 53.3% 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: 90.4% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq -2.8 \cdot 10^{+158}:\\ \;\;\;\;\frac{-b}{a}\\ \mathbf{elif}\;b \leq 4.3 \cdot 10^{-281}:\\ \;\;\;\;\frac{\sqrt{b \cdot b - \left(a \cdot 4\right) \cdot c} - b}{a \cdot 2}\\ \mathbf{elif}\;b \leq 1.8 \cdot 10^{+74}:\\ \;\;\;\;\frac{-0.5 \cdot \frac{c}{-0.25}}{\left(-b\right) - \sqrt{\mathsf{fma}\left(b, b, c \cdot \left(a \cdot -4\right)\right)}}\\ \mathbf{else}:\\ \;\;\;\;\frac{-c}{b}\\ \end{array} \end{array} \]
(FPCore (a b c)
 :precision binary64
 (if (<= b -2.8e+158)
   (/ (- b) a)
   (if (<= b 4.3e-281)
     (/ (- (sqrt (- (* b b) (* (* a 4.0) c))) b) (* a 2.0))
     (if (<= b 1.8e+74)
       (/ (* -0.5 (/ c -0.25)) (- (- b) (sqrt (fma b b (* c (* a -4.0))))))
       (/ (- c) b)))))
double code(double a, double b, double c) {
	double tmp;
	if (b <= -2.8e+158) {
		tmp = -b / a;
	} else if (b <= 4.3e-281) {
		tmp = (sqrt(((b * b) - ((a * 4.0) * c))) - b) / (a * 2.0);
	} else if (b <= 1.8e+74) {
		tmp = (-0.5 * (c / -0.25)) / (-b - sqrt(fma(b, b, (c * (a * -4.0)))));
	} else {
		tmp = -c / b;
	}
	return tmp;
}
function code(a, b, c)
	tmp = 0.0
	if (b <= -2.8e+158)
		tmp = Float64(Float64(-b) / a);
	elseif (b <= 4.3e-281)
		tmp = Float64(Float64(sqrt(Float64(Float64(b * b) - Float64(Float64(a * 4.0) * c))) - b) / Float64(a * 2.0));
	elseif (b <= 1.8e+74)
		tmp = Float64(Float64(-0.5 * Float64(c / -0.25)) / Float64(Float64(-b) - sqrt(fma(b, b, Float64(c * Float64(a * -4.0))))));
	else
		tmp = Float64(Float64(-c) / b);
	end
	return tmp
end
code[a_, b_, c_] := If[LessEqual[b, -2.8e+158], N[((-b) / a), $MachinePrecision], If[LessEqual[b, 4.3e-281], 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], If[LessEqual[b, 1.8e+74], N[(N[(-0.5 * N[(c / -0.25), $MachinePrecision]), $MachinePrecision] / N[((-b) - N[Sqrt[N[(b * b + N[(c * N[(a * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[((-c) / b), $MachinePrecision]]]]
\begin{array}{l}

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

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

\mathbf{elif}\;b \leq 1.8 \cdot 10^{+74}:\\
\;\;\;\;\frac{-0.5 \cdot \frac{c}{-0.25}}{\left(-b\right) - \sqrt{\mathsf{fma}\left(b, b, c \cdot \left(a \cdot -4\right)\right)}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if b < -2.80000000000000001e158

    1. Initial program 33.1%

      \[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a} \]
    2. Taylor expanded in b around -inf 100.0%

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

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

        \[\leadsto \frac{\color{blue}{-b}}{a} \]
    4. Simplified100.0%

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

    if -2.80000000000000001e158 < b < 4.30000000000000023e-281

    1. Initial program 90.1%

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

    if 4.30000000000000023e-281 < b < 1.79999999999999994e74

    1. Initial program 61.0%

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

        \[\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)}}}{2 \cdot a} \]
      2. *-commutative60.7%

        \[\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)}}{2 \cdot a} \]
      3. fma-def60.7%

        \[\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)}}{2 \cdot a} \]
      4. associate-+l+60.7%

        \[\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)}}}{2 \cdot a} \]
      5. *-commutative60.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{\frac{0 - \mathsf{fma}\left(c, -4 \cdot a, 0\right)}{\left(-b\right) - \sqrt{\mathsf{fma}\left(b, b, \mathsf{fma}\left(c, -4 \cdot a, 0\right)\right)}}}}{2 \cdot a} \]
      2. Step-by-step derivation
        1. div-inv77.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{-0.5 \cdot \frac{c \cdot \left(a \cdot -4\right)}{a}}{\left(-b\right) - \sqrt{\mathsf{fma}\left(b, b, c \cdot \left(a \cdot -4\right)\right)}}} \]
      6. Step-by-step derivation
        1. expm1-log1p-u55.8%

          \[\leadsto \frac{-0.5 \cdot \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{c \cdot \left(a \cdot -4\right)}{a}\right)\right)}}{\left(-b\right) - \sqrt{\mathsf{fma}\left(b, b, c \cdot \left(a \cdot -4\right)\right)}} \]
        2. expm1-udef21.4%

          \[\leadsto \frac{-0.5 \cdot \color{blue}{\left(e^{\mathsf{log1p}\left(\frac{c \cdot \left(a \cdot -4\right)}{a}\right)} - 1\right)}}{\left(-b\right) - \sqrt{\mathsf{fma}\left(b, b, c \cdot \left(a \cdot -4\right)\right)}} \]
        3. associate-/l*21.5%

          \[\leadsto \frac{-0.5 \cdot \left(e^{\mathsf{log1p}\left(\color{blue}{\frac{c}{\frac{a}{a \cdot -4}}}\right)} - 1\right)}{\left(-b\right) - \sqrt{\mathsf{fma}\left(b, b, c \cdot \left(a \cdot -4\right)\right)}} \]
      7. Applied egg-rr21.5%

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

          \[\leadsto \frac{-0.5 \cdot \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{c}{\frac{a}{a \cdot -4}}\right)\right)}}{\left(-b\right) - \sqrt{\mathsf{fma}\left(b, b, c \cdot \left(a \cdot -4\right)\right)}} \]
        2. expm1-log1p87.7%

          \[\leadsto \frac{-0.5 \cdot \color{blue}{\frac{c}{\frac{a}{a \cdot -4}}}}{\left(-b\right) - \sqrt{\mathsf{fma}\left(b, b, c \cdot \left(a \cdot -4\right)\right)}} \]
        3. associate-/r*87.7%

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

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

          \[\leadsto \frac{-0.5 \cdot \frac{c}{\color{blue}{-0.25}}}{\left(-b\right) - \sqrt{\mathsf{fma}\left(b, b, c \cdot \left(a \cdot -4\right)\right)}} \]
      9. Simplified87.7%

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

      if 1.79999999999999994e74 < b

      1. Initial program 3.8%

        \[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a} \]
      2. Taylor expanded in b around inf 95.8%

        \[\leadsto \color{blue}{-1 \cdot \frac{c}{b}} \]
      3. Step-by-step derivation
        1. associate-*r/95.8%

          \[\leadsto \color{blue}{\frac{-1 \cdot c}{b}} \]
        2. neg-mul-195.8%

          \[\leadsto \frac{\color{blue}{-c}}{b} \]
      4. Simplified95.8%

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

      \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -2.8 \cdot 10^{+158}:\\ \;\;\;\;\frac{-b}{a}\\ \mathbf{elif}\;b \leq 4.3 \cdot 10^{-281}:\\ \;\;\;\;\frac{\sqrt{b \cdot b - \left(a \cdot 4\right) \cdot c} - b}{a \cdot 2}\\ \mathbf{elif}\;b \leq 1.8 \cdot 10^{+74}:\\ \;\;\;\;\frac{-0.5 \cdot \frac{c}{-0.25}}{\left(-b\right) - \sqrt{\mathsf{fma}\left(b, b, c \cdot \left(a \cdot -4\right)\right)}}\\ \mathbf{else}:\\ \;\;\;\;\frac{-c}{b}\\ \end{array} \]

    Alternative 2: 88.3% accurate, 0.5× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq -2.8 \cdot 10^{+158}:\\ \;\;\;\;\frac{-b}{a}\\ \mathbf{elif}\;b \leq 4.2 \cdot 10^{-281}:\\ \;\;\;\;\frac{\sqrt{b \cdot b - \left(a \cdot 4\right) \cdot c} - b}{a \cdot 2}\\ \mathbf{elif}\;b \leq 54:\\ \;\;\;\;\frac{\frac{c}{0.5}}{\left(-b\right) - \mathsf{hypot}\left(b, \sqrt{a \cdot \left(c \cdot -4\right)}\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{-c}{b}\\ \end{array} \end{array} \]
    (FPCore (a b c)
     :precision binary64
     (if (<= b -2.8e+158)
       (/ (- b) a)
       (if (<= b 4.2e-281)
         (/ (- (sqrt (- (* b b) (* (* a 4.0) c))) b) (* a 2.0))
         (if (<= b 54.0)
           (/ (/ c 0.5) (- (- b) (hypot b (sqrt (* a (* c -4.0))))))
           (/ (- c) b)))))
    double code(double a, double b, double c) {
    	double tmp;
    	if (b <= -2.8e+158) {
    		tmp = -b / a;
    	} else if (b <= 4.2e-281) {
    		tmp = (sqrt(((b * b) - ((a * 4.0) * c))) - b) / (a * 2.0);
    	} else if (b <= 54.0) {
    		tmp = (c / 0.5) / (-b - hypot(b, sqrt((a * (c * -4.0)))));
    	} else {
    		tmp = -c / b;
    	}
    	return tmp;
    }
    
    public static double code(double a, double b, double c) {
    	double tmp;
    	if (b <= -2.8e+158) {
    		tmp = -b / a;
    	} else if (b <= 4.2e-281) {
    		tmp = (Math.sqrt(((b * b) - ((a * 4.0) * c))) - b) / (a * 2.0);
    	} else if (b <= 54.0) {
    		tmp = (c / 0.5) / (-b - Math.hypot(b, Math.sqrt((a * (c * -4.0)))));
    	} else {
    		tmp = -c / b;
    	}
    	return tmp;
    }
    
    def code(a, b, c):
    	tmp = 0
    	if b <= -2.8e+158:
    		tmp = -b / a
    	elif b <= 4.2e-281:
    		tmp = (math.sqrt(((b * b) - ((a * 4.0) * c))) - b) / (a * 2.0)
    	elif b <= 54.0:
    		tmp = (c / 0.5) / (-b - math.hypot(b, math.sqrt((a * (c * -4.0)))))
    	else:
    		tmp = -c / b
    	return tmp
    
    function code(a, b, c)
    	tmp = 0.0
    	if (b <= -2.8e+158)
    		tmp = Float64(Float64(-b) / a);
    	elseif (b <= 4.2e-281)
    		tmp = Float64(Float64(sqrt(Float64(Float64(b * b) - Float64(Float64(a * 4.0) * c))) - b) / Float64(a * 2.0));
    	elseif (b <= 54.0)
    		tmp = Float64(Float64(c / 0.5) / Float64(Float64(-b) - hypot(b, sqrt(Float64(a * Float64(c * -4.0))))));
    	else
    		tmp = Float64(Float64(-c) / b);
    	end
    	return tmp
    end
    
    function tmp_2 = code(a, b, c)
    	tmp = 0.0;
    	if (b <= -2.8e+158)
    		tmp = -b / a;
    	elseif (b <= 4.2e-281)
    		tmp = (sqrt(((b * b) - ((a * 4.0) * c))) - b) / (a * 2.0);
    	elseif (b <= 54.0)
    		tmp = (c / 0.5) / (-b - hypot(b, sqrt((a * (c * -4.0)))));
    	else
    		tmp = -c / b;
    	end
    	tmp_2 = tmp;
    end
    
    code[a_, b_, c_] := If[LessEqual[b, -2.8e+158], N[((-b) / a), $MachinePrecision], If[LessEqual[b, 4.2e-281], 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], If[LessEqual[b, 54.0], N[(N[(c / 0.5), $MachinePrecision] / N[((-b) - N[Sqrt[b ^ 2 + N[Sqrt[N[(a * N[(c * -4.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[((-c) / b), $MachinePrecision]]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    \mathbf{if}\;b \leq -2.8 \cdot 10^{+158}:\\
    \;\;\;\;\frac{-b}{a}\\
    
    \mathbf{elif}\;b \leq 4.2 \cdot 10^{-281}:\\
    \;\;\;\;\frac{\sqrt{b \cdot b - \left(a \cdot 4\right) \cdot c} - b}{a \cdot 2}\\
    
    \mathbf{elif}\;b \leq 54:\\
    \;\;\;\;\frac{\frac{c}{0.5}}{\left(-b\right) - \mathsf{hypot}\left(b, \sqrt{a \cdot \left(c \cdot -4\right)}\right)}\\
    
    \mathbf{else}:\\
    \;\;\;\;\frac{-c}{b}\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 4 regimes
    2. if b < -2.80000000000000001e158

      1. Initial program 33.1%

        \[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a} \]
      2. Taylor expanded in b around -inf 100.0%

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

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

          \[\leadsto \frac{\color{blue}{-b}}{a} \]
      4. Simplified100.0%

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

      if -2.80000000000000001e158 < b < 4.1999999999999998e-281

      1. Initial program 90.1%

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

      if 4.1999999999999998e-281 < b < 54

      1. Initial program 71.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. prod-diff70.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)}}}{2 \cdot a} \]
        2. *-commutative70.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)}}{2 \cdot a} \]
        3. fma-def70.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)}}{2 \cdot a} \]
        4. associate-+l+70.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)}}}{2 \cdot a} \]
        5. *-commutative70.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \frac{\color{blue}{\frac{0 - \mathsf{fma}\left(c, -4 \cdot a, 0\right)}{\left(-b\right) - \sqrt{\mathsf{fma}\left(b, b, \mathsf{fma}\left(c, -4 \cdot a, 0\right)\right)}}}}{2 \cdot a} \]
        2. Step-by-step derivation
          1. div-inv78.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \color{blue}{\frac{-0.5 \cdot \frac{c \cdot \left(a \cdot -4\right)}{a}}{\left(-b\right) - \sqrt{\mathsf{fma}\left(b, b, c \cdot \left(a \cdot -4\right)\right)}}} \]
        6. Step-by-step derivation
          1. expm1-log1p-u62.6%

            \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{-0.5 \cdot \frac{c \cdot \left(a \cdot -4\right)}{a}}{\left(-b\right) - \sqrt{\mathsf{fma}\left(b, b, c \cdot \left(a \cdot -4\right)\right)}}\right)\right)} \]
          2. expm1-udef14.9%

            \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\frac{-0.5 \cdot \frac{c \cdot \left(a \cdot -4\right)}{a}}{\left(-b\right) - \sqrt{\mathsf{fma}\left(b, b, c \cdot \left(a \cdot -4\right)\right)}}\right)} - 1} \]
        7. Applied egg-rr15.0%

          \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\frac{-0.5}{\frac{\left(-b\right) - \mathsf{hypot}\left(b, \sqrt{c \cdot \left(a \cdot -4\right)}\right)}{\frac{c}{\frac{a}{a \cdot -4}}}}\right)} - 1} \]
        8. Step-by-step derivation
          1. expm1-def71.2%

            \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{-0.5}{\frac{\left(-b\right) - \mathsf{hypot}\left(b, \sqrt{c \cdot \left(a \cdot -4\right)}\right)}{\frac{c}{\frac{a}{a \cdot -4}}}}\right)\right)} \]
          2. expm1-log1p87.1%

            \[\leadsto \color{blue}{\frac{-0.5}{\frac{\left(-b\right) - \mathsf{hypot}\left(b, \sqrt{c \cdot \left(a \cdot -4\right)}\right)}{\frac{c}{\frac{a}{a \cdot -4}}}}} \]
          3. associate-/r/87.0%

            \[\leadsto \color{blue}{\frac{-0.5}{\left(-b\right) - \mathsf{hypot}\left(b, \sqrt{c \cdot \left(a \cdot -4\right)}\right)} \cdot \frac{c}{\frac{a}{a \cdot -4}}} \]
          4. associate-*l/87.1%

            \[\leadsto \color{blue}{\frac{-0.5 \cdot \frac{c}{\frac{a}{a \cdot -4}}}{\left(-b\right) - \mathsf{hypot}\left(b, \sqrt{c \cdot \left(a \cdot -4\right)}\right)}} \]
          5. *-commutative87.1%

            \[\leadsto \frac{\color{blue}{\frac{c}{\frac{a}{a \cdot -4}} \cdot -0.5}}{\left(-b\right) - \mathsf{hypot}\left(b, \sqrt{c \cdot \left(a \cdot -4\right)}\right)} \]
          6. associate-*l/87.1%

            \[\leadsto \frac{\color{blue}{\frac{c \cdot -0.5}{\frac{a}{a \cdot -4}}}}{\left(-b\right) - \mathsf{hypot}\left(b, \sqrt{c \cdot \left(a \cdot -4\right)}\right)} \]
          7. associate-/l*87.1%

            \[\leadsto \frac{\color{blue}{\frac{c}{\frac{\frac{a}{a \cdot -4}}{-0.5}}}}{\left(-b\right) - \mathsf{hypot}\left(b, \sqrt{c \cdot \left(a \cdot -4\right)}\right)} \]
          8. associate-/r*87.1%

            \[\leadsto \frac{\frac{c}{\frac{\color{blue}{\frac{\frac{a}{a}}{-4}}}{-0.5}}}{\left(-b\right) - \mathsf{hypot}\left(b, \sqrt{c \cdot \left(a \cdot -4\right)}\right)} \]
          9. *-inverses87.1%

            \[\leadsto \frac{\frac{c}{\frac{\frac{\color{blue}{1}}{-4}}{-0.5}}}{\left(-b\right) - \mathsf{hypot}\left(b, \sqrt{c \cdot \left(a \cdot -4\right)}\right)} \]
          10. metadata-eval87.1%

            \[\leadsto \frac{\frac{c}{\frac{\color{blue}{-0.25}}{-0.5}}}{\left(-b\right) - \mathsf{hypot}\left(b, \sqrt{c \cdot \left(a \cdot -4\right)}\right)} \]
          11. metadata-eval87.1%

            \[\leadsto \frac{\frac{c}{\color{blue}{0.5}}}{\left(-b\right) - \mathsf{hypot}\left(b, \sqrt{c \cdot \left(a \cdot -4\right)}\right)} \]
          12. associate-*r*87.1%

            \[\leadsto \frac{\frac{c}{0.5}}{\left(-b\right) - \mathsf{hypot}\left(b, \sqrt{\color{blue}{\left(c \cdot a\right) \cdot -4}}\right)} \]
          13. *-commutative87.1%

            \[\leadsto \frac{\frac{c}{0.5}}{\left(-b\right) - \mathsf{hypot}\left(b, \sqrt{\color{blue}{\left(a \cdot c\right)} \cdot -4}\right)} \]
          14. associate-*l*87.1%

            \[\leadsto \frac{\frac{c}{0.5}}{\left(-b\right) - \mathsf{hypot}\left(b, \sqrt{\color{blue}{a \cdot \left(c \cdot -4\right)}}\right)} \]
        9. Simplified87.1%

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

        if 54 < b

        1. Initial program 8.5%

          \[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a} \]
        2. Taylor expanded in b around inf 94.3%

          \[\leadsto \color{blue}{-1 \cdot \frac{c}{b}} \]
        3. Step-by-step derivation
          1. associate-*r/94.3%

            \[\leadsto \color{blue}{\frac{-1 \cdot c}{b}} \]
          2. neg-mul-194.3%

            \[\leadsto \frac{\color{blue}{-c}}{b} \]
        4. Simplified94.3%

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

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -2.8 \cdot 10^{+158}:\\ \;\;\;\;\frac{-b}{a}\\ \mathbf{elif}\;b \leq 4.2 \cdot 10^{-281}:\\ \;\;\;\;\frac{\sqrt{b \cdot b - \left(a \cdot 4\right) \cdot c} - b}{a \cdot 2}\\ \mathbf{elif}\;b \leq 54:\\ \;\;\;\;\frac{\frac{c}{0.5}}{\left(-b\right) - \mathsf{hypot}\left(b, \sqrt{a \cdot \left(c \cdot -4\right)}\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{-c}{b}\\ \end{array} \]

      Alternative 3: 84.9% accurate, 1.0× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq -2.8 \cdot 10^{+158}:\\ \;\;\;\;\frac{-b}{a}\\ \mathbf{elif}\;b \leq 220:\\ \;\;\;\;\frac{\sqrt{b \cdot b - \left(a \cdot 4\right) \cdot c} - b}{a \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;\frac{-c}{b}\\ \end{array} \end{array} \]
      (FPCore (a b c)
       :precision binary64
       (if (<= b -2.8e+158)
         (/ (- b) a)
         (if (<= b 220.0)
           (/ (- (sqrt (- (* b b) (* (* a 4.0) c))) b) (* a 2.0))
           (/ (- c) b))))
      double code(double a, double b, double c) {
      	double tmp;
      	if (b <= -2.8e+158) {
      		tmp = -b / a;
      	} else if (b <= 220.0) {
      		tmp = (sqrt(((b * b) - ((a * 4.0) * c))) - b) / (a * 2.0);
      	} 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 <= (-2.8d+158)) then
              tmp = -b / a
          else if (b <= 220.0d0) then
              tmp = (sqrt(((b * b) - ((a * 4.0d0) * c))) - b) / (a * 2.0d0)
          else
              tmp = -c / b
          end if
          code = tmp
      end function
      
      public static double code(double a, double b, double c) {
      	double tmp;
      	if (b <= -2.8e+158) {
      		tmp = -b / a;
      	} else if (b <= 220.0) {
      		tmp = (Math.sqrt(((b * b) - ((a * 4.0) * c))) - b) / (a * 2.0);
      	} else {
      		tmp = -c / b;
      	}
      	return tmp;
      }
      
      def code(a, b, c):
      	tmp = 0
      	if b <= -2.8e+158:
      		tmp = -b / a
      	elif b <= 220.0:
      		tmp = (math.sqrt(((b * b) - ((a * 4.0) * c))) - b) / (a * 2.0)
      	else:
      		tmp = -c / b
      	return tmp
      
      function code(a, b, c)
      	tmp = 0.0
      	if (b <= -2.8e+158)
      		tmp = Float64(Float64(-b) / a);
      	elseif (b <= 220.0)
      		tmp = Float64(Float64(sqrt(Float64(Float64(b * b) - Float64(Float64(a * 4.0) * c))) - b) / Float64(a * 2.0));
      	else
      		tmp = Float64(Float64(-c) / b);
      	end
      	return tmp
      end
      
      function tmp_2 = code(a, b, c)
      	tmp = 0.0;
      	if (b <= -2.8e+158)
      		tmp = -b / a;
      	elseif (b <= 220.0)
      		tmp = (sqrt(((b * b) - ((a * 4.0) * c))) - b) / (a * 2.0);
      	else
      		tmp = -c / b;
      	end
      	tmp_2 = tmp;
      end
      
      code[a_, b_, c_] := If[LessEqual[b, -2.8e+158], N[((-b) / a), $MachinePrecision], If[LessEqual[b, 220.0], 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[((-c) / b), $MachinePrecision]]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      \mathbf{if}\;b \leq -2.8 \cdot 10^{+158}:\\
      \;\;\;\;\frac{-b}{a}\\
      
      \mathbf{elif}\;b \leq 220:\\
      \;\;\;\;\frac{\sqrt{b \cdot b - \left(a \cdot 4\right) \cdot c} - b}{a \cdot 2}\\
      
      \mathbf{else}:\\
      \;\;\;\;\frac{-c}{b}\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 3 regimes
      2. if b < -2.80000000000000001e158

        1. Initial program 33.1%

          \[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a} \]
        2. Taylor expanded in b around -inf 100.0%

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

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

            \[\leadsto \frac{\color{blue}{-b}}{a} \]
        4. Simplified100.0%

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

        if -2.80000000000000001e158 < b < 220

        1. Initial program 84.1%

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

        if 220 < b

        1. Initial program 8.5%

          \[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a} \]
        2. Taylor expanded in b around inf 94.3%

          \[\leadsto \color{blue}{-1 \cdot \frac{c}{b}} \]
        3. Step-by-step derivation
          1. associate-*r/94.3%

            \[\leadsto \color{blue}{\frac{-1 \cdot c}{b}} \]
          2. neg-mul-194.3%

            \[\leadsto \frac{\color{blue}{-c}}{b} \]
        4. Simplified94.3%

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

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -2.8 \cdot 10^{+158}:\\ \;\;\;\;\frac{-b}{a}\\ \mathbf{elif}\;b \leq 220:\\ \;\;\;\;\frac{\sqrt{b \cdot b - \left(a \cdot 4\right) \cdot c} - b}{a \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;\frac{-c}{b}\\ \end{array} \]

      Alternative 4: 79.5% accurate, 1.0× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq -5.4 \cdot 10^{-12}:\\ \;\;\;\;\frac{c}{b} - \frac{b}{a}\\ \mathbf{elif}\;b \leq 11.2:\\ \;\;\;\;\frac{\sqrt{c \cdot \left(a \cdot -4\right)} - b}{a \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;\frac{-c}{b}\\ \end{array} \end{array} \]
      (FPCore (a b c)
       :precision binary64
       (if (<= b -5.4e-12)
         (- (/ c b) (/ b a))
         (if (<= b 11.2) (/ (- (sqrt (* c (* a -4.0))) b) (* a 2.0)) (/ (- c) b))))
      double code(double a, double b, double c) {
      	double tmp;
      	if (b <= -5.4e-12) {
      		tmp = (c / b) - (b / a);
      	} else if (b <= 11.2) {
      		tmp = (sqrt((c * (a * -4.0))) - b) / (a * 2.0);
      	} 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 <= (-5.4d-12)) then
              tmp = (c / b) - (b / a)
          else if (b <= 11.2d0) then
              tmp = (sqrt((c * (a * (-4.0d0)))) - b) / (a * 2.0d0)
          else
              tmp = -c / b
          end if
          code = tmp
      end function
      
      public static double code(double a, double b, double c) {
      	double tmp;
      	if (b <= -5.4e-12) {
      		tmp = (c / b) - (b / a);
      	} else if (b <= 11.2) {
      		tmp = (Math.sqrt((c * (a * -4.0))) - b) / (a * 2.0);
      	} else {
      		tmp = -c / b;
      	}
      	return tmp;
      }
      
      def code(a, b, c):
      	tmp = 0
      	if b <= -5.4e-12:
      		tmp = (c / b) - (b / a)
      	elif b <= 11.2:
      		tmp = (math.sqrt((c * (a * -4.0))) - b) / (a * 2.0)
      	else:
      		tmp = -c / b
      	return tmp
      
      function code(a, b, c)
      	tmp = 0.0
      	if (b <= -5.4e-12)
      		tmp = Float64(Float64(c / b) - Float64(b / a));
      	elseif (b <= 11.2)
      		tmp = Float64(Float64(sqrt(Float64(c * Float64(a * -4.0))) - b) / Float64(a * 2.0));
      	else
      		tmp = Float64(Float64(-c) / b);
      	end
      	return tmp
      end
      
      function tmp_2 = code(a, b, c)
      	tmp = 0.0;
      	if (b <= -5.4e-12)
      		tmp = (c / b) - (b / a);
      	elseif (b <= 11.2)
      		tmp = (sqrt((c * (a * -4.0))) - b) / (a * 2.0);
      	else
      		tmp = -c / b;
      	end
      	tmp_2 = tmp;
      end
      
      code[a_, b_, c_] := If[LessEqual[b, -5.4e-12], N[(N[(c / b), $MachinePrecision] - N[(b / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 11.2], N[(N[(N[Sqrt[N[(c * N[(a * -4.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision] / N[(a * 2.0), $MachinePrecision]), $MachinePrecision], N[((-c) / b), $MachinePrecision]]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      \mathbf{if}\;b \leq -5.4 \cdot 10^{-12}:\\
      \;\;\;\;\frac{c}{b} - \frac{b}{a}\\
      
      \mathbf{elif}\;b \leq 11.2:\\
      \;\;\;\;\frac{\sqrt{c \cdot \left(a \cdot -4\right)} - b}{a \cdot 2}\\
      
      \mathbf{else}:\\
      \;\;\;\;\frac{-c}{b}\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 3 regimes
      2. if b < -5.39999999999999961e-12

        1. Initial program 69.8%

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

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

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

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

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

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

        if -5.39999999999999961e-12 < b < 11.199999999999999

        1. Initial program 79.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. prod-diff78.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)}}}{2 \cdot a} \]
          2. *-commutative78.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)}}{2 \cdot a} \]
          3. fma-def78.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)}}{2 \cdot a} \]
          4. associate-+l+78.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)}}}{2 \cdot a} \]
          5. *-commutative78.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        if 11.199999999999999 < b

        1. Initial program 8.5%

          \[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a} \]
        2. Taylor expanded in b around inf 94.3%

          \[\leadsto \color{blue}{-1 \cdot \frac{c}{b}} \]
        3. Step-by-step derivation
          1. associate-*r/94.3%

            \[\leadsto \color{blue}{\frac{-1 \cdot c}{b}} \]
          2. neg-mul-194.3%

            \[\leadsto \frac{\color{blue}{-c}}{b} \]
        4. Simplified94.3%

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

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -5.4 \cdot 10^{-12}:\\ \;\;\;\;\frac{c}{b} - \frac{b}{a}\\ \mathbf{elif}\;b \leq 11.2:\\ \;\;\;\;\frac{\sqrt{c \cdot \left(a \cdot -4\right)} - b}{a \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;\frac{-c}{b}\\ \end{array} \]

      Alternative 5: 79.9% accurate, 1.0× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq -8.2 \cdot 10^{-91}:\\ \;\;\;\;\frac{c}{b} - \frac{b}{a}\\ \mathbf{elif}\;b \leq 36:\\ \;\;\;\;0.5 \cdot \frac{\sqrt{c \cdot \left(a \cdot -4\right)}}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{-c}{b}\\ \end{array} \end{array} \]
      (FPCore (a b c)
       :precision binary64
       (if (<= b -8.2e-91)
         (- (/ c b) (/ b a))
         (if (<= b 36.0) (* 0.5 (/ (sqrt (* c (* a -4.0))) a)) (/ (- c) b))))
      double code(double a, double b, double c) {
      	double tmp;
      	if (b <= -8.2e-91) {
      		tmp = (c / b) - (b / a);
      	} else if (b <= 36.0) {
      		tmp = 0.5 * (sqrt((c * (a * -4.0))) / 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 <= (-8.2d-91)) then
              tmp = (c / b) - (b / a)
          else if (b <= 36.0d0) then
              tmp = 0.5d0 * (sqrt((c * (a * (-4.0d0)))) / 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 <= -8.2e-91) {
      		tmp = (c / b) - (b / a);
      	} else if (b <= 36.0) {
      		tmp = 0.5 * (Math.sqrt((c * (a * -4.0))) / a);
      	} else {
      		tmp = -c / b;
      	}
      	return tmp;
      }
      
      def code(a, b, c):
      	tmp = 0
      	if b <= -8.2e-91:
      		tmp = (c / b) - (b / a)
      	elif b <= 36.0:
      		tmp = 0.5 * (math.sqrt((c * (a * -4.0))) / a)
      	else:
      		tmp = -c / b
      	return tmp
      
      function code(a, b, c)
      	tmp = 0.0
      	if (b <= -8.2e-91)
      		tmp = Float64(Float64(c / b) - Float64(b / a));
      	elseif (b <= 36.0)
      		tmp = Float64(0.5 * Float64(sqrt(Float64(c * Float64(a * -4.0))) / a));
      	else
      		tmp = Float64(Float64(-c) / b);
      	end
      	return tmp
      end
      
      function tmp_2 = code(a, b, c)
      	tmp = 0.0;
      	if (b <= -8.2e-91)
      		tmp = (c / b) - (b / a);
      	elseif (b <= 36.0)
      		tmp = 0.5 * (sqrt((c * (a * -4.0))) / a);
      	else
      		tmp = -c / b;
      	end
      	tmp_2 = tmp;
      end
      
      code[a_, b_, c_] := If[LessEqual[b, -8.2e-91], N[(N[(c / b), $MachinePrecision] - N[(b / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 36.0], N[(0.5 * N[(N[Sqrt[N[(c * N[(a * -4.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], N[((-c) / b), $MachinePrecision]]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      \mathbf{if}\;b \leq -8.2 \cdot 10^{-91}:\\
      \;\;\;\;\frac{c}{b} - \frac{b}{a}\\
      
      \mathbf{elif}\;b \leq 36:\\
      \;\;\;\;0.5 \cdot \frac{\sqrt{c \cdot \left(a \cdot -4\right)}}{a}\\
      
      \mathbf{else}:\\
      \;\;\;\;\frac{-c}{b}\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 3 regimes
      2. if b < -8.20000000000000048e-91

        1. Initial program 70.9%

          \[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a} \]
        2. Taylor expanded in b around -inf 86.9%

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

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

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

            \[\leadsto \color{blue}{\frac{c}{b} - \frac{b}{a}} \]
        4. Simplified86.9%

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

        if -8.20000000000000048e-91 < b < 36

        1. Initial program 79.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. prod-diff79.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)}}}{2 \cdot a} \]
          2. *-commutative79.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)}}{2 \cdot a} \]
          3. fma-def79.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)}}{2 \cdot a} \]
          4. associate-+l+79.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)}}}{2 \cdot a} \]
          5. *-commutative79.2%

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

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

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

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

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

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

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

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

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

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

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

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

          \[\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)} \]
        5. Step-by-step derivation
          1. associate-*l/73.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-identity73.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. distribute-rgt-out73.5%

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

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

            \[\leadsto 0.5 \cdot \frac{\sqrt{\left(c \cdot a\right) \cdot \color{blue}{-4}}}{a} \]
          6. associate-*l*73.5%

            \[\leadsto 0.5 \cdot \frac{\sqrt{\color{blue}{c \cdot \left(a \cdot -4\right)}}}{a} \]
          7. *-commutative73.5%

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

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

        if 36 < b

        1. Initial program 8.5%

          \[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a} \]
        2. Taylor expanded in b around inf 94.3%

          \[\leadsto \color{blue}{-1 \cdot \frac{c}{b}} \]
        3. Step-by-step derivation
          1. associate-*r/94.3%

            \[\leadsto \color{blue}{\frac{-1 \cdot c}{b}} \]
          2. neg-mul-194.3%

            \[\leadsto \frac{\color{blue}{-c}}{b} \]
        4. Simplified94.3%

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

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -8.2 \cdot 10^{-91}:\\ \;\;\;\;\frac{c}{b} - \frac{b}{a}\\ \mathbf{elif}\;b \leq 36:\\ \;\;\;\;0.5 \cdot \frac{\sqrt{c \cdot \left(a \cdot -4\right)}}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{-c}{b}\\ \end{array} \]

      Alternative 6: 67.2% 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 75.4%

          \[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a} \]
        2. Taylor expanded in b around -inf 67.2%

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

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

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

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

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

        if -4.999999999999985e-310 < b

        1. Initial program 34.6%

          \[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a} \]
        2. Taylor expanded in b around inf 65.7%

          \[\leadsto \color{blue}{-1 \cdot \frac{c}{b}} \]
        3. Step-by-step derivation
          1. associate-*r/65.7%

            \[\leadsto \color{blue}{\frac{-1 \cdot c}{b}} \]
          2. neg-mul-165.7%

            \[\leadsto \frac{\color{blue}{-c}}{b} \]
        4. Simplified65.7%

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

        \[\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} \]

      Alternative 7: 67.0% accurate, 19.1× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq 2.85 \cdot 10^{-301}:\\ \;\;\;\;\frac{-b}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{-c}{b}\\ \end{array} \end{array} \]
      (FPCore (a b c)
       :precision binary64
       (if (<= b 2.85e-301) (/ (- b) a) (/ (- c) b)))
      double code(double a, double b, double c) {
      	double tmp;
      	if (b <= 2.85e-301) {
      		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 <= 2.85d-301) 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 <= 2.85e-301) {
      		tmp = -b / a;
      	} else {
      		tmp = -c / b;
      	}
      	return tmp;
      }
      
      def code(a, b, c):
      	tmp = 0
      	if b <= 2.85e-301:
      		tmp = -b / a
      	else:
      		tmp = -c / b
      	return tmp
      
      function code(a, b, c)
      	tmp = 0.0
      	if (b <= 2.85e-301)
      		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 <= 2.85e-301)
      		tmp = -b / a;
      	else
      		tmp = -c / b;
      	end
      	tmp_2 = tmp;
      end
      
      code[a_, b_, c_] := If[LessEqual[b, 2.85e-301], N[((-b) / a), $MachinePrecision], N[((-c) / b), $MachinePrecision]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      \mathbf{if}\;b \leq 2.85 \cdot 10^{-301}:\\
      \;\;\;\;\frac{-b}{a}\\
      
      \mathbf{else}:\\
      \;\;\;\;\frac{-c}{b}\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if b < 2.85000000000000018e-301

        1. Initial program 75.6%

          \[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a} \]
        2. Taylor expanded in b around -inf 66.3%

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

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

            \[\leadsto \frac{\color{blue}{-b}}{a} \]
        4. Simplified66.3%

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

        if 2.85000000000000018e-301 < b

        1. Initial program 34.1%

          \[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a} \]
        2. Taylor expanded in b around inf 66.2%

          \[\leadsto \color{blue}{-1 \cdot \frac{c}{b}} \]
        3. Step-by-step derivation
          1. associate-*r/66.2%

            \[\leadsto \color{blue}{\frac{-1 \cdot c}{b}} \]
          2. neg-mul-166.2%

            \[\leadsto \frac{\color{blue}{-c}}{b} \]
        4. Simplified66.2%

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

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq 2.85 \cdot 10^{-301}:\\ \;\;\;\;\frac{-b}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{-c}{b}\\ \end{array} \]

      Alternative 8: 35.7% accurate, 29.0× speedup?

      \[\begin{array}{l} \\ \frac{-b}{a} \end{array} \]
      (FPCore (a b c) :precision binary64 (/ (- b) a))
      double code(double a, double b, double c) {
      	return -b / 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 / a
      end function
      
      public static double code(double a, double b, double c) {
      	return -b / a;
      }
      
      def code(a, b, c):
      	return -b / a
      
      function code(a, b, c)
      	return Float64(Float64(-b) / a)
      end
      
      function tmp = code(a, b, c)
      	tmp = -b / a;
      end
      
      code[a_, b_, c_] := N[((-b) / a), $MachinePrecision]
      
      \begin{array}{l}
      
      \\
      \frac{-b}{a}
      \end{array}
      
      Derivation
      1. Initial program 53.9%

        \[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a} \]
      2. Taylor expanded in b around -inf 33.0%

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

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

          \[\leadsto \frac{\color{blue}{-b}}{a} \]
      4. Simplified33.0%

        \[\leadsto \color{blue}{\frac{-b}{a}} \]
      5. Final simplification33.0%

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

      Alternative 9: 2.5% accurate, 38.7× speedup?

      \[\begin{array}{l} \\ \frac{b}{a} \end{array} \]
      (FPCore (a b c) :precision binary64 (/ b a))
      double code(double a, double b, double c) {
      	return b / 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 / a
      end function
      
      public static double code(double a, double b, double c) {
      	return b / a;
      }
      
      def code(a, b, c):
      	return b / a
      
      function code(a, b, c)
      	return Float64(b / a)
      end
      
      function tmp = code(a, b, c)
      	tmp = b / a;
      end
      
      code[a_, b_, c_] := N[(b / a), $MachinePrecision]
      
      \begin{array}{l}
      
      \\
      \frac{b}{a}
      \end{array}
      
      Derivation
      1. Initial program 53.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. clear-num53.8%

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

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

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

          \[\leadsto \frac{\color{blue}{0.5}}{a} \cdot \left(\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}\right) \]
        5. add-sqr-sqrt35.5%

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

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

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

          \[\leadsto \frac{0.5}{a} \cdot \left(\color{blue}{\sqrt{b} \cdot \sqrt{b}} + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}\right) \]
        9. add-sqr-sqrt34.1%

          \[\leadsto \frac{0.5}{a} \cdot \left(\color{blue}{b} + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}\right) \]
        10. sub-neg34.1%

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

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

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

          \[\leadsto \frac{0.5}{a} \cdot \left(b + \mathsf{hypot}\left(b, \sqrt{-\color{blue}{c \cdot \left(4 \cdot a\right)}}\right)\right) \]
        14. distribute-rgt-neg-in29.2%

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

          \[\leadsto \frac{0.5}{a} \cdot \left(b + \mathsf{hypot}\left(b, \sqrt{c \cdot \left(-\color{blue}{a \cdot 4}\right)}\right)\right) \]
        16. distribute-rgt-neg-in29.2%

          \[\leadsto \frac{0.5}{a} \cdot \left(b + \mathsf{hypot}\left(b, \sqrt{c \cdot \color{blue}{\left(a \cdot \left(-4\right)\right)}}\right)\right) \]
        17. metadata-eval29.2%

          \[\leadsto \frac{0.5}{a} \cdot \left(b + \mathsf{hypot}\left(b, \sqrt{c \cdot \left(a \cdot \color{blue}{-4}\right)}\right)\right) \]
      3. Applied egg-rr29.2%

        \[\leadsto \color{blue}{\frac{0.5}{a} \cdot \left(b + \mathsf{hypot}\left(b, \sqrt{c \cdot \left(a \cdot -4\right)}\right)\right)} \]
      4. Taylor expanded in a around 0 2.6%

        \[\leadsto \color{blue}{\frac{b}{a}} \]
      5. Final simplification2.6%

        \[\leadsto \frac{b}{a} \]

      Developer target: 70.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 2023293 
      (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)))