Cubic critical

Percentage Accurate: 52.3% → 84.9%
Time: 15.7s
Alternatives: 13
Speedup: 16.4×

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 13 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: 52.3% 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.9% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq -2.3 \cdot 10^{+83}:\\
\;\;\;\;\frac{-0.3333333333333333 \cdot \mathsf{fma}\left(b, 2, -1.5 \cdot \frac{c}{\frac{b}{a}}\right)}{a}\\

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

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


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

    1. Initial program 52.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. /-rgt-identity52.8%

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{-0.3333333333333333 \cdot \color{blue}{\left(-1.5 \cdot \frac{c \cdot a}{b} + 2 \cdot b\right)}}{a} \]
    5. Step-by-step derivation
      1. +-commutative92.4%

        \[\leadsto \frac{-0.3333333333333333 \cdot \color{blue}{\left(2 \cdot b + -1.5 \cdot \frac{c \cdot a}{b}\right)}}{a} \]
      2. *-commutative92.4%

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

        \[\leadsto \frac{-0.3333333333333333 \cdot \color{blue}{\mathsf{fma}\left(b, 2, -1.5 \cdot \frac{c \cdot a}{b}\right)}}{a} \]
      4. associate-/l*95.5%

        \[\leadsto \frac{-0.3333333333333333 \cdot \mathsf{fma}\left(b, 2, -1.5 \cdot \color{blue}{\frac{c}{\frac{b}{a}}}\right)}{a} \]
    6. Simplified95.5%

      \[\leadsto \frac{-0.3333333333333333 \cdot \color{blue}{\mathsf{fma}\left(b, 2, -1.5 \cdot \frac{c}{\frac{b}{a}}\right)}}{a} \]

    if -2.29999999999999995e83 < b < 3.69999999999999986e-81

    1. Initial program 87.5%

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

    if 3.69999999999999986e-81 < b

    1. Initial program 15.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. /-rgt-identity15.0%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(b - \left(-1.5 \cdot \frac{c \cdot a}{b} + b\right)\right) \cdot \color{blue}{\frac{1}{\frac{a}{-0.3333333333333333}}} \]
      2. inv-pow24.6%

        \[\leadsto \left(b - \left(-1.5 \cdot \frac{c \cdot a}{b} + b\right)\right) \cdot \color{blue}{{\left(\frac{a}{-0.3333333333333333}\right)}^{-1}} \]
    6. Applied egg-rr24.6%

      \[\leadsto \left(b - \left(-1.5 \cdot \frac{c \cdot a}{b} + b\right)\right) \cdot \color{blue}{{\left(\frac{a}{-0.3333333333333333}\right)}^{-1}} \]
    7. Step-by-step derivation
      1. unpow-124.6%

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

      \[\leadsto \left(b - \left(-1.5 \cdot \frac{c \cdot a}{b} + b\right)\right) \cdot \color{blue}{\frac{1}{\frac{a}{-0.3333333333333333}}} \]
    9. Taylor expanded in b around 0 85.5%

      \[\leadsto \color{blue}{-0.5 \cdot \frac{c}{b}} \]
    10. Step-by-step derivation
      1. *-commutative85.5%

        \[\leadsto \color{blue}{\frac{c}{b} \cdot -0.5} \]
      2. associate-*l/85.5%

        \[\leadsto \color{blue}{\frac{c \cdot -0.5}{b}} \]
    11. Simplified85.5%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -2.3 \cdot 10^{+83}:\\ \;\;\;\;\frac{-0.3333333333333333 \cdot \mathsf{fma}\left(b, 2, -1.5 \cdot \frac{c}{\frac{b}{a}}\right)}{a}\\ \mathbf{elif}\;b \leq 3.7 \cdot 10^{-81}:\\ \;\;\;\;\frac{\sqrt{b \cdot b - c \cdot \left(a \cdot 3\right)} - b}{a \cdot 3}\\ \mathbf{else}:\\ \;\;\;\;\frac{c \cdot -0.5}{b}\\ \end{array} \]

Alternative 2: 85.0% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq -1.2 \cdot 10^{+114}:\\
\;\;\;\;\frac{-0.3333333333333333 \cdot \mathsf{fma}\left(b, 2, -1.5 \cdot \frac{c}{\frac{b}{a}}\right)}{a}\\

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

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


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

    1. Initial program 49.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. /-rgt-identity49.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{-0.3333333333333333 \cdot \color{blue}{\left(2 \cdot b + -1.5 \cdot \frac{c \cdot a}{b}\right)}}{a} \]
      2. *-commutative91.8%

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

        \[\leadsto \frac{-0.3333333333333333 \cdot \color{blue}{\mathsf{fma}\left(b, 2, -1.5 \cdot \frac{c \cdot a}{b}\right)}}{a} \]
      4. associate-/l*95.1%

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

      \[\leadsto \frac{-0.3333333333333333 \cdot \color{blue}{\mathsf{fma}\left(b, 2, -1.5 \cdot \frac{c}{\frac{b}{a}}\right)}}{a} \]

    if -1.2e114 < b < 3.09999999999999988e-81

    1. Initial program 88.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. /-rgt-identity88.0%

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{-0.3333333333333333 \cdot \left(b - \sqrt{\mathsf{fma}\left(b, b, \left(a \cdot c\right) \cdot -3\right)}\right)}{a}} \]
    4. Step-by-step derivation
      1. fma-udef87.8%

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

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

        \[\leadsto \frac{-0.3333333333333333 \cdot \left(b - \sqrt{b \cdot b + \color{blue}{\left(-3\right)} \cdot \left(a \cdot c\right)}\right)}{a} \]
      4. cancel-sign-sub-inv87.8%

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

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

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

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

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

    if 3.09999999999999988e-81 < b

    1. Initial program 15.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. /-rgt-identity15.0%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(b - \left(-1.5 \cdot \frac{c \cdot a}{b} + b\right)\right) \cdot \color{blue}{\frac{1}{\frac{a}{-0.3333333333333333}}} \]
      2. inv-pow24.6%

        \[\leadsto \left(b - \left(-1.5 \cdot \frac{c \cdot a}{b} + b\right)\right) \cdot \color{blue}{{\left(\frac{a}{-0.3333333333333333}\right)}^{-1}} \]
    6. Applied egg-rr24.6%

      \[\leadsto \left(b - \left(-1.5 \cdot \frac{c \cdot a}{b} + b\right)\right) \cdot \color{blue}{{\left(\frac{a}{-0.3333333333333333}\right)}^{-1}} \]
    7. Step-by-step derivation
      1. unpow-124.6%

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

      \[\leadsto \left(b - \left(-1.5 \cdot \frac{c \cdot a}{b} + b\right)\right) \cdot \color{blue}{\frac{1}{\frac{a}{-0.3333333333333333}}} \]
    9. Taylor expanded in b around 0 85.5%

      \[\leadsto \color{blue}{-0.5 \cdot \frac{c}{b}} \]
    10. Step-by-step derivation
      1. *-commutative85.5%

        \[\leadsto \color{blue}{\frac{c}{b} \cdot -0.5} \]
      2. associate-*l/85.5%

        \[\leadsto \color{blue}{\frac{c \cdot -0.5}{b}} \]
    11. Simplified85.5%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -1.2 \cdot 10^{+114}:\\ \;\;\;\;\frac{-0.3333333333333333 \cdot \mathsf{fma}\left(b, 2, -1.5 \cdot \frac{c}{\frac{b}{a}}\right)}{a}\\ \mathbf{elif}\;b \leq 3.1 \cdot 10^{-81}:\\ \;\;\;\;\frac{-0.3333333333333333 \cdot \left(b - \sqrt{b \cdot b - c \cdot \left(a \cdot 3\right)}\right)}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{c \cdot -0.5}{b}\\ \end{array} \]

Alternative 3: 84.9% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq -3.2 \cdot 10^{+82}:\\
\;\;\;\;\frac{-0.3333333333333333 \cdot \mathsf{fma}\left(b, 2, -1.5 \cdot \frac{c}{\frac{b}{a}}\right)}{a}\\

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

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


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

    1. Initial program 52.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. /-rgt-identity52.8%

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{-0.3333333333333333 \cdot \color{blue}{\left(-1.5 \cdot \frac{c \cdot a}{b} + 2 \cdot b\right)}}{a} \]
    5. Step-by-step derivation
      1. +-commutative92.4%

        \[\leadsto \frac{-0.3333333333333333 \cdot \color{blue}{\left(2 \cdot b + -1.5 \cdot \frac{c \cdot a}{b}\right)}}{a} \]
      2. *-commutative92.4%

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

        \[\leadsto \frac{-0.3333333333333333 \cdot \color{blue}{\mathsf{fma}\left(b, 2, -1.5 \cdot \frac{c \cdot a}{b}\right)}}{a} \]
      4. associate-/l*95.5%

        \[\leadsto \frac{-0.3333333333333333 \cdot \mathsf{fma}\left(b, 2, -1.5 \cdot \color{blue}{\frac{c}{\frac{b}{a}}}\right)}{a} \]
    6. Simplified95.5%

      \[\leadsto \frac{-0.3333333333333333 \cdot \color{blue}{\mathsf{fma}\left(b, 2, -1.5 \cdot \frac{c}{\frac{b}{a}}\right)}}{a} \]

    if -3.19999999999999975e82 < b < 1.6999999999999999e-81

    1. Initial program 87.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.6999999999999999e-81 < b

    1. Initial program 15.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. /-rgt-identity15.0%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(b - \left(-1.5 \cdot \frac{c \cdot a}{b} + b\right)\right) \cdot \color{blue}{\frac{1}{\frac{a}{-0.3333333333333333}}} \]
      2. inv-pow24.6%

        \[\leadsto \left(b - \left(-1.5 \cdot \frac{c \cdot a}{b} + b\right)\right) \cdot \color{blue}{{\left(\frac{a}{-0.3333333333333333}\right)}^{-1}} \]
    6. Applied egg-rr24.6%

      \[\leadsto \left(b - \left(-1.5 \cdot \frac{c \cdot a}{b} + b\right)\right) \cdot \color{blue}{{\left(\frac{a}{-0.3333333333333333}\right)}^{-1}} \]
    7. Step-by-step derivation
      1. unpow-124.6%

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

      \[\leadsto \left(b - \left(-1.5 \cdot \frac{c \cdot a}{b} + b\right)\right) \cdot \color{blue}{\frac{1}{\frac{a}{-0.3333333333333333}}} \]
    9. Taylor expanded in b around 0 85.5%

      \[\leadsto \color{blue}{-0.5 \cdot \frac{c}{b}} \]
    10. Step-by-step derivation
      1. *-commutative85.5%

        \[\leadsto \color{blue}{\frac{c}{b} \cdot -0.5} \]
      2. associate-*l/85.5%

        \[\leadsto \color{blue}{\frac{c \cdot -0.5}{b}} \]
    11. Simplified85.5%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -3.2 \cdot 10^{+82}:\\ \;\;\;\;\frac{-0.3333333333333333 \cdot \mathsf{fma}\left(b, 2, -1.5 \cdot \frac{c}{\frac{b}{a}}\right)}{a}\\ \mathbf{elif}\;b \leq 1.7 \cdot 10^{-81}:\\ \;\;\;\;\frac{\sqrt{b \cdot b - 3 \cdot \left(c \cdot a\right)} - b}{a \cdot 3}\\ \mathbf{else}:\\ \;\;\;\;\frac{c \cdot -0.5}{b}\\ \end{array} \]

Alternative 4: 80.3% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq -4.2 \cdot 10^{-38}:\\ \;\;\;\;\frac{b}{a} \cdot -0.6666666666666666 + 0.5 \cdot \frac{c}{b}\\ \mathbf{elif}\;b \leq 1.5 \cdot 10^{-81}:\\ \;\;\;\;\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 -4.2e-38)
   (+ (* (/ b a) -0.6666666666666666) (* 0.5 (/ c b)))
   (if (<= b 1.5e-81)
     (* (- 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 <= -4.2e-38) {
		tmp = ((b / a) * -0.6666666666666666) + (0.5 * (c / b));
	} else if (b <= 1.5e-81) {
		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 <= (-4.2d-38)) then
        tmp = ((b / a) * (-0.6666666666666666d0)) + (0.5d0 * (c / b))
    else if (b <= 1.5d-81) 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 <= -4.2e-38) {
		tmp = ((b / a) * -0.6666666666666666) + (0.5 * (c / b));
	} else if (b <= 1.5e-81) {
		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 <= -4.2e-38:
		tmp = ((b / a) * -0.6666666666666666) + (0.5 * (c / b))
	elif b <= 1.5e-81:
		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 <= -4.2e-38)
		tmp = Float64(Float64(Float64(b / a) * -0.6666666666666666) + Float64(0.5 * Float64(c / b)));
	elseif (b <= 1.5e-81)
		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 <= -4.2e-38)
		tmp = ((b / a) * -0.6666666666666666) + (0.5 * (c / b));
	elseif (b <= 1.5e-81)
		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, -4.2e-38], N[(N[(N[(b / a), $MachinePrecision] * -0.6666666666666666), $MachinePrecision] + N[(0.5 * N[(c / b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 1.5e-81], 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 -4.2 \cdot 10^{-38}:\\
\;\;\;\;\frac{b}{a} \cdot -0.6666666666666666 + 0.5 \cdot \frac{c}{b}\\

\mathbf{elif}\;b \leq 1.5 \cdot 10^{-81}:\\
\;\;\;\;\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 < -4.20000000000000026e-38

    1. Initial program 65.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. /-rgt-identity65.9%

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{-0.6666666666666666 \cdot \frac{b}{a} + 0.5 \cdot \frac{c}{b}} \]

    if -4.20000000000000026e-38 < b < 1.4999999999999999e-81

    1. Initial program 83.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. /-rgt-identity83.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.4999999999999999e-81 < b

    1. Initial program 15.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. /-rgt-identity15.5%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \left(b - \color{blue}{\left(-1.5 \cdot \frac{c \cdot a}{b} + b\right)}\right) \cdot \frac{-0.3333333333333333}{a} \]
    5. Step-by-step derivation
      1. clear-num25.0%

        \[\leadsto \left(b - \left(-1.5 \cdot \frac{c \cdot a}{b} + b\right)\right) \cdot \color{blue}{\frac{1}{\frac{a}{-0.3333333333333333}}} \]
      2. inv-pow25.0%

        \[\leadsto \left(b - \left(-1.5 \cdot \frac{c \cdot a}{b} + b\right)\right) \cdot \color{blue}{{\left(\frac{a}{-0.3333333333333333}\right)}^{-1}} \]
    6. Applied egg-rr25.0%

      \[\leadsto \left(b - \left(-1.5 \cdot \frac{c \cdot a}{b} + b\right)\right) \cdot \color{blue}{{\left(\frac{a}{-0.3333333333333333}\right)}^{-1}} \]
    7. Step-by-step derivation
      1. unpow-125.0%

        \[\leadsto \left(b - \left(-1.5 \cdot \frac{c \cdot a}{b} + b\right)\right) \cdot \color{blue}{\frac{1}{\frac{a}{-0.3333333333333333}}} \]
    8. Simplified25.0%

      \[\leadsto \left(b - \left(-1.5 \cdot \frac{c \cdot a}{b} + b\right)\right) \cdot \color{blue}{\frac{1}{\frac{a}{-0.3333333333333333}}} \]
    9. Taylor expanded in b around 0 85.2%

      \[\leadsto \color{blue}{-0.5 \cdot \frac{c}{b}} \]
    10. Step-by-step derivation
      1. *-commutative85.2%

        \[\leadsto \color{blue}{\frac{c}{b} \cdot -0.5} \]
      2. associate-*l/85.2%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -4.2 \cdot 10^{-38}:\\ \;\;\;\;\frac{b}{a} \cdot -0.6666666666666666 + 0.5 \cdot \frac{c}{b}\\ \mathbf{elif}\;b \leq 1.5 \cdot 10^{-81}:\\ \;\;\;\;\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} \]

Alternative 5: 80.3% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq -2.65 \cdot 10^{-39}:\\ \;\;\;\;\frac{b}{a} \cdot -0.6666666666666666 + 0.5 \cdot \frac{c}{b}\\ \mathbf{elif}\;b \leq 1.45 \cdot 10^{-81}:\\ \;\;\;\;\frac{-0.3333333333333333 \cdot \left(b - \sqrt{c \cdot \left(a \cdot -3\right)}\right)}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{c \cdot -0.5}{b}\\ \end{array} \end{array} \]
(FPCore (a b c)
 :precision binary64
 (if (<= b -2.65e-39)
   (+ (* (/ b a) -0.6666666666666666) (* 0.5 (/ c b)))
   (if (<= b 1.45e-81)
     (/ (* -0.3333333333333333 (- b (sqrt (* c (* a -3.0))))) a)
     (/ (* c -0.5) b))))
double code(double a, double b, double c) {
	double tmp;
	if (b <= -2.65e-39) {
		tmp = ((b / a) * -0.6666666666666666) + (0.5 * (c / b));
	} else if (b <= 1.45e-81) {
		tmp = (-0.3333333333333333 * (b - 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 <= (-2.65d-39)) then
        tmp = ((b / a) * (-0.6666666666666666d0)) + (0.5d0 * (c / b))
    else if (b <= 1.45d-81) then
        tmp = ((-0.3333333333333333d0) * (b - 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 <= -2.65e-39) {
		tmp = ((b / a) * -0.6666666666666666) + (0.5 * (c / b));
	} else if (b <= 1.45e-81) {
		tmp = (-0.3333333333333333 * (b - Math.sqrt((c * (a * -3.0))))) / a;
	} else {
		tmp = (c * -0.5) / b;
	}
	return tmp;
}
def code(a, b, c):
	tmp = 0
	if b <= -2.65e-39:
		tmp = ((b / a) * -0.6666666666666666) + (0.5 * (c / b))
	elif b <= 1.45e-81:
		tmp = (-0.3333333333333333 * (b - 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 <= -2.65e-39)
		tmp = Float64(Float64(Float64(b / a) * -0.6666666666666666) + Float64(0.5 * Float64(c / b)));
	elseif (b <= 1.45e-81)
		tmp = Float64(Float64(-0.3333333333333333 * Float64(b - 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 <= -2.65e-39)
		tmp = ((b / a) * -0.6666666666666666) + (0.5 * (c / b));
	elseif (b <= 1.45e-81)
		tmp = (-0.3333333333333333 * (b - sqrt((c * (a * -3.0))))) / a;
	else
		tmp = (c * -0.5) / b;
	end
	tmp_2 = tmp;
end
code[a_, b_, c_] := If[LessEqual[b, -2.65e-39], N[(N[(N[(b / a), $MachinePrecision] * -0.6666666666666666), $MachinePrecision] + N[(0.5 * N[(c / b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 1.45e-81], N[(N[(-0.3333333333333333 * N[(b - N[Sqrt[N[(c * N[(a * -3.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision], N[(N[(c * -0.5), $MachinePrecision] / b), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;b \leq -2.65 \cdot 10^{-39}:\\
\;\;\;\;\frac{b}{a} \cdot -0.6666666666666666 + 0.5 \cdot \frac{c}{b}\\

\mathbf{elif}\;b \leq 1.45 \cdot 10^{-81}:\\
\;\;\;\;\frac{-0.3333333333333333 \cdot \left(b - \sqrt{c \cdot \left(a \cdot -3\right)}\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.65000000000000002e-39

    1. Initial program 65.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. /-rgt-identity65.9%

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{-0.6666666666666666 \cdot \frac{b}{a} + 0.5 \cdot \frac{c}{b}} \]

    if -2.65000000000000002e-39 < b < 1.44999999999999994e-81

    1. Initial program 83.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. /-rgt-identity83.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.44999999999999994e-81 < b

    1. Initial program 15.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. /-rgt-identity15.5%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \left(b - \color{blue}{\left(-1.5 \cdot \frac{c \cdot a}{b} + b\right)}\right) \cdot \frac{-0.3333333333333333}{a} \]
    5. Step-by-step derivation
      1. clear-num25.0%

        \[\leadsto \left(b - \left(-1.5 \cdot \frac{c \cdot a}{b} + b\right)\right) \cdot \color{blue}{\frac{1}{\frac{a}{-0.3333333333333333}}} \]
      2. inv-pow25.0%

        \[\leadsto \left(b - \left(-1.5 \cdot \frac{c \cdot a}{b} + b\right)\right) \cdot \color{blue}{{\left(\frac{a}{-0.3333333333333333}\right)}^{-1}} \]
    6. Applied egg-rr25.0%

      \[\leadsto \left(b - \left(-1.5 \cdot \frac{c \cdot a}{b} + b\right)\right) \cdot \color{blue}{{\left(\frac{a}{-0.3333333333333333}\right)}^{-1}} \]
    7. Step-by-step derivation
      1. unpow-125.0%

        \[\leadsto \left(b - \left(-1.5 \cdot \frac{c \cdot a}{b} + b\right)\right) \cdot \color{blue}{\frac{1}{\frac{a}{-0.3333333333333333}}} \]
    8. Simplified25.0%

      \[\leadsto \left(b - \left(-1.5 \cdot \frac{c \cdot a}{b} + b\right)\right) \cdot \color{blue}{\frac{1}{\frac{a}{-0.3333333333333333}}} \]
    9. Taylor expanded in b around 0 85.2%

      \[\leadsto \color{blue}{-0.5 \cdot \frac{c}{b}} \]
    10. Step-by-step derivation
      1. *-commutative85.2%

        \[\leadsto \color{blue}{\frac{c}{b} \cdot -0.5} \]
      2. associate-*l/85.2%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -2.65 \cdot 10^{-39}:\\ \;\;\;\;\frac{b}{a} \cdot -0.6666666666666666 + 0.5 \cdot \frac{c}{b}\\ \mathbf{elif}\;b \leq 1.45 \cdot 10^{-81}:\\ \;\;\;\;\frac{-0.3333333333333333 \cdot \left(b - \sqrt{c \cdot \left(a \cdot -3\right)}\right)}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{c \cdot -0.5}{b}\\ \end{array} \]

Alternative 6: 80.3% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq -2.7 \cdot 10^{-38}:\\
\;\;\;\;\frac{-0.3333333333333333 \cdot \mathsf{fma}\left(b, 2, -1.5 \cdot \frac{c}{\frac{b}{a}}\right)}{a}\\

\mathbf{elif}\;b \leq 1.5 \cdot 10^{-81}:\\
\;\;\;\;\frac{-0.3333333333333333 \cdot \left(b - \sqrt{c \cdot \left(a \cdot -3\right)}\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.70000000000000005e-38

    1. Initial program 65.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. /-rgt-identity65.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{-0.3333333333333333 \cdot \color{blue}{\left(2 \cdot b + -1.5 \cdot \frac{c \cdot a}{b}\right)}}{a} \]
      2. *-commutative89.4%

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

        \[\leadsto \frac{-0.3333333333333333 \cdot \color{blue}{\mathsf{fma}\left(b, 2, -1.5 \cdot \frac{c \cdot a}{b}\right)}}{a} \]
      4. associate-/l*91.6%

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

      \[\leadsto \frac{-0.3333333333333333 \cdot \color{blue}{\mathsf{fma}\left(b, 2, -1.5 \cdot \frac{c}{\frac{b}{a}}\right)}}{a} \]

    if -2.70000000000000005e-38 < b < 1.4999999999999999e-81

    1. Initial program 83.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. /-rgt-identity83.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.4999999999999999e-81 < b

    1. Initial program 15.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. /-rgt-identity15.5%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \left(b - \color{blue}{\left(-1.5 \cdot \frac{c \cdot a}{b} + b\right)}\right) \cdot \frac{-0.3333333333333333}{a} \]
    5. Step-by-step derivation
      1. clear-num25.0%

        \[\leadsto \left(b - \left(-1.5 \cdot \frac{c \cdot a}{b} + b\right)\right) \cdot \color{blue}{\frac{1}{\frac{a}{-0.3333333333333333}}} \]
      2. inv-pow25.0%

        \[\leadsto \left(b - \left(-1.5 \cdot \frac{c \cdot a}{b} + b\right)\right) \cdot \color{blue}{{\left(\frac{a}{-0.3333333333333333}\right)}^{-1}} \]
    6. Applied egg-rr25.0%

      \[\leadsto \left(b - \left(-1.5 \cdot \frac{c \cdot a}{b} + b\right)\right) \cdot \color{blue}{{\left(\frac{a}{-0.3333333333333333}\right)}^{-1}} \]
    7. Step-by-step derivation
      1. unpow-125.0%

        \[\leadsto \left(b - \left(-1.5 \cdot \frac{c \cdot a}{b} + b\right)\right) \cdot \color{blue}{\frac{1}{\frac{a}{-0.3333333333333333}}} \]
    8. Simplified25.0%

      \[\leadsto \left(b - \left(-1.5 \cdot \frac{c \cdot a}{b} + b\right)\right) \cdot \color{blue}{\frac{1}{\frac{a}{-0.3333333333333333}}} \]
    9. Taylor expanded in b around 0 85.2%

      \[\leadsto \color{blue}{-0.5 \cdot \frac{c}{b}} \]
    10. Step-by-step derivation
      1. *-commutative85.2%

        \[\leadsto \color{blue}{\frac{c}{b} \cdot -0.5} \]
      2. associate-*l/85.2%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -2.7 \cdot 10^{-38}:\\ \;\;\;\;\frac{-0.3333333333333333 \cdot \mathsf{fma}\left(b, 2, -1.5 \cdot \frac{c}{\frac{b}{a}}\right)}{a}\\ \mathbf{elif}\;b \leq 1.5 \cdot 10^{-81}:\\ \;\;\;\;\frac{-0.3333333333333333 \cdot \left(b - \sqrt{c \cdot \left(a \cdot -3\right)}\right)}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{c \cdot -0.5}{b}\\ \end{array} \]

Alternative 7: 66.5% accurate, 12.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq 1.05 \cdot 10^{-297}:\\ \;\;\;\;\frac{-0.3333333333333333}{a} \cdot \left(b \cdot 2\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{c \cdot -0.5}{b}\\ \end{array} \end{array} \]
(FPCore (a b c)
 :precision binary64
 (if (<= b 1.05e-297)
   (* (/ -0.3333333333333333 a) (* b 2.0))
   (/ (* c -0.5) b)))
double code(double a, double b, double c) {
	double tmp;
	if (b <= 1.05e-297) {
		tmp = (-0.3333333333333333 / a) * (b * 2.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 <= 1.05d-297) then
        tmp = ((-0.3333333333333333d0) / a) * (b * 2.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 <= 1.05e-297) {
		tmp = (-0.3333333333333333 / a) * (b * 2.0);
	} else {
		tmp = (c * -0.5) / b;
	}
	return tmp;
}
def code(a, b, c):
	tmp = 0
	if b <= 1.05e-297:
		tmp = (-0.3333333333333333 / a) * (b * 2.0)
	else:
		tmp = (c * -0.5) / b
	return tmp
function code(a, b, c)
	tmp = 0.0
	if (b <= 1.05e-297)
		tmp = Float64(Float64(-0.3333333333333333 / a) * Float64(b * 2.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 <= 1.05e-297)
		tmp = (-0.3333333333333333 / a) * (b * 2.0);
	else
		tmp = (c * -0.5) / b;
	end
	tmp_2 = tmp;
end
code[a_, b_, c_] := If[LessEqual[b, 1.05e-297], N[(N[(-0.3333333333333333 / a), $MachinePrecision] * N[(b * 2.0), $MachinePrecision]), $MachinePrecision], N[(N[(c * -0.5), $MachinePrecision] / b), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;b \leq 1.05 \cdot 10^{-297}:\\
\;\;\;\;\frac{-0.3333333333333333}{a} \cdot \left(b \cdot 2\right)\\

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


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

    1. Initial program 72.7%

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\left(2 \cdot b\right)} \cdot \frac{-0.3333333333333333}{a} \]
    5. Step-by-step derivation
      1. *-commutative68.6%

        \[\leadsto \color{blue}{\left(b \cdot 2\right)} \cdot \frac{-0.3333333333333333}{a} \]
    6. Simplified68.6%

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

    if 1.05000000000000007e-297 < b

    1. Initial program 32.2%

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \left(b - \color{blue}{\left(-1.5 \cdot \frac{c \cdot a}{b} + b\right)}\right) \cdot \frac{-0.3333333333333333}{a} \]
    5. Step-by-step derivation
      1. clear-num19.4%

        \[\leadsto \left(b - \left(-1.5 \cdot \frac{c \cdot a}{b} + b\right)\right) \cdot \color{blue}{\frac{1}{\frac{a}{-0.3333333333333333}}} \]
      2. inv-pow19.4%

        \[\leadsto \left(b - \left(-1.5 \cdot \frac{c \cdot a}{b} + b\right)\right) \cdot \color{blue}{{\left(\frac{a}{-0.3333333333333333}\right)}^{-1}} \]
    6. Applied egg-rr19.4%

      \[\leadsto \left(b - \left(-1.5 \cdot \frac{c \cdot a}{b} + b\right)\right) \cdot \color{blue}{{\left(\frac{a}{-0.3333333333333333}\right)}^{-1}} \]
    7. Step-by-step derivation
      1. unpow-119.4%

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

      \[\leadsto \left(b - \left(-1.5 \cdot \frac{c \cdot a}{b} + b\right)\right) \cdot \color{blue}{\frac{1}{\frac{a}{-0.3333333333333333}}} \]
    9. Taylor expanded in b around 0 67.2%

      \[\leadsto \color{blue}{-0.5 \cdot \frac{c}{b}} \]
    10. Step-by-step derivation
      1. *-commutative67.2%

        \[\leadsto \color{blue}{\frac{c}{b} \cdot -0.5} \]
      2. associate-*l/67.2%

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

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

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

Alternative 8: 66.5% accurate, 12.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq 4.2 \cdot 10^{-303}:\\ \;\;\;\;\frac{b}{3} \cdot \frac{-2}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{c \cdot -0.5}{b}\\ \end{array} \end{array} \]
(FPCore (a b c)
 :precision binary64
 (if (<= b 4.2e-303) (* (/ b 3.0) (/ -2.0 a)) (/ (* c -0.5) b)))
double code(double a, double b, double c) {
	double tmp;
	if (b <= 4.2e-303) {
		tmp = (b / 3.0) * (-2.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.2d-303) then
        tmp = (b / 3.0d0) * ((-2.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.2e-303) {
		tmp = (b / 3.0) * (-2.0 / a);
	} else {
		tmp = (c * -0.5) / b;
	}
	return tmp;
}
def code(a, b, c):
	tmp = 0
	if b <= 4.2e-303:
		tmp = (b / 3.0) * (-2.0 / a)
	else:
		tmp = (c * -0.5) / b
	return tmp
function code(a, b, c)
	tmp = 0.0
	if (b <= 4.2e-303)
		tmp = Float64(Float64(b / 3.0) * Float64(-2.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.2e-303)
		tmp = (b / 3.0) * (-2.0 / a);
	else
		tmp = (c * -0.5) / b;
	end
	tmp_2 = tmp;
end
code[a_, b_, c_] := If[LessEqual[b, 4.2e-303], N[(N[(b / 3.0), $MachinePrecision] * N[(-2.0 / a), $MachinePrecision]), $MachinePrecision], N[(N[(c * -0.5), $MachinePrecision] / b), $MachinePrecision]]
\begin{array}{l}

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

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


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

    1. Initial program 72.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{b \cdot -2}}{3 \cdot a} \]
    6. Simplified68.7%

      \[\leadsto \frac{\color{blue}{b \cdot -2}}{3 \cdot a} \]
    7. Step-by-step derivation
      1. times-frac68.6%

        \[\leadsto \color{blue}{\frac{b}{3} \cdot \frac{-2}{a}} \]
    8. Applied egg-rr68.6%

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

    if 4.2e-303 < b

    1. Initial program 32.2%

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \left(b - \color{blue}{\left(-1.5 \cdot \frac{c \cdot a}{b} + b\right)}\right) \cdot \frac{-0.3333333333333333}{a} \]
    5. Step-by-step derivation
      1. clear-num19.4%

        \[\leadsto \left(b - \left(-1.5 \cdot \frac{c \cdot a}{b} + b\right)\right) \cdot \color{blue}{\frac{1}{\frac{a}{-0.3333333333333333}}} \]
      2. inv-pow19.4%

        \[\leadsto \left(b - \left(-1.5 \cdot \frac{c \cdot a}{b} + b\right)\right) \cdot \color{blue}{{\left(\frac{a}{-0.3333333333333333}\right)}^{-1}} \]
    6. Applied egg-rr19.4%

      \[\leadsto \left(b - \left(-1.5 \cdot \frac{c \cdot a}{b} + b\right)\right) \cdot \color{blue}{{\left(\frac{a}{-0.3333333333333333}\right)}^{-1}} \]
    7. Step-by-step derivation
      1. unpow-119.4%

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

      \[\leadsto \left(b - \left(-1.5 \cdot \frac{c \cdot a}{b} + b\right)\right) \cdot \color{blue}{\frac{1}{\frac{a}{-0.3333333333333333}}} \]
    9. Taylor expanded in b around 0 67.2%

      \[\leadsto \color{blue}{-0.5 \cdot \frac{c}{b}} \]
    10. Step-by-step derivation
      1. *-commutative67.2%

        \[\leadsto \color{blue}{\frac{c}{b} \cdot -0.5} \]
      2. associate-*l/67.2%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq 4.2 \cdot 10^{-303}:\\ \;\;\;\;\frac{b}{3} \cdot \frac{-2}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{c \cdot -0.5}{b}\\ \end{array} \]

Alternative 9: 66.5% accurate, 12.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq 1.25 \cdot 10^{-301}:\\ \;\;\;\;\frac{b \cdot -2}{a \cdot 3}\\ \mathbf{else}:\\ \;\;\;\;\frac{c \cdot -0.5}{b}\\ \end{array} \end{array} \]
(FPCore (a b c)
 :precision binary64
 (if (<= b 1.25e-301) (/ (* b -2.0) (* a 3.0)) (/ (* c -0.5) b)))
double code(double a, double b, double c) {
	double tmp;
	if (b <= 1.25e-301) {
		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 <= 1.25d-301) 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 <= 1.25e-301) {
		tmp = (b * -2.0) / (a * 3.0);
	} else {
		tmp = (c * -0.5) / b;
	}
	return tmp;
}
def code(a, b, c):
	tmp = 0
	if b <= 1.25e-301:
		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 <= 1.25e-301)
		tmp = Float64(Float64(b * -2.0) / Float64(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 <= 1.25e-301)
		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, 1.25e-301], N[(N[(b * -2.0), $MachinePrecision] / N[(a * 3.0), $MachinePrecision]), $MachinePrecision], N[(N[(c * -0.5), $MachinePrecision] / b), $MachinePrecision]]
\begin{array}{l}

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

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


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

    1. Initial program 72.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{b \cdot -2}}{3 \cdot a} \]
    6. Simplified68.7%

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

    if 1.25000000000000003e-301 < b

    1. Initial program 32.2%

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \left(b - \color{blue}{\left(-1.5 \cdot \frac{c \cdot a}{b} + b\right)}\right) \cdot \frac{-0.3333333333333333}{a} \]
    5. Step-by-step derivation
      1. clear-num19.4%

        \[\leadsto \left(b - \left(-1.5 \cdot \frac{c \cdot a}{b} + b\right)\right) \cdot \color{blue}{\frac{1}{\frac{a}{-0.3333333333333333}}} \]
      2. inv-pow19.4%

        \[\leadsto \left(b - \left(-1.5 \cdot \frac{c \cdot a}{b} + b\right)\right) \cdot \color{blue}{{\left(\frac{a}{-0.3333333333333333}\right)}^{-1}} \]
    6. Applied egg-rr19.4%

      \[\leadsto \left(b - \left(-1.5 \cdot \frac{c \cdot a}{b} + b\right)\right) \cdot \color{blue}{{\left(\frac{a}{-0.3333333333333333}\right)}^{-1}} \]
    7. Step-by-step derivation
      1. unpow-119.4%

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

      \[\leadsto \left(b - \left(-1.5 \cdot \frac{c \cdot a}{b} + b\right)\right) \cdot \color{blue}{\frac{1}{\frac{a}{-0.3333333333333333}}} \]
    9. Taylor expanded in b around 0 67.2%

      \[\leadsto \color{blue}{-0.5 \cdot \frac{c}{b}} \]
    10. Step-by-step derivation
      1. *-commutative67.2%

        \[\leadsto \color{blue}{\frac{c}{b} \cdot -0.5} \]
      2. associate-*l/67.2%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq 1.25 \cdot 10^{-301}:\\ \;\;\;\;\frac{b \cdot -2}{a \cdot 3}\\ \mathbf{else}:\\ \;\;\;\;\frac{c \cdot -0.5}{b}\\ \end{array} \]

Alternative 10: 66.5% accurate, 16.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq 1.32 \cdot 10^{-303}:\\ \;\;\;\;\frac{b}{a} \cdot -0.6666666666666666\\ \mathbf{else}:\\ \;\;\;\;-0.5 \cdot \frac{c}{b}\\ \end{array} \end{array} \]
(FPCore (a b c)
 :precision binary64
 (if (<= b 1.32e-303) (* (/ b a) -0.6666666666666666) (* -0.5 (/ c b))))
double code(double a, double b, double c) {
	double tmp;
	if (b <= 1.32e-303) {
		tmp = (b / a) * -0.6666666666666666;
	} 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 <= 1.32d-303) then
        tmp = (b / a) * (-0.6666666666666666d0)
    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 <= 1.32e-303) {
		tmp = (b / a) * -0.6666666666666666;
	} else {
		tmp = -0.5 * (c / b);
	}
	return tmp;
}
def code(a, b, c):
	tmp = 0
	if b <= 1.32e-303:
		tmp = (b / a) * -0.6666666666666666
	else:
		tmp = -0.5 * (c / b)
	return tmp
function code(a, b, c)
	tmp = 0.0
	if (b <= 1.32e-303)
		tmp = Float64(Float64(b / a) * -0.6666666666666666);
	else
		tmp = Float64(-0.5 * Float64(c / b));
	end
	return tmp
end
function tmp_2 = code(a, b, c)
	tmp = 0.0;
	if (b <= 1.32e-303)
		tmp = (b / a) * -0.6666666666666666;
	else
		tmp = -0.5 * (c / b);
	end
	tmp_2 = tmp;
end
code[a_, b_, c_] := If[LessEqual[b, 1.32e-303], N[(N[(b / a), $MachinePrecision] * -0.6666666666666666), $MachinePrecision], N[(-0.5 * N[(c / b), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;b \leq 1.32 \cdot 10^{-303}:\\
\;\;\;\;\frac{b}{a} \cdot -0.6666666666666666\\

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


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

    1. Initial program 72.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{b}{a} \cdot -0.6666666666666666} \]
    6. Simplified68.5%

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

    if 1.32000000000000005e-303 < b

    1. Initial program 32.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq 1.32 \cdot 10^{-303}:\\ \;\;\;\;\frac{b}{a} \cdot -0.6666666666666666\\ \mathbf{else}:\\ \;\;\;\;-0.5 \cdot \frac{c}{b}\\ \end{array} \]

Alternative 11: 66.5% accurate, 16.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq 2.4 \cdot 10^{-303}:\\ \;\;\;\;\frac{b}{\frac{a}{-0.6666666666666666}}\\ \mathbf{else}:\\ \;\;\;\;-0.5 \cdot \frac{c}{b}\\ \end{array} \end{array} \]
(FPCore (a b c)
 :precision binary64
 (if (<= b 2.4e-303) (/ b (/ a -0.6666666666666666)) (* -0.5 (/ c b))))
double code(double a, double b, double c) {
	double tmp;
	if (b <= 2.4e-303) {
		tmp = b / (a / -0.6666666666666666);
	} 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 <= 2.4d-303) then
        tmp = b / (a / (-0.6666666666666666d0))
    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 <= 2.4e-303) {
		tmp = b / (a / -0.6666666666666666);
	} else {
		tmp = -0.5 * (c / b);
	}
	return tmp;
}
def code(a, b, c):
	tmp = 0
	if b <= 2.4e-303:
		tmp = b / (a / -0.6666666666666666)
	else:
		tmp = -0.5 * (c / b)
	return tmp
function code(a, b, c)
	tmp = 0.0
	if (b <= 2.4e-303)
		tmp = Float64(b / Float64(a / -0.6666666666666666));
	else
		tmp = Float64(-0.5 * Float64(c / b));
	end
	return tmp
end
function tmp_2 = code(a, b, c)
	tmp = 0.0;
	if (b <= 2.4e-303)
		tmp = b / (a / -0.6666666666666666);
	else
		tmp = -0.5 * (c / b);
	end
	tmp_2 = tmp;
end
code[a_, b_, c_] := If[LessEqual[b, 2.4e-303], N[(b / N[(a / -0.6666666666666666), $MachinePrecision]), $MachinePrecision], N[(-0.5 * N[(c / b), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;b \leq 2.4 \cdot 10^{-303}:\\
\;\;\;\;\frac{b}{\frac{a}{-0.6666666666666666}}\\

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


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

    1. Initial program 72.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{b}{a} \cdot -0.6666666666666666} \]
    6. Simplified68.5%

      \[\leadsto \color{blue}{\frac{b}{a} \cdot -0.6666666666666666} \]
    7. Taylor expanded in b around 0 68.5%

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

        \[\leadsto \color{blue}{\frac{b}{a} \cdot -0.6666666666666666} \]
      2. associate-/r/68.6%

        \[\leadsto \color{blue}{\frac{b}{\frac{a}{-0.6666666666666666}}} \]
    9. Simplified68.6%

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

    if 2.4000000000000001e-303 < b

    1. Initial program 32.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq 2.4 \cdot 10^{-303}:\\ \;\;\;\;\frac{b}{\frac{a}{-0.6666666666666666}}\\ \mathbf{else}:\\ \;\;\;\;-0.5 \cdot \frac{c}{b}\\ \end{array} \]

Alternative 12: 66.5% accurate, 16.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq 1.32 \cdot 10^{-303}:\\ \;\;\;\;\frac{b}{\frac{a}{-0.6666666666666666}}\\ \mathbf{else}:\\ \;\;\;\;\frac{c \cdot -0.5}{b}\\ \end{array} \end{array} \]
(FPCore (a b c)
 :precision binary64
 (if (<= b 1.32e-303) (/ b (/ a -0.6666666666666666)) (/ (* c -0.5) b)))
double code(double a, double b, double c) {
	double tmp;
	if (b <= 1.32e-303) {
		tmp = b / (a / -0.6666666666666666);
	} 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 <= 1.32d-303) then
        tmp = b / (a / (-0.6666666666666666d0))
    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 <= 1.32e-303) {
		tmp = b / (a / -0.6666666666666666);
	} else {
		tmp = (c * -0.5) / b;
	}
	return tmp;
}
def code(a, b, c):
	tmp = 0
	if b <= 1.32e-303:
		tmp = b / (a / -0.6666666666666666)
	else:
		tmp = (c * -0.5) / b
	return tmp
function code(a, b, c)
	tmp = 0.0
	if (b <= 1.32e-303)
		tmp = Float64(b / Float64(a / -0.6666666666666666));
	else
		tmp = Float64(Float64(c * -0.5) / b);
	end
	return tmp
end
function tmp_2 = code(a, b, c)
	tmp = 0.0;
	if (b <= 1.32e-303)
		tmp = b / (a / -0.6666666666666666);
	else
		tmp = (c * -0.5) / b;
	end
	tmp_2 = tmp;
end
code[a_, b_, c_] := If[LessEqual[b, 1.32e-303], N[(b / N[(a / -0.6666666666666666), $MachinePrecision]), $MachinePrecision], N[(N[(c * -0.5), $MachinePrecision] / b), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;b \leq 1.32 \cdot 10^{-303}:\\
\;\;\;\;\frac{b}{\frac{a}{-0.6666666666666666}}\\

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


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

    1. Initial program 72.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{b}{a} \cdot -0.6666666666666666} \]
    6. Simplified68.5%

      \[\leadsto \color{blue}{\frac{b}{a} \cdot -0.6666666666666666} \]
    7. Taylor expanded in b around 0 68.5%

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

        \[\leadsto \color{blue}{\frac{b}{a} \cdot -0.6666666666666666} \]
      2. associate-/r/68.6%

        \[\leadsto \color{blue}{\frac{b}{\frac{a}{-0.6666666666666666}}} \]
    9. Simplified68.6%

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

    if 1.32000000000000005e-303 < b

    1. Initial program 32.2%

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \left(b - \color{blue}{\left(-1.5 \cdot \frac{c \cdot a}{b} + b\right)}\right) \cdot \frac{-0.3333333333333333}{a} \]
    5. Step-by-step derivation
      1. clear-num19.4%

        \[\leadsto \left(b - \left(-1.5 \cdot \frac{c \cdot a}{b} + b\right)\right) \cdot \color{blue}{\frac{1}{\frac{a}{-0.3333333333333333}}} \]
      2. inv-pow19.4%

        \[\leadsto \left(b - \left(-1.5 \cdot \frac{c \cdot a}{b} + b\right)\right) \cdot \color{blue}{{\left(\frac{a}{-0.3333333333333333}\right)}^{-1}} \]
    6. Applied egg-rr19.4%

      \[\leadsto \left(b - \left(-1.5 \cdot \frac{c \cdot a}{b} + b\right)\right) \cdot \color{blue}{{\left(\frac{a}{-0.3333333333333333}\right)}^{-1}} \]
    7. Step-by-step derivation
      1. unpow-119.4%

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

      \[\leadsto \left(b - \left(-1.5 \cdot \frac{c \cdot a}{b} + b\right)\right) \cdot \color{blue}{\frac{1}{\frac{a}{-0.3333333333333333}}} \]
    9. Taylor expanded in b around 0 67.2%

      \[\leadsto \color{blue}{-0.5 \cdot \frac{c}{b}} \]
    10. Step-by-step derivation
      1. *-commutative67.2%

        \[\leadsto \color{blue}{\frac{c}{b} \cdot -0.5} \]
      2. associate-*l/67.2%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq 1.32 \cdot 10^{-303}:\\ \;\;\;\;\frac{b}{\frac{a}{-0.6666666666666666}}\\ \mathbf{else}:\\ \;\;\;\;\frac{c \cdot -0.5}{b}\\ \end{array} \]

Alternative 13: 34.5% accurate, 23.2× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Reproduce

?
herbie shell --seed 2023182 
(FPCore (a b c)
  :name "Cubic critical"
  :precision binary64
  (/ (+ (- b) (sqrt (- (* b b) (* (* 3.0 a) c)))) (* 3.0 a)))