Cubic critical, medium range

Percentage Accurate: 31.4% → 95.7%
Time: 14.7s
Alternatives: 6
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 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: 31.4% 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: 95.7% accurate, 0.1× speedup?

\[\begin{array}{l} \\ -0.5625 \cdot \frac{{a}^{2} \cdot {c}^{3}}{{b}^{5}} + \left(-0.5 \cdot \frac{c}{b} + \left(-0.375 \cdot \frac{a \cdot {c}^{2}}{{b}^{3}} + {c}^{4} \cdot \frac{-1.0546875}{\frac{{b}^{7}}{{a}^{3}}}\right)\right) \end{array} \]
(FPCore (a b c)
 :precision binary64
 (+
  (* -0.5625 (/ (* (pow a 2.0) (pow c 3.0)) (pow b 5.0)))
  (+
   (* -0.5 (/ c b))
   (+
    (* -0.375 (/ (* a (pow c 2.0)) (pow b 3.0)))
    (* (pow c 4.0) (/ -1.0546875 (/ (pow b 7.0) (pow a 3.0))))))))
double code(double a, double b, double c) {
	return (-0.5625 * ((pow(a, 2.0) * pow(c, 3.0)) / pow(b, 5.0))) + ((-0.5 * (c / b)) + ((-0.375 * ((a * pow(c, 2.0)) / pow(b, 3.0))) + (pow(c, 4.0) * (-1.0546875 / (pow(b, 7.0) / pow(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 = ((-0.5625d0) * (((a ** 2.0d0) * (c ** 3.0d0)) / (b ** 5.0d0))) + (((-0.5d0) * (c / b)) + (((-0.375d0) * ((a * (c ** 2.0d0)) / (b ** 3.0d0))) + ((c ** 4.0d0) * ((-1.0546875d0) / ((b ** 7.0d0) / (a ** 3.0d0))))))
end function
public static double code(double a, double b, double c) {
	return (-0.5625 * ((Math.pow(a, 2.0) * Math.pow(c, 3.0)) / Math.pow(b, 5.0))) + ((-0.5 * (c / b)) + ((-0.375 * ((a * Math.pow(c, 2.0)) / Math.pow(b, 3.0))) + (Math.pow(c, 4.0) * (-1.0546875 / (Math.pow(b, 7.0) / Math.pow(a, 3.0))))));
}
def code(a, b, c):
	return (-0.5625 * ((math.pow(a, 2.0) * math.pow(c, 3.0)) / math.pow(b, 5.0))) + ((-0.5 * (c / b)) + ((-0.375 * ((a * math.pow(c, 2.0)) / math.pow(b, 3.0))) + (math.pow(c, 4.0) * (-1.0546875 / (math.pow(b, 7.0) / math.pow(a, 3.0))))))
function code(a, b, c)
	return Float64(Float64(-0.5625 * Float64(Float64((a ^ 2.0) * (c ^ 3.0)) / (b ^ 5.0))) + Float64(Float64(-0.5 * Float64(c / b)) + Float64(Float64(-0.375 * Float64(Float64(a * (c ^ 2.0)) / (b ^ 3.0))) + Float64((c ^ 4.0) * Float64(-1.0546875 / Float64((b ^ 7.0) / (a ^ 3.0)))))))
end
function tmp = code(a, b, c)
	tmp = (-0.5625 * (((a ^ 2.0) * (c ^ 3.0)) / (b ^ 5.0))) + ((-0.5 * (c / b)) + ((-0.375 * ((a * (c ^ 2.0)) / (b ^ 3.0))) + ((c ^ 4.0) * (-1.0546875 / ((b ^ 7.0) / (a ^ 3.0))))));
end
code[a_, b_, c_] := N[(N[(-0.5625 * N[(N[(N[Power[a, 2.0], $MachinePrecision] * N[Power[c, 3.0], $MachinePrecision]), $MachinePrecision] / N[Power[b, 5.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(-0.5 * N[(c / b), $MachinePrecision]), $MachinePrecision] + N[(N[(-0.375 * N[(N[(a * N[Power[c, 2.0], $MachinePrecision]), $MachinePrecision] / N[Power[b, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Power[c, 4.0], $MachinePrecision] * N[(-1.0546875 / N[(N[Power[b, 7.0], $MachinePrecision] / N[Power[a, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
-0.5625 \cdot \frac{{a}^{2} \cdot {c}^{3}}{{b}^{5}} + \left(-0.5 \cdot \frac{c}{b} + \left(-0.375 \cdot \frac{a \cdot {c}^{2}}{{b}^{3}} + {c}^{4} \cdot \frac{-1.0546875}{\frac{{b}^{7}}{{a}^{3}}}\right)\right)
\end{array}
Derivation
  1. Initial program 33.2%

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

    \[\leadsto \color{blue}{-0.5625 \cdot \frac{{a}^{2} \cdot {c}^{3}}{{b}^{5}} + \left(-0.5 \cdot \frac{c}{b} + \left(-0.375 \cdot \frac{a \cdot {c}^{2}}{{b}^{3}} + -0.16666666666666666 \cdot \frac{5.0625 \cdot \left({a}^{4} \cdot {c}^{4}\right) + {\left(-1.125 \cdot \left({a}^{2} \cdot {c}^{2}\right)\right)}^{2}}{a \cdot {b}^{7}}\right)\right)} \]
  3. Taylor expanded in a around 0 94.9%

    \[\leadsto -0.5625 \cdot \frac{{a}^{2} \cdot {c}^{3}}{{b}^{5}} + \left(-0.5 \cdot \frac{c}{b} + \left(-0.375 \cdot \frac{a \cdot {c}^{2}}{{b}^{3}} + \color{blue}{-0.16666666666666666 \cdot \frac{{a}^{3} \cdot \left(1.265625 \cdot {c}^{4} + 5.0625 \cdot {c}^{4}\right)}{{b}^{7}}}\right)\right) \]
  4. Step-by-step derivation
    1. associate-/l*94.9%

      \[\leadsto -0.5625 \cdot \frac{{a}^{2} \cdot {c}^{3}}{{b}^{5}} + \left(-0.5 \cdot \frac{c}{b} + \left(-0.375 \cdot \frac{a \cdot {c}^{2}}{{b}^{3}} + -0.16666666666666666 \cdot \color{blue}{\frac{{a}^{3}}{\frac{{b}^{7}}{1.265625 \cdot {c}^{4} + 5.0625 \cdot {c}^{4}}}}\right)\right) \]
    2. associate-*r/94.9%

      \[\leadsto -0.5625 \cdot \frac{{a}^{2} \cdot {c}^{3}}{{b}^{5}} + \left(-0.5 \cdot \frac{c}{b} + \left(-0.375 \cdot \frac{a \cdot {c}^{2}}{{b}^{3}} + \color{blue}{\frac{-0.16666666666666666 \cdot {a}^{3}}{\frac{{b}^{7}}{1.265625 \cdot {c}^{4} + 5.0625 \cdot {c}^{4}}}}\right)\right) \]
    3. distribute-rgt-out94.9%

      \[\leadsto -0.5625 \cdot \frac{{a}^{2} \cdot {c}^{3}}{{b}^{5}} + \left(-0.5 \cdot \frac{c}{b} + \left(-0.375 \cdot \frac{a \cdot {c}^{2}}{{b}^{3}} + \frac{-0.16666666666666666 \cdot {a}^{3}}{\frac{{b}^{7}}{\color{blue}{{c}^{4} \cdot \left(1.265625 + 5.0625\right)}}}\right)\right) \]
    4. metadata-eval94.9%

      \[\leadsto -0.5625 \cdot \frac{{a}^{2} \cdot {c}^{3}}{{b}^{5}} + \left(-0.5 \cdot \frac{c}{b} + \left(-0.375 \cdot \frac{a \cdot {c}^{2}}{{b}^{3}} + \frac{-0.16666666666666666 \cdot {a}^{3}}{\frac{{b}^{7}}{{c}^{4} \cdot \color{blue}{6.328125}}}\right)\right) \]
  5. Simplified94.9%

    \[\leadsto -0.5625 \cdot \frac{{a}^{2} \cdot {c}^{3}}{{b}^{5}} + \left(-0.5 \cdot \frac{c}{b} + \left(-0.375 \cdot \frac{a \cdot {c}^{2}}{{b}^{3}} + \color{blue}{\frac{-0.16666666666666666 \cdot {a}^{3}}{\frac{{b}^{7}}{{c}^{4} \cdot 6.328125}}}\right)\right) \]
  6. Step-by-step derivation
    1. associate-/r/94.9%

      \[\leadsto -0.5625 \cdot \frac{{a}^{2} \cdot {c}^{3}}{{b}^{5}} + \left(-0.5 \cdot \frac{c}{b} + \left(-0.375 \cdot \frac{a \cdot {c}^{2}}{{b}^{3}} + \color{blue}{\frac{-0.16666666666666666 \cdot {a}^{3}}{{b}^{7}} \cdot \left({c}^{4} \cdot 6.328125\right)}\right)\right) \]
    2. *-commutative94.9%

      \[\leadsto -0.5625 \cdot \frac{{a}^{2} \cdot {c}^{3}}{{b}^{5}} + \left(-0.5 \cdot \frac{c}{b} + \left(-0.375 \cdot \frac{a \cdot {c}^{2}}{{b}^{3}} + \color{blue}{\left({c}^{4} \cdot 6.328125\right) \cdot \frac{-0.16666666666666666 \cdot {a}^{3}}{{b}^{7}}}\right)\right) \]
    3. associate-/l*94.9%

      \[\leadsto -0.5625 \cdot \frac{{a}^{2} \cdot {c}^{3}}{{b}^{5}} + \left(-0.5 \cdot \frac{c}{b} + \left(-0.375 \cdot \frac{a \cdot {c}^{2}}{{b}^{3}} + \left({c}^{4} \cdot 6.328125\right) \cdot \color{blue}{\frac{-0.16666666666666666}{\frac{{b}^{7}}{{a}^{3}}}}\right)\right) \]
  7. Applied egg-rr94.9%

    \[\leadsto -0.5625 \cdot \frac{{a}^{2} \cdot {c}^{3}}{{b}^{5}} + \left(-0.5 \cdot \frac{c}{b} + \left(-0.375 \cdot \frac{a \cdot {c}^{2}}{{b}^{3}} + \color{blue}{\left({c}^{4} \cdot 6.328125\right) \cdot \frac{-0.16666666666666666}{\frac{{b}^{7}}{{a}^{3}}}}\right)\right) \]
  8. Step-by-step derivation
    1. associate-*l*94.9%

      \[\leadsto -0.5625 \cdot \frac{{a}^{2} \cdot {c}^{3}}{{b}^{5}} + \left(-0.5 \cdot \frac{c}{b} + \left(-0.375 \cdot \frac{a \cdot {c}^{2}}{{b}^{3}} + \color{blue}{{c}^{4} \cdot \left(6.328125 \cdot \frac{-0.16666666666666666}{\frac{{b}^{7}}{{a}^{3}}}\right)}\right)\right) \]
    2. *-commutative94.9%

      \[\leadsto -0.5625 \cdot \frac{{a}^{2} \cdot {c}^{3}}{{b}^{5}} + \left(-0.5 \cdot \frac{c}{b} + \left(-0.375 \cdot \frac{a \cdot {c}^{2}}{{b}^{3}} + {c}^{4} \cdot \color{blue}{\left(\frac{-0.16666666666666666}{\frac{{b}^{7}}{{a}^{3}}} \cdot 6.328125\right)}\right)\right) \]
    3. associate-*l/94.9%

      \[\leadsto -0.5625 \cdot \frac{{a}^{2} \cdot {c}^{3}}{{b}^{5}} + \left(-0.5 \cdot \frac{c}{b} + \left(-0.375 \cdot \frac{a \cdot {c}^{2}}{{b}^{3}} + {c}^{4} \cdot \color{blue}{\frac{-0.16666666666666666 \cdot 6.328125}{\frac{{b}^{7}}{{a}^{3}}}}\right)\right) \]
    4. metadata-eval94.9%

      \[\leadsto -0.5625 \cdot \frac{{a}^{2} \cdot {c}^{3}}{{b}^{5}} + \left(-0.5 \cdot \frac{c}{b} + \left(-0.375 \cdot \frac{a \cdot {c}^{2}}{{b}^{3}} + {c}^{4} \cdot \frac{\color{blue}{-1.0546875}}{\frac{{b}^{7}}{{a}^{3}}}\right)\right) \]
  9. Simplified94.9%

    \[\leadsto -0.5625 \cdot \frac{{a}^{2} \cdot {c}^{3}}{{b}^{5}} + \left(-0.5 \cdot \frac{c}{b} + \left(-0.375 \cdot \frac{a \cdot {c}^{2}}{{b}^{3}} + \color{blue}{{c}^{4} \cdot \frac{-1.0546875}{\frac{{b}^{7}}{{a}^{3}}}}\right)\right) \]
  10. Final simplification94.9%

    \[\leadsto -0.5625 \cdot \frac{{a}^{2} \cdot {c}^{3}}{{b}^{5}} + \left(-0.5 \cdot \frac{c}{b} + \left(-0.375 \cdot \frac{a \cdot {c}^{2}}{{b}^{3}} + {c}^{4} \cdot \frac{-1.0546875}{\frac{{b}^{7}}{{a}^{3}}}\right)\right) \]

Alternative 2: 94.2% accurate, 0.2× speedup?

\[\begin{array}{l} \\ -0.5625 \cdot \frac{{a}^{2} \cdot {c}^{3}}{{b}^{5}} + \left(-0.5 \cdot \frac{c}{b} + -0.375 \cdot \frac{a \cdot {c}^{2}}{{b}^{3}}\right) \end{array} \]
(FPCore (a b c)
 :precision binary64
 (+
  (* -0.5625 (/ (* (pow a 2.0) (pow c 3.0)) (pow b 5.0)))
  (+ (* -0.5 (/ c b)) (* -0.375 (/ (* a (pow c 2.0)) (pow b 3.0))))))
double code(double a, double b, double c) {
	return (-0.5625 * ((pow(a, 2.0) * pow(c, 3.0)) / pow(b, 5.0))) + ((-0.5 * (c / b)) + (-0.375 * ((a * pow(c, 2.0)) / pow(b, 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 = ((-0.5625d0) * (((a ** 2.0d0) * (c ** 3.0d0)) / (b ** 5.0d0))) + (((-0.5d0) * (c / b)) + ((-0.375d0) * ((a * (c ** 2.0d0)) / (b ** 3.0d0))))
end function
public static double code(double a, double b, double c) {
	return (-0.5625 * ((Math.pow(a, 2.0) * Math.pow(c, 3.0)) / Math.pow(b, 5.0))) + ((-0.5 * (c / b)) + (-0.375 * ((a * Math.pow(c, 2.0)) / Math.pow(b, 3.0))));
}
def code(a, b, c):
	return (-0.5625 * ((math.pow(a, 2.0) * math.pow(c, 3.0)) / math.pow(b, 5.0))) + ((-0.5 * (c / b)) + (-0.375 * ((a * math.pow(c, 2.0)) / math.pow(b, 3.0))))
function code(a, b, c)
	return Float64(Float64(-0.5625 * Float64(Float64((a ^ 2.0) * (c ^ 3.0)) / (b ^ 5.0))) + Float64(Float64(-0.5 * Float64(c / b)) + Float64(-0.375 * Float64(Float64(a * (c ^ 2.0)) / (b ^ 3.0)))))
end
function tmp = code(a, b, c)
	tmp = (-0.5625 * (((a ^ 2.0) * (c ^ 3.0)) / (b ^ 5.0))) + ((-0.5 * (c / b)) + (-0.375 * ((a * (c ^ 2.0)) / (b ^ 3.0))));
end
code[a_, b_, c_] := N[(N[(-0.5625 * N[(N[(N[Power[a, 2.0], $MachinePrecision] * N[Power[c, 3.0], $MachinePrecision]), $MachinePrecision] / N[Power[b, 5.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(-0.5 * N[(c / b), $MachinePrecision]), $MachinePrecision] + N[(-0.375 * N[(N[(a * N[Power[c, 2.0], $MachinePrecision]), $MachinePrecision] / N[Power[b, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
-0.5625 \cdot \frac{{a}^{2} \cdot {c}^{3}}{{b}^{5}} + \left(-0.5 \cdot \frac{c}{b} + -0.375 \cdot \frac{a \cdot {c}^{2}}{{b}^{3}}\right)
\end{array}
Derivation
  1. Initial program 33.2%

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

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

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

Alternative 3: 93.6% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \frac{-1.6875 \cdot \frac{{c}^{3} \cdot {a}^{3}}{{b}^{5}} + \left(-1.5 \cdot \frac{a \cdot c}{b} + -1.125 \cdot \left(\frac{1}{b} \cdot {\left(c \cdot \frac{a}{b}\right)}^{2}\right)\right)}{a \cdot 3} \end{array} \]
(FPCore (a b c)
 :precision binary64
 (/
  (+
   (* -1.6875 (/ (* (pow c 3.0) (pow a 3.0)) (pow b 5.0)))
   (+ (* -1.5 (/ (* a c) b)) (* -1.125 (* (/ 1.0 b) (pow (* c (/ a b)) 2.0)))))
  (* a 3.0)))
double code(double a, double b, double c) {
	return ((-1.6875 * ((pow(c, 3.0) * pow(a, 3.0)) / pow(b, 5.0))) + ((-1.5 * ((a * c) / b)) + (-1.125 * ((1.0 / b) * pow((c * (a / b)), 2.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 = (((-1.6875d0) * (((c ** 3.0d0) * (a ** 3.0d0)) / (b ** 5.0d0))) + (((-1.5d0) * ((a * c) / b)) + ((-1.125d0) * ((1.0d0 / b) * ((c * (a / b)) ** 2.0d0))))) / (a * 3.0d0)
end function
public static double code(double a, double b, double c) {
	return ((-1.6875 * ((Math.pow(c, 3.0) * Math.pow(a, 3.0)) / Math.pow(b, 5.0))) + ((-1.5 * ((a * c) / b)) + (-1.125 * ((1.0 / b) * Math.pow((c * (a / b)), 2.0))))) / (a * 3.0);
}
def code(a, b, c):
	return ((-1.6875 * ((math.pow(c, 3.0) * math.pow(a, 3.0)) / math.pow(b, 5.0))) + ((-1.5 * ((a * c) / b)) + (-1.125 * ((1.0 / b) * math.pow((c * (a / b)), 2.0))))) / (a * 3.0)
function code(a, b, c)
	return Float64(Float64(Float64(-1.6875 * Float64(Float64((c ^ 3.0) * (a ^ 3.0)) / (b ^ 5.0))) + Float64(Float64(-1.5 * Float64(Float64(a * c) / b)) + Float64(-1.125 * Float64(Float64(1.0 / b) * (Float64(c * Float64(a / b)) ^ 2.0))))) / Float64(a * 3.0))
end
function tmp = code(a, b, c)
	tmp = ((-1.6875 * (((c ^ 3.0) * (a ^ 3.0)) / (b ^ 5.0))) + ((-1.5 * ((a * c) / b)) + (-1.125 * ((1.0 / b) * ((c * (a / b)) ^ 2.0))))) / (a * 3.0);
end
code[a_, b_, c_] := N[(N[(N[(-1.6875 * N[(N[(N[Power[c, 3.0], $MachinePrecision] * N[Power[a, 3.0], $MachinePrecision]), $MachinePrecision] / N[Power[b, 5.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(-1.5 * N[(N[(a * c), $MachinePrecision] / b), $MachinePrecision]), $MachinePrecision] + N[(-1.125 * N[(N[(1.0 / b), $MachinePrecision] * N[Power[N[(c * N[(a / b), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(a * 3.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\frac{-1.6875 \cdot \frac{{c}^{3} \cdot {a}^{3}}{{b}^{5}} + \left(-1.5 \cdot \frac{a \cdot c}{b} + -1.125 \cdot \left(\frac{1}{b} \cdot {\left(c \cdot \frac{a}{b}\right)}^{2}\right)\right)}{a \cdot 3}
\end{array}
Derivation
  1. Initial program 33.2%

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

    \[\leadsto \frac{\color{blue}{-1.6875 \cdot \frac{{a}^{3} \cdot {c}^{3}}{{b}^{5}} + \left(-1.5 \cdot \frac{a \cdot c}{b} + -1.125 \cdot \frac{{a}^{2} \cdot {c}^{2}}{{b}^{3}}\right)}}{3 \cdot a} \]
  3. Step-by-step derivation
    1. *-un-lft-identity92.6%

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

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

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

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

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

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

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

      \[\leadsto \frac{-1.6875 \cdot \frac{{a}^{3} \cdot {c}^{3}}{{b}^{5}} + \left(-1.5 \cdot \frac{a \cdot c}{b} + -1.125 \cdot \left(\frac{1}{b} \cdot \frac{\left(a \cdot a\right) \cdot \color{blue}{\left(c \cdot c\right)}}{{b}^{2}}\right)\right)}{3 \cdot a} \]
    9. swap-sqr92.6%

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

      \[\leadsto \frac{-1.6875 \cdot \frac{{a}^{3} \cdot {c}^{3}}{{b}^{5}} + \left(-1.5 \cdot \frac{a \cdot c}{b} + -1.125 \cdot \left(\frac{1}{b} \cdot \frac{\left(a \cdot c\right) \cdot \left(a \cdot c\right)}{\color{blue}{b \cdot b}}\right)\right)}{3 \cdot a} \]
    11. frac-times92.6%

      \[\leadsto \frac{-1.6875 \cdot \frac{{a}^{3} \cdot {c}^{3}}{{b}^{5}} + \left(-1.5 \cdot \frac{a \cdot c}{b} + -1.125 \cdot \left(\frac{1}{b} \cdot \color{blue}{\left(\frac{a \cdot c}{b} \cdot \frac{a \cdot c}{b}\right)}\right)\right)}{3 \cdot a} \]
    12. pow192.6%

      \[\leadsto \frac{-1.6875 \cdot \frac{{a}^{3} \cdot {c}^{3}}{{b}^{5}} + \left(-1.5 \cdot \frac{a \cdot c}{b} + -1.125 \cdot \left(\frac{1}{b} \cdot \left(\color{blue}{{\left(\frac{a \cdot c}{b}\right)}^{1}} \cdot \frac{a \cdot c}{b}\right)\right)\right)}{3 \cdot a} \]
    13. metadata-eval92.6%

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

      \[\leadsto \frac{-1.6875 \cdot \frac{{a}^{3} \cdot {c}^{3}}{{b}^{5}} + \left(-1.5 \cdot \frac{a \cdot c}{b} + -1.125 \cdot \left(\frac{1}{b} \cdot \left({\left(\frac{a \cdot c}{b}\right)}^{\left(\frac{2}{2}\right)} \cdot \color{blue}{{\left(\frac{a \cdot c}{b}\right)}^{1}}\right)\right)\right)}{3 \cdot a} \]
    15. metadata-eval92.6%

      \[\leadsto \frac{-1.6875 \cdot \frac{{a}^{3} \cdot {c}^{3}}{{b}^{5}} + \left(-1.5 \cdot \frac{a \cdot c}{b} + -1.125 \cdot \left(\frac{1}{b} \cdot \left({\left(\frac{a \cdot c}{b}\right)}^{\left(\frac{2}{2}\right)} \cdot {\left(\frac{a \cdot c}{b}\right)}^{\color{blue}{\left(\frac{2}{2}\right)}}\right)\right)\right)}{3 \cdot a} \]
    16. pow-sqr92.6%

      \[\leadsto \frac{-1.6875 \cdot \frac{{a}^{3} \cdot {c}^{3}}{{b}^{5}} + \left(-1.5 \cdot \frac{a \cdot c}{b} + -1.125 \cdot \left(\frac{1}{b} \cdot \color{blue}{{\left(\frac{a \cdot c}{b}\right)}^{\left(2 \cdot \frac{2}{2}\right)}}\right)\right)}{3 \cdot a} \]
    17. associate-/l*92.6%

      \[\leadsto \frac{-1.6875 \cdot \frac{{a}^{3} \cdot {c}^{3}}{{b}^{5}} + \left(-1.5 \cdot \frac{a \cdot c}{b} + -1.125 \cdot \left(\frac{1}{b} \cdot {\color{blue}{\left(\frac{a}{\frac{b}{c}}\right)}}^{\left(2 \cdot \frac{2}{2}\right)}\right)\right)}{3 \cdot a} \]
    18. associate-/r/92.6%

      \[\leadsto \frac{-1.6875 \cdot \frac{{a}^{3} \cdot {c}^{3}}{{b}^{5}} + \left(-1.5 \cdot \frac{a \cdot c}{b} + -1.125 \cdot \left(\frac{1}{b} \cdot {\color{blue}{\left(\frac{a}{b} \cdot c\right)}}^{\left(2 \cdot \frac{2}{2}\right)}\right)\right)}{3 \cdot a} \]
    19. metadata-eval92.6%

      \[\leadsto \frac{-1.6875 \cdot \frac{{a}^{3} \cdot {c}^{3}}{{b}^{5}} + \left(-1.5 \cdot \frac{a \cdot c}{b} + -1.125 \cdot \left(\frac{1}{b} \cdot {\left(\frac{a}{b} \cdot c\right)}^{\left(2 \cdot \color{blue}{1}\right)}\right)\right)}{3 \cdot a} \]
    20. metadata-eval92.6%

      \[\leadsto \frac{-1.6875 \cdot \frac{{a}^{3} \cdot {c}^{3}}{{b}^{5}} + \left(-1.5 \cdot \frac{a \cdot c}{b} + -1.125 \cdot \left(\frac{1}{b} \cdot {\left(\frac{a}{b} \cdot c\right)}^{\color{blue}{2}}\right)\right)}{3 \cdot a} \]
  4. Applied egg-rr92.6%

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

    \[\leadsto \frac{-1.6875 \cdot \frac{{c}^{3} \cdot {a}^{3}}{{b}^{5}} + \left(-1.5 \cdot \frac{a \cdot c}{b} + -1.125 \cdot \left(\frac{1}{b} \cdot {\left(c \cdot \frac{a}{b}\right)}^{2}\right)\right)}{a \cdot 3} \]

Alternative 4: 91.0% accurate, 0.5× speedup?

\[\begin{array}{l} \\ -0.5 \cdot \frac{c}{b} + -0.375 \cdot \frac{a \cdot {c}^{2}}{{b}^{3}} \end{array} \]
(FPCore (a b c)
 :precision binary64
 (+ (* -0.5 (/ c b)) (* -0.375 (/ (* a (pow c 2.0)) (pow b 3.0)))))
double code(double a, double b, double c) {
	return (-0.5 * (c / b)) + (-0.375 * ((a * pow(c, 2.0)) / pow(b, 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 = ((-0.5d0) * (c / b)) + ((-0.375d0) * ((a * (c ** 2.0d0)) / (b ** 3.0d0)))
end function
public static double code(double a, double b, double c) {
	return (-0.5 * (c / b)) + (-0.375 * ((a * Math.pow(c, 2.0)) / Math.pow(b, 3.0)));
}
def code(a, b, c):
	return (-0.5 * (c / b)) + (-0.375 * ((a * math.pow(c, 2.0)) / math.pow(b, 3.0)))
function code(a, b, c)
	return Float64(Float64(-0.5 * Float64(c / b)) + Float64(-0.375 * Float64(Float64(a * (c ^ 2.0)) / (b ^ 3.0))))
end
function tmp = code(a, b, c)
	tmp = (-0.5 * (c / b)) + (-0.375 * ((a * (c ^ 2.0)) / (b ^ 3.0)));
end
code[a_, b_, c_] := N[(N[(-0.5 * N[(c / b), $MachinePrecision]), $MachinePrecision] + N[(-0.375 * N[(N[(a * N[Power[c, 2.0], $MachinePrecision]), $MachinePrecision] / N[Power[b, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
-0.5 \cdot \frac{c}{b} + -0.375 \cdot \frac{a \cdot {c}^{2}}{{b}^{3}}
\end{array}
Derivation
  1. Initial program 33.2%

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

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

    \[\leadsto -0.5 \cdot \frac{c}{b} + -0.375 \cdot \frac{a \cdot {c}^{2}}{{b}^{3}} \]

Alternative 5: 90.8% accurate, 5.5× speedup?

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

\\
\frac{\frac{-3 \cdot \left(a \cdot c\right)}{b + \left(b + -1.5 \cdot \left(c \cdot \frac{a}{b}\right)\right)}}{a \cdot 3}
\end{array}
Derivation
  1. Initial program 33.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. Simplified33.2%

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

      \[\leadsto \frac{\color{blue}{\left(b + -1.5 \cdot \frac{a \cdot c}{b}\right)} - b}{3 \cdot a} \]
    3. Step-by-step derivation
      1. sub-neg22.1%

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

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

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

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

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

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

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

        \[\leadsto \frac{\frac{{\left(b + -1.5 \cdot \color{blue}{\frac{a}{\frac{b}{c}}}\right)}^{\left(2 \cdot \frac{2}{2}\right)} - \left(-b\right) \cdot \left(-b\right)}{\left(b + -1.5 \cdot \frac{a \cdot c}{b}\right) - \left(-b\right)}}{3 \cdot a} \]
      9. associate-/r/22.0%

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

        \[\leadsto \frac{\frac{{\left(b + -1.5 \cdot \left(\frac{a}{b} \cdot c\right)\right)}^{\left(2 \cdot \color{blue}{1}\right)} - \left(-b\right) \cdot \left(-b\right)}{\left(b + -1.5 \cdot \frac{a \cdot c}{b}\right) - \left(-b\right)}}{3 \cdot a} \]
      11. metadata-eval22.0%

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

      \[\leadsto \frac{\color{blue}{\frac{{\left(b + -1.5 \cdot \left(\frac{a}{b} \cdot c\right)\right)}^{2} - \left(-b\right) \cdot \left(-b\right)}{\left(b + -1.5 \cdot \left(\frac{a}{b} \cdot c\right)\right) - \left(-b\right)}}}{3 \cdot a} \]
    5. Taylor expanded in b around inf 89.6%

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

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

      \[\leadsto \frac{\frac{\color{blue}{-3 \cdot \left(c \cdot a\right)}}{\left(b + -1.5 \cdot \left(\frac{a}{b} \cdot c\right)\right) - \left(-b\right)}}{3 \cdot a} \]
    8. Final simplification89.6%

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

    Alternative 6: 81.4% 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 33.2%

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

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

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

    Reproduce

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