The quadratic formula (r2)

Percentage Accurate: 52.1% → 86.1%
Time: 12.7s
Alternatives: 8
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 8 alternatives:

AlternativeAccuracySpeedup
The accuracy (vertical axis) and speed (horizontal axis) of each alternatives. Up and to the right is better. The red square shows the initial program, and each blue circle shows an alternative.The line shows the best available speed-accuracy tradeoffs.

Initial Program: 52.1% 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: 86.1% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{-c}{b}\\ \mathbf{if}\;b \leq -7 \cdot 10^{+29}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;b \leq -1.05 \cdot 10^{-79}:\\ \;\;\;\;-0.5 \cdot \frac{\frac{c \cdot \left(a \cdot 4\right)}{b - \sqrt{\mathsf{fma}\left(c, a \cdot -4, b \cdot b\right)}}}{a}\\ \mathbf{elif}\;b \leq -1 \cdot 10^{-122}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;b \leq 5 \cdot 10^{+99}:\\ \;\;\;\;-0.5 \cdot \frac{b + \sqrt{b \cdot b - a \cdot \left(c \cdot 4\right)}}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{-b}{a}\\ \end{array} \end{array} \]
(FPCore (a b c)
 :precision binary64
 (let* ((t_0 (/ (- c) b)))
   (if (<= b -7e+29)
     t_0
     (if (<= b -1.05e-79)
       (*
        -0.5
        (/ (/ (* c (* a 4.0)) (- b (sqrt (fma c (* a -4.0) (* b b))))) a))
       (if (<= b -1e-122)
         t_0
         (if (<= b 5e+99)
           (* -0.5 (/ (+ b (sqrt (- (* b b) (* a (* c 4.0))))) a))
           (/ (- b) a)))))))
double code(double a, double b, double c) {
	double t_0 = -c / b;
	double tmp;
	if (b <= -7e+29) {
		tmp = t_0;
	} else if (b <= -1.05e-79) {
		tmp = -0.5 * (((c * (a * 4.0)) / (b - sqrt(fma(c, (a * -4.0), (b * b))))) / a);
	} else if (b <= -1e-122) {
		tmp = t_0;
	} else if (b <= 5e+99) {
		tmp = -0.5 * ((b + sqrt(((b * b) - (a * (c * 4.0))))) / a);
	} else {
		tmp = -b / a;
	}
	return tmp;
}
function code(a, b, c)
	t_0 = Float64(Float64(-c) / b)
	tmp = 0.0
	if (b <= -7e+29)
		tmp = t_0;
	elseif (b <= -1.05e-79)
		tmp = Float64(-0.5 * Float64(Float64(Float64(c * Float64(a * 4.0)) / Float64(b - sqrt(fma(c, Float64(a * -4.0), Float64(b * b))))) / a));
	elseif (b <= -1e-122)
		tmp = t_0;
	elseif (b <= 5e+99)
		tmp = Float64(-0.5 * Float64(Float64(b + sqrt(Float64(Float64(b * b) - Float64(a * Float64(c * 4.0))))) / a));
	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, -7e+29], t$95$0, If[LessEqual[b, -1.05e-79], N[(-0.5 * N[(N[(N[(c * N[(a * 4.0), $MachinePrecision]), $MachinePrecision] / N[(b - N[Sqrt[N[(c * N[(a * -4.0), $MachinePrecision] + N[(b * b), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, -1e-122], t$95$0, If[LessEqual[b, 5e+99], N[(-0.5 * N[(N[(b + N[Sqrt[N[(N[(b * b), $MachinePrecision] - N[(a * N[(c * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], N[((-b) / a), $MachinePrecision]]]]]]
\begin{array}{l}

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

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

\mathbf{elif}\;b \leq -1 \cdot 10^{-122}:\\
\;\;\;\;t_0\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if b < -6.99999999999999958e29 or -1.05e-79 < b < -1.00000000000000006e-122

    1. Initial program 14.7%

      \[\frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{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}} \]

    if -6.99999999999999958e29 < b < -1.05e-79

    1. Initial program 37.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. /-rgt-identity37.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto -0.5 \cdot \frac{\frac{b \cdot b - \color{blue}{\left(b \cdot b - a \cdot \left(c \cdot 4\right)\right)}}{b - \sqrt{b \cdot b - a \cdot \left(c \cdot 4\right)}}}{a} \]
    7. Applied egg-rr37.1%

      \[\leadsto -0.5 \cdot \frac{\color{blue}{\frac{b \cdot b - \left(b \cdot b - a \cdot \left(c \cdot 4\right)\right)}{b - \sqrt{b \cdot b - a \cdot \left(c \cdot 4\right)}}}}{a} \]
    8. Step-by-step derivation
      1. associate--r-83.8%

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

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

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

        \[\leadsto -0.5 \cdot \frac{\frac{0 + \color{blue}{\left(c \cdot a\right)} \cdot 4}{b - \sqrt{b \cdot b - a \cdot \left(c \cdot 4\right)}}}{a} \]
      5. associate-*l*83.8%

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

        \[\leadsto -0.5 \cdot \frac{\frac{0 + c \cdot \left(a \cdot 4\right)}{b - \sqrt{b \cdot b - \color{blue}{\left(c \cdot 4\right) \cdot a}}}}{a} \]
      7. cancel-sign-sub-inv83.8%

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

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

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

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

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

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

        \[\leadsto -0.5 \cdot \frac{\frac{0 + c \cdot \left(a \cdot 4\right)}{b - \sqrt{\color{blue}{\left(c \cdot a\right) \cdot -4} + b \cdot b}}}{a} \]
      14. associate-*l*83.8%

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

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

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

    if -1.00000000000000006e-122 < b < 5.00000000000000008e99

    1. Initial program 79.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. /-rgt-identity79.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto -0.5 \cdot \color{blue}{\left(-1 \cdot \frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{a}\right)} \]
      16. div-sub79.7%

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

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

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

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

        \[\leadsto -0.5 \cdot \frac{b + \sqrt{\left(a \cdot c\right) \cdot \color{blue}{\left(-4\right)} + b \cdot b}}{a} \]
      4. distribute-rgt-neg-in79.7%

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

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

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

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

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

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

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

    if 5.00000000000000008e99 < b

    1. Initial program 58.2%

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

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

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

        \[\leadsto \frac{\color{blue}{-b}}{a} \]
    4. Simplified95.7%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -7 \cdot 10^{+29}:\\ \;\;\;\;\frac{-c}{b}\\ \mathbf{elif}\;b \leq -1.05 \cdot 10^{-79}:\\ \;\;\;\;-0.5 \cdot \frac{\frac{c \cdot \left(a \cdot 4\right)}{b - \sqrt{\mathsf{fma}\left(c, a \cdot -4, b \cdot b\right)}}}{a}\\ \mathbf{elif}\;b \leq -1 \cdot 10^{-122}:\\ \;\;\;\;\frac{-c}{b}\\ \mathbf{elif}\;b \leq 5 \cdot 10^{+99}:\\ \;\;\;\;-0.5 \cdot \frac{b + \sqrt{b \cdot b - a \cdot \left(c \cdot 4\right)}}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{-b}{a}\\ \end{array} \]

Alternative 2: 85.2% accurate, 1.0× speedup?

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

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

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

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


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

    1. Initial program 19.9%

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

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

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

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

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

    if -9.4999999999999996e-115 < b < 1.25e97

    1. Initial program 79.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. /-rgt-identity79.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto -0.5 \cdot \color{blue}{\left(-1 \cdot \frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{a}\right)} \]
      16. div-sub79.7%

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

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

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

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

        \[\leadsto -0.5 \cdot \frac{b + \sqrt{\left(a \cdot c\right) \cdot \color{blue}{\left(-4\right)} + b \cdot b}}{a} \]
      4. distribute-rgt-neg-in79.7%

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

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

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

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

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

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

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

    if 1.25e97 < b

    1. Initial program 58.2%

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

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

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

        \[\leadsto \frac{\color{blue}{-b}}{a} \]
    4. Simplified95.7%

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

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

Alternative 3: 80.7% accurate, 1.0× speedup?

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

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

\mathbf{elif}\;b \leq 1.36 \cdot 10^{-46}:\\
\;\;\;\;-0.5 \cdot \left(\left(b + \sqrt{c \cdot \left(a \cdot -4\right)}\right) \cdot \frac{1}{a}\right)\\

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


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

    1. Initial program 19.9%

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

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

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

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

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

    if -9.5000000000000002e-119 < b < 1.3600000000000001e-46

    1. Initial program 74.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. /-rgt-identity74.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto -0.5 \cdot \color{blue}{\left(-1 \cdot \frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{a}\right)} \]
      16. div-sub74.9%

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

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

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

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

        \[\leadsto -0.5 \cdot \frac{b + \sqrt{\left(a \cdot c\right) \cdot \color{blue}{\left(-4\right)} + b \cdot b}}{a} \]
      4. distribute-rgt-neg-in74.9%

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

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

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

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

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

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

      \[\leadsto -0.5 \cdot \frac{b + \sqrt{\color{blue}{b \cdot b - a \cdot \left(c \cdot 4\right)}}}{a} \]
    6. Step-by-step derivation
      1. div-inv75.0%

        \[\leadsto -0.5 \cdot \color{blue}{\left(\left(b + \sqrt{b \cdot b - a \cdot \left(c \cdot 4\right)}\right) \cdot \frac{1}{a}\right)} \]
    7. Applied egg-rr75.0%

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

      \[\leadsto -0.5 \cdot \left(\left(b + \sqrt{\color{blue}{-4 \cdot \left(c \cdot a\right)}}\right) \cdot \frac{1}{a}\right) \]
    9. Step-by-step derivation
      1. *-commutative66.8%

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

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

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

    if 1.3600000000000001e-46 < b

    1. Initial program 72.1%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -9.5 \cdot 10^{-119}:\\ \;\;\;\;\frac{-c}{b}\\ \mathbf{elif}\;b \leq 1.36 \cdot 10^{-46}:\\ \;\;\;\;-0.5 \cdot \left(\left(b + \sqrt{c \cdot \left(a \cdot -4\right)}\right) \cdot \frac{1}{a}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{c}{b} - \frac{b}{a}\\ \end{array} \]

Alternative 4: 80.8% accurate, 1.0× speedup?

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

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

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

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


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

    1. Initial program 19.9%

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

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

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

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

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

    if -1.4000000000000001e-114 < b < 1.04999999999999994e-46

    1. Initial program 74.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. /-rgt-identity74.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto -0.5 \cdot \color{blue}{\left(-1 \cdot \frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{a}\right)} \]
      16. div-sub74.9%

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

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

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

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

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

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

    if 1.04999999999999994e-46 < b

    1. Initial program 72.1%

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

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

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

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

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

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

Alternative 5: 68.1% accurate, 12.8× speedup?

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

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

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


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

    1. Initial program 32.2%

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

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

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

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

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

    if -9.999999999999969e-311 < b

    1. Initial program 73.2%

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

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

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

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

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

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

Alternative 6: 43.2% accurate, 19.1× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq -4 \cdot 10^{+56}:\\
\;\;\;\;\frac{c}{b}\\

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


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

    1. Initial program 14.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. /-rgt-identity14.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto -0.5 \cdot \color{blue}{\left(-1 \cdot \frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{a}\right)} \]
      16. div-sub12.0%

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto -0.5 \cdot \frac{b + \color{blue}{\left(b + -2 \cdot \frac{c \cdot a}{b}\right)}}{a} \]
    7. Step-by-step derivation
      1. associate-/l*2.5%

        \[\leadsto -0.5 \cdot \frac{b + \left(b + -2 \cdot \color{blue}{\frac{c}{\frac{b}{a}}}\right)}{a} \]
    8. Simplified2.5%

      \[\leadsto -0.5 \cdot \frac{b + \color{blue}{\left(b + -2 \cdot \frac{c}{\frac{b}{a}}\right)}}{a} \]
    9. Taylor expanded in b around 0 42.2%

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

    if -4.00000000000000037e56 < b

    1. Initial program 64.7%

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

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

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

        \[\leadsto \frac{\color{blue}{-b}}{a} \]
    4. Simplified40.7%

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

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

Alternative 7: 67.9% accurate, 19.1× speedup?

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

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

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


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

    1. Initial program 32.2%

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

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

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

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

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

    if -9.999999999999969e-311 < b

    1. Initial program 73.2%

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

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

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

        \[\leadsto \frac{\color{blue}{-b}}{a} \]
    4. Simplified62.5%

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

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

Alternative 8: 10.6% 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 51.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. /-rgt-identity51.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto -0.5 \cdot \color{blue}{\left(-1 \cdot \frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{a}\right)} \]
    16. div-sub50.7%

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto -0.5 \cdot \frac{b + \color{blue}{\left(b + -2 \cdot \frac{c \cdot a}{b}\right)}}{a} \]
  7. Step-by-step derivation
    1. associate-/l*30.3%

      \[\leadsto -0.5 \cdot \frac{b + \left(b + -2 \cdot \color{blue}{\frac{c}{\frac{b}{a}}}\right)}{a} \]
  8. Simplified30.3%

    \[\leadsto -0.5 \cdot \frac{b + \color{blue}{\left(b + -2 \cdot \frac{c}{\frac{b}{a}}\right)}}{a} \]
  9. Taylor expanded in b around 0 13.4%

    \[\leadsto \color{blue}{\frac{c}{b}} \]
  10. Final simplification13.4%

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

Developer target: 70.4% 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 2023171 
(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)))