Quadratic roots, full range

Percentage Accurate: 52.5% → 85.6%
Time: 6.0s
Alternatives: 9
Speedup: 2.5×

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}

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

The average percentage accuracy by input value. Horizontal axis shows value of an input variable; the variable is choosen in the title. Vertical axis is accuracy; higher is better. Red represent the original program, while blue represents Herbie's suggestion. These can be toggled with buttons below the plot. The line is an average while dots represent individual samples.

Accuracy vs Speed?

Herbie found 9 alternatives:

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

Initial Program: 52.5% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a} \end{array} \]
(FPCore (a b c)
 :precision binary64
 (/ (+ (- b) (sqrt (- (* b b) (* (* 4.0 a) c)))) (* 2.0 a)))
double code(double a, double b, double c) {
	return (-b + sqrt(((b * b) - ((4.0 * a) * c)))) / (2.0 * a);
}
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.6% accurate, 0.9× speedup?

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

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

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

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


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

    1. Initial program 62.4%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{\color{blue}{\sqrt{\mathsf{fma}\left(-4 \cdot a, c, b \cdot b\right)} + \left(-b\right)}}{2 \cdot a} \]
    5. 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)} \]
    6. Step-by-step derivation
      1. Applied rewrites96.9%

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

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

          \[\leadsto \mathsf{fma}\left(\frac{b}{a}, \color{blue}{-1}, \frac{c}{b}\right) \]
        2. Step-by-step derivation
          1. Applied rewrites97.1%

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

          if -1.3499999999999999e69 < b < 4.89999999999999993e-67

          1. Initial program 73.3%

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

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

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

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

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

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

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

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

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

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

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

          if 4.89999999999999993e-67 < b

          1. Initial program 12.3%

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

            \[\leadsto \color{blue}{-1 \cdot \frac{c}{b}} \]
          4. Step-by-step derivation
            1. Applied rewrites92.1%

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

            \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -1.35 \cdot 10^{+69}:\\ \;\;\;\;\frac{-b}{a} + \frac{c}{b}\\ \mathbf{elif}\;b \leq 4.9 \cdot 10^{-67}:\\ \;\;\;\;\frac{\sqrt{\mathsf{fma}\left(-4 \cdot a, c, b \cdot b\right)} - b}{2 \cdot a}\\ \mathbf{else}:\\ \;\;\;\;\frac{c}{-b}\\ \end{array} \]
          7. Add Preprocessing

          Alternative 2: 81.3% accurate, 0.9× speedup?

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

            1. Initial program 69.7%

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \frac{\color{blue}{\sqrt{\mathsf{fma}\left(-4 \cdot a, c, b \cdot b\right)} + \left(-b\right)}}{2 \cdot a} \]
            5. 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)} \]
            6. Step-by-step derivation
              1. Applied rewrites88.9%

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

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

                  \[\leadsto \mathsf{fma}\left(\frac{b}{a}, \color{blue}{-1}, \frac{c}{b}\right) \]
                2. Step-by-step derivation
                  1. Applied rewrites89.1%

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

                  if -9.49999999999999917e-81 < b < 4.89999999999999993e-67

                  1. Initial program 67.7%

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

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

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

                    if 4.89999999999999993e-67 < b

                    1. Initial program 12.3%

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

                      \[\leadsto \color{blue}{-1 \cdot \frac{c}{b}} \]
                    4. Step-by-step derivation
                      1. Applied rewrites92.1%

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

                      \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -9.5 \cdot 10^{-81}:\\ \;\;\;\;\frac{-b}{a} + \frac{c}{b}\\ \mathbf{elif}\;b \leq 4.9 \cdot 10^{-67}:\\ \;\;\;\;\frac{\left(-b\right) + \sqrt{-4 \cdot \left(c \cdot a\right)}}{2 \cdot a}\\ \mathbf{else}:\\ \;\;\;\;\frac{c}{-b}\\ \end{array} \]
                    7. Add Preprocessing

                    Alternative 3: 80.9% accurate, 1.0× speedup?

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

                      1. Initial program 69.7%

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

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

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

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

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

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

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

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

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

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

                        \[\leadsto \frac{\color{blue}{\sqrt{\mathsf{fma}\left(-4 \cdot a, c, b \cdot b\right)} + \left(-b\right)}}{2 \cdot a} \]
                      5. 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)} \]
                      6. Step-by-step derivation
                        1. Applied rewrites88.9%

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

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

                            \[\leadsto \mathsf{fma}\left(\frac{b}{a}, \color{blue}{-1}, \frac{c}{b}\right) \]
                          2. Step-by-step derivation
                            1. Applied rewrites89.1%

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

                            if -9.49999999999999917e-81 < b < 4.89999999999999993e-67

                            1. Initial program 67.7%

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

                              \[\leadsto \frac{\color{blue}{\sqrt{a \cdot c} \cdot \sqrt{-4}}}{2 \cdot a} \]
                            4. Step-by-step derivation
                              1. Applied rewrites60.4%

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

                              if 4.89999999999999993e-67 < b

                              1. Initial program 12.3%

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

                                \[\leadsto \color{blue}{-1 \cdot \frac{c}{b}} \]
                              4. Step-by-step derivation
                                1. Applied rewrites92.1%

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

                                \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -9.5 \cdot 10^{-81}:\\ \;\;\;\;\frac{-b}{a} + \frac{c}{b}\\ \mathbf{elif}\;b \leq 4.9 \cdot 10^{-67}:\\ \;\;\;\;\frac{\sqrt{-4 \cdot \left(c \cdot a\right)}}{2 \cdot a}\\ \mathbf{else}:\\ \;\;\;\;\frac{c}{-b}\\ \end{array} \]
                              7. Add Preprocessing

                              Alternative 4: 74.0% accurate, 1.1× speedup?

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

                                1. Initial program 71.9%

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

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

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

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

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

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

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

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

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

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

                                  \[\leadsto \frac{\color{blue}{\sqrt{\mathsf{fma}\left(-4 \cdot a, c, b \cdot b\right)} + \left(-b\right)}}{2 \cdot a} \]
                                5. 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)} \]
                                6. Step-by-step derivation
                                  1. Applied rewrites83.6%

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

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

                                      \[\leadsto \mathsf{fma}\left(\frac{b}{a}, \color{blue}{-1}, \frac{c}{b}\right) \]
                                    2. Step-by-step derivation
                                      1. Applied rewrites83.8%

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

                                      if -1.95e-107 < b < 1.08000000000000003e-165

                                      1. Initial program 67.6%

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

                                        \[\leadsto \color{blue}{-1 \cdot \left(\sqrt{\frac{c}{a}} \cdot \sqrt{-1}\right)} \]
                                      4. Step-by-step derivation
                                        1. Applied rewrites30.9%

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

                                          \[\leadsto \sqrt{\frac{c}{a}} \cdot \color{blue}{\sqrt{-1}} \]
                                        3. Step-by-step derivation
                                          1. Applied rewrites43.7%

                                            \[\leadsto \sqrt{\frac{-c}{a}} \]
                                          2. Step-by-step derivation
                                            1. Applied rewrites50.0%

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

                                            if 1.08000000000000003e-165 < b

                                            1. Initial program 19.5%

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

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

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

                                              \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -1.95 \cdot 10^{-107}:\\ \;\;\;\;\frac{-b}{a} + \frac{c}{b}\\ \mathbf{elif}\;b \leq 1.08 \cdot 10^{-165}:\\ \;\;\;\;\frac{\sqrt{-c}}{\sqrt{a}}\\ \mathbf{else}:\\ \;\;\;\;\frac{c}{-b}\\ \end{array} \]
                                            7. Add Preprocessing

                                            Alternative 5: 71.7% accurate, 1.4× speedup?

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

                                              1. Initial program 71.9%

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

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

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

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

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

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

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

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

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

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

                                                \[\leadsto \frac{\color{blue}{\sqrt{\mathsf{fma}\left(-4 \cdot a, c, b \cdot b\right)} + \left(-b\right)}}{2 \cdot a} \]
                                              5. 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)} \]
                                              6. Step-by-step derivation
                                                1. Applied rewrites83.6%

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

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

                                                    \[\leadsto \mathsf{fma}\left(\frac{b}{a}, \color{blue}{-1}, \frac{c}{b}\right) \]
                                                  2. Step-by-step derivation
                                                    1. Applied rewrites83.8%

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

                                                    if -1.95e-107 < b < 9.1000000000000006e-203

                                                    1. Initial program 70.2%

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

                                                      \[\leadsto \color{blue}{-1 \cdot \left(\sqrt{\frac{c}{a}} \cdot \sqrt{-1}\right)} \]
                                                    4. Step-by-step derivation
                                                      1. Applied rewrites30.5%

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

                                                        \[\leadsto \sqrt{\frac{c}{a}} \cdot \color{blue}{\sqrt{-1}} \]
                                                      3. Step-by-step derivation
                                                        1. Applied rewrites47.2%

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

                                                        if 9.1000000000000006e-203 < b

                                                        1. Initial program 19.9%

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

                                                          \[\leadsto \color{blue}{-1 \cdot \frac{c}{b}} \]
                                                        4. Step-by-step derivation
                                                          1. Applied rewrites81.7%

                                                            \[\leadsto \color{blue}{\frac{-c}{b}} \]
                                                        5. Recombined 3 regimes into one program.
                                                        6. Final simplification77.8%

                                                          \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -1.95 \cdot 10^{-107}:\\ \;\;\;\;\frac{-b}{a} + \frac{c}{b}\\ \mathbf{elif}\;b \leq 9.1 \cdot 10^{-203}:\\ \;\;\;\;\sqrt{\frac{-c}{a}}\\ \mathbf{else}:\\ \;\;\;\;\frac{c}{-b}\\ \end{array} \]
                                                        7. Add Preprocessing

                                                        Alternative 6: 71.5% accurate, 1.4× speedup?

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

                                                          1. Initial program 71.9%

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

                                                            \[\leadsto \color{blue}{-1 \cdot \frac{b}{a}} \]
                                                          4. Step-by-step derivation
                                                            1. Applied rewrites83.2%

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

                                                            if -1.95e-107 < b < 9.1000000000000006e-203

                                                            1. Initial program 70.2%

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

                                                              \[\leadsto \color{blue}{-1 \cdot \left(\sqrt{\frac{c}{a}} \cdot \sqrt{-1}\right)} \]
                                                            4. Step-by-step derivation
                                                              1. Applied rewrites30.5%

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

                                                                \[\leadsto \sqrt{\frac{c}{a}} \cdot \color{blue}{\sqrt{-1}} \]
                                                              3. Step-by-step derivation
                                                                1. Applied rewrites47.2%

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

                                                                if 9.1000000000000006e-203 < b

                                                                1. Initial program 19.9%

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

                                                                  \[\leadsto \color{blue}{-1 \cdot \frac{c}{b}} \]
                                                                4. Step-by-step derivation
                                                                  1. Applied rewrites81.7%

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

                                                                  \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -1.95 \cdot 10^{-107}:\\ \;\;\;\;\frac{-b}{a}\\ \mathbf{elif}\;b \leq 9.1 \cdot 10^{-203}:\\ \;\;\;\;\sqrt{\frac{-c}{a}}\\ \mathbf{else}:\\ \;\;\;\;\frac{c}{-b}\\ \end{array} \]
                                                                7. Add Preprocessing

                                                                Alternative 7: 67.9% accurate, 2.5× speedup?

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

                                                                  1. Initial program 72.3%

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

                                                                    \[\leadsto \color{blue}{-1 \cdot \frac{b}{a}} \]
                                                                  4. Step-by-step derivation
                                                                    1. Applied rewrites69.7%

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

                                                                    if 9.9999999999999993e-273 < b

                                                                    1. Initial program 23.2%

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

                                                                      \[\leadsto \color{blue}{-1 \cdot \frac{c}{b}} \]
                                                                    4. Step-by-step derivation
                                                                      1. Applied rewrites75.5%

                                                                        \[\leadsto \color{blue}{\frac{-c}{b}} \]
                                                                    5. Recombined 2 regimes into one program.
                                                                    6. Final simplification72.5%

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

                                                                    Alternative 8: 43.5% accurate, 2.5× speedup?

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

                                                                      1. Initial program 65.7%

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

                                                                        \[\leadsto \color{blue}{-1 \cdot \frac{b}{a}} \]
                                                                      4. Step-by-step derivation
                                                                        1. Applied rewrites53.6%

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

                                                                        if 8.4999999999999997e-12 < b

                                                                        1. Initial program 12.2%

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

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

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

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

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

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

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

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

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

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

                                                                          \[\leadsto \frac{\color{blue}{\sqrt{\mathsf{fma}\left(-4 \cdot a, c, b \cdot b\right)} + \left(-b\right)}}{2 \cdot a} \]
                                                                        5. 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)} \]
                                                                        6. Step-by-step derivation
                                                                          1. Applied rewrites2.2%

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

                                                                            \[\leadsto \frac{c}{\color{blue}{b}} \]
                                                                          3. Step-by-step derivation
                                                                            1. Applied rewrites32.2%

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

                                                                          Alternative 9: 10.5% accurate, 4.2× 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 48.3%

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

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

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

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

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

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

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

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

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

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

                                                                            \[\leadsto \frac{\color{blue}{\sqrt{\mathsf{fma}\left(-4 \cdot a, c, b \cdot b\right)} + \left(-b\right)}}{2 \cdot a} \]
                                                                          5. 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)} \]
                                                                          6. Step-by-step derivation
                                                                            1. Applied rewrites36.3%

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

                                                                              \[\leadsto \frac{c}{\color{blue}{b}} \]
                                                                            3. Step-by-step derivation
                                                                              1. Applied rewrites12.6%

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

                                                                              Reproduce

                                                                              ?
                                                                              herbie shell --seed 2025026 
                                                                              (FPCore (a b c)
                                                                                :name "Quadratic roots, full range"
                                                                                :precision binary64
                                                                                (/ (+ (- b) (sqrt (- (* b b) (* (* 4.0 a) c)))) (* 2.0 a)))