The quadratic formula (r1)

Percentage Accurate: 52.1% → 85.4%
Time: 5.1s
Alternatives: 9
Speedup: 2.2×

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);
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

real(8) function code(a, b, c)
use fmin_fmax_functions
    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}

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 9 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.1% 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);
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

real(8) function code(a, b, c)
use fmin_fmax_functions
    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.4% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq -3.5 \cdot 10^{+120}:\\ \;\;\;\;-1 \cdot \frac{b}{a}\\ \mathbf{elif}\;b \leq 3.9 \cdot 10^{-64}:\\ \;\;\;\;\frac{\mathsf{fma}\left(\frac{\sqrt{\mathsf{fma}\left(c \cdot -4, a, b \cdot b\right)}}{a + a}, a, b \cdot -0.5\right)}{a}\\ \mathbf{else}:\\ \;\;\;\;-1 \cdot \frac{c}{b}\\ \end{array} \end{array} \]
(FPCore (a b c)
 :precision binary64
 (if (<= b -3.5e+120)
   (* -1.0 (/ b a))
   (if (<= b 3.9e-64)
     (/ (fma (/ (sqrt (fma (* c -4.0) a (* b b))) (+ a a)) a (* b -0.5)) a)
     (* -1.0 (/ c b)))))
double code(double a, double b, double c) {
	double tmp;
	if (b <= -3.5e+120) {
		tmp = -1.0 * (b / a);
	} else if (b <= 3.9e-64) {
		tmp = fma((sqrt(fma((c * -4.0), a, (b * b))) / (a + a)), a, (b * -0.5)) / a;
	} else {
		tmp = -1.0 * (c / b);
	}
	return tmp;
}
function code(a, b, c)
	tmp = 0.0
	if (b <= -3.5e+120)
		tmp = Float64(-1.0 * Float64(b / a));
	elseif (b <= 3.9e-64)
		tmp = Float64(fma(Float64(sqrt(fma(Float64(c * -4.0), a, Float64(b * b))) / Float64(a + a)), a, Float64(b * -0.5)) / a);
	else
		tmp = Float64(-1.0 * Float64(c / b));
	end
	return tmp
end
code[a_, b_, c_] := If[LessEqual[b, -3.5e+120], N[(-1.0 * N[(b / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 3.9e-64], N[(N[(N[(N[Sqrt[N[(N[(c * -4.0), $MachinePrecision] * a + N[(b * b), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(a + a), $MachinePrecision]), $MachinePrecision] * a + N[(b * -0.5), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision], N[(-1.0 * N[(c / b), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

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

\mathbf{elif}\;b \leq 3.9 \cdot 10^{-64}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\frac{\sqrt{\mathsf{fma}\left(c \cdot -4, a, b \cdot b\right)}}{a + a}, a, b \cdot -0.5\right)}{a}\\

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


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

    1. Initial program 52.1%

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

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

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

        \[\leadsto \color{blue}{\frac{1}{\frac{2 \cdot a}{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}}} \]
      4. lower-unsound-/.f6452.0

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

        \[\leadsto \frac{1}{\frac{\color{blue}{2 \cdot a}}{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}} \]
      6. count-2-revN/A

        \[\leadsto \frac{1}{\frac{\color{blue}{a + a}}{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}} \]
      7. lower-+.f6452.0

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

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

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

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

        \[\leadsto \frac{1}{\frac{a + a}{\color{blue}{\sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c} - \left(\mathsf{neg}\left(\left(-b\right)\right)\right)}}} \]
    3. Applied rewrites52.1%

      \[\leadsto \color{blue}{\frac{1}{\frac{a + a}{\sqrt{\mathsf{fma}\left(c \cdot -4, a, b \cdot b\right)} - b}}} \]
    4. Step-by-step derivation
      1. lift-/.f64N/A

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

        \[\leadsto \frac{1}{\color{blue}{\frac{a + a}{\sqrt{\mathsf{fma}\left(c \cdot -4, a, b \cdot b\right)} - b}}} \]
      3. mult-flipN/A

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

        \[\leadsto \color{blue}{\frac{\frac{1}{a + a}}{\frac{1}{\sqrt{\mathsf{fma}\left(c \cdot -4, a, b \cdot b\right)} - b}}} \]
      5. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{\frac{1}{a + a}}{\frac{1}{\sqrt{\mathsf{fma}\left(c \cdot -4, a, b \cdot b\right)} - b}}} \]
      6. lift-+.f64N/A

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

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

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

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

        \[\leadsto \frac{\color{blue}{\frac{\frac{1}{2}}{a}}}{\frac{1}{\sqrt{\mathsf{fma}\left(c \cdot -4, a, b \cdot b\right)} - b}} \]
      11. lower-/.f6452.0

        \[\leadsto \frac{\frac{0.5}{a}}{\color{blue}{\frac{1}{\sqrt{\mathsf{fma}\left(c \cdot -4, a, b \cdot b\right)} - b}}} \]
      12. lift-*.f64N/A

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

        \[\leadsto \frac{\frac{\frac{1}{2}}{a}}{\frac{1}{\sqrt{\mathsf{fma}\left(\color{blue}{-4 \cdot c}, a, b \cdot b\right)} - b}} \]
      14. lift-*.f6452.0

        \[\leadsto \frac{\frac{0.5}{a}}{\frac{1}{\sqrt{\mathsf{fma}\left(\color{blue}{-4 \cdot c}, a, b \cdot b\right)} - b}} \]
    5. Applied rewrites52.0%

      \[\leadsto \color{blue}{\frac{\frac{0.5}{a}}{\frac{1}{\sqrt{\mathsf{fma}\left(-4 \cdot c, a, b \cdot b\right)} - b}}} \]
    6. Taylor expanded in b around -inf

      \[\leadsto \color{blue}{-1 \cdot \frac{b}{a}} \]
    7. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto -1 \cdot \color{blue}{\frac{b}{a}} \]
      2. lower-/.f6436.1

        \[\leadsto -1 \cdot \frac{b}{\color{blue}{a}} \]
    8. Applied rewrites36.1%

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

    if -3.50000000000000007e120 < b < 3.8999999999999997e-64

    1. Initial program 52.1%

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

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

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

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

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

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

        \[\leadsto \frac{\sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a} + \color{blue}{\frac{\frac{-b}{2}}{a}} \]
      7. add-to-fractionN/A

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

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

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

        \[\leadsto \frac{\mathsf{fma}\left(\frac{\sqrt{\mathsf{fma}\left(c \cdot -4, a, b \cdot b\right)}}{a + a}, a, \color{blue}{\frac{b}{-2}}\right)}{a} \]
      2. mult-flipN/A

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

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

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

        \[\leadsto \frac{\mathsf{fma}\left(\frac{\sqrt{\mathsf{fma}\left(c \cdot -4, a, b \cdot b\right)}}{a + a}, a, \color{blue}{b \cdot \left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}\right)}{a} \]
      6. metadata-eval50.0

        \[\leadsto \frac{\mathsf{fma}\left(\frac{\sqrt{\mathsf{fma}\left(c \cdot -4, a, b \cdot b\right)}}{a + a}, a, b \cdot \color{blue}{-0.5}\right)}{a} \]
    5. Applied rewrites50.0%

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

    if 3.8999999999999997e-64 < b

    1. Initial program 52.1%

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

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

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

        \[\leadsto \color{blue}{\frac{1}{\frac{2 \cdot a}{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}}} \]
      4. lower-unsound-/.f6452.0

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

        \[\leadsto \frac{1}{\frac{\color{blue}{2 \cdot a}}{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}} \]
      6. count-2-revN/A

        \[\leadsto \frac{1}{\frac{\color{blue}{a + a}}{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}} \]
      7. lower-+.f6452.0

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

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

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

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

        \[\leadsto \frac{1}{\frac{a + a}{\color{blue}{\sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c} - \left(\mathsf{neg}\left(\left(-b\right)\right)\right)}}} \]
    3. Applied rewrites52.1%

      \[\leadsto \color{blue}{\frac{1}{\frac{a + a}{\sqrt{\mathsf{fma}\left(c \cdot -4, a, b \cdot b\right)} - b}}} \]
    4. Step-by-step derivation
      1. lift-/.f64N/A

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

        \[\leadsto \frac{1}{\color{blue}{\frac{a + a}{\sqrt{\mathsf{fma}\left(c \cdot -4, a, b \cdot b\right)} - b}}} \]
      3. mult-flipN/A

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

        \[\leadsto \color{blue}{\frac{\frac{1}{a + a}}{\frac{1}{\sqrt{\mathsf{fma}\left(c \cdot -4, a, b \cdot b\right)} - b}}} \]
      5. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{\frac{1}{a + a}}{\frac{1}{\sqrt{\mathsf{fma}\left(c \cdot -4, a, b \cdot b\right)} - b}}} \]
      6. lift-+.f64N/A

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

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

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

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

        \[\leadsto \frac{\color{blue}{\frac{\frac{1}{2}}{a}}}{\frac{1}{\sqrt{\mathsf{fma}\left(c \cdot -4, a, b \cdot b\right)} - b}} \]
      11. lower-/.f6452.0

        \[\leadsto \frac{\frac{0.5}{a}}{\color{blue}{\frac{1}{\sqrt{\mathsf{fma}\left(c \cdot -4, a, b \cdot b\right)} - b}}} \]
      12. lift-*.f64N/A

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

        \[\leadsto \frac{\frac{\frac{1}{2}}{a}}{\frac{1}{\sqrt{\mathsf{fma}\left(\color{blue}{-4 \cdot c}, a, b \cdot b\right)} - b}} \]
      14. lift-*.f6452.0

        \[\leadsto \frac{\frac{0.5}{a}}{\frac{1}{\sqrt{\mathsf{fma}\left(\color{blue}{-4 \cdot c}, a, b \cdot b\right)} - b}} \]
    5. Applied rewrites52.0%

      \[\leadsto \color{blue}{\frac{\frac{0.5}{a}}{\frac{1}{\sqrt{\mathsf{fma}\left(-4 \cdot c, a, b \cdot b\right)} - b}}} \]
    6. Taylor expanded in b around inf

      \[\leadsto \color{blue}{-1 \cdot \frac{c}{b}} \]
    7. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto -1 \cdot \color{blue}{\frac{c}{b}} \]
      2. lower-/.f6434.6

        \[\leadsto -1 \cdot \frac{c}{\color{blue}{b}} \]
    8. Applied rewrites34.6%

      \[\leadsto \color{blue}{-1 \cdot \frac{c}{b}} \]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 2: 85.4% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq -3.5 \cdot 10^{+120}:\\ \;\;\;\;-1 \cdot \frac{b}{a}\\ \mathbf{elif}\;b \leq 3.9 \cdot 10^{-64}:\\ \;\;\;\;\mathsf{fma}\left(b, \frac{-0.5}{a}, \frac{\sqrt{\mathsf{fma}\left(c \cdot -4, a, b \cdot b\right)}}{a + a}\right)\\ \mathbf{else}:\\ \;\;\;\;-1 \cdot \frac{c}{b}\\ \end{array} \end{array} \]
(FPCore (a b c)
 :precision binary64
 (if (<= b -3.5e+120)
   (* -1.0 (/ b a))
   (if (<= b 3.9e-64)
     (fma b (/ -0.5 a) (/ (sqrt (fma (* c -4.0) a (* b b))) (+ a a)))
     (* -1.0 (/ c b)))))
double code(double a, double b, double c) {
	double tmp;
	if (b <= -3.5e+120) {
		tmp = -1.0 * (b / a);
	} else if (b <= 3.9e-64) {
		tmp = fma(b, (-0.5 / a), (sqrt(fma((c * -4.0), a, (b * b))) / (a + a)));
	} else {
		tmp = -1.0 * (c / b);
	}
	return tmp;
}
function code(a, b, c)
	tmp = 0.0
	if (b <= -3.5e+120)
		tmp = Float64(-1.0 * Float64(b / a));
	elseif (b <= 3.9e-64)
		tmp = fma(b, Float64(-0.5 / a), Float64(sqrt(fma(Float64(c * -4.0), a, Float64(b * b))) / Float64(a + a)));
	else
		tmp = Float64(-1.0 * Float64(c / b));
	end
	return tmp
end
code[a_, b_, c_] := If[LessEqual[b, -3.5e+120], N[(-1.0 * N[(b / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 3.9e-64], N[(b * N[(-0.5 / a), $MachinePrecision] + N[(N[Sqrt[N[(N[(c * -4.0), $MachinePrecision] * a + N[(b * b), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(a + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-1.0 * N[(c / b), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

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

\mathbf{elif}\;b \leq 3.9 \cdot 10^{-64}:\\
\;\;\;\;\mathsf{fma}\left(b, \frac{-0.5}{a}, \frac{\sqrt{\mathsf{fma}\left(c \cdot -4, a, b \cdot b\right)}}{a + a}\right)\\

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


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

    1. Initial program 52.1%

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

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

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

        \[\leadsto \color{blue}{\frac{1}{\frac{2 \cdot a}{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}}} \]
      4. lower-unsound-/.f6452.0

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

        \[\leadsto \frac{1}{\frac{\color{blue}{2 \cdot a}}{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}} \]
      6. count-2-revN/A

        \[\leadsto \frac{1}{\frac{\color{blue}{a + a}}{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}} \]
      7. lower-+.f6452.0

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

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

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

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

        \[\leadsto \frac{1}{\frac{a + a}{\color{blue}{\sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c} - \left(\mathsf{neg}\left(\left(-b\right)\right)\right)}}} \]
    3. Applied rewrites52.1%

      \[\leadsto \color{blue}{\frac{1}{\frac{a + a}{\sqrt{\mathsf{fma}\left(c \cdot -4, a, b \cdot b\right)} - b}}} \]
    4. Step-by-step derivation
      1. lift-/.f64N/A

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

        \[\leadsto \frac{1}{\color{blue}{\frac{a + a}{\sqrt{\mathsf{fma}\left(c \cdot -4, a, b \cdot b\right)} - b}}} \]
      3. mult-flipN/A

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

        \[\leadsto \color{blue}{\frac{\frac{1}{a + a}}{\frac{1}{\sqrt{\mathsf{fma}\left(c \cdot -4, a, b \cdot b\right)} - b}}} \]
      5. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{\frac{1}{a + a}}{\frac{1}{\sqrt{\mathsf{fma}\left(c \cdot -4, a, b \cdot b\right)} - b}}} \]
      6. lift-+.f64N/A

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

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

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

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

        \[\leadsto \frac{\color{blue}{\frac{\frac{1}{2}}{a}}}{\frac{1}{\sqrt{\mathsf{fma}\left(c \cdot -4, a, b \cdot b\right)} - b}} \]
      11. lower-/.f6452.0

        \[\leadsto \frac{\frac{0.5}{a}}{\color{blue}{\frac{1}{\sqrt{\mathsf{fma}\left(c \cdot -4, a, b \cdot b\right)} - b}}} \]
      12. lift-*.f64N/A

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

        \[\leadsto \frac{\frac{\frac{1}{2}}{a}}{\frac{1}{\sqrt{\mathsf{fma}\left(\color{blue}{-4 \cdot c}, a, b \cdot b\right)} - b}} \]
      14. lift-*.f6452.0

        \[\leadsto \frac{\frac{0.5}{a}}{\frac{1}{\sqrt{\mathsf{fma}\left(\color{blue}{-4 \cdot c}, a, b \cdot b\right)} - b}} \]
    5. Applied rewrites52.0%

      \[\leadsto \color{blue}{\frac{\frac{0.5}{a}}{\frac{1}{\sqrt{\mathsf{fma}\left(-4 \cdot c, a, b \cdot b\right)} - b}}} \]
    6. Taylor expanded in b around -inf

      \[\leadsto \color{blue}{-1 \cdot \frac{b}{a}} \]
    7. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto -1 \cdot \color{blue}{\frac{b}{a}} \]
      2. lower-/.f6436.1

        \[\leadsto -1 \cdot \frac{b}{\color{blue}{a}} \]
    8. Applied rewrites36.1%

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

    if -3.50000000000000007e120 < b < 3.8999999999999997e-64

    1. Initial program 52.1%

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

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

        \[\leadsto \frac{\color{blue}{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}}{2 \cdot a} \]
      3. div-addN/A

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\mathsf{neg}\left(\color{blue}{\left(\mathsf{neg}\left(b\right)\right)}\right), \frac{1}{\mathsf{neg}\left(2 \cdot a\right)}, \frac{\sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}\right) \]
      8. remove-double-negN/A

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

        \[\leadsto \mathsf{fma}\left(b, \frac{1}{\mathsf{neg}\left(\color{blue}{2 \cdot a}\right)}, \frac{\sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}\right) \]
      10. distribute-lft-neg-inN/A

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(b, \frac{\color{blue}{\frac{-1}{2}}}{a}, \frac{\sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}\right) \]
      17. lower-/.f6450.0

        \[\leadsto \mathsf{fma}\left(b, \frac{-0.5}{a}, \color{blue}{\frac{\sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}}\right) \]
    3. Applied rewrites50.0%

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

    if 3.8999999999999997e-64 < b

    1. Initial program 52.1%

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

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

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

        \[\leadsto \color{blue}{\frac{1}{\frac{2 \cdot a}{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}}} \]
      4. lower-unsound-/.f6452.0

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

        \[\leadsto \frac{1}{\frac{\color{blue}{2 \cdot a}}{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}} \]
      6. count-2-revN/A

        \[\leadsto \frac{1}{\frac{\color{blue}{a + a}}{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}} \]
      7. lower-+.f6452.0

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

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

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

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

        \[\leadsto \frac{1}{\frac{a + a}{\color{blue}{\sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c} - \left(\mathsf{neg}\left(\left(-b\right)\right)\right)}}} \]
    3. Applied rewrites52.1%

      \[\leadsto \color{blue}{\frac{1}{\frac{a + a}{\sqrt{\mathsf{fma}\left(c \cdot -4, a, b \cdot b\right)} - b}}} \]
    4. Step-by-step derivation
      1. lift-/.f64N/A

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

        \[\leadsto \frac{1}{\color{blue}{\frac{a + a}{\sqrt{\mathsf{fma}\left(c \cdot -4, a, b \cdot b\right)} - b}}} \]
      3. mult-flipN/A

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

        \[\leadsto \color{blue}{\frac{\frac{1}{a + a}}{\frac{1}{\sqrt{\mathsf{fma}\left(c \cdot -4, a, b \cdot b\right)} - b}}} \]
      5. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{\frac{1}{a + a}}{\frac{1}{\sqrt{\mathsf{fma}\left(c \cdot -4, a, b \cdot b\right)} - b}}} \]
      6. lift-+.f64N/A

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

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

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

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

        \[\leadsto \frac{\color{blue}{\frac{\frac{1}{2}}{a}}}{\frac{1}{\sqrt{\mathsf{fma}\left(c \cdot -4, a, b \cdot b\right)} - b}} \]
      11. lower-/.f6452.0

        \[\leadsto \frac{\frac{0.5}{a}}{\color{blue}{\frac{1}{\sqrt{\mathsf{fma}\left(c \cdot -4, a, b \cdot b\right)} - b}}} \]
      12. lift-*.f64N/A

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

        \[\leadsto \frac{\frac{\frac{1}{2}}{a}}{\frac{1}{\sqrt{\mathsf{fma}\left(\color{blue}{-4 \cdot c}, a, b \cdot b\right)} - b}} \]
      14. lift-*.f6452.0

        \[\leadsto \frac{\frac{0.5}{a}}{\frac{1}{\sqrt{\mathsf{fma}\left(\color{blue}{-4 \cdot c}, a, b \cdot b\right)} - b}} \]
    5. Applied rewrites52.0%

      \[\leadsto \color{blue}{\frac{\frac{0.5}{a}}{\frac{1}{\sqrt{\mathsf{fma}\left(-4 \cdot c, a, b \cdot b\right)} - b}}} \]
    6. Taylor expanded in b around inf

      \[\leadsto \color{blue}{-1 \cdot \frac{c}{b}} \]
    7. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto -1 \cdot \color{blue}{\frac{c}{b}} \]
      2. lower-/.f6434.6

        \[\leadsto -1 \cdot \frac{c}{\color{blue}{b}} \]
    8. Applied rewrites34.6%

      \[\leadsto \color{blue}{-1 \cdot \frac{c}{b}} \]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 3: 85.4% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq -3.5 \cdot 10^{+120}:\\ \;\;\;\;-1 \cdot \frac{b}{a}\\ \mathbf{elif}\;b \leq 3.9 \cdot 10^{-64}:\\ \;\;\;\;\frac{\sqrt{\mathsf{fma}\left(c \cdot -4, a, b \cdot b\right)} - b}{a + a}\\ \mathbf{else}:\\ \;\;\;\;-1 \cdot \frac{c}{b}\\ \end{array} \end{array} \]
(FPCore (a b c)
 :precision binary64
 (if (<= b -3.5e+120)
   (* -1.0 (/ b a))
   (if (<= b 3.9e-64)
     (/ (- (sqrt (fma (* c -4.0) a (* b b))) b) (+ a a))
     (* -1.0 (/ c b)))))
double code(double a, double b, double c) {
	double tmp;
	if (b <= -3.5e+120) {
		tmp = -1.0 * (b / a);
	} else if (b <= 3.9e-64) {
		tmp = (sqrt(fma((c * -4.0), a, (b * b))) - b) / (a + a);
	} else {
		tmp = -1.0 * (c / b);
	}
	return tmp;
}
function code(a, b, c)
	tmp = 0.0
	if (b <= -3.5e+120)
		tmp = Float64(-1.0 * Float64(b / a));
	elseif (b <= 3.9e-64)
		tmp = Float64(Float64(sqrt(fma(Float64(c * -4.0), a, Float64(b * b))) - b) / Float64(a + a));
	else
		tmp = Float64(-1.0 * Float64(c / b));
	end
	return tmp
end
code[a_, b_, c_] := If[LessEqual[b, -3.5e+120], N[(-1.0 * N[(b / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 3.9e-64], N[(N[(N[Sqrt[N[(N[(c * -4.0), $MachinePrecision] * a + N[(b * b), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision] / N[(a + a), $MachinePrecision]), $MachinePrecision], N[(-1.0 * N[(c / b), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

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

\mathbf{elif}\;b \leq 3.9 \cdot 10^{-64}:\\
\;\;\;\;\frac{\sqrt{\mathsf{fma}\left(c \cdot -4, a, b \cdot b\right)} - b}{a + a}\\

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


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

    1. Initial program 52.1%

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

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

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

        \[\leadsto \color{blue}{\frac{1}{\frac{2 \cdot a}{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}}} \]
      4. lower-unsound-/.f6452.0

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

        \[\leadsto \frac{1}{\frac{\color{blue}{2 \cdot a}}{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}} \]
      6. count-2-revN/A

        \[\leadsto \frac{1}{\frac{\color{blue}{a + a}}{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}} \]
      7. lower-+.f6452.0

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

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

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

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

        \[\leadsto \frac{1}{\frac{a + a}{\color{blue}{\sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c} - \left(\mathsf{neg}\left(\left(-b\right)\right)\right)}}} \]
    3. Applied rewrites52.1%

      \[\leadsto \color{blue}{\frac{1}{\frac{a + a}{\sqrt{\mathsf{fma}\left(c \cdot -4, a, b \cdot b\right)} - b}}} \]
    4. Step-by-step derivation
      1. lift-/.f64N/A

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

        \[\leadsto \frac{1}{\color{blue}{\frac{a + a}{\sqrt{\mathsf{fma}\left(c \cdot -4, a, b \cdot b\right)} - b}}} \]
      3. mult-flipN/A

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

        \[\leadsto \color{blue}{\frac{\frac{1}{a + a}}{\frac{1}{\sqrt{\mathsf{fma}\left(c \cdot -4, a, b \cdot b\right)} - b}}} \]
      5. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{\frac{1}{a + a}}{\frac{1}{\sqrt{\mathsf{fma}\left(c \cdot -4, a, b \cdot b\right)} - b}}} \]
      6. lift-+.f64N/A

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

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

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

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

        \[\leadsto \frac{\color{blue}{\frac{\frac{1}{2}}{a}}}{\frac{1}{\sqrt{\mathsf{fma}\left(c \cdot -4, a, b \cdot b\right)} - b}} \]
      11. lower-/.f6452.0

        \[\leadsto \frac{\frac{0.5}{a}}{\color{blue}{\frac{1}{\sqrt{\mathsf{fma}\left(c \cdot -4, a, b \cdot b\right)} - b}}} \]
      12. lift-*.f64N/A

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

        \[\leadsto \frac{\frac{\frac{1}{2}}{a}}{\frac{1}{\sqrt{\mathsf{fma}\left(\color{blue}{-4 \cdot c}, a, b \cdot b\right)} - b}} \]
      14. lift-*.f6452.0

        \[\leadsto \frac{\frac{0.5}{a}}{\frac{1}{\sqrt{\mathsf{fma}\left(\color{blue}{-4 \cdot c}, a, b \cdot b\right)} - b}} \]
    5. Applied rewrites52.0%

      \[\leadsto \color{blue}{\frac{\frac{0.5}{a}}{\frac{1}{\sqrt{\mathsf{fma}\left(-4 \cdot c, a, b \cdot b\right)} - b}}} \]
    6. Taylor expanded in b around -inf

      \[\leadsto \color{blue}{-1 \cdot \frac{b}{a}} \]
    7. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto -1 \cdot \color{blue}{\frac{b}{a}} \]
      2. lower-/.f6436.1

        \[\leadsto -1 \cdot \frac{b}{\color{blue}{a}} \]
    8. Applied rewrites36.1%

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

    if -3.50000000000000007e120 < b < 3.8999999999999997e-64

    1. Initial program 52.1%

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

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

      if 3.8999999999999997e-64 < b

      1. Initial program 52.1%

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

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

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

          \[\leadsto \color{blue}{\frac{1}{\frac{2 \cdot a}{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}}} \]
        4. lower-unsound-/.f6452.0

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

          \[\leadsto \frac{1}{\frac{\color{blue}{2 \cdot a}}{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}} \]
        6. count-2-revN/A

          \[\leadsto \frac{1}{\frac{\color{blue}{a + a}}{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}} \]
        7. lower-+.f6452.0

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

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

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

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

          \[\leadsto \frac{1}{\frac{a + a}{\color{blue}{\sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c} - \left(\mathsf{neg}\left(\left(-b\right)\right)\right)}}} \]
      3. Applied rewrites52.1%

        \[\leadsto \color{blue}{\frac{1}{\frac{a + a}{\sqrt{\mathsf{fma}\left(c \cdot -4, a, b \cdot b\right)} - b}}} \]
      4. Step-by-step derivation
        1. lift-/.f64N/A

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

          \[\leadsto \frac{1}{\color{blue}{\frac{a + a}{\sqrt{\mathsf{fma}\left(c \cdot -4, a, b \cdot b\right)} - b}}} \]
        3. mult-flipN/A

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

          \[\leadsto \color{blue}{\frac{\frac{1}{a + a}}{\frac{1}{\sqrt{\mathsf{fma}\left(c \cdot -4, a, b \cdot b\right)} - b}}} \]
        5. lower-/.f64N/A

          \[\leadsto \color{blue}{\frac{\frac{1}{a + a}}{\frac{1}{\sqrt{\mathsf{fma}\left(c \cdot -4, a, b \cdot b\right)} - b}}} \]
        6. lift-+.f64N/A

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

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

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

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

          \[\leadsto \frac{\color{blue}{\frac{\frac{1}{2}}{a}}}{\frac{1}{\sqrt{\mathsf{fma}\left(c \cdot -4, a, b \cdot b\right)} - b}} \]
        11. lower-/.f6452.0

          \[\leadsto \frac{\frac{0.5}{a}}{\color{blue}{\frac{1}{\sqrt{\mathsf{fma}\left(c \cdot -4, a, b \cdot b\right)} - b}}} \]
        12. lift-*.f64N/A

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

          \[\leadsto \frac{\frac{\frac{1}{2}}{a}}{\frac{1}{\sqrt{\mathsf{fma}\left(\color{blue}{-4 \cdot c}, a, b \cdot b\right)} - b}} \]
        14. lift-*.f6452.0

          \[\leadsto \frac{\frac{0.5}{a}}{\frac{1}{\sqrt{\mathsf{fma}\left(\color{blue}{-4 \cdot c}, a, b \cdot b\right)} - b}} \]
      5. Applied rewrites52.0%

        \[\leadsto \color{blue}{\frac{\frac{0.5}{a}}{\frac{1}{\sqrt{\mathsf{fma}\left(-4 \cdot c, a, b \cdot b\right)} - b}}} \]
      6. Taylor expanded in b around inf

        \[\leadsto \color{blue}{-1 \cdot \frac{c}{b}} \]
      7. Step-by-step derivation
        1. lower-*.f64N/A

          \[\leadsto -1 \cdot \color{blue}{\frac{c}{b}} \]
        2. lower-/.f6434.6

          \[\leadsto -1 \cdot \frac{c}{\color{blue}{b}} \]
      8. Applied rewrites34.6%

        \[\leadsto \color{blue}{-1 \cdot \frac{c}{b}} \]
    3. Recombined 3 regimes into one program.
    4. Add Preprocessing

    Alternative 4: 80.2% accurate, 0.9× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq -2 \cdot 10^{-115}:\\ \;\;\;\;-1 \cdot \frac{b}{a}\\ \mathbf{elif}\;b \leq 3.9 \cdot 10^{-64}:\\ \;\;\;\;\frac{\mathsf{fma}\left(-0.5, b, 0.5 \cdot \sqrt{-4 \cdot \left(a \cdot c\right)}\right)}{a}\\ \mathbf{else}:\\ \;\;\;\;-1 \cdot \frac{c}{b}\\ \end{array} \end{array} \]
    (FPCore (a b c)
     :precision binary64
     (if (<= b -2e-115)
       (* -1.0 (/ b a))
       (if (<= b 3.9e-64)
         (/ (fma -0.5 b (* 0.5 (sqrt (* -4.0 (* a c))))) a)
         (* -1.0 (/ c b)))))
    double code(double a, double b, double c) {
    	double tmp;
    	if (b <= -2e-115) {
    		tmp = -1.0 * (b / a);
    	} else if (b <= 3.9e-64) {
    		tmp = fma(-0.5, b, (0.5 * sqrt((-4.0 * (a * c))))) / a;
    	} else {
    		tmp = -1.0 * (c / b);
    	}
    	return tmp;
    }
    
    function code(a, b, c)
    	tmp = 0.0
    	if (b <= -2e-115)
    		tmp = Float64(-1.0 * Float64(b / a));
    	elseif (b <= 3.9e-64)
    		tmp = Float64(fma(-0.5, b, Float64(0.5 * sqrt(Float64(-4.0 * Float64(a * c))))) / a);
    	else
    		tmp = Float64(-1.0 * Float64(c / b));
    	end
    	return tmp
    end
    
    code[a_, b_, c_] := If[LessEqual[b, -2e-115], N[(-1.0 * N[(b / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 3.9e-64], N[(N[(-0.5 * b + N[(0.5 * N[Sqrt[N[(-4.0 * N[(a * c), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision], N[(-1.0 * N[(c / b), $MachinePrecision]), $MachinePrecision]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    \mathbf{if}\;b \leq -2 \cdot 10^{-115}:\\
    \;\;\;\;-1 \cdot \frac{b}{a}\\
    
    \mathbf{elif}\;b \leq 3.9 \cdot 10^{-64}:\\
    \;\;\;\;\frac{\mathsf{fma}\left(-0.5, b, 0.5 \cdot \sqrt{-4 \cdot \left(a \cdot c\right)}\right)}{a}\\
    
    \mathbf{else}:\\
    \;\;\;\;-1 \cdot \frac{c}{b}\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 3 regimes
    2. if b < -2.0000000000000001e-115

      1. Initial program 52.1%

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

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

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

          \[\leadsto \color{blue}{\frac{1}{\frac{2 \cdot a}{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}}} \]
        4. lower-unsound-/.f6452.0

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

          \[\leadsto \frac{1}{\frac{\color{blue}{2 \cdot a}}{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}} \]
        6. count-2-revN/A

          \[\leadsto \frac{1}{\frac{\color{blue}{a + a}}{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}} \]
        7. lower-+.f6452.0

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

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

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

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

          \[\leadsto \frac{1}{\frac{a + a}{\color{blue}{\sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c} - \left(\mathsf{neg}\left(\left(-b\right)\right)\right)}}} \]
      3. Applied rewrites52.1%

        \[\leadsto \color{blue}{\frac{1}{\frac{a + a}{\sqrt{\mathsf{fma}\left(c \cdot -4, a, b \cdot b\right)} - b}}} \]
      4. Step-by-step derivation
        1. lift-/.f64N/A

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

          \[\leadsto \frac{1}{\color{blue}{\frac{a + a}{\sqrt{\mathsf{fma}\left(c \cdot -4, a, b \cdot b\right)} - b}}} \]
        3. mult-flipN/A

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

          \[\leadsto \color{blue}{\frac{\frac{1}{a + a}}{\frac{1}{\sqrt{\mathsf{fma}\left(c \cdot -4, a, b \cdot b\right)} - b}}} \]
        5. lower-/.f64N/A

          \[\leadsto \color{blue}{\frac{\frac{1}{a + a}}{\frac{1}{\sqrt{\mathsf{fma}\left(c \cdot -4, a, b \cdot b\right)} - b}}} \]
        6. lift-+.f64N/A

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

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

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

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

          \[\leadsto \frac{\color{blue}{\frac{\frac{1}{2}}{a}}}{\frac{1}{\sqrt{\mathsf{fma}\left(c \cdot -4, a, b \cdot b\right)} - b}} \]
        11. lower-/.f6452.0

          \[\leadsto \frac{\frac{0.5}{a}}{\color{blue}{\frac{1}{\sqrt{\mathsf{fma}\left(c \cdot -4, a, b \cdot b\right)} - b}}} \]
        12. lift-*.f64N/A

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

          \[\leadsto \frac{\frac{\frac{1}{2}}{a}}{\frac{1}{\sqrt{\mathsf{fma}\left(\color{blue}{-4 \cdot c}, a, b \cdot b\right)} - b}} \]
        14. lift-*.f6452.0

          \[\leadsto \frac{\frac{0.5}{a}}{\frac{1}{\sqrt{\mathsf{fma}\left(\color{blue}{-4 \cdot c}, a, b \cdot b\right)} - b}} \]
      5. Applied rewrites52.0%

        \[\leadsto \color{blue}{\frac{\frac{0.5}{a}}{\frac{1}{\sqrt{\mathsf{fma}\left(-4 \cdot c, a, b \cdot b\right)} - b}}} \]
      6. Taylor expanded in b around -inf

        \[\leadsto \color{blue}{-1 \cdot \frac{b}{a}} \]
      7. Step-by-step derivation
        1. lower-*.f64N/A

          \[\leadsto -1 \cdot \color{blue}{\frac{b}{a}} \]
        2. lower-/.f6436.1

          \[\leadsto -1 \cdot \frac{b}{\color{blue}{a}} \]
      8. Applied rewrites36.1%

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

      if -2.0000000000000001e-115 < b < 3.8999999999999997e-64

      1. Initial program 52.1%

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

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

          \[\leadsto \frac{\color{blue}{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}}{2 \cdot a} \]
        3. div-addN/A

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

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

          \[\leadsto \frac{-b}{2 \cdot a} + \color{blue}{\frac{\frac{\sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2}}{a}} \]
        6. add-to-fractionN/A

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

          \[\leadsto \color{blue}{\frac{\frac{-b}{2 \cdot a} \cdot a + \frac{\sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2}}{a}} \]
      3. Applied rewrites49.9%

        \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(\frac{b}{-2 \cdot a}, a, \sqrt{\mathsf{fma}\left(c \cdot -4, a, b \cdot b\right)} \cdot 0.5\right)}{a}} \]
      4. Step-by-step derivation
        1. lift-fma.f64N/A

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

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

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

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

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

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

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

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

          \[\leadsto \frac{\mathsf{fma}\left(b \cdot a, \frac{\color{blue}{\frac{-1}{2}}}{a}, \sqrt{\mathsf{fma}\left(c \cdot -4, a, b \cdot b\right)} \cdot \frac{1}{2}\right)}{a} \]
        10. lower-/.f6447.4

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

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

          \[\leadsto \frac{\mathsf{fma}\left(b \cdot a, \frac{\frac{-1}{2}}{a}, \color{blue}{\frac{1}{2} \cdot \sqrt{\mathsf{fma}\left(c \cdot -4, a, b \cdot b\right)}}\right)}{a} \]
        13. lower-*.f6447.4

          \[\leadsto \frac{\mathsf{fma}\left(b \cdot a, \frac{-0.5}{a}, \color{blue}{0.5 \cdot \sqrt{\mathsf{fma}\left(c \cdot -4, a, b \cdot b\right)}}\right)}{a} \]
        14. lift-*.f64N/A

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

          \[\leadsto \frac{\mathsf{fma}\left(b \cdot a, \frac{\frac{-1}{2}}{a}, \frac{1}{2} \cdot \sqrt{\mathsf{fma}\left(\color{blue}{-4 \cdot c}, a, b \cdot b\right)}\right)}{a} \]
        16. lift-*.f6447.4

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

        \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(b \cdot a, \frac{-0.5}{a}, 0.5 \cdot \sqrt{\mathsf{fma}\left(-4 \cdot c, a, b \cdot b\right)}\right)}}{a} \]
      6. Taylor expanded in b around 0

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

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

          \[\leadsto \frac{\mathsf{fma}\left(\frac{-1}{2}, b, \frac{1}{2} \cdot \sqrt{-4 \cdot \left(a \cdot c\right)}\right)}{a} \]
        3. lower-sqrt.f64N/A

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

          \[\leadsto \frac{\mathsf{fma}\left(\frac{-1}{2}, b, \frac{1}{2} \cdot \sqrt{-4 \cdot \left(a \cdot c\right)}\right)}{a} \]
        5. lower-*.f6433.0

          \[\leadsto \frac{\mathsf{fma}\left(-0.5, b, 0.5 \cdot \sqrt{-4 \cdot \left(a \cdot c\right)}\right)}{a} \]
      8. Applied rewrites33.0%

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

      if 3.8999999999999997e-64 < b

      1. Initial program 52.1%

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

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

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

          \[\leadsto \color{blue}{\frac{1}{\frac{2 \cdot a}{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}}} \]
        4. lower-unsound-/.f6452.0

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

          \[\leadsto \frac{1}{\frac{\color{blue}{2 \cdot a}}{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}} \]
        6. count-2-revN/A

          \[\leadsto \frac{1}{\frac{\color{blue}{a + a}}{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}} \]
        7. lower-+.f6452.0

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

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

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

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

          \[\leadsto \frac{1}{\frac{a + a}{\color{blue}{\sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c} - \left(\mathsf{neg}\left(\left(-b\right)\right)\right)}}} \]
      3. Applied rewrites52.1%

        \[\leadsto \color{blue}{\frac{1}{\frac{a + a}{\sqrt{\mathsf{fma}\left(c \cdot -4, a, b \cdot b\right)} - b}}} \]
      4. Step-by-step derivation
        1. lift-/.f64N/A

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

          \[\leadsto \frac{1}{\color{blue}{\frac{a + a}{\sqrt{\mathsf{fma}\left(c \cdot -4, a, b \cdot b\right)} - b}}} \]
        3. mult-flipN/A

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

          \[\leadsto \color{blue}{\frac{\frac{1}{a + a}}{\frac{1}{\sqrt{\mathsf{fma}\left(c \cdot -4, a, b \cdot b\right)} - b}}} \]
        5. lower-/.f64N/A

          \[\leadsto \color{blue}{\frac{\frac{1}{a + a}}{\frac{1}{\sqrt{\mathsf{fma}\left(c \cdot -4, a, b \cdot b\right)} - b}}} \]
        6. lift-+.f64N/A

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

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

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

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

          \[\leadsto \frac{\color{blue}{\frac{\frac{1}{2}}{a}}}{\frac{1}{\sqrt{\mathsf{fma}\left(c \cdot -4, a, b \cdot b\right)} - b}} \]
        11. lower-/.f6452.0

          \[\leadsto \frac{\frac{0.5}{a}}{\color{blue}{\frac{1}{\sqrt{\mathsf{fma}\left(c \cdot -4, a, b \cdot b\right)} - b}}} \]
        12. lift-*.f64N/A

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

          \[\leadsto \frac{\frac{\frac{1}{2}}{a}}{\frac{1}{\sqrt{\mathsf{fma}\left(\color{blue}{-4 \cdot c}, a, b \cdot b\right)} - b}} \]
        14. lift-*.f6452.0

          \[\leadsto \frac{\frac{0.5}{a}}{\frac{1}{\sqrt{\mathsf{fma}\left(\color{blue}{-4 \cdot c}, a, b \cdot b\right)} - b}} \]
      5. Applied rewrites52.0%

        \[\leadsto \color{blue}{\frac{\frac{0.5}{a}}{\frac{1}{\sqrt{\mathsf{fma}\left(-4 \cdot c, a, b \cdot b\right)} - b}}} \]
      6. Taylor expanded in b around inf

        \[\leadsto \color{blue}{-1 \cdot \frac{c}{b}} \]
      7. Step-by-step derivation
        1. lower-*.f64N/A

          \[\leadsto -1 \cdot \color{blue}{\frac{c}{b}} \]
        2. lower-/.f6434.6

          \[\leadsto -1 \cdot \frac{c}{\color{blue}{b}} \]
      8. Applied rewrites34.6%

        \[\leadsto \color{blue}{-1 \cdot \frac{c}{b}} \]
    3. Recombined 3 regimes into one program.
    4. Add Preprocessing

    Alternative 5: 80.0% accurate, 1.1× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq -4.7 \cdot 10^{-116}:\\ \;\;\;\;-1 \cdot \frac{b}{a}\\ \mathbf{elif}\;b \leq 3.9 \cdot 10^{-64}:\\ \;\;\;\;\frac{0.5 \cdot \sqrt{-4 \cdot \left(a \cdot c\right)}}{a}\\ \mathbf{else}:\\ \;\;\;\;-1 \cdot \frac{c}{b}\\ \end{array} \end{array} \]
    (FPCore (a b c)
     :precision binary64
     (if (<= b -4.7e-116)
       (* -1.0 (/ b a))
       (if (<= b 3.9e-64) (/ (* 0.5 (sqrt (* -4.0 (* a c)))) a) (* -1.0 (/ c b)))))
    double code(double a, double b, double c) {
    	double tmp;
    	if (b <= -4.7e-116) {
    		tmp = -1.0 * (b / a);
    	} else if (b <= 3.9e-64) {
    		tmp = (0.5 * sqrt((-4.0 * (a * c)))) / a;
    	} else {
    		tmp = -1.0 * (c / b);
    	}
    	return tmp;
    }
    
    module fmin_fmax_functions
        implicit none
        private
        public fmax
        public fmin
    
        interface fmax
            module procedure fmax88
            module procedure fmax44
            module procedure fmax84
            module procedure fmax48
        end interface
        interface fmin
            module procedure fmin88
            module procedure fmin44
            module procedure fmin84
            module procedure fmin48
        end interface
    contains
        real(8) function fmax88(x, y) result (res)
            real(8), intent (in) :: x
            real(8), intent (in) :: y
            res = merge(y, merge(x, max(x, y), y /= y), x /= x)
        end function
        real(4) function fmax44(x, y) result (res)
            real(4), intent (in) :: x
            real(4), intent (in) :: y
            res = merge(y, merge(x, max(x, y), y /= y), x /= x)
        end function
        real(8) function fmax84(x, y) result(res)
            real(8), intent (in) :: x
            real(4), intent (in) :: y
            res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
        end function
        real(8) function fmax48(x, y) result(res)
            real(4), intent (in) :: x
            real(8), intent (in) :: y
            res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
        end function
        real(8) function fmin88(x, y) result (res)
            real(8), intent (in) :: x
            real(8), intent (in) :: y
            res = merge(y, merge(x, min(x, y), y /= y), x /= x)
        end function
        real(4) function fmin44(x, y) result (res)
            real(4), intent (in) :: x
            real(4), intent (in) :: y
            res = merge(y, merge(x, min(x, y), y /= y), x /= x)
        end function
        real(8) function fmin84(x, y) result(res)
            real(8), intent (in) :: x
            real(4), intent (in) :: y
            res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
        end function
        real(8) function fmin48(x, y) result(res)
            real(4), intent (in) :: x
            real(8), intent (in) :: y
            res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
        end function
    end module
    
    real(8) function code(a, b, c)
    use fmin_fmax_functions
        real(8), intent (in) :: a
        real(8), intent (in) :: b
        real(8), intent (in) :: c
        real(8) :: tmp
        if (b <= (-4.7d-116)) then
            tmp = (-1.0d0) * (b / a)
        else if (b <= 3.9d-64) then
            tmp = (0.5d0 * sqrt(((-4.0d0) * (a * c)))) / a
        else
            tmp = (-1.0d0) * (c / b)
        end if
        code = tmp
    end function
    
    public static double code(double a, double b, double c) {
    	double tmp;
    	if (b <= -4.7e-116) {
    		tmp = -1.0 * (b / a);
    	} else if (b <= 3.9e-64) {
    		tmp = (0.5 * Math.sqrt((-4.0 * (a * c)))) / a;
    	} else {
    		tmp = -1.0 * (c / b);
    	}
    	return tmp;
    }
    
    def code(a, b, c):
    	tmp = 0
    	if b <= -4.7e-116:
    		tmp = -1.0 * (b / a)
    	elif b <= 3.9e-64:
    		tmp = (0.5 * math.sqrt((-4.0 * (a * c)))) / a
    	else:
    		tmp = -1.0 * (c / b)
    	return tmp
    
    function code(a, b, c)
    	tmp = 0.0
    	if (b <= -4.7e-116)
    		tmp = Float64(-1.0 * Float64(b / a));
    	elseif (b <= 3.9e-64)
    		tmp = Float64(Float64(0.5 * sqrt(Float64(-4.0 * Float64(a * c)))) / a);
    	else
    		tmp = Float64(-1.0 * Float64(c / b));
    	end
    	return tmp
    end
    
    function tmp_2 = code(a, b, c)
    	tmp = 0.0;
    	if (b <= -4.7e-116)
    		tmp = -1.0 * (b / a);
    	elseif (b <= 3.9e-64)
    		tmp = (0.5 * sqrt((-4.0 * (a * c)))) / a;
    	else
    		tmp = -1.0 * (c / b);
    	end
    	tmp_2 = tmp;
    end
    
    code[a_, b_, c_] := If[LessEqual[b, -4.7e-116], N[(-1.0 * N[(b / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 3.9e-64], N[(N[(0.5 * N[Sqrt[N[(-4.0 * N[(a * c), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision], N[(-1.0 * N[(c / b), $MachinePrecision]), $MachinePrecision]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    \mathbf{if}\;b \leq -4.7 \cdot 10^{-116}:\\
    \;\;\;\;-1 \cdot \frac{b}{a}\\
    
    \mathbf{elif}\;b \leq 3.9 \cdot 10^{-64}:\\
    \;\;\;\;\frac{0.5 \cdot \sqrt{-4 \cdot \left(a \cdot c\right)}}{a}\\
    
    \mathbf{else}:\\
    \;\;\;\;-1 \cdot \frac{c}{b}\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 3 regimes
    2. if b < -4.69999999999999994e-116

      1. Initial program 52.1%

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

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

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

          \[\leadsto \color{blue}{\frac{1}{\frac{2 \cdot a}{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}}} \]
        4. lower-unsound-/.f6452.0

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

          \[\leadsto \frac{1}{\frac{\color{blue}{2 \cdot a}}{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}} \]
        6. count-2-revN/A

          \[\leadsto \frac{1}{\frac{\color{blue}{a + a}}{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}} \]
        7. lower-+.f6452.0

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

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

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

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

          \[\leadsto \frac{1}{\frac{a + a}{\color{blue}{\sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c} - \left(\mathsf{neg}\left(\left(-b\right)\right)\right)}}} \]
      3. Applied rewrites52.1%

        \[\leadsto \color{blue}{\frac{1}{\frac{a + a}{\sqrt{\mathsf{fma}\left(c \cdot -4, a, b \cdot b\right)} - b}}} \]
      4. Step-by-step derivation
        1. lift-/.f64N/A

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

          \[\leadsto \frac{1}{\color{blue}{\frac{a + a}{\sqrt{\mathsf{fma}\left(c \cdot -4, a, b \cdot b\right)} - b}}} \]
        3. mult-flipN/A

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

          \[\leadsto \color{blue}{\frac{\frac{1}{a + a}}{\frac{1}{\sqrt{\mathsf{fma}\left(c \cdot -4, a, b \cdot b\right)} - b}}} \]
        5. lower-/.f64N/A

          \[\leadsto \color{blue}{\frac{\frac{1}{a + a}}{\frac{1}{\sqrt{\mathsf{fma}\left(c \cdot -4, a, b \cdot b\right)} - b}}} \]
        6. lift-+.f64N/A

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

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

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

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

          \[\leadsto \frac{\color{blue}{\frac{\frac{1}{2}}{a}}}{\frac{1}{\sqrt{\mathsf{fma}\left(c \cdot -4, a, b \cdot b\right)} - b}} \]
        11. lower-/.f6452.0

          \[\leadsto \frac{\frac{0.5}{a}}{\color{blue}{\frac{1}{\sqrt{\mathsf{fma}\left(c \cdot -4, a, b \cdot b\right)} - b}}} \]
        12. lift-*.f64N/A

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

          \[\leadsto \frac{\frac{\frac{1}{2}}{a}}{\frac{1}{\sqrt{\mathsf{fma}\left(\color{blue}{-4 \cdot c}, a, b \cdot b\right)} - b}} \]
        14. lift-*.f6452.0

          \[\leadsto \frac{\frac{0.5}{a}}{\frac{1}{\sqrt{\mathsf{fma}\left(\color{blue}{-4 \cdot c}, a, b \cdot b\right)} - b}} \]
      5. Applied rewrites52.0%

        \[\leadsto \color{blue}{\frac{\frac{0.5}{a}}{\frac{1}{\sqrt{\mathsf{fma}\left(-4 \cdot c, a, b \cdot b\right)} - b}}} \]
      6. Taylor expanded in b around -inf

        \[\leadsto \color{blue}{-1 \cdot \frac{b}{a}} \]
      7. Step-by-step derivation
        1. lower-*.f64N/A

          \[\leadsto -1 \cdot \color{blue}{\frac{b}{a}} \]
        2. lower-/.f6436.1

          \[\leadsto -1 \cdot \frac{b}{\color{blue}{a}} \]
      8. Applied rewrites36.1%

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

      if -4.69999999999999994e-116 < b < 3.8999999999999997e-64

      1. Initial program 52.1%

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

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

          \[\leadsto \frac{\color{blue}{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}}{2 \cdot a} \]
        3. div-addN/A

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

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

          \[\leadsto \frac{-b}{2 \cdot a} + \color{blue}{\frac{\frac{\sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2}}{a}} \]
        6. add-to-fractionN/A

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

          \[\leadsto \color{blue}{\frac{\frac{-b}{2 \cdot a} \cdot a + \frac{\sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2}}{a}} \]
      3. Applied rewrites49.9%

        \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(\frac{b}{-2 \cdot a}, a, \sqrt{\mathsf{fma}\left(c \cdot -4, a, b \cdot b\right)} \cdot 0.5\right)}{a}} \]
      4. Step-by-step derivation
        1. lift-fma.f64N/A

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

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

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

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

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

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

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

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

          \[\leadsto \frac{\mathsf{fma}\left(b \cdot a, \frac{\color{blue}{\frac{-1}{2}}}{a}, \sqrt{\mathsf{fma}\left(c \cdot -4, a, b \cdot b\right)} \cdot \frac{1}{2}\right)}{a} \]
        10. lower-/.f6447.4

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

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

          \[\leadsto \frac{\mathsf{fma}\left(b \cdot a, \frac{\frac{-1}{2}}{a}, \color{blue}{\frac{1}{2} \cdot \sqrt{\mathsf{fma}\left(c \cdot -4, a, b \cdot b\right)}}\right)}{a} \]
        13. lower-*.f6447.4

          \[\leadsto \frac{\mathsf{fma}\left(b \cdot a, \frac{-0.5}{a}, \color{blue}{0.5 \cdot \sqrt{\mathsf{fma}\left(c \cdot -4, a, b \cdot b\right)}}\right)}{a} \]
        14. lift-*.f64N/A

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

          \[\leadsto \frac{\mathsf{fma}\left(b \cdot a, \frac{\frac{-1}{2}}{a}, \frac{1}{2} \cdot \sqrt{\mathsf{fma}\left(\color{blue}{-4 \cdot c}, a, b \cdot b\right)}\right)}{a} \]
        16. lift-*.f6447.4

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

        \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(b \cdot a, \frac{-0.5}{a}, 0.5 \cdot \sqrt{\mathsf{fma}\left(-4 \cdot c, a, b \cdot b\right)}\right)}}{a} \]
      6. Taylor expanded in b around 0

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

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

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

          \[\leadsto \frac{\frac{1}{2} \cdot \sqrt{-4 \cdot \left(a \cdot c\right)}}{a} \]
        4. lower-*.f6428.6

          \[\leadsto \frac{0.5 \cdot \sqrt{-4 \cdot \left(a \cdot c\right)}}{a} \]
      8. Applied rewrites28.6%

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

      if 3.8999999999999997e-64 < b

      1. Initial program 52.1%

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

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

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

          \[\leadsto \color{blue}{\frac{1}{\frac{2 \cdot a}{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}}} \]
        4. lower-unsound-/.f6452.0

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

          \[\leadsto \frac{1}{\frac{\color{blue}{2 \cdot a}}{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}} \]
        6. count-2-revN/A

          \[\leadsto \frac{1}{\frac{\color{blue}{a + a}}{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}} \]
        7. lower-+.f6452.0

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

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

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

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

          \[\leadsto \frac{1}{\frac{a + a}{\color{blue}{\sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c} - \left(\mathsf{neg}\left(\left(-b\right)\right)\right)}}} \]
      3. Applied rewrites52.1%

        \[\leadsto \color{blue}{\frac{1}{\frac{a + a}{\sqrt{\mathsf{fma}\left(c \cdot -4, a, b \cdot b\right)} - b}}} \]
      4. Step-by-step derivation
        1. lift-/.f64N/A

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

          \[\leadsto \frac{1}{\color{blue}{\frac{a + a}{\sqrt{\mathsf{fma}\left(c \cdot -4, a, b \cdot b\right)} - b}}} \]
        3. mult-flipN/A

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

          \[\leadsto \color{blue}{\frac{\frac{1}{a + a}}{\frac{1}{\sqrt{\mathsf{fma}\left(c \cdot -4, a, b \cdot b\right)} - b}}} \]
        5. lower-/.f64N/A

          \[\leadsto \color{blue}{\frac{\frac{1}{a + a}}{\frac{1}{\sqrt{\mathsf{fma}\left(c \cdot -4, a, b \cdot b\right)} - b}}} \]
        6. lift-+.f64N/A

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

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

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

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

          \[\leadsto \frac{\color{blue}{\frac{\frac{1}{2}}{a}}}{\frac{1}{\sqrt{\mathsf{fma}\left(c \cdot -4, a, b \cdot b\right)} - b}} \]
        11. lower-/.f6452.0

          \[\leadsto \frac{\frac{0.5}{a}}{\color{blue}{\frac{1}{\sqrt{\mathsf{fma}\left(c \cdot -4, a, b \cdot b\right)} - b}}} \]
        12. lift-*.f64N/A

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

          \[\leadsto \frac{\frac{\frac{1}{2}}{a}}{\frac{1}{\sqrt{\mathsf{fma}\left(\color{blue}{-4 \cdot c}, a, b \cdot b\right)} - b}} \]
        14. lift-*.f6452.0

          \[\leadsto \frac{\frac{0.5}{a}}{\frac{1}{\sqrt{\mathsf{fma}\left(\color{blue}{-4 \cdot c}, a, b \cdot b\right)} - b}} \]
      5. Applied rewrites52.0%

        \[\leadsto \color{blue}{\frac{\frac{0.5}{a}}{\frac{1}{\sqrt{\mathsf{fma}\left(-4 \cdot c, a, b \cdot b\right)} - b}}} \]
      6. Taylor expanded in b around inf

        \[\leadsto \color{blue}{-1 \cdot \frac{c}{b}} \]
      7. Step-by-step derivation
        1. lower-*.f64N/A

          \[\leadsto -1 \cdot \color{blue}{\frac{c}{b}} \]
        2. lower-/.f6434.6

          \[\leadsto -1 \cdot \frac{c}{\color{blue}{b}} \]
      8. Applied rewrites34.6%

        \[\leadsto \color{blue}{-1 \cdot \frac{c}{b}} \]
    3. Recombined 3 regimes into one program.
    4. Add Preprocessing

    Alternative 6: 72.0% accurate, 1.2× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq -3 \cdot 10^{-138}:\\ \;\;\;\;-1 \cdot \frac{b}{a}\\ \mathbf{elif}\;b \leq 3.1 \cdot 10^{-116}:\\ \;\;\;\;0.5 \cdot \sqrt{-4 \cdot \frac{c}{a}}\\ \mathbf{else}:\\ \;\;\;\;-1 \cdot \frac{c}{b}\\ \end{array} \end{array} \]
    (FPCore (a b c)
     :precision binary64
     (if (<= b -3e-138)
       (* -1.0 (/ b a))
       (if (<= b 3.1e-116) (* 0.5 (sqrt (* -4.0 (/ c a)))) (* -1.0 (/ c b)))))
    double code(double a, double b, double c) {
    	double tmp;
    	if (b <= -3e-138) {
    		tmp = -1.0 * (b / a);
    	} else if (b <= 3.1e-116) {
    		tmp = 0.5 * sqrt((-4.0 * (c / a)));
    	} else {
    		tmp = -1.0 * (c / b);
    	}
    	return tmp;
    }
    
    module fmin_fmax_functions
        implicit none
        private
        public fmax
        public fmin
    
        interface fmax
            module procedure fmax88
            module procedure fmax44
            module procedure fmax84
            module procedure fmax48
        end interface
        interface fmin
            module procedure fmin88
            module procedure fmin44
            module procedure fmin84
            module procedure fmin48
        end interface
    contains
        real(8) function fmax88(x, y) result (res)
            real(8), intent (in) :: x
            real(8), intent (in) :: y
            res = merge(y, merge(x, max(x, y), y /= y), x /= x)
        end function
        real(4) function fmax44(x, y) result (res)
            real(4), intent (in) :: x
            real(4), intent (in) :: y
            res = merge(y, merge(x, max(x, y), y /= y), x /= x)
        end function
        real(8) function fmax84(x, y) result(res)
            real(8), intent (in) :: x
            real(4), intent (in) :: y
            res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
        end function
        real(8) function fmax48(x, y) result(res)
            real(4), intent (in) :: x
            real(8), intent (in) :: y
            res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
        end function
        real(8) function fmin88(x, y) result (res)
            real(8), intent (in) :: x
            real(8), intent (in) :: y
            res = merge(y, merge(x, min(x, y), y /= y), x /= x)
        end function
        real(4) function fmin44(x, y) result (res)
            real(4), intent (in) :: x
            real(4), intent (in) :: y
            res = merge(y, merge(x, min(x, y), y /= y), x /= x)
        end function
        real(8) function fmin84(x, y) result(res)
            real(8), intent (in) :: x
            real(4), intent (in) :: y
            res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
        end function
        real(8) function fmin48(x, y) result(res)
            real(4), intent (in) :: x
            real(8), intent (in) :: y
            res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
        end function
    end module
    
    real(8) function code(a, b, c)
    use fmin_fmax_functions
        real(8), intent (in) :: a
        real(8), intent (in) :: b
        real(8), intent (in) :: c
        real(8) :: tmp
        if (b <= (-3d-138)) then
            tmp = (-1.0d0) * (b / a)
        else if (b <= 3.1d-116) then
            tmp = 0.5d0 * sqrt(((-4.0d0) * (c / a)))
        else
            tmp = (-1.0d0) * (c / b)
        end if
        code = tmp
    end function
    
    public static double code(double a, double b, double c) {
    	double tmp;
    	if (b <= -3e-138) {
    		tmp = -1.0 * (b / a);
    	} else if (b <= 3.1e-116) {
    		tmp = 0.5 * Math.sqrt((-4.0 * (c / a)));
    	} else {
    		tmp = -1.0 * (c / b);
    	}
    	return tmp;
    }
    
    def code(a, b, c):
    	tmp = 0
    	if b <= -3e-138:
    		tmp = -1.0 * (b / a)
    	elif b <= 3.1e-116:
    		tmp = 0.5 * math.sqrt((-4.0 * (c / a)))
    	else:
    		tmp = -1.0 * (c / b)
    	return tmp
    
    function code(a, b, c)
    	tmp = 0.0
    	if (b <= -3e-138)
    		tmp = Float64(-1.0 * Float64(b / a));
    	elseif (b <= 3.1e-116)
    		tmp = Float64(0.5 * sqrt(Float64(-4.0 * Float64(c / a))));
    	else
    		tmp = Float64(-1.0 * Float64(c / b));
    	end
    	return tmp
    end
    
    function tmp_2 = code(a, b, c)
    	tmp = 0.0;
    	if (b <= -3e-138)
    		tmp = -1.0 * (b / a);
    	elseif (b <= 3.1e-116)
    		tmp = 0.5 * sqrt((-4.0 * (c / a)));
    	else
    		tmp = -1.0 * (c / b);
    	end
    	tmp_2 = tmp;
    end
    
    code[a_, b_, c_] := If[LessEqual[b, -3e-138], N[(-1.0 * N[(b / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 3.1e-116], N[(0.5 * N[Sqrt[N[(-4.0 * N[(c / a), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(-1.0 * N[(c / b), $MachinePrecision]), $MachinePrecision]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    \mathbf{if}\;b \leq -3 \cdot 10^{-138}:\\
    \;\;\;\;-1 \cdot \frac{b}{a}\\
    
    \mathbf{elif}\;b \leq 3.1 \cdot 10^{-116}:\\
    \;\;\;\;0.5 \cdot \sqrt{-4 \cdot \frac{c}{a}}\\
    
    \mathbf{else}:\\
    \;\;\;\;-1 \cdot \frac{c}{b}\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 3 regimes
    2. if b < -3.0000000000000001e-138

      1. Initial program 52.1%

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

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

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

          \[\leadsto \color{blue}{\frac{1}{\frac{2 \cdot a}{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}}} \]
        4. lower-unsound-/.f6452.0

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

          \[\leadsto \frac{1}{\frac{\color{blue}{2 \cdot a}}{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}} \]
        6. count-2-revN/A

          \[\leadsto \frac{1}{\frac{\color{blue}{a + a}}{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}} \]
        7. lower-+.f6452.0

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

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

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

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

          \[\leadsto \frac{1}{\frac{a + a}{\color{blue}{\sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c} - \left(\mathsf{neg}\left(\left(-b\right)\right)\right)}}} \]
      3. Applied rewrites52.1%

        \[\leadsto \color{blue}{\frac{1}{\frac{a + a}{\sqrt{\mathsf{fma}\left(c \cdot -4, a, b \cdot b\right)} - b}}} \]
      4. Step-by-step derivation
        1. lift-/.f64N/A

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

          \[\leadsto \frac{1}{\color{blue}{\frac{a + a}{\sqrt{\mathsf{fma}\left(c \cdot -4, a, b \cdot b\right)} - b}}} \]
        3. mult-flipN/A

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

          \[\leadsto \color{blue}{\frac{\frac{1}{a + a}}{\frac{1}{\sqrt{\mathsf{fma}\left(c \cdot -4, a, b \cdot b\right)} - b}}} \]
        5. lower-/.f64N/A

          \[\leadsto \color{blue}{\frac{\frac{1}{a + a}}{\frac{1}{\sqrt{\mathsf{fma}\left(c \cdot -4, a, b \cdot b\right)} - b}}} \]
        6. lift-+.f64N/A

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

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

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

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

          \[\leadsto \frac{\color{blue}{\frac{\frac{1}{2}}{a}}}{\frac{1}{\sqrt{\mathsf{fma}\left(c \cdot -4, a, b \cdot b\right)} - b}} \]
        11. lower-/.f6452.0

          \[\leadsto \frac{\frac{0.5}{a}}{\color{blue}{\frac{1}{\sqrt{\mathsf{fma}\left(c \cdot -4, a, b \cdot b\right)} - b}}} \]
        12. lift-*.f64N/A

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

          \[\leadsto \frac{\frac{\frac{1}{2}}{a}}{\frac{1}{\sqrt{\mathsf{fma}\left(\color{blue}{-4 \cdot c}, a, b \cdot b\right)} - b}} \]
        14. lift-*.f6452.0

          \[\leadsto \frac{\frac{0.5}{a}}{\frac{1}{\sqrt{\mathsf{fma}\left(\color{blue}{-4 \cdot c}, a, b \cdot b\right)} - b}} \]
      5. Applied rewrites52.0%

        \[\leadsto \color{blue}{\frac{\frac{0.5}{a}}{\frac{1}{\sqrt{\mathsf{fma}\left(-4 \cdot c, a, b \cdot b\right)} - b}}} \]
      6. Taylor expanded in b around -inf

        \[\leadsto \color{blue}{-1 \cdot \frac{b}{a}} \]
      7. Step-by-step derivation
        1. lower-*.f64N/A

          \[\leadsto -1 \cdot \color{blue}{\frac{b}{a}} \]
        2. lower-/.f6436.1

          \[\leadsto -1 \cdot \frac{b}{\color{blue}{a}} \]
      8. Applied rewrites36.1%

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

      if -3.0000000000000001e-138 < b < 3.10000000000000018e-116

      1. Initial program 52.1%

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

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

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

          \[\leadsto \color{blue}{\frac{1}{\frac{2 \cdot a}{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}}} \]
        4. lower-unsound-/.f6452.0

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

          \[\leadsto \frac{1}{\frac{\color{blue}{2 \cdot a}}{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}} \]
        6. count-2-revN/A

          \[\leadsto \frac{1}{\frac{\color{blue}{a + a}}{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}} \]
        7. lower-+.f6452.0

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

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

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

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

          \[\leadsto \frac{1}{\frac{a + a}{\color{blue}{\sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c} - \left(\mathsf{neg}\left(\left(-b\right)\right)\right)}}} \]
      3. Applied rewrites52.1%

        \[\leadsto \color{blue}{\frac{1}{\frac{a + a}{\sqrt{\mathsf{fma}\left(c \cdot -4, a, b \cdot b\right)} - b}}} \]
      4. Step-by-step derivation
        1. lift-/.f64N/A

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

          \[\leadsto \frac{1}{\color{blue}{\frac{a + a}{\sqrt{\mathsf{fma}\left(c \cdot -4, a, b \cdot b\right)} - b}}} \]
        3. mult-flipN/A

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

          \[\leadsto \color{blue}{\frac{\frac{1}{a + a}}{\frac{1}{\sqrt{\mathsf{fma}\left(c \cdot -4, a, b \cdot b\right)} - b}}} \]
        5. lower-/.f64N/A

          \[\leadsto \color{blue}{\frac{\frac{1}{a + a}}{\frac{1}{\sqrt{\mathsf{fma}\left(c \cdot -4, a, b \cdot b\right)} - b}}} \]
        6. lift-+.f64N/A

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

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

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

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

          \[\leadsto \frac{\color{blue}{\frac{\frac{1}{2}}{a}}}{\frac{1}{\sqrt{\mathsf{fma}\left(c \cdot -4, a, b \cdot b\right)} - b}} \]
        11. lower-/.f6452.0

          \[\leadsto \frac{\frac{0.5}{a}}{\color{blue}{\frac{1}{\sqrt{\mathsf{fma}\left(c \cdot -4, a, b \cdot b\right)} - b}}} \]
        12. lift-*.f64N/A

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

          \[\leadsto \frac{\frac{\frac{1}{2}}{a}}{\frac{1}{\sqrt{\mathsf{fma}\left(\color{blue}{-4 \cdot c}, a, b \cdot b\right)} - b}} \]
        14. lift-*.f6452.0

          \[\leadsto \frac{\frac{0.5}{a}}{\frac{1}{\sqrt{\mathsf{fma}\left(\color{blue}{-4 \cdot c}, a, b \cdot b\right)} - b}} \]
      5. Applied rewrites52.0%

        \[\leadsto \color{blue}{\frac{\frac{0.5}{a}}{\frac{1}{\sqrt{\mathsf{fma}\left(-4 \cdot c, a, b \cdot b\right)} - b}}} \]
      6. Taylor expanded in a around inf

        \[\leadsto \color{blue}{\frac{1}{2} \cdot \sqrt{-4 \cdot \frac{c}{a}}} \]
      7. Step-by-step derivation
        1. lower-*.f64N/A

          \[\leadsto \frac{1}{2} \cdot \color{blue}{\sqrt{-4 \cdot \frac{c}{a}}} \]
        2. lower-sqrt.f64N/A

          \[\leadsto \frac{1}{2} \cdot \sqrt{-4 \cdot \frac{c}{a}} \]
        3. lower-*.f64N/A

          \[\leadsto \frac{1}{2} \cdot \sqrt{-4 \cdot \frac{c}{a}} \]
        4. lower-/.f6417.3

          \[\leadsto 0.5 \cdot \sqrt{-4 \cdot \frac{c}{a}} \]
      8. Applied rewrites17.3%

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

      if 3.10000000000000018e-116 < b

      1. Initial program 52.1%

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

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

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

          \[\leadsto \color{blue}{\frac{1}{\frac{2 \cdot a}{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}}} \]
        4. lower-unsound-/.f6452.0

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

          \[\leadsto \frac{1}{\frac{\color{blue}{2 \cdot a}}{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}} \]
        6. count-2-revN/A

          \[\leadsto \frac{1}{\frac{\color{blue}{a + a}}{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}} \]
        7. lower-+.f6452.0

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

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

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

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

          \[\leadsto \frac{1}{\frac{a + a}{\color{blue}{\sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c} - \left(\mathsf{neg}\left(\left(-b\right)\right)\right)}}} \]
      3. Applied rewrites52.1%

        \[\leadsto \color{blue}{\frac{1}{\frac{a + a}{\sqrt{\mathsf{fma}\left(c \cdot -4, a, b \cdot b\right)} - b}}} \]
      4. Step-by-step derivation
        1. lift-/.f64N/A

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

          \[\leadsto \frac{1}{\color{blue}{\frac{a + a}{\sqrt{\mathsf{fma}\left(c \cdot -4, a, b \cdot b\right)} - b}}} \]
        3. mult-flipN/A

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

          \[\leadsto \color{blue}{\frac{\frac{1}{a + a}}{\frac{1}{\sqrt{\mathsf{fma}\left(c \cdot -4, a, b \cdot b\right)} - b}}} \]
        5. lower-/.f64N/A

          \[\leadsto \color{blue}{\frac{\frac{1}{a + a}}{\frac{1}{\sqrt{\mathsf{fma}\left(c \cdot -4, a, b \cdot b\right)} - b}}} \]
        6. lift-+.f64N/A

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

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

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

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

          \[\leadsto \frac{\color{blue}{\frac{\frac{1}{2}}{a}}}{\frac{1}{\sqrt{\mathsf{fma}\left(c \cdot -4, a, b \cdot b\right)} - b}} \]
        11. lower-/.f6452.0

          \[\leadsto \frac{\frac{0.5}{a}}{\color{blue}{\frac{1}{\sqrt{\mathsf{fma}\left(c \cdot -4, a, b \cdot b\right)} - b}}} \]
        12. lift-*.f64N/A

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

          \[\leadsto \frac{\frac{\frac{1}{2}}{a}}{\frac{1}{\sqrt{\mathsf{fma}\left(\color{blue}{-4 \cdot c}, a, b \cdot b\right)} - b}} \]
        14. lift-*.f6452.0

          \[\leadsto \frac{\frac{0.5}{a}}{\frac{1}{\sqrt{\mathsf{fma}\left(\color{blue}{-4 \cdot c}, a, b \cdot b\right)} - b}} \]
      5. Applied rewrites52.0%

        \[\leadsto \color{blue}{\frac{\frac{0.5}{a}}{\frac{1}{\sqrt{\mathsf{fma}\left(-4 \cdot c, a, b \cdot b\right)} - b}}} \]
      6. Taylor expanded in b around inf

        \[\leadsto \color{blue}{-1 \cdot \frac{c}{b}} \]
      7. Step-by-step derivation
        1. lower-*.f64N/A

          \[\leadsto -1 \cdot \color{blue}{\frac{c}{b}} \]
        2. lower-/.f6434.6

          \[\leadsto -1 \cdot \frac{c}{\color{blue}{b}} \]
      8. Applied rewrites34.6%

        \[\leadsto \color{blue}{-1 \cdot \frac{c}{b}} \]
    3. Recombined 3 regimes into one program.
    4. Add Preprocessing

    Alternative 7: 71.6% accurate, 1.2× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq -6.9 \cdot 10^{-118}:\\ \;\;\;\;-1 \cdot \frac{b}{a}\\ \mathbf{elif}\;b \leq 2.7 \cdot 10^{-110}:\\ \;\;\;\;-0.5 \cdot \sqrt{-4 \cdot \frac{c}{a}}\\ \mathbf{else}:\\ \;\;\;\;-1 \cdot \frac{c}{b}\\ \end{array} \end{array} \]
    (FPCore (a b c)
     :precision binary64
     (if (<= b -6.9e-118)
       (* -1.0 (/ b a))
       (if (<= b 2.7e-110) (* -0.5 (sqrt (* -4.0 (/ c a)))) (* -1.0 (/ c b)))))
    double code(double a, double b, double c) {
    	double tmp;
    	if (b <= -6.9e-118) {
    		tmp = -1.0 * (b / a);
    	} else if (b <= 2.7e-110) {
    		tmp = -0.5 * sqrt((-4.0 * (c / a)));
    	} else {
    		tmp = -1.0 * (c / b);
    	}
    	return tmp;
    }
    
    module fmin_fmax_functions
        implicit none
        private
        public fmax
        public fmin
    
        interface fmax
            module procedure fmax88
            module procedure fmax44
            module procedure fmax84
            module procedure fmax48
        end interface
        interface fmin
            module procedure fmin88
            module procedure fmin44
            module procedure fmin84
            module procedure fmin48
        end interface
    contains
        real(8) function fmax88(x, y) result (res)
            real(8), intent (in) :: x
            real(8), intent (in) :: y
            res = merge(y, merge(x, max(x, y), y /= y), x /= x)
        end function
        real(4) function fmax44(x, y) result (res)
            real(4), intent (in) :: x
            real(4), intent (in) :: y
            res = merge(y, merge(x, max(x, y), y /= y), x /= x)
        end function
        real(8) function fmax84(x, y) result(res)
            real(8), intent (in) :: x
            real(4), intent (in) :: y
            res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
        end function
        real(8) function fmax48(x, y) result(res)
            real(4), intent (in) :: x
            real(8), intent (in) :: y
            res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
        end function
        real(8) function fmin88(x, y) result (res)
            real(8), intent (in) :: x
            real(8), intent (in) :: y
            res = merge(y, merge(x, min(x, y), y /= y), x /= x)
        end function
        real(4) function fmin44(x, y) result (res)
            real(4), intent (in) :: x
            real(4), intent (in) :: y
            res = merge(y, merge(x, min(x, y), y /= y), x /= x)
        end function
        real(8) function fmin84(x, y) result(res)
            real(8), intent (in) :: x
            real(4), intent (in) :: y
            res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
        end function
        real(8) function fmin48(x, y) result(res)
            real(4), intent (in) :: x
            real(8), intent (in) :: y
            res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
        end function
    end module
    
    real(8) function code(a, b, c)
    use fmin_fmax_functions
        real(8), intent (in) :: a
        real(8), intent (in) :: b
        real(8), intent (in) :: c
        real(8) :: tmp
        if (b <= (-6.9d-118)) then
            tmp = (-1.0d0) * (b / a)
        else if (b <= 2.7d-110) then
            tmp = (-0.5d0) * sqrt(((-4.0d0) * (c / a)))
        else
            tmp = (-1.0d0) * (c / b)
        end if
        code = tmp
    end function
    
    public static double code(double a, double b, double c) {
    	double tmp;
    	if (b <= -6.9e-118) {
    		tmp = -1.0 * (b / a);
    	} else if (b <= 2.7e-110) {
    		tmp = -0.5 * Math.sqrt((-4.0 * (c / a)));
    	} else {
    		tmp = -1.0 * (c / b);
    	}
    	return tmp;
    }
    
    def code(a, b, c):
    	tmp = 0
    	if b <= -6.9e-118:
    		tmp = -1.0 * (b / a)
    	elif b <= 2.7e-110:
    		tmp = -0.5 * math.sqrt((-4.0 * (c / a)))
    	else:
    		tmp = -1.0 * (c / b)
    	return tmp
    
    function code(a, b, c)
    	tmp = 0.0
    	if (b <= -6.9e-118)
    		tmp = Float64(-1.0 * Float64(b / a));
    	elseif (b <= 2.7e-110)
    		tmp = Float64(-0.5 * sqrt(Float64(-4.0 * Float64(c / a))));
    	else
    		tmp = Float64(-1.0 * Float64(c / b));
    	end
    	return tmp
    end
    
    function tmp_2 = code(a, b, c)
    	tmp = 0.0;
    	if (b <= -6.9e-118)
    		tmp = -1.0 * (b / a);
    	elseif (b <= 2.7e-110)
    		tmp = -0.5 * sqrt((-4.0 * (c / a)));
    	else
    		tmp = -1.0 * (c / b);
    	end
    	tmp_2 = tmp;
    end
    
    code[a_, b_, c_] := If[LessEqual[b, -6.9e-118], N[(-1.0 * N[(b / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 2.7e-110], N[(-0.5 * N[Sqrt[N[(-4.0 * N[(c / a), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(-1.0 * N[(c / b), $MachinePrecision]), $MachinePrecision]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    \mathbf{if}\;b \leq -6.9 \cdot 10^{-118}:\\
    \;\;\;\;-1 \cdot \frac{b}{a}\\
    
    \mathbf{elif}\;b \leq 2.7 \cdot 10^{-110}:\\
    \;\;\;\;-0.5 \cdot \sqrt{-4 \cdot \frac{c}{a}}\\
    
    \mathbf{else}:\\
    \;\;\;\;-1 \cdot \frac{c}{b}\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 3 regimes
    2. if b < -6.9000000000000002e-118

      1. Initial program 52.1%

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

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

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

          \[\leadsto \color{blue}{\frac{1}{\frac{2 \cdot a}{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}}} \]
        4. lower-unsound-/.f6452.0

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

          \[\leadsto \frac{1}{\frac{\color{blue}{2 \cdot a}}{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}} \]
        6. count-2-revN/A

          \[\leadsto \frac{1}{\frac{\color{blue}{a + a}}{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}} \]
        7. lower-+.f6452.0

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

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

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

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

          \[\leadsto \frac{1}{\frac{a + a}{\color{blue}{\sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c} - \left(\mathsf{neg}\left(\left(-b\right)\right)\right)}}} \]
      3. Applied rewrites52.1%

        \[\leadsto \color{blue}{\frac{1}{\frac{a + a}{\sqrt{\mathsf{fma}\left(c \cdot -4, a, b \cdot b\right)} - b}}} \]
      4. Step-by-step derivation
        1. lift-/.f64N/A

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

          \[\leadsto \frac{1}{\color{blue}{\frac{a + a}{\sqrt{\mathsf{fma}\left(c \cdot -4, a, b \cdot b\right)} - b}}} \]
        3. mult-flipN/A

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

          \[\leadsto \color{blue}{\frac{\frac{1}{a + a}}{\frac{1}{\sqrt{\mathsf{fma}\left(c \cdot -4, a, b \cdot b\right)} - b}}} \]
        5. lower-/.f64N/A

          \[\leadsto \color{blue}{\frac{\frac{1}{a + a}}{\frac{1}{\sqrt{\mathsf{fma}\left(c \cdot -4, a, b \cdot b\right)} - b}}} \]
        6. lift-+.f64N/A

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

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

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

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

          \[\leadsto \frac{\color{blue}{\frac{\frac{1}{2}}{a}}}{\frac{1}{\sqrt{\mathsf{fma}\left(c \cdot -4, a, b \cdot b\right)} - b}} \]
        11. lower-/.f6452.0

          \[\leadsto \frac{\frac{0.5}{a}}{\color{blue}{\frac{1}{\sqrt{\mathsf{fma}\left(c \cdot -4, a, b \cdot b\right)} - b}}} \]
        12. lift-*.f64N/A

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

          \[\leadsto \frac{\frac{\frac{1}{2}}{a}}{\frac{1}{\sqrt{\mathsf{fma}\left(\color{blue}{-4 \cdot c}, a, b \cdot b\right)} - b}} \]
        14. lift-*.f6452.0

          \[\leadsto \frac{\frac{0.5}{a}}{\frac{1}{\sqrt{\mathsf{fma}\left(\color{blue}{-4 \cdot c}, a, b \cdot b\right)} - b}} \]
      5. Applied rewrites52.0%

        \[\leadsto \color{blue}{\frac{\frac{0.5}{a}}{\frac{1}{\sqrt{\mathsf{fma}\left(-4 \cdot c, a, b \cdot b\right)} - b}}} \]
      6. Taylor expanded in b around -inf

        \[\leadsto \color{blue}{-1 \cdot \frac{b}{a}} \]
      7. Step-by-step derivation
        1. lower-*.f64N/A

          \[\leadsto -1 \cdot \color{blue}{\frac{b}{a}} \]
        2. lower-/.f6436.1

          \[\leadsto -1 \cdot \frac{b}{\color{blue}{a}} \]
      8. Applied rewrites36.1%

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

      if -6.9000000000000002e-118 < b < 2.6999999999999998e-110

      1. Initial program 52.1%

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

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

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

          \[\leadsto \color{blue}{\frac{1}{\frac{2 \cdot a}{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}}} \]
        4. lower-unsound-/.f6452.0

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

          \[\leadsto \frac{1}{\frac{\color{blue}{2 \cdot a}}{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}} \]
        6. count-2-revN/A

          \[\leadsto \frac{1}{\frac{\color{blue}{a + a}}{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}} \]
        7. lower-+.f6452.0

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

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

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

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

          \[\leadsto \frac{1}{\frac{a + a}{\color{blue}{\sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c} - \left(\mathsf{neg}\left(\left(-b\right)\right)\right)}}} \]
      3. Applied rewrites52.1%

        \[\leadsto \color{blue}{\frac{1}{\frac{a + a}{\sqrt{\mathsf{fma}\left(c \cdot -4, a, b \cdot b\right)} - b}}} \]
      4. Step-by-step derivation
        1. lift-/.f64N/A

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

          \[\leadsto \frac{1}{\color{blue}{\frac{a + a}{\sqrt{\mathsf{fma}\left(c \cdot -4, a, b \cdot b\right)} - b}}} \]
        3. mult-flipN/A

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

          \[\leadsto \color{blue}{\frac{\frac{1}{a + a}}{\frac{1}{\sqrt{\mathsf{fma}\left(c \cdot -4, a, b \cdot b\right)} - b}}} \]
        5. lower-/.f64N/A

          \[\leadsto \color{blue}{\frac{\frac{1}{a + a}}{\frac{1}{\sqrt{\mathsf{fma}\left(c \cdot -4, a, b \cdot b\right)} - b}}} \]
        6. lift-+.f64N/A

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

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

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

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

          \[\leadsto \frac{\color{blue}{\frac{\frac{1}{2}}{a}}}{\frac{1}{\sqrt{\mathsf{fma}\left(c \cdot -4, a, b \cdot b\right)} - b}} \]
        11. lower-/.f6452.0

          \[\leadsto \frac{\frac{0.5}{a}}{\color{blue}{\frac{1}{\sqrt{\mathsf{fma}\left(c \cdot -4, a, b \cdot b\right)} - b}}} \]
        12. lift-*.f64N/A

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

          \[\leadsto \frac{\frac{\frac{1}{2}}{a}}{\frac{1}{\sqrt{\mathsf{fma}\left(\color{blue}{-4 \cdot c}, a, b \cdot b\right)} - b}} \]
        14. lift-*.f6452.0

          \[\leadsto \frac{\frac{0.5}{a}}{\frac{1}{\sqrt{\mathsf{fma}\left(\color{blue}{-4 \cdot c}, a, b \cdot b\right)} - b}} \]
      5. Applied rewrites52.0%

        \[\leadsto \color{blue}{\frac{\frac{0.5}{a}}{\frac{1}{\sqrt{\mathsf{fma}\left(-4 \cdot c, a, b \cdot b\right)} - b}}} \]
      6. Taylor expanded in a around -inf

        \[\leadsto \color{blue}{\frac{-1}{2} \cdot \sqrt{-4 \cdot \frac{c}{a}}} \]
      7. Step-by-step derivation
        1. lower-*.f64N/A

          \[\leadsto \frac{-1}{2} \cdot \color{blue}{\sqrt{-4 \cdot \frac{c}{a}}} \]
        2. lower-sqrt.f64N/A

          \[\leadsto \frac{-1}{2} \cdot \sqrt{-4 \cdot \frac{c}{a}} \]
        3. lower-*.f64N/A

          \[\leadsto \frac{-1}{2} \cdot \sqrt{-4 \cdot \frac{c}{a}} \]
        4. lower-/.f6417.0

          \[\leadsto -0.5 \cdot \sqrt{-4 \cdot \frac{c}{a}} \]
      8. Applied rewrites17.0%

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

      if 2.6999999999999998e-110 < b

      1. Initial program 52.1%

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

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

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

          \[\leadsto \color{blue}{\frac{1}{\frac{2 \cdot a}{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}}} \]
        4. lower-unsound-/.f6452.0

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

          \[\leadsto \frac{1}{\frac{\color{blue}{2 \cdot a}}{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}} \]
        6. count-2-revN/A

          \[\leadsto \frac{1}{\frac{\color{blue}{a + a}}{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}} \]
        7. lower-+.f6452.0

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

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

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

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

          \[\leadsto \frac{1}{\frac{a + a}{\color{blue}{\sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c} - \left(\mathsf{neg}\left(\left(-b\right)\right)\right)}}} \]
      3. Applied rewrites52.1%

        \[\leadsto \color{blue}{\frac{1}{\frac{a + a}{\sqrt{\mathsf{fma}\left(c \cdot -4, a, b \cdot b\right)} - b}}} \]
      4. Step-by-step derivation
        1. lift-/.f64N/A

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

          \[\leadsto \frac{1}{\color{blue}{\frac{a + a}{\sqrt{\mathsf{fma}\left(c \cdot -4, a, b \cdot b\right)} - b}}} \]
        3. mult-flipN/A

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

          \[\leadsto \color{blue}{\frac{\frac{1}{a + a}}{\frac{1}{\sqrt{\mathsf{fma}\left(c \cdot -4, a, b \cdot b\right)} - b}}} \]
        5. lower-/.f64N/A

          \[\leadsto \color{blue}{\frac{\frac{1}{a + a}}{\frac{1}{\sqrt{\mathsf{fma}\left(c \cdot -4, a, b \cdot b\right)} - b}}} \]
        6. lift-+.f64N/A

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

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

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

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

          \[\leadsto \frac{\color{blue}{\frac{\frac{1}{2}}{a}}}{\frac{1}{\sqrt{\mathsf{fma}\left(c \cdot -4, a, b \cdot b\right)} - b}} \]
        11. lower-/.f6452.0

          \[\leadsto \frac{\frac{0.5}{a}}{\color{blue}{\frac{1}{\sqrt{\mathsf{fma}\left(c \cdot -4, a, b \cdot b\right)} - b}}} \]
        12. lift-*.f64N/A

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

          \[\leadsto \frac{\frac{\frac{1}{2}}{a}}{\frac{1}{\sqrt{\mathsf{fma}\left(\color{blue}{-4 \cdot c}, a, b \cdot b\right)} - b}} \]
        14. lift-*.f6452.0

          \[\leadsto \frac{\frac{0.5}{a}}{\frac{1}{\sqrt{\mathsf{fma}\left(\color{blue}{-4 \cdot c}, a, b \cdot b\right)} - b}} \]
      5. Applied rewrites52.0%

        \[\leadsto \color{blue}{\frac{\frac{0.5}{a}}{\frac{1}{\sqrt{\mathsf{fma}\left(-4 \cdot c, a, b \cdot b\right)} - b}}} \]
      6. Taylor expanded in b around inf

        \[\leadsto \color{blue}{-1 \cdot \frac{c}{b}} \]
      7. Step-by-step derivation
        1. lower-*.f64N/A

          \[\leadsto -1 \cdot \color{blue}{\frac{c}{b}} \]
        2. lower-/.f6434.6

          \[\leadsto -1 \cdot \frac{c}{\color{blue}{b}} \]
      8. Applied rewrites34.6%

        \[\leadsto \color{blue}{-1 \cdot \frac{c}{b}} \]
    3. Recombined 3 regimes into one program.
    4. Add Preprocessing

    Alternative 8: 68.2% accurate, 2.2× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq -5 \cdot 10^{-310}:\\ \;\;\;\;-1 \cdot \frac{b}{a}\\ \mathbf{else}:\\ \;\;\;\;-1 \cdot \frac{c}{b}\\ \end{array} \end{array} \]
    (FPCore (a b c)
     :precision binary64
     (if (<= b -5e-310) (* -1.0 (/ b a)) (* -1.0 (/ c b))))
    double code(double a, double b, double c) {
    	double tmp;
    	if (b <= -5e-310) {
    		tmp = -1.0 * (b / a);
    	} else {
    		tmp = -1.0 * (c / b);
    	}
    	return tmp;
    }
    
    module fmin_fmax_functions
        implicit none
        private
        public fmax
        public fmin
    
        interface fmax
            module procedure fmax88
            module procedure fmax44
            module procedure fmax84
            module procedure fmax48
        end interface
        interface fmin
            module procedure fmin88
            module procedure fmin44
            module procedure fmin84
            module procedure fmin48
        end interface
    contains
        real(8) function fmax88(x, y) result (res)
            real(8), intent (in) :: x
            real(8), intent (in) :: y
            res = merge(y, merge(x, max(x, y), y /= y), x /= x)
        end function
        real(4) function fmax44(x, y) result (res)
            real(4), intent (in) :: x
            real(4), intent (in) :: y
            res = merge(y, merge(x, max(x, y), y /= y), x /= x)
        end function
        real(8) function fmax84(x, y) result(res)
            real(8), intent (in) :: x
            real(4), intent (in) :: y
            res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
        end function
        real(8) function fmax48(x, y) result(res)
            real(4), intent (in) :: x
            real(8), intent (in) :: y
            res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
        end function
        real(8) function fmin88(x, y) result (res)
            real(8), intent (in) :: x
            real(8), intent (in) :: y
            res = merge(y, merge(x, min(x, y), y /= y), x /= x)
        end function
        real(4) function fmin44(x, y) result (res)
            real(4), intent (in) :: x
            real(4), intent (in) :: y
            res = merge(y, merge(x, min(x, y), y /= y), x /= x)
        end function
        real(8) function fmin84(x, y) result(res)
            real(8), intent (in) :: x
            real(4), intent (in) :: y
            res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
        end function
        real(8) function fmin48(x, y) result(res)
            real(4), intent (in) :: x
            real(8), intent (in) :: y
            res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
        end function
    end module
    
    real(8) function code(a, b, c)
    use fmin_fmax_functions
        real(8), intent (in) :: a
        real(8), intent (in) :: b
        real(8), intent (in) :: c
        real(8) :: tmp
        if (b <= (-5d-310)) then
            tmp = (-1.0d0) * (b / a)
        else
            tmp = (-1.0d0) * (c / b)
        end if
        code = tmp
    end function
    
    public static double code(double a, double b, double c) {
    	double tmp;
    	if (b <= -5e-310) {
    		tmp = -1.0 * (b / a);
    	} else {
    		tmp = -1.0 * (c / b);
    	}
    	return tmp;
    }
    
    def code(a, b, c):
    	tmp = 0
    	if b <= -5e-310:
    		tmp = -1.0 * (b / a)
    	else:
    		tmp = -1.0 * (c / b)
    	return tmp
    
    function code(a, b, c)
    	tmp = 0.0
    	if (b <= -5e-310)
    		tmp = Float64(-1.0 * Float64(b / a));
    	else
    		tmp = Float64(-1.0 * Float64(c / b));
    	end
    	return tmp
    end
    
    function tmp_2 = code(a, b, c)
    	tmp = 0.0;
    	if (b <= -5e-310)
    		tmp = -1.0 * (b / a);
    	else
    		tmp = -1.0 * (c / b);
    	end
    	tmp_2 = tmp;
    end
    
    code[a_, b_, c_] := If[LessEqual[b, -5e-310], N[(-1.0 * N[(b / a), $MachinePrecision]), $MachinePrecision], N[(-1.0 * N[(c / b), $MachinePrecision]), $MachinePrecision]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    \mathbf{if}\;b \leq -5 \cdot 10^{-310}:\\
    \;\;\;\;-1 \cdot \frac{b}{a}\\
    
    \mathbf{else}:\\
    \;\;\;\;-1 \cdot \frac{c}{b}\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if b < -4.999999999999985e-310

      1. Initial program 52.1%

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

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

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

          \[\leadsto \color{blue}{\frac{1}{\frac{2 \cdot a}{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}}} \]
        4. lower-unsound-/.f6452.0

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

          \[\leadsto \frac{1}{\frac{\color{blue}{2 \cdot a}}{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}} \]
        6. count-2-revN/A

          \[\leadsto \frac{1}{\frac{\color{blue}{a + a}}{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}} \]
        7. lower-+.f6452.0

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

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

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

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

          \[\leadsto \frac{1}{\frac{a + a}{\color{blue}{\sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c} - \left(\mathsf{neg}\left(\left(-b\right)\right)\right)}}} \]
      3. Applied rewrites52.1%

        \[\leadsto \color{blue}{\frac{1}{\frac{a + a}{\sqrt{\mathsf{fma}\left(c \cdot -4, a, b \cdot b\right)} - b}}} \]
      4. Step-by-step derivation
        1. lift-/.f64N/A

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

          \[\leadsto \frac{1}{\color{blue}{\frac{a + a}{\sqrt{\mathsf{fma}\left(c \cdot -4, a, b \cdot b\right)} - b}}} \]
        3. mult-flipN/A

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

          \[\leadsto \color{blue}{\frac{\frac{1}{a + a}}{\frac{1}{\sqrt{\mathsf{fma}\left(c \cdot -4, a, b \cdot b\right)} - b}}} \]
        5. lower-/.f64N/A

          \[\leadsto \color{blue}{\frac{\frac{1}{a + a}}{\frac{1}{\sqrt{\mathsf{fma}\left(c \cdot -4, a, b \cdot b\right)} - b}}} \]
        6. lift-+.f64N/A

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

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

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

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

          \[\leadsto \frac{\color{blue}{\frac{\frac{1}{2}}{a}}}{\frac{1}{\sqrt{\mathsf{fma}\left(c \cdot -4, a, b \cdot b\right)} - b}} \]
        11. lower-/.f6452.0

          \[\leadsto \frac{\frac{0.5}{a}}{\color{blue}{\frac{1}{\sqrt{\mathsf{fma}\left(c \cdot -4, a, b \cdot b\right)} - b}}} \]
        12. lift-*.f64N/A

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

          \[\leadsto \frac{\frac{\frac{1}{2}}{a}}{\frac{1}{\sqrt{\mathsf{fma}\left(\color{blue}{-4 \cdot c}, a, b \cdot b\right)} - b}} \]
        14. lift-*.f6452.0

          \[\leadsto \frac{\frac{0.5}{a}}{\frac{1}{\sqrt{\mathsf{fma}\left(\color{blue}{-4 \cdot c}, a, b \cdot b\right)} - b}} \]
      5. Applied rewrites52.0%

        \[\leadsto \color{blue}{\frac{\frac{0.5}{a}}{\frac{1}{\sqrt{\mathsf{fma}\left(-4 \cdot c, a, b \cdot b\right)} - b}}} \]
      6. Taylor expanded in b around -inf

        \[\leadsto \color{blue}{-1 \cdot \frac{b}{a}} \]
      7. Step-by-step derivation
        1. lower-*.f64N/A

          \[\leadsto -1 \cdot \color{blue}{\frac{b}{a}} \]
        2. lower-/.f6436.1

          \[\leadsto -1 \cdot \frac{b}{\color{blue}{a}} \]
      8. Applied rewrites36.1%

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

      if -4.999999999999985e-310 < b

      1. Initial program 52.1%

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

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

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

          \[\leadsto \color{blue}{\frac{1}{\frac{2 \cdot a}{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}}} \]
        4. lower-unsound-/.f6452.0

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

          \[\leadsto \frac{1}{\frac{\color{blue}{2 \cdot a}}{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}} \]
        6. count-2-revN/A

          \[\leadsto \frac{1}{\frac{\color{blue}{a + a}}{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}} \]
        7. lower-+.f6452.0

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

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

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

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

          \[\leadsto \frac{1}{\frac{a + a}{\color{blue}{\sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c} - \left(\mathsf{neg}\left(\left(-b\right)\right)\right)}}} \]
      3. Applied rewrites52.1%

        \[\leadsto \color{blue}{\frac{1}{\frac{a + a}{\sqrt{\mathsf{fma}\left(c \cdot -4, a, b \cdot b\right)} - b}}} \]
      4. Step-by-step derivation
        1. lift-/.f64N/A

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

          \[\leadsto \frac{1}{\color{blue}{\frac{a + a}{\sqrt{\mathsf{fma}\left(c \cdot -4, a, b \cdot b\right)} - b}}} \]
        3. mult-flipN/A

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

          \[\leadsto \color{blue}{\frac{\frac{1}{a + a}}{\frac{1}{\sqrt{\mathsf{fma}\left(c \cdot -4, a, b \cdot b\right)} - b}}} \]
        5. lower-/.f64N/A

          \[\leadsto \color{blue}{\frac{\frac{1}{a + a}}{\frac{1}{\sqrt{\mathsf{fma}\left(c \cdot -4, a, b \cdot b\right)} - b}}} \]
        6. lift-+.f64N/A

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

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

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

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

          \[\leadsto \frac{\color{blue}{\frac{\frac{1}{2}}{a}}}{\frac{1}{\sqrt{\mathsf{fma}\left(c \cdot -4, a, b \cdot b\right)} - b}} \]
        11. lower-/.f6452.0

          \[\leadsto \frac{\frac{0.5}{a}}{\color{blue}{\frac{1}{\sqrt{\mathsf{fma}\left(c \cdot -4, a, b \cdot b\right)} - b}}} \]
        12. lift-*.f64N/A

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

          \[\leadsto \frac{\frac{\frac{1}{2}}{a}}{\frac{1}{\sqrt{\mathsf{fma}\left(\color{blue}{-4 \cdot c}, a, b \cdot b\right)} - b}} \]
        14. lift-*.f6452.0

          \[\leadsto \frac{\frac{0.5}{a}}{\frac{1}{\sqrt{\mathsf{fma}\left(\color{blue}{-4 \cdot c}, a, b \cdot b\right)} - b}} \]
      5. Applied rewrites52.0%

        \[\leadsto \color{blue}{\frac{\frac{0.5}{a}}{\frac{1}{\sqrt{\mathsf{fma}\left(-4 \cdot c, a, b \cdot b\right)} - b}}} \]
      6. Taylor expanded in b around inf

        \[\leadsto \color{blue}{-1 \cdot \frac{c}{b}} \]
      7. Step-by-step derivation
        1. lower-*.f64N/A

          \[\leadsto -1 \cdot \color{blue}{\frac{c}{b}} \]
        2. lower-/.f6434.6

          \[\leadsto -1 \cdot \frac{c}{\color{blue}{b}} \]
      8. Applied rewrites34.6%

        \[\leadsto \color{blue}{-1 \cdot \frac{c}{b}} \]
    3. Recombined 2 regimes into one program.
    4. Add Preprocessing

    Alternative 9: 36.1% accurate, 3.3× speedup?

    \[\begin{array}{l} \\ -1 \cdot \frac{b}{a} \end{array} \]
    (FPCore (a b c) :precision binary64 (* -1.0 (/ b a)))
    double code(double a, double b, double c) {
    	return -1.0 * (b / a);
    }
    
    module fmin_fmax_functions
        implicit none
        private
        public fmax
        public fmin
    
        interface fmax
            module procedure fmax88
            module procedure fmax44
            module procedure fmax84
            module procedure fmax48
        end interface
        interface fmin
            module procedure fmin88
            module procedure fmin44
            module procedure fmin84
            module procedure fmin48
        end interface
    contains
        real(8) function fmax88(x, y) result (res)
            real(8), intent (in) :: x
            real(8), intent (in) :: y
            res = merge(y, merge(x, max(x, y), y /= y), x /= x)
        end function
        real(4) function fmax44(x, y) result (res)
            real(4), intent (in) :: x
            real(4), intent (in) :: y
            res = merge(y, merge(x, max(x, y), y /= y), x /= x)
        end function
        real(8) function fmax84(x, y) result(res)
            real(8), intent (in) :: x
            real(4), intent (in) :: y
            res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
        end function
        real(8) function fmax48(x, y) result(res)
            real(4), intent (in) :: x
            real(8), intent (in) :: y
            res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
        end function
        real(8) function fmin88(x, y) result (res)
            real(8), intent (in) :: x
            real(8), intent (in) :: y
            res = merge(y, merge(x, min(x, y), y /= y), x /= x)
        end function
        real(4) function fmin44(x, y) result (res)
            real(4), intent (in) :: x
            real(4), intent (in) :: y
            res = merge(y, merge(x, min(x, y), y /= y), x /= x)
        end function
        real(8) function fmin84(x, y) result(res)
            real(8), intent (in) :: x
            real(4), intent (in) :: y
            res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
        end function
        real(8) function fmin48(x, y) result(res)
            real(4), intent (in) :: x
            real(8), intent (in) :: y
            res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
        end function
    end module
    
    real(8) function code(a, b, c)
    use fmin_fmax_functions
        real(8), intent (in) :: a
        real(8), intent (in) :: b
        real(8), intent (in) :: c
        code = (-1.0d0) * (b / a)
    end function
    
    public static double code(double a, double b, double c) {
    	return -1.0 * (b / a);
    }
    
    def code(a, b, c):
    	return -1.0 * (b / a)
    
    function code(a, b, c)
    	return Float64(-1.0 * Float64(b / a))
    end
    
    function tmp = code(a, b, c)
    	tmp = -1.0 * (b / a);
    end
    
    code[a_, b_, c_] := N[(-1.0 * N[(b / a), $MachinePrecision]), $MachinePrecision]
    
    \begin{array}{l}
    
    \\
    -1 \cdot \frac{b}{a}
    \end{array}
    
    Derivation
    1. Initial program 52.1%

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

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

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

        \[\leadsto \color{blue}{\frac{1}{\frac{2 \cdot a}{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}}} \]
      4. lower-unsound-/.f6452.0

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

        \[\leadsto \frac{1}{\frac{\color{blue}{2 \cdot a}}{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}} \]
      6. count-2-revN/A

        \[\leadsto \frac{1}{\frac{\color{blue}{a + a}}{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}} \]
      7. lower-+.f6452.0

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

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

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

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

        \[\leadsto \frac{1}{\frac{a + a}{\color{blue}{\sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c} - \left(\mathsf{neg}\left(\left(-b\right)\right)\right)}}} \]
    3. Applied rewrites52.1%

      \[\leadsto \color{blue}{\frac{1}{\frac{a + a}{\sqrt{\mathsf{fma}\left(c \cdot -4, a, b \cdot b\right)} - b}}} \]
    4. Step-by-step derivation
      1. lift-/.f64N/A

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

        \[\leadsto \frac{1}{\color{blue}{\frac{a + a}{\sqrt{\mathsf{fma}\left(c \cdot -4, a, b \cdot b\right)} - b}}} \]
      3. mult-flipN/A

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

        \[\leadsto \color{blue}{\frac{\frac{1}{a + a}}{\frac{1}{\sqrt{\mathsf{fma}\left(c \cdot -4, a, b \cdot b\right)} - b}}} \]
      5. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{\frac{1}{a + a}}{\frac{1}{\sqrt{\mathsf{fma}\left(c \cdot -4, a, b \cdot b\right)} - b}}} \]
      6. lift-+.f64N/A

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

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

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

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

        \[\leadsto \frac{\color{blue}{\frac{\frac{1}{2}}{a}}}{\frac{1}{\sqrt{\mathsf{fma}\left(c \cdot -4, a, b \cdot b\right)} - b}} \]
      11. lower-/.f6452.0

        \[\leadsto \frac{\frac{0.5}{a}}{\color{blue}{\frac{1}{\sqrt{\mathsf{fma}\left(c \cdot -4, a, b \cdot b\right)} - b}}} \]
      12. lift-*.f64N/A

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

        \[\leadsto \frac{\frac{\frac{1}{2}}{a}}{\frac{1}{\sqrt{\mathsf{fma}\left(\color{blue}{-4 \cdot c}, a, b \cdot b\right)} - b}} \]
      14. lift-*.f6452.0

        \[\leadsto \frac{\frac{0.5}{a}}{\frac{1}{\sqrt{\mathsf{fma}\left(\color{blue}{-4 \cdot c}, a, b \cdot b\right)} - b}} \]
    5. Applied rewrites52.0%

      \[\leadsto \color{blue}{\frac{\frac{0.5}{a}}{\frac{1}{\sqrt{\mathsf{fma}\left(-4 \cdot c, a, b \cdot b\right)} - b}}} \]
    6. Taylor expanded in b around -inf

      \[\leadsto \color{blue}{-1 \cdot \frac{b}{a}} \]
    7. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto -1 \cdot \color{blue}{\frac{b}{a}} \]
      2. lower-/.f6436.1

        \[\leadsto -1 \cdot \frac{b}{\color{blue}{a}} \]
    8. Applied rewrites36.1%

      \[\leadsto \color{blue}{-1 \cdot \frac{b}{a}} \]
    9. Add Preprocessing

    Developer Target 1: 70.3% accurate, 0.7× 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;
    }
    
    module fmin_fmax_functions
        implicit none
        private
        public fmax
        public fmin
    
        interface fmax
            module procedure fmax88
            module procedure fmax44
            module procedure fmax84
            module procedure fmax48
        end interface
        interface fmin
            module procedure fmin88
            module procedure fmin44
            module procedure fmin84
            module procedure fmin48
        end interface
    contains
        real(8) function fmax88(x, y) result (res)
            real(8), intent (in) :: x
            real(8), intent (in) :: y
            res = merge(y, merge(x, max(x, y), y /= y), x /= x)
        end function
        real(4) function fmax44(x, y) result (res)
            real(4), intent (in) :: x
            real(4), intent (in) :: y
            res = merge(y, merge(x, max(x, y), y /= y), x /= x)
        end function
        real(8) function fmax84(x, y) result(res)
            real(8), intent (in) :: x
            real(4), intent (in) :: y
            res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
        end function
        real(8) function fmax48(x, y) result(res)
            real(4), intent (in) :: x
            real(8), intent (in) :: y
            res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
        end function
        real(8) function fmin88(x, y) result (res)
            real(8), intent (in) :: x
            real(8), intent (in) :: y
            res = merge(y, merge(x, min(x, y), y /= y), x /= x)
        end function
        real(4) function fmin44(x, y) result (res)
            real(4), intent (in) :: x
            real(4), intent (in) :: y
            res = merge(y, merge(x, min(x, y), y /= y), x /= x)
        end function
        real(8) function fmin84(x, y) result(res)
            real(8), intent (in) :: x
            real(4), intent (in) :: y
            res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
        end function
        real(8) function fmin48(x, y) result(res)
            real(4), intent (in) :: x
            real(8), intent (in) :: y
            res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
        end function
    end module
    
    real(8) function code(a, b, c)
    use fmin_fmax_functions
        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 2025164 
    (FPCore (a b c)
      :name "The quadratic formula (r1)"
      :precision binary64
    
      :alt
      (! :herbie-platform c (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)))