Quadratic roots, medium range

Percentage Accurate: 31.1% → 99.7%
Time: 12.1s
Alternatives: 8
Speedup: 3.6×

Specification

?
\[\left(\left(1.1102230246251565 \cdot 10^{-16} < a \land a < 9007199254740992\right) \land \left(1.1102230246251565 \cdot 10^{-16} < b \land b < 9007199254740992\right)\right) \land \left(1.1102230246251565 \cdot 10^{-16} < c \land c < 9007199254740992\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 8 alternatives:

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

Initial Program: 31.1% 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: 99.7% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \frac{-2 \cdot c}{\sqrt{\mathsf{fma}\left(-4, c, \frac{b \cdot b}{a}\right) \cdot a} + b} \end{array} \]
(FPCore (a b c)
 :precision binary64
 (/ (* -2.0 c) (+ (sqrt (* (fma -4.0 c (/ (* b b) a)) a)) b)))
double code(double a, double b, double c) {
	return (-2.0 * c) / (sqrt((fma(-4.0, c, ((b * b) / a)) * a)) + b);
}
function code(a, b, c)
	return Float64(Float64(-2.0 * c) / Float64(sqrt(Float64(fma(-4.0, c, Float64(Float64(b * b) / a)) * a)) + b))
end
code[a_, b_, c_] := N[(N[(-2.0 * c), $MachinePrecision] / N[(N[Sqrt[N[(N[(-4.0 * c + N[(N[(b * b), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision] * a), $MachinePrecision]], $MachinePrecision] + b), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\frac{-2 \cdot c}{\sqrt{\mathsf{fma}\left(-4, c, \frac{b \cdot b}{a}\right) \cdot a} + b}
\end{array}
Derivation
  1. Initial program 30.8%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{\frac{1}{2}}{\frac{a}{\left(\mathsf{neg}\left(b\right)\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}}} \]
    8. lower-/.f6430.8

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 99.7% accurate, 1.1× speedup?

\[\begin{array}{l} \\ \frac{-2 \cdot c}{\sqrt{\mathsf{fma}\left(b, b, \left(-4 \cdot c\right) \cdot a\right)} + b} \end{array} \]
(FPCore (a b c)
 :precision binary64
 (/ (* -2.0 c) (+ (sqrt (fma b b (* (* -4.0 c) a))) b)))
double code(double a, double b, double c) {
	return (-2.0 * c) / (sqrt(fma(b, b, ((-4.0 * c) * a))) + b);
}
function code(a, b, c)
	return Float64(Float64(-2.0 * c) / Float64(sqrt(fma(b, b, Float64(Float64(-4.0 * c) * a))) + b))
end
code[a_, b_, c_] := N[(N[(-2.0 * c), $MachinePrecision] / N[(N[Sqrt[N[(b * b + N[(N[(-4.0 * c), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] + b), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\frac{-2 \cdot c}{\sqrt{\mathsf{fma}\left(b, b, \left(-4 \cdot c\right) \cdot a\right)} + b}
\end{array}
Derivation
  1. Initial program 31.1%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{\frac{1}{2}}{\frac{a}{\left(\mathsf{neg}\left(b\right)\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}}} \]
    8. lower-/.f6431.1

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Reproduce

?
herbie shell --seed 2024234 
(FPCore (a b c)
  :name "Quadratic roots, medium range"
  :precision binary64
  :pre (and (and (and (< 1.1102230246251565e-16 a) (< a 9007199254740992.0)) (and (< 1.1102230246251565e-16 b) (< b 9007199254740992.0))) (and (< 1.1102230246251565e-16 c) (< c 9007199254740992.0)))
  (/ (+ (- b) (sqrt (- (* b b) (* (* 4.0 a) c)))) (* 2.0 a)))