The quadratic formula (r2)

Percentage Accurate: 51.9% → 85.2%
Time: 18.8s
Alternatives: 9
Speedup: 19.1×

Specification

?
\[\begin{array}{l} \\ \frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{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(4.0 * Float64(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[(4.0 * N[(a * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[(2.0 * a), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

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

\[\begin{array}{l} \\ \frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{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(4.0 * Float64(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[(4.0 * N[(a * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[(2.0 * a), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

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

Alternative 1: 85.2% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{-c}{b}\\ \mathbf{if}\;b \leq -8.5 \cdot 10^{+42}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;b \leq -2.2 \cdot 10^{-13}:\\ \;\;\;\;\frac{\frac{c \cdot a}{a} \cdot -2}{b - \mathsf{hypot}\left(b, \sqrt{a \cdot \left(c \cdot -4\right)}\right)}\\ \mathbf{elif}\;b \leq -9.6 \cdot 10^{-46}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;b \leq 3.8 \cdot 10^{+96}:\\ \;\;\;\;\frac{\left(-b\right) - \sqrt{\mathsf{fma}\left(a \cdot -4, c, b \cdot b\right)}}{a \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;-\frac{b}{a}\\ \end{array} \end{array} \]
(FPCore (a b c)
 :precision binary64
 (let* ((t_0 (/ (- c) b)))
   (if (<= b -8.5e+42)
     t_0
     (if (<= b -2.2e-13)
       (/ (* (/ (* c a) a) -2.0) (- b (hypot b (sqrt (* a (* c -4.0))))))
       (if (<= b -9.6e-46)
         t_0
         (if (<= b 3.8e+96)
           (/ (- (- b) (sqrt (fma (* a -4.0) c (* b b)))) (* a 2.0))
           (- (/ b a))))))))
double code(double a, double b, double c) {
	double t_0 = -c / b;
	double tmp;
	if (b <= -8.5e+42) {
		tmp = t_0;
	} else if (b <= -2.2e-13) {
		tmp = (((c * a) / a) * -2.0) / (b - hypot(b, sqrt((a * (c * -4.0)))));
	} else if (b <= -9.6e-46) {
		tmp = t_0;
	} else if (b <= 3.8e+96) {
		tmp = (-b - sqrt(fma((a * -4.0), c, (b * b)))) / (a * 2.0);
	} else {
		tmp = -(b / a);
	}
	return tmp;
}
function code(a, b, c)
	t_0 = Float64(Float64(-c) / b)
	tmp = 0.0
	if (b <= -8.5e+42)
		tmp = t_0;
	elseif (b <= -2.2e-13)
		tmp = Float64(Float64(Float64(Float64(c * a) / a) * -2.0) / Float64(b - hypot(b, sqrt(Float64(a * Float64(c * -4.0))))));
	elseif (b <= -9.6e-46)
		tmp = t_0;
	elseif (b <= 3.8e+96)
		tmp = Float64(Float64(Float64(-b) - sqrt(fma(Float64(a * -4.0), c, Float64(b * b)))) / Float64(a * 2.0));
	else
		tmp = Float64(-Float64(b / a));
	end
	return tmp
end
code[a_, b_, c_] := Block[{t$95$0 = N[((-c) / b), $MachinePrecision]}, If[LessEqual[b, -8.5e+42], t$95$0, If[LessEqual[b, -2.2e-13], N[(N[(N[(N[(c * a), $MachinePrecision] / a), $MachinePrecision] * -2.0), $MachinePrecision] / N[(b - N[Sqrt[b ^ 2 + N[Sqrt[N[(a * N[(c * -4.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, -9.6e-46], t$95$0, If[LessEqual[b, 3.8e+96], N[(N[((-b) - N[Sqrt[N[(N[(a * -4.0), $MachinePrecision] * c + N[(b * b), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[(a * 2.0), $MachinePrecision]), $MachinePrecision], (-N[(b / a), $MachinePrecision])]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \frac{-c}{b}\\
\mathbf{if}\;b \leq -8.5 \cdot 10^{+42}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;b \leq -2.2 \cdot 10^{-13}:\\
\;\;\;\;\frac{\frac{c \cdot a}{a} \cdot -2}{b - \mathsf{hypot}\left(b, \sqrt{a \cdot \left(c \cdot -4\right)}\right)}\\

\mathbf{elif}\;b \leq -9.6 \cdot 10^{-46}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;b \leq 3.8 \cdot 10^{+96}:\\
\;\;\;\;\frac{\left(-b\right) - \sqrt{\mathsf{fma}\left(a \cdot -4, c, b \cdot b\right)}}{a \cdot 2}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if b < -8.5000000000000003e42 or -2.19999999999999997e-13 < b < -9.60000000000000053e-46

    1. Initial program 12.2%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{-c}}{b} \]
    6. Simplified94.2%

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

    if -8.5000000000000003e42 < b < -2.19999999999999997e-13

    1. Initial program 69.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\frac{a \cdot \left(c \cdot -4\right) - \color{blue}{\left(b \cdot b + b \cdot b\right)}}{b - \mathsf{hypot}\left(b, \sqrt{c \cdot \left(a \cdot -4\right)}\right)}}{a \cdot 2} \]
      10. distribute-lft-out54.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\frac{\color{blue}{\left(a \cdot c\right) \cdot -4}}{a \cdot 2}}{b - \mathsf{hypot}\left(b, \sqrt{a \cdot \left(c \cdot -4\right)}\right)} \]
      5. rem-square-sqrt0.0%

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

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

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

        \[\leadsto \frac{\frac{a \cdot c}{a} \cdot \frac{\color{blue}{\sqrt{-4} \cdot \sqrt{-4}}}{2}}{b - \mathsf{hypot}\left(b, \sqrt{a \cdot \left(c \cdot -4\right)}\right)} \]
      9. rem-square-sqrt84.6%

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

        \[\leadsto \frac{\frac{a \cdot c}{a} \cdot \color{blue}{-2}}{b - \mathsf{hypot}\left(b, \sqrt{a \cdot \left(c \cdot -4\right)}\right)} \]
    14. Simplified84.6%

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

    if -9.60000000000000053e-46 < b < 3.8000000000000002e96

    1. Initial program 86.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.8000000000000002e96 < b

    1. Initial program 54.0%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{-b}}{a} \]
    6. Simplified93.5%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -8.5 \cdot 10^{+42}:\\ \;\;\;\;\frac{-c}{b}\\ \mathbf{elif}\;b \leq -2.2 \cdot 10^{-13}:\\ \;\;\;\;\frac{\frac{c \cdot a}{a} \cdot -2}{b - \mathsf{hypot}\left(b, \sqrt{a \cdot \left(c \cdot -4\right)}\right)}\\ \mathbf{elif}\;b \leq -9.6 \cdot 10^{-46}:\\ \;\;\;\;\frac{-c}{b}\\ \mathbf{elif}\;b \leq 3.8 \cdot 10^{+96}:\\ \;\;\;\;\frac{\left(-b\right) - \sqrt{\mathsf{fma}\left(a \cdot -4, c, b \cdot b\right)}}{a \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;-\frac{b}{a}\\ \end{array} \]

Alternative 2: 86.2% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq -1.34 \cdot 10^{-45}:\\ \;\;\;\;\frac{-c}{b}\\ \mathbf{elif}\;b \leq 2 \cdot 10^{+96}:\\ \;\;\;\;\frac{\left(-b\right) - \sqrt{\mathsf{fma}\left(a \cdot -4, c, b \cdot b\right)}}{a \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;-\frac{b}{a}\\ \end{array} \end{array} \]
(FPCore (a b c)
 :precision binary64
 (if (<= b -1.34e-45)
   (/ (- c) b)
   (if (<= b 2e+96)
     (/ (- (- b) (sqrt (fma (* a -4.0) c (* b b)))) (* a 2.0))
     (- (/ b a)))))
double code(double a, double b, double c) {
	double tmp;
	if (b <= -1.34e-45) {
		tmp = -c / b;
	} else if (b <= 2e+96) {
		tmp = (-b - sqrt(fma((a * -4.0), c, (b * b)))) / (a * 2.0);
	} else {
		tmp = -(b / a);
	}
	return tmp;
}
function code(a, b, c)
	tmp = 0.0
	if (b <= -1.34e-45)
		tmp = Float64(Float64(-c) / b);
	elseif (b <= 2e+96)
		tmp = Float64(Float64(Float64(-b) - sqrt(fma(Float64(a * -4.0), c, Float64(b * b)))) / Float64(a * 2.0));
	else
		tmp = Float64(-Float64(b / a));
	end
	return tmp
end
code[a_, b_, c_] := If[LessEqual[b, -1.34e-45], N[((-c) / b), $MachinePrecision], If[LessEqual[b, 2e+96], N[(N[((-b) - N[Sqrt[N[(N[(a * -4.0), $MachinePrecision] * c + N[(b * b), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[(a * 2.0), $MachinePrecision]), $MachinePrecision], (-N[(b / a), $MachinePrecision])]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;b \leq -1.34 \cdot 10^{-45}:\\
\;\;\;\;\frac{-c}{b}\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if b < -1.34e-45

    1. Initial program 20.0%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{-c}}{b} \]
    6. Simplified87.5%

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

    if -1.34e-45 < b < 2.0000000000000001e96

    1. Initial program 86.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.0000000000000001e96 < b

    1. Initial program 54.0%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{-b}}{a} \]
    6. Simplified93.5%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -1.34 \cdot 10^{-45}:\\ \;\;\;\;\frac{-c}{b}\\ \mathbf{elif}\;b \leq 2 \cdot 10^{+96}:\\ \;\;\;\;\frac{\left(-b\right) - \sqrt{\mathsf{fma}\left(a \cdot -4, c, b \cdot b\right)}}{a \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;-\frac{b}{a}\\ \end{array} \]

Alternative 3: 86.2% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq -4.4 \cdot 10^{-45}:\\
\;\;\;\;\frac{-c}{b}\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if b < -4.39999999999999987e-45

    1. Initial program 20.0%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{-c}}{b} \]
    6. Simplified87.5%

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

    if -4.39999999999999987e-45 < b < 2.04999999999999993e95

    1. Initial program 86.3%

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

    if 2.04999999999999993e95 < b

    1. Initial program 54.0%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{-b}}{a} \]
    6. Simplified93.5%

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

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

Alternative 4: 86.2% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq -5.2 \cdot 10^{-45}:\\
\;\;\;\;\frac{-c}{b}\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if b < -5.19999999999999973e-45

    1. Initial program 20.0%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{-c}}{b} \]
    6. Simplified87.5%

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

    if -5.19999999999999973e-45 < b < 1.00000000000000005e96

    1. Initial program 86.3%

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

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

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

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

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

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

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

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

    if 1.00000000000000005e96 < b

    1. Initial program 54.0%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{-b}}{a} \]
    6. Simplified93.5%

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

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

Alternative 5: 81.1% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq -1.22 \cdot 10^{-68}:\\
\;\;\;\;\frac{-c}{b}\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if b < -1.2200000000000001e-68

    1. Initial program 20.7%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{-c}}{b} \]
    6. Simplified86.8%

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

    if -1.2200000000000001e-68 < b < 2.5000000000000001e-28

    1. Initial program 82.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.5000000000000001e-28 < b

    1. Initial program 68.5%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{-b}}{a} \]
    6. Simplified87.3%

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

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

Alternative 6: 43.6% accurate, 19.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq -5500000000:\\ \;\;\;\;\frac{c}{b}\\ \mathbf{else}:\\ \;\;\;\;-\frac{b}{a}\\ \end{array} \end{array} \]
(FPCore (a b c)
 :precision binary64
 (if (<= b -5500000000.0) (/ c b) (- (/ b a))))
double code(double a, double b, double c) {
	double tmp;
	if (b <= -5500000000.0) {
		tmp = c / b;
	} else {
		tmp = -(b / 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 <= (-5500000000.0d0)) then
        tmp = c / b
    else
        tmp = -(b / a)
    end if
    code = tmp
end function
public static double code(double a, double b, double c) {
	double tmp;
	if (b <= -5500000000.0) {
		tmp = c / b;
	} else {
		tmp = -(b / a);
	}
	return tmp;
}
def code(a, b, c):
	tmp = 0
	if b <= -5500000000.0:
		tmp = c / b
	else:
		tmp = -(b / a)
	return tmp
function code(a, b, c)
	tmp = 0.0
	if (b <= -5500000000.0)
		tmp = Float64(c / b);
	else
		tmp = Float64(-Float64(b / a));
	end
	return tmp
end
function tmp_2 = code(a, b, c)
	tmp = 0.0;
	if (b <= -5500000000.0)
		tmp = c / b;
	else
		tmp = -(b / a);
	end
	tmp_2 = tmp;
end
code[a_, b_, c_] := If[LessEqual[b, -5500000000.0], N[(c / b), $MachinePrecision], (-N[(b / a), $MachinePrecision])]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;b \leq -5500000000:\\
\;\;\;\;\frac{c}{b}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if b < -5.5e9

    1. Initial program 15.9%

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

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

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

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

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

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

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

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

      \[\leadsto \frac{\color{blue}{-2 \cdot b + 2 \cdot \frac{a \cdot c}{b}}}{a \cdot 2} \]
    5. Taylor expanded in b around 0 33.3%

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

    if -5.5e9 < b

    1. Initial program 71.9%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{-b}}{a} \]
    6. Simplified48.9%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -5500000000:\\ \;\;\;\;\frac{c}{b}\\ \mathbf{else}:\\ \;\;\;\;-\frac{b}{a}\\ \end{array} \]

Alternative 7: 68.2% accurate, 19.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq -1 \cdot 10^{-311}:\\ \;\;\;\;\frac{-c}{b}\\ \mathbf{else}:\\ \;\;\;\;-\frac{b}{a}\\ \end{array} \end{array} \]
(FPCore (a b c)
 :precision binary64
 (if (<= b -1e-311) (/ (- c) b) (- (/ b a))))
double code(double a, double b, double c) {
	double tmp;
	if (b <= -1e-311) {
		tmp = -c / b;
	} else {
		tmp = -(b / 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 <= (-1d-311)) then
        tmp = -c / b
    else
        tmp = -(b / a)
    end if
    code = tmp
end function
public static double code(double a, double b, double c) {
	double tmp;
	if (b <= -1e-311) {
		tmp = -c / b;
	} else {
		tmp = -(b / a);
	}
	return tmp;
}
def code(a, b, c):
	tmp = 0
	if b <= -1e-311:
		tmp = -c / b
	else:
		tmp = -(b / a)
	return tmp
function code(a, b, c)
	tmp = 0.0
	if (b <= -1e-311)
		tmp = Float64(Float64(-c) / b);
	else
		tmp = Float64(-Float64(b / a));
	end
	return tmp
end
function tmp_2 = code(a, b, c)
	tmp = 0.0;
	if (b <= -1e-311)
		tmp = -c / b;
	else
		tmp = -(b / a);
	end
	tmp_2 = tmp;
end
code[a_, b_, c_] := If[LessEqual[b, -1e-311], N[((-c) / b), $MachinePrecision], (-N[(b / a), $MachinePrecision])]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;b \leq -1 \cdot 10^{-311}:\\
\;\;\;\;\frac{-c}{b}\\

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


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

    1. Initial program 33.9%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{-c}}{b} \]
    6. Simplified69.6%

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

    if -9.99999999999948e-312 < b

    1. Initial program 74.3%

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

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

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

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

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

        \[\leadsto \frac{\left(-b\right) - \sqrt{b \cdot b - \color{blue}{\left(4 \cdot a\right) \cdot c}}}{2 \cdot a} \]
      6. *-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. Taylor expanded in b around inf 65.2%

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

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

        \[\leadsto \frac{\color{blue}{-b}}{a} \]
    6. Simplified65.2%

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

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

Alternative 8: 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 54.4%

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \frac{\color{blue}{{\left(\sqrt[3]{b - \mathsf{hypot}\left(b, \sqrt{c \cdot \left(a \cdot -4\right)}\right)}\right)}^{3}}}{a \cdot 2} \]
  6. Taylor expanded in b around -inf 2.4%

    \[\leadsto \color{blue}{\frac{b}{a}} \]
  7. Final simplification2.4%

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

Alternative 9: 11.1% accurate, 38.7× speedup?

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

\\
\frac{c}{b}
\end{array}
Derivation
  1. Initial program 54.4%

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

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

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

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

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

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

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

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

    \[\leadsto \frac{\color{blue}{-2 \cdot b + 2 \cdot \frac{a \cdot c}{b}}}{a \cdot 2} \]
  5. Taylor expanded in b around 0 12.6%

    \[\leadsto \color{blue}{\frac{c}{b}} \]
  6. Final simplification12.6%

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

Developer target: 70.8% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}\\ \mathbf{if}\;b < 0:\\ \;\;\;\;\frac{c}{a \cdot \frac{\left(-b\right) + t_0}{2 \cdot a}}\\ \mathbf{else}:\\ \;\;\;\;\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)
     (/ c (* a (/ (+ (- b) t_0) (* 2.0 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 = c / (a * ((-b + t_0) / (2.0 * a)));
	} else {
		tmp = (-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 = c / (a * ((-b + t_0) / (2.0d0 * a)))
    else
        tmp = (-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 = c / (a * ((-b + t_0) / (2.0 * a)));
	} else {
		tmp = (-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 = c / (a * ((-b + t_0) / (2.0 * a)))
	else:
		tmp = (-b - t_0) / (2.0 * a)
	return tmp
function code(a, b, c)
	t_0 = sqrt(Float64(Float64(b * b) - Float64(4.0 * Float64(a * c))))
	tmp = 0.0
	if (b < 0.0)
		tmp = Float64(c / Float64(a * Float64(Float64(Float64(-b) + t_0) / Float64(2.0 * a))));
	else
		tmp = 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 = c / (a * ((-b + t_0) / (2.0 * a)));
	else
		tmp = (-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[(4.0 * N[(a * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[Less[b, 0.0], N[(c / N[(a * N[(N[((-b) + t$95$0), $MachinePrecision] / N[(2.0 * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[((-b) - t$95$0), $MachinePrecision] / N[(2.0 * a), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

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

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


\end{array}
\end{array}

Reproduce

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

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

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