Cubic critical

Percentage Accurate: 51.6% → 84.6%
Time: 22.5s
Alternatives: 21
Speedup: 11.6×

Specification

?
\[\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 21 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: 51.6% 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: 84.6% accurate, 0.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq -1 \cdot 10^{+153}:\\
\;\;\;\;\frac{-0.6666666666666666}{\frac{a}{b}}\\

\mathbf{elif}\;b \leq 6 \cdot 10^{-36}:\\
\;\;\;\;\frac{\sqrt{b \cdot b - \left(a \cdot 3\right) \cdot c} - b}{a \cdot 3}\\

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


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

    1. Initial program 36.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. sqr-neg36.3%

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

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

        \[\leadsto \frac{\left(-b\right) + \sqrt{b \cdot b - \color{blue}{3 \cdot \left(a \cdot c\right)}}}{3 \cdot a} \]
    3. Simplified36.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. Taylor expanded in b around -inf 95.1%

      \[\leadsto \color{blue}{-0.6666666666666666 \cdot \frac{b}{a}} \]
    6. Step-by-step derivation
      1. *-commutative95.1%

        \[\leadsto \color{blue}{\frac{b}{a} \cdot -0.6666666666666666} \]
    7. Simplified95.1%

      \[\leadsto \color{blue}{\frac{b}{a} \cdot -0.6666666666666666} \]
    8. Step-by-step derivation
      1. *-commutative95.1%

        \[\leadsto \color{blue}{-0.6666666666666666 \cdot \frac{b}{a}} \]
      2. clear-num94.9%

        \[\leadsto -0.6666666666666666 \cdot \color{blue}{\frac{1}{\frac{a}{b}}} \]
      3. un-div-inv95.1%

        \[\leadsto \color{blue}{\frac{-0.6666666666666666}{\frac{a}{b}}} \]
    9. Applied egg-rr95.1%

      \[\leadsto \color{blue}{\frac{-0.6666666666666666}{\frac{a}{b}}} \]

    if -1e153 < b < 6.0000000000000003e-36

    1. Initial program 77.8%

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

    if 6.0000000000000003e-36 < b

    1. Initial program 17.6%

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

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

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

        \[\leadsto \frac{\left(-b\right) + \sqrt{b \cdot b - \color{blue}{3 \cdot \left(a \cdot c\right)}}}{3 \cdot a} \]
    3. Simplified17.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. frac-2neg17.6%

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

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

      \[\leadsto \color{blue}{\left(b - \sqrt{\mathsf{fma}\left(b, b, c \cdot \left(a \cdot -3\right)\right)}\right) \cdot \frac{1}{a \cdot -3}} \]
    7. Step-by-step derivation
      1. un-div-inv17.6%

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

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

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

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

        \[\leadsto \frac{\frac{b - \color{blue}{\mathsf{hypot}\left(b, \sqrt{c \cdot \left(a \cdot -3\right)}\right)}}{a}}{-3} \]
    8. Applied egg-rr23.5%

      \[\leadsto \color{blue}{\frac{\frac{b - \mathsf{hypot}\left(b, \sqrt{c \cdot \left(a \cdot -3\right)}\right)}{a}}{-3}} \]
    9. Step-by-step derivation
      1. clear-num23.5%

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

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

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

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

        \[\leadsto \frac{1}{\color{blue}{\frac{-3}{b - \mathsf{hypot}\left(b, \sqrt{c \cdot \left(a \cdot -3\right)}\right)} \cdot a}} \]
    12. Simplified23.5%

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

      \[\leadsto \frac{1}{\color{blue}{1.5 \cdot \frac{a}{b} + 6 \cdot \frac{b}{c \cdot {\left(\sqrt{-3}\right)}^{2}}}} \]
    14. Step-by-step derivation
      1. fma-define0.0%

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

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

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

        \[\leadsto \frac{1}{\mathsf{fma}\left(1.5, \frac{a}{b}, \frac{6 \cdot b}{\color{blue}{\left(\sqrt{-3} \cdot \sqrt{-3}\right)} \cdot c}\right)} \]
      5. rem-square-sqrt87.9%

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

        \[\leadsto \frac{1}{\mathsf{fma}\left(1.5, \frac{a}{b}, \color{blue}{\frac{6}{-3} \cdot \frac{b}{c}}\right)} \]
      7. metadata-eval88.1%

        \[\leadsto \frac{1}{\mathsf{fma}\left(1.5, \frac{a}{b}, \color{blue}{-2} \cdot \frac{b}{c}\right)} \]
    15. Simplified88.1%

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

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

Alternative 2: 84.6% accurate, 0.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq -2 \cdot 10^{+153}:\\
\;\;\;\;\frac{-0.6666666666666666}{\frac{a}{b}}\\

\mathbf{elif}\;b \leq 1.05 \cdot 10^{-32}:\\
\;\;\;\;\frac{\sqrt{b \cdot b - 3 \cdot \left(a \cdot c\right)} - b}{a \cdot 3}\\

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


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

    1. Initial program 36.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. sqr-neg36.3%

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

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

        \[\leadsto \frac{\left(-b\right) + \sqrt{b \cdot b - \color{blue}{3 \cdot \left(a \cdot c\right)}}}{3 \cdot a} \]
    3. Simplified36.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. Taylor expanded in b around -inf 95.1%

      \[\leadsto \color{blue}{-0.6666666666666666 \cdot \frac{b}{a}} \]
    6. Step-by-step derivation
      1. *-commutative95.1%

        \[\leadsto \color{blue}{\frac{b}{a} \cdot -0.6666666666666666} \]
    7. Simplified95.1%

      \[\leadsto \color{blue}{\frac{b}{a} \cdot -0.6666666666666666} \]
    8. Step-by-step derivation
      1. *-commutative95.1%

        \[\leadsto \color{blue}{-0.6666666666666666 \cdot \frac{b}{a}} \]
      2. clear-num94.9%

        \[\leadsto -0.6666666666666666 \cdot \color{blue}{\frac{1}{\frac{a}{b}}} \]
      3. un-div-inv95.1%

        \[\leadsto \color{blue}{\frac{-0.6666666666666666}{\frac{a}{b}}} \]
    9. Applied egg-rr95.1%

      \[\leadsto \color{blue}{\frac{-0.6666666666666666}{\frac{a}{b}}} \]

    if -2e153 < b < 1.05e-32

    1. Initial program 77.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. sqr-neg77.8%

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

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

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

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

    if 1.05e-32 < b

    1. Initial program 17.6%

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

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

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

        \[\leadsto \frac{\left(-b\right) + \sqrt{b \cdot b - \color{blue}{3 \cdot \left(a \cdot c\right)}}}{3 \cdot a} \]
    3. Simplified17.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. frac-2neg17.6%

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

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

      \[\leadsto \color{blue}{\left(b - \sqrt{\mathsf{fma}\left(b, b, c \cdot \left(a \cdot -3\right)\right)}\right) \cdot \frac{1}{a \cdot -3}} \]
    7. Step-by-step derivation
      1. un-div-inv17.6%

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

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

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

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

        \[\leadsto \frac{\frac{b - \color{blue}{\mathsf{hypot}\left(b, \sqrt{c \cdot \left(a \cdot -3\right)}\right)}}{a}}{-3} \]
    8. Applied egg-rr23.5%

      \[\leadsto \color{blue}{\frac{\frac{b - \mathsf{hypot}\left(b, \sqrt{c \cdot \left(a \cdot -3\right)}\right)}{a}}{-3}} \]
    9. Step-by-step derivation
      1. clear-num23.5%

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

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

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

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

        \[\leadsto \frac{1}{\color{blue}{\frac{-3}{b - \mathsf{hypot}\left(b, \sqrt{c \cdot \left(a \cdot -3\right)}\right)} \cdot a}} \]
    12. Simplified23.5%

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

      \[\leadsto \frac{1}{\color{blue}{1.5 \cdot \frac{a}{b} + 6 \cdot \frac{b}{c \cdot {\left(\sqrt{-3}\right)}^{2}}}} \]
    14. Step-by-step derivation
      1. fma-define0.0%

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

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

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

        \[\leadsto \frac{1}{\mathsf{fma}\left(1.5, \frac{a}{b}, \frac{6 \cdot b}{\color{blue}{\left(\sqrt{-3} \cdot \sqrt{-3}\right)} \cdot c}\right)} \]
      5. rem-square-sqrt87.9%

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

        \[\leadsto \frac{1}{\mathsf{fma}\left(1.5, \frac{a}{b}, \color{blue}{\frac{6}{-3} \cdot \frac{b}{c}}\right)} \]
      7. metadata-eval88.1%

        \[\leadsto \frac{1}{\mathsf{fma}\left(1.5, \frac{a}{b}, \color{blue}{-2} \cdot \frac{b}{c}\right)} \]
    15. Simplified88.1%

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

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

Alternative 3: 79.1% accurate, 0.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq -0.0003:\\
\;\;\;\;b \cdot \left(\frac{c \cdot \left(--0.5\right)}{{b}^{2}} - \frac{0.6666666666666666}{a}\right)\\

\mathbf{elif}\;b \leq 4.2 \cdot 10^{-36}:\\
\;\;\;\;\left(b - \sqrt{c \cdot \left(a \cdot -3\right)}\right) \cdot \frac{1}{a \cdot -3}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if b < -2.99999999999999974e-4

    1. Initial program 56.0%

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

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

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

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

      \[\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. frac-2neg56.0%

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

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

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

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

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

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

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

        \[\leadsto \frac{\frac{b - \color{blue}{\mathsf{hypot}\left(b, \sqrt{c \cdot \left(a \cdot -3\right)}\right)}}{a}}{-3} \]
    8. Applied egg-rr41.8%

      \[\leadsto \color{blue}{\frac{\frac{b - \mathsf{hypot}\left(b, \sqrt{c \cdot \left(a \cdot -3\right)}\right)}{a}}{-3}} \]
    9. Step-by-step derivation
      1. clear-num41.8%

        \[\leadsto \color{blue}{\frac{1}{\frac{-3}{\frac{b - \mathsf{hypot}\left(b, \sqrt{c \cdot \left(a \cdot -3\right)}\right)}{a}}}} \]
      2. inv-pow41.8%

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

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

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

        \[\leadsto \frac{1}{\color{blue}{\frac{-3}{b - \mathsf{hypot}\left(b, \sqrt{c \cdot \left(a \cdot -3\right)}\right)} \cdot a}} \]
    12. Simplified41.8%

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

      \[\leadsto \color{blue}{-1 \cdot \left(b \cdot \left(0.16666666666666666 \cdot \frac{c \cdot {\left(\sqrt{-3}\right)}^{2}}{{b}^{2}} + 0.6666666666666666 \cdot \frac{1}{a}\right)\right)} \]
    14. Step-by-step derivation
      1. mul-1-neg0.0%

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

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

        \[\leadsto b \cdot \left(-\left(\color{blue}{\frac{0.16666666666666666 \cdot \left(c \cdot {\left(\sqrt{-3}\right)}^{2}\right)}{{b}^{2}}} + 0.6666666666666666 \cdot \frac{1}{a}\right)\right) \]
      4. *-commutative0.0%

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

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

        \[\leadsto b \cdot \left(-\left(\frac{\left(c \cdot \color{blue}{-3}\right) \cdot 0.16666666666666666}{{b}^{2}} + 0.6666666666666666 \cdot \frac{1}{a}\right)\right) \]
      7. associate-*l*90.2%

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

        \[\leadsto b \cdot \left(-\left(\frac{c \cdot \color{blue}{-0.5}}{{b}^{2}} + 0.6666666666666666 \cdot \frac{1}{a}\right)\right) \]
      9. associate-*r/90.1%

        \[\leadsto b \cdot \left(-\left(\frac{c \cdot -0.5}{{b}^{2}} + \color{blue}{\frac{0.6666666666666666 \cdot 1}{a}}\right)\right) \]
      10. metadata-eval90.1%

        \[\leadsto b \cdot \left(-\left(\frac{c \cdot -0.5}{{b}^{2}} + \frac{\color{blue}{0.6666666666666666}}{a}\right)\right) \]
    15. Simplified90.1%

      \[\leadsto \color{blue}{b \cdot \left(-\left(\frac{c \cdot -0.5}{{b}^{2}} + \frac{0.6666666666666666}{a}\right)\right)} \]

    if -2.99999999999999974e-4 < b < 4.19999999999999982e-36

    1. Initial program 74.6%

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

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

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

        \[\leadsto \frac{\left(-b\right) + \sqrt{b \cdot b - \color{blue}{3 \cdot \left(a \cdot c\right)}}}{3 \cdot a} \]
    3. Simplified74.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. frac-2neg74.4%

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

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

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

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

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

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

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

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

    if 4.19999999999999982e-36 < b

    1. Initial program 17.6%

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

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

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

        \[\leadsto \frac{\left(-b\right) + \sqrt{b \cdot b - \color{blue}{3 \cdot \left(a \cdot c\right)}}}{3 \cdot a} \]
    3. Simplified17.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. frac-2neg17.6%

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

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

      \[\leadsto \color{blue}{\left(b - \sqrt{\mathsf{fma}\left(b, b, c \cdot \left(a \cdot -3\right)\right)}\right) \cdot \frac{1}{a \cdot -3}} \]
    7. Step-by-step derivation
      1. un-div-inv17.6%

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

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

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

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

        \[\leadsto \frac{\frac{b - \color{blue}{\mathsf{hypot}\left(b, \sqrt{c \cdot \left(a \cdot -3\right)}\right)}}{a}}{-3} \]
    8. Applied egg-rr23.5%

      \[\leadsto \color{blue}{\frac{\frac{b - \mathsf{hypot}\left(b, \sqrt{c \cdot \left(a \cdot -3\right)}\right)}{a}}{-3}} \]
    9. Step-by-step derivation
      1. clear-num23.5%

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

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

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

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

        \[\leadsto \frac{1}{\color{blue}{\frac{-3}{b - \mathsf{hypot}\left(b, \sqrt{c \cdot \left(a \cdot -3\right)}\right)} \cdot a}} \]
    12. Simplified23.5%

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

      \[\leadsto \frac{1}{\color{blue}{1.5 \cdot \frac{a}{b} + 6 \cdot \frac{b}{c \cdot {\left(\sqrt{-3}\right)}^{2}}}} \]
    14. Step-by-step derivation
      1. fma-define0.0%

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

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

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

        \[\leadsto \frac{1}{\mathsf{fma}\left(1.5, \frac{a}{b}, \frac{6 \cdot b}{\color{blue}{\left(\sqrt{-3} \cdot \sqrt{-3}\right)} \cdot c}\right)} \]
      5. rem-square-sqrt87.9%

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

        \[\leadsto \frac{1}{\mathsf{fma}\left(1.5, \frac{a}{b}, \color{blue}{\frac{6}{-3} \cdot \frac{b}{c}}\right)} \]
      7. metadata-eval88.1%

        \[\leadsto \frac{1}{\mathsf{fma}\left(1.5, \frac{a}{b}, \color{blue}{-2} \cdot \frac{b}{c}\right)} \]
    15. Simplified88.1%

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

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

Alternative 4: 79.1% accurate, 0.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq -0.0003:\\
\;\;\;\;b \cdot \left(0.6666666666666666 \cdot \frac{-1}{a} - -0.5 \cdot \frac{c}{{b}^{2}}\right)\\

\mathbf{elif}\;b \leq 7 \cdot 10^{-36}:\\
\;\;\;\;\left(b - \sqrt{c \cdot \left(a \cdot -3\right)}\right) \cdot \frac{1}{a \cdot -3}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if b < -2.99999999999999974e-4

    1. Initial program 56.0%

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

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

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

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

      \[\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 90.2%

      \[\leadsto \color{blue}{-1 \cdot \left(b \cdot \left(-0.5 \cdot \frac{c}{{b}^{2}} + 0.6666666666666666 \cdot \frac{1}{a}\right)\right)} \]

    if -2.99999999999999974e-4 < b < 6.9999999999999999e-36

    1. Initial program 74.6%

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

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

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

        \[\leadsto \frac{\left(-b\right) + \sqrt{b \cdot b - \color{blue}{3 \cdot \left(a \cdot c\right)}}}{3 \cdot a} \]
    3. Simplified74.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. frac-2neg74.4%

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

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

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

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

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

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

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

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

    if 6.9999999999999999e-36 < b

    1. Initial program 17.6%

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

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

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

        \[\leadsto \frac{\left(-b\right) + \sqrt{b \cdot b - \color{blue}{3 \cdot \left(a \cdot c\right)}}}{3 \cdot a} \]
    3. Simplified17.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. frac-2neg17.6%

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

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

      \[\leadsto \color{blue}{\left(b - \sqrt{\mathsf{fma}\left(b, b, c \cdot \left(a \cdot -3\right)\right)}\right) \cdot \frac{1}{a \cdot -3}} \]
    7. Step-by-step derivation
      1. un-div-inv17.6%

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

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

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

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

        \[\leadsto \frac{\frac{b - \color{blue}{\mathsf{hypot}\left(b, \sqrt{c \cdot \left(a \cdot -3\right)}\right)}}{a}}{-3} \]
    8. Applied egg-rr23.5%

      \[\leadsto \color{blue}{\frac{\frac{b - \mathsf{hypot}\left(b, \sqrt{c \cdot \left(a \cdot -3\right)}\right)}{a}}{-3}} \]
    9. Step-by-step derivation
      1. clear-num23.5%

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

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

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

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

        \[\leadsto \frac{1}{\color{blue}{\frac{-3}{b - \mathsf{hypot}\left(b, \sqrt{c \cdot \left(a \cdot -3\right)}\right)} \cdot a}} \]
    12. Simplified23.5%

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

      \[\leadsto \frac{1}{\color{blue}{1.5 \cdot \frac{a}{b} + 6 \cdot \frac{b}{c \cdot {\left(\sqrt{-3}\right)}^{2}}}} \]
    14. Step-by-step derivation
      1. fma-define0.0%

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

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

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

        \[\leadsto \frac{1}{\mathsf{fma}\left(1.5, \frac{a}{b}, \frac{6 \cdot b}{\color{blue}{\left(\sqrt{-3} \cdot \sqrt{-3}\right)} \cdot c}\right)} \]
      5. rem-square-sqrt87.9%

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

        \[\leadsto \frac{1}{\mathsf{fma}\left(1.5, \frac{a}{b}, \color{blue}{\frac{6}{-3} \cdot \frac{b}{c}}\right)} \]
      7. metadata-eval88.1%

        \[\leadsto \frac{1}{\mathsf{fma}\left(1.5, \frac{a}{b}, \color{blue}{-2} \cdot \frac{b}{c}\right)} \]
    15. Simplified88.1%

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

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

Alternative 5: 79.3% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq -0.00038:\\
\;\;\;\;\frac{-0.6666666666666666}{\frac{a}{b}}\\

\mathbf{elif}\;b \leq 2 \cdot 10^{-30}:\\
\;\;\;\;\left(b - \sqrt{c \cdot \left(a \cdot -3\right)}\right) \cdot \frac{-0.3333333333333333}{a}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if b < -3.8000000000000002e-4

    1. Initial program 56.0%

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

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

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

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

      \[\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 89.8%

      \[\leadsto \color{blue}{-0.6666666666666666 \cdot \frac{b}{a}} \]
    6. Step-by-step derivation
      1. *-commutative89.8%

        \[\leadsto \color{blue}{\frac{b}{a} \cdot -0.6666666666666666} \]
    7. Simplified89.8%

      \[\leadsto \color{blue}{\frac{b}{a} \cdot -0.6666666666666666} \]
    8. Step-by-step derivation
      1. *-commutative89.8%

        \[\leadsto \color{blue}{-0.6666666666666666 \cdot \frac{b}{a}} \]
      2. clear-num89.7%

        \[\leadsto -0.6666666666666666 \cdot \color{blue}{\frac{1}{\frac{a}{b}}} \]
      3. un-div-inv89.9%

        \[\leadsto \color{blue}{\frac{-0.6666666666666666}{\frac{a}{b}}} \]
    9. Applied egg-rr89.9%

      \[\leadsto \color{blue}{\frac{-0.6666666666666666}{\frac{a}{b}}} \]

    if -3.8000000000000002e-4 < b < 2e-30

    1. Initial program 74.6%

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

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

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

        \[\leadsto \frac{\left(-b\right) + \sqrt{b \cdot b - \color{blue}{3 \cdot \left(a \cdot c\right)}}}{3 \cdot a} \]
    3. Simplified74.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. frac-2neg74.4%

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

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

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

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

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

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

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

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

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

    if 2e-30 < b

    1. Initial program 17.6%

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

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

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

        \[\leadsto \frac{\left(-b\right) + \sqrt{b \cdot b - \color{blue}{3 \cdot \left(a \cdot c\right)}}}{3 \cdot a} \]
    3. Simplified17.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. frac-2neg17.6%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -0.00038:\\ \;\;\;\;\frac{-0.6666666666666666}{\frac{a}{b}}\\ \mathbf{elif}\;b \leq 2 \cdot 10^{-30}:\\ \;\;\;\;\left(b - \sqrt{c \cdot \left(a \cdot -3\right)}\right) \cdot \frac{-0.3333333333333333}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{c \cdot -0.5}{b}\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 79.0% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq -0.0003:\\
\;\;\;\;\frac{-0.6666666666666666}{\frac{a}{b}}\\

\mathbf{elif}\;b \leq 4.6 \cdot 10^{-36}:\\
\;\;\;\;\left(b - \sqrt{c \cdot \left(a \cdot -3\right)}\right) \cdot \frac{-0.3333333333333333}{a}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if b < -2.99999999999999974e-4

    1. Initial program 56.0%

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

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

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

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

      \[\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 89.8%

      \[\leadsto \color{blue}{-0.6666666666666666 \cdot \frac{b}{a}} \]
    6. Step-by-step derivation
      1. *-commutative89.8%

        \[\leadsto \color{blue}{\frac{b}{a} \cdot -0.6666666666666666} \]
    7. Simplified89.8%

      \[\leadsto \color{blue}{\frac{b}{a} \cdot -0.6666666666666666} \]
    8. Step-by-step derivation
      1. *-commutative89.8%

        \[\leadsto \color{blue}{-0.6666666666666666 \cdot \frac{b}{a}} \]
      2. clear-num89.7%

        \[\leadsto -0.6666666666666666 \cdot \color{blue}{\frac{1}{\frac{a}{b}}} \]
      3. un-div-inv89.9%

        \[\leadsto \color{blue}{\frac{-0.6666666666666666}{\frac{a}{b}}} \]
    9. Applied egg-rr89.9%

      \[\leadsto \color{blue}{\frac{-0.6666666666666666}{\frac{a}{b}}} \]

    if -2.99999999999999974e-4 < b < 4.59999999999999993e-36

    1. Initial program 74.6%

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

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

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

        \[\leadsto \frac{\left(-b\right) + \sqrt{b \cdot b - \color{blue}{3 \cdot \left(a \cdot c\right)}}}{3 \cdot a} \]
    3. Simplified74.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. frac-2neg74.4%

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

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

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

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

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

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

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

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

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

    if 4.59999999999999993e-36 < b

    1. Initial program 17.6%

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

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

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

        \[\leadsto \frac{\left(-b\right) + \sqrt{b \cdot b - \color{blue}{3 \cdot \left(a \cdot c\right)}}}{3 \cdot a} \]
    3. Simplified17.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. frac-2neg17.6%

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

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

      \[\leadsto \color{blue}{\left(b - \sqrt{\mathsf{fma}\left(b, b, c \cdot \left(a \cdot -3\right)\right)}\right) \cdot \frac{1}{a \cdot -3}} \]
    7. Step-by-step derivation
      1. un-div-inv17.6%

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

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

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

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

        \[\leadsto \frac{\frac{b - \color{blue}{\mathsf{hypot}\left(b, \sqrt{c \cdot \left(a \cdot -3\right)}\right)}}{a}}{-3} \]
    8. Applied egg-rr23.5%

      \[\leadsto \color{blue}{\frac{\frac{b - \mathsf{hypot}\left(b, \sqrt{c \cdot \left(a \cdot -3\right)}\right)}{a}}{-3}} \]
    9. Step-by-step derivation
      1. clear-num23.5%

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

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

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

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

        \[\leadsto \frac{1}{\color{blue}{\frac{-3}{b - \mathsf{hypot}\left(b, \sqrt{c \cdot \left(a \cdot -3\right)}\right)} \cdot a}} \]
    12. Simplified23.5%

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

      \[\leadsto \frac{1}{\color{blue}{1.5 \cdot \frac{a}{b} + 6 \cdot \frac{b}{c \cdot {\left(\sqrt{-3}\right)}^{2}}}} \]
    14. Step-by-step derivation
      1. fma-define0.0%

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

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

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

        \[\leadsto \frac{1}{\mathsf{fma}\left(1.5, \frac{a}{b}, \frac{6 \cdot b}{\color{blue}{\left(\sqrt{-3} \cdot \sqrt{-3}\right)} \cdot c}\right)} \]
      5. rem-square-sqrt87.9%

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

        \[\leadsto \frac{1}{\mathsf{fma}\left(1.5, \frac{a}{b}, \color{blue}{\frac{6}{-3} \cdot \frac{b}{c}}\right)} \]
      7. metadata-eval88.1%

        \[\leadsto \frac{1}{\mathsf{fma}\left(1.5, \frac{a}{b}, \color{blue}{-2} \cdot \frac{b}{c}\right)} \]
    15. Simplified88.1%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -0.0003:\\ \;\;\;\;\frac{-0.6666666666666666}{\frac{a}{b}}\\ \mathbf{elif}\;b \leq 4.6 \cdot 10^{-36}:\\ \;\;\;\;\left(b - \sqrt{c \cdot \left(a \cdot -3\right)}\right) \cdot \frac{-0.3333333333333333}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\mathsf{fma}\left(1.5, \frac{a}{b}, -2 \cdot \frac{b}{c}\right)}\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 79.1% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq -0.0003:\\
\;\;\;\;\frac{-0.6666666666666666}{\frac{a}{b}}\\

\mathbf{elif}\;b \leq 8 \cdot 10^{-36}:\\
\;\;\;\;\frac{b - \sqrt{c \cdot \left(a \cdot -3\right)}}{a \cdot -3}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if b < -2.99999999999999974e-4

    1. Initial program 56.0%

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

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

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

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

      \[\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 89.8%

      \[\leadsto \color{blue}{-0.6666666666666666 \cdot \frac{b}{a}} \]
    6. Step-by-step derivation
      1. *-commutative89.8%

        \[\leadsto \color{blue}{\frac{b}{a} \cdot -0.6666666666666666} \]
    7. Simplified89.8%

      \[\leadsto \color{blue}{\frac{b}{a} \cdot -0.6666666666666666} \]
    8. Step-by-step derivation
      1. *-commutative89.8%

        \[\leadsto \color{blue}{-0.6666666666666666 \cdot \frac{b}{a}} \]
      2. clear-num89.7%

        \[\leadsto -0.6666666666666666 \cdot \color{blue}{\frac{1}{\frac{a}{b}}} \]
      3. un-div-inv89.9%

        \[\leadsto \color{blue}{\frac{-0.6666666666666666}{\frac{a}{b}}} \]
    9. Applied egg-rr89.9%

      \[\leadsto \color{blue}{\frac{-0.6666666666666666}{\frac{a}{b}}} \]

    if -2.99999999999999974e-4 < b < 7.9999999999999995e-36

    1. Initial program 74.6%

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

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

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

        \[\leadsto \frac{\left(-b\right) + \sqrt{b \cdot b - \color{blue}{3 \cdot \left(a \cdot c\right)}}}{3 \cdot a} \]
    3. Simplified74.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. frac-2neg74.4%

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

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

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

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

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

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

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

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

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

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

    if 7.9999999999999995e-36 < b

    1. Initial program 17.6%

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

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

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

        \[\leadsto \frac{\left(-b\right) + \sqrt{b \cdot b - \color{blue}{3 \cdot \left(a \cdot c\right)}}}{3 \cdot a} \]
    3. Simplified17.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. frac-2neg17.6%

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

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

      \[\leadsto \color{blue}{\left(b - \sqrt{\mathsf{fma}\left(b, b, c \cdot \left(a \cdot -3\right)\right)}\right) \cdot \frac{1}{a \cdot -3}} \]
    7. Step-by-step derivation
      1. un-div-inv17.6%

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

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

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

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

        \[\leadsto \frac{\frac{b - \color{blue}{\mathsf{hypot}\left(b, \sqrt{c \cdot \left(a \cdot -3\right)}\right)}}{a}}{-3} \]
    8. Applied egg-rr23.5%

      \[\leadsto \color{blue}{\frac{\frac{b - \mathsf{hypot}\left(b, \sqrt{c \cdot \left(a \cdot -3\right)}\right)}{a}}{-3}} \]
    9. Step-by-step derivation
      1. clear-num23.5%

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

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

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

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

        \[\leadsto \frac{1}{\color{blue}{\frac{-3}{b - \mathsf{hypot}\left(b, \sqrt{c \cdot \left(a \cdot -3\right)}\right)} \cdot a}} \]
    12. Simplified23.5%

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

      \[\leadsto \frac{1}{\color{blue}{1.5 \cdot \frac{a}{b} + 6 \cdot \frac{b}{c \cdot {\left(\sqrt{-3}\right)}^{2}}}} \]
    14. Step-by-step derivation
      1. fma-define0.0%

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

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

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

        \[\leadsto \frac{1}{\mathsf{fma}\left(1.5, \frac{a}{b}, \frac{6 \cdot b}{\color{blue}{\left(\sqrt{-3} \cdot \sqrt{-3}\right)} \cdot c}\right)} \]
      5. rem-square-sqrt87.9%

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

        \[\leadsto \frac{1}{\mathsf{fma}\left(1.5, \frac{a}{b}, \color{blue}{\frac{6}{-3} \cdot \frac{b}{c}}\right)} \]
      7. metadata-eval88.1%

        \[\leadsto \frac{1}{\mathsf{fma}\left(1.5, \frac{a}{b}, \color{blue}{-2} \cdot \frac{b}{c}\right)} \]
    15. Simplified88.1%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -0.0003:\\ \;\;\;\;\frac{-0.6666666666666666}{\frac{a}{b}}\\ \mathbf{elif}\;b \leq 8 \cdot 10^{-36}:\\ \;\;\;\;\frac{b - \sqrt{c \cdot \left(a \cdot -3\right)}}{a \cdot -3}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\mathsf{fma}\left(1.5, \frac{a}{b}, -2 \cdot \frac{b}{c}\right)}\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 79.2% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq -0.0003:\\
\;\;\;\;b \cdot \left(\frac{c \cdot \left(--0.5\right)}{{b}^{2}} - \frac{0.6666666666666666}{a}\right)\\

\mathbf{elif}\;b \leq 1.55 \cdot 10^{-35}:\\
\;\;\;\;\frac{b - \sqrt{c \cdot \left(a \cdot -3\right)}}{a \cdot -3}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if b < -2.99999999999999974e-4

    1. Initial program 56.0%

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

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

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

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

      \[\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. frac-2neg56.0%

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

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

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

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

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

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

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

        \[\leadsto \frac{\frac{b - \color{blue}{\mathsf{hypot}\left(b, \sqrt{c \cdot \left(a \cdot -3\right)}\right)}}{a}}{-3} \]
    8. Applied egg-rr41.8%

      \[\leadsto \color{blue}{\frac{\frac{b - \mathsf{hypot}\left(b, \sqrt{c \cdot \left(a \cdot -3\right)}\right)}{a}}{-3}} \]
    9. Step-by-step derivation
      1. clear-num41.8%

        \[\leadsto \color{blue}{\frac{1}{\frac{-3}{\frac{b - \mathsf{hypot}\left(b, \sqrt{c \cdot \left(a \cdot -3\right)}\right)}{a}}}} \]
      2. inv-pow41.8%

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

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

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

        \[\leadsto \frac{1}{\color{blue}{\frac{-3}{b - \mathsf{hypot}\left(b, \sqrt{c \cdot \left(a \cdot -3\right)}\right)} \cdot a}} \]
    12. Simplified41.8%

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

      \[\leadsto \color{blue}{-1 \cdot \left(b \cdot \left(0.16666666666666666 \cdot \frac{c \cdot {\left(\sqrt{-3}\right)}^{2}}{{b}^{2}} + 0.6666666666666666 \cdot \frac{1}{a}\right)\right)} \]
    14. Step-by-step derivation
      1. mul-1-neg0.0%

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

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

        \[\leadsto b \cdot \left(-\left(\color{blue}{\frac{0.16666666666666666 \cdot \left(c \cdot {\left(\sqrt{-3}\right)}^{2}\right)}{{b}^{2}}} + 0.6666666666666666 \cdot \frac{1}{a}\right)\right) \]
      4. *-commutative0.0%

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

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

        \[\leadsto b \cdot \left(-\left(\frac{\left(c \cdot \color{blue}{-3}\right) \cdot 0.16666666666666666}{{b}^{2}} + 0.6666666666666666 \cdot \frac{1}{a}\right)\right) \]
      7. associate-*l*90.2%

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

        \[\leadsto b \cdot \left(-\left(\frac{c \cdot \color{blue}{-0.5}}{{b}^{2}} + 0.6666666666666666 \cdot \frac{1}{a}\right)\right) \]
      9. associate-*r/90.1%

        \[\leadsto b \cdot \left(-\left(\frac{c \cdot -0.5}{{b}^{2}} + \color{blue}{\frac{0.6666666666666666 \cdot 1}{a}}\right)\right) \]
      10. metadata-eval90.1%

        \[\leadsto b \cdot \left(-\left(\frac{c \cdot -0.5}{{b}^{2}} + \frac{\color{blue}{0.6666666666666666}}{a}\right)\right) \]
    15. Simplified90.1%

      \[\leadsto \color{blue}{b \cdot \left(-\left(\frac{c \cdot -0.5}{{b}^{2}} + \frac{0.6666666666666666}{a}\right)\right)} \]

    if -2.99999999999999974e-4 < b < 1.55000000000000006e-35

    1. Initial program 74.6%

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

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

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

        \[\leadsto \frac{\left(-b\right) + \sqrt{b \cdot b - \color{blue}{3 \cdot \left(a \cdot c\right)}}}{3 \cdot a} \]
    3. Simplified74.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. frac-2neg74.4%

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

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

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

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

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

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

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

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

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

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

    if 1.55000000000000006e-35 < b

    1. Initial program 17.6%

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

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

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

        \[\leadsto \frac{\left(-b\right) + \sqrt{b \cdot b - \color{blue}{3 \cdot \left(a \cdot c\right)}}}{3 \cdot a} \]
    3. Simplified17.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. frac-2neg17.6%

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

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

      \[\leadsto \color{blue}{\left(b - \sqrt{\mathsf{fma}\left(b, b, c \cdot \left(a \cdot -3\right)\right)}\right) \cdot \frac{1}{a \cdot -3}} \]
    7. Step-by-step derivation
      1. un-div-inv17.6%

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

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

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

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

        \[\leadsto \frac{\frac{b - \color{blue}{\mathsf{hypot}\left(b, \sqrt{c \cdot \left(a \cdot -3\right)}\right)}}{a}}{-3} \]
    8. Applied egg-rr23.5%

      \[\leadsto \color{blue}{\frac{\frac{b - \mathsf{hypot}\left(b, \sqrt{c \cdot \left(a \cdot -3\right)}\right)}{a}}{-3}} \]
    9. Step-by-step derivation
      1. clear-num23.5%

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

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

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

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

        \[\leadsto \frac{1}{\color{blue}{\frac{-3}{b - \mathsf{hypot}\left(b, \sqrt{c \cdot \left(a \cdot -3\right)}\right)} \cdot a}} \]
    12. Simplified23.5%

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

      \[\leadsto \frac{1}{\color{blue}{1.5 \cdot \frac{a}{b} + 6 \cdot \frac{b}{c \cdot {\left(\sqrt{-3}\right)}^{2}}}} \]
    14. Step-by-step derivation
      1. fma-define0.0%

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

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

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

        \[\leadsto \frac{1}{\mathsf{fma}\left(1.5, \frac{a}{b}, \frac{6 \cdot b}{\color{blue}{\left(\sqrt{-3} \cdot \sqrt{-3}\right)} \cdot c}\right)} \]
      5. rem-square-sqrt87.9%

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

        \[\leadsto \frac{1}{\mathsf{fma}\left(1.5, \frac{a}{b}, \color{blue}{\frac{6}{-3} \cdot \frac{b}{c}}\right)} \]
      7. metadata-eval88.1%

        \[\leadsto \frac{1}{\mathsf{fma}\left(1.5, \frac{a}{b}, \color{blue}{-2} \cdot \frac{b}{c}\right)} \]
    15. Simplified88.1%

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

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

Alternative 9: 78.7% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq -0.0003:\\
\;\;\;\;\frac{-0.6666666666666666}{\frac{a}{b}}\\

\mathbf{elif}\;b \leq 5.6 \cdot 10^{-35}:\\
\;\;\;\;0.3333333333333333 \cdot \frac{\sqrt{a \cdot \left(c \cdot -3\right)}}{a}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if b < -2.99999999999999974e-4

    1. Initial program 56.0%

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

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

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

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

      \[\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 89.8%

      \[\leadsto \color{blue}{-0.6666666666666666 \cdot \frac{b}{a}} \]
    6. Step-by-step derivation
      1. *-commutative89.8%

        \[\leadsto \color{blue}{\frac{b}{a} \cdot -0.6666666666666666} \]
    7. Simplified89.8%

      \[\leadsto \color{blue}{\frac{b}{a} \cdot -0.6666666666666666} \]
    8. Step-by-step derivation
      1. *-commutative89.8%

        \[\leadsto \color{blue}{-0.6666666666666666 \cdot \frac{b}{a}} \]
      2. clear-num89.7%

        \[\leadsto -0.6666666666666666 \cdot \color{blue}{\frac{1}{\frac{a}{b}}} \]
      3. un-div-inv89.9%

        \[\leadsto \color{blue}{\frac{-0.6666666666666666}{\frac{a}{b}}} \]
    9. Applied egg-rr89.9%

      \[\leadsto \color{blue}{\frac{-0.6666666666666666}{\frac{a}{b}}} \]

    if -2.99999999999999974e-4 < b < 5.5999999999999999e-35

    1. Initial program 74.6%

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

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

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

        \[\leadsto \frac{\left(-b\right) + \sqrt{b \cdot b - \color{blue}{3 \cdot \left(a \cdot c\right)}}}{3 \cdot a} \]
    3. Simplified74.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. prod-diff74.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto 0.3333333333333333 \cdot \left(\frac{1}{a} \cdot \sqrt{\left(-6 \cdot a\right) \cdot c + \color{blue}{\left(3 \cdot a\right) \cdot c}}\right) \]
      3. distribute-rgt-in64.0%

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

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

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

    if 5.5999999999999999e-35 < b

    1. Initial program 17.6%

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

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

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

        \[\leadsto \frac{\left(-b\right) + \sqrt{b \cdot b - \color{blue}{3 \cdot \left(a \cdot c\right)}}}{3 \cdot a} \]
    3. Simplified17.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. frac-2neg17.6%

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

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

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

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

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

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

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

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

Alternative 10: 78.7% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq -0.00034:\\
\;\;\;\;\frac{-0.6666666666666666}{\frac{a}{b}}\\

\mathbf{elif}\;b \leq 5.6 \cdot 10^{-36}:\\
\;\;\;\;0.3333333333333333 \cdot \frac{\sqrt{c \cdot \left(a \cdot -3\right)}}{a}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if b < -3.4e-4

    1. Initial program 56.0%

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

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

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

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

      \[\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 89.8%

      \[\leadsto \color{blue}{-0.6666666666666666 \cdot \frac{b}{a}} \]
    6. Step-by-step derivation
      1. *-commutative89.8%

        \[\leadsto \color{blue}{\frac{b}{a} \cdot -0.6666666666666666} \]
    7. Simplified89.8%

      \[\leadsto \color{blue}{\frac{b}{a} \cdot -0.6666666666666666} \]
    8. Step-by-step derivation
      1. *-commutative89.8%

        \[\leadsto \color{blue}{-0.6666666666666666 \cdot \frac{b}{a}} \]
      2. clear-num89.7%

        \[\leadsto -0.6666666666666666 \cdot \color{blue}{\frac{1}{\frac{a}{b}}} \]
      3. un-div-inv89.9%

        \[\leadsto \color{blue}{\frac{-0.6666666666666666}{\frac{a}{b}}} \]
    9. Applied egg-rr89.9%

      \[\leadsto \color{blue}{\frac{-0.6666666666666666}{\frac{a}{b}}} \]

    if -3.4e-4 < b < 5.6000000000000002e-36

    1. Initial program 74.6%

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

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

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

        \[\leadsto \frac{\left(-b\right) + \sqrt{b \cdot b - \color{blue}{3 \cdot \left(a \cdot c\right)}}}{3 \cdot a} \]
    3. Simplified74.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. prod-diff74.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto 0.3333333333333333 \cdot \left(\frac{1}{a} \cdot \sqrt{\left(-6 \cdot a\right) \cdot c + \color{blue}{\left(3 \cdot a\right) \cdot c}}\right) \]
      3. distribute-rgt-in64.0%

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

        \[\leadsto 0.3333333333333333 \cdot \color{blue}{\frac{1 \cdot \sqrt{c \cdot \left(-6 \cdot a + 3 \cdot a\right)}}{a}} \]
      5. distribute-rgt-in63.7%

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

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

        \[\leadsto 0.3333333333333333 \cdot \frac{1 \cdot \sqrt{-6 \cdot \left(a \cdot c\right) + \color{blue}{3 \cdot \left(a \cdot c\right)}}}{a} \]
      8. distribute-rgt-out64.0%

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

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

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

        \[\leadsto 0.3333333333333333 \cdot \frac{1 \cdot \sqrt{\color{blue}{c \cdot \left(a \cdot -3\right)}}}{a} \]
      12. *-lft-identity64.1%

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

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

    if 5.6000000000000002e-36 < b

    1. Initial program 17.6%

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

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

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

        \[\leadsto \frac{\left(-b\right) + \sqrt{b \cdot b - \color{blue}{3 \cdot \left(a \cdot c\right)}}}{3 \cdot a} \]
    3. Simplified17.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. frac-2neg17.6%

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

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

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

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

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

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

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

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

Alternative 11: 78.7% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq -0.00038:\\
\;\;\;\;\frac{-0.6666666666666666}{\frac{a}{b}}\\

\mathbf{elif}\;b \leq 5.3 \cdot 10^{-36}:\\
\;\;\;\;\frac{0.3333333333333333}{a} \cdot \sqrt{a \cdot \left(c \cdot -3\right)}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if b < -3.8000000000000002e-4

    1. Initial program 56.0%

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

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

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

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

      \[\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 89.8%

      \[\leadsto \color{blue}{-0.6666666666666666 \cdot \frac{b}{a}} \]
    6. Step-by-step derivation
      1. *-commutative89.8%

        \[\leadsto \color{blue}{\frac{b}{a} \cdot -0.6666666666666666} \]
    7. Simplified89.8%

      \[\leadsto \color{blue}{\frac{b}{a} \cdot -0.6666666666666666} \]
    8. Step-by-step derivation
      1. *-commutative89.8%

        \[\leadsto \color{blue}{-0.6666666666666666 \cdot \frac{b}{a}} \]
      2. clear-num89.7%

        \[\leadsto -0.6666666666666666 \cdot \color{blue}{\frac{1}{\frac{a}{b}}} \]
      3. un-div-inv89.9%

        \[\leadsto \color{blue}{\frac{-0.6666666666666666}{\frac{a}{b}}} \]
    9. Applied egg-rr89.9%

      \[\leadsto \color{blue}{\frac{-0.6666666666666666}{\frac{a}{b}}} \]

    if -3.8000000000000002e-4 < b < 5.2999999999999998e-36

    1. Initial program 74.6%

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

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

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

        \[\leadsto \frac{\left(-b\right) + \sqrt{b \cdot b - \color{blue}{3 \cdot \left(a \cdot c\right)}}}{3 \cdot a} \]
    3. Simplified74.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. prod-diff74.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 5.2999999999999998e-36 < b

    1. Initial program 17.6%

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

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

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

        \[\leadsto \frac{\left(-b\right) + \sqrt{b \cdot b - \color{blue}{3 \cdot \left(a \cdot c\right)}}}{3 \cdot a} \]
    3. Simplified17.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. frac-2neg17.6%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -0.00038:\\ \;\;\;\;\frac{-0.6666666666666666}{\frac{a}{b}}\\ \mathbf{elif}\;b \leq 5.3 \cdot 10^{-36}:\\ \;\;\;\;\frac{0.3333333333333333}{a} \cdot \sqrt{a \cdot \left(c \cdot -3\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{c \cdot -0.5}{b}\\ \end{array} \]
  5. Add Preprocessing

Alternative 12: 70.2% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq -4.7 \cdot 10^{-54}:\\
\;\;\;\;\frac{\frac{b \cdot 2}{a}}{-3}\\

\mathbf{elif}\;b \leq 1.8 \cdot 10^{-184}:\\
\;\;\;\;\sqrt{\left(c \cdot \frac{-3}{a}\right) \cdot 0.1111111111111111}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if b < -4.7e-54

    1. Initial program 59.9%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\left(b - \sqrt{\mathsf{fma}\left(b, b, c \cdot \left(a \cdot -3\right)\right)}\right) \cdot \frac{1}{a \cdot -3}} \]
    7. Step-by-step derivation
      1. un-div-inv59.9%

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

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

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

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

        \[\leadsto \frac{\frac{b - \color{blue}{\mathsf{hypot}\left(b, \sqrt{c \cdot \left(a \cdot -3\right)}\right)}}{a}}{-3} \]
    8. Applied egg-rr46.9%

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

      \[\leadsto \frac{\frac{\color{blue}{2 \cdot b}}{a}}{-3} \]
    10. Step-by-step derivation
      1. *-commutative86.1%

        \[\leadsto \frac{\frac{\color{blue}{b \cdot 2}}{a}}{-3} \]
    11. Simplified86.1%

      \[\leadsto \frac{\frac{\color{blue}{b \cdot 2}}{a}}{-3} \]

    if -4.7e-54 < b < 1.8000000000000001e-184

    1. Initial program 80.6%

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

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

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

        \[\leadsto \frac{\left(-b\right) + \sqrt{b \cdot b - \color{blue}{3 \cdot \left(a \cdot c\right)}}}{3 \cdot a} \]
    3. Simplified80.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. prod-diff80.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\left(-b\right) + \sqrt{\mathsf{fma}\left(b, b, c \cdot \left(a \cdot -3\right)\right) + \left(c \cdot \left(a \cdot -3\right) + \color{blue}{a \cdot \left(3 \cdot c\right)}\right)}}{3 \cdot a} \]
    6. Applied egg-rr80.4%

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

      \[\leadsto \color{blue}{0.3333333333333333 \cdot \sqrt{\frac{-6 \cdot c + 3 \cdot c}{a}}} \]
    8. Step-by-step derivation
      1. *-commutative30.9%

        \[\leadsto \color{blue}{\sqrt{\frac{-6 \cdot c + 3 \cdot c}{a}} \cdot 0.3333333333333333} \]
      2. distribute-rgt-out30.9%

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

        \[\leadsto \sqrt{\frac{c \cdot \color{blue}{-3}}{a}} \cdot 0.3333333333333333 \]
    9. Simplified30.9%

      \[\leadsto \color{blue}{\sqrt{\frac{c \cdot -3}{a}} \cdot 0.3333333333333333} \]
    10. Step-by-step derivation
      1. add-sqr-sqrt30.8%

        \[\leadsto \color{blue}{\sqrt{\sqrt{\frac{c \cdot -3}{a}} \cdot 0.3333333333333333} \cdot \sqrt{\sqrt{\frac{c \cdot -3}{a}} \cdot 0.3333333333333333}} \]
      2. sqrt-unprod30.9%

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

        \[\leadsto \sqrt{\color{blue}{{\left(\sqrt{\frac{c \cdot -3}{a}} \cdot 0.3333333333333333\right)}^{2}}} \]
      4. associate-/l*31.0%

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

      \[\leadsto \color{blue}{\sqrt{{\left(\sqrt{c \cdot \frac{-3}{a}} \cdot 0.3333333333333333\right)}^{2}}} \]
    12. Step-by-step derivation
      1. unpow231.0%

        \[\leadsto \sqrt{\color{blue}{\left(\sqrt{c \cdot \frac{-3}{a}} \cdot 0.3333333333333333\right) \cdot \left(\sqrt{c \cdot \frac{-3}{a}} \cdot 0.3333333333333333\right)}} \]
      2. swap-sqr30.9%

        \[\leadsto \sqrt{\color{blue}{\left(\sqrt{c \cdot \frac{-3}{a}} \cdot \sqrt{c \cdot \frac{-3}{a}}\right) \cdot \left(0.3333333333333333 \cdot 0.3333333333333333\right)}} \]
      3. rem-square-sqrt30.9%

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

        \[\leadsto \sqrt{\left(c \cdot \frac{-3}{a}\right) \cdot \color{blue}{0.1111111111111111}} \]
    13. Simplified30.9%

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

    if 1.8000000000000001e-184 < b

    1. Initial program 27.0%

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -4.7 \cdot 10^{-54}:\\ \;\;\;\;\frac{\frac{b \cdot 2}{a}}{-3}\\ \mathbf{elif}\;b \leq 1.8 \cdot 10^{-184}:\\ \;\;\;\;\sqrt{\left(c \cdot \frac{-3}{a}\right) \cdot 0.1111111111111111}\\ \mathbf{else}:\\ \;\;\;\;\frac{c \cdot -0.5}{b}\\ \end{array} \]
  5. Add Preprocessing

Alternative 13: 70.2% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq -4.7 \cdot 10^{-54}:\\
\;\;\;\;\frac{\frac{b \cdot 2}{a}}{-3}\\

\mathbf{elif}\;b \leq 5.6 \cdot 10^{-182}:\\
\;\;\;\;0.3333333333333333 \cdot \sqrt{-3 \cdot \frac{c}{a}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if b < -4.7e-54

    1. Initial program 59.9%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\left(b - \sqrt{\mathsf{fma}\left(b, b, c \cdot \left(a \cdot -3\right)\right)}\right) \cdot \frac{1}{a \cdot -3}} \]
    7. Step-by-step derivation
      1. un-div-inv59.9%

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

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

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

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

        \[\leadsto \frac{\frac{b - \color{blue}{\mathsf{hypot}\left(b, \sqrt{c \cdot \left(a \cdot -3\right)}\right)}}{a}}{-3} \]
    8. Applied egg-rr46.9%

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

      \[\leadsto \frac{\frac{\color{blue}{2 \cdot b}}{a}}{-3} \]
    10. Step-by-step derivation
      1. *-commutative86.1%

        \[\leadsto \frac{\frac{\color{blue}{b \cdot 2}}{a}}{-3} \]
    11. Simplified86.1%

      \[\leadsto \frac{\frac{\color{blue}{b \cdot 2}}{a}}{-3} \]

    if -4.7e-54 < b < 5.59999999999999986e-182

    1. Initial program 80.6%

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

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

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

        \[\leadsto \frac{\left(-b\right) + \sqrt{b \cdot b - \color{blue}{3 \cdot \left(a \cdot c\right)}}}{3 \cdot a} \]
    3. Simplified80.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. prod-diff80.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\left(-b\right) + \sqrt{\mathsf{fma}\left(b, b, c \cdot \left(a \cdot -3\right)\right) + \left(c \cdot \left(a \cdot -3\right) + \color{blue}{a \cdot \left(3 \cdot c\right)}\right)}}{3 \cdot a} \]
    6. Applied egg-rr80.4%

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

      \[\leadsto \color{blue}{0.3333333333333333 \cdot \sqrt{\frac{-6 \cdot c + 3 \cdot c}{a}}} \]
    8. Step-by-step derivation
      1. *-commutative30.9%

        \[\leadsto \color{blue}{\sqrt{\frac{-6 \cdot c + 3 \cdot c}{a}} \cdot 0.3333333333333333} \]
      2. distribute-rgt-out30.9%

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

        \[\leadsto \sqrt{\frac{c \cdot \color{blue}{-3}}{a}} \cdot 0.3333333333333333 \]
    9. Simplified30.9%

      \[\leadsto \color{blue}{\sqrt{\frac{c \cdot -3}{a}} \cdot 0.3333333333333333} \]
    10. Taylor expanded in c around 0 30.9%

      \[\leadsto \sqrt{\color{blue}{-3 \cdot \frac{c}{a}}} \cdot 0.3333333333333333 \]

    if 5.59999999999999986e-182 < b

    1. Initial program 27.0%

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -4.7 \cdot 10^{-54}:\\ \;\;\;\;\frac{\frac{b \cdot 2}{a}}{-3}\\ \mathbf{elif}\;b \leq 5.6 \cdot 10^{-182}:\\ \;\;\;\;0.3333333333333333 \cdot \sqrt{-3 \cdot \frac{c}{a}}\\ \mathbf{else}:\\ \;\;\;\;\frac{c \cdot -0.5}{b}\\ \end{array} \]
  5. Add Preprocessing

Alternative 14: 70.2% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq -4.7 \cdot 10^{-54}:\\
\;\;\;\;\frac{\frac{b \cdot 2}{a}}{-3}\\

\mathbf{elif}\;b \leq 1.82 \cdot 10^{-184}:\\
\;\;\;\;0.3333333333333333 \cdot \sqrt{\frac{c \cdot -3}{a}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if b < -4.7e-54

    1. Initial program 59.9%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\left(b - \sqrt{\mathsf{fma}\left(b, b, c \cdot \left(a \cdot -3\right)\right)}\right) \cdot \frac{1}{a \cdot -3}} \]
    7. Step-by-step derivation
      1. un-div-inv59.9%

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

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

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

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

        \[\leadsto \frac{\frac{b - \color{blue}{\mathsf{hypot}\left(b, \sqrt{c \cdot \left(a \cdot -3\right)}\right)}}{a}}{-3} \]
    8. Applied egg-rr46.9%

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

      \[\leadsto \frac{\frac{\color{blue}{2 \cdot b}}{a}}{-3} \]
    10. Step-by-step derivation
      1. *-commutative86.1%

        \[\leadsto \frac{\frac{\color{blue}{b \cdot 2}}{a}}{-3} \]
    11. Simplified86.1%

      \[\leadsto \frac{\frac{\color{blue}{b \cdot 2}}{a}}{-3} \]

    if -4.7e-54 < b < 1.82000000000000006e-184

    1. Initial program 80.6%

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

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

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

        \[\leadsto \frac{\left(-b\right) + \sqrt{b \cdot b - \color{blue}{3 \cdot \left(a \cdot c\right)}}}{3 \cdot a} \]
    3. Simplified80.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. prod-diff80.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\left(-b\right) + \sqrt{\mathsf{fma}\left(b, b, c \cdot \left(a \cdot -3\right)\right) + \left(c \cdot \left(a \cdot -3\right) + \color{blue}{a \cdot \left(3 \cdot c\right)}\right)}}{3 \cdot a} \]
    6. Applied egg-rr80.4%

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

      \[\leadsto \color{blue}{0.3333333333333333 \cdot \sqrt{\frac{-6 \cdot c + 3 \cdot c}{a}}} \]
    8. Step-by-step derivation
      1. *-commutative30.9%

        \[\leadsto \color{blue}{\sqrt{\frac{-6 \cdot c + 3 \cdot c}{a}} \cdot 0.3333333333333333} \]
      2. distribute-rgt-out30.9%

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

        \[\leadsto \sqrt{\frac{c \cdot \color{blue}{-3}}{a}} \cdot 0.3333333333333333 \]
    9. Simplified30.9%

      \[\leadsto \color{blue}{\sqrt{\frac{c \cdot -3}{a}} \cdot 0.3333333333333333} \]

    if 1.82000000000000006e-184 < b

    1. Initial program 27.0%

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -4.7 \cdot 10^{-54}:\\ \;\;\;\;\frac{\frac{b \cdot 2}{a}}{-3}\\ \mathbf{elif}\;b \leq 1.82 \cdot 10^{-184}:\\ \;\;\;\;0.3333333333333333 \cdot \sqrt{\frac{c \cdot -3}{a}}\\ \mathbf{else}:\\ \;\;\;\;\frac{c \cdot -0.5}{b}\\ \end{array} \]
  5. Add Preprocessing

Alternative 15: 67.3% accurate, 9.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq -4 \cdot 10^{-310}:\\
\;\;\;\;\frac{\frac{b \cdot 2}{a}}{-3}\\

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


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

    1. Initial program 68.4%

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

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

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

        \[\leadsto \frac{\left(-b\right) + \sqrt{b \cdot b - \color{blue}{3 \cdot \left(a \cdot c\right)}}}{3 \cdot a} \]
    3. Simplified68.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. frac-2neg68.3%

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

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

      \[\leadsto \color{blue}{\left(b - \sqrt{\mathsf{fma}\left(b, b, c \cdot \left(a \cdot -3\right)\right)}\right) \cdot \frac{1}{a \cdot -3}} \]
    7. Step-by-step derivation
      1. un-div-inv68.4%

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

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

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

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

        \[\leadsto \frac{\frac{b - \color{blue}{\mathsf{hypot}\left(b, \sqrt{c \cdot \left(a \cdot -3\right)}\right)}}{a}}{-3} \]
    8. Applied egg-rr59.2%

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

      \[\leadsto \frac{\frac{\color{blue}{2 \cdot b}}{a}}{-3} \]
    10. Step-by-step derivation
      1. *-commutative61.5%

        \[\leadsto \frac{\frac{\color{blue}{b \cdot 2}}{a}}{-3} \]
    11. Simplified61.5%

      \[\leadsto \frac{\frac{\color{blue}{b \cdot 2}}{a}}{-3} \]

    if -3.999999999999988e-310 < b

    1. Initial program 31.5%

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

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

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

        \[\leadsto \frac{\left(-b\right) + \sqrt{b \cdot b - \color{blue}{3 \cdot \left(a \cdot c\right)}}}{3 \cdot a} \]
    3. Simplified31.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. frac-2neg31.4%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -4 \cdot 10^{-310}:\\ \;\;\;\;\frac{\frac{b \cdot 2}{a}}{-3}\\ \mathbf{else}:\\ \;\;\;\;\frac{c \cdot -0.5}{b}\\ \end{array} \]
  5. Add Preprocessing

Alternative 16: 67.1% accurate, 11.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq -4 \cdot 10^{-310}:\\
\;\;\;\;b \cdot \frac{-0.6666666666666666}{a}\\

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


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

    1. Initial program 68.4%

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

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

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

        \[\leadsto \frac{\left(-b\right) + \sqrt{b \cdot b - \color{blue}{3 \cdot \left(a \cdot c\right)}}}{3 \cdot a} \]
    3. Simplified68.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. frac-2neg68.3%

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

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

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

      \[\leadsto \color{blue}{-0.6666666666666666 \cdot \frac{b}{a}} \]
    8. Step-by-step derivation
      1. associate-*r/61.5%

        \[\leadsto \color{blue}{\frac{-0.6666666666666666 \cdot b}{a}} \]
      2. *-commutative61.5%

        \[\leadsto \frac{\color{blue}{b \cdot -0.6666666666666666}}{a} \]
      3. associate-*r/61.4%

        \[\leadsto \color{blue}{b \cdot \frac{-0.6666666666666666}{a}} \]
    9. Simplified61.4%

      \[\leadsto \color{blue}{b \cdot \frac{-0.6666666666666666}{a}} \]

    if -3.999999999999988e-310 < b

    1. Initial program 31.5%

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

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

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

        \[\leadsto \frac{\left(-b\right) + \sqrt{b \cdot b - \color{blue}{3 \cdot \left(a \cdot c\right)}}}{3 \cdot a} \]
    3. Simplified31.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. Taylor expanded in b around inf 50.4%

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

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

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

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

      \[\leadsto \frac{\color{blue}{\frac{a \cdot \left(c \cdot -1.5\right)}{b}}}{3 \cdot a} \]
    8. Step-by-step derivation
      1. div-inv50.4%

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

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

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

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

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

        \[\leadsto a \cdot \left(\left(c \cdot \frac{-1.5}{b}\right) \cdot \frac{\color{blue}{0.3333333333333333}}{a}\right) \]
    9. Applied egg-rr62.6%

      \[\leadsto \color{blue}{a \cdot \left(\left(c \cdot \frac{-1.5}{b}\right) \cdot \frac{0.3333333333333333}{a}\right)} \]
    10. Step-by-step derivation
      1. associate-*r*55.8%

        \[\leadsto \color{blue}{\left(a \cdot \left(c \cdot \frac{-1.5}{b}\right)\right) \cdot \frac{0.3333333333333333}{a}} \]
      2. associate-*r*50.4%

        \[\leadsto \color{blue}{\left(\left(a \cdot c\right) \cdot \frac{-1.5}{b}\right)} \cdot \frac{0.3333333333333333}{a} \]
      3. *-commutative50.4%

        \[\leadsto \left(\color{blue}{\left(c \cdot a\right)} \cdot \frac{-1.5}{b}\right) \cdot \frac{0.3333333333333333}{a} \]
      4. associate-*r/50.4%

        \[\leadsto \color{blue}{\frac{\left(c \cdot a\right) \cdot -1.5}{b}} \cdot \frac{0.3333333333333333}{a} \]
      5. *-commutative50.4%

        \[\leadsto \frac{\color{blue}{\left(a \cdot c\right)} \cdot -1.5}{b} \cdot \frac{0.3333333333333333}{a} \]
      6. *-commutative50.4%

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

        \[\leadsto \frac{\color{blue}{\left(-1.5 \cdot a\right) \cdot c}}{b} \cdot \frac{0.3333333333333333}{a} \]
      8. *-commutative50.4%

        \[\leadsto \frac{\color{blue}{c \cdot \left(-1.5 \cdot a\right)}}{b} \cdot \frac{0.3333333333333333}{a} \]
      9. *-rgt-identity50.4%

        \[\leadsto \frac{\color{blue}{\left(c \cdot \left(-1.5 \cdot a\right)\right) \cdot 1}}{b} \cdot \frac{0.3333333333333333}{a} \]
      10. associate-*r/50.4%

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

        \[\leadsto \color{blue}{\left(c \cdot \left(-1.5 \cdot a\right)\right) \cdot \left(\frac{1}{b} \cdot \frac{0.3333333333333333}{a}\right)} \]
      12. associate-*l*61.7%

        \[\leadsto \color{blue}{c \cdot \left(\left(-1.5 \cdot a\right) \cdot \left(\frac{1}{b} \cdot \frac{0.3333333333333333}{a}\right)\right)} \]
      13. *-commutative61.7%

        \[\leadsto c \cdot \left(\color{blue}{\left(a \cdot -1.5\right)} \cdot \left(\frac{1}{b} \cdot \frac{0.3333333333333333}{a}\right)\right) \]
      14. associate-*l/61.7%

        \[\leadsto c \cdot \left(\left(a \cdot -1.5\right) \cdot \color{blue}{\frac{1 \cdot \frac{0.3333333333333333}{a}}{b}}\right) \]
      15. *-lft-identity61.7%

        \[\leadsto c \cdot \left(\left(a \cdot -1.5\right) \cdot \frac{\color{blue}{\frac{0.3333333333333333}{a}}}{b}\right) \]
    11. Simplified61.7%

      \[\leadsto \color{blue}{c \cdot \left(\left(a \cdot -1.5\right) \cdot \frac{\frac{0.3333333333333333}{a}}{b}\right)} \]
    12. Taylor expanded in a around 0 67.9%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -4 \cdot 10^{-310}:\\ \;\;\;\;b \cdot \frac{-0.6666666666666666}{a}\\ \mathbf{else}:\\ \;\;\;\;c \cdot \frac{-0.5}{b}\\ \end{array} \]
  5. Add Preprocessing

Alternative 17: 67.1% accurate, 11.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq -4 \cdot 10^{-310}:\\
\;\;\;\;-0.6666666666666666 \cdot \frac{b}{a}\\

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


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

    1. Initial program 68.4%

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

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

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

        \[\leadsto \frac{\left(-b\right) + \sqrt{b \cdot b - \color{blue}{3 \cdot \left(a \cdot c\right)}}}{3 \cdot a} \]
    3. Simplified68.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. Taylor expanded in b around -inf 61.4%

      \[\leadsto \color{blue}{-0.6666666666666666 \cdot \frac{b}{a}} \]
    6. Step-by-step derivation
      1. *-commutative61.4%

        \[\leadsto \color{blue}{\frac{b}{a} \cdot -0.6666666666666666} \]
    7. Simplified61.4%

      \[\leadsto \color{blue}{\frac{b}{a} \cdot -0.6666666666666666} \]

    if -3.999999999999988e-310 < b

    1. Initial program 31.5%

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

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

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

        \[\leadsto \frac{\left(-b\right) + \sqrt{b \cdot b - \color{blue}{3 \cdot \left(a \cdot c\right)}}}{3 \cdot a} \]
    3. Simplified31.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. Taylor expanded in b around inf 50.4%

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

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

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

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

      \[\leadsto \frac{\color{blue}{\frac{a \cdot \left(c \cdot -1.5\right)}{b}}}{3 \cdot a} \]
    8. Step-by-step derivation
      1. div-inv50.4%

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

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

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

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

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

        \[\leadsto a \cdot \left(\left(c \cdot \frac{-1.5}{b}\right) \cdot \frac{\color{blue}{0.3333333333333333}}{a}\right) \]
    9. Applied egg-rr62.6%

      \[\leadsto \color{blue}{a \cdot \left(\left(c \cdot \frac{-1.5}{b}\right) \cdot \frac{0.3333333333333333}{a}\right)} \]
    10. Step-by-step derivation
      1. associate-*r*55.8%

        \[\leadsto \color{blue}{\left(a \cdot \left(c \cdot \frac{-1.5}{b}\right)\right) \cdot \frac{0.3333333333333333}{a}} \]
      2. associate-*r*50.4%

        \[\leadsto \color{blue}{\left(\left(a \cdot c\right) \cdot \frac{-1.5}{b}\right)} \cdot \frac{0.3333333333333333}{a} \]
      3. *-commutative50.4%

        \[\leadsto \left(\color{blue}{\left(c \cdot a\right)} \cdot \frac{-1.5}{b}\right) \cdot \frac{0.3333333333333333}{a} \]
      4. associate-*r/50.4%

        \[\leadsto \color{blue}{\frac{\left(c \cdot a\right) \cdot -1.5}{b}} \cdot \frac{0.3333333333333333}{a} \]
      5. *-commutative50.4%

        \[\leadsto \frac{\color{blue}{\left(a \cdot c\right)} \cdot -1.5}{b} \cdot \frac{0.3333333333333333}{a} \]
      6. *-commutative50.4%

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

        \[\leadsto \frac{\color{blue}{\left(-1.5 \cdot a\right) \cdot c}}{b} \cdot \frac{0.3333333333333333}{a} \]
      8. *-commutative50.4%

        \[\leadsto \frac{\color{blue}{c \cdot \left(-1.5 \cdot a\right)}}{b} \cdot \frac{0.3333333333333333}{a} \]
      9. *-rgt-identity50.4%

        \[\leadsto \frac{\color{blue}{\left(c \cdot \left(-1.5 \cdot a\right)\right) \cdot 1}}{b} \cdot \frac{0.3333333333333333}{a} \]
      10. associate-*r/50.4%

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

        \[\leadsto \color{blue}{\left(c \cdot \left(-1.5 \cdot a\right)\right) \cdot \left(\frac{1}{b} \cdot \frac{0.3333333333333333}{a}\right)} \]
      12. associate-*l*61.7%

        \[\leadsto \color{blue}{c \cdot \left(\left(-1.5 \cdot a\right) \cdot \left(\frac{1}{b} \cdot \frac{0.3333333333333333}{a}\right)\right)} \]
      13. *-commutative61.7%

        \[\leadsto c \cdot \left(\color{blue}{\left(a \cdot -1.5\right)} \cdot \left(\frac{1}{b} \cdot \frac{0.3333333333333333}{a}\right)\right) \]
      14. associate-*l/61.7%

        \[\leadsto c \cdot \left(\left(a \cdot -1.5\right) \cdot \color{blue}{\frac{1 \cdot \frac{0.3333333333333333}{a}}{b}}\right) \]
      15. *-lft-identity61.7%

        \[\leadsto c \cdot \left(\left(a \cdot -1.5\right) \cdot \frac{\color{blue}{\frac{0.3333333333333333}{a}}}{b}\right) \]
    11. Simplified61.7%

      \[\leadsto \color{blue}{c \cdot \left(\left(a \cdot -1.5\right) \cdot \frac{\frac{0.3333333333333333}{a}}{b}\right)} \]
    12. Taylor expanded in a around 0 67.9%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -4 \cdot 10^{-310}:\\ \;\;\;\;-0.6666666666666666 \cdot \frac{b}{a}\\ \mathbf{else}:\\ \;\;\;\;c \cdot \frac{-0.5}{b}\\ \end{array} \]
  5. Add Preprocessing

Alternative 18: 67.3% accurate, 11.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq -4 \cdot 10^{-310}:\\
\;\;\;\;-0.6666666666666666 \cdot \frac{b}{a}\\

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


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

    1. Initial program 68.4%

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

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

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

        \[\leadsto \frac{\left(-b\right) + \sqrt{b \cdot b - \color{blue}{3 \cdot \left(a \cdot c\right)}}}{3 \cdot a} \]
    3. Simplified68.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. Taylor expanded in b around -inf 61.4%

      \[\leadsto \color{blue}{-0.6666666666666666 \cdot \frac{b}{a}} \]
    6. Step-by-step derivation
      1. *-commutative61.4%

        \[\leadsto \color{blue}{\frac{b}{a} \cdot -0.6666666666666666} \]
    7. Simplified61.4%

      \[\leadsto \color{blue}{\frac{b}{a} \cdot -0.6666666666666666} \]

    if -3.999999999999988e-310 < b

    1. Initial program 31.5%

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

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

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

        \[\leadsto \frac{\left(-b\right) + \sqrt{b \cdot b - \color{blue}{3 \cdot \left(a \cdot c\right)}}}{3 \cdot a} \]
    3. Simplified31.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. Taylor expanded in b around inf 68.2%

      \[\leadsto \color{blue}{-0.5 \cdot \frac{c}{b}} \]
    6. Step-by-step derivation
      1. *-commutative68.2%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -4 \cdot 10^{-310}:\\ \;\;\;\;-0.6666666666666666 \cdot \frac{b}{a}\\ \mathbf{else}:\\ \;\;\;\;-0.5 \cdot \frac{c}{b}\\ \end{array} \]
  5. Add Preprocessing

Alternative 19: 67.3% accurate, 11.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq -4 \cdot 10^{-310}:\\
\;\;\;\;\frac{-0.6666666666666666}{\frac{a}{b}}\\

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


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

    1. Initial program 68.4%

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

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

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

        \[\leadsto \frac{\left(-b\right) + \sqrt{b \cdot b - \color{blue}{3 \cdot \left(a \cdot c\right)}}}{3 \cdot a} \]
    3. Simplified68.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. Taylor expanded in b around -inf 61.4%

      \[\leadsto \color{blue}{-0.6666666666666666 \cdot \frac{b}{a}} \]
    6. Step-by-step derivation
      1. *-commutative61.4%

        \[\leadsto \color{blue}{\frac{b}{a} \cdot -0.6666666666666666} \]
    7. Simplified61.4%

      \[\leadsto \color{blue}{\frac{b}{a} \cdot -0.6666666666666666} \]
    8. Step-by-step derivation
      1. *-commutative61.4%

        \[\leadsto \color{blue}{-0.6666666666666666 \cdot \frac{b}{a}} \]
      2. clear-num61.4%

        \[\leadsto -0.6666666666666666 \cdot \color{blue}{\frac{1}{\frac{a}{b}}} \]
      3. un-div-inv61.5%

        \[\leadsto \color{blue}{\frac{-0.6666666666666666}{\frac{a}{b}}} \]
    9. Applied egg-rr61.5%

      \[\leadsto \color{blue}{\frac{-0.6666666666666666}{\frac{a}{b}}} \]

    if -3.999999999999988e-310 < b

    1. Initial program 31.5%

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

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

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

        \[\leadsto \frac{\left(-b\right) + \sqrt{b \cdot b - \color{blue}{3 \cdot \left(a \cdot c\right)}}}{3 \cdot a} \]
    3. Simplified31.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. Taylor expanded in b around inf 68.2%

      \[\leadsto \color{blue}{-0.5 \cdot \frac{c}{b}} \]
    6. Step-by-step derivation
      1. *-commutative68.2%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -4 \cdot 10^{-310}:\\ \;\;\;\;\frac{-0.6666666666666666}{\frac{a}{b}}\\ \mathbf{else}:\\ \;\;\;\;-0.5 \cdot \frac{c}{b}\\ \end{array} \]
  5. Add Preprocessing

Alternative 20: 67.3% accurate, 11.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq -4 \cdot 10^{-310}:\\
\;\;\;\;\frac{-0.6666666666666666}{\frac{a}{b}}\\

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


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

    1. Initial program 68.4%

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

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

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

        \[\leadsto \frac{\left(-b\right) + \sqrt{b \cdot b - \color{blue}{3 \cdot \left(a \cdot c\right)}}}{3 \cdot a} \]
    3. Simplified68.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. Taylor expanded in b around -inf 61.4%

      \[\leadsto \color{blue}{-0.6666666666666666 \cdot \frac{b}{a}} \]
    6. Step-by-step derivation
      1. *-commutative61.4%

        \[\leadsto \color{blue}{\frac{b}{a} \cdot -0.6666666666666666} \]
    7. Simplified61.4%

      \[\leadsto \color{blue}{\frac{b}{a} \cdot -0.6666666666666666} \]
    8. Step-by-step derivation
      1. *-commutative61.4%

        \[\leadsto \color{blue}{-0.6666666666666666 \cdot \frac{b}{a}} \]
      2. clear-num61.4%

        \[\leadsto -0.6666666666666666 \cdot \color{blue}{\frac{1}{\frac{a}{b}}} \]
      3. un-div-inv61.5%

        \[\leadsto \color{blue}{\frac{-0.6666666666666666}{\frac{a}{b}}} \]
    9. Applied egg-rr61.5%

      \[\leadsto \color{blue}{\frac{-0.6666666666666666}{\frac{a}{b}}} \]

    if -3.999999999999988e-310 < b

    1. Initial program 31.5%

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

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

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

        \[\leadsto \frac{\left(-b\right) + \sqrt{b \cdot b - \color{blue}{3 \cdot \left(a \cdot c\right)}}}{3 \cdot a} \]
    3. Simplified31.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. frac-2neg31.4%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -4 \cdot 10^{-310}:\\ \;\;\;\;\frac{-0.6666666666666666}{\frac{a}{b}}\\ \mathbf{else}:\\ \;\;\;\;\frac{c \cdot -0.5}{b}\\ \end{array} \]
  5. Add Preprocessing

Alternative 21: 34.3% accurate, 23.2× speedup?

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

\\
b \cdot \frac{-0.6666666666666666}{a}
\end{array}
Derivation
  1. Initial program 49.1%

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

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

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

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

    \[\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. frac-2neg49.0%

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

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

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

    \[\leadsto \color{blue}{-0.6666666666666666 \cdot \frac{b}{a}} \]
  8. Step-by-step derivation
    1. associate-*r/30.8%

      \[\leadsto \color{blue}{\frac{-0.6666666666666666 \cdot b}{a}} \]
    2. *-commutative30.8%

      \[\leadsto \frac{\color{blue}{b \cdot -0.6666666666666666}}{a} \]
    3. associate-*r/30.7%

      \[\leadsto \color{blue}{b \cdot \frac{-0.6666666666666666}{a}} \]
  9. Simplified30.7%

    \[\leadsto \color{blue}{b \cdot \frac{-0.6666666666666666}{a}} \]
  10. Final simplification30.7%

    \[\leadsto b \cdot \frac{-0.6666666666666666}{a} \]
  11. Add Preprocessing

Reproduce

?
herbie shell --seed 2024089 
(FPCore (a b c)
  :name "Cubic critical"
  :precision binary64
  (/ (+ (- b) (sqrt (- (* b b) (* (* 3.0 a) c)))) (* 3.0 a)))