?

Average Accuracy: 42.8% → 77.3%
Time: 23.9s
Precision: binary64
Cost: 13896

?

\[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a} \]
\[\begin{array}{l} \mathbf{if}\;b \leq -2.2 \cdot 10^{+147}:\\ \;\;\;\;\frac{c}{b} - \frac{b}{a}\\ \mathbf{elif}\;b \leq 3.1 \cdot 10^{-57}:\\ \;\;\;\;\frac{b - \sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)}}{a} \cdot -0.5\\ \mathbf{else}:\\ \;\;\;\;\frac{-0.5}{\mathsf{fma}\left(-0.5, \frac{a}{b}, 0.5 \cdot \frac{b}{c}\right)}\\ \end{array} \]
(FPCore (a b c)
 :precision binary64
 (/ (+ (- b) (sqrt (- (* b b) (* (* 4.0 a) c)))) (* 2.0 a)))
(FPCore (a b c)
 :precision binary64
 (if (<= b -2.2e+147)
   (- (/ c b) (/ b a))
   (if (<= b 3.1e-57)
     (* (/ (- b (sqrt (fma a (* c -4.0) (* b b)))) a) -0.5)
     (/ -0.5 (fma -0.5 (/ a b) (* 0.5 (/ b c)))))))
double code(double a, double b, double c) {
	return (-b + sqrt(((b * b) - ((4.0 * a) * c)))) / (2.0 * a);
}
double code(double a, double b, double c) {
	double tmp;
	if (b <= -2.2e+147) {
		tmp = (c / b) - (b / a);
	} else if (b <= 3.1e-57) {
		tmp = ((b - sqrt(fma(a, (c * -4.0), (b * b)))) / a) * -0.5;
	} else {
		tmp = -0.5 / fma(-0.5, (a / b), (0.5 * (b / c)));
	}
	return tmp;
}
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 code(a, b, c)
	tmp = 0.0
	if (b <= -2.2e+147)
		tmp = Float64(Float64(c / b) - Float64(b / a));
	elseif (b <= 3.1e-57)
		tmp = Float64(Float64(Float64(b - sqrt(fma(a, Float64(c * -4.0), Float64(b * b)))) / a) * -0.5);
	else
		tmp = Float64(-0.5 / fma(-0.5, Float64(a / b), Float64(0.5 * Float64(b / c))));
	end
	return tmp
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]
code[a_, b_, c_] := If[LessEqual[b, -2.2e+147], N[(N[(c / b), $MachinePrecision] - N[(b / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 3.1e-57], N[(N[(N[(b - N[Sqrt[N[(a * N[(c * -4.0), $MachinePrecision] + N[(b * b), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision] * -0.5), $MachinePrecision], N[(-0.5 / N[(-0.5 * N[(a / b), $MachinePrecision] + N[(0.5 * N[(b / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}
\begin{array}{l}
\mathbf{if}\;b \leq -2.2 \cdot 10^{+147}:\\
\;\;\;\;\frac{c}{b} - \frac{b}{a}\\

\mathbf{elif}\;b \leq 3.1 \cdot 10^{-57}:\\
\;\;\;\;\frac{b - \sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)}}{a} \cdot -0.5\\

\mathbf{else}:\\
\;\;\;\;\frac{-0.5}{\mathsf{fma}\left(-0.5, \frac{a}{b}, 0.5 \cdot \frac{b}{c}\right)}\\


\end{array}

Error?

Target

Original42.8%
Target61.5%
Herbie77.3%
\[\begin{array}{l} \mathbf{if}\;b < 0:\\ \;\;\;\;\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}\\ \mathbf{else}:\\ \;\;\;\;\frac{c}{a \cdot \frac{\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}}\\ \end{array} \]

Derivation?

  1. Split input into 3 regimes
  2. if b < -2.2000000000000002e147

    1. Initial program 0.0%

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

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

      [Start]0.0

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

      neg-sub0 [=>]0.0

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

      associate-+l- [=>]0.0

      \[ \frac{\color{blue}{0 - \left(b - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}\right)}}{2 \cdot a} \]

      sub0-neg [=>]0.0

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

      neg-mul-1 [=>]0.0

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

      associate-*l/ [<=]0.0

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

      *-commutative [=>]0.0

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

      associate-/r* [=>]0.0

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

      /-rgt-identity [<=]0.0

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

      metadata-eval [<=]0.0

      \[ \frac{b - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{\color{blue}{--1}} \cdot \frac{\frac{-1}{2}}{a} \]
    3. Taylor expanded in b around -inf 50.1%

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

      \[\leadsto \color{blue}{\frac{c}{b} - \frac{b}{a}} \]
      Proof

      [Start]50.1

      \[ \frac{c}{b} + -1 \cdot \frac{b}{a} \]

      mul-1-neg [=>]50.1

      \[ \frac{c}{b} + \color{blue}{\left(-\frac{b}{a}\right)} \]

      unsub-neg [=>]50.1

      \[ \color{blue}{\frac{c}{b} - \frac{b}{a}} \]

    if -2.2000000000000002e147 < b < 3.09999999999999976e-57

    1. Initial program 81.2%

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

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

      [Start]81.2

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

      /-rgt-identity [<=]81.2

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

      metadata-eval [<=]81.2

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

      associate-/l* [<=]81.2

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

      times-frac [=>]81.0

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

      metadata-eval [=>]81.0

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

      metadata-eval [<=]81.0

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

      associate-*l/ [<=]81.0

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

      associate-/r/ [<=]81.0

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

      times-frac [<=]81.2

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

      *-commutative [=>]81.2

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

      times-frac [=>]81.2

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

    if 3.09999999999999976e-57 < b

    1. Initial program 10.9%

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

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

      [Start]10.9

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

      /-rgt-identity [<=]10.9

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

      metadata-eval [<=]10.9

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

      associate-/l* [<=]10.9

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

      times-frac [=>]10.9

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

      metadata-eval [=>]10.9

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

      metadata-eval [<=]10.9

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

      associate-*l/ [<=]10.9

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

      associate-/r/ [<=]10.9

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

      times-frac [<=]10.9

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

      *-commutative [=>]10.9

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

      times-frac [=>]10.9

      \[ \color{blue}{\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{\frac{a}{-1}} \cdot \frac{-1}{2}} \]
    3. Applied egg-rr19.5%

      \[\leadsto \color{blue}{\frac{-0.5}{\frac{a}{b - \mathsf{hypot}\left(b, \sqrt{a \cdot \left(c \cdot -4\right)}\right)}}} \]
      Proof

      [Start]10.9

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

      *-commutative [=>]10.9

      \[ \color{blue}{-0.5 \cdot \frac{b - \sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)}}{a}} \]

      clear-num [=>]10.9

      \[ -0.5 \cdot \color{blue}{\frac{1}{\frac{a}{b - \sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)}}}} \]

      un-div-inv [=>]10.9

      \[ \color{blue}{\frac{-0.5}{\frac{a}{b - \sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)}}}} \]

      fma-udef [=>]10.9

      \[ \frac{-0.5}{\frac{a}{b - \sqrt{\color{blue}{a \cdot \left(c \cdot -4\right) + b \cdot b}}}} \]

      +-commutative [=>]10.9

      \[ \frac{-0.5}{\frac{a}{b - \sqrt{\color{blue}{b \cdot b + a \cdot \left(c \cdot -4\right)}}}} \]

      add-sqr-sqrt [=>]9.4

      \[ \frac{-0.5}{\frac{a}{b - \sqrt{b \cdot b + \color{blue}{\sqrt{a \cdot \left(c \cdot -4\right)} \cdot \sqrt{a \cdot \left(c \cdot -4\right)}}}}} \]

      hypot-def [=>]19.5

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

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

      \[\leadsto \frac{-0.5}{\color{blue}{\mathsf{fma}\left(-0.5, \frac{a}{b}, 0.5 \cdot \frac{b}{c}\right)}} \]
      Proof

      [Start]0.0

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

      +-commutative [=>]0.0

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

      fma-def [=>]0.0

      \[ \frac{-0.5}{\color{blue}{\mathsf{fma}\left(-0.5, \frac{a}{b}, -2 \cdot \frac{b}{c \cdot {\left(\sqrt{-4}\right)}^{2}}\right)}} \]

      associate-*r/ [=>]0.0

      \[ \frac{-0.5}{\mathsf{fma}\left(-0.5, \frac{a}{b}, \color{blue}{\frac{-2 \cdot b}{c \cdot {\left(\sqrt{-4}\right)}^{2}}}\right)} \]

      *-commutative [=>]0.0

      \[ \frac{-0.5}{\mathsf{fma}\left(-0.5, \frac{a}{b}, \frac{-2 \cdot b}{\color{blue}{{\left(\sqrt{-4}\right)}^{2} \cdot c}}\right)} \]

      times-frac [=>]0.0

      \[ \frac{-0.5}{\mathsf{fma}\left(-0.5, \frac{a}{b}, \color{blue}{\frac{-2}{{\left(\sqrt{-4}\right)}^{2}} \cdot \frac{b}{c}}\right)} \]

      unpow2 [=>]0.0

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

      rem-square-sqrt [=>]91.2

      \[ \frac{-0.5}{\mathsf{fma}\left(-0.5, \frac{a}{b}, \frac{-2}{\color{blue}{-4}} \cdot \frac{b}{c}\right)} \]

      metadata-eval [=>]91.2

      \[ \frac{-0.5}{\mathsf{fma}\left(-0.5, \frac{a}{b}, \color{blue}{0.5} \cdot \frac{b}{c}\right)} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification79.4%

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -2.2 \cdot 10^{+147}:\\ \;\;\;\;\frac{c}{b} - \frac{b}{a}\\ \mathbf{elif}\;b \leq 3.1 \cdot 10^{-57}:\\ \;\;\;\;\frac{b - \sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)}}{a} \cdot -0.5\\ \mathbf{else}:\\ \;\;\;\;\frac{-0.5}{\mathsf{fma}\left(-0.5, \frac{a}{b}, 0.5 \cdot \frac{b}{c}\right)}\\ \end{array} \]

Alternatives

Alternative 1
Accuracy77.2%
Cost7624
\[\begin{array}{l} \mathbf{if}\;b \leq -2.8 \cdot 10^{+147}:\\ \;\;\;\;\frac{c}{b} - \frac{b}{a}\\ \mathbf{elif}\;b \leq 4.3 \cdot 10^{-64}:\\ \;\;\;\;\left(b - \sqrt{b \cdot b + a \cdot \left(c \cdot -4\right)}\right) \cdot \frac{-0.5}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{-0.5}{\mathsf{fma}\left(-0.5, \frac{a}{b}, 0.5 \cdot \frac{b}{c}\right)}\\ \end{array} \]
Alternative 2
Accuracy77.3%
Cost7624
\[\begin{array}{l} \mathbf{if}\;b \leq -3 \cdot 10^{+147}:\\ \;\;\;\;\frac{c}{b} - \frac{b}{a}\\ \mathbf{elif}\;b \leq 5 \cdot 10^{-60}:\\ \;\;\;\;\frac{\sqrt{b \cdot b - c \cdot \left(a \cdot 4\right)} - b}{a \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;\frac{-0.5}{\mathsf{fma}\left(-0.5, \frac{a}{b}, 0.5 \cdot \frac{b}{c}\right)}\\ \end{array} \]
Alternative 3
Accuracy72.8%
Cost7368
\[\begin{array}{l} \mathbf{if}\;b \leq -1.15 \cdot 10^{-49}:\\ \;\;\;\;\frac{c}{b} - \frac{b}{a}\\ \mathbf{elif}\;b \leq 9.5 \cdot 10^{-103}:\\ \;\;\;\;\frac{-0.5}{a} \cdot \left(b - \sqrt{c \cdot \left(a \cdot -4\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{-c}{b}\\ \end{array} \]
Alternative 4
Accuracy72.7%
Cost7368
\[\begin{array}{l} \mathbf{if}\;b \leq -5.1 \cdot 10^{-54}:\\ \;\;\;\;\frac{c}{b} - \frac{b}{a}\\ \mathbf{elif}\;b \leq 1.35 \cdot 10^{-102}:\\ \;\;\;\;\frac{-0.5}{a} \cdot \left(b - \sqrt{c \cdot \left(a \cdot -4\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{-0.5}{\mathsf{fma}\left(-0.5, \frac{a}{b}, 0.5 \cdot \frac{b}{c}\right)}\\ \end{array} \]
Alternative 5
Accuracy72.6%
Cost7368
\[\begin{array}{l} \mathbf{if}\;b \leq -6 \cdot 10^{-47}:\\ \;\;\;\;\frac{c}{b} - \frac{b}{a}\\ \mathbf{elif}\;b \leq 1.3 \cdot 10^{-102}:\\ \;\;\;\;\frac{\sqrt{c \cdot \left(a \cdot -4\right)} - b}{a \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;\frac{-0.5}{\mathsf{fma}\left(-0.5, \frac{a}{b}, 0.5 \cdot \frac{b}{c}\right)}\\ \end{array} \]
Alternative 6
Accuracy34.6%
Cost388
\[\begin{array}{l} \mathbf{if}\;b \leq 1.75 \cdot 10^{+75}:\\ \;\;\;\;\frac{-b}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{c}{b}\\ \end{array} \]
Alternative 7
Accuracy59.5%
Cost388
\[\begin{array}{l} \mathbf{if}\;b \leq 1.1 \cdot 10^{-214}:\\ \;\;\;\;\frac{-b}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{-c}{b}\\ \end{array} \]
Alternative 8
Accuracy10.6%
Cost192
\[\frac{c}{b} \]
Alternative 9
Accuracy3.6%
Cost64
\[1 \]

Error

Reproduce?

herbie shell --seed 2023153 
(FPCore (a b c)
  :name "The quadratic formula (r1)"
  :precision binary64

  :herbie-target
  (if (< b 0.0) (/ (+ (- b) (sqrt (- (* b b) (* (* 4.0 a) c)))) (* 2.0 a)) (/ c (* a (/ (- (- b) (sqrt (- (* b b) (* (* 4.0 a) c)))) (* 2.0 a)))))

  (/ (+ (- b) (sqrt (- (* b b) (* (* 4.0 a) c)))) (* 2.0 a)))