Cubic critical

Percentage Accurate: 63.5% → 87.4%
Time: 21.6s
Alternatives: 16
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 16 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: 63.5% 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: 87.4% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;c \leq 2.65 \cdot 10^{+234}:\\ \;\;\;\;\left(b - \mathsf{hypot}\left(b, \sqrt{\left|c \cdot \left(a \cdot -3\right)\right|}\right)\right) \cdot \frac{\frac{1}{a}}{-3}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{b - \mathsf{hypot}\left(b, \sqrt{a \cdot -3} \cdot \sqrt{c}\right)}{a}}{-3}\\ \end{array} \end{array} \]
(FPCore (a b c)
 :precision binary64
 (if (<= c 2.65e+234)
   (* (- b (hypot b (sqrt (fabs (* c (* a -3.0)))))) (/ (/ 1.0 a) -3.0))
   (/ (/ (- b (hypot b (* (sqrt (* a -3.0)) (sqrt c)))) a) -3.0)))
double code(double a, double b, double c) {
	double tmp;
	if (c <= 2.65e+234) {
		tmp = (b - hypot(b, sqrt(fabs((c * (a * -3.0)))))) * ((1.0 / a) / -3.0);
	} else {
		tmp = ((b - hypot(b, (sqrt((a * -3.0)) * sqrt(c)))) / a) / -3.0;
	}
	return tmp;
}
public static double code(double a, double b, double c) {
	double tmp;
	if (c <= 2.65e+234) {
		tmp = (b - Math.hypot(b, Math.sqrt(Math.abs((c * (a * -3.0)))))) * ((1.0 / a) / -3.0);
	} else {
		tmp = ((b - Math.hypot(b, (Math.sqrt((a * -3.0)) * Math.sqrt(c)))) / a) / -3.0;
	}
	return tmp;
}
def code(a, b, c):
	tmp = 0
	if c <= 2.65e+234:
		tmp = (b - math.hypot(b, math.sqrt(math.fabs((c * (a * -3.0)))))) * ((1.0 / a) / -3.0)
	else:
		tmp = ((b - math.hypot(b, (math.sqrt((a * -3.0)) * math.sqrt(c)))) / a) / -3.0
	return tmp
function code(a, b, c)
	tmp = 0.0
	if (c <= 2.65e+234)
		tmp = Float64(Float64(b - hypot(b, sqrt(abs(Float64(c * Float64(a * -3.0)))))) * Float64(Float64(1.0 / a) / -3.0));
	else
		tmp = Float64(Float64(Float64(b - hypot(b, Float64(sqrt(Float64(a * -3.0)) * sqrt(c)))) / a) / -3.0);
	end
	return tmp
end
function tmp_2 = code(a, b, c)
	tmp = 0.0;
	if (c <= 2.65e+234)
		tmp = (b - hypot(b, sqrt(abs((c * (a * -3.0)))))) * ((1.0 / a) / -3.0);
	else
		tmp = ((b - hypot(b, (sqrt((a * -3.0)) * sqrt(c)))) / a) / -3.0;
	end
	tmp_2 = tmp;
end
code[a_, b_, c_] := If[LessEqual[c, 2.65e+234], N[(N[(b - N[Sqrt[b ^ 2 + N[Sqrt[N[Abs[N[(c * N[(a * -3.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision] * N[(N[(1.0 / a), $MachinePrecision] / -3.0), $MachinePrecision]), $MachinePrecision], N[(N[(N[(b - N[Sqrt[b ^ 2 + N[(N[Sqrt[N[(a * -3.0), $MachinePrecision]], $MachinePrecision] * N[Sqrt[c], $MachinePrecision]), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision] / -3.0), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;c \leq 2.65 \cdot 10^{+234}:\\
\;\;\;\;\left(b - \mathsf{hypot}\left(b, \sqrt{\left|c \cdot \left(a \cdot -3\right)\right|}\right)\right) \cdot \frac{\frac{1}{a}}{-3}\\

\mathbf{else}:\\
\;\;\;\;\frac{\frac{b - \mathsf{hypot}\left(b, \sqrt{a \cdot -3} \cdot \sqrt{c}\right)}{a}}{-3}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if c < 2.64999999999999999e234

    1. Initial program 67.9%

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

        \[\leadsto \frac{\left(-b\right) + \sqrt{\color{blue}{\left(-b\right) \cdot \left(-b\right)} - \left(3 \cdot a\right) \cdot c}}{3 \cdot a} \]
      2. sqr-neg67.9%

        \[\leadsto \frac{\left(-b\right) + \sqrt{\color{blue}{b \cdot b} - \left(3 \cdot a\right) \cdot c}}{3 \cdot a} \]
      3. associate-*l*67.8%

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

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

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

        \[\leadsto \left(b - \mathsf{hypot}\left(b, \sqrt{a \cdot \left(c \cdot -3\right)}\right)\right) \cdot \color{blue}{\frac{\frac{1}{a}}{-3}} \]
    7. Simplified64.6%

      \[\leadsto \color{blue}{\left(b - \mathsf{hypot}\left(b, \sqrt{a \cdot \left(c \cdot -3\right)}\right)\right) \cdot \frac{\frac{1}{a}}{-3}} \]
    8. Step-by-step derivation
      1. associate-*r*64.6%

        \[\leadsto \left(b - \mathsf{hypot}\left(b, \sqrt{\color{blue}{\left(a \cdot c\right) \cdot -3}}\right)\right) \cdot \frac{\frac{1}{a}}{-3} \]
      2. *-commutative64.6%

        \[\leadsto \left(b - \mathsf{hypot}\left(b, \sqrt{\color{blue}{-3 \cdot \left(a \cdot c\right)}}\right)\right) \cdot \frac{\frac{1}{a}}{-3} \]
      3. add-sqr-sqrt64.6%

        \[\leadsto \left(b - \mathsf{hypot}\left(b, \sqrt{\color{blue}{\sqrt{-3 \cdot \left(a \cdot c\right)} \cdot \sqrt{-3 \cdot \left(a \cdot c\right)}}}\right)\right) \cdot \frac{\frac{1}{a}}{-3} \]
      4. pow1/264.6%

        \[\leadsto \left(b - \mathsf{hypot}\left(b, \sqrt{\color{blue}{{\left(-3 \cdot \left(a \cdot c\right)\right)}^{0.5}} \cdot \sqrt{-3 \cdot \left(a \cdot c\right)}}\right)\right) \cdot \frac{\frac{1}{a}}{-3} \]
      5. pow1/264.6%

        \[\leadsto \left(b - \mathsf{hypot}\left(b, \sqrt{{\left(-3 \cdot \left(a \cdot c\right)\right)}^{0.5} \cdot \color{blue}{{\left(-3 \cdot \left(a \cdot c\right)\right)}^{0.5}}}\right)\right) \cdot \frac{\frac{1}{a}}{-3} \]
      6. pow-prod-down77.9%

        \[\leadsto \left(b - \mathsf{hypot}\left(b, \sqrt{\color{blue}{{\left(\left(-3 \cdot \left(a \cdot c\right)\right) \cdot \left(-3 \cdot \left(a \cdot c\right)\right)\right)}^{0.5}}}\right)\right) \cdot \frac{\frac{1}{a}}{-3} \]
      7. pow277.9%

        \[\leadsto \left(b - \mathsf{hypot}\left(b, \sqrt{{\color{blue}{\left({\left(-3 \cdot \left(a \cdot c\right)\right)}^{2}\right)}}^{0.5}}\right)\right) \cdot \frac{\frac{1}{a}}{-3} \]
      8. *-commutative77.9%

        \[\leadsto \left(b - \mathsf{hypot}\left(b, \sqrt{{\left({\color{blue}{\left(\left(a \cdot c\right) \cdot -3\right)}}^{2}\right)}^{0.5}}\right)\right) \cdot \frac{\frac{1}{a}}{-3} \]
      9. associate-*r*77.9%

        \[\leadsto \left(b - \mathsf{hypot}\left(b, \sqrt{{\left({\color{blue}{\left(a \cdot \left(c \cdot -3\right)\right)}}^{2}\right)}^{0.5}}\right)\right) \cdot \frac{\frac{1}{a}}{-3} \]
    9. Applied egg-rr77.9%

      \[\leadsto \left(b - \mathsf{hypot}\left(b, \sqrt{\color{blue}{{\left({\left(a \cdot \left(c \cdot -3\right)\right)}^{2}\right)}^{0.5}}}\right)\right) \cdot \frac{\frac{1}{a}}{-3} \]
    10. Step-by-step derivation
      1. unpow1/277.9%

        \[\leadsto \left(b - \mathsf{hypot}\left(b, \sqrt{\color{blue}{\sqrt{{\left(a \cdot \left(c \cdot -3\right)\right)}^{2}}}}\right)\right) \cdot \frac{\frac{1}{a}}{-3} \]
      2. unpow277.9%

        \[\leadsto \left(b - \mathsf{hypot}\left(b, \sqrt{\sqrt{\color{blue}{\left(a \cdot \left(c \cdot -3\right)\right) \cdot \left(a \cdot \left(c \cdot -3\right)\right)}}}\right)\right) \cdot \frac{\frac{1}{a}}{-3} \]
      3. rem-sqrt-square91.6%

        \[\leadsto \left(b - \mathsf{hypot}\left(b, \sqrt{\color{blue}{\left|a \cdot \left(c \cdot -3\right)\right|}}\right)\right) \cdot \frac{\frac{1}{a}}{-3} \]
      4. associate-*r*91.6%

        \[\leadsto \left(b - \mathsf{hypot}\left(b, \sqrt{\left|\color{blue}{\left(a \cdot c\right) \cdot -3}\right|}\right)\right) \cdot \frac{\frac{1}{a}}{-3} \]
      5. *-commutative91.6%

        \[\leadsto \left(b - \mathsf{hypot}\left(b, \sqrt{\left|\color{blue}{\left(c \cdot a\right)} \cdot -3\right|}\right)\right) \cdot \frac{\frac{1}{a}}{-3} \]
      6. associate-*l*91.5%

        \[\leadsto \left(b - \mathsf{hypot}\left(b, \sqrt{\left|\color{blue}{c \cdot \left(a \cdot -3\right)}\right|}\right)\right) \cdot \frac{\frac{1}{a}}{-3} \]
    11. Simplified91.5%

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

    if 2.64999999999999999e234 < c

    1. Initial program 22.5%

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

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

        \[\leadsto \frac{\left(-b\right) + \sqrt{\color{blue}{b \cdot b} - \left(3 \cdot a\right) \cdot c}}{3 \cdot a} \]
      3. associate-*l*22.5%

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

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

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

        \[\leadsto \left(b - \mathsf{hypot}\left(b, \sqrt{a \cdot \left(c \cdot -3\right)}\right)\right) \cdot \color{blue}{\frac{\frac{1}{a}}{-3}} \]
    7. Simplified22.5%

      \[\leadsto \color{blue}{\left(b - \mathsf{hypot}\left(b, \sqrt{a \cdot \left(c \cdot -3\right)}\right)\right) \cdot \frac{\frac{1}{a}}{-3}} \]
    8. Step-by-step derivation
      1. associate-*r/22.5%

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

      \[\leadsto \color{blue}{\frac{\left(b - \mathsf{hypot}\left(b, \sqrt{a \cdot \left(c \cdot -3\right)}\right)\right) \cdot \frac{1}{a}}{-3}} \]
    10. Step-by-step derivation
      1. associate-*r/22.6%

        \[\leadsto \frac{\color{blue}{\frac{\left(b - \mathsf{hypot}\left(b, \sqrt{a \cdot \left(c \cdot -3\right)}\right)\right) \cdot 1}{a}}}{-3} \]
      2. *-rgt-identity22.6%

        \[\leadsto \frac{\frac{\color{blue}{b - \mathsf{hypot}\left(b, \sqrt{a \cdot \left(c \cdot -3\right)}\right)}}{a}}{-3} \]
      3. associate-*r*22.5%

        \[\leadsto \frac{\frac{b - \mathsf{hypot}\left(b, \sqrt{\color{blue}{\left(a \cdot c\right) \cdot -3}}\right)}{a}}{-3} \]
      4. *-commutative22.5%

        \[\leadsto \frac{\frac{b - \mathsf{hypot}\left(b, \sqrt{\color{blue}{\left(c \cdot a\right)} \cdot -3}\right)}{a}}{-3} \]
      5. associate-*l*22.5%

        \[\leadsto \frac{\frac{b - \mathsf{hypot}\left(b, \sqrt{\color{blue}{c \cdot \left(a \cdot -3\right)}}\right)}{a}}{-3} \]
    11. Simplified22.5%

      \[\leadsto \color{blue}{\frac{\frac{b - \mathsf{hypot}\left(b, \sqrt{c \cdot \left(a \cdot -3\right)}\right)}{a}}{-3}} \]
    12. Taylor expanded in c around 0 22.5%

      \[\leadsto \frac{\frac{b - \mathsf{hypot}\left(b, \sqrt{\color{blue}{-3 \cdot \left(a \cdot c\right)}}\right)}{a}}{-3} \]
    13. Step-by-step derivation
      1. pow1/223.1%

        \[\leadsto \frac{\frac{b - \mathsf{hypot}\left(b, \color{blue}{{\left(-3 \cdot \left(a \cdot c\right)\right)}^{0.5}}\right)}{a}}{-3} \]
      2. associate-*r*23.1%

        \[\leadsto \frac{\frac{b - \mathsf{hypot}\left(b, {\color{blue}{\left(\left(-3 \cdot a\right) \cdot c\right)}}^{0.5}\right)}{a}}{-3} \]
      3. unpow-prod-down89.5%

        \[\leadsto \frac{\frac{b - \mathsf{hypot}\left(b, \color{blue}{{\left(-3 \cdot a\right)}^{0.5} \cdot {c}^{0.5}}\right)}{a}}{-3} \]
      4. pow1/289.5%

        \[\leadsto \frac{\frac{b - \mathsf{hypot}\left(b, {\left(-3 \cdot a\right)}^{0.5} \cdot \color{blue}{\sqrt{c}}\right)}{a}}{-3} \]
    14. Applied egg-rr89.5%

      \[\leadsto \frac{\frac{b - \mathsf{hypot}\left(b, \color{blue}{{\left(-3 \cdot a\right)}^{0.5} \cdot \sqrt{c}}\right)}{a}}{-3} \]
    15. Step-by-step derivation
      1. unpow1/289.5%

        \[\leadsto \frac{\frac{b - \mathsf{hypot}\left(b, \color{blue}{\sqrt{-3 \cdot a}} \cdot \sqrt{c}\right)}{a}}{-3} \]
      2. *-commutative89.5%

        \[\leadsto \frac{\frac{b - \mathsf{hypot}\left(b, \sqrt{\color{blue}{a \cdot -3}} \cdot \sqrt{c}\right)}{a}}{-3} \]
    16. Simplified89.5%

      \[\leadsto \frac{\frac{b - \mathsf{hypot}\left(b, \color{blue}{\sqrt{a \cdot -3} \cdot \sqrt{c}}\right)}{a}}{-3} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification91.4%

    \[\leadsto \begin{array}{l} \mathbf{if}\;c \leq 2.65 \cdot 10^{+234}:\\ \;\;\;\;\left(b - \mathsf{hypot}\left(b, \sqrt{\left|c \cdot \left(a \cdot -3\right)\right|}\right)\right) \cdot \frac{\frac{1}{a}}{-3}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{b - \mathsf{hypot}\left(b, \sqrt{a \cdot -3} \cdot \sqrt{c}\right)}{a}}{-3}\\ \end{array} \]
  5. Add Preprocessing

Alternative 2: 79.2% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := 0.3333333333333333 \cdot \frac{\sqrt{c \cdot \left(a \cdot -3\right)}}{a}\\ \mathbf{if}\;b \leq -1.1 \cdot 10^{-19}:\\ \;\;\;\;\frac{\frac{2}{a}}{\frac{-3}{b}}\\ \mathbf{elif}\;b \leq -3.2 \cdot 10^{-39}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;b \leq -1.65 \cdot 10^{-99}:\\ \;\;\;\;\frac{b \cdot \frac{2}{a}}{-3}\\ \mathbf{elif}\;b \leq 8.5 \cdot 10^{-88}:\\ \;\;\;\;t\_0\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(b + -1.5 \cdot \left(a \cdot \frac{c}{b}\right)\right) - b}{a \cdot 3}\\ \end{array} \end{array} \]
(FPCore (a b c)
 :precision binary64
 (let* ((t_0 (* 0.3333333333333333 (/ (sqrt (* c (* a -3.0))) a))))
   (if (<= b -1.1e-19)
     (/ (/ 2.0 a) (/ -3.0 b))
     (if (<= b -3.2e-39)
       t_0
       (if (<= b -1.65e-99)
         (/ (* b (/ 2.0 a)) -3.0)
         (if (<= b 8.5e-88)
           t_0
           (/ (- (+ b (* -1.5 (* a (/ c b)))) b) (* a 3.0))))))))
double code(double a, double b, double c) {
	double t_0 = 0.3333333333333333 * (sqrt((c * (a * -3.0))) / a);
	double tmp;
	if (b <= -1.1e-19) {
		tmp = (2.0 / a) / (-3.0 / b);
	} else if (b <= -3.2e-39) {
		tmp = t_0;
	} else if (b <= -1.65e-99) {
		tmp = (b * (2.0 / a)) / -3.0;
	} else if (b <= 8.5e-88) {
		tmp = t_0;
	} else {
		tmp = ((b + (-1.5 * (a * (c / b)))) - b) / (a * 3.0);
	}
	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) :: t_0
    real(8) :: tmp
    t_0 = 0.3333333333333333d0 * (sqrt((c * (a * (-3.0d0)))) / a)
    if (b <= (-1.1d-19)) then
        tmp = (2.0d0 / a) / ((-3.0d0) / b)
    else if (b <= (-3.2d-39)) then
        tmp = t_0
    else if (b <= (-1.65d-99)) then
        tmp = (b * (2.0d0 / a)) / (-3.0d0)
    else if (b <= 8.5d-88) then
        tmp = t_0
    else
        tmp = ((b + ((-1.5d0) * (a * (c / b)))) - b) / (a * 3.0d0)
    end if
    code = tmp
end function
public static double code(double a, double b, double c) {
	double t_0 = 0.3333333333333333 * (Math.sqrt((c * (a * -3.0))) / a);
	double tmp;
	if (b <= -1.1e-19) {
		tmp = (2.0 / a) / (-3.0 / b);
	} else if (b <= -3.2e-39) {
		tmp = t_0;
	} else if (b <= -1.65e-99) {
		tmp = (b * (2.0 / a)) / -3.0;
	} else if (b <= 8.5e-88) {
		tmp = t_0;
	} else {
		tmp = ((b + (-1.5 * (a * (c / b)))) - b) / (a * 3.0);
	}
	return tmp;
}
def code(a, b, c):
	t_0 = 0.3333333333333333 * (math.sqrt((c * (a * -3.0))) / a)
	tmp = 0
	if b <= -1.1e-19:
		tmp = (2.0 / a) / (-3.0 / b)
	elif b <= -3.2e-39:
		tmp = t_0
	elif b <= -1.65e-99:
		tmp = (b * (2.0 / a)) / -3.0
	elif b <= 8.5e-88:
		tmp = t_0
	else:
		tmp = ((b + (-1.5 * (a * (c / b)))) - b) / (a * 3.0)
	return tmp
function code(a, b, c)
	t_0 = Float64(0.3333333333333333 * Float64(sqrt(Float64(c * Float64(a * -3.0))) / a))
	tmp = 0.0
	if (b <= -1.1e-19)
		tmp = Float64(Float64(2.0 / a) / Float64(-3.0 / b));
	elseif (b <= -3.2e-39)
		tmp = t_0;
	elseif (b <= -1.65e-99)
		tmp = Float64(Float64(b * Float64(2.0 / a)) / -3.0);
	elseif (b <= 8.5e-88)
		tmp = t_0;
	else
		tmp = Float64(Float64(Float64(b + Float64(-1.5 * Float64(a * Float64(c / b)))) - b) / Float64(a * 3.0));
	end
	return tmp
end
function tmp_2 = code(a, b, c)
	t_0 = 0.3333333333333333 * (sqrt((c * (a * -3.0))) / a);
	tmp = 0.0;
	if (b <= -1.1e-19)
		tmp = (2.0 / a) / (-3.0 / b);
	elseif (b <= -3.2e-39)
		tmp = t_0;
	elseif (b <= -1.65e-99)
		tmp = (b * (2.0 / a)) / -3.0;
	elseif (b <= 8.5e-88)
		tmp = t_0;
	else
		tmp = ((b + (-1.5 * (a * (c / b)))) - b) / (a * 3.0);
	end
	tmp_2 = tmp;
end
code[a_, b_, c_] := Block[{t$95$0 = N[(0.3333333333333333 * N[(N[Sqrt[N[(c * N[(a * -3.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -1.1e-19], N[(N[(2.0 / a), $MachinePrecision] / N[(-3.0 / b), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, -3.2e-39], t$95$0, If[LessEqual[b, -1.65e-99], N[(N[(b * N[(2.0 / a), $MachinePrecision]), $MachinePrecision] / -3.0), $MachinePrecision], If[LessEqual[b, 8.5e-88], t$95$0, N[(N[(N[(b + N[(-1.5 * N[(a * N[(c / b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - b), $MachinePrecision] / N[(a * 3.0), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := 0.3333333333333333 \cdot \frac{\sqrt{c \cdot \left(a \cdot -3\right)}}{a}\\
\mathbf{if}\;b \leq -1.1 \cdot 10^{-19}:\\
\;\;\;\;\frac{\frac{2}{a}}{\frac{-3}{b}}\\

\mathbf{elif}\;b \leq -3.2 \cdot 10^{-39}:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;b \leq -1.65 \cdot 10^{-99}:\\
\;\;\;\;\frac{b \cdot \frac{2}{a}}{-3}\\

\mathbf{elif}\;b \leq 8.5 \cdot 10^{-88}:\\
\;\;\;\;t\_0\\

\mathbf{else}:\\
\;\;\;\;\frac{\left(b + -1.5 \cdot \left(a \cdot \frac{c}{b}\right)\right) - b}{a \cdot 3}\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if b < -1.0999999999999999e-19

    1. Initial program 69.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. sqr-neg69.3%

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

        \[\leadsto \frac{\left(-b\right) + \sqrt{\color{blue}{b \cdot b} - \left(3 \cdot a\right) \cdot c}}{3 \cdot a} \]
      3. associate-*l*69.3%

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

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

      \[\leadsto \frac{\left(-b\right) + \color{blue}{-1 \cdot b}}{3 \cdot a} \]
    6. Step-by-step derivation
      1. mul-1-neg89.6%

        \[\leadsto \frac{\left(-b\right) + \color{blue}{\left(-b\right)}}{3 \cdot a} \]
    7. Simplified89.6%

      \[\leadsto \frac{\left(-b\right) + \color{blue}{\left(-b\right)}}{3 \cdot a} \]
    8. Step-by-step derivation
      1. count-289.6%

        \[\leadsto \frac{\color{blue}{2 \cdot \left(-b\right)}}{3 \cdot a} \]
      2. *-commutative89.6%

        \[\leadsto \frac{2 \cdot \left(-b\right)}{\color{blue}{a \cdot 3}} \]
      3. times-frac89.6%

        \[\leadsto \color{blue}{\frac{2}{a} \cdot \frac{-b}{3}} \]
      4. add-sqr-sqrt89.3%

        \[\leadsto \frac{2}{a} \cdot \frac{\color{blue}{\sqrt{-b} \cdot \sqrt{-b}}}{3} \]
      5. sqrt-unprod64.8%

        \[\leadsto \frac{2}{a} \cdot \frac{\color{blue}{\sqrt{\left(-b\right) \cdot \left(-b\right)}}}{3} \]
      6. sqr-neg64.8%

        \[\leadsto \frac{2}{a} \cdot \frac{\sqrt{\color{blue}{b \cdot b}}}{3} \]
      7. sqrt-unprod0.0%

        \[\leadsto \frac{2}{a} \cdot \frac{\color{blue}{\sqrt{b} \cdot \sqrt{b}}}{3} \]
      8. add-sqr-sqrt1.0%

        \[\leadsto \frac{2}{a} \cdot \frac{\color{blue}{b}}{3} \]
    9. Applied egg-rr1.0%

      \[\leadsto \color{blue}{\frac{2}{a} \cdot \frac{b}{3}} \]
    10. Step-by-step derivation
      1. associate-*l/1.0%

        \[\leadsto \color{blue}{\frac{2 \cdot \frac{b}{3}}{a}} \]
      2. associate-/l*1.0%

        \[\leadsto \color{blue}{2 \cdot \frac{\frac{b}{3}}{a}} \]
    11. Simplified1.0%

      \[\leadsto \color{blue}{2 \cdot \frac{\frac{b}{3}}{a}} \]
    12. Step-by-step derivation
      1. clear-num1.0%

        \[\leadsto 2 \cdot \color{blue}{\frac{1}{\frac{a}{\frac{b}{3}}}} \]
      2. un-div-inv1.0%

        \[\leadsto \color{blue}{\frac{2}{\frac{a}{\frac{b}{3}}}} \]
      3. div-inv1.0%

        \[\leadsto \frac{2}{\color{blue}{a \cdot \frac{1}{\frac{b}{3}}}} \]
      4. clear-num1.0%

        \[\leadsto \frac{2}{a \cdot \color{blue}{\frac{3}{b}}} \]
      5. frac-2neg1.0%

        \[\leadsto \frac{2}{a \cdot \color{blue}{\frac{-3}{-b}}} \]
      6. metadata-eval1.0%

        \[\leadsto \frac{2}{a \cdot \frac{\color{blue}{-3}}{-b}} \]
      7. add-sqr-sqrt1.0%

        \[\leadsto \frac{2}{a \cdot \frac{-3}{\color{blue}{\sqrt{-b} \cdot \sqrt{-b}}}} \]
      8. sqrt-unprod0.9%

        \[\leadsto \frac{2}{a \cdot \frac{-3}{\color{blue}{\sqrt{\left(-b\right) \cdot \left(-b\right)}}}} \]
      9. sqr-neg0.9%

        \[\leadsto \frac{2}{a \cdot \frac{-3}{\sqrt{\color{blue}{b \cdot b}}}} \]
      10. sqrt-unprod0.0%

        \[\leadsto \frac{2}{a \cdot \frac{-3}{\color{blue}{\sqrt{b} \cdot \sqrt{b}}}} \]
      11. add-sqr-sqrt89.6%

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

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

        \[\leadsto \color{blue}{\frac{\frac{2}{a}}{\frac{-3}{b}}} \]
    15. Simplified89.7%

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

    if -1.0999999999999999e-19 < b < -3.1999999999999998e-39 or -1.64999999999999993e-99 < b < 8.4999999999999996e-88

    1. Initial program 85.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. sqr-neg85.2%

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

        \[\leadsto \frac{\left(-b\right) + \sqrt{\color{blue}{b \cdot b} - \left(3 \cdot a\right) \cdot c}}{3 \cdot a} \]
      3. associate-*l*85.0%

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

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

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

        \[\leadsto \left(b - \mathsf{hypot}\left(b, \sqrt{a \cdot \left(c \cdot -3\right)}\right)\right) \cdot \color{blue}{\frac{\frac{1}{a}}{-3}} \]
    7. Simplified82.5%

      \[\leadsto \color{blue}{\left(b - \mathsf{hypot}\left(b, \sqrt{a \cdot \left(c \cdot -3\right)}\right)\right) \cdot \frac{\frac{1}{a}}{-3}} \]
    8. Step-by-step derivation
      1. associate-*r*82.5%

        \[\leadsto \left(b - \mathsf{hypot}\left(b, \sqrt{\color{blue}{\left(a \cdot c\right) \cdot -3}}\right)\right) \cdot \frac{\frac{1}{a}}{-3} \]
      2. *-commutative82.5%

        \[\leadsto \left(b - \mathsf{hypot}\left(b, \sqrt{\color{blue}{-3 \cdot \left(a \cdot c\right)}}\right)\right) \cdot \frac{\frac{1}{a}}{-3} \]
      3. add-sqr-sqrt82.5%

        \[\leadsto \left(b - \mathsf{hypot}\left(b, \sqrt{\color{blue}{\sqrt{-3 \cdot \left(a \cdot c\right)} \cdot \sqrt{-3 \cdot \left(a \cdot c\right)}}}\right)\right) \cdot \frac{\frac{1}{a}}{-3} \]
      4. pow1/282.5%

        \[\leadsto \left(b - \mathsf{hypot}\left(b, \sqrt{\color{blue}{{\left(-3 \cdot \left(a \cdot c\right)\right)}^{0.5}} \cdot \sqrt{-3 \cdot \left(a \cdot c\right)}}\right)\right) \cdot \frac{\frac{1}{a}}{-3} \]
      5. pow1/282.5%

        \[\leadsto \left(b - \mathsf{hypot}\left(b, \sqrt{{\left(-3 \cdot \left(a \cdot c\right)\right)}^{0.5} \cdot \color{blue}{{\left(-3 \cdot \left(a \cdot c\right)\right)}^{0.5}}}\right)\right) \cdot \frac{\frac{1}{a}}{-3} \]
      6. pow-prod-down58.6%

        \[\leadsto \left(b - \mathsf{hypot}\left(b, \sqrt{\color{blue}{{\left(\left(-3 \cdot \left(a \cdot c\right)\right) \cdot \left(-3 \cdot \left(a \cdot c\right)\right)\right)}^{0.5}}}\right)\right) \cdot \frac{\frac{1}{a}}{-3} \]
      7. pow258.6%

        \[\leadsto \left(b - \mathsf{hypot}\left(b, \sqrt{{\color{blue}{\left({\left(-3 \cdot \left(a \cdot c\right)\right)}^{2}\right)}}^{0.5}}\right)\right) \cdot \frac{\frac{1}{a}}{-3} \]
      8. *-commutative58.6%

        \[\leadsto \left(b - \mathsf{hypot}\left(b, \sqrt{{\left({\color{blue}{\left(\left(a \cdot c\right) \cdot -3\right)}}^{2}\right)}^{0.5}}\right)\right) \cdot \frac{\frac{1}{a}}{-3} \]
      9. associate-*r*58.6%

        \[\leadsto \left(b - \mathsf{hypot}\left(b, \sqrt{{\left({\color{blue}{\left(a \cdot \left(c \cdot -3\right)\right)}}^{2}\right)}^{0.5}}\right)\right) \cdot \frac{\frac{1}{a}}{-3} \]
    9. Applied egg-rr58.6%

      \[\leadsto \left(b - \mathsf{hypot}\left(b, \sqrt{\color{blue}{{\left({\left(a \cdot \left(c \cdot -3\right)\right)}^{2}\right)}^{0.5}}}\right)\right) \cdot \frac{\frac{1}{a}}{-3} \]
    10. Step-by-step derivation
      1. unpow1/258.6%

        \[\leadsto \left(b - \mathsf{hypot}\left(b, \sqrt{\color{blue}{\sqrt{{\left(a \cdot \left(c \cdot -3\right)\right)}^{2}}}}\right)\right) \cdot \frac{\frac{1}{a}}{-3} \]
      2. unpow258.6%

        \[\leadsto \left(b - \mathsf{hypot}\left(b, \sqrt{\sqrt{\color{blue}{\left(a \cdot \left(c \cdot -3\right)\right) \cdot \left(a \cdot \left(c \cdot -3\right)\right)}}}\right)\right) \cdot \frac{\frac{1}{a}}{-3} \]
      3. rem-sqrt-square84.4%

        \[\leadsto \left(b - \mathsf{hypot}\left(b, \sqrt{\color{blue}{\left|a \cdot \left(c \cdot -3\right)\right|}}\right)\right) \cdot \frac{\frac{1}{a}}{-3} \]
      4. associate-*r*84.4%

        \[\leadsto \left(b - \mathsf{hypot}\left(b, \sqrt{\left|\color{blue}{\left(a \cdot c\right) \cdot -3}\right|}\right)\right) \cdot \frac{\frac{1}{a}}{-3} \]
      5. *-commutative84.4%

        \[\leadsto \left(b - \mathsf{hypot}\left(b, \sqrt{\left|\color{blue}{\left(c \cdot a\right)} \cdot -3\right|}\right)\right) \cdot \frac{\frac{1}{a}}{-3} \]
      6. associate-*l*84.3%

        \[\leadsto \left(b - \mathsf{hypot}\left(b, \sqrt{\left|\color{blue}{c \cdot \left(a \cdot -3\right)}\right|}\right)\right) \cdot \frac{\frac{1}{a}}{-3} \]
    11. Simplified84.3%

      \[\leadsto \left(b - \mathsf{hypot}\left(b, \sqrt{\color{blue}{\left|c \cdot \left(a \cdot -3\right)\right|}}\right)\right) \cdot \frac{\frac{1}{a}}{-3} \]
    12. Taylor expanded in b around 0 82.0%

      \[\leadsto \color{blue}{0.3333333333333333 \cdot \left(\frac{1}{a} \cdot \sqrt{\left|-3 \cdot \left(a \cdot c\right)\right|}\right)} \]
    13. Step-by-step derivation
      1. associate-*l/82.0%

        \[\leadsto 0.3333333333333333 \cdot \color{blue}{\frac{1 \cdot \sqrt{\left|-3 \cdot \left(a \cdot c\right)\right|}}{a}} \]
      2. *-lft-identity82.0%

        \[\leadsto 0.3333333333333333 \cdot \frac{\color{blue}{\sqrt{\left|-3 \cdot \left(a \cdot c\right)\right|}}}{a} \]
      3. associate-*r*81.9%

        \[\leadsto 0.3333333333333333 \cdot \frac{\sqrt{\left|\color{blue}{\left(-3 \cdot a\right) \cdot c}\right|}}{a} \]
      4. *-commutative81.9%

        \[\leadsto 0.3333333333333333 \cdot \frac{\sqrt{\left|\color{blue}{\left(a \cdot -3\right)} \cdot c\right|}}{a} \]
      5. *-commutative81.9%

        \[\leadsto 0.3333333333333333 \cdot \frac{\sqrt{\left|\color{blue}{c \cdot \left(a \cdot -3\right)}\right|}}{a} \]
      6. rem-cube-cbrt81.2%

        \[\leadsto 0.3333333333333333 \cdot \frac{\sqrt{\left|\color{blue}{{\left(\sqrt[3]{c \cdot \left(a \cdot -3\right)}\right)}^{3}}\right|}}{a} \]
      7. sqr-pow81.1%

        \[\leadsto 0.3333333333333333 \cdot \frac{\sqrt{\left|\color{blue}{{\left(\sqrt[3]{c \cdot \left(a \cdot -3\right)}\right)}^{\left(\frac{3}{2}\right)} \cdot {\left(\sqrt[3]{c \cdot \left(a \cdot -3\right)}\right)}^{\left(\frac{3}{2}\right)}}\right|}}{a} \]
      8. fabs-sqr81.1%

        \[\leadsto 0.3333333333333333 \cdot \frac{\sqrt{\color{blue}{{\left(\sqrt[3]{c \cdot \left(a \cdot -3\right)}\right)}^{\left(\frac{3}{2}\right)} \cdot {\left(\sqrt[3]{c \cdot \left(a \cdot -3\right)}\right)}^{\left(\frac{3}{2}\right)}}}}{a} \]
      9. sqr-pow81.0%

        \[\leadsto 0.3333333333333333 \cdot \frac{\sqrt{\color{blue}{{\left(\sqrt[3]{c \cdot \left(a \cdot -3\right)}\right)}^{3}}}}{a} \]
      10. rem-cube-cbrt81.6%

        \[\leadsto 0.3333333333333333 \cdot \frac{\sqrt{\color{blue}{c \cdot \left(a \cdot -3\right)}}}{a} \]
      11. *-commutative81.6%

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

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

    if -3.1999999999999998e-39 < b < -1.64999999999999993e-99

    1. Initial program 99.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. sqr-neg99.6%

        \[\leadsto \frac{\left(-b\right) + \sqrt{\color{blue}{\left(-b\right) \cdot \left(-b\right)} - \left(3 \cdot a\right) \cdot c}}{3 \cdot a} \]
      2. sqr-neg99.6%

        \[\leadsto \frac{\left(-b\right) + \sqrt{\color{blue}{b \cdot b} - \left(3 \cdot a\right) \cdot c}}{3 \cdot a} \]
      3. associate-*l*99.5%

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

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

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

        \[\leadsto \left(b - \mathsf{hypot}\left(b, \sqrt{a \cdot \left(c \cdot -3\right)}\right)\right) \cdot \color{blue}{\frac{\frac{1}{a}}{-3}} \]
    7. Simplified74.5%

      \[\leadsto \color{blue}{\left(b - \mathsf{hypot}\left(b, \sqrt{a \cdot \left(c \cdot -3\right)}\right)\right) \cdot \frac{\frac{1}{a}}{-3}} \]
    8. Step-by-step derivation
      1. associate-*r/74.7%

        \[\leadsto \color{blue}{\frac{\left(b - \mathsf{hypot}\left(b, \sqrt{a \cdot \left(c \cdot -3\right)}\right)\right) \cdot \frac{1}{a}}{-3}} \]
    9. Applied egg-rr74.7%

      \[\leadsto \color{blue}{\frac{\left(b - \mathsf{hypot}\left(b, \sqrt{a \cdot \left(c \cdot -3\right)}\right)\right) \cdot \frac{1}{a}}{-3}} \]
    10. Step-by-step derivation
      1. associate-*r/74.7%

        \[\leadsto \frac{\color{blue}{\frac{\left(b - \mathsf{hypot}\left(b, \sqrt{a \cdot \left(c \cdot -3\right)}\right)\right) \cdot 1}{a}}}{-3} \]
      2. *-rgt-identity74.7%

        \[\leadsto \frac{\frac{\color{blue}{b - \mathsf{hypot}\left(b, \sqrt{a \cdot \left(c \cdot -3\right)}\right)}}{a}}{-3} \]
      3. associate-*r*74.9%

        \[\leadsto \frac{\frac{b - \mathsf{hypot}\left(b, \sqrt{\color{blue}{\left(a \cdot c\right) \cdot -3}}\right)}{a}}{-3} \]
      4. *-commutative74.9%

        \[\leadsto \frac{\frac{b - \mathsf{hypot}\left(b, \sqrt{\color{blue}{\left(c \cdot a\right)} \cdot -3}\right)}{a}}{-3} \]
      5. associate-*l*74.9%

        \[\leadsto \frac{\frac{b - \mathsf{hypot}\left(b, \sqrt{\color{blue}{c \cdot \left(a \cdot -3\right)}}\right)}{a}}{-3} \]
    11. Simplified74.9%

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

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

        \[\leadsto \frac{\color{blue}{\frac{2 \cdot b}{a}}}{-3} \]
      2. associate-*l/76.7%

        \[\leadsto \frac{\color{blue}{\frac{2}{a} \cdot b}}{-3} \]
      3. *-commutative76.7%

        \[\leadsto \frac{\color{blue}{b \cdot \frac{2}{a}}}{-3} \]
    14. Simplified76.7%

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

    if 8.4999999999999996e-88 < b

    1. Initial program 39.4%

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

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

        \[\leadsto \frac{\left(-b\right) + \sqrt{\color{blue}{b \cdot b} - \left(3 \cdot a\right) \cdot c}}{3 \cdot a} \]
      3. associate-*l*39.4%

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

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

      \[\leadsto \frac{\left(-b\right) + \color{blue}{\left(b + -1.5 \cdot \frac{a \cdot c}{b}\right)}}{3 \cdot a} \]
    6. Step-by-step derivation
      1. associate-/l*88.2%

        \[\leadsto \frac{\left(-b\right) + \left(b + -1.5 \cdot \color{blue}{\left(a \cdot \frac{c}{b}\right)}\right)}{3 \cdot a} \]
    7. Simplified88.2%

      \[\leadsto \frac{\left(-b\right) + \color{blue}{\left(b + -1.5 \cdot \left(a \cdot \frac{c}{b}\right)\right)}}{3 \cdot a} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification86.3%

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -1.1 \cdot 10^{-19}:\\ \;\;\;\;\frac{\frac{2}{a}}{\frac{-3}{b}}\\ \mathbf{elif}\;b \leq -3.2 \cdot 10^{-39}:\\ \;\;\;\;0.3333333333333333 \cdot \frac{\sqrt{c \cdot \left(a \cdot -3\right)}}{a}\\ \mathbf{elif}\;b \leq -1.65 \cdot 10^{-99}:\\ \;\;\;\;\frac{b \cdot \frac{2}{a}}{-3}\\ \mathbf{elif}\;b \leq 8.5 \cdot 10^{-88}:\\ \;\;\;\;0.3333333333333333 \cdot \frac{\sqrt{c \cdot \left(a \cdot -3\right)}}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(b + -1.5 \cdot \left(a \cdot \frac{c}{b}\right)\right) - b}{a \cdot 3}\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 79.3% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq -1.1 \cdot 10^{-19}:\\ \;\;\;\;\frac{\frac{2}{a}}{\frac{-3}{b}}\\ \mathbf{elif}\;b \leq -4.4 \cdot 10^{-44}:\\ \;\;\;\;\frac{\sqrt{-3 \cdot \left(c \cdot a\right)} - b}{a \cdot 3}\\ \mathbf{elif}\;b \leq -1.9 \cdot 10^{-103}:\\ \;\;\;\;\frac{b \cdot \frac{2}{a}}{-3}\\ \mathbf{elif}\;b \leq 8.2 \cdot 10^{-88}:\\ \;\;\;\;0.3333333333333333 \cdot \frac{\sqrt{c \cdot \left(a \cdot -3\right)}}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(b + -1.5 \cdot \left(a \cdot \frac{c}{b}\right)\right) - b}{a \cdot 3}\\ \end{array} \end{array} \]
(FPCore (a b c)
 :precision binary64
 (if (<= b -1.1e-19)
   (/ (/ 2.0 a) (/ -3.0 b))
   (if (<= b -4.4e-44)
     (/ (- (sqrt (* -3.0 (* c a))) b) (* a 3.0))
     (if (<= b -1.9e-103)
       (/ (* b (/ 2.0 a)) -3.0)
       (if (<= b 8.2e-88)
         (* 0.3333333333333333 (/ (sqrt (* c (* a -3.0))) a))
         (/ (- (+ b (* -1.5 (* a (/ c b)))) b) (* a 3.0)))))))
double code(double a, double b, double c) {
	double tmp;
	if (b <= -1.1e-19) {
		tmp = (2.0 / a) / (-3.0 / b);
	} else if (b <= -4.4e-44) {
		tmp = (sqrt((-3.0 * (c * a))) - b) / (a * 3.0);
	} else if (b <= -1.9e-103) {
		tmp = (b * (2.0 / a)) / -3.0;
	} else if (b <= 8.2e-88) {
		tmp = 0.3333333333333333 * (sqrt((c * (a * -3.0))) / a);
	} else {
		tmp = ((b + (-1.5 * (a * (c / b)))) - b) / (a * 3.0);
	}
	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.1d-19)) then
        tmp = (2.0d0 / a) / ((-3.0d0) / b)
    else if (b <= (-4.4d-44)) then
        tmp = (sqrt(((-3.0d0) * (c * a))) - b) / (a * 3.0d0)
    else if (b <= (-1.9d-103)) then
        tmp = (b * (2.0d0 / a)) / (-3.0d0)
    else if (b <= 8.2d-88) then
        tmp = 0.3333333333333333d0 * (sqrt((c * (a * (-3.0d0)))) / a)
    else
        tmp = ((b + ((-1.5d0) * (a * (c / b)))) - b) / (a * 3.0d0)
    end if
    code = tmp
end function
public static double code(double a, double b, double c) {
	double tmp;
	if (b <= -1.1e-19) {
		tmp = (2.0 / a) / (-3.0 / b);
	} else if (b <= -4.4e-44) {
		tmp = (Math.sqrt((-3.0 * (c * a))) - b) / (a * 3.0);
	} else if (b <= -1.9e-103) {
		tmp = (b * (2.0 / a)) / -3.0;
	} else if (b <= 8.2e-88) {
		tmp = 0.3333333333333333 * (Math.sqrt((c * (a * -3.0))) / a);
	} else {
		tmp = ((b + (-1.5 * (a * (c / b)))) - b) / (a * 3.0);
	}
	return tmp;
}
def code(a, b, c):
	tmp = 0
	if b <= -1.1e-19:
		tmp = (2.0 / a) / (-3.0 / b)
	elif b <= -4.4e-44:
		tmp = (math.sqrt((-3.0 * (c * a))) - b) / (a * 3.0)
	elif b <= -1.9e-103:
		tmp = (b * (2.0 / a)) / -3.0
	elif b <= 8.2e-88:
		tmp = 0.3333333333333333 * (math.sqrt((c * (a * -3.0))) / a)
	else:
		tmp = ((b + (-1.5 * (a * (c / b)))) - b) / (a * 3.0)
	return tmp
function code(a, b, c)
	tmp = 0.0
	if (b <= -1.1e-19)
		tmp = Float64(Float64(2.0 / a) / Float64(-3.0 / b));
	elseif (b <= -4.4e-44)
		tmp = Float64(Float64(sqrt(Float64(-3.0 * Float64(c * a))) - b) / Float64(a * 3.0));
	elseif (b <= -1.9e-103)
		tmp = Float64(Float64(b * Float64(2.0 / a)) / -3.0);
	elseif (b <= 8.2e-88)
		tmp = Float64(0.3333333333333333 * Float64(sqrt(Float64(c * Float64(a * -3.0))) / a));
	else
		tmp = Float64(Float64(Float64(b + Float64(-1.5 * Float64(a * Float64(c / b)))) - b) / Float64(a * 3.0));
	end
	return tmp
end
function tmp_2 = code(a, b, c)
	tmp = 0.0;
	if (b <= -1.1e-19)
		tmp = (2.0 / a) / (-3.0 / b);
	elseif (b <= -4.4e-44)
		tmp = (sqrt((-3.0 * (c * a))) - b) / (a * 3.0);
	elseif (b <= -1.9e-103)
		tmp = (b * (2.0 / a)) / -3.0;
	elseif (b <= 8.2e-88)
		tmp = 0.3333333333333333 * (sqrt((c * (a * -3.0))) / a);
	else
		tmp = ((b + (-1.5 * (a * (c / b)))) - b) / (a * 3.0);
	end
	tmp_2 = tmp;
end
code[a_, b_, c_] := If[LessEqual[b, -1.1e-19], N[(N[(2.0 / a), $MachinePrecision] / N[(-3.0 / b), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, -4.4e-44], N[(N[(N[Sqrt[N[(-3.0 * N[(c * a), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision] / N[(a * 3.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, -1.9e-103], N[(N[(b * N[(2.0 / a), $MachinePrecision]), $MachinePrecision] / -3.0), $MachinePrecision], If[LessEqual[b, 8.2e-88], N[(0.3333333333333333 * N[(N[Sqrt[N[(c * N[(a * -3.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], N[(N[(N[(b + N[(-1.5 * N[(a * N[(c / b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - b), $MachinePrecision] / N[(a * 3.0), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;b \leq -1.1 \cdot 10^{-19}:\\
\;\;\;\;\frac{\frac{2}{a}}{\frac{-3}{b}}\\

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

\mathbf{elif}\;b \leq -1.9 \cdot 10^{-103}:\\
\;\;\;\;\frac{b \cdot \frac{2}{a}}{-3}\\

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

\mathbf{else}:\\
\;\;\;\;\frac{\left(b + -1.5 \cdot \left(a \cdot \frac{c}{b}\right)\right) - b}{a \cdot 3}\\


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if b < -1.0999999999999999e-19

    1. Initial program 69.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. sqr-neg69.3%

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

        \[\leadsto \frac{\left(-b\right) + \sqrt{\color{blue}{b \cdot b} - \left(3 \cdot a\right) \cdot c}}{3 \cdot a} \]
      3. associate-*l*69.3%

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

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

      \[\leadsto \frac{\left(-b\right) + \color{blue}{-1 \cdot b}}{3 \cdot a} \]
    6. Step-by-step derivation
      1. mul-1-neg89.6%

        \[\leadsto \frac{\left(-b\right) + \color{blue}{\left(-b\right)}}{3 \cdot a} \]
    7. Simplified89.6%

      \[\leadsto \frac{\left(-b\right) + \color{blue}{\left(-b\right)}}{3 \cdot a} \]
    8. Step-by-step derivation
      1. count-289.6%

        \[\leadsto \frac{\color{blue}{2 \cdot \left(-b\right)}}{3 \cdot a} \]
      2. *-commutative89.6%

        \[\leadsto \frac{2 \cdot \left(-b\right)}{\color{blue}{a \cdot 3}} \]
      3. times-frac89.6%

        \[\leadsto \color{blue}{\frac{2}{a} \cdot \frac{-b}{3}} \]
      4. add-sqr-sqrt89.3%

        \[\leadsto \frac{2}{a} \cdot \frac{\color{blue}{\sqrt{-b} \cdot \sqrt{-b}}}{3} \]
      5. sqrt-unprod64.8%

        \[\leadsto \frac{2}{a} \cdot \frac{\color{blue}{\sqrt{\left(-b\right) \cdot \left(-b\right)}}}{3} \]
      6. sqr-neg64.8%

        \[\leadsto \frac{2}{a} \cdot \frac{\sqrt{\color{blue}{b \cdot b}}}{3} \]
      7. sqrt-unprod0.0%

        \[\leadsto \frac{2}{a} \cdot \frac{\color{blue}{\sqrt{b} \cdot \sqrt{b}}}{3} \]
      8. add-sqr-sqrt1.0%

        \[\leadsto \frac{2}{a} \cdot \frac{\color{blue}{b}}{3} \]
    9. Applied egg-rr1.0%

      \[\leadsto \color{blue}{\frac{2}{a} \cdot \frac{b}{3}} \]
    10. Step-by-step derivation
      1. associate-*l/1.0%

        \[\leadsto \color{blue}{\frac{2 \cdot \frac{b}{3}}{a}} \]
      2. associate-/l*1.0%

        \[\leadsto \color{blue}{2 \cdot \frac{\frac{b}{3}}{a}} \]
    11. Simplified1.0%

      \[\leadsto \color{blue}{2 \cdot \frac{\frac{b}{3}}{a}} \]
    12. Step-by-step derivation
      1. clear-num1.0%

        \[\leadsto 2 \cdot \color{blue}{\frac{1}{\frac{a}{\frac{b}{3}}}} \]
      2. un-div-inv1.0%

        \[\leadsto \color{blue}{\frac{2}{\frac{a}{\frac{b}{3}}}} \]
      3. div-inv1.0%

        \[\leadsto \frac{2}{\color{blue}{a \cdot \frac{1}{\frac{b}{3}}}} \]
      4. clear-num1.0%

        \[\leadsto \frac{2}{a \cdot \color{blue}{\frac{3}{b}}} \]
      5. frac-2neg1.0%

        \[\leadsto \frac{2}{a \cdot \color{blue}{\frac{-3}{-b}}} \]
      6. metadata-eval1.0%

        \[\leadsto \frac{2}{a \cdot \frac{\color{blue}{-3}}{-b}} \]
      7. add-sqr-sqrt1.0%

        \[\leadsto \frac{2}{a \cdot \frac{-3}{\color{blue}{\sqrt{-b} \cdot \sqrt{-b}}}} \]
      8. sqrt-unprod0.9%

        \[\leadsto \frac{2}{a \cdot \frac{-3}{\color{blue}{\sqrt{\left(-b\right) \cdot \left(-b\right)}}}} \]
      9. sqr-neg0.9%

        \[\leadsto \frac{2}{a \cdot \frac{-3}{\sqrt{\color{blue}{b \cdot b}}}} \]
      10. sqrt-unprod0.0%

        \[\leadsto \frac{2}{a \cdot \frac{-3}{\color{blue}{\sqrt{b} \cdot \sqrt{b}}}} \]
      11. add-sqr-sqrt89.6%

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

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

        \[\leadsto \color{blue}{\frac{\frac{2}{a}}{\frac{-3}{b}}} \]
    15. Simplified89.7%

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

    if -1.0999999999999999e-19 < b < -4.40000000000000024e-44

    1. Initial program 99.4%

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

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

        \[\leadsto \frac{\left(-b\right) + \sqrt{\color{blue}{b \cdot b} - \left(3 \cdot a\right) \cdot c}}{3 \cdot a} \]
      3. associate-*l*99.4%

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

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

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

    if -4.40000000000000024e-44 < b < -1.9e-103

    1. Initial program 99.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. sqr-neg99.6%

        \[\leadsto \frac{\left(-b\right) + \sqrt{\color{blue}{\left(-b\right) \cdot \left(-b\right)} - \left(3 \cdot a\right) \cdot c}}{3 \cdot a} \]
      2. sqr-neg99.6%

        \[\leadsto \frac{\left(-b\right) + \sqrt{\color{blue}{b \cdot b} - \left(3 \cdot a\right) \cdot c}}{3 \cdot a} \]
      3. associate-*l*99.5%

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

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

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

        \[\leadsto \left(b - \mathsf{hypot}\left(b, \sqrt{a \cdot \left(c \cdot -3\right)}\right)\right) \cdot \color{blue}{\frac{\frac{1}{a}}{-3}} \]
    7. Simplified74.5%

      \[\leadsto \color{blue}{\left(b - \mathsf{hypot}\left(b, \sqrt{a \cdot \left(c \cdot -3\right)}\right)\right) \cdot \frac{\frac{1}{a}}{-3}} \]
    8. Step-by-step derivation
      1. associate-*r/74.7%

        \[\leadsto \color{blue}{\frac{\left(b - \mathsf{hypot}\left(b, \sqrt{a \cdot \left(c \cdot -3\right)}\right)\right) \cdot \frac{1}{a}}{-3}} \]
    9. Applied egg-rr74.7%

      \[\leadsto \color{blue}{\frac{\left(b - \mathsf{hypot}\left(b, \sqrt{a \cdot \left(c \cdot -3\right)}\right)\right) \cdot \frac{1}{a}}{-3}} \]
    10. Step-by-step derivation
      1. associate-*r/74.7%

        \[\leadsto \frac{\color{blue}{\frac{\left(b - \mathsf{hypot}\left(b, \sqrt{a \cdot \left(c \cdot -3\right)}\right)\right) \cdot 1}{a}}}{-3} \]
      2. *-rgt-identity74.7%

        \[\leadsto \frac{\frac{\color{blue}{b - \mathsf{hypot}\left(b, \sqrt{a \cdot \left(c \cdot -3\right)}\right)}}{a}}{-3} \]
      3. associate-*r*74.9%

        \[\leadsto \frac{\frac{b - \mathsf{hypot}\left(b, \sqrt{\color{blue}{\left(a \cdot c\right) \cdot -3}}\right)}{a}}{-3} \]
      4. *-commutative74.9%

        \[\leadsto \frac{\frac{b - \mathsf{hypot}\left(b, \sqrt{\color{blue}{\left(c \cdot a\right)} \cdot -3}\right)}{a}}{-3} \]
      5. associate-*l*74.9%

        \[\leadsto \frac{\frac{b - \mathsf{hypot}\left(b, \sqrt{\color{blue}{c \cdot \left(a \cdot -3\right)}}\right)}{a}}{-3} \]
    11. Simplified74.9%

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

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

        \[\leadsto \frac{\color{blue}{\frac{2 \cdot b}{a}}}{-3} \]
      2. associate-*l/76.7%

        \[\leadsto \frac{\color{blue}{\frac{2}{a} \cdot b}}{-3} \]
      3. *-commutative76.7%

        \[\leadsto \frac{\color{blue}{b \cdot \frac{2}{a}}}{-3} \]
    14. Simplified76.7%

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

    if -1.9e-103 < b < 8.2000000000000002e-88

    1. Initial program 84.1%

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

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

        \[\leadsto \frac{\left(-b\right) + \sqrt{\color{blue}{b \cdot b} - \left(3 \cdot a\right) \cdot c}}{3 \cdot a} \]
      3. associate-*l*83.9%

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

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

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

        \[\leadsto \left(b - \mathsf{hypot}\left(b, \sqrt{a \cdot \left(c \cdot -3\right)}\right)\right) \cdot \color{blue}{\frac{\frac{1}{a}}{-3}} \]
    7. Simplified81.3%

      \[\leadsto \color{blue}{\left(b - \mathsf{hypot}\left(b, \sqrt{a \cdot \left(c \cdot -3\right)}\right)\right) \cdot \frac{\frac{1}{a}}{-3}} \]
    8. Step-by-step derivation
      1. associate-*r*81.3%

        \[\leadsto \left(b - \mathsf{hypot}\left(b, \sqrt{\color{blue}{\left(a \cdot c\right) \cdot -3}}\right)\right) \cdot \frac{\frac{1}{a}}{-3} \]
      2. *-commutative81.3%

        \[\leadsto \left(b - \mathsf{hypot}\left(b, \sqrt{\color{blue}{-3 \cdot \left(a \cdot c\right)}}\right)\right) \cdot \frac{\frac{1}{a}}{-3} \]
      3. add-sqr-sqrt81.3%

        \[\leadsto \left(b - \mathsf{hypot}\left(b, \sqrt{\color{blue}{\sqrt{-3 \cdot \left(a \cdot c\right)} \cdot \sqrt{-3 \cdot \left(a \cdot c\right)}}}\right)\right) \cdot \frac{\frac{1}{a}}{-3} \]
      4. pow1/281.3%

        \[\leadsto \left(b - \mathsf{hypot}\left(b, \sqrt{\color{blue}{{\left(-3 \cdot \left(a \cdot c\right)\right)}^{0.5}} \cdot \sqrt{-3 \cdot \left(a \cdot c\right)}}\right)\right) \cdot \frac{\frac{1}{a}}{-3} \]
      5. pow1/281.3%

        \[\leadsto \left(b - \mathsf{hypot}\left(b, \sqrt{{\left(-3 \cdot \left(a \cdot c\right)\right)}^{0.5} \cdot \color{blue}{{\left(-3 \cdot \left(a \cdot c\right)\right)}^{0.5}}}\right)\right) \cdot \frac{\frac{1}{a}}{-3} \]
      6. pow-prod-down59.9%

        \[\leadsto \left(b - \mathsf{hypot}\left(b, \sqrt{\color{blue}{{\left(\left(-3 \cdot \left(a \cdot c\right)\right) \cdot \left(-3 \cdot \left(a \cdot c\right)\right)\right)}^{0.5}}}\right)\right) \cdot \frac{\frac{1}{a}}{-3} \]
      7. pow259.9%

        \[\leadsto \left(b - \mathsf{hypot}\left(b, \sqrt{{\color{blue}{\left({\left(-3 \cdot \left(a \cdot c\right)\right)}^{2}\right)}}^{0.5}}\right)\right) \cdot \frac{\frac{1}{a}}{-3} \]
      8. *-commutative59.9%

        \[\leadsto \left(b - \mathsf{hypot}\left(b, \sqrt{{\left({\color{blue}{\left(\left(a \cdot c\right) \cdot -3\right)}}^{2}\right)}^{0.5}}\right)\right) \cdot \frac{\frac{1}{a}}{-3} \]
      9. associate-*r*59.8%

        \[\leadsto \left(b - \mathsf{hypot}\left(b, \sqrt{{\left({\color{blue}{\left(a \cdot \left(c \cdot -3\right)\right)}}^{2}\right)}^{0.5}}\right)\right) \cdot \frac{\frac{1}{a}}{-3} \]
    9. Applied egg-rr59.8%

      \[\leadsto \left(b - \mathsf{hypot}\left(b, \sqrt{\color{blue}{{\left({\left(a \cdot \left(c \cdot -3\right)\right)}^{2}\right)}^{0.5}}}\right)\right) \cdot \frac{\frac{1}{a}}{-3} \]
    10. Step-by-step derivation
      1. unpow1/259.8%

        \[\leadsto \left(b - \mathsf{hypot}\left(b, \sqrt{\color{blue}{\sqrt{{\left(a \cdot \left(c \cdot -3\right)\right)}^{2}}}}\right)\right) \cdot \frac{\frac{1}{a}}{-3} \]
      2. unpow259.8%

        \[\leadsto \left(b - \mathsf{hypot}\left(b, \sqrt{\sqrt{\color{blue}{\left(a \cdot \left(c \cdot -3\right)\right) \cdot \left(a \cdot \left(c \cdot -3\right)\right)}}}\right)\right) \cdot \frac{\frac{1}{a}}{-3} \]
      3. rem-sqrt-square83.3%

        \[\leadsto \left(b - \mathsf{hypot}\left(b, \sqrt{\color{blue}{\left|a \cdot \left(c \cdot -3\right)\right|}}\right)\right) \cdot \frac{\frac{1}{a}}{-3} \]
      4. associate-*r*83.3%

        \[\leadsto \left(b - \mathsf{hypot}\left(b, \sqrt{\left|\color{blue}{\left(a \cdot c\right) \cdot -3}\right|}\right)\right) \cdot \frac{\frac{1}{a}}{-3} \]
      5. *-commutative83.3%

        \[\leadsto \left(b - \mathsf{hypot}\left(b, \sqrt{\left|\color{blue}{\left(c \cdot a\right)} \cdot -3\right|}\right)\right) \cdot \frac{\frac{1}{a}}{-3} \]
      6. associate-*l*83.2%

        \[\leadsto \left(b - \mathsf{hypot}\left(b, \sqrt{\left|\color{blue}{c \cdot \left(a \cdot -3\right)}\right|}\right)\right) \cdot \frac{\frac{1}{a}}{-3} \]
    11. Simplified83.2%

      \[\leadsto \left(b - \mathsf{hypot}\left(b, \sqrt{\color{blue}{\left|c \cdot \left(a \cdot -3\right)\right|}}\right)\right) \cdot \frac{\frac{1}{a}}{-3} \]
    12. Taylor expanded in b around 0 80.7%

      \[\leadsto \color{blue}{0.3333333333333333 \cdot \left(\frac{1}{a} \cdot \sqrt{\left|-3 \cdot \left(a \cdot c\right)\right|}\right)} \]
    13. Step-by-step derivation
      1. associate-*l/80.8%

        \[\leadsto 0.3333333333333333 \cdot \color{blue}{\frac{1 \cdot \sqrt{\left|-3 \cdot \left(a \cdot c\right)\right|}}{a}} \]
      2. *-lft-identity80.8%

        \[\leadsto 0.3333333333333333 \cdot \frac{\color{blue}{\sqrt{\left|-3 \cdot \left(a \cdot c\right)\right|}}}{a} \]
      3. associate-*r*80.7%

        \[\leadsto 0.3333333333333333 \cdot \frac{\sqrt{\left|\color{blue}{\left(-3 \cdot a\right) \cdot c}\right|}}{a} \]
      4. *-commutative80.7%

        \[\leadsto 0.3333333333333333 \cdot \frac{\sqrt{\left|\color{blue}{\left(a \cdot -3\right)} \cdot c\right|}}{a} \]
      5. *-commutative80.7%

        \[\leadsto 0.3333333333333333 \cdot \frac{\sqrt{\left|\color{blue}{c \cdot \left(a \cdot -3\right)}\right|}}{a} \]
      6. rem-cube-cbrt80.0%

        \[\leadsto 0.3333333333333333 \cdot \frac{\sqrt{\left|\color{blue}{{\left(\sqrt[3]{c \cdot \left(a \cdot -3\right)}\right)}^{3}}\right|}}{a} \]
      7. sqr-pow79.9%

        \[\leadsto 0.3333333333333333 \cdot \frac{\sqrt{\left|\color{blue}{{\left(\sqrt[3]{c \cdot \left(a \cdot -3\right)}\right)}^{\left(\frac{3}{2}\right)} \cdot {\left(\sqrt[3]{c \cdot \left(a \cdot -3\right)}\right)}^{\left(\frac{3}{2}\right)}}\right|}}{a} \]
      8. fabs-sqr79.9%

        \[\leadsto 0.3333333333333333 \cdot \frac{\sqrt{\color{blue}{{\left(\sqrt[3]{c \cdot \left(a \cdot -3\right)}\right)}^{\left(\frac{3}{2}\right)} \cdot {\left(\sqrt[3]{c \cdot \left(a \cdot -3\right)}\right)}^{\left(\frac{3}{2}\right)}}}}{a} \]
      9. sqr-pow79.7%

        \[\leadsto 0.3333333333333333 \cdot \frac{\sqrt{\color{blue}{{\left(\sqrt[3]{c \cdot \left(a \cdot -3\right)}\right)}^{3}}}}{a} \]
      10. rem-cube-cbrt80.4%

        \[\leadsto 0.3333333333333333 \cdot \frac{\sqrt{\color{blue}{c \cdot \left(a \cdot -3\right)}}}{a} \]
      11. *-commutative80.4%

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

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

    if 8.2000000000000002e-88 < b

    1. Initial program 39.4%

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

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

        \[\leadsto \frac{\left(-b\right) + \sqrt{\color{blue}{b \cdot b} - \left(3 \cdot a\right) \cdot c}}{3 \cdot a} \]
      3. associate-*l*39.4%

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

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

      \[\leadsto \frac{\left(-b\right) + \color{blue}{\left(b + -1.5 \cdot \frac{a \cdot c}{b}\right)}}{3 \cdot a} \]
    6. Step-by-step derivation
      1. associate-/l*88.2%

        \[\leadsto \frac{\left(-b\right) + \left(b + -1.5 \cdot \color{blue}{\left(a \cdot \frac{c}{b}\right)}\right)}{3 \cdot a} \]
    7. Simplified88.2%

      \[\leadsto \frac{\left(-b\right) + \color{blue}{\left(b + -1.5 \cdot \left(a \cdot \frac{c}{b}\right)\right)}}{3 \cdot a} \]
  3. Recombined 5 regimes into one program.
  4. Final simplification86.3%

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -1.1 \cdot 10^{-19}:\\ \;\;\;\;\frac{\frac{2}{a}}{\frac{-3}{b}}\\ \mathbf{elif}\;b \leq -4.4 \cdot 10^{-44}:\\ \;\;\;\;\frac{\sqrt{-3 \cdot \left(c \cdot a\right)} - b}{a \cdot 3}\\ \mathbf{elif}\;b \leq -1.9 \cdot 10^{-103}:\\ \;\;\;\;\frac{b \cdot \frac{2}{a}}{-3}\\ \mathbf{elif}\;b \leq 8.2 \cdot 10^{-88}:\\ \;\;\;\;0.3333333333333333 \cdot \frac{\sqrt{c \cdot \left(a \cdot -3\right)}}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(b + -1.5 \cdot \left(a \cdot \frac{c}{b}\right)\right) - b}{a \cdot 3}\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 79.4% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq -2.4 \cdot 10^{-19}:\\ \;\;\;\;\frac{\frac{2}{a}}{\frac{-3}{b}}\\ \mathbf{elif}\;b \leq -1.4 \cdot 10^{-54}:\\ \;\;\;\;\frac{\sqrt{a \cdot \left(c \cdot -3\right)} - b}{a \cdot 3}\\ \mathbf{elif}\;b \leq -8.2 \cdot 10^{-102}:\\ \;\;\;\;\frac{b \cdot \frac{2}{a}}{-3}\\ \mathbf{elif}\;b \leq 8.5 \cdot 10^{-88}:\\ \;\;\;\;0.3333333333333333 \cdot \frac{\sqrt{c \cdot \left(a \cdot -3\right)}}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(b + -1.5 \cdot \left(a \cdot \frac{c}{b}\right)\right) - b}{a \cdot 3}\\ \end{array} \end{array} \]
(FPCore (a b c)
 :precision binary64
 (if (<= b -2.4e-19)
   (/ (/ 2.0 a) (/ -3.0 b))
   (if (<= b -1.4e-54)
     (/ (- (sqrt (* a (* c -3.0))) b) (* a 3.0))
     (if (<= b -8.2e-102)
       (/ (* b (/ 2.0 a)) -3.0)
       (if (<= b 8.5e-88)
         (* 0.3333333333333333 (/ (sqrt (* c (* a -3.0))) a))
         (/ (- (+ b (* -1.5 (* a (/ c b)))) b) (* a 3.0)))))))
double code(double a, double b, double c) {
	double tmp;
	if (b <= -2.4e-19) {
		tmp = (2.0 / a) / (-3.0 / b);
	} else if (b <= -1.4e-54) {
		tmp = (sqrt((a * (c * -3.0))) - b) / (a * 3.0);
	} else if (b <= -8.2e-102) {
		tmp = (b * (2.0 / a)) / -3.0;
	} else if (b <= 8.5e-88) {
		tmp = 0.3333333333333333 * (sqrt((c * (a * -3.0))) / a);
	} else {
		tmp = ((b + (-1.5 * (a * (c / b)))) - b) / (a * 3.0);
	}
	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 <= (-2.4d-19)) then
        tmp = (2.0d0 / a) / ((-3.0d0) / b)
    else if (b <= (-1.4d-54)) then
        tmp = (sqrt((a * (c * (-3.0d0)))) - b) / (a * 3.0d0)
    else if (b <= (-8.2d-102)) then
        tmp = (b * (2.0d0 / a)) / (-3.0d0)
    else if (b <= 8.5d-88) then
        tmp = 0.3333333333333333d0 * (sqrt((c * (a * (-3.0d0)))) / a)
    else
        tmp = ((b + ((-1.5d0) * (a * (c / b)))) - b) / (a * 3.0d0)
    end if
    code = tmp
end function
public static double code(double a, double b, double c) {
	double tmp;
	if (b <= -2.4e-19) {
		tmp = (2.0 / a) / (-3.0 / b);
	} else if (b <= -1.4e-54) {
		tmp = (Math.sqrt((a * (c * -3.0))) - b) / (a * 3.0);
	} else if (b <= -8.2e-102) {
		tmp = (b * (2.0 / a)) / -3.0;
	} else if (b <= 8.5e-88) {
		tmp = 0.3333333333333333 * (Math.sqrt((c * (a * -3.0))) / a);
	} else {
		tmp = ((b + (-1.5 * (a * (c / b)))) - b) / (a * 3.0);
	}
	return tmp;
}
def code(a, b, c):
	tmp = 0
	if b <= -2.4e-19:
		tmp = (2.0 / a) / (-3.0 / b)
	elif b <= -1.4e-54:
		tmp = (math.sqrt((a * (c * -3.0))) - b) / (a * 3.0)
	elif b <= -8.2e-102:
		tmp = (b * (2.0 / a)) / -3.0
	elif b <= 8.5e-88:
		tmp = 0.3333333333333333 * (math.sqrt((c * (a * -3.0))) / a)
	else:
		tmp = ((b + (-1.5 * (a * (c / b)))) - b) / (a * 3.0)
	return tmp
function code(a, b, c)
	tmp = 0.0
	if (b <= -2.4e-19)
		tmp = Float64(Float64(2.0 / a) / Float64(-3.0 / b));
	elseif (b <= -1.4e-54)
		tmp = Float64(Float64(sqrt(Float64(a * Float64(c * -3.0))) - b) / Float64(a * 3.0));
	elseif (b <= -8.2e-102)
		tmp = Float64(Float64(b * Float64(2.0 / a)) / -3.0);
	elseif (b <= 8.5e-88)
		tmp = Float64(0.3333333333333333 * Float64(sqrt(Float64(c * Float64(a * -3.0))) / a));
	else
		tmp = Float64(Float64(Float64(b + Float64(-1.5 * Float64(a * Float64(c / b)))) - b) / Float64(a * 3.0));
	end
	return tmp
end
function tmp_2 = code(a, b, c)
	tmp = 0.0;
	if (b <= -2.4e-19)
		tmp = (2.0 / a) / (-3.0 / b);
	elseif (b <= -1.4e-54)
		tmp = (sqrt((a * (c * -3.0))) - b) / (a * 3.0);
	elseif (b <= -8.2e-102)
		tmp = (b * (2.0 / a)) / -3.0;
	elseif (b <= 8.5e-88)
		tmp = 0.3333333333333333 * (sqrt((c * (a * -3.0))) / a);
	else
		tmp = ((b + (-1.5 * (a * (c / b)))) - b) / (a * 3.0);
	end
	tmp_2 = tmp;
end
code[a_, b_, c_] := If[LessEqual[b, -2.4e-19], N[(N[(2.0 / a), $MachinePrecision] / N[(-3.0 / b), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, -1.4e-54], N[(N[(N[Sqrt[N[(a * N[(c * -3.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision] / N[(a * 3.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, -8.2e-102], N[(N[(b * N[(2.0 / a), $MachinePrecision]), $MachinePrecision] / -3.0), $MachinePrecision], If[LessEqual[b, 8.5e-88], N[(0.3333333333333333 * N[(N[Sqrt[N[(c * N[(a * -3.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], N[(N[(N[(b + N[(-1.5 * N[(a * N[(c / b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - b), $MachinePrecision] / N[(a * 3.0), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;b \leq -2.4 \cdot 10^{-19}:\\
\;\;\;\;\frac{\frac{2}{a}}{\frac{-3}{b}}\\

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

\mathbf{elif}\;b \leq -8.2 \cdot 10^{-102}:\\
\;\;\;\;\frac{b \cdot \frac{2}{a}}{-3}\\

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

\mathbf{else}:\\
\;\;\;\;\frac{\left(b + -1.5 \cdot \left(a \cdot \frac{c}{b}\right)\right) - b}{a \cdot 3}\\


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if b < -2.40000000000000023e-19

    1. Initial program 69.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. sqr-neg69.3%

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

        \[\leadsto \frac{\left(-b\right) + \sqrt{\color{blue}{b \cdot b} - \left(3 \cdot a\right) \cdot c}}{3 \cdot a} \]
      3. associate-*l*69.3%

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

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

      \[\leadsto \frac{\left(-b\right) + \color{blue}{-1 \cdot b}}{3 \cdot a} \]
    6. Step-by-step derivation
      1. mul-1-neg89.6%

        \[\leadsto \frac{\left(-b\right) + \color{blue}{\left(-b\right)}}{3 \cdot a} \]
    7. Simplified89.6%

      \[\leadsto \frac{\left(-b\right) + \color{blue}{\left(-b\right)}}{3 \cdot a} \]
    8. Step-by-step derivation
      1. count-289.6%

        \[\leadsto \frac{\color{blue}{2 \cdot \left(-b\right)}}{3 \cdot a} \]
      2. *-commutative89.6%

        \[\leadsto \frac{2 \cdot \left(-b\right)}{\color{blue}{a \cdot 3}} \]
      3. times-frac89.6%

        \[\leadsto \color{blue}{\frac{2}{a} \cdot \frac{-b}{3}} \]
      4. add-sqr-sqrt89.3%

        \[\leadsto \frac{2}{a} \cdot \frac{\color{blue}{\sqrt{-b} \cdot \sqrt{-b}}}{3} \]
      5. sqrt-unprod64.8%

        \[\leadsto \frac{2}{a} \cdot \frac{\color{blue}{\sqrt{\left(-b\right) \cdot \left(-b\right)}}}{3} \]
      6. sqr-neg64.8%

        \[\leadsto \frac{2}{a} \cdot \frac{\sqrt{\color{blue}{b \cdot b}}}{3} \]
      7. sqrt-unprod0.0%

        \[\leadsto \frac{2}{a} \cdot \frac{\color{blue}{\sqrt{b} \cdot \sqrt{b}}}{3} \]
      8. add-sqr-sqrt1.0%

        \[\leadsto \frac{2}{a} \cdot \frac{\color{blue}{b}}{3} \]
    9. Applied egg-rr1.0%

      \[\leadsto \color{blue}{\frac{2}{a} \cdot \frac{b}{3}} \]
    10. Step-by-step derivation
      1. associate-*l/1.0%

        \[\leadsto \color{blue}{\frac{2 \cdot \frac{b}{3}}{a}} \]
      2. associate-/l*1.0%

        \[\leadsto \color{blue}{2 \cdot \frac{\frac{b}{3}}{a}} \]
    11. Simplified1.0%

      \[\leadsto \color{blue}{2 \cdot \frac{\frac{b}{3}}{a}} \]
    12. Step-by-step derivation
      1. clear-num1.0%

        \[\leadsto 2 \cdot \color{blue}{\frac{1}{\frac{a}{\frac{b}{3}}}} \]
      2. un-div-inv1.0%

        \[\leadsto \color{blue}{\frac{2}{\frac{a}{\frac{b}{3}}}} \]
      3. div-inv1.0%

        \[\leadsto \frac{2}{\color{blue}{a \cdot \frac{1}{\frac{b}{3}}}} \]
      4. clear-num1.0%

        \[\leadsto \frac{2}{a \cdot \color{blue}{\frac{3}{b}}} \]
      5. frac-2neg1.0%

        \[\leadsto \frac{2}{a \cdot \color{blue}{\frac{-3}{-b}}} \]
      6. metadata-eval1.0%

        \[\leadsto \frac{2}{a \cdot \frac{\color{blue}{-3}}{-b}} \]
      7. add-sqr-sqrt1.0%

        \[\leadsto \frac{2}{a \cdot \frac{-3}{\color{blue}{\sqrt{-b} \cdot \sqrt{-b}}}} \]
      8. sqrt-unprod0.9%

        \[\leadsto \frac{2}{a \cdot \frac{-3}{\color{blue}{\sqrt{\left(-b\right) \cdot \left(-b\right)}}}} \]
      9. sqr-neg0.9%

        \[\leadsto \frac{2}{a \cdot \frac{-3}{\sqrt{\color{blue}{b \cdot b}}}} \]
      10. sqrt-unprod0.0%

        \[\leadsto \frac{2}{a \cdot \frac{-3}{\color{blue}{\sqrt{b} \cdot \sqrt{b}}}} \]
      11. add-sqr-sqrt89.6%

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

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

        \[\leadsto \color{blue}{\frac{\frac{2}{a}}{\frac{-3}{b}}} \]
    15. Simplified89.7%

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

    if -2.40000000000000023e-19 < b < -1.4000000000000001e-54

    1. Initial program 99.4%

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

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

        \[\leadsto \frac{\left(-b\right) + \sqrt{\color{blue}{b \cdot b} - \left(3 \cdot a\right) \cdot c}}{3 \cdot a} \]
      3. associate-*l*99.4%

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

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

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

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

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

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

    if -1.4000000000000001e-54 < b < -8.2000000000000005e-102

    1. Initial program 99.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. sqr-neg99.6%

        \[\leadsto \frac{\left(-b\right) + \sqrt{\color{blue}{\left(-b\right) \cdot \left(-b\right)} - \left(3 \cdot a\right) \cdot c}}{3 \cdot a} \]
      2. sqr-neg99.6%

        \[\leadsto \frac{\left(-b\right) + \sqrt{\color{blue}{b \cdot b} - \left(3 \cdot a\right) \cdot c}}{3 \cdot a} \]
      3. associate-*l*99.5%

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

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

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

        \[\leadsto \left(b - \mathsf{hypot}\left(b, \sqrt{a \cdot \left(c \cdot -3\right)}\right)\right) \cdot \color{blue}{\frac{\frac{1}{a}}{-3}} \]
    7. Simplified74.5%

      \[\leadsto \color{blue}{\left(b - \mathsf{hypot}\left(b, \sqrt{a \cdot \left(c \cdot -3\right)}\right)\right) \cdot \frac{\frac{1}{a}}{-3}} \]
    8. Step-by-step derivation
      1. associate-*r/74.7%

        \[\leadsto \color{blue}{\frac{\left(b - \mathsf{hypot}\left(b, \sqrt{a \cdot \left(c \cdot -3\right)}\right)\right) \cdot \frac{1}{a}}{-3}} \]
    9. Applied egg-rr74.7%

      \[\leadsto \color{blue}{\frac{\left(b - \mathsf{hypot}\left(b, \sqrt{a \cdot \left(c \cdot -3\right)}\right)\right) \cdot \frac{1}{a}}{-3}} \]
    10. Step-by-step derivation
      1. associate-*r/74.7%

        \[\leadsto \frac{\color{blue}{\frac{\left(b - \mathsf{hypot}\left(b, \sqrt{a \cdot \left(c \cdot -3\right)}\right)\right) \cdot 1}{a}}}{-3} \]
      2. *-rgt-identity74.7%

        \[\leadsto \frac{\frac{\color{blue}{b - \mathsf{hypot}\left(b, \sqrt{a \cdot \left(c \cdot -3\right)}\right)}}{a}}{-3} \]
      3. associate-*r*74.9%

        \[\leadsto \frac{\frac{b - \mathsf{hypot}\left(b, \sqrt{\color{blue}{\left(a \cdot c\right) \cdot -3}}\right)}{a}}{-3} \]
      4. *-commutative74.9%

        \[\leadsto \frac{\frac{b - \mathsf{hypot}\left(b, \sqrt{\color{blue}{\left(c \cdot a\right)} \cdot -3}\right)}{a}}{-3} \]
      5. associate-*l*74.9%

        \[\leadsto \frac{\frac{b - \mathsf{hypot}\left(b, \sqrt{\color{blue}{c \cdot \left(a \cdot -3\right)}}\right)}{a}}{-3} \]
    11. Simplified74.9%

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

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

        \[\leadsto \frac{\color{blue}{\frac{2 \cdot b}{a}}}{-3} \]
      2. associate-*l/76.7%

        \[\leadsto \frac{\color{blue}{\frac{2}{a} \cdot b}}{-3} \]
      3. *-commutative76.7%

        \[\leadsto \frac{\color{blue}{b \cdot \frac{2}{a}}}{-3} \]
    14. Simplified76.7%

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

    if -8.2000000000000005e-102 < b < 8.4999999999999996e-88

    1. Initial program 84.1%

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

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

        \[\leadsto \frac{\left(-b\right) + \sqrt{\color{blue}{b \cdot b} - \left(3 \cdot a\right) \cdot c}}{3 \cdot a} \]
      3. associate-*l*83.9%

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

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

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

        \[\leadsto \left(b - \mathsf{hypot}\left(b, \sqrt{a \cdot \left(c \cdot -3\right)}\right)\right) \cdot \color{blue}{\frac{\frac{1}{a}}{-3}} \]
    7. Simplified81.3%

      \[\leadsto \color{blue}{\left(b - \mathsf{hypot}\left(b, \sqrt{a \cdot \left(c \cdot -3\right)}\right)\right) \cdot \frac{\frac{1}{a}}{-3}} \]
    8. Step-by-step derivation
      1. associate-*r*81.3%

        \[\leadsto \left(b - \mathsf{hypot}\left(b, \sqrt{\color{blue}{\left(a \cdot c\right) \cdot -3}}\right)\right) \cdot \frac{\frac{1}{a}}{-3} \]
      2. *-commutative81.3%

        \[\leadsto \left(b - \mathsf{hypot}\left(b, \sqrt{\color{blue}{-3 \cdot \left(a \cdot c\right)}}\right)\right) \cdot \frac{\frac{1}{a}}{-3} \]
      3. add-sqr-sqrt81.3%

        \[\leadsto \left(b - \mathsf{hypot}\left(b, \sqrt{\color{blue}{\sqrt{-3 \cdot \left(a \cdot c\right)} \cdot \sqrt{-3 \cdot \left(a \cdot c\right)}}}\right)\right) \cdot \frac{\frac{1}{a}}{-3} \]
      4. pow1/281.3%

        \[\leadsto \left(b - \mathsf{hypot}\left(b, \sqrt{\color{blue}{{\left(-3 \cdot \left(a \cdot c\right)\right)}^{0.5}} \cdot \sqrt{-3 \cdot \left(a \cdot c\right)}}\right)\right) \cdot \frac{\frac{1}{a}}{-3} \]
      5. pow1/281.3%

        \[\leadsto \left(b - \mathsf{hypot}\left(b, \sqrt{{\left(-3 \cdot \left(a \cdot c\right)\right)}^{0.5} \cdot \color{blue}{{\left(-3 \cdot \left(a \cdot c\right)\right)}^{0.5}}}\right)\right) \cdot \frac{\frac{1}{a}}{-3} \]
      6. pow-prod-down59.9%

        \[\leadsto \left(b - \mathsf{hypot}\left(b, \sqrt{\color{blue}{{\left(\left(-3 \cdot \left(a \cdot c\right)\right) \cdot \left(-3 \cdot \left(a \cdot c\right)\right)\right)}^{0.5}}}\right)\right) \cdot \frac{\frac{1}{a}}{-3} \]
      7. pow259.9%

        \[\leadsto \left(b - \mathsf{hypot}\left(b, \sqrt{{\color{blue}{\left({\left(-3 \cdot \left(a \cdot c\right)\right)}^{2}\right)}}^{0.5}}\right)\right) \cdot \frac{\frac{1}{a}}{-3} \]
      8. *-commutative59.9%

        \[\leadsto \left(b - \mathsf{hypot}\left(b, \sqrt{{\left({\color{blue}{\left(\left(a \cdot c\right) \cdot -3\right)}}^{2}\right)}^{0.5}}\right)\right) \cdot \frac{\frac{1}{a}}{-3} \]
      9. associate-*r*59.8%

        \[\leadsto \left(b - \mathsf{hypot}\left(b, \sqrt{{\left({\color{blue}{\left(a \cdot \left(c \cdot -3\right)\right)}}^{2}\right)}^{0.5}}\right)\right) \cdot \frac{\frac{1}{a}}{-3} \]
    9. Applied egg-rr59.8%

      \[\leadsto \left(b - \mathsf{hypot}\left(b, \sqrt{\color{blue}{{\left({\left(a \cdot \left(c \cdot -3\right)\right)}^{2}\right)}^{0.5}}}\right)\right) \cdot \frac{\frac{1}{a}}{-3} \]
    10. Step-by-step derivation
      1. unpow1/259.8%

        \[\leadsto \left(b - \mathsf{hypot}\left(b, \sqrt{\color{blue}{\sqrt{{\left(a \cdot \left(c \cdot -3\right)\right)}^{2}}}}\right)\right) \cdot \frac{\frac{1}{a}}{-3} \]
      2. unpow259.8%

        \[\leadsto \left(b - \mathsf{hypot}\left(b, \sqrt{\sqrt{\color{blue}{\left(a \cdot \left(c \cdot -3\right)\right) \cdot \left(a \cdot \left(c \cdot -3\right)\right)}}}\right)\right) \cdot \frac{\frac{1}{a}}{-3} \]
      3. rem-sqrt-square83.3%

        \[\leadsto \left(b - \mathsf{hypot}\left(b, \sqrt{\color{blue}{\left|a \cdot \left(c \cdot -3\right)\right|}}\right)\right) \cdot \frac{\frac{1}{a}}{-3} \]
      4. associate-*r*83.3%

        \[\leadsto \left(b - \mathsf{hypot}\left(b, \sqrt{\left|\color{blue}{\left(a \cdot c\right) \cdot -3}\right|}\right)\right) \cdot \frac{\frac{1}{a}}{-3} \]
      5. *-commutative83.3%

        \[\leadsto \left(b - \mathsf{hypot}\left(b, \sqrt{\left|\color{blue}{\left(c \cdot a\right)} \cdot -3\right|}\right)\right) \cdot \frac{\frac{1}{a}}{-3} \]
      6. associate-*l*83.2%

        \[\leadsto \left(b - \mathsf{hypot}\left(b, \sqrt{\left|\color{blue}{c \cdot \left(a \cdot -3\right)}\right|}\right)\right) \cdot \frac{\frac{1}{a}}{-3} \]
    11. Simplified83.2%

      \[\leadsto \left(b - \mathsf{hypot}\left(b, \sqrt{\color{blue}{\left|c \cdot \left(a \cdot -3\right)\right|}}\right)\right) \cdot \frac{\frac{1}{a}}{-3} \]
    12. Taylor expanded in b around 0 80.7%

      \[\leadsto \color{blue}{0.3333333333333333 \cdot \left(\frac{1}{a} \cdot \sqrt{\left|-3 \cdot \left(a \cdot c\right)\right|}\right)} \]
    13. Step-by-step derivation
      1. associate-*l/80.8%

        \[\leadsto 0.3333333333333333 \cdot \color{blue}{\frac{1 \cdot \sqrt{\left|-3 \cdot \left(a \cdot c\right)\right|}}{a}} \]
      2. *-lft-identity80.8%

        \[\leadsto 0.3333333333333333 \cdot \frac{\color{blue}{\sqrt{\left|-3 \cdot \left(a \cdot c\right)\right|}}}{a} \]
      3. associate-*r*80.7%

        \[\leadsto 0.3333333333333333 \cdot \frac{\sqrt{\left|\color{blue}{\left(-3 \cdot a\right) \cdot c}\right|}}{a} \]
      4. *-commutative80.7%

        \[\leadsto 0.3333333333333333 \cdot \frac{\sqrt{\left|\color{blue}{\left(a \cdot -3\right)} \cdot c\right|}}{a} \]
      5. *-commutative80.7%

        \[\leadsto 0.3333333333333333 \cdot \frac{\sqrt{\left|\color{blue}{c \cdot \left(a \cdot -3\right)}\right|}}{a} \]
      6. rem-cube-cbrt80.0%

        \[\leadsto 0.3333333333333333 \cdot \frac{\sqrt{\left|\color{blue}{{\left(\sqrt[3]{c \cdot \left(a \cdot -3\right)}\right)}^{3}}\right|}}{a} \]
      7. sqr-pow79.9%

        \[\leadsto 0.3333333333333333 \cdot \frac{\sqrt{\left|\color{blue}{{\left(\sqrt[3]{c \cdot \left(a \cdot -3\right)}\right)}^{\left(\frac{3}{2}\right)} \cdot {\left(\sqrt[3]{c \cdot \left(a \cdot -3\right)}\right)}^{\left(\frac{3}{2}\right)}}\right|}}{a} \]
      8. fabs-sqr79.9%

        \[\leadsto 0.3333333333333333 \cdot \frac{\sqrt{\color{blue}{{\left(\sqrt[3]{c \cdot \left(a \cdot -3\right)}\right)}^{\left(\frac{3}{2}\right)} \cdot {\left(\sqrt[3]{c \cdot \left(a \cdot -3\right)}\right)}^{\left(\frac{3}{2}\right)}}}}{a} \]
      9. sqr-pow79.7%

        \[\leadsto 0.3333333333333333 \cdot \frac{\sqrt{\color{blue}{{\left(\sqrt[3]{c \cdot \left(a \cdot -3\right)}\right)}^{3}}}}{a} \]
      10. rem-cube-cbrt80.4%

        \[\leadsto 0.3333333333333333 \cdot \frac{\sqrt{\color{blue}{c \cdot \left(a \cdot -3\right)}}}{a} \]
      11. *-commutative80.4%

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

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

    if 8.4999999999999996e-88 < b

    1. Initial program 39.4%

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

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

        \[\leadsto \frac{\left(-b\right) + \sqrt{\color{blue}{b \cdot b} - \left(3 \cdot a\right) \cdot c}}{3 \cdot a} \]
      3. associate-*l*39.4%

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

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

      \[\leadsto \frac{\left(-b\right) + \color{blue}{\left(b + -1.5 \cdot \frac{a \cdot c}{b}\right)}}{3 \cdot a} \]
    6. Step-by-step derivation
      1. associate-/l*88.2%

        \[\leadsto \frac{\left(-b\right) + \left(b + -1.5 \cdot \color{blue}{\left(a \cdot \frac{c}{b}\right)}\right)}{3 \cdot a} \]
    7. Simplified88.2%

      \[\leadsto \frac{\left(-b\right) + \color{blue}{\left(b + -1.5 \cdot \left(a \cdot \frac{c}{b}\right)\right)}}{3 \cdot a} \]
  3. Recombined 5 regimes into one program.
  4. Final simplification86.3%

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -2.4 \cdot 10^{-19}:\\ \;\;\;\;\frac{\frac{2}{a}}{\frac{-3}{b}}\\ \mathbf{elif}\;b \leq -1.4 \cdot 10^{-54}:\\ \;\;\;\;\frac{\sqrt{a \cdot \left(c \cdot -3\right)} - b}{a \cdot 3}\\ \mathbf{elif}\;b \leq -8.2 \cdot 10^{-102}:\\ \;\;\;\;\frac{b \cdot \frac{2}{a}}{-3}\\ \mathbf{elif}\;b \leq 8.5 \cdot 10^{-88}:\\ \;\;\;\;0.3333333333333333 \cdot \frac{\sqrt{c \cdot \left(a \cdot -3\right)}}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(b + -1.5 \cdot \left(a \cdot \frac{c}{b}\right)\right) - b}{a \cdot 3}\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 86.8% accurate, 0.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq -7.2 \cdot 10^{+72}:\\
\;\;\;\;\frac{\frac{b \cdot 2}{a}}{-3}\\

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

\mathbf{else}:\\
\;\;\;\;\frac{\left(b + -1.5 \cdot \left(a \cdot \frac{c}{b}\right)\right) - b}{a \cdot 3}\\


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

    1. Initial program 58.1%

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

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

        \[\leadsto \frac{\left(-b\right) + \sqrt{\color{blue}{b \cdot b} - \left(3 \cdot a\right) \cdot c}}{3 \cdot a} \]
      3. associate-*l*58.1%

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

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

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

        \[\leadsto \left(b - \mathsf{hypot}\left(b, \sqrt{a \cdot \left(c \cdot -3\right)}\right)\right) \cdot \color{blue}{\frac{\frac{1}{a}}{-3}} \]
    7. Simplified50.1%

      \[\leadsto \color{blue}{\left(b - \mathsf{hypot}\left(b, \sqrt{a \cdot \left(c \cdot -3\right)}\right)\right) \cdot \frac{\frac{1}{a}}{-3}} \]
    8. Step-by-step derivation
      1. associate-*r/50.1%

        \[\leadsto \color{blue}{\frac{\left(b - \mathsf{hypot}\left(b, \sqrt{a \cdot \left(c \cdot -3\right)}\right)\right) \cdot \frac{1}{a}}{-3}} \]
    9. Applied egg-rr50.1%

      \[\leadsto \color{blue}{\frac{\left(b - \mathsf{hypot}\left(b, \sqrt{a \cdot \left(c \cdot -3\right)}\right)\right) \cdot \frac{1}{a}}{-3}} \]
    10. Step-by-step derivation
      1. associate-*r/50.2%

        \[\leadsto \frac{\color{blue}{\frac{\left(b - \mathsf{hypot}\left(b, \sqrt{a \cdot \left(c \cdot -3\right)}\right)\right) \cdot 1}{a}}}{-3} \]
      2. *-rgt-identity50.2%

        \[\leadsto \frac{\frac{\color{blue}{b - \mathsf{hypot}\left(b, \sqrt{a \cdot \left(c \cdot -3\right)}\right)}}{a}}{-3} \]
      3. associate-*r*50.2%

        \[\leadsto \frac{\frac{b - \mathsf{hypot}\left(b, \sqrt{\color{blue}{\left(a \cdot c\right) \cdot -3}}\right)}{a}}{-3} \]
      4. *-commutative50.2%

        \[\leadsto \frac{\frac{b - \mathsf{hypot}\left(b, \sqrt{\color{blue}{\left(c \cdot a\right)} \cdot -3}\right)}{a}}{-3} \]
      5. associate-*l*50.2%

        \[\leadsto \frac{\frac{b - \mathsf{hypot}\left(b, \sqrt{\color{blue}{c \cdot \left(a \cdot -3\right)}}\right)}{a}}{-3} \]
    11. Simplified50.2%

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

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

        \[\leadsto \frac{\color{blue}{\frac{2 \cdot b}{a}}}{-3} \]
    14. Simplified94.0%

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

    if -7.20000000000000069e72 < b < 8.5999999999999994e32

    1. Initial program 87.8%

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

        \[\leadsto \frac{\left(-b\right) + \sqrt{\color{blue}{\left(-b\right) \cdot \left(-b\right)} - \left(3 \cdot a\right) \cdot c}}{3 \cdot a} \]
      2. sqr-neg87.8%

        \[\leadsto \frac{\left(-b\right) + \sqrt{\color{blue}{b \cdot b} - \left(3 \cdot a\right) \cdot c}}{3 \cdot a} \]
      3. associate-*l*87.7%

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

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

    if 8.5999999999999994e32 < b

    1. Initial program 29.8%

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

        \[\leadsto \frac{\left(-b\right) + \sqrt{\color{blue}{\left(-b\right) \cdot \left(-b\right)} - \left(3 \cdot a\right) \cdot c}}{3 \cdot a} \]
      2. sqr-neg29.8%

        \[\leadsto \frac{\left(-b\right) + \sqrt{\color{blue}{b \cdot b} - \left(3 \cdot a\right) \cdot c}}{3 \cdot a} \]
      3. associate-*l*29.8%

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

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

      \[\leadsto \frac{\left(-b\right) + \color{blue}{\left(b + -1.5 \cdot \frac{a \cdot c}{b}\right)}}{3 \cdot a} \]
    6. Step-by-step derivation
      1. associate-/l*93.9%

        \[\leadsto \frac{\left(-b\right) + \left(b + -1.5 \cdot \color{blue}{\left(a \cdot \frac{c}{b}\right)}\right)}{3 \cdot a} \]
    7. Simplified93.9%

      \[\leadsto \frac{\left(-b\right) + \color{blue}{\left(b + -1.5 \cdot \left(a \cdot \frac{c}{b}\right)\right)}}{3 \cdot a} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification90.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -7.2 \cdot 10^{+72}:\\ \;\;\;\;\frac{\frac{b \cdot 2}{a}}{-3}\\ \mathbf{elif}\;b \leq 8.6 \cdot 10^{+32}:\\ \;\;\;\;\frac{\sqrt{b \cdot b - 3 \cdot \left(c \cdot a\right)} - b}{a \cdot 3}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(b + -1.5 \cdot \left(a \cdot \frac{c}{b}\right)\right) - b}{a \cdot 3}\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 86.8% accurate, 0.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq -1.85 \cdot 10^{+72}:\\
\;\;\;\;\frac{\frac{b \cdot 2}{a}}{-3}\\

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

\mathbf{else}:\\
\;\;\;\;\frac{\left(b + -1.5 \cdot \left(a \cdot \frac{c}{b}\right)\right) - b}{a \cdot 3}\\


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

    1. Initial program 58.1%

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

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

        \[\leadsto \frac{\left(-b\right) + \sqrt{\color{blue}{b \cdot b} - \left(3 \cdot a\right) \cdot c}}{3 \cdot a} \]
      3. associate-*l*58.1%

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

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

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

        \[\leadsto \left(b - \mathsf{hypot}\left(b, \sqrt{a \cdot \left(c \cdot -3\right)}\right)\right) \cdot \color{blue}{\frac{\frac{1}{a}}{-3}} \]
    7. Simplified50.1%

      \[\leadsto \color{blue}{\left(b - \mathsf{hypot}\left(b, \sqrt{a \cdot \left(c \cdot -3\right)}\right)\right) \cdot \frac{\frac{1}{a}}{-3}} \]
    8. Step-by-step derivation
      1. associate-*r/50.1%

        \[\leadsto \color{blue}{\frac{\left(b - \mathsf{hypot}\left(b, \sqrt{a \cdot \left(c \cdot -3\right)}\right)\right) \cdot \frac{1}{a}}{-3}} \]
    9. Applied egg-rr50.1%

      \[\leadsto \color{blue}{\frac{\left(b - \mathsf{hypot}\left(b, \sqrt{a \cdot \left(c \cdot -3\right)}\right)\right) \cdot \frac{1}{a}}{-3}} \]
    10. Step-by-step derivation
      1. associate-*r/50.2%

        \[\leadsto \frac{\color{blue}{\frac{\left(b - \mathsf{hypot}\left(b, \sqrt{a \cdot \left(c \cdot -3\right)}\right)\right) \cdot 1}{a}}}{-3} \]
      2. *-rgt-identity50.2%

        \[\leadsto \frac{\frac{\color{blue}{b - \mathsf{hypot}\left(b, \sqrt{a \cdot \left(c \cdot -3\right)}\right)}}{a}}{-3} \]
      3. associate-*r*50.2%

        \[\leadsto \frac{\frac{b - \mathsf{hypot}\left(b, \sqrt{\color{blue}{\left(a \cdot c\right) \cdot -3}}\right)}{a}}{-3} \]
      4. *-commutative50.2%

        \[\leadsto \frac{\frac{b - \mathsf{hypot}\left(b, \sqrt{\color{blue}{\left(c \cdot a\right)} \cdot -3}\right)}{a}}{-3} \]
      5. associate-*l*50.2%

        \[\leadsto \frac{\frac{b - \mathsf{hypot}\left(b, \sqrt{\color{blue}{c \cdot \left(a \cdot -3\right)}}\right)}{a}}{-3} \]
    11. Simplified50.2%

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

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

        \[\leadsto \frac{\color{blue}{\frac{2 \cdot b}{a}}}{-3} \]
    14. Simplified94.0%

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

    if -1.8500000000000001e72 < b < 8.5999999999999994e32

    1. Initial program 87.8%

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

    if 8.5999999999999994e32 < b

    1. Initial program 29.8%

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

        \[\leadsto \frac{\left(-b\right) + \sqrt{\color{blue}{\left(-b\right) \cdot \left(-b\right)} - \left(3 \cdot a\right) \cdot c}}{3 \cdot a} \]
      2. sqr-neg29.8%

        \[\leadsto \frac{\left(-b\right) + \sqrt{\color{blue}{b \cdot b} - \left(3 \cdot a\right) \cdot c}}{3 \cdot a} \]
      3. associate-*l*29.8%

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

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

      \[\leadsto \frac{\left(-b\right) + \color{blue}{\left(b + -1.5 \cdot \frac{a \cdot c}{b}\right)}}{3 \cdot a} \]
    6. Step-by-step derivation
      1. associate-/l*93.9%

        \[\leadsto \frac{\left(-b\right) + \left(b + -1.5 \cdot \color{blue}{\left(a \cdot \frac{c}{b}\right)}\right)}{3 \cdot a} \]
    7. Simplified93.9%

      \[\leadsto \frac{\left(-b\right) + \color{blue}{\left(b + -1.5 \cdot \left(a \cdot \frac{c}{b}\right)\right)}}{3 \cdot a} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification90.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -1.85 \cdot 10^{+72}:\\ \;\;\;\;\frac{\frac{b \cdot 2}{a}}{-3}\\ \mathbf{elif}\;b \leq 8.6 \cdot 10^{+32}:\\ \;\;\;\;\frac{\sqrt{b \cdot b - c \cdot \left(a \cdot 3\right)} - b}{a \cdot 3}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(b + -1.5 \cdot \left(a \cdot \frac{c}{b}\right)\right) - b}{a \cdot 3}\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 65.2% accurate, 5.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq -5 \cdot 10^{-310}:\\ \;\;\;\;\frac{\frac{b \cdot 2}{a}}{-3}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(b + -1.5 \cdot \left(a \cdot \frac{c}{b}\right)\right) - b}{a \cdot 3}\\ \end{array} \end{array} \]
(FPCore (a b c)
 :precision binary64
 (if (<= b -5e-310)
   (/ (/ (* b 2.0) a) -3.0)
   (/ (- (+ b (* -1.5 (* a (/ c b)))) b) (* a 3.0))))
double code(double a, double b, double c) {
	double tmp;
	if (b <= -5e-310) {
		tmp = ((b * 2.0) / a) / -3.0;
	} else {
		tmp = ((b + (-1.5 * (a * (c / b)))) - b) / (a * 3.0);
	}
	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 * 2.0d0) / a) / (-3.0d0)
    else
        tmp = ((b + ((-1.5d0) * (a * (c / b)))) - b) / (a * 3.0d0)
    end if
    code = tmp
end function
public static double code(double a, double b, double c) {
	double tmp;
	if (b <= -5e-310) {
		tmp = ((b * 2.0) / a) / -3.0;
	} else {
		tmp = ((b + (-1.5 * (a * (c / b)))) - b) / (a * 3.0);
	}
	return tmp;
}
def code(a, b, c):
	tmp = 0
	if b <= -5e-310:
		tmp = ((b * 2.0) / a) / -3.0
	else:
		tmp = ((b + (-1.5 * (a * (c / b)))) - b) / (a * 3.0)
	return tmp
function code(a, b, c)
	tmp = 0.0
	if (b <= -5e-310)
		tmp = Float64(Float64(Float64(b * 2.0) / a) / -3.0);
	else
		tmp = Float64(Float64(Float64(b + Float64(-1.5 * Float64(a * Float64(c / b)))) - b) / Float64(a * 3.0));
	end
	return tmp
end
function tmp_2 = code(a, b, c)
	tmp = 0.0;
	if (b <= -5e-310)
		tmp = ((b * 2.0) / a) / -3.0;
	else
		tmp = ((b + (-1.5 * (a * (c / b)))) - b) / (a * 3.0);
	end
	tmp_2 = tmp;
end
code[a_, b_, c_] := If[LessEqual[b, -5e-310], N[(N[(N[(b * 2.0), $MachinePrecision] / a), $MachinePrecision] / -3.0), $MachinePrecision], N[(N[(N[(b + N[(-1.5 * N[(a * N[(c / b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - b), $MachinePrecision] / N[(a * 3.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;b \leq -5 \cdot 10^{-310}:\\
\;\;\;\;\frac{\frac{b \cdot 2}{a}}{-3}\\

\mathbf{else}:\\
\;\;\;\;\frac{\left(b + -1.5 \cdot \left(a \cdot \frac{c}{b}\right)\right) - b}{a \cdot 3}\\


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

    1. Initial program 77.4%

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

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

        \[\leadsto \frac{\left(-b\right) + \sqrt{\color{blue}{b \cdot b} - \left(3 \cdot a\right) \cdot c}}{3 \cdot a} \]
      3. associate-*l*77.4%

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

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

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

        \[\leadsto \left(b - \mathsf{hypot}\left(b, \sqrt{a \cdot \left(c \cdot -3\right)}\right)\right) \cdot \color{blue}{\frac{\frac{1}{a}}{-3}} \]
    7. Simplified63.8%

      \[\leadsto \color{blue}{\left(b - \mathsf{hypot}\left(b, \sqrt{a \cdot \left(c \cdot -3\right)}\right)\right) \cdot \frac{\frac{1}{a}}{-3}} \]
    8. Step-by-step derivation
      1. associate-*r/63.8%

        \[\leadsto \color{blue}{\frac{\left(b - \mathsf{hypot}\left(b, \sqrt{a \cdot \left(c \cdot -3\right)}\right)\right) \cdot \frac{1}{a}}{-3}} \]
    9. Applied egg-rr63.8%

      \[\leadsto \color{blue}{\frac{\left(b - \mathsf{hypot}\left(b, \sqrt{a \cdot \left(c \cdot -3\right)}\right)\right) \cdot \frac{1}{a}}{-3}} \]
    10. Step-by-step derivation
      1. associate-*r/63.9%

        \[\leadsto \frac{\color{blue}{\frac{\left(b - \mathsf{hypot}\left(b, \sqrt{a \cdot \left(c \cdot -3\right)}\right)\right) \cdot 1}{a}}}{-3} \]
      2. *-rgt-identity63.9%

        \[\leadsto \frac{\frac{\color{blue}{b - \mathsf{hypot}\left(b, \sqrt{a \cdot \left(c \cdot -3\right)}\right)}}{a}}{-3} \]
      3. associate-*r*64.0%

        \[\leadsto \frac{\frac{b - \mathsf{hypot}\left(b, \sqrt{\color{blue}{\left(a \cdot c\right) \cdot -3}}\right)}{a}}{-3} \]
      4. *-commutative64.0%

        \[\leadsto \frac{\frac{b - \mathsf{hypot}\left(b, \sqrt{\color{blue}{\left(c \cdot a\right)} \cdot -3}\right)}{a}}{-3} \]
      5. associate-*l*63.9%

        \[\leadsto \frac{\frac{b - \mathsf{hypot}\left(b, \sqrt{\color{blue}{c \cdot \left(a \cdot -3\right)}}\right)}{a}}{-3} \]
    11. Simplified63.9%

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

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

        \[\leadsto \frac{\color{blue}{\frac{2 \cdot b}{a}}}{-3} \]
    14. Simplified69.7%

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

    if -4.999999999999985e-310 < b

    1. Initial program 53.8%

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

        \[\leadsto \frac{\left(-b\right) + \sqrt{\color{blue}{\left(-b\right) \cdot \left(-b\right)} - \left(3 \cdot a\right) \cdot c}}{3 \cdot a} \]
      2. sqr-neg53.8%

        \[\leadsto \frac{\left(-b\right) + \sqrt{\color{blue}{b \cdot b} - \left(3 \cdot a\right) \cdot c}}{3 \cdot a} \]
      3. associate-*l*53.8%

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

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

      \[\leadsto \frac{\left(-b\right) + \color{blue}{\left(b + -1.5 \cdot \frac{a \cdot c}{b}\right)}}{3 \cdot a} \]
    6. Step-by-step derivation
      1. associate-/l*63.4%

        \[\leadsto \frac{\left(-b\right) + \left(b + -1.5 \cdot \color{blue}{\left(a \cdot \frac{c}{b}\right)}\right)}{3 \cdot a} \]
    7. Simplified63.4%

      \[\leadsto \frac{\left(-b\right) + \color{blue}{\left(b + -1.5 \cdot \left(a \cdot \frac{c}{b}\right)\right)}}{3 \cdot a} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification66.7%

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

Alternative 8: 65.3% accurate, 5.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq -5 \cdot 10^{-310}:\\ \;\;\;\;\frac{\left(\frac{c}{b} \cdot \left(a \cdot 1.5\right) - b\right) - b}{a \cdot 3}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(b + -1.5 \cdot \left(a \cdot \frac{c}{b}\right)\right) - b}{a \cdot 3}\\ \end{array} \end{array} \]
(FPCore (a b c)
 :precision binary64
 (if (<= b -5e-310)
   (/ (- (- (* (/ c b) (* a 1.5)) b) b) (* a 3.0))
   (/ (- (+ b (* -1.5 (* a (/ c b)))) b) (* a 3.0))))
double code(double a, double b, double c) {
	double tmp;
	if (b <= -5e-310) {
		tmp = ((((c / b) * (a * 1.5)) - b) - b) / (a * 3.0);
	} else {
		tmp = ((b + (-1.5 * (a * (c / b)))) - b) / (a * 3.0);
	}
	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 = ((((c / b) * (a * 1.5d0)) - b) - b) / (a * 3.0d0)
    else
        tmp = ((b + ((-1.5d0) * (a * (c / b)))) - b) / (a * 3.0d0)
    end if
    code = tmp
end function
public static double code(double a, double b, double c) {
	double tmp;
	if (b <= -5e-310) {
		tmp = ((((c / b) * (a * 1.5)) - b) - b) / (a * 3.0);
	} else {
		tmp = ((b + (-1.5 * (a * (c / b)))) - b) / (a * 3.0);
	}
	return tmp;
}
def code(a, b, c):
	tmp = 0
	if b <= -5e-310:
		tmp = ((((c / b) * (a * 1.5)) - b) - b) / (a * 3.0)
	else:
		tmp = ((b + (-1.5 * (a * (c / b)))) - b) / (a * 3.0)
	return tmp
function code(a, b, c)
	tmp = 0.0
	if (b <= -5e-310)
		tmp = Float64(Float64(Float64(Float64(Float64(c / b) * Float64(a * 1.5)) - b) - b) / Float64(a * 3.0));
	else
		tmp = Float64(Float64(Float64(b + Float64(-1.5 * Float64(a * Float64(c / b)))) - b) / Float64(a * 3.0));
	end
	return tmp
end
function tmp_2 = code(a, b, c)
	tmp = 0.0;
	if (b <= -5e-310)
		tmp = ((((c / b) * (a * 1.5)) - b) - b) / (a * 3.0);
	else
		tmp = ((b + (-1.5 * (a * (c / b)))) - b) / (a * 3.0);
	end
	tmp_2 = tmp;
end
code[a_, b_, c_] := If[LessEqual[b, -5e-310], N[(N[(N[(N[(N[(c / b), $MachinePrecision] * N[(a * 1.5), $MachinePrecision]), $MachinePrecision] - b), $MachinePrecision] - b), $MachinePrecision] / N[(a * 3.0), $MachinePrecision]), $MachinePrecision], N[(N[(N[(b + N[(-1.5 * N[(a * N[(c / b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - b), $MachinePrecision] / N[(a * 3.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

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

\mathbf{else}:\\
\;\;\;\;\frac{\left(b + -1.5 \cdot \left(a \cdot \frac{c}{b}\right)\right) - b}{a \cdot 3}\\


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

    1. Initial program 77.4%

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

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

        \[\leadsto \frac{\left(-b\right) + \sqrt{\color{blue}{b \cdot b} - \left(3 \cdot a\right) \cdot c}}{3 \cdot a} \]
      3. associate-*l*77.4%

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

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

      \[\leadsto \frac{\left(-b\right) + \color{blue}{\left(-1 \cdot b + 1.5 \cdot \frac{a \cdot c}{b}\right)}}{3 \cdot a} \]
    6. Step-by-step derivation
      1. +-commutative66.6%

        \[\leadsto \frac{\left(-b\right) + \color{blue}{\left(1.5 \cdot \frac{a \cdot c}{b} + -1 \cdot b\right)}}{3 \cdot a} \]
      2. mul-1-neg66.6%

        \[\leadsto \frac{\left(-b\right) + \left(1.5 \cdot \frac{a \cdot c}{b} + \color{blue}{\left(-b\right)}\right)}{3 \cdot a} \]
      3. unsub-neg66.6%

        \[\leadsto \frac{\left(-b\right) + \color{blue}{\left(1.5 \cdot \frac{a \cdot c}{b} - b\right)}}{3 \cdot a} \]
      4. associate-/l*69.7%

        \[\leadsto \frac{\left(-b\right) + \left(1.5 \cdot \color{blue}{\left(a \cdot \frac{c}{b}\right)} - b\right)}{3 \cdot a} \]
      5. associate-*r*69.7%

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

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

    if -4.999999999999985e-310 < b

    1. Initial program 53.8%

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

        \[\leadsto \frac{\left(-b\right) + \sqrt{\color{blue}{\left(-b\right) \cdot \left(-b\right)} - \left(3 \cdot a\right) \cdot c}}{3 \cdot a} \]
      2. sqr-neg53.8%

        \[\leadsto \frac{\left(-b\right) + \sqrt{\color{blue}{b \cdot b} - \left(3 \cdot a\right) \cdot c}}{3 \cdot a} \]
      3. associate-*l*53.8%

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

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

      \[\leadsto \frac{\left(-b\right) + \color{blue}{\left(b + -1.5 \cdot \frac{a \cdot c}{b}\right)}}{3 \cdot a} \]
    6. Step-by-step derivation
      1. associate-/l*63.4%

        \[\leadsto \frac{\left(-b\right) + \left(b + -1.5 \cdot \color{blue}{\left(a \cdot \frac{c}{b}\right)}\right)}{3 \cdot a} \]
    7. Simplified63.4%

      \[\leadsto \frac{\left(-b\right) + \color{blue}{\left(b + -1.5 \cdot \left(a \cdot \frac{c}{b}\right)\right)}}{3 \cdot a} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification66.7%

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

Alternative 9: 64.6% accurate, 7.2× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;0\\


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

    1. Initial program 75.8%

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

        \[\leadsto \frac{\left(-b\right) + \sqrt{\color{blue}{\left(-b\right) \cdot \left(-b\right)} - \left(3 \cdot a\right) \cdot c}}{3 \cdot a} \]
      2. sqr-neg75.8%

        \[\leadsto \frac{\left(-b\right) + \sqrt{\color{blue}{b \cdot b} - \left(3 \cdot a\right) \cdot c}}{3 \cdot a} \]
      3. associate-*l*75.8%

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

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

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

    if -2.20000000000000009e-231 < b

    1. Initial program 56.9%

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

        \[\leadsto \frac{\left(-b\right) + \sqrt{\color{blue}{\left(-b\right) \cdot \left(-b\right)} - \left(3 \cdot a\right) \cdot c}}{3 \cdot a} \]
      2. sqr-neg56.9%

        \[\leadsto \frac{\left(-b\right) + \sqrt{\color{blue}{b \cdot b} - \left(3 \cdot a\right) \cdot c}}{3 \cdot a} \]
      3. associate-*l*56.8%

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

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

      \[\leadsto \frac{\left(-b\right) + \color{blue}{-1 \cdot b}}{3 \cdot a} \]
    6. Step-by-step derivation
      1. mul-1-neg2.7%

        \[\leadsto \frac{\left(-b\right) + \color{blue}{\left(-b\right)}}{3 \cdot a} \]
    7. Simplified2.7%

      \[\leadsto \frac{\left(-b\right) + \color{blue}{\left(-b\right)}}{3 \cdot a} \]
    8. Step-by-step derivation
      1. expm1-log1p-u2.1%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{\left(-b\right) + \left(-b\right)}{3 \cdot a}\right)\right)} \]
      2. expm1-undefine8.0%

        \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\frac{\left(-b\right) + \left(-b\right)}{3 \cdot a}\right)} - 1} \]
      3. associate-/r*8.0%

        \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{\frac{\frac{\left(-b\right) + \left(-b\right)}{3}}{a}}\right)} - 1 \]
      4. unsub-neg8.0%

        \[\leadsto e^{\mathsf{log1p}\left(\frac{\frac{\color{blue}{\left(-b\right) - b}}{3}}{a}\right)} - 1 \]
      5. add-sqr-sqrt7.7%

        \[\leadsto e^{\mathsf{log1p}\left(\frac{\frac{\left(-b\right) - \color{blue}{\sqrt{b} \cdot \sqrt{b}}}{3}}{a}\right)} - 1 \]
      6. sqrt-unprod4.9%

        \[\leadsto e^{\mathsf{log1p}\left(\frac{\frac{\left(-b\right) - \color{blue}{\sqrt{b \cdot b}}}{3}}{a}\right)} - 1 \]
      7. sqr-neg4.9%

        \[\leadsto e^{\mathsf{log1p}\left(\frac{\frac{\left(-b\right) - \sqrt{\color{blue}{\left(-b\right) \cdot \left(-b\right)}}}{3}}{a}\right)} - 1 \]
      8. sqrt-unprod0.3%

        \[\leadsto e^{\mathsf{log1p}\left(\frac{\frac{\left(-b\right) - \color{blue}{\sqrt{-b} \cdot \sqrt{-b}}}{3}}{a}\right)} - 1 \]
      9. add-sqr-sqrt58.3%

        \[\leadsto e^{\mathsf{log1p}\left(\frac{\frac{\left(-b\right) - \color{blue}{\left(-b\right)}}{3}}{a}\right)} - 1 \]
      10. +-inverses58.3%

        \[\leadsto e^{\mathsf{log1p}\left(\frac{\frac{\color{blue}{0}}{3}}{a}\right)} - 1 \]
      11. metadata-eval58.3%

        \[\leadsto e^{\mathsf{log1p}\left(\frac{\color{blue}{0}}{a}\right)} - 1 \]
    9. Applied egg-rr58.3%

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\frac{0}{a}\right)} - 1} \]
    10. Step-by-step derivation
      1. log1p-undefine58.3%

        \[\leadsto e^{\color{blue}{\log \left(1 + \frac{0}{a}\right)}} - 1 \]
      2. div058.3%

        \[\leadsto e^{\log \left(1 + \color{blue}{0}\right)} - 1 \]
      3. metadata-eval58.3%

        \[\leadsto e^{\log \color{blue}{1}} - 1 \]
      4. metadata-eval58.3%

        \[\leadsto e^{\color{blue}{0}} - 1 \]
      5. 1-exp58.3%

        \[\leadsto \color{blue}{1} - 1 \]
      6. metadata-eval58.3%

        \[\leadsto \color{blue}{0} \]
    11. Simplified58.3%

      \[\leadsto \color{blue}{0} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification66.1%

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

Alternative 10: 64.6% accurate, 9.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq -2 \cdot 10^{-304}:\\ \;\;\;\;\frac{\frac{2}{a}}{\frac{-3}{b}}\\ \mathbf{else}:\\ \;\;\;\;0\\ \end{array} \end{array} \]
(FPCore (a b c)
 :precision binary64
 (if (<= b -2e-304) (/ (/ 2.0 a) (/ -3.0 b)) 0.0))
double code(double a, double b, double c) {
	double tmp;
	if (b <= -2e-304) {
		tmp = (2.0 / a) / (-3.0 / b);
	} else {
		tmp = 0.0;
	}
	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 <= (-2d-304)) then
        tmp = (2.0d0 / a) / ((-3.0d0) / b)
    else
        tmp = 0.0d0
    end if
    code = tmp
end function
public static double code(double a, double b, double c) {
	double tmp;
	if (b <= -2e-304) {
		tmp = (2.0 / a) / (-3.0 / b);
	} else {
		tmp = 0.0;
	}
	return tmp;
}
def code(a, b, c):
	tmp = 0
	if b <= -2e-304:
		tmp = (2.0 / a) / (-3.0 / b)
	else:
		tmp = 0.0
	return tmp
function code(a, b, c)
	tmp = 0.0
	if (b <= -2e-304)
		tmp = Float64(Float64(2.0 / a) / Float64(-3.0 / b));
	else
		tmp = 0.0;
	end
	return tmp
end
function tmp_2 = code(a, b, c)
	tmp = 0.0;
	if (b <= -2e-304)
		tmp = (2.0 / a) / (-3.0 / b);
	else
		tmp = 0.0;
	end
	tmp_2 = tmp;
end
code[a_, b_, c_] := If[LessEqual[b, -2e-304], N[(N[(2.0 / a), $MachinePrecision] / N[(-3.0 / b), $MachinePrecision]), $MachinePrecision], 0.0]
\begin{array}{l}

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

\mathbf{else}:\\
\;\;\;\;0\\


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

    1. Initial program 77.4%

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

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

        \[\leadsto \frac{\left(-b\right) + \sqrt{\color{blue}{b \cdot b} - \left(3 \cdot a\right) \cdot c}}{3 \cdot a} \]
      3. associate-*l*77.4%

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

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

      \[\leadsto \frac{\left(-b\right) + \color{blue}{-1 \cdot b}}{3 \cdot a} \]
    6. Step-by-step derivation
      1. mul-1-neg69.6%

        \[\leadsto \frac{\left(-b\right) + \color{blue}{\left(-b\right)}}{3 \cdot a} \]
    7. Simplified69.6%

      \[\leadsto \frac{\left(-b\right) + \color{blue}{\left(-b\right)}}{3 \cdot a} \]
    8. Step-by-step derivation
      1. count-269.6%

        \[\leadsto \frac{\color{blue}{2 \cdot \left(-b\right)}}{3 \cdot a} \]
      2. *-commutative69.6%

        \[\leadsto \frac{2 \cdot \left(-b\right)}{\color{blue}{a \cdot 3}} \]
      3. times-frac69.6%

        \[\leadsto \color{blue}{\frac{2}{a} \cdot \frac{-b}{3}} \]
      4. add-sqr-sqrt69.3%

        \[\leadsto \frac{2}{a} \cdot \frac{\color{blue}{\sqrt{-b} \cdot \sqrt{-b}}}{3} \]
      5. sqrt-unprod52.4%

        \[\leadsto \frac{2}{a} \cdot \frac{\color{blue}{\sqrt{\left(-b\right) \cdot \left(-b\right)}}}{3} \]
      6. sqr-neg52.4%

        \[\leadsto \frac{2}{a} \cdot \frac{\sqrt{\color{blue}{b \cdot b}}}{3} \]
      7. sqrt-unprod0.0%

        \[\leadsto \frac{2}{a} \cdot \frac{\color{blue}{\sqrt{b} \cdot \sqrt{b}}}{3} \]
      8. add-sqr-sqrt1.5%

        \[\leadsto \frac{2}{a} \cdot \frac{\color{blue}{b}}{3} \]
    9. Applied egg-rr1.5%

      \[\leadsto \color{blue}{\frac{2}{a} \cdot \frac{b}{3}} \]
    10. Step-by-step derivation
      1. associate-*l/1.5%

        \[\leadsto \color{blue}{\frac{2 \cdot \frac{b}{3}}{a}} \]
      2. associate-/l*1.5%

        \[\leadsto \color{blue}{2 \cdot \frac{\frac{b}{3}}{a}} \]
    11. Simplified1.5%

      \[\leadsto \color{blue}{2 \cdot \frac{\frac{b}{3}}{a}} \]
    12. Step-by-step derivation
      1. clear-num1.5%

        \[\leadsto 2 \cdot \color{blue}{\frac{1}{\frac{a}{\frac{b}{3}}}} \]
      2. un-div-inv1.5%

        \[\leadsto \color{blue}{\frac{2}{\frac{a}{\frac{b}{3}}}} \]
      3. div-inv1.5%

        \[\leadsto \frac{2}{\color{blue}{a \cdot \frac{1}{\frac{b}{3}}}} \]
      4. clear-num1.5%

        \[\leadsto \frac{2}{a \cdot \color{blue}{\frac{3}{b}}} \]
      5. frac-2neg1.5%

        \[\leadsto \frac{2}{a \cdot \color{blue}{\frac{-3}{-b}}} \]
      6. metadata-eval1.5%

        \[\leadsto \frac{2}{a \cdot \frac{\color{blue}{-3}}{-b}} \]
      7. add-sqr-sqrt1.5%

        \[\leadsto \frac{2}{a \cdot \frac{-3}{\color{blue}{\sqrt{-b} \cdot \sqrt{-b}}}} \]
      8. sqrt-unprod1.4%

        \[\leadsto \frac{2}{a \cdot \frac{-3}{\color{blue}{\sqrt{\left(-b\right) \cdot \left(-b\right)}}}} \]
      9. sqr-neg1.4%

        \[\leadsto \frac{2}{a \cdot \frac{-3}{\sqrt{\color{blue}{b \cdot b}}}} \]
      10. sqrt-unprod0.0%

        \[\leadsto \frac{2}{a \cdot \frac{-3}{\color{blue}{\sqrt{b} \cdot \sqrt{b}}}} \]
      11. add-sqr-sqrt69.6%

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

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

        \[\leadsto \color{blue}{\frac{\frac{2}{a}}{\frac{-3}{b}}} \]
    15. Simplified69.6%

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

    if -1.99999999999999994e-304 < b

    1. Initial program 53.8%

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

        \[\leadsto \frac{\left(-b\right) + \sqrt{\color{blue}{\left(-b\right) \cdot \left(-b\right)} - \left(3 \cdot a\right) \cdot c}}{3 \cdot a} \]
      2. sqr-neg53.8%

        \[\leadsto \frac{\left(-b\right) + \sqrt{\color{blue}{b \cdot b} - \left(3 \cdot a\right) \cdot c}}{3 \cdot a} \]
      3. associate-*l*53.8%

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

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

      \[\leadsto \frac{\left(-b\right) + \color{blue}{-1 \cdot b}}{3 \cdot a} \]
    6. Step-by-step derivation
      1. mul-1-neg2.5%

        \[\leadsto \frac{\left(-b\right) + \color{blue}{\left(-b\right)}}{3 \cdot a} \]
    7. Simplified2.5%

      \[\leadsto \frac{\left(-b\right) + \color{blue}{\left(-b\right)}}{3 \cdot a} \]
    8. Step-by-step derivation
      1. expm1-log1p-u1.9%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{\left(-b\right) + \left(-b\right)}{3 \cdot a}\right)\right)} \]
      2. expm1-undefine8.2%

        \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\frac{\left(-b\right) + \left(-b\right)}{3 \cdot a}\right)} - 1} \]
      3. associate-/r*8.2%

        \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{\frac{\frac{\left(-b\right) + \left(-b\right)}{3}}{a}}\right)} - 1 \]
      4. unsub-neg8.2%

        \[\leadsto e^{\mathsf{log1p}\left(\frac{\frac{\color{blue}{\left(-b\right) - b}}{3}}{a}\right)} - 1 \]
      5. add-sqr-sqrt8.2%

        \[\leadsto e^{\mathsf{log1p}\left(\frac{\frac{\left(-b\right) - \color{blue}{\sqrt{b} \cdot \sqrt{b}}}{3}}{a}\right)} - 1 \]
      6. sqrt-unprod4.9%

        \[\leadsto e^{\mathsf{log1p}\left(\frac{\frac{\left(-b\right) - \color{blue}{\sqrt{b \cdot b}}}{3}}{a}\right)} - 1 \]
      7. sqr-neg4.9%

        \[\leadsto e^{\mathsf{log1p}\left(\frac{\frac{\left(-b\right) - \sqrt{\color{blue}{\left(-b\right) \cdot \left(-b\right)}}}{3}}{a}\right)} - 1 \]
      8. sqrt-unprod0.0%

        \[\leadsto e^{\mathsf{log1p}\left(\frac{\frac{\left(-b\right) - \color{blue}{\sqrt{-b} \cdot \sqrt{-b}}}{3}}{a}\right)} - 1 \]
      9. add-sqr-sqrt62.3%

        \[\leadsto e^{\mathsf{log1p}\left(\frac{\frac{\left(-b\right) - \color{blue}{\left(-b\right)}}{3}}{a}\right)} - 1 \]
      10. +-inverses62.3%

        \[\leadsto e^{\mathsf{log1p}\left(\frac{\frac{\color{blue}{0}}{3}}{a}\right)} - 1 \]
      11. metadata-eval62.3%

        \[\leadsto e^{\mathsf{log1p}\left(\frac{\color{blue}{0}}{a}\right)} - 1 \]
    9. Applied egg-rr62.3%

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\frac{0}{a}\right)} - 1} \]
    10. Step-by-step derivation
      1. log1p-undefine62.3%

        \[\leadsto e^{\color{blue}{\log \left(1 + \frac{0}{a}\right)}} - 1 \]
      2. div062.3%

        \[\leadsto e^{\log \left(1 + \color{blue}{0}\right)} - 1 \]
      3. metadata-eval62.3%

        \[\leadsto e^{\log \color{blue}{1}} - 1 \]
      4. metadata-eval62.3%

        \[\leadsto e^{\color{blue}{0}} - 1 \]
      5. 1-exp62.3%

        \[\leadsto \color{blue}{1} - 1 \]
      6. metadata-eval62.3%

        \[\leadsto \color{blue}{0} \]
    11. Simplified62.3%

      \[\leadsto \color{blue}{0} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification66.1%

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

Alternative 11: 64.6% accurate, 9.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq -5 \cdot 10^{-310}:\\ \;\;\;\;\frac{\frac{b \cdot 2}{a}}{-3}\\ \mathbf{else}:\\ \;\;\;\;0\\ \end{array} \end{array} \]
(FPCore (a b c)
 :precision binary64
 (if (<= b -5e-310) (/ (/ (* b 2.0) a) -3.0) 0.0))
double code(double a, double b, double c) {
	double tmp;
	if (b <= -5e-310) {
		tmp = ((b * 2.0) / a) / -3.0;
	} else {
		tmp = 0.0;
	}
	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 * 2.0d0) / a) / (-3.0d0)
    else
        tmp = 0.0d0
    end if
    code = tmp
end function
public static double code(double a, double b, double c) {
	double tmp;
	if (b <= -5e-310) {
		tmp = ((b * 2.0) / a) / -3.0;
	} else {
		tmp = 0.0;
	}
	return tmp;
}
def code(a, b, c):
	tmp = 0
	if b <= -5e-310:
		tmp = ((b * 2.0) / a) / -3.0
	else:
		tmp = 0.0
	return tmp
function code(a, b, c)
	tmp = 0.0
	if (b <= -5e-310)
		tmp = Float64(Float64(Float64(b * 2.0) / a) / -3.0);
	else
		tmp = 0.0;
	end
	return tmp
end
function tmp_2 = code(a, b, c)
	tmp = 0.0;
	if (b <= -5e-310)
		tmp = ((b * 2.0) / a) / -3.0;
	else
		tmp = 0.0;
	end
	tmp_2 = tmp;
end
code[a_, b_, c_] := If[LessEqual[b, -5e-310], N[(N[(N[(b * 2.0), $MachinePrecision] / a), $MachinePrecision] / -3.0), $MachinePrecision], 0.0]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;b \leq -5 \cdot 10^{-310}:\\
\;\;\;\;\frac{\frac{b \cdot 2}{a}}{-3}\\

\mathbf{else}:\\
\;\;\;\;0\\


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

    1. Initial program 77.4%

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

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

        \[\leadsto \frac{\left(-b\right) + \sqrt{\color{blue}{b \cdot b} - \left(3 \cdot a\right) \cdot c}}{3 \cdot a} \]
      3. associate-*l*77.4%

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

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

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

        \[\leadsto \left(b - \mathsf{hypot}\left(b, \sqrt{a \cdot \left(c \cdot -3\right)}\right)\right) \cdot \color{blue}{\frac{\frac{1}{a}}{-3}} \]
    7. Simplified63.8%

      \[\leadsto \color{blue}{\left(b - \mathsf{hypot}\left(b, \sqrt{a \cdot \left(c \cdot -3\right)}\right)\right) \cdot \frac{\frac{1}{a}}{-3}} \]
    8. Step-by-step derivation
      1. associate-*r/63.8%

        \[\leadsto \color{blue}{\frac{\left(b - \mathsf{hypot}\left(b, \sqrt{a \cdot \left(c \cdot -3\right)}\right)\right) \cdot \frac{1}{a}}{-3}} \]
    9. Applied egg-rr63.8%

      \[\leadsto \color{blue}{\frac{\left(b - \mathsf{hypot}\left(b, \sqrt{a \cdot \left(c \cdot -3\right)}\right)\right) \cdot \frac{1}{a}}{-3}} \]
    10. Step-by-step derivation
      1. associate-*r/63.9%

        \[\leadsto \frac{\color{blue}{\frac{\left(b - \mathsf{hypot}\left(b, \sqrt{a \cdot \left(c \cdot -3\right)}\right)\right) \cdot 1}{a}}}{-3} \]
      2. *-rgt-identity63.9%

        \[\leadsto \frac{\frac{\color{blue}{b - \mathsf{hypot}\left(b, \sqrt{a \cdot \left(c \cdot -3\right)}\right)}}{a}}{-3} \]
      3. associate-*r*64.0%

        \[\leadsto \frac{\frac{b - \mathsf{hypot}\left(b, \sqrt{\color{blue}{\left(a \cdot c\right) \cdot -3}}\right)}{a}}{-3} \]
      4. *-commutative64.0%

        \[\leadsto \frac{\frac{b - \mathsf{hypot}\left(b, \sqrt{\color{blue}{\left(c \cdot a\right)} \cdot -3}\right)}{a}}{-3} \]
      5. associate-*l*63.9%

        \[\leadsto \frac{\frac{b - \mathsf{hypot}\left(b, \sqrt{\color{blue}{c \cdot \left(a \cdot -3\right)}}\right)}{a}}{-3} \]
    11. Simplified63.9%

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

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

        \[\leadsto \frac{\color{blue}{\frac{2 \cdot b}{a}}}{-3} \]
    14. Simplified69.7%

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

    if -4.999999999999985e-310 < b

    1. Initial program 53.8%

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

        \[\leadsto \frac{\left(-b\right) + \sqrt{\color{blue}{\left(-b\right) \cdot \left(-b\right)} - \left(3 \cdot a\right) \cdot c}}{3 \cdot a} \]
      2. sqr-neg53.8%

        \[\leadsto \frac{\left(-b\right) + \sqrt{\color{blue}{b \cdot b} - \left(3 \cdot a\right) \cdot c}}{3 \cdot a} \]
      3. associate-*l*53.8%

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

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

      \[\leadsto \frac{\left(-b\right) + \color{blue}{-1 \cdot b}}{3 \cdot a} \]
    6. Step-by-step derivation
      1. mul-1-neg2.5%

        \[\leadsto \frac{\left(-b\right) + \color{blue}{\left(-b\right)}}{3 \cdot a} \]
    7. Simplified2.5%

      \[\leadsto \frac{\left(-b\right) + \color{blue}{\left(-b\right)}}{3 \cdot a} \]
    8. Step-by-step derivation
      1. expm1-log1p-u1.9%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{\left(-b\right) + \left(-b\right)}{3 \cdot a}\right)\right)} \]
      2. expm1-undefine8.2%

        \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\frac{\left(-b\right) + \left(-b\right)}{3 \cdot a}\right)} - 1} \]
      3. associate-/r*8.2%

        \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{\frac{\frac{\left(-b\right) + \left(-b\right)}{3}}{a}}\right)} - 1 \]
      4. unsub-neg8.2%

        \[\leadsto e^{\mathsf{log1p}\left(\frac{\frac{\color{blue}{\left(-b\right) - b}}{3}}{a}\right)} - 1 \]
      5. add-sqr-sqrt8.2%

        \[\leadsto e^{\mathsf{log1p}\left(\frac{\frac{\left(-b\right) - \color{blue}{\sqrt{b} \cdot \sqrt{b}}}{3}}{a}\right)} - 1 \]
      6. sqrt-unprod4.9%

        \[\leadsto e^{\mathsf{log1p}\left(\frac{\frac{\left(-b\right) - \color{blue}{\sqrt{b \cdot b}}}{3}}{a}\right)} - 1 \]
      7. sqr-neg4.9%

        \[\leadsto e^{\mathsf{log1p}\left(\frac{\frac{\left(-b\right) - \sqrt{\color{blue}{\left(-b\right) \cdot \left(-b\right)}}}{3}}{a}\right)} - 1 \]
      8. sqrt-unprod0.0%

        \[\leadsto e^{\mathsf{log1p}\left(\frac{\frac{\left(-b\right) - \color{blue}{\sqrt{-b} \cdot \sqrt{-b}}}{3}}{a}\right)} - 1 \]
      9. add-sqr-sqrt62.3%

        \[\leadsto e^{\mathsf{log1p}\left(\frac{\frac{\left(-b\right) - \color{blue}{\left(-b\right)}}{3}}{a}\right)} - 1 \]
      10. +-inverses62.3%

        \[\leadsto e^{\mathsf{log1p}\left(\frac{\frac{\color{blue}{0}}{3}}{a}\right)} - 1 \]
      11. metadata-eval62.3%

        \[\leadsto e^{\mathsf{log1p}\left(\frac{\color{blue}{0}}{a}\right)} - 1 \]
    9. Applied egg-rr62.3%

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\frac{0}{a}\right)} - 1} \]
    10. Step-by-step derivation
      1. log1p-undefine62.3%

        \[\leadsto e^{\color{blue}{\log \left(1 + \frac{0}{a}\right)}} - 1 \]
      2. div062.3%

        \[\leadsto e^{\log \left(1 + \color{blue}{0}\right)} - 1 \]
      3. metadata-eval62.3%

        \[\leadsto e^{\log \color{blue}{1}} - 1 \]
      4. metadata-eval62.3%

        \[\leadsto e^{\color{blue}{0}} - 1 \]
      5. 1-exp62.3%

        \[\leadsto \color{blue}{1} - 1 \]
      6. metadata-eval62.3%

        \[\leadsto \color{blue}{0} \]
    11. Simplified62.3%

      \[\leadsto \color{blue}{0} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification66.1%

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

Alternative 12: 64.6% accurate, 11.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq -5 \cdot 10^{-310}:\\ \;\;\;\;b \cdot \frac{-0.6666666666666666}{a}\\ \mathbf{else}:\\ \;\;\;\;0\\ \end{array} \end{array} \]
(FPCore (a b c)
 :precision binary64
 (if (<= b -5e-310) (* b (/ -0.6666666666666666 a)) 0.0))
double code(double a, double b, double c) {
	double tmp;
	if (b <= -5e-310) {
		tmp = b * (-0.6666666666666666 / a);
	} else {
		tmp = 0.0;
	}
	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)
    else
        tmp = 0.0d0
    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);
	} else {
		tmp = 0.0;
	}
	return tmp;
}
def code(a, b, c):
	tmp = 0
	if b <= -5e-310:
		tmp = b * (-0.6666666666666666 / a)
	else:
		tmp = 0.0
	return tmp
function code(a, b, c)
	tmp = 0.0
	if (b <= -5e-310)
		tmp = Float64(b * Float64(-0.6666666666666666 / a));
	else
		tmp = 0.0;
	end
	return tmp
end
function tmp_2 = code(a, b, c)
	tmp = 0.0;
	if (b <= -5e-310)
		tmp = b * (-0.6666666666666666 / a);
	else
		tmp = 0.0;
	end
	tmp_2 = tmp;
end
code[a_, b_, c_] := If[LessEqual[b, -5e-310], N[(b * N[(-0.6666666666666666 / a), $MachinePrecision]), $MachinePrecision], 0.0]
\begin{array}{l}

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

\mathbf{else}:\\
\;\;\;\;0\\


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

    1. Initial program 77.4%

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

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

        \[\leadsto \frac{\left(-b\right) + \sqrt{\color{blue}{b \cdot b} - \left(3 \cdot a\right) \cdot c}}{3 \cdot a} \]
      3. associate-*l*77.4%

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

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

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

        \[\leadsto \left(b - \mathsf{hypot}\left(b, \sqrt{a \cdot \left(c \cdot -3\right)}\right)\right) \cdot \color{blue}{\frac{\frac{1}{a}}{-3}} \]
    7. Simplified63.8%

      \[\leadsto \color{blue}{\left(b - \mathsf{hypot}\left(b, \sqrt{a \cdot \left(c \cdot -3\right)}\right)\right) \cdot \frac{\frac{1}{a}}{-3}} \]
    8. Step-by-step derivation
      1. associate-*r*63.8%

        \[\leadsto \left(b - \mathsf{hypot}\left(b, \sqrt{\color{blue}{\left(a \cdot c\right) \cdot -3}}\right)\right) \cdot \frac{\frac{1}{a}}{-3} \]
      2. *-commutative63.8%

        \[\leadsto \left(b - \mathsf{hypot}\left(b, \sqrt{\color{blue}{-3 \cdot \left(a \cdot c\right)}}\right)\right) \cdot \frac{\frac{1}{a}}{-3} \]
      3. add-sqr-sqrt63.8%

        \[\leadsto \left(b - \mathsf{hypot}\left(b, \sqrt{\color{blue}{\sqrt{-3 \cdot \left(a \cdot c\right)} \cdot \sqrt{-3 \cdot \left(a \cdot c\right)}}}\right)\right) \cdot \frac{\frac{1}{a}}{-3} \]
      4. pow1/263.8%

        \[\leadsto \left(b - \mathsf{hypot}\left(b, \sqrt{\color{blue}{{\left(-3 \cdot \left(a \cdot c\right)\right)}^{0.5}} \cdot \sqrt{-3 \cdot \left(a \cdot c\right)}}\right)\right) \cdot \frac{\frac{1}{a}}{-3} \]
      5. pow1/263.9%

        \[\leadsto \left(b - \mathsf{hypot}\left(b, \sqrt{{\left(-3 \cdot \left(a \cdot c\right)\right)}^{0.5} \cdot \color{blue}{{\left(-3 \cdot \left(a \cdot c\right)\right)}^{0.5}}}\right)\right) \cdot \frac{\frac{1}{a}}{-3} \]
      6. pow-prod-down76.1%

        \[\leadsto \left(b - \mathsf{hypot}\left(b, \sqrt{\color{blue}{{\left(\left(-3 \cdot \left(a \cdot c\right)\right) \cdot \left(-3 \cdot \left(a \cdot c\right)\right)\right)}^{0.5}}}\right)\right) \cdot \frac{\frac{1}{a}}{-3} \]
      7. pow276.1%

        \[\leadsto \left(b - \mathsf{hypot}\left(b, \sqrt{{\color{blue}{\left({\left(-3 \cdot \left(a \cdot c\right)\right)}^{2}\right)}}^{0.5}}\right)\right) \cdot \frac{\frac{1}{a}}{-3} \]
      8. *-commutative76.1%

        \[\leadsto \left(b - \mathsf{hypot}\left(b, \sqrt{{\left({\color{blue}{\left(\left(a \cdot c\right) \cdot -3\right)}}^{2}\right)}^{0.5}}\right)\right) \cdot \frac{\frac{1}{a}}{-3} \]
      9. associate-*r*76.1%

        \[\leadsto \left(b - \mathsf{hypot}\left(b, \sqrt{{\left({\color{blue}{\left(a \cdot \left(c \cdot -3\right)\right)}}^{2}\right)}^{0.5}}\right)\right) \cdot \frac{\frac{1}{a}}{-3} \]
    9. Applied egg-rr76.1%

      \[\leadsto \left(b - \mathsf{hypot}\left(b, \sqrt{\color{blue}{{\left({\left(a \cdot \left(c \cdot -3\right)\right)}^{2}\right)}^{0.5}}}\right)\right) \cdot \frac{\frac{1}{a}}{-3} \]
    10. Step-by-step derivation
      1. unpow1/276.1%

        \[\leadsto \left(b - \mathsf{hypot}\left(b, \sqrt{\color{blue}{\sqrt{{\left(a \cdot \left(c \cdot -3\right)\right)}^{2}}}}\right)\right) \cdot \frac{\frac{1}{a}}{-3} \]
      2. unpow276.1%

        \[\leadsto \left(b - \mathsf{hypot}\left(b, \sqrt{\sqrt{\color{blue}{\left(a \cdot \left(c \cdot -3\right)\right) \cdot \left(a \cdot \left(c \cdot -3\right)\right)}}}\right)\right) \cdot \frac{\frac{1}{a}}{-3} \]
      3. rem-sqrt-square91.1%

        \[\leadsto \left(b - \mathsf{hypot}\left(b, \sqrt{\color{blue}{\left|a \cdot \left(c \cdot -3\right)\right|}}\right)\right) \cdot \frac{\frac{1}{a}}{-3} \]
      4. associate-*r*91.1%

        \[\leadsto \left(b - \mathsf{hypot}\left(b, \sqrt{\left|\color{blue}{\left(a \cdot c\right) \cdot -3}\right|}\right)\right) \cdot \frac{\frac{1}{a}}{-3} \]
      5. *-commutative91.1%

        \[\leadsto \left(b - \mathsf{hypot}\left(b, \sqrt{\left|\color{blue}{\left(c \cdot a\right)} \cdot -3\right|}\right)\right) \cdot \frac{\frac{1}{a}}{-3} \]
      6. associate-*l*91.1%

        \[\leadsto \left(b - \mathsf{hypot}\left(b, \sqrt{\left|\color{blue}{c \cdot \left(a \cdot -3\right)}\right|}\right)\right) \cdot \frac{\frac{1}{a}}{-3} \]
    11. Simplified91.1%

      \[\leadsto \left(b - \mathsf{hypot}\left(b, \sqrt{\color{blue}{\left|c \cdot \left(a \cdot -3\right)\right|}}\right)\right) \cdot \frac{\frac{1}{a}}{-3} \]
    12. Taylor expanded in b around -inf 69.5%

      \[\leadsto \color{blue}{-0.6666666666666666 \cdot \frac{b}{a}} \]
    13. Step-by-step derivation
      1. *-commutative69.5%

        \[\leadsto \color{blue}{\frac{b}{a} \cdot -0.6666666666666666} \]
      2. associate-*l/69.6%

        \[\leadsto \color{blue}{\frac{b \cdot -0.6666666666666666}{a}} \]
      3. associate-/l*69.5%

        \[\leadsto \color{blue}{b \cdot \frac{-0.6666666666666666}{a}} \]
    14. Simplified69.5%

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

    if -4.999999999999985e-310 < b

    1. Initial program 53.8%

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

        \[\leadsto \frac{\left(-b\right) + \sqrt{\color{blue}{\left(-b\right) \cdot \left(-b\right)} - \left(3 \cdot a\right) \cdot c}}{3 \cdot a} \]
      2. sqr-neg53.8%

        \[\leadsto \frac{\left(-b\right) + \sqrt{\color{blue}{b \cdot b} - \left(3 \cdot a\right) \cdot c}}{3 \cdot a} \]
      3. associate-*l*53.8%

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

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

      \[\leadsto \frac{\left(-b\right) + \color{blue}{-1 \cdot b}}{3 \cdot a} \]
    6. Step-by-step derivation
      1. mul-1-neg2.5%

        \[\leadsto \frac{\left(-b\right) + \color{blue}{\left(-b\right)}}{3 \cdot a} \]
    7. Simplified2.5%

      \[\leadsto \frac{\left(-b\right) + \color{blue}{\left(-b\right)}}{3 \cdot a} \]
    8. Step-by-step derivation
      1. expm1-log1p-u1.9%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{\left(-b\right) + \left(-b\right)}{3 \cdot a}\right)\right)} \]
      2. expm1-undefine8.2%

        \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\frac{\left(-b\right) + \left(-b\right)}{3 \cdot a}\right)} - 1} \]
      3. associate-/r*8.2%

        \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{\frac{\frac{\left(-b\right) + \left(-b\right)}{3}}{a}}\right)} - 1 \]
      4. unsub-neg8.2%

        \[\leadsto e^{\mathsf{log1p}\left(\frac{\frac{\color{blue}{\left(-b\right) - b}}{3}}{a}\right)} - 1 \]
      5. add-sqr-sqrt8.2%

        \[\leadsto e^{\mathsf{log1p}\left(\frac{\frac{\left(-b\right) - \color{blue}{\sqrt{b} \cdot \sqrt{b}}}{3}}{a}\right)} - 1 \]
      6. sqrt-unprod4.9%

        \[\leadsto e^{\mathsf{log1p}\left(\frac{\frac{\left(-b\right) - \color{blue}{\sqrt{b \cdot b}}}{3}}{a}\right)} - 1 \]
      7. sqr-neg4.9%

        \[\leadsto e^{\mathsf{log1p}\left(\frac{\frac{\left(-b\right) - \sqrt{\color{blue}{\left(-b\right) \cdot \left(-b\right)}}}{3}}{a}\right)} - 1 \]
      8. sqrt-unprod0.0%

        \[\leadsto e^{\mathsf{log1p}\left(\frac{\frac{\left(-b\right) - \color{blue}{\sqrt{-b} \cdot \sqrt{-b}}}{3}}{a}\right)} - 1 \]
      9. add-sqr-sqrt62.3%

        \[\leadsto e^{\mathsf{log1p}\left(\frac{\frac{\left(-b\right) - \color{blue}{\left(-b\right)}}{3}}{a}\right)} - 1 \]
      10. +-inverses62.3%

        \[\leadsto e^{\mathsf{log1p}\left(\frac{\frac{\color{blue}{0}}{3}}{a}\right)} - 1 \]
      11. metadata-eval62.3%

        \[\leadsto e^{\mathsf{log1p}\left(\frac{\color{blue}{0}}{a}\right)} - 1 \]
    9. Applied egg-rr62.3%

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\frac{0}{a}\right)} - 1} \]
    10. Step-by-step derivation
      1. log1p-undefine62.3%

        \[\leadsto e^{\color{blue}{\log \left(1 + \frac{0}{a}\right)}} - 1 \]
      2. div062.3%

        \[\leadsto e^{\log \left(1 + \color{blue}{0}\right)} - 1 \]
      3. metadata-eval62.3%

        \[\leadsto e^{\log \color{blue}{1}} - 1 \]
      4. metadata-eval62.3%

        \[\leadsto e^{\color{blue}{0}} - 1 \]
      5. 1-exp62.3%

        \[\leadsto \color{blue}{1} - 1 \]
      6. metadata-eval62.3%

        \[\leadsto \color{blue}{0} \]
    11. Simplified62.3%

      \[\leadsto \color{blue}{0} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification66.0%

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

Alternative 13: 64.6% accurate, 11.6× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;0\\


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

    1. Initial program 77.4%

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

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

        \[\leadsto \frac{\left(-b\right) + \sqrt{\color{blue}{b \cdot b} - \left(3 \cdot a\right) \cdot c}}{3 \cdot a} \]
      3. associate-*l*77.4%

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

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

      \[\leadsto \color{blue}{-0.6666666666666666 \cdot \frac{b}{a}} \]
    6. Step-by-step derivation
      1. *-commutative69.5%

        \[\leadsto \color{blue}{\frac{b}{a} \cdot -0.6666666666666666} \]
    7. Simplified69.5%

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

    if -4.999999999999985e-310 < b

    1. Initial program 53.8%

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

        \[\leadsto \frac{\left(-b\right) + \sqrt{\color{blue}{\left(-b\right) \cdot \left(-b\right)} - \left(3 \cdot a\right) \cdot c}}{3 \cdot a} \]
      2. sqr-neg53.8%

        \[\leadsto \frac{\left(-b\right) + \sqrt{\color{blue}{b \cdot b} - \left(3 \cdot a\right) \cdot c}}{3 \cdot a} \]
      3. associate-*l*53.8%

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

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

      \[\leadsto \frac{\left(-b\right) + \color{blue}{-1 \cdot b}}{3 \cdot a} \]
    6. Step-by-step derivation
      1. mul-1-neg2.5%

        \[\leadsto \frac{\left(-b\right) + \color{blue}{\left(-b\right)}}{3 \cdot a} \]
    7. Simplified2.5%

      \[\leadsto \frac{\left(-b\right) + \color{blue}{\left(-b\right)}}{3 \cdot a} \]
    8. Step-by-step derivation
      1. expm1-log1p-u1.9%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{\left(-b\right) + \left(-b\right)}{3 \cdot a}\right)\right)} \]
      2. expm1-undefine8.2%

        \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\frac{\left(-b\right) + \left(-b\right)}{3 \cdot a}\right)} - 1} \]
      3. associate-/r*8.2%

        \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{\frac{\frac{\left(-b\right) + \left(-b\right)}{3}}{a}}\right)} - 1 \]
      4. unsub-neg8.2%

        \[\leadsto e^{\mathsf{log1p}\left(\frac{\frac{\color{blue}{\left(-b\right) - b}}{3}}{a}\right)} - 1 \]
      5. add-sqr-sqrt8.2%

        \[\leadsto e^{\mathsf{log1p}\left(\frac{\frac{\left(-b\right) - \color{blue}{\sqrt{b} \cdot \sqrt{b}}}{3}}{a}\right)} - 1 \]
      6. sqrt-unprod4.9%

        \[\leadsto e^{\mathsf{log1p}\left(\frac{\frac{\left(-b\right) - \color{blue}{\sqrt{b \cdot b}}}{3}}{a}\right)} - 1 \]
      7. sqr-neg4.9%

        \[\leadsto e^{\mathsf{log1p}\left(\frac{\frac{\left(-b\right) - \sqrt{\color{blue}{\left(-b\right) \cdot \left(-b\right)}}}{3}}{a}\right)} - 1 \]
      8. sqrt-unprod0.0%

        \[\leadsto e^{\mathsf{log1p}\left(\frac{\frac{\left(-b\right) - \color{blue}{\sqrt{-b} \cdot \sqrt{-b}}}{3}}{a}\right)} - 1 \]
      9. add-sqr-sqrt62.3%

        \[\leadsto e^{\mathsf{log1p}\left(\frac{\frac{\left(-b\right) - \color{blue}{\left(-b\right)}}{3}}{a}\right)} - 1 \]
      10. +-inverses62.3%

        \[\leadsto e^{\mathsf{log1p}\left(\frac{\frac{\color{blue}{0}}{3}}{a}\right)} - 1 \]
      11. metadata-eval62.3%

        \[\leadsto e^{\mathsf{log1p}\left(\frac{\color{blue}{0}}{a}\right)} - 1 \]
    9. Applied egg-rr62.3%

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\frac{0}{a}\right)} - 1} \]
    10. Step-by-step derivation
      1. log1p-undefine62.3%

        \[\leadsto e^{\color{blue}{\log \left(1 + \frac{0}{a}\right)}} - 1 \]
      2. div062.3%

        \[\leadsto e^{\log \left(1 + \color{blue}{0}\right)} - 1 \]
      3. metadata-eval62.3%

        \[\leadsto e^{\log \color{blue}{1}} - 1 \]
      4. metadata-eval62.3%

        \[\leadsto e^{\color{blue}{0}} - 1 \]
      5. 1-exp62.3%

        \[\leadsto \color{blue}{1} - 1 \]
      6. metadata-eval62.3%

        \[\leadsto \color{blue}{0} \]
    11. Simplified62.3%

      \[\leadsto \color{blue}{0} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification66.0%

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

Alternative 14: 64.6% accurate, 11.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq -5 \cdot 10^{-310}:\\ \;\;\;\;\frac{-0.6666666666666666}{\frac{a}{b}}\\ \mathbf{else}:\\ \;\;\;\;0\\ \end{array} \end{array} \]
(FPCore (a b c)
 :precision binary64
 (if (<= b -5e-310) (/ -0.6666666666666666 (/ a b)) 0.0))
double code(double a, double b, double c) {
	double tmp;
	if (b <= -5e-310) {
		tmp = -0.6666666666666666 / (a / b);
	} else {
		tmp = 0.0;
	}
	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 = (-0.6666666666666666d0) / (a / b)
    else
        tmp = 0.0d0
    end if
    code = tmp
end function
public static double code(double a, double b, double c) {
	double tmp;
	if (b <= -5e-310) {
		tmp = -0.6666666666666666 / (a / b);
	} else {
		tmp = 0.0;
	}
	return tmp;
}
def code(a, b, c):
	tmp = 0
	if b <= -5e-310:
		tmp = -0.6666666666666666 / (a / b)
	else:
		tmp = 0.0
	return tmp
function code(a, b, c)
	tmp = 0.0
	if (b <= -5e-310)
		tmp = Float64(-0.6666666666666666 / Float64(a / b));
	else
		tmp = 0.0;
	end
	return tmp
end
function tmp_2 = code(a, b, c)
	tmp = 0.0;
	if (b <= -5e-310)
		tmp = -0.6666666666666666 / (a / b);
	else
		tmp = 0.0;
	end
	tmp_2 = tmp;
end
code[a_, b_, c_] := If[LessEqual[b, -5e-310], N[(-0.6666666666666666 / N[(a / b), $MachinePrecision]), $MachinePrecision], 0.0]
\begin{array}{l}

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

\mathbf{else}:\\
\;\;\;\;0\\


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

    1. Initial program 77.4%

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

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

        \[\leadsto \frac{\left(-b\right) + \sqrt{\color{blue}{b \cdot b} - \left(3 \cdot a\right) \cdot c}}{3 \cdot a} \]
      3. associate-*l*77.4%

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

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

      \[\leadsto \color{blue}{-0.6666666666666666 \cdot \frac{b}{a}} \]
    6. Step-by-step derivation
      1. *-commutative69.5%

        \[\leadsto \color{blue}{\frac{b}{a} \cdot -0.6666666666666666} \]
    7. Simplified69.5%

      \[\leadsto \color{blue}{\frac{b}{a} \cdot -0.6666666666666666} \]
    8. Step-by-step derivation
      1. *-commutative69.5%

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

        \[\leadsto -0.6666666666666666 \cdot \color{blue}{\frac{1}{\frac{a}{b}}} \]
      3. un-div-inv69.5%

        \[\leadsto \color{blue}{\frac{-0.6666666666666666}{\frac{a}{b}}} \]
    9. Applied egg-rr69.5%

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

    if -4.999999999999985e-310 < b

    1. Initial program 53.8%

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

        \[\leadsto \frac{\left(-b\right) + \sqrt{\color{blue}{\left(-b\right) \cdot \left(-b\right)} - \left(3 \cdot a\right) \cdot c}}{3 \cdot a} \]
      2. sqr-neg53.8%

        \[\leadsto \frac{\left(-b\right) + \sqrt{\color{blue}{b \cdot b} - \left(3 \cdot a\right) \cdot c}}{3 \cdot a} \]
      3. associate-*l*53.8%

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

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

      \[\leadsto \frac{\left(-b\right) + \color{blue}{-1 \cdot b}}{3 \cdot a} \]
    6. Step-by-step derivation
      1. mul-1-neg2.5%

        \[\leadsto \frac{\left(-b\right) + \color{blue}{\left(-b\right)}}{3 \cdot a} \]
    7. Simplified2.5%

      \[\leadsto \frac{\left(-b\right) + \color{blue}{\left(-b\right)}}{3 \cdot a} \]
    8. Step-by-step derivation
      1. expm1-log1p-u1.9%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{\left(-b\right) + \left(-b\right)}{3 \cdot a}\right)\right)} \]
      2. expm1-undefine8.2%

        \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\frac{\left(-b\right) + \left(-b\right)}{3 \cdot a}\right)} - 1} \]
      3. associate-/r*8.2%

        \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{\frac{\frac{\left(-b\right) + \left(-b\right)}{3}}{a}}\right)} - 1 \]
      4. unsub-neg8.2%

        \[\leadsto e^{\mathsf{log1p}\left(\frac{\frac{\color{blue}{\left(-b\right) - b}}{3}}{a}\right)} - 1 \]
      5. add-sqr-sqrt8.2%

        \[\leadsto e^{\mathsf{log1p}\left(\frac{\frac{\left(-b\right) - \color{blue}{\sqrt{b} \cdot \sqrt{b}}}{3}}{a}\right)} - 1 \]
      6. sqrt-unprod4.9%

        \[\leadsto e^{\mathsf{log1p}\left(\frac{\frac{\left(-b\right) - \color{blue}{\sqrt{b \cdot b}}}{3}}{a}\right)} - 1 \]
      7. sqr-neg4.9%

        \[\leadsto e^{\mathsf{log1p}\left(\frac{\frac{\left(-b\right) - \sqrt{\color{blue}{\left(-b\right) \cdot \left(-b\right)}}}{3}}{a}\right)} - 1 \]
      8. sqrt-unprod0.0%

        \[\leadsto e^{\mathsf{log1p}\left(\frac{\frac{\left(-b\right) - \color{blue}{\sqrt{-b} \cdot \sqrt{-b}}}{3}}{a}\right)} - 1 \]
      9. add-sqr-sqrt62.3%

        \[\leadsto e^{\mathsf{log1p}\left(\frac{\frac{\left(-b\right) - \color{blue}{\left(-b\right)}}{3}}{a}\right)} - 1 \]
      10. +-inverses62.3%

        \[\leadsto e^{\mathsf{log1p}\left(\frac{\frac{\color{blue}{0}}{3}}{a}\right)} - 1 \]
      11. metadata-eval62.3%

        \[\leadsto e^{\mathsf{log1p}\left(\frac{\color{blue}{0}}{a}\right)} - 1 \]
    9. Applied egg-rr62.3%

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\frac{0}{a}\right)} - 1} \]
    10. Step-by-step derivation
      1. log1p-undefine62.3%

        \[\leadsto e^{\color{blue}{\log \left(1 + \frac{0}{a}\right)}} - 1 \]
      2. div062.3%

        \[\leadsto e^{\log \left(1 + \color{blue}{0}\right)} - 1 \]
      3. metadata-eval62.3%

        \[\leadsto e^{\log \color{blue}{1}} - 1 \]
      4. metadata-eval62.3%

        \[\leadsto e^{\color{blue}{0}} - 1 \]
      5. 1-exp62.3%

        \[\leadsto \color{blue}{1} - 1 \]
      6. metadata-eval62.3%

        \[\leadsto \color{blue}{0} \]
    11. Simplified62.3%

      \[\leadsto \color{blue}{0} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification66.0%

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

Alternative 15: 64.6% accurate, 11.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq -5 \cdot 10^{-310}:\\ \;\;\;\;\frac{b \cdot -0.6666666666666666}{a}\\ \mathbf{else}:\\ \;\;\;\;0\\ \end{array} \end{array} \]
(FPCore (a b c)
 :precision binary64
 (if (<= b -5e-310) (/ (* b -0.6666666666666666) a) 0.0))
double code(double a, double b, double c) {
	double tmp;
	if (b <= -5e-310) {
		tmp = (b * -0.6666666666666666) / a;
	} else {
		tmp = 0.0;
	}
	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
    else
        tmp = 0.0d0
    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;
	} else {
		tmp = 0.0;
	}
	return tmp;
}
def code(a, b, c):
	tmp = 0
	if b <= -5e-310:
		tmp = (b * -0.6666666666666666) / a
	else:
		tmp = 0.0
	return tmp
function code(a, b, c)
	tmp = 0.0
	if (b <= -5e-310)
		tmp = Float64(Float64(b * -0.6666666666666666) / a);
	else
		tmp = 0.0;
	end
	return tmp
end
function tmp_2 = code(a, b, c)
	tmp = 0.0;
	if (b <= -5e-310)
		tmp = (b * -0.6666666666666666) / a;
	else
		tmp = 0.0;
	end
	tmp_2 = tmp;
end
code[a_, b_, c_] := If[LessEqual[b, -5e-310], N[(N[(b * -0.6666666666666666), $MachinePrecision] / a), $MachinePrecision], 0.0]
\begin{array}{l}

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

\mathbf{else}:\\
\;\;\;\;0\\


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

    1. Initial program 77.4%

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

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

        \[\leadsto \frac{\left(-b\right) + \sqrt{\color{blue}{b \cdot b} - \left(3 \cdot a\right) \cdot c}}{3 \cdot a} \]
      3. associate-*l*77.4%

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

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

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

        \[\leadsto \left(b - \mathsf{hypot}\left(b, \sqrt{a \cdot \left(c \cdot -3\right)}\right)\right) \cdot \color{blue}{\frac{\frac{1}{a}}{-3}} \]
    7. Simplified63.8%

      \[\leadsto \color{blue}{\left(b - \mathsf{hypot}\left(b, \sqrt{a \cdot \left(c \cdot -3\right)}\right)\right) \cdot \frac{\frac{1}{a}}{-3}} \]
    8. Step-by-step derivation
      1. associate-*r*63.8%

        \[\leadsto \left(b - \mathsf{hypot}\left(b, \sqrt{\color{blue}{\left(a \cdot c\right) \cdot -3}}\right)\right) \cdot \frac{\frac{1}{a}}{-3} \]
      2. *-commutative63.8%

        \[\leadsto \left(b - \mathsf{hypot}\left(b, \sqrt{\color{blue}{-3 \cdot \left(a \cdot c\right)}}\right)\right) \cdot \frac{\frac{1}{a}}{-3} \]
      3. add-sqr-sqrt63.8%

        \[\leadsto \left(b - \mathsf{hypot}\left(b, \sqrt{\color{blue}{\sqrt{-3 \cdot \left(a \cdot c\right)} \cdot \sqrt{-3 \cdot \left(a \cdot c\right)}}}\right)\right) \cdot \frac{\frac{1}{a}}{-3} \]
      4. pow1/263.8%

        \[\leadsto \left(b - \mathsf{hypot}\left(b, \sqrt{\color{blue}{{\left(-3 \cdot \left(a \cdot c\right)\right)}^{0.5}} \cdot \sqrt{-3 \cdot \left(a \cdot c\right)}}\right)\right) \cdot \frac{\frac{1}{a}}{-3} \]
      5. pow1/263.9%

        \[\leadsto \left(b - \mathsf{hypot}\left(b, \sqrt{{\left(-3 \cdot \left(a \cdot c\right)\right)}^{0.5} \cdot \color{blue}{{\left(-3 \cdot \left(a \cdot c\right)\right)}^{0.5}}}\right)\right) \cdot \frac{\frac{1}{a}}{-3} \]
      6. pow-prod-down76.1%

        \[\leadsto \left(b - \mathsf{hypot}\left(b, \sqrt{\color{blue}{{\left(\left(-3 \cdot \left(a \cdot c\right)\right) \cdot \left(-3 \cdot \left(a \cdot c\right)\right)\right)}^{0.5}}}\right)\right) \cdot \frac{\frac{1}{a}}{-3} \]
      7. pow276.1%

        \[\leadsto \left(b - \mathsf{hypot}\left(b, \sqrt{{\color{blue}{\left({\left(-3 \cdot \left(a \cdot c\right)\right)}^{2}\right)}}^{0.5}}\right)\right) \cdot \frac{\frac{1}{a}}{-3} \]
      8. *-commutative76.1%

        \[\leadsto \left(b - \mathsf{hypot}\left(b, \sqrt{{\left({\color{blue}{\left(\left(a \cdot c\right) \cdot -3\right)}}^{2}\right)}^{0.5}}\right)\right) \cdot \frac{\frac{1}{a}}{-3} \]
      9. associate-*r*76.1%

        \[\leadsto \left(b - \mathsf{hypot}\left(b, \sqrt{{\left({\color{blue}{\left(a \cdot \left(c \cdot -3\right)\right)}}^{2}\right)}^{0.5}}\right)\right) \cdot \frac{\frac{1}{a}}{-3} \]
    9. Applied egg-rr76.1%

      \[\leadsto \left(b - \mathsf{hypot}\left(b, \sqrt{\color{blue}{{\left({\left(a \cdot \left(c \cdot -3\right)\right)}^{2}\right)}^{0.5}}}\right)\right) \cdot \frac{\frac{1}{a}}{-3} \]
    10. Step-by-step derivation
      1. unpow1/276.1%

        \[\leadsto \left(b - \mathsf{hypot}\left(b, \sqrt{\color{blue}{\sqrt{{\left(a \cdot \left(c \cdot -3\right)\right)}^{2}}}}\right)\right) \cdot \frac{\frac{1}{a}}{-3} \]
      2. unpow276.1%

        \[\leadsto \left(b - \mathsf{hypot}\left(b, \sqrt{\sqrt{\color{blue}{\left(a \cdot \left(c \cdot -3\right)\right) \cdot \left(a \cdot \left(c \cdot -3\right)\right)}}}\right)\right) \cdot \frac{\frac{1}{a}}{-3} \]
      3. rem-sqrt-square91.1%

        \[\leadsto \left(b - \mathsf{hypot}\left(b, \sqrt{\color{blue}{\left|a \cdot \left(c \cdot -3\right)\right|}}\right)\right) \cdot \frac{\frac{1}{a}}{-3} \]
      4. associate-*r*91.1%

        \[\leadsto \left(b - \mathsf{hypot}\left(b, \sqrt{\left|\color{blue}{\left(a \cdot c\right) \cdot -3}\right|}\right)\right) \cdot \frac{\frac{1}{a}}{-3} \]
      5. *-commutative91.1%

        \[\leadsto \left(b - \mathsf{hypot}\left(b, \sqrt{\left|\color{blue}{\left(c \cdot a\right)} \cdot -3\right|}\right)\right) \cdot \frac{\frac{1}{a}}{-3} \]
      6. associate-*l*91.1%

        \[\leadsto \left(b - \mathsf{hypot}\left(b, \sqrt{\left|\color{blue}{c \cdot \left(a \cdot -3\right)}\right|}\right)\right) \cdot \frac{\frac{1}{a}}{-3} \]
    11. Simplified91.1%

      \[\leadsto \left(b - \mathsf{hypot}\left(b, \sqrt{\color{blue}{\left|c \cdot \left(a \cdot -3\right)\right|}}\right)\right) \cdot \frac{\frac{1}{a}}{-3} \]
    12. Taylor expanded in b around -inf 69.5%

      \[\leadsto \color{blue}{-0.6666666666666666 \cdot \frac{b}{a}} \]
    13. Step-by-step derivation
      1. *-commutative69.5%

        \[\leadsto \color{blue}{\frac{b}{a} \cdot -0.6666666666666666} \]
      2. associate-*l/69.6%

        \[\leadsto \color{blue}{\frac{b \cdot -0.6666666666666666}{a}} \]
    14. Simplified69.6%

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

    if -4.999999999999985e-310 < b

    1. Initial program 53.8%

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

        \[\leadsto \frac{\left(-b\right) + \sqrt{\color{blue}{\left(-b\right) \cdot \left(-b\right)} - \left(3 \cdot a\right) \cdot c}}{3 \cdot a} \]
      2. sqr-neg53.8%

        \[\leadsto \frac{\left(-b\right) + \sqrt{\color{blue}{b \cdot b} - \left(3 \cdot a\right) \cdot c}}{3 \cdot a} \]
      3. associate-*l*53.8%

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

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

      \[\leadsto \frac{\left(-b\right) + \color{blue}{-1 \cdot b}}{3 \cdot a} \]
    6. Step-by-step derivation
      1. mul-1-neg2.5%

        \[\leadsto \frac{\left(-b\right) + \color{blue}{\left(-b\right)}}{3 \cdot a} \]
    7. Simplified2.5%

      \[\leadsto \frac{\left(-b\right) + \color{blue}{\left(-b\right)}}{3 \cdot a} \]
    8. Step-by-step derivation
      1. expm1-log1p-u1.9%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{\left(-b\right) + \left(-b\right)}{3 \cdot a}\right)\right)} \]
      2. expm1-undefine8.2%

        \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\frac{\left(-b\right) + \left(-b\right)}{3 \cdot a}\right)} - 1} \]
      3. associate-/r*8.2%

        \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{\frac{\frac{\left(-b\right) + \left(-b\right)}{3}}{a}}\right)} - 1 \]
      4. unsub-neg8.2%

        \[\leadsto e^{\mathsf{log1p}\left(\frac{\frac{\color{blue}{\left(-b\right) - b}}{3}}{a}\right)} - 1 \]
      5. add-sqr-sqrt8.2%

        \[\leadsto e^{\mathsf{log1p}\left(\frac{\frac{\left(-b\right) - \color{blue}{\sqrt{b} \cdot \sqrt{b}}}{3}}{a}\right)} - 1 \]
      6. sqrt-unprod4.9%

        \[\leadsto e^{\mathsf{log1p}\left(\frac{\frac{\left(-b\right) - \color{blue}{\sqrt{b \cdot b}}}{3}}{a}\right)} - 1 \]
      7. sqr-neg4.9%

        \[\leadsto e^{\mathsf{log1p}\left(\frac{\frac{\left(-b\right) - \sqrt{\color{blue}{\left(-b\right) \cdot \left(-b\right)}}}{3}}{a}\right)} - 1 \]
      8. sqrt-unprod0.0%

        \[\leadsto e^{\mathsf{log1p}\left(\frac{\frac{\left(-b\right) - \color{blue}{\sqrt{-b} \cdot \sqrt{-b}}}{3}}{a}\right)} - 1 \]
      9. add-sqr-sqrt62.3%

        \[\leadsto e^{\mathsf{log1p}\left(\frac{\frac{\left(-b\right) - \color{blue}{\left(-b\right)}}{3}}{a}\right)} - 1 \]
      10. +-inverses62.3%

        \[\leadsto e^{\mathsf{log1p}\left(\frac{\frac{\color{blue}{0}}{3}}{a}\right)} - 1 \]
      11. metadata-eval62.3%

        \[\leadsto e^{\mathsf{log1p}\left(\frac{\color{blue}{0}}{a}\right)} - 1 \]
    9. Applied egg-rr62.3%

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\frac{0}{a}\right)} - 1} \]
    10. Step-by-step derivation
      1. log1p-undefine62.3%

        \[\leadsto e^{\color{blue}{\log \left(1 + \frac{0}{a}\right)}} - 1 \]
      2. div062.3%

        \[\leadsto e^{\log \left(1 + \color{blue}{0}\right)} - 1 \]
      3. metadata-eval62.3%

        \[\leadsto e^{\log \color{blue}{1}} - 1 \]
      4. metadata-eval62.3%

        \[\leadsto e^{\color{blue}{0}} - 1 \]
      5. 1-exp62.3%

        \[\leadsto \color{blue}{1} - 1 \]
      6. metadata-eval62.3%

        \[\leadsto \color{blue}{0} \]
    11. Simplified62.3%

      \[\leadsto \color{blue}{0} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification66.1%

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

Alternative 16: 32.4% accurate, 116.0× speedup?

\[\begin{array}{l} \\ 0 \end{array} \]
(FPCore (a b c) :precision binary64 0.0)
double code(double a, double b, double c) {
	return 0.0;
}
real(8) function code(a, b, c)
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    code = 0.0d0
end function
public static double code(double a, double b, double c) {
	return 0.0;
}
def code(a, b, c):
	return 0.0
function code(a, b, c)
	return 0.0
end
function tmp = code(a, b, c)
	tmp = 0.0;
end
code[a_, b_, c_] := 0.0
\begin{array}{l}

\\
0
\end{array}
Derivation
  1. Initial program 66.1%

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

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

      \[\leadsto \frac{\left(-b\right) + \sqrt{\color{blue}{b \cdot b} - \left(3 \cdot a\right) \cdot c}}{3 \cdot a} \]
    3. associate-*l*66.0%

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

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

    \[\leadsto \frac{\left(-b\right) + \color{blue}{-1 \cdot b}}{3 \cdot a} \]
  6. Step-by-step derivation
    1. mul-1-neg37.4%

      \[\leadsto \frac{\left(-b\right) + \color{blue}{\left(-b\right)}}{3 \cdot a} \]
  7. Simplified37.4%

    \[\leadsto \frac{\left(-b\right) + \color{blue}{\left(-b\right)}}{3 \cdot a} \]
  8. Step-by-step derivation
    1. expm1-log1p-u21.7%

      \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{\left(-b\right) + \left(-b\right)}{3 \cdot a}\right)\right)} \]
    2. expm1-undefine18.3%

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\frac{\left(-b\right) + \left(-b\right)}{3 \cdot a}\right)} - 1} \]
    3. associate-/r*18.3%

      \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{\frac{\frac{\left(-b\right) + \left(-b\right)}{3}}{a}}\right)} - 1 \]
    4. unsub-neg18.3%

      \[\leadsto e^{\mathsf{log1p}\left(\frac{\frac{\color{blue}{\left(-b\right) - b}}{3}}{a}\right)} - 1 \]
    5. add-sqr-sqrt4.0%

      \[\leadsto e^{\mathsf{log1p}\left(\frac{\frac{\left(-b\right) - \color{blue}{\sqrt{b} \cdot \sqrt{b}}}{3}}{a}\right)} - 1 \]
    6. sqrt-unprod3.5%

      \[\leadsto e^{\mathsf{log1p}\left(\frac{\frac{\left(-b\right) - \color{blue}{\sqrt{b \cdot b}}}{3}}{a}\right)} - 1 \]
    7. sqr-neg3.5%

      \[\leadsto e^{\mathsf{log1p}\left(\frac{\frac{\left(-b\right) - \sqrt{\color{blue}{\left(-b\right) \cdot \left(-b\right)}}}{3}}{a}\right)} - 1 \]
    8. sqrt-unprod1.6%

      \[\leadsto e^{\mathsf{log1p}\left(\frac{\frac{\left(-b\right) - \color{blue}{\sqrt{-b} \cdot \sqrt{-b}}}{3}}{a}\right)} - 1 \]
    9. add-sqr-sqrt31.4%

      \[\leadsto e^{\mathsf{log1p}\left(\frac{\frac{\left(-b\right) - \color{blue}{\left(-b\right)}}{3}}{a}\right)} - 1 \]
    10. +-inverses31.4%

      \[\leadsto e^{\mathsf{log1p}\left(\frac{\frac{\color{blue}{0}}{3}}{a}\right)} - 1 \]
    11. metadata-eval31.4%

      \[\leadsto e^{\mathsf{log1p}\left(\frac{\color{blue}{0}}{a}\right)} - 1 \]
  9. Applied egg-rr31.4%

    \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\frac{0}{a}\right)} - 1} \]
  10. Step-by-step derivation
    1. log1p-undefine31.4%

      \[\leadsto e^{\color{blue}{\log \left(1 + \frac{0}{a}\right)}} - 1 \]
    2. div031.4%

      \[\leadsto e^{\log \left(1 + \color{blue}{0}\right)} - 1 \]
    3. metadata-eval31.4%

      \[\leadsto e^{\log \color{blue}{1}} - 1 \]
    4. metadata-eval31.4%

      \[\leadsto e^{\color{blue}{0}} - 1 \]
    5. 1-exp31.4%

      \[\leadsto \color{blue}{1} - 1 \]
    6. metadata-eval31.4%

      \[\leadsto \color{blue}{0} \]
  11. Simplified31.4%

    \[\leadsto \color{blue}{0} \]
  12. Final simplification31.4%

    \[\leadsto 0 \]
  13. Add Preprocessing

Reproduce

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