Quadratic roots, full range

Percentage Accurate: 52.0% → 83.6%
Time: 6.8s
Alternatives: 7
Speedup: N/A×

Specification

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

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

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 7 alternatives:

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

Initial Program: 52.0% accurate, 1.0× speedup?

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

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

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

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

Alternative 1: 83.6% accurate, N/A× speedup?

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

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

\mathbf{elif}\;b \leq 125000000000:\\
\;\;\;\;-1 \cdot \frac{b}{2 \cdot a} + \frac{{\left(\mathsf{fma}\left(c \cdot -4, a, b \cdot b\right)\right)}^{0.5}}{2 \cdot a}\\

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


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

    1. Initial program 66.1%

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

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

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

        \[\leadsto \frac{b}{a} \cdot \color{blue}{-1} \]
      3. lower-/.f6497.0

        \[\leadsto \frac{b}{a} \cdot -1 \]
    5. Applied rewrites97.0%

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

    if -4.50000000000000024e77 < b < 1.25e11

    1. Initial program 72.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{-1 \cdot b}{2 \cdot a} + \frac{{\left(\mathsf{fma}\left(c \cdot -4, a, \color{blue}{b \cdot b}\right)\right)}^{0.5}}{2 \cdot a} \]
    6. Applied rewrites73.0%

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

    if 1.25e11 < b

    1. Initial program 13.9%

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

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

        \[\leadsto \frac{c}{b} \cdot \color{blue}{-1} \]
      2. lower-*.f64N/A

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

        \[\leadsto \frac{c}{b} \cdot -1 \]
    5. Applied rewrites87.6%

      \[\leadsto \color{blue}{\frac{c}{b} \cdot -1} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification82.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -4.5 \cdot 10^{+77}:\\ \;\;\;\;\frac{b}{a} \cdot -1\\ \mathbf{elif}\;b \leq 125000000000:\\ \;\;\;\;-1 \cdot \frac{b}{2 \cdot a} + \frac{{\left(\mathsf{fma}\left(c \cdot -4, a, b \cdot b\right)\right)}^{0.5}}{2 \cdot a}\\ \mathbf{else}:\\ \;\;\;\;\frac{c}{b} \cdot -1\\ \end{array} \]
  5. Add Preprocessing

Alternative 2: 82.9% accurate, N/A× speedup?

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

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

\mathbf{elif}\;b \leq 1.7 \cdot 10^{-48}:\\
\;\;\;\;-1 \cdot \frac{b}{2 \cdot a} + \frac{e^{\log \left(\mathsf{fma}\left(c \cdot -4, a, b \cdot b\right)\right) \cdot 0.5}}{2 \cdot a}\\

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


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

    1. Initial program 66.1%

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

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

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

        \[\leadsto \frac{b}{a} \cdot \color{blue}{-1} \]
      3. lower-/.f6497.0

        \[\leadsto \frac{b}{a} \cdot -1 \]
    5. Applied rewrites97.0%

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

    if -3.99999999999999993e77 < b < 1.70000000000000014e-48

    1. Initial program 75.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{-1 \cdot b}{2 \cdot a} + \frac{{\left(\mathsf{fma}\left(c \cdot -4, a, \color{blue}{b \cdot b}\right)\right)}^{0.5}}{2 \cdot a} \]
    6. Applied rewrites75.2%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{-1 \cdot b}{2 \cdot a} + \frac{e^{\log \left(\mathsf{fma}\left(\color{blue}{c \cdot -4}, a, b \cdot b\right)\right) \cdot \frac{1}{2}}}{2 \cdot a} \]
      11. lift-*.f6471.0

        \[\leadsto \frac{-1 \cdot b}{2 \cdot a} + \frac{e^{\log \left(\mathsf{fma}\left(c \cdot -4, a, \color{blue}{b \cdot b}\right)\right) \cdot 0.5}}{2 \cdot a} \]
    8. Applied rewrites71.0%

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

    if 1.70000000000000014e-48 < b

    1. Initial program 20.2%

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

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

        \[\leadsto \frac{c}{b} \cdot \color{blue}{-1} \]
      2. lower-*.f64N/A

        \[\leadsto \frac{c}{b} \cdot \color{blue}{-1} \]
      3. lower-/.f6480.9

        \[\leadsto \frac{c}{b} \cdot -1 \]
    5. Applied rewrites80.9%

      \[\leadsto \color{blue}{\frac{c}{b} \cdot -1} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification80.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -4 \cdot 10^{+77}:\\ \;\;\;\;\frac{b}{a} \cdot -1\\ \mathbf{elif}\;b \leq 1.7 \cdot 10^{-48}:\\ \;\;\;\;-1 \cdot \frac{b}{2 \cdot a} + \frac{e^{\log \left(\mathsf{fma}\left(c \cdot -4, a, b \cdot b\right)\right) \cdot 0.5}}{2 \cdot a}\\ \mathbf{else}:\\ \;\;\;\;\frac{c}{b} \cdot -1\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 82.9% accurate, N/A× speedup?

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

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

\mathbf{elif}\;b \leq 1.7 \cdot 10^{-48}:\\
\;\;\;\;-1 \cdot \frac{b}{2 \cdot a} + \frac{e^{\log \left(\mathsf{fma}\left(b, b, \left(-4 \cdot a\right) \cdot c\right)\right) \cdot 0.5}}{2 \cdot a}\\

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


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

    1. Initial program 66.1%

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

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

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

        \[\leadsto \frac{b}{a} \cdot \color{blue}{-1} \]
      3. lower-/.f6497.0

        \[\leadsto \frac{b}{a} \cdot -1 \]
    5. Applied rewrites97.0%

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

    if -3.99999999999999993e77 < b < 1.70000000000000014e-48

    1. Initial program 75.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{-1 \cdot b}{2 \cdot a} + \frac{e^{\color{blue}{\log \left({b}^{1} \cdot {b}^{1} + -4 \cdot \left(c \cdot a\right)\right) \cdot \frac{1}{2}}}}{2 \cdot a} \]
    6. Applied rewrites71.0%

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

    if 1.70000000000000014e-48 < b

    1. Initial program 20.2%

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

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

        \[\leadsto \frac{c}{b} \cdot \color{blue}{-1} \]
      2. lower-*.f64N/A

        \[\leadsto \frac{c}{b} \cdot \color{blue}{-1} \]
      3. lower-/.f6480.9

        \[\leadsto \frac{c}{b} \cdot -1 \]
    5. Applied rewrites80.9%

      \[\leadsto \color{blue}{\frac{c}{b} \cdot -1} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification80.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -4 \cdot 10^{+77}:\\ \;\;\;\;\frac{b}{a} \cdot -1\\ \mathbf{elif}\;b \leq 1.7 \cdot 10^{-48}:\\ \;\;\;\;-1 \cdot \frac{b}{2 \cdot a} + \frac{e^{\log \left(\mathsf{fma}\left(b, b, \left(-4 \cdot a\right) \cdot c\right)\right) \cdot 0.5}}{2 \cdot a}\\ \mathbf{else}:\\ \;\;\;\;\frac{c}{b} \cdot -1\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 71.9% accurate, N/A× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq -1.04 \cdot 10^{-110}:\\ \;\;\;\;\mathsf{fma}\left(\frac{c}{b}, -1, \frac{b}{a}\right) \cdot -1\\ \mathbf{elif}\;b \leq 6 \cdot 10^{-64}:\\ \;\;\;\;-1 \cdot \frac{b}{2 \cdot a} + \frac{e^{\left(\left(\log 4 + \log a\right) + \log \left({\left(\frac{-1}{c}\right)}^{-1}\right)\right) \cdot 0.5}}{2 \cdot a}\\ \mathbf{else}:\\ \;\;\;\;\frac{c}{b} \cdot -1\\ \end{array} \end{array} \]
(FPCore (a b c)
 :precision binary64
 (if (<= b -1.04e-110)
   (* (fma (/ c b) -1.0 (/ b a)) -1.0)
   (if (<= b 6e-64)
     (+
      (* -1.0 (/ b (* 2.0 a)))
      (/
       (exp (* (+ (+ (log 4.0) (log a)) (log (pow (/ -1.0 c) -1.0))) 0.5))
       (* 2.0 a)))
     (* (/ c b) -1.0))))
double code(double a, double b, double c) {
	double tmp;
	if (b <= -1.04e-110) {
		tmp = fma((c / b), -1.0, (b / a)) * -1.0;
	} else if (b <= 6e-64) {
		tmp = (-1.0 * (b / (2.0 * a))) + (exp((((log(4.0) + log(a)) + log(pow((-1.0 / c), -1.0))) * 0.5)) / (2.0 * a));
	} else {
		tmp = (c / b) * -1.0;
	}
	return tmp;
}
function code(a, b, c)
	tmp = 0.0
	if (b <= -1.04e-110)
		tmp = Float64(fma(Float64(c / b), -1.0, Float64(b / a)) * -1.0);
	elseif (b <= 6e-64)
		tmp = Float64(Float64(-1.0 * Float64(b / Float64(2.0 * a))) + Float64(exp(Float64(Float64(Float64(log(4.0) + log(a)) + log((Float64(-1.0 / c) ^ -1.0))) * 0.5)) / Float64(2.0 * a)));
	else
		tmp = Float64(Float64(c / b) * -1.0);
	end
	return tmp
end
code[a_, b_, c_] := If[LessEqual[b, -1.04e-110], N[(N[(N[(c / b), $MachinePrecision] * -1.0 + N[(b / a), $MachinePrecision]), $MachinePrecision] * -1.0), $MachinePrecision], If[LessEqual[b, 6e-64], N[(N[(-1.0 * N[(b / N[(2.0 * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Exp[N[(N[(N[(N[Log[4.0], $MachinePrecision] + N[Log[a], $MachinePrecision]), $MachinePrecision] + N[Log[N[Power[N[(-1.0 / c), $MachinePrecision], -1.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * 0.5), $MachinePrecision]], $MachinePrecision] / N[(2.0 * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(c / b), $MachinePrecision] * -1.0), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;b \leq -1.04 \cdot 10^{-110}:\\
\;\;\;\;\mathsf{fma}\left(\frac{c}{b}, -1, \frac{b}{a}\right) \cdot -1\\

\mathbf{elif}\;b \leq 6 \cdot 10^{-64}:\\
\;\;\;\;-1 \cdot \frac{b}{2 \cdot a} + \frac{e^{\left(\left(\log 4 + \log a\right) + \log \left({\left(\frac{-1}{c}\right)}^{-1}\right)\right) \cdot 0.5}}{2 \cdot a}\\

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


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

    1. Initial program 77.4%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\mathsf{fma}\left(\frac{c}{b \cdot b}, -1, {a}^{-1}\right) \cdot b\right) \cdot -1 \]
      11. lower-pow.f6485.6

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

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

      \[\leadsto \left(-1 \cdot \frac{c}{b} + \frac{b}{a}\right) \cdot -1 \]
    7. Step-by-step derivation
      1. *-commutativeN/A

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

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

        \[\leadsto \mathsf{fma}\left(\frac{c}{b}, -1, \frac{b}{a}\right) \cdot -1 \]
      4. lift-/.f6485.9

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

      \[\leadsto \mathsf{fma}\left(\frac{c}{b}, -1, \frac{b}{a}\right) \cdot -1 \]

    if -1.03999999999999993e-110 < b < 6.0000000000000001e-64

    1. Initial program 65.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{-1 \cdot b}{2 \cdot a} + \frac{e^{\log \left(\mathsf{fma}\left(\color{blue}{c \cdot -4}, a, b \cdot b\right)\right) \cdot \frac{1}{2}}}{2 \cdot a} \]
      11. lift-*.f6461.4

        \[\leadsto \frac{-1 \cdot b}{2 \cdot a} + \frac{e^{\log \left(\mathsf{fma}\left(c \cdot -4, a, \color{blue}{b \cdot b}\right)\right) \cdot 0.5}}{2 \cdot a} \]
    8. Applied rewrites61.4%

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

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

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

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

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

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

        \[\leadsto \frac{-1 \cdot b}{2 \cdot a} + \frac{e^{\left(\left(\log 4 + \log a\right) + -1 \cdot \log \left(\frac{-1}{c}\right)\right) \cdot \frac{1}{2}}}{2 \cdot a} \]
      6. log-pow-revN/A

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

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

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

        \[\leadsto \frac{-1 \cdot b}{2 \cdot a} + \frac{e^{\left(\left(\log 4 + \log a\right) + \log \left({\left(\frac{-1}{c}\right)}^{-1}\right)\right) \cdot 0.5}}{2 \cdot a} \]
    11. Applied rewrites46.2%

      \[\leadsto \frac{-1 \cdot b}{2 \cdot a} + \frac{e^{\color{blue}{\left(\left(\log 4 + \log a\right) + \log \left({\left(\frac{-1}{c}\right)}^{-1}\right)\right)} \cdot 0.5}}{2 \cdot a} \]

    if 6.0000000000000001e-64 < b

    1. Initial program 23.8%

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

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

        \[\leadsto \frac{c}{b} \cdot \color{blue}{-1} \]
      2. lower-*.f64N/A

        \[\leadsto \frac{c}{b} \cdot \color{blue}{-1} \]
      3. lower-/.f6477.8

        \[\leadsto \frac{c}{b} \cdot -1 \]
    5. Applied rewrites77.8%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -1.04 \cdot 10^{-110}:\\ \;\;\;\;\mathsf{fma}\left(\frac{c}{b}, -1, \frac{b}{a}\right) \cdot -1\\ \mathbf{elif}\;b \leq 6 \cdot 10^{-64}:\\ \;\;\;\;-1 \cdot \frac{b}{2 \cdot a} + \frac{e^{\left(\left(\log 4 + \log a\right) + \log \left({\left(\frac{-1}{c}\right)}^{-1}\right)\right) \cdot 0.5}}{2 \cdot a}\\ \mathbf{else}:\\ \;\;\;\;\frac{c}{b} \cdot -1\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 67.3% accurate, N/A× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq -5 \cdot 10^{-310}:\\
\;\;\;\;\mathsf{fma}\left(\frac{c}{b}, -1, \frac{b}{a}\right) \cdot -1\\

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


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

    1. Initial program 74.4%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\mathsf{fma}\left(\frac{c}{b \cdot b}, -1, {a}^{-1}\right) \cdot b\right) \cdot -1 \]
      11. lower-pow.f6466.4

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

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

      \[\leadsto \left(-1 \cdot \frac{c}{b} + \frac{b}{a}\right) \cdot -1 \]
    7. Step-by-step derivation
      1. *-commutativeN/A

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

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

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

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

      \[\leadsto \mathsf{fma}\left(\frac{c}{b}, -1, \frac{b}{a}\right) \cdot -1 \]

    if -4.999999999999985e-310 < b

    1. Initial program 39.1%

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

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

        \[\leadsto \frac{c}{b} \cdot \color{blue}{-1} \]
      2. lower-*.f64N/A

        \[\leadsto \frac{c}{b} \cdot \color{blue}{-1} \]
      3. lower-/.f6456.0

        \[\leadsto \frac{c}{b} \cdot -1 \]
    5. Applied rewrites56.0%

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

Alternative 6: 67.2% accurate, N/A× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq -5 \cdot 10^{-310}:\\
\;\;\;\;\mathsf{fma}\left(\frac{c}{b}, -1, \frac{b}{a}\right) \cdot -1\\

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


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

    1. Initial program 74.4%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\mathsf{fma}\left(\frac{c}{b \cdot b}, -1, {a}^{-1}\right) \cdot b\right) \cdot -1 \]
      11. lower-pow.f6466.4

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

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

      \[\leadsto \left(-1 \cdot \frac{c}{b} + \frac{b}{a}\right) \cdot -1 \]
    7. Step-by-step derivation
      1. *-commutativeN/A

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

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

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

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

      \[\leadsto \mathsf{fma}\left(\frac{c}{b}, -1, \frac{b}{a}\right) \cdot -1 \]

    if -4.999999999999985e-310 < b

    1. Initial program 39.1%

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

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

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

        \[\leadsto \left(c \cdot \left(-2 \cdot \frac{{a}^{2} \cdot c}{{b}^{5}} + -1 \cdot \frac{a}{{b}^{3}}\right) - \frac{1}{b}\right) \cdot \color{blue}{c} \]
    5. Applied rewrites41.8%

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

      \[\leadsto \frac{-1}{b} \cdot c \]
    7. Step-by-step derivation
      1. frac-2negN/A

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

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

        \[\leadsto \frac{1}{\mathsf{neg}\left(b\right)} \cdot c \]
      4. lower-neg.f6455.9

        \[\leadsto \frac{1}{-b} \cdot c \]
    8. Applied rewrites55.9%

      \[\leadsto \frac{1}{-b} \cdot c \]
  3. Recombined 2 regimes into one program.
  4. Final simplification62.5%

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -5 \cdot 10^{-310}:\\ \;\;\;\;\mathsf{fma}\left(\frac{c}{b}, -1, \frac{b}{a}\right) \cdot -1\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{-1 \cdot b} \cdot c\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 33.9% accurate, N/A× speedup?

\[\begin{array}{l} \\ \mathsf{fma}\left(\frac{c}{b}, -1, \frac{b}{a}\right) \cdot -1 \end{array} \]
(FPCore (a b c) :precision binary64 (* (fma (/ c b) -1.0 (/ b a)) -1.0))
double code(double a, double b, double c) {
	return fma((c / b), -1.0, (b / a)) * -1.0;
}
function code(a, b, c)
	return Float64(fma(Float64(c / b), -1.0, Float64(b / a)) * -1.0)
end
code[a_, b_, c_] := N[(N[(N[(c / b), $MachinePrecision] * -1.0 + N[(b / a), $MachinePrecision]), $MachinePrecision] * -1.0), $MachinePrecision]
\begin{array}{l}

\\
\mathsf{fma}\left(\frac{c}{b}, -1, \frac{b}{a}\right) \cdot -1
\end{array}
Derivation
  1. Initial program 58.1%

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \left(\mathsf{fma}\left(\frac{c}{b \cdot b}, -1, {a}^{-1}\right) \cdot b\right) \cdot -1 \]
    11. lower-pow.f6436.6

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

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

    \[\leadsto \left(-1 \cdot \frac{c}{b} + \frac{b}{a}\right) \cdot -1 \]
  7. Step-by-step derivation
    1. *-commutativeN/A

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

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

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

      \[\leadsto \mathsf{fma}\left(\frac{c}{b}, -1, \frac{b}{a}\right) \cdot -1 \]
  8. Applied rewrites37.6%

    \[\leadsto \mathsf{fma}\left(\frac{c}{b}, -1, \frac{b}{a}\right) \cdot -1 \]
  9. Add Preprocessing

Reproduce

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