Average Error: 34.5 → 23.2
Time: 23.2s
Precision: binary64
Cost: 14496
\[\frac{\left(-b_2\right) - \sqrt{b_2 \cdot b_2 - a \cdot c}}{a} \]
\[\begin{array}{l} t_0 := a \cdot \left(-c\right)\\ t_1 := \sqrt{t_0}\\ t_2 := b_2 - \mathsf{hypot}\left(b_2, t_1\right)\\ t_3 := \frac{\frac{-c}{\frac{t_2}{a}}}{a}\\ t_4 := \mathsf{hypot}\left(b_2, \sqrt{a \cdot c}\right)\\ t_5 := \frac{\frac{a \cdot c}{t_4 - b_2}}{a}\\ \mathbf{if}\;b_2 \leq -8.2 \cdot 10^{+255}:\\ \;\;\;\;t_5\\ \mathbf{elif}\;b_2 \leq -6 \cdot 10^{+193}:\\ \;\;\;\;\frac{\frac{t_0}{t_2}}{a}\\ \mathbf{elif}\;b_2 \leq -1.4 \cdot 10^{+164}:\\ \;\;\;\;\frac{\frac{a}{\frac{b_2 - t_4}{-c}}}{a}\\ \mathbf{elif}\;b_2 \leq -4.2 \cdot 10^{+95}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;b_2 \leq -2.85 \cdot 10^{+45}:\\ \;\;\;\;t_5\\ \mathbf{elif}\;b_2 \leq 8.8 \cdot 10^{-272}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;b_2 \leq 1.32 \cdot 10^{+154}:\\ \;\;\;\;\frac{\left(-b_2\right) - \sqrt{b_2 \cdot b_2 - a \cdot c}}{a}\\ \mathbf{elif}\;b_2 \leq 4 \cdot 10^{+193}:\\ \;\;\;\;\frac{\left(-b_2\right) - \mathsf{hypot}\left(t_1, b_2\right)}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(-b_2\right) - t_4}{a}\\ \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 (* a (- c)))
        (t_1 (sqrt t_0))
        (t_2 (- b_2 (hypot b_2 t_1)))
        (t_3 (/ (/ (- c) (/ t_2 a)) a))
        (t_4 (hypot b_2 (sqrt (* a c))))
        (t_5 (/ (/ (* a c) (- t_4 b_2)) a)))
   (if (<= b_2 -8.2e+255)
     t_5
     (if (<= b_2 -6e+193)
       (/ (/ t_0 t_2) a)
       (if (<= b_2 -1.4e+164)
         (/ (/ a (/ (- b_2 t_4) (- c))) a)
         (if (<= b_2 -4.2e+95)
           t_3
           (if (<= b_2 -2.85e+45)
             t_5
             (if (<= b_2 8.8e-272)
               t_3
               (if (<= b_2 1.32e+154)
                 (/ (- (- b_2) (sqrt (- (* b_2 b_2) (* a c)))) a)
                 (if (<= b_2 4e+193)
                   (/ (- (- b_2) (hypot t_1 b_2)) a)
                   (/ (- (- b_2) t_4) a)))))))))))
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 = a * -c;
	double t_1 = sqrt(t_0);
	double t_2 = b_2 - hypot(b_2, t_1);
	double t_3 = (-c / (t_2 / a)) / a;
	double t_4 = hypot(b_2, sqrt((a * c)));
	double t_5 = ((a * c) / (t_4 - b_2)) / a;
	double tmp;
	if (b_2 <= -8.2e+255) {
		tmp = t_5;
	} else if (b_2 <= -6e+193) {
		tmp = (t_0 / t_2) / a;
	} else if (b_2 <= -1.4e+164) {
		tmp = (a / ((b_2 - t_4) / -c)) / a;
	} else if (b_2 <= -4.2e+95) {
		tmp = t_3;
	} else if (b_2 <= -2.85e+45) {
		tmp = t_5;
	} else if (b_2 <= 8.8e-272) {
		tmp = t_3;
	} else if (b_2 <= 1.32e+154) {
		tmp = (-b_2 - sqrt(((b_2 * b_2) - (a * c)))) / a;
	} else if (b_2 <= 4e+193) {
		tmp = (-b_2 - hypot(t_1, b_2)) / a;
	} else {
		tmp = (-b_2 - t_4) / a;
	}
	return tmp;
}
public static double code(double a, double b_2, double c) {
	return (-b_2 - Math.sqrt(((b_2 * b_2) - (a * c)))) / a;
}
public static double code(double a, double b_2, double c) {
	double t_0 = a * -c;
	double t_1 = Math.sqrt(t_0);
	double t_2 = b_2 - Math.hypot(b_2, t_1);
	double t_3 = (-c / (t_2 / a)) / a;
	double t_4 = Math.hypot(b_2, Math.sqrt((a * c)));
	double t_5 = ((a * c) / (t_4 - b_2)) / a;
	double tmp;
	if (b_2 <= -8.2e+255) {
		tmp = t_5;
	} else if (b_2 <= -6e+193) {
		tmp = (t_0 / t_2) / a;
	} else if (b_2 <= -1.4e+164) {
		tmp = (a / ((b_2 - t_4) / -c)) / a;
	} else if (b_2 <= -4.2e+95) {
		tmp = t_3;
	} else if (b_2 <= -2.85e+45) {
		tmp = t_5;
	} else if (b_2 <= 8.8e-272) {
		tmp = t_3;
	} else if (b_2 <= 1.32e+154) {
		tmp = (-b_2 - Math.sqrt(((b_2 * b_2) - (a * c)))) / a;
	} else if (b_2 <= 4e+193) {
		tmp = (-b_2 - Math.hypot(t_1, b_2)) / a;
	} else {
		tmp = (-b_2 - t_4) / a;
	}
	return tmp;
}
def code(a, b_2, c):
	return (-b_2 - math.sqrt(((b_2 * b_2) - (a * c)))) / a
def code(a, b_2, c):
	t_0 = a * -c
	t_1 = math.sqrt(t_0)
	t_2 = b_2 - math.hypot(b_2, t_1)
	t_3 = (-c / (t_2 / a)) / a
	t_4 = math.hypot(b_2, math.sqrt((a * c)))
	t_5 = ((a * c) / (t_4 - b_2)) / a
	tmp = 0
	if b_2 <= -8.2e+255:
		tmp = t_5
	elif b_2 <= -6e+193:
		tmp = (t_0 / t_2) / a
	elif b_2 <= -1.4e+164:
		tmp = (a / ((b_2 - t_4) / -c)) / a
	elif b_2 <= -4.2e+95:
		tmp = t_3
	elif b_2 <= -2.85e+45:
		tmp = t_5
	elif b_2 <= 8.8e-272:
		tmp = t_3
	elif b_2 <= 1.32e+154:
		tmp = (-b_2 - math.sqrt(((b_2 * b_2) - (a * c)))) / a
	elif b_2 <= 4e+193:
		tmp = (-b_2 - math.hypot(t_1, b_2)) / a
	else:
		tmp = (-b_2 - t_4) / a
	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 = Float64(a * Float64(-c))
	t_1 = sqrt(t_0)
	t_2 = Float64(b_2 - hypot(b_2, t_1))
	t_3 = Float64(Float64(Float64(-c) / Float64(t_2 / a)) / a)
	t_4 = hypot(b_2, sqrt(Float64(a * c)))
	t_5 = Float64(Float64(Float64(a * c) / Float64(t_4 - b_2)) / a)
	tmp = 0.0
	if (b_2 <= -8.2e+255)
		tmp = t_5;
	elseif (b_2 <= -6e+193)
		tmp = Float64(Float64(t_0 / t_2) / a);
	elseif (b_2 <= -1.4e+164)
		tmp = Float64(Float64(a / Float64(Float64(b_2 - t_4) / Float64(-c))) / a);
	elseif (b_2 <= -4.2e+95)
		tmp = t_3;
	elseif (b_2 <= -2.85e+45)
		tmp = t_5;
	elseif (b_2 <= 8.8e-272)
		tmp = t_3;
	elseif (b_2 <= 1.32e+154)
		tmp = Float64(Float64(Float64(-b_2) - sqrt(Float64(Float64(b_2 * b_2) - Float64(a * c)))) / a);
	elseif (b_2 <= 4e+193)
		tmp = Float64(Float64(Float64(-b_2) - hypot(t_1, b_2)) / a);
	else
		tmp = Float64(Float64(Float64(-b_2) - t_4) / a);
	end
	return tmp
end
function tmp = code(a, b_2, c)
	tmp = (-b_2 - sqrt(((b_2 * b_2) - (a * c)))) / a;
end
function tmp_2 = code(a, b_2, c)
	t_0 = a * -c;
	t_1 = sqrt(t_0);
	t_2 = b_2 - hypot(b_2, t_1);
	t_3 = (-c / (t_2 / a)) / a;
	t_4 = hypot(b_2, sqrt((a * c)));
	t_5 = ((a * c) / (t_4 - b_2)) / a;
	tmp = 0.0;
	if (b_2 <= -8.2e+255)
		tmp = t_5;
	elseif (b_2 <= -6e+193)
		tmp = (t_0 / t_2) / a;
	elseif (b_2 <= -1.4e+164)
		tmp = (a / ((b_2 - t_4) / -c)) / a;
	elseif (b_2 <= -4.2e+95)
		tmp = t_3;
	elseif (b_2 <= -2.85e+45)
		tmp = t_5;
	elseif (b_2 <= 8.8e-272)
		tmp = t_3;
	elseif (b_2 <= 1.32e+154)
		tmp = (-b_2 - sqrt(((b_2 * b_2) - (a * c)))) / a;
	elseif (b_2 <= 4e+193)
		tmp = (-b_2 - hypot(t_1, b_2)) / a;
	else
		tmp = (-b_2 - t_4) / a;
	end
	tmp_2 = 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[(a * (-c)), $MachinePrecision]}, Block[{t$95$1 = N[Sqrt[t$95$0], $MachinePrecision]}, Block[{t$95$2 = N[(b$95$2 - N[Sqrt[b$95$2 ^ 2 + t$95$1 ^ 2], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[((-c) / N[(t$95$2 / a), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]}, Block[{t$95$4 = N[Sqrt[b$95$2 ^ 2 + N[Sqrt[N[(a * c), $MachinePrecision]], $MachinePrecision] ^ 2], $MachinePrecision]}, Block[{t$95$5 = N[(N[(N[(a * c), $MachinePrecision] / N[(t$95$4 - b$95$2), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]}, If[LessEqual[b$95$2, -8.2e+255], t$95$5, If[LessEqual[b$95$2, -6e+193], N[(N[(t$95$0 / t$95$2), $MachinePrecision] / a), $MachinePrecision], If[LessEqual[b$95$2, -1.4e+164], N[(N[(a / N[(N[(b$95$2 - t$95$4), $MachinePrecision] / (-c)), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision], If[LessEqual[b$95$2, -4.2e+95], t$95$3, If[LessEqual[b$95$2, -2.85e+45], t$95$5, If[LessEqual[b$95$2, 8.8e-272], t$95$3, If[LessEqual[b$95$2, 1.32e+154], 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], If[LessEqual[b$95$2, 4e+193], N[(N[((-b$95$2) - N[Sqrt[t$95$1 ^ 2 + b$95$2 ^ 2], $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision], N[(N[((-b$95$2) - t$95$4), $MachinePrecision] / a), $MachinePrecision]]]]]]]]]]]]]]]
\frac{\left(-b_2\right) - \sqrt{b_2 \cdot b_2 - a \cdot c}}{a}
\begin{array}{l}
t_0 := a \cdot \left(-c\right)\\
t_1 := \sqrt{t_0}\\
t_2 := b_2 - \mathsf{hypot}\left(b_2, t_1\right)\\
t_3 := \frac{\frac{-c}{\frac{t_2}{a}}}{a}\\
t_4 := \mathsf{hypot}\left(b_2, \sqrt{a \cdot c}\right)\\
t_5 := \frac{\frac{a \cdot c}{t_4 - b_2}}{a}\\
\mathbf{if}\;b_2 \leq -8.2 \cdot 10^{+255}:\\
\;\;\;\;t_5\\

\mathbf{elif}\;b_2 \leq -6 \cdot 10^{+193}:\\
\;\;\;\;\frac{\frac{t_0}{t_2}}{a}\\

\mathbf{elif}\;b_2 \leq -1.4 \cdot 10^{+164}:\\
\;\;\;\;\frac{\frac{a}{\frac{b_2 - t_4}{-c}}}{a}\\

\mathbf{elif}\;b_2 \leq -4.2 \cdot 10^{+95}:\\
\;\;\;\;t_3\\

\mathbf{elif}\;b_2 \leq -2.85 \cdot 10^{+45}:\\
\;\;\;\;t_5\\

\mathbf{elif}\;b_2 \leq 8.8 \cdot 10^{-272}:\\
\;\;\;\;t_3\\

\mathbf{elif}\;b_2 \leq 1.32 \cdot 10^{+154}:\\
\;\;\;\;\frac{\left(-b_2\right) - \sqrt{b_2 \cdot b_2 - a \cdot c}}{a}\\

\mathbf{elif}\;b_2 \leq 4 \cdot 10^{+193}:\\
\;\;\;\;\frac{\left(-b_2\right) - \mathsf{hypot}\left(t_1, b_2\right)}{a}\\

\mathbf{else}:\\
\;\;\;\;\frac{\left(-b_2\right) - t_4}{a}\\


\end{array}

Error

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Split input into 7 regimes
  2. if b_2 < -8.2000000000000008e255 or -4.2e95 < b_2 < -2.85000000000000013e45

    1. Initial program 57.6

      \[\frac{\left(-b_2\right) - \sqrt{b_2 \cdot b_2 - a \cdot c}}{a} \]
    2. Applied egg-rr61.3

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

      \[\leadsto \frac{\color{blue}{\mathsf{hypot}\left(b_2, \sqrt{a \cdot c}\right) + b_2}}{a} \]
    4. Applied egg-rr61.0

      \[\leadsto \frac{\color{blue}{\frac{\mathsf{fma}\left(b_2, b_2, a \cdot c\right)}{\mathsf{hypot}\left(b_2, \sqrt{a \cdot c}\right) - b_2} - \frac{b_2 \cdot b_2}{\mathsf{hypot}\left(b_2, \sqrt{a \cdot c}\right) - b_2}}}{a} \]
    5. Simplified37.9

      \[\leadsto \frac{\color{blue}{\frac{a \cdot c}{\mathsf{hypot}\left(b_2, \sqrt{a \cdot c}\right) - b_2}}}{a} \]
      Proof
      (/.f64 (*.f64 a c) (-.f64 (hypot.f64 b_2 (sqrt.f64 (*.f64 a c))) b_2)): 0 points increase in error, 0 points decrease in error
      (/.f64 (Rewrite<= +-rgt-identity_binary64 (+.f64 (*.f64 a c) 0)) (-.f64 (hypot.f64 b_2 (sqrt.f64 (*.f64 a c))) b_2)): 0 points increase in error, 0 points decrease in error
      (/.f64 (+.f64 (*.f64 a c) (Rewrite<= +-inverses_binary64 (-.f64 (*.f64 b_2 b_2) (*.f64 b_2 b_2)))) (-.f64 (hypot.f64 b_2 (sqrt.f64 (*.f64 a c))) b_2)): 26 points increase in error, 0 points decrease in error
      (/.f64 (Rewrite<= associate--l+_binary64 (-.f64 (+.f64 (*.f64 a c) (*.f64 b_2 b_2)) (*.f64 b_2 b_2))) (-.f64 (hypot.f64 b_2 (sqrt.f64 (*.f64 a c))) b_2)): 6 points increase in error, 13 points decrease in error
      (/.f64 (-.f64 (Rewrite<= +-commutative_binary64 (+.f64 (*.f64 b_2 b_2) (*.f64 a c))) (*.f64 b_2 b_2)) (-.f64 (hypot.f64 b_2 (sqrt.f64 (*.f64 a c))) b_2)): 0 points increase in error, 0 points decrease in error
      (/.f64 (-.f64 (Rewrite<= fma-udef_binary64 (fma.f64 b_2 b_2 (*.f64 a c))) (*.f64 b_2 b_2)) (-.f64 (hypot.f64 b_2 (sqrt.f64 (*.f64 a c))) b_2)): 0 points increase in error, 0 points decrease in error
      (Rewrite=> div-sub_binary64 (-.f64 (/.f64 (fma.f64 b_2 b_2 (*.f64 a c)) (-.f64 (hypot.f64 b_2 (sqrt.f64 (*.f64 a c))) b_2)) (/.f64 (*.f64 b_2 b_2) (-.f64 (hypot.f64 b_2 (sqrt.f64 (*.f64 a c))) b_2)))): 0 points increase in error, 1 points decrease in error

    if -8.2000000000000008e255 < b_2 < -6e193

    1. Initial program 64.0

      \[\frac{\left(-b_2\right) - \sqrt{b_2 \cdot b_2 - a \cdot c}}{a} \]
    2. Applied egg-rr64.0

      \[\leadsto \frac{\left(-b_2\right) - \color{blue}{{\left({\left(b_2 \cdot b_2 - a \cdot c\right)}^{0.25}\right)}^{2}}}{a} \]
    3. Applied egg-rr64.0

      \[\leadsto \frac{\color{blue}{\frac{-\left(b_2 \cdot b_2 - \left(b_2 \cdot b_2 - a \cdot c\right)\right)}{b_2 - \mathsf{hypot}\left(b_2, \sqrt{-a \cdot c}\right)}}}{a} \]
    4. Simplified33.4

      \[\leadsto \frac{\color{blue}{\frac{a \cdot \left(-c\right)}{b_2 - \mathsf{hypot}\left(b_2, \sqrt{a \cdot \left(-c\right)}\right)}}}{a} \]
      Proof
      (/.f64 (*.f64 a (neg.f64 c)) (-.f64 b_2 (hypot.f64 b_2 (sqrt.f64 (*.f64 a (neg.f64 c)))))): 0 points increase in error, 0 points decrease in error
      (/.f64 (*.f64 a (neg.f64 c)) (-.f64 b_2 (hypot.f64 b_2 (sqrt.f64 (Rewrite<= distribute-rgt-neg-in_binary64 (neg.f64 (*.f64 a c))))))): 0 points increase in error, 0 points decrease in error
      (/.f64 (Rewrite<= distribute-rgt-neg-in_binary64 (neg.f64 (*.f64 a c))) (-.f64 b_2 (hypot.f64 b_2 (sqrt.f64 (neg.f64 (*.f64 a c)))))): 0 points increase in error, 0 points decrease in error
      (/.f64 (Rewrite=> neg-sub0_binary64 (-.f64 0 (*.f64 a c))) (-.f64 b_2 (hypot.f64 b_2 (sqrt.f64 (neg.f64 (*.f64 a c)))))): 0 points increase in error, 0 points decrease in error
      (/.f64 (-.f64 (Rewrite<= metadata-eval (-.f64 0 0)) (*.f64 a c)) (-.f64 b_2 (hypot.f64 b_2 (sqrt.f64 (neg.f64 (*.f64 a c)))))): 0 points increase in error, 0 points decrease in error
      (/.f64 (Rewrite<= associate--r+_binary64 (-.f64 0 (+.f64 0 (*.f64 a c)))) (-.f64 b_2 (hypot.f64 b_2 (sqrt.f64 (neg.f64 (*.f64 a c)))))): 0 points increase in error, 0 points decrease in error
      (/.f64 (-.f64 0 (+.f64 (Rewrite<= +-inverses_binary64 (-.f64 (*.f64 b_2 b_2) (*.f64 b_2 b_2))) (*.f64 a c))) (-.f64 b_2 (hypot.f64 b_2 (sqrt.f64 (neg.f64 (*.f64 a c)))))): 22 points increase in error, 0 points decrease in error
      (/.f64 (-.f64 0 (Rewrite<= associate--r-_binary64 (-.f64 (*.f64 b_2 b_2) (-.f64 (*.f64 b_2 b_2) (*.f64 a c))))) (-.f64 b_2 (hypot.f64 b_2 (sqrt.f64 (neg.f64 (*.f64 a c)))))): 8 points increase in error, 9 points decrease in error
      (/.f64 (Rewrite<= neg-sub0_binary64 (neg.f64 (-.f64 (*.f64 b_2 b_2) (-.f64 (*.f64 b_2 b_2) (*.f64 a c))))) (-.f64 b_2 (hypot.f64 b_2 (sqrt.f64 (neg.f64 (*.f64 a c)))))): 0 points increase in error, 0 points decrease in error

    if -6e193 < b_2 < -1.4000000000000001e164

    1. Initial program 64.0

      \[\frac{\left(-b_2\right) - \sqrt{b_2 \cdot b_2 - a \cdot c}}{a} \]
    2. Applied egg-rr64.0

      \[\leadsto \frac{\left(-b_2\right) - \sqrt{\color{blue}{\frac{{b_2}^{4} - \left(a \cdot \left(-c\right)\right) \cdot \left(a \cdot \left(-c\right)\right)}{b_2 \cdot b_2 - a \cdot \left(-c\right)}}}}{a} \]
    3. Applied egg-rr63.4

      \[\leadsto \frac{\color{blue}{\mathsf{fma}\left({\left(\sqrt[3]{b_2}\right)}^{2}, \sqrt[3]{b_2}, \mathsf{hypot}\left(b_2, \sqrt{a \cdot c}\right)\right)}}{a} \]
    4. Applied egg-rr64.0

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

      \[\leadsto \frac{\color{blue}{\frac{a}{\frac{b_2 - \mathsf{hypot}\left(b_2, \sqrt{a \cdot c}\right)}{-c}}}}{a} \]
      Proof
      (/.f64 a (/.f64 (-.f64 b_2 (hypot.f64 b_2 (sqrt.f64 (*.f64 a c)))) (neg.f64 c))): 0 points increase in error, 0 points decrease in error
      (Rewrite<= associate-/l*_binary64 (/.f64 (*.f64 a (neg.f64 c)) (-.f64 b_2 (hypot.f64 b_2 (sqrt.f64 (*.f64 a c)))))): 12 points increase in error, 8 points decrease in error
      (/.f64 (Rewrite<= distribute-rgt-neg-in_binary64 (neg.f64 (*.f64 a c))) (-.f64 b_2 (hypot.f64 b_2 (sqrt.f64 (*.f64 a c))))): 0 points increase in error, 0 points decrease in error
      (/.f64 (Rewrite=> neg-sub0_binary64 (-.f64 0 (*.f64 a c))) (-.f64 b_2 (hypot.f64 b_2 (sqrt.f64 (*.f64 a c))))): 0 points increase in error, 0 points decrease in error
      (Rewrite=> div-sub_binary64 (-.f64 (/.f64 0 (-.f64 b_2 (hypot.f64 b_2 (sqrt.f64 (*.f64 a c))))) (/.f64 (*.f64 a c) (-.f64 b_2 (hypot.f64 b_2 (sqrt.f64 (*.f64 a c))))))): 0 points increase in error, 0 points decrease in error
      (-.f64 (/.f64 (Rewrite<= +-inverses_binary64 (-.f64 (*.f64 b_2 b_2) (*.f64 b_2 b_2))) (-.f64 b_2 (hypot.f64 b_2 (sqrt.f64 (*.f64 a c))))) (/.f64 (*.f64 a c) (-.f64 b_2 (hypot.f64 b_2 (sqrt.f64 (*.f64 a c)))))): 26 points increase in error, 0 points decrease in error
      (Rewrite<= div-sub_binary64 (/.f64 (-.f64 (-.f64 (*.f64 b_2 b_2) (*.f64 b_2 b_2)) (*.f64 a c)) (-.f64 b_2 (hypot.f64 b_2 (sqrt.f64 (*.f64 a c)))))): 0 points increase in error, 0 points decrease in error
      (/.f64 (Rewrite<= associate--r+_binary64 (-.f64 (*.f64 b_2 b_2) (+.f64 (*.f64 b_2 b_2) (*.f64 a c)))) (-.f64 b_2 (hypot.f64 b_2 (sqrt.f64 (*.f64 a c))))): 6 points increase in error, 13 points decrease in error
      (/.f64 (-.f64 (*.f64 b_2 b_2) (Rewrite<= fma-udef_binary64 (fma.f64 b_2 b_2 (*.f64 a c)))) (-.f64 b_2 (hypot.f64 b_2 (sqrt.f64 (*.f64 a c))))): 0 points increase in error, 0 points decrease in error

    if -1.4000000000000001e164 < b_2 < -4.2e95 or -2.85000000000000013e45 < b_2 < 8.79999999999999952e-272

    1. Initial program 32.8

      \[\frac{\left(-b_2\right) - \sqrt{b_2 \cdot b_2 - a \cdot c}}{a} \]
    2. Applied egg-rr44.3

      \[\leadsto \frac{\left(-b_2\right) - \color{blue}{{\left({\left(b_2 \cdot b_2 - a \cdot c\right)}^{1.5}\right)}^{0.3333333333333333}}}{a} \]
    3. Simplified42.6

      \[\leadsto \frac{\left(-b_2\right) - \color{blue}{\sqrt[3]{{\left(b_2 \cdot b_2 - a \cdot c\right)}^{1.5}}}}{a} \]
      Proof
      (cbrt.f64 (pow.f64 (-.f64 (*.f64 b_2 b_2) (*.f64 a c)) 3/2)): 0 points increase in error, 0 points decrease in error
      (Rewrite<= unpow1/3_binary64 (pow.f64 (pow.f64 (-.f64 (*.f64 b_2 b_2) (*.f64 a c)) 3/2) 1/3)): 51 points increase in error, 71 points decrease in error
    4. Applied egg-rr34.4

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

      \[\leadsto \frac{\color{blue}{\frac{-c}{\frac{b_2 - \mathsf{hypot}\left(b_2, \sqrt{a \cdot \left(-c\right)}\right)}{a}}}}{a} \]
      Proof
      (/.f64 (neg.f64 c) (/.f64 (-.f64 b_2 (hypot.f64 b_2 (sqrt.f64 (*.f64 a (neg.f64 c))))) a)): 0 points increase in error, 0 points decrease in error
      (Rewrite<= associate-/l*_binary64 (/.f64 (*.f64 (neg.f64 c) a) (-.f64 b_2 (hypot.f64 b_2 (sqrt.f64 (*.f64 a (neg.f64 c))))))): 42 points increase in error, 27 points decrease in error
      (/.f64 (Rewrite<= *-commutative_binary64 (*.f64 a (neg.f64 c))) (-.f64 b_2 (hypot.f64 b_2 (sqrt.f64 (*.f64 a (neg.f64 c)))))): 0 points increase in error, 0 points decrease in error
      (/.f64 (Rewrite<= +-lft-identity_binary64 (+.f64 0 (*.f64 a (neg.f64 c)))) (-.f64 b_2 (hypot.f64 b_2 (sqrt.f64 (*.f64 a (neg.f64 c)))))): 0 points increase in error, 0 points decrease in error
      (/.f64 (+.f64 (Rewrite<= metadata-eval (neg.f64 0)) (*.f64 a (neg.f64 c))) (-.f64 b_2 (hypot.f64 b_2 (sqrt.f64 (*.f64 a (neg.f64 c)))))): 0 points increase in error, 0 points decrease in error
      (/.f64 (+.f64 (neg.f64 0) (Rewrite=> distribute-rgt-neg-out_binary64 (neg.f64 (*.f64 a c)))) (-.f64 b_2 (hypot.f64 b_2 (sqrt.f64 (*.f64 a (neg.f64 c)))))): 0 points increase in error, 0 points decrease in error
      (/.f64 (Rewrite<= distribute-neg-in_binary64 (neg.f64 (+.f64 0 (*.f64 a c)))) (-.f64 b_2 (hypot.f64 b_2 (sqrt.f64 (*.f64 a (neg.f64 c)))))): 0 points increase in error, 0 points decrease in error
      (/.f64 (neg.f64 (+.f64 (Rewrite<= +-inverses_binary64 (-.f64 (*.f64 b_2 b_2) (*.f64 b_2 b_2))) (*.f64 a c))) (-.f64 b_2 (hypot.f64 b_2 (sqrt.f64 (*.f64 a (neg.f64 c)))))): 22 points increase in error, 0 points decrease in error
      (/.f64 (neg.f64 (Rewrite<= associate--r-_binary64 (-.f64 (*.f64 b_2 b_2) (-.f64 (*.f64 b_2 b_2) (*.f64 a c))))) (-.f64 b_2 (hypot.f64 b_2 (sqrt.f64 (*.f64 a (neg.f64 c)))))): 8 points increase in error, 9 points decrease in error

    if 8.79999999999999952e-272 < b_2 < 1.31999999999999998e154

    1. Initial program 8.8

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

    if 1.31999999999999998e154 < b_2 < 4.00000000000000026e193

    1. Initial program 64.0

      \[\frac{\left(-b_2\right) - \sqrt{b_2 \cdot b_2 - a \cdot c}}{a} \]
    2. Applied egg-rr37.6

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

    if 4.00000000000000026e193 < b_2

    1. Initial program 64.0

      \[\frac{\left(-b_2\right) - \sqrt{b_2 \cdot b_2 - a \cdot c}}{a} \]
    2. Applied egg-rr64.0

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

      \[\leadsto \frac{\left(-b_2\right) - \sqrt{\color{blue}{\left(b_2 \cdot b_2 - a \cdot c\right) + 2 \cdot \mathsf{fma}\left(a, -c, a \cdot c\right)}}}{a} \]
      Proof
      (+.f64 (-.f64 (*.f64 b_2 b_2) (*.f64 a c)) (*.f64 2 (fma.f64 a (neg.f64 c) (*.f64 a c)))): 0 points increase in error, 0 points decrease in error
      (+.f64 (-.f64 (*.f64 b_2 b_2) (*.f64 a c)) (Rewrite<= count-2_binary64 (+.f64 (fma.f64 a (neg.f64 c) (*.f64 a c)) (fma.f64 a (neg.f64 c) (*.f64 a c))))): 0 points increase in error, 0 points decrease in error
    4. Applied egg-rr40.1

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

      \[\leadsto \frac{\color{blue}{\left(-\mathsf{hypot}\left(b_2, \sqrt{a \cdot c}\right)\right) - b_2}}{a} \]
      Proof
      (-.f64 (neg.f64 (hypot.f64 b_2 (sqrt.f64 (*.f64 a c)))) b_2): 0 points increase in error, 0 points decrease in error
      (Rewrite=> sub-neg_binary64 (+.f64 (neg.f64 (hypot.f64 b_2 (sqrt.f64 (*.f64 a c)))) (neg.f64 b_2))): 0 points increase in error, 0 points decrease in error
      (Rewrite<= distribute-neg-in_binary64 (neg.f64 (+.f64 (hypot.f64 b_2 (sqrt.f64 (*.f64 a c))) b_2))): 0 points increase in error, 0 points decrease in error
      (neg.f64 (Rewrite<= +-commutative_binary64 (+.f64 b_2 (hypot.f64 b_2 (sqrt.f64 (*.f64 a c)))))): 0 points increase in error, 0 points decrease in error
  3. Recombined 7 regimes into one program.
  4. Final simplification23.2

    \[\leadsto \begin{array}{l} \mathbf{if}\;b_2 \leq -8.2 \cdot 10^{+255}:\\ \;\;\;\;\frac{\frac{a \cdot c}{\mathsf{hypot}\left(b_2, \sqrt{a \cdot c}\right) - b_2}}{a}\\ \mathbf{elif}\;b_2 \leq -6 \cdot 10^{+193}:\\ \;\;\;\;\frac{\frac{a \cdot \left(-c\right)}{b_2 - \mathsf{hypot}\left(b_2, \sqrt{a \cdot \left(-c\right)}\right)}}{a}\\ \mathbf{elif}\;b_2 \leq -1.4 \cdot 10^{+164}:\\ \;\;\;\;\frac{\frac{a}{\frac{b_2 - \mathsf{hypot}\left(b_2, \sqrt{a \cdot c}\right)}{-c}}}{a}\\ \mathbf{elif}\;b_2 \leq -4.2 \cdot 10^{+95}:\\ \;\;\;\;\frac{\frac{-c}{\frac{b_2 - \mathsf{hypot}\left(b_2, \sqrt{a \cdot \left(-c\right)}\right)}{a}}}{a}\\ \mathbf{elif}\;b_2 \leq -2.85 \cdot 10^{+45}:\\ \;\;\;\;\frac{\frac{a \cdot c}{\mathsf{hypot}\left(b_2, \sqrt{a \cdot c}\right) - b_2}}{a}\\ \mathbf{elif}\;b_2 \leq 8.8 \cdot 10^{-272}:\\ \;\;\;\;\frac{\frac{-c}{\frac{b_2 - \mathsf{hypot}\left(b_2, \sqrt{a \cdot \left(-c\right)}\right)}{a}}}{a}\\ \mathbf{elif}\;b_2 \leq 1.32 \cdot 10^{+154}:\\ \;\;\;\;\frac{\left(-b_2\right) - \sqrt{b_2 \cdot b_2 - a \cdot c}}{a}\\ \mathbf{elif}\;b_2 \leq 4 \cdot 10^{+193}:\\ \;\;\;\;\frac{\left(-b_2\right) - \mathsf{hypot}\left(\sqrt{a \cdot \left(-c\right)}, b_2\right)}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(-b_2\right) - \mathsf{hypot}\left(b_2, \sqrt{a \cdot c}\right)}{a}\\ \end{array} \]

Alternatives

Alternative 1
Error23.1
Cost14224
\[\begin{array}{l} t_0 := \frac{\frac{a}{\frac{b_2 - \mathsf{hypot}\left(b_2, \sqrt{a \cdot \left(-c\right)}\right)}{-c}}}{a}\\ t_1 := \mathsf{hypot}\left(b_2, \sqrt{a \cdot c}\right)\\ \mathbf{if}\;b_2 \leq -1.55 \cdot 10^{+163}:\\ \;\;\;\;\frac{\frac{a}{\frac{b_2 - t_1}{-c}}}{a}\\ \mathbf{elif}\;b_2 \leq -2 \cdot 10^{+97}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;b_2 \leq -2.85 \cdot 10^{+45}:\\ \;\;\;\;\frac{\frac{a \cdot c}{t_1 - b_2}}{a}\\ \mathbf{elif}\;b_2 \leq 8.5 \cdot 10^{-272}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;b_2 \leq 6 \cdot 10^{+145}:\\ \;\;\;\;\frac{\left(-b_2\right) - \sqrt{b_2 \cdot b_2 - a \cdot c}}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(-b_2\right) - t_1}{a}\\ \end{array} \]
Alternative 2
Error23.4
Cost14224
\[\begin{array}{l} t_0 := \frac{\frac{-c}{\frac{b_2 - \mathsf{hypot}\left(b_2, \sqrt{a \cdot \left(-c\right)}\right)}{a}}}{a}\\ t_1 := \mathsf{hypot}\left(b_2, \sqrt{a \cdot c}\right)\\ \mathbf{if}\;b_2 \leq -1.45 \cdot 10^{+164}:\\ \;\;\;\;\frac{\frac{a}{\frac{b_2 - t_1}{-c}}}{a}\\ \mathbf{elif}\;b_2 \leq -5.1 \cdot 10^{+95}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;b_2 \leq -6 \cdot 10^{+44}:\\ \;\;\;\;\frac{\frac{a \cdot c}{t_1 - b_2}}{a}\\ \mathbf{elif}\;b_2 \leq 1.9 \cdot 10^{-269}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;b_2 \leq 6 \cdot 10^{+145}:\\ \;\;\;\;\frac{\left(-b_2\right) - \sqrt{b_2 \cdot b_2 - a \cdot c}}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(-b_2\right) - t_1}{a}\\ \end{array} \]
Alternative 3
Error26.0
Cost13700
\[\begin{array}{l} t_0 := \mathsf{hypot}\left(b_2, \sqrt{a \cdot c}\right)\\ \mathbf{if}\;b_2 \leq -1.7 \cdot 10^{-48}:\\ \;\;\;\;\frac{\frac{a \cdot c}{t_0 - b_2}}{a}\\ \mathbf{elif}\;b_2 \leq 6 \cdot 10^{+145}:\\ \;\;\;\;\frac{\left(-b_2\right) - \sqrt{b_2 \cdot b_2 - a \cdot c}}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(-b_2\right) - t_0}{a}\\ \end{array} \]
Alternative 4
Error28.5
Cost13640
\[\begin{array}{l} \mathbf{if}\;b_2 \leq -1.32 \cdot 10^{+154}:\\ \;\;\;\;\frac{b_2 + \mathsf{hypot}\left(b_2, \sqrt{a \cdot \left(-c\right)}\right)}{a}\\ \mathbf{elif}\;b_2 \leq 6 \cdot 10^{+145}:\\ \;\;\;\;\frac{\left(-b_2\right) - \sqrt{b_2 \cdot b_2 - a \cdot c}}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(-b_2\right) - \mathsf{hypot}\left(b_2, \sqrt{a \cdot c}\right)}{a}\\ \end{array} \]
Alternative 5
Error28.9
Cost13640
\[\begin{array}{l} \mathbf{if}\;b_2 \leq 2 \cdot 10^{-155}:\\ \;\;\;\;\frac{\left(-b_2\right) - \mathsf{hypot}\left(\sqrt{a \cdot \left(-c\right)}, b_2\right)}{a}\\ \mathbf{elif}\;b_2 \leq 6 \cdot 10^{+145}:\\ \;\;\;\;\frac{\left(-b_2\right) - \sqrt{b_2 \cdot b_2 - a \cdot c}}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(-b_2\right) - \mathsf{hypot}\left(b_2, \sqrt{a \cdot c}\right)}{a}\\ \end{array} \]
Alternative 6
Error31.3
Cost13508
\[\begin{array}{l} \mathbf{if}\;b_2 \leq -1.32 \cdot 10^{+154}:\\ \;\;\;\;\frac{b_2 + \mathsf{hypot}\left(b_2, \sqrt{a \cdot \left(-c\right)}\right)}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(-b_2\right) - \sqrt{b_2 \cdot b_2 - a \cdot c}}{a}\\ \end{array} \]
Alternative 7
Error31.2
Cost13444
\[\begin{array}{l} \mathbf{if}\;b_2 \leq -1.32 \cdot 10^{+154}:\\ \;\;\;\;\frac{b_2 + \mathsf{hypot}\left(b_2, \sqrt{a \cdot c}\right)}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(-b_2\right) - \sqrt{b_2 \cdot b_2 - a \cdot c}}{a}\\ \end{array} \]
Alternative 8
Error34.5
Cost7168
\[\frac{\left(-b_2\right) - \sqrt{b_2 \cdot b_2 - a \cdot c}}{a} \]
Alternative 9
Error46.2
Cost7104
\[\frac{b_2 - \sqrt{b_2 \cdot b_2 - a \cdot c}}{a} \]

Error

Reproduce

herbie shell --seed 2022334 
(FPCore (a b_2 c)
  :name "quad2m (problem 3.2.1, negative)"
  :precision binary64
  (/ (- (- b_2) (sqrt (- (* b_2 b_2) (* a c)))) a))