The quadratic formula (r2)

Percentage Accurate: 51.6% → 89.4%
Time: 14.5s
Alternatives: 11
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 11 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.6% 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: 89.4% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := a \cdot \left(c \cdot -4\right)\\ \mathbf{if}\;b \leq -3.5 \cdot 10^{+43}:\\ \;\;\;\;\frac{-c}{b}\\ \mathbf{elif}\;b \leq -2.75 \cdot 10^{-304}:\\ \;\;\;\;-0.5 \cdot \frac{c \cdot 4}{b - \sqrt{\mathsf{fma}\left(b, b, t_0\right)}}\\ \mathbf{elif}\;b \leq 4.2 \cdot 10^{+114}:\\ \;\;\;\;-0.5 \cdot \left(\frac{b}{a} + \frac{\sqrt{t_0 + b \cdot b}}{a}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{-b}{a}\\ \end{array} \end{array} \]
(FPCore (a b c)
 :precision binary64
 (let* ((t_0 (* a (* c -4.0))))
   (if (<= b -3.5e+43)
     (/ (- c) b)
     (if (<= b -2.75e-304)
       (* -0.5 (/ (* c 4.0) (- b (sqrt (fma b b t_0)))))
       (if (<= b 4.2e+114)
         (* -0.5 (+ (/ b a) (/ (sqrt (+ t_0 (* b b))) a)))
         (/ (- b) a))))))
double code(double a, double b, double c) {
	double t_0 = a * (c * -4.0);
	double tmp;
	if (b <= -3.5e+43) {
		tmp = -c / b;
	} else if (b <= -2.75e-304) {
		tmp = -0.5 * ((c * 4.0) / (b - sqrt(fma(b, b, t_0))));
	} else if (b <= 4.2e+114) {
		tmp = -0.5 * ((b / a) + (sqrt((t_0 + (b * b))) / a));
	} else {
		tmp = -b / a;
	}
	return tmp;
}
function code(a, b, c)
	t_0 = Float64(a * Float64(c * -4.0))
	tmp = 0.0
	if (b <= -3.5e+43)
		tmp = Float64(Float64(-c) / b);
	elseif (b <= -2.75e-304)
		tmp = Float64(-0.5 * Float64(Float64(c * 4.0) / Float64(b - sqrt(fma(b, b, t_0)))));
	elseif (b <= 4.2e+114)
		tmp = Float64(-0.5 * Float64(Float64(b / a) + Float64(sqrt(Float64(t_0 + Float64(b * b))) / a)));
	else
		tmp = Float64(Float64(-b) / a);
	end
	return tmp
end
code[a_, b_, c_] := Block[{t$95$0 = N[(a * N[(c * -4.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -3.5e+43], N[((-c) / b), $MachinePrecision], If[LessEqual[b, -2.75e-304], N[(-0.5 * N[(N[(c * 4.0), $MachinePrecision] / N[(b - N[Sqrt[N[(b * b + t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 4.2e+114], N[(-0.5 * N[(N[(b / a), $MachinePrecision] + N[(N[Sqrt[N[(t$95$0 + N[(b * b), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[((-b) / a), $MachinePrecision]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := a \cdot \left(c \cdot -4\right)\\
\mathbf{if}\;b \leq -3.5 \cdot 10^{+43}:\\
\;\;\;\;\frac{-c}{b}\\

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

\mathbf{elif}\;b \leq 4.2 \cdot 10^{+114}:\\
\;\;\;\;-0.5 \cdot \left(\frac{b}{a} + \frac{\sqrt{t_0 + b \cdot b}}{a}\right)\\

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


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

    1. Initial program 4.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.3%

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

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

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

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

    if -3.5000000000000001e43 < b < -2.75000000000000017e-304

    1. Initial program 57.7%

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

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

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

        \[\leadsto -0.5 \cdot \frac{b + \sqrt{\color{blue}{\left(a \cdot c\right) \cdot -4} + b \cdot b}}{a} \]
      3. metadata-eval57.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-in57.7%

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

        \[\leadsto -0.5 \cdot \frac{b + \sqrt{\left(-\color{blue}{4 \cdot \left(a \cdot c\right)}\right) + b \cdot b}}{a} \]
      6. +-commutative57.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-neg57.7%

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

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

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

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

        \[\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)} \]
    6. Applied egg-rr57.6%

      \[\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. Step-by-step derivation
      1. *-commutative57.6%

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

        \[\leadsto -0.5 \cdot \left(\frac{1}{a} \cdot \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)}}}\right) \]
      3. add-sqr-sqrt57.1%

        \[\leadsto -0.5 \cdot \left(\frac{1}{a} \cdot \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)}}\right) \]
      4. frac-times46.1%

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

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

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

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

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

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

    if -2.75000000000000017e-304 < b < 4.2000000000000001e114

    1. Initial program 90.4%

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

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

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

        \[\leadsto -0.5 \cdot \frac{b + \sqrt{\color{blue}{\left(a \cdot c\right) \cdot -4} + b \cdot b}}{a} \]
      3. metadata-eval90.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-in90.4%

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

        \[\leadsto -0.5 \cdot \frac{b + \sqrt{\left(-\color{blue}{4 \cdot \left(a \cdot c\right)}\right) + b \cdot b}}{a} \]
      6. +-commutative90.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-neg90.4%

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

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

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

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

        \[\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)} \]
    6. Applied egg-rr90.2%

      \[\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. Step-by-step derivation
      1. *-commutative90.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 4.2000000000000001e114 < b

    1. Initial program 61.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 94.4%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -3.5 \cdot 10^{+43}:\\ \;\;\;\;\frac{-c}{b}\\ \mathbf{elif}\;b \leq -2.75 \cdot 10^{-304}:\\ \;\;\;\;-0.5 \cdot \frac{c \cdot 4}{b - \sqrt{\mathsf{fma}\left(b, b, a \cdot \left(c \cdot -4\right)\right)}}\\ \mathbf{elif}\;b \leq 4.2 \cdot 10^{+114}:\\ \;\;\;\;-0.5 \cdot \left(\frac{b}{a} + \frac{\sqrt{a \cdot \left(c \cdot -4\right) + b \cdot b}}{a}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{-b}{a}\\ \end{array} \]

Alternative 2: 86.1% accurate, 0.9× speedup?

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

\\
\begin{array}{l}
t_0 := \left(c \cdot 4\right) \cdot a\\
\mathbf{if}\;b \leq -1 \cdot 10^{-26}:\\
\;\;\;\;\frac{-c}{b}\\

\mathbf{elif}\;b \leq -9.6 \cdot 10^{-100}:\\
\;\;\;\;-0.5 \cdot \frac{\frac{t_0}{b - \sqrt{b \cdot b - t_0}}}{a}\\

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

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


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

    1. Initial program 7.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 92.1%

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

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

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

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

    if -1e-26 < b < -9.600000000000001e-100

    1. Initial program 45.9%

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

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

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

        \[\leadsto -0.5 \cdot \frac{b + \sqrt{\color{blue}{\left(a \cdot c\right) \cdot -4} + b \cdot b}}{a} \]
      3. metadata-eval45.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-in45.9%

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

        \[\leadsto -0.5 \cdot \frac{b + \sqrt{\left(-\color{blue}{4 \cdot \left(a \cdot c\right)}\right) + b \cdot b}}{a} \]
      6. +-commutative45.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-neg45.9%

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

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

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

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

        \[\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-sqrt45.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} \]
    6. Applied egg-rr45.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} \]
    7. Step-by-step derivation
      1. add-log-exp2.9%

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

        \[\leadsto -0.5 \cdot \frac{\frac{\log \left(e^{\color{blue}{\left(b \cdot b - b \cdot b\right) + a \cdot \left(c \cdot 4\right)}}\right)}{b - \sqrt{b \cdot b - a \cdot \left(c \cdot 4\right)}}}{a} \]
      3. exp-sum2.9%

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

        \[\leadsto -0.5 \cdot \frac{\frac{\log \left(e^{\color{blue}{0}} \cdot e^{a \cdot \left(c \cdot 4\right)}\right)}{b - \sqrt{b \cdot b - a \cdot \left(c \cdot 4\right)}}}{a} \]
      5. 1-exp2.9%

        \[\leadsto -0.5 \cdot \frac{\frac{\log \left(\color{blue}{1} \cdot e^{a \cdot \left(c \cdot 4\right)}\right)}{b - \sqrt{b \cdot b - a \cdot \left(c \cdot 4\right)}}}{a} \]
      6. *-un-lft-identity2.9%

        \[\leadsto -0.5 \cdot \frac{\frac{\log \color{blue}{\left(e^{a \cdot \left(c \cdot 4\right)}\right)}}{b - \sqrt{b \cdot b - a \cdot \left(c \cdot 4\right)}}}{a} \]
      7. add-log-exp75.0%

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

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

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

    if -9.600000000000001e-100 < b < 8.5000000000000001e114

    1. Initial program 87.1%

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

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

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

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

        \[\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-in87.1%

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

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

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

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

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

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

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

        \[\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)} \]
    6. Applied egg-rr86.9%

      \[\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. Step-by-step derivation
      1. *-commutative86.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 8.5000000000000001e114 < b

    1. Initial program 61.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 94.4%

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

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

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

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

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

Alternative 3: 85.0% accurate, 1.0× speedup?

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

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

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

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


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

    1. Initial program 11.5%

      \[\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 87.2%

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

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

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

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

    if -7.80000000000000044e-63 < b < 9.5000000000000001e113

    1. Initial program 84.7%

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

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

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

        \[\leadsto -0.5 \cdot \frac{b + \sqrt{\color{blue}{\left(a \cdot c\right) \cdot -4} + b \cdot b}}{a} \]
      3. metadata-eval84.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-in84.7%

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

        \[\leadsto -0.5 \cdot \frac{b + \sqrt{\left(-\color{blue}{4 \cdot \left(a \cdot c\right)}\right) + b \cdot b}}{a} \]
      6. +-commutative84.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-neg84.7%

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

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

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

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

        \[\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)} \]
    6. Applied egg-rr84.6%

      \[\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. Step-by-step derivation
      1. *-commutative84.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 9.5000000000000001e113 < b

    1. Initial program 61.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 94.4%

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

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

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

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

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

Alternative 4: 85.0% accurate, 1.0× speedup?

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

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

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

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


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

    1. Initial program 11.5%

      \[\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 87.2%

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

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

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

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

    if -9.20000000000000002e-62 < b < 2e114

    1. Initial program 84.7%

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

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

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

        \[\leadsto -0.5 \cdot \frac{b + \sqrt{\color{blue}{\left(a \cdot c\right) \cdot -4} + b \cdot b}}{a} \]
      3. metadata-eval84.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-in84.7%

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

        \[\leadsto -0.5 \cdot \frac{b + \sqrt{\left(-\color{blue}{4 \cdot \left(a \cdot c\right)}\right) + b \cdot b}}{a} \]
      6. +-commutative84.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-neg84.7%

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

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

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

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

    if 2e114 < b

    1. Initial program 61.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 94.4%

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

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

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

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

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

Alternative 5: 79.5% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq -4.4 \cdot 10^{-70}:\\ \;\;\;\;\frac{-c}{b}\\ \mathbf{elif}\;b \leq 2.25 \cdot 10^{-130}:\\ \;\;\;\;-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 -4.4e-70)
   (/ (- c) b)
   (if (<= b 2.25e-130)
     (* -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 <= -4.4e-70) {
		tmp = -c / b;
	} else if (b <= 2.25e-130) {
		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 <= (-4.4d-70)) then
        tmp = -c / b
    else if (b <= 2.25d-130) 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 <= -4.4e-70) {
		tmp = -c / b;
	} else if (b <= 2.25e-130) {
		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 <= -4.4e-70:
		tmp = -c / b
	elif b <= 2.25e-130:
		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 <= -4.4e-70)
		tmp = Float64(Float64(-c) / b);
	elseif (b <= 2.25e-130)
		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 <= -4.4e-70)
		tmp = -c / b;
	elseif (b <= 2.25e-130)
		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, -4.4e-70], N[((-c) / b), $MachinePrecision], If[LessEqual[b, 2.25e-130], 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 -4.4 \cdot 10^{-70}:\\
\;\;\;\;\frac{-c}{b}\\

\mathbf{elif}\;b \leq 2.25 \cdot 10^{-130}:\\
\;\;\;\;-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 < -4.3999999999999998e-70

    1. Initial program 12.3%

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

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

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

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

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

    if -4.3999999999999998e-70 < b < 2.25e-130

    1. Initial program 77.9%

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

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

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

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

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

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

    if 2.25e-130 < b

    1. Initial program 79.6%

      \[\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 84.8%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -4.4 \cdot 10^{-70}:\\ \;\;\;\;\frac{-c}{b}\\ \mathbf{elif}\;b \leq 2.25 \cdot 10^{-130}:\\ \;\;\;\;-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 6: 68.2% accurate, 12.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq -5 \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 -5e-310) (/ (- c) b) (- (/ c b) (/ b a))))
double code(double a, double b, double c) {
	double tmp;
	if (b <= -5e-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 <= (-5d-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 <= -5e-310) {
		tmp = -c / b;
	} else {
		tmp = (c / b) - (b / a);
	}
	return tmp;
}
def code(a, b, c):
	tmp = 0
	if b <= -5e-310:
		tmp = -c / b
	else:
		tmp = (c / b) - (b / a)
	return tmp
function code(a, b, c)
	tmp = 0.0
	if (b <= -5e-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 <= -5e-310)
		tmp = -c / b;
	else
		tmp = (c / b) - (b / a);
	end
	tmp_2 = tmp;
end
code[a_, b_, c_] := If[LessEqual[b, -5e-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 -5 \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 < -4.999999999999985e-310

    1. Initial program 31.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 63.1%

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

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

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

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

    if -4.999999999999985e-310 < b

    1. Initial program 79.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 70.9%

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

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

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

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

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

Alternative 7: 43.7% accurate, 19.1× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq -7.5 \cdot 10^{-292}:\\
\;\;\;\;0\\

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


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

    1. Initial program 31.0%

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

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

      \[\leadsto -0.5 \cdot \frac{b + \sqrt{\color{blue}{{b}^{2}}}}{a} \]
    4. Step-by-step derivation
      1. unpow24.1%

        \[\leadsto -0.5 \cdot \frac{b + \sqrt{\color{blue}{b \cdot b}}}{a} \]
    5. Simplified4.1%

      \[\leadsto -0.5 \cdot \frac{b + \sqrt{\color{blue}{b \cdot b}}}{a} \]
    6. Taylor expanded in b around -inf 12.6%

      \[\leadsto \color{blue}{0} \]

    if -7.5000000000000002e-292 < b

    1. Initial program 79.4%

      \[\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 69.3%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -7.5 \cdot 10^{-292}:\\ \;\;\;\;0\\ \mathbf{else}:\\ \;\;\;\;\frac{-b}{a}\\ \end{array} \]

Alternative 8: 68.0% accurate, 19.1× speedup?

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

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

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


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

    1. Initial program 31.0%

      \[\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 64.6%

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

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

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

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

    if -8.99999999999999913e-292 < b

    1. Initial program 79.4%

      \[\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 69.3%

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

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

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

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

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

Alternative 9: 3.6% accurate, 116.0× speedup?

\[\begin{array}{l} \\ -1 \end{array} \]
(FPCore (a b c) :precision binary64 -1.0)
double code(double a, double b, double c) {
	return -1.0;
}
real(8) function code(a, b, c)
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    code = -1.0d0
end function
public static double code(double a, double b, double c) {
	return -1.0;
}
def code(a, b, c):
	return -1.0
function code(a, b, c)
	return -1.0
end
function tmp = code(a, b, c)
	tmp = -1.0;
end
code[a_, b_, c_] := -1.0
\begin{array}{l}

\\
-1
\end{array}
Derivation
  1. Initial program 57.1%

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

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

    \[\leadsto -0.5 \cdot \frac{b + \sqrt{\color{blue}{{b}^{2}}}}{a} \]
  4. Step-by-step derivation
    1. unpow232.3%

      \[\leadsto -0.5 \cdot \frac{b + \sqrt{\color{blue}{b \cdot b}}}{a} \]
  5. Simplified32.3%

    \[\leadsto -0.5 \cdot \frac{b + \sqrt{\color{blue}{b \cdot b}}}{a} \]
  6. Taylor expanded in b around -inf 7.3%

    \[\leadsto \color{blue}{0} \]
  7. Simplified3.3%

    \[\leadsto \color{blue}{-1} \]
  8. Final simplification3.3%

    \[\leadsto -1 \]

Alternative 10: 3.6% accurate, 116.0× speedup?

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

\\
-0.5
\end{array}
Derivation
  1. Initial program 57.1%

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

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

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

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

      \[\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-in57.1%

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

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

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

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

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

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

    \[\leadsto -0.5 \cdot \frac{b + \sqrt{\color{blue}{b \cdot b - a \cdot \left(c \cdot 4\right)}}}{a} \]
  5. Step-by-step derivation
    1. div-inv57.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)} \]
  6. Applied egg-rr57.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. Taylor expanded in b around inf 38.6%

    \[\leadsto -0.5 \cdot \left(\left(b + \color{blue}{b}\right) \cdot \frac{1}{a}\right) \]
  8. Step-by-step derivation
    1. expm1-log1p-u24.4%

      \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(-0.5 \cdot \left(\left(b + b\right) \cdot \frac{1}{a}\right)\right)\right)} \]
    2. expm1-udef21.5%

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(-0.5 \cdot \left(\left(b + b\right) \cdot \frac{1}{a}\right)\right)} - 1} \]
  9. Applied egg-rr0.0%

    \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\frac{-0.5}{a \cdot \frac{0}{0}}\right)} - 1} \]
  10. Simplified3.3%

    \[\leadsto \color{blue}{-0.5} \]
  11. Final simplification3.3%

    \[\leadsto -0.5 \]

Alternative 11: 10.7% accurate, 116.0× speedup?

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

\\
0
\end{array}
Derivation
  1. Initial program 57.1%

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

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

    \[\leadsto -0.5 \cdot \frac{b + \sqrt{\color{blue}{{b}^{2}}}}{a} \]
  4. Step-by-step derivation
    1. unpow232.3%

      \[\leadsto -0.5 \cdot \frac{b + \sqrt{\color{blue}{b \cdot b}}}{a} \]
  5. Simplified32.3%

    \[\leadsto -0.5 \cdot \frac{b + \sqrt{\color{blue}{b \cdot b}}}{a} \]
  6. Taylor expanded in b around -inf 7.3%

    \[\leadsto \color{blue}{0} \]
  7. Final simplification7.3%

    \[\leadsto 0 \]

Developer target: 69.3% 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 2023257 
(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)))