Cubic critical, medium range

Percentage Accurate: 31.3% → 99.3%
Time: 16.6s
Alternatives: 8
Speedup: 23.2×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 8 alternatives:

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

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

\[\begin{array}{l} \\ \begin{array}{l} t_0 := a \cdot \left(c \cdot 3\right)\\ \frac{\frac{c \cdot -3}{b + \frac{\sqrt{{b}^{4} - {t\_0}^{2}}}{\mathsf{hypot}\left(b, \sqrt{t\_0}\right)}}}{3} \end{array} \end{array} \]
(FPCore (a b c)
 :precision binary64
 (let* ((t_0 (* a (* c 3.0))))
   (/
    (/
     (* c -3.0)
     (+ b (/ (sqrt (- (pow b 4.0) (pow t_0 2.0))) (hypot b (sqrt t_0)))))
    3.0)))
double code(double a, double b, double c) {
	double t_0 = a * (c * 3.0);
	return ((c * -3.0) / (b + (sqrt((pow(b, 4.0) - pow(t_0, 2.0))) / hypot(b, sqrt(t_0))))) / 3.0;
}
public static double code(double a, double b, double c) {
	double t_0 = a * (c * 3.0);
	return ((c * -3.0) / (b + (Math.sqrt((Math.pow(b, 4.0) - Math.pow(t_0, 2.0))) / Math.hypot(b, Math.sqrt(t_0))))) / 3.0;
}
def code(a, b, c):
	t_0 = a * (c * 3.0)
	return ((c * -3.0) / (b + (math.sqrt((math.pow(b, 4.0) - math.pow(t_0, 2.0))) / math.hypot(b, math.sqrt(t_0))))) / 3.0
function code(a, b, c)
	t_0 = Float64(a * Float64(c * 3.0))
	return Float64(Float64(Float64(c * -3.0) / Float64(b + Float64(sqrt(Float64((b ^ 4.0) - (t_0 ^ 2.0))) / hypot(b, sqrt(t_0))))) / 3.0)
end
function tmp = code(a, b, c)
	t_0 = a * (c * 3.0);
	tmp = ((c * -3.0) / (b + (sqrt(((b ^ 4.0) - (t_0 ^ 2.0))) / hypot(b, sqrt(t_0))))) / 3.0;
end
code[a_, b_, c_] := Block[{t$95$0 = N[(a * N[(c * 3.0), $MachinePrecision]), $MachinePrecision]}, N[(N[(N[(c * -3.0), $MachinePrecision] / N[(b + N[(N[Sqrt[N[(N[Power[b, 4.0], $MachinePrecision] - N[Power[t$95$0, 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[Sqrt[b ^ 2 + N[Sqrt[t$95$0], $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 3.0), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := a \cdot \left(c \cdot 3\right)\\
\frac{\frac{c \cdot -3}{b + \frac{\sqrt{{b}^{4} - {t\_0}^{2}}}{\mathsf{hypot}\left(b, \sqrt{t\_0}\right)}}}{3}
\end{array}
\end{array}
Derivation
  1. Initial program 30.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{\frac{\sqrt{{b}^{4} - {\left(c \cdot \left(a \cdot 3\right)\right)}^{2}}}{\mathsf{hypot}\left(b, {\left(3 \cdot \left(a \cdot c\right)\right)}^{\color{blue}{0.5}}\right)} - b}{3 \cdot a} \]
    9. unpow1/230.1%

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

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

      \[\leadsto \frac{\frac{\sqrt{{b}^{4} - {\left(c \cdot \left(a \cdot 3\right)\right)}^{2}}}{\mathsf{hypot}\left(b, \sqrt{\color{blue}{\left(c \cdot a\right)} \cdot 3}\right)} - b}{3 \cdot a} \]
    12. associate-*l*30.1%

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

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

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

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

      \[\leadsto \frac{\color{blue}{\frac{{\left(\frac{\sqrt{{b}^{4} - {\left(a \cdot \left(c \cdot 3\right)\right)}^{2}}}{\mathsf{hypot}\left(b, \sqrt{a \cdot \left(c \cdot 3\right)}\right)}\right)}^{2} - {b}^{2}}{b + \frac{\sqrt{{b}^{4} - {\left(a \cdot \left(c \cdot 3\right)\right)}^{2}}}{\mathsf{hypot}\left(b, \sqrt{a \cdot \left(c \cdot 3\right)}\right)}}}}{3 \cdot a} \]
    2. Taylor expanded in b around 0 0.0%

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

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

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

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

        \[\leadsto \frac{\frac{a \cdot \frac{c \cdot -9}{\color{blue}{\sqrt{3} \cdot \sqrt{3}}}}{b + \frac{\sqrt{{b}^{4} - {\left(a \cdot \left(c \cdot 3\right)\right)}^{2}}}{\mathsf{hypot}\left(b, \sqrt{a \cdot \left(c \cdot 3\right)}\right)}}}{3 \cdot a} \]
      5. rem-square-sqrt99.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{\frac{c \cdot -3}{b + \frac{\sqrt{{b}^{4} - {\left(a \cdot \left(c \cdot 3\right)\right)}^{2}}}{\mathsf{hypot}\left(b, \sqrt{a \cdot \left(c \cdot 3\right)}\right)}}}{3} \]
    10. Add Preprocessing

    Alternative 2: 90.3% accurate, 0.3× speedup?

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

      1. Initial program 75.7%

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

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

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

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

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

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

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

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

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

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

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

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

      1. Initial program 21.9%

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

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

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

    Alternative 3: 99.1% accurate, 0.3× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_0 := a \cdot \left(c \cdot 3\right)\\ \frac{\frac{a \cdot \frac{c \cdot -9}{3}}{b + \frac{\sqrt{{b}^{4} - t\_0 \cdot t\_0}}{\mathsf{hypot}\left(b, \sqrt{t\_0}\right)}}}{a \cdot 3} \end{array} \end{array} \]
    (FPCore (a b c)
     :precision binary64
     (let* ((t_0 (* a (* c 3.0))))
       (/
        (/
         (* a (/ (* c -9.0) 3.0))
         (+ b (/ (sqrt (- (pow b 4.0) (* t_0 t_0))) (hypot b (sqrt t_0)))))
        (* a 3.0))))
    double code(double a, double b, double c) {
    	double t_0 = a * (c * 3.0);
    	return ((a * ((c * -9.0) / 3.0)) / (b + (sqrt((pow(b, 4.0) - (t_0 * t_0))) / hypot(b, sqrt(t_0))))) / (a * 3.0);
    }
    
    public static double code(double a, double b, double c) {
    	double t_0 = a * (c * 3.0);
    	return ((a * ((c * -9.0) / 3.0)) / (b + (Math.sqrt((Math.pow(b, 4.0) - (t_0 * t_0))) / Math.hypot(b, Math.sqrt(t_0))))) / (a * 3.0);
    }
    
    def code(a, b, c):
    	t_0 = a * (c * 3.0)
    	return ((a * ((c * -9.0) / 3.0)) / (b + (math.sqrt((math.pow(b, 4.0) - (t_0 * t_0))) / math.hypot(b, math.sqrt(t_0))))) / (a * 3.0)
    
    function code(a, b, c)
    	t_0 = Float64(a * Float64(c * 3.0))
    	return Float64(Float64(Float64(a * Float64(Float64(c * -9.0) / 3.0)) / Float64(b + Float64(sqrt(Float64((b ^ 4.0) - Float64(t_0 * t_0))) / hypot(b, sqrt(t_0))))) / Float64(a * 3.0))
    end
    
    function tmp = code(a, b, c)
    	t_0 = a * (c * 3.0);
    	tmp = ((a * ((c * -9.0) / 3.0)) / (b + (sqrt(((b ^ 4.0) - (t_0 * t_0))) / hypot(b, sqrt(t_0))))) / (a * 3.0);
    end
    
    code[a_, b_, c_] := Block[{t$95$0 = N[(a * N[(c * 3.0), $MachinePrecision]), $MachinePrecision]}, N[(N[(N[(a * N[(N[(c * -9.0), $MachinePrecision] / 3.0), $MachinePrecision]), $MachinePrecision] / N[(b + N[(N[Sqrt[N[(N[Power[b, 4.0], $MachinePrecision] - N[(t$95$0 * t$95$0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[Sqrt[b ^ 2 + N[Sqrt[t$95$0], $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(a * 3.0), $MachinePrecision]), $MachinePrecision]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_0 := a \cdot \left(c \cdot 3\right)\\
    \frac{\frac{a \cdot \frac{c \cdot -9}{3}}{b + \frac{\sqrt{{b}^{4} - t\_0 \cdot t\_0}}{\mathsf{hypot}\left(b, \sqrt{t\_0}\right)}}}{a \cdot 3}
    \end{array}
    \end{array}
    
    Derivation
    1. Initial program 30.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\frac{\sqrt{{b}^{4} - {\left(c \cdot \left(a \cdot 3\right)\right)}^{2}}}{\mathsf{hypot}\left(b, {\left(3 \cdot \left(a \cdot c\right)\right)}^{\color{blue}{0.5}}\right)} - b}{3 \cdot a} \]
      9. unpow1/230.1%

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

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

        \[\leadsto \frac{\frac{\sqrt{{b}^{4} - {\left(c \cdot \left(a \cdot 3\right)\right)}^{2}}}{\mathsf{hypot}\left(b, \sqrt{\color{blue}{\left(c \cdot a\right)} \cdot 3}\right)} - b}{3 \cdot a} \]
      12. associate-*l*30.1%

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

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

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

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

        \[\leadsto \frac{\color{blue}{\frac{{\left(\frac{\sqrt{{b}^{4} - {\left(a \cdot \left(c \cdot 3\right)\right)}^{2}}}{\mathsf{hypot}\left(b, \sqrt{a \cdot \left(c \cdot 3\right)}\right)}\right)}^{2} - {b}^{2}}{b + \frac{\sqrt{{b}^{4} - {\left(a \cdot \left(c \cdot 3\right)\right)}^{2}}}{\mathsf{hypot}\left(b, \sqrt{a \cdot \left(c \cdot 3\right)}\right)}}}}{3 \cdot a} \]
      2. Taylor expanded in b around 0 0.0%

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

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

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

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

          \[\leadsto \frac{\frac{a \cdot \frac{c \cdot -9}{\color{blue}{\sqrt{3} \cdot \sqrt{3}}}}{b + \frac{\sqrt{{b}^{4} - {\left(a \cdot \left(c \cdot 3\right)\right)}^{2}}}{\mathsf{hypot}\left(b, \sqrt{a \cdot \left(c \cdot 3\right)}\right)}}}{3 \cdot a} \]
        5. rem-square-sqrt99.1%

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

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

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

        \[\leadsto \frac{\frac{a \cdot \frac{c \cdot -9}{3}}{b + \frac{\sqrt{{b}^{4} - \color{blue}{\left(a \cdot \left(c \cdot 3\right)\right) \cdot \left(a \cdot \left(c \cdot 3\right)\right)}}}{\mathsf{hypot}\left(b, \sqrt{a \cdot \left(c \cdot 3\right)}\right)}}}{3 \cdot a} \]
      7. Final simplification99.1%

        \[\leadsto \frac{\frac{a \cdot \frac{c \cdot -9}{3}}{b + \frac{\sqrt{{b}^{4} - \left(a \cdot \left(c \cdot 3\right)\right) \cdot \left(a \cdot \left(c \cdot 3\right)\right)}}{\mathsf{hypot}\left(b, \sqrt{a \cdot \left(c \cdot 3\right)}\right)}}}{a \cdot 3} \]
      8. Add Preprocessing

      Alternative 4: 90.3% accurate, 0.3× speedup?

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

        1. Initial program 75.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. /-rgt-identity75.7%

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

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

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

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

        1. Initial program 21.9%

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

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

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

      Alternative 5: 83.8% accurate, 0.3× speedup?

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

        1. Initial program 69.8%

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

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

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

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

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

        1. Initial program 13.4%

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

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

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

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

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

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

      Alternative 6: 83.8% accurate, 0.5× speedup?

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

        1. Initial program 69.8%

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

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

        1. Initial program 13.4%

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

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

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

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

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

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

      Alternative 7: 81.4% accurate, 23.2× speedup?

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

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

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

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

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

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

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

      Alternative 8: 3.2% accurate, 38.7× speedup?

      \[\begin{array}{l} \\ \frac{0}{a} \end{array} \]
      (FPCore (a b c) :precision binary64 (/ 0.0 a))
      double code(double a, double b, double c) {
      	return 0.0 / a;
      }
      
      real(8) function code(a, b, c)
          real(8), intent (in) :: a
          real(8), intent (in) :: b
          real(8), intent (in) :: c
          code = 0.0d0 / a
      end function
      
      public static double code(double a, double b, double c) {
      	return 0.0 / a;
      }
      
      def code(a, b, c):
      	return 0.0 / a
      
      function code(a, b, c)
      	return Float64(0.0 / a)
      end
      
      function tmp = code(a, b, c)
      	tmp = 0.0 / a;
      end
      
      code[a_, b_, c_] := N[(0.0 / a), $MachinePrecision]
      
      \begin{array}{l}
      
      \\
      \frac{0}{a}
      \end{array}
      
      Derivation
      1. Initial program 30.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{0}{a} \]
      11. Add Preprocessing

      Reproduce

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