Cubic critical

Percentage Accurate: 52.2% → 86.0%
Time: 15.4s
Alternatives: 9
Speedup: 11.6×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 9 alternatives:

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

Initial Program: 52.2% 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: 86.0% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq -1.12 \cdot 10^{+132}:\\ \;\;\;\;\frac{\frac{b}{-1.5}}{a}\\ \mathbf{elif}\;b \leq 2.7 \cdot 10^{-39}:\\ \;\;\;\;\frac{\sqrt{b \cdot b + c \cdot \left(a \cdot -3\right)} - b}{a \cdot 3}\\ \mathbf{else}:\\ \;\;\;\;\frac{c \cdot -0.5}{b}\\ \end{array} \end{array} \]
(FPCore (a b c)
 :precision binary64
 (if (<= b -1.12e+132)
   (/ (/ b -1.5) a)
   (if (<= b 2.7e-39)
     (/ (- (sqrt (+ (* b b) (* c (* a -3.0)))) b) (* a 3.0))
     (/ (* c -0.5) b))))
double code(double a, double b, double c) {
	double tmp;
	if (b <= -1.12e+132) {
		tmp = (b / -1.5) / a;
	} else if (b <= 2.7e-39) {
		tmp = (sqrt(((b * b) + (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 <= (-1.12d+132)) then
        tmp = (b / (-1.5d0)) / a
    else if (b <= 2.7d-39) then
        tmp = (sqrt(((b * b) + (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 <= -1.12e+132) {
		tmp = (b / -1.5) / a;
	} else if (b <= 2.7e-39) {
		tmp = (Math.sqrt(((b * b) + (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 <= -1.12e+132:
		tmp = (b / -1.5) / a
	elif b <= 2.7e-39:
		tmp = (math.sqrt(((b * b) + (c * (a * -3.0)))) - b) / (a * 3.0)
	else:
		tmp = (c * -0.5) / b
	return tmp
function code(a, b, c)
	tmp = 0.0
	if (b <= -1.12e+132)
		tmp = Float64(Float64(b / -1.5) / a);
	elseif (b <= 2.7e-39)
		tmp = Float64(Float64(sqrt(Float64(Float64(b * b) + Float64(c * Float64(a * -3.0)))) - b) / Float64(a * 3.0));
	else
		tmp = Float64(Float64(c * -0.5) / b);
	end
	return tmp
end
function tmp_2 = code(a, b, c)
	tmp = 0.0;
	if (b <= -1.12e+132)
		tmp = (b / -1.5) / a;
	elseif (b <= 2.7e-39)
		tmp = (sqrt(((b * b) + (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, -1.12e+132], N[(N[(b / -1.5), $MachinePrecision] / a), $MachinePrecision], If[LessEqual[b, 2.7e-39], N[(N[(N[Sqrt[N[(N[(b * b), $MachinePrecision] + N[(c * N[(a * -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision] / N[(a * 3.0), $MachinePrecision]), $MachinePrecision], N[(N[(c * -0.5), $MachinePrecision] / b), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;b \leq -1.12 \cdot 10^{+132}:\\
\;\;\;\;\frac{\frac{b}{-1.5}}{a}\\

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

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


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

    1. Initial program 50.6%

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

        \[\leadsto \mathsf{/.f64}\left(\left(\left(\mathsf{neg}\left(b\right)\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}\right), \color{blue}{\left(3 \cdot a\right)}\right) \]
      2. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c} + \left(\mathsf{neg}\left(b\right)\right)\right), \left(\color{blue}{3} \cdot a\right)\right) \]
      3. unsub-negN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c} - b\right), \left(\color{blue}{3} \cdot a\right)\right) \]
      4. --lowering--.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\left(\sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}\right), b\right), \left(\color{blue}{3} \cdot a\right)\right) \]
      5. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\left(b \cdot b - \left(3 \cdot a\right) \cdot c\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      6. sub-negN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\left(b \cdot b + \left(\mathsf{neg}\left(\left(3 \cdot a\right) \cdot c\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      7. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\left(b \cdot b\right), \left(\mathsf{neg}\left(\left(3 \cdot a\right) \cdot c\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(\mathsf{neg}\left(\left(3 \cdot a\right) \cdot c\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      9. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(\mathsf{neg}\left(c \cdot \left(3 \cdot a\right)\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      10. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(c \cdot \left(\mathsf{neg}\left(3 \cdot a\right)\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      11. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(c, \left(\mathsf{neg}\left(3 \cdot a\right)\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      12. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(c, \left(\mathsf{neg}\left(a \cdot 3\right)\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      13. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(c, \left(a \cdot \left(\mathsf{neg}\left(3\right)\right)\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      14. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(c, \mathsf{*.f64}\left(a, \left(\mathsf{neg}\left(3\right)\right)\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      15. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(c, \mathsf{*.f64}\left(a, -3\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      16. *-lowering-*.f6450.6%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(c, \mathsf{*.f64}\left(a, -3\right)\right)\right)\right), b\right), \mathsf{*.f64}\left(3, \color{blue}{a}\right)\right) \]
    3. Simplified50.6%

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

      \[\leadsto \mathsf{/.f64}\left(\color{blue}{\left(-2 \cdot b\right)}, \mathsf{*.f64}\left(3, a\right)\right) \]
    6. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\left(b \cdot -2\right), \mathsf{*.f64}\left(\color{blue}{3}, a\right)\right) \]
      2. *-lowering-*.f6492.4%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(b, -2\right), \mathsf{*.f64}\left(\color{blue}{3}, a\right)\right) \]
    7. Simplified92.4%

      \[\leadsto \frac{\color{blue}{b \cdot -2}}{3 \cdot a} \]
    8. Step-by-step derivation
      1. associate-/r*N/A

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

        \[\leadsto \frac{b \cdot \frac{-2}{3}}{a} \]
      3. metadata-evalN/A

        \[\leadsto \frac{b \cdot \frac{-2}{3}}{a} \]
      4. metadata-evalN/A

        \[\leadsto \frac{b \cdot \frac{1}{\frac{-3}{2}}}{a} \]
      5. div-invN/A

        \[\leadsto \frac{\frac{b}{\frac{-3}{2}}}{a} \]
      6. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\left(\frac{b}{\frac{-3}{2}}\right), \color{blue}{a}\right) \]
      7. /-lowering-/.f6492.5%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(b, \frac{-3}{2}\right), a\right) \]
    9. Applied egg-rr92.5%

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

    if -1.12e132 < b < 2.7000000000000001e-39

    1. Initial program 79.3%

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

        \[\leadsto \mathsf{/.f64}\left(\left(\left(\mathsf{neg}\left(b\right)\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}\right), \color{blue}{\left(3 \cdot a\right)}\right) \]
      2. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c} + \left(\mathsf{neg}\left(b\right)\right)\right), \left(\color{blue}{3} \cdot a\right)\right) \]
      3. unsub-negN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c} - b\right), \left(\color{blue}{3} \cdot a\right)\right) \]
      4. --lowering--.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\left(\sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}\right), b\right), \left(\color{blue}{3} \cdot a\right)\right) \]
      5. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\left(b \cdot b - \left(3 \cdot a\right) \cdot c\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      6. sub-negN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\left(b \cdot b + \left(\mathsf{neg}\left(\left(3 \cdot a\right) \cdot c\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      7. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\left(b \cdot b\right), \left(\mathsf{neg}\left(\left(3 \cdot a\right) \cdot c\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(\mathsf{neg}\left(\left(3 \cdot a\right) \cdot c\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      9. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(\mathsf{neg}\left(c \cdot \left(3 \cdot a\right)\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      10. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(c \cdot \left(\mathsf{neg}\left(3 \cdot a\right)\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      11. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(c, \left(\mathsf{neg}\left(3 \cdot a\right)\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      12. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(c, \left(\mathsf{neg}\left(a \cdot 3\right)\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      13. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(c, \left(a \cdot \left(\mathsf{neg}\left(3\right)\right)\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      14. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(c, \mathsf{*.f64}\left(a, \left(\mathsf{neg}\left(3\right)\right)\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      15. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(c, \mathsf{*.f64}\left(a, -3\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      16. *-lowering-*.f6479.3%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(c, \mathsf{*.f64}\left(a, -3\right)\right)\right)\right), b\right), \mathsf{*.f64}\left(3, \color{blue}{a}\right)\right) \]
    3. Simplified79.3%

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

    if 2.7000000000000001e-39 < b

    1. Initial program 18.5%

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

        \[\leadsto \mathsf{/.f64}\left(\left(\left(\mathsf{neg}\left(b\right)\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}\right), \color{blue}{\left(3 \cdot a\right)}\right) \]
      2. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c} + \left(\mathsf{neg}\left(b\right)\right)\right), \left(\color{blue}{3} \cdot a\right)\right) \]
      3. unsub-negN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c} - b\right), \left(\color{blue}{3} \cdot a\right)\right) \]
      4. --lowering--.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\left(\sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}\right), b\right), \left(\color{blue}{3} \cdot a\right)\right) \]
      5. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\left(b \cdot b - \left(3 \cdot a\right) \cdot c\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      6. sub-negN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\left(b \cdot b + \left(\mathsf{neg}\left(\left(3 \cdot a\right) \cdot c\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      7. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\left(b \cdot b\right), \left(\mathsf{neg}\left(\left(3 \cdot a\right) \cdot c\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(\mathsf{neg}\left(\left(3 \cdot a\right) \cdot c\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      9. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(\mathsf{neg}\left(c \cdot \left(3 \cdot a\right)\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      10. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(c \cdot \left(\mathsf{neg}\left(3 \cdot a\right)\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      11. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(c, \left(\mathsf{neg}\left(3 \cdot a\right)\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      12. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(c, \left(\mathsf{neg}\left(a \cdot 3\right)\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      13. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(c, \left(a \cdot \left(\mathsf{neg}\left(3\right)\right)\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      14. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(c, \mathsf{*.f64}\left(a, \left(\mathsf{neg}\left(3\right)\right)\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      15. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(c, \mathsf{*.f64}\left(a, -3\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      16. *-lowering-*.f6418.5%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(c, \mathsf{*.f64}\left(a, -3\right)\right)\right)\right), b\right), \mathsf{*.f64}\left(3, \color{blue}{a}\right)\right) \]
    3. Simplified18.5%

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

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

        \[\leadsto \frac{\frac{-1}{2} \cdot c}{\color{blue}{b}} \]
      2. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\left(\frac{-1}{2} \cdot c\right), \color{blue}{b}\right) \]
      3. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\left(c \cdot \frac{-1}{2}\right), b\right) \]
      4. *-lowering-*.f6485.2%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c, \frac{-1}{2}\right), b\right) \]
    7. Simplified85.2%

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

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

Alternative 2: 85.9% accurate, 0.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq -8 \cdot 10^{+129}:\\
\;\;\;\;\frac{\frac{b}{-1.5}}{a}\\

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

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


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

    1. Initial program 50.6%

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

        \[\leadsto \mathsf{/.f64}\left(\left(\left(\mathsf{neg}\left(b\right)\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}\right), \color{blue}{\left(3 \cdot a\right)}\right) \]
      2. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c} + \left(\mathsf{neg}\left(b\right)\right)\right), \left(\color{blue}{3} \cdot a\right)\right) \]
      3. unsub-negN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c} - b\right), \left(\color{blue}{3} \cdot a\right)\right) \]
      4. --lowering--.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\left(\sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}\right), b\right), \left(\color{blue}{3} \cdot a\right)\right) \]
      5. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\left(b \cdot b - \left(3 \cdot a\right) \cdot c\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      6. sub-negN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\left(b \cdot b + \left(\mathsf{neg}\left(\left(3 \cdot a\right) \cdot c\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      7. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\left(b \cdot b\right), \left(\mathsf{neg}\left(\left(3 \cdot a\right) \cdot c\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(\mathsf{neg}\left(\left(3 \cdot a\right) \cdot c\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      9. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(\mathsf{neg}\left(c \cdot \left(3 \cdot a\right)\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      10. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(c \cdot \left(\mathsf{neg}\left(3 \cdot a\right)\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      11. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(c, \left(\mathsf{neg}\left(3 \cdot a\right)\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      12. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(c, \left(\mathsf{neg}\left(a \cdot 3\right)\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      13. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(c, \left(a \cdot \left(\mathsf{neg}\left(3\right)\right)\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      14. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(c, \mathsf{*.f64}\left(a, \left(\mathsf{neg}\left(3\right)\right)\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      15. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(c, \mathsf{*.f64}\left(a, -3\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      16. *-lowering-*.f6450.6%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(c, \mathsf{*.f64}\left(a, -3\right)\right)\right)\right), b\right), \mathsf{*.f64}\left(3, \color{blue}{a}\right)\right) \]
    3. Simplified50.6%

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

      \[\leadsto \mathsf{/.f64}\left(\color{blue}{\left(-2 \cdot b\right)}, \mathsf{*.f64}\left(3, a\right)\right) \]
    6. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\left(b \cdot -2\right), \mathsf{*.f64}\left(\color{blue}{3}, a\right)\right) \]
      2. *-lowering-*.f6492.4%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(b, -2\right), \mathsf{*.f64}\left(\color{blue}{3}, a\right)\right) \]
    7. Simplified92.4%

      \[\leadsto \frac{\color{blue}{b \cdot -2}}{3 \cdot a} \]
    8. Step-by-step derivation
      1. associate-/r*N/A

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

        \[\leadsto \frac{b \cdot \frac{-2}{3}}{a} \]
      3. metadata-evalN/A

        \[\leadsto \frac{b \cdot \frac{-2}{3}}{a} \]
      4. metadata-evalN/A

        \[\leadsto \frac{b \cdot \frac{1}{\frac{-3}{2}}}{a} \]
      5. div-invN/A

        \[\leadsto \frac{\frac{b}{\frac{-3}{2}}}{a} \]
      6. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\left(\frac{b}{\frac{-3}{2}}\right), \color{blue}{a}\right) \]
      7. /-lowering-/.f6492.5%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(b, \frac{-3}{2}\right), a\right) \]
    9. Applied egg-rr92.5%

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

    if -8e129 < b < 2.8000000000000001e-37

    1. Initial program 79.3%

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

        \[\leadsto \mathsf{/.f64}\left(\left(\left(\mathsf{neg}\left(b\right)\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}\right), \color{blue}{\left(3 \cdot a\right)}\right) \]
      2. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c} + \left(\mathsf{neg}\left(b\right)\right)\right), \left(\color{blue}{3} \cdot a\right)\right) \]
      3. unsub-negN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c} - b\right), \left(\color{blue}{3} \cdot a\right)\right) \]
      4. --lowering--.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\left(\sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}\right), b\right), \left(\color{blue}{3} \cdot a\right)\right) \]
      5. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\left(b \cdot b - \left(3 \cdot a\right) \cdot c\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      6. sub-negN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\left(b \cdot b + \left(\mathsf{neg}\left(\left(3 \cdot a\right) \cdot c\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      7. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\left(b \cdot b\right), \left(\mathsf{neg}\left(\left(3 \cdot a\right) \cdot c\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(\mathsf{neg}\left(\left(3 \cdot a\right) \cdot c\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      9. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(\mathsf{neg}\left(c \cdot \left(3 \cdot a\right)\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      10. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(c \cdot \left(\mathsf{neg}\left(3 \cdot a\right)\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      11. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(c, \left(\mathsf{neg}\left(3 \cdot a\right)\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      12. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(c, \left(\mathsf{neg}\left(a \cdot 3\right)\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      13. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(c, \left(a \cdot \left(\mathsf{neg}\left(3\right)\right)\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      14. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(c, \mathsf{*.f64}\left(a, \left(\mathsf{neg}\left(3\right)\right)\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      15. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(c, \mathsf{*.f64}\left(a, -3\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      16. *-lowering-*.f6479.3%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(c, \mathsf{*.f64}\left(a, -3\right)\right)\right)\right), b\right), \mathsf{*.f64}\left(3, \color{blue}{a}\right)\right) \]
    3. Simplified79.3%

      \[\leadsto \color{blue}{\frac{\sqrt{b \cdot b + c \cdot \left(a \cdot -3\right)} - b}{3 \cdot a}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. remove-double-negN/A

        \[\leadsto \frac{\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\sqrt{b \cdot b + c \cdot \left(a \cdot -3\right)}\right)\right)\right)\right) - b}{3 \cdot a} \]
      2. sub-divN/A

        \[\leadsto \frac{\mathsf{neg}\left(\left(\mathsf{neg}\left(\sqrt{b \cdot b + c \cdot \left(a \cdot -3\right)}\right)\right)\right)}{3 \cdot a} - \color{blue}{\frac{b}{3 \cdot a}} \]
      3. remove-double-negN/A

        \[\leadsto \frac{\sqrt{b \cdot b + c \cdot \left(a \cdot -3\right)}}{3 \cdot a} - \frac{b}{3 \cdot a} \]
      4. div-subN/A

        \[\leadsto \frac{\sqrt{b \cdot b + c \cdot \left(a \cdot -3\right)} - b}{\color{blue}{3 \cdot a}} \]
      5. clear-numN/A

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

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

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{1}{3 \cdot a}\right), \color{blue}{\left(\sqrt{b \cdot b + c \cdot \left(a \cdot -3\right)} - b\right)}\right) \]
      8. associate-/r*N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{\frac{1}{3}}{a}\right), \left(\color{blue}{\sqrt{b \cdot b + c \cdot \left(a \cdot -3\right)}} - b\right)\right) \]
      9. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(\frac{1}{3}\right), a\right), \left(\color{blue}{\sqrt{b \cdot b + c \cdot \left(a \cdot -3\right)}} - b\right)\right) \]
      10. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\frac{1}{3}, a\right), \left(\sqrt{\color{blue}{b \cdot b + c \cdot \left(a \cdot -3\right)}} - b\right)\right) \]
      11. --lowering--.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\frac{1}{3}, a\right), \mathsf{\_.f64}\left(\left(\sqrt{b \cdot b + c \cdot \left(a \cdot -3\right)}\right), \color{blue}{b}\right)\right) \]
    6. Applied egg-rr79.3%

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

    if 2.8000000000000001e-37 < b

    1. Initial program 18.5%

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

        \[\leadsto \mathsf{/.f64}\left(\left(\left(\mathsf{neg}\left(b\right)\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}\right), \color{blue}{\left(3 \cdot a\right)}\right) \]
      2. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c} + \left(\mathsf{neg}\left(b\right)\right)\right), \left(\color{blue}{3} \cdot a\right)\right) \]
      3. unsub-negN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c} - b\right), \left(\color{blue}{3} \cdot a\right)\right) \]
      4. --lowering--.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\left(\sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}\right), b\right), \left(\color{blue}{3} \cdot a\right)\right) \]
      5. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\left(b \cdot b - \left(3 \cdot a\right) \cdot c\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      6. sub-negN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\left(b \cdot b + \left(\mathsf{neg}\left(\left(3 \cdot a\right) \cdot c\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      7. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\left(b \cdot b\right), \left(\mathsf{neg}\left(\left(3 \cdot a\right) \cdot c\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(\mathsf{neg}\left(\left(3 \cdot a\right) \cdot c\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      9. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(\mathsf{neg}\left(c \cdot \left(3 \cdot a\right)\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      10. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(c \cdot \left(\mathsf{neg}\left(3 \cdot a\right)\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      11. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(c, \left(\mathsf{neg}\left(3 \cdot a\right)\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      12. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(c, \left(\mathsf{neg}\left(a \cdot 3\right)\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      13. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(c, \left(a \cdot \left(\mathsf{neg}\left(3\right)\right)\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      14. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(c, \mathsf{*.f64}\left(a, \left(\mathsf{neg}\left(3\right)\right)\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      15. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(c, \mathsf{*.f64}\left(a, -3\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      16. *-lowering-*.f6418.5%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(c, \mathsf{*.f64}\left(a, -3\right)\right)\right)\right), b\right), \mathsf{*.f64}\left(3, \color{blue}{a}\right)\right) \]
    3. Simplified18.5%

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

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

        \[\leadsto \frac{\frac{-1}{2} \cdot c}{\color{blue}{b}} \]
      2. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\left(\frac{-1}{2} \cdot c\right), \color{blue}{b}\right) \]
      3. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\left(c \cdot \frac{-1}{2}\right), b\right) \]
      4. *-lowering-*.f6485.2%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c, \frac{-1}{2}\right), b\right) \]
    7. Simplified85.2%

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

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

Alternative 3: 80.9% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq -1.5 \cdot 10^{-50}:\\
\;\;\;\;\frac{\frac{b}{-1.5}}{a}\\

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

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


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

    1. Initial program 62.4%

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

        \[\leadsto \mathsf{/.f64}\left(\left(\left(\mathsf{neg}\left(b\right)\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}\right), \color{blue}{\left(3 \cdot a\right)}\right) \]
      2. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c} + \left(\mathsf{neg}\left(b\right)\right)\right), \left(\color{blue}{3} \cdot a\right)\right) \]
      3. unsub-negN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c} - b\right), \left(\color{blue}{3} \cdot a\right)\right) \]
      4. --lowering--.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\left(\sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}\right), b\right), \left(\color{blue}{3} \cdot a\right)\right) \]
      5. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\left(b \cdot b - \left(3 \cdot a\right) \cdot c\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      6. sub-negN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\left(b \cdot b + \left(\mathsf{neg}\left(\left(3 \cdot a\right) \cdot c\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      7. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\left(b \cdot b\right), \left(\mathsf{neg}\left(\left(3 \cdot a\right) \cdot c\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(\mathsf{neg}\left(\left(3 \cdot a\right) \cdot c\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      9. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(\mathsf{neg}\left(c \cdot \left(3 \cdot a\right)\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      10. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(c \cdot \left(\mathsf{neg}\left(3 \cdot a\right)\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      11. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(c, \left(\mathsf{neg}\left(3 \cdot a\right)\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      12. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(c, \left(\mathsf{neg}\left(a \cdot 3\right)\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      13. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(c, \left(a \cdot \left(\mathsf{neg}\left(3\right)\right)\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      14. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(c, \mathsf{*.f64}\left(a, \left(\mathsf{neg}\left(3\right)\right)\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      15. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(c, \mathsf{*.f64}\left(a, -3\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      16. *-lowering-*.f6462.4%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(c, \mathsf{*.f64}\left(a, -3\right)\right)\right)\right), b\right), \mathsf{*.f64}\left(3, \color{blue}{a}\right)\right) \]
    3. Simplified62.4%

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

      \[\leadsto \mathsf{/.f64}\left(\color{blue}{\left(-2 \cdot b\right)}, \mathsf{*.f64}\left(3, a\right)\right) \]
    6. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\left(b \cdot -2\right), \mathsf{*.f64}\left(\color{blue}{3}, a\right)\right) \]
      2. *-lowering-*.f6486.2%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(b, -2\right), \mathsf{*.f64}\left(\color{blue}{3}, a\right)\right) \]
    7. Simplified86.2%

      \[\leadsto \frac{\color{blue}{b \cdot -2}}{3 \cdot a} \]
    8. Step-by-step derivation
      1. associate-/r*N/A

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

        \[\leadsto \frac{b \cdot \frac{-2}{3}}{a} \]
      3. metadata-evalN/A

        \[\leadsto \frac{b \cdot \frac{-2}{3}}{a} \]
      4. metadata-evalN/A

        \[\leadsto \frac{b \cdot \frac{1}{\frac{-3}{2}}}{a} \]
      5. div-invN/A

        \[\leadsto \frac{\frac{b}{\frac{-3}{2}}}{a} \]
      6. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\left(\frac{b}{\frac{-3}{2}}\right), \color{blue}{a}\right) \]
      7. /-lowering-/.f6486.3%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(b, \frac{-3}{2}\right), a\right) \]
    9. Applied egg-rr86.3%

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

    if -1.49999999999999995e-50 < b < 2.29999999999999996e-36

    1. Initial program 77.7%

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

        \[\leadsto \mathsf{/.f64}\left(\left(\left(\mathsf{neg}\left(b\right)\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}\right), \color{blue}{\left(3 \cdot a\right)}\right) \]
      2. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c} + \left(\mathsf{neg}\left(b\right)\right)\right), \left(\color{blue}{3} \cdot a\right)\right) \]
      3. unsub-negN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c} - b\right), \left(\color{blue}{3} \cdot a\right)\right) \]
      4. --lowering--.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\left(\sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}\right), b\right), \left(\color{blue}{3} \cdot a\right)\right) \]
      5. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\left(b \cdot b - \left(3 \cdot a\right) \cdot c\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      6. sub-negN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\left(b \cdot b + \left(\mathsf{neg}\left(\left(3 \cdot a\right) \cdot c\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      7. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\left(b \cdot b\right), \left(\mathsf{neg}\left(\left(3 \cdot a\right) \cdot c\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(\mathsf{neg}\left(\left(3 \cdot a\right) \cdot c\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      9. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(\mathsf{neg}\left(c \cdot \left(3 \cdot a\right)\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      10. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(c \cdot \left(\mathsf{neg}\left(3 \cdot a\right)\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      11. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(c, \left(\mathsf{neg}\left(3 \cdot a\right)\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      12. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(c, \left(\mathsf{neg}\left(a \cdot 3\right)\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      13. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(c, \left(a \cdot \left(\mathsf{neg}\left(3\right)\right)\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      14. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(c, \mathsf{*.f64}\left(a, \left(\mathsf{neg}\left(3\right)\right)\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      15. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(c, \mathsf{*.f64}\left(a, -3\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      16. *-lowering-*.f6477.7%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(c, \mathsf{*.f64}\left(a, -3\right)\right)\right)\right), b\right), \mathsf{*.f64}\left(3, \color{blue}{a}\right)\right) \]
    3. Simplified77.7%

      \[\leadsto \color{blue}{\frac{\sqrt{b \cdot b + c \cdot \left(a \cdot -3\right)} - b}{3 \cdot a}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. remove-double-negN/A

        \[\leadsto \frac{\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\sqrt{b \cdot b + c \cdot \left(a \cdot -3\right)}\right)\right)\right)\right) - b}{3 \cdot a} \]
      2. sub-divN/A

        \[\leadsto \frac{\mathsf{neg}\left(\left(\mathsf{neg}\left(\sqrt{b \cdot b + c \cdot \left(a \cdot -3\right)}\right)\right)\right)}{3 \cdot a} - \color{blue}{\frac{b}{3 \cdot a}} \]
      3. remove-double-negN/A

        \[\leadsto \frac{\sqrt{b \cdot b + c \cdot \left(a \cdot -3\right)}}{3 \cdot a} - \frac{b}{3 \cdot a} \]
      4. div-subN/A

        \[\leadsto \frac{\sqrt{b \cdot b + c \cdot \left(a \cdot -3\right)} - b}{\color{blue}{3 \cdot a}} \]
      5. clear-numN/A

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

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

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{1}{3 \cdot a}\right), \color{blue}{\left(\sqrt{b \cdot b + c \cdot \left(a \cdot -3\right)} - b\right)}\right) \]
      8. associate-/r*N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{\frac{1}{3}}{a}\right), \left(\color{blue}{\sqrt{b \cdot b + c \cdot \left(a \cdot -3\right)}} - b\right)\right) \]
      9. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(\frac{1}{3}\right), a\right), \left(\color{blue}{\sqrt{b \cdot b + c \cdot \left(a \cdot -3\right)}} - b\right)\right) \]
      10. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\frac{1}{3}, a\right), \left(\sqrt{\color{blue}{b \cdot b + c \cdot \left(a \cdot -3\right)}} - b\right)\right) \]
      11. --lowering--.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\frac{1}{3}, a\right), \mathsf{\_.f64}\left(\left(\sqrt{b \cdot b + c \cdot \left(a \cdot -3\right)}\right), \color{blue}{b}\right)\right) \]
    6. Applied egg-rr77.7%

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

      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\frac{1}{3}, a\right), \mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\color{blue}{\left(-3 \cdot \left(a \cdot c\right)\right)}\right), b\right)\right) \]
    8. Step-by-step derivation
      1. associate-*r*N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\frac{1}{3}, a\right), \mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\left(\left(-3 \cdot a\right) \cdot c\right)\right), b\right)\right) \]
      2. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\frac{1}{3}, a\right), \mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\left(c \cdot \left(-3 \cdot a\right)\right)\right), b\right)\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\frac{1}{3}, a\right), \mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(c, \left(-3 \cdot a\right)\right)\right), b\right)\right) \]
      4. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\frac{1}{3}, a\right), \mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(c, \left(a \cdot -3\right)\right)\right), b\right)\right) \]
      5. *-lowering-*.f6470.1%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\frac{1}{3}, a\right), \mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(c, \mathsf{*.f64}\left(a, -3\right)\right)\right), b\right)\right) \]
    9. Simplified70.1%

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

    if 2.29999999999999996e-36 < b

    1. Initial program 18.5%

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

        \[\leadsto \mathsf{/.f64}\left(\left(\left(\mathsf{neg}\left(b\right)\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}\right), \color{blue}{\left(3 \cdot a\right)}\right) \]
      2. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c} + \left(\mathsf{neg}\left(b\right)\right)\right), \left(\color{blue}{3} \cdot a\right)\right) \]
      3. unsub-negN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c} - b\right), \left(\color{blue}{3} \cdot a\right)\right) \]
      4. --lowering--.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\left(\sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}\right), b\right), \left(\color{blue}{3} \cdot a\right)\right) \]
      5. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\left(b \cdot b - \left(3 \cdot a\right) \cdot c\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      6. sub-negN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\left(b \cdot b + \left(\mathsf{neg}\left(\left(3 \cdot a\right) \cdot c\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      7. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\left(b \cdot b\right), \left(\mathsf{neg}\left(\left(3 \cdot a\right) \cdot c\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(\mathsf{neg}\left(\left(3 \cdot a\right) \cdot c\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      9. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(\mathsf{neg}\left(c \cdot \left(3 \cdot a\right)\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      10. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(c \cdot \left(\mathsf{neg}\left(3 \cdot a\right)\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      11. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(c, \left(\mathsf{neg}\left(3 \cdot a\right)\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      12. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(c, \left(\mathsf{neg}\left(a \cdot 3\right)\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      13. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(c, \left(a \cdot \left(\mathsf{neg}\left(3\right)\right)\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      14. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(c, \mathsf{*.f64}\left(a, \left(\mathsf{neg}\left(3\right)\right)\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      15. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(c, \mathsf{*.f64}\left(a, -3\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      16. *-lowering-*.f6418.5%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(c, \mathsf{*.f64}\left(a, -3\right)\right)\right)\right), b\right), \mathsf{*.f64}\left(3, \color{blue}{a}\right)\right) \]
    3. Simplified18.5%

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

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

        \[\leadsto \frac{\frac{-1}{2} \cdot c}{\color{blue}{b}} \]
      2. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\left(\frac{-1}{2} \cdot c\right), \color{blue}{b}\right) \]
      3. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\left(c \cdot \frac{-1}{2}\right), b\right) \]
      4. *-lowering-*.f6485.2%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c, \frac{-1}{2}\right), b\right) \]
    7. Simplified85.2%

      \[\leadsto \color{blue}{\frac{c \cdot -0.5}{b}} \]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 4: 67.9% accurate, 11.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq 1.45 \cdot 10^{-272}:\\
\;\;\;\;\frac{\frac{b}{-1.5}}{a}\\

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


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

    1. Initial program 69.9%

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

        \[\leadsto \mathsf{/.f64}\left(\left(\left(\mathsf{neg}\left(b\right)\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}\right), \color{blue}{\left(3 \cdot a\right)}\right) \]
      2. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c} + \left(\mathsf{neg}\left(b\right)\right)\right), \left(\color{blue}{3} \cdot a\right)\right) \]
      3. unsub-negN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c} - b\right), \left(\color{blue}{3} \cdot a\right)\right) \]
      4. --lowering--.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\left(\sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}\right), b\right), \left(\color{blue}{3} \cdot a\right)\right) \]
      5. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\left(b \cdot b - \left(3 \cdot a\right) \cdot c\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      6. sub-negN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\left(b \cdot b + \left(\mathsf{neg}\left(\left(3 \cdot a\right) \cdot c\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      7. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\left(b \cdot b\right), \left(\mathsf{neg}\left(\left(3 \cdot a\right) \cdot c\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(\mathsf{neg}\left(\left(3 \cdot a\right) \cdot c\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      9. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(\mathsf{neg}\left(c \cdot \left(3 \cdot a\right)\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      10. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(c \cdot \left(\mathsf{neg}\left(3 \cdot a\right)\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      11. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(c, \left(\mathsf{neg}\left(3 \cdot a\right)\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      12. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(c, \left(\mathsf{neg}\left(a \cdot 3\right)\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      13. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(c, \left(a \cdot \left(\mathsf{neg}\left(3\right)\right)\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      14. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(c, \mathsf{*.f64}\left(a, \left(\mathsf{neg}\left(3\right)\right)\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      15. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(c, \mathsf{*.f64}\left(a, -3\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      16. *-lowering-*.f6469.9%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(c, \mathsf{*.f64}\left(a, -3\right)\right)\right)\right), b\right), \mathsf{*.f64}\left(3, \color{blue}{a}\right)\right) \]
    3. Simplified69.9%

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

      \[\leadsto \mathsf{/.f64}\left(\color{blue}{\left(-2 \cdot b\right)}, \mathsf{*.f64}\left(3, a\right)\right) \]
    6. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\left(b \cdot -2\right), \mathsf{*.f64}\left(\color{blue}{3}, a\right)\right) \]
      2. *-lowering-*.f6463.7%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(b, -2\right), \mathsf{*.f64}\left(\color{blue}{3}, a\right)\right) \]
    7. Simplified63.7%

      \[\leadsto \frac{\color{blue}{b \cdot -2}}{3 \cdot a} \]
    8. Step-by-step derivation
      1. associate-/r*N/A

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

        \[\leadsto \frac{b \cdot \frac{-2}{3}}{a} \]
      3. metadata-evalN/A

        \[\leadsto \frac{b \cdot \frac{-2}{3}}{a} \]
      4. metadata-evalN/A

        \[\leadsto \frac{b \cdot \frac{1}{\frac{-3}{2}}}{a} \]
      5. div-invN/A

        \[\leadsto \frac{\frac{b}{\frac{-3}{2}}}{a} \]
      6. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\left(\frac{b}{\frac{-3}{2}}\right), \color{blue}{a}\right) \]
      7. /-lowering-/.f6463.7%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(b, \frac{-3}{2}\right), a\right) \]
    9. Applied egg-rr63.7%

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

    if 1.44999999999999997e-272 < b

    1. Initial program 33.3%

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

        \[\leadsto \mathsf{/.f64}\left(\left(\left(\mathsf{neg}\left(b\right)\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}\right), \color{blue}{\left(3 \cdot a\right)}\right) \]
      2. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c} + \left(\mathsf{neg}\left(b\right)\right)\right), \left(\color{blue}{3} \cdot a\right)\right) \]
      3. unsub-negN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c} - b\right), \left(\color{blue}{3} \cdot a\right)\right) \]
      4. --lowering--.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\left(\sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}\right), b\right), \left(\color{blue}{3} \cdot a\right)\right) \]
      5. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\left(b \cdot b - \left(3 \cdot a\right) \cdot c\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      6. sub-negN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\left(b \cdot b + \left(\mathsf{neg}\left(\left(3 \cdot a\right) \cdot c\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      7. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\left(b \cdot b\right), \left(\mathsf{neg}\left(\left(3 \cdot a\right) \cdot c\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(\mathsf{neg}\left(\left(3 \cdot a\right) \cdot c\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      9. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(\mathsf{neg}\left(c \cdot \left(3 \cdot a\right)\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      10. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(c \cdot \left(\mathsf{neg}\left(3 \cdot a\right)\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      11. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(c, \left(\mathsf{neg}\left(3 \cdot a\right)\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      12. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(c, \left(\mathsf{neg}\left(a \cdot 3\right)\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      13. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(c, \left(a \cdot \left(\mathsf{neg}\left(3\right)\right)\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      14. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(c, \mathsf{*.f64}\left(a, \left(\mathsf{neg}\left(3\right)\right)\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      15. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(c, \mathsf{*.f64}\left(a, -3\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      16. *-lowering-*.f6433.3%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(c, \mathsf{*.f64}\left(a, -3\right)\right)\right)\right), b\right), \mathsf{*.f64}\left(3, \color{blue}{a}\right)\right) \]
    3. Simplified33.3%

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

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

        \[\leadsto \frac{\frac{-1}{2} \cdot c}{\color{blue}{b}} \]
      2. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\left(\frac{-1}{2} \cdot c\right), \color{blue}{b}\right) \]
      3. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\left(c \cdot \frac{-1}{2}\right), b\right) \]
      4. *-lowering-*.f6465.3%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c, \frac{-1}{2}\right), b\right) \]
    7. Simplified65.3%

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

Alternative 5: 67.9% accurate, 11.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq 1.45 \cdot 10^{-272}:\\
\;\;\;\;\frac{b}{-1.5 \cdot a}\\

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


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

    1. Initial program 69.9%

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

        \[\leadsto \mathsf{/.f64}\left(\left(\left(\mathsf{neg}\left(b\right)\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}\right), \color{blue}{\left(3 \cdot a\right)}\right) \]
      2. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c} + \left(\mathsf{neg}\left(b\right)\right)\right), \left(\color{blue}{3} \cdot a\right)\right) \]
      3. unsub-negN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c} - b\right), \left(\color{blue}{3} \cdot a\right)\right) \]
      4. --lowering--.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\left(\sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}\right), b\right), \left(\color{blue}{3} \cdot a\right)\right) \]
      5. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\left(b \cdot b - \left(3 \cdot a\right) \cdot c\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      6. sub-negN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\left(b \cdot b + \left(\mathsf{neg}\left(\left(3 \cdot a\right) \cdot c\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      7. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\left(b \cdot b\right), \left(\mathsf{neg}\left(\left(3 \cdot a\right) \cdot c\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(\mathsf{neg}\left(\left(3 \cdot a\right) \cdot c\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      9. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(\mathsf{neg}\left(c \cdot \left(3 \cdot a\right)\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      10. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(c \cdot \left(\mathsf{neg}\left(3 \cdot a\right)\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      11. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(c, \left(\mathsf{neg}\left(3 \cdot a\right)\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      12. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(c, \left(\mathsf{neg}\left(a \cdot 3\right)\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      13. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(c, \left(a \cdot \left(\mathsf{neg}\left(3\right)\right)\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      14. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(c, \mathsf{*.f64}\left(a, \left(\mathsf{neg}\left(3\right)\right)\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      15. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(c, \mathsf{*.f64}\left(a, -3\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      16. *-lowering-*.f6469.9%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(c, \mathsf{*.f64}\left(a, -3\right)\right)\right)\right), b\right), \mathsf{*.f64}\left(3, \color{blue}{a}\right)\right) \]
    3. Simplified69.9%

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

      \[\leadsto \color{blue}{\frac{-2}{3} \cdot \frac{b}{a}} \]
    6. Step-by-step derivation
      1. associate-*r/N/A

        \[\leadsto \frac{\frac{-2}{3} \cdot b}{\color{blue}{a}} \]
      2. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\left(\frac{-2}{3} \cdot b\right), \color{blue}{a}\right) \]
      3. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\left(b \cdot \frac{-2}{3}\right), a\right) \]
      4. *-lowering-*.f6463.7%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(b, \frac{-2}{3}\right), a\right) \]
    7. Simplified63.7%

      \[\leadsto \color{blue}{\frac{b \cdot -0.6666666666666666}{a}} \]
    8. Step-by-step derivation
      1. clear-numN/A

        \[\leadsto \frac{1}{\color{blue}{\frac{a}{b \cdot \frac{-2}{3}}}} \]
      2. inv-powN/A

        \[\leadsto {\left(\frac{a}{b \cdot \frac{-2}{3}}\right)}^{\color{blue}{-1}} \]
      3. div-invN/A

        \[\leadsto {\left(a \cdot \frac{1}{b \cdot \frac{-2}{3}}\right)}^{-1} \]
      4. unpow-prod-downN/A

        \[\leadsto {a}^{-1} \cdot \color{blue}{{\left(\frac{1}{b \cdot \frac{-2}{3}}\right)}^{-1}} \]
      5. inv-powN/A

        \[\leadsto \frac{1}{a} \cdot {\color{blue}{\left(\frac{1}{b \cdot \frac{-2}{3}}\right)}}^{-1} \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{1}{a}\right), \color{blue}{\left({\left(\frac{1}{b \cdot \frac{-2}{3}}\right)}^{-1}\right)}\right) \]
      7. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, a\right), \left({\color{blue}{\left(\frac{1}{b \cdot \frac{-2}{3}}\right)}}^{-1}\right)\right) \]
      8. pow-lowering-pow.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, a\right), \mathsf{pow.f64}\left(\left(\frac{1}{b \cdot \frac{-2}{3}}\right), \color{blue}{-1}\right)\right) \]
      9. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, a\right), \mathsf{pow.f64}\left(\left(\frac{1}{\frac{-2}{3} \cdot b}\right), -1\right)\right) \]
      10. associate-/r*N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, a\right), \mathsf{pow.f64}\left(\left(\frac{\frac{1}{\frac{-2}{3}}}{b}\right), -1\right)\right) \]
      11. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, a\right), \mathsf{pow.f64}\left(\mathsf{/.f64}\left(\left(\frac{1}{\frac{-2}{3}}\right), b\right), -1\right)\right) \]
      12. metadata-eval63.5%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, a\right), \mathsf{pow.f64}\left(\mathsf{/.f64}\left(\frac{-3}{2}, b\right), -1\right)\right) \]
    9. Applied egg-rr63.5%

      \[\leadsto \color{blue}{\frac{1}{a} \cdot {\left(\frac{-1.5}{b}\right)}^{-1}} \]
    10. Step-by-step derivation
      1. unpow-1N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, a\right), \left(\frac{1}{\color{blue}{\frac{\frac{-3}{2}}{b}}}\right)\right) \]
      2. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, a\right), \mathsf{/.f64}\left(1, \color{blue}{\left(\frac{\frac{-3}{2}}{b}\right)}\right)\right) \]
      3. /-lowering-/.f6463.5%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, a\right), \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\frac{-3}{2}, \color{blue}{b}\right)\right)\right) \]
    11. Applied egg-rr63.5%

      \[\leadsto \frac{1}{a} \cdot \color{blue}{\frac{1}{\frac{-1.5}{b}}} \]
    12. Step-by-step derivation
      1. associate-/r/N/A

        \[\leadsto \frac{1}{\color{blue}{\frac{a}{\frac{1}{\frac{\frac{-3}{2}}{b}}}}} \]
      2. clear-numN/A

        \[\leadsto \frac{\frac{1}{\frac{\frac{-3}{2}}{b}}}{\color{blue}{a}} \]
      3. clear-numN/A

        \[\leadsto \frac{\frac{b}{\frac{-3}{2}}}{a} \]
      4. associate-/l/N/A

        \[\leadsto \frac{b}{\color{blue}{a \cdot \frac{-3}{2}}} \]
      5. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(b, \color{blue}{\left(a \cdot \frac{-3}{2}\right)}\right) \]
      6. *-lowering-*.f6463.7%

        \[\leadsto \mathsf{/.f64}\left(b, \mathsf{*.f64}\left(a, \color{blue}{\frac{-3}{2}}\right)\right) \]
    13. Applied egg-rr63.7%

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

    if 1.44999999999999997e-272 < b

    1. Initial program 33.3%

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

        \[\leadsto \mathsf{/.f64}\left(\left(\left(\mathsf{neg}\left(b\right)\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}\right), \color{blue}{\left(3 \cdot a\right)}\right) \]
      2. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c} + \left(\mathsf{neg}\left(b\right)\right)\right), \left(\color{blue}{3} \cdot a\right)\right) \]
      3. unsub-negN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c} - b\right), \left(\color{blue}{3} \cdot a\right)\right) \]
      4. --lowering--.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\left(\sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}\right), b\right), \left(\color{blue}{3} \cdot a\right)\right) \]
      5. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\left(b \cdot b - \left(3 \cdot a\right) \cdot c\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      6. sub-negN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\left(b \cdot b + \left(\mathsf{neg}\left(\left(3 \cdot a\right) \cdot c\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      7. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\left(b \cdot b\right), \left(\mathsf{neg}\left(\left(3 \cdot a\right) \cdot c\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(\mathsf{neg}\left(\left(3 \cdot a\right) \cdot c\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      9. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(\mathsf{neg}\left(c \cdot \left(3 \cdot a\right)\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      10. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(c \cdot \left(\mathsf{neg}\left(3 \cdot a\right)\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      11. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(c, \left(\mathsf{neg}\left(3 \cdot a\right)\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      12. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(c, \left(\mathsf{neg}\left(a \cdot 3\right)\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      13. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(c, \left(a \cdot \left(\mathsf{neg}\left(3\right)\right)\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      14. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(c, \mathsf{*.f64}\left(a, \left(\mathsf{neg}\left(3\right)\right)\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      15. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(c, \mathsf{*.f64}\left(a, -3\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      16. *-lowering-*.f6433.3%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(c, \mathsf{*.f64}\left(a, -3\right)\right)\right)\right), b\right), \mathsf{*.f64}\left(3, \color{blue}{a}\right)\right) \]
    3. Simplified33.3%

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

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

        \[\leadsto \frac{\frac{-1}{2} \cdot c}{\color{blue}{b}} \]
      2. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\left(\frac{-1}{2} \cdot c\right), \color{blue}{b}\right) \]
      3. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\left(c \cdot \frac{-1}{2}\right), b\right) \]
      4. *-lowering-*.f6465.3%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c, \frac{-1}{2}\right), b\right) \]
    7. Simplified65.3%

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

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

Alternative 6: 67.8% accurate, 11.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq 1.45 \cdot 10^{-272}:\\
\;\;\;\;\frac{b}{-1.5 \cdot a}\\

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


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

    1. Initial program 69.9%

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

        \[\leadsto \mathsf{/.f64}\left(\left(\left(\mathsf{neg}\left(b\right)\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}\right), \color{blue}{\left(3 \cdot a\right)}\right) \]
      2. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c} + \left(\mathsf{neg}\left(b\right)\right)\right), \left(\color{blue}{3} \cdot a\right)\right) \]
      3. unsub-negN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c} - b\right), \left(\color{blue}{3} \cdot a\right)\right) \]
      4. --lowering--.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\left(\sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}\right), b\right), \left(\color{blue}{3} \cdot a\right)\right) \]
      5. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\left(b \cdot b - \left(3 \cdot a\right) \cdot c\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      6. sub-negN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\left(b \cdot b + \left(\mathsf{neg}\left(\left(3 \cdot a\right) \cdot c\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      7. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\left(b \cdot b\right), \left(\mathsf{neg}\left(\left(3 \cdot a\right) \cdot c\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(\mathsf{neg}\left(\left(3 \cdot a\right) \cdot c\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      9. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(\mathsf{neg}\left(c \cdot \left(3 \cdot a\right)\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      10. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(c \cdot \left(\mathsf{neg}\left(3 \cdot a\right)\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      11. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(c, \left(\mathsf{neg}\left(3 \cdot a\right)\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      12. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(c, \left(\mathsf{neg}\left(a \cdot 3\right)\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      13. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(c, \left(a \cdot \left(\mathsf{neg}\left(3\right)\right)\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      14. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(c, \mathsf{*.f64}\left(a, \left(\mathsf{neg}\left(3\right)\right)\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      15. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(c, \mathsf{*.f64}\left(a, -3\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      16. *-lowering-*.f6469.9%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(c, \mathsf{*.f64}\left(a, -3\right)\right)\right)\right), b\right), \mathsf{*.f64}\left(3, \color{blue}{a}\right)\right) \]
    3. Simplified69.9%

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

      \[\leadsto \color{blue}{\frac{-2}{3} \cdot \frac{b}{a}} \]
    6. Step-by-step derivation
      1. associate-*r/N/A

        \[\leadsto \frac{\frac{-2}{3} \cdot b}{\color{blue}{a}} \]
      2. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\left(\frac{-2}{3} \cdot b\right), \color{blue}{a}\right) \]
      3. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\left(b \cdot \frac{-2}{3}\right), a\right) \]
      4. *-lowering-*.f6463.7%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(b, \frac{-2}{3}\right), a\right) \]
    7. Simplified63.7%

      \[\leadsto \color{blue}{\frac{b \cdot -0.6666666666666666}{a}} \]
    8. Step-by-step derivation
      1. clear-numN/A

        \[\leadsto \frac{1}{\color{blue}{\frac{a}{b \cdot \frac{-2}{3}}}} \]
      2. inv-powN/A

        \[\leadsto {\left(\frac{a}{b \cdot \frac{-2}{3}}\right)}^{\color{blue}{-1}} \]
      3. div-invN/A

        \[\leadsto {\left(a \cdot \frac{1}{b \cdot \frac{-2}{3}}\right)}^{-1} \]
      4. unpow-prod-downN/A

        \[\leadsto {a}^{-1} \cdot \color{blue}{{\left(\frac{1}{b \cdot \frac{-2}{3}}\right)}^{-1}} \]
      5. inv-powN/A

        \[\leadsto \frac{1}{a} \cdot {\color{blue}{\left(\frac{1}{b \cdot \frac{-2}{3}}\right)}}^{-1} \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{1}{a}\right), \color{blue}{\left({\left(\frac{1}{b \cdot \frac{-2}{3}}\right)}^{-1}\right)}\right) \]
      7. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, a\right), \left({\color{blue}{\left(\frac{1}{b \cdot \frac{-2}{3}}\right)}}^{-1}\right)\right) \]
      8. pow-lowering-pow.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, a\right), \mathsf{pow.f64}\left(\left(\frac{1}{b \cdot \frac{-2}{3}}\right), \color{blue}{-1}\right)\right) \]
      9. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, a\right), \mathsf{pow.f64}\left(\left(\frac{1}{\frac{-2}{3} \cdot b}\right), -1\right)\right) \]
      10. associate-/r*N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, a\right), \mathsf{pow.f64}\left(\left(\frac{\frac{1}{\frac{-2}{3}}}{b}\right), -1\right)\right) \]
      11. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, a\right), \mathsf{pow.f64}\left(\mathsf{/.f64}\left(\left(\frac{1}{\frac{-2}{3}}\right), b\right), -1\right)\right) \]
      12. metadata-eval63.5%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, a\right), \mathsf{pow.f64}\left(\mathsf{/.f64}\left(\frac{-3}{2}, b\right), -1\right)\right) \]
    9. Applied egg-rr63.5%

      \[\leadsto \color{blue}{\frac{1}{a} \cdot {\left(\frac{-1.5}{b}\right)}^{-1}} \]
    10. Step-by-step derivation
      1. unpow-1N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, a\right), \left(\frac{1}{\color{blue}{\frac{\frac{-3}{2}}{b}}}\right)\right) \]
      2. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, a\right), \mathsf{/.f64}\left(1, \color{blue}{\left(\frac{\frac{-3}{2}}{b}\right)}\right)\right) \]
      3. /-lowering-/.f6463.5%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, a\right), \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\frac{-3}{2}, \color{blue}{b}\right)\right)\right) \]
    11. Applied egg-rr63.5%

      \[\leadsto \frac{1}{a} \cdot \color{blue}{\frac{1}{\frac{-1.5}{b}}} \]
    12. Step-by-step derivation
      1. associate-/r/N/A

        \[\leadsto \frac{1}{\color{blue}{\frac{a}{\frac{1}{\frac{\frac{-3}{2}}{b}}}}} \]
      2. clear-numN/A

        \[\leadsto \frac{\frac{1}{\frac{\frac{-3}{2}}{b}}}{\color{blue}{a}} \]
      3. clear-numN/A

        \[\leadsto \frac{\frac{b}{\frac{-3}{2}}}{a} \]
      4. associate-/l/N/A

        \[\leadsto \frac{b}{\color{blue}{a \cdot \frac{-3}{2}}} \]
      5. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(b, \color{blue}{\left(a \cdot \frac{-3}{2}\right)}\right) \]
      6. *-lowering-*.f6463.7%

        \[\leadsto \mathsf{/.f64}\left(b, \mathsf{*.f64}\left(a, \color{blue}{\frac{-3}{2}}\right)\right) \]
    13. Applied egg-rr63.7%

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

    if 1.44999999999999997e-272 < b

    1. Initial program 33.3%

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

        \[\leadsto \mathsf{/.f64}\left(\left(\left(\mathsf{neg}\left(b\right)\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}\right), \color{blue}{\left(3 \cdot a\right)}\right) \]
      2. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c} + \left(\mathsf{neg}\left(b\right)\right)\right), \left(\color{blue}{3} \cdot a\right)\right) \]
      3. unsub-negN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c} - b\right), \left(\color{blue}{3} \cdot a\right)\right) \]
      4. --lowering--.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\left(\sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}\right), b\right), \left(\color{blue}{3} \cdot a\right)\right) \]
      5. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\left(b \cdot b - \left(3 \cdot a\right) \cdot c\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      6. sub-negN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\left(b \cdot b + \left(\mathsf{neg}\left(\left(3 \cdot a\right) \cdot c\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      7. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\left(b \cdot b\right), \left(\mathsf{neg}\left(\left(3 \cdot a\right) \cdot c\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(\mathsf{neg}\left(\left(3 \cdot a\right) \cdot c\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      9. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(\mathsf{neg}\left(c \cdot \left(3 \cdot a\right)\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      10. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(c \cdot \left(\mathsf{neg}\left(3 \cdot a\right)\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      11. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(c, \left(\mathsf{neg}\left(3 \cdot a\right)\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      12. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(c, \left(\mathsf{neg}\left(a \cdot 3\right)\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      13. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(c, \left(a \cdot \left(\mathsf{neg}\left(3\right)\right)\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      14. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(c, \mathsf{*.f64}\left(a, \left(\mathsf{neg}\left(3\right)\right)\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      15. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(c, \mathsf{*.f64}\left(a, -3\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      16. *-lowering-*.f6433.3%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(c, \mathsf{*.f64}\left(a, -3\right)\right)\right)\right), b\right), \mathsf{*.f64}\left(3, \color{blue}{a}\right)\right) \]
    3. Simplified33.3%

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

      \[\leadsto \color{blue}{c \cdot \left(\frac{-3}{8} \cdot \frac{a \cdot c}{{b}^{3}} - \frac{1}{2} \cdot \frac{1}{b}\right)} \]
    6. Step-by-step derivation
      1. sub-negN/A

        \[\leadsto c \cdot \left(\frac{-3}{8} \cdot \frac{a \cdot c}{{b}^{3}} + \color{blue}{\left(\mathsf{neg}\left(\frac{1}{2} \cdot \frac{1}{b}\right)\right)}\right) \]
      2. associate-*r/N/A

        \[\leadsto c \cdot \left(\frac{\frac{-3}{8} \cdot \left(a \cdot c\right)}{{b}^{3}} + \left(\mathsf{neg}\left(\color{blue}{\frac{1}{2} \cdot \frac{1}{b}}\right)\right)\right) \]
      3. associate-*r*N/A

        \[\leadsto c \cdot \left(\frac{\left(\frac{-3}{8} \cdot a\right) \cdot c}{{b}^{3}} + \left(\mathsf{neg}\left(\color{blue}{\frac{1}{2}} \cdot \frac{1}{b}\right)\right)\right) \]
      4. associate-*l/N/A

        \[\leadsto c \cdot \left(\frac{\frac{-3}{8} \cdot a}{{b}^{3}} \cdot c + \left(\mathsf{neg}\left(\color{blue}{\frac{1}{2} \cdot \frac{1}{b}}\right)\right)\right) \]
      5. associate-*r/N/A

        \[\leadsto c \cdot \left(\left(\frac{-3}{8} \cdot \frac{a}{{b}^{3}}\right) \cdot c + \left(\mathsf{neg}\left(\color{blue}{\frac{1}{2}} \cdot \frac{1}{b}\right)\right)\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(c, \color{blue}{\left(\left(\frac{-3}{8} \cdot \frac{a}{{b}^{3}}\right) \cdot c + \left(\mathsf{neg}\left(\frac{1}{2} \cdot \frac{1}{b}\right)\right)\right)}\right) \]
      7. +-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(c, \left(\left(\mathsf{neg}\left(\frac{1}{2} \cdot \frac{1}{b}\right)\right) + \color{blue}{\left(\frac{-3}{8} \cdot \frac{a}{{b}^{3}}\right) \cdot c}\right)\right) \]
      8. +-lowering-+.f64N/A

        \[\leadsto \mathsf{*.f64}\left(c, \mathsf{+.f64}\left(\left(\mathsf{neg}\left(\frac{1}{2} \cdot \frac{1}{b}\right)\right), \color{blue}{\left(\left(\frac{-3}{8} \cdot \frac{a}{{b}^{3}}\right) \cdot c\right)}\right)\right) \]
      9. associate-*r/N/A

        \[\leadsto \mathsf{*.f64}\left(c, \mathsf{+.f64}\left(\left(\mathsf{neg}\left(\frac{\frac{1}{2} \cdot 1}{b}\right)\right), \left(\left(\color{blue}{\frac{-3}{8}} \cdot \frac{a}{{b}^{3}}\right) \cdot c\right)\right)\right) \]
      10. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(c, \mathsf{+.f64}\left(\left(\mathsf{neg}\left(\frac{\frac{1}{2}}{b}\right)\right), \left(\left(\frac{-3}{8} \cdot \frac{a}{{b}^{3}}\right) \cdot c\right)\right)\right) \]
      11. distribute-neg-fracN/A

        \[\leadsto \mathsf{*.f64}\left(c, \mathsf{+.f64}\left(\left(\frac{\mathsf{neg}\left(\frac{1}{2}\right)}{b}\right), \left(\color{blue}{\left(\frac{-3}{8} \cdot \frac{a}{{b}^{3}}\right)} \cdot c\right)\right)\right) \]
      12. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(c, \mathsf{+.f64}\left(\left(\frac{\frac{-1}{2}}{b}\right), \left(\left(\color{blue}{\frac{-3}{8}} \cdot \frac{a}{{b}^{3}}\right) \cdot c\right)\right)\right) \]
      13. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(c, \mathsf{+.f64}\left(\mathsf{/.f64}\left(\frac{-1}{2}, b\right), \left(\color{blue}{\left(\frac{-3}{8} \cdot \frac{a}{{b}^{3}}\right)} \cdot c\right)\right)\right) \]
      14. associate-*r/N/A

        \[\leadsto \mathsf{*.f64}\left(c, \mathsf{+.f64}\left(\mathsf{/.f64}\left(\frac{-1}{2}, b\right), \left(\frac{\frac{-3}{8} \cdot a}{{b}^{3}} \cdot c\right)\right)\right) \]
      15. associate-*l/N/A

        \[\leadsto \mathsf{*.f64}\left(c, \mathsf{+.f64}\left(\mathsf{/.f64}\left(\frac{-1}{2}, b\right), \left(\frac{\left(\frac{-3}{8} \cdot a\right) \cdot c}{\color{blue}{{b}^{3}}}\right)\right)\right) \]
      16. associate-*r*N/A

        \[\leadsto \mathsf{*.f64}\left(c, \mathsf{+.f64}\left(\mathsf{/.f64}\left(\frac{-1}{2}, b\right), \left(\frac{\frac{-3}{8} \cdot \left(a \cdot c\right)}{{\color{blue}{b}}^{3}}\right)\right)\right) \]
      17. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(c, \mathsf{+.f64}\left(\mathsf{/.f64}\left(\frac{-1}{2}, b\right), \mathsf{/.f64}\left(\left(\frac{-3}{8} \cdot \left(a \cdot c\right)\right), \color{blue}{\left({b}^{3}\right)}\right)\right)\right) \]
    7. Simplified59.6%

      \[\leadsto \color{blue}{c \cdot \left(\frac{-0.5}{b} + \frac{-0.375 \cdot \left(c \cdot a\right)}{b \cdot \left(b \cdot b\right)}\right)} \]
    8. Taylor expanded in b around inf

      \[\leadsto \mathsf{*.f64}\left(c, \color{blue}{\left(\frac{\frac{-1}{2}}{b}\right)}\right) \]
    9. Step-by-step derivation
      1. /-lowering-/.f6465.0%

        \[\leadsto \mathsf{*.f64}\left(c, \mathsf{/.f64}\left(\frac{-1}{2}, \color{blue}{b}\right)\right) \]
    10. Simplified65.0%

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

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

Alternative 7: 67.7% accurate, 11.6× speedup?

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

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

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


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

    1. Initial program 69.9%

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

        \[\leadsto \mathsf{/.f64}\left(\left(\left(\mathsf{neg}\left(b\right)\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}\right), \color{blue}{\left(3 \cdot a\right)}\right) \]
      2. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c} + \left(\mathsf{neg}\left(b\right)\right)\right), \left(\color{blue}{3} \cdot a\right)\right) \]
      3. unsub-negN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c} - b\right), \left(\color{blue}{3} \cdot a\right)\right) \]
      4. --lowering--.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\left(\sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}\right), b\right), \left(\color{blue}{3} \cdot a\right)\right) \]
      5. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\left(b \cdot b - \left(3 \cdot a\right) \cdot c\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      6. sub-negN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\left(b \cdot b + \left(\mathsf{neg}\left(\left(3 \cdot a\right) \cdot c\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      7. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\left(b \cdot b\right), \left(\mathsf{neg}\left(\left(3 \cdot a\right) \cdot c\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(\mathsf{neg}\left(\left(3 \cdot a\right) \cdot c\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      9. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(\mathsf{neg}\left(c \cdot \left(3 \cdot a\right)\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      10. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(c \cdot \left(\mathsf{neg}\left(3 \cdot a\right)\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      11. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(c, \left(\mathsf{neg}\left(3 \cdot a\right)\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      12. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(c, \left(\mathsf{neg}\left(a \cdot 3\right)\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      13. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(c, \left(a \cdot \left(\mathsf{neg}\left(3\right)\right)\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      14. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(c, \mathsf{*.f64}\left(a, \left(\mathsf{neg}\left(3\right)\right)\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      15. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(c, \mathsf{*.f64}\left(a, -3\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      16. *-lowering-*.f6469.9%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(c, \mathsf{*.f64}\left(a, -3\right)\right)\right)\right), b\right), \mathsf{*.f64}\left(3, \color{blue}{a}\right)\right) \]
    3. Simplified69.9%

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

      \[\leadsto \color{blue}{\frac{-2}{3} \cdot \frac{b}{a}} \]
    6. Step-by-step derivation
      1. associate-*r/N/A

        \[\leadsto \frac{\frac{-2}{3} \cdot b}{\color{blue}{a}} \]
      2. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\left(\frac{-2}{3} \cdot b\right), \color{blue}{a}\right) \]
      3. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\left(b \cdot \frac{-2}{3}\right), a\right) \]
      4. *-lowering-*.f6463.7%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(b, \frac{-2}{3}\right), a\right) \]
    7. Simplified63.7%

      \[\leadsto \color{blue}{\frac{b \cdot -0.6666666666666666}{a}} \]
    8. Step-by-step derivation
      1. associate-/l*N/A

        \[\leadsto b \cdot \color{blue}{\frac{\frac{-2}{3}}{a}} \]
      2. *-commutativeN/A

        \[\leadsto \frac{\frac{-2}{3}}{a} \cdot \color{blue}{b} \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{\frac{-2}{3}}{a}\right), \color{blue}{b}\right) \]
      4. /-lowering-/.f6463.7%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\frac{-2}{3}, a\right), b\right) \]
    9. Applied egg-rr63.7%

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

    if 1.44999999999999997e-272 < b

    1. Initial program 33.3%

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

        \[\leadsto \mathsf{/.f64}\left(\left(\left(\mathsf{neg}\left(b\right)\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}\right), \color{blue}{\left(3 \cdot a\right)}\right) \]
      2. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c} + \left(\mathsf{neg}\left(b\right)\right)\right), \left(\color{blue}{3} \cdot a\right)\right) \]
      3. unsub-negN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c} - b\right), \left(\color{blue}{3} \cdot a\right)\right) \]
      4. --lowering--.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\left(\sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}\right), b\right), \left(\color{blue}{3} \cdot a\right)\right) \]
      5. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\left(b \cdot b - \left(3 \cdot a\right) \cdot c\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      6. sub-negN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\left(b \cdot b + \left(\mathsf{neg}\left(\left(3 \cdot a\right) \cdot c\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      7. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\left(b \cdot b\right), \left(\mathsf{neg}\left(\left(3 \cdot a\right) \cdot c\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(\mathsf{neg}\left(\left(3 \cdot a\right) \cdot c\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      9. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(\mathsf{neg}\left(c \cdot \left(3 \cdot a\right)\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      10. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(c \cdot \left(\mathsf{neg}\left(3 \cdot a\right)\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      11. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(c, \left(\mathsf{neg}\left(3 \cdot a\right)\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      12. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(c, \left(\mathsf{neg}\left(a \cdot 3\right)\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      13. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(c, \left(a \cdot \left(\mathsf{neg}\left(3\right)\right)\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      14. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(c, \mathsf{*.f64}\left(a, \left(\mathsf{neg}\left(3\right)\right)\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      15. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(c, \mathsf{*.f64}\left(a, -3\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
      16. *-lowering-*.f6433.3%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(c, \mathsf{*.f64}\left(a, -3\right)\right)\right)\right), b\right), \mathsf{*.f64}\left(3, \color{blue}{a}\right)\right) \]
    3. Simplified33.3%

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

      \[\leadsto \color{blue}{c \cdot \left(\frac{-3}{8} \cdot \frac{a \cdot c}{{b}^{3}} - \frac{1}{2} \cdot \frac{1}{b}\right)} \]
    6. Step-by-step derivation
      1. sub-negN/A

        \[\leadsto c \cdot \left(\frac{-3}{8} \cdot \frac{a \cdot c}{{b}^{3}} + \color{blue}{\left(\mathsf{neg}\left(\frac{1}{2} \cdot \frac{1}{b}\right)\right)}\right) \]
      2. associate-*r/N/A

        \[\leadsto c \cdot \left(\frac{\frac{-3}{8} \cdot \left(a \cdot c\right)}{{b}^{3}} + \left(\mathsf{neg}\left(\color{blue}{\frac{1}{2} \cdot \frac{1}{b}}\right)\right)\right) \]
      3. associate-*r*N/A

        \[\leadsto c \cdot \left(\frac{\left(\frac{-3}{8} \cdot a\right) \cdot c}{{b}^{3}} + \left(\mathsf{neg}\left(\color{blue}{\frac{1}{2}} \cdot \frac{1}{b}\right)\right)\right) \]
      4. associate-*l/N/A

        \[\leadsto c \cdot \left(\frac{\frac{-3}{8} \cdot a}{{b}^{3}} \cdot c + \left(\mathsf{neg}\left(\color{blue}{\frac{1}{2} \cdot \frac{1}{b}}\right)\right)\right) \]
      5. associate-*r/N/A

        \[\leadsto c \cdot \left(\left(\frac{-3}{8} \cdot \frac{a}{{b}^{3}}\right) \cdot c + \left(\mathsf{neg}\left(\color{blue}{\frac{1}{2}} \cdot \frac{1}{b}\right)\right)\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(c, \color{blue}{\left(\left(\frac{-3}{8} \cdot \frac{a}{{b}^{3}}\right) \cdot c + \left(\mathsf{neg}\left(\frac{1}{2} \cdot \frac{1}{b}\right)\right)\right)}\right) \]
      7. +-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(c, \left(\left(\mathsf{neg}\left(\frac{1}{2} \cdot \frac{1}{b}\right)\right) + \color{blue}{\left(\frac{-3}{8} \cdot \frac{a}{{b}^{3}}\right) \cdot c}\right)\right) \]
      8. +-lowering-+.f64N/A

        \[\leadsto \mathsf{*.f64}\left(c, \mathsf{+.f64}\left(\left(\mathsf{neg}\left(\frac{1}{2} \cdot \frac{1}{b}\right)\right), \color{blue}{\left(\left(\frac{-3}{8} \cdot \frac{a}{{b}^{3}}\right) \cdot c\right)}\right)\right) \]
      9. associate-*r/N/A

        \[\leadsto \mathsf{*.f64}\left(c, \mathsf{+.f64}\left(\left(\mathsf{neg}\left(\frac{\frac{1}{2} \cdot 1}{b}\right)\right), \left(\left(\color{blue}{\frac{-3}{8}} \cdot \frac{a}{{b}^{3}}\right) \cdot c\right)\right)\right) \]
      10. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(c, \mathsf{+.f64}\left(\left(\mathsf{neg}\left(\frac{\frac{1}{2}}{b}\right)\right), \left(\left(\frac{-3}{8} \cdot \frac{a}{{b}^{3}}\right) \cdot c\right)\right)\right) \]
      11. distribute-neg-fracN/A

        \[\leadsto \mathsf{*.f64}\left(c, \mathsf{+.f64}\left(\left(\frac{\mathsf{neg}\left(\frac{1}{2}\right)}{b}\right), \left(\color{blue}{\left(\frac{-3}{8} \cdot \frac{a}{{b}^{3}}\right)} \cdot c\right)\right)\right) \]
      12. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(c, \mathsf{+.f64}\left(\left(\frac{\frac{-1}{2}}{b}\right), \left(\left(\color{blue}{\frac{-3}{8}} \cdot \frac{a}{{b}^{3}}\right) \cdot c\right)\right)\right) \]
      13. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(c, \mathsf{+.f64}\left(\mathsf{/.f64}\left(\frac{-1}{2}, b\right), \left(\color{blue}{\left(\frac{-3}{8} \cdot \frac{a}{{b}^{3}}\right)} \cdot c\right)\right)\right) \]
      14. associate-*r/N/A

        \[\leadsto \mathsf{*.f64}\left(c, \mathsf{+.f64}\left(\mathsf{/.f64}\left(\frac{-1}{2}, b\right), \left(\frac{\frac{-3}{8} \cdot a}{{b}^{3}} \cdot c\right)\right)\right) \]
      15. associate-*l/N/A

        \[\leadsto \mathsf{*.f64}\left(c, \mathsf{+.f64}\left(\mathsf{/.f64}\left(\frac{-1}{2}, b\right), \left(\frac{\left(\frac{-3}{8} \cdot a\right) \cdot c}{\color{blue}{{b}^{3}}}\right)\right)\right) \]
      16. associate-*r*N/A

        \[\leadsto \mathsf{*.f64}\left(c, \mathsf{+.f64}\left(\mathsf{/.f64}\left(\frac{-1}{2}, b\right), \left(\frac{\frac{-3}{8} \cdot \left(a \cdot c\right)}{{\color{blue}{b}}^{3}}\right)\right)\right) \]
      17. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(c, \mathsf{+.f64}\left(\mathsf{/.f64}\left(\frac{-1}{2}, b\right), \mathsf{/.f64}\left(\left(\frac{-3}{8} \cdot \left(a \cdot c\right)\right), \color{blue}{\left({b}^{3}\right)}\right)\right)\right) \]
    7. Simplified59.6%

      \[\leadsto \color{blue}{c \cdot \left(\frac{-0.5}{b} + \frac{-0.375 \cdot \left(c \cdot a\right)}{b \cdot \left(b \cdot b\right)}\right)} \]
    8. Taylor expanded in b around inf

      \[\leadsto \mathsf{*.f64}\left(c, \color{blue}{\left(\frac{\frac{-1}{2}}{b}\right)}\right) \]
    9. Step-by-step derivation
      1. /-lowering-/.f6465.0%

        \[\leadsto \mathsf{*.f64}\left(c, \mathsf{/.f64}\left(\frac{-1}{2}, \color{blue}{b}\right)\right) \]
    10. Simplified65.0%

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

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

Alternative 8: 35.5% accurate, 23.2× speedup?

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

\\
c \cdot \frac{-0.5}{b}
\end{array}
Derivation
  1. Initial program 54.3%

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

      \[\leadsto \mathsf{/.f64}\left(\left(\left(\mathsf{neg}\left(b\right)\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}\right), \color{blue}{\left(3 \cdot a\right)}\right) \]
    2. +-commutativeN/A

      \[\leadsto \mathsf{/.f64}\left(\left(\sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c} + \left(\mathsf{neg}\left(b\right)\right)\right), \left(\color{blue}{3} \cdot a\right)\right) \]
    3. unsub-negN/A

      \[\leadsto \mathsf{/.f64}\left(\left(\sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c} - b\right), \left(\color{blue}{3} \cdot a\right)\right) \]
    4. --lowering--.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\left(\sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}\right), b\right), \left(\color{blue}{3} \cdot a\right)\right) \]
    5. sqrt-lowering-sqrt.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\left(b \cdot b - \left(3 \cdot a\right) \cdot c\right)\right), b\right), \left(3 \cdot a\right)\right) \]
    6. sub-negN/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\left(b \cdot b + \left(\mathsf{neg}\left(\left(3 \cdot a\right) \cdot c\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
    7. +-lowering-+.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\left(b \cdot b\right), \left(\mathsf{neg}\left(\left(3 \cdot a\right) \cdot c\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
    8. *-lowering-*.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(\mathsf{neg}\left(\left(3 \cdot a\right) \cdot c\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
    9. *-commutativeN/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(\mathsf{neg}\left(c \cdot \left(3 \cdot a\right)\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
    10. distribute-rgt-neg-inN/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(c \cdot \left(\mathsf{neg}\left(3 \cdot a\right)\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
    11. *-lowering-*.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(c, \left(\mathsf{neg}\left(3 \cdot a\right)\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
    12. *-commutativeN/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(c, \left(\mathsf{neg}\left(a \cdot 3\right)\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
    13. distribute-rgt-neg-inN/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(c, \left(a \cdot \left(\mathsf{neg}\left(3\right)\right)\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
    14. *-lowering-*.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(c, \mathsf{*.f64}\left(a, \left(\mathsf{neg}\left(3\right)\right)\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
    15. metadata-evalN/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(c, \mathsf{*.f64}\left(a, -3\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
    16. *-lowering-*.f6454.3%

      \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(c, \mathsf{*.f64}\left(a, -3\right)\right)\right)\right), b\right), \mathsf{*.f64}\left(3, \color{blue}{a}\right)\right) \]
  3. Simplified54.3%

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

    \[\leadsto \color{blue}{c \cdot \left(\frac{-3}{8} \cdot \frac{a \cdot c}{{b}^{3}} - \frac{1}{2} \cdot \frac{1}{b}\right)} \]
  6. Step-by-step derivation
    1. sub-negN/A

      \[\leadsto c \cdot \left(\frac{-3}{8} \cdot \frac{a \cdot c}{{b}^{3}} + \color{blue}{\left(\mathsf{neg}\left(\frac{1}{2} \cdot \frac{1}{b}\right)\right)}\right) \]
    2. associate-*r/N/A

      \[\leadsto c \cdot \left(\frac{\frac{-3}{8} \cdot \left(a \cdot c\right)}{{b}^{3}} + \left(\mathsf{neg}\left(\color{blue}{\frac{1}{2} \cdot \frac{1}{b}}\right)\right)\right) \]
    3. associate-*r*N/A

      \[\leadsto c \cdot \left(\frac{\left(\frac{-3}{8} \cdot a\right) \cdot c}{{b}^{3}} + \left(\mathsf{neg}\left(\color{blue}{\frac{1}{2}} \cdot \frac{1}{b}\right)\right)\right) \]
    4. associate-*l/N/A

      \[\leadsto c \cdot \left(\frac{\frac{-3}{8} \cdot a}{{b}^{3}} \cdot c + \left(\mathsf{neg}\left(\color{blue}{\frac{1}{2} \cdot \frac{1}{b}}\right)\right)\right) \]
    5. associate-*r/N/A

      \[\leadsto c \cdot \left(\left(\frac{-3}{8} \cdot \frac{a}{{b}^{3}}\right) \cdot c + \left(\mathsf{neg}\left(\color{blue}{\frac{1}{2}} \cdot \frac{1}{b}\right)\right)\right) \]
    6. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(c, \color{blue}{\left(\left(\frac{-3}{8} \cdot \frac{a}{{b}^{3}}\right) \cdot c + \left(\mathsf{neg}\left(\frac{1}{2} \cdot \frac{1}{b}\right)\right)\right)}\right) \]
    7. +-commutativeN/A

      \[\leadsto \mathsf{*.f64}\left(c, \left(\left(\mathsf{neg}\left(\frac{1}{2} \cdot \frac{1}{b}\right)\right) + \color{blue}{\left(\frac{-3}{8} \cdot \frac{a}{{b}^{3}}\right) \cdot c}\right)\right) \]
    8. +-lowering-+.f64N/A

      \[\leadsto \mathsf{*.f64}\left(c, \mathsf{+.f64}\left(\left(\mathsf{neg}\left(\frac{1}{2} \cdot \frac{1}{b}\right)\right), \color{blue}{\left(\left(\frac{-3}{8} \cdot \frac{a}{{b}^{3}}\right) \cdot c\right)}\right)\right) \]
    9. associate-*r/N/A

      \[\leadsto \mathsf{*.f64}\left(c, \mathsf{+.f64}\left(\left(\mathsf{neg}\left(\frac{\frac{1}{2} \cdot 1}{b}\right)\right), \left(\left(\color{blue}{\frac{-3}{8}} \cdot \frac{a}{{b}^{3}}\right) \cdot c\right)\right)\right) \]
    10. metadata-evalN/A

      \[\leadsto \mathsf{*.f64}\left(c, \mathsf{+.f64}\left(\left(\mathsf{neg}\left(\frac{\frac{1}{2}}{b}\right)\right), \left(\left(\frac{-3}{8} \cdot \frac{a}{{b}^{3}}\right) \cdot c\right)\right)\right) \]
    11. distribute-neg-fracN/A

      \[\leadsto \mathsf{*.f64}\left(c, \mathsf{+.f64}\left(\left(\frac{\mathsf{neg}\left(\frac{1}{2}\right)}{b}\right), \left(\color{blue}{\left(\frac{-3}{8} \cdot \frac{a}{{b}^{3}}\right)} \cdot c\right)\right)\right) \]
    12. metadata-evalN/A

      \[\leadsto \mathsf{*.f64}\left(c, \mathsf{+.f64}\left(\left(\frac{\frac{-1}{2}}{b}\right), \left(\left(\color{blue}{\frac{-3}{8}} \cdot \frac{a}{{b}^{3}}\right) \cdot c\right)\right)\right) \]
    13. /-lowering-/.f64N/A

      \[\leadsto \mathsf{*.f64}\left(c, \mathsf{+.f64}\left(\mathsf{/.f64}\left(\frac{-1}{2}, b\right), \left(\color{blue}{\left(\frac{-3}{8} \cdot \frac{a}{{b}^{3}}\right)} \cdot c\right)\right)\right) \]
    14. associate-*r/N/A

      \[\leadsto \mathsf{*.f64}\left(c, \mathsf{+.f64}\left(\mathsf{/.f64}\left(\frac{-1}{2}, b\right), \left(\frac{\frac{-3}{8} \cdot a}{{b}^{3}} \cdot c\right)\right)\right) \]
    15. associate-*l/N/A

      \[\leadsto \mathsf{*.f64}\left(c, \mathsf{+.f64}\left(\mathsf{/.f64}\left(\frac{-1}{2}, b\right), \left(\frac{\left(\frac{-3}{8} \cdot a\right) \cdot c}{\color{blue}{{b}^{3}}}\right)\right)\right) \]
    16. associate-*r*N/A

      \[\leadsto \mathsf{*.f64}\left(c, \mathsf{+.f64}\left(\mathsf{/.f64}\left(\frac{-1}{2}, b\right), \left(\frac{\frac{-3}{8} \cdot \left(a \cdot c\right)}{{\color{blue}{b}}^{3}}\right)\right)\right) \]
    17. /-lowering-/.f64N/A

      \[\leadsto \mathsf{*.f64}\left(c, \mathsf{+.f64}\left(\mathsf{/.f64}\left(\frac{-1}{2}, b\right), \mathsf{/.f64}\left(\left(\frac{-3}{8} \cdot \left(a \cdot c\right)\right), \color{blue}{\left({b}^{3}\right)}\right)\right)\right) \]
  7. Simplified26.8%

    \[\leadsto \color{blue}{c \cdot \left(\frac{-0.5}{b} + \frac{-0.375 \cdot \left(c \cdot a\right)}{b \cdot \left(b \cdot b\right)}\right)} \]
  8. Taylor expanded in b around inf

    \[\leadsto \mathsf{*.f64}\left(c, \color{blue}{\left(\frac{\frac{-1}{2}}{b}\right)}\right) \]
  9. Step-by-step derivation
    1. /-lowering-/.f6428.8%

      \[\leadsto \mathsf{*.f64}\left(c, \mathsf{/.f64}\left(\frac{-1}{2}, \color{blue}{b}\right)\right) \]
  10. Simplified28.8%

    \[\leadsto c \cdot \color{blue}{\frac{-0.5}{b}} \]
  11. Add Preprocessing

Alternative 9: 10.9% accurate, 116.0× speedup?

\[\begin{array}{l} \\ 0 \end{array} \]
(FPCore (a b c) :precision binary64 0.0)
double code(double a, double b, double c) {
	return 0.0;
}
real(8) function code(a, b, c)
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    code = 0.0d0
end function
public static double code(double a, double b, double c) {
	return 0.0;
}
def code(a, b, c):
	return 0.0
function code(a, b, c)
	return 0.0
end
function tmp = code(a, b, c)
	tmp = 0.0;
end
code[a_, b_, c_] := 0.0
\begin{array}{l}

\\
0
\end{array}
Derivation
  1. Initial program 54.3%

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

      \[\leadsto \mathsf{/.f64}\left(\left(\left(\mathsf{neg}\left(b\right)\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}\right), \color{blue}{\left(3 \cdot a\right)}\right) \]
    2. +-commutativeN/A

      \[\leadsto \mathsf{/.f64}\left(\left(\sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c} + \left(\mathsf{neg}\left(b\right)\right)\right), \left(\color{blue}{3} \cdot a\right)\right) \]
    3. unsub-negN/A

      \[\leadsto \mathsf{/.f64}\left(\left(\sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c} - b\right), \left(\color{blue}{3} \cdot a\right)\right) \]
    4. --lowering--.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\left(\sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}\right), b\right), \left(\color{blue}{3} \cdot a\right)\right) \]
    5. sqrt-lowering-sqrt.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\left(b \cdot b - \left(3 \cdot a\right) \cdot c\right)\right), b\right), \left(3 \cdot a\right)\right) \]
    6. sub-negN/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\left(b \cdot b + \left(\mathsf{neg}\left(\left(3 \cdot a\right) \cdot c\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
    7. +-lowering-+.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\left(b \cdot b\right), \left(\mathsf{neg}\left(\left(3 \cdot a\right) \cdot c\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
    8. *-lowering-*.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(\mathsf{neg}\left(\left(3 \cdot a\right) \cdot c\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
    9. *-commutativeN/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(\mathsf{neg}\left(c \cdot \left(3 \cdot a\right)\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
    10. distribute-rgt-neg-inN/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(c \cdot \left(\mathsf{neg}\left(3 \cdot a\right)\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
    11. *-lowering-*.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(c, \left(\mathsf{neg}\left(3 \cdot a\right)\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
    12. *-commutativeN/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(c, \left(\mathsf{neg}\left(a \cdot 3\right)\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
    13. distribute-rgt-neg-inN/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(c, \left(a \cdot \left(\mathsf{neg}\left(3\right)\right)\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
    14. *-lowering-*.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(c, \mathsf{*.f64}\left(a, \left(\mathsf{neg}\left(3\right)\right)\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
    15. metadata-evalN/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(c, \mathsf{*.f64}\left(a, -3\right)\right)\right)\right), b\right), \left(3 \cdot a\right)\right) \]
    16. *-lowering-*.f6454.3%

      \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(c, \mathsf{*.f64}\left(a, -3\right)\right)\right)\right), b\right), \mathsf{*.f64}\left(3, \color{blue}{a}\right)\right) \]
  3. Simplified54.3%

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

    \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\color{blue}{b}, b\right), \mathsf{*.f64}\left(3, a\right)\right) \]
  6. Step-by-step derivation
    1. Simplified10.0%

      \[\leadsto \frac{\color{blue}{b} - b}{3 \cdot a} \]
    2. Step-by-step derivation
      1. div-subN/A

        \[\leadsto \frac{b}{3 \cdot a} - \color{blue}{\frac{b}{3 \cdot a}} \]
      2. +-inverses10.0%

        \[\leadsto 0 \]
    3. Applied egg-rr10.0%

      \[\leadsto \color{blue}{0} \]
    4. Add Preprocessing

    Reproduce

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