quadm (p42, negative)

Percentage Accurate: 51.4% → 75.4%
Time: 11.4s
Alternatives: 7
Speedup: 1.0×

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 7 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.4% 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: 75.4% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
t_0 := \sqrt{\mathsf{fma}\left(b, b, c \cdot \left(a \cdot -4\right)\right)}\\
\mathbf{if}\;b \leq -7 \cdot 10^{-81}:\\
\;\;\;\;\frac{4 \cdot \left(a \cdot c\right)}{\left(b - t\_0\right) \cdot \left(a \cdot -2\right)}\\

\mathbf{elif}\;b \leq 1.1 \cdot 10^{+45}:\\
\;\;\;\;\mathsf{fma}\left(b, \frac{-0.5}{a}, \frac{t\_0}{a \cdot -2}\right)\\

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


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

    1. Initial program 16.5%

      \[\frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2 \cdot a} \]
    2. Add Preprocessing
    3. Applied egg-rr7.9%

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

      \[\leadsto \frac{\color{blue}{4 \cdot \left(a \cdot c\right)}}{\left(b - \sqrt{\mathsf{fma}\left(b, b, c \cdot \left(a \cdot -4\right)\right)}\right) \cdot \left(a \cdot -2\right)} \]
    5. Step-by-step derivation
      1. lower-*.f64N/A

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

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

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

    if -6.99999999999999973e-81 < b < 1.1e45

    1. Initial program 87.6%

      \[\frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2 \cdot a} \]
    2. Add Preprocessing
    3. Applied egg-rr87.7%

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

    if 1.1e45 < b

    1. Initial program 60.8%

      \[\frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2 \cdot a} \]
    2. Add Preprocessing
    3. Taylor expanded in a around 0

      \[\leadsto \color{blue}{\frac{-1}{2} \cdot \frac{b + {b}^{2}}{a}} \]
    4. Step-by-step derivation
      1. associate-*r/N/A

        \[\leadsto \color{blue}{\frac{\frac{-1}{2} \cdot \left(b + {b}^{2}\right)}{a}} \]
      2. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{\frac{-1}{2} \cdot \left(b + {b}^{2}\right)}{a}} \]
      3. +-commutativeN/A

        \[\leadsto \frac{\frac{-1}{2} \cdot \color{blue}{\left({b}^{2} + b\right)}}{a} \]
      4. *-lft-identityN/A

        \[\leadsto \frac{\frac{-1}{2} \cdot \left({b}^{2} + \color{blue}{1 \cdot b}\right)}{a} \]
      5. lft-mult-inverseN/A

        \[\leadsto \frac{\frac{-1}{2} \cdot \left({b}^{2} + \color{blue}{\left(\frac{1}{b} \cdot b\right)} \cdot b\right)}{a} \]
      6. associate-*r*N/A

        \[\leadsto \frac{\frac{-1}{2} \cdot \left({b}^{2} + \color{blue}{\frac{1}{b} \cdot \left(b \cdot b\right)}\right)}{a} \]
      7. unpow2N/A

        \[\leadsto \frac{\frac{-1}{2} \cdot \left({b}^{2} + \frac{1}{b} \cdot \color{blue}{{b}^{2}}\right)}{a} \]
      8. *-lft-identityN/A

        \[\leadsto \frac{\frac{-1}{2} \cdot \left(\color{blue}{1 \cdot {b}^{2}} + \frac{1}{b} \cdot {b}^{2}\right)}{a} \]
      9. distribute-rgt-inN/A

        \[\leadsto \frac{\frac{-1}{2} \cdot \color{blue}{\left({b}^{2} \cdot \left(1 + \frac{1}{b}\right)\right)}}{a} \]
      10. lower-*.f64N/A

        \[\leadsto \frac{\color{blue}{\frac{-1}{2} \cdot \left({b}^{2} \cdot \left(1 + \frac{1}{b}\right)\right)}}{a} \]
      11. unpow2N/A

        \[\leadsto \frac{\frac{-1}{2} \cdot \left(\color{blue}{\left(b \cdot b\right)} \cdot \left(1 + \frac{1}{b}\right)\right)}{a} \]
      12. associate-*l*N/A

        \[\leadsto \frac{\frac{-1}{2} \cdot \color{blue}{\left(b \cdot \left(b \cdot \left(1 + \frac{1}{b}\right)\right)\right)}}{a} \]
      13. distribute-lft-inN/A

        \[\leadsto \frac{\frac{-1}{2} \cdot \left(b \cdot \color{blue}{\left(b \cdot 1 + b \cdot \frac{1}{b}\right)}\right)}{a} \]
      14. *-rgt-identityN/A

        \[\leadsto \frac{\frac{-1}{2} \cdot \left(b \cdot \left(\color{blue}{b} + b \cdot \frac{1}{b}\right)\right)}{a} \]
      15. rgt-mult-inverseN/A

        \[\leadsto \frac{\frac{-1}{2} \cdot \left(b \cdot \left(b + \color{blue}{1}\right)\right)}{a} \]
      16. distribute-lft-outN/A

        \[\leadsto \frac{\frac{-1}{2} \cdot \color{blue}{\left(b \cdot b + b \cdot 1\right)}}{a} \]
      17. *-rgt-identityN/A

        \[\leadsto \frac{\frac{-1}{2} \cdot \left(b \cdot b + \color{blue}{b}\right)}{a} \]
      18. lower-fma.f6440.6

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

      \[\leadsto \color{blue}{\frac{-0.5 \cdot \mathsf{fma}\left(b, b, b\right)}{a}} \]
    6. Taylor expanded in b around 0

      \[\leadsto \color{blue}{\frac{-1}{2} \cdot \frac{b}{a}} \]
    7. Step-by-step derivation
      1. associate-*r/N/A

        \[\leadsto \color{blue}{\frac{\frac{-1}{2} \cdot b}{a}} \]
      2. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{\frac{-1}{2} \cdot b}{a}} \]
      3. lower-*.f6448.5

        \[\leadsto \frac{\color{blue}{-0.5 \cdot b}}{a} \]
    8. Simplified48.5%

      \[\leadsto \color{blue}{\frac{-0.5 \cdot b}{a}} \]
    9. Taylor expanded in b around -inf

      \[\leadsto \frac{\color{blue}{-1 \cdot b}}{a} \]
    10. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto \frac{\color{blue}{\mathsf{neg}\left(b\right)}}{a} \]
      2. lower-neg.f6495.3

        \[\leadsto \frac{\color{blue}{-b}}{a} \]
    11. Simplified95.3%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -7 \cdot 10^{-81}:\\ \;\;\;\;\frac{4 \cdot \left(a \cdot c\right)}{\left(b - \sqrt{\mathsf{fma}\left(b, b, c \cdot \left(a \cdot -4\right)\right)}\right) \cdot \left(a \cdot -2\right)}\\ \mathbf{elif}\;b \leq 1.1 \cdot 10^{+45}:\\ \;\;\;\;\mathsf{fma}\left(b, \frac{-0.5}{a}, \frac{\sqrt{\mathsf{fma}\left(b, b, c \cdot \left(a \cdot -4\right)\right)}}{a \cdot -2}\right)\\ \mathbf{else}:\\ \;\;\;\;-\frac{b}{a}\\ \end{array} \]
  5. Add Preprocessing

Alternative 2: 66.0% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq -1.7 \cdot 10^{+88}:\\
\;\;\;\;\frac{0.5}{\frac{a}{0}}\\

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

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


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

    1. Initial program 7.4%

      \[\frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2 \cdot a} \]
    2. Add Preprocessing
    3. Applied egg-rr1.9%

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

      \[\leadsto \frac{\frac{1}{2}}{\frac{a}{b - \color{blue}{{b}^{3}}}} \]
    5. Step-by-step derivation
      1. cube-multN/A

        \[\leadsto \frac{\frac{1}{2}}{\frac{a}{b - \color{blue}{b \cdot \left(b \cdot b\right)}}} \]
      2. unpow2N/A

        \[\leadsto \frac{\frac{1}{2}}{\frac{a}{b - b \cdot \color{blue}{{b}^{2}}}} \]
      3. lower-*.f64N/A

        \[\leadsto \frac{\frac{1}{2}}{\frac{a}{b - \color{blue}{b \cdot {b}^{2}}}} \]
      4. unpow2N/A

        \[\leadsto \frac{\frac{1}{2}}{\frac{a}{b - b \cdot \color{blue}{\left(b \cdot b\right)}}} \]
      5. lower-*.f641.7

        \[\leadsto \frac{0.5}{\frac{a}{b - b \cdot \color{blue}{\left(b \cdot b\right)}}} \]
    6. Simplified1.7%

      \[\leadsto \frac{0.5}{\frac{a}{b - \color{blue}{b \cdot \left(b \cdot b\right)}}} \]
    7. Taylor expanded in b around 0

      \[\leadsto \frac{\frac{1}{2}}{\frac{a}{\color{blue}{0}}} \]
    8. Step-by-step derivation
      1. Simplified35.5%

        \[\leadsto \frac{0.5}{\frac{a}{\color{blue}{0}}} \]

      if -1.70000000000000002e88 < b < 1.1e45

      1. Initial program 73.0%

        \[\frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2 \cdot a} \]
      2. Add Preprocessing
      3. Applied egg-rr73.0%

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

      if 1.1e45 < b

      1. Initial program 60.8%

        \[\frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2 \cdot a} \]
      2. Add Preprocessing
      3. Taylor expanded in a around 0

        \[\leadsto \color{blue}{\frac{-1}{2} \cdot \frac{b + {b}^{2}}{a}} \]
      4. Step-by-step derivation
        1. associate-*r/N/A

          \[\leadsto \color{blue}{\frac{\frac{-1}{2} \cdot \left(b + {b}^{2}\right)}{a}} \]
        2. lower-/.f64N/A

          \[\leadsto \color{blue}{\frac{\frac{-1}{2} \cdot \left(b + {b}^{2}\right)}{a}} \]
        3. +-commutativeN/A

          \[\leadsto \frac{\frac{-1}{2} \cdot \color{blue}{\left({b}^{2} + b\right)}}{a} \]
        4. *-lft-identityN/A

          \[\leadsto \frac{\frac{-1}{2} \cdot \left({b}^{2} + \color{blue}{1 \cdot b}\right)}{a} \]
        5. lft-mult-inverseN/A

          \[\leadsto \frac{\frac{-1}{2} \cdot \left({b}^{2} + \color{blue}{\left(\frac{1}{b} \cdot b\right)} \cdot b\right)}{a} \]
        6. associate-*r*N/A

          \[\leadsto \frac{\frac{-1}{2} \cdot \left({b}^{2} + \color{blue}{\frac{1}{b} \cdot \left(b \cdot b\right)}\right)}{a} \]
        7. unpow2N/A

          \[\leadsto \frac{\frac{-1}{2} \cdot \left({b}^{2} + \frac{1}{b} \cdot \color{blue}{{b}^{2}}\right)}{a} \]
        8. *-lft-identityN/A

          \[\leadsto \frac{\frac{-1}{2} \cdot \left(\color{blue}{1 \cdot {b}^{2}} + \frac{1}{b} \cdot {b}^{2}\right)}{a} \]
        9. distribute-rgt-inN/A

          \[\leadsto \frac{\frac{-1}{2} \cdot \color{blue}{\left({b}^{2} \cdot \left(1 + \frac{1}{b}\right)\right)}}{a} \]
        10. lower-*.f64N/A

          \[\leadsto \frac{\color{blue}{\frac{-1}{2} \cdot \left({b}^{2} \cdot \left(1 + \frac{1}{b}\right)\right)}}{a} \]
        11. unpow2N/A

          \[\leadsto \frac{\frac{-1}{2} \cdot \left(\color{blue}{\left(b \cdot b\right)} \cdot \left(1 + \frac{1}{b}\right)\right)}{a} \]
        12. associate-*l*N/A

          \[\leadsto \frac{\frac{-1}{2} \cdot \color{blue}{\left(b \cdot \left(b \cdot \left(1 + \frac{1}{b}\right)\right)\right)}}{a} \]
        13. distribute-lft-inN/A

          \[\leadsto \frac{\frac{-1}{2} \cdot \left(b \cdot \color{blue}{\left(b \cdot 1 + b \cdot \frac{1}{b}\right)}\right)}{a} \]
        14. *-rgt-identityN/A

          \[\leadsto \frac{\frac{-1}{2} \cdot \left(b \cdot \left(\color{blue}{b} + b \cdot \frac{1}{b}\right)\right)}{a} \]
        15. rgt-mult-inverseN/A

          \[\leadsto \frac{\frac{-1}{2} \cdot \left(b \cdot \left(b + \color{blue}{1}\right)\right)}{a} \]
        16. distribute-lft-outN/A

          \[\leadsto \frac{\frac{-1}{2} \cdot \color{blue}{\left(b \cdot b + b \cdot 1\right)}}{a} \]
        17. *-rgt-identityN/A

          \[\leadsto \frac{\frac{-1}{2} \cdot \left(b \cdot b + \color{blue}{b}\right)}{a} \]
        18. lower-fma.f6440.6

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

        \[\leadsto \color{blue}{\frac{-0.5 \cdot \mathsf{fma}\left(b, b, b\right)}{a}} \]
      6. Taylor expanded in b around 0

        \[\leadsto \color{blue}{\frac{-1}{2} \cdot \frac{b}{a}} \]
      7. Step-by-step derivation
        1. associate-*r/N/A

          \[\leadsto \color{blue}{\frac{\frac{-1}{2} \cdot b}{a}} \]
        2. lower-/.f64N/A

          \[\leadsto \color{blue}{\frac{\frac{-1}{2} \cdot b}{a}} \]
        3. lower-*.f6448.5

          \[\leadsto \frac{\color{blue}{-0.5 \cdot b}}{a} \]
      8. Simplified48.5%

        \[\leadsto \color{blue}{\frac{-0.5 \cdot b}{a}} \]
      9. Taylor expanded in b around -inf

        \[\leadsto \frac{\color{blue}{-1 \cdot b}}{a} \]
      10. Step-by-step derivation
        1. mul-1-negN/A

          \[\leadsto \frac{\color{blue}{\mathsf{neg}\left(b\right)}}{a} \]
        2. lower-neg.f6495.3

          \[\leadsto \frac{\color{blue}{-b}}{a} \]
      11. Simplified95.3%

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

      \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -1.7 \cdot 10^{+88}:\\ \;\;\;\;\frac{0.5}{\frac{a}{0}}\\ \mathbf{elif}\;b \leq 1.1 \cdot 10^{+45}:\\ \;\;\;\;\mathsf{fma}\left(\frac{b}{a}, -0.5, \frac{\sqrt{\mathsf{fma}\left(b, b, c \cdot \left(a \cdot -4\right)\right)}}{a \cdot -2}\right)\\ \mathbf{else}:\\ \;\;\;\;-\frac{b}{a}\\ \end{array} \]
    11. Add Preprocessing

    Alternative 3: 65.1% accurate, 0.9× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq -1.35 \cdot 10^{+154}:\\ \;\;\;\;\frac{0.5}{\frac{\mathsf{fma}\left(b, \mathsf{fma}\left(b, a, a\right), a\right)}{b}}\\ \mathbf{elif}\;b \leq 1.1 \cdot 10^{+45}:\\ \;\;\;\;\frac{b + \sqrt{\mathsf{fma}\left(b, b, c \cdot \left(a \cdot -4\right)\right)}}{a \cdot -2}\\ \mathbf{else}:\\ \;\;\;\;-\frac{b}{a}\\ \end{array} \end{array} \]
    (FPCore (a b c)
     :precision binary64
     (if (<= b -1.35e+154)
       (/ 0.5 (/ (fma b (fma b a a) a) b))
       (if (<= b 1.1e+45)
         (/ (+ b (sqrt (fma b b (* c (* a -4.0))))) (* a -2.0))
         (- (/ b a)))))
    double code(double a, double b, double c) {
    	double tmp;
    	if (b <= -1.35e+154) {
    		tmp = 0.5 / (fma(b, fma(b, a, a), a) / b);
    	} else if (b <= 1.1e+45) {
    		tmp = (b + sqrt(fma(b, b, (c * (a * -4.0))))) / (a * -2.0);
    	} else {
    		tmp = -(b / a);
    	}
    	return tmp;
    }
    
    function code(a, b, c)
    	tmp = 0.0
    	if (b <= -1.35e+154)
    		tmp = Float64(0.5 / Float64(fma(b, fma(b, a, a), a) / b));
    	elseif (b <= 1.1e+45)
    		tmp = Float64(Float64(b + sqrt(fma(b, b, Float64(c * Float64(a * -4.0))))) / Float64(a * -2.0));
    	else
    		tmp = Float64(-Float64(b / a));
    	end
    	return tmp
    end
    
    code[a_, b_, c_] := If[LessEqual[b, -1.35e+154], N[(0.5 / N[(N[(b * N[(b * a + a), $MachinePrecision] + a), $MachinePrecision] / b), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 1.1e+45], N[(N[(b + N[Sqrt[N[(b * b + N[(c * N[(a * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[(a * -2.0), $MachinePrecision]), $MachinePrecision], (-N[(b / a), $MachinePrecision])]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    \mathbf{if}\;b \leq -1.35 \cdot 10^{+154}:\\
    \;\;\;\;\frac{0.5}{\frac{\mathsf{fma}\left(b, \mathsf{fma}\left(b, a, a\right), a\right)}{b}}\\
    
    \mathbf{elif}\;b \leq 1.1 \cdot 10^{+45}:\\
    \;\;\;\;\frac{b + \sqrt{\mathsf{fma}\left(b, b, c \cdot \left(a \cdot -4\right)\right)}}{a \cdot -2}\\
    
    \mathbf{else}:\\
    \;\;\;\;-\frac{b}{a}\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 3 regimes
    2. if b < -1.35000000000000003e154

      1. Initial program 1.6%

        \[\frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2 \cdot a} \]
      2. Add Preprocessing
      3. Applied egg-rr1.6%

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

        \[\leadsto \frac{\frac{1}{2}}{\frac{a}{b - \color{blue}{{b}^{3}}}} \]
      5. Step-by-step derivation
        1. cube-multN/A

          \[\leadsto \frac{\frac{1}{2}}{\frac{a}{b - \color{blue}{b \cdot \left(b \cdot b\right)}}} \]
        2. unpow2N/A

          \[\leadsto \frac{\frac{1}{2}}{\frac{a}{b - b \cdot \color{blue}{{b}^{2}}}} \]
        3. lower-*.f64N/A

          \[\leadsto \frac{\frac{1}{2}}{\frac{a}{b - \color{blue}{b \cdot {b}^{2}}}} \]
        4. unpow2N/A

          \[\leadsto \frac{\frac{1}{2}}{\frac{a}{b - b \cdot \color{blue}{\left(b \cdot b\right)}}} \]
        5. lower-*.f641.7

          \[\leadsto \frac{0.5}{\frac{a}{b - b \cdot \color{blue}{\left(b \cdot b\right)}}} \]
      6. Simplified1.7%

        \[\leadsto \frac{0.5}{\frac{a}{b - \color{blue}{b \cdot \left(b \cdot b\right)}}} \]
      7. Taylor expanded in b around 0

        \[\leadsto \frac{\frac{1}{2}}{\color{blue}{\frac{a + b \cdot \left(a \cdot b - -1 \cdot a\right)}{b}}} \]
      8. Step-by-step derivation
        1. lower-/.f64N/A

          \[\leadsto \frac{\frac{1}{2}}{\color{blue}{\frac{a + b \cdot \left(a \cdot b - -1 \cdot a\right)}{b}}} \]
        2. +-commutativeN/A

          \[\leadsto \frac{\frac{1}{2}}{\frac{\color{blue}{b \cdot \left(a \cdot b - -1 \cdot a\right) + a}}{b}} \]
        3. cancel-sign-sub-invN/A

          \[\leadsto \frac{\frac{1}{2}}{\frac{b \cdot \color{blue}{\left(a \cdot b + \left(\mathsf{neg}\left(-1\right)\right) \cdot a\right)} + a}{b}} \]
        4. metadata-evalN/A

          \[\leadsto \frac{\frac{1}{2}}{\frac{b \cdot \left(a \cdot b + \color{blue}{1} \cdot a\right) + a}{b}} \]
        5. *-lft-identityN/A

          \[\leadsto \frac{\frac{1}{2}}{\frac{b \cdot \left(a \cdot b + \color{blue}{a}\right) + a}{b}} \]
        6. +-commutativeN/A

          \[\leadsto \frac{\frac{1}{2}}{\frac{b \cdot \color{blue}{\left(a + a \cdot b\right)} + a}{b}} \]
        7. lower-fma.f64N/A

          \[\leadsto \frac{\frac{1}{2}}{\frac{\color{blue}{\mathsf{fma}\left(b, a + a \cdot b, a\right)}}{b}} \]
        8. +-commutativeN/A

          \[\leadsto \frac{\frac{1}{2}}{\frac{\mathsf{fma}\left(b, \color{blue}{a \cdot b + a}, a\right)}{b}} \]
        9. *-commutativeN/A

          \[\leadsto \frac{\frac{1}{2}}{\frac{\mathsf{fma}\left(b, \color{blue}{b \cdot a} + a, a\right)}{b}} \]
        10. lower-fma.f6441.3

          \[\leadsto \frac{0.5}{\frac{\mathsf{fma}\left(b, \color{blue}{\mathsf{fma}\left(b, a, a\right)}, a\right)}{b}} \]
      9. Simplified41.3%

        \[\leadsto \frac{0.5}{\color{blue}{\frac{\mathsf{fma}\left(b, \mathsf{fma}\left(b, a, a\right), a\right)}{b}}} \]

      if -1.35000000000000003e154 < b < 1.1e45

      1. Initial program 66.5%

        \[\frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2 \cdot a} \]
      2. Add Preprocessing
      3. Applied egg-rr66.5%

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

      if 1.1e45 < b

      1. Initial program 60.8%

        \[\frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2 \cdot a} \]
      2. Add Preprocessing
      3. Taylor expanded in a around 0

        \[\leadsto \color{blue}{\frac{-1}{2} \cdot \frac{b + {b}^{2}}{a}} \]
      4. Step-by-step derivation
        1. associate-*r/N/A

          \[\leadsto \color{blue}{\frac{\frac{-1}{2} \cdot \left(b + {b}^{2}\right)}{a}} \]
        2. lower-/.f64N/A

          \[\leadsto \color{blue}{\frac{\frac{-1}{2} \cdot \left(b + {b}^{2}\right)}{a}} \]
        3. +-commutativeN/A

          \[\leadsto \frac{\frac{-1}{2} \cdot \color{blue}{\left({b}^{2} + b\right)}}{a} \]
        4. *-lft-identityN/A

          \[\leadsto \frac{\frac{-1}{2} \cdot \left({b}^{2} + \color{blue}{1 \cdot b}\right)}{a} \]
        5. lft-mult-inverseN/A

          \[\leadsto \frac{\frac{-1}{2} \cdot \left({b}^{2} + \color{blue}{\left(\frac{1}{b} \cdot b\right)} \cdot b\right)}{a} \]
        6. associate-*r*N/A

          \[\leadsto \frac{\frac{-1}{2} \cdot \left({b}^{2} + \color{blue}{\frac{1}{b} \cdot \left(b \cdot b\right)}\right)}{a} \]
        7. unpow2N/A

          \[\leadsto \frac{\frac{-1}{2} \cdot \left({b}^{2} + \frac{1}{b} \cdot \color{blue}{{b}^{2}}\right)}{a} \]
        8. *-lft-identityN/A

          \[\leadsto \frac{\frac{-1}{2} \cdot \left(\color{blue}{1 \cdot {b}^{2}} + \frac{1}{b} \cdot {b}^{2}\right)}{a} \]
        9. distribute-rgt-inN/A

          \[\leadsto \frac{\frac{-1}{2} \cdot \color{blue}{\left({b}^{2} \cdot \left(1 + \frac{1}{b}\right)\right)}}{a} \]
        10. lower-*.f64N/A

          \[\leadsto \frac{\color{blue}{\frac{-1}{2} \cdot \left({b}^{2} \cdot \left(1 + \frac{1}{b}\right)\right)}}{a} \]
        11. unpow2N/A

          \[\leadsto \frac{\frac{-1}{2} \cdot \left(\color{blue}{\left(b \cdot b\right)} \cdot \left(1 + \frac{1}{b}\right)\right)}{a} \]
        12. associate-*l*N/A

          \[\leadsto \frac{\frac{-1}{2} \cdot \color{blue}{\left(b \cdot \left(b \cdot \left(1 + \frac{1}{b}\right)\right)\right)}}{a} \]
        13. distribute-lft-inN/A

          \[\leadsto \frac{\frac{-1}{2} \cdot \left(b \cdot \color{blue}{\left(b \cdot 1 + b \cdot \frac{1}{b}\right)}\right)}{a} \]
        14. *-rgt-identityN/A

          \[\leadsto \frac{\frac{-1}{2} \cdot \left(b \cdot \left(\color{blue}{b} + b \cdot \frac{1}{b}\right)\right)}{a} \]
        15. rgt-mult-inverseN/A

          \[\leadsto \frac{\frac{-1}{2} \cdot \left(b \cdot \left(b + \color{blue}{1}\right)\right)}{a} \]
        16. distribute-lft-outN/A

          \[\leadsto \frac{\frac{-1}{2} \cdot \color{blue}{\left(b \cdot b + b \cdot 1\right)}}{a} \]
        17. *-rgt-identityN/A

          \[\leadsto \frac{\frac{-1}{2} \cdot \left(b \cdot b + \color{blue}{b}\right)}{a} \]
        18. lower-fma.f6440.6

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

        \[\leadsto \color{blue}{\frac{-0.5 \cdot \mathsf{fma}\left(b, b, b\right)}{a}} \]
      6. Taylor expanded in b around 0

        \[\leadsto \color{blue}{\frac{-1}{2} \cdot \frac{b}{a}} \]
      7. Step-by-step derivation
        1. associate-*r/N/A

          \[\leadsto \color{blue}{\frac{\frac{-1}{2} \cdot b}{a}} \]
        2. lower-/.f64N/A

          \[\leadsto \color{blue}{\frac{\frac{-1}{2} \cdot b}{a}} \]
        3. lower-*.f6448.5

          \[\leadsto \frac{\color{blue}{-0.5 \cdot b}}{a} \]
      8. Simplified48.5%

        \[\leadsto \color{blue}{\frac{-0.5 \cdot b}{a}} \]
      9. Taylor expanded in b around -inf

        \[\leadsto \frac{\color{blue}{-1 \cdot b}}{a} \]
      10. Step-by-step derivation
        1. mul-1-negN/A

          \[\leadsto \frac{\color{blue}{\mathsf{neg}\left(b\right)}}{a} \]
        2. lower-neg.f6495.3

          \[\leadsto \frac{\color{blue}{-b}}{a} \]
      11. Simplified95.3%

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

      \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -1.35 \cdot 10^{+154}:\\ \;\;\;\;\frac{0.5}{\frac{\mathsf{fma}\left(b, \mathsf{fma}\left(b, a, a\right), a\right)}{b}}\\ \mathbf{elif}\;b \leq 1.1 \cdot 10^{+45}:\\ \;\;\;\;\frac{b + \sqrt{\mathsf{fma}\left(b, b, c \cdot \left(a \cdot -4\right)\right)}}{a \cdot -2}\\ \mathbf{else}:\\ \;\;\;\;-\frac{b}{a}\\ \end{array} \]
    5. Add Preprocessing

    Alternative 4: 65.0% accurate, 0.9× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq -1.35 \cdot 10^{+154}:\\ \;\;\;\;\frac{0.5}{\frac{\mathsf{fma}\left(b, \mathsf{fma}\left(b, a, a\right), a\right)}{b}}\\ \mathbf{elif}\;b \leq 1.1 \cdot 10^{+45}:\\ \;\;\;\;\frac{-0.5}{a} \cdot \left(b + \sqrt{\mathsf{fma}\left(b, b, c \cdot \left(a \cdot -4\right)\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;-\frac{b}{a}\\ \end{array} \end{array} \]
    (FPCore (a b c)
     :precision binary64
     (if (<= b -1.35e+154)
       (/ 0.5 (/ (fma b (fma b a a) a) b))
       (if (<= b 1.1e+45)
         (* (/ -0.5 a) (+ b (sqrt (fma b b (* c (* a -4.0))))))
         (- (/ b a)))))
    double code(double a, double b, double c) {
    	double tmp;
    	if (b <= -1.35e+154) {
    		tmp = 0.5 / (fma(b, fma(b, a, a), a) / b);
    	} else if (b <= 1.1e+45) {
    		tmp = (-0.5 / a) * (b + sqrt(fma(b, b, (c * (a * -4.0)))));
    	} else {
    		tmp = -(b / a);
    	}
    	return tmp;
    }
    
    function code(a, b, c)
    	tmp = 0.0
    	if (b <= -1.35e+154)
    		tmp = Float64(0.5 / Float64(fma(b, fma(b, a, a), a) / b));
    	elseif (b <= 1.1e+45)
    		tmp = Float64(Float64(-0.5 / a) * Float64(b + sqrt(fma(b, b, Float64(c * Float64(a * -4.0))))));
    	else
    		tmp = Float64(-Float64(b / a));
    	end
    	return tmp
    end
    
    code[a_, b_, c_] := If[LessEqual[b, -1.35e+154], N[(0.5 / N[(N[(b * N[(b * a + a), $MachinePrecision] + a), $MachinePrecision] / b), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 1.1e+45], N[(N[(-0.5 / a), $MachinePrecision] * N[(b + N[Sqrt[N[(b * b + N[(c * N[(a * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], (-N[(b / a), $MachinePrecision])]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    \mathbf{if}\;b \leq -1.35 \cdot 10^{+154}:\\
    \;\;\;\;\frac{0.5}{\frac{\mathsf{fma}\left(b, \mathsf{fma}\left(b, a, a\right), a\right)}{b}}\\
    
    \mathbf{elif}\;b \leq 1.1 \cdot 10^{+45}:\\
    \;\;\;\;\frac{-0.5}{a} \cdot \left(b + \sqrt{\mathsf{fma}\left(b, b, c \cdot \left(a \cdot -4\right)\right)}\right)\\
    
    \mathbf{else}:\\
    \;\;\;\;-\frac{b}{a}\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 3 regimes
    2. if b < -1.35000000000000003e154

      1. Initial program 1.6%

        \[\frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2 \cdot a} \]
      2. Add Preprocessing
      3. Applied egg-rr1.6%

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

        \[\leadsto \frac{\frac{1}{2}}{\frac{a}{b - \color{blue}{{b}^{3}}}} \]
      5. Step-by-step derivation
        1. cube-multN/A

          \[\leadsto \frac{\frac{1}{2}}{\frac{a}{b - \color{blue}{b \cdot \left(b \cdot b\right)}}} \]
        2. unpow2N/A

          \[\leadsto \frac{\frac{1}{2}}{\frac{a}{b - b \cdot \color{blue}{{b}^{2}}}} \]
        3. lower-*.f64N/A

          \[\leadsto \frac{\frac{1}{2}}{\frac{a}{b - \color{blue}{b \cdot {b}^{2}}}} \]
        4. unpow2N/A

          \[\leadsto \frac{\frac{1}{2}}{\frac{a}{b - b \cdot \color{blue}{\left(b \cdot b\right)}}} \]
        5. lower-*.f641.7

          \[\leadsto \frac{0.5}{\frac{a}{b - b \cdot \color{blue}{\left(b \cdot b\right)}}} \]
      6. Simplified1.7%

        \[\leadsto \frac{0.5}{\frac{a}{b - \color{blue}{b \cdot \left(b \cdot b\right)}}} \]
      7. Taylor expanded in b around 0

        \[\leadsto \frac{\frac{1}{2}}{\color{blue}{\frac{a + b \cdot \left(a \cdot b - -1 \cdot a\right)}{b}}} \]
      8. Step-by-step derivation
        1. lower-/.f64N/A

          \[\leadsto \frac{\frac{1}{2}}{\color{blue}{\frac{a + b \cdot \left(a \cdot b - -1 \cdot a\right)}{b}}} \]
        2. +-commutativeN/A

          \[\leadsto \frac{\frac{1}{2}}{\frac{\color{blue}{b \cdot \left(a \cdot b - -1 \cdot a\right) + a}}{b}} \]
        3. cancel-sign-sub-invN/A

          \[\leadsto \frac{\frac{1}{2}}{\frac{b \cdot \color{blue}{\left(a \cdot b + \left(\mathsf{neg}\left(-1\right)\right) \cdot a\right)} + a}{b}} \]
        4. metadata-evalN/A

          \[\leadsto \frac{\frac{1}{2}}{\frac{b \cdot \left(a \cdot b + \color{blue}{1} \cdot a\right) + a}{b}} \]
        5. *-lft-identityN/A

          \[\leadsto \frac{\frac{1}{2}}{\frac{b \cdot \left(a \cdot b + \color{blue}{a}\right) + a}{b}} \]
        6. +-commutativeN/A

          \[\leadsto \frac{\frac{1}{2}}{\frac{b \cdot \color{blue}{\left(a + a \cdot b\right)} + a}{b}} \]
        7. lower-fma.f64N/A

          \[\leadsto \frac{\frac{1}{2}}{\frac{\color{blue}{\mathsf{fma}\left(b, a + a \cdot b, a\right)}}{b}} \]
        8. +-commutativeN/A

          \[\leadsto \frac{\frac{1}{2}}{\frac{\mathsf{fma}\left(b, \color{blue}{a \cdot b + a}, a\right)}{b}} \]
        9. *-commutativeN/A

          \[\leadsto \frac{\frac{1}{2}}{\frac{\mathsf{fma}\left(b, \color{blue}{b \cdot a} + a, a\right)}{b}} \]
        10. lower-fma.f6441.3

          \[\leadsto \frac{0.5}{\frac{\mathsf{fma}\left(b, \color{blue}{\mathsf{fma}\left(b, a, a\right)}, a\right)}{b}} \]
      9. Simplified41.3%

        \[\leadsto \frac{0.5}{\color{blue}{\frac{\mathsf{fma}\left(b, \mathsf{fma}\left(b, a, a\right), a\right)}{b}}} \]

      if -1.35000000000000003e154 < b < 1.1e45

      1. Initial program 66.5%

        \[\frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2 \cdot a} \]
      2. Add Preprocessing
      3. Applied egg-rr66.5%

        \[\leadsto \color{blue}{\frac{b + \sqrt{\mathsf{fma}\left(b, b, c \cdot \left(a \cdot -4\right)\right)}}{a \cdot -2}} \]
      4. Step-by-step derivation
        1. lift-*.f64N/A

          \[\leadsto \frac{b + \sqrt{b \cdot b + c \cdot \color{blue}{\left(a \cdot -4\right)}}}{a \cdot -2} \]
        2. lift-*.f64N/A

          \[\leadsto \frac{b + \sqrt{b \cdot b + \color{blue}{c \cdot \left(a \cdot -4\right)}}}{a \cdot -2} \]
        3. lift-fma.f64N/A

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

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

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

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

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

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

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

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

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

          \[\leadsto \color{blue}{\frac{\frac{1}{-2}}{a}} \cdot \left(b + \sqrt{\mathsf{fma}\left(b, b, c \cdot \left(a \cdot -4\right)\right)}\right) \]
        13. metadata-evalN/A

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

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

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

      if 1.1e45 < b

      1. Initial program 60.8%

        \[\frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2 \cdot a} \]
      2. Add Preprocessing
      3. Taylor expanded in a around 0

        \[\leadsto \color{blue}{\frac{-1}{2} \cdot \frac{b + {b}^{2}}{a}} \]
      4. Step-by-step derivation
        1. associate-*r/N/A

          \[\leadsto \color{blue}{\frac{\frac{-1}{2} \cdot \left(b + {b}^{2}\right)}{a}} \]
        2. lower-/.f64N/A

          \[\leadsto \color{blue}{\frac{\frac{-1}{2} \cdot \left(b + {b}^{2}\right)}{a}} \]
        3. +-commutativeN/A

          \[\leadsto \frac{\frac{-1}{2} \cdot \color{blue}{\left({b}^{2} + b\right)}}{a} \]
        4. *-lft-identityN/A

          \[\leadsto \frac{\frac{-1}{2} \cdot \left({b}^{2} + \color{blue}{1 \cdot b}\right)}{a} \]
        5. lft-mult-inverseN/A

          \[\leadsto \frac{\frac{-1}{2} \cdot \left({b}^{2} + \color{blue}{\left(\frac{1}{b} \cdot b\right)} \cdot b\right)}{a} \]
        6. associate-*r*N/A

          \[\leadsto \frac{\frac{-1}{2} \cdot \left({b}^{2} + \color{blue}{\frac{1}{b} \cdot \left(b \cdot b\right)}\right)}{a} \]
        7. unpow2N/A

          \[\leadsto \frac{\frac{-1}{2} \cdot \left({b}^{2} + \frac{1}{b} \cdot \color{blue}{{b}^{2}}\right)}{a} \]
        8. *-lft-identityN/A

          \[\leadsto \frac{\frac{-1}{2} \cdot \left(\color{blue}{1 \cdot {b}^{2}} + \frac{1}{b} \cdot {b}^{2}\right)}{a} \]
        9. distribute-rgt-inN/A

          \[\leadsto \frac{\frac{-1}{2} \cdot \color{blue}{\left({b}^{2} \cdot \left(1 + \frac{1}{b}\right)\right)}}{a} \]
        10. lower-*.f64N/A

          \[\leadsto \frac{\color{blue}{\frac{-1}{2} \cdot \left({b}^{2} \cdot \left(1 + \frac{1}{b}\right)\right)}}{a} \]
        11. unpow2N/A

          \[\leadsto \frac{\frac{-1}{2} \cdot \left(\color{blue}{\left(b \cdot b\right)} \cdot \left(1 + \frac{1}{b}\right)\right)}{a} \]
        12. associate-*l*N/A

          \[\leadsto \frac{\frac{-1}{2} \cdot \color{blue}{\left(b \cdot \left(b \cdot \left(1 + \frac{1}{b}\right)\right)\right)}}{a} \]
        13. distribute-lft-inN/A

          \[\leadsto \frac{\frac{-1}{2} \cdot \left(b \cdot \color{blue}{\left(b \cdot 1 + b \cdot \frac{1}{b}\right)}\right)}{a} \]
        14. *-rgt-identityN/A

          \[\leadsto \frac{\frac{-1}{2} \cdot \left(b \cdot \left(\color{blue}{b} + b \cdot \frac{1}{b}\right)\right)}{a} \]
        15. rgt-mult-inverseN/A

          \[\leadsto \frac{\frac{-1}{2} \cdot \left(b \cdot \left(b + \color{blue}{1}\right)\right)}{a} \]
        16. distribute-lft-outN/A

          \[\leadsto \frac{\frac{-1}{2} \cdot \color{blue}{\left(b \cdot b + b \cdot 1\right)}}{a} \]
        17. *-rgt-identityN/A

          \[\leadsto \frac{\frac{-1}{2} \cdot \left(b \cdot b + \color{blue}{b}\right)}{a} \]
        18. lower-fma.f6440.6

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

        \[\leadsto \color{blue}{\frac{-0.5 \cdot \mathsf{fma}\left(b, b, b\right)}{a}} \]
      6. Taylor expanded in b around 0

        \[\leadsto \color{blue}{\frac{-1}{2} \cdot \frac{b}{a}} \]
      7. Step-by-step derivation
        1. associate-*r/N/A

          \[\leadsto \color{blue}{\frac{\frac{-1}{2} \cdot b}{a}} \]
        2. lower-/.f64N/A

          \[\leadsto \color{blue}{\frac{\frac{-1}{2} \cdot b}{a}} \]
        3. lower-*.f6448.5

          \[\leadsto \frac{\color{blue}{-0.5 \cdot b}}{a} \]
      8. Simplified48.5%

        \[\leadsto \color{blue}{\frac{-0.5 \cdot b}{a}} \]
      9. Taylor expanded in b around -inf

        \[\leadsto \frac{\color{blue}{-1 \cdot b}}{a} \]
      10. Step-by-step derivation
        1. mul-1-negN/A

          \[\leadsto \frac{\color{blue}{\mathsf{neg}\left(b\right)}}{a} \]
        2. lower-neg.f6495.3

          \[\leadsto \frac{\color{blue}{-b}}{a} \]
      11. Simplified95.3%

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

      \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -1.35 \cdot 10^{+154}:\\ \;\;\;\;\frac{0.5}{\frac{\mathsf{fma}\left(b, \mathsf{fma}\left(b, a, a\right), a\right)}{b}}\\ \mathbf{elif}\;b \leq 1.1 \cdot 10^{+45}:\\ \;\;\;\;\frac{-0.5}{a} \cdot \left(b + \sqrt{\mathsf{fma}\left(b, b, c \cdot \left(a \cdot -4\right)\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;-\frac{b}{a}\\ \end{array} \]
    5. Add Preprocessing

    Alternative 5: 60.1% accurate, 1.0× speedup?

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

      1. Initial program 8.5%

        \[\frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2 \cdot a} \]
      2. Add Preprocessing
      3. Applied egg-rr2.0%

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

        \[\leadsto \frac{\frac{1}{2}}{\frac{a}{b - \color{blue}{{b}^{3}}}} \]
      5. Step-by-step derivation
        1. cube-multN/A

          \[\leadsto \frac{\frac{1}{2}}{\frac{a}{b - \color{blue}{b \cdot \left(b \cdot b\right)}}} \]
        2. unpow2N/A

          \[\leadsto \frac{\frac{1}{2}}{\frac{a}{b - b \cdot \color{blue}{{b}^{2}}}} \]
        3. lower-*.f64N/A

          \[\leadsto \frac{\frac{1}{2}}{\frac{a}{b - \color{blue}{b \cdot {b}^{2}}}} \]
        4. unpow2N/A

          \[\leadsto \frac{\frac{1}{2}}{\frac{a}{b - b \cdot \color{blue}{\left(b \cdot b\right)}}} \]
        5. lower-*.f641.8

          \[\leadsto \frac{0.5}{\frac{a}{b - b \cdot \color{blue}{\left(b \cdot b\right)}}} \]
      6. Simplified1.8%

        \[\leadsto \frac{0.5}{\frac{a}{b - \color{blue}{b \cdot \left(b \cdot b\right)}}} \]
      7. Taylor expanded in b around 0

        \[\leadsto \frac{\frac{1}{2}}{\frac{a}{\color{blue}{0}}} \]
      8. Step-by-step derivation
        1. Simplified32.9%

          \[\leadsto \frac{0.5}{\frac{a}{\color{blue}{0}}} \]

        if -4.2000000000000001e32 < b < 1.25000000000000007e-123

        1. Initial program 70.5%

          \[\frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2 \cdot a} \]
        2. Add Preprocessing
        3. Applied egg-rr70.5%

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

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

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

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

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

        if 1.25000000000000007e-123 < b

        1. Initial program 70.9%

          \[\frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2 \cdot a} \]
        2. Add Preprocessing
        3. Taylor expanded in a around 0

          \[\leadsto \color{blue}{\frac{-1}{2} \cdot \frac{b + {b}^{2}}{a}} \]
        4. Step-by-step derivation
          1. associate-*r/N/A

            \[\leadsto \color{blue}{\frac{\frac{-1}{2} \cdot \left(b + {b}^{2}\right)}{a}} \]
          2. lower-/.f64N/A

            \[\leadsto \color{blue}{\frac{\frac{-1}{2} \cdot \left(b + {b}^{2}\right)}{a}} \]
          3. +-commutativeN/A

            \[\leadsto \frac{\frac{-1}{2} \cdot \color{blue}{\left({b}^{2} + b\right)}}{a} \]
          4. *-lft-identityN/A

            \[\leadsto \frac{\frac{-1}{2} \cdot \left({b}^{2} + \color{blue}{1 \cdot b}\right)}{a} \]
          5. lft-mult-inverseN/A

            \[\leadsto \frac{\frac{-1}{2} \cdot \left({b}^{2} + \color{blue}{\left(\frac{1}{b} \cdot b\right)} \cdot b\right)}{a} \]
          6. associate-*r*N/A

            \[\leadsto \frac{\frac{-1}{2} \cdot \left({b}^{2} + \color{blue}{\frac{1}{b} \cdot \left(b \cdot b\right)}\right)}{a} \]
          7. unpow2N/A

            \[\leadsto \frac{\frac{-1}{2} \cdot \left({b}^{2} + \frac{1}{b} \cdot \color{blue}{{b}^{2}}\right)}{a} \]
          8. *-lft-identityN/A

            \[\leadsto \frac{\frac{-1}{2} \cdot \left(\color{blue}{1 \cdot {b}^{2}} + \frac{1}{b} \cdot {b}^{2}\right)}{a} \]
          9. distribute-rgt-inN/A

            \[\leadsto \frac{\frac{-1}{2} \cdot \color{blue}{\left({b}^{2} \cdot \left(1 + \frac{1}{b}\right)\right)}}{a} \]
          10. lower-*.f64N/A

            \[\leadsto \frac{\color{blue}{\frac{-1}{2} \cdot \left({b}^{2} \cdot \left(1 + \frac{1}{b}\right)\right)}}{a} \]
          11. unpow2N/A

            \[\leadsto \frac{\frac{-1}{2} \cdot \left(\color{blue}{\left(b \cdot b\right)} \cdot \left(1 + \frac{1}{b}\right)\right)}{a} \]
          12. associate-*l*N/A

            \[\leadsto \frac{\frac{-1}{2} \cdot \color{blue}{\left(b \cdot \left(b \cdot \left(1 + \frac{1}{b}\right)\right)\right)}}{a} \]
          13. distribute-lft-inN/A

            \[\leadsto \frac{\frac{-1}{2} \cdot \left(b \cdot \color{blue}{\left(b \cdot 1 + b \cdot \frac{1}{b}\right)}\right)}{a} \]
          14. *-rgt-identityN/A

            \[\leadsto \frac{\frac{-1}{2} \cdot \left(b \cdot \left(\color{blue}{b} + b \cdot \frac{1}{b}\right)\right)}{a} \]
          15. rgt-mult-inverseN/A

            \[\leadsto \frac{\frac{-1}{2} \cdot \left(b \cdot \left(b + \color{blue}{1}\right)\right)}{a} \]
          16. distribute-lft-outN/A

            \[\leadsto \frac{\frac{-1}{2} \cdot \color{blue}{\left(b \cdot b + b \cdot 1\right)}}{a} \]
          17. *-rgt-identityN/A

            \[\leadsto \frac{\frac{-1}{2} \cdot \left(b \cdot b + \color{blue}{b}\right)}{a} \]
          18. lower-fma.f6434.5

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

          \[\leadsto \color{blue}{\frac{-0.5 \cdot \mathsf{fma}\left(b, b, b\right)}{a}} \]
        6. Taylor expanded in b around 0

          \[\leadsto \color{blue}{\frac{-1}{2} \cdot \frac{b}{a}} \]
        7. Step-by-step derivation
          1. associate-*r/N/A

            \[\leadsto \color{blue}{\frac{\frac{-1}{2} \cdot b}{a}} \]
          2. lower-/.f64N/A

            \[\leadsto \color{blue}{\frac{\frac{-1}{2} \cdot b}{a}} \]
          3. lower-*.f6440.9

            \[\leadsto \frac{\color{blue}{-0.5 \cdot b}}{a} \]
        8. Simplified40.9%

          \[\leadsto \color{blue}{\frac{-0.5 \cdot b}{a}} \]
        9. Taylor expanded in b around -inf

          \[\leadsto \frac{\color{blue}{-1 \cdot b}}{a} \]
        10. Step-by-step derivation
          1. mul-1-negN/A

            \[\leadsto \frac{\color{blue}{\mathsf{neg}\left(b\right)}}{a} \]
          2. lower-neg.f6490.9

            \[\leadsto \frac{\color{blue}{-b}}{a} \]
        11. Simplified90.9%

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

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -4.2 \cdot 10^{+32}:\\ \;\;\;\;\frac{0.5}{\frac{a}{0}}\\ \mathbf{elif}\;b \leq 1.25 \cdot 10^{-123}:\\ \;\;\;\;\frac{b + \sqrt{\left(a \cdot c\right) \cdot -4}}{a \cdot -2}\\ \mathbf{else}:\\ \;\;\;\;-\frac{b}{a}\\ \end{array} \]
      11. Add Preprocessing

      Alternative 6: 43.6% accurate, 1.7× speedup?

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

        1. Initial program 32.8%

          \[\frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2 \cdot a} \]
        2. Add Preprocessing
        3. Applied egg-rr27.2%

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

          \[\leadsto \frac{\frac{1}{2}}{\frac{a}{b - \color{blue}{{b}^{3}}}} \]
        5. Step-by-step derivation
          1. cube-multN/A

            \[\leadsto \frac{\frac{1}{2}}{\frac{a}{b - \color{blue}{b \cdot \left(b \cdot b\right)}}} \]
          2. unpow2N/A

            \[\leadsto \frac{\frac{1}{2}}{\frac{a}{b - b \cdot \color{blue}{{b}^{2}}}} \]
          3. lower-*.f64N/A

            \[\leadsto \frac{\frac{1}{2}}{\frac{a}{b - \color{blue}{b \cdot {b}^{2}}}} \]
          4. unpow2N/A

            \[\leadsto \frac{\frac{1}{2}}{\frac{a}{b - b \cdot \color{blue}{\left(b \cdot b\right)}}} \]
          5. lower-*.f643.1

            \[\leadsto \frac{0.5}{\frac{a}{b - b \cdot \color{blue}{\left(b \cdot b\right)}}} \]
        6. Simplified3.1%

          \[\leadsto \frac{0.5}{\frac{a}{b - \color{blue}{b \cdot \left(b \cdot b\right)}}} \]
        7. Taylor expanded in b around 0

          \[\leadsto \frac{\frac{1}{2}}{\frac{a}{\color{blue}{0}}} \]
        8. Step-by-step derivation
          1. Simplified20.1%

            \[\leadsto \frac{0.5}{\frac{a}{\color{blue}{0}}} \]

          if -1.95000000000000013e-305 < b

          1. Initial program 73.6%

            \[\frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2 \cdot a} \]
          2. Add Preprocessing
          3. Taylor expanded in a around 0

            \[\leadsto \color{blue}{\frac{-1}{2} \cdot \frac{b + {b}^{2}}{a}} \]
          4. Step-by-step derivation
            1. associate-*r/N/A

              \[\leadsto \color{blue}{\frac{\frac{-1}{2} \cdot \left(b + {b}^{2}\right)}{a}} \]
            2. lower-/.f64N/A

              \[\leadsto \color{blue}{\frac{\frac{-1}{2} \cdot \left(b + {b}^{2}\right)}{a}} \]
            3. +-commutativeN/A

              \[\leadsto \frac{\frac{-1}{2} \cdot \color{blue}{\left({b}^{2} + b\right)}}{a} \]
            4. *-lft-identityN/A

              \[\leadsto \frac{\frac{-1}{2} \cdot \left({b}^{2} + \color{blue}{1 \cdot b}\right)}{a} \]
            5. lft-mult-inverseN/A

              \[\leadsto \frac{\frac{-1}{2} \cdot \left({b}^{2} + \color{blue}{\left(\frac{1}{b} \cdot b\right)} \cdot b\right)}{a} \]
            6. associate-*r*N/A

              \[\leadsto \frac{\frac{-1}{2} \cdot \left({b}^{2} + \color{blue}{\frac{1}{b} \cdot \left(b \cdot b\right)}\right)}{a} \]
            7. unpow2N/A

              \[\leadsto \frac{\frac{-1}{2} \cdot \left({b}^{2} + \frac{1}{b} \cdot \color{blue}{{b}^{2}}\right)}{a} \]
            8. *-lft-identityN/A

              \[\leadsto \frac{\frac{-1}{2} \cdot \left(\color{blue}{1 \cdot {b}^{2}} + \frac{1}{b} \cdot {b}^{2}\right)}{a} \]
            9. distribute-rgt-inN/A

              \[\leadsto \frac{\frac{-1}{2} \cdot \color{blue}{\left({b}^{2} \cdot \left(1 + \frac{1}{b}\right)\right)}}{a} \]
            10. lower-*.f64N/A

              \[\leadsto \frac{\color{blue}{\frac{-1}{2} \cdot \left({b}^{2} \cdot \left(1 + \frac{1}{b}\right)\right)}}{a} \]
            11. unpow2N/A

              \[\leadsto \frac{\frac{-1}{2} \cdot \left(\color{blue}{\left(b \cdot b\right)} \cdot \left(1 + \frac{1}{b}\right)\right)}{a} \]
            12. associate-*l*N/A

              \[\leadsto \frac{\frac{-1}{2} \cdot \color{blue}{\left(b \cdot \left(b \cdot \left(1 + \frac{1}{b}\right)\right)\right)}}{a} \]
            13. distribute-lft-inN/A

              \[\leadsto \frac{\frac{-1}{2} \cdot \left(b \cdot \color{blue}{\left(b \cdot 1 + b \cdot \frac{1}{b}\right)}\right)}{a} \]
            14. *-rgt-identityN/A

              \[\leadsto \frac{\frac{-1}{2} \cdot \left(b \cdot \left(\color{blue}{b} + b \cdot \frac{1}{b}\right)\right)}{a} \]
            15. rgt-mult-inverseN/A

              \[\leadsto \frac{\frac{-1}{2} \cdot \left(b \cdot \left(b + \color{blue}{1}\right)\right)}{a} \]
            16. distribute-lft-outN/A

              \[\leadsto \frac{\frac{-1}{2} \cdot \color{blue}{\left(b \cdot b + b \cdot 1\right)}}{a} \]
            17. *-rgt-identityN/A

              \[\leadsto \frac{\frac{-1}{2} \cdot \left(b \cdot b + \color{blue}{b}\right)}{a} \]
            18. lower-fma.f6428.5

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

            \[\leadsto \color{blue}{\frac{-0.5 \cdot \mathsf{fma}\left(b, b, b\right)}{a}} \]
          6. Taylor expanded in b around 0

            \[\leadsto \color{blue}{\frac{-1}{2} \cdot \frac{b}{a}} \]
          7. Step-by-step derivation
            1. associate-*r/N/A

              \[\leadsto \color{blue}{\frac{\frac{-1}{2} \cdot b}{a}} \]
            2. lower-/.f64N/A

              \[\leadsto \color{blue}{\frac{\frac{-1}{2} \cdot b}{a}} \]
            3. lower-*.f6433.6

              \[\leadsto \frac{\color{blue}{-0.5 \cdot b}}{a} \]
          8. Simplified33.6%

            \[\leadsto \color{blue}{\frac{-0.5 \cdot b}{a}} \]
          9. Taylor expanded in b around -inf

            \[\leadsto \frac{\color{blue}{-1 \cdot b}}{a} \]
          10. Step-by-step derivation
            1. mul-1-negN/A

              \[\leadsto \frac{\color{blue}{\mathsf{neg}\left(b\right)}}{a} \]
            2. lower-neg.f6474.6

              \[\leadsto \frac{\color{blue}{-b}}{a} \]
          11. Simplified74.6%

            \[\leadsto \frac{\color{blue}{-b}}{a} \]
        9. Recombined 2 regimes into one program.
        10. Final simplification48.6%

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

        Alternative 7: 35.0% accurate, 3.6× speedup?

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

          \[\frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2 \cdot a} \]
        2. Add Preprocessing
        3. Taylor expanded in a around 0

          \[\leadsto \color{blue}{\frac{-1}{2} \cdot \frac{b + {b}^{2}}{a}} \]
        4. Step-by-step derivation
          1. associate-*r/N/A

            \[\leadsto \color{blue}{\frac{\frac{-1}{2} \cdot \left(b + {b}^{2}\right)}{a}} \]
          2. lower-/.f64N/A

            \[\leadsto \color{blue}{\frac{\frac{-1}{2} \cdot \left(b + {b}^{2}\right)}{a}} \]
          3. +-commutativeN/A

            \[\leadsto \frac{\frac{-1}{2} \cdot \color{blue}{\left({b}^{2} + b\right)}}{a} \]
          4. *-lft-identityN/A

            \[\leadsto \frac{\frac{-1}{2} \cdot \left({b}^{2} + \color{blue}{1 \cdot b}\right)}{a} \]
          5. lft-mult-inverseN/A

            \[\leadsto \frac{\frac{-1}{2} \cdot \left({b}^{2} + \color{blue}{\left(\frac{1}{b} \cdot b\right)} \cdot b\right)}{a} \]
          6. associate-*r*N/A

            \[\leadsto \frac{\frac{-1}{2} \cdot \left({b}^{2} + \color{blue}{\frac{1}{b} \cdot \left(b \cdot b\right)}\right)}{a} \]
          7. unpow2N/A

            \[\leadsto \frac{\frac{-1}{2} \cdot \left({b}^{2} + \frac{1}{b} \cdot \color{blue}{{b}^{2}}\right)}{a} \]
          8. *-lft-identityN/A

            \[\leadsto \frac{\frac{-1}{2} \cdot \left(\color{blue}{1 \cdot {b}^{2}} + \frac{1}{b} \cdot {b}^{2}\right)}{a} \]
          9. distribute-rgt-inN/A

            \[\leadsto \frac{\frac{-1}{2} \cdot \color{blue}{\left({b}^{2} \cdot \left(1 + \frac{1}{b}\right)\right)}}{a} \]
          10. lower-*.f64N/A

            \[\leadsto \frac{\color{blue}{\frac{-1}{2} \cdot \left({b}^{2} \cdot \left(1 + \frac{1}{b}\right)\right)}}{a} \]
          11. unpow2N/A

            \[\leadsto \frac{\frac{-1}{2} \cdot \left(\color{blue}{\left(b \cdot b\right)} \cdot \left(1 + \frac{1}{b}\right)\right)}{a} \]
          12. associate-*l*N/A

            \[\leadsto \frac{\frac{-1}{2} \cdot \color{blue}{\left(b \cdot \left(b \cdot \left(1 + \frac{1}{b}\right)\right)\right)}}{a} \]
          13. distribute-lft-inN/A

            \[\leadsto \frac{\frac{-1}{2} \cdot \left(b \cdot \color{blue}{\left(b \cdot 1 + b \cdot \frac{1}{b}\right)}\right)}{a} \]
          14. *-rgt-identityN/A

            \[\leadsto \frac{\frac{-1}{2} \cdot \left(b \cdot \left(\color{blue}{b} + b \cdot \frac{1}{b}\right)\right)}{a} \]
          15. rgt-mult-inverseN/A

            \[\leadsto \frac{\frac{-1}{2} \cdot \left(b \cdot \left(b + \color{blue}{1}\right)\right)}{a} \]
          16. distribute-lft-outN/A

            \[\leadsto \frac{\frac{-1}{2} \cdot \color{blue}{\left(b \cdot b + b \cdot 1\right)}}{a} \]
          17. *-rgt-identityN/A

            \[\leadsto \frac{\frac{-1}{2} \cdot \left(b \cdot b + \color{blue}{b}\right)}{a} \]
          18. lower-fma.f6416.2

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

          \[\leadsto \color{blue}{\frac{-0.5 \cdot \mathsf{fma}\left(b, b, b\right)}{a}} \]
        6. Taylor expanded in b around 0

          \[\leadsto \color{blue}{\frac{-1}{2} \cdot \frac{b}{a}} \]
        7. Step-by-step derivation
          1. associate-*r/N/A

            \[\leadsto \color{blue}{\frac{\frac{-1}{2} \cdot b}{a}} \]
          2. lower-/.f64N/A

            \[\leadsto \color{blue}{\frac{\frac{-1}{2} \cdot b}{a}} \]
          3. lower-*.f6418.9

            \[\leadsto \frac{\color{blue}{-0.5 \cdot b}}{a} \]
        8. Simplified18.9%

          \[\leadsto \color{blue}{\frac{-0.5 \cdot b}{a}} \]
        9. Taylor expanded in b around -inf

          \[\leadsto \frac{\color{blue}{-1 \cdot b}}{a} \]
        10. Step-by-step derivation
          1. mul-1-negN/A

            \[\leadsto \frac{\color{blue}{\mathsf{neg}\left(b\right)}}{a} \]
          2. lower-neg.f6440.4

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

          \[\leadsto \frac{\color{blue}{-b}}{a} \]
        12. Final simplification40.4%

          \[\leadsto -\frac{b}{a} \]
        13. Add Preprocessing

        Developer Target 1: 99.7% accurate, 0.2× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} t_0 := \left|\frac{b}{2}\right|\\ t_1 := \sqrt{\left|a\right|} \cdot \sqrt{\left|c\right|}\\ t_2 := \begin{array}{l} \mathbf{if}\;\mathsf{copysign}\left(a, c\right) = a:\\ \;\;\;\;\sqrt{t\_0 - t\_1} \cdot \sqrt{t\_0 + t\_1}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{hypot}\left(\frac{b}{2}, t\_1\right)\\ \end{array}\\ \mathbf{if}\;b < 0:\\ \;\;\;\;\frac{c}{t\_2 - \frac{b}{2}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{b}{2} + t\_2}{-a}\\ \end{array} \end{array} \]
        (FPCore (a b c)
         :precision binary64
         (let* ((t_0 (fabs (/ b 2.0)))
                (t_1 (* (sqrt (fabs a)) (sqrt (fabs c))))
                (t_2
                 (if (== (copysign a c) a)
                   (* (sqrt (- t_0 t_1)) (sqrt (+ t_0 t_1)))
                   (hypot (/ b 2.0) t_1))))
           (if (< b 0.0) (/ c (- t_2 (/ b 2.0))) (/ (+ (/ b 2.0) t_2) (- a)))))
        double code(double a, double b, double c) {
        	double t_0 = fabs((b / 2.0));
        	double t_1 = sqrt(fabs(a)) * sqrt(fabs(c));
        	double tmp;
        	if (copysign(a, c) == a) {
        		tmp = sqrt((t_0 - t_1)) * sqrt((t_0 + t_1));
        	} else {
        		tmp = hypot((b / 2.0), t_1);
        	}
        	double t_2 = tmp;
        	double tmp_1;
        	if (b < 0.0) {
        		tmp_1 = c / (t_2 - (b / 2.0));
        	} else {
        		tmp_1 = ((b / 2.0) + t_2) / -a;
        	}
        	return tmp_1;
        }
        
        public static double code(double a, double b, double c) {
        	double t_0 = Math.abs((b / 2.0));
        	double t_1 = Math.sqrt(Math.abs(a)) * Math.sqrt(Math.abs(c));
        	double tmp;
        	if (Math.copySign(a, c) == a) {
        		tmp = Math.sqrt((t_0 - t_1)) * Math.sqrt((t_0 + t_1));
        	} else {
        		tmp = Math.hypot((b / 2.0), t_1);
        	}
        	double t_2 = tmp;
        	double tmp_1;
        	if (b < 0.0) {
        		tmp_1 = c / (t_2 - (b / 2.0));
        	} else {
        		tmp_1 = ((b / 2.0) + t_2) / -a;
        	}
        	return tmp_1;
        }
        
        def code(a, b, c):
        	t_0 = math.fabs((b / 2.0))
        	t_1 = math.sqrt(math.fabs(a)) * math.sqrt(math.fabs(c))
        	tmp = 0
        	if math.copysign(a, c) == a:
        		tmp = math.sqrt((t_0 - t_1)) * math.sqrt((t_0 + t_1))
        	else:
        		tmp = math.hypot((b / 2.0), t_1)
        	t_2 = tmp
        	tmp_1 = 0
        	if b < 0.0:
        		tmp_1 = c / (t_2 - (b / 2.0))
        	else:
        		tmp_1 = ((b / 2.0) + t_2) / -a
        	return tmp_1
        
        function code(a, b, c)
        	t_0 = abs(Float64(b / 2.0))
        	t_1 = Float64(sqrt(abs(a)) * sqrt(abs(c)))
        	tmp = 0.0
        	if (copysign(a, c) == a)
        		tmp = Float64(sqrt(Float64(t_0 - t_1)) * sqrt(Float64(t_0 + t_1)));
        	else
        		tmp = hypot(Float64(b / 2.0), t_1);
        	end
        	t_2 = tmp
        	tmp_1 = 0.0
        	if (b < 0.0)
        		tmp_1 = Float64(c / Float64(t_2 - Float64(b / 2.0)));
        	else
        		tmp_1 = Float64(Float64(Float64(b / 2.0) + t_2) / Float64(-a));
        	end
        	return tmp_1
        end
        
        function tmp_3 = code(a, b, c)
        	t_0 = abs((b / 2.0));
        	t_1 = sqrt(abs(a)) * sqrt(abs(c));
        	tmp = 0.0;
        	if ((sign(c) * abs(a)) == a)
        		tmp = sqrt((t_0 - t_1)) * sqrt((t_0 + t_1));
        	else
        		tmp = hypot((b / 2.0), t_1);
        	end
        	t_2 = tmp;
        	tmp_2 = 0.0;
        	if (b < 0.0)
        		tmp_2 = c / (t_2 - (b / 2.0));
        	else
        		tmp_2 = ((b / 2.0) + t_2) / -a;
        	end
        	tmp_3 = tmp_2;
        end
        
        code[a_, b_, c_] := Block[{t$95$0 = N[Abs[N[(b / 2.0), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(N[Sqrt[N[Abs[a], $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[Abs[c], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = If[Equal[N[With[{TMP1 = Abs[a], TMP2 = Sign[c]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision], a], N[(N[Sqrt[N[(t$95$0 - t$95$1), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(t$95$0 + t$95$1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[Sqrt[N[(b / 2.0), $MachinePrecision] ^ 2 + t$95$1 ^ 2], $MachinePrecision]]}, If[Less[b, 0.0], N[(c / N[(t$95$2 - N[(b / 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(b / 2.0), $MachinePrecision] + t$95$2), $MachinePrecision] / (-a)), $MachinePrecision]]]]]
        
        \begin{array}{l}
        
        \\
        \begin{array}{l}
        t_0 := \left|\frac{b}{2}\right|\\
        t_1 := \sqrt{\left|a\right|} \cdot \sqrt{\left|c\right|}\\
        t_2 := \begin{array}{l}
        \mathbf{if}\;\mathsf{copysign}\left(a, c\right) = a:\\
        \;\;\;\;\sqrt{t\_0 - t\_1} \cdot \sqrt{t\_0 + t\_1}\\
        
        \mathbf{else}:\\
        \;\;\;\;\mathsf{hypot}\left(\frac{b}{2}, t\_1\right)\\
        
        
        \end{array}\\
        \mathbf{if}\;b < 0:\\
        \;\;\;\;\frac{c}{t\_2 - \frac{b}{2}}\\
        
        \mathbf{else}:\\
        \;\;\;\;\frac{\frac{b}{2} + t\_2}{-a}\\
        
        
        \end{array}
        \end{array}
        

        Reproduce

        ?
        herbie shell --seed 2024214 
        (FPCore (a b c)
          :name "quadm (p42, negative)"
          :precision binary64
          :herbie-expected 10
        
          :alt
          (! :herbie-platform default (let ((sqtD (let ((x (* (sqrt (fabs a)) (sqrt (fabs c))))) (if (== (copysign a c) a) (* (sqrt (- (fabs (/ b 2)) x)) (sqrt (+ (fabs (/ b 2)) x))) (hypot (/ b 2) x))))) (if (< b 0) (/ c (- sqtD (/ b 2))) (/ (+ (/ b 2) sqtD) (- a)))))
        
          (/ (- (- b) (sqrt (- (* b b) (* 4.0 (* a c))))) (* 2.0 a)))