The quadratic formula (r1)

Percentage Accurate: 52.2% → 85.7%
Time: 17.3s
Alternatives: 9
Speedup: 19.1×

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 9 alternatives:

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

Initial Program: 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: 85.7% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq -1.1 \cdot 10^{+71}:\\
\;\;\;\;\frac{c \cdot \left(\frac{a \cdot -4}{b} \cdot -0.25\right) - b}{a}\\

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

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


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

    1. Initial program 50.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. *-commutative50.4%

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\left(-b\right) + \sqrt{{b}^{2} + \left(\color{blue}{\left(a \cdot \left(-4\right)\right)} \cdot c + \mathsf{fma}\left(-c, 4 \cdot a, c \cdot \left(4 \cdot a\right)\right)\right)}}{a \cdot 2} \]
      9. metadata-eval50.1%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{-0.25 \cdot \frac{-8 \cdot \left(a \cdot c\right) + 4 \cdot \left(a \cdot c\right)}{a \cdot b} + -1 \cdot \frac{b}{a}} \]
      2. mul-1-neg89.2%

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

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

        \[\leadsto \color{blue}{\frac{-8 \cdot \left(a \cdot c\right) + 4 \cdot \left(a \cdot c\right)}{a \cdot b} \cdot -0.25} - \frac{b}{a} \]
      5. associate-*r*89.2%

        \[\leadsto \frac{\color{blue}{\left(-8 \cdot a\right) \cdot c} + 4 \cdot \left(a \cdot c\right)}{a \cdot b} \cdot -0.25 - \frac{b}{a} \]
      6. associate-*r*89.2%

        \[\leadsto \frac{\left(-8 \cdot a\right) \cdot c + \color{blue}{\left(4 \cdot a\right) \cdot c}}{a \cdot b} \cdot -0.25 - \frac{b}{a} \]
      7. distribute-rgt-in89.2%

        \[\leadsto \frac{\color{blue}{c \cdot \left(-8 \cdot a + 4 \cdot a\right)}}{a \cdot b} \cdot -0.25 - \frac{b}{a} \]
      8. times-frac79.5%

        \[\leadsto \color{blue}{\left(\frac{c}{a} \cdot \frac{-8 \cdot a + 4 \cdot a}{b}\right)} \cdot -0.25 - \frac{b}{a} \]
      9. distribute-rgt-out79.5%

        \[\leadsto \left(\frac{c}{a} \cdot \frac{\color{blue}{a \cdot \left(-8 + 4\right)}}{b}\right) \cdot -0.25 - \frac{b}{a} \]
      10. metadata-eval79.5%

        \[\leadsto \left(\frac{c}{a} \cdot \frac{a \cdot \color{blue}{-4}}{b}\right) \cdot -0.25 - \frac{b}{a} \]
    10. Simplified79.5%

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

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

        \[\leadsto \color{blue}{{\left(\sqrt[3]{\left(\frac{c}{a} \cdot \frac{a \cdot -4}{b}\right) \cdot -0.25 - \frac{b}{a}}\right)}^{3}} \]
      3. associate-*l*78.1%

        \[\leadsto {\left(\sqrt[3]{\color{blue}{\frac{c}{a} \cdot \left(\frac{a \cdot -4}{b} \cdot -0.25\right)} - \frac{b}{a}}\right)}^{3} \]
    12. Applied egg-rr78.1%

      \[\leadsto \color{blue}{{\left(\sqrt[3]{\frac{c}{a} \cdot \left(\frac{a \cdot -4}{b} \cdot -0.25\right) - \frac{b}{a}}\right)}^{3}} \]
    13. Step-by-step derivation
      1. rem-cube-cbrt79.5%

        \[\leadsto \color{blue}{\frac{c}{a} \cdot \left(\frac{a \cdot -4}{b} \cdot -0.25\right) - \frac{b}{a}} \]
      2. sub-neg79.5%

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

        \[\leadsto \frac{c}{a} \cdot \left(\frac{\color{blue}{-4 \cdot a}}{b} \cdot -0.25\right) + \left(-\frac{b}{a}\right) \]
      4. *-un-lft-identity79.5%

        \[\leadsto \frac{c}{a} \cdot \left(\frac{-4 \cdot a}{\color{blue}{1 \cdot b}} \cdot -0.25\right) + \left(-\frac{b}{a}\right) \]
      5. times-frac79.5%

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

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

      \[\leadsto \color{blue}{\frac{c}{a} \cdot \left(\left(-4 \cdot \frac{a}{b}\right) \cdot -0.25\right) + \left(-\frac{b}{a}\right)} \]
    15. Step-by-step derivation
      1. sub-neg79.5%

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

        \[\leadsto \color{blue}{\frac{c \cdot \left(\left(-4 \cdot \frac{a}{b}\right) \cdot -0.25\right)}{a}} - \frac{b}{a} \]
      3. div-sub97.8%

        \[\leadsto \color{blue}{\frac{c \cdot \left(\left(-4 \cdot \frac{a}{b}\right) \cdot -0.25\right) - b}{a}} \]
      4. associate-*r/97.8%

        \[\leadsto \frac{c \cdot \left(\color{blue}{\frac{-4 \cdot a}{b}} \cdot -0.25\right) - b}{a} \]
      5. *-commutative97.8%

        \[\leadsto \frac{c \cdot \left(\frac{\color{blue}{a \cdot -4}}{b} \cdot -0.25\right) - b}{a} \]
    16. Simplified97.8%

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

    if -1.09999999999999997e71 < b < 2.89999999999999988e-39

    1. Initial program 80.6%

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

    if 2.89999999999999988e-39 < b

    1. Initial program 13.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. *-commutative13.5%

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

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

      \[\leadsto \color{blue}{-1 \cdot \frac{c}{b}} \]
    5. Step-by-step derivation
      1. mul-1-neg88.5%

        \[\leadsto \color{blue}{-\frac{c}{b}} \]
      2. distribute-neg-frac88.5%

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

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

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

Alternative 2: 81.2% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq -5 \cdot 10^{-48}:\\
\;\;\;\;\frac{c \cdot \left(\frac{a \cdot -4}{b} \cdot -0.25\right) - b}{a}\\

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

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


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

    1. Initial program 65.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{\left(-b\right) + \sqrt{\color{blue}{{b}^{2} + \left(a \cdot \left(c \cdot -4\right) + \left(a \cdot \left(c \cdot -4\right) + \left(c \cdot 4\right) \cdot a\right)\right)}}}{a \cdot 2} \]
    6. Step-by-step derivation
      1. fma-def64.8%

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

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

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

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

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

        \[\leadsto \color{blue}{-0.25 \cdot \frac{-8 \cdot \left(a \cdot c\right) + 4 \cdot \left(a \cdot c\right)}{a \cdot b} + -1 \cdot \frac{b}{a}} \]
      2. mul-1-neg82.9%

        \[\leadsto -0.25 \cdot \frac{-8 \cdot \left(a \cdot c\right) + 4 \cdot \left(a \cdot c\right)}{a \cdot b} + \color{blue}{\left(-\frac{b}{a}\right)} \]
      3. unsub-neg82.9%

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

        \[\leadsto \color{blue}{\frac{-8 \cdot \left(a \cdot c\right) + 4 \cdot \left(a \cdot c\right)}{a \cdot b} \cdot -0.25} - \frac{b}{a} \]
      5. associate-*r*82.9%

        \[\leadsto \frac{\color{blue}{\left(-8 \cdot a\right) \cdot c} + 4 \cdot \left(a \cdot c\right)}{a \cdot b} \cdot -0.25 - \frac{b}{a} \]
      6. associate-*r*82.9%

        \[\leadsto \frac{\left(-8 \cdot a\right) \cdot c + \color{blue}{\left(4 \cdot a\right) \cdot c}}{a \cdot b} \cdot -0.25 - \frac{b}{a} \]
      7. distribute-rgt-in82.9%

        \[\leadsto \frac{\color{blue}{c \cdot \left(-8 \cdot a + 4 \cdot a\right)}}{a \cdot b} \cdot -0.25 - \frac{b}{a} \]
      8. times-frac76.3%

        \[\leadsto \color{blue}{\left(\frac{c}{a} \cdot \frac{-8 \cdot a + 4 \cdot a}{b}\right)} \cdot -0.25 - \frac{b}{a} \]
      9. distribute-rgt-out76.3%

        \[\leadsto \left(\frac{c}{a} \cdot \frac{\color{blue}{a \cdot \left(-8 + 4\right)}}{b}\right) \cdot -0.25 - \frac{b}{a} \]
      10. metadata-eval76.3%

        \[\leadsto \left(\frac{c}{a} \cdot \frac{a \cdot \color{blue}{-4}}{b}\right) \cdot -0.25 - \frac{b}{a} \]
    10. Simplified76.3%

      \[\leadsto \color{blue}{\left(\frac{c}{a} \cdot \frac{a \cdot -4}{b}\right) \cdot -0.25 - \frac{b}{a}} \]
    11. Step-by-step derivation
      1. add-cube-cbrt74.9%

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

        \[\leadsto \color{blue}{{\left(\sqrt[3]{\left(\frac{c}{a} \cdot \frac{a \cdot -4}{b}\right) \cdot -0.25 - \frac{b}{a}}\right)}^{3}} \]
      3. associate-*l*75.0%

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

      \[\leadsto \color{blue}{{\left(\sqrt[3]{\frac{c}{a} \cdot \left(\frac{a \cdot -4}{b} \cdot -0.25\right) - \frac{b}{a}}\right)}^{3}} \]
    13. Step-by-step derivation
      1. rem-cube-cbrt76.3%

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

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

        \[\leadsto \frac{c}{a} \cdot \left(\frac{\color{blue}{-4 \cdot a}}{b} \cdot -0.25\right) + \left(-\frac{b}{a}\right) \]
      4. *-un-lft-identity76.3%

        \[\leadsto \frac{c}{a} \cdot \left(\frac{-4 \cdot a}{\color{blue}{1 \cdot b}} \cdot -0.25\right) + \left(-\frac{b}{a}\right) \]
      5. times-frac76.3%

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

        \[\leadsto \frac{c}{a} \cdot \left(\left(\color{blue}{-4} \cdot \frac{a}{b}\right) \cdot -0.25\right) + \left(-\frac{b}{a}\right) \]
    14. Applied egg-rr76.3%

      \[\leadsto \color{blue}{\frac{c}{a} \cdot \left(\left(-4 \cdot \frac{a}{b}\right) \cdot -0.25\right) + \left(-\frac{b}{a}\right)} \]
    15. Step-by-step derivation
      1. sub-neg76.3%

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

        \[\leadsto \color{blue}{\frac{c \cdot \left(\left(-4 \cdot \frac{a}{b}\right) \cdot -0.25\right)}{a}} - \frac{b}{a} \]
      3. div-sub88.8%

        \[\leadsto \color{blue}{\frac{c \cdot \left(\left(-4 \cdot \frac{a}{b}\right) \cdot -0.25\right) - b}{a}} \]
      4. associate-*r/88.8%

        \[\leadsto \frac{c \cdot \left(\color{blue}{\frac{-4 \cdot a}{b}} \cdot -0.25\right) - b}{a} \]
      5. *-commutative88.8%

        \[\leadsto \frac{c \cdot \left(\frac{\color{blue}{a \cdot -4}}{b} \cdot -0.25\right) - b}{a} \]
    16. Simplified88.8%

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

    if -4.9999999999999999e-48 < b < 4.19999999999999987e-39

    1. Initial program 73.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. *-commutative73.5%

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

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

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

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

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

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

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

        \[\leadsto \frac{\left(-b\right) + {\left({\color{blue}{\left(\left(-\left(4 \cdot a\right) \cdot c\right) + b \cdot b\right)}}^{\left(\frac{0.5}{2}\right)}\right)}^{2}}{a \cdot 2} \]
      7. distribute-lft-neg-in73.2%

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

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

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

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

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

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

        \[\leadsto \frac{\left(-b\right) + {\left({\color{blue}{\left(\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)\right)}}^{\left(\frac{0.5}{2}\right)}\right)}^{2}}{a \cdot 2} \]
      14. pow271.8%

        \[\leadsto \frac{\left(-b\right) + {\left({\left(\mathsf{fma}\left(a, c \cdot -4, \color{blue}{{b}^{2}}\right)\right)}^{\left(\frac{0.5}{2}\right)}\right)}^{2}}{a \cdot 2} \]
      15. metadata-eval71.8%

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

      \[\leadsto \frac{\left(-b\right) + \color{blue}{{\left({\left(\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)\right)}^{0.25}\right)}^{2}}}{a \cdot 2} \]
    6. Taylor expanded in c around -inf 48.1%

      \[\leadsto \frac{\color{blue}{{\left(e^{0.25 \cdot \left(\log \left(4 \cdot a\right) + -1 \cdot \log \left(\frac{-1}{c}\right)\right)}\right)}^{2} - b}}{a \cdot 2} \]
    7. Step-by-step derivation
      1. clear-num48.1%

        \[\leadsto \color{blue}{\frac{1}{\frac{a \cdot 2}{{\left(e^{0.25 \cdot \left(\log \left(4 \cdot a\right) + -1 \cdot \log \left(\frac{-1}{c}\right)\right)}\right)}^{2} - b}}} \]
      2. inv-pow48.1%

        \[\leadsto \color{blue}{{\left(\frac{a \cdot 2}{{\left(e^{0.25 \cdot \left(\log \left(4 \cdot a\right) + -1 \cdot \log \left(\frac{-1}{c}\right)\right)}\right)}^{2} - b}\right)}^{-1}} \]
    8. Applied egg-rr71.8%

      \[\leadsto \color{blue}{{\left(\frac{a \cdot 2}{{\left({\left(\left(a \cdot 4\right) \cdot \frac{1}{\frac{-1}{c}}\right)}^{0.25}\right)}^{2} - b}\right)}^{-1}} \]
    9. Step-by-step derivation
      1. unpow-171.8%

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

        \[\leadsto \frac{1}{\color{blue}{\frac{a}{\frac{{\left({\left(\left(a \cdot 4\right) \cdot \frac{1}{\frac{-1}{c}}\right)}^{0.25}\right)}^{2} - b}{2}}}} \]
      3. unpow271.8%

        \[\leadsto \frac{1}{\frac{a}{\frac{\color{blue}{{\left(\left(a \cdot 4\right) \cdot \frac{1}{\frac{-1}{c}}\right)}^{0.25} \cdot {\left(\left(a \cdot 4\right) \cdot \frac{1}{\frac{-1}{c}}\right)}^{0.25}} - b}{2}}} \]
      4. pow-sqr72.2%

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

        \[\leadsto \frac{1}{\frac{a}{\frac{{\left(\left(a \cdot 4\right) \cdot \frac{1}{\frac{-1}{c}}\right)}^{\color{blue}{0.5}} - b}{2}}} \]
      6. unpow1/272.2%

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

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

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

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

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

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

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

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

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

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

    if 4.19999999999999987e-39 < b

    1. Initial program 13.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. *-commutative13.5%

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

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

      \[\leadsto \color{blue}{-1 \cdot \frac{c}{b}} \]
    5. Step-by-step derivation
      1. mul-1-neg88.5%

        \[\leadsto \color{blue}{-\frac{c}{b}} \]
      2. distribute-neg-frac88.5%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -5 \cdot 10^{-48}:\\ \;\;\;\;\frac{c \cdot \left(\frac{a \cdot -4}{b} \cdot -0.25\right) - b}{a}\\ \mathbf{elif}\;b \leq 4.2 \cdot 10^{-39}:\\ \;\;\;\;\frac{1}{\frac{a}{\frac{\sqrt{-4 \cdot \left(c \cdot a\right)} - b}{2}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{-c}{b}\\ \end{array} \]

Alternative 3: 81.2% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq -1.6 \cdot 10^{-48}:\\
\;\;\;\;\frac{c \cdot \left(\frac{a \cdot -4}{b} \cdot -0.25\right) - b}{a}\\

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

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


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

    1. Initial program 65.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{\left(-b\right) + \sqrt{\color{blue}{{b}^{2} + \left(a \cdot \left(c \cdot -4\right) + \left(a \cdot \left(c \cdot -4\right) + \left(c \cdot 4\right) \cdot a\right)\right)}}}{a \cdot 2} \]
    6. Step-by-step derivation
      1. fma-def64.8%

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

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

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

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

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

        \[\leadsto \color{blue}{-0.25 \cdot \frac{-8 \cdot \left(a \cdot c\right) + 4 \cdot \left(a \cdot c\right)}{a \cdot b} + -1 \cdot \frac{b}{a}} \]
      2. mul-1-neg82.9%

        \[\leadsto -0.25 \cdot \frac{-8 \cdot \left(a \cdot c\right) + 4 \cdot \left(a \cdot c\right)}{a \cdot b} + \color{blue}{\left(-\frac{b}{a}\right)} \]
      3. unsub-neg82.9%

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

        \[\leadsto \color{blue}{\frac{-8 \cdot \left(a \cdot c\right) + 4 \cdot \left(a \cdot c\right)}{a \cdot b} \cdot -0.25} - \frac{b}{a} \]
      5. associate-*r*82.9%

        \[\leadsto \frac{\color{blue}{\left(-8 \cdot a\right) \cdot c} + 4 \cdot \left(a \cdot c\right)}{a \cdot b} \cdot -0.25 - \frac{b}{a} \]
      6. associate-*r*82.9%

        \[\leadsto \frac{\left(-8 \cdot a\right) \cdot c + \color{blue}{\left(4 \cdot a\right) \cdot c}}{a \cdot b} \cdot -0.25 - \frac{b}{a} \]
      7. distribute-rgt-in82.9%

        \[\leadsto \frac{\color{blue}{c \cdot \left(-8 \cdot a + 4 \cdot a\right)}}{a \cdot b} \cdot -0.25 - \frac{b}{a} \]
      8. times-frac76.3%

        \[\leadsto \color{blue}{\left(\frac{c}{a} \cdot \frac{-8 \cdot a + 4 \cdot a}{b}\right)} \cdot -0.25 - \frac{b}{a} \]
      9. distribute-rgt-out76.3%

        \[\leadsto \left(\frac{c}{a} \cdot \frac{\color{blue}{a \cdot \left(-8 + 4\right)}}{b}\right) \cdot -0.25 - \frac{b}{a} \]
      10. metadata-eval76.3%

        \[\leadsto \left(\frac{c}{a} \cdot \frac{a \cdot \color{blue}{-4}}{b}\right) \cdot -0.25 - \frac{b}{a} \]
    10. Simplified76.3%

      \[\leadsto \color{blue}{\left(\frac{c}{a} \cdot \frac{a \cdot -4}{b}\right) \cdot -0.25 - \frac{b}{a}} \]
    11. Step-by-step derivation
      1. add-cube-cbrt74.9%

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

        \[\leadsto \color{blue}{{\left(\sqrt[3]{\left(\frac{c}{a} \cdot \frac{a \cdot -4}{b}\right) \cdot -0.25 - \frac{b}{a}}\right)}^{3}} \]
      3. associate-*l*75.0%

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

      \[\leadsto \color{blue}{{\left(\sqrt[3]{\frac{c}{a} \cdot \left(\frac{a \cdot -4}{b} \cdot -0.25\right) - \frac{b}{a}}\right)}^{3}} \]
    13. Step-by-step derivation
      1. rem-cube-cbrt76.3%

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

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

        \[\leadsto \frac{c}{a} \cdot \left(\frac{\color{blue}{-4 \cdot a}}{b} \cdot -0.25\right) + \left(-\frac{b}{a}\right) \]
      4. *-un-lft-identity76.3%

        \[\leadsto \frac{c}{a} \cdot \left(\frac{-4 \cdot a}{\color{blue}{1 \cdot b}} \cdot -0.25\right) + \left(-\frac{b}{a}\right) \]
      5. times-frac76.3%

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

        \[\leadsto \frac{c}{a} \cdot \left(\left(\color{blue}{-4} \cdot \frac{a}{b}\right) \cdot -0.25\right) + \left(-\frac{b}{a}\right) \]
    14. Applied egg-rr76.3%

      \[\leadsto \color{blue}{\frac{c}{a} \cdot \left(\left(-4 \cdot \frac{a}{b}\right) \cdot -0.25\right) + \left(-\frac{b}{a}\right)} \]
    15. Step-by-step derivation
      1. sub-neg76.3%

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

        \[\leadsto \color{blue}{\frac{c \cdot \left(\left(-4 \cdot \frac{a}{b}\right) \cdot -0.25\right)}{a}} - \frac{b}{a} \]
      3. div-sub88.8%

        \[\leadsto \color{blue}{\frac{c \cdot \left(\left(-4 \cdot \frac{a}{b}\right) \cdot -0.25\right) - b}{a}} \]
      4. associate-*r/88.8%

        \[\leadsto \frac{c \cdot \left(\color{blue}{\frac{-4 \cdot a}{b}} \cdot -0.25\right) - b}{a} \]
      5. *-commutative88.8%

        \[\leadsto \frac{c \cdot \left(\frac{\color{blue}{a \cdot -4}}{b} \cdot -0.25\right) - b}{a} \]
    16. Simplified88.8%

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

    if -1.5999999999999999e-48 < b < 4.19999999999999987e-39

    1. Initial program 73.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. *-commutative73.5%

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

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

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

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

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

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

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

        \[\leadsto \frac{\left(-b\right) + {\left({\color{blue}{\left(\left(-\left(4 \cdot a\right) \cdot c\right) + b \cdot b\right)}}^{\left(\frac{0.5}{2}\right)}\right)}^{2}}{a \cdot 2} \]
      7. distribute-lft-neg-in73.2%

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

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

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

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

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

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

        \[\leadsto \frac{\left(-b\right) + {\left({\color{blue}{\left(\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)\right)}}^{\left(\frac{0.5}{2}\right)}\right)}^{2}}{a \cdot 2} \]
      14. pow271.8%

        \[\leadsto \frac{\left(-b\right) + {\left({\left(\mathsf{fma}\left(a, c \cdot -4, \color{blue}{{b}^{2}}\right)\right)}^{\left(\frac{0.5}{2}\right)}\right)}^{2}}{a \cdot 2} \]
      15. metadata-eval71.8%

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

      \[\leadsto \frac{\left(-b\right) + \color{blue}{{\left({\left(\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)\right)}^{0.25}\right)}^{2}}}{a \cdot 2} \]
    6. Taylor expanded in c around -inf 48.1%

      \[\leadsto \frac{\color{blue}{{\left(e^{0.25 \cdot \left(\log \left(4 \cdot a\right) + -1 \cdot \log \left(\frac{-1}{c}\right)\right)}\right)}^{2} - b}}{a \cdot 2} \]
    7. Step-by-step derivation
      1. expm1-log1p-u48.2%

        \[\leadsto 0.5 \cdot \frac{\color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left({\left(e^{0.25 \cdot \left(\log \left(4 \cdot a\right) + -1 \cdot \log \left(\frac{-1}{c}\right)\right)}\right)}^{2}\right)\right)}}{a} \]
      2. expm1-udef26.5%

        \[\leadsto 0.5 \cdot \frac{\color{blue}{e^{\mathsf{log1p}\left({\left(e^{0.25 \cdot \left(\log \left(4 \cdot a\right) + -1 \cdot \log \left(\frac{-1}{c}\right)\right)}\right)}^{2}\right)} - 1}}{a} \]
    8. Applied egg-rr38.1%

      \[\leadsto \frac{\color{blue}{\left(e^{\mathsf{log1p}\left({\left({\left(\left(a \cdot 4\right) \cdot \frac{1}{\frac{-1}{c}}\right)}^{0.25}\right)}^{2}\right)} - 1\right)} - b}{a \cdot 2} \]
    9. Step-by-step derivation
      1. expm1-def69.0%

        \[\leadsto 0.5 \cdot \frac{\color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left({\left({\left(\left(a \cdot 4\right) \cdot \frac{1}{\frac{-1}{c}}\right)}^{0.25}\right)}^{2}\right)\right)}}{a} \]
      2. expm1-log1p71.6%

        \[\leadsto 0.5 \cdot \frac{\color{blue}{{\left({\left(\left(a \cdot 4\right) \cdot \frac{1}{\frac{-1}{c}}\right)}^{0.25}\right)}^{2}}}{a} \]
      3. unpow271.6%

        \[\leadsto 0.5 \cdot \frac{\color{blue}{{\left(\left(a \cdot 4\right) \cdot \frac{1}{\frac{-1}{c}}\right)}^{0.25} \cdot {\left(\left(a \cdot 4\right) \cdot \frac{1}{\frac{-1}{c}}\right)}^{0.25}}}{a} \]
      4. pow-sqr71.9%

        \[\leadsto 0.5 \cdot \frac{\color{blue}{{\left(\left(a \cdot 4\right) \cdot \frac{1}{\frac{-1}{c}}\right)}^{\left(2 \cdot 0.25\right)}}}{a} \]
      5. metadata-eval71.9%

        \[\leadsto 0.5 \cdot \frac{{\left(\left(a \cdot 4\right) \cdot \frac{1}{\frac{-1}{c}}\right)}^{\color{blue}{0.5}}}{a} \]
      6. unpow1/271.9%

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

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

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

        \[\leadsto 0.5 \cdot \frac{\sqrt{a \cdot \left(4 \cdot \left(\color{blue}{-1} \cdot c\right)\right)}}{a} \]
      10. associate-*r*70.5%

        \[\leadsto 0.5 \cdot \frac{\sqrt{a \cdot \color{blue}{\left(\left(4 \cdot -1\right) \cdot c\right)}}}{a} \]
      11. metadata-eval70.5%

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

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

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

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

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

    if 4.19999999999999987e-39 < b

    1. Initial program 13.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. *-commutative13.5%

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

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

      \[\leadsto \color{blue}{-1 \cdot \frac{c}{b}} \]
    5. Step-by-step derivation
      1. mul-1-neg88.5%

        \[\leadsto \color{blue}{-\frac{c}{b}} \]
      2. distribute-neg-frac88.5%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -1.6 \cdot 10^{-48}:\\ \;\;\;\;\frac{c \cdot \left(\frac{a \cdot -4}{b} \cdot -0.25\right) - b}{a}\\ \mathbf{elif}\;b \leq 4.2 \cdot 10^{-39}:\\ \;\;\;\;\frac{\sqrt{-4 \cdot \left(c \cdot a\right)} - b}{a \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;\frac{-c}{b}\\ \end{array} \]

Alternative 4: 80.8% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq -1.1 \cdot 10^{-47}:\\
\;\;\;\;\frac{c \cdot \left(\frac{a \cdot -4}{b} \cdot -0.25\right) - b}{a}\\

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

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


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

    1. Initial program 65.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{\left(-b\right) + \sqrt{\color{blue}{{b}^{2} + \left(a \cdot \left(c \cdot -4\right) + \left(a \cdot \left(c \cdot -4\right) + \left(c \cdot 4\right) \cdot a\right)\right)}}}{a \cdot 2} \]
    6. Step-by-step derivation
      1. fma-def64.8%

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

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

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

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

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

        \[\leadsto \color{blue}{-0.25 \cdot \frac{-8 \cdot \left(a \cdot c\right) + 4 \cdot \left(a \cdot c\right)}{a \cdot b} + -1 \cdot \frac{b}{a}} \]
      2. mul-1-neg82.9%

        \[\leadsto -0.25 \cdot \frac{-8 \cdot \left(a \cdot c\right) + 4 \cdot \left(a \cdot c\right)}{a \cdot b} + \color{blue}{\left(-\frac{b}{a}\right)} \]
      3. unsub-neg82.9%

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

        \[\leadsto \color{blue}{\frac{-8 \cdot \left(a \cdot c\right) + 4 \cdot \left(a \cdot c\right)}{a \cdot b} \cdot -0.25} - \frac{b}{a} \]
      5. associate-*r*82.9%

        \[\leadsto \frac{\color{blue}{\left(-8 \cdot a\right) \cdot c} + 4 \cdot \left(a \cdot c\right)}{a \cdot b} \cdot -0.25 - \frac{b}{a} \]
      6. associate-*r*82.9%

        \[\leadsto \frac{\left(-8 \cdot a\right) \cdot c + \color{blue}{\left(4 \cdot a\right) \cdot c}}{a \cdot b} \cdot -0.25 - \frac{b}{a} \]
      7. distribute-rgt-in82.9%

        \[\leadsto \frac{\color{blue}{c \cdot \left(-8 \cdot a + 4 \cdot a\right)}}{a \cdot b} \cdot -0.25 - \frac{b}{a} \]
      8. times-frac76.3%

        \[\leadsto \color{blue}{\left(\frac{c}{a} \cdot \frac{-8 \cdot a + 4 \cdot a}{b}\right)} \cdot -0.25 - \frac{b}{a} \]
      9. distribute-rgt-out76.3%

        \[\leadsto \left(\frac{c}{a} \cdot \frac{\color{blue}{a \cdot \left(-8 + 4\right)}}{b}\right) \cdot -0.25 - \frac{b}{a} \]
      10. metadata-eval76.3%

        \[\leadsto \left(\frac{c}{a} \cdot \frac{a \cdot \color{blue}{-4}}{b}\right) \cdot -0.25 - \frac{b}{a} \]
    10. Simplified76.3%

      \[\leadsto \color{blue}{\left(\frac{c}{a} \cdot \frac{a \cdot -4}{b}\right) \cdot -0.25 - \frac{b}{a}} \]
    11. Step-by-step derivation
      1. add-cube-cbrt74.9%

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

        \[\leadsto \color{blue}{{\left(\sqrt[3]{\left(\frac{c}{a} \cdot \frac{a \cdot -4}{b}\right) \cdot -0.25 - \frac{b}{a}}\right)}^{3}} \]
      3. associate-*l*75.0%

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

      \[\leadsto \color{blue}{{\left(\sqrt[3]{\frac{c}{a} \cdot \left(\frac{a \cdot -4}{b} \cdot -0.25\right) - \frac{b}{a}}\right)}^{3}} \]
    13. Step-by-step derivation
      1. rem-cube-cbrt76.3%

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

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

        \[\leadsto \frac{c}{a} \cdot \left(\frac{\color{blue}{-4 \cdot a}}{b} \cdot -0.25\right) + \left(-\frac{b}{a}\right) \]
      4. *-un-lft-identity76.3%

        \[\leadsto \frac{c}{a} \cdot \left(\frac{-4 \cdot a}{\color{blue}{1 \cdot b}} \cdot -0.25\right) + \left(-\frac{b}{a}\right) \]
      5. times-frac76.3%

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

        \[\leadsto \frac{c}{a} \cdot \left(\left(\color{blue}{-4} \cdot \frac{a}{b}\right) \cdot -0.25\right) + \left(-\frac{b}{a}\right) \]
    14. Applied egg-rr76.3%

      \[\leadsto \color{blue}{\frac{c}{a} \cdot \left(\left(-4 \cdot \frac{a}{b}\right) \cdot -0.25\right) + \left(-\frac{b}{a}\right)} \]
    15. Step-by-step derivation
      1. sub-neg76.3%

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

        \[\leadsto \color{blue}{\frac{c \cdot \left(\left(-4 \cdot \frac{a}{b}\right) \cdot -0.25\right)}{a}} - \frac{b}{a} \]
      3. div-sub88.8%

        \[\leadsto \color{blue}{\frac{c \cdot \left(\left(-4 \cdot \frac{a}{b}\right) \cdot -0.25\right) - b}{a}} \]
      4. associate-*r/88.8%

        \[\leadsto \frac{c \cdot \left(\color{blue}{\frac{-4 \cdot a}{b}} \cdot -0.25\right) - b}{a} \]
      5. *-commutative88.8%

        \[\leadsto \frac{c \cdot \left(\frac{\color{blue}{a \cdot -4}}{b} \cdot -0.25\right) - b}{a} \]
    16. Simplified88.8%

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

    if -1.10000000000000009e-47 < b < 2.89999999999999988e-39

    1. Initial program 73.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. *-commutative73.5%

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

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

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

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

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

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

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

        \[\leadsto \frac{\left(-b\right) + {\left({\color{blue}{\left(\left(-\left(4 \cdot a\right) \cdot c\right) + b \cdot b\right)}}^{\left(\frac{0.5}{2}\right)}\right)}^{2}}{a \cdot 2} \]
      7. distribute-lft-neg-in73.2%

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

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

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

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

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

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

        \[\leadsto \frac{\left(-b\right) + {\left({\color{blue}{\left(\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)\right)}}^{\left(\frac{0.5}{2}\right)}\right)}^{2}}{a \cdot 2} \]
      14. pow271.8%

        \[\leadsto \frac{\left(-b\right) + {\left({\left(\mathsf{fma}\left(a, c \cdot -4, \color{blue}{{b}^{2}}\right)\right)}^{\left(\frac{0.5}{2}\right)}\right)}^{2}}{a \cdot 2} \]
      15. metadata-eval71.8%

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

      \[\leadsto \frac{\left(-b\right) + \color{blue}{{\left({\left(\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)\right)}^{0.25}\right)}^{2}}}{a \cdot 2} \]
    6. Taylor expanded in c around -inf 48.1%

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

      \[\leadsto \color{blue}{0.5 \cdot \frac{{\left(e^{0.25 \cdot \left(\log \left(4 \cdot a\right) + -1 \cdot \log \left(\frac{-1}{c}\right)\right)}\right)}^{2}}{a}} \]
    8. Step-by-step derivation
      1. expm1-log1p-u48.2%

        \[\leadsto 0.5 \cdot \frac{\color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left({\left(e^{0.25 \cdot \left(\log \left(4 \cdot a\right) + -1 \cdot \log \left(\frac{-1}{c}\right)\right)}\right)}^{2}\right)\right)}}{a} \]
      2. expm1-udef26.5%

        \[\leadsto 0.5 \cdot \frac{\color{blue}{e^{\mathsf{log1p}\left({\left(e^{0.25 \cdot \left(\log \left(4 \cdot a\right) + -1 \cdot \log \left(\frac{-1}{c}\right)\right)}\right)}^{2}\right)} - 1}}{a} \]
    9. Applied egg-rr37.4%

      \[\leadsto 0.5 \cdot \frac{\color{blue}{e^{\mathsf{log1p}\left({\left({\left(\left(a \cdot 4\right) \cdot \frac{1}{\frac{-1}{c}}\right)}^{0.25}\right)}^{2}\right)} - 1}}{a} \]
    10. Step-by-step derivation
      1. expm1-def69.0%

        \[\leadsto 0.5 \cdot \frac{\color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left({\left({\left(\left(a \cdot 4\right) \cdot \frac{1}{\frac{-1}{c}}\right)}^{0.25}\right)}^{2}\right)\right)}}{a} \]
      2. expm1-log1p71.6%

        \[\leadsto 0.5 \cdot \frac{\color{blue}{{\left({\left(\left(a \cdot 4\right) \cdot \frac{1}{\frac{-1}{c}}\right)}^{0.25}\right)}^{2}}}{a} \]
      3. unpow271.6%

        \[\leadsto 0.5 \cdot \frac{\color{blue}{{\left(\left(a \cdot 4\right) \cdot \frac{1}{\frac{-1}{c}}\right)}^{0.25} \cdot {\left(\left(a \cdot 4\right) \cdot \frac{1}{\frac{-1}{c}}\right)}^{0.25}}}{a} \]
      4. pow-sqr71.9%

        \[\leadsto 0.5 \cdot \frac{\color{blue}{{\left(\left(a \cdot 4\right) \cdot \frac{1}{\frac{-1}{c}}\right)}^{\left(2 \cdot 0.25\right)}}}{a} \]
      5. metadata-eval71.9%

        \[\leadsto 0.5 \cdot \frac{{\left(\left(a \cdot 4\right) \cdot \frac{1}{\frac{-1}{c}}\right)}^{\color{blue}{0.5}}}{a} \]
      6. unpow1/271.9%

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

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

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

        \[\leadsto 0.5 \cdot \frac{\sqrt{a \cdot \left(4 \cdot \left(\color{blue}{-1} \cdot c\right)\right)}}{a} \]
      10. associate-*r*70.5%

        \[\leadsto 0.5 \cdot \frac{\sqrt{a \cdot \color{blue}{\left(\left(4 \cdot -1\right) \cdot c\right)}}}{a} \]
      11. metadata-eval70.5%

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

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

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

        \[\leadsto 0.5 \cdot \frac{\sqrt{\color{blue}{-4 \cdot \left(a \cdot c\right)}}}{a} \]
    11. Simplified71.8%

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

    if 2.89999999999999988e-39 < b

    1. Initial program 13.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. *-commutative13.5%

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

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

      \[\leadsto \color{blue}{-1 \cdot \frac{c}{b}} \]
    5. Step-by-step derivation
      1. mul-1-neg88.5%

        \[\leadsto \color{blue}{-\frac{c}{b}} \]
      2. distribute-neg-frac88.5%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -1.1 \cdot 10^{-47}:\\ \;\;\;\;\frac{c \cdot \left(\frac{a \cdot -4}{b} \cdot -0.25\right) - b}{a}\\ \mathbf{elif}\;b \leq 2.9 \cdot 10^{-39}:\\ \;\;\;\;0.5 \cdot \frac{\sqrt{-4 \cdot \left(c \cdot a\right)}}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{-c}{b}\\ \end{array} \]

Alternative 5: 68.2% accurate, 12.8× speedup?

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

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

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


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

    1. Initial program 70.9%

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

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

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

      \[\leadsto \color{blue}{-1 \cdot \frac{b}{a} + \frac{c}{b}} \]
    5. Step-by-step derivation
      1. +-commutative69.7%

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

        \[\leadsto \frac{c}{b} + \color{blue}{\left(-\frac{b}{a}\right)} \]
      3. unsub-neg69.7%

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

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

    if -4.999999999999985e-310 < b

    1. Initial program 26.9%

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

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

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

      \[\leadsto \color{blue}{-1 \cdot \frac{c}{b}} \]
    5. Step-by-step derivation
      1. mul-1-neg70.6%

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

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

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

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

Alternative 6: 43.6% accurate, 19.1× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if b < 1.9000000000000001e44

    1. Initial program 64.9%

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

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

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

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

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

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

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

    if 1.9000000000000001e44 < b

    1. Initial program 8.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. *-commutative8.3%

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

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

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

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

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

Alternative 7: 68.1% accurate, 19.1× speedup?

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

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

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


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

    1. Initial program 70.9%

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

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

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

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

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

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

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

    if -4.999999999999985e-310 < b

    1. Initial program 26.9%

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

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

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

      \[\leadsto \color{blue}{-1 \cdot \frac{c}{b}} \]
    5. Step-by-step derivation
      1. mul-1-neg70.6%

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

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

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

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

Alternative 8: 2.5% accurate, 38.7× speedup?

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

\\
\frac{b}{a}
\end{array}
Derivation
  1. Initial program 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. *-commutative48.5%

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

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

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

    \[\leadsto \color{blue}{\frac{b}{a}} \]
  6. Final simplification2.5%

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

Alternative 9: 10.8% accurate, 38.7× speedup?

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

\\
\frac{c}{b}
\end{array}
Derivation
  1. Initial program 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. *-commutative48.5%

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

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

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

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

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

Developer target: 70.3% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}\\ \mathbf{if}\;b < 0:\\ \;\;\;\;\frac{\left(-b\right) + t_0}{2 \cdot a}\\ \mathbf{else}:\\ \;\;\;\;\frac{c}{a \cdot \frac{\left(-b\right) - t_0}{2 \cdot a}}\\ \end{array} \end{array} \]
(FPCore (a b c)
 :precision binary64
 (let* ((t_0 (sqrt (- (* b b) (* (* 4.0 a) c)))))
   (if (< b 0.0)
     (/ (+ (- b) t_0) (* 2.0 a))
     (/ c (* a (/ (- (- b) t_0) (* 2.0 a)))))))
double code(double a, double b, double c) {
	double t_0 = sqrt(((b * b) - ((4.0 * a) * c)));
	double tmp;
	if (b < 0.0) {
		tmp = (-b + t_0) / (2.0 * a);
	} else {
		tmp = c / (a * ((-b - t_0) / (2.0 * a)));
	}
	return tmp;
}
real(8) function code(a, b, c)
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8) :: t_0
    real(8) :: tmp
    t_0 = sqrt(((b * b) - ((4.0d0 * a) * c)))
    if (b < 0.0d0) then
        tmp = (-b + t_0) / (2.0d0 * a)
    else
        tmp = c / (a * ((-b - t_0) / (2.0d0 * a)))
    end if
    code = tmp
end function
public static double code(double a, double b, double c) {
	double t_0 = Math.sqrt(((b * b) - ((4.0 * a) * c)));
	double tmp;
	if (b < 0.0) {
		tmp = (-b + t_0) / (2.0 * a);
	} else {
		tmp = c / (a * ((-b - t_0) / (2.0 * a)));
	}
	return tmp;
}
def code(a, b, c):
	t_0 = math.sqrt(((b * b) - ((4.0 * a) * c)))
	tmp = 0
	if b < 0.0:
		tmp = (-b + t_0) / (2.0 * a)
	else:
		tmp = c / (a * ((-b - t_0) / (2.0 * a)))
	return tmp
function code(a, b, c)
	t_0 = sqrt(Float64(Float64(b * b) - Float64(Float64(4.0 * a) * c)))
	tmp = 0.0
	if (b < 0.0)
		tmp = Float64(Float64(Float64(-b) + t_0) / Float64(2.0 * a));
	else
		tmp = Float64(c / Float64(a * Float64(Float64(Float64(-b) - t_0) / Float64(2.0 * a))));
	end
	return tmp
end
function tmp_2 = code(a, b, c)
	t_0 = sqrt(((b * b) - ((4.0 * a) * c)));
	tmp = 0.0;
	if (b < 0.0)
		tmp = (-b + t_0) / (2.0 * a);
	else
		tmp = c / (a * ((-b - t_0) / (2.0 * a)));
	end
	tmp_2 = tmp;
end
code[a_, b_, c_] := Block[{t$95$0 = N[Sqrt[N[(N[(b * b), $MachinePrecision] - N[(N[(4.0 * a), $MachinePrecision] * c), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[Less[b, 0.0], N[(N[((-b) + t$95$0), $MachinePrecision] / N[(2.0 * a), $MachinePrecision]), $MachinePrecision], N[(c / N[(a * N[(N[((-b) - t$95$0), $MachinePrecision] / N[(2.0 * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

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

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


\end{array}
\end{array}

Reproduce

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

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

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