?

Average Error: 34.3 → 7.3
Time: 15.3s
Precision: binary64
Cost: 14092

?

\[\frac{\left(-b_2\right) + \sqrt{b_2 \cdot b_2 - a \cdot c}}{a} \]
\[\begin{array}{l} t_0 := \sqrt{b_2 \cdot b_2 - a \cdot c}\\ \mathbf{if}\;b_2 \leq -3.05 \cdot 10^{+41}:\\ \;\;\;\;\frac{b_2 \cdot -2}{a}\\ \mathbf{elif}\;b_2 \leq -1.65 \cdot 10^{-141}:\\ \;\;\;\;\frac{t_0 - b_2}{a}\\ \mathbf{elif}\;b_2 \leq 10^{+138}:\\ \;\;\;\;\frac{-c}{b_2 + t_0}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(-0.125, {\left(\frac{c}{b_2}\right)}^{2} \cdot \frac{a}{b_2}, \frac{c}{b_2} \cdot -0.5\right)\\ \end{array} \]
(FPCore (a b_2 c)
 :precision binary64
 (/ (+ (- b_2) (sqrt (- (* b_2 b_2) (* a c)))) a))
(FPCore (a b_2 c)
 :precision binary64
 (let* ((t_0 (sqrt (- (* b_2 b_2) (* a c)))))
   (if (<= b_2 -3.05e+41)
     (/ (* b_2 -2.0) a)
     (if (<= b_2 -1.65e-141)
       (/ (- t_0 b_2) a)
       (if (<= b_2 1e+138)
         (/ (- c) (+ b_2 t_0))
         (fma -0.125 (* (pow (/ c b_2) 2.0) (/ a b_2)) (* (/ c b_2) -0.5)))))))
double code(double a, double b_2, double c) {
	return (-b_2 + sqrt(((b_2 * b_2) - (a * c)))) / a;
}
double code(double a, double b_2, double c) {
	double t_0 = sqrt(((b_2 * b_2) - (a * c)));
	double tmp;
	if (b_2 <= -3.05e+41) {
		tmp = (b_2 * -2.0) / a;
	} else if (b_2 <= -1.65e-141) {
		tmp = (t_0 - b_2) / a;
	} else if (b_2 <= 1e+138) {
		tmp = -c / (b_2 + t_0);
	} else {
		tmp = fma(-0.125, (pow((c / b_2), 2.0) * (a / b_2)), ((c / b_2) * -0.5));
	}
	return tmp;
}
function code(a, b_2, c)
	return Float64(Float64(Float64(-b_2) + sqrt(Float64(Float64(b_2 * b_2) - Float64(a * c)))) / a)
end
function code(a, b_2, c)
	t_0 = sqrt(Float64(Float64(b_2 * b_2) - Float64(a * c)))
	tmp = 0.0
	if (b_2 <= -3.05e+41)
		tmp = Float64(Float64(b_2 * -2.0) / a);
	elseif (b_2 <= -1.65e-141)
		tmp = Float64(Float64(t_0 - b_2) / a);
	elseif (b_2 <= 1e+138)
		tmp = Float64(Float64(-c) / Float64(b_2 + t_0));
	else
		tmp = fma(-0.125, Float64((Float64(c / b_2) ^ 2.0) * Float64(a / b_2)), Float64(Float64(c / b_2) * -0.5));
	end
	return tmp
end
code[a_, b$95$2_, c_] := N[(N[((-b$95$2) + N[Sqrt[N[(N[(b$95$2 * b$95$2), $MachinePrecision] - N[(a * c), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]
code[a_, b$95$2_, c_] := Block[{t$95$0 = N[Sqrt[N[(N[(b$95$2 * b$95$2), $MachinePrecision] - N[(a * c), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[b$95$2, -3.05e+41], N[(N[(b$95$2 * -2.0), $MachinePrecision] / a), $MachinePrecision], If[LessEqual[b$95$2, -1.65e-141], N[(N[(t$95$0 - b$95$2), $MachinePrecision] / a), $MachinePrecision], If[LessEqual[b$95$2, 1e+138], N[((-c) / N[(b$95$2 + t$95$0), $MachinePrecision]), $MachinePrecision], N[(-0.125 * N[(N[Power[N[(c / b$95$2), $MachinePrecision], 2.0], $MachinePrecision] * N[(a / b$95$2), $MachinePrecision]), $MachinePrecision] + N[(N[(c / b$95$2), $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision]]]]]
\frac{\left(-b_2\right) + \sqrt{b_2 \cdot b_2 - a \cdot c}}{a}
\begin{array}{l}
t_0 := \sqrt{b_2 \cdot b_2 - a \cdot c}\\
\mathbf{if}\;b_2 \leq -3.05 \cdot 10^{+41}:\\
\;\;\;\;\frac{b_2 \cdot -2}{a}\\

\mathbf{elif}\;b_2 \leq -1.65 \cdot 10^{-141}:\\
\;\;\;\;\frac{t_0 - b_2}{a}\\

\mathbf{elif}\;b_2 \leq 10^{+138}:\\
\;\;\;\;\frac{-c}{b_2 + t_0}\\

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


\end{array}

Error?

Derivation?

  1. Split input into 4 regimes
  2. if b_2 < -3.04999999999999999e41

    1. Initial program 36.7

      \[\frac{\left(-b_2\right) + \sqrt{b_2 \cdot b_2 - a \cdot c}}{a} \]
    2. Simplified36.7

      \[\leadsto \color{blue}{\frac{\sqrt{b_2 \cdot b_2 - a \cdot c} - b_2}{a}} \]
      Proof

      [Start]36.7

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

      +-commutative [=>]36.7

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

      unsub-neg [=>]36.7

      \[ \frac{\color{blue}{\sqrt{b_2 \cdot b_2 - a \cdot c} - b_2}}{a} \]
    3. Taylor expanded in b_2 around -inf 6.5

      \[\leadsto \frac{\color{blue}{-2 \cdot b_2}}{a} \]
    4. Simplified6.5

      \[\leadsto \frac{\color{blue}{b_2 \cdot -2}}{a} \]
      Proof

      [Start]6.5

      \[ \frac{-2 \cdot b_2}{a} \]

      *-commutative [=>]6.5

      \[ \frac{\color{blue}{b_2 \cdot -2}}{a} \]

    if -3.04999999999999999e41 < b_2 < -1.65e-141

    1. Initial program 5.9

      \[\frac{\left(-b_2\right) + \sqrt{b_2 \cdot b_2 - a \cdot c}}{a} \]
    2. Simplified5.9

      \[\leadsto \color{blue}{\frac{\sqrt{b_2 \cdot b_2 - a \cdot c} - b_2}{a}} \]
      Proof

      [Start]5.9

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

      +-commutative [=>]5.9

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

      unsub-neg [=>]5.9

      \[ \frac{\color{blue}{\sqrt{b_2 \cdot b_2 - a \cdot c} - b_2}}{a} \]

    if -1.65e-141 < b_2 < 1e138

    1. Initial program 30.2

      \[\frac{\left(-b_2\right) + \sqrt{b_2 \cdot b_2 - a \cdot c}}{a} \]
    2. Simplified30.2

      \[\leadsto \color{blue}{\frac{\sqrt{b_2 \cdot b_2 - a \cdot c} - b_2}{a}} \]
      Proof

      [Start]30.2

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

      +-commutative [=>]30.2

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

      unsub-neg [=>]30.2

      \[ \frac{\color{blue}{\sqrt{b_2 \cdot b_2 - a \cdot c} - b_2}}{a} \]
    3. Applied egg-rr30.3

      \[\leadsto \color{blue}{\frac{1}{a} \cdot \left(\sqrt{b_2 \cdot b_2 - a \cdot c} - b_2\right)} \]
    4. Applied egg-rr31.0

      \[\leadsto \color{blue}{\frac{\frac{1}{a}}{\frac{b_2 + \sqrt{\mathsf{fma}\left(b_2, b_2, a \cdot \left(-c\right)\right)}}{b_2 \cdot b_2 - \mathsf{fma}\left(b_2, b_2, a \cdot c\right)}}} \]
    5. Simplified35.7

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

      [Start]31.0

      \[ \frac{\frac{1}{a}}{\frac{b_2 + \sqrt{\mathsf{fma}\left(b_2, b_2, a \cdot \left(-c\right)\right)}}{b_2 \cdot b_2 - \mathsf{fma}\left(b_2, b_2, a \cdot c\right)}} \]

      remove-double-neg [<=]31.0

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

      +-commutative [<=]31.0

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

      sub-neg [<=]31.0

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

      sqr-neg [<=]31.0

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

      fma-udef [=>]31.0

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

      sqr-neg [<=]31.0

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

      +-commutative [=>]31.0

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

      associate--r+ [=>]31.0

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

      unsub-neg [<=]31.0

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

      sqr-neg [=>]31.0

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

      distribute-rgt-neg-out [<=]31.0

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

      fma-udef [<=]31.0

      \[ \frac{\frac{1}{a}}{\frac{\sqrt{\mathsf{fma}\left(b_2, b_2, a \cdot \left(-c\right)\right)} - \left(-b_2\right)}{\color{blue}{\mathsf{fma}\left(b_2, b_2, a \cdot \left(-c\right)\right)} - \left(-b_2\right) \cdot \left(-b_2\right)}} \]
    6. Applied egg-rr37.2

      \[\leadsto \color{blue}{\frac{b_2}{a} \cdot \frac{b_2}{b_2 + \sqrt{b_2 \cdot b_2 - c \cdot a}} + \left(-\frac{\mathsf{fma}\left(b_2, b_2, c \cdot a\right)}{a \cdot \left(b_2 + \sqrt{b_2 \cdot b_2 - c \cdot a}\right)}\right)} \]
    7. Simplified15.6

      \[\leadsto \color{blue}{\frac{\frac{a \cdot \left(-c\right)}{a}}{b_2 + \sqrt{b_2 \cdot b_2 - c \cdot a}}} \]
      Proof

      [Start]37.2

      \[ \frac{b_2}{a} \cdot \frac{b_2}{b_2 + \sqrt{b_2 \cdot b_2 - c \cdot a}} + \left(-\frac{\mathsf{fma}\left(b_2, b_2, c \cdot a\right)}{a \cdot \left(b_2 + \sqrt{b_2 \cdot b_2 - c \cdot a}\right)}\right) \]

      sub-neg [<=]37.2

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

      associate-*r/ [=>]37.7

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

      associate-*l/ [=>]37.7

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

      associate-/r* [<=]36.4

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

      div-sub [<=]35.7

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

      associate-/r* [=>]31.0

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

      fma-udef [=>]31.0

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

      associate--r+ [=>]15.6

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

      +-inverses [=>]15.6

      \[ \frac{\frac{\color{blue}{0} - c \cdot a}{a}}{b_2 + \sqrt{b_2 \cdot b_2 - c \cdot a}} \]

      neg-sub0 [<=]15.6

      \[ \frac{\frac{\color{blue}{-c \cdot a}}{a}}{b_2 + \sqrt{b_2 \cdot b_2 - c \cdot a}} \]

      distribute-lft-neg-in [=>]15.6

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

      *-commutative [=>]15.6

      \[ \frac{\frac{\color{blue}{a \cdot \left(-c\right)}}{a}}{b_2 + \sqrt{b_2 \cdot b_2 - c \cdot a}} \]
    8. Taylor expanded in a around 0 10.5

      \[\leadsto \frac{\color{blue}{-1 \cdot c}}{b_2 + \sqrt{b_2 \cdot b_2 - c \cdot a}} \]
    9. Simplified10.5

      \[\leadsto \frac{\color{blue}{-c}}{b_2 + \sqrt{b_2 \cdot b_2 - c \cdot a}} \]
      Proof

      [Start]10.5

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

      mul-1-neg [=>]10.5

      \[ \frac{\color{blue}{-c}}{b_2 + \sqrt{b_2 \cdot b_2 - c \cdot a}} \]

    if 1e138 < b_2

    1. Initial program 62.4

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

      \[\leadsto \color{blue}{\frac{\sqrt{b_2 \cdot b_2 - a \cdot c} - b_2}{a}} \]
      Proof

      [Start]62.4

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

      +-commutative [=>]62.4

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

      unsub-neg [=>]62.4

      \[ \frac{\color{blue}{\sqrt{b_2 \cdot b_2 - a \cdot c} - b_2}}{a} \]
    3. Taylor expanded in b_2 around inf 19.5

      \[\leadsto \color{blue}{-0.125 \cdot \frac{{c}^{2} \cdot a}{{b_2}^{3}} + -0.5 \cdot \frac{c}{b_2}} \]
    4. Simplified16.5

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

      [Start]19.5

      \[ -0.125 \cdot \frac{{c}^{2} \cdot a}{{b_2}^{3}} + -0.5 \cdot \frac{c}{b_2} \]

      fma-def [=>]19.5

      \[ \color{blue}{\mathsf{fma}\left(-0.125, \frac{{c}^{2} \cdot a}{{b_2}^{3}}, -0.5 \cdot \frac{c}{b_2}\right)} \]

      associate-/l* [=>]16.5

      \[ \mathsf{fma}\left(-0.125, \color{blue}{\frac{{c}^{2}}{\frac{{b_2}^{3}}{a}}}, -0.5 \cdot \frac{c}{b_2}\right) \]

      unpow2 [=>]16.5

      \[ \mathsf{fma}\left(-0.125, \frac{\color{blue}{c \cdot c}}{\frac{{b_2}^{3}}{a}}, -0.5 \cdot \frac{c}{b_2}\right) \]
    5. Applied egg-rr2.1

      \[\leadsto \mathsf{fma}\left(-0.125, \color{blue}{{\left(\frac{c}{b_2}\right)}^{2} \cdot \frac{a}{b_2}}, -0.5 \cdot \frac{c}{b_2}\right) \]
  3. Recombined 4 regimes into one program.
  4. Final simplification7.3

    \[\leadsto \begin{array}{l} \mathbf{if}\;b_2 \leq -3.05 \cdot 10^{+41}:\\ \;\;\;\;\frac{b_2 \cdot -2}{a}\\ \mathbf{elif}\;b_2 \leq -1.65 \cdot 10^{-141}:\\ \;\;\;\;\frac{\sqrt{b_2 \cdot b_2 - a \cdot c} - b_2}{a}\\ \mathbf{elif}\;b_2 \leq 10^{+138}:\\ \;\;\;\;\frac{-c}{b_2 + \sqrt{b_2 \cdot b_2 - a \cdot c}}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(-0.125, {\left(\frac{c}{b_2}\right)}^{2} \cdot \frac{a}{b_2}, \frac{c}{b_2} \cdot -0.5\right)\\ \end{array} \]

Alternatives

Alternative 1
Error7.4
Cost7564
\[\begin{array}{l} t_0 := \sqrt{b_2 \cdot b_2 - a \cdot c}\\ \mathbf{if}\;b_2 \leq -1.58 \cdot 10^{+41}:\\ \;\;\;\;\frac{b_2 \cdot -2}{a}\\ \mathbf{elif}\;b_2 \leq -1.65 \cdot 10^{-141}:\\ \;\;\;\;\frac{t_0 - b_2}{a}\\ \mathbf{elif}\;b_2 \leq 3.5 \cdot 10^{+93}:\\ \;\;\;\;\frac{-c}{b_2 + t_0}\\ \mathbf{else}:\\ \;\;\;\;\frac{c}{b_2} \cdot -0.5\\ \end{array} \]
Alternative 2
Error10.5
Cost7368
\[\begin{array}{l} \mathbf{if}\;b_2 \leq -3.15 \cdot 10^{+41}:\\ \;\;\;\;\frac{b_2 \cdot -2}{a}\\ \mathbf{elif}\;b_2 \leq 6.4 \cdot 10^{-40}:\\ \;\;\;\;\frac{\sqrt{b_2 \cdot b_2 - a \cdot c} - b_2}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{c}{b_2} \cdot -0.5\\ \end{array} \]
Alternative 3
Error13.3
Cost7304
\[\begin{array}{l} \mathbf{if}\;b_2 \leq -1.8 \cdot 10^{-88}:\\ \;\;\;\;-2 \cdot \frac{b_2}{a} + \frac{c}{b_2} \cdot 0.5\\ \mathbf{elif}\;b_2 \leq 6.8 \cdot 10^{-47}:\\ \;\;\;\;\frac{1}{a} \cdot \left(\sqrt{a \cdot \left(-c\right)} - b_2\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{c}{b_2} \cdot -0.5\\ \end{array} \]
Alternative 4
Error13.3
Cost7176
\[\begin{array}{l} \mathbf{if}\;b_2 \leq -2.1 \cdot 10^{-89}:\\ \;\;\;\;-2 \cdot \frac{b_2}{a} + \frac{c}{b_2} \cdot 0.5\\ \mathbf{elif}\;b_2 \leq 1.7 \cdot 10^{-47}:\\ \;\;\;\;\frac{\sqrt{a \cdot \left(-c\right)} - b_2}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{c}{b_2} \cdot -0.5\\ \end{array} \]
Alternative 5
Error36.4
Cost452
\[\begin{array}{l} \mathbf{if}\;b_2 \leq 1.45 \cdot 10^{-219}:\\ \;\;\;\;\frac{-b_2}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{c}{b_2} \cdot -0.5\\ \end{array} \]
Alternative 6
Error22.2
Cost452
\[\begin{array}{l} \mathbf{if}\;b_2 \leq 1.5 \cdot 10^{-219}:\\ \;\;\;\;\frac{-2}{\frac{a}{b_2}}\\ \mathbf{else}:\\ \;\;\;\;\frac{c}{b_2} \cdot -0.5\\ \end{array} \]
Alternative 7
Error22.2
Cost452
\[\begin{array}{l} \mathbf{if}\;b_2 \leq 2.5 \cdot 10^{-219}:\\ \;\;\;\;\frac{b_2 \cdot -2}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{c}{b_2} \cdot -0.5\\ \end{array} \]
Alternative 8
Error53.2
Cost388
\[\begin{array}{l} \mathbf{if}\;b_2 \leq -1.35 \cdot 10^{-276}:\\ \;\;\;\;\frac{-b_2}{a}\\ \mathbf{else}:\\ \;\;\;\;0\\ \end{array} \]
Alternative 9
Error56.3
Cost64
\[0 \]

Error

Reproduce?

herbie shell --seed 2023034 
(FPCore (a b_2 c)
  :name "quad2p (problem 3.2.1, positive)"
  :precision binary64
  (/ (+ (- b_2) (sqrt (- (* b_2 b_2) (* a c)))) a))