quad2p (problem 3.2.1, positive)

Percentage Accurate: 52.8% → 87.4%
Time: 10.4s
Alternatives: 8
Speedup: 15.9×

Specification

?
\[\begin{array}{l} \\ \frac{\left(-b_2\right) + \sqrt{b_2 \cdot b_2 - a \cdot c}}{a} \end{array} \]
(FPCore (a b_2 c)
 :precision binary64
 (/ (+ (- b_2) (sqrt (- (* b_2 b_2) (* a c)))) a))
double code(double a, double b_2, double c) {
	return (-b_2 + sqrt(((b_2 * b_2) - (a * c)))) / a;
}
real(8) function code(a, b_2, c)
    real(8), intent (in) :: a
    real(8), intent (in) :: b_2
    real(8), intent (in) :: c
    code = (-b_2 + sqrt(((b_2 * b_2) - (a * c)))) / a
end function
public static double code(double a, double b_2, double c) {
	return (-b_2 + Math.sqrt(((b_2 * b_2) - (a * c)))) / a;
}
def code(a, b_2, c):
	return (-b_2 + math.sqrt(((b_2 * b_2) - (a * c)))) / a
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 tmp = code(a, b_2, c)
	tmp = (-b_2 + sqrt(((b_2 * b_2) - (a * c)))) / a;
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]
\begin{array}{l}

\\
\frac{\left(-b_2\right) + \sqrt{b_2 \cdot b_2 - a \cdot c}}{a}
\end{array}

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

The average percentage accuracy by input value. Horizontal axis shows value of an input variable; the variable is choosen in the title. Vertical axis is accuracy; higher is better. Red represent the original program, while blue represents Herbie's suggestion. These can be toggled with buttons below the plot. The line is an average while dots represent individual samples.

Accuracy vs Speed?

Herbie found 8 alternatives:

AlternativeAccuracySpeedup
The accuracy (vertical axis) and speed (horizontal axis) of each alternatives. Up and to the right is better. The red square shows the initial program, and each blue circle shows an alternative.The line shows the best available speed-accuracy tradeoffs.

Initial Program: 52.8% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \frac{\left(-b_2\right) + \sqrt{b_2 \cdot b_2 - a \cdot c}}{a} \end{array} \]
(FPCore (a b_2 c)
 :precision binary64
 (/ (+ (- b_2) (sqrt (- (* b_2 b_2) (* a c)))) a))
double code(double a, double b_2, double c) {
	return (-b_2 + sqrt(((b_2 * b_2) - (a * c)))) / a;
}
real(8) function code(a, b_2, c)
    real(8), intent (in) :: a
    real(8), intent (in) :: b_2
    real(8), intent (in) :: c
    code = (-b_2 + sqrt(((b_2 * b_2) - (a * c)))) / a
end function
public static double code(double a, double b_2, double c) {
	return (-b_2 + Math.sqrt(((b_2 * b_2) - (a * c)))) / a;
}
def code(a, b_2, c):
	return (-b_2 + math.sqrt(((b_2 * b_2) - (a * c)))) / a
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 tmp = code(a, b_2, c)
	tmp = (-b_2 + sqrt(((b_2 * b_2) - (a * c)))) / a;
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]
\begin{array}{l}

\\
\frac{\left(-b_2\right) + \sqrt{b_2 \cdot b_2 - a \cdot c}}{a}
\end{array}

Alternative 1: 87.4% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \sqrt{b_2 \cdot b_2 - a \cdot c}\\ \mathbf{if}\;b_2 \leq -1 \cdot 10^{+154}:\\ \;\;\;\;-2 \cdot \frac{b_2}{a} + 0.5 \cdot \frac{c}{b_2}\\ \mathbf{elif}\;b_2 \leq 8 \cdot 10^{-160}:\\ \;\;\;\;\frac{t_0 - b_2}{a}\\ \mathbf{elif}\;b_2 \leq 1300000000:\\ \;\;\;\;\frac{\frac{c \cdot \left(-a\right)}{b_2 + t_0}}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{c}{b_2} \cdot -0.5\\ \end{array} \end{array} \]
(FPCore (a b_2 c)
 :precision binary64
 (let* ((t_0 (sqrt (- (* b_2 b_2) (* a c)))))
   (if (<= b_2 -1e+154)
     (+ (* -2.0 (/ b_2 a)) (* 0.5 (/ c b_2)))
     (if (<= b_2 8e-160)
       (/ (- t_0 b_2) a)
       (if (<= b_2 1300000000.0)
         (/ (/ (* c (- a)) (+ b_2 t_0)) a)
         (* (/ c b_2) -0.5))))))
double code(double a, double b_2, double c) {
	double t_0 = sqrt(((b_2 * b_2) - (a * c)));
	double tmp;
	if (b_2 <= -1e+154) {
		tmp = (-2.0 * (b_2 / a)) + (0.5 * (c / b_2));
	} else if (b_2 <= 8e-160) {
		tmp = (t_0 - b_2) / a;
	} else if (b_2 <= 1300000000.0) {
		tmp = ((c * -a) / (b_2 + t_0)) / a;
	} else {
		tmp = (c / b_2) * -0.5;
	}
	return tmp;
}
real(8) function code(a, b_2, c)
    real(8), intent (in) :: a
    real(8), intent (in) :: b_2
    real(8), intent (in) :: c
    real(8) :: t_0
    real(8) :: tmp
    t_0 = sqrt(((b_2 * b_2) - (a * c)))
    if (b_2 <= (-1d+154)) then
        tmp = ((-2.0d0) * (b_2 / a)) + (0.5d0 * (c / b_2))
    else if (b_2 <= 8d-160) then
        tmp = (t_0 - b_2) / a
    else if (b_2 <= 1300000000.0d0) then
        tmp = ((c * -a) / (b_2 + t_0)) / a
    else
        tmp = (c / b_2) * (-0.5d0)
    end if
    code = tmp
end function
public static double code(double a, double b_2, double c) {
	double t_0 = Math.sqrt(((b_2 * b_2) - (a * c)));
	double tmp;
	if (b_2 <= -1e+154) {
		tmp = (-2.0 * (b_2 / a)) + (0.5 * (c / b_2));
	} else if (b_2 <= 8e-160) {
		tmp = (t_0 - b_2) / a;
	} else if (b_2 <= 1300000000.0) {
		tmp = ((c * -a) / (b_2 + t_0)) / a;
	} else {
		tmp = (c / b_2) * -0.5;
	}
	return tmp;
}
def code(a, b_2, c):
	t_0 = math.sqrt(((b_2 * b_2) - (a * c)))
	tmp = 0
	if b_2 <= -1e+154:
		tmp = (-2.0 * (b_2 / a)) + (0.5 * (c / b_2))
	elif b_2 <= 8e-160:
		tmp = (t_0 - b_2) / a
	elif b_2 <= 1300000000.0:
		tmp = ((c * -a) / (b_2 + t_0)) / a
	else:
		tmp = (c / b_2) * -0.5
	return tmp
function code(a, b_2, c)
	t_0 = sqrt(Float64(Float64(b_2 * b_2) - Float64(a * c)))
	tmp = 0.0
	if (b_2 <= -1e+154)
		tmp = Float64(Float64(-2.0 * Float64(b_2 / a)) + Float64(0.5 * Float64(c / b_2)));
	elseif (b_2 <= 8e-160)
		tmp = Float64(Float64(t_0 - b_2) / a);
	elseif (b_2 <= 1300000000.0)
		tmp = Float64(Float64(Float64(c * Float64(-a)) / Float64(b_2 + t_0)) / a);
	else
		tmp = Float64(Float64(c / b_2) * -0.5);
	end
	return tmp
end
function tmp_2 = code(a, b_2, c)
	t_0 = sqrt(((b_2 * b_2) - (a * c)));
	tmp = 0.0;
	if (b_2 <= -1e+154)
		tmp = (-2.0 * (b_2 / a)) + (0.5 * (c / b_2));
	elseif (b_2 <= 8e-160)
		tmp = (t_0 - b_2) / a;
	elseif (b_2 <= 1300000000.0)
		tmp = ((c * -a) / (b_2 + t_0)) / a;
	else
		tmp = (c / b_2) * -0.5;
	end
	tmp_2 = tmp;
end
code[a_, b$95$2_, c_] := Block[{t$95$0 = N[Sqrt[N[(N[(b$95$2 * b$95$2), $MachinePrecision] - N[(a * c), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[b$95$2, -1e+154], N[(N[(-2.0 * N[(b$95$2 / a), $MachinePrecision]), $MachinePrecision] + N[(0.5 * N[(c / b$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b$95$2, 8e-160], N[(N[(t$95$0 - b$95$2), $MachinePrecision] / a), $MachinePrecision], If[LessEqual[b$95$2, 1300000000.0], N[(N[(N[(c * (-a)), $MachinePrecision] / N[(b$95$2 + t$95$0), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision], N[(N[(c / b$95$2), $MachinePrecision] * -0.5), $MachinePrecision]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \sqrt{b_2 \cdot b_2 - a \cdot c}\\
\mathbf{if}\;b_2 \leq -1 \cdot 10^{+154}:\\
\;\;\;\;-2 \cdot \frac{b_2}{a} + 0.5 \cdot \frac{c}{b_2}\\

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

\mathbf{elif}\;b_2 \leq 1300000000:\\
\;\;\;\;\frac{\frac{c \cdot \left(-a\right)}{b_2 + t_0}}{a}\\

\mathbf{else}:\\
\;\;\;\;\frac{c}{b_2} \cdot -0.5\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if b_2 < -1.00000000000000004e154

    1. Initial program 49.3%

      \[\frac{\left(-b_2\right) + \sqrt{b_2 \cdot b_2 - a \cdot c}}{a} \]
    2. Step-by-step derivation
      1. +-commutative49.3%

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

        \[\leadsto \frac{\color{blue}{\sqrt{b_2 \cdot b_2 - a \cdot c} - b_2}}{a} \]
    3. Simplified49.3%

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

      \[\leadsto \color{blue}{-2 \cdot \frac{b_2}{a} + 0.5 \cdot \frac{c}{b_2}} \]

    if -1.00000000000000004e154 < b_2 < 7.9999999999999999e-160

    1. Initial program 84.2%

      \[\frac{\left(-b_2\right) + \sqrt{b_2 \cdot b_2 - a \cdot c}}{a} \]
    2. Step-by-step derivation
      1. +-commutative84.2%

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

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

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

    if 7.9999999999999999e-160 < b_2 < 1.3e9

    1. Initial program 54.4%

      \[\frac{\left(-b_2\right) + \sqrt{b_2 \cdot b_2 - a \cdot c}}{a} \]
    2. Step-by-step derivation
      1. +-commutative54.4%

        \[\leadsto \frac{\color{blue}{\sqrt{b_2 \cdot b_2 - a \cdot c} + \left(-b_2\right)}}{a} \]
      2. unsub-neg54.4%

        \[\leadsto \frac{\color{blue}{\sqrt{b_2 \cdot b_2 - a \cdot c} - b_2}}{a} \]
    3. Simplified54.4%

      \[\leadsto \color{blue}{\frac{\sqrt{b_2 \cdot b_2 - a \cdot c} - b_2}{a}} \]
    4. Step-by-step derivation
      1. add-cbrt-cube45.3%

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

        \[\leadsto \frac{\sqrt[3]{\color{blue}{{\left(\sqrt{b_2 \cdot b_2 - a \cdot c}\right)}^{3}}} - b_2}{a} \]
      3. pow1/342.3%

        \[\leadsto \frac{\color{blue}{{\left({\left(\sqrt{b_2 \cdot b_2 - a \cdot c}\right)}^{3}\right)}^{0.3333333333333333}} - b_2}{a} \]
      4. sqrt-pow242.3%

        \[\leadsto \frac{{\color{blue}{\left({\left(b_2 \cdot b_2 - a \cdot c\right)}^{\left(\frac{3}{2}\right)}\right)}}^{0.3333333333333333} - b_2}{a} \]
      5. fma-neg42.3%

        \[\leadsto \frac{{\left({\color{blue}{\left(\mathsf{fma}\left(b_2, b_2, -a \cdot c\right)\right)}}^{\left(\frac{3}{2}\right)}\right)}^{0.3333333333333333} - b_2}{a} \]
      6. *-commutative42.3%

        \[\leadsto \frac{{\left({\left(\mathsf{fma}\left(b_2, b_2, -\color{blue}{c \cdot a}\right)\right)}^{\left(\frac{3}{2}\right)}\right)}^{0.3333333333333333} - b_2}{a} \]
      7. distribute-rgt-neg-in42.3%

        \[\leadsto \frac{{\left({\left(\mathsf{fma}\left(b_2, b_2, \color{blue}{c \cdot \left(-a\right)}\right)\right)}^{\left(\frac{3}{2}\right)}\right)}^{0.3333333333333333} - b_2}{a} \]
      8. metadata-eval42.3%

        \[\leadsto \frac{{\left({\left(\mathsf{fma}\left(b_2, b_2, c \cdot \left(-a\right)\right)\right)}^{\color{blue}{1.5}}\right)}^{0.3333333333333333} - b_2}{a} \]
    5. Applied egg-rr42.3%

      \[\leadsto \frac{\color{blue}{{\left({\left(\mathsf{fma}\left(b_2, b_2, c \cdot \left(-a\right)\right)\right)}^{1.5}\right)}^{0.3333333333333333}} - b_2}{a} \]
    6. Step-by-step derivation
      1. unpow1/345.3%

        \[\leadsto \frac{\color{blue}{\sqrt[3]{{\left(\mathsf{fma}\left(b_2, b_2, c \cdot \left(-a\right)\right)\right)}^{1.5}}} - b_2}{a} \]
      2. distribute-rgt-neg-out45.3%

        \[\leadsto \frac{\sqrt[3]{{\left(\mathsf{fma}\left(b_2, b_2, \color{blue}{-c \cdot a}\right)\right)}^{1.5}} - b_2}{a} \]
      3. *-commutative45.3%

        \[\leadsto \frac{\sqrt[3]{{\left(\mathsf{fma}\left(b_2, b_2, -\color{blue}{a \cdot c}\right)\right)}^{1.5}} - b_2}{a} \]
      4. fma-neg45.3%

        \[\leadsto \frac{\sqrt[3]{{\color{blue}{\left(b_2 \cdot b_2 - a \cdot c\right)}}^{1.5}} - b_2}{a} \]
      5. *-commutative45.3%

        \[\leadsto \frac{\sqrt[3]{{\left(b_2 \cdot b_2 - \color{blue}{c \cdot a}\right)}^{1.5}} - b_2}{a} \]
    7. Simplified45.3%

      \[\leadsto \frac{\color{blue}{\sqrt[3]{{\left(b_2 \cdot b_2 - c \cdot a\right)}^{1.5}}} - b_2}{a} \]
    8. Step-by-step derivation
      1. pow1/342.3%

        \[\leadsto \frac{\color{blue}{{\left({\left(b_2 \cdot b_2 - c \cdot a\right)}^{1.5}\right)}^{0.3333333333333333}} - b_2}{a} \]
      2. fma-neg42.3%

        \[\leadsto \frac{{\left({\color{blue}{\left(\mathsf{fma}\left(b_2, b_2, -c \cdot a\right)\right)}}^{1.5}\right)}^{0.3333333333333333} - b_2}{a} \]
      3. distribute-rgt-neg-out42.3%

        \[\leadsto \frac{{\left({\left(\mathsf{fma}\left(b_2, b_2, \color{blue}{c \cdot \left(-a\right)}\right)\right)}^{1.5}\right)}^{0.3333333333333333} - b_2}{a} \]
      4. pow-pow54.4%

        \[\leadsto \frac{\color{blue}{{\left(\mathsf{fma}\left(b_2, b_2, c \cdot \left(-a\right)\right)\right)}^{\left(1.5 \cdot 0.3333333333333333\right)}} - b_2}{a} \]
      5. metadata-eval54.4%

        \[\leadsto \frac{{\left(\mathsf{fma}\left(b_2, b_2, c \cdot \left(-a\right)\right)\right)}^{\color{blue}{0.5}} - b_2}{a} \]
      6. metadata-eval54.4%

        \[\leadsto \frac{{\left(\mathsf{fma}\left(b_2, b_2, c \cdot \left(-a\right)\right)\right)}^{\color{blue}{\left(0.25 + 0.25\right)}} - b_2}{a} \]
      7. pow-prod-up53.5%

        \[\leadsto \frac{\color{blue}{{\left(\mathsf{fma}\left(b_2, b_2, c \cdot \left(-a\right)\right)\right)}^{0.25} \cdot {\left(\mathsf{fma}\left(b_2, b_2, c \cdot \left(-a\right)\right)\right)}^{0.25}} - b_2}{a} \]
      8. pow253.5%

        \[\leadsto \frac{\color{blue}{{\left({\left(\mathsf{fma}\left(b_2, b_2, c \cdot \left(-a\right)\right)\right)}^{0.25}\right)}^{2}} - b_2}{a} \]
      9. distribute-rgt-neg-out53.5%

        \[\leadsto \frac{{\left({\left(\mathsf{fma}\left(b_2, b_2, \color{blue}{-c \cdot a}\right)\right)}^{0.25}\right)}^{2} - b_2}{a} \]
      10. fma-neg53.5%

        \[\leadsto \frac{{\left({\color{blue}{\left(b_2 \cdot b_2 - c \cdot a\right)}}^{0.25}\right)}^{2} - b_2}{a} \]
    9. Applied egg-rr53.5%

      \[\leadsto \frac{\color{blue}{{\left({\left(b_2 \cdot b_2 - c \cdot a\right)}^{0.25}\right)}^{2}} - b_2}{a} \]
    10. Step-by-step derivation
      1. flip--53.5%

        \[\leadsto \frac{\color{blue}{\frac{{\left({\left(b_2 \cdot b_2 - c \cdot a\right)}^{0.25}\right)}^{2} \cdot {\left({\left(b_2 \cdot b_2 - c \cdot a\right)}^{0.25}\right)}^{2} - b_2 \cdot b_2}{{\left({\left(b_2 \cdot b_2 - c \cdot a\right)}^{0.25}\right)}^{2} + b_2}}}{a} \]
      2. pow-pow53.9%

        \[\leadsto \frac{\frac{\color{blue}{{\left(b_2 \cdot b_2 - c \cdot a\right)}^{\left(0.25 \cdot 2\right)}} \cdot {\left({\left(b_2 \cdot b_2 - c \cdot a\right)}^{0.25}\right)}^{2} - b_2 \cdot b_2}{{\left({\left(b_2 \cdot b_2 - c \cdot a\right)}^{0.25}\right)}^{2} + b_2}}{a} \]
      3. metadata-eval53.9%

        \[\leadsto \frac{\frac{{\left(b_2 \cdot b_2 - c \cdot a\right)}^{\color{blue}{0.5}} \cdot {\left({\left(b_2 \cdot b_2 - c \cdot a\right)}^{0.25}\right)}^{2} - b_2 \cdot b_2}{{\left({\left(b_2 \cdot b_2 - c \cdot a\right)}^{0.25}\right)}^{2} + b_2}}{a} \]
      4. pow-pow53.9%

        \[\leadsto \frac{\frac{{\left(b_2 \cdot b_2 - c \cdot a\right)}^{0.5} \cdot \color{blue}{{\left(b_2 \cdot b_2 - c \cdot a\right)}^{\left(0.25 \cdot 2\right)}} - b_2 \cdot b_2}{{\left({\left(b_2 \cdot b_2 - c \cdot a\right)}^{0.25}\right)}^{2} + b_2}}{a} \]
      5. metadata-eval53.9%

        \[\leadsto \frac{\frac{{\left(b_2 \cdot b_2 - c \cdot a\right)}^{0.5} \cdot {\left(b_2 \cdot b_2 - c \cdot a\right)}^{\color{blue}{0.5}} - b_2 \cdot b_2}{{\left({\left(b_2 \cdot b_2 - c \cdot a\right)}^{0.25}\right)}^{2} + b_2}}{a} \]
      6. pow-prod-up54.0%

        \[\leadsto \frac{\frac{\color{blue}{{\left(b_2 \cdot b_2 - c \cdot a\right)}^{\left(0.5 + 0.5\right)}} - b_2 \cdot b_2}{{\left({\left(b_2 \cdot b_2 - c \cdot a\right)}^{0.25}\right)}^{2} + b_2}}{a} \]
      7. metadata-eval54.0%

        \[\leadsto \frac{\frac{{\left(b_2 \cdot b_2 - c \cdot a\right)}^{\color{blue}{1}} - b_2 \cdot b_2}{{\left({\left(b_2 \cdot b_2 - c \cdot a\right)}^{0.25}\right)}^{2} + b_2}}{a} \]
      8. pow154.0%

        \[\leadsto \frac{\frac{\color{blue}{\left(b_2 \cdot b_2 - c \cdot a\right)} - b_2 \cdot b_2}{{\left({\left(b_2 \cdot b_2 - c \cdot a\right)}^{0.25}\right)}^{2} + b_2}}{a} \]
      9. pow-pow54.3%

        \[\leadsto \frac{\frac{\left(b_2 \cdot b_2 - c \cdot a\right) - b_2 \cdot b_2}{\color{blue}{{\left(b_2 \cdot b_2 - c \cdot a\right)}^{\left(0.25 \cdot 2\right)}} + b_2}}{a} \]
      10. metadata-eval54.3%

        \[\leadsto \frac{\frac{\left(b_2 \cdot b_2 - c \cdot a\right) - b_2 \cdot b_2}{{\left(b_2 \cdot b_2 - c \cdot a\right)}^{\color{blue}{0.5}} + b_2}}{a} \]
      11. pow1/254.3%

        \[\leadsto \frac{\frac{\left(b_2 \cdot b_2 - c \cdot a\right) - b_2 \cdot b_2}{\color{blue}{\sqrt{b_2 \cdot b_2 - c \cdot a}} + b_2}}{a} \]
    11. Applied egg-rr54.3%

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

      \[\leadsto \frac{\frac{\color{blue}{-1 \cdot \left(c \cdot a\right)}}{\sqrt{b_2 \cdot b_2 - c \cdot a} + b_2}}{a} \]
    13. Step-by-step derivation
      1. mul-1-neg71.2%

        \[\leadsto \frac{\frac{\color{blue}{-c \cdot a}}{\sqrt{b_2 \cdot b_2 - c \cdot a} + b_2}}{a} \]
      2. distribute-rgt-neg-in71.2%

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

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

    if 1.3e9 < b_2

    1. Initial program 8.3%

      \[\frac{\left(-b_2\right) + \sqrt{b_2 \cdot b_2 - a \cdot c}}{a} \]
    2. Step-by-step derivation
      1. +-commutative8.3%

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

        \[\leadsto \frac{\color{blue}{\sqrt{b_2 \cdot b_2 - a \cdot c} - b_2}}{a} \]
    3. Simplified8.3%

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

      \[\leadsto \color{blue}{-0.5 \cdot \frac{c}{b_2}} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification85.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;b_2 \leq -1 \cdot 10^{+154}:\\ \;\;\;\;-2 \cdot \frac{b_2}{a} + 0.5 \cdot \frac{c}{b_2}\\ \mathbf{elif}\;b_2 \leq 8 \cdot 10^{-160}:\\ \;\;\;\;\frac{\sqrt{b_2 \cdot b_2 - a \cdot c} - b_2}{a}\\ \mathbf{elif}\;b_2 \leq 1300000000:\\ \;\;\;\;\frac{\frac{c \cdot \left(-a\right)}{b_2 + \sqrt{b_2 \cdot b_2 - a \cdot c}}}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{c}{b_2} \cdot -0.5\\ \end{array} \]

Alternative 2: 85.7% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b_2 \leq -5.5 \cdot 10^{+153}:\\ \;\;\;\;-2 \cdot \frac{b_2}{a} + 0.5 \cdot \frac{c}{b_2}\\ \mathbf{elif}\;b_2 \leq 2.7 \cdot 10^{-61}:\\ \;\;\;\;\frac{\sqrt{b_2 \cdot b_2 - a \cdot c} - b_2}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{c}{b_2} \cdot -0.5\\ \end{array} \end{array} \]
(FPCore (a b_2 c)
 :precision binary64
 (if (<= b_2 -5.5e+153)
   (+ (* -2.0 (/ b_2 a)) (* 0.5 (/ c b_2)))
   (if (<= b_2 2.7e-61)
     (/ (- (sqrt (- (* b_2 b_2) (* a c))) b_2) a)
     (* (/ c b_2) -0.5))))
double code(double a, double b_2, double c) {
	double tmp;
	if (b_2 <= -5.5e+153) {
		tmp = (-2.0 * (b_2 / a)) + (0.5 * (c / b_2));
	} else if (b_2 <= 2.7e-61) {
		tmp = (sqrt(((b_2 * b_2) - (a * c))) - b_2) / a;
	} else {
		tmp = (c / b_2) * -0.5;
	}
	return tmp;
}
real(8) function code(a, b_2, c)
    real(8), intent (in) :: a
    real(8), intent (in) :: b_2
    real(8), intent (in) :: c
    real(8) :: tmp
    if (b_2 <= (-5.5d+153)) then
        tmp = ((-2.0d0) * (b_2 / a)) + (0.5d0 * (c / b_2))
    else if (b_2 <= 2.7d-61) then
        tmp = (sqrt(((b_2 * b_2) - (a * c))) - b_2) / a
    else
        tmp = (c / b_2) * (-0.5d0)
    end if
    code = tmp
end function
public static double code(double a, double b_2, double c) {
	double tmp;
	if (b_2 <= -5.5e+153) {
		tmp = (-2.0 * (b_2 / a)) + (0.5 * (c / b_2));
	} else if (b_2 <= 2.7e-61) {
		tmp = (Math.sqrt(((b_2 * b_2) - (a * c))) - b_2) / a;
	} else {
		tmp = (c / b_2) * -0.5;
	}
	return tmp;
}
def code(a, b_2, c):
	tmp = 0
	if b_2 <= -5.5e+153:
		tmp = (-2.0 * (b_2 / a)) + (0.5 * (c / b_2))
	elif b_2 <= 2.7e-61:
		tmp = (math.sqrt(((b_2 * b_2) - (a * c))) - b_2) / a
	else:
		tmp = (c / b_2) * -0.5
	return tmp
function code(a, b_2, c)
	tmp = 0.0
	if (b_2 <= -5.5e+153)
		tmp = Float64(Float64(-2.0 * Float64(b_2 / a)) + Float64(0.5 * Float64(c / b_2)));
	elseif (b_2 <= 2.7e-61)
		tmp = Float64(Float64(sqrt(Float64(Float64(b_2 * b_2) - Float64(a * c))) - b_2) / a);
	else
		tmp = Float64(Float64(c / b_2) * -0.5);
	end
	return tmp
end
function tmp_2 = code(a, b_2, c)
	tmp = 0.0;
	if (b_2 <= -5.5e+153)
		tmp = (-2.0 * (b_2 / a)) + (0.5 * (c / b_2));
	elseif (b_2 <= 2.7e-61)
		tmp = (sqrt(((b_2 * b_2) - (a * c))) - b_2) / a;
	else
		tmp = (c / b_2) * -0.5;
	end
	tmp_2 = tmp;
end
code[a_, b$95$2_, c_] := If[LessEqual[b$95$2, -5.5e+153], N[(N[(-2.0 * N[(b$95$2 / a), $MachinePrecision]), $MachinePrecision] + N[(0.5 * N[(c / b$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b$95$2, 2.7e-61], N[(N[(N[Sqrt[N[(N[(b$95$2 * b$95$2), $MachinePrecision] - N[(a * c), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - b$95$2), $MachinePrecision] / a), $MachinePrecision], N[(N[(c / b$95$2), $MachinePrecision] * -0.5), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;b_2 \leq -5.5 \cdot 10^{+153}:\\
\;\;\;\;-2 \cdot \frac{b_2}{a} + 0.5 \cdot \frac{c}{b_2}\\

\mathbf{elif}\;b_2 \leq 2.7 \cdot 10^{-61}:\\
\;\;\;\;\frac{\sqrt{b_2 \cdot b_2 - a \cdot c} - b_2}{a}\\

\mathbf{else}:\\
\;\;\;\;\frac{c}{b_2} \cdot -0.5\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if b_2 < -5.5000000000000003e153

    1. Initial program 49.3%

      \[\frac{\left(-b_2\right) + \sqrt{b_2 \cdot b_2 - a \cdot c}}{a} \]
    2. Step-by-step derivation
      1. +-commutative49.3%

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

        \[\leadsto \frac{\color{blue}{\sqrt{b_2 \cdot b_2 - a \cdot c} - b_2}}{a} \]
    3. Simplified49.3%

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

      \[\leadsto \color{blue}{-2 \cdot \frac{b_2}{a} + 0.5 \cdot \frac{c}{b_2}} \]

    if -5.5000000000000003e153 < b_2 < 2.69999999999999993e-61

    1. Initial program 80.5%

      \[\frac{\left(-b_2\right) + \sqrt{b_2 \cdot b_2 - a \cdot c}}{a} \]
    2. Step-by-step derivation
      1. +-commutative80.5%

        \[\leadsto \frac{\color{blue}{\sqrt{b_2 \cdot b_2 - a \cdot c} + \left(-b_2\right)}}{a} \]
      2. unsub-neg80.5%

        \[\leadsto \frac{\color{blue}{\sqrt{b_2 \cdot b_2 - a \cdot c} - b_2}}{a} \]
    3. Simplified80.5%

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

    if 2.69999999999999993e-61 < b_2

    1. Initial program 13.9%

      \[\frac{\left(-b_2\right) + \sqrt{b_2 \cdot b_2 - a \cdot c}}{a} \]
    2. Step-by-step derivation
      1. +-commutative13.9%

        \[\leadsto \frac{\color{blue}{\sqrt{b_2 \cdot b_2 - a \cdot c} + \left(-b_2\right)}}{a} \]
      2. unsub-neg13.9%

        \[\leadsto \frac{\color{blue}{\sqrt{b_2 \cdot b_2 - a \cdot c} - b_2}}{a} \]
    3. Simplified13.9%

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

      \[\leadsto \color{blue}{-0.5 \cdot \frac{c}{b_2}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification84.1%

    \[\leadsto \begin{array}{l} \mathbf{if}\;b_2 \leq -5.5 \cdot 10^{+153}:\\ \;\;\;\;-2 \cdot \frac{b_2}{a} + 0.5 \cdot \frac{c}{b_2}\\ \mathbf{elif}\;b_2 \leq 2.7 \cdot 10^{-61}:\\ \;\;\;\;\frac{\sqrt{b_2 \cdot b_2 - a \cdot c} - b_2}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{c}{b_2} \cdot -0.5\\ \end{array} \]

Alternative 3: 80.2% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b_2 \leq -1.12 \cdot 10^{-26}:\\ \;\;\;\;-2 \cdot \frac{b_2}{a} + 0.5 \cdot \frac{c}{b_2}\\ \mathbf{elif}\;b_2 \leq 2.8 \cdot 10^{-67}:\\ \;\;\;\;\frac{\sqrt{c \cdot \left(-a\right)} - b_2}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{c}{b_2} \cdot -0.5\\ \end{array} \end{array} \]
(FPCore (a b_2 c)
 :precision binary64
 (if (<= b_2 -1.12e-26)
   (+ (* -2.0 (/ b_2 a)) (* 0.5 (/ c b_2)))
   (if (<= b_2 2.8e-67) (/ (- (sqrt (* c (- a))) b_2) a) (* (/ c b_2) -0.5))))
double code(double a, double b_2, double c) {
	double tmp;
	if (b_2 <= -1.12e-26) {
		tmp = (-2.0 * (b_2 / a)) + (0.5 * (c / b_2));
	} else if (b_2 <= 2.8e-67) {
		tmp = (sqrt((c * -a)) - b_2) / a;
	} else {
		tmp = (c / b_2) * -0.5;
	}
	return tmp;
}
real(8) function code(a, b_2, c)
    real(8), intent (in) :: a
    real(8), intent (in) :: b_2
    real(8), intent (in) :: c
    real(8) :: tmp
    if (b_2 <= (-1.12d-26)) then
        tmp = ((-2.0d0) * (b_2 / a)) + (0.5d0 * (c / b_2))
    else if (b_2 <= 2.8d-67) then
        tmp = (sqrt((c * -a)) - b_2) / a
    else
        tmp = (c / b_2) * (-0.5d0)
    end if
    code = tmp
end function
public static double code(double a, double b_2, double c) {
	double tmp;
	if (b_2 <= -1.12e-26) {
		tmp = (-2.0 * (b_2 / a)) + (0.5 * (c / b_2));
	} else if (b_2 <= 2.8e-67) {
		tmp = (Math.sqrt((c * -a)) - b_2) / a;
	} else {
		tmp = (c / b_2) * -0.5;
	}
	return tmp;
}
def code(a, b_2, c):
	tmp = 0
	if b_2 <= -1.12e-26:
		tmp = (-2.0 * (b_2 / a)) + (0.5 * (c / b_2))
	elif b_2 <= 2.8e-67:
		tmp = (math.sqrt((c * -a)) - b_2) / a
	else:
		tmp = (c / b_2) * -0.5
	return tmp
function code(a, b_2, c)
	tmp = 0.0
	if (b_2 <= -1.12e-26)
		tmp = Float64(Float64(-2.0 * Float64(b_2 / a)) + Float64(0.5 * Float64(c / b_2)));
	elseif (b_2 <= 2.8e-67)
		tmp = Float64(Float64(sqrt(Float64(c * Float64(-a))) - b_2) / a);
	else
		tmp = Float64(Float64(c / b_2) * -0.5);
	end
	return tmp
end
function tmp_2 = code(a, b_2, c)
	tmp = 0.0;
	if (b_2 <= -1.12e-26)
		tmp = (-2.0 * (b_2 / a)) + (0.5 * (c / b_2));
	elseif (b_2 <= 2.8e-67)
		tmp = (sqrt((c * -a)) - b_2) / a;
	else
		tmp = (c / b_2) * -0.5;
	end
	tmp_2 = tmp;
end
code[a_, b$95$2_, c_] := If[LessEqual[b$95$2, -1.12e-26], N[(N[(-2.0 * N[(b$95$2 / a), $MachinePrecision]), $MachinePrecision] + N[(0.5 * N[(c / b$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b$95$2, 2.8e-67], N[(N[(N[Sqrt[N[(c * (-a)), $MachinePrecision]], $MachinePrecision] - b$95$2), $MachinePrecision] / a), $MachinePrecision], N[(N[(c / b$95$2), $MachinePrecision] * -0.5), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;b_2 \leq -1.12 \cdot 10^{-26}:\\
\;\;\;\;-2 \cdot \frac{b_2}{a} + 0.5 \cdot \frac{c}{b_2}\\

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

\mathbf{else}:\\
\;\;\;\;\frac{c}{b_2} \cdot -0.5\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if b_2 < -1.12e-26

    1. Initial program 72.9%

      \[\frac{\left(-b_2\right) + \sqrt{b_2 \cdot b_2 - a \cdot c}}{a} \]
    2. Step-by-step derivation
      1. +-commutative72.9%

        \[\leadsto \frac{\color{blue}{\sqrt{b_2 \cdot b_2 - a \cdot c} + \left(-b_2\right)}}{a} \]
      2. unsub-neg72.9%

        \[\leadsto \frac{\color{blue}{\sqrt{b_2 \cdot b_2 - a \cdot c} - b_2}}{a} \]
    3. Simplified72.9%

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

      \[\leadsto \color{blue}{-2 \cdot \frac{b_2}{a} + 0.5 \cdot \frac{c}{b_2}} \]

    if -1.12e-26 < b_2 < 2.8000000000000001e-67

    1. Initial program 74.6%

      \[\frac{\left(-b_2\right) + \sqrt{b_2 \cdot b_2 - a \cdot c}}{a} \]
    2. Step-by-step derivation
      1. +-commutative74.6%

        \[\leadsto \frac{\color{blue}{\sqrt{b_2 \cdot b_2 - a \cdot c} + \left(-b_2\right)}}{a} \]
      2. unsub-neg74.6%

        \[\leadsto \frac{\color{blue}{\sqrt{b_2 \cdot b_2 - a \cdot c} - b_2}}{a} \]
    3. Simplified74.6%

      \[\leadsto \color{blue}{\frac{\sqrt{b_2 \cdot b_2 - a \cdot c} - b_2}{a}} \]
    4. Taylor expanded in b_2 around 0 67.7%

      \[\leadsto \frac{\sqrt{\color{blue}{-1 \cdot \left(c \cdot a\right)}} - b_2}{a} \]
    5. Step-by-step derivation
      1. mul-1-neg67.7%

        \[\leadsto \frac{\sqrt{\color{blue}{-c \cdot a}} - b_2}{a} \]
      2. distribute-rgt-neg-out67.7%

        \[\leadsto \frac{\sqrt{\color{blue}{c \cdot \left(-a\right)}} - b_2}{a} \]
    6. Simplified67.7%

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

    if 2.8000000000000001e-67 < b_2

    1. Initial program 14.7%

      \[\frac{\left(-b_2\right) + \sqrt{b_2 \cdot b_2 - a \cdot c}}{a} \]
    2. Step-by-step derivation
      1. +-commutative14.7%

        \[\leadsto \frac{\color{blue}{\sqrt{b_2 \cdot b_2 - a \cdot c} + \left(-b_2\right)}}{a} \]
      2. unsub-neg14.7%

        \[\leadsto \frac{\color{blue}{\sqrt{b_2 \cdot b_2 - a \cdot c} - b_2}}{a} \]
    3. Simplified14.7%

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

      \[\leadsto \color{blue}{-0.5 \cdot \frac{c}{b_2}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification80.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;b_2 \leq -1.12 \cdot 10^{-26}:\\ \;\;\;\;-2 \cdot \frac{b_2}{a} + 0.5 \cdot \frac{c}{b_2}\\ \mathbf{elif}\;b_2 \leq 2.8 \cdot 10^{-67}:\\ \;\;\;\;\frac{\sqrt{c \cdot \left(-a\right)} - b_2}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{c}{b_2} \cdot -0.5\\ \end{array} \]

Alternative 4: 67.7% accurate, 8.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b_2 \leq -5 \cdot 10^{-310}:\\ \;\;\;\;-2 \cdot \frac{b_2}{a} + 0.5 \cdot \frac{c}{b_2}\\ \mathbf{else}:\\ \;\;\;\;\frac{c}{b_2} \cdot -0.5\\ \end{array} \end{array} \]
(FPCore (a b_2 c)
 :precision binary64
 (if (<= b_2 -5e-310)
   (+ (* -2.0 (/ b_2 a)) (* 0.5 (/ c b_2)))
   (* (/ c b_2) -0.5)))
double code(double a, double b_2, double c) {
	double tmp;
	if (b_2 <= -5e-310) {
		tmp = (-2.0 * (b_2 / a)) + (0.5 * (c / b_2));
	} else {
		tmp = (c / b_2) * -0.5;
	}
	return tmp;
}
real(8) function code(a, b_2, c)
    real(8), intent (in) :: a
    real(8), intent (in) :: b_2
    real(8), intent (in) :: c
    real(8) :: tmp
    if (b_2 <= (-5d-310)) then
        tmp = ((-2.0d0) * (b_2 / a)) + (0.5d0 * (c / b_2))
    else
        tmp = (c / b_2) * (-0.5d0)
    end if
    code = tmp
end function
public static double code(double a, double b_2, double c) {
	double tmp;
	if (b_2 <= -5e-310) {
		tmp = (-2.0 * (b_2 / a)) + (0.5 * (c / b_2));
	} else {
		tmp = (c / b_2) * -0.5;
	}
	return tmp;
}
def code(a, b_2, c):
	tmp = 0
	if b_2 <= -5e-310:
		tmp = (-2.0 * (b_2 / a)) + (0.5 * (c / b_2))
	else:
		tmp = (c / b_2) * -0.5
	return tmp
function code(a, b_2, c)
	tmp = 0.0
	if (b_2 <= -5e-310)
		tmp = Float64(Float64(-2.0 * Float64(b_2 / a)) + Float64(0.5 * Float64(c / b_2)));
	else
		tmp = Float64(Float64(c / b_2) * -0.5);
	end
	return tmp
end
function tmp_2 = code(a, b_2, c)
	tmp = 0.0;
	if (b_2 <= -5e-310)
		tmp = (-2.0 * (b_2 / a)) + (0.5 * (c / b_2));
	else
		tmp = (c / b_2) * -0.5;
	end
	tmp_2 = tmp;
end
code[a_, b$95$2_, c_] := If[LessEqual[b$95$2, -5e-310], N[(N[(-2.0 * N[(b$95$2 / a), $MachinePrecision]), $MachinePrecision] + N[(0.5 * N[(c / b$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(c / b$95$2), $MachinePrecision] * -0.5), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;b_2 \leq -5 \cdot 10^{-310}:\\
\;\;\;\;-2 \cdot \frac{b_2}{a} + 0.5 \cdot \frac{c}{b_2}\\

\mathbf{else}:\\
\;\;\;\;\frac{c}{b_2} \cdot -0.5\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if b_2 < -4.999999999999985e-310

    1. Initial program 76.3%

      \[\frac{\left(-b_2\right) + \sqrt{b_2 \cdot b_2 - a \cdot c}}{a} \]
    2. Step-by-step derivation
      1. +-commutative76.3%

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

        \[\leadsto \frac{\color{blue}{\sqrt{b_2 \cdot b_2 - a \cdot c} - b_2}}{a} \]
    3. Simplified76.3%

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

      \[\leadsto \color{blue}{-2 \cdot \frac{b_2}{a} + 0.5 \cdot \frac{c}{b_2}} \]

    if -4.999999999999985e-310 < b_2

    1. Initial program 30.5%

      \[\frac{\left(-b_2\right) + \sqrt{b_2 \cdot b_2 - a \cdot c}}{a} \]
    2. Step-by-step derivation
      1. +-commutative30.5%

        \[\leadsto \frac{\color{blue}{\sqrt{b_2 \cdot b_2 - a \cdot c} + \left(-b_2\right)}}{a} \]
      2. unsub-neg30.5%

        \[\leadsto \frac{\color{blue}{\sqrt{b_2 \cdot b_2 - a \cdot c} - b_2}}{a} \]
    3. Simplified30.5%

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

      \[\leadsto \color{blue}{-0.5 \cdot \frac{c}{b_2}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification64.4%

    \[\leadsto \begin{array}{l} \mathbf{if}\;b_2 \leq -5 \cdot 10^{-310}:\\ \;\;\;\;-2 \cdot \frac{b_2}{a} + 0.5 \cdot \frac{c}{b_2}\\ \mathbf{else}:\\ \;\;\;\;\frac{c}{b_2} \cdot -0.5\\ \end{array} \]

Alternative 5: 47.6% accurate, 15.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b_2 \leq -5 \cdot 10^{-310}:\\ \;\;\;\;\frac{-b_2}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{c}{b_2} \cdot -0.5\\ \end{array} \end{array} \]
(FPCore (a b_2 c)
 :precision binary64
 (if (<= b_2 -5e-310) (/ (- b_2) a) (* (/ c b_2) -0.5)))
double code(double a, double b_2, double c) {
	double tmp;
	if (b_2 <= -5e-310) {
		tmp = -b_2 / a;
	} else {
		tmp = (c / b_2) * -0.5;
	}
	return tmp;
}
real(8) function code(a, b_2, c)
    real(8), intent (in) :: a
    real(8), intent (in) :: b_2
    real(8), intent (in) :: c
    real(8) :: tmp
    if (b_2 <= (-5d-310)) then
        tmp = -b_2 / a
    else
        tmp = (c / b_2) * (-0.5d0)
    end if
    code = tmp
end function
public static double code(double a, double b_2, double c) {
	double tmp;
	if (b_2 <= -5e-310) {
		tmp = -b_2 / a;
	} else {
		tmp = (c / b_2) * -0.5;
	}
	return tmp;
}
def code(a, b_2, c):
	tmp = 0
	if b_2 <= -5e-310:
		tmp = -b_2 / a
	else:
		tmp = (c / b_2) * -0.5
	return tmp
function code(a, b_2, c)
	tmp = 0.0
	if (b_2 <= -5e-310)
		tmp = Float64(Float64(-b_2) / a);
	else
		tmp = Float64(Float64(c / b_2) * -0.5);
	end
	return tmp
end
function tmp_2 = code(a, b_2, c)
	tmp = 0.0;
	if (b_2 <= -5e-310)
		tmp = -b_2 / a;
	else
		tmp = (c / b_2) * -0.5;
	end
	tmp_2 = tmp;
end
code[a_, b$95$2_, c_] := If[LessEqual[b$95$2, -5e-310], N[((-b$95$2) / a), $MachinePrecision], N[(N[(c / b$95$2), $MachinePrecision] * -0.5), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;b_2 \leq -5 \cdot 10^{-310}:\\
\;\;\;\;\frac{-b_2}{a}\\

\mathbf{else}:\\
\;\;\;\;\frac{c}{b_2} \cdot -0.5\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if b_2 < -4.999999999999985e-310

    1. Initial program 76.3%

      \[\frac{\left(-b_2\right) + \sqrt{b_2 \cdot b_2 - a \cdot c}}{a} \]
    2. Step-by-step derivation
      1. +-commutative76.3%

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

        \[\leadsto \frac{\color{blue}{\sqrt{b_2 \cdot b_2 - a \cdot c} - b_2}}{a} \]
    3. Simplified76.3%

      \[\leadsto \color{blue}{\frac{\sqrt{b_2 \cdot b_2 - a \cdot c} - b_2}{a}} \]
    4. Step-by-step derivation
      1. add-sqr-sqrt76.0%

        \[\leadsto \frac{\color{blue}{\sqrt{\sqrt{b_2 \cdot b_2 - a \cdot c}} \cdot \sqrt{\sqrt{b_2 \cdot b_2 - a \cdot c}}} - b_2}{a} \]
      2. fma-neg76.1%

        \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(\sqrt{\sqrt{b_2 \cdot b_2 - a \cdot c}}, \sqrt{\sqrt{b_2 \cdot b_2 - a \cdot c}}, -b_2\right)}}{a} \]
      3. pow1/276.1%

        \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\color{blue}{{\left(b_2 \cdot b_2 - a \cdot c\right)}^{0.5}}}, \sqrt{\sqrt{b_2 \cdot b_2 - a \cdot c}}, -b_2\right)}{a} \]
      4. sqrt-pow176.2%

        \[\leadsto \frac{\mathsf{fma}\left(\color{blue}{{\left(b_2 \cdot b_2 - a \cdot c\right)}^{\left(\frac{0.5}{2}\right)}}, \sqrt{\sqrt{b_2 \cdot b_2 - a \cdot c}}, -b_2\right)}{a} \]
      5. fma-neg76.2%

        \[\leadsto \frac{\mathsf{fma}\left({\color{blue}{\left(\mathsf{fma}\left(b_2, b_2, -a \cdot c\right)\right)}}^{\left(\frac{0.5}{2}\right)}, \sqrt{\sqrt{b_2 \cdot b_2 - a \cdot c}}, -b_2\right)}{a} \]
      6. *-commutative76.2%

        \[\leadsto \frac{\mathsf{fma}\left({\left(\mathsf{fma}\left(b_2, b_2, -\color{blue}{c \cdot a}\right)\right)}^{\left(\frac{0.5}{2}\right)}, \sqrt{\sqrt{b_2 \cdot b_2 - a \cdot c}}, -b_2\right)}{a} \]
      7. distribute-rgt-neg-in76.2%

        \[\leadsto \frac{\mathsf{fma}\left({\left(\mathsf{fma}\left(b_2, b_2, \color{blue}{c \cdot \left(-a\right)}\right)\right)}^{\left(\frac{0.5}{2}\right)}, \sqrt{\sqrt{b_2 \cdot b_2 - a \cdot c}}, -b_2\right)}{a} \]
      8. metadata-eval76.2%

        \[\leadsto \frac{\mathsf{fma}\left({\left(\mathsf{fma}\left(b_2, b_2, c \cdot \left(-a\right)\right)\right)}^{\color{blue}{0.25}}, \sqrt{\sqrt{b_2 \cdot b_2 - a \cdot c}}, -b_2\right)}{a} \]
      9. pow1/276.2%

        \[\leadsto \frac{\mathsf{fma}\left({\left(\mathsf{fma}\left(b_2, b_2, c \cdot \left(-a\right)\right)\right)}^{0.25}, \sqrt{\color{blue}{{\left(b_2 \cdot b_2 - a \cdot c\right)}^{0.5}}}, -b_2\right)}{a} \]
      10. sqrt-pow176.1%

        \[\leadsto \frac{\mathsf{fma}\left({\left(\mathsf{fma}\left(b_2, b_2, c \cdot \left(-a\right)\right)\right)}^{0.25}, \color{blue}{{\left(b_2 \cdot b_2 - a \cdot c\right)}^{\left(\frac{0.5}{2}\right)}}, -b_2\right)}{a} \]
      11. fma-neg76.2%

        \[\leadsto \frac{\mathsf{fma}\left({\left(\mathsf{fma}\left(b_2, b_2, c \cdot \left(-a\right)\right)\right)}^{0.25}, {\color{blue}{\left(\mathsf{fma}\left(b_2, b_2, -a \cdot c\right)\right)}}^{\left(\frac{0.5}{2}\right)}, -b_2\right)}{a} \]
      12. *-commutative76.2%

        \[\leadsto \frac{\mathsf{fma}\left({\left(\mathsf{fma}\left(b_2, b_2, c \cdot \left(-a\right)\right)\right)}^{0.25}, {\left(\mathsf{fma}\left(b_2, b_2, -\color{blue}{c \cdot a}\right)\right)}^{\left(\frac{0.5}{2}\right)}, -b_2\right)}{a} \]
      13. distribute-rgt-neg-in76.2%

        \[\leadsto \frac{\mathsf{fma}\left({\left(\mathsf{fma}\left(b_2, b_2, c \cdot \left(-a\right)\right)\right)}^{0.25}, {\left(\mathsf{fma}\left(b_2, b_2, \color{blue}{c \cdot \left(-a\right)}\right)\right)}^{\left(\frac{0.5}{2}\right)}, -b_2\right)}{a} \]
      14. metadata-eval76.2%

        \[\leadsto \frac{\mathsf{fma}\left({\left(\mathsf{fma}\left(b_2, b_2, c \cdot \left(-a\right)\right)\right)}^{0.25}, {\left(\mathsf{fma}\left(b_2, b_2, c \cdot \left(-a\right)\right)\right)}^{\color{blue}{0.25}}, -b_2\right)}{a} \]
    5. Applied egg-rr76.2%

      \[\leadsto \frac{\color{blue}{\mathsf{fma}\left({\left(\mathsf{fma}\left(b_2, b_2, c \cdot \left(-a\right)\right)\right)}^{0.25}, {\left(\mathsf{fma}\left(b_2, b_2, c \cdot \left(-a\right)\right)\right)}^{0.25}, -b_2\right)}}{a} \]
    6. Taylor expanded in b_2 around inf 28.2%

      \[\leadsto \frac{\color{blue}{-1 \cdot b_2}}{a} \]
    7. Step-by-step derivation
      1. neg-mul-128.2%

        \[\leadsto \frac{\color{blue}{-b_2}}{a} \]
    8. Simplified28.2%

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

    if -4.999999999999985e-310 < b_2

    1. Initial program 30.5%

      \[\frac{\left(-b_2\right) + \sqrt{b_2 \cdot b_2 - a \cdot c}}{a} \]
    2. Step-by-step derivation
      1. +-commutative30.5%

        \[\leadsto \frac{\color{blue}{\sqrt{b_2 \cdot b_2 - a \cdot c} + \left(-b_2\right)}}{a} \]
      2. unsub-neg30.5%

        \[\leadsto \frac{\color{blue}{\sqrt{b_2 \cdot b_2 - a \cdot c} - b_2}}{a} \]
    3. Simplified30.5%

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

      \[\leadsto \color{blue}{-0.5 \cdot \frac{c}{b_2}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification48.2%

    \[\leadsto \begin{array}{l} \mathbf{if}\;b_2 \leq -5 \cdot 10^{-310}:\\ \;\;\;\;\frac{-b_2}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{c}{b_2} \cdot -0.5\\ \end{array} \]

Alternative 6: 67.4% accurate, 15.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b_2 \leq -5 \cdot 10^{-310}:\\ \;\;\;\;\frac{b_2 \cdot -2}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{c}{b_2} \cdot -0.5\\ \end{array} \end{array} \]
(FPCore (a b_2 c)
 :precision binary64
 (if (<= b_2 -5e-310) (/ (* b_2 -2.0) a) (* (/ c b_2) -0.5)))
double code(double a, double b_2, double c) {
	double tmp;
	if (b_2 <= -5e-310) {
		tmp = (b_2 * -2.0) / a;
	} else {
		tmp = (c / b_2) * -0.5;
	}
	return tmp;
}
real(8) function code(a, b_2, c)
    real(8), intent (in) :: a
    real(8), intent (in) :: b_2
    real(8), intent (in) :: c
    real(8) :: tmp
    if (b_2 <= (-5d-310)) then
        tmp = (b_2 * (-2.0d0)) / a
    else
        tmp = (c / b_2) * (-0.5d0)
    end if
    code = tmp
end function
public static double code(double a, double b_2, double c) {
	double tmp;
	if (b_2 <= -5e-310) {
		tmp = (b_2 * -2.0) / a;
	} else {
		tmp = (c / b_2) * -0.5;
	}
	return tmp;
}
def code(a, b_2, c):
	tmp = 0
	if b_2 <= -5e-310:
		tmp = (b_2 * -2.0) / a
	else:
		tmp = (c / b_2) * -0.5
	return tmp
function code(a, b_2, c)
	tmp = 0.0
	if (b_2 <= -5e-310)
		tmp = Float64(Float64(b_2 * -2.0) / a);
	else
		tmp = Float64(Float64(c / b_2) * -0.5);
	end
	return tmp
end
function tmp_2 = code(a, b_2, c)
	tmp = 0.0;
	if (b_2 <= -5e-310)
		tmp = (b_2 * -2.0) / a;
	else
		tmp = (c / b_2) * -0.5;
	end
	tmp_2 = tmp;
end
code[a_, b$95$2_, c_] := If[LessEqual[b$95$2, -5e-310], N[(N[(b$95$2 * -2.0), $MachinePrecision] / a), $MachinePrecision], N[(N[(c / b$95$2), $MachinePrecision] * -0.5), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;b_2 \leq -5 \cdot 10^{-310}:\\
\;\;\;\;\frac{b_2 \cdot -2}{a}\\

\mathbf{else}:\\
\;\;\;\;\frac{c}{b_2} \cdot -0.5\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if b_2 < -4.999999999999985e-310

    1. Initial program 76.3%

      \[\frac{\left(-b_2\right) + \sqrt{b_2 \cdot b_2 - a \cdot c}}{a} \]
    2. Step-by-step derivation
      1. +-commutative76.3%

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

        \[\leadsto \frac{\color{blue}{\sqrt{b_2 \cdot b_2 - a \cdot c} - b_2}}{a} \]
    3. Simplified76.3%

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

      \[\leadsto \frac{\color{blue}{-2 \cdot b_2}}{a} \]
    5. Step-by-step derivation
      1. *-commutative62.1%

        \[\leadsto \frac{\color{blue}{b_2 \cdot -2}}{a} \]
    6. Simplified62.1%

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

    if -4.999999999999985e-310 < b_2

    1. Initial program 30.5%

      \[\frac{\left(-b_2\right) + \sqrt{b_2 \cdot b_2 - a \cdot c}}{a} \]
    2. Step-by-step derivation
      1. +-commutative30.5%

        \[\leadsto \frac{\color{blue}{\sqrt{b_2 \cdot b_2 - a \cdot c} + \left(-b_2\right)}}{a} \]
      2. unsub-neg30.5%

        \[\leadsto \frac{\color{blue}{\sqrt{b_2 \cdot b_2 - a \cdot c} - b_2}}{a} \]
    3. Simplified30.5%

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

      \[\leadsto \color{blue}{-0.5 \cdot \frac{c}{b_2}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification64.3%

    \[\leadsto \begin{array}{l} \mathbf{if}\;b_2 \leq -5 \cdot 10^{-310}:\\ \;\;\;\;\frac{b_2 \cdot -2}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{c}{b_2} \cdot -0.5\\ \end{array} \]

Alternative 7: 23.5% accurate, 18.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b_2 \leq -5 \cdot 10^{-310}:\\ \;\;\;\;\frac{-b_2}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{0}{a}\\ \end{array} \end{array} \]
(FPCore (a b_2 c)
 :precision binary64
 (if (<= b_2 -5e-310) (/ (- b_2) a) (/ 0.0 a)))
double code(double a, double b_2, double c) {
	double tmp;
	if (b_2 <= -5e-310) {
		tmp = -b_2 / a;
	} else {
		tmp = 0.0 / a;
	}
	return tmp;
}
real(8) function code(a, b_2, c)
    real(8), intent (in) :: a
    real(8), intent (in) :: b_2
    real(8), intent (in) :: c
    real(8) :: tmp
    if (b_2 <= (-5d-310)) then
        tmp = -b_2 / a
    else
        tmp = 0.0d0 / a
    end if
    code = tmp
end function
public static double code(double a, double b_2, double c) {
	double tmp;
	if (b_2 <= -5e-310) {
		tmp = -b_2 / a;
	} else {
		tmp = 0.0 / a;
	}
	return tmp;
}
def code(a, b_2, c):
	tmp = 0
	if b_2 <= -5e-310:
		tmp = -b_2 / a
	else:
		tmp = 0.0 / a
	return tmp
function code(a, b_2, c)
	tmp = 0.0
	if (b_2 <= -5e-310)
		tmp = Float64(Float64(-b_2) / a);
	else
		tmp = Float64(0.0 / a);
	end
	return tmp
end
function tmp_2 = code(a, b_2, c)
	tmp = 0.0;
	if (b_2 <= -5e-310)
		tmp = -b_2 / a;
	else
		tmp = 0.0 / a;
	end
	tmp_2 = tmp;
end
code[a_, b$95$2_, c_] := If[LessEqual[b$95$2, -5e-310], N[((-b$95$2) / a), $MachinePrecision], N[(0.0 / a), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;b_2 \leq -5 \cdot 10^{-310}:\\
\;\;\;\;\frac{-b_2}{a}\\

\mathbf{else}:\\
\;\;\;\;\frac{0}{a}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if b_2 < -4.999999999999985e-310

    1. Initial program 76.3%

      \[\frac{\left(-b_2\right) + \sqrt{b_2 \cdot b_2 - a \cdot c}}{a} \]
    2. Step-by-step derivation
      1. +-commutative76.3%

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

        \[\leadsto \frac{\color{blue}{\sqrt{b_2 \cdot b_2 - a \cdot c} - b_2}}{a} \]
    3. Simplified76.3%

      \[\leadsto \color{blue}{\frac{\sqrt{b_2 \cdot b_2 - a \cdot c} - b_2}{a}} \]
    4. Step-by-step derivation
      1. add-sqr-sqrt76.0%

        \[\leadsto \frac{\color{blue}{\sqrt{\sqrt{b_2 \cdot b_2 - a \cdot c}} \cdot \sqrt{\sqrt{b_2 \cdot b_2 - a \cdot c}}} - b_2}{a} \]
      2. fma-neg76.1%

        \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(\sqrt{\sqrt{b_2 \cdot b_2 - a \cdot c}}, \sqrt{\sqrt{b_2 \cdot b_2 - a \cdot c}}, -b_2\right)}}{a} \]
      3. pow1/276.1%

        \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\color{blue}{{\left(b_2 \cdot b_2 - a \cdot c\right)}^{0.5}}}, \sqrt{\sqrt{b_2 \cdot b_2 - a \cdot c}}, -b_2\right)}{a} \]
      4. sqrt-pow176.2%

        \[\leadsto \frac{\mathsf{fma}\left(\color{blue}{{\left(b_2 \cdot b_2 - a \cdot c\right)}^{\left(\frac{0.5}{2}\right)}}, \sqrt{\sqrt{b_2 \cdot b_2 - a \cdot c}}, -b_2\right)}{a} \]
      5. fma-neg76.2%

        \[\leadsto \frac{\mathsf{fma}\left({\color{blue}{\left(\mathsf{fma}\left(b_2, b_2, -a \cdot c\right)\right)}}^{\left(\frac{0.5}{2}\right)}, \sqrt{\sqrt{b_2 \cdot b_2 - a \cdot c}}, -b_2\right)}{a} \]
      6. *-commutative76.2%

        \[\leadsto \frac{\mathsf{fma}\left({\left(\mathsf{fma}\left(b_2, b_2, -\color{blue}{c \cdot a}\right)\right)}^{\left(\frac{0.5}{2}\right)}, \sqrt{\sqrt{b_2 \cdot b_2 - a \cdot c}}, -b_2\right)}{a} \]
      7. distribute-rgt-neg-in76.2%

        \[\leadsto \frac{\mathsf{fma}\left({\left(\mathsf{fma}\left(b_2, b_2, \color{blue}{c \cdot \left(-a\right)}\right)\right)}^{\left(\frac{0.5}{2}\right)}, \sqrt{\sqrt{b_2 \cdot b_2 - a \cdot c}}, -b_2\right)}{a} \]
      8. metadata-eval76.2%

        \[\leadsto \frac{\mathsf{fma}\left({\left(\mathsf{fma}\left(b_2, b_2, c \cdot \left(-a\right)\right)\right)}^{\color{blue}{0.25}}, \sqrt{\sqrt{b_2 \cdot b_2 - a \cdot c}}, -b_2\right)}{a} \]
      9. pow1/276.2%

        \[\leadsto \frac{\mathsf{fma}\left({\left(\mathsf{fma}\left(b_2, b_2, c \cdot \left(-a\right)\right)\right)}^{0.25}, \sqrt{\color{blue}{{\left(b_2 \cdot b_2 - a \cdot c\right)}^{0.5}}}, -b_2\right)}{a} \]
      10. sqrt-pow176.1%

        \[\leadsto \frac{\mathsf{fma}\left({\left(\mathsf{fma}\left(b_2, b_2, c \cdot \left(-a\right)\right)\right)}^{0.25}, \color{blue}{{\left(b_2 \cdot b_2 - a \cdot c\right)}^{\left(\frac{0.5}{2}\right)}}, -b_2\right)}{a} \]
      11. fma-neg76.2%

        \[\leadsto \frac{\mathsf{fma}\left({\left(\mathsf{fma}\left(b_2, b_2, c \cdot \left(-a\right)\right)\right)}^{0.25}, {\color{blue}{\left(\mathsf{fma}\left(b_2, b_2, -a \cdot c\right)\right)}}^{\left(\frac{0.5}{2}\right)}, -b_2\right)}{a} \]
      12. *-commutative76.2%

        \[\leadsto \frac{\mathsf{fma}\left({\left(\mathsf{fma}\left(b_2, b_2, c \cdot \left(-a\right)\right)\right)}^{0.25}, {\left(\mathsf{fma}\left(b_2, b_2, -\color{blue}{c \cdot a}\right)\right)}^{\left(\frac{0.5}{2}\right)}, -b_2\right)}{a} \]
      13. distribute-rgt-neg-in76.2%

        \[\leadsto \frac{\mathsf{fma}\left({\left(\mathsf{fma}\left(b_2, b_2, c \cdot \left(-a\right)\right)\right)}^{0.25}, {\left(\mathsf{fma}\left(b_2, b_2, \color{blue}{c \cdot \left(-a\right)}\right)\right)}^{\left(\frac{0.5}{2}\right)}, -b_2\right)}{a} \]
      14. metadata-eval76.2%

        \[\leadsto \frac{\mathsf{fma}\left({\left(\mathsf{fma}\left(b_2, b_2, c \cdot \left(-a\right)\right)\right)}^{0.25}, {\left(\mathsf{fma}\left(b_2, b_2, c \cdot \left(-a\right)\right)\right)}^{\color{blue}{0.25}}, -b_2\right)}{a} \]
    5. Applied egg-rr76.2%

      \[\leadsto \frac{\color{blue}{\mathsf{fma}\left({\left(\mathsf{fma}\left(b_2, b_2, c \cdot \left(-a\right)\right)\right)}^{0.25}, {\left(\mathsf{fma}\left(b_2, b_2, c \cdot \left(-a\right)\right)\right)}^{0.25}, -b_2\right)}}{a} \]
    6. Taylor expanded in b_2 around inf 28.2%

      \[\leadsto \frac{\color{blue}{-1 \cdot b_2}}{a} \]
    7. Step-by-step derivation
      1. neg-mul-128.2%

        \[\leadsto \frac{\color{blue}{-b_2}}{a} \]
    8. Simplified28.2%

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

    if -4.999999999999985e-310 < b_2

    1. Initial program 30.5%

      \[\frac{\left(-b_2\right) + \sqrt{b_2 \cdot b_2 - a \cdot c}}{a} \]
    2. Step-by-step derivation
      1. +-commutative30.5%

        \[\leadsto \frac{\color{blue}{\sqrt{b_2 \cdot b_2 - a \cdot c} + \left(-b_2\right)}}{a} \]
      2. unsub-neg30.5%

        \[\leadsto \frac{\color{blue}{\sqrt{b_2 \cdot b_2 - a \cdot c} - b_2}}{a} \]
    3. Simplified30.5%

      \[\leadsto \color{blue}{\frac{\sqrt{b_2 \cdot b_2 - a \cdot c} - b_2}{a}} \]
    4. Step-by-step derivation
      1. add-sqr-sqrt28.9%

        \[\leadsto \frac{\color{blue}{\sqrt{\sqrt{b_2 \cdot b_2 - a \cdot c}} \cdot \sqrt{\sqrt{b_2 \cdot b_2 - a \cdot c}}} - b_2}{a} \]
      2. fma-neg27.4%

        \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(\sqrt{\sqrt{b_2 \cdot b_2 - a \cdot c}}, \sqrt{\sqrt{b_2 \cdot b_2 - a \cdot c}}, -b_2\right)}}{a} \]
      3. pow1/227.4%

        \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\color{blue}{{\left(b_2 \cdot b_2 - a \cdot c\right)}^{0.5}}}, \sqrt{\sqrt{b_2 \cdot b_2 - a \cdot c}}, -b_2\right)}{a} \]
      4. sqrt-pow127.4%

        \[\leadsto \frac{\mathsf{fma}\left(\color{blue}{{\left(b_2 \cdot b_2 - a \cdot c\right)}^{\left(\frac{0.5}{2}\right)}}, \sqrt{\sqrt{b_2 \cdot b_2 - a \cdot c}}, -b_2\right)}{a} \]
      5. fma-neg27.4%

        \[\leadsto \frac{\mathsf{fma}\left({\color{blue}{\left(\mathsf{fma}\left(b_2, b_2, -a \cdot c\right)\right)}}^{\left(\frac{0.5}{2}\right)}, \sqrt{\sqrt{b_2 \cdot b_2 - a \cdot c}}, -b_2\right)}{a} \]
      6. *-commutative27.4%

        \[\leadsto \frac{\mathsf{fma}\left({\left(\mathsf{fma}\left(b_2, b_2, -\color{blue}{c \cdot a}\right)\right)}^{\left(\frac{0.5}{2}\right)}, \sqrt{\sqrt{b_2 \cdot b_2 - a \cdot c}}, -b_2\right)}{a} \]
      7. distribute-rgt-neg-in27.4%

        \[\leadsto \frac{\mathsf{fma}\left({\left(\mathsf{fma}\left(b_2, b_2, \color{blue}{c \cdot \left(-a\right)}\right)\right)}^{\left(\frac{0.5}{2}\right)}, \sqrt{\sqrt{b_2 \cdot b_2 - a \cdot c}}, -b_2\right)}{a} \]
      8. metadata-eval27.4%

        \[\leadsto \frac{\mathsf{fma}\left({\left(\mathsf{fma}\left(b_2, b_2, c \cdot \left(-a\right)\right)\right)}^{\color{blue}{0.25}}, \sqrt{\sqrt{b_2 \cdot b_2 - a \cdot c}}, -b_2\right)}{a} \]
      9. pow1/227.4%

        \[\leadsto \frac{\mathsf{fma}\left({\left(\mathsf{fma}\left(b_2, b_2, c \cdot \left(-a\right)\right)\right)}^{0.25}, \sqrt{\color{blue}{{\left(b_2 \cdot b_2 - a \cdot c\right)}^{0.5}}}, -b_2\right)}{a} \]
      10. sqrt-pow127.4%

        \[\leadsto \frac{\mathsf{fma}\left({\left(\mathsf{fma}\left(b_2, b_2, c \cdot \left(-a\right)\right)\right)}^{0.25}, \color{blue}{{\left(b_2 \cdot b_2 - a \cdot c\right)}^{\left(\frac{0.5}{2}\right)}}, -b_2\right)}{a} \]
      11. fma-neg27.4%

        \[\leadsto \frac{\mathsf{fma}\left({\left(\mathsf{fma}\left(b_2, b_2, c \cdot \left(-a\right)\right)\right)}^{0.25}, {\color{blue}{\left(\mathsf{fma}\left(b_2, b_2, -a \cdot c\right)\right)}}^{\left(\frac{0.5}{2}\right)}, -b_2\right)}{a} \]
      12. *-commutative27.4%

        \[\leadsto \frac{\mathsf{fma}\left({\left(\mathsf{fma}\left(b_2, b_2, c \cdot \left(-a\right)\right)\right)}^{0.25}, {\left(\mathsf{fma}\left(b_2, b_2, -\color{blue}{c \cdot a}\right)\right)}^{\left(\frac{0.5}{2}\right)}, -b_2\right)}{a} \]
      13. distribute-rgt-neg-in27.4%

        \[\leadsto \frac{\mathsf{fma}\left({\left(\mathsf{fma}\left(b_2, b_2, c \cdot \left(-a\right)\right)\right)}^{0.25}, {\left(\mathsf{fma}\left(b_2, b_2, \color{blue}{c \cdot \left(-a\right)}\right)\right)}^{\left(\frac{0.5}{2}\right)}, -b_2\right)}{a} \]
      14. metadata-eval27.4%

        \[\leadsto \frac{\mathsf{fma}\left({\left(\mathsf{fma}\left(b_2, b_2, c \cdot \left(-a\right)\right)\right)}^{0.25}, {\left(\mathsf{fma}\left(b_2, b_2, c \cdot \left(-a\right)\right)\right)}^{\color{blue}{0.25}}, -b_2\right)}{a} \]
    5. Applied egg-rr27.4%

      \[\leadsto \frac{\color{blue}{\mathsf{fma}\left({\left(\mathsf{fma}\left(b_2, b_2, c \cdot \left(-a\right)\right)\right)}^{0.25}, {\left(\mathsf{fma}\left(b_2, b_2, c \cdot \left(-a\right)\right)\right)}^{0.25}, -b_2\right)}}{a} \]
    6. Taylor expanded in b_2 around inf 19.1%

      \[\leadsto \frac{\color{blue}{-1 \cdot b_2 + b_2}}{a} \]
    7. Step-by-step derivation
      1. distribute-lft1-in19.1%

        \[\leadsto \frac{\color{blue}{\left(-1 + 1\right) \cdot b_2}}{a} \]
      2. metadata-eval19.1%

        \[\leadsto \frac{\color{blue}{0} \cdot b_2}{a} \]
      3. mul0-lft19.1%

        \[\leadsto \frac{\color{blue}{0}}{a} \]
    8. Simplified19.1%

      \[\leadsto \frac{\color{blue}{0}}{a} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification23.4%

    \[\leadsto \begin{array}{l} \mathbf{if}\;b_2 \leq -5 \cdot 10^{-310}:\\ \;\;\;\;\frac{-b_2}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{0}{a}\\ \end{array} \]

Alternative 8: 10.9% accurate, 37.3× speedup?

\[\begin{array}{l} \\ \frac{0}{a} \end{array} \]
(FPCore (a b_2 c) :precision binary64 (/ 0.0 a))
double code(double a, double b_2, double c) {
	return 0.0 / a;
}
real(8) function code(a, b_2, c)
    real(8), intent (in) :: a
    real(8), intent (in) :: b_2
    real(8), intent (in) :: c
    code = 0.0d0 / a
end function
public static double code(double a, double b_2, double c) {
	return 0.0 / a;
}
def code(a, b_2, c):
	return 0.0 / a
function code(a, b_2, c)
	return Float64(0.0 / a)
end
function tmp = code(a, b_2, c)
	tmp = 0.0 / a;
end
code[a_, b$95$2_, c_] := N[(0.0 / a), $MachinePrecision]
\begin{array}{l}

\\
\frac{0}{a}
\end{array}
Derivation
  1. Initial program 52.2%

    \[\frac{\left(-b_2\right) + \sqrt{b_2 \cdot b_2 - a \cdot c}}{a} \]
  2. Step-by-step derivation
    1. +-commutative52.2%

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

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

    \[\leadsto \color{blue}{\frac{\sqrt{b_2 \cdot b_2 - a \cdot c} - b_2}{a}} \]
  4. Step-by-step derivation
    1. add-sqr-sqrt51.2%

      \[\leadsto \frac{\color{blue}{\sqrt{\sqrt{b_2 \cdot b_2 - a \cdot c}} \cdot \sqrt{\sqrt{b_2 \cdot b_2 - a \cdot c}}} - b_2}{a} \]
    2. fma-neg50.4%

      \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(\sqrt{\sqrt{b_2 \cdot b_2 - a \cdot c}}, \sqrt{\sqrt{b_2 \cdot b_2 - a \cdot c}}, -b_2\right)}}{a} \]
    3. pow1/250.4%

      \[\leadsto \frac{\mathsf{fma}\left(\sqrt{\color{blue}{{\left(b_2 \cdot b_2 - a \cdot c\right)}^{0.5}}}, \sqrt{\sqrt{b_2 \cdot b_2 - a \cdot c}}, -b_2\right)}{a} \]
    4. sqrt-pow150.5%

      \[\leadsto \frac{\mathsf{fma}\left(\color{blue}{{\left(b_2 \cdot b_2 - a \cdot c\right)}^{\left(\frac{0.5}{2}\right)}}, \sqrt{\sqrt{b_2 \cdot b_2 - a \cdot c}}, -b_2\right)}{a} \]
    5. fma-neg50.5%

      \[\leadsto \frac{\mathsf{fma}\left({\color{blue}{\left(\mathsf{fma}\left(b_2, b_2, -a \cdot c\right)\right)}}^{\left(\frac{0.5}{2}\right)}, \sqrt{\sqrt{b_2 \cdot b_2 - a \cdot c}}, -b_2\right)}{a} \]
    6. *-commutative50.5%

      \[\leadsto \frac{\mathsf{fma}\left({\left(\mathsf{fma}\left(b_2, b_2, -\color{blue}{c \cdot a}\right)\right)}^{\left(\frac{0.5}{2}\right)}, \sqrt{\sqrt{b_2 \cdot b_2 - a \cdot c}}, -b_2\right)}{a} \]
    7. distribute-rgt-neg-in50.5%

      \[\leadsto \frac{\mathsf{fma}\left({\left(\mathsf{fma}\left(b_2, b_2, \color{blue}{c \cdot \left(-a\right)}\right)\right)}^{\left(\frac{0.5}{2}\right)}, \sqrt{\sqrt{b_2 \cdot b_2 - a \cdot c}}, -b_2\right)}{a} \]
    8. metadata-eval50.5%

      \[\leadsto \frac{\mathsf{fma}\left({\left(\mathsf{fma}\left(b_2, b_2, c \cdot \left(-a\right)\right)\right)}^{\color{blue}{0.25}}, \sqrt{\sqrt{b_2 \cdot b_2 - a \cdot c}}, -b_2\right)}{a} \]
    9. pow1/250.5%

      \[\leadsto \frac{\mathsf{fma}\left({\left(\mathsf{fma}\left(b_2, b_2, c \cdot \left(-a\right)\right)\right)}^{0.25}, \sqrt{\color{blue}{{\left(b_2 \cdot b_2 - a \cdot c\right)}^{0.5}}}, -b_2\right)}{a} \]
    10. sqrt-pow150.4%

      \[\leadsto \frac{\mathsf{fma}\left({\left(\mathsf{fma}\left(b_2, b_2, c \cdot \left(-a\right)\right)\right)}^{0.25}, \color{blue}{{\left(b_2 \cdot b_2 - a \cdot c\right)}^{\left(\frac{0.5}{2}\right)}}, -b_2\right)}{a} \]
    11. fma-neg50.5%

      \[\leadsto \frac{\mathsf{fma}\left({\left(\mathsf{fma}\left(b_2, b_2, c \cdot \left(-a\right)\right)\right)}^{0.25}, {\color{blue}{\left(\mathsf{fma}\left(b_2, b_2, -a \cdot c\right)\right)}}^{\left(\frac{0.5}{2}\right)}, -b_2\right)}{a} \]
    12. *-commutative50.5%

      \[\leadsto \frac{\mathsf{fma}\left({\left(\mathsf{fma}\left(b_2, b_2, c \cdot \left(-a\right)\right)\right)}^{0.25}, {\left(\mathsf{fma}\left(b_2, b_2, -\color{blue}{c \cdot a}\right)\right)}^{\left(\frac{0.5}{2}\right)}, -b_2\right)}{a} \]
    13. distribute-rgt-neg-in50.5%

      \[\leadsto \frac{\mathsf{fma}\left({\left(\mathsf{fma}\left(b_2, b_2, c \cdot \left(-a\right)\right)\right)}^{0.25}, {\left(\mathsf{fma}\left(b_2, b_2, \color{blue}{c \cdot \left(-a\right)}\right)\right)}^{\left(\frac{0.5}{2}\right)}, -b_2\right)}{a} \]
    14. metadata-eval50.5%

      \[\leadsto \frac{\mathsf{fma}\left({\left(\mathsf{fma}\left(b_2, b_2, c \cdot \left(-a\right)\right)\right)}^{0.25}, {\left(\mathsf{fma}\left(b_2, b_2, c \cdot \left(-a\right)\right)\right)}^{\color{blue}{0.25}}, -b_2\right)}{a} \]
  5. Applied egg-rr50.5%

    \[\leadsto \frac{\color{blue}{\mathsf{fma}\left({\left(\mathsf{fma}\left(b_2, b_2, c \cdot \left(-a\right)\right)\right)}^{0.25}, {\left(\mathsf{fma}\left(b_2, b_2, c \cdot \left(-a\right)\right)\right)}^{0.25}, -b_2\right)}}{a} \]
  6. Taylor expanded in b_2 around inf 11.4%

    \[\leadsto \frac{\color{blue}{-1 \cdot b_2 + b_2}}{a} \]
  7. Step-by-step derivation
    1. distribute-lft1-in11.4%

      \[\leadsto \frac{\color{blue}{\left(-1 + 1\right) \cdot b_2}}{a} \]
    2. metadata-eval11.4%

      \[\leadsto \frac{\color{blue}{0} \cdot b_2}{a} \]
    3. mul0-lft11.4%

      \[\leadsto \frac{\color{blue}{0}}{a} \]
  8. Simplified11.4%

    \[\leadsto \frac{\color{blue}{0}}{a} \]
  9. Final simplification11.4%

    \[\leadsto \frac{0}{a} \]

Reproduce

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