Quadratic roots, narrow range

Percentage Accurate: 55.2% → 92.0%
Time: 17.2s
Alternatives: 11
Speedup: 29.0×

Specification

?
\[\left(\left(1.0536712127723509 \cdot 10^{-8} < a \land a < 94906265.62425156\right) \land \left(1.0536712127723509 \cdot 10^{-8} < b \land b < 94906265.62425156\right)\right) \land \left(1.0536712127723509 \cdot 10^{-8} < c \land c < 94906265.62425156\right)\]
\[\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 11 alternatives:

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

Initial Program: 55.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: 92.0% accurate, 0.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \mathsf{fma}\left(c, -4, \frac{{b}^{2}}{a}\right)\\ \mathbf{if}\;\frac{\sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c} - b}{a \cdot 2} \leq -30:\\ \;\;\;\;\frac{\frac{\mathsf{fma}\left(a, t\_0, -{b}^{2}\right)}{\mathsf{fma}\left(\sqrt{a}, \sqrt{t\_0}, b\right)}}{a \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;\frac{\mathsf{fma}\left(-2, \frac{{c}^{3} \cdot {a}^{2}}{{b}^{4}}, \left(-0.25 \cdot \frac{{\left(a \cdot c\right)}^{4} \cdot \left(20 \cdot {b}^{-6}\right)}{a} - a \cdot \left(\frac{c}{b} \cdot \frac{c}{b}\right)\right) - c\right)}{b}\\ \end{array} \end{array} \]
(FPCore (a b c)
 :precision binary64
 (let* ((t_0 (fma c -4.0 (/ (pow b 2.0) a))))
   (if (<= (/ (- (sqrt (- (* b b) (* (* 4.0 a) c))) b) (* a 2.0)) -30.0)
     (/ (/ (fma a t_0 (- (pow b 2.0))) (fma (sqrt a) (sqrt t_0) b)) (* a 2.0))
     (/
      (fma
       -2.0
       (/ (* (pow c 3.0) (pow a 2.0)) (pow b 4.0))
       (-
        (-
         (* -0.25 (/ (* (pow (* a c) 4.0) (* 20.0 (pow b -6.0))) a))
         (* a (* (/ c b) (/ c b))))
        c))
      b))))
double code(double a, double b, double c) {
	double t_0 = fma(c, -4.0, (pow(b, 2.0) / a));
	double tmp;
	if (((sqrt(((b * b) - ((4.0 * a) * c))) - b) / (a * 2.0)) <= -30.0) {
		tmp = (fma(a, t_0, -pow(b, 2.0)) / fma(sqrt(a), sqrt(t_0), b)) / (a * 2.0);
	} else {
		tmp = fma(-2.0, ((pow(c, 3.0) * pow(a, 2.0)) / pow(b, 4.0)), (((-0.25 * ((pow((a * c), 4.0) * (20.0 * pow(b, -6.0))) / a)) - (a * ((c / b) * (c / b)))) - c)) / b;
	}
	return tmp;
}
function code(a, b, c)
	t_0 = fma(c, -4.0, Float64((b ^ 2.0) / a))
	tmp = 0.0
	if (Float64(Float64(sqrt(Float64(Float64(b * b) - Float64(Float64(4.0 * a) * c))) - b) / Float64(a * 2.0)) <= -30.0)
		tmp = Float64(Float64(fma(a, t_0, Float64(-(b ^ 2.0))) / fma(sqrt(a), sqrt(t_0), b)) / Float64(a * 2.0));
	else
		tmp = Float64(fma(-2.0, Float64(Float64((c ^ 3.0) * (a ^ 2.0)) / (b ^ 4.0)), Float64(Float64(Float64(-0.25 * Float64(Float64((Float64(a * c) ^ 4.0) * Float64(20.0 * (b ^ -6.0))) / a)) - Float64(a * Float64(Float64(c / b) * Float64(c / b)))) - c)) / b);
	end
	return tmp
end
code[a_, b_, c_] := Block[{t$95$0 = N[(c * -4.0 + N[(N[Power[b, 2.0], $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(N[(N[Sqrt[N[(N[(b * b), $MachinePrecision] - N[(N[(4.0 * a), $MachinePrecision] * c), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision] / N[(a * 2.0), $MachinePrecision]), $MachinePrecision], -30.0], N[(N[(N[(a * t$95$0 + (-N[Power[b, 2.0], $MachinePrecision])), $MachinePrecision] / N[(N[Sqrt[a], $MachinePrecision] * N[Sqrt[t$95$0], $MachinePrecision] + b), $MachinePrecision]), $MachinePrecision] / N[(a * 2.0), $MachinePrecision]), $MachinePrecision], N[(N[(-2.0 * N[(N[(N[Power[c, 3.0], $MachinePrecision] * N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision] / N[Power[b, 4.0], $MachinePrecision]), $MachinePrecision] + N[(N[(N[(-0.25 * N[(N[(N[Power[N[(a * c), $MachinePrecision], 4.0], $MachinePrecision] * N[(20.0 * N[Power[b, -6.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision] - N[(a * N[(N[(c / b), $MachinePrecision] * N[(c / b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - c), $MachinePrecision]), $MachinePrecision] / b), $MachinePrecision]]]
\begin{array}{l}

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

\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(-2, \frac{{c}^{3} \cdot {a}^{2}}{{b}^{4}}, \left(-0.25 \cdot \frac{{\left(a \cdot c\right)}^{4} \cdot \left(20 \cdot {b}^{-6}\right)}{a} - a \cdot \left(\frac{c}{b} \cdot \frac{c}{b}\right)\right) - c\right)}{b}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (/.f64 (+.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 #s(literal 4 binary64) a) c)))) (*.f64 #s(literal 2 binary64) a)) < -30

    1. Initial program 86.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. +-commutative86.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -30 < (/.f64 (+.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 #s(literal 4 binary64) a) c)))) (*.f64 #s(literal 2 binary64) a))

    1. Initial program 51.1%

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

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

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

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

        \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(-2, \frac{{c}^{3} \cdot {a}^{2}}{{b}^{4}}, \left(-0.25 \cdot \left(\frac{{a}^{4} \cdot {c}^{4}}{a} \cdot \frac{20}{{b}^{6}}\right) - \frac{a \cdot {c}^{2}}{{b}^{2}}\right) - c\right)}{b}} \]
      2. Step-by-step derivation
        1. associate-*l/94.3%

          \[\leadsto \frac{\mathsf{fma}\left(-2, \frac{{c}^{3} \cdot {a}^{2}}{{b}^{4}}, \left(-0.25 \cdot \color{blue}{\frac{\left({a}^{4} \cdot {c}^{4}\right) \cdot \frac{20}{{b}^{6}}}{a}} - \frac{a \cdot {c}^{2}}{{b}^{2}}\right) - c\right)}{b} \]
        2. pow-prod-down94.3%

          \[\leadsto \frac{\mathsf{fma}\left(-2, \frac{{c}^{3} \cdot {a}^{2}}{{b}^{4}}, \left(-0.25 \cdot \frac{\color{blue}{{\left(a \cdot c\right)}^{4}} \cdot \frac{20}{{b}^{6}}}{a} - \frac{a \cdot {c}^{2}}{{b}^{2}}\right) - c\right)}{b} \]
        3. div-inv94.3%

          \[\leadsto \frac{\mathsf{fma}\left(-2, \frac{{c}^{3} \cdot {a}^{2}}{{b}^{4}}, \left(-0.25 \cdot \frac{{\left(a \cdot c\right)}^{4} \cdot \color{blue}{\left(20 \cdot \frac{1}{{b}^{6}}\right)}}{a} - \frac{a \cdot {c}^{2}}{{b}^{2}}\right) - c\right)}{b} \]
        4. pow-flip94.3%

          \[\leadsto \frac{\mathsf{fma}\left(-2, \frac{{c}^{3} \cdot {a}^{2}}{{b}^{4}}, \left(-0.25 \cdot \frac{{\left(a \cdot c\right)}^{4} \cdot \left(20 \cdot \color{blue}{{b}^{\left(-6\right)}}\right)}{a} - \frac{a \cdot {c}^{2}}{{b}^{2}}\right) - c\right)}{b} \]
        5. metadata-eval94.3%

          \[\leadsto \frac{\mathsf{fma}\left(-2, \frac{{c}^{3} \cdot {a}^{2}}{{b}^{4}}, \left(-0.25 \cdot \frac{{\left(a \cdot c\right)}^{4} \cdot \left(20 \cdot {b}^{\color{blue}{-6}}\right)}{a} - \frac{a \cdot {c}^{2}}{{b}^{2}}\right) - c\right)}{b} \]
      3. Applied egg-rr94.3%

        \[\leadsto \frac{\mathsf{fma}\left(-2, \frac{{c}^{3} \cdot {a}^{2}}{{b}^{4}}, \left(-0.25 \cdot \color{blue}{\frac{{\left(a \cdot c\right)}^{4} \cdot \left(20 \cdot {b}^{-6}\right)}{a}} - \frac{a \cdot {c}^{2}}{{b}^{2}}\right) - c\right)}{b} \]
      4. Step-by-step derivation
        1. associate-/l*94.3%

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

        \[\leadsto \frac{\mathsf{fma}\left(-2, \frac{{c}^{3} \cdot {a}^{2}}{{b}^{4}}, \left(-0.25 \cdot \frac{{\left(a \cdot c\right)}^{4} \cdot \left(20 \cdot {b}^{-6}\right)}{a} - \color{blue}{a \cdot \frac{{c}^{2}}{{b}^{2}}}\right) - c\right)}{b} \]
      6. Step-by-step derivation
        1. unpow294.3%

          \[\leadsto \frac{\mathsf{fma}\left(-2, \frac{{c}^{3} \cdot {a}^{2}}{{b}^{4}}, \left(-0.25 \cdot \frac{{\left(a \cdot c\right)}^{4} \cdot \left(20 \cdot {b}^{-6}\right)}{a} - a \cdot \frac{\color{blue}{c \cdot c}}{{b}^{2}}\right) - c\right)}{b} \]
        2. unpow294.3%

          \[\leadsto \frac{\mathsf{fma}\left(-2, \frac{{c}^{3} \cdot {a}^{2}}{{b}^{4}}, \left(-0.25 \cdot \frac{{\left(a \cdot c\right)}^{4} \cdot \left(20 \cdot {b}^{-6}\right)}{a} - a \cdot \frac{c \cdot c}{\color{blue}{b \cdot b}}\right) - c\right)}{b} \]
        3. times-frac94.3%

          \[\leadsto \frac{\mathsf{fma}\left(-2, \frac{{c}^{3} \cdot {a}^{2}}{{b}^{4}}, \left(-0.25 \cdot \frac{{\left(a \cdot c\right)}^{4} \cdot \left(20 \cdot {b}^{-6}\right)}{a} - a \cdot \color{blue}{\left(\frac{c}{b} \cdot \frac{c}{b}\right)}\right) - c\right)}{b} \]
        4. sqr-neg94.3%

          \[\leadsto \frac{\mathsf{fma}\left(-2, \frac{{c}^{3} \cdot {a}^{2}}{{b}^{4}}, \left(-0.25 \cdot \frac{{\left(a \cdot c\right)}^{4} \cdot \left(20 \cdot {b}^{-6}\right)}{a} - a \cdot \color{blue}{\left(\left(-\frac{c}{b}\right) \cdot \left(-\frac{c}{b}\right)\right)}\right) - c\right)}{b} \]
        5. unpow294.3%

          \[\leadsto \frac{\mathsf{fma}\left(-2, \frac{{c}^{3} \cdot {a}^{2}}{{b}^{4}}, \left(-0.25 \cdot \frac{{\left(a \cdot c\right)}^{4} \cdot \left(20 \cdot {b}^{-6}\right)}{a} - a \cdot \color{blue}{{\left(-\frac{c}{b}\right)}^{2}}\right) - c\right)}{b} \]
        6. distribute-neg-frac294.3%

          \[\leadsto \frac{\mathsf{fma}\left(-2, \frac{{c}^{3} \cdot {a}^{2}}{{b}^{4}}, \left(-0.25 \cdot \frac{{\left(a \cdot c\right)}^{4} \cdot \left(20 \cdot {b}^{-6}\right)}{a} - a \cdot {\color{blue}{\left(\frac{c}{-b}\right)}}^{2}\right) - c\right)}{b} \]
      7. Simplified94.3%

        \[\leadsto \frac{\mathsf{fma}\left(-2, \frac{{c}^{3} \cdot {a}^{2}}{{b}^{4}}, \left(-0.25 \cdot \frac{{\left(a \cdot c\right)}^{4} \cdot \left(20 \cdot {b}^{-6}\right)}{a} - \color{blue}{a \cdot {\left(\frac{c}{-b}\right)}^{2}}\right) - c\right)}{b} \]
      8. Step-by-step derivation
        1. unpow294.3%

          \[\leadsto \frac{\mathsf{fma}\left(-2, \frac{{c}^{3} \cdot {a}^{2}}{{b}^{4}}, \left(-0.25 \cdot \frac{{\left(a \cdot c\right)}^{4} \cdot \left(20 \cdot {b}^{-6}\right)}{a} - a \cdot \color{blue}{\left(\frac{c}{-b} \cdot \frac{c}{-b}\right)}\right) - c\right)}{b} \]
      9. Applied egg-rr94.3%

        \[\leadsto \frac{\mathsf{fma}\left(-2, \frac{{c}^{3} \cdot {a}^{2}}{{b}^{4}}, \left(-0.25 \cdot \frac{{\left(a \cdot c\right)}^{4} \cdot \left(20 \cdot {b}^{-6}\right)}{a} - a \cdot \color{blue}{\left(\frac{c}{-b} \cdot \frac{c}{-b}\right)}\right) - c\right)}{b} \]
    7. Recombined 2 regimes into one program.
    8. Final simplification93.8%

      \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{\sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c} - b}{a \cdot 2} \leq -30:\\ \;\;\;\;\frac{\frac{\mathsf{fma}\left(a, \mathsf{fma}\left(c, -4, \frac{{b}^{2}}{a}\right), -{b}^{2}\right)}{\mathsf{fma}\left(\sqrt{a}, \sqrt{\mathsf{fma}\left(c, -4, \frac{{b}^{2}}{a}\right)}, b\right)}}{a \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;\frac{\mathsf{fma}\left(-2, \frac{{c}^{3} \cdot {a}^{2}}{{b}^{4}}, \left(-0.25 \cdot \frac{{\left(a \cdot c\right)}^{4} \cdot \left(20 \cdot {b}^{-6}\right)}{a} - a \cdot \left(\frac{c}{b} \cdot \frac{c}{b}\right)\right) - c\right)}{b}\\ \end{array} \]
    9. Add Preprocessing

    Alternative 2: 92.1% accurate, 0.1× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\frac{\sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c} - b}{a \cdot 2} \leq -30:\\ \;\;\;\;\frac{\frac{\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right) - {b}^{2}}{\mathsf{fma}\left(\sqrt{a}, \sqrt{\mathsf{fma}\left(c, -4, \frac{{b}^{2}}{a}\right)}, b\right)}}{a \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;\frac{\mathsf{fma}\left(-2, \frac{{c}^{3} \cdot {a}^{2}}{{b}^{4}}, \left(-0.25 \cdot \frac{{\left(a \cdot c\right)}^{4} \cdot \left(20 \cdot {b}^{-6}\right)}{a} - a \cdot \left(\frac{c}{b} \cdot \frac{c}{b}\right)\right) - c\right)}{b}\\ \end{array} \end{array} \]
    (FPCore (a b c)
     :precision binary64
     (if (<= (/ (- (sqrt (- (* b b) (* (* 4.0 a) c))) b) (* a 2.0)) -30.0)
       (/
        (/
         (- (fma a (* c -4.0) (pow b 2.0)) (pow b 2.0))
         (fma (sqrt a) (sqrt (fma c -4.0 (/ (pow b 2.0) a))) b))
        (* a 2.0))
       (/
        (fma
         -2.0
         (/ (* (pow c 3.0) (pow a 2.0)) (pow b 4.0))
         (-
          (-
           (* -0.25 (/ (* (pow (* a c) 4.0) (* 20.0 (pow b -6.0))) a))
           (* a (* (/ c b) (/ c b))))
          c))
        b)))
    double code(double a, double b, double c) {
    	double tmp;
    	if (((sqrt(((b * b) - ((4.0 * a) * c))) - b) / (a * 2.0)) <= -30.0) {
    		tmp = ((fma(a, (c * -4.0), pow(b, 2.0)) - pow(b, 2.0)) / fma(sqrt(a), sqrt(fma(c, -4.0, (pow(b, 2.0) / a))), b)) / (a * 2.0);
    	} else {
    		tmp = fma(-2.0, ((pow(c, 3.0) * pow(a, 2.0)) / pow(b, 4.0)), (((-0.25 * ((pow((a * c), 4.0) * (20.0 * pow(b, -6.0))) / a)) - (a * ((c / b) * (c / b)))) - c)) / b;
    	}
    	return tmp;
    }
    
    function code(a, b, c)
    	tmp = 0.0
    	if (Float64(Float64(sqrt(Float64(Float64(b * b) - Float64(Float64(4.0 * a) * c))) - b) / Float64(a * 2.0)) <= -30.0)
    		tmp = Float64(Float64(Float64(fma(a, Float64(c * -4.0), (b ^ 2.0)) - (b ^ 2.0)) / fma(sqrt(a), sqrt(fma(c, -4.0, Float64((b ^ 2.0) / a))), b)) / Float64(a * 2.0));
    	else
    		tmp = Float64(fma(-2.0, Float64(Float64((c ^ 3.0) * (a ^ 2.0)) / (b ^ 4.0)), Float64(Float64(Float64(-0.25 * Float64(Float64((Float64(a * c) ^ 4.0) * Float64(20.0 * (b ^ -6.0))) / a)) - Float64(a * Float64(Float64(c / b) * Float64(c / b)))) - c)) / b);
    	end
    	return tmp
    end
    
    code[a_, b_, c_] := If[LessEqual[N[(N[(N[Sqrt[N[(N[(b * b), $MachinePrecision] - N[(N[(4.0 * a), $MachinePrecision] * c), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision] / N[(a * 2.0), $MachinePrecision]), $MachinePrecision], -30.0], N[(N[(N[(N[(a * N[(c * -4.0), $MachinePrecision] + N[Power[b, 2.0], $MachinePrecision]), $MachinePrecision] - N[Power[b, 2.0], $MachinePrecision]), $MachinePrecision] / N[(N[Sqrt[a], $MachinePrecision] * N[Sqrt[N[(c * -4.0 + N[(N[Power[b, 2.0], $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] + b), $MachinePrecision]), $MachinePrecision] / N[(a * 2.0), $MachinePrecision]), $MachinePrecision], N[(N[(-2.0 * N[(N[(N[Power[c, 3.0], $MachinePrecision] * N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision] / N[Power[b, 4.0], $MachinePrecision]), $MachinePrecision] + N[(N[(N[(-0.25 * N[(N[(N[Power[N[(a * c), $MachinePrecision], 4.0], $MachinePrecision] * N[(20.0 * N[Power[b, -6.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision] - N[(a * N[(N[(c / b), $MachinePrecision] * N[(c / b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - c), $MachinePrecision]), $MachinePrecision] / b), $MachinePrecision]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    \mathbf{if}\;\frac{\sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c} - b}{a \cdot 2} \leq -30:\\
    \;\;\;\;\frac{\frac{\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right) - {b}^{2}}{\mathsf{fma}\left(\sqrt{a}, \sqrt{\mathsf{fma}\left(c, -4, \frac{{b}^{2}}{a}\right)}, b\right)}}{a \cdot 2}\\
    
    \mathbf{else}:\\
    \;\;\;\;\frac{\mathsf{fma}\left(-2, \frac{{c}^{3} \cdot {a}^{2}}{{b}^{4}}, \left(-0.25 \cdot \frac{{\left(a \cdot c\right)}^{4} \cdot \left(20 \cdot {b}^{-6}\right)}{a} - a \cdot \left(\frac{c}{b} \cdot \frac{c}{b}\right)\right) - c\right)}{b}\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if (/.f64 (+.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 #s(literal 4 binary64) a) c)))) (*.f64 #s(literal 2 binary64) a)) < -30

      1. Initial program 86.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. +-commutative86.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      if -30 < (/.f64 (+.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 #s(literal 4 binary64) a) c)))) (*.f64 #s(literal 2 binary64) a))

      1. Initial program 51.1%

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

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

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

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

          \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(-2, \frac{{c}^{3} \cdot {a}^{2}}{{b}^{4}}, \left(-0.25 \cdot \left(\frac{{a}^{4} \cdot {c}^{4}}{a} \cdot \frac{20}{{b}^{6}}\right) - \frac{a \cdot {c}^{2}}{{b}^{2}}\right) - c\right)}{b}} \]
        2. Step-by-step derivation
          1. associate-*l/94.3%

            \[\leadsto \frac{\mathsf{fma}\left(-2, \frac{{c}^{3} \cdot {a}^{2}}{{b}^{4}}, \left(-0.25 \cdot \color{blue}{\frac{\left({a}^{4} \cdot {c}^{4}\right) \cdot \frac{20}{{b}^{6}}}{a}} - \frac{a \cdot {c}^{2}}{{b}^{2}}\right) - c\right)}{b} \]
          2. pow-prod-down94.3%

            \[\leadsto \frac{\mathsf{fma}\left(-2, \frac{{c}^{3} \cdot {a}^{2}}{{b}^{4}}, \left(-0.25 \cdot \frac{\color{blue}{{\left(a \cdot c\right)}^{4}} \cdot \frac{20}{{b}^{6}}}{a} - \frac{a \cdot {c}^{2}}{{b}^{2}}\right) - c\right)}{b} \]
          3. div-inv94.3%

            \[\leadsto \frac{\mathsf{fma}\left(-2, \frac{{c}^{3} \cdot {a}^{2}}{{b}^{4}}, \left(-0.25 \cdot \frac{{\left(a \cdot c\right)}^{4} \cdot \color{blue}{\left(20 \cdot \frac{1}{{b}^{6}}\right)}}{a} - \frac{a \cdot {c}^{2}}{{b}^{2}}\right) - c\right)}{b} \]
          4. pow-flip94.3%

            \[\leadsto \frac{\mathsf{fma}\left(-2, \frac{{c}^{3} \cdot {a}^{2}}{{b}^{4}}, \left(-0.25 \cdot \frac{{\left(a \cdot c\right)}^{4} \cdot \left(20 \cdot \color{blue}{{b}^{\left(-6\right)}}\right)}{a} - \frac{a \cdot {c}^{2}}{{b}^{2}}\right) - c\right)}{b} \]
          5. metadata-eval94.3%

            \[\leadsto \frac{\mathsf{fma}\left(-2, \frac{{c}^{3} \cdot {a}^{2}}{{b}^{4}}, \left(-0.25 \cdot \frac{{\left(a \cdot c\right)}^{4} \cdot \left(20 \cdot {b}^{\color{blue}{-6}}\right)}{a} - \frac{a \cdot {c}^{2}}{{b}^{2}}\right) - c\right)}{b} \]
        3. Applied egg-rr94.3%

          \[\leadsto \frac{\mathsf{fma}\left(-2, \frac{{c}^{3} \cdot {a}^{2}}{{b}^{4}}, \left(-0.25 \cdot \color{blue}{\frac{{\left(a \cdot c\right)}^{4} \cdot \left(20 \cdot {b}^{-6}\right)}{a}} - \frac{a \cdot {c}^{2}}{{b}^{2}}\right) - c\right)}{b} \]
        4. Step-by-step derivation
          1. associate-/l*94.3%

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

          \[\leadsto \frac{\mathsf{fma}\left(-2, \frac{{c}^{3} \cdot {a}^{2}}{{b}^{4}}, \left(-0.25 \cdot \frac{{\left(a \cdot c\right)}^{4} \cdot \left(20 \cdot {b}^{-6}\right)}{a} - \color{blue}{a \cdot \frac{{c}^{2}}{{b}^{2}}}\right) - c\right)}{b} \]
        6. Step-by-step derivation
          1. unpow294.3%

            \[\leadsto \frac{\mathsf{fma}\left(-2, \frac{{c}^{3} \cdot {a}^{2}}{{b}^{4}}, \left(-0.25 \cdot \frac{{\left(a \cdot c\right)}^{4} \cdot \left(20 \cdot {b}^{-6}\right)}{a} - a \cdot \frac{\color{blue}{c \cdot c}}{{b}^{2}}\right) - c\right)}{b} \]
          2. unpow294.3%

            \[\leadsto \frac{\mathsf{fma}\left(-2, \frac{{c}^{3} \cdot {a}^{2}}{{b}^{4}}, \left(-0.25 \cdot \frac{{\left(a \cdot c\right)}^{4} \cdot \left(20 \cdot {b}^{-6}\right)}{a} - a \cdot \frac{c \cdot c}{\color{blue}{b \cdot b}}\right) - c\right)}{b} \]
          3. times-frac94.3%

            \[\leadsto \frac{\mathsf{fma}\left(-2, \frac{{c}^{3} \cdot {a}^{2}}{{b}^{4}}, \left(-0.25 \cdot \frac{{\left(a \cdot c\right)}^{4} \cdot \left(20 \cdot {b}^{-6}\right)}{a} - a \cdot \color{blue}{\left(\frac{c}{b} \cdot \frac{c}{b}\right)}\right) - c\right)}{b} \]
          4. sqr-neg94.3%

            \[\leadsto \frac{\mathsf{fma}\left(-2, \frac{{c}^{3} \cdot {a}^{2}}{{b}^{4}}, \left(-0.25 \cdot \frac{{\left(a \cdot c\right)}^{4} \cdot \left(20 \cdot {b}^{-6}\right)}{a} - a \cdot \color{blue}{\left(\left(-\frac{c}{b}\right) \cdot \left(-\frac{c}{b}\right)\right)}\right) - c\right)}{b} \]
          5. unpow294.3%

            \[\leadsto \frac{\mathsf{fma}\left(-2, \frac{{c}^{3} \cdot {a}^{2}}{{b}^{4}}, \left(-0.25 \cdot \frac{{\left(a \cdot c\right)}^{4} \cdot \left(20 \cdot {b}^{-6}\right)}{a} - a \cdot \color{blue}{{\left(-\frac{c}{b}\right)}^{2}}\right) - c\right)}{b} \]
          6. distribute-neg-frac294.3%

            \[\leadsto \frac{\mathsf{fma}\left(-2, \frac{{c}^{3} \cdot {a}^{2}}{{b}^{4}}, \left(-0.25 \cdot \frac{{\left(a \cdot c\right)}^{4} \cdot \left(20 \cdot {b}^{-6}\right)}{a} - a \cdot {\color{blue}{\left(\frac{c}{-b}\right)}}^{2}\right) - c\right)}{b} \]
        7. Simplified94.3%

          \[\leadsto \frac{\mathsf{fma}\left(-2, \frac{{c}^{3} \cdot {a}^{2}}{{b}^{4}}, \left(-0.25 \cdot \frac{{\left(a \cdot c\right)}^{4} \cdot \left(20 \cdot {b}^{-6}\right)}{a} - \color{blue}{a \cdot {\left(\frac{c}{-b}\right)}^{2}}\right) - c\right)}{b} \]
        8. Step-by-step derivation
          1. unpow294.3%

            \[\leadsto \frac{\mathsf{fma}\left(-2, \frac{{c}^{3} \cdot {a}^{2}}{{b}^{4}}, \left(-0.25 \cdot \frac{{\left(a \cdot c\right)}^{4} \cdot \left(20 \cdot {b}^{-6}\right)}{a} - a \cdot \color{blue}{\left(\frac{c}{-b} \cdot \frac{c}{-b}\right)}\right) - c\right)}{b} \]
        9. Applied egg-rr94.3%

          \[\leadsto \frac{\mathsf{fma}\left(-2, \frac{{c}^{3} \cdot {a}^{2}}{{b}^{4}}, \left(-0.25 \cdot \frac{{\left(a \cdot c\right)}^{4} \cdot \left(20 \cdot {b}^{-6}\right)}{a} - a \cdot \color{blue}{\left(\frac{c}{-b} \cdot \frac{c}{-b}\right)}\right) - c\right)}{b} \]
      7. Recombined 2 regimes into one program.
      8. Final simplification93.7%

        \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{\sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c} - b}{a \cdot 2} \leq -30:\\ \;\;\;\;\frac{\frac{\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right) - {b}^{2}}{\mathsf{fma}\left(\sqrt{a}, \sqrt{\mathsf{fma}\left(c, -4, \frac{{b}^{2}}{a}\right)}, b\right)}}{a \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;\frac{\mathsf{fma}\left(-2, \frac{{c}^{3} \cdot {a}^{2}}{{b}^{4}}, \left(-0.25 \cdot \frac{{\left(a \cdot c\right)}^{4} \cdot \left(20 \cdot {b}^{-6}\right)}{a} - a \cdot \left(\frac{c}{b} \cdot \frac{c}{b}\right)\right) - c\right)}{b}\\ \end{array} \]
      9. Add Preprocessing

      Alternative 3: 92.0% accurate, 0.2× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\frac{\sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c} - b}{a \cdot 2} \leq -30:\\ \;\;\;\;\frac{\sqrt{\mathsf{fma}\left(b, b, c \cdot \left(a \cdot -4\right)\right)} - b}{a \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;\frac{\mathsf{fma}\left(-2, \frac{{c}^{3} \cdot {a}^{2}}{{b}^{4}}, \left(-0.25 \cdot \frac{{\left(a \cdot c\right)}^{4} \cdot \left(20 \cdot {b}^{-6}\right)}{a} - a \cdot \left(\frac{c}{b} \cdot \frac{c}{b}\right)\right) - c\right)}{b}\\ \end{array} \end{array} \]
      (FPCore (a b c)
       :precision binary64
       (if (<= (/ (- (sqrt (- (* b b) (* (* 4.0 a) c))) b) (* a 2.0)) -30.0)
         (/ (- (sqrt (fma b b (* c (* a -4.0)))) b) (* a 2.0))
         (/
          (fma
           -2.0
           (/ (* (pow c 3.0) (pow a 2.0)) (pow b 4.0))
           (-
            (-
             (* -0.25 (/ (* (pow (* a c) 4.0) (* 20.0 (pow b -6.0))) a))
             (* a (* (/ c b) (/ c b))))
            c))
          b)))
      double code(double a, double b, double c) {
      	double tmp;
      	if (((sqrt(((b * b) - ((4.0 * a) * c))) - b) / (a * 2.0)) <= -30.0) {
      		tmp = (sqrt(fma(b, b, (c * (a * -4.0)))) - b) / (a * 2.0);
      	} else {
      		tmp = fma(-2.0, ((pow(c, 3.0) * pow(a, 2.0)) / pow(b, 4.0)), (((-0.25 * ((pow((a * c), 4.0) * (20.0 * pow(b, -6.0))) / a)) - (a * ((c / b) * (c / b)))) - c)) / b;
      	}
      	return tmp;
      }
      
      function code(a, b, c)
      	tmp = 0.0
      	if (Float64(Float64(sqrt(Float64(Float64(b * b) - Float64(Float64(4.0 * a) * c))) - b) / Float64(a * 2.0)) <= -30.0)
      		tmp = Float64(Float64(sqrt(fma(b, b, Float64(c * Float64(a * -4.0)))) - b) / Float64(a * 2.0));
      	else
      		tmp = Float64(fma(-2.0, Float64(Float64((c ^ 3.0) * (a ^ 2.0)) / (b ^ 4.0)), Float64(Float64(Float64(-0.25 * Float64(Float64((Float64(a * c) ^ 4.0) * Float64(20.0 * (b ^ -6.0))) / a)) - Float64(a * Float64(Float64(c / b) * Float64(c / b)))) - c)) / b);
      	end
      	return tmp
      end
      
      code[a_, b_, c_] := If[LessEqual[N[(N[(N[Sqrt[N[(N[(b * b), $MachinePrecision] - N[(N[(4.0 * a), $MachinePrecision] * c), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision] / N[(a * 2.0), $MachinePrecision]), $MachinePrecision], -30.0], N[(N[(N[Sqrt[N[(b * b + N[(c * N[(a * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision] / N[(a * 2.0), $MachinePrecision]), $MachinePrecision], N[(N[(-2.0 * N[(N[(N[Power[c, 3.0], $MachinePrecision] * N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision] / N[Power[b, 4.0], $MachinePrecision]), $MachinePrecision] + N[(N[(N[(-0.25 * N[(N[(N[Power[N[(a * c), $MachinePrecision], 4.0], $MachinePrecision] * N[(20.0 * N[Power[b, -6.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision] - N[(a * N[(N[(c / b), $MachinePrecision] * N[(c / b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - c), $MachinePrecision]), $MachinePrecision] / b), $MachinePrecision]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      \mathbf{if}\;\frac{\sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c} - b}{a \cdot 2} \leq -30:\\
      \;\;\;\;\frac{\sqrt{\mathsf{fma}\left(b, b, c \cdot \left(a \cdot -4\right)\right)} - b}{a \cdot 2}\\
      
      \mathbf{else}:\\
      \;\;\;\;\frac{\mathsf{fma}\left(-2, \frac{{c}^{3} \cdot {a}^{2}}{{b}^{4}}, \left(-0.25 \cdot \frac{{\left(a \cdot c\right)}^{4} \cdot \left(20 \cdot {b}^{-6}\right)}{a} - a \cdot \left(\frac{c}{b} \cdot \frac{c}{b}\right)\right) - c\right)}{b}\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if (/.f64 (+.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 #s(literal 4 binary64) a) c)))) (*.f64 #s(literal 2 binary64) a)) < -30

        1. Initial program 86.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. *-commutative86.9%

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

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

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

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

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

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

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

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

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

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

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

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

        if -30 < (/.f64 (+.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 #s(literal 4 binary64) a) c)))) (*.f64 #s(literal 2 binary64) a))

        1. Initial program 51.1%

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

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

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

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

            \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(-2, \frac{{c}^{3} \cdot {a}^{2}}{{b}^{4}}, \left(-0.25 \cdot \left(\frac{{a}^{4} \cdot {c}^{4}}{a} \cdot \frac{20}{{b}^{6}}\right) - \frac{a \cdot {c}^{2}}{{b}^{2}}\right) - c\right)}{b}} \]
          2. Step-by-step derivation
            1. associate-*l/94.3%

              \[\leadsto \frac{\mathsf{fma}\left(-2, \frac{{c}^{3} \cdot {a}^{2}}{{b}^{4}}, \left(-0.25 \cdot \color{blue}{\frac{\left({a}^{4} \cdot {c}^{4}\right) \cdot \frac{20}{{b}^{6}}}{a}} - \frac{a \cdot {c}^{2}}{{b}^{2}}\right) - c\right)}{b} \]
            2. pow-prod-down94.3%

              \[\leadsto \frac{\mathsf{fma}\left(-2, \frac{{c}^{3} \cdot {a}^{2}}{{b}^{4}}, \left(-0.25 \cdot \frac{\color{blue}{{\left(a \cdot c\right)}^{4}} \cdot \frac{20}{{b}^{6}}}{a} - \frac{a \cdot {c}^{2}}{{b}^{2}}\right) - c\right)}{b} \]
            3. div-inv94.3%

              \[\leadsto \frac{\mathsf{fma}\left(-2, \frac{{c}^{3} \cdot {a}^{2}}{{b}^{4}}, \left(-0.25 \cdot \frac{{\left(a \cdot c\right)}^{4} \cdot \color{blue}{\left(20 \cdot \frac{1}{{b}^{6}}\right)}}{a} - \frac{a \cdot {c}^{2}}{{b}^{2}}\right) - c\right)}{b} \]
            4. pow-flip94.3%

              \[\leadsto \frac{\mathsf{fma}\left(-2, \frac{{c}^{3} \cdot {a}^{2}}{{b}^{4}}, \left(-0.25 \cdot \frac{{\left(a \cdot c\right)}^{4} \cdot \left(20 \cdot \color{blue}{{b}^{\left(-6\right)}}\right)}{a} - \frac{a \cdot {c}^{2}}{{b}^{2}}\right) - c\right)}{b} \]
            5. metadata-eval94.3%

              \[\leadsto \frac{\mathsf{fma}\left(-2, \frac{{c}^{3} \cdot {a}^{2}}{{b}^{4}}, \left(-0.25 \cdot \frac{{\left(a \cdot c\right)}^{4} \cdot \left(20 \cdot {b}^{\color{blue}{-6}}\right)}{a} - \frac{a \cdot {c}^{2}}{{b}^{2}}\right) - c\right)}{b} \]
          3. Applied egg-rr94.3%

            \[\leadsto \frac{\mathsf{fma}\left(-2, \frac{{c}^{3} \cdot {a}^{2}}{{b}^{4}}, \left(-0.25 \cdot \color{blue}{\frac{{\left(a \cdot c\right)}^{4} \cdot \left(20 \cdot {b}^{-6}\right)}{a}} - \frac{a \cdot {c}^{2}}{{b}^{2}}\right) - c\right)}{b} \]
          4. Step-by-step derivation
            1. associate-/l*94.3%

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

            \[\leadsto \frac{\mathsf{fma}\left(-2, \frac{{c}^{3} \cdot {a}^{2}}{{b}^{4}}, \left(-0.25 \cdot \frac{{\left(a \cdot c\right)}^{4} \cdot \left(20 \cdot {b}^{-6}\right)}{a} - \color{blue}{a \cdot \frac{{c}^{2}}{{b}^{2}}}\right) - c\right)}{b} \]
          6. Step-by-step derivation
            1. unpow294.3%

              \[\leadsto \frac{\mathsf{fma}\left(-2, \frac{{c}^{3} \cdot {a}^{2}}{{b}^{4}}, \left(-0.25 \cdot \frac{{\left(a \cdot c\right)}^{4} \cdot \left(20 \cdot {b}^{-6}\right)}{a} - a \cdot \frac{\color{blue}{c \cdot c}}{{b}^{2}}\right) - c\right)}{b} \]
            2. unpow294.3%

              \[\leadsto \frac{\mathsf{fma}\left(-2, \frac{{c}^{3} \cdot {a}^{2}}{{b}^{4}}, \left(-0.25 \cdot \frac{{\left(a \cdot c\right)}^{4} \cdot \left(20 \cdot {b}^{-6}\right)}{a} - a \cdot \frac{c \cdot c}{\color{blue}{b \cdot b}}\right) - c\right)}{b} \]
            3. times-frac94.3%

              \[\leadsto \frac{\mathsf{fma}\left(-2, \frac{{c}^{3} \cdot {a}^{2}}{{b}^{4}}, \left(-0.25 \cdot \frac{{\left(a \cdot c\right)}^{4} \cdot \left(20 \cdot {b}^{-6}\right)}{a} - a \cdot \color{blue}{\left(\frac{c}{b} \cdot \frac{c}{b}\right)}\right) - c\right)}{b} \]
            4. sqr-neg94.3%

              \[\leadsto \frac{\mathsf{fma}\left(-2, \frac{{c}^{3} \cdot {a}^{2}}{{b}^{4}}, \left(-0.25 \cdot \frac{{\left(a \cdot c\right)}^{4} \cdot \left(20 \cdot {b}^{-6}\right)}{a} - a \cdot \color{blue}{\left(\left(-\frac{c}{b}\right) \cdot \left(-\frac{c}{b}\right)\right)}\right) - c\right)}{b} \]
            5. unpow294.3%

              \[\leadsto \frac{\mathsf{fma}\left(-2, \frac{{c}^{3} \cdot {a}^{2}}{{b}^{4}}, \left(-0.25 \cdot \frac{{\left(a \cdot c\right)}^{4} \cdot \left(20 \cdot {b}^{-6}\right)}{a} - a \cdot \color{blue}{{\left(-\frac{c}{b}\right)}^{2}}\right) - c\right)}{b} \]
            6. distribute-neg-frac294.3%

              \[\leadsto \frac{\mathsf{fma}\left(-2, \frac{{c}^{3} \cdot {a}^{2}}{{b}^{4}}, \left(-0.25 \cdot \frac{{\left(a \cdot c\right)}^{4} \cdot \left(20 \cdot {b}^{-6}\right)}{a} - a \cdot {\color{blue}{\left(\frac{c}{-b}\right)}}^{2}\right) - c\right)}{b} \]
          7. Simplified94.3%

            \[\leadsto \frac{\mathsf{fma}\left(-2, \frac{{c}^{3} \cdot {a}^{2}}{{b}^{4}}, \left(-0.25 \cdot \frac{{\left(a \cdot c\right)}^{4} \cdot \left(20 \cdot {b}^{-6}\right)}{a} - \color{blue}{a \cdot {\left(\frac{c}{-b}\right)}^{2}}\right) - c\right)}{b} \]
          8. Step-by-step derivation
            1. unpow294.3%

              \[\leadsto \frac{\mathsf{fma}\left(-2, \frac{{c}^{3} \cdot {a}^{2}}{{b}^{4}}, \left(-0.25 \cdot \frac{{\left(a \cdot c\right)}^{4} \cdot \left(20 \cdot {b}^{-6}\right)}{a} - a \cdot \color{blue}{\left(\frac{c}{-b} \cdot \frac{c}{-b}\right)}\right) - c\right)}{b} \]
          9. Applied egg-rr94.3%

            \[\leadsto \frac{\mathsf{fma}\left(-2, \frac{{c}^{3} \cdot {a}^{2}}{{b}^{4}}, \left(-0.25 \cdot \frac{{\left(a \cdot c\right)}^{4} \cdot \left(20 \cdot {b}^{-6}\right)}{a} - a \cdot \color{blue}{\left(\frac{c}{-b} \cdot \frac{c}{-b}\right)}\right) - c\right)}{b} \]
        7. Recombined 2 regimes into one program.
        8. Final simplification93.6%

          \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{\sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c} - b}{a \cdot 2} \leq -30:\\ \;\;\;\;\frac{\sqrt{\mathsf{fma}\left(b, b, c \cdot \left(a \cdot -4\right)\right)} - b}{a \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;\frac{\mathsf{fma}\left(-2, \frac{{c}^{3} \cdot {a}^{2}}{{b}^{4}}, \left(-0.25 \cdot \frac{{\left(a \cdot c\right)}^{4} \cdot \left(20 \cdot {b}^{-6}\right)}{a} - a \cdot \left(\frac{c}{b} \cdot \frac{c}{b}\right)\right) - c\right)}{b}\\ \end{array} \]
        9. Add Preprocessing

        Alternative 4: 89.5% accurate, 0.2× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\frac{\sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c} - b}{a \cdot 2} \leq -30:\\ \;\;\;\;\frac{\sqrt{\mathsf{fma}\left(b, b, c \cdot \left(a \cdot -4\right)\right)} - b}{a \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;a \cdot \left(-2 \cdot \left(a \cdot \frac{{c}^{3}}{{b}^{5}}\right) - \frac{{c}^{2}}{{b}^{3}}\right) - \frac{c}{b}\\ \end{array} \end{array} \]
        (FPCore (a b c)
         :precision binary64
         (if (<= (/ (- (sqrt (- (* b b) (* (* 4.0 a) c))) b) (* a 2.0)) -30.0)
           (/ (- (sqrt (fma b b (* c (* a -4.0)))) b) (* a 2.0))
           (-
            (*
             a
             (-
              (* -2.0 (* a (/ (pow c 3.0) (pow b 5.0))))
              (/ (pow c 2.0) (pow b 3.0))))
            (/ c b))))
        double code(double a, double b, double c) {
        	double tmp;
        	if (((sqrt(((b * b) - ((4.0 * a) * c))) - b) / (a * 2.0)) <= -30.0) {
        		tmp = (sqrt(fma(b, b, (c * (a * -4.0)))) - b) / (a * 2.0);
        	} else {
        		tmp = (a * ((-2.0 * (a * (pow(c, 3.0) / pow(b, 5.0)))) - (pow(c, 2.0) / pow(b, 3.0)))) - (c / b);
        	}
        	return tmp;
        }
        
        function code(a, b, c)
        	tmp = 0.0
        	if (Float64(Float64(sqrt(Float64(Float64(b * b) - Float64(Float64(4.0 * a) * c))) - b) / Float64(a * 2.0)) <= -30.0)
        		tmp = Float64(Float64(sqrt(fma(b, b, Float64(c * Float64(a * -4.0)))) - b) / Float64(a * 2.0));
        	else
        		tmp = Float64(Float64(a * Float64(Float64(-2.0 * Float64(a * Float64((c ^ 3.0) / (b ^ 5.0)))) - Float64((c ^ 2.0) / (b ^ 3.0)))) - Float64(c / b));
        	end
        	return tmp
        end
        
        code[a_, b_, c_] := If[LessEqual[N[(N[(N[Sqrt[N[(N[(b * b), $MachinePrecision] - N[(N[(4.0 * a), $MachinePrecision] * c), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision] / N[(a * 2.0), $MachinePrecision]), $MachinePrecision], -30.0], N[(N[(N[Sqrt[N[(b * b + N[(c * N[(a * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision] / N[(a * 2.0), $MachinePrecision]), $MachinePrecision], N[(N[(a * N[(N[(-2.0 * N[(a * N[(N[Power[c, 3.0], $MachinePrecision] / N[Power[b, 5.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[Power[c, 2.0], $MachinePrecision] / N[Power[b, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(c / b), $MachinePrecision]), $MachinePrecision]]
        
        \begin{array}{l}
        
        \\
        \begin{array}{l}
        \mathbf{if}\;\frac{\sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c} - b}{a \cdot 2} \leq -30:\\
        \;\;\;\;\frac{\sqrt{\mathsf{fma}\left(b, b, c \cdot \left(a \cdot -4\right)\right)} - b}{a \cdot 2}\\
        
        \mathbf{else}:\\
        \;\;\;\;a \cdot \left(-2 \cdot \left(a \cdot \frac{{c}^{3}}{{b}^{5}}\right) - \frac{{c}^{2}}{{b}^{3}}\right) - \frac{c}{b}\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 2 regimes
        2. if (/.f64 (+.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 #s(literal 4 binary64) a) c)))) (*.f64 #s(literal 2 binary64) a)) < -30

          1. Initial program 86.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. *-commutative86.9%

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

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

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

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

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

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

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

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

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

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

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

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

          if -30 < (/.f64 (+.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 #s(literal 4 binary64) a) c)))) (*.f64 #s(literal 2 binary64) a))

          1. Initial program 51.1%

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

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

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

            \[\leadsto \color{blue}{-1 \cdot \frac{c}{b} + a \cdot \left(-2 \cdot \frac{a \cdot {c}^{3}}{{b}^{5}} + -1 \cdot \frac{{c}^{2}}{{b}^{3}}\right)} \]
          6. Step-by-step derivation
            1. +-commutative91.9%

              \[\leadsto \color{blue}{a \cdot \left(-2 \cdot \frac{a \cdot {c}^{3}}{{b}^{5}} + -1 \cdot \frac{{c}^{2}}{{b}^{3}}\right) + -1 \cdot \frac{c}{b}} \]
            2. mul-1-neg91.9%

              \[\leadsto a \cdot \left(-2 \cdot \frac{a \cdot {c}^{3}}{{b}^{5}} + -1 \cdot \frac{{c}^{2}}{{b}^{3}}\right) + \color{blue}{\left(-\frac{c}{b}\right)} \]
            3. unsub-neg91.9%

              \[\leadsto \color{blue}{a \cdot \left(-2 \cdot \frac{a \cdot {c}^{3}}{{b}^{5}} + -1 \cdot \frac{{c}^{2}}{{b}^{3}}\right) - \frac{c}{b}} \]
            4. mul-1-neg91.9%

              \[\leadsto a \cdot \left(-2 \cdot \frac{a \cdot {c}^{3}}{{b}^{5}} + \color{blue}{\left(-\frac{{c}^{2}}{{b}^{3}}\right)}\right) - \frac{c}{b} \]
            5. unsub-neg91.9%

              \[\leadsto a \cdot \color{blue}{\left(-2 \cdot \frac{a \cdot {c}^{3}}{{b}^{5}} - \frac{{c}^{2}}{{b}^{3}}\right)} - \frac{c}{b} \]
            6. associate-/l*91.9%

              \[\leadsto a \cdot \left(-2 \cdot \color{blue}{\left(a \cdot \frac{{c}^{3}}{{b}^{5}}\right)} - \frac{{c}^{2}}{{b}^{3}}\right) - \frac{c}{b} \]
          7. Simplified91.9%

            \[\leadsto \color{blue}{a \cdot \left(-2 \cdot \left(a \cdot \frac{{c}^{3}}{{b}^{5}}\right) - \frac{{c}^{2}}{{b}^{3}}\right) - \frac{c}{b}} \]
        3. Recombined 2 regimes into one program.
        4. Final simplification91.5%

          \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{\sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c} - b}{a \cdot 2} \leq -30:\\ \;\;\;\;\frac{\sqrt{\mathsf{fma}\left(b, b, c \cdot \left(a \cdot -4\right)\right)} - b}{a \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;a \cdot \left(-2 \cdot \left(a \cdot \frac{{c}^{3}}{{b}^{5}}\right) - \frac{{c}^{2}}{{b}^{3}}\right) - \frac{c}{b}\\ \end{array} \]
        5. Add Preprocessing

        Alternative 5: 89.4% accurate, 0.3× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\frac{\sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c} - b}{a \cdot 2} \leq -30:\\ \;\;\;\;\frac{\sqrt{\mathsf{fma}\left(b, b, c \cdot \left(a \cdot -4\right)\right)} - b}{a \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;c \cdot \left(c \cdot \left(-2 \cdot \frac{c \cdot {a}^{2}}{{b}^{5}} - \frac{a}{{b}^{3}}\right) + \frac{-1}{b}\right)\\ \end{array} \end{array} \]
        (FPCore (a b c)
         :precision binary64
         (if (<= (/ (- (sqrt (- (* b b) (* (* 4.0 a) c))) b) (* a 2.0)) -30.0)
           (/ (- (sqrt (fma b b (* c (* a -4.0)))) b) (* a 2.0))
           (*
            c
            (+
             (* c (- (* -2.0 (/ (* c (pow a 2.0)) (pow b 5.0))) (/ a (pow b 3.0))))
             (/ -1.0 b)))))
        double code(double a, double b, double c) {
        	double tmp;
        	if (((sqrt(((b * b) - ((4.0 * a) * c))) - b) / (a * 2.0)) <= -30.0) {
        		tmp = (sqrt(fma(b, b, (c * (a * -4.0)))) - b) / (a * 2.0);
        	} else {
        		tmp = c * ((c * ((-2.0 * ((c * pow(a, 2.0)) / pow(b, 5.0))) - (a / pow(b, 3.0)))) + (-1.0 / b));
        	}
        	return tmp;
        }
        
        function code(a, b, c)
        	tmp = 0.0
        	if (Float64(Float64(sqrt(Float64(Float64(b * b) - Float64(Float64(4.0 * a) * c))) - b) / Float64(a * 2.0)) <= -30.0)
        		tmp = Float64(Float64(sqrt(fma(b, b, Float64(c * Float64(a * -4.0)))) - b) / Float64(a * 2.0));
        	else
        		tmp = Float64(c * Float64(Float64(c * Float64(Float64(-2.0 * Float64(Float64(c * (a ^ 2.0)) / (b ^ 5.0))) - Float64(a / (b ^ 3.0)))) + Float64(-1.0 / b)));
        	end
        	return tmp
        end
        
        code[a_, b_, c_] := If[LessEqual[N[(N[(N[Sqrt[N[(N[(b * b), $MachinePrecision] - N[(N[(4.0 * a), $MachinePrecision] * c), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision] / N[(a * 2.0), $MachinePrecision]), $MachinePrecision], -30.0], N[(N[(N[Sqrt[N[(b * b + N[(c * N[(a * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision] / N[(a * 2.0), $MachinePrecision]), $MachinePrecision], N[(c * N[(N[(c * N[(N[(-2.0 * N[(N[(c * N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision] / N[Power[b, 5.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(a / N[Power[b, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(-1.0 / b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
        
        \begin{array}{l}
        
        \\
        \begin{array}{l}
        \mathbf{if}\;\frac{\sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c} - b}{a \cdot 2} \leq -30:\\
        \;\;\;\;\frac{\sqrt{\mathsf{fma}\left(b, b, c \cdot \left(a \cdot -4\right)\right)} - b}{a \cdot 2}\\
        
        \mathbf{else}:\\
        \;\;\;\;c \cdot \left(c \cdot \left(-2 \cdot \frac{c \cdot {a}^{2}}{{b}^{5}} - \frac{a}{{b}^{3}}\right) + \frac{-1}{b}\right)\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 2 regimes
        2. if (/.f64 (+.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 #s(literal 4 binary64) a) c)))) (*.f64 #s(literal 2 binary64) a)) < -30

          1. Initial program 86.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. *-commutative86.9%

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

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

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

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

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

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

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

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

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

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

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

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

          if -30 < (/.f64 (+.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 #s(literal 4 binary64) a) c)))) (*.f64 #s(literal 2 binary64) a))

          1. Initial program 51.1%

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

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

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

            \[\leadsto \color{blue}{c \cdot \left(c \cdot \left(-2 \cdot \frac{{a}^{2} \cdot c}{{b}^{5}} + -1 \cdot \frac{a}{{b}^{3}}\right) - \frac{1}{b}\right)} \]
        3. Recombined 2 regimes into one program.
        4. Final simplification91.4%

          \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{\sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c} - b}{a \cdot 2} \leq -30:\\ \;\;\;\;\frac{\sqrt{\mathsf{fma}\left(b, b, c \cdot \left(a \cdot -4\right)\right)} - b}{a \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;c \cdot \left(c \cdot \left(-2 \cdot \frac{c \cdot {a}^{2}}{{b}^{5}} - \frac{a}{{b}^{3}}\right) + \frac{-1}{b}\right)\\ \end{array} \]
        5. Add Preprocessing

        Alternative 6: 85.6% accurate, 0.3× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\frac{\sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c} - b}{a \cdot 2} \leq -0.014:\\ \;\;\;\;\frac{\sqrt{\mathsf{fma}\left(b, b, c \cdot \left(a \cdot -4\right)\right)} - b}{a \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;a \cdot \frac{c \cdot \left(-c\right)}{{b}^{3}} - \frac{c}{b}\\ \end{array} \end{array} \]
        (FPCore (a b c)
         :precision binary64
         (if (<= (/ (- (sqrt (- (* b b) (* (* 4.0 a) c))) b) (* a 2.0)) -0.014)
           (/ (- (sqrt (fma b b (* c (* a -4.0)))) b) (* a 2.0))
           (- (* a (/ (* c (- c)) (pow b 3.0))) (/ c b))))
        double code(double a, double b, double c) {
        	double tmp;
        	if (((sqrt(((b * b) - ((4.0 * a) * c))) - b) / (a * 2.0)) <= -0.014) {
        		tmp = (sqrt(fma(b, b, (c * (a * -4.0)))) - b) / (a * 2.0);
        	} else {
        		tmp = (a * ((c * -c) / pow(b, 3.0))) - (c / b);
        	}
        	return tmp;
        }
        
        function code(a, b, c)
        	tmp = 0.0
        	if (Float64(Float64(sqrt(Float64(Float64(b * b) - Float64(Float64(4.0 * a) * c))) - b) / Float64(a * 2.0)) <= -0.014)
        		tmp = Float64(Float64(sqrt(fma(b, b, Float64(c * Float64(a * -4.0)))) - b) / Float64(a * 2.0));
        	else
        		tmp = Float64(Float64(a * Float64(Float64(c * Float64(-c)) / (b ^ 3.0))) - Float64(c / b));
        	end
        	return tmp
        end
        
        code[a_, b_, c_] := If[LessEqual[N[(N[(N[Sqrt[N[(N[(b * b), $MachinePrecision] - N[(N[(4.0 * a), $MachinePrecision] * c), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision] / N[(a * 2.0), $MachinePrecision]), $MachinePrecision], -0.014], N[(N[(N[Sqrt[N[(b * b + N[(c * N[(a * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision] / N[(a * 2.0), $MachinePrecision]), $MachinePrecision], N[(N[(a * N[(N[(c * (-c)), $MachinePrecision] / N[Power[b, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(c / b), $MachinePrecision]), $MachinePrecision]]
        
        \begin{array}{l}
        
        \\
        \begin{array}{l}
        \mathbf{if}\;\frac{\sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c} - b}{a \cdot 2} \leq -0.014:\\
        \;\;\;\;\frac{\sqrt{\mathsf{fma}\left(b, b, c \cdot \left(a \cdot -4\right)\right)} - b}{a \cdot 2}\\
        
        \mathbf{else}:\\
        \;\;\;\;a \cdot \frac{c \cdot \left(-c\right)}{{b}^{3}} - \frac{c}{b}\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 2 regimes
        2. if (/.f64 (+.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 #s(literal 4 binary64) a) c)))) (*.f64 #s(literal 2 binary64) a)) < -0.0140000000000000003

          1. Initial program 79.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. *-commutative79.0%

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

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

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

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

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

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

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

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

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

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

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

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

          if -0.0140000000000000003 < (/.f64 (+.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 #s(literal 4 binary64) a) c)))) (*.f64 #s(literal 2 binary64) a))

          1. Initial program 45.2%

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

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

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

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

              \[\leadsto -1 \cdot \frac{c}{b} + \color{blue}{\left(-\frac{a \cdot {c}^{2}}{{b}^{3}}\right)} \]
            2. unsub-neg90.6%

              \[\leadsto \color{blue}{-1 \cdot \frac{c}{b} - \frac{a \cdot {c}^{2}}{{b}^{3}}} \]
            3. mul-1-neg90.6%

              \[\leadsto \color{blue}{\left(-\frac{c}{b}\right)} - \frac{a \cdot {c}^{2}}{{b}^{3}} \]
            4. distribute-neg-frac290.6%

              \[\leadsto \color{blue}{\frac{c}{-b}} - \frac{a \cdot {c}^{2}}{{b}^{3}} \]
            5. associate-/l*90.6%

              \[\leadsto \frac{c}{-b} - \color{blue}{a \cdot \frac{{c}^{2}}{{b}^{3}}} \]
          7. Simplified90.6%

            \[\leadsto \color{blue}{\frac{c}{-b} - a \cdot \frac{{c}^{2}}{{b}^{3}}} \]
          8. Step-by-step derivation
            1. unpow290.6%

              \[\leadsto \frac{c}{-b} - a \cdot \frac{\color{blue}{c \cdot c}}{{b}^{3}} \]
          9. Applied egg-rr90.6%

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

          \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{\sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c} - b}{a \cdot 2} \leq -0.014:\\ \;\;\;\;\frac{\sqrt{\mathsf{fma}\left(b, b, c \cdot \left(a \cdot -4\right)\right)} - b}{a \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;a \cdot \frac{c \cdot \left(-c\right)}{{b}^{3}} - \frac{c}{b}\\ \end{array} \]
        5. Add Preprocessing

        Alternative 7: 85.6% accurate, 0.3× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\frac{\sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c} - b}{a \cdot 2} \leq -0.014:\\ \;\;\;\;\frac{\sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)} - b}{a \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;a \cdot \frac{c \cdot \left(-c\right)}{{b}^{3}} - \frac{c}{b}\\ \end{array} \end{array} \]
        (FPCore (a b c)
         :precision binary64
         (if (<= (/ (- (sqrt (- (* b b) (* (* 4.0 a) c))) b) (* a 2.0)) -0.014)
           (/ (- (sqrt (fma a (* c -4.0) (* b b))) b) (* a 2.0))
           (- (* a (/ (* c (- c)) (pow b 3.0))) (/ c b))))
        double code(double a, double b, double c) {
        	double tmp;
        	if (((sqrt(((b * b) - ((4.0 * a) * c))) - b) / (a * 2.0)) <= -0.014) {
        		tmp = (sqrt(fma(a, (c * -4.0), (b * b))) - b) / (a * 2.0);
        	} else {
        		tmp = (a * ((c * -c) / pow(b, 3.0))) - (c / b);
        	}
        	return tmp;
        }
        
        function code(a, b, c)
        	tmp = 0.0
        	if (Float64(Float64(sqrt(Float64(Float64(b * b) - Float64(Float64(4.0 * a) * c))) - b) / Float64(a * 2.0)) <= -0.014)
        		tmp = Float64(Float64(sqrt(fma(a, Float64(c * -4.0), Float64(b * b))) - b) / Float64(a * 2.0));
        	else
        		tmp = Float64(Float64(a * Float64(Float64(c * Float64(-c)) / (b ^ 3.0))) - Float64(c / b));
        	end
        	return tmp
        end
        
        code[a_, b_, c_] := If[LessEqual[N[(N[(N[Sqrt[N[(N[(b * b), $MachinePrecision] - N[(N[(4.0 * a), $MachinePrecision] * c), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision] / N[(a * 2.0), $MachinePrecision]), $MachinePrecision], -0.014], N[(N[(N[Sqrt[N[(a * N[(c * -4.0), $MachinePrecision] + N[(b * b), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision] / N[(a * 2.0), $MachinePrecision]), $MachinePrecision], N[(N[(a * N[(N[(c * (-c)), $MachinePrecision] / N[Power[b, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(c / b), $MachinePrecision]), $MachinePrecision]]
        
        \begin{array}{l}
        
        \\
        \begin{array}{l}
        \mathbf{if}\;\frac{\sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c} - b}{a \cdot 2} \leq -0.014:\\
        \;\;\;\;\frac{\sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)} - b}{a \cdot 2}\\
        
        \mathbf{else}:\\
        \;\;\;\;a \cdot \frac{c \cdot \left(-c\right)}{{b}^{3}} - \frac{c}{b}\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 2 regimes
        2. if (/.f64 (+.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 #s(literal 4 binary64) a) c)))) (*.f64 #s(literal 2 binary64) a)) < -0.0140000000000000003

          1. Initial program 79.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. +-commutative79.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          if -0.0140000000000000003 < (/.f64 (+.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 #s(literal 4 binary64) a) c)))) (*.f64 #s(literal 2 binary64) a))

          1. Initial program 45.2%

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

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

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

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

              \[\leadsto -1 \cdot \frac{c}{b} + \color{blue}{\left(-\frac{a \cdot {c}^{2}}{{b}^{3}}\right)} \]
            2. unsub-neg90.6%

              \[\leadsto \color{blue}{-1 \cdot \frac{c}{b} - \frac{a \cdot {c}^{2}}{{b}^{3}}} \]
            3. mul-1-neg90.6%

              \[\leadsto \color{blue}{\left(-\frac{c}{b}\right)} - \frac{a \cdot {c}^{2}}{{b}^{3}} \]
            4. distribute-neg-frac290.6%

              \[\leadsto \color{blue}{\frac{c}{-b}} - \frac{a \cdot {c}^{2}}{{b}^{3}} \]
            5. associate-/l*90.6%

              \[\leadsto \frac{c}{-b} - \color{blue}{a \cdot \frac{{c}^{2}}{{b}^{3}}} \]
          7. Simplified90.6%

            \[\leadsto \color{blue}{\frac{c}{-b} - a \cdot \frac{{c}^{2}}{{b}^{3}}} \]
          8. Step-by-step derivation
            1. unpow290.6%

              \[\leadsto \frac{c}{-b} - a \cdot \frac{\color{blue}{c \cdot c}}{{b}^{3}} \]
          9. Applied egg-rr90.6%

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

          \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{\sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c} - b}{a \cdot 2} \leq -0.014:\\ \;\;\;\;\frac{\sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)} - b}{a \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;a \cdot \frac{c \cdot \left(-c\right)}{{b}^{3}} - \frac{c}{b}\\ \end{array} \]
        5. Add Preprocessing

        Alternative 8: 85.6% accurate, 0.5× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{\sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c} - b}{a \cdot 2}\\ \mathbf{if}\;t\_0 \leq -0.014:\\ \;\;\;\;t\_0\\ \mathbf{else}:\\ \;\;\;\;a \cdot \frac{c \cdot \left(-c\right)}{{b}^{3}} - \frac{c}{b}\\ \end{array} \end{array} \]
        (FPCore (a b c)
         :precision binary64
         (let* ((t_0 (/ (- (sqrt (- (* b b) (* (* 4.0 a) c))) b) (* a 2.0))))
           (if (<= t_0 -0.014) t_0 (- (* a (/ (* c (- c)) (pow b 3.0))) (/ c b)))))
        double code(double a, double b, double c) {
        	double t_0 = (sqrt(((b * b) - ((4.0 * a) * c))) - b) / (a * 2.0);
        	double tmp;
        	if (t_0 <= -0.014) {
        		tmp = t_0;
        	} else {
        		tmp = (a * ((c * -c) / pow(b, 3.0))) - (c / b);
        	}
        	return tmp;
        }
        
        real(8) function code(a, b, c)
            real(8), intent (in) :: a
            real(8), intent (in) :: b
            real(8), intent (in) :: c
            real(8) :: t_0
            real(8) :: tmp
            t_0 = (sqrt(((b * b) - ((4.0d0 * a) * c))) - b) / (a * 2.0d0)
            if (t_0 <= (-0.014d0)) then
                tmp = t_0
            else
                tmp = (a * ((c * -c) / (b ** 3.0d0))) - (c / b)
            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))) - b) / (a * 2.0);
        	double tmp;
        	if (t_0 <= -0.014) {
        		tmp = t_0;
        	} else {
        		tmp = (a * ((c * -c) / Math.pow(b, 3.0))) - (c / b);
        	}
        	return tmp;
        }
        
        def code(a, b, c):
        	t_0 = (math.sqrt(((b * b) - ((4.0 * a) * c))) - b) / (a * 2.0)
        	tmp = 0
        	if t_0 <= -0.014:
        		tmp = t_0
        	else:
        		tmp = (a * ((c * -c) / math.pow(b, 3.0))) - (c / b)
        	return tmp
        
        function code(a, b, c)
        	t_0 = Float64(Float64(sqrt(Float64(Float64(b * b) - Float64(Float64(4.0 * a) * c))) - b) / Float64(a * 2.0))
        	tmp = 0.0
        	if (t_0 <= -0.014)
        		tmp = t_0;
        	else
        		tmp = Float64(Float64(a * Float64(Float64(c * Float64(-c)) / (b ^ 3.0))) - Float64(c / b));
        	end
        	return tmp
        end
        
        function tmp_2 = code(a, b, c)
        	t_0 = (sqrt(((b * b) - ((4.0 * a) * c))) - b) / (a * 2.0);
        	tmp = 0.0;
        	if (t_0 <= -0.014)
        		tmp = t_0;
        	else
        		tmp = (a * ((c * -c) / (b ^ 3.0))) - (c / b);
        	end
        	tmp_2 = tmp;
        end
        
        code[a_, b_, c_] := Block[{t$95$0 = N[(N[(N[Sqrt[N[(N[(b * b), $MachinePrecision] - N[(N[(4.0 * a), $MachinePrecision] * c), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision] / N[(a * 2.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -0.014], t$95$0, N[(N[(a * N[(N[(c * (-c)), $MachinePrecision] / N[Power[b, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(c / b), $MachinePrecision]), $MachinePrecision]]]
        
        \begin{array}{l}
        
        \\
        \begin{array}{l}
        t_0 := \frac{\sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c} - b}{a \cdot 2}\\
        \mathbf{if}\;t\_0 \leq -0.014:\\
        \;\;\;\;t\_0\\
        
        \mathbf{else}:\\
        \;\;\;\;a \cdot \frac{c \cdot \left(-c\right)}{{b}^{3}} - \frac{c}{b}\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 2 regimes
        2. if (/.f64 (+.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 #s(literal 4 binary64) a) c)))) (*.f64 #s(literal 2 binary64) a)) < -0.0140000000000000003

          1. Initial program 79.0%

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

          if -0.0140000000000000003 < (/.f64 (+.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 #s(literal 4 binary64) a) c)))) (*.f64 #s(literal 2 binary64) a))

          1. Initial program 45.2%

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

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

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

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

              \[\leadsto -1 \cdot \frac{c}{b} + \color{blue}{\left(-\frac{a \cdot {c}^{2}}{{b}^{3}}\right)} \]
            2. unsub-neg90.6%

              \[\leadsto \color{blue}{-1 \cdot \frac{c}{b} - \frac{a \cdot {c}^{2}}{{b}^{3}}} \]
            3. mul-1-neg90.6%

              \[\leadsto \color{blue}{\left(-\frac{c}{b}\right)} - \frac{a \cdot {c}^{2}}{{b}^{3}} \]
            4. distribute-neg-frac290.6%

              \[\leadsto \color{blue}{\frac{c}{-b}} - \frac{a \cdot {c}^{2}}{{b}^{3}} \]
            5. associate-/l*90.6%

              \[\leadsto \frac{c}{-b} - \color{blue}{a \cdot \frac{{c}^{2}}{{b}^{3}}} \]
          7. Simplified90.6%

            \[\leadsto \color{blue}{\frac{c}{-b} - a \cdot \frac{{c}^{2}}{{b}^{3}}} \]
          8. Step-by-step derivation
            1. unpow290.6%

              \[\leadsto \frac{c}{-b} - a \cdot \frac{\color{blue}{c \cdot c}}{{b}^{3}} \]
          9. Applied egg-rr90.6%

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

          \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{\sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c} - b}{a \cdot 2} \leq -0.014:\\ \;\;\;\;\frac{\sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c} - b}{a \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;a \cdot \frac{c \cdot \left(-c\right)}{{b}^{3}} - \frac{c}{b}\\ \end{array} \]
        5. Add Preprocessing

        Alternative 9: 81.8% accurate, 1.0× speedup?

        \[\begin{array}{l} \\ a \cdot \frac{c \cdot \left(-c\right)}{{b}^{3}} - \frac{c}{b} \end{array} \]
        (FPCore (a b c)
         :precision binary64
         (- (* a (/ (* c (- c)) (pow b 3.0))) (/ c b)))
        double code(double a, double b, double c) {
        	return (a * ((c * -c) / pow(b, 3.0))) - (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 = (a * ((c * -c) / (b ** 3.0d0))) - (c / b)
        end function
        
        public static double code(double a, double b, double c) {
        	return (a * ((c * -c) / Math.pow(b, 3.0))) - (c / b);
        }
        
        def code(a, b, c):
        	return (a * ((c * -c) / math.pow(b, 3.0))) - (c / b)
        
        function code(a, b, c)
        	return Float64(Float64(a * Float64(Float64(c * Float64(-c)) / (b ^ 3.0))) - Float64(c / b))
        end
        
        function tmp = code(a, b, c)
        	tmp = (a * ((c * -c) / (b ^ 3.0))) - (c / b);
        end
        
        code[a_, b_, c_] := N[(N[(a * N[(N[(c * (-c)), $MachinePrecision] / N[Power[b, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(c / b), $MachinePrecision]), $MachinePrecision]
        
        \begin{array}{l}
        
        \\
        a \cdot \frac{c \cdot \left(-c\right)}{{b}^{3}} - \frac{c}{b}
        \end{array}
        
        Derivation
        1. Initial program 54.6%

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

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

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

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

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

            \[\leadsto \color{blue}{-1 \cdot \frac{c}{b} - \frac{a \cdot {c}^{2}}{{b}^{3}}} \]
          3. mul-1-neg82.8%

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

            \[\leadsto \color{blue}{\frac{c}{-b}} - \frac{a \cdot {c}^{2}}{{b}^{3}} \]
          5. associate-/l*82.8%

            \[\leadsto \frac{c}{-b} - \color{blue}{a \cdot \frac{{c}^{2}}{{b}^{3}}} \]
        7. Simplified82.8%

          \[\leadsto \color{blue}{\frac{c}{-b} - a \cdot \frac{{c}^{2}}{{b}^{3}}} \]
        8. Step-by-step derivation
          1. unpow282.8%

            \[\leadsto \frac{c}{-b} - a \cdot \frac{\color{blue}{c \cdot c}}{{b}^{3}} \]
        9. Applied egg-rr82.8%

          \[\leadsto \frac{c}{-b} - a \cdot \frac{\color{blue}{c \cdot c}}{{b}^{3}} \]
        10. Final simplification82.8%

          \[\leadsto a \cdot \frac{c \cdot \left(-c\right)}{{b}^{3}} - \frac{c}{b} \]
        11. Add Preprocessing

        Alternative 10: 81.8% accurate, 1.0× speedup?

        \[\begin{array}{l} \\ \frac{\left(-c\right) - a \cdot {\left(\frac{c}{-b}\right)}^{2}}{b} \end{array} \]
        (FPCore (a b c)
         :precision binary64
         (/ (- (- c) (* a (pow (/ c (- b)) 2.0))) b))
        double code(double a, double b, double c) {
        	return (-c - (a * pow((c / -b), 2.0))) / 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 - (a * ((c / -b) ** 2.0d0))) / b
        end function
        
        public static double code(double a, double b, double c) {
        	return (-c - (a * Math.pow((c / -b), 2.0))) / b;
        }
        
        def code(a, b, c):
        	return (-c - (a * math.pow((c / -b), 2.0))) / b
        
        function code(a, b, c)
        	return Float64(Float64(Float64(-c) - Float64(a * (Float64(c / Float64(-b)) ^ 2.0))) / b)
        end
        
        function tmp = code(a, b, c)
        	tmp = (-c - (a * ((c / -b) ^ 2.0))) / b;
        end
        
        code[a_, b_, c_] := N[(N[((-c) - N[(a * N[Power[N[(c / (-b)), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / b), $MachinePrecision]
        
        \begin{array}{l}
        
        \\
        \frac{\left(-c\right) - a \cdot {\left(\frac{c}{-b}\right)}^{2}}{b}
        \end{array}
        
        Derivation
        1. Initial program 54.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \color{blue}{\frac{\sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)} - b}{a \cdot 2}} \]
        4. Add Preprocessing
        5. Step-by-step derivation
          1. div-sub53.6%

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

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

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

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

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

            \[\leadsto 0.5 \cdot \frac{\sqrt{\mathsf{fma}\left(a, c \cdot -4, \color{blue}{{b}^{2}}\right)}}{a} - \frac{b}{a \cdot 2} \]
          7. *-un-lft-identity53.6%

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

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

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

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

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

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

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

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

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

            \[\leadsto \frac{\color{blue}{-1 \cdot c - \frac{a \cdot {c}^{2}}{{b}^{2}}}}{b} \]
          3. mul-1-neg82.8%

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

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

            \[\leadsto \frac{\left(-c\right) - a \cdot \frac{\color{blue}{c \cdot c}}{{b}^{2}}}{b} \]
          6. unpow282.8%

            \[\leadsto \frac{\left(-c\right) - a \cdot \frac{c \cdot c}{\color{blue}{b \cdot b}}}{b} \]
          7. times-frac82.8%

            \[\leadsto \frac{\left(-c\right) - a \cdot \color{blue}{\left(\frac{c}{b} \cdot \frac{c}{b}\right)}}{b} \]
          8. sqr-neg82.8%

            \[\leadsto \frac{\left(-c\right) - a \cdot \color{blue}{\left(\left(-\frac{c}{b}\right) \cdot \left(-\frac{c}{b}\right)\right)}}{b} \]
          9. distribute-frac-neg282.8%

            \[\leadsto \frac{\left(-c\right) - a \cdot \left(\color{blue}{\frac{c}{-b}} \cdot \left(-\frac{c}{b}\right)\right)}{b} \]
          10. distribute-frac-neg282.8%

            \[\leadsto \frac{\left(-c\right) - a \cdot \left(\frac{c}{-b} \cdot \color{blue}{\frac{c}{-b}}\right)}{b} \]
          11. unpow282.8%

            \[\leadsto \frac{\left(-c\right) - a \cdot \color{blue}{{\left(\frac{c}{-b}\right)}^{2}}}{b} \]
        11. Simplified82.8%

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

        Alternative 11: 64.5% accurate, 29.0× 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 / Float64(-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 54.6%

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

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

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

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

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

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

          \[\leadsto \color{blue}{\frac{-c}{b}} \]
        8. Final simplification64.7%

          \[\leadsto \frac{c}{-b} \]
        9. Add Preprocessing

        Reproduce

        ?
        herbie shell --seed 2024108 
        (FPCore (a b c)
          :name "Quadratic roots, narrow range"
          :precision binary64
          :pre (and (and (and (< 1.0536712127723509e-8 a) (< a 94906265.62425156)) (and (< 1.0536712127723509e-8 b) (< b 94906265.62425156))) (and (< 1.0536712127723509e-8 c) (< c 94906265.62425156)))
          (/ (+ (- b) (sqrt (- (* b b) (* (* 4.0 a) c)))) (* 2.0 a)))