?

Average Accuracy: 47.2% → 90.0%
Time: 12.7s
Precision: binary64
Cost: 7564

?

\[\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 - c \cdot a}\\ \mathbf{if}\;b_2 \leq -1.6 \cdot 10^{+99}:\\ \;\;\;\;\frac{c}{\mathsf{fma}\left(-1, b_2, 0.5 \cdot \frac{c}{\frac{b_2}{a}}\right) - b_2}\\ \mathbf{elif}\;b_2 \leq 4.5 \cdot 10^{-308}:\\ \;\;\;\;\frac{c}{t_0 - b_2}\\ \mathbf{elif}\;b_2 \leq 9.8 \cdot 10^{+110}:\\ \;\;\;\;\frac{\left(-b_2\right) - t_0}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{b_2 \cdot -2}{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 (sqrt (- (* b_2 b_2) (* c a)))))
   (if (<= b_2 -1.6e+99)
     (/ c (- (fma -1.0 b_2 (* 0.5 (/ c (/ b_2 a)))) b_2))
     (if (<= b_2 4.5e-308)
       (/ c (- t_0 b_2))
       (if (<= b_2 9.8e+110) (/ (- (- b_2) t_0) a) (/ (* b_2 -2.0) 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 = sqrt(((b_2 * b_2) - (c * a)));
	double tmp;
	if (b_2 <= -1.6e+99) {
		tmp = c / (fma(-1.0, b_2, (0.5 * (c / (b_2 / a)))) - b_2);
	} else if (b_2 <= 4.5e-308) {
		tmp = c / (t_0 - b_2);
	} else if (b_2 <= 9.8e+110) {
		tmp = (-b_2 - t_0) / a;
	} else {
		tmp = (b_2 * -2.0) / 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 = sqrt(Float64(Float64(b_2 * b_2) - Float64(c * a)))
	tmp = 0.0
	if (b_2 <= -1.6e+99)
		tmp = Float64(c / Float64(fma(-1.0, b_2, Float64(0.5 * Float64(c / Float64(b_2 / a)))) - b_2));
	elseif (b_2 <= 4.5e-308)
		tmp = Float64(c / Float64(t_0 - b_2));
	elseif (b_2 <= 9.8e+110)
		tmp = Float64(Float64(Float64(-b_2) - t_0) / a);
	else
		tmp = Float64(Float64(b_2 * -2.0) / a);
	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[(c * a), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[b$95$2, -1.6e+99], N[(c / N[(N[(-1.0 * b$95$2 + N[(0.5 * N[(c / N[(b$95$2 / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - b$95$2), $MachinePrecision]), $MachinePrecision], If[LessEqual[b$95$2, 4.5e-308], N[(c / N[(t$95$0 - b$95$2), $MachinePrecision]), $MachinePrecision], If[LessEqual[b$95$2, 9.8e+110], N[(N[((-b$95$2) - t$95$0), $MachinePrecision] / a), $MachinePrecision], N[(N[(b$95$2 * -2.0), $MachinePrecision] / a), $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 - c \cdot a}\\
\mathbf{if}\;b_2 \leq -1.6 \cdot 10^{+99}:\\
\;\;\;\;\frac{c}{\mathsf{fma}\left(-1, b_2, 0.5 \cdot \frac{c}{\frac{b_2}{a}}\right) - b_2}\\

\mathbf{elif}\;b_2 \leq 4.5 \cdot 10^{-308}:\\
\;\;\;\;\frac{c}{t_0 - b_2}\\

\mathbf{elif}\;b_2 \leq 9.8 \cdot 10^{+110}:\\
\;\;\;\;\frac{\left(-b_2\right) - t_0}{a}\\

\mathbf{else}:\\
\;\;\;\;\frac{b_2 \cdot -2}{a}\\


\end{array}

Error?

Derivation?

  1. Split input into 4 regimes
  2. if b_2 < -1.6e99

    1. Initial program 7.3%

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

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

      [Start]7.3

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

      flip-- [=>]7.3

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

      frac-2neg [=>]7.3

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

      add-sqr-sqrt [<=]7.3

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

      associate--r- [=>]19.2

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

      +-commutative [=>]19.2

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

      sqr-neg [=>]19.2

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

      add-sqr-sqrt [=>]19.2

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

      sqrt-unprod [=>]19.2

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

      sqr-neg [=>]19.2

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

      sqrt-prod [=>]0.0

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

      add-sqr-sqrt [<=]0.5

      \[ \frac{\frac{-\left(a \cdot c + \left(b_2 \cdot b_2 - b_2 \cdot b_2\right)\right)}{-\left(\color{blue}{b_2} + \sqrt{b_2 \cdot b_2 - a \cdot c}\right)}}{a} \]
    3. Simplified50.9%

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

      [Start]19.2

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

      rem-square-sqrt [<=]0.0

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

      associate-/l/ [<=]0.0

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

      distribute-frac-neg [=>]0.0

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

      neg-mul-1 [=>]0.0

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

      metadata-eval [<=]0.0

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

      times-frac [<=]0.0

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

      *-lft-identity [=>]0.0

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

      neg-mul-1 [<=]0.0

      \[ \frac{\frac{\frac{a \cdot c + \left(b_2 \cdot b_2 - b_2 \cdot b_2\right)}{\color{blue}{-\sqrt{b_2 - \sqrt{b_2 \cdot b_2 - a \cdot c}}}}}{\sqrt{b_2 - \sqrt{b_2 \cdot b_2 - a \cdot c}}}}{a} \]
    4. Applied egg-rr40.5%

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\frac{a}{a} \cdot \frac{c}{\sqrt{b_2 \cdot b_2 - c \cdot a} - b_2}\right)} - 1} \]
      Proof

      [Start]50.9

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

      expm1-log1p-u [=>]48.8

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

      expm1-udef [=>]40.3

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

      associate-/l/ [=>]40.3

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

      *-commutative [=>]40.3

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

      times-frac [=>]40.5

      \[ e^{\mathsf{log1p}\left(\color{blue}{\frac{a}{a} \cdot \frac{c}{\sqrt{b_2 \cdot b_2 - c \cdot a} - b_2}}\right)} - 1 \]
    5. Simplified54.4%

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

      [Start]40.5

      \[ e^{\mathsf{log1p}\left(\frac{a}{a} \cdot \frac{c}{\sqrt{b_2 \cdot b_2 - c \cdot a} - b_2}\right)} - 1 \]

      expm1-def [=>]52.2

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

      expm1-log1p [=>]54.4

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

      associate-*l/ [=>]51.2

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

      *-commutative [<=]51.2

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

      associate-*l/ [=>]50.9

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

      associate-/r* [<=]50.8

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

      *-commutative [<=]50.8

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

      associate-/r* [=>]52.9

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

      associate-/l* [=>]54.4

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

      *-inverses [=>]54.4

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

      /-rgt-identity [=>]54.4

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

      \[\leadsto \frac{c}{\color{blue}{\left(-1 \cdot b_2 + 0.5 \cdot \frac{c \cdot a}{b_2}\right)} - b_2} \]
    7. Simplified96.1%

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

      [Start]89.4

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

      fma-def [=>]89.4

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

      associate-/l* [=>]96.1

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

    if -1.6e99 < b_2 < 4.50000000000000009e-308

    1. Initial program 50.1%

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

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

      [Start]50.1

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

      flip-- [=>]50.1

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

      frac-2neg [=>]50.1

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

      add-sqr-sqrt [<=]50.1

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

      associate--r- [=>]74.2

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

      +-commutative [=>]74.2

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

      sqr-neg [=>]74.2

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

      add-sqr-sqrt [=>]74.0

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

      sqrt-unprod [=>]74.0

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

      sqr-neg [=>]74.0

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

      sqrt-prod [=>]0.1

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

      add-sqr-sqrt [<=]43.7

      \[ \frac{\frac{-\left(a \cdot c + \left(b_2 \cdot b_2 - b_2 \cdot b_2\right)\right)}{-\left(\color{blue}{b_2} + \sqrt{b_2 \cdot b_2 - a \cdot c}\right)}}{a} \]
    3. Simplified74.2%

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

      [Start]74.2

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

      rem-square-sqrt [<=]0.0

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

      associate-/l/ [<=]0.0

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

      distribute-frac-neg [=>]0.0

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

      neg-mul-1 [=>]0.0

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

      metadata-eval [<=]0.0

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

      times-frac [<=]0.0

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

      *-lft-identity [=>]0.0

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

      neg-mul-1 [<=]0.0

      \[ \frac{\frac{\frac{a \cdot c + \left(b_2 \cdot b_2 - b_2 \cdot b_2\right)}{\color{blue}{-\sqrt{b_2 - \sqrt{b_2 \cdot b_2 - a \cdot c}}}}}{\sqrt{b_2 - \sqrt{b_2 \cdot b_2 - a \cdot c}}}}{a} \]
    4. Applied egg-rr22.1%

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\frac{a}{a} \cdot \frac{c}{\sqrt{b_2 \cdot b_2 - c \cdot a} - b_2}\right)} - 1} \]
      Proof

      [Start]74.2

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

      expm1-log1p-u [=>]58.1

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

      expm1-udef [=>]21.5

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

      associate-/l/ [=>]19.4

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

      *-commutative [=>]19.4

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

      times-frac [=>]22.1

      \[ e^{\mathsf{log1p}\left(\color{blue}{\frac{a}{a} \cdot \frac{c}{\sqrt{b_2 \cdot b_2 - c \cdot a} - b_2}}\right)} - 1 \]
    5. Simplified86.2%

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

      [Start]22.1

      \[ e^{\mathsf{log1p}\left(\frac{a}{a} \cdot \frac{c}{\sqrt{b_2 \cdot b_2 - c \cdot a} - b_2}\right)} - 1 \]

      expm1-def [=>]69.7

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

      expm1-log1p [=>]86.2

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

      associate-*l/ [=>]78.4

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

      *-commutative [<=]78.4

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

      associate-*l/ [=>]74.2

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

      associate-/r* [<=]66.8

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

      *-commutative [<=]66.8

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

      associate-/r* [=>]76.0

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

      associate-/l* [=>]86.2

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

      *-inverses [=>]86.2

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

      /-rgt-identity [=>]86.2

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

    if 4.50000000000000009e-308 < b_2 < 9.80000000000000003e110

    1. Initial program 87.1%

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

    if 9.80000000000000003e110 < b_2

    1. Initial program 21.9%

      \[\frac{\left(-b_2\right) - \sqrt{b_2 \cdot b_2 - a \cdot c}}{a} \]
    2. Taylor expanded in b_2 around inf 94.2%

      \[\leadsto \frac{\color{blue}{-2 \cdot b_2}}{a} \]
    3. Simplified94.2%

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

      [Start]94.2

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

      *-commutative [=>]94.2

      \[ \frac{\color{blue}{b_2 \cdot -2}}{a} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification90.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;b_2 \leq -1.6 \cdot 10^{+99}:\\ \;\;\;\;\frac{c}{\mathsf{fma}\left(-1, b_2, 0.5 \cdot \frac{c}{\frac{b_2}{a}}\right) - b_2}\\ \mathbf{elif}\;b_2 \leq 4.5 \cdot 10^{-308}:\\ \;\;\;\;\frac{c}{\sqrt{b_2 \cdot b_2 - c \cdot a} - b_2}\\ \mathbf{elif}\;b_2 \leq 9.8 \cdot 10^{+110}:\\ \;\;\;\;\frac{\left(-b_2\right) - \sqrt{b_2 \cdot b_2 - c \cdot a}}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{b_2 \cdot -2}{a}\\ \end{array} \]

Alternatives

Alternative 1
Accuracy89.9%
Cost7564
\[\begin{array}{l} t_0 := \sqrt{b_2 \cdot b_2 - c \cdot a}\\ \mathbf{if}\;b_2 \leq -8 \cdot 10^{+98}:\\ \;\;\;\;-0.5 \cdot \frac{c}{b_2}\\ \mathbf{elif}\;b_2 \leq 3.7 \cdot 10^{-305}:\\ \;\;\;\;\frac{c}{t_0 - b_2}\\ \mathbf{elif}\;b_2 \leq 3.55 \cdot 10^{+109}:\\ \;\;\;\;\frac{\left(-b_2\right) - t_0}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{b_2 \cdot -2}{a}\\ \end{array} \]
Alternative 2
Accuracy84.3%
Cost7368
\[\begin{array}{l} \mathbf{if}\;b_2 \leq -1.8 \cdot 10^{+99}:\\ \;\;\;\;-0.5 \cdot \frac{c}{b_2}\\ \mathbf{elif}\;b_2 \leq 7.5 \cdot 10^{-46}:\\ \;\;\;\;\frac{c}{\sqrt{b_2 \cdot b_2 - c \cdot a} - b_2}\\ \mathbf{else}:\\ \;\;\;\;\frac{b_2}{a} \cdot -2 + 0.5 \cdot \frac{c}{b_2}\\ \end{array} \]
Alternative 3
Accuracy64.2%
Cost452
\[\begin{array}{l} \mathbf{if}\;b_2 \leq -9 \cdot 10^{-217}:\\ \;\;\;\;\frac{c \cdot -0.5}{b_2}\\ \mathbf{else}:\\ \;\;\;\;\frac{b_2 \cdot -2}{a}\\ \end{array} \]
Alternative 4
Accuracy37.6%
Cost320
\[-0.5 \cdot \frac{c}{b_2} \]
Alternative 5
Accuracy37.7%
Cost320
\[\frac{c \cdot -0.5}{b_2} \]

Error

Reproduce?

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