The quadratic formula (r1)

Percentage Accurate: 52.0% → 84.9%
Time: 13.1s
Alternatives: 10
Speedup: 19.1×

Specification

?
\[\begin{array}{l} \\ \frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a} \end{array} \]
(FPCore (a b c)
 :precision binary64
 (/ (+ (- b) (sqrt (- (* b b) (* (* 4.0 a) c)))) (* 2.0 a)))
double code(double a, double b, double c) {
	return (-b + sqrt(((b * b) - ((4.0 * a) * c)))) / (2.0 * a);
}
real(8) function code(a, b, c)
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    code = (-b + sqrt(((b * b) - ((4.0d0 * a) * c)))) / (2.0d0 * a)
end function
public static double code(double a, double b, double c) {
	return (-b + Math.sqrt(((b * b) - ((4.0 * a) * c)))) / (2.0 * a);
}
def code(a, b, c):
	return (-b + math.sqrt(((b * b) - ((4.0 * a) * c)))) / (2.0 * a)
function code(a, b, c)
	return Float64(Float64(Float64(-b) + sqrt(Float64(Float64(b * b) - Float64(Float64(4.0 * a) * c)))) / Float64(2.0 * a))
end
function tmp = code(a, b, c)
	tmp = (-b + sqrt(((b * b) - ((4.0 * a) * c)))) / (2.0 * a);
end
code[a_, b_, c_] := N[(N[((-b) + N[Sqrt[N[(N[(b * b), $MachinePrecision] - N[(N[(4.0 * a), $MachinePrecision] * c), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[(2.0 * a), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot 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 10 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.0% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a} \end{array} \]
(FPCore (a b c)
 :precision binary64
 (/ (+ (- b) (sqrt (- (* b b) (* (* 4.0 a) c)))) (* 2.0 a)))
double code(double a, double b, double c) {
	return (-b + sqrt(((b * b) - ((4.0 * a) * c)))) / (2.0 * a);
}
real(8) function code(a, b, c)
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    code = (-b + sqrt(((b * b) - ((4.0d0 * a) * c)))) / (2.0d0 * a)
end function
public static double code(double a, double b, double c) {
	return (-b + Math.sqrt(((b * b) - ((4.0 * a) * c)))) / (2.0 * a);
}
def code(a, b, c):
	return (-b + math.sqrt(((b * b) - ((4.0 * a) * c)))) / (2.0 * a)
function code(a, b, c)
	return Float64(Float64(Float64(-b) + sqrt(Float64(Float64(b * b) - Float64(Float64(4.0 * a) * c)))) / Float64(2.0 * a))
end
function tmp = code(a, b, c)
	tmp = (-b + sqrt(((b * b) - ((4.0 * a) * c)))) / (2.0 * a);
end
code[a_, b_, c_] := N[(N[((-b) + N[Sqrt[N[(N[(b * b), $MachinePrecision] - N[(N[(4.0 * a), $MachinePrecision] * c), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[(2.0 * a), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

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

Alternative 1: 84.9% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq -4 \cdot 10^{+117}:\\ \;\;\;\;\frac{c}{b} - \frac{b}{a}\\ \mathbf{elif}\;b \leq 5 \cdot 10^{-95} \lor \neg \left(b \leq 2.35 \cdot 10^{-80}\right) \land b \leq 0.135:\\ \;\;\;\;\frac{\sqrt{b \cdot b - c \cdot \left(a \cdot 4\right)} - b}{a \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;\frac{-c}{b}\\ \end{array} \end{array} \]
(FPCore (a b c)
 :precision binary64
 (if (<= b -4e+117)
   (- (/ c b) (/ b a))
   (if (or (<= b 5e-95) (and (not (<= b 2.35e-80)) (<= b 0.135)))
     (/ (- (sqrt (- (* b b) (* c (* a 4.0)))) b) (* a 2.0))
     (/ (- c) b))))
double code(double a, double b, double c) {
	double tmp;
	if (b <= -4e+117) {
		tmp = (c / b) - (b / a);
	} else if ((b <= 5e-95) || (!(b <= 2.35e-80) && (b <= 0.135))) {
		tmp = (sqrt(((b * b) - (c * (a * 4.0)))) - b) / (a * 2.0);
	} else {
		tmp = -c / b;
	}
	return tmp;
}
real(8) function code(a, b, c)
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8) :: tmp
    if (b <= (-4d+117)) then
        tmp = (c / b) - (b / a)
    else if ((b <= 5d-95) .or. (.not. (b <= 2.35d-80)) .and. (b <= 0.135d0)) then
        tmp = (sqrt(((b * b) - (c * (a * 4.0d0)))) - b) / (a * 2.0d0)
    else
        tmp = -c / b
    end if
    code = tmp
end function
public static double code(double a, double b, double c) {
	double tmp;
	if (b <= -4e+117) {
		tmp = (c / b) - (b / a);
	} else if ((b <= 5e-95) || (!(b <= 2.35e-80) && (b <= 0.135))) {
		tmp = (Math.sqrt(((b * b) - (c * (a * 4.0)))) - b) / (a * 2.0);
	} else {
		tmp = -c / b;
	}
	return tmp;
}
def code(a, b, c):
	tmp = 0
	if b <= -4e+117:
		tmp = (c / b) - (b / a)
	elif (b <= 5e-95) or (not (b <= 2.35e-80) and (b <= 0.135)):
		tmp = (math.sqrt(((b * b) - (c * (a * 4.0)))) - b) / (a * 2.0)
	else:
		tmp = -c / b
	return tmp
function code(a, b, c)
	tmp = 0.0
	if (b <= -4e+117)
		tmp = Float64(Float64(c / b) - Float64(b / a));
	elseif ((b <= 5e-95) || (!(b <= 2.35e-80) && (b <= 0.135)))
		tmp = Float64(Float64(sqrt(Float64(Float64(b * b) - Float64(c * Float64(a * 4.0)))) - b) / Float64(a * 2.0));
	else
		tmp = Float64(Float64(-c) / b);
	end
	return tmp
end
function tmp_2 = code(a, b, c)
	tmp = 0.0;
	if (b <= -4e+117)
		tmp = (c / b) - (b / a);
	elseif ((b <= 5e-95) || (~((b <= 2.35e-80)) && (b <= 0.135)))
		tmp = (sqrt(((b * b) - (c * (a * 4.0)))) - b) / (a * 2.0);
	else
		tmp = -c / b;
	end
	tmp_2 = tmp;
end
code[a_, b_, c_] := If[LessEqual[b, -4e+117], N[(N[(c / b), $MachinePrecision] - N[(b / a), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[b, 5e-95], And[N[Not[LessEqual[b, 2.35e-80]], $MachinePrecision], LessEqual[b, 0.135]]], N[(N[(N[Sqrt[N[(N[(b * b), $MachinePrecision] - N[(c * N[(a * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision] / N[(a * 2.0), $MachinePrecision]), $MachinePrecision], N[((-c) / b), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;b \leq -4 \cdot 10^{+117}:\\
\;\;\;\;\frac{c}{b} - \frac{b}{a}\\

\mathbf{elif}\;b \leq 5 \cdot 10^{-95} \lor \neg \left(b \leq 2.35 \cdot 10^{-80}\right) \land b \leq 0.135:\\
\;\;\;\;\frac{\sqrt{b \cdot b - c \cdot \left(a \cdot 4\right)} - b}{a \cdot 2}\\

\mathbf{else}:\\
\;\;\;\;\frac{-c}{b}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if b < -4.0000000000000002e117

    1. Initial program 47.7%

      \[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a} \]
    2. Taylor expanded in b around -inf 96.8%

      \[\leadsto \color{blue}{-1 \cdot \frac{b}{a} + \frac{c}{b}} \]
    3. Step-by-step derivation
      1. +-commutative96.8%

        \[\leadsto \color{blue}{\frac{c}{b} + -1 \cdot \frac{b}{a}} \]
      2. mul-1-neg96.8%

        \[\leadsto \frac{c}{b} + \color{blue}{\left(-\frac{b}{a}\right)} \]
      3. unsub-neg96.8%

        \[\leadsto \color{blue}{\frac{c}{b} - \frac{b}{a}} \]
    4. Simplified96.8%

      \[\leadsto \color{blue}{\frac{c}{b} - \frac{b}{a}} \]

    if -4.0000000000000002e117 < b < 4.9999999999999998e-95 or 2.34999999999999986e-80 < b < 0.13500000000000001

    1. Initial program 83.0%

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

    if 4.9999999999999998e-95 < b < 2.34999999999999986e-80 or 0.13500000000000001 < b

    1. Initial program 16.5%

      \[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a} \]
    2. Taylor expanded in b around inf 83.2%

      \[\leadsto \color{blue}{-1 \cdot \frac{c}{b}} \]
    3. Step-by-step derivation
      1. associate-*r/83.2%

        \[\leadsto \color{blue}{\frac{-1 \cdot c}{b}} \]
      2. neg-mul-183.2%

        \[\leadsto \frac{\color{blue}{-c}}{b} \]
    4. Simplified83.2%

      \[\leadsto \color{blue}{\frac{-c}{b}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification86.2%

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -4 \cdot 10^{+117}:\\ \;\;\;\;\frac{c}{b} - \frac{b}{a}\\ \mathbf{elif}\;b \leq 5 \cdot 10^{-95} \lor \neg \left(b \leq 2.35 \cdot 10^{-80}\right) \land b \leq 0.135:\\ \;\;\;\;\frac{\sqrt{b \cdot b - c \cdot \left(a \cdot 4\right)} - b}{a \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;\frac{-c}{b}\\ \end{array} \]

Alternative 2: 81.4% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq -1.25 \cdot 10^{-75}:\\ \;\;\;\;\frac{c}{b} - \frac{b}{a}\\ \mathbf{elif}\;b \leq 8 \cdot 10^{-95}:\\ \;\;\;\;\frac{{\left(\frac{c \cdot 4}{\frac{-1}{a}}\right)}^{0.5} - b}{a \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;\frac{-c}{b}\\ \end{array} \end{array} \]
(FPCore (a b c)
 :precision binary64
 (if (<= b -1.25e-75)
   (- (/ c b) (/ b a))
   (if (<= b 8e-95)
     (/ (- (pow (/ (* c 4.0) (/ -1.0 a)) 0.5) b) (* a 2.0))
     (/ (- c) b))))
double code(double a, double b, double c) {
	double tmp;
	if (b <= -1.25e-75) {
		tmp = (c / b) - (b / a);
	} else if (b <= 8e-95) {
		tmp = (pow(((c * 4.0) / (-1.0 / a)), 0.5) - b) / (a * 2.0);
	} else {
		tmp = -c / b;
	}
	return tmp;
}
real(8) function code(a, b, c)
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8) :: tmp
    if (b <= (-1.25d-75)) then
        tmp = (c / b) - (b / a)
    else if (b <= 8d-95) then
        tmp = ((((c * 4.0d0) / ((-1.0d0) / a)) ** 0.5d0) - b) / (a * 2.0d0)
    else
        tmp = -c / b
    end if
    code = tmp
end function
public static double code(double a, double b, double c) {
	double tmp;
	if (b <= -1.25e-75) {
		tmp = (c / b) - (b / a);
	} else if (b <= 8e-95) {
		tmp = (Math.pow(((c * 4.0) / (-1.0 / a)), 0.5) - b) / (a * 2.0);
	} else {
		tmp = -c / b;
	}
	return tmp;
}
def code(a, b, c):
	tmp = 0
	if b <= -1.25e-75:
		tmp = (c / b) - (b / a)
	elif b <= 8e-95:
		tmp = (math.pow(((c * 4.0) / (-1.0 / a)), 0.5) - b) / (a * 2.0)
	else:
		tmp = -c / b
	return tmp
function code(a, b, c)
	tmp = 0.0
	if (b <= -1.25e-75)
		tmp = Float64(Float64(c / b) - Float64(b / a));
	elseif (b <= 8e-95)
		tmp = Float64(Float64((Float64(Float64(c * 4.0) / Float64(-1.0 / a)) ^ 0.5) - b) / Float64(a * 2.0));
	else
		tmp = Float64(Float64(-c) / b);
	end
	return tmp
end
function tmp_2 = code(a, b, c)
	tmp = 0.0;
	if (b <= -1.25e-75)
		tmp = (c / b) - (b / a);
	elseif (b <= 8e-95)
		tmp = ((((c * 4.0) / (-1.0 / a)) ^ 0.5) - b) / (a * 2.0);
	else
		tmp = -c / b;
	end
	tmp_2 = tmp;
end
code[a_, b_, c_] := If[LessEqual[b, -1.25e-75], N[(N[(c / b), $MachinePrecision] - N[(b / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 8e-95], N[(N[(N[Power[N[(N[(c * 4.0), $MachinePrecision] / N[(-1.0 / a), $MachinePrecision]), $MachinePrecision], 0.5], $MachinePrecision] - b), $MachinePrecision] / N[(a * 2.0), $MachinePrecision]), $MachinePrecision], N[((-c) / b), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;b \leq -1.25 \cdot 10^{-75}:\\
\;\;\;\;\frac{c}{b} - \frac{b}{a}\\

\mathbf{elif}\;b \leq 8 \cdot 10^{-95}:\\
\;\;\;\;\frac{{\left(\frac{c \cdot 4}{\frac{-1}{a}}\right)}^{0.5} - b}{a \cdot 2}\\

\mathbf{else}:\\
\;\;\;\;\frac{-c}{b}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if b < -1.24999999999999995e-75

    1. Initial program 68.0%

      \[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a} \]
    2. Taylor expanded in b around -inf 93.4%

      \[\leadsto \color{blue}{-1 \cdot \frac{b}{a} + \frac{c}{b}} \]
    3. Step-by-step derivation
      1. +-commutative93.4%

        \[\leadsto \color{blue}{\frac{c}{b} + -1 \cdot \frac{b}{a}} \]
      2. mul-1-neg93.4%

        \[\leadsto \frac{c}{b} + \color{blue}{\left(-\frac{b}{a}\right)} \]
      3. unsub-neg93.4%

        \[\leadsto \color{blue}{\frac{c}{b} - \frac{b}{a}} \]
    4. Simplified93.4%

      \[\leadsto \color{blue}{\frac{c}{b} - \frac{b}{a}} \]

    if -1.24999999999999995e-75 < b < 7.99999999999999992e-95

    1. Initial program 80.2%

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

        \[\leadsto \frac{\left(-b\right) + \color{blue}{{\left(b \cdot b - \left(4 \cdot a\right) \cdot c\right)}^{0.5}}}{2 \cdot a} \]
      2. pow-to-exp74.8%

        \[\leadsto \frac{\left(-b\right) + \color{blue}{e^{\log \left(b \cdot b - \left(4 \cdot a\right) \cdot c\right) \cdot 0.5}}}{2 \cdot a} \]
      3. fma-neg74.8%

        \[\leadsto \frac{\left(-b\right) + e^{\log \color{blue}{\left(\mathsf{fma}\left(b, b, -\left(4 \cdot a\right) \cdot c\right)\right)} \cdot 0.5}}{2 \cdot a} \]
      4. *-commutative74.8%

        \[\leadsto \frac{\left(-b\right) + e^{\log \left(\mathsf{fma}\left(b, b, -\color{blue}{c \cdot \left(4 \cdot a\right)}\right)\right) \cdot 0.5}}{2 \cdot a} \]
      5. distribute-rgt-neg-in74.8%

        \[\leadsto \frac{\left(-b\right) + e^{\log \left(\mathsf{fma}\left(b, b, \color{blue}{c \cdot \left(-4 \cdot a\right)}\right)\right) \cdot 0.5}}{2 \cdot a} \]
      6. *-commutative74.8%

        \[\leadsto \frac{\left(-b\right) + e^{\log \left(\mathsf{fma}\left(b, b, c \cdot \left(-\color{blue}{a \cdot 4}\right)\right)\right) \cdot 0.5}}{2 \cdot a} \]
      7. distribute-rgt-neg-in74.8%

        \[\leadsto \frac{\left(-b\right) + e^{\log \left(\mathsf{fma}\left(b, b, c \cdot \color{blue}{\left(a \cdot \left(-4\right)\right)}\right)\right) \cdot 0.5}}{2 \cdot a} \]
      8. metadata-eval74.8%

        \[\leadsto \frac{\left(-b\right) + e^{\log \left(\mathsf{fma}\left(b, b, c \cdot \left(a \cdot \color{blue}{-4}\right)\right)\right) \cdot 0.5}}{2 \cdot a} \]
    3. Applied egg-rr74.8%

      \[\leadsto \frac{\left(-b\right) + \color{blue}{e^{\log \left(\mathsf{fma}\left(b, b, c \cdot \left(a \cdot -4\right)\right)\right) \cdot 0.5}}}{2 \cdot a} \]
    4. Taylor expanded in a around -inf 46.5%

      \[\leadsto \frac{\left(-b\right) + e^{\color{blue}{\left(\log \left(4 \cdot c\right) + -1 \cdot \log \left(\frac{-1}{a}\right)\right)} \cdot 0.5}}{2 \cdot a} \]
    5. Step-by-step derivation
      1. mul-1-neg46.5%

        \[\leadsto \frac{\left(-b\right) + e^{\left(\log \left(4 \cdot c\right) + \color{blue}{\left(-\log \left(\frac{-1}{a}\right)\right)}\right) \cdot 0.5}}{2 \cdot a} \]
      2. unsub-neg46.5%

        \[\leadsto \frac{\left(-b\right) + e^{\color{blue}{\left(\log \left(4 \cdot c\right) - \log \left(\frac{-1}{a}\right)\right)} \cdot 0.5}}{2 \cdot a} \]
      3. *-commutative46.5%

        \[\leadsto \frac{\left(-b\right) + e^{\left(\log \color{blue}{\left(c \cdot 4\right)} - \log \left(\frac{-1}{a}\right)\right) \cdot 0.5}}{2 \cdot a} \]
    6. Simplified46.5%

      \[\leadsto \frac{\left(-b\right) + e^{\color{blue}{\left(\log \left(c \cdot 4\right) - \log \left(\frac{-1}{a}\right)\right)} \cdot 0.5}}{2 \cdot a} \]
    7. Step-by-step derivation
      1. exp-prod39.6%

        \[\leadsto \frac{\left(-b\right) + \color{blue}{{\left(e^{\log \left(c \cdot 4\right) - \log \left(\frac{-1}{a}\right)}\right)}^{0.5}}}{2 \cdot a} \]
      2. diff-log67.2%

        \[\leadsto \frac{\left(-b\right) + {\left(e^{\color{blue}{\log \left(\frac{c \cdot 4}{\frac{-1}{a}}\right)}}\right)}^{0.5}}{2 \cdot a} \]
      3. add-exp-log71.8%

        \[\leadsto \frac{\left(-b\right) + {\color{blue}{\left(\frac{c \cdot 4}{\frac{-1}{a}}\right)}}^{0.5}}{2 \cdot a} \]
    8. Applied egg-rr71.8%

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

    if 7.99999999999999992e-95 < b

    1. Initial program 23.4%

      \[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a} \]
    2. Taylor expanded in b around inf 74.3%

      \[\leadsto \color{blue}{-1 \cdot \frac{c}{b}} \]
    3. Step-by-step derivation
      1. associate-*r/74.3%

        \[\leadsto \color{blue}{\frac{-1 \cdot c}{b}} \]
      2. neg-mul-174.3%

        \[\leadsto \frac{\color{blue}{-c}}{b} \]
    4. Simplified74.3%

      \[\leadsto \color{blue}{\frac{-c}{b}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification81.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -1.25 \cdot 10^{-75}:\\ \;\;\;\;\frac{c}{b} - \frac{b}{a}\\ \mathbf{elif}\;b \leq 8 \cdot 10^{-95}:\\ \;\;\;\;\frac{{\left(\frac{c \cdot 4}{\frac{-1}{a}}\right)}^{0.5} - b}{a \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;\frac{-c}{b}\\ \end{array} \]

Alternative 3: 81.3% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq -1.1 \cdot 10^{-69}:\\
\;\;\;\;\frac{c}{b} - \frac{b}{a}\\

\mathbf{elif}\;b \leq 2.2 \cdot 10^{-94}:\\
\;\;\;\;\left(\sqrt{c \cdot \frac{a}{-0.25}} - b\right) \cdot \frac{0.5}{a}\\

\mathbf{else}:\\
\;\;\;\;\frac{-c}{b}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if b < -1.1e-69

    1. Initial program 68.0%

      \[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a} \]
    2. Taylor expanded in b around -inf 93.4%

      \[\leadsto \color{blue}{-1 \cdot \frac{b}{a} + \frac{c}{b}} \]
    3. Step-by-step derivation
      1. +-commutative93.4%

        \[\leadsto \color{blue}{\frac{c}{b} + -1 \cdot \frac{b}{a}} \]
      2. mul-1-neg93.4%

        \[\leadsto \frac{c}{b} + \color{blue}{\left(-\frac{b}{a}\right)} \]
      3. unsub-neg93.4%

        \[\leadsto \color{blue}{\frac{c}{b} - \frac{b}{a}} \]
    4. Simplified93.4%

      \[\leadsto \color{blue}{\frac{c}{b} - \frac{b}{a}} \]

    if -1.1e-69 < b < 2.20000000000000001e-94

    1. Initial program 80.2%

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

        \[\leadsto \frac{\left(-b\right) + \color{blue}{{\left(b \cdot b - \left(4 \cdot a\right) \cdot c\right)}^{0.5}}}{2 \cdot a} \]
      2. pow-to-exp74.8%

        \[\leadsto \frac{\left(-b\right) + \color{blue}{e^{\log \left(b \cdot b - \left(4 \cdot a\right) \cdot c\right) \cdot 0.5}}}{2 \cdot a} \]
      3. fma-neg74.8%

        \[\leadsto \frac{\left(-b\right) + e^{\log \color{blue}{\left(\mathsf{fma}\left(b, b, -\left(4 \cdot a\right) \cdot c\right)\right)} \cdot 0.5}}{2 \cdot a} \]
      4. *-commutative74.8%

        \[\leadsto \frac{\left(-b\right) + e^{\log \left(\mathsf{fma}\left(b, b, -\color{blue}{c \cdot \left(4 \cdot a\right)}\right)\right) \cdot 0.5}}{2 \cdot a} \]
      5. distribute-rgt-neg-in74.8%

        \[\leadsto \frac{\left(-b\right) + e^{\log \left(\mathsf{fma}\left(b, b, \color{blue}{c \cdot \left(-4 \cdot a\right)}\right)\right) \cdot 0.5}}{2 \cdot a} \]
      6. *-commutative74.8%

        \[\leadsto \frac{\left(-b\right) + e^{\log \left(\mathsf{fma}\left(b, b, c \cdot \left(-\color{blue}{a \cdot 4}\right)\right)\right) \cdot 0.5}}{2 \cdot a} \]
      7. distribute-rgt-neg-in74.8%

        \[\leadsto \frac{\left(-b\right) + e^{\log \left(\mathsf{fma}\left(b, b, c \cdot \color{blue}{\left(a \cdot \left(-4\right)\right)}\right)\right) \cdot 0.5}}{2 \cdot a} \]
      8. metadata-eval74.8%

        \[\leadsto \frac{\left(-b\right) + e^{\log \left(\mathsf{fma}\left(b, b, c \cdot \left(a \cdot \color{blue}{-4}\right)\right)\right) \cdot 0.5}}{2 \cdot a} \]
    3. Applied egg-rr74.8%

      \[\leadsto \frac{\left(-b\right) + \color{blue}{e^{\log \left(\mathsf{fma}\left(b, b, c \cdot \left(a \cdot -4\right)\right)\right) \cdot 0.5}}}{2 \cdot a} \]
    4. Taylor expanded in c around -inf 33.5%

      \[\leadsto \frac{\left(-b\right) + e^{\color{blue}{\left(\log \left(4 \cdot a\right) + -1 \cdot \log \left(\frac{-1}{c}\right)\right)} \cdot 0.5}}{2 \cdot a} \]
    5. Step-by-step derivation
      1. mul-1-neg33.5%

        \[\leadsto \frac{\left(-b\right) + e^{\left(\log \left(4 \cdot a\right) + \color{blue}{\left(-\log \left(\frac{-1}{c}\right)\right)}\right) \cdot 0.5}}{2 \cdot a} \]
      2. unsub-neg33.5%

        \[\leadsto \frac{\left(-b\right) + e^{\color{blue}{\left(\log \left(4 \cdot a\right) - \log \left(\frac{-1}{c}\right)\right)} \cdot 0.5}}{2 \cdot a} \]
      3. *-commutative33.5%

        \[\leadsto \frac{\left(-b\right) + e^{\left(\log \color{blue}{\left(a \cdot 4\right)} - \log \left(\frac{-1}{c}\right)\right) \cdot 0.5}}{2 \cdot a} \]
    6. Simplified33.5%

      \[\leadsto \frac{\left(-b\right) + e^{\color{blue}{\left(\log \left(a \cdot 4\right) - \log \left(\frac{-1}{c}\right)\right)} \cdot 0.5}}{2 \cdot a} \]
    7. Taylor expanded in a around 0 33.5%

      \[\leadsto \color{blue}{0.5 \cdot \frac{e^{0.5 \cdot \left(\left(\log 4 + \log a\right) - \log \left(\frac{-1}{c}\right)\right)} - b}{a}} \]
    8. Simplified71.7%

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

    if 2.20000000000000001e-94 < b

    1. Initial program 23.4%

      \[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a} \]
    2. Taylor expanded in b around inf 74.3%

      \[\leadsto \color{blue}{-1 \cdot \frac{c}{b}} \]
    3. Step-by-step derivation
      1. associate-*r/74.3%

        \[\leadsto \color{blue}{\frac{-1 \cdot c}{b}} \]
      2. neg-mul-174.3%

        \[\leadsto \frac{\color{blue}{-c}}{b} \]
    4. Simplified74.3%

      \[\leadsto \color{blue}{\frac{-c}{b}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification81.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -1.1 \cdot 10^{-69}:\\ \;\;\;\;\frac{c}{b} - \frac{b}{a}\\ \mathbf{elif}\;b \leq 2.2 \cdot 10^{-94}:\\ \;\;\;\;\left(\sqrt{c \cdot \frac{a}{-0.25}} - b\right) \cdot \frac{0.5}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{-c}{b}\\ \end{array} \]

Alternative 4: 81.3% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq -4.5 \cdot 10^{-69}:\\
\;\;\;\;\frac{c}{b} - \frac{b}{a}\\

\mathbf{elif}\;b \leq 3.9 \cdot 10^{-95}:\\
\;\;\;\;\frac{\sqrt{c \cdot \frac{a}{-0.25}} - b}{a \cdot 2}\\

\mathbf{else}:\\
\;\;\;\;\frac{-c}{b}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if b < -4.50000000000000009e-69

    1. Initial program 68.0%

      \[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a} \]
    2. Taylor expanded in b around -inf 93.4%

      \[\leadsto \color{blue}{-1 \cdot \frac{b}{a} + \frac{c}{b}} \]
    3. Step-by-step derivation
      1. +-commutative93.4%

        \[\leadsto \color{blue}{\frac{c}{b} + -1 \cdot \frac{b}{a}} \]
      2. mul-1-neg93.4%

        \[\leadsto \frac{c}{b} + \color{blue}{\left(-\frac{b}{a}\right)} \]
      3. unsub-neg93.4%

        \[\leadsto \color{blue}{\frac{c}{b} - \frac{b}{a}} \]
    4. Simplified93.4%

      \[\leadsto \color{blue}{\frac{c}{b} - \frac{b}{a}} \]

    if -4.50000000000000009e-69 < b < 3.9e-95

    1. Initial program 80.2%

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

        \[\leadsto \frac{\left(-b\right) + \color{blue}{{\left(b \cdot b - \left(4 \cdot a\right) \cdot c\right)}^{0.5}}}{2 \cdot a} \]
      2. pow-to-exp74.8%

        \[\leadsto \frac{\left(-b\right) + \color{blue}{e^{\log \left(b \cdot b - \left(4 \cdot a\right) \cdot c\right) \cdot 0.5}}}{2 \cdot a} \]
      3. fma-neg74.8%

        \[\leadsto \frac{\left(-b\right) + e^{\log \color{blue}{\left(\mathsf{fma}\left(b, b, -\left(4 \cdot a\right) \cdot c\right)\right)} \cdot 0.5}}{2 \cdot a} \]
      4. *-commutative74.8%

        \[\leadsto \frac{\left(-b\right) + e^{\log \left(\mathsf{fma}\left(b, b, -\color{blue}{c \cdot \left(4 \cdot a\right)}\right)\right) \cdot 0.5}}{2 \cdot a} \]
      5. distribute-rgt-neg-in74.8%

        \[\leadsto \frac{\left(-b\right) + e^{\log \left(\mathsf{fma}\left(b, b, \color{blue}{c \cdot \left(-4 \cdot a\right)}\right)\right) \cdot 0.5}}{2 \cdot a} \]
      6. *-commutative74.8%

        \[\leadsto \frac{\left(-b\right) + e^{\log \left(\mathsf{fma}\left(b, b, c \cdot \left(-\color{blue}{a \cdot 4}\right)\right)\right) \cdot 0.5}}{2 \cdot a} \]
      7. distribute-rgt-neg-in74.8%

        \[\leadsto \frac{\left(-b\right) + e^{\log \left(\mathsf{fma}\left(b, b, c \cdot \color{blue}{\left(a \cdot \left(-4\right)\right)}\right)\right) \cdot 0.5}}{2 \cdot a} \]
      8. metadata-eval74.8%

        \[\leadsto \frac{\left(-b\right) + e^{\log \left(\mathsf{fma}\left(b, b, c \cdot \left(a \cdot \color{blue}{-4}\right)\right)\right) \cdot 0.5}}{2 \cdot a} \]
    3. Applied egg-rr74.8%

      \[\leadsto \frac{\left(-b\right) + \color{blue}{e^{\log \left(\mathsf{fma}\left(b, b, c \cdot \left(a \cdot -4\right)\right)\right) \cdot 0.5}}}{2 \cdot a} \]
    4. Taylor expanded in c around -inf 33.5%

      \[\leadsto \frac{\left(-b\right) + e^{\color{blue}{\left(\log \left(4 \cdot a\right) + -1 \cdot \log \left(\frac{-1}{c}\right)\right)} \cdot 0.5}}{2 \cdot a} \]
    5. Step-by-step derivation
      1. mul-1-neg33.5%

        \[\leadsto \frac{\left(-b\right) + e^{\left(\log \left(4 \cdot a\right) + \color{blue}{\left(-\log \left(\frac{-1}{c}\right)\right)}\right) \cdot 0.5}}{2 \cdot a} \]
      2. unsub-neg33.5%

        \[\leadsto \frac{\left(-b\right) + e^{\color{blue}{\left(\log \left(4 \cdot a\right) - \log \left(\frac{-1}{c}\right)\right)} \cdot 0.5}}{2 \cdot a} \]
      3. *-commutative33.5%

        \[\leadsto \frac{\left(-b\right) + e^{\left(\log \color{blue}{\left(a \cdot 4\right)} - \log \left(\frac{-1}{c}\right)\right) \cdot 0.5}}{2 \cdot a} \]
    6. Simplified33.5%

      \[\leadsto \frac{\left(-b\right) + e^{\color{blue}{\left(\log \left(a \cdot 4\right) - \log \left(\frac{-1}{c}\right)\right)} \cdot 0.5}}{2 \cdot a} \]
    7. Taylor expanded in b around 0 33.5%

      \[\leadsto \frac{\color{blue}{e^{0.5 \cdot \left(\log \left(4 \cdot a\right) - \log \left(\frac{-1}{c}\right)\right)} + -1 \cdot b}}{2 \cdot a} \]
    8. Step-by-step derivation
      1. neg-mul-133.5%

        \[\leadsto \frac{e^{0.5 \cdot \left(\log \left(4 \cdot a\right) - \log \left(\frac{-1}{c}\right)\right)} + \color{blue}{\left(-b\right)}}{2 \cdot a} \]
      2. sub-neg33.5%

        \[\leadsto \frac{\color{blue}{e^{0.5 \cdot \left(\log \left(4 \cdot a\right) - \log \left(\frac{-1}{c}\right)\right)} - b}}{2 \cdot a} \]
      3. *-commutative33.5%

        \[\leadsto \frac{e^{\color{blue}{\left(\log \left(4 \cdot a\right) - \log \left(\frac{-1}{c}\right)\right) \cdot 0.5}} - b}{2 \cdot a} \]
      4. log-prod33.5%

        \[\leadsto \frac{e^{\left(\color{blue}{\left(\log 4 + \log a\right)} - \log \left(\frac{-1}{c}\right)\right) \cdot 0.5} - b}{2 \cdot a} \]
      5. +-commutative33.5%

        \[\leadsto \frac{e^{\left(\color{blue}{\left(\log a + \log 4\right)} - \log \left(\frac{-1}{c}\right)\right) \cdot 0.5} - b}{2 \cdot a} \]
      6. log-prod33.5%

        \[\leadsto \frac{e^{\left(\color{blue}{\log \left(a \cdot 4\right)} - \log \left(\frac{-1}{c}\right)\right) \cdot 0.5} - b}{2 \cdot a} \]
      7. log-div67.2%

        \[\leadsto \frac{e^{\color{blue}{\log \left(\frac{a \cdot 4}{\frac{-1}{c}}\right)} \cdot 0.5} - b}{2 \cdot a} \]
      8. exp-to-pow71.8%

        \[\leadsto \frac{\color{blue}{{\left(\frac{a \cdot 4}{\frac{-1}{c}}\right)}^{0.5}} - b}{2 \cdot a} \]
      9. unpow1/271.8%

        \[\leadsto \frac{\color{blue}{\sqrt{\frac{a \cdot 4}{\frac{-1}{c}}}} - b}{2 \cdot a} \]
      10. associate-/r/71.8%

        \[\leadsto \frac{\sqrt{\color{blue}{\frac{a \cdot 4}{-1} \cdot c}} - b}{2 \cdot a} \]
      11. *-commutative71.8%

        \[\leadsto \frac{\sqrt{\color{blue}{c \cdot \frac{a \cdot 4}{-1}}} - b}{2 \cdot a} \]
      12. associate-/l*71.8%

        \[\leadsto \frac{\sqrt{c \cdot \color{blue}{\frac{a}{\frac{-1}{4}}}} - b}{2 \cdot a} \]
      13. metadata-eval71.8%

        \[\leadsto \frac{\sqrt{c \cdot \frac{a}{\color{blue}{-0.25}}} - b}{2 \cdot a} \]
    9. Simplified71.8%

      \[\leadsto \frac{\color{blue}{\sqrt{c \cdot \frac{a}{-0.25}} - b}}{2 \cdot a} \]

    if 3.9e-95 < b

    1. Initial program 23.4%

      \[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a} \]
    2. Taylor expanded in b around inf 74.3%

      \[\leadsto \color{blue}{-1 \cdot \frac{c}{b}} \]
    3. Step-by-step derivation
      1. associate-*r/74.3%

        \[\leadsto \color{blue}{\frac{-1 \cdot c}{b}} \]
      2. neg-mul-174.3%

        \[\leadsto \frac{\color{blue}{-c}}{b} \]
    4. Simplified74.3%

      \[\leadsto \color{blue}{\frac{-c}{b}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification81.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -4.5 \cdot 10^{-69}:\\ \;\;\;\;\frac{c}{b} - \frac{b}{a}\\ \mathbf{elif}\;b \leq 3.9 \cdot 10^{-95}:\\ \;\;\;\;\frac{\sqrt{c \cdot \frac{a}{-0.25}} - b}{a \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;\frac{-c}{b}\\ \end{array} \]

Alternative 5: 80.9% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq -7.6 \cdot 10^{-95}:\\
\;\;\;\;\frac{c}{b} - \frac{b}{a}\\

\mathbf{elif}\;b \leq 2.15 \cdot 10^{-94}:\\
\;\;\;\;\frac{0.5}{a} \cdot \sqrt{a \cdot \frac{c}{-0.25}}\\

\mathbf{else}:\\
\;\;\;\;\frac{-c}{b}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if b < -7.5999999999999995e-95

    1. Initial program 69.3%

      \[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a} \]
    2. Taylor expanded in b around -inf 91.8%

      \[\leadsto \color{blue}{-1 \cdot \frac{b}{a} + \frac{c}{b}} \]
    3. Step-by-step derivation
      1. +-commutative91.8%

        \[\leadsto \color{blue}{\frac{c}{b} + -1 \cdot \frac{b}{a}} \]
      2. mul-1-neg91.8%

        \[\leadsto \frac{c}{b} + \color{blue}{\left(-\frac{b}{a}\right)} \]
      3. unsub-neg91.8%

        \[\leadsto \color{blue}{\frac{c}{b} - \frac{b}{a}} \]
    4. Simplified91.8%

      \[\leadsto \color{blue}{\frac{c}{b} - \frac{b}{a}} \]

    if -7.5999999999999995e-95 < b < 2.1499999999999999e-94

    1. Initial program 78.9%

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

        \[\leadsto \frac{\left(-b\right) + \color{blue}{{\left(b \cdot b - \left(4 \cdot a\right) \cdot c\right)}^{0.5}}}{2 \cdot a} \]
      2. pow-to-exp73.7%

        \[\leadsto \frac{\left(-b\right) + \color{blue}{e^{\log \left(b \cdot b - \left(4 \cdot a\right) \cdot c\right) \cdot 0.5}}}{2 \cdot a} \]
      3. fma-neg73.7%

        \[\leadsto \frac{\left(-b\right) + e^{\log \color{blue}{\left(\mathsf{fma}\left(b, b, -\left(4 \cdot a\right) \cdot c\right)\right)} \cdot 0.5}}{2 \cdot a} \]
      4. *-commutative73.7%

        \[\leadsto \frac{\left(-b\right) + e^{\log \left(\mathsf{fma}\left(b, b, -\color{blue}{c \cdot \left(4 \cdot a\right)}\right)\right) \cdot 0.5}}{2 \cdot a} \]
      5. distribute-rgt-neg-in73.7%

        \[\leadsto \frac{\left(-b\right) + e^{\log \left(\mathsf{fma}\left(b, b, \color{blue}{c \cdot \left(-4 \cdot a\right)}\right)\right) \cdot 0.5}}{2 \cdot a} \]
      6. *-commutative73.7%

        \[\leadsto \frac{\left(-b\right) + e^{\log \left(\mathsf{fma}\left(b, b, c \cdot \left(-\color{blue}{a \cdot 4}\right)\right)\right) \cdot 0.5}}{2 \cdot a} \]
      7. distribute-rgt-neg-in73.7%

        \[\leadsto \frac{\left(-b\right) + e^{\log \left(\mathsf{fma}\left(b, b, c \cdot \color{blue}{\left(a \cdot \left(-4\right)\right)}\right)\right) \cdot 0.5}}{2 \cdot a} \]
      8. metadata-eval73.7%

        \[\leadsto \frac{\left(-b\right) + e^{\log \left(\mathsf{fma}\left(b, b, c \cdot \left(a \cdot \color{blue}{-4}\right)\right)\right) \cdot 0.5}}{2 \cdot a} \]
    3. Applied egg-rr73.7%

      \[\leadsto \frac{\left(-b\right) + \color{blue}{e^{\log \left(\mathsf{fma}\left(b, b, c \cdot \left(a \cdot -4\right)\right)\right) \cdot 0.5}}}{2 \cdot a} \]
    4. Taylor expanded in a around -inf 49.6%

      \[\leadsto \frac{\left(-b\right) + e^{\color{blue}{\left(\log \left(4 \cdot c\right) + -1 \cdot \log \left(\frac{-1}{a}\right)\right)} \cdot 0.5}}{2 \cdot a} \]
    5. Step-by-step derivation
      1. mul-1-neg49.6%

        \[\leadsto \frac{\left(-b\right) + e^{\left(\log \left(4 \cdot c\right) + \color{blue}{\left(-\log \left(\frac{-1}{a}\right)\right)}\right) \cdot 0.5}}{2 \cdot a} \]
      2. unsub-neg49.6%

        \[\leadsto \frac{\left(-b\right) + e^{\color{blue}{\left(\log \left(4 \cdot c\right) - \log \left(\frac{-1}{a}\right)\right)} \cdot 0.5}}{2 \cdot a} \]
      3. *-commutative49.6%

        \[\leadsto \frac{\left(-b\right) + e^{\left(\log \color{blue}{\left(c \cdot 4\right)} - \log \left(\frac{-1}{a}\right)\right) \cdot 0.5}}{2 \cdot a} \]
    6. Simplified49.6%

      \[\leadsto \frac{\left(-b\right) + e^{\color{blue}{\left(\log \left(c \cdot 4\right) - \log \left(\frac{-1}{a}\right)\right)} \cdot 0.5}}{2 \cdot a} \]
    7. Taylor expanded in b around 0 49.8%

      \[\leadsto \color{blue}{0.5 \cdot \frac{e^{0.5 \cdot \left(\log \left(4 \cdot c\right) - \log \left(\frac{-1}{a}\right)\right)}}{a}} \]
    8. Step-by-step derivation
      1. associate-*r/49.8%

        \[\leadsto \color{blue}{\frac{0.5 \cdot e^{0.5 \cdot \left(\log \left(4 \cdot c\right) - \log \left(\frac{-1}{a}\right)\right)}}{a}} \]
      2. *-lft-identity49.8%

        \[\leadsto \frac{0.5 \cdot e^{0.5 \cdot \left(\log \left(4 \cdot c\right) - \log \left(\frac{-1}{a}\right)\right)}}{\color{blue}{1 \cdot a}} \]
      3. *-commutative49.8%

        \[\leadsto \frac{0.5 \cdot e^{\color{blue}{\left(\log \left(4 \cdot c\right) - \log \left(\frac{-1}{a}\right)\right) \cdot 0.5}}}{1 \cdot a} \]
      4. *-commutative49.8%

        \[\leadsto \frac{0.5 \cdot e^{\left(\log \color{blue}{\left(c \cdot 4\right)} - \log \left(\frac{-1}{a}\right)\right) \cdot 0.5}}{1 \cdot a} \]
      5. log-div67.9%

        \[\leadsto \frac{0.5 \cdot e^{\color{blue}{\log \left(\frac{c \cdot 4}{\frac{-1}{a}}\right)} \cdot 0.5}}{1 \cdot a} \]
      6. exp-to-pow72.6%

        \[\leadsto \frac{0.5 \cdot \color{blue}{{\left(\frac{c \cdot 4}{\frac{-1}{a}}\right)}^{0.5}}}{1 \cdot a} \]
      7. *-commutative72.6%

        \[\leadsto \frac{0.5 \cdot {\left(\frac{c \cdot 4}{\frac{-1}{a}}\right)}^{0.5}}{\color{blue}{a \cdot 1}} \]
      8. times-frac72.6%

        \[\leadsto \color{blue}{\frac{0.5}{a} \cdot \frac{{\left(\frac{c \cdot 4}{\frac{-1}{a}}\right)}^{0.5}}{1}} \]
      9. /-rgt-identity72.6%

        \[\leadsto \frac{0.5}{a} \cdot \color{blue}{{\left(\frac{c \cdot 4}{\frac{-1}{a}}\right)}^{0.5}} \]
      10. unpow1/272.6%

        \[\leadsto \frac{0.5}{a} \cdot \color{blue}{\sqrt{\frac{c \cdot 4}{\frac{-1}{a}}}} \]
      11. associate-/r/72.5%

        \[\leadsto \frac{0.5}{a} \cdot \sqrt{\color{blue}{\frac{c \cdot 4}{-1} \cdot a}} \]
      12. *-commutative72.5%

        \[\leadsto \frac{0.5}{a} \cdot \sqrt{\color{blue}{a \cdot \frac{c \cdot 4}{-1}}} \]
      13. associate-/l*72.5%

        \[\leadsto \frac{0.5}{a} \cdot \sqrt{a \cdot \color{blue}{\frac{c}{\frac{-1}{4}}}} \]
      14. metadata-eval72.5%

        \[\leadsto \frac{0.5}{a} \cdot \sqrt{a \cdot \frac{c}{\color{blue}{-0.25}}} \]
    9. Simplified72.5%

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

    if 2.1499999999999999e-94 < b

    1. Initial program 23.4%

      \[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a} \]
    2. Taylor expanded in b around inf 74.3%

      \[\leadsto \color{blue}{-1 \cdot \frac{c}{b}} \]
    3. Step-by-step derivation
      1. associate-*r/74.3%

        \[\leadsto \color{blue}{\frac{-1 \cdot c}{b}} \]
      2. neg-mul-174.3%

        \[\leadsto \frac{\color{blue}{-c}}{b} \]
    4. Simplified74.3%

      \[\leadsto \color{blue}{\frac{-c}{b}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification80.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -7.6 \cdot 10^{-95}:\\ \;\;\;\;\frac{c}{b} - \frac{b}{a}\\ \mathbf{elif}\;b \leq 2.15 \cdot 10^{-94}:\\ \;\;\;\;\frac{0.5}{a} \cdot \sqrt{a \cdot \frac{c}{-0.25}}\\ \mathbf{else}:\\ \;\;\;\;\frac{-c}{b}\\ \end{array} \]

Alternative 6: 80.9% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq -4.3 \cdot 10^{-95}:\\
\;\;\;\;\frac{c}{b} - \frac{b}{a}\\

\mathbf{elif}\;b \leq 2.15 \cdot 10^{-94}:\\
\;\;\;\;\frac{0.5 \cdot \sqrt{c \cdot \frac{a}{-0.25}}}{a}\\

\mathbf{else}:\\
\;\;\;\;\frac{-c}{b}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if b < -4.29999999999999997e-95

    1. Initial program 69.3%

      \[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a} \]
    2. Taylor expanded in b around -inf 91.8%

      \[\leadsto \color{blue}{-1 \cdot \frac{b}{a} + \frac{c}{b}} \]
    3. Step-by-step derivation
      1. +-commutative91.8%

        \[\leadsto \color{blue}{\frac{c}{b} + -1 \cdot \frac{b}{a}} \]
      2. mul-1-neg91.8%

        \[\leadsto \frac{c}{b} + \color{blue}{\left(-\frac{b}{a}\right)} \]
      3. unsub-neg91.8%

        \[\leadsto \color{blue}{\frac{c}{b} - \frac{b}{a}} \]
    4. Simplified91.8%

      \[\leadsto \color{blue}{\frac{c}{b} - \frac{b}{a}} \]

    if -4.29999999999999997e-95 < b < 2.1499999999999999e-94

    1. Initial program 78.9%

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

        \[\leadsto \frac{\left(-b\right) + \color{blue}{{\left(b \cdot b - \left(4 \cdot a\right) \cdot c\right)}^{0.5}}}{2 \cdot a} \]
      2. pow-to-exp73.7%

        \[\leadsto \frac{\left(-b\right) + \color{blue}{e^{\log \left(b \cdot b - \left(4 \cdot a\right) \cdot c\right) \cdot 0.5}}}{2 \cdot a} \]
      3. fma-neg73.7%

        \[\leadsto \frac{\left(-b\right) + e^{\log \color{blue}{\left(\mathsf{fma}\left(b, b, -\left(4 \cdot a\right) \cdot c\right)\right)} \cdot 0.5}}{2 \cdot a} \]
      4. *-commutative73.7%

        \[\leadsto \frac{\left(-b\right) + e^{\log \left(\mathsf{fma}\left(b, b, -\color{blue}{c \cdot \left(4 \cdot a\right)}\right)\right) \cdot 0.5}}{2 \cdot a} \]
      5. distribute-rgt-neg-in73.7%

        \[\leadsto \frac{\left(-b\right) + e^{\log \left(\mathsf{fma}\left(b, b, \color{blue}{c \cdot \left(-4 \cdot a\right)}\right)\right) \cdot 0.5}}{2 \cdot a} \]
      6. *-commutative73.7%

        \[\leadsto \frac{\left(-b\right) + e^{\log \left(\mathsf{fma}\left(b, b, c \cdot \left(-\color{blue}{a \cdot 4}\right)\right)\right) \cdot 0.5}}{2 \cdot a} \]
      7. distribute-rgt-neg-in73.7%

        \[\leadsto \frac{\left(-b\right) + e^{\log \left(\mathsf{fma}\left(b, b, c \cdot \color{blue}{\left(a \cdot \left(-4\right)\right)}\right)\right) \cdot 0.5}}{2 \cdot a} \]
      8. metadata-eval73.7%

        \[\leadsto \frac{\left(-b\right) + e^{\log \left(\mathsf{fma}\left(b, b, c \cdot \left(a \cdot \color{blue}{-4}\right)\right)\right) \cdot 0.5}}{2 \cdot a} \]
    3. Applied egg-rr73.7%

      \[\leadsto \frac{\left(-b\right) + \color{blue}{e^{\log \left(\mathsf{fma}\left(b, b, c \cdot \left(a \cdot -4\right)\right)\right) \cdot 0.5}}}{2 \cdot a} \]
    4. Taylor expanded in c around -inf 32.4%

      \[\leadsto \frac{\left(-b\right) + e^{\color{blue}{\left(\log \left(4 \cdot a\right) + -1 \cdot \log \left(\frac{-1}{c}\right)\right)} \cdot 0.5}}{2 \cdot a} \]
    5. Step-by-step derivation
      1. mul-1-neg32.4%

        \[\leadsto \frac{\left(-b\right) + e^{\left(\log \left(4 \cdot a\right) + \color{blue}{\left(-\log \left(\frac{-1}{c}\right)\right)}\right) \cdot 0.5}}{2 \cdot a} \]
      2. unsub-neg32.4%

        \[\leadsto \frac{\left(-b\right) + e^{\color{blue}{\left(\log \left(4 \cdot a\right) - \log \left(\frac{-1}{c}\right)\right)} \cdot 0.5}}{2 \cdot a} \]
      3. *-commutative32.4%

        \[\leadsto \frac{\left(-b\right) + e^{\left(\log \color{blue}{\left(a \cdot 4\right)} - \log \left(\frac{-1}{c}\right)\right) \cdot 0.5}}{2 \cdot a} \]
    6. Simplified32.4%

      \[\leadsto \frac{\left(-b\right) + e^{\color{blue}{\left(\log \left(a \cdot 4\right) - \log \left(\frac{-1}{c}\right)\right)} \cdot 0.5}}{2 \cdot a} \]
    7. Taylor expanded in b around 0 32.4%

      \[\leadsto \color{blue}{0.5 \cdot \frac{e^{0.5 \cdot \left(\log \left(4 \cdot a\right) - \log \left(\frac{-1}{c}\right)\right)}}{a}} \]
    8. Step-by-step derivation
      1. associate-*r/32.4%

        \[\leadsto \color{blue}{\frac{0.5 \cdot e^{0.5 \cdot \left(\log \left(4 \cdot a\right) - \log \left(\frac{-1}{c}\right)\right)}}{a}} \]
      2. *-commutative32.4%

        \[\leadsto \frac{0.5 \cdot e^{\color{blue}{\left(\log \left(4 \cdot a\right) - \log \left(\frac{-1}{c}\right)\right) \cdot 0.5}}}{a} \]
      3. log-prod32.4%

        \[\leadsto \frac{0.5 \cdot e^{\left(\color{blue}{\left(\log 4 + \log a\right)} - \log \left(\frac{-1}{c}\right)\right) \cdot 0.5}}{a} \]
      4. +-commutative32.4%

        \[\leadsto \frac{0.5 \cdot e^{\left(\color{blue}{\left(\log a + \log 4\right)} - \log \left(\frac{-1}{c}\right)\right) \cdot 0.5}}{a} \]
      5. log-prod32.4%

        \[\leadsto \frac{0.5 \cdot e^{\left(\color{blue}{\log \left(a \cdot 4\right)} - \log \left(\frac{-1}{c}\right)\right) \cdot 0.5}}{a} \]
      6. log-div67.9%

        \[\leadsto \frac{0.5 \cdot e^{\color{blue}{\log \left(\frac{a \cdot 4}{\frac{-1}{c}}\right)} \cdot 0.5}}{a} \]
      7. exp-to-pow72.5%

        \[\leadsto \frac{0.5 \cdot \color{blue}{{\left(\frac{a \cdot 4}{\frac{-1}{c}}\right)}^{0.5}}}{a} \]
      8. unpow1/272.5%

        \[\leadsto \frac{0.5 \cdot \color{blue}{\sqrt{\frac{a \cdot 4}{\frac{-1}{c}}}}}{a} \]
      9. associate-/r/72.5%

        \[\leadsto \frac{0.5 \cdot \sqrt{\color{blue}{\frac{a \cdot 4}{-1} \cdot c}}}{a} \]
      10. *-commutative72.5%

        \[\leadsto \frac{0.5 \cdot \sqrt{\color{blue}{c \cdot \frac{a \cdot 4}{-1}}}}{a} \]
      11. associate-/l*72.5%

        \[\leadsto \frac{0.5 \cdot \sqrt{c \cdot \color{blue}{\frac{a}{\frac{-1}{4}}}}}{a} \]
      12. metadata-eval72.5%

        \[\leadsto \frac{0.5 \cdot \sqrt{c \cdot \frac{a}{\color{blue}{-0.25}}}}{a} \]
    9. Simplified72.5%

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

    if 2.1499999999999999e-94 < b

    1. Initial program 23.4%

      \[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a} \]
    2. Taylor expanded in b around inf 74.3%

      \[\leadsto \color{blue}{-1 \cdot \frac{c}{b}} \]
    3. Step-by-step derivation
      1. associate-*r/74.3%

        \[\leadsto \color{blue}{\frac{-1 \cdot c}{b}} \]
      2. neg-mul-174.3%

        \[\leadsto \frac{\color{blue}{-c}}{b} \]
    4. Simplified74.3%

      \[\leadsto \color{blue}{\frac{-c}{b}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification80.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -4.3 \cdot 10^{-95}:\\ \;\;\;\;\frac{c}{b} - \frac{b}{a}\\ \mathbf{elif}\;b \leq 2.15 \cdot 10^{-94}:\\ \;\;\;\;\frac{0.5 \cdot \sqrt{c \cdot \frac{a}{-0.25}}}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{-c}{b}\\ \end{array} \]

Alternative 7: 68.2% accurate, 12.8× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;\frac{-c}{b}\\


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

    1. Initial program 72.7%

      \[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a} \]
    2. Taylor expanded in b around -inf 76.4%

      \[\leadsto \color{blue}{-1 \cdot \frac{b}{a} + \frac{c}{b}} \]
    3. Step-by-step derivation
      1. +-commutative76.4%

        \[\leadsto \color{blue}{\frac{c}{b} + -1 \cdot \frac{b}{a}} \]
      2. mul-1-neg76.4%

        \[\leadsto \frac{c}{b} + \color{blue}{\left(-\frac{b}{a}\right)} \]
      3. unsub-neg76.4%

        \[\leadsto \color{blue}{\frac{c}{b} - \frac{b}{a}} \]
    4. Simplified76.4%

      \[\leadsto \color{blue}{\frac{c}{b} - \frac{b}{a}} \]

    if -1.999999999999994e-310 < b

    1. Initial program 36.2%

      \[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a} \]
    2. Taylor expanded in b around inf 58.1%

      \[\leadsto \color{blue}{-1 \cdot \frac{c}{b}} \]
    3. Step-by-step derivation
      1. associate-*r/58.1%

        \[\leadsto \color{blue}{\frac{-1 \cdot c}{b}} \]
      2. neg-mul-158.1%

        \[\leadsto \frac{\color{blue}{-c}}{b} \]
    4. Simplified58.1%

      \[\leadsto \color{blue}{\frac{-c}{b}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification67.2%

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

Alternative 8: 42.9% accurate, 19.1× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq 7.1 \cdot 10^{+72}:\\
\;\;\;\;\frac{-b}{a}\\

\mathbf{else}:\\
\;\;\;\;\frac{c}{b}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if b < 7.0999999999999993e72

    1. Initial program 66.0%

      \[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a} \]
    2. Taylor expanded in b around -inf 49.5%

      \[\leadsto \color{blue}{-1 \cdot \frac{b}{a}} \]
    3. Step-by-step derivation
      1. associate-*r/49.5%

        \[\leadsto \color{blue}{\frac{-1 \cdot b}{a}} \]
      2. mul-1-neg49.5%

        \[\leadsto \frac{\color{blue}{-b}}{a} \]
    4. Simplified49.5%

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

    if 7.0999999999999993e72 < b

    1. Initial program 11.4%

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

        \[\leadsto \frac{\left(-b\right) + \color{blue}{{\left(b \cdot b - \left(4 \cdot a\right) \cdot c\right)}^{0.5}}}{2 \cdot a} \]
      2. pow-to-exp6.4%

        \[\leadsto \frac{\left(-b\right) + \color{blue}{e^{\log \left(b \cdot b - \left(4 \cdot a\right) \cdot c\right) \cdot 0.5}}}{2 \cdot a} \]
      3. fma-neg6.4%

        \[\leadsto \frac{\left(-b\right) + e^{\log \color{blue}{\left(\mathsf{fma}\left(b, b, -\left(4 \cdot a\right) \cdot c\right)\right)} \cdot 0.5}}{2 \cdot a} \]
      4. *-commutative6.4%

        \[\leadsto \frac{\left(-b\right) + e^{\log \left(\mathsf{fma}\left(b, b, -\color{blue}{c \cdot \left(4 \cdot a\right)}\right)\right) \cdot 0.5}}{2 \cdot a} \]
      5. distribute-rgt-neg-in6.4%

        \[\leadsto \frac{\left(-b\right) + e^{\log \left(\mathsf{fma}\left(b, b, \color{blue}{c \cdot \left(-4 \cdot a\right)}\right)\right) \cdot 0.5}}{2 \cdot a} \]
      6. *-commutative6.4%

        \[\leadsto \frac{\left(-b\right) + e^{\log \left(\mathsf{fma}\left(b, b, c \cdot \left(-\color{blue}{a \cdot 4}\right)\right)\right) \cdot 0.5}}{2 \cdot a} \]
      7. distribute-rgt-neg-in6.4%

        \[\leadsto \frac{\left(-b\right) + e^{\log \left(\mathsf{fma}\left(b, b, c \cdot \color{blue}{\left(a \cdot \left(-4\right)\right)}\right)\right) \cdot 0.5}}{2 \cdot a} \]
      8. metadata-eval6.4%

        \[\leadsto \frac{\left(-b\right) + e^{\log \left(\mathsf{fma}\left(b, b, c \cdot \left(a \cdot \color{blue}{-4}\right)\right)\right) \cdot 0.5}}{2 \cdot a} \]
    3. Applied egg-rr6.4%

      \[\leadsto \frac{\left(-b\right) + \color{blue}{e^{\log \left(\mathsf{fma}\left(b, b, c \cdot \left(a \cdot -4\right)\right)\right) \cdot 0.5}}}{2 \cdot a} \]
    4. Taylor expanded in b around -inf 2.5%

      \[\leadsto \frac{\left(-b\right) + \color{blue}{\left(-1 \cdot b + 2 \cdot \frac{a \cdot c}{b}\right)}}{2 \cdot a} \]
    5. Step-by-step derivation
      1. neg-mul-12.5%

        \[\leadsto \frac{\left(-b\right) + \left(\color{blue}{\left(-b\right)} + 2 \cdot \frac{a \cdot c}{b}\right)}{2 \cdot a} \]
      2. +-commutative2.5%

        \[\leadsto \frac{\left(-b\right) + \color{blue}{\left(2 \cdot \frac{a \cdot c}{b} + \left(-b\right)\right)}}{2 \cdot a} \]
      3. unsub-neg2.5%

        \[\leadsto \frac{\left(-b\right) + \color{blue}{\left(2 \cdot \frac{a \cdot c}{b} - b\right)}}{2 \cdot a} \]
      4. associate-/l*2.6%

        \[\leadsto \frac{\left(-b\right) + \left(2 \cdot \color{blue}{\frac{a}{\frac{b}{c}}} - b\right)}{2 \cdot a} \]
      5. *-commutative2.6%

        \[\leadsto \frac{\left(-b\right) + \left(\color{blue}{\frac{a}{\frac{b}{c}} \cdot 2} - b\right)}{2 \cdot a} \]
      6. associate-*l/2.6%

        \[\leadsto \frac{\left(-b\right) + \left(\color{blue}{\frac{a \cdot 2}{\frac{b}{c}}} - b\right)}{2 \cdot a} \]
    6. Simplified2.6%

      \[\leadsto \frac{\left(-b\right) + \color{blue}{\left(\frac{a \cdot 2}{\frac{b}{c}} - b\right)}}{2 \cdot a} \]
    7. Taylor expanded in b around 0 37.2%

      \[\leadsto \color{blue}{\frac{c}{b}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification46.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq 7.1 \cdot 10^{+72}:\\ \;\;\;\;\frac{-b}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{c}{b}\\ \end{array} \]

Alternative 9: 68.0% accurate, 19.1× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;\frac{-c}{b}\\


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

    1. Initial program 72.7%

      \[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a} \]
    2. Taylor expanded in b around -inf 76.3%

      \[\leadsto \color{blue}{-1 \cdot \frac{b}{a}} \]
    3. Step-by-step derivation
      1. associate-*r/76.3%

        \[\leadsto \color{blue}{\frac{-1 \cdot b}{a}} \]
      2. mul-1-neg76.3%

        \[\leadsto \frac{\color{blue}{-b}}{a} \]
    4. Simplified76.3%

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

    if -1.999999999999994e-310 < b

    1. Initial program 36.2%

      \[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a} \]
    2. Taylor expanded in b around inf 58.1%

      \[\leadsto \color{blue}{-1 \cdot \frac{c}{b}} \]
    3. Step-by-step derivation
      1. associate-*r/58.1%

        \[\leadsto \color{blue}{\frac{-1 \cdot c}{b}} \]
      2. neg-mul-158.1%

        \[\leadsto \frac{\color{blue}{-c}}{b} \]
    4. Simplified58.1%

      \[\leadsto \color{blue}{\frac{-c}{b}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification67.2%

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

Alternative 10: 10.6% accurate, 38.7× speedup?

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

\\
\frac{c}{b}
\end{array}
Derivation
  1. Initial program 54.5%

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

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

      \[\leadsto \frac{\left(-b\right) + \color{blue}{e^{\log \left(b \cdot b - \left(4 \cdot a\right) \cdot c\right) \cdot 0.5}}}{2 \cdot a} \]
    3. fma-neg50.9%

      \[\leadsto \frac{\left(-b\right) + e^{\log \color{blue}{\left(\mathsf{fma}\left(b, b, -\left(4 \cdot a\right) \cdot c\right)\right)} \cdot 0.5}}{2 \cdot a} \]
    4. *-commutative50.9%

      \[\leadsto \frac{\left(-b\right) + e^{\log \left(\mathsf{fma}\left(b, b, -\color{blue}{c \cdot \left(4 \cdot a\right)}\right)\right) \cdot 0.5}}{2 \cdot a} \]
    5. distribute-rgt-neg-in50.9%

      \[\leadsto \frac{\left(-b\right) + e^{\log \left(\mathsf{fma}\left(b, b, \color{blue}{c \cdot \left(-4 \cdot a\right)}\right)\right) \cdot 0.5}}{2 \cdot a} \]
    6. *-commutative50.9%

      \[\leadsto \frac{\left(-b\right) + e^{\log \left(\mathsf{fma}\left(b, b, c \cdot \left(-\color{blue}{a \cdot 4}\right)\right)\right) \cdot 0.5}}{2 \cdot a} \]
    7. distribute-rgt-neg-in50.9%

      \[\leadsto \frac{\left(-b\right) + e^{\log \left(\mathsf{fma}\left(b, b, c \cdot \color{blue}{\left(a \cdot \left(-4\right)\right)}\right)\right) \cdot 0.5}}{2 \cdot a} \]
    8. metadata-eval50.9%

      \[\leadsto \frac{\left(-b\right) + e^{\log \left(\mathsf{fma}\left(b, b, c \cdot \left(a \cdot \color{blue}{-4}\right)\right)\right) \cdot 0.5}}{2 \cdot a} \]
  3. Applied egg-rr50.9%

    \[\leadsto \frac{\left(-b\right) + \color{blue}{e^{\log \left(\mathsf{fma}\left(b, b, c \cdot \left(a \cdot -4\right)\right)\right) \cdot 0.5}}}{2 \cdot a} \]
  4. Taylor expanded in b around -inf 37.0%

    \[\leadsto \frac{\left(-b\right) + \color{blue}{\left(-1 \cdot b + 2 \cdot \frac{a \cdot c}{b}\right)}}{2 \cdot a} \]
  5. Step-by-step derivation
    1. neg-mul-137.0%

      \[\leadsto \frac{\left(-b\right) + \left(\color{blue}{\left(-b\right)} + 2 \cdot \frac{a \cdot c}{b}\right)}{2 \cdot a} \]
    2. +-commutative37.0%

      \[\leadsto \frac{\left(-b\right) + \color{blue}{\left(2 \cdot \frac{a \cdot c}{b} + \left(-b\right)\right)}}{2 \cdot a} \]
    3. unsub-neg37.0%

      \[\leadsto \frac{\left(-b\right) + \color{blue}{\left(2 \cdot \frac{a \cdot c}{b} - b\right)}}{2 \cdot a} \]
    4. associate-/l*39.3%

      \[\leadsto \frac{\left(-b\right) + \left(2 \cdot \color{blue}{\frac{a}{\frac{b}{c}}} - b\right)}{2 \cdot a} \]
    5. *-commutative39.3%

      \[\leadsto \frac{\left(-b\right) + \left(\color{blue}{\frac{a}{\frac{b}{c}} \cdot 2} - b\right)}{2 \cdot a} \]
    6. associate-*l/39.3%

      \[\leadsto \frac{\left(-b\right) + \left(\color{blue}{\frac{a \cdot 2}{\frac{b}{c}}} - b\right)}{2 \cdot a} \]
  6. Simplified39.3%

    \[\leadsto \frac{\left(-b\right) + \color{blue}{\left(\frac{a \cdot 2}{\frac{b}{c}} - b\right)}}{2 \cdot a} \]
  7. Taylor expanded in b around 0 10.1%

    \[\leadsto \color{blue}{\frac{c}{b}} \]
  8. Final simplification10.1%

    \[\leadsto \frac{c}{b} \]

Developer target: 70.1% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}\\ \mathbf{if}\;b < 0:\\ \;\;\;\;\frac{\left(-b\right) + t_0}{2 \cdot a}\\ \mathbf{else}:\\ \;\;\;\;\frac{c}{a \cdot \frac{\left(-b\right) - t_0}{2 \cdot a}}\\ \end{array} \end{array} \]
(FPCore (a b c)
 :precision binary64
 (let* ((t_0 (sqrt (- (* b b) (* (* 4.0 a) c)))))
   (if (< b 0.0)
     (/ (+ (- b) t_0) (* 2.0 a))
     (/ c (* a (/ (- (- b) t_0) (* 2.0 a)))))))
double code(double a, double b, double c) {
	double t_0 = sqrt(((b * b) - ((4.0 * a) * c)));
	double tmp;
	if (b < 0.0) {
		tmp = (-b + t_0) / (2.0 * a);
	} else {
		tmp = c / (a * ((-b - t_0) / (2.0 * a)));
	}
	return tmp;
}
real(8) function code(a, b, c)
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8) :: t_0
    real(8) :: tmp
    t_0 = sqrt(((b * b) - ((4.0d0 * a) * c)))
    if (b < 0.0d0) then
        tmp = (-b + t_0) / (2.0d0 * a)
    else
        tmp = c / (a * ((-b - t_0) / (2.0d0 * a)))
    end if
    code = tmp
end function
public static double code(double a, double b, double c) {
	double t_0 = Math.sqrt(((b * b) - ((4.0 * a) * c)));
	double tmp;
	if (b < 0.0) {
		tmp = (-b + t_0) / (2.0 * a);
	} else {
		tmp = c / (a * ((-b - t_0) / (2.0 * a)));
	}
	return tmp;
}
def code(a, b, c):
	t_0 = math.sqrt(((b * b) - ((4.0 * a) * c)))
	tmp = 0
	if b < 0.0:
		tmp = (-b + t_0) / (2.0 * a)
	else:
		tmp = c / (a * ((-b - t_0) / (2.0 * a)))
	return tmp
function code(a, b, c)
	t_0 = sqrt(Float64(Float64(b * b) - Float64(Float64(4.0 * a) * c)))
	tmp = 0.0
	if (b < 0.0)
		tmp = Float64(Float64(Float64(-b) + t_0) / Float64(2.0 * a));
	else
		tmp = Float64(c / Float64(a * Float64(Float64(Float64(-b) - t_0) / Float64(2.0 * a))));
	end
	return tmp
end
function tmp_2 = code(a, b, c)
	t_0 = sqrt(((b * b) - ((4.0 * a) * c)));
	tmp = 0.0;
	if (b < 0.0)
		tmp = (-b + t_0) / (2.0 * a);
	else
		tmp = c / (a * ((-b - t_0) / (2.0 * a)));
	end
	tmp_2 = tmp;
end
code[a_, b_, c_] := Block[{t$95$0 = N[Sqrt[N[(N[(b * b), $MachinePrecision] - N[(N[(4.0 * a), $MachinePrecision] * c), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[Less[b, 0.0], N[(N[((-b) + t$95$0), $MachinePrecision] / N[(2.0 * a), $MachinePrecision]), $MachinePrecision], N[(c / N[(a * N[(N[((-b) - t$95$0), $MachinePrecision] / N[(2.0 * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}\\
\mathbf{if}\;b < 0:\\
\;\;\;\;\frac{\left(-b\right) + t_0}{2 \cdot a}\\

\mathbf{else}:\\
\;\;\;\;\frac{c}{a \cdot \frac{\left(-b\right) - t_0}{2 \cdot a}}\\


\end{array}
\end{array}

Reproduce

?
herbie shell --seed 2023279 
(FPCore (a b c)
  :name "The quadratic formula (r1)"
  :precision binary64

  :herbie-target
  (if (< b 0.0) (/ (+ (- b) (sqrt (- (* b b) (* (* 4.0 a) c)))) (* 2.0 a)) (/ c (* a (/ (- (- b) (sqrt (- (* b b) (* (* 4.0 a) c)))) (* 2.0 a)))))

  (/ (+ (- b) (sqrt (- (* b b) (* (* 4.0 a) c)))) (* 2.0 a)))