Cubic critical, narrow range

Percentage Accurate: 55.0% → 99.1%
Time: 16.7s
Alternatives: 16
Speedup: 23.2×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 16 alternatives:

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

Initial Program: 55.0% 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.1% accurate, 0.4× speedup?

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

\\
\frac{-1}{\frac{a \cdot 3}{a} \cdot \frac{b + \sqrt{\mathsf{fma}\left(-3, a \cdot c, {b}^{2}\right)}}{3 \cdot c}}
\end{array}
Derivation
  1. Initial program 52.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. neg-sub052.6%

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{\left(-b\right) + \sqrt{b \cdot b - \color{blue}{\left(e^{\mathsf{log1p}\left(3 \cdot \left(a \cdot c\right)\right)} - 1\right)}}}{3 \cdot a} \]
  6. Applied egg-rr49.3%

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

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

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

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

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

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

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

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

      \[\leadsto \frac{\frac{{\left(-b\right)}^{2} - \left({b}^{2} - \color{blue}{\left(a \cdot c\right) \cdot 3}\right)}{\left(-b\right) - \sqrt{b \cdot b - \mathsf{expm1}\left(\mathsf{log1p}\left(\left(a \cdot c\right) \cdot 3\right)\right)}}}{3 \cdot a} \]
    6. associate-*l*54.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \frac{-1}{\frac{a \cdot 3}{a} \cdot \frac{b + \sqrt{\mathsf{fma}\left(-3, a \cdot c, {b}^{2}\right)}}{3 \cdot c}} \]
  22. Add Preprocessing

Alternative 2: 89.7% accurate, 0.4× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;\frac{\frac{1}{\frac{-0.6666666666666666 \cdot \frac{b}{c} + a \cdot \left(0.375 \cdot \frac{a \cdot c}{{b}^{3}} + 0.5 \cdot \frac{1}{b}\right)}{a}}}{a \cdot 3}\\


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

    1. Initial program 84.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. neg-sub084.1%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\left(-b\right) + \sqrt{b \cdot b - \color{blue}{\left(e^{\mathsf{log1p}\left(3 \cdot \left(a \cdot c\right)\right)} - 1\right)}}}{3 \cdot a} \]
    6. Applied egg-rr62.0%

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

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

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

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

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

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

        \[\leadsto {\left(\frac{\color{blue}{a \cdot 3}}{\left(-b\right) + \sqrt{b \cdot b - \mathsf{expm1}\left(\mathsf{log1p}\left(\left(a \cdot c\right) \cdot 3\right)\right)}}\right)}^{-1} \]
      4. neg-mul-184.1%

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

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

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

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

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

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

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

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

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

    if 0.38 < b

    1. Initial program 47.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\frac{{\left(-b\right)}^{2} - \left({b}^{2} - \color{blue}{\left(a \cdot c\right) \cdot 3}\right)}{\left(-b\right) - \sqrt{b \cdot b - \mathsf{expm1}\left(\mathsf{log1p}\left(\left(a \cdot c\right) \cdot 3\right)\right)}}}{3 \cdot a} \]
      6. associate-*l*49.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 99.1% accurate, 0.4× speedup?

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

\\
\frac{\frac{a \cdot \left(3 \cdot c\right)}{\left(-b\right) - \sqrt{\mathsf{fma}\left(-3, a \cdot c, {b}^{2}\right)}}}{a} \cdot 0.3333333333333333
\end{array}
Derivation
  1. Initial program 52.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. neg-sub052.6%

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{\left(-b\right) + \sqrt{b \cdot b - \color{blue}{\left(e^{\mathsf{log1p}\left(3 \cdot \left(a \cdot c\right)\right)} - 1\right)}}}{3 \cdot a} \]
  6. Applied egg-rr49.3%

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

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

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

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

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

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

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

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

      \[\leadsto \frac{\frac{{\left(-b\right)}^{2} - \left({b}^{2} - \color{blue}{\left(a \cdot c\right) \cdot 3}\right)}{\left(-b\right) - \sqrt{b \cdot b - \mathsf{expm1}\left(\mathsf{log1p}\left(\left(a \cdot c\right) \cdot 3\right)\right)}}}{3 \cdot a} \]
    6. associate-*l*54.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{\frac{\frac{a \cdot \left(c \cdot 3\right)}{\left(-b\right) - \sqrt{\mathsf{fma}\left(-3, c \cdot a, {b}^{2}\right)}}}{a} \cdot 0.3333333333333333} \]
  21. Final simplification98.9%

    \[\leadsto \frac{\frac{a \cdot \left(3 \cdot c\right)}{\left(-b\right) - \sqrt{\mathsf{fma}\left(-3, a \cdot c, {b}^{2}\right)}}}{a} \cdot 0.3333333333333333 \]
  22. Add Preprocessing

Alternative 4: 89.7% accurate, 0.5× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;\frac{\frac{1}{\frac{-0.6666666666666666 \cdot \frac{b}{c} + a \cdot \left(0.375 \cdot \frac{a \cdot c}{{b}^{3}} + 0.5 \cdot \frac{1}{b}\right)}{a}}}{a \cdot 3}\\


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

    1. Initial program 84.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. /-rgt-identity84.1%

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

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

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

    if 0.38 < b

    1. Initial program 47.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\frac{{\left(-b\right)}^{2} - \left({b}^{2} - \color{blue}{\left(a \cdot c\right) \cdot 3}\right)}{\left(-b\right) - \sqrt{b \cdot b - \mathsf{expm1}\left(\mathsf{log1p}\left(\left(a \cdot c\right) \cdot 3\right)\right)}}}{3 \cdot a} \]
      6. associate-*l*49.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 89.7% accurate, 0.9× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;\frac{\frac{1}{\frac{-0.6666666666666666 \cdot \frac{b}{c} + a \cdot \left(0.375 \cdot \frac{a \cdot c}{{b}^{3}} + 0.5 \cdot \frac{1}{b}\right)}{a}}}{a \cdot 3}\\


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

    1. Initial program 84.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. neg-sub084.1%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\left(-b\right) + \sqrt{b \cdot b - \color{blue}{\left(e^{\mathsf{log1p}\left(3 \cdot \left(a \cdot c\right)\right)} - 1\right)}}}{3 \cdot a} \]
    6. Applied egg-rr62.0%

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

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

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

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

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

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

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

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

    if 0.35999999999999999 < b

    1. Initial program 47.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\frac{{\left(-b\right)}^{2} - \left({b}^{2} - \color{blue}{\left(a \cdot c\right) \cdot 3}\right)}{\left(-b\right) - \sqrt{b \cdot b - \mathsf{expm1}\left(\mathsf{log1p}\left(\left(a \cdot c\right) \cdot 3\right)\right)}}}{3 \cdot a} \]
      6. associate-*l*49.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 89.7% accurate, 0.9× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;\frac{\frac{1}{\frac{-0.6666666666666666 \cdot \frac{b}{a} + c \cdot \left(0.375 \cdot \frac{a \cdot c}{{b}^{3}} + 0.5 \cdot \frac{1}{b}\right)}{c}}}{a \cdot 3}\\


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

    1. Initial program 84.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. neg-sub084.1%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\left(-b\right) + \sqrt{b \cdot b - \color{blue}{\left(e^{\mathsf{log1p}\left(3 \cdot \left(a \cdot c\right)\right)} - 1\right)}}}{3 \cdot a} \]
    6. Applied egg-rr62.0%

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

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

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

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

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

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

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

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

    if 0.37 < b

    1. Initial program 47.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\frac{{\left(-b\right)}^{2} - \left({b}^{2} - \color{blue}{\left(a \cdot c\right) \cdot 3}\right)}{\left(-b\right) - \sqrt{b \cdot b - \mathsf{expm1}\left(\mathsf{log1p}\left(\left(a \cdot c\right) \cdot 3\right)\right)}}}{3 \cdot a} \]
      6. associate-*l*49.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 85.4% accurate, 1.0× speedup?

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

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

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


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

    1. Initial program 81.5%

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

    if 6.5 < b

    1. Initial program 44.8%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\left(-b\right) + \sqrt{b \cdot b - \color{blue}{\left(e^{\mathsf{log1p}\left(3 \cdot \left(a \cdot c\right)\right)} - 1\right)}}}{3 \cdot a} \]
    6. Applied egg-rr44.7%

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\frac{{\left(-b\right)}^{2} - \left({b}^{2} - \color{blue}{\left(a \cdot c\right) \cdot 3}\right)}{\left(-b\right) - \sqrt{b \cdot b - \mathsf{expm1}\left(\mathsf{log1p}\left(\left(a \cdot c\right) \cdot 3\right)\right)}}}{3 \cdot a} \]
      6. associate-*l*46.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{\frac{1}{\color{blue}{\frac{-0.6666666666666666 \cdot \frac{b}{c} + 0.5 \cdot \frac{a}{b}}{a}}}}{3 \cdot a} \]
    18. Step-by-step derivation
      1. fma-define89.7%

        \[\leadsto \frac{\frac{1}{\frac{\color{blue}{\mathsf{fma}\left(-0.6666666666666666, \frac{b}{c}, 0.5 \cdot \frac{a}{b}\right)}}{a}}}{3 \cdot a} \]
    19. Simplified89.7%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq 6.5:\\ \;\;\;\;\frac{\sqrt{b \cdot b - c \cdot \left(a \cdot 3\right)} - b}{a \cdot 3}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{1}{\frac{\mathsf{fma}\left(-0.6666666666666666, \frac{b}{c}, 0.5 \cdot \frac{a}{b}\right)}{a}}}{a \cdot 3}\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 85.4% accurate, 1.0× speedup?

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

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

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


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

    1. Initial program 81.5%

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

    if 6.79999999999999982 < b

    1. Initial program 44.8%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\left(-b\right) + \sqrt{b \cdot b - \color{blue}{\left(e^{\mathsf{log1p}\left(3 \cdot \left(a \cdot c\right)\right)} - 1\right)}}}{3 \cdot a} \]
    6. Applied egg-rr44.7%

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\frac{{\left(-b\right)}^{2} - \left({b}^{2} - \color{blue}{\left(a \cdot c\right) \cdot 3}\right)}{\left(-b\right) - \sqrt{b \cdot b - \mathsf{expm1}\left(\mathsf{log1p}\left(\left(a \cdot c\right) \cdot 3\right)\right)}}}{3 \cdot a} \]
      6. associate-*l*46.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{\frac{1}{\color{blue}{\frac{-0.6666666666666666 \cdot \frac{b}{a} + 0.5 \cdot \frac{c}{b}}{c}}}}{3 \cdot a} \]
    18. Step-by-step derivation
      1. fma-define89.6%

        \[\leadsto \frac{\frac{1}{\frac{\color{blue}{\mathsf{fma}\left(-0.6666666666666666, \frac{b}{a}, 0.5 \cdot \frac{c}{b}\right)}}{c}}}{3 \cdot a} \]
    19. Simplified89.6%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq 6.8:\\ \;\;\;\;\frac{\sqrt{b \cdot b - c \cdot \left(a \cdot 3\right)} - b}{a \cdot 3}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{1}{\frac{\mathsf{fma}\left(-0.6666666666666666, \frac{b}{a}, 0.5 \cdot \frac{c}{b}\right)}{c}}}{a \cdot 3}\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 85.4% accurate, 1.0× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;\frac{\frac{1}{\frac{-0.6666666666666666 \cdot \frac{b}{c} + 0.5 \cdot \frac{a}{b}}{a}}}{a \cdot 3}\\


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

    1. Initial program 81.5%

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

    if 7.5999999999999996 < b

    1. Initial program 44.8%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\left(-b\right) + \sqrt{b \cdot b - \color{blue}{\left(e^{\mathsf{log1p}\left(3 \cdot \left(a \cdot c\right)\right)} - 1\right)}}}{3 \cdot a} \]
    6. Applied egg-rr44.7%

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\frac{{\left(-b\right)}^{2} - \left({b}^{2} - \color{blue}{\left(a \cdot c\right) \cdot 3}\right)}{\left(-b\right) - \sqrt{b \cdot b - \mathsf{expm1}\left(\mathsf{log1p}\left(\left(a \cdot c\right) \cdot 3\right)\right)}}}{3 \cdot a} \]
      6. associate-*l*46.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq 7.6:\\ \;\;\;\;\frac{\sqrt{b \cdot b - c \cdot \left(a \cdot 3\right)} - b}{a \cdot 3}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{1}{\frac{-0.6666666666666666 \cdot \frac{b}{c} + 0.5 \cdot \frac{a}{b}}{a}}}{a \cdot 3}\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 85.4% accurate, 1.0× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;\frac{\frac{1}{\frac{-0.6666666666666666 \cdot \frac{b}{c} + 0.5 \cdot \frac{a}{b}}{a}}}{a \cdot 3}\\


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

    1. Initial program 81.5%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\left(-b\right) + \sqrt{b \cdot b - \color{blue}{\left(e^{\mathsf{log1p}\left(3 \cdot \left(a \cdot c\right)\right)} - 1\right)}}}{3 \cdot a} \]
    6. Applied egg-rr66.1%

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

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

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

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

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

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

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

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

    if 6.5999999999999996 < b

    1. Initial program 44.8%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\left(-b\right) + \sqrt{b \cdot b - \color{blue}{\left(e^{\mathsf{log1p}\left(3 \cdot \left(a \cdot c\right)\right)} - 1\right)}}}{3 \cdot a} \]
    6. Applied egg-rr44.7%

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\frac{{\left(-b\right)}^{2} - \left({b}^{2} - \color{blue}{\left(a \cdot c\right) \cdot 3}\right)}{\left(-b\right) - \sqrt{b \cdot b - \mathsf{expm1}\left(\mathsf{log1p}\left(\left(a \cdot c\right) \cdot 3\right)\right)}}}{3 \cdot a} \]
      6. associate-*l*46.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{\frac{1}{\color{blue}{\frac{-0.6666666666666666 \cdot \frac{b}{c} + 0.5 \cdot \frac{a}{b}}{a}}}}{3 \cdot a} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification87.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq 6.6:\\ \;\;\;\;\frac{\sqrt{b \cdot b - a \cdot \left(3 \cdot c\right)} - b}{a \cdot 3}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{1}{\frac{-0.6666666666666666 \cdot \frac{b}{c} + 0.5 \cdot \frac{a}{b}}{a}}}{a \cdot 3}\\ \end{array} \]
  5. Add Preprocessing

Alternative 11: 85.4% accurate, 1.0× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;\frac{\frac{1}{\frac{-0.6666666666666666 \cdot \frac{b}{c} + 0.5 \cdot \frac{a}{b}}{a}}}{a \cdot 3}\\


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

    1. Initial program 81.5%

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

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

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

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

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

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

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

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

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

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

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

    if 6.5999999999999996 < b

    1. Initial program 44.8%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\left(-b\right) + \sqrt{b \cdot b - \color{blue}{\left(e^{\mathsf{log1p}\left(3 \cdot \left(a \cdot c\right)\right)} - 1\right)}}}{3 \cdot a} \]
    6. Applied egg-rr44.7%

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\frac{{\left(-b\right)}^{2} - \left({b}^{2} - \color{blue}{\left(a \cdot c\right) \cdot 3}\right)}{\left(-b\right) - \sqrt{b \cdot b - \mathsf{expm1}\left(\mathsf{log1p}\left(\left(a \cdot c\right) \cdot 3\right)\right)}}}{3 \cdot a} \]
      6. associate-*l*46.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{\frac{1}{\color{blue}{\frac{-0.6666666666666666 \cdot \frac{b}{c} + 0.5 \cdot \frac{a}{b}}{a}}}}{3 \cdot a} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification87.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq 6.6:\\ \;\;\;\;\frac{\sqrt{b \cdot b - 3 \cdot \left(a \cdot c\right)} - b}{a \cdot 3}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{1}{\frac{-0.6666666666666666 \cdot \frac{b}{c} + 0.5 \cdot \frac{a}{b}}{a}}}{a \cdot 3}\\ \end{array} \]
  5. Add Preprocessing

Alternative 12: 82.2% accurate, 6.1× speedup?

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

\\
\frac{\frac{1}{\frac{-0.6666666666666666 \cdot \frac{b}{c} + 0.5 \cdot \frac{a}{b}}{a}}}{a \cdot 3}
\end{array}
Derivation
  1. Initial program 52.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. neg-sub052.6%

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{\left(-b\right) + \sqrt{b \cdot b - \color{blue}{\left(e^{\mathsf{log1p}\left(3 \cdot \left(a \cdot c\right)\right)} - 1\right)}}}{3 \cdot a} \]
  6. Applied egg-rr49.3%

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

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

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

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

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

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

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

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

      \[\leadsto \frac{\frac{{\left(-b\right)}^{2} - \left({b}^{2} - \color{blue}{\left(a \cdot c\right) \cdot 3}\right)}{\left(-b\right) - \sqrt{b \cdot b - \mathsf{expm1}\left(\mathsf{log1p}\left(\left(a \cdot c\right) \cdot 3\right)\right)}}}{3 \cdot a} \]
    6. associate-*l*54.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \frac{\frac{1}{\color{blue}{\frac{-0.6666666666666666 \cdot \frac{b}{c} + 0.5 \cdot \frac{a}{b}}{a}}}}{3 \cdot a} \]
  18. Final simplification83.8%

    \[\leadsto \frac{\frac{1}{\frac{-0.6666666666666666 \cdot \frac{b}{c} + 0.5 \cdot \frac{a}{b}}{a}}}{a \cdot 3} \]
  19. Add Preprocessing

Alternative 13: 82.2% accurate, 6.1× speedup?

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

\\
\frac{\frac{1}{\frac{-0.6666666666666666 \cdot \frac{b}{a} + 0.5 \cdot \frac{c}{b}}{c}}}{a \cdot 3}
\end{array}
Derivation
  1. Initial program 52.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. neg-sub052.6%

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{\left(-b\right) + \sqrt{b \cdot b - \color{blue}{\left(e^{\mathsf{log1p}\left(3 \cdot \left(a \cdot c\right)\right)} - 1\right)}}}{3 \cdot a} \]
  6. Applied egg-rr49.3%

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

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

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

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

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

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

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

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

      \[\leadsto \frac{\frac{{\left(-b\right)}^{2} - \left({b}^{2} - \color{blue}{\left(a \cdot c\right) \cdot 3}\right)}{\left(-b\right) - \sqrt{b \cdot b - \mathsf{expm1}\left(\mathsf{log1p}\left(\left(a \cdot c\right) \cdot 3\right)\right)}}}{3 \cdot a} \]
    6. associate-*l*54.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \frac{\frac{1}{\color{blue}{\frac{-0.6666666666666666 \cdot \frac{b}{a} + 0.5 \cdot \frac{c}{b}}{c}}}}{3 \cdot a} \]
  18. Final simplification83.8%

    \[\leadsto \frac{\frac{1}{\frac{-0.6666666666666666 \cdot \frac{b}{a} + 0.5 \cdot \frac{c}{b}}{c}}}{a \cdot 3} \]
  19. Add Preprocessing

Alternative 14: 64.7% accurate, 23.2× speedup?

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

\\
\frac{c \cdot -0.5}{b}
\end{array}
Derivation
  1. Initial program 52.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. neg-sub052.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 15: 64.6% accurate, 23.2× speedup?

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

\\
c \cdot \frac{-0.5}{b}
\end{array}
Derivation
  1. Initial program 52.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. neg-sub052.6%

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

      \[\leadsto \frac{\left(0 - b\right) + \sqrt{\color{blue}{\left(-b\right) \cdot \left(-b\right)} - \left(3 \cdot a\right) \cdot c}}{3 \cdot a} \]
    3. associate-+l-52.6%

      \[\leadsto \frac{\color{blue}{0 - \left(b - \sqrt{\left(-b\right) \cdot \left(-b\right) - \left(3 \cdot a\right) \cdot c}\right)}}{3 \cdot a} \]
    4. sub0-neg52.6%

      \[\leadsto \frac{\color{blue}{-\left(b - \sqrt{\left(-b\right) \cdot \left(-b\right) - \left(3 \cdot a\right) \cdot c}\right)}}{3 \cdot a} \]
    5. sub-neg52.6%

      \[\leadsto \frac{-\color{blue}{\left(b + \left(-\sqrt{\left(-b\right) \cdot \left(-b\right) - \left(3 \cdot a\right) \cdot c}\right)\right)}}{3 \cdot a} \]
    6. distribute-neg-in52.6%

      \[\leadsto \frac{\color{blue}{\left(-b\right) + \left(-\left(-\sqrt{\left(-b\right) \cdot \left(-b\right) - \left(3 \cdot a\right) \cdot c}\right)\right)}}{3 \cdot a} \]
    7. remove-double-neg52.6%

      \[\leadsto \frac{\left(-b\right) + \color{blue}{\sqrt{\left(-b\right) \cdot \left(-b\right) - \left(3 \cdot a\right) \cdot c}}}{3 \cdot a} \]
    8. sqr-neg52.6%

      \[\leadsto \frac{\left(-b\right) + \sqrt{\color{blue}{b \cdot b} - \left(3 \cdot a\right) \cdot c}}{3 \cdot a} \]
    9. associate-*l*52.6%

      \[\leadsto \frac{\left(-b\right) + \sqrt{b \cdot b - \color{blue}{3 \cdot \left(a \cdot c\right)}}}{3 \cdot a} \]
  3. Simplified52.6%

    \[\leadsto \color{blue}{\frac{\left(-b\right) + \sqrt{b \cdot b - 3 \cdot \left(a \cdot c\right)}}{3 \cdot a}} \]
  4. Add Preprocessing
  5. Step-by-step derivation
    1. expm1-log1p-u52.6%

      \[\leadsto \frac{\left(-b\right) + \sqrt{b \cdot b - \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(3 \cdot \left(a \cdot c\right)\right)\right)}}}{3 \cdot a} \]
    2. expm1-undefine49.3%

      \[\leadsto \frac{\left(-b\right) + \sqrt{b \cdot b - \color{blue}{\left(e^{\mathsf{log1p}\left(3 \cdot \left(a \cdot c\right)\right)} - 1\right)}}}{3 \cdot a} \]
  6. Applied egg-rr49.3%

    \[\leadsto \frac{\left(-b\right) + \sqrt{b \cdot b - \color{blue}{\left(e^{\mathsf{log1p}\left(3 \cdot \left(a \cdot c\right)\right)} - 1\right)}}}{3 \cdot a} \]
  7. Step-by-step derivation
    1. expm1-define52.6%

      \[\leadsto \frac{\left(-b\right) + \sqrt{b \cdot b - \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(3 \cdot \left(a \cdot c\right)\right)\right)}}}{3 \cdot a} \]
    2. *-commutative52.6%

      \[\leadsto \frac{\left(-b\right) + \sqrt{b \cdot b - \mathsf{expm1}\left(\mathsf{log1p}\left(\color{blue}{\left(a \cdot c\right) \cdot 3}\right)\right)}}{3 \cdot a} \]
  8. Simplified52.6%

    \[\leadsto \frac{\left(-b\right) + \sqrt{b \cdot b - \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\left(a \cdot c\right) \cdot 3\right)\right)}}}{3 \cdot a} \]
  9. Step-by-step derivation
    1. div-inv52.6%

      \[\leadsto \color{blue}{\left(\left(-b\right) + \sqrt{b \cdot b - \mathsf{expm1}\left(\mathsf{log1p}\left(\left(a \cdot c\right) \cdot 3\right)\right)}\right) \cdot \frac{1}{3 \cdot a}} \]
    2. neg-mul-152.6%

      \[\leadsto \left(\color{blue}{-1 \cdot b} + \sqrt{b \cdot b - \mathsf{expm1}\left(\mathsf{log1p}\left(\left(a \cdot c\right) \cdot 3\right)\right)}\right) \cdot \frac{1}{3 \cdot a} \]
    3. fma-define52.6%

      \[\leadsto \color{blue}{\mathsf{fma}\left(-1, b, \sqrt{b \cdot b - \mathsf{expm1}\left(\mathsf{log1p}\left(\left(a \cdot c\right) \cdot 3\right)\right)}\right)} \cdot \frac{1}{3 \cdot a} \]
    4. pow252.6%

      \[\leadsto \mathsf{fma}\left(-1, b, \sqrt{\color{blue}{{b}^{2}} - \mathsf{expm1}\left(\mathsf{log1p}\left(\left(a \cdot c\right) \cdot 3\right)\right)}\right) \cdot \frac{1}{3 \cdot a} \]
    5. expm1-log1p-u52.6%

      \[\leadsto \mathsf{fma}\left(-1, b, \sqrt{{b}^{2} - \color{blue}{\left(a \cdot c\right) \cdot 3}}\right) \cdot \frac{1}{3 \cdot a} \]
    6. associate-*l*52.6%

      \[\leadsto \mathsf{fma}\left(-1, b, \sqrt{{b}^{2} - \color{blue}{a \cdot \left(c \cdot 3\right)}}\right) \cdot \frac{1}{3 \cdot a} \]
    7. *-commutative52.6%

      \[\leadsto \mathsf{fma}\left(-1, b, \sqrt{{b}^{2} - a \cdot \left(c \cdot 3\right)}\right) \cdot \frac{1}{\color{blue}{a \cdot 3}} \]
  10. Applied egg-rr52.6%

    \[\leadsto \color{blue}{\mathsf{fma}\left(-1, b, \sqrt{{b}^{2} - a \cdot \left(c \cdot 3\right)}\right) \cdot \frac{1}{a \cdot 3}} \]
  11. Step-by-step derivation
    1. fma-undefine52.6%

      \[\leadsto \color{blue}{\left(-1 \cdot b + \sqrt{{b}^{2} - a \cdot \left(c \cdot 3\right)}\right)} \cdot \frac{1}{a \cdot 3} \]
    2. *-commutative52.6%

      \[\leadsto \left(\color{blue}{b \cdot -1} + \sqrt{{b}^{2} - a \cdot \left(c \cdot 3\right)}\right) \cdot \frac{1}{a \cdot 3} \]
    3. fma-define52.6%

      \[\leadsto \color{blue}{\mathsf{fma}\left(b, -1, \sqrt{{b}^{2} - a \cdot \left(c \cdot 3\right)}\right)} \cdot \frac{1}{a \cdot 3} \]
    4. unpow252.6%

      \[\leadsto \mathsf{fma}\left(b, -1, \sqrt{\color{blue}{b \cdot b} - a \cdot \left(c \cdot 3\right)}\right) \cdot \frac{1}{a \cdot 3} \]
    5. fma-neg52.6%

      \[\leadsto \mathsf{fma}\left(b, -1, \sqrt{\color{blue}{\mathsf{fma}\left(b, b, -a \cdot \left(c \cdot 3\right)\right)}}\right) \cdot \frac{1}{a \cdot 3} \]
    6. associate-*r*52.6%

      \[\leadsto \mathsf{fma}\left(b, -1, \sqrt{\mathsf{fma}\left(b, b, -\color{blue}{\left(a \cdot c\right) \cdot 3}\right)}\right) \cdot \frac{1}{a \cdot 3} \]
    7. distribute-rgt-neg-in52.6%

      \[\leadsto \mathsf{fma}\left(b, -1, \sqrt{\mathsf{fma}\left(b, b, \color{blue}{\left(a \cdot c\right) \cdot \left(-3\right)}\right)}\right) \cdot \frac{1}{a \cdot 3} \]
    8. metadata-eval52.6%

      \[\leadsto \mathsf{fma}\left(b, -1, \sqrt{\mathsf{fma}\left(b, b, \left(a \cdot c\right) \cdot \color{blue}{-3}\right)}\right) \cdot \frac{1}{a \cdot 3} \]
    9. *-commutative52.6%

      \[\leadsto \mathsf{fma}\left(b, -1, \sqrt{\mathsf{fma}\left(b, b, \left(a \cdot c\right) \cdot -3\right)}\right) \cdot \frac{1}{\color{blue}{3 \cdot a}} \]
    10. associate-/r*52.5%

      \[\leadsto \mathsf{fma}\left(b, -1, \sqrt{\mathsf{fma}\left(b, b, \left(a \cdot c\right) \cdot -3\right)}\right) \cdot \color{blue}{\frac{\frac{1}{3}}{a}} \]
    11. metadata-eval52.5%

      \[\leadsto \mathsf{fma}\left(b, -1, \sqrt{\mathsf{fma}\left(b, b, \left(a \cdot c\right) \cdot -3\right)}\right) \cdot \frac{\color{blue}{0.3333333333333333}}{a} \]
  12. Simplified52.5%

    \[\leadsto \color{blue}{\mathsf{fma}\left(b, -1, \sqrt{\mathsf{fma}\left(b, b, \left(a \cdot c\right) \cdot -3\right)}\right) \cdot \frac{0.3333333333333333}{a}} \]
  13. Taylor expanded in a around 0 66.3%

    \[\leadsto \color{blue}{\frac{-0.5 \cdot \frac{a \cdot c}{b} + 0.3333333333333333 \cdot \left(b + -1 \cdot b\right)}{a}} \]
  14. Taylor expanded in c around inf 66.3%

    \[\leadsto \color{blue}{c \cdot \left(0.3333333333333333 \cdot \frac{b + -1 \cdot b}{a \cdot c} - 0.5 \cdot \frac{1}{b}\right)} \]
  15. Step-by-step derivation
    1. distribute-rgt1-in66.3%

      \[\leadsto c \cdot \left(0.3333333333333333 \cdot \frac{\color{blue}{\left(-1 + 1\right) \cdot b}}{a \cdot c} - 0.5 \cdot \frac{1}{b}\right) \]
    2. metadata-eval66.3%

      \[\leadsto c \cdot \left(0.3333333333333333 \cdot \frac{\color{blue}{0} \cdot b}{a \cdot c} - 0.5 \cdot \frac{1}{b}\right) \]
    3. mul0-lft66.3%

      \[\leadsto c \cdot \left(0.3333333333333333 \cdot \frac{\color{blue}{0}}{a \cdot c} - 0.5 \cdot \frac{1}{b}\right) \]
    4. div066.3%

      \[\leadsto c \cdot \left(0.3333333333333333 \cdot \color{blue}{0} - 0.5 \cdot \frac{1}{b}\right) \]
    5. metadata-eval66.3%

      \[\leadsto c \cdot \left(\color{blue}{0} - 0.5 \cdot \frac{1}{b}\right) \]
    6. neg-sub066.3%

      \[\leadsto c \cdot \color{blue}{\left(-0.5 \cdot \frac{1}{b}\right)} \]
    7. associate-*r/66.3%

      \[\leadsto c \cdot \left(-\color{blue}{\frac{0.5 \cdot 1}{b}}\right) \]
    8. metadata-eval66.3%

      \[\leadsto c \cdot \left(-\frac{\color{blue}{0.5}}{b}\right) \]
    9. distribute-neg-frac66.3%

      \[\leadsto c \cdot \color{blue}{\frac{-0.5}{b}} \]
    10. metadata-eval66.3%

      \[\leadsto c \cdot \frac{\color{blue}{-0.5}}{b} \]
  16. Simplified66.3%

    \[\leadsto \color{blue}{c \cdot \frac{-0.5}{b}} \]
  17. Add Preprocessing

Alternative 16: 3.2% accurate, 116.0× speedup?

\[\begin{array}{l} \\ 0 \end{array} \]
(FPCore (a b c) :precision binary64 0.0)
double code(double a, double b, double c) {
	return 0.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.0d0
end function
public static double code(double a, double b, double c) {
	return 0.0;
}
def code(a, b, c):
	return 0.0
function code(a, b, c)
	return 0.0
end
function tmp = code(a, b, c)
	tmp = 0.0;
end
code[a_, b_, c_] := 0.0
\begin{array}{l}

\\
0
\end{array}
Derivation
  1. Initial program 52.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. neg-sub052.6%

      \[\leadsto \frac{\color{blue}{\left(0 - b\right)} + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a} \]
    2. sqr-neg52.6%

      \[\leadsto \frac{\left(0 - b\right) + \sqrt{\color{blue}{\left(-b\right) \cdot \left(-b\right)} - \left(3 \cdot a\right) \cdot c}}{3 \cdot a} \]
    3. associate-+l-52.6%

      \[\leadsto \frac{\color{blue}{0 - \left(b - \sqrt{\left(-b\right) \cdot \left(-b\right) - \left(3 \cdot a\right) \cdot c}\right)}}{3 \cdot a} \]
    4. sub0-neg52.6%

      \[\leadsto \frac{\color{blue}{-\left(b - \sqrt{\left(-b\right) \cdot \left(-b\right) - \left(3 \cdot a\right) \cdot c}\right)}}{3 \cdot a} \]
    5. sub-neg52.6%

      \[\leadsto \frac{-\color{blue}{\left(b + \left(-\sqrt{\left(-b\right) \cdot \left(-b\right) - \left(3 \cdot a\right) \cdot c}\right)\right)}}{3 \cdot a} \]
    6. distribute-neg-in52.6%

      \[\leadsto \frac{\color{blue}{\left(-b\right) + \left(-\left(-\sqrt{\left(-b\right) \cdot \left(-b\right) - \left(3 \cdot a\right) \cdot c}\right)\right)}}{3 \cdot a} \]
    7. remove-double-neg52.6%

      \[\leadsto \frac{\left(-b\right) + \color{blue}{\sqrt{\left(-b\right) \cdot \left(-b\right) - \left(3 \cdot a\right) \cdot c}}}{3 \cdot a} \]
    8. sqr-neg52.6%

      \[\leadsto \frac{\left(-b\right) + \sqrt{\color{blue}{b \cdot b} - \left(3 \cdot a\right) \cdot c}}{3 \cdot a} \]
    9. associate-*l*52.6%

      \[\leadsto \frac{\left(-b\right) + \sqrt{b \cdot b - \color{blue}{3 \cdot \left(a \cdot c\right)}}}{3 \cdot a} \]
  3. Simplified52.6%

    \[\leadsto \color{blue}{\frac{\left(-b\right) + \sqrt{b \cdot b - 3 \cdot \left(a \cdot c\right)}}{3 \cdot a}} \]
  4. Add Preprocessing
  5. Step-by-step derivation
    1. expm1-log1p-u52.6%

      \[\leadsto \frac{\left(-b\right) + \sqrt{b \cdot b - \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(3 \cdot \left(a \cdot c\right)\right)\right)}}}{3 \cdot a} \]
    2. expm1-undefine49.3%

      \[\leadsto \frac{\left(-b\right) + \sqrt{b \cdot b - \color{blue}{\left(e^{\mathsf{log1p}\left(3 \cdot \left(a \cdot c\right)\right)} - 1\right)}}}{3 \cdot a} \]
  6. Applied egg-rr49.3%

    \[\leadsto \frac{\left(-b\right) + \sqrt{b \cdot b - \color{blue}{\left(e^{\mathsf{log1p}\left(3 \cdot \left(a \cdot c\right)\right)} - 1\right)}}}{3 \cdot a} \]
  7. Step-by-step derivation
    1. expm1-define52.6%

      \[\leadsto \frac{\left(-b\right) + \sqrt{b \cdot b - \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(3 \cdot \left(a \cdot c\right)\right)\right)}}}{3 \cdot a} \]
    2. *-commutative52.6%

      \[\leadsto \frac{\left(-b\right) + \sqrt{b \cdot b - \mathsf{expm1}\left(\mathsf{log1p}\left(\color{blue}{\left(a \cdot c\right) \cdot 3}\right)\right)}}{3 \cdot a} \]
  8. Simplified52.6%

    \[\leadsto \frac{\left(-b\right) + \sqrt{b \cdot b - \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\left(a \cdot c\right) \cdot 3\right)\right)}}}{3 \cdot a} \]
  9. Step-by-step derivation
    1. div-inv52.6%

      \[\leadsto \color{blue}{\left(\left(-b\right) + \sqrt{b \cdot b - \mathsf{expm1}\left(\mathsf{log1p}\left(\left(a \cdot c\right) \cdot 3\right)\right)}\right) \cdot \frac{1}{3 \cdot a}} \]
    2. neg-mul-152.6%

      \[\leadsto \left(\color{blue}{-1 \cdot b} + \sqrt{b \cdot b - \mathsf{expm1}\left(\mathsf{log1p}\left(\left(a \cdot c\right) \cdot 3\right)\right)}\right) \cdot \frac{1}{3 \cdot a} \]
    3. fma-define52.6%

      \[\leadsto \color{blue}{\mathsf{fma}\left(-1, b, \sqrt{b \cdot b - \mathsf{expm1}\left(\mathsf{log1p}\left(\left(a \cdot c\right) \cdot 3\right)\right)}\right)} \cdot \frac{1}{3 \cdot a} \]
    4. pow252.6%

      \[\leadsto \mathsf{fma}\left(-1, b, \sqrt{\color{blue}{{b}^{2}} - \mathsf{expm1}\left(\mathsf{log1p}\left(\left(a \cdot c\right) \cdot 3\right)\right)}\right) \cdot \frac{1}{3 \cdot a} \]
    5. expm1-log1p-u52.6%

      \[\leadsto \mathsf{fma}\left(-1, b, \sqrt{{b}^{2} - \color{blue}{\left(a \cdot c\right) \cdot 3}}\right) \cdot \frac{1}{3 \cdot a} \]
    6. associate-*l*52.6%

      \[\leadsto \mathsf{fma}\left(-1, b, \sqrt{{b}^{2} - \color{blue}{a \cdot \left(c \cdot 3\right)}}\right) \cdot \frac{1}{3 \cdot a} \]
    7. *-commutative52.6%

      \[\leadsto \mathsf{fma}\left(-1, b, \sqrt{{b}^{2} - a \cdot \left(c \cdot 3\right)}\right) \cdot \frac{1}{\color{blue}{a \cdot 3}} \]
  10. Applied egg-rr52.6%

    \[\leadsto \color{blue}{\mathsf{fma}\left(-1, b, \sqrt{{b}^{2} - a \cdot \left(c \cdot 3\right)}\right) \cdot \frac{1}{a \cdot 3}} \]
  11. Step-by-step derivation
    1. fma-undefine52.6%

      \[\leadsto \color{blue}{\left(-1 \cdot b + \sqrt{{b}^{2} - a \cdot \left(c \cdot 3\right)}\right)} \cdot \frac{1}{a \cdot 3} \]
    2. *-commutative52.6%

      \[\leadsto \left(\color{blue}{b \cdot -1} + \sqrt{{b}^{2} - a \cdot \left(c \cdot 3\right)}\right) \cdot \frac{1}{a \cdot 3} \]
    3. fma-define52.6%

      \[\leadsto \color{blue}{\mathsf{fma}\left(b, -1, \sqrt{{b}^{2} - a \cdot \left(c \cdot 3\right)}\right)} \cdot \frac{1}{a \cdot 3} \]
    4. unpow252.6%

      \[\leadsto \mathsf{fma}\left(b, -1, \sqrt{\color{blue}{b \cdot b} - a \cdot \left(c \cdot 3\right)}\right) \cdot \frac{1}{a \cdot 3} \]
    5. fma-neg52.6%

      \[\leadsto \mathsf{fma}\left(b, -1, \sqrt{\color{blue}{\mathsf{fma}\left(b, b, -a \cdot \left(c \cdot 3\right)\right)}}\right) \cdot \frac{1}{a \cdot 3} \]
    6. associate-*r*52.6%

      \[\leadsto \mathsf{fma}\left(b, -1, \sqrt{\mathsf{fma}\left(b, b, -\color{blue}{\left(a \cdot c\right) \cdot 3}\right)}\right) \cdot \frac{1}{a \cdot 3} \]
    7. distribute-rgt-neg-in52.6%

      \[\leadsto \mathsf{fma}\left(b, -1, \sqrt{\mathsf{fma}\left(b, b, \color{blue}{\left(a \cdot c\right) \cdot \left(-3\right)}\right)}\right) \cdot \frac{1}{a \cdot 3} \]
    8. metadata-eval52.6%

      \[\leadsto \mathsf{fma}\left(b, -1, \sqrt{\mathsf{fma}\left(b, b, \left(a \cdot c\right) \cdot \color{blue}{-3}\right)}\right) \cdot \frac{1}{a \cdot 3} \]
    9. *-commutative52.6%

      \[\leadsto \mathsf{fma}\left(b, -1, \sqrt{\mathsf{fma}\left(b, b, \left(a \cdot c\right) \cdot -3\right)}\right) \cdot \frac{1}{\color{blue}{3 \cdot a}} \]
    10. associate-/r*52.5%

      \[\leadsto \mathsf{fma}\left(b, -1, \sqrt{\mathsf{fma}\left(b, b, \left(a \cdot c\right) \cdot -3\right)}\right) \cdot \color{blue}{\frac{\frac{1}{3}}{a}} \]
    11. metadata-eval52.5%

      \[\leadsto \mathsf{fma}\left(b, -1, \sqrt{\mathsf{fma}\left(b, b, \left(a \cdot c\right) \cdot -3\right)}\right) \cdot \frac{\color{blue}{0.3333333333333333}}{a} \]
  12. Simplified52.5%

    \[\leadsto \color{blue}{\mathsf{fma}\left(b, -1, \sqrt{\mathsf{fma}\left(b, b, \left(a \cdot c\right) \cdot -3\right)}\right) \cdot \frac{0.3333333333333333}{a}} \]
  13. Taylor expanded in a around 0 66.3%

    \[\leadsto \color{blue}{\frac{-0.5 \cdot \frac{a \cdot c}{b} + 0.3333333333333333 \cdot \left(b + -1 \cdot b\right)}{a}} \]
  14. Taylor expanded in a around 0 3.2%

    \[\leadsto \color{blue}{0.3333333333333333 \cdot \frac{b + -1 \cdot b}{a}} \]
  15. Step-by-step derivation
    1. distribute-rgt1-in3.2%

      \[\leadsto 0.3333333333333333 \cdot \frac{\color{blue}{\left(-1 + 1\right) \cdot b}}{a} \]
    2. metadata-eval3.2%

      \[\leadsto 0.3333333333333333 \cdot \frac{\color{blue}{0} \cdot b}{a} \]
    3. mul0-lft3.2%

      \[\leadsto 0.3333333333333333 \cdot \frac{\color{blue}{0}}{a} \]
    4. metadata-eval3.2%

      \[\leadsto 0.3333333333333333 \cdot \frac{\color{blue}{1 + -1}}{a} \]
    5. rem-square-sqrt0.0%

      \[\leadsto 0.3333333333333333 \cdot \frac{1 + \color{blue}{\sqrt{-1} \cdot \sqrt{-1}}}{a} \]
    6. unpow20.0%

      \[\leadsto 0.3333333333333333 \cdot \frac{1 + \color{blue}{{\left(\sqrt{-1}\right)}^{2}}}{a} \]
    7. associate-*r/0.0%

      \[\leadsto \color{blue}{\frac{0.3333333333333333 \cdot \left(1 + {\left(\sqrt{-1}\right)}^{2}\right)}{a}} \]
    8. unpow20.0%

      \[\leadsto \frac{0.3333333333333333 \cdot \left(1 + \color{blue}{\sqrt{-1} \cdot \sqrt{-1}}\right)}{a} \]
    9. rem-square-sqrt3.2%

      \[\leadsto \frac{0.3333333333333333 \cdot \left(1 + \color{blue}{-1}\right)}{a} \]
    10. metadata-eval3.2%

      \[\leadsto \frac{0.3333333333333333 \cdot \color{blue}{0}}{a} \]
    11. metadata-eval3.2%

      \[\leadsto \frac{\color{blue}{0}}{a} \]
    12. div03.2%

      \[\leadsto \color{blue}{0} \]
  16. Simplified3.2%

    \[\leadsto \color{blue}{0} \]
  17. Add Preprocessing

Reproduce

?
herbie shell --seed 2024108 
(FPCore (a b c)
  :name "Cubic critical, narrow range"
  :precision binary64
  :pre (and (and (and (< 1.0536712127723509e-8 a) (< a 94906265.62425156)) (and (< 1.0536712127723509e-8 b) (< b 94906265.62425156))) (and (< 1.0536712127723509e-8 c) (< c 94906265.62425156)))
  (/ (+ (- b) (sqrt (- (* b b) (* (* 3.0 a) c)))) (* 3.0 a)))