Quadratic roots, narrow range

Percentage Accurate: 55.8% → 99.6%
Time: 14.5s
Alternatives: 7
Speedup: 29.0×

Specification

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

\\
\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}
\end{array}

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

The average percentage accuracy by input value. Horizontal axis shows value of an input variable; the variable is choosen in the title. Vertical axis is accuracy; higher is better. Red represent the original program, while blue represents Herbie's suggestion. These can be toggled with buttons below the plot. The line is an average while dots represent individual samples.

Accuracy vs Speed?

Herbie found 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: 55.8% accurate, 1.0× speedup?

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

\\
\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}
\end{array}

Alternative 1: 99.6% accurate, 0.5× speedup?

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

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

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

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

    \[\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. Step-by-step derivation
    1. add-cube-cbrt55.9%

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

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

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

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

    \[\leadsto \frac{\color{blue}{\frac{{\left(-b\right)}^{2} - \left({b}^{2} - c \cdot \left(a \cdot 4\right)\right)}{\left(-b\right) - \sqrt{{b}^{2} - c \cdot \left(a \cdot 4\right)}}}}{a \cdot 2} \]
  9. Step-by-step derivation
    1. associate--r-99.2%

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

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

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

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

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

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

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

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

    \[\leadsto \frac{\frac{\color{blue}{4 \cdot \left(a \cdot c\right)}}{\left(-b\right) - \sqrt{{b}^{2} - a \cdot \left(c \cdot 4\right)}}}{a \cdot 2} \]
  12. Step-by-step derivation
    1. *-un-lft-identity99.2%

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

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

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

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

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

      \[\leadsto 1 \cdot \frac{a \cdot \left(4 \cdot c\right)}{\left(a \cdot 2\right) \cdot \left(\left(-b\right) - \sqrt{{b}^{2} - a \cdot \color{blue}{\left(4 \cdot c\right)}}\right)} \]
  13. Applied egg-rr99.2%

    \[\leadsto \color{blue}{1 \cdot \frac{a \cdot \left(4 \cdot c\right)}{\left(a \cdot 2\right) \cdot \left(\left(-b\right) - \sqrt{{b}^{2} - a \cdot \left(4 \cdot c\right)}\right)}} \]
  14. Step-by-step derivation
    1. *-lft-identity99.2%

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

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

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

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

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

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

Alternative 2: 99.5% accurate, 0.5× speedup?

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

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

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

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

    \[\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. Step-by-step derivation
    1. add-cube-cbrt55.9%

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

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

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

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

    \[\leadsto \frac{\color{blue}{\frac{{\left(-b\right)}^{2} - \left({b}^{2} - c \cdot \left(a \cdot 4\right)\right)}{\left(-b\right) - \sqrt{{b}^{2} - c \cdot \left(a \cdot 4\right)}}}}{a \cdot 2} \]
  9. Step-by-step derivation
    1. associate--r-99.2%

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \left(4 \cdot \frac{a \cdot c}{\left(-b\right) - \sqrt{{b}^{2} - a \cdot \color{blue}{\left(4 \cdot c\right)}}}\right) \cdot \frac{1}{a \cdot 2} \]
  13. Applied egg-rr99.1%

    \[\leadsto \color{blue}{\left(4 \cdot \frac{a \cdot c}{\left(-b\right) - \sqrt{{b}^{2} - a \cdot \left(4 \cdot c\right)}}\right) \cdot \frac{1}{a \cdot 2}} \]
  14. Step-by-step derivation
    1. associate-*r/99.2%

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

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

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

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

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

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

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

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

Alternative 3: 99.3% accurate, 1.0× speedup?

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

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

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

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

    \[\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. Step-by-step derivation
    1. add-cube-cbrt55.9%

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

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

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

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

    \[\leadsto \frac{\color{blue}{\frac{{\left(-b\right)}^{2} - \left({b}^{2} - c \cdot \left(a \cdot 4\right)\right)}{\left(-b\right) - \sqrt{{b}^{2} - c \cdot \left(a \cdot 4\right)}}}}{a \cdot 2} \]
  9. Step-by-step derivation
    1. associate--r-99.2%

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{\frac{4 \cdot \left(a \cdot c\right)}{\left(-b\right) - \sqrt{\color{blue}{b \cdot b} - a \cdot \left(c \cdot 4\right)}}}{a \cdot 2} \]
  13. Applied egg-rr99.2%

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

Alternative 4: 85.6% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq 19.5:\\ \;\;\;\;\frac{\sqrt{b \cdot b - c \cdot \left(a \cdot 4\right)} - b}{a \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{4 \cdot \left(a \cdot c\right)}{2 \cdot \left(a \cdot \frac{c}{b} - b\right)}}{a \cdot 2}\\ \end{array} \end{array} \]
(FPCore (a b c)
 :precision binary64
 (if (<= b 19.5)
   (/ (- (sqrt (- (* b b) (* c (* a 4.0)))) b) (* a 2.0))
   (/ (/ (* 4.0 (* a c)) (* 2.0 (- (* a (/ c b)) b))) (* a 2.0))))
double code(double a, double b, double c) {
	double tmp;
	if (b <= 19.5) {
		tmp = (sqrt(((b * b) - (c * (a * 4.0)))) - b) / (a * 2.0);
	} else {
		tmp = ((4.0 * (a * c)) / (2.0 * ((a * (c / b)) - b))) / (a * 2.0);
	}
	return tmp;
}
real(8) function code(a, b, c)
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8) :: tmp
    if (b <= 19.5d0) then
        tmp = (sqrt(((b * b) - (c * (a * 4.0d0)))) - b) / (a * 2.0d0)
    else
        tmp = ((4.0d0 * (a * c)) / (2.0d0 * ((a * (c / b)) - b))) / (a * 2.0d0)
    end if
    code = tmp
end function
public static double code(double a, double b, double c) {
	double tmp;
	if (b <= 19.5) {
		tmp = (Math.sqrt(((b * b) - (c * (a * 4.0)))) - b) / (a * 2.0);
	} else {
		tmp = ((4.0 * (a * c)) / (2.0 * ((a * (c / b)) - b))) / (a * 2.0);
	}
	return tmp;
}
def code(a, b, c):
	tmp = 0
	if b <= 19.5:
		tmp = (math.sqrt(((b * b) - (c * (a * 4.0)))) - b) / (a * 2.0)
	else:
		tmp = ((4.0 * (a * c)) / (2.0 * ((a * (c / b)) - b))) / (a * 2.0)
	return tmp
function code(a, b, c)
	tmp = 0.0
	if (b <= 19.5)
		tmp = Float64(Float64(sqrt(Float64(Float64(b * b) - Float64(c * Float64(a * 4.0)))) - b) / Float64(a * 2.0));
	else
		tmp = Float64(Float64(Float64(4.0 * Float64(a * c)) / Float64(2.0 * Float64(Float64(a * Float64(c / b)) - b))) / Float64(a * 2.0));
	end
	return tmp
end
function tmp_2 = code(a, b, c)
	tmp = 0.0;
	if (b <= 19.5)
		tmp = (sqrt(((b * b) - (c * (a * 4.0)))) - b) / (a * 2.0);
	else
		tmp = ((4.0 * (a * c)) / (2.0 * ((a * (c / b)) - b))) / (a * 2.0);
	end
	tmp_2 = tmp;
end
code[a_, b_, c_] := If[LessEqual[b, 19.5], N[(N[(N[Sqrt[N[(N[(b * b), $MachinePrecision] - N[(c * N[(a * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision] / N[(a * 2.0), $MachinePrecision]), $MachinePrecision], N[(N[(N[(4.0 * N[(a * c), $MachinePrecision]), $MachinePrecision] / N[(2.0 * N[(N[(a * N[(c / b), $MachinePrecision]), $MachinePrecision] - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(a * 2.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;b \leq 19.5:\\
\;\;\;\;\frac{\sqrt{b \cdot b - c \cdot \left(a \cdot 4\right)} - b}{a \cdot 2}\\

\mathbf{else}:\\
\;\;\;\;\frac{\frac{4 \cdot \left(a \cdot c\right)}{2 \cdot \left(a \cdot \frac{c}{b} - b\right)}}{a \cdot 2}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if b < 19.5

    1. Initial program 79.1%

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

    if 19.5 < b

    1. Initial program 47.8%

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

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

      \[\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. Step-by-step derivation
      1. add-cube-cbrt47.8%

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

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

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

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

      \[\leadsto \frac{\color{blue}{\frac{{\left(-b\right)}^{2} - \left({b}^{2} - c \cdot \left(a \cdot 4\right)\right)}{\left(-b\right) - \sqrt{{b}^{2} - c \cdot \left(a \cdot 4\right)}}}}{a \cdot 2} \]
    9. Step-by-step derivation
      1. associate--r-99.2%

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{\frac{4 \cdot \left(a \cdot c\right)}{\color{blue}{2 \cdot \frac{a \cdot c}{b} - 2 \cdot b}}}{a \cdot 2} \]
    13. Step-by-step derivation
      1. distribute-lft-out--89.1%

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

        \[\leadsto \frac{\frac{4 \cdot \left(a \cdot c\right)}{2 \cdot \left(\color{blue}{a \cdot \frac{c}{b}} - b\right)}}{a \cdot 2} \]
    14. Simplified89.1%

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

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

Alternative 5: 81.7% accurate, 6.1× speedup?

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

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

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

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

    \[\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. Step-by-step derivation
    1. add-cube-cbrt55.9%

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

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

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

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

    \[\leadsto \frac{\color{blue}{\frac{{\left(-b\right)}^{2} - \left({b}^{2} - c \cdot \left(a \cdot 4\right)\right)}{\left(-b\right) - \sqrt{{b}^{2} - c \cdot \left(a \cdot 4\right)}}}}{a \cdot 2} \]
  9. Step-by-step derivation
    1. associate--r-99.2%

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

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

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

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

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

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

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

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

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

    \[\leadsto \frac{\frac{4 \cdot \left(a \cdot c\right)}{\color{blue}{2 \cdot \frac{a \cdot c}{b} - 2 \cdot b}}}{a \cdot 2} \]
  13. Step-by-step derivation
    1. distribute-lft-out--82.9%

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

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

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

Alternative 6: 81.6% accurate, 6.1× speedup?

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

\\
\frac{\frac{1}{\frac{-0.5 \cdot \frac{b}{a} + \frac{c}{b} \cdot 0.5}{c}}}{a \cdot 2}
\end{array}
Derivation
  1. Initial program 55.9%

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

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

    \[\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. Step-by-step derivation
    1. add-cube-cbrt55.9%

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

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

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

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

    \[\leadsto \frac{\color{blue}{\frac{{\left(-b\right)}^{2} - \left({b}^{2} - c \cdot \left(a \cdot 4\right)\right)}{\left(-b\right) - \sqrt{{b}^{2} - c \cdot \left(a \cdot 4\right)}}}}{a \cdot 2} \]
  9. Step-by-step derivation
    1. associate--r-99.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \frac{\frac{1}{\color{blue}{\frac{-0.5 \cdot \frac{b}{a} + 0.5 \cdot \frac{c}{b}}{c}}}}{a \cdot 2} \]
  16. Final simplification82.8%

    \[\leadsto \frac{\frac{1}{\frac{-0.5 \cdot \frac{b}{a} + \frac{c}{b} \cdot 0.5}{c}}}{a \cdot 2} \]
  17. Add Preprocessing

Alternative 7: 64.1% accurate, 29.0× speedup?

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

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

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

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

    \[\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. Taylor expanded in b around inf 64.3%

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

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

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

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

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

Reproduce

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