Quadratic roots, wide range

Percentage Accurate: 17.7% → 97.6%
Time: 11.7s
Alternatives: 5
Speedup: 29.0×

Specification

?
\[\left(\left(4.930380657631324 \cdot 10^{-32} < a \land a < 2.028240960365167 \cdot 10^{+31}\right) \land \left(4.930380657631324 \cdot 10^{-32} < b \land b < 2.028240960365167 \cdot 10^{+31}\right)\right) \land \left(4.930380657631324 \cdot 10^{-32} < c \land c < 2.028240960365167 \cdot 10^{+31}\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 5 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: 17.7% 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: 97.6% accurate, 0.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := {\left(c \cdot a\right)}^{4}\\ \mathsf{fma}\left(-2, {c}^{3} \cdot \frac{{a}^{2}}{{b}^{5}}, \mathsf{fma}\left(-1, \mathsf{fma}\left(a, c \cdot \left(c \cdot {b}^{-3}\right), \frac{c}{b}\right), \frac{\mathsf{fma}\left(16, t\_0, 4 \cdot t\_0\right) \cdot -0.25}{a \cdot {b}^{7}}\right)\right) \end{array} \end{array} \]
(FPCore (a b c)
 :precision binary64
 (let* ((t_0 (pow (* c a) 4.0)))
   (fma
    -2.0
    (* (pow c 3.0) (/ (pow a 2.0) (pow b 5.0)))
    (fma
     -1.0
     (fma a (* c (* c (pow b -3.0))) (/ c b))
     (/ (* (fma 16.0 t_0 (* 4.0 t_0)) -0.25) (* a (pow b 7.0)))))))
double code(double a, double b, double c) {
	double t_0 = pow((c * a), 4.0);
	return fma(-2.0, (pow(c, 3.0) * (pow(a, 2.0) / pow(b, 5.0))), fma(-1.0, fma(a, (c * (c * pow(b, -3.0))), (c / b)), ((fma(16.0, t_0, (4.0 * t_0)) * -0.25) / (a * pow(b, 7.0)))));
}
function code(a, b, c)
	t_0 = Float64(c * a) ^ 4.0
	return fma(-2.0, Float64((c ^ 3.0) * Float64((a ^ 2.0) / (b ^ 5.0))), fma(-1.0, fma(a, Float64(c * Float64(c * (b ^ -3.0))), Float64(c / b)), Float64(Float64(fma(16.0, t_0, Float64(4.0 * t_0)) * -0.25) / Float64(a * (b ^ 7.0)))))
end
code[a_, b_, c_] := Block[{t$95$0 = N[Power[N[(c * a), $MachinePrecision], 4.0], $MachinePrecision]}, N[(-2.0 * N[(N[Power[c, 3.0], $MachinePrecision] * N[(N[Power[a, 2.0], $MachinePrecision] / N[Power[b, 5.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(-1.0 * N[(a * N[(c * N[(c * N[Power[b, -3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(c / b), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(16.0 * t$95$0 + N[(4.0 * t$95$0), $MachinePrecision]), $MachinePrecision] * -0.25), $MachinePrecision] / N[(a * N[Power[b, 7.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := {\left(c \cdot a\right)}^{4}\\
\mathsf{fma}\left(-2, {c}^{3} \cdot \frac{{a}^{2}}{{b}^{5}}, \mathsf{fma}\left(-1, \mathsf{fma}\left(a, c \cdot \left(c \cdot {b}^{-3}\right), \frac{c}{b}\right), \frac{\mathsf{fma}\left(16, t\_0, 4 \cdot t\_0\right) \cdot -0.25}{a \cdot {b}^{7}}\right)\right)
\end{array}
\end{array}
Derivation
  1. Initial program 14.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. *-commutative14.4%

      \[\leadsto \frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{\color{blue}{a \cdot 2}} \]
  3. Simplified14.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 98.8%

    \[\leadsto \color{blue}{-2 \cdot \frac{{a}^{2} \cdot {c}^{3}}{{b}^{5}} + \left(-1 \cdot \frac{c}{b} + \left(-1 \cdot \frac{a \cdot {c}^{2}}{{b}^{3}} + -0.25 \cdot \frac{16 \cdot \left({a}^{4} \cdot {c}^{4}\right) + {\left(-2 \cdot \left({a}^{2} \cdot {c}^{2}\right)\right)}^{2}}{a \cdot {b}^{7}}\right)\right)} \]
  6. Simplified98.8%

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

      \[\leadsto \mathsf{fma}\left(-2, {c}^{3} \cdot \frac{{a}^{2}}{{b}^{5}}, \mathsf{fma}\left(-1, \mathsf{fma}\left(a, \frac{{c}^{2}}{{b}^{3}}, \frac{c}{b}\right), \frac{\mathsf{fma}\left(16, \color{blue}{{c}^{4} \cdot {a}^{4}}, 4 \cdot \left({a}^{4} \cdot {c}^{4}\right)\right) \cdot -0.25}{a \cdot {b}^{7}}\right)\right) \]
    2. pow-prod-down98.8%

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

    \[\leadsto \mathsf{fma}\left(-2, {c}^{3} \cdot \frac{{a}^{2}}{{b}^{5}}, \mathsf{fma}\left(-1, \mathsf{fma}\left(a, \frac{{c}^{2}}{{b}^{3}}, \frac{c}{b}\right), \frac{\mathsf{fma}\left(16, \color{blue}{{\left(c \cdot a\right)}^{4}}, 4 \cdot \left({a}^{4} \cdot {c}^{4}\right)\right) \cdot -0.25}{a \cdot {b}^{7}}\right)\right) \]
  9. Step-by-step derivation
    1. *-commutative98.8%

      \[\leadsto \mathsf{fma}\left(-2, {c}^{3} \cdot \frac{{a}^{2}}{{b}^{5}}, \mathsf{fma}\left(-1, \mathsf{fma}\left(a, \frac{{c}^{2}}{{b}^{3}}, \frac{c}{b}\right), \frac{\mathsf{fma}\left(16, \color{blue}{{c}^{4} \cdot {a}^{4}}, 4 \cdot \left({a}^{4} \cdot {c}^{4}\right)\right) \cdot -0.25}{a \cdot {b}^{7}}\right)\right) \]
    2. pow-prod-down98.8%

      \[\leadsto \mathsf{fma}\left(-2, {c}^{3} \cdot \frac{{a}^{2}}{{b}^{5}}, \mathsf{fma}\left(-1, \mathsf{fma}\left(a, \frac{{c}^{2}}{{b}^{3}}, \frac{c}{b}\right), \frac{\mathsf{fma}\left(16, \color{blue}{{\left(c \cdot a\right)}^{4}}, 4 \cdot \left({a}^{4} \cdot {c}^{4}\right)\right) \cdot -0.25}{a \cdot {b}^{7}}\right)\right) \]
  10. Applied egg-rr98.8%

    \[\leadsto \mathsf{fma}\left(-2, {c}^{3} \cdot \frac{{a}^{2}}{{b}^{5}}, \mathsf{fma}\left(-1, \mathsf{fma}\left(a, \frac{{c}^{2}}{{b}^{3}}, \frac{c}{b}\right), \frac{\mathsf{fma}\left(16, {\left(c \cdot a\right)}^{4}, 4 \cdot \color{blue}{{\left(c \cdot a\right)}^{4}}\right) \cdot -0.25}{a \cdot {b}^{7}}\right)\right) \]
  11. Step-by-step derivation
    1. div-inv98.8%

      \[\leadsto \mathsf{fma}\left(-2, {c}^{3} \cdot \frac{{a}^{2}}{{b}^{5}}, \mathsf{fma}\left(-1, \mathsf{fma}\left(a, \color{blue}{{c}^{2} \cdot \frac{1}{{b}^{3}}}, \frac{c}{b}\right), \frac{\mathsf{fma}\left(16, {\left(c \cdot a\right)}^{4}, 4 \cdot {\left(c \cdot a\right)}^{4}\right) \cdot -0.25}{a \cdot {b}^{7}}\right)\right) \]
    2. unpow298.8%

      \[\leadsto \mathsf{fma}\left(-2, {c}^{3} \cdot \frac{{a}^{2}}{{b}^{5}}, \mathsf{fma}\left(-1, \mathsf{fma}\left(a, \color{blue}{\left(c \cdot c\right)} \cdot \frac{1}{{b}^{3}}, \frac{c}{b}\right), \frac{\mathsf{fma}\left(16, {\left(c \cdot a\right)}^{4}, 4 \cdot {\left(c \cdot a\right)}^{4}\right) \cdot -0.25}{a \cdot {b}^{7}}\right)\right) \]
    3. associate-*l*98.8%

      \[\leadsto \mathsf{fma}\left(-2, {c}^{3} \cdot \frac{{a}^{2}}{{b}^{5}}, \mathsf{fma}\left(-1, \mathsf{fma}\left(a, \color{blue}{c \cdot \left(c \cdot \frac{1}{{b}^{3}}\right)}, \frac{c}{b}\right), \frac{\mathsf{fma}\left(16, {\left(c \cdot a\right)}^{4}, 4 \cdot {\left(c \cdot a\right)}^{4}\right) \cdot -0.25}{a \cdot {b}^{7}}\right)\right) \]
    4. pow-flip98.8%

      \[\leadsto \mathsf{fma}\left(-2, {c}^{3} \cdot \frac{{a}^{2}}{{b}^{5}}, \mathsf{fma}\left(-1, \mathsf{fma}\left(a, c \cdot \left(c \cdot \color{blue}{{b}^{\left(-3\right)}}\right), \frac{c}{b}\right), \frac{\mathsf{fma}\left(16, {\left(c \cdot a\right)}^{4}, 4 \cdot {\left(c \cdot a\right)}^{4}\right) \cdot -0.25}{a \cdot {b}^{7}}\right)\right) \]
    5. metadata-eval98.8%

      \[\leadsto \mathsf{fma}\left(-2, {c}^{3} \cdot \frac{{a}^{2}}{{b}^{5}}, \mathsf{fma}\left(-1, \mathsf{fma}\left(a, c \cdot \left(c \cdot {b}^{\color{blue}{-3}}\right), \frac{c}{b}\right), \frac{\mathsf{fma}\left(16, {\left(c \cdot a\right)}^{4}, 4 \cdot {\left(c \cdot a\right)}^{4}\right) \cdot -0.25}{a \cdot {b}^{7}}\right)\right) \]
  12. Applied egg-rr98.8%

    \[\leadsto \mathsf{fma}\left(-2, {c}^{3} \cdot \frac{{a}^{2}}{{b}^{5}}, \mathsf{fma}\left(-1, \mathsf{fma}\left(a, \color{blue}{c \cdot \left(c \cdot {b}^{-3}\right)}, \frac{c}{b}\right), \frac{\mathsf{fma}\left(16, {\left(c \cdot a\right)}^{4}, 4 \cdot {\left(c \cdot a\right)}^{4}\right) \cdot -0.25}{a \cdot {b}^{7}}\right)\right) \]
  13. Final simplification98.8%

    \[\leadsto \mathsf{fma}\left(-2, {c}^{3} \cdot \frac{{a}^{2}}{{b}^{5}}, \mathsf{fma}\left(-1, \mathsf{fma}\left(a, c \cdot \left(c \cdot {b}^{-3}\right), \frac{c}{b}\right), \frac{\mathsf{fma}\left(16, {\left(c \cdot a\right)}^{4}, 4 \cdot {\left(c \cdot a\right)}^{4}\right) \cdot -0.25}{a \cdot {b}^{7}}\right)\right) \]
  14. Add Preprocessing

Alternative 2: 96.8% accurate, 0.3× speedup?

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

\\
-2 \cdot \frac{{c}^{3} \cdot {a}^{2}}{{b}^{5}} - \left(\frac{c}{b} + {\left(\frac{c}{b}\right)}^{2} \cdot \frac{a}{b}\right)
\end{array}
Derivation
  1. Initial program 14.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. *-commutative14.4%

      \[\leadsto \frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{\color{blue}{a \cdot 2}} \]
  3. Simplified14.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 98.3%

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

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

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

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

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

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

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

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

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

Alternative 3: 96.3% accurate, 0.3× speedup?

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

\\
\frac{-4 \cdot \frac{{\left(c \cdot a\right)}^{3}}{{b}^{5}} + \left(-2 \cdot \frac{c \cdot a}{b} + -2 \cdot \left(\left(c \cdot a\right) \cdot \left({b}^{-3} \cdot \left(c \cdot a\right)\right)\right)\right)}{a \cdot 2}
\end{array}
Derivation
  1. Initial program 14.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. *-commutative14.4%

      \[\leadsto \frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{\color{blue}{a \cdot 2}} \]
  3. Simplified14.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 97.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{-4 \cdot \frac{{a}^{3} \cdot {c}^{3}}{{b}^{5}} + \left(-2 \cdot \frac{a \cdot c}{b} + -2 \cdot \left(\left(c \cdot a\right) \cdot \left(\left(c \cdot a\right) \cdot \color{blue}{{b}^{\left(-3\right)}}\right)\right)\right)}{a \cdot 2} \]
    21. metadata-eval97.8%

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

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

      \[\leadsto \frac{-4 \cdot \frac{\color{blue}{{c}^{3} \cdot {a}^{3}}}{{b}^{5}} + \left(-2 \cdot \frac{a \cdot c}{b} + -2 \cdot \left(\left(c \cdot a\right) \cdot \left(\left(c \cdot a\right) \cdot {b}^{-3}\right)\right)\right)}{a \cdot 2} \]
    2. pow-prod-down97.8%

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

    \[\leadsto \frac{-4 \cdot \frac{\color{blue}{{\left(c \cdot a\right)}^{3}}}{{b}^{5}} + \left(-2 \cdot \frac{a \cdot c}{b} + -2 \cdot \left(\left(c \cdot a\right) \cdot \left(\left(c \cdot a\right) \cdot {b}^{-3}\right)\right)\right)}{a \cdot 2} \]
  10. Final simplification97.8%

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

Alternative 4: 95.2% accurate, 1.0× speedup?

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

\\
\frac{-c}{b} - a \cdot \left(c \cdot \left(c \cdot {b}^{-3}\right)\right)
\end{array}
Derivation
  1. Initial program 14.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. *-commutative14.4%

      \[\leadsto \frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{\color{blue}{a \cdot 2}} \]
  3. Simplified14.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 96.7%

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

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

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

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

      \[\leadsto \mathsf{fma}\left(-2, {c}^{3} \cdot \frac{{a}^{2}}{{b}^{5}}, \mathsf{fma}\left(-1, \mathsf{fma}\left(a, \color{blue}{{c}^{2} \cdot \frac{1}{{b}^{3}}}, \frac{c}{b}\right), \frac{\mathsf{fma}\left(16, {\left(c \cdot a\right)}^{4}, 4 \cdot {\left(c \cdot a\right)}^{4}\right) \cdot -0.25}{a \cdot {b}^{7}}\right)\right) \]
    2. unpow298.8%

      \[\leadsto \mathsf{fma}\left(-2, {c}^{3} \cdot \frac{{a}^{2}}{{b}^{5}}, \mathsf{fma}\left(-1, \mathsf{fma}\left(a, \color{blue}{\left(c \cdot c\right)} \cdot \frac{1}{{b}^{3}}, \frac{c}{b}\right), \frac{\mathsf{fma}\left(16, {\left(c \cdot a\right)}^{4}, 4 \cdot {\left(c \cdot a\right)}^{4}\right) \cdot -0.25}{a \cdot {b}^{7}}\right)\right) \]
    3. associate-*l*98.8%

      \[\leadsto \mathsf{fma}\left(-2, {c}^{3} \cdot \frac{{a}^{2}}{{b}^{5}}, \mathsf{fma}\left(-1, \mathsf{fma}\left(a, \color{blue}{c \cdot \left(c \cdot \frac{1}{{b}^{3}}\right)}, \frac{c}{b}\right), \frac{\mathsf{fma}\left(16, {\left(c \cdot a\right)}^{4}, 4 \cdot {\left(c \cdot a\right)}^{4}\right) \cdot -0.25}{a \cdot {b}^{7}}\right)\right) \]
    4. pow-flip98.8%

      \[\leadsto \mathsf{fma}\left(-2, {c}^{3} \cdot \frac{{a}^{2}}{{b}^{5}}, \mathsf{fma}\left(-1, \mathsf{fma}\left(a, c \cdot \left(c \cdot \color{blue}{{b}^{\left(-3\right)}}\right), \frac{c}{b}\right), \frac{\mathsf{fma}\left(16, {\left(c \cdot a\right)}^{4}, 4 \cdot {\left(c \cdot a\right)}^{4}\right) \cdot -0.25}{a \cdot {b}^{7}}\right)\right) \]
    5. metadata-eval98.8%

      \[\leadsto \mathsf{fma}\left(-2, {c}^{3} \cdot \frac{{a}^{2}}{{b}^{5}}, \mathsf{fma}\left(-1, \mathsf{fma}\left(a, c \cdot \left(c \cdot {b}^{\color{blue}{-3}}\right), \frac{c}{b}\right), \frac{\mathsf{fma}\left(16, {\left(c \cdot a\right)}^{4}, 4 \cdot {\left(c \cdot a\right)}^{4}\right) \cdot -0.25}{a \cdot {b}^{7}}\right)\right) \]
  9. Applied egg-rr96.7%

    \[\leadsto -1 \cdot \left(\frac{c}{b} + a \cdot \color{blue}{\left(c \cdot \left(c \cdot {b}^{-3}\right)\right)}\right) \]
  10. Final simplification96.7%

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

Alternative 5: 90.4% 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 14.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. *-commutative14.4%

      \[\leadsto \frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{\color{blue}{a \cdot 2}} \]
  3. Simplified14.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 92.8%

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

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

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

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

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

Reproduce

?
herbie shell --seed 2024043 
(FPCore (a b c)
  :name "Quadratic roots, wide range"
  :precision binary64
  :pre (and (and (and (< 4.930380657631324e-32 a) (< a 2.028240960365167e+31)) (and (< 4.930380657631324e-32 b) (< b 2.028240960365167e+31))) (and (< 4.930380657631324e-32 c) (< c 2.028240960365167e+31)))
  (/ (+ (- b) (sqrt (- (* b b) (* (* 4.0 a) c)))) (* 2.0 a)))