Quadratic roots, medium range

Percentage Accurate: 31.1% → 99.7%
Time: 29.9s
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.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.3× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{1 \cdot \left(a \cdot \left(c \cdot -4\right)\right)}{\left(a \cdot 2\right) \cdot \left(b + \frac{\sqrt{{b}^{4} + -16 \cdot {\left(a \cdot c\right)}^{2}}}{\mathsf{hypot}\left(b, \sqrt{c \cdot \left(a \cdot 4\right)}\right)}\right)}} \]
    3. *-lft-identity99.3%

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

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{\frac{-2 \cdot \left(a \cdot \frac{c}{a}\right)}{b + \frac{\sqrt{{b}^{4} + -16 \cdot {\left(a \cdot c\right)}^{2}}}{\mathsf{hypot}\left(b, \sqrt{c \cdot \left(a \cdot 4\right)}\right)}}} \]
  15. Step-by-step derivation
    1. unpow299.5%

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

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

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

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

Alternative 2: 99.4% accurate, 0.5× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 99.4% accurate, 0.5× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{\frac{\left(a \cdot c\right) \cdot -4}{\sqrt{\mathsf{hypot}\left(b, \sqrt{a \cdot \left(c \cdot -4\right)}\right) \cdot \sqrt{\color{blue}{b \cdot b} + -4 \cdot \left(a \cdot c\right)}} + b}}{a \cdot 2} \]
    10. *-commutative0.0%

      \[\leadsto \frac{\frac{\left(a \cdot c\right) \cdot -4}{\sqrt{\mathsf{hypot}\left(b, \sqrt{a \cdot \left(c \cdot -4\right)}\right) \cdot \sqrt{b \cdot b + \color{blue}{\left(a \cdot c\right) \cdot -4}}} + b}}{a \cdot 2} \]
    11. add-sqr-sqrt0.0%

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

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

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

    \[\leadsto \frac{\frac{\left(a \cdot c\right) \cdot -4}{\sqrt{\color{blue}{\mathsf{hypot}\left(b, \sqrt{a \cdot \left(c \cdot -4\right)}\right) \cdot \mathsf{hypot}\left(b, \sqrt{a \cdot \left(c \cdot -4\right)}\right)}} + b}}{a \cdot 2} \]
  15. Step-by-step derivation
    1. hypot-undefine0.0%

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

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

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

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

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

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

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

Alternative 4: 91.0% accurate, 7.7× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{1 \cdot \left(a \cdot \left(c \cdot -4\right)\right)}{\left(a \cdot 2\right) \cdot \left(b + \frac{\sqrt{{b}^{4} + -16 \cdot {\left(a \cdot c\right)}^{2}}}{\mathsf{hypot}\left(b, \sqrt{c \cdot \left(a \cdot 4\right)}\right)}\right)}} \]
    3. *-lft-identity99.3%

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

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

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

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

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

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

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

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

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

    \[\leadsto \frac{-2 \cdot \left(a \cdot \frac{c}{a}\right)}{b + \color{blue}{\left(b + -2 \cdot \frac{a \cdot c}{b}\right)}} \]
  16. Taylor expanded in a around 0 91.7%

    \[\leadsto \frac{-2 \cdot \color{blue}{c}}{b + \left(b + -2 \cdot \frac{a \cdot c}{b}\right)} \]
  17. Final simplification91.7%

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

Alternative 5: 90.8% accurate, 12.9× speedup?

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{\frac{c}{-b} - a \cdot \frac{{c}^{2}}{{b}^{3}}} \]
  8. Taylor expanded in b around inf 91.3%

    \[\leadsto \color{blue}{\frac{-1 \cdot c + -1 \cdot \frac{a \cdot {c}^{2}}{{b}^{2}}}{b}} \]
  9. Step-by-step derivation
    1. distribute-lft-out91.3%

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

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

      \[\leadsto \color{blue}{-\frac{c + \frac{a \cdot {c}^{2}}{{b}^{2}}}{b}} \]
    4. distribute-neg-frac291.3%

      \[\leadsto \color{blue}{\frac{c + \frac{a \cdot {c}^{2}}{{b}^{2}}}{-b}} \]
    5. +-commutative91.3%

      \[\leadsto \frac{\color{blue}{\frac{a \cdot {c}^{2}}{{b}^{2}} + c}}{-b} \]
    6. associate-/l*91.3%

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

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

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

      \[\leadsto \frac{\mathsf{fma}\left(a, \frac{c \cdot c}{\color{blue}{b \cdot b}}, c\right)}{-b} \]
    10. times-frac91.3%

      \[\leadsto \frac{\mathsf{fma}\left(a, \color{blue}{\frac{c}{b} \cdot \frac{c}{b}}, c\right)}{-b} \]
    11. sqr-neg91.3%

      \[\leadsto \frac{\mathsf{fma}\left(a, \color{blue}{\left(-\frac{c}{b}\right) \cdot \left(-\frac{c}{b}\right)}, c\right)}{-b} \]
    12. distribute-frac-neg291.3%

      \[\leadsto \frac{\mathsf{fma}\left(a, \color{blue}{\frac{c}{-b}} \cdot \left(-\frac{c}{b}\right), c\right)}{-b} \]
    13. distribute-frac-neg291.3%

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

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

    \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(a, {\left(\frac{c}{-b}\right)}^{2}, c\right)}{-b}} \]
  11. Step-by-step derivation
    1. clear-num91.1%

      \[\leadsto \color{blue}{\frac{1}{\frac{-b}{\mathsf{fma}\left(a, {\left(\frac{c}{-b}\right)}^{2}, c\right)}}} \]
    2. inv-pow91.1%

      \[\leadsto \color{blue}{{\left(\frac{-b}{\mathsf{fma}\left(a, {\left(\frac{c}{-b}\right)}^{2}, c\right)}\right)}^{-1}} \]
    3. distribute-frac-neg291.1%

      \[\leadsto {\left(\frac{-b}{\mathsf{fma}\left(a, {\color{blue}{\left(-\frac{c}{b}\right)}}^{2}, c\right)}\right)}^{-1} \]
  12. Applied egg-rr91.1%

    \[\leadsto \color{blue}{{\left(\frac{-b}{\mathsf{fma}\left(a, {\left(-\frac{c}{b}\right)}^{2}, c\right)}\right)}^{-1}} \]
  13. Step-by-step derivation
    1. unpow-191.1%

      \[\leadsto \color{blue}{\frac{1}{\frac{-b}{\mathsf{fma}\left(a, {\left(-\frac{c}{b}\right)}^{2}, c\right)}}} \]
    2. distribute-neg-frac291.1%

      \[\leadsto \frac{1}{\frac{-b}{\mathsf{fma}\left(a, {\color{blue}{\left(\frac{c}{-b}\right)}}^{2}, c\right)}} \]
  14. Simplified91.1%

    \[\leadsto \color{blue}{\frac{1}{\frac{-b}{\mathsf{fma}\left(a, {\left(\frac{c}{-b}\right)}^{2}, c\right)}}} \]
  15. Taylor expanded in a around 0 91.4%

    \[\leadsto \frac{1}{\color{blue}{-1 \cdot \frac{b}{c} + \frac{a}{b}}} \]
  16. Step-by-step derivation
    1. +-commutative91.4%

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

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

      \[\leadsto \frac{1}{\color{blue}{\frac{a}{b} - \frac{b}{c}}} \]
  17. Simplified91.4%

    \[\leadsto \frac{1}{\color{blue}{\frac{a}{b} - \frac{b}{c}}} \]
  18. Add Preprocessing

Alternative 6: 81.5% accurate, 29.0× speedup?

\[\begin{array}{l} \\ \frac{-c}{b} \end{array} \]
(FPCore (a b c) :precision binary64 (/ (- c) b))
double code(double a, double b, double c) {
	return -c / b;
}
real(8) function code(a, b, c)
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    code = -c / b
end function
public static double code(double a, double b, double c) {
	return -c / b;
}
def code(a, b, c):
	return -c / b
function code(a, b, c)
	return Float64(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 30.4%

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

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

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

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

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

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

    \[\leadsto \color{blue}{\frac{-c}{b}} \]
  8. Add Preprocessing

Alternative 7: 1.6% accurate, 38.7× speedup?

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

\\
\frac{b}{a}
\end{array}
Derivation
  1. Initial program 30.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{1 \cdot \left(a \cdot \left(c \cdot -4\right)\right)}{\left(a \cdot 2\right) \cdot \left(b + \frac{\sqrt{{b}^{4} + -16 \cdot {\left(a \cdot c\right)}^{2}}}{\mathsf{hypot}\left(b, \sqrt{c \cdot \left(a \cdot 4\right)}\right)}\right)}} \]
    3. *-lft-identity99.3%

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{\frac{b}{a}} \]
  17. Add Preprocessing

Reproduce

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