Cubic critical

Percentage Accurate: 51.6% → 85.4%
Time: 15.4s
Alternatives: 14
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 14 alternatives:

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

Initial Program: 51.6% accurate, 1.0× speedup?

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

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

Alternative 1: 85.4% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq -3.2 \cdot 10^{+143}:\\ \;\;\;\;\frac{-2}{\frac{a \cdot 3}{b}}\\ \mathbf{elif}\;b \leq 1.95 \cdot 10^{-62}:\\ \;\;\;\;\frac{\sqrt{b \cdot b - \left(a \cdot 3\right) \cdot c} - 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+143)
   (/ -2.0 (/ (* a 3.0) b))
   (if (<= b 1.95e-62)
     (/ (- (sqrt (- (* b b) (* (* a 3.0) c))) b) (* a 3.0))
     (/ (* c -0.5) b))))
double code(double a, double b, double c) {
	double tmp;
	if (b <= -3.2e+143) {
		tmp = -2.0 / ((a * 3.0) / b);
	} else if (b <= 1.95e-62) {
		tmp = (sqrt(((b * b) - ((a * 3.0) * c))) - b) / (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 <= (-3.2d+143)) then
        tmp = (-2.0d0) / ((a * 3.0d0) / b)
    else if (b <= 1.95d-62) then
        tmp = (sqrt(((b * b) - ((a * 3.0d0) * c))) - b) / (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 <= -3.2e+143) {
		tmp = -2.0 / ((a * 3.0) / b);
	} else if (b <= 1.95e-62) {
		tmp = (Math.sqrt(((b * b) - ((a * 3.0) * c))) - b) / (a * 3.0);
	} else {
		tmp = (c * -0.5) / b;
	}
	return tmp;
}
def code(a, b, c):
	tmp = 0
	if b <= -3.2e+143:
		tmp = -2.0 / ((a * 3.0) / b)
	elif b <= 1.95e-62:
		tmp = (math.sqrt(((b * b) - ((a * 3.0) * c))) - b) / (a * 3.0)
	else:
		tmp = (c * -0.5) / b
	return tmp
function code(a, b, c)
	tmp = 0.0
	if (b <= -3.2e+143)
		tmp = Float64(-2.0 / Float64(Float64(a * 3.0) / b));
	elseif (b <= 1.95e-62)
		tmp = Float64(Float64(sqrt(Float64(Float64(b * b) - Float64(Float64(a * 3.0) * c))) - b) / 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 <= -3.2e+143)
		tmp = -2.0 / ((a * 3.0) / b);
	elseif (b <= 1.95e-62)
		tmp = (sqrt(((b * b) - ((a * 3.0) * c))) - b) / (a * 3.0);
	else
		tmp = (c * -0.5) / b;
	end
	tmp_2 = tmp;
end
code[a_, b_, c_] := If[LessEqual[b, -3.2e+143], N[(-2.0 / N[(N[(a * 3.0), $MachinePrecision] / b), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 1.95e-62], N[(N[(N[Sqrt[N[(N[(b * b), $MachinePrecision] - N[(N[(a * 3.0), $MachinePrecision] * c), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision] / N[(a * 3.0), $MachinePrecision]), $MachinePrecision], N[(N[(c * -0.5), $MachinePrecision] / b), $MachinePrecision]]]
\begin{array}{l}

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

\mathbf{elif}\;b \leq 1.95 \cdot 10^{-62}:\\
\;\;\;\;\frac{\sqrt{b \cdot b - \left(a \cdot 3\right) \cdot c} - 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.20000000000000016e143

    1. Initial program 48.7%

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

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

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

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

      \[\leadsto \color{blue}{\left(2 \cdot b\right)} \cdot \frac{\frac{1}{a}}{-3} \]
    7. Step-by-step derivation
      1. add-exp-log46.0%

        \[\leadsto \color{blue}{e^{\log \left(\left(2 \cdot b\right) \cdot \frac{\frac{1}{a}}{-3}\right)}} \]
      2. *-commutative46.0%

        \[\leadsto e^{\log \left(\color{blue}{\left(b \cdot 2\right)} \cdot \frac{\frac{1}{a}}{-3}\right)} \]
      3. div-inv46.0%

        \[\leadsto e^{\log \left(\left(b \cdot 2\right) \cdot \color{blue}{\left(\frac{1}{a} \cdot \frac{1}{-3}\right)}\right)} \]
      4. metadata-eval46.0%

        \[\leadsto e^{\log \left(\left(b \cdot 2\right) \cdot \left(\frac{1}{a} \cdot \color{blue}{-0.3333333333333333}\right)\right)} \]
    8. Applied egg-rr46.0%

      \[\leadsto \color{blue}{e^{\log \left(\left(b \cdot 2\right) \cdot \left(\frac{1}{a} \cdot -0.3333333333333333\right)\right)}} \]
    9. Step-by-step derivation
      1. rem-exp-log94.5%

        \[\leadsto \color{blue}{\left(b \cdot 2\right) \cdot \left(\frac{1}{a} \cdot -0.3333333333333333\right)} \]
      2. associate-*r*94.4%

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

        \[\leadsto \left(\left(b \cdot \color{blue}{\left(--2\right)}\right) \cdot \frac{1}{a}\right) \cdot -0.3333333333333333 \]
      4. distribute-rgt-neg-in94.4%

        \[\leadsto \left(\color{blue}{\left(-b \cdot -2\right)} \cdot \frac{1}{a}\right) \cdot -0.3333333333333333 \]
      5. distribute-lft-neg-in94.4%

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

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

        \[\leadsto \left(-\frac{b \cdot -2}{a}\right) \cdot \color{blue}{\frac{1}{-3}} \]
      8. div-inv94.8%

        \[\leadsto \color{blue}{\frac{-\frac{b \cdot -2}{a}}{-3}} \]
      9. metadata-eval94.8%

        \[\leadsto \frac{-\frac{b \cdot -2}{a}}{\color{blue}{-3}} \]
      10. frac-2neg94.8%

        \[\leadsto \color{blue}{\frac{\frac{b \cdot -2}{a}}{3}} \]
      11. associate-/l/94.8%

        \[\leadsto \color{blue}{\frac{b \cdot -2}{3 \cdot a}} \]
      12. *-commutative94.8%

        \[\leadsto \frac{\color{blue}{-2 \cdot b}}{3 \cdot a} \]
      13. associate-/l*94.8%

        \[\leadsto \color{blue}{\frac{-2}{\frac{3 \cdot a}{b}}} \]
      14. *-commutative94.8%

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

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

    if -3.20000000000000016e143 < b < 1.9500000000000002e-62

    1. Initial program 85.5%

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

    if 1.9500000000000002e-62 < b

    1. Initial program 20.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{-0.5 \cdot c}{b}} \]
    7. Simplified83.0%

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

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

Alternative 2: 80.4% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq -2.9 \cdot 10^{-58}:\\
\;\;\;\;\frac{\left(\frac{a}{\frac{b}{c}} \cdot 1.5 - b\right) - b}{a \cdot 3}\\

\mathbf{elif}\;b \leq 3.6 \cdot 10^{-62}:\\
\;\;\;\;0.3333333333333333 \cdot \frac{b + \sqrt{-3 \cdot \left(a \cdot c\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.8999999999999999e-58

    1. Initial program 73.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.8999999999999999e-58 < b < 3.6e-62

    1. Initial program 80.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto e^{\mathsf{log1p}\left(\frac{\color{blue}{\sqrt{b} \cdot \sqrt{b}} + \sqrt{a \cdot -3} \cdot \sqrt{c}}{3 \cdot a}\right)} - 1 \]
      7. add-sqr-sqrt1.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.6e-62 < b

    1. Initial program 20.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{-0.5 \cdot c}{b}} \]
    7. Simplified83.0%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -2.9 \cdot 10^{-58}:\\ \;\;\;\;\frac{\left(\frac{a}{\frac{b}{c}} \cdot 1.5 - b\right) - b}{a \cdot 3}\\ \mathbf{elif}\;b \leq 3.6 \cdot 10^{-62}:\\ \;\;\;\;0.3333333333333333 \cdot \frac{b + \sqrt{-3 \cdot \left(a \cdot c\right)}}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{c \cdot -0.5}{b}\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 80.4% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq -2.6 \cdot 10^{-58}:\\
\;\;\;\;\frac{\left(\frac{a}{\frac{b}{c}} \cdot 1.5 - b\right) - b}{a \cdot 3}\\

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

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


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

    1. Initial program 73.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.60000000000000007e-58 < b < 1e-59

    1. Initial program 80.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto e^{\mathsf{log1p}\left(\frac{\color{blue}{\sqrt{b} \cdot \sqrt{b}} + \sqrt{a \cdot -3} \cdot \sqrt{c}}{3 \cdot a}\right)} - 1 \]
      7. add-sqr-sqrt1.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1e-59 < b

    1. Initial program 20.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{-0.5 \cdot c}{b}} \]
    7. Simplified83.0%

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

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

Alternative 4: 80.5% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq -2.8 \cdot 10^{-58}:\\ \;\;\;\;\frac{\left(\frac{a}{\frac{b}{c}} \cdot 1.5 - b\right) - b}{a \cdot 3}\\ \mathbf{elif}\;b \leq 7 \cdot 10^{-60}:\\ \;\;\;\;0.3333333333333333 \cdot \frac{b + \sqrt{c \cdot \left(a \cdot -3\right)}}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{c \cdot -0.5}{b}\\ \end{array} \end{array} \]
(FPCore (a b c)
 :precision binary64
 (if (<= b -2.8e-58)
   (/ (- (- (* (/ a (/ b c)) 1.5) b) b) (* a 3.0))
   (if (<= b 7e-60)
     (* 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.8e-58) {
		tmp = ((((a / (b / c)) * 1.5) - b) - b) / (a * 3.0);
	} else if (b <= 7e-60) {
		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.8d-58)) then
        tmp = ((((a / (b / c)) * 1.5d0) - b) - b) / (a * 3.0d0)
    else if (b <= 7d-60) 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.8e-58) {
		tmp = ((((a / (b / c)) * 1.5) - b) - b) / (a * 3.0);
	} else if (b <= 7e-60) {
		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.8e-58:
		tmp = ((((a / (b / c)) * 1.5) - b) - b) / (a * 3.0)
	elif b <= 7e-60:
		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.8e-58)
		tmp = Float64(Float64(Float64(Float64(Float64(a / Float64(b / c)) * 1.5) - b) - b) / Float64(a * 3.0));
	elseif (b <= 7e-60)
		tmp = Float64(0.3333333333333333 * Float64(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.8e-58)
		tmp = ((((a / (b / c)) * 1.5) - b) - b) / (a * 3.0);
	elseif (b <= 7e-60)
		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.8e-58], N[(N[(N[(N[(N[(a / N[(b / c), $MachinePrecision]), $MachinePrecision] * 1.5), $MachinePrecision] - b), $MachinePrecision] - b), $MachinePrecision] / N[(a * 3.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 7e-60], N[(0.3333333333333333 * N[(N[(b + N[Sqrt[N[(c * N[(a * -3.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], N[(N[(c * -0.5), $MachinePrecision] / b), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;b \leq -2.8 \cdot 10^{-58}:\\
\;\;\;\;\frac{\left(\frac{a}{\frac{b}{c}} \cdot 1.5 - b\right) - b}{a \cdot 3}\\

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

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


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

    1. Initial program 73.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.8000000000000001e-58 < b < 6.99999999999999952e-60

    1. Initial program 80.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto 0.3333333333333333 \cdot \frac{\color{blue}{\sqrt{-b} \cdot \sqrt{-b}} + \sqrt{a \cdot -3} \cdot \sqrt{c}}{a} \]
      5. sqrt-unprod37.8%

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

        \[\leadsto 0.3333333333333333 \cdot \frac{\sqrt{\color{blue}{b \cdot b}} + \sqrt{a \cdot -3} \cdot \sqrt{c}}{a} \]
      7. sqrt-unprod17.5%

        \[\leadsto 0.3333333333333333 \cdot \frac{\color{blue}{\sqrt{b} \cdot \sqrt{b}} + \sqrt{a \cdot -3} \cdot \sqrt{c}}{a} \]
      8. add-sqr-sqrt37.6%

        \[\leadsto 0.3333333333333333 \cdot \frac{\color{blue}{b} + \sqrt{a \cdot -3} \cdot \sqrt{c}}{a} \]
      9. sqrt-unprod70.7%

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

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

    if 6.99999999999999952e-60 < b

    1. Initial program 20.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{-0.5 \cdot c}{b}} \]
    7. Simplified83.0%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -2.8 \cdot 10^{-58}:\\ \;\;\;\;\frac{\left(\frac{a}{\frac{b}{c}} \cdot 1.5 - b\right) - b}{a \cdot 3}\\ \mathbf{elif}\;b \leq 7 \cdot 10^{-60}:\\ \;\;\;\;0.3333333333333333 \cdot \frac{b + \sqrt{c \cdot \left(a \cdot -3\right)}}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{c \cdot -0.5}{b}\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 80.9% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq -2.9 \cdot 10^{-58}:\\ \;\;\;\;\frac{\left(\frac{a}{\frac{b}{c}} \cdot 1.5 - b\right) - b}{a \cdot 3}\\ \mathbf{elif}\;b \leq 5.5 \cdot 10^{-61}:\\ \;\;\;\;\frac{\sqrt{a \cdot \left(c \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.9e-58)
   (/ (- (- (* (/ a (/ b c)) 1.5) b) b) (* a 3.0))
   (if (<= b 5.5e-61)
     (/ (- (sqrt (* a (* c -3.0))) b) (* a 3.0))
     (/ (* c -0.5) b))))
double code(double a, double b, double c) {
	double tmp;
	if (b <= -2.9e-58) {
		tmp = ((((a / (b / c)) * 1.5) - b) - b) / (a * 3.0);
	} else if (b <= 5.5e-61) {
		tmp = (sqrt((a * (c * -3.0))) - b) / (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 <= (-2.9d-58)) then
        tmp = ((((a / (b / c)) * 1.5d0) - b) - b) / (a * 3.0d0)
    else if (b <= 5.5d-61) then
        tmp = (sqrt((a * (c * (-3.0d0)))) - b) / (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 <= -2.9e-58) {
		tmp = ((((a / (b / c)) * 1.5) - b) - b) / (a * 3.0);
	} else if (b <= 5.5e-61) {
		tmp = (Math.sqrt((a * (c * -3.0))) - b) / (a * 3.0);
	} else {
		tmp = (c * -0.5) / b;
	}
	return tmp;
}
def code(a, b, c):
	tmp = 0
	if b <= -2.9e-58:
		tmp = ((((a / (b / c)) * 1.5) - b) - b) / (a * 3.0)
	elif b <= 5.5e-61:
		tmp = (math.sqrt((a * (c * -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.9e-58)
		tmp = Float64(Float64(Float64(Float64(Float64(a / Float64(b / c)) * 1.5) - b) - b) / Float64(a * 3.0));
	elseif (b <= 5.5e-61)
		tmp = Float64(Float64(sqrt(Float64(a * Float64(c * -3.0))) - b) / 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 <= -2.9e-58)
		tmp = ((((a / (b / c)) * 1.5) - b) - b) / (a * 3.0);
	elseif (b <= 5.5e-61)
		tmp = (sqrt((a * (c * -3.0))) - b) / (a * 3.0);
	else
		tmp = (c * -0.5) / b;
	end
	tmp_2 = tmp;
end
code[a_, b_, c_] := If[LessEqual[b, -2.9e-58], N[(N[(N[(N[(N[(a / N[(b / c), $MachinePrecision]), $MachinePrecision] * 1.5), $MachinePrecision] - b), $MachinePrecision] - b), $MachinePrecision] / N[(a * 3.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 5.5e-61], N[(N[(N[Sqrt[N[(a * N[(c * -3.0), $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.9 \cdot 10^{-58}:\\
\;\;\;\;\frac{\left(\frac{a}{\frac{b}{c}} \cdot 1.5 - b\right) - b}{a \cdot 3}\\

\mathbf{elif}\;b \leq 5.5 \cdot 10^{-61}:\\
\;\;\;\;\frac{\sqrt{a \cdot \left(c \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.8999999999999999e-58

    1. Initial program 73.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.8999999999999999e-58 < b < 5.4999999999999997e-61

    1. Initial program 80.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 5.4999999999999997e-61 < b

    1. Initial program 20.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{-0.5 \cdot c}{b}} \]
    7. Simplified83.0%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -2.9 \cdot 10^{-58}:\\ \;\;\;\;\frac{\left(\frac{a}{\frac{b}{c}} \cdot 1.5 - b\right) - b}{a \cdot 3}\\ \mathbf{elif}\;b \leq 5.5 \cdot 10^{-61}:\\ \;\;\;\;\frac{\sqrt{a \cdot \left(c \cdot -3\right)} - b}{a \cdot 3}\\ \mathbf{else}:\\ \;\;\;\;\frac{c \cdot -0.5}{b}\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 80.9% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq -2.4 \cdot 10^{-58}:\\ \;\;\;\;\frac{\left(\frac{a}{\frac{b}{c}} \cdot 1.5 - b\right) - b}{a \cdot 3}\\ \mathbf{elif}\;b \leq 7.8 \cdot 10^{-62}:\\ \;\;\;\;\frac{\sqrt{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.4e-58)
   (/ (- (- (* (/ a (/ b c)) 1.5) b) b) (* a 3.0))
   (if (<= b 7.8e-62)
     (/ (- (sqrt (* 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.4e-58) {
		tmp = ((((a / (b / c)) * 1.5) - b) - b) / (a * 3.0);
	} else if (b <= 7.8e-62) {
		tmp = (sqrt((c * (a * -3.0))) - b) / (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 <= (-2.4d-58)) then
        tmp = ((((a / (b / c)) * 1.5d0) - b) - b) / (a * 3.0d0)
    else if (b <= 7.8d-62) then
        tmp = (sqrt((c * (a * (-3.0d0)))) - b) / (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 <= -2.4e-58) {
		tmp = ((((a / (b / c)) * 1.5) - b) - b) / (a * 3.0);
	} else if (b <= 7.8e-62) {
		tmp = (Math.sqrt((c * (a * -3.0))) - b) / (a * 3.0);
	} else {
		tmp = (c * -0.5) / b;
	}
	return tmp;
}
def code(a, b, c):
	tmp = 0
	if b <= -2.4e-58:
		tmp = ((((a / (b / c)) * 1.5) - b) - b) / (a * 3.0)
	elif b <= 7.8e-62:
		tmp = (math.sqrt((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.4e-58)
		tmp = Float64(Float64(Float64(Float64(Float64(a / Float64(b / c)) * 1.5) - b) - b) / Float64(a * 3.0));
	elseif (b <= 7.8e-62)
		tmp = Float64(Float64(sqrt(Float64(c * Float64(a * -3.0))) - b) / 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 <= -2.4e-58)
		tmp = ((((a / (b / c)) * 1.5) - b) - b) / (a * 3.0);
	elseif (b <= 7.8e-62)
		tmp = (sqrt((c * (a * -3.0))) - b) / (a * 3.0);
	else
		tmp = (c * -0.5) / b;
	end
	tmp_2 = tmp;
end
code[a_, b_, c_] := If[LessEqual[b, -2.4e-58], N[(N[(N[(N[(N[(a / N[(b / c), $MachinePrecision]), $MachinePrecision] * 1.5), $MachinePrecision] - b), $MachinePrecision] - b), $MachinePrecision] / N[(a * 3.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 7.8e-62], N[(N[(N[Sqrt[N[(c * N[(a * -3.0), $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.4 \cdot 10^{-58}:\\
\;\;\;\;\frac{\left(\frac{a}{\frac{b}{c}} \cdot 1.5 - b\right) - b}{a \cdot 3}\\

\mathbf{elif}\;b \leq 7.8 \cdot 10^{-62}:\\
\;\;\;\;\frac{\sqrt{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.4000000000000001e-58

    1. Initial program 73.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.4000000000000001e-58 < b < 7.8000000000000007e-62

    1. Initial program 80.9%

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

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

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

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

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

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

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

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

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

    if 7.8000000000000007e-62 < b

    1. Initial program 20.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{-0.5 \cdot c}{b}} \]
    7. Simplified83.0%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -2.4 \cdot 10^{-58}:\\ \;\;\;\;\frac{\left(\frac{a}{\frac{b}{c}} \cdot 1.5 - b\right) - b}{a \cdot 3}\\ \mathbf{elif}\;b \leq 7.8 \cdot 10^{-62}:\\ \;\;\;\;\frac{\sqrt{c \cdot \left(a \cdot -3\right)} - b}{a \cdot 3}\\ \mathbf{else}:\\ \;\;\;\;\frac{c \cdot -0.5}{b}\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 68.2% accurate, 12.8× speedup?

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

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

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


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

    1. Initial program 78.4%

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

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

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

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

      \[\leadsto \color{blue}{\left(2 \cdot b\right)} \cdot \frac{\frac{1}{a}}{-3} \]
    7. Step-by-step derivation
      1. add-exp-log28.0%

        \[\leadsto \color{blue}{e^{\log \left(\left(2 \cdot b\right) \cdot \frac{\frac{1}{a}}{-3}\right)}} \]
      2. *-commutative28.0%

        \[\leadsto e^{\log \left(\color{blue}{\left(b \cdot 2\right)} \cdot \frac{\frac{1}{a}}{-3}\right)} \]
      3. div-inv28.0%

        \[\leadsto e^{\log \left(\left(b \cdot 2\right) \cdot \color{blue}{\left(\frac{1}{a} \cdot \frac{1}{-3}\right)}\right)} \]
      4. metadata-eval28.0%

        \[\leadsto e^{\log \left(\left(b \cdot 2\right) \cdot \left(\frac{1}{a} \cdot \color{blue}{-0.3333333333333333}\right)\right)} \]
    8. Applied egg-rr28.0%

      \[\leadsto \color{blue}{e^{\log \left(\left(b \cdot 2\right) \cdot \left(\frac{1}{a} \cdot -0.3333333333333333\right)\right)}} \]
    9. Step-by-step derivation
      1. rem-exp-log66.2%

        \[\leadsto \color{blue}{\left(b \cdot 2\right) \cdot \left(\frac{1}{a} \cdot -0.3333333333333333\right)} \]
      2. associate-*r*66.2%

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

        \[\leadsto \left(\left(b \cdot \color{blue}{\left(--2\right)}\right) \cdot \frac{1}{a}\right) \cdot -0.3333333333333333 \]
      4. distribute-rgt-neg-in66.2%

        \[\leadsto \left(\color{blue}{\left(-b \cdot -2\right)} \cdot \frac{1}{a}\right) \cdot -0.3333333333333333 \]
      5. distribute-lft-neg-in66.2%

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

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

        \[\leadsto \left(-\frac{b \cdot -2}{a}\right) \cdot \color{blue}{\frac{1}{-3}} \]
      8. div-inv66.4%

        \[\leadsto \color{blue}{\frac{-\frac{b \cdot -2}{a}}{-3}} \]
      9. metadata-eval66.4%

        \[\leadsto \frac{-\frac{b \cdot -2}{a}}{\color{blue}{-3}} \]
      10. frac-2neg66.4%

        \[\leadsto \color{blue}{\frac{\frac{b \cdot -2}{a}}{3}} \]
      11. associate-/l/66.4%

        \[\leadsto \color{blue}{\frac{b \cdot -2}{3 \cdot a}} \]
      12. *-commutative66.4%

        \[\leadsto \frac{\color{blue}{-2 \cdot b}}{3 \cdot a} \]
      13. associate-/l*66.4%

        \[\leadsto \color{blue}{\frac{-2}{\frac{3 \cdot a}{b}}} \]
      14. *-commutative66.4%

        \[\leadsto \frac{-2}{\frac{\color{blue}{a \cdot 3}}{b}} \]
    10. Applied egg-rr66.4%

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

    if -4.999999999999985e-310 < b

    1. Initial program 31.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{-0.5 \cdot c}{b}} \]
    7. Simplified68.0%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -5 \cdot 10^{-310}:\\ \;\;\;\;\frac{-2}{\frac{a \cdot 3}{b}}\\ \mathbf{else}:\\ \;\;\;\;\frac{c \cdot -0.5}{b}\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 68.2% accurate, 12.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq 2 \cdot 10^{-309}:\\ \;\;\;\;\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 2e-309) (/ (* b -2.0) (* a 3.0)) (/ (* c -0.5) b)))
double code(double a, double b, double c) {
	double tmp;
	if (b <= 2e-309) {
		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 <= 2d-309) 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 <= 2e-309) {
		tmp = (b * -2.0) / (a * 3.0);
	} else {
		tmp = (c * -0.5) / b;
	}
	return tmp;
}
def code(a, b, c):
	tmp = 0
	if b <= 2e-309:
		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 <= 2e-309)
		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 <= 2e-309)
		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, 2e-309], 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 2 \cdot 10^{-309}:\\
\;\;\;\;\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.9999999999999988e-309

    1. Initial program 78.4%

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

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

        \[\leadsto \frac{\color{blue}{b \cdot -2}}{3 \cdot a} \]
    5. Simplified66.4%

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

    if 1.9999999999999988e-309 < b

    1. Initial program 31.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{-0.5 \cdot c}{b}} \]
    7. Simplified68.0%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq 2 \cdot 10^{-309}:\\ \;\;\;\;\frac{b \cdot -2}{a \cdot 3}\\ \mathbf{else}:\\ \;\;\;\;\frac{c \cdot -0.5}{b}\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 48.2% accurate, 16.4× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq -5 \cdot 10^{-310}:\\
\;\;\;\;\frac{b}{a} \cdot -0.3333333333333333\\

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


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

    1. Initial program 78.4%

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

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

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

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

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

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

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

    if -4.999999999999985e-310 < b

    1. Initial program 31.9%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -5 \cdot 10^{-310}:\\ \;\;\;\;\frac{b}{a} \cdot -0.3333333333333333\\ \mathbf{else}:\\ \;\;\;\;-0.5 \cdot \frac{c}{b}\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 68.2% accurate, 16.4× speedup?

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

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

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


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

    1. Initial program 78.4%

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

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

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

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

      \[\leadsto \color{blue}{\left(2 \cdot b\right)} \cdot \frac{\frac{1}{a}}{-3} \]
    7. Step-by-step derivation
      1. expm1-log1p-u35.0%

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

        \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\left(2 \cdot b\right) \cdot \frac{\frac{1}{a}}{-3}\right)} - 1} \]
      3. *-commutative26.7%

        \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{\left(b \cdot 2\right)} \cdot \frac{\frac{1}{a}}{-3}\right)} - 1 \]
      4. div-inv26.7%

        \[\leadsto e^{\mathsf{log1p}\left(\left(b \cdot 2\right) \cdot \color{blue}{\left(\frac{1}{a} \cdot \frac{1}{-3}\right)}\right)} - 1 \]
      5. metadata-eval26.7%

        \[\leadsto e^{\mathsf{log1p}\left(\left(b \cdot 2\right) \cdot \left(\frac{1}{a} \cdot \color{blue}{-0.3333333333333333}\right)\right)} - 1 \]
    8. Applied egg-rr26.7%

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\left(b \cdot 2\right) \cdot \left(\frac{1}{a} \cdot -0.3333333333333333\right)\right)} - 1} \]
    9. Step-by-step derivation
      1. expm1-def35.0%

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

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

        \[\leadsto \color{blue}{b \cdot \left(2 \cdot \left(\frac{1}{a} \cdot -0.3333333333333333\right)\right)} \]
      4. associate-*l/66.2%

        \[\leadsto b \cdot \left(2 \cdot \color{blue}{\frac{1 \cdot -0.3333333333333333}{a}}\right) \]
      5. metadata-eval66.2%

        \[\leadsto b \cdot \left(2 \cdot \frac{\color{blue}{-0.3333333333333333}}{a}\right) \]
      6. associate-*r/66.2%

        \[\leadsto b \cdot \color{blue}{\frac{2 \cdot -0.3333333333333333}{a}} \]
      7. metadata-eval66.2%

        \[\leadsto b \cdot \frac{\color{blue}{-0.6666666666666666}}{a} \]
    10. Simplified66.2%

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

    if -4.999999999999985e-310 < b

    1. Initial program 31.9%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -5 \cdot 10^{-310}:\\ \;\;\;\;b \cdot \frac{-0.6666666666666666}{a}\\ \mathbf{else}:\\ \;\;\;\;-0.5 \cdot \frac{c}{b}\\ \end{array} \]
  5. Add Preprocessing

Alternative 11: 68.2% accurate, 16.4× speedup?

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

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

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


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

    1. Initial program 78.4%

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

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

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

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

    if -4.999999999999985e-310 < b

    1. Initial program 31.9%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -5 \cdot 10^{-310}:\\ \;\;\;\;-0.6666666666666666 \cdot \frac{b}{a}\\ \mathbf{else}:\\ \;\;\;\;-0.5 \cdot \frac{c}{b}\\ \end{array} \]
  5. Add Preprocessing

Alternative 12: 68.3% accurate, 16.4× speedup?

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

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

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


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

    1. Initial program 78.4%

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

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

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

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

    if -4.999999999999985e-310 < b

    1. Initial program 31.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{-0.5 \cdot c}{b}} \]
    7. Simplified68.0%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -5 \cdot 10^{-310}:\\ \;\;\;\;-0.6666666666666666 \cdot \frac{b}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{c \cdot -0.5}{b}\\ \end{array} \]
  5. Add Preprocessing

Alternative 13: 68.3% accurate, 16.4× speedup?

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

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

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


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

    1. Initial program 78.4%

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

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

        \[\leadsto \color{blue}{\frac{b}{a} \cdot -0.6666666666666666} \]
      2. associate-*l/66.3%

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

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

    if -4.999999999999985e-310 < b

    1. Initial program 31.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{-0.5 \cdot c}{b}} \]
    7. Simplified68.0%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -5 \cdot 10^{-310}:\\ \;\;\;\;\frac{b \cdot -0.6666666666666666}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{c \cdot -0.5}{b}\\ \end{array} \]
  5. Add Preprocessing

Alternative 14: 35.2% 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 54.6%

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

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

    \[\leadsto -0.5 \cdot \frac{c}{b} \]
  5. Add Preprocessing

Reproduce

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