?

Average Accuracy: 55.5% → 92.0%
Time: 25.4s
Precision: binary64
Cost: 54468

?

\[\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)\]
\[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a} \]
\[\begin{array}{l} t_0 := c \cdot \left(a \cdot -4\right)\\ t_1 := \sqrt{b + \sqrt{\mathsf{fma}\left(b, b, t_0\right)}}\\ \mathbf{if}\;\frac{\sqrt{b \cdot b + t_0} - b}{a \cdot 2} \leq -100:\\ \;\;\;\;\frac{\frac{\frac{b \cdot b - \mathsf{fma}\left(b, b, 4 \cdot \left(a \cdot c\right)\right)}{t_1}}{t_1}}{a \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;\left(\mathsf{fma}\left(-0.25, \frac{a \cdot a}{{b}^{7}} \cdot \left(\frac{a}{0.05} \cdot {c}^{4}\right), \frac{\left(a \cdot \left(a \cdot -2\right)\right) \cdot {c}^{3}}{{b}^{5}}\right) - \frac{c}{b}\right) - a \cdot \left(\frac{c}{b} \cdot \frac{c}{b \cdot b}\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
 (let* ((t_0 (* c (* a -4.0))) (t_1 (sqrt (+ b (sqrt (fma b b t_0))))))
   (if (<= (/ (- (sqrt (+ (* b b) t_0)) b) (* a 2.0)) -100.0)
     (/ (/ (/ (- (* b b) (fma b b (* 4.0 (* a c)))) t_1) t_1) (* a 2.0))
     (-
      (-
       (fma
        -0.25
        (* (/ (* a a) (pow b 7.0)) (* (/ a 0.05) (pow c 4.0)))
        (/ (* (* a (* a -2.0)) (pow c 3.0)) (pow b 5.0)))
       (/ c b))
      (* a (* (/ c b) (/ c (* b b))))))))
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 = c * (a * -4.0);
	double t_1 = sqrt((b + sqrt(fma(b, b, t_0))));
	double tmp;
	if (((sqrt(((b * b) + t_0)) - b) / (a * 2.0)) <= -100.0) {
		tmp = ((((b * b) - fma(b, b, (4.0 * (a * c)))) / t_1) / t_1) / (a * 2.0);
	} else {
		tmp = (fma(-0.25, (((a * a) / pow(b, 7.0)) * ((a / 0.05) * pow(c, 4.0))), (((a * (a * -2.0)) * pow(c, 3.0)) / pow(b, 5.0))) - (c / b)) - (a * ((c / b) * (c / (b * b))));
	}
	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(c * Float64(a * -4.0))
	t_1 = sqrt(Float64(b + sqrt(fma(b, b, t_0))))
	tmp = 0.0
	if (Float64(Float64(sqrt(Float64(Float64(b * b) + t_0)) - b) / Float64(a * 2.0)) <= -100.0)
		tmp = Float64(Float64(Float64(Float64(Float64(b * b) - fma(b, b, Float64(4.0 * Float64(a * c)))) / t_1) / t_1) / Float64(a * 2.0));
	else
		tmp = Float64(Float64(fma(-0.25, Float64(Float64(Float64(a * a) / (b ^ 7.0)) * Float64(Float64(a / 0.05) * (c ^ 4.0))), Float64(Float64(Float64(a * Float64(a * -2.0)) * (c ^ 3.0)) / (b ^ 5.0))) - Float64(c / b)) - Float64(a * Float64(Float64(c / b) * Float64(c / Float64(b * b)))));
	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[(c * N[(a * -4.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Sqrt[N[(b + N[Sqrt[N[(b * b + t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(N[(N[Sqrt[N[(N[(b * b), $MachinePrecision] + t$95$0), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision] / N[(a * 2.0), $MachinePrecision]), $MachinePrecision], -100.0], N[(N[(N[(N[(N[(b * b), $MachinePrecision] - N[(b * b + N[(4.0 * N[(a * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision] / t$95$1), $MachinePrecision] / N[(a * 2.0), $MachinePrecision]), $MachinePrecision], N[(N[(N[(-0.25 * N[(N[(N[(a * a), $MachinePrecision] / N[Power[b, 7.0], $MachinePrecision]), $MachinePrecision] * N[(N[(a / 0.05), $MachinePrecision] * N[Power[c, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(a * N[(a * -2.0), $MachinePrecision]), $MachinePrecision] * N[Power[c, 3.0], $MachinePrecision]), $MachinePrecision] / N[Power[b, 5.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(c / b), $MachinePrecision]), $MachinePrecision] - N[(a * N[(N[(c / b), $MachinePrecision] * N[(c / N[(b * b), $MachinePrecision]), $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}
t_0 := c \cdot \left(a \cdot -4\right)\\
t_1 := \sqrt{b + \sqrt{\mathsf{fma}\left(b, b, t_0\right)}}\\
\mathbf{if}\;\frac{\sqrt{b \cdot b + t_0} - b}{a \cdot 2} \leq -100:\\
\;\;\;\;\frac{\frac{\frac{b \cdot b - \mathsf{fma}\left(b, b, 4 \cdot \left(a \cdot c\right)\right)}{t_1}}{t_1}}{a \cdot 2}\\

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


\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)) < -100

    1. Initial program 86.7%

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

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

      [Start]86.7

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

      *-commutative [=>]86.7

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

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

      [Start]86.7

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

      +-commutative [=>]86.7

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

      flip-+ [=>]86.7

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

      add-sqr-sqrt [=>]0.0

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

      sqrt-unprod [=>]1.5

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

      sqr-neg [=>]1.5

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

      sqrt-prod [=>]1.5

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

      add-sqr-sqrt [<=]1.5

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

      unsub-neg [<=]1.5

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

      +-commutative [<=]1.5

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

      add-sqr-sqrt [=>]0.0

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

      associate-/r* [=>]0.0

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

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

    1. Initial program 53.4%

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

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

      [Start]53.4

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

      *-commutative [=>]53.4

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

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

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

      [Start]92.3

      \[ -1 \cdot \frac{{c}^{2} \cdot a}{{b}^{3}} + \left(-1 \cdot \frac{c}{b} + \left(-0.25 \cdot \frac{{a}^{3} \cdot \left(16 \cdot \frac{{c}^{4}}{{b}^{6}} + {\left(-2 \cdot \frac{{c}^{2}}{{b}^{3}}\right)}^{2}\right)}{b} + -2 \cdot \frac{{c}^{3} \cdot {a}^{2}}{{b}^{5}}\right)\right) \]

      +-commutative [=>]92.3

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

      mul-1-neg [=>]92.3

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

      unsub-neg [=>]92.3

      \[ \color{blue}{\left(-1 \cdot \frac{c}{b} + \left(-0.25 \cdot \frac{{a}^{3} \cdot \left(16 \cdot \frac{{c}^{4}}{{b}^{6}} + {\left(-2 \cdot \frac{{c}^{2}}{{b}^{3}}\right)}^{2}\right)}{b} + -2 \cdot \frac{{c}^{3} \cdot {a}^{2}}{{b}^{5}}\right)\right) - \frac{{c}^{2} \cdot a}{{b}^{3}}} \]
    5. Taylor expanded in b around 0 92.3%

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

      \[\leadsto \left(\mathsf{fma}\left(-0.25, \color{blue}{\frac{{a}^{3}}{\frac{{b}^{7}}{{c}^{4} \cdot 20}}}, \frac{\left(\left(a \cdot -2\right) \cdot a\right) \cdot {c}^{3}}{{b}^{5}}\right) - \frac{c}{b}\right) - \frac{c \cdot c}{{b}^{3}} \cdot a \]
      Proof

      [Start]92.3

      \[ \left(\mathsf{fma}\left(-0.25, \frac{{a}^{3} \cdot \left(4 \cdot {c}^{4} + 16 \cdot {c}^{4}\right)}{{b}^{7}}, \frac{\left(\left(a \cdot -2\right) \cdot a\right) \cdot {c}^{3}}{{b}^{5}}\right) - \frac{c}{b}\right) - \frac{c \cdot c}{{b}^{3}} \cdot a \]

      associate-/l* [=>]92.3

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

      distribute-rgt-out [=>]92.3

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

      metadata-eval [=>]92.3

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

      \[\leadsto \left(\mathsf{fma}\left(-0.25, \frac{{a}^{3}}{\frac{{b}^{7}}{{c}^{4} \cdot 20}}, \frac{\left(\left(a \cdot -2\right) \cdot a\right) \cdot {c}^{3}}{{b}^{5}}\right) - \frac{c}{b}\right) - \color{blue}{\left(\frac{c}{b \cdot b} \cdot \frac{c}{b}\right)} \cdot a \]
      Proof

      [Start]92.3

      \[ \left(\mathsf{fma}\left(-0.25, \frac{{a}^{3}}{\frac{{b}^{7}}{{c}^{4} \cdot 20}}, \frac{\left(\left(a \cdot -2\right) \cdot a\right) \cdot {c}^{3}}{{b}^{5}}\right) - \frac{c}{b}\right) - \frac{c \cdot c}{{b}^{3}} \cdot a \]

      unpow3 [=>]92.3

      \[ \left(\mathsf{fma}\left(-0.25, \frac{{a}^{3}}{\frac{{b}^{7}}{{c}^{4} \cdot 20}}, \frac{\left(\left(a \cdot -2\right) \cdot a\right) \cdot {c}^{3}}{{b}^{5}}\right) - \frac{c}{b}\right) - \frac{c \cdot c}{\color{blue}{\left(b \cdot b\right) \cdot b}} \cdot a \]

      times-frac [=>]92.3

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

      \[\leadsto \left(\mathsf{fma}\left(-0.25, \color{blue}{\frac{a \cdot a}{{b}^{7}} \cdot \left(\frac{a}{0.05} \cdot {c}^{4}\right)}, \frac{\left(\left(a \cdot -2\right) \cdot a\right) \cdot {c}^{3}}{{b}^{5}}\right) - \frac{c}{b}\right) - \left(\frac{c}{b \cdot b} \cdot \frac{c}{b}\right) \cdot a \]
      Proof

      [Start]92.3

      \[ \left(\mathsf{fma}\left(-0.25, \frac{{a}^{3}}{\frac{{b}^{7}}{{c}^{4} \cdot 20}}, \frac{\left(\left(a \cdot -2\right) \cdot a\right) \cdot {c}^{3}}{{b}^{5}}\right) - \frac{c}{b}\right) - \left(\frac{c}{b \cdot b} \cdot \frac{c}{b}\right) \cdot a \]

      unpow3 [=>]92.3

      \[ \left(\mathsf{fma}\left(-0.25, \frac{\color{blue}{\left(a \cdot a\right) \cdot a}}{\frac{{b}^{7}}{{c}^{4} \cdot 20}}, \frac{\left(\left(a \cdot -2\right) \cdot a\right) \cdot {c}^{3}}{{b}^{5}}\right) - \frac{c}{b}\right) - \left(\frac{c}{b \cdot b} \cdot \frac{c}{b}\right) \cdot a \]

      div-inv [=>]92.3

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

      times-frac [=>]92.3

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

      *-commutative [=>]92.3

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

      associate-/r* [=>]92.3

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

      associate-/r/ [=>]92.3

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

      metadata-eval [=>]92.3

      \[ \left(\mathsf{fma}\left(-0.25, \frac{a \cdot a}{{b}^{7}} \cdot \left(\frac{a}{\color{blue}{0.05}} \cdot {c}^{4}\right), \frac{\left(\left(a \cdot -2\right) \cdot a\right) \cdot {c}^{3}}{{b}^{5}}\right) - \frac{c}{b}\right) - \left(\frac{c}{b \cdot b} \cdot \frac{c}{b}\right) \cdot a \]
  3. Recombined 2 regimes into one program.
  4. Final simplification92.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{\sqrt{b \cdot b + c \cdot \left(a \cdot -4\right)} - b}{a \cdot 2} \leq -100:\\ \;\;\;\;\frac{\frac{\frac{b \cdot b - \mathsf{fma}\left(b, b, 4 \cdot \left(a \cdot c\right)\right)}{\sqrt{b + \sqrt{\mathsf{fma}\left(b, b, c \cdot \left(a \cdot -4\right)\right)}}}}{\sqrt{b + \sqrt{\mathsf{fma}\left(b, b, c \cdot \left(a \cdot -4\right)\right)}}}}{a \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;\left(\mathsf{fma}\left(-0.25, \frac{a \cdot a}{{b}^{7}} \cdot \left(\frac{a}{0.05} \cdot {c}^{4}\right), \frac{\left(a \cdot \left(a \cdot -2\right)\right) \cdot {c}^{3}}{{b}^{5}}\right) - \frac{c}{b}\right) - a \cdot \left(\frac{c}{b} \cdot \frac{c}{b \cdot b}\right)\\ \end{array} \]

Alternatives

Alternative 1
Accuracy92.1%
Cost42052
\[\begin{array}{l} t_0 := \mathsf{fma}\left(c, a \cdot -4, b \cdot b\right)\\ \mathbf{if}\;\frac{\sqrt{b \cdot b + c \cdot \left(a \cdot -4\right)} - b}{a \cdot 2} \leq -100:\\ \;\;\;\;\frac{\frac{b \cdot b - t_0}{\left(-b\right) - \sqrt{t_0}}}{a \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;\left(\mathsf{fma}\left(-0.25, \frac{a \cdot a}{{b}^{7}} \cdot \left(\frac{a}{0.05} \cdot {c}^{4}\right), \frac{\left(a \cdot \left(a \cdot -2\right)\right) \cdot {c}^{3}}{{b}^{5}}\right) - \frac{c}{b}\right) - a \cdot \left(\frac{c}{b} \cdot \frac{c}{b \cdot b}\right)\\ \end{array} \]
Alternative 2
Accuracy89.2%
Cost28292
\[\begin{array}{l} t_0 := \mathsf{fma}\left(c, a \cdot -4, b \cdot b\right)\\ \mathbf{if}\;\frac{\sqrt{b \cdot b + c \cdot \left(a \cdot -4\right)} - b}{a \cdot 2} \leq -0.028:\\ \;\;\;\;\frac{\frac{b \cdot b - t_0}{\left(-b\right) - \sqrt{t_0}}}{a \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;\left(\frac{\left(a \cdot \left(a \cdot -2\right)\right) \cdot {c}^{3}}{{b}^{5}} - \frac{c}{b}\right) - \frac{\frac{a \cdot \left(c \cdot c\right)}{b \cdot b}}{b}\\ \end{array} \]
Alternative 3
Accuracy89.0%
Cost28228
\[\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 -0.028:\\ \;\;\;\;\frac{\frac{b \cdot b - \mathsf{fma}\left(b, b, 4 \cdot \left(a \cdot c\right)\right)}{b + \sqrt{\mathsf{fma}\left(b, b, t_0\right)}}}{a \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;\left(\frac{\left(a \cdot \left(a \cdot -2\right)\right) \cdot {c}^{3}}{{b}^{5}} - \frac{c}{b}\right) - \frac{\frac{a \cdot \left(c \cdot c\right)}{b \cdot b}}{b}\\ \end{array} \]
Alternative 4
Accuracy88.8%
Cost21956
\[\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 -0.028:\\ \;\;\;\;\frac{\sqrt{\mathsf{fma}\left(b, b, t_0\right)} - b}{a \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;\left(\frac{\left(a \cdot \left(a \cdot -2\right)\right) \cdot {c}^{3}}{{b}^{5}} - \frac{c}{b}\right) - \frac{\frac{a \cdot \left(c \cdot c\right)}{b \cdot b}}{b}\\ \end{array} \]
Alternative 5
Accuracy85.1%
Cost21060
\[\begin{array}{l} \mathbf{if}\;\frac{\sqrt{b \cdot b + c \cdot \left(a \cdot -4\right)} - b}{a \cdot 2} \leq -0.028:\\ \;\;\;\;\left(\sqrt{\mathsf{fma}\left(b, b, \left(a \cdot c\right) \cdot -4\right)} - b\right) \cdot \frac{0.5}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{-c}{b} - \frac{c}{\frac{\frac{{b}^{3}}{a}}{c}}\\ \end{array} \]
Alternative 6
Accuracy85.1%
Cost21060
\[\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 -0.028:\\ \;\;\;\;\frac{\sqrt{\mathsf{fma}\left(b, b, t_0\right)} - b}{a \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;\frac{-c}{b} - \frac{c}{\frac{\frac{{b}^{3}}{a}}{c}}\\ \end{array} \]
Alternative 7
Accuracy85.1%
Cost14788
\[\begin{array}{l} t_0 := \frac{\sqrt{b \cdot b + c \cdot \left(a \cdot -4\right)} - b}{a \cdot 2}\\ \mathbf{if}\;t_0 \leq -0.028:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;\frac{-c}{b} - \frac{c}{\frac{\frac{{b}^{3}}{a}}{c}}\\ \end{array} \]
Alternative 8
Accuracy84.0%
Cost7492
\[\begin{array}{l} \mathbf{if}\;b \leq 470:\\ \;\;\;\;\frac{0.5}{a} \cdot \left(\sqrt{b \cdot b + a \cdot \left(c \cdot -4\right)} - b\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{-c}{b} - \frac{c}{\frac{\frac{{b}^{3}}{a}}{c}}\\ \end{array} \]
Alternative 9
Accuracy81.5%
Cost7232
\[\frac{-c}{b} - \frac{c}{\frac{\frac{{b}^{3}}{a}}{c}} \]
Alternative 10
Accuracy81.4%
Cost1600
\[\frac{-2 \cdot \left(\frac{c \cdot c}{\frac{b \cdot b}{a} \cdot \frac{b}{a}} + \frac{c}{\frac{b}{a}}\right)}{a \cdot 2} \]
Alternative 11
Accuracy64.3%
Cost256
\[\frac{-c}{b} \]
Alternative 12
Accuracy1.6%
Cost192
\[\frac{c}{b} \]

Error

Reproduce?

herbie shell --seed 2023135 
(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)))