Quadratic roots, narrow range

Percentage Accurate: 55.2% → 92.0%
Time: 29.6s
Alternatives: 16
Speedup: 29.0×

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 16 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.2% 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.0% accurate, 0.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)\\ \mathbf{if}\;b \leq 0.028:\\ \;\;\;\;\frac{\left({\left(e^{\log t\_0}\right)}^{0.25} + \sqrt{b}\right) \cdot \frac{{t\_0}^{0.75} - {b}^{1.5}}{\left(b + \sqrt{t\_0}\right) + \sqrt{b} \cdot {t\_0}^{0.25}}}{a \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(-2, {a}^{2} \cdot \frac{{c}^{3}}{{b}^{5}}, \mathsf{fma}\left(-1, \mathsf{fma}\left(a, \frac{{c}^{2}}{{b}^{3}}, \frac{c}{b}\right), \frac{-5 \cdot \left({a}^{3} \cdot {c}^{4}\right)}{{b}^{7}}\right)\right)\\ \end{array} \end{array} \]
(FPCore (a b c)
 :precision binary64
 (let* ((t_0 (fma a (* c -4.0) (pow b 2.0))))
   (if (<= b 0.028)
     (/
      (*
       (+ (pow (exp (log t_0)) 0.25) (sqrt b))
       (/
        (- (pow t_0 0.75) (pow b 1.5))
        (+ (+ b (sqrt t_0)) (* (sqrt b) (pow t_0 0.25)))))
      (* a 2.0))
     (fma
      -2.0
      (* (pow a 2.0) (/ (pow c 3.0) (pow b 5.0)))
      (fma
       -1.0
       (fma a (/ (pow c 2.0) (pow b 3.0)) (/ c b))
       (/ (* -5.0 (* (pow a 3.0) (pow c 4.0))) (pow b 7.0)))))))
double code(double a, double b, double c) {
	double t_0 = fma(a, (c * -4.0), pow(b, 2.0));
	double tmp;
	if (b <= 0.028) {
		tmp = ((pow(exp(log(t_0)), 0.25) + sqrt(b)) * ((pow(t_0, 0.75) - pow(b, 1.5)) / ((b + sqrt(t_0)) + (sqrt(b) * pow(t_0, 0.25))))) / (a * 2.0);
	} else {
		tmp = fma(-2.0, (pow(a, 2.0) * (pow(c, 3.0) / pow(b, 5.0))), fma(-1.0, fma(a, (pow(c, 2.0) / pow(b, 3.0)), (c / b)), ((-5.0 * (pow(a, 3.0) * pow(c, 4.0))) / pow(b, 7.0))));
	}
	return tmp;
}
function code(a, b, c)
	t_0 = fma(a, Float64(c * -4.0), (b ^ 2.0))
	tmp = 0.0
	if (b <= 0.028)
		tmp = Float64(Float64(Float64((exp(log(t_0)) ^ 0.25) + sqrt(b)) * Float64(Float64((t_0 ^ 0.75) - (b ^ 1.5)) / Float64(Float64(b + sqrt(t_0)) + Float64(sqrt(b) * (t_0 ^ 0.25))))) / Float64(a * 2.0));
	else
		tmp = fma(-2.0, Float64((a ^ 2.0) * Float64((c ^ 3.0) / (b ^ 5.0))), fma(-1.0, fma(a, Float64((c ^ 2.0) / (b ^ 3.0)), Float64(c / b)), Float64(Float64(-5.0 * Float64((a ^ 3.0) * (c ^ 4.0))) / (b ^ 7.0))));
	end
	return tmp
end
code[a_, b_, c_] := Block[{t$95$0 = N[(a * N[(c * -4.0), $MachinePrecision] + N[Power[b, 2.0], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, 0.028], N[(N[(N[(N[Power[N[Exp[N[Log[t$95$0], $MachinePrecision]], $MachinePrecision], 0.25], $MachinePrecision] + N[Sqrt[b], $MachinePrecision]), $MachinePrecision] * N[(N[(N[Power[t$95$0, 0.75], $MachinePrecision] - N[Power[b, 1.5], $MachinePrecision]), $MachinePrecision] / N[(N[(b + N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[b], $MachinePrecision] * N[Power[t$95$0, 0.25], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(a * 2.0), $MachinePrecision]), $MachinePrecision], N[(-2.0 * N[(N[Power[a, 2.0], $MachinePrecision] * N[(N[Power[c, 3.0], $MachinePrecision] / N[Power[b, 5.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(-1.0 * N[(a * N[(N[Power[c, 2.0], $MachinePrecision] / N[Power[b, 3.0], $MachinePrecision]), $MachinePrecision] + N[(c / b), $MachinePrecision]), $MachinePrecision] + N[(N[(-5.0 * N[(N[Power[a, 3.0], $MachinePrecision] * N[Power[c, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Power[b, 7.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)\\
\mathbf{if}\;b \leq 0.028:\\
\;\;\;\;\frac{\left({\left(e^{\log t\_0}\right)}^{0.25} + \sqrt{b}\right) \cdot \frac{{t\_0}^{0.75} - {b}^{1.5}}{\left(b + \sqrt{t\_0}\right) + \sqrt{b} \cdot {t\_0}^{0.25}}}{a \cdot 2}\\

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-2, {a}^{2} \cdot \frac{{c}^{3}}{{b}^{5}}, \mathsf{fma}\left(-1, \mathsf{fma}\left(a, \frac{{c}^{2}}{{b}^{3}}, \frac{c}{b}\right), \frac{-5 \cdot \left({a}^{3} \cdot {c}^{4}\right)}{{b}^{7}}\right)\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if b < 0.0280000000000000006

    1. Initial program 92.2%

      \[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a} \]
    2. Step-by-step derivation
      1. *-commutative92.2%

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

      \[\leadsto \color{blue}{\frac{\sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)} - b}{a \cdot 2}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. add-sqr-sqrt91.3%

        \[\leadsto \frac{\color{blue}{\sqrt{\sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)}} \cdot \sqrt{\sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)}}} - b}{a \cdot 2} \]
      2. add-sqr-sqrt90.5%

        \[\leadsto \frac{\sqrt{\sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)}} \cdot \sqrt{\sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)}} - \color{blue}{\sqrt{b} \cdot \sqrt{b}}}{a \cdot 2} \]
      3. difference-of-squares91.2%

        \[\leadsto \frac{\color{blue}{\left(\sqrt{\sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)}} + \sqrt{b}\right) \cdot \left(\sqrt{\sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)}} - \sqrt{b}\right)}}{a \cdot 2} \]
      4. pow1/291.2%

        \[\leadsto \frac{\left(\sqrt{\color{blue}{{\left(\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)\right)}^{0.5}}} + \sqrt{b}\right) \cdot \left(\sqrt{\sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)}} - \sqrt{b}\right)}{a \cdot 2} \]
      5. sqrt-pow191.2%

        \[\leadsto \frac{\left(\color{blue}{{\left(\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)\right)}^{\left(\frac{0.5}{2}\right)}} + \sqrt{b}\right) \cdot \left(\sqrt{\sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)}} - \sqrt{b}\right)}{a \cdot 2} \]
      6. pow291.2%

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

        \[\leadsto \frac{\left({\left(\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)\right)}^{\color{blue}{0.25}} + \sqrt{b}\right) \cdot \left(\sqrt{\sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)}} - \sqrt{b}\right)}{a \cdot 2} \]
      8. pow1/291.2%

        \[\leadsto \frac{\left({\left(\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)\right)}^{0.25} + \sqrt{b}\right) \cdot \left(\sqrt{\color{blue}{{\left(\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)\right)}^{0.5}}} - \sqrt{b}\right)}{a \cdot 2} \]
      9. sqrt-pow191.1%

        \[\leadsto \frac{\left({\left(\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)\right)}^{0.25} + \sqrt{b}\right) \cdot \left(\color{blue}{{\left(\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)\right)}^{\left(\frac{0.5}{2}\right)}} - \sqrt{b}\right)}{a \cdot 2} \]
      10. pow291.1%

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

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

      \[\leadsto \frac{\color{blue}{\left({\left(\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)\right)}^{0.25} + \sqrt{b}\right) \cdot \left({\left(\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)\right)}^{0.25} - \sqrt{b}\right)}}{a \cdot 2} \]
    7. Step-by-step derivation
      1. add-exp-log91.1%

        \[\leadsto \frac{\left({\color{blue}{\left(e^{\log \left(\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)\right)}\right)}}^{0.25} + \sqrt{b}\right) \cdot \left({\left(\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)\right)}^{0.25} - \sqrt{b}\right)}{a \cdot 2} \]
    8. Applied egg-rr91.1%

      \[\leadsto \frac{\left({\color{blue}{\left(e^{\log \left(\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)\right)}\right)}}^{0.25} + \sqrt{b}\right) \cdot \left({\left(\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)\right)}^{0.25} - \sqrt{b}\right)}{a \cdot 2} \]
    9. Step-by-step derivation
      1. flip3--91.6%

        \[\leadsto \frac{\left({\left(e^{\log \left(\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)\right)}\right)}^{0.25} + \sqrt{b}\right) \cdot \color{blue}{\frac{{\left({\left(\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)\right)}^{0.25}\right)}^{3} - {\left(\sqrt{b}\right)}^{3}}{{\left(\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)\right)}^{0.25} \cdot {\left(\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)\right)}^{0.25} + \left(\sqrt{b} \cdot \sqrt{b} + {\left(\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)\right)}^{0.25} \cdot \sqrt{b}\right)}}}{a \cdot 2} \]
      2. pow-pow91.8%

        \[\leadsto \frac{\left({\left(e^{\log \left(\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)\right)}\right)}^{0.25} + \sqrt{b}\right) \cdot \frac{\color{blue}{{\left(\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)\right)}^{\left(0.25 \cdot 3\right)}} - {\left(\sqrt{b}\right)}^{3}}{{\left(\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)\right)}^{0.25} \cdot {\left(\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)\right)}^{0.25} + \left(\sqrt{b} \cdot \sqrt{b} + {\left(\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)\right)}^{0.25} \cdot \sqrt{b}\right)}}{a \cdot 2} \]
      3. metadata-eval91.8%

        \[\leadsto \frac{\left({\left(e^{\log \left(\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)\right)}\right)}^{0.25} + \sqrt{b}\right) \cdot \frac{{\left(\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)\right)}^{\color{blue}{0.75}} - {\left(\sqrt{b}\right)}^{3}}{{\left(\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)\right)}^{0.25} \cdot {\left(\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)\right)}^{0.25} + \left(\sqrt{b} \cdot \sqrt{b} + {\left(\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)\right)}^{0.25} \cdot \sqrt{b}\right)}}{a \cdot 2} \]
      4. pow1/291.8%

        \[\leadsto \frac{\left({\left(e^{\log \left(\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)\right)}\right)}^{0.25} + \sqrt{b}\right) \cdot \frac{{\left(\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)\right)}^{0.75} - {\color{blue}{\left({b}^{0.5}\right)}}^{3}}{{\left(\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)\right)}^{0.25} \cdot {\left(\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)\right)}^{0.25} + \left(\sqrt{b} \cdot \sqrt{b} + {\left(\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)\right)}^{0.25} \cdot \sqrt{b}\right)}}{a \cdot 2} \]
      5. pow-pow94.2%

        \[\leadsto \frac{\left({\left(e^{\log \left(\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)\right)}\right)}^{0.25} + \sqrt{b}\right) \cdot \frac{{\left(\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)\right)}^{0.75} - \color{blue}{{b}^{\left(0.5 \cdot 3\right)}}}{{\left(\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)\right)}^{0.25} \cdot {\left(\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)\right)}^{0.25} + \left(\sqrt{b} \cdot \sqrt{b} + {\left(\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)\right)}^{0.25} \cdot \sqrt{b}\right)}}{a \cdot 2} \]
      6. metadata-eval94.2%

        \[\leadsto \frac{\left({\left(e^{\log \left(\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)\right)}\right)}^{0.25} + \sqrt{b}\right) \cdot \frac{{\left(\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)\right)}^{0.75} - {b}^{\color{blue}{1.5}}}{{\left(\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)\right)}^{0.25} \cdot {\left(\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)\right)}^{0.25} + \left(\sqrt{b} \cdot \sqrt{b} + {\left(\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)\right)}^{0.25} \cdot \sqrt{b}\right)}}{a \cdot 2} \]
      7. pow-prod-up94.2%

        \[\leadsto \frac{\left({\left(e^{\log \left(\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)\right)}\right)}^{0.25} + \sqrt{b}\right) \cdot \frac{{\left(\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)\right)}^{0.75} - {b}^{1.5}}{\color{blue}{{\left(\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)\right)}^{\left(0.25 + 0.25\right)}} + \left(\sqrt{b} \cdot \sqrt{b} + {\left(\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)\right)}^{0.25} \cdot \sqrt{b}\right)}}{a \cdot 2} \]
      8. metadata-eval94.2%

        \[\leadsto \frac{\left({\left(e^{\log \left(\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)\right)}\right)}^{0.25} + \sqrt{b}\right) \cdot \frac{{\left(\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)\right)}^{0.75} - {b}^{1.5}}{{\left(\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)\right)}^{\color{blue}{0.5}} + \left(\sqrt{b} \cdot \sqrt{b} + {\left(\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)\right)}^{0.25} \cdot \sqrt{b}\right)}}{a \cdot 2} \]
      9. pow1/294.2%

        \[\leadsto \frac{\left({\left(e^{\log \left(\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)\right)}\right)}^{0.25} + \sqrt{b}\right) \cdot \frac{{\left(\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)\right)}^{0.75} - {b}^{1.5}}{\color{blue}{\sqrt{\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)}} + \left(\sqrt{b} \cdot \sqrt{b} + {\left(\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)\right)}^{0.25} \cdot \sqrt{b}\right)}}{a \cdot 2} \]
      10. add-sqr-sqrt94.1%

        \[\leadsto \frac{\left({\left(e^{\log \left(\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)\right)}\right)}^{0.25} + \sqrt{b}\right) \cdot \frac{{\left(\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)\right)}^{0.75} - {b}^{1.5}}{\sqrt{\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)} + \left(\color{blue}{b} + {\left(\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)\right)}^{0.25} \cdot \sqrt{b}\right)}}{a \cdot 2} \]
    10. Applied egg-rr94.1%

      \[\leadsto \frac{\left({\left(e^{\log \left(\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)\right)}\right)}^{0.25} + \sqrt{b}\right) \cdot \color{blue}{\frac{{\left(\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)\right)}^{0.75} - {b}^{1.5}}{\sqrt{\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)} + \left(b + {\left(\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)\right)}^{0.25} \cdot \sqrt{b}\right)}}}{a \cdot 2} \]
    11. Step-by-step derivation
      1. associate-+r+94.1%

        \[\leadsto \frac{\left({\left(e^{\log \left(\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)\right)}\right)}^{0.25} + \sqrt{b}\right) \cdot \frac{{\left(\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)\right)}^{0.75} - {b}^{1.5}}{\color{blue}{\left(\sqrt{\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)} + b\right) + {\left(\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)\right)}^{0.25} \cdot \sqrt{b}}}}{a \cdot 2} \]
      2. +-commutative94.1%

        \[\leadsto \frac{\left({\left(e^{\log \left(\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)\right)}\right)}^{0.25} + \sqrt{b}\right) \cdot \frac{{\left(\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)\right)}^{0.75} - {b}^{1.5}}{\color{blue}{\left(b + \sqrt{\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)}\right)} + {\left(\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)\right)}^{0.25} \cdot \sqrt{b}}}{a \cdot 2} \]
      3. *-commutative94.1%

        \[\leadsto \frac{\left({\left(e^{\log \left(\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)\right)}\right)}^{0.25} + \sqrt{b}\right) \cdot \frac{{\left(\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)\right)}^{0.75} - {b}^{1.5}}{\left(b + \sqrt{\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)}\right) + \color{blue}{\sqrt{b} \cdot {\left(\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)\right)}^{0.25}}}}{a \cdot 2} \]
    12. Simplified94.1%

      \[\leadsto \frac{\left({\left(e^{\log \left(\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)\right)}\right)}^{0.25} + \sqrt{b}\right) \cdot \color{blue}{\frac{{\left(\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)\right)}^{0.75} - {b}^{1.5}}{\left(b + \sqrt{\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)}\right) + \sqrt{b} \cdot {\left(\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)\right)}^{0.25}}}}{a \cdot 2} \]

    if 0.0280000000000000006 < b

    1. Initial program 51.4%

      \[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a} \]
    2. Step-by-step derivation
      1. *-commutative51.4%

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(-2, {a}^{2} \cdot \frac{{c}^{3}}{{b}^{5}}, \mathsf{fma}\left(-1, \mathsf{fma}\left(a, \frac{{c}^{2}}{{b}^{3}}, \frac{c}{b}\right), {a}^{3} \cdot \left(\frac{\mathsf{fma}\left(16, \frac{{c}^{4}}{{b}^{6}}, 4 \cdot \frac{{c}^{4}}{{b}^{6}}\right)}{b} \cdot -0.25\right)\right)\right)} \]
    7. Taylor expanded in c around 0 92.9%

      \[\leadsto \mathsf{fma}\left(-2, {a}^{2} \cdot \frac{{c}^{3}}{{b}^{5}}, \mathsf{fma}\left(-1, \mathsf{fma}\left(a, \frac{{c}^{2}}{{b}^{3}}, \frac{c}{b}\right), \color{blue}{-5 \cdot \frac{{a}^{3} \cdot {c}^{4}}{{b}^{7}}}\right)\right) \]
    8. Step-by-step derivation
      1. associate-*r/92.9%

        \[\leadsto \mathsf{fma}\left(-2, {a}^{2} \cdot \frac{{c}^{3}}{{b}^{5}}, \mathsf{fma}\left(-1, \mathsf{fma}\left(a, \frac{{c}^{2}}{{b}^{3}}, \frac{c}{b}\right), \color{blue}{\frac{-5 \cdot \left({a}^{3} \cdot {c}^{4}\right)}{{b}^{7}}}\right)\right) \]
    9. Simplified92.9%

      \[\leadsto \mathsf{fma}\left(-2, {a}^{2} \cdot \frac{{c}^{3}}{{b}^{5}}, \mathsf{fma}\left(-1, \mathsf{fma}\left(a, \frac{{c}^{2}}{{b}^{3}}, \frac{c}{b}\right), \color{blue}{\frac{-5 \cdot \left({a}^{3} \cdot {c}^{4}\right)}{{b}^{7}}}\right)\right) \]
  3. Recombined 2 regimes into one program.
  4. Final simplification93.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq 0.028:\\ \;\;\;\;\frac{\left({\left(e^{\log \left(\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)\right)}\right)}^{0.25} + \sqrt{b}\right) \cdot \frac{{\left(\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)\right)}^{0.75} - {b}^{1.5}}{\left(b + \sqrt{\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)}\right) + \sqrt{b} \cdot {\left(\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)\right)}^{0.25}}}{a \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(-2, {a}^{2} \cdot \frac{{c}^{3}}{{b}^{5}}, \mathsf{fma}\left(-1, \mathsf{fma}\left(a, \frac{{c}^{2}}{{b}^{3}}, \frac{c}{b}\right), \frac{-5 \cdot \left({a}^{3} \cdot {c}^{4}\right)}{{b}^{7}}\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 2: 92.0% accurate, 0.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)\\ t_1 := {t\_0}^{0.25}\\ \mathbf{if}\;b \leq 0.028:\\ \;\;\;\;\frac{\frac{{t\_0}^{0.75} - {b}^{1.5}}{\left(b + \sqrt{t\_0}\right) + \sqrt{b} \cdot t\_1} \cdot \left(\sqrt{b} + t\_1\right)}{a \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(-2, {a}^{2} \cdot \frac{{c}^{3}}{{b}^{5}}, \mathsf{fma}\left(-1, \mathsf{fma}\left(a, \frac{{c}^{2}}{{b}^{3}}, \frac{c}{b}\right), \frac{-5 \cdot \left({a}^{3} \cdot {c}^{4}\right)}{{b}^{7}}\right)\right)\\ \end{array} \end{array} \]
(FPCore (a b c)
 :precision binary64
 (let* ((t_0 (fma a (* c -4.0) (pow b 2.0))) (t_1 (pow t_0 0.25)))
   (if (<= b 0.028)
     (/
      (*
       (/ (- (pow t_0 0.75) (pow b 1.5)) (+ (+ b (sqrt t_0)) (* (sqrt b) t_1)))
       (+ (sqrt b) t_1))
      (* a 2.0))
     (fma
      -2.0
      (* (pow a 2.0) (/ (pow c 3.0) (pow b 5.0)))
      (fma
       -1.0
       (fma a (/ (pow c 2.0) (pow b 3.0)) (/ c b))
       (/ (* -5.0 (* (pow a 3.0) (pow c 4.0))) (pow b 7.0)))))))
double code(double a, double b, double c) {
	double t_0 = fma(a, (c * -4.0), pow(b, 2.0));
	double t_1 = pow(t_0, 0.25);
	double tmp;
	if (b <= 0.028) {
		tmp = (((pow(t_0, 0.75) - pow(b, 1.5)) / ((b + sqrt(t_0)) + (sqrt(b) * t_1))) * (sqrt(b) + t_1)) / (a * 2.0);
	} else {
		tmp = fma(-2.0, (pow(a, 2.0) * (pow(c, 3.0) / pow(b, 5.0))), fma(-1.0, fma(a, (pow(c, 2.0) / pow(b, 3.0)), (c / b)), ((-5.0 * (pow(a, 3.0) * pow(c, 4.0))) / pow(b, 7.0))));
	}
	return tmp;
}
function code(a, b, c)
	t_0 = fma(a, Float64(c * -4.0), (b ^ 2.0))
	t_1 = t_0 ^ 0.25
	tmp = 0.0
	if (b <= 0.028)
		tmp = Float64(Float64(Float64(Float64((t_0 ^ 0.75) - (b ^ 1.5)) / Float64(Float64(b + sqrt(t_0)) + Float64(sqrt(b) * t_1))) * Float64(sqrt(b) + t_1)) / Float64(a * 2.0));
	else
		tmp = fma(-2.0, Float64((a ^ 2.0) * Float64((c ^ 3.0) / (b ^ 5.0))), fma(-1.0, fma(a, Float64((c ^ 2.0) / (b ^ 3.0)), Float64(c / b)), Float64(Float64(-5.0 * Float64((a ^ 3.0) * (c ^ 4.0))) / (b ^ 7.0))));
	end
	return tmp
end
code[a_, b_, c_] := Block[{t$95$0 = N[(a * N[(c * -4.0), $MachinePrecision] + N[Power[b, 2.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Power[t$95$0, 0.25], $MachinePrecision]}, If[LessEqual[b, 0.028], N[(N[(N[(N[(N[Power[t$95$0, 0.75], $MachinePrecision] - N[Power[b, 1.5], $MachinePrecision]), $MachinePrecision] / N[(N[(b + N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[b], $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[Sqrt[b], $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision] / N[(a * 2.0), $MachinePrecision]), $MachinePrecision], N[(-2.0 * N[(N[Power[a, 2.0], $MachinePrecision] * N[(N[Power[c, 3.0], $MachinePrecision] / N[Power[b, 5.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(-1.0 * N[(a * N[(N[Power[c, 2.0], $MachinePrecision] / N[Power[b, 3.0], $MachinePrecision]), $MachinePrecision] + N[(c / b), $MachinePrecision]), $MachinePrecision] + N[(N[(-5.0 * N[(N[Power[a, 3.0], $MachinePrecision] * N[Power[c, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Power[b, 7.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)\\
t_1 := {t\_0}^{0.25}\\
\mathbf{if}\;b \leq 0.028:\\
\;\;\;\;\frac{\frac{{t\_0}^{0.75} - {b}^{1.5}}{\left(b + \sqrt{t\_0}\right) + \sqrt{b} \cdot t\_1} \cdot \left(\sqrt{b} + t\_1\right)}{a \cdot 2}\\

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-2, {a}^{2} \cdot \frac{{c}^{3}}{{b}^{5}}, \mathsf{fma}\left(-1, \mathsf{fma}\left(a, \frac{{c}^{2}}{{b}^{3}}, \frac{c}{b}\right), \frac{-5 \cdot \left({a}^{3} \cdot {c}^{4}\right)}{{b}^{7}}\right)\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if b < 0.0280000000000000006

    1. Initial program 92.2%

      \[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a} \]
    2. Step-by-step derivation
      1. *-commutative92.2%

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

      \[\leadsto \color{blue}{\frac{\sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)} - b}{a \cdot 2}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. add-sqr-sqrt91.3%

        \[\leadsto \frac{\color{blue}{\sqrt{\sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)}} \cdot \sqrt{\sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)}}} - b}{a \cdot 2} \]
      2. add-sqr-sqrt90.5%

        \[\leadsto \frac{\sqrt{\sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)}} \cdot \sqrt{\sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)}} - \color{blue}{\sqrt{b} \cdot \sqrt{b}}}{a \cdot 2} \]
      3. difference-of-squares91.2%

        \[\leadsto \frac{\color{blue}{\left(\sqrt{\sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)}} + \sqrt{b}\right) \cdot \left(\sqrt{\sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)}} - \sqrt{b}\right)}}{a \cdot 2} \]
      4. pow1/291.2%

        \[\leadsto \frac{\left(\sqrt{\color{blue}{{\left(\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)\right)}^{0.5}}} + \sqrt{b}\right) \cdot \left(\sqrt{\sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)}} - \sqrt{b}\right)}{a \cdot 2} \]
      5. sqrt-pow191.2%

        \[\leadsto \frac{\left(\color{blue}{{\left(\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)\right)}^{\left(\frac{0.5}{2}\right)}} + \sqrt{b}\right) \cdot \left(\sqrt{\sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)}} - \sqrt{b}\right)}{a \cdot 2} \]
      6. pow291.2%

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

        \[\leadsto \frac{\left({\left(\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)\right)}^{\color{blue}{0.25}} + \sqrt{b}\right) \cdot \left(\sqrt{\sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)}} - \sqrt{b}\right)}{a \cdot 2} \]
      8. pow1/291.2%

        \[\leadsto \frac{\left({\left(\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)\right)}^{0.25} + \sqrt{b}\right) \cdot \left(\sqrt{\color{blue}{{\left(\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)\right)}^{0.5}}} - \sqrt{b}\right)}{a \cdot 2} \]
      9. sqrt-pow191.1%

        \[\leadsto \frac{\left({\left(\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)\right)}^{0.25} + \sqrt{b}\right) \cdot \left(\color{blue}{{\left(\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)\right)}^{\left(\frac{0.5}{2}\right)}} - \sqrt{b}\right)}{a \cdot 2} \]
      10. pow291.1%

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

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

      \[\leadsto \frac{\color{blue}{\left({\left(\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)\right)}^{0.25} + \sqrt{b}\right) \cdot \left({\left(\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)\right)}^{0.25} - \sqrt{b}\right)}}{a \cdot 2} \]
    7. Step-by-step derivation
      1. flip3--91.6%

        \[\leadsto \frac{\left({\left(e^{\log \left(\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)\right)}\right)}^{0.25} + \sqrt{b}\right) \cdot \color{blue}{\frac{{\left({\left(\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)\right)}^{0.25}\right)}^{3} - {\left(\sqrt{b}\right)}^{3}}{{\left(\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)\right)}^{0.25} \cdot {\left(\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)\right)}^{0.25} + \left(\sqrt{b} \cdot \sqrt{b} + {\left(\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)\right)}^{0.25} \cdot \sqrt{b}\right)}}}{a \cdot 2} \]
      2. pow-pow91.8%

        \[\leadsto \frac{\left({\left(e^{\log \left(\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)\right)}\right)}^{0.25} + \sqrt{b}\right) \cdot \frac{\color{blue}{{\left(\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)\right)}^{\left(0.25 \cdot 3\right)}} - {\left(\sqrt{b}\right)}^{3}}{{\left(\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)\right)}^{0.25} \cdot {\left(\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)\right)}^{0.25} + \left(\sqrt{b} \cdot \sqrt{b} + {\left(\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)\right)}^{0.25} \cdot \sqrt{b}\right)}}{a \cdot 2} \]
      3. metadata-eval91.8%

        \[\leadsto \frac{\left({\left(e^{\log \left(\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)\right)}\right)}^{0.25} + \sqrt{b}\right) \cdot \frac{{\left(\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)\right)}^{\color{blue}{0.75}} - {\left(\sqrt{b}\right)}^{3}}{{\left(\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)\right)}^{0.25} \cdot {\left(\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)\right)}^{0.25} + \left(\sqrt{b} \cdot \sqrt{b} + {\left(\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)\right)}^{0.25} \cdot \sqrt{b}\right)}}{a \cdot 2} \]
      4. pow1/291.8%

        \[\leadsto \frac{\left({\left(e^{\log \left(\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)\right)}\right)}^{0.25} + \sqrt{b}\right) \cdot \frac{{\left(\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)\right)}^{0.75} - {\color{blue}{\left({b}^{0.5}\right)}}^{3}}{{\left(\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)\right)}^{0.25} \cdot {\left(\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)\right)}^{0.25} + \left(\sqrt{b} \cdot \sqrt{b} + {\left(\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)\right)}^{0.25} \cdot \sqrt{b}\right)}}{a \cdot 2} \]
      5. pow-pow94.2%

        \[\leadsto \frac{\left({\left(e^{\log \left(\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)\right)}\right)}^{0.25} + \sqrt{b}\right) \cdot \frac{{\left(\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)\right)}^{0.75} - \color{blue}{{b}^{\left(0.5 \cdot 3\right)}}}{{\left(\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)\right)}^{0.25} \cdot {\left(\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)\right)}^{0.25} + \left(\sqrt{b} \cdot \sqrt{b} + {\left(\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)\right)}^{0.25} \cdot \sqrt{b}\right)}}{a \cdot 2} \]
      6. metadata-eval94.2%

        \[\leadsto \frac{\left({\left(e^{\log \left(\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)\right)}\right)}^{0.25} + \sqrt{b}\right) \cdot \frac{{\left(\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)\right)}^{0.75} - {b}^{\color{blue}{1.5}}}{{\left(\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)\right)}^{0.25} \cdot {\left(\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)\right)}^{0.25} + \left(\sqrt{b} \cdot \sqrt{b} + {\left(\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)\right)}^{0.25} \cdot \sqrt{b}\right)}}{a \cdot 2} \]
      7. pow-prod-up94.2%

        \[\leadsto \frac{\left({\left(e^{\log \left(\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)\right)}\right)}^{0.25} + \sqrt{b}\right) \cdot \frac{{\left(\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)\right)}^{0.75} - {b}^{1.5}}{\color{blue}{{\left(\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)\right)}^{\left(0.25 + 0.25\right)}} + \left(\sqrt{b} \cdot \sqrt{b} + {\left(\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)\right)}^{0.25} \cdot \sqrt{b}\right)}}{a \cdot 2} \]
      8. metadata-eval94.2%

        \[\leadsto \frac{\left({\left(e^{\log \left(\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)\right)}\right)}^{0.25} + \sqrt{b}\right) \cdot \frac{{\left(\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)\right)}^{0.75} - {b}^{1.5}}{{\left(\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)\right)}^{\color{blue}{0.5}} + \left(\sqrt{b} \cdot \sqrt{b} + {\left(\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)\right)}^{0.25} \cdot \sqrt{b}\right)}}{a \cdot 2} \]
      9. pow1/294.2%

        \[\leadsto \frac{\left({\left(e^{\log \left(\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)\right)}\right)}^{0.25} + \sqrt{b}\right) \cdot \frac{{\left(\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)\right)}^{0.75} - {b}^{1.5}}{\color{blue}{\sqrt{\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)}} + \left(\sqrt{b} \cdot \sqrt{b} + {\left(\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)\right)}^{0.25} \cdot \sqrt{b}\right)}}{a \cdot 2} \]
      10. add-sqr-sqrt94.1%

        \[\leadsto \frac{\left({\left(e^{\log \left(\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)\right)}\right)}^{0.25} + \sqrt{b}\right) \cdot \frac{{\left(\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)\right)}^{0.75} - {b}^{1.5}}{\sqrt{\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)} + \left(\color{blue}{b} + {\left(\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)\right)}^{0.25} \cdot \sqrt{b}\right)}}{a \cdot 2} \]
    8. Applied egg-rr93.9%

      \[\leadsto \frac{\left({\left(\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)\right)}^{0.25} + \sqrt{b}\right) \cdot \color{blue}{\frac{{\left(\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)\right)}^{0.75} - {b}^{1.5}}{\sqrt{\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)} + \left(b + {\left(\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)\right)}^{0.25} \cdot \sqrt{b}\right)}}}{a \cdot 2} \]
    9. Step-by-step derivation
      1. associate-+r+94.1%

        \[\leadsto \frac{\left({\left(e^{\log \left(\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)\right)}\right)}^{0.25} + \sqrt{b}\right) \cdot \frac{{\left(\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)\right)}^{0.75} - {b}^{1.5}}{\color{blue}{\left(\sqrt{\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)} + b\right) + {\left(\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)\right)}^{0.25} \cdot \sqrt{b}}}}{a \cdot 2} \]
      2. +-commutative94.1%

        \[\leadsto \frac{\left({\left(e^{\log \left(\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)\right)}\right)}^{0.25} + \sqrt{b}\right) \cdot \frac{{\left(\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)\right)}^{0.75} - {b}^{1.5}}{\color{blue}{\left(b + \sqrt{\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)}\right)} + {\left(\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)\right)}^{0.25} \cdot \sqrt{b}}}{a \cdot 2} \]
      3. *-commutative94.1%

        \[\leadsto \frac{\left({\left(e^{\log \left(\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)\right)}\right)}^{0.25} + \sqrt{b}\right) \cdot \frac{{\left(\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)\right)}^{0.75} - {b}^{1.5}}{\left(b + \sqrt{\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)}\right) + \color{blue}{\sqrt{b} \cdot {\left(\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)\right)}^{0.25}}}}{a \cdot 2} \]
    10. Simplified93.8%

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

    if 0.0280000000000000006 < b

    1. Initial program 51.4%

      \[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a} \]
    2. Step-by-step derivation
      1. *-commutative51.4%

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(-2, {a}^{2} \cdot \frac{{c}^{3}}{{b}^{5}}, \mathsf{fma}\left(-1, \mathsf{fma}\left(a, \frac{{c}^{2}}{{b}^{3}}, \frac{c}{b}\right), {a}^{3} \cdot \left(\frac{\mathsf{fma}\left(16, \frac{{c}^{4}}{{b}^{6}}, 4 \cdot \frac{{c}^{4}}{{b}^{6}}\right)}{b} \cdot -0.25\right)\right)\right)} \]
    7. Taylor expanded in c around 0 92.9%

      \[\leadsto \mathsf{fma}\left(-2, {a}^{2} \cdot \frac{{c}^{3}}{{b}^{5}}, \mathsf{fma}\left(-1, \mathsf{fma}\left(a, \frac{{c}^{2}}{{b}^{3}}, \frac{c}{b}\right), \color{blue}{-5 \cdot \frac{{a}^{3} \cdot {c}^{4}}{{b}^{7}}}\right)\right) \]
    8. Step-by-step derivation
      1. associate-*r/92.9%

        \[\leadsto \mathsf{fma}\left(-2, {a}^{2} \cdot \frac{{c}^{3}}{{b}^{5}}, \mathsf{fma}\left(-1, \mathsf{fma}\left(a, \frac{{c}^{2}}{{b}^{3}}, \frac{c}{b}\right), \color{blue}{\frac{-5 \cdot \left({a}^{3} \cdot {c}^{4}\right)}{{b}^{7}}}\right)\right) \]
    9. Simplified92.9%

      \[\leadsto \mathsf{fma}\left(-2, {a}^{2} \cdot \frac{{c}^{3}}{{b}^{5}}, \mathsf{fma}\left(-1, \mathsf{fma}\left(a, \frac{{c}^{2}}{{b}^{3}}, \frac{c}{b}\right), \color{blue}{\frac{-5 \cdot \left({a}^{3} \cdot {c}^{4}\right)}{{b}^{7}}}\right)\right) \]
  3. Recombined 2 regimes into one program.
  4. Final simplification93.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq 0.028:\\ \;\;\;\;\frac{\frac{{\left(\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)\right)}^{0.75} - {b}^{1.5}}{\left(b + \sqrt{\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)}\right) + \sqrt{b} \cdot {\left(\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)\right)}^{0.25}} \cdot \left(\sqrt{b} + {\left(\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)\right)}^{0.25}\right)}{a \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(-2, {a}^{2} \cdot \frac{{c}^{3}}{{b}^{5}}, \mathsf{fma}\left(-1, \mathsf{fma}\left(a, \frac{{c}^{2}}{{b}^{3}}, \frac{c}{b}\right), \frac{-5 \cdot \left({a}^{3} \cdot {c}^{4}\right)}{{b}^{7}}\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 92.0% accurate, 0.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)\\ t_1 := \sqrt{t\_0}\\ \mathbf{if}\;b \leq 0.03:\\ \;\;\;\;\frac{{b}^{3} - {t\_0}^{1.5}}{{\left(-t\_1\right)}^{2} + \left({b}^{2} + b \cdot t\_1\right)} \cdot \frac{1}{a \cdot -2}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(-2, {a}^{2} \cdot \frac{{c}^{3}}{{b}^{5}}, \mathsf{fma}\left(-1, \mathsf{fma}\left(a, \frac{{c}^{2}}{{b}^{3}}, \frac{c}{b}\right), \frac{-5 \cdot \left({a}^{3} \cdot {c}^{4}\right)}{{b}^{7}}\right)\right)\\ \end{array} \end{array} \]
(FPCore (a b c)
 :precision binary64
 (let* ((t_0 (fma a (* c -4.0) (pow b 2.0))) (t_1 (sqrt t_0)))
   (if (<= b 0.03)
     (*
      (/
       (- (pow b 3.0) (pow t_0 1.5))
       (+ (pow (- t_1) 2.0) (+ (pow b 2.0) (* b t_1))))
      (/ 1.0 (* a -2.0)))
     (fma
      -2.0
      (* (pow a 2.0) (/ (pow c 3.0) (pow b 5.0)))
      (fma
       -1.0
       (fma a (/ (pow c 2.0) (pow b 3.0)) (/ c b))
       (/ (* -5.0 (* (pow a 3.0) (pow c 4.0))) (pow b 7.0)))))))
double code(double a, double b, double c) {
	double t_0 = fma(a, (c * -4.0), pow(b, 2.0));
	double t_1 = sqrt(t_0);
	double tmp;
	if (b <= 0.03) {
		tmp = ((pow(b, 3.0) - pow(t_0, 1.5)) / (pow(-t_1, 2.0) + (pow(b, 2.0) + (b * t_1)))) * (1.0 / (a * -2.0));
	} else {
		tmp = fma(-2.0, (pow(a, 2.0) * (pow(c, 3.0) / pow(b, 5.0))), fma(-1.0, fma(a, (pow(c, 2.0) / pow(b, 3.0)), (c / b)), ((-5.0 * (pow(a, 3.0) * pow(c, 4.0))) / pow(b, 7.0))));
	}
	return tmp;
}
function code(a, b, c)
	t_0 = fma(a, Float64(c * -4.0), (b ^ 2.0))
	t_1 = sqrt(t_0)
	tmp = 0.0
	if (b <= 0.03)
		tmp = Float64(Float64(Float64((b ^ 3.0) - (t_0 ^ 1.5)) / Float64((Float64(-t_1) ^ 2.0) + Float64((b ^ 2.0) + Float64(b * t_1)))) * Float64(1.0 / Float64(a * -2.0)));
	else
		tmp = fma(-2.0, Float64((a ^ 2.0) * Float64((c ^ 3.0) / (b ^ 5.0))), fma(-1.0, fma(a, Float64((c ^ 2.0) / (b ^ 3.0)), Float64(c / b)), Float64(Float64(-5.0 * Float64((a ^ 3.0) * (c ^ 4.0))) / (b ^ 7.0))));
	end
	return tmp
end
code[a_, b_, c_] := Block[{t$95$0 = N[(a * N[(c * -4.0), $MachinePrecision] + N[Power[b, 2.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Sqrt[t$95$0], $MachinePrecision]}, If[LessEqual[b, 0.03], N[(N[(N[(N[Power[b, 3.0], $MachinePrecision] - N[Power[t$95$0, 1.5], $MachinePrecision]), $MachinePrecision] / N[(N[Power[(-t$95$1), 2.0], $MachinePrecision] + N[(N[Power[b, 2.0], $MachinePrecision] + N[(b * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 / N[(a * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-2.0 * N[(N[Power[a, 2.0], $MachinePrecision] * N[(N[Power[c, 3.0], $MachinePrecision] / N[Power[b, 5.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(-1.0 * N[(a * N[(N[Power[c, 2.0], $MachinePrecision] / N[Power[b, 3.0], $MachinePrecision]), $MachinePrecision] + N[(c / b), $MachinePrecision]), $MachinePrecision] + N[(N[(-5.0 * N[(N[Power[a, 3.0], $MachinePrecision] * N[Power[c, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Power[b, 7.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)\\
t_1 := \sqrt{t\_0}\\
\mathbf{if}\;b \leq 0.03:\\
\;\;\;\;\frac{{b}^{3} - {t\_0}^{1.5}}{{\left(-t\_1\right)}^{2} + \left({b}^{2} + b \cdot t\_1\right)} \cdot \frac{1}{a \cdot -2}\\

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-2, {a}^{2} \cdot \frac{{c}^{3}}{{b}^{5}}, \mathsf{fma}\left(-1, \mathsf{fma}\left(a, \frac{{c}^{2}}{{b}^{3}}, \frac{c}{b}\right), \frac{-5 \cdot \left({a}^{3} \cdot {c}^{4}\right)}{{b}^{7}}\right)\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if b < 0.029999999999999999

    1. Initial program 92.2%

      \[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a} \]
    2. Step-by-step derivation
      1. *-commutative92.2%

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

      \[\leadsto \color{blue}{\frac{\sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)} - b}{a \cdot 2}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. frac-2neg92.3%

        \[\leadsto \color{blue}{\frac{-\left(\sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)} - b\right)}{-a \cdot 2}} \]
      2. div-inv92.6%

        \[\leadsto \color{blue}{\left(-\left(\sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)} - b\right)\right) \cdot \frac{1}{-a \cdot 2}} \]
      3. sub-neg92.6%

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

        \[\leadsto \color{blue}{\left(\left(-\sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)}\right) + \left(-\left(-b\right)\right)\right)} \cdot \frac{1}{-a \cdot 2} \]
      5. pow292.6%

        \[\leadsto \left(\left(-\sqrt{\mathsf{fma}\left(a, c \cdot -4, \color{blue}{{b}^{2}}\right)}\right) + \left(-\left(-b\right)\right)\right) \cdot \frac{1}{-a \cdot 2} \]
      6. add-sqr-sqrt0.0%

        \[\leadsto \left(\left(-\sqrt{\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)}\right) + \left(-\color{blue}{\sqrt{-b} \cdot \sqrt{-b}}\right)\right) \cdot \frac{1}{-a \cdot 2} \]
      7. sqrt-unprod1.6%

        \[\leadsto \left(\left(-\sqrt{\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)}\right) + \left(-\color{blue}{\sqrt{\left(-b\right) \cdot \left(-b\right)}}\right)\right) \cdot \frac{1}{-a \cdot 2} \]
      8. sqr-neg1.6%

        \[\leadsto \left(\left(-\sqrt{\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)}\right) + \left(-\sqrt{\color{blue}{b \cdot b}}\right)\right) \cdot \frac{1}{-a \cdot 2} \]
      9. sqrt-prod1.6%

        \[\leadsto \left(\left(-\sqrt{\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)}\right) + \left(-\color{blue}{\sqrt{b} \cdot \sqrt{b}}\right)\right) \cdot \frac{1}{-a \cdot 2} \]
      10. add-sqr-sqrt1.6%

        \[\leadsto \left(\left(-\sqrt{\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)}\right) + \left(-\color{blue}{b}\right)\right) \cdot \frac{1}{-a \cdot 2} \]
      11. add-sqr-sqrt0.0%

        \[\leadsto \left(\left(-\sqrt{\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)}\right) + \color{blue}{\sqrt{-b} \cdot \sqrt{-b}}\right) \cdot \frac{1}{-a \cdot 2} \]
      12. sqrt-unprod92.6%

        \[\leadsto \left(\left(-\sqrt{\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)}\right) + \color{blue}{\sqrt{\left(-b\right) \cdot \left(-b\right)}}\right) \cdot \frac{1}{-a \cdot 2} \]
      13. sqr-neg92.6%

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

        \[\leadsto \left(\left(-\sqrt{\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)}\right) + \color{blue}{\sqrt{b} \cdot \sqrt{b}}\right) \cdot \frac{1}{-a \cdot 2} \]
      15. add-sqr-sqrt92.6%

        \[\leadsto \left(\left(-\sqrt{\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)}\right) + \color{blue}{b}\right) \cdot \frac{1}{-a \cdot 2} \]
      16. distribute-rgt-neg-in92.6%

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

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

      \[\leadsto \color{blue}{\left(\left(-\sqrt{\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)}\right) + b\right) \cdot \frac{1}{a \cdot -2}} \]
    7. Step-by-step derivation
      1. flip3-+92.6%

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

        \[\leadsto \frac{{\color{blue}{\left(-1 \cdot \sqrt{\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)}\right)}}^{3} + {b}^{3}}{\left(-\sqrt{\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)}\right) \cdot \left(-\sqrt{\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)}\right) + \left(b \cdot b - \left(-\sqrt{\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)}\right) \cdot b\right)} \cdot \frac{1}{a \cdot -2} \]
      3. unpow-prod-down92.6%

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

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

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

        \[\leadsto \frac{-1 \cdot {\left({\left(\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)\right)}^{\color{blue}{\left(1.5 \cdot 0.3333333333333333\right)}}\right)}^{3} + {b}^{3}}{\left(-\sqrt{\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)}\right) \cdot \left(-\sqrt{\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)}\right) + \left(b \cdot b - \left(-\sqrt{\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)}\right) \cdot b\right)} \cdot \frac{1}{a \cdot -2} \]
      7. pow-pow88.2%

        \[\leadsto \frac{-1 \cdot {\color{blue}{\left({\left({\left(\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)\right)}^{1.5}\right)}^{0.3333333333333333}\right)}}^{3} + {b}^{3}}{\left(-\sqrt{\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)}\right) \cdot \left(-\sqrt{\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)}\right) + \left(b \cdot b - \left(-\sqrt{\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)}\right) \cdot b\right)} \cdot \frac{1}{a \cdot -2} \]
      8. pow1/391.1%

        \[\leadsto \frac{-1 \cdot {\color{blue}{\left(\sqrt[3]{{\left(\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)\right)}^{1.5}}\right)}}^{3} + {b}^{3}}{\left(-\sqrt{\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)}\right) \cdot \left(-\sqrt{\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)}\right) + \left(b \cdot b - \left(-\sqrt{\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)}\right) \cdot b\right)} \cdot \frac{1}{a \cdot -2} \]
      9. pow391.0%

        \[\leadsto \frac{-1 \cdot \color{blue}{\left(\left(\sqrt[3]{{\left(\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)\right)}^{1.5}} \cdot \sqrt[3]{{\left(\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)\right)}^{1.5}}\right) \cdot \sqrt[3]{{\left(\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)\right)}^{1.5}}\right)} + {b}^{3}}{\left(-\sqrt{\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)}\right) \cdot \left(-\sqrt{\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)}\right) + \left(b \cdot b - \left(-\sqrt{\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)}\right) \cdot b\right)} \cdot \frac{1}{a \cdot -2} \]
      10. add-cube-cbrt93.5%

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

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

    if 0.029999999999999999 < b

    1. Initial program 51.4%

      \[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a} \]
    2. Step-by-step derivation
      1. *-commutative51.4%

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(-2, {a}^{2} \cdot \frac{{c}^{3}}{{b}^{5}}, \mathsf{fma}\left(-1, \mathsf{fma}\left(a, \frac{{c}^{2}}{{b}^{3}}, \frac{c}{b}\right), {a}^{3} \cdot \left(\frac{\mathsf{fma}\left(16, \frac{{c}^{4}}{{b}^{6}}, 4 \cdot \frac{{c}^{4}}{{b}^{6}}\right)}{b} \cdot -0.25\right)\right)\right)} \]
    7. Taylor expanded in c around 0 92.9%

      \[\leadsto \mathsf{fma}\left(-2, {a}^{2} \cdot \frac{{c}^{3}}{{b}^{5}}, \mathsf{fma}\left(-1, \mathsf{fma}\left(a, \frac{{c}^{2}}{{b}^{3}}, \frac{c}{b}\right), \color{blue}{-5 \cdot \frac{{a}^{3} \cdot {c}^{4}}{{b}^{7}}}\right)\right) \]
    8. Step-by-step derivation
      1. associate-*r/92.9%

        \[\leadsto \mathsf{fma}\left(-2, {a}^{2} \cdot \frac{{c}^{3}}{{b}^{5}}, \mathsf{fma}\left(-1, \mathsf{fma}\left(a, \frac{{c}^{2}}{{b}^{3}}, \frac{c}{b}\right), \color{blue}{\frac{-5 \cdot \left({a}^{3} \cdot {c}^{4}\right)}{{b}^{7}}}\right)\right) \]
    9. Simplified92.9%

      \[\leadsto \mathsf{fma}\left(-2, {a}^{2} \cdot \frac{{c}^{3}}{{b}^{5}}, \mathsf{fma}\left(-1, \mathsf{fma}\left(a, \frac{{c}^{2}}{{b}^{3}}, \frac{c}{b}\right), \color{blue}{\frac{-5 \cdot \left({a}^{3} \cdot {c}^{4}\right)}{{b}^{7}}}\right)\right) \]
  3. Recombined 2 regimes into one program.
  4. Final simplification93.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq 0.03:\\ \;\;\;\;\frac{{b}^{3} - {\left(\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)\right)}^{1.5}}{{\left(-\sqrt{\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)}\right)}^{2} + \left({b}^{2} + b \cdot \sqrt{\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)}\right)} \cdot \frac{1}{a \cdot -2}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(-2, {a}^{2} \cdot \frac{{c}^{3}}{{b}^{5}}, \mathsf{fma}\left(-1, \mathsf{fma}\left(a, \frac{{c}^{2}}{{b}^{3}}, \frac{c}{b}\right), \frac{-5 \cdot \left({a}^{3} \cdot {c}^{4}\right)}{{b}^{7}}\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 92.0% accurate, 0.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)\\ \mathbf{if}\;b \leq 0.0305:\\ \;\;\;\;\frac{\frac{{t\_0}^{1.5} - {b}^{3}}{t\_0 + \mathsf{fma}\left(b, b, b \cdot \sqrt{t\_0}\right)}}{a \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(-2, {a}^{2} \cdot \frac{{c}^{3}}{{b}^{5}}, \mathsf{fma}\left(-1, \mathsf{fma}\left(a, \frac{{c}^{2}}{{b}^{3}}, \frac{c}{b}\right), \frac{-5 \cdot \left({a}^{3} \cdot {c}^{4}\right)}{{b}^{7}}\right)\right)\\ \end{array} \end{array} \]
(FPCore (a b c)
 :precision binary64
 (let* ((t_0 (fma a (* c -4.0) (pow b 2.0))))
   (if (<= b 0.0305)
     (/
      (/ (- (pow t_0 1.5) (pow b 3.0)) (+ t_0 (fma b b (* b (sqrt t_0)))))
      (* a 2.0))
     (fma
      -2.0
      (* (pow a 2.0) (/ (pow c 3.0) (pow b 5.0)))
      (fma
       -1.0
       (fma a (/ (pow c 2.0) (pow b 3.0)) (/ c b))
       (/ (* -5.0 (* (pow a 3.0) (pow c 4.0))) (pow b 7.0)))))))
double code(double a, double b, double c) {
	double t_0 = fma(a, (c * -4.0), pow(b, 2.0));
	double tmp;
	if (b <= 0.0305) {
		tmp = ((pow(t_0, 1.5) - pow(b, 3.0)) / (t_0 + fma(b, b, (b * sqrt(t_0))))) / (a * 2.0);
	} else {
		tmp = fma(-2.0, (pow(a, 2.0) * (pow(c, 3.0) / pow(b, 5.0))), fma(-1.0, fma(a, (pow(c, 2.0) / pow(b, 3.0)), (c / b)), ((-5.0 * (pow(a, 3.0) * pow(c, 4.0))) / pow(b, 7.0))));
	}
	return tmp;
}
function code(a, b, c)
	t_0 = fma(a, Float64(c * -4.0), (b ^ 2.0))
	tmp = 0.0
	if (b <= 0.0305)
		tmp = Float64(Float64(Float64((t_0 ^ 1.5) - (b ^ 3.0)) / Float64(t_0 + fma(b, b, Float64(b * sqrt(t_0))))) / Float64(a * 2.0));
	else
		tmp = fma(-2.0, Float64((a ^ 2.0) * Float64((c ^ 3.0) / (b ^ 5.0))), fma(-1.0, fma(a, Float64((c ^ 2.0) / (b ^ 3.0)), Float64(c / b)), Float64(Float64(-5.0 * Float64((a ^ 3.0) * (c ^ 4.0))) / (b ^ 7.0))));
	end
	return tmp
end
code[a_, b_, c_] := Block[{t$95$0 = N[(a * N[(c * -4.0), $MachinePrecision] + N[Power[b, 2.0], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, 0.0305], N[(N[(N[(N[Power[t$95$0, 1.5], $MachinePrecision] - N[Power[b, 3.0], $MachinePrecision]), $MachinePrecision] / N[(t$95$0 + N[(b * b + N[(b * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(a * 2.0), $MachinePrecision]), $MachinePrecision], N[(-2.0 * N[(N[Power[a, 2.0], $MachinePrecision] * N[(N[Power[c, 3.0], $MachinePrecision] / N[Power[b, 5.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(-1.0 * N[(a * N[(N[Power[c, 2.0], $MachinePrecision] / N[Power[b, 3.0], $MachinePrecision]), $MachinePrecision] + N[(c / b), $MachinePrecision]), $MachinePrecision] + N[(N[(-5.0 * N[(N[Power[a, 3.0], $MachinePrecision] * N[Power[c, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Power[b, 7.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)\\
\mathbf{if}\;b \leq 0.0305:\\
\;\;\;\;\frac{\frac{{t\_0}^{1.5} - {b}^{3}}{t\_0 + \mathsf{fma}\left(b, b, b \cdot \sqrt{t\_0}\right)}}{a \cdot 2}\\

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-2, {a}^{2} \cdot \frac{{c}^{3}}{{b}^{5}}, \mathsf{fma}\left(-1, \mathsf{fma}\left(a, \frac{{c}^{2}}{{b}^{3}}, \frac{c}{b}\right), \frac{-5 \cdot \left({a}^{3} \cdot {c}^{4}\right)}{{b}^{7}}\right)\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if b < 0.030499999999999999

    1. Initial program 92.2%

      \[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a} \]
    2. Step-by-step derivation
      1. *-commutative92.2%

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

      \[\leadsto \color{blue}{\frac{\sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)} - b}{a \cdot 2}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. add-cbrt-cube90.8%

        \[\leadsto \frac{\color{blue}{\sqrt[3]{\left(\sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)} \cdot \sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)}\right) \cdot \sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)}}} - b}{a \cdot 2} \]
      2. pow1/387.9%

        \[\leadsto \frac{\color{blue}{{\left(\left(\sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)} \cdot \sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)}\right) \cdot \sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)}\right)}^{0.3333333333333333}} - b}{a \cdot 2} \]
      3. pow387.9%

        \[\leadsto \frac{{\color{blue}{\left({\left(\sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)}\right)}^{3}\right)}}^{0.3333333333333333} - b}{a \cdot 2} \]
      4. sqrt-pow288.0%

        \[\leadsto \frac{{\color{blue}{\left({\left(\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)\right)}^{\left(\frac{3}{2}\right)}\right)}}^{0.3333333333333333} - b}{a \cdot 2} \]
      5. pow288.0%

        \[\leadsto \frac{{\left({\left(\mathsf{fma}\left(a, c \cdot -4, \color{blue}{{b}^{2}}\right)\right)}^{\left(\frac{3}{2}\right)}\right)}^{0.3333333333333333} - b}{a \cdot 2} \]
      6. metadata-eval88.0%

        \[\leadsto \frac{{\left({\left(\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)\right)}^{\color{blue}{1.5}}\right)}^{0.3333333333333333} - b}{a \cdot 2} \]
    6. Applied egg-rr88.0%

      \[\leadsto \frac{\color{blue}{{\left({\left(\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)\right)}^{1.5}\right)}^{0.3333333333333333}} - b}{a \cdot 2} \]
    7. Step-by-step derivation
      1. unpow1/391.1%

        \[\leadsto \frac{\color{blue}{\sqrt[3]{{\left(\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)\right)}^{1.5}}} - b}{a \cdot 2} \]
    8. Simplified91.1%

      \[\leadsto \frac{\color{blue}{\sqrt[3]{{\left(\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)\right)}^{1.5}}} - b}{a \cdot 2} \]
    9. Step-by-step derivation
      1. flip3--91.0%

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

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

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

        \[\leadsto \frac{\frac{{\left(\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)\right)}^{1.5} - {b}^{3}}{\color{blue}{\sqrt[3]{{\left(\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)\right)}^{1.5} \cdot {\left(\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)\right)}^{1.5}}} + \left(b \cdot b + \sqrt[3]{{\left(\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)\right)}^{1.5}} \cdot b\right)}}{a \cdot 2} \]
      5. pow-prod-up93.4%

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

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

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

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

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

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

    if 0.030499999999999999 < b

    1. Initial program 51.4%

      \[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a} \]
    2. Step-by-step derivation
      1. *-commutative51.4%

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(-2, {a}^{2} \cdot \frac{{c}^{3}}{{b}^{5}}, \mathsf{fma}\left(-1, \mathsf{fma}\left(a, \frac{{c}^{2}}{{b}^{3}}, \frac{c}{b}\right), {a}^{3} \cdot \left(\frac{\mathsf{fma}\left(16, \frac{{c}^{4}}{{b}^{6}}, 4 \cdot \frac{{c}^{4}}{{b}^{6}}\right)}{b} \cdot -0.25\right)\right)\right)} \]
    7. Taylor expanded in c around 0 92.9%

      \[\leadsto \mathsf{fma}\left(-2, {a}^{2} \cdot \frac{{c}^{3}}{{b}^{5}}, \mathsf{fma}\left(-1, \mathsf{fma}\left(a, \frac{{c}^{2}}{{b}^{3}}, \frac{c}{b}\right), \color{blue}{-5 \cdot \frac{{a}^{3} \cdot {c}^{4}}{{b}^{7}}}\right)\right) \]
    8. Step-by-step derivation
      1. associate-*r/92.9%

        \[\leadsto \mathsf{fma}\left(-2, {a}^{2} \cdot \frac{{c}^{3}}{{b}^{5}}, \mathsf{fma}\left(-1, \mathsf{fma}\left(a, \frac{{c}^{2}}{{b}^{3}}, \frac{c}{b}\right), \color{blue}{\frac{-5 \cdot \left({a}^{3} \cdot {c}^{4}\right)}{{b}^{7}}}\right)\right) \]
    9. Simplified92.9%

      \[\leadsto \mathsf{fma}\left(-2, {a}^{2} \cdot \frac{{c}^{3}}{{b}^{5}}, \mathsf{fma}\left(-1, \mathsf{fma}\left(a, \frac{{c}^{2}}{{b}^{3}}, \frac{c}{b}\right), \color{blue}{\frac{-5 \cdot \left({a}^{3} \cdot {c}^{4}\right)}{{b}^{7}}}\right)\right) \]
  3. Recombined 2 regimes into one program.
  4. Final simplification93.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq 0.0305:\\ \;\;\;\;\frac{\frac{{\left(\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)\right)}^{1.5} - {b}^{3}}{\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right) + \mathsf{fma}\left(b, b, b \cdot \sqrt{\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)}\right)}}{a \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(-2, {a}^{2} \cdot \frac{{c}^{3}}{{b}^{5}}, \mathsf{fma}\left(-1, \mathsf{fma}\left(a, \frac{{c}^{2}}{{b}^{3}}, \frac{c}{b}\right), \frac{-5 \cdot \left({a}^{3} \cdot {c}^{4}\right)}{{b}^{7}}\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 92.1% accurate, 0.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)\\ \mathbf{if}\;b \leq 0.0285:\\ \;\;\;\;\frac{\frac{{t\_0}^{1.5} - {b}^{3}}{t\_0 + \mathsf{fma}\left(b, b, b \cdot \sqrt{t\_0}\right)}}{a \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;-2 \cdot \frac{{a}^{2} \cdot {c}^{3}}{{b}^{5}} + \left(\left(-0.25 \cdot \frac{{\left(a \cdot c\right)}^{4} \cdot 20}{a \cdot {b}^{7}} - \frac{a \cdot {c}^{2}}{{b}^{3}}\right) - \frac{c}{b}\right)\\ \end{array} \end{array} \]
(FPCore (a b c)
 :precision binary64
 (let* ((t_0 (fma a (* c -4.0) (pow b 2.0))))
   (if (<= b 0.0285)
     (/
      (/ (- (pow t_0 1.5) (pow b 3.0)) (+ t_0 (fma b b (* b (sqrt t_0)))))
      (* a 2.0))
     (+
      (* -2.0 (/ (* (pow a 2.0) (pow c 3.0)) (pow b 5.0)))
      (-
       (-
        (* -0.25 (/ (* (pow (* a c) 4.0) 20.0) (* a (pow b 7.0))))
        (/ (* a (pow c 2.0)) (pow b 3.0)))
       (/ c b))))))
double code(double a, double b, double c) {
	double t_0 = fma(a, (c * -4.0), pow(b, 2.0));
	double tmp;
	if (b <= 0.0285) {
		tmp = ((pow(t_0, 1.5) - pow(b, 3.0)) / (t_0 + fma(b, b, (b * sqrt(t_0))))) / (a * 2.0);
	} else {
		tmp = (-2.0 * ((pow(a, 2.0) * pow(c, 3.0)) / pow(b, 5.0))) + (((-0.25 * ((pow((a * c), 4.0) * 20.0) / (a * pow(b, 7.0)))) - ((a * pow(c, 2.0)) / pow(b, 3.0))) - (c / b));
	}
	return tmp;
}
function code(a, b, c)
	t_0 = fma(a, Float64(c * -4.0), (b ^ 2.0))
	tmp = 0.0
	if (b <= 0.0285)
		tmp = Float64(Float64(Float64((t_0 ^ 1.5) - (b ^ 3.0)) / Float64(t_0 + fma(b, b, Float64(b * sqrt(t_0))))) / Float64(a * 2.0));
	else
		tmp = Float64(Float64(-2.0 * Float64(Float64((a ^ 2.0) * (c ^ 3.0)) / (b ^ 5.0))) + Float64(Float64(Float64(-0.25 * Float64(Float64((Float64(a * c) ^ 4.0) * 20.0) / Float64(a * (b ^ 7.0)))) - Float64(Float64(a * (c ^ 2.0)) / (b ^ 3.0))) - Float64(c / b)));
	end
	return tmp
end
code[a_, b_, c_] := Block[{t$95$0 = N[(a * N[(c * -4.0), $MachinePrecision] + N[Power[b, 2.0], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, 0.0285], N[(N[(N[(N[Power[t$95$0, 1.5], $MachinePrecision] - N[Power[b, 3.0], $MachinePrecision]), $MachinePrecision] / N[(t$95$0 + N[(b * b + N[(b * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(a * 2.0), $MachinePrecision]), $MachinePrecision], N[(N[(-2.0 * N[(N[(N[Power[a, 2.0], $MachinePrecision] * N[Power[c, 3.0], $MachinePrecision]), $MachinePrecision] / N[Power[b, 5.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(-0.25 * N[(N[(N[Power[N[(a * c), $MachinePrecision], 4.0], $MachinePrecision] * 20.0), $MachinePrecision] / N[(a * N[Power[b, 7.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(a * N[Power[c, 2.0], $MachinePrecision]), $MachinePrecision] / N[Power[b, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(c / b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)\\
\mathbf{if}\;b \leq 0.0285:\\
\;\;\;\;\frac{\frac{{t\_0}^{1.5} - {b}^{3}}{t\_0 + \mathsf{fma}\left(b, b, b \cdot \sqrt{t\_0}\right)}}{a \cdot 2}\\

\mathbf{else}:\\
\;\;\;\;-2 \cdot \frac{{a}^{2} \cdot {c}^{3}}{{b}^{5}} + \left(\left(-0.25 \cdot \frac{{\left(a \cdot c\right)}^{4} \cdot 20}{a \cdot {b}^{7}} - \frac{a \cdot {c}^{2}}{{b}^{3}}\right) - \frac{c}{b}\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if b < 0.028500000000000001

    1. Initial program 92.2%

      \[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a} \]
    2. Step-by-step derivation
      1. *-commutative92.2%

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

      \[\leadsto \color{blue}{\frac{\sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)} - b}{a \cdot 2}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. add-cbrt-cube90.8%

        \[\leadsto \frac{\color{blue}{\sqrt[3]{\left(\sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)} \cdot \sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)}\right) \cdot \sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)}}} - b}{a \cdot 2} \]
      2. pow1/387.9%

        \[\leadsto \frac{\color{blue}{{\left(\left(\sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)} \cdot \sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)}\right) \cdot \sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)}\right)}^{0.3333333333333333}} - b}{a \cdot 2} \]
      3. pow387.9%

        \[\leadsto \frac{{\color{blue}{\left({\left(\sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)}\right)}^{3}\right)}}^{0.3333333333333333} - b}{a \cdot 2} \]
      4. sqrt-pow288.0%

        \[\leadsto \frac{{\color{blue}{\left({\left(\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)\right)}^{\left(\frac{3}{2}\right)}\right)}}^{0.3333333333333333} - b}{a \cdot 2} \]
      5. pow288.0%

        \[\leadsto \frac{{\left({\left(\mathsf{fma}\left(a, c \cdot -4, \color{blue}{{b}^{2}}\right)\right)}^{\left(\frac{3}{2}\right)}\right)}^{0.3333333333333333} - b}{a \cdot 2} \]
      6. metadata-eval88.0%

        \[\leadsto \frac{{\left({\left(\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)\right)}^{\color{blue}{1.5}}\right)}^{0.3333333333333333} - b}{a \cdot 2} \]
    6. Applied egg-rr88.0%

      \[\leadsto \frac{\color{blue}{{\left({\left(\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)\right)}^{1.5}\right)}^{0.3333333333333333}} - b}{a \cdot 2} \]
    7. Step-by-step derivation
      1. unpow1/391.1%

        \[\leadsto \frac{\color{blue}{\sqrt[3]{{\left(\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)\right)}^{1.5}}} - b}{a \cdot 2} \]
    8. Simplified91.1%

      \[\leadsto \frac{\color{blue}{\sqrt[3]{{\left(\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)\right)}^{1.5}}} - b}{a \cdot 2} \]
    9. Step-by-step derivation
      1. flip3--91.0%

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

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

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

        \[\leadsto \frac{\frac{{\left(\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)\right)}^{1.5} - {b}^{3}}{\color{blue}{\sqrt[3]{{\left(\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)\right)}^{1.5} \cdot {\left(\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)\right)}^{1.5}}} + \left(b \cdot b + \sqrt[3]{{\left(\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)\right)}^{1.5}} \cdot b\right)}}{a \cdot 2} \]
      5. pow-prod-up93.4%

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

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

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

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

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

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

    if 0.028500000000000001 < b

    1. Initial program 51.4%

      \[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a} \]
    2. Step-by-step derivation
      1. *-commutative51.4%

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

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

      \[\leadsto \color{blue}{-2 \cdot \frac{{a}^{2} \cdot {c}^{3}}{{b}^{5}} + \left(-1 \cdot \frac{c}{b} + \left(-1 \cdot \frac{a \cdot {c}^{2}}{{b}^{3}} + -0.25 \cdot \frac{16 \cdot \left({a}^{4} \cdot {c}^{4}\right) + {\left(-2 \cdot \left({a}^{2} \cdot {c}^{2}\right)\right)}^{2}}{a \cdot {b}^{7}}\right)\right)} \]
    6. Taylor expanded in c around 0 92.9%

      \[\leadsto -2 \cdot \frac{{a}^{2} \cdot {c}^{3}}{{b}^{5}} + \left(-1 \cdot \frac{c}{b} + \left(-1 \cdot \frac{a \cdot {c}^{2}}{{b}^{3}} + -0.25 \cdot \color{blue}{\frac{{c}^{4} \cdot \left(4 \cdot {a}^{4} + 16 \cdot {a}^{4}\right)}{a \cdot {b}^{7}}}\right)\right) \]
    7. Step-by-step derivation
      1. distribute-rgt-in92.9%

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

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

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

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

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

Alternative 6: 92.1% accurate, 0.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)\\ \mathbf{if}\;b \leq 0.03:\\ \;\;\;\;\frac{1}{a \cdot -2} \cdot \frac{{b}^{2} - t\_0}{b + \sqrt{t\_0}}\\ \mathbf{else}:\\ \;\;\;\;-2 \cdot \frac{{a}^{2} \cdot {c}^{3}}{{b}^{5}} + \left(\left(-0.25 \cdot \frac{{\left(a \cdot c\right)}^{4} \cdot 20}{a \cdot {b}^{7}} - \frac{a \cdot {c}^{2}}{{b}^{3}}\right) - \frac{c}{b}\right)\\ \end{array} \end{array} \]
(FPCore (a b c)
 :precision binary64
 (let* ((t_0 (fma a (* c -4.0) (pow b 2.0))))
   (if (<= b 0.03)
     (* (/ 1.0 (* a -2.0)) (/ (- (pow b 2.0) t_0) (+ b (sqrt t_0))))
     (+
      (* -2.0 (/ (* (pow a 2.0) (pow c 3.0)) (pow b 5.0)))
      (-
       (-
        (* -0.25 (/ (* (pow (* a c) 4.0) 20.0) (* a (pow b 7.0))))
        (/ (* a (pow c 2.0)) (pow b 3.0)))
       (/ c b))))))
double code(double a, double b, double c) {
	double t_0 = fma(a, (c * -4.0), pow(b, 2.0));
	double tmp;
	if (b <= 0.03) {
		tmp = (1.0 / (a * -2.0)) * ((pow(b, 2.0) - t_0) / (b + sqrt(t_0)));
	} else {
		tmp = (-2.0 * ((pow(a, 2.0) * pow(c, 3.0)) / pow(b, 5.0))) + (((-0.25 * ((pow((a * c), 4.0) * 20.0) / (a * pow(b, 7.0)))) - ((a * pow(c, 2.0)) / pow(b, 3.0))) - (c / b));
	}
	return tmp;
}
function code(a, b, c)
	t_0 = fma(a, Float64(c * -4.0), (b ^ 2.0))
	tmp = 0.0
	if (b <= 0.03)
		tmp = Float64(Float64(1.0 / Float64(a * -2.0)) * Float64(Float64((b ^ 2.0) - t_0) / Float64(b + sqrt(t_0))));
	else
		tmp = Float64(Float64(-2.0 * Float64(Float64((a ^ 2.0) * (c ^ 3.0)) / (b ^ 5.0))) + Float64(Float64(Float64(-0.25 * Float64(Float64((Float64(a * c) ^ 4.0) * 20.0) / Float64(a * (b ^ 7.0)))) - Float64(Float64(a * (c ^ 2.0)) / (b ^ 3.0))) - Float64(c / b)));
	end
	return tmp
end
code[a_, b_, c_] := Block[{t$95$0 = N[(a * N[(c * -4.0), $MachinePrecision] + N[Power[b, 2.0], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, 0.03], N[(N[(1.0 / N[(a * -2.0), $MachinePrecision]), $MachinePrecision] * N[(N[(N[Power[b, 2.0], $MachinePrecision] - t$95$0), $MachinePrecision] / N[(b + N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(-2.0 * N[(N[(N[Power[a, 2.0], $MachinePrecision] * N[Power[c, 3.0], $MachinePrecision]), $MachinePrecision] / N[Power[b, 5.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(-0.25 * N[(N[(N[Power[N[(a * c), $MachinePrecision], 4.0], $MachinePrecision] * 20.0), $MachinePrecision] / N[(a * N[Power[b, 7.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(a * N[Power[c, 2.0], $MachinePrecision]), $MachinePrecision] / N[Power[b, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(c / b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)\\
\mathbf{if}\;b \leq 0.03:\\
\;\;\;\;\frac{1}{a \cdot -2} \cdot \frac{{b}^{2} - t\_0}{b + \sqrt{t\_0}}\\

\mathbf{else}:\\
\;\;\;\;-2 \cdot \frac{{a}^{2} \cdot {c}^{3}}{{b}^{5}} + \left(\left(-0.25 \cdot \frac{{\left(a \cdot c\right)}^{4} \cdot 20}{a \cdot {b}^{7}} - \frac{a \cdot {c}^{2}}{{b}^{3}}\right) - \frac{c}{b}\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if b < 0.029999999999999999

    1. Initial program 92.2%

      \[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a} \]
    2. Step-by-step derivation
      1. *-commutative92.2%

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

      \[\leadsto \color{blue}{\frac{\sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)} - b}{a \cdot 2}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. frac-2neg92.3%

        \[\leadsto \color{blue}{\frac{-\left(\sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)} - b\right)}{-a \cdot 2}} \]
      2. div-inv92.6%

        \[\leadsto \color{blue}{\left(-\left(\sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)} - b\right)\right) \cdot \frac{1}{-a \cdot 2}} \]
      3. sub-neg92.6%

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

        \[\leadsto \color{blue}{\left(\left(-\sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)}\right) + \left(-\left(-b\right)\right)\right)} \cdot \frac{1}{-a \cdot 2} \]
      5. pow292.6%

        \[\leadsto \left(\left(-\sqrt{\mathsf{fma}\left(a, c \cdot -4, \color{blue}{{b}^{2}}\right)}\right) + \left(-\left(-b\right)\right)\right) \cdot \frac{1}{-a \cdot 2} \]
      6. add-sqr-sqrt0.0%

        \[\leadsto \left(\left(-\sqrt{\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)}\right) + \left(-\color{blue}{\sqrt{-b} \cdot \sqrt{-b}}\right)\right) \cdot \frac{1}{-a \cdot 2} \]
      7. sqrt-unprod1.6%

        \[\leadsto \left(\left(-\sqrt{\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)}\right) + \left(-\color{blue}{\sqrt{\left(-b\right) \cdot \left(-b\right)}}\right)\right) \cdot \frac{1}{-a \cdot 2} \]
      8. sqr-neg1.6%

        \[\leadsto \left(\left(-\sqrt{\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)}\right) + \left(-\sqrt{\color{blue}{b \cdot b}}\right)\right) \cdot \frac{1}{-a \cdot 2} \]
      9. sqrt-prod1.6%

        \[\leadsto \left(\left(-\sqrt{\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)}\right) + \left(-\color{blue}{\sqrt{b} \cdot \sqrt{b}}\right)\right) \cdot \frac{1}{-a \cdot 2} \]
      10. add-sqr-sqrt1.6%

        \[\leadsto \left(\left(-\sqrt{\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)}\right) + \left(-\color{blue}{b}\right)\right) \cdot \frac{1}{-a \cdot 2} \]
      11. add-sqr-sqrt0.0%

        \[\leadsto \left(\left(-\sqrt{\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)}\right) + \color{blue}{\sqrt{-b} \cdot \sqrt{-b}}\right) \cdot \frac{1}{-a \cdot 2} \]
      12. sqrt-unprod92.6%

        \[\leadsto \left(\left(-\sqrt{\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)}\right) + \color{blue}{\sqrt{\left(-b\right) \cdot \left(-b\right)}}\right) \cdot \frac{1}{-a \cdot 2} \]
      13. sqr-neg92.6%

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

        \[\leadsto \left(\left(-\sqrt{\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)}\right) + \color{blue}{\sqrt{b} \cdot \sqrt{b}}\right) \cdot \frac{1}{-a \cdot 2} \]
      15. add-sqr-sqrt92.6%

        \[\leadsto \left(\left(-\sqrt{\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)}\right) + \color{blue}{b}\right) \cdot \frac{1}{-a \cdot 2} \]
      16. distribute-rgt-neg-in92.6%

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

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

      \[\leadsto \color{blue}{\left(\left(-\sqrt{\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)}\right) + b\right) \cdot \frac{1}{a \cdot -2}} \]
    7. Step-by-step derivation
      1. flip-+92.0%

        \[\leadsto \color{blue}{\frac{\left(-\sqrt{\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)}\right) \cdot \left(-\sqrt{\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)}\right) - b \cdot b}{\left(-\sqrt{\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)}\right) - b}} \cdot \frac{1}{a \cdot -2} \]
      2. pow292.0%

        \[\leadsto \frac{\color{blue}{{\left(-\sqrt{\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)}\right)}^{2}} - b \cdot b}{\left(-\sqrt{\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)}\right) - b} \cdot \frac{1}{a \cdot -2} \]
      3. unpow292.0%

        \[\leadsto \frac{{\left(-\sqrt{\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)}\right)}^{2} - \color{blue}{{b}^{2}}}{\left(-\sqrt{\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)}\right) - b} \cdot \frac{1}{a \cdot -2} \]
    8. Applied egg-rr92.0%

      \[\leadsto \color{blue}{\frac{{\left(-\sqrt{\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)}\right)}^{2} - {b}^{2}}{\left(-\sqrt{\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)}\right) - b}} \cdot \frac{1}{a \cdot -2} \]
    9. Step-by-step derivation
      1. div-sub91.5%

        \[\leadsto \color{blue}{\left(\frac{{\left(-\sqrt{\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)}\right)}^{2}}{\left(-\sqrt{\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)}\right) - b} - \frac{{b}^{2}}{\left(-\sqrt{\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)}\right) - b}\right)} \cdot \frac{1}{a \cdot -2} \]
      2. unpow291.5%

        \[\leadsto \left(\frac{\color{blue}{\left(-\sqrt{\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)}\right) \cdot \left(-\sqrt{\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)}\right)}}{\left(-\sqrt{\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)}\right) - b} - \frac{{b}^{2}}{\left(-\sqrt{\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)}\right) - b}\right) \cdot \frac{1}{a \cdot -2} \]
      3. sqr-neg91.5%

        \[\leadsto \left(\frac{\color{blue}{\sqrt{\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)} \cdot \sqrt{\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)}}}{\left(-\sqrt{\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)}\right) - b} - \frac{{b}^{2}}{\left(-\sqrt{\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)}\right) - b}\right) \cdot \frac{1}{a \cdot -2} \]
      4. rem-square-sqrt93.0%

        \[\leadsto \left(\frac{\color{blue}{\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)}}{\left(-\sqrt{\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)}\right) - b} - \frac{{b}^{2}}{\left(-\sqrt{\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)}\right) - b}\right) \cdot \frac{1}{a \cdot -2} \]
      5. div-sub93.4%

        \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right) - {b}^{2}}{\left(-\sqrt{\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)}\right) - b}} \cdot \frac{1}{a \cdot -2} \]
    10. Simplified93.4%

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right) - {b}^{2}}{\left(-\sqrt{\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)}\right) - b}} \cdot \frac{1}{a \cdot -2} \]

    if 0.029999999999999999 < b

    1. Initial program 51.4%

      \[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a} \]
    2. Step-by-step derivation
      1. *-commutative51.4%

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

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

      \[\leadsto \color{blue}{-2 \cdot \frac{{a}^{2} \cdot {c}^{3}}{{b}^{5}} + \left(-1 \cdot \frac{c}{b} + \left(-1 \cdot \frac{a \cdot {c}^{2}}{{b}^{3}} + -0.25 \cdot \frac{16 \cdot \left({a}^{4} \cdot {c}^{4}\right) + {\left(-2 \cdot \left({a}^{2} \cdot {c}^{2}\right)\right)}^{2}}{a \cdot {b}^{7}}\right)\right)} \]
    6. Taylor expanded in c around 0 92.9%

      \[\leadsto -2 \cdot \frac{{a}^{2} \cdot {c}^{3}}{{b}^{5}} + \left(-1 \cdot \frac{c}{b} + \left(-1 \cdot \frac{a \cdot {c}^{2}}{{b}^{3}} + -0.25 \cdot \color{blue}{\frac{{c}^{4} \cdot \left(4 \cdot {a}^{4} + 16 \cdot {a}^{4}\right)}{a \cdot {b}^{7}}}\right)\right) \]
    7. Step-by-step derivation
      1. distribute-rgt-in92.9%

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

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

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

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

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

Alternative 7: 89.8% accurate, 0.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \mathsf{fma}\left(-4, a \cdot c, {b}^{2}\right)\\ \mathbf{if}\;b \leq 5.2:\\ \;\;\;\;\frac{\frac{t\_0 - {b}^{2}}{b + \sqrt{t\_0}}}{a \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;\left(-2 \cdot \left({a}^{2} \cdot \frac{{c}^{3}}{{b}^{5}}\right) - \frac{c}{b}\right) - a \cdot \frac{{c}^{2}}{{b}^{3}}\\ \end{array} \end{array} \]
(FPCore (a b c)
 :precision binary64
 (let* ((t_0 (fma -4.0 (* a c) (pow b 2.0))))
   (if (<= b 5.2)
     (/ (/ (- t_0 (pow b 2.0)) (+ b (sqrt t_0))) (* a 2.0))
     (-
      (- (* -2.0 (* (pow a 2.0) (/ (pow c 3.0) (pow b 5.0)))) (/ c b))
      (* a (/ (pow c 2.0) (pow b 3.0)))))))
double code(double a, double b, double c) {
	double t_0 = fma(-4.0, (a * c), pow(b, 2.0));
	double tmp;
	if (b <= 5.2) {
		tmp = ((t_0 - pow(b, 2.0)) / (b + sqrt(t_0))) / (a * 2.0);
	} else {
		tmp = ((-2.0 * (pow(a, 2.0) * (pow(c, 3.0) / pow(b, 5.0)))) - (c / b)) - (a * (pow(c, 2.0) / pow(b, 3.0)));
	}
	return tmp;
}
function code(a, b, c)
	t_0 = fma(-4.0, Float64(a * c), (b ^ 2.0))
	tmp = 0.0
	if (b <= 5.2)
		tmp = Float64(Float64(Float64(t_0 - (b ^ 2.0)) / Float64(b + sqrt(t_0))) / Float64(a * 2.0));
	else
		tmp = Float64(Float64(Float64(-2.0 * Float64((a ^ 2.0) * Float64((c ^ 3.0) / (b ^ 5.0)))) - Float64(c / b)) - Float64(a * Float64((c ^ 2.0) / (b ^ 3.0))));
	end
	return tmp
end
code[a_, b_, c_] := Block[{t$95$0 = N[(-4.0 * N[(a * c), $MachinePrecision] + N[Power[b, 2.0], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, 5.2], N[(N[(N[(t$95$0 - N[Power[b, 2.0], $MachinePrecision]), $MachinePrecision] / N[(b + N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(a * 2.0), $MachinePrecision]), $MachinePrecision], N[(N[(N[(-2.0 * N[(N[Power[a, 2.0], $MachinePrecision] * N[(N[Power[c, 3.0], $MachinePrecision] / N[Power[b, 5.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(c / b), $MachinePrecision]), $MachinePrecision] - N[(a * N[(N[Power[c, 2.0], $MachinePrecision] / N[Power[b, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(-4, a \cdot c, {b}^{2}\right)\\
\mathbf{if}\;b \leq 5.2:\\
\;\;\;\;\frac{\frac{t\_0 - {b}^{2}}{b + \sqrt{t\_0}}}{a \cdot 2}\\

\mathbf{else}:\\
\;\;\;\;\left(-2 \cdot \left({a}^{2} \cdot \frac{{c}^{3}}{{b}^{5}}\right) - \frac{c}{b}\right) - a \cdot \frac{{c}^{2}}{{b}^{3}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if b < 5.20000000000000018

    1. Initial program 80.6%

      \[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a} \]
    2. Step-by-step derivation
      1. *-commutative80.6%

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

      \[\leadsto \color{blue}{\frac{\sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)} - b}{a \cdot 2}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. add-sqr-sqrt79.5%

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

        \[\leadsto \frac{\color{blue}{{\left(\sqrt{\sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)}}\right)}^{2}} - b}{a \cdot 2} \]
      3. pow1/279.5%

        \[\leadsto \frac{{\left(\sqrt{\color{blue}{{\left(\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)\right)}^{0.5}}}\right)}^{2} - b}{a \cdot 2} \]
      4. sqrt-pow179.5%

        \[\leadsto \frac{{\color{blue}{\left({\left(\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)\right)}^{\left(\frac{0.5}{2}\right)}\right)}}^{2} - b}{a \cdot 2} \]
      5. pow279.5%

        \[\leadsto \frac{{\left({\left(\mathsf{fma}\left(a, c \cdot -4, \color{blue}{{b}^{2}}\right)\right)}^{\left(\frac{0.5}{2}\right)}\right)}^{2} - b}{a \cdot 2} \]
      6. metadata-eval79.5%

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

      \[\leadsto \frac{\color{blue}{{\left({\left(\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)\right)}^{0.25}\right)}^{2}} - b}{a \cdot 2} \]
    7. Step-by-step derivation
      1. flip--79.9%

        \[\leadsto \frac{\color{blue}{\frac{{\left({\left(\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)\right)}^{0.25}\right)}^{2} \cdot {\left({\left(\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)\right)}^{0.25}\right)}^{2} - b \cdot b}{{\left({\left(\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)\right)}^{0.25}\right)}^{2} + b}}}{a \cdot 2} \]
      2. pow-pow80.6%

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

        \[\leadsto \frac{\frac{{\left(\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)\right)}^{\color{blue}{0.5}} \cdot {\left({\left(\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)\right)}^{0.25}\right)}^{2} - b \cdot b}{{\left({\left(\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)\right)}^{0.25}\right)}^{2} + b}}{a \cdot 2} \]
      4. pow1/280.6%

        \[\leadsto \frac{\frac{\color{blue}{\sqrt{\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)}} \cdot {\left({\left(\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)\right)}^{0.25}\right)}^{2} - b \cdot b}{{\left({\left(\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)\right)}^{0.25}\right)}^{2} + b}}{a \cdot 2} \]
      5. pow-pow80.7%

        \[\leadsto \frac{\frac{\sqrt{\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)} \cdot \color{blue}{{\left(\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)\right)}^{\left(0.25 \cdot 2\right)}} - b \cdot b}{{\left({\left(\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)\right)}^{0.25}\right)}^{2} + b}}{a \cdot 2} \]
      6. metadata-eval80.7%

        \[\leadsto \frac{\frac{\sqrt{\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)} \cdot {\left(\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)\right)}^{\color{blue}{0.5}} - b \cdot b}{{\left({\left(\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)\right)}^{0.25}\right)}^{2} + b}}{a \cdot 2} \]
      7. pow1/280.7%

        \[\leadsto \frac{\frac{\sqrt{\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)} \cdot \color{blue}{\sqrt{\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)}} - b \cdot b}{{\left({\left(\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)\right)}^{0.25}\right)}^{2} + b}}{a \cdot 2} \]
      8. add-sqr-sqrt81.8%

        \[\leadsto \frac{\frac{\color{blue}{\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)} - b \cdot b}{{\left({\left(\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)\right)}^{0.25}\right)}^{2} + b}}{a \cdot 2} \]
      9. unpow281.8%

        \[\leadsto \frac{\frac{\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right) - \color{blue}{{b}^{2}}}{{\left({\left(\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)\right)}^{0.25}\right)}^{2} + b}}{a \cdot 2} \]
      10. pow-pow81.8%

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

        \[\leadsto \frac{\frac{\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right) - {b}^{2}}{{\left(\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)\right)}^{\color{blue}{0.5}} + b}}{a \cdot 2} \]
      12. pow1/281.8%

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

      \[\leadsto \frac{\color{blue}{\frac{\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right) - {b}^{2}}{\sqrt{\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)} + b}}}{a \cdot 2} \]
    9. Step-by-step derivation
      1. fma-define81.8%

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

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

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

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

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

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

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

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

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

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

    if 5.20000000000000018 < b

    1. Initial program 46.1%

      \[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a} \]
    2. Step-by-step derivation
      1. *-commutative46.1%

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

      \[\leadsto \color{blue}{\frac{\sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)} - b}{a \cdot 2}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. add-sqr-sqrt45.3%

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

        \[\leadsto \frac{\color{blue}{{\left(\sqrt{\sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)}}\right)}^{2}} - b}{a \cdot 2} \]
      3. pow1/245.3%

        \[\leadsto \frac{{\left(\sqrt{\color{blue}{{\left(\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)\right)}^{0.5}}}\right)}^{2} - b}{a \cdot 2} \]
      4. sqrt-pow145.7%

        \[\leadsto \frac{{\color{blue}{\left({\left(\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)\right)}^{\left(\frac{0.5}{2}\right)}\right)}}^{2} - b}{a \cdot 2} \]
      5. pow245.7%

        \[\leadsto \frac{{\left({\left(\mathsf{fma}\left(a, c \cdot -4, \color{blue}{{b}^{2}}\right)\right)}^{\left(\frac{0.5}{2}\right)}\right)}^{2} - b}{a \cdot 2} \]
      6. metadata-eval45.7%

        \[\leadsto \frac{{\left({\left(\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)\right)}^{\color{blue}{0.25}}\right)}^{2} - b}{a \cdot 2} \]
    6. Applied egg-rr45.7%

      \[\leadsto \frac{\color{blue}{{\left({\left(\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)\right)}^{0.25}\right)}^{2}} - b}{a \cdot 2} \]
    7. Step-by-step derivation
      1. div-sub45.7%

        \[\leadsto \color{blue}{\frac{{\left({\left(\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)\right)}^{0.25}\right)}^{2}}{a \cdot 2} - \frac{b}{a \cdot 2}} \]
      2. pow-pow45.7%

        \[\leadsto \frac{\color{blue}{{\left(\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)\right)}^{\left(0.25 \cdot 2\right)}}}{a \cdot 2} - \frac{b}{a \cdot 2} \]
      3. metadata-eval45.7%

        \[\leadsto \frac{{\left(\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)\right)}^{\color{blue}{0.5}}}{a \cdot 2} - \frac{b}{a \cdot 2} \]
      4. pow1/245.7%

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

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

      \[\leadsto \color{blue}{-2 \cdot \frac{{a}^{2} \cdot {c}^{3}}{{b}^{5}} + \left(-1 \cdot \frac{c}{b} + -1 \cdot \frac{a \cdot {c}^{2}}{{b}^{3}}\right)} \]
    10. Step-by-step derivation
      1. associate-+r+93.9%

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

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

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

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

        \[\leadsto \color{blue}{\left(-2 \cdot \frac{{a}^{2} \cdot {c}^{3}}{{b}^{5}} - \frac{c}{b}\right)} - \frac{a \cdot {c}^{2}}{{b}^{3}} \]
      6. associate-/l*93.9%

        \[\leadsto \left(-2 \cdot \color{blue}{\left({a}^{2} \cdot \frac{{c}^{3}}{{b}^{5}}\right)} - \frac{c}{b}\right) - \frac{a \cdot {c}^{2}}{{b}^{3}} \]
      7. associate-/l*93.9%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq 5.2:\\ \;\;\;\;\frac{\frac{\mathsf{fma}\left(-4, a \cdot c, {b}^{2}\right) - {b}^{2}}{b + \sqrt{\mathsf{fma}\left(-4, a \cdot c, {b}^{2}\right)}}}{a \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;\left(-2 \cdot \left({a}^{2} \cdot \frac{{c}^{3}}{{b}^{5}}\right) - \frac{c}{b}\right) - a \cdot \frac{{c}^{2}}{{b}^{3}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 89.8% accurate, 0.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)\\ \mathbf{if}\;b \leq 5.2:\\ \;\;\;\;\frac{\frac{t\_0 - {b}^{2}}{b + \sqrt{t\_0}}}{a \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;\left(-2 \cdot \left({a}^{2} \cdot \frac{{c}^{3}}{{b}^{5}}\right) - \frac{c}{b}\right) - a \cdot \frac{{c}^{2}}{{b}^{3}}\\ \end{array} \end{array} \]
(FPCore (a b c)
 :precision binary64
 (let* ((t_0 (fma a (* c -4.0) (pow b 2.0))))
   (if (<= b 5.2)
     (/ (/ (- t_0 (pow b 2.0)) (+ b (sqrt t_0))) (* a 2.0))
     (-
      (- (* -2.0 (* (pow a 2.0) (/ (pow c 3.0) (pow b 5.0)))) (/ c b))
      (* a (/ (pow c 2.0) (pow b 3.0)))))))
double code(double a, double b, double c) {
	double t_0 = fma(a, (c * -4.0), pow(b, 2.0));
	double tmp;
	if (b <= 5.2) {
		tmp = ((t_0 - pow(b, 2.0)) / (b + sqrt(t_0))) / (a * 2.0);
	} else {
		tmp = ((-2.0 * (pow(a, 2.0) * (pow(c, 3.0) / pow(b, 5.0)))) - (c / b)) - (a * (pow(c, 2.0) / pow(b, 3.0)));
	}
	return tmp;
}
function code(a, b, c)
	t_0 = fma(a, Float64(c * -4.0), (b ^ 2.0))
	tmp = 0.0
	if (b <= 5.2)
		tmp = Float64(Float64(Float64(t_0 - (b ^ 2.0)) / Float64(b + sqrt(t_0))) / Float64(a * 2.0));
	else
		tmp = Float64(Float64(Float64(-2.0 * Float64((a ^ 2.0) * Float64((c ^ 3.0) / (b ^ 5.0)))) - Float64(c / b)) - Float64(a * Float64((c ^ 2.0) / (b ^ 3.0))));
	end
	return tmp
end
code[a_, b_, c_] := Block[{t$95$0 = N[(a * N[(c * -4.0), $MachinePrecision] + N[Power[b, 2.0], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, 5.2], N[(N[(N[(t$95$0 - N[Power[b, 2.0], $MachinePrecision]), $MachinePrecision] / N[(b + N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(a * 2.0), $MachinePrecision]), $MachinePrecision], N[(N[(N[(-2.0 * N[(N[Power[a, 2.0], $MachinePrecision] * N[(N[Power[c, 3.0], $MachinePrecision] / N[Power[b, 5.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(c / b), $MachinePrecision]), $MachinePrecision] - N[(a * N[(N[Power[c, 2.0], $MachinePrecision] / N[Power[b, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)\\
\mathbf{if}\;b \leq 5.2:\\
\;\;\;\;\frac{\frac{t\_0 - {b}^{2}}{b + \sqrt{t\_0}}}{a \cdot 2}\\

\mathbf{else}:\\
\;\;\;\;\left(-2 \cdot \left({a}^{2} \cdot \frac{{c}^{3}}{{b}^{5}}\right) - \frac{c}{b}\right) - a \cdot \frac{{c}^{2}}{{b}^{3}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if b < 5.20000000000000018

    1. Initial program 80.6%

      \[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a} \]
    2. Step-by-step derivation
      1. *-commutative80.6%

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

      \[\leadsto \color{blue}{\frac{\sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)} - b}{a \cdot 2}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. add-cbrt-cube79.0%

        \[\leadsto \frac{\color{blue}{\sqrt[3]{\left(\sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)} \cdot \sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)}\right) \cdot \sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)}}} - b}{a \cdot 2} \]
      2. pow1/378.5%

        \[\leadsto \frac{\color{blue}{{\left(\left(\sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)} \cdot \sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)}\right) \cdot \sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)}\right)}^{0.3333333333333333}} - b}{a \cdot 2} \]
      3. pow378.6%

        \[\leadsto \frac{{\color{blue}{\left({\left(\sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)}\right)}^{3}\right)}}^{0.3333333333333333} - b}{a \cdot 2} \]
      4. sqrt-pow278.5%

        \[\leadsto \frac{{\color{blue}{\left({\left(\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)\right)}^{\left(\frac{3}{2}\right)}\right)}}^{0.3333333333333333} - b}{a \cdot 2} \]
      5. pow278.5%

        \[\leadsto \frac{{\left({\left(\mathsf{fma}\left(a, c \cdot -4, \color{blue}{{b}^{2}}\right)\right)}^{\left(\frac{3}{2}\right)}\right)}^{0.3333333333333333} - b}{a \cdot 2} \]
      6. metadata-eval78.5%

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

      \[\leadsto \frac{\color{blue}{{\left({\left(\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)\right)}^{1.5}\right)}^{0.3333333333333333}} - b}{a \cdot 2} \]
    7. Step-by-step derivation
      1. unpow1/379.2%

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

      \[\leadsto \frac{\color{blue}{\sqrt[3]{{\left(\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)\right)}^{1.5}}} - b}{a \cdot 2} \]
    9. Step-by-step derivation
      1. flip--79.2%

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

        \[\leadsto \frac{\frac{\color{blue}{\sqrt[3]{{\left(\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)\right)}^{1.5} \cdot {\left(\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)\right)}^{1.5}}} - b \cdot b}{\sqrt[3]{{\left(\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)\right)}^{1.5}} + b}}{a \cdot 2} \]
      3. pow-prod-up80.3%

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

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

        \[\leadsto \frac{\frac{\sqrt[3]{\color{blue}{\left(\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right) \cdot \mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)\right) \cdot \mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)}} - b \cdot b}{\sqrt[3]{{\left(\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)\right)}^{1.5}} + b}}{a \cdot 2} \]
      6. add-cbrt-cube81.8%

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

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

        \[\leadsto \frac{\frac{\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right) - {b}^{2}}{\color{blue}{{\left({\left(\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)\right)}^{1.5}\right)}^{0.3333333333333333}} + b}}{a \cdot 2} \]
      9. pow-pow81.8%

        \[\leadsto \frac{\frac{\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right) - {b}^{2}}{\color{blue}{{\left(\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)\right)}^{\left(1.5 \cdot 0.3333333333333333\right)}} + b}}{a \cdot 2} \]
      10. metadata-eval81.8%

        \[\leadsto \frac{\frac{\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right) - {b}^{2}}{{\left(\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)\right)}^{\color{blue}{0.5}} + b}}{a \cdot 2} \]
      11. pow1/281.8%

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

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

    if 5.20000000000000018 < b

    1. Initial program 46.1%

      \[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a} \]
    2. Step-by-step derivation
      1. *-commutative46.1%

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

      \[\leadsto \color{blue}{\frac{\sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)} - b}{a \cdot 2}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. add-sqr-sqrt45.3%

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

        \[\leadsto \frac{\color{blue}{{\left(\sqrt{\sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)}}\right)}^{2}} - b}{a \cdot 2} \]
      3. pow1/245.3%

        \[\leadsto \frac{{\left(\sqrt{\color{blue}{{\left(\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)\right)}^{0.5}}}\right)}^{2} - b}{a \cdot 2} \]
      4. sqrt-pow145.7%

        \[\leadsto \frac{{\color{blue}{\left({\left(\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)\right)}^{\left(\frac{0.5}{2}\right)}\right)}}^{2} - b}{a \cdot 2} \]
      5. pow245.7%

        \[\leadsto \frac{{\left({\left(\mathsf{fma}\left(a, c \cdot -4, \color{blue}{{b}^{2}}\right)\right)}^{\left(\frac{0.5}{2}\right)}\right)}^{2} - b}{a \cdot 2} \]
      6. metadata-eval45.7%

        \[\leadsto \frac{{\left({\left(\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)\right)}^{\color{blue}{0.25}}\right)}^{2} - b}{a \cdot 2} \]
    6. Applied egg-rr45.7%

      \[\leadsto \frac{\color{blue}{{\left({\left(\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)\right)}^{0.25}\right)}^{2}} - b}{a \cdot 2} \]
    7. Step-by-step derivation
      1. div-sub45.7%

        \[\leadsto \color{blue}{\frac{{\left({\left(\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)\right)}^{0.25}\right)}^{2}}{a \cdot 2} - \frac{b}{a \cdot 2}} \]
      2. pow-pow45.7%

        \[\leadsto \frac{\color{blue}{{\left(\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)\right)}^{\left(0.25 \cdot 2\right)}}}{a \cdot 2} - \frac{b}{a \cdot 2} \]
      3. metadata-eval45.7%

        \[\leadsto \frac{{\left(\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)\right)}^{\color{blue}{0.5}}}{a \cdot 2} - \frac{b}{a \cdot 2} \]
      4. pow1/245.7%

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

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

      \[\leadsto \color{blue}{-2 \cdot \frac{{a}^{2} \cdot {c}^{3}}{{b}^{5}} + \left(-1 \cdot \frac{c}{b} + -1 \cdot \frac{a \cdot {c}^{2}}{{b}^{3}}\right)} \]
    10. Step-by-step derivation
      1. associate-+r+93.9%

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

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

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

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

        \[\leadsto \color{blue}{\left(-2 \cdot \frac{{a}^{2} \cdot {c}^{3}}{{b}^{5}} - \frac{c}{b}\right)} - \frac{a \cdot {c}^{2}}{{b}^{3}} \]
      6. associate-/l*93.9%

        \[\leadsto \left(-2 \cdot \color{blue}{\left({a}^{2} \cdot \frac{{c}^{3}}{{b}^{5}}\right)} - \frac{c}{b}\right) - \frac{a \cdot {c}^{2}}{{b}^{3}} \]
      7. associate-/l*93.9%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq 5.2:\\ \;\;\;\;\frac{\frac{\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right) - {b}^{2}}{b + \sqrt{\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)}}}{a \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;\left(-2 \cdot \left({a}^{2} \cdot \frac{{c}^{3}}{{b}^{5}}\right) - \frac{c}{b}\right) - a \cdot \frac{{c}^{2}}{{b}^{3}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 89.8% accurate, 0.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq 0.35:\\ \;\;\;\;\frac{1}{a \cdot -2} \cdot \left(b - \sqrt{\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;\left(-2 \cdot \left({a}^{2} \cdot \frac{{c}^{3}}{{b}^{5}}\right) - \frac{c}{b}\right) - a \cdot \frac{{c}^{2}}{{b}^{3}}\\ \end{array} \end{array} \]
(FPCore (a b c)
 :precision binary64
 (if (<= b 0.35)
   (* (/ 1.0 (* a -2.0)) (- b (sqrt (fma a (* c -4.0) (pow b 2.0)))))
   (-
    (- (* -2.0 (* (pow a 2.0) (/ (pow c 3.0) (pow b 5.0)))) (/ c b))
    (* a (/ (pow c 2.0) (pow b 3.0))))))
double code(double a, double b, double c) {
	double tmp;
	if (b <= 0.35) {
		tmp = (1.0 / (a * -2.0)) * (b - sqrt(fma(a, (c * -4.0), pow(b, 2.0))));
	} else {
		tmp = ((-2.0 * (pow(a, 2.0) * (pow(c, 3.0) / pow(b, 5.0)))) - (c / b)) - (a * (pow(c, 2.0) / pow(b, 3.0)));
	}
	return tmp;
}
function code(a, b, c)
	tmp = 0.0
	if (b <= 0.35)
		tmp = Float64(Float64(1.0 / Float64(a * -2.0)) * Float64(b - sqrt(fma(a, Float64(c * -4.0), (b ^ 2.0)))));
	else
		tmp = Float64(Float64(Float64(-2.0 * Float64((a ^ 2.0) * Float64((c ^ 3.0) / (b ^ 5.0)))) - Float64(c / b)) - Float64(a * Float64((c ^ 2.0) / (b ^ 3.0))));
	end
	return tmp
end
code[a_, b_, c_] := If[LessEqual[b, 0.35], N[(N[(1.0 / N[(a * -2.0), $MachinePrecision]), $MachinePrecision] * N[(b - N[Sqrt[N[(a * N[(c * -4.0), $MachinePrecision] + N[Power[b, 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(-2.0 * N[(N[Power[a, 2.0], $MachinePrecision] * N[(N[Power[c, 3.0], $MachinePrecision] / N[Power[b, 5.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(c / b), $MachinePrecision]), $MachinePrecision] - N[(a * N[(N[Power[c, 2.0], $MachinePrecision] / N[Power[b, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;b \leq 0.35:\\
\;\;\;\;\frac{1}{a \cdot -2} \cdot \left(b - \sqrt{\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)}\right)\\

\mathbf{else}:\\
\;\;\;\;\left(-2 \cdot \left({a}^{2} \cdot \frac{{c}^{3}}{{b}^{5}}\right) - \frac{c}{b}\right) - a \cdot \frac{{c}^{2}}{{b}^{3}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if b < 0.34999999999999998

    1. Initial program 86.0%

      \[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a} \]
    2. Step-by-step derivation
      1. *-commutative86.0%

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

      \[\leadsto \color{blue}{\frac{\sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)} - b}{a \cdot 2}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. frac-2neg86.1%

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

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

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

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

        \[\leadsto \left(\left(-\sqrt{\mathsf{fma}\left(a, c \cdot -4, \color{blue}{{b}^{2}}\right)}\right) + \left(-\left(-b\right)\right)\right) \cdot \frac{1}{-a \cdot 2} \]
      6. add-sqr-sqrt0.0%

        \[\leadsto \left(\left(-\sqrt{\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)}\right) + \left(-\color{blue}{\sqrt{-b} \cdot \sqrt{-b}}\right)\right) \cdot \frac{1}{-a \cdot 2} \]
      7. sqrt-unprod1.6%

        \[\leadsto \left(\left(-\sqrt{\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)}\right) + \left(-\color{blue}{\sqrt{\left(-b\right) \cdot \left(-b\right)}}\right)\right) \cdot \frac{1}{-a \cdot 2} \]
      8. sqr-neg1.6%

        \[\leadsto \left(\left(-\sqrt{\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)}\right) + \left(-\sqrt{\color{blue}{b \cdot b}}\right)\right) \cdot \frac{1}{-a \cdot 2} \]
      9. sqrt-prod1.6%

        \[\leadsto \left(\left(-\sqrt{\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)}\right) + \left(-\color{blue}{\sqrt{b} \cdot \sqrt{b}}\right)\right) \cdot \frac{1}{-a \cdot 2} \]
      10. add-sqr-sqrt1.6%

        \[\leadsto \left(\left(-\sqrt{\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)}\right) + \left(-\color{blue}{b}\right)\right) \cdot \frac{1}{-a \cdot 2} \]
      11. add-sqr-sqrt0.0%

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

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

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

        \[\leadsto \left(\left(-\sqrt{\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)}\right) + \color{blue}{\sqrt{b} \cdot \sqrt{b}}\right) \cdot \frac{1}{-a \cdot 2} \]
      15. add-sqr-sqrt86.3%

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

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

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

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

    if 0.34999999999999998 < b

    1. Initial program 49.9%

      \[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a} \]
    2. Step-by-step derivation
      1. *-commutative49.9%

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

      \[\leadsto \color{blue}{\frac{\sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)} - b}{a \cdot 2}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. add-sqr-sqrt49.1%

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

        \[\leadsto \frac{\color{blue}{{\left(\sqrt{\sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)}}\right)}^{2}} - b}{a \cdot 2} \]
      3. pow1/249.2%

        \[\leadsto \frac{{\left(\sqrt{\color{blue}{{\left(\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)\right)}^{0.5}}}\right)}^{2} - b}{a \cdot 2} \]
      4. sqrt-pow149.5%

        \[\leadsto \frac{{\color{blue}{\left({\left(\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)\right)}^{\left(\frac{0.5}{2}\right)}\right)}}^{2} - b}{a \cdot 2} \]
      5. pow249.5%

        \[\leadsto \frac{{\left({\left(\mathsf{fma}\left(a, c \cdot -4, \color{blue}{{b}^{2}}\right)\right)}^{\left(\frac{0.5}{2}\right)}\right)}^{2} - b}{a \cdot 2} \]
      6. metadata-eval49.5%

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

      \[\leadsto \frac{\color{blue}{{\left({\left(\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)\right)}^{0.25}\right)}^{2}} - b}{a \cdot 2} \]
    7. Step-by-step derivation
      1. div-sub49.4%

        \[\leadsto \color{blue}{\frac{{\left({\left(\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)\right)}^{0.25}\right)}^{2}}{a \cdot 2} - \frac{b}{a \cdot 2}} \]
      2. pow-pow49.6%

        \[\leadsto \frac{\color{blue}{{\left(\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)\right)}^{\left(0.25 \cdot 2\right)}}}{a \cdot 2} - \frac{b}{a \cdot 2} \]
      3. metadata-eval49.6%

        \[\leadsto \frac{{\left(\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)\right)}^{\color{blue}{0.5}}}{a \cdot 2} - \frac{b}{a \cdot 2} \]
      4. pow1/249.6%

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

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

      \[\leadsto \color{blue}{-2 \cdot \frac{{a}^{2} \cdot {c}^{3}}{{b}^{5}} + \left(-1 \cdot \frac{c}{b} + -1 \cdot \frac{a \cdot {c}^{2}}{{b}^{3}}\right)} \]
    10. Step-by-step derivation
      1. associate-+r+91.5%

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

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

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

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

        \[\leadsto \color{blue}{\left(-2 \cdot \frac{{a}^{2} \cdot {c}^{3}}{{b}^{5}} - \frac{c}{b}\right)} - \frac{a \cdot {c}^{2}}{{b}^{3}} \]
      6. associate-/l*91.5%

        \[\leadsto \left(-2 \cdot \color{blue}{\left({a}^{2} \cdot \frac{{c}^{3}}{{b}^{5}}\right)} - \frac{c}{b}\right) - \frac{a \cdot {c}^{2}}{{b}^{3}} \]
      7. associate-/l*91.5%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq 0.35:\\ \;\;\;\;\frac{1}{a \cdot -2} \cdot \left(b - \sqrt{\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;\left(-2 \cdot \left({a}^{2} \cdot \frac{{c}^{3}}{{b}^{5}}\right) - \frac{c}{b}\right) - a \cdot \frac{{c}^{2}}{{b}^{3}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 85.5% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq 25.5:\\ \;\;\;\;\frac{1}{a \cdot -2} \cdot \left(b - \sqrt{\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{c}{-b} - \frac{a \cdot {c}^{2}}{{b}^{3}}\\ \end{array} \end{array} \]
(FPCore (a b c)
 :precision binary64
 (if (<= b 25.5)
   (* (/ 1.0 (* a -2.0)) (- b (sqrt (fma a (* c -4.0) (pow b 2.0)))))
   (- (/ c (- b)) (/ (* a (pow c 2.0)) (pow b 3.0)))))
double code(double a, double b, double c) {
	double tmp;
	if (b <= 25.5) {
		tmp = (1.0 / (a * -2.0)) * (b - sqrt(fma(a, (c * -4.0), pow(b, 2.0))));
	} else {
		tmp = (c / -b) - ((a * pow(c, 2.0)) / pow(b, 3.0));
	}
	return tmp;
}
function code(a, b, c)
	tmp = 0.0
	if (b <= 25.5)
		tmp = Float64(Float64(1.0 / Float64(a * -2.0)) * Float64(b - sqrt(fma(a, Float64(c * -4.0), (b ^ 2.0)))));
	else
		tmp = Float64(Float64(c / Float64(-b)) - Float64(Float64(a * (c ^ 2.0)) / (b ^ 3.0)));
	end
	return tmp
end
code[a_, b_, c_] := If[LessEqual[b, 25.5], N[(N[(1.0 / N[(a * -2.0), $MachinePrecision]), $MachinePrecision] * N[(b - N[Sqrt[N[(a * N[(c * -4.0), $MachinePrecision] + N[Power[b, 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(c / (-b)), $MachinePrecision] - N[(N[(a * N[Power[c, 2.0], $MachinePrecision]), $MachinePrecision] / N[Power[b, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;b \leq 25.5:\\
\;\;\;\;\frac{1}{a \cdot -2} \cdot \left(b - \sqrt{\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)}\right)\\

\mathbf{else}:\\
\;\;\;\;\frac{c}{-b} - \frac{a \cdot {c}^{2}}{{b}^{3}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if b < 25.5

    1. Initial program 78.9%

      \[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a} \]
    2. Step-by-step derivation
      1. *-commutative78.9%

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

      \[\leadsto \color{blue}{\frac{\sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)} - b}{a \cdot 2}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. frac-2neg79.0%

        \[\leadsto \color{blue}{\frac{-\left(\sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)} - b\right)}{-a \cdot 2}} \]
      2. div-inv79.0%

        \[\leadsto \color{blue}{\left(-\left(\sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)} - b\right)\right) \cdot \frac{1}{-a \cdot 2}} \]
      3. sub-neg79.0%

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

        \[\leadsto \color{blue}{\left(\left(-\sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)}\right) + \left(-\left(-b\right)\right)\right)} \cdot \frac{1}{-a \cdot 2} \]
      5. pow279.0%

        \[\leadsto \left(\left(-\sqrt{\mathsf{fma}\left(a, c \cdot -4, \color{blue}{{b}^{2}}\right)}\right) + \left(-\left(-b\right)\right)\right) \cdot \frac{1}{-a \cdot 2} \]
      6. add-sqr-sqrt0.0%

        \[\leadsto \left(\left(-\sqrt{\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)}\right) + \left(-\color{blue}{\sqrt{-b} \cdot \sqrt{-b}}\right)\right) \cdot \frac{1}{-a \cdot 2} \]
      7. sqrt-unprod1.6%

        \[\leadsto \left(\left(-\sqrt{\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)}\right) + \left(-\color{blue}{\sqrt{\left(-b\right) \cdot \left(-b\right)}}\right)\right) \cdot \frac{1}{-a \cdot 2} \]
      8. sqr-neg1.6%

        \[\leadsto \left(\left(-\sqrt{\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)}\right) + \left(-\sqrt{\color{blue}{b \cdot b}}\right)\right) \cdot \frac{1}{-a \cdot 2} \]
      9. sqrt-prod1.6%

        \[\leadsto \left(\left(-\sqrt{\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)}\right) + \left(-\color{blue}{\sqrt{b} \cdot \sqrt{b}}\right)\right) \cdot \frac{1}{-a \cdot 2} \]
      10. add-sqr-sqrt1.6%

        \[\leadsto \left(\left(-\sqrt{\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)}\right) + \left(-\color{blue}{b}\right)\right) \cdot \frac{1}{-a \cdot 2} \]
      11. add-sqr-sqrt0.0%

        \[\leadsto \left(\left(-\sqrt{\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)}\right) + \color{blue}{\sqrt{-b} \cdot \sqrt{-b}}\right) \cdot \frac{1}{-a \cdot 2} \]
      12. sqrt-unprod79.0%

        \[\leadsto \left(\left(-\sqrt{\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)}\right) + \color{blue}{\sqrt{\left(-b\right) \cdot \left(-b\right)}}\right) \cdot \frac{1}{-a \cdot 2} \]
      13. sqr-neg79.0%

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

        \[\leadsto \left(\left(-\sqrt{\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)}\right) + \color{blue}{\sqrt{b} \cdot \sqrt{b}}\right) \cdot \frac{1}{-a \cdot 2} \]
      15. add-sqr-sqrt79.0%

        \[\leadsto \left(\left(-\sqrt{\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)}\right) + \color{blue}{b}\right) \cdot \frac{1}{-a \cdot 2} \]
      16. distribute-rgt-neg-in79.0%

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

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

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

    if 25.5 < b

    1. Initial program 44.3%

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

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

      \[\leadsto \color{blue}{\frac{\sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)} - b}{a \cdot 2}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. frac-2neg44.3%

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

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

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

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

        \[\leadsto \left(\left(-\sqrt{\mathsf{fma}\left(a, c \cdot -4, \color{blue}{{b}^{2}}\right)}\right) + \left(-\left(-b\right)\right)\right) \cdot \frac{1}{-a \cdot 2} \]
      6. add-sqr-sqrt0.0%

        \[\leadsto \left(\left(-\sqrt{\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)}\right) + \left(-\color{blue}{\sqrt{-b} \cdot \sqrt{-b}}\right)\right) \cdot \frac{1}{-a \cdot 2} \]
      7. sqrt-unprod1.6%

        \[\leadsto \left(\left(-\sqrt{\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)}\right) + \left(-\color{blue}{\sqrt{\left(-b\right) \cdot \left(-b\right)}}\right)\right) \cdot \frac{1}{-a \cdot 2} \]
      8. sqr-neg1.6%

        \[\leadsto \left(\left(-\sqrt{\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)}\right) + \left(-\sqrt{\color{blue}{b \cdot b}}\right)\right) \cdot \frac{1}{-a \cdot 2} \]
      9. sqrt-prod1.6%

        \[\leadsto \left(\left(-\sqrt{\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)}\right) + \left(-\color{blue}{\sqrt{b} \cdot \sqrt{b}}\right)\right) \cdot \frac{1}{-a \cdot 2} \]
      10. add-sqr-sqrt1.6%

        \[\leadsto \left(\left(-\sqrt{\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)}\right) + \left(-\color{blue}{b}\right)\right) \cdot \frac{1}{-a \cdot 2} \]
      11. add-sqr-sqrt0.0%

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

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

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

        \[\leadsto \left(\left(-\sqrt{\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)}\right) + \color{blue}{\sqrt{b} \cdot \sqrt{b}}\right) \cdot \frac{1}{-a \cdot 2} \]
      15. add-sqr-sqrt44.3%

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

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

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

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

      \[\leadsto \color{blue}{-1 \cdot \frac{c}{b} + -1 \cdot \frac{a \cdot {c}^{2}}{{b}^{3}}} \]
    8. Step-by-step derivation
      1. mul-1-neg91.0%

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

        \[\leadsto \color{blue}{-1 \cdot \frac{c}{b} - \frac{a \cdot {c}^{2}}{{b}^{3}}} \]
      3. mul-1-neg91.0%

        \[\leadsto \color{blue}{\left(-\frac{c}{b}\right)} - \frac{a \cdot {c}^{2}}{{b}^{3}} \]
      4. distribute-neg-frac291.0%

        \[\leadsto \color{blue}{\frac{c}{-b}} - \frac{a \cdot {c}^{2}}{{b}^{3}} \]
    9. Simplified91.0%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq 25.5:\\ \;\;\;\;\frac{1}{a \cdot -2} \cdot \left(b - \sqrt{\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{c}{-b} - \frac{a \cdot {c}^{2}}{{b}^{3}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 11: 76.3% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{\sqrt{b \cdot b - c \cdot \left(a \cdot 4\right)} - b}{a \cdot 2}\\ \mathbf{if}\;t\_0 \leq -8 \cdot 10^{-7}:\\ \;\;\;\;t\_0\\ \mathbf{else}:\\ \;\;\;\;\frac{c}{-b}\\ \end{array} \end{array} \]
(FPCore (a b c)
 :precision binary64
 (let* ((t_0 (/ (- (sqrt (- (* b b) (* c (* a 4.0)))) b) (* a 2.0))))
   (if (<= t_0 -8e-7) t_0 (/ c (- b)))))
double code(double a, double b, double c) {
	double t_0 = (sqrt(((b * b) - (c * (a * 4.0)))) - b) / (a * 2.0);
	double tmp;
	if (t_0 <= -8e-7) {
		tmp = t_0;
	} else {
		tmp = 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) :: tmp
    t_0 = (sqrt(((b * b) - (c * (a * 4.0d0)))) - b) / (a * 2.0d0)
    if (t_0 <= (-8d-7)) then
        tmp = t_0
    else
        tmp = c / -b
    end if
    code = tmp
end function
public static double code(double a, double b, double c) {
	double t_0 = (Math.sqrt(((b * b) - (c * (a * 4.0)))) - b) / (a * 2.0);
	double tmp;
	if (t_0 <= -8e-7) {
		tmp = t_0;
	} else {
		tmp = c / -b;
	}
	return tmp;
}
def code(a, b, c):
	t_0 = (math.sqrt(((b * b) - (c * (a * 4.0)))) - b) / (a * 2.0)
	tmp = 0
	if t_0 <= -8e-7:
		tmp = t_0
	else:
		tmp = c / -b
	return tmp
function code(a, b, c)
	t_0 = Float64(Float64(sqrt(Float64(Float64(b * b) - Float64(c * Float64(a * 4.0)))) - b) / Float64(a * 2.0))
	tmp = 0.0
	if (t_0 <= -8e-7)
		tmp = t_0;
	else
		tmp = Float64(c / Float64(-b));
	end
	return tmp
end
function tmp_2 = code(a, b, c)
	t_0 = (sqrt(((b * b) - (c * (a * 4.0)))) - b) / (a * 2.0);
	tmp = 0.0;
	if (t_0 <= -8e-7)
		tmp = t_0;
	else
		tmp = c / -b;
	end
	tmp_2 = tmp;
end
code[a_, b_, c_] := Block[{t$95$0 = N[(N[(N[Sqrt[N[(N[(b * b), $MachinePrecision] - N[(c * N[(a * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision] / N[(a * 2.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -8e-7], t$95$0, N[(c / (-b)), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \frac{\sqrt{b \cdot b - c \cdot \left(a \cdot 4\right)} - b}{a \cdot 2}\\
\mathbf{if}\;t\_0 \leq -8 \cdot 10^{-7}:\\
\;\;\;\;t\_0\\

\mathbf{else}:\\
\;\;\;\;\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 4 a) c)))) (*.f64 2 a)) < -7.9999999999999996e-7

    1. Initial program 72.1%

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

    if -7.9999999999999996e-7 < (/.f64 (+.f64 (neg.f64 b) (sqrt.f64 (-.f64 (*.f64 b b) (*.f64 (*.f64 4 a) c)))) (*.f64 2 a))

    1. Initial program 28.2%

      \[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a} \]
    2. Step-by-step derivation
      1. *-commutative28.2%

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

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

      \[\leadsto \color{blue}{-1 \cdot \frac{c}{b}} \]
    6. Step-by-step derivation
      1. mul-1-neg85.7%

        \[\leadsto \color{blue}{-\frac{c}{b}} \]
      2. distribute-neg-frac285.7%

        \[\leadsto \color{blue}{\frac{c}{-b}} \]
    7. Simplified85.7%

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

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

Alternative 12: 85.5% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq 25.5:\\ \;\;\;\;\frac{\sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)} - b}{a \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;\frac{a \cdot {c}^{2}}{-{b}^{3}} - \frac{c}{b}\\ \end{array} \end{array} \]
(FPCore (a b c)
 :precision binary64
 (if (<= b 25.5)
   (/ (- (sqrt (fma a (* c -4.0) (* b b))) b) (* a 2.0))
   (- (/ (* a (pow c 2.0)) (- (pow b 3.0))) (/ c b))))
double code(double a, double b, double c) {
	double tmp;
	if (b <= 25.5) {
		tmp = (sqrt(fma(a, (c * -4.0), (b * b))) - b) / (a * 2.0);
	} else {
		tmp = ((a * pow(c, 2.0)) / -pow(b, 3.0)) - (c / b);
	}
	return tmp;
}
function code(a, b, c)
	tmp = 0.0
	if (b <= 25.5)
		tmp = Float64(Float64(sqrt(fma(a, Float64(c * -4.0), Float64(b * b))) - b) / Float64(a * 2.0));
	else
		tmp = Float64(Float64(Float64(a * (c ^ 2.0)) / Float64(-(b ^ 3.0))) - Float64(c / b));
	end
	return tmp
end
code[a_, b_, c_] := If[LessEqual[b, 25.5], N[(N[(N[Sqrt[N[(a * N[(c * -4.0), $MachinePrecision] + N[(b * b), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision] / N[(a * 2.0), $MachinePrecision]), $MachinePrecision], N[(N[(N[(a * N[Power[c, 2.0], $MachinePrecision]), $MachinePrecision] / (-N[Power[b, 3.0], $MachinePrecision])), $MachinePrecision] - N[(c / b), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;b \leq 25.5:\\
\;\;\;\;\frac{\sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)} - b}{a \cdot 2}\\

\mathbf{else}:\\
\;\;\;\;\frac{a \cdot {c}^{2}}{-{b}^{3}} - \frac{c}{b}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if b < 25.5

    1. Initial program 78.9%

      \[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a} \]
    2. Step-by-step derivation
      1. *-commutative78.9%

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

      \[\leadsto \color{blue}{\frac{\sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)} - b}{a \cdot 2}} \]
    4. Add Preprocessing

    if 25.5 < b

    1. Initial program 44.3%

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

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

      \[\leadsto \color{blue}{\frac{\sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)} - b}{a \cdot 2}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. frac-2neg44.3%

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

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

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

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

        \[\leadsto \left(\left(-\sqrt{\mathsf{fma}\left(a, c \cdot -4, \color{blue}{{b}^{2}}\right)}\right) + \left(-\left(-b\right)\right)\right) \cdot \frac{1}{-a \cdot 2} \]
      6. add-sqr-sqrt0.0%

        \[\leadsto \left(\left(-\sqrt{\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)}\right) + \left(-\color{blue}{\sqrt{-b} \cdot \sqrt{-b}}\right)\right) \cdot \frac{1}{-a \cdot 2} \]
      7. sqrt-unprod1.6%

        \[\leadsto \left(\left(-\sqrt{\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)}\right) + \left(-\color{blue}{\sqrt{\left(-b\right) \cdot \left(-b\right)}}\right)\right) \cdot \frac{1}{-a \cdot 2} \]
      8. sqr-neg1.6%

        \[\leadsto \left(\left(-\sqrt{\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)}\right) + \left(-\sqrt{\color{blue}{b \cdot b}}\right)\right) \cdot \frac{1}{-a \cdot 2} \]
      9. sqrt-prod1.6%

        \[\leadsto \left(\left(-\sqrt{\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)}\right) + \left(-\color{blue}{\sqrt{b} \cdot \sqrt{b}}\right)\right) \cdot \frac{1}{-a \cdot 2} \]
      10. add-sqr-sqrt1.6%

        \[\leadsto \left(\left(-\sqrt{\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)}\right) + \left(-\color{blue}{b}\right)\right) \cdot \frac{1}{-a \cdot 2} \]
      11. add-sqr-sqrt0.0%

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

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

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

        \[\leadsto \left(\left(-\sqrt{\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)}\right) + \color{blue}{\sqrt{b} \cdot \sqrt{b}}\right) \cdot \frac{1}{-a \cdot 2} \]
      15. add-sqr-sqrt44.3%

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

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

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

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

      \[\leadsto \color{blue}{-1 \cdot \frac{c}{b} + -1 \cdot \frac{a \cdot {c}^{2}}{{b}^{3}}} \]
    8. Step-by-step derivation
      1. mul-1-neg91.0%

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

        \[\leadsto \color{blue}{-1 \cdot \frac{c}{b} - \frac{a \cdot {c}^{2}}{{b}^{3}}} \]
      3. mul-1-neg91.0%

        \[\leadsto \color{blue}{\left(-\frac{c}{b}\right)} - \frac{a \cdot {c}^{2}}{{b}^{3}} \]
      4. distribute-neg-frac291.0%

        \[\leadsto \color{blue}{\frac{c}{-b}} - \frac{a \cdot {c}^{2}}{{b}^{3}} \]
    9. Simplified91.0%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq 25.5:\\ \;\;\;\;\frac{\sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)} - b}{a \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;\frac{a \cdot {c}^{2}}{-{b}^{3}} - \frac{c}{b}\\ \end{array} \]
  5. Add Preprocessing

Alternative 13: 85.6% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq 25.5:\\ \;\;\;\;\frac{\sqrt{\mathsf{fma}\left(b, b, c \cdot \left(a \cdot -4\right)\right)} - b}{a \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;\frac{a \cdot {c}^{2}}{-{b}^{3}} - \frac{c}{b}\\ \end{array} \end{array} \]
(FPCore (a b c)
 :precision binary64
 (if (<= b 25.5)
   (/ (- (sqrt (fma b b (* c (* a -4.0)))) b) (* a 2.0))
   (- (/ (* a (pow c 2.0)) (- (pow b 3.0))) (/ c b))))
double code(double a, double b, double c) {
	double tmp;
	if (b <= 25.5) {
		tmp = (sqrt(fma(b, b, (c * (a * -4.0)))) - b) / (a * 2.0);
	} else {
		tmp = ((a * pow(c, 2.0)) / -pow(b, 3.0)) - (c / b);
	}
	return tmp;
}
function code(a, b, c)
	tmp = 0.0
	if (b <= 25.5)
		tmp = Float64(Float64(sqrt(fma(b, b, Float64(c * Float64(a * -4.0)))) - b) / Float64(a * 2.0));
	else
		tmp = Float64(Float64(Float64(a * (c ^ 2.0)) / Float64(-(b ^ 3.0))) - Float64(c / b));
	end
	return tmp
end
code[a_, b_, c_] := If[LessEqual[b, 25.5], N[(N[(N[Sqrt[N[(b * b + N[(c * N[(a * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision] / N[(a * 2.0), $MachinePrecision]), $MachinePrecision], N[(N[(N[(a * N[Power[c, 2.0], $MachinePrecision]), $MachinePrecision] / (-N[Power[b, 3.0], $MachinePrecision])), $MachinePrecision] - N[(c / b), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;b \leq 25.5:\\
\;\;\;\;\frac{\sqrt{\mathsf{fma}\left(b, b, c \cdot \left(a \cdot -4\right)\right)} - b}{a \cdot 2}\\

\mathbf{else}:\\
\;\;\;\;\frac{a \cdot {c}^{2}}{-{b}^{3}} - \frac{c}{b}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if b < 25.5

    1. Initial program 78.9%

      \[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a} \]
    2. Step-by-step derivation
      1. *-commutative78.9%

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

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

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

        \[\leadsto \frac{\color{blue}{\sqrt{\left(-b\right) \cdot \left(-b\right) - \left(4 \cdot a\right) \cdot c} - b}}{a \cdot 2} \]
      5. sqr-neg78.9%

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

        \[\leadsto \frac{\sqrt{\color{blue}{\mathsf{fma}\left(b, b, -\left(4 \cdot a\right) \cdot c\right)}} - b}{a \cdot 2} \]
      7. distribute-lft-neg-in79.0%

        \[\leadsto \frac{\sqrt{\mathsf{fma}\left(b, b, \color{blue}{\left(-4 \cdot a\right) \cdot c}\right)} - b}{a \cdot 2} \]
      8. *-commutative79.0%

        \[\leadsto \frac{\sqrt{\mathsf{fma}\left(b, b, \color{blue}{c \cdot \left(-4 \cdot a\right)}\right)} - b}{a \cdot 2} \]
      9. *-commutative79.0%

        \[\leadsto \frac{\sqrt{\mathsf{fma}\left(b, b, c \cdot \left(-\color{blue}{a \cdot 4}\right)\right)} - b}{a \cdot 2} \]
      10. distribute-rgt-neg-in79.0%

        \[\leadsto \frac{\sqrt{\mathsf{fma}\left(b, b, c \cdot \color{blue}{\left(a \cdot \left(-4\right)\right)}\right)} - b}{a \cdot 2} \]
      11. metadata-eval79.0%

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

      \[\leadsto \color{blue}{\frac{\sqrt{\mathsf{fma}\left(b, b, c \cdot \left(a \cdot -4\right)\right)} - b}{a \cdot 2}} \]
    4. Add Preprocessing

    if 25.5 < b

    1. Initial program 44.3%

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

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

      \[\leadsto \color{blue}{\frac{\sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)} - b}{a \cdot 2}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. frac-2neg44.3%

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

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

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

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

        \[\leadsto \left(\left(-\sqrt{\mathsf{fma}\left(a, c \cdot -4, \color{blue}{{b}^{2}}\right)}\right) + \left(-\left(-b\right)\right)\right) \cdot \frac{1}{-a \cdot 2} \]
      6. add-sqr-sqrt0.0%

        \[\leadsto \left(\left(-\sqrt{\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)}\right) + \left(-\color{blue}{\sqrt{-b} \cdot \sqrt{-b}}\right)\right) \cdot \frac{1}{-a \cdot 2} \]
      7. sqrt-unprod1.6%

        \[\leadsto \left(\left(-\sqrt{\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)}\right) + \left(-\color{blue}{\sqrt{\left(-b\right) \cdot \left(-b\right)}}\right)\right) \cdot \frac{1}{-a \cdot 2} \]
      8. sqr-neg1.6%

        \[\leadsto \left(\left(-\sqrt{\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)}\right) + \left(-\sqrt{\color{blue}{b \cdot b}}\right)\right) \cdot \frac{1}{-a \cdot 2} \]
      9. sqrt-prod1.6%

        \[\leadsto \left(\left(-\sqrt{\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)}\right) + \left(-\color{blue}{\sqrt{b} \cdot \sqrt{b}}\right)\right) \cdot \frac{1}{-a \cdot 2} \]
      10. add-sqr-sqrt1.6%

        \[\leadsto \left(\left(-\sqrt{\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)}\right) + \left(-\color{blue}{b}\right)\right) \cdot \frac{1}{-a \cdot 2} \]
      11. add-sqr-sqrt0.0%

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

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

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

        \[\leadsto \left(\left(-\sqrt{\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)}\right) + \color{blue}{\sqrt{b} \cdot \sqrt{b}}\right) \cdot \frac{1}{-a \cdot 2} \]
      15. add-sqr-sqrt44.3%

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

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

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

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

      \[\leadsto \color{blue}{-1 \cdot \frac{c}{b} + -1 \cdot \frac{a \cdot {c}^{2}}{{b}^{3}}} \]
    8. Step-by-step derivation
      1. mul-1-neg91.0%

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

        \[\leadsto \color{blue}{-1 \cdot \frac{c}{b} - \frac{a \cdot {c}^{2}}{{b}^{3}}} \]
      3. mul-1-neg91.0%

        \[\leadsto \color{blue}{\left(-\frac{c}{b}\right)} - \frac{a \cdot {c}^{2}}{{b}^{3}} \]
      4. distribute-neg-frac291.0%

        \[\leadsto \color{blue}{\frac{c}{-b}} - \frac{a \cdot {c}^{2}}{{b}^{3}} \]
    9. Simplified91.0%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq 25.5:\\ \;\;\;\;\frac{\sqrt{\mathsf{fma}\left(b, b, c \cdot \left(a \cdot -4\right)\right)} - b}{a \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;\frac{a \cdot {c}^{2}}{-{b}^{3}} - \frac{c}{b}\\ \end{array} \]
  5. Add Preprocessing

Alternative 14: 85.5% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq 25.5:\\ \;\;\;\;\frac{\sqrt{b \cdot b - c \cdot \left(a \cdot 4\right)} - b}{a \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;\frac{c}{-b} - \frac{a \cdot {c}^{2}}{{b}^{3}}\\ \end{array} \end{array} \]
(FPCore (a b c)
 :precision binary64
 (if (<= b 25.5)
   (/ (- (sqrt (- (* b b) (* c (* a 4.0)))) b) (* a 2.0))
   (- (/ c (- b)) (/ (* a (pow c 2.0)) (pow b 3.0)))))
double code(double a, double b, double c) {
	double tmp;
	if (b <= 25.5) {
		tmp = (sqrt(((b * b) - (c * (a * 4.0)))) - b) / (a * 2.0);
	} else {
		tmp = (c / -b) - ((a * pow(c, 2.0)) / pow(b, 3.0));
	}
	return tmp;
}
real(8) function code(a, b, c)
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8) :: tmp
    if (b <= 25.5d0) then
        tmp = (sqrt(((b * b) - (c * (a * 4.0d0)))) - b) / (a * 2.0d0)
    else
        tmp = (c / -b) - ((a * (c ** 2.0d0)) / (b ** 3.0d0))
    end if
    code = tmp
end function
public static double code(double a, double b, double c) {
	double tmp;
	if (b <= 25.5) {
		tmp = (Math.sqrt(((b * b) - (c * (a * 4.0)))) - b) / (a * 2.0);
	} else {
		tmp = (c / -b) - ((a * Math.pow(c, 2.0)) / Math.pow(b, 3.0));
	}
	return tmp;
}
def code(a, b, c):
	tmp = 0
	if b <= 25.5:
		tmp = (math.sqrt(((b * b) - (c * (a * 4.0)))) - b) / (a * 2.0)
	else:
		tmp = (c / -b) - ((a * math.pow(c, 2.0)) / math.pow(b, 3.0))
	return tmp
function code(a, b, c)
	tmp = 0.0
	if (b <= 25.5)
		tmp = Float64(Float64(sqrt(Float64(Float64(b * b) - Float64(c * Float64(a * 4.0)))) - b) / Float64(a * 2.0));
	else
		tmp = Float64(Float64(c / Float64(-b)) - Float64(Float64(a * (c ^ 2.0)) / (b ^ 3.0)));
	end
	return tmp
end
function tmp_2 = code(a, b, c)
	tmp = 0.0;
	if (b <= 25.5)
		tmp = (sqrt(((b * b) - (c * (a * 4.0)))) - b) / (a * 2.0);
	else
		tmp = (c / -b) - ((a * (c ^ 2.0)) / (b ^ 3.0));
	end
	tmp_2 = tmp;
end
code[a_, b_, c_] := If[LessEqual[b, 25.5], N[(N[(N[Sqrt[N[(N[(b * b), $MachinePrecision] - N[(c * N[(a * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision] / N[(a * 2.0), $MachinePrecision]), $MachinePrecision], N[(N[(c / (-b)), $MachinePrecision] - N[(N[(a * N[Power[c, 2.0], $MachinePrecision]), $MachinePrecision] / N[Power[b, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;b \leq 25.5:\\
\;\;\;\;\frac{\sqrt{b \cdot b - c \cdot \left(a \cdot 4\right)} - b}{a \cdot 2}\\

\mathbf{else}:\\
\;\;\;\;\frac{c}{-b} - \frac{a \cdot {c}^{2}}{{b}^{3}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if b < 25.5

    1. Initial program 78.9%

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

    if 25.5 < b

    1. Initial program 44.3%

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

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

      \[\leadsto \color{blue}{\frac{\sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)} - b}{a \cdot 2}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. frac-2neg44.3%

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

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

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

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

        \[\leadsto \left(\left(-\sqrt{\mathsf{fma}\left(a, c \cdot -4, \color{blue}{{b}^{2}}\right)}\right) + \left(-\left(-b\right)\right)\right) \cdot \frac{1}{-a \cdot 2} \]
      6. add-sqr-sqrt0.0%

        \[\leadsto \left(\left(-\sqrt{\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)}\right) + \left(-\color{blue}{\sqrt{-b} \cdot \sqrt{-b}}\right)\right) \cdot \frac{1}{-a \cdot 2} \]
      7. sqrt-unprod1.6%

        \[\leadsto \left(\left(-\sqrt{\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)}\right) + \left(-\color{blue}{\sqrt{\left(-b\right) \cdot \left(-b\right)}}\right)\right) \cdot \frac{1}{-a \cdot 2} \]
      8. sqr-neg1.6%

        \[\leadsto \left(\left(-\sqrt{\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)}\right) + \left(-\sqrt{\color{blue}{b \cdot b}}\right)\right) \cdot \frac{1}{-a \cdot 2} \]
      9. sqrt-prod1.6%

        \[\leadsto \left(\left(-\sqrt{\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)}\right) + \left(-\color{blue}{\sqrt{b} \cdot \sqrt{b}}\right)\right) \cdot \frac{1}{-a \cdot 2} \]
      10. add-sqr-sqrt1.6%

        \[\leadsto \left(\left(-\sqrt{\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)}\right) + \left(-\color{blue}{b}\right)\right) \cdot \frac{1}{-a \cdot 2} \]
      11. add-sqr-sqrt0.0%

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

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

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

        \[\leadsto \left(\left(-\sqrt{\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)}\right) + \color{blue}{\sqrt{b} \cdot \sqrt{b}}\right) \cdot \frac{1}{-a \cdot 2} \]
      15. add-sqr-sqrt44.3%

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

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

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

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

      \[\leadsto \color{blue}{-1 \cdot \frac{c}{b} + -1 \cdot \frac{a \cdot {c}^{2}}{{b}^{3}}} \]
    8. Step-by-step derivation
      1. mul-1-neg91.0%

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

        \[\leadsto \color{blue}{-1 \cdot \frac{c}{b} - \frac{a \cdot {c}^{2}}{{b}^{3}}} \]
      3. mul-1-neg91.0%

        \[\leadsto \color{blue}{\left(-\frac{c}{b}\right)} - \frac{a \cdot {c}^{2}}{{b}^{3}} \]
      4. distribute-neg-frac291.0%

        \[\leadsto \color{blue}{\frac{c}{-b}} - \frac{a \cdot {c}^{2}}{{b}^{3}} \]
    9. Simplified91.0%

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

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

Alternative 15: 64.6% accurate, 29.0× speedup?

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

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

    \[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a} \]
  2. Step-by-step derivation
    1. *-commutative54.4%

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

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

    \[\leadsto \color{blue}{-1 \cdot \frac{c}{b}} \]
  6. Step-by-step derivation
    1. mul-1-neg64.7%

      \[\leadsto \color{blue}{-\frac{c}{b}} \]
    2. distribute-neg-frac264.7%

      \[\leadsto \color{blue}{\frac{c}{-b}} \]
  7. Simplified64.7%

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

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

Alternative 16: 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 54.4%

    \[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a} \]
  2. Step-by-step derivation
    1. *-commutative54.4%

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

    \[\leadsto \color{blue}{\frac{\sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)} - b}{a \cdot 2}} \]
  4. Add Preprocessing
  5. Step-by-step derivation
    1. frac-2neg54.5%

      \[\leadsto \color{blue}{\frac{-\left(\sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)} - b\right)}{-a \cdot 2}} \]
    2. div-inv54.5%

      \[\leadsto \color{blue}{\left(-\left(\sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)} - b\right)\right) \cdot \frac{1}{-a \cdot 2}} \]
    3. sub-neg54.5%

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

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

      \[\leadsto \left(\left(-\sqrt{\mathsf{fma}\left(a, c \cdot -4, \color{blue}{{b}^{2}}\right)}\right) + \left(-\left(-b\right)\right)\right) \cdot \frac{1}{-a \cdot 2} \]
    6. add-sqr-sqrt0.0%

      \[\leadsto \left(\left(-\sqrt{\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)}\right) + \left(-\color{blue}{\sqrt{-b} \cdot \sqrt{-b}}\right)\right) \cdot \frac{1}{-a \cdot 2} \]
    7. sqrt-unprod1.6%

      \[\leadsto \left(\left(-\sqrt{\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)}\right) + \left(-\color{blue}{\sqrt{\left(-b\right) \cdot \left(-b\right)}}\right)\right) \cdot \frac{1}{-a \cdot 2} \]
    8. sqr-neg1.6%

      \[\leadsto \left(\left(-\sqrt{\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)}\right) + \left(-\sqrt{\color{blue}{b \cdot b}}\right)\right) \cdot \frac{1}{-a \cdot 2} \]
    9. sqrt-prod1.6%

      \[\leadsto \left(\left(-\sqrt{\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)}\right) + \left(-\color{blue}{\sqrt{b} \cdot \sqrt{b}}\right)\right) \cdot \frac{1}{-a \cdot 2} \]
    10. add-sqr-sqrt1.6%

      \[\leadsto \left(\left(-\sqrt{\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)}\right) + \left(-\color{blue}{b}\right)\right) \cdot \frac{1}{-a \cdot 2} \]
    11. add-sqr-sqrt0.0%

      \[\leadsto \left(\left(-\sqrt{\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)}\right) + \color{blue}{\sqrt{-b} \cdot \sqrt{-b}}\right) \cdot \frac{1}{-a \cdot 2} \]
    12. sqrt-unprod54.5%

      \[\leadsto \left(\left(-\sqrt{\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)}\right) + \color{blue}{\sqrt{\left(-b\right) \cdot \left(-b\right)}}\right) \cdot \frac{1}{-a \cdot 2} \]
    13. sqr-neg54.5%

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

      \[\leadsto \left(\left(-\sqrt{\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)}\right) + \color{blue}{\sqrt{b} \cdot \sqrt{b}}\right) \cdot \frac{1}{-a \cdot 2} \]
    15. add-sqr-sqrt54.5%

      \[\leadsto \left(\left(-\sqrt{\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)}\right) + \color{blue}{b}\right) \cdot \frac{1}{-a \cdot 2} \]
    16. distribute-rgt-neg-in54.5%

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

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

    \[\leadsto \color{blue}{\left(\left(-\sqrt{\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)}\right) + b\right) \cdot \frac{1}{a \cdot -2}} \]
  7. Step-by-step derivation
    1. add-log-exp51.6%

      \[\leadsto \color{blue}{\log \left(e^{\left(-\sqrt{\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)}\right) + b}\right)} \cdot \frac{1}{a \cdot -2} \]
    2. neg-mul-151.6%

      \[\leadsto \log \left(e^{\color{blue}{-1 \cdot \sqrt{\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)}} + b}\right) \cdot \frac{1}{a \cdot -2} \]
    3. fma-define51.6%

      \[\leadsto \log \left(e^{\color{blue}{\mathsf{fma}\left(-1, \sqrt{\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)}, b\right)}}\right) \cdot \frac{1}{a \cdot -2} \]
  8. Applied egg-rr51.6%

    \[\leadsto \color{blue}{\log \left(e^{\mathsf{fma}\left(-1, \sqrt{\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)}, b\right)}\right)} \cdot \frac{1}{a \cdot -2} \]
  9. Taylor expanded in a around 0 3.2%

    \[\leadsto \color{blue}{-0.5 \cdot \frac{b + -1 \cdot b}{a}} \]
  10. Step-by-step derivation
    1. associate-*r/3.2%

      \[\leadsto \color{blue}{\frac{-0.5 \cdot \left(b + -1 \cdot b\right)}{a}} \]
    2. distribute-rgt1-in3.2%

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

      \[\leadsto \frac{-0.5 \cdot \left(\color{blue}{0} \cdot b\right)}{a} \]
    4. mul0-lft3.2%

      \[\leadsto \frac{-0.5 \cdot \color{blue}{0}}{a} \]
    5. metadata-eval3.2%

      \[\leadsto \frac{\color{blue}{0}}{a} \]
  11. Simplified3.2%

    \[\leadsto \color{blue}{\frac{0}{a}} \]
  12. Final simplification3.2%

    \[\leadsto \frac{0}{a} \]
  13. Add Preprocessing

Reproduce

?
herbie shell --seed 2024039 
(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)))