The quadratic formula (r1)

Percentage Accurate: 52.4% → 85.4%
Time: 4.3s
Alternatives: 10
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 10 alternatives:

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

Initial Program: 52.4% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a} \end{array} \]
(FPCore (a b c)
 :precision binary64
 (/ (+ (- b) (sqrt (- (* b b) (* (* 4.0 a) c)))) (* 2.0 a)))
double code(double a, double b, double c) {
	return (-b + sqrt(((b * b) - ((4.0 * a) * c)))) / (2.0 * a);
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

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

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

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

Alternative 1: 85.4% accurate, 0.7× speedup?

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

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

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

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


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

    1. Initial program 41.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 rewrites41.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 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. lower-/.f64N/A

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

          \[\leadsto \left(-b\right) \cdot \left(\frac{-c}{{b}^{2}} + \frac{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.9

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

        \[\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.4

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

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

      if -1.6500000000000001e152 < b < 3.00000000000000002e-51

      1. Initial program 79.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 rewrites79.6%

          \[\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(-4 \cdot a, c, b \cdot b\right)} + \left(-b\right)}{\color{blue}{a + a}} \]
          2. lift-/.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        if 3.00000000000000002e-51 < b

        1. Initial program 16.9%

          \[\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.f6488.0

            \[\leadsto \frac{-c}{b} \]
        4. Applied rewrites88.0%

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

      Alternative 2: 85.4% accurate, 0.8× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq -1.65 \cdot 10^{+152}:\\ \;\;\;\;\frac{-b}{a} + \frac{c}{b}\\ \mathbf{elif}\;b \leq 3 \cdot 10^{-51}:\\ \;\;\;\;\frac{\sqrt{\mathsf{fma}\left(-4 \cdot a, c, b \cdot b\right)} + \left(-b\right)}{a + a}\\ \mathbf{else}:\\ \;\;\;\;\frac{-c}{b}\\ \end{array} \end{array} \]
      (FPCore (a b c)
       :precision binary64
       (if (<= b -1.65e+152)
         (+ (/ (- b) a) (/ c b))
         (if (<= b 3e-51)
           (/ (+ (sqrt (fma (* -4.0 a) c (* b b))) (- b)) (+ a a))
           (/ (- c) b))))
      double code(double a, double b, double c) {
      	double tmp;
      	if (b <= -1.65e+152) {
      		tmp = (-b / a) + (c / b);
      	} else if (b <= 3e-51) {
      		tmp = (sqrt(fma((-4.0 * a), c, (b * b))) + -b) / (a + a);
      	} else {
      		tmp = -c / b;
      	}
      	return tmp;
      }
      
      function code(a, b, c)
      	tmp = 0.0
      	if (b <= -1.65e+152)
      		tmp = Float64(Float64(Float64(-b) / a) + Float64(c / b));
      	elseif (b <= 3e-51)
      		tmp = Float64(Float64(sqrt(fma(Float64(-4.0 * a), c, Float64(b * b))) + Float64(-b)) / Float64(a + a));
      	else
      		tmp = Float64(Float64(-c) / b);
      	end
      	return tmp
      end
      
      code[a_, b_, c_] := If[LessEqual[b, -1.65e+152], N[(N[((-b) / a), $MachinePrecision] + N[(c / b), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 3e-51], N[(N[(N[Sqrt[N[(N[(-4.0 * a), $MachinePrecision] * c + N[(b * b), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] + (-b)), $MachinePrecision] / N[(a + a), $MachinePrecision]), $MachinePrecision], N[((-c) / b), $MachinePrecision]]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      \mathbf{if}\;b \leq -1.65 \cdot 10^{+152}:\\
      \;\;\;\;\frac{-b}{a} + \frac{c}{b}\\
      
      \mathbf{elif}\;b \leq 3 \cdot 10^{-51}:\\
      \;\;\;\;\frac{\sqrt{\mathsf{fma}\left(-4 \cdot a, c, b \cdot b\right)} + \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.6500000000000001e152

        1. Initial program 41.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 rewrites41.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 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. lower-/.f64N/A

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

              \[\leadsto \left(-b\right) \cdot \left(\frac{-c}{{b}^{2}} + \frac{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.9

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

            \[\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.4

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

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

          if -1.6500000000000001e152 < b < 3.00000000000000002e-51

          1. Initial program 79.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 rewrites79.6%

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

            if 3.00000000000000002e-51 < b

            1. Initial program 16.9%

              \[\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.f6488.0

                \[\leadsto \frac{-c}{b} \]
            4. Applied rewrites88.0%

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

          Alternative 3: 80.1% accurate, 0.9× speedup?

          \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq -1.26 \cdot 10^{-21}:\\ \;\;\;\;\frac{-b}{a} + \frac{c}{b}\\ \mathbf{elif}\;b \leq 3 \cdot 10^{-51}:\\ \;\;\;\;\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.26e-21)
             (+ (/ (- b) a) (/ c b))
             (if (<= b 3e-51)
               (/ (+ (sqrt (* (* a -4.0) c)) (- b)) (+ a a))
               (/ (- c) b))))
          double code(double a, double b, double c) {
          	double tmp;
          	if (b <= -1.26e-21) {
          		tmp = (-b / a) + (c / b);
          	} else if (b <= 3e-51) {
          		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.26d-21)) then
                  tmp = (-b / a) + (c / b)
              else if (b <= 3d-51) 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.26e-21) {
          		tmp = (-b / a) + (c / b);
          	} else if (b <= 3e-51) {
          		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.26e-21:
          		tmp = (-b / a) + (c / b)
          	elif b <= 3e-51:
          		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.26e-21)
          		tmp = Float64(Float64(Float64(-b) / a) + Float64(c / b));
          	elseif (b <= 3e-51)
          		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.26e-21)
          		tmp = (-b / a) + (c / b);
          	elseif (b <= 3e-51)
          		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.26e-21], N[(N[((-b) / a), $MachinePrecision] + N[(c / b), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 3e-51], 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.26 \cdot 10^{-21}:\\
          \;\;\;\;\frac{-b}{a} + \frac{c}{b}\\
          
          \mathbf{elif}\;b \leq 3 \cdot 10^{-51}:\\
          \;\;\;\;\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.26e-21

            1. Initial program 65.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 rewrites66.0%

                \[\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. lower-/.f64N/A

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

                  \[\leadsto \left(-b\right) \cdot \left(\frac{-c}{{b}^{2}} + \frac{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-/.f6489.6

                  \[\leadsto \left(-b\right) \cdot \left(\frac{-c}{b \cdot b} + \frac{1}{\color{blue}{a}}\right) \]
              4. Applied rewrites89.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-/.f6489.9

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

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

              if -1.26e-21 < b < 3.00000000000000002e-51

              1. Initial program 73.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 rewrites73.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 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-*.f6463.3

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

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

                if 3.00000000000000002e-51 < b

                1. Initial program 16.9%

                  \[\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.f6488.0

                    \[\leadsto \frac{-c}{b} \]
                4. Applied rewrites88.0%

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

              Alternative 4: 79.9% accurate, 1.1× speedup?

              \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq -1.4 \cdot 10^{-43}:\\ \;\;\;\;\frac{-b}{a} + \frac{c}{b}\\ \mathbf{elif}\;b \leq 3 \cdot 10^{-51}:\\ \;\;\;\;\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 -1.4e-43)
                 (+ (/ (- b) a) (/ c b))
                 (if (<= b 3e-51) (/ (sqrt (* (* a -4.0) c)) (+ a a)) (/ (- c) b))))
              double code(double a, double b, double c) {
              	double tmp;
              	if (b <= -1.4e-43) {
              		tmp = (-b / a) + (c / b);
              	} else if (b <= 3e-51) {
              		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 <= (-1.4d-43)) then
                      tmp = (-b / a) + (c / b)
                  else if (b <= 3d-51) 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 <= -1.4e-43) {
              		tmp = (-b / a) + (c / b);
              	} else if (b <= 3e-51) {
              		tmp = Math.sqrt(((a * -4.0) * c)) / (a + a);
              	} else {
              		tmp = -c / b;
              	}
              	return tmp;
              }
              
              def code(a, b, c):
              	tmp = 0
              	if b <= -1.4e-43:
              		tmp = (-b / a) + (c / b)
              	elif b <= 3e-51:
              		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 <= -1.4e-43)
              		tmp = Float64(Float64(Float64(-b) / a) + Float64(c / b));
              	elseif (b <= 3e-51)
              		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 <= -1.4e-43)
              		tmp = (-b / a) + (c / b);
              	elseif (b <= 3e-51)
              		tmp = sqrt(((a * -4.0) * c)) / (a + a);
              	else
              		tmp = -c / b;
              	end
              	tmp_2 = tmp;
              end
              
              code[a_, b_, c_] := If[LessEqual[b, -1.4e-43], N[(N[((-b) / a), $MachinePrecision] + N[(c / b), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 3e-51], 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 -1.4 \cdot 10^{-43}:\\
              \;\;\;\;\frac{-b}{a} + \frac{c}{b}\\
              
              \mathbf{elif}\;b \leq 3 \cdot 10^{-51}:\\
              \;\;\;\;\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 < -1.3999999999999999e-43

                1. Initial program 67.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 rewrites67.3%

                    \[\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. lower-/.f64N/A

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

                      \[\leadsto \left(-b\right) \cdot \left(\frac{-c}{{b}^{2}} + \frac{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-/.f6488.1

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

                    \[\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-/.f6488.4

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

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

                  if -1.3999999999999999e-43 < b < 3.00000000000000002e-51

                  1. Initial program 72.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 rewrites72.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 \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-*.f6463.0

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

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

                    if 3.00000000000000002e-51 < b

                    1. Initial program 16.9%

                      \[\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.f6488.0

                        \[\leadsto \frac{-c}{b} \]
                    4. Applied rewrites88.0%

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

                  Alternative 5: 70.8% accurate, 1.3× speedup?

                  \[\begin{array}{l} \\ \begin{array}{l} t_0 := \sqrt{\frac{-c}{a}}\\ \mathbf{if}\;b \leq -2.2 \cdot 10^{-50}:\\ \;\;\;\;\frac{-b}{a} + \frac{c}{b}\\ \mathbf{elif}\;b \leq -4.2 \cdot 10^{-234}:\\ \;\;\;\;-t\_0\\ \mathbf{elif}\;b \leq 1.1 \cdot 10^{-89}:\\ \;\;\;\;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 -2.2e-50)
                       (+ (/ (- b) a) (/ c b))
                       (if (<= b -4.2e-234) (- t_0) (if (<= b 1.1e-89) t_0 (/ (- c) b))))))
                  double code(double a, double b, double c) {
                  	double t_0 = sqrt((-c / a));
                  	double tmp;
                  	if (b <= -2.2e-50) {
                  		tmp = (-b / a) + (c / b);
                  	} else if (b <= -4.2e-234) {
                  		tmp = -t_0;
                  	} else if (b <= 1.1e-89) {
                  		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 <= (-2.2d-50)) then
                          tmp = (-b / a) + (c / b)
                      else if (b <= (-4.2d-234)) then
                          tmp = -t_0
                      else if (b <= 1.1d-89) 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 <= -2.2e-50) {
                  		tmp = (-b / a) + (c / b);
                  	} else if (b <= -4.2e-234) {
                  		tmp = -t_0;
                  	} else if (b <= 1.1e-89) {
                  		tmp = t_0;
                  	} else {
                  		tmp = -c / b;
                  	}
                  	return tmp;
                  }
                  
                  def code(a, b, c):
                  	t_0 = math.sqrt((-c / a))
                  	tmp = 0
                  	if b <= -2.2e-50:
                  		tmp = (-b / a) + (c / b)
                  	elif b <= -4.2e-234:
                  		tmp = -t_0
                  	elif b <= 1.1e-89:
                  		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 <= -2.2e-50)
                  		tmp = Float64(Float64(Float64(-b) / a) + Float64(c / b));
                  	elseif (b <= -4.2e-234)
                  		tmp = Float64(-t_0);
                  	elseif (b <= 1.1e-89)
                  		tmp = 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 <= -2.2e-50)
                  		tmp = (-b / a) + (c / b);
                  	elseif (b <= -4.2e-234)
                  		tmp = -t_0;
                  	elseif (b <= 1.1e-89)
                  		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, -2.2e-50], N[(N[((-b) / a), $MachinePrecision] + N[(c / b), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, -4.2e-234], (-t$95$0), If[LessEqual[b, 1.1e-89], t$95$0, N[((-c) / b), $MachinePrecision]]]]]
                  
                  \begin{array}{l}
                  
                  \\
                  \begin{array}{l}
                  t_0 := \sqrt{\frac{-c}{a}}\\
                  \mathbf{if}\;b \leq -2.2 \cdot 10^{-50}:\\
                  \;\;\;\;\frac{-b}{a} + \frac{c}{b}\\
                  
                  \mathbf{elif}\;b \leq -4.2 \cdot 10^{-234}:\\
                  \;\;\;\;-t\_0\\
                  
                  \mathbf{elif}\;b \leq 1.1 \cdot 10^{-89}:\\
                  \;\;\;\;t\_0\\
                  
                  \mathbf{else}:\\
                  \;\;\;\;\frac{-c}{b}\\
                  
                  
                  \end{array}
                  \end{array}
                  
                  Derivation
                  1. Split input into 4 regimes
                  2. if b < -2.1999999999999999e-50

                    1. Initial program 67.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 rewrites67.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. lower-/.f64N/A

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

                          \[\leadsto \left(-b\right) \cdot \left(\frac{-c}{{b}^{2}} + \frac{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-/.f6487.6

                          \[\leadsto \left(-b\right) \cdot \left(\frac{-c}{b \cdot b} + \frac{1}{\color{blue}{a}}\right) \]
                      4. Applied rewrites87.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-/.f6487.9

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

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

                      if -2.1999999999999999e-50 < b < -4.19999999999999982e-234

                      1. Initial program 82.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 rewrites82.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. sqrt-prodN/A

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

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

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

                            \[\leadsto \mathsf{neg}\left(\sqrt{\frac{c}{a} \cdot -1}\right) \]
                          6. lift-neg.f6426.7

                            \[\leadsto -\sqrt{\frac{c}{a} \cdot -1} \]
                          7. lift-*.f64N/A

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

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

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

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

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

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

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

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

                        if -4.19999999999999982e-234 < b < 1.10000000000000006e-89

                        1. Initial program 70.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                        if 1.10000000000000006e-89 < b

                        1. Initial program 19.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.f6484.7

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

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

                      Alternative 6: 70.2% accurate, 1.3× speedup?

                      \[\begin{array}{l} \\ \begin{array}{l} t_0 := \sqrt{\frac{-c}{a}}\\ \mathbf{if}\;b \leq -2.2 \cdot 10^{-50}:\\ \;\;\;\;\frac{-b}{a}\\ \mathbf{elif}\;b \leq -4.2 \cdot 10^{-234}:\\ \;\;\;\;-t\_0\\ \mathbf{elif}\;b \leq 1.1 \cdot 10^{-89}:\\ \;\;\;\;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 -2.2e-50)
                           (/ (- b) a)
                           (if (<= b -4.2e-234) (- t_0) (if (<= b 1.1e-89) t_0 (/ (- c) b))))))
                      double code(double a, double b, double c) {
                      	double t_0 = sqrt((-c / a));
                      	double tmp;
                      	if (b <= -2.2e-50) {
                      		tmp = -b / a;
                      	} else if (b <= -4.2e-234) {
                      		tmp = -t_0;
                      	} else if (b <= 1.1e-89) {
                      		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 <= (-2.2d-50)) then
                              tmp = -b / a
                          else if (b <= (-4.2d-234)) then
                              tmp = -t_0
                          else if (b <= 1.1d-89) 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 <= -2.2e-50) {
                      		tmp = -b / a;
                      	} else if (b <= -4.2e-234) {
                      		tmp = -t_0;
                      	} else if (b <= 1.1e-89) {
                      		tmp = t_0;
                      	} else {
                      		tmp = -c / b;
                      	}
                      	return tmp;
                      }
                      
                      def code(a, b, c):
                      	t_0 = math.sqrt((-c / a))
                      	tmp = 0
                      	if b <= -2.2e-50:
                      		tmp = -b / a
                      	elif b <= -4.2e-234:
                      		tmp = -t_0
                      	elif b <= 1.1e-89:
                      		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 <= -2.2e-50)
                      		tmp = Float64(Float64(-b) / a);
                      	elseif (b <= -4.2e-234)
                      		tmp = Float64(-t_0);
                      	elseif (b <= 1.1e-89)
                      		tmp = 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 <= -2.2e-50)
                      		tmp = -b / a;
                      	elseif (b <= -4.2e-234)
                      		tmp = -t_0;
                      	elseif (b <= 1.1e-89)
                      		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, -2.2e-50], N[((-b) / a), $MachinePrecision], If[LessEqual[b, -4.2e-234], (-t$95$0), If[LessEqual[b, 1.1e-89], t$95$0, N[((-c) / b), $MachinePrecision]]]]]
                      
                      \begin{array}{l}
                      
                      \\
                      \begin{array}{l}
                      t_0 := \sqrt{\frac{-c}{a}}\\
                      \mathbf{if}\;b \leq -2.2 \cdot 10^{-50}:\\
                      \;\;\;\;\frac{-b}{a}\\
                      
                      \mathbf{elif}\;b \leq -4.2 \cdot 10^{-234}:\\
                      \;\;\;\;-t\_0\\
                      
                      \mathbf{elif}\;b \leq 1.1 \cdot 10^{-89}:\\
                      \;\;\;\;t\_0\\
                      
                      \mathbf{else}:\\
                      \;\;\;\;\frac{-c}{b}\\
                      
                      
                      \end{array}
                      \end{array}
                      
                      Derivation
                      1. Split input into 4 regimes
                      2. if b < -2.1999999999999999e-50

                        1. Initial program 67.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-/.f6487.5

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

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

                        if -2.1999999999999999e-50 < b < -4.19999999999999982e-234

                        1. Initial program 82.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 rewrites82.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. sqrt-prodN/A

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

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

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

                              \[\leadsto \mathsf{neg}\left(\sqrt{\frac{c}{a} \cdot -1}\right) \]
                            6. lift-neg.f6426.7

                              \[\leadsto -\sqrt{\frac{c}{a} \cdot -1} \]
                            7. lift-*.f64N/A

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

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

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

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

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

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

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

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

                          if -4.19999999999999982e-234 < b < 1.10000000000000006e-89

                          1. Initial program 70.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                          if 1.10000000000000006e-89 < b

                          1. Initial program 19.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.f6484.7

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

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

                        Alternative 7: 70.1% accurate, 1.7× speedup?

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

                          1. Initial program 71.3%

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

                            \[\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-/.f6474.9

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

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

                          if -2.1e-212 < b < 1.10000000000000006e-89

                          1. Initial program 70.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                          if 1.10000000000000006e-89 < b

                          1. Initial program 19.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.f6484.7

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

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

                        Alternative 8: 66.8% accurate, 2.7× speedup?

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

                          1. Initial program 71.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-/.f6462.6

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

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

                          if 9.00000000000000035e-243 < b

                          1. Initial program 29.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.f6471.8

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

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

                        Alternative 9: 43.1% accurate, 2.7× speedup?

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

                          1. Initial program 67.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-/.f6448.5

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

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

                          if 5.6e14 < b

                          1. Initial program 13.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 rewrites13.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. lower-/.f64N/A

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

                                \[\leadsto \left(-b\right) \cdot \left(\frac{-c}{{b}^{2}} + \frac{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-/.f6429.8

                                \[\leadsto \frac{c}{b} \]
                            7. Applied rewrites29.8%

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

                          Alternative 10: 10.7% 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.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 rewrites52.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}{-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. lower-/.f64N/A

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

                                \[\leadsto \left(-b\right) \cdot \left(\frac{-c}{{b}^{2}} + \frac{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-/.f6434.5

                                \[\leadsto \left(-b\right) \cdot \left(\frac{-c}{b \cdot b} + \frac{1}{\color{blue}{a}}\right) \]
                            4. Applied rewrites34.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-/.f6410.7

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

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

                            Developer Target 1: 70.0% 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 2025101 
                            (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)))