The quadratic formula (r2)

Percentage Accurate: 51.2% → 86.5%
Time: 4.7s
Alternatives: 12
Speedup: 2.2×

Specification

?
\[\begin{array}{l} \\ \frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{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(4.0 * Float64(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[(4.0 * N[(a * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[(2.0 * a), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

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

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 12 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: 51.2% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{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(4.0 * Float64(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[(4.0 * N[(a * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[(2.0 * a), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

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

Alternative 1: 86.5% accurate, 0.6× speedup?

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

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

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

\mathbf{else}:\\
\;\;\;\;\frac{\left(-b\right) - \sqrt{1 - \left(a \cdot 4\right) \cdot \frac{\frac{c}{b}}{b}} \cdot \left|b\right|}{a + a}\\


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

    1. Initial program 51.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -9.19999999999999961e-15 < b < 4.40000000000000037e-53

    1. Initial program 51.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 4.40000000000000037e-53 < b

    1. Initial program 51.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\left(-b\right) - \sqrt{1 - \left(a \cdot 4\right) \cdot \color{blue}{\frac{c}{b \cdot b}}} \cdot \left|b\right|}{2 \cdot a} \]
      18. lower-fabs.f6451.4

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

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

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

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

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

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

        \[\leadsto \frac{\left(-b\right) - \sqrt{1 - \left(a \cdot 4\right) \cdot \frac{\color{blue}{\frac{c}{b}}}{b}} \cdot \left|b\right|}{2 \cdot a} \]
    5. Applied rewrites55.0%

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

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

        \[\leadsto \frac{\left(-b\right) - \sqrt{1 - \left(a \cdot 4\right) \cdot \frac{\frac{c}{b}}{b}} \cdot \left|b\right|}{\color{blue}{a + a}} \]
      3. lift-+.f6455.0

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

      \[\leadsto \frac{\left(-b\right) - \sqrt{1 - \left(a \cdot 4\right) \cdot \frac{\frac{c}{b}}{b}} \cdot \left|b\right|}{\color{blue}{a + a}} \]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 2: 86.5% accurate, 0.6× speedup?

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

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

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

\mathbf{else}:\\
\;\;\;\;\frac{\left(-b\right) - \sqrt{1 - \left(a \cdot 4\right) \cdot \frac{\frac{c}{b}}{b}} \cdot \left|b\right|}{a + a}\\


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

    1. Initial program 51.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -6.9999999999999997e-82 < b < 4.40000000000000037e-53

    1. Initial program 51.2%

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

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

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

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

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

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

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

    if 4.40000000000000037e-53 < b

    1. Initial program 51.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\left(-b\right) - \sqrt{1 - \left(a \cdot 4\right) \cdot \color{blue}{\frac{c}{b \cdot b}}} \cdot \left|b\right|}{2 \cdot a} \]
      18. lower-fabs.f6451.4

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

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

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

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

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

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

        \[\leadsto \frac{\left(-b\right) - \sqrt{1 - \left(a \cdot 4\right) \cdot \frac{\color{blue}{\frac{c}{b}}}{b}} \cdot \left|b\right|}{2 \cdot a} \]
    5. Applied rewrites55.0%

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

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

        \[\leadsto \frac{\left(-b\right) - \sqrt{1 - \left(a \cdot 4\right) \cdot \frac{\frac{c}{b}}{b}} \cdot \left|b\right|}{\color{blue}{a + a}} \]
      3. lift-+.f6455.0

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

      \[\leadsto \frac{\left(-b\right) - \sqrt{1 - \left(a \cdot 4\right) \cdot \frac{\frac{c}{b}}{b}} \cdot \left|b\right|}{\color{blue}{a + a}} \]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 3: 86.0% accurate, 0.6× speedup?

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

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

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

\mathbf{else}:\\
\;\;\;\;\frac{\left(-b\right) - \sqrt{1 - \left(a \cdot 4\right) \cdot \frac{\frac{c}{b}}{b}} \cdot \left|b\right|}{a + a}\\


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

    1. Initial program 51.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -6.9999999999999997e-82 < b < 4.40000000000000037e-53

    1. Initial program 51.2%

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

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

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

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

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

    if 4.40000000000000037e-53 < b

    1. Initial program 51.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\left(-b\right) - \sqrt{1 - \left(a \cdot 4\right) \cdot \color{blue}{\frac{c}{b \cdot b}}} \cdot \left|b\right|}{2 \cdot a} \]
      18. lower-fabs.f6451.4

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

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

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

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

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

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

        \[\leadsto \frac{\left(-b\right) - \sqrt{1 - \left(a \cdot 4\right) \cdot \frac{\color{blue}{\frac{c}{b}}}{b}} \cdot \left|b\right|}{2 \cdot a} \]
    5. Applied rewrites55.0%

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

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

        \[\leadsto \frac{\left(-b\right) - \sqrt{1 - \left(a \cdot 4\right) \cdot \frac{\frac{c}{b}}{b}} \cdot \left|b\right|}{\color{blue}{a + a}} \]
      3. lift-+.f6455.0

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

      \[\leadsto \frac{\left(-b\right) - \sqrt{1 - \left(a \cdot 4\right) \cdot \frac{\frac{c}{b}}{b}} \cdot \left|b\right|}{\color{blue}{a + a}} \]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 4: 86.0% accurate, 0.6× speedup?

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

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

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

\mathbf{else}:\\
\;\;\;\;\frac{\left(-b\right) - \sqrt{1 - \left(a \cdot 4\right) \cdot \frac{c}{b \cdot b}} \cdot \left|b\right|}{a + a}\\


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

    1. Initial program 51.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -6.9999999999999997e-82 < b < 4.40000000000000037e-53

    1. Initial program 51.2%

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

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

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

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

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

    if 4.40000000000000037e-53 < b

    1. Initial program 51.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\left(-b\right) - \sqrt{1 - \left(a \cdot 4\right) \cdot \color{blue}{\frac{c}{b \cdot b}}} \cdot \left|b\right|}{2 \cdot a} \]
      18. lower-fabs.f6451.4

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

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

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

        \[\leadsto \frac{\left(-b\right) - \sqrt{1 - \left(a \cdot 4\right) \cdot \frac{c}{b \cdot b}} \cdot \left|b\right|}{\color{blue}{a + a}} \]
      3. lift-+.f6451.4

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

      \[\leadsto \frac{\left(-b\right) - \sqrt{1 - \left(a \cdot 4\right) \cdot \frac{c}{b \cdot b}} \cdot \left|b\right|}{\color{blue}{a + a}} \]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 5: 85.5% accurate, 0.8× speedup?

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

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

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

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


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

    1. Initial program 51.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -6.9999999999999997e-82 < b < 2.4500000000000001e92

    1. Initial program 51.2%

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

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

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

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

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

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

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

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

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

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

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

    if 2.4500000000000001e92 < b

    1. Initial program 51.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 85.5% accurate, 0.8× speedup?

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

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

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

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


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

    1. Initial program 51.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -6.9999999999999997e-82 < b < 2.4500000000000001e92

    1. Initial program 51.2%

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

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

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

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

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

    if 2.4500000000000001e92 < b

    1. Initial program 51.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 80.3% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq -1.05 \cdot 10^{-115}:\\ \;\;\;\;-1 \cdot \frac{c}{b}\\ \mathbf{elif}\;b \leq 4.5 \cdot 10^{-53}:\\ \;\;\;\;\frac{0.5}{a} \cdot \left(\left(-b\right) - \sqrt{-4 \cdot \left(a \cdot c\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;-1 \cdot \frac{b}{a}\\ \end{array} \end{array} \]
(FPCore (a b c)
 :precision binary64
 (if (<= b -1.05e-115)
   (* -1.0 (/ c b))
   (if (<= b 4.5e-53)
     (* (/ 0.5 a) (- (- b) (sqrt (* -4.0 (* a c)))))
     (* -1.0 (/ b a)))))
double code(double a, double b, double c) {
	double tmp;
	if (b <= -1.05e-115) {
		tmp = -1.0 * (c / b);
	} else if (b <= 4.5e-53) {
		tmp = (0.5 / a) * (-b - sqrt((-4.0 * (a * c))));
	} else {
		tmp = -1.0 * (b / a);
	}
	return tmp;
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

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

real(8) function code(a, b, c)
use fmin_fmax_functions
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8) :: tmp
    if (b <= (-1.05d-115)) then
        tmp = (-1.0d0) * (c / b)
    else if (b <= 4.5d-53) then
        tmp = (0.5d0 / a) * (-b - sqrt(((-4.0d0) * (a * c))))
    else
        tmp = (-1.0d0) * (b / a)
    end if
    code = tmp
end function
public static double code(double a, double b, double c) {
	double tmp;
	if (b <= -1.05e-115) {
		tmp = -1.0 * (c / b);
	} else if (b <= 4.5e-53) {
		tmp = (0.5 / a) * (-b - Math.sqrt((-4.0 * (a * c))));
	} else {
		tmp = -1.0 * (b / a);
	}
	return tmp;
}
def code(a, b, c):
	tmp = 0
	if b <= -1.05e-115:
		tmp = -1.0 * (c / b)
	elif b <= 4.5e-53:
		tmp = (0.5 / a) * (-b - math.sqrt((-4.0 * (a * c))))
	else:
		tmp = -1.0 * (b / a)
	return tmp
function code(a, b, c)
	tmp = 0.0
	if (b <= -1.05e-115)
		tmp = Float64(-1.0 * Float64(c / b));
	elseif (b <= 4.5e-53)
		tmp = Float64(Float64(0.5 / a) * Float64(Float64(-b) - sqrt(Float64(-4.0 * Float64(a * c)))));
	else
		tmp = Float64(-1.0 * Float64(b / a));
	end
	return tmp
end
function tmp_2 = code(a, b, c)
	tmp = 0.0;
	if (b <= -1.05e-115)
		tmp = -1.0 * (c / b);
	elseif (b <= 4.5e-53)
		tmp = (0.5 / a) * (-b - sqrt((-4.0 * (a * c))));
	else
		tmp = -1.0 * (b / a);
	end
	tmp_2 = tmp;
end
code[a_, b_, c_] := If[LessEqual[b, -1.05e-115], N[(-1.0 * N[(c / b), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 4.5e-53], N[(N[(0.5 / a), $MachinePrecision] * N[((-b) - N[Sqrt[N[(-4.0 * N[(a * c), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-1.0 * N[(b / a), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

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

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

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


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

    1. Initial program 51.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.05000000000000001e-115 < b < 4.49999999999999985e-53

    1. Initial program 51.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 4.49999999999999985e-53 < b

    1. Initial program 51.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 79.8% accurate, 1.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq -1.05 \cdot 10^{-115}:\\ \;\;\;\;-1 \cdot \frac{c}{b}\\ \mathbf{elif}\;b \leq 4.5 \cdot 10^{-53}:\\ \;\;\;\;-0.5 \cdot \frac{\sqrt{-4 \cdot \left(a \cdot c\right)}}{a}\\ \mathbf{else}:\\ \;\;\;\;-1 \cdot \frac{b}{a}\\ \end{array} \end{array} \]
(FPCore (a b c)
 :precision binary64
 (if (<= b -1.05e-115)
   (* -1.0 (/ c b))
   (if (<= b 4.5e-53)
     (* -0.5 (/ (sqrt (* -4.0 (* a c))) a))
     (* -1.0 (/ b a)))))
double code(double a, double b, double c) {
	double tmp;
	if (b <= -1.05e-115) {
		tmp = -1.0 * (c / b);
	} else if (b <= 4.5e-53) {
		tmp = -0.5 * (sqrt((-4.0 * (a * c))) / a);
	} else {
		tmp = -1.0 * (b / a);
	}
	return tmp;
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

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

real(8) function code(a, b, c)
use fmin_fmax_functions
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8) :: tmp
    if (b <= (-1.05d-115)) then
        tmp = (-1.0d0) * (c / b)
    else if (b <= 4.5d-53) then
        tmp = (-0.5d0) * (sqrt(((-4.0d0) * (a * c))) / a)
    else
        tmp = (-1.0d0) * (b / a)
    end if
    code = tmp
end function
public static double code(double a, double b, double c) {
	double tmp;
	if (b <= -1.05e-115) {
		tmp = -1.0 * (c / b);
	} else if (b <= 4.5e-53) {
		tmp = -0.5 * (Math.sqrt((-4.0 * (a * c))) / a);
	} else {
		tmp = -1.0 * (b / a);
	}
	return tmp;
}
def code(a, b, c):
	tmp = 0
	if b <= -1.05e-115:
		tmp = -1.0 * (c / b)
	elif b <= 4.5e-53:
		tmp = -0.5 * (math.sqrt((-4.0 * (a * c))) / a)
	else:
		tmp = -1.0 * (b / a)
	return tmp
function code(a, b, c)
	tmp = 0.0
	if (b <= -1.05e-115)
		tmp = Float64(-1.0 * Float64(c / b));
	elseif (b <= 4.5e-53)
		tmp = Float64(-0.5 * Float64(sqrt(Float64(-4.0 * Float64(a * c))) / a));
	else
		tmp = Float64(-1.0 * Float64(b / a));
	end
	return tmp
end
function tmp_2 = code(a, b, c)
	tmp = 0.0;
	if (b <= -1.05e-115)
		tmp = -1.0 * (c / b);
	elseif (b <= 4.5e-53)
		tmp = -0.5 * (sqrt((-4.0 * (a * c))) / a);
	else
		tmp = -1.0 * (b / a);
	end
	tmp_2 = tmp;
end
code[a_, b_, c_] := If[LessEqual[b, -1.05e-115], N[(-1.0 * N[(c / b), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 4.5e-53], N[(-0.5 * N[(N[Sqrt[N[(-4.0 * N[(a * c), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], N[(-1.0 * N[(b / a), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

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

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

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


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

    1. Initial program 51.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.05000000000000001e-115 < b < 4.49999999999999985e-53

    1. Initial program 51.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 4.49999999999999985e-53 < b

    1. Initial program 51.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 71.4% accurate, 1.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq -8.3 \cdot 10^{-116}:\\ \;\;\;\;-1 \cdot \frac{c}{b}\\ \mathbf{elif}\;b \leq 3.1 \cdot 10^{-195}:\\ \;\;\;\;0.5 \cdot \sqrt{-4 \cdot \frac{c}{a}}\\ \mathbf{else}:\\ \;\;\;\;-1 \cdot \frac{b}{a}\\ \end{array} \end{array} \]
(FPCore (a b c)
 :precision binary64
 (if (<= b -8.3e-116)
   (* -1.0 (/ c b))
   (if (<= b 3.1e-195) (* 0.5 (sqrt (* -4.0 (/ c a)))) (* -1.0 (/ b a)))))
double code(double a, double b, double c) {
	double tmp;
	if (b <= -8.3e-116) {
		tmp = -1.0 * (c / b);
	} else if (b <= 3.1e-195) {
		tmp = 0.5 * sqrt((-4.0 * (c / a)));
	} else {
		tmp = -1.0 * (b / a);
	}
	return tmp;
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

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

real(8) function code(a, b, c)
use fmin_fmax_functions
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8) :: tmp
    if (b <= (-8.3d-116)) then
        tmp = (-1.0d0) * (c / b)
    else if (b <= 3.1d-195) then
        tmp = 0.5d0 * sqrt(((-4.0d0) * (c / a)))
    else
        tmp = (-1.0d0) * (b / a)
    end if
    code = tmp
end function
public static double code(double a, double b, double c) {
	double tmp;
	if (b <= -8.3e-116) {
		tmp = -1.0 * (c / b);
	} else if (b <= 3.1e-195) {
		tmp = 0.5 * Math.sqrt((-4.0 * (c / a)));
	} else {
		tmp = -1.0 * (b / a);
	}
	return tmp;
}
def code(a, b, c):
	tmp = 0
	if b <= -8.3e-116:
		tmp = -1.0 * (c / b)
	elif b <= 3.1e-195:
		tmp = 0.5 * math.sqrt((-4.0 * (c / a)))
	else:
		tmp = -1.0 * (b / a)
	return tmp
function code(a, b, c)
	tmp = 0.0
	if (b <= -8.3e-116)
		tmp = Float64(-1.0 * Float64(c / b));
	elseif (b <= 3.1e-195)
		tmp = Float64(0.5 * sqrt(Float64(-4.0 * Float64(c / a))));
	else
		tmp = Float64(-1.0 * Float64(b / a));
	end
	return tmp
end
function tmp_2 = code(a, b, c)
	tmp = 0.0;
	if (b <= -8.3e-116)
		tmp = -1.0 * (c / b);
	elseif (b <= 3.1e-195)
		tmp = 0.5 * sqrt((-4.0 * (c / a)));
	else
		tmp = -1.0 * (b / a);
	end
	tmp_2 = tmp;
end
code[a_, b_, c_] := If[LessEqual[b, -8.3e-116], N[(-1.0 * N[(c / b), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 3.1e-195], N[(0.5 * N[Sqrt[N[(-4.0 * N[(c / a), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(-1.0 * N[(b / a), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

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

\mathbf{elif}\;b \leq 3.1 \cdot 10^{-195}:\\
\;\;\;\;0.5 \cdot \sqrt{-4 \cdot \frac{c}{a}}\\

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


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

    1. Initial program 51.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -8.2999999999999997e-116 < b < 3.10000000000000002e-195

    1. Initial program 51.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.10000000000000002e-195 < b

    1. Initial program 51.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 71.3% accurate, 1.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq -1.25 \cdot 10^{-174}:\\ \;\;\;\;-1 \cdot \frac{c}{b}\\ \mathbf{elif}\;b \leq 7.6 \cdot 10^{-205}:\\ \;\;\;\;-0.5 \cdot \sqrt{-4 \cdot \frac{c}{a}}\\ \mathbf{else}:\\ \;\;\;\;-1 \cdot \frac{b}{a}\\ \end{array} \end{array} \]
(FPCore (a b c)
 :precision binary64
 (if (<= b -1.25e-174)
   (* -1.0 (/ c b))
   (if (<= b 7.6e-205) (* -0.5 (sqrt (* -4.0 (/ c a)))) (* -1.0 (/ b a)))))
double code(double a, double b, double c) {
	double tmp;
	if (b <= -1.25e-174) {
		tmp = -1.0 * (c / b);
	} else if (b <= 7.6e-205) {
		tmp = -0.5 * sqrt((-4.0 * (c / a)));
	} else {
		tmp = -1.0 * (b / a);
	}
	return tmp;
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

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

real(8) function code(a, b, c)
use fmin_fmax_functions
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8) :: tmp
    if (b <= (-1.25d-174)) then
        tmp = (-1.0d0) * (c / b)
    else if (b <= 7.6d-205) then
        tmp = (-0.5d0) * sqrt(((-4.0d0) * (c / a)))
    else
        tmp = (-1.0d0) * (b / a)
    end if
    code = tmp
end function
public static double code(double a, double b, double c) {
	double tmp;
	if (b <= -1.25e-174) {
		tmp = -1.0 * (c / b);
	} else if (b <= 7.6e-205) {
		tmp = -0.5 * Math.sqrt((-4.0 * (c / a)));
	} else {
		tmp = -1.0 * (b / a);
	}
	return tmp;
}
def code(a, b, c):
	tmp = 0
	if b <= -1.25e-174:
		tmp = -1.0 * (c / b)
	elif b <= 7.6e-205:
		tmp = -0.5 * math.sqrt((-4.0 * (c / a)))
	else:
		tmp = -1.0 * (b / a)
	return tmp
function code(a, b, c)
	tmp = 0.0
	if (b <= -1.25e-174)
		tmp = Float64(-1.0 * Float64(c / b));
	elseif (b <= 7.6e-205)
		tmp = Float64(-0.5 * sqrt(Float64(-4.0 * Float64(c / a))));
	else
		tmp = Float64(-1.0 * Float64(b / a));
	end
	return tmp
end
function tmp_2 = code(a, b, c)
	tmp = 0.0;
	if (b <= -1.25e-174)
		tmp = -1.0 * (c / b);
	elseif (b <= 7.6e-205)
		tmp = -0.5 * sqrt((-4.0 * (c / a)));
	else
		tmp = -1.0 * (b / a);
	end
	tmp_2 = tmp;
end
code[a_, b_, c_] := If[LessEqual[b, -1.25e-174], N[(-1.0 * N[(c / b), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 7.6e-205], N[(-0.5 * N[Sqrt[N[(-4.0 * N[(c / a), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(-1.0 * N[(b / a), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

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

\mathbf{elif}\;b \leq 7.6 \cdot 10^{-205}:\\
\;\;\;\;-0.5 \cdot \sqrt{-4 \cdot \frac{c}{a}}\\

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


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

    1. Initial program 51.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.2500000000000001e-174 < b < 7.59999999999999983e-205

    1. Initial program 51.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 7.59999999999999983e-205 < b

    1. Initial program 51.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 11: 66.9% accurate, 2.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq -5.5 \cdot 10^{-179}:\\ \;\;\;\;-1 \cdot \frac{c}{b}\\ \mathbf{else}:\\ \;\;\;\;-1 \cdot \frac{b}{a}\\ \end{array} \end{array} \]
(FPCore (a b c)
 :precision binary64
 (if (<= b -5.5e-179) (* -1.0 (/ c b)) (* -1.0 (/ b a))))
double code(double a, double b, double c) {
	double tmp;
	if (b <= -5.5e-179) {
		tmp = -1.0 * (c / b);
	} else {
		tmp = -1.0 * (b / a);
	}
	return tmp;
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

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

real(8) function code(a, b, c)
use fmin_fmax_functions
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8) :: tmp
    if (b <= (-5.5d-179)) then
        tmp = (-1.0d0) * (c / b)
    else
        tmp = (-1.0d0) * (b / a)
    end if
    code = tmp
end function
public static double code(double a, double b, double c) {
	double tmp;
	if (b <= -5.5e-179) {
		tmp = -1.0 * (c / b);
	} else {
		tmp = -1.0 * (b / a);
	}
	return tmp;
}
def code(a, b, c):
	tmp = 0
	if b <= -5.5e-179:
		tmp = -1.0 * (c / b)
	else:
		tmp = -1.0 * (b / a)
	return tmp
function code(a, b, c)
	tmp = 0.0
	if (b <= -5.5e-179)
		tmp = Float64(-1.0 * Float64(c / b));
	else
		tmp = Float64(-1.0 * Float64(b / a));
	end
	return tmp
end
function tmp_2 = code(a, b, c)
	tmp = 0.0;
	if (b <= -5.5e-179)
		tmp = -1.0 * (c / b);
	else
		tmp = -1.0 * (b / a);
	end
	tmp_2 = tmp;
end
code[a_, b_, c_] := If[LessEqual[b, -5.5e-179], N[(-1.0 * N[(c / b), $MachinePrecision]), $MachinePrecision], N[(-1.0 * N[(b / a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

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

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


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

    1. Initial program 51.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -5.5000000000000003e-179 < b

    1. Initial program 51.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 12: 34.4% accurate, 3.3× speedup?

\[\begin{array}{l} \\ -1 \cdot \frac{b}{a} \end{array} \]
(FPCore (a b c) :precision binary64 (* -1.0 (/ b a)))
double code(double a, double b, double c) {
	return -1.0 * (b / a);
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

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

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

\\
-1 \cdot \frac{b}{a}
\end{array}
Derivation
  1. Initial program 51.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Developer Target 1: 69.6% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}\\ \mathbf{if}\;b < 0:\\ \;\;\;\;\frac{c}{a \cdot \frac{\left(-b\right) + t\_0}{2 \cdot a}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(-b\right) - t\_0}{2 \cdot a}\\ \end{array} \end{array} \]
(FPCore (a b c)
 :precision binary64
 (let* ((t_0 (sqrt (- (* b b) (* 4.0 (* a c))))))
   (if (< b 0.0)
     (/ c (* a (/ (+ (- b) t_0) (* 2.0 a))))
     (/ (- (- b) t_0) (* 2.0 a)))))
double code(double a, double b, double c) {
	double t_0 = sqrt(((b * b) - (4.0 * (a * c))));
	double tmp;
	if (b < 0.0) {
		tmp = c / (a * ((-b + t_0) / (2.0 * a)));
	} else {
		tmp = (-b - t_0) / (2.0 * a);
	}
	return tmp;
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

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

real(8) function code(a, b, c)
use fmin_fmax_functions
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8) :: t_0
    real(8) :: tmp
    t_0 = sqrt(((b * b) - (4.0d0 * (a * c))))
    if (b < 0.0d0) then
        tmp = c / (a * ((-b + t_0) / (2.0d0 * a)))
    else
        tmp = (-b - t_0) / (2.0d0 * a)
    end if
    code = tmp
end function
public static double code(double a, double b, double c) {
	double t_0 = Math.sqrt(((b * b) - (4.0 * (a * c))));
	double tmp;
	if (b < 0.0) {
		tmp = c / (a * ((-b + t_0) / (2.0 * a)));
	} else {
		tmp = (-b - t_0) / (2.0 * a);
	}
	return tmp;
}
def code(a, b, c):
	t_0 = math.sqrt(((b * b) - (4.0 * (a * c))))
	tmp = 0
	if b < 0.0:
		tmp = c / (a * ((-b + t_0) / (2.0 * a)))
	else:
		tmp = (-b - t_0) / (2.0 * a)
	return tmp
function code(a, b, c)
	t_0 = sqrt(Float64(Float64(b * b) - Float64(4.0 * Float64(a * c))))
	tmp = 0.0
	if (b < 0.0)
		tmp = Float64(c / Float64(a * Float64(Float64(Float64(-b) + t_0) / Float64(2.0 * a))));
	else
		tmp = Float64(Float64(Float64(-b) - t_0) / Float64(2.0 * a));
	end
	return tmp
end
function tmp_2 = code(a, b, c)
	t_0 = sqrt(((b * b) - (4.0 * (a * c))));
	tmp = 0.0;
	if (b < 0.0)
		tmp = c / (a * ((-b + t_0) / (2.0 * a)));
	else
		tmp = (-b - t_0) / (2.0 * a);
	end
	tmp_2 = tmp;
end
code[a_, b_, c_] := Block[{t$95$0 = N[Sqrt[N[(N[(b * b), $MachinePrecision] - N[(4.0 * N[(a * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[Less[b, 0.0], N[(c / N[(a * N[(N[((-b) + t$95$0), $MachinePrecision] / N[(2.0 * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[((-b) - t$95$0), $MachinePrecision] / N[(2.0 * a), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}\\
\mathbf{if}\;b < 0:\\
\;\;\;\;\frac{c}{a \cdot \frac{\left(-b\right) + t\_0}{2 \cdot a}}\\

\mathbf{else}:\\
\;\;\;\;\frac{\left(-b\right) - t\_0}{2 \cdot a}\\


\end{array}
\end{array}

Reproduce

?
herbie shell --seed 2025140 
(FPCore (a b c)
  :name "The quadratic formula (r2)"
  :precision binary64

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

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