Cubic critical, narrow range

Percentage Accurate: 55.4% → 91.9%
Time: 22.9s
Alternatives: 11
Speedup: 23.2×

Specification

?
\[\left(\left(1.0536712127723509 \cdot 10^{-8} < a \land a < 94906265.62425156\right) \land \left(1.0536712127723509 \cdot 10^{-8} < b \land b < 94906265.62425156\right)\right) \land \left(1.0536712127723509 \cdot 10^{-8} < c \land c < 94906265.62425156\right)\]
\[\begin{array}{l} \\ \frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a} \end{array} \]
(FPCore (a b c)
 :precision binary64
 (/ (+ (- b) (sqrt (- (* b b) (* (* 3.0 a) c)))) (* 3.0 a)))
double code(double a, double b, double c) {
	return (-b + sqrt(((b * b) - ((3.0 * a) * c)))) / (3.0 * a);
}
real(8) function code(a, b, c)
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    code = (-b + sqrt(((b * b) - ((3.0d0 * a) * c)))) / (3.0d0 * a)
end function
public static double code(double a, double b, double c) {
	return (-b + Math.sqrt(((b * b) - ((3.0 * a) * c)))) / (3.0 * a);
}
def code(a, b, c):
	return (-b + math.sqrt(((b * b) - ((3.0 * a) * c)))) / (3.0 * a)
function code(a, b, c)
	return Float64(Float64(Float64(-b) + sqrt(Float64(Float64(b * b) - Float64(Float64(3.0 * a) * c)))) / Float64(3.0 * a))
end
function tmp = code(a, b, c)
	tmp = (-b + sqrt(((b * b) - ((3.0 * a) * c)))) / (3.0 * a);
end
code[a_, b_, c_] := N[(N[((-b) + N[Sqrt[N[(N[(b * b), $MachinePrecision] - N[(N[(3.0 * a), $MachinePrecision] * c), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[(3.0 * a), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 11 alternatives:

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

Initial Program: 55.4% 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: 91.9% accurate, 0.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := a \cdot \left(c \cdot 3\right)\\ t_1 := \frac{{b}^{6} - 27 \cdot {\left(a \cdot c\right)}^{3}}{\mathsf{fma}\left(t\_0, \mathsf{fma}\left(b, b, t\_0\right), {b}^{4}\right)}\\ \mathbf{if}\;b \leq 0.115:\\ \;\;\;\;\frac{\frac{t\_1 - {b}^{2}}{b + \sqrt{t\_1}}}{a \cdot 3}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(-0.5, \frac{c}{b}, \mathsf{fma}\left(-0.5625, {a}^{2} \cdot \frac{{c}^{3}}{{b}^{5}}, \mathsf{fma}\left(-0.16666666666666666, \frac{{\left(a \cdot c\right)}^{4}}{a} \cdot \frac{6.328125}{{b}^{7}}, -0.375 \cdot \left(a \cdot \frac{{c}^{2}}{{b}^{3}}\right)\right)\right)\right)\\ \end{array} \end{array} \]
(FPCore (a b c)
 :precision binary64
 (let* ((t_0 (* a (* c 3.0)))
        (t_1
         (/
          (- (pow b 6.0) (* 27.0 (pow (* a c) 3.0)))
          (fma t_0 (fma b b t_0) (pow b 4.0)))))
   (if (<= b 0.115)
     (/ (/ (- t_1 (pow b 2.0)) (+ b (sqrt t_1))) (* a 3.0))
     (fma
      -0.5
      (/ c b)
      (fma
       -0.5625
       (* (pow a 2.0) (/ (pow c 3.0) (pow b 5.0)))
       (fma
        -0.16666666666666666
        (* (/ (pow (* a c) 4.0) a) (/ 6.328125 (pow b 7.0)))
        (* -0.375 (* a (/ (pow c 2.0) (pow b 3.0))))))))))
double code(double a, double b, double c) {
	double t_0 = a * (c * 3.0);
	double t_1 = (pow(b, 6.0) - (27.0 * pow((a * c), 3.0))) / fma(t_0, fma(b, b, t_0), pow(b, 4.0));
	double tmp;
	if (b <= 0.115) {
		tmp = ((t_1 - pow(b, 2.0)) / (b + sqrt(t_1))) / (a * 3.0);
	} else {
		tmp = fma(-0.5, (c / b), fma(-0.5625, (pow(a, 2.0) * (pow(c, 3.0) / pow(b, 5.0))), fma(-0.16666666666666666, ((pow((a * c), 4.0) / a) * (6.328125 / pow(b, 7.0))), (-0.375 * (a * (pow(c, 2.0) / pow(b, 3.0)))))));
	}
	return tmp;
}
function code(a, b, c)
	t_0 = Float64(a * Float64(c * 3.0))
	t_1 = Float64(Float64((b ^ 6.0) - Float64(27.0 * (Float64(a * c) ^ 3.0))) / fma(t_0, fma(b, b, t_0), (b ^ 4.0)))
	tmp = 0.0
	if (b <= 0.115)
		tmp = Float64(Float64(Float64(t_1 - (b ^ 2.0)) / Float64(b + sqrt(t_1))) / Float64(a * 3.0));
	else
		tmp = fma(-0.5, Float64(c / b), fma(-0.5625, Float64((a ^ 2.0) * Float64((c ^ 3.0) / (b ^ 5.0))), fma(-0.16666666666666666, Float64(Float64((Float64(a * c) ^ 4.0) / a) * Float64(6.328125 / (b ^ 7.0))), Float64(-0.375 * Float64(a * Float64((c ^ 2.0) / (b ^ 3.0)))))));
	end
	return tmp
end
code[a_, b_, c_] := Block[{t$95$0 = N[(a * N[(c * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[Power[b, 6.0], $MachinePrecision] - N[(27.0 * N[Power[N[(a * c), $MachinePrecision], 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(t$95$0 * N[(b * b + t$95$0), $MachinePrecision] + N[Power[b, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, 0.115], N[(N[(N[(t$95$1 - N[Power[b, 2.0], $MachinePrecision]), $MachinePrecision] / N[(b + N[Sqrt[t$95$1], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(a * 3.0), $MachinePrecision]), $MachinePrecision], N[(-0.5 * N[(c / b), $MachinePrecision] + N[(-0.5625 * N[(N[Power[a, 2.0], $MachinePrecision] * N[(N[Power[c, 3.0], $MachinePrecision] / N[Power[b, 5.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(-0.16666666666666666 * N[(N[(N[Power[N[(a * c), $MachinePrecision], 4.0], $MachinePrecision] / a), $MachinePrecision] * N[(6.328125 / N[Power[b, 7.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(-0.375 * N[(a * N[(N[Power[c, 2.0], $MachinePrecision] / N[Power[b, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := a \cdot \left(c \cdot 3\right)\\
t_1 := \frac{{b}^{6} - 27 \cdot {\left(a \cdot c\right)}^{3}}{\mathsf{fma}\left(t\_0, \mathsf{fma}\left(b, b, t\_0\right), {b}^{4}\right)}\\
\mathbf{if}\;b \leq 0.115:\\
\;\;\;\;\frac{\frac{t\_1 - {b}^{2}}{b + \sqrt{t\_1}}}{a \cdot 3}\\

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-0.5, \frac{c}{b}, \mathsf{fma}\left(-0.5625, {a}^{2} \cdot \frac{{c}^{3}}{{b}^{5}}, \mathsf{fma}\left(-0.16666666666666666, \frac{{\left(a \cdot c\right)}^{4}}{a} \cdot \frac{6.328125}{{b}^{7}}, -0.375 \cdot \left(a \cdot \frac{{c}^{2}}{{b}^{3}}\right)\right)\right)\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if b < 0.115000000000000005

    1. Initial program 87.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. /-rgt-identity87.0%

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

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

      \[\leadsto \color{blue}{\frac{\sqrt{\mathsf{fma}\left(b, b, a \cdot \left(c \cdot -3\right)\right)} - b}{3 \cdot a}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. associate-*r*87.0%

        \[\leadsto \frac{\sqrt{\mathsf{fma}\left(b, b, \color{blue}{\left(a \cdot c\right) \cdot -3}\right)} - b}{3 \cdot a} \]
      2. metadata-eval87.0%

        \[\leadsto \frac{\sqrt{\mathsf{fma}\left(b, b, \left(a \cdot c\right) \cdot \color{blue}{\left(-3\right)}\right)} - b}{3 \cdot a} \]
      3. distribute-rgt-neg-in87.0%

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{\frac{\frac{\sqrt{{b}^{6} - {\left(3 \cdot \left(a \cdot c\right)\right)}^{3}}}{\sqrt{{b}^{4} + \left(3 \cdot \left(a \cdot c\right)\right) \cdot \mathsf{fma}\left(b, b, 3 \cdot \left(a \cdot c\right)\right)}} \cdot \frac{\sqrt{{b}^{6} - {\left(3 \cdot \left(a \cdot c\right)\right)}^{3}}}{\sqrt{{b}^{4} + \left(3 \cdot \left(a \cdot c\right)\right) \cdot \mathsf{fma}\left(b, b, 3 \cdot \left(a \cdot c\right)\right)}} - b \cdot b}{\frac{\sqrt{{b}^{6} - {\left(3 \cdot \left(a \cdot c\right)\right)}^{3}}}{\sqrt{{b}^{4} + \left(3 \cdot \left(a \cdot c\right)\right) \cdot \mathsf{fma}\left(b, b, 3 \cdot \left(a \cdot c\right)\right)}} + b}}}{3 \cdot a} \]
    8. Applied egg-rr86.5%

      \[\leadsto \frac{\color{blue}{\frac{{\left(\sqrt{\frac{{b}^{6} - {\left(\left(a \cdot 3\right) \cdot c\right)}^{3}}{\mathsf{fma}\left(\left(a \cdot 3\right) \cdot c, \mathsf{fma}\left(b, b, \left(a \cdot 3\right) \cdot c\right), {b}^{4}\right)}}\right)}^{2} - {b}^{2}}{\sqrt{\frac{{b}^{6} - {\left(\left(a \cdot 3\right) \cdot c\right)}^{3}}{\mathsf{fma}\left(\left(a \cdot 3\right) \cdot c, \mathsf{fma}\left(b, b, \left(a \cdot 3\right) \cdot c\right), {b}^{4}\right)}} + b}}}{3 \cdot a} \]
    9. Step-by-step derivation
      1. Simplified87.7%

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

      if 0.115000000000000005 < b

      1. Initial program 54.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. /-rgt-identity54.0%

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

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

        \[\leadsto \color{blue}{\frac{\sqrt{\mathsf{fma}\left(b, b, a \cdot \left(c \cdot -3\right)\right)} - b}{3 \cdot a}} \]
      4. Add Preprocessing
      5. Step-by-step derivation
        1. associate-*r*53.9%

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

          \[\leadsto \frac{\sqrt{\mathsf{fma}\left(b, b, \left(a \cdot c\right) \cdot \color{blue}{\left(-3\right)}\right)} - b}{3 \cdot a} \]
        3. distribute-rgt-neg-in53.9%

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{-0.5 \cdot \frac{c}{b} + \left(-0.16666666666666666 \cdot \frac{-9 \cdot \left({a}^{2} \cdot \left({c}^{2} \cdot \left(-9 \cdot \left({a}^{2} \cdot {c}^{2}\right) + 9 \cdot \left({a}^{2} \cdot {c}^{2}\right)\right)\right)\right) + \left(1.5 \cdot \left(a \cdot \left(c \cdot \left(-3 \cdot \left(a \cdot \left(c \cdot \left(-9 \cdot \left({a}^{2} \cdot {c}^{2}\right) + 9 \cdot \left({a}^{2} \cdot {c}^{2}\right)\right)\right)\right) + 1.5 \cdot \left(a \cdot \left(c \cdot \left(-9 \cdot \left({a}^{2} \cdot {c}^{2}\right) + \left(9 \cdot \left({a}^{2} \cdot {c}^{2}\right) + {\left(-1.5 \cdot \left(a \cdot c\right)\right)}^{2}\right)\right)\right)\right)\right)\right)\right) + \left(9 \cdot \left({a}^{2} \cdot \left({c}^{2} \cdot \left(-9 \cdot \left({a}^{2} \cdot {c}^{2}\right) + 9 \cdot \left({a}^{2} \cdot {c}^{2}\right)\right)\right)\right) + {\left(-0.5 \cdot \left(-9 \cdot \left({a}^{2} \cdot {c}^{2}\right) + \left(9 \cdot \left({a}^{2} \cdot {c}^{2}\right) + {\left(-1.5 \cdot \left(a \cdot c\right)\right)}^{2}\right)\right)\right)}^{2}\right)\right)}{a \cdot {b}^{7}} + \left(-0.16666666666666666 \cdot \frac{-9 \cdot \left({a}^{2} \cdot {c}^{2}\right) + \left(9 \cdot \left({a}^{2} \cdot {c}^{2}\right) + {\left(-1.5 \cdot \left(a \cdot c\right)\right)}^{2}\right)}{a \cdot {b}^{3}} + -0.16666666666666666 \cdot \frac{-3 \cdot \left(a \cdot \left(c \cdot \left(-9 \cdot \left({a}^{2} \cdot {c}^{2}\right) + 9 \cdot \left({a}^{2} \cdot {c}^{2}\right)\right)\right)\right) + 1.5 \cdot \left(a \cdot \left(c \cdot \left(-9 \cdot \left({a}^{2} \cdot {c}^{2}\right) + \left(9 \cdot \left({a}^{2} \cdot {c}^{2}\right) + {\left(-1.5 \cdot \left(a \cdot c\right)\right)}^{2}\right)\right)\right)\right)}{a \cdot {b}^{5}}\right)\right)} \]
      8. Simplified91.8%

        \[\leadsto \color{blue}{\mathsf{fma}\left(-0.5, \frac{c}{b}, -0.16666666666666666 \cdot \left(\left(\frac{{\left(a \cdot c\right)}^{2} \cdot 2.25 + 0}{a \cdot {b}^{3}} + \frac{\mathsf{fma}\left(1.5, \left(a \cdot c\right) \cdot \left({\left(a \cdot c\right)}^{2} \cdot 2.25 + 0\right), \left(-3 \cdot a\right) \cdot \left(c \cdot 0\right)\right)}{a \cdot {b}^{5}}\right) + \frac{\left({\left(0 + -0.5 \cdot \left({\left(a \cdot c\right)}^{2} \cdot 2.25\right)\right)}^{2} + 0\right) + \mathsf{fma}\left(1.5, \left(a \cdot c\right) \cdot \mathsf{fma}\left(1.5, \left(a \cdot c\right) \cdot \left({\left(a \cdot c\right)}^{2} \cdot 2.25 + 0\right), \left(-3 \cdot a\right) \cdot \left(c \cdot 0\right)\right), 0\right)}{a \cdot {b}^{7}}\right)\right)} \]
      9. Taylor expanded in b around -inf 91.8%

        \[\leadsto \mathsf{fma}\left(-0.5, \frac{c}{b}, \color{blue}{-0.5625 \cdot \frac{{a}^{2} \cdot {c}^{3}}{{b}^{5}} + \left(-0.375 \cdot \frac{a \cdot {c}^{2}}{{b}^{3}} + -0.16666666666666666 \cdot \frac{1.265625 \cdot \left({a}^{4} \cdot {c}^{4}\right) + 5.0625 \cdot \left({a}^{4} \cdot {c}^{4}\right)}{a \cdot {b}^{7}}\right)}\right) \]
      10. Step-by-step derivation
        1. fma-define91.8%

          \[\leadsto \mathsf{fma}\left(-0.5, \frac{c}{b}, \color{blue}{\mathsf{fma}\left(-0.5625, \frac{{a}^{2} \cdot {c}^{3}}{{b}^{5}}, -0.375 \cdot \frac{a \cdot {c}^{2}}{{b}^{3}} + -0.16666666666666666 \cdot \frac{1.265625 \cdot \left({a}^{4} \cdot {c}^{4}\right) + 5.0625 \cdot \left({a}^{4} \cdot {c}^{4}\right)}{a \cdot {b}^{7}}\right)}\right) \]
        2. associate-/l*91.8%

          \[\leadsto \mathsf{fma}\left(-0.5, \frac{c}{b}, \mathsf{fma}\left(-0.5625, \color{blue}{{a}^{2} \cdot \frac{{c}^{3}}{{b}^{5}}}, -0.375 \cdot \frac{a \cdot {c}^{2}}{{b}^{3}} + -0.16666666666666666 \cdot \frac{1.265625 \cdot \left({a}^{4} \cdot {c}^{4}\right) + 5.0625 \cdot \left({a}^{4} \cdot {c}^{4}\right)}{a \cdot {b}^{7}}\right)\right) \]
        3. +-commutative91.8%

          \[\leadsto \mathsf{fma}\left(-0.5, \frac{c}{b}, \mathsf{fma}\left(-0.5625, {a}^{2} \cdot \frac{{c}^{3}}{{b}^{5}}, \color{blue}{-0.16666666666666666 \cdot \frac{1.265625 \cdot \left({a}^{4} \cdot {c}^{4}\right) + 5.0625 \cdot \left({a}^{4} \cdot {c}^{4}\right)}{a \cdot {b}^{7}} + -0.375 \cdot \frac{a \cdot {c}^{2}}{{b}^{3}}}\right)\right) \]
        4. fma-define91.8%

          \[\leadsto \mathsf{fma}\left(-0.5, \frac{c}{b}, \mathsf{fma}\left(-0.5625, {a}^{2} \cdot \frac{{c}^{3}}{{b}^{5}}, \color{blue}{\mathsf{fma}\left(-0.16666666666666666, \frac{1.265625 \cdot \left({a}^{4} \cdot {c}^{4}\right) + 5.0625 \cdot \left({a}^{4} \cdot {c}^{4}\right)}{a \cdot {b}^{7}}, -0.375 \cdot \frac{a \cdot {c}^{2}}{{b}^{3}}\right)}\right)\right) \]
      11. Simplified91.8%

        \[\leadsto \mathsf{fma}\left(-0.5, \frac{c}{b}, \color{blue}{\mathsf{fma}\left(-0.5625, {a}^{2} \cdot \frac{{c}^{3}}{{b}^{5}}, \mathsf{fma}\left(-0.16666666666666666, \frac{{\left(a \cdot c\right)}^{4}}{a} \cdot \frac{6.328125}{{b}^{7}}, -0.375 \cdot \left(a \cdot \frac{{c}^{2}}{{b}^{3}}\right)\right)\right)}\right) \]
    10. Recombined 2 regimes into one program.
    11. Final simplification91.4%

      \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq 0.115:\\ \;\;\;\;\frac{\frac{\frac{{b}^{6} - 27 \cdot {\left(a \cdot c\right)}^{3}}{\mathsf{fma}\left(a \cdot \left(c \cdot 3\right), \mathsf{fma}\left(b, b, a \cdot \left(c \cdot 3\right)\right), {b}^{4}\right)} - {b}^{2}}{b + \sqrt{\frac{{b}^{6} - 27 \cdot {\left(a \cdot c\right)}^{3}}{\mathsf{fma}\left(a \cdot \left(c \cdot 3\right), \mathsf{fma}\left(b, b, a \cdot \left(c \cdot 3\right)\right), {b}^{4}\right)}}}}{a \cdot 3}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(-0.5, \frac{c}{b}, \mathsf{fma}\left(-0.5625, {a}^{2} \cdot \frac{{c}^{3}}{{b}^{5}}, \mathsf{fma}\left(-0.16666666666666666, \frac{{\left(a \cdot c\right)}^{4}}{a} \cdot \frac{6.328125}{{b}^{7}}, -0.375 \cdot \left(a \cdot \frac{{c}^{2}}{{b}^{3}}\right)\right)\right)\right)\\ \end{array} \]
    12. Add Preprocessing

    Alternative 2: 91.9% accurate, 0.1× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq 0.125:\\ \;\;\;\;\frac{\sqrt{\mathsf{fma}\left(a \cdot c, -3, {b}^{2}\right)} - b}{a \cdot 3}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(-0.5, \frac{c}{b}, \mathsf{fma}\left(-0.5625, {a}^{2} \cdot \frac{{c}^{3}}{{b}^{5}}, \mathsf{fma}\left(-0.16666666666666666, \frac{{\left(a \cdot c\right)}^{4}}{a} \cdot \frac{6.328125}{{b}^{7}}, -0.375 \cdot \left(a \cdot \frac{{c}^{2}}{{b}^{3}}\right)\right)\right)\right)\\ \end{array} \end{array} \]
    (FPCore (a b c)
     :precision binary64
     (if (<= b 0.125)
       (/ (- (sqrt (fma (* a c) -3.0 (pow b 2.0))) b) (* a 3.0))
       (fma
        -0.5
        (/ c b)
        (fma
         -0.5625
         (* (pow a 2.0) (/ (pow c 3.0) (pow b 5.0)))
         (fma
          -0.16666666666666666
          (* (/ (pow (* a c) 4.0) a) (/ 6.328125 (pow b 7.0)))
          (* -0.375 (* a (/ (pow c 2.0) (pow b 3.0)))))))))
    double code(double a, double b, double c) {
    	double tmp;
    	if (b <= 0.125) {
    		tmp = (sqrt(fma((a * c), -3.0, pow(b, 2.0))) - b) / (a * 3.0);
    	} else {
    		tmp = fma(-0.5, (c / b), fma(-0.5625, (pow(a, 2.0) * (pow(c, 3.0) / pow(b, 5.0))), fma(-0.16666666666666666, ((pow((a * c), 4.0) / a) * (6.328125 / pow(b, 7.0))), (-0.375 * (a * (pow(c, 2.0) / pow(b, 3.0)))))));
    	}
    	return tmp;
    }
    
    function code(a, b, c)
    	tmp = 0.0
    	if (b <= 0.125)
    		tmp = Float64(Float64(sqrt(fma(Float64(a * c), -3.0, (b ^ 2.0))) - b) / Float64(a * 3.0));
    	else
    		tmp = fma(-0.5, Float64(c / b), fma(-0.5625, Float64((a ^ 2.0) * Float64((c ^ 3.0) / (b ^ 5.0))), fma(-0.16666666666666666, Float64(Float64((Float64(a * c) ^ 4.0) / a) * Float64(6.328125 / (b ^ 7.0))), Float64(-0.375 * Float64(a * Float64((c ^ 2.0) / (b ^ 3.0)))))));
    	end
    	return tmp
    end
    
    code[a_, b_, c_] := If[LessEqual[b, 0.125], N[(N[(N[Sqrt[N[(N[(a * c), $MachinePrecision] * -3.0 + N[Power[b, 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision] / N[(a * 3.0), $MachinePrecision]), $MachinePrecision], N[(-0.5 * N[(c / b), $MachinePrecision] + N[(-0.5625 * N[(N[Power[a, 2.0], $MachinePrecision] * N[(N[Power[c, 3.0], $MachinePrecision] / N[Power[b, 5.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(-0.16666666666666666 * N[(N[(N[Power[N[(a * c), $MachinePrecision], 4.0], $MachinePrecision] / a), $MachinePrecision] * N[(6.328125 / N[Power[b, 7.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(-0.375 * N[(a * N[(N[Power[c, 2.0], $MachinePrecision] / N[Power[b, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    \mathbf{if}\;b \leq 0.125:\\
    \;\;\;\;\frac{\sqrt{\mathsf{fma}\left(a \cdot c, -3, {b}^{2}\right)} - b}{a \cdot 3}\\
    
    \mathbf{else}:\\
    \;\;\;\;\mathsf{fma}\left(-0.5, \frac{c}{b}, \mathsf{fma}\left(-0.5625, {a}^{2} \cdot \frac{{c}^{3}}{{b}^{5}}, \mathsf{fma}\left(-0.16666666666666666, \frac{{\left(a \cdot c\right)}^{4}}{a} \cdot \frac{6.328125}{{b}^{7}}, -0.375 \cdot \left(a \cdot \frac{{c}^{2}}{{b}^{3}}\right)\right)\right)\right)\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if b < 0.125

      1. Initial program 87.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-neg87.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-neg87.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*86.9%

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

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

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

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

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

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

      if 0.125 < b

      1. Initial program 54.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. /-rgt-identity54.0%

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

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

        \[\leadsto \color{blue}{\frac{\sqrt{\mathsf{fma}\left(b, b, a \cdot \left(c \cdot -3\right)\right)} - b}{3 \cdot a}} \]
      4. Add Preprocessing
      5. Step-by-step derivation
        1. associate-*r*53.9%

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

          \[\leadsto \frac{\sqrt{\mathsf{fma}\left(b, b, \left(a \cdot c\right) \cdot \color{blue}{\left(-3\right)}\right)} - b}{3 \cdot a} \]
        3. distribute-rgt-neg-in53.9%

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{-0.5 \cdot \frac{c}{b} + \left(-0.16666666666666666 \cdot \frac{-9 \cdot \left({a}^{2} \cdot \left({c}^{2} \cdot \left(-9 \cdot \left({a}^{2} \cdot {c}^{2}\right) + 9 \cdot \left({a}^{2} \cdot {c}^{2}\right)\right)\right)\right) + \left(1.5 \cdot \left(a \cdot \left(c \cdot \left(-3 \cdot \left(a \cdot \left(c \cdot \left(-9 \cdot \left({a}^{2} \cdot {c}^{2}\right) + 9 \cdot \left({a}^{2} \cdot {c}^{2}\right)\right)\right)\right) + 1.5 \cdot \left(a \cdot \left(c \cdot \left(-9 \cdot \left({a}^{2} \cdot {c}^{2}\right) + \left(9 \cdot \left({a}^{2} \cdot {c}^{2}\right) + {\left(-1.5 \cdot \left(a \cdot c\right)\right)}^{2}\right)\right)\right)\right)\right)\right)\right) + \left(9 \cdot \left({a}^{2} \cdot \left({c}^{2} \cdot \left(-9 \cdot \left({a}^{2} \cdot {c}^{2}\right) + 9 \cdot \left({a}^{2} \cdot {c}^{2}\right)\right)\right)\right) + {\left(-0.5 \cdot \left(-9 \cdot \left({a}^{2} \cdot {c}^{2}\right) + \left(9 \cdot \left({a}^{2} \cdot {c}^{2}\right) + {\left(-1.5 \cdot \left(a \cdot c\right)\right)}^{2}\right)\right)\right)}^{2}\right)\right)}{a \cdot {b}^{7}} + \left(-0.16666666666666666 \cdot \frac{-9 \cdot \left({a}^{2} \cdot {c}^{2}\right) + \left(9 \cdot \left({a}^{2} \cdot {c}^{2}\right) + {\left(-1.5 \cdot \left(a \cdot c\right)\right)}^{2}\right)}{a \cdot {b}^{3}} + -0.16666666666666666 \cdot \frac{-3 \cdot \left(a \cdot \left(c \cdot \left(-9 \cdot \left({a}^{2} \cdot {c}^{2}\right) + 9 \cdot \left({a}^{2} \cdot {c}^{2}\right)\right)\right)\right) + 1.5 \cdot \left(a \cdot \left(c \cdot \left(-9 \cdot \left({a}^{2} \cdot {c}^{2}\right) + \left(9 \cdot \left({a}^{2} \cdot {c}^{2}\right) + {\left(-1.5 \cdot \left(a \cdot c\right)\right)}^{2}\right)\right)\right)\right)}{a \cdot {b}^{5}}\right)\right)} \]
      8. Simplified91.8%

        \[\leadsto \color{blue}{\mathsf{fma}\left(-0.5, \frac{c}{b}, -0.16666666666666666 \cdot \left(\left(\frac{{\left(a \cdot c\right)}^{2} \cdot 2.25 + 0}{a \cdot {b}^{3}} + \frac{\mathsf{fma}\left(1.5, \left(a \cdot c\right) \cdot \left({\left(a \cdot c\right)}^{2} \cdot 2.25 + 0\right), \left(-3 \cdot a\right) \cdot \left(c \cdot 0\right)\right)}{a \cdot {b}^{5}}\right) + \frac{\left({\left(0 + -0.5 \cdot \left({\left(a \cdot c\right)}^{2} \cdot 2.25\right)\right)}^{2} + 0\right) + \mathsf{fma}\left(1.5, \left(a \cdot c\right) \cdot \mathsf{fma}\left(1.5, \left(a \cdot c\right) \cdot \left({\left(a \cdot c\right)}^{2} \cdot 2.25 + 0\right), \left(-3 \cdot a\right) \cdot \left(c \cdot 0\right)\right), 0\right)}{a \cdot {b}^{7}}\right)\right)} \]
      9. Taylor expanded in b around -inf 91.8%

        \[\leadsto \mathsf{fma}\left(-0.5, \frac{c}{b}, \color{blue}{-0.5625 \cdot \frac{{a}^{2} \cdot {c}^{3}}{{b}^{5}} + \left(-0.375 \cdot \frac{a \cdot {c}^{2}}{{b}^{3}} + -0.16666666666666666 \cdot \frac{1.265625 \cdot \left({a}^{4} \cdot {c}^{4}\right) + 5.0625 \cdot \left({a}^{4} \cdot {c}^{4}\right)}{a \cdot {b}^{7}}\right)}\right) \]
      10. Step-by-step derivation
        1. fma-define91.8%

          \[\leadsto \mathsf{fma}\left(-0.5, \frac{c}{b}, \color{blue}{\mathsf{fma}\left(-0.5625, \frac{{a}^{2} \cdot {c}^{3}}{{b}^{5}}, -0.375 \cdot \frac{a \cdot {c}^{2}}{{b}^{3}} + -0.16666666666666666 \cdot \frac{1.265625 \cdot \left({a}^{4} \cdot {c}^{4}\right) + 5.0625 \cdot \left({a}^{4} \cdot {c}^{4}\right)}{a \cdot {b}^{7}}\right)}\right) \]
        2. associate-/l*91.8%

          \[\leadsto \mathsf{fma}\left(-0.5, \frac{c}{b}, \mathsf{fma}\left(-0.5625, \color{blue}{{a}^{2} \cdot \frac{{c}^{3}}{{b}^{5}}}, -0.375 \cdot \frac{a \cdot {c}^{2}}{{b}^{3}} + -0.16666666666666666 \cdot \frac{1.265625 \cdot \left({a}^{4} \cdot {c}^{4}\right) + 5.0625 \cdot \left({a}^{4} \cdot {c}^{4}\right)}{a \cdot {b}^{7}}\right)\right) \]
        3. +-commutative91.8%

          \[\leadsto \mathsf{fma}\left(-0.5, \frac{c}{b}, \mathsf{fma}\left(-0.5625, {a}^{2} \cdot \frac{{c}^{3}}{{b}^{5}}, \color{blue}{-0.16666666666666666 \cdot \frac{1.265625 \cdot \left({a}^{4} \cdot {c}^{4}\right) + 5.0625 \cdot \left({a}^{4} \cdot {c}^{4}\right)}{a \cdot {b}^{7}} + -0.375 \cdot \frac{a \cdot {c}^{2}}{{b}^{3}}}\right)\right) \]
        4. fma-define91.8%

          \[\leadsto \mathsf{fma}\left(-0.5, \frac{c}{b}, \mathsf{fma}\left(-0.5625, {a}^{2} \cdot \frac{{c}^{3}}{{b}^{5}}, \color{blue}{\mathsf{fma}\left(-0.16666666666666666, \frac{1.265625 \cdot \left({a}^{4} \cdot {c}^{4}\right) + 5.0625 \cdot \left({a}^{4} \cdot {c}^{4}\right)}{a \cdot {b}^{7}}, -0.375 \cdot \frac{a \cdot {c}^{2}}{{b}^{3}}\right)}\right)\right) \]
      11. Simplified91.8%

        \[\leadsto \mathsf{fma}\left(-0.5, \frac{c}{b}, \color{blue}{\mathsf{fma}\left(-0.5625, {a}^{2} \cdot \frac{{c}^{3}}{{b}^{5}}, \mathsf{fma}\left(-0.16666666666666666, \frac{{\left(a \cdot c\right)}^{4}}{a} \cdot \frac{6.328125}{{b}^{7}}, -0.375 \cdot \left(a \cdot \frac{{c}^{2}}{{b}^{3}}\right)\right)\right)}\right) \]
    3. Recombined 2 regimes into one program.
    4. Final simplification91.3%

      \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq 0.125:\\ \;\;\;\;\frac{\sqrt{\mathsf{fma}\left(a \cdot c, -3, {b}^{2}\right)} - b}{a \cdot 3}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(-0.5, \frac{c}{b}, \mathsf{fma}\left(-0.5625, {a}^{2} \cdot \frac{{c}^{3}}{{b}^{5}}, \mathsf{fma}\left(-0.16666666666666666, \frac{{\left(a \cdot c\right)}^{4}}{a} \cdot \frac{6.328125}{{b}^{7}}, -0.375 \cdot \left(a \cdot \frac{{c}^{2}}{{b}^{3}}\right)\right)\right)\right)\\ \end{array} \]
    5. Add Preprocessing

    Alternative 3: 91.9% accurate, 0.1× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq 0.12:\\ \;\;\;\;\frac{\sqrt{\mathsf{fma}\left(a \cdot c, -3, {b}^{2}\right)} - b}{a \cdot 3}\\ \mathbf{else}:\\ \;\;\;\;-0.5625 \cdot \frac{{a}^{2} \cdot {c}^{3}}{{b}^{5}} + \left(-0.5 \cdot \frac{c}{b} + \left(-0.375 \cdot \frac{a \cdot {c}^{2}}{{b}^{3}} + -0.16666666666666666 \cdot \frac{5.0625 \cdot \left({a}^{4} \cdot {c}^{4}\right) + {\left(a \cdot c\right)}^{4} \cdot 1.265625}{a \cdot {b}^{7}}\right)\right)\\ \end{array} \end{array} \]
    (FPCore (a b c)
     :precision binary64
     (if (<= b 0.12)
       (/ (- (sqrt (fma (* a c) -3.0 (pow b 2.0))) b) (* a 3.0))
       (+
        (* -0.5625 (/ (* (pow a 2.0) (pow c 3.0)) (pow b 5.0)))
        (+
         (* -0.5 (/ c b))
         (+
          (* -0.375 (/ (* a (pow c 2.0)) (pow b 3.0)))
          (*
           -0.16666666666666666
           (/
            (+
             (* 5.0625 (* (pow a 4.0) (pow c 4.0)))
             (* (pow (* a c) 4.0) 1.265625))
            (* a (pow b 7.0)))))))))
    double code(double a, double b, double c) {
    	double tmp;
    	if (b <= 0.12) {
    		tmp = (sqrt(fma((a * c), -3.0, pow(b, 2.0))) - b) / (a * 3.0);
    	} else {
    		tmp = (-0.5625 * ((pow(a, 2.0) * pow(c, 3.0)) / pow(b, 5.0))) + ((-0.5 * (c / b)) + ((-0.375 * ((a * pow(c, 2.0)) / pow(b, 3.0))) + (-0.16666666666666666 * (((5.0625 * (pow(a, 4.0) * pow(c, 4.0))) + (pow((a * c), 4.0) * 1.265625)) / (a * pow(b, 7.0))))));
    	}
    	return tmp;
    }
    
    function code(a, b, c)
    	tmp = 0.0
    	if (b <= 0.12)
    		tmp = Float64(Float64(sqrt(fma(Float64(a * c), -3.0, (b ^ 2.0))) - b) / Float64(a * 3.0));
    	else
    		tmp = Float64(Float64(-0.5625 * Float64(Float64((a ^ 2.0) * (c ^ 3.0)) / (b ^ 5.0))) + Float64(Float64(-0.5 * Float64(c / b)) + Float64(Float64(-0.375 * Float64(Float64(a * (c ^ 2.0)) / (b ^ 3.0))) + Float64(-0.16666666666666666 * Float64(Float64(Float64(5.0625 * Float64((a ^ 4.0) * (c ^ 4.0))) + Float64((Float64(a * c) ^ 4.0) * 1.265625)) / Float64(a * (b ^ 7.0)))))));
    	end
    	return tmp
    end
    
    code[a_, b_, c_] := If[LessEqual[b, 0.12], N[(N[(N[Sqrt[N[(N[(a * c), $MachinePrecision] * -3.0 + N[Power[b, 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision] / N[(a * 3.0), $MachinePrecision]), $MachinePrecision], N[(N[(-0.5625 * N[(N[(N[Power[a, 2.0], $MachinePrecision] * N[Power[c, 3.0], $MachinePrecision]), $MachinePrecision] / N[Power[b, 5.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(-0.5 * N[(c / b), $MachinePrecision]), $MachinePrecision] + N[(N[(-0.375 * N[(N[(a * N[Power[c, 2.0], $MachinePrecision]), $MachinePrecision] / N[Power[b, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(-0.16666666666666666 * N[(N[(N[(5.0625 * N[(N[Power[a, 4.0], $MachinePrecision] * N[Power[c, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Power[N[(a * c), $MachinePrecision], 4.0], $MachinePrecision] * 1.265625), $MachinePrecision]), $MachinePrecision] / N[(a * N[Power[b, 7.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    \mathbf{if}\;b \leq 0.12:\\
    \;\;\;\;\frac{\sqrt{\mathsf{fma}\left(a \cdot c, -3, {b}^{2}\right)} - b}{a \cdot 3}\\
    
    \mathbf{else}:\\
    \;\;\;\;-0.5625 \cdot \frac{{a}^{2} \cdot {c}^{3}}{{b}^{5}} + \left(-0.5 \cdot \frac{c}{b} + \left(-0.375 \cdot \frac{a \cdot {c}^{2}}{{b}^{3}} + -0.16666666666666666 \cdot \frac{5.0625 \cdot \left({a}^{4} \cdot {c}^{4}\right) + {\left(a \cdot c\right)}^{4} \cdot 1.265625}{a \cdot {b}^{7}}\right)\right)\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if b < 0.12

      1. Initial program 87.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-neg87.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-neg87.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*86.9%

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

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

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

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

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

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

      if 0.12 < b

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

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

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

        \[\leadsto \color{blue}{-0.5625 \cdot \frac{{a}^{2} \cdot {c}^{3}}{{b}^{5}} + \left(-0.5 \cdot \frac{c}{b} + \left(-0.375 \cdot \frac{a \cdot {c}^{2}}{{b}^{3}} + -0.16666666666666666 \cdot \frac{5.0625 \cdot \left({a}^{4} \cdot {c}^{4}\right) + {\left(-1.125 \cdot \left({a}^{2} \cdot {c}^{2}\right)\right)}^{2}}{a \cdot {b}^{7}}\right)\right)} \]
      6. Step-by-step derivation
        1. *-commutative91.7%

          \[\leadsto -0.5625 \cdot \frac{{a}^{2} \cdot {c}^{3}}{{b}^{5}} + \left(-0.5 \cdot \frac{c}{b} + \left(-0.375 \cdot \frac{a \cdot {c}^{2}}{{b}^{3}} + -0.16666666666666666 \cdot \frac{5.0625 \cdot \left({a}^{4} \cdot {c}^{4}\right) + {\color{blue}{\left(\left({a}^{2} \cdot {c}^{2}\right) \cdot -1.125\right)}}^{2}}{a \cdot {b}^{7}}\right)\right) \]
        2. unpow-prod-down91.7%

          \[\leadsto -0.5625 \cdot \frac{{a}^{2} \cdot {c}^{3}}{{b}^{5}} + \left(-0.5 \cdot \frac{c}{b} + \left(-0.375 \cdot \frac{a \cdot {c}^{2}}{{b}^{3}} + -0.16666666666666666 \cdot \frac{5.0625 \cdot \left({a}^{4} \cdot {c}^{4}\right) + \color{blue}{{\left({a}^{2} \cdot {c}^{2}\right)}^{2} \cdot {-1.125}^{2}}}{a \cdot {b}^{7}}\right)\right) \]
        3. pow-prod-down91.7%

          \[\leadsto -0.5625 \cdot \frac{{a}^{2} \cdot {c}^{3}}{{b}^{5}} + \left(-0.5 \cdot \frac{c}{b} + \left(-0.375 \cdot \frac{a \cdot {c}^{2}}{{b}^{3}} + -0.16666666666666666 \cdot \frac{5.0625 \cdot \left({a}^{4} \cdot {c}^{4}\right) + {\color{blue}{\left({\left(a \cdot c\right)}^{2}\right)}}^{2} \cdot {-1.125}^{2}}{a \cdot {b}^{7}}\right)\right) \]
        4. pow-pow91.7%

          \[\leadsto -0.5625 \cdot \frac{{a}^{2} \cdot {c}^{3}}{{b}^{5}} + \left(-0.5 \cdot \frac{c}{b} + \left(-0.375 \cdot \frac{a \cdot {c}^{2}}{{b}^{3}} + -0.16666666666666666 \cdot \frac{5.0625 \cdot \left({a}^{4} \cdot {c}^{4}\right) + \color{blue}{{\left(a \cdot c\right)}^{\left(2 \cdot 2\right)}} \cdot {-1.125}^{2}}{a \cdot {b}^{7}}\right)\right) \]
        5. metadata-eval91.7%

          \[\leadsto -0.5625 \cdot \frac{{a}^{2} \cdot {c}^{3}}{{b}^{5}} + \left(-0.5 \cdot \frac{c}{b} + \left(-0.375 \cdot \frac{a \cdot {c}^{2}}{{b}^{3}} + -0.16666666666666666 \cdot \frac{5.0625 \cdot \left({a}^{4} \cdot {c}^{4}\right) + {\left(a \cdot c\right)}^{\color{blue}{4}} \cdot {-1.125}^{2}}{a \cdot {b}^{7}}\right)\right) \]
        6. metadata-eval91.7%

          \[\leadsto -0.5625 \cdot \frac{{a}^{2} \cdot {c}^{3}}{{b}^{5}} + \left(-0.5 \cdot \frac{c}{b} + \left(-0.375 \cdot \frac{a \cdot {c}^{2}}{{b}^{3}} + -0.16666666666666666 \cdot \frac{5.0625 \cdot \left({a}^{4} \cdot {c}^{4}\right) + {\left(a \cdot c\right)}^{4} \cdot \color{blue}{1.265625}}{a \cdot {b}^{7}}\right)\right) \]
      7. Applied egg-rr91.7%

        \[\leadsto -0.5625 \cdot \frac{{a}^{2} \cdot {c}^{3}}{{b}^{5}} + \left(-0.5 \cdot \frac{c}{b} + \left(-0.375 \cdot \frac{a \cdot {c}^{2}}{{b}^{3}} + -0.16666666666666666 \cdot \frac{5.0625 \cdot \left({a}^{4} \cdot {c}^{4}\right) + \color{blue}{{\left(a \cdot c\right)}^{4} \cdot 1.265625}}{a \cdot {b}^{7}}\right)\right) \]
    3. Recombined 2 regimes into one program.
    4. Final simplification91.3%

      \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq 0.12:\\ \;\;\;\;\frac{\sqrt{\mathsf{fma}\left(a \cdot c, -3, {b}^{2}\right)} - b}{a \cdot 3}\\ \mathbf{else}:\\ \;\;\;\;-0.5625 \cdot \frac{{a}^{2} \cdot {c}^{3}}{{b}^{5}} + \left(-0.5 \cdot \frac{c}{b} + \left(-0.375 \cdot \frac{a \cdot {c}^{2}}{{b}^{3}} + -0.16666666666666666 \cdot \frac{5.0625 \cdot \left({a}^{4} \cdot {c}^{4}\right) + {\left(a \cdot c\right)}^{4} \cdot 1.265625}{a \cdot {b}^{7}}\right)\right)\\ \end{array} \]
    5. Add Preprocessing

    Alternative 4: 88.5% accurate, 0.2× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq 30:\\ \;\;\;\;\frac{\sqrt{\mathsf{fma}\left(a \cdot c, -3, {b}^{2}\right)} - b}{a \cdot 3}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(-0.5, \frac{c}{b}, -0.5625 \cdot \frac{{a}^{2} \cdot {c}^{3}}{{b}^{5}} + -0.375 \cdot \frac{a \cdot {c}^{2}}{{b}^{3}}\right)\\ \end{array} \end{array} \]
    (FPCore (a b c)
     :precision binary64
     (if (<= b 30.0)
       (/ (- (sqrt (fma (* a c) -3.0 (pow b 2.0))) b) (* a 3.0))
       (fma
        -0.5
        (/ c b)
        (+
         (* -0.5625 (/ (* (pow a 2.0) (pow c 3.0)) (pow b 5.0)))
         (* -0.375 (/ (* a (pow c 2.0)) (pow b 3.0)))))))
    double code(double a, double b, double c) {
    	double tmp;
    	if (b <= 30.0) {
    		tmp = (sqrt(fma((a * c), -3.0, pow(b, 2.0))) - b) / (a * 3.0);
    	} else {
    		tmp = fma(-0.5, (c / b), ((-0.5625 * ((pow(a, 2.0) * pow(c, 3.0)) / pow(b, 5.0))) + (-0.375 * ((a * pow(c, 2.0)) / pow(b, 3.0)))));
    	}
    	return tmp;
    }
    
    function code(a, b, c)
    	tmp = 0.0
    	if (b <= 30.0)
    		tmp = Float64(Float64(sqrt(fma(Float64(a * c), -3.0, (b ^ 2.0))) - b) / Float64(a * 3.0));
    	else
    		tmp = fma(-0.5, Float64(c / b), Float64(Float64(-0.5625 * Float64(Float64((a ^ 2.0) * (c ^ 3.0)) / (b ^ 5.0))) + Float64(-0.375 * Float64(Float64(a * (c ^ 2.0)) / (b ^ 3.0)))));
    	end
    	return tmp
    end
    
    code[a_, b_, c_] := If[LessEqual[b, 30.0], N[(N[(N[Sqrt[N[(N[(a * c), $MachinePrecision] * -3.0 + N[Power[b, 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision] / N[(a * 3.0), $MachinePrecision]), $MachinePrecision], N[(-0.5 * N[(c / b), $MachinePrecision] + N[(N[(-0.5625 * N[(N[(N[Power[a, 2.0], $MachinePrecision] * N[Power[c, 3.0], $MachinePrecision]), $MachinePrecision] / N[Power[b, 5.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(-0.375 * N[(N[(a * N[Power[c, 2.0], $MachinePrecision]), $MachinePrecision] / N[Power[b, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    \mathbf{if}\;b \leq 30:\\
    \;\;\;\;\frac{\sqrt{\mathsf{fma}\left(a \cdot c, -3, {b}^{2}\right)} - b}{a \cdot 3}\\
    
    \mathbf{else}:\\
    \;\;\;\;\mathsf{fma}\left(-0.5, \frac{c}{b}, -0.5625 \cdot \frac{{a}^{2} \cdot {c}^{3}}{{b}^{5}} + -0.375 \cdot \frac{a \cdot {c}^{2}}{{b}^{3}}\right)\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if b < 30

      1. Initial program 81.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-neg81.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-neg81.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*81.6%

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

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

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

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

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

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

      if 30 < b

      1. Initial program 49.2%

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

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

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

        \[\leadsto \color{blue}{\frac{\sqrt{\mathsf{fma}\left(b, b, a \cdot \left(c \cdot -3\right)\right)} - b}{3 \cdot a}} \]
      4. Add Preprocessing
      5. Step-by-step derivation
        1. associate-*r*49.1%

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

          \[\leadsto \frac{\sqrt{\mathsf{fma}\left(b, b, \left(a \cdot c\right) \cdot \color{blue}{\left(-3\right)}\right)} - b}{3 \cdot a} \]
        3. distribute-rgt-neg-in49.1%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(-0.5, \frac{c}{b}, -0.16666666666666666 \cdot \left(\left(\frac{{\left(a \cdot c\right)}^{2} \cdot 2.25 + 0}{a \cdot {b}^{3}} + \frac{\mathsf{fma}\left(1.5, \left(a \cdot c\right) \cdot \left({\left(a \cdot c\right)}^{2} \cdot 2.25 + 0\right), \left(-3 \cdot a\right) \cdot \left(c \cdot 0\right)\right)}{a \cdot {b}^{5}}\right) + \frac{\left({\left(0 + -0.5 \cdot \left({\left(a \cdot c\right)}^{2} \cdot 2.25\right)\right)}^{2} + 0\right) + \mathsf{fma}\left(1.5, \left(a \cdot c\right) \cdot \mathsf{fma}\left(1.5, \left(a \cdot c\right) \cdot \left({\left(a \cdot c\right)}^{2} \cdot 2.25 + 0\right), \left(-3 \cdot a\right) \cdot \left(c \cdot 0\right)\right), 0\right)}{a \cdot {b}^{7}}\right)\right)} \]
      9. Taylor expanded in a around 0 91.4%

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

      \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq 30:\\ \;\;\;\;\frac{\sqrt{\mathsf{fma}\left(a \cdot c, -3, {b}^{2}\right)} - b}{a \cdot 3}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(-0.5, \frac{c}{b}, -0.5625 \cdot \frac{{a}^{2} \cdot {c}^{3}}{{b}^{5}} + -0.375 \cdot \frac{a \cdot {c}^{2}}{{b}^{3}}\right)\\ \end{array} \]
    5. Add Preprocessing

    Alternative 5: 88.5% accurate, 0.2× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq 30:\\ \;\;\;\;\frac{\sqrt{\mathsf{fma}\left(a \cdot c, -3, {b}^{2}\right)} - b}{a \cdot 3}\\ \mathbf{else}:\\ \;\;\;\;-0.5625 \cdot \frac{{a}^{2} \cdot {c}^{3}}{{b}^{5}} + \left(-0.5 \cdot \frac{c}{b} + -0.375 \cdot \frac{a \cdot {c}^{2}}{{b}^{3}}\right)\\ \end{array} \end{array} \]
    (FPCore (a b c)
     :precision binary64
     (if (<= b 30.0)
       (/ (- (sqrt (fma (* a c) -3.0 (pow b 2.0))) b) (* a 3.0))
       (+
        (* -0.5625 (/ (* (pow a 2.0) (pow c 3.0)) (pow b 5.0)))
        (+ (* -0.5 (/ c b)) (* -0.375 (/ (* a (pow c 2.0)) (pow b 3.0)))))))
    double code(double a, double b, double c) {
    	double tmp;
    	if (b <= 30.0) {
    		tmp = (sqrt(fma((a * c), -3.0, pow(b, 2.0))) - b) / (a * 3.0);
    	} else {
    		tmp = (-0.5625 * ((pow(a, 2.0) * pow(c, 3.0)) / pow(b, 5.0))) + ((-0.5 * (c / b)) + (-0.375 * ((a * pow(c, 2.0)) / pow(b, 3.0))));
    	}
    	return tmp;
    }
    
    function code(a, b, c)
    	tmp = 0.0
    	if (b <= 30.0)
    		tmp = Float64(Float64(sqrt(fma(Float64(a * c), -3.0, (b ^ 2.0))) - b) / Float64(a * 3.0));
    	else
    		tmp = Float64(Float64(-0.5625 * Float64(Float64((a ^ 2.0) * (c ^ 3.0)) / (b ^ 5.0))) + Float64(Float64(-0.5 * Float64(c / b)) + Float64(-0.375 * Float64(Float64(a * (c ^ 2.0)) / (b ^ 3.0)))));
    	end
    	return tmp
    end
    
    code[a_, b_, c_] := If[LessEqual[b, 30.0], N[(N[(N[Sqrt[N[(N[(a * c), $MachinePrecision] * -3.0 + N[Power[b, 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision] / N[(a * 3.0), $MachinePrecision]), $MachinePrecision], N[(N[(-0.5625 * N[(N[(N[Power[a, 2.0], $MachinePrecision] * N[Power[c, 3.0], $MachinePrecision]), $MachinePrecision] / N[Power[b, 5.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(-0.5 * N[(c / b), $MachinePrecision]), $MachinePrecision] + N[(-0.375 * N[(N[(a * N[Power[c, 2.0], $MachinePrecision]), $MachinePrecision] / N[Power[b, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    \mathbf{if}\;b \leq 30:\\
    \;\;\;\;\frac{\sqrt{\mathsf{fma}\left(a \cdot c, -3, {b}^{2}\right)} - b}{a \cdot 3}\\
    
    \mathbf{else}:\\
    \;\;\;\;-0.5625 \cdot \frac{{a}^{2} \cdot {c}^{3}}{{b}^{5}} + \left(-0.5 \cdot \frac{c}{b} + -0.375 \cdot \frac{a \cdot {c}^{2}}{{b}^{3}}\right)\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if b < 30

      1. Initial program 81.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-neg81.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-neg81.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*81.6%

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

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

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

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

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

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

      if 30 < b

      1. Initial program 49.2%

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

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

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

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

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

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

      \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq 30:\\ \;\;\;\;\frac{\sqrt{\mathsf{fma}\left(a \cdot c, -3, {b}^{2}\right)} - b}{a \cdot 3}\\ \mathbf{else}:\\ \;\;\;\;-0.5625 \cdot \frac{{a}^{2} \cdot {c}^{3}}{{b}^{5}} + \left(-0.5 \cdot \frac{c}{b} + -0.375 \cdot \frac{a \cdot {c}^{2}}{{b}^{3}}\right)\\ \end{array} \]
    5. Add Preprocessing

    Alternative 6: 85.2% accurate, 0.3× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\frac{\sqrt{b \cdot b - c \cdot \left(a \cdot 3\right)} - b}{a \cdot 3} \leq -0.0004:\\ \;\;\;\;\frac{\sqrt{\mathsf{fma}\left(a \cdot c, -3, {b}^{2}\right)} - b}{a \cdot 3}\\ \mathbf{else}:\\ \;\;\;\;-0.5 \cdot \frac{c}{b} + -0.375 \cdot \frac{a \cdot {c}^{2}}{{b}^{3}}\\ \end{array} \end{array} \]
    (FPCore (a b c)
     :precision binary64
     (if (<= (/ (- (sqrt (- (* b b) (* c (* a 3.0)))) b) (* a 3.0)) -0.0004)
       (/ (- (sqrt (fma (* a c) -3.0 (pow b 2.0))) b) (* a 3.0))
       (+ (* -0.5 (/ c b)) (* -0.375 (/ (* a (pow c 2.0)) (pow b 3.0))))))
    double code(double a, double b, double c) {
    	double tmp;
    	if (((sqrt(((b * b) - (c * (a * 3.0)))) - b) / (a * 3.0)) <= -0.0004) {
    		tmp = (sqrt(fma((a * c), -3.0, pow(b, 2.0))) - b) / (a * 3.0);
    	} else {
    		tmp = (-0.5 * (c / b)) + (-0.375 * ((a * pow(c, 2.0)) / pow(b, 3.0)));
    	}
    	return tmp;
    }
    
    function code(a, b, c)
    	tmp = 0.0
    	if (Float64(Float64(sqrt(Float64(Float64(b * b) - Float64(c * Float64(a * 3.0)))) - b) / Float64(a * 3.0)) <= -0.0004)
    		tmp = Float64(Float64(sqrt(fma(Float64(a * c), -3.0, (b ^ 2.0))) - b) / Float64(a * 3.0));
    	else
    		tmp = Float64(Float64(-0.5 * Float64(c / b)) + Float64(-0.375 * Float64(Float64(a * (c ^ 2.0)) / (b ^ 3.0))));
    	end
    	return tmp
    end
    
    code[a_, b_, c_] := If[LessEqual[N[(N[(N[Sqrt[N[(N[(b * b), $MachinePrecision] - N[(c * N[(a * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision] / N[(a * 3.0), $MachinePrecision]), $MachinePrecision], -0.0004], N[(N[(N[Sqrt[N[(N[(a * c), $MachinePrecision] * -3.0 + N[Power[b, 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision] / N[(a * 3.0), $MachinePrecision]), $MachinePrecision], N[(N[(-0.5 * N[(c / b), $MachinePrecision]), $MachinePrecision] + N[(-0.375 * N[(N[(a * N[Power[c, 2.0], $MachinePrecision]), $MachinePrecision] / N[Power[b, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    \mathbf{if}\;\frac{\sqrt{b \cdot b - c \cdot \left(a \cdot 3\right)} - b}{a \cdot 3} \leq -0.0004:\\
    \;\;\;\;\frac{\sqrt{\mathsf{fma}\left(a \cdot c, -3, {b}^{2}\right)} - b}{a \cdot 3}\\
    
    \mathbf{else}:\\
    \;\;\;\;-0.5 \cdot \frac{c}{b} + -0.375 \cdot \frac{a \cdot {c}^{2}}{{b}^{3}}\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if (/.f64 (+.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 3 a) c)))) (*.f64 3 a)) < -4.00000000000000019e-4

      1. Initial program 77.5%

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

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

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

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

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

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

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

          \[\leadsto \frac{\left(-b\right) + \sqrt{\color{blue}{\mathsf{fma}\left(a \cdot c, -3, {b}^{2}\right)}}}{3 \cdot a} \]
      7. Simplified77.6%

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

      if -4.00000000000000019e-4 < (/.f64 (+.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 3 a) c)))) (*.f64 3 a))

      1. Initial program 41.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-neg41.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-neg41.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*41.4%

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

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

      \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{\sqrt{b \cdot b - c \cdot \left(a \cdot 3\right)} - b}{a \cdot 3} \leq -0.0004:\\ \;\;\;\;\frac{\sqrt{\mathsf{fma}\left(a \cdot c, -3, {b}^{2}\right)} - b}{a \cdot 3}\\ \mathbf{else}:\\ \;\;\;\;-0.5 \cdot \frac{c}{b} + -0.375 \cdot \frac{a \cdot {c}^{2}}{{b}^{3}}\\ \end{array} \]
    5. Add Preprocessing

    Alternative 7: 85.2% accurate, 0.3× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\frac{\sqrt{b \cdot b - c \cdot \left(a \cdot 3\right)} - b}{a \cdot 3} \leq -0.0004:\\ \;\;\;\;\frac{\sqrt{\mathsf{fma}\left(b, b, a \cdot \left(c \cdot -3\right)\right)} - b}{a \cdot 3}\\ \mathbf{else}:\\ \;\;\;\;-0.5 \cdot \frac{c}{b} + -0.375 \cdot \frac{a \cdot {c}^{2}}{{b}^{3}}\\ \end{array} \end{array} \]
    (FPCore (a b c)
     :precision binary64
     (if (<= (/ (- (sqrt (- (* b b) (* c (* a 3.0)))) b) (* a 3.0)) -0.0004)
       (/ (- (sqrt (fma b b (* a (* c -3.0)))) b) (* a 3.0))
       (+ (* -0.5 (/ c b)) (* -0.375 (/ (* a (pow c 2.0)) (pow b 3.0))))))
    double code(double a, double b, double c) {
    	double tmp;
    	if (((sqrt(((b * b) - (c * (a * 3.0)))) - b) / (a * 3.0)) <= -0.0004) {
    		tmp = (sqrt(fma(b, b, (a * (c * -3.0)))) - b) / (a * 3.0);
    	} else {
    		tmp = (-0.5 * (c / b)) + (-0.375 * ((a * pow(c, 2.0)) / pow(b, 3.0)));
    	}
    	return tmp;
    }
    
    function code(a, b, c)
    	tmp = 0.0
    	if (Float64(Float64(sqrt(Float64(Float64(b * b) - Float64(c * Float64(a * 3.0)))) - b) / Float64(a * 3.0)) <= -0.0004)
    		tmp = Float64(Float64(sqrt(fma(b, b, Float64(a * Float64(c * -3.0)))) - b) / Float64(a * 3.0));
    	else
    		tmp = Float64(Float64(-0.5 * Float64(c / b)) + Float64(-0.375 * Float64(Float64(a * (c ^ 2.0)) / (b ^ 3.0))));
    	end
    	return tmp
    end
    
    code[a_, b_, c_] := If[LessEqual[N[(N[(N[Sqrt[N[(N[(b * b), $MachinePrecision] - N[(c * N[(a * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision] / N[(a * 3.0), $MachinePrecision]), $MachinePrecision], -0.0004], N[(N[(N[Sqrt[N[(b * b + N[(a * N[(c * -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision] / N[(a * 3.0), $MachinePrecision]), $MachinePrecision], N[(N[(-0.5 * N[(c / b), $MachinePrecision]), $MachinePrecision] + N[(-0.375 * N[(N[(a * N[Power[c, 2.0], $MachinePrecision]), $MachinePrecision] / N[Power[b, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    \mathbf{if}\;\frac{\sqrt{b \cdot b - c \cdot \left(a \cdot 3\right)} - b}{a \cdot 3} \leq -0.0004:\\
    \;\;\;\;\frac{\sqrt{\mathsf{fma}\left(b, b, a \cdot \left(c \cdot -3\right)\right)} - b}{a \cdot 3}\\
    
    \mathbf{else}:\\
    \;\;\;\;-0.5 \cdot \frac{c}{b} + -0.375 \cdot \frac{a \cdot {c}^{2}}{{b}^{3}}\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if (/.f64 (+.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 3 a) c)))) (*.f64 3 a)) < -4.00000000000000019e-4

      1. Initial program 77.5%

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

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

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

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

      if -4.00000000000000019e-4 < (/.f64 (+.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 3 a) c)))) (*.f64 3 a))

      1. Initial program 41.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-neg41.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-neg41.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*41.4%

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

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

      \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{\sqrt{b \cdot b - c \cdot \left(a \cdot 3\right)} - b}{a \cdot 3} \leq -0.0004:\\ \;\;\;\;\frac{\sqrt{\mathsf{fma}\left(b, b, a \cdot \left(c \cdot -3\right)\right)} - b}{a \cdot 3}\\ \mathbf{else}:\\ \;\;\;\;-0.5 \cdot \frac{c}{b} + -0.375 \cdot \frac{a \cdot {c}^{2}}{{b}^{3}}\\ \end{array} \]
    5. Add Preprocessing

    Alternative 8: 75.6% accurate, 0.3× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\frac{\sqrt{b \cdot b - c \cdot \left(a \cdot 3\right)} - b}{a \cdot 3} \leq -0.00037:\\ \;\;\;\;\frac{\sqrt{\mathsf{fma}\left(b, b, a \cdot \left(c \cdot -3\right)\right)} - b}{a \cdot 3}\\ \mathbf{else}:\\ \;\;\;\;\frac{c \cdot -0.5}{b}\\ \end{array} \end{array} \]
    (FPCore (a b c)
     :precision binary64
     (if (<= (/ (- (sqrt (- (* b b) (* c (* a 3.0)))) b) (* a 3.0)) -0.00037)
       (/ (- (sqrt (fma b b (* a (* c -3.0)))) b) (* a 3.0))
       (/ (* c -0.5) b)))
    double code(double a, double b, double c) {
    	double tmp;
    	if (((sqrt(((b * b) - (c * (a * 3.0)))) - b) / (a * 3.0)) <= -0.00037) {
    		tmp = (sqrt(fma(b, b, (a * (c * -3.0)))) - b) / (a * 3.0);
    	} else {
    		tmp = (c * -0.5) / b;
    	}
    	return tmp;
    }
    
    function code(a, b, c)
    	tmp = 0.0
    	if (Float64(Float64(sqrt(Float64(Float64(b * b) - Float64(c * Float64(a * 3.0)))) - b) / Float64(a * 3.0)) <= -0.00037)
    		tmp = Float64(Float64(sqrt(fma(b, b, Float64(a * Float64(c * -3.0)))) - b) / Float64(a * 3.0));
    	else
    		tmp = Float64(Float64(c * -0.5) / b);
    	end
    	return tmp
    end
    
    code[a_, b_, c_] := If[LessEqual[N[(N[(N[Sqrt[N[(N[(b * b), $MachinePrecision] - N[(c * N[(a * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision] / N[(a * 3.0), $MachinePrecision]), $MachinePrecision], -0.00037], N[(N[(N[Sqrt[N[(b * b + N[(a * N[(c * -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision] / N[(a * 3.0), $MachinePrecision]), $MachinePrecision], N[(N[(c * -0.5), $MachinePrecision] / b), $MachinePrecision]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    \mathbf{if}\;\frac{\sqrt{b \cdot b - c \cdot \left(a \cdot 3\right)} - b}{a \cdot 3} \leq -0.00037:\\
    \;\;\;\;\frac{\sqrt{\mathsf{fma}\left(b, b, a \cdot \left(c \cdot -3\right)\right)} - b}{a \cdot 3}\\
    
    \mathbf{else}:\\
    \;\;\;\;\frac{c \cdot -0.5}{b}\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if (/.f64 (+.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 3 a) c)))) (*.f64 3 a)) < -3.6999999999999999e-4

      1. Initial program 77.5%

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

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

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

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

      if -3.6999999999999999e-4 < (/.f64 (+.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 3 a) c)))) (*.f64 3 a))

      1. Initial program 41.2%

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

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

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

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

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

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

          \[\leadsto \color{blue}{\frac{c}{b} \cdot -0.5} \]
        2. associate-*l/76.8%

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

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

      \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{\sqrt{b \cdot b - c \cdot \left(a \cdot 3\right)} - b}{a \cdot 3} \leq -0.00037:\\ \;\;\;\;\frac{\sqrt{\mathsf{fma}\left(b, b, a \cdot \left(c \cdot -3\right)\right)} - b}{a \cdot 3}\\ \mathbf{else}:\\ \;\;\;\;\frac{c \cdot -0.5}{b}\\ \end{array} \]
    5. Add Preprocessing

    Alternative 9: 75.6% accurate, 0.5× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{\sqrt{b \cdot b - c \cdot \left(a \cdot 3\right)} - b}{a \cdot 3}\\ \mathbf{if}\;t\_0 \leq -0.00037:\\ \;\;\;\;t\_0\\ \mathbf{else}:\\ \;\;\;\;\frac{c \cdot -0.5}{b}\\ \end{array} \end{array} \]
    (FPCore (a b c)
     :precision binary64
     (let* ((t_0 (/ (- (sqrt (- (* b b) (* c (* a 3.0)))) b) (* a 3.0))))
       (if (<= t_0 -0.00037) t_0 (/ (* c -0.5) b))))
    double code(double a, double b, double c) {
    	double t_0 = (sqrt(((b * b) - (c * (a * 3.0)))) - b) / (a * 3.0);
    	double tmp;
    	if (t_0 <= -0.00037) {
    		tmp = t_0;
    	} else {
    		tmp = (c * -0.5) / b;
    	}
    	return tmp;
    }
    
    real(8) function code(a, b, c)
        real(8), intent (in) :: a
        real(8), intent (in) :: b
        real(8), intent (in) :: c
        real(8) :: t_0
        real(8) :: tmp
        t_0 = (sqrt(((b * b) - (c * (a * 3.0d0)))) - b) / (a * 3.0d0)
        if (t_0 <= (-0.00037d0)) then
            tmp = t_0
        else
            tmp = (c * (-0.5d0)) / b
        end if
        code = tmp
    end function
    
    public static double code(double a, double b, double c) {
    	double t_0 = (Math.sqrt(((b * b) - (c * (a * 3.0)))) - b) / (a * 3.0);
    	double tmp;
    	if (t_0 <= -0.00037) {
    		tmp = t_0;
    	} else {
    		tmp = (c * -0.5) / b;
    	}
    	return tmp;
    }
    
    def code(a, b, c):
    	t_0 = (math.sqrt(((b * b) - (c * (a * 3.0)))) - b) / (a * 3.0)
    	tmp = 0
    	if t_0 <= -0.00037:
    		tmp = t_0
    	else:
    		tmp = (c * -0.5) / b
    	return tmp
    
    function code(a, b, c)
    	t_0 = Float64(Float64(sqrt(Float64(Float64(b * b) - Float64(c * Float64(a * 3.0)))) - b) / Float64(a * 3.0))
    	tmp = 0.0
    	if (t_0 <= -0.00037)
    		tmp = t_0;
    	else
    		tmp = Float64(Float64(c * -0.5) / b);
    	end
    	return tmp
    end
    
    function tmp_2 = code(a, b, c)
    	t_0 = (sqrt(((b * b) - (c * (a * 3.0)))) - b) / (a * 3.0);
    	tmp = 0.0;
    	if (t_0 <= -0.00037)
    		tmp = t_0;
    	else
    		tmp = (c * -0.5) / b;
    	end
    	tmp_2 = tmp;
    end
    
    code[a_, b_, c_] := Block[{t$95$0 = N[(N[(N[Sqrt[N[(N[(b * b), $MachinePrecision] - N[(c * N[(a * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision] / N[(a * 3.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -0.00037], t$95$0, N[(N[(c * -0.5), $MachinePrecision] / b), $MachinePrecision]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_0 := \frac{\sqrt{b \cdot b - c \cdot \left(a \cdot 3\right)} - b}{a \cdot 3}\\
    \mathbf{if}\;t\_0 \leq -0.00037:\\
    \;\;\;\;t\_0\\
    
    \mathbf{else}:\\
    \;\;\;\;\frac{c \cdot -0.5}{b}\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if (/.f64 (+.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 3 a) c)))) (*.f64 3 a)) < -3.6999999999999999e-4

      1. Initial program 77.5%

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

      if -3.6999999999999999e-4 < (/.f64 (+.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 3 a) c)))) (*.f64 3 a))

      1. Initial program 41.2%

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

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

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

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

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

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

          \[\leadsto \color{blue}{\frac{c}{b} \cdot -0.5} \]
        2. associate-*l/76.8%

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

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

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

    Alternative 10: 73.6% accurate, 1.0× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq 160:\\ \;\;\;\;\frac{\sqrt{b \cdot b - \left(a \cdot c\right) \cdot 3} - b}{a \cdot 3}\\ \mathbf{else}:\\ \;\;\;\;\frac{c \cdot -0.5}{b}\\ \end{array} \end{array} \]
    (FPCore (a b c)
     :precision binary64
     (if (<= b 160.0)
       (/ (- (sqrt (- (* b b) (* (* a c) 3.0))) b) (* a 3.0))
       (/ (* c -0.5) b)))
    double code(double a, double b, double c) {
    	double tmp;
    	if (b <= 160.0) {
    		tmp = (sqrt(((b * b) - ((a * c) * 3.0))) - b) / (a * 3.0);
    	} else {
    		tmp = (c * -0.5) / b;
    	}
    	return tmp;
    }
    
    real(8) function code(a, b, c)
        real(8), intent (in) :: a
        real(8), intent (in) :: b
        real(8), intent (in) :: c
        real(8) :: tmp
        if (b <= 160.0d0) then
            tmp = (sqrt(((b * b) - ((a * c) * 3.0d0))) - b) / (a * 3.0d0)
        else
            tmp = (c * (-0.5d0)) / b
        end if
        code = tmp
    end function
    
    public static double code(double a, double b, double c) {
    	double tmp;
    	if (b <= 160.0) {
    		tmp = (Math.sqrt(((b * b) - ((a * c) * 3.0))) - b) / (a * 3.0);
    	} else {
    		tmp = (c * -0.5) / b;
    	}
    	return tmp;
    }
    
    def code(a, b, c):
    	tmp = 0
    	if b <= 160.0:
    		tmp = (math.sqrt(((b * b) - ((a * c) * 3.0))) - b) / (a * 3.0)
    	else:
    		tmp = (c * -0.5) / b
    	return tmp
    
    function code(a, b, c)
    	tmp = 0.0
    	if (b <= 160.0)
    		tmp = Float64(Float64(sqrt(Float64(Float64(b * b) - Float64(Float64(a * c) * 3.0))) - b) / Float64(a * 3.0));
    	else
    		tmp = Float64(Float64(c * -0.5) / b);
    	end
    	return tmp
    end
    
    function tmp_2 = code(a, b, c)
    	tmp = 0.0;
    	if (b <= 160.0)
    		tmp = (sqrt(((b * b) - ((a * c) * 3.0))) - b) / (a * 3.0);
    	else
    		tmp = (c * -0.5) / b;
    	end
    	tmp_2 = tmp;
    end
    
    code[a_, b_, c_] := If[LessEqual[b, 160.0], N[(N[(N[Sqrt[N[(N[(b * b), $MachinePrecision] - N[(N[(a * c), $MachinePrecision] * 3.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision] / N[(a * 3.0), $MachinePrecision]), $MachinePrecision], N[(N[(c * -0.5), $MachinePrecision] / b), $MachinePrecision]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    \mathbf{if}\;b \leq 160:\\
    \;\;\;\;\frac{\sqrt{b \cdot b - \left(a \cdot c\right) \cdot 3} - b}{a \cdot 3}\\
    
    \mathbf{else}:\\
    \;\;\;\;\frac{c \cdot -0.5}{b}\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if b < 160

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

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

      if 160 < b

      1. Initial program 46.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-neg46.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-neg46.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*46.1%

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

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

          \[\leadsto \color{blue}{\frac{c}{b} \cdot -0.5} \]
        2. associate-*l/72.7%

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

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

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

    Alternative 11: 64.4% accurate, 23.2× speedup?

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

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

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

        \[\leadsto \color{blue}{\frac{c}{b} \cdot -0.5} \]
      2. associate-*l/63.0%

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

      \[\leadsto \color{blue}{\frac{c \cdot -0.5}{b}} \]
    8. Final simplification63.0%

      \[\leadsto \frac{c \cdot -0.5}{b} \]
    9. Add Preprocessing

    Reproduce

    ?
    herbie shell --seed 2024050 
    (FPCore (a b c)
      :name "Cubic critical, narrow range"
      :precision binary64
      :pre (and (and (and (< 1.0536712127723509e-8 a) (< a 94906265.62425156)) (and (< 1.0536712127723509e-8 b) (< b 94906265.62425156))) (and (< 1.0536712127723509e-8 c) (< c 94906265.62425156)))
      (/ (+ (- b) (sqrt (- (* b b) (* (* 3.0 a) c)))) (* 3.0 a)))