Cubic critical

Percentage Accurate: 52.3% → 85.5%
Time: 11.9s
Alternatives: 12
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 12 alternatives:

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

Initial Program: 52.3% accurate, 1.0× speedup?

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

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

Alternative 1: 85.5% accurate, 0.9× speedup?

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

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

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

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


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

    1. Initial program 51.8%

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

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

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

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

        \[\leadsto \frac{\left(\mathsf{neg}\left(b\right)\right) + \sqrt{b \cdot b - \color{blue}{3 \cdot \left(a \cdot c\right)}}}{3 \cdot a} \]
      5. *-lowering-*.f6451.8

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\sqrt{b \cdot b - \color{blue}{\left(3 \cdot a\right) \cdot c}} - b}{3 \cdot a} \]
      8. *-commutativeN/A

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

        \[\leadsto \frac{\sqrt{b \cdot b - \color{blue}{c \cdot \left(3 \cdot a\right)}} - b}{3 \cdot a} \]
      10. *-lowering-*.f6451.8

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

      \[\leadsto \frac{\color{blue}{\sqrt{b \cdot b - c \cdot \left(3 \cdot a\right)} - b}}{3 \cdot a} \]
    7. Step-by-step derivation
      1. *-commutativeN/A

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

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

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

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

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

        \[\leadsto \frac{\frac{\color{blue}{\sqrt{b \cdot b - c \cdot \left(3 \cdot a\right)}} - b}{a}}{3} \]
      7. sub-negN/A

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

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

        \[\leadsto \frac{\frac{\sqrt{\color{blue}{b \cdot b} + \left(\mathsf{neg}\left(c \cdot \left(3 \cdot a\right)\right)\right)} - b}{a}}{3} \]
      10. distribute-rgt-neg-inN/A

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

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

        \[\leadsto \frac{\frac{\sqrt{b \cdot b + c \cdot \left(\mathsf{neg}\left(\color{blue}{a \cdot 3}\right)\right)} - b}{a}}{3} \]
      13. distribute-rgt-neg-inN/A

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

        \[\leadsto \frac{\frac{\sqrt{b \cdot b + c \cdot \color{blue}{\left(a \cdot \left(\mathsf{neg}\left(3\right)\right)\right)}} - b}{a}}{3} \]
      15. metadata-eval51.9

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

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

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

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

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

        \[\leadsto \frac{\frac{\color{blue}{b \cdot -2}}{a}}{3} \]
      4. *-lowering-*.f6497.1

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

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

    if -2.4e125 < b < 6.2000000000000003e-103

    1. Initial program 81.9%

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

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

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

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

        \[\leadsto \frac{\left(\mathsf{neg}\left(b\right)\right) + \sqrt{b \cdot b - \color{blue}{3 \cdot \left(a \cdot c\right)}}}{3 \cdot a} \]
      5. *-lowering-*.f6481.9

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\sqrt{b \cdot b - \color{blue}{\left(3 \cdot a\right) \cdot c}} - b}{3 \cdot a} \]
      8. *-commutativeN/A

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

        \[\leadsto \frac{\sqrt{b \cdot b - \color{blue}{c \cdot \left(3 \cdot a\right)}} - b}{3 \cdot a} \]
      10. *-lowering-*.f6481.9

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

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

    if 6.2000000000000003e-103 < b

    1. Initial program 11.9%

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

      \[\leadsto \color{blue}{\frac{\frac{-1}{2} \cdot c + \frac{-3}{8} \cdot \frac{a \cdot {c}^{2}}{{b}^{2}}}{b}} \]
    4. Step-by-step derivation
      1. /-lowering-/.f64N/A

        \[\leadsto \color{blue}{\frac{\frac{-1}{2} \cdot c + \frac{-3}{8} \cdot \frac{a \cdot {c}^{2}}{{b}^{2}}}{b}} \]
    5. Simplified92.1%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{c \cdot \left(\frac{-1}{2} + a \cdot \left(\color{blue}{\frac{c}{{b}^{2}}} \cdot \frac{-3}{8}\right)\right)}{b} \]
      12. unpow2N/A

        \[\leadsto \frac{c \cdot \left(\frac{-1}{2} + a \cdot \left(\frac{c}{\color{blue}{b \cdot b}} \cdot \frac{-3}{8}\right)\right)}{b} \]
      13. *-lowering-*.f6494.4

        \[\leadsto \frac{c \cdot \left(-0.5 + a \cdot \left(\frac{c}{\color{blue}{b \cdot b}} \cdot -0.375\right)\right)}{b} \]
    8. Simplified94.4%

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

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

Alternative 2: 85.4% accurate, 0.9× speedup?

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

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

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

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


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

    1. Initial program 52.5%

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

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

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

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

        \[\leadsto \frac{\left(\mathsf{neg}\left(b\right)\right) + \sqrt{b \cdot b - \color{blue}{3 \cdot \left(a \cdot c\right)}}}{3 \cdot a} \]
      5. *-lowering-*.f6452.5

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\sqrt{b \cdot b - \color{blue}{\left(3 \cdot a\right) \cdot c}} - b}{3 \cdot a} \]
      8. *-commutativeN/A

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

        \[\leadsto \frac{\sqrt{b \cdot b - \color{blue}{c \cdot \left(3 \cdot a\right)}} - b}{3 \cdot a} \]
      10. *-lowering-*.f6452.5

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

      \[\leadsto \frac{\color{blue}{\sqrt{b \cdot b - c \cdot \left(3 \cdot a\right)} - b}}{3 \cdot a} \]
    7. Step-by-step derivation
      1. *-commutativeN/A

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

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

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

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

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

        \[\leadsto \frac{\frac{\color{blue}{\sqrt{b \cdot b - c \cdot \left(3 \cdot a\right)}} - b}{a}}{3} \]
      7. sub-negN/A

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

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

        \[\leadsto \frac{\frac{\sqrt{\color{blue}{b \cdot b} + \left(\mathsf{neg}\left(c \cdot \left(3 \cdot a\right)\right)\right)} - b}{a}}{3} \]
      10. distribute-rgt-neg-inN/A

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

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

        \[\leadsto \frac{\frac{\sqrt{b \cdot b + c \cdot \left(\mathsf{neg}\left(\color{blue}{a \cdot 3}\right)\right)} - b}{a}}{3} \]
      13. distribute-rgt-neg-inN/A

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

        \[\leadsto \frac{\frac{\sqrt{b \cdot b + c \cdot \color{blue}{\left(a \cdot \left(\mathsf{neg}\left(3\right)\right)\right)}} - b}{a}}{3} \]
      15. metadata-eval52.6

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

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

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

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

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

        \[\leadsto \frac{\frac{\color{blue}{b \cdot -2}}{a}}{3} \]
      4. *-lowering-*.f6497.1

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

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

    if -2.3000000000000001e119 < b < 2.20000000000000013e-102

    1. Initial program 81.7%

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

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

    if 2.20000000000000013e-102 < b

    1. Initial program 11.9%

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

      \[\leadsto \color{blue}{\frac{\frac{-1}{2} \cdot c + \frac{-3}{8} \cdot \frac{a \cdot {c}^{2}}{{b}^{2}}}{b}} \]
    4. Step-by-step derivation
      1. /-lowering-/.f64N/A

        \[\leadsto \color{blue}{\frac{\frac{-1}{2} \cdot c + \frac{-3}{8} \cdot \frac{a \cdot {c}^{2}}{{b}^{2}}}{b}} \]
    5. Simplified92.1%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{c \cdot \left(\frac{-1}{2} + a \cdot \left(\color{blue}{\frac{c}{{b}^{2}}} \cdot \frac{-3}{8}\right)\right)}{b} \]
      12. unpow2N/A

        \[\leadsto \frac{c \cdot \left(\frac{-1}{2} + a \cdot \left(\frac{c}{\color{blue}{b \cdot b}} \cdot \frac{-3}{8}\right)\right)}{b} \]
      13. *-lowering-*.f6494.4

        \[\leadsto \frac{c \cdot \left(-0.5 + a \cdot \left(\frac{c}{\color{blue}{b \cdot b}} \cdot -0.375\right)\right)}{b} \]
    8. Simplified94.4%

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

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

Alternative 3: 80.7% accurate, 1.0× speedup?

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

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

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

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


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

    1. Initial program 65.2%

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

      \[\leadsto \frac{\color{blue}{-1 \cdot \left(b \cdot \left(2 + \frac{-3}{2} \cdot \frac{a \cdot c}{{b}^{2}}\right)\right)}}{3 \cdot a} \]
    4. Step-by-step derivation
      1. *-commutativeN/A

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

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

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

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

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

    if -1.19999999999999995e-77 < b < 1.40000000000000006e-102

    1. Initial program 78.2%

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

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

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

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

        \[\leadsto \frac{\left(\mathsf{neg}\left(b\right)\right) + \sqrt{b \cdot b - \color{blue}{3 \cdot \left(a \cdot c\right)}}}{3 \cdot a} \]
      5. *-lowering-*.f6478.2

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\sqrt{b \cdot b - \color{blue}{\left(3 \cdot a\right) \cdot c}} - b}{3 \cdot a} \]
      8. *-commutativeN/A

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

        \[\leadsto \frac{\sqrt{b \cdot b - \color{blue}{c \cdot \left(3 \cdot a\right)}} - b}{3 \cdot a} \]
      10. *-lowering-*.f6478.2

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

      \[\leadsto \frac{\color{blue}{\sqrt{b \cdot b - c \cdot \left(3 \cdot a\right)} - b}}{3 \cdot a} \]
    7. Step-by-step derivation
      1. *-commutativeN/A

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

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

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

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

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

        \[\leadsto \frac{\frac{\color{blue}{\sqrt{b \cdot b - c \cdot \left(3 \cdot a\right)}} - b}{a}}{3} \]
      7. sub-negN/A

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

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

        \[\leadsto \frac{\frac{\sqrt{\color{blue}{b \cdot b} + \left(\mathsf{neg}\left(c \cdot \left(3 \cdot a\right)\right)\right)} - b}{a}}{3} \]
      10. distribute-rgt-neg-inN/A

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

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

        \[\leadsto \frac{\frac{\sqrt{b \cdot b + c \cdot \left(\mathsf{neg}\left(\color{blue}{a \cdot 3}\right)\right)} - b}{a}}{3} \]
      13. distribute-rgt-neg-inN/A

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

        \[\leadsto \frac{\frac{\sqrt{b \cdot b + c \cdot \color{blue}{\left(a \cdot \left(\mathsf{neg}\left(3\right)\right)\right)}} - b}{a}}{3} \]
      15. metadata-eval78.4

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

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

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

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

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

        \[\leadsto \frac{\frac{\sqrt{\color{blue}{c \cdot \left(a \cdot -3\right)}} - b}{a}}{3} \]
      4. *-commutativeN/A

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

        \[\leadsto \frac{\frac{\sqrt{\color{blue}{c \cdot \left(-3 \cdot a\right)}} - b}{a}}{3} \]
      6. *-commutativeN/A

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

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

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

    if 1.40000000000000006e-102 < b

    1. Initial program 11.9%

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

      \[\leadsto \color{blue}{\frac{\frac{-1}{2} \cdot c + \frac{-3}{8} \cdot \frac{a \cdot {c}^{2}}{{b}^{2}}}{b}} \]
    4. Step-by-step derivation
      1. /-lowering-/.f64N/A

        \[\leadsto \color{blue}{\frac{\frac{-1}{2} \cdot c + \frac{-3}{8} \cdot \frac{a \cdot {c}^{2}}{{b}^{2}}}{b}} \]
    5. Simplified92.1%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{c \cdot \left(\frac{-1}{2} + a \cdot \left(\color{blue}{\frac{c}{{b}^{2}}} \cdot \frac{-3}{8}\right)\right)}{b} \]
      12. unpow2N/A

        \[\leadsto \frac{c \cdot \left(\frac{-1}{2} + a \cdot \left(\frac{c}{\color{blue}{b \cdot b}} \cdot \frac{-3}{8}\right)\right)}{b} \]
      13. *-lowering-*.f6494.4

        \[\leadsto \frac{c \cdot \left(-0.5 + a \cdot \left(\frac{c}{\color{blue}{b \cdot b}} \cdot -0.375\right)\right)}{b} \]
    8. Simplified94.4%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -1.2 \cdot 10^{-77}:\\ \;\;\;\;\frac{b \cdot \left(\frac{\left(a \cdot \frac{c}{b}\right) \cdot \left(0 - -1.5\right)}{b} - 2\right)}{a \cdot 3}\\ \mathbf{elif}\;b \leq 1.4 \cdot 10^{-102}:\\ \;\;\;\;\frac{\frac{\sqrt{c \cdot \left(a \cdot -3\right)} - b}{a}}{3}\\ \mathbf{else}:\\ \;\;\;\;\frac{c \cdot \left(-0.5 + a \cdot \left(\frac{c}{b \cdot b} \cdot -0.375\right)\right)}{b}\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 80.6% accurate, 1.0× speedup?

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

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

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

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


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

    1. Initial program 65.2%

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

      \[\leadsto \frac{\color{blue}{-1 \cdot \left(b \cdot \left(2 + \frac{-3}{2} \cdot \frac{a \cdot c}{{b}^{2}}\right)\right)}}{3 \cdot a} \]
    4. Step-by-step derivation
      1. *-commutativeN/A

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

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

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

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

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

    if -2.1999999999999999e-79 < b < 6.00000000000000016e-111

    1. Initial program 78.2%

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

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

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

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

        \[\leadsto \frac{\left(\mathsf{neg}\left(b\right)\right) + \sqrt{b \cdot b - \color{blue}{3 \cdot \left(a \cdot c\right)}}}{3 \cdot a} \]
      5. *-lowering-*.f6478.2

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\sqrt{b \cdot b - \color{blue}{\left(3 \cdot a\right) \cdot c}} - b}{3 \cdot a} \]
      8. *-commutativeN/A

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

        \[\leadsto \frac{\sqrt{b \cdot b - \color{blue}{c \cdot \left(3 \cdot a\right)}} - b}{3 \cdot a} \]
      10. *-lowering-*.f6478.2

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

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

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

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

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

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

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

    if 6.00000000000000016e-111 < b

    1. Initial program 11.9%

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

      \[\leadsto \color{blue}{\frac{\frac{-1}{2} \cdot c + \frac{-3}{8} \cdot \frac{a \cdot {c}^{2}}{{b}^{2}}}{b}} \]
    4. Step-by-step derivation
      1. /-lowering-/.f64N/A

        \[\leadsto \color{blue}{\frac{\frac{-1}{2} \cdot c + \frac{-3}{8} \cdot \frac{a \cdot {c}^{2}}{{b}^{2}}}{b}} \]
    5. Simplified92.1%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{c \cdot \left(\frac{-1}{2} + a \cdot \left(\color{blue}{\frac{c}{{b}^{2}}} \cdot \frac{-3}{8}\right)\right)}{b} \]
      12. unpow2N/A

        \[\leadsto \frac{c \cdot \left(\frac{-1}{2} + a \cdot \left(\frac{c}{\color{blue}{b \cdot b}} \cdot \frac{-3}{8}\right)\right)}{b} \]
      13. *-lowering-*.f6494.4

        \[\leadsto \frac{c \cdot \left(-0.5 + a \cdot \left(\frac{c}{\color{blue}{b \cdot b}} \cdot -0.375\right)\right)}{b} \]
    8. Simplified94.4%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -2.2 \cdot 10^{-79}:\\ \;\;\;\;\frac{b \cdot \left(\frac{\left(a \cdot \frac{c}{b}\right) \cdot \left(0 - -1.5\right)}{b} - 2\right)}{a \cdot 3}\\ \mathbf{elif}\;b \leq 6 \cdot 10^{-111}:\\ \;\;\;\;\frac{\sqrt{-3 \cdot \left(a \cdot c\right)} - b}{a \cdot 3}\\ \mathbf{else}:\\ \;\;\;\;\frac{c \cdot \left(-0.5 + a \cdot \left(\frac{c}{b \cdot b} \cdot -0.375\right)\right)}{b}\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 68.4% accurate, 7.2× speedup?

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

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

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


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

    1. Initial program 70.3%

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

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

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

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

        \[\leadsto \frac{\left(\mathsf{neg}\left(b\right)\right) + \sqrt{b \cdot b - \color{blue}{3 \cdot \left(a \cdot c\right)}}}{3 \cdot a} \]
      5. *-lowering-*.f6470.3

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

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

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

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

        \[\leadsto \frac{\mathsf{neg}\left(\color{blue}{\left(2 + \left(\frac{-3}{2} \cdot \frac{a \cdot c}{{b}^{2}} + \frac{-9}{8} \cdot \frac{{a}^{2} \cdot {c}^{2}}{{b}^{4}}\right)\right) \cdot b}\right)}{3 \cdot a} \]
      3. distribute-rgt-neg-inN/A

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

        \[\leadsto \frac{\color{blue}{\left(2 + \left(\frac{-3}{2} \cdot \frac{a \cdot c}{{b}^{2}} + \frac{-9}{8} \cdot \frac{{a}^{2} \cdot {c}^{2}}{{b}^{4}}\right)\right) \cdot \left(\mathsf{neg}\left(b\right)\right)}}{3 \cdot a} \]
    7. Simplified50.1%

      \[\leadsto \frac{\color{blue}{\left(\left(2 + \frac{-1.5 \cdot \frac{a \cdot c}{b}}{b}\right) + \frac{-1.125 \cdot \left(c \cdot \left(a \cdot \left(a \cdot c\right)\right)\right)}{\left(b \cdot b\right) \cdot \left(b \cdot b\right)}\right) \cdot \left(0 - b\right)}}{3 \cdot a} \]
    8. Taylor expanded in c around 0

      \[\leadsto \color{blue}{\frac{-2}{3} \cdot \frac{b}{a} + \frac{1}{2} \cdot \frac{c}{b}} \]
    9. Step-by-step derivation
      1. +-lowering-+.f64N/A

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

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

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

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

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

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

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

        \[\leadsto \frac{b \cdot \frac{-2}{3}}{a} + \frac{\color{blue}{c \cdot \frac{1}{2}}}{b} \]
      9. *-lowering-*.f6464.4

        \[\leadsto \frac{b \cdot -0.6666666666666666}{a} + \frac{\color{blue}{c \cdot 0.5}}{b} \]
    10. Simplified64.4%

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

    if -1.999999999999994e-310 < b

    1. Initial program 21.3%

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

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

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

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

        \[\leadsto \frac{\color{blue}{c \cdot \frac{-1}{2}}}{b} \]
      4. *-lowering-*.f6480.4

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

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

Alternative 6: 68.2% accurate, 9.7× speedup?

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

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

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


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

    1. Initial program 70.3%

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

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

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

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

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

    if -1.999999999999994e-310 < b

    1. Initial program 21.3%

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

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

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

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

        \[\leadsto \frac{\color{blue}{c \cdot \frac{-1}{2}}}{b} \]
      4. *-lowering-*.f6480.4

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

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

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

Alternative 7: 68.2% accurate, 11.6× speedup?

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

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

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


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

    1. Initial program 70.3%

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{b}{a} \cdot -0.6666666666666666} \]
    6. Applied egg-rr64.3%

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

    if 9.00000000000000017e-308 < b

    1. Initial program 21.3%

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

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

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

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

        \[\leadsto \frac{\color{blue}{c \cdot \frac{-1}{2}}}{b} \]
      4. *-lowering-*.f6480.4

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

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

Alternative 8: 43.9% accurate, 11.6× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;0\\


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

    1. Initial program 68.4%

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{b}{a} \cdot -0.6666666666666666} \]
    6. Applied egg-rr56.3%

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

    if 1.72000000000000008e-37 < b

    1. Initial program 11.7%

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

      \[\leadsto \frac{\left(\mathsf{neg}\left(b\right)\right) + \sqrt{\color{blue}{{b}^{2}}}}{3 \cdot a} \]
    4. Step-by-step derivation
      1. unpow2N/A

        \[\leadsto \frac{\left(\mathsf{neg}\left(b\right)\right) + \sqrt{\color{blue}{b \cdot b}}}{3 \cdot a} \]
      2. *-lowering-*.f646.2

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

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

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

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

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

        \[\leadsto \frac{\frac{\color{blue}{\sqrt{b} \cdot \sqrt{b}} + \left(\mathsf{neg}\left(b\right)\right)}{a}}{3} \]
      5. rem-square-sqrtN/A

        \[\leadsto \frac{\frac{\color{blue}{b} + \left(\mathsf{neg}\left(b\right)\right)}{a}}{3} \]
      6. unsub-negN/A

        \[\leadsto \frac{\frac{\color{blue}{b - b}}{a}}{3} \]
      7. +-inversesN/A

        \[\leadsto \frac{\frac{\color{blue}{0}}{a}}{3} \]
      8. metadata-evalN/A

        \[\leadsto \frac{\frac{\color{blue}{\mathsf{neg}\left(0\right)}}{a}}{3} \]
      9. distribute-frac-negN/A

        \[\leadsto \frac{\color{blue}{\mathsf{neg}\left(\frac{0}{a}\right)}}{3} \]
      10. distribute-frac-neg2N/A

        \[\leadsto \frac{\color{blue}{\frac{0}{\mathsf{neg}\left(a\right)}}}{3} \]
      11. div0N/A

        \[\leadsto \frac{\color{blue}{0}}{3} \]
      12. metadata-evalN/A

        \[\leadsto \frac{\color{blue}{\mathsf{neg}\left(0\right)}}{3} \]
      13. +-inversesN/A

        \[\leadsto \frac{\mathsf{neg}\left(\color{blue}{\left(b - b\right)}\right)}{3} \]
      14. unsub-negN/A

        \[\leadsto \frac{\mathsf{neg}\left(\color{blue}{\left(b + \left(\mathsf{neg}\left(b\right)\right)\right)}\right)}{3} \]
      15. rem-square-sqrtN/A

        \[\leadsto \frac{\mathsf{neg}\left(\left(\color{blue}{\sqrt{b} \cdot \sqrt{b}} + \left(\mathsf{neg}\left(b\right)\right)\right)\right)}{3} \]
      16. sqrt-prodN/A

        \[\leadsto \frac{\mathsf{neg}\left(\left(\color{blue}{\sqrt{b \cdot b}} + \left(\mathsf{neg}\left(b\right)\right)\right)\right)}{3} \]
      17. +-commutativeN/A

        \[\leadsto \frac{\mathsf{neg}\left(\color{blue}{\left(\left(\mathsf{neg}\left(b\right)\right) + \sqrt{b \cdot b}\right)}\right)}{3} \]
      18. metadata-evalN/A

        \[\leadsto \frac{\mathsf{neg}\left(\left(\left(\mathsf{neg}\left(b\right)\right) + \sqrt{b \cdot b}\right)\right)}{\color{blue}{\mathsf{neg}\left(-3\right)}} \]
      19. metadata-evalN/A

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

        \[\leadsto \color{blue}{\frac{\left(\mathsf{neg}\left(b\right)\right) + \sqrt{b \cdot b}}{\mathsf{neg}\left(3\right)}} \]
      21. +-commutativeN/A

        \[\leadsto \frac{\color{blue}{\sqrt{b \cdot b} + \left(\mathsf{neg}\left(b\right)\right)}}{\mathsf{neg}\left(3\right)} \]
      22. sqrt-prodN/A

        \[\leadsto \frac{\color{blue}{\sqrt{b} \cdot \sqrt{b}} + \left(\mathsf{neg}\left(b\right)\right)}{\mathsf{neg}\left(3\right)} \]
      23. rem-square-sqrtN/A

        \[\leadsto \frac{\color{blue}{b} + \left(\mathsf{neg}\left(b\right)\right)}{\mathsf{neg}\left(3\right)} \]
      24. unsub-negN/A

        \[\leadsto \frac{\color{blue}{b - b}}{\mathsf{neg}\left(3\right)} \]
    7. Applied egg-rr28.3%

      \[\leadsto \color{blue}{0} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 9: 43.9% accurate, 11.6× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;0\\


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

    1. Initial program 68.4%

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

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

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

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

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

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

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

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

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

        \[\leadsto b \cdot \color{blue}{\frac{-0.6666666666666666}{a}} \]
    7. Applied egg-rr56.2%

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

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

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

        \[\leadsto \color{blue}{\frac{b}{\frac{a}{\frac{-2}{3}}}} \]
      4. /-lowering-/.f6456.2

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

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

    if 2.70000000000000016e-37 < b

    1. Initial program 11.7%

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

      \[\leadsto \frac{\left(\mathsf{neg}\left(b\right)\right) + \sqrt{\color{blue}{{b}^{2}}}}{3 \cdot a} \]
    4. Step-by-step derivation
      1. unpow2N/A

        \[\leadsto \frac{\left(\mathsf{neg}\left(b\right)\right) + \sqrt{\color{blue}{b \cdot b}}}{3 \cdot a} \]
      2. *-lowering-*.f646.2

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

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

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

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

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

        \[\leadsto \frac{\frac{\color{blue}{\sqrt{b} \cdot \sqrt{b}} + \left(\mathsf{neg}\left(b\right)\right)}{a}}{3} \]
      5. rem-square-sqrtN/A

        \[\leadsto \frac{\frac{\color{blue}{b} + \left(\mathsf{neg}\left(b\right)\right)}{a}}{3} \]
      6. unsub-negN/A

        \[\leadsto \frac{\frac{\color{blue}{b - b}}{a}}{3} \]
      7. +-inversesN/A

        \[\leadsto \frac{\frac{\color{blue}{0}}{a}}{3} \]
      8. metadata-evalN/A

        \[\leadsto \frac{\frac{\color{blue}{\mathsf{neg}\left(0\right)}}{a}}{3} \]
      9. distribute-frac-negN/A

        \[\leadsto \frac{\color{blue}{\mathsf{neg}\left(\frac{0}{a}\right)}}{3} \]
      10. distribute-frac-neg2N/A

        \[\leadsto \frac{\color{blue}{\frac{0}{\mathsf{neg}\left(a\right)}}}{3} \]
      11. div0N/A

        \[\leadsto \frac{\color{blue}{0}}{3} \]
      12. metadata-evalN/A

        \[\leadsto \frac{\color{blue}{\mathsf{neg}\left(0\right)}}{3} \]
      13. +-inversesN/A

        \[\leadsto \frac{\mathsf{neg}\left(\color{blue}{\left(b - b\right)}\right)}{3} \]
      14. unsub-negN/A

        \[\leadsto \frac{\mathsf{neg}\left(\color{blue}{\left(b + \left(\mathsf{neg}\left(b\right)\right)\right)}\right)}{3} \]
      15. rem-square-sqrtN/A

        \[\leadsto \frac{\mathsf{neg}\left(\left(\color{blue}{\sqrt{b} \cdot \sqrt{b}} + \left(\mathsf{neg}\left(b\right)\right)\right)\right)}{3} \]
      16. sqrt-prodN/A

        \[\leadsto \frac{\mathsf{neg}\left(\left(\color{blue}{\sqrt{b \cdot b}} + \left(\mathsf{neg}\left(b\right)\right)\right)\right)}{3} \]
      17. +-commutativeN/A

        \[\leadsto \frac{\mathsf{neg}\left(\color{blue}{\left(\left(\mathsf{neg}\left(b\right)\right) + \sqrt{b \cdot b}\right)}\right)}{3} \]
      18. metadata-evalN/A

        \[\leadsto \frac{\mathsf{neg}\left(\left(\left(\mathsf{neg}\left(b\right)\right) + \sqrt{b \cdot b}\right)\right)}{\color{blue}{\mathsf{neg}\left(-3\right)}} \]
      19. metadata-evalN/A

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

        \[\leadsto \color{blue}{\frac{\left(\mathsf{neg}\left(b\right)\right) + \sqrt{b \cdot b}}{\mathsf{neg}\left(3\right)}} \]
      21. +-commutativeN/A

        \[\leadsto \frac{\color{blue}{\sqrt{b \cdot b} + \left(\mathsf{neg}\left(b\right)\right)}}{\mathsf{neg}\left(3\right)} \]
      22. sqrt-prodN/A

        \[\leadsto \frac{\color{blue}{\sqrt{b} \cdot \sqrt{b}} + \left(\mathsf{neg}\left(b\right)\right)}{\mathsf{neg}\left(3\right)} \]
      23. rem-square-sqrtN/A

        \[\leadsto \frac{\color{blue}{b} + \left(\mathsf{neg}\left(b\right)\right)}{\mathsf{neg}\left(3\right)} \]
      24. unsub-negN/A

        \[\leadsto \frac{\color{blue}{b - b}}{\mathsf{neg}\left(3\right)} \]
    7. Applied egg-rr28.3%

      \[\leadsto \color{blue}{0} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 10: 43.9% accurate, 11.6× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;0\\


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

    1. Initial program 68.4%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{-0.6666666666666666}{\color{blue}{\frac{a}{b}}} \]
    7. Applied egg-rr56.2%

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

    if 1.72000000000000008e-37 < b

    1. Initial program 11.7%

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

      \[\leadsto \frac{\left(\mathsf{neg}\left(b\right)\right) + \sqrt{\color{blue}{{b}^{2}}}}{3 \cdot a} \]
    4. Step-by-step derivation
      1. unpow2N/A

        \[\leadsto \frac{\left(\mathsf{neg}\left(b\right)\right) + \sqrt{\color{blue}{b \cdot b}}}{3 \cdot a} \]
      2. *-lowering-*.f646.2

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

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

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

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

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

        \[\leadsto \frac{\frac{\color{blue}{\sqrt{b} \cdot \sqrt{b}} + \left(\mathsf{neg}\left(b\right)\right)}{a}}{3} \]
      5. rem-square-sqrtN/A

        \[\leadsto \frac{\frac{\color{blue}{b} + \left(\mathsf{neg}\left(b\right)\right)}{a}}{3} \]
      6. unsub-negN/A

        \[\leadsto \frac{\frac{\color{blue}{b - b}}{a}}{3} \]
      7. +-inversesN/A

        \[\leadsto \frac{\frac{\color{blue}{0}}{a}}{3} \]
      8. metadata-evalN/A

        \[\leadsto \frac{\frac{\color{blue}{\mathsf{neg}\left(0\right)}}{a}}{3} \]
      9. distribute-frac-negN/A

        \[\leadsto \frac{\color{blue}{\mathsf{neg}\left(\frac{0}{a}\right)}}{3} \]
      10. distribute-frac-neg2N/A

        \[\leadsto \frac{\color{blue}{\frac{0}{\mathsf{neg}\left(a\right)}}}{3} \]
      11. div0N/A

        \[\leadsto \frac{\color{blue}{0}}{3} \]
      12. metadata-evalN/A

        \[\leadsto \frac{\color{blue}{\mathsf{neg}\left(0\right)}}{3} \]
      13. +-inversesN/A

        \[\leadsto \frac{\mathsf{neg}\left(\color{blue}{\left(b - b\right)}\right)}{3} \]
      14. unsub-negN/A

        \[\leadsto \frac{\mathsf{neg}\left(\color{blue}{\left(b + \left(\mathsf{neg}\left(b\right)\right)\right)}\right)}{3} \]
      15. rem-square-sqrtN/A

        \[\leadsto \frac{\mathsf{neg}\left(\left(\color{blue}{\sqrt{b} \cdot \sqrt{b}} + \left(\mathsf{neg}\left(b\right)\right)\right)\right)}{3} \]
      16. sqrt-prodN/A

        \[\leadsto \frac{\mathsf{neg}\left(\left(\color{blue}{\sqrt{b \cdot b}} + \left(\mathsf{neg}\left(b\right)\right)\right)\right)}{3} \]
      17. +-commutativeN/A

        \[\leadsto \frac{\mathsf{neg}\left(\color{blue}{\left(\left(\mathsf{neg}\left(b\right)\right) + \sqrt{b \cdot b}\right)}\right)}{3} \]
      18. metadata-evalN/A

        \[\leadsto \frac{\mathsf{neg}\left(\left(\left(\mathsf{neg}\left(b\right)\right) + \sqrt{b \cdot b}\right)\right)}{\color{blue}{\mathsf{neg}\left(-3\right)}} \]
      19. metadata-evalN/A

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

        \[\leadsto \color{blue}{\frac{\left(\mathsf{neg}\left(b\right)\right) + \sqrt{b \cdot b}}{\mathsf{neg}\left(3\right)}} \]
      21. +-commutativeN/A

        \[\leadsto \frac{\color{blue}{\sqrt{b \cdot b} + \left(\mathsf{neg}\left(b\right)\right)}}{\mathsf{neg}\left(3\right)} \]
      22. sqrt-prodN/A

        \[\leadsto \frac{\color{blue}{\sqrt{b} \cdot \sqrt{b}} + \left(\mathsf{neg}\left(b\right)\right)}{\mathsf{neg}\left(3\right)} \]
      23. rem-square-sqrtN/A

        \[\leadsto \frac{\color{blue}{b} + \left(\mathsf{neg}\left(b\right)\right)}{\mathsf{neg}\left(3\right)} \]
      24. unsub-negN/A

        \[\leadsto \frac{\color{blue}{b - b}}{\mathsf{neg}\left(3\right)} \]
    7. Applied egg-rr28.3%

      \[\leadsto \color{blue}{0} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 11: 43.9% accurate, 11.6× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;0\\


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

    1. Initial program 68.4%

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

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

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

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

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

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

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

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

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

        \[\leadsto b \cdot \color{blue}{\frac{-0.6666666666666666}{a}} \]
    7. Applied egg-rr56.2%

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

    if 1.72000000000000008e-37 < b

    1. Initial program 11.7%

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

      \[\leadsto \frac{\left(\mathsf{neg}\left(b\right)\right) + \sqrt{\color{blue}{{b}^{2}}}}{3 \cdot a} \]
    4. Step-by-step derivation
      1. unpow2N/A

        \[\leadsto \frac{\left(\mathsf{neg}\left(b\right)\right) + \sqrt{\color{blue}{b \cdot b}}}{3 \cdot a} \]
      2. *-lowering-*.f646.2

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

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

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

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

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

        \[\leadsto \frac{\frac{\color{blue}{\sqrt{b} \cdot \sqrt{b}} + \left(\mathsf{neg}\left(b\right)\right)}{a}}{3} \]
      5. rem-square-sqrtN/A

        \[\leadsto \frac{\frac{\color{blue}{b} + \left(\mathsf{neg}\left(b\right)\right)}{a}}{3} \]
      6. unsub-negN/A

        \[\leadsto \frac{\frac{\color{blue}{b - b}}{a}}{3} \]
      7. +-inversesN/A

        \[\leadsto \frac{\frac{\color{blue}{0}}{a}}{3} \]
      8. metadata-evalN/A

        \[\leadsto \frac{\frac{\color{blue}{\mathsf{neg}\left(0\right)}}{a}}{3} \]
      9. distribute-frac-negN/A

        \[\leadsto \frac{\color{blue}{\mathsf{neg}\left(\frac{0}{a}\right)}}{3} \]
      10. distribute-frac-neg2N/A

        \[\leadsto \frac{\color{blue}{\frac{0}{\mathsf{neg}\left(a\right)}}}{3} \]
      11. div0N/A

        \[\leadsto \frac{\color{blue}{0}}{3} \]
      12. metadata-evalN/A

        \[\leadsto \frac{\color{blue}{\mathsf{neg}\left(0\right)}}{3} \]
      13. +-inversesN/A

        \[\leadsto \frac{\mathsf{neg}\left(\color{blue}{\left(b - b\right)}\right)}{3} \]
      14. unsub-negN/A

        \[\leadsto \frac{\mathsf{neg}\left(\color{blue}{\left(b + \left(\mathsf{neg}\left(b\right)\right)\right)}\right)}{3} \]
      15. rem-square-sqrtN/A

        \[\leadsto \frac{\mathsf{neg}\left(\left(\color{blue}{\sqrt{b} \cdot \sqrt{b}} + \left(\mathsf{neg}\left(b\right)\right)\right)\right)}{3} \]
      16. sqrt-prodN/A

        \[\leadsto \frac{\mathsf{neg}\left(\left(\color{blue}{\sqrt{b \cdot b}} + \left(\mathsf{neg}\left(b\right)\right)\right)\right)}{3} \]
      17. +-commutativeN/A

        \[\leadsto \frac{\mathsf{neg}\left(\color{blue}{\left(\left(\mathsf{neg}\left(b\right)\right) + \sqrt{b \cdot b}\right)}\right)}{3} \]
      18. metadata-evalN/A

        \[\leadsto \frac{\mathsf{neg}\left(\left(\left(\mathsf{neg}\left(b\right)\right) + \sqrt{b \cdot b}\right)\right)}{\color{blue}{\mathsf{neg}\left(-3\right)}} \]
      19. metadata-evalN/A

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

        \[\leadsto \color{blue}{\frac{\left(\mathsf{neg}\left(b\right)\right) + \sqrt{b \cdot b}}{\mathsf{neg}\left(3\right)}} \]
      21. +-commutativeN/A

        \[\leadsto \frac{\color{blue}{\sqrt{b \cdot b} + \left(\mathsf{neg}\left(b\right)\right)}}{\mathsf{neg}\left(3\right)} \]
      22. sqrt-prodN/A

        \[\leadsto \frac{\color{blue}{\sqrt{b} \cdot \sqrt{b}} + \left(\mathsf{neg}\left(b\right)\right)}{\mathsf{neg}\left(3\right)} \]
      23. rem-square-sqrtN/A

        \[\leadsto \frac{\color{blue}{b} + \left(\mathsf{neg}\left(b\right)\right)}{\mathsf{neg}\left(3\right)} \]
      24. unsub-negN/A

        \[\leadsto \frac{\color{blue}{b - b}}{\mathsf{neg}\left(3\right)} \]
    7. Applied egg-rr28.3%

      \[\leadsto \color{blue}{0} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 12: 11.6% 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 50.2%

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

    \[\leadsto \frac{\left(\mathsf{neg}\left(b\right)\right) + \sqrt{\color{blue}{{b}^{2}}}}{3 \cdot a} \]
  4. Step-by-step derivation
    1. unpow2N/A

      \[\leadsto \frac{\left(\mathsf{neg}\left(b\right)\right) + \sqrt{\color{blue}{b \cdot b}}}{3 \cdot a} \]
    2. *-lowering-*.f6427.8

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

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

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

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

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

      \[\leadsto \frac{\frac{\color{blue}{\sqrt{b} \cdot \sqrt{b}} + \left(\mathsf{neg}\left(b\right)\right)}{a}}{3} \]
    5. rem-square-sqrtN/A

      \[\leadsto \frac{\frac{\color{blue}{b} + \left(\mathsf{neg}\left(b\right)\right)}{a}}{3} \]
    6. unsub-negN/A

      \[\leadsto \frac{\frac{\color{blue}{b - b}}{a}}{3} \]
    7. +-inversesN/A

      \[\leadsto \frac{\frac{\color{blue}{0}}{a}}{3} \]
    8. metadata-evalN/A

      \[\leadsto \frac{\frac{\color{blue}{\mathsf{neg}\left(0\right)}}{a}}{3} \]
    9. distribute-frac-negN/A

      \[\leadsto \frac{\color{blue}{\mathsf{neg}\left(\frac{0}{a}\right)}}{3} \]
    10. distribute-frac-neg2N/A

      \[\leadsto \frac{\color{blue}{\frac{0}{\mathsf{neg}\left(a\right)}}}{3} \]
    11. div0N/A

      \[\leadsto \frac{\color{blue}{0}}{3} \]
    12. metadata-evalN/A

      \[\leadsto \frac{\color{blue}{\mathsf{neg}\left(0\right)}}{3} \]
    13. +-inversesN/A

      \[\leadsto \frac{\mathsf{neg}\left(\color{blue}{\left(b - b\right)}\right)}{3} \]
    14. unsub-negN/A

      \[\leadsto \frac{\mathsf{neg}\left(\color{blue}{\left(b + \left(\mathsf{neg}\left(b\right)\right)\right)}\right)}{3} \]
    15. rem-square-sqrtN/A

      \[\leadsto \frac{\mathsf{neg}\left(\left(\color{blue}{\sqrt{b} \cdot \sqrt{b}} + \left(\mathsf{neg}\left(b\right)\right)\right)\right)}{3} \]
    16. sqrt-prodN/A

      \[\leadsto \frac{\mathsf{neg}\left(\left(\color{blue}{\sqrt{b \cdot b}} + \left(\mathsf{neg}\left(b\right)\right)\right)\right)}{3} \]
    17. +-commutativeN/A

      \[\leadsto \frac{\mathsf{neg}\left(\color{blue}{\left(\left(\mathsf{neg}\left(b\right)\right) + \sqrt{b \cdot b}\right)}\right)}{3} \]
    18. metadata-evalN/A

      \[\leadsto \frac{\mathsf{neg}\left(\left(\left(\mathsf{neg}\left(b\right)\right) + \sqrt{b \cdot b}\right)\right)}{\color{blue}{\mathsf{neg}\left(-3\right)}} \]
    19. metadata-evalN/A

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

      \[\leadsto \color{blue}{\frac{\left(\mathsf{neg}\left(b\right)\right) + \sqrt{b \cdot b}}{\mathsf{neg}\left(3\right)}} \]
    21. +-commutativeN/A

      \[\leadsto \frac{\color{blue}{\sqrt{b \cdot b} + \left(\mathsf{neg}\left(b\right)\right)}}{\mathsf{neg}\left(3\right)} \]
    22. sqrt-prodN/A

      \[\leadsto \frac{\color{blue}{\sqrt{b} \cdot \sqrt{b}} + \left(\mathsf{neg}\left(b\right)\right)}{\mathsf{neg}\left(3\right)} \]
    23. rem-square-sqrtN/A

      \[\leadsto \frac{\color{blue}{b} + \left(\mathsf{neg}\left(b\right)\right)}{\mathsf{neg}\left(3\right)} \]
    24. unsub-negN/A

      \[\leadsto \frac{\color{blue}{b - b}}{\mathsf{neg}\left(3\right)} \]
  7. Applied egg-rr10.9%

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

Reproduce

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