The quadratic formula (r1)

Percentage Accurate: 52.7% → 85.1%
Time: 5.0s
Alternatives: 14
Speedup: 2.7×

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 14 alternatives:

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

Initial Program: 52.7% 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.1% accurate, 0.8× speedup?

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

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

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

\mathbf{else}:\\
\;\;\;\;\frac{-\mathsf{fma}\left(c, c \cdot \frac{\frac{a}{b}}{b}, c\right)}{b}\\


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

    1. Initial program 52.5%

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \left(-b\right) \cdot \left(\frac{-c}{{b}^{2}} + \frac{1}{a}\right) \]
        9. lower-/.f64N/A

          \[\leadsto \left(-b\right) \cdot \left(\frac{-c}{{b}^{2}} + \frac{\color{blue}{1}}{a}\right) \]
        10. pow2N/A

          \[\leadsto \left(-b\right) \cdot \left(\frac{-c}{b \cdot b} + \frac{1}{a}\right) \]
        11. lift-*.f64N/A

          \[\leadsto \left(-b\right) \cdot \left(\frac{-c}{b \cdot b} + \frac{1}{a}\right) \]
        12. lower-/.f6496.8

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

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

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

          \[\leadsto -1 \cdot \frac{b}{a} + \frac{c}{\color{blue}{b}} \]
        2. associate-*r/N/A

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

          \[\leadsto \frac{\mathsf{neg}\left(b\right)}{a} + \frac{c}{b} \]
        4. lift-neg.f64N/A

          \[\leadsto \frac{-b}{a} + \frac{c}{b} \]
        5. lower-/.f64N/A

          \[\leadsto \frac{-b}{a} + \frac{c}{b} \]
        6. lower-/.f6497.2

          \[\leadsto \frac{-b}{a} + \frac{c}{b} \]
      7. Applied rewrites97.2%

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

      if -4.00000000000000006e116 < b < 3.20000000000000017e-100

      1. Initial program 81.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

        if 3.20000000000000017e-100 < b

        1. Initial program 20.2%

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

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

            \[\leadsto \color{blue}{\frac{-1 \cdot c + -1 \cdot \frac{a \cdot {c}^{2}}{{b}^{2}}}{b}} \]
          3. Applied rewrites69.3%

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

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

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

              \[\leadsto \frac{-\left(c \cdot \left(c \cdot \frac{a}{b \cdot b}\right) + c\right)}{b} \]
            4. lower-fma.f64N/A

              \[\leadsto \frac{-\mathsf{fma}\left(c, c \cdot \frac{a}{b \cdot b}, c\right)}{b} \]
            5. lift-*.f64N/A

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

              \[\leadsto \frac{-\mathsf{fma}\left(c, c \cdot \frac{a}{b \cdot b}, c\right)}{b} \]
            7. pow2N/A

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

              \[\leadsto \frac{-\mathsf{fma}\left(c, c \cdot \frac{a}{{b}^{2}}, c\right)}{b} \]
            9. pow2N/A

              \[\leadsto \frac{-\mathsf{fma}\left(c, c \cdot \frac{a}{b \cdot b}, c\right)}{b} \]
            10. lift-/.f64N/A

              \[\leadsto \frac{-\mathsf{fma}\left(c, c \cdot \frac{a}{b \cdot b}, c\right)}{b} \]
            11. lift-*.f6482.9

              \[\leadsto \frac{-\mathsf{fma}\left(c, c \cdot \frac{a}{b \cdot b}, c\right)}{b} \]
          5. Applied rewrites82.9%

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

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

              \[\leadsto \frac{-\mathsf{fma}\left(c, c \cdot \frac{a}{b \cdot b}, c\right)}{b} \]
            3. associate-/r*N/A

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

              \[\leadsto \frac{-\mathsf{fma}\left(c, c \cdot \frac{\frac{a}{b}}{b}, c\right)}{b} \]
            5. lower-/.f6482.9

              \[\leadsto \frac{-\mathsf{fma}\left(c, c \cdot \frac{\frac{a}{b}}{b}, c\right)}{b} \]
          7. Applied rewrites82.9%

            \[\leadsto \frac{-\mathsf{fma}\left(c, c \cdot \frac{\frac{a}{b}}{b}, c\right)}{b} \]
        3. Recombined 3 regimes into one program.
        4. Add Preprocessing

        Alternative 2: 79.7% accurate, 0.9× speedup?

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

          1. Initial program 72.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 rewrites72.2%

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

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

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

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

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

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

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

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

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

                \[\leadsto \left(-b\right) \cdot \left(\frac{-c}{{b}^{2}} + \frac{1}{a}\right) \]
              9. lower-/.f64N/A

                \[\leadsto \left(-b\right) \cdot \left(\frac{-c}{{b}^{2}} + \frac{\color{blue}{1}}{a}\right) \]
              10. pow2N/A

                \[\leadsto \left(-b\right) \cdot \left(\frac{-c}{b \cdot b} + \frac{1}{a}\right) \]
              11. lift-*.f64N/A

                \[\leadsto \left(-b\right) \cdot \left(\frac{-c}{b \cdot b} + \frac{1}{a}\right) \]
              12. lower-/.f6480.6

                \[\leadsto \left(-b\right) \cdot \left(\frac{-c}{b \cdot b} + \frac{1}{\color{blue}{a}}\right) \]
            4. Applied rewrites80.6%

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

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

                \[\leadsto -1 \cdot \frac{b}{a} + \frac{c}{\color{blue}{b}} \]
              2. associate-*r/N/A

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

                \[\leadsto \frac{\mathsf{neg}\left(b\right)}{a} + \frac{c}{b} \]
              4. lift-neg.f64N/A

                \[\leadsto \frac{-b}{a} + \frac{c}{b} \]
              5. lower-/.f64N/A

                \[\leadsto \frac{-b}{a} + \frac{c}{b} \]
              6. lower-/.f6480.9

                \[\leadsto \frac{-b}{a} + \frac{c}{b} \]
            7. Applied rewrites80.9%

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

            if -1.32000000000000004e-120 < b < 1.15e-104

            1. Initial program 74.6%

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

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

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

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

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

                  \[\leadsto \frac{\sqrt{\left(a \cdot -4\right) \cdot c} + \left(-b\right)}{a + a} \]
                4. lower-*.f6472.3

                  \[\leadsto \frac{\sqrt{\left(a \cdot -4\right) \cdot c} + \left(-b\right)}{a + a} \]
              4. Applied rewrites72.3%

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

              if 1.15e-104 < b

              1. Initial program 20.4%

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

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

                  \[\leadsto \color{blue}{\frac{-1 \cdot c + -1 \cdot \frac{a \cdot {c}^{2}}{{b}^{2}}}{b}} \]
                3. Applied rewrites69.0%

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

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

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

                    \[\leadsto \frac{-\left(c \cdot \left(c \cdot \frac{a}{b \cdot b}\right) + c\right)}{b} \]
                  4. lower-fma.f64N/A

                    \[\leadsto \frac{-\mathsf{fma}\left(c, c \cdot \frac{a}{b \cdot b}, c\right)}{b} \]
                  5. lift-*.f64N/A

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

                    \[\leadsto \frac{-\mathsf{fma}\left(c, c \cdot \frac{a}{b \cdot b}, c\right)}{b} \]
                  7. pow2N/A

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

                    \[\leadsto \frac{-\mathsf{fma}\left(c, c \cdot \frac{a}{{b}^{2}}, c\right)}{b} \]
                  9. pow2N/A

                    \[\leadsto \frac{-\mathsf{fma}\left(c, c \cdot \frac{a}{b \cdot b}, c\right)}{b} \]
                  10. lift-/.f64N/A

                    \[\leadsto \frac{-\mathsf{fma}\left(c, c \cdot \frac{a}{b \cdot b}, c\right)}{b} \]
                  11. lift-*.f6482.5

                    \[\leadsto \frac{-\mathsf{fma}\left(c, c \cdot \frac{a}{b \cdot b}, c\right)}{b} \]
                5. Applied rewrites82.5%

                  \[\leadsto \frac{-\mathsf{fma}\left(c, c \cdot \frac{a}{b \cdot b}, c\right)}{b} \]
              3. Recombined 3 regimes into one program.
              4. Add Preprocessing

              Alternative 3: 79.5% accurate, 0.9× speedup?

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

                1. Initial program 72.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 rewrites72.2%

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

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

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

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

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

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

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

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

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

                      \[\leadsto \left(-b\right) \cdot \left(\frac{-c}{{b}^{2}} + \frac{1}{a}\right) \]
                    9. lower-/.f64N/A

                      \[\leadsto \left(-b\right) \cdot \left(\frac{-c}{{b}^{2}} + \frac{\color{blue}{1}}{a}\right) \]
                    10. pow2N/A

                      \[\leadsto \left(-b\right) \cdot \left(\frac{-c}{b \cdot b} + \frac{1}{a}\right) \]
                    11. lift-*.f64N/A

                      \[\leadsto \left(-b\right) \cdot \left(\frac{-c}{b \cdot b} + \frac{1}{a}\right) \]
                    12. lower-/.f6480.6

                      \[\leadsto \left(-b\right) \cdot \left(\frac{-c}{b \cdot b} + \frac{1}{\color{blue}{a}}\right) \]
                  4. Applied rewrites80.6%

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

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

                      \[\leadsto -1 \cdot \frac{b}{a} + \frac{c}{\color{blue}{b}} \]
                    2. associate-*r/N/A

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

                      \[\leadsto \frac{\mathsf{neg}\left(b\right)}{a} + \frac{c}{b} \]
                    4. lift-neg.f64N/A

                      \[\leadsto \frac{-b}{a} + \frac{c}{b} \]
                    5. lower-/.f64N/A

                      \[\leadsto \frac{-b}{a} + \frac{c}{b} \]
                    6. lower-/.f6480.9

                      \[\leadsto \frac{-b}{a} + \frac{c}{b} \]
                  7. Applied rewrites80.9%

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

                  if -1.32000000000000004e-120 < b < 1.15e-104

                  1. Initial program 74.6%

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

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

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

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

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

                        \[\leadsto \frac{\sqrt{\left(a \cdot -4\right) \cdot c} + \left(-b\right)}{a + a} \]
                      4. lower-*.f6472.3

                        \[\leadsto \frac{\sqrt{\left(a \cdot -4\right) \cdot c} + \left(-b\right)}{a + a} \]
                    4. Applied rewrites72.3%

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

                    if 1.15e-104 < b

                    1. Initial program 20.4%

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

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

                        \[\leadsto \color{blue}{\frac{-1 \cdot c + -1 \cdot \frac{a \cdot {c}^{2}}{{b}^{2}}}{b}} \]
                      3. Applied rewrites69.0%

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

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

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

                          \[\leadsto \frac{-\left(c \cdot \left(c \cdot \frac{a}{b \cdot b}\right) + c\right)}{b} \]
                        4. lower-fma.f64N/A

                          \[\leadsto \frac{-\mathsf{fma}\left(c, c \cdot \frac{a}{b \cdot b}, c\right)}{b} \]
                        5. lift-*.f64N/A

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

                          \[\leadsto \frac{-\mathsf{fma}\left(c, c \cdot \frac{a}{b \cdot b}, c\right)}{b} \]
                        7. pow2N/A

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

                          \[\leadsto \frac{-\mathsf{fma}\left(c, c \cdot \frac{a}{{b}^{2}}, c\right)}{b} \]
                        9. pow2N/A

                          \[\leadsto \frac{-\mathsf{fma}\left(c, c \cdot \frac{a}{b \cdot b}, c\right)}{b} \]
                        10. lift-/.f64N/A

                          \[\leadsto \frac{-\mathsf{fma}\left(c, c \cdot \frac{a}{b \cdot b}, c\right)}{b} \]
                        11. lift-*.f6482.5

                          \[\leadsto \frac{-\mathsf{fma}\left(c, c \cdot \frac{a}{b \cdot b}, c\right)}{b} \]
                      5. Applied rewrites82.5%

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

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

                          \[\leadsto \frac{-\mathsf{fma}\left(c, c \cdot \frac{a}{b \cdot b}, c\right)}{b} \]
                        3. associate-/r*N/A

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

                          \[\leadsto \frac{-\mathsf{fma}\left(c, c \cdot \frac{\frac{a}{b}}{b}, c\right)}{b} \]
                        5. lower-/.f6482.5

                          \[\leadsto \frac{-\mathsf{fma}\left(c, c \cdot \frac{\frac{a}{b}}{b}, c\right)}{b} \]
                      7. Applied rewrites82.5%

                        \[\leadsto \frac{-\mathsf{fma}\left(c, c \cdot \frac{\frac{a}{b}}{b}, c\right)}{b} \]
                    3. Recombined 3 regimes into one program.
                    4. Add Preprocessing

                    Alternative 4: 79.5% accurate, 0.9× speedup?

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

                      1. Initial program 72.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 rewrites72.2%

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

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

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

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

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

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

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

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

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

                            \[\leadsto \left(-b\right) \cdot \left(\frac{-c}{{b}^{2}} + \frac{1}{a}\right) \]
                          9. lower-/.f64N/A

                            \[\leadsto \left(-b\right) \cdot \left(\frac{-c}{{b}^{2}} + \frac{\color{blue}{1}}{a}\right) \]
                          10. pow2N/A

                            \[\leadsto \left(-b\right) \cdot \left(\frac{-c}{b \cdot b} + \frac{1}{a}\right) \]
                          11. lift-*.f64N/A

                            \[\leadsto \left(-b\right) \cdot \left(\frac{-c}{b \cdot b} + \frac{1}{a}\right) \]
                          12. lower-/.f6480.6

                            \[\leadsto \left(-b\right) \cdot \left(\frac{-c}{b \cdot b} + \frac{1}{\color{blue}{a}}\right) \]
                        4. Applied rewrites80.6%

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

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

                            \[\leadsto -1 \cdot \frac{b}{a} + \frac{c}{\color{blue}{b}} \]
                          2. associate-*r/N/A

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

                            \[\leadsto \frac{\mathsf{neg}\left(b\right)}{a} + \frac{c}{b} \]
                          4. lift-neg.f64N/A

                            \[\leadsto \frac{-b}{a} + \frac{c}{b} \]
                          5. lower-/.f64N/A

                            \[\leadsto \frac{-b}{a} + \frac{c}{b} \]
                          6. lower-/.f6480.9

                            \[\leadsto \frac{-b}{a} + \frac{c}{b} \]
                        7. Applied rewrites80.9%

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

                        if -1.32000000000000004e-120 < b < 1.15e-104

                        1. Initial program 74.6%

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

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

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

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

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

                              \[\leadsto \frac{\sqrt{\left(a \cdot -4\right) \cdot c} + \left(-b\right)}{a + a} \]
                            4. lower-*.f6472.3

                              \[\leadsto \frac{\sqrt{\left(a \cdot -4\right) \cdot c} + \left(-b\right)}{a + a} \]
                          4. Applied rewrites72.3%

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

                          if 1.15e-104 < b

                          1. Initial program 20.4%

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

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

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

                              \[\leadsto \frac{\mathsf{neg}\left(c\right)}{b} \]
                            3. lower-/.f64N/A

                              \[\leadsto \frac{\mathsf{neg}\left(c\right)}{\color{blue}{b}} \]
                            4. lower-neg.f6483.1

                              \[\leadsto \frac{-c}{b} \]
                          4. Applied rewrites83.1%

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

                        Alternative 5: 79.5% accurate, 1.1× speedup?

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

                          1. Initial program 72.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 rewrites72.2%

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

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

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

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

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

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

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

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

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

                                \[\leadsto \left(-b\right) \cdot \left(\frac{-c}{{b}^{2}} + \frac{1}{a}\right) \]
                              9. lower-/.f64N/A

                                \[\leadsto \left(-b\right) \cdot \left(\frac{-c}{{b}^{2}} + \frac{\color{blue}{1}}{a}\right) \]
                              10. pow2N/A

                                \[\leadsto \left(-b\right) \cdot \left(\frac{-c}{b \cdot b} + \frac{1}{a}\right) \]
                              11. lift-*.f64N/A

                                \[\leadsto \left(-b\right) \cdot \left(\frac{-c}{b \cdot b} + \frac{1}{a}\right) \]
                              12. lower-/.f6480.6

                                \[\leadsto \left(-b\right) \cdot \left(\frac{-c}{b \cdot b} + \frac{1}{\color{blue}{a}}\right) \]
                            4. Applied rewrites80.6%

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

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

                                \[\leadsto -1 \cdot \frac{b}{a} + \frac{c}{\color{blue}{b}} \]
                              2. associate-*r/N/A

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

                                \[\leadsto \frac{\mathsf{neg}\left(b\right)}{a} + \frac{c}{b} \]
                              4. lift-neg.f64N/A

                                \[\leadsto \frac{-b}{a} + \frac{c}{b} \]
                              5. lower-/.f64N/A

                                \[\leadsto \frac{-b}{a} + \frac{c}{b} \]
                              6. lower-/.f6480.9

                                \[\leadsto \frac{-b}{a} + \frac{c}{b} \]
                            7. Applied rewrites80.9%

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

                            if -6.5000000000000003e-121 < b < 1.15e-104

                            1. Initial program 74.6%

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

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

                                \[\leadsto \frac{\color{blue}{\sqrt{a \cdot c} \cdot \sqrt{-4}}}{a + a} \]
                              3. Step-by-step derivation
                                1. sqrt-unprodN/A

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

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

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

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

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

                                  \[\leadsto \frac{\sqrt{\left(a \cdot -4\right) \cdot c}}{a + a} \]
                                7. lower-*.f6471.4

                                  \[\leadsto \frac{\sqrt{\left(a \cdot -4\right) \cdot c}}{a + a} \]
                              4. Applied rewrites71.4%

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

                              if 1.15e-104 < b

                              1. Initial program 20.4%

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

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

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

                                  \[\leadsto \frac{\mathsf{neg}\left(c\right)}{b} \]
                                3. lower-/.f64N/A

                                  \[\leadsto \frac{\mathsf{neg}\left(c\right)}{\color{blue}{b}} \]
                                4. lower-neg.f6483.1

                                  \[\leadsto \frac{-c}{b} \]
                              4. Applied rewrites83.1%

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

                            Alternative 6: 79.5% accurate, 1.1× speedup?

                            \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq -6.5 \cdot 10^{-121}:\\ \;\;\;\;\frac{-b}{a} + \frac{c}{b}\\ \mathbf{elif}\;b \leq 1.15 \cdot 10^{-104}:\\ \;\;\;\;\left(-c\right) \cdot \frac{1}{\sqrt{-c \cdot a}}\\ \mathbf{else}:\\ \;\;\;\;\frac{-c}{b}\\ \end{array} \end{array} \]
                            (FPCore (a b c)
                             :precision binary64
                             (if (<= b -6.5e-121)
                               (+ (/ (- b) a) (/ c b))
                               (if (<= b 1.15e-104) (* (- c) (/ 1.0 (sqrt (- (* c a))))) (/ (- c) b))))
                            double code(double a, double b, double c) {
                            	double tmp;
                            	if (b <= -6.5e-121) {
                            		tmp = (-b / a) + (c / b);
                            	} else if (b <= 1.15e-104) {
                            		tmp = -c * (1.0 / sqrt(-(c * a)));
                            	} else {
                            		tmp = -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.5d-121)) then
                                    tmp = (-b / a) + (c / b)
                                else if (b <= 1.15d-104) then
                                    tmp = -c * (1.0d0 / sqrt(-(c * a)))
                                else
                                    tmp = -c / b
                                end if
                                code = tmp
                            end function
                            
                            public static double code(double a, double b, double c) {
                            	double tmp;
                            	if (b <= -6.5e-121) {
                            		tmp = (-b / a) + (c / b);
                            	} else if (b <= 1.15e-104) {
                            		tmp = -c * (1.0 / Math.sqrt(-(c * a)));
                            	} else {
                            		tmp = -c / b;
                            	}
                            	return tmp;
                            }
                            
                            def code(a, b, c):
                            	tmp = 0
                            	if b <= -6.5e-121:
                            		tmp = (-b / a) + (c / b)
                            	elif b <= 1.15e-104:
                            		tmp = -c * (1.0 / math.sqrt(-(c * a)))
                            	else:
                            		tmp = -c / b
                            	return tmp
                            
                            function code(a, b, c)
                            	tmp = 0.0
                            	if (b <= -6.5e-121)
                            		tmp = Float64(Float64(Float64(-b) / a) + Float64(c / b));
                            	elseif (b <= 1.15e-104)
                            		tmp = Float64(Float64(-c) * Float64(1.0 / sqrt(Float64(-Float64(c * a)))));
                            	else
                            		tmp = Float64(Float64(-c) / b);
                            	end
                            	return tmp
                            end
                            
                            function tmp_2 = code(a, b, c)
                            	tmp = 0.0;
                            	if (b <= -6.5e-121)
                            		tmp = (-b / a) + (c / b);
                            	elseif (b <= 1.15e-104)
                            		tmp = -c * (1.0 / sqrt(-(c * a)));
                            	else
                            		tmp = -c / b;
                            	end
                            	tmp_2 = tmp;
                            end
                            
                            code[a_, b_, c_] := If[LessEqual[b, -6.5e-121], N[(N[((-b) / a), $MachinePrecision] + N[(c / b), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 1.15e-104], N[((-c) * N[(1.0 / N[Sqrt[(-N[(c * a), $MachinePrecision])], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[((-c) / b), $MachinePrecision]]]
                            
                            \begin{array}{l}
                            
                            \\
                            \begin{array}{l}
                            \mathbf{if}\;b \leq -6.5 \cdot 10^{-121}:\\
                            \;\;\;\;\frac{-b}{a} + \frac{c}{b}\\
                            
                            \mathbf{elif}\;b \leq 1.15 \cdot 10^{-104}:\\
                            \;\;\;\;\left(-c\right) \cdot \frac{1}{\sqrt{-c \cdot a}}\\
                            
                            \mathbf{else}:\\
                            \;\;\;\;\frac{-c}{b}\\
                            
                            
                            \end{array}
                            \end{array}
                            
                            Derivation
                            1. Split input into 3 regimes
                            2. if b < -6.5000000000000003e-121

                              1. Initial program 72.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 rewrites72.2%

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

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

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

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

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

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

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

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

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

                                    \[\leadsto \left(-b\right) \cdot \left(\frac{-c}{{b}^{2}} + \frac{1}{a}\right) \]
                                  9. lower-/.f64N/A

                                    \[\leadsto \left(-b\right) \cdot \left(\frac{-c}{{b}^{2}} + \frac{\color{blue}{1}}{a}\right) \]
                                  10. pow2N/A

                                    \[\leadsto \left(-b\right) \cdot \left(\frac{-c}{b \cdot b} + \frac{1}{a}\right) \]
                                  11. lift-*.f64N/A

                                    \[\leadsto \left(-b\right) \cdot \left(\frac{-c}{b \cdot b} + \frac{1}{a}\right) \]
                                  12. lower-/.f6480.6

                                    \[\leadsto \left(-b\right) \cdot \left(\frac{-c}{b \cdot b} + \frac{1}{\color{blue}{a}}\right) \]
                                4. Applied rewrites80.6%

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

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

                                    \[\leadsto -1 \cdot \frac{b}{a} + \frac{c}{\color{blue}{b}} \]
                                  2. associate-*r/N/A

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

                                    \[\leadsto \frac{\mathsf{neg}\left(b\right)}{a} + \frac{c}{b} \]
                                  4. lift-neg.f64N/A

                                    \[\leadsto \frac{-b}{a} + \frac{c}{b} \]
                                  5. lower-/.f64N/A

                                    \[\leadsto \frac{-b}{a} + \frac{c}{b} \]
                                  6. lower-/.f6480.9

                                    \[\leadsto \frac{-b}{a} + \frac{c}{b} \]
                                7. Applied rewrites80.9%

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

                                if -6.5000000000000003e-121 < b < 1.15e-104

                                1. Initial program 74.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                  \[\leadsto \left(-c\right) \cdot \left(\sqrt{\frac{1}{a \cdot c}} \cdot \color{blue}{\sqrt{-1}}\right) \]
                                6. Step-by-step derivation
                                  1. *-commutativeN/A

                                    \[\leadsto \left(-c\right) \cdot \left(\sqrt{\frac{1}{c \cdot a}} \cdot \sqrt{-1}\right) \]
                                  2. sqrt-prodN/A

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

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

                                    \[\leadsto \left(-c\right) \cdot \sqrt{\frac{1 \cdot -1}{c \cdot a}} \]
                                  5. metadata-evalN/A

                                    \[\leadsto \left(-c\right) \cdot \sqrt{\frac{-1}{c \cdot a}} \]
                                  6. *-commutativeN/A

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

                                    \[\leadsto \left(-c\right) \cdot \sqrt{\frac{-1}{a \cdot c}} \]
                                  8. *-commutativeN/A

                                    \[\leadsto \left(-c\right) \cdot \sqrt{\frac{-1}{c \cdot a}} \]
                                  9. lift-*.f6470.5

                                    \[\leadsto \left(-c\right) \cdot \sqrt{\frac{-1}{c \cdot a}} \]
                                7. Applied rewrites70.5%

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

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

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

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

                                    \[\leadsto \left(-c\right) \cdot \sqrt{\frac{\mathsf{neg}\left(-1\right)}{\mathsf{neg}\left(c \cdot a\right)}} \]
                                  5. *-commutativeN/A

                                    \[\leadsto \left(-c\right) \cdot \sqrt{\frac{\mathsf{neg}\left(-1\right)}{\mathsf{neg}\left(a \cdot c\right)}} \]
                                  6. metadata-evalN/A

                                    \[\leadsto \left(-c\right) \cdot \sqrt{\frac{1}{\mathsf{neg}\left(a \cdot c\right)}} \]
                                  7. sqrt-divN/A

                                    \[\leadsto \left(-c\right) \cdot \frac{\sqrt{1}}{\sqrt{\mathsf{neg}\left(a \cdot c\right)}} \]
                                  8. metadata-evalN/A

                                    \[\leadsto \left(-c\right) \cdot \frac{1}{\sqrt{\mathsf{neg}\left(a \cdot c\right)}} \]
                                  9. lower-/.f64N/A

                                    \[\leadsto \left(-c\right) \cdot \frac{1}{\sqrt{\mathsf{neg}\left(a \cdot c\right)}} \]
                                  10. lower-sqrt.f64N/A

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

                                    \[\leadsto \left(-c\right) \cdot \frac{1}{\sqrt{-a \cdot c}} \]
                                  12. *-commutativeN/A

                                    \[\leadsto \left(-c\right) \cdot \frac{1}{\sqrt{-c \cdot a}} \]
                                  13. lift-*.f6471.2

                                    \[\leadsto \left(-c\right) \cdot \frac{1}{\sqrt{-c \cdot a}} \]
                                9. Applied rewrites71.2%

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

                                if 1.15e-104 < b

                                1. Initial program 20.4%

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

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

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

                                    \[\leadsto \frac{\mathsf{neg}\left(c\right)}{b} \]
                                  3. lower-/.f64N/A

                                    \[\leadsto \frac{\mathsf{neg}\left(c\right)}{\color{blue}{b}} \]
                                  4. lower-neg.f6483.1

                                    \[\leadsto \frac{-c}{b} \]
                                4. Applied rewrites83.1%

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

                              Alternative 7: 79.3% accurate, 1.2× speedup?

                              \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq -6.5 \cdot 10^{-121}:\\ \;\;\;\;\frac{-b}{a} + \frac{c}{b}\\ \mathbf{elif}\;b \leq 1.15 \cdot 10^{-104}:\\ \;\;\;\;\left(-c\right) \cdot \sqrt{\frac{-1}{c \cdot a}}\\ \mathbf{else}:\\ \;\;\;\;\frac{-c}{b}\\ \end{array} \end{array} \]
                              (FPCore (a b c)
                               :precision binary64
                               (if (<= b -6.5e-121)
                                 (+ (/ (- b) a) (/ c b))
                                 (if (<= b 1.15e-104) (* (- c) (sqrt (/ -1.0 (* c a)))) (/ (- c) b))))
                              double code(double a, double b, double c) {
                              	double tmp;
                              	if (b <= -6.5e-121) {
                              		tmp = (-b / a) + (c / b);
                              	} else if (b <= 1.15e-104) {
                              		tmp = -c * sqrt((-1.0 / (c * a)));
                              	} else {
                              		tmp = -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.5d-121)) then
                                      tmp = (-b / a) + (c / b)
                                  else if (b <= 1.15d-104) then
                                      tmp = -c * sqrt(((-1.0d0) / (c * a)))
                                  else
                                      tmp = -c / b
                                  end if
                                  code = tmp
                              end function
                              
                              public static double code(double a, double b, double c) {
                              	double tmp;
                              	if (b <= -6.5e-121) {
                              		tmp = (-b / a) + (c / b);
                              	} else if (b <= 1.15e-104) {
                              		tmp = -c * Math.sqrt((-1.0 / (c * a)));
                              	} else {
                              		tmp = -c / b;
                              	}
                              	return tmp;
                              }
                              
                              def code(a, b, c):
                              	tmp = 0
                              	if b <= -6.5e-121:
                              		tmp = (-b / a) + (c / b)
                              	elif b <= 1.15e-104:
                              		tmp = -c * math.sqrt((-1.0 / (c * a)))
                              	else:
                              		tmp = -c / b
                              	return tmp
                              
                              function code(a, b, c)
                              	tmp = 0.0
                              	if (b <= -6.5e-121)
                              		tmp = Float64(Float64(Float64(-b) / a) + Float64(c / b));
                              	elseif (b <= 1.15e-104)
                              		tmp = Float64(Float64(-c) * sqrt(Float64(-1.0 / Float64(c * a))));
                              	else
                              		tmp = Float64(Float64(-c) / b);
                              	end
                              	return tmp
                              end
                              
                              function tmp_2 = code(a, b, c)
                              	tmp = 0.0;
                              	if (b <= -6.5e-121)
                              		tmp = (-b / a) + (c / b);
                              	elseif (b <= 1.15e-104)
                              		tmp = -c * sqrt((-1.0 / (c * a)));
                              	else
                              		tmp = -c / b;
                              	end
                              	tmp_2 = tmp;
                              end
                              
                              code[a_, b_, c_] := If[LessEqual[b, -6.5e-121], N[(N[((-b) / a), $MachinePrecision] + N[(c / b), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 1.15e-104], N[((-c) * N[Sqrt[N[(-1.0 / N[(c * a), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[((-c) / b), $MachinePrecision]]]
                              
                              \begin{array}{l}
                              
                              \\
                              \begin{array}{l}
                              \mathbf{if}\;b \leq -6.5 \cdot 10^{-121}:\\
                              \;\;\;\;\frac{-b}{a} + \frac{c}{b}\\
                              
                              \mathbf{elif}\;b \leq 1.15 \cdot 10^{-104}:\\
                              \;\;\;\;\left(-c\right) \cdot \sqrt{\frac{-1}{c \cdot a}}\\
                              
                              \mathbf{else}:\\
                              \;\;\;\;\frac{-c}{b}\\
                              
                              
                              \end{array}
                              \end{array}
                              
                              Derivation
                              1. Split input into 3 regimes
                              2. if b < -6.5000000000000003e-121

                                1. Initial program 72.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 rewrites72.2%

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

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

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

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

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

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

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

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

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

                                      \[\leadsto \left(-b\right) \cdot \left(\frac{-c}{{b}^{2}} + \frac{1}{a}\right) \]
                                    9. lower-/.f64N/A

                                      \[\leadsto \left(-b\right) \cdot \left(\frac{-c}{{b}^{2}} + \frac{\color{blue}{1}}{a}\right) \]
                                    10. pow2N/A

                                      \[\leadsto \left(-b\right) \cdot \left(\frac{-c}{b \cdot b} + \frac{1}{a}\right) \]
                                    11. lift-*.f64N/A

                                      \[\leadsto \left(-b\right) \cdot \left(\frac{-c}{b \cdot b} + \frac{1}{a}\right) \]
                                    12. lower-/.f6480.6

                                      \[\leadsto \left(-b\right) \cdot \left(\frac{-c}{b \cdot b} + \frac{1}{\color{blue}{a}}\right) \]
                                  4. Applied rewrites80.6%

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

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

                                      \[\leadsto -1 \cdot \frac{b}{a} + \frac{c}{\color{blue}{b}} \]
                                    2. associate-*r/N/A

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

                                      \[\leadsto \frac{\mathsf{neg}\left(b\right)}{a} + \frac{c}{b} \]
                                    4. lift-neg.f64N/A

                                      \[\leadsto \frac{-b}{a} + \frac{c}{b} \]
                                    5. lower-/.f64N/A

                                      \[\leadsto \frac{-b}{a} + \frac{c}{b} \]
                                    6. lower-/.f6480.9

                                      \[\leadsto \frac{-b}{a} + \frac{c}{b} \]
                                  7. Applied rewrites80.9%

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

                                  if -6.5000000000000003e-121 < b < 1.15e-104

                                  1. Initial program 74.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                    \[\leadsto \left(-c\right) \cdot \left(\sqrt{\frac{1}{a \cdot c}} \cdot \color{blue}{\sqrt{-1}}\right) \]
                                  6. Step-by-step derivation
                                    1. *-commutativeN/A

                                      \[\leadsto \left(-c\right) \cdot \left(\sqrt{\frac{1}{c \cdot a}} \cdot \sqrt{-1}\right) \]
                                    2. sqrt-prodN/A

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

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

                                      \[\leadsto \left(-c\right) \cdot \sqrt{\frac{1 \cdot -1}{c \cdot a}} \]
                                    5. metadata-evalN/A

                                      \[\leadsto \left(-c\right) \cdot \sqrt{\frac{-1}{c \cdot a}} \]
                                    6. *-commutativeN/A

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

                                      \[\leadsto \left(-c\right) \cdot \sqrt{\frac{-1}{a \cdot c}} \]
                                    8. *-commutativeN/A

                                      \[\leadsto \left(-c\right) \cdot \sqrt{\frac{-1}{c \cdot a}} \]
                                    9. lift-*.f6470.5

                                      \[\leadsto \left(-c\right) \cdot \sqrt{\frac{-1}{c \cdot a}} \]
                                  7. Applied rewrites70.5%

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

                                  if 1.15e-104 < b

                                  1. Initial program 20.4%

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

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

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

                                      \[\leadsto \frac{\mathsf{neg}\left(c\right)}{b} \]
                                    3. lower-/.f64N/A

                                      \[\leadsto \frac{\mathsf{neg}\left(c\right)}{\color{blue}{b}} \]
                                    4. lower-neg.f6483.1

                                      \[\leadsto \frac{-c}{b} \]
                                  4. Applied rewrites83.1%

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

                                Alternative 8: 72.9% accurate, 1.3× speedup?

                                \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq -5 \cdot 10^{-140}:\\ \;\;\;\;\frac{-b}{a} + \frac{c}{b}\\ \mathbf{elif}\;b \leq 3.2 \cdot 10^{-113}:\\ \;\;\;\;-\frac{\sqrt{-\left(-c\right)}}{\sqrt{-a}}\\ \mathbf{else}:\\ \;\;\;\;\frac{-c}{b}\\ \end{array} \end{array} \]
                                (FPCore (a b c)
                                 :precision binary64
                                 (if (<= b -5e-140)
                                   (+ (/ (- b) a) (/ c b))
                                   (if (<= b 3.2e-113) (- (/ (sqrt (- (- c))) (sqrt (- a)))) (/ (- c) b))))
                                double code(double a, double b, double c) {
                                	double tmp;
                                	if (b <= -5e-140) {
                                		tmp = (-b / a) + (c / b);
                                	} else if (b <= 3.2e-113) {
                                		tmp = -(sqrt(-(-c)) / sqrt(-a));
                                	} else {
                                		tmp = -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-140)) then
                                        tmp = (-b / a) + (c / b)
                                    else if (b <= 3.2d-113) then
                                        tmp = -(sqrt(-(-c)) / sqrt(-a))
                                    else
                                        tmp = -c / b
                                    end if
                                    code = tmp
                                end function
                                
                                public static double code(double a, double b, double c) {
                                	double tmp;
                                	if (b <= -5e-140) {
                                		tmp = (-b / a) + (c / b);
                                	} else if (b <= 3.2e-113) {
                                		tmp = -(Math.sqrt(-(-c)) / Math.sqrt(-a));
                                	} else {
                                		tmp = -c / b;
                                	}
                                	return tmp;
                                }
                                
                                def code(a, b, c):
                                	tmp = 0
                                	if b <= -5e-140:
                                		tmp = (-b / a) + (c / b)
                                	elif b <= 3.2e-113:
                                		tmp = -(math.sqrt(-(-c)) / math.sqrt(-a))
                                	else:
                                		tmp = -c / b
                                	return tmp
                                
                                function code(a, b, c)
                                	tmp = 0.0
                                	if (b <= -5e-140)
                                		tmp = Float64(Float64(Float64(-b) / a) + Float64(c / b));
                                	elseif (b <= 3.2e-113)
                                		tmp = Float64(-Float64(sqrt(Float64(-Float64(-c))) / sqrt(Float64(-a))));
                                	else
                                		tmp = Float64(Float64(-c) / b);
                                	end
                                	return tmp
                                end
                                
                                function tmp_2 = code(a, b, c)
                                	tmp = 0.0;
                                	if (b <= -5e-140)
                                		tmp = (-b / a) + (c / b);
                                	elseif (b <= 3.2e-113)
                                		tmp = -(sqrt(-(-c)) / sqrt(-a));
                                	else
                                		tmp = -c / b;
                                	end
                                	tmp_2 = tmp;
                                end
                                
                                code[a_, b_, c_] := If[LessEqual[b, -5e-140], N[(N[((-b) / a), $MachinePrecision] + N[(c / b), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 3.2e-113], (-N[(N[Sqrt[(-(-c))], $MachinePrecision] / N[Sqrt[(-a)], $MachinePrecision]), $MachinePrecision]), N[((-c) / b), $MachinePrecision]]]
                                
                                \begin{array}{l}
                                
                                \\
                                \begin{array}{l}
                                \mathbf{if}\;b \leq -5 \cdot 10^{-140}:\\
                                \;\;\;\;\frac{-b}{a} + \frac{c}{b}\\
                                
                                \mathbf{elif}\;b \leq 3.2 \cdot 10^{-113}:\\
                                \;\;\;\;-\frac{\sqrt{-\left(-c\right)}}{\sqrt{-a}}\\
                                
                                \mathbf{else}:\\
                                \;\;\;\;\frac{-c}{b}\\
                                
                                
                                \end{array}
                                \end{array}
                                
                                Derivation
                                1. Split input into 3 regimes
                                2. if b < -5.00000000000000015e-140

                                  1. Initial program 72.5%

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

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

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

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

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

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

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

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

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

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

                                        \[\leadsto \left(-b\right) \cdot \left(\frac{-c}{{b}^{2}} + \frac{1}{a}\right) \]
                                      9. lower-/.f64N/A

                                        \[\leadsto \left(-b\right) \cdot \left(\frac{-c}{{b}^{2}} + \frac{\color{blue}{1}}{a}\right) \]
                                      10. pow2N/A

                                        \[\leadsto \left(-b\right) \cdot \left(\frac{-c}{b \cdot b} + \frac{1}{a}\right) \]
                                      11. lift-*.f64N/A

                                        \[\leadsto \left(-b\right) \cdot \left(\frac{-c}{b \cdot b} + \frac{1}{a}\right) \]
                                      12. lower-/.f6479.0

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

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

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

                                        \[\leadsto -1 \cdot \frac{b}{a} + \frac{c}{\color{blue}{b}} \]
                                      2. associate-*r/N/A

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

                                        \[\leadsto \frac{\mathsf{neg}\left(b\right)}{a} + \frac{c}{b} \]
                                      4. lift-neg.f64N/A

                                        \[\leadsto \frac{-b}{a} + \frac{c}{b} \]
                                      5. lower-/.f64N/A

                                        \[\leadsto \frac{-b}{a} + \frac{c}{b} \]
                                      6. lower-/.f6479.4

                                        \[\leadsto \frac{-b}{a} + \frac{c}{b} \]
                                    7. Applied rewrites79.4%

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

                                    if -5.00000000000000015e-140 < b < 3.2000000000000002e-113

                                    1. Initial program 74.5%

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

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

                                        \[\leadsto \color{blue}{-1 \cdot \left(\sqrt{\frac{c}{a}} \cdot \sqrt{-1}\right)} \]
                                      3. Step-by-step derivation
                                        1. mul-1-negN/A

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

                                          \[\leadsto -\sqrt{\frac{c}{a}} \cdot \sqrt{-1} \]
                                        3. sqrt-unprodN/A

                                          \[\leadsto -\sqrt{\frac{c}{a} \cdot -1} \]
                                        4. *-commutativeN/A

                                          \[\leadsto -\sqrt{-1 \cdot \frac{c}{a}} \]
                                        5. lower-sqrt.f64N/A

                                          \[\leadsto -\sqrt{-1 \cdot \frac{c}{a}} \]
                                        6. associate-*r/N/A

                                          \[\leadsto -\sqrt{\frac{-1 \cdot c}{a}} \]
                                        7. mul-1-negN/A

                                          \[\leadsto -\sqrt{\frac{\mathsf{neg}\left(c\right)}{a}} \]
                                        8. lift-neg.f64N/A

                                          \[\leadsto -\sqrt{\frac{-c}{a}} \]
                                        9. lower-/.f6433.8

                                          \[\leadsto -\sqrt{\frac{-c}{a}} \]
                                      4. Applied rewrites33.8%

                                        \[\leadsto \color{blue}{-\sqrt{\frac{-c}{a}}} \]
                                      5. Step-by-step derivation
                                        1. lift-sqrt.f64N/A

                                          \[\leadsto -\sqrt{\frac{-c}{a}} \]
                                        2. lift-/.f64N/A

                                          \[\leadsto -\sqrt{\frac{-c}{a}} \]
                                        3. frac-2negN/A

                                          \[\leadsto -\sqrt{\frac{\mathsf{neg}\left(\left(-c\right)\right)}{\mathsf{neg}\left(a\right)}} \]
                                        4. sqrt-divN/A

                                          \[\leadsto -\frac{\sqrt{\mathsf{neg}\left(\left(-c\right)\right)}}{\sqrt{\mathsf{neg}\left(a\right)}} \]
                                        5. lower-/.f64N/A

                                          \[\leadsto -\frac{\sqrt{\mathsf{neg}\left(\left(-c\right)\right)}}{\sqrt{\mathsf{neg}\left(a\right)}} \]
                                        6. lower-sqrt.f64N/A

                                          \[\leadsto -\frac{\sqrt{\mathsf{neg}\left(\left(-c\right)\right)}}{\sqrt{\mathsf{neg}\left(a\right)}} \]
                                        7. lower-neg.f64N/A

                                          \[\leadsto -\frac{\sqrt{-\left(-c\right)}}{\sqrt{\mathsf{neg}\left(a\right)}} \]
                                        8. lower-sqrt.f64N/A

                                          \[\leadsto -\frac{\sqrt{-\left(-c\right)}}{\sqrt{\mathsf{neg}\left(a\right)}} \]
                                        9. lower-neg.f6444.0

                                          \[\leadsto -\frac{\sqrt{-\left(-c\right)}}{\sqrt{-a}} \]
                                      6. Applied rewrites44.0%

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

                                      if 3.2000000000000002e-113 < b

                                      1. Initial program 20.8%

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

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

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

                                          \[\leadsto \frac{\mathsf{neg}\left(c\right)}{b} \]
                                        3. lower-/.f64N/A

                                          \[\leadsto \frac{\mathsf{neg}\left(c\right)}{\color{blue}{b}} \]
                                        4. lower-neg.f6482.5

                                          \[\leadsto \frac{-c}{b} \]
                                      4. Applied rewrites82.5%

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

                                    Alternative 9: 70.9% accurate, 1.2× speedup?

                                    \[\begin{array}{l} \\ \begin{array}{l} t_0 := \sqrt{\frac{-c}{a}}\\ \mathbf{if}\;b \leq -1.32 \cdot 10^{-139}:\\ \;\;\;\;\frac{-b}{a} + \frac{c}{b}\\ \mathbf{elif}\;b \leq -1.6 \cdot 10^{-251}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;b \leq 2.3 \cdot 10^{-136}:\\ \;\;\;\;-t\_0\\ \mathbf{else}:\\ \;\;\;\;\frac{-c}{b}\\ \end{array} \end{array} \]
                                    (FPCore (a b c)
                                     :precision binary64
                                     (let* ((t_0 (sqrt (/ (- c) a))))
                                       (if (<= b -1.32e-139)
                                         (+ (/ (- b) a) (/ c b))
                                         (if (<= b -1.6e-251) t_0 (if (<= b 2.3e-136) (- t_0) (/ (- c) b))))))
                                    double code(double a, double b, double c) {
                                    	double t_0 = sqrt((-c / a));
                                    	double tmp;
                                    	if (b <= -1.32e-139) {
                                    		tmp = (-b / a) + (c / b);
                                    	} else if (b <= -1.6e-251) {
                                    		tmp = t_0;
                                    	} else if (b <= 2.3e-136) {
                                    		tmp = -t_0;
                                    	} else {
                                    		tmp = -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) :: t_0
                                        real(8) :: tmp
                                        t_0 = sqrt((-c / a))
                                        if (b <= (-1.32d-139)) then
                                            tmp = (-b / a) + (c / b)
                                        else if (b <= (-1.6d-251)) then
                                            tmp = t_0
                                        else if (b <= 2.3d-136) then
                                            tmp = -t_0
                                        else
                                            tmp = -c / b
                                        end if
                                        code = tmp
                                    end function
                                    
                                    public static double code(double a, double b, double c) {
                                    	double t_0 = Math.sqrt((-c / a));
                                    	double tmp;
                                    	if (b <= -1.32e-139) {
                                    		tmp = (-b / a) + (c / b);
                                    	} else if (b <= -1.6e-251) {
                                    		tmp = t_0;
                                    	} else if (b <= 2.3e-136) {
                                    		tmp = -t_0;
                                    	} else {
                                    		tmp = -c / b;
                                    	}
                                    	return tmp;
                                    }
                                    
                                    def code(a, b, c):
                                    	t_0 = math.sqrt((-c / a))
                                    	tmp = 0
                                    	if b <= -1.32e-139:
                                    		tmp = (-b / a) + (c / b)
                                    	elif b <= -1.6e-251:
                                    		tmp = t_0
                                    	elif b <= 2.3e-136:
                                    		tmp = -t_0
                                    	else:
                                    		tmp = -c / b
                                    	return tmp
                                    
                                    function code(a, b, c)
                                    	t_0 = sqrt(Float64(Float64(-c) / a))
                                    	tmp = 0.0
                                    	if (b <= -1.32e-139)
                                    		tmp = Float64(Float64(Float64(-b) / a) + Float64(c / b));
                                    	elseif (b <= -1.6e-251)
                                    		tmp = t_0;
                                    	elseif (b <= 2.3e-136)
                                    		tmp = Float64(-t_0);
                                    	else
                                    		tmp = Float64(Float64(-c) / b);
                                    	end
                                    	return tmp
                                    end
                                    
                                    function tmp_2 = code(a, b, c)
                                    	t_0 = sqrt((-c / a));
                                    	tmp = 0.0;
                                    	if (b <= -1.32e-139)
                                    		tmp = (-b / a) + (c / b);
                                    	elseif (b <= -1.6e-251)
                                    		tmp = t_0;
                                    	elseif (b <= 2.3e-136)
                                    		tmp = -t_0;
                                    	else
                                    		tmp = -c / b;
                                    	end
                                    	tmp_2 = tmp;
                                    end
                                    
                                    code[a_, b_, c_] := Block[{t$95$0 = N[Sqrt[N[((-c) / a), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[b, -1.32e-139], N[(N[((-b) / a), $MachinePrecision] + N[(c / b), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, -1.6e-251], t$95$0, If[LessEqual[b, 2.3e-136], (-t$95$0), N[((-c) / b), $MachinePrecision]]]]]
                                    
                                    \begin{array}{l}
                                    
                                    \\
                                    \begin{array}{l}
                                    t_0 := \sqrt{\frac{-c}{a}}\\
                                    \mathbf{if}\;b \leq -1.32 \cdot 10^{-139}:\\
                                    \;\;\;\;\frac{-b}{a} + \frac{c}{b}\\
                                    
                                    \mathbf{elif}\;b \leq -1.6 \cdot 10^{-251}:\\
                                    \;\;\;\;t\_0\\
                                    
                                    \mathbf{elif}\;b \leq 2.3 \cdot 10^{-136}:\\
                                    \;\;\;\;-t\_0\\
                                    
                                    \mathbf{else}:\\
                                    \;\;\;\;\frac{-c}{b}\\
                                    
                                    
                                    \end{array}
                                    \end{array}
                                    
                                    Derivation
                                    1. Split input into 4 regimes
                                    2. if b < -1.31999999999999995e-139

                                      1. Initial program 72.5%

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

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

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

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

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

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

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

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

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

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

                                            \[\leadsto \left(-b\right) \cdot \left(\frac{-c}{{b}^{2}} + \frac{1}{a}\right) \]
                                          9. lower-/.f64N/A

                                            \[\leadsto \left(-b\right) \cdot \left(\frac{-c}{{b}^{2}} + \frac{\color{blue}{1}}{a}\right) \]
                                          10. pow2N/A

                                            \[\leadsto \left(-b\right) \cdot \left(\frac{-c}{b \cdot b} + \frac{1}{a}\right) \]
                                          11. lift-*.f64N/A

                                            \[\leadsto \left(-b\right) \cdot \left(\frac{-c}{b \cdot b} + \frac{1}{a}\right) \]
                                          12. lower-/.f6479.0

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

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

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

                                            \[\leadsto -1 \cdot \frac{b}{a} + \frac{c}{\color{blue}{b}} \]
                                          2. associate-*r/N/A

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

                                            \[\leadsto \frac{\mathsf{neg}\left(b\right)}{a} + \frac{c}{b} \]
                                          4. lift-neg.f64N/A

                                            \[\leadsto \frac{-b}{a} + \frac{c}{b} \]
                                          5. lower-/.f64N/A

                                            \[\leadsto \frac{-b}{a} + \frac{c}{b} \]
                                          6. lower-/.f6479.4

                                            \[\leadsto \frac{-b}{a} + \frac{c}{b} \]
                                        7. Applied rewrites79.4%

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

                                        if -1.31999999999999995e-139 < b < -1.59999999999999991e-251

                                        1. Initial program 76.4%

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

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

                                            \[\leadsto \color{blue}{-1 \cdot \left(\sqrt{\frac{c}{a}} \cdot \sqrt{-1}\right)} \]
                                          3. Step-by-step derivation
                                            1. mul-1-negN/A

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

                                              \[\leadsto -\sqrt{\frac{c}{a}} \cdot \sqrt{-1} \]
                                            3. sqrt-unprodN/A

                                              \[\leadsto -\sqrt{\frac{c}{a} \cdot -1} \]
                                            4. *-commutativeN/A

                                              \[\leadsto -\sqrt{-1 \cdot \frac{c}{a}} \]
                                            5. lower-sqrt.f64N/A

                                              \[\leadsto -\sqrt{-1 \cdot \frac{c}{a}} \]
                                            6. associate-*r/N/A

                                              \[\leadsto -\sqrt{\frac{-1 \cdot c}{a}} \]
                                            7. mul-1-negN/A

                                              \[\leadsto -\sqrt{\frac{\mathsf{neg}\left(c\right)}{a}} \]
                                            8. lift-neg.f64N/A

                                              \[\leadsto -\sqrt{\frac{-c}{a}} \]
                                            9. lower-/.f6433.8

                                              \[\leadsto -\sqrt{\frac{-c}{a}} \]
                                          4. Applied rewrites33.8%

                                            \[\leadsto \color{blue}{-\sqrt{\frac{-c}{a}}} \]
                                          5. Taylor expanded in c around -inf

                                            \[\leadsto \sqrt{\frac{c}{a}} \cdot \color{blue}{\sqrt{-1}} \]
                                          6. Step-by-step derivation
                                            1. sqrt-unprodN/A

                                              \[\leadsto \sqrt{\frac{c}{a} \cdot -1} \]
                                            2. *-commutativeN/A

                                              \[\leadsto \sqrt{-1 \cdot \frac{c}{a}} \]
                                            3. mul-1-negN/A

                                              \[\leadsto \sqrt{\mathsf{neg}\left(\frac{c}{a}\right)} \]
                                            4. distribute-frac-negN/A

                                              \[\leadsto \sqrt{\frac{\mathsf{neg}\left(c\right)}{a}} \]
                                            5. lift-neg.f64N/A

                                              \[\leadsto \sqrt{\frac{-c}{a}} \]
                                            6. lift-/.f64N/A

                                              \[\leadsto \sqrt{\frac{-c}{a}} \]
                                            7. lift-sqrt.f6432.7

                                              \[\leadsto \sqrt{\frac{-c}{a}} \]
                                          7. Applied rewrites32.7%

                                            \[\leadsto \sqrt{\frac{-c}{a}} \]

                                          if -1.59999999999999991e-251 < b < 2.29999999999999998e-136

                                          1. Initial program 74.8%

                                            \[\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 rewrites74.8%

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

                                              \[\leadsto \color{blue}{-1 \cdot \left(\sqrt{\frac{c}{a}} \cdot \sqrt{-1}\right)} \]
                                            3. Step-by-step derivation
                                              1. mul-1-negN/A

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

                                                \[\leadsto -\sqrt{\frac{c}{a}} \cdot \sqrt{-1} \]
                                              3. sqrt-unprodN/A

                                                \[\leadsto -\sqrt{\frac{c}{a} \cdot -1} \]
                                              4. *-commutativeN/A

                                                \[\leadsto -\sqrt{-1 \cdot \frac{c}{a}} \]
                                              5. lower-sqrt.f64N/A

                                                \[\leadsto -\sqrt{-1 \cdot \frac{c}{a}} \]
                                              6. associate-*r/N/A

                                                \[\leadsto -\sqrt{\frac{-1 \cdot c}{a}} \]
                                              7. mul-1-negN/A

                                                \[\leadsto -\sqrt{\frac{\mathsf{neg}\left(c\right)}{a}} \]
                                              8. lift-neg.f64N/A

                                                \[\leadsto -\sqrt{\frac{-c}{a}} \]
                                              9. lower-/.f6435.1

                                                \[\leadsto -\sqrt{\frac{-c}{a}} \]
                                            4. Applied rewrites35.1%

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

                                            if 2.29999999999999998e-136 < b

                                            1. Initial program 22.3%

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

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

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

                                                \[\leadsto \frac{\mathsf{neg}\left(c\right)}{b} \]
                                              3. lower-/.f64N/A

                                                \[\leadsto \frac{\mathsf{neg}\left(c\right)}{\color{blue}{b}} \]
                                              4. lower-neg.f6480.7

                                                \[\leadsto \frac{-c}{b} \]
                                            4. Applied rewrites80.7%

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

                                          Alternative 10: 70.8% accurate, 1.2× speedup?

                                          \[\begin{array}{l} \\ \begin{array}{l} t_0 := \sqrt{\frac{-c}{a}}\\ \mathbf{if}\;b \leq -1.32 \cdot 10^{-139}:\\ \;\;\;\;\frac{-b}{a}\\ \mathbf{elif}\;b \leq -1.6 \cdot 10^{-251}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;b \leq 2.3 \cdot 10^{-136}:\\ \;\;\;\;-t\_0\\ \mathbf{else}:\\ \;\;\;\;\frac{-c}{b}\\ \end{array} \end{array} \]
                                          (FPCore (a b c)
                                           :precision binary64
                                           (let* ((t_0 (sqrt (/ (- c) a))))
                                             (if (<= b -1.32e-139)
                                               (/ (- b) a)
                                               (if (<= b -1.6e-251) t_0 (if (<= b 2.3e-136) (- t_0) (/ (- c) b))))))
                                          double code(double a, double b, double c) {
                                          	double t_0 = sqrt((-c / a));
                                          	double tmp;
                                          	if (b <= -1.32e-139) {
                                          		tmp = -b / a;
                                          	} else if (b <= -1.6e-251) {
                                          		tmp = t_0;
                                          	} else if (b <= 2.3e-136) {
                                          		tmp = -t_0;
                                          	} else {
                                          		tmp = -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) :: t_0
                                              real(8) :: tmp
                                              t_0 = sqrt((-c / a))
                                              if (b <= (-1.32d-139)) then
                                                  tmp = -b / a
                                              else if (b <= (-1.6d-251)) then
                                                  tmp = t_0
                                              else if (b <= 2.3d-136) then
                                                  tmp = -t_0
                                              else
                                                  tmp = -c / b
                                              end if
                                              code = tmp
                                          end function
                                          
                                          public static double code(double a, double b, double c) {
                                          	double t_0 = Math.sqrt((-c / a));
                                          	double tmp;
                                          	if (b <= -1.32e-139) {
                                          		tmp = -b / a;
                                          	} else if (b <= -1.6e-251) {
                                          		tmp = t_0;
                                          	} else if (b <= 2.3e-136) {
                                          		tmp = -t_0;
                                          	} else {
                                          		tmp = -c / b;
                                          	}
                                          	return tmp;
                                          }
                                          
                                          def code(a, b, c):
                                          	t_0 = math.sqrt((-c / a))
                                          	tmp = 0
                                          	if b <= -1.32e-139:
                                          		tmp = -b / a
                                          	elif b <= -1.6e-251:
                                          		tmp = t_0
                                          	elif b <= 2.3e-136:
                                          		tmp = -t_0
                                          	else:
                                          		tmp = -c / b
                                          	return tmp
                                          
                                          function code(a, b, c)
                                          	t_0 = sqrt(Float64(Float64(-c) / a))
                                          	tmp = 0.0
                                          	if (b <= -1.32e-139)
                                          		tmp = Float64(Float64(-b) / a);
                                          	elseif (b <= -1.6e-251)
                                          		tmp = t_0;
                                          	elseif (b <= 2.3e-136)
                                          		tmp = Float64(-t_0);
                                          	else
                                          		tmp = Float64(Float64(-c) / b);
                                          	end
                                          	return tmp
                                          end
                                          
                                          function tmp_2 = code(a, b, c)
                                          	t_0 = sqrt((-c / a));
                                          	tmp = 0.0;
                                          	if (b <= -1.32e-139)
                                          		tmp = -b / a;
                                          	elseif (b <= -1.6e-251)
                                          		tmp = t_0;
                                          	elseif (b <= 2.3e-136)
                                          		tmp = -t_0;
                                          	else
                                          		tmp = -c / b;
                                          	end
                                          	tmp_2 = tmp;
                                          end
                                          
                                          code[a_, b_, c_] := Block[{t$95$0 = N[Sqrt[N[((-c) / a), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[b, -1.32e-139], N[((-b) / a), $MachinePrecision], If[LessEqual[b, -1.6e-251], t$95$0, If[LessEqual[b, 2.3e-136], (-t$95$0), N[((-c) / b), $MachinePrecision]]]]]
                                          
                                          \begin{array}{l}
                                          
                                          \\
                                          \begin{array}{l}
                                          t_0 := \sqrt{\frac{-c}{a}}\\
                                          \mathbf{if}\;b \leq -1.32 \cdot 10^{-139}:\\
                                          \;\;\;\;\frac{-b}{a}\\
                                          
                                          \mathbf{elif}\;b \leq -1.6 \cdot 10^{-251}:\\
                                          \;\;\;\;t\_0\\
                                          
                                          \mathbf{elif}\;b \leq 2.3 \cdot 10^{-136}:\\
                                          \;\;\;\;-t\_0\\
                                          
                                          \mathbf{else}:\\
                                          \;\;\;\;\frac{-c}{b}\\
                                          
                                          
                                          \end{array}
                                          \end{array}
                                          
                                          Derivation
                                          1. Split input into 4 regimes
                                          2. if b < -1.31999999999999995e-139

                                            1. Initial program 72.5%

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

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

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

                                                \[\leadsto \frac{\mathsf{neg}\left(b\right)}{a} \]
                                              3. lift-neg.f64N/A

                                                \[\leadsto \frac{-b}{a} \]
                                              4. lower-/.f6479.0

                                                \[\leadsto \frac{-b}{\color{blue}{a}} \]
                                            4. Applied rewrites79.0%

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

                                            if -1.31999999999999995e-139 < b < -1.59999999999999991e-251

                                            1. Initial program 76.4%

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

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

                                                \[\leadsto \color{blue}{-1 \cdot \left(\sqrt{\frac{c}{a}} \cdot \sqrt{-1}\right)} \]
                                              3. Step-by-step derivation
                                                1. mul-1-negN/A

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

                                                  \[\leadsto -\sqrt{\frac{c}{a}} \cdot \sqrt{-1} \]
                                                3. sqrt-unprodN/A

                                                  \[\leadsto -\sqrt{\frac{c}{a} \cdot -1} \]
                                                4. *-commutativeN/A

                                                  \[\leadsto -\sqrt{-1 \cdot \frac{c}{a}} \]
                                                5. lower-sqrt.f64N/A

                                                  \[\leadsto -\sqrt{-1 \cdot \frac{c}{a}} \]
                                                6. associate-*r/N/A

                                                  \[\leadsto -\sqrt{\frac{-1 \cdot c}{a}} \]
                                                7. mul-1-negN/A

                                                  \[\leadsto -\sqrt{\frac{\mathsf{neg}\left(c\right)}{a}} \]
                                                8. lift-neg.f64N/A

                                                  \[\leadsto -\sqrt{\frac{-c}{a}} \]
                                                9. lower-/.f6433.8

                                                  \[\leadsto -\sqrt{\frac{-c}{a}} \]
                                              4. Applied rewrites33.8%

                                                \[\leadsto \color{blue}{-\sqrt{\frac{-c}{a}}} \]
                                              5. Taylor expanded in c around -inf

                                                \[\leadsto \sqrt{\frac{c}{a}} \cdot \color{blue}{\sqrt{-1}} \]
                                              6. Step-by-step derivation
                                                1. sqrt-unprodN/A

                                                  \[\leadsto \sqrt{\frac{c}{a} \cdot -1} \]
                                                2. *-commutativeN/A

                                                  \[\leadsto \sqrt{-1 \cdot \frac{c}{a}} \]
                                                3. mul-1-negN/A

                                                  \[\leadsto \sqrt{\mathsf{neg}\left(\frac{c}{a}\right)} \]
                                                4. distribute-frac-negN/A

                                                  \[\leadsto \sqrt{\frac{\mathsf{neg}\left(c\right)}{a}} \]
                                                5. lift-neg.f64N/A

                                                  \[\leadsto \sqrt{\frac{-c}{a}} \]
                                                6. lift-/.f64N/A

                                                  \[\leadsto \sqrt{\frac{-c}{a}} \]
                                                7. lift-sqrt.f6432.7

                                                  \[\leadsto \sqrt{\frac{-c}{a}} \]
                                              7. Applied rewrites32.7%

                                                \[\leadsto \sqrt{\frac{-c}{a}} \]

                                              if -1.59999999999999991e-251 < b < 2.29999999999999998e-136

                                              1. Initial program 74.8%

                                                \[\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 rewrites74.8%

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

                                                  \[\leadsto \color{blue}{-1 \cdot \left(\sqrt{\frac{c}{a}} \cdot \sqrt{-1}\right)} \]
                                                3. Step-by-step derivation
                                                  1. mul-1-negN/A

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

                                                    \[\leadsto -\sqrt{\frac{c}{a}} \cdot \sqrt{-1} \]
                                                  3. sqrt-unprodN/A

                                                    \[\leadsto -\sqrt{\frac{c}{a} \cdot -1} \]
                                                  4. *-commutativeN/A

                                                    \[\leadsto -\sqrt{-1 \cdot \frac{c}{a}} \]
                                                  5. lower-sqrt.f64N/A

                                                    \[\leadsto -\sqrt{-1 \cdot \frac{c}{a}} \]
                                                  6. associate-*r/N/A

                                                    \[\leadsto -\sqrt{\frac{-1 \cdot c}{a}} \]
                                                  7. mul-1-negN/A

                                                    \[\leadsto -\sqrt{\frac{\mathsf{neg}\left(c\right)}{a}} \]
                                                  8. lift-neg.f64N/A

                                                    \[\leadsto -\sqrt{\frac{-c}{a}} \]
                                                  9. lower-/.f6435.1

                                                    \[\leadsto -\sqrt{\frac{-c}{a}} \]
                                                4. Applied rewrites35.1%

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

                                                if 2.29999999999999998e-136 < b

                                                1. Initial program 22.3%

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

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

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

                                                    \[\leadsto \frac{\mathsf{neg}\left(c\right)}{b} \]
                                                  3. lower-/.f64N/A

                                                    \[\leadsto \frac{\mathsf{neg}\left(c\right)}{\color{blue}{b}} \]
                                                  4. lower-neg.f6480.7

                                                    \[\leadsto \frac{-c}{b} \]
                                                4. Applied rewrites80.7%

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

                                              Alternative 11: 70.7% accurate, 1.7× speedup?

                                              \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq -1.32 \cdot 10^{-139}:\\ \;\;\;\;\frac{-b}{a}\\ \mathbf{elif}\;b \leq 1.95 \cdot 10^{-123}:\\ \;\;\;\;\sqrt{\frac{-c}{a}}\\ \mathbf{else}:\\ \;\;\;\;\frac{-c}{b}\\ \end{array} \end{array} \]
                                              (FPCore (a b c)
                                               :precision binary64
                                               (if (<= b -1.32e-139)
                                                 (/ (- b) a)
                                                 (if (<= b 1.95e-123) (sqrt (/ (- c) a)) (/ (- c) b))))
                                              double code(double a, double b, double c) {
                                              	double tmp;
                                              	if (b <= -1.32e-139) {
                                              		tmp = -b / a;
                                              	} else if (b <= 1.95e-123) {
                                              		tmp = sqrt((-c / a));
                                              	} else {
                                              		tmp = -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 <= (-1.32d-139)) then
                                                      tmp = -b / a
                                                  else if (b <= 1.95d-123) then
                                                      tmp = sqrt((-c / a))
                                                  else
                                                      tmp = -c / b
                                                  end if
                                                  code = tmp
                                              end function
                                              
                                              public static double code(double a, double b, double c) {
                                              	double tmp;
                                              	if (b <= -1.32e-139) {
                                              		tmp = -b / a;
                                              	} else if (b <= 1.95e-123) {
                                              		tmp = Math.sqrt((-c / a));
                                              	} else {
                                              		tmp = -c / b;
                                              	}
                                              	return tmp;
                                              }
                                              
                                              def code(a, b, c):
                                              	tmp = 0
                                              	if b <= -1.32e-139:
                                              		tmp = -b / a
                                              	elif b <= 1.95e-123:
                                              		tmp = math.sqrt((-c / a))
                                              	else:
                                              		tmp = -c / b
                                              	return tmp
                                              
                                              function code(a, b, c)
                                              	tmp = 0.0
                                              	if (b <= -1.32e-139)
                                              		tmp = Float64(Float64(-b) / a);
                                              	elseif (b <= 1.95e-123)
                                              		tmp = sqrt(Float64(Float64(-c) / a));
                                              	else
                                              		tmp = Float64(Float64(-c) / b);
                                              	end
                                              	return tmp
                                              end
                                              
                                              function tmp_2 = code(a, b, c)
                                              	tmp = 0.0;
                                              	if (b <= -1.32e-139)
                                              		tmp = -b / a;
                                              	elseif (b <= 1.95e-123)
                                              		tmp = sqrt((-c / a));
                                              	else
                                              		tmp = -c / b;
                                              	end
                                              	tmp_2 = tmp;
                                              end
                                              
                                              code[a_, b_, c_] := If[LessEqual[b, -1.32e-139], N[((-b) / a), $MachinePrecision], If[LessEqual[b, 1.95e-123], N[Sqrt[N[((-c) / a), $MachinePrecision]], $MachinePrecision], N[((-c) / b), $MachinePrecision]]]
                                              
                                              \begin{array}{l}
                                              
                                              \\
                                              \begin{array}{l}
                                              \mathbf{if}\;b \leq -1.32 \cdot 10^{-139}:\\
                                              \;\;\;\;\frac{-b}{a}\\
                                              
                                              \mathbf{elif}\;b \leq 1.95 \cdot 10^{-123}:\\
                                              \;\;\;\;\sqrt{\frac{-c}{a}}\\
                                              
                                              \mathbf{else}:\\
                                              \;\;\;\;\frac{-c}{b}\\
                                              
                                              
                                              \end{array}
                                              \end{array}
                                              
                                              Derivation
                                              1. Split input into 3 regimes
                                              2. if b < -1.31999999999999995e-139

                                                1. Initial program 72.5%

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

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

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

                                                    \[\leadsto \frac{\mathsf{neg}\left(b\right)}{a} \]
                                                  3. lift-neg.f64N/A

                                                    \[\leadsto \frac{-b}{a} \]
                                                  4. lower-/.f6479.0

                                                    \[\leadsto \frac{-b}{\color{blue}{a}} \]
                                                4. Applied rewrites79.0%

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

                                                if -1.31999999999999995e-139 < b < 1.94999999999999988e-123

                                                1. Initial program 74.9%

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

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

                                                    \[\leadsto \color{blue}{-1 \cdot \left(\sqrt{\frac{c}{a}} \cdot \sqrt{-1}\right)} \]
                                                  3. Step-by-step derivation
                                                    1. mul-1-negN/A

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

                                                      \[\leadsto -\sqrt{\frac{c}{a}} \cdot \sqrt{-1} \]
                                                    3. sqrt-unprodN/A

                                                      \[\leadsto -\sqrt{\frac{c}{a} \cdot -1} \]
                                                    4. *-commutativeN/A

                                                      \[\leadsto -\sqrt{-1 \cdot \frac{c}{a}} \]
                                                    5. lower-sqrt.f64N/A

                                                      \[\leadsto -\sqrt{-1 \cdot \frac{c}{a}} \]
                                                    6. associate-*r/N/A

                                                      \[\leadsto -\sqrt{\frac{-1 \cdot c}{a}} \]
                                                    7. mul-1-negN/A

                                                      \[\leadsto -\sqrt{\frac{\mathsf{neg}\left(c\right)}{a}} \]
                                                    8. lift-neg.f64N/A

                                                      \[\leadsto -\sqrt{\frac{-c}{a}} \]
                                                    9. lower-/.f6434.4

                                                      \[\leadsto -\sqrt{\frac{-c}{a}} \]
                                                  4. Applied rewrites34.4%

                                                    \[\leadsto \color{blue}{-\sqrt{\frac{-c}{a}}} \]
                                                  5. Taylor expanded in c around -inf

                                                    \[\leadsto \sqrt{\frac{c}{a}} \cdot \color{blue}{\sqrt{-1}} \]
                                                  6. Step-by-step derivation
                                                    1. sqrt-unprodN/A

                                                      \[\leadsto \sqrt{\frac{c}{a} \cdot -1} \]
                                                    2. *-commutativeN/A

                                                      \[\leadsto \sqrt{-1 \cdot \frac{c}{a}} \]
                                                    3. mul-1-negN/A

                                                      \[\leadsto \sqrt{\mathsf{neg}\left(\frac{c}{a}\right)} \]
                                                    4. distribute-frac-negN/A

                                                      \[\leadsto \sqrt{\frac{\mathsf{neg}\left(c\right)}{a}} \]
                                                    5. lift-neg.f64N/A

                                                      \[\leadsto \sqrt{\frac{-c}{a}} \]
                                                    6. lift-/.f64N/A

                                                      \[\leadsto \sqrt{\frac{-c}{a}} \]
                                                    7. lift-sqrt.f6435.3

                                                      \[\leadsto \sqrt{\frac{-c}{a}} \]
                                                  7. Applied rewrites35.3%

                                                    \[\leadsto \sqrt{\frac{-c}{a}} \]

                                                  if 1.94999999999999988e-123 < b

                                                  1. Initial program 21.4%

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

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

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

                                                      \[\leadsto \frac{\mathsf{neg}\left(c\right)}{b} \]
                                                    3. lower-/.f64N/A

                                                      \[\leadsto \frac{\mathsf{neg}\left(c\right)}{\color{blue}{b}} \]
                                                    4. lower-neg.f6481.8

                                                      \[\leadsto \frac{-c}{b} \]
                                                  4. Applied rewrites81.8%

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

                                                Alternative 12: 66.3% accurate, 2.7× speedup?

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

                                                  1. Initial program 73.2%

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

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

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

                                                      \[\leadsto \frac{\mathsf{neg}\left(b\right)}{a} \]
                                                    3. lift-neg.f64N/A

                                                      \[\leadsto \frac{-b}{a} \]
                                                    4. lower-/.f6465.7

                                                      \[\leadsto \frac{-b}{\color{blue}{a}} \]
                                                  4. Applied rewrites65.7%

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

                                                  if -4.999999999999985e-310 < b

                                                  1. Initial program 33.0%

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

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

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

                                                      \[\leadsto \frac{\mathsf{neg}\left(c\right)}{b} \]
                                                    3. lower-/.f64N/A

                                                      \[\leadsto \frac{\mathsf{neg}\left(c\right)}{\color{blue}{b}} \]
                                                    4. lower-neg.f6466.8

                                                      \[\leadsto \frac{-c}{b} \]
                                                  4. Applied rewrites66.8%

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

                                                Alternative 13: 41.7% accurate, 2.7× speedup?

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

                                                  1. Initial program 71.9%

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

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

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

                                                      \[\leadsto \frac{\mathsf{neg}\left(b\right)}{a} \]
                                                    3. lift-neg.f64N/A

                                                      \[\leadsto \frac{-b}{a} \]
                                                    4. lower-/.f6450.2

                                                      \[\leadsto \frac{-b}{\color{blue}{a}} \]
                                                  4. Applied rewrites50.2%

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

                                                  if 1.6000000000000001e-55 < b

                                                  1. Initial program 17.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 rewrites17.1%

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

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

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

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

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

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

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

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

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

                                                        \[\leadsto \left(-b\right) \cdot \left(\frac{-c}{{b}^{2}} + \frac{1}{a}\right) \]
                                                      9. lower-/.f64N/A

                                                        \[\leadsto \left(-b\right) \cdot \left(\frac{-c}{{b}^{2}} + \frac{\color{blue}{1}}{a}\right) \]
                                                      10. pow2N/A

                                                        \[\leadsto \left(-b\right) \cdot \left(\frac{-c}{b \cdot b} + \frac{1}{a}\right) \]
                                                      11. lift-*.f64N/A

                                                        \[\leadsto \left(-b\right) \cdot \left(\frac{-c}{b \cdot b} + \frac{1}{a}\right) \]
                                                      12. lower-/.f642.5

                                                        \[\leadsto \left(-b\right) \cdot \left(\frac{-c}{b \cdot b} + \frac{1}{\color{blue}{a}}\right) \]
                                                    4. Applied rewrites2.5%

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

                                                      \[\leadsto \frac{c}{\color{blue}{b}} \]
                                                    6. Step-by-step derivation
                                                      1. lower-/.f6425.9

                                                        \[\leadsto \frac{c}{b} \]
                                                    7. Applied rewrites25.9%

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

                                                  Alternative 14: 11.1% accurate, 5.6× speedup?

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

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

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

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

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

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

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

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

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

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

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

                                                        \[\leadsto \left(-b\right) \cdot \left(\frac{-c}{{b}^{2}} + \frac{1}{a}\right) \]
                                                      9. lower-/.f64N/A

                                                        \[\leadsto \left(-b\right) \cdot \left(\frac{-c}{{b}^{2}} + \frac{\color{blue}{1}}{a}\right) \]
                                                      10. pow2N/A

                                                        \[\leadsto \left(-b\right) \cdot \left(\frac{-c}{b \cdot b} + \frac{1}{a}\right) \]
                                                      11. lift-*.f64N/A

                                                        \[\leadsto \left(-b\right) \cdot \left(\frac{-c}{b \cdot b} + \frac{1}{a}\right) \]
                                                      12. lower-/.f6432.6

                                                        \[\leadsto \left(-b\right) \cdot \left(\frac{-c}{b \cdot b} + \frac{1}{\color{blue}{a}}\right) \]
                                                    4. Applied rewrites32.6%

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

                                                      \[\leadsto \frac{c}{\color{blue}{b}} \]
                                                    6. Step-by-step derivation
                                                      1. lower-/.f6411.1

                                                        \[\leadsto \frac{c}{b} \]
                                                    7. Applied rewrites11.1%

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

                                                    Developer Target 1: 71.4% 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 2025093 
                                                    (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)))