Average Error: 43.9 → 41.4
Time: 26.5s
Precision: binary64
Cost: 192452
\[\left(\left(1.1102230246251565 \cdot 10^{-16} < a \land a < 9007199254740992\right) \land \left(1.1102230246251565 \cdot 10^{-16} < b \land b < 9007199254740992\right)\right) \land \left(1.1102230246251565 \cdot 10^{-16} < c \land c < 9007199254740992\right)\]
\[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a} \]
\[\begin{array}{l} t_0 := \frac{\mathsf{fma}\left({\left(a \cdot c\right)}^{2}, -16, {b}^{4}\right)}{\mathsf{fma}\left(b, b, a \cdot \left(4 \cdot c\right)\right)}\\ t_1 := \mathsf{fma}\left(b, b, \mathsf{fma}\left(b, \sqrt{t_0}, t_0\right)\right)\\ \mathbf{if}\;\frac{\sqrt{b \cdot b + c \cdot \left(a \cdot -4\right)} - b}{a \cdot 2} \leq -1 \cdot 10^{-21}:\\ \;\;\;\;\frac{\frac{{t_0}^{1.5}}{t_1} - \frac{{b}^{3}}{t_1}}{a \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left({\left(\mathsf{fma}\left(b, b, \left(a \cdot c\right) \cdot -4\right)\right)}^{0.25}, {\left({\left({\left(\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)\right)}^{3}\right)}^{0.3333333333333333}\right)}^{0.25}, -b\right) \cdot \frac{0.5}{a}\\ \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
 (let* ((t_0
         (/
          (fma (pow (* a c) 2.0) -16.0 (pow b 4.0))
          (fma b b (* a (* 4.0 c)))))
        (t_1 (fma b b (fma b (sqrt t_0) t_0))))
   (if (<= (/ (- (sqrt (+ (* b b) (* c (* a -4.0)))) b) (* a 2.0)) -1e-21)
     (/ (- (/ (pow t_0 1.5) t_1) (/ (pow b 3.0) t_1)) (* a 2.0))
     (*
      (fma
       (pow (fma b b (* (* a c) -4.0)) 0.25)
       (pow (pow (pow (fma a (* c -4.0) (* b b)) 3.0) 0.3333333333333333) 0.25)
       (- b))
      (/ 0.5 a)))))
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 t_0 = fma(pow((a * c), 2.0), -16.0, pow(b, 4.0)) / fma(b, b, (a * (4.0 * c)));
	double t_1 = fma(b, b, fma(b, sqrt(t_0), t_0));
	double tmp;
	if (((sqrt(((b * b) + (c * (a * -4.0)))) - b) / (a * 2.0)) <= -1e-21) {
		tmp = ((pow(t_0, 1.5) / t_1) - (pow(b, 3.0) / t_1)) / (a * 2.0);
	} else {
		tmp = fma(pow(fma(b, b, ((a * c) * -4.0)), 0.25), pow(pow(pow(fma(a, (c * -4.0), (b * b)), 3.0), 0.3333333333333333), 0.25), -b) * (0.5 / a);
	}
	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)
	t_0 = Float64(fma((Float64(a * c) ^ 2.0), -16.0, (b ^ 4.0)) / fma(b, b, Float64(a * Float64(4.0 * c))))
	t_1 = fma(b, b, fma(b, sqrt(t_0), t_0))
	tmp = 0.0
	if (Float64(Float64(sqrt(Float64(Float64(b * b) + Float64(c * Float64(a * -4.0)))) - b) / Float64(a * 2.0)) <= -1e-21)
		tmp = Float64(Float64(Float64((t_0 ^ 1.5) / t_1) - Float64((b ^ 3.0) / t_1)) / Float64(a * 2.0));
	else
		tmp = Float64(fma((fma(b, b, Float64(Float64(a * c) * -4.0)) ^ 0.25), (((fma(a, Float64(c * -4.0), Float64(b * b)) ^ 3.0) ^ 0.3333333333333333) ^ 0.25), Float64(-b)) * Float64(0.5 / a));
	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_] := Block[{t$95$0 = N[(N[(N[Power[N[(a * c), $MachinePrecision], 2.0], $MachinePrecision] * -16.0 + N[Power[b, 4.0], $MachinePrecision]), $MachinePrecision] / N[(b * b + N[(a * N[(4.0 * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(b * b + N[(b * N[Sqrt[t$95$0], $MachinePrecision] + t$95$0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[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], -1e-21], N[(N[(N[(N[Power[t$95$0, 1.5], $MachinePrecision] / t$95$1), $MachinePrecision] - N[(N[Power[b, 3.0], $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision] / N[(a * 2.0), $MachinePrecision]), $MachinePrecision], N[(N[(N[Power[N[(b * b + N[(N[(a * c), $MachinePrecision] * -4.0), $MachinePrecision]), $MachinePrecision], 0.25], $MachinePrecision] * N[Power[N[Power[N[Power[N[(a * N[(c * -4.0), $MachinePrecision] + N[(b * b), $MachinePrecision]), $MachinePrecision], 3.0], $MachinePrecision], 0.3333333333333333], $MachinePrecision], 0.25], $MachinePrecision] + (-b)), $MachinePrecision] * N[(0.5 / a), $MachinePrecision]), $MachinePrecision]]]]
\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}
\begin{array}{l}
t_0 := \frac{\mathsf{fma}\left({\left(a \cdot c\right)}^{2}, -16, {b}^{4}\right)}{\mathsf{fma}\left(b, b, a \cdot \left(4 \cdot c\right)\right)}\\
t_1 := \mathsf{fma}\left(b, b, \mathsf{fma}\left(b, \sqrt{t_0}, t_0\right)\right)\\
\mathbf{if}\;\frac{\sqrt{b \cdot b + c \cdot \left(a \cdot -4\right)} - b}{a \cdot 2} \leq -1 \cdot 10^{-21}:\\
\;\;\;\;\frac{\frac{{t_0}^{1.5}}{t_1} - \frac{{b}^{3}}{t_1}}{a \cdot 2}\\

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


\end{array}

Error

Derivation

  1. Split input into 2 regimes
  2. if (/.f64 (+.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 4 a) c)))) (*.f64 2 a)) < -9.99999999999999908e-22

    1. Initial program 24.1

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

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

      \[\leadsto \frac{\left(-b\right) + \sqrt{\color{blue}{\left({b}^{4} - {\left(\left(a \cdot c\right) \cdot 4\right)}^{2}\right) \cdot \frac{1}{\mathsf{fma}\left(4, a \cdot c, b \cdot b\right)}}}}{2 \cdot a} \]
      Proof
      (*.f64 (-.f64 (pow.f64 b 4) (pow.f64 (*.f64 (*.f64 a c) 4) 2)) (/.f64 1 (fma.f64 4 (*.f64 a c) (*.f64 b b)))): 0 points increase in error, 0 points decrease in error
      (*.f64 (-.f64 (pow.f64 b 4) (pow.f64 (Rewrite<= *-commutative_binary64 (*.f64 4 (*.f64 a c))) 2)) (/.f64 1 (fma.f64 4 (*.f64 a c) (*.f64 b b)))): 0 points increase in error, 0 points decrease in error
    4. Applied egg-rr49.0

      \[\leadsto \frac{\color{blue}{\log \left(\frac{e^{\sqrt{\frac{\mathsf{fma}\left({\left(a \cdot c\right)}^{2}, -16, {b}^{4}\right)}{\mathsf{fma}\left(4 \cdot a, c, b \cdot b\right)}}}}{e^{b}}\right)}}{2 \cdot a} \]
    5. Applied egg-rr35.7

      \[\leadsto \frac{\color{blue}{-\log \left(\frac{e^{b - \sqrt{\frac{\mathsf{fma}\left({\left(a \cdot c\right)}^{2}, -16, {b}^{4}\right)}{\mathsf{fma}\left(a, 4 \cdot c, b \cdot b\right)}}}}{1}\right)}}{2 \cdot a} \]
    6. Applied egg-rr23.9

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

    if -9.99999999999999908e-22 < (/.f64 (+.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 4 a) c)))) (*.f64 2 a))

    1. Initial program 61.9

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

      \[\leadsto \color{blue}{\left(\sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)} - b\right) \cdot \frac{0.5}{a}} \]
      Proof
      (*.f64 (-.f64 (sqrt.f64 (fma.f64 a (*.f64 c -4) (*.f64 b b))) b) (/.f64 1/2 a)): 0 points increase in error, 0 points decrease in error
      (*.f64 (-.f64 (sqrt.f64 (fma.f64 a (*.f64 c (Rewrite<= metadata-eval (neg.f64 4))) (*.f64 b b))) b) (/.f64 1/2 a)): 0 points increase in error, 0 points decrease in error
      (*.f64 (-.f64 (sqrt.f64 (fma.f64 a (Rewrite<= distribute-rgt-neg-in_binary64 (neg.f64 (*.f64 c 4))) (*.f64 b b))) b) (/.f64 1/2 a)): 0 points increase in error, 0 points decrease in error
      (*.f64 (-.f64 (sqrt.f64 (fma.f64 a (neg.f64 (Rewrite=> *-commutative_binary64 (*.f64 4 c))) (*.f64 b b))) b) (/.f64 1/2 a)): 0 points increase in error, 0 points decrease in error
      (*.f64 (-.f64 (sqrt.f64 (fma.f64 a (Rewrite=> distribute-lft-neg-in_binary64 (*.f64 (neg.f64 4) c)) (*.f64 b b))) b) (/.f64 1/2 a)): 0 points increase in error, 0 points decrease in error
      (*.f64 (-.f64 (sqrt.f64 (Rewrite<= fma-def_binary64 (+.f64 (*.f64 a (*.f64 (neg.f64 4) c)) (*.f64 b b)))) b) (/.f64 1/2 a)): 1 points increase in error, 0 points decrease in error
      (*.f64 (-.f64 (sqrt.f64 (+.f64 (Rewrite<= associate-*l*_binary64 (*.f64 (*.f64 a (neg.f64 4)) c)) (*.f64 b b))) b) (/.f64 1/2 a)): 0 points increase in error, 0 points decrease in error
      (*.f64 (-.f64 (sqrt.f64 (+.f64 (*.f64 (Rewrite<= distribute-rgt-neg-in_binary64 (neg.f64 (*.f64 a 4))) c) (*.f64 b b))) b) (/.f64 1/2 a)): 0 points increase in error, 0 points decrease in error
      (*.f64 (-.f64 (sqrt.f64 (+.f64 (*.f64 (neg.f64 (Rewrite<= *-commutative_binary64 (*.f64 4 a))) c) (*.f64 b b))) b) (/.f64 1/2 a)): 0 points increase in error, 0 points decrease in error
      (*.f64 (-.f64 (sqrt.f64 (Rewrite<= +-commutative_binary64 (+.f64 (*.f64 b b) (*.f64 (neg.f64 (*.f64 4 a)) c)))) b) (/.f64 1/2 a)): 0 points increase in error, 0 points decrease in error
      (*.f64 (-.f64 (sqrt.f64 (Rewrite<= cancel-sign-sub-inv_binary64 (-.f64 (*.f64 b b) (*.f64 (*.f64 4 a) c)))) b) (/.f64 1/2 a)): 0 points increase in error, 0 points decrease in error
      (*.f64 (Rewrite<= unsub-neg_binary64 (+.f64 (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 4 a) c))) (neg.f64 b))) (/.f64 1/2 a)): 0 points increase in error, 0 points decrease in error
      (*.f64 (Rewrite<= +-commutative_binary64 (+.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 4 a) c))))) (/.f64 1/2 a)): 0 points increase in error, 0 points decrease in error
      (*.f64 (+.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 4 a) c)))) (/.f64 (Rewrite<= metadata-eval (/.f64 1 2)) a)): 0 points increase in error, 0 points decrease in error
      (*.f64 (+.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 4 a) c)))) (/.f64 (/.f64 (Rewrite<= metadata-eval (neg.f64 -1)) 2) a)): 0 points increase in error, 0 points decrease in error
      (*.f64 (+.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 4 a) c)))) (Rewrite<= associate-/r*_binary64 (/.f64 (neg.f64 -1) (*.f64 2 a)))): 0 points increase in error, 0 points decrease in error
      (Rewrite=> associate-*r/_binary64 (/.f64 (*.f64 (+.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 4 a) c)))) (neg.f64 -1)) (*.f64 2 a))): 17 points increase in error, 26 points decrease in error
      (Rewrite=> associate-/l*_binary64 (/.f64 (+.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 4 a) c)))) (/.f64 (*.f64 2 a) (neg.f64 -1)))): 0 points increase in error, 0 points decrease in error
      (/.f64 (+.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 4 a) c)))) (/.f64 (*.f64 2 a) (Rewrite=> metadata-eval 1))): 0 points increase in error, 0 points decrease in error
      (/.f64 (+.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 4 a) c)))) (Rewrite=> /-rgt-identity_binary64 (*.f64 2 a))): 0 points increase in error, 0 points decrease in error
    3. Applied egg-rr59.8

      \[\leadsto \color{blue}{\mathsf{fma}\left({\left(\mathsf{fma}\left(b, b, \left(a \cdot c\right) \cdot -4\right)\right)}^{0.25}, {\left(\mathsf{fma}\left(b, b, \left(a \cdot c\right) \cdot -4\right)\right)}^{0.25}, -b\right)} \cdot \frac{0.5}{a} \]
    4. Applied egg-rr57.3

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{\sqrt{b \cdot b + c \cdot \left(a \cdot -4\right)} - b}{a \cdot 2} \leq -1 \cdot 10^{-21}:\\ \;\;\;\;\frac{\frac{{\left(\frac{\mathsf{fma}\left({\left(a \cdot c\right)}^{2}, -16, {b}^{4}\right)}{\mathsf{fma}\left(b, b, a \cdot \left(4 \cdot c\right)\right)}\right)}^{1.5}}{\mathsf{fma}\left(b, b, \mathsf{fma}\left(b, \sqrt{\frac{\mathsf{fma}\left({\left(a \cdot c\right)}^{2}, -16, {b}^{4}\right)}{\mathsf{fma}\left(b, b, a \cdot \left(4 \cdot c\right)\right)}}, \frac{\mathsf{fma}\left({\left(a \cdot c\right)}^{2}, -16, {b}^{4}\right)}{\mathsf{fma}\left(b, b, a \cdot \left(4 \cdot c\right)\right)}\right)\right)} - \frac{{b}^{3}}{\mathsf{fma}\left(b, b, \mathsf{fma}\left(b, \sqrt{\frac{\mathsf{fma}\left({\left(a \cdot c\right)}^{2}, -16, {b}^{4}\right)}{\mathsf{fma}\left(b, b, a \cdot \left(4 \cdot c\right)\right)}}, \frac{\mathsf{fma}\left({\left(a \cdot c\right)}^{2}, -16, {b}^{4}\right)}{\mathsf{fma}\left(b, b, a \cdot \left(4 \cdot c\right)\right)}\right)\right)}}{a \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left({\left(\mathsf{fma}\left(b, b, \left(a \cdot c\right) \cdot -4\right)\right)}^{0.25}, {\left({\left({\left(\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)\right)}^{3}\right)}^{0.3333333333333333}\right)}^{0.25}, -b\right) \cdot \frac{0.5}{a}\\ \end{array} \]

Alternatives

Alternative 1
Error41.4
Cost100804
\[\begin{array}{l} t_0 := \frac{\mathsf{fma}\left({\left(a \cdot c\right)}^{2}, -16, {b}^{4}\right)}{\mathsf{fma}\left(b, b, a \cdot \left(4 \cdot c\right)\right)}\\ t_1 := b + \sqrt{t_0}\\ \mathbf{if}\;\frac{\sqrt{b \cdot b + c \cdot \left(a \cdot -4\right)} - b}{a \cdot 2} \leq -1 \cdot 10^{-21}:\\ \;\;\;\;\frac{\frac{t_0}{t_1} - \frac{b \cdot b}{t_1}}{a \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left({\left(\mathsf{fma}\left(b, b, \left(a \cdot c\right) \cdot -4\right)\right)}^{0.25}, {\left({\left({\left(\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)\right)}^{3}\right)}^{0.3333333333333333}\right)}^{0.25}, -b\right) \cdot \frac{0.5}{a}\\ \end{array} \]
Alternative 2
Error41.4
Cost81604
\[\begin{array}{l} t_0 := \frac{{b}^{6} + {\left(a \cdot c\right)}^{3} \cdot -64}{\mathsf{fma}\left(a \cdot \left(4 \cdot c\right), \mathsf{fma}\left(a \cdot c, 4, b \cdot b\right), {b}^{4}\right)}\\ \mathbf{if}\;\frac{\sqrt{b \cdot b + c \cdot \left(a \cdot -4\right)} - b}{a \cdot 2} \leq -1 \cdot 10^{-21}:\\ \;\;\;\;\frac{\frac{t_0 - b \cdot b}{b + \sqrt{t_0}}}{a \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left({\left(\mathsf{fma}\left(b, b, \left(a \cdot c\right) \cdot -4\right)\right)}^{0.25}, {\left({\left({\left(\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)\right)}^{3}\right)}^{0.3333333333333333}\right)}^{0.25}, -b\right) \cdot \frac{0.5}{a}\\ \end{array} \]
Alternative 3
Error41.5
Cost53764
\[\begin{array}{l} t_0 := c \cdot \left(a \cdot -4\right)\\ \mathbf{if}\;\frac{\sqrt{b \cdot b + t_0} - b}{a \cdot 2} \leq -1 \cdot 10^{-21}:\\ \;\;\;\;\frac{\sqrt{\mathsf{fma}\left(b, b, t_0\right)} - b}{a \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left({\left(\mathsf{fma}\left(b, b, \left(a \cdot c\right) \cdot -4\right)\right)}^{0.25}, {\left({\left({\left(\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)\right)}^{3}\right)}^{0.3333333333333333}\right)}^{0.25}, -b\right) \cdot \frac{0.5}{a}\\ \end{array} \]
Alternative 4
Error41.5
Cost47364
\[\begin{array}{l} t_0 := c \cdot \left(a \cdot -4\right)\\ t_1 := \mathsf{fma}\left(c, a \cdot -4, b \cdot b\right)\\ \mathbf{if}\;\frac{\sqrt{b \cdot b + t_0} - b}{a \cdot 2} \leq -1 \cdot 10^{-21}:\\ \;\;\;\;\frac{\sqrt{\mathsf{fma}\left(b, b, t_0\right)} - b}{a \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(-b\right) + \sqrt{{\left({t_1}^{2}\right)}^{0.3333333333333333} \cdot \sqrt[3]{t_1}}}{a \cdot 2}\\ \end{array} \]
Alternative 5
Error41.5
Cost40516
\[\begin{array}{l} t_0 := c \cdot \left(a \cdot -4\right)\\ \mathbf{if}\;\frac{\sqrt{b \cdot b + t_0} - b}{a \cdot 2} \leq -1 \cdot 10^{-21}:\\ \;\;\;\;\frac{\sqrt{\mathsf{fma}\left(b, b, t_0\right)} - b}{a \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(-b\right) + {\left(\sqrt[3]{{\left({\left(\mathsf{fma}\left(b, b, \left(a \cdot c\right) \cdot -4\right)\right)}^{1.5}\right)}^{3}}\right)}^{0.3333333333333333}}{a \cdot 2}\\ \end{array} \]
Alternative 6
Error41.5
Cost27652
\[\begin{array}{l} t_0 := c \cdot \left(a \cdot -4\right)\\ \mathbf{if}\;\frac{\sqrt{b \cdot b + t_0} - b}{a \cdot 2} \leq -1 \cdot 10^{-21}:\\ \;\;\;\;\frac{\sqrt{\mathsf{fma}\left(b, b, t_0\right)} - b}{a \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;\frac{0.5}{a} \cdot \left(\left(-b\right) + {\left({\left(\mathsf{fma}\left(b, b, \left(a \cdot c\right) \cdot -4\right)\right)}^{1.5}\right)}^{0.3333333333333333}\right)\\ \end{array} \]
Alternative 7
Error41.5
Cost27652
\[\begin{array}{l} t_0 := c \cdot \left(a \cdot -4\right)\\ \mathbf{if}\;\frac{\sqrt{b \cdot b + t_0} - b}{a \cdot 2} \leq -1 \cdot 10^{-21}:\\ \;\;\;\;\frac{\sqrt{\mathsf{fma}\left(b, b, t_0\right)} - b}{a \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(-b\right) + {\left({\left(\mathsf{fma}\left(c, a \cdot -4, b \cdot b\right)\right)}^{1.5}\right)}^{0.3333333333333333}}{a \cdot 2}\\ \end{array} \]
Alternative 8
Error43.0
Cost27588
\[\begin{array}{l} t_0 := c \cdot \left(a \cdot -4\right)\\ \mathbf{if}\;\frac{\sqrt{b \cdot b + t_0} - b}{a \cdot 2} \leq -4 \cdot 10^{-19}:\\ \;\;\;\;\frac{\sqrt{\mathsf{fma}\left(b, b, t_0\right)} - b}{a \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;\frac{0.5}{a} \cdot \left(e^{0.5 \cdot \log \left(\mathsf{fma}\left(b, b, \left(a \cdot c\right) \cdot -4\right)\right)} - b\right)\\ \end{array} \]
Alternative 9
Error43.8
Cost20160
\[\frac{0.5}{a} \cdot \left({\left({\left(\mathsf{fma}\left(b, b, \left(a \cdot c\right) \cdot -4\right)\right)}^{0.25}\right)}^{2} - b\right) \]
Alternative 10
Error43.8
Cost13632
\[\frac{0.5}{a} \cdot \left(\sqrt{\mathsf{fma}\left(b, b, a \cdot \left(c \cdot -4\right)\right)} - b\right) \]
Alternative 11
Error43.8
Cost13632
\[\frac{\sqrt{\mathsf{fma}\left(b, b, c \cdot \left(a \cdot -4\right)\right)} - b}{a \cdot 2} \]
Alternative 12
Error43.9
Cost7360
\[\frac{0.5}{a} \cdot \left(\sqrt{b \cdot b + \left(a \cdot c\right) \cdot -4} - b\right) \]
Alternative 13
Error43.9
Cost7360
\[\frac{\sqrt{b \cdot b + c \cdot \left(a \cdot -4\right)} - b}{a \cdot 2} \]

Error

Reproduce

herbie shell --seed 2022334 
(FPCore (a b c)
  :name "Quadratic roots, medium range"
  :precision binary64
  :pre (and (and (and (< 1.1102230246251565e-16 a) (< a 9007199254740992.0)) (and (< 1.1102230246251565e-16 b) (< b 9007199254740992.0))) (and (< 1.1102230246251565e-16 c) (< c 9007199254740992.0)))
  (/ (+ (- b) (sqrt (- (* b b) (* (* 4.0 a) c)))) (* 2.0 a)))