Cubic critical, narrow range

Percentage Accurate: 55.7% → 91.8%
Time: 18.2s
Alternatives: 11
Speedup: 23.2×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 11 alternatives:

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

Initial Program: 55.7% 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.8% accurate, 0.1× speedup?

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

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

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


\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)) < -18

    1. Initial program 87.7%

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

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

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

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

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

        \[\leadsto \frac{\left(-b\right) + \sqrt{\mathsf{fma}\left(b, \color{blue}{\sqrt{b} \cdot \sqrt{b}}, -c \cdot \left(3 \cdot a\right)\right) + \mathsf{fma}\left(-c, 3 \cdot a, c \cdot \left(3 \cdot a\right)\right)}}{3 \cdot a} \]
      6. add-sqr-sqrt88.1%

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

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

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

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

        \[\leadsto \frac{\left(-b\right) + \sqrt{\mathsf{fma}\left(b, b, -3 \cdot \left(a \cdot c\right)\right) + \mathsf{fma}\left(-c, a \cdot \color{blue}{\frac{1}{0.3333333333333333}}, c \cdot \left(3 \cdot a\right)\right)}}{3 \cdot a} \]
      11. div-inv87.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\left(-b\right) + \sqrt{\mathsf{fma}\left(c, a \cdot -3, b \cdot b\right) + \left(\left(-\frac{a}{0.3333333333333333}\right) \cdot c + \color{blue}{\left(3 \cdot a\right) \cdot c}\right)}}{3 \cdot a} \]
      14. distribute-rgt-out87.8%

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

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

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

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

        \[\leadsto \frac{\frac{\left(-b\right) \cdot \left(-b\right) - \color{blue}{\left(\mathsf{fma}\left(c, a \cdot -3, b \cdot b\right) + c \cdot \left(\left(-\frac{a}{0.3333333333333333}\right) + a \cdot 3\right)\right)}}{\left(-b\right) - \sqrt{\mathsf{fma}\left(c, a \cdot -3, b \cdot b\right) + c \cdot \left(\left(-\frac{a}{0.3333333333333333}\right) + a \cdot 3\right)}}}{3 \cdot a} \]
      3. distribute-neg-frac88.5%

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

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

      \[\leadsto \frac{\color{blue}{\frac{\left(-b\right) \cdot \left(-b\right) - \left(\mathsf{fma}\left(c, a \cdot -3, b \cdot b\right) + c \cdot \left(\frac{-a}{0.3333333333333333} + a \cdot 3\right)\right)}{\left(-b\right) - \sqrt{\mathsf{fma}\left(c, a \cdot -3, b \cdot b\right) + c \cdot \left(\frac{-a}{0.3333333333333333} + a \cdot 3\right)}}}}{3 \cdot a} \]
    8. Step-by-step derivation
      1. sqr-neg88.5%

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

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

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

    1. Initial program 49.7%

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

      \[\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)} \]
    3. Step-by-step derivation
      1. fma-def93.4%

        \[\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)} \]
      2. associate-/l*93.4%

        \[\leadsto \mathsf{fma}\left(-0.5625, \color{blue}{\frac{{c}^{3}}{\frac{{b}^{5}}{{a}^{2}}}}, -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) \]
      3. unpow293.4%

        \[\leadsto \mathsf{fma}\left(-0.5625, \frac{{c}^{3}}{\frac{{b}^{5}}{\color{blue}{a \cdot a}}}, -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) \]
      4. fma-def93.4%

        \[\leadsto \mathsf{fma}\left(-0.5625, \frac{{c}^{3}}{\frac{{b}^{5}}{a \cdot a}}, \color{blue}{\mathsf{fma}\left(-0.16666666666666666, \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}}, -0.5 \cdot \frac{c}{b} + -0.375 \cdot \frac{{c}^{2} \cdot a}{{b}^{3}}\right)}\right) \]
    4. Simplified93.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 89.5% accurate, 0.2× speedup?

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

\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 (/.f64 (+.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 3 a) c)))) (*.f64 3 a)) < -1.55000000000000004

    1. Initial program 84.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. add-sqr-sqrt84.0%

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\left(-b\right) + \sqrt{\mathsf{fma}\left(b, b, -3 \cdot \left(a \cdot c\right)\right) + \mathsf{fma}\left(-c, a \cdot \color{blue}{\frac{1}{0.3333333333333333}}, c \cdot \left(3 \cdot a\right)\right)}}{3 \cdot a} \]
      11. div-inv84.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{\frac{\left(-b\right) \cdot \left(-b\right) - \sqrt{\mathsf{fma}\left(c, a \cdot -3, b \cdot b\right) + c \cdot \left(\left(-\frac{a}{0.3333333333333333}\right) + a \cdot 3\right)} \cdot \sqrt{\mathsf{fma}\left(c, a \cdot -3, b \cdot b\right) + c \cdot \left(\left(-\frac{a}{0.3333333333333333}\right) + a \cdot 3\right)}}{\left(-b\right) - \sqrt{\mathsf{fma}\left(c, a \cdot -3, b \cdot b\right) + c \cdot \left(\left(-\frac{a}{0.3333333333333333}\right) + a \cdot 3\right)}}}}{3 \cdot a} \]
      2. add-sqr-sqrt85.3%

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

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

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

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

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

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

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

    1. Initial program 48.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 91.5%

      \[\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)} \]
    3. Step-by-step derivation
      1. fma-def91.5%

        \[\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*91.5%

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

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

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

        \[\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*91.5%

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

        \[\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) \]
    4. Simplified91.5%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{\sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c} - b}{3 \cdot a} \leq -1.55:\\ \;\;\;\;\frac{\frac{b \cdot b + \left(c \cdot \left(\frac{a}{0.3333333333333333} - 3 \cdot a\right) - \mathsf{fma}\left(c, a \cdot -3, b \cdot b\right)\right)}{\left(-b\right) - \sqrt{\mathsf{fma}\left(c, a \cdot -3, b \cdot b\right) + c \cdot \left(3 \cdot a - \frac{a}{0.3333333333333333}\right)}}}{3 \cdot a}\\ \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: 85.4% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \mathsf{fma}\left(c, a \cdot -3, b \cdot b\right)\\ \mathbf{if}\;\frac{\sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c} - b}{3 \cdot a} \leq -0.013:\\ \;\;\;\;\frac{\frac{b \cdot b + \left(c \cdot \left(\frac{a}{0.3333333333333333} - 3 \cdot a\right) - t_0\right)}{\left(-b\right) - \sqrt{t_0 + c \cdot \left(3 \cdot a - \frac{a}{0.3333333333333333}\right)}}}{3 \cdot a}\\ \mathbf{else}:\\ \;\;\;\;-0.375 \cdot \frac{c \cdot c}{\frac{{b}^{3}}{a}} + -0.5 \cdot \frac{c}{b}\\ \end{array} \end{array} \]
(FPCore (a b c)
 :precision binary64
 (let* ((t_0 (fma c (* a -3.0) (* b b))))
   (if (<= (/ (- (sqrt (- (* b b) (* (* 3.0 a) c))) b) (* 3.0 a)) -0.013)
     (/
      (/
       (+ (* b b) (- (* c (- (/ a 0.3333333333333333) (* 3.0 a))) t_0))
       (- (- b) (sqrt (+ t_0 (* c (- (* 3.0 a) (/ a 0.3333333333333333)))))))
      (* 3.0 a))
     (+ (* -0.375 (/ (* c c) (/ (pow b 3.0) a))) (* -0.5 (/ c b))))))
double code(double a, double b, double c) {
	double t_0 = fma(c, (a * -3.0), (b * b));
	double tmp;
	if (((sqrt(((b * b) - ((3.0 * a) * c))) - b) / (3.0 * a)) <= -0.013) {
		tmp = (((b * b) + ((c * ((a / 0.3333333333333333) - (3.0 * a))) - t_0)) / (-b - sqrt((t_0 + (c * ((3.0 * a) - (a / 0.3333333333333333))))))) / (3.0 * a);
	} else {
		tmp = (-0.375 * ((c * c) / (pow(b, 3.0) / a))) + (-0.5 * (c / b));
	}
	return tmp;
}
function code(a, b, c)
	t_0 = fma(c, Float64(a * -3.0), Float64(b * b))
	tmp = 0.0
	if (Float64(Float64(sqrt(Float64(Float64(b * b) - Float64(Float64(3.0 * a) * c))) - b) / Float64(3.0 * a)) <= -0.013)
		tmp = Float64(Float64(Float64(Float64(b * b) + Float64(Float64(c * Float64(Float64(a / 0.3333333333333333) - Float64(3.0 * a))) - t_0)) / Float64(Float64(-b) - sqrt(Float64(t_0 + Float64(c * Float64(Float64(3.0 * a) - Float64(a / 0.3333333333333333))))))) / Float64(3.0 * a));
	else
		tmp = Float64(Float64(-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[(c * N[(a * -3.0), $MachinePrecision] + N[(b * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(N[(N[Sqrt[N[(N[(b * b), $MachinePrecision] - N[(N[(3.0 * a), $MachinePrecision] * c), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision] / N[(3.0 * a), $MachinePrecision]), $MachinePrecision], -0.013], N[(N[(N[(N[(b * b), $MachinePrecision] + N[(N[(c * N[(N[(a / 0.3333333333333333), $MachinePrecision] - N[(3.0 * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]), $MachinePrecision] / N[((-b) - N[Sqrt[N[(t$95$0 + N[(c * N[(N[(3.0 * a), $MachinePrecision] - N[(a / 0.3333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(3.0 * a), $MachinePrecision]), $MachinePrecision], N[(N[(-0.375 * N[(N[(c * c), $MachinePrecision] / N[(N[Power[b, 3.0], $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(-0.5 * N[(c / b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

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

\mathbf{else}:\\
\;\;\;\;-0.375 \cdot \frac{c \cdot c}{\frac{{b}^{3}}{a}} + -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)) < -0.0129999999999999994

    1. Initial program 77.4%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\left(-b\right) + \sqrt{\mathsf{fma}\left(b, b, -3 \cdot \left(a \cdot c\right)\right) + \mathsf{fma}\left(-c, a \cdot \color{blue}{\frac{1}{0.3333333333333333}}, c \cdot \left(3 \cdot a\right)\right)}}{3 \cdot a} \]
      11. div-inv77.5%

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

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

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

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

        \[\leadsto \frac{\left(-b\right) + \sqrt{\mathsf{fma}\left(b, b, -3 \cdot \left(a \cdot c\right)\right) + \color{blue}{\left(\left(-c\right) \cdot \frac{a}{0.3333333333333333} + 3 \cdot \left(a \cdot c\right)\right)}}}{3 \cdot a} \]
      2. distribute-lft-neg-out77.6%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\left(-b\right) + \sqrt{\mathsf{fma}\left(c, a \cdot -3, b \cdot b\right) + \left(\left(-\frac{a}{0.3333333333333333}\right) \cdot c + \color{blue}{\left(3 \cdot a\right) \cdot c}\right)}}{3 \cdot a} \]
      14. distribute-rgt-out77.4%

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

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

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

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

        \[\leadsto \frac{\frac{\left(-b\right) \cdot \left(-b\right) - \color{blue}{\left(\mathsf{fma}\left(c, a \cdot -3, b \cdot b\right) + c \cdot \left(\left(-\frac{a}{0.3333333333333333}\right) + a \cdot 3\right)\right)}}{\left(-b\right) - \sqrt{\mathsf{fma}\left(c, a \cdot -3, b \cdot b\right) + c \cdot \left(\left(-\frac{a}{0.3333333333333333}\right) + a \cdot 3\right)}}}{3 \cdot a} \]
      3. distribute-neg-frac78.7%

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

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

      \[\leadsto \frac{\color{blue}{\frac{\left(-b\right) \cdot \left(-b\right) - \left(\mathsf{fma}\left(c, a \cdot -3, b \cdot b\right) + c \cdot \left(\frac{-a}{0.3333333333333333} + a \cdot 3\right)\right)}{\left(-b\right) - \sqrt{\mathsf{fma}\left(c, a \cdot -3, b \cdot b\right) + c \cdot \left(\frac{-a}{0.3333333333333333} + a \cdot 3\right)}}}}{3 \cdot a} \]
    8. Step-by-step derivation
      1. sqr-neg78.7%

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

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

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

    1. Initial program 43.0%

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

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

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

        \[\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*90.3%

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

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

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

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

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

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

Alternative 4: 85.0% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \mathsf{fma}\left(b, b, c \cdot \left(a \cdot -3\right)\right)\\ \mathbf{if}\;\frac{\sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c} - b}{3 \cdot a} \leq -0.05:\\ \;\;\;\;\frac{\frac{t_0 - b \cdot b}{b + \sqrt{t_0}}}{3 \cdot a}\\ \mathbf{else}:\\ \;\;\;\;-0.375 \cdot \frac{c \cdot c}{\frac{{b}^{3}}{a}} + -0.5 \cdot \frac{c}{b}\\ \end{array} \end{array} \]
(FPCore (a b c)
 :precision binary64
 (let* ((t_0 (fma b b (* c (* a -3.0)))))
   (if (<= (/ (- (sqrt (- (* b b) (* (* 3.0 a) c))) b) (* 3.0 a)) -0.05)
     (/ (/ (- t_0 (* b b)) (+ b (sqrt t_0))) (* 3.0 a))
     (+ (* -0.375 (/ (* c c) (/ (pow b 3.0) a))) (* -0.5 (/ c b))))))
double code(double a, double b, double c) {
	double t_0 = fma(b, b, (c * (a * -3.0)));
	double tmp;
	if (((sqrt(((b * b) - ((3.0 * a) * c))) - b) / (3.0 * a)) <= -0.05) {
		tmp = ((t_0 - (b * b)) / (b + sqrt(t_0))) / (3.0 * a);
	} else {
		tmp = (-0.375 * ((c * c) / (pow(b, 3.0) / a))) + (-0.5 * (c / b));
	}
	return tmp;
}
function code(a, b, c)
	t_0 = fma(b, b, Float64(c * Float64(a * -3.0)))
	tmp = 0.0
	if (Float64(Float64(sqrt(Float64(Float64(b * b) - Float64(Float64(3.0 * a) * c))) - b) / Float64(3.0 * a)) <= -0.05)
		tmp = Float64(Float64(Float64(t_0 - Float64(b * b)) / Float64(b + sqrt(t_0))) / Float64(3.0 * a));
	else
		tmp = Float64(Float64(-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[(b * b + N[(c * N[(a * -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(N[(N[Sqrt[N[(N[(b * b), $MachinePrecision] - N[(N[(3.0 * a), $MachinePrecision] * c), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision] / N[(3.0 * a), $MachinePrecision]), $MachinePrecision], -0.05], N[(N[(N[(t$95$0 - N[(b * b), $MachinePrecision]), $MachinePrecision] / N[(b + N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(3.0 * a), $MachinePrecision]), $MachinePrecision], N[(N[(-0.375 * N[(N[(c * c), $MachinePrecision] / N[(N[Power[b, 3.0], $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(-0.5 * N[(c / b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

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

\mathbf{else}:\\
\;\;\;\;-0.375 \cdot \frac{c \cdot c}{\frac{{b}^{3}}{a}} + -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)) < -0.050000000000000003

    1. Initial program 78.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-sub078.5%

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

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

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

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

      \[\leadsto \color{blue}{\frac{\sqrt{\mathsf{fma}\left(b, b, c \cdot \left(a \cdot -3\right)\right)} - b}{3 \cdot a}} \]
    4. Step-by-step derivation
      1. add-sqr-sqrt76.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 44.4%

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

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

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

        \[\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*89.4%

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

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

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

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

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

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

Alternative 5: 84.7% accurate, 0.3× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;-0.375 \cdot \frac{c \cdot c}{\frac{{b}^{3}}{a}} + -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)) < -0.050000000000000003

    1. Initial program 78.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-sub078.5%

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\sqrt{\mathsf{fma}\left(b, b, a \cdot \left(c \cdot -3\right)\right)} - b}{\color{blue}{3 \cdot a}} \]
      4. add-cbrt-cube78.7%

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

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

        \[\leadsto \frac{\sqrt{\mathsf{fma}\left(b, b, a \cdot \left(c \cdot -3\right)\right)} - b}{{\color{blue}{\left({\left(3 \cdot a\right)}^{3}\right)}}^{0.3333333333333333}} \]
      7. *-commutative78.8%

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

        \[\leadsto \frac{\sqrt{\mathsf{fma}\left(b, b, a \cdot \left(c \cdot -3\right)\right)} - b}{{\left({\left(a \cdot \color{blue}{\frac{1}{0.3333333333333333}}\right)}^{3}\right)}^{0.3333333333333333}} \]
      9. div-inv78.8%

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

      \[\leadsto \frac{\sqrt{\mathsf{fma}\left(b, b, a \cdot \left(c \cdot -3\right)\right)} - b}{\color{blue}{{\left({\left(\frac{a}{0.3333333333333333}\right)}^{3}\right)}^{0.3333333333333333}}} \]
    6. Step-by-step derivation
      1. add-cube-cbrt78.8%

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

        \[\leadsto \frac{\sqrt{\mathsf{fma}\left(b, b, a \cdot \left(c \cdot -3\right)\right)} - b}{{\left(\left(\sqrt[3]{\color{blue}{\left(\frac{a}{0.3333333333333333} \cdot \frac{a}{0.3333333333333333}\right) \cdot \frac{a}{0.3333333333333333}}} \cdot \sqrt[3]{{\left(\frac{a}{0.3333333333333333}\right)}^{3}}\right) \cdot \sqrt[3]{{\left(\frac{a}{0.3333333333333333}\right)}^{3}}\right)}^{0.3333333333333333}} \]
      3. add-cbrt-cube78.8%

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

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

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

        \[\leadsto \frac{\sqrt{\mathsf{fma}\left(b, b, a \cdot \left(c \cdot -3\right)\right)} - b}{{\left(\left(\left(a \cdot 3\right) \cdot \sqrt[3]{\color{blue}{\left(\frac{a}{0.3333333333333333} \cdot \frac{a}{0.3333333333333333}\right) \cdot \frac{a}{0.3333333333333333}}}\right) \cdot \sqrt[3]{{\left(\frac{a}{0.3333333333333333}\right)}^{3}}\right)}^{0.3333333333333333}} \]
      7. add-cbrt-cube78.8%

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

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

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

        \[\leadsto \frac{\sqrt{\mathsf{fma}\left(b, b, a \cdot \left(c \cdot -3\right)\right)} - b}{{\left(\left(\left(a \cdot 3\right) \cdot \left(a \cdot 3\right)\right) \cdot \sqrt[3]{\color{blue}{\left(\frac{a}{0.3333333333333333} \cdot \frac{a}{0.3333333333333333}\right) \cdot \frac{a}{0.3333333333333333}}}\right)}^{0.3333333333333333}} \]
      11. add-cbrt-cube78.8%

        \[\leadsto \frac{\sqrt{\mathsf{fma}\left(b, b, a \cdot \left(c \cdot -3\right)\right)} - b}{{\left(\left(\left(a \cdot 3\right) \cdot \left(a \cdot 3\right)\right) \cdot \color{blue}{\frac{a}{0.3333333333333333}}\right)}^{0.3333333333333333}} \]
      12. div-inv78.8%

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

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

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

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

    1. Initial program 44.4%

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

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

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

        \[\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*89.4%

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

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

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

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

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

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

Alternative 6: 84.8% accurate, 0.4× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;-0.375 \cdot \frac{c \cdot c}{\frac{{b}^{3}}{a}} + -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)) < -0.050000000000000003

    1. Initial program 78.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-sub078.5%

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

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

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

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

      \[\leadsto \color{blue}{\frac{\sqrt{\mathsf{fma}\left(b, b, c \cdot \left(a \cdot -3\right)\right)} - b}{3 \cdot a}} \]
    4. Step-by-step derivation
      1. add-sqr-sqrt76.8%

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

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

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

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

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

      \[\leadsto \frac{\color{blue}{{\left({\left(\mathsf{fma}\left(b, b, c \cdot \left(a \cdot -3\right)\right)\right)}^{0.25}\right)}^{2}} - b}{3 \cdot a} \]
    6. Step-by-step derivation
      1. add-log-exp61.6%

        \[\leadsto \color{blue}{\log \left(e^{\frac{{\left({\left(\mathsf{fma}\left(b, b, c \cdot \left(a \cdot -3\right)\right)\right)}^{0.25}\right)}^{2} - b}{3 \cdot a}}\right)} \]
      2. pow-pow63.0%

        \[\leadsto \log \left(e^{\frac{\color{blue}{{\left(\mathsf{fma}\left(b, b, c \cdot \left(a \cdot -3\right)\right)\right)}^{\left(0.25 \cdot 2\right)}} - b}{3 \cdot a}}\right) \]
      3. metadata-eval63.0%

        \[\leadsto \log \left(e^{\frac{{\left(\mathsf{fma}\left(b, b, c \cdot \left(a \cdot -3\right)\right)\right)}^{\color{blue}{0.5}} - b}{3 \cdot a}}\right) \]
      4. *-commutative63.0%

        \[\leadsto \log \left(e^{\frac{{\left(\mathsf{fma}\left(b, b, c \cdot \left(a \cdot -3\right)\right)\right)}^{0.5} - b}{\color{blue}{a \cdot 3}}}\right) \]
    7. Applied egg-rr63.0%

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

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

        \[\leadsto \color{blue}{\frac{-\left({\left(\mathsf{fma}\left(b, b, c \cdot \left(a \cdot -3\right)\right)\right)}^{0.5} - b\right)}{-a \cdot 3}} \]
      3. unpow1/278.7%

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

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

        \[\leadsto \frac{-\left(\sqrt{\mathsf{fma}\left(b, b, \left(c \cdot a\right) \cdot -3\right)} - b\right)}{-a \cdot \color{blue}{\frac{1}{0.3333333333333333}}} \]
      6. div-inv78.7%

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

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

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

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

    1. Initial program 44.4%

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

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

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

        \[\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*89.4%

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

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

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

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

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

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

Alternative 7: 84.8% accurate, 0.4× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;-0.375 \cdot \frac{c \cdot c}{\frac{{b}^{3}}{a}} + -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)) < -0.050000000000000003

    1. Initial program 78.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-sub078.5%

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

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

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

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

      \[\leadsto \color{blue}{\frac{\sqrt{\mathsf{fma}\left(b, b, c \cdot \left(a \cdot -3\right)\right)} - b}{3 \cdot a}} \]
    4. Step-by-step derivation
      1. add-sqr-sqrt76.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{1 \cdot \left({\left(\mathsf{fma}\left(b, b, c \cdot \left(a \cdot -3\right)\right)\right)}^{0.5} - b\right)}{\color{blue}{3 \cdot a}} \]
      4. times-frac78.7%

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

        \[\leadsto \color{blue}{0.3333333333333333} \cdot \frac{{\left(\mathsf{fma}\left(b, b, c \cdot \left(a \cdot -3\right)\right)\right)}^{0.5} - b}{a} \]
      6. unpow1/278.7%

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

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

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

    1. Initial program 44.4%

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

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

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

        \[\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*89.4%

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

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

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

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

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

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

Alternative 8: 84.8% accurate, 0.4× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;-0.375 \cdot \frac{c \cdot c}{\frac{{b}^{3}}{a}} + -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)) < -0.050000000000000003

    1. Initial program 78.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-sub078.5%

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

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

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

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

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

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

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

    1. Initial program 44.4%

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

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

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

        \[\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*89.4%

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

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

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

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

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

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

Alternative 9: 84.7% accurate, 0.5× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;-0.375 \cdot \frac{c \cdot c}{\frac{{b}^{3}}{a}} + -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)) < -0.050000000000000003

    1. Initial program 78.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. cancel-sign-sub-inv78.5%

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

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 44.4%

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

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

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

        \[\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*89.4%

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

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

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

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

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

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

Alternative 10: 81.1% accurate, 1.0× speedup?

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

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

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

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

      \[\leadsto \color{blue}{-0.375 \cdot \frac{{c}^{2} \cdot a}{{b}^{3}} + -0.5 \cdot \frac{c}{b}} \]
    2. fma-def82.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*82.9%

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

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

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

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

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

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

Alternative 11: 64.0% 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 52.7%

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

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

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

Reproduce

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