Cubic critical

Percentage Accurate: 52.8% → 84.3%
Time: 17.6s
Alternatives: 13
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 13 alternatives:

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

Initial Program: 52.8% 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: 84.3% accurate, 0.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{c}{b} \cdot -0.5\\ \mathbf{if}\;b \leq -5.2 \cdot 10^{+65}:\\ \;\;\;\;\frac{\frac{b \cdot 2}{-3}}{a}\\ \mathbf{elif}\;b \leq 1.65 \cdot 10^{-85}:\\ \;\;\;\;\frac{\sqrt{b \cdot b - \left(a \cdot 3\right) \cdot c} - b}{a \cdot 3}\\ \mathbf{elif}\;b \leq 9 \cdot 10^{-24}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;b \leq 0.00014:\\ \;\;\;\;\frac{1}{a} \cdot \frac{b - \sqrt{-3 \cdot \left(a \cdot c\right)}}{-3}\\ \mathbf{elif}\;b \leq 6.2 \cdot 10^{+15}:\\ \;\;\;\;\frac{\frac{\mathsf{fma}\left(-1.6875, \frac{{\left(a \cdot c\right)}^{3}}{{b}^{4}}, \mathsf{fma}\left(-1.125, \frac{{\left(a \cdot c\right)}^{2}}{{b}^{2}}, a \cdot \left(c \cdot -1.5\right)\right)\right)}{b}}{a \cdot 3}\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
(FPCore (a b c)
 :precision binary64
 (let* ((t_0 (* (/ c b) -0.5)))
   (if (<= b -5.2e+65)
     (/ (/ (* b 2.0) -3.0) a)
     (if (<= b 1.65e-85)
       (/ (- (sqrt (- (* b b) (* (* a 3.0) c))) b) (* a 3.0))
       (if (<= b 9e-24)
         t_0
         (if (<= b 0.00014)
           (* (/ 1.0 a) (/ (- b (sqrt (* -3.0 (* a c)))) -3.0))
           (if (<= b 6.2e+15)
             (/
              (/
               (fma
                -1.6875
                (/ (pow (* a c) 3.0) (pow b 4.0))
                (fma
                 -1.125
                 (/ (pow (* a c) 2.0) (pow b 2.0))
                 (* a (* c -1.5))))
               b)
              (* a 3.0))
             t_0)))))))
double code(double a, double b, double c) {
	double t_0 = (c / b) * -0.5;
	double tmp;
	if (b <= -5.2e+65) {
		tmp = ((b * 2.0) / -3.0) / a;
	} else if (b <= 1.65e-85) {
		tmp = (sqrt(((b * b) - ((a * 3.0) * c))) - b) / (a * 3.0);
	} else if (b <= 9e-24) {
		tmp = t_0;
	} else if (b <= 0.00014) {
		tmp = (1.0 / a) * ((b - sqrt((-3.0 * (a * c)))) / -3.0);
	} else if (b <= 6.2e+15) {
		tmp = (fma(-1.6875, (pow((a * c), 3.0) / pow(b, 4.0)), fma(-1.125, (pow((a * c), 2.0) / pow(b, 2.0)), (a * (c * -1.5)))) / b) / (a * 3.0);
	} else {
		tmp = t_0;
	}
	return tmp;
}
function code(a, b, c)
	t_0 = Float64(Float64(c / b) * -0.5)
	tmp = 0.0
	if (b <= -5.2e+65)
		tmp = Float64(Float64(Float64(b * 2.0) / -3.0) / a);
	elseif (b <= 1.65e-85)
		tmp = Float64(Float64(sqrt(Float64(Float64(b * b) - Float64(Float64(a * 3.0) * c))) - b) / Float64(a * 3.0));
	elseif (b <= 9e-24)
		tmp = t_0;
	elseif (b <= 0.00014)
		tmp = Float64(Float64(1.0 / a) * Float64(Float64(b - sqrt(Float64(-3.0 * Float64(a * c)))) / -3.0));
	elseif (b <= 6.2e+15)
		tmp = Float64(Float64(fma(-1.6875, Float64((Float64(a * c) ^ 3.0) / (b ^ 4.0)), fma(-1.125, Float64((Float64(a * c) ^ 2.0) / (b ^ 2.0)), Float64(a * Float64(c * -1.5)))) / b) / Float64(a * 3.0));
	else
		tmp = t_0;
	end
	return tmp
end
code[a_, b_, c_] := Block[{t$95$0 = N[(N[(c / b), $MachinePrecision] * -0.5), $MachinePrecision]}, If[LessEqual[b, -5.2e+65], N[(N[(N[(b * 2.0), $MachinePrecision] / -3.0), $MachinePrecision] / a), $MachinePrecision], If[LessEqual[b, 1.65e-85], N[(N[(N[Sqrt[N[(N[(b * b), $MachinePrecision] - N[(N[(a * 3.0), $MachinePrecision] * c), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision] / N[(a * 3.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 9e-24], t$95$0, If[LessEqual[b, 0.00014], N[(N[(1.0 / a), $MachinePrecision] * N[(N[(b - N[Sqrt[N[(-3.0 * N[(a * c), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / -3.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 6.2e+15], N[(N[(N[(-1.6875 * N[(N[Power[N[(a * c), $MachinePrecision], 3.0], $MachinePrecision] / N[Power[b, 4.0], $MachinePrecision]), $MachinePrecision] + N[(-1.125 * N[(N[Power[N[(a * c), $MachinePrecision], 2.0], $MachinePrecision] / N[Power[b, 2.0], $MachinePrecision]), $MachinePrecision] + N[(a * N[(c * -1.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / b), $MachinePrecision] / N[(a * 3.0), $MachinePrecision]), $MachinePrecision], t$95$0]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \frac{c}{b} \cdot -0.5\\
\mathbf{if}\;b \leq -5.2 \cdot 10^{+65}:\\
\;\;\;\;\frac{\frac{b \cdot 2}{-3}}{a}\\

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

\mathbf{elif}\;b \leq 9 \cdot 10^{-24}:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;b \leq 0.00014:\\
\;\;\;\;\frac{1}{a} \cdot \frac{b - \sqrt{-3 \cdot \left(a \cdot c\right)}}{-3}\\

\mathbf{elif}\;b \leq 6.2 \cdot 10^{+15}:\\
\;\;\;\;\frac{\frac{\mathsf{fma}\left(-1.6875, \frac{{\left(a \cdot c\right)}^{3}}{{b}^{4}}, \mathsf{fma}\left(-1.125, \frac{{\left(a \cdot c\right)}^{2}}{{b}^{2}}, a \cdot \left(c \cdot -1.5\right)\right)\right)}{b}}{a \cdot 3}\\

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


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

    1. Initial program 56.0%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{b \cdot -0.6666666666666666}{a}} \]
    9. Applied egg-rr91.2%

      \[\leadsto \color{blue}{\frac{b \cdot -0.6666666666666666}{a}} \]
    10. Step-by-step derivation
      1. metadata-eval91.2%

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

        \[\leadsto \frac{\color{blue}{\frac{b \cdot 2}{-3}}}{a} \]
    11. Applied egg-rr91.3%

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

    if -5.20000000000000005e65 < b < 1.64999999999999986e-85

    1. Initial program 72.7%

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

    if 1.64999999999999986e-85 < b < 8.9999999999999995e-24 or 6.2e15 < b

    1. Initial program 11.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-neg11.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-neg11.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*11.1%

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

      \[\leadsto \color{blue}{-0.5 \cdot \frac{c}{b}} \]
    6. Step-by-step derivation
      1. *-commutative88.5%

        \[\leadsto \color{blue}{\frac{c}{b} \cdot -0.5} \]
    7. Simplified88.5%

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

    if 8.9999999999999995e-24 < b < 1.3999999999999999e-4

    1. Initial program 98.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-neg98.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-neg98.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*98.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto 1 \cdot \frac{b - \sqrt{\color{blue}{\left(-3 \cdot a\right) \cdot c}}}{-3 \cdot a} \]
      16. *-commutative98.8%

        \[\leadsto 1 \cdot \frac{b - \sqrt{\color{blue}{\left(a \cdot -3\right)} \cdot c}}{-3 \cdot a} \]
      17. *-commutative98.8%

        \[\leadsto 1 \cdot \frac{b - \sqrt{\color{blue}{c \cdot \left(a \cdot -3\right)}}}{-3 \cdot a} \]
      18. distribute-lft-neg-in98.8%

        \[\leadsto 1 \cdot \frac{b - \sqrt{c \cdot \left(a \cdot -3\right)}}{\color{blue}{\left(-3\right) \cdot a}} \]
      19. metadata-eval98.8%

        \[\leadsto 1 \cdot \frac{b - \sqrt{c \cdot \left(a \cdot -3\right)}}{\color{blue}{-3} \cdot a} \]
      20. *-commutative98.8%

        \[\leadsto 1 \cdot \frac{b - \sqrt{c \cdot \left(a \cdot -3\right)}}{\color{blue}{a \cdot -3}} \]
    7. Applied egg-rr98.8%

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

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

      \[\leadsto \color{blue}{\frac{b - \sqrt{c \cdot \left(a \cdot -3\right)}}{a \cdot -3}} \]
    10. Step-by-step derivation
      1. *-un-lft-identity98.8%

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

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

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

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

        \[\leadsto \frac{1}{a} \cdot \frac{b - \sqrt{\color{blue}{-3 \cdot \left(a \cdot c\right)}}}{-3} \]
    11. Applied egg-rr100.0%

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

    if 1.3999999999999999e-4 < b < 6.2e15

    1. Initial program 28.7%

      \[\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-neg28.7%

        \[\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-neg28.7%

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

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

      \[\leadsto \frac{\color{blue}{\frac{-1.6875 \cdot \frac{{a}^{3} \cdot {c}^{3}}{{b}^{4}} + \left(-1.5 \cdot \left(a \cdot c\right) + -1.125 \cdot \frac{{a}^{2} \cdot {c}^{2}}{{b}^{2}}\right)}{b}}}{3 \cdot a} \]
    6. Step-by-step derivation
      1. fma-define56.7%

        \[\leadsto \frac{\frac{\color{blue}{\mathsf{fma}\left(-1.6875, \frac{{a}^{3} \cdot {c}^{3}}{{b}^{4}}, -1.5 \cdot \left(a \cdot c\right) + -1.125 \cdot \frac{{a}^{2} \cdot {c}^{2}}{{b}^{2}}\right)}}{b}}{3 \cdot a} \]
      2. cube-prod56.7%

        \[\leadsto \frac{\frac{\mathsf{fma}\left(-1.6875, \frac{\color{blue}{{\left(a \cdot c\right)}^{3}}}{{b}^{4}}, -1.5 \cdot \left(a \cdot c\right) + -1.125 \cdot \frac{{a}^{2} \cdot {c}^{2}}{{b}^{2}}\right)}{b}}{3 \cdot a} \]
      3. +-commutative56.7%

        \[\leadsto \frac{\frac{\mathsf{fma}\left(-1.6875, \frac{{\left(a \cdot c\right)}^{3}}{{b}^{4}}, \color{blue}{-1.125 \cdot \frac{{a}^{2} \cdot {c}^{2}}{{b}^{2}} + -1.5 \cdot \left(a \cdot c\right)}\right)}{b}}{3 \cdot a} \]
      4. fma-define56.7%

        \[\leadsto \frac{\frac{\mathsf{fma}\left(-1.6875, \frac{{\left(a \cdot c\right)}^{3}}{{b}^{4}}, \color{blue}{\mathsf{fma}\left(-1.125, \frac{{a}^{2} \cdot {c}^{2}}{{b}^{2}}, -1.5 \cdot \left(a \cdot c\right)\right)}\right)}{b}}{3 \cdot a} \]
      5. unpow256.7%

        \[\leadsto \frac{\frac{\mathsf{fma}\left(-1.6875, \frac{{\left(a \cdot c\right)}^{3}}{{b}^{4}}, \mathsf{fma}\left(-1.125, \frac{\color{blue}{\left(a \cdot a\right)} \cdot {c}^{2}}{{b}^{2}}, -1.5 \cdot \left(a \cdot c\right)\right)\right)}{b}}{3 \cdot a} \]
      6. unpow256.7%

        \[\leadsto \frac{\frac{\mathsf{fma}\left(-1.6875, \frac{{\left(a \cdot c\right)}^{3}}{{b}^{4}}, \mathsf{fma}\left(-1.125, \frac{\left(a \cdot a\right) \cdot \color{blue}{\left(c \cdot c\right)}}{{b}^{2}}, -1.5 \cdot \left(a \cdot c\right)\right)\right)}{b}}{3 \cdot a} \]
      7. swap-sqr85.3%

        \[\leadsto \frac{\frac{\mathsf{fma}\left(-1.6875, \frac{{\left(a \cdot c\right)}^{3}}{{b}^{4}}, \mathsf{fma}\left(-1.125, \frac{\color{blue}{\left(a \cdot c\right) \cdot \left(a \cdot c\right)}}{{b}^{2}}, -1.5 \cdot \left(a \cdot c\right)\right)\right)}{b}}{3 \cdot a} \]
      8. unpow285.3%

        \[\leadsto \frac{\frac{\mathsf{fma}\left(-1.6875, \frac{{\left(a \cdot c\right)}^{3}}{{b}^{4}}, \mathsf{fma}\left(-1.125, \frac{\color{blue}{{\left(a \cdot c\right)}^{2}}}{{b}^{2}}, -1.5 \cdot \left(a \cdot c\right)\right)\right)}{b}}{3 \cdot a} \]
      9. *-commutative85.3%

        \[\leadsto \frac{\frac{\mathsf{fma}\left(-1.6875, \frac{{\left(a \cdot c\right)}^{3}}{{b}^{4}}, \mathsf{fma}\left(-1.125, \frac{{\left(a \cdot c\right)}^{2}}{{b}^{2}}, -1.5 \cdot \color{blue}{\left(c \cdot a\right)}\right)\right)}{b}}{3 \cdot a} \]
      10. associate-*r*85.3%

        \[\leadsto \frac{\frac{\mathsf{fma}\left(-1.6875, \frac{{\left(a \cdot c\right)}^{3}}{{b}^{4}}, \mathsf{fma}\left(-1.125, \frac{{\left(a \cdot c\right)}^{2}}{{b}^{2}}, \color{blue}{\left(-1.5 \cdot c\right) \cdot a}\right)\right)}{b}}{3 \cdot a} \]
    7. Simplified85.3%

      \[\leadsto \frac{\color{blue}{\frac{\mathsf{fma}\left(-1.6875, \frac{{\left(a \cdot c\right)}^{3}}{{b}^{4}}, \mathsf{fma}\left(-1.125, \frac{{\left(a \cdot c\right)}^{2}}{{b}^{2}}, \left(-1.5 \cdot c\right) \cdot a\right)\right)}{b}}}{3 \cdot a} \]
  3. Recombined 5 regimes into one program.
  4. Final simplification83.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -5.2 \cdot 10^{+65}:\\ \;\;\;\;\frac{\frac{b \cdot 2}{-3}}{a}\\ \mathbf{elif}\;b \leq 1.65 \cdot 10^{-85}:\\ \;\;\;\;\frac{\sqrt{b \cdot b - \left(a \cdot 3\right) \cdot c} - b}{a \cdot 3}\\ \mathbf{elif}\;b \leq 9 \cdot 10^{-24}:\\ \;\;\;\;\frac{c}{b} \cdot -0.5\\ \mathbf{elif}\;b \leq 0.00014:\\ \;\;\;\;\frac{1}{a} \cdot \frac{b - \sqrt{-3 \cdot \left(a \cdot c\right)}}{-3}\\ \mathbf{elif}\;b \leq 6.2 \cdot 10^{+15}:\\ \;\;\;\;\frac{\frac{\mathsf{fma}\left(-1.6875, \frac{{\left(a \cdot c\right)}^{3}}{{b}^{4}}, \mathsf{fma}\left(-1.125, \frac{{\left(a \cdot c\right)}^{2}}{{b}^{2}}, a \cdot \left(c \cdot -1.5\right)\right)\right)}{b}}{a \cdot 3}\\ \mathbf{else}:\\ \;\;\;\;\frac{c}{b} \cdot -0.5\\ \end{array} \]
  5. Add Preprocessing

Alternative 2: 78.8% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{c}{b} \cdot -0.5\\ \mathbf{if}\;b \leq -160000000:\\ \;\;\;\;\frac{\frac{b \cdot 2}{-3}}{a}\\ \mathbf{elif}\;b \leq 3.3 \cdot 10^{-83}:\\ \;\;\;\;\frac{b - \sqrt{c \cdot \left(-3 \cdot a\right)}}{-3 \cdot a}\\ \mathbf{elif}\;b \leq 3.3 \cdot 10^{-30}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;b \leq 8.2 \cdot 10^{-5}:\\ \;\;\;\;\frac{1}{a} \cdot \frac{b - \sqrt{-3 \cdot \left(a \cdot c\right)}}{-3}\\ \mathbf{elif}\;b \leq 6500:\\ \;\;\;\;c \cdot \left(-0.375 \cdot \frac{a \cdot c}{{b}^{3}} + 0.5 \cdot \frac{-1}{b}\right)\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
(FPCore (a b c)
 :precision binary64
 (let* ((t_0 (* (/ c b) -0.5)))
   (if (<= b -160000000.0)
     (/ (/ (* b 2.0) -3.0) a)
     (if (<= b 3.3e-83)
       (/ (- b (sqrt (* c (* -3.0 a)))) (* -3.0 a))
       (if (<= b 3.3e-30)
         t_0
         (if (<= b 8.2e-5)
           (* (/ 1.0 a) (/ (- b (sqrt (* -3.0 (* a c)))) -3.0))
           (if (<= b 6500.0)
             (* c (+ (* -0.375 (/ (* a c) (pow b 3.0))) (* 0.5 (/ -1.0 b))))
             t_0)))))))
double code(double a, double b, double c) {
	double t_0 = (c / b) * -0.5;
	double tmp;
	if (b <= -160000000.0) {
		tmp = ((b * 2.0) / -3.0) / a;
	} else if (b <= 3.3e-83) {
		tmp = (b - sqrt((c * (-3.0 * a)))) / (-3.0 * a);
	} else if (b <= 3.3e-30) {
		tmp = t_0;
	} else if (b <= 8.2e-5) {
		tmp = (1.0 / a) * ((b - sqrt((-3.0 * (a * c)))) / -3.0);
	} else if (b <= 6500.0) {
		tmp = c * ((-0.375 * ((a * c) / pow(b, 3.0))) + (0.5 * (-1.0 / b)));
	} else {
		tmp = t_0;
	}
	return tmp;
}
real(8) function code(a, b, c)
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8) :: t_0
    real(8) :: tmp
    t_0 = (c / b) * (-0.5d0)
    if (b <= (-160000000.0d0)) then
        tmp = ((b * 2.0d0) / (-3.0d0)) / a
    else if (b <= 3.3d-83) then
        tmp = (b - sqrt((c * ((-3.0d0) * a)))) / ((-3.0d0) * a)
    else if (b <= 3.3d-30) then
        tmp = t_0
    else if (b <= 8.2d-5) then
        tmp = (1.0d0 / a) * ((b - sqrt(((-3.0d0) * (a * c)))) / (-3.0d0))
    else if (b <= 6500.0d0) then
        tmp = c * (((-0.375d0) * ((a * c) / (b ** 3.0d0))) + (0.5d0 * ((-1.0d0) / b)))
    else
        tmp = t_0
    end if
    code = tmp
end function
public static double code(double a, double b, double c) {
	double t_0 = (c / b) * -0.5;
	double tmp;
	if (b <= -160000000.0) {
		tmp = ((b * 2.0) / -3.0) / a;
	} else if (b <= 3.3e-83) {
		tmp = (b - Math.sqrt((c * (-3.0 * a)))) / (-3.0 * a);
	} else if (b <= 3.3e-30) {
		tmp = t_0;
	} else if (b <= 8.2e-5) {
		tmp = (1.0 / a) * ((b - Math.sqrt((-3.0 * (a * c)))) / -3.0);
	} else if (b <= 6500.0) {
		tmp = c * ((-0.375 * ((a * c) / Math.pow(b, 3.0))) + (0.5 * (-1.0 / b)));
	} else {
		tmp = t_0;
	}
	return tmp;
}
def code(a, b, c):
	t_0 = (c / b) * -0.5
	tmp = 0
	if b <= -160000000.0:
		tmp = ((b * 2.0) / -3.0) / a
	elif b <= 3.3e-83:
		tmp = (b - math.sqrt((c * (-3.0 * a)))) / (-3.0 * a)
	elif b <= 3.3e-30:
		tmp = t_0
	elif b <= 8.2e-5:
		tmp = (1.0 / a) * ((b - math.sqrt((-3.0 * (a * c)))) / -3.0)
	elif b <= 6500.0:
		tmp = c * ((-0.375 * ((a * c) / math.pow(b, 3.0))) + (0.5 * (-1.0 / b)))
	else:
		tmp = t_0
	return tmp
function code(a, b, c)
	t_0 = Float64(Float64(c / b) * -0.5)
	tmp = 0.0
	if (b <= -160000000.0)
		tmp = Float64(Float64(Float64(b * 2.0) / -3.0) / a);
	elseif (b <= 3.3e-83)
		tmp = Float64(Float64(b - sqrt(Float64(c * Float64(-3.0 * a)))) / Float64(-3.0 * a));
	elseif (b <= 3.3e-30)
		tmp = t_0;
	elseif (b <= 8.2e-5)
		tmp = Float64(Float64(1.0 / a) * Float64(Float64(b - sqrt(Float64(-3.0 * Float64(a * c)))) / -3.0));
	elseif (b <= 6500.0)
		tmp = Float64(c * Float64(Float64(-0.375 * Float64(Float64(a * c) / (b ^ 3.0))) + Float64(0.5 * Float64(-1.0 / b))));
	else
		tmp = t_0;
	end
	return tmp
end
function tmp_2 = code(a, b, c)
	t_0 = (c / b) * -0.5;
	tmp = 0.0;
	if (b <= -160000000.0)
		tmp = ((b * 2.0) / -3.0) / a;
	elseif (b <= 3.3e-83)
		tmp = (b - sqrt((c * (-3.0 * a)))) / (-3.0 * a);
	elseif (b <= 3.3e-30)
		tmp = t_0;
	elseif (b <= 8.2e-5)
		tmp = (1.0 / a) * ((b - sqrt((-3.0 * (a * c)))) / -3.0);
	elseif (b <= 6500.0)
		tmp = c * ((-0.375 * ((a * c) / (b ^ 3.0))) + (0.5 * (-1.0 / b)));
	else
		tmp = t_0;
	end
	tmp_2 = tmp;
end
code[a_, b_, c_] := Block[{t$95$0 = N[(N[(c / b), $MachinePrecision] * -0.5), $MachinePrecision]}, If[LessEqual[b, -160000000.0], N[(N[(N[(b * 2.0), $MachinePrecision] / -3.0), $MachinePrecision] / a), $MachinePrecision], If[LessEqual[b, 3.3e-83], N[(N[(b - N[Sqrt[N[(c * N[(-3.0 * a), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[(-3.0 * a), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 3.3e-30], t$95$0, If[LessEqual[b, 8.2e-5], N[(N[(1.0 / a), $MachinePrecision] * N[(N[(b - N[Sqrt[N[(-3.0 * N[(a * c), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / -3.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 6500.0], N[(c * N[(N[(-0.375 * N[(N[(a * c), $MachinePrecision] / N[Power[b, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(0.5 * N[(-1.0 / b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \frac{c}{b} \cdot -0.5\\
\mathbf{if}\;b \leq -160000000:\\
\;\;\;\;\frac{\frac{b \cdot 2}{-3}}{a}\\

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

\mathbf{elif}\;b \leq 3.3 \cdot 10^{-30}:\\
\;\;\;\;t\_0\\

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

\mathbf{elif}\;b \leq 6500:\\
\;\;\;\;c \cdot \left(-0.375 \cdot \frac{a \cdot c}{{b}^{3}} + 0.5 \cdot \frac{-1}{b}\right)\\

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


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

    1. Initial program 59.0%

      \[\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-neg59.0%

        \[\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-neg59.0%

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{b \cdot -0.6666666666666666}{a}} \]
    10. Step-by-step derivation
      1. metadata-eval89.8%

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

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

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

    if -1.6e8 < b < 3.2999999999999999e-83

    1. Initial program 71.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto 1 \cdot \frac{b - \sqrt{\color{blue}{\left(-3 \cdot a\right) \cdot c}}}{-3 \cdot a} \]
      16. *-commutative64.8%

        \[\leadsto 1 \cdot \frac{b - \sqrt{\color{blue}{\left(a \cdot -3\right)} \cdot c}}{-3 \cdot a} \]
      17. *-commutative64.8%

        \[\leadsto 1 \cdot \frac{b - \sqrt{\color{blue}{c \cdot \left(a \cdot -3\right)}}}{-3 \cdot a} \]
      18. distribute-lft-neg-in64.8%

        \[\leadsto 1 \cdot \frac{b - \sqrt{c \cdot \left(a \cdot -3\right)}}{\color{blue}{\left(-3\right) \cdot a}} \]
      19. metadata-eval64.8%

        \[\leadsto 1 \cdot \frac{b - \sqrt{c \cdot \left(a \cdot -3\right)}}{\color{blue}{-3} \cdot a} \]
      20. *-commutative64.8%

        \[\leadsto 1 \cdot \frac{b - \sqrt{c \cdot \left(a \cdot -3\right)}}{\color{blue}{a \cdot -3}} \]
    7. Applied egg-rr64.8%

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

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

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

    if 3.2999999999999999e-83 < b < 3.3000000000000003e-30 or 6500 < b

    1. Initial program 12.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-neg12.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-neg12.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*12.1%

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

      \[\leadsto \color{blue}{-0.5 \cdot \frac{c}{b}} \]
    6. Step-by-step derivation
      1. *-commutative87.7%

        \[\leadsto \color{blue}{\frac{c}{b} \cdot -0.5} \]
    7. Simplified87.7%

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

    if 3.3000000000000003e-30 < b < 8.20000000000000009e-5

    1. Initial program 98.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-neg98.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-neg98.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*98.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto 1 \cdot \frac{b - \sqrt{\color{blue}{\left(-3 \cdot a\right) \cdot c}}}{-3 \cdot a} \]
      16. *-commutative98.8%

        \[\leadsto 1 \cdot \frac{b - \sqrt{\color{blue}{\left(a \cdot -3\right)} \cdot c}}{-3 \cdot a} \]
      17. *-commutative98.8%

        \[\leadsto 1 \cdot \frac{b - \sqrt{\color{blue}{c \cdot \left(a \cdot -3\right)}}}{-3 \cdot a} \]
      18. distribute-lft-neg-in98.8%

        \[\leadsto 1 \cdot \frac{b - \sqrt{c \cdot \left(a \cdot -3\right)}}{\color{blue}{\left(-3\right) \cdot a}} \]
      19. metadata-eval98.8%

        \[\leadsto 1 \cdot \frac{b - \sqrt{c \cdot \left(a \cdot -3\right)}}{\color{blue}{-3} \cdot a} \]
      20. *-commutative98.8%

        \[\leadsto 1 \cdot \frac{b - \sqrt{c \cdot \left(a \cdot -3\right)}}{\color{blue}{a \cdot -3}} \]
    7. Applied egg-rr98.8%

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

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

      \[\leadsto \color{blue}{\frac{b - \sqrt{c \cdot \left(a \cdot -3\right)}}{a \cdot -3}} \]
    10. Step-by-step derivation
      1. *-un-lft-identity98.8%

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

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

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

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

        \[\leadsto \frac{1}{a} \cdot \frac{b - \sqrt{\color{blue}{-3 \cdot \left(a \cdot c\right)}}}{-3} \]
    11. Applied egg-rr100.0%

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

    if 8.20000000000000009e-5 < b < 6500

    1. Initial program 23.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-neg23.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-neg23.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*23.3%

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

      \[\leadsto \color{blue}{c \cdot \left(-0.375 \cdot \frac{a \cdot c}{{b}^{3}} - 0.5 \cdot \frac{1}{b}\right)} \]
  3. Recombined 5 regimes into one program.
  4. Final simplification81.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -160000000:\\ \;\;\;\;\frac{\frac{b \cdot 2}{-3}}{a}\\ \mathbf{elif}\;b \leq 3.3 \cdot 10^{-83}:\\ \;\;\;\;\frac{b - \sqrt{c \cdot \left(-3 \cdot a\right)}}{-3 \cdot a}\\ \mathbf{elif}\;b \leq 3.3 \cdot 10^{-30}:\\ \;\;\;\;\frac{c}{b} \cdot -0.5\\ \mathbf{elif}\;b \leq 8.2 \cdot 10^{-5}:\\ \;\;\;\;\frac{1}{a} \cdot \frac{b - \sqrt{-3 \cdot \left(a \cdot c\right)}}{-3}\\ \mathbf{elif}\;b \leq 6500:\\ \;\;\;\;c \cdot \left(-0.375 \cdot \frac{a \cdot c}{{b}^{3}} + 0.5 \cdot \frac{-1}{b}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{c}{b} \cdot -0.5\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 84.4% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{c}{b} \cdot -0.5\\ \mathbf{if}\;b \leq -5.2 \cdot 10^{+65}:\\ \;\;\;\;\frac{\frac{b \cdot 2}{-3}}{a}\\ \mathbf{elif}\;b \leq 1.28 \cdot 10^{-86}:\\ \;\;\;\;\frac{\sqrt{b \cdot b - 3 \cdot \left(a \cdot c\right)} - b}{a \cdot 3}\\ \mathbf{elif}\;b \leq 2.6 \cdot 10^{-24}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;b \leq 8.6 \cdot 10^{-5}:\\ \;\;\;\;\frac{1}{a} \cdot \frac{b - \sqrt{-3 \cdot \left(a \cdot c\right)}}{-3}\\ \mathbf{elif}\;b \leq 6.2 \cdot 10^{+15}:\\ \;\;\;\;c \cdot \left(-0.375 \cdot \frac{a \cdot c}{{b}^{3}} + 0.5 \cdot \frac{-1}{b}\right)\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
(FPCore (a b c)
 :precision binary64
 (let* ((t_0 (* (/ c b) -0.5)))
   (if (<= b -5.2e+65)
     (/ (/ (* b 2.0) -3.0) a)
     (if (<= b 1.28e-86)
       (/ (- (sqrt (- (* b b) (* 3.0 (* a c)))) b) (* a 3.0))
       (if (<= b 2.6e-24)
         t_0
         (if (<= b 8.6e-5)
           (* (/ 1.0 a) (/ (- b (sqrt (* -3.0 (* a c)))) -3.0))
           (if (<= b 6.2e+15)
             (* c (+ (* -0.375 (/ (* a c) (pow b 3.0))) (* 0.5 (/ -1.0 b))))
             t_0)))))))
double code(double a, double b, double c) {
	double t_0 = (c / b) * -0.5;
	double tmp;
	if (b <= -5.2e+65) {
		tmp = ((b * 2.0) / -3.0) / a;
	} else if (b <= 1.28e-86) {
		tmp = (sqrt(((b * b) - (3.0 * (a * c)))) - b) / (a * 3.0);
	} else if (b <= 2.6e-24) {
		tmp = t_0;
	} else if (b <= 8.6e-5) {
		tmp = (1.0 / a) * ((b - sqrt((-3.0 * (a * c)))) / -3.0);
	} else if (b <= 6.2e+15) {
		tmp = c * ((-0.375 * ((a * c) / pow(b, 3.0))) + (0.5 * (-1.0 / b)));
	} else {
		tmp = t_0;
	}
	return tmp;
}
real(8) function code(a, b, c)
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8) :: t_0
    real(8) :: tmp
    t_0 = (c / b) * (-0.5d0)
    if (b <= (-5.2d+65)) then
        tmp = ((b * 2.0d0) / (-3.0d0)) / a
    else if (b <= 1.28d-86) then
        tmp = (sqrt(((b * b) - (3.0d0 * (a * c)))) - b) / (a * 3.0d0)
    else if (b <= 2.6d-24) then
        tmp = t_0
    else if (b <= 8.6d-5) then
        tmp = (1.0d0 / a) * ((b - sqrt(((-3.0d0) * (a * c)))) / (-3.0d0))
    else if (b <= 6.2d+15) then
        tmp = c * (((-0.375d0) * ((a * c) / (b ** 3.0d0))) + (0.5d0 * ((-1.0d0) / b)))
    else
        tmp = t_0
    end if
    code = tmp
end function
public static double code(double a, double b, double c) {
	double t_0 = (c / b) * -0.5;
	double tmp;
	if (b <= -5.2e+65) {
		tmp = ((b * 2.0) / -3.0) / a;
	} else if (b <= 1.28e-86) {
		tmp = (Math.sqrt(((b * b) - (3.0 * (a * c)))) - b) / (a * 3.0);
	} else if (b <= 2.6e-24) {
		tmp = t_0;
	} else if (b <= 8.6e-5) {
		tmp = (1.0 / a) * ((b - Math.sqrt((-3.0 * (a * c)))) / -3.0);
	} else if (b <= 6.2e+15) {
		tmp = c * ((-0.375 * ((a * c) / Math.pow(b, 3.0))) + (0.5 * (-1.0 / b)));
	} else {
		tmp = t_0;
	}
	return tmp;
}
def code(a, b, c):
	t_0 = (c / b) * -0.5
	tmp = 0
	if b <= -5.2e+65:
		tmp = ((b * 2.0) / -3.0) / a
	elif b <= 1.28e-86:
		tmp = (math.sqrt(((b * b) - (3.0 * (a * c)))) - b) / (a * 3.0)
	elif b <= 2.6e-24:
		tmp = t_0
	elif b <= 8.6e-5:
		tmp = (1.0 / a) * ((b - math.sqrt((-3.0 * (a * c)))) / -3.0)
	elif b <= 6.2e+15:
		tmp = c * ((-0.375 * ((a * c) / math.pow(b, 3.0))) + (0.5 * (-1.0 / b)))
	else:
		tmp = t_0
	return tmp
function code(a, b, c)
	t_0 = Float64(Float64(c / b) * -0.5)
	tmp = 0.0
	if (b <= -5.2e+65)
		tmp = Float64(Float64(Float64(b * 2.0) / -3.0) / a);
	elseif (b <= 1.28e-86)
		tmp = Float64(Float64(sqrt(Float64(Float64(b * b) - Float64(3.0 * Float64(a * c)))) - b) / Float64(a * 3.0));
	elseif (b <= 2.6e-24)
		tmp = t_0;
	elseif (b <= 8.6e-5)
		tmp = Float64(Float64(1.0 / a) * Float64(Float64(b - sqrt(Float64(-3.0 * Float64(a * c)))) / -3.0));
	elseif (b <= 6.2e+15)
		tmp = Float64(c * Float64(Float64(-0.375 * Float64(Float64(a * c) / (b ^ 3.0))) + Float64(0.5 * Float64(-1.0 / b))));
	else
		tmp = t_0;
	end
	return tmp
end
function tmp_2 = code(a, b, c)
	t_0 = (c / b) * -0.5;
	tmp = 0.0;
	if (b <= -5.2e+65)
		tmp = ((b * 2.0) / -3.0) / a;
	elseif (b <= 1.28e-86)
		tmp = (sqrt(((b * b) - (3.0 * (a * c)))) - b) / (a * 3.0);
	elseif (b <= 2.6e-24)
		tmp = t_0;
	elseif (b <= 8.6e-5)
		tmp = (1.0 / a) * ((b - sqrt((-3.0 * (a * c)))) / -3.0);
	elseif (b <= 6.2e+15)
		tmp = c * ((-0.375 * ((a * c) / (b ^ 3.0))) + (0.5 * (-1.0 / b)));
	else
		tmp = t_0;
	end
	tmp_2 = tmp;
end
code[a_, b_, c_] := Block[{t$95$0 = N[(N[(c / b), $MachinePrecision] * -0.5), $MachinePrecision]}, If[LessEqual[b, -5.2e+65], N[(N[(N[(b * 2.0), $MachinePrecision] / -3.0), $MachinePrecision] / a), $MachinePrecision], If[LessEqual[b, 1.28e-86], 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], If[LessEqual[b, 2.6e-24], t$95$0, If[LessEqual[b, 8.6e-5], N[(N[(1.0 / a), $MachinePrecision] * N[(N[(b - N[Sqrt[N[(-3.0 * N[(a * c), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / -3.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 6.2e+15], N[(c * N[(N[(-0.375 * N[(N[(a * c), $MachinePrecision] / N[Power[b, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(0.5 * N[(-1.0 / b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \frac{c}{b} \cdot -0.5\\
\mathbf{if}\;b \leq -5.2 \cdot 10^{+65}:\\
\;\;\;\;\frac{\frac{b \cdot 2}{-3}}{a}\\

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

\mathbf{elif}\;b \leq 2.6 \cdot 10^{-24}:\\
\;\;\;\;t\_0\\

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

\mathbf{elif}\;b \leq 6.2 \cdot 10^{+15}:\\
\;\;\;\;c \cdot \left(-0.375 \cdot \frac{a \cdot c}{{b}^{3}} + 0.5 \cdot \frac{-1}{b}\right)\\

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


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

    1. Initial program 56.0%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{b \cdot -0.6666666666666666}{a}} \]
    9. Applied egg-rr91.2%

      \[\leadsto \color{blue}{\frac{b \cdot -0.6666666666666666}{a}} \]
    10. Step-by-step derivation
      1. metadata-eval91.2%

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

        \[\leadsto \frac{\color{blue}{\frac{b \cdot 2}{-3}}}{a} \]
    11. Applied egg-rr91.3%

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

    if -5.20000000000000005e65 < b < 1.27999999999999992e-86

    1. Initial program 72.7%

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

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

        \[\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.5%

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

    if 1.27999999999999992e-86 < b < 2.6e-24 or 6.2e15 < b

    1. Initial program 11.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-neg11.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-neg11.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*11.1%

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

      \[\leadsto \color{blue}{-0.5 \cdot \frac{c}{b}} \]
    6. Step-by-step derivation
      1. *-commutative88.5%

        \[\leadsto \color{blue}{\frac{c}{b} \cdot -0.5} \]
    7. Simplified88.5%

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

    if 2.6e-24 < b < 8.6000000000000003e-5

    1. Initial program 98.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-neg98.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-neg98.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*98.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto 1 \cdot \frac{b - \sqrt{\color{blue}{\left(-3 \cdot a\right) \cdot c}}}{-3 \cdot a} \]
      16. *-commutative98.8%

        \[\leadsto 1 \cdot \frac{b - \sqrt{\color{blue}{\left(a \cdot -3\right)} \cdot c}}{-3 \cdot a} \]
      17. *-commutative98.8%

        \[\leadsto 1 \cdot \frac{b - \sqrt{\color{blue}{c \cdot \left(a \cdot -3\right)}}}{-3 \cdot a} \]
      18. distribute-lft-neg-in98.8%

        \[\leadsto 1 \cdot \frac{b - \sqrt{c \cdot \left(a \cdot -3\right)}}{\color{blue}{\left(-3\right) \cdot a}} \]
      19. metadata-eval98.8%

        \[\leadsto 1 \cdot \frac{b - \sqrt{c \cdot \left(a \cdot -3\right)}}{\color{blue}{-3} \cdot a} \]
      20. *-commutative98.8%

        \[\leadsto 1 \cdot \frac{b - \sqrt{c \cdot \left(a \cdot -3\right)}}{\color{blue}{a \cdot -3}} \]
    7. Applied egg-rr98.8%

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

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

      \[\leadsto \color{blue}{\frac{b - \sqrt{c \cdot \left(a \cdot -3\right)}}{a \cdot -3}} \]
    10. Step-by-step derivation
      1. *-un-lft-identity98.8%

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

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

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

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

        \[\leadsto \frac{1}{a} \cdot \frac{b - \sqrt{\color{blue}{-3 \cdot \left(a \cdot c\right)}}}{-3} \]
    11. Applied egg-rr100.0%

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

    if 8.6000000000000003e-5 < b < 6.2e15

    1. Initial program 28.7%

      \[\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-neg28.7%

        \[\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-neg28.7%

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

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

      \[\leadsto \color{blue}{c \cdot \left(-0.375 \cdot \frac{a \cdot c}{{b}^{3}} - 0.5 \cdot \frac{1}{b}\right)} \]
  3. Recombined 5 regimes into one program.
  4. Final simplification83.4%

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -5.2 \cdot 10^{+65}:\\ \;\;\;\;\frac{\frac{b \cdot 2}{-3}}{a}\\ \mathbf{elif}\;b \leq 1.28 \cdot 10^{-86}:\\ \;\;\;\;\frac{\sqrt{b \cdot b - 3 \cdot \left(a \cdot c\right)} - b}{a \cdot 3}\\ \mathbf{elif}\;b \leq 2.6 \cdot 10^{-24}:\\ \;\;\;\;\frac{c}{b} \cdot -0.5\\ \mathbf{elif}\;b \leq 8.6 \cdot 10^{-5}:\\ \;\;\;\;\frac{1}{a} \cdot \frac{b - \sqrt{-3 \cdot \left(a \cdot c\right)}}{-3}\\ \mathbf{elif}\;b \leq 6.2 \cdot 10^{+15}:\\ \;\;\;\;c \cdot \left(-0.375 \cdot \frac{a \cdot c}{{b}^{3}} + 0.5 \cdot \frac{-1}{b}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{c}{b} \cdot -0.5\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 84.5% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{c}{b} \cdot -0.5\\ \mathbf{if}\;b \leq -5.2 \cdot 10^{+65}:\\ \;\;\;\;\frac{\frac{b \cdot 2}{-3}}{a}\\ \mathbf{elif}\;b \leq 2.5 \cdot 10^{-85}:\\ \;\;\;\;\frac{\sqrt{b \cdot b - \left(a \cdot 3\right) \cdot c} - b}{a \cdot 3}\\ \mathbf{elif}\;b \leq 9 \cdot 10^{-24}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;b \leq 8.2 \cdot 10^{-5}:\\ \;\;\;\;\frac{1}{a} \cdot \frac{b - \sqrt{-3 \cdot \left(a \cdot c\right)}}{-3}\\ \mathbf{elif}\;b \leq 6.2 \cdot 10^{+15}:\\ \;\;\;\;c \cdot \left(-0.375 \cdot \frac{a \cdot c}{{b}^{3}} + 0.5 \cdot \frac{-1}{b}\right)\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
(FPCore (a b c)
 :precision binary64
 (let* ((t_0 (* (/ c b) -0.5)))
   (if (<= b -5.2e+65)
     (/ (/ (* b 2.0) -3.0) a)
     (if (<= b 2.5e-85)
       (/ (- (sqrt (- (* b b) (* (* a 3.0) c))) b) (* a 3.0))
       (if (<= b 9e-24)
         t_0
         (if (<= b 8.2e-5)
           (* (/ 1.0 a) (/ (- b (sqrt (* -3.0 (* a c)))) -3.0))
           (if (<= b 6.2e+15)
             (* c (+ (* -0.375 (/ (* a c) (pow b 3.0))) (* 0.5 (/ -1.0 b))))
             t_0)))))))
double code(double a, double b, double c) {
	double t_0 = (c / b) * -0.5;
	double tmp;
	if (b <= -5.2e+65) {
		tmp = ((b * 2.0) / -3.0) / a;
	} else if (b <= 2.5e-85) {
		tmp = (sqrt(((b * b) - ((a * 3.0) * c))) - b) / (a * 3.0);
	} else if (b <= 9e-24) {
		tmp = t_0;
	} else if (b <= 8.2e-5) {
		tmp = (1.0 / a) * ((b - sqrt((-3.0 * (a * c)))) / -3.0);
	} else if (b <= 6.2e+15) {
		tmp = c * ((-0.375 * ((a * c) / pow(b, 3.0))) + (0.5 * (-1.0 / b)));
	} else {
		tmp = t_0;
	}
	return tmp;
}
real(8) function code(a, b, c)
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8) :: t_0
    real(8) :: tmp
    t_0 = (c / b) * (-0.5d0)
    if (b <= (-5.2d+65)) then
        tmp = ((b * 2.0d0) / (-3.0d0)) / a
    else if (b <= 2.5d-85) then
        tmp = (sqrt(((b * b) - ((a * 3.0d0) * c))) - b) / (a * 3.0d0)
    else if (b <= 9d-24) then
        tmp = t_0
    else if (b <= 8.2d-5) then
        tmp = (1.0d0 / a) * ((b - sqrt(((-3.0d0) * (a * c)))) / (-3.0d0))
    else if (b <= 6.2d+15) then
        tmp = c * (((-0.375d0) * ((a * c) / (b ** 3.0d0))) + (0.5d0 * ((-1.0d0) / b)))
    else
        tmp = t_0
    end if
    code = tmp
end function
public static double code(double a, double b, double c) {
	double t_0 = (c / b) * -0.5;
	double tmp;
	if (b <= -5.2e+65) {
		tmp = ((b * 2.0) / -3.0) / a;
	} else if (b <= 2.5e-85) {
		tmp = (Math.sqrt(((b * b) - ((a * 3.0) * c))) - b) / (a * 3.0);
	} else if (b <= 9e-24) {
		tmp = t_0;
	} else if (b <= 8.2e-5) {
		tmp = (1.0 / a) * ((b - Math.sqrt((-3.0 * (a * c)))) / -3.0);
	} else if (b <= 6.2e+15) {
		tmp = c * ((-0.375 * ((a * c) / Math.pow(b, 3.0))) + (0.5 * (-1.0 / b)));
	} else {
		tmp = t_0;
	}
	return tmp;
}
def code(a, b, c):
	t_0 = (c / b) * -0.5
	tmp = 0
	if b <= -5.2e+65:
		tmp = ((b * 2.0) / -3.0) / a
	elif b <= 2.5e-85:
		tmp = (math.sqrt(((b * b) - ((a * 3.0) * c))) - b) / (a * 3.0)
	elif b <= 9e-24:
		tmp = t_0
	elif b <= 8.2e-5:
		tmp = (1.0 / a) * ((b - math.sqrt((-3.0 * (a * c)))) / -3.0)
	elif b <= 6.2e+15:
		tmp = c * ((-0.375 * ((a * c) / math.pow(b, 3.0))) + (0.5 * (-1.0 / b)))
	else:
		tmp = t_0
	return tmp
function code(a, b, c)
	t_0 = Float64(Float64(c / b) * -0.5)
	tmp = 0.0
	if (b <= -5.2e+65)
		tmp = Float64(Float64(Float64(b * 2.0) / -3.0) / a);
	elseif (b <= 2.5e-85)
		tmp = Float64(Float64(sqrt(Float64(Float64(b * b) - Float64(Float64(a * 3.0) * c))) - b) / Float64(a * 3.0));
	elseif (b <= 9e-24)
		tmp = t_0;
	elseif (b <= 8.2e-5)
		tmp = Float64(Float64(1.0 / a) * Float64(Float64(b - sqrt(Float64(-3.0 * Float64(a * c)))) / -3.0));
	elseif (b <= 6.2e+15)
		tmp = Float64(c * Float64(Float64(-0.375 * Float64(Float64(a * c) / (b ^ 3.0))) + Float64(0.5 * Float64(-1.0 / b))));
	else
		tmp = t_0;
	end
	return tmp
end
function tmp_2 = code(a, b, c)
	t_0 = (c / b) * -0.5;
	tmp = 0.0;
	if (b <= -5.2e+65)
		tmp = ((b * 2.0) / -3.0) / a;
	elseif (b <= 2.5e-85)
		tmp = (sqrt(((b * b) - ((a * 3.0) * c))) - b) / (a * 3.0);
	elseif (b <= 9e-24)
		tmp = t_0;
	elseif (b <= 8.2e-5)
		tmp = (1.0 / a) * ((b - sqrt((-3.0 * (a * c)))) / -3.0);
	elseif (b <= 6.2e+15)
		tmp = c * ((-0.375 * ((a * c) / (b ^ 3.0))) + (0.5 * (-1.0 / b)));
	else
		tmp = t_0;
	end
	tmp_2 = tmp;
end
code[a_, b_, c_] := Block[{t$95$0 = N[(N[(c / b), $MachinePrecision] * -0.5), $MachinePrecision]}, If[LessEqual[b, -5.2e+65], N[(N[(N[(b * 2.0), $MachinePrecision] / -3.0), $MachinePrecision] / a), $MachinePrecision], If[LessEqual[b, 2.5e-85], N[(N[(N[Sqrt[N[(N[(b * b), $MachinePrecision] - N[(N[(a * 3.0), $MachinePrecision] * c), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision] / N[(a * 3.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 9e-24], t$95$0, If[LessEqual[b, 8.2e-5], N[(N[(1.0 / a), $MachinePrecision] * N[(N[(b - N[Sqrt[N[(-3.0 * N[(a * c), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / -3.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 6.2e+15], N[(c * N[(N[(-0.375 * N[(N[(a * c), $MachinePrecision] / N[Power[b, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(0.5 * N[(-1.0 / b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \frac{c}{b} \cdot -0.5\\
\mathbf{if}\;b \leq -5.2 \cdot 10^{+65}:\\
\;\;\;\;\frac{\frac{b \cdot 2}{-3}}{a}\\

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

\mathbf{elif}\;b \leq 9 \cdot 10^{-24}:\\
\;\;\;\;t\_0\\

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

\mathbf{elif}\;b \leq 6.2 \cdot 10^{+15}:\\
\;\;\;\;c \cdot \left(-0.375 \cdot \frac{a \cdot c}{{b}^{3}} + 0.5 \cdot \frac{-1}{b}\right)\\

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


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

    1. Initial program 56.0%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{b \cdot -0.6666666666666666}{a}} \]
    9. Applied egg-rr91.2%

      \[\leadsto \color{blue}{\frac{b \cdot -0.6666666666666666}{a}} \]
    10. Step-by-step derivation
      1. metadata-eval91.2%

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

        \[\leadsto \frac{\color{blue}{\frac{b \cdot 2}{-3}}}{a} \]
    11. Applied egg-rr91.3%

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

    if -5.20000000000000005e65 < b < 2.5000000000000001e-85

    1. Initial program 72.7%

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

    if 2.5000000000000001e-85 < b < 8.9999999999999995e-24 or 6.2e15 < b

    1. Initial program 11.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-neg11.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-neg11.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*11.1%

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

      \[\leadsto \color{blue}{-0.5 \cdot \frac{c}{b}} \]
    6. Step-by-step derivation
      1. *-commutative88.5%

        \[\leadsto \color{blue}{\frac{c}{b} \cdot -0.5} \]
    7. Simplified88.5%

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

    if 8.9999999999999995e-24 < b < 8.20000000000000009e-5

    1. Initial program 98.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-neg98.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-neg98.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*98.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto 1 \cdot \frac{b - \sqrt{\color{blue}{\left(-3 \cdot a\right) \cdot c}}}{-3 \cdot a} \]
      16. *-commutative98.8%

        \[\leadsto 1 \cdot \frac{b - \sqrt{\color{blue}{\left(a \cdot -3\right)} \cdot c}}{-3 \cdot a} \]
      17. *-commutative98.8%

        \[\leadsto 1 \cdot \frac{b - \sqrt{\color{blue}{c \cdot \left(a \cdot -3\right)}}}{-3 \cdot a} \]
      18. distribute-lft-neg-in98.8%

        \[\leadsto 1 \cdot \frac{b - \sqrt{c \cdot \left(a \cdot -3\right)}}{\color{blue}{\left(-3\right) \cdot a}} \]
      19. metadata-eval98.8%

        \[\leadsto 1 \cdot \frac{b - \sqrt{c \cdot \left(a \cdot -3\right)}}{\color{blue}{-3} \cdot a} \]
      20. *-commutative98.8%

        \[\leadsto 1 \cdot \frac{b - \sqrt{c \cdot \left(a \cdot -3\right)}}{\color{blue}{a \cdot -3}} \]
    7. Applied egg-rr98.8%

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

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

      \[\leadsto \color{blue}{\frac{b - \sqrt{c \cdot \left(a \cdot -3\right)}}{a \cdot -3}} \]
    10. Step-by-step derivation
      1. *-un-lft-identity98.8%

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

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

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

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

        \[\leadsto \frac{1}{a} \cdot \frac{b - \sqrt{\color{blue}{-3 \cdot \left(a \cdot c\right)}}}{-3} \]
    11. Applied egg-rr100.0%

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

    if 8.20000000000000009e-5 < b < 6.2e15

    1. Initial program 28.7%

      \[\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-neg28.7%

        \[\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-neg28.7%

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

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

      \[\leadsto \color{blue}{c \cdot \left(-0.375 \cdot \frac{a \cdot c}{{b}^{3}} - 0.5 \cdot \frac{1}{b}\right)} \]
  3. Recombined 5 regimes into one program.
  4. Final simplification83.5%

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -5.2 \cdot 10^{+65}:\\ \;\;\;\;\frac{\frac{b \cdot 2}{-3}}{a}\\ \mathbf{elif}\;b \leq 2.5 \cdot 10^{-85}:\\ \;\;\;\;\frac{\sqrt{b \cdot b - \left(a \cdot 3\right) \cdot c} - b}{a \cdot 3}\\ \mathbf{elif}\;b \leq 9 \cdot 10^{-24}:\\ \;\;\;\;\frac{c}{b} \cdot -0.5\\ \mathbf{elif}\;b \leq 8.2 \cdot 10^{-5}:\\ \;\;\;\;\frac{1}{a} \cdot \frac{b - \sqrt{-3 \cdot \left(a \cdot c\right)}}{-3}\\ \mathbf{elif}\;b \leq 6.2 \cdot 10^{+15}:\\ \;\;\;\;c \cdot \left(-0.375 \cdot \frac{a \cdot c}{{b}^{3}} + 0.5 \cdot \frac{-1}{b}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{c}{b} \cdot -0.5\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 78.3% accurate, 1.0× speedup?

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

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

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

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


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

    1. Initial program 59.0%

      \[\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-neg59.0%

        \[\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-neg59.0%

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{b \cdot -0.6666666666666666}{a}} \]
    10. Step-by-step derivation
      1. metadata-eval89.8%

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

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

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

    if -1.6e8 < b < 2.00000000000000017e-86

    1. Initial program 71.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.00000000000000017e-86 < b

    1. Initial program 16.7%

      \[\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-neg16.7%

        \[\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-neg16.7%

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

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

      \[\leadsto \color{blue}{-0.5 \cdot \frac{c}{b}} \]
    6. Step-by-step derivation
      1. *-commutative83.9%

        \[\leadsto \color{blue}{\frac{c}{b} \cdot -0.5} \]
    7. Simplified83.9%

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

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

Alternative 6: 78.3% accurate, 1.0× speedup?

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

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

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

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


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

    1. Initial program 59.0%

      \[\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-neg59.0%

        \[\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-neg59.0%

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{b \cdot -0.6666666666666666}{a}} \]
    10. Step-by-step derivation
      1. metadata-eval89.8%

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

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

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

    if -1.6e8 < b < 8.499999999999999e-86

    1. Initial program 71.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 8.499999999999999e-86 < b

    1. Initial program 16.7%

      \[\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-neg16.7%

        \[\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-neg16.7%

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

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

      \[\leadsto \color{blue}{-0.5 \cdot \frac{c}{b}} \]
    6. Step-by-step derivation
      1. *-commutative83.9%

        \[\leadsto \color{blue}{\frac{c}{b} \cdot -0.5} \]
    7. Simplified83.9%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -160000000:\\ \;\;\;\;\frac{\frac{b \cdot 2}{-3}}{a}\\ \mathbf{elif}\;b \leq 8.5 \cdot 10^{-86}:\\ \;\;\;\;\left(b + \sqrt{c \cdot \left(-3 \cdot a\right)}\right) \cdot \frac{0.3333333333333333}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{c}{b} \cdot -0.5\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 79.1% accurate, 1.0× speedup?

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

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

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

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


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

    1. Initial program 59.0%

      \[\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-neg59.0%

        \[\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-neg59.0%

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{b \cdot -0.6666666666666666}{a}} \]
    10. Step-by-step derivation
      1. metadata-eval89.8%

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

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

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

    if -2.2e8 < b < 1.02000000000000004e-84

    1. Initial program 71.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(b - \sqrt{\color{blue}{\left(-3 \cdot a\right) \cdot c}}\right) \cdot \frac{1}{-3 \cdot a} \]
      16. *-commutative64.9%

        \[\leadsto \left(b - \sqrt{\color{blue}{\left(a \cdot -3\right)} \cdot c}\right) \cdot \frac{1}{-3 \cdot a} \]
      17. *-commutative64.9%

        \[\leadsto \left(b - \sqrt{\color{blue}{c \cdot \left(a \cdot -3\right)}}\right) \cdot \frac{1}{-3 \cdot a} \]
      18. distribute-lft-neg-in64.9%

        \[\leadsto \left(b - \sqrt{c \cdot \left(a \cdot -3\right)}\right) \cdot \frac{1}{\color{blue}{\left(-3\right) \cdot a}} \]
      19. metadata-eval64.9%

        \[\leadsto \left(b - \sqrt{c \cdot \left(a \cdot -3\right)}\right) \cdot \frac{1}{\color{blue}{-3} \cdot a} \]
      20. *-commutative64.9%

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{b - \sqrt{a \cdot \left(c \cdot \color{blue}{\left(\sqrt{-3} \cdot \sqrt{-3}\right)}\right)}}{a} \cdot \frac{1}{-3} \]
      9. rem-square-sqrt64.8%

        \[\leadsto \frac{b - \sqrt{a \cdot \left(c \cdot \color{blue}{-3}\right)}}{a} \cdot \frac{1}{-3} \]
      10. metadata-eval64.8%

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

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

    if 1.02000000000000004e-84 < b

    1. Initial program 16.7%

      \[\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-neg16.7%

        \[\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-neg16.7%

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

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

      \[\leadsto \color{blue}{-0.5 \cdot \frac{c}{b}} \]
    6. Step-by-step derivation
      1. *-commutative83.9%

        \[\leadsto \color{blue}{\frac{c}{b} \cdot -0.5} \]
    7. Simplified83.9%

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

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

Alternative 8: 79.2% accurate, 1.0× speedup?

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

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

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

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


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

    1. Initial program 59.0%

      \[\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-neg59.0%

        \[\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-neg59.0%

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{b \cdot -0.6666666666666666}{a}} \]
    10. Step-by-step derivation
      1. metadata-eval89.8%

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

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

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

    if -1.6e8 < b < 2.8000000000000001e-87

    1. Initial program 71.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto 1 \cdot \frac{b - \sqrt{\color{blue}{\left(-3 \cdot a\right) \cdot c}}}{-3 \cdot a} \]
      16. *-commutative64.8%

        \[\leadsto 1 \cdot \frac{b - \sqrt{\color{blue}{\left(a \cdot -3\right)} \cdot c}}{-3 \cdot a} \]
      17. *-commutative64.8%

        \[\leadsto 1 \cdot \frac{b - \sqrt{\color{blue}{c \cdot \left(a \cdot -3\right)}}}{-3 \cdot a} \]
      18. distribute-lft-neg-in64.8%

        \[\leadsto 1 \cdot \frac{b - \sqrt{c \cdot \left(a \cdot -3\right)}}{\color{blue}{\left(-3\right) \cdot a}} \]
      19. metadata-eval64.8%

        \[\leadsto 1 \cdot \frac{b - \sqrt{c \cdot \left(a \cdot -3\right)}}{\color{blue}{-3} \cdot a} \]
      20. *-commutative64.8%

        \[\leadsto 1 \cdot \frac{b - \sqrt{c \cdot \left(a \cdot -3\right)}}{\color{blue}{a \cdot -3}} \]
    7. Applied egg-rr64.8%

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

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

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

    if 2.8000000000000001e-87 < b

    1. Initial program 16.7%

      \[\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-neg16.7%

        \[\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-neg16.7%

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

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

      \[\leadsto \color{blue}{-0.5 \cdot \frac{c}{b}} \]
    6. Step-by-step derivation
      1. *-commutative83.9%

        \[\leadsto \color{blue}{\frac{c}{b} \cdot -0.5} \]
    7. Simplified83.9%

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

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

Alternative 9: 67.0% accurate, 9.7× speedup?

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

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

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


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

    1. Initial program 65.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-neg65.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-neg65.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*65.7%

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

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

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

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

        \[\leadsto \color{blue}{\frac{b \cdot -0.6666666666666666}{a}} \]
    9. Applied egg-rr62.2%

      \[\leadsto \color{blue}{\frac{b \cdot -0.6666666666666666}{a}} \]
    10. Step-by-step derivation
      1. metadata-eval62.2%

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

        \[\leadsto \frac{\color{blue}{\frac{b \cdot 2}{-3}}}{a} \]
    11. Applied egg-rr62.3%

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

    if 8.79999999999999987e-305 < b

    1. Initial program 29.4%

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

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

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

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

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

      \[\leadsto \color{blue}{-0.5 \cdot \frac{c}{b}} \]
    6. Step-by-step derivation
      1. *-commutative64.7%

        \[\leadsto \color{blue}{\frac{c}{b} \cdot -0.5} \]
    7. Simplified64.7%

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

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

Alternative 10: 67.0% accurate, 11.6× speedup?

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

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

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


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

    1. Initial program 65.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-neg65.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-neg65.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*65.7%

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

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

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

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

    if 1.6999999999999999e-304 < b

    1. Initial program 29.4%

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

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

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

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

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

      \[\leadsto \color{blue}{-0.5 \cdot \frac{c}{b}} \]
    6. Step-by-step derivation
      1. *-commutative64.7%

        \[\leadsto \color{blue}{\frac{c}{b} \cdot -0.5} \]
    7. Simplified64.7%

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

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

Alternative 11: 67.0% accurate, 11.6× speedup?

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

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

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


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

    1. Initial program 65.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-neg65.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-neg65.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*65.7%

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

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

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

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

        \[\leadsto \color{blue}{\frac{b \cdot -0.6666666666666666}{a}} \]
    9. Applied egg-rr62.2%

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

    if 8.79999999999999987e-305 < b

    1. Initial program 29.4%

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

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

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

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

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

      \[\leadsto \color{blue}{-0.5 \cdot \frac{c}{b}} \]
    6. Step-by-step derivation
      1. *-commutative64.7%

        \[\leadsto \color{blue}{\frac{c}{b} \cdot -0.5} \]
    7. Simplified64.7%

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

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

Alternative 12: 35.1% accurate, 23.2× speedup?

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

\\
b \cdot \frac{-0.6666666666666666}{a}
\end{array}
Derivation
  1. Initial program 49.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-neg49.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-neg49.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*49.1%

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

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

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

    \[\leadsto \color{blue}{\frac{b}{a} \cdot -0.6666666666666666} \]
  8. Step-by-step derivation
    1. *-commutative35.0%

      \[\leadsto \color{blue}{-0.6666666666666666 \cdot \frac{b}{a}} \]
    2. clear-num35.0%

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

      \[\leadsto \color{blue}{\frac{-0.6666666666666666}{\frac{a}{b}}} \]
  9. Applied egg-rr35.0%

    \[\leadsto \color{blue}{\frac{-0.6666666666666666}{\frac{a}{b}}} \]
  10. Step-by-step derivation
    1. associate-/r/34.9%

      \[\leadsto \color{blue}{\frac{-0.6666666666666666}{a} \cdot b} \]
  11. Simplified34.9%

    \[\leadsto \color{blue}{\frac{-0.6666666666666666}{a} \cdot b} \]
  12. Final simplification34.9%

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

Alternative 13: 35.1% accurate, 23.2× speedup?

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

\\
-0.6666666666666666 \cdot \frac{b}{a}
\end{array}
Derivation
  1. Initial program 49.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-neg49.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-neg49.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*49.1%

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

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

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

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

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

Reproduce

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