Quadratic roots, full range

Percentage Accurate: 52.2% → 86.1%
Time: 13.1s
Alternatives: 8
Speedup: 11.6×

Specification

?
\[\begin{array}{l} \\ \frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a} \end{array} \]
(FPCore (a b c)
 :precision binary64
 (/ (+ (- b) (sqrt (- (* b b) (* (* 4.0 a) c)))) (* 2.0 a)))
double code(double a, double b, double c) {
	return (-b + sqrt(((b * b) - ((4.0 * a) * c)))) / (2.0 * a);
}
real(8) function code(a, b, c)
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    code = (-b + sqrt(((b * b) - ((4.0d0 * a) * c)))) / (2.0d0 * a)
end function
public static double code(double a, double b, double c) {
	return (-b + Math.sqrt(((b * b) - ((4.0 * a) * c)))) / (2.0 * a);
}
def code(a, b, c):
	return (-b + math.sqrt(((b * b) - ((4.0 * a) * c)))) / (2.0 * a)
function code(a, b, c)
	return Float64(Float64(Float64(-b) + sqrt(Float64(Float64(b * b) - Float64(Float64(4.0 * a) * c)))) / Float64(2.0 * a))
end
function tmp = code(a, b, c)
	tmp = (-b + sqrt(((b * b) - ((4.0 * a) * c)))) / (2.0 * a);
end
code[a_, b_, c_] := N[(N[((-b) + N[Sqrt[N[(N[(b * b), $MachinePrecision] - N[(N[(4.0 * a), $MachinePrecision] * c), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[(2.0 * a), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

The average percentage accuracy by input value. Horizontal axis shows value of an input variable; the variable is choosen in the title. Vertical axis is accuracy; higher is better. Red represent the original program, while blue represents Herbie's suggestion. These can be toggled with buttons below the plot. The line is an average while dots represent individual samples.

Accuracy vs Speed?

Herbie found 8 alternatives:

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

Initial Program: 52.2% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a} \end{array} \]
(FPCore (a b c)
 :precision binary64
 (/ (+ (- b) (sqrt (- (* b b) (* (* 4.0 a) c)))) (* 2.0 a)))
double code(double a, double b, double c) {
	return (-b + sqrt(((b * b) - ((4.0 * a) * c)))) / (2.0 * a);
}
real(8) function code(a, b, c)
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    code = (-b + sqrt(((b * b) - ((4.0d0 * a) * c)))) / (2.0d0 * a)
end function
public static double code(double a, double b, double c) {
	return (-b + Math.sqrt(((b * b) - ((4.0 * a) * c)))) / (2.0 * a);
}
def code(a, b, c):
	return (-b + math.sqrt(((b * b) - ((4.0 * a) * c)))) / (2.0 * a)
function code(a, b, c)
	return Float64(Float64(Float64(-b) + sqrt(Float64(Float64(b * b) - Float64(Float64(4.0 * a) * c)))) / Float64(2.0 * a))
end
function tmp = code(a, b, c)
	tmp = (-b + sqrt(((b * b) - ((4.0 * a) * c)))) / (2.0 * a);
end
code[a_, b_, c_] := N[(N[((-b) + N[Sqrt[N[(N[(b * b), $MachinePrecision] - N[(N[(4.0 * a), $MachinePrecision] * c), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[(2.0 * a), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

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

Alternative 1: 86.1% accurate, 0.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq -6.6 \cdot 10^{+94}:\\
\;\;\;\;\frac{c}{b} - \frac{b}{a}\\

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

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


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

    1. Initial program 52.1%

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

        \[\leadsto \mathsf{/.f64}\left(\left(\left(\mathsf{neg}\left(b\right)\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}\right), \color{blue}{\left(2 \cdot a\right)}\right) \]
      2. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c} + \left(\mathsf{neg}\left(b\right)\right)\right), \left(\color{blue}{2} \cdot a\right)\right) \]
      3. unsub-negN/A

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\left(\sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}\right), b\right), \left(\color{blue}{2} \cdot a\right)\right) \]
      5. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\left(b \cdot b - \left(4 \cdot a\right) \cdot c\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      6. sub-negN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\left(b \cdot b + \left(\mathsf{neg}\left(\left(4 \cdot a\right) \cdot c\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      7. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\left(b \cdot b\right), \left(\mathsf{neg}\left(\left(4 \cdot a\right) \cdot c\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(\mathsf{neg}\left(\left(4 \cdot a\right) \cdot c\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      9. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(\mathsf{neg}\left(\left(a \cdot 4\right) \cdot c\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      10. associate-*l*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(\mathsf{neg}\left(a \cdot \left(4 \cdot c\right)\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      11. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(a \cdot \left(\mathsf{neg}\left(4 \cdot c\right)\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      12. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(a \cdot \left(\mathsf{neg}\left(c \cdot 4\right)\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      13. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(a, \left(\mathsf{neg}\left(c \cdot 4\right)\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      14. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(a, \left(c \cdot \left(\mathsf{neg}\left(4\right)\right)\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      15. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(c, \left(\mathsf{neg}\left(4\right)\right)\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      16. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(c, -4\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      17. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(c, -4\right)\right)\right)\right), b\right), \left(a \cdot \color{blue}{2}\right)\right) \]
    3. Simplified52.1%

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

      \[\leadsto \color{blue}{-1 \cdot \left(b \cdot \left(-1 \cdot \frac{c}{{b}^{2}} + \frac{1}{a}\right)\right)} \]
    6. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto \mathsf{neg}\left(b \cdot \left(-1 \cdot \frac{c}{{b}^{2}} + \frac{1}{a}\right)\right) \]
      2. *-commutativeN/A

        \[\leadsto \mathsf{neg}\left(\left(-1 \cdot \frac{c}{{b}^{2}} + \frac{1}{a}\right) \cdot b\right) \]
      3. distribute-rgt-neg-inN/A

        \[\leadsto \left(-1 \cdot \frac{c}{{b}^{2}} + \frac{1}{a}\right) \cdot \color{blue}{\left(\mathsf{neg}\left(b\right)\right)} \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(-1 \cdot \frac{c}{{b}^{2}} + \frac{1}{a}\right), \color{blue}{\left(\mathsf{neg}\left(b\right)\right)}\right) \]
      5. +-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{1}{a} + -1 \cdot \frac{c}{{b}^{2}}\right), \left(\mathsf{neg}\left(\color{blue}{b}\right)\right)\right) \]
      6. mul-1-negN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{1}{a} + \left(\mathsf{neg}\left(\frac{c}{{b}^{2}}\right)\right)\right), \left(\mathsf{neg}\left(b\right)\right)\right) \]
      7. unsub-negN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{1}{a} - \frac{c}{{b}^{2}}\right), \left(\mathsf{neg}\left(\color{blue}{b}\right)\right)\right) \]
      8. --lowering--.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\left(\frac{1}{a}\right), \left(\frac{c}{{b}^{2}}\right)\right), \left(\mathsf{neg}\left(\color{blue}{b}\right)\right)\right) \]
      9. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, a\right), \left(\frac{c}{{b}^{2}}\right)\right), \left(\mathsf{neg}\left(b\right)\right)\right) \]
      10. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, a\right), \mathsf{/.f64}\left(c, \left({b}^{2}\right)\right)\right), \left(\mathsf{neg}\left(b\right)\right)\right) \]
      11. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, a\right), \mathsf{/.f64}\left(c, \left(b \cdot b\right)\right)\right), \left(\mathsf{neg}\left(b\right)\right)\right) \]
      12. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, a\right), \mathsf{/.f64}\left(c, \mathsf{*.f64}\left(b, b\right)\right)\right), \left(\mathsf{neg}\left(b\right)\right)\right) \]
      13. neg-sub0N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, a\right), \mathsf{/.f64}\left(c, \mathsf{*.f64}\left(b, b\right)\right)\right), \left(0 - \color{blue}{b}\right)\right) \]
      14. --lowering--.f6493.0%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, a\right), \mathsf{/.f64}\left(c, \mathsf{*.f64}\left(b, b\right)\right)\right), \mathsf{\_.f64}\left(0, \color{blue}{b}\right)\right) \]
    7. Simplified93.0%

      \[\leadsto \color{blue}{\left(\frac{1}{a} - \frac{c}{b \cdot b}\right) \cdot \left(0 - b\right)} \]
    8. Taylor expanded in a around inf

      \[\leadsto \color{blue}{-1 \cdot \frac{b}{a} + \frac{c}{b}} \]
    9. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto \frac{c}{b} + \color{blue}{-1 \cdot \frac{b}{a}} \]
      2. mul-1-negN/A

        \[\leadsto \frac{c}{b} + \left(\mathsf{neg}\left(\frac{b}{a}\right)\right) \]
      3. unsub-negN/A

        \[\leadsto \frac{c}{b} - \color{blue}{\frac{b}{a}} \]
      4. --lowering--.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\left(\frac{c}{b}\right), \color{blue}{\left(\frac{b}{a}\right)}\right) \]
      5. /-lowering-/.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(c, b\right), \left(\frac{\color{blue}{b}}{a}\right)\right) \]
      6. /-lowering-/.f6493.7%

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(c, b\right), \mathsf{/.f64}\left(b, \color{blue}{a}\right)\right) \]
    10. Simplified93.7%

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

    if -6.6e94 < b < 1.92e-66

    1. Initial program 83.6%

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

        \[\leadsto \mathsf{/.f64}\left(\left(\left(\mathsf{neg}\left(b\right)\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}\right), \color{blue}{\left(2 \cdot a\right)}\right) \]
      2. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c} + \left(\mathsf{neg}\left(b\right)\right)\right), \left(\color{blue}{2} \cdot a\right)\right) \]
      3. unsub-negN/A

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\left(\sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}\right), b\right), \left(\color{blue}{2} \cdot a\right)\right) \]
      5. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\left(b \cdot b - \left(4 \cdot a\right) \cdot c\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      6. sub-negN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\left(b \cdot b + \left(\mathsf{neg}\left(\left(4 \cdot a\right) \cdot c\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      7. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\left(b \cdot b\right), \left(\mathsf{neg}\left(\left(4 \cdot a\right) \cdot c\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(\mathsf{neg}\left(\left(4 \cdot a\right) \cdot c\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      9. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(\mathsf{neg}\left(\left(a \cdot 4\right) \cdot c\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      10. associate-*l*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(\mathsf{neg}\left(a \cdot \left(4 \cdot c\right)\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      11. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(a \cdot \left(\mathsf{neg}\left(4 \cdot c\right)\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      12. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(a \cdot \left(\mathsf{neg}\left(c \cdot 4\right)\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      13. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(a, \left(\mathsf{neg}\left(c \cdot 4\right)\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      14. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(a, \left(c \cdot \left(\mathsf{neg}\left(4\right)\right)\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      15. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(c, \left(\mathsf{neg}\left(4\right)\right)\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      16. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(c, -4\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      17. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(c, -4\right)\right)\right)\right), b\right), \left(a \cdot \color{blue}{2}\right)\right) \]
    3. Simplified83.6%

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

    if 1.92e-66 < b

    1. Initial program 11.3%

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

        \[\leadsto \mathsf{/.f64}\left(\left(\left(\mathsf{neg}\left(b\right)\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}\right), \color{blue}{\left(2 \cdot a\right)}\right) \]
      2. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c} + \left(\mathsf{neg}\left(b\right)\right)\right), \left(\color{blue}{2} \cdot a\right)\right) \]
      3. unsub-negN/A

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\left(\sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}\right), b\right), \left(\color{blue}{2} \cdot a\right)\right) \]
      5. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\left(b \cdot b - \left(4 \cdot a\right) \cdot c\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      6. sub-negN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\left(b \cdot b + \left(\mathsf{neg}\left(\left(4 \cdot a\right) \cdot c\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      7. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\left(b \cdot b\right), \left(\mathsf{neg}\left(\left(4 \cdot a\right) \cdot c\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(\mathsf{neg}\left(\left(4 \cdot a\right) \cdot c\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      9. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(\mathsf{neg}\left(\left(a \cdot 4\right) \cdot c\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      10. associate-*l*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(\mathsf{neg}\left(a \cdot \left(4 \cdot c\right)\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      11. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(a \cdot \left(\mathsf{neg}\left(4 \cdot c\right)\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      12. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(a \cdot \left(\mathsf{neg}\left(c \cdot 4\right)\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      13. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(a, \left(\mathsf{neg}\left(c \cdot 4\right)\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      14. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(a, \left(c \cdot \left(\mathsf{neg}\left(4\right)\right)\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      15. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(c, \left(\mathsf{neg}\left(4\right)\right)\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      16. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(c, -4\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      17. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(c, -4\right)\right)\right)\right), b\right), \left(a \cdot \color{blue}{2}\right)\right) \]
    3. Simplified11.3%

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

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

        \[\leadsto \mathsf{neg}\left(\frac{c}{b}\right) \]
      2. neg-sub0N/A

        \[\leadsto 0 - \color{blue}{\frac{c}{b}} \]
      3. --lowering--.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(0, \color{blue}{\left(\frac{c}{b}\right)}\right) \]
      4. /-lowering-/.f6485.3%

        \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(c, \color{blue}{b}\right)\right) \]
    7. Simplified85.3%

      \[\leadsto \color{blue}{0 - \frac{c}{b}} \]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 2: 86.0% accurate, 0.9× speedup?

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

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

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

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


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

    1. Initial program 52.1%

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

        \[\leadsto \mathsf{/.f64}\left(\left(\left(\mathsf{neg}\left(b\right)\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}\right), \color{blue}{\left(2 \cdot a\right)}\right) \]
      2. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c} + \left(\mathsf{neg}\left(b\right)\right)\right), \left(\color{blue}{2} \cdot a\right)\right) \]
      3. unsub-negN/A

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\left(\sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}\right), b\right), \left(\color{blue}{2} \cdot a\right)\right) \]
      5. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\left(b \cdot b - \left(4 \cdot a\right) \cdot c\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      6. sub-negN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\left(b \cdot b + \left(\mathsf{neg}\left(\left(4 \cdot a\right) \cdot c\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      7. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\left(b \cdot b\right), \left(\mathsf{neg}\left(\left(4 \cdot a\right) \cdot c\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(\mathsf{neg}\left(\left(4 \cdot a\right) \cdot c\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      9. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(\mathsf{neg}\left(\left(a \cdot 4\right) \cdot c\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      10. associate-*l*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(\mathsf{neg}\left(a \cdot \left(4 \cdot c\right)\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      11. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(a \cdot \left(\mathsf{neg}\left(4 \cdot c\right)\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      12. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(a \cdot \left(\mathsf{neg}\left(c \cdot 4\right)\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      13. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(a, \left(\mathsf{neg}\left(c \cdot 4\right)\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      14. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(a, \left(c \cdot \left(\mathsf{neg}\left(4\right)\right)\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      15. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(c, \left(\mathsf{neg}\left(4\right)\right)\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      16. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(c, -4\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      17. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(c, -4\right)\right)\right)\right), b\right), \left(a \cdot \color{blue}{2}\right)\right) \]
    3. Simplified52.1%

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

      \[\leadsto \color{blue}{-1 \cdot \left(b \cdot \left(-1 \cdot \frac{c}{{b}^{2}} + \frac{1}{a}\right)\right)} \]
    6. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto \mathsf{neg}\left(b \cdot \left(-1 \cdot \frac{c}{{b}^{2}} + \frac{1}{a}\right)\right) \]
      2. *-commutativeN/A

        \[\leadsto \mathsf{neg}\left(\left(-1 \cdot \frac{c}{{b}^{2}} + \frac{1}{a}\right) \cdot b\right) \]
      3. distribute-rgt-neg-inN/A

        \[\leadsto \left(-1 \cdot \frac{c}{{b}^{2}} + \frac{1}{a}\right) \cdot \color{blue}{\left(\mathsf{neg}\left(b\right)\right)} \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(-1 \cdot \frac{c}{{b}^{2}} + \frac{1}{a}\right), \color{blue}{\left(\mathsf{neg}\left(b\right)\right)}\right) \]
      5. +-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{1}{a} + -1 \cdot \frac{c}{{b}^{2}}\right), \left(\mathsf{neg}\left(\color{blue}{b}\right)\right)\right) \]
      6. mul-1-negN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{1}{a} + \left(\mathsf{neg}\left(\frac{c}{{b}^{2}}\right)\right)\right), \left(\mathsf{neg}\left(b\right)\right)\right) \]
      7. unsub-negN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{1}{a} - \frac{c}{{b}^{2}}\right), \left(\mathsf{neg}\left(\color{blue}{b}\right)\right)\right) \]
      8. --lowering--.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\left(\frac{1}{a}\right), \left(\frac{c}{{b}^{2}}\right)\right), \left(\mathsf{neg}\left(\color{blue}{b}\right)\right)\right) \]
      9. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, a\right), \left(\frac{c}{{b}^{2}}\right)\right), \left(\mathsf{neg}\left(b\right)\right)\right) \]
      10. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, a\right), \mathsf{/.f64}\left(c, \left({b}^{2}\right)\right)\right), \left(\mathsf{neg}\left(b\right)\right)\right) \]
      11. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, a\right), \mathsf{/.f64}\left(c, \left(b \cdot b\right)\right)\right), \left(\mathsf{neg}\left(b\right)\right)\right) \]
      12. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, a\right), \mathsf{/.f64}\left(c, \mathsf{*.f64}\left(b, b\right)\right)\right), \left(\mathsf{neg}\left(b\right)\right)\right) \]
      13. neg-sub0N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, a\right), \mathsf{/.f64}\left(c, \mathsf{*.f64}\left(b, b\right)\right)\right), \left(0 - \color{blue}{b}\right)\right) \]
      14. --lowering--.f6493.0%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, a\right), \mathsf{/.f64}\left(c, \mathsf{*.f64}\left(b, b\right)\right)\right), \mathsf{\_.f64}\left(0, \color{blue}{b}\right)\right) \]
    7. Simplified93.0%

      \[\leadsto \color{blue}{\left(\frac{1}{a} - \frac{c}{b \cdot b}\right) \cdot \left(0 - b\right)} \]
    8. Taylor expanded in a around inf

      \[\leadsto \color{blue}{-1 \cdot \frac{b}{a} + \frac{c}{b}} \]
    9. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto \frac{c}{b} + \color{blue}{-1 \cdot \frac{b}{a}} \]
      2. mul-1-negN/A

        \[\leadsto \frac{c}{b} + \left(\mathsf{neg}\left(\frac{b}{a}\right)\right) \]
      3. unsub-negN/A

        \[\leadsto \frac{c}{b} - \color{blue}{\frac{b}{a}} \]
      4. --lowering--.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\left(\frac{c}{b}\right), \color{blue}{\left(\frac{b}{a}\right)}\right) \]
      5. /-lowering-/.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(c, b\right), \left(\frac{\color{blue}{b}}{a}\right)\right) \]
      6. /-lowering-/.f6493.7%

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(c, b\right), \mathsf{/.f64}\left(b, \color{blue}{a}\right)\right) \]
    10. Simplified93.7%

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

    if -8.99999999999999981e93 < b < 1.2499999999999999e-66

    1. Initial program 83.6%

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

        \[\leadsto \mathsf{/.f64}\left(\left(\left(\mathsf{neg}\left(b\right)\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}\right), \color{blue}{\left(2 \cdot a\right)}\right) \]
      2. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c} + \left(\mathsf{neg}\left(b\right)\right)\right), \left(\color{blue}{2} \cdot a\right)\right) \]
      3. unsub-negN/A

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\left(\sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}\right), b\right), \left(\color{blue}{2} \cdot a\right)\right) \]
      5. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\left(b \cdot b - \left(4 \cdot a\right) \cdot c\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      6. sub-negN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\left(b \cdot b + \left(\mathsf{neg}\left(\left(4 \cdot a\right) \cdot c\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      7. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\left(b \cdot b\right), \left(\mathsf{neg}\left(\left(4 \cdot a\right) \cdot c\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(\mathsf{neg}\left(\left(4 \cdot a\right) \cdot c\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      9. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(\mathsf{neg}\left(\left(a \cdot 4\right) \cdot c\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      10. associate-*l*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(\mathsf{neg}\left(a \cdot \left(4 \cdot c\right)\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      11. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(a \cdot \left(\mathsf{neg}\left(4 \cdot c\right)\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      12. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(a \cdot \left(\mathsf{neg}\left(c \cdot 4\right)\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      13. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(a, \left(\mathsf{neg}\left(c \cdot 4\right)\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      14. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(a, \left(c \cdot \left(\mathsf{neg}\left(4\right)\right)\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      15. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(c, \left(\mathsf{neg}\left(4\right)\right)\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      16. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(c, -4\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      17. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(c, -4\right)\right)\right)\right), b\right), \left(a \cdot \color{blue}{2}\right)\right) \]
    3. Simplified83.6%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\frac{1}{2}, a\right), \mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\left(b \cdot b\right), \left(a \cdot \left(c \cdot -4\right)\right)\right)\right), b\right)\right) \]
      11. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\frac{1}{2}, a\right), \mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(a \cdot \left(c \cdot -4\right)\right)\right)\right), b\right)\right) \]
      12. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\frac{1}{2}, a\right), \mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(a, \left(c \cdot -4\right)\right)\right)\right), b\right)\right) \]
      13. *-lowering-*.f6483.4%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\frac{1}{2}, a\right), \mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(c, -4\right)\right)\right)\right), b\right)\right) \]
    6. Applied egg-rr83.4%

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

    if 1.2499999999999999e-66 < b

    1. Initial program 11.3%

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

        \[\leadsto \mathsf{/.f64}\left(\left(\left(\mathsf{neg}\left(b\right)\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}\right), \color{blue}{\left(2 \cdot a\right)}\right) \]
      2. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c} + \left(\mathsf{neg}\left(b\right)\right)\right), \left(\color{blue}{2} \cdot a\right)\right) \]
      3. unsub-negN/A

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\left(\sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}\right), b\right), \left(\color{blue}{2} \cdot a\right)\right) \]
      5. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\left(b \cdot b - \left(4 \cdot a\right) \cdot c\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      6. sub-negN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\left(b \cdot b + \left(\mathsf{neg}\left(\left(4 \cdot a\right) \cdot c\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      7. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\left(b \cdot b\right), \left(\mathsf{neg}\left(\left(4 \cdot a\right) \cdot c\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(\mathsf{neg}\left(\left(4 \cdot a\right) \cdot c\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      9. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(\mathsf{neg}\left(\left(a \cdot 4\right) \cdot c\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      10. associate-*l*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(\mathsf{neg}\left(a \cdot \left(4 \cdot c\right)\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      11. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(a \cdot \left(\mathsf{neg}\left(4 \cdot c\right)\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      12. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(a \cdot \left(\mathsf{neg}\left(c \cdot 4\right)\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      13. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(a, \left(\mathsf{neg}\left(c \cdot 4\right)\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      14. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(a, \left(c \cdot \left(\mathsf{neg}\left(4\right)\right)\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      15. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(c, \left(\mathsf{neg}\left(4\right)\right)\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      16. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(c, -4\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      17. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(c, -4\right)\right)\right)\right), b\right), \left(a \cdot \color{blue}{2}\right)\right) \]
    3. Simplified11.3%

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

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

        \[\leadsto \mathsf{neg}\left(\frac{c}{b}\right) \]
      2. neg-sub0N/A

        \[\leadsto 0 - \color{blue}{\frac{c}{b}} \]
      3. --lowering--.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(0, \color{blue}{\left(\frac{c}{b}\right)}\right) \]
      4. /-lowering-/.f6485.3%

        \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(c, \color{blue}{b}\right)\right) \]
    7. Simplified85.3%

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

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

Alternative 3: 81.6% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq -1.18 \cdot 10^{-49}:\\ \;\;\;\;\frac{c}{b} - \frac{b}{a}\\ \mathbf{elif}\;b \leq 4.3 \cdot 10^{-69}:\\ \;\;\;\;\frac{\sqrt{c \cdot \left(a \cdot -4\right)} - b}{a \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;0 - \frac{c}{b}\\ \end{array} \end{array} \]
(FPCore (a b c)
 :precision binary64
 (if (<= b -1.18e-49)
   (- (/ c b) (/ b a))
   (if (<= b 4.3e-69)
     (/ (- (sqrt (* c (* a -4.0))) b) (* a 2.0))
     (- 0.0 (/ c b)))))
double code(double a, double b, double c) {
	double tmp;
	if (b <= -1.18e-49) {
		tmp = (c / b) - (b / a);
	} else if (b <= 4.3e-69) {
		tmp = (sqrt((c * (a * -4.0))) - b) / (a * 2.0);
	} else {
		tmp = 0.0 - (c / b);
	}
	return tmp;
}
real(8) function code(a, b, c)
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8) :: tmp
    if (b <= (-1.18d-49)) then
        tmp = (c / b) - (b / a)
    else if (b <= 4.3d-69) then
        tmp = (sqrt((c * (a * (-4.0d0)))) - b) / (a * 2.0d0)
    else
        tmp = 0.0d0 - (c / b)
    end if
    code = tmp
end function
public static double code(double a, double b, double c) {
	double tmp;
	if (b <= -1.18e-49) {
		tmp = (c / b) - (b / a);
	} else if (b <= 4.3e-69) {
		tmp = (Math.sqrt((c * (a * -4.0))) - b) / (a * 2.0);
	} else {
		tmp = 0.0 - (c / b);
	}
	return tmp;
}
def code(a, b, c):
	tmp = 0
	if b <= -1.18e-49:
		tmp = (c / b) - (b / a)
	elif b <= 4.3e-69:
		tmp = (math.sqrt((c * (a * -4.0))) - b) / (a * 2.0)
	else:
		tmp = 0.0 - (c / b)
	return tmp
function code(a, b, c)
	tmp = 0.0
	if (b <= -1.18e-49)
		tmp = Float64(Float64(c / b) - Float64(b / a));
	elseif (b <= 4.3e-69)
		tmp = Float64(Float64(sqrt(Float64(c * Float64(a * -4.0))) - b) / Float64(a * 2.0));
	else
		tmp = Float64(0.0 - Float64(c / b));
	end
	return tmp
end
function tmp_2 = code(a, b, c)
	tmp = 0.0;
	if (b <= -1.18e-49)
		tmp = (c / b) - (b / a);
	elseif (b <= 4.3e-69)
		tmp = (sqrt((c * (a * -4.0))) - b) / (a * 2.0);
	else
		tmp = 0.0 - (c / b);
	end
	tmp_2 = tmp;
end
code[a_, b_, c_] := If[LessEqual[b, -1.18e-49], N[(N[(c / b), $MachinePrecision] - N[(b / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 4.3e-69], N[(N[(N[Sqrt[N[(c * N[(a * -4.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision] / N[(a * 2.0), $MachinePrecision]), $MachinePrecision], N[(0.0 - N[(c / b), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;b \leq -1.18 \cdot 10^{-49}:\\
\;\;\;\;\frac{c}{b} - \frac{b}{a}\\

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

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


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

    1. Initial program 66.3%

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

        \[\leadsto \mathsf{/.f64}\left(\left(\left(\mathsf{neg}\left(b\right)\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}\right), \color{blue}{\left(2 \cdot a\right)}\right) \]
      2. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c} + \left(\mathsf{neg}\left(b\right)\right)\right), \left(\color{blue}{2} \cdot a\right)\right) \]
      3. unsub-negN/A

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\left(\sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}\right), b\right), \left(\color{blue}{2} \cdot a\right)\right) \]
      5. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\left(b \cdot b - \left(4 \cdot a\right) \cdot c\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      6. sub-negN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\left(b \cdot b + \left(\mathsf{neg}\left(\left(4 \cdot a\right) \cdot c\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      7. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\left(b \cdot b\right), \left(\mathsf{neg}\left(\left(4 \cdot a\right) \cdot c\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(\mathsf{neg}\left(\left(4 \cdot a\right) \cdot c\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      9. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(\mathsf{neg}\left(\left(a \cdot 4\right) \cdot c\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      10. associate-*l*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(\mathsf{neg}\left(a \cdot \left(4 \cdot c\right)\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      11. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(a \cdot \left(\mathsf{neg}\left(4 \cdot c\right)\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      12. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(a \cdot \left(\mathsf{neg}\left(c \cdot 4\right)\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      13. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(a, \left(\mathsf{neg}\left(c \cdot 4\right)\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      14. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(a, \left(c \cdot \left(\mathsf{neg}\left(4\right)\right)\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      15. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(c, \left(\mathsf{neg}\left(4\right)\right)\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      16. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(c, -4\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      17. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(c, -4\right)\right)\right)\right), b\right), \left(a \cdot \color{blue}{2}\right)\right) \]
    3. Simplified66.3%

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

      \[\leadsto \color{blue}{-1 \cdot \left(b \cdot \left(-1 \cdot \frac{c}{{b}^{2}} + \frac{1}{a}\right)\right)} \]
    6. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto \mathsf{neg}\left(b \cdot \left(-1 \cdot \frac{c}{{b}^{2}} + \frac{1}{a}\right)\right) \]
      2. *-commutativeN/A

        \[\leadsto \mathsf{neg}\left(\left(-1 \cdot \frac{c}{{b}^{2}} + \frac{1}{a}\right) \cdot b\right) \]
      3. distribute-rgt-neg-inN/A

        \[\leadsto \left(-1 \cdot \frac{c}{{b}^{2}} + \frac{1}{a}\right) \cdot \color{blue}{\left(\mathsf{neg}\left(b\right)\right)} \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(-1 \cdot \frac{c}{{b}^{2}} + \frac{1}{a}\right), \color{blue}{\left(\mathsf{neg}\left(b\right)\right)}\right) \]
      5. +-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{1}{a} + -1 \cdot \frac{c}{{b}^{2}}\right), \left(\mathsf{neg}\left(\color{blue}{b}\right)\right)\right) \]
      6. mul-1-negN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{1}{a} + \left(\mathsf{neg}\left(\frac{c}{{b}^{2}}\right)\right)\right), \left(\mathsf{neg}\left(b\right)\right)\right) \]
      7. unsub-negN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{1}{a} - \frac{c}{{b}^{2}}\right), \left(\mathsf{neg}\left(\color{blue}{b}\right)\right)\right) \]
      8. --lowering--.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\left(\frac{1}{a}\right), \left(\frac{c}{{b}^{2}}\right)\right), \left(\mathsf{neg}\left(\color{blue}{b}\right)\right)\right) \]
      9. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, a\right), \left(\frac{c}{{b}^{2}}\right)\right), \left(\mathsf{neg}\left(b\right)\right)\right) \]
      10. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, a\right), \mathsf{/.f64}\left(c, \left({b}^{2}\right)\right)\right), \left(\mathsf{neg}\left(b\right)\right)\right) \]
      11. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, a\right), \mathsf{/.f64}\left(c, \left(b \cdot b\right)\right)\right), \left(\mathsf{neg}\left(b\right)\right)\right) \]
      12. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, a\right), \mathsf{/.f64}\left(c, \mathsf{*.f64}\left(b, b\right)\right)\right), \left(\mathsf{neg}\left(b\right)\right)\right) \]
      13. neg-sub0N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, a\right), \mathsf{/.f64}\left(c, \mathsf{*.f64}\left(b, b\right)\right)\right), \left(0 - \color{blue}{b}\right)\right) \]
      14. --lowering--.f6486.1%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, a\right), \mathsf{/.f64}\left(c, \mathsf{*.f64}\left(b, b\right)\right)\right), \mathsf{\_.f64}\left(0, \color{blue}{b}\right)\right) \]
    7. Simplified86.1%

      \[\leadsto \color{blue}{\left(\frac{1}{a} - \frac{c}{b \cdot b}\right) \cdot \left(0 - b\right)} \]
    8. Taylor expanded in a around inf

      \[\leadsto \color{blue}{-1 \cdot \frac{b}{a} + \frac{c}{b}} \]
    9. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto \frac{c}{b} + \color{blue}{-1 \cdot \frac{b}{a}} \]
      2. mul-1-negN/A

        \[\leadsto \frac{c}{b} + \left(\mathsf{neg}\left(\frac{b}{a}\right)\right) \]
      3. unsub-negN/A

        \[\leadsto \frac{c}{b} - \color{blue}{\frac{b}{a}} \]
      4. --lowering--.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\left(\frac{c}{b}\right), \color{blue}{\left(\frac{b}{a}\right)}\right) \]
      5. /-lowering-/.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(c, b\right), \left(\frac{\color{blue}{b}}{a}\right)\right) \]
      6. /-lowering-/.f6486.6%

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(c, b\right), \mathsf{/.f64}\left(b, \color{blue}{a}\right)\right) \]
    10. Simplified86.6%

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

    if -1.18e-49 < b < 4.3e-69

    1. Initial program 79.4%

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

        \[\leadsto \mathsf{/.f64}\left(\left(\left(\mathsf{neg}\left(b\right)\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}\right), \color{blue}{\left(2 \cdot a\right)}\right) \]
      2. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c} + \left(\mathsf{neg}\left(b\right)\right)\right), \left(\color{blue}{2} \cdot a\right)\right) \]
      3. unsub-negN/A

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\left(\sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}\right), b\right), \left(\color{blue}{2} \cdot a\right)\right) \]
      5. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\left(b \cdot b - \left(4 \cdot a\right) \cdot c\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      6. sub-negN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\left(b \cdot b + \left(\mathsf{neg}\left(\left(4 \cdot a\right) \cdot c\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      7. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\left(b \cdot b\right), \left(\mathsf{neg}\left(\left(4 \cdot a\right) \cdot c\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(\mathsf{neg}\left(\left(4 \cdot a\right) \cdot c\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      9. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(\mathsf{neg}\left(\left(a \cdot 4\right) \cdot c\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      10. associate-*l*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(\mathsf{neg}\left(a \cdot \left(4 \cdot c\right)\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      11. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(a \cdot \left(\mathsf{neg}\left(4 \cdot c\right)\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      12. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(a \cdot \left(\mathsf{neg}\left(c \cdot 4\right)\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      13. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(a, \left(\mathsf{neg}\left(c \cdot 4\right)\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      14. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(a, \left(c \cdot \left(\mathsf{neg}\left(4\right)\right)\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      15. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(c, \left(\mathsf{neg}\left(4\right)\right)\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      16. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(c, -4\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      17. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(c, -4\right)\right)\right)\right), b\right), \left(a \cdot \color{blue}{2}\right)\right) \]
    3. Simplified79.4%

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

      \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\color{blue}{\left(-4 \cdot \left(a \cdot c\right)\right)}\right), b\right), \mathsf{*.f64}\left(a, 2\right)\right) \]
    6. Step-by-step derivation
      1. associate-*r*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\left(\left(-4 \cdot a\right) \cdot c\right)\right), b\right), \mathsf{*.f64}\left(a, 2\right)\right) \]
      2. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\left(c \cdot \left(-4 \cdot a\right)\right)\right), b\right), \mathsf{*.f64}\left(a, 2\right)\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(c, \left(-4 \cdot a\right)\right)\right), b\right), \mathsf{*.f64}\left(a, 2\right)\right) \]
      4. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(c, \left(a \cdot -4\right)\right)\right), b\right), \mathsf{*.f64}\left(a, 2\right)\right) \]
      5. *-lowering-*.f6478.1%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(c, \mathsf{*.f64}\left(a, -4\right)\right)\right), b\right), \mathsf{*.f64}\left(a, 2\right)\right) \]
    7. Simplified78.1%

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

    if 4.3e-69 < b

    1. Initial program 11.3%

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

        \[\leadsto \mathsf{/.f64}\left(\left(\left(\mathsf{neg}\left(b\right)\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}\right), \color{blue}{\left(2 \cdot a\right)}\right) \]
      2. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c} + \left(\mathsf{neg}\left(b\right)\right)\right), \left(\color{blue}{2} \cdot a\right)\right) \]
      3. unsub-negN/A

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\left(\sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}\right), b\right), \left(\color{blue}{2} \cdot a\right)\right) \]
      5. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\left(b \cdot b - \left(4 \cdot a\right) \cdot c\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      6. sub-negN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\left(b \cdot b + \left(\mathsf{neg}\left(\left(4 \cdot a\right) \cdot c\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      7. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\left(b \cdot b\right), \left(\mathsf{neg}\left(\left(4 \cdot a\right) \cdot c\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(\mathsf{neg}\left(\left(4 \cdot a\right) \cdot c\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      9. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(\mathsf{neg}\left(\left(a \cdot 4\right) \cdot c\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      10. associate-*l*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(\mathsf{neg}\left(a \cdot \left(4 \cdot c\right)\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      11. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(a \cdot \left(\mathsf{neg}\left(4 \cdot c\right)\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      12. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(a \cdot \left(\mathsf{neg}\left(c \cdot 4\right)\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      13. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(a, \left(\mathsf{neg}\left(c \cdot 4\right)\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      14. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(a, \left(c \cdot \left(\mathsf{neg}\left(4\right)\right)\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      15. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(c, \left(\mathsf{neg}\left(4\right)\right)\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      16. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(c, -4\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      17. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(c, -4\right)\right)\right)\right), b\right), \left(a \cdot \color{blue}{2}\right)\right) \]
    3. Simplified11.3%

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

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

        \[\leadsto \mathsf{neg}\left(\frac{c}{b}\right) \]
      2. neg-sub0N/A

        \[\leadsto 0 - \color{blue}{\frac{c}{b}} \]
      3. --lowering--.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(0, \color{blue}{\left(\frac{c}{b}\right)}\right) \]
      4. /-lowering-/.f6485.3%

        \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(c, \color{blue}{b}\right)\right) \]
    7. Simplified85.3%

      \[\leadsto \color{blue}{0 - \frac{c}{b}} \]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 4: 81.5% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq -1.48 \cdot 10^{-61}:\\ \;\;\;\;\frac{c}{b} - \frac{b}{a}\\ \mathbf{elif}\;b \leq 3.7 \cdot 10^{-66}:\\ \;\;\;\;\frac{0.5}{a} \cdot \left(\sqrt{a \cdot \left(c \cdot -4\right)} - b\right)\\ \mathbf{else}:\\ \;\;\;\;0 - \frac{c}{b}\\ \end{array} \end{array} \]
(FPCore (a b c)
 :precision binary64
 (if (<= b -1.48e-61)
   (- (/ c b) (/ b a))
   (if (<= b 3.7e-66)
     (* (/ 0.5 a) (- (sqrt (* a (* c -4.0))) b))
     (- 0.0 (/ c b)))))
double code(double a, double b, double c) {
	double tmp;
	if (b <= -1.48e-61) {
		tmp = (c / b) - (b / a);
	} else if (b <= 3.7e-66) {
		tmp = (0.5 / a) * (sqrt((a * (c * -4.0))) - b);
	} else {
		tmp = 0.0 - (c / b);
	}
	return tmp;
}
real(8) function code(a, b, c)
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8) :: tmp
    if (b <= (-1.48d-61)) then
        tmp = (c / b) - (b / a)
    else if (b <= 3.7d-66) then
        tmp = (0.5d0 / a) * (sqrt((a * (c * (-4.0d0)))) - b)
    else
        tmp = 0.0d0 - (c / b)
    end if
    code = tmp
end function
public static double code(double a, double b, double c) {
	double tmp;
	if (b <= -1.48e-61) {
		tmp = (c / b) - (b / a);
	} else if (b <= 3.7e-66) {
		tmp = (0.5 / a) * (Math.sqrt((a * (c * -4.0))) - b);
	} else {
		tmp = 0.0 - (c / b);
	}
	return tmp;
}
def code(a, b, c):
	tmp = 0
	if b <= -1.48e-61:
		tmp = (c / b) - (b / a)
	elif b <= 3.7e-66:
		tmp = (0.5 / a) * (math.sqrt((a * (c * -4.0))) - b)
	else:
		tmp = 0.0 - (c / b)
	return tmp
function code(a, b, c)
	tmp = 0.0
	if (b <= -1.48e-61)
		tmp = Float64(Float64(c / b) - Float64(b / a));
	elseif (b <= 3.7e-66)
		tmp = Float64(Float64(0.5 / a) * Float64(sqrt(Float64(a * Float64(c * -4.0))) - b));
	else
		tmp = Float64(0.0 - Float64(c / b));
	end
	return tmp
end
function tmp_2 = code(a, b, c)
	tmp = 0.0;
	if (b <= -1.48e-61)
		tmp = (c / b) - (b / a);
	elseif (b <= 3.7e-66)
		tmp = (0.5 / a) * (sqrt((a * (c * -4.0))) - b);
	else
		tmp = 0.0 - (c / b);
	end
	tmp_2 = tmp;
end
code[a_, b_, c_] := If[LessEqual[b, -1.48e-61], N[(N[(c / b), $MachinePrecision] - N[(b / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 3.7e-66], N[(N[(0.5 / a), $MachinePrecision] * N[(N[Sqrt[N[(a * N[(c * -4.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision]), $MachinePrecision], N[(0.0 - N[(c / b), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;b \leq -1.48 \cdot 10^{-61}:\\
\;\;\;\;\frac{c}{b} - \frac{b}{a}\\

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

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


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

    1. Initial program 66.3%

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

        \[\leadsto \mathsf{/.f64}\left(\left(\left(\mathsf{neg}\left(b\right)\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}\right), \color{blue}{\left(2 \cdot a\right)}\right) \]
      2. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c} + \left(\mathsf{neg}\left(b\right)\right)\right), \left(\color{blue}{2} \cdot a\right)\right) \]
      3. unsub-negN/A

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\left(\sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}\right), b\right), \left(\color{blue}{2} \cdot a\right)\right) \]
      5. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\left(b \cdot b - \left(4 \cdot a\right) \cdot c\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      6. sub-negN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\left(b \cdot b + \left(\mathsf{neg}\left(\left(4 \cdot a\right) \cdot c\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      7. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\left(b \cdot b\right), \left(\mathsf{neg}\left(\left(4 \cdot a\right) \cdot c\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(\mathsf{neg}\left(\left(4 \cdot a\right) \cdot c\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      9. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(\mathsf{neg}\left(\left(a \cdot 4\right) \cdot c\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      10. associate-*l*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(\mathsf{neg}\left(a \cdot \left(4 \cdot c\right)\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      11. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(a \cdot \left(\mathsf{neg}\left(4 \cdot c\right)\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      12. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(a \cdot \left(\mathsf{neg}\left(c \cdot 4\right)\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      13. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(a, \left(\mathsf{neg}\left(c \cdot 4\right)\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      14. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(a, \left(c \cdot \left(\mathsf{neg}\left(4\right)\right)\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      15. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(c, \left(\mathsf{neg}\left(4\right)\right)\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      16. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(c, -4\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      17. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(c, -4\right)\right)\right)\right), b\right), \left(a \cdot \color{blue}{2}\right)\right) \]
    3. Simplified66.3%

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

      \[\leadsto \color{blue}{-1 \cdot \left(b \cdot \left(-1 \cdot \frac{c}{{b}^{2}} + \frac{1}{a}\right)\right)} \]
    6. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto \mathsf{neg}\left(b \cdot \left(-1 \cdot \frac{c}{{b}^{2}} + \frac{1}{a}\right)\right) \]
      2. *-commutativeN/A

        \[\leadsto \mathsf{neg}\left(\left(-1 \cdot \frac{c}{{b}^{2}} + \frac{1}{a}\right) \cdot b\right) \]
      3. distribute-rgt-neg-inN/A

        \[\leadsto \left(-1 \cdot \frac{c}{{b}^{2}} + \frac{1}{a}\right) \cdot \color{blue}{\left(\mathsf{neg}\left(b\right)\right)} \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(-1 \cdot \frac{c}{{b}^{2}} + \frac{1}{a}\right), \color{blue}{\left(\mathsf{neg}\left(b\right)\right)}\right) \]
      5. +-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{1}{a} + -1 \cdot \frac{c}{{b}^{2}}\right), \left(\mathsf{neg}\left(\color{blue}{b}\right)\right)\right) \]
      6. mul-1-negN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{1}{a} + \left(\mathsf{neg}\left(\frac{c}{{b}^{2}}\right)\right)\right), \left(\mathsf{neg}\left(b\right)\right)\right) \]
      7. unsub-negN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{1}{a} - \frac{c}{{b}^{2}}\right), \left(\mathsf{neg}\left(\color{blue}{b}\right)\right)\right) \]
      8. --lowering--.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\left(\frac{1}{a}\right), \left(\frac{c}{{b}^{2}}\right)\right), \left(\mathsf{neg}\left(\color{blue}{b}\right)\right)\right) \]
      9. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, a\right), \left(\frac{c}{{b}^{2}}\right)\right), \left(\mathsf{neg}\left(b\right)\right)\right) \]
      10. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, a\right), \mathsf{/.f64}\left(c, \left({b}^{2}\right)\right)\right), \left(\mathsf{neg}\left(b\right)\right)\right) \]
      11. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, a\right), \mathsf{/.f64}\left(c, \left(b \cdot b\right)\right)\right), \left(\mathsf{neg}\left(b\right)\right)\right) \]
      12. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, a\right), \mathsf{/.f64}\left(c, \mathsf{*.f64}\left(b, b\right)\right)\right), \left(\mathsf{neg}\left(b\right)\right)\right) \]
      13. neg-sub0N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, a\right), \mathsf{/.f64}\left(c, \mathsf{*.f64}\left(b, b\right)\right)\right), \left(0 - \color{blue}{b}\right)\right) \]
      14. --lowering--.f6486.1%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, a\right), \mathsf{/.f64}\left(c, \mathsf{*.f64}\left(b, b\right)\right)\right), \mathsf{\_.f64}\left(0, \color{blue}{b}\right)\right) \]
    7. Simplified86.1%

      \[\leadsto \color{blue}{\left(\frac{1}{a} - \frac{c}{b \cdot b}\right) \cdot \left(0 - b\right)} \]
    8. Taylor expanded in a around inf

      \[\leadsto \color{blue}{-1 \cdot \frac{b}{a} + \frac{c}{b}} \]
    9. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto \frac{c}{b} + \color{blue}{-1 \cdot \frac{b}{a}} \]
      2. mul-1-negN/A

        \[\leadsto \frac{c}{b} + \left(\mathsf{neg}\left(\frac{b}{a}\right)\right) \]
      3. unsub-negN/A

        \[\leadsto \frac{c}{b} - \color{blue}{\frac{b}{a}} \]
      4. --lowering--.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\left(\frac{c}{b}\right), \color{blue}{\left(\frac{b}{a}\right)}\right) \]
      5. /-lowering-/.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(c, b\right), \left(\frac{\color{blue}{b}}{a}\right)\right) \]
      6. /-lowering-/.f6486.6%

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(c, b\right), \mathsf{/.f64}\left(b, \color{blue}{a}\right)\right) \]
    10. Simplified86.6%

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

    if -1.4799999999999999e-61 < b < 3.7000000000000002e-66

    1. Initial program 79.4%

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

        \[\leadsto \mathsf{/.f64}\left(\left(\left(\mathsf{neg}\left(b\right)\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}\right), \color{blue}{\left(2 \cdot a\right)}\right) \]
      2. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c} + \left(\mathsf{neg}\left(b\right)\right)\right), \left(\color{blue}{2} \cdot a\right)\right) \]
      3. unsub-negN/A

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\left(\sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}\right), b\right), \left(\color{blue}{2} \cdot a\right)\right) \]
      5. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\left(b \cdot b - \left(4 \cdot a\right) \cdot c\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      6. sub-negN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\left(b \cdot b + \left(\mathsf{neg}\left(\left(4 \cdot a\right) \cdot c\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      7. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\left(b \cdot b\right), \left(\mathsf{neg}\left(\left(4 \cdot a\right) \cdot c\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(\mathsf{neg}\left(\left(4 \cdot a\right) \cdot c\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      9. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(\mathsf{neg}\left(\left(a \cdot 4\right) \cdot c\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      10. associate-*l*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(\mathsf{neg}\left(a \cdot \left(4 \cdot c\right)\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      11. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(a \cdot \left(\mathsf{neg}\left(4 \cdot c\right)\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      12. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(a \cdot \left(\mathsf{neg}\left(c \cdot 4\right)\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      13. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(a, \left(\mathsf{neg}\left(c \cdot 4\right)\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      14. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(a, \left(c \cdot \left(\mathsf{neg}\left(4\right)\right)\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      15. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(c, \left(\mathsf{neg}\left(4\right)\right)\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      16. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(c, -4\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      17. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(c, -4\right)\right)\right)\right), b\right), \left(a \cdot \color{blue}{2}\right)\right) \]
    3. Simplified79.4%

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

      \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\color{blue}{\left(-4 \cdot \left(a \cdot c\right)\right)}\right), b\right), \mathsf{*.f64}\left(a, 2\right)\right) \]
    6. Step-by-step derivation
      1. associate-*r*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\left(\left(-4 \cdot a\right) \cdot c\right)\right), b\right), \mathsf{*.f64}\left(a, 2\right)\right) \]
      2. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\left(c \cdot \left(-4 \cdot a\right)\right)\right), b\right), \mathsf{*.f64}\left(a, 2\right)\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(c, \left(-4 \cdot a\right)\right)\right), b\right), \mathsf{*.f64}\left(a, 2\right)\right) \]
      4. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(c, \left(a \cdot -4\right)\right)\right), b\right), \mathsf{*.f64}\left(a, 2\right)\right) \]
      5. *-lowering-*.f6478.1%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(c, \mathsf{*.f64}\left(a, -4\right)\right)\right), b\right), \mathsf{*.f64}\left(a, 2\right)\right) \]
    7. Simplified78.1%

      \[\leadsto \frac{\sqrt{\color{blue}{c \cdot \left(a \cdot -4\right)}} - b}{a \cdot 2} \]
    8. Step-by-step derivation
      1. clear-numN/A

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

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

        \[\leadsto \frac{1}{2 \cdot a} \cdot \left(\sqrt{c \cdot \left(a \cdot -4\right)} - b\right) \]
      4. associate-/r*N/A

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\frac{1}{2}, a\right), \mathsf{\_.f64}\left(\left(\sqrt{c \cdot \left(-4 \cdot a\right)}\right), b\right)\right) \]
      10. associate-*r*N/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\frac{1}{2}, a\right), \mathsf{\_.f64}\left(\left(\sqrt{a \cdot \left(c \cdot -4\right)}\right), b\right)\right) \]
      12. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\frac{1}{2}, a\right), \mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\left(a \cdot \left(c \cdot -4\right)\right)\right), b\right)\right) \]
      13. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\frac{1}{2}, a\right), \mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(a, \left(c \cdot -4\right)\right)\right), b\right)\right) \]
      14. *-lowering-*.f6478.0%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\frac{1}{2}, a\right), \mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(c, -4\right)\right)\right), b\right)\right) \]
    9. Applied egg-rr78.0%

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

    if 3.7000000000000002e-66 < b

    1. Initial program 11.3%

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

        \[\leadsto \mathsf{/.f64}\left(\left(\left(\mathsf{neg}\left(b\right)\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}\right), \color{blue}{\left(2 \cdot a\right)}\right) \]
      2. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c} + \left(\mathsf{neg}\left(b\right)\right)\right), \left(\color{blue}{2} \cdot a\right)\right) \]
      3. unsub-negN/A

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\left(\sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}\right), b\right), \left(\color{blue}{2} \cdot a\right)\right) \]
      5. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\left(b \cdot b - \left(4 \cdot a\right) \cdot c\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      6. sub-negN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\left(b \cdot b + \left(\mathsf{neg}\left(\left(4 \cdot a\right) \cdot c\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      7. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\left(b \cdot b\right), \left(\mathsf{neg}\left(\left(4 \cdot a\right) \cdot c\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(\mathsf{neg}\left(\left(4 \cdot a\right) \cdot c\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      9. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(\mathsf{neg}\left(\left(a \cdot 4\right) \cdot c\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      10. associate-*l*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(\mathsf{neg}\left(a \cdot \left(4 \cdot c\right)\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      11. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(a \cdot \left(\mathsf{neg}\left(4 \cdot c\right)\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      12. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(a \cdot \left(\mathsf{neg}\left(c \cdot 4\right)\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      13. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(a, \left(\mathsf{neg}\left(c \cdot 4\right)\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      14. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(a, \left(c \cdot \left(\mathsf{neg}\left(4\right)\right)\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      15. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(c, \left(\mathsf{neg}\left(4\right)\right)\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      16. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(c, -4\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      17. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(c, -4\right)\right)\right)\right), b\right), \left(a \cdot \color{blue}{2}\right)\right) \]
    3. Simplified11.3%

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

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

        \[\leadsto \mathsf{neg}\left(\frac{c}{b}\right) \]
      2. neg-sub0N/A

        \[\leadsto 0 - \color{blue}{\frac{c}{b}} \]
      3. --lowering--.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(0, \color{blue}{\left(\frac{c}{b}\right)}\right) \]
      4. /-lowering-/.f6485.3%

        \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(c, \color{blue}{b}\right)\right) \]
    7. Simplified85.3%

      \[\leadsto \color{blue}{0 - \frac{c}{b}} \]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 5: 68.3% accurate, 9.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq -5 \cdot 10^{-310}:\\ \;\;\;\;\frac{c}{b} - \frac{b}{a}\\ \mathbf{else}:\\ \;\;\;\;0 - \frac{c}{b}\\ \end{array} \end{array} \]
(FPCore (a b c)
 :precision binary64
 (if (<= b -5e-310) (- (/ c b) (/ b a)) (- 0.0 (/ c b))))
double code(double a, double b, double c) {
	double tmp;
	if (b <= -5e-310) {
		tmp = (c / b) - (b / a);
	} else {
		tmp = 0.0 - (c / b);
	}
	return tmp;
}
real(8) function code(a, b, c)
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8) :: tmp
    if (b <= (-5d-310)) then
        tmp = (c / b) - (b / a)
    else
        tmp = 0.0d0 - (c / b)
    end if
    code = tmp
end function
public static double code(double a, double b, double c) {
	double tmp;
	if (b <= -5e-310) {
		tmp = (c / b) - (b / a);
	} else {
		tmp = 0.0 - (c / b);
	}
	return tmp;
}
def code(a, b, c):
	tmp = 0
	if b <= -5e-310:
		tmp = (c / b) - (b / a)
	else:
		tmp = 0.0 - (c / b)
	return tmp
function code(a, b, c)
	tmp = 0.0
	if (b <= -5e-310)
		tmp = Float64(Float64(c / b) - Float64(b / a));
	else
		tmp = Float64(0.0 - Float64(c / b));
	end
	return tmp
end
function tmp_2 = code(a, b, c)
	tmp = 0.0;
	if (b <= -5e-310)
		tmp = (c / b) - (b / a);
	else
		tmp = 0.0 - (c / b);
	end
	tmp_2 = tmp;
end
code[a_, b_, c_] := If[LessEqual[b, -5e-310], N[(N[(c / b), $MachinePrecision] - N[(b / a), $MachinePrecision]), $MachinePrecision], N[(0.0 - N[(c / b), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

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

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


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

    1. Initial program 71.5%

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

        \[\leadsto \mathsf{/.f64}\left(\left(\left(\mathsf{neg}\left(b\right)\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}\right), \color{blue}{\left(2 \cdot a\right)}\right) \]
      2. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c} + \left(\mathsf{neg}\left(b\right)\right)\right), \left(\color{blue}{2} \cdot a\right)\right) \]
      3. unsub-negN/A

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\left(\sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}\right), b\right), \left(\color{blue}{2} \cdot a\right)\right) \]
      5. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\left(b \cdot b - \left(4 \cdot a\right) \cdot c\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      6. sub-negN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\left(b \cdot b + \left(\mathsf{neg}\left(\left(4 \cdot a\right) \cdot c\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      7. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\left(b \cdot b\right), \left(\mathsf{neg}\left(\left(4 \cdot a\right) \cdot c\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(\mathsf{neg}\left(\left(4 \cdot a\right) \cdot c\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      9. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(\mathsf{neg}\left(\left(a \cdot 4\right) \cdot c\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      10. associate-*l*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(\mathsf{neg}\left(a \cdot \left(4 \cdot c\right)\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      11. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(a \cdot \left(\mathsf{neg}\left(4 \cdot c\right)\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      12. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(a \cdot \left(\mathsf{neg}\left(c \cdot 4\right)\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      13. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(a, \left(\mathsf{neg}\left(c \cdot 4\right)\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      14. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(a, \left(c \cdot \left(\mathsf{neg}\left(4\right)\right)\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      15. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(c, \left(\mathsf{neg}\left(4\right)\right)\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      16. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(c, -4\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      17. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(c, -4\right)\right)\right)\right), b\right), \left(a \cdot \color{blue}{2}\right)\right) \]
    3. Simplified71.5%

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

      \[\leadsto \color{blue}{-1 \cdot \left(b \cdot \left(-1 \cdot \frac{c}{{b}^{2}} + \frac{1}{a}\right)\right)} \]
    6. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto \mathsf{neg}\left(b \cdot \left(-1 \cdot \frac{c}{{b}^{2}} + \frac{1}{a}\right)\right) \]
      2. *-commutativeN/A

        \[\leadsto \mathsf{neg}\left(\left(-1 \cdot \frac{c}{{b}^{2}} + \frac{1}{a}\right) \cdot b\right) \]
      3. distribute-rgt-neg-inN/A

        \[\leadsto \left(-1 \cdot \frac{c}{{b}^{2}} + \frac{1}{a}\right) \cdot \color{blue}{\left(\mathsf{neg}\left(b\right)\right)} \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(-1 \cdot \frac{c}{{b}^{2}} + \frac{1}{a}\right), \color{blue}{\left(\mathsf{neg}\left(b\right)\right)}\right) \]
      5. +-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{1}{a} + -1 \cdot \frac{c}{{b}^{2}}\right), \left(\mathsf{neg}\left(\color{blue}{b}\right)\right)\right) \]
      6. mul-1-negN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{1}{a} + \left(\mathsf{neg}\left(\frac{c}{{b}^{2}}\right)\right)\right), \left(\mathsf{neg}\left(b\right)\right)\right) \]
      7. unsub-negN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{1}{a} - \frac{c}{{b}^{2}}\right), \left(\mathsf{neg}\left(\color{blue}{b}\right)\right)\right) \]
      8. --lowering--.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\left(\frac{1}{a}\right), \left(\frac{c}{{b}^{2}}\right)\right), \left(\mathsf{neg}\left(\color{blue}{b}\right)\right)\right) \]
      9. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, a\right), \left(\frac{c}{{b}^{2}}\right)\right), \left(\mathsf{neg}\left(b\right)\right)\right) \]
      10. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, a\right), \mathsf{/.f64}\left(c, \left({b}^{2}\right)\right)\right), \left(\mathsf{neg}\left(b\right)\right)\right) \]
      11. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, a\right), \mathsf{/.f64}\left(c, \left(b \cdot b\right)\right)\right), \left(\mathsf{neg}\left(b\right)\right)\right) \]
      12. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, a\right), \mathsf{/.f64}\left(c, \mathsf{*.f64}\left(b, b\right)\right)\right), \left(\mathsf{neg}\left(b\right)\right)\right) \]
      13. neg-sub0N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, a\right), \mathsf{/.f64}\left(c, \mathsf{*.f64}\left(b, b\right)\right)\right), \left(0 - \color{blue}{b}\right)\right) \]
      14. --lowering--.f6462.5%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, a\right), \mathsf{/.f64}\left(c, \mathsf{*.f64}\left(b, b\right)\right)\right), \mathsf{\_.f64}\left(0, \color{blue}{b}\right)\right) \]
    7. Simplified62.5%

      \[\leadsto \color{blue}{\left(\frac{1}{a} - \frac{c}{b \cdot b}\right) \cdot \left(0 - b\right)} \]
    8. Taylor expanded in a around inf

      \[\leadsto \color{blue}{-1 \cdot \frac{b}{a} + \frac{c}{b}} \]
    9. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto \frac{c}{b} + \color{blue}{-1 \cdot \frac{b}{a}} \]
      2. mul-1-negN/A

        \[\leadsto \frac{c}{b} + \left(\mathsf{neg}\left(\frac{b}{a}\right)\right) \]
      3. unsub-negN/A

        \[\leadsto \frac{c}{b} - \color{blue}{\frac{b}{a}} \]
      4. --lowering--.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\left(\frac{c}{b}\right), \color{blue}{\left(\frac{b}{a}\right)}\right) \]
      5. /-lowering-/.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(c, b\right), \left(\frac{\color{blue}{b}}{a}\right)\right) \]
      6. /-lowering-/.f6464.7%

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(c, b\right), \mathsf{/.f64}\left(b, \color{blue}{a}\right)\right) \]
    10. Simplified64.7%

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

    if -4.999999999999985e-310 < b

    1. Initial program 23.7%

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

        \[\leadsto \mathsf{/.f64}\left(\left(\left(\mathsf{neg}\left(b\right)\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}\right), \color{blue}{\left(2 \cdot a\right)}\right) \]
      2. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c} + \left(\mathsf{neg}\left(b\right)\right)\right), \left(\color{blue}{2} \cdot a\right)\right) \]
      3. unsub-negN/A

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\left(\sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}\right), b\right), \left(\color{blue}{2} \cdot a\right)\right) \]
      5. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\left(b \cdot b - \left(4 \cdot a\right) \cdot c\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      6. sub-negN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\left(b \cdot b + \left(\mathsf{neg}\left(\left(4 \cdot a\right) \cdot c\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      7. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\left(b \cdot b\right), \left(\mathsf{neg}\left(\left(4 \cdot a\right) \cdot c\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(\mathsf{neg}\left(\left(4 \cdot a\right) \cdot c\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      9. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(\mathsf{neg}\left(\left(a \cdot 4\right) \cdot c\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      10. associate-*l*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(\mathsf{neg}\left(a \cdot \left(4 \cdot c\right)\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      11. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(a \cdot \left(\mathsf{neg}\left(4 \cdot c\right)\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      12. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(a \cdot \left(\mathsf{neg}\left(c \cdot 4\right)\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      13. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(a, \left(\mathsf{neg}\left(c \cdot 4\right)\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      14. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(a, \left(c \cdot \left(\mathsf{neg}\left(4\right)\right)\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      15. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(c, \left(\mathsf{neg}\left(4\right)\right)\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      16. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(c, -4\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      17. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(c, -4\right)\right)\right)\right), b\right), \left(a \cdot \color{blue}{2}\right)\right) \]
    3. Simplified23.7%

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

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

        \[\leadsto \mathsf{neg}\left(\frac{c}{b}\right) \]
      2. neg-sub0N/A

        \[\leadsto 0 - \color{blue}{\frac{c}{b}} \]
      3. --lowering--.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(0, \color{blue}{\left(\frac{c}{b}\right)}\right) \]
      4. /-lowering-/.f6471.2%

        \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(c, \color{blue}{b}\right)\right) \]
    7. Simplified71.2%

      \[\leadsto \color{blue}{0 - \frac{c}{b}} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 6: 68.1% accurate, 11.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq 2.35 \cdot 10^{-300}:\\ \;\;\;\;\frac{b}{0 - a}\\ \mathbf{else}:\\ \;\;\;\;0 - \frac{c}{b}\\ \end{array} \end{array} \]
(FPCore (a b c)
 :precision binary64
 (if (<= b 2.35e-300) (/ b (- 0.0 a)) (- 0.0 (/ c b))))
double code(double a, double b, double c) {
	double tmp;
	if (b <= 2.35e-300) {
		tmp = b / (0.0 - a);
	} else {
		tmp = 0.0 - (c / b);
	}
	return tmp;
}
real(8) function code(a, b, c)
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8) :: tmp
    if (b <= 2.35d-300) then
        tmp = b / (0.0d0 - a)
    else
        tmp = 0.0d0 - (c / b)
    end if
    code = tmp
end function
public static double code(double a, double b, double c) {
	double tmp;
	if (b <= 2.35e-300) {
		tmp = b / (0.0 - a);
	} else {
		tmp = 0.0 - (c / b);
	}
	return tmp;
}
def code(a, b, c):
	tmp = 0
	if b <= 2.35e-300:
		tmp = b / (0.0 - a)
	else:
		tmp = 0.0 - (c / b)
	return tmp
function code(a, b, c)
	tmp = 0.0
	if (b <= 2.35e-300)
		tmp = Float64(b / Float64(0.0 - a));
	else
		tmp = Float64(0.0 - Float64(c / b));
	end
	return tmp
end
function tmp_2 = code(a, b, c)
	tmp = 0.0;
	if (b <= 2.35e-300)
		tmp = b / (0.0 - a);
	else
		tmp = 0.0 - (c / b);
	end
	tmp_2 = tmp;
end
code[a_, b_, c_] := If[LessEqual[b, 2.35e-300], N[(b / N[(0.0 - a), $MachinePrecision]), $MachinePrecision], N[(0.0 - N[(c / b), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;b \leq 2.35 \cdot 10^{-300}:\\
\;\;\;\;\frac{b}{0 - a}\\

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


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

    1. Initial program 71.7%

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

        \[\leadsto \mathsf{/.f64}\left(\left(\left(\mathsf{neg}\left(b\right)\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}\right), \color{blue}{\left(2 \cdot a\right)}\right) \]
      2. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c} + \left(\mathsf{neg}\left(b\right)\right)\right), \left(\color{blue}{2} \cdot a\right)\right) \]
      3. unsub-negN/A

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\left(\sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}\right), b\right), \left(\color{blue}{2} \cdot a\right)\right) \]
      5. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\left(b \cdot b - \left(4 \cdot a\right) \cdot c\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      6. sub-negN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\left(b \cdot b + \left(\mathsf{neg}\left(\left(4 \cdot a\right) \cdot c\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      7. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\left(b \cdot b\right), \left(\mathsf{neg}\left(\left(4 \cdot a\right) \cdot c\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(\mathsf{neg}\left(\left(4 \cdot a\right) \cdot c\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      9. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(\mathsf{neg}\left(\left(a \cdot 4\right) \cdot c\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      10. associate-*l*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(\mathsf{neg}\left(a \cdot \left(4 \cdot c\right)\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      11. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(a \cdot \left(\mathsf{neg}\left(4 \cdot c\right)\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      12. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(a \cdot \left(\mathsf{neg}\left(c \cdot 4\right)\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      13. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(a, \left(\mathsf{neg}\left(c \cdot 4\right)\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      14. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(a, \left(c \cdot \left(\mathsf{neg}\left(4\right)\right)\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      15. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(c, \left(\mathsf{neg}\left(4\right)\right)\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      16. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(c, -4\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      17. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(c, -4\right)\right)\right)\right), b\right), \left(a \cdot \color{blue}{2}\right)\right) \]
    3. Simplified71.7%

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

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

        \[\leadsto \mathsf{neg}\left(\frac{b}{a}\right) \]
      2. neg-sub0N/A

        \[\leadsto 0 - \color{blue}{\frac{b}{a}} \]
      3. --lowering--.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(0, \color{blue}{\left(\frac{b}{a}\right)}\right) \]
      4. /-lowering-/.f6463.8%

        \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(b, \color{blue}{a}\right)\right) \]
    7. Simplified63.8%

      \[\leadsto \color{blue}{0 - \frac{b}{a}} \]
    8. Step-by-step derivation
      1. sub0-negN/A

        \[\leadsto \mathsf{neg}\left(\frac{b}{a}\right) \]
      2. neg-lowering-neg.f64N/A

        \[\leadsto \mathsf{neg.f64}\left(\left(\frac{b}{a}\right)\right) \]
      3. /-lowering-/.f6463.8%

        \[\leadsto \mathsf{neg.f64}\left(\mathsf{/.f64}\left(b, a\right)\right) \]
    9. Applied egg-rr63.8%

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

    if 2.35e-300 < b

    1. Initial program 23.1%

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

        \[\leadsto \mathsf{/.f64}\left(\left(\left(\mathsf{neg}\left(b\right)\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}\right), \color{blue}{\left(2 \cdot a\right)}\right) \]
      2. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c} + \left(\mathsf{neg}\left(b\right)\right)\right), \left(\color{blue}{2} \cdot a\right)\right) \]
      3. unsub-negN/A

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\left(\sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}\right), b\right), \left(\color{blue}{2} \cdot a\right)\right) \]
      5. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\left(b \cdot b - \left(4 \cdot a\right) \cdot c\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      6. sub-negN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\left(b \cdot b + \left(\mathsf{neg}\left(\left(4 \cdot a\right) \cdot c\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      7. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\left(b \cdot b\right), \left(\mathsf{neg}\left(\left(4 \cdot a\right) \cdot c\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(\mathsf{neg}\left(\left(4 \cdot a\right) \cdot c\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      9. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(\mathsf{neg}\left(\left(a \cdot 4\right) \cdot c\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      10. associate-*l*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(\mathsf{neg}\left(a \cdot \left(4 \cdot c\right)\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      11. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(a \cdot \left(\mathsf{neg}\left(4 \cdot c\right)\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      12. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(a \cdot \left(\mathsf{neg}\left(c \cdot 4\right)\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      13. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(a, \left(\mathsf{neg}\left(c \cdot 4\right)\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      14. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(a, \left(c \cdot \left(\mathsf{neg}\left(4\right)\right)\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      15. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(c, \left(\mathsf{neg}\left(4\right)\right)\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      16. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(c, -4\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      17. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(c, -4\right)\right)\right)\right), b\right), \left(a \cdot \color{blue}{2}\right)\right) \]
    3. Simplified23.1%

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

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

        \[\leadsto \mathsf{neg}\left(\frac{c}{b}\right) \]
      2. neg-sub0N/A

        \[\leadsto 0 - \color{blue}{\frac{c}{b}} \]
      3. --lowering--.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(0, \color{blue}{\left(\frac{c}{b}\right)}\right) \]
      4. /-lowering-/.f6471.8%

        \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(c, \color{blue}{b}\right)\right) \]
    7. Simplified71.8%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq 2.35 \cdot 10^{-300}:\\ \;\;\;\;\frac{b}{0 - a}\\ \mathbf{else}:\\ \;\;\;\;0 - \frac{c}{b}\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 43.2% accurate, 11.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq -1.9 \cdot 10^{-305}:\\
\;\;\;\;\frac{b}{0 - a}\\

\mathbf{else}:\\
\;\;\;\;0\\


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

    1. Initial program 71.2%

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

        \[\leadsto \mathsf{/.f64}\left(\left(\left(\mathsf{neg}\left(b\right)\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}\right), \color{blue}{\left(2 \cdot a\right)}\right) \]
      2. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c} + \left(\mathsf{neg}\left(b\right)\right)\right), \left(\color{blue}{2} \cdot a\right)\right) \]
      3. unsub-negN/A

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\left(\sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}\right), b\right), \left(\color{blue}{2} \cdot a\right)\right) \]
      5. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\left(b \cdot b - \left(4 \cdot a\right) \cdot c\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      6. sub-negN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\left(b \cdot b + \left(\mathsf{neg}\left(\left(4 \cdot a\right) \cdot c\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      7. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\left(b \cdot b\right), \left(\mathsf{neg}\left(\left(4 \cdot a\right) \cdot c\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(\mathsf{neg}\left(\left(4 \cdot a\right) \cdot c\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      9. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(\mathsf{neg}\left(\left(a \cdot 4\right) \cdot c\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      10. associate-*l*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(\mathsf{neg}\left(a \cdot \left(4 \cdot c\right)\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      11. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(a \cdot \left(\mathsf{neg}\left(4 \cdot c\right)\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      12. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(a \cdot \left(\mathsf{neg}\left(c \cdot 4\right)\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      13. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(a, \left(\mathsf{neg}\left(c \cdot 4\right)\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      14. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(a, \left(c \cdot \left(\mathsf{neg}\left(4\right)\right)\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      15. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(c, \left(\mathsf{neg}\left(4\right)\right)\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      16. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(c, -4\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      17. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(c, -4\right)\right)\right)\right), b\right), \left(a \cdot \color{blue}{2}\right)\right) \]
    3. Simplified71.2%

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

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

        \[\leadsto \mathsf{neg}\left(\frac{b}{a}\right) \]
      2. neg-sub0N/A

        \[\leadsto 0 - \color{blue}{\frac{b}{a}} \]
      3. --lowering--.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(0, \color{blue}{\left(\frac{b}{a}\right)}\right) \]
      4. /-lowering-/.f6464.7%

        \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(b, \color{blue}{a}\right)\right) \]
    7. Simplified64.7%

      \[\leadsto \color{blue}{0 - \frac{b}{a}} \]
    8. Step-by-step derivation
      1. sub0-negN/A

        \[\leadsto \mathsf{neg}\left(\frac{b}{a}\right) \]
      2. neg-lowering-neg.f64N/A

        \[\leadsto \mathsf{neg.f64}\left(\left(\frac{b}{a}\right)\right) \]
      3. /-lowering-/.f6464.7%

        \[\leadsto \mathsf{neg.f64}\left(\mathsf{/.f64}\left(b, a\right)\right) \]
    9. Applied egg-rr64.7%

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

    if -1.9e-305 < b

    1. Initial program 24.3%

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

        \[\leadsto \mathsf{/.f64}\left(\left(\left(\mathsf{neg}\left(b\right)\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}\right), \color{blue}{\left(2 \cdot a\right)}\right) \]
      2. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c} + \left(\mathsf{neg}\left(b\right)\right)\right), \left(\color{blue}{2} \cdot a\right)\right) \]
      3. unsub-negN/A

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\left(\sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}\right), b\right), \left(\color{blue}{2} \cdot a\right)\right) \]
      5. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\left(b \cdot b - \left(4 \cdot a\right) \cdot c\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      6. sub-negN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\left(b \cdot b + \left(\mathsf{neg}\left(\left(4 \cdot a\right) \cdot c\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      7. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\left(b \cdot b\right), \left(\mathsf{neg}\left(\left(4 \cdot a\right) \cdot c\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(\mathsf{neg}\left(\left(4 \cdot a\right) \cdot c\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      9. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(\mathsf{neg}\left(\left(a \cdot 4\right) \cdot c\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      10. associate-*l*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(\mathsf{neg}\left(a \cdot \left(4 \cdot c\right)\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      11. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(a \cdot \left(\mathsf{neg}\left(4 \cdot c\right)\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      12. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(a \cdot \left(\mathsf{neg}\left(c \cdot 4\right)\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      13. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(a, \left(\mathsf{neg}\left(c \cdot 4\right)\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      14. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(a, \left(c \cdot \left(\mathsf{neg}\left(4\right)\right)\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      15. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(c, \left(\mathsf{neg}\left(4\right)\right)\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      16. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(c, -4\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      17. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(c, -4\right)\right)\right)\right), b\right), \left(a \cdot \color{blue}{2}\right)\right) \]
    3. Simplified24.3%

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

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

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

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\left(\left(2 \cdot a\right) \cdot \left(2 \cdot a\right)\right), \left(\sqrt{b \cdot b + a \cdot \left(c \cdot -4\right)} \cdot \color{blue}{\left(a \cdot 2\right)} - \left(a \cdot 2\right) \cdot b\right)\right)\right) \]
      8. swap-sqrN/A

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

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{*.f64}\left(4, \mathsf{*.f64}\left(a, a\right)\right), \left(\sqrt{b \cdot b + a \cdot \left(c \cdot -4\right)} \cdot \color{blue}{\left(a \cdot 2\right)} - \left(a \cdot 2\right) \cdot b\right)\right)\right) \]
      14. cancel-sign-sub-invN/A

        \[\leadsto \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{*.f64}\left(4, \mathsf{*.f64}\left(a, a\right)\right), \left(\sqrt{b \cdot b + a \cdot \left(c \cdot -4\right)} \cdot \left(a \cdot 2\right) + \color{blue}{\left(\mathsf{neg}\left(a \cdot 2\right)\right) \cdot b}\right)\right)\right) \]
      15. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{*.f64}\left(4, \mathsf{*.f64}\left(a, a\right)\right), \mathsf{+.f64}\left(\left(\sqrt{b \cdot b + a \cdot \left(c \cdot -4\right)} \cdot \left(a \cdot 2\right)\right), \color{blue}{\left(\left(\mathsf{neg}\left(a \cdot 2\right)\right) \cdot b\right)}\right)\right)\right) \]
    6. Applied egg-rr12.6%

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

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

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

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

        \[\leadsto \frac{\frac{1}{4} \cdot \left(b \cdot 0\right)}{a} \]
      4. mul0-rgtN/A

        \[\leadsto \frac{\frac{1}{4} \cdot 0}{a} \]
      5. metadata-evalN/A

        \[\leadsto \frac{0}{a} \]
      6. /-lowering-/.f6423.0%

        \[\leadsto \mathsf{/.f64}\left(0, \color{blue}{a}\right) \]
    9. Simplified23.0%

      \[\leadsto \color{blue}{\frac{0}{a}} \]
    10. Step-by-step derivation
      1. div023.0%

        \[\leadsto 0 \]
    11. Applied egg-rr23.0%

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

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

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

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

      \[\leadsto \mathsf{/.f64}\left(\left(\left(\mathsf{neg}\left(b\right)\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}\right), \color{blue}{\left(2 \cdot a\right)}\right) \]
    2. +-commutativeN/A

      \[\leadsto \mathsf{/.f64}\left(\left(\sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c} + \left(\mathsf{neg}\left(b\right)\right)\right), \left(\color{blue}{2} \cdot a\right)\right) \]
    3. unsub-negN/A

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

      \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\left(\sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}\right), b\right), \left(\color{blue}{2} \cdot a\right)\right) \]
    5. sqrt-lowering-sqrt.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\left(b \cdot b - \left(4 \cdot a\right) \cdot c\right)\right), b\right), \left(2 \cdot a\right)\right) \]
    6. sub-negN/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\left(b \cdot b + \left(\mathsf{neg}\left(\left(4 \cdot a\right) \cdot c\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
    7. +-lowering-+.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\left(b \cdot b\right), \left(\mathsf{neg}\left(\left(4 \cdot a\right) \cdot c\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
    8. *-lowering-*.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(\mathsf{neg}\left(\left(4 \cdot a\right) \cdot c\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
    9. *-commutativeN/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(\mathsf{neg}\left(\left(a \cdot 4\right) \cdot c\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
    10. associate-*l*N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(\mathsf{neg}\left(a \cdot \left(4 \cdot c\right)\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
    11. distribute-rgt-neg-inN/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(a \cdot \left(\mathsf{neg}\left(4 \cdot c\right)\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
    12. *-commutativeN/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(a \cdot \left(\mathsf{neg}\left(c \cdot 4\right)\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
    13. *-lowering-*.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(a, \left(\mathsf{neg}\left(c \cdot 4\right)\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
    14. distribute-rgt-neg-inN/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(a, \left(c \cdot \left(\mathsf{neg}\left(4\right)\right)\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
    15. *-lowering-*.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(c, \left(\mathsf{neg}\left(4\right)\right)\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
    16. metadata-evalN/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(c, -4\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
    17. *-commutativeN/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(c, -4\right)\right)\right)\right), b\right), \left(a \cdot \color{blue}{2}\right)\right) \]
  3. Simplified48.5%

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

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

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

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

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

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

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

      \[\leadsto \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\left(\left(2 \cdot a\right) \cdot \left(2 \cdot a\right)\right), \left(\sqrt{b \cdot b + a \cdot \left(c \cdot -4\right)} \cdot \color{blue}{\left(a \cdot 2\right)} - \left(a \cdot 2\right) \cdot b\right)\right)\right) \]
    8. swap-sqrN/A

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

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

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

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

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

      \[\leadsto \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{*.f64}\left(4, \mathsf{*.f64}\left(a, a\right)\right), \left(\sqrt{b \cdot b + a \cdot \left(c \cdot -4\right)} \cdot \color{blue}{\left(a \cdot 2\right)} - \left(a \cdot 2\right) \cdot b\right)\right)\right) \]
    14. cancel-sign-sub-invN/A

      \[\leadsto \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{*.f64}\left(4, \mathsf{*.f64}\left(a, a\right)\right), \left(\sqrt{b \cdot b + a \cdot \left(c \cdot -4\right)} \cdot \left(a \cdot 2\right) + \color{blue}{\left(\mathsf{neg}\left(a \cdot 2\right)\right) \cdot b}\right)\right)\right) \]
    15. +-lowering-+.f64N/A

      \[\leadsto \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{*.f64}\left(4, \mathsf{*.f64}\left(a, a\right)\right), \mathsf{+.f64}\left(\left(\sqrt{b \cdot b + a \cdot \left(c \cdot -4\right)} \cdot \left(a \cdot 2\right)\right), \color{blue}{\left(\left(\mathsf{neg}\left(a \cdot 2\right)\right) \cdot b\right)}\right)\right)\right) \]
  6. Applied egg-rr30.6%

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

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

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

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

      \[\leadsto \frac{\frac{1}{4} \cdot \left(b \cdot 0\right)}{a} \]
    4. mul0-rgtN/A

      \[\leadsto \frac{\frac{1}{4} \cdot 0}{a} \]
    5. metadata-evalN/A

      \[\leadsto \frac{0}{a} \]
    6. /-lowering-/.f6412.5%

      \[\leadsto \mathsf{/.f64}\left(0, \color{blue}{a}\right) \]
  9. Simplified12.5%

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

      \[\leadsto 0 \]
  11. Applied egg-rr12.5%

    \[\leadsto \color{blue}{0} \]
  12. Add Preprocessing

Reproduce

?
herbie shell --seed 2024139 
(FPCore (a b c)
  :name "Quadratic roots, full range"
  :precision binary64
  (/ (+ (- b) (sqrt (- (* b b) (* (* 4.0 a) c)))) (* 2.0 a)))