Cubic critical

Percentage Accurate: 51.9% → 85.6%
Time: 15.4s
Alternatives: 11
Speedup: 11.6×

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);
}
real(8) function code(a, b, c)
    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}

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 11 alternatives:

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

Initial Program: 51.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);
}
real(8) function code(a, b, c)
    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: 85.6% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq -1.35 \cdot 10^{+154}:\\ \;\;\;\;b \cdot \left(\frac{\frac{c}{b}}{b} \cdot \left(0 - -0.5\right) - \frac{0.6666666666666666}{a}\right)\\ \mathbf{elif}\;b \leq 3.2 \cdot 10^{-75}:\\ \;\;\;\;\frac{\sqrt{b \cdot b - c \cdot \left(a \cdot 3\right)} - b}{a \cdot 3}\\ \mathbf{else}:\\ \;\;\;\;\frac{-0.5 \cdot c}{b}\\ \end{array} \end{array} \]
(FPCore (a b c)
 :precision binary64
 (if (<= b -1.35e+154)
   (* b (- (* (/ (/ c b) b) (- 0.0 -0.5)) (/ 0.6666666666666666 a)))
   (if (<= b 3.2e-75)
     (/ (- (sqrt (- (* b b) (* c (* a 3.0)))) b) (* a 3.0))
     (/ (* -0.5 c) b))))
double code(double a, double b, double c) {
	double tmp;
	if (b <= -1.35e+154) {
		tmp = b * ((((c / b) / b) * (0.0 - -0.5)) - (0.6666666666666666 / a));
	} else if (b <= 3.2e-75) {
		tmp = (sqrt(((b * b) - (c * (a * 3.0)))) - b) / (a * 3.0);
	} else {
		tmp = (-0.5 * c) / b;
	}
	return tmp;
}
real(8) function code(a, b, c)
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8) :: tmp
    if (b <= (-1.35d+154)) then
        tmp = b * ((((c / b) / b) * (0.0d0 - (-0.5d0))) - (0.6666666666666666d0 / a))
    else if (b <= 3.2d-75) then
        tmp = (sqrt(((b * b) - (c * (a * 3.0d0)))) - b) / (a * 3.0d0)
    else
        tmp = ((-0.5d0) * c) / b
    end if
    code = tmp
end function
public static double code(double a, double b, double c) {
	double tmp;
	if (b <= -1.35e+154) {
		tmp = b * ((((c / b) / b) * (0.0 - -0.5)) - (0.6666666666666666 / a));
	} else if (b <= 3.2e-75) {
		tmp = (Math.sqrt(((b * b) - (c * (a * 3.0)))) - b) / (a * 3.0);
	} else {
		tmp = (-0.5 * c) / b;
	}
	return tmp;
}
def code(a, b, c):
	tmp = 0
	if b <= -1.35e+154:
		tmp = b * ((((c / b) / b) * (0.0 - -0.5)) - (0.6666666666666666 / a))
	elif b <= 3.2e-75:
		tmp = (math.sqrt(((b * b) - (c * (a * 3.0)))) - b) / (a * 3.0)
	else:
		tmp = (-0.5 * c) / b
	return tmp
function code(a, b, c)
	tmp = 0.0
	if (b <= -1.35e+154)
		tmp = Float64(b * Float64(Float64(Float64(Float64(c / b) / b) * Float64(0.0 - -0.5)) - Float64(0.6666666666666666 / a)));
	elseif (b <= 3.2e-75)
		tmp = Float64(Float64(sqrt(Float64(Float64(b * b) - Float64(c * Float64(a * 3.0)))) - b) / Float64(a * 3.0));
	else
		tmp = Float64(Float64(-0.5 * c) / b);
	end
	return tmp
end
function tmp_2 = code(a, b, c)
	tmp = 0.0;
	if (b <= -1.35e+154)
		tmp = b * ((((c / b) / b) * (0.0 - -0.5)) - (0.6666666666666666 / a));
	elseif (b <= 3.2e-75)
		tmp = (sqrt(((b * b) - (c * (a * 3.0)))) - b) / (a * 3.0);
	else
		tmp = (-0.5 * c) / b;
	end
	tmp_2 = tmp;
end
code[a_, b_, c_] := If[LessEqual[b, -1.35e+154], N[(b * N[(N[(N[(N[(c / b), $MachinePrecision] / b), $MachinePrecision] * N[(0.0 - -0.5), $MachinePrecision]), $MachinePrecision] - N[(0.6666666666666666 / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 3.2e-75], N[(N[(N[Sqrt[N[(N[(b * b), $MachinePrecision] - N[(c * N[(a * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision] / N[(a * 3.0), $MachinePrecision]), $MachinePrecision], N[(N[(-0.5 * c), $MachinePrecision] / b), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;b \leq -1.35 \cdot 10^{+154}:\\
\;\;\;\;b \cdot \left(\frac{\frac{c}{b}}{b} \cdot \left(0 - -0.5\right) - \frac{0.6666666666666666}{a}\right)\\

\mathbf{elif}\;b \leq 3.2 \cdot 10^{-75}:\\
\;\;\;\;\frac{\sqrt{b \cdot b - c \cdot \left(a \cdot 3\right)} - b}{a \cdot 3}\\

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


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

    1. Initial program 44.4%

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

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

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

        \[\leadsto \mathsf{neg}\left(\left(\frac{-1}{2} \cdot \frac{c}{{b}^{2}} + \frac{2}{3} \cdot \frac{1}{a}\right) \cdot b\right) \]
      3. distribute-rgt-neg-inN/A

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\frac{-1}{2}, \left(\frac{c}{{b}^{2}}\right)\right), \left(\frac{2}{3} \cdot \frac{1}{a}\right)\right), \left(\mathsf{neg}\left(b\right)\right)\right) \]
      7. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\frac{-1}{2}, \left(\frac{c}{b \cdot b}\right)\right), \left(\frac{2}{3} \cdot \frac{1}{a}\right)\right), \left(\mathsf{neg}\left(b\right)\right)\right) \]
      8. associate-/r*N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\frac{-1}{2}, \left(\frac{\frac{c}{b}}{b}\right)\right), \left(\frac{2}{3} \cdot \frac{1}{a}\right)\right), \left(\mathsf{neg}\left(b\right)\right)\right) \]
      9. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\frac{-1}{2}, \mathsf{/.f64}\left(\left(\frac{c}{b}\right), b\right)\right), \left(\frac{2}{3} \cdot \frac{1}{a}\right)\right), \left(\mathsf{neg}\left(b\right)\right)\right) \]
      10. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\frac{-1}{2}, \mathsf{/.f64}\left(\mathsf{/.f64}\left(c, b\right), b\right)\right), \left(\frac{2}{3} \cdot \frac{1}{a}\right)\right), \left(\mathsf{neg}\left(b\right)\right)\right) \]
      11. associate-*r/N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\frac{-1}{2}, \mathsf{/.f64}\left(\mathsf{/.f64}\left(c, b\right), b\right)\right), \left(\frac{\frac{2}{3} \cdot 1}{a}\right)\right), \left(\mathsf{neg}\left(b\right)\right)\right) \]
      12. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\frac{-1}{2}, \mathsf{/.f64}\left(\mathsf{/.f64}\left(c, b\right), b\right)\right), \left(\frac{\frac{2}{3}}{a}\right)\right), \left(\mathsf{neg}\left(b\right)\right)\right) \]
      13. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\frac{-1}{2}, \mathsf{/.f64}\left(\mathsf{/.f64}\left(c, b\right), b\right)\right), \mathsf{/.f64}\left(\frac{2}{3}, a\right)\right), \left(\mathsf{neg}\left(b\right)\right)\right) \]
      14. neg-sub0N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\frac{-1}{2}, \mathsf{/.f64}\left(\mathsf{/.f64}\left(c, b\right), b\right)\right), \mathsf{/.f64}\left(\frac{2}{3}, a\right)\right), \left(0 - \color{blue}{b}\right)\right) \]
      15. --lowering--.f6497.4%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\frac{-1}{2}, \mathsf{/.f64}\left(\mathsf{/.f64}\left(c, b\right), b\right)\right), \mathsf{/.f64}\left(\frac{2}{3}, a\right)\right), \mathsf{\_.f64}\left(0, \color{blue}{b}\right)\right) \]
    5. Simplified97.4%

      \[\leadsto \color{blue}{\left(-0.5 \cdot \frac{\frac{c}{b}}{b} + \frac{0.6666666666666666}{a}\right) \cdot \left(0 - b\right)} \]

    if -1.35000000000000003e154 < b < 3.19999999999999977e-75

    1. Initial program 85.6%

      \[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a} \]
    2. Add Preprocessing

    if 3.19999999999999977e-75 < b

    1. Initial program 17.5%

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\left(c \cdot \frac{-1}{2}\right), b\right) \]
      4. *-lowering-*.f6483.4%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c, \frac{-1}{2}\right), b\right) \]
    5. Simplified83.4%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -1.35 \cdot 10^{+154}:\\ \;\;\;\;b \cdot \left(\frac{\frac{c}{b}}{b} \cdot \left(0 - -0.5\right) - \frac{0.6666666666666666}{a}\right)\\ \mathbf{elif}\;b \leq 3.2 \cdot 10^{-75}:\\ \;\;\;\;\frac{\sqrt{b \cdot b - c \cdot \left(a \cdot 3\right)} - b}{a \cdot 3}\\ \mathbf{else}:\\ \;\;\;\;\frac{-0.5 \cdot c}{b}\\ \end{array} \]
  5. Add Preprocessing

Alternative 2: 85.6% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq -1 \cdot 10^{+154}:\\ \;\;\;\;b \cdot \left(\frac{\frac{c}{b}}{b} \cdot \left(0 - -0.5\right) - \frac{0.6666666666666666}{a}\right)\\ \mathbf{elif}\;b \leq 7.2 \cdot 10^{-76}:\\ \;\;\;\;\frac{\sqrt{b \cdot b + a \cdot \left(c \cdot -3\right)} - b}{a \cdot 3}\\ \mathbf{else}:\\ \;\;\;\;\frac{-0.5 \cdot c}{b}\\ \end{array} \end{array} \]
(FPCore (a b c)
 :precision binary64
 (if (<= b -1e+154)
   (* b (- (* (/ (/ c b) b) (- 0.0 -0.5)) (/ 0.6666666666666666 a)))
   (if (<= b 7.2e-76)
     (/ (- (sqrt (+ (* b b) (* a (* c -3.0)))) b) (* a 3.0))
     (/ (* -0.5 c) b))))
double code(double a, double b, double c) {
	double tmp;
	if (b <= -1e+154) {
		tmp = b * ((((c / b) / b) * (0.0 - -0.5)) - (0.6666666666666666 / a));
	} else if (b <= 7.2e-76) {
		tmp = (sqrt(((b * b) + (a * (c * -3.0)))) - b) / (a * 3.0);
	} else {
		tmp = (-0.5 * c) / b;
	}
	return tmp;
}
real(8) function code(a, b, c)
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8) :: tmp
    if (b <= (-1d+154)) then
        tmp = b * ((((c / b) / b) * (0.0d0 - (-0.5d0))) - (0.6666666666666666d0 / a))
    else if (b <= 7.2d-76) then
        tmp = (sqrt(((b * b) + (a * (c * (-3.0d0))))) - b) / (a * 3.0d0)
    else
        tmp = ((-0.5d0) * c) / b
    end if
    code = tmp
end function
public static double code(double a, double b, double c) {
	double tmp;
	if (b <= -1e+154) {
		tmp = b * ((((c / b) / b) * (0.0 - -0.5)) - (0.6666666666666666 / a));
	} else if (b <= 7.2e-76) {
		tmp = (Math.sqrt(((b * b) + (a * (c * -3.0)))) - b) / (a * 3.0);
	} else {
		tmp = (-0.5 * c) / b;
	}
	return tmp;
}
def code(a, b, c):
	tmp = 0
	if b <= -1e+154:
		tmp = b * ((((c / b) / b) * (0.0 - -0.5)) - (0.6666666666666666 / a))
	elif b <= 7.2e-76:
		tmp = (math.sqrt(((b * b) + (a * (c * -3.0)))) - b) / (a * 3.0)
	else:
		tmp = (-0.5 * c) / b
	return tmp
function code(a, b, c)
	tmp = 0.0
	if (b <= -1e+154)
		tmp = Float64(b * Float64(Float64(Float64(Float64(c / b) / b) * Float64(0.0 - -0.5)) - Float64(0.6666666666666666 / a)));
	elseif (b <= 7.2e-76)
		tmp = Float64(Float64(sqrt(Float64(Float64(b * b) + Float64(a * Float64(c * -3.0)))) - b) / Float64(a * 3.0));
	else
		tmp = Float64(Float64(-0.5 * c) / b);
	end
	return tmp
end
function tmp_2 = code(a, b, c)
	tmp = 0.0;
	if (b <= -1e+154)
		tmp = b * ((((c / b) / b) * (0.0 - -0.5)) - (0.6666666666666666 / a));
	elseif (b <= 7.2e-76)
		tmp = (sqrt(((b * b) + (a * (c * -3.0)))) - b) / (a * 3.0);
	else
		tmp = (-0.5 * c) / b;
	end
	tmp_2 = tmp;
end
code[a_, b_, c_] := If[LessEqual[b, -1e+154], N[(b * N[(N[(N[(N[(c / b), $MachinePrecision] / b), $MachinePrecision] * N[(0.0 - -0.5), $MachinePrecision]), $MachinePrecision] - N[(0.6666666666666666 / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 7.2e-76], N[(N[(N[Sqrt[N[(N[(b * b), $MachinePrecision] + N[(a * N[(c * -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision] / N[(a * 3.0), $MachinePrecision]), $MachinePrecision], N[(N[(-0.5 * c), $MachinePrecision] / b), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;b \leq -1 \cdot 10^{+154}:\\
\;\;\;\;b \cdot \left(\frac{\frac{c}{b}}{b} \cdot \left(0 - -0.5\right) - \frac{0.6666666666666666}{a}\right)\\

\mathbf{elif}\;b \leq 7.2 \cdot 10^{-76}:\\
\;\;\;\;\frac{\sqrt{b \cdot b + a \cdot \left(c \cdot -3\right)} - b}{a \cdot 3}\\

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


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

    1. Initial program 44.4%

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

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

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

        \[\leadsto \mathsf{neg}\left(\left(\frac{-1}{2} \cdot \frac{c}{{b}^{2}} + \frac{2}{3} \cdot \frac{1}{a}\right) \cdot b\right) \]
      3. distribute-rgt-neg-inN/A

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\frac{-1}{2}, \left(\frac{c}{{b}^{2}}\right)\right), \left(\frac{2}{3} \cdot \frac{1}{a}\right)\right), \left(\mathsf{neg}\left(b\right)\right)\right) \]
      7. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\frac{-1}{2}, \left(\frac{c}{b \cdot b}\right)\right), \left(\frac{2}{3} \cdot \frac{1}{a}\right)\right), \left(\mathsf{neg}\left(b\right)\right)\right) \]
      8. associate-/r*N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\frac{-1}{2}, \left(\frac{\frac{c}{b}}{b}\right)\right), \left(\frac{2}{3} \cdot \frac{1}{a}\right)\right), \left(\mathsf{neg}\left(b\right)\right)\right) \]
      9. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\frac{-1}{2}, \mathsf{/.f64}\left(\left(\frac{c}{b}\right), b\right)\right), \left(\frac{2}{3} \cdot \frac{1}{a}\right)\right), \left(\mathsf{neg}\left(b\right)\right)\right) \]
      10. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\frac{-1}{2}, \mathsf{/.f64}\left(\mathsf{/.f64}\left(c, b\right), b\right)\right), \left(\frac{2}{3} \cdot \frac{1}{a}\right)\right), \left(\mathsf{neg}\left(b\right)\right)\right) \]
      11. associate-*r/N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\frac{-1}{2}, \mathsf{/.f64}\left(\mathsf{/.f64}\left(c, b\right), b\right)\right), \left(\frac{\frac{2}{3} \cdot 1}{a}\right)\right), \left(\mathsf{neg}\left(b\right)\right)\right) \]
      12. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\frac{-1}{2}, \mathsf{/.f64}\left(\mathsf{/.f64}\left(c, b\right), b\right)\right), \left(\frac{\frac{2}{3}}{a}\right)\right), \left(\mathsf{neg}\left(b\right)\right)\right) \]
      13. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\frac{-1}{2}, \mathsf{/.f64}\left(\mathsf{/.f64}\left(c, b\right), b\right)\right), \mathsf{/.f64}\left(\frac{2}{3}, a\right)\right), \left(\mathsf{neg}\left(b\right)\right)\right) \]
      14. neg-sub0N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\frac{-1}{2}, \mathsf{/.f64}\left(\mathsf{/.f64}\left(c, b\right), b\right)\right), \mathsf{/.f64}\left(\frac{2}{3}, a\right)\right), \left(0 - \color{blue}{b}\right)\right) \]
      15. --lowering--.f6497.4%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\frac{-1}{2}, \mathsf{/.f64}\left(\mathsf{/.f64}\left(c, b\right), b\right)\right), \mathsf{/.f64}\left(\frac{2}{3}, a\right)\right), \mathsf{\_.f64}\left(0, \color{blue}{b}\right)\right) \]
    5. Simplified97.4%

      \[\leadsto \color{blue}{\left(-0.5 \cdot \frac{\frac{c}{b}}{b} + \frac{0.6666666666666666}{a}\right) \cdot \left(0 - b\right)} \]

    if -1.00000000000000004e154 < b < 7.2000000000000001e-76

    1. Initial program 85.6%

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

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

        \[\leadsto \mathsf{/.f64}\left(\left(\sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c} + \left(\mathsf{neg}\left(b\right)\right)\right), \left(\color{blue}{3} \cdot a\right)\right) \]
      3. unsub-negN/A

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\left(\sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}\right), b\right), \left(\color{blue}{3} \cdot a\right)\right) \]
      5. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\left(b \cdot b - \left(3 \cdot a\right) \cdot c\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      6. sub-negN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\left(b \cdot b + \left(\mathsf{neg}\left(\left(3 \cdot a\right) \cdot c\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      7. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\left(b \cdot b\right), \left(\mathsf{neg}\left(\left(3 \cdot a\right) \cdot c\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(\mathsf{neg}\left(\left(3 \cdot a\right) \cdot c\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      9. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(\mathsf{neg}\left(\left(a \cdot 3\right) \cdot c\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      10. associate-*l*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(\mathsf{neg}\left(a \cdot \left(3 \cdot c\right)\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      11. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(a \cdot \left(\mathsf{neg}\left(3 \cdot c\right)\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      12. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(a \cdot \left(\mathsf{neg}\left(c \cdot 3\right)\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      13. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(a, \left(\mathsf{neg}\left(c \cdot 3\right)\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      14. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(a, \left(c \cdot \left(\mathsf{neg}\left(3\right)\right)\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      15. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(c, \left(\mathsf{neg}\left(3\right)\right)\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      16. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(c, -3\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      17. *-lowering-*.f6485.6%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(c, -3\right)\right)\right)\right), b\right), \mathsf{*.f64}\left(3, \color{blue}{a}\right)\right) \]
    3. Simplified85.6%

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

    if 7.2000000000000001e-76 < b

    1. Initial program 17.5%

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\left(c \cdot \frac{-1}{2}\right), b\right) \]
      4. *-lowering-*.f6483.4%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c, \frac{-1}{2}\right), b\right) \]
    5. Simplified83.4%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -1 \cdot 10^{+154}:\\ \;\;\;\;b \cdot \left(\frac{\frac{c}{b}}{b} \cdot \left(0 - -0.5\right) - \frac{0.6666666666666666}{a}\right)\\ \mathbf{elif}\;b \leq 7.2 \cdot 10^{-76}:\\ \;\;\;\;\frac{\sqrt{b \cdot b + a \cdot \left(c \cdot -3\right)} - b}{a \cdot 3}\\ \mathbf{else}:\\ \;\;\;\;\frac{-0.5 \cdot c}{b}\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 85.6% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq -1 \cdot 10^{+154}:\\ \;\;\;\;b \cdot \left(\frac{\frac{c}{b}}{b} \cdot \left(0 - -0.5\right) - \frac{0.6666666666666666}{a}\right)\\ \mathbf{elif}\;b \leq 6 \cdot 10^{-75}:\\ \;\;\;\;\left(\sqrt{b \cdot b + a \cdot \left(c \cdot -3\right)} - b\right) \cdot \frac{0.3333333333333333}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{-0.5 \cdot c}{b}\\ \end{array} \end{array} \]
(FPCore (a b c)
 :precision binary64
 (if (<= b -1e+154)
   (* b (- (* (/ (/ c b) b) (- 0.0 -0.5)) (/ 0.6666666666666666 a)))
   (if (<= b 6e-75)
     (* (- (sqrt (+ (* b b) (* a (* c -3.0)))) b) (/ 0.3333333333333333 a))
     (/ (* -0.5 c) b))))
double code(double a, double b, double c) {
	double tmp;
	if (b <= -1e+154) {
		tmp = b * ((((c / b) / b) * (0.0 - -0.5)) - (0.6666666666666666 / a));
	} else if (b <= 6e-75) {
		tmp = (sqrt(((b * b) + (a * (c * -3.0)))) - b) * (0.3333333333333333 / a);
	} else {
		tmp = (-0.5 * c) / b;
	}
	return tmp;
}
real(8) function code(a, b, c)
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8) :: tmp
    if (b <= (-1d+154)) then
        tmp = b * ((((c / b) / b) * (0.0d0 - (-0.5d0))) - (0.6666666666666666d0 / a))
    else if (b <= 6d-75) then
        tmp = (sqrt(((b * b) + (a * (c * (-3.0d0))))) - b) * (0.3333333333333333d0 / a)
    else
        tmp = ((-0.5d0) * c) / b
    end if
    code = tmp
end function
public static double code(double a, double b, double c) {
	double tmp;
	if (b <= -1e+154) {
		tmp = b * ((((c / b) / b) * (0.0 - -0.5)) - (0.6666666666666666 / a));
	} else if (b <= 6e-75) {
		tmp = (Math.sqrt(((b * b) + (a * (c * -3.0)))) - b) * (0.3333333333333333 / a);
	} else {
		tmp = (-0.5 * c) / b;
	}
	return tmp;
}
def code(a, b, c):
	tmp = 0
	if b <= -1e+154:
		tmp = b * ((((c / b) / b) * (0.0 - -0.5)) - (0.6666666666666666 / a))
	elif b <= 6e-75:
		tmp = (math.sqrt(((b * b) + (a * (c * -3.0)))) - b) * (0.3333333333333333 / a)
	else:
		tmp = (-0.5 * c) / b
	return tmp
function code(a, b, c)
	tmp = 0.0
	if (b <= -1e+154)
		tmp = Float64(b * Float64(Float64(Float64(Float64(c / b) / b) * Float64(0.0 - -0.5)) - Float64(0.6666666666666666 / a)));
	elseif (b <= 6e-75)
		tmp = Float64(Float64(sqrt(Float64(Float64(b * b) + Float64(a * Float64(c * -3.0)))) - b) * Float64(0.3333333333333333 / a));
	else
		tmp = Float64(Float64(-0.5 * c) / b);
	end
	return tmp
end
function tmp_2 = code(a, b, c)
	tmp = 0.0;
	if (b <= -1e+154)
		tmp = b * ((((c / b) / b) * (0.0 - -0.5)) - (0.6666666666666666 / a));
	elseif (b <= 6e-75)
		tmp = (sqrt(((b * b) + (a * (c * -3.0)))) - b) * (0.3333333333333333 / a);
	else
		tmp = (-0.5 * c) / b;
	end
	tmp_2 = tmp;
end
code[a_, b_, c_] := If[LessEqual[b, -1e+154], N[(b * N[(N[(N[(N[(c / b), $MachinePrecision] / b), $MachinePrecision] * N[(0.0 - -0.5), $MachinePrecision]), $MachinePrecision] - N[(0.6666666666666666 / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 6e-75], N[(N[(N[Sqrt[N[(N[(b * b), $MachinePrecision] + N[(a * N[(c * -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision] * N[(0.3333333333333333 / a), $MachinePrecision]), $MachinePrecision], N[(N[(-0.5 * c), $MachinePrecision] / b), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;b \leq -1 \cdot 10^{+154}:\\
\;\;\;\;b \cdot \left(\frac{\frac{c}{b}}{b} \cdot \left(0 - -0.5\right) - \frac{0.6666666666666666}{a}\right)\\

\mathbf{elif}\;b \leq 6 \cdot 10^{-75}:\\
\;\;\;\;\left(\sqrt{b \cdot b + a \cdot \left(c \cdot -3\right)} - b\right) \cdot \frac{0.3333333333333333}{a}\\

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


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

    1. Initial program 44.4%

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

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

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

        \[\leadsto \mathsf{neg}\left(\left(\frac{-1}{2} \cdot \frac{c}{{b}^{2}} + \frac{2}{3} \cdot \frac{1}{a}\right) \cdot b\right) \]
      3. distribute-rgt-neg-inN/A

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\frac{-1}{2}, \left(\frac{c}{{b}^{2}}\right)\right), \left(\frac{2}{3} \cdot \frac{1}{a}\right)\right), \left(\mathsf{neg}\left(b\right)\right)\right) \]
      7. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\frac{-1}{2}, \left(\frac{c}{b \cdot b}\right)\right), \left(\frac{2}{3} \cdot \frac{1}{a}\right)\right), \left(\mathsf{neg}\left(b\right)\right)\right) \]
      8. associate-/r*N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\frac{-1}{2}, \left(\frac{\frac{c}{b}}{b}\right)\right), \left(\frac{2}{3} \cdot \frac{1}{a}\right)\right), \left(\mathsf{neg}\left(b\right)\right)\right) \]
      9. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\frac{-1}{2}, \mathsf{/.f64}\left(\left(\frac{c}{b}\right), b\right)\right), \left(\frac{2}{3} \cdot \frac{1}{a}\right)\right), \left(\mathsf{neg}\left(b\right)\right)\right) \]
      10. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\frac{-1}{2}, \mathsf{/.f64}\left(\mathsf{/.f64}\left(c, b\right), b\right)\right), \left(\frac{2}{3} \cdot \frac{1}{a}\right)\right), \left(\mathsf{neg}\left(b\right)\right)\right) \]
      11. associate-*r/N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\frac{-1}{2}, \mathsf{/.f64}\left(\mathsf{/.f64}\left(c, b\right), b\right)\right), \left(\frac{\frac{2}{3} \cdot 1}{a}\right)\right), \left(\mathsf{neg}\left(b\right)\right)\right) \]
      12. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\frac{-1}{2}, \mathsf{/.f64}\left(\mathsf{/.f64}\left(c, b\right), b\right)\right), \left(\frac{\frac{2}{3}}{a}\right)\right), \left(\mathsf{neg}\left(b\right)\right)\right) \]
      13. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\frac{-1}{2}, \mathsf{/.f64}\left(\mathsf{/.f64}\left(c, b\right), b\right)\right), \mathsf{/.f64}\left(\frac{2}{3}, a\right)\right), \left(\mathsf{neg}\left(b\right)\right)\right) \]
      14. neg-sub0N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\frac{-1}{2}, \mathsf{/.f64}\left(\mathsf{/.f64}\left(c, b\right), b\right)\right), \mathsf{/.f64}\left(\frac{2}{3}, a\right)\right), \left(0 - \color{blue}{b}\right)\right) \]
      15. --lowering--.f6497.4%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\frac{-1}{2}, \mathsf{/.f64}\left(\mathsf{/.f64}\left(c, b\right), b\right)\right), \mathsf{/.f64}\left(\frac{2}{3}, a\right)\right), \mathsf{\_.f64}\left(0, \color{blue}{b}\right)\right) \]
    5. Simplified97.4%

      \[\leadsto \color{blue}{\left(-0.5 \cdot \frac{\frac{c}{b}}{b} + \frac{0.6666666666666666}{a}\right) \cdot \left(0 - b\right)} \]

    if -1.00000000000000004e154 < b < 5.9999999999999997e-75

    1. Initial program 85.6%

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(\frac{1}{3}\right), a\right), \left(\color{blue}{\left(\mathsf{neg}\left(b\right)\right)} + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}\right)\right) \]
      6. metadata-evalN/A

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\frac{1}{3}, a\right), \left(\sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c} - \color{blue}{b}\right)\right) \]
      9. --lowering--.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\frac{1}{3}, a\right), \mathsf{\_.f64}\left(\left(\sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}\right), \color{blue}{b}\right)\right) \]
    4. Applied egg-rr85.5%

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

    if 5.9999999999999997e-75 < b

    1. Initial program 17.5%

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\left(c \cdot \frac{-1}{2}\right), b\right) \]
      4. *-lowering-*.f6483.4%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c, \frac{-1}{2}\right), b\right) \]
    5. Simplified83.4%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -1 \cdot 10^{+154}:\\ \;\;\;\;b \cdot \left(\frac{\frac{c}{b}}{b} \cdot \left(0 - -0.5\right) - \frac{0.6666666666666666}{a}\right)\\ \mathbf{elif}\;b \leq 6 \cdot 10^{-75}:\\ \;\;\;\;\left(\sqrt{b \cdot b + a \cdot \left(c \cdot -3\right)} - b\right) \cdot \frac{0.3333333333333333}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{-0.5 \cdot c}{b}\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 80.2% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq -7 \cdot 10^{-142}:\\ \;\;\;\;\frac{a \cdot \left(\frac{c}{b} \cdot 1.5 - \frac{b}{a}\right) - b}{a \cdot 3}\\ \mathbf{elif}\;b \leq 6 \cdot 10^{-75}:\\ \;\;\;\;\frac{\sqrt{c \cdot \left(a \cdot -3\right)} - b}{a \cdot 3}\\ \mathbf{else}:\\ \;\;\;\;\frac{-0.5 \cdot c}{b}\\ \end{array} \end{array} \]
(FPCore (a b c)
 :precision binary64
 (if (<= b -7e-142)
   (/ (- (* a (- (* (/ c b) 1.5) (/ b a))) b) (* a 3.0))
   (if (<= b 6e-75)
     (/ (- (sqrt (* c (* a -3.0))) b) (* a 3.0))
     (/ (* -0.5 c) b))))
double code(double a, double b, double c) {
	double tmp;
	if (b <= -7e-142) {
		tmp = ((a * (((c / b) * 1.5) - (b / a))) - b) / (a * 3.0);
	} else if (b <= 6e-75) {
		tmp = (sqrt((c * (a * -3.0))) - b) / (a * 3.0);
	} else {
		tmp = (-0.5 * c) / b;
	}
	return tmp;
}
real(8) function code(a, b, c)
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8) :: tmp
    if (b <= (-7d-142)) then
        tmp = ((a * (((c / b) * 1.5d0) - (b / a))) - b) / (a * 3.0d0)
    else if (b <= 6d-75) then
        tmp = (sqrt((c * (a * (-3.0d0)))) - b) / (a * 3.0d0)
    else
        tmp = ((-0.5d0) * c) / b
    end if
    code = tmp
end function
public static double code(double a, double b, double c) {
	double tmp;
	if (b <= -7e-142) {
		tmp = ((a * (((c / b) * 1.5) - (b / a))) - b) / (a * 3.0);
	} else if (b <= 6e-75) {
		tmp = (Math.sqrt((c * (a * -3.0))) - b) / (a * 3.0);
	} else {
		tmp = (-0.5 * c) / b;
	}
	return tmp;
}
def code(a, b, c):
	tmp = 0
	if b <= -7e-142:
		tmp = ((a * (((c / b) * 1.5) - (b / a))) - b) / (a * 3.0)
	elif b <= 6e-75:
		tmp = (math.sqrt((c * (a * -3.0))) - b) / (a * 3.0)
	else:
		tmp = (-0.5 * c) / b
	return tmp
function code(a, b, c)
	tmp = 0.0
	if (b <= -7e-142)
		tmp = Float64(Float64(Float64(a * Float64(Float64(Float64(c / b) * 1.5) - Float64(b / a))) - b) / Float64(a * 3.0));
	elseif (b <= 6e-75)
		tmp = Float64(Float64(sqrt(Float64(c * Float64(a * -3.0))) - b) / Float64(a * 3.0));
	else
		tmp = Float64(Float64(-0.5 * c) / b);
	end
	return tmp
end
function tmp_2 = code(a, b, c)
	tmp = 0.0;
	if (b <= -7e-142)
		tmp = ((a * (((c / b) * 1.5) - (b / a))) - b) / (a * 3.0);
	elseif (b <= 6e-75)
		tmp = (sqrt((c * (a * -3.0))) - b) / (a * 3.0);
	else
		tmp = (-0.5 * c) / b;
	end
	tmp_2 = tmp;
end
code[a_, b_, c_] := If[LessEqual[b, -7e-142], N[(N[(N[(a * N[(N[(N[(c / b), $MachinePrecision] * 1.5), $MachinePrecision] - N[(b / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - b), $MachinePrecision] / N[(a * 3.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 6e-75], N[(N[(N[Sqrt[N[(c * N[(a * -3.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision] / N[(a * 3.0), $MachinePrecision]), $MachinePrecision], N[(N[(-0.5 * c), $MachinePrecision] / b), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;b \leq -7 \cdot 10^{-142}:\\
\;\;\;\;\frac{a \cdot \left(\frac{c}{b} \cdot 1.5 - \frac{b}{a}\right) - b}{a \cdot 3}\\

\mathbf{elif}\;b \leq 6 \cdot 10^{-75}:\\
\;\;\;\;\frac{\sqrt{c \cdot \left(a \cdot -3\right)} - b}{a \cdot 3}\\

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


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

    1. Initial program 76.3%

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

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

        \[\leadsto \mathsf{/.f64}\left(\left(\sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c} + \left(\mathsf{neg}\left(b\right)\right)\right), \left(\color{blue}{3} \cdot a\right)\right) \]
      3. unsub-negN/A

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\left(\sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}\right), b\right), \left(\color{blue}{3} \cdot a\right)\right) \]
      5. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\left(b \cdot b - \left(3 \cdot a\right) \cdot c\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      6. sub-negN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\left(b \cdot b + \left(\mathsf{neg}\left(\left(3 \cdot a\right) \cdot c\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      7. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\left(b \cdot b\right), \left(\mathsf{neg}\left(\left(3 \cdot a\right) \cdot c\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(\mathsf{neg}\left(\left(3 \cdot a\right) \cdot c\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      9. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(\mathsf{neg}\left(\left(a \cdot 3\right) \cdot c\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      10. associate-*l*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(\mathsf{neg}\left(a \cdot \left(3 \cdot c\right)\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      11. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(a \cdot \left(\mathsf{neg}\left(3 \cdot c\right)\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      12. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(a \cdot \left(\mathsf{neg}\left(c \cdot 3\right)\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      13. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(a, \left(\mathsf{neg}\left(c \cdot 3\right)\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      14. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(a, \left(c \cdot \left(\mathsf{neg}\left(3\right)\right)\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      15. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(c, \left(\mathsf{neg}\left(3\right)\right)\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      16. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(c, -3\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      17. *-lowering-*.f6476.3%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(c, -3\right)\right)\right)\right), b\right), \mathsf{*.f64}\left(3, \color{blue}{a}\right)\right) \]
    3. Simplified76.3%

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

      \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\color{blue}{\left(-1 \cdot \left(b \cdot \left(1 + \frac{-3}{2} \cdot \frac{a \cdot c}{{b}^{2}}\right)\right)\right)}, b\right), \mathsf{*.f64}\left(3, a\right)\right) \]
    6. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\left(\mathsf{neg}\left(b \cdot \left(1 + \frac{-3}{2} \cdot \frac{a \cdot c}{{b}^{2}}\right)\right)\right), b\right), \mathsf{*.f64}\left(3, a\right)\right) \]
      2. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\left(\mathsf{neg}\left(\left(1 + \frac{-3}{2} \cdot \frac{a \cdot c}{{b}^{2}}\right) \cdot b\right)\right), b\right), \mathsf{*.f64}\left(3, a\right)\right) \]
      3. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\left(\left(1 + \frac{-3}{2} \cdot \frac{a \cdot c}{{b}^{2}}\right) \cdot \left(\mathsf{neg}\left(b\right)\right)\right), b\right), \mathsf{*.f64}\left(3, a\right)\right) \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\left(1 + \frac{-3}{2} \cdot \frac{a \cdot c}{{b}^{2}}\right), \left(\mathsf{neg}\left(b\right)\right)\right), b\right), \mathsf{*.f64}\left(3, a\right)\right) \]
      5. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \left(\frac{-3}{2} \cdot \frac{a \cdot c}{{b}^{2}}\right)\right), \left(\mathsf{neg}\left(b\right)\right)\right), b\right), \mathsf{*.f64}\left(3, a\right)\right) \]
      6. associate-*r/N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \left(\frac{\frac{-3}{2} \cdot \left(a \cdot c\right)}{{b}^{2}}\right)\right), \left(\mathsf{neg}\left(b\right)\right)\right), b\right), \mathsf{*.f64}\left(3, a\right)\right) \]
      7. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\left(\frac{-3}{2} \cdot \left(a \cdot c\right)\right), \left({b}^{2}\right)\right)\right), \left(\mathsf{neg}\left(b\right)\right)\right), b\right), \mathsf{*.f64}\left(3, a\right)\right) \]
      8. associate-*r*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\left(\left(\frac{-3}{2} \cdot a\right) \cdot c\right), \left({b}^{2}\right)\right)\right), \left(\mathsf{neg}\left(b\right)\right)\right), b\right), \mathsf{*.f64}\left(3, a\right)\right) \]
      9. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\left(c \cdot \left(\frac{-3}{2} \cdot a\right)\right), \left({b}^{2}\right)\right)\right), \left(\mathsf{neg}\left(b\right)\right)\right), b\right), \mathsf{*.f64}\left(3, a\right)\right) \]
      10. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\mathsf{*.f64}\left(c, \left(\frac{-3}{2} \cdot a\right)\right), \left({b}^{2}\right)\right)\right), \left(\mathsf{neg}\left(b\right)\right)\right), b\right), \mathsf{*.f64}\left(3, a\right)\right) \]
      11. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\mathsf{*.f64}\left(c, \left(a \cdot \frac{-3}{2}\right)\right), \left({b}^{2}\right)\right)\right), \left(\mathsf{neg}\left(b\right)\right)\right), b\right), \mathsf{*.f64}\left(3, a\right)\right) \]
      12. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\mathsf{*.f64}\left(c, \mathsf{*.f64}\left(a, \frac{-3}{2}\right)\right), \left({b}^{2}\right)\right)\right), \left(\mathsf{neg}\left(b\right)\right)\right), b\right), \mathsf{*.f64}\left(3, a\right)\right) \]
      13. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\mathsf{*.f64}\left(c, \mathsf{*.f64}\left(a, \frac{-3}{2}\right)\right), \left(b \cdot b\right)\right)\right), \left(\mathsf{neg}\left(b\right)\right)\right), b\right), \mathsf{*.f64}\left(3, a\right)\right) \]
      14. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\mathsf{*.f64}\left(c, \mathsf{*.f64}\left(a, \frac{-3}{2}\right)\right), \mathsf{*.f64}\left(b, b\right)\right)\right), \left(\mathsf{neg}\left(b\right)\right)\right), b\right), \mathsf{*.f64}\left(3, a\right)\right) \]
      15. neg-sub0N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\mathsf{*.f64}\left(c, \mathsf{*.f64}\left(a, \frac{-3}{2}\right)\right), \mathsf{*.f64}\left(b, b\right)\right)\right), \left(0 - b\right)\right), b\right), \mathsf{*.f64}\left(3, a\right)\right) \]
      16. --lowering--.f6490.1%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\mathsf{*.f64}\left(c, \mathsf{*.f64}\left(a, \frac{-3}{2}\right)\right), \mathsf{*.f64}\left(b, b\right)\right)\right), \mathsf{\_.f64}\left(0, b\right)\right), b\right), \mathsf{*.f64}\left(3, a\right)\right) \]
    7. Simplified90.1%

      \[\leadsto \frac{\color{blue}{\left(1 + \frac{c \cdot \left(a \cdot -1.5\right)}{b \cdot b}\right) \cdot \left(0 - b\right)} - b}{3 \cdot a} \]
    8. Taylor expanded in a around inf

      \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\color{blue}{\left(a \cdot \left(-1 \cdot \frac{b}{a} + \frac{3}{2} \cdot \frac{c}{b}\right)\right)}, b\right), \mathsf{*.f64}\left(3, a\right)\right) \]
    9. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(a, \left(-1 \cdot \frac{b}{a} + \frac{3}{2} \cdot \frac{c}{b}\right)\right), b\right), \mathsf{*.f64}\left(3, a\right)\right) \]
      2. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(a, \left(\frac{3}{2} \cdot \frac{c}{b} + -1 \cdot \frac{b}{a}\right)\right), b\right), \mathsf{*.f64}\left(3, a\right)\right) \]
      3. mul-1-negN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(a, \left(\frac{3}{2} \cdot \frac{c}{b} + \left(\mathsf{neg}\left(\frac{b}{a}\right)\right)\right)\right), b\right), \mathsf{*.f64}\left(3, a\right)\right) \]
      4. sub-negN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(a, \left(\frac{3}{2} \cdot \frac{c}{b} - \frac{b}{a}\right)\right), b\right), \mathsf{*.f64}\left(3, a\right)\right) \]
      5. --lowering--.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(a, \mathsf{\_.f64}\left(\left(\frac{3}{2} \cdot \frac{c}{b}\right), \left(\frac{b}{a}\right)\right)\right), b\right), \mathsf{*.f64}\left(3, a\right)\right) \]
      6. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(a, \mathsf{\_.f64}\left(\left(\frac{c}{b} \cdot \frac{3}{2}\right), \left(\frac{b}{a}\right)\right)\right), b\right), \mathsf{*.f64}\left(3, a\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(a, \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\left(\frac{c}{b}\right), \frac{3}{2}\right), \left(\frac{b}{a}\right)\right)\right), b\right), \mathsf{*.f64}\left(3, a\right)\right) \]
      8. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(a, \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(c, b\right), \frac{3}{2}\right), \left(\frac{b}{a}\right)\right)\right), b\right), \mathsf{*.f64}\left(3, a\right)\right) \]
      9. /-lowering-/.f6492.4%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(a, \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(c, b\right), \frac{3}{2}\right), \mathsf{/.f64}\left(b, a\right)\right)\right), b\right), \mathsf{*.f64}\left(3, a\right)\right) \]
    10. Simplified92.4%

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

    if -7.00000000000000029e-142 < b < 5.9999999999999997e-75

    1. Initial program 76.2%

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

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

        \[\leadsto \mathsf{/.f64}\left(\left(\sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c} + \left(\mathsf{neg}\left(b\right)\right)\right), \left(\color{blue}{3} \cdot a\right)\right) \]
      3. unsub-negN/A

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\left(\sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}\right), b\right), \left(\color{blue}{3} \cdot a\right)\right) \]
      5. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\left(b \cdot b - \left(3 \cdot a\right) \cdot c\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      6. sub-negN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\left(b \cdot b + \left(\mathsf{neg}\left(\left(3 \cdot a\right) \cdot c\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      7. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\left(b \cdot b\right), \left(\mathsf{neg}\left(\left(3 \cdot a\right) \cdot c\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(\mathsf{neg}\left(\left(3 \cdot a\right) \cdot c\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      9. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(\mathsf{neg}\left(\left(a \cdot 3\right) \cdot c\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      10. associate-*l*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(\mathsf{neg}\left(a \cdot \left(3 \cdot c\right)\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      11. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(a \cdot \left(\mathsf{neg}\left(3 \cdot c\right)\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      12. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(a \cdot \left(\mathsf{neg}\left(c \cdot 3\right)\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      13. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(a, \left(\mathsf{neg}\left(c \cdot 3\right)\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      14. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(a, \left(c \cdot \left(\mathsf{neg}\left(3\right)\right)\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      15. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(c, \left(\mathsf{neg}\left(3\right)\right)\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      16. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(c, -3\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      17. *-lowering-*.f6476.1%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(c, -3\right)\right)\right)\right), b\right), \mathsf{*.f64}\left(3, \color{blue}{a}\right)\right) \]
    3. Simplified76.1%

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\left(\left(-3 \cdot a\right) \cdot c\right)\right), b\right), \mathsf{*.f64}\left(3, a\right)\right) \]
      2. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\left(c \cdot \left(-3 \cdot a\right)\right)\right), b\right), \mathsf{*.f64}\left(3, a\right)\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(c, \left(-3 \cdot a\right)\right)\right), b\right), \mathsf{*.f64}\left(3, a\right)\right) \]
      4. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(c, \left(a \cdot -3\right)\right)\right), b\right), \mathsf{*.f64}\left(3, a\right)\right) \]
      5. *-lowering-*.f6474.7%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(c, \mathsf{*.f64}\left(a, -3\right)\right)\right), b\right), \mathsf{*.f64}\left(3, a\right)\right) \]
    7. Simplified74.7%

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

    if 5.9999999999999997e-75 < b

    1. Initial program 17.5%

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\left(c \cdot \frac{-1}{2}\right), b\right) \]
      4. *-lowering-*.f6483.4%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c, \frac{-1}{2}\right), b\right) \]
    5. Simplified83.4%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -7 \cdot 10^{-142}:\\ \;\;\;\;\frac{a \cdot \left(\frac{c}{b} \cdot 1.5 - \frac{b}{a}\right) - b}{a \cdot 3}\\ \mathbf{elif}\;b \leq 6 \cdot 10^{-75}:\\ \;\;\;\;\frac{\sqrt{c \cdot \left(a \cdot -3\right)} - b}{a \cdot 3}\\ \mathbf{else}:\\ \;\;\;\;\frac{-0.5 \cdot c}{b}\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 80.2% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq -7 \cdot 10^{-142}:\\ \;\;\;\;\frac{a \cdot \left(\frac{c}{b} \cdot 1.5 - \frac{b}{a}\right) - b}{a \cdot 3}\\ \mathbf{elif}\;b \leq 5.2 \cdot 10^{-76}:\\ \;\;\;\;\frac{0.3333333333333333}{a} \cdot \left(\sqrt{c \cdot \left(a \cdot -3\right)} - b\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{-0.5 \cdot c}{b}\\ \end{array} \end{array} \]
(FPCore (a b c)
 :precision binary64
 (if (<= b -7e-142)
   (/ (- (* a (- (* (/ c b) 1.5) (/ b a))) b) (* a 3.0))
   (if (<= b 5.2e-76)
     (* (/ 0.3333333333333333 a) (- (sqrt (* c (* a -3.0))) b))
     (/ (* -0.5 c) b))))
double code(double a, double b, double c) {
	double tmp;
	if (b <= -7e-142) {
		tmp = ((a * (((c / b) * 1.5) - (b / a))) - b) / (a * 3.0);
	} else if (b <= 5.2e-76) {
		tmp = (0.3333333333333333 / a) * (sqrt((c * (a * -3.0))) - b);
	} else {
		tmp = (-0.5 * c) / b;
	}
	return tmp;
}
real(8) function code(a, b, c)
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8) :: tmp
    if (b <= (-7d-142)) then
        tmp = ((a * (((c / b) * 1.5d0) - (b / a))) - b) / (a * 3.0d0)
    else if (b <= 5.2d-76) then
        tmp = (0.3333333333333333d0 / a) * (sqrt((c * (a * (-3.0d0)))) - b)
    else
        tmp = ((-0.5d0) * c) / b
    end if
    code = tmp
end function
public static double code(double a, double b, double c) {
	double tmp;
	if (b <= -7e-142) {
		tmp = ((a * (((c / b) * 1.5) - (b / a))) - b) / (a * 3.0);
	} else if (b <= 5.2e-76) {
		tmp = (0.3333333333333333 / a) * (Math.sqrt((c * (a * -3.0))) - b);
	} else {
		tmp = (-0.5 * c) / b;
	}
	return tmp;
}
def code(a, b, c):
	tmp = 0
	if b <= -7e-142:
		tmp = ((a * (((c / b) * 1.5) - (b / a))) - b) / (a * 3.0)
	elif b <= 5.2e-76:
		tmp = (0.3333333333333333 / a) * (math.sqrt((c * (a * -3.0))) - b)
	else:
		tmp = (-0.5 * c) / b
	return tmp
function code(a, b, c)
	tmp = 0.0
	if (b <= -7e-142)
		tmp = Float64(Float64(Float64(a * Float64(Float64(Float64(c / b) * 1.5) - Float64(b / a))) - b) / Float64(a * 3.0));
	elseif (b <= 5.2e-76)
		tmp = Float64(Float64(0.3333333333333333 / a) * Float64(sqrt(Float64(c * Float64(a * -3.0))) - b));
	else
		tmp = Float64(Float64(-0.5 * c) / b);
	end
	return tmp
end
function tmp_2 = code(a, b, c)
	tmp = 0.0;
	if (b <= -7e-142)
		tmp = ((a * (((c / b) * 1.5) - (b / a))) - b) / (a * 3.0);
	elseif (b <= 5.2e-76)
		tmp = (0.3333333333333333 / a) * (sqrt((c * (a * -3.0))) - b);
	else
		tmp = (-0.5 * c) / b;
	end
	tmp_2 = tmp;
end
code[a_, b_, c_] := If[LessEqual[b, -7e-142], N[(N[(N[(a * N[(N[(N[(c / b), $MachinePrecision] * 1.5), $MachinePrecision] - N[(b / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - b), $MachinePrecision] / N[(a * 3.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 5.2e-76], N[(N[(0.3333333333333333 / a), $MachinePrecision] * N[(N[Sqrt[N[(c * N[(a * -3.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision]), $MachinePrecision], N[(N[(-0.5 * c), $MachinePrecision] / b), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;b \leq -7 \cdot 10^{-142}:\\
\;\;\;\;\frac{a \cdot \left(\frac{c}{b} \cdot 1.5 - \frac{b}{a}\right) - b}{a \cdot 3}\\

\mathbf{elif}\;b \leq 5.2 \cdot 10^{-76}:\\
\;\;\;\;\frac{0.3333333333333333}{a} \cdot \left(\sqrt{c \cdot \left(a \cdot -3\right)} - b\right)\\

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


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

    1. Initial program 76.3%

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

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

        \[\leadsto \mathsf{/.f64}\left(\left(\sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c} + \left(\mathsf{neg}\left(b\right)\right)\right), \left(\color{blue}{3} \cdot a\right)\right) \]
      3. unsub-negN/A

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\left(\sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}\right), b\right), \left(\color{blue}{3} \cdot a\right)\right) \]
      5. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\left(b \cdot b - \left(3 \cdot a\right) \cdot c\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      6. sub-negN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\left(b \cdot b + \left(\mathsf{neg}\left(\left(3 \cdot a\right) \cdot c\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      7. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\left(b \cdot b\right), \left(\mathsf{neg}\left(\left(3 \cdot a\right) \cdot c\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(\mathsf{neg}\left(\left(3 \cdot a\right) \cdot c\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      9. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(\mathsf{neg}\left(\left(a \cdot 3\right) \cdot c\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      10. associate-*l*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(\mathsf{neg}\left(a \cdot \left(3 \cdot c\right)\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      11. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(a \cdot \left(\mathsf{neg}\left(3 \cdot c\right)\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      12. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(a \cdot \left(\mathsf{neg}\left(c \cdot 3\right)\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      13. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(a, \left(\mathsf{neg}\left(c \cdot 3\right)\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      14. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(a, \left(c \cdot \left(\mathsf{neg}\left(3\right)\right)\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      15. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(c, \left(\mathsf{neg}\left(3\right)\right)\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      16. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(c, -3\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      17. *-lowering-*.f6476.3%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(c, -3\right)\right)\right)\right), b\right), \mathsf{*.f64}\left(3, \color{blue}{a}\right)\right) \]
    3. Simplified76.3%

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

      \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\color{blue}{\left(-1 \cdot \left(b \cdot \left(1 + \frac{-3}{2} \cdot \frac{a \cdot c}{{b}^{2}}\right)\right)\right)}, b\right), \mathsf{*.f64}\left(3, a\right)\right) \]
    6. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\left(\mathsf{neg}\left(b \cdot \left(1 + \frac{-3}{2} \cdot \frac{a \cdot c}{{b}^{2}}\right)\right)\right), b\right), \mathsf{*.f64}\left(3, a\right)\right) \]
      2. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\left(\mathsf{neg}\left(\left(1 + \frac{-3}{2} \cdot \frac{a \cdot c}{{b}^{2}}\right) \cdot b\right)\right), b\right), \mathsf{*.f64}\left(3, a\right)\right) \]
      3. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\left(\left(1 + \frac{-3}{2} \cdot \frac{a \cdot c}{{b}^{2}}\right) \cdot \left(\mathsf{neg}\left(b\right)\right)\right), b\right), \mathsf{*.f64}\left(3, a\right)\right) \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\left(1 + \frac{-3}{2} \cdot \frac{a \cdot c}{{b}^{2}}\right), \left(\mathsf{neg}\left(b\right)\right)\right), b\right), \mathsf{*.f64}\left(3, a\right)\right) \]
      5. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \left(\frac{-3}{2} \cdot \frac{a \cdot c}{{b}^{2}}\right)\right), \left(\mathsf{neg}\left(b\right)\right)\right), b\right), \mathsf{*.f64}\left(3, a\right)\right) \]
      6. associate-*r/N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \left(\frac{\frac{-3}{2} \cdot \left(a \cdot c\right)}{{b}^{2}}\right)\right), \left(\mathsf{neg}\left(b\right)\right)\right), b\right), \mathsf{*.f64}\left(3, a\right)\right) \]
      7. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\left(\frac{-3}{2} \cdot \left(a \cdot c\right)\right), \left({b}^{2}\right)\right)\right), \left(\mathsf{neg}\left(b\right)\right)\right), b\right), \mathsf{*.f64}\left(3, a\right)\right) \]
      8. associate-*r*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\left(\left(\frac{-3}{2} \cdot a\right) \cdot c\right), \left({b}^{2}\right)\right)\right), \left(\mathsf{neg}\left(b\right)\right)\right), b\right), \mathsf{*.f64}\left(3, a\right)\right) \]
      9. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\left(c \cdot \left(\frac{-3}{2} \cdot a\right)\right), \left({b}^{2}\right)\right)\right), \left(\mathsf{neg}\left(b\right)\right)\right), b\right), \mathsf{*.f64}\left(3, a\right)\right) \]
      10. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\mathsf{*.f64}\left(c, \left(\frac{-3}{2} \cdot a\right)\right), \left({b}^{2}\right)\right)\right), \left(\mathsf{neg}\left(b\right)\right)\right), b\right), \mathsf{*.f64}\left(3, a\right)\right) \]
      11. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\mathsf{*.f64}\left(c, \left(a \cdot \frac{-3}{2}\right)\right), \left({b}^{2}\right)\right)\right), \left(\mathsf{neg}\left(b\right)\right)\right), b\right), \mathsf{*.f64}\left(3, a\right)\right) \]
      12. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\mathsf{*.f64}\left(c, \mathsf{*.f64}\left(a, \frac{-3}{2}\right)\right), \left({b}^{2}\right)\right)\right), \left(\mathsf{neg}\left(b\right)\right)\right), b\right), \mathsf{*.f64}\left(3, a\right)\right) \]
      13. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\mathsf{*.f64}\left(c, \mathsf{*.f64}\left(a, \frac{-3}{2}\right)\right), \left(b \cdot b\right)\right)\right), \left(\mathsf{neg}\left(b\right)\right)\right), b\right), \mathsf{*.f64}\left(3, a\right)\right) \]
      14. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\mathsf{*.f64}\left(c, \mathsf{*.f64}\left(a, \frac{-3}{2}\right)\right), \mathsf{*.f64}\left(b, b\right)\right)\right), \left(\mathsf{neg}\left(b\right)\right)\right), b\right), \mathsf{*.f64}\left(3, a\right)\right) \]
      15. neg-sub0N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\mathsf{*.f64}\left(c, \mathsf{*.f64}\left(a, \frac{-3}{2}\right)\right), \mathsf{*.f64}\left(b, b\right)\right)\right), \left(0 - b\right)\right), b\right), \mathsf{*.f64}\left(3, a\right)\right) \]
      16. --lowering--.f6490.1%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\mathsf{*.f64}\left(c, \mathsf{*.f64}\left(a, \frac{-3}{2}\right)\right), \mathsf{*.f64}\left(b, b\right)\right)\right), \mathsf{\_.f64}\left(0, b\right)\right), b\right), \mathsf{*.f64}\left(3, a\right)\right) \]
    7. Simplified90.1%

      \[\leadsto \frac{\color{blue}{\left(1 + \frac{c \cdot \left(a \cdot -1.5\right)}{b \cdot b}\right) \cdot \left(0 - b\right)} - b}{3 \cdot a} \]
    8. Taylor expanded in a around inf

      \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\color{blue}{\left(a \cdot \left(-1 \cdot \frac{b}{a} + \frac{3}{2} \cdot \frac{c}{b}\right)\right)}, b\right), \mathsf{*.f64}\left(3, a\right)\right) \]
    9. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(a, \left(-1 \cdot \frac{b}{a} + \frac{3}{2} \cdot \frac{c}{b}\right)\right), b\right), \mathsf{*.f64}\left(3, a\right)\right) \]
      2. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(a, \left(\frac{3}{2} \cdot \frac{c}{b} + -1 \cdot \frac{b}{a}\right)\right), b\right), \mathsf{*.f64}\left(3, a\right)\right) \]
      3. mul-1-negN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(a, \left(\frac{3}{2} \cdot \frac{c}{b} + \left(\mathsf{neg}\left(\frac{b}{a}\right)\right)\right)\right), b\right), \mathsf{*.f64}\left(3, a\right)\right) \]
      4. sub-negN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(a, \left(\frac{3}{2} \cdot \frac{c}{b} - \frac{b}{a}\right)\right), b\right), \mathsf{*.f64}\left(3, a\right)\right) \]
      5. --lowering--.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(a, \mathsf{\_.f64}\left(\left(\frac{3}{2} \cdot \frac{c}{b}\right), \left(\frac{b}{a}\right)\right)\right), b\right), \mathsf{*.f64}\left(3, a\right)\right) \]
      6. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(a, \mathsf{\_.f64}\left(\left(\frac{c}{b} \cdot \frac{3}{2}\right), \left(\frac{b}{a}\right)\right)\right), b\right), \mathsf{*.f64}\left(3, a\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(a, \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\left(\frac{c}{b}\right), \frac{3}{2}\right), \left(\frac{b}{a}\right)\right)\right), b\right), \mathsf{*.f64}\left(3, a\right)\right) \]
      8. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(a, \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(c, b\right), \frac{3}{2}\right), \left(\frac{b}{a}\right)\right)\right), b\right), \mathsf{*.f64}\left(3, a\right)\right) \]
      9. /-lowering-/.f6492.4%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(a, \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(c, b\right), \frac{3}{2}\right), \mathsf{/.f64}\left(b, a\right)\right)\right), b\right), \mathsf{*.f64}\left(3, a\right)\right) \]
    10. Simplified92.4%

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

    if -7.00000000000000029e-142 < b < 5.1999999999999999e-76

    1. Initial program 76.2%

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(\frac{1}{3}\right), a\right), \left(\color{blue}{\left(\mathsf{neg}\left(b\right)\right)} + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}\right)\right) \]
      6. metadata-evalN/A

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\frac{1}{3}, a\right), \left(\sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c} - \color{blue}{b}\right)\right) \]
      9. --lowering--.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\frac{1}{3}, a\right), \mathsf{\_.f64}\left(\left(\sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}\right), \color{blue}{b}\right)\right) \]
    4. Applied egg-rr76.1%

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\frac{1}{3}, a\right), \mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\left(\left(c \cdot a\right) \cdot -3\right)\right), b\right)\right) \]
      3. associate-*r*N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\frac{1}{3}, a\right), \mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\left(c \cdot \left(a \cdot -3\right)\right)\right), b\right)\right) \]
      4. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\frac{1}{3}, a\right), \mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\left(c \cdot \left(-3 \cdot a\right)\right)\right), b\right)\right) \]
      5. *-lowering-*.f64N/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\frac{1}{3}, a\right), \mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(c, \left(a \cdot -3\right)\right)\right), b\right)\right) \]
      7. *-lowering-*.f6474.6%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\frac{1}{3}, a\right), \mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(c, \mathsf{*.f64}\left(a, -3\right)\right)\right), b\right)\right) \]
    7. Simplified74.6%

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

    if 5.1999999999999999e-76 < b

    1. Initial program 17.5%

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\left(c \cdot \frac{-1}{2}\right), b\right) \]
      4. *-lowering-*.f6483.4%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c, \frac{-1}{2}\right), b\right) \]
    5. Simplified83.4%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -7 \cdot 10^{-142}:\\ \;\;\;\;\frac{a \cdot \left(\frac{c}{b} \cdot 1.5 - \frac{b}{a}\right) - b}{a \cdot 3}\\ \mathbf{elif}\;b \leq 5.2 \cdot 10^{-76}:\\ \;\;\;\;\frac{0.3333333333333333}{a} \cdot \left(\sqrt{c \cdot \left(a \cdot -3\right)} - b\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{-0.5 \cdot c}{b}\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 68.3% accurate, 7.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq -5 \cdot 10^{-310}:\\ \;\;\;\;\frac{b \cdot -0.6666666666666666}{a} + \frac{c \cdot 0.5}{b}\\ \mathbf{else}:\\ \;\;\;\;\frac{-0.5 \cdot c}{b}\\ \end{array} \end{array} \]
(FPCore (a b c)
 :precision binary64
 (if (<= b -5e-310)
   (+ (/ (* b -0.6666666666666666) a) (/ (* c 0.5) b))
   (/ (* -0.5 c) b)))
double code(double a, double b, double c) {
	double tmp;
	if (b <= -5e-310) {
		tmp = ((b * -0.6666666666666666) / a) + ((c * 0.5) / b);
	} else {
		tmp = (-0.5 * c) / b;
	}
	return tmp;
}
real(8) function code(a, b, c)
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8) :: tmp
    if (b <= (-5d-310)) then
        tmp = ((b * (-0.6666666666666666d0)) / a) + ((c * 0.5d0) / b)
    else
        tmp = ((-0.5d0) * c) / b
    end if
    code = tmp
end function
public static double code(double a, double b, double c) {
	double tmp;
	if (b <= -5e-310) {
		tmp = ((b * -0.6666666666666666) / a) + ((c * 0.5) / b);
	} else {
		tmp = (-0.5 * c) / b;
	}
	return tmp;
}
def code(a, b, c):
	tmp = 0
	if b <= -5e-310:
		tmp = ((b * -0.6666666666666666) / a) + ((c * 0.5) / b)
	else:
		tmp = (-0.5 * c) / b
	return tmp
function code(a, b, c)
	tmp = 0.0
	if (b <= -5e-310)
		tmp = Float64(Float64(Float64(b * -0.6666666666666666) / a) + Float64(Float64(c * 0.5) / b));
	else
		tmp = Float64(Float64(-0.5 * c) / b);
	end
	return tmp
end
function tmp_2 = code(a, b, c)
	tmp = 0.0;
	if (b <= -5e-310)
		tmp = ((b * -0.6666666666666666) / a) + ((c * 0.5) / b);
	else
		tmp = (-0.5 * c) / b;
	end
	tmp_2 = tmp;
end
code[a_, b_, c_] := If[LessEqual[b, -5e-310], N[(N[(N[(b * -0.6666666666666666), $MachinePrecision] / a), $MachinePrecision] + N[(N[(c * 0.5), $MachinePrecision] / b), $MachinePrecision]), $MachinePrecision], N[(N[(-0.5 * c), $MachinePrecision] / b), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;b \leq -5 \cdot 10^{-310}:\\
\;\;\;\;\frac{b \cdot -0.6666666666666666}{a} + \frac{c \cdot 0.5}{b}\\

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


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

    1. Initial program 78.9%

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

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

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

        \[\leadsto \mathsf{neg}\left(\left(\frac{-1}{2} \cdot \frac{c}{{b}^{2}} + \frac{2}{3} \cdot \frac{1}{a}\right) \cdot b\right) \]
      3. distribute-rgt-neg-inN/A

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\frac{-1}{2}, \left(\frac{c}{{b}^{2}}\right)\right), \left(\frac{2}{3} \cdot \frac{1}{a}\right)\right), \left(\mathsf{neg}\left(b\right)\right)\right) \]
      7. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\frac{-1}{2}, \left(\frac{c}{b \cdot b}\right)\right), \left(\frac{2}{3} \cdot \frac{1}{a}\right)\right), \left(\mathsf{neg}\left(b\right)\right)\right) \]
      8. associate-/r*N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\frac{-1}{2}, \left(\frac{\frac{c}{b}}{b}\right)\right), \left(\frac{2}{3} \cdot \frac{1}{a}\right)\right), \left(\mathsf{neg}\left(b\right)\right)\right) \]
      9. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\frac{-1}{2}, \mathsf{/.f64}\left(\left(\frac{c}{b}\right), b\right)\right), \left(\frac{2}{3} \cdot \frac{1}{a}\right)\right), \left(\mathsf{neg}\left(b\right)\right)\right) \]
      10. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\frac{-1}{2}, \mathsf{/.f64}\left(\mathsf{/.f64}\left(c, b\right), b\right)\right), \left(\frac{2}{3} \cdot \frac{1}{a}\right)\right), \left(\mathsf{neg}\left(b\right)\right)\right) \]
      11. associate-*r/N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\frac{-1}{2}, \mathsf{/.f64}\left(\mathsf{/.f64}\left(c, b\right), b\right)\right), \left(\frac{\frac{2}{3} \cdot 1}{a}\right)\right), \left(\mathsf{neg}\left(b\right)\right)\right) \]
      12. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\frac{-1}{2}, \mathsf{/.f64}\left(\mathsf{/.f64}\left(c, b\right), b\right)\right), \left(\frac{\frac{2}{3}}{a}\right)\right), \left(\mathsf{neg}\left(b\right)\right)\right) \]
      13. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\frac{-1}{2}, \mathsf{/.f64}\left(\mathsf{/.f64}\left(c, b\right), b\right)\right), \mathsf{/.f64}\left(\frac{2}{3}, a\right)\right), \left(\mathsf{neg}\left(b\right)\right)\right) \]
      14. neg-sub0N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\frac{-1}{2}, \mathsf{/.f64}\left(\mathsf{/.f64}\left(c, b\right), b\right)\right), \mathsf{/.f64}\left(\frac{2}{3}, a\right)\right), \left(0 - \color{blue}{b}\right)\right) \]
      15. --lowering--.f6472.3%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(\frac{-1}{2}, \mathsf{/.f64}\left(\mathsf{/.f64}\left(c, b\right), b\right)\right), \mathsf{/.f64}\left(\frac{2}{3}, a\right)\right), \mathsf{\_.f64}\left(0, \color{blue}{b}\right)\right) \]
    5. Simplified72.3%

      \[\leadsto \color{blue}{\left(-0.5 \cdot \frac{\frac{c}{b}}{b} + \frac{0.6666666666666666}{a}\right) \cdot \left(0 - b\right)} \]
    6. Taylor expanded in c around 0

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

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

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

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

        \[\leadsto \mathsf{+.f64}\left(\mathsf{/.f64}\left(\left(b \cdot \frac{-2}{3}\right), a\right), \left(\frac{1}{2} \cdot \frac{c}{b}\right)\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(b, \frac{-2}{3}\right), a\right), \left(\frac{1}{2} \cdot \frac{c}{b}\right)\right) \]
      6. associate-*r/N/A

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

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

        \[\leadsto \mathsf{+.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(b, \frac{-2}{3}\right), a\right), \mathsf{/.f64}\left(\left(c \cdot \frac{1}{2}\right), b\right)\right) \]
      9. *-lowering-*.f6472.5%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(b, \frac{-2}{3}\right), a\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(c, \frac{1}{2}\right), b\right)\right) \]
    8. Simplified72.5%

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

    if -4.999999999999985e-310 < b

    1. Initial program 30.5%

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\left(c \cdot \frac{-1}{2}\right), b\right) \]
      4. *-lowering-*.f6468.8%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c, \frac{-1}{2}\right), b\right) \]
    5. Simplified68.8%

      \[\leadsto \color{blue}{\frac{c \cdot -0.5}{b}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification70.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -5 \cdot 10^{-310}:\\ \;\;\;\;\frac{b \cdot -0.6666666666666666}{a} + \frac{c \cdot 0.5}{b}\\ \mathbf{else}:\\ \;\;\;\;\frac{-0.5 \cdot c}{b}\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 68.1% accurate, 11.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq 3.5 \cdot 10^{-280}:\\ \;\;\;\;\frac{b \cdot -0.6666666666666666}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{-0.5 \cdot c}{b}\\ \end{array} \end{array} \]
(FPCore (a b c)
 :precision binary64
 (if (<= b 3.5e-280) (/ (* b -0.6666666666666666) a) (/ (* -0.5 c) b)))
double code(double a, double b, double c) {
	double tmp;
	if (b <= 3.5e-280) {
		tmp = (b * -0.6666666666666666) / a;
	} else {
		tmp = (-0.5 * c) / b;
	}
	return tmp;
}
real(8) function code(a, b, c)
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8) :: tmp
    if (b <= 3.5d-280) then
        tmp = (b * (-0.6666666666666666d0)) / a
    else
        tmp = ((-0.5d0) * c) / b
    end if
    code = tmp
end function
public static double code(double a, double b, double c) {
	double tmp;
	if (b <= 3.5e-280) {
		tmp = (b * -0.6666666666666666) / a;
	} else {
		tmp = (-0.5 * c) / b;
	}
	return tmp;
}
def code(a, b, c):
	tmp = 0
	if b <= 3.5e-280:
		tmp = (b * -0.6666666666666666) / a
	else:
		tmp = (-0.5 * c) / b
	return tmp
function code(a, b, c)
	tmp = 0.0
	if (b <= 3.5e-280)
		tmp = Float64(Float64(b * -0.6666666666666666) / a);
	else
		tmp = Float64(Float64(-0.5 * c) / b);
	end
	return tmp
end
function tmp_2 = code(a, b, c)
	tmp = 0.0;
	if (b <= 3.5e-280)
		tmp = (b * -0.6666666666666666) / a;
	else
		tmp = (-0.5 * c) / b;
	end
	tmp_2 = tmp;
end
code[a_, b_, c_] := If[LessEqual[b, 3.5e-280], N[(N[(b * -0.6666666666666666), $MachinePrecision] / a), $MachinePrecision], N[(N[(-0.5 * c), $MachinePrecision] / b), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;b \leq 3.5 \cdot 10^{-280}:\\
\;\;\;\;\frac{b \cdot -0.6666666666666666}{a}\\

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


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

    1. Initial program 78.6%

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\left(b \cdot \frac{-2}{3}\right), a\right) \]
      4. *-lowering-*.f6470.7%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(b, \frac{-2}{3}\right), a\right) \]
    5. Simplified70.7%

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

    if 3.5000000000000001e-280 < b

    1. Initial program 29.7%

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\left(c \cdot \frac{-1}{2}\right), b\right) \]
      4. *-lowering-*.f6470.3%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c, \frac{-1}{2}\right), b\right) \]
    5. Simplified70.3%

      \[\leadsto \color{blue}{\frac{c \cdot -0.5}{b}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification70.5%

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq 3.5 \cdot 10^{-280}:\\ \;\;\;\;\frac{b \cdot -0.6666666666666666}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{-0.5 \cdot c}{b}\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 68.0% accurate, 11.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq 3.5 \cdot 10^{-280}:\\ \;\;\;\;\frac{b \cdot -0.6666666666666666}{a}\\ \mathbf{else}:\\ \;\;\;\;c \cdot \frac{-0.5}{b}\\ \end{array} \end{array} \]
(FPCore (a b c)
 :precision binary64
 (if (<= b 3.5e-280) (/ (* b -0.6666666666666666) a) (* c (/ -0.5 b))))
double code(double a, double b, double c) {
	double tmp;
	if (b <= 3.5e-280) {
		tmp = (b * -0.6666666666666666) / a;
	} else {
		tmp = c * (-0.5 / b);
	}
	return tmp;
}
real(8) function code(a, b, c)
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8) :: tmp
    if (b <= 3.5d-280) then
        tmp = (b * (-0.6666666666666666d0)) / a
    else
        tmp = c * ((-0.5d0) / b)
    end if
    code = tmp
end function
public static double code(double a, double b, double c) {
	double tmp;
	if (b <= 3.5e-280) {
		tmp = (b * -0.6666666666666666) / a;
	} else {
		tmp = c * (-0.5 / b);
	}
	return tmp;
}
def code(a, b, c):
	tmp = 0
	if b <= 3.5e-280:
		tmp = (b * -0.6666666666666666) / a
	else:
		tmp = c * (-0.5 / b)
	return tmp
function code(a, b, c)
	tmp = 0.0
	if (b <= 3.5e-280)
		tmp = Float64(Float64(b * -0.6666666666666666) / a);
	else
		tmp = Float64(c * Float64(-0.5 / b));
	end
	return tmp
end
function tmp_2 = code(a, b, c)
	tmp = 0.0;
	if (b <= 3.5e-280)
		tmp = (b * -0.6666666666666666) / a;
	else
		tmp = c * (-0.5 / b);
	end
	tmp_2 = tmp;
end
code[a_, b_, c_] := If[LessEqual[b, 3.5e-280], N[(N[(b * -0.6666666666666666), $MachinePrecision] / a), $MachinePrecision], N[(c * N[(-0.5 / b), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;b \leq 3.5 \cdot 10^{-280}:\\
\;\;\;\;\frac{b \cdot -0.6666666666666666}{a}\\

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


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

    1. Initial program 78.6%

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\left(b \cdot \frac{-2}{3}\right), a\right) \]
      4. *-lowering-*.f6470.7%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(b, \frac{-2}{3}\right), a\right) \]
    5. Simplified70.7%

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

    if 3.5000000000000001e-280 < b

    1. Initial program 29.7%

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\left(\frac{\left(\mathsf{neg}\left(b\right)\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{a}\right), \color{blue}{3}\right) \]
    4. Applied egg-rr29.6%

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

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

        \[\leadsto \mathsf{/.f64}\left(\left(\frac{\frac{-3}{2} \cdot c}{b}\right), 3\right) \]
      2. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\frac{-3}{2} \cdot c\right), b\right), 3\right) \]
      3. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(c \cdot \frac{-3}{2}\right), b\right), 3\right) \]
      4. *-lowering-*.f6470.0%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(c, \frac{-3}{2}\right), b\right), 3\right) \]
    7. Simplified70.0%

      \[\leadsto \frac{\color{blue}{\frac{c \cdot -1.5}{b}}}{3} \]
    8. Step-by-step derivation
      1. div-invN/A

        \[\leadsto \frac{c \cdot \frac{-3}{2}}{b} \cdot \color{blue}{\frac{1}{3}} \]
      2. metadata-evalN/A

        \[\leadsto \frac{c \cdot \frac{-3}{2}}{b} \cdot \frac{1}{3} \]
      3. associate-*l/N/A

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

        \[\leadsto \mathsf{/.f64}\left(\left(\left(c \cdot \frac{-3}{2}\right) \cdot \frac{1}{3}\right), \color{blue}{b}\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(c \cdot \frac{-3}{2}\right), \frac{1}{3}\right), b\right) \]
      6. *-lowering-*.f6470.0%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(c, \frac{-3}{2}\right), \frac{1}{3}\right), b\right) \]
    9. Applied egg-rr70.0%

      \[\leadsto \color{blue}{\frac{\left(c \cdot -1.5\right) \cdot 0.3333333333333333}{b}} \]
    10. Step-by-step derivation
      1. associate-*l*N/A

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

        \[\leadsto \frac{c \cdot \frac{-1}{2}}{b} \]
      3. metadata-evalN/A

        \[\leadsto \frac{c \cdot \left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}{b} \]
      4. associate-/l*N/A

        \[\leadsto c \cdot \color{blue}{\frac{\mathsf{neg}\left(\frac{1}{2}\right)}{b}} \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(c, \color{blue}{\left(\frac{\mathsf{neg}\left(\frac{1}{2}\right)}{b}\right)}\right) \]
      6. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(c, \mathsf{/.f64}\left(\left(\mathsf{neg}\left(\frac{1}{2}\right)\right), \color{blue}{b}\right)\right) \]
      7. metadata-eval70.0%

        \[\leadsto \mathsf{*.f64}\left(c, \mathsf{/.f64}\left(\frac{-1}{2}, b\right)\right) \]
    11. Applied egg-rr70.0%

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

Alternative 9: 68.0% accurate, 11.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq 3 \cdot 10^{-279}:\\ \;\;\;\;b \cdot \frac{-0.6666666666666666}{a}\\ \mathbf{else}:\\ \;\;\;\;c \cdot \frac{-0.5}{b}\\ \end{array} \end{array} \]
(FPCore (a b c)
 :precision binary64
 (if (<= b 3e-279) (* b (/ -0.6666666666666666 a)) (* c (/ -0.5 b))))
double code(double a, double b, double c) {
	double tmp;
	if (b <= 3e-279) {
		tmp = b * (-0.6666666666666666 / a);
	} else {
		tmp = c * (-0.5 / b);
	}
	return tmp;
}
real(8) function code(a, b, c)
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8) :: tmp
    if (b <= 3d-279) then
        tmp = b * ((-0.6666666666666666d0) / a)
    else
        tmp = c * ((-0.5d0) / b)
    end if
    code = tmp
end function
public static double code(double a, double b, double c) {
	double tmp;
	if (b <= 3e-279) {
		tmp = b * (-0.6666666666666666 / a);
	} else {
		tmp = c * (-0.5 / b);
	}
	return tmp;
}
def code(a, b, c):
	tmp = 0
	if b <= 3e-279:
		tmp = b * (-0.6666666666666666 / a)
	else:
		tmp = c * (-0.5 / b)
	return tmp
function code(a, b, c)
	tmp = 0.0
	if (b <= 3e-279)
		tmp = Float64(b * Float64(-0.6666666666666666 / a));
	else
		tmp = Float64(c * Float64(-0.5 / b));
	end
	return tmp
end
function tmp_2 = code(a, b, c)
	tmp = 0.0;
	if (b <= 3e-279)
		tmp = b * (-0.6666666666666666 / a);
	else
		tmp = c * (-0.5 / b);
	end
	tmp_2 = tmp;
end
code[a_, b_, c_] := If[LessEqual[b, 3e-279], N[(b * N[(-0.6666666666666666 / a), $MachinePrecision]), $MachinePrecision], N[(c * N[(-0.5 / b), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;b \leq 3 \cdot 10^{-279}:\\
\;\;\;\;b \cdot \frac{-0.6666666666666666}{a}\\

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


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

    1. Initial program 78.6%

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\left(b \cdot \frac{-2}{3}\right), a\right) \]
      4. *-lowering-*.f6470.7%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(b, \frac{-2}{3}\right), a\right) \]
    5. Simplified70.7%

      \[\leadsto \color{blue}{\frac{b \cdot -0.6666666666666666}{a}} \]
    6. Step-by-step derivation
      1. associate-/l*N/A

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

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

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{\frac{-2}{3}}{a}\right), \color{blue}{b}\right) \]
      4. /-lowering-/.f6470.7%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\frac{-2}{3}, a\right), b\right) \]
    7. Applied egg-rr70.7%

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

    if 3e-279 < b

    1. Initial program 29.7%

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\left(\frac{\left(\mathsf{neg}\left(b\right)\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{a}\right), \color{blue}{3}\right) \]
    4. Applied egg-rr29.6%

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

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

        \[\leadsto \mathsf{/.f64}\left(\left(\frac{\frac{-3}{2} \cdot c}{b}\right), 3\right) \]
      2. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\frac{-3}{2} \cdot c\right), b\right), 3\right) \]
      3. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(c \cdot \frac{-3}{2}\right), b\right), 3\right) \]
      4. *-lowering-*.f6470.0%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(c, \frac{-3}{2}\right), b\right), 3\right) \]
    7. Simplified70.0%

      \[\leadsto \frac{\color{blue}{\frac{c \cdot -1.5}{b}}}{3} \]
    8. Step-by-step derivation
      1. div-invN/A

        \[\leadsto \frac{c \cdot \frac{-3}{2}}{b} \cdot \color{blue}{\frac{1}{3}} \]
      2. metadata-evalN/A

        \[\leadsto \frac{c \cdot \frac{-3}{2}}{b} \cdot \frac{1}{3} \]
      3. associate-*l/N/A

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

        \[\leadsto \mathsf{/.f64}\left(\left(\left(c \cdot \frac{-3}{2}\right) \cdot \frac{1}{3}\right), \color{blue}{b}\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(c \cdot \frac{-3}{2}\right), \frac{1}{3}\right), b\right) \]
      6. *-lowering-*.f6470.0%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(c, \frac{-3}{2}\right), \frac{1}{3}\right), b\right) \]
    9. Applied egg-rr70.0%

      \[\leadsto \color{blue}{\frac{\left(c \cdot -1.5\right) \cdot 0.3333333333333333}{b}} \]
    10. Step-by-step derivation
      1. associate-*l*N/A

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

        \[\leadsto \frac{c \cdot \frac{-1}{2}}{b} \]
      3. metadata-evalN/A

        \[\leadsto \frac{c \cdot \left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}{b} \]
      4. associate-/l*N/A

        \[\leadsto c \cdot \color{blue}{\frac{\mathsf{neg}\left(\frac{1}{2}\right)}{b}} \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(c, \color{blue}{\left(\frac{\mathsf{neg}\left(\frac{1}{2}\right)}{b}\right)}\right) \]
      6. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(c, \mathsf{/.f64}\left(\left(\mathsf{neg}\left(\frac{1}{2}\right)\right), \color{blue}{b}\right)\right) \]
      7. metadata-eval70.0%

        \[\leadsto \mathsf{*.f64}\left(c, \mathsf{/.f64}\left(\frac{-1}{2}, b\right)\right) \]
    11. Applied egg-rr70.0%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq 3 \cdot 10^{-279}:\\ \;\;\;\;b \cdot \frac{-0.6666666666666666}{a}\\ \mathbf{else}:\\ \;\;\;\;c \cdot \frac{-0.5}{b}\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 68.0% accurate, 11.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq 3.5 \cdot 10^{-280}:\\ \;\;\;\;\frac{b}{a} \cdot -0.6666666666666666\\ \mathbf{else}:\\ \;\;\;\;c \cdot \frac{-0.5}{b}\\ \end{array} \end{array} \]
(FPCore (a b c)
 :precision binary64
 (if (<= b 3.5e-280) (* (/ b a) -0.6666666666666666) (* c (/ -0.5 b))))
double code(double a, double b, double c) {
	double tmp;
	if (b <= 3.5e-280) {
		tmp = (b / a) * -0.6666666666666666;
	} else {
		tmp = c * (-0.5 / b);
	}
	return tmp;
}
real(8) function code(a, b, c)
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8) :: tmp
    if (b <= 3.5d-280) then
        tmp = (b / a) * (-0.6666666666666666d0)
    else
        tmp = c * ((-0.5d0) / b)
    end if
    code = tmp
end function
public static double code(double a, double b, double c) {
	double tmp;
	if (b <= 3.5e-280) {
		tmp = (b / a) * -0.6666666666666666;
	} else {
		tmp = c * (-0.5 / b);
	}
	return tmp;
}
def code(a, b, c):
	tmp = 0
	if b <= 3.5e-280:
		tmp = (b / a) * -0.6666666666666666
	else:
		tmp = c * (-0.5 / b)
	return tmp
function code(a, b, c)
	tmp = 0.0
	if (b <= 3.5e-280)
		tmp = Float64(Float64(b / a) * -0.6666666666666666);
	else
		tmp = Float64(c * Float64(-0.5 / b));
	end
	return tmp
end
function tmp_2 = code(a, b, c)
	tmp = 0.0;
	if (b <= 3.5e-280)
		tmp = (b / a) * -0.6666666666666666;
	else
		tmp = c * (-0.5 / b);
	end
	tmp_2 = tmp;
end
code[a_, b_, c_] := If[LessEqual[b, 3.5e-280], N[(N[(b / a), $MachinePrecision] * -0.6666666666666666), $MachinePrecision], N[(c * N[(-0.5 / b), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;b \leq 3.5 \cdot 10^{-280}:\\
\;\;\;\;\frac{b}{a} \cdot -0.6666666666666666\\

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


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

    1. Initial program 78.6%

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\left(b \cdot \frac{-2}{3}\right), a\right) \]
      4. *-lowering-*.f6470.7%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(b, \frac{-2}{3}\right), a\right) \]
    5. Simplified70.7%

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\frac{-2}{3}, \color{blue}{\left(\frac{b}{a}\right)}\right) \]
      4. /-lowering-/.f6470.6%

        \[\leadsto \mathsf{*.f64}\left(\frac{-2}{3}, \mathsf{/.f64}\left(b, \color{blue}{a}\right)\right) \]
    7. Applied egg-rr70.6%

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

    if 3.5000000000000001e-280 < b

    1. Initial program 29.7%

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\left(\frac{\left(\mathsf{neg}\left(b\right)\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{a}\right), \color{blue}{3}\right) \]
    4. Applied egg-rr29.6%

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

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

        \[\leadsto \mathsf{/.f64}\left(\left(\frac{\frac{-3}{2} \cdot c}{b}\right), 3\right) \]
      2. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\frac{-3}{2} \cdot c\right), b\right), 3\right) \]
      3. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(c \cdot \frac{-3}{2}\right), b\right), 3\right) \]
      4. *-lowering-*.f6470.0%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(c, \frac{-3}{2}\right), b\right), 3\right) \]
    7. Simplified70.0%

      \[\leadsto \frac{\color{blue}{\frac{c \cdot -1.5}{b}}}{3} \]
    8. Step-by-step derivation
      1. div-invN/A

        \[\leadsto \frac{c \cdot \frac{-3}{2}}{b} \cdot \color{blue}{\frac{1}{3}} \]
      2. metadata-evalN/A

        \[\leadsto \frac{c \cdot \frac{-3}{2}}{b} \cdot \frac{1}{3} \]
      3. associate-*l/N/A

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

        \[\leadsto \mathsf{/.f64}\left(\left(\left(c \cdot \frac{-3}{2}\right) \cdot \frac{1}{3}\right), \color{blue}{b}\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(c \cdot \frac{-3}{2}\right), \frac{1}{3}\right), b\right) \]
      6. *-lowering-*.f6470.0%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(c, \frac{-3}{2}\right), \frac{1}{3}\right), b\right) \]
    9. Applied egg-rr70.0%

      \[\leadsto \color{blue}{\frac{\left(c \cdot -1.5\right) \cdot 0.3333333333333333}{b}} \]
    10. Step-by-step derivation
      1. associate-*l*N/A

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

        \[\leadsto \frac{c \cdot \frac{-1}{2}}{b} \]
      3. metadata-evalN/A

        \[\leadsto \frac{c \cdot \left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}{b} \]
      4. associate-/l*N/A

        \[\leadsto c \cdot \color{blue}{\frac{\mathsf{neg}\left(\frac{1}{2}\right)}{b}} \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(c, \color{blue}{\left(\frac{\mathsf{neg}\left(\frac{1}{2}\right)}{b}\right)}\right) \]
      6. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(c, \mathsf{/.f64}\left(\left(\mathsf{neg}\left(\frac{1}{2}\right)\right), \color{blue}{b}\right)\right) \]
      7. metadata-eval70.0%

        \[\leadsto \mathsf{*.f64}\left(c, \mathsf{/.f64}\left(\frac{-1}{2}, b\right)\right) \]
    11. Applied egg-rr70.0%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq 3.5 \cdot 10^{-280}:\\ \;\;\;\;\frac{b}{a} \cdot -0.6666666666666666\\ \mathbf{else}:\\ \;\;\;\;c \cdot \frac{-0.5}{b}\\ \end{array} \]
  5. Add Preprocessing

Alternative 11: 35.7% accurate, 23.2× speedup?

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

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

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

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

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

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

      \[\leadsto \mathsf{/.f64}\left(\left(b \cdot \frac{-2}{3}\right), a\right) \]
    4. *-lowering-*.f6436.2%

      \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(b, \frac{-2}{3}\right), a\right) \]
  5. Simplified36.2%

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

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

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

      \[\leadsto \mathsf{*.f64}\left(\frac{-2}{3}, \color{blue}{\left(\frac{b}{a}\right)}\right) \]
    4. /-lowering-/.f6436.1%

      \[\leadsto \mathsf{*.f64}\left(\frac{-2}{3}, \mathsf{/.f64}\left(b, \color{blue}{a}\right)\right) \]
  7. Applied egg-rr36.1%

    \[\leadsto \color{blue}{-0.6666666666666666 \cdot \frac{b}{a}} \]
  8. Final simplification36.1%

    \[\leadsto \frac{b}{a} \cdot -0.6666666666666666 \]
  9. Add Preprocessing

Reproduce

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