Cubic critical, narrow range

Percentage Accurate: 55.7% → 99.6%
Time: 24.3s
Alternatives: 9
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 9 alternatives:

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

Initial Program: 55.7% accurate, 1.0× speedup?

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

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

Alternative 1: 99.6% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \frac{c}{\left(-b\right) - {\left(\mathsf{fma}\left(b, b, -3 \cdot \left(c \cdot a\right)\right)\right)}^{0.5}} \end{array} \]
(FPCore (a b c)
 :precision binary64
 (/ c (- (- b) (pow (fma b b (* -3.0 (* c a))) 0.5))))
double code(double a, double b, double c) {
	return c / (-b - pow(fma(b, b, (-3.0 * (c * a))), 0.5));
}
function code(a, b, c)
	return Float64(c / Float64(Float64(-b) - (fma(b, b, Float64(-3.0 * Float64(c * a))) ^ 0.5)))
end
code[a_, b_, c_] := N[(c / N[((-b) - N[Power[N[(b * b + N[(-3.0 * N[(c * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\frac{c}{\left(-b\right) - {\left(\mathsf{fma}\left(b, b, -3 \cdot \left(c \cdot a\right)\right)\right)}^{0.5}}
\end{array}
Derivation
  1. Initial program 57.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-neg57.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-neg57.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*57.5%

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

    \[\leadsto \color{blue}{\frac{\left(-b\right) + \sqrt{b \cdot b - 3 \cdot \left(a \cdot c\right)}}{3 \cdot a}} \]
  4. Add Preprocessing
  5. Step-by-step derivation
    1. add-cbrt-cube57.5%

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

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

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

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

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

    \[\leadsto \frac{\color{blue}{\frac{{\left(-b\right)}^{2} - \left({b}^{2} - \left(a \cdot c\right) \cdot 3\right)}{\left(-b\right) - \sqrt{{b}^{2} - \left(a \cdot c\right) \cdot 3}}}}{3 \cdot a} \]
  9. Step-by-step derivation
    1. associate--r-99.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \frac{\color{blue}{c}}{\left(-b\right) - \sqrt{\mathsf{fma}\left(b, b, -3 \cdot \left(c \cdot a\right)\right)}} \]
  16. Step-by-step derivation
    1. pow1/299.6%

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

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

Alternative 2: 85.5% 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 -0.011:\\ \;\;\;\;\frac{\sqrt{b \cdot b - a \cdot \left(c \cdot 3\right)} - b}{a \cdot 3}\\ \mathbf{else}:\\ \;\;\;\;\frac{c}{b \cdot \left(1.5 \cdot \frac{c \cdot a}{{b}^{2}} - 2\right)}\\ \end{array} \end{array} \]
(FPCore (a b c)
 :precision binary64
 (if (<= (/ (- (sqrt (- (* b b) (* c (* a 3.0)))) b) (* a 3.0)) -0.011)
   (/ (- (sqrt (- (* b b) (* a (* c 3.0)))) b) (* a 3.0))
   (/ c (* b (- (* 1.5 (/ (* c a) (pow b 2.0))) 2.0)))))
double code(double a, double b, double c) {
	double tmp;
	if (((sqrt(((b * b) - (c * (a * 3.0)))) - b) / (a * 3.0)) <= -0.011) {
		tmp = (sqrt(((b * b) - (a * (c * 3.0)))) - b) / (a * 3.0);
	} else {
		tmp = c / (b * ((1.5 * ((c * a) / pow(b, 2.0))) - 2.0));
	}
	return tmp;
}
real(8) function code(a, b, c)
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8) :: tmp
    if (((sqrt(((b * b) - (c * (a * 3.0d0)))) - b) / (a * 3.0d0)) <= (-0.011d0)) then
        tmp = (sqrt(((b * b) - (a * (c * 3.0d0)))) - b) / (a * 3.0d0)
    else
        tmp = c / (b * ((1.5d0 * ((c * a) / (b ** 2.0d0))) - 2.0d0))
    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)) <= -0.011) {
		tmp = (Math.sqrt(((b * b) - (a * (c * 3.0)))) - b) / (a * 3.0);
	} else {
		tmp = c / (b * ((1.5 * ((c * a) / Math.pow(b, 2.0))) - 2.0));
	}
	return tmp;
}
def code(a, b, c):
	tmp = 0
	if ((math.sqrt(((b * b) - (c * (a * 3.0)))) - b) / (a * 3.0)) <= -0.011:
		tmp = (math.sqrt(((b * b) - (a * (c * 3.0)))) - b) / (a * 3.0)
	else:
		tmp = c / (b * ((1.5 * ((c * a) / math.pow(b, 2.0))) - 2.0))
	return tmp
function code(a, b, c)
	tmp = 0.0
	if (Float64(Float64(sqrt(Float64(Float64(b * b) - Float64(c * Float64(a * 3.0)))) - b) / Float64(a * 3.0)) <= -0.011)
		tmp = Float64(Float64(sqrt(Float64(Float64(b * b) - Float64(a * Float64(c * 3.0)))) - b) / Float64(a * 3.0));
	else
		tmp = Float64(c / Float64(b * Float64(Float64(1.5 * Float64(Float64(c * a) / (b ^ 2.0))) - 2.0)));
	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)) <= -0.011)
		tmp = (sqrt(((b * b) - (a * (c * 3.0)))) - b) / (a * 3.0);
	else
		tmp = c / (b * ((1.5 * ((c * a) / (b ^ 2.0))) - 2.0));
	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], -0.011], N[(N[(N[Sqrt[N[(N[(b * b), $MachinePrecision] - N[(a * N[(c * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision] / N[(a * 3.0), $MachinePrecision]), $MachinePrecision], N[(c / N[(b * N[(N[(1.5 * N[(N[(c * a), $MachinePrecision] / N[Power[b, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

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

\mathbf{else}:\\
\;\;\;\;\frac{c}{b \cdot \left(1.5 \cdot \frac{c \cdot a}{{b}^{2}} - 2\right)}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (/.f64 (+.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 #s(literal 3 binary64) a) c)))) (*.f64 #s(literal 3 binary64) a)) < -0.010999999999999999

    1. Initial program 78.9%

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

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

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

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

      \[\leadsto \color{blue}{\frac{\left(-b\right) + \sqrt{b \cdot b - 3 \cdot \left(a \cdot c\right)}}{3 \cdot a}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. add-cbrt-cube78.9%

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

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

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

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

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

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

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

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

    if -0.010999999999999999 < (/.f64 (+.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 #s(literal 3 binary64) a) c)))) (*.f64 #s(literal 3 binary64) a))

    1. Initial program 47.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-neg47.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-neg47.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*47.4%

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

      \[\leadsto \color{blue}{\frac{\left(-b\right) + \sqrt{b \cdot b - 3 \cdot \left(a \cdot c\right)}}{3 \cdot a}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. add-cbrt-cube47.4%

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

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

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

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

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

      \[\leadsto \frac{\color{blue}{\frac{{\left(-b\right)}^{2} - \left({b}^{2} - \left(a \cdot c\right) \cdot 3\right)}{\left(-b\right) - \sqrt{{b}^{2} - \left(a \cdot c\right) \cdot 3}}}}{3 \cdot a} \]
    9. Step-by-step derivation
      1. associate--r-99.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 99.6% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \frac{c}{\left(-b\right) - \sqrt{\mathsf{fma}\left(b, b, -3 \cdot \left(c \cdot a\right)\right)}} \end{array} \]
(FPCore (a b c)
 :precision binary64
 (/ c (- (- b) (sqrt (fma b b (* -3.0 (* c a)))))))
double code(double a, double b, double c) {
	return c / (-b - sqrt(fma(b, b, (-3.0 * (c * a)))));
}
function code(a, b, c)
	return Float64(c / Float64(Float64(-b) - sqrt(fma(b, b, Float64(-3.0 * Float64(c * a))))))
end
code[a_, b_, c_] := N[(c / N[((-b) - N[Sqrt[N[(b * b + N[(-3.0 * N[(c * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\frac{c}{\left(-b\right) - \sqrt{\mathsf{fma}\left(b, b, -3 \cdot \left(c \cdot a\right)\right)}}
\end{array}
Derivation
  1. Initial program 57.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-neg57.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-neg57.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*57.5%

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

    \[\leadsto \color{blue}{\frac{\left(-b\right) + \sqrt{b \cdot b - 3 \cdot \left(a \cdot c\right)}}{3 \cdot a}} \]
  4. Add Preprocessing
  5. Step-by-step derivation
    1. add-cbrt-cube57.5%

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

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

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

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

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

    \[\leadsto \frac{\color{blue}{\frac{{\left(-b\right)}^{2} - \left({b}^{2} - \left(a \cdot c\right) \cdot 3\right)}{\left(-b\right) - \sqrt{{b}^{2} - \left(a \cdot c\right) \cdot 3}}}}{3 \cdot a} \]
  9. Step-by-step derivation
    1. associate--r-99.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 85.5% accurate, 1.0× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;\frac{c}{b \cdot \left(1.5 \cdot \frac{c \cdot a}{{b}^{2}} - 2\right)}\\


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

    1. Initial program 80.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-neg80.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-neg80.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*80.6%

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

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

    if 5.20000000000000018 < b

    1. Initial program 51.9%

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

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

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

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

      \[\leadsto \color{blue}{\frac{\left(-b\right) + \sqrt{b \cdot b - 3 \cdot \left(a \cdot c\right)}}{3 \cdot a}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. add-cbrt-cube51.8%

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

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

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

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

        \[\leadsto \frac{\color{blue}{\frac{\left(-b\right) \cdot \left(-b\right) - \sqrt{b \cdot b - {\left({\left(3 \cdot \left(a \cdot c\right)\right)}^{3}\right)}^{0.3333333333333333}} \cdot \sqrt{b \cdot b - {\left({\left(3 \cdot \left(a \cdot c\right)\right)}^{3}\right)}^{0.3333333333333333}}}{\left(-b\right) - \sqrt{b \cdot b - {\left({\left(3 \cdot \left(a \cdot c\right)\right)}^{3}\right)}^{0.3333333333333333}}}}}{3 \cdot a} \]
    8. Applied egg-rr53.0%

      \[\leadsto \frac{\color{blue}{\frac{{\left(-b\right)}^{2} - \left({b}^{2} - \left(a \cdot c\right) \cdot 3\right)}{\left(-b\right) - \sqrt{{b}^{2} - \left(a \cdot c\right) \cdot 3}}}}{3 \cdot a} \]
    9. Step-by-step derivation
      1. associate--r-99.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{c}{\color{blue}{b \cdot \left(1.5 \cdot \frac{a \cdot c}{{b}^{2}} - 2\right)}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification85.0%

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

Alternative 5: 82.0% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \frac{c}{b \cdot \left(1.5 \cdot \frac{c \cdot a}{{b}^{2}} - 2\right)} \end{array} \]
(FPCore (a b c)
 :precision binary64
 (/ c (* b (- (* 1.5 (/ (* c a) (pow b 2.0))) 2.0))))
double code(double a, double b, double c) {
	return c / (b * ((1.5 * ((c * a) / pow(b, 2.0))) - 2.0));
}
real(8) function code(a, b, c)
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    code = c / (b * ((1.5d0 * ((c * a) / (b ** 2.0d0))) - 2.0d0))
end function
public static double code(double a, double b, double c) {
	return c / (b * ((1.5 * ((c * a) / Math.pow(b, 2.0))) - 2.0));
}
def code(a, b, c):
	return c / (b * ((1.5 * ((c * a) / math.pow(b, 2.0))) - 2.0))
function code(a, b, c)
	return Float64(c / Float64(b * Float64(Float64(1.5 * Float64(Float64(c * a) / (b ^ 2.0))) - 2.0)))
end
function tmp = code(a, b, c)
	tmp = c / (b * ((1.5 * ((c * a) / (b ^ 2.0))) - 2.0));
end
code[a_, b_, c_] := N[(c / N[(b * N[(N[(1.5 * N[(N[(c * a), $MachinePrecision] / N[Power[b, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\frac{c}{b \cdot \left(1.5 \cdot \frac{c \cdot a}{{b}^{2}} - 2\right)}
\end{array}
Derivation
  1. Initial program 57.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-neg57.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-neg57.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*57.5%

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

    \[\leadsto \color{blue}{\frac{\left(-b\right) + \sqrt{b \cdot b - 3 \cdot \left(a \cdot c\right)}}{3 \cdot a}} \]
  4. Add Preprocessing
  5. Step-by-step derivation
    1. add-cbrt-cube57.5%

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

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

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

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

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

    \[\leadsto \frac{\color{blue}{\frac{{\left(-b\right)}^{2} - \left({b}^{2} - \left(a \cdot c\right) \cdot 3\right)}{\left(-b\right) - \sqrt{{b}^{2} - \left(a \cdot c\right) \cdot 3}}}}{3 \cdot a} \]
  9. Step-by-step derivation
    1. associate--r-99.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \frac{c}{\color{blue}{b \cdot \left(1.5 \cdot \frac{a \cdot c}{{b}^{2}} - 2\right)}} \]
  17. Final simplification81.6%

    \[\leadsto \frac{c}{b \cdot \left(1.5 \cdot \frac{c \cdot a}{{b}^{2}} - 2\right)} \]
  18. Add Preprocessing

Alternative 6: 82.0% accurate, 8.9× speedup?

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

\\
\frac{c}{1.5 \cdot \frac{c \cdot a}{b} - b \cdot 2}
\end{array}
Derivation
  1. Initial program 57.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-neg57.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-neg57.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*57.5%

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

    \[\leadsto \color{blue}{\frac{\left(-b\right) + \sqrt{b \cdot b - 3 \cdot \left(a \cdot c\right)}}{3 \cdot a}} \]
  4. Add Preprocessing
  5. Step-by-step derivation
    1. add-cbrt-cube57.5%

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

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

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

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

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

    \[\leadsto \frac{\color{blue}{\frac{{\left(-b\right)}^{2} - \left({b}^{2} - \left(a \cdot c\right) \cdot 3\right)}{\left(-b\right) - \sqrt{{b}^{2} - \left(a \cdot c\right) \cdot 3}}}}{3 \cdot a} \]
  9. Step-by-step derivation
    1. associate--r-99.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \frac{c}{\color{blue}{1.5 \cdot \frac{a \cdot c}{b} - 2 \cdot b}} \]
  17. Final simplification81.6%

    \[\leadsto \frac{c}{1.5 \cdot \frac{c \cdot a}{b} - b \cdot 2} \]
  18. Add Preprocessing

Alternative 7: 64.1% accurate, 23.2× speedup?

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

\\
\frac{c \cdot -0.5}{b}
\end{array}
Derivation
  1. Initial program 57.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-neg57.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-neg57.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*57.5%

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

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

    \[\leadsto \color{blue}{-0.5 \cdot \frac{c}{b}} \]
  6. Step-by-step derivation
    1. associate-*r/62.9%

      \[\leadsto \color{blue}{\frac{-0.5 \cdot c}{b}} \]
    2. *-commutative62.9%

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

    \[\leadsto \color{blue}{\frac{c \cdot -0.5}{b}} \]
  8. Add Preprocessing

Alternative 8: 64.1% accurate, 23.2× speedup?

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

\\
\frac{-0.5}{\frac{b}{c}}
\end{array}
Derivation
  1. Initial program 57.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-neg57.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-neg57.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*57.5%

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

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

    \[\leadsto \frac{\color{blue}{-1.5 \cdot \frac{a \cdot c}{b}}}{3 \cdot a} \]
  6. Step-by-step derivation
    1. associate-/l*62.7%

      \[\leadsto \color{blue}{-1.5 \cdot \frac{\frac{a \cdot c}{b}}{3 \cdot a}} \]
    2. associate-/l*62.8%

      \[\leadsto -1.5 \cdot \frac{\color{blue}{a \cdot \frac{c}{b}}}{3 \cdot a} \]
    3. *-commutative62.8%

      \[\leadsto -1.5 \cdot \frac{a \cdot \frac{c}{b}}{\color{blue}{a \cdot 3}} \]
  7. Applied egg-rr62.8%

    \[\leadsto \color{blue}{-1.5 \cdot \frac{a \cdot \frac{c}{b}}{a \cdot 3}} \]
  8. Step-by-step derivation
    1. times-frac62.8%

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

      \[\leadsto -1.5 \cdot \left(\color{blue}{1} \cdot \frac{\frac{c}{b}}{3}\right) \]
    3. associate-*r*62.8%

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

      \[\leadsto \color{blue}{-1.5} \cdot \frac{\frac{c}{b}}{3} \]
  9. Simplified62.8%

    \[\leadsto \color{blue}{-1.5 \cdot \frac{\frac{c}{b}}{3}} \]
  10. Step-by-step derivation
    1. associate-*r/62.8%

      \[\leadsto \color{blue}{\frac{-1.5 \cdot \frac{c}{b}}{3}} \]
  11. Applied egg-rr62.8%

    \[\leadsto \color{blue}{\frac{-1.5 \cdot \frac{c}{b}}{3}} \]
  12. Step-by-step derivation
    1. associate-/l*62.8%

      \[\leadsto \color{blue}{-1.5 \cdot \frac{\frac{c}{b}}{3}} \]
  13. Applied egg-rr62.8%

    \[\leadsto \color{blue}{-1.5 \cdot \frac{\frac{c}{b}}{3}} \]
  14. Step-by-step derivation
    1. associate-/l/62.8%

      \[\leadsto -1.5 \cdot \color{blue}{\frac{c}{3 \cdot b}} \]
  15. Simplified62.8%

    \[\leadsto \color{blue}{-1.5 \cdot \frac{c}{3 \cdot b}} \]
  16. Step-by-step derivation
    1. clear-num62.8%

      \[\leadsto -1.5 \cdot \color{blue}{\frac{1}{\frac{3 \cdot b}{c}}} \]
    2. un-div-inv62.8%

      \[\leadsto \color{blue}{\frac{-1.5}{\frac{3 \cdot b}{c}}} \]
    3. *-un-lft-identity62.8%

      \[\leadsto \frac{-1.5}{\frac{3 \cdot b}{\color{blue}{1 \cdot c}}} \]
    4. times-frac62.8%

      \[\leadsto \frac{-1.5}{\color{blue}{\frac{3}{1} \cdot \frac{b}{c}}} \]
    5. metadata-eval62.8%

      \[\leadsto \frac{-1.5}{\color{blue}{3} \cdot \frac{b}{c}} \]
  17. Applied egg-rr62.8%

    \[\leadsto \color{blue}{\frac{-1.5}{3 \cdot \frac{b}{c}}} \]
  18. Step-by-step derivation
    1. associate-/r*62.8%

      \[\leadsto \color{blue}{\frac{\frac{-1.5}{3}}{\frac{b}{c}}} \]
    2. metadata-eval62.8%

      \[\leadsto \frac{\color{blue}{-0.5}}{\frac{b}{c}} \]
  19. Simplified62.8%

    \[\leadsto \color{blue}{\frac{-0.5}{\frac{b}{c}}} \]
  20. Add Preprocessing

Alternative 9: 64.1% accurate, 23.2× speedup?

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

\\
c \cdot \frac{-0.5}{b}
\end{array}
Derivation
  1. Initial program 57.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-neg57.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-neg57.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*57.5%

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

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

    \[\leadsto \frac{\color{blue}{-1.5 \cdot \frac{a \cdot c}{b}}}{3 \cdot a} \]
  6. Step-by-step derivation
    1. associate-/l*62.7%

      \[\leadsto \color{blue}{-1.5 \cdot \frac{\frac{a \cdot c}{b}}{3 \cdot a}} \]
    2. associate-/l*62.8%

      \[\leadsto -1.5 \cdot \frac{\color{blue}{a \cdot \frac{c}{b}}}{3 \cdot a} \]
    3. *-commutative62.8%

      \[\leadsto -1.5 \cdot \frac{a \cdot \frac{c}{b}}{\color{blue}{a \cdot 3}} \]
  7. Applied egg-rr62.8%

    \[\leadsto \color{blue}{-1.5 \cdot \frac{a \cdot \frac{c}{b}}{a \cdot 3}} \]
  8. Step-by-step derivation
    1. times-frac62.8%

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

      \[\leadsto -1.5 \cdot \left(\color{blue}{1} \cdot \frac{\frac{c}{b}}{3}\right) \]
    3. associate-*r*62.8%

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

      \[\leadsto \color{blue}{-1.5} \cdot \frac{\frac{c}{b}}{3} \]
  9. Simplified62.8%

    \[\leadsto \color{blue}{-1.5 \cdot \frac{\frac{c}{b}}{3}} \]
  10. Step-by-step derivation
    1. associate-*r/62.8%

      \[\leadsto \color{blue}{\frac{-1.5 \cdot \frac{c}{b}}{3}} \]
  11. Applied egg-rr62.8%

    \[\leadsto \color{blue}{\frac{-1.5 \cdot \frac{c}{b}}{3}} \]
  12. Step-by-step derivation
    1. associate-/l*62.8%

      \[\leadsto \color{blue}{-1.5 \cdot \frac{\frac{c}{b}}{3}} \]
  13. Applied egg-rr62.8%

    \[\leadsto \color{blue}{-1.5 \cdot \frac{\frac{c}{b}}{3}} \]
  14. Step-by-step derivation
    1. associate-/l/62.8%

      \[\leadsto -1.5 \cdot \color{blue}{\frac{c}{3 \cdot b}} \]
  15. Simplified62.8%

    \[\leadsto \color{blue}{-1.5 \cdot \frac{c}{3 \cdot b}} \]
  16. Step-by-step derivation
    1. clear-num62.8%

      \[\leadsto -1.5 \cdot \color{blue}{\frac{1}{\frac{3 \cdot b}{c}}} \]
    2. un-div-inv62.8%

      \[\leadsto \color{blue}{\frac{-1.5}{\frac{3 \cdot b}{c}}} \]
    3. *-un-lft-identity62.8%

      \[\leadsto \frac{-1.5}{\frac{3 \cdot b}{\color{blue}{1 \cdot c}}} \]
    4. times-frac62.8%

      \[\leadsto \frac{-1.5}{\color{blue}{\frac{3}{1} \cdot \frac{b}{c}}} \]
    5. metadata-eval62.8%

      \[\leadsto \frac{-1.5}{\color{blue}{3} \cdot \frac{b}{c}} \]
  17. Applied egg-rr62.8%

    \[\leadsto \color{blue}{\frac{-1.5}{3 \cdot \frac{b}{c}}} \]
  18. Step-by-step derivation
    1. associate-/r*62.8%

      \[\leadsto \color{blue}{\frac{\frac{-1.5}{3}}{\frac{b}{c}}} \]
    2. metadata-eval62.8%

      \[\leadsto \frac{\color{blue}{-0.5}}{\frac{b}{c}} \]
  19. Simplified62.8%

    \[\leadsto \color{blue}{\frac{-0.5}{\frac{b}{c}}} \]
  20. Step-by-step derivation
    1. associate-/r/62.8%

      \[\leadsto \color{blue}{\frac{-0.5}{b} \cdot c} \]
  21. Applied egg-rr62.8%

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

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

Reproduce

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