Cubic critical, narrow range

Percentage Accurate: 55.4% → 91.3%
Time: 12.6s
Alternatives: 10
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 10 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.3% accurate, 0.1× speedup?

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

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

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


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

    1. Initial program 88.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. flip-+87.9%

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

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

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

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

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

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

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

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

    if 3.2999999999999998 < b

    1. Initial program 47.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. neg-sub047.5%

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\left(\sqrt{\mathsf{fma}\left(b, b, a \cdot \left(c \cdot -3\right)\right)} - b\right) \cdot \frac{0.3333333333333333}{a}} \]
    4. Step-by-step derivation
      1. expm1-log1p-u47.6%

        \[\leadsto \left(\sqrt{\mathsf{fma}\left(b, b, a \cdot \left(c \cdot -3\right)\right)} - b\right) \cdot \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{0.3333333333333333}{a}\right)\right)} \]
    5. Applied egg-rr47.6%

      \[\leadsto \left(\sqrt{\mathsf{fma}\left(b, b, a \cdot \left(c \cdot -3\right)\right)} - b\right) \cdot \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{0.3333333333333333}{a}\right)\right)} \]
    6. Taylor expanded in b around inf 94.7%

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

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

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

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

Alternative 2: 89.2% accurate, 0.2× speedup?

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

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

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


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

    1. Initial program 84.8%

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

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

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

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

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

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

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

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

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

    if 20 < b

    1. Initial program 45.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-identity45.2%

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{-0.5625 \cdot \frac{{c}^{3} \cdot {a}^{2}}{{b}^{5}} + \left(-0.5 \cdot \frac{c}{b} + -0.375 \cdot \frac{{c}^{2} \cdot a}{{b}^{3}}\right)} \]
    5. Step-by-step derivation
      1. fma-def93.2%

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

        \[\leadsto \mathsf{fma}\left(-0.5625, \color{blue}{\frac{{c}^{3}}{\frac{{b}^{5}}{{a}^{2}}}}, -0.5 \cdot \frac{c}{b} + -0.375 \cdot \frac{{c}^{2} \cdot a}{{b}^{3}}\right) \]
      3. unpow293.2%

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

        \[\leadsto \mathsf{fma}\left(-0.5625, \frac{{c}^{3}}{\frac{{b}^{5}}{a \cdot a}}, \color{blue}{-0.375 \cdot \frac{{c}^{2} \cdot a}{{b}^{3}} + -0.5 \cdot \frac{c}{b}}\right) \]
      5. fma-def93.2%

        \[\leadsto \mathsf{fma}\left(-0.5625, \frac{{c}^{3}}{\frac{{b}^{5}}{a \cdot a}}, \color{blue}{\mathsf{fma}\left(-0.375, \frac{{c}^{2} \cdot a}{{b}^{3}}, -0.5 \cdot \frac{c}{b}\right)}\right) \]
      6. associate-/l*93.2%

        \[\leadsto \mathsf{fma}\left(-0.5625, \frac{{c}^{3}}{\frac{{b}^{5}}{a \cdot a}}, \mathsf{fma}\left(-0.375, \color{blue}{\frac{{c}^{2}}{\frac{{b}^{3}}{a}}}, -0.5 \cdot \frac{c}{b}\right)\right) \]
      7. unpow293.2%

        \[\leadsto \mathsf{fma}\left(-0.5625, \frac{{c}^{3}}{\frac{{b}^{5}}{a \cdot a}}, \mathsf{fma}\left(-0.375, \frac{\color{blue}{c \cdot c}}{\frac{{b}^{3}}{a}}, -0.5 \cdot \frac{c}{b}\right)\right) \]
    6. Simplified93.2%

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

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

Alternative 3: 89.0% accurate, 0.3× speedup?

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

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

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


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

    1. Initial program 84.8%

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

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

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

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

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

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

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

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

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

    if 20 < b

    1. Initial program 45.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-identity45.2%

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{\color{blue}{-0.5 \cdot \frac{c \cdot a}{b} + \left(-0.375 \cdot \frac{{c}^{2} \cdot {a}^{2}}{{b}^{3}} + -0.5625 \cdot \frac{{c}^{3} \cdot {a}^{3}}{{b}^{5}}\right)}}{a} \]
    5. Step-by-step derivation
      1. fma-def93.1%

        \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(-0.5, \frac{c \cdot a}{b}, -0.375 \cdot \frac{{c}^{2} \cdot {a}^{2}}{{b}^{3}} + -0.5625 \cdot \frac{{c}^{3} \cdot {a}^{3}}{{b}^{5}}\right)}}{a} \]
      2. *-commutative93.1%

        \[\leadsto \frac{\mathsf{fma}\left(-0.5, \frac{c \cdot a}{b}, \color{blue}{\frac{{c}^{2} \cdot {a}^{2}}{{b}^{3}} \cdot -0.375} + -0.5625 \cdot \frac{{c}^{3} \cdot {a}^{3}}{{b}^{5}}\right)}{a} \]
      3. fma-def93.1%

        \[\leadsto \frac{\mathsf{fma}\left(-0.5, \frac{c \cdot a}{b}, \color{blue}{\mathsf{fma}\left(\frac{{c}^{2} \cdot {a}^{2}}{{b}^{3}}, -0.375, -0.5625 \cdot \frac{{c}^{3} \cdot {a}^{3}}{{b}^{5}}\right)}\right)}{a} \]
      4. unpow293.1%

        \[\leadsto \frac{\mathsf{fma}\left(-0.5, \frac{c \cdot a}{b}, \mathsf{fma}\left(\frac{\color{blue}{\left(c \cdot c\right)} \cdot {a}^{2}}{{b}^{3}}, -0.375, -0.5625 \cdot \frac{{c}^{3} \cdot {a}^{3}}{{b}^{5}}\right)\right)}{a} \]
      5. associate-*l*93.1%

        \[\leadsto \frac{\mathsf{fma}\left(-0.5, \frac{c \cdot a}{b}, \mathsf{fma}\left(\frac{\color{blue}{c \cdot \left(c \cdot {a}^{2}\right)}}{{b}^{3}}, -0.375, -0.5625 \cdot \frac{{c}^{3} \cdot {a}^{3}}{{b}^{5}}\right)\right)}{a} \]
      6. unpow293.1%

        \[\leadsto \frac{\mathsf{fma}\left(-0.5, \frac{c \cdot a}{b}, \mathsf{fma}\left(\frac{c \cdot \left(c \cdot \color{blue}{\left(a \cdot a\right)}\right)}{{b}^{3}}, -0.375, -0.5625 \cdot \frac{{c}^{3} \cdot {a}^{3}}{{b}^{5}}\right)\right)}{a} \]
      7. *-commutative93.1%

        \[\leadsto \frac{\mathsf{fma}\left(-0.5, \frac{c \cdot a}{b}, \mathsf{fma}\left(\frac{c \cdot \left(c \cdot \left(a \cdot a\right)\right)}{{b}^{3}}, -0.375, \color{blue}{\frac{{c}^{3} \cdot {a}^{3}}{{b}^{5}} \cdot -0.5625}\right)\right)}{a} \]
      8. cube-prod93.1%

        \[\leadsto \frac{\mathsf{fma}\left(-0.5, \frac{c \cdot a}{b}, \mathsf{fma}\left(\frac{c \cdot \left(c \cdot \left(a \cdot a\right)\right)}{{b}^{3}}, -0.375, \frac{\color{blue}{{\left(c \cdot a\right)}^{3}}}{{b}^{5}} \cdot -0.5625\right)\right)}{a} \]
    6. Simplified93.1%

      \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(-0.5, \frac{c \cdot a}{b}, \mathsf{fma}\left(\frac{c \cdot \left(c \cdot \left(a \cdot a\right)\right)}{{b}^{3}}, -0.375, \frac{{\left(c \cdot a\right)}^{3}}{{b}^{5}} \cdot -0.5625\right)\right)}}{a} \]
    7. Step-by-step derivation
      1. unpow393.1%

        \[\leadsto \frac{\mathsf{fma}\left(-0.5, \frac{c \cdot a}{b}, \mathsf{fma}\left(\frac{c \cdot \left(c \cdot \left(a \cdot a\right)\right)}{{b}^{3}}, -0.375, \frac{\color{blue}{\left(\left(c \cdot a\right) \cdot \left(c \cdot a\right)\right) \cdot \left(c \cdot a\right)}}{{b}^{5}} \cdot -0.5625\right)\right)}{a} \]
      2. unswap-sqr93.1%

        \[\leadsto \frac{\mathsf{fma}\left(-0.5, \frac{c \cdot a}{b}, \mathsf{fma}\left(\frac{c \cdot \left(c \cdot \left(a \cdot a\right)\right)}{{b}^{3}}, -0.375, \frac{\color{blue}{\left(\left(c \cdot c\right) \cdot \left(a \cdot a\right)\right)} \cdot \left(c \cdot a\right)}{{b}^{5}} \cdot -0.5625\right)\right)}{a} \]
      3. associate-*r*93.1%

        \[\leadsto \frac{\mathsf{fma}\left(-0.5, \frac{c \cdot a}{b}, \mathsf{fma}\left(\frac{c \cdot \left(c \cdot \left(a \cdot a\right)\right)}{{b}^{3}}, -0.375, \frac{\color{blue}{\left(c \cdot \left(c \cdot \left(a \cdot a\right)\right)\right)} \cdot \left(c \cdot a\right)}{{b}^{5}} \cdot -0.5625\right)\right)}{a} \]
    8. Applied egg-rr93.1%

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

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

Alternative 4: 85.7% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := b \cdot b - c \cdot \left(a \cdot 3\right)\\ \mathbf{if}\;b \leq 20:\\ \;\;\;\;\frac{\frac{{\left(-b\right)}^{2} - t_0}{\left(-b\right) - \sqrt{t_0}}}{a \cdot 3}\\ \mathbf{else}:\\ \;\;\;\;-0.5 \cdot \frac{c}{b} + -0.375 \cdot \frac{c \cdot c}{\frac{{b}^{3}}{a}}\\ \end{array} \end{array} \]
(FPCore (a b c)
 :precision binary64
 (let* ((t_0 (- (* b b) (* c (* a 3.0)))))
   (if (<= b 20.0)
     (/ (/ (- (pow (- b) 2.0) t_0) (- (- b) (sqrt t_0))) (* a 3.0))
     (+ (* -0.5 (/ c b)) (* -0.375 (/ (* c c) (/ (pow b 3.0) a)))))))
double code(double a, double b, double c) {
	double t_0 = (b * b) - (c * (a * 3.0));
	double tmp;
	if (b <= 20.0) {
		tmp = ((pow(-b, 2.0) - t_0) / (-b - sqrt(t_0))) / (a * 3.0);
	} else {
		tmp = (-0.5 * (c / b)) + (-0.375 * ((c * c) / (pow(b, 3.0) / a)));
	}
	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 = (b * b) - (c * (a * 3.0d0))
    if (b <= 20.0d0) then
        tmp = (((-b ** 2.0d0) - t_0) / (-b - sqrt(t_0))) / (a * 3.0d0)
    else
        tmp = ((-0.5d0) * (c / b)) + ((-0.375d0) * ((c * c) / ((b ** 3.0d0) / a)))
    end if
    code = tmp
end function
public static double code(double a, double b, double c) {
	double t_0 = (b * b) - (c * (a * 3.0));
	double tmp;
	if (b <= 20.0) {
		tmp = ((Math.pow(-b, 2.0) - t_0) / (-b - Math.sqrt(t_0))) / (a * 3.0);
	} else {
		tmp = (-0.5 * (c / b)) + (-0.375 * ((c * c) / (Math.pow(b, 3.0) / a)));
	}
	return tmp;
}
def code(a, b, c):
	t_0 = (b * b) - (c * (a * 3.0))
	tmp = 0
	if b <= 20.0:
		tmp = ((math.pow(-b, 2.0) - t_0) / (-b - math.sqrt(t_0))) / (a * 3.0)
	else:
		tmp = (-0.5 * (c / b)) + (-0.375 * ((c * c) / (math.pow(b, 3.0) / a)))
	return tmp
function code(a, b, c)
	t_0 = Float64(Float64(b * b) - Float64(c * Float64(a * 3.0)))
	tmp = 0.0
	if (b <= 20.0)
		tmp = Float64(Float64(Float64((Float64(-b) ^ 2.0) - t_0) / Float64(Float64(-b) - sqrt(t_0))) / Float64(a * 3.0));
	else
		tmp = Float64(Float64(-0.5 * Float64(c / b)) + Float64(-0.375 * Float64(Float64(c * c) / Float64((b ^ 3.0) / a))));
	end
	return tmp
end
function tmp_2 = code(a, b, c)
	t_0 = (b * b) - (c * (a * 3.0));
	tmp = 0.0;
	if (b <= 20.0)
		tmp = (((-b ^ 2.0) - t_0) / (-b - sqrt(t_0))) / (a * 3.0);
	else
		tmp = (-0.5 * (c / b)) + (-0.375 * ((c * c) / ((b ^ 3.0) / a)));
	end
	tmp_2 = tmp;
end
code[a_, b_, c_] := Block[{t$95$0 = N[(N[(b * b), $MachinePrecision] - N[(c * N[(a * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, 20.0], N[(N[(N[(N[Power[(-b), 2.0], $MachinePrecision] - t$95$0), $MachinePrecision] / N[((-b) - N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(a * 3.0), $MachinePrecision]), $MachinePrecision], N[(N[(-0.5 * N[(c / b), $MachinePrecision]), $MachinePrecision] + N[(-0.375 * N[(N[(c * c), $MachinePrecision] / N[(N[Power[b, 3.0], $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

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

\mathbf{else}:\\
\;\;\;\;-0.5 \cdot \frac{c}{b} + -0.375 \cdot \frac{c \cdot c}{\frac{{b}^{3}}{a}}\\


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

    1. Initial program 84.8%

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

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

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

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

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

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

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

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

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

    if 20 < b

    1. Initial program 45.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-identity45.2%

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{-0.5 \cdot \frac{c}{b} + -0.375 \cdot \frac{{c}^{2} \cdot a}{{b}^{3}}} \]
    5. Step-by-step derivation
      1. +-commutative88.9%

        \[\leadsto \color{blue}{-0.375 \cdot \frac{{c}^{2} \cdot a}{{b}^{3}} + -0.5 \cdot \frac{c}{b}} \]
      2. fma-def88.9%

        \[\leadsto \color{blue}{\mathsf{fma}\left(-0.375, \frac{{c}^{2} \cdot a}{{b}^{3}}, -0.5 \cdot \frac{c}{b}\right)} \]
      3. associate-/l*88.9%

        \[\leadsto \mathsf{fma}\left(-0.375, \color{blue}{\frac{{c}^{2}}{\frac{{b}^{3}}{a}}}, -0.5 \cdot \frac{c}{b}\right) \]
      4. unpow288.9%

        \[\leadsto \mathsf{fma}\left(-0.375, \frac{\color{blue}{c \cdot c}}{\frac{{b}^{3}}{a}}, -0.5 \cdot \frac{c}{b}\right) \]
    6. Simplified88.9%

      \[\leadsto \color{blue}{\mathsf{fma}\left(-0.375, \frac{c \cdot c}{\frac{{b}^{3}}{a}}, -0.5 \cdot \frac{c}{b}\right)} \]
    7. Step-by-step derivation
      1. fma-udef88.9%

        \[\leadsto \color{blue}{-0.375 \cdot \frac{c \cdot c}{\frac{{b}^{3}}{a}} + -0.5 \cdot \frac{c}{b}} \]
    8. Applied egg-rr88.9%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq 20:\\ \;\;\;\;\frac{\frac{{\left(-b\right)}^{2} - \left(b \cdot b - c \cdot \left(a \cdot 3\right)\right)}{\left(-b\right) - \sqrt{b \cdot b - c \cdot \left(a \cdot 3\right)}}}{a \cdot 3}\\ \mathbf{else}:\\ \;\;\;\;-0.5 \cdot \frac{c}{b} + -0.375 \cdot \frac{c \cdot c}{\frac{{b}^{3}}{a}}\\ \end{array} \]

Alternative 5: 85.3% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq 20:\\ \;\;\;\;-0.3333333333333333 \cdot \frac{b - \sqrt{\mathsf{fma}\left(b, b, a \cdot \left(c \cdot -3\right)\right)}}{a}\\ \mathbf{else}:\\ \;\;\;\;-0.5 \cdot \frac{c}{b} + -0.375 \cdot \frac{c \cdot c}{\frac{{b}^{3}}{a}}\\ \end{array} \end{array} \]
(FPCore (a b c)
 :precision binary64
 (if (<= b 20.0)
   (* -0.3333333333333333 (/ (- b (sqrt (fma b b (* a (* c -3.0))))) a))
   (+ (* -0.5 (/ c b)) (* -0.375 (/ (* c c) (/ (pow b 3.0) a))))))
double code(double a, double b, double c) {
	double tmp;
	if (b <= 20.0) {
		tmp = -0.3333333333333333 * ((b - sqrt(fma(b, b, (a * (c * -3.0))))) / a);
	} else {
		tmp = (-0.5 * (c / b)) + (-0.375 * ((c * c) / (pow(b, 3.0) / a)));
	}
	return tmp;
}
function code(a, b, c)
	tmp = 0.0
	if (b <= 20.0)
		tmp = Float64(-0.3333333333333333 * Float64(Float64(b - sqrt(fma(b, b, Float64(a * Float64(c * -3.0))))) / a));
	else
		tmp = Float64(Float64(-0.5 * Float64(c / b)) + Float64(-0.375 * Float64(Float64(c * c) / Float64((b ^ 3.0) / a))));
	end
	return tmp
end
code[a_, b_, c_] := If[LessEqual[b, 20.0], N[(-0.3333333333333333 * N[(N[(b - N[Sqrt[N[(b * b + N[(a * N[(c * -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], N[(N[(-0.5 * N[(c / b), $MachinePrecision]), $MachinePrecision] + N[(-0.375 * N[(N[(c * c), $MachinePrecision] / N[(N[Power[b, 3.0], $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;b \leq 20:\\
\;\;\;\;-0.3333333333333333 \cdot \frac{b - \sqrt{\mathsf{fma}\left(b, b, a \cdot \left(c \cdot -3\right)\right)}}{a}\\

\mathbf{else}:\\
\;\;\;\;-0.5 \cdot \frac{c}{b} + -0.375 \cdot \frac{c \cdot c}{\frac{{b}^{3}}{a}}\\


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

    1. Initial program 84.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{-0.3333333333333333} \cdot \frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{-a} \]
      15. neg-mul-184.9%

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

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

    if 20 < b

    1. Initial program 45.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-identity45.2%

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{-0.5 \cdot \frac{c}{b} + -0.375 \cdot \frac{{c}^{2} \cdot a}{{b}^{3}}} \]
    5. Step-by-step derivation
      1. +-commutative88.9%

        \[\leadsto \color{blue}{-0.375 \cdot \frac{{c}^{2} \cdot a}{{b}^{3}} + -0.5 \cdot \frac{c}{b}} \]
      2. fma-def88.9%

        \[\leadsto \color{blue}{\mathsf{fma}\left(-0.375, \frac{{c}^{2} \cdot a}{{b}^{3}}, -0.5 \cdot \frac{c}{b}\right)} \]
      3. associate-/l*88.9%

        \[\leadsto \mathsf{fma}\left(-0.375, \color{blue}{\frac{{c}^{2}}{\frac{{b}^{3}}{a}}}, -0.5 \cdot \frac{c}{b}\right) \]
      4. unpow288.9%

        \[\leadsto \mathsf{fma}\left(-0.375, \frac{\color{blue}{c \cdot c}}{\frac{{b}^{3}}{a}}, -0.5 \cdot \frac{c}{b}\right) \]
    6. Simplified88.9%

      \[\leadsto \color{blue}{\mathsf{fma}\left(-0.375, \frac{c \cdot c}{\frac{{b}^{3}}{a}}, -0.5 \cdot \frac{c}{b}\right)} \]
    7. Step-by-step derivation
      1. fma-udef88.9%

        \[\leadsto \color{blue}{-0.375 \cdot \frac{c \cdot c}{\frac{{b}^{3}}{a}} + -0.5 \cdot \frac{c}{b}} \]
    8. Applied egg-rr88.9%

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

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

Alternative 6: 85.3% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq 20:\\ \;\;\;\;\frac{-0.3333333333333333 \cdot \left(b - \sqrt{\mathsf{fma}\left(b, b, \left(c \cdot a\right) \cdot -3\right)}\right)}{a}\\ \mathbf{else}:\\ \;\;\;\;-0.5 \cdot \frac{c}{b} + -0.375 \cdot \frac{c \cdot c}{\frac{{b}^{3}}{a}}\\ \end{array} \end{array} \]
(FPCore (a b c)
 :precision binary64
 (if (<= b 20.0)
   (/ (* -0.3333333333333333 (- b (sqrt (fma b b (* (* c a) -3.0))))) a)
   (+ (* -0.5 (/ c b)) (* -0.375 (/ (* c c) (/ (pow b 3.0) a))))))
double code(double a, double b, double c) {
	double tmp;
	if (b <= 20.0) {
		tmp = (-0.3333333333333333 * (b - sqrt(fma(b, b, ((c * a) * -3.0))))) / a;
	} else {
		tmp = (-0.5 * (c / b)) + (-0.375 * ((c * c) / (pow(b, 3.0) / a)));
	}
	return tmp;
}
function code(a, b, c)
	tmp = 0.0
	if (b <= 20.0)
		tmp = Float64(Float64(-0.3333333333333333 * Float64(b - sqrt(fma(b, b, Float64(Float64(c * a) * -3.0))))) / a);
	else
		tmp = Float64(Float64(-0.5 * Float64(c / b)) + Float64(-0.375 * Float64(Float64(c * c) / Float64((b ^ 3.0) / a))));
	end
	return tmp
end
code[a_, b_, c_] := If[LessEqual[b, 20.0], N[(N[(-0.3333333333333333 * N[(b - N[Sqrt[N[(b * b + N[(N[(c * a), $MachinePrecision] * -3.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision], N[(N[(-0.5 * N[(c / b), $MachinePrecision]), $MachinePrecision] + N[(-0.375 * N[(N[(c * c), $MachinePrecision] / N[(N[Power[b, 3.0], $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;b \leq 20:\\
\;\;\;\;\frac{-0.3333333333333333 \cdot \left(b - \sqrt{\mathsf{fma}\left(b, b, \left(c \cdot a\right) \cdot -3\right)}\right)}{a}\\

\mathbf{else}:\\
\;\;\;\;-0.5 \cdot \frac{c}{b} + -0.375 \cdot \frac{c \cdot c}{\frac{{b}^{3}}{a}}\\


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

    1. Initial program 84.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 20 < b

    1. Initial program 45.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-identity45.2%

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{-0.5 \cdot \frac{c}{b} + -0.375 \cdot \frac{{c}^{2} \cdot a}{{b}^{3}}} \]
    5. Step-by-step derivation
      1. +-commutative88.9%

        \[\leadsto \color{blue}{-0.375 \cdot \frac{{c}^{2} \cdot a}{{b}^{3}} + -0.5 \cdot \frac{c}{b}} \]
      2. fma-def88.9%

        \[\leadsto \color{blue}{\mathsf{fma}\left(-0.375, \frac{{c}^{2} \cdot a}{{b}^{3}}, -0.5 \cdot \frac{c}{b}\right)} \]
      3. associate-/l*88.9%

        \[\leadsto \mathsf{fma}\left(-0.375, \color{blue}{\frac{{c}^{2}}{\frac{{b}^{3}}{a}}}, -0.5 \cdot \frac{c}{b}\right) \]
      4. unpow288.9%

        \[\leadsto \mathsf{fma}\left(-0.375, \frac{\color{blue}{c \cdot c}}{\frac{{b}^{3}}{a}}, -0.5 \cdot \frac{c}{b}\right) \]
    6. Simplified88.9%

      \[\leadsto \color{blue}{\mathsf{fma}\left(-0.375, \frac{c \cdot c}{\frac{{b}^{3}}{a}}, -0.5 \cdot \frac{c}{b}\right)} \]
    7. Step-by-step derivation
      1. fma-udef88.9%

        \[\leadsto \color{blue}{-0.375 \cdot \frac{c \cdot c}{\frac{{b}^{3}}{a}} + -0.5 \cdot \frac{c}{b}} \]
    8. Applied egg-rr88.9%

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

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

Alternative 7: 85.3% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq 22:\\
\;\;\;\;\frac{\sqrt{b \cdot b - c \cdot \left(a \cdot 3\right)} - b}{a \cdot 3}\\

\mathbf{else}:\\
\;\;\;\;-0.5 \cdot \frac{c}{b} + -0.375 \cdot \frac{c \cdot c}{\frac{{b}^{3}}{a}}\\


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

    1. Initial program 84.8%

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

    if 22 < b

    1. Initial program 45.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-identity45.2%

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{-0.5 \cdot \frac{c}{b} + -0.375 \cdot \frac{{c}^{2} \cdot a}{{b}^{3}}} \]
    5. Step-by-step derivation
      1. +-commutative88.9%

        \[\leadsto \color{blue}{-0.375 \cdot \frac{{c}^{2} \cdot a}{{b}^{3}} + -0.5 \cdot \frac{c}{b}} \]
      2. fma-def88.9%

        \[\leadsto \color{blue}{\mathsf{fma}\left(-0.375, \frac{{c}^{2} \cdot a}{{b}^{3}}, -0.5 \cdot \frac{c}{b}\right)} \]
      3. associate-/l*88.9%

        \[\leadsto \mathsf{fma}\left(-0.375, \color{blue}{\frac{{c}^{2}}{\frac{{b}^{3}}{a}}}, -0.5 \cdot \frac{c}{b}\right) \]
      4. unpow288.9%

        \[\leadsto \mathsf{fma}\left(-0.375, \frac{\color{blue}{c \cdot c}}{\frac{{b}^{3}}{a}}, -0.5 \cdot \frac{c}{b}\right) \]
    6. Simplified88.9%

      \[\leadsto \color{blue}{\mathsf{fma}\left(-0.375, \frac{c \cdot c}{\frac{{b}^{3}}{a}}, -0.5 \cdot \frac{c}{b}\right)} \]
    7. Step-by-step derivation
      1. fma-udef88.9%

        \[\leadsto \color{blue}{-0.375 \cdot \frac{c \cdot c}{\frac{{b}^{3}}{a}} + -0.5 \cdot \frac{c}{b}} \]
    8. Applied egg-rr88.9%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq 22:\\ \;\;\;\;\frac{\sqrt{b \cdot b - c \cdot \left(a \cdot 3\right)} - b}{a \cdot 3}\\ \mathbf{else}:\\ \;\;\;\;-0.5 \cdot \frac{c}{b} + -0.375 \cdot \frac{c \cdot c}{\frac{{b}^{3}}{a}}\\ \end{array} \]

Alternative 8: 81.3% accurate, 1.0× speedup?

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

\\
-0.5 \cdot \frac{c}{b} + -0.375 \cdot \frac{c \cdot c}{\frac{{b}^{3}}{a}}
\end{array}
Derivation
  1. Initial program 53.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{-0.5 \cdot \frac{c}{b} + -0.375 \cdot \frac{{c}^{2} \cdot a}{{b}^{3}}} \]
  5. Step-by-step derivation
    1. +-commutative81.8%

      \[\leadsto \color{blue}{-0.375 \cdot \frac{{c}^{2} \cdot a}{{b}^{3}} + -0.5 \cdot \frac{c}{b}} \]
    2. fma-def81.8%

      \[\leadsto \color{blue}{\mathsf{fma}\left(-0.375, \frac{{c}^{2} \cdot a}{{b}^{3}}, -0.5 \cdot \frac{c}{b}\right)} \]
    3. associate-/l*81.8%

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

      \[\leadsto \mathsf{fma}\left(-0.375, \frac{\color{blue}{c \cdot c}}{\frac{{b}^{3}}{a}}, -0.5 \cdot \frac{c}{b}\right) \]
  6. Simplified81.8%

    \[\leadsto \color{blue}{\mathsf{fma}\left(-0.375, \frac{c \cdot c}{\frac{{b}^{3}}{a}}, -0.5 \cdot \frac{c}{b}\right)} \]
  7. Step-by-step derivation
    1. fma-udef81.8%

      \[\leadsto \color{blue}{-0.375 \cdot \frac{c \cdot c}{\frac{{b}^{3}}{a}} + -0.5 \cdot \frac{c}{b}} \]
  8. Applied egg-rr81.8%

    \[\leadsto \color{blue}{-0.375 \cdot \frac{c \cdot c}{\frac{{b}^{3}}{a}} + -0.5 \cdot \frac{c}{b}} \]
  9. Final simplification81.8%

    \[\leadsto -0.5 \cdot \frac{c}{b} + -0.375 \cdot \frac{c \cdot c}{\frac{{b}^{3}}{a}} \]

Alternative 9: 81.2% accurate, 1.0× speedup?

\[\begin{array}{l} \\ c \cdot \left(\frac{-0.5}{b} + \frac{c \cdot \left(a \cdot -0.375\right)}{{b}^{3}}\right) \end{array} \]
(FPCore (a b c)
 :precision binary64
 (* c (+ (/ -0.5 b) (/ (* c (* a -0.375)) (pow b 3.0)))))
double code(double a, double b, double c) {
	return c * ((-0.5 / b) + ((c * (a * -0.375)) / pow(b, 3.0)));
}
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) + ((c * (a * (-0.375d0))) / (b ** 3.0d0)))
end function
public static double code(double a, double b, double c) {
	return c * ((-0.5 / b) + ((c * (a * -0.375)) / Math.pow(b, 3.0)));
}
def code(a, b, c):
	return c * ((-0.5 / b) + ((c * (a * -0.375)) / math.pow(b, 3.0)))
function code(a, b, c)
	return Float64(c * Float64(Float64(-0.5 / b) + Float64(Float64(c * Float64(a * -0.375)) / (b ^ 3.0))))
end
function tmp = code(a, b, c)
	tmp = c * ((-0.5 / b) + ((c * (a * -0.375)) / (b ^ 3.0)));
end
code[a_, b_, c_] := N[(c * N[(N[(-0.5 / b), $MachinePrecision] + N[(N[(c * N[(a * -0.375), $MachinePrecision]), $MachinePrecision] / N[Power[b, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
c \cdot \left(\frac{-0.5}{b} + \frac{c \cdot \left(a \cdot -0.375\right)}{{b}^{3}}\right)
\end{array}
Derivation
  1. Initial program 53.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{-0.3333333333333333} \cdot \frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{-a} \]
    15. neg-mul-153.1%

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

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

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

      \[\leadsto -0.3333333333333333 \cdot \color{blue}{\mathsf{fma}\left(1.125, \frac{{c}^{2} \cdot a}{{b}^{3}}, 1.5 \cdot \frac{c}{b}\right)} \]
    2. associate-/l*81.6%

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

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

      \[\leadsto -0.3333333333333333 \cdot \mathsf{fma}\left(1.125, \frac{c \cdot c}{\frac{{b}^{3}}{a}}, \color{blue}{\frac{1.5 \cdot c}{b}}\right) \]
  6. Simplified81.5%

    \[\leadsto -0.3333333333333333 \cdot \color{blue}{\mathsf{fma}\left(1.125, \frac{c \cdot c}{\frac{{b}^{3}}{a}}, \frac{1.5 \cdot c}{b}\right)} \]
  7. Taylor expanded in c around 0 81.8%

    \[\leadsto \color{blue}{-0.5 \cdot \frac{c}{b} + -0.375 \cdot \frac{{c}^{2} \cdot a}{{b}^{3}}} \]
  8. Step-by-step derivation
    1. +-commutative81.8%

      \[\leadsto \color{blue}{-0.375 \cdot \frac{{c}^{2} \cdot a}{{b}^{3}} + -0.5 \cdot \frac{c}{b}} \]
    2. *-commutative81.8%

      \[\leadsto \color{blue}{\frac{{c}^{2} \cdot a}{{b}^{3}} \cdot -0.375} + -0.5 \cdot \frac{c}{b} \]
    3. associate-*l/81.8%

      \[\leadsto \color{blue}{\left(\frac{{c}^{2}}{{b}^{3}} \cdot a\right)} \cdot -0.375 + -0.5 \cdot \frac{c}{b} \]
    4. associate-*l*81.8%

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

      \[\leadsto \frac{\color{blue}{c \cdot c}}{{b}^{3}} \cdot \left(a \cdot -0.375\right) + -0.5 \cdot \frac{c}{b} \]
    6. associate-*r/81.8%

      \[\leadsto \color{blue}{\left(c \cdot \frac{c}{{b}^{3}}\right)} \cdot \left(a \cdot -0.375\right) + -0.5 \cdot \frac{c}{b} \]
    7. associate-*r/81.8%

      \[\leadsto \left(c \cdot \frac{c}{{b}^{3}}\right) \cdot \left(a \cdot -0.375\right) + \color{blue}{\frac{-0.5 \cdot c}{b}} \]
    8. associate-/l*81.6%

      \[\leadsto \left(c \cdot \frac{c}{{b}^{3}}\right) \cdot \left(a \cdot -0.375\right) + \color{blue}{\frac{-0.5}{\frac{b}{c}}} \]
    9. metadata-eval81.6%

      \[\leadsto \left(c \cdot \frac{c}{{b}^{3}}\right) \cdot \left(a \cdot -0.375\right) + \frac{\color{blue}{-0.3333333333333333 \cdot 1.5}}{\frac{b}{c}} \]
    10. associate-*r/81.5%

      \[\leadsto \left(c \cdot \frac{c}{{b}^{3}}\right) \cdot \left(a \cdot -0.375\right) + \color{blue}{-0.3333333333333333 \cdot \frac{1.5}{\frac{b}{c}}} \]
    11. fma-def81.5%

      \[\leadsto \color{blue}{\mathsf{fma}\left(c \cdot \frac{c}{{b}^{3}}, a \cdot -0.375, -0.3333333333333333 \cdot \frac{1.5}{\frac{b}{c}}\right)} \]
    12. associate-*r/81.6%

      \[\leadsto \mathsf{fma}\left(c \cdot \frac{c}{{b}^{3}}, a \cdot -0.375, \color{blue}{\frac{-0.3333333333333333 \cdot 1.5}{\frac{b}{c}}}\right) \]
    13. metadata-eval81.6%

      \[\leadsto \mathsf{fma}\left(c \cdot \frac{c}{{b}^{3}}, a \cdot -0.375, \frac{\color{blue}{-0.5}}{\frac{b}{c}}\right) \]
  9. Simplified81.6%

    \[\leadsto \color{blue}{\mathsf{fma}\left(c \cdot \frac{c}{{b}^{3}}, a \cdot -0.375, \frac{-0.5}{\frac{b}{c}}\right)} \]
  10. Taylor expanded in c around 0 81.8%

    \[\leadsto \color{blue}{-0.5 \cdot \frac{c}{b} + -0.375 \cdot \frac{{c}^{2} \cdot a}{{b}^{3}}} \]
  11. Step-by-step derivation
    1. associate-*r/81.8%

      \[\leadsto \color{blue}{\frac{-0.5 \cdot c}{b}} + -0.375 \cdot \frac{{c}^{2} \cdot a}{{b}^{3}} \]
    2. associate-*l/81.6%

      \[\leadsto \color{blue}{\frac{-0.5}{b} \cdot c} + -0.375 \cdot \frac{{c}^{2} \cdot a}{{b}^{3}} \]
    3. *-commutative81.6%

      \[\leadsto \color{blue}{c \cdot \frac{-0.5}{b}} + -0.375 \cdot \frac{{c}^{2} \cdot a}{{b}^{3}} \]
    4. *-commutative81.6%

      \[\leadsto c \cdot \frac{-0.5}{b} + \color{blue}{\frac{{c}^{2} \cdot a}{{b}^{3}} \cdot -0.375} \]
    5. unpow281.6%

      \[\leadsto c \cdot \frac{-0.5}{b} + \frac{\color{blue}{\left(c \cdot c\right)} \cdot a}{{b}^{3}} \cdot -0.375 \]
    6. associate-*l/81.6%

      \[\leadsto c \cdot \frac{-0.5}{b} + \color{blue}{\left(\frac{c \cdot c}{{b}^{3}} \cdot a\right)} \cdot -0.375 \]
    7. associate-*r/81.6%

      \[\leadsto c \cdot \frac{-0.5}{b} + \left(\color{blue}{\left(c \cdot \frac{c}{{b}^{3}}\right)} \cdot a\right) \cdot -0.375 \]
    8. associate-*r*81.6%

      \[\leadsto c \cdot \frac{-0.5}{b} + \color{blue}{\left(c \cdot \frac{c}{{b}^{3}}\right) \cdot \left(a \cdot -0.375\right)} \]
    9. associate-*l*81.6%

      \[\leadsto c \cdot \frac{-0.5}{b} + \color{blue}{c \cdot \left(\frac{c}{{b}^{3}} \cdot \left(a \cdot -0.375\right)\right)} \]
    10. distribute-lft-out81.6%

      \[\leadsto \color{blue}{c \cdot \left(\frac{-0.5}{b} + \frac{c}{{b}^{3}} \cdot \left(a \cdot -0.375\right)\right)} \]
    11. associate-*l/81.6%

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

    \[\leadsto \color{blue}{c \cdot \left(\frac{-0.5}{b} + \frac{c \cdot \left(a \cdot -0.375\right)}{{b}^{3}}\right)} \]
  13. Final simplification81.6%

    \[\leadsto c \cdot \left(\frac{-0.5}{b} + \frac{c \cdot \left(a \cdot -0.375\right)}{{b}^{3}}\right) \]

Alternative 10: 64.3% accurate, 23.2× speedup?

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

\\
-0.5 \cdot \frac{c}{b}
\end{array}
Derivation
  1. Initial program 53.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{-0.5 \cdot \frac{c}{b}} \]
  5. Final simplification66.1%

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

Reproduce

?
herbie shell --seed 2023178 
(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)))