Cubic critical, medium range

Percentage Accurate: 31.7% → 99.6%
Time: 15.0s
Alternatives: 9
Speedup: 23.2×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{\frac{0 + a \cdot \left(3 \cdot c\right)}{\left(-b\right) - \sqrt{b \cdot b - a \cdot \left(3 \cdot c\right)}} \cdot \frac{1}{a \cdot 3}} \]
  14. Step-by-step derivation
    1. +-lft-identity99.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 82.8% 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 -1000:\\ \;\;\;\;\left(\sqrt{b \cdot b - a \cdot \left(c \cdot 3\right)} - b\right) \cdot \frac{1}{a \cdot 3}\\ \mathbf{else}:\\ \;\;\;\;-0.5 \cdot \frac{c}{b}\\ \end{array} \end{array} \]
(FPCore (a b c)
 :precision binary64
 (if (<= (/ (- (sqrt (- (* b b) (* c (* a 3.0)))) b) (* a 3.0)) -1000.0)
   (* (- (sqrt (- (* b b) (* a (* c 3.0)))) b) (/ 1.0 (* a 3.0)))
   (* -0.5 (/ c b))))
double code(double a, double b, double c) {
	double tmp;
	if (((sqrt(((b * b) - (c * (a * 3.0)))) - b) / (a * 3.0)) <= -1000.0) {
		tmp = (sqrt(((b * b) - (a * (c * 3.0)))) - b) * (1.0 / (a * 3.0));
	} else {
		tmp = -0.5 * (c / b);
	}
	return tmp;
}
real(8) function code(a, b, c)
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8) :: tmp
    if (((sqrt(((b * b) - (c * (a * 3.0d0)))) - b) / (a * 3.0d0)) <= (-1000.0d0)) then
        tmp = (sqrt(((b * b) - (a * (c * 3.0d0)))) - b) * (1.0d0 / (a * 3.0d0))
    else
        tmp = (-0.5d0) * (c / b)
    end if
    code = tmp
end function
public static double code(double a, double b, double c) {
	double tmp;
	if (((Math.sqrt(((b * b) - (c * (a * 3.0)))) - b) / (a * 3.0)) <= -1000.0) {
		tmp = (Math.sqrt(((b * b) - (a * (c * 3.0)))) - b) * (1.0 / (a * 3.0));
	} else {
		tmp = -0.5 * (c / b);
	}
	return tmp;
}
def code(a, b, c):
	tmp = 0
	if ((math.sqrt(((b * b) - (c * (a * 3.0)))) - b) / (a * 3.0)) <= -1000.0:
		tmp = (math.sqrt(((b * b) - (a * (c * 3.0)))) - b) * (1.0 / (a * 3.0))
	else:
		tmp = -0.5 * (c / b)
	return tmp
function code(a, b, c)
	tmp = 0.0
	if (Float64(Float64(sqrt(Float64(Float64(b * b) - Float64(c * Float64(a * 3.0)))) - b) / Float64(a * 3.0)) <= -1000.0)
		tmp = Float64(Float64(sqrt(Float64(Float64(b * b) - Float64(a * Float64(c * 3.0)))) - b) * Float64(1.0 / Float64(a * 3.0)));
	else
		tmp = Float64(-0.5 * Float64(c / b));
	end
	return tmp
end
function tmp_2 = code(a, b, c)
	tmp = 0.0;
	if (((sqrt(((b * b) - (c * (a * 3.0)))) - b) / (a * 3.0)) <= -1000.0)
		tmp = (sqrt(((b * b) - (a * (c * 3.0)))) - b) * (1.0 / (a * 3.0));
	else
		tmp = -0.5 * (c / b);
	end
	tmp_2 = tmp;
end
code[a_, b_, c_] := If[LessEqual[N[(N[(N[Sqrt[N[(N[(b * b), $MachinePrecision] - N[(c * N[(a * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision] / N[(a * 3.0), $MachinePrecision]), $MachinePrecision], -1000.0], N[(N[(N[Sqrt[N[(N[(b * b), $MachinePrecision] - N[(a * N[(c * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision] * N[(1.0 / N[(a * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-0.5 * N[(c / b), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

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

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


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

    1. Initial program 79.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 27.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. sqr-neg27.2%

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

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

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

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

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

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

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

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

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


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

    1. Initial program 79.1%

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

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

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

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

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

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

    1. Initial program 27.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. sqr-neg27.2%

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

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

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

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

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

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

Alternative 4: 99.1% accurate, 0.9× speedup?

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

\\
\frac{\frac{\left(b \cdot b - b \cdot b\right) + 3 \cdot \left(c \cdot a\right)}{\left(-b\right) - \sqrt{b \cdot b - c \cdot \left(a \cdot 3\right)}}}{a \cdot 3}
\end{array}
Derivation
  1. Initial program 30.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-neg30.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-neg30.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*30.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 99.4% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := c \cdot \left(a \cdot 3\right)\\ \frac{\frac{\left(b \cdot b - b \cdot b\right) + t_0}{\left(-b\right) - \sqrt{b \cdot b - t_0}}}{a \cdot 3} \end{array} \end{array} \]
(FPCore (a b c)
 :precision binary64
 (let* ((t_0 (* c (* a 3.0))))
   (/
    (/ (+ (- (* b b) (* b b)) t_0) (- (- b) (sqrt (- (* b b) t_0))))
    (* a 3.0))))
double code(double a, double b, double c) {
	double t_0 = c * (a * 3.0);
	return ((((b * b) - (b * b)) + t_0) / (-b - sqrt(((b * b) - t_0)))) / (a * 3.0);
}
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
    t_0 = c * (a * 3.0d0)
    code = ((((b * b) - (b * b)) + t_0) / (-b - sqrt(((b * b) - t_0)))) / (a * 3.0d0)
end function
public static double code(double a, double b, double c) {
	double t_0 = c * (a * 3.0);
	return ((((b * b) - (b * b)) + t_0) / (-b - Math.sqrt(((b * b) - t_0)))) / (a * 3.0);
}
def code(a, b, c):
	t_0 = c * (a * 3.0)
	return ((((b * b) - (b * b)) + t_0) / (-b - math.sqrt(((b * b) - t_0)))) / (a * 3.0)
function code(a, b, c)
	t_0 = Float64(c * Float64(a * 3.0))
	return Float64(Float64(Float64(Float64(Float64(b * b) - Float64(b * b)) + t_0) / Float64(Float64(-b) - sqrt(Float64(Float64(b * b) - t_0)))) / Float64(a * 3.0))
end
function tmp = code(a, b, c)
	t_0 = c * (a * 3.0);
	tmp = ((((b * b) - (b * b)) + t_0) / (-b - sqrt(((b * b) - t_0)))) / (a * 3.0);
end
code[a_, b_, c_] := Block[{t$95$0 = N[(c * N[(a * 3.0), $MachinePrecision]), $MachinePrecision]}, N[(N[(N[(N[(N[(b * b), $MachinePrecision] - N[(b * b), $MachinePrecision]), $MachinePrecision] + t$95$0), $MachinePrecision] / N[((-b) - N[Sqrt[N[(N[(b * b), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(a * 3.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := c \cdot \left(a \cdot 3\right)\\
\frac{\frac{\left(b \cdot b - b \cdot b\right) + t_0}{\left(-b\right) - \sqrt{b \cdot b - t_0}}}{a \cdot 3}
\end{array}
\end{array}
Derivation
  1. Initial program 30.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-neg30.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-neg30.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*30.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 99.2% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := a \cdot \left(c \cdot 3\right)\\ \frac{t_0}{\left(a \cdot \left(-3\right)\right) \cdot \left(b + \sqrt{b \cdot b - t_0}\right)} \end{array} \end{array} \]
(FPCore (a b c)
 :precision binary64
 (let* ((t_0 (* a (* c 3.0))))
   (/ t_0 (* (* a (- 3.0)) (+ b (sqrt (- (* b b) t_0)))))))
double code(double a, double b, double c) {
	double t_0 = a * (c * 3.0);
	return t_0 / ((a * -3.0) * (b + sqrt(((b * b) - t_0))));
}
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
    t_0 = a * (c * 3.0d0)
    code = t_0 / ((a * -3.0d0) * (b + sqrt(((b * b) - t_0))))
end function
public static double code(double a, double b, double c) {
	double t_0 = a * (c * 3.0);
	return t_0 / ((a * -3.0) * (b + Math.sqrt(((b * b) - t_0))));
}
def code(a, b, c):
	t_0 = a * (c * 3.0)
	return t_0 / ((a * -3.0) * (b + math.sqrt(((b * b) - t_0))))
function code(a, b, c)
	t_0 = Float64(a * Float64(c * 3.0))
	return Float64(t_0 / Float64(Float64(a * Float64(-3.0)) * Float64(b + sqrt(Float64(Float64(b * b) - t_0)))))
end
function tmp = code(a, b, c)
	t_0 = a * (c * 3.0);
	tmp = t_0 / ((a * -3.0) * (b + sqrt(((b * b) - t_0))));
end
code[a_, b_, c_] := Block[{t$95$0 = N[(a * N[(c * 3.0), $MachinePrecision]), $MachinePrecision]}, N[(t$95$0 / N[(N[(a * (-3.0)), $MachinePrecision] * N[(b + N[Sqrt[N[(N[(b * b), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := a \cdot \left(c \cdot 3\right)\\
\frac{t_0}{\left(a \cdot \left(-3\right)\right) \cdot \left(b + \sqrt{b \cdot b - t_0}\right)}
\end{array}
\end{array}
Derivation
  1. Initial program 30.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-neg30.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-neg30.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*30.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 99.1% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := a \cdot \left(c \cdot 3\right)\\ \frac{\frac{t_0}{\left(-b\right) - \sqrt{b \cdot b - t_0}}}{a \cdot 3} \end{array} \end{array} \]
(FPCore (a b c)
 :precision binary64
 (let* ((t_0 (* a (* c 3.0))))
   (/ (/ t_0 (- (- b) (sqrt (- (* b b) t_0)))) (* a 3.0))))
double code(double a, double b, double c) {
	double t_0 = a * (c * 3.0);
	return (t_0 / (-b - sqrt(((b * b) - t_0)))) / (a * 3.0);
}
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
    t_0 = a * (c * 3.0d0)
    code = (t_0 / (-b - sqrt(((b * b) - t_0)))) / (a * 3.0d0)
end function
public static double code(double a, double b, double c) {
	double t_0 = a * (c * 3.0);
	return (t_0 / (-b - Math.sqrt(((b * b) - t_0)))) / (a * 3.0);
}
def code(a, b, c):
	t_0 = a * (c * 3.0)
	return (t_0 / (-b - math.sqrt(((b * b) - t_0)))) / (a * 3.0)
function code(a, b, c)
	t_0 = Float64(a * Float64(c * 3.0))
	return Float64(Float64(t_0 / Float64(Float64(-b) - sqrt(Float64(Float64(b * b) - t_0)))) / Float64(a * 3.0))
end
function tmp = code(a, b, c)
	t_0 = a * (c * 3.0);
	tmp = (t_0 / (-b - sqrt(((b * b) - t_0)))) / (a * 3.0);
end
code[a_, b_, c_] := Block[{t$95$0 = N[(a * N[(c * 3.0), $MachinePrecision]), $MachinePrecision]}, N[(N[(t$95$0 / N[((-b) - N[Sqrt[N[(N[(b * b), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(a * 3.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := a \cdot \left(c \cdot 3\right)\\
\frac{\frac{t_0}{\left(-b\right) - \sqrt{b \cdot b - t_0}}}{a \cdot 3}
\end{array}
\end{array}
Derivation
  1. Initial program 30.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-neg30.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-neg30.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*30.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 82.5% accurate, 1.0× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if b < 5.59999999999999992e-5

    1. Initial program 74.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 5.59999999999999992e-5 < b

    1. Initial program 26.7%

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

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

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

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

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

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

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

Alternative 9: 81.1% 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 30.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-neg30.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-neg30.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*30.6%

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

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

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

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

Reproduce

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