Cubic critical, narrow range

Percentage Accurate: 54.7% → 91.9%
Time: 22.4s
Alternatives: 13
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 13 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: 54.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.9% accurate, 0.1× speedup?

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

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

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


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

    1. Initial program 86.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 0.450000000000000011 < b

    1. Initial program 52.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. neg-sub052.0%

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{-1.6875 \cdot \frac{{c}^{3} \cdot {a}^{2}}{{\left(\sqrt{3}\right)}^{2} \cdot {b}^{5}} + \left(-0.5 \cdot \frac{{a}^{3} \cdot \left({\left(-1.125 \cdot \frac{{c}^{2}}{{b}^{3}}\right)}^{2} + 5.0625 \cdot \frac{{c}^{4}}{{b}^{6}}\right)}{{\left(\sqrt{3}\right)}^{2} \cdot b} + \left(-1.125 \cdot \frac{{c}^{2} \cdot a}{{\left(\sqrt{3}\right)}^{2} \cdot {b}^{3}} + -1.5 \cdot \frac{c}{{\left(\sqrt{3}\right)}^{2} \cdot b}\right)\right)} \]
    7. Simplified93.1%

      \[\leadsto \color{blue}{\mathsf{fma}\left(-0.16666666666666666, \frac{{a}^{3} \cdot \mathsf{fma}\left(1.265625, \frac{{c}^{4}}{{b}^{6}}, \frac{{c}^{4} \cdot 5.0625}{{b}^{6}}\right)}{b}, \mathsf{fma}\left(-0.5, \frac{c}{b}, \mathsf{fma}\left(-0.375, a \cdot \left(\frac{c}{{b}^{3}} \cdot c\right), -0.5625 \cdot \left(a \cdot \left(a \cdot \frac{{c}^{3}}{{b}^{5}}\right)\right)\right)\right)\right)} \]
    8. Taylor expanded in a around 0 93.1%

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

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

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

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

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

Alternative 2: 91.9% accurate, 0.2× speedup?

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

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

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


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

    1. Initial program 86.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 0.46000000000000002 < b

    1. Initial program 52.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. neg-sub052.0%

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{-1.6875 \cdot \frac{{c}^{3} \cdot {a}^{2}}{{\left(\sqrt{3}\right)}^{2} \cdot {b}^{5}} + \left(-1.125 \cdot \frac{{c}^{2} \cdot a}{{\left(\sqrt{3}\right)}^{2} \cdot {b}^{3}} + \left(-0.5 \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 \left({b}^{7} \cdot {\left(\sqrt{3}\right)}^{2}\right)} + -1.5 \cdot \frac{c}{{\left(\sqrt{3}\right)}^{2} \cdot b}\right)\right)} \]
    7. Simplified93.0%

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

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

Alternative 3: 89.8% accurate, 0.2× speedup?

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

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

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


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

    1. Initial program 86.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 0.450000000000000011 < b

    1. Initial program 52.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. neg-sub052.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 89.8% accurate, 0.3× speedup?

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

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

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


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

    1. Initial program 86.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 0.46000000000000002 < b

    1. Initial program 52.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. neg-sub052.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 84.6% accurate, 0.3× speedup?

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

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

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


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

    1. Initial program 79.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. neg-sub079.7%

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

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

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

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

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

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

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

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

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

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

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

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

    if 235 < b

    1. Initial program 44.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 84.6% accurate, 0.3× speedup?

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

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

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


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

    1. Initial program 79.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. neg-sub079.7%

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

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

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

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

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

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

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

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

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

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

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

    if 235 < b

    1. Initial program 44.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 76.1% accurate, 0.4× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;-0.5 \cdot \frac{c}{b}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (/.f64 (+.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 3 a) c)))) (*.f64 3 a)) < -8.0000000000000002e-8

    1. Initial program 73.3%

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

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

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

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

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

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

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

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

    1. Initial program 33.0%

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

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

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

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

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

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

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

Alternative 8: 84.6% accurate, 0.4× speedup?

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

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

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


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

    1. Initial program 79.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. neg-sub079.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\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)}}} \]
      4. *-commutative79.9%

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

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

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

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

    if 235 < b

    1. Initial program 44.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 84.6% accurate, 0.4× speedup?

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

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

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


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

    1. Initial program 79.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. neg-sub079.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\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)}}} \]
      4. *-commutative79.9%

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

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

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

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

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

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

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

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

      \[\leadsto \frac{\sqrt{\mathsf{fma}\left(b, b, a \cdot \left(c \cdot -3\right)\right)} - b}{\color{blue}{-1 \cdot \left(a \cdot \sqrt[3]{-27}\right)}} \]
    11. Step-by-step derivation
      1. mul-1-neg79.9%

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

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

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

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

    if 235 < b

    1. Initial program 44.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 76.0% accurate, 0.5× 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 -8 \cdot 10^{-8}:\\ \;\;\;\;\frac{\sqrt{b \cdot b - a \cdot \frac{c}{0.3333333333333333}} - b}{a \cdot 3}\\ \mathbf{else}:\\ \;\;\;\;-0.5 \cdot \frac{c}{b}\\ \end{array} \end{array} \]
(FPCore (a b c)
 :precision binary64
 (if (<= (/ (- (sqrt (- (* b b) (* c (* a 3.0)))) b) (* a 3.0)) -8e-8)
   (/ (- (sqrt (- (* b b) (* a (/ c 0.3333333333333333)))) b) (* a 3.0))
   (* -0.5 (/ c b))))
double code(double a, double b, double c) {
	double tmp;
	if (((sqrt(((b * b) - (c * (a * 3.0)))) - b) / (a * 3.0)) <= -8e-8) {
		tmp = (sqrt(((b * b) - (a * (c / 0.3333333333333333)))) - b) / (a * 3.0);
	} else {
		tmp = -0.5 * (c / b);
	}
	return tmp;
}
real(8) function code(a, b, c)
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8) :: tmp
    if (((sqrt(((b * b) - (c * (a * 3.0d0)))) - b) / (a * 3.0d0)) <= (-8d-8)) then
        tmp = (sqrt(((b * b) - (a * (c / 0.3333333333333333d0)))) - b) / (a * 3.0d0)
    else
        tmp = (-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) - (c * (a * 3.0)))) - b) / (a * 3.0)) <= -8e-8) {
		tmp = (Math.sqrt(((b * b) - (a * (c / 0.3333333333333333)))) - b) / (a * 3.0);
	} else {
		tmp = -0.5 * (c / b);
	}
	return tmp;
}
def code(a, b, c):
	tmp = 0
	if ((math.sqrt(((b * b) - (c * (a * 3.0)))) - b) / (a * 3.0)) <= -8e-8:
		tmp = (math.sqrt(((b * b) - (a * (c / 0.3333333333333333)))) - b) / (a * 3.0)
	else:
		tmp = -0.5 * (c / b)
	return tmp
function code(a, b, c)
	tmp = 0.0
	if (Float64(Float64(sqrt(Float64(Float64(b * b) - Float64(c * Float64(a * 3.0)))) - b) / Float64(a * 3.0)) <= -8e-8)
		tmp = Float64(Float64(sqrt(Float64(Float64(b * b) - Float64(a * Float64(c / 0.3333333333333333)))) - b) / Float64(a * 3.0));
	else
		tmp = Float64(-0.5 * Float64(c / b));
	end
	return tmp
end
function tmp_2 = code(a, b, c)
	tmp = 0.0;
	if (((sqrt(((b * b) - (c * (a * 3.0)))) - b) / (a * 3.0)) <= -8e-8)
		tmp = (sqrt(((b * b) - (a * (c / 0.3333333333333333)))) - b) / (a * 3.0);
	else
		tmp = -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[(c * N[(a * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision] / N[(a * 3.0), $MachinePrecision]), $MachinePrecision], -8e-8], N[(N[(N[Sqrt[N[(N[(b * b), $MachinePrecision] - N[(a * N[(c / 0.3333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision] / N[(a * 3.0), $MachinePrecision]), $MachinePrecision], N[(-0.5 * N[(c / b), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

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

\mathbf{else}:\\
\;\;\;\;-0.5 \cdot \frac{c}{b}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (/.f64 (+.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 3 a) c)))) (*.f64 3 a)) < -8.0000000000000002e-8

    1. Initial program 73.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 33.0%

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

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

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

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

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

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

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

Alternative 11: 84.6% accurate, 0.5× speedup?

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

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

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


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

    1. Initial program 79.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. neg-sub079.7%

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

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

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

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

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

    if 235 < b

    1. Initial program 44.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 12: 74.4% accurate, 1.0× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;-0.5 \cdot \frac{c}{b}\\


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

    1. Initial program 79.6%

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

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

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

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

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

    if 250 < b

    1. Initial program 44.4%

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

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

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

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

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

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

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

Alternative 13: 64.9% 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 57.7%

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

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

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

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

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

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

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

Reproduce

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