Quadratic roots, medium range

Percentage Accurate: 31.0% → 99.6%
Time: 11.6s
Alternatives: 7
Speedup: 29.0×

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

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

Initial Program: 31.0% 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.6% accurate, 0.5× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \frac{\color{blue}{-4 \cdot \left(c \cdot a\right)}}{b + \sqrt{\mathsf{fma}\left(b, b, \left(c \cdot a\right) \cdot -4\right)}} \cdot \frac{0.5}{a} \]
  11. Step-by-step derivation
    1. *-commutative99.3%

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

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

    \[\leadsto \frac{\color{blue}{c \cdot \left(a \cdot -4\right)}}{b + \sqrt{\mathsf{fma}\left(b, b, \left(c \cdot a\right) \cdot -4\right)}} \cdot \frac{0.5}{a} \]
  13. Step-by-step derivation
    1. associate-*l/99.4%

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

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

    \[\leadsto \color{blue}{\frac{\left(c \cdot \left(a \cdot -4\right)\right) \cdot \frac{0.5}{a}}{b + \sqrt{\mathsf{fma}\left(b, b, c \cdot \left(a \cdot -4\right)\right)}}} \]
  15. Step-by-step derivation
    1. associate-*r/99.6%

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

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

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

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

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

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

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

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

Alternative 2: 99.4% accurate, 0.5× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \frac{\color{blue}{-4 \cdot \left(c \cdot a\right)}}{b + \sqrt{\mathsf{fma}\left(b, b, \left(c \cdot a\right) \cdot -4\right)}} \cdot \frac{0.5}{a} \]
  11. Step-by-step derivation
    1. *-commutative99.3%

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

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

    \[\leadsto \frac{\color{blue}{c \cdot \left(a \cdot -4\right)}}{b + \sqrt{\mathsf{fma}\left(b, b, \left(c \cdot a\right) \cdot -4\right)}} \cdot \frac{0.5}{a} \]
  13. Step-by-step derivation
    1. frac-times99.4%

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

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

    \[\leadsto \color{blue}{\frac{\left(c \cdot \left(a \cdot -4\right)\right) \cdot 0.5}{\left(b + \sqrt{\mathsf{fma}\left(b, b, c \cdot \left(a \cdot -4\right)\right)}\right) \cdot a}} \]
  15. Step-by-step derivation
    1. *-commutative99.4%

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

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

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

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

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

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

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

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

Alternative 3: 93.9% accurate, 0.9× speedup?

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

\\
\frac{c \cdot \left(a \cdot -4\right)}{b + \left(b + -2 \cdot \left(a \cdot \left(a \cdot \frac{c}{\frac{{b}^{3}}{c}} + \frac{c}{b}\right)\right)\right)} \cdot \frac{0.5}{a}
\end{array}
Derivation
  1. Initial program 31.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \frac{\color{blue}{-4 \cdot \left(c \cdot a\right)}}{b + \sqrt{\mathsf{fma}\left(b, b, \left(c \cdot a\right) \cdot -4\right)}} \cdot \frac{0.5}{a} \]
  11. Step-by-step derivation
    1. *-commutative99.3%

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{c \cdot \left(a \cdot -4\right)}{b + \left(b + -2 \cdot \left(\color{blue}{\left(\frac{c \cdot c}{{b}^{3}} \cdot a\right) \cdot a} + \frac{c}{b} \cdot a\right)\right)} \cdot \frac{0.5}{a} \]
    10. distribute-rgt-out92.1%

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

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

    \[\leadsto \frac{c \cdot \left(a \cdot -4\right)}{b + \color{blue}{\left(b + -2 \cdot \left(a \cdot \left(\frac{c}{\frac{{b}^{3}}{c}} \cdot a + \frac{c}{b}\right)\right)\right)}} \cdot \frac{0.5}{a} \]
  16. Final simplification92.1%

    \[\leadsto \frac{c \cdot \left(a \cdot -4\right)}{b + \left(b + -2 \cdot \left(a \cdot \left(a \cdot \frac{c}{\frac{{b}^{3}}{c}} + \frac{c}{b}\right)\right)\right)} \cdot \frac{0.5}{a} \]

Alternative 4: 91.1% accurate, 1.0× speedup?

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

\\
\frac{-c}{b} - \frac{a}{\frac{{b}^{3}}{c \cdot c}}
\end{array}
Derivation
  1. Initial program 31.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{-1 \cdot \frac{c}{b} - \frac{{c}^{2} \cdot a}{{b}^{3}}} \]
    4. associate-*r/89.4%

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

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

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

      \[\leadsto \frac{-c}{b} - \color{blue}{\frac{a}{\frac{{b}^{3}}{{c}^{2}}}} \]
    8. unpow289.4%

      \[\leadsto \frac{-c}{b} - \frac{a}{\frac{{b}^{3}}{\color{blue}{c \cdot c}}} \]
  6. Simplified89.4%

    \[\leadsto \color{blue}{\frac{-c}{b} - \frac{a}{\frac{{b}^{3}}{c \cdot c}}} \]
  7. Final simplification89.4%

    \[\leadsto \frac{-c}{b} - \frac{a}{\frac{{b}^{3}}{c \cdot c}} \]

Alternative 5: 91.0% accurate, 5.5× speedup?

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

\\
\frac{0.5}{a} \cdot \frac{c \cdot \left(a \cdot -4\right)}{b + \left(b + -2 \cdot \frac{c \cdot a}{b}\right)}
\end{array}
Derivation
  1. Initial program 31.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \frac{\color{blue}{-4 \cdot \left(c \cdot a\right)}}{b + \sqrt{\mathsf{fma}\left(b, b, \left(c \cdot a\right) \cdot -4\right)}} \cdot \frac{0.5}{a} \]
  11. Step-by-step derivation
    1. *-commutative99.3%

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

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

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

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

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

Alternative 6: 91.0% accurate, 5.5× speedup?

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

\\
\frac{0.5}{a} \cdot \frac{c \cdot \left(a \cdot -4\right)}{-2 \cdot \frac{c \cdot a}{b} + b \cdot 2}
\end{array}
Derivation
  1. Initial program 31.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \frac{\color{blue}{-4 \cdot \left(c \cdot a\right)}}{b + \sqrt{\mathsf{fma}\left(b, b, \left(c \cdot a\right) \cdot -4\right)}} \cdot \frac{0.5}{a} \]
  11. Step-by-step derivation
    1. *-commutative99.3%

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

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

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

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

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

Alternative 7: 81.7% 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(Float64(-c) / b)
end
function tmp = code(a, b, c)
	tmp = -c / b;
end
code[a_, b_, c_] := N[((-c) / b), $MachinePrecision]
\begin{array}{l}

\\
\frac{-c}{b}
\end{array}
Derivation
  1. Initial program 31.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Reproduce

?
herbie shell --seed 2023229 
(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)))