Cubic critical, medium range

Percentage Accurate: 31.4% → 95.4%
Time: 13.9s
Alternatives: 10
Speedup: 23.2×

Specification

?
\[\left(\left(1.1102230246251565 \cdot 10^{-16} < a \land a < 9007199254740992\right) \land \left(1.1102230246251565 \cdot 10^{-16} < b \land b < 9007199254740992\right)\right) \land \left(1.1102230246251565 \cdot 10^{-16} < c \land c < 9007199254740992\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: 31.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: 95.4% accurate, 0.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := a \cdot \left(c \cdot 3\right)\\ t_1 := {\left(a \cdot c\right)}^{4}\\ t_2 := {\left(a \cdot c\right)}^{2}\\ t_3 := {c}^{3} \cdot 27\\ t_4 := t_1 \cdot 81\\ t_5 := {t_0}^{2}\\ t_6 := t_5 \cdot -0.375\\ t_7 := \mathsf{fma}\left(-0.5, a \cdot \left(c \cdot \left(3 \cdot t_6\right)\right), 0.125 \cdot {t_0}^{3}\right)\\ t_8 := 2.25 \cdot \left({a}^{3} \cdot \left(3 \cdot {c}^{3}\right)\right) - t_7\\ t_9 := \mathsf{fma}\left(-4.5, t_2, t_5 \cdot 0.375\right)\\ t_10 := {c}^{2} \cdot 9\\ t_11 := a \cdot t_10\\ t_12 := \mathsf{fma}\left(4, \frac{t_8}{t_11}, 8 \cdot \frac{{t_9}^{2}}{{a}^{2} \cdot t_3}\right)\\ {\left(\mathsf{fma}\left(-12, \frac{t_9}{a \cdot \left(b \cdot t_10\right)}, \mathsf{fma}\left(-3, \frac{\mathsf{fma}\left(2, \frac{t_9}{a} \cdot \frac{t_12}{c \cdot 3}, \mathsf{fma}\left(4, \frac{\mathsf{fma}\left(-10.125, t_1, 4.5 \cdot \left(t_2 \cdot t_6\right) - \mathsf{fma}\left(-0.5, a \cdot \left(\left(c \cdot 3\right) \cdot t_7\right), \mathsf{fma}\left(-0.5, \mathsf{fma}\left(0.0625, t_4, {\left(t_5 \cdot -0.125\right)}^{2}\right), \mathsf{fma}\left(0.125, t_2 \cdot \left(9 \cdot t_6\right), t_4 \cdot -0.03125\right)\right)\right)\right)}{t_11}, 8 \cdot \left(\frac{t_9}{{a}^{2}} \cdot \frac{t_8}{t_3}\right)\right)\right)}{{b}^{5}} + \frac{t_12}{{b}^{3}}, -2 \cdot \frac{b}{c}\right)\right)\right)}^{-1} \end{array} \end{array} \]
(FPCore (a b c)
 :precision binary64
 (let* ((t_0 (* a (* c 3.0)))
        (t_1 (pow (* a c) 4.0))
        (t_2 (pow (* a c) 2.0))
        (t_3 (* (pow c 3.0) 27.0))
        (t_4 (* t_1 81.0))
        (t_5 (pow t_0 2.0))
        (t_6 (* t_5 -0.375))
        (t_7 (fma -0.5 (* a (* c (* 3.0 t_6))) (* 0.125 (pow t_0 3.0))))
        (t_8 (- (* 2.25 (* (pow a 3.0) (* 3.0 (pow c 3.0)))) t_7))
        (t_9 (fma -4.5 t_2 (* t_5 0.375)))
        (t_10 (* (pow c 2.0) 9.0))
        (t_11 (* a t_10))
        (t_12
         (fma 4.0 (/ t_8 t_11) (* 8.0 (/ (pow t_9 2.0) (* (pow a 2.0) t_3))))))
   (pow
    (fma
     -12.0
     (/ t_9 (* a (* b t_10)))
     (fma
      -3.0
      (+
       (/
        (fma
         2.0
         (* (/ t_9 a) (/ t_12 (* c 3.0)))
         (fma
          4.0
          (/
           (fma
            -10.125
            t_1
            (-
             (* 4.5 (* t_2 t_6))
             (fma
              -0.5
              (* a (* (* c 3.0) t_7))
              (fma
               -0.5
               (fma 0.0625 t_4 (pow (* t_5 -0.125) 2.0))
               (fma 0.125 (* t_2 (* 9.0 t_6)) (* t_4 -0.03125))))))
           t_11)
          (* 8.0 (* (/ t_9 (pow a 2.0)) (/ t_8 t_3)))))
        (pow b 5.0))
       (/ t_12 (pow b 3.0)))
      (* -2.0 (/ b c))))
    -1.0)))
double code(double a, double b, double c) {
	double t_0 = a * (c * 3.0);
	double t_1 = pow((a * c), 4.0);
	double t_2 = pow((a * c), 2.0);
	double t_3 = pow(c, 3.0) * 27.0;
	double t_4 = t_1 * 81.0;
	double t_5 = pow(t_0, 2.0);
	double t_6 = t_5 * -0.375;
	double t_7 = fma(-0.5, (a * (c * (3.0 * t_6))), (0.125 * pow(t_0, 3.0)));
	double t_8 = (2.25 * (pow(a, 3.0) * (3.0 * pow(c, 3.0)))) - t_7;
	double t_9 = fma(-4.5, t_2, (t_5 * 0.375));
	double t_10 = pow(c, 2.0) * 9.0;
	double t_11 = a * t_10;
	double t_12 = fma(4.0, (t_8 / t_11), (8.0 * (pow(t_9, 2.0) / (pow(a, 2.0) * t_3))));
	return pow(fma(-12.0, (t_9 / (a * (b * t_10))), fma(-3.0, ((fma(2.0, ((t_9 / a) * (t_12 / (c * 3.0))), fma(4.0, (fma(-10.125, t_1, ((4.5 * (t_2 * t_6)) - fma(-0.5, (a * ((c * 3.0) * t_7)), fma(-0.5, fma(0.0625, t_4, pow((t_5 * -0.125), 2.0)), fma(0.125, (t_2 * (9.0 * t_6)), (t_4 * -0.03125)))))) / t_11), (8.0 * ((t_9 / pow(a, 2.0)) * (t_8 / t_3))))) / pow(b, 5.0)) + (t_12 / pow(b, 3.0))), (-2.0 * (b / c)))), -1.0);
}
function code(a, b, c)
	t_0 = Float64(a * Float64(c * 3.0))
	t_1 = Float64(a * c) ^ 4.0
	t_2 = Float64(a * c) ^ 2.0
	t_3 = Float64((c ^ 3.0) * 27.0)
	t_4 = Float64(t_1 * 81.0)
	t_5 = t_0 ^ 2.0
	t_6 = Float64(t_5 * -0.375)
	t_7 = fma(-0.5, Float64(a * Float64(c * Float64(3.0 * t_6))), Float64(0.125 * (t_0 ^ 3.0)))
	t_8 = Float64(Float64(2.25 * Float64((a ^ 3.0) * Float64(3.0 * (c ^ 3.0)))) - t_7)
	t_9 = fma(-4.5, t_2, Float64(t_5 * 0.375))
	t_10 = Float64((c ^ 2.0) * 9.0)
	t_11 = Float64(a * t_10)
	t_12 = fma(4.0, Float64(t_8 / t_11), Float64(8.0 * Float64((t_9 ^ 2.0) / Float64((a ^ 2.0) * t_3))))
	return fma(-12.0, Float64(t_9 / Float64(a * Float64(b * t_10))), fma(-3.0, Float64(Float64(fma(2.0, Float64(Float64(t_9 / a) * Float64(t_12 / Float64(c * 3.0))), fma(4.0, Float64(fma(-10.125, t_1, Float64(Float64(4.5 * Float64(t_2 * t_6)) - fma(-0.5, Float64(a * Float64(Float64(c * 3.0) * t_7)), fma(-0.5, fma(0.0625, t_4, (Float64(t_5 * -0.125) ^ 2.0)), fma(0.125, Float64(t_2 * Float64(9.0 * t_6)), Float64(t_4 * -0.03125)))))) / t_11), Float64(8.0 * Float64(Float64(t_9 / (a ^ 2.0)) * Float64(t_8 / t_3))))) / (b ^ 5.0)) + Float64(t_12 / (b ^ 3.0))), Float64(-2.0 * Float64(b / c)))) ^ -1.0
end
code[a_, b_, c_] := Block[{t$95$0 = N[(a * N[(c * 3.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Power[N[(a * c), $MachinePrecision], 4.0], $MachinePrecision]}, Block[{t$95$2 = N[Power[N[(a * c), $MachinePrecision], 2.0], $MachinePrecision]}, Block[{t$95$3 = N[(N[Power[c, 3.0], $MachinePrecision] * 27.0), $MachinePrecision]}, Block[{t$95$4 = N[(t$95$1 * 81.0), $MachinePrecision]}, Block[{t$95$5 = N[Power[t$95$0, 2.0], $MachinePrecision]}, Block[{t$95$6 = N[(t$95$5 * -0.375), $MachinePrecision]}, Block[{t$95$7 = N[(-0.5 * N[(a * N[(c * N[(3.0 * t$95$6), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(0.125 * N[Power[t$95$0, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$8 = N[(N[(2.25 * N[(N[Power[a, 3.0], $MachinePrecision] * N[(3.0 * N[Power[c, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$7), $MachinePrecision]}, Block[{t$95$9 = N[(-4.5 * t$95$2 + N[(t$95$5 * 0.375), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$10 = N[(N[Power[c, 2.0], $MachinePrecision] * 9.0), $MachinePrecision]}, Block[{t$95$11 = N[(a * t$95$10), $MachinePrecision]}, Block[{t$95$12 = N[(4.0 * N[(t$95$8 / t$95$11), $MachinePrecision] + N[(8.0 * N[(N[Power[t$95$9, 2.0], $MachinePrecision] / N[(N[Power[a, 2.0], $MachinePrecision] * t$95$3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[Power[N[(-12.0 * N[(t$95$9 / N[(a * N[(b * t$95$10), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(-3.0 * N[(N[(N[(2.0 * N[(N[(t$95$9 / a), $MachinePrecision] * N[(t$95$12 / N[(c * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(4.0 * N[(N[(-10.125 * t$95$1 + N[(N[(4.5 * N[(t$95$2 * t$95$6), $MachinePrecision]), $MachinePrecision] - N[(-0.5 * N[(a * N[(N[(c * 3.0), $MachinePrecision] * t$95$7), $MachinePrecision]), $MachinePrecision] + N[(-0.5 * N[(0.0625 * t$95$4 + N[Power[N[(t$95$5 * -0.125), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] + N[(0.125 * N[(t$95$2 * N[(9.0 * t$95$6), $MachinePrecision]), $MachinePrecision] + N[(t$95$4 * -0.03125), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$11), $MachinePrecision] + N[(8.0 * N[(N[(t$95$9 / N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision] * N[(t$95$8 / t$95$3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Power[b, 5.0], $MachinePrecision]), $MachinePrecision] + N[(t$95$12 / N[Power[b, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(-2.0 * N[(b / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], -1.0], $MachinePrecision]]]]]]]]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := a \cdot \left(c \cdot 3\right)\\
t_1 := {\left(a \cdot c\right)}^{4}\\
t_2 := {\left(a \cdot c\right)}^{2}\\
t_3 := {c}^{3} \cdot 27\\
t_4 := t_1 \cdot 81\\
t_5 := {t_0}^{2}\\
t_6 := t_5 \cdot -0.375\\
t_7 := \mathsf{fma}\left(-0.5, a \cdot \left(c \cdot \left(3 \cdot t_6\right)\right), 0.125 \cdot {t_0}^{3}\right)\\
t_8 := 2.25 \cdot \left({a}^{3} \cdot \left(3 \cdot {c}^{3}\right)\right) - t_7\\
t_9 := \mathsf{fma}\left(-4.5, t_2, t_5 \cdot 0.375\right)\\
t_10 := {c}^{2} \cdot 9\\
t_11 := a \cdot t_10\\
t_12 := \mathsf{fma}\left(4, \frac{t_8}{t_11}, 8 \cdot \frac{{t_9}^{2}}{{a}^{2} \cdot t_3}\right)\\
{\left(\mathsf{fma}\left(-12, \frac{t_9}{a \cdot \left(b \cdot t_10\right)}, \mathsf{fma}\left(-3, \frac{\mathsf{fma}\left(2, \frac{t_9}{a} \cdot \frac{t_12}{c \cdot 3}, \mathsf{fma}\left(4, \frac{\mathsf{fma}\left(-10.125, t_1, 4.5 \cdot \left(t_2 \cdot t_6\right) - \mathsf{fma}\left(-0.5, a \cdot \left(\left(c \cdot 3\right) \cdot t_7\right), \mathsf{fma}\left(-0.5, \mathsf{fma}\left(0.0625, t_4, {\left(t_5 \cdot -0.125\right)}^{2}\right), \mathsf{fma}\left(0.125, t_2 \cdot \left(9 \cdot t_6\right), t_4 \cdot -0.03125\right)\right)\right)\right)}{t_11}, 8 \cdot \left(\frac{t_9}{{a}^{2}} \cdot \frac{t_8}{t_3}\right)\right)\right)}{{b}^{5}} + \frac{t_12}{{b}^{3}}, -2 \cdot \frac{b}{c}\right)\right)\right)}^{-1}
\end{array}
\end{array}
Derivation
  1. Initial program 31.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. flip--31.4%

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

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

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

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

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

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

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

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

      \[\leadsto \frac{\left(-b\right) + \sqrt{\left({b}^{4} - {\left(3 \cdot \left(a \cdot c\right)\right)}^{2}\right) \cdot \frac{1}{\color{blue}{\mathsf{fma}\left(b, b, \left(3 \cdot a\right) \cdot c\right)}}}}{3 \cdot a} \]
    10. associate-*l*31.4%

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

    \[\leadsto \frac{\left(-b\right) + \sqrt{\color{blue}{\left({b}^{4} - {\left(3 \cdot \left(a \cdot c\right)\right)}^{2}\right) \cdot \frac{1}{\mathsf{fma}\left(b, b, 3 \cdot \left(a \cdot c\right)\right)}}}}{3 \cdot a} \]
  4. Step-by-step derivation
    1. associate-*r/31.4%

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

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

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

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

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

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

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

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

      \[\leadsto \frac{\left(-b\right) + \sqrt{\frac{{b}^{4}}{\mathsf{fma}\left(b, b, 3 \cdot \left(a \cdot c\right)\right)} - \frac{\left(\left(a \cdot c\right) \cdot \left(a \cdot c\right)\right) \cdot \color{blue}{\left(-3 \cdot -3\right)}}{\mathsf{fma}\left(b, b, 3 \cdot \left(a \cdot c\right)\right)}}}{3 \cdot a} \]
    10. swap-sqr31.4%

      \[\leadsto \frac{\left(-b\right) + \sqrt{\frac{{b}^{4}}{\mathsf{fma}\left(b, b, 3 \cdot \left(a \cdot c\right)\right)} - \frac{\color{blue}{\left(\left(a \cdot c\right) \cdot -3\right) \cdot \left(\left(a \cdot c\right) \cdot -3\right)}}{\mathsf{fma}\left(b, b, 3 \cdot \left(a \cdot c\right)\right)}}}{3 \cdot a} \]
    11. associate-*r*31.4%

      \[\leadsto \frac{\left(-b\right) + \sqrt{\frac{{b}^{4}}{\mathsf{fma}\left(b, b, 3 \cdot \left(a \cdot c\right)\right)} - \frac{\color{blue}{\left(a \cdot \left(c \cdot -3\right)\right)} \cdot \left(\left(a \cdot c\right) \cdot -3\right)}{\mathsf{fma}\left(b, b, 3 \cdot \left(a \cdot c\right)\right)}}}{3 \cdot a} \]
    12. associate-*r*31.4%

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

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

      \[\leadsto \frac{\left(-b\right) + \sqrt{\color{blue}{\frac{{b}^{4} - {\left(a \cdot \left(c \cdot -3\right)\right)}^{2}}{\mathsf{fma}\left(b, b, 3 \cdot \left(a \cdot c\right)\right)}}}}{3 \cdot a} \]
    15. associate-*r*31.4%

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

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

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

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

    \[\leadsto \color{blue}{{\left(\frac{a \cdot 3}{\mathsf{fma}\left(-1, b, \frac{\sqrt{{b}^{4} - {\left(a \cdot c\right)}^{2} \cdot 9}}{\mathsf{hypot}\left(b, \sqrt{a \cdot \left(c \cdot 3\right)}\right)}\right)}\right)}^{-1}} \]
  8. Taylor expanded in b around inf 94.4%

    \[\leadsto {\color{blue}{\left(-12 \cdot \frac{-4.5 \cdot \left({a}^{2} \cdot {c}^{2}\right) + -1 \cdot \left(-0.25 \cdot \left({a}^{2} \cdot \left({c}^{2} \cdot {\left(\sqrt{3}\right)}^{4}\right)\right) + -0.125 \cdot \left({a}^{2} \cdot \left({c}^{2} \cdot {\left(\sqrt{3}\right)}^{4}\right)\right)\right)}{a \cdot \left(b \cdot \left({c}^{2} \cdot {\left(\sqrt{3}\right)}^{4}\right)\right)} + \left(-6 \cdot \frac{b}{c \cdot {\left(\sqrt{3}\right)}^{2}} + \left(-3 \cdot \frac{2 \cdot \frac{\left(-4.5 \cdot \left({a}^{2} \cdot {c}^{2}\right) + -1 \cdot \left(-0.25 \cdot \left({a}^{2} \cdot \left({c}^{2} \cdot {\left(\sqrt{3}\right)}^{4}\right)\right) + -0.125 \cdot \left({a}^{2} \cdot \left({c}^{2} \cdot {\left(\sqrt{3}\right)}^{4}\right)\right)\right)\right) \cdot \left(4 \cdot \frac{-1 \cdot \left(-0.5 \cdot \left(a \cdot \left(c \cdot \left({\left(\sqrt{3}\right)}^{2} \cdot \left(-0.25 \cdot \left({a}^{2} \cdot \left({c}^{2} \cdot {\left(\sqrt{3}\right)}^{4}\right)\right) + -0.125 \cdot \left({a}^{2} \cdot \left({c}^{2} \cdot {\left(\sqrt{3}\right)}^{4}\right)\right)\right)\right)\right)\right) + 0.125 \cdot \left({a}^{3} \cdot \left({c}^{3} \cdot {\left(\sqrt{3}\right)}^{6}\right)\right)\right) + 2.25 \cdot \left({a}^{3} \cdot \left({c}^{3} \cdot {\left(\sqrt{3}\right)}^{2}\right)\right)}{a \cdot \left({c}^{2} \cdot {\left(\sqrt{3}\right)}^{4}\right)} + 8 \cdot \frac{{\left(-4.5 \cdot \left({a}^{2} \cdot {c}^{2}\right) + -1 \cdot \left(-0.25 \cdot \left({a}^{2} \cdot \left({c}^{2} \cdot {\left(\sqrt{3}\right)}^{4}\right)\right) + -0.125 \cdot \left({a}^{2} \cdot \left({c}^{2} \cdot {\left(\sqrt{3}\right)}^{4}\right)\right)\right)\right)}^{2}}{{a}^{2} \cdot \left({c}^{3} \cdot {\left(\sqrt{3}\right)}^{6}\right)}\right)}{a \cdot \left(c \cdot {\left(\sqrt{3}\right)}^{2}\right)} + \left(4 \cdot \frac{-10.125 \cdot \left({a}^{4} \cdot {c}^{4}\right) + \left(-1 \cdot \left(-0.5 \cdot \left(a \cdot \left(c \cdot \left({\left(\sqrt{3}\right)}^{2} \cdot \left(-0.5 \cdot \left(a \cdot \left(c \cdot \left({\left(\sqrt{3}\right)}^{2} \cdot \left(-0.25 \cdot \left({a}^{2} \cdot \left({c}^{2} \cdot {\left(\sqrt{3}\right)}^{4}\right)\right) + -0.125 \cdot \left({a}^{2} \cdot \left({c}^{2} \cdot {\left(\sqrt{3}\right)}^{4}\right)\right)\right)\right)\right)\right) + 0.125 \cdot \left({a}^{3} \cdot \left({c}^{3} \cdot {\left(\sqrt{3}\right)}^{6}\right)\right)\right)\right)\right)\right) + \left(-0.5 \cdot \left(0.0625 \cdot \left({a}^{4} \cdot \left({c}^{4} \cdot {\left(\sqrt{3}\right)}^{8}\right)\right) + {\left(-0.125 \cdot \left({a}^{2} \cdot \left({c}^{2} \cdot {\left(\sqrt{3}\right)}^{4}\right)\right)\right)}^{2}\right) + \left(-0.03125 \cdot \left({a}^{4} \cdot \left({c}^{4} \cdot {\left(\sqrt{3}\right)}^{8}\right)\right) + 0.125 \cdot \left({a}^{2} \cdot \left({c}^{2} \cdot \left({\left(\sqrt{3}\right)}^{4} \cdot \left(-0.25 \cdot \left({a}^{2} \cdot \left({c}^{2} \cdot {\left(\sqrt{3}\right)}^{4}\right)\right) + -0.125 \cdot \left({a}^{2} \cdot \left({c}^{2} \cdot {\left(\sqrt{3}\right)}^{4}\right)\right)\right)\right)\right)\right)\right)\right)\right) + 4.5 \cdot \left({a}^{2} \cdot \left({c}^{2} \cdot \left(-0.25 \cdot \left({a}^{2} \cdot \left({c}^{2} \cdot {\left(\sqrt{3}\right)}^{4}\right)\right) + -0.125 \cdot \left({a}^{2} \cdot \left({c}^{2} \cdot {\left(\sqrt{3}\right)}^{4}\right)\right)\right)\right)\right)\right)}{a \cdot \left({c}^{2} \cdot {\left(\sqrt{3}\right)}^{4}\right)} + 8 \cdot \frac{\left(-4.5 \cdot \left({a}^{2} \cdot {c}^{2}\right) + -1 \cdot \left(-0.25 \cdot \left({a}^{2} \cdot \left({c}^{2} \cdot {\left(\sqrt{3}\right)}^{4}\right)\right) + -0.125 \cdot \left({a}^{2} \cdot \left({c}^{2} \cdot {\left(\sqrt{3}\right)}^{4}\right)\right)\right)\right) \cdot \left(-1 \cdot \left(-0.5 \cdot \left(a \cdot \left(c \cdot \left({\left(\sqrt{3}\right)}^{2} \cdot \left(-0.25 \cdot \left({a}^{2} \cdot \left({c}^{2} \cdot {\left(\sqrt{3}\right)}^{4}\right)\right) + -0.125 \cdot \left({a}^{2} \cdot \left({c}^{2} \cdot {\left(\sqrt{3}\right)}^{4}\right)\right)\right)\right)\right)\right) + 0.125 \cdot \left({a}^{3} \cdot \left({c}^{3} \cdot {\left(\sqrt{3}\right)}^{6}\right)\right)\right) + 2.25 \cdot \left({a}^{3} \cdot \left({c}^{3} \cdot {\left(\sqrt{3}\right)}^{2}\right)\right)\right)}{{a}^{2} \cdot \left({c}^{3} \cdot {\left(\sqrt{3}\right)}^{6}\right)}\right)}{{b}^{5}} + -3 \cdot \frac{4 \cdot \frac{-1 \cdot \left(-0.5 \cdot \left(a \cdot \left(c \cdot \left({\left(\sqrt{3}\right)}^{2} \cdot \left(-0.25 \cdot \left({a}^{2} \cdot \left({c}^{2} \cdot {\left(\sqrt{3}\right)}^{4}\right)\right) + -0.125 \cdot \left({a}^{2} \cdot \left({c}^{2} \cdot {\left(\sqrt{3}\right)}^{4}\right)\right)\right)\right)\right)\right) + 0.125 \cdot \left({a}^{3} \cdot \left({c}^{3} \cdot {\left(\sqrt{3}\right)}^{6}\right)\right)\right) + 2.25 \cdot \left({a}^{3} \cdot \left({c}^{3} \cdot {\left(\sqrt{3}\right)}^{2}\right)\right)}{a \cdot \left({c}^{2} \cdot {\left(\sqrt{3}\right)}^{4}\right)} + 8 \cdot \frac{{\left(-4.5 \cdot \left({a}^{2} \cdot {c}^{2}\right) + -1 \cdot \left(-0.25 \cdot \left({a}^{2} \cdot \left({c}^{2} \cdot {\left(\sqrt{3}\right)}^{4}\right)\right) + -0.125 \cdot \left({a}^{2} \cdot \left({c}^{2} \cdot {\left(\sqrt{3}\right)}^{4}\right)\right)\right)\right)}^{2}}{{a}^{2} \cdot \left({c}^{3} \cdot {\left(\sqrt{3}\right)}^{6}\right)}}{{b}^{3}}\right)\right)\right)}}^{-1} \]
  9. Simplified95.2%

    \[\leadsto {\color{blue}{\left(\mathsf{fma}\left(-12, \frac{\mathsf{fma}\left(-4.5, {\left(a \cdot c\right)}^{2}, {\left(a \cdot \left(3 \cdot c\right)\right)}^{2} \cdot 0.375\right)}{a \cdot \left(b \cdot \left({c}^{2} \cdot 9\right)\right)}, \mathsf{fma}\left(-3, \frac{\mathsf{fma}\left(2, \frac{\mathsf{fma}\left(-4.5, {\left(a \cdot c\right)}^{2}, {\left(a \cdot \left(3 \cdot c\right)\right)}^{2} \cdot 0.375\right)}{a} \cdot \frac{\mathsf{fma}\left(4, \frac{2.25 \cdot \left({a}^{3} \cdot \left(3 \cdot {c}^{3}\right)\right) - \mathsf{fma}\left(-0.5, a \cdot \left(c \cdot \left(3 \cdot \left({\left(a \cdot \left(3 \cdot c\right)\right)}^{2} \cdot -0.375\right)\right)\right), 0.125 \cdot {\left(a \cdot \left(3 \cdot c\right)\right)}^{3}\right)}{a \cdot \left({c}^{2} \cdot 9\right)}, 8 \cdot \frac{{\left(\mathsf{fma}\left(-4.5, {\left(a \cdot c\right)}^{2}, {\left(a \cdot \left(3 \cdot c\right)\right)}^{2} \cdot 0.375\right)\right)}^{2}}{{a}^{2} \cdot \left({c}^{3} \cdot 27\right)}\right)}{3 \cdot c}, \mathsf{fma}\left(4, \frac{\mathsf{fma}\left(-10.125, {\left(a \cdot c\right)}^{4}, 4.5 \cdot \left({\left(a \cdot c\right)}^{2} \cdot \left({\left(a \cdot \left(3 \cdot c\right)\right)}^{2} \cdot -0.375\right)\right) - \mathsf{fma}\left(-0.5, a \cdot \left(\left(3 \cdot c\right) \cdot \mathsf{fma}\left(-0.5, a \cdot \left(c \cdot \left(3 \cdot \left({\left(a \cdot \left(3 \cdot c\right)\right)}^{2} \cdot -0.375\right)\right)\right), 0.125 \cdot {\left(a \cdot \left(3 \cdot c\right)\right)}^{3}\right)\right), \mathsf{fma}\left(-0.5, \mathsf{fma}\left(0.0625, {\left(a \cdot c\right)}^{4} \cdot 81, {\left(-0.125 \cdot {\left(a \cdot \left(3 \cdot c\right)\right)}^{2}\right)}^{2}\right), \mathsf{fma}\left(0.125, {\left(a \cdot c\right)}^{2} \cdot \left(9 \cdot \left({\left(a \cdot \left(3 \cdot c\right)\right)}^{2} \cdot -0.375\right)\right), -0.03125 \cdot \left({\left(a \cdot c\right)}^{4} \cdot 81\right)\right)\right)\right)\right)}{a \cdot \left({c}^{2} \cdot 9\right)}, 8 \cdot \left(\frac{\mathsf{fma}\left(-4.5, {\left(a \cdot c\right)}^{2}, {\left(a \cdot \left(3 \cdot c\right)\right)}^{2} \cdot 0.375\right)}{{a}^{2}} \cdot \frac{2.25 \cdot \left({a}^{3} \cdot \left(3 \cdot {c}^{3}\right)\right) - \mathsf{fma}\left(-0.5, a \cdot \left(c \cdot \left(3 \cdot \left({\left(a \cdot \left(3 \cdot c\right)\right)}^{2} \cdot -0.375\right)\right)\right), 0.125 \cdot {\left(a \cdot \left(3 \cdot c\right)\right)}^{3}\right)}{{c}^{3} \cdot 27}\right)\right)\right)}{{b}^{5}} + \frac{\mathsf{fma}\left(4, \frac{2.25 \cdot \left({a}^{3} \cdot \left(3 \cdot {c}^{3}\right)\right) - \mathsf{fma}\left(-0.5, a \cdot \left(c \cdot \left(3 \cdot \left({\left(a \cdot \left(3 \cdot c\right)\right)}^{2} \cdot -0.375\right)\right)\right), 0.125 \cdot {\left(a \cdot \left(3 \cdot c\right)\right)}^{3}\right)}{a \cdot \left({c}^{2} \cdot 9\right)}, 8 \cdot \frac{{\left(\mathsf{fma}\left(-4.5, {\left(a \cdot c\right)}^{2}, {\left(a \cdot \left(3 \cdot c\right)\right)}^{2} \cdot 0.375\right)\right)}^{2}}{{a}^{2} \cdot \left({c}^{3} \cdot 27\right)}\right)}{{b}^{3}}, -2 \cdot \frac{b}{c}\right)\right)\right)}}^{-1} \]
  10. Final simplification95.2%

    \[\leadsto {\left(\mathsf{fma}\left(-12, \frac{\mathsf{fma}\left(-4.5, {\left(a \cdot c\right)}^{2}, {\left(a \cdot \left(c \cdot 3\right)\right)}^{2} \cdot 0.375\right)}{a \cdot \left(b \cdot \left({c}^{2} \cdot 9\right)\right)}, \mathsf{fma}\left(-3, \frac{\mathsf{fma}\left(2, \frac{\mathsf{fma}\left(-4.5, {\left(a \cdot c\right)}^{2}, {\left(a \cdot \left(c \cdot 3\right)\right)}^{2} \cdot 0.375\right)}{a} \cdot \frac{\mathsf{fma}\left(4, \frac{2.25 \cdot \left({a}^{3} \cdot \left(3 \cdot {c}^{3}\right)\right) - \mathsf{fma}\left(-0.5, a \cdot \left(c \cdot \left(3 \cdot \left({\left(a \cdot \left(c \cdot 3\right)\right)}^{2} \cdot -0.375\right)\right)\right), 0.125 \cdot {\left(a \cdot \left(c \cdot 3\right)\right)}^{3}\right)}{a \cdot \left({c}^{2} \cdot 9\right)}, 8 \cdot \frac{{\left(\mathsf{fma}\left(-4.5, {\left(a \cdot c\right)}^{2}, {\left(a \cdot \left(c \cdot 3\right)\right)}^{2} \cdot 0.375\right)\right)}^{2}}{{a}^{2} \cdot \left({c}^{3} \cdot 27\right)}\right)}{c \cdot 3}, \mathsf{fma}\left(4, \frac{\mathsf{fma}\left(-10.125, {\left(a \cdot c\right)}^{4}, 4.5 \cdot \left({\left(a \cdot c\right)}^{2} \cdot \left({\left(a \cdot \left(c \cdot 3\right)\right)}^{2} \cdot -0.375\right)\right) - \mathsf{fma}\left(-0.5, a \cdot \left(\left(c \cdot 3\right) \cdot \mathsf{fma}\left(-0.5, a \cdot \left(c \cdot \left(3 \cdot \left({\left(a \cdot \left(c \cdot 3\right)\right)}^{2} \cdot -0.375\right)\right)\right), 0.125 \cdot {\left(a \cdot \left(c \cdot 3\right)\right)}^{3}\right)\right), \mathsf{fma}\left(-0.5, \mathsf{fma}\left(0.0625, {\left(a \cdot c\right)}^{4} \cdot 81, {\left({\left(a \cdot \left(c \cdot 3\right)\right)}^{2} \cdot -0.125\right)}^{2}\right), \mathsf{fma}\left(0.125, {\left(a \cdot c\right)}^{2} \cdot \left(9 \cdot \left({\left(a \cdot \left(c \cdot 3\right)\right)}^{2} \cdot -0.375\right)\right), \left({\left(a \cdot c\right)}^{4} \cdot 81\right) \cdot -0.03125\right)\right)\right)\right)}{a \cdot \left({c}^{2} \cdot 9\right)}, 8 \cdot \left(\frac{\mathsf{fma}\left(-4.5, {\left(a \cdot c\right)}^{2}, {\left(a \cdot \left(c \cdot 3\right)\right)}^{2} \cdot 0.375\right)}{{a}^{2}} \cdot \frac{2.25 \cdot \left({a}^{3} \cdot \left(3 \cdot {c}^{3}\right)\right) - \mathsf{fma}\left(-0.5, a \cdot \left(c \cdot \left(3 \cdot \left({\left(a \cdot \left(c \cdot 3\right)\right)}^{2} \cdot -0.375\right)\right)\right), 0.125 \cdot {\left(a \cdot \left(c \cdot 3\right)\right)}^{3}\right)}{{c}^{3} \cdot 27}\right)\right)\right)}{{b}^{5}} + \frac{\mathsf{fma}\left(4, \frac{2.25 \cdot \left({a}^{3} \cdot \left(3 \cdot {c}^{3}\right)\right) - \mathsf{fma}\left(-0.5, a \cdot \left(c \cdot \left(3 \cdot \left({\left(a \cdot \left(c \cdot 3\right)\right)}^{2} \cdot -0.375\right)\right)\right), 0.125 \cdot {\left(a \cdot \left(c \cdot 3\right)\right)}^{3}\right)}{a \cdot \left({c}^{2} \cdot 9\right)}, 8 \cdot \frac{{\left(\mathsf{fma}\left(-4.5, {\left(a \cdot c\right)}^{2}, {\left(a \cdot \left(c \cdot 3\right)\right)}^{2} \cdot 0.375\right)\right)}^{2}}{{a}^{2} \cdot \left({c}^{3} \cdot 27\right)}\right)}{{b}^{3}}, -2 \cdot \frac{b}{c}\right)\right)\right)}^{-1} \]

Alternative 2: 95.4% accurate, 0.2× speedup?

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

\\
-0.5625 \cdot \frac{{c}^{3} \cdot {a}^{2}}{{b}^{5}} + \left(-0.5 \cdot \frac{c}{b} + \left(-0.375 \cdot \frac{a \cdot {c}^{2}}{{b}^{3}} + -1.0546875 \cdot \frac{{\left(a \cdot c\right)}^{4}}{a \cdot {b}^{7}}\right)\right)
\end{array}
Derivation
  1. Initial program 31.3%

    \[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a} \]
  2. Taylor expanded in b around inf 95.2%

    \[\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)} \]
  3. Taylor expanded in c around 0 95.2%

    \[\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}} + \color{blue}{-0.16666666666666666 \cdot \frac{{c}^{4} \cdot \left(1.265625 \cdot {a}^{4} + 5.0625 \cdot {a}^{4}\right)}{a \cdot {b}^{7}}}\right)\right) \]
  4. Step-by-step derivation
    1. associate-*r/95.2%

      \[\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}} + \color{blue}{\frac{-0.16666666666666666 \cdot \left({c}^{4} \cdot \left(1.265625 \cdot {a}^{4} + 5.0625 \cdot {a}^{4}\right)\right)}{a \cdot {b}^{7}}}\right)\right) \]
  5. Simplified95.2%

    \[\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}} + \color{blue}{-0.16666666666666666 \cdot \frac{{\left(a \cdot c\right)}^{4}}{\frac{a \cdot {b}^{7}}{6.328125}}}\right)\right) \]
  6. Step-by-step derivation
    1. expm1-log1p-u93.9%

      \[\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}} + \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(-0.16666666666666666 \cdot \frac{{\left(a \cdot c\right)}^{4}}{\frac{a \cdot {b}^{7}}{6.328125}}\right)\right)}\right)\right) \]
    2. expm1-udef93.5%

      \[\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}} + \color{blue}{\left(e^{\mathsf{log1p}\left(-0.16666666666666666 \cdot \frac{{\left(a \cdot c\right)}^{4}}{\frac{a \cdot {b}^{7}}{6.328125}}\right)} - 1\right)}\right)\right) \]
    3. associate-*r/93.5%

      \[\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}} + \left(e^{\mathsf{log1p}\left(\color{blue}{\frac{-0.16666666666666666 \cdot {\left(a \cdot c\right)}^{4}}{\frac{a \cdot {b}^{7}}{6.328125}}}\right)} - 1\right)\right)\right) \]
    4. div-inv93.5%

      \[\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}} + \left(e^{\mathsf{log1p}\left(\frac{-0.16666666666666666 \cdot {\left(a \cdot c\right)}^{4}}{\color{blue}{\left(a \cdot {b}^{7}\right) \cdot \frac{1}{6.328125}}}\right)} - 1\right)\right)\right) \]
    5. metadata-eval93.5%

      \[\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}} + \left(e^{\mathsf{log1p}\left(\frac{-0.16666666666666666 \cdot {\left(a \cdot c\right)}^{4}}{\left(a \cdot {b}^{7}\right) \cdot \color{blue}{0.1580246913580247}}\right)} - 1\right)\right)\right) \]
  7. Applied egg-rr93.5%

    \[\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}} + \color{blue}{\left(e^{\mathsf{log1p}\left(\frac{-0.16666666666666666 \cdot {\left(a \cdot c\right)}^{4}}{\left(a \cdot {b}^{7}\right) \cdot 0.1580246913580247}\right)} - 1\right)}\right)\right) \]
  8. Step-by-step derivation
    1. expm1-def93.9%

      \[\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}} + \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{-0.16666666666666666 \cdot {\left(a \cdot c\right)}^{4}}{\left(a \cdot {b}^{7}\right) \cdot 0.1580246913580247}\right)\right)}\right)\right) \]
    2. expm1-log1p95.2%

      \[\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}} + \color{blue}{\frac{-0.16666666666666666 \cdot {\left(a \cdot c\right)}^{4}}{\left(a \cdot {b}^{7}\right) \cdot 0.1580246913580247}}\right)\right) \]
    3. *-commutative95.2%

      \[\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}} + \frac{-0.16666666666666666 \cdot {\left(a \cdot c\right)}^{4}}{\color{blue}{0.1580246913580247 \cdot \left(a \cdot {b}^{7}\right)}}\right)\right) \]
    4. times-frac95.2%

      \[\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}} + \color{blue}{\frac{-0.16666666666666666}{0.1580246913580247} \cdot \frac{{\left(a \cdot c\right)}^{4}}{a \cdot {b}^{7}}}\right)\right) \]
    5. metadata-eval95.2%

      \[\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}} + \color{blue}{-1.0546875} \cdot \frac{{\left(a \cdot c\right)}^{4}}{a \cdot {b}^{7}}\right)\right) \]
  9. Simplified95.2%

    \[\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}} + \color{blue}{-1.0546875 \cdot \frac{{\left(a \cdot c\right)}^{4}}{a \cdot {b}^{7}}}\right)\right) \]
  10. Final simplification95.2%

    \[\leadsto -0.5625 \cdot \frac{{c}^{3} \cdot {a}^{2}}{{b}^{5}} + \left(-0.5 \cdot \frac{c}{b} + \left(-0.375 \cdot \frac{a \cdot {c}^{2}}{{b}^{3}} + -1.0546875 \cdot \frac{{\left(a \cdot c\right)}^{4}}{a \cdot {b}^{7}}\right)\right) \]

Alternative 3: 90.4% accurate, 0.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \sqrt{a \cdot \left(c \cdot 3\right)}\\ \mathbf{if}\;\frac{\sqrt{b \cdot b - c \cdot \left(a \cdot 3\right)} - b}{a \cdot 3} \leq -1:\\ \;\;\;\;\frac{\mathsf{fma}\left(\sqrt{b + t_0}, \sqrt{b - t_0}, -b\right)}{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
 (let* ((t_0 (sqrt (* a (* c 3.0)))))
   (if (<= (/ (- (sqrt (- (* b b) (* c (* a 3.0)))) b) (* a 3.0)) -1.0)
     (/ (fma (sqrt (+ b t_0)) (sqrt (- b t_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 t_0 = sqrt((a * (c * 3.0)));
	double tmp;
	if (((sqrt(((b * b) - (c * (a * 3.0)))) - b) / (a * 3.0)) <= -1.0) {
		tmp = fma(sqrt((b + t_0)), sqrt((b - t_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)
	t_0 = sqrt(Float64(a * Float64(c * 3.0)))
	tmp = 0.0
	if (Float64(Float64(sqrt(Float64(Float64(b * b) - Float64(c * Float64(a * 3.0)))) - b) / Float64(a * 3.0)) <= -1.0)
		tmp = Float64(fma(sqrt(Float64(b + t_0)), sqrt(Float64(b - t_0)), Float64(-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_] := Block[{t$95$0 = N[Sqrt[N[(a * N[(c * 3.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, 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], -1.0], N[(N[(N[Sqrt[N[(b + t$95$0), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(b - t$95$0), $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}
t_0 := \sqrt{a \cdot \left(c \cdot 3\right)}\\
\mathbf{if}\;\frac{\sqrt{b \cdot b - c \cdot \left(a \cdot 3\right)} - b}{a \cdot 3} \leq -1:\\
\;\;\;\;\frac{\mathsf{fma}\left(\sqrt{b + t_0}, \sqrt{b - t_0}, -b\right)}{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)) < -1

    1. Initial program 80.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 25.2%

      \[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a} \]
    2. Taylor expanded in b around inf 94.2%

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

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

Alternative 4: 93.8% accurate, 0.2× speedup?

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

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

    \[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a} \]
  2. Taylor expanded in b around inf 93.6%

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

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

Alternative 5: 90.4% accurate, 0.3× speedup?

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

    1. Initial program 80.9%

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

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

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

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

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

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

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

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

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

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

    1. Initial program 25.2%

      \[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a} \]
    2. Taylor expanded in b around inf 94.2%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{\sqrt{b \cdot b - c \cdot \left(a \cdot 3\right)} - b}{a \cdot 3} \leq -1:\\ \;\;\;\;\frac{\sqrt{\left(b + \sqrt{\left(a \cdot c\right) \cdot 3}\right) \cdot \left(b - \sqrt{\left(a \cdot c\right) \cdot 3}\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} \]

Alternative 6: 90.4% accurate, 0.4× 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 -1:\\ \;\;\;\;\frac{\sqrt{\mathsf{fma}\left(b, b, \left(a \cdot c\right) \cdot \left(-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)) -1.0)
   (/ (- (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)) <= -1.0) {
		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)) <= -1.0)
		tmp = Float64(Float64(sqrt(fma(b, b, Float64(Float64(a * c) * Float64(-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], -1.0], N[(N[(N[Sqrt[N[(b * b + N[(N[(a * c), $MachinePrecision] * (-3.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 -1:\\
\;\;\;\;\frac{\sqrt{\mathsf{fma}\left(b, b, \left(a \cdot c\right) \cdot \left(-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)) < -1

    1. Initial program 80.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 25.2%

      \[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a} \]
    2. Taylor expanded in b around inf 94.2%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{\sqrt{b \cdot b - c \cdot \left(a \cdot 3\right)} - b}{a \cdot 3} \leq -1:\\ \;\;\;\;\frac{\sqrt{\mathsf{fma}\left(b, b, \left(a \cdot c\right) \cdot \left(-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} \]

Alternative 7: 83.7% accurate, 0.4× 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 -1:\\ \;\;\;\;\frac{\sqrt{\mathsf{fma}\left(b, b, \left(a \cdot c\right) \cdot \left(-3\right)\right)} - b}{a \cdot 3}\\ \mathbf{else}:\\ \;\;\;\;-0.5 \cdot \frac{c}{b}\\ \end{array} \end{array} \]
(FPCore (a b c)
 :precision binary64
 (if (<= (/ (- (sqrt (- (* b b) (* c (* a 3.0)))) b) (* a 3.0)) -1.0)
   (/ (- (sqrt (fma b b (* (* a c) (- 3.0)))) b) (* a 3.0))
   (* -0.5 (/ c b))))
double code(double a, double b, double c) {
	double tmp;
	if (((sqrt(((b * b) - (c * (a * 3.0)))) - b) / (a * 3.0)) <= -1.0) {
		tmp = (sqrt(fma(b, b, ((a * c) * -3.0))) - b) / (a * 3.0);
	} else {
		tmp = -0.5 * (c / 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)) <= -1.0)
		tmp = Float64(Float64(sqrt(fma(b, b, Float64(Float64(a * c) * Float64(-3.0)))) - b) / Float64(a * 3.0));
	else
		tmp = Float64(-0.5 * Float64(c / 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], -1.0], N[(N[(N[Sqrt[N[(b * b + N[(N[(a * c), $MachinePrecision] * (-3.0)), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision] / N[(a * 3.0), $MachinePrecision]), $MachinePrecision], N[(-0.5 * N[(c / b), $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 -1:\\
\;\;\;\;\frac{\sqrt{\mathsf{fma}\left(b, b, \left(a \cdot c\right) \cdot \left(-3\right)\right)} - b}{a \cdot 3}\\

\mathbf{else}:\\
\;\;\;\;-0.5 \cdot \frac{c}{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)) < -1

    1. Initial program 80.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 25.2%

      \[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a} \]
    2. Taylor expanded in b around inf 86.6%

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

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

Alternative 8: 83.7% 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 -1:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;-0.5 \cdot \frac{c}{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 -1.0) t_0 (* -0.5 (/ c 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 <= -1.0) {
		tmp = t_0;
	} else {
		tmp = -0.5 * (c / 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 <= (-1.0d0)) then
        tmp = t_0
    else
        tmp = (-0.5d0) * (c / 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 <= -1.0) {
		tmp = t_0;
	} else {
		tmp = -0.5 * (c / 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 <= -1.0:
		tmp = t_0
	else:
		tmp = -0.5 * (c / 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 <= -1.0)
		tmp = t_0;
	else
		tmp = Float64(-0.5 * Float64(c / 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 <= -1.0)
		tmp = t_0;
	else
		tmp = -0.5 * (c / 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, -1.0], t$95$0, N[(-0.5 * N[(c / b), $MachinePrecision]), $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 -1:\\
\;\;\;\;t_0\\

\mathbf{else}:\\
\;\;\;\;-0.5 \cdot \frac{c}{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)) < -1

    1. Initial program 80.9%

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

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

    1. Initial program 25.2%

      \[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a} \]
    2. Taylor expanded in b around inf 86.6%

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

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

Alternative 9: 81.2% 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 31.3%

    \[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a} \]
  2. Taylor expanded in b around inf 81.6%

    \[\leadsto \color{blue}{-0.5 \cdot \frac{c}{b}} \]
  3. Final simplification81.6%

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

Alternative 10: 3.2% accurate, 38.7× speedup?

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

\\
\frac{0}{a}
\end{array}
Derivation
  1. Initial program 31.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. add-sqr-sqrt31.3%

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{0.16666666666666666 \cdot \left(\color{blue}{0} \cdot \left(\sqrt{a \cdot c} \cdot \sqrt{3}\right)\right)}{a} \]
    4. mul0-lft3.2%

      \[\leadsto \frac{0.16666666666666666 \cdot \color{blue}{0}}{a} \]
    5. metadata-eval3.2%

      \[\leadsto \frac{\color{blue}{0}}{a} \]
  8. Simplified3.2%

    \[\leadsto \color{blue}{\frac{0}{a}} \]
  9. Final simplification3.2%

    \[\leadsto \frac{0}{a} \]

Reproduce

?
herbie shell --seed 2023319 
(FPCore (a b c)
  :name "Cubic critical, medium range"
  :precision binary64
  :pre (and (and (and (< 1.1102230246251565e-16 a) (< a 9007199254740992.0)) (and (< 1.1102230246251565e-16 b) (< b 9007199254740992.0))) (and (< 1.1102230246251565e-16 c) (< c 9007199254740992.0)))
  (/ (+ (- b) (sqrt (- (* b b) (* (* 3.0 a) c)))) (* 3.0 a)))