Cubic critical

Percentage Accurate: 52.9% → 89.9%
Time: 4.8s
Alternatives: 15
Speedup: 2.2×

Specification

?
\[\begin{array}{l} \\ \frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a} \end{array} \]
(FPCore (a b c)
 :precision binary64
 (/ (+ (- b) (sqrt (- (* b b) (* (* 3.0 a) c)))) (* 3.0 a)))
double code(double a, double b, double c) {
	return (-b + sqrt(((b * b) - ((3.0 * a) * c)))) / (3.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) - ((3.0d0 * a) * c)))) / (3.0d0 * a)
end function
public static double code(double a, double b, double c) {
	return (-b + Math.sqrt(((b * b) - ((3.0 * a) * c)))) / (3.0 * a);
}
def code(a, b, c):
	return (-b + math.sqrt(((b * b) - ((3.0 * a) * c)))) / (3.0 * a)
function code(a, b, c)
	return Float64(Float64(Float64(-b) + sqrt(Float64(Float64(b * b) - Float64(Float64(3.0 * a) * c)))) / Float64(3.0 * a))
end
function tmp = code(a, b, c)
	tmp = (-b + sqrt(((b * b) - ((3.0 * a) * c)))) / (3.0 * a);
end
code[a_, b_, c_] := N[(N[((-b) + N[Sqrt[N[(N[(b * b), $MachinePrecision] - N[(N[(3.0 * a), $MachinePrecision] * c), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[(3.0 * a), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \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 15 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.9% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a} \end{array} \]
(FPCore (a b c)
 :precision binary64
 (/ (+ (- b) (sqrt (- (* b b) (* (* 3.0 a) c)))) (* 3.0 a)))
double code(double a, double b, double c) {
	return (-b + sqrt(((b * b) - ((3.0 * a) * c)))) / (3.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) - ((3.0d0 * a) * c)))) / (3.0d0 * a)
end function
public static double code(double a, double b, double c) {
	return (-b + Math.sqrt(((b * b) - ((3.0 * a) * c)))) / (3.0 * a);
}
def code(a, b, c):
	return (-b + math.sqrt(((b * b) - ((3.0 * a) * c)))) / (3.0 * a)
function code(a, b, c)
	return Float64(Float64(Float64(-b) + sqrt(Float64(Float64(b * b) - Float64(Float64(3.0 * a) * c)))) / Float64(3.0 * a))
end
function tmp = code(a, b, c)
	tmp = (-b + sqrt(((b * b) - ((3.0 * a) * c)))) / (3.0 * a);
end
code[a_, b_, c_] := N[(N[((-b) + N[Sqrt[N[(N[(b * b), $MachinePrecision] - N[(N[(3.0 * a), $MachinePrecision] * c), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[(3.0 * a), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

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

Alternative 1: 89.9% accurate, 0.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \mathsf{fma}\left(\frac{c}{\left|b\right|}, -0.5, \frac{\left|b\right| - b}{a} \cdot 0.3333333333333333\right)\\ t_1 := \frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a}\\ t_2 := \frac{\sqrt{\mathsf{fma}\left(-3 \cdot a, c, b \cdot b\right)} + \left(-b\right)}{a \cdot 3}\\ \mathbf{if}\;t\_1 \leq -\infty:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;t\_1 \leq -5 \cdot 10^{-306}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;t\_1 \leq 0:\\ \;\;\;\;\frac{c}{b} \cdot -0.5\\ \mathbf{elif}\;t\_1 \leq 10^{+226}:\\ \;\;\;\;t\_2\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
(FPCore (a b c)
 :precision binary64
 (let* ((t_0
         (fma (/ c (fabs b)) -0.5 (* (/ (- (fabs b) b) a) 0.3333333333333333)))
        (t_1 (/ (+ (- b) (sqrt (- (* b b) (* (* 3.0 a) c)))) (* 3.0 a)))
        (t_2 (/ (+ (sqrt (fma (* -3.0 a) c (* b b))) (- b)) (* a 3.0))))
   (if (<= t_1 (- INFINITY))
     t_0
     (if (<= t_1 -5e-306)
       t_2
       (if (<= t_1 0.0) (* (/ c b) -0.5) (if (<= t_1 1e+226) t_2 t_0))))))
double code(double a, double b, double c) {
	double t_0 = fma((c / fabs(b)), -0.5, (((fabs(b) - b) / a) * 0.3333333333333333));
	double t_1 = (-b + sqrt(((b * b) - ((3.0 * a) * c)))) / (3.0 * a);
	double t_2 = (sqrt(fma((-3.0 * a), c, (b * b))) + -b) / (a * 3.0);
	double tmp;
	if (t_1 <= -((double) INFINITY)) {
		tmp = t_0;
	} else if (t_1 <= -5e-306) {
		tmp = t_2;
	} else if (t_1 <= 0.0) {
		tmp = (c / b) * -0.5;
	} else if (t_1 <= 1e+226) {
		tmp = t_2;
	} else {
		tmp = t_0;
	}
	return tmp;
}
function code(a, b, c)
	t_0 = fma(Float64(c / abs(b)), -0.5, Float64(Float64(Float64(abs(b) - b) / a) * 0.3333333333333333))
	t_1 = Float64(Float64(Float64(-b) + sqrt(Float64(Float64(b * b) - Float64(Float64(3.0 * a) * c)))) / Float64(3.0 * a))
	t_2 = Float64(Float64(sqrt(fma(Float64(-3.0 * a), c, Float64(b * b))) + Float64(-b)) / Float64(a * 3.0))
	tmp = 0.0
	if (t_1 <= Float64(-Inf))
		tmp = t_0;
	elseif (t_1 <= -5e-306)
		tmp = t_2;
	elseif (t_1 <= 0.0)
		tmp = Float64(Float64(c / b) * -0.5);
	elseif (t_1 <= 1e+226)
		tmp = t_2;
	else
		tmp = t_0;
	end
	return tmp
end
code[a_, b_, c_] := Block[{t$95$0 = N[(N[(c / N[Abs[b], $MachinePrecision]), $MachinePrecision] * -0.5 + N[(N[(N[(N[Abs[b], $MachinePrecision] - b), $MachinePrecision] / a), $MachinePrecision] * 0.3333333333333333), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[((-b) + N[Sqrt[N[(N[(b * b), $MachinePrecision] - N[(N[(3.0 * a), $MachinePrecision] * c), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[(3.0 * a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[Sqrt[N[(N[(-3.0 * a), $MachinePrecision] * c + N[(b * b), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] + (-b)), $MachinePrecision] / N[(a * 3.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], t$95$0, If[LessEqual[t$95$1, -5e-306], t$95$2, If[LessEqual[t$95$1, 0.0], N[(N[(c / b), $MachinePrecision] * -0.5), $MachinePrecision], If[LessEqual[t$95$1, 1e+226], t$95$2, t$95$0]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(\frac{c}{\left|b\right|}, -0.5, \frac{\left|b\right| - b}{a} \cdot 0.3333333333333333\right)\\
t_1 := \frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a}\\
t_2 := \frac{\sqrt{\mathsf{fma}\left(-3 \cdot a, c, b \cdot b\right)} + \left(-b\right)}{a \cdot 3}\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;t\_1 \leq -5 \cdot 10^{-306}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;t\_1 \leq 0:\\
\;\;\;\;\frac{c}{b} \cdot -0.5\\

\mathbf{elif}\;t\_1 \leq 10^{+226}:\\
\;\;\;\;t\_2\\

\mathbf{else}:\\
\;\;\;\;t\_0\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (/.f64 (+.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 #s(literal 3 binary64) a) c)))) (*.f64 #s(literal 3 binary64) a)) < -inf.0 or 9.99999999999999961e225 < (/.f64 (+.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 #s(literal 3 binary64) a) c)))) (*.f64 #s(literal 3 binary64) a))

    1. Initial program 52.9%

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\frac{c}{\sqrt{b \cdot b}}, \frac{-1}{2}, \frac{1}{3} \cdot \frac{\sqrt{{b}^{2}} - b}{a}\right) \]
      5. rem-sqrt-square-revN/A

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\frac{c}{\left|b\right|}, \frac{-1}{2}, \frac{\sqrt{b \cdot b} - b}{a} \cdot \frac{1}{3}\right) \]
      12. rem-sqrt-square-revN/A

        \[\leadsto \mathsf{fma}\left(\frac{c}{\left|b\right|}, \frac{-1}{2}, \frac{\left|b\right| - b}{a} \cdot \frac{1}{3}\right) \]
      13. lower-fabs.f6467.5

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

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

    if -inf.0 < (/.f64 (+.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 #s(literal 3 binary64) a) c)))) (*.f64 #s(literal 3 binary64) a)) < -4.99999999999999998e-306 or -0.0 < (/.f64 (+.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 #s(literal 3 binary64) a) c)))) (*.f64 #s(literal 3 binary64) a)) < 9.99999999999999961e225

    1. Initial program 52.9%

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

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

      if -4.99999999999999998e-306 < (/.f64 (+.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 #s(literal 3 binary64) a) c)))) (*.f64 #s(literal 3 binary64) a)) < -0.0

      1. Initial program 52.9%

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

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

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

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

          \[\leadsto \frac{c}{b} \cdot -0.5 \]
      4. Applied rewrites34.6%

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

    Alternative 2: 89.8% accurate, 0.2× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_0 := \sqrt{\mathsf{fma}\left(-3 \cdot a, c, b \cdot b\right)} - b\\ t_1 := \mathsf{fma}\left(\frac{c}{\left|b\right|}, -0.5, \frac{\left|b\right| - b}{a} \cdot 0.3333333333333333\right)\\ t_2 := \frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a}\\ \mathbf{if}\;t\_2 \leq -\infty:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t\_2 \leq -5 \cdot 10^{-306}:\\ \;\;\;\;\frac{\frac{t\_0}{3}}{a}\\ \mathbf{elif}\;t\_2 \leq 0:\\ \;\;\;\;\frac{c}{b} \cdot -0.5\\ \mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+234}:\\ \;\;\;\;\frac{t\_0 \cdot 0.3333333333333333}{a}\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
    (FPCore (a b c)
     :precision binary64
     (let* ((t_0 (- (sqrt (fma (* -3.0 a) c (* b b))) b))
            (t_1
             (fma (/ c (fabs b)) -0.5 (* (/ (- (fabs b) b) a) 0.3333333333333333)))
            (t_2 (/ (+ (- b) (sqrt (- (* b b) (* (* 3.0 a) c)))) (* 3.0 a))))
       (if (<= t_2 (- INFINITY))
         t_1
         (if (<= t_2 -5e-306)
           (/ (/ t_0 3.0) a)
           (if (<= t_2 0.0)
             (* (/ c b) -0.5)
             (if (<= t_2 2e+234) (/ (* t_0 0.3333333333333333) a) t_1))))))
    double code(double a, double b, double c) {
    	double t_0 = sqrt(fma((-3.0 * a), c, (b * b))) - b;
    	double t_1 = fma((c / fabs(b)), -0.5, (((fabs(b) - b) / a) * 0.3333333333333333));
    	double t_2 = (-b + sqrt(((b * b) - ((3.0 * a) * c)))) / (3.0 * a);
    	double tmp;
    	if (t_2 <= -((double) INFINITY)) {
    		tmp = t_1;
    	} else if (t_2 <= -5e-306) {
    		tmp = (t_0 / 3.0) / a;
    	} else if (t_2 <= 0.0) {
    		tmp = (c / b) * -0.5;
    	} else if (t_2 <= 2e+234) {
    		tmp = (t_0 * 0.3333333333333333) / a;
    	} else {
    		tmp = t_1;
    	}
    	return tmp;
    }
    
    function code(a, b, c)
    	t_0 = Float64(sqrt(fma(Float64(-3.0 * a), c, Float64(b * b))) - b)
    	t_1 = fma(Float64(c / abs(b)), -0.5, Float64(Float64(Float64(abs(b) - b) / a) * 0.3333333333333333))
    	t_2 = Float64(Float64(Float64(-b) + sqrt(Float64(Float64(b * b) - Float64(Float64(3.0 * a) * c)))) / Float64(3.0 * a))
    	tmp = 0.0
    	if (t_2 <= Float64(-Inf))
    		tmp = t_1;
    	elseif (t_2 <= -5e-306)
    		tmp = Float64(Float64(t_0 / 3.0) / a);
    	elseif (t_2 <= 0.0)
    		tmp = Float64(Float64(c / b) * -0.5);
    	elseif (t_2 <= 2e+234)
    		tmp = Float64(Float64(t_0 * 0.3333333333333333) / a);
    	else
    		tmp = t_1;
    	end
    	return tmp
    end
    
    code[a_, b_, c_] := Block[{t$95$0 = N[(N[Sqrt[N[(N[(-3.0 * a), $MachinePrecision] * c + N[(b * b), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision]}, Block[{t$95$1 = N[(N[(c / N[Abs[b], $MachinePrecision]), $MachinePrecision] * -0.5 + N[(N[(N[(N[Abs[b], $MachinePrecision] - b), $MachinePrecision] / a), $MachinePrecision] * 0.3333333333333333), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[((-b) + N[Sqrt[N[(N[(b * b), $MachinePrecision] - N[(N[(3.0 * a), $MachinePrecision] * c), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[(3.0 * a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, (-Infinity)], t$95$1, If[LessEqual[t$95$2, -5e-306], N[(N[(t$95$0 / 3.0), $MachinePrecision] / a), $MachinePrecision], If[LessEqual[t$95$2, 0.0], N[(N[(c / b), $MachinePrecision] * -0.5), $MachinePrecision], If[LessEqual[t$95$2, 2e+234], N[(N[(t$95$0 * 0.3333333333333333), $MachinePrecision] / a), $MachinePrecision], t$95$1]]]]]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_0 := \sqrt{\mathsf{fma}\left(-3 \cdot a, c, b \cdot b\right)} - b\\
    t_1 := \mathsf{fma}\left(\frac{c}{\left|b\right|}, -0.5, \frac{\left|b\right| - b}{a} \cdot 0.3333333333333333\right)\\
    t_2 := \frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a}\\
    \mathbf{if}\;t\_2 \leq -\infty:\\
    \;\;\;\;t\_1\\
    
    \mathbf{elif}\;t\_2 \leq -5 \cdot 10^{-306}:\\
    \;\;\;\;\frac{\frac{t\_0}{3}}{a}\\
    
    \mathbf{elif}\;t\_2 \leq 0:\\
    \;\;\;\;\frac{c}{b} \cdot -0.5\\
    
    \mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+234}:\\
    \;\;\;\;\frac{t\_0 \cdot 0.3333333333333333}{a}\\
    
    \mathbf{else}:\\
    \;\;\;\;t\_1\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 4 regimes
    2. if (/.f64 (+.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 #s(literal 3 binary64) a) c)))) (*.f64 #s(literal 3 binary64) a)) < -inf.0 or 2.00000000000000004e234 < (/.f64 (+.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 #s(literal 3 binary64) a) c)))) (*.f64 #s(literal 3 binary64) a))

      1. Initial program 52.9%

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

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

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

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

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

          \[\leadsto \mathsf{fma}\left(\frac{c}{\sqrt{b \cdot b}}, \frac{-1}{2}, \frac{1}{3} \cdot \frac{\sqrt{{b}^{2}} - b}{a}\right) \]
        5. rem-sqrt-square-revN/A

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

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

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

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

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

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

          \[\leadsto \mathsf{fma}\left(\frac{c}{\left|b\right|}, \frac{-1}{2}, \frac{\sqrt{b \cdot b} - b}{a} \cdot \frac{1}{3}\right) \]
        12. rem-sqrt-square-revN/A

          \[\leadsto \mathsf{fma}\left(\frac{c}{\left|b\right|}, \frac{-1}{2}, \frac{\left|b\right| - b}{a} \cdot \frac{1}{3}\right) \]
        13. lower-fabs.f6467.5

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

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

      if -inf.0 < (/.f64 (+.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 #s(literal 3 binary64) a) c)))) (*.f64 #s(literal 3 binary64) a)) < -4.99999999999999998e-306

      1. Initial program 52.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \frac{\frac{\sqrt{\left(-3 \cdot a\right) \cdot c + b \cdot b} + \color{blue}{\left(\mathsf{neg}\left(b\right)\right)}}{3}}{a} \]
        7. sub-flip-reverseN/A

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

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

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

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

          \[\leadsto \frac{\frac{\sqrt{\mathsf{fma}\left(-3 \cdot a, c, \color{blue}{b \cdot b}\right)} - b}{3}}{a} \]
        12. lift-sqrt.f6452.9

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

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

      if -4.99999999999999998e-306 < (/.f64 (+.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 #s(literal 3 binary64) a) c)))) (*.f64 #s(literal 3 binary64) a)) < -0.0

      1. Initial program 52.9%

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

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

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

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

          \[\leadsto \frac{c}{b} \cdot -0.5 \]
      4. Applied rewrites34.6%

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

      if -0.0 < (/.f64 (+.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 #s(literal 3 binary64) a) c)))) (*.f64 #s(literal 3 binary64) a)) < 2.00000000000000004e234

      1. Initial program 52.9%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{\frac{\sqrt{\mathsf{fma}\left(-3 \cdot a, c, b \cdot b\right)} + \left(-b\right)}{3}}{a}} \]
      4. Step-by-step derivation
        1. Applied rewrites52.8%

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

      Alternative 3: 89.8% accurate, 0.2× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} t_0 := \mathsf{fma}\left(\frac{c}{\left|b\right|}, -0.5, \frac{\left|b\right| - b}{a} \cdot 0.3333333333333333\right)\\ t_1 := \frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a}\\ t_2 := \frac{\left(\sqrt{\mathsf{fma}\left(-3 \cdot a, c, b \cdot b\right)} - b\right) \cdot 0.3333333333333333}{a}\\ \mathbf{if}\;t\_1 \leq -\infty:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;t\_1 \leq -5 \cdot 10^{-306}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;t\_1 \leq 0:\\ \;\;\;\;\frac{c}{b} \cdot -0.5\\ \mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+234}:\\ \;\;\;\;t\_2\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
      (FPCore (a b c)
       :precision binary64
       (let* ((t_0
               (fma (/ c (fabs b)) -0.5 (* (/ (- (fabs b) b) a) 0.3333333333333333)))
              (t_1 (/ (+ (- b) (sqrt (- (* b b) (* (* 3.0 a) c)))) (* 3.0 a)))
              (t_2
               (/ (* (- (sqrt (fma (* -3.0 a) c (* b b))) b) 0.3333333333333333) a)))
         (if (<= t_1 (- INFINITY))
           t_0
           (if (<= t_1 -5e-306)
             t_2
             (if (<= t_1 0.0) (* (/ c b) -0.5) (if (<= t_1 2e+234) t_2 t_0))))))
      double code(double a, double b, double c) {
      	double t_0 = fma((c / fabs(b)), -0.5, (((fabs(b) - b) / a) * 0.3333333333333333));
      	double t_1 = (-b + sqrt(((b * b) - ((3.0 * a) * c)))) / (3.0 * a);
      	double t_2 = ((sqrt(fma((-3.0 * a), c, (b * b))) - b) * 0.3333333333333333) / a;
      	double tmp;
      	if (t_1 <= -((double) INFINITY)) {
      		tmp = t_0;
      	} else if (t_1 <= -5e-306) {
      		tmp = t_2;
      	} else if (t_1 <= 0.0) {
      		tmp = (c / b) * -0.5;
      	} else if (t_1 <= 2e+234) {
      		tmp = t_2;
      	} else {
      		tmp = t_0;
      	}
      	return tmp;
      }
      
      function code(a, b, c)
      	t_0 = fma(Float64(c / abs(b)), -0.5, Float64(Float64(Float64(abs(b) - b) / a) * 0.3333333333333333))
      	t_1 = Float64(Float64(Float64(-b) + sqrt(Float64(Float64(b * b) - Float64(Float64(3.0 * a) * c)))) / Float64(3.0 * a))
      	t_2 = Float64(Float64(Float64(sqrt(fma(Float64(-3.0 * a), c, Float64(b * b))) - b) * 0.3333333333333333) / a)
      	tmp = 0.0
      	if (t_1 <= Float64(-Inf))
      		tmp = t_0;
      	elseif (t_1 <= -5e-306)
      		tmp = t_2;
      	elseif (t_1 <= 0.0)
      		tmp = Float64(Float64(c / b) * -0.5);
      	elseif (t_1 <= 2e+234)
      		tmp = t_2;
      	else
      		tmp = t_0;
      	end
      	return tmp
      end
      
      code[a_, b_, c_] := Block[{t$95$0 = N[(N[(c / N[Abs[b], $MachinePrecision]), $MachinePrecision] * -0.5 + N[(N[(N[(N[Abs[b], $MachinePrecision] - b), $MachinePrecision] / a), $MachinePrecision] * 0.3333333333333333), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[((-b) + N[Sqrt[N[(N[(b * b), $MachinePrecision] - N[(N[(3.0 * a), $MachinePrecision] * c), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[(3.0 * a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(N[Sqrt[N[(N[(-3.0 * a), $MachinePrecision] * c + N[(b * b), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision] * 0.3333333333333333), $MachinePrecision] / a), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], t$95$0, If[LessEqual[t$95$1, -5e-306], t$95$2, If[LessEqual[t$95$1, 0.0], N[(N[(c / b), $MachinePrecision] * -0.5), $MachinePrecision], If[LessEqual[t$95$1, 2e+234], t$95$2, t$95$0]]]]]]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      t_0 := \mathsf{fma}\left(\frac{c}{\left|b\right|}, -0.5, \frac{\left|b\right| - b}{a} \cdot 0.3333333333333333\right)\\
      t_1 := \frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a}\\
      t_2 := \frac{\left(\sqrt{\mathsf{fma}\left(-3 \cdot a, c, b \cdot b\right)} - b\right) \cdot 0.3333333333333333}{a}\\
      \mathbf{if}\;t\_1 \leq -\infty:\\
      \;\;\;\;t\_0\\
      
      \mathbf{elif}\;t\_1 \leq -5 \cdot 10^{-306}:\\
      \;\;\;\;t\_2\\
      
      \mathbf{elif}\;t\_1 \leq 0:\\
      \;\;\;\;\frac{c}{b} \cdot -0.5\\
      
      \mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+234}:\\
      \;\;\;\;t\_2\\
      
      \mathbf{else}:\\
      \;\;\;\;t\_0\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 3 regimes
      2. if (/.f64 (+.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 #s(literal 3 binary64) a) c)))) (*.f64 #s(literal 3 binary64) a)) < -inf.0 or 2.00000000000000004e234 < (/.f64 (+.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 #s(literal 3 binary64) a) c)))) (*.f64 #s(literal 3 binary64) a))

        1. Initial program 52.9%

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

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

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

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

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

            \[\leadsto \mathsf{fma}\left(\frac{c}{\sqrt{b \cdot b}}, \frac{-1}{2}, \frac{1}{3} \cdot \frac{\sqrt{{b}^{2}} - b}{a}\right) \]
          5. rem-sqrt-square-revN/A

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

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

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

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

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

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

            \[\leadsto \mathsf{fma}\left(\frac{c}{\left|b\right|}, \frac{-1}{2}, \frac{\sqrt{b \cdot b} - b}{a} \cdot \frac{1}{3}\right) \]
          12. rem-sqrt-square-revN/A

            \[\leadsto \mathsf{fma}\left(\frac{c}{\left|b\right|}, \frac{-1}{2}, \frac{\left|b\right| - b}{a} \cdot \frac{1}{3}\right) \]
          13. lower-fabs.f6467.5

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

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

        if -inf.0 < (/.f64 (+.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 #s(literal 3 binary64) a) c)))) (*.f64 #s(literal 3 binary64) a)) < -4.99999999999999998e-306 or -0.0 < (/.f64 (+.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 #s(literal 3 binary64) a) c)))) (*.f64 #s(literal 3 binary64) a)) < 2.00000000000000004e234

        1. Initial program 52.9%

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \color{blue}{\frac{\frac{\sqrt{\mathsf{fma}\left(-3 \cdot a, c, b \cdot b\right)} + \left(-b\right)}{3}}{a}} \]
        4. Step-by-step derivation
          1. Applied rewrites52.8%

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

          if -4.99999999999999998e-306 < (/.f64 (+.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 #s(literal 3 binary64) a) c)))) (*.f64 #s(literal 3 binary64) a)) < -0.0

          1. Initial program 52.9%

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

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

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

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

              \[\leadsto \frac{c}{b} \cdot -0.5 \]
          4. Applied rewrites34.6%

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

        Alternative 4: 80.3% accurate, 0.9× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} t_0 := \mathsf{fma}\left(\frac{c}{\left|b\right|}, -0.5, \frac{\left|b\right| - b}{a} \cdot 0.3333333333333333\right)\\ \mathbf{if}\;b \leq -3.5 \cdot 10^{-62}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;b \leq 6.6 \cdot 10^{-76}:\\ \;\;\;\;\frac{\left(-b\right) + \sqrt{-3 \cdot \left(c \cdot a\right)}}{3 \cdot a}\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
        (FPCore (a b c)
         :precision binary64
         (let* ((t_0
                 (fma
                  (/ c (fabs b))
                  -0.5
                  (* (/ (- (fabs b) b) a) 0.3333333333333333))))
           (if (<= b -3.5e-62)
             t_0
             (if (<= b 6.6e-76) (/ (+ (- b) (sqrt (* -3.0 (* c a)))) (* 3.0 a)) t_0))))
        double code(double a, double b, double c) {
        	double t_0 = fma((c / fabs(b)), -0.5, (((fabs(b) - b) / a) * 0.3333333333333333));
        	double tmp;
        	if (b <= -3.5e-62) {
        		tmp = t_0;
        	} else if (b <= 6.6e-76) {
        		tmp = (-b + sqrt((-3.0 * (c * a)))) / (3.0 * a);
        	} else {
        		tmp = t_0;
        	}
        	return tmp;
        }
        
        function code(a, b, c)
        	t_0 = fma(Float64(c / abs(b)), -0.5, Float64(Float64(Float64(abs(b) - b) / a) * 0.3333333333333333))
        	tmp = 0.0
        	if (b <= -3.5e-62)
        		tmp = t_0;
        	elseif (b <= 6.6e-76)
        		tmp = Float64(Float64(Float64(-b) + sqrt(Float64(-3.0 * Float64(c * a)))) / Float64(3.0 * a));
        	else
        		tmp = t_0;
        	end
        	return tmp
        end
        
        code[a_, b_, c_] := Block[{t$95$0 = N[(N[(c / N[Abs[b], $MachinePrecision]), $MachinePrecision] * -0.5 + N[(N[(N[(N[Abs[b], $MachinePrecision] - b), $MachinePrecision] / a), $MachinePrecision] * 0.3333333333333333), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -3.5e-62], t$95$0, If[LessEqual[b, 6.6e-76], N[(N[((-b) + N[Sqrt[N[(-3.0 * N[(c * a), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[(3.0 * a), $MachinePrecision]), $MachinePrecision], t$95$0]]]
        
        \begin{array}{l}
        
        \\
        \begin{array}{l}
        t_0 := \mathsf{fma}\left(\frac{c}{\left|b\right|}, -0.5, \frac{\left|b\right| - b}{a} \cdot 0.3333333333333333\right)\\
        \mathbf{if}\;b \leq -3.5 \cdot 10^{-62}:\\
        \;\;\;\;t\_0\\
        
        \mathbf{elif}\;b \leq 6.6 \cdot 10^{-76}:\\
        \;\;\;\;\frac{\left(-b\right) + \sqrt{-3 \cdot \left(c \cdot a\right)}}{3 \cdot a}\\
        
        \mathbf{else}:\\
        \;\;\;\;t\_0\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 2 regimes
        2. if b < -3.5000000000000001e-62 or 6.59999999999999967e-76 < b

          1. Initial program 52.9%

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

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

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

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

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

              \[\leadsto \mathsf{fma}\left(\frac{c}{\sqrt{b \cdot b}}, \frac{-1}{2}, \frac{1}{3} \cdot \frac{\sqrt{{b}^{2}} - b}{a}\right) \]
            5. rem-sqrt-square-revN/A

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

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

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

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

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

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

              \[\leadsto \mathsf{fma}\left(\frac{c}{\left|b\right|}, \frac{-1}{2}, \frac{\sqrt{b \cdot b} - b}{a} \cdot \frac{1}{3}\right) \]
            12. rem-sqrt-square-revN/A

              \[\leadsto \mathsf{fma}\left(\frac{c}{\left|b\right|}, \frac{-1}{2}, \frac{\left|b\right| - b}{a} \cdot \frac{1}{3}\right) \]
            13. lower-fabs.f6467.5

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

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

          if -3.5000000000000001e-62 < b < 6.59999999999999967e-76

          1. Initial program 52.9%

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

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

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

              \[\leadsto \frac{\left(-b\right) + \sqrt{-3 \cdot \left(c \cdot \color{blue}{a}\right)}}{3 \cdot a} \]
            3. lower-*.f6434.0

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

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

        Alternative 5: 80.3% accurate, 0.9× speedup?

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

          1. Initial program 52.9%

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

            \[\leadsto \frac{\color{blue}{-2 \cdot b}}{3 \cdot a} \]
          3. Step-by-step derivation
            1. lower-*.f6435.2

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

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

          if -3.5000000000000001e-62 < b < 6.59999999999999967e-76

          1. Initial program 52.9%

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

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

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

              \[\leadsto \frac{\left(-b\right) + \sqrt{-3 \cdot \left(c \cdot \color{blue}{a}\right)}}{3 \cdot a} \]
            3. lower-*.f6434.0

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

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

          if 6.59999999999999967e-76 < b

          1. Initial program 52.9%

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

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

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

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

              \[\leadsto \frac{c}{b} \cdot -0.5 \]
          4. Applied rewrites34.6%

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

        Alternative 6: 80.0% accurate, 1.1× speedup?

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

          1. Initial program 52.9%

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

            \[\leadsto \frac{\color{blue}{-2 \cdot b}}{3 \cdot a} \]
          3. Step-by-step derivation
            1. lower-*.f6435.2

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

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

          if -3.5000000000000001e-62 < b < 6.59999999999999967e-76

          1. Initial program 52.9%

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

            \[\leadsto \frac{\color{blue}{\sqrt{\mathsf{neg}\left(3 \cdot \left(a \cdot c\right)\right)}}}{3 \cdot a} \]
          3. Step-by-step derivation
            1. distribute-lft-neg-inN/A

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

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

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

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

              \[\leadsto \frac{\sqrt{-3 \cdot \left(c \cdot a\right)}}{3 \cdot a} \]
            6. lower-*.f6429.6

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

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

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

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

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

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

              \[\leadsto \frac{\sqrt{\left(-3 \cdot a\right) \cdot c}}{3 \cdot a} \]
            6. lower-*.f6429.7

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

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

          if 6.59999999999999967e-76 < b

          1. Initial program 52.9%

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

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

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

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

              \[\leadsto \frac{c}{b} \cdot -0.5 \]
          4. Applied rewrites34.6%

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

        Alternative 7: 79.9% accurate, 1.1× speedup?

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

          1. Initial program 52.9%

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

            \[\leadsto \frac{\color{blue}{-2 \cdot b}}{3 \cdot a} \]
          3. Step-by-step derivation
            1. lower-*.f6435.2

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

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

          if -3.5000000000000001e-62 < b < 6.59999999999999967e-76

          1. Initial program 52.9%

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

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

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

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

              \[\leadsto \frac{\sqrt{\mathsf{neg}\left(3 \cdot \left(a \cdot c\right)\right)}}{a} \cdot \frac{1}{3} \]
            4. distribute-lft-neg-inN/A

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

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

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

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

              \[\leadsto \frac{\sqrt{-3 \cdot \left(c \cdot a\right)}}{a} \cdot \frac{1}{3} \]
            9. lower-*.f6429.6

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

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

          if 6.59999999999999967e-76 < b

          1. Initial program 52.9%

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

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

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

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

              \[\leadsto \frac{c}{b} \cdot -0.5 \]
          4. Applied rewrites34.6%

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

          1. Initial program 52.9%

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

            \[\leadsto \frac{\color{blue}{-2 \cdot b}}{3 \cdot a} \]
          3. Step-by-step derivation
            1. lower-*.f6435.2

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

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

          if -3.5000000000000001e-62 < b < 6.59999999999999967e-76

          1. Initial program 52.9%

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

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

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

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

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

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

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

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

              \[\leadsto \frac{-1}{3} \cdot \left(\frac{b}{a} + \sqrt{\sqrt{-3 \cdot \frac{c}{a}} \cdot \sqrt{-3 \cdot \frac{c}{a}}}\right) \]
            8. rem-square-sqrtN/A

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

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

              \[\leadsto \frac{-1}{3} \cdot \left(\frac{b}{a} + \sqrt{\frac{c}{a} \cdot -3}\right) \]
            11. lower-/.f6420.1

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

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

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

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

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

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

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

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

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

              \[\leadsto \left(-0.3333333333333333 \cdot c\right) \cdot \sqrt{\frac{-3}{c \cdot a}} \]
          7. Applied rewrites28.2%

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

          if 6.59999999999999967e-76 < b

          1. Initial program 52.9%

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

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

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

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

              \[\leadsto \frac{c}{b} \cdot -0.5 \]
          4. Applied rewrites34.6%

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

        Alternative 9: 71.7% accurate, 1.2× speedup?

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

          1. Initial program 52.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \frac{\frac{\color{blue}{-2 \cdot b}}{3}}{a} \]
          5. Step-by-step derivation
            1. lower-*.f6435.2

              \[\leadsto \frac{\frac{-2 \cdot \color{blue}{b}}{3}}{a} \]
          6. Applied rewrites35.2%

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

          if -1.10000000000000001e-161 < b < 2.0499999999999999e-169

          1. Initial program 52.9%

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

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

              \[\leadsto \frac{-1}{3} \cdot \color{blue}{\sqrt{-3 \cdot \frac{c}{a}}} \]
            2. rem-square-sqrtN/A

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

              \[\leadsto \frac{-1}{3} \cdot \sqrt{\sqrt{-3 \cdot \frac{c}{a}} \cdot \sqrt{-3 \cdot \frac{c}{a}}} \]
            4. rem-square-sqrtN/A

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

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

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

              \[\leadsto -0.3333333333333333 \cdot \sqrt{\frac{c}{a} \cdot -3} \]
          4. Applied rewrites17.7%

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

          if 2.0499999999999999e-169 < b

          1. Initial program 52.9%

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

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

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

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

              \[\leadsto \frac{c}{b} \cdot -0.5 \]
          4. Applied rewrites34.6%

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

        Alternative 10: 67.4% accurate, 1.6× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq 1.7 \cdot 10^{-307}:\\ \;\;\;\;\frac{\left|b\right| - b}{3 \cdot a}\\ \mathbf{else}:\\ \;\;\;\;\frac{c}{b} \cdot -0.5\\ \end{array} \end{array} \]
        (FPCore (a b c)
         :precision binary64
         (if (<= b 1.7e-307) (/ (- (fabs b) b) (* 3.0 a)) (* (/ c b) -0.5)))
        double code(double a, double b, double c) {
        	double tmp;
        	if (b <= 1.7e-307) {
        		tmp = (fabs(b) - b) / (3.0 * a);
        	} else {
        		tmp = (c / b) * -0.5;
        	}
        	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.7d-307) then
                tmp = (abs(b) - b) / (3.0d0 * a)
            else
                tmp = (c / b) * (-0.5d0)
            end if
            code = tmp
        end function
        
        public static double code(double a, double b, double c) {
        	double tmp;
        	if (b <= 1.7e-307) {
        		tmp = (Math.abs(b) - b) / (3.0 * a);
        	} else {
        		tmp = (c / b) * -0.5;
        	}
        	return tmp;
        }
        
        def code(a, b, c):
        	tmp = 0
        	if b <= 1.7e-307:
        		tmp = (math.fabs(b) - b) / (3.0 * a)
        	else:
        		tmp = (c / b) * -0.5
        	return tmp
        
        function code(a, b, c)
        	tmp = 0.0
        	if (b <= 1.7e-307)
        		tmp = Float64(Float64(abs(b) - b) / Float64(3.0 * a));
        	else
        		tmp = Float64(Float64(c / b) * -0.5);
        	end
        	return tmp
        end
        
        function tmp_2 = code(a, b, c)
        	tmp = 0.0;
        	if (b <= 1.7e-307)
        		tmp = (abs(b) - b) / (3.0 * a);
        	else
        		tmp = (c / b) * -0.5;
        	end
        	tmp_2 = tmp;
        end
        
        code[a_, b_, c_] := If[LessEqual[b, 1.7e-307], N[(N[(N[Abs[b], $MachinePrecision] - b), $MachinePrecision] / N[(3.0 * a), $MachinePrecision]), $MachinePrecision], N[(N[(c / b), $MachinePrecision] * -0.5), $MachinePrecision]]
        
        \begin{array}{l}
        
        \\
        \begin{array}{l}
        \mathbf{if}\;b \leq 1.7 \cdot 10^{-307}:\\
        \;\;\;\;\frac{\left|b\right| - b}{3 \cdot a}\\
        
        \mathbf{else}:\\
        \;\;\;\;\frac{c}{b} \cdot -0.5\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 2 regimes
        2. if b < 1.69999999999999994e-307

          1. Initial program 52.9%

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

            \[\leadsto \frac{\color{blue}{\sqrt{{b}^{2}} - b}}{3 \cdot a} \]
          3. Step-by-step derivation
            1. lower--.f64N/A

              \[\leadsto \frac{\sqrt{{b}^{2}} - \color{blue}{b}}{3 \cdot a} \]
            2. pow2N/A

              \[\leadsto \frac{\sqrt{b \cdot b} - b}{3 \cdot a} \]
            3. rem-sqrt-square-revN/A

              \[\leadsto \frac{\left|b\right| - b}{3 \cdot a} \]
            4. lower-fabs.f6444.1

              \[\leadsto \frac{\left|b\right| - b}{3 \cdot a} \]
          4. Applied rewrites44.1%

            \[\leadsto \frac{\color{blue}{\left|b\right| - b}}{3 \cdot a} \]

          if 1.69999999999999994e-307 < b

          1. Initial program 52.9%

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

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

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

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

              \[\leadsto \frac{c}{b} \cdot -0.5 \]
          4. Applied rewrites34.6%

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

        Alternative 11: 67.4% accurate, 1.7× speedup?

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

          1. Initial program 52.9%

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

            \[\leadsto \frac{\color{blue}{-2 \cdot b}}{3 \cdot a} \]
          3. Step-by-step derivation
            1. lower-*.f6435.2

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

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

          if 2.9e-308 < b

          1. Initial program 52.9%

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

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

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

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

              \[\leadsto \frac{c}{b} \cdot -0.5 \]
          4. Applied rewrites34.6%

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

        Alternative 12: 67.3% accurate, 2.2× speedup?

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

          1. Initial program 52.9%

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

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

              \[\leadsto \frac{-2}{3} \cdot \color{blue}{\frac{b}{a}} \]
            2. lower-/.f6435.2

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

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

              \[\leadsto \frac{-2}{3} \cdot \color{blue}{\frac{b}{a}} \]
            2. lift-/.f64N/A

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

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

              \[\leadsto \frac{\frac{-2}{3} \cdot b}{\color{blue}{a}} \]
            5. lower-*.f6435.2

              \[\leadsto \frac{-0.6666666666666666 \cdot b}{a} \]
          6. Applied rewrites35.2%

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

          if 2.9e-308 < b

          1. Initial program 52.9%

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

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

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

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

              \[\leadsto \frac{c}{b} \cdot -0.5 \]
          4. Applied rewrites34.6%

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

        Alternative 13: 67.3% accurate, 2.2× speedup?

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

          1. Initial program 52.9%

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

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

              \[\leadsto \frac{-2}{3} \cdot \color{blue}{\frac{b}{a}} \]
            2. lower-/.f6435.2

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

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

          if 2.9e-308 < b

          1. Initial program 52.9%

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

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

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

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

              \[\leadsto \frac{c}{b} \cdot -0.5 \]
          4. Applied rewrites34.6%

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

        Alternative 14: 35.2% accurate, 3.3× speedup?

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

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

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

            \[\leadsto \frac{-2}{3} \cdot \color{blue}{\frac{b}{a}} \]
          2. lower-/.f6435.2

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

          \[\leadsto \color{blue}{-0.6666666666666666 \cdot \frac{b}{a}} \]
        5. Add Preprocessing

        Alternative 15: 15.5% accurate, 3.3× speedup?

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

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

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

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

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

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

            \[\leadsto \mathsf{fma}\left(\frac{c}{\sqrt{b \cdot b}}, \frac{-1}{2}, \frac{1}{3} \cdot \frac{\sqrt{{b}^{2}} - b}{a}\right) \]
          5. rem-sqrt-square-revN/A

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

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

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

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

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

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

            \[\leadsto \mathsf{fma}\left(\frac{c}{\left|b\right|}, \frac{-1}{2}, \frac{\sqrt{b \cdot b} - b}{a} \cdot \frac{1}{3}\right) \]
          12. rem-sqrt-square-revN/A

            \[\leadsto \mathsf{fma}\left(\frac{c}{\left|b\right|}, \frac{-1}{2}, \frac{\left|b\right| - b}{a} \cdot \frac{1}{3}\right) \]
          13. lower-fabs.f6467.5

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

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

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

            \[\leadsto \frac{-1}{3} \cdot \frac{b}{\color{blue}{a}} \]
          2. lift-/.f6415.5

            \[\leadsto -0.3333333333333333 \cdot \frac{b}{a} \]
        7. Applied rewrites15.5%

          \[\leadsto -0.3333333333333333 \cdot \color{blue}{\frac{b}{a}} \]
        8. Add Preprocessing

        Reproduce

        ?
        herbie shell --seed 2025139 
        (FPCore (a b c)
          :name "Cubic critical"
          :precision binary64
          (/ (+ (- b) (sqrt (- (* b b) (* (* 3.0 a) c)))) (* 3.0 a)))