The quadratic formula (r1)

Percentage Accurate: 52.5% → 85.1%
Time: 15.1s
Alternatives: 14
Speedup: 11.6×

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 14 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.5% 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: 85.1% accurate, 0.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq -9.2 \cdot 10^{+92}:\\
\;\;\;\;\frac{0 - b}{a}\\

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

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


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

    1. Initial program 43.5%

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

      \[\leadsto \color{blue}{-1 \cdot \frac{b}{a}} \]
    4. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto \mathsf{neg}\left(\frac{b}{a}\right) \]
      2. distribute-neg-frac2N/A

        \[\leadsto \frac{b}{\color{blue}{\mathsf{neg}\left(a\right)}} \]
      3. mul-1-negN/A

        \[\leadsto \frac{b}{-1 \cdot \color{blue}{a}} \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(b, \color{blue}{\left(-1 \cdot a\right)}\right) \]
      5. mul-1-negN/A

        \[\leadsto \mathsf{/.f64}\left(b, \left(\mathsf{neg}\left(a\right)\right)\right) \]
      6. neg-lowering-neg.f6490.8%

        \[\leadsto \mathsf{/.f64}\left(b, \mathsf{neg.f64}\left(a\right)\right) \]
    5. Simplified90.8%

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

    if -9.19999999999999994e92 < b < 1.02000000000000001e-131

    1. Initial program 87.6%

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

        \[\leadsto \mathsf{/.f64}\left(\left(\left(\mathsf{neg}\left(b\right)\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}\right), \color{blue}{\left(2 \cdot a\right)}\right) \]
      2. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c} + \left(\mathsf{neg}\left(b\right)\right)\right), \left(\color{blue}{2} \cdot a\right)\right) \]
      3. unsub-negN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c} - b\right), \left(\color{blue}{2} \cdot a\right)\right) \]
      4. --lowering--.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\left(\sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}\right), b\right), \left(\color{blue}{2} \cdot a\right)\right) \]
      5. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\left(b \cdot b - \left(4 \cdot a\right) \cdot c\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      6. sub-negN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\left(b \cdot b + \left(\mathsf{neg}\left(\left(4 \cdot a\right) \cdot c\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      7. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\left(b \cdot b\right), \left(\mathsf{neg}\left(\left(4 \cdot a\right) \cdot c\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(\mathsf{neg}\left(\left(4 \cdot a\right) \cdot c\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      9. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(\mathsf{neg}\left(\left(a \cdot 4\right) \cdot c\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      10. associate-*l*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(\mathsf{neg}\left(a \cdot \left(4 \cdot c\right)\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      11. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(a \cdot \left(\mathsf{neg}\left(4 \cdot c\right)\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      12. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(a \cdot \left(\mathsf{neg}\left(c \cdot 4\right)\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      13. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(a, \left(\mathsf{neg}\left(c \cdot 4\right)\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      14. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(a, \left(c \cdot \left(\mathsf{neg}\left(4\right)\right)\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      15. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(c, \left(\mathsf{neg}\left(4\right)\right)\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      16. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(c, -4\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      17. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(c, -4\right)\right)\right)\right), b\right), \left(a \cdot \color{blue}{2}\right)\right) \]
    3. Simplified86.7%

      \[\leadsto \color{blue}{\frac{\sqrt{b \cdot b + a \cdot \left(c \cdot -4\right)} - b}{a \cdot 2}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\left(b \cdot b + a \cdot \left(-4 \cdot c\right)\right)\right), b\right), \mathsf{*.f64}\left(a, 2\right)\right) \]
      2. associate-*r*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\left(b \cdot b + \left(a \cdot -4\right) \cdot c\right)\right), b\right), \mathsf{*.f64}\left(a, 2\right)\right) \]
      3. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\left(b \cdot b + \left(a \cdot \left(\mathsf{neg}\left(4\right)\right)\right) \cdot c\right)\right), b\right), \mathsf{*.f64}\left(a, 2\right)\right) \]
      4. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\left(b \cdot b + \left(\mathsf{neg}\left(a \cdot 4\right)\right) \cdot c\right)\right), b\right), \mathsf{*.f64}\left(a, 2\right)\right) \]
      5. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\left(b \cdot b + \left(\mathsf{neg}\left(4 \cdot a\right)\right) \cdot c\right)\right), b\right), \mathsf{*.f64}\left(a, 2\right)\right) \]
      6. cancel-sign-sub-invN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\left(b \cdot b - \left(4 \cdot a\right) \cdot c\right)\right), b\right), \mathsf{*.f64}\left(a, 2\right)\right) \]
      7. --lowering--.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(\left(b \cdot b\right), \left(\left(4 \cdot a\right) \cdot c\right)\right)\right), b\right), \mathsf{*.f64}\left(a, 2\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(\left(4 \cdot a\right) \cdot c\right)\right)\right), b\right), \mathsf{*.f64}\left(a, 2\right)\right) \]
      9. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(\left(4 \cdot a\right), c\right)\right)\right), b\right), \mathsf{*.f64}\left(a, 2\right)\right) \]
      10. *-lowering-*.f6487.6%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, a\right), c\right)\right)\right), b\right), \mathsf{*.f64}\left(a, 2\right)\right) \]
    6. Applied egg-rr87.6%

      \[\leadsto \frac{\sqrt{\color{blue}{b \cdot b - \left(4 \cdot a\right) \cdot c}} - b}{a \cdot 2} \]
    7. Step-by-step derivation
      1. pow1/2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\left({\left(b \cdot b - \left(4 \cdot a\right) \cdot c\right)}^{\frac{1}{2}}\right), b\right), \mathsf{*.f64}\left(a, 2\right)\right) \]
      2. sub-negN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\left({\left(b \cdot b + \left(\mathsf{neg}\left(\left(4 \cdot a\right) \cdot c\right)\right)\right)}^{\frac{1}{2}}\right), b\right), \mathsf{*.f64}\left(a, 2\right)\right) \]
      3. associate-*l*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\left({\left(b \cdot b + \left(\mathsf{neg}\left(4 \cdot \left(a \cdot c\right)\right)\right)\right)}^{\frac{1}{2}}\right), b\right), \mathsf{*.f64}\left(a, 2\right)\right) \]
      4. distribute-lft-neg-inN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\left({\left(b \cdot b + \left(\mathsf{neg}\left(4\right)\right) \cdot \left(a \cdot c\right)\right)}^{\frac{1}{2}}\right), b\right), \mathsf{*.f64}\left(a, 2\right)\right) \]
      5. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\left({\left(b \cdot b + -4 \cdot \left(a \cdot c\right)\right)}^{\frac{1}{2}}\right), b\right), \mathsf{*.f64}\left(a, 2\right)\right) \]
      6. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\left({\left(b \cdot b + \left(a \cdot c\right) \cdot -4\right)}^{\frac{1}{2}}\right), b\right), \mathsf{*.f64}\left(a, 2\right)\right) \]
      7. associate-*r*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\left({\left(b \cdot b + a \cdot \left(c \cdot -4\right)\right)}^{\frac{1}{2}}\right), b\right), \mathsf{*.f64}\left(a, 2\right)\right) \]
      8. remove-double-divN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\left({\left(\frac{1}{\frac{1}{b \cdot b + a \cdot \left(c \cdot -4\right)}}\right)}^{\frac{1}{2}}\right), b\right), \mathsf{*.f64}\left(a, 2\right)\right) \]
      9. inv-powN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\left({\left({\left(\frac{1}{b \cdot b + a \cdot \left(c \cdot -4\right)}\right)}^{-1}\right)}^{\frac{1}{2}}\right), b\right), \mathsf{*.f64}\left(a, 2\right)\right) \]
      10. pow-powN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\left({\left(\frac{1}{b \cdot b + a \cdot \left(c \cdot -4\right)}\right)}^{\left(-1 \cdot \frac{1}{2}\right)}\right), b\right), \mathsf{*.f64}\left(a, 2\right)\right) \]
      11. pow-lowering-pow.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{pow.f64}\left(\left(\frac{1}{b \cdot b + a \cdot \left(c \cdot -4\right)}\right), \left(-1 \cdot \frac{1}{2}\right)\right), b\right), \mathsf{*.f64}\left(a, 2\right)\right) \]
      12. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{pow.f64}\left(\mathsf{/.f64}\left(1, \left(b \cdot b + a \cdot \left(c \cdot -4\right)\right)\right), \left(-1 \cdot \frac{1}{2}\right)\right), b\right), \mathsf{*.f64}\left(a, 2\right)\right) \]
      13. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{pow.f64}\left(\mathsf{/.f64}\left(1, \left(b \cdot b + a \cdot \left(-4 \cdot c\right)\right)\right), \left(-1 \cdot \frac{1}{2}\right)\right), b\right), \mathsf{*.f64}\left(a, 2\right)\right) \]
      14. associate-*r*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{pow.f64}\left(\mathsf{/.f64}\left(1, \left(b \cdot b + \left(a \cdot -4\right) \cdot c\right)\right), \left(-1 \cdot \frac{1}{2}\right)\right), b\right), \mathsf{*.f64}\left(a, 2\right)\right) \]
      15. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{pow.f64}\left(\mathsf{/.f64}\left(1, \left(b \cdot b + c \cdot \left(a \cdot -4\right)\right)\right), \left(-1 \cdot \frac{1}{2}\right)\right), b\right), \mathsf{*.f64}\left(a, 2\right)\right) \]
      16. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{pow.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(\left(b \cdot b\right), \left(c \cdot \left(a \cdot -4\right)\right)\right)\right), \left(-1 \cdot \frac{1}{2}\right)\right), b\right), \mathsf{*.f64}\left(a, 2\right)\right) \]
      17. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{pow.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(c \cdot \left(a \cdot -4\right)\right)\right)\right), \left(-1 \cdot \frac{1}{2}\right)\right), b\right), \mathsf{*.f64}\left(a, 2\right)\right) \]
      18. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{pow.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(c, \left(a \cdot -4\right)\right)\right)\right), \left(-1 \cdot \frac{1}{2}\right)\right), b\right), \mathsf{*.f64}\left(a, 2\right)\right) \]
      19. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{pow.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(c, \mathsf{*.f64}\left(a, -4\right)\right)\right)\right), \left(-1 \cdot \frac{1}{2}\right)\right), b\right), \mathsf{*.f64}\left(a, 2\right)\right) \]
      20. metadata-eval87.6%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{pow.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(c, \mathsf{*.f64}\left(a, -4\right)\right)\right)\right), \frac{-1}{2}\right), b\right), \mathsf{*.f64}\left(a, 2\right)\right) \]
    8. Applied egg-rr87.6%

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

    if 1.02000000000000001e-131 < b

    1. Initial program 17.3%

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

      \[\leadsto \color{blue}{-1 \cdot \frac{c}{b}} \]
    4. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto \mathsf{neg}\left(\frac{c}{b}\right) \]
      2. neg-sub0N/A

        \[\leadsto 0 - \color{blue}{\frac{c}{b}} \]
      3. --lowering--.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(0, \color{blue}{\left(\frac{c}{b}\right)}\right) \]
      4. /-lowering-/.f6483.6%

        \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(c, \color{blue}{b}\right)\right) \]
    5. Simplified83.6%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -9.2 \cdot 10^{+92}:\\ \;\;\;\;\frac{0 - b}{a}\\ \mathbf{elif}\;b \leq 1.02 \cdot 10^{-131}:\\ \;\;\;\;\frac{{\left(\frac{1}{b \cdot b + c \cdot \left(a \cdot -4\right)}\right)}^{-0.5} - b}{a \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;\frac{c}{0 - b}\\ \end{array} \]
  5. Add Preprocessing

Alternative 2: 85.3% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq -3.8 \cdot 10^{+92}:\\ \;\;\;\;\frac{0 - b}{a}\\ \mathbf{elif}\;b \leq 1.02 \cdot 10^{-131}:\\ \;\;\;\;\frac{\sqrt{b \cdot b - c \cdot \left(a \cdot 4\right)} - b}{a \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;\frac{c}{0 - b}\\ \end{array} \end{array} \]
(FPCore (a b c)
 :precision binary64
 (if (<= b -3.8e+92)
   (/ (- 0.0 b) a)
   (if (<= b 1.02e-131)
     (/ (- (sqrt (- (* b b) (* c (* a 4.0)))) b) (* a 2.0))
     (/ c (- 0.0 b)))))
double code(double a, double b, double c) {
	double tmp;
	if (b <= -3.8e+92) {
		tmp = (0.0 - b) / a;
	} else if (b <= 1.02e-131) {
		tmp = (sqrt(((b * b) - (c * (a * 4.0)))) - b) / (a * 2.0);
	} else {
		tmp = c / (0.0 - 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 <= (-3.8d+92)) then
        tmp = (0.0d0 - b) / a
    else if (b <= 1.02d-131) then
        tmp = (sqrt(((b * b) - (c * (a * 4.0d0)))) - b) / (a * 2.0d0)
    else
        tmp = c / (0.0d0 - b)
    end if
    code = tmp
end function
public static double code(double a, double b, double c) {
	double tmp;
	if (b <= -3.8e+92) {
		tmp = (0.0 - b) / a;
	} else if (b <= 1.02e-131) {
		tmp = (Math.sqrt(((b * b) - (c * (a * 4.0)))) - b) / (a * 2.0);
	} else {
		tmp = c / (0.0 - b);
	}
	return tmp;
}
def code(a, b, c):
	tmp = 0
	if b <= -3.8e+92:
		tmp = (0.0 - b) / a
	elif b <= 1.02e-131:
		tmp = (math.sqrt(((b * b) - (c * (a * 4.0)))) - b) / (a * 2.0)
	else:
		tmp = c / (0.0 - b)
	return tmp
function code(a, b, c)
	tmp = 0.0
	if (b <= -3.8e+92)
		tmp = Float64(Float64(0.0 - b) / a);
	elseif (b <= 1.02e-131)
		tmp = Float64(Float64(sqrt(Float64(Float64(b * b) - Float64(c * Float64(a * 4.0)))) - b) / Float64(a * 2.0));
	else
		tmp = Float64(c / Float64(0.0 - b));
	end
	return tmp
end
function tmp_2 = code(a, b, c)
	tmp = 0.0;
	if (b <= -3.8e+92)
		tmp = (0.0 - b) / a;
	elseif (b <= 1.02e-131)
		tmp = (sqrt(((b * b) - (c * (a * 4.0)))) - b) / (a * 2.0);
	else
		tmp = c / (0.0 - b);
	end
	tmp_2 = tmp;
end
code[a_, b_, c_] := If[LessEqual[b, -3.8e+92], N[(N[(0.0 - b), $MachinePrecision] / a), $MachinePrecision], If[LessEqual[b, 1.02e-131], 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 / N[(0.0 - b), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;b \leq -3.8 \cdot 10^{+92}:\\
\;\;\;\;\frac{0 - b}{a}\\

\mathbf{elif}\;b \leq 1.02 \cdot 10^{-131}:\\
\;\;\;\;\frac{\sqrt{b \cdot b - c \cdot \left(a \cdot 4\right)} - b}{a \cdot 2}\\

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


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

    1. Initial program 43.5%

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

      \[\leadsto \color{blue}{-1 \cdot \frac{b}{a}} \]
    4. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto \mathsf{neg}\left(\frac{b}{a}\right) \]
      2. distribute-neg-frac2N/A

        \[\leadsto \frac{b}{\color{blue}{\mathsf{neg}\left(a\right)}} \]
      3. mul-1-negN/A

        \[\leadsto \frac{b}{-1 \cdot \color{blue}{a}} \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(b, \color{blue}{\left(-1 \cdot a\right)}\right) \]
      5. mul-1-negN/A

        \[\leadsto \mathsf{/.f64}\left(b, \left(\mathsf{neg}\left(a\right)\right)\right) \]
      6. neg-lowering-neg.f6490.8%

        \[\leadsto \mathsf{/.f64}\left(b, \mathsf{neg.f64}\left(a\right)\right) \]
    5. Simplified90.8%

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

    if -3.8e92 < b < 1.02000000000000001e-131

    1. Initial program 87.6%

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

        \[\leadsto \mathsf{/.f64}\left(\left(\left(\mathsf{neg}\left(b\right)\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}\right), \color{blue}{\left(2 \cdot a\right)}\right) \]
      2. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c} + \left(\mathsf{neg}\left(b\right)\right)\right), \left(\color{blue}{2} \cdot a\right)\right) \]
      3. unsub-negN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c} - b\right), \left(\color{blue}{2} \cdot a\right)\right) \]
      4. --lowering--.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\left(\sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}\right), b\right), \left(\color{blue}{2} \cdot a\right)\right) \]
      5. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\left(b \cdot b - \left(4 \cdot a\right) \cdot c\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      6. sub-negN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\left(b \cdot b + \left(\mathsf{neg}\left(\left(4 \cdot a\right) \cdot c\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      7. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\left(b \cdot b\right), \left(\mathsf{neg}\left(\left(4 \cdot a\right) \cdot c\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(\mathsf{neg}\left(\left(4 \cdot a\right) \cdot c\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      9. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(\mathsf{neg}\left(\left(a \cdot 4\right) \cdot c\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      10. associate-*l*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(\mathsf{neg}\left(a \cdot \left(4 \cdot c\right)\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      11. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(a \cdot \left(\mathsf{neg}\left(4 \cdot c\right)\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      12. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(a \cdot \left(\mathsf{neg}\left(c \cdot 4\right)\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      13. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(a, \left(\mathsf{neg}\left(c \cdot 4\right)\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      14. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(a, \left(c \cdot \left(\mathsf{neg}\left(4\right)\right)\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      15. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(c, \left(\mathsf{neg}\left(4\right)\right)\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      16. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(c, -4\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      17. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(c, -4\right)\right)\right)\right), b\right), \left(a \cdot \color{blue}{2}\right)\right) \]
    3. Simplified86.7%

      \[\leadsto \color{blue}{\frac{\sqrt{b \cdot b + a \cdot \left(c \cdot -4\right)} - b}{a \cdot 2}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\left(b \cdot b + a \cdot \left(-4 \cdot c\right)\right)\right), b\right), \mathsf{*.f64}\left(a, 2\right)\right) \]
      2. associate-*r*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\left(b \cdot b + \left(a \cdot -4\right) \cdot c\right)\right), b\right), \mathsf{*.f64}\left(a, 2\right)\right) \]
      3. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\left(b \cdot b + \left(a \cdot \left(\mathsf{neg}\left(4\right)\right)\right) \cdot c\right)\right), b\right), \mathsf{*.f64}\left(a, 2\right)\right) \]
      4. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\left(b \cdot b + \left(\mathsf{neg}\left(a \cdot 4\right)\right) \cdot c\right)\right), b\right), \mathsf{*.f64}\left(a, 2\right)\right) \]
      5. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\left(b \cdot b + \left(\mathsf{neg}\left(4 \cdot a\right)\right) \cdot c\right)\right), b\right), \mathsf{*.f64}\left(a, 2\right)\right) \]
      6. cancel-sign-sub-invN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\left(b \cdot b - \left(4 \cdot a\right) \cdot c\right)\right), b\right), \mathsf{*.f64}\left(a, 2\right)\right) \]
      7. --lowering--.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(\left(b \cdot b\right), \left(\left(4 \cdot a\right) \cdot c\right)\right)\right), b\right), \mathsf{*.f64}\left(a, 2\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(\left(4 \cdot a\right) \cdot c\right)\right)\right), b\right), \mathsf{*.f64}\left(a, 2\right)\right) \]
      9. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(\left(4 \cdot a\right), c\right)\right)\right), b\right), \mathsf{*.f64}\left(a, 2\right)\right) \]
      10. *-lowering-*.f6487.6%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, a\right), c\right)\right)\right), b\right), \mathsf{*.f64}\left(a, 2\right)\right) \]
    6. Applied egg-rr87.6%

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

    if 1.02000000000000001e-131 < b

    1. Initial program 17.3%

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

      \[\leadsto \color{blue}{-1 \cdot \frac{c}{b}} \]
    4. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto \mathsf{neg}\left(\frac{c}{b}\right) \]
      2. neg-sub0N/A

        \[\leadsto 0 - \color{blue}{\frac{c}{b}} \]
      3. --lowering--.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(0, \color{blue}{\left(\frac{c}{b}\right)}\right) \]
      4. /-lowering-/.f6483.6%

        \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(c, \color{blue}{b}\right)\right) \]
    5. Simplified83.6%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -3.8 \cdot 10^{+92}:\\ \;\;\;\;\frac{0 - b}{a}\\ \mathbf{elif}\;b \leq 1.02 \cdot 10^{-131}:\\ \;\;\;\;\frac{\sqrt{b \cdot b - c \cdot \left(a \cdot 4\right)} - b}{a \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;\frac{c}{0 - b}\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 85.1% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq -2.15 \cdot 10^{+68}:\\ \;\;\;\;\frac{c}{b} - \frac{b}{a}\\ \mathbf{elif}\;b \leq 1.02 \cdot 10^{-131}:\\ \;\;\;\;\frac{\sqrt{b \cdot b + a \cdot \left(c \cdot -4\right)} - b}{a \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;\frac{c}{0 - b}\\ \end{array} \end{array} \]
(FPCore (a b c)
 :precision binary64
 (if (<= b -2.15e+68)
   (- (/ c b) (/ b a))
   (if (<= b 1.02e-131)
     (/ (- (sqrt (+ (* b b) (* a (* c -4.0)))) b) (* a 2.0))
     (/ c (- 0.0 b)))))
double code(double a, double b, double c) {
	double tmp;
	if (b <= -2.15e+68) {
		tmp = (c / b) - (b / a);
	} else if (b <= 1.02e-131) {
		tmp = (sqrt(((b * b) + (a * (c * -4.0)))) - b) / (a * 2.0);
	} else {
		tmp = c / (0.0 - 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 <= (-2.15d+68)) then
        tmp = (c / b) - (b / a)
    else if (b <= 1.02d-131) then
        tmp = (sqrt(((b * b) + (a * (c * (-4.0d0))))) - b) / (a * 2.0d0)
    else
        tmp = c / (0.0d0 - b)
    end if
    code = tmp
end function
public static double code(double a, double b, double c) {
	double tmp;
	if (b <= -2.15e+68) {
		tmp = (c / b) - (b / a);
	} else if (b <= 1.02e-131) {
		tmp = (Math.sqrt(((b * b) + (a * (c * -4.0)))) - b) / (a * 2.0);
	} else {
		tmp = c / (0.0 - b);
	}
	return tmp;
}
def code(a, b, c):
	tmp = 0
	if b <= -2.15e+68:
		tmp = (c / b) - (b / a)
	elif b <= 1.02e-131:
		tmp = (math.sqrt(((b * b) + (a * (c * -4.0)))) - b) / (a * 2.0)
	else:
		tmp = c / (0.0 - b)
	return tmp
function code(a, b, c)
	tmp = 0.0
	if (b <= -2.15e+68)
		tmp = Float64(Float64(c / b) - Float64(b / a));
	elseif (b <= 1.02e-131)
		tmp = Float64(Float64(sqrt(Float64(Float64(b * b) + Float64(a * Float64(c * -4.0)))) - b) / Float64(a * 2.0));
	else
		tmp = Float64(c / Float64(0.0 - b));
	end
	return tmp
end
function tmp_2 = code(a, b, c)
	tmp = 0.0;
	if (b <= -2.15e+68)
		tmp = (c / b) - (b / a);
	elseif (b <= 1.02e-131)
		tmp = (sqrt(((b * b) + (a * (c * -4.0)))) - b) / (a * 2.0);
	else
		tmp = c / (0.0 - b);
	end
	tmp_2 = tmp;
end
code[a_, b_, c_] := If[LessEqual[b, -2.15e+68], N[(N[(c / b), $MachinePrecision] - N[(b / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 1.02e-131], N[(N[(N[Sqrt[N[(N[(b * b), $MachinePrecision] + N[(a * N[(c * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision] / N[(a * 2.0), $MachinePrecision]), $MachinePrecision], N[(c / N[(0.0 - b), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

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

\mathbf{elif}\;b \leq 1.02 \cdot 10^{-131}:\\
\;\;\;\;\frac{\sqrt{b \cdot b + a \cdot \left(c \cdot -4\right)} - b}{a \cdot 2}\\

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


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

    1. Initial program 47.9%

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

      \[\leadsto \color{blue}{-1 \cdot \left(b \cdot \left(-1 \cdot \frac{c}{{b}^{2}} + \frac{1}{a}\right)\right)} \]
    4. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto \mathsf{neg}\left(b \cdot \left(-1 \cdot \frac{c}{{b}^{2}} + \frac{1}{a}\right)\right) \]
      2. *-commutativeN/A

        \[\leadsto \mathsf{neg}\left(\left(-1 \cdot \frac{c}{{b}^{2}} + \frac{1}{a}\right) \cdot b\right) \]
      3. distribute-rgt-neg-inN/A

        \[\leadsto \left(-1 \cdot \frac{c}{{b}^{2}} + \frac{1}{a}\right) \cdot \color{blue}{\left(\mathsf{neg}\left(b\right)\right)} \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(-1 \cdot \frac{c}{{b}^{2}} + \frac{1}{a}\right), \color{blue}{\left(\mathsf{neg}\left(b\right)\right)}\right) \]
      5. +-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{1}{a} + -1 \cdot \frac{c}{{b}^{2}}\right), \left(\mathsf{neg}\left(\color{blue}{b}\right)\right)\right) \]
      6. mul-1-negN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{1}{a} + \left(\mathsf{neg}\left(\frac{c}{{b}^{2}}\right)\right)\right), \left(\mathsf{neg}\left(b\right)\right)\right) \]
      7. unsub-negN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{1}{a} - \frac{c}{{b}^{2}}\right), \left(\mathsf{neg}\left(\color{blue}{b}\right)\right)\right) \]
      8. --lowering--.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\left(\frac{1}{a}\right), \left(\frac{c}{{b}^{2}}\right)\right), \left(\mathsf{neg}\left(\color{blue}{b}\right)\right)\right) \]
      9. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, a\right), \left(\frac{c}{{b}^{2}}\right)\right), \left(\mathsf{neg}\left(b\right)\right)\right) \]
      10. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, a\right), \mathsf{/.f64}\left(c, \left({b}^{2}\right)\right)\right), \left(\mathsf{neg}\left(b\right)\right)\right) \]
      11. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, a\right), \mathsf{/.f64}\left(c, \left(b \cdot b\right)\right)\right), \left(\mathsf{neg}\left(b\right)\right)\right) \]
      12. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, a\right), \mathsf{/.f64}\left(c, \mathsf{*.f64}\left(b, b\right)\right)\right), \left(\mathsf{neg}\left(b\right)\right)\right) \]
      13. neg-sub0N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, a\right), \mathsf{/.f64}\left(c, \mathsf{*.f64}\left(b, b\right)\right)\right), \left(0 - \color{blue}{b}\right)\right) \]
      14. --lowering--.f6489.7%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, a\right), \mathsf{/.f64}\left(c, \mathsf{*.f64}\left(b, b\right)\right)\right), \mathsf{\_.f64}\left(0, \color{blue}{b}\right)\right) \]
    5. Simplified89.7%

      \[\leadsto \color{blue}{\left(\frac{1}{a} - \frac{c}{b \cdot b}\right) \cdot \left(0 - b\right)} \]
    6. Taylor expanded in a around inf

      \[\leadsto \color{blue}{-1 \cdot \frac{b}{a} + \frac{c}{b}} \]
    7. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto \frac{c}{b} + \color{blue}{-1 \cdot \frac{b}{a}} \]
      2. mul-1-negN/A

        \[\leadsto \frac{c}{b} + \left(\mathsf{neg}\left(\frac{b}{a}\right)\right) \]
      3. unsub-negN/A

        \[\leadsto \frac{c}{b} - \color{blue}{\frac{b}{a}} \]
      4. --lowering--.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\left(\frac{c}{b}\right), \color{blue}{\left(\frac{b}{a}\right)}\right) \]
      5. /-lowering-/.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(c, b\right), \left(\frac{\color{blue}{b}}{a}\right)\right) \]
      6. /-lowering-/.f6490.0%

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(c, b\right), \mathsf{/.f64}\left(b, \color{blue}{a}\right)\right) \]
    8. Simplified90.0%

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

    if -2.1500000000000001e68 < b < 1.02000000000000001e-131

    1. Initial program 87.7%

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

        \[\leadsto \mathsf{/.f64}\left(\left(\left(\mathsf{neg}\left(b\right)\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}\right), \color{blue}{\left(2 \cdot a\right)}\right) \]
      2. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c} + \left(\mathsf{neg}\left(b\right)\right)\right), \left(\color{blue}{2} \cdot a\right)\right) \]
      3. unsub-negN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c} - b\right), \left(\color{blue}{2} \cdot a\right)\right) \]
      4. --lowering--.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\left(\sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}\right), b\right), \left(\color{blue}{2} \cdot a\right)\right) \]
      5. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\left(b \cdot b - \left(4 \cdot a\right) \cdot c\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      6. sub-negN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\left(b \cdot b + \left(\mathsf{neg}\left(\left(4 \cdot a\right) \cdot c\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      7. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\left(b \cdot b\right), \left(\mathsf{neg}\left(\left(4 \cdot a\right) \cdot c\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(\mathsf{neg}\left(\left(4 \cdot a\right) \cdot c\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      9. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(\mathsf{neg}\left(\left(a \cdot 4\right) \cdot c\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      10. associate-*l*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(\mathsf{neg}\left(a \cdot \left(4 \cdot c\right)\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      11. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(a \cdot \left(\mathsf{neg}\left(4 \cdot c\right)\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      12. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(a \cdot \left(\mathsf{neg}\left(c \cdot 4\right)\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      13. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(a, \left(\mathsf{neg}\left(c \cdot 4\right)\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      14. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(a, \left(c \cdot \left(\mathsf{neg}\left(4\right)\right)\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      15. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(c, \left(\mathsf{neg}\left(4\right)\right)\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      16. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(c, -4\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      17. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(c, -4\right)\right)\right)\right), b\right), \left(a \cdot \color{blue}{2}\right)\right) \]
    3. Simplified87.7%

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

    if 1.02000000000000001e-131 < b

    1. Initial program 17.3%

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

      \[\leadsto \color{blue}{-1 \cdot \frac{c}{b}} \]
    4. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto \mathsf{neg}\left(\frac{c}{b}\right) \]
      2. neg-sub0N/A

        \[\leadsto 0 - \color{blue}{\frac{c}{b}} \]
      3. --lowering--.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(0, \color{blue}{\left(\frac{c}{b}\right)}\right) \]
      4. /-lowering-/.f6483.6%

        \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(c, \color{blue}{b}\right)\right) \]
    5. Simplified83.6%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -2.15 \cdot 10^{+68}:\\ \;\;\;\;\frac{c}{b} - \frac{b}{a}\\ \mathbf{elif}\;b \leq 1.02 \cdot 10^{-131}:\\ \;\;\;\;\frac{\sqrt{b \cdot b + a \cdot \left(c \cdot -4\right)} - b}{a \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;\frac{c}{0 - b}\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 85.2% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq -1 \cdot 10^{+85}:\\ \;\;\;\;\frac{0 - b}{a}\\ \mathbf{elif}\;b \leq 1.02 \cdot 10^{-131}:\\ \;\;\;\;\frac{0.5}{a} \cdot \left(\sqrt{b \cdot b + c \cdot \left(a \cdot -4\right)} - b\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{c}{0 - b}\\ \end{array} \end{array} \]
(FPCore (a b c)
 :precision binary64
 (if (<= b -1e+85)
   (/ (- 0.0 b) a)
   (if (<= b 1.02e-131)
     (* (/ 0.5 a) (- (sqrt (+ (* b b) (* c (* a -4.0)))) b))
     (/ c (- 0.0 b)))))
double code(double a, double b, double c) {
	double tmp;
	if (b <= -1e+85) {
		tmp = (0.0 - b) / a;
	} else if (b <= 1.02e-131) {
		tmp = (0.5 / a) * (sqrt(((b * b) + (c * (a * -4.0)))) - b);
	} else {
		tmp = c / (0.0 - 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 <= (-1d+85)) then
        tmp = (0.0d0 - b) / a
    else if (b <= 1.02d-131) then
        tmp = (0.5d0 / a) * (sqrt(((b * b) + (c * (a * (-4.0d0))))) - b)
    else
        tmp = c / (0.0d0 - b)
    end if
    code = tmp
end function
public static double code(double a, double b, double c) {
	double tmp;
	if (b <= -1e+85) {
		tmp = (0.0 - b) / a;
	} else if (b <= 1.02e-131) {
		tmp = (0.5 / a) * (Math.sqrt(((b * b) + (c * (a * -4.0)))) - b);
	} else {
		tmp = c / (0.0 - b);
	}
	return tmp;
}
def code(a, b, c):
	tmp = 0
	if b <= -1e+85:
		tmp = (0.0 - b) / a
	elif b <= 1.02e-131:
		tmp = (0.5 / a) * (math.sqrt(((b * b) + (c * (a * -4.0)))) - b)
	else:
		tmp = c / (0.0 - b)
	return tmp
function code(a, b, c)
	tmp = 0.0
	if (b <= -1e+85)
		tmp = Float64(Float64(0.0 - b) / a);
	elseif (b <= 1.02e-131)
		tmp = Float64(Float64(0.5 / a) * Float64(sqrt(Float64(Float64(b * b) + Float64(c * Float64(a * -4.0)))) - b));
	else
		tmp = Float64(c / Float64(0.0 - b));
	end
	return tmp
end
function tmp_2 = code(a, b, c)
	tmp = 0.0;
	if (b <= -1e+85)
		tmp = (0.0 - b) / a;
	elseif (b <= 1.02e-131)
		tmp = (0.5 / a) * (sqrt(((b * b) + (c * (a * -4.0)))) - b);
	else
		tmp = c / (0.0 - b);
	end
	tmp_2 = tmp;
end
code[a_, b_, c_] := If[LessEqual[b, -1e+85], N[(N[(0.0 - b), $MachinePrecision] / a), $MachinePrecision], If[LessEqual[b, 1.02e-131], N[(N[(0.5 / a), $MachinePrecision] * N[(N[Sqrt[N[(N[(b * b), $MachinePrecision] + N[(c * N[(a * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision]), $MachinePrecision], N[(c / N[(0.0 - b), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;b \leq -1 \cdot 10^{+85}:\\
\;\;\;\;\frac{0 - b}{a}\\

\mathbf{elif}\;b \leq 1.02 \cdot 10^{-131}:\\
\;\;\;\;\frac{0.5}{a} \cdot \left(\sqrt{b \cdot b + c \cdot \left(a \cdot -4\right)} - b\right)\\

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


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

    1. Initial program 46.2%

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

      \[\leadsto \color{blue}{-1 \cdot \frac{b}{a}} \]
    4. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto \mathsf{neg}\left(\frac{b}{a}\right) \]
      2. distribute-neg-frac2N/A

        \[\leadsto \frac{b}{\color{blue}{\mathsf{neg}\left(a\right)}} \]
      3. mul-1-negN/A

        \[\leadsto \frac{b}{-1 \cdot \color{blue}{a}} \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(b, \color{blue}{\left(-1 \cdot a\right)}\right) \]
      5. mul-1-negN/A

        \[\leadsto \mathsf{/.f64}\left(b, \left(\mathsf{neg}\left(a\right)\right)\right) \]
      6. neg-lowering-neg.f6491.2%

        \[\leadsto \mathsf{/.f64}\left(b, \mathsf{neg.f64}\left(a\right)\right) \]
    5. Simplified91.2%

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

    if -1e85 < b < 1.02000000000000001e-131

    1. Initial program 87.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. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\left(\left(\mathsf{neg}\left(b\right)\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}\right), \color{blue}{\left(2 \cdot a\right)}\right) \]
      2. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c} + \left(\mathsf{neg}\left(b\right)\right)\right), \left(\color{blue}{2} \cdot a\right)\right) \]
      3. unsub-negN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c} - b\right), \left(\color{blue}{2} \cdot a\right)\right) \]
      4. --lowering--.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\left(\sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}\right), b\right), \left(\color{blue}{2} \cdot a\right)\right) \]
      5. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\left(b \cdot b - \left(4 \cdot a\right) \cdot c\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      6. sub-negN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\left(b \cdot b + \left(\mathsf{neg}\left(\left(4 \cdot a\right) \cdot c\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      7. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\left(b \cdot b\right), \left(\mathsf{neg}\left(\left(4 \cdot a\right) \cdot c\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(\mathsf{neg}\left(\left(4 \cdot a\right) \cdot c\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      9. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(\mathsf{neg}\left(\left(a \cdot 4\right) \cdot c\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      10. associate-*l*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(\mathsf{neg}\left(a \cdot \left(4 \cdot c\right)\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      11. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(a \cdot \left(\mathsf{neg}\left(4 \cdot c\right)\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      12. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(a \cdot \left(\mathsf{neg}\left(c \cdot 4\right)\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      13. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(a, \left(\mathsf{neg}\left(c \cdot 4\right)\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      14. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(a, \left(c \cdot \left(\mathsf{neg}\left(4\right)\right)\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      15. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(c, \left(\mathsf{neg}\left(4\right)\right)\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      16. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(c, -4\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      17. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(c, -4\right)\right)\right)\right), b\right), \left(a \cdot \color{blue}{2}\right)\right) \]
    3. Simplified86.3%

      \[\leadsto \color{blue}{\frac{\sqrt{b \cdot b + a \cdot \left(c \cdot -4\right)} - b}{a \cdot 2}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\left(b \cdot b + a \cdot \left(-4 \cdot c\right)\right)\right), b\right), \mathsf{*.f64}\left(a, 2\right)\right) \]
      2. associate-*r*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\left(b \cdot b + \left(a \cdot -4\right) \cdot c\right)\right), b\right), \mathsf{*.f64}\left(a, 2\right)\right) \]
      3. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\left(b \cdot b + \left(a \cdot \left(\mathsf{neg}\left(4\right)\right)\right) \cdot c\right)\right), b\right), \mathsf{*.f64}\left(a, 2\right)\right) \]
      4. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\left(b \cdot b + \left(\mathsf{neg}\left(a \cdot 4\right)\right) \cdot c\right)\right), b\right), \mathsf{*.f64}\left(a, 2\right)\right) \]
      5. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\left(b \cdot b + \left(\mathsf{neg}\left(4 \cdot a\right)\right) \cdot c\right)\right), b\right), \mathsf{*.f64}\left(a, 2\right)\right) \]
      6. cancel-sign-sub-invN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\left(b \cdot b - \left(4 \cdot a\right) \cdot c\right)\right), b\right), \mathsf{*.f64}\left(a, 2\right)\right) \]
      7. --lowering--.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(\left(b \cdot b\right), \left(\left(4 \cdot a\right) \cdot c\right)\right)\right), b\right), \mathsf{*.f64}\left(a, 2\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(\left(4 \cdot a\right) \cdot c\right)\right)\right), b\right), \mathsf{*.f64}\left(a, 2\right)\right) \]
      9. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(\left(4 \cdot a\right), c\right)\right)\right), b\right), \mathsf{*.f64}\left(a, 2\right)\right) \]
      10. *-lowering-*.f6487.2%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, a\right), c\right)\right)\right), b\right), \mathsf{*.f64}\left(a, 2\right)\right) \]
    6. Applied egg-rr87.2%

      \[\leadsto \frac{\sqrt{\color{blue}{b \cdot b - \left(4 \cdot a\right) \cdot c}} - b}{a \cdot 2} \]
    7. Step-by-step derivation
      1. sub-negN/A

        \[\leadsto \frac{\sqrt{b \cdot b + \left(\mathsf{neg}\left(\left(4 \cdot a\right) \cdot c\right)\right)} - b}{a \cdot 2} \]
      2. associate-*l*N/A

        \[\leadsto \frac{\sqrt{b \cdot b + \left(\mathsf{neg}\left(4 \cdot \left(a \cdot c\right)\right)\right)} - b}{a \cdot 2} \]
      3. distribute-lft-neg-inN/A

        \[\leadsto \frac{\sqrt{b \cdot b + \left(\mathsf{neg}\left(4\right)\right) \cdot \left(a \cdot c\right)} - b}{a \cdot 2} \]
      4. metadata-evalN/A

        \[\leadsto \frac{\sqrt{b \cdot b + -4 \cdot \left(a \cdot c\right)} - b}{a \cdot 2} \]
      5. *-commutativeN/A

        \[\leadsto \frac{\sqrt{b \cdot b + \left(a \cdot c\right) \cdot -4} - b}{a \cdot 2} \]
      6. associate-*r*N/A

        \[\leadsto \frac{\sqrt{b \cdot b + a \cdot \left(c \cdot -4\right)} - b}{a \cdot 2} \]
      7. remove-double-divN/A

        \[\leadsto \frac{\sqrt{\frac{1}{\frac{1}{b \cdot b + a \cdot \left(c \cdot -4\right)}}} - b}{a \cdot 2} \]
      8. clear-numN/A

        \[\leadsto \frac{1}{\color{blue}{\frac{a \cdot 2}{\sqrt{\frac{1}{\frac{1}{b \cdot b + a \cdot \left(c \cdot -4\right)}}} - b}}} \]
      9. associate-/r/N/A

        \[\leadsto \frac{1}{a \cdot 2} \cdot \color{blue}{\left(\sqrt{\frac{1}{\frac{1}{b \cdot b + a \cdot \left(c \cdot -4\right)}}} - b\right)} \]
      10. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{1}{a \cdot 2}\right), \color{blue}{\left(\sqrt{\frac{1}{\frac{1}{b \cdot b + a \cdot \left(c \cdot -4\right)}}} - b\right)}\right) \]
      11. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{1}{2 \cdot a}\right), \left(\sqrt{\frac{1}{\frac{1}{b \cdot b + a \cdot \left(c \cdot -4\right)}}} - b\right)\right) \]
      12. associate-/r*N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{\frac{1}{2}}{a}\right), \left(\color{blue}{\sqrt{\frac{1}{\frac{1}{b \cdot b + a \cdot \left(c \cdot -4\right)}}}} - b\right)\right) \]
      13. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{\frac{1}{2}}{a}\right), \left(\sqrt{\color{blue}{\frac{1}{\frac{1}{b \cdot b + a \cdot \left(c \cdot -4\right)}}}} - b\right)\right) \]
      14. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\frac{1}{2}, a\right), \left(\color{blue}{\sqrt{\frac{1}{\frac{1}{b \cdot b + a \cdot \left(c \cdot -4\right)}}}} - b\right)\right) \]
      15. --lowering--.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\frac{1}{2}, a\right), \mathsf{\_.f64}\left(\left(\sqrt{\frac{1}{\frac{1}{b \cdot b + a \cdot \left(c \cdot -4\right)}}}\right), \color{blue}{b}\right)\right) \]
    8. Applied egg-rr87.0%

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

    if 1.02000000000000001e-131 < b

    1. Initial program 17.3%

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

      \[\leadsto \color{blue}{-1 \cdot \frac{c}{b}} \]
    4. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto \mathsf{neg}\left(\frac{c}{b}\right) \]
      2. neg-sub0N/A

        \[\leadsto 0 - \color{blue}{\frac{c}{b}} \]
      3. --lowering--.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(0, \color{blue}{\left(\frac{c}{b}\right)}\right) \]
      4. /-lowering-/.f6483.6%

        \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(c, \color{blue}{b}\right)\right) \]
    5. Simplified83.6%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -1 \cdot 10^{+85}:\\ \;\;\;\;\frac{0 - b}{a}\\ \mathbf{elif}\;b \leq 1.02 \cdot 10^{-131}:\\ \;\;\;\;\frac{0.5}{a} \cdot \left(\sqrt{b \cdot b + c \cdot \left(a \cdot -4\right)} - b\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{c}{0 - b}\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 84.7% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq -1.25 \cdot 10^{+36}:\\ \;\;\;\;\frac{c}{b} - \frac{b}{a}\\ \mathbf{elif}\;b \leq 1.02 \cdot 10^{-131}:\\ \;\;\;\;\left(\sqrt{b \cdot b + a \cdot \left(c \cdot -4\right)} - b\right) \cdot \frac{0.5}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{c}{0 - b}\\ \end{array} \end{array} \]
(FPCore (a b c)
 :precision binary64
 (if (<= b -1.25e+36)
   (- (/ c b) (/ b a))
   (if (<= b 1.02e-131)
     (* (- (sqrt (+ (* b b) (* a (* c -4.0)))) b) (/ 0.5 a))
     (/ c (- 0.0 b)))))
double code(double a, double b, double c) {
	double tmp;
	if (b <= -1.25e+36) {
		tmp = (c / b) - (b / a);
	} else if (b <= 1.02e-131) {
		tmp = (sqrt(((b * b) + (a * (c * -4.0)))) - b) * (0.5 / a);
	} else {
		tmp = c / (0.0 - 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+36)) then
        tmp = (c / b) - (b / a)
    else if (b <= 1.02d-131) then
        tmp = (sqrt(((b * b) + (a * (c * (-4.0d0))))) - b) * (0.5d0 / a)
    else
        tmp = c / (0.0d0 - b)
    end if
    code = tmp
end function
public static double code(double a, double b, double c) {
	double tmp;
	if (b <= -1.25e+36) {
		tmp = (c / b) - (b / a);
	} else if (b <= 1.02e-131) {
		tmp = (Math.sqrt(((b * b) + (a * (c * -4.0)))) - b) * (0.5 / a);
	} else {
		tmp = c / (0.0 - b);
	}
	return tmp;
}
def code(a, b, c):
	tmp = 0
	if b <= -1.25e+36:
		tmp = (c / b) - (b / a)
	elif b <= 1.02e-131:
		tmp = (math.sqrt(((b * b) + (a * (c * -4.0)))) - b) * (0.5 / a)
	else:
		tmp = c / (0.0 - b)
	return tmp
function code(a, b, c)
	tmp = 0.0
	if (b <= -1.25e+36)
		tmp = Float64(Float64(c / b) - Float64(b / a));
	elseif (b <= 1.02e-131)
		tmp = Float64(Float64(sqrt(Float64(Float64(b * b) + Float64(a * Float64(c * -4.0)))) - b) * Float64(0.5 / a));
	else
		tmp = Float64(c / Float64(0.0 - b));
	end
	return tmp
end
function tmp_2 = code(a, b, c)
	tmp = 0.0;
	if (b <= -1.25e+36)
		tmp = (c / b) - (b / a);
	elseif (b <= 1.02e-131)
		tmp = (sqrt(((b * b) + (a * (c * -4.0)))) - b) * (0.5 / a);
	else
		tmp = c / (0.0 - b);
	end
	tmp_2 = tmp;
end
code[a_, b_, c_] := If[LessEqual[b, -1.25e+36], N[(N[(c / b), $MachinePrecision] - N[(b / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 1.02e-131], N[(N[(N[Sqrt[N[(N[(b * b), $MachinePrecision] + N[(a * N[(c * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision] * N[(0.5 / a), $MachinePrecision]), $MachinePrecision], N[(c / N[(0.0 - b), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

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

\mathbf{elif}\;b \leq 1.02 \cdot 10^{-131}:\\
\;\;\;\;\left(\sqrt{b \cdot b + a \cdot \left(c \cdot -4\right)} - b\right) \cdot \frac{0.5}{a}\\

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


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

    1. Initial program 52.7%

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

      \[\leadsto \color{blue}{-1 \cdot \left(b \cdot \left(-1 \cdot \frac{c}{{b}^{2}} + \frac{1}{a}\right)\right)} \]
    4. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto \mathsf{neg}\left(b \cdot \left(-1 \cdot \frac{c}{{b}^{2}} + \frac{1}{a}\right)\right) \]
      2. *-commutativeN/A

        \[\leadsto \mathsf{neg}\left(\left(-1 \cdot \frac{c}{{b}^{2}} + \frac{1}{a}\right) \cdot b\right) \]
      3. distribute-rgt-neg-inN/A

        \[\leadsto \left(-1 \cdot \frac{c}{{b}^{2}} + \frac{1}{a}\right) \cdot \color{blue}{\left(\mathsf{neg}\left(b\right)\right)} \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(-1 \cdot \frac{c}{{b}^{2}} + \frac{1}{a}\right), \color{blue}{\left(\mathsf{neg}\left(b\right)\right)}\right) \]
      5. +-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{1}{a} + -1 \cdot \frac{c}{{b}^{2}}\right), \left(\mathsf{neg}\left(\color{blue}{b}\right)\right)\right) \]
      6. mul-1-negN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{1}{a} + \left(\mathsf{neg}\left(\frac{c}{{b}^{2}}\right)\right)\right), \left(\mathsf{neg}\left(b\right)\right)\right) \]
      7. unsub-negN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{1}{a} - \frac{c}{{b}^{2}}\right), \left(\mathsf{neg}\left(\color{blue}{b}\right)\right)\right) \]
      8. --lowering--.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\left(\frac{1}{a}\right), \left(\frac{c}{{b}^{2}}\right)\right), \left(\mathsf{neg}\left(\color{blue}{b}\right)\right)\right) \]
      9. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, a\right), \left(\frac{c}{{b}^{2}}\right)\right), \left(\mathsf{neg}\left(b\right)\right)\right) \]
      10. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, a\right), \mathsf{/.f64}\left(c, \left({b}^{2}\right)\right)\right), \left(\mathsf{neg}\left(b\right)\right)\right) \]
      11. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, a\right), \mathsf{/.f64}\left(c, \left(b \cdot b\right)\right)\right), \left(\mathsf{neg}\left(b\right)\right)\right) \]
      12. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, a\right), \mathsf{/.f64}\left(c, \mathsf{*.f64}\left(b, b\right)\right)\right), \left(\mathsf{neg}\left(b\right)\right)\right) \]
      13. neg-sub0N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, a\right), \mathsf{/.f64}\left(c, \mathsf{*.f64}\left(b, b\right)\right)\right), \left(0 - \color{blue}{b}\right)\right) \]
      14. --lowering--.f6490.6%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, a\right), \mathsf{/.f64}\left(c, \mathsf{*.f64}\left(b, b\right)\right)\right), \mathsf{\_.f64}\left(0, \color{blue}{b}\right)\right) \]
    5. Simplified90.6%

      \[\leadsto \color{blue}{\left(\frac{1}{a} - \frac{c}{b \cdot b}\right) \cdot \left(0 - b\right)} \]
    6. Taylor expanded in a around inf

      \[\leadsto \color{blue}{-1 \cdot \frac{b}{a} + \frac{c}{b}} \]
    7. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto \frac{c}{b} + \color{blue}{-1 \cdot \frac{b}{a}} \]
      2. mul-1-negN/A

        \[\leadsto \frac{c}{b} + \left(\mathsf{neg}\left(\frac{b}{a}\right)\right) \]
      3. unsub-negN/A

        \[\leadsto \frac{c}{b} - \color{blue}{\frac{b}{a}} \]
      4. --lowering--.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\left(\frac{c}{b}\right), \color{blue}{\left(\frac{b}{a}\right)}\right) \]
      5. /-lowering-/.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(c, b\right), \left(\frac{\color{blue}{b}}{a}\right)\right) \]
      6. /-lowering-/.f6490.9%

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(c, b\right), \mathsf{/.f64}\left(b, \color{blue}{a}\right)\right) \]
    8. Simplified90.9%

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

    if -1.24999999999999994e36 < b < 1.02000000000000001e-131

    1. Initial program 86.7%

      \[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. clear-numN/A

        \[\leadsto \frac{1}{\color{blue}{\frac{2 \cdot a}{\left(\mathsf{neg}\left(b\right)\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}}} \]
      2. *-commutativeN/A

        \[\leadsto \frac{1}{\frac{a \cdot 2}{\color{blue}{\left(\mathsf{neg}\left(b\right)\right)} + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}} \]
      3. associate-/r/N/A

        \[\leadsto \frac{1}{a \cdot 2} \cdot \color{blue}{\left(\left(\mathsf{neg}\left(b\right)\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}\right)} \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{1}{a \cdot 2}\right), \color{blue}{\left(\left(\mathsf{neg}\left(b\right)\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}\right)}\right) \]
      5. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{1}{2 \cdot a}\right), \left(\left(\mathsf{neg}\left(b\right)\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}\right)\right) \]
      6. associate-/r*N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{\frac{1}{2}}{a}\right), \left(\color{blue}{\left(\mathsf{neg}\left(b\right)\right)} + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}\right)\right) \]
      7. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{\frac{1}{2}}{a}\right), \left(\left(\mathsf{neg}\left(\color{blue}{b}\right)\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}\right)\right) \]
      8. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\frac{1}{2}, a\right), \left(\color{blue}{\left(\mathsf{neg}\left(b\right)\right)} + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}\right)\right) \]
      9. +-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\frac{1}{2}, a\right), \left(\sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c} + \color{blue}{\left(\mathsf{neg}\left(b\right)\right)}\right)\right) \]
      10. unsub-negN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\frac{1}{2}, a\right), \left(\sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c} - \color{blue}{b}\right)\right) \]
      11. --lowering--.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\frac{1}{2}, a\right), \mathsf{\_.f64}\left(\left(\sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}\right), \color{blue}{b}\right)\right) \]
    4. Applied egg-rr86.5%

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

    if 1.02000000000000001e-131 < b

    1. Initial program 17.3%

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

      \[\leadsto \color{blue}{-1 \cdot \frac{c}{b}} \]
    4. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto \mathsf{neg}\left(\frac{c}{b}\right) \]
      2. neg-sub0N/A

        \[\leadsto 0 - \color{blue}{\frac{c}{b}} \]
      3. --lowering--.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(0, \color{blue}{\left(\frac{c}{b}\right)}\right) \]
      4. /-lowering-/.f6483.6%

        \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(c, \color{blue}{b}\right)\right) \]
    5. Simplified83.6%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -1.25 \cdot 10^{+36}:\\ \;\;\;\;\frac{c}{b} - \frac{b}{a}\\ \mathbf{elif}\;b \leq 1.02 \cdot 10^{-131}:\\ \;\;\;\;\left(\sqrt{b \cdot b + a \cdot \left(c \cdot -4\right)} - b\right) \cdot \frac{0.5}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{c}{0 - b}\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 80.8% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq -1.25 \cdot 10^{-33}:\\ \;\;\;\;\frac{c}{b} - \frac{b}{a}\\ \mathbf{elif}\;b \leq 1.02 \cdot 10^{-131}:\\ \;\;\;\;\frac{2 \cdot \sqrt{0 - a \cdot c} - b}{a \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;\frac{c}{0 - b}\\ \end{array} \end{array} \]
(FPCore (a b c)
 :precision binary64
 (if (<= b -1.25e-33)
   (- (/ c b) (/ b a))
   (if (<= b 1.02e-131)
     (/ (- (* 2.0 (sqrt (- 0.0 (* a c)))) b) (* a 2.0))
     (/ c (- 0.0 b)))))
double code(double a, double b, double c) {
	double tmp;
	if (b <= -1.25e-33) {
		tmp = (c / b) - (b / a);
	} else if (b <= 1.02e-131) {
		tmp = ((2.0 * sqrt((0.0 - (a * c)))) - b) / (a * 2.0);
	} else {
		tmp = c / (0.0 - 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-33)) then
        tmp = (c / b) - (b / a)
    else if (b <= 1.02d-131) then
        tmp = ((2.0d0 * sqrt((0.0d0 - (a * c)))) - b) / (a * 2.0d0)
    else
        tmp = c / (0.0d0 - b)
    end if
    code = tmp
end function
public static double code(double a, double b, double c) {
	double tmp;
	if (b <= -1.25e-33) {
		tmp = (c / b) - (b / a);
	} else if (b <= 1.02e-131) {
		tmp = ((2.0 * Math.sqrt((0.0 - (a * c)))) - b) / (a * 2.0);
	} else {
		tmp = c / (0.0 - b);
	}
	return tmp;
}
def code(a, b, c):
	tmp = 0
	if b <= -1.25e-33:
		tmp = (c / b) - (b / a)
	elif b <= 1.02e-131:
		tmp = ((2.0 * math.sqrt((0.0 - (a * c)))) - b) / (a * 2.0)
	else:
		tmp = c / (0.0 - b)
	return tmp
function code(a, b, c)
	tmp = 0.0
	if (b <= -1.25e-33)
		tmp = Float64(Float64(c / b) - Float64(b / a));
	elseif (b <= 1.02e-131)
		tmp = Float64(Float64(Float64(2.0 * sqrt(Float64(0.0 - Float64(a * c)))) - b) / Float64(a * 2.0));
	else
		tmp = Float64(c / Float64(0.0 - b));
	end
	return tmp
end
function tmp_2 = code(a, b, c)
	tmp = 0.0;
	if (b <= -1.25e-33)
		tmp = (c / b) - (b / a);
	elseif (b <= 1.02e-131)
		tmp = ((2.0 * sqrt((0.0 - (a * c)))) - b) / (a * 2.0);
	else
		tmp = c / (0.0 - b);
	end
	tmp_2 = tmp;
end
code[a_, b_, c_] := If[LessEqual[b, -1.25e-33], N[(N[(c / b), $MachinePrecision] - N[(b / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 1.02e-131], N[(N[(N[(2.0 * N[Sqrt[N[(0.0 - N[(a * c), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - b), $MachinePrecision] / N[(a * 2.0), $MachinePrecision]), $MachinePrecision], N[(c / N[(0.0 - b), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

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

\mathbf{elif}\;b \leq 1.02 \cdot 10^{-131}:\\
\;\;\;\;\frac{2 \cdot \sqrt{0 - a \cdot c} - b}{a \cdot 2}\\

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


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

    1. Initial program 61.7%

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

      \[\leadsto \color{blue}{-1 \cdot \left(b \cdot \left(-1 \cdot \frac{c}{{b}^{2}} + \frac{1}{a}\right)\right)} \]
    4. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto \mathsf{neg}\left(b \cdot \left(-1 \cdot \frac{c}{{b}^{2}} + \frac{1}{a}\right)\right) \]
      2. *-commutativeN/A

        \[\leadsto \mathsf{neg}\left(\left(-1 \cdot \frac{c}{{b}^{2}} + \frac{1}{a}\right) \cdot b\right) \]
      3. distribute-rgt-neg-inN/A

        \[\leadsto \left(-1 \cdot \frac{c}{{b}^{2}} + \frac{1}{a}\right) \cdot \color{blue}{\left(\mathsf{neg}\left(b\right)\right)} \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(-1 \cdot \frac{c}{{b}^{2}} + \frac{1}{a}\right), \color{blue}{\left(\mathsf{neg}\left(b\right)\right)}\right) \]
      5. +-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{1}{a} + -1 \cdot \frac{c}{{b}^{2}}\right), \left(\mathsf{neg}\left(\color{blue}{b}\right)\right)\right) \]
      6. mul-1-negN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{1}{a} + \left(\mathsf{neg}\left(\frac{c}{{b}^{2}}\right)\right)\right), \left(\mathsf{neg}\left(b\right)\right)\right) \]
      7. unsub-negN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{1}{a} - \frac{c}{{b}^{2}}\right), \left(\mathsf{neg}\left(\color{blue}{b}\right)\right)\right) \]
      8. --lowering--.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\left(\frac{1}{a}\right), \left(\frac{c}{{b}^{2}}\right)\right), \left(\mathsf{neg}\left(\color{blue}{b}\right)\right)\right) \]
      9. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, a\right), \left(\frac{c}{{b}^{2}}\right)\right), \left(\mathsf{neg}\left(b\right)\right)\right) \]
      10. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, a\right), \mathsf{/.f64}\left(c, \left({b}^{2}\right)\right)\right), \left(\mathsf{neg}\left(b\right)\right)\right) \]
      11. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, a\right), \mathsf{/.f64}\left(c, \left(b \cdot b\right)\right)\right), \left(\mathsf{neg}\left(b\right)\right)\right) \]
      12. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, a\right), \mathsf{/.f64}\left(c, \mathsf{*.f64}\left(b, b\right)\right)\right), \left(\mathsf{neg}\left(b\right)\right)\right) \]
      13. neg-sub0N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, a\right), \mathsf{/.f64}\left(c, \mathsf{*.f64}\left(b, b\right)\right)\right), \left(0 - \color{blue}{b}\right)\right) \]
      14. --lowering--.f6489.6%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, a\right), \mathsf{/.f64}\left(c, \mathsf{*.f64}\left(b, b\right)\right)\right), \mathsf{\_.f64}\left(0, \color{blue}{b}\right)\right) \]
    5. Simplified89.6%

      \[\leadsto \color{blue}{\left(\frac{1}{a} - \frac{c}{b \cdot b}\right) \cdot \left(0 - b\right)} \]
    6. Taylor expanded in a around inf

      \[\leadsto \color{blue}{-1 \cdot \frac{b}{a} + \frac{c}{b}} \]
    7. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto \frac{c}{b} + \color{blue}{-1 \cdot \frac{b}{a}} \]
      2. mul-1-negN/A

        \[\leadsto \frac{c}{b} + \left(\mathsf{neg}\left(\frac{b}{a}\right)\right) \]
      3. unsub-negN/A

        \[\leadsto \frac{c}{b} - \color{blue}{\frac{b}{a}} \]
      4. --lowering--.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\left(\frac{c}{b}\right), \color{blue}{\left(\frac{b}{a}\right)}\right) \]
      5. /-lowering-/.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(c, b\right), \left(\frac{\color{blue}{b}}{a}\right)\right) \]
      6. /-lowering-/.f6489.8%

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(c, b\right), \mathsf{/.f64}\left(b, \color{blue}{a}\right)\right) \]
    8. Simplified89.8%

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

    if -1.25000000000000007e-33 < b < 1.02000000000000001e-131

    1. Initial program 84.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. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\left(\left(\mathsf{neg}\left(b\right)\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}\right), \color{blue}{\left(2 \cdot a\right)}\right) \]
      2. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c} + \left(\mathsf{neg}\left(b\right)\right)\right), \left(\color{blue}{2} \cdot a\right)\right) \]
      3. unsub-negN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c} - b\right), \left(\color{blue}{2} \cdot a\right)\right) \]
      4. --lowering--.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\left(\sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}\right), b\right), \left(\color{blue}{2} \cdot a\right)\right) \]
      5. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\left(b \cdot b - \left(4 \cdot a\right) \cdot c\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      6. sub-negN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\left(b \cdot b + \left(\mathsf{neg}\left(\left(4 \cdot a\right) \cdot c\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      7. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\left(b \cdot b\right), \left(\mathsf{neg}\left(\left(4 \cdot a\right) \cdot c\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(\mathsf{neg}\left(\left(4 \cdot a\right) \cdot c\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      9. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(\mathsf{neg}\left(\left(a \cdot 4\right) \cdot c\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      10. associate-*l*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(\mathsf{neg}\left(a \cdot \left(4 \cdot c\right)\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      11. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(a \cdot \left(\mathsf{neg}\left(4 \cdot c\right)\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      12. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(a \cdot \left(\mathsf{neg}\left(c \cdot 4\right)\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      13. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(a, \left(\mathsf{neg}\left(c \cdot 4\right)\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      14. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(a, \left(c \cdot \left(\mathsf{neg}\left(4\right)\right)\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      15. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(c, \left(\mathsf{neg}\left(4\right)\right)\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      16. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(c, -4\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      17. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(c, -4\right)\right)\right)\right), b\right), \left(a \cdot \color{blue}{2}\right)\right) \]
    3. Simplified84.2%

      \[\leadsto \color{blue}{\frac{\sqrt{b \cdot b + a \cdot \left(c \cdot -4\right)} - b}{a \cdot 2}} \]
    4. Add Preprocessing
    5. Taylor expanded in b around 0

      \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\color{blue}{\left(-4 \cdot \left(a \cdot c\right)\right)}\right), b\right), \mathsf{*.f64}\left(a, 2\right)\right) \]
    6. Step-by-step derivation
      1. associate-*r*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\left(\left(-4 \cdot a\right) \cdot c\right)\right), b\right), \mathsf{*.f64}\left(a, 2\right)\right) \]
      2. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\left(c \cdot \left(-4 \cdot a\right)\right)\right), b\right), \mathsf{*.f64}\left(a, 2\right)\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(c, \left(-4 \cdot a\right)\right)\right), b\right), \mathsf{*.f64}\left(a, 2\right)\right) \]
      4. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(c, \left(a \cdot -4\right)\right)\right), b\right), \mathsf{*.f64}\left(a, 2\right)\right) \]
      5. *-lowering-*.f6480.6%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(c, \mathsf{*.f64}\left(a, -4\right)\right)\right), b\right), \mathsf{*.f64}\left(a, 2\right)\right) \]
    7. Simplified80.6%

      \[\leadsto \frac{\sqrt{\color{blue}{c \cdot \left(a \cdot -4\right)}} - b}{a \cdot 2} \]
    8. Step-by-step derivation
      1. associate-*r*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\left(\sqrt{\left(c \cdot a\right) \cdot -4}\right), b\right), \mathsf{*.f64}\left(a, 2\right)\right) \]
      2. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\left(\sqrt{\left(a \cdot c\right) \cdot -4}\right), b\right), \mathsf{*.f64}\left(a, 2\right)\right) \]
      3. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\left(\sqrt{-4 \cdot \left(a \cdot c\right)}\right), b\right), \mathsf{*.f64}\left(a, 2\right)\right) \]
      4. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\left(\sqrt{\left(\mathsf{neg}\left(4\right)\right) \cdot \left(a \cdot c\right)}\right), b\right), \mathsf{*.f64}\left(a, 2\right)\right) \]
      5. distribute-lft-neg-inN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\left(\sqrt{\mathsf{neg}\left(4 \cdot \left(a \cdot c\right)\right)}\right), b\right), \mathsf{*.f64}\left(a, 2\right)\right) \]
      6. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\left(\sqrt{4 \cdot \left(\mathsf{neg}\left(a \cdot c\right)\right)}\right), b\right), \mathsf{*.f64}\left(a, 2\right)\right) \]
      7. sqrt-prodN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\left(\sqrt{4} \cdot \sqrt{\mathsf{neg}\left(a \cdot c\right)}\right), b\right), \mathsf{*.f64}\left(a, 2\right)\right) \]
      8. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\left(2 \cdot \sqrt{\mathsf{neg}\left(a \cdot c\right)}\right), b\right), \mathsf{*.f64}\left(a, 2\right)\right) \]
      9. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(2, \left(\sqrt{\mathsf{neg}\left(a \cdot c\right)}\right)\right), b\right), \mathsf{*.f64}\left(a, 2\right)\right) \]
      10. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(2, \mathsf{sqrt.f64}\left(\left(\mathsf{neg}\left(a \cdot c\right)\right)\right)\right), b\right), \mathsf{*.f64}\left(a, 2\right)\right) \]
      11. neg-lowering-neg.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(2, \mathsf{sqrt.f64}\left(\mathsf{neg.f64}\left(\left(a \cdot c\right)\right)\right)\right), b\right), \mathsf{*.f64}\left(a, 2\right)\right) \]
      12. *-lowering-*.f6482.0%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(2, \mathsf{sqrt.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(a, c\right)\right)\right)\right), b\right), \mathsf{*.f64}\left(a, 2\right)\right) \]
    9. Applied egg-rr82.0%

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

    if 1.02000000000000001e-131 < b

    1. Initial program 17.3%

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

      \[\leadsto \color{blue}{-1 \cdot \frac{c}{b}} \]
    4. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto \mathsf{neg}\left(\frac{c}{b}\right) \]
      2. neg-sub0N/A

        \[\leadsto 0 - \color{blue}{\frac{c}{b}} \]
      3. --lowering--.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(0, \color{blue}{\left(\frac{c}{b}\right)}\right) \]
      4. /-lowering-/.f6483.6%

        \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(c, \color{blue}{b}\right)\right) \]
    5. Simplified83.6%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -1.25 \cdot 10^{-33}:\\ \;\;\;\;\frac{c}{b} - \frac{b}{a}\\ \mathbf{elif}\;b \leq 1.02 \cdot 10^{-131}:\\ \;\;\;\;\frac{2 \cdot \sqrt{0 - a \cdot c} - b}{a \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;\frac{c}{0 - b}\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 80.7% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq -2 \cdot 10^{-35}:\\ \;\;\;\;\frac{c}{b} - \frac{b}{a}\\ \mathbf{elif}\;b \leq 1.02 \cdot 10^{-131}:\\ \;\;\;\;\frac{{\left(\frac{-0.25}{a \cdot c}\right)}^{-0.5} - b}{a \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;\frac{c}{0 - b}\\ \end{array} \end{array} \]
(FPCore (a b c)
 :precision binary64
 (if (<= b -2e-35)
   (- (/ c b) (/ b a))
   (if (<= b 1.02e-131)
     (/ (- (pow (/ -0.25 (* a c)) -0.5) b) (* a 2.0))
     (/ c (- 0.0 b)))))
double code(double a, double b, double c) {
	double tmp;
	if (b <= -2e-35) {
		tmp = (c / b) - (b / a);
	} else if (b <= 1.02e-131) {
		tmp = (pow((-0.25 / (a * c)), -0.5) - b) / (a * 2.0);
	} else {
		tmp = c / (0.0 - 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-35)) then
        tmp = (c / b) - (b / a)
    else if (b <= 1.02d-131) then
        tmp = ((((-0.25d0) / (a * c)) ** (-0.5d0)) - b) / (a * 2.0d0)
    else
        tmp = c / (0.0d0 - b)
    end if
    code = tmp
end function
public static double code(double a, double b, double c) {
	double tmp;
	if (b <= -2e-35) {
		tmp = (c / b) - (b / a);
	} else if (b <= 1.02e-131) {
		tmp = (Math.pow((-0.25 / (a * c)), -0.5) - b) / (a * 2.0);
	} else {
		tmp = c / (0.0 - b);
	}
	return tmp;
}
def code(a, b, c):
	tmp = 0
	if b <= -2e-35:
		tmp = (c / b) - (b / a)
	elif b <= 1.02e-131:
		tmp = (math.pow((-0.25 / (a * c)), -0.5) - b) / (a * 2.0)
	else:
		tmp = c / (0.0 - b)
	return tmp
function code(a, b, c)
	tmp = 0.0
	if (b <= -2e-35)
		tmp = Float64(Float64(c / b) - Float64(b / a));
	elseif (b <= 1.02e-131)
		tmp = Float64(Float64((Float64(-0.25 / Float64(a * c)) ^ -0.5) - b) / Float64(a * 2.0));
	else
		tmp = Float64(c / Float64(0.0 - b));
	end
	return tmp
end
function tmp_2 = code(a, b, c)
	tmp = 0.0;
	if (b <= -2e-35)
		tmp = (c / b) - (b / a);
	elseif (b <= 1.02e-131)
		tmp = (((-0.25 / (a * c)) ^ -0.5) - b) / (a * 2.0);
	else
		tmp = c / (0.0 - b);
	end
	tmp_2 = tmp;
end
code[a_, b_, c_] := If[LessEqual[b, -2e-35], N[(N[(c / b), $MachinePrecision] - N[(b / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 1.02e-131], N[(N[(N[Power[N[(-0.25 / N[(a * c), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] - b), $MachinePrecision] / N[(a * 2.0), $MachinePrecision]), $MachinePrecision], N[(c / N[(0.0 - b), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

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

\mathbf{elif}\;b \leq 1.02 \cdot 10^{-131}:\\
\;\;\;\;\frac{{\left(\frac{-0.25}{a \cdot c}\right)}^{-0.5} - b}{a \cdot 2}\\

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


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

    1. Initial program 61.7%

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

      \[\leadsto \color{blue}{-1 \cdot \left(b \cdot \left(-1 \cdot \frac{c}{{b}^{2}} + \frac{1}{a}\right)\right)} \]
    4. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto \mathsf{neg}\left(b \cdot \left(-1 \cdot \frac{c}{{b}^{2}} + \frac{1}{a}\right)\right) \]
      2. *-commutativeN/A

        \[\leadsto \mathsf{neg}\left(\left(-1 \cdot \frac{c}{{b}^{2}} + \frac{1}{a}\right) \cdot b\right) \]
      3. distribute-rgt-neg-inN/A

        \[\leadsto \left(-1 \cdot \frac{c}{{b}^{2}} + \frac{1}{a}\right) \cdot \color{blue}{\left(\mathsf{neg}\left(b\right)\right)} \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(-1 \cdot \frac{c}{{b}^{2}} + \frac{1}{a}\right), \color{blue}{\left(\mathsf{neg}\left(b\right)\right)}\right) \]
      5. +-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{1}{a} + -1 \cdot \frac{c}{{b}^{2}}\right), \left(\mathsf{neg}\left(\color{blue}{b}\right)\right)\right) \]
      6. mul-1-negN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{1}{a} + \left(\mathsf{neg}\left(\frac{c}{{b}^{2}}\right)\right)\right), \left(\mathsf{neg}\left(b\right)\right)\right) \]
      7. unsub-negN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{1}{a} - \frac{c}{{b}^{2}}\right), \left(\mathsf{neg}\left(\color{blue}{b}\right)\right)\right) \]
      8. --lowering--.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\left(\frac{1}{a}\right), \left(\frac{c}{{b}^{2}}\right)\right), \left(\mathsf{neg}\left(\color{blue}{b}\right)\right)\right) \]
      9. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, a\right), \left(\frac{c}{{b}^{2}}\right)\right), \left(\mathsf{neg}\left(b\right)\right)\right) \]
      10. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, a\right), \mathsf{/.f64}\left(c, \left({b}^{2}\right)\right)\right), \left(\mathsf{neg}\left(b\right)\right)\right) \]
      11. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, a\right), \mathsf{/.f64}\left(c, \left(b \cdot b\right)\right)\right), \left(\mathsf{neg}\left(b\right)\right)\right) \]
      12. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, a\right), \mathsf{/.f64}\left(c, \mathsf{*.f64}\left(b, b\right)\right)\right), \left(\mathsf{neg}\left(b\right)\right)\right) \]
      13. neg-sub0N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, a\right), \mathsf{/.f64}\left(c, \mathsf{*.f64}\left(b, b\right)\right)\right), \left(0 - \color{blue}{b}\right)\right) \]
      14. --lowering--.f6489.6%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, a\right), \mathsf{/.f64}\left(c, \mathsf{*.f64}\left(b, b\right)\right)\right), \mathsf{\_.f64}\left(0, \color{blue}{b}\right)\right) \]
    5. Simplified89.6%

      \[\leadsto \color{blue}{\left(\frac{1}{a} - \frac{c}{b \cdot b}\right) \cdot \left(0 - b\right)} \]
    6. Taylor expanded in a around inf

      \[\leadsto \color{blue}{-1 \cdot \frac{b}{a} + \frac{c}{b}} \]
    7. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto \frac{c}{b} + \color{blue}{-1 \cdot \frac{b}{a}} \]
      2. mul-1-negN/A

        \[\leadsto \frac{c}{b} + \left(\mathsf{neg}\left(\frac{b}{a}\right)\right) \]
      3. unsub-negN/A

        \[\leadsto \frac{c}{b} - \color{blue}{\frac{b}{a}} \]
      4. --lowering--.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\left(\frac{c}{b}\right), \color{blue}{\left(\frac{b}{a}\right)}\right) \]
      5. /-lowering-/.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(c, b\right), \left(\frac{\color{blue}{b}}{a}\right)\right) \]
      6. /-lowering-/.f6489.8%

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(c, b\right), \mathsf{/.f64}\left(b, \color{blue}{a}\right)\right) \]
    8. Simplified89.8%

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

    if -2.00000000000000002e-35 < b < 1.02000000000000001e-131

    1. Initial program 84.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. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\left(\left(\mathsf{neg}\left(b\right)\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}\right), \color{blue}{\left(2 \cdot a\right)}\right) \]
      2. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c} + \left(\mathsf{neg}\left(b\right)\right)\right), \left(\color{blue}{2} \cdot a\right)\right) \]
      3. unsub-negN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c} - b\right), \left(\color{blue}{2} \cdot a\right)\right) \]
      4. --lowering--.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\left(\sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}\right), b\right), \left(\color{blue}{2} \cdot a\right)\right) \]
      5. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\left(b \cdot b - \left(4 \cdot a\right) \cdot c\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      6. sub-negN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\left(b \cdot b + \left(\mathsf{neg}\left(\left(4 \cdot a\right) \cdot c\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      7. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\left(b \cdot b\right), \left(\mathsf{neg}\left(\left(4 \cdot a\right) \cdot c\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(\mathsf{neg}\left(\left(4 \cdot a\right) \cdot c\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      9. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(\mathsf{neg}\left(\left(a \cdot 4\right) \cdot c\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      10. associate-*l*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(\mathsf{neg}\left(a \cdot \left(4 \cdot c\right)\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      11. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(a \cdot \left(\mathsf{neg}\left(4 \cdot c\right)\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      12. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(a \cdot \left(\mathsf{neg}\left(c \cdot 4\right)\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      13. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(a, \left(\mathsf{neg}\left(c \cdot 4\right)\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      14. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(a, \left(c \cdot \left(\mathsf{neg}\left(4\right)\right)\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      15. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(c, \left(\mathsf{neg}\left(4\right)\right)\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      16. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(c, -4\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      17. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(c, -4\right)\right)\right)\right), b\right), \left(a \cdot \color{blue}{2}\right)\right) \]
    3. Simplified84.2%

      \[\leadsto \color{blue}{\frac{\sqrt{b \cdot b + a \cdot \left(c \cdot -4\right)} - b}{a \cdot 2}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\left(b \cdot b + a \cdot \left(-4 \cdot c\right)\right)\right), b\right), \mathsf{*.f64}\left(a, 2\right)\right) \]
      2. associate-*r*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\left(b \cdot b + \left(a \cdot -4\right) \cdot c\right)\right), b\right), \mathsf{*.f64}\left(a, 2\right)\right) \]
      3. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\left(b \cdot b + \left(a \cdot \left(\mathsf{neg}\left(4\right)\right)\right) \cdot c\right)\right), b\right), \mathsf{*.f64}\left(a, 2\right)\right) \]
      4. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\left(b \cdot b + \left(\mathsf{neg}\left(a \cdot 4\right)\right) \cdot c\right)\right), b\right), \mathsf{*.f64}\left(a, 2\right)\right) \]
      5. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\left(b \cdot b + \left(\mathsf{neg}\left(4 \cdot a\right)\right) \cdot c\right)\right), b\right), \mathsf{*.f64}\left(a, 2\right)\right) \]
      6. cancel-sign-sub-invN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\left(b \cdot b - \left(4 \cdot a\right) \cdot c\right)\right), b\right), \mathsf{*.f64}\left(a, 2\right)\right) \]
      7. --lowering--.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(\left(b \cdot b\right), \left(\left(4 \cdot a\right) \cdot c\right)\right)\right), b\right), \mathsf{*.f64}\left(a, 2\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(\left(4 \cdot a\right) \cdot c\right)\right)\right), b\right), \mathsf{*.f64}\left(a, 2\right)\right) \]
      9. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(\left(4 \cdot a\right), c\right)\right)\right), b\right), \mathsf{*.f64}\left(a, 2\right)\right) \]
      10. *-lowering-*.f6484.2%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, a\right), c\right)\right)\right), b\right), \mathsf{*.f64}\left(a, 2\right)\right) \]
    6. Applied egg-rr84.2%

      \[\leadsto \frac{\sqrt{\color{blue}{b \cdot b - \left(4 \cdot a\right) \cdot c}} - b}{a \cdot 2} \]
    7. Step-by-step derivation
      1. pow1/2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\left({\left(b \cdot b - \left(4 \cdot a\right) \cdot c\right)}^{\frac{1}{2}}\right), b\right), \mathsf{*.f64}\left(a, 2\right)\right) \]
      2. sub-negN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\left({\left(b \cdot b + \left(\mathsf{neg}\left(\left(4 \cdot a\right) \cdot c\right)\right)\right)}^{\frac{1}{2}}\right), b\right), \mathsf{*.f64}\left(a, 2\right)\right) \]
      3. associate-*l*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\left({\left(b \cdot b + \left(\mathsf{neg}\left(4 \cdot \left(a \cdot c\right)\right)\right)\right)}^{\frac{1}{2}}\right), b\right), \mathsf{*.f64}\left(a, 2\right)\right) \]
      4. distribute-lft-neg-inN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\left({\left(b \cdot b + \left(\mathsf{neg}\left(4\right)\right) \cdot \left(a \cdot c\right)\right)}^{\frac{1}{2}}\right), b\right), \mathsf{*.f64}\left(a, 2\right)\right) \]
      5. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\left({\left(b \cdot b + -4 \cdot \left(a \cdot c\right)\right)}^{\frac{1}{2}}\right), b\right), \mathsf{*.f64}\left(a, 2\right)\right) \]
      6. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\left({\left(b \cdot b + \left(a \cdot c\right) \cdot -4\right)}^{\frac{1}{2}}\right), b\right), \mathsf{*.f64}\left(a, 2\right)\right) \]
      7. associate-*r*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\left({\left(b \cdot b + a \cdot \left(c \cdot -4\right)\right)}^{\frac{1}{2}}\right), b\right), \mathsf{*.f64}\left(a, 2\right)\right) \]
      8. remove-double-divN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\left({\left(\frac{1}{\frac{1}{b \cdot b + a \cdot \left(c \cdot -4\right)}}\right)}^{\frac{1}{2}}\right), b\right), \mathsf{*.f64}\left(a, 2\right)\right) \]
      9. inv-powN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\left({\left({\left(\frac{1}{b \cdot b + a \cdot \left(c \cdot -4\right)}\right)}^{-1}\right)}^{\frac{1}{2}}\right), b\right), \mathsf{*.f64}\left(a, 2\right)\right) \]
      10. pow-powN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\left({\left(\frac{1}{b \cdot b + a \cdot \left(c \cdot -4\right)}\right)}^{\left(-1 \cdot \frac{1}{2}\right)}\right), b\right), \mathsf{*.f64}\left(a, 2\right)\right) \]
      11. pow-lowering-pow.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{pow.f64}\left(\left(\frac{1}{b \cdot b + a \cdot \left(c \cdot -4\right)}\right), \left(-1 \cdot \frac{1}{2}\right)\right), b\right), \mathsf{*.f64}\left(a, 2\right)\right) \]
      12. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{pow.f64}\left(\mathsf{/.f64}\left(1, \left(b \cdot b + a \cdot \left(c \cdot -4\right)\right)\right), \left(-1 \cdot \frac{1}{2}\right)\right), b\right), \mathsf{*.f64}\left(a, 2\right)\right) \]
      13. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{pow.f64}\left(\mathsf{/.f64}\left(1, \left(b \cdot b + a \cdot \left(-4 \cdot c\right)\right)\right), \left(-1 \cdot \frac{1}{2}\right)\right), b\right), \mathsf{*.f64}\left(a, 2\right)\right) \]
      14. associate-*r*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{pow.f64}\left(\mathsf{/.f64}\left(1, \left(b \cdot b + \left(a \cdot -4\right) \cdot c\right)\right), \left(-1 \cdot \frac{1}{2}\right)\right), b\right), \mathsf{*.f64}\left(a, 2\right)\right) \]
      15. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{pow.f64}\left(\mathsf{/.f64}\left(1, \left(b \cdot b + c \cdot \left(a \cdot -4\right)\right)\right), \left(-1 \cdot \frac{1}{2}\right)\right), b\right), \mathsf{*.f64}\left(a, 2\right)\right) \]
      16. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{pow.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(\left(b \cdot b\right), \left(c \cdot \left(a \cdot -4\right)\right)\right)\right), \left(-1 \cdot \frac{1}{2}\right)\right), b\right), \mathsf{*.f64}\left(a, 2\right)\right) \]
      17. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{pow.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(c \cdot \left(a \cdot -4\right)\right)\right)\right), \left(-1 \cdot \frac{1}{2}\right)\right), b\right), \mathsf{*.f64}\left(a, 2\right)\right) \]
      18. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{pow.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(c, \left(a \cdot -4\right)\right)\right)\right), \left(-1 \cdot \frac{1}{2}\right)\right), b\right), \mathsf{*.f64}\left(a, 2\right)\right) \]
      19. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{pow.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(c, \mathsf{*.f64}\left(a, -4\right)\right)\right)\right), \left(-1 \cdot \frac{1}{2}\right)\right), b\right), \mathsf{*.f64}\left(a, 2\right)\right) \]
      20. metadata-eval84.3%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{pow.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(c, \mathsf{*.f64}\left(a, -4\right)\right)\right)\right), \frac{-1}{2}\right), b\right), \mathsf{*.f64}\left(a, 2\right)\right) \]
    8. Applied egg-rr84.3%

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

      \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{pow.f64}\left(\color{blue}{\left(\frac{\frac{-1}{4}}{a \cdot c}\right)}, \frac{-1}{2}\right), b\right), \mathsf{*.f64}\left(a, 2\right)\right) \]
    10. Step-by-step derivation
      1. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{pow.f64}\left(\mathsf{/.f64}\left(\frac{-1}{4}, \left(a \cdot c\right)\right), \frac{-1}{2}\right), b\right), \mathsf{*.f64}\left(a, 2\right)\right) \]
      2. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{pow.f64}\left(\mathsf{/.f64}\left(\frac{-1}{4}, \left(c \cdot a\right)\right), \frac{-1}{2}\right), b\right), \mathsf{*.f64}\left(a, 2\right)\right) \]
      3. *-lowering-*.f6482.0%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{pow.f64}\left(\mathsf{/.f64}\left(\frac{-1}{4}, \mathsf{*.f64}\left(c, a\right)\right), \frac{-1}{2}\right), b\right), \mathsf{*.f64}\left(a, 2\right)\right) \]
    11. Simplified82.0%

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

    if 1.02000000000000001e-131 < b

    1. Initial program 17.3%

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

      \[\leadsto \color{blue}{-1 \cdot \frac{c}{b}} \]
    4. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto \mathsf{neg}\left(\frac{c}{b}\right) \]
      2. neg-sub0N/A

        \[\leadsto 0 - \color{blue}{\frac{c}{b}} \]
      3. --lowering--.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(0, \color{blue}{\left(\frac{c}{b}\right)}\right) \]
      4. /-lowering-/.f6483.6%

        \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(c, \color{blue}{b}\right)\right) \]
    5. Simplified83.6%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -2 \cdot 10^{-35}:\\ \;\;\;\;\frac{c}{b} - \frac{b}{a}\\ \mathbf{elif}\;b \leq 1.02 \cdot 10^{-131}:\\ \;\;\;\;\frac{{\left(\frac{-0.25}{a \cdot c}\right)}^{-0.5} - b}{a \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;\frac{c}{0 - b}\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 80.7% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq -2 \cdot 10^{-33}:\\ \;\;\;\;\frac{c}{b} - \frac{b}{a}\\ \mathbf{elif}\;b \leq 1.02 \cdot 10^{-131}:\\ \;\;\;\;\frac{\sqrt{c \cdot \left(a \cdot -4\right)} - b}{a \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;\frac{c}{0 - b}\\ \end{array} \end{array} \]
(FPCore (a b c)
 :precision binary64
 (if (<= b -2e-33)
   (- (/ c b) (/ b a))
   (if (<= b 1.02e-131)
     (/ (- (sqrt (* c (* a -4.0))) b) (* a 2.0))
     (/ c (- 0.0 b)))))
double code(double a, double b, double c) {
	double tmp;
	if (b <= -2e-33) {
		tmp = (c / b) - (b / a);
	} else if (b <= 1.02e-131) {
		tmp = (sqrt((c * (a * -4.0))) - b) / (a * 2.0);
	} else {
		tmp = c / (0.0 - 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-33)) then
        tmp = (c / b) - (b / a)
    else if (b <= 1.02d-131) then
        tmp = (sqrt((c * (a * (-4.0d0)))) - b) / (a * 2.0d0)
    else
        tmp = c / (0.0d0 - b)
    end if
    code = tmp
end function
public static double code(double a, double b, double c) {
	double tmp;
	if (b <= -2e-33) {
		tmp = (c / b) - (b / a);
	} else if (b <= 1.02e-131) {
		tmp = (Math.sqrt((c * (a * -4.0))) - b) / (a * 2.0);
	} else {
		tmp = c / (0.0 - b);
	}
	return tmp;
}
def code(a, b, c):
	tmp = 0
	if b <= -2e-33:
		tmp = (c / b) - (b / a)
	elif b <= 1.02e-131:
		tmp = (math.sqrt((c * (a * -4.0))) - b) / (a * 2.0)
	else:
		tmp = c / (0.0 - b)
	return tmp
function code(a, b, c)
	tmp = 0.0
	if (b <= -2e-33)
		tmp = Float64(Float64(c / b) - Float64(b / a));
	elseif (b <= 1.02e-131)
		tmp = Float64(Float64(sqrt(Float64(c * Float64(a * -4.0))) - b) / Float64(a * 2.0));
	else
		tmp = Float64(c / Float64(0.0 - b));
	end
	return tmp
end
function tmp_2 = code(a, b, c)
	tmp = 0.0;
	if (b <= -2e-33)
		tmp = (c / b) - (b / a);
	elseif (b <= 1.02e-131)
		tmp = (sqrt((c * (a * -4.0))) - b) / (a * 2.0);
	else
		tmp = c / (0.0 - b);
	end
	tmp_2 = tmp;
end
code[a_, b_, c_] := If[LessEqual[b, -2e-33], N[(N[(c / b), $MachinePrecision] - N[(b / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 1.02e-131], N[(N[(N[Sqrt[N[(c * N[(a * -4.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision] / N[(a * 2.0), $MachinePrecision]), $MachinePrecision], N[(c / N[(0.0 - b), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

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

\mathbf{elif}\;b \leq 1.02 \cdot 10^{-131}:\\
\;\;\;\;\frac{\sqrt{c \cdot \left(a \cdot -4\right)} - b}{a \cdot 2}\\

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


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

    1. Initial program 61.7%

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

      \[\leadsto \color{blue}{-1 \cdot \left(b \cdot \left(-1 \cdot \frac{c}{{b}^{2}} + \frac{1}{a}\right)\right)} \]
    4. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto \mathsf{neg}\left(b \cdot \left(-1 \cdot \frac{c}{{b}^{2}} + \frac{1}{a}\right)\right) \]
      2. *-commutativeN/A

        \[\leadsto \mathsf{neg}\left(\left(-1 \cdot \frac{c}{{b}^{2}} + \frac{1}{a}\right) \cdot b\right) \]
      3. distribute-rgt-neg-inN/A

        \[\leadsto \left(-1 \cdot \frac{c}{{b}^{2}} + \frac{1}{a}\right) \cdot \color{blue}{\left(\mathsf{neg}\left(b\right)\right)} \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(-1 \cdot \frac{c}{{b}^{2}} + \frac{1}{a}\right), \color{blue}{\left(\mathsf{neg}\left(b\right)\right)}\right) \]
      5. +-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{1}{a} + -1 \cdot \frac{c}{{b}^{2}}\right), \left(\mathsf{neg}\left(\color{blue}{b}\right)\right)\right) \]
      6. mul-1-negN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{1}{a} + \left(\mathsf{neg}\left(\frac{c}{{b}^{2}}\right)\right)\right), \left(\mathsf{neg}\left(b\right)\right)\right) \]
      7. unsub-negN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{1}{a} - \frac{c}{{b}^{2}}\right), \left(\mathsf{neg}\left(\color{blue}{b}\right)\right)\right) \]
      8. --lowering--.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\left(\frac{1}{a}\right), \left(\frac{c}{{b}^{2}}\right)\right), \left(\mathsf{neg}\left(\color{blue}{b}\right)\right)\right) \]
      9. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, a\right), \left(\frac{c}{{b}^{2}}\right)\right), \left(\mathsf{neg}\left(b\right)\right)\right) \]
      10. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, a\right), \mathsf{/.f64}\left(c, \left({b}^{2}\right)\right)\right), \left(\mathsf{neg}\left(b\right)\right)\right) \]
      11. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, a\right), \mathsf{/.f64}\left(c, \left(b \cdot b\right)\right)\right), \left(\mathsf{neg}\left(b\right)\right)\right) \]
      12. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, a\right), \mathsf{/.f64}\left(c, \mathsf{*.f64}\left(b, b\right)\right)\right), \left(\mathsf{neg}\left(b\right)\right)\right) \]
      13. neg-sub0N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, a\right), \mathsf{/.f64}\left(c, \mathsf{*.f64}\left(b, b\right)\right)\right), \left(0 - \color{blue}{b}\right)\right) \]
      14. --lowering--.f6489.6%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, a\right), \mathsf{/.f64}\left(c, \mathsf{*.f64}\left(b, b\right)\right)\right), \mathsf{\_.f64}\left(0, \color{blue}{b}\right)\right) \]
    5. Simplified89.6%

      \[\leadsto \color{blue}{\left(\frac{1}{a} - \frac{c}{b \cdot b}\right) \cdot \left(0 - b\right)} \]
    6. Taylor expanded in a around inf

      \[\leadsto \color{blue}{-1 \cdot \frac{b}{a} + \frac{c}{b}} \]
    7. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto \frac{c}{b} + \color{blue}{-1 \cdot \frac{b}{a}} \]
      2. mul-1-negN/A

        \[\leadsto \frac{c}{b} + \left(\mathsf{neg}\left(\frac{b}{a}\right)\right) \]
      3. unsub-negN/A

        \[\leadsto \frac{c}{b} - \color{blue}{\frac{b}{a}} \]
      4. --lowering--.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\left(\frac{c}{b}\right), \color{blue}{\left(\frac{b}{a}\right)}\right) \]
      5. /-lowering-/.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(c, b\right), \left(\frac{\color{blue}{b}}{a}\right)\right) \]
      6. /-lowering-/.f6489.8%

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(c, b\right), \mathsf{/.f64}\left(b, \color{blue}{a}\right)\right) \]
    8. Simplified89.8%

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

    if -2.0000000000000001e-33 < b < 1.02000000000000001e-131

    1. Initial program 84.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. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\left(\left(\mathsf{neg}\left(b\right)\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}\right), \color{blue}{\left(2 \cdot a\right)}\right) \]
      2. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c} + \left(\mathsf{neg}\left(b\right)\right)\right), \left(\color{blue}{2} \cdot a\right)\right) \]
      3. unsub-negN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c} - b\right), \left(\color{blue}{2} \cdot a\right)\right) \]
      4. --lowering--.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\left(\sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}\right), b\right), \left(\color{blue}{2} \cdot a\right)\right) \]
      5. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\left(b \cdot b - \left(4 \cdot a\right) \cdot c\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      6. sub-negN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\left(b \cdot b + \left(\mathsf{neg}\left(\left(4 \cdot a\right) \cdot c\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      7. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\left(b \cdot b\right), \left(\mathsf{neg}\left(\left(4 \cdot a\right) \cdot c\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(\mathsf{neg}\left(\left(4 \cdot a\right) \cdot c\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      9. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(\mathsf{neg}\left(\left(a \cdot 4\right) \cdot c\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      10. associate-*l*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(\mathsf{neg}\left(a \cdot \left(4 \cdot c\right)\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      11. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(a \cdot \left(\mathsf{neg}\left(4 \cdot c\right)\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      12. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(a \cdot \left(\mathsf{neg}\left(c \cdot 4\right)\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      13. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(a, \left(\mathsf{neg}\left(c \cdot 4\right)\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      14. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(a, \left(c \cdot \left(\mathsf{neg}\left(4\right)\right)\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      15. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(c, \left(\mathsf{neg}\left(4\right)\right)\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      16. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(c, -4\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      17. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(c, -4\right)\right)\right)\right), b\right), \left(a \cdot \color{blue}{2}\right)\right) \]
    3. Simplified84.2%

      \[\leadsto \color{blue}{\frac{\sqrt{b \cdot b + a \cdot \left(c \cdot -4\right)} - b}{a \cdot 2}} \]
    4. Add Preprocessing
    5. Taylor expanded in b around 0

      \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\color{blue}{\left(-4 \cdot \left(a \cdot c\right)\right)}\right), b\right), \mathsf{*.f64}\left(a, 2\right)\right) \]
    6. Step-by-step derivation
      1. associate-*r*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\left(\left(-4 \cdot a\right) \cdot c\right)\right), b\right), \mathsf{*.f64}\left(a, 2\right)\right) \]
      2. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\left(c \cdot \left(-4 \cdot a\right)\right)\right), b\right), \mathsf{*.f64}\left(a, 2\right)\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(c, \left(-4 \cdot a\right)\right)\right), b\right), \mathsf{*.f64}\left(a, 2\right)\right) \]
      4. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(c, \left(a \cdot -4\right)\right)\right), b\right), \mathsf{*.f64}\left(a, 2\right)\right) \]
      5. *-lowering-*.f6480.6%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(c, \mathsf{*.f64}\left(a, -4\right)\right)\right), b\right), \mathsf{*.f64}\left(a, 2\right)\right) \]
    7. Simplified80.6%

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

    if 1.02000000000000001e-131 < b

    1. Initial program 17.3%

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

      \[\leadsto \color{blue}{-1 \cdot \frac{c}{b}} \]
    4. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto \mathsf{neg}\left(\frac{c}{b}\right) \]
      2. neg-sub0N/A

        \[\leadsto 0 - \color{blue}{\frac{c}{b}} \]
      3. --lowering--.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(0, \color{blue}{\left(\frac{c}{b}\right)}\right) \]
      4. /-lowering-/.f6483.6%

        \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(c, \color{blue}{b}\right)\right) \]
    5. Simplified83.6%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -2 \cdot 10^{-33}:\\ \;\;\;\;\frac{c}{b} - \frac{b}{a}\\ \mathbf{elif}\;b \leq 1.02 \cdot 10^{-131}:\\ \;\;\;\;\frac{\sqrt{c \cdot \left(a \cdot -4\right)} - b}{a \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;\frac{c}{0 - b}\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 80.7% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq -2.1 \cdot 10^{-33}:\\ \;\;\;\;\frac{c}{b} - \frac{b}{a}\\ \mathbf{elif}\;b \leq 1.02 \cdot 10^{-131}:\\ \;\;\;\;\frac{0.5}{a} \cdot \left(\sqrt{c \cdot \left(a \cdot -4\right)} - b\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{c}{0 - b}\\ \end{array} \end{array} \]
(FPCore (a b c)
 :precision binary64
 (if (<= b -2.1e-33)
   (- (/ c b) (/ b a))
   (if (<= b 1.02e-131)
     (* (/ 0.5 a) (- (sqrt (* c (* a -4.0))) b))
     (/ c (- 0.0 b)))))
double code(double a, double b, double c) {
	double tmp;
	if (b <= -2.1e-33) {
		tmp = (c / b) - (b / a);
	} else if (b <= 1.02e-131) {
		tmp = (0.5 / a) * (sqrt((c * (a * -4.0))) - b);
	} else {
		tmp = c / (0.0 - 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 <= (-2.1d-33)) then
        tmp = (c / b) - (b / a)
    else if (b <= 1.02d-131) then
        tmp = (0.5d0 / a) * (sqrt((c * (a * (-4.0d0)))) - b)
    else
        tmp = c / (0.0d0 - b)
    end if
    code = tmp
end function
public static double code(double a, double b, double c) {
	double tmp;
	if (b <= -2.1e-33) {
		tmp = (c / b) - (b / a);
	} else if (b <= 1.02e-131) {
		tmp = (0.5 / a) * (Math.sqrt((c * (a * -4.0))) - b);
	} else {
		tmp = c / (0.0 - b);
	}
	return tmp;
}
def code(a, b, c):
	tmp = 0
	if b <= -2.1e-33:
		tmp = (c / b) - (b / a)
	elif b <= 1.02e-131:
		tmp = (0.5 / a) * (math.sqrt((c * (a * -4.0))) - b)
	else:
		tmp = c / (0.0 - b)
	return tmp
function code(a, b, c)
	tmp = 0.0
	if (b <= -2.1e-33)
		tmp = Float64(Float64(c / b) - Float64(b / a));
	elseif (b <= 1.02e-131)
		tmp = Float64(Float64(0.5 / a) * Float64(sqrt(Float64(c * Float64(a * -4.0))) - b));
	else
		tmp = Float64(c / Float64(0.0 - b));
	end
	return tmp
end
function tmp_2 = code(a, b, c)
	tmp = 0.0;
	if (b <= -2.1e-33)
		tmp = (c / b) - (b / a);
	elseif (b <= 1.02e-131)
		tmp = (0.5 / a) * (sqrt((c * (a * -4.0))) - b);
	else
		tmp = c / (0.0 - b);
	end
	tmp_2 = tmp;
end
code[a_, b_, c_] := If[LessEqual[b, -2.1e-33], N[(N[(c / b), $MachinePrecision] - N[(b / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 1.02e-131], N[(N[(0.5 / a), $MachinePrecision] * N[(N[Sqrt[N[(c * N[(a * -4.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision]), $MachinePrecision], N[(c / N[(0.0 - b), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

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

\mathbf{elif}\;b \leq 1.02 \cdot 10^{-131}:\\
\;\;\;\;\frac{0.5}{a} \cdot \left(\sqrt{c \cdot \left(a \cdot -4\right)} - b\right)\\

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


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

    1. Initial program 61.7%

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

      \[\leadsto \color{blue}{-1 \cdot \left(b \cdot \left(-1 \cdot \frac{c}{{b}^{2}} + \frac{1}{a}\right)\right)} \]
    4. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto \mathsf{neg}\left(b \cdot \left(-1 \cdot \frac{c}{{b}^{2}} + \frac{1}{a}\right)\right) \]
      2. *-commutativeN/A

        \[\leadsto \mathsf{neg}\left(\left(-1 \cdot \frac{c}{{b}^{2}} + \frac{1}{a}\right) \cdot b\right) \]
      3. distribute-rgt-neg-inN/A

        \[\leadsto \left(-1 \cdot \frac{c}{{b}^{2}} + \frac{1}{a}\right) \cdot \color{blue}{\left(\mathsf{neg}\left(b\right)\right)} \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(-1 \cdot \frac{c}{{b}^{2}} + \frac{1}{a}\right), \color{blue}{\left(\mathsf{neg}\left(b\right)\right)}\right) \]
      5. +-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{1}{a} + -1 \cdot \frac{c}{{b}^{2}}\right), \left(\mathsf{neg}\left(\color{blue}{b}\right)\right)\right) \]
      6. mul-1-negN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{1}{a} + \left(\mathsf{neg}\left(\frac{c}{{b}^{2}}\right)\right)\right), \left(\mathsf{neg}\left(b\right)\right)\right) \]
      7. unsub-negN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{1}{a} - \frac{c}{{b}^{2}}\right), \left(\mathsf{neg}\left(\color{blue}{b}\right)\right)\right) \]
      8. --lowering--.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\left(\frac{1}{a}\right), \left(\frac{c}{{b}^{2}}\right)\right), \left(\mathsf{neg}\left(\color{blue}{b}\right)\right)\right) \]
      9. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, a\right), \left(\frac{c}{{b}^{2}}\right)\right), \left(\mathsf{neg}\left(b\right)\right)\right) \]
      10. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, a\right), \mathsf{/.f64}\left(c, \left({b}^{2}\right)\right)\right), \left(\mathsf{neg}\left(b\right)\right)\right) \]
      11. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, a\right), \mathsf{/.f64}\left(c, \left(b \cdot b\right)\right)\right), \left(\mathsf{neg}\left(b\right)\right)\right) \]
      12. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, a\right), \mathsf{/.f64}\left(c, \mathsf{*.f64}\left(b, b\right)\right)\right), \left(\mathsf{neg}\left(b\right)\right)\right) \]
      13. neg-sub0N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, a\right), \mathsf{/.f64}\left(c, \mathsf{*.f64}\left(b, b\right)\right)\right), \left(0 - \color{blue}{b}\right)\right) \]
      14. --lowering--.f6489.6%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, a\right), \mathsf{/.f64}\left(c, \mathsf{*.f64}\left(b, b\right)\right)\right), \mathsf{\_.f64}\left(0, \color{blue}{b}\right)\right) \]
    5. Simplified89.6%

      \[\leadsto \color{blue}{\left(\frac{1}{a} - \frac{c}{b \cdot b}\right) \cdot \left(0 - b\right)} \]
    6. Taylor expanded in a around inf

      \[\leadsto \color{blue}{-1 \cdot \frac{b}{a} + \frac{c}{b}} \]
    7. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto \frac{c}{b} + \color{blue}{-1 \cdot \frac{b}{a}} \]
      2. mul-1-negN/A

        \[\leadsto \frac{c}{b} + \left(\mathsf{neg}\left(\frac{b}{a}\right)\right) \]
      3. unsub-negN/A

        \[\leadsto \frac{c}{b} - \color{blue}{\frac{b}{a}} \]
      4. --lowering--.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\left(\frac{c}{b}\right), \color{blue}{\left(\frac{b}{a}\right)}\right) \]
      5. /-lowering-/.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(c, b\right), \left(\frac{\color{blue}{b}}{a}\right)\right) \]
      6. /-lowering-/.f6489.8%

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(c, b\right), \mathsf{/.f64}\left(b, \color{blue}{a}\right)\right) \]
    8. Simplified89.8%

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

    if -2.1e-33 < b < 1.02000000000000001e-131

    1. Initial program 84.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. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\left(\left(\mathsf{neg}\left(b\right)\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}\right), \color{blue}{\left(2 \cdot a\right)}\right) \]
      2. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c} + \left(\mathsf{neg}\left(b\right)\right)\right), \left(\color{blue}{2} \cdot a\right)\right) \]
      3. unsub-negN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c} - b\right), \left(\color{blue}{2} \cdot a\right)\right) \]
      4. --lowering--.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\left(\sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}\right), b\right), \left(\color{blue}{2} \cdot a\right)\right) \]
      5. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\left(b \cdot b - \left(4 \cdot a\right) \cdot c\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      6. sub-negN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\left(b \cdot b + \left(\mathsf{neg}\left(\left(4 \cdot a\right) \cdot c\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      7. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\left(b \cdot b\right), \left(\mathsf{neg}\left(\left(4 \cdot a\right) \cdot c\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(\mathsf{neg}\left(\left(4 \cdot a\right) \cdot c\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      9. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(\mathsf{neg}\left(\left(a \cdot 4\right) \cdot c\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      10. associate-*l*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(\mathsf{neg}\left(a \cdot \left(4 \cdot c\right)\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      11. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(a \cdot \left(\mathsf{neg}\left(4 \cdot c\right)\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      12. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(a \cdot \left(\mathsf{neg}\left(c \cdot 4\right)\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      13. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(a, \left(\mathsf{neg}\left(c \cdot 4\right)\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      14. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(a, \left(c \cdot \left(\mathsf{neg}\left(4\right)\right)\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      15. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(c, \left(\mathsf{neg}\left(4\right)\right)\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      16. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(c, -4\right)\right)\right)\right), b\right), \left(2 \cdot a\right)\right) \]
      17. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(c, -4\right)\right)\right)\right), b\right), \left(a \cdot \color{blue}{2}\right)\right) \]
    3. Simplified84.2%

      \[\leadsto \color{blue}{\frac{\sqrt{b \cdot b + a \cdot \left(c \cdot -4\right)} - b}{a \cdot 2}} \]
    4. Add Preprocessing
    5. Taylor expanded in b around 0

      \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\color{blue}{\left(-4 \cdot \left(a \cdot c\right)\right)}\right), b\right), \mathsf{*.f64}\left(a, 2\right)\right) \]
    6. Step-by-step derivation
      1. associate-*r*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\left(\left(-4 \cdot a\right) \cdot c\right)\right), b\right), \mathsf{*.f64}\left(a, 2\right)\right) \]
      2. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\left(c \cdot \left(-4 \cdot a\right)\right)\right), b\right), \mathsf{*.f64}\left(a, 2\right)\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(c, \left(-4 \cdot a\right)\right)\right), b\right), \mathsf{*.f64}\left(a, 2\right)\right) \]
      4. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(c, \left(a \cdot -4\right)\right)\right), b\right), \mathsf{*.f64}\left(a, 2\right)\right) \]
      5. *-lowering-*.f6480.6%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(c, \mathsf{*.f64}\left(a, -4\right)\right)\right), b\right), \mathsf{*.f64}\left(a, 2\right)\right) \]
    7. Simplified80.6%

      \[\leadsto \frac{\sqrt{\color{blue}{c \cdot \left(a \cdot -4\right)}} - b}{a \cdot 2} \]
    8. Step-by-step derivation
      1. clear-numN/A

        \[\leadsto \frac{1}{\color{blue}{\frac{a \cdot 2}{\sqrt{c \cdot \left(a \cdot -4\right)} - b}}} \]
      2. associate-/r/N/A

        \[\leadsto \frac{1}{a \cdot 2} \cdot \color{blue}{\left(\sqrt{c \cdot \left(a \cdot -4\right)} - b\right)} \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{1}{a \cdot 2}\right), \color{blue}{\left(\sqrt{c \cdot \left(a \cdot -4\right)} - b\right)}\right) \]
      4. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{1}{2 \cdot a}\right), \left(\sqrt{c \cdot \left(a \cdot -4\right)} - b\right)\right) \]
      5. associate-/r*N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{\frac{1}{2}}{a}\right), \left(\color{blue}{\sqrt{c \cdot \left(a \cdot -4\right)}} - b\right)\right) \]
      6. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{\frac{1}{2}}{a}\right), \left(\sqrt{\color{blue}{c \cdot \left(a \cdot -4\right)}} - b\right)\right) \]
      7. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\frac{1}{2}, a\right), \left(\color{blue}{\sqrt{c \cdot \left(a \cdot -4\right)}} - b\right)\right) \]
      8. --lowering--.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\frac{1}{2}, a\right), \mathsf{\_.f64}\left(\left(\sqrt{c \cdot \left(a \cdot -4\right)}\right), \color{blue}{b}\right)\right) \]
      9. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\frac{1}{2}, a\right), \mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\left(c \cdot \left(a \cdot -4\right)\right)\right), b\right)\right) \]
      10. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\frac{1}{2}, a\right), \mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(c, \left(a \cdot -4\right)\right)\right), b\right)\right) \]
      11. *-lowering-*.f6480.3%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\frac{1}{2}, a\right), \mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(c, \mathsf{*.f64}\left(a, -4\right)\right)\right), b\right)\right) \]
    9. Applied egg-rr80.3%

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

    if 1.02000000000000001e-131 < b

    1. Initial program 17.3%

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

      \[\leadsto \color{blue}{-1 \cdot \frac{c}{b}} \]
    4. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto \mathsf{neg}\left(\frac{c}{b}\right) \]
      2. neg-sub0N/A

        \[\leadsto 0 - \color{blue}{\frac{c}{b}} \]
      3. --lowering--.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(0, \color{blue}{\left(\frac{c}{b}\right)}\right) \]
      4. /-lowering-/.f6483.6%

        \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(c, \color{blue}{b}\right)\right) \]
    5. Simplified83.6%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -2.1 \cdot 10^{-33}:\\ \;\;\;\;\frac{c}{b} - \frac{b}{a}\\ \mathbf{elif}\;b \leq 1.02 \cdot 10^{-131}:\\ \;\;\;\;\frac{0.5}{a} \cdot \left(\sqrt{c \cdot \left(a \cdot -4\right)} - b\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{c}{0 - b}\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 67.7% accurate, 9.7× speedup?

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

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

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


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

    1. Initial program 66.9%

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

      \[\leadsto \color{blue}{-1 \cdot \left(b \cdot \left(-1 \cdot \frac{c}{{b}^{2}} + \frac{1}{a}\right)\right)} \]
    4. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto \mathsf{neg}\left(b \cdot \left(-1 \cdot \frac{c}{{b}^{2}} + \frac{1}{a}\right)\right) \]
      2. *-commutativeN/A

        \[\leadsto \mathsf{neg}\left(\left(-1 \cdot \frac{c}{{b}^{2}} + \frac{1}{a}\right) \cdot b\right) \]
      3. distribute-rgt-neg-inN/A

        \[\leadsto \left(-1 \cdot \frac{c}{{b}^{2}} + \frac{1}{a}\right) \cdot \color{blue}{\left(\mathsf{neg}\left(b\right)\right)} \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(-1 \cdot \frac{c}{{b}^{2}} + \frac{1}{a}\right), \color{blue}{\left(\mathsf{neg}\left(b\right)\right)}\right) \]
      5. +-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{1}{a} + -1 \cdot \frac{c}{{b}^{2}}\right), \left(\mathsf{neg}\left(\color{blue}{b}\right)\right)\right) \]
      6. mul-1-negN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{1}{a} + \left(\mathsf{neg}\left(\frac{c}{{b}^{2}}\right)\right)\right), \left(\mathsf{neg}\left(b\right)\right)\right) \]
      7. unsub-negN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{1}{a} - \frac{c}{{b}^{2}}\right), \left(\mathsf{neg}\left(\color{blue}{b}\right)\right)\right) \]
      8. --lowering--.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\left(\frac{1}{a}\right), \left(\frac{c}{{b}^{2}}\right)\right), \left(\mathsf{neg}\left(\color{blue}{b}\right)\right)\right) \]
      9. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, a\right), \left(\frac{c}{{b}^{2}}\right)\right), \left(\mathsf{neg}\left(b\right)\right)\right) \]
      10. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, a\right), \mathsf{/.f64}\left(c, \left({b}^{2}\right)\right)\right), \left(\mathsf{neg}\left(b\right)\right)\right) \]
      11. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, a\right), \mathsf{/.f64}\left(c, \left(b \cdot b\right)\right)\right), \left(\mathsf{neg}\left(b\right)\right)\right) \]
      12. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, a\right), \mathsf{/.f64}\left(c, \mathsf{*.f64}\left(b, b\right)\right)\right), \left(\mathsf{neg}\left(b\right)\right)\right) \]
      13. neg-sub0N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, a\right), \mathsf{/.f64}\left(c, \mathsf{*.f64}\left(b, b\right)\right)\right), \left(0 - \color{blue}{b}\right)\right) \]
      14. --lowering--.f6465.9%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, a\right), \mathsf{/.f64}\left(c, \mathsf{*.f64}\left(b, b\right)\right)\right), \mathsf{\_.f64}\left(0, \color{blue}{b}\right)\right) \]
    5. Simplified65.9%

      \[\leadsto \color{blue}{\left(\frac{1}{a} - \frac{c}{b \cdot b}\right) \cdot \left(0 - b\right)} \]
    6. Taylor expanded in a around inf

      \[\leadsto \color{blue}{-1 \cdot \frac{b}{a} + \frac{c}{b}} \]
    7. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto \frac{c}{b} + \color{blue}{-1 \cdot \frac{b}{a}} \]
      2. mul-1-negN/A

        \[\leadsto \frac{c}{b} + \left(\mathsf{neg}\left(\frac{b}{a}\right)\right) \]
      3. unsub-negN/A

        \[\leadsto \frac{c}{b} - \color{blue}{\frac{b}{a}} \]
      4. --lowering--.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\left(\frac{c}{b}\right), \color{blue}{\left(\frac{b}{a}\right)}\right) \]
      5. /-lowering-/.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(c, b\right), \left(\frac{\color{blue}{b}}{a}\right)\right) \]
      6. /-lowering-/.f6467.0%

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{/.f64}\left(c, b\right), \mathsf{/.f64}\left(b, \color{blue}{a}\right)\right) \]
    8. Simplified67.0%

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

    if -9.999999999999969e-311 < b

    1. Initial program 33.6%

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

      \[\leadsto \color{blue}{-1 \cdot \frac{c}{b}} \]
    4. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto \mathsf{neg}\left(\frac{c}{b}\right) \]
      2. neg-sub0N/A

        \[\leadsto 0 - \color{blue}{\frac{c}{b}} \]
      3. --lowering--.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(0, \color{blue}{\left(\frac{c}{b}\right)}\right) \]
      4. /-lowering-/.f6467.3%

        \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(c, \color{blue}{b}\right)\right) \]
    5. Simplified67.3%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -1 \cdot 10^{-310}:\\ \;\;\;\;\frac{c}{b} - \frac{b}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{c}{0 - b}\\ \end{array} \]
  5. Add Preprocessing

Alternative 11: 67.5% accurate, 11.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq 5 \cdot 10^{-307}:\\ \;\;\;\;\frac{0 - b}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{c}{0 - b}\\ \end{array} \end{array} \]
(FPCore (a b c)
 :precision binary64
 (if (<= b 5e-307) (/ (- 0.0 b) a) (/ c (- 0.0 b))))
double code(double a, double b, double c) {
	double tmp;
	if (b <= 5e-307) {
		tmp = (0.0 - b) / a;
	} else {
		tmp = c / (0.0 - 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 <= 5d-307) then
        tmp = (0.0d0 - b) / a
    else
        tmp = c / (0.0d0 - b)
    end if
    code = tmp
end function
public static double code(double a, double b, double c) {
	double tmp;
	if (b <= 5e-307) {
		tmp = (0.0 - b) / a;
	} else {
		tmp = c / (0.0 - b);
	}
	return tmp;
}
def code(a, b, c):
	tmp = 0
	if b <= 5e-307:
		tmp = (0.0 - b) / a
	else:
		tmp = c / (0.0 - b)
	return tmp
function code(a, b, c)
	tmp = 0.0
	if (b <= 5e-307)
		tmp = Float64(Float64(0.0 - b) / a);
	else
		tmp = Float64(c / Float64(0.0 - b));
	end
	return tmp
end
function tmp_2 = code(a, b, c)
	tmp = 0.0;
	if (b <= 5e-307)
		tmp = (0.0 - b) / a;
	else
		tmp = c / (0.0 - b);
	end
	tmp_2 = tmp;
end
code[a_, b_, c_] := If[LessEqual[b, 5e-307], N[(N[(0.0 - b), $MachinePrecision] / a), $MachinePrecision], N[(c / N[(0.0 - b), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;b \leq 5 \cdot 10^{-307}:\\
\;\;\;\;\frac{0 - b}{a}\\

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


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

    1. Initial program 67.6%

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

      \[\leadsto \color{blue}{-1 \cdot \frac{b}{a}} \]
    4. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto \mathsf{neg}\left(\frac{b}{a}\right) \]
      2. distribute-neg-frac2N/A

        \[\leadsto \frac{b}{\color{blue}{\mathsf{neg}\left(a\right)}} \]
      3. mul-1-negN/A

        \[\leadsto \frac{b}{-1 \cdot \color{blue}{a}} \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(b, \color{blue}{\left(-1 \cdot a\right)}\right) \]
      5. mul-1-negN/A

        \[\leadsto \mathsf{/.f64}\left(b, \left(\mathsf{neg}\left(a\right)\right)\right) \]
      6. neg-lowering-neg.f6465.3%

        \[\leadsto \mathsf{/.f64}\left(b, \mathsf{neg.f64}\left(a\right)\right) \]
    5. Simplified65.3%

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

    if 5.00000000000000014e-307 < b

    1. Initial program 31.9%

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

      \[\leadsto \color{blue}{-1 \cdot \frac{c}{b}} \]
    4. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto \mathsf{neg}\left(\frac{c}{b}\right) \]
      2. neg-sub0N/A

        \[\leadsto 0 - \color{blue}{\frac{c}{b}} \]
      3. --lowering--.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(0, \color{blue}{\left(\frac{c}{b}\right)}\right) \]
      4. /-lowering-/.f6468.9%

        \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(c, \color{blue}{b}\right)\right) \]
    5. Simplified68.9%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq 5 \cdot 10^{-307}:\\ \;\;\;\;\frac{0 - b}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{c}{0 - b}\\ \end{array} \]
  5. Add Preprocessing

Alternative 12: 43.5% accurate, 11.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq 98:\\ \;\;\;\;\frac{0 - b}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{c}{b}\\ \end{array} \end{array} \]
(FPCore (a b c) :precision binary64 (if (<= b 98.0) (/ (- 0.0 b) a) (/ c b)))
double code(double a, double b, double c) {
	double tmp;
	if (b <= 98.0) {
		tmp = (0.0 - 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 <= 98.0d0) then
        tmp = (0.0d0 - 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 <= 98.0) {
		tmp = (0.0 - b) / a;
	} else {
		tmp = c / b;
	}
	return tmp;
}
def code(a, b, c):
	tmp = 0
	if b <= 98.0:
		tmp = (0.0 - b) / a
	else:
		tmp = c / b
	return tmp
function code(a, b, c)
	tmp = 0.0
	if (b <= 98.0)
		tmp = Float64(Float64(0.0 - b) / a);
	else
		tmp = Float64(c / b);
	end
	return tmp
end
function tmp_2 = code(a, b, c)
	tmp = 0.0;
	if (b <= 98.0)
		tmp = (0.0 - b) / a;
	else
		tmp = c / b;
	end
	tmp_2 = tmp;
end
code[a_, b_, c_] := If[LessEqual[b, 98.0], N[(N[(0.0 - b), $MachinePrecision] / a), $MachinePrecision], N[(c / b), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;b \leq 98:\\
\;\;\;\;\frac{0 - b}{a}\\

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


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

    1. Initial program 67.6%

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

      \[\leadsto \color{blue}{-1 \cdot \frac{b}{a}} \]
    4. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto \mathsf{neg}\left(\frac{b}{a}\right) \]
      2. distribute-neg-frac2N/A

        \[\leadsto \frac{b}{\color{blue}{\mathsf{neg}\left(a\right)}} \]
      3. mul-1-negN/A

        \[\leadsto \frac{b}{-1 \cdot \color{blue}{a}} \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(b, \color{blue}{\left(-1 \cdot a\right)}\right) \]
      5. mul-1-negN/A

        \[\leadsto \mathsf{/.f64}\left(b, \left(\mathsf{neg}\left(a\right)\right)\right) \]
      6. neg-lowering-neg.f6450.9%

        \[\leadsto \mathsf{/.f64}\left(b, \mathsf{neg.f64}\left(a\right)\right) \]
    5. Simplified50.9%

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

    if 98 < b

    1. Initial program 11.8%

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

      \[\leadsto \color{blue}{-1 \cdot \left(b \cdot \left(-1 \cdot \frac{c}{{b}^{2}} + \frac{1}{a}\right)\right)} \]
    4. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto \mathsf{neg}\left(b \cdot \left(-1 \cdot \frac{c}{{b}^{2}} + \frac{1}{a}\right)\right) \]
      2. *-commutativeN/A

        \[\leadsto \mathsf{neg}\left(\left(-1 \cdot \frac{c}{{b}^{2}} + \frac{1}{a}\right) \cdot b\right) \]
      3. distribute-rgt-neg-inN/A

        \[\leadsto \left(-1 \cdot \frac{c}{{b}^{2}} + \frac{1}{a}\right) \cdot \color{blue}{\left(\mathsf{neg}\left(b\right)\right)} \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(-1 \cdot \frac{c}{{b}^{2}} + \frac{1}{a}\right), \color{blue}{\left(\mathsf{neg}\left(b\right)\right)}\right) \]
      5. +-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{1}{a} + -1 \cdot \frac{c}{{b}^{2}}\right), \left(\mathsf{neg}\left(\color{blue}{b}\right)\right)\right) \]
      6. mul-1-negN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{1}{a} + \left(\mathsf{neg}\left(\frac{c}{{b}^{2}}\right)\right)\right), \left(\mathsf{neg}\left(b\right)\right)\right) \]
      7. unsub-negN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{1}{a} - \frac{c}{{b}^{2}}\right), \left(\mathsf{neg}\left(\color{blue}{b}\right)\right)\right) \]
      8. --lowering--.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\left(\frac{1}{a}\right), \left(\frac{c}{{b}^{2}}\right)\right), \left(\mathsf{neg}\left(\color{blue}{b}\right)\right)\right) \]
      9. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, a\right), \left(\frac{c}{{b}^{2}}\right)\right), \left(\mathsf{neg}\left(b\right)\right)\right) \]
      10. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, a\right), \mathsf{/.f64}\left(c, \left({b}^{2}\right)\right)\right), \left(\mathsf{neg}\left(b\right)\right)\right) \]
      11. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, a\right), \mathsf{/.f64}\left(c, \left(b \cdot b\right)\right)\right), \left(\mathsf{neg}\left(b\right)\right)\right) \]
      12. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, a\right), \mathsf{/.f64}\left(c, \mathsf{*.f64}\left(b, b\right)\right)\right), \left(\mathsf{neg}\left(b\right)\right)\right) \]
      13. neg-sub0N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, a\right), \mathsf{/.f64}\left(c, \mathsf{*.f64}\left(b, b\right)\right)\right), \left(0 - \color{blue}{b}\right)\right) \]
      14. --lowering--.f642.7%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, a\right), \mathsf{/.f64}\left(c, \mathsf{*.f64}\left(b, b\right)\right)\right), \mathsf{\_.f64}\left(0, \color{blue}{b}\right)\right) \]
    5. Simplified2.7%

      \[\leadsto \color{blue}{\left(\frac{1}{a} - \frac{c}{b \cdot b}\right) \cdot \left(0 - b\right)} \]
    6. Taylor expanded in a around inf

      \[\leadsto \color{blue}{\frac{c}{b}} \]
    7. Step-by-step derivation
      1. /-lowering-/.f6421.7%

        \[\leadsto \mathsf{/.f64}\left(c, \color{blue}{b}\right) \]
    8. Simplified21.7%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq 98:\\ \;\;\;\;\frac{0 - b}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{c}{b}\\ \end{array} \]
  5. Add Preprocessing

Alternative 13: 11.1% 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 51.3%

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

    \[\leadsto \color{blue}{-1 \cdot \left(b \cdot \left(-1 \cdot \frac{c}{{b}^{2}} + \frac{1}{a}\right)\right)} \]
  4. Step-by-step derivation
    1. mul-1-negN/A

      \[\leadsto \mathsf{neg}\left(b \cdot \left(-1 \cdot \frac{c}{{b}^{2}} + \frac{1}{a}\right)\right) \]
    2. *-commutativeN/A

      \[\leadsto \mathsf{neg}\left(\left(-1 \cdot \frac{c}{{b}^{2}} + \frac{1}{a}\right) \cdot b\right) \]
    3. distribute-rgt-neg-inN/A

      \[\leadsto \left(-1 \cdot \frac{c}{{b}^{2}} + \frac{1}{a}\right) \cdot \color{blue}{\left(\mathsf{neg}\left(b\right)\right)} \]
    4. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\left(-1 \cdot \frac{c}{{b}^{2}} + \frac{1}{a}\right), \color{blue}{\left(\mathsf{neg}\left(b\right)\right)}\right) \]
    5. +-commutativeN/A

      \[\leadsto \mathsf{*.f64}\left(\left(\frac{1}{a} + -1 \cdot \frac{c}{{b}^{2}}\right), \left(\mathsf{neg}\left(\color{blue}{b}\right)\right)\right) \]
    6. mul-1-negN/A

      \[\leadsto \mathsf{*.f64}\left(\left(\frac{1}{a} + \left(\mathsf{neg}\left(\frac{c}{{b}^{2}}\right)\right)\right), \left(\mathsf{neg}\left(b\right)\right)\right) \]
    7. unsub-negN/A

      \[\leadsto \mathsf{*.f64}\left(\left(\frac{1}{a} - \frac{c}{{b}^{2}}\right), \left(\mathsf{neg}\left(\color{blue}{b}\right)\right)\right) \]
    8. --lowering--.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\left(\frac{1}{a}\right), \left(\frac{c}{{b}^{2}}\right)\right), \left(\mathsf{neg}\left(\color{blue}{b}\right)\right)\right) \]
    9. /-lowering-/.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, a\right), \left(\frac{c}{{b}^{2}}\right)\right), \left(\mathsf{neg}\left(b\right)\right)\right) \]
    10. /-lowering-/.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, a\right), \mathsf{/.f64}\left(c, \left({b}^{2}\right)\right)\right), \left(\mathsf{neg}\left(b\right)\right)\right) \]
    11. unpow2N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, a\right), \mathsf{/.f64}\left(c, \left(b \cdot b\right)\right)\right), \left(\mathsf{neg}\left(b\right)\right)\right) \]
    12. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, a\right), \mathsf{/.f64}\left(c, \mathsf{*.f64}\left(b, b\right)\right)\right), \left(\mathsf{neg}\left(b\right)\right)\right) \]
    13. neg-sub0N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, a\right), \mathsf{/.f64}\left(c, \mathsf{*.f64}\left(b, b\right)\right)\right), \left(0 - \color{blue}{b}\right)\right) \]
    14. --lowering--.f6436.1%

      \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, a\right), \mathsf{/.f64}\left(c, \mathsf{*.f64}\left(b, b\right)\right)\right), \mathsf{\_.f64}\left(0, \color{blue}{b}\right)\right) \]
  5. Simplified36.1%

    \[\leadsto \color{blue}{\left(\frac{1}{a} - \frac{c}{b \cdot b}\right) \cdot \left(0 - b\right)} \]
  6. Taylor expanded in a around inf

    \[\leadsto \color{blue}{\frac{c}{b}} \]
  7. Step-by-step derivation
    1. /-lowering-/.f648.6%

      \[\leadsto \mathsf{/.f64}\left(c, \color{blue}{b}\right) \]
  8. Simplified8.6%

    \[\leadsto \color{blue}{\frac{c}{b}} \]
  9. Add Preprocessing

Alternative 14: 2.5% accurate, 38.7× speedup?

\[\begin{array}{l} \\ \frac{b}{a} \end{array} \]
(FPCore (a b c) :precision binary64 (/ b a))
double code(double a, double b, double c) {
	return b / 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 / a
end function
public static double code(double a, double b, double c) {
	return b / a;
}
def code(a, b, c):
	return b / a
function code(a, b, c)
	return Float64(b / a)
end
function tmp = code(a, b, c)
	tmp = b / a;
end
code[a_, b_, c_] := N[(b / a), $MachinePrecision]
\begin{array}{l}

\\
\frac{b}{a}
\end{array}
Derivation
  1. Initial program 51.3%

    \[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a} \]
  2. Add Preprocessing
  3. Step-by-step derivation
    1. *-commutativeN/A

      \[\leadsto \frac{\left(\mathsf{neg}\left(b\right)\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{a \cdot \color{blue}{2}} \]
    2. clear-numN/A

      \[\leadsto \frac{1}{\color{blue}{\frac{a \cdot 2}{\left(\mathsf{neg}\left(b\right)\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}}} \]
    3. associate-/r/N/A

      \[\leadsto \frac{1}{a \cdot 2} \cdot \color{blue}{\left(\left(\mathsf{neg}\left(b\right)\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}\right)} \]
    4. flip-+N/A

      \[\leadsto \frac{1}{a \cdot 2} \cdot \frac{\left(\mathsf{neg}\left(b\right)\right) \cdot \left(\mathsf{neg}\left(b\right)\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c} \cdot \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{\color{blue}{\left(\mathsf{neg}\left(b\right)\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}} \]
    5. clear-numN/A

      \[\leadsto \frac{1}{a \cdot 2} \cdot \frac{1}{\color{blue}{\frac{\left(\mathsf{neg}\left(b\right)\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{\left(\mathsf{neg}\left(b\right)\right) \cdot \left(\mathsf{neg}\left(b\right)\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c} \cdot \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}}} \]
    6. un-div-invN/A

      \[\leadsto \frac{\frac{1}{a \cdot 2}}{\color{blue}{\frac{\left(\mathsf{neg}\left(b\right)\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{\left(\mathsf{neg}\left(b\right)\right) \cdot \left(\mathsf{neg}\left(b\right)\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c} \cdot \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}}} \]
    7. /-lowering-/.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\left(\frac{1}{a \cdot 2}\right), \color{blue}{\left(\frac{\left(\mathsf{neg}\left(b\right)\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{\left(\mathsf{neg}\left(b\right)\right) \cdot \left(\mathsf{neg}\left(b\right)\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c} \cdot \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}\right)}\right) \]
  4. Applied egg-rr50.7%

    \[\leadsto \color{blue}{\frac{\frac{0.5}{a}}{\frac{1}{\sqrt{b \cdot b + a \cdot \left(c \cdot -4\right)} - b}}} \]
  5. Taylor expanded in a around 0

    \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\frac{1}{2}, a\right), \color{blue}{\left(\frac{\frac{-1}{2} \cdot \frac{b}{c} + \frac{1}{2} \cdot \frac{a}{b}}{a}\right)}\right) \]
  6. Step-by-step derivation
    1. /-lowering-/.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\frac{1}{2}, a\right), \mathsf{/.f64}\left(\left(\frac{-1}{2} \cdot \frac{b}{c} + \frac{1}{2} \cdot \frac{a}{b}\right), \color{blue}{a}\right)\right) \]
    2. +-lowering-+.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\frac{1}{2}, a\right), \mathsf{/.f64}\left(\mathsf{+.f64}\left(\left(\frac{-1}{2} \cdot \frac{b}{c}\right), \left(\frac{1}{2} \cdot \frac{a}{b}\right)\right), a\right)\right) \]
    3. *-lowering-*.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\frac{1}{2}, a\right), \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\frac{-1}{2}, \left(\frac{b}{c}\right)\right), \left(\frac{1}{2} \cdot \frac{a}{b}\right)\right), a\right)\right) \]
    4. /-lowering-/.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\frac{1}{2}, a\right), \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\frac{-1}{2}, \mathsf{/.f64}\left(b, c\right)\right), \left(\frac{1}{2} \cdot \frac{a}{b}\right)\right), a\right)\right) \]
    5. *-lowering-*.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\frac{1}{2}, a\right), \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\frac{-1}{2}, \mathsf{/.f64}\left(b, c\right)\right), \mathsf{*.f64}\left(\frac{1}{2}, \left(\frac{a}{b}\right)\right)\right), a\right)\right) \]
    6. /-lowering-/.f6427.1%

      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\frac{1}{2}, a\right), \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\frac{-1}{2}, \mathsf{/.f64}\left(b, c\right)\right), \mathsf{*.f64}\left(\frac{1}{2}, \mathsf{/.f64}\left(a, b\right)\right)\right), a\right)\right) \]
  7. Simplified27.1%

    \[\leadsto \frac{\frac{0.5}{a}}{\color{blue}{\frac{-0.5 \cdot \frac{b}{c} + 0.5 \cdot \frac{a}{b}}{a}}} \]
  8. Taylor expanded in a around inf

    \[\leadsto \color{blue}{\frac{b}{a}} \]
  9. Step-by-step derivation
    1. /-lowering-/.f642.3%

      \[\leadsto \mathsf{/.f64}\left(b, \color{blue}{a}\right) \]
  10. Simplified2.3%

    \[\leadsto \color{blue}{\frac{b}{a}} \]
  11. Add Preprocessing

Developer Target 1: 70.8% accurate, 0.9× 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 2024160 
(FPCore (a b c)
  :name "The quadratic formula (r1)"
  :precision binary64

  :alt
  (! :herbie-platform default (let ((d (- (* b b) (* (* 4 a) c)))) (let ((r1 (/ (+ (- b) (sqrt d)) (* 2 a)))) (let ((r2 (/ (- (- b) (sqrt d)) (* 2 a)))) (if (< b 0) r1 (/ c (* a r2)))))))

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