Quadratic roots, narrow range

Percentage Accurate: 55.4% → 92.6%
Time: 18.0s
Alternatives: 18
Speedup: 23.2×

Specification

?
\[\left(\left(1.0536712127723509 \cdot 10^{-8} < a \land a < 94906265.62425156\right) \land \left(1.0536712127723509 \cdot 10^{-8} < b \land b < 94906265.62425156\right)\right) \land \left(1.0536712127723509 \cdot 10^{-8} < c \land c < 94906265.62425156\right)\]
\[\begin{array}{l} \\ \frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a} \end{array} \]
(FPCore (a b c)
 :precision binary64
 (/ (+ (- b) (sqrt (- (* b b) (* (* 4.0 a) c)))) (* 2.0 a)))
double code(double a, double b, double c) {
	return (-b + sqrt(((b * b) - ((4.0 * a) * c)))) / (2.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) - ((4.0d0 * a) * c)))) / (2.0d0 * a)
end function
public static double code(double a, double b, double c) {
	return (-b + Math.sqrt(((b * b) - ((4.0 * a) * c)))) / (2.0 * a);
}
def code(a, b, c):
	return (-b + math.sqrt(((b * b) - ((4.0 * a) * c)))) / (2.0 * a)
function code(a, b, c)
	return Float64(Float64(Float64(-b) + sqrt(Float64(Float64(b * b) - Float64(Float64(4.0 * a) * c)))) / Float64(2.0 * a))
end
function tmp = code(a, b, c)
	tmp = (-b + sqrt(((b * b) - ((4.0 * a) * c)))) / (2.0 * a);
end
code[a_, b_, c_] := N[(N[((-b) + N[Sqrt[N[(N[(b * b), $MachinePrecision] - N[(N[(4.0 * a), $MachinePrecision] * c), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[(2.0 * a), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \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 18 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: 55.4% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a} \end{array} \]
(FPCore (a b c)
 :precision binary64
 (/ (+ (- b) (sqrt (- (* b b) (* (* 4.0 a) c)))) (* 2.0 a)))
double code(double a, double b, double c) {
	return (-b + sqrt(((b * b) - ((4.0 * a) * c)))) / (2.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) - ((4.0d0 * a) * c)))) / (2.0d0 * a)
end function
public static double code(double a, double b, double c) {
	return (-b + Math.sqrt(((b * b) - ((4.0 * a) * c)))) / (2.0 * a);
}
def code(a, b, c):
	return (-b + math.sqrt(((b * b) - ((4.0 * a) * c)))) / (2.0 * a)
function code(a, b, c)
	return Float64(Float64(Float64(-b) + sqrt(Float64(Float64(b * b) - Float64(Float64(4.0 * a) * c)))) / Float64(2.0 * a))
end
function tmp = code(a, b, c)
	tmp = (-b + sqrt(((b * b) - ((4.0 * a) * c)))) / (2.0 * a);
end
code[a_, b_, c_] := N[(N[((-b) + N[Sqrt[N[(N[(b * b), $MachinePrecision] - N[(N[(4.0 * a), $MachinePrecision] * c), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[(2.0 * a), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

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

Alternative 1: 92.6% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \left(c \cdot \left(c \cdot \left(c \cdot c\right)\right)\right) \cdot 20\\ t_1 := \frac{b}{\frac{c}{b}}\\ t_2 := c \cdot \left(t\_1 + a \cdot -4\right)\\ t_3 := c \cdot \left(c \cdot \left(c \cdot -2\right)\right)\\ t_4 := b \cdot \left(b \cdot b\right)\\ t_5 := \left(b \cdot b\right) \cdot t\_4\\ t_6 := c \cdot \frac{c}{t\_4}\\ t_7 := \frac{t\_3}{t\_5}\\ t_8 := b \cdot t\_5\\ t_9 := \frac{\left(a \cdot -0.25\right) \cdot t\_0}{b \cdot t\_8}\\ \mathbf{if}\;\frac{\sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c} - b}{a \cdot 2} \leq -16:\\ \;\;\;\;\frac{{t\_2}^{1.5} - t\_4}{\left(a \cdot 2\right) \cdot \left(b \cdot b + \left(t\_2 + b \cdot \sqrt{t\_2}\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{a \cdot \left(\left(a \cdot a\right) \cdot \left(\frac{t\_7}{\frac{t\_5}{t\_3}} + \frac{t\_9}{\frac{b}{\frac{a \cdot -0.25}{\frac{t\_8}{t\_0}}}}\right) - \frac{t\_6}{\frac{b}{\frac{c}{t\_1}}}\right)}{t\_6 + a \cdot \left(t\_7 + t\_9\right)} - \frac{c}{b}\\ \end{array} \end{array} \]
(FPCore (a b c)
 :precision binary64
 (let* ((t_0 (* (* c (* c (* c c))) 20.0))
        (t_1 (/ b (/ c b)))
        (t_2 (* c (+ t_1 (* a -4.0))))
        (t_3 (* c (* c (* c -2.0))))
        (t_4 (* b (* b b)))
        (t_5 (* (* b b) t_4))
        (t_6 (* c (/ c t_4)))
        (t_7 (/ t_3 t_5))
        (t_8 (* b t_5))
        (t_9 (/ (* (* a -0.25) t_0) (* b t_8))))
   (if (<= (/ (- (sqrt (- (* b b) (* (* 4.0 a) c))) b) (* a 2.0)) -16.0)
     (/
      (- (pow t_2 1.5) t_4)
      (* (* a 2.0) (+ (* b b) (+ t_2 (* b (sqrt t_2))))))
     (-
      (/
       (*
        a
        (-
         (*
          (* a a)
          (+ (/ t_7 (/ t_5 t_3)) (/ t_9 (/ b (/ (* a -0.25) (/ t_8 t_0))))))
         (/ t_6 (/ b (/ c t_1)))))
       (+ t_6 (* a (+ t_7 t_9))))
      (/ c b)))))
double code(double a, double b, double c) {
	double t_0 = (c * (c * (c * c))) * 20.0;
	double t_1 = b / (c / b);
	double t_2 = c * (t_1 + (a * -4.0));
	double t_3 = c * (c * (c * -2.0));
	double t_4 = b * (b * b);
	double t_5 = (b * b) * t_4;
	double t_6 = c * (c / t_4);
	double t_7 = t_3 / t_5;
	double t_8 = b * t_5;
	double t_9 = ((a * -0.25) * t_0) / (b * t_8);
	double tmp;
	if (((sqrt(((b * b) - ((4.0 * a) * c))) - b) / (a * 2.0)) <= -16.0) {
		tmp = (pow(t_2, 1.5) - t_4) / ((a * 2.0) * ((b * b) + (t_2 + (b * sqrt(t_2)))));
	} else {
		tmp = ((a * (((a * a) * ((t_7 / (t_5 / t_3)) + (t_9 / (b / ((a * -0.25) / (t_8 / t_0)))))) - (t_6 / (b / (c / t_1))))) / (t_6 + (a * (t_7 + t_9)))) - (c / b);
	}
	return tmp;
}
real(8) function code(a, b, c)
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: t_3
    real(8) :: t_4
    real(8) :: t_5
    real(8) :: t_6
    real(8) :: t_7
    real(8) :: t_8
    real(8) :: t_9
    real(8) :: tmp
    t_0 = (c * (c * (c * c))) * 20.0d0
    t_1 = b / (c / b)
    t_2 = c * (t_1 + (a * (-4.0d0)))
    t_3 = c * (c * (c * (-2.0d0)))
    t_4 = b * (b * b)
    t_5 = (b * b) * t_4
    t_6 = c * (c / t_4)
    t_7 = t_3 / t_5
    t_8 = b * t_5
    t_9 = ((a * (-0.25d0)) * t_0) / (b * t_8)
    if (((sqrt(((b * b) - ((4.0d0 * a) * c))) - b) / (a * 2.0d0)) <= (-16.0d0)) then
        tmp = ((t_2 ** 1.5d0) - t_4) / ((a * 2.0d0) * ((b * b) + (t_2 + (b * sqrt(t_2)))))
    else
        tmp = ((a * (((a * a) * ((t_7 / (t_5 / t_3)) + (t_9 / (b / ((a * (-0.25d0)) / (t_8 / t_0)))))) - (t_6 / (b / (c / t_1))))) / (t_6 + (a * (t_7 + t_9)))) - (c / b)
    end if
    code = tmp
end function
public static double code(double a, double b, double c) {
	double t_0 = (c * (c * (c * c))) * 20.0;
	double t_1 = b / (c / b);
	double t_2 = c * (t_1 + (a * -4.0));
	double t_3 = c * (c * (c * -2.0));
	double t_4 = b * (b * b);
	double t_5 = (b * b) * t_4;
	double t_6 = c * (c / t_4);
	double t_7 = t_3 / t_5;
	double t_8 = b * t_5;
	double t_9 = ((a * -0.25) * t_0) / (b * t_8);
	double tmp;
	if (((Math.sqrt(((b * b) - ((4.0 * a) * c))) - b) / (a * 2.0)) <= -16.0) {
		tmp = (Math.pow(t_2, 1.5) - t_4) / ((a * 2.0) * ((b * b) + (t_2 + (b * Math.sqrt(t_2)))));
	} else {
		tmp = ((a * (((a * a) * ((t_7 / (t_5 / t_3)) + (t_9 / (b / ((a * -0.25) / (t_8 / t_0)))))) - (t_6 / (b / (c / t_1))))) / (t_6 + (a * (t_7 + t_9)))) - (c / b);
	}
	return tmp;
}
def code(a, b, c):
	t_0 = (c * (c * (c * c))) * 20.0
	t_1 = b / (c / b)
	t_2 = c * (t_1 + (a * -4.0))
	t_3 = c * (c * (c * -2.0))
	t_4 = b * (b * b)
	t_5 = (b * b) * t_4
	t_6 = c * (c / t_4)
	t_7 = t_3 / t_5
	t_8 = b * t_5
	t_9 = ((a * -0.25) * t_0) / (b * t_8)
	tmp = 0
	if ((math.sqrt(((b * b) - ((4.0 * a) * c))) - b) / (a * 2.0)) <= -16.0:
		tmp = (math.pow(t_2, 1.5) - t_4) / ((a * 2.0) * ((b * b) + (t_2 + (b * math.sqrt(t_2)))))
	else:
		tmp = ((a * (((a * a) * ((t_7 / (t_5 / t_3)) + (t_9 / (b / ((a * -0.25) / (t_8 / t_0)))))) - (t_6 / (b / (c / t_1))))) / (t_6 + (a * (t_7 + t_9)))) - (c / b)
	return tmp
function code(a, b, c)
	t_0 = Float64(Float64(c * Float64(c * Float64(c * c))) * 20.0)
	t_1 = Float64(b / Float64(c / b))
	t_2 = Float64(c * Float64(t_1 + Float64(a * -4.0)))
	t_3 = Float64(c * Float64(c * Float64(c * -2.0)))
	t_4 = Float64(b * Float64(b * b))
	t_5 = Float64(Float64(b * b) * t_4)
	t_6 = Float64(c * Float64(c / t_4))
	t_7 = Float64(t_3 / t_5)
	t_8 = Float64(b * t_5)
	t_9 = Float64(Float64(Float64(a * -0.25) * t_0) / Float64(b * t_8))
	tmp = 0.0
	if (Float64(Float64(sqrt(Float64(Float64(b * b) - Float64(Float64(4.0 * a) * c))) - b) / Float64(a * 2.0)) <= -16.0)
		tmp = Float64(Float64((t_2 ^ 1.5) - t_4) / Float64(Float64(a * 2.0) * Float64(Float64(b * b) + Float64(t_2 + Float64(b * sqrt(t_2))))));
	else
		tmp = Float64(Float64(Float64(a * Float64(Float64(Float64(a * a) * Float64(Float64(t_7 / Float64(t_5 / t_3)) + Float64(t_9 / Float64(b / Float64(Float64(a * -0.25) / Float64(t_8 / t_0)))))) - Float64(t_6 / Float64(b / Float64(c / t_1))))) / Float64(t_6 + Float64(a * Float64(t_7 + t_9)))) - Float64(c / b));
	end
	return tmp
end
function tmp_2 = code(a, b, c)
	t_0 = (c * (c * (c * c))) * 20.0;
	t_1 = b / (c / b);
	t_2 = c * (t_1 + (a * -4.0));
	t_3 = c * (c * (c * -2.0));
	t_4 = b * (b * b);
	t_5 = (b * b) * t_4;
	t_6 = c * (c / t_4);
	t_7 = t_3 / t_5;
	t_8 = b * t_5;
	t_9 = ((a * -0.25) * t_0) / (b * t_8);
	tmp = 0.0;
	if (((sqrt(((b * b) - ((4.0 * a) * c))) - b) / (a * 2.0)) <= -16.0)
		tmp = ((t_2 ^ 1.5) - t_4) / ((a * 2.0) * ((b * b) + (t_2 + (b * sqrt(t_2)))));
	else
		tmp = ((a * (((a * a) * ((t_7 / (t_5 / t_3)) + (t_9 / (b / ((a * -0.25) / (t_8 / t_0)))))) - (t_6 / (b / (c / t_1))))) / (t_6 + (a * (t_7 + t_9)))) - (c / b);
	end
	tmp_2 = tmp;
end
code[a_, b_, c_] := Block[{t$95$0 = N[(N[(c * N[(c * N[(c * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * 20.0), $MachinePrecision]}, Block[{t$95$1 = N[(b / N[(c / b), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(c * N[(t$95$1 + N[(a * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(c * N[(c * N[(c * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(b * N[(b * b), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[(N[(b * b), $MachinePrecision] * t$95$4), $MachinePrecision]}, Block[{t$95$6 = N[(c * N[(c / t$95$4), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$7 = N[(t$95$3 / t$95$5), $MachinePrecision]}, Block[{t$95$8 = N[(b * t$95$5), $MachinePrecision]}, Block[{t$95$9 = N[(N[(N[(a * -0.25), $MachinePrecision] * t$95$0), $MachinePrecision] / N[(b * t$95$8), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(N[(N[Sqrt[N[(N[(b * b), $MachinePrecision] - N[(N[(4.0 * a), $MachinePrecision] * c), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision] / N[(a * 2.0), $MachinePrecision]), $MachinePrecision], -16.0], N[(N[(N[Power[t$95$2, 1.5], $MachinePrecision] - t$95$4), $MachinePrecision] / N[(N[(a * 2.0), $MachinePrecision] * N[(N[(b * b), $MachinePrecision] + N[(t$95$2 + N[(b * N[Sqrt[t$95$2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(a * N[(N[(N[(a * a), $MachinePrecision] * N[(N[(t$95$7 / N[(t$95$5 / t$95$3), $MachinePrecision]), $MachinePrecision] + N[(t$95$9 / N[(b / N[(N[(a * -0.25), $MachinePrecision] / N[(t$95$8 / t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(t$95$6 / N[(b / N[(c / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(t$95$6 + N[(a * N[(t$95$7 + t$95$9), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(c / b), $MachinePrecision]), $MachinePrecision]]]]]]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \left(c \cdot \left(c \cdot \left(c \cdot c\right)\right)\right) \cdot 20\\
t_1 := \frac{b}{\frac{c}{b}}\\
t_2 := c \cdot \left(t\_1 + a \cdot -4\right)\\
t_3 := c \cdot \left(c \cdot \left(c \cdot -2\right)\right)\\
t_4 := b \cdot \left(b \cdot b\right)\\
t_5 := \left(b \cdot b\right) \cdot t\_4\\
t_6 := c \cdot \frac{c}{t\_4}\\
t_7 := \frac{t\_3}{t\_5}\\
t_8 := b \cdot t\_5\\
t_9 := \frac{\left(a \cdot -0.25\right) \cdot t\_0}{b \cdot t\_8}\\
\mathbf{if}\;\frac{\sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c} - b}{a \cdot 2} \leq -16:\\
\;\;\;\;\frac{{t\_2}^{1.5} - t\_4}{\left(a \cdot 2\right) \cdot \left(b \cdot b + \left(t\_2 + b \cdot \sqrt{t\_2}\right)\right)}\\

\mathbf{else}:\\
\;\;\;\;\frac{a \cdot \left(\left(a \cdot a\right) \cdot \left(\frac{t\_7}{\frac{t\_5}{t\_3}} + \frac{t\_9}{\frac{b}{\frac{a \cdot -0.25}{\frac{t\_8}{t\_0}}}}\right) - \frac{t\_6}{\frac{b}{\frac{c}{t\_1}}}\right)}{t\_6 + a \cdot \left(t\_7 + t\_9\right)} - \frac{c}{b}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (/.f64 (+.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 #s(literal 4 binary64) a) c)))) (*.f64 #s(literal 2 binary64) a)) < -16

    1. Initial program 86.6%

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{neg.f64}\left(b\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(c, \left(\frac{{b}^{2}}{c} - 4 \cdot a\right)\right)\right)\right), \mathsf{*.f64}\left(2, a\right)\right) \]
      2. cancel-sign-sub-invN/A

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{neg.f64}\left(b\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(c, \mathsf{+.f64}\left(\left(\frac{{b}^{2}}{c}\right), \left(-4 \cdot a\right)\right)\right)\right)\right), \mathsf{*.f64}\left(2, a\right)\right) \]
      5. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{neg.f64}\left(b\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(c, \mathsf{+.f64}\left(\mathsf{/.f64}\left(\left({b}^{2}\right), c\right), \left(-4 \cdot a\right)\right)\right)\right)\right), \mathsf{*.f64}\left(2, a\right)\right) \]
      6. unpow2N/A

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{neg.f64}\left(b\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(c, \mathsf{+.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(b, b\right), c\right), \left(a \cdot -4\right)\right)\right)\right)\right), \mathsf{*.f64}\left(2, a\right)\right) \]
      9. *-lowering-*.f6486.2%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{neg.f64}\left(b\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(c, \mathsf{+.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(b, b\right), c\right), \mathsf{*.f64}\left(a, -4\right)\right)\right)\right)\right), \mathsf{*.f64}\left(2, a\right)\right) \]
    5. Simplified86.2%

      \[\leadsto \frac{\left(-b\right) + \sqrt{\color{blue}{c \cdot \left(\frac{b \cdot b}{c} + a \cdot -4\right)}}}{2 \cdot a} \]
    6. Step-by-step derivation
      1. flip3-+N/A

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\left({\left(\mathsf{neg}\left(b\right)\right)}^{3} + {\left(\sqrt{c \cdot \left(\frac{b \cdot b}{c} + a \cdot -4\right)}\right)}^{3}\right), \color{blue}{\left(\left(1 \cdot \left(a \cdot 2\right)\right) \cdot \left(\left(\mathsf{neg}\left(b\right)\right) \cdot \left(\mathsf{neg}\left(b\right)\right) + \left(\sqrt{c \cdot \left(\frac{b \cdot b}{c} + a \cdot -4\right)} \cdot \sqrt{c \cdot \left(\frac{b \cdot b}{c} + a \cdot -4\right)} - \left(\mathsf{neg}\left(b\right)\right) \cdot \sqrt{c \cdot \left(\frac{b \cdot b}{c} + a \cdot -4\right)}\right)\right)\right)}\right) \]
    7. Applied egg-rr87.5%

      \[\leadsto \color{blue}{\frac{\left(0 - b \cdot \left(b \cdot b\right)\right) + {\left(c \cdot \left(\frac{b}{\frac{c}{b}} + a \cdot -4\right)\right)}^{1.5}}{\left(a \cdot 2\right) \cdot \left(b \cdot b + \left(c \cdot \left(\frac{b}{\frac{c}{b}} + a \cdot -4\right) + b \cdot \sqrt{c \cdot \left(\frac{b}{\frac{c}{b}} + a \cdot -4\right)}\right)\right)}} \]

    if -16 < (/.f64 (+.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 #s(literal 4 binary64) a) c)))) (*.f64 #s(literal 2 binary64) a))

    1. Initial program 54.2%

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

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

      \[\leadsto \color{blue}{a \cdot \left(a \cdot \left(\frac{\left(c \cdot \left(c \cdot c\right)\right) \cdot -2}{{b}^{5}} + \frac{\left(-0.25 \cdot a\right) \cdot \frac{{c}^{4} \cdot 20}{{b}^{6}}}{b}\right) - \frac{c \cdot \frac{\frac{c}{b}}{b}}{b}\right) - \frac{c}{b}} \]
    5. Applied egg-rr93.4%

      \[\leadsto \color{blue}{\frac{\left(\left(a \cdot a\right) \cdot \left(\frac{\frac{c \cdot \left(c \cdot \left(c \cdot -2\right)\right)}{\left(b \cdot b\right) \cdot \left(b \cdot \left(b \cdot b\right)\right)}}{\frac{\left(b \cdot b\right) \cdot \left(b \cdot \left(b \cdot b\right)\right)}{c \cdot \left(c \cdot \left(c \cdot -2\right)\right)}} + \frac{\frac{\left(-0.25 \cdot a\right) \cdot \left(\left(c \cdot \left(c \cdot \left(c \cdot c\right)\right)\right) \cdot 20\right)}{b \cdot \left(b \cdot \left(\left(b \cdot b\right) \cdot \left(b \cdot \left(b \cdot b\right)\right)\right)\right)}}{\frac{b}{\frac{-0.25 \cdot a}{\frac{b \cdot \left(\left(b \cdot b\right) \cdot \left(b \cdot \left(b \cdot b\right)\right)\right)}{\left(c \cdot \left(c \cdot \left(c \cdot c\right)\right)\right) \cdot 20}}}}\right) - \frac{c \cdot \frac{c}{b \cdot \left(b \cdot b\right)}}{\frac{b}{\frac{c}{\frac{b}{\frac{c}{b}}}}}\right) \cdot a}{a \cdot \left(\frac{\left(-0.25 \cdot a\right) \cdot \left(\left(c \cdot \left(c \cdot \left(c \cdot c\right)\right)\right) \cdot 20\right)}{b \cdot \left(b \cdot \left(\left(b \cdot b\right) \cdot \left(b \cdot \left(b \cdot b\right)\right)\right)\right)} + \frac{c \cdot \left(c \cdot \left(c \cdot -2\right)\right)}{\left(b \cdot b\right) \cdot \left(b \cdot \left(b \cdot b\right)\right)}\right) + c \cdot \frac{c}{b \cdot \left(b \cdot b\right)}}} - \frac{c}{b} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification92.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{\sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c} - b}{a \cdot 2} \leq -16:\\ \;\;\;\;\frac{{\left(c \cdot \left(\frac{b}{\frac{c}{b}} + a \cdot -4\right)\right)}^{1.5} - b \cdot \left(b \cdot b\right)}{\left(a \cdot 2\right) \cdot \left(b \cdot b + \left(c \cdot \left(\frac{b}{\frac{c}{b}} + a \cdot -4\right) + b \cdot \sqrt{c \cdot \left(\frac{b}{\frac{c}{b}} + a \cdot -4\right)}\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{a \cdot \left(\left(a \cdot a\right) \cdot \left(\frac{\frac{c \cdot \left(c \cdot \left(c \cdot -2\right)\right)}{\left(b \cdot b\right) \cdot \left(b \cdot \left(b \cdot b\right)\right)}}{\frac{\left(b \cdot b\right) \cdot \left(b \cdot \left(b \cdot b\right)\right)}{c \cdot \left(c \cdot \left(c \cdot -2\right)\right)}} + \frac{\frac{\left(a \cdot -0.25\right) \cdot \left(\left(c \cdot \left(c \cdot \left(c \cdot c\right)\right)\right) \cdot 20\right)}{b \cdot \left(b \cdot \left(\left(b \cdot b\right) \cdot \left(b \cdot \left(b \cdot b\right)\right)\right)\right)}}{\frac{b}{\frac{a \cdot -0.25}{\frac{b \cdot \left(\left(b \cdot b\right) \cdot \left(b \cdot \left(b \cdot b\right)\right)\right)}{\left(c \cdot \left(c \cdot \left(c \cdot c\right)\right)\right) \cdot 20}}}}\right) - \frac{c \cdot \frac{c}{b \cdot \left(b \cdot b\right)}}{\frac{b}{\frac{c}{\frac{b}{\frac{c}{b}}}}}\right)}{c \cdot \frac{c}{b \cdot \left(b \cdot b\right)} + a \cdot \left(\frac{c \cdot \left(c \cdot \left(c \cdot -2\right)\right)}{\left(b \cdot b\right) \cdot \left(b \cdot \left(b \cdot b\right)\right)} + \frac{\left(a \cdot -0.25\right) \cdot \left(\left(c \cdot \left(c \cdot \left(c \cdot c\right)\right)\right) \cdot 20\right)}{b \cdot \left(b \cdot \left(\left(b \cdot b\right) \cdot \left(b \cdot \left(b \cdot b\right)\right)\right)\right)}\right)} - \frac{c}{b}\\ \end{array} \]
  5. Add Preprocessing

Alternative 2: 92.6% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{b}{\frac{c}{b}}\\ t_1 := c \cdot \left(t\_0 + a \cdot -4\right)\\ t_2 := \left(c \cdot \left(c \cdot \left(c \cdot c\right)\right)\right) \cdot 20\\ t_3 := b \cdot \left(b \cdot b\right)\\ t_4 := \left(b \cdot b\right) \cdot t\_3\\ t_5 := c \cdot \frac{c}{t\_3}\\ t_6 := b \cdot t\_4\\ t_7 := \frac{\left(a \cdot -0.25\right) \cdot t\_2}{b \cdot t\_6}\\ t_8 := c \cdot \left(c \cdot \left(c \cdot -2\right)\right)\\ t_9 := \frac{t\_8}{t\_4}\\ \mathbf{if}\;\frac{\sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c} - b}{a \cdot 2} \leq -16:\\ \;\;\;\;\frac{\left({t\_1}^{1.5} - t\_3\right) \cdot \frac{0.5}{a}}{b \cdot b + \left(t\_1 + b \cdot \sqrt{t\_1}\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{a \cdot \left(\left(a \cdot a\right) \cdot \left(\frac{t\_9}{\frac{t\_4}{t\_8}} + \frac{t\_7}{\frac{b}{\frac{a \cdot -0.25}{\frac{t\_6}{t\_2}}}}\right) - \frac{t\_5}{\frac{b}{\frac{c}{t\_0}}}\right)}{t\_5 + a \cdot \left(t\_9 + t\_7\right)} - \frac{c}{b}\\ \end{array} \end{array} \]
(FPCore (a b c)
 :precision binary64
 (let* ((t_0 (/ b (/ c b)))
        (t_1 (* c (+ t_0 (* a -4.0))))
        (t_2 (* (* c (* c (* c c))) 20.0))
        (t_3 (* b (* b b)))
        (t_4 (* (* b b) t_3))
        (t_5 (* c (/ c t_3)))
        (t_6 (* b t_4))
        (t_7 (/ (* (* a -0.25) t_2) (* b t_6)))
        (t_8 (* c (* c (* c -2.0))))
        (t_9 (/ t_8 t_4)))
   (if (<= (/ (- (sqrt (- (* b b) (* (* 4.0 a) c))) b) (* a 2.0)) -16.0)
     (/
      (* (- (pow t_1 1.5) t_3) (/ 0.5 a))
      (+ (* b b) (+ t_1 (* b (sqrt t_1)))))
     (-
      (/
       (*
        a
        (-
         (*
          (* a a)
          (+ (/ t_9 (/ t_4 t_8)) (/ t_7 (/ b (/ (* a -0.25) (/ t_6 t_2))))))
         (/ t_5 (/ b (/ c t_0)))))
       (+ t_5 (* a (+ t_9 t_7))))
      (/ c b)))))
double code(double a, double b, double c) {
	double t_0 = b / (c / b);
	double t_1 = c * (t_0 + (a * -4.0));
	double t_2 = (c * (c * (c * c))) * 20.0;
	double t_3 = b * (b * b);
	double t_4 = (b * b) * t_3;
	double t_5 = c * (c / t_3);
	double t_6 = b * t_4;
	double t_7 = ((a * -0.25) * t_2) / (b * t_6);
	double t_8 = c * (c * (c * -2.0));
	double t_9 = t_8 / t_4;
	double tmp;
	if (((sqrt(((b * b) - ((4.0 * a) * c))) - b) / (a * 2.0)) <= -16.0) {
		tmp = ((pow(t_1, 1.5) - t_3) * (0.5 / a)) / ((b * b) + (t_1 + (b * sqrt(t_1))));
	} else {
		tmp = ((a * (((a * a) * ((t_9 / (t_4 / t_8)) + (t_7 / (b / ((a * -0.25) / (t_6 / t_2)))))) - (t_5 / (b / (c / t_0))))) / (t_5 + (a * (t_9 + t_7)))) - (c / b);
	}
	return tmp;
}
real(8) function code(a, b, c)
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: t_3
    real(8) :: t_4
    real(8) :: t_5
    real(8) :: t_6
    real(8) :: t_7
    real(8) :: t_8
    real(8) :: t_9
    real(8) :: tmp
    t_0 = b / (c / b)
    t_1 = c * (t_0 + (a * (-4.0d0)))
    t_2 = (c * (c * (c * c))) * 20.0d0
    t_3 = b * (b * b)
    t_4 = (b * b) * t_3
    t_5 = c * (c / t_3)
    t_6 = b * t_4
    t_7 = ((a * (-0.25d0)) * t_2) / (b * t_6)
    t_8 = c * (c * (c * (-2.0d0)))
    t_9 = t_8 / t_4
    if (((sqrt(((b * b) - ((4.0d0 * a) * c))) - b) / (a * 2.0d0)) <= (-16.0d0)) then
        tmp = (((t_1 ** 1.5d0) - t_3) * (0.5d0 / a)) / ((b * b) + (t_1 + (b * sqrt(t_1))))
    else
        tmp = ((a * (((a * a) * ((t_9 / (t_4 / t_8)) + (t_7 / (b / ((a * (-0.25d0)) / (t_6 / t_2)))))) - (t_5 / (b / (c / t_0))))) / (t_5 + (a * (t_9 + t_7)))) - (c / b)
    end if
    code = tmp
end function
public static double code(double a, double b, double c) {
	double t_0 = b / (c / b);
	double t_1 = c * (t_0 + (a * -4.0));
	double t_2 = (c * (c * (c * c))) * 20.0;
	double t_3 = b * (b * b);
	double t_4 = (b * b) * t_3;
	double t_5 = c * (c / t_3);
	double t_6 = b * t_4;
	double t_7 = ((a * -0.25) * t_2) / (b * t_6);
	double t_8 = c * (c * (c * -2.0));
	double t_9 = t_8 / t_4;
	double tmp;
	if (((Math.sqrt(((b * b) - ((4.0 * a) * c))) - b) / (a * 2.0)) <= -16.0) {
		tmp = ((Math.pow(t_1, 1.5) - t_3) * (0.5 / a)) / ((b * b) + (t_1 + (b * Math.sqrt(t_1))));
	} else {
		tmp = ((a * (((a * a) * ((t_9 / (t_4 / t_8)) + (t_7 / (b / ((a * -0.25) / (t_6 / t_2)))))) - (t_5 / (b / (c / t_0))))) / (t_5 + (a * (t_9 + t_7)))) - (c / b);
	}
	return tmp;
}
def code(a, b, c):
	t_0 = b / (c / b)
	t_1 = c * (t_0 + (a * -4.0))
	t_2 = (c * (c * (c * c))) * 20.0
	t_3 = b * (b * b)
	t_4 = (b * b) * t_3
	t_5 = c * (c / t_3)
	t_6 = b * t_4
	t_7 = ((a * -0.25) * t_2) / (b * t_6)
	t_8 = c * (c * (c * -2.0))
	t_9 = t_8 / t_4
	tmp = 0
	if ((math.sqrt(((b * b) - ((4.0 * a) * c))) - b) / (a * 2.0)) <= -16.0:
		tmp = ((math.pow(t_1, 1.5) - t_3) * (0.5 / a)) / ((b * b) + (t_1 + (b * math.sqrt(t_1))))
	else:
		tmp = ((a * (((a * a) * ((t_9 / (t_4 / t_8)) + (t_7 / (b / ((a * -0.25) / (t_6 / t_2)))))) - (t_5 / (b / (c / t_0))))) / (t_5 + (a * (t_9 + t_7)))) - (c / b)
	return tmp
function code(a, b, c)
	t_0 = Float64(b / Float64(c / b))
	t_1 = Float64(c * Float64(t_0 + Float64(a * -4.0)))
	t_2 = Float64(Float64(c * Float64(c * Float64(c * c))) * 20.0)
	t_3 = Float64(b * Float64(b * b))
	t_4 = Float64(Float64(b * b) * t_3)
	t_5 = Float64(c * Float64(c / t_3))
	t_6 = Float64(b * t_4)
	t_7 = Float64(Float64(Float64(a * -0.25) * t_2) / Float64(b * t_6))
	t_8 = Float64(c * Float64(c * Float64(c * -2.0)))
	t_9 = Float64(t_8 / t_4)
	tmp = 0.0
	if (Float64(Float64(sqrt(Float64(Float64(b * b) - Float64(Float64(4.0 * a) * c))) - b) / Float64(a * 2.0)) <= -16.0)
		tmp = Float64(Float64(Float64((t_1 ^ 1.5) - t_3) * Float64(0.5 / a)) / Float64(Float64(b * b) + Float64(t_1 + Float64(b * sqrt(t_1)))));
	else
		tmp = Float64(Float64(Float64(a * Float64(Float64(Float64(a * a) * Float64(Float64(t_9 / Float64(t_4 / t_8)) + Float64(t_7 / Float64(b / Float64(Float64(a * -0.25) / Float64(t_6 / t_2)))))) - Float64(t_5 / Float64(b / Float64(c / t_0))))) / Float64(t_5 + Float64(a * Float64(t_9 + t_7)))) - Float64(c / b));
	end
	return tmp
end
function tmp_2 = code(a, b, c)
	t_0 = b / (c / b);
	t_1 = c * (t_0 + (a * -4.0));
	t_2 = (c * (c * (c * c))) * 20.0;
	t_3 = b * (b * b);
	t_4 = (b * b) * t_3;
	t_5 = c * (c / t_3);
	t_6 = b * t_4;
	t_7 = ((a * -0.25) * t_2) / (b * t_6);
	t_8 = c * (c * (c * -2.0));
	t_9 = t_8 / t_4;
	tmp = 0.0;
	if (((sqrt(((b * b) - ((4.0 * a) * c))) - b) / (a * 2.0)) <= -16.0)
		tmp = (((t_1 ^ 1.5) - t_3) * (0.5 / a)) / ((b * b) + (t_1 + (b * sqrt(t_1))));
	else
		tmp = ((a * (((a * a) * ((t_9 / (t_4 / t_8)) + (t_7 / (b / ((a * -0.25) / (t_6 / t_2)))))) - (t_5 / (b / (c / t_0))))) / (t_5 + (a * (t_9 + t_7)))) - (c / b);
	end
	tmp_2 = tmp;
end
code[a_, b_, c_] := Block[{t$95$0 = N[(b / N[(c / b), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(c * N[(t$95$0 + N[(a * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(c * N[(c * N[(c * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * 20.0), $MachinePrecision]}, Block[{t$95$3 = N[(b * N[(b * b), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[(b * b), $MachinePrecision] * t$95$3), $MachinePrecision]}, Block[{t$95$5 = N[(c * N[(c / t$95$3), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$6 = N[(b * t$95$4), $MachinePrecision]}, Block[{t$95$7 = N[(N[(N[(a * -0.25), $MachinePrecision] * t$95$2), $MachinePrecision] / N[(b * t$95$6), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$8 = N[(c * N[(c * N[(c * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$9 = N[(t$95$8 / t$95$4), $MachinePrecision]}, If[LessEqual[N[(N[(N[Sqrt[N[(N[(b * b), $MachinePrecision] - N[(N[(4.0 * a), $MachinePrecision] * c), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision] / N[(a * 2.0), $MachinePrecision]), $MachinePrecision], -16.0], N[(N[(N[(N[Power[t$95$1, 1.5], $MachinePrecision] - t$95$3), $MachinePrecision] * N[(0.5 / a), $MachinePrecision]), $MachinePrecision] / N[(N[(b * b), $MachinePrecision] + N[(t$95$1 + N[(b * N[Sqrt[t$95$1], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(a * N[(N[(N[(a * a), $MachinePrecision] * N[(N[(t$95$9 / N[(t$95$4 / t$95$8), $MachinePrecision]), $MachinePrecision] + N[(t$95$7 / N[(b / N[(N[(a * -0.25), $MachinePrecision] / N[(t$95$6 / t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(t$95$5 / N[(b / N[(c / t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(t$95$5 + N[(a * N[(t$95$9 + t$95$7), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(c / b), $MachinePrecision]), $MachinePrecision]]]]]]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \frac{b}{\frac{c}{b}}\\
t_1 := c \cdot \left(t\_0 + a \cdot -4\right)\\
t_2 := \left(c \cdot \left(c \cdot \left(c \cdot c\right)\right)\right) \cdot 20\\
t_3 := b \cdot \left(b \cdot b\right)\\
t_4 := \left(b \cdot b\right) \cdot t\_3\\
t_5 := c \cdot \frac{c}{t\_3}\\
t_6 := b \cdot t\_4\\
t_7 := \frac{\left(a \cdot -0.25\right) \cdot t\_2}{b \cdot t\_6}\\
t_8 := c \cdot \left(c \cdot \left(c \cdot -2\right)\right)\\
t_9 := \frac{t\_8}{t\_4}\\
\mathbf{if}\;\frac{\sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c} - b}{a \cdot 2} \leq -16:\\
\;\;\;\;\frac{\left({t\_1}^{1.5} - t\_3\right) \cdot \frac{0.5}{a}}{b \cdot b + \left(t\_1 + b \cdot \sqrt{t\_1}\right)}\\

\mathbf{else}:\\
\;\;\;\;\frac{a \cdot \left(\left(a \cdot a\right) \cdot \left(\frac{t\_9}{\frac{t\_4}{t\_8}} + \frac{t\_7}{\frac{b}{\frac{a \cdot -0.25}{\frac{t\_6}{t\_2}}}}\right) - \frac{t\_5}{\frac{b}{\frac{c}{t\_0}}}\right)}{t\_5 + a \cdot \left(t\_9 + t\_7\right)} - \frac{c}{b}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (/.f64 (+.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 #s(literal 4 binary64) a) c)))) (*.f64 #s(literal 2 binary64) a)) < -16

    1. Initial program 86.6%

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{neg.f64}\left(b\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(c, \left(\frac{{b}^{2}}{c} - 4 \cdot a\right)\right)\right)\right), \mathsf{*.f64}\left(2, a\right)\right) \]
      2. cancel-sign-sub-invN/A

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{neg.f64}\left(b\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(c, \mathsf{+.f64}\left(\left(\frac{{b}^{2}}{c}\right), \left(-4 \cdot a\right)\right)\right)\right)\right), \mathsf{*.f64}\left(2, a\right)\right) \]
      5. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{neg.f64}\left(b\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(c, \mathsf{+.f64}\left(\mathsf{/.f64}\left(\left({b}^{2}\right), c\right), \left(-4 \cdot a\right)\right)\right)\right)\right), \mathsf{*.f64}\left(2, a\right)\right) \]
      6. unpow2N/A

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{neg.f64}\left(b\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(c, \mathsf{+.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(b, b\right), c\right), \left(a \cdot -4\right)\right)\right)\right)\right), \mathsf{*.f64}\left(2, a\right)\right) \]
      9. *-lowering-*.f6486.2%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{neg.f64}\left(b\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(c, \mathsf{+.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(b, b\right), c\right), \mathsf{*.f64}\left(a, -4\right)\right)\right)\right)\right), \mathsf{*.f64}\left(2, a\right)\right) \]
    5. Simplified86.2%

      \[\leadsto \frac{\left(-b\right) + \sqrt{\color{blue}{c \cdot \left(\frac{b \cdot b}{c} + a \cdot -4\right)}}}{2 \cdot a} \]
    6. Step-by-step derivation
      1. div-invN/A

        \[\leadsto \left(\left(\mathsf{neg}\left(b\right)\right) + \sqrt{c \cdot \left(\frac{b \cdot b}{c} + a \cdot -4\right)}\right) \cdot \color{blue}{\frac{1}{2 \cdot a}} \]
      2. flip3-+N/A

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

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

        \[\leadsto \mathsf{/.f64}\left(\left(\left({\left(\mathsf{neg}\left(b\right)\right)}^{3} + {\left(\sqrt{c \cdot \left(\frac{b \cdot b}{c} + a \cdot -4\right)}\right)}^{3}\right) \cdot \frac{1}{2 \cdot a}\right), \color{blue}{\left(\left(\mathsf{neg}\left(b\right)\right) \cdot \left(\mathsf{neg}\left(b\right)\right) + \left(\sqrt{c \cdot \left(\frac{b \cdot b}{c} + a \cdot -4\right)} \cdot \sqrt{c \cdot \left(\frac{b \cdot b}{c} + a \cdot -4\right)} - \left(\mathsf{neg}\left(b\right)\right) \cdot \sqrt{c \cdot \left(\frac{b \cdot b}{c} + a \cdot -4\right)}\right)\right)}\right) \]
    7. Applied egg-rr87.4%

      \[\leadsto \color{blue}{\frac{\left(\left(0 - b \cdot \left(b \cdot b\right)\right) + {\left(c \cdot \left(\frac{b}{\frac{c}{b}} + a \cdot -4\right)\right)}^{1.5}\right) \cdot \frac{0.5}{a}}{b \cdot b + \left(c \cdot \left(\frac{b}{\frac{c}{b}} + a \cdot -4\right) + b \cdot \sqrt{c \cdot \left(\frac{b}{\frac{c}{b}} + a \cdot -4\right)}\right)}} \]

    if -16 < (/.f64 (+.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 #s(literal 4 binary64) a) c)))) (*.f64 #s(literal 2 binary64) a))

    1. Initial program 54.2%

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

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

      \[\leadsto \color{blue}{a \cdot \left(a \cdot \left(\frac{\left(c \cdot \left(c \cdot c\right)\right) \cdot -2}{{b}^{5}} + \frac{\left(-0.25 \cdot a\right) \cdot \frac{{c}^{4} \cdot 20}{{b}^{6}}}{b}\right) - \frac{c \cdot \frac{\frac{c}{b}}{b}}{b}\right) - \frac{c}{b}} \]
    5. Applied egg-rr93.4%

      \[\leadsto \color{blue}{\frac{\left(\left(a \cdot a\right) \cdot \left(\frac{\frac{c \cdot \left(c \cdot \left(c \cdot -2\right)\right)}{\left(b \cdot b\right) \cdot \left(b \cdot \left(b \cdot b\right)\right)}}{\frac{\left(b \cdot b\right) \cdot \left(b \cdot \left(b \cdot b\right)\right)}{c \cdot \left(c \cdot \left(c \cdot -2\right)\right)}} + \frac{\frac{\left(-0.25 \cdot a\right) \cdot \left(\left(c \cdot \left(c \cdot \left(c \cdot c\right)\right)\right) \cdot 20\right)}{b \cdot \left(b \cdot \left(\left(b \cdot b\right) \cdot \left(b \cdot \left(b \cdot b\right)\right)\right)\right)}}{\frac{b}{\frac{-0.25 \cdot a}{\frac{b \cdot \left(\left(b \cdot b\right) \cdot \left(b \cdot \left(b \cdot b\right)\right)\right)}{\left(c \cdot \left(c \cdot \left(c \cdot c\right)\right)\right) \cdot 20}}}}\right) - \frac{c \cdot \frac{c}{b \cdot \left(b \cdot b\right)}}{\frac{b}{\frac{c}{\frac{b}{\frac{c}{b}}}}}\right) \cdot a}{a \cdot \left(\frac{\left(-0.25 \cdot a\right) \cdot \left(\left(c \cdot \left(c \cdot \left(c \cdot c\right)\right)\right) \cdot 20\right)}{b \cdot \left(b \cdot \left(\left(b \cdot b\right) \cdot \left(b \cdot \left(b \cdot b\right)\right)\right)\right)} + \frac{c \cdot \left(c \cdot \left(c \cdot -2\right)\right)}{\left(b \cdot b\right) \cdot \left(b \cdot \left(b \cdot b\right)\right)}\right) + c \cdot \frac{c}{b \cdot \left(b \cdot b\right)}}} - \frac{c}{b} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification92.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{\sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c} - b}{a \cdot 2} \leq -16:\\ \;\;\;\;\frac{\left({\left(c \cdot \left(\frac{b}{\frac{c}{b}} + a \cdot -4\right)\right)}^{1.5} - b \cdot \left(b \cdot b\right)\right) \cdot \frac{0.5}{a}}{b \cdot b + \left(c \cdot \left(\frac{b}{\frac{c}{b}} + a \cdot -4\right) + b \cdot \sqrt{c \cdot \left(\frac{b}{\frac{c}{b}} + a \cdot -4\right)}\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{a \cdot \left(\left(a \cdot a\right) \cdot \left(\frac{\frac{c \cdot \left(c \cdot \left(c \cdot -2\right)\right)}{\left(b \cdot b\right) \cdot \left(b \cdot \left(b \cdot b\right)\right)}}{\frac{\left(b \cdot b\right) \cdot \left(b \cdot \left(b \cdot b\right)\right)}{c \cdot \left(c \cdot \left(c \cdot -2\right)\right)}} + \frac{\frac{\left(a \cdot -0.25\right) \cdot \left(\left(c \cdot \left(c \cdot \left(c \cdot c\right)\right)\right) \cdot 20\right)}{b \cdot \left(b \cdot \left(\left(b \cdot b\right) \cdot \left(b \cdot \left(b \cdot b\right)\right)\right)\right)}}{\frac{b}{\frac{a \cdot -0.25}{\frac{b \cdot \left(\left(b \cdot b\right) \cdot \left(b \cdot \left(b \cdot b\right)\right)\right)}{\left(c \cdot \left(c \cdot \left(c \cdot c\right)\right)\right) \cdot 20}}}}\right) - \frac{c \cdot \frac{c}{b \cdot \left(b \cdot b\right)}}{\frac{b}{\frac{c}{\frac{b}{\frac{c}{b}}}}}\right)}{c \cdot \frac{c}{b \cdot \left(b \cdot b\right)} + a \cdot \left(\frac{c \cdot \left(c \cdot \left(c \cdot -2\right)\right)}{\left(b \cdot b\right) \cdot \left(b \cdot \left(b \cdot b\right)\right)} + \frac{\left(a \cdot -0.25\right) \cdot \left(\left(c \cdot \left(c \cdot \left(c \cdot c\right)\right)\right) \cdot 20\right)}{b \cdot \left(b \cdot \left(\left(b \cdot b\right) \cdot \left(b \cdot \left(b \cdot b\right)\right)\right)\right)}\right)} - \frac{c}{b}\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 92.5% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \left(c \cdot \left(c \cdot \left(c \cdot c\right)\right)\right) \cdot 20\\ t_1 := b \cdot \left(b \cdot b\right)\\ t_2 := \left(b \cdot b\right) \cdot t\_1\\ t_3 := b \cdot t\_2\\ t_4 := c \cdot \frac{c}{t\_1}\\ t_5 := \frac{\left(a \cdot -0.25\right) \cdot t\_0}{b \cdot t\_3}\\ t_6 := \sqrt{b \cdot b + a \cdot \left(c \cdot -4\right)}\\ t_7 := c \cdot \left(c \cdot \left(c \cdot -2\right)\right)\\ t_8 := \frac{t\_7}{t\_2}\\ \mathbf{if}\;\frac{\sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c} - b}{a \cdot 2} \leq -16:\\ \;\;\;\;\frac{a \cdot 2 - \frac{b}{\frac{t\_6}{a \cdot 2}}}{\left(a \cdot 2\right) \cdot \frac{a \cdot 2}{t\_6}}\\ \mathbf{else}:\\ \;\;\;\;\frac{a \cdot \left(\left(a \cdot a\right) \cdot \left(\frac{t\_8}{\frac{t\_2}{t\_7}} + \frac{t\_5}{\frac{b}{\frac{a \cdot -0.25}{\frac{t\_3}{t\_0}}}}\right) - \frac{t\_4}{\frac{b}{\frac{c}{\frac{b}{\frac{c}{b}}}}}\right)}{t\_4 + a \cdot \left(t\_8 + t\_5\right)} - \frac{c}{b}\\ \end{array} \end{array} \]
(FPCore (a b c)
 :precision binary64
 (let* ((t_0 (* (* c (* c (* c c))) 20.0))
        (t_1 (* b (* b b)))
        (t_2 (* (* b b) t_1))
        (t_3 (* b t_2))
        (t_4 (* c (/ c t_1)))
        (t_5 (/ (* (* a -0.25) t_0) (* b t_3)))
        (t_6 (sqrt (+ (* b b) (* a (* c -4.0)))))
        (t_7 (* c (* c (* c -2.0))))
        (t_8 (/ t_7 t_2)))
   (if (<= (/ (- (sqrt (- (* b b) (* (* 4.0 a) c))) b) (* a 2.0)) -16.0)
     (/ (- (* a 2.0) (/ b (/ t_6 (* a 2.0)))) (* (* a 2.0) (/ (* a 2.0) t_6)))
     (-
      (/
       (*
        a
        (-
         (*
          (* a a)
          (+ (/ t_8 (/ t_2 t_7)) (/ t_5 (/ b (/ (* a -0.25) (/ t_3 t_0))))))
         (/ t_4 (/ b (/ c (/ b (/ c b)))))))
       (+ t_4 (* a (+ t_8 t_5))))
      (/ c b)))))
double code(double a, double b, double c) {
	double t_0 = (c * (c * (c * c))) * 20.0;
	double t_1 = b * (b * b);
	double t_2 = (b * b) * t_1;
	double t_3 = b * t_2;
	double t_4 = c * (c / t_1);
	double t_5 = ((a * -0.25) * t_0) / (b * t_3);
	double t_6 = sqrt(((b * b) + (a * (c * -4.0))));
	double t_7 = c * (c * (c * -2.0));
	double t_8 = t_7 / t_2;
	double tmp;
	if (((sqrt(((b * b) - ((4.0 * a) * c))) - b) / (a * 2.0)) <= -16.0) {
		tmp = ((a * 2.0) - (b / (t_6 / (a * 2.0)))) / ((a * 2.0) * ((a * 2.0) / t_6));
	} else {
		tmp = ((a * (((a * a) * ((t_8 / (t_2 / t_7)) + (t_5 / (b / ((a * -0.25) / (t_3 / t_0)))))) - (t_4 / (b / (c / (b / (c / b))))))) / (t_4 + (a * (t_8 + t_5)))) - (c / b);
	}
	return tmp;
}
real(8) function code(a, b, c)
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: t_3
    real(8) :: t_4
    real(8) :: t_5
    real(8) :: t_6
    real(8) :: t_7
    real(8) :: t_8
    real(8) :: tmp
    t_0 = (c * (c * (c * c))) * 20.0d0
    t_1 = b * (b * b)
    t_2 = (b * b) * t_1
    t_3 = b * t_2
    t_4 = c * (c / t_1)
    t_5 = ((a * (-0.25d0)) * t_0) / (b * t_3)
    t_6 = sqrt(((b * b) + (a * (c * (-4.0d0)))))
    t_7 = c * (c * (c * (-2.0d0)))
    t_8 = t_7 / t_2
    if (((sqrt(((b * b) - ((4.0d0 * a) * c))) - b) / (a * 2.0d0)) <= (-16.0d0)) then
        tmp = ((a * 2.0d0) - (b / (t_6 / (a * 2.0d0)))) / ((a * 2.0d0) * ((a * 2.0d0) / t_6))
    else
        tmp = ((a * (((a * a) * ((t_8 / (t_2 / t_7)) + (t_5 / (b / ((a * (-0.25d0)) / (t_3 / t_0)))))) - (t_4 / (b / (c / (b / (c / b))))))) / (t_4 + (a * (t_8 + t_5)))) - (c / b)
    end if
    code = tmp
end function
public static double code(double a, double b, double c) {
	double t_0 = (c * (c * (c * c))) * 20.0;
	double t_1 = b * (b * b);
	double t_2 = (b * b) * t_1;
	double t_3 = b * t_2;
	double t_4 = c * (c / t_1);
	double t_5 = ((a * -0.25) * t_0) / (b * t_3);
	double t_6 = Math.sqrt(((b * b) + (a * (c * -4.0))));
	double t_7 = c * (c * (c * -2.0));
	double t_8 = t_7 / t_2;
	double tmp;
	if (((Math.sqrt(((b * b) - ((4.0 * a) * c))) - b) / (a * 2.0)) <= -16.0) {
		tmp = ((a * 2.0) - (b / (t_6 / (a * 2.0)))) / ((a * 2.0) * ((a * 2.0) / t_6));
	} else {
		tmp = ((a * (((a * a) * ((t_8 / (t_2 / t_7)) + (t_5 / (b / ((a * -0.25) / (t_3 / t_0)))))) - (t_4 / (b / (c / (b / (c / b))))))) / (t_4 + (a * (t_8 + t_5)))) - (c / b);
	}
	return tmp;
}
def code(a, b, c):
	t_0 = (c * (c * (c * c))) * 20.0
	t_1 = b * (b * b)
	t_2 = (b * b) * t_1
	t_3 = b * t_2
	t_4 = c * (c / t_1)
	t_5 = ((a * -0.25) * t_0) / (b * t_3)
	t_6 = math.sqrt(((b * b) + (a * (c * -4.0))))
	t_7 = c * (c * (c * -2.0))
	t_8 = t_7 / t_2
	tmp = 0
	if ((math.sqrt(((b * b) - ((4.0 * a) * c))) - b) / (a * 2.0)) <= -16.0:
		tmp = ((a * 2.0) - (b / (t_6 / (a * 2.0)))) / ((a * 2.0) * ((a * 2.0) / t_6))
	else:
		tmp = ((a * (((a * a) * ((t_8 / (t_2 / t_7)) + (t_5 / (b / ((a * -0.25) / (t_3 / t_0)))))) - (t_4 / (b / (c / (b / (c / b))))))) / (t_4 + (a * (t_8 + t_5)))) - (c / b)
	return tmp
function code(a, b, c)
	t_0 = Float64(Float64(c * Float64(c * Float64(c * c))) * 20.0)
	t_1 = Float64(b * Float64(b * b))
	t_2 = Float64(Float64(b * b) * t_1)
	t_3 = Float64(b * t_2)
	t_4 = Float64(c * Float64(c / t_1))
	t_5 = Float64(Float64(Float64(a * -0.25) * t_0) / Float64(b * t_3))
	t_6 = sqrt(Float64(Float64(b * b) + Float64(a * Float64(c * -4.0))))
	t_7 = Float64(c * Float64(c * Float64(c * -2.0)))
	t_8 = Float64(t_7 / t_2)
	tmp = 0.0
	if (Float64(Float64(sqrt(Float64(Float64(b * b) - Float64(Float64(4.0 * a) * c))) - b) / Float64(a * 2.0)) <= -16.0)
		tmp = Float64(Float64(Float64(a * 2.0) - Float64(b / Float64(t_6 / Float64(a * 2.0)))) / Float64(Float64(a * 2.0) * Float64(Float64(a * 2.0) / t_6)));
	else
		tmp = Float64(Float64(Float64(a * Float64(Float64(Float64(a * a) * Float64(Float64(t_8 / Float64(t_2 / t_7)) + Float64(t_5 / Float64(b / Float64(Float64(a * -0.25) / Float64(t_3 / t_0)))))) - Float64(t_4 / Float64(b / Float64(c / Float64(b / Float64(c / b))))))) / Float64(t_4 + Float64(a * Float64(t_8 + t_5)))) - Float64(c / b));
	end
	return tmp
end
function tmp_2 = code(a, b, c)
	t_0 = (c * (c * (c * c))) * 20.0;
	t_1 = b * (b * b);
	t_2 = (b * b) * t_1;
	t_3 = b * t_2;
	t_4 = c * (c / t_1);
	t_5 = ((a * -0.25) * t_0) / (b * t_3);
	t_6 = sqrt(((b * b) + (a * (c * -4.0))));
	t_7 = c * (c * (c * -2.0));
	t_8 = t_7 / t_2;
	tmp = 0.0;
	if (((sqrt(((b * b) - ((4.0 * a) * c))) - b) / (a * 2.0)) <= -16.0)
		tmp = ((a * 2.0) - (b / (t_6 / (a * 2.0)))) / ((a * 2.0) * ((a * 2.0) / t_6));
	else
		tmp = ((a * (((a * a) * ((t_8 / (t_2 / t_7)) + (t_5 / (b / ((a * -0.25) / (t_3 / t_0)))))) - (t_4 / (b / (c / (b / (c / b))))))) / (t_4 + (a * (t_8 + t_5)))) - (c / b);
	end
	tmp_2 = tmp;
end
code[a_, b_, c_] := Block[{t$95$0 = N[(N[(c * N[(c * N[(c * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * 20.0), $MachinePrecision]}, Block[{t$95$1 = N[(b * N[(b * b), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(b * b), $MachinePrecision] * t$95$1), $MachinePrecision]}, Block[{t$95$3 = N[(b * t$95$2), $MachinePrecision]}, Block[{t$95$4 = N[(c * N[(c / t$95$1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[(N[(N[(a * -0.25), $MachinePrecision] * t$95$0), $MachinePrecision] / N[(b * t$95$3), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$6 = N[Sqrt[N[(N[(b * b), $MachinePrecision] + N[(a * N[(c * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$7 = N[(c * N[(c * N[(c * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$8 = N[(t$95$7 / t$95$2), $MachinePrecision]}, If[LessEqual[N[(N[(N[Sqrt[N[(N[(b * b), $MachinePrecision] - N[(N[(4.0 * a), $MachinePrecision] * c), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision] / N[(a * 2.0), $MachinePrecision]), $MachinePrecision], -16.0], N[(N[(N[(a * 2.0), $MachinePrecision] - N[(b / N[(t$95$6 / N[(a * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(a * 2.0), $MachinePrecision] * N[(N[(a * 2.0), $MachinePrecision] / t$95$6), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(a * N[(N[(N[(a * a), $MachinePrecision] * N[(N[(t$95$8 / N[(t$95$2 / t$95$7), $MachinePrecision]), $MachinePrecision] + N[(t$95$5 / N[(b / N[(N[(a * -0.25), $MachinePrecision] / N[(t$95$3 / t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(t$95$4 / N[(b / N[(c / N[(b / N[(c / b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(t$95$4 + N[(a * N[(t$95$8 + t$95$5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(c / b), $MachinePrecision]), $MachinePrecision]]]]]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \left(c \cdot \left(c \cdot \left(c \cdot c\right)\right)\right) \cdot 20\\
t_1 := b \cdot \left(b \cdot b\right)\\
t_2 := \left(b \cdot b\right) \cdot t\_1\\
t_3 := b \cdot t\_2\\
t_4 := c \cdot \frac{c}{t\_1}\\
t_5 := \frac{\left(a \cdot -0.25\right) \cdot t\_0}{b \cdot t\_3}\\
t_6 := \sqrt{b \cdot b + a \cdot \left(c \cdot -4\right)}\\
t_7 := c \cdot \left(c \cdot \left(c \cdot -2\right)\right)\\
t_8 := \frac{t\_7}{t\_2}\\
\mathbf{if}\;\frac{\sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c} - b}{a \cdot 2} \leq -16:\\
\;\;\;\;\frac{a \cdot 2 - \frac{b}{\frac{t\_6}{a \cdot 2}}}{\left(a \cdot 2\right) \cdot \frac{a \cdot 2}{t\_6}}\\

\mathbf{else}:\\
\;\;\;\;\frac{a \cdot \left(\left(a \cdot a\right) \cdot \left(\frac{t\_8}{\frac{t\_2}{t\_7}} + \frac{t\_5}{\frac{b}{\frac{a \cdot -0.25}{\frac{t\_3}{t\_0}}}}\right) - \frac{t\_4}{\frac{b}{\frac{c}{\frac{b}{\frac{c}{b}}}}}\right)}{t\_4 + a \cdot \left(t\_8 + t\_5\right)} - \frac{c}{b}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (/.f64 (+.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 #s(literal 4 binary64) a) c)))) (*.f64 #s(literal 2 binary64) a)) < -16

    1. Initial program 86.6%

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

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

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

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

        \[\leadsto \mathsf{\_.f64}\left(\left(\frac{\sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}\right), \color{blue}{\left(\frac{b}{2 \cdot a}\right)}\right) \]
    4. Applied egg-rr86.2%

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\left(\left(\mathsf{neg}\left(-1\right)\right) \cdot \left(a \cdot 2\right) - \frac{a \cdot 2}{\sqrt{b \cdot b + c \cdot \left(a \cdot -4\right)}} \cdot b\right), \color{blue}{\left(\frac{a \cdot 2}{\sqrt{b \cdot b + c \cdot \left(a \cdot -4\right)}} \cdot \left(a \cdot 2\right)\right)}\right) \]
    6. Applied egg-rr86.5%

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\left(1 \cdot \left(a \cdot 2\right)\right), \left(\frac{a \cdot 2}{\sqrt{b \cdot b + a \cdot \left(c \cdot -4\right)}} \cdot b\right)\right), \mathsf{*.f64}\left(\color{blue}{\mathsf{/.f64}\left(\mathsf{*.f64}\left(a, 2\right), \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(c, -4\right)\right)\right)\right)\right)}, \mathsf{*.f64}\left(a, 2\right)\right)\right) \]
      2. *-lft-identityN/A

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(a, 2\right), \left(b \cdot \frac{a \cdot 2}{\sqrt{b \cdot b + a \cdot \left(c \cdot -4\right)}}\right)\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(a, 2\right), \color{blue}{\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(c, -4\right)\right)\right)\right)}\right), \mathsf{*.f64}\left(a, 2\right)\right)\right) \]
      5. clear-numN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(a, 2\right), \left(b \cdot \frac{1}{\frac{\sqrt{b \cdot b + a \cdot \left(c \cdot -4\right)}}{a \cdot 2}}\right)\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(a, 2\right), \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(c, -4\right)\right)\right)\right)\right), \mathsf{*.f64}\left(a, 2\right)\right)\right) \]
      6. un-div-invN/A

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(a, 2\right), \mathsf{/.f64}\left(b, \left(\frac{\sqrt{b \cdot b + a \cdot \left(c \cdot -4\right)}}{a \cdot 2}\right)\right)\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(a, 2\right), \color{blue}{\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(c, -4\right)\right)\right)\right)}\right), \mathsf{*.f64}\left(a, 2\right)\right)\right) \]
      8. *-lft-identityN/A

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

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

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(a, 2\right), \mathsf{/.f64}\left(b, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(c, -4\right)\right)\right)\right), \left(1 \cdot \left(a \cdot 2\right)\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(a, 2\right), \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(c, -4\right)\right)\right)\right)\right), \mathsf{*.f64}\left(a, 2\right)\right)\right) \]
      15. *-lft-identityN/A

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(a, 2\right), \mathsf{/.f64}\left(b, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(c, -4\right)\right)\right)\right), \mathsf{*.f64}\left(a, 2\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(a, 2\right), \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(c, -4\right)\right)\right)\right)\right), \mathsf{*.f64}\left(a, 2\right)\right)\right) \]
    8. Applied egg-rr87.4%

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

    if -16 < (/.f64 (+.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 #s(literal 4 binary64) a) c)))) (*.f64 #s(literal 2 binary64) a))

    1. Initial program 54.2%

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

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

      \[\leadsto \color{blue}{a \cdot \left(a \cdot \left(\frac{\left(c \cdot \left(c \cdot c\right)\right) \cdot -2}{{b}^{5}} + \frac{\left(-0.25 \cdot a\right) \cdot \frac{{c}^{4} \cdot 20}{{b}^{6}}}{b}\right) - \frac{c \cdot \frac{\frac{c}{b}}{b}}{b}\right) - \frac{c}{b}} \]
    5. Applied egg-rr93.4%

      \[\leadsto \color{blue}{\frac{\left(\left(a \cdot a\right) \cdot \left(\frac{\frac{c \cdot \left(c \cdot \left(c \cdot -2\right)\right)}{\left(b \cdot b\right) \cdot \left(b \cdot \left(b \cdot b\right)\right)}}{\frac{\left(b \cdot b\right) \cdot \left(b \cdot \left(b \cdot b\right)\right)}{c \cdot \left(c \cdot \left(c \cdot -2\right)\right)}} + \frac{\frac{\left(-0.25 \cdot a\right) \cdot \left(\left(c \cdot \left(c \cdot \left(c \cdot c\right)\right)\right) \cdot 20\right)}{b \cdot \left(b \cdot \left(\left(b \cdot b\right) \cdot \left(b \cdot \left(b \cdot b\right)\right)\right)\right)}}{\frac{b}{\frac{-0.25 \cdot a}{\frac{b \cdot \left(\left(b \cdot b\right) \cdot \left(b \cdot \left(b \cdot b\right)\right)\right)}{\left(c \cdot \left(c \cdot \left(c \cdot c\right)\right)\right) \cdot 20}}}}\right) - \frac{c \cdot \frac{c}{b \cdot \left(b \cdot b\right)}}{\frac{b}{\frac{c}{\frac{b}{\frac{c}{b}}}}}\right) \cdot a}{a \cdot \left(\frac{\left(-0.25 \cdot a\right) \cdot \left(\left(c \cdot \left(c \cdot \left(c \cdot c\right)\right)\right) \cdot 20\right)}{b \cdot \left(b \cdot \left(\left(b \cdot b\right) \cdot \left(b \cdot \left(b \cdot b\right)\right)\right)\right)} + \frac{c \cdot \left(c \cdot \left(c \cdot -2\right)\right)}{\left(b \cdot b\right) \cdot \left(b \cdot \left(b \cdot b\right)\right)}\right) + c \cdot \frac{c}{b \cdot \left(b \cdot b\right)}}} - \frac{c}{b} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification92.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{\sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c} - b}{a \cdot 2} \leq -16:\\ \;\;\;\;\frac{a \cdot 2 - \frac{b}{\frac{\sqrt{b \cdot b + a \cdot \left(c \cdot -4\right)}}{a \cdot 2}}}{\left(a \cdot 2\right) \cdot \frac{a \cdot 2}{\sqrt{b \cdot b + a \cdot \left(c \cdot -4\right)}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{a \cdot \left(\left(a \cdot a\right) \cdot \left(\frac{\frac{c \cdot \left(c \cdot \left(c \cdot -2\right)\right)}{\left(b \cdot b\right) \cdot \left(b \cdot \left(b \cdot b\right)\right)}}{\frac{\left(b \cdot b\right) \cdot \left(b \cdot \left(b \cdot b\right)\right)}{c \cdot \left(c \cdot \left(c \cdot -2\right)\right)}} + \frac{\frac{\left(a \cdot -0.25\right) \cdot \left(\left(c \cdot \left(c \cdot \left(c \cdot c\right)\right)\right) \cdot 20\right)}{b \cdot \left(b \cdot \left(\left(b \cdot b\right) \cdot \left(b \cdot \left(b \cdot b\right)\right)\right)\right)}}{\frac{b}{\frac{a \cdot -0.25}{\frac{b \cdot \left(\left(b \cdot b\right) \cdot \left(b \cdot \left(b \cdot b\right)\right)\right)}{\left(c \cdot \left(c \cdot \left(c \cdot c\right)\right)\right) \cdot 20}}}}\right) - \frac{c \cdot \frac{c}{b \cdot \left(b \cdot b\right)}}{\frac{b}{\frac{c}{\frac{b}{\frac{c}{b}}}}}\right)}{c \cdot \frac{c}{b \cdot \left(b \cdot b\right)} + a \cdot \left(\frac{c \cdot \left(c \cdot \left(c \cdot -2\right)\right)}{\left(b \cdot b\right) \cdot \left(b \cdot \left(b \cdot b\right)\right)} + \frac{\left(a \cdot -0.25\right) \cdot \left(\left(c \cdot \left(c \cdot \left(c \cdot c\right)\right)\right) \cdot 20\right)}{b \cdot \left(b \cdot \left(\left(b \cdot b\right) \cdot \left(b \cdot \left(b \cdot b\right)\right)\right)\right)}\right)} - \frac{c}{b}\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 92.6% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \left(c \cdot \left(c \cdot \left(c \cdot c\right)\right)\right) \cdot 20\\ t_1 := c \cdot \left(c \cdot \left(c \cdot -2\right)\right)\\ t_2 := 4 \cdot \left(a \cdot a\right)\\ t_3 := b \cdot \left(b \cdot b\right)\\ t_4 := \left(b \cdot b\right) \cdot t\_3\\ t_5 := c \cdot \frac{c}{t\_3}\\ t_6 := b \cdot t\_4\\ t_7 := \frac{\left(a \cdot -0.25\right) \cdot t\_0}{b \cdot t\_6}\\ t_8 := b \cdot b + a \cdot \left(c \cdot -4\right)\\ t_9 := \frac{t\_1}{t\_4}\\ \mathbf{if}\;\frac{\sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c} - b}{a \cdot 2} \leq -16:\\ \;\;\;\;\frac{1}{\frac{\frac{0.5}{a} \cdot \left(b + \sqrt{t\_8}\right)}{\frac{t\_8}{t\_2} - \frac{b \cdot b}{t\_2}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{a \cdot \left(\left(a \cdot a\right) \cdot \left(\frac{t\_9}{\frac{t\_4}{t\_1}} + \frac{t\_7}{\frac{b}{\frac{a \cdot -0.25}{\frac{t\_6}{t\_0}}}}\right) - \frac{t\_5}{\frac{b}{\frac{c}{\frac{b}{\frac{c}{b}}}}}\right)}{t\_5 + a \cdot \left(t\_9 + t\_7\right)} - \frac{c}{b}\\ \end{array} \end{array} \]
(FPCore (a b c)
 :precision binary64
 (let* ((t_0 (* (* c (* c (* c c))) 20.0))
        (t_1 (* c (* c (* c -2.0))))
        (t_2 (* 4.0 (* a a)))
        (t_3 (* b (* b b)))
        (t_4 (* (* b b) t_3))
        (t_5 (* c (/ c t_3)))
        (t_6 (* b t_4))
        (t_7 (/ (* (* a -0.25) t_0) (* b t_6)))
        (t_8 (+ (* b b) (* a (* c -4.0))))
        (t_9 (/ t_1 t_4)))
   (if (<= (/ (- (sqrt (- (* b b) (* (* 4.0 a) c))) b) (* a 2.0)) -16.0)
     (/ 1.0 (/ (* (/ 0.5 a) (+ b (sqrt t_8))) (- (/ t_8 t_2) (/ (* b b) t_2))))
     (-
      (/
       (*
        a
        (-
         (*
          (* a a)
          (+ (/ t_9 (/ t_4 t_1)) (/ t_7 (/ b (/ (* a -0.25) (/ t_6 t_0))))))
         (/ t_5 (/ b (/ c (/ b (/ c b)))))))
       (+ t_5 (* a (+ t_9 t_7))))
      (/ c b)))))
double code(double a, double b, double c) {
	double t_0 = (c * (c * (c * c))) * 20.0;
	double t_1 = c * (c * (c * -2.0));
	double t_2 = 4.0 * (a * a);
	double t_3 = b * (b * b);
	double t_4 = (b * b) * t_3;
	double t_5 = c * (c / t_3);
	double t_6 = b * t_4;
	double t_7 = ((a * -0.25) * t_0) / (b * t_6);
	double t_8 = (b * b) + (a * (c * -4.0));
	double t_9 = t_1 / t_4;
	double tmp;
	if (((sqrt(((b * b) - ((4.0 * a) * c))) - b) / (a * 2.0)) <= -16.0) {
		tmp = 1.0 / (((0.5 / a) * (b + sqrt(t_8))) / ((t_8 / t_2) - ((b * b) / t_2)));
	} else {
		tmp = ((a * (((a * a) * ((t_9 / (t_4 / t_1)) + (t_7 / (b / ((a * -0.25) / (t_6 / t_0)))))) - (t_5 / (b / (c / (b / (c / b))))))) / (t_5 + (a * (t_9 + t_7)))) - (c / b);
	}
	return tmp;
}
real(8) function code(a, b, c)
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: t_3
    real(8) :: t_4
    real(8) :: t_5
    real(8) :: t_6
    real(8) :: t_7
    real(8) :: t_8
    real(8) :: t_9
    real(8) :: tmp
    t_0 = (c * (c * (c * c))) * 20.0d0
    t_1 = c * (c * (c * (-2.0d0)))
    t_2 = 4.0d0 * (a * a)
    t_3 = b * (b * b)
    t_4 = (b * b) * t_3
    t_5 = c * (c / t_3)
    t_6 = b * t_4
    t_7 = ((a * (-0.25d0)) * t_0) / (b * t_6)
    t_8 = (b * b) + (a * (c * (-4.0d0)))
    t_9 = t_1 / t_4
    if (((sqrt(((b * b) - ((4.0d0 * a) * c))) - b) / (a * 2.0d0)) <= (-16.0d0)) then
        tmp = 1.0d0 / (((0.5d0 / a) * (b + sqrt(t_8))) / ((t_8 / t_2) - ((b * b) / t_2)))
    else
        tmp = ((a * (((a * a) * ((t_9 / (t_4 / t_1)) + (t_7 / (b / ((a * (-0.25d0)) / (t_6 / t_0)))))) - (t_5 / (b / (c / (b / (c / b))))))) / (t_5 + (a * (t_9 + t_7)))) - (c / b)
    end if
    code = tmp
end function
public static double code(double a, double b, double c) {
	double t_0 = (c * (c * (c * c))) * 20.0;
	double t_1 = c * (c * (c * -2.0));
	double t_2 = 4.0 * (a * a);
	double t_3 = b * (b * b);
	double t_4 = (b * b) * t_3;
	double t_5 = c * (c / t_3);
	double t_6 = b * t_4;
	double t_7 = ((a * -0.25) * t_0) / (b * t_6);
	double t_8 = (b * b) + (a * (c * -4.0));
	double t_9 = t_1 / t_4;
	double tmp;
	if (((Math.sqrt(((b * b) - ((4.0 * a) * c))) - b) / (a * 2.0)) <= -16.0) {
		tmp = 1.0 / (((0.5 / a) * (b + Math.sqrt(t_8))) / ((t_8 / t_2) - ((b * b) / t_2)));
	} else {
		tmp = ((a * (((a * a) * ((t_9 / (t_4 / t_1)) + (t_7 / (b / ((a * -0.25) / (t_6 / t_0)))))) - (t_5 / (b / (c / (b / (c / b))))))) / (t_5 + (a * (t_9 + t_7)))) - (c / b);
	}
	return tmp;
}
def code(a, b, c):
	t_0 = (c * (c * (c * c))) * 20.0
	t_1 = c * (c * (c * -2.0))
	t_2 = 4.0 * (a * a)
	t_3 = b * (b * b)
	t_4 = (b * b) * t_3
	t_5 = c * (c / t_3)
	t_6 = b * t_4
	t_7 = ((a * -0.25) * t_0) / (b * t_6)
	t_8 = (b * b) + (a * (c * -4.0))
	t_9 = t_1 / t_4
	tmp = 0
	if ((math.sqrt(((b * b) - ((4.0 * a) * c))) - b) / (a * 2.0)) <= -16.0:
		tmp = 1.0 / (((0.5 / a) * (b + math.sqrt(t_8))) / ((t_8 / t_2) - ((b * b) / t_2)))
	else:
		tmp = ((a * (((a * a) * ((t_9 / (t_4 / t_1)) + (t_7 / (b / ((a * -0.25) / (t_6 / t_0)))))) - (t_5 / (b / (c / (b / (c / b))))))) / (t_5 + (a * (t_9 + t_7)))) - (c / b)
	return tmp
function code(a, b, c)
	t_0 = Float64(Float64(c * Float64(c * Float64(c * c))) * 20.0)
	t_1 = Float64(c * Float64(c * Float64(c * -2.0)))
	t_2 = Float64(4.0 * Float64(a * a))
	t_3 = Float64(b * Float64(b * b))
	t_4 = Float64(Float64(b * b) * t_3)
	t_5 = Float64(c * Float64(c / t_3))
	t_6 = Float64(b * t_4)
	t_7 = Float64(Float64(Float64(a * -0.25) * t_0) / Float64(b * t_6))
	t_8 = Float64(Float64(b * b) + Float64(a * Float64(c * -4.0)))
	t_9 = Float64(t_1 / t_4)
	tmp = 0.0
	if (Float64(Float64(sqrt(Float64(Float64(b * b) - Float64(Float64(4.0 * a) * c))) - b) / Float64(a * 2.0)) <= -16.0)
		tmp = Float64(1.0 / Float64(Float64(Float64(0.5 / a) * Float64(b + sqrt(t_8))) / Float64(Float64(t_8 / t_2) - Float64(Float64(b * b) / t_2))));
	else
		tmp = Float64(Float64(Float64(a * Float64(Float64(Float64(a * a) * Float64(Float64(t_9 / Float64(t_4 / t_1)) + Float64(t_7 / Float64(b / Float64(Float64(a * -0.25) / Float64(t_6 / t_0)))))) - Float64(t_5 / Float64(b / Float64(c / Float64(b / Float64(c / b))))))) / Float64(t_5 + Float64(a * Float64(t_9 + t_7)))) - Float64(c / b));
	end
	return tmp
end
function tmp_2 = code(a, b, c)
	t_0 = (c * (c * (c * c))) * 20.0;
	t_1 = c * (c * (c * -2.0));
	t_2 = 4.0 * (a * a);
	t_3 = b * (b * b);
	t_4 = (b * b) * t_3;
	t_5 = c * (c / t_3);
	t_6 = b * t_4;
	t_7 = ((a * -0.25) * t_0) / (b * t_6);
	t_8 = (b * b) + (a * (c * -4.0));
	t_9 = t_1 / t_4;
	tmp = 0.0;
	if (((sqrt(((b * b) - ((4.0 * a) * c))) - b) / (a * 2.0)) <= -16.0)
		tmp = 1.0 / (((0.5 / a) * (b + sqrt(t_8))) / ((t_8 / t_2) - ((b * b) / t_2)));
	else
		tmp = ((a * (((a * a) * ((t_9 / (t_4 / t_1)) + (t_7 / (b / ((a * -0.25) / (t_6 / t_0)))))) - (t_5 / (b / (c / (b / (c / b))))))) / (t_5 + (a * (t_9 + t_7)))) - (c / b);
	end
	tmp_2 = tmp;
end
code[a_, b_, c_] := Block[{t$95$0 = N[(N[(c * N[(c * N[(c * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * 20.0), $MachinePrecision]}, Block[{t$95$1 = N[(c * N[(c * N[(c * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(4.0 * N[(a * a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(b * N[(b * b), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[(b * b), $MachinePrecision] * t$95$3), $MachinePrecision]}, Block[{t$95$5 = N[(c * N[(c / t$95$3), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$6 = N[(b * t$95$4), $MachinePrecision]}, Block[{t$95$7 = N[(N[(N[(a * -0.25), $MachinePrecision] * t$95$0), $MachinePrecision] / N[(b * t$95$6), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$8 = N[(N[(b * b), $MachinePrecision] + N[(a * N[(c * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$9 = N[(t$95$1 / t$95$4), $MachinePrecision]}, If[LessEqual[N[(N[(N[Sqrt[N[(N[(b * b), $MachinePrecision] - N[(N[(4.0 * a), $MachinePrecision] * c), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision] / N[(a * 2.0), $MachinePrecision]), $MachinePrecision], -16.0], N[(1.0 / N[(N[(N[(0.5 / a), $MachinePrecision] * N[(b + N[Sqrt[t$95$8], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(t$95$8 / t$95$2), $MachinePrecision] - N[(N[(b * b), $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(a * N[(N[(N[(a * a), $MachinePrecision] * N[(N[(t$95$9 / N[(t$95$4 / t$95$1), $MachinePrecision]), $MachinePrecision] + N[(t$95$7 / N[(b / N[(N[(a * -0.25), $MachinePrecision] / N[(t$95$6 / t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(t$95$5 / N[(b / N[(c / N[(b / N[(c / b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(t$95$5 + N[(a * N[(t$95$9 + t$95$7), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(c / b), $MachinePrecision]), $MachinePrecision]]]]]]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \left(c \cdot \left(c \cdot \left(c \cdot c\right)\right)\right) \cdot 20\\
t_1 := c \cdot \left(c \cdot \left(c \cdot -2\right)\right)\\
t_2 := 4 \cdot \left(a \cdot a\right)\\
t_3 := b \cdot \left(b \cdot b\right)\\
t_4 := \left(b \cdot b\right) \cdot t\_3\\
t_5 := c \cdot \frac{c}{t\_3}\\
t_6 := b \cdot t\_4\\
t_7 := \frac{\left(a \cdot -0.25\right) \cdot t\_0}{b \cdot t\_6}\\
t_8 := b \cdot b + a \cdot \left(c \cdot -4\right)\\
t_9 := \frac{t\_1}{t\_4}\\
\mathbf{if}\;\frac{\sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c} - b}{a \cdot 2} \leq -16:\\
\;\;\;\;\frac{1}{\frac{\frac{0.5}{a} \cdot \left(b + \sqrt{t\_8}\right)}{\frac{t\_8}{t\_2} - \frac{b \cdot b}{t\_2}}}\\

\mathbf{else}:\\
\;\;\;\;\frac{a \cdot \left(\left(a \cdot a\right) \cdot \left(\frac{t\_9}{\frac{t\_4}{t\_1}} + \frac{t\_7}{\frac{b}{\frac{a \cdot -0.25}{\frac{t\_6}{t\_0}}}}\right) - \frac{t\_5}{\frac{b}{\frac{c}{\frac{b}{\frac{c}{b}}}}}\right)}{t\_5 + a \cdot \left(t\_9 + t\_7\right)} - \frac{c}{b}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (/.f64 (+.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 #s(literal 4 binary64) a) c)))) (*.f64 #s(literal 2 binary64) a)) < -16

    1. Initial program 86.6%

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

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

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

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

        \[\leadsto \mathsf{\_.f64}\left(\left(\frac{\sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}\right), \color{blue}{\left(\frac{b}{2 \cdot a}\right)}\right) \]
    4. Applied egg-rr86.2%

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

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

    if -16 < (/.f64 (+.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 #s(literal 4 binary64) a) c)))) (*.f64 #s(literal 2 binary64) a))

    1. Initial program 54.2%

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

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

      \[\leadsto \color{blue}{a \cdot \left(a \cdot \left(\frac{\left(c \cdot \left(c \cdot c\right)\right) \cdot -2}{{b}^{5}} + \frac{\left(-0.25 \cdot a\right) \cdot \frac{{c}^{4} \cdot 20}{{b}^{6}}}{b}\right) - \frac{c \cdot \frac{\frac{c}{b}}{b}}{b}\right) - \frac{c}{b}} \]
    5. Applied egg-rr93.4%

      \[\leadsto \color{blue}{\frac{\left(\left(a \cdot a\right) \cdot \left(\frac{\frac{c \cdot \left(c \cdot \left(c \cdot -2\right)\right)}{\left(b \cdot b\right) \cdot \left(b \cdot \left(b \cdot b\right)\right)}}{\frac{\left(b \cdot b\right) \cdot \left(b \cdot \left(b \cdot b\right)\right)}{c \cdot \left(c \cdot \left(c \cdot -2\right)\right)}} + \frac{\frac{\left(-0.25 \cdot a\right) \cdot \left(\left(c \cdot \left(c \cdot \left(c \cdot c\right)\right)\right) \cdot 20\right)}{b \cdot \left(b \cdot \left(\left(b \cdot b\right) \cdot \left(b \cdot \left(b \cdot b\right)\right)\right)\right)}}{\frac{b}{\frac{-0.25 \cdot a}{\frac{b \cdot \left(\left(b \cdot b\right) \cdot \left(b \cdot \left(b \cdot b\right)\right)\right)}{\left(c \cdot \left(c \cdot \left(c \cdot c\right)\right)\right) \cdot 20}}}}\right) - \frac{c \cdot \frac{c}{b \cdot \left(b \cdot b\right)}}{\frac{b}{\frac{c}{\frac{b}{\frac{c}{b}}}}}\right) \cdot a}{a \cdot \left(\frac{\left(-0.25 \cdot a\right) \cdot \left(\left(c \cdot \left(c \cdot \left(c \cdot c\right)\right)\right) \cdot 20\right)}{b \cdot \left(b \cdot \left(\left(b \cdot b\right) \cdot \left(b \cdot \left(b \cdot b\right)\right)\right)\right)} + \frac{c \cdot \left(c \cdot \left(c \cdot -2\right)\right)}{\left(b \cdot b\right) \cdot \left(b \cdot \left(b \cdot b\right)\right)}\right) + c \cdot \frac{c}{b \cdot \left(b \cdot b\right)}}} - \frac{c}{b} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification92.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{\sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c} - b}{a \cdot 2} \leq -16:\\ \;\;\;\;\frac{1}{\frac{\frac{0.5}{a} \cdot \left(b + \sqrt{b \cdot b + a \cdot \left(c \cdot -4\right)}\right)}{\frac{b \cdot b + a \cdot \left(c \cdot -4\right)}{4 \cdot \left(a \cdot a\right)} - \frac{b \cdot b}{4 \cdot \left(a \cdot a\right)}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{a \cdot \left(\left(a \cdot a\right) \cdot \left(\frac{\frac{c \cdot \left(c \cdot \left(c \cdot -2\right)\right)}{\left(b \cdot b\right) \cdot \left(b \cdot \left(b \cdot b\right)\right)}}{\frac{\left(b \cdot b\right) \cdot \left(b \cdot \left(b \cdot b\right)\right)}{c \cdot \left(c \cdot \left(c \cdot -2\right)\right)}} + \frac{\frac{\left(a \cdot -0.25\right) \cdot \left(\left(c \cdot \left(c \cdot \left(c \cdot c\right)\right)\right) \cdot 20\right)}{b \cdot \left(b \cdot \left(\left(b \cdot b\right) \cdot \left(b \cdot \left(b \cdot b\right)\right)\right)\right)}}{\frac{b}{\frac{a \cdot -0.25}{\frac{b \cdot \left(\left(b \cdot b\right) \cdot \left(b \cdot \left(b \cdot b\right)\right)\right)}{\left(c \cdot \left(c \cdot \left(c \cdot c\right)\right)\right) \cdot 20}}}}\right) - \frac{c \cdot \frac{c}{b \cdot \left(b \cdot b\right)}}{\frac{b}{\frac{c}{\frac{b}{\frac{c}{b}}}}}\right)}{c \cdot \frac{c}{b \cdot \left(b \cdot b\right)} + a \cdot \left(\frac{c \cdot \left(c \cdot \left(c \cdot -2\right)\right)}{\left(b \cdot b\right) \cdot \left(b \cdot \left(b \cdot b\right)\right)} + \frac{\left(a \cdot -0.25\right) \cdot \left(\left(c \cdot \left(c \cdot \left(c \cdot c\right)\right)\right) \cdot 20\right)}{b \cdot \left(b \cdot \left(\left(b \cdot b\right) \cdot \left(b \cdot \left(b \cdot b\right)\right)\right)\right)}\right)} - \frac{c}{b}\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 92.6% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \left(c \cdot \left(c \cdot \left(c \cdot c\right)\right)\right) \cdot 20\\ t_1 := c \cdot \left(c \cdot \left(c \cdot -2\right)\right)\\ t_2 := b \cdot \left(b \cdot b\right)\\ t_3 := c \cdot \frac{c}{t\_2}\\ t_4 := \left(b \cdot b\right) \cdot t\_2\\ t_5 := b \cdot t\_4\\ t_6 := \frac{\left(a \cdot -0.25\right) \cdot t\_0}{b \cdot t\_5}\\ t_7 := \frac{b}{\frac{c}{b}}\\ t_8 := c \cdot \left(t\_7 + a \cdot -4\right)\\ t_9 := \frac{t\_1}{t\_4}\\ \mathbf{if}\;\frac{\sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c} - b}{a \cdot 2} \leq -16:\\ \;\;\;\;\frac{\left(b \cdot b - t\_8\right) \cdot \frac{-1}{b + \sqrt{t\_8}}}{a \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;\frac{a \cdot \left(\left(a \cdot a\right) \cdot \left(\frac{t\_9}{\frac{t\_4}{t\_1}} + \frac{t\_6}{\frac{b}{\frac{a \cdot -0.25}{\frac{t\_5}{t\_0}}}}\right) - \frac{t\_3}{\frac{b}{\frac{c}{t\_7}}}\right)}{t\_3 + a \cdot \left(t\_9 + t\_6\right)} - \frac{c}{b}\\ \end{array} \end{array} \]
(FPCore (a b c)
 :precision binary64
 (let* ((t_0 (* (* c (* c (* c c))) 20.0))
        (t_1 (* c (* c (* c -2.0))))
        (t_2 (* b (* b b)))
        (t_3 (* c (/ c t_2)))
        (t_4 (* (* b b) t_2))
        (t_5 (* b t_4))
        (t_6 (/ (* (* a -0.25) t_0) (* b t_5)))
        (t_7 (/ b (/ c b)))
        (t_8 (* c (+ t_7 (* a -4.0))))
        (t_9 (/ t_1 t_4)))
   (if (<= (/ (- (sqrt (- (* b b) (* (* 4.0 a) c))) b) (* a 2.0)) -16.0)
     (/ (* (- (* b b) t_8) (/ -1.0 (+ b (sqrt t_8)))) (* a 2.0))
     (-
      (/
       (*
        a
        (-
         (*
          (* a a)
          (+ (/ t_9 (/ t_4 t_1)) (/ t_6 (/ b (/ (* a -0.25) (/ t_5 t_0))))))
         (/ t_3 (/ b (/ c t_7)))))
       (+ t_3 (* a (+ t_9 t_6))))
      (/ c b)))))
double code(double a, double b, double c) {
	double t_0 = (c * (c * (c * c))) * 20.0;
	double t_1 = c * (c * (c * -2.0));
	double t_2 = b * (b * b);
	double t_3 = c * (c / t_2);
	double t_4 = (b * b) * t_2;
	double t_5 = b * t_4;
	double t_6 = ((a * -0.25) * t_0) / (b * t_5);
	double t_7 = b / (c / b);
	double t_8 = c * (t_7 + (a * -4.0));
	double t_9 = t_1 / t_4;
	double tmp;
	if (((sqrt(((b * b) - ((4.0 * a) * c))) - b) / (a * 2.0)) <= -16.0) {
		tmp = (((b * b) - t_8) * (-1.0 / (b + sqrt(t_8)))) / (a * 2.0);
	} else {
		tmp = ((a * (((a * a) * ((t_9 / (t_4 / t_1)) + (t_6 / (b / ((a * -0.25) / (t_5 / t_0)))))) - (t_3 / (b / (c / t_7))))) / (t_3 + (a * (t_9 + t_6)))) - (c / b);
	}
	return tmp;
}
real(8) function code(a, b, c)
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: t_3
    real(8) :: t_4
    real(8) :: t_5
    real(8) :: t_6
    real(8) :: t_7
    real(8) :: t_8
    real(8) :: t_9
    real(8) :: tmp
    t_0 = (c * (c * (c * c))) * 20.0d0
    t_1 = c * (c * (c * (-2.0d0)))
    t_2 = b * (b * b)
    t_3 = c * (c / t_2)
    t_4 = (b * b) * t_2
    t_5 = b * t_4
    t_6 = ((a * (-0.25d0)) * t_0) / (b * t_5)
    t_7 = b / (c / b)
    t_8 = c * (t_7 + (a * (-4.0d0)))
    t_9 = t_1 / t_4
    if (((sqrt(((b * b) - ((4.0d0 * a) * c))) - b) / (a * 2.0d0)) <= (-16.0d0)) then
        tmp = (((b * b) - t_8) * ((-1.0d0) / (b + sqrt(t_8)))) / (a * 2.0d0)
    else
        tmp = ((a * (((a * a) * ((t_9 / (t_4 / t_1)) + (t_6 / (b / ((a * (-0.25d0)) / (t_5 / t_0)))))) - (t_3 / (b / (c / t_7))))) / (t_3 + (a * (t_9 + t_6)))) - (c / b)
    end if
    code = tmp
end function
public static double code(double a, double b, double c) {
	double t_0 = (c * (c * (c * c))) * 20.0;
	double t_1 = c * (c * (c * -2.0));
	double t_2 = b * (b * b);
	double t_3 = c * (c / t_2);
	double t_4 = (b * b) * t_2;
	double t_5 = b * t_4;
	double t_6 = ((a * -0.25) * t_0) / (b * t_5);
	double t_7 = b / (c / b);
	double t_8 = c * (t_7 + (a * -4.0));
	double t_9 = t_1 / t_4;
	double tmp;
	if (((Math.sqrt(((b * b) - ((4.0 * a) * c))) - b) / (a * 2.0)) <= -16.0) {
		tmp = (((b * b) - t_8) * (-1.0 / (b + Math.sqrt(t_8)))) / (a * 2.0);
	} else {
		tmp = ((a * (((a * a) * ((t_9 / (t_4 / t_1)) + (t_6 / (b / ((a * -0.25) / (t_5 / t_0)))))) - (t_3 / (b / (c / t_7))))) / (t_3 + (a * (t_9 + t_6)))) - (c / b);
	}
	return tmp;
}
def code(a, b, c):
	t_0 = (c * (c * (c * c))) * 20.0
	t_1 = c * (c * (c * -2.0))
	t_2 = b * (b * b)
	t_3 = c * (c / t_2)
	t_4 = (b * b) * t_2
	t_5 = b * t_4
	t_6 = ((a * -0.25) * t_0) / (b * t_5)
	t_7 = b / (c / b)
	t_8 = c * (t_7 + (a * -4.0))
	t_9 = t_1 / t_4
	tmp = 0
	if ((math.sqrt(((b * b) - ((4.0 * a) * c))) - b) / (a * 2.0)) <= -16.0:
		tmp = (((b * b) - t_8) * (-1.0 / (b + math.sqrt(t_8)))) / (a * 2.0)
	else:
		tmp = ((a * (((a * a) * ((t_9 / (t_4 / t_1)) + (t_6 / (b / ((a * -0.25) / (t_5 / t_0)))))) - (t_3 / (b / (c / t_7))))) / (t_3 + (a * (t_9 + t_6)))) - (c / b)
	return tmp
function code(a, b, c)
	t_0 = Float64(Float64(c * Float64(c * Float64(c * c))) * 20.0)
	t_1 = Float64(c * Float64(c * Float64(c * -2.0)))
	t_2 = Float64(b * Float64(b * b))
	t_3 = Float64(c * Float64(c / t_2))
	t_4 = Float64(Float64(b * b) * t_2)
	t_5 = Float64(b * t_4)
	t_6 = Float64(Float64(Float64(a * -0.25) * t_0) / Float64(b * t_5))
	t_7 = Float64(b / Float64(c / b))
	t_8 = Float64(c * Float64(t_7 + Float64(a * -4.0)))
	t_9 = Float64(t_1 / t_4)
	tmp = 0.0
	if (Float64(Float64(sqrt(Float64(Float64(b * b) - Float64(Float64(4.0 * a) * c))) - b) / Float64(a * 2.0)) <= -16.0)
		tmp = Float64(Float64(Float64(Float64(b * b) - t_8) * Float64(-1.0 / Float64(b + sqrt(t_8)))) / Float64(a * 2.0));
	else
		tmp = Float64(Float64(Float64(a * Float64(Float64(Float64(a * a) * Float64(Float64(t_9 / Float64(t_4 / t_1)) + Float64(t_6 / Float64(b / Float64(Float64(a * -0.25) / Float64(t_5 / t_0)))))) - Float64(t_3 / Float64(b / Float64(c / t_7))))) / Float64(t_3 + Float64(a * Float64(t_9 + t_6)))) - Float64(c / b));
	end
	return tmp
end
function tmp_2 = code(a, b, c)
	t_0 = (c * (c * (c * c))) * 20.0;
	t_1 = c * (c * (c * -2.0));
	t_2 = b * (b * b);
	t_3 = c * (c / t_2);
	t_4 = (b * b) * t_2;
	t_5 = b * t_4;
	t_6 = ((a * -0.25) * t_0) / (b * t_5);
	t_7 = b / (c / b);
	t_8 = c * (t_7 + (a * -4.0));
	t_9 = t_1 / t_4;
	tmp = 0.0;
	if (((sqrt(((b * b) - ((4.0 * a) * c))) - b) / (a * 2.0)) <= -16.0)
		tmp = (((b * b) - t_8) * (-1.0 / (b + sqrt(t_8)))) / (a * 2.0);
	else
		tmp = ((a * (((a * a) * ((t_9 / (t_4 / t_1)) + (t_6 / (b / ((a * -0.25) / (t_5 / t_0)))))) - (t_3 / (b / (c / t_7))))) / (t_3 + (a * (t_9 + t_6)))) - (c / b);
	end
	tmp_2 = tmp;
end
code[a_, b_, c_] := Block[{t$95$0 = N[(N[(c * N[(c * N[(c * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * 20.0), $MachinePrecision]}, Block[{t$95$1 = N[(c * N[(c * N[(c * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(b * N[(b * b), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(c * N[(c / t$95$2), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[(b * b), $MachinePrecision] * t$95$2), $MachinePrecision]}, Block[{t$95$5 = N[(b * t$95$4), $MachinePrecision]}, Block[{t$95$6 = N[(N[(N[(a * -0.25), $MachinePrecision] * t$95$0), $MachinePrecision] / N[(b * t$95$5), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$7 = N[(b / N[(c / b), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$8 = N[(c * N[(t$95$7 + N[(a * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$9 = N[(t$95$1 / t$95$4), $MachinePrecision]}, If[LessEqual[N[(N[(N[Sqrt[N[(N[(b * b), $MachinePrecision] - N[(N[(4.0 * a), $MachinePrecision] * c), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision] / N[(a * 2.0), $MachinePrecision]), $MachinePrecision], -16.0], N[(N[(N[(N[(b * b), $MachinePrecision] - t$95$8), $MachinePrecision] * N[(-1.0 / N[(b + N[Sqrt[t$95$8], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(a * 2.0), $MachinePrecision]), $MachinePrecision], N[(N[(N[(a * N[(N[(N[(a * a), $MachinePrecision] * N[(N[(t$95$9 / N[(t$95$4 / t$95$1), $MachinePrecision]), $MachinePrecision] + N[(t$95$6 / N[(b / N[(N[(a * -0.25), $MachinePrecision] / N[(t$95$5 / t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(t$95$3 / N[(b / N[(c / t$95$7), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(t$95$3 + N[(a * N[(t$95$9 + t$95$6), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(c / b), $MachinePrecision]), $MachinePrecision]]]]]]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \left(c \cdot \left(c \cdot \left(c \cdot c\right)\right)\right) \cdot 20\\
t_1 := c \cdot \left(c \cdot \left(c \cdot -2\right)\right)\\
t_2 := b \cdot \left(b \cdot b\right)\\
t_3 := c \cdot \frac{c}{t\_2}\\
t_4 := \left(b \cdot b\right) \cdot t\_2\\
t_5 := b \cdot t\_4\\
t_6 := \frac{\left(a \cdot -0.25\right) \cdot t\_0}{b \cdot t\_5}\\
t_7 := \frac{b}{\frac{c}{b}}\\
t_8 := c \cdot \left(t\_7 + a \cdot -4\right)\\
t_9 := \frac{t\_1}{t\_4}\\
\mathbf{if}\;\frac{\sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c} - b}{a \cdot 2} \leq -16:\\
\;\;\;\;\frac{\left(b \cdot b - t\_8\right) \cdot \frac{-1}{b + \sqrt{t\_8}}}{a \cdot 2}\\

\mathbf{else}:\\
\;\;\;\;\frac{a \cdot \left(\left(a \cdot a\right) \cdot \left(\frac{t\_9}{\frac{t\_4}{t\_1}} + \frac{t\_6}{\frac{b}{\frac{a \cdot -0.25}{\frac{t\_5}{t\_0}}}}\right) - \frac{t\_3}{\frac{b}{\frac{c}{t\_7}}}\right)}{t\_3 + a \cdot \left(t\_9 + t\_6\right)} - \frac{c}{b}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (/.f64 (+.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 #s(literal 4 binary64) a) c)))) (*.f64 #s(literal 2 binary64) a)) < -16

    1. Initial program 86.6%

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{neg.f64}\left(b\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(c, \left(\frac{{b}^{2}}{c} - 4 \cdot a\right)\right)\right)\right), \mathsf{*.f64}\left(2, a\right)\right) \]
      2. cancel-sign-sub-invN/A

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{neg.f64}\left(b\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(c, \mathsf{+.f64}\left(\left(\frac{{b}^{2}}{c}\right), \left(-4 \cdot a\right)\right)\right)\right)\right), \mathsf{*.f64}\left(2, a\right)\right) \]
      5. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{neg.f64}\left(b\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(c, \mathsf{+.f64}\left(\mathsf{/.f64}\left(\left({b}^{2}\right), c\right), \left(-4 \cdot a\right)\right)\right)\right)\right), \mathsf{*.f64}\left(2, a\right)\right) \]
      6. unpow2N/A

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{neg.f64}\left(b\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(c, \mathsf{+.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(b, b\right), c\right), \left(a \cdot -4\right)\right)\right)\right)\right), \mathsf{*.f64}\left(2, a\right)\right) \]
      9. *-lowering-*.f6486.2%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{neg.f64}\left(b\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(c, \mathsf{+.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(b, b\right), c\right), \mathsf{*.f64}\left(a, -4\right)\right)\right)\right)\right), \mathsf{*.f64}\left(2, a\right)\right) \]
    5. Simplified86.2%

      \[\leadsto \frac{\left(-b\right) + \sqrt{\color{blue}{c \cdot \left(\frac{b \cdot b}{c} + a \cdot -4\right)}}}{2 \cdot a} \]
    6. Step-by-step derivation
      1. flip-+N/A

        \[\leadsto \mathsf{/.f64}\left(\left(\frac{\left(\mathsf{neg}\left(b\right)\right) \cdot \left(\mathsf{neg}\left(b\right)\right) - \sqrt{c \cdot \left(\frac{b \cdot b}{c} + a \cdot -4\right)} \cdot \sqrt{c \cdot \left(\frac{b \cdot b}{c} + a \cdot -4\right)}}{\left(\mathsf{neg}\left(b\right)\right) - \sqrt{c \cdot \left(\frac{b \cdot b}{c} + a \cdot -4\right)}}\right), \mathsf{*.f64}\left(\color{blue}{2}, a\right)\right) \]
      2. div-invN/A

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

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

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

    if -16 < (/.f64 (+.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 #s(literal 4 binary64) a) c)))) (*.f64 #s(literal 2 binary64) a))

    1. Initial program 54.2%

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

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

      \[\leadsto \color{blue}{a \cdot \left(a \cdot \left(\frac{\left(c \cdot \left(c \cdot c\right)\right) \cdot -2}{{b}^{5}} + \frac{\left(-0.25 \cdot a\right) \cdot \frac{{c}^{4} \cdot 20}{{b}^{6}}}{b}\right) - \frac{c \cdot \frac{\frac{c}{b}}{b}}{b}\right) - \frac{c}{b}} \]
    5. Applied egg-rr93.4%

      \[\leadsto \color{blue}{\frac{\left(\left(a \cdot a\right) \cdot \left(\frac{\frac{c \cdot \left(c \cdot \left(c \cdot -2\right)\right)}{\left(b \cdot b\right) \cdot \left(b \cdot \left(b \cdot b\right)\right)}}{\frac{\left(b \cdot b\right) \cdot \left(b \cdot \left(b \cdot b\right)\right)}{c \cdot \left(c \cdot \left(c \cdot -2\right)\right)}} + \frac{\frac{\left(-0.25 \cdot a\right) \cdot \left(\left(c \cdot \left(c \cdot \left(c \cdot c\right)\right)\right) \cdot 20\right)}{b \cdot \left(b \cdot \left(\left(b \cdot b\right) \cdot \left(b \cdot \left(b \cdot b\right)\right)\right)\right)}}{\frac{b}{\frac{-0.25 \cdot a}{\frac{b \cdot \left(\left(b \cdot b\right) \cdot \left(b \cdot \left(b \cdot b\right)\right)\right)}{\left(c \cdot \left(c \cdot \left(c \cdot c\right)\right)\right) \cdot 20}}}}\right) - \frac{c \cdot \frac{c}{b \cdot \left(b \cdot b\right)}}{\frac{b}{\frac{c}{\frac{b}{\frac{c}{b}}}}}\right) \cdot a}{a \cdot \left(\frac{\left(-0.25 \cdot a\right) \cdot \left(\left(c \cdot \left(c \cdot \left(c \cdot c\right)\right)\right) \cdot 20\right)}{b \cdot \left(b \cdot \left(\left(b \cdot b\right) \cdot \left(b \cdot \left(b \cdot b\right)\right)\right)\right)} + \frac{c \cdot \left(c \cdot \left(c \cdot -2\right)\right)}{\left(b \cdot b\right) \cdot \left(b \cdot \left(b \cdot b\right)\right)}\right) + c \cdot \frac{c}{b \cdot \left(b \cdot b\right)}}} - \frac{c}{b} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification92.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{\sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c} - b}{a \cdot 2} \leq -16:\\ \;\;\;\;\frac{\left(b \cdot b - c \cdot \left(\frac{b}{\frac{c}{b}} + a \cdot -4\right)\right) \cdot \frac{-1}{b + \sqrt{c \cdot \left(\frac{b}{\frac{c}{b}} + a \cdot -4\right)}}}{a \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;\frac{a \cdot \left(\left(a \cdot a\right) \cdot \left(\frac{\frac{c \cdot \left(c \cdot \left(c \cdot -2\right)\right)}{\left(b \cdot b\right) \cdot \left(b \cdot \left(b \cdot b\right)\right)}}{\frac{\left(b \cdot b\right) \cdot \left(b \cdot \left(b \cdot b\right)\right)}{c \cdot \left(c \cdot \left(c \cdot -2\right)\right)}} + \frac{\frac{\left(a \cdot -0.25\right) \cdot \left(\left(c \cdot \left(c \cdot \left(c \cdot c\right)\right)\right) \cdot 20\right)}{b \cdot \left(b \cdot \left(\left(b \cdot b\right) \cdot \left(b \cdot \left(b \cdot b\right)\right)\right)\right)}}{\frac{b}{\frac{a \cdot -0.25}{\frac{b \cdot \left(\left(b \cdot b\right) \cdot \left(b \cdot \left(b \cdot b\right)\right)\right)}{\left(c \cdot \left(c \cdot \left(c \cdot c\right)\right)\right) \cdot 20}}}}\right) - \frac{c \cdot \frac{c}{b \cdot \left(b \cdot b\right)}}{\frac{b}{\frac{c}{\frac{b}{\frac{c}{b}}}}}\right)}{c \cdot \frac{c}{b \cdot \left(b \cdot b\right)} + a \cdot \left(\frac{c \cdot \left(c \cdot \left(c \cdot -2\right)\right)}{\left(b \cdot b\right) \cdot \left(b \cdot \left(b \cdot b\right)\right)} + \frac{\left(a \cdot -0.25\right) \cdot \left(\left(c \cdot \left(c \cdot \left(c \cdot c\right)\right)\right) \cdot 20\right)}{b \cdot \left(b \cdot \left(\left(b \cdot b\right) \cdot \left(b \cdot \left(b \cdot b\right)\right)\right)\right)}\right)} - \frac{c}{b}\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 92.2% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := c \cdot \left(\frac{b}{\frac{c}{b}} + a \cdot -4\right)\\ t_1 := b \cdot \left(b \cdot b\right)\\ t_2 := \left(b \cdot b\right) \cdot t\_1\\ \mathbf{if}\;\frac{\sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c} - b}{a \cdot 2} \leq -16:\\ \;\;\;\;\frac{\left(b \cdot b - t\_0\right) \cdot \frac{-1}{b + \sqrt{t\_0}}}{a \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;a \cdot \left(a \cdot \left(\frac{c \cdot \left(c \cdot \left(c \cdot -2\right)\right)}{t\_2} + \frac{\left(a \cdot -0.25\right) \cdot \left(\left(c \cdot \left(c \cdot \left(c \cdot c\right)\right)\right) \cdot 20\right)}{b \cdot \left(b \cdot t\_2\right)}\right) - c \cdot \frac{c}{t\_1}\right) - \frac{c}{b}\\ \end{array} \end{array} \]
(FPCore (a b c)
 :precision binary64
 (let* ((t_0 (* c (+ (/ b (/ c b)) (* a -4.0))))
        (t_1 (* b (* b b)))
        (t_2 (* (* b b) t_1)))
   (if (<= (/ (- (sqrt (- (* b b) (* (* 4.0 a) c))) b) (* a 2.0)) -16.0)
     (/ (* (- (* b b) t_0) (/ -1.0 (+ b (sqrt t_0)))) (* a 2.0))
     (-
      (*
       a
       (-
        (*
         a
         (+
          (/ (* c (* c (* c -2.0))) t_2)
          (/ (* (* a -0.25) (* (* c (* c (* c c))) 20.0)) (* b (* b t_2)))))
        (* c (/ c t_1))))
      (/ c b)))))
double code(double a, double b, double c) {
	double t_0 = c * ((b / (c / b)) + (a * -4.0));
	double t_1 = b * (b * b);
	double t_2 = (b * b) * t_1;
	double tmp;
	if (((sqrt(((b * b) - ((4.0 * a) * c))) - b) / (a * 2.0)) <= -16.0) {
		tmp = (((b * b) - t_0) * (-1.0 / (b + sqrt(t_0)))) / (a * 2.0);
	} else {
		tmp = (a * ((a * (((c * (c * (c * -2.0))) / t_2) + (((a * -0.25) * ((c * (c * (c * c))) * 20.0)) / (b * (b * t_2))))) - (c * (c / t_1)))) - (c / b);
	}
	return tmp;
}
real(8) function code(a, b, c)
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_0 = c * ((b / (c / b)) + (a * (-4.0d0)))
    t_1 = b * (b * b)
    t_2 = (b * b) * t_1
    if (((sqrt(((b * b) - ((4.0d0 * a) * c))) - b) / (a * 2.0d0)) <= (-16.0d0)) then
        tmp = (((b * b) - t_0) * ((-1.0d0) / (b + sqrt(t_0)))) / (a * 2.0d0)
    else
        tmp = (a * ((a * (((c * (c * (c * (-2.0d0)))) / t_2) + (((a * (-0.25d0)) * ((c * (c * (c * c))) * 20.0d0)) / (b * (b * t_2))))) - (c * (c / t_1)))) - (c / b)
    end if
    code = tmp
end function
public static double code(double a, double b, double c) {
	double t_0 = c * ((b / (c / b)) + (a * -4.0));
	double t_1 = b * (b * b);
	double t_2 = (b * b) * t_1;
	double tmp;
	if (((Math.sqrt(((b * b) - ((4.0 * a) * c))) - b) / (a * 2.0)) <= -16.0) {
		tmp = (((b * b) - t_0) * (-1.0 / (b + Math.sqrt(t_0)))) / (a * 2.0);
	} else {
		tmp = (a * ((a * (((c * (c * (c * -2.0))) / t_2) + (((a * -0.25) * ((c * (c * (c * c))) * 20.0)) / (b * (b * t_2))))) - (c * (c / t_1)))) - (c / b);
	}
	return tmp;
}
def code(a, b, c):
	t_0 = c * ((b / (c / b)) + (a * -4.0))
	t_1 = b * (b * b)
	t_2 = (b * b) * t_1
	tmp = 0
	if ((math.sqrt(((b * b) - ((4.0 * a) * c))) - b) / (a * 2.0)) <= -16.0:
		tmp = (((b * b) - t_0) * (-1.0 / (b + math.sqrt(t_0)))) / (a * 2.0)
	else:
		tmp = (a * ((a * (((c * (c * (c * -2.0))) / t_2) + (((a * -0.25) * ((c * (c * (c * c))) * 20.0)) / (b * (b * t_2))))) - (c * (c / t_1)))) - (c / b)
	return tmp
function code(a, b, c)
	t_0 = Float64(c * Float64(Float64(b / Float64(c / b)) + Float64(a * -4.0)))
	t_1 = Float64(b * Float64(b * b))
	t_2 = Float64(Float64(b * b) * t_1)
	tmp = 0.0
	if (Float64(Float64(sqrt(Float64(Float64(b * b) - Float64(Float64(4.0 * a) * c))) - b) / Float64(a * 2.0)) <= -16.0)
		tmp = Float64(Float64(Float64(Float64(b * b) - t_0) * Float64(-1.0 / Float64(b + sqrt(t_0)))) / Float64(a * 2.0));
	else
		tmp = Float64(Float64(a * Float64(Float64(a * Float64(Float64(Float64(c * Float64(c * Float64(c * -2.0))) / t_2) + Float64(Float64(Float64(a * -0.25) * Float64(Float64(c * Float64(c * Float64(c * c))) * 20.0)) / Float64(b * Float64(b * t_2))))) - Float64(c * Float64(c / t_1)))) - Float64(c / b));
	end
	return tmp
end
function tmp_2 = code(a, b, c)
	t_0 = c * ((b / (c / b)) + (a * -4.0));
	t_1 = b * (b * b);
	t_2 = (b * b) * t_1;
	tmp = 0.0;
	if (((sqrt(((b * b) - ((4.0 * a) * c))) - b) / (a * 2.0)) <= -16.0)
		tmp = (((b * b) - t_0) * (-1.0 / (b + sqrt(t_0)))) / (a * 2.0);
	else
		tmp = (a * ((a * (((c * (c * (c * -2.0))) / t_2) + (((a * -0.25) * ((c * (c * (c * c))) * 20.0)) / (b * (b * t_2))))) - (c * (c / t_1)))) - (c / b);
	end
	tmp_2 = tmp;
end
code[a_, b_, c_] := Block[{t$95$0 = N[(c * N[(N[(b / N[(c / b), $MachinePrecision]), $MachinePrecision] + N[(a * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(b * N[(b * b), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(b * b), $MachinePrecision] * t$95$1), $MachinePrecision]}, If[LessEqual[N[(N[(N[Sqrt[N[(N[(b * b), $MachinePrecision] - N[(N[(4.0 * a), $MachinePrecision] * c), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision] / N[(a * 2.0), $MachinePrecision]), $MachinePrecision], -16.0], N[(N[(N[(N[(b * b), $MachinePrecision] - t$95$0), $MachinePrecision] * N[(-1.0 / N[(b + N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(a * 2.0), $MachinePrecision]), $MachinePrecision], N[(N[(a * N[(N[(a * N[(N[(N[(c * N[(c * N[(c * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$2), $MachinePrecision] + N[(N[(N[(a * -0.25), $MachinePrecision] * N[(N[(c * N[(c * N[(c * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * 20.0), $MachinePrecision]), $MachinePrecision] / N[(b * N[(b * t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(c * N[(c / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(c / b), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := c \cdot \left(\frac{b}{\frac{c}{b}} + a \cdot -4\right)\\
t_1 := b \cdot \left(b \cdot b\right)\\
t_2 := \left(b \cdot b\right) \cdot t\_1\\
\mathbf{if}\;\frac{\sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c} - b}{a \cdot 2} \leq -16:\\
\;\;\;\;\frac{\left(b \cdot b - t\_0\right) \cdot \frac{-1}{b + \sqrt{t\_0}}}{a \cdot 2}\\

\mathbf{else}:\\
\;\;\;\;a \cdot \left(a \cdot \left(\frac{c \cdot \left(c \cdot \left(c \cdot -2\right)\right)}{t\_2} + \frac{\left(a \cdot -0.25\right) \cdot \left(\left(c \cdot \left(c \cdot \left(c \cdot c\right)\right)\right) \cdot 20\right)}{b \cdot \left(b \cdot t\_2\right)}\right) - c \cdot \frac{c}{t\_1}\right) - \frac{c}{b}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (/.f64 (+.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 #s(literal 4 binary64) a) c)))) (*.f64 #s(literal 2 binary64) a)) < -16

    1. Initial program 86.6%

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{neg.f64}\left(b\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(c, \left(\frac{{b}^{2}}{c} - 4 \cdot a\right)\right)\right)\right), \mathsf{*.f64}\left(2, a\right)\right) \]
      2. cancel-sign-sub-invN/A

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{neg.f64}\left(b\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(c, \mathsf{+.f64}\left(\left(\frac{{b}^{2}}{c}\right), \left(-4 \cdot a\right)\right)\right)\right)\right), \mathsf{*.f64}\left(2, a\right)\right) \]
      5. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{neg.f64}\left(b\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(c, \mathsf{+.f64}\left(\mathsf{/.f64}\left(\left({b}^{2}\right), c\right), \left(-4 \cdot a\right)\right)\right)\right)\right), \mathsf{*.f64}\left(2, a\right)\right) \]
      6. unpow2N/A

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{neg.f64}\left(b\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(c, \mathsf{+.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(b, b\right), c\right), \left(a \cdot -4\right)\right)\right)\right)\right), \mathsf{*.f64}\left(2, a\right)\right) \]
      9. *-lowering-*.f6486.2%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{neg.f64}\left(b\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(c, \mathsf{+.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(b, b\right), c\right), \mathsf{*.f64}\left(a, -4\right)\right)\right)\right)\right), \mathsf{*.f64}\left(2, a\right)\right) \]
    5. Simplified86.2%

      \[\leadsto \frac{\left(-b\right) + \sqrt{\color{blue}{c \cdot \left(\frac{b \cdot b}{c} + a \cdot -4\right)}}}{2 \cdot a} \]
    6. Step-by-step derivation
      1. flip-+N/A

        \[\leadsto \mathsf{/.f64}\left(\left(\frac{\left(\mathsf{neg}\left(b\right)\right) \cdot \left(\mathsf{neg}\left(b\right)\right) - \sqrt{c \cdot \left(\frac{b \cdot b}{c} + a \cdot -4\right)} \cdot \sqrt{c \cdot \left(\frac{b \cdot b}{c} + a \cdot -4\right)}}{\left(\mathsf{neg}\left(b\right)\right) - \sqrt{c \cdot \left(\frac{b \cdot b}{c} + a \cdot -4\right)}}\right), \mathsf{*.f64}\left(\color{blue}{2}, a\right)\right) \]
      2. div-invN/A

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

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

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

    if -16 < (/.f64 (+.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 #s(literal 4 binary64) a) c)))) (*.f64 #s(literal 2 binary64) a))

    1. Initial program 54.2%

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

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

      \[\leadsto \color{blue}{a \cdot \left(a \cdot \left(\frac{\left(c \cdot \left(c \cdot c\right)\right) \cdot -2}{{b}^{5}} + \frac{\left(-0.25 \cdot a\right) \cdot \frac{{c}^{4} \cdot 20}{{b}^{6}}}{b}\right) - \frac{c \cdot \frac{\frac{c}{b}}{b}}{b}\right) - \frac{c}{b}} \]
    5. Applied egg-rr93.0%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{\sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c} - b}{a \cdot 2} \leq -16:\\ \;\;\;\;\frac{\left(b \cdot b - c \cdot \left(\frac{b}{\frac{c}{b}} + a \cdot -4\right)\right) \cdot \frac{-1}{b + \sqrt{c \cdot \left(\frac{b}{\frac{c}{b}} + a \cdot -4\right)}}}{a \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;a \cdot \left(a \cdot \left(\frac{c \cdot \left(c \cdot \left(c \cdot -2\right)\right)}{\left(b \cdot b\right) \cdot \left(b \cdot \left(b \cdot b\right)\right)} + \frac{\left(a \cdot -0.25\right) \cdot \left(\left(c \cdot \left(c \cdot \left(c \cdot c\right)\right)\right) \cdot 20\right)}{b \cdot \left(b \cdot \left(\left(b \cdot b\right) \cdot \left(b \cdot \left(b \cdot b\right)\right)\right)\right)}\right) - c \cdot \frac{c}{b \cdot \left(b \cdot b\right)}\right) - \frac{c}{b}\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 92.2% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := c \cdot \left(\frac{b}{\frac{c}{b}} + a \cdot -4\right)\\ t_1 := b \cdot \left(b \cdot b\right)\\ t_2 := \left(b \cdot b\right) \cdot t\_1\\ \mathbf{if}\;\frac{\sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c} - b}{a \cdot 2} \leq -16:\\ \;\;\;\;\frac{t\_0 - b \cdot b}{\left(a \cdot 2\right) \cdot \left(b + \sqrt{t\_0}\right)}\\ \mathbf{else}:\\ \;\;\;\;a \cdot \left(a \cdot \left(\frac{c \cdot \left(c \cdot \left(c \cdot -2\right)\right)}{t\_2} + \frac{\left(a \cdot -0.25\right) \cdot \left(\left(c \cdot \left(c \cdot \left(c \cdot c\right)\right)\right) \cdot 20\right)}{b \cdot \left(b \cdot t\_2\right)}\right) - c \cdot \frac{c}{t\_1}\right) - \frac{c}{b}\\ \end{array} \end{array} \]
(FPCore (a b c)
 :precision binary64
 (let* ((t_0 (* c (+ (/ b (/ c b)) (* a -4.0))))
        (t_1 (* b (* b b)))
        (t_2 (* (* b b) t_1)))
   (if (<= (/ (- (sqrt (- (* b b) (* (* 4.0 a) c))) b) (* a 2.0)) -16.0)
     (/ (- t_0 (* b b)) (* (* a 2.0) (+ b (sqrt t_0))))
     (-
      (*
       a
       (-
        (*
         a
         (+
          (/ (* c (* c (* c -2.0))) t_2)
          (/ (* (* a -0.25) (* (* c (* c (* c c))) 20.0)) (* b (* b t_2)))))
        (* c (/ c t_1))))
      (/ c b)))))
double code(double a, double b, double c) {
	double t_0 = c * ((b / (c / b)) + (a * -4.0));
	double t_1 = b * (b * b);
	double t_2 = (b * b) * t_1;
	double tmp;
	if (((sqrt(((b * b) - ((4.0 * a) * c))) - b) / (a * 2.0)) <= -16.0) {
		tmp = (t_0 - (b * b)) / ((a * 2.0) * (b + sqrt(t_0)));
	} else {
		tmp = (a * ((a * (((c * (c * (c * -2.0))) / t_2) + (((a * -0.25) * ((c * (c * (c * c))) * 20.0)) / (b * (b * t_2))))) - (c * (c / t_1)))) - (c / b);
	}
	return tmp;
}
real(8) function code(a, b, c)
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_0 = c * ((b / (c / b)) + (a * (-4.0d0)))
    t_1 = b * (b * b)
    t_2 = (b * b) * t_1
    if (((sqrt(((b * b) - ((4.0d0 * a) * c))) - b) / (a * 2.0d0)) <= (-16.0d0)) then
        tmp = (t_0 - (b * b)) / ((a * 2.0d0) * (b + sqrt(t_0)))
    else
        tmp = (a * ((a * (((c * (c * (c * (-2.0d0)))) / t_2) + (((a * (-0.25d0)) * ((c * (c * (c * c))) * 20.0d0)) / (b * (b * t_2))))) - (c * (c / t_1)))) - (c / b)
    end if
    code = tmp
end function
public static double code(double a, double b, double c) {
	double t_0 = c * ((b / (c / b)) + (a * -4.0));
	double t_1 = b * (b * b);
	double t_2 = (b * b) * t_1;
	double tmp;
	if (((Math.sqrt(((b * b) - ((4.0 * a) * c))) - b) / (a * 2.0)) <= -16.0) {
		tmp = (t_0 - (b * b)) / ((a * 2.0) * (b + Math.sqrt(t_0)));
	} else {
		tmp = (a * ((a * (((c * (c * (c * -2.0))) / t_2) + (((a * -0.25) * ((c * (c * (c * c))) * 20.0)) / (b * (b * t_2))))) - (c * (c / t_1)))) - (c / b);
	}
	return tmp;
}
def code(a, b, c):
	t_0 = c * ((b / (c / b)) + (a * -4.0))
	t_1 = b * (b * b)
	t_2 = (b * b) * t_1
	tmp = 0
	if ((math.sqrt(((b * b) - ((4.0 * a) * c))) - b) / (a * 2.0)) <= -16.0:
		tmp = (t_0 - (b * b)) / ((a * 2.0) * (b + math.sqrt(t_0)))
	else:
		tmp = (a * ((a * (((c * (c * (c * -2.0))) / t_2) + (((a * -0.25) * ((c * (c * (c * c))) * 20.0)) / (b * (b * t_2))))) - (c * (c / t_1)))) - (c / b)
	return tmp
function code(a, b, c)
	t_0 = Float64(c * Float64(Float64(b / Float64(c / b)) + Float64(a * -4.0)))
	t_1 = Float64(b * Float64(b * b))
	t_2 = Float64(Float64(b * b) * t_1)
	tmp = 0.0
	if (Float64(Float64(sqrt(Float64(Float64(b * b) - Float64(Float64(4.0 * a) * c))) - b) / Float64(a * 2.0)) <= -16.0)
		tmp = Float64(Float64(t_0 - Float64(b * b)) / Float64(Float64(a * 2.0) * Float64(b + sqrt(t_0))));
	else
		tmp = Float64(Float64(a * Float64(Float64(a * Float64(Float64(Float64(c * Float64(c * Float64(c * -2.0))) / t_2) + Float64(Float64(Float64(a * -0.25) * Float64(Float64(c * Float64(c * Float64(c * c))) * 20.0)) / Float64(b * Float64(b * t_2))))) - Float64(c * Float64(c / t_1)))) - Float64(c / b));
	end
	return tmp
end
function tmp_2 = code(a, b, c)
	t_0 = c * ((b / (c / b)) + (a * -4.0));
	t_1 = b * (b * b);
	t_2 = (b * b) * t_1;
	tmp = 0.0;
	if (((sqrt(((b * b) - ((4.0 * a) * c))) - b) / (a * 2.0)) <= -16.0)
		tmp = (t_0 - (b * b)) / ((a * 2.0) * (b + sqrt(t_0)));
	else
		tmp = (a * ((a * (((c * (c * (c * -2.0))) / t_2) + (((a * -0.25) * ((c * (c * (c * c))) * 20.0)) / (b * (b * t_2))))) - (c * (c / t_1)))) - (c / b);
	end
	tmp_2 = tmp;
end
code[a_, b_, c_] := Block[{t$95$0 = N[(c * N[(N[(b / N[(c / b), $MachinePrecision]), $MachinePrecision] + N[(a * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(b * N[(b * b), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(b * b), $MachinePrecision] * t$95$1), $MachinePrecision]}, If[LessEqual[N[(N[(N[Sqrt[N[(N[(b * b), $MachinePrecision] - N[(N[(4.0 * a), $MachinePrecision] * c), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision] / N[(a * 2.0), $MachinePrecision]), $MachinePrecision], -16.0], N[(N[(t$95$0 - N[(b * b), $MachinePrecision]), $MachinePrecision] / N[(N[(a * 2.0), $MachinePrecision] * N[(b + N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(a * N[(N[(a * N[(N[(N[(c * N[(c * N[(c * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$2), $MachinePrecision] + N[(N[(N[(a * -0.25), $MachinePrecision] * N[(N[(c * N[(c * N[(c * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * 20.0), $MachinePrecision]), $MachinePrecision] / N[(b * N[(b * t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(c * N[(c / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(c / b), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := c \cdot \left(\frac{b}{\frac{c}{b}} + a \cdot -4\right)\\
t_1 := b \cdot \left(b \cdot b\right)\\
t_2 := \left(b \cdot b\right) \cdot t\_1\\
\mathbf{if}\;\frac{\sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c} - b}{a \cdot 2} \leq -16:\\
\;\;\;\;\frac{t\_0 - b \cdot b}{\left(a \cdot 2\right) \cdot \left(b + \sqrt{t\_0}\right)}\\

\mathbf{else}:\\
\;\;\;\;a \cdot \left(a \cdot \left(\frac{c \cdot \left(c \cdot \left(c \cdot -2\right)\right)}{t\_2} + \frac{\left(a \cdot -0.25\right) \cdot \left(\left(c \cdot \left(c \cdot \left(c \cdot c\right)\right)\right) \cdot 20\right)}{b \cdot \left(b \cdot t\_2\right)}\right) - c \cdot \frac{c}{t\_1}\right) - \frac{c}{b}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (/.f64 (+.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 #s(literal 4 binary64) a) c)))) (*.f64 #s(literal 2 binary64) a)) < -16

    1. Initial program 86.6%

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{neg.f64}\left(b\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(c, \left(\frac{{b}^{2}}{c} - 4 \cdot a\right)\right)\right)\right), \mathsf{*.f64}\left(2, a\right)\right) \]
      2. cancel-sign-sub-invN/A

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{neg.f64}\left(b\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(c, \mathsf{+.f64}\left(\left(\frac{{b}^{2}}{c}\right), \left(-4 \cdot a\right)\right)\right)\right)\right), \mathsf{*.f64}\left(2, a\right)\right) \]
      5. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{neg.f64}\left(b\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(c, \mathsf{+.f64}\left(\mathsf{/.f64}\left(\left({b}^{2}\right), c\right), \left(-4 \cdot a\right)\right)\right)\right)\right), \mathsf{*.f64}\left(2, a\right)\right) \]
      6. unpow2N/A

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{neg.f64}\left(b\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(c, \mathsf{+.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(b, b\right), c\right), \left(a \cdot -4\right)\right)\right)\right)\right), \mathsf{*.f64}\left(2, a\right)\right) \]
      9. *-lowering-*.f6486.2%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{neg.f64}\left(b\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(c, \mathsf{+.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(b, b\right), c\right), \mathsf{*.f64}\left(a, -4\right)\right)\right)\right)\right), \mathsf{*.f64}\left(2, a\right)\right) \]
    5. Simplified86.2%

      \[\leadsto \frac{\left(-b\right) + \sqrt{\color{blue}{c \cdot \left(\frac{b \cdot b}{c} + a \cdot -4\right)}}}{2 \cdot a} \]
    6. Step-by-step derivation
      1. flip-+N/A

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\left(\left(\mathsf{neg}\left(b\right)\right) \cdot \left(\mathsf{neg}\left(b\right)\right) - \sqrt{c \cdot \left(\frac{b \cdot b}{c} + a \cdot -4\right)} \cdot \sqrt{c \cdot \left(\frac{b \cdot b}{c} + a \cdot -4\right)}\right), \color{blue}{\left(\left(1 \cdot \left(a \cdot 2\right)\right) \cdot \left(\left(\mathsf{neg}\left(b\right)\right) - \sqrt{c \cdot \left(\frac{b \cdot b}{c} + a \cdot -4\right)}\right)\right)}\right) \]
    7. Applied egg-rr87.3%

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

    if -16 < (/.f64 (+.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 #s(literal 4 binary64) a) c)))) (*.f64 #s(literal 2 binary64) a))

    1. Initial program 54.2%

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

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

      \[\leadsto \color{blue}{a \cdot \left(a \cdot \left(\frac{\left(c \cdot \left(c \cdot c\right)\right) \cdot -2}{{b}^{5}} + \frac{\left(-0.25 \cdot a\right) \cdot \frac{{c}^{4} \cdot 20}{{b}^{6}}}{b}\right) - \frac{c \cdot \frac{\frac{c}{b}}{b}}{b}\right) - \frac{c}{b}} \]
    5. Applied egg-rr93.0%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{\sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c} - b}{a \cdot 2} \leq -16:\\ \;\;\;\;\frac{c \cdot \left(\frac{b}{\frac{c}{b}} + a \cdot -4\right) - b \cdot b}{\left(a \cdot 2\right) \cdot \left(b + \sqrt{c \cdot \left(\frac{b}{\frac{c}{b}} + a \cdot -4\right)}\right)}\\ \mathbf{else}:\\ \;\;\;\;a \cdot \left(a \cdot \left(\frac{c \cdot \left(c \cdot \left(c \cdot -2\right)\right)}{\left(b \cdot b\right) \cdot \left(b \cdot \left(b \cdot b\right)\right)} + \frac{\left(a \cdot -0.25\right) \cdot \left(\left(c \cdot \left(c \cdot \left(c \cdot c\right)\right)\right) \cdot 20\right)}{b \cdot \left(b \cdot \left(\left(b \cdot b\right) \cdot \left(b \cdot \left(b \cdot b\right)\right)\right)\right)}\right) - c \cdot \frac{c}{b \cdot \left(b \cdot b\right)}\right) - \frac{c}{b}\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 92.2% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := c \cdot \left(\frac{b}{\frac{c}{b}} + a \cdot -4\right)\\ t_1 := b \cdot \left(b \cdot b\right)\\ t_2 := \left(b \cdot b\right) \cdot t\_1\\ \mathbf{if}\;\frac{\sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c} - b}{a \cdot 2} \leq -16:\\ \;\;\;\;\frac{\frac{0.5}{a} \cdot \left(t\_0 - b \cdot b\right)}{b + \sqrt{t\_0}}\\ \mathbf{else}:\\ \;\;\;\;a \cdot \left(a \cdot \left(\frac{c \cdot \left(c \cdot \left(c \cdot -2\right)\right)}{t\_2} + \frac{\left(a \cdot -0.25\right) \cdot \left(\left(c \cdot \left(c \cdot \left(c \cdot c\right)\right)\right) \cdot 20\right)}{b \cdot \left(b \cdot t\_2\right)}\right) - c \cdot \frac{c}{t\_1}\right) - \frac{c}{b}\\ \end{array} \end{array} \]
(FPCore (a b c)
 :precision binary64
 (let* ((t_0 (* c (+ (/ b (/ c b)) (* a -4.0))))
        (t_1 (* b (* b b)))
        (t_2 (* (* b b) t_1)))
   (if (<= (/ (- (sqrt (- (* b b) (* (* 4.0 a) c))) b) (* a 2.0)) -16.0)
     (/ (* (/ 0.5 a) (- t_0 (* b b))) (+ b (sqrt t_0)))
     (-
      (*
       a
       (-
        (*
         a
         (+
          (/ (* c (* c (* c -2.0))) t_2)
          (/ (* (* a -0.25) (* (* c (* c (* c c))) 20.0)) (* b (* b t_2)))))
        (* c (/ c t_1))))
      (/ c b)))))
double code(double a, double b, double c) {
	double t_0 = c * ((b / (c / b)) + (a * -4.0));
	double t_1 = b * (b * b);
	double t_2 = (b * b) * t_1;
	double tmp;
	if (((sqrt(((b * b) - ((4.0 * a) * c))) - b) / (a * 2.0)) <= -16.0) {
		tmp = ((0.5 / a) * (t_0 - (b * b))) / (b + sqrt(t_0));
	} else {
		tmp = (a * ((a * (((c * (c * (c * -2.0))) / t_2) + (((a * -0.25) * ((c * (c * (c * c))) * 20.0)) / (b * (b * t_2))))) - (c * (c / t_1)))) - (c / b);
	}
	return tmp;
}
real(8) function code(a, b, c)
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_0 = c * ((b / (c / b)) + (a * (-4.0d0)))
    t_1 = b * (b * b)
    t_2 = (b * b) * t_1
    if (((sqrt(((b * b) - ((4.0d0 * a) * c))) - b) / (a * 2.0d0)) <= (-16.0d0)) then
        tmp = ((0.5d0 / a) * (t_0 - (b * b))) / (b + sqrt(t_0))
    else
        tmp = (a * ((a * (((c * (c * (c * (-2.0d0)))) / t_2) + (((a * (-0.25d0)) * ((c * (c * (c * c))) * 20.0d0)) / (b * (b * t_2))))) - (c * (c / t_1)))) - (c / b)
    end if
    code = tmp
end function
public static double code(double a, double b, double c) {
	double t_0 = c * ((b / (c / b)) + (a * -4.0));
	double t_1 = b * (b * b);
	double t_2 = (b * b) * t_1;
	double tmp;
	if (((Math.sqrt(((b * b) - ((4.0 * a) * c))) - b) / (a * 2.0)) <= -16.0) {
		tmp = ((0.5 / a) * (t_0 - (b * b))) / (b + Math.sqrt(t_0));
	} else {
		tmp = (a * ((a * (((c * (c * (c * -2.0))) / t_2) + (((a * -0.25) * ((c * (c * (c * c))) * 20.0)) / (b * (b * t_2))))) - (c * (c / t_1)))) - (c / b);
	}
	return tmp;
}
def code(a, b, c):
	t_0 = c * ((b / (c / b)) + (a * -4.0))
	t_1 = b * (b * b)
	t_2 = (b * b) * t_1
	tmp = 0
	if ((math.sqrt(((b * b) - ((4.0 * a) * c))) - b) / (a * 2.0)) <= -16.0:
		tmp = ((0.5 / a) * (t_0 - (b * b))) / (b + math.sqrt(t_0))
	else:
		tmp = (a * ((a * (((c * (c * (c * -2.0))) / t_2) + (((a * -0.25) * ((c * (c * (c * c))) * 20.0)) / (b * (b * t_2))))) - (c * (c / t_1)))) - (c / b)
	return tmp
function code(a, b, c)
	t_0 = Float64(c * Float64(Float64(b / Float64(c / b)) + Float64(a * -4.0)))
	t_1 = Float64(b * Float64(b * b))
	t_2 = Float64(Float64(b * b) * t_1)
	tmp = 0.0
	if (Float64(Float64(sqrt(Float64(Float64(b * b) - Float64(Float64(4.0 * a) * c))) - b) / Float64(a * 2.0)) <= -16.0)
		tmp = Float64(Float64(Float64(0.5 / a) * Float64(t_0 - Float64(b * b))) / Float64(b + sqrt(t_0)));
	else
		tmp = Float64(Float64(a * Float64(Float64(a * Float64(Float64(Float64(c * Float64(c * Float64(c * -2.0))) / t_2) + Float64(Float64(Float64(a * -0.25) * Float64(Float64(c * Float64(c * Float64(c * c))) * 20.0)) / Float64(b * Float64(b * t_2))))) - Float64(c * Float64(c / t_1)))) - Float64(c / b));
	end
	return tmp
end
function tmp_2 = code(a, b, c)
	t_0 = c * ((b / (c / b)) + (a * -4.0));
	t_1 = b * (b * b);
	t_2 = (b * b) * t_1;
	tmp = 0.0;
	if (((sqrt(((b * b) - ((4.0 * a) * c))) - b) / (a * 2.0)) <= -16.0)
		tmp = ((0.5 / a) * (t_0 - (b * b))) / (b + sqrt(t_0));
	else
		tmp = (a * ((a * (((c * (c * (c * -2.0))) / t_2) + (((a * -0.25) * ((c * (c * (c * c))) * 20.0)) / (b * (b * t_2))))) - (c * (c / t_1)))) - (c / b);
	end
	tmp_2 = tmp;
end
code[a_, b_, c_] := Block[{t$95$0 = N[(c * N[(N[(b / N[(c / b), $MachinePrecision]), $MachinePrecision] + N[(a * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(b * N[(b * b), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(b * b), $MachinePrecision] * t$95$1), $MachinePrecision]}, If[LessEqual[N[(N[(N[Sqrt[N[(N[(b * b), $MachinePrecision] - N[(N[(4.0 * a), $MachinePrecision] * c), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision] / N[(a * 2.0), $MachinePrecision]), $MachinePrecision], -16.0], N[(N[(N[(0.5 / a), $MachinePrecision] * N[(t$95$0 - N[(b * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(b + N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(a * N[(N[(a * N[(N[(N[(c * N[(c * N[(c * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$2), $MachinePrecision] + N[(N[(N[(a * -0.25), $MachinePrecision] * N[(N[(c * N[(c * N[(c * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * 20.0), $MachinePrecision]), $MachinePrecision] / N[(b * N[(b * t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(c * N[(c / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(c / b), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := c \cdot \left(\frac{b}{\frac{c}{b}} + a \cdot -4\right)\\
t_1 := b \cdot \left(b \cdot b\right)\\
t_2 := \left(b \cdot b\right) \cdot t\_1\\
\mathbf{if}\;\frac{\sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c} - b}{a \cdot 2} \leq -16:\\
\;\;\;\;\frac{\frac{0.5}{a} \cdot \left(t\_0 - b \cdot b\right)}{b + \sqrt{t\_0}}\\

\mathbf{else}:\\
\;\;\;\;a \cdot \left(a \cdot \left(\frac{c \cdot \left(c \cdot \left(c \cdot -2\right)\right)}{t\_2} + \frac{\left(a \cdot -0.25\right) \cdot \left(\left(c \cdot \left(c \cdot \left(c \cdot c\right)\right)\right) \cdot 20\right)}{b \cdot \left(b \cdot t\_2\right)}\right) - c \cdot \frac{c}{t\_1}\right) - \frac{c}{b}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (/.f64 (+.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 #s(literal 4 binary64) a) c)))) (*.f64 #s(literal 2 binary64) a)) < -16

    1. Initial program 86.6%

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{neg.f64}\left(b\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(c, \left(\frac{{b}^{2}}{c} - 4 \cdot a\right)\right)\right)\right), \mathsf{*.f64}\left(2, a\right)\right) \]
      2. cancel-sign-sub-invN/A

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{neg.f64}\left(b\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(c, \mathsf{+.f64}\left(\left(\frac{{b}^{2}}{c}\right), \left(-4 \cdot a\right)\right)\right)\right)\right), \mathsf{*.f64}\left(2, a\right)\right) \]
      5. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{neg.f64}\left(b\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(c, \mathsf{+.f64}\left(\mathsf{/.f64}\left(\left({b}^{2}\right), c\right), \left(-4 \cdot a\right)\right)\right)\right)\right), \mathsf{*.f64}\left(2, a\right)\right) \]
      6. unpow2N/A

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{neg.f64}\left(b\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(c, \mathsf{+.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(b, b\right), c\right), \left(a \cdot -4\right)\right)\right)\right)\right), \mathsf{*.f64}\left(2, a\right)\right) \]
      9. *-lowering-*.f6486.2%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{neg.f64}\left(b\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(c, \mathsf{+.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(b, b\right), c\right), \mathsf{*.f64}\left(a, -4\right)\right)\right)\right)\right), \mathsf{*.f64}\left(2, a\right)\right) \]
    5. Simplified86.2%

      \[\leadsto \frac{\left(-b\right) + \sqrt{\color{blue}{c \cdot \left(\frac{b \cdot b}{c} + a \cdot -4\right)}}}{2 \cdot a} \]
    6. Step-by-step derivation
      1. div-invN/A

        \[\leadsto \left(\left(\mathsf{neg}\left(b\right)\right) + \sqrt{c \cdot \left(\frac{b \cdot b}{c} + a \cdot -4\right)}\right) \cdot \color{blue}{\frac{1}{2 \cdot a}} \]
      2. flip-+N/A

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

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

        \[\leadsto \mathsf{/.f64}\left(\left(\left(\left(\mathsf{neg}\left(b\right)\right) \cdot \left(\mathsf{neg}\left(b\right)\right) - \sqrt{c \cdot \left(\frac{b \cdot b}{c} + a \cdot -4\right)} \cdot \sqrt{c \cdot \left(\frac{b \cdot b}{c} + a \cdot -4\right)}\right) \cdot \frac{1}{2 \cdot a}\right), \color{blue}{\left(\left(\mathsf{neg}\left(b\right)\right) - \sqrt{c \cdot \left(\frac{b \cdot b}{c} + a \cdot -4\right)}\right)}\right) \]
    7. Applied egg-rr87.3%

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

    if -16 < (/.f64 (+.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 #s(literal 4 binary64) a) c)))) (*.f64 #s(literal 2 binary64) a))

    1. Initial program 54.2%

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

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

      \[\leadsto \color{blue}{a \cdot \left(a \cdot \left(\frac{\left(c \cdot \left(c \cdot c\right)\right) \cdot -2}{{b}^{5}} + \frac{\left(-0.25 \cdot a\right) \cdot \frac{{c}^{4} \cdot 20}{{b}^{6}}}{b}\right) - \frac{c \cdot \frac{\frac{c}{b}}{b}}{b}\right) - \frac{c}{b}} \]
    5. Applied egg-rr93.0%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{\sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c} - b}{a \cdot 2} \leq -16:\\ \;\;\;\;\frac{\frac{0.5}{a} \cdot \left(c \cdot \left(\frac{b}{\frac{c}{b}} + a \cdot -4\right) - b \cdot b\right)}{b + \sqrt{c \cdot \left(\frac{b}{\frac{c}{b}} + a \cdot -4\right)}}\\ \mathbf{else}:\\ \;\;\;\;a \cdot \left(a \cdot \left(\frac{c \cdot \left(c \cdot \left(c \cdot -2\right)\right)}{\left(b \cdot b\right) \cdot \left(b \cdot \left(b \cdot b\right)\right)} + \frac{\left(a \cdot -0.25\right) \cdot \left(\left(c \cdot \left(c \cdot \left(c \cdot c\right)\right)\right) \cdot 20\right)}{b \cdot \left(b \cdot \left(\left(b \cdot b\right) \cdot \left(b \cdot \left(b \cdot b\right)\right)\right)\right)}\right) - c \cdot \frac{c}{b \cdot \left(b \cdot b\right)}\right) - \frac{c}{b}\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 92.2% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := b \cdot \left(b \cdot b\right)\\ t_1 := \left(b \cdot b\right) \cdot t\_0\\ \mathbf{if}\;\frac{\sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c} - b}{a \cdot 2} \leq -16:\\ \;\;\;\;\frac{-0.5}{a} \cdot \left(b - \sqrt{b \cdot b + c \cdot \left(a \cdot -4\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;a \cdot \left(a \cdot \left(\frac{c \cdot \left(c \cdot \left(c \cdot -2\right)\right)}{t\_1} + \frac{\left(a \cdot -0.25\right) \cdot \left(\left(c \cdot \left(c \cdot \left(c \cdot c\right)\right)\right) \cdot 20\right)}{b \cdot \left(b \cdot t\_1\right)}\right) - c \cdot \frac{c}{t\_0}\right) - \frac{c}{b}\\ \end{array} \end{array} \]
(FPCore (a b c)
 :precision binary64
 (let* ((t_0 (* b (* b b))) (t_1 (* (* b b) t_0)))
   (if (<= (/ (- (sqrt (- (* b b) (* (* 4.0 a) c))) b) (* a 2.0)) -16.0)
     (* (/ -0.5 a) (- b (sqrt (+ (* b b) (* c (* a -4.0))))))
     (-
      (*
       a
       (-
        (*
         a
         (+
          (/ (* c (* c (* c -2.0))) t_1)
          (/ (* (* a -0.25) (* (* c (* c (* c c))) 20.0)) (* b (* b t_1)))))
        (* c (/ c t_0))))
      (/ c b)))))
double code(double a, double b, double c) {
	double t_0 = b * (b * b);
	double t_1 = (b * b) * t_0;
	double tmp;
	if (((sqrt(((b * b) - ((4.0 * a) * c))) - b) / (a * 2.0)) <= -16.0) {
		tmp = (-0.5 / a) * (b - sqrt(((b * b) + (c * (a * -4.0)))));
	} else {
		tmp = (a * ((a * (((c * (c * (c * -2.0))) / t_1) + (((a * -0.25) * ((c * (c * (c * c))) * 20.0)) / (b * (b * t_1))))) - (c * (c / t_0)))) - (c / b);
	}
	return tmp;
}
real(8) function code(a, b, c)
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: tmp
    t_0 = b * (b * b)
    t_1 = (b * b) * t_0
    if (((sqrt(((b * b) - ((4.0d0 * a) * c))) - b) / (a * 2.0d0)) <= (-16.0d0)) then
        tmp = ((-0.5d0) / a) * (b - sqrt(((b * b) + (c * (a * (-4.0d0))))))
    else
        tmp = (a * ((a * (((c * (c * (c * (-2.0d0)))) / t_1) + (((a * (-0.25d0)) * ((c * (c * (c * c))) * 20.0d0)) / (b * (b * t_1))))) - (c * (c / t_0)))) - (c / b)
    end if
    code = tmp
end function
public static double code(double a, double b, double c) {
	double t_0 = b * (b * b);
	double t_1 = (b * b) * t_0;
	double tmp;
	if (((Math.sqrt(((b * b) - ((4.0 * a) * c))) - b) / (a * 2.0)) <= -16.0) {
		tmp = (-0.5 / a) * (b - Math.sqrt(((b * b) + (c * (a * -4.0)))));
	} else {
		tmp = (a * ((a * (((c * (c * (c * -2.0))) / t_1) + (((a * -0.25) * ((c * (c * (c * c))) * 20.0)) / (b * (b * t_1))))) - (c * (c / t_0)))) - (c / b);
	}
	return tmp;
}
def code(a, b, c):
	t_0 = b * (b * b)
	t_1 = (b * b) * t_0
	tmp = 0
	if ((math.sqrt(((b * b) - ((4.0 * a) * c))) - b) / (a * 2.0)) <= -16.0:
		tmp = (-0.5 / a) * (b - math.sqrt(((b * b) + (c * (a * -4.0)))))
	else:
		tmp = (a * ((a * (((c * (c * (c * -2.0))) / t_1) + (((a * -0.25) * ((c * (c * (c * c))) * 20.0)) / (b * (b * t_1))))) - (c * (c / t_0)))) - (c / b)
	return tmp
function code(a, b, c)
	t_0 = Float64(b * Float64(b * b))
	t_1 = Float64(Float64(b * b) * t_0)
	tmp = 0.0
	if (Float64(Float64(sqrt(Float64(Float64(b * b) - Float64(Float64(4.0 * a) * c))) - b) / Float64(a * 2.0)) <= -16.0)
		tmp = Float64(Float64(-0.5 / a) * Float64(b - sqrt(Float64(Float64(b * b) + Float64(c * Float64(a * -4.0))))));
	else
		tmp = Float64(Float64(a * Float64(Float64(a * Float64(Float64(Float64(c * Float64(c * Float64(c * -2.0))) / t_1) + Float64(Float64(Float64(a * -0.25) * Float64(Float64(c * Float64(c * Float64(c * c))) * 20.0)) / Float64(b * Float64(b * t_1))))) - Float64(c * Float64(c / t_0)))) - Float64(c / b));
	end
	return tmp
end
function tmp_2 = code(a, b, c)
	t_0 = b * (b * b);
	t_1 = (b * b) * t_0;
	tmp = 0.0;
	if (((sqrt(((b * b) - ((4.0 * a) * c))) - b) / (a * 2.0)) <= -16.0)
		tmp = (-0.5 / a) * (b - sqrt(((b * b) + (c * (a * -4.0)))));
	else
		tmp = (a * ((a * (((c * (c * (c * -2.0))) / t_1) + (((a * -0.25) * ((c * (c * (c * c))) * 20.0)) / (b * (b * t_1))))) - (c * (c / t_0)))) - (c / b);
	end
	tmp_2 = tmp;
end
code[a_, b_, c_] := Block[{t$95$0 = N[(b * N[(b * b), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(b * b), $MachinePrecision] * t$95$0), $MachinePrecision]}, If[LessEqual[N[(N[(N[Sqrt[N[(N[(b * b), $MachinePrecision] - N[(N[(4.0 * a), $MachinePrecision] * c), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision] / N[(a * 2.0), $MachinePrecision]), $MachinePrecision], -16.0], N[(N[(-0.5 / a), $MachinePrecision] * N[(b - N[Sqrt[N[(N[(b * b), $MachinePrecision] + N[(c * N[(a * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(a * N[(N[(a * N[(N[(N[(c * N[(c * N[(c * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision] + N[(N[(N[(a * -0.25), $MachinePrecision] * N[(N[(c * N[(c * N[(c * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * 20.0), $MachinePrecision]), $MachinePrecision] / N[(b * N[(b * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(c * N[(c / t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(c / b), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := b \cdot \left(b \cdot b\right)\\
t_1 := \left(b \cdot b\right) \cdot t\_0\\
\mathbf{if}\;\frac{\sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c} - b}{a \cdot 2} \leq -16:\\
\;\;\;\;\frac{-0.5}{a} \cdot \left(b - \sqrt{b \cdot b + c \cdot \left(a \cdot -4\right)}\right)\\

\mathbf{else}:\\
\;\;\;\;a \cdot \left(a \cdot \left(\frac{c \cdot \left(c \cdot \left(c \cdot -2\right)\right)}{t\_1} + \frac{\left(a \cdot -0.25\right) \cdot \left(\left(c \cdot \left(c \cdot \left(c \cdot c\right)\right)\right) \cdot 20\right)}{b \cdot \left(b \cdot t\_1\right)}\right) - c \cdot \frac{c}{t\_0}\right) - \frac{c}{b}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (/.f64 (+.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 #s(literal 4 binary64) a) c)))) (*.f64 #s(literal 2 binary64) a)) < -16

    1. Initial program 86.6%

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

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

    if -16 < (/.f64 (+.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 #s(literal 4 binary64) a) c)))) (*.f64 #s(literal 2 binary64) a))

    1. Initial program 54.2%

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

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

      \[\leadsto \color{blue}{a \cdot \left(a \cdot \left(\frac{\left(c \cdot \left(c \cdot c\right)\right) \cdot -2}{{b}^{5}} + \frac{\left(-0.25 \cdot a\right) \cdot \frac{{c}^{4} \cdot 20}{{b}^{6}}}{b}\right) - \frac{c \cdot \frac{\frac{c}{b}}{b}}{b}\right) - \frac{c}{b}} \]
    5. Applied egg-rr93.0%

      \[\leadsto \color{blue}{\left(a \cdot \left(\frac{\left(-0.25 \cdot a\right) \cdot \left(\left(c \cdot \left(c \cdot \left(c \cdot c\right)\right)\right) \cdot 20\right)}{b \cdot \left(b \cdot \left(\left(b \cdot b\right) \cdot \left(b \cdot \left(b \cdot b\right)\right)\right)\right)} + \frac{c \cdot \left(c \cdot \left(c \cdot -2\right)\right)}{\left(b \cdot b\right) \cdot \left(b \cdot \left(b \cdot b\right)\right)}\right) - c \cdot \frac{c}{b \cdot \left(b \cdot b\right)}\right) \cdot a} - \frac{c}{b} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification92.4%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{\sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c} - b}{a \cdot 2} \leq -16:\\ \;\;\;\;\frac{-0.5}{a} \cdot \left(b - \sqrt{b \cdot b + c \cdot \left(a \cdot -4\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;a \cdot \left(a \cdot \left(\frac{c \cdot \left(c \cdot \left(c \cdot -2\right)\right)}{\left(b \cdot b\right) \cdot \left(b \cdot \left(b \cdot b\right)\right)} + \frac{\left(a \cdot -0.25\right) \cdot \left(\left(c \cdot \left(c \cdot \left(c \cdot c\right)\right)\right) \cdot 20\right)}{b \cdot \left(b \cdot \left(\left(b \cdot b\right) \cdot \left(b \cdot \left(b \cdot b\right)\right)\right)\right)}\right) - c \cdot \frac{c}{b \cdot \left(b \cdot b\right)}\right) - \frac{c}{b}\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 91.1% accurate, 1.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := b \cdot \left(b \cdot b\right)\\ t_1 := \left(b \cdot b\right) \cdot t\_0\\ a \cdot \left(a \cdot \left(\frac{c \cdot \left(c \cdot \left(c \cdot -2\right)\right)}{t\_1} + \frac{\left(a \cdot -0.25\right) \cdot \left(\left(c \cdot \left(c \cdot \left(c \cdot c\right)\right)\right) \cdot 20\right)}{b \cdot \left(b \cdot t\_1\right)}\right) - c \cdot \frac{c}{t\_0}\right) - \frac{c}{b} \end{array} \end{array} \]
(FPCore (a b c)
 :precision binary64
 (let* ((t_0 (* b (* b b))) (t_1 (* (* b b) t_0)))
   (-
    (*
     a
     (-
      (*
       a
       (+
        (/ (* c (* c (* c -2.0))) t_1)
        (/ (* (* a -0.25) (* (* c (* c (* c c))) 20.0)) (* b (* b t_1)))))
      (* c (/ c t_0))))
    (/ c b))))
double code(double a, double b, double c) {
	double t_0 = b * (b * b);
	double t_1 = (b * b) * t_0;
	return (a * ((a * (((c * (c * (c * -2.0))) / t_1) + (((a * -0.25) * ((c * (c * (c * c))) * 20.0)) / (b * (b * t_1))))) - (c * (c / t_0)))) - (c / b);
}
real(8) function code(a, b, c)
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8) :: t_0
    real(8) :: t_1
    t_0 = b * (b * b)
    t_1 = (b * b) * t_0
    code = (a * ((a * (((c * (c * (c * (-2.0d0)))) / t_1) + (((a * (-0.25d0)) * ((c * (c * (c * c))) * 20.0d0)) / (b * (b * t_1))))) - (c * (c / t_0)))) - (c / b)
end function
public static double code(double a, double b, double c) {
	double t_0 = b * (b * b);
	double t_1 = (b * b) * t_0;
	return (a * ((a * (((c * (c * (c * -2.0))) / t_1) + (((a * -0.25) * ((c * (c * (c * c))) * 20.0)) / (b * (b * t_1))))) - (c * (c / t_0)))) - (c / b);
}
def code(a, b, c):
	t_0 = b * (b * b)
	t_1 = (b * b) * t_0
	return (a * ((a * (((c * (c * (c * -2.0))) / t_1) + (((a * -0.25) * ((c * (c * (c * c))) * 20.0)) / (b * (b * t_1))))) - (c * (c / t_0)))) - (c / b)
function code(a, b, c)
	t_0 = Float64(b * Float64(b * b))
	t_1 = Float64(Float64(b * b) * t_0)
	return Float64(Float64(a * Float64(Float64(a * Float64(Float64(Float64(c * Float64(c * Float64(c * -2.0))) / t_1) + Float64(Float64(Float64(a * -0.25) * Float64(Float64(c * Float64(c * Float64(c * c))) * 20.0)) / Float64(b * Float64(b * t_1))))) - Float64(c * Float64(c / t_0)))) - Float64(c / b))
end
function tmp = code(a, b, c)
	t_0 = b * (b * b);
	t_1 = (b * b) * t_0;
	tmp = (a * ((a * (((c * (c * (c * -2.0))) / t_1) + (((a * -0.25) * ((c * (c * (c * c))) * 20.0)) / (b * (b * t_1))))) - (c * (c / t_0)))) - (c / b);
end
code[a_, b_, c_] := Block[{t$95$0 = N[(b * N[(b * b), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(b * b), $MachinePrecision] * t$95$0), $MachinePrecision]}, N[(N[(a * N[(N[(a * N[(N[(N[(c * N[(c * N[(c * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision] + N[(N[(N[(a * -0.25), $MachinePrecision] * N[(N[(c * N[(c * N[(c * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * 20.0), $MachinePrecision]), $MachinePrecision] / N[(b * N[(b * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(c * N[(c / t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(c / b), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := b \cdot \left(b \cdot b\right)\\
t_1 := \left(b \cdot b\right) \cdot t\_0\\
a \cdot \left(a \cdot \left(\frac{c \cdot \left(c \cdot \left(c \cdot -2\right)\right)}{t\_1} + \frac{\left(a \cdot -0.25\right) \cdot \left(\left(c \cdot \left(c \cdot \left(c \cdot c\right)\right)\right) \cdot 20\right)}{b \cdot \left(b \cdot t\_1\right)}\right) - c \cdot \frac{c}{t\_0}\right) - \frac{c}{b}
\end{array}
\end{array}
Derivation
  1. Initial program 57.2%

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

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

    \[\leadsto \color{blue}{a \cdot \left(a \cdot \left(\frac{\left(c \cdot \left(c \cdot c\right)\right) \cdot -2}{{b}^{5}} + \frac{\left(-0.25 \cdot a\right) \cdot \frac{{c}^{4} \cdot 20}{{b}^{6}}}{b}\right) - \frac{c \cdot \frac{\frac{c}{b}}{b}}{b}\right) - \frac{c}{b}} \]
  5. Applied egg-rr90.7%

    \[\leadsto \color{blue}{\left(a \cdot \left(\frac{\left(-0.25 \cdot a\right) \cdot \left(\left(c \cdot \left(c \cdot \left(c \cdot c\right)\right)\right) \cdot 20\right)}{b \cdot \left(b \cdot \left(\left(b \cdot b\right) \cdot \left(b \cdot \left(b \cdot b\right)\right)\right)\right)} + \frac{c \cdot \left(c \cdot \left(c \cdot -2\right)\right)}{\left(b \cdot b\right) \cdot \left(b \cdot \left(b \cdot b\right)\right)}\right) - c \cdot \frac{c}{b \cdot \left(b \cdot b\right)}\right) \cdot a} - \frac{c}{b} \]
  6. Final simplification90.7%

    \[\leadsto a \cdot \left(a \cdot \left(\frac{c \cdot \left(c \cdot \left(c \cdot -2\right)\right)}{\left(b \cdot b\right) \cdot \left(b \cdot \left(b \cdot b\right)\right)} + \frac{\left(a \cdot -0.25\right) \cdot \left(\left(c \cdot \left(c \cdot \left(c \cdot c\right)\right)\right) \cdot 20\right)}{b \cdot \left(b \cdot \left(\left(b \cdot b\right) \cdot \left(b \cdot \left(b \cdot b\right)\right)\right)\right)}\right) - c \cdot \frac{c}{b \cdot \left(b \cdot b\right)}\right) - \frac{c}{b} \]
  7. Add Preprocessing

Alternative 11: 91.0% accurate, 2.5× speedup?

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

\\
c \cdot \left(c \cdot \frac{\frac{\left(c \cdot c\right) \cdot \left(-5 \cdot \left(a \cdot \left(a \cdot a\right)\right)\right)}{\left(b \cdot b\right) \cdot \left(b \cdot b\right)} + \left(\frac{-2 \cdot \left(c \cdot \left(a \cdot a\right)\right)}{b \cdot b} - a\right)}{b \cdot \left(b \cdot b\right)} + \frac{-1}{b}\right)
\end{array}
Derivation
  1. Initial program 57.2%

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

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

    \[\leadsto \color{blue}{c \cdot \left(c \cdot \left(c \cdot \left(\frac{-2 \cdot \left(a \cdot a\right)}{{b}^{5}} + \frac{\left(-0.25 \cdot c\right) \cdot \frac{{a}^{4} \cdot 20}{{b}^{6}}}{a \cdot b}\right) - \frac{a}{b \cdot \left(b \cdot b\right)}\right) + \frac{-1}{b}\right)} \]
  5. Taylor expanded in b around inf

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

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

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

    \[\leadsto c \cdot \left(c \cdot \frac{\frac{\left(c \cdot c\right) \cdot \left(-5 \cdot \left(a \cdot \left(a \cdot a\right)\right)\right)}{\left(b \cdot b\right) \cdot \left(b \cdot b\right)} + \left(\frac{-2 \cdot \left(c \cdot \left(a \cdot a\right)\right)}{b \cdot b} - a\right)}{b \cdot \left(b \cdot b\right)} + \frac{-1}{b}\right) \]
  9. Add Preprocessing

Alternative 12: 88.0% accurate, 3.5× speedup?

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

\\
\frac{\frac{\left(a \cdot a\right) \cdot \left(-2 \cdot \left(c \cdot \left(c \cdot c\right)\right)\right)}{\left(b \cdot b\right) \cdot \left(b \cdot b\right)} - \left(c + a \cdot \left(c \cdot \frac{\frac{c}{b}}{b}\right)\right)}{b}
\end{array}
Derivation
  1. Initial program 57.2%

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

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

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

    \[\leadsto \color{blue}{\frac{\frac{\left(\left(c \cdot \left(c \cdot c\right)\right) \cdot -2\right) \cdot \left(a \cdot a\right)}{\left(b \cdot b\right) \cdot \left(b \cdot b\right)} - \left(c + a \cdot \left(c \cdot \frac{\frac{c}{b}}{b}\right)\right)}{b}} \]
  6. Final simplification87.6%

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

Alternative 13: 88.0% accurate, 3.7× speedup?

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

\\
\frac{\frac{\left(c \cdot \left(c \cdot c\right)\right) \cdot \left(\left(a \cdot a\right) \cdot -2\right)}{b \cdot b} - a \cdot \left(c \cdot c\right)}{b \cdot \left(b \cdot b\right)} - \frac{c}{b}
\end{array}
Derivation
  1. Initial program 57.2%

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

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

    \[\leadsto \color{blue}{a \cdot \left(a \cdot \left(\frac{\left(c \cdot \left(c \cdot c\right)\right) \cdot -2}{{b}^{5}} + \frac{\left(-0.25 \cdot a\right) \cdot \frac{{c}^{4} \cdot 20}{{b}^{6}}}{b}\right) - \frac{c \cdot \frac{\frac{c}{b}}{b}}{b}\right) - \frac{c}{b}} \]
  5. Taylor expanded in b around inf

    \[\leadsto \mathsf{\_.f64}\left(\color{blue}{\left(\frac{-2 \cdot \frac{{a}^{2} \cdot {c}^{3}}{{b}^{2}} + -1 \cdot \left(a \cdot {c}^{2}\right)}{{b}^{3}}\right)}, \mathsf{/.f64}\left(c, b\right)\right) \]
  6. Step-by-step derivation
    1. /-lowering-/.f64N/A

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

    \[\leadsto \color{blue}{\frac{\frac{\left(-2 \cdot \left(a \cdot a\right)\right) \cdot \left(c \cdot \left(c \cdot c\right)\right)}{b \cdot b} - a \cdot \left(c \cdot c\right)}{b \cdot \left(b \cdot b\right)}} - \frac{c}{b} \]
  8. Final simplification87.6%

    \[\leadsto \frac{\frac{\left(c \cdot \left(c \cdot c\right)\right) \cdot \left(\left(a \cdot a\right) \cdot -2\right)}{b \cdot b} - a \cdot \left(c \cdot c\right)}{b \cdot \left(b \cdot b\right)} - \frac{c}{b} \]
  9. Add Preprocessing

Alternative 14: 87.8% accurate, 4.3× speedup?

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

\\
c \cdot \left(\frac{-1}{b} + c \cdot \frac{\frac{-2 \cdot \left(c \cdot \left(a \cdot a\right)\right)}{b \cdot b} - a}{b \cdot \left(b \cdot b\right)}\right)
\end{array}
Derivation
  1. Initial program 57.2%

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

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

    \[\leadsto \color{blue}{c \cdot \left(c \cdot \left(c \cdot \left(\frac{-2 \cdot \left(a \cdot a\right)}{{b}^{5}} + \frac{\left(-0.25 \cdot c\right) \cdot \frac{{a}^{4} \cdot 20}{{b}^{6}}}{a \cdot b}\right) - \frac{a}{b \cdot \left(b \cdot b\right)}\right) + \frac{-1}{b}\right)} \]
  5. Taylor expanded in b around inf

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

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

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

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

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

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

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

      \[\leadsto \mathsf{*.f64}\left(c, \mathsf{+.f64}\left(\mathsf{*.f64}\left(c, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(-2, \mathsf{*.f64}\left(c, \left({a}^{2}\right)\right)\right), \left({b}^{2}\right)\right), a\right), \left({b}^{3}\right)\right)\right), \mathsf{/.f64}\left(-1, b\right)\right)\right) \]
    8. unpow2N/A

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

      \[\leadsto \mathsf{*.f64}\left(c, \mathsf{+.f64}\left(\mathsf{*.f64}\left(c, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(-2, \mathsf{*.f64}\left(c, \mathsf{*.f64}\left(a, a\right)\right)\right), \left({b}^{2}\right)\right), a\right), \left({b}^{3}\right)\right)\right), \mathsf{/.f64}\left(-1, b\right)\right)\right) \]
    10. unpow2N/A

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

      \[\leadsto \mathsf{*.f64}\left(c, \mathsf{+.f64}\left(\mathsf{*.f64}\left(c, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(-2, \mathsf{*.f64}\left(c, \mathsf{*.f64}\left(a, a\right)\right)\right), \mathsf{*.f64}\left(b, b\right)\right), a\right), \left({b}^{3}\right)\right)\right), \mathsf{/.f64}\left(-1, b\right)\right)\right) \]
    12. cube-multN/A

      \[\leadsto \mathsf{*.f64}\left(c, \mathsf{+.f64}\left(\mathsf{*.f64}\left(c, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(-2, \mathsf{*.f64}\left(c, \mathsf{*.f64}\left(a, a\right)\right)\right), \mathsf{*.f64}\left(b, b\right)\right), a\right), \left(b \cdot \left(b \cdot b\right)\right)\right)\right), \mathsf{/.f64}\left(-1, b\right)\right)\right) \]
    13. unpow2N/A

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

      \[\leadsto \mathsf{*.f64}\left(c, \mathsf{+.f64}\left(\mathsf{*.f64}\left(c, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(-2, \mathsf{*.f64}\left(c, \mathsf{*.f64}\left(a, a\right)\right)\right), \mathsf{*.f64}\left(b, b\right)\right), a\right), \mathsf{*.f64}\left(b, \left({b}^{2}\right)\right)\right)\right), \mathsf{/.f64}\left(-1, b\right)\right)\right) \]
    15. unpow2N/A

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

      \[\leadsto \mathsf{*.f64}\left(c, \mathsf{+.f64}\left(\mathsf{*.f64}\left(c, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(-2, \mathsf{*.f64}\left(c, \mathsf{*.f64}\left(a, a\right)\right)\right), \mathsf{*.f64}\left(b, b\right)\right), a\right), \mathsf{*.f64}\left(b, \mathsf{*.f64}\left(b, b\right)\right)\right)\right), \mathsf{/.f64}\left(-1, b\right)\right)\right) \]
  7. Simplified87.4%

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

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

Alternative 15: 81.7% accurate, 7.7× speedup?

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

\\
\frac{c + a \cdot \left(c \cdot \frac{\frac{c}{b}}{b}\right)}{0 - b}
\end{array}
Derivation
  1. Initial program 57.2%

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

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

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

      \[\leadsto \mathsf{/.f64}\left(\left(-1 \cdot \frac{a \cdot {c}^{2}}{{b}^{2}} + -1 \cdot c\right), b\right) \]
    3. mul-1-negN/A

      \[\leadsto \mathsf{/.f64}\left(\left(-1 \cdot \frac{a \cdot {c}^{2}}{{b}^{2}} + \left(\mathsf{neg}\left(c\right)\right)\right), b\right) \]
    4. unsub-negN/A

      \[\leadsto \mathsf{/.f64}\left(\left(-1 \cdot \frac{a \cdot {c}^{2}}{{b}^{2}} - c\right), b\right) \]
    5. --lowering--.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\left(-1 \cdot \frac{a \cdot {c}^{2}}{{b}^{2}}\right), c\right), b\right) \]
    6. mul-1-negN/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\left(\mathsf{neg}\left(\frac{a \cdot {c}^{2}}{{b}^{2}}\right)\right), c\right), b\right) \]
    7. neg-sub0N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\left(0 - \frac{a \cdot {c}^{2}}{{b}^{2}}\right), c\right), b\right) \]
    8. --lowering--.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{\_.f64}\left(0, \left(\frac{a \cdot {c}^{2}}{{b}^{2}}\right)\right), c\right), b\right) \]
    9. associate-/l*N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{\_.f64}\left(0, \left(a \cdot \frac{{c}^{2}}{{b}^{2}}\right)\right), c\right), b\right) \]
    10. *-lowering-*.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(a, \left(\frac{{c}^{2}}{{b}^{2}}\right)\right)\right), c\right), b\right) \]
    11. unpow2N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(a, \left(\frac{c \cdot c}{{b}^{2}}\right)\right)\right), c\right), b\right) \]
    12. associate-/l*N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(a, \left(c \cdot \frac{c}{{b}^{2}}\right)\right)\right), c\right), b\right) \]
    13. *-lowering-*.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(c, \left(\frac{c}{{b}^{2}}\right)\right)\right)\right), c\right), b\right) \]
    14. unpow2N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(c, \left(\frac{c}{b \cdot b}\right)\right)\right)\right), c\right), b\right) \]
    15. associate-/r*N/A

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

      \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(c, \mathsf{/.f64}\left(\left(\frac{c}{b}\right), b\right)\right)\right)\right), c\right), b\right) \]
    17. /-lowering-/.f6480.8%

      \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(a, \mathsf{*.f64}\left(c, \mathsf{/.f64}\left(\mathsf{/.f64}\left(c, b\right), b\right)\right)\right)\right), c\right), b\right) \]
  5. Simplified80.8%

    \[\leadsto \color{blue}{\frac{\left(0 - a \cdot \left(c \cdot \frac{\frac{c}{b}}{b}\right)\right) - c}{b}} \]
  6. Final simplification80.8%

    \[\leadsto \frac{c + a \cdot \left(c \cdot \frac{\frac{c}{b}}{b}\right)}{0 - b} \]
  7. Add Preprocessing

Alternative 16: 81.6% accurate, 7.7× speedup?

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

\\
c \cdot \left(\frac{-1}{b} - \frac{a \cdot c}{b \cdot \left(b \cdot b\right)}\right)
\end{array}
Derivation
  1. Initial program 57.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \mathsf{*.f64}\left(c, \left(\frac{-1}{b} + \left(\mathsf{neg}\left(\frac{a \cdot c}{{b}^{3}}\right)\right)\right)\right) \]
    15. unsub-negN/A

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

      \[\leadsto \mathsf{*.f64}\left(c, \mathsf{\_.f64}\left(\left(\frac{-1}{b}\right), \color{blue}{\left(\frac{a \cdot c}{{b}^{3}}\right)}\right)\right) \]
  5. Simplified80.6%

    \[\leadsto \color{blue}{c \cdot \left(\frac{-1}{b} - \frac{a \cdot c}{b \cdot \left(b \cdot b\right)}\right)} \]
  6. Add Preprocessing

Alternative 17: 64.5% accurate, 23.2× speedup?

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

\\
\frac{c}{0 - b}
\end{array}
Derivation
  1. Initial program 57.2%

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

    \[\leadsto \color{blue}{-1 \cdot \frac{c}{b}} \]
  4. Step-by-step derivation
    1. mul-1-negN/A

      \[\leadsto \mathsf{neg}\left(\frac{c}{b}\right) \]
    2. neg-sub0N/A

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

      \[\leadsto \mathsf{\_.f64}\left(0, \color{blue}{\left(\frac{c}{b}\right)}\right) \]
    4. /-lowering-/.f6462.9%

      \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(c, \color{blue}{b}\right)\right) \]
  5. Simplified62.9%

    \[\leadsto \color{blue}{0 - \frac{c}{b}} \]
  6. Step-by-step derivation
    1. sub0-negN/A

      \[\leadsto \mathsf{neg}\left(\frac{c}{b}\right) \]
    2. neg-lowering-neg.f64N/A

      \[\leadsto \mathsf{neg.f64}\left(\left(\frac{c}{b}\right)\right) \]
    3. /-lowering-/.f6462.9%

      \[\leadsto \mathsf{neg.f64}\left(\mathsf{/.f64}\left(c, b\right)\right) \]
  7. Applied egg-rr62.9%

    \[\leadsto \color{blue}{-\frac{c}{b}} \]
  8. Final simplification62.9%

    \[\leadsto \frac{c}{0 - b} \]
  9. Add Preprocessing

Alternative 18: 3.2% accurate, 38.7× speedup?

\[\begin{array}{l} \\ \frac{0}{a} \end{array} \]
(FPCore (a b c) :precision binary64 (/ 0.0 a))
double code(double a, double b, double c) {
	return 0.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 = 0.0d0 / a
end function
public static double code(double a, double b, double c) {
	return 0.0 / a;
}
def code(a, b, c):
	return 0.0 / a
function code(a, b, c)
	return Float64(0.0 / a)
end
function tmp = code(a, b, c)
	tmp = 0.0 / a;
end
code[a_, b_, c_] := N[(0.0 / a), $MachinePrecision]
\begin{array}{l}

\\
\frac{0}{a}
\end{array}
Derivation
  1. Initial program 57.2%

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

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

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

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

      \[\leadsto \mathsf{\_.f64}\left(\left(\frac{\sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}\right), \color{blue}{\left(\frac{b}{2 \cdot a}\right)}\right) \]
  4. Applied egg-rr56.5%

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

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

      \[\leadsto \mathsf{/.f64}\left(\left(\sqrt{b \cdot b + c \cdot \left(a \cdot -4\right)} \cdot \left(a \cdot 2\right) - \left(a \cdot 2\right) \cdot b\right), \color{blue}{\left(\left(a \cdot 2\right) \cdot \left(a \cdot 2\right)\right)}\right) \]
  6. Applied egg-rr56.5%

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

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

      \[\leadsto \frac{\frac{1}{4} \cdot \left(-2 \cdot b + 2 \cdot b\right)}{\color{blue}{a}} \]
    2. distribute-rgt-outN/A

      \[\leadsto \frac{\frac{1}{4} \cdot \left(b \cdot \left(-2 + 2\right)\right)}{a} \]
    3. metadata-evalN/A

      \[\leadsto \frac{\frac{1}{4} \cdot \left(b \cdot 0\right)}{a} \]
    4. mul0-rgtN/A

      \[\leadsto \frac{\frac{1}{4} \cdot 0}{a} \]
    5. metadata-evalN/A

      \[\leadsto \frac{0}{a} \]
    6. /-lowering-/.f643.2%

      \[\leadsto \mathsf{/.f64}\left(0, \color{blue}{a}\right) \]
  9. Simplified3.2%

    \[\leadsto \color{blue}{\frac{0}{a}} \]
  10. Add Preprocessing

Reproduce

?
herbie shell --seed 2024191 
(FPCore (a b c)
  :name "Quadratic roots, narrow range"
  :precision binary64
  :pre (and (and (and (< 1.0536712127723509e-8 a) (< a 94906265.62425156)) (and (< 1.0536712127723509e-8 b) (< b 94906265.62425156))) (and (< 1.0536712127723509e-8 c) (< c 94906265.62425156)))
  (/ (+ (- b) (sqrt (- (* b b) (* (* 4.0 a) c)))) (* 2.0 a)))