Cubic critical, wide range

Percentage Accurate: 18.1% → 99.4%
Time: 9.1s
Alternatives: 6
Speedup: 23.2×

Specification

?
\[\left(\left(4.930380657631324 \cdot 10^{-32} < a \land a < 2.028240960365167 \cdot 10^{+31}\right) \land \left(4.930380657631324 \cdot 10^{-32} < b \land b < 2.028240960365167 \cdot 10^{+31}\right)\right) \land \left(4.930380657631324 \cdot 10^{-32} < c \land c < 2.028240960365167 \cdot 10^{+31}\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 6 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: 18.1% 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.4% accurate, 0.5× speedup?

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

\\
\frac{\frac{c \cdot \left(a \cdot \left(--3\right)\right)}{\left(-b\right) - \sqrt{\mathsf{fma}\left(c, a \cdot -3, b \cdot b\right)}}}{a \cdot 3}
\end{array}
Derivation
  1. Initial program 19.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. expm1-log1p-u19.4%

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

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

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

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

      \[\leadsto \frac{\color{blue}{\frac{\left(-b\right) \cdot \left(-b\right) - \sqrt{\mathsf{expm1}\left(\mathsf{log1p}\left(b \cdot b - c \cdot \left(a \cdot 3\right)\right)\right)} \cdot \sqrt{\mathsf{expm1}\left(\mathsf{log1p}\left(b \cdot b - c \cdot \left(a \cdot 3\right)\right)\right)}}{\left(-b\right) - \sqrt{\mathsf{expm1}\left(\mathsf{log1p}\left(b \cdot b - c \cdot \left(a \cdot 3\right)\right)\right)}}}}{3 \cdot a} \]
    2. add-sqr-sqrt19.7%

      \[\leadsto \frac{\frac{\left(-b\right) \cdot \left(-b\right) - \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(b \cdot b - c \cdot \left(a \cdot 3\right)\right)\right)}}{\left(-b\right) - \sqrt{\mathsf{expm1}\left(\mathsf{log1p}\left(b \cdot b - c \cdot \left(a \cdot 3\right)\right)\right)}}}{3 \cdot a} \]
    3. expm1-log1p-u19.8%

      \[\leadsto \frac{\frac{\left(-b\right) \cdot \left(-b\right) - \color{blue}{\left(b \cdot b - c \cdot \left(a \cdot 3\right)\right)}}{\left(-b\right) - \sqrt{\mathsf{expm1}\left(\mathsf{log1p}\left(b \cdot b - c \cdot \left(a \cdot 3\right)\right)\right)}}}{3 \cdot a} \]
    4. *-commutative19.8%

      \[\leadsto \frac{\frac{\left(-b\right) \cdot \left(-b\right) - \left(b \cdot b - c \cdot \color{blue}{\left(3 \cdot a\right)}\right)}{\left(-b\right) - \sqrt{\mathsf{expm1}\left(\mathsf{log1p}\left(b \cdot b - c \cdot \left(a \cdot 3\right)\right)\right)}}}{3 \cdot a} \]
    5. expm1-log1p-u19.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 94.1% accurate, 0.5× speedup?

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

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

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

    1. Initial program 79.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. expm1-log1p-u74.5%

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

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

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

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

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

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

        \[\leadsto \frac{\frac{\left(-b\right) \cdot \left(-b\right) - \color{blue}{\left(b \cdot b - c \cdot \left(a \cdot 3\right)\right)}}{\left(-b\right) - \sqrt{\mathsf{expm1}\left(\mathsf{log1p}\left(b \cdot b - c \cdot \left(a \cdot 3\right)\right)\right)}}}{3 \cdot a} \]
      4. *-commutative80.9%

        \[\leadsto \frac{\frac{\left(-b\right) \cdot \left(-b\right) - \left(b \cdot b - c \cdot \color{blue}{\left(3 \cdot a\right)}\right)}{\left(-b\right) - \sqrt{\mathsf{expm1}\left(\mathsf{log1p}\left(b \cdot b - c \cdot \left(a \cdot 3\right)\right)\right)}}}{3 \cdot a} \]
      5. expm1-log1p-u81.0%

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

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

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

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

    1. Initial program 13.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. /-rgt-identity13.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{-0.375 \cdot \frac{c \cdot c}{\frac{{b}^{3}}{a}} + -0.5 \cdot \frac{c}{b}} \]
      2. associate-/r/96.8%

        \[\leadsto -0.375 \cdot \color{blue}{\left(\frac{c \cdot c}{{b}^{3}} \cdot a\right)} + -0.5 \cdot \frac{c}{b} \]
    8. Applied egg-rr96.8%

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

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

Alternative 3: 94.0% accurate, 0.5× speedup?

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

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

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

    1. Initial program 79.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. expm1-log1p-u74.5%

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

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

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

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

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

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

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

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

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

    1. Initial program 13.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. /-rgt-identity13.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{-0.375 \cdot \frac{c \cdot c}{\frac{{b}^{3}}{a}} + -0.5 \cdot \frac{c}{b}} \]
      2. associate-/r/96.8%

        \[\leadsto -0.375 \cdot \color{blue}{\left(\frac{c \cdot c}{{b}^{3}} \cdot a\right)} + -0.5 \cdot \frac{c}{b} \]
    8. Applied egg-rr96.8%

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

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

Alternative 4: 94.0% accurate, 0.5× speedup?

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

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

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

    1. Initial program 79.3%

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

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

    1. Initial program 13.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. /-rgt-identity13.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{-0.375 \cdot \frac{c \cdot c}{\frac{{b}^{3}}{a}} + -0.5 \cdot \frac{c}{b}} \]
      2. associate-/r/96.8%

        \[\leadsto -0.375 \cdot \color{blue}{\left(\frac{c \cdot c}{{b}^{3}} \cdot a\right)} + -0.5 \cdot \frac{c}{b} \]
    8. Applied egg-rr96.8%

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

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

Alternative 5: 95.3% accurate, 1.0× speedup?

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

\\
-0.375 \cdot \left(a \cdot \frac{c \cdot c}{{b}^{3}}\right) + -0.5 \cdot \frac{c}{b}
\end{array}
Derivation
  1. Initial program 19.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. /-rgt-identity19.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\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. +-commutative93.6%

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

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

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

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

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

      \[\leadsto \color{blue}{-0.375 \cdot \frac{c \cdot c}{\frac{{b}^{3}}{a}} + -0.5 \cdot \frac{c}{b}} \]
    2. associate-/r/93.6%

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

    \[\leadsto \color{blue}{-0.375 \cdot \left(\frac{c \cdot c}{{b}^{3}} \cdot a\right) + -0.5 \cdot \frac{c}{b}} \]
  9. Final simplification93.6%

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

Alternative 6: 90.2% accurate, 23.2× speedup?

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

\\
-0.5 \cdot \frac{c}{b}
\end{array}
Derivation
  1. Initial program 19.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. /-rgt-identity19.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Reproduce

?
herbie shell --seed 2023257 
(FPCore (a b c)
  :name "Cubic critical, wide range"
  :precision binary64
  :pre (and (and (and (< 4.930380657631324e-32 a) (< a 2.028240960365167e+31)) (and (< 4.930380657631324e-32 b) (< b 2.028240960365167e+31))) (and (< 4.930380657631324e-32 c) (< c 2.028240960365167e+31)))
  (/ (+ (- b) (sqrt (- (* b b) (* (* 3.0 a) c)))) (* 3.0 a)))