Cubic critical

Percentage Accurate: 64.6% → 89.7%
Time: 23.5s
Alternatives: 15
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 15 alternatives:

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

Initial Program: 64.6% 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: 89.7% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq -2.15 \cdot 10^{+79}:\\ \;\;\;\;\frac{1}{\frac{a}{b} \cdot -1.5}\\ \mathbf{elif}\;b \leq -6.2 \cdot 10^{-75}:\\ \;\;\;\;\frac{\sqrt{\mathsf{fma}\left(b, b, a \cdot \left(c \cdot -3\right)\right)} - b}{a \cdot 3}\\ \mathbf{elif}\;b \leq 5 \cdot 10^{-157}:\\ \;\;\;\;\left(b - \mathsf{hypot}\left(b, \sqrt{c \cdot \left(a \cdot -3\right)}\right)\right) \cdot \frac{1}{a \cdot -3}\\ \mathbf{elif}\;b \leq 6.1 \cdot 10^{+124}:\\ \;\;\;\;\frac{\sqrt{b \cdot b - c \cdot \left(a \cdot 3\right)} - b}{a \cdot 3}\\ \mathbf{else}:\\ \;\;\;\;0\\ \end{array} \end{array} \]
(FPCore (a b c)
 :precision binary64
 (if (<= b -2.15e+79)
   (/ 1.0 (* (/ a b) -1.5))
   (if (<= b -6.2e-75)
     (/ (- (sqrt (fma b b (* a (* c -3.0)))) b) (* a 3.0))
     (if (<= b 5e-157)
       (* (- b (hypot b (sqrt (* c (* a -3.0))))) (/ 1.0 (* a -3.0)))
       (if (<= b 6.1e+124)
         (/ (- (sqrt (- (* b b) (* c (* a 3.0)))) b) (* a 3.0))
         0.0)))))
double code(double a, double b, double c) {
	double tmp;
	if (b <= -2.15e+79) {
		tmp = 1.0 / ((a / b) * -1.5);
	} else if (b <= -6.2e-75) {
		tmp = (sqrt(fma(b, b, (a * (c * -3.0)))) - b) / (a * 3.0);
	} else if (b <= 5e-157) {
		tmp = (b - hypot(b, sqrt((c * (a * -3.0))))) * (1.0 / (a * -3.0));
	} else if (b <= 6.1e+124) {
		tmp = (sqrt(((b * b) - (c * (a * 3.0)))) - b) / (a * 3.0);
	} else {
		tmp = 0.0;
	}
	return tmp;
}
function code(a, b, c)
	tmp = 0.0
	if (b <= -2.15e+79)
		tmp = Float64(1.0 / Float64(Float64(a / b) * -1.5));
	elseif (b <= -6.2e-75)
		tmp = Float64(Float64(sqrt(fma(b, b, Float64(a * Float64(c * -3.0)))) - b) / Float64(a * 3.0));
	elseif (b <= 5e-157)
		tmp = Float64(Float64(b - hypot(b, sqrt(Float64(c * Float64(a * -3.0))))) * Float64(1.0 / Float64(a * -3.0)));
	elseif (b <= 6.1e+124)
		tmp = Float64(Float64(sqrt(Float64(Float64(b * b) - Float64(c * Float64(a * 3.0)))) - b) / Float64(a * 3.0));
	else
		tmp = 0.0;
	end
	return tmp
end
code[a_, b_, c_] := If[LessEqual[b, -2.15e+79], N[(1.0 / N[(N[(a / b), $MachinePrecision] * -1.5), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, -6.2e-75], N[(N[(N[Sqrt[N[(b * b + N[(a * N[(c * -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision] / N[(a * 3.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 5e-157], N[(N[(b - N[Sqrt[b ^ 2 + N[Sqrt[N[(c * N[(a * -3.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision] * N[(1.0 / N[(a * -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 6.1e+124], 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], 0.0]]]]
\begin{array}{l}

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

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

\mathbf{elif}\;b \leq 5 \cdot 10^{-157}:\\
\;\;\;\;\left(b - \mathsf{hypot}\left(b, \sqrt{c \cdot \left(a \cdot -3\right)}\right)\right) \cdot \frac{1}{a \cdot -3}\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if b < -2.1500000000000002e79

    1. Initial program 67.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-neg67.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-neg67.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*67.5%

        \[\leadsto \frac{\left(-b\right) + \sqrt{b \cdot b - \color{blue}{3 \cdot \left(a \cdot c\right)}}}{3 \cdot a} \]
    3. Simplified67.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. Taylor expanded in b around -inf 94.7%

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

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

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

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

        \[\leadsto \color{blue}{{\left(\frac{3 \cdot a}{\left(-b\right) + \left(-b\right)}\right)}^{-1}} \]
      3. count-294.7%

        \[\leadsto {\left(\frac{3 \cdot a}{\color{blue}{2 \cdot \left(-b\right)}}\right)}^{-1} \]
      4. times-frac94.8%

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

        \[\leadsto {\left(\color{blue}{1.5} \cdot \frac{a}{-b}\right)}^{-1} \]
      6. add-sqr-sqrt94.5%

        \[\leadsto {\left(1.5 \cdot \frac{a}{\color{blue}{\sqrt{-b} \cdot \sqrt{-b}}}\right)}^{-1} \]
      7. sqrt-unprod67.8%

        \[\leadsto {\left(1.5 \cdot \frac{a}{\color{blue}{\sqrt{\left(-b\right) \cdot \left(-b\right)}}}\right)}^{-1} \]
      8. sqr-neg67.8%

        \[\leadsto {\left(1.5 \cdot \frac{a}{\sqrt{\color{blue}{b \cdot b}}}\right)}^{-1} \]
      9. sqrt-unprod0.0%

        \[\leadsto {\left(1.5 \cdot \frac{a}{\color{blue}{\sqrt{b} \cdot \sqrt{b}}}\right)}^{-1} \]
      10. add-sqr-sqrt0.8%

        \[\leadsto {\left(1.5 \cdot \frac{a}{\color{blue}{b}}\right)}^{-1} \]
    9. Applied egg-rr0.8%

      \[\leadsto \color{blue}{{\left(1.5 \cdot \frac{a}{b}\right)}^{-1}} \]
    10. Step-by-step derivation
      1. unpow-10.8%

        \[\leadsto \color{blue}{\frac{1}{1.5 \cdot \frac{a}{b}}} \]
    11. Simplified0.8%

      \[\leadsto \color{blue}{\frac{1}{1.5 \cdot \frac{a}{b}}} \]
    12. Step-by-step derivation
      1. associate-*r/0.8%

        \[\leadsto \frac{1}{\color{blue}{\frac{1.5 \cdot a}{b}}} \]
      2. add-sqr-sqrt0.0%

        \[\leadsto \frac{1}{\frac{1.5 \cdot a}{\color{blue}{\sqrt{b} \cdot \sqrt{b}}}} \]
      3. sqrt-unprod67.8%

        \[\leadsto \frac{1}{\frac{1.5 \cdot a}{\color{blue}{\sqrt{b \cdot b}}}} \]
      4. sqr-neg67.8%

        \[\leadsto \frac{1}{\frac{1.5 \cdot a}{\sqrt{\color{blue}{\left(-b\right) \cdot \left(-b\right)}}}} \]
      5. sqrt-unprod94.5%

        \[\leadsto \frac{1}{\frac{1.5 \cdot a}{\color{blue}{\sqrt{-b} \cdot \sqrt{-b}}}} \]
      6. add-sqr-sqrt94.7%

        \[\leadsto \frac{1}{\frac{1.5 \cdot a}{\color{blue}{-b}}} \]
      7. distribute-neg-frac294.7%

        \[\leadsto \frac{1}{\color{blue}{-\frac{1.5 \cdot a}{b}}} \]
      8. associate-*r/94.8%

        \[\leadsto \frac{1}{-\color{blue}{1.5 \cdot \frac{a}{b}}} \]
      9. neg-sub081.3%

        \[\leadsto \frac{1}{\color{blue}{0 - 1.5 \cdot \frac{a}{b}}} \]
    13. Applied egg-rr81.3%

      \[\leadsto \frac{1}{\color{blue}{0 - 1.5 \cdot \frac{a}{b}}} \]
    14. Step-by-step derivation
      1. neg-sub094.8%

        \[\leadsto \frac{1}{\color{blue}{-1.5 \cdot \frac{a}{b}}} \]
      2. *-commutative94.8%

        \[\leadsto \frac{1}{-\color{blue}{\frac{a}{b} \cdot 1.5}} \]
      3. distribute-rgt-neg-in94.8%

        \[\leadsto \frac{1}{\color{blue}{\frac{a}{b} \cdot \left(-1.5\right)}} \]
      4. metadata-eval94.8%

        \[\leadsto \frac{1}{\frac{a}{b} \cdot \color{blue}{-1.5}} \]
    15. Simplified94.8%

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

    if -2.1500000000000002e79 < b < -6.20000000000000013e-75

    1. Initial program 99.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. /-rgt-identity99.5%

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

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

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

    if -6.20000000000000013e-75 < b < 5.0000000000000002e-157

    1. Initial program 71.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-neg71.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-neg71.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*71.7%

        \[\leadsto \frac{\left(-b\right) + \sqrt{b \cdot b - \color{blue}{3 \cdot \left(a \cdot c\right)}}}{3 \cdot a} \]
    3. Simplified71.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
    5. Applied egg-rr80.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. *-commutative80.3%

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

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

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

    if 5.0000000000000002e-157 < b < 6.1000000000000001e124

    1. Initial program 88.9%

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

    if 6.1000000000000001e124 < b

    1. Initial program 10.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-neg10.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-neg10.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*13.2%

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

      \[\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 4.6%

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

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

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

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

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

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

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

        \[\leadsto \frac{\sqrt{\color{blue}{b \cdot b}}}{3 \cdot a} - \frac{b}{3 \cdot a} \]
      6. sqrt-unprod43.4%

        \[\leadsto \frac{\color{blue}{\sqrt{b} \cdot \sqrt{b}}}{3 \cdot a} - \frac{b}{3 \cdot a} \]
      7. add-sqr-sqrt61.9%

        \[\leadsto \frac{\color{blue}{b}}{3 \cdot a} - \frac{b}{3 \cdot a} \]
      8. *-commutative61.9%

        \[\leadsto \frac{b}{\color{blue}{a \cdot 3}} - \frac{b}{3 \cdot a} \]
      9. *-commutative61.9%

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

      \[\leadsto \color{blue}{\frac{b}{a \cdot 3} - \frac{b}{a \cdot 3}} \]
    10. Step-by-step derivation
      1. +-inverses100.0%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -2.15 \cdot 10^{+79}:\\ \;\;\;\;\frac{1}{\frac{a}{b} \cdot -1.5}\\ \mathbf{elif}\;b \leq -6.2 \cdot 10^{-75}:\\ \;\;\;\;\frac{\sqrt{\mathsf{fma}\left(b, b, a \cdot \left(c \cdot -3\right)\right)} - b}{a \cdot 3}\\ \mathbf{elif}\;b \leq 5 \cdot 10^{-157}:\\ \;\;\;\;\left(b - \mathsf{hypot}\left(b, \sqrt{c \cdot \left(a \cdot -3\right)}\right)\right) \cdot \frac{1}{a \cdot -3}\\ \mathbf{elif}\;b \leq 6.1 \cdot 10^{+124}:\\ \;\;\;\;\frac{\sqrt{b \cdot b - c \cdot \left(a \cdot 3\right)} - b}{a \cdot 3}\\ \mathbf{else}:\\ \;\;\;\;0\\ \end{array} \]
  5. Add Preprocessing

Alternative 2: 89.9% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{\sqrt{b \cdot b - c \cdot \left(a \cdot 3\right)} - b}{a \cdot 3}\\ \mathbf{if}\;b \leq -2.15 \cdot 10^{+79}:\\ \;\;\;\;\frac{1}{\frac{a}{b} \cdot -1.5}\\ \mathbf{elif}\;b \leq -3.6 \cdot 10^{-232}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;b \leq 5 \cdot 10^{-147}:\\ \;\;\;\;\frac{-0.3333333333333333}{a} \cdot \left(b - \mathsf{hypot}\left(b, \sqrt{-3 \cdot \left(a \cdot c\right)}\right)\right)\\ \mathbf{elif}\;b \leq 10^{+124}:\\ \;\;\;\;t\_0\\ \mathbf{else}:\\ \;\;\;\;0\\ \end{array} \end{array} \]
(FPCore (a b c)
 :precision binary64
 (let* ((t_0 (/ (- (sqrt (- (* b b) (* c (* a 3.0)))) b) (* a 3.0))))
   (if (<= b -2.15e+79)
     (/ 1.0 (* (/ a b) -1.5))
     (if (<= b -3.6e-232)
       t_0
       (if (<= b 5e-147)
         (* (/ -0.3333333333333333 a) (- b (hypot b (sqrt (* -3.0 (* a c))))))
         (if (<= b 1e+124) t_0 0.0))))))
double code(double a, double b, double c) {
	double t_0 = (sqrt(((b * b) - (c * (a * 3.0)))) - b) / (a * 3.0);
	double tmp;
	if (b <= -2.15e+79) {
		tmp = 1.0 / ((a / b) * -1.5);
	} else if (b <= -3.6e-232) {
		tmp = t_0;
	} else if (b <= 5e-147) {
		tmp = (-0.3333333333333333 / a) * (b - hypot(b, sqrt((-3.0 * (a * c)))));
	} else if (b <= 1e+124) {
		tmp = t_0;
	} else {
		tmp = 0.0;
	}
	return tmp;
}
public static double code(double a, double b, double c) {
	double t_0 = (Math.sqrt(((b * b) - (c * (a * 3.0)))) - b) / (a * 3.0);
	double tmp;
	if (b <= -2.15e+79) {
		tmp = 1.0 / ((a / b) * -1.5);
	} else if (b <= -3.6e-232) {
		tmp = t_0;
	} else if (b <= 5e-147) {
		tmp = (-0.3333333333333333 / a) * (b - Math.hypot(b, Math.sqrt((-3.0 * (a * c)))));
	} else if (b <= 1e+124) {
		tmp = t_0;
	} else {
		tmp = 0.0;
	}
	return tmp;
}
def code(a, b, c):
	t_0 = (math.sqrt(((b * b) - (c * (a * 3.0)))) - b) / (a * 3.0)
	tmp = 0
	if b <= -2.15e+79:
		tmp = 1.0 / ((a / b) * -1.5)
	elif b <= -3.6e-232:
		tmp = t_0
	elif b <= 5e-147:
		tmp = (-0.3333333333333333 / a) * (b - math.hypot(b, math.sqrt((-3.0 * (a * c)))))
	elif b <= 1e+124:
		tmp = t_0
	else:
		tmp = 0.0
	return tmp
function code(a, b, c)
	t_0 = Float64(Float64(sqrt(Float64(Float64(b * b) - Float64(c * Float64(a * 3.0)))) - b) / Float64(a * 3.0))
	tmp = 0.0
	if (b <= -2.15e+79)
		tmp = Float64(1.0 / Float64(Float64(a / b) * -1.5));
	elseif (b <= -3.6e-232)
		tmp = t_0;
	elseif (b <= 5e-147)
		tmp = Float64(Float64(-0.3333333333333333 / a) * Float64(b - hypot(b, sqrt(Float64(-3.0 * Float64(a * c))))));
	elseif (b <= 1e+124)
		tmp = t_0;
	else
		tmp = 0.0;
	end
	return tmp
end
function tmp_2 = code(a, b, c)
	t_0 = (sqrt(((b * b) - (c * (a * 3.0)))) - b) / (a * 3.0);
	tmp = 0.0;
	if (b <= -2.15e+79)
		tmp = 1.0 / ((a / b) * -1.5);
	elseif (b <= -3.6e-232)
		tmp = t_0;
	elseif (b <= 5e-147)
		tmp = (-0.3333333333333333 / a) * (b - hypot(b, sqrt((-3.0 * (a * c)))));
	elseif (b <= 1e+124)
		tmp = t_0;
	else
		tmp = 0.0;
	end
	tmp_2 = tmp;
end
code[a_, b_, c_] := Block[{t$95$0 = 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]}, If[LessEqual[b, -2.15e+79], N[(1.0 / N[(N[(a / b), $MachinePrecision] * -1.5), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, -3.6e-232], t$95$0, If[LessEqual[b, 5e-147], N[(N[(-0.3333333333333333 / a), $MachinePrecision] * N[(b - N[Sqrt[b ^ 2 + N[Sqrt[N[(-3.0 * N[(a * c), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 1e+124], t$95$0, 0.0]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \frac{\sqrt{b \cdot b - c \cdot \left(a \cdot 3\right)} - b}{a \cdot 3}\\
\mathbf{if}\;b \leq -2.15 \cdot 10^{+79}:\\
\;\;\;\;\frac{1}{\frac{a}{b} \cdot -1.5}\\

\mathbf{elif}\;b \leq -3.6 \cdot 10^{-232}:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;b \leq 5 \cdot 10^{-147}:\\
\;\;\;\;\frac{-0.3333333333333333}{a} \cdot \left(b - \mathsf{hypot}\left(b, \sqrt{-3 \cdot \left(a \cdot c\right)}\right)\right)\\

\mathbf{elif}\;b \leq 10^{+124}:\\
\;\;\;\;t\_0\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if b < -2.1500000000000002e79

    1. Initial program 67.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-neg67.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-neg67.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*67.5%

        \[\leadsto \frac{\left(-b\right) + \sqrt{b \cdot b - \color{blue}{3 \cdot \left(a \cdot c\right)}}}{3 \cdot a} \]
    3. Simplified67.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. Taylor expanded in b around -inf 94.7%

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

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

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

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

        \[\leadsto \color{blue}{{\left(\frac{3 \cdot a}{\left(-b\right) + \left(-b\right)}\right)}^{-1}} \]
      3. count-294.7%

        \[\leadsto {\left(\frac{3 \cdot a}{\color{blue}{2 \cdot \left(-b\right)}}\right)}^{-1} \]
      4. times-frac94.8%

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

        \[\leadsto {\left(\color{blue}{1.5} \cdot \frac{a}{-b}\right)}^{-1} \]
      6. add-sqr-sqrt94.5%

        \[\leadsto {\left(1.5 \cdot \frac{a}{\color{blue}{\sqrt{-b} \cdot \sqrt{-b}}}\right)}^{-1} \]
      7. sqrt-unprod67.8%

        \[\leadsto {\left(1.5 \cdot \frac{a}{\color{blue}{\sqrt{\left(-b\right) \cdot \left(-b\right)}}}\right)}^{-1} \]
      8. sqr-neg67.8%

        \[\leadsto {\left(1.5 \cdot \frac{a}{\sqrt{\color{blue}{b \cdot b}}}\right)}^{-1} \]
      9. sqrt-unprod0.0%

        \[\leadsto {\left(1.5 \cdot \frac{a}{\color{blue}{\sqrt{b} \cdot \sqrt{b}}}\right)}^{-1} \]
      10. add-sqr-sqrt0.8%

        \[\leadsto {\left(1.5 \cdot \frac{a}{\color{blue}{b}}\right)}^{-1} \]
    9. Applied egg-rr0.8%

      \[\leadsto \color{blue}{{\left(1.5 \cdot \frac{a}{b}\right)}^{-1}} \]
    10. Step-by-step derivation
      1. unpow-10.8%

        \[\leadsto \color{blue}{\frac{1}{1.5 \cdot \frac{a}{b}}} \]
    11. Simplified0.8%

      \[\leadsto \color{blue}{\frac{1}{1.5 \cdot \frac{a}{b}}} \]
    12. Step-by-step derivation
      1. associate-*r/0.8%

        \[\leadsto \frac{1}{\color{blue}{\frac{1.5 \cdot a}{b}}} \]
      2. add-sqr-sqrt0.0%

        \[\leadsto \frac{1}{\frac{1.5 \cdot a}{\color{blue}{\sqrt{b} \cdot \sqrt{b}}}} \]
      3. sqrt-unprod67.8%

        \[\leadsto \frac{1}{\frac{1.5 \cdot a}{\color{blue}{\sqrt{b \cdot b}}}} \]
      4. sqr-neg67.8%

        \[\leadsto \frac{1}{\frac{1.5 \cdot a}{\sqrt{\color{blue}{\left(-b\right) \cdot \left(-b\right)}}}} \]
      5. sqrt-unprod94.5%

        \[\leadsto \frac{1}{\frac{1.5 \cdot a}{\color{blue}{\sqrt{-b} \cdot \sqrt{-b}}}} \]
      6. add-sqr-sqrt94.7%

        \[\leadsto \frac{1}{\frac{1.5 \cdot a}{\color{blue}{-b}}} \]
      7. distribute-neg-frac294.7%

        \[\leadsto \frac{1}{\color{blue}{-\frac{1.5 \cdot a}{b}}} \]
      8. associate-*r/94.8%

        \[\leadsto \frac{1}{-\color{blue}{1.5 \cdot \frac{a}{b}}} \]
      9. neg-sub081.3%

        \[\leadsto \frac{1}{\color{blue}{0 - 1.5 \cdot \frac{a}{b}}} \]
    13. Applied egg-rr81.3%

      \[\leadsto \frac{1}{\color{blue}{0 - 1.5 \cdot \frac{a}{b}}} \]
    14. Step-by-step derivation
      1. neg-sub094.8%

        \[\leadsto \frac{1}{\color{blue}{-1.5 \cdot \frac{a}{b}}} \]
      2. *-commutative94.8%

        \[\leadsto \frac{1}{-\color{blue}{\frac{a}{b} \cdot 1.5}} \]
      3. distribute-rgt-neg-in94.8%

        \[\leadsto \frac{1}{\color{blue}{\frac{a}{b} \cdot \left(-1.5\right)}} \]
      4. metadata-eval94.8%

        \[\leadsto \frac{1}{\frac{a}{b} \cdot \color{blue}{-1.5}} \]
    15. Simplified94.8%

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

    if -2.1500000000000002e79 < b < -3.60000000000000016e-232 or 5.00000000000000013e-147 < b < 9.99999999999999948e123

    1. Initial program 91.6%

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

    if -3.60000000000000016e-232 < b < 5.00000000000000013e-147

    1. Initial program 63.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-neg63.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-neg63.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*63.7%

        \[\leadsto \frac{\left(-b\right) + \sqrt{b \cdot b - \color{blue}{3 \cdot \left(a \cdot c\right)}}}{3 \cdot a} \]
    3. Simplified63.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
    5. Applied egg-rr78.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. *-commutative78.4%

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

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

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

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

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

    if 9.99999999999999948e123 < b

    1. Initial program 10.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-neg10.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-neg10.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*13.2%

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

      \[\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 4.6%

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

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

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

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

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

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

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

        \[\leadsto \frac{\sqrt{\color{blue}{b \cdot b}}}{3 \cdot a} - \frac{b}{3 \cdot a} \]
      6. sqrt-unprod43.4%

        \[\leadsto \frac{\color{blue}{\sqrt{b} \cdot \sqrt{b}}}{3 \cdot a} - \frac{b}{3 \cdot a} \]
      7. add-sqr-sqrt61.9%

        \[\leadsto \frac{\color{blue}{b}}{3 \cdot a} - \frac{b}{3 \cdot a} \]
      8. *-commutative61.9%

        \[\leadsto \frac{b}{\color{blue}{a \cdot 3}} - \frac{b}{3 \cdot a} \]
      9. *-commutative61.9%

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

      \[\leadsto \color{blue}{\frac{b}{a \cdot 3} - \frac{b}{a \cdot 3}} \]
    10. Step-by-step derivation
      1. +-inverses100.0%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -2.15 \cdot 10^{+79}:\\ \;\;\;\;\frac{1}{\frac{a}{b} \cdot -1.5}\\ \mathbf{elif}\;b \leq -3.6 \cdot 10^{-232}:\\ \;\;\;\;\frac{\sqrt{b \cdot b - c \cdot \left(a \cdot 3\right)} - b}{a \cdot 3}\\ \mathbf{elif}\;b \leq 5 \cdot 10^{-147}:\\ \;\;\;\;\frac{-0.3333333333333333}{a} \cdot \left(b - \mathsf{hypot}\left(b, \sqrt{-3 \cdot \left(a \cdot c\right)}\right)\right)\\ \mathbf{elif}\;b \leq 10^{+124}:\\ \;\;\;\;\frac{\sqrt{b \cdot b - c \cdot \left(a \cdot 3\right)} - b}{a \cdot 3}\\ \mathbf{else}:\\ \;\;\;\;0\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 89.8% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{\sqrt{b \cdot b - c \cdot \left(a \cdot 3\right)} - b}{a \cdot 3}\\ \mathbf{if}\;b \leq -1.2 \cdot 10^{+79}:\\ \;\;\;\;\frac{1}{\frac{a}{b} \cdot -1.5}\\ \mathbf{elif}\;b \leq -6.5 \cdot 10^{-84}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;b \leq 8.5 \cdot 10^{-133}:\\ \;\;\;\;\left(b - \mathsf{hypot}\left(b, \sqrt{a \cdot \left(c \cdot -3\right)}\right)\right) \cdot \frac{-0.3333333333333333}{a}\\ \mathbf{elif}\;b \leq 5 \cdot 10^{+124}:\\ \;\;\;\;t\_0\\ \mathbf{else}:\\ \;\;\;\;0\\ \end{array} \end{array} \]
(FPCore (a b c)
 :precision binary64
 (let* ((t_0 (/ (- (sqrt (- (* b b) (* c (* a 3.0)))) b) (* a 3.0))))
   (if (<= b -1.2e+79)
     (/ 1.0 (* (/ a b) -1.5))
     (if (<= b -6.5e-84)
       t_0
       (if (<= b 8.5e-133)
         (* (- b (hypot b (sqrt (* a (* c -3.0))))) (/ -0.3333333333333333 a))
         (if (<= b 5e+124) t_0 0.0))))))
double code(double a, double b, double c) {
	double t_0 = (sqrt(((b * b) - (c * (a * 3.0)))) - b) / (a * 3.0);
	double tmp;
	if (b <= -1.2e+79) {
		tmp = 1.0 / ((a / b) * -1.5);
	} else if (b <= -6.5e-84) {
		tmp = t_0;
	} else if (b <= 8.5e-133) {
		tmp = (b - hypot(b, sqrt((a * (c * -3.0))))) * (-0.3333333333333333 / a);
	} else if (b <= 5e+124) {
		tmp = t_0;
	} else {
		tmp = 0.0;
	}
	return tmp;
}
public static double code(double a, double b, double c) {
	double t_0 = (Math.sqrt(((b * b) - (c * (a * 3.0)))) - b) / (a * 3.0);
	double tmp;
	if (b <= -1.2e+79) {
		tmp = 1.0 / ((a / b) * -1.5);
	} else if (b <= -6.5e-84) {
		tmp = t_0;
	} else if (b <= 8.5e-133) {
		tmp = (b - Math.hypot(b, Math.sqrt((a * (c * -3.0))))) * (-0.3333333333333333 / a);
	} else if (b <= 5e+124) {
		tmp = t_0;
	} else {
		tmp = 0.0;
	}
	return tmp;
}
def code(a, b, c):
	t_0 = (math.sqrt(((b * b) - (c * (a * 3.0)))) - b) / (a * 3.0)
	tmp = 0
	if b <= -1.2e+79:
		tmp = 1.0 / ((a / b) * -1.5)
	elif b <= -6.5e-84:
		tmp = t_0
	elif b <= 8.5e-133:
		tmp = (b - math.hypot(b, math.sqrt((a * (c * -3.0))))) * (-0.3333333333333333 / a)
	elif b <= 5e+124:
		tmp = t_0
	else:
		tmp = 0.0
	return tmp
function code(a, b, c)
	t_0 = Float64(Float64(sqrt(Float64(Float64(b * b) - Float64(c * Float64(a * 3.0)))) - b) / Float64(a * 3.0))
	tmp = 0.0
	if (b <= -1.2e+79)
		tmp = Float64(1.0 / Float64(Float64(a / b) * -1.5));
	elseif (b <= -6.5e-84)
		tmp = t_0;
	elseif (b <= 8.5e-133)
		tmp = Float64(Float64(b - hypot(b, sqrt(Float64(a * Float64(c * -3.0))))) * Float64(-0.3333333333333333 / a));
	elseif (b <= 5e+124)
		tmp = t_0;
	else
		tmp = 0.0;
	end
	return tmp
end
function tmp_2 = code(a, b, c)
	t_0 = (sqrt(((b * b) - (c * (a * 3.0)))) - b) / (a * 3.0);
	tmp = 0.0;
	if (b <= -1.2e+79)
		tmp = 1.0 / ((a / b) * -1.5);
	elseif (b <= -6.5e-84)
		tmp = t_0;
	elseif (b <= 8.5e-133)
		tmp = (b - hypot(b, sqrt((a * (c * -3.0))))) * (-0.3333333333333333 / a);
	elseif (b <= 5e+124)
		tmp = t_0;
	else
		tmp = 0.0;
	end
	tmp_2 = tmp;
end
code[a_, b_, c_] := Block[{t$95$0 = 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]}, If[LessEqual[b, -1.2e+79], N[(1.0 / N[(N[(a / b), $MachinePrecision] * -1.5), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, -6.5e-84], t$95$0, If[LessEqual[b, 8.5e-133], N[(N[(b - N[Sqrt[b ^ 2 + N[Sqrt[N[(a * N[(c * -3.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision] * N[(-0.3333333333333333 / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 5e+124], t$95$0, 0.0]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \frac{\sqrt{b \cdot b - c \cdot \left(a \cdot 3\right)} - b}{a \cdot 3}\\
\mathbf{if}\;b \leq -1.2 \cdot 10^{+79}:\\
\;\;\;\;\frac{1}{\frac{a}{b} \cdot -1.5}\\

\mathbf{elif}\;b \leq -6.5 \cdot 10^{-84}:\\
\;\;\;\;t\_0\\

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

\mathbf{elif}\;b \leq 5 \cdot 10^{+124}:\\
\;\;\;\;t\_0\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if b < -1.19999999999999993e79

    1. Initial program 67.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-neg67.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-neg67.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*67.5%

        \[\leadsto \frac{\left(-b\right) + \sqrt{b \cdot b - \color{blue}{3 \cdot \left(a \cdot c\right)}}}{3 \cdot a} \]
    3. Simplified67.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. Taylor expanded in b around -inf 94.7%

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

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

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

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

        \[\leadsto \color{blue}{{\left(\frac{3 \cdot a}{\left(-b\right) + \left(-b\right)}\right)}^{-1}} \]
      3. count-294.7%

        \[\leadsto {\left(\frac{3 \cdot a}{\color{blue}{2 \cdot \left(-b\right)}}\right)}^{-1} \]
      4. times-frac94.8%

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

        \[\leadsto {\left(\color{blue}{1.5} \cdot \frac{a}{-b}\right)}^{-1} \]
      6. add-sqr-sqrt94.5%

        \[\leadsto {\left(1.5 \cdot \frac{a}{\color{blue}{\sqrt{-b} \cdot \sqrt{-b}}}\right)}^{-1} \]
      7. sqrt-unprod67.8%

        \[\leadsto {\left(1.5 \cdot \frac{a}{\color{blue}{\sqrt{\left(-b\right) \cdot \left(-b\right)}}}\right)}^{-1} \]
      8. sqr-neg67.8%

        \[\leadsto {\left(1.5 \cdot \frac{a}{\sqrt{\color{blue}{b \cdot b}}}\right)}^{-1} \]
      9. sqrt-unprod0.0%

        \[\leadsto {\left(1.5 \cdot \frac{a}{\color{blue}{\sqrt{b} \cdot \sqrt{b}}}\right)}^{-1} \]
      10. add-sqr-sqrt0.8%

        \[\leadsto {\left(1.5 \cdot \frac{a}{\color{blue}{b}}\right)}^{-1} \]
    9. Applied egg-rr0.8%

      \[\leadsto \color{blue}{{\left(1.5 \cdot \frac{a}{b}\right)}^{-1}} \]
    10. Step-by-step derivation
      1. unpow-10.8%

        \[\leadsto \color{blue}{\frac{1}{1.5 \cdot \frac{a}{b}}} \]
    11. Simplified0.8%

      \[\leadsto \color{blue}{\frac{1}{1.5 \cdot \frac{a}{b}}} \]
    12. Step-by-step derivation
      1. associate-*r/0.8%

        \[\leadsto \frac{1}{\color{blue}{\frac{1.5 \cdot a}{b}}} \]
      2. add-sqr-sqrt0.0%

        \[\leadsto \frac{1}{\frac{1.5 \cdot a}{\color{blue}{\sqrt{b} \cdot \sqrt{b}}}} \]
      3. sqrt-unprod67.8%

        \[\leadsto \frac{1}{\frac{1.5 \cdot a}{\color{blue}{\sqrt{b \cdot b}}}} \]
      4. sqr-neg67.8%

        \[\leadsto \frac{1}{\frac{1.5 \cdot a}{\sqrt{\color{blue}{\left(-b\right) \cdot \left(-b\right)}}}} \]
      5. sqrt-unprod94.5%

        \[\leadsto \frac{1}{\frac{1.5 \cdot a}{\color{blue}{\sqrt{-b} \cdot \sqrt{-b}}}} \]
      6. add-sqr-sqrt94.7%

        \[\leadsto \frac{1}{\frac{1.5 \cdot a}{\color{blue}{-b}}} \]
      7. distribute-neg-frac294.7%

        \[\leadsto \frac{1}{\color{blue}{-\frac{1.5 \cdot a}{b}}} \]
      8. associate-*r/94.8%

        \[\leadsto \frac{1}{-\color{blue}{1.5 \cdot \frac{a}{b}}} \]
      9. neg-sub081.3%

        \[\leadsto \frac{1}{\color{blue}{0 - 1.5 \cdot \frac{a}{b}}} \]
    13. Applied egg-rr81.3%

      \[\leadsto \frac{1}{\color{blue}{0 - 1.5 \cdot \frac{a}{b}}} \]
    14. Step-by-step derivation
      1. neg-sub094.8%

        \[\leadsto \frac{1}{\color{blue}{-1.5 \cdot \frac{a}{b}}} \]
      2. *-commutative94.8%

        \[\leadsto \frac{1}{-\color{blue}{\frac{a}{b} \cdot 1.5}} \]
      3. distribute-rgt-neg-in94.8%

        \[\leadsto \frac{1}{\color{blue}{\frac{a}{b} \cdot \left(-1.5\right)}} \]
      4. metadata-eval94.8%

        \[\leadsto \frac{1}{\frac{a}{b} \cdot \color{blue}{-1.5}} \]
    15. Simplified94.8%

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

    if -1.19999999999999993e79 < b < -6.50000000000000022e-84 or 8.49999999999999957e-133 < b < 4.9999999999999996e124

    1. Initial program 93.9%

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

    if -6.50000000000000022e-84 < b < 8.49999999999999957e-133

    1. Initial program 72.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-neg72.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-neg72.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*72.1%

        \[\leadsto \frac{\left(-b\right) + \sqrt{b \cdot b - \color{blue}{3 \cdot \left(a \cdot c\right)}}}{3 \cdot a} \]
    3. Simplified72.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-rr80.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. *-commutative80.6%

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

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

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

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

    if 4.9999999999999996e124 < b

    1. Initial program 10.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-neg10.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-neg10.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*13.2%

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

      \[\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 4.6%

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

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

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

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

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

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

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

        \[\leadsto \frac{\sqrt{\color{blue}{b \cdot b}}}{3 \cdot a} - \frac{b}{3 \cdot a} \]
      6. sqrt-unprod43.4%

        \[\leadsto \frac{\color{blue}{\sqrt{b} \cdot \sqrt{b}}}{3 \cdot a} - \frac{b}{3 \cdot a} \]
      7. add-sqr-sqrt61.9%

        \[\leadsto \frac{\color{blue}{b}}{3 \cdot a} - \frac{b}{3 \cdot a} \]
      8. *-commutative61.9%

        \[\leadsto \frac{b}{\color{blue}{a \cdot 3}} - \frac{b}{3 \cdot a} \]
      9. *-commutative61.9%

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

      \[\leadsto \color{blue}{\frac{b}{a \cdot 3} - \frac{b}{a \cdot 3}} \]
    10. Step-by-step derivation
      1. +-inverses100.0%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -1.2 \cdot 10^{+79}:\\ \;\;\;\;\frac{1}{\frac{a}{b} \cdot -1.5}\\ \mathbf{elif}\;b \leq -6.5 \cdot 10^{-84}:\\ \;\;\;\;\frac{\sqrt{b \cdot b - c \cdot \left(a \cdot 3\right)} - b}{a \cdot 3}\\ \mathbf{elif}\;b \leq 8.5 \cdot 10^{-133}:\\ \;\;\;\;\left(b - \mathsf{hypot}\left(b, \sqrt{a \cdot \left(c \cdot -3\right)}\right)\right) \cdot \frac{-0.3333333333333333}{a}\\ \mathbf{elif}\;b \leq 5 \cdot 10^{+124}:\\ \;\;\;\;\frac{\sqrt{b \cdot b - c \cdot \left(a \cdot 3\right)} - b}{a \cdot 3}\\ \mathbf{else}:\\ \;\;\;\;0\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 89.9% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{\sqrt{b \cdot b - c \cdot \left(a \cdot 3\right)} - b}{a \cdot 3}\\ \mathbf{if}\;b \leq -1.95 \cdot 10^{+79}:\\ \;\;\;\;\frac{1}{\frac{a}{b} \cdot -1.5}\\ \mathbf{elif}\;b \leq -9.2 \cdot 10^{-222}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;b \leq 2.3 \cdot 10^{-110}:\\ \;\;\;\;\frac{\frac{b - \mathsf{hypot}\left(b, \sqrt{a \cdot \left(c \cdot -3\right)}\right)}{a}}{-3}\\ \mathbf{elif}\;b \leq 10^{+124}:\\ \;\;\;\;t\_0\\ \mathbf{else}:\\ \;\;\;\;0\\ \end{array} \end{array} \]
(FPCore (a b c)
 :precision binary64
 (let* ((t_0 (/ (- (sqrt (- (* b b) (* c (* a 3.0)))) b) (* a 3.0))))
   (if (<= b -1.95e+79)
     (/ 1.0 (* (/ a b) -1.5))
     (if (<= b -9.2e-222)
       t_0
       (if (<= b 2.3e-110)
         (/ (/ (- b (hypot b (sqrt (* a (* c -3.0))))) a) -3.0)
         (if (<= b 1e+124) t_0 0.0))))))
double code(double a, double b, double c) {
	double t_0 = (sqrt(((b * b) - (c * (a * 3.0)))) - b) / (a * 3.0);
	double tmp;
	if (b <= -1.95e+79) {
		tmp = 1.0 / ((a / b) * -1.5);
	} else if (b <= -9.2e-222) {
		tmp = t_0;
	} else if (b <= 2.3e-110) {
		tmp = ((b - hypot(b, sqrt((a * (c * -3.0))))) / a) / -3.0;
	} else if (b <= 1e+124) {
		tmp = t_0;
	} else {
		tmp = 0.0;
	}
	return tmp;
}
public static double code(double a, double b, double c) {
	double t_0 = (Math.sqrt(((b * b) - (c * (a * 3.0)))) - b) / (a * 3.0);
	double tmp;
	if (b <= -1.95e+79) {
		tmp = 1.0 / ((a / b) * -1.5);
	} else if (b <= -9.2e-222) {
		tmp = t_0;
	} else if (b <= 2.3e-110) {
		tmp = ((b - Math.hypot(b, Math.sqrt((a * (c * -3.0))))) / a) / -3.0;
	} else if (b <= 1e+124) {
		tmp = t_0;
	} else {
		tmp = 0.0;
	}
	return tmp;
}
def code(a, b, c):
	t_0 = (math.sqrt(((b * b) - (c * (a * 3.0)))) - b) / (a * 3.0)
	tmp = 0
	if b <= -1.95e+79:
		tmp = 1.0 / ((a / b) * -1.5)
	elif b <= -9.2e-222:
		tmp = t_0
	elif b <= 2.3e-110:
		tmp = ((b - math.hypot(b, math.sqrt((a * (c * -3.0))))) / a) / -3.0
	elif b <= 1e+124:
		tmp = t_0
	else:
		tmp = 0.0
	return tmp
function code(a, b, c)
	t_0 = Float64(Float64(sqrt(Float64(Float64(b * b) - Float64(c * Float64(a * 3.0)))) - b) / Float64(a * 3.0))
	tmp = 0.0
	if (b <= -1.95e+79)
		tmp = Float64(1.0 / Float64(Float64(a / b) * -1.5));
	elseif (b <= -9.2e-222)
		tmp = t_0;
	elseif (b <= 2.3e-110)
		tmp = Float64(Float64(Float64(b - hypot(b, sqrt(Float64(a * Float64(c * -3.0))))) / a) / -3.0);
	elseif (b <= 1e+124)
		tmp = t_0;
	else
		tmp = 0.0;
	end
	return tmp
end
function tmp_2 = code(a, b, c)
	t_0 = (sqrt(((b * b) - (c * (a * 3.0)))) - b) / (a * 3.0);
	tmp = 0.0;
	if (b <= -1.95e+79)
		tmp = 1.0 / ((a / b) * -1.5);
	elseif (b <= -9.2e-222)
		tmp = t_0;
	elseif (b <= 2.3e-110)
		tmp = ((b - hypot(b, sqrt((a * (c * -3.0))))) / a) / -3.0;
	elseif (b <= 1e+124)
		tmp = t_0;
	else
		tmp = 0.0;
	end
	tmp_2 = tmp;
end
code[a_, b_, c_] := Block[{t$95$0 = 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]}, If[LessEqual[b, -1.95e+79], N[(1.0 / N[(N[(a / b), $MachinePrecision] * -1.5), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, -9.2e-222], t$95$0, If[LessEqual[b, 2.3e-110], N[(N[(N[(b - N[Sqrt[b ^ 2 + N[Sqrt[N[(a * N[(c * -3.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision] / -3.0), $MachinePrecision], If[LessEqual[b, 1e+124], t$95$0, 0.0]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \frac{\sqrt{b \cdot b - c \cdot \left(a \cdot 3\right)} - b}{a \cdot 3}\\
\mathbf{if}\;b \leq -1.95 \cdot 10^{+79}:\\
\;\;\;\;\frac{1}{\frac{a}{b} \cdot -1.5}\\

\mathbf{elif}\;b \leq -9.2 \cdot 10^{-222}:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;b \leq 2.3 \cdot 10^{-110}:\\
\;\;\;\;\frac{\frac{b - \mathsf{hypot}\left(b, \sqrt{a \cdot \left(c \cdot -3\right)}\right)}{a}}{-3}\\

\mathbf{elif}\;b \leq 10^{+124}:\\
\;\;\;\;t\_0\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if b < -1.9499999999999999e79

    1. Initial program 67.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-neg67.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-neg67.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*67.5%

        \[\leadsto \frac{\left(-b\right) + \sqrt{b \cdot b - \color{blue}{3 \cdot \left(a \cdot c\right)}}}{3 \cdot a} \]
    3. Simplified67.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. Taylor expanded in b around -inf 94.7%

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

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

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

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

        \[\leadsto \color{blue}{{\left(\frac{3 \cdot a}{\left(-b\right) + \left(-b\right)}\right)}^{-1}} \]
      3. count-294.7%

        \[\leadsto {\left(\frac{3 \cdot a}{\color{blue}{2 \cdot \left(-b\right)}}\right)}^{-1} \]
      4. times-frac94.8%

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

        \[\leadsto {\left(\color{blue}{1.5} \cdot \frac{a}{-b}\right)}^{-1} \]
      6. add-sqr-sqrt94.5%

        \[\leadsto {\left(1.5 \cdot \frac{a}{\color{blue}{\sqrt{-b} \cdot \sqrt{-b}}}\right)}^{-1} \]
      7. sqrt-unprod67.8%

        \[\leadsto {\left(1.5 \cdot \frac{a}{\color{blue}{\sqrt{\left(-b\right) \cdot \left(-b\right)}}}\right)}^{-1} \]
      8. sqr-neg67.8%

        \[\leadsto {\left(1.5 \cdot \frac{a}{\sqrt{\color{blue}{b \cdot b}}}\right)}^{-1} \]
      9. sqrt-unprod0.0%

        \[\leadsto {\left(1.5 \cdot \frac{a}{\color{blue}{\sqrt{b} \cdot \sqrt{b}}}\right)}^{-1} \]
      10. add-sqr-sqrt0.8%

        \[\leadsto {\left(1.5 \cdot \frac{a}{\color{blue}{b}}\right)}^{-1} \]
    9. Applied egg-rr0.8%

      \[\leadsto \color{blue}{{\left(1.5 \cdot \frac{a}{b}\right)}^{-1}} \]
    10. Step-by-step derivation
      1. unpow-10.8%

        \[\leadsto \color{blue}{\frac{1}{1.5 \cdot \frac{a}{b}}} \]
    11. Simplified0.8%

      \[\leadsto \color{blue}{\frac{1}{1.5 \cdot \frac{a}{b}}} \]
    12. Step-by-step derivation
      1. associate-*r/0.8%

        \[\leadsto \frac{1}{\color{blue}{\frac{1.5 \cdot a}{b}}} \]
      2. add-sqr-sqrt0.0%

        \[\leadsto \frac{1}{\frac{1.5 \cdot a}{\color{blue}{\sqrt{b} \cdot \sqrt{b}}}} \]
      3. sqrt-unprod67.8%

        \[\leadsto \frac{1}{\frac{1.5 \cdot a}{\color{blue}{\sqrt{b \cdot b}}}} \]
      4. sqr-neg67.8%

        \[\leadsto \frac{1}{\frac{1.5 \cdot a}{\sqrt{\color{blue}{\left(-b\right) \cdot \left(-b\right)}}}} \]
      5. sqrt-unprod94.5%

        \[\leadsto \frac{1}{\frac{1.5 \cdot a}{\color{blue}{\sqrt{-b} \cdot \sqrt{-b}}}} \]
      6. add-sqr-sqrt94.7%

        \[\leadsto \frac{1}{\frac{1.5 \cdot a}{\color{blue}{-b}}} \]
      7. distribute-neg-frac294.7%

        \[\leadsto \frac{1}{\color{blue}{-\frac{1.5 \cdot a}{b}}} \]
      8. associate-*r/94.8%

        \[\leadsto \frac{1}{-\color{blue}{1.5 \cdot \frac{a}{b}}} \]
      9. neg-sub081.3%

        \[\leadsto \frac{1}{\color{blue}{0 - 1.5 \cdot \frac{a}{b}}} \]
    13. Applied egg-rr81.3%

      \[\leadsto \frac{1}{\color{blue}{0 - 1.5 \cdot \frac{a}{b}}} \]
    14. Step-by-step derivation
      1. neg-sub094.8%

        \[\leadsto \frac{1}{\color{blue}{-1.5 \cdot \frac{a}{b}}} \]
      2. *-commutative94.8%

        \[\leadsto \frac{1}{-\color{blue}{\frac{a}{b} \cdot 1.5}} \]
      3. distribute-rgt-neg-in94.8%

        \[\leadsto \frac{1}{\color{blue}{\frac{a}{b} \cdot \left(-1.5\right)}} \]
      4. metadata-eval94.8%

        \[\leadsto \frac{1}{\frac{a}{b} \cdot \color{blue}{-1.5}} \]
    15. Simplified94.8%

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

    if -1.9499999999999999e79 < b < -9.2000000000000005e-222 or 2.3000000000000001e-110 < b < 9.99999999999999948e123

    1. Initial program 91.4%

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

    if -9.2000000000000005e-222 < b < 2.3000000000000001e-110

    1. Initial program 66.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-neg66.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-neg66.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*66.8%

        \[\leadsto \frac{\left(-b\right) + \sqrt{b \cdot b - \color{blue}{3 \cdot \left(a \cdot c\right)}}}{3 \cdot a} \]
    3. Simplified66.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-rr80.0%

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

        \[\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}} \]
      2. un-div-inv80.3%

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

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

    if 9.99999999999999948e123 < b

    1. Initial program 10.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-neg10.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-neg10.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*13.2%

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

      \[\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 4.6%

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

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

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

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

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

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

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

        \[\leadsto \frac{\sqrt{\color{blue}{b \cdot b}}}{3 \cdot a} - \frac{b}{3 \cdot a} \]
      6. sqrt-unprod43.4%

        \[\leadsto \frac{\color{blue}{\sqrt{b} \cdot \sqrt{b}}}{3 \cdot a} - \frac{b}{3 \cdot a} \]
      7. add-sqr-sqrt61.9%

        \[\leadsto \frac{\color{blue}{b}}{3 \cdot a} - \frac{b}{3 \cdot a} \]
      8. *-commutative61.9%

        \[\leadsto \frac{b}{\color{blue}{a \cdot 3}} - \frac{b}{3 \cdot a} \]
      9. *-commutative61.9%

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

      \[\leadsto \color{blue}{\frac{b}{a \cdot 3} - \frac{b}{a \cdot 3}} \]
    10. Step-by-step derivation
      1. +-inverses100.0%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -1.95 \cdot 10^{+79}:\\ \;\;\;\;\frac{1}{\frac{a}{b} \cdot -1.5}\\ \mathbf{elif}\;b \leq -9.2 \cdot 10^{-222}:\\ \;\;\;\;\frac{\sqrt{b \cdot b - c \cdot \left(a \cdot 3\right)} - b}{a \cdot 3}\\ \mathbf{elif}\;b \leq 2.3 \cdot 10^{-110}:\\ \;\;\;\;\frac{\frac{b - \mathsf{hypot}\left(b, \sqrt{a \cdot \left(c \cdot -3\right)}\right)}{a}}{-3}\\ \mathbf{elif}\;b \leq 10^{+124}:\\ \;\;\;\;\frac{\sqrt{b \cdot b - c \cdot \left(a \cdot 3\right)} - b}{a \cdot 3}\\ \mathbf{else}:\\ \;\;\;\;0\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 89.8% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := a \cdot \left(c \cdot -3\right)\\ \mathbf{if}\;b \leq -2.1 \cdot 10^{+79}:\\ \;\;\;\;\frac{1}{\frac{a}{b} \cdot -1.5}\\ \mathbf{elif}\;b \leq -1.1 \cdot 10^{-81}:\\ \;\;\;\;\frac{\sqrt{\mathsf{fma}\left(b, b, t\_0\right)} - b}{a \cdot 3}\\ \mathbf{elif}\;b \leq 5 \cdot 10^{-147}:\\ \;\;\;\;\left(b - \mathsf{hypot}\left(b, \sqrt{t\_0}\right)\right) \cdot \frac{-0.3333333333333333}{a}\\ \mathbf{elif}\;b \leq 8.8 \cdot 10^{+124}:\\ \;\;\;\;\frac{\sqrt{b \cdot b - c \cdot \left(a \cdot 3\right)} - b}{a \cdot 3}\\ \mathbf{else}:\\ \;\;\;\;0\\ \end{array} \end{array} \]
(FPCore (a b c)
 :precision binary64
 (let* ((t_0 (* a (* c -3.0))))
   (if (<= b -2.1e+79)
     (/ 1.0 (* (/ a b) -1.5))
     (if (<= b -1.1e-81)
       (/ (- (sqrt (fma b b t_0)) b) (* a 3.0))
       (if (<= b 5e-147)
         (* (- b (hypot b (sqrt t_0))) (/ -0.3333333333333333 a))
         (if (<= b 8.8e+124)
           (/ (- (sqrt (- (* b b) (* c (* a 3.0)))) b) (* a 3.0))
           0.0))))))
double code(double a, double b, double c) {
	double t_0 = a * (c * -3.0);
	double tmp;
	if (b <= -2.1e+79) {
		tmp = 1.0 / ((a / b) * -1.5);
	} else if (b <= -1.1e-81) {
		tmp = (sqrt(fma(b, b, t_0)) - b) / (a * 3.0);
	} else if (b <= 5e-147) {
		tmp = (b - hypot(b, sqrt(t_0))) * (-0.3333333333333333 / a);
	} else if (b <= 8.8e+124) {
		tmp = (sqrt(((b * b) - (c * (a * 3.0)))) - b) / (a * 3.0);
	} else {
		tmp = 0.0;
	}
	return tmp;
}
function code(a, b, c)
	t_0 = Float64(a * Float64(c * -3.0))
	tmp = 0.0
	if (b <= -2.1e+79)
		tmp = Float64(1.0 / Float64(Float64(a / b) * -1.5));
	elseif (b <= -1.1e-81)
		tmp = Float64(Float64(sqrt(fma(b, b, t_0)) - b) / Float64(a * 3.0));
	elseif (b <= 5e-147)
		tmp = Float64(Float64(b - hypot(b, sqrt(t_0))) * Float64(-0.3333333333333333 / a));
	elseif (b <= 8.8e+124)
		tmp = Float64(Float64(sqrt(Float64(Float64(b * b) - Float64(c * Float64(a * 3.0)))) - b) / Float64(a * 3.0));
	else
		tmp = 0.0;
	end
	return tmp
end
code[a_, b_, c_] := Block[{t$95$0 = N[(a * N[(c * -3.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -2.1e+79], N[(1.0 / N[(N[(a / b), $MachinePrecision] * -1.5), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, -1.1e-81], N[(N[(N[Sqrt[N[(b * b + t$95$0), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision] / N[(a * 3.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 5e-147], N[(N[(b - N[Sqrt[b ^ 2 + N[Sqrt[t$95$0], $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision] * N[(-0.3333333333333333 / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 8.8e+124], 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], 0.0]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := a \cdot \left(c \cdot -3\right)\\
\mathbf{if}\;b \leq -2.1 \cdot 10^{+79}:\\
\;\;\;\;\frac{1}{\frac{a}{b} \cdot -1.5}\\

\mathbf{elif}\;b \leq -1.1 \cdot 10^{-81}:\\
\;\;\;\;\frac{\sqrt{\mathsf{fma}\left(b, b, t\_0\right)} - b}{a \cdot 3}\\

\mathbf{elif}\;b \leq 5 \cdot 10^{-147}:\\
\;\;\;\;\left(b - \mathsf{hypot}\left(b, \sqrt{t\_0}\right)\right) \cdot \frac{-0.3333333333333333}{a}\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if b < -2.10000000000000008e79

    1. Initial program 67.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-neg67.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-neg67.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*67.5%

        \[\leadsto \frac{\left(-b\right) + \sqrt{b \cdot b - \color{blue}{3 \cdot \left(a \cdot c\right)}}}{3 \cdot a} \]
    3. Simplified67.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. Taylor expanded in b around -inf 94.7%

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

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

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

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

        \[\leadsto \color{blue}{{\left(\frac{3 \cdot a}{\left(-b\right) + \left(-b\right)}\right)}^{-1}} \]
      3. count-294.7%

        \[\leadsto {\left(\frac{3 \cdot a}{\color{blue}{2 \cdot \left(-b\right)}}\right)}^{-1} \]
      4. times-frac94.8%

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

        \[\leadsto {\left(\color{blue}{1.5} \cdot \frac{a}{-b}\right)}^{-1} \]
      6. add-sqr-sqrt94.5%

        \[\leadsto {\left(1.5 \cdot \frac{a}{\color{blue}{\sqrt{-b} \cdot \sqrt{-b}}}\right)}^{-1} \]
      7. sqrt-unprod67.8%

        \[\leadsto {\left(1.5 \cdot \frac{a}{\color{blue}{\sqrt{\left(-b\right) \cdot \left(-b\right)}}}\right)}^{-1} \]
      8. sqr-neg67.8%

        \[\leadsto {\left(1.5 \cdot \frac{a}{\sqrt{\color{blue}{b \cdot b}}}\right)}^{-1} \]
      9. sqrt-unprod0.0%

        \[\leadsto {\left(1.5 \cdot \frac{a}{\color{blue}{\sqrt{b} \cdot \sqrt{b}}}\right)}^{-1} \]
      10. add-sqr-sqrt0.8%

        \[\leadsto {\left(1.5 \cdot \frac{a}{\color{blue}{b}}\right)}^{-1} \]
    9. Applied egg-rr0.8%

      \[\leadsto \color{blue}{{\left(1.5 \cdot \frac{a}{b}\right)}^{-1}} \]
    10. Step-by-step derivation
      1. unpow-10.8%

        \[\leadsto \color{blue}{\frac{1}{1.5 \cdot \frac{a}{b}}} \]
    11. Simplified0.8%

      \[\leadsto \color{blue}{\frac{1}{1.5 \cdot \frac{a}{b}}} \]
    12. Step-by-step derivation
      1. associate-*r/0.8%

        \[\leadsto \frac{1}{\color{blue}{\frac{1.5 \cdot a}{b}}} \]
      2. add-sqr-sqrt0.0%

        \[\leadsto \frac{1}{\frac{1.5 \cdot a}{\color{blue}{\sqrt{b} \cdot \sqrt{b}}}} \]
      3. sqrt-unprod67.8%

        \[\leadsto \frac{1}{\frac{1.5 \cdot a}{\color{blue}{\sqrt{b \cdot b}}}} \]
      4. sqr-neg67.8%

        \[\leadsto \frac{1}{\frac{1.5 \cdot a}{\sqrt{\color{blue}{\left(-b\right) \cdot \left(-b\right)}}}} \]
      5. sqrt-unprod94.5%

        \[\leadsto \frac{1}{\frac{1.5 \cdot a}{\color{blue}{\sqrt{-b} \cdot \sqrt{-b}}}} \]
      6. add-sqr-sqrt94.7%

        \[\leadsto \frac{1}{\frac{1.5 \cdot a}{\color{blue}{-b}}} \]
      7. distribute-neg-frac294.7%

        \[\leadsto \frac{1}{\color{blue}{-\frac{1.5 \cdot a}{b}}} \]
      8. associate-*r/94.8%

        \[\leadsto \frac{1}{-\color{blue}{1.5 \cdot \frac{a}{b}}} \]
      9. neg-sub081.3%

        \[\leadsto \frac{1}{\color{blue}{0 - 1.5 \cdot \frac{a}{b}}} \]
    13. Applied egg-rr81.3%

      \[\leadsto \frac{1}{\color{blue}{0 - 1.5 \cdot \frac{a}{b}}} \]
    14. Step-by-step derivation
      1. neg-sub094.8%

        \[\leadsto \frac{1}{\color{blue}{-1.5 \cdot \frac{a}{b}}} \]
      2. *-commutative94.8%

        \[\leadsto \frac{1}{-\color{blue}{\frac{a}{b} \cdot 1.5}} \]
      3. distribute-rgt-neg-in94.8%

        \[\leadsto \frac{1}{\color{blue}{\frac{a}{b} \cdot \left(-1.5\right)}} \]
      4. metadata-eval94.8%

        \[\leadsto \frac{1}{\frac{a}{b} \cdot \color{blue}{-1.5}} \]
    15. Simplified94.8%

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

    if -2.10000000000000008e79 < b < -1.1e-81

    1. Initial program 99.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. /-rgt-identity99.5%

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

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

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

    if -1.1e-81 < b < 5.00000000000000013e-147

    1. Initial program 72.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-neg72.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-neg72.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*72.1%

        \[\leadsto \frac{\left(-b\right) + \sqrt{b \cdot b - \color{blue}{3 \cdot \left(a \cdot c\right)}}}{3 \cdot a} \]
    3. Simplified72.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-rr80.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. *-commutative80.6%

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

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

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

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

    if 5.00000000000000013e-147 < b < 8.8000000000000004e124

    1. Initial program 88.6%

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

    if 8.8000000000000004e124 < b

    1. Initial program 10.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-neg10.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-neg10.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*13.2%

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

      \[\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 4.6%

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

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

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

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

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

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

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

        \[\leadsto \frac{\sqrt{\color{blue}{b \cdot b}}}{3 \cdot a} - \frac{b}{3 \cdot a} \]
      6. sqrt-unprod43.4%

        \[\leadsto \frac{\color{blue}{\sqrt{b} \cdot \sqrt{b}}}{3 \cdot a} - \frac{b}{3 \cdot a} \]
      7. add-sqr-sqrt61.9%

        \[\leadsto \frac{\color{blue}{b}}{3 \cdot a} - \frac{b}{3 \cdot a} \]
      8. *-commutative61.9%

        \[\leadsto \frac{b}{\color{blue}{a \cdot 3}} - \frac{b}{3 \cdot a} \]
      9. *-commutative61.9%

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

      \[\leadsto \color{blue}{\frac{b}{a \cdot 3} - \frac{b}{a \cdot 3}} \]
    10. Step-by-step derivation
      1. +-inverses100.0%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -2.1 \cdot 10^{+79}:\\ \;\;\;\;\frac{1}{\frac{a}{b} \cdot -1.5}\\ \mathbf{elif}\;b \leq -1.1 \cdot 10^{-81}:\\ \;\;\;\;\frac{\sqrt{\mathsf{fma}\left(b, b, a \cdot \left(c \cdot -3\right)\right)} - b}{a \cdot 3}\\ \mathbf{elif}\;b \leq 5 \cdot 10^{-147}:\\ \;\;\;\;\left(b - \mathsf{hypot}\left(b, \sqrt{a \cdot \left(c \cdot -3\right)}\right)\right) \cdot \frac{-0.3333333333333333}{a}\\ \mathbf{elif}\;b \leq 8.8 \cdot 10^{+124}:\\ \;\;\;\;\frac{\sqrt{b \cdot b - c \cdot \left(a \cdot 3\right)} - b}{a \cdot 3}\\ \mathbf{else}:\\ \;\;\;\;0\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 89.3% accurate, 0.9× speedup?

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

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

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

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


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

    1. Initial program 67.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-neg67.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-neg67.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*67.5%

        \[\leadsto \frac{\left(-b\right) + \sqrt{b \cdot b - \color{blue}{3 \cdot \left(a \cdot c\right)}}}{3 \cdot a} \]
    3. Simplified67.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. Taylor expanded in b around -inf 94.7%

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

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

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

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

        \[\leadsto \color{blue}{{\left(\frac{3 \cdot a}{\left(-b\right) + \left(-b\right)}\right)}^{-1}} \]
      3. count-294.7%

        \[\leadsto {\left(\frac{3 \cdot a}{\color{blue}{2 \cdot \left(-b\right)}}\right)}^{-1} \]
      4. times-frac94.8%

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

        \[\leadsto {\left(\color{blue}{1.5} \cdot \frac{a}{-b}\right)}^{-1} \]
      6. add-sqr-sqrt94.5%

        \[\leadsto {\left(1.5 \cdot \frac{a}{\color{blue}{\sqrt{-b} \cdot \sqrt{-b}}}\right)}^{-1} \]
      7. sqrt-unprod67.8%

        \[\leadsto {\left(1.5 \cdot \frac{a}{\color{blue}{\sqrt{\left(-b\right) \cdot \left(-b\right)}}}\right)}^{-1} \]
      8. sqr-neg67.8%

        \[\leadsto {\left(1.5 \cdot \frac{a}{\sqrt{\color{blue}{b \cdot b}}}\right)}^{-1} \]
      9. sqrt-unprod0.0%

        \[\leadsto {\left(1.5 \cdot \frac{a}{\color{blue}{\sqrt{b} \cdot \sqrt{b}}}\right)}^{-1} \]
      10. add-sqr-sqrt0.8%

        \[\leadsto {\left(1.5 \cdot \frac{a}{\color{blue}{b}}\right)}^{-1} \]
    9. Applied egg-rr0.8%

      \[\leadsto \color{blue}{{\left(1.5 \cdot \frac{a}{b}\right)}^{-1}} \]
    10. Step-by-step derivation
      1. unpow-10.8%

        \[\leadsto \color{blue}{\frac{1}{1.5 \cdot \frac{a}{b}}} \]
    11. Simplified0.8%

      \[\leadsto \color{blue}{\frac{1}{1.5 \cdot \frac{a}{b}}} \]
    12. Step-by-step derivation
      1. associate-*r/0.8%

        \[\leadsto \frac{1}{\color{blue}{\frac{1.5 \cdot a}{b}}} \]
      2. add-sqr-sqrt0.0%

        \[\leadsto \frac{1}{\frac{1.5 \cdot a}{\color{blue}{\sqrt{b} \cdot \sqrt{b}}}} \]
      3. sqrt-unprod67.8%

        \[\leadsto \frac{1}{\frac{1.5 \cdot a}{\color{blue}{\sqrt{b \cdot b}}}} \]
      4. sqr-neg67.8%

        \[\leadsto \frac{1}{\frac{1.5 \cdot a}{\sqrt{\color{blue}{\left(-b\right) \cdot \left(-b\right)}}}} \]
      5. sqrt-unprod94.5%

        \[\leadsto \frac{1}{\frac{1.5 \cdot a}{\color{blue}{\sqrt{-b} \cdot \sqrt{-b}}}} \]
      6. add-sqr-sqrt94.7%

        \[\leadsto \frac{1}{\frac{1.5 \cdot a}{\color{blue}{-b}}} \]
      7. distribute-neg-frac294.7%

        \[\leadsto \frac{1}{\color{blue}{-\frac{1.5 \cdot a}{b}}} \]
      8. associate-*r/94.8%

        \[\leadsto \frac{1}{-\color{blue}{1.5 \cdot \frac{a}{b}}} \]
      9. neg-sub081.3%

        \[\leadsto \frac{1}{\color{blue}{0 - 1.5 \cdot \frac{a}{b}}} \]
    13. Applied egg-rr81.3%

      \[\leadsto \frac{1}{\color{blue}{0 - 1.5 \cdot \frac{a}{b}}} \]
    14. Step-by-step derivation
      1. neg-sub094.8%

        \[\leadsto \frac{1}{\color{blue}{-1.5 \cdot \frac{a}{b}}} \]
      2. *-commutative94.8%

        \[\leadsto \frac{1}{-\color{blue}{\frac{a}{b} \cdot 1.5}} \]
      3. distribute-rgt-neg-in94.8%

        \[\leadsto \frac{1}{\color{blue}{\frac{a}{b} \cdot \left(-1.5\right)}} \]
      4. metadata-eval94.8%

        \[\leadsto \frac{1}{\frac{a}{b} \cdot \color{blue}{-1.5}} \]
    15. Simplified94.8%

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

    if -2.1500000000000002e79 < b < 1.9999999999999999e124

    1. Initial program 85.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-neg85.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-neg85.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*85.2%

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

      \[\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 1.9999999999999999e124 < b

    1. Initial program 10.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-neg10.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-neg10.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*13.2%

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

      \[\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 4.6%

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

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

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

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

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

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

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

        \[\leadsto \frac{\sqrt{\color{blue}{b \cdot b}}}{3 \cdot a} - \frac{b}{3 \cdot a} \]
      6. sqrt-unprod43.4%

        \[\leadsto \frac{\color{blue}{\sqrt{b} \cdot \sqrt{b}}}{3 \cdot a} - \frac{b}{3 \cdot a} \]
      7. add-sqr-sqrt61.9%

        \[\leadsto \frac{\color{blue}{b}}{3 \cdot a} - \frac{b}{3 \cdot a} \]
      8. *-commutative61.9%

        \[\leadsto \frac{b}{\color{blue}{a \cdot 3}} - \frac{b}{3 \cdot a} \]
      9. *-commutative61.9%

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

      \[\leadsto \color{blue}{\frac{b}{a \cdot 3} - \frac{b}{a \cdot 3}} \]
    10. Step-by-step derivation
      1. +-inverses100.0%

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

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

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

Alternative 7: 89.3% accurate, 0.9× speedup?

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

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

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

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


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

    1. Initial program 67.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-neg67.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-neg67.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*67.5%

        \[\leadsto \frac{\left(-b\right) + \sqrt{b \cdot b - \color{blue}{3 \cdot \left(a \cdot c\right)}}}{3 \cdot a} \]
    3. Simplified67.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. Taylor expanded in b around -inf 94.7%

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

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

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

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

        \[\leadsto \color{blue}{{\left(\frac{3 \cdot a}{\left(-b\right) + \left(-b\right)}\right)}^{-1}} \]
      3. count-294.7%

        \[\leadsto {\left(\frac{3 \cdot a}{\color{blue}{2 \cdot \left(-b\right)}}\right)}^{-1} \]
      4. times-frac94.8%

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

        \[\leadsto {\left(\color{blue}{1.5} \cdot \frac{a}{-b}\right)}^{-1} \]
      6. add-sqr-sqrt94.5%

        \[\leadsto {\left(1.5 \cdot \frac{a}{\color{blue}{\sqrt{-b} \cdot \sqrt{-b}}}\right)}^{-1} \]
      7. sqrt-unprod67.8%

        \[\leadsto {\left(1.5 \cdot \frac{a}{\color{blue}{\sqrt{\left(-b\right) \cdot \left(-b\right)}}}\right)}^{-1} \]
      8. sqr-neg67.8%

        \[\leadsto {\left(1.5 \cdot \frac{a}{\sqrt{\color{blue}{b \cdot b}}}\right)}^{-1} \]
      9. sqrt-unprod0.0%

        \[\leadsto {\left(1.5 \cdot \frac{a}{\color{blue}{\sqrt{b} \cdot \sqrt{b}}}\right)}^{-1} \]
      10. add-sqr-sqrt0.8%

        \[\leadsto {\left(1.5 \cdot \frac{a}{\color{blue}{b}}\right)}^{-1} \]
    9. Applied egg-rr0.8%

      \[\leadsto \color{blue}{{\left(1.5 \cdot \frac{a}{b}\right)}^{-1}} \]
    10. Step-by-step derivation
      1. unpow-10.8%

        \[\leadsto \color{blue}{\frac{1}{1.5 \cdot \frac{a}{b}}} \]
    11. Simplified0.8%

      \[\leadsto \color{blue}{\frac{1}{1.5 \cdot \frac{a}{b}}} \]
    12. Step-by-step derivation
      1. associate-*r/0.8%

        \[\leadsto \frac{1}{\color{blue}{\frac{1.5 \cdot a}{b}}} \]
      2. add-sqr-sqrt0.0%

        \[\leadsto \frac{1}{\frac{1.5 \cdot a}{\color{blue}{\sqrt{b} \cdot \sqrt{b}}}} \]
      3. sqrt-unprod67.8%

        \[\leadsto \frac{1}{\frac{1.5 \cdot a}{\color{blue}{\sqrt{b \cdot b}}}} \]
      4. sqr-neg67.8%

        \[\leadsto \frac{1}{\frac{1.5 \cdot a}{\sqrt{\color{blue}{\left(-b\right) \cdot \left(-b\right)}}}} \]
      5. sqrt-unprod94.5%

        \[\leadsto \frac{1}{\frac{1.5 \cdot a}{\color{blue}{\sqrt{-b} \cdot \sqrt{-b}}}} \]
      6. add-sqr-sqrt94.7%

        \[\leadsto \frac{1}{\frac{1.5 \cdot a}{\color{blue}{-b}}} \]
      7. distribute-neg-frac294.7%

        \[\leadsto \frac{1}{\color{blue}{-\frac{1.5 \cdot a}{b}}} \]
      8. associate-*r/94.8%

        \[\leadsto \frac{1}{-\color{blue}{1.5 \cdot \frac{a}{b}}} \]
      9. neg-sub081.3%

        \[\leadsto \frac{1}{\color{blue}{0 - 1.5 \cdot \frac{a}{b}}} \]
    13. Applied egg-rr81.3%

      \[\leadsto \frac{1}{\color{blue}{0 - 1.5 \cdot \frac{a}{b}}} \]
    14. Step-by-step derivation
      1. neg-sub094.8%

        \[\leadsto \frac{1}{\color{blue}{-1.5 \cdot \frac{a}{b}}} \]
      2. *-commutative94.8%

        \[\leadsto \frac{1}{-\color{blue}{\frac{a}{b} \cdot 1.5}} \]
      3. distribute-rgt-neg-in94.8%

        \[\leadsto \frac{1}{\color{blue}{\frac{a}{b} \cdot \left(-1.5\right)}} \]
      4. metadata-eval94.8%

        \[\leadsto \frac{1}{\frac{a}{b} \cdot \color{blue}{-1.5}} \]
    15. Simplified94.8%

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

    if -1.7499999999999999e79 < b < 5.5000000000000002e123

    1. Initial program 85.3%

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

    if 5.5000000000000002e123 < b

    1. Initial program 10.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-neg10.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-neg10.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*13.2%

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

      \[\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 4.6%

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

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

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

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

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

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

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

        \[\leadsto \frac{\sqrt{\color{blue}{b \cdot b}}}{3 \cdot a} - \frac{b}{3 \cdot a} \]
      6. sqrt-unprod43.4%

        \[\leadsto \frac{\color{blue}{\sqrt{b} \cdot \sqrt{b}}}{3 \cdot a} - \frac{b}{3 \cdot a} \]
      7. add-sqr-sqrt61.9%

        \[\leadsto \frac{\color{blue}{b}}{3 \cdot a} - \frac{b}{3 \cdot a} \]
      8. *-commutative61.9%

        \[\leadsto \frac{b}{\color{blue}{a \cdot 3}} - \frac{b}{3 \cdot a} \]
      9. *-commutative61.9%

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

      \[\leadsto \color{blue}{\frac{b}{a \cdot 3} - \frac{b}{a \cdot 3}} \]
    10. Step-by-step derivation
      1. +-inverses100.0%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -1.75 \cdot 10^{+79}:\\ \;\;\;\;\frac{1}{\frac{a}{b} \cdot -1.5}\\ \mathbf{elif}\;b \leq 5.5 \cdot 10^{+123}:\\ \;\;\;\;\frac{\sqrt{b \cdot b - c \cdot \left(a \cdot 3\right)} - b}{a \cdot 3}\\ \mathbf{else}:\\ \;\;\;\;0\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 78.9% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq -5.4 \cdot 10^{-89}:\\ \;\;\;\;-0.6666666666666666 \cdot \frac{b}{a} + 0.5 \cdot \frac{c}{b}\\ \mathbf{elif}\;b \leq 6 \cdot 10^{-173}:\\ \;\;\;\;\frac{\sqrt{-3 \cdot \left(a \cdot c\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 -5.4e-89)
   (+ (* -0.6666666666666666 (/ b a)) (* 0.5 (/ c b)))
   (if (<= b 6e-173)
     (/ (- (sqrt (* -3.0 (* a c))) 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 <= -5.4e-89) {
		tmp = (-0.6666666666666666 * (b / a)) + (0.5 * (c / b));
	} else if (b <= 6e-173) {
		tmp = (sqrt((-3.0 * (a * c))) - 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 <= (-5.4d-89)) then
        tmp = ((-0.6666666666666666d0) * (b / a)) + (0.5d0 * (c / b))
    else if (b <= 6d-173) then
        tmp = (sqrt(((-3.0d0) * (a * c))) - 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 <= -5.4e-89) {
		tmp = (-0.6666666666666666 * (b / a)) + (0.5 * (c / b));
	} else if (b <= 6e-173) {
		tmp = (Math.sqrt((-3.0 * (a * c))) - 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 <= -5.4e-89:
		tmp = (-0.6666666666666666 * (b / a)) + (0.5 * (c / b))
	elif b <= 6e-173:
		tmp = (math.sqrt((-3.0 * (a * c))) - 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 <= -5.4e-89)
		tmp = Float64(Float64(-0.6666666666666666 * Float64(b / a)) + Float64(0.5 * Float64(c / b)));
	elseif (b <= 6e-173)
		tmp = Float64(Float64(sqrt(Float64(-3.0 * Float64(a * c))) - 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 <= -5.4e-89)
		tmp = (-0.6666666666666666 * (b / a)) + (0.5 * (c / b));
	elseif (b <= 6e-173)
		tmp = (sqrt((-3.0 * (a * c))) - 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, -5.4e-89], N[(N[(-0.6666666666666666 * N[(b / a), $MachinePrecision]), $MachinePrecision] + N[(0.5 * N[(c / b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 6e-173], N[(N[(N[Sqrt[N[(-3.0 * N[(a * c), $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 -5.4 \cdot 10^{-89}:\\
\;\;\;\;-0.6666666666666666 \cdot \frac{b}{a} + 0.5 \cdot \frac{c}{b}\\

\mathbf{elif}\;b \leq 6 \cdot 10^{-173}:\\
\;\;\;\;\frac{\sqrt{-3 \cdot \left(a \cdot c\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 < -5.39999999999999975e-89

    1. Initial program 79.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-neg79.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-neg79.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*79.2%

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

      \[\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 85.8%

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

    if -5.39999999999999975e-89 < b < 6.0000000000000002e-173

    1. Initial program 76.3%

      \[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a} \]
    2. Step-by-step derivation
      1. sqr-neg76.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-neg76.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*76.2%

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

      \[\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 72.0%

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

    if 6.0000000000000002e-173 < b

    1. Initial program 48.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-neg48.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-neg48.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*49.7%

        \[\leadsto \frac{\left(-b\right) + \sqrt{b \cdot b - \color{blue}{3 \cdot \left(a \cdot c\right)}}}{3 \cdot a} \]
    3. Simplified49.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
    5. Taylor expanded in b around inf 79.0%

      \[\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*81.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. Simplified81.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 3 regimes into one program.
  4. Final simplification81.5%

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -5.4 \cdot 10^{-89}:\\ \;\;\;\;-0.6666666666666666 \cdot \frac{b}{a} + 0.5 \cdot \frac{c}{b}\\ \mathbf{elif}\;b \leq 6 \cdot 10^{-173}:\\ \;\;\;\;\frac{\sqrt{-3 \cdot \left(a \cdot c\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: 78.9% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq -5.4 \cdot 10^{-89}:\\ \;\;\;\;-0.6666666666666666 \cdot \frac{b}{a} + 0.5 \cdot \frac{c}{b}\\ \mathbf{elif}\;b \leq 6 \cdot 10^{-173}:\\ \;\;\;\;\frac{\sqrt{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 -5.4e-89)
   (+ (* -0.6666666666666666 (/ b a)) (* 0.5 (/ c b)))
   (if (<= b 6e-173)
     (/ (- (sqrt (* 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 <= -5.4e-89) {
		tmp = (-0.6666666666666666 * (b / a)) + (0.5 * (c / b));
	} else if (b <= 6e-173) {
		tmp = (sqrt((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 <= (-5.4d-89)) then
        tmp = ((-0.6666666666666666d0) * (b / a)) + (0.5d0 * (c / b))
    else if (b <= 6d-173) then
        tmp = (sqrt((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 <= -5.4e-89) {
		tmp = (-0.6666666666666666 * (b / a)) + (0.5 * (c / b));
	} else if (b <= 6e-173) {
		tmp = (Math.sqrt((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 <= -5.4e-89:
		tmp = (-0.6666666666666666 * (b / a)) + (0.5 * (c / b))
	elif b <= 6e-173:
		tmp = (math.sqrt((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 <= -5.4e-89)
		tmp = Float64(Float64(-0.6666666666666666 * Float64(b / a)) + Float64(0.5 * Float64(c / b)));
	elseif (b <= 6e-173)
		tmp = Float64(Float64(sqrt(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 <= -5.4e-89)
		tmp = (-0.6666666666666666 * (b / a)) + (0.5 * (c / b));
	elseif (b <= 6e-173)
		tmp = (sqrt((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, -5.4e-89], N[(N[(-0.6666666666666666 * N[(b / a), $MachinePrecision]), $MachinePrecision] + N[(0.5 * N[(c / b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 6e-173], N[(N[(N[Sqrt[N[(c * N[(a * -3.0), $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 -5.4 \cdot 10^{-89}:\\
\;\;\;\;-0.6666666666666666 \cdot \frac{b}{a} + 0.5 \cdot \frac{c}{b}\\

\mathbf{elif}\;b \leq 6 \cdot 10^{-173}:\\
\;\;\;\;\frac{\sqrt{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 < -5.39999999999999975e-89

    1. Initial program 79.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-neg79.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-neg79.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*79.2%

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

      \[\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 85.8%

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

    if -5.39999999999999975e-89 < b < 6.0000000000000002e-173

    1. Initial program 76.3%

      \[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a} \]
    2. Step-by-step derivation
      1. sqr-neg76.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-neg76.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*76.2%

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

      \[\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 72.0%

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

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

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

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

    if 6.0000000000000002e-173 < b

    1. Initial program 48.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-neg48.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-neg48.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*49.7%

        \[\leadsto \frac{\left(-b\right) + \sqrt{b \cdot b - \color{blue}{3 \cdot \left(a \cdot c\right)}}}{3 \cdot a} \]
    3. Simplified49.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
    5. Taylor expanded in b around inf 79.0%

      \[\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*81.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. Simplified81.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 3 regimes into one program.
  4. Final simplification81.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -5.4 \cdot 10^{-89}:\\ \;\;\;\;-0.6666666666666666 \cdot \frac{b}{a} + 0.5 \cdot \frac{c}{b}\\ \mathbf{elif}\;b \leq 6 \cdot 10^{-173}:\\ \;\;\;\;\frac{\sqrt{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 10: 67.2% accurate, 5.8× speedup?

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

\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 < -9.999999999999969e-311

    1. Initial program 78.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-neg78.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-neg78.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*78.5%

        \[\leadsto \frac{\left(-b\right) + \sqrt{b \cdot b - \color{blue}{3 \cdot \left(a \cdot c\right)}}}{3 \cdot a} \]
    3. Simplified78.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. Taylor expanded in b around -inf 70.3%

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

    if -9.999999999999969e-311 < b

    1. Initial program 53.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-neg53.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-neg53.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*54.0%

        \[\leadsto \frac{\left(-b\right) + \sqrt{b \cdot b - \color{blue}{3 \cdot \left(a \cdot c\right)}}}{3 \cdot a} \]
    3. Simplified54.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 68.0%

      \[\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*69.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. Simplified69.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 2 regimes into one program.
  4. Final simplification70.1%

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -1 \cdot 10^{-310}:\\ \;\;\;\;-0.6666666666666666 \cdot \frac{b}{a} + 0.5 \cdot \frac{c}{b}\\ \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 11: 66.6% accurate, 7.2× speedup?

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

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

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


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

    1. Initial program 78.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-neg78.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-neg78.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*78.8%

        \[\leadsto \frac{\left(-b\right) + \sqrt{b \cdot b - \color{blue}{3 \cdot \left(a \cdot c\right)}}}{3 \cdot a} \]
    3. Simplified78.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 73.6%

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

    if -1.1800000000000001e-243 < b

    1. Initial program 54.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-neg54.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-neg54.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*55.1%

        \[\leadsto \frac{\left(-b\right) + \sqrt{b \cdot b - \color{blue}{3 \cdot \left(a \cdot c\right)}}}{3 \cdot a} \]
    3. Simplified55.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. Taylor expanded in b around -inf 3.6%

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

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

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

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

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

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

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

        \[\leadsto \frac{\sqrt{\color{blue}{b \cdot b}}}{3 \cdot a} - \frac{b}{3 \cdot a} \]
      6. sqrt-unprod29.6%

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

        \[\leadsto \frac{\color{blue}{b}}{3 \cdot a} - \frac{b}{3 \cdot a} \]
      8. *-commutative47.8%

        \[\leadsto \frac{b}{\color{blue}{a \cdot 3}} - \frac{b}{3 \cdot a} \]
      9. *-commutative47.8%

        \[\leadsto \frac{b}{a \cdot 3} - \frac{b}{\color{blue}{a \cdot 3}} \]
    9. Applied egg-rr47.8%

      \[\leadsto \color{blue}{\frac{b}{a \cdot 3} - \frac{b}{a \cdot 3}} \]
    10. Step-by-step derivation
      1. +-inverses65.3%

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

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

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

Alternative 12: 66.4% accurate, 9.7× speedup?

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

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

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


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

    1. Initial program 78.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-neg78.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-neg78.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*78.5%

        \[\leadsto \frac{\left(-b\right) + \sqrt{b \cdot b - \color{blue}{3 \cdot \left(a \cdot c\right)}}}{3 \cdot a} \]
    3. Simplified78.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. Taylor expanded in b around -inf 69.9%

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

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

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

        \[\leadsto \color{blue}{\frac{1}{\frac{3 \cdot a}{\left(-b\right) + \left(-b\right)}}} \]
      2. inv-pow69.8%

        \[\leadsto \color{blue}{{\left(\frac{3 \cdot a}{\left(-b\right) + \left(-b\right)}\right)}^{-1}} \]
      3. count-269.8%

        \[\leadsto {\left(\frac{3 \cdot a}{\color{blue}{2 \cdot \left(-b\right)}}\right)}^{-1} \]
      4. times-frac70.0%

        \[\leadsto {\color{blue}{\left(\frac{3}{2} \cdot \frac{a}{-b}\right)}}^{-1} \]
      5. metadata-eval70.0%

        \[\leadsto {\left(\color{blue}{1.5} \cdot \frac{a}{-b}\right)}^{-1} \]
      6. add-sqr-sqrt69.7%

        \[\leadsto {\left(1.5 \cdot \frac{a}{\color{blue}{\sqrt{-b} \cdot \sqrt{-b}}}\right)}^{-1} \]
      7. sqrt-unprod55.8%

        \[\leadsto {\left(1.5 \cdot \frac{a}{\color{blue}{\sqrt{\left(-b\right) \cdot \left(-b\right)}}}\right)}^{-1} \]
      8. sqr-neg55.8%

        \[\leadsto {\left(1.5 \cdot \frac{a}{\sqrt{\color{blue}{b \cdot b}}}\right)}^{-1} \]
      9. sqrt-unprod0.0%

        \[\leadsto {\left(1.5 \cdot \frac{a}{\color{blue}{\sqrt{b} \cdot \sqrt{b}}}\right)}^{-1} \]
      10. add-sqr-sqrt1.5%

        \[\leadsto {\left(1.5 \cdot \frac{a}{\color{blue}{b}}\right)}^{-1} \]
    9. Applied egg-rr1.5%

      \[\leadsto \color{blue}{{\left(1.5 \cdot \frac{a}{b}\right)}^{-1}} \]
    10. Step-by-step derivation
      1. unpow-11.5%

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

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

        \[\leadsto \frac{1}{\color{blue}{\frac{1.5 \cdot a}{b}}} \]
      2. add-sqr-sqrt0.0%

        \[\leadsto \frac{1}{\frac{1.5 \cdot a}{\color{blue}{\sqrt{b} \cdot \sqrt{b}}}} \]
      3. sqrt-unprod55.7%

        \[\leadsto \frac{1}{\frac{1.5 \cdot a}{\color{blue}{\sqrt{b \cdot b}}}} \]
      4. sqr-neg55.7%

        \[\leadsto \frac{1}{\frac{1.5 \cdot a}{\sqrt{\color{blue}{\left(-b\right) \cdot \left(-b\right)}}}} \]
      5. sqrt-unprod69.7%

        \[\leadsto \frac{1}{\frac{1.5 \cdot a}{\color{blue}{\sqrt{-b} \cdot \sqrt{-b}}}} \]
      6. add-sqr-sqrt69.8%

        \[\leadsto \frac{1}{\frac{1.5 \cdot a}{\color{blue}{-b}}} \]
      7. distribute-neg-frac269.8%

        \[\leadsto \frac{1}{\color{blue}{-\frac{1.5 \cdot a}{b}}} \]
      8. associate-*r/70.0%

        \[\leadsto \frac{1}{-\color{blue}{1.5 \cdot \frac{a}{b}}} \]
      9. neg-sub062.6%

        \[\leadsto \frac{1}{\color{blue}{0 - 1.5 \cdot \frac{a}{b}}} \]
    13. Applied egg-rr62.6%

      \[\leadsto \frac{1}{\color{blue}{0 - 1.5 \cdot \frac{a}{b}}} \]
    14. Step-by-step derivation
      1. neg-sub070.0%

        \[\leadsto \frac{1}{\color{blue}{-1.5 \cdot \frac{a}{b}}} \]
      2. *-commutative70.0%

        \[\leadsto \frac{1}{-\color{blue}{\frac{a}{b} \cdot 1.5}} \]
      3. distribute-rgt-neg-in70.0%

        \[\leadsto \frac{1}{\color{blue}{\frac{a}{b} \cdot \left(-1.5\right)}} \]
      4. metadata-eval70.0%

        \[\leadsto \frac{1}{\frac{a}{b} \cdot \color{blue}{-1.5}} \]
    15. Simplified70.0%

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

    if -9.999999999999969e-311 < b

    1. Initial program 53.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-neg53.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-neg53.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*54.0%

        \[\leadsto \frac{\left(-b\right) + \sqrt{b \cdot b - \color{blue}{3 \cdot \left(a \cdot c\right)}}}{3 \cdot a} \]
    3. Simplified54.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 3.5%

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

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

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

        \[\leadsto \frac{\color{blue}{\left(-b\right) - b}}{3 \cdot a} \]
      2. div-sub3.5%

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

        \[\leadsto \frac{\color{blue}{\sqrt{-b} \cdot \sqrt{-b}}}{3 \cdot a} - \frac{b}{3 \cdot a} \]
      4. sqrt-unprod26.7%

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

        \[\leadsto \frac{\sqrt{\color{blue}{b \cdot b}}}{3 \cdot a} - \frac{b}{3 \cdot a} \]
      6. sqrt-unprod31.6%

        \[\leadsto \frac{\color{blue}{\sqrt{b} \cdot \sqrt{b}}}{3 \cdot a} - \frac{b}{3 \cdot a} \]
      7. add-sqr-sqrt50.7%

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

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

        \[\leadsto \frac{b}{a \cdot 3} - \frac{b}{\color{blue}{a \cdot 3}} \]
    9. Applied egg-rr50.7%

      \[\leadsto \color{blue}{\frac{b}{a \cdot 3} - \frac{b}{a \cdot 3}} \]
    10. Step-by-step derivation
      1. +-inverses69.4%

        \[\leadsto \color{blue}{0} \]
    11. Simplified69.4%

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

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

Alternative 13: 66.4% accurate, 11.6× speedup?

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

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

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


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

    1. Initial program 79.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-neg79.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-neg79.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*79.5%

        \[\leadsto \frac{\left(-b\right) + \sqrt{b \cdot b - \color{blue}{3 \cdot \left(a \cdot c\right)}}}{3 \cdot a} \]
    3. Simplified79.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. Taylor expanded in b around -inf 70.7%

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

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

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

    if -1.95000000000000014e-298 < b

    1. Initial program 52.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-neg52.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-neg52.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*53.1%

        \[\leadsto \frac{\left(-b\right) + \sqrt{b \cdot b - \color{blue}{3 \cdot \left(a \cdot c\right)}}}{3 \cdot a} \]
    3. Simplified53.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. Taylor expanded in b around -inf 3.5%

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

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

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

        \[\leadsto \frac{\color{blue}{\left(-b\right) - b}}{3 \cdot a} \]
      2. div-sub3.5%

        \[\leadsto \color{blue}{\frac{-b}{3 \cdot a} - \frac{b}{3 \cdot a}} \]
      3. add-sqr-sqrt0.1%

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

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

        \[\leadsto \frac{\sqrt{\color{blue}{b \cdot b}}}{3 \cdot a} - \frac{b}{3 \cdot a} \]
      6. sqrt-unprod31.0%

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

        \[\leadsto \frac{\color{blue}{b}}{3 \cdot a} - \frac{b}{3 \cdot a} \]
      8. *-commutative49.8%

        \[\leadsto \frac{b}{\color{blue}{a \cdot 3}} - \frac{b}{3 \cdot a} \]
      9. *-commutative49.8%

        \[\leadsto \frac{b}{a \cdot 3} - \frac{b}{\color{blue}{a \cdot 3}} \]
    9. Applied egg-rr49.8%

      \[\leadsto \color{blue}{\frac{b}{a \cdot 3} - \frac{b}{a \cdot 3}} \]
    10. Step-by-step derivation
      1. +-inverses68.1%

        \[\leadsto \color{blue}{0} \]
    11. Simplified68.1%

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

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

Alternative 14: 66.4% accurate, 11.6× speedup?

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

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

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


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

    1. Initial program 79.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-neg79.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-neg79.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*79.5%

        \[\leadsto \frac{\left(-b\right) + \sqrt{b \cdot b - \color{blue}{3 \cdot \left(a \cdot c\right)}}}{3 \cdot a} \]
    3. Simplified79.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-rr68.8%

      \[\leadsto \color{blue}{\frac{b - \mathsf{hypot}\left(b, \sqrt{a \cdot \left(c \cdot -3\right)}\right)}{-3} \cdot \frac{1}{a}} \]
    6. Step-by-step derivation
      1. associate-*l/68.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}} \]
      2. un-div-inv68.7%

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

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

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

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

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

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

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

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

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

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

    if -1.95000000000000014e-298 < b

    1. Initial program 52.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-neg52.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-neg52.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*53.1%

        \[\leadsto \frac{\left(-b\right) + \sqrt{b \cdot b - \color{blue}{3 \cdot \left(a \cdot c\right)}}}{3 \cdot a} \]
    3. Simplified53.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. Taylor expanded in b around -inf 3.5%

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

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

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

        \[\leadsto \frac{\color{blue}{\left(-b\right) - b}}{3 \cdot a} \]
      2. div-sub3.5%

        \[\leadsto \color{blue}{\frac{-b}{3 \cdot a} - \frac{b}{3 \cdot a}} \]
      3. add-sqr-sqrt0.1%

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

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

        \[\leadsto \frac{\sqrt{\color{blue}{b \cdot b}}}{3 \cdot a} - \frac{b}{3 \cdot a} \]
      6. sqrt-unprod31.0%

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

        \[\leadsto \frac{\color{blue}{b}}{3 \cdot a} - \frac{b}{3 \cdot a} \]
      8. *-commutative49.8%

        \[\leadsto \frac{b}{\color{blue}{a \cdot 3}} - \frac{b}{3 \cdot a} \]
      9. *-commutative49.8%

        \[\leadsto \frac{b}{a \cdot 3} - \frac{b}{\color{blue}{a \cdot 3}} \]
    9. Applied egg-rr49.8%

      \[\leadsto \color{blue}{\frac{b}{a \cdot 3} - \frac{b}{a \cdot 3}} \]
    10. Step-by-step derivation
      1. +-inverses68.1%

        \[\leadsto \color{blue}{0} \]
    11. Simplified68.1%

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

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

Alternative 15: 33.8% 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 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*68.3%

      \[\leadsto \frac{\left(-b\right) + \sqrt{b \cdot b - \color{blue}{3 \cdot \left(a \cdot c\right)}}}{3 \cdot a} \]
  3. Simplified68.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 42.2%

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

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

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

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

      \[\leadsto \color{blue}{\frac{-b}{3 \cdot a} - \frac{b}{3 \cdot a}} \]
    3. add-sqr-sqrt40.6%

      \[\leadsto \frac{\color{blue}{\sqrt{-b} \cdot \sqrt{-b}}}{3 \cdot a} - \frac{b}{3 \cdot a} \]
    4. sqrt-unprod43.7%

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

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

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

      \[\leadsto \frac{\color{blue}{b}}{3 \cdot a} - \frac{b}{3 \cdot a} \]
    8. *-commutative22.6%

      \[\leadsto \frac{b}{\color{blue}{a \cdot 3}} - \frac{b}{3 \cdot a} \]
    9. *-commutative22.6%

      \[\leadsto \frac{b}{a \cdot 3} - \frac{b}{\color{blue}{a \cdot 3}} \]
  9. Applied egg-rr22.6%

    \[\leadsto \color{blue}{\frac{b}{a \cdot 3} - \frac{b}{a \cdot 3}} \]
  10. Step-by-step derivation
    1. +-inverses30.7%

      \[\leadsto \color{blue}{0} \]
  11. Simplified30.7%

    \[\leadsto \color{blue}{0} \]
  12. Final simplification30.7%

    \[\leadsto 0 \]
  13. Add Preprocessing

Reproduce

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