Cubic critical, narrow range

Percentage Accurate: 56.1% → 92.0%
Time: 11.6s
Alternatives: 11
Speedup: 2.9×

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 11 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: 56.1% accurate, 1.0× speedup?

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

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

Alternative 1: 92.0% accurate, 0.1× speedup?

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

\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(c, a \cdot -3, b \cdot b\right)\\
t_1 := \frac{c}{b \cdot \left(b \cdot b\right)} \cdot 0.375\\
\mathbf{if}\;b \leq 0.33:\\
\;\;\;\;\frac{\frac{b \cdot b - t\_0}{a \cdot \left(b + \sqrt{t\_0}\right)}}{-3}\\

\mathbf{else}:\\
\;\;\;\;\frac{1}{\mathsf{fma}\left(a, \mathsf{fma}\left(a, 3 \cdot \mathsf{fma}\left(a, \mathsf{fma}\left(-0.75, \frac{c \cdot t\_1}{b \cdot b}, \mathsf{fma}\left(0.2222222222222222, \frac{b \cdot \left(\frac{{c}^{4}}{{b}^{6}} \cdot 6.328125\right)}{c \cdot c}, \frac{\left(c \cdot c\right) \cdot -0.5625}{{b}^{5}}\right)\right), t\_1\right), \frac{1.5}{b}\right), \frac{b \cdot -2}{c}\right)}\\


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

    1. Initial program 87.2%

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

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

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

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

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

        \[\leadsto \frac{\frac{b - \color{blue}{\sqrt{\mathsf{fma}\left(a, -3 \cdot c, b \cdot b\right)}}}{a}}{-3} \]
      5. flip--N/A

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

        \[\leadsto \frac{\color{blue}{\frac{b \cdot b - \sqrt{\mathsf{fma}\left(a, -3 \cdot c, b \cdot b\right)} \cdot \sqrt{\mathsf{fma}\left(a, -3 \cdot c, b \cdot b\right)}}{a \cdot \left(b + \sqrt{\mathsf{fma}\left(a, -3 \cdot c, b \cdot b\right)}\right)}}}{-3} \]
      7. lower-/.f64N/A

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

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

    if 0.330000000000000016 < b

    1. Initial program 50.6%

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{1}{\frac{-3 \cdot a}{b - \sqrt{\mathsf{fma}\left(a, -3 \cdot c, b \cdot b\right)}}}} \]
      8. lower-/.f64N/A

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

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

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

        \[\leadsto \frac{1}{\frac{\mathsf{neg}\left(\color{blue}{3 \cdot a}\right)}{b - \sqrt{\mathsf{fma}\left(a, -3 \cdot c, b \cdot b\right)}}} \]
      12. lower-/.f64N/A

        \[\leadsto \frac{1}{\color{blue}{\frac{\mathsf{neg}\left(3 \cdot a\right)}{b - \sqrt{\mathsf{fma}\left(a, -3 \cdot c, b \cdot b\right)}}}} \]
      13. lift-*.f64N/A

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

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

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

        \[\leadsto \frac{1}{\frac{a \cdot \color{blue}{-3}}{b - \sqrt{\mathsf{fma}\left(a, -3 \cdot c, b \cdot b\right)}}} \]
      17. lower-*.f6450.6

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

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

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

      \[\leadsto \frac{1}{\color{blue}{\mathsf{fma}\left(a, \mathsf{fma}\left(a, 3 \cdot \mathsf{fma}\left(a, \mathsf{fma}\left(-0.75, \frac{c \cdot \left(\frac{c}{b \cdot \left(b \cdot b\right)} \cdot 0.375\right)}{b \cdot b}, \mathsf{fma}\left(0.2222222222222222, \frac{b \cdot \left(\frac{{c}^{4}}{{b}^{6}} \cdot 6.328125\right)}{c \cdot c}, \frac{-0.5625 \cdot \left(c \cdot c\right)}{{b}^{5}}\right)\right), \frac{c}{b \cdot \left(b \cdot b\right)} \cdot 0.375\right), \frac{1.5}{b}\right), \frac{b \cdot -2}{c}\right)}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification94.2%

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

Alternative 2: 91.8% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := b \cdot \left(b \cdot b\right)\\ t_1 := \mathsf{fma}\left(c, a \cdot -3, b \cdot b\right)\\ t_2 := b \cdot t\_0\\ \mathbf{if}\;b \leq 0.38:\\ \;\;\;\;\frac{\frac{b \cdot b - t\_1}{a \cdot \left(b + \sqrt{t\_1}\right)}}{-3}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(a, \mathsf{fma}\left(a, \mathsf{fma}\left(\frac{\frac{\left(c \cdot \left(c \cdot \left(c \cdot c\right)\right)\right) \cdot \left(a \cdot 6.328125\right)}{\left(b \cdot b\right) \cdot t\_2}}{b}, -0.16666666666666666, \frac{c \cdot \left(\left(c \cdot c\right) \cdot -0.5625\right)}{b \cdot t\_2}\right), \frac{\left(c \cdot c\right) \cdot -0.375}{t\_0}\right), \frac{c \cdot -0.5}{b}\right)\\ \end{array} \end{array} \]
(FPCore (a b c)
 :precision binary64
 (let* ((t_0 (* b (* b b))) (t_1 (fma c (* a -3.0) (* b b))) (t_2 (* b t_0)))
   (if (<= b 0.38)
     (/ (/ (- (* b b) t_1) (* a (+ b (sqrt t_1)))) -3.0)
     (fma
      a
      (fma
       a
       (fma
        (/ (/ (* (* c (* c (* c c))) (* a 6.328125)) (* (* b b) t_2)) b)
        -0.16666666666666666
        (/ (* c (* (* c c) -0.5625)) (* b t_2)))
       (/ (* (* c c) -0.375) t_0))
      (/ (* c -0.5) b)))))
double code(double a, double b, double c) {
	double t_0 = b * (b * b);
	double t_1 = fma(c, (a * -3.0), (b * b));
	double t_2 = b * t_0;
	double tmp;
	if (b <= 0.38) {
		tmp = (((b * b) - t_1) / (a * (b + sqrt(t_1)))) / -3.0;
	} else {
		tmp = fma(a, fma(a, fma(((((c * (c * (c * c))) * (a * 6.328125)) / ((b * b) * t_2)) / b), -0.16666666666666666, ((c * ((c * c) * -0.5625)) / (b * t_2))), (((c * c) * -0.375) / t_0)), ((c * -0.5) / b));
	}
	return tmp;
}
function code(a, b, c)
	t_0 = Float64(b * Float64(b * b))
	t_1 = fma(c, Float64(a * -3.0), Float64(b * b))
	t_2 = Float64(b * t_0)
	tmp = 0.0
	if (b <= 0.38)
		tmp = Float64(Float64(Float64(Float64(b * b) - t_1) / Float64(a * Float64(b + sqrt(t_1)))) / -3.0);
	else
		tmp = fma(a, fma(a, fma(Float64(Float64(Float64(Float64(c * Float64(c * Float64(c * c))) * Float64(a * 6.328125)) / Float64(Float64(b * b) * t_2)) / b), -0.16666666666666666, Float64(Float64(c * Float64(Float64(c * c) * -0.5625)) / Float64(b * t_2))), Float64(Float64(Float64(c * c) * -0.375) / t_0)), Float64(Float64(c * -0.5) / b));
	end
	return tmp
end
code[a_, b_, c_] := Block[{t$95$0 = N[(b * N[(b * b), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(c * N[(a * -3.0), $MachinePrecision] + N[(b * b), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(b * t$95$0), $MachinePrecision]}, If[LessEqual[b, 0.38], N[(N[(N[(N[(b * b), $MachinePrecision] - t$95$1), $MachinePrecision] / N[(a * N[(b + N[Sqrt[t$95$1], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / -3.0), $MachinePrecision], N[(a * N[(a * N[(N[(N[(N[(N[(c * N[(c * N[(c * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(a * 6.328125), $MachinePrecision]), $MachinePrecision] / N[(N[(b * b), $MachinePrecision] * t$95$2), $MachinePrecision]), $MachinePrecision] / b), $MachinePrecision] * -0.16666666666666666 + N[(N[(c * N[(N[(c * c), $MachinePrecision] * -0.5625), $MachinePrecision]), $MachinePrecision] / N[(b * t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(c * c), $MachinePrecision] * -0.375), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision] + N[(N[(c * -0.5), $MachinePrecision] / b), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}

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

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(a, \mathsf{fma}\left(a, \mathsf{fma}\left(\frac{\frac{\left(c \cdot \left(c \cdot \left(c \cdot c\right)\right)\right) \cdot \left(a \cdot 6.328125\right)}{\left(b \cdot b\right) \cdot t\_2}}{b}, -0.16666666666666666, \frac{c \cdot \left(\left(c \cdot c\right) \cdot -0.5625\right)}{b \cdot t\_2}\right), \frac{\left(c \cdot c\right) \cdot -0.375}{t\_0}\right), \frac{c \cdot -0.5}{b}\right)\\


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

    1. Initial program 87.2%

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

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

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

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

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

        \[\leadsto \frac{\frac{b - \color{blue}{\sqrt{\mathsf{fma}\left(a, -3 \cdot c, b \cdot b\right)}}}{a}}{-3} \]
      5. flip--N/A

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

        \[\leadsto \frac{\color{blue}{\frac{b \cdot b - \sqrt{\mathsf{fma}\left(a, -3 \cdot c, b \cdot b\right)} \cdot \sqrt{\mathsf{fma}\left(a, -3 \cdot c, b \cdot b\right)}}{a \cdot \left(b + \sqrt{\mathsf{fma}\left(a, -3 \cdot c, b \cdot b\right)}\right)}}}{-3} \]
      7. lower-/.f64N/A

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

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

    if 0.38 < b

    1. Initial program 50.6%

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(a, \mathsf{fma}\left(a, \mathsf{fma}\left(\frac{\frac{{c}^{4}}{{b}^{6}} \cdot \left(6.328125 \cdot a\right)}{b}, -0.16666666666666666, \frac{\left(c \cdot \left(c \cdot c\right)\right) \cdot -0.5625}{{b}^{5}}\right), \frac{\left(c \cdot c\right) \cdot -0.375}{b \cdot \left(b \cdot b\right)}\right), \frac{c \cdot -0.5}{b}\right)} \]
    5. Step-by-step derivation
      1. lift-pow.f64N/A

        \[\leadsto \mathsf{fma}\left(a, \mathsf{fma}\left(a, \mathsf{fma}\left(\frac{\frac{\color{blue}{{c}^{4}}}{{b}^{6}} \cdot \left(\frac{405}{64} \cdot a\right)}{b}, \frac{-1}{6}, \frac{\left(c \cdot \left(c \cdot c\right)\right) \cdot \frac{-9}{16}}{{b}^{5}}\right), \frac{\left(c \cdot c\right) \cdot \frac{-3}{8}}{b \cdot \left(b \cdot b\right)}\right), \frac{c \cdot \frac{-1}{2}}{b}\right) \]
      2. lift-pow.f64N/A

        \[\leadsto \mathsf{fma}\left(a, \mathsf{fma}\left(a, \mathsf{fma}\left(\frac{\frac{{c}^{4}}{\color{blue}{{b}^{6}}} \cdot \left(\frac{405}{64} \cdot a\right)}{b}, \frac{-1}{6}, \frac{\left(c \cdot \left(c \cdot c\right)\right) \cdot \frac{-9}{16}}{{b}^{5}}\right), \frac{\left(c \cdot c\right) \cdot \frac{-3}{8}}{b \cdot \left(b \cdot b\right)}\right), \frac{c \cdot \frac{-1}{2}}{b}\right) \]
      3. lift-*.f64N/A

        \[\leadsto \mathsf{fma}\left(a, \mathsf{fma}\left(a, \mathsf{fma}\left(\frac{\frac{{c}^{4}}{{b}^{6}} \cdot \color{blue}{\left(\frac{405}{64} \cdot a\right)}}{b}, \frac{-1}{6}, \frac{\left(c \cdot \left(c \cdot c\right)\right) \cdot \frac{-9}{16}}{{b}^{5}}\right), \frac{\left(c \cdot c\right) \cdot \frac{-3}{8}}{b \cdot \left(b \cdot b\right)}\right), \frac{c \cdot \frac{-1}{2}}{b}\right) \]
      4. associate-*l/N/A

        \[\leadsto \mathsf{fma}\left(a, \mathsf{fma}\left(a, \mathsf{fma}\left(\frac{\color{blue}{\frac{{c}^{4} \cdot \left(\frac{405}{64} \cdot a\right)}{{b}^{6}}}}{b}, \frac{-1}{6}, \frac{\left(c \cdot \left(c \cdot c\right)\right) \cdot \frac{-9}{16}}{{b}^{5}}\right), \frac{\left(c \cdot c\right) \cdot \frac{-3}{8}}{b \cdot \left(b \cdot b\right)}\right), \frac{c \cdot \frac{-1}{2}}{b}\right) \]
      5. lower-/.f64N/A

        \[\leadsto \mathsf{fma}\left(a, \mathsf{fma}\left(a, \mathsf{fma}\left(\frac{\color{blue}{\frac{{c}^{4} \cdot \left(\frac{405}{64} \cdot a\right)}{{b}^{6}}}}{b}, \frac{-1}{6}, \frac{\left(c \cdot \left(c \cdot c\right)\right) \cdot \frac{-9}{16}}{{b}^{5}}\right), \frac{\left(c \cdot c\right) \cdot \frac{-3}{8}}{b \cdot \left(b \cdot b\right)}\right), \frac{c \cdot \frac{-1}{2}}{b}\right) \]
      6. lower-*.f6494.6

        \[\leadsto \mathsf{fma}\left(a, \mathsf{fma}\left(a, \mathsf{fma}\left(\frac{\frac{\color{blue}{{c}^{4} \cdot \left(6.328125 \cdot a\right)}}{{b}^{6}}}{b}, -0.16666666666666666, \frac{\left(c \cdot \left(c \cdot c\right)\right) \cdot -0.5625}{{b}^{5}}\right), \frac{\left(c \cdot c\right) \cdot -0.375}{b \cdot \left(b \cdot b\right)}\right), \frac{c \cdot -0.5}{b}\right) \]
      7. lift-pow.f64N/A

        \[\leadsto \mathsf{fma}\left(a, \mathsf{fma}\left(a, \mathsf{fma}\left(\frac{\frac{\color{blue}{{c}^{4}} \cdot \left(\frac{405}{64} \cdot a\right)}{{b}^{6}}}{b}, \frac{-1}{6}, \frac{\left(c \cdot \left(c \cdot c\right)\right) \cdot \frac{-9}{16}}{{b}^{5}}\right), \frac{\left(c \cdot c\right) \cdot \frac{-3}{8}}{b \cdot \left(b \cdot b\right)}\right), \frac{c \cdot \frac{-1}{2}}{b}\right) \]
      8. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(a, \mathsf{fma}\left(a, \mathsf{fma}\left(\frac{\frac{{c}^{\color{blue}{\left(2 \cdot 2\right)}} \cdot \left(\frac{405}{64} \cdot a\right)}{{b}^{6}}}{b}, \frac{-1}{6}, \frac{\left(c \cdot \left(c \cdot c\right)\right) \cdot \frac{-9}{16}}{{b}^{5}}\right), \frac{\left(c \cdot c\right) \cdot \frac{-3}{8}}{b \cdot \left(b \cdot b\right)}\right), \frac{c \cdot \frac{-1}{2}}{b}\right) \]
      9. pow-sqrN/A

        \[\leadsto \mathsf{fma}\left(a, \mathsf{fma}\left(a, \mathsf{fma}\left(\frac{\frac{\color{blue}{\left({c}^{2} \cdot {c}^{2}\right)} \cdot \left(\frac{405}{64} \cdot a\right)}{{b}^{6}}}{b}, \frac{-1}{6}, \frac{\left(c \cdot \left(c \cdot c\right)\right) \cdot \frac{-9}{16}}{{b}^{5}}\right), \frac{\left(c \cdot c\right) \cdot \frac{-3}{8}}{b \cdot \left(b \cdot b\right)}\right), \frac{c \cdot \frac{-1}{2}}{b}\right) \]
      10. pow2N/A

        \[\leadsto \mathsf{fma}\left(a, \mathsf{fma}\left(a, \mathsf{fma}\left(\frac{\frac{\left(\color{blue}{\left(c \cdot c\right)} \cdot {c}^{2}\right) \cdot \left(\frac{405}{64} \cdot a\right)}{{b}^{6}}}{b}, \frac{-1}{6}, \frac{\left(c \cdot \left(c \cdot c\right)\right) \cdot \frac{-9}{16}}{{b}^{5}}\right), \frac{\left(c \cdot c\right) \cdot \frac{-3}{8}}{b \cdot \left(b \cdot b\right)}\right), \frac{c \cdot \frac{-1}{2}}{b}\right) \]
      11. pow2N/A

        \[\leadsto \mathsf{fma}\left(a, \mathsf{fma}\left(a, \mathsf{fma}\left(\frac{\frac{\left(\left(c \cdot c\right) \cdot \color{blue}{\left(c \cdot c\right)}\right) \cdot \left(\frac{405}{64} \cdot a\right)}{{b}^{6}}}{b}, \frac{-1}{6}, \frac{\left(c \cdot \left(c \cdot c\right)\right) \cdot \frac{-9}{16}}{{b}^{5}}\right), \frac{\left(c \cdot c\right) \cdot \frac{-3}{8}}{b \cdot \left(b \cdot b\right)}\right), \frac{c \cdot \frac{-1}{2}}{b}\right) \]
      12. lift-*.f64N/A

        \[\leadsto \mathsf{fma}\left(a, \mathsf{fma}\left(a, \mathsf{fma}\left(\frac{\frac{\left(\left(c \cdot c\right) \cdot \color{blue}{\left(c \cdot c\right)}\right) \cdot \left(\frac{405}{64} \cdot a\right)}{{b}^{6}}}{b}, \frac{-1}{6}, \frac{\left(c \cdot \left(c \cdot c\right)\right) \cdot \frac{-9}{16}}{{b}^{5}}\right), \frac{\left(c \cdot c\right) \cdot \frac{-3}{8}}{b \cdot \left(b \cdot b\right)}\right), \frac{c \cdot \frac{-1}{2}}{b}\right) \]
      13. associate-*l*N/A

        \[\leadsto \mathsf{fma}\left(a, \mathsf{fma}\left(a, \mathsf{fma}\left(\frac{\frac{\color{blue}{\left(c \cdot \left(c \cdot \left(c \cdot c\right)\right)\right)} \cdot \left(\frac{405}{64} \cdot a\right)}{{b}^{6}}}{b}, \frac{-1}{6}, \frac{\left(c \cdot \left(c \cdot c\right)\right) \cdot \frac{-9}{16}}{{b}^{5}}\right), \frac{\left(c \cdot c\right) \cdot \frac{-3}{8}}{b \cdot \left(b \cdot b\right)}\right), \frac{c \cdot \frac{-1}{2}}{b}\right) \]
      14. lift-*.f64N/A

        \[\leadsto \mathsf{fma}\left(a, \mathsf{fma}\left(a, \mathsf{fma}\left(\frac{\frac{\left(c \cdot \color{blue}{\left(c \cdot \left(c \cdot c\right)\right)}\right) \cdot \left(\frac{405}{64} \cdot a\right)}{{b}^{6}}}{b}, \frac{-1}{6}, \frac{\left(c \cdot \left(c \cdot c\right)\right) \cdot \frac{-9}{16}}{{b}^{5}}\right), \frac{\left(c \cdot c\right) \cdot \frac{-3}{8}}{b \cdot \left(b \cdot b\right)}\right), \frac{c \cdot \frac{-1}{2}}{b}\right) \]
      15. lower-*.f6494.6

        \[\leadsto \mathsf{fma}\left(a, \mathsf{fma}\left(a, \mathsf{fma}\left(\frac{\frac{\color{blue}{\left(c \cdot \left(c \cdot \left(c \cdot c\right)\right)\right)} \cdot \left(6.328125 \cdot a\right)}{{b}^{6}}}{b}, -0.16666666666666666, \frac{\left(c \cdot \left(c \cdot c\right)\right) \cdot -0.5625}{{b}^{5}}\right), \frac{\left(c \cdot c\right) \cdot -0.375}{b \cdot \left(b \cdot b\right)}\right), \frac{c \cdot -0.5}{b}\right) \]
      16. lift-pow.f64N/A

        \[\leadsto \mathsf{fma}\left(a, \mathsf{fma}\left(a, \mathsf{fma}\left(\frac{\frac{\left(c \cdot \left(c \cdot \left(c \cdot c\right)\right)\right) \cdot \left(\frac{405}{64} \cdot a\right)}{\color{blue}{{b}^{6}}}}{b}, \frac{-1}{6}, \frac{\left(c \cdot \left(c \cdot c\right)\right) \cdot \frac{-9}{16}}{{b}^{5}}\right), \frac{\left(c \cdot c\right) \cdot \frac{-3}{8}}{b \cdot \left(b \cdot b\right)}\right), \frac{c \cdot \frac{-1}{2}}{b}\right) \]
      17. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(a, \mathsf{fma}\left(a, \mathsf{fma}\left(\frac{\frac{\left(c \cdot \left(c \cdot \left(c \cdot c\right)\right)\right) \cdot \left(\frac{405}{64} \cdot a\right)}{{b}^{\color{blue}{\left(2 \cdot 3\right)}}}}{b}, \frac{-1}{6}, \frac{\left(c \cdot \left(c \cdot c\right)\right) \cdot \frac{-9}{16}}{{b}^{5}}\right), \frac{\left(c \cdot c\right) \cdot \frac{-3}{8}}{b \cdot \left(b \cdot b\right)}\right), \frac{c \cdot \frac{-1}{2}}{b}\right) \]
      18. pow-powN/A

        \[\leadsto \mathsf{fma}\left(a, \mathsf{fma}\left(a, \mathsf{fma}\left(\frac{\frac{\left(c \cdot \left(c \cdot \left(c \cdot c\right)\right)\right) \cdot \left(\frac{405}{64} \cdot a\right)}{\color{blue}{{\left({b}^{2}\right)}^{3}}}}{b}, \frac{-1}{6}, \frac{\left(c \cdot \left(c \cdot c\right)\right) \cdot \frac{-9}{16}}{{b}^{5}}\right), \frac{\left(c \cdot c\right) \cdot \frac{-3}{8}}{b \cdot \left(b \cdot b\right)}\right), \frac{c \cdot \frac{-1}{2}}{b}\right) \]
      19. pow2N/A

        \[\leadsto \mathsf{fma}\left(a, \mathsf{fma}\left(a, \mathsf{fma}\left(\frac{\frac{\left(c \cdot \left(c \cdot \left(c \cdot c\right)\right)\right) \cdot \left(\frac{405}{64} \cdot a\right)}{{\color{blue}{\left(b \cdot b\right)}}^{3}}}{b}, \frac{-1}{6}, \frac{\left(c \cdot \left(c \cdot c\right)\right) \cdot \frac{-9}{16}}{{b}^{5}}\right), \frac{\left(c \cdot c\right) \cdot \frac{-3}{8}}{b \cdot \left(b \cdot b\right)}\right), \frac{c \cdot \frac{-1}{2}}{b}\right) \]
      20. lift-*.f64N/A

        \[\leadsto \mathsf{fma}\left(a, \mathsf{fma}\left(a, \mathsf{fma}\left(\frac{\frac{\left(c \cdot \left(c \cdot \left(c \cdot c\right)\right)\right) \cdot \left(\frac{405}{64} \cdot a\right)}{{\color{blue}{\left(b \cdot b\right)}}^{3}}}{b}, \frac{-1}{6}, \frac{\left(c \cdot \left(c \cdot c\right)\right) \cdot \frac{-9}{16}}{{b}^{5}}\right), \frac{\left(c \cdot c\right) \cdot \frac{-3}{8}}{b \cdot \left(b \cdot b\right)}\right), \frac{c \cdot \frac{-1}{2}}{b}\right) \]
      21. cube-multN/A

        \[\leadsto \mathsf{fma}\left(a, \mathsf{fma}\left(a, \mathsf{fma}\left(\frac{\frac{\left(c \cdot \left(c \cdot \left(c \cdot c\right)\right)\right) \cdot \left(\frac{405}{64} \cdot a\right)}{\color{blue}{\left(b \cdot b\right) \cdot \left(\left(b \cdot b\right) \cdot \left(b \cdot b\right)\right)}}}{b}, \frac{-1}{6}, \frac{\left(c \cdot \left(c \cdot c\right)\right) \cdot \frac{-9}{16}}{{b}^{5}}\right), \frac{\left(c \cdot c\right) \cdot \frac{-3}{8}}{b \cdot \left(b \cdot b\right)}\right), \frac{c \cdot \frac{-1}{2}}{b}\right) \]
      22. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(a, \mathsf{fma}\left(a, \mathsf{fma}\left(\frac{\frac{\left(c \cdot \left(c \cdot \left(c \cdot c\right)\right)\right) \cdot \left(\frac{405}{64} \cdot a\right)}{\color{blue}{\left(b \cdot b\right) \cdot \left(\left(b \cdot b\right) \cdot \left(b \cdot b\right)\right)}}}{b}, \frac{-1}{6}, \frac{\left(c \cdot \left(c \cdot c\right)\right) \cdot \frac{-9}{16}}{{b}^{5}}\right), \frac{\left(c \cdot c\right) \cdot \frac{-3}{8}}{b \cdot \left(b \cdot b\right)}\right), \frac{c \cdot \frac{-1}{2}}{b}\right) \]
      23. lift-*.f64N/A

        \[\leadsto \mathsf{fma}\left(a, \mathsf{fma}\left(a, \mathsf{fma}\left(\frac{\frac{\left(c \cdot \left(c \cdot \left(c \cdot c\right)\right)\right) \cdot \left(\frac{405}{64} \cdot a\right)}{\left(b \cdot b\right) \cdot \left(\color{blue}{\left(b \cdot b\right)} \cdot \left(b \cdot b\right)\right)}}{b}, \frac{-1}{6}, \frac{\left(c \cdot \left(c \cdot c\right)\right) \cdot \frac{-9}{16}}{{b}^{5}}\right), \frac{\left(c \cdot c\right) \cdot \frac{-3}{8}}{b \cdot \left(b \cdot b\right)}\right), \frac{c \cdot \frac{-1}{2}}{b}\right) \]
      24. associate-*l*N/A

        \[\leadsto \mathsf{fma}\left(a, \mathsf{fma}\left(a, \mathsf{fma}\left(\frac{\frac{\left(c \cdot \left(c \cdot \left(c \cdot c\right)\right)\right) \cdot \left(\frac{405}{64} \cdot a\right)}{\left(b \cdot b\right) \cdot \color{blue}{\left(b \cdot \left(b \cdot \left(b \cdot b\right)\right)\right)}}}{b}, \frac{-1}{6}, \frac{\left(c \cdot \left(c \cdot c\right)\right) \cdot \frac{-9}{16}}{{b}^{5}}\right), \frac{\left(c \cdot c\right) \cdot \frac{-3}{8}}{b \cdot \left(b \cdot b\right)}\right), \frac{c \cdot \frac{-1}{2}}{b}\right) \]
      25. lift-*.f64N/A

        \[\leadsto \mathsf{fma}\left(a, \mathsf{fma}\left(a, \mathsf{fma}\left(\frac{\frac{\left(c \cdot \left(c \cdot \left(c \cdot c\right)\right)\right) \cdot \left(\frac{405}{64} \cdot a\right)}{\left(b \cdot b\right) \cdot \left(b \cdot \color{blue}{\left(b \cdot \left(b \cdot b\right)\right)}\right)}}{b}, \frac{-1}{6}, \frac{\left(c \cdot \left(c \cdot c\right)\right) \cdot \frac{-9}{16}}{{b}^{5}}\right), \frac{\left(c \cdot c\right) \cdot \frac{-3}{8}}{b \cdot \left(b \cdot b\right)}\right), \frac{c \cdot \frac{-1}{2}}{b}\right) \]
      26. lower-*.f6494.6

        \[\leadsto \mathsf{fma}\left(a, \mathsf{fma}\left(a, \mathsf{fma}\left(\frac{\frac{\left(c \cdot \left(c \cdot \left(c \cdot c\right)\right)\right) \cdot \left(6.328125 \cdot a\right)}{\left(b \cdot b\right) \cdot \color{blue}{\left(b \cdot \left(b \cdot \left(b \cdot b\right)\right)\right)}}}{b}, -0.16666666666666666, \frac{\left(c \cdot \left(c \cdot c\right)\right) \cdot -0.5625}{{b}^{5}}\right), \frac{\left(c \cdot c\right) \cdot -0.375}{b \cdot \left(b \cdot b\right)}\right), \frac{c \cdot -0.5}{b}\right) \]
    6. Applied egg-rr94.6%

      \[\leadsto \mathsf{fma}\left(a, \mathsf{fma}\left(a, \mathsf{fma}\left(\frac{\color{blue}{\frac{\left(c \cdot \left(c \cdot \left(c \cdot c\right)\right)\right) \cdot \left(6.328125 \cdot a\right)}{\left(b \cdot b\right) \cdot \left(b \cdot \left(b \cdot \left(b \cdot b\right)\right)\right)}}}{b}, -0.16666666666666666, \frac{\left(c \cdot \left(c \cdot c\right)\right) \cdot -0.5625}{{b}^{5}}\right), \frac{\left(c \cdot c\right) \cdot -0.375}{b \cdot \left(b \cdot b\right)}\right), \frac{c \cdot -0.5}{b}\right) \]
    7. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \mathsf{fma}\left(a, \mathsf{fma}\left(a, \mathsf{fma}\left(\frac{\frac{\left(c \cdot \left(c \cdot \left(c \cdot c\right)\right)\right) \cdot \left(\frac{405}{64} \cdot a\right)}{\left(b \cdot b\right) \cdot \left(b \cdot \left(b \cdot \left(b \cdot b\right)\right)\right)}}{b}, \frac{-1}{6}, \frac{\left(c \cdot \color{blue}{\left(c \cdot c\right)}\right) \cdot \frac{-9}{16}}{{b}^{5}}\right), \frac{\left(c \cdot c\right) \cdot \frac{-3}{8}}{b \cdot \left(b \cdot b\right)}\right), \frac{c \cdot \frac{-1}{2}}{b}\right) \]
      2. lift-*.f64N/A

        \[\leadsto \mathsf{fma}\left(a, \mathsf{fma}\left(a, \mathsf{fma}\left(\frac{\frac{\left(c \cdot \left(c \cdot \left(c \cdot c\right)\right)\right) \cdot \left(\frac{405}{64} \cdot a\right)}{\left(b \cdot b\right) \cdot \left(b \cdot \left(b \cdot \left(b \cdot b\right)\right)\right)}}{b}, \frac{-1}{6}, \frac{\color{blue}{\left(c \cdot \left(c \cdot c\right)\right)} \cdot \frac{-9}{16}}{{b}^{5}}\right), \frac{\left(c \cdot c\right) \cdot \frac{-3}{8}}{b \cdot \left(b \cdot b\right)}\right), \frac{c \cdot \frac{-1}{2}}{b}\right) \]
      3. lift-*.f64N/A

        \[\leadsto \mathsf{fma}\left(a, \mathsf{fma}\left(a, \mathsf{fma}\left(\frac{\frac{\left(c \cdot \left(c \cdot \left(c \cdot c\right)\right)\right) \cdot \left(\frac{405}{64} \cdot a\right)}{\left(b \cdot b\right) \cdot \left(b \cdot \left(b \cdot \left(b \cdot b\right)\right)\right)}}{b}, \frac{-1}{6}, \frac{\color{blue}{\left(c \cdot \left(c \cdot c\right)\right) \cdot \frac{-9}{16}}}{{b}^{5}}\right), \frac{\left(c \cdot c\right) \cdot \frac{-3}{8}}{b \cdot \left(b \cdot b\right)}\right), \frac{c \cdot \frac{-1}{2}}{b}\right) \]
      4. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(a, \mathsf{fma}\left(a, \mathsf{fma}\left(\frac{\frac{\left(c \cdot \left(c \cdot \left(c \cdot c\right)\right)\right) \cdot \left(\frac{405}{64} \cdot a\right)}{\left(b \cdot b\right) \cdot \left(b \cdot \left(b \cdot \left(b \cdot b\right)\right)\right)}}{b}, \frac{-1}{6}, \frac{\left(c \cdot \left(c \cdot c\right)\right) \cdot \frac{-9}{16}}{{b}^{\color{blue}{\left(2 + 3\right)}}}\right), \frac{\left(c \cdot c\right) \cdot \frac{-3}{8}}{b \cdot \left(b \cdot b\right)}\right), \frac{c \cdot \frac{-1}{2}}{b}\right) \]
      5. pow-prod-upN/A

        \[\leadsto \mathsf{fma}\left(a, \mathsf{fma}\left(a, \mathsf{fma}\left(\frac{\frac{\left(c \cdot \left(c \cdot \left(c \cdot c\right)\right)\right) \cdot \left(\frac{405}{64} \cdot a\right)}{\left(b \cdot b\right) \cdot \left(b \cdot \left(b \cdot \left(b \cdot b\right)\right)\right)}}{b}, \frac{-1}{6}, \frac{\left(c \cdot \left(c \cdot c\right)\right) \cdot \frac{-9}{16}}{\color{blue}{{b}^{2} \cdot {b}^{3}}}\right), \frac{\left(c \cdot c\right) \cdot \frac{-3}{8}}{b \cdot \left(b \cdot b\right)}\right), \frac{c \cdot \frac{-1}{2}}{b}\right) \]
      6. pow2N/A

        \[\leadsto \mathsf{fma}\left(a, \mathsf{fma}\left(a, \mathsf{fma}\left(\frac{\frac{\left(c \cdot \left(c \cdot \left(c \cdot c\right)\right)\right) \cdot \left(\frac{405}{64} \cdot a\right)}{\left(b \cdot b\right) \cdot \left(b \cdot \left(b \cdot \left(b \cdot b\right)\right)\right)}}{b}, \frac{-1}{6}, \frac{\left(c \cdot \left(c \cdot c\right)\right) \cdot \frac{-9}{16}}{\color{blue}{\left(b \cdot b\right)} \cdot {b}^{3}}\right), \frac{\left(c \cdot c\right) \cdot \frac{-3}{8}}{b \cdot \left(b \cdot b\right)}\right), \frac{c \cdot \frac{-1}{2}}{b}\right) \]
      7. cube-unmultN/A

        \[\leadsto \mathsf{fma}\left(a, \mathsf{fma}\left(a, \mathsf{fma}\left(\frac{\frac{\left(c \cdot \left(c \cdot \left(c \cdot c\right)\right)\right) \cdot \left(\frac{405}{64} \cdot a\right)}{\left(b \cdot b\right) \cdot \left(b \cdot \left(b \cdot \left(b \cdot b\right)\right)\right)}}{b}, \frac{-1}{6}, \frac{\left(c \cdot \left(c \cdot c\right)\right) \cdot \frac{-9}{16}}{\left(b \cdot b\right) \cdot \color{blue}{\left(b \cdot \left(b \cdot b\right)\right)}}\right), \frac{\left(c \cdot c\right) \cdot \frac{-3}{8}}{b \cdot \left(b \cdot b\right)}\right), \frac{c \cdot \frac{-1}{2}}{b}\right) \]
      8. lift-*.f64N/A

        \[\leadsto \mathsf{fma}\left(a, \mathsf{fma}\left(a, \mathsf{fma}\left(\frac{\frac{\left(c \cdot \left(c \cdot \left(c \cdot c\right)\right)\right) \cdot \left(\frac{405}{64} \cdot a\right)}{\left(b \cdot b\right) \cdot \left(b \cdot \left(b \cdot \left(b \cdot b\right)\right)\right)}}{b}, \frac{-1}{6}, \frac{\left(c \cdot \left(c \cdot c\right)\right) \cdot \frac{-9}{16}}{\left(b \cdot b\right) \cdot \left(b \cdot \color{blue}{\left(b \cdot b\right)}\right)}\right), \frac{\left(c \cdot c\right) \cdot \frac{-3}{8}}{b \cdot \left(b \cdot b\right)}\right), \frac{c \cdot \frac{-1}{2}}{b}\right) \]
      9. lift-*.f64N/A

        \[\leadsto \mathsf{fma}\left(a, \mathsf{fma}\left(a, \mathsf{fma}\left(\frac{\frac{\left(c \cdot \left(c \cdot \left(c \cdot c\right)\right)\right) \cdot \left(\frac{405}{64} \cdot a\right)}{\left(b \cdot b\right) \cdot \left(b \cdot \left(b \cdot \left(b \cdot b\right)\right)\right)}}{b}, \frac{-1}{6}, \frac{\left(c \cdot \left(c \cdot c\right)\right) \cdot \frac{-9}{16}}{\left(b \cdot b\right) \cdot \color{blue}{\left(b \cdot \left(b \cdot b\right)\right)}}\right), \frac{\left(c \cdot c\right) \cdot \frac{-3}{8}}{b \cdot \left(b \cdot b\right)}\right), \frac{c \cdot \frac{-1}{2}}{b}\right) \]
      10. associate-*r*N/A

        \[\leadsto \mathsf{fma}\left(a, \mathsf{fma}\left(a, \mathsf{fma}\left(\frac{\frac{\left(c \cdot \left(c \cdot \left(c \cdot c\right)\right)\right) \cdot \left(\frac{405}{64} \cdot a\right)}{\left(b \cdot b\right) \cdot \left(b \cdot \left(b \cdot \left(b \cdot b\right)\right)\right)}}{b}, \frac{-1}{6}, \frac{\left(c \cdot \left(c \cdot c\right)\right) \cdot \frac{-9}{16}}{\color{blue}{b \cdot \left(b \cdot \left(b \cdot \left(b \cdot b\right)\right)\right)}}\right), \frac{\left(c \cdot c\right) \cdot \frac{-3}{8}}{b \cdot \left(b \cdot b\right)}\right), \frac{c \cdot \frac{-1}{2}}{b}\right) \]
      11. lift-*.f64N/A

        \[\leadsto \mathsf{fma}\left(a, \mathsf{fma}\left(a, \mathsf{fma}\left(\frac{\frac{\left(c \cdot \left(c \cdot \left(c \cdot c\right)\right)\right) \cdot \left(\frac{405}{64} \cdot a\right)}{\left(b \cdot b\right) \cdot \left(b \cdot \left(b \cdot \left(b \cdot b\right)\right)\right)}}{b}, \frac{-1}{6}, \frac{\left(c \cdot \left(c \cdot c\right)\right) \cdot \frac{-9}{16}}{b \cdot \color{blue}{\left(b \cdot \left(b \cdot \left(b \cdot b\right)\right)\right)}}\right), \frac{\left(c \cdot c\right) \cdot \frac{-3}{8}}{b \cdot \left(b \cdot b\right)}\right), \frac{c \cdot \frac{-1}{2}}{b}\right) \]
      12. lower-/.f64N/A

        \[\leadsto \mathsf{fma}\left(a, \mathsf{fma}\left(a, \mathsf{fma}\left(\frac{\frac{\left(c \cdot \left(c \cdot \left(c \cdot c\right)\right)\right) \cdot \left(\frac{405}{64} \cdot a\right)}{\left(b \cdot b\right) \cdot \left(b \cdot \left(b \cdot \left(b \cdot b\right)\right)\right)}}{b}, \frac{-1}{6}, \color{blue}{\frac{\left(c \cdot \left(c \cdot c\right)\right) \cdot \frac{-9}{16}}{b \cdot \left(b \cdot \left(b \cdot \left(b \cdot b\right)\right)\right)}}\right), \frac{\left(c \cdot c\right) \cdot \frac{-3}{8}}{b \cdot \left(b \cdot b\right)}\right), \frac{c \cdot \frac{-1}{2}}{b}\right) \]
      13. lift-*.f64N/A

        \[\leadsto \mathsf{fma}\left(a, \mathsf{fma}\left(a, \mathsf{fma}\left(\frac{\frac{\left(c \cdot \left(c \cdot \left(c \cdot c\right)\right)\right) \cdot \left(\frac{405}{64} \cdot a\right)}{\left(b \cdot b\right) \cdot \left(b \cdot \left(b \cdot \left(b \cdot b\right)\right)\right)}}{b}, \frac{-1}{6}, \frac{\color{blue}{\left(c \cdot \left(c \cdot c\right)\right) \cdot \frac{-9}{16}}}{b \cdot \left(b \cdot \left(b \cdot \left(b \cdot b\right)\right)\right)}\right), \frac{\left(c \cdot c\right) \cdot \frac{-3}{8}}{b \cdot \left(b \cdot b\right)}\right), \frac{c \cdot \frac{-1}{2}}{b}\right) \]
      14. lift-*.f64N/A

        \[\leadsto \mathsf{fma}\left(a, \mathsf{fma}\left(a, \mathsf{fma}\left(\frac{\frac{\left(c \cdot \left(c \cdot \left(c \cdot c\right)\right)\right) \cdot \left(\frac{405}{64} \cdot a\right)}{\left(b \cdot b\right) \cdot \left(b \cdot \left(b \cdot \left(b \cdot b\right)\right)\right)}}{b}, \frac{-1}{6}, \frac{\color{blue}{\left(c \cdot \left(c \cdot c\right)\right)} \cdot \frac{-9}{16}}{b \cdot \left(b \cdot \left(b \cdot \left(b \cdot b\right)\right)\right)}\right), \frac{\left(c \cdot c\right) \cdot \frac{-3}{8}}{b \cdot \left(b \cdot b\right)}\right), \frac{c \cdot \frac{-1}{2}}{b}\right) \]
      15. associate-*l*N/A

        \[\leadsto \mathsf{fma}\left(a, \mathsf{fma}\left(a, \mathsf{fma}\left(\frac{\frac{\left(c \cdot \left(c \cdot \left(c \cdot c\right)\right)\right) \cdot \left(\frac{405}{64} \cdot a\right)}{\left(b \cdot b\right) \cdot \left(b \cdot \left(b \cdot \left(b \cdot b\right)\right)\right)}}{b}, \frac{-1}{6}, \frac{\color{blue}{c \cdot \left(\left(c \cdot c\right) \cdot \frac{-9}{16}\right)}}{b \cdot \left(b \cdot \left(b \cdot \left(b \cdot b\right)\right)\right)}\right), \frac{\left(c \cdot c\right) \cdot \frac{-3}{8}}{b \cdot \left(b \cdot b\right)}\right), \frac{c \cdot \frac{-1}{2}}{b}\right) \]
      16. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(a, \mathsf{fma}\left(a, \mathsf{fma}\left(\frac{\frac{\left(c \cdot \left(c \cdot \left(c \cdot c\right)\right)\right) \cdot \left(\frac{405}{64} \cdot a\right)}{\left(b \cdot b\right) \cdot \left(b \cdot \left(b \cdot \left(b \cdot b\right)\right)\right)}}{b}, \frac{-1}{6}, \frac{\color{blue}{c \cdot \left(\left(c \cdot c\right) \cdot \frac{-9}{16}\right)}}{b \cdot \left(b \cdot \left(b \cdot \left(b \cdot b\right)\right)\right)}\right), \frac{\left(c \cdot c\right) \cdot \frac{-3}{8}}{b \cdot \left(b \cdot b\right)}\right), \frac{c \cdot \frac{-1}{2}}{b}\right) \]
      17. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(a, \mathsf{fma}\left(a, \mathsf{fma}\left(\frac{\frac{\left(c \cdot \left(c \cdot \left(c \cdot c\right)\right)\right) \cdot \left(\frac{405}{64} \cdot a\right)}{\left(b \cdot b\right) \cdot \left(b \cdot \left(b \cdot \left(b \cdot b\right)\right)\right)}}{b}, \frac{-1}{6}, \frac{c \cdot \color{blue}{\left(\left(c \cdot c\right) \cdot \frac{-9}{16}\right)}}{b \cdot \left(b \cdot \left(b \cdot \left(b \cdot b\right)\right)\right)}\right), \frac{\left(c \cdot c\right) \cdot \frac{-3}{8}}{b \cdot \left(b \cdot b\right)}\right), \frac{c \cdot \frac{-1}{2}}{b}\right) \]
      18. lower-*.f6494.6

        \[\leadsto \mathsf{fma}\left(a, \mathsf{fma}\left(a, \mathsf{fma}\left(\frac{\frac{\left(c \cdot \left(c \cdot \left(c \cdot c\right)\right)\right) \cdot \left(6.328125 \cdot a\right)}{\left(b \cdot b\right) \cdot \left(b \cdot \left(b \cdot \left(b \cdot b\right)\right)\right)}}{b}, -0.16666666666666666, \frac{c \cdot \left(\left(c \cdot c\right) \cdot -0.5625\right)}{\color{blue}{b \cdot \left(b \cdot \left(b \cdot \left(b \cdot b\right)\right)\right)}}\right), \frac{\left(c \cdot c\right) \cdot -0.375}{b \cdot \left(b \cdot b\right)}\right), \frac{c \cdot -0.5}{b}\right) \]
    8. Applied egg-rr94.6%

      \[\leadsto \mathsf{fma}\left(a, \mathsf{fma}\left(a, \mathsf{fma}\left(\frac{\frac{\left(c \cdot \left(c \cdot \left(c \cdot c\right)\right)\right) \cdot \left(6.328125 \cdot a\right)}{\left(b \cdot b\right) \cdot \left(b \cdot \left(b \cdot \left(b \cdot b\right)\right)\right)}}{b}, -0.16666666666666666, \color{blue}{\frac{c \cdot \left(\left(c \cdot c\right) \cdot -0.5625\right)}{b \cdot \left(b \cdot \left(b \cdot \left(b \cdot b\right)\right)\right)}}\right), \frac{\left(c \cdot c\right) \cdot -0.375}{b \cdot \left(b \cdot b\right)}\right), \frac{c \cdot -0.5}{b}\right) \]
  3. Recombined 2 regimes into one program.
  4. Final simplification94.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq 0.38:\\ \;\;\;\;\frac{\frac{b \cdot b - \mathsf{fma}\left(c, a \cdot -3, b \cdot b\right)}{a \cdot \left(b + \sqrt{\mathsf{fma}\left(c, a \cdot -3, b \cdot b\right)}\right)}}{-3}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(a, \mathsf{fma}\left(a, \mathsf{fma}\left(\frac{\frac{\left(c \cdot \left(c \cdot \left(c \cdot c\right)\right)\right) \cdot \left(a \cdot 6.328125\right)}{\left(b \cdot b\right) \cdot \left(b \cdot \left(b \cdot \left(b \cdot b\right)\right)\right)}}{b}, -0.16666666666666666, \frac{c \cdot \left(\left(c \cdot c\right) \cdot -0.5625\right)}{b \cdot \left(b \cdot \left(b \cdot \left(b \cdot b\right)\right)\right)}\right), \frac{\left(c \cdot c\right) \cdot -0.375}{b \cdot \left(b \cdot b\right)}\right), \frac{c \cdot -0.5}{b}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 89.7% accurate, 0.6× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;\frac{1}{\mathsf{fma}\left(a, \mathsf{fma}\left(a \cdot 3, \frac{c}{b \cdot \left(b \cdot b\right)} \cdot 0.375, \frac{1.5}{b}\right), \frac{b \cdot -2}{c}\right)}\\


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

    1. Initial program 87.2%

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

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

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

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

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

        \[\leadsto \frac{\frac{b - \color{blue}{\sqrt{\mathsf{fma}\left(a, -3 \cdot c, b \cdot b\right)}}}{a}}{-3} \]
      5. flip--N/A

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

        \[\leadsto \frac{\color{blue}{\frac{b \cdot b - \sqrt{\mathsf{fma}\left(a, -3 \cdot c, b \cdot b\right)} \cdot \sqrt{\mathsf{fma}\left(a, -3 \cdot c, b \cdot b\right)}}{a \cdot \left(b + \sqrt{\mathsf{fma}\left(a, -3 \cdot c, b \cdot b\right)}\right)}}}{-3} \]
      7. lower-/.f64N/A

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

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

    if 0.38 < b

    1. Initial program 50.6%

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{1}{\frac{-3 \cdot a}{b - \sqrt{\mathsf{fma}\left(a, -3 \cdot c, b \cdot b\right)}}}} \]
      8. lower-/.f64N/A

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

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

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

        \[\leadsto \frac{1}{\frac{\mathsf{neg}\left(\color{blue}{3 \cdot a}\right)}{b - \sqrt{\mathsf{fma}\left(a, -3 \cdot c, b \cdot b\right)}}} \]
      12. lower-/.f64N/A

        \[\leadsto \frac{1}{\color{blue}{\frac{\mathsf{neg}\left(3 \cdot a\right)}{b - \sqrt{\mathsf{fma}\left(a, -3 \cdot c, b \cdot b\right)}}}} \]
      13. lift-*.f64N/A

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

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

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

        \[\leadsto \frac{1}{\frac{a \cdot \color{blue}{-3}}{b - \sqrt{\mathsf{fma}\left(a, -3 \cdot c, b \cdot b\right)}}} \]
      17. lower-*.f6450.6

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

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

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

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

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

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

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

Alternative 4: 85.0% accurate, 0.6× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;\frac{1}{\mathsf{fma}\left(-2, \frac{b}{c}, 1.5 \cdot \frac{a}{b}\right)}\\


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

    1. Initial program 87.2%

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

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

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

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

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

        \[\leadsto \frac{\frac{b - \color{blue}{\sqrt{\mathsf{fma}\left(a, -3 \cdot c, b \cdot b\right)}}}{a}}{-3} \]
      5. flip--N/A

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

        \[\leadsto \frac{\color{blue}{\frac{b \cdot b - \sqrt{\mathsf{fma}\left(a, -3 \cdot c, b \cdot b\right)} \cdot \sqrt{\mathsf{fma}\left(a, -3 \cdot c, b \cdot b\right)}}{a \cdot \left(b + \sqrt{\mathsf{fma}\left(a, -3 \cdot c, b \cdot b\right)}\right)}}}{-3} \]
      7. lower-/.f64N/A

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

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

    if 0.38 < b

    1. Initial program 50.6%

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{1}{\frac{-3 \cdot a}{b - \sqrt{\mathsf{fma}\left(a, -3 \cdot c, b \cdot b\right)}}}} \]
      8. lower-/.f64N/A

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

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

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

        \[\leadsto \frac{1}{\frac{\mathsf{neg}\left(\color{blue}{3 \cdot a}\right)}{b - \sqrt{\mathsf{fma}\left(a, -3 \cdot c, b \cdot b\right)}}} \]
      12. lower-/.f64N/A

        \[\leadsto \frac{1}{\color{blue}{\frac{\mathsf{neg}\left(3 \cdot a\right)}{b - \sqrt{\mathsf{fma}\left(a, -3 \cdot c, b \cdot b\right)}}}} \]
      13. lift-*.f64N/A

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

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

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

        \[\leadsto \frac{1}{\frac{a \cdot \color{blue}{-3}}{b - \sqrt{\mathsf{fma}\left(a, -3 \cdot c, b \cdot b\right)}}} \]
      17. lower-*.f6450.6

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

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

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

        \[\leadsto \frac{1}{\color{blue}{\mathsf{fma}\left(-2, \frac{b}{c}, \frac{3}{2} \cdot \frac{a}{b}\right)}} \]
      2. lower-/.f64N/A

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

        \[\leadsto \frac{1}{\mathsf{fma}\left(-2, \frac{b}{c}, \color{blue}{\frac{3}{2} \cdot \frac{a}{b}}\right)} \]
      4. lower-/.f6487.3

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

      \[\leadsto \frac{1}{\color{blue}{\mathsf{fma}\left(-2, \frac{b}{c}, 1.5 \cdot \frac{a}{b}\right)}} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 5: 85.0% accurate, 0.6× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;\frac{1}{\mathsf{fma}\left(-2, \frac{b}{c}, 1.5 \cdot \frac{a}{b}\right)}\\


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

    1. Initial program 87.2%

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{b - \sqrt{\mathsf{fma}\left(a, -3 \cdot c, b \cdot b\right)}}}{-3 \cdot a} \]
      8. flip--N/A

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

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

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

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

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

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

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

    if 0.38 < b

    1. Initial program 50.6%

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{1}{\frac{-3 \cdot a}{b - \sqrt{\mathsf{fma}\left(a, -3 \cdot c, b \cdot b\right)}}}} \]
      8. lower-/.f64N/A

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

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

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

        \[\leadsto \frac{1}{\frac{\mathsf{neg}\left(\color{blue}{3 \cdot a}\right)}{b - \sqrt{\mathsf{fma}\left(a, -3 \cdot c, b \cdot b\right)}}} \]
      12. lower-/.f64N/A

        \[\leadsto \frac{1}{\color{blue}{\frac{\mathsf{neg}\left(3 \cdot a\right)}{b - \sqrt{\mathsf{fma}\left(a, -3 \cdot c, b \cdot b\right)}}}} \]
      13. lift-*.f64N/A

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

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

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

        \[\leadsto \frac{1}{\frac{a \cdot \color{blue}{-3}}{b - \sqrt{\mathsf{fma}\left(a, -3 \cdot c, b \cdot b\right)}}} \]
      17. lower-*.f6450.6

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

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

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

        \[\leadsto \frac{1}{\color{blue}{\mathsf{fma}\left(-2, \frac{b}{c}, \frac{3}{2} \cdot \frac{a}{b}\right)}} \]
      2. lower-/.f64N/A

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

        \[\leadsto \frac{1}{\mathsf{fma}\left(-2, \frac{b}{c}, \color{blue}{\frac{3}{2} \cdot \frac{a}{b}}\right)} \]
      4. lower-/.f6487.3

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

      \[\leadsto \frac{1}{\color{blue}{\mathsf{fma}\left(-2, \frac{b}{c}, 1.5 \cdot \frac{a}{b}\right)}} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 6: 84.8% accurate, 0.9× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;\frac{1}{\mathsf{fma}\left(-2, \frac{b}{c}, 1.5 \cdot \frac{a}{b}\right)}\\


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

    1. Initial program 87.2%

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

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

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

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

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

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

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

        \[\leadsto \frac{\frac{b - \sqrt{\mathsf{fma}\left(b, b, \color{blue}{\left(-3 \cdot c\right) \cdot a}\right)}}{a}}{-3} \]
      7. lift-*.f64N/A

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

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

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

        \[\leadsto \frac{\frac{b - \sqrt{\mathsf{fma}\left(b, b, c \cdot \left(\color{blue}{\left(\mathsf{neg}\left(3\right)\right)} \cdot a\right)\right)}}{a}}{-3} \]
      11. distribute-lft-neg-inN/A

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

        \[\leadsto \frac{\frac{b - \sqrt{\mathsf{fma}\left(b, b, c \cdot \left(\mathsf{neg}\left(\color{blue}{3 \cdot a}\right)\right)\right)}}{a}}{-3} \]
      13. lower-*.f64N/A

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

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

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

        \[\leadsto \frac{\frac{b - \sqrt{\mathsf{fma}\left(b, b, c \cdot \color{blue}{\left(a \cdot \left(\mathsf{neg}\left(3\right)\right)\right)}\right)}}{a}}{-3} \]
      17. metadata-evalN/A

        \[\leadsto \frac{\frac{b - \sqrt{\mathsf{fma}\left(b, b, c \cdot \left(a \cdot \color{blue}{-3}\right)\right)}}{a}}{-3} \]
      18. lower-*.f6487.6

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

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

    if 0.38 < b

    1. Initial program 50.6%

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{1}{\frac{-3 \cdot a}{b - \sqrt{\mathsf{fma}\left(a, -3 \cdot c, b \cdot b\right)}}}} \]
      8. lower-/.f64N/A

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

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

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

        \[\leadsto \frac{1}{\frac{\mathsf{neg}\left(\color{blue}{3 \cdot a}\right)}{b - \sqrt{\mathsf{fma}\left(a, -3 \cdot c, b \cdot b\right)}}} \]
      12. lower-/.f64N/A

        \[\leadsto \frac{1}{\color{blue}{\frac{\mathsf{neg}\left(3 \cdot a\right)}{b - \sqrt{\mathsf{fma}\left(a, -3 \cdot c, b \cdot b\right)}}}} \]
      13. lift-*.f64N/A

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

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

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

        \[\leadsto \frac{1}{\frac{a \cdot \color{blue}{-3}}{b - \sqrt{\mathsf{fma}\left(a, -3 \cdot c, b \cdot b\right)}}} \]
      17. lower-*.f6450.6

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

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

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

        \[\leadsto \frac{1}{\color{blue}{\mathsf{fma}\left(-2, \frac{b}{c}, \frac{3}{2} \cdot \frac{a}{b}\right)}} \]
      2. lower-/.f64N/A

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

        \[\leadsto \frac{1}{\mathsf{fma}\left(-2, \frac{b}{c}, \color{blue}{\frac{3}{2} \cdot \frac{a}{b}}\right)} \]
      4. lower-/.f6487.3

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

      \[\leadsto \frac{1}{\color{blue}{\mathsf{fma}\left(-2, \frac{b}{c}, 1.5 \cdot \frac{a}{b}\right)}} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 7: 84.8% accurate, 0.9× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;\frac{1}{\mathsf{fma}\left(-2, \frac{b}{c}, 1.5 \cdot \frac{a}{b}\right)}\\


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

    1. Initial program 87.2%

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

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

    if 0.38 < b

    1. Initial program 50.6%

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{1}{\frac{-3 \cdot a}{b - \sqrt{\mathsf{fma}\left(a, -3 \cdot c, b \cdot b\right)}}}} \]
      8. lower-/.f64N/A

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

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

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

        \[\leadsto \frac{1}{\frac{\mathsf{neg}\left(\color{blue}{3 \cdot a}\right)}{b - \sqrt{\mathsf{fma}\left(a, -3 \cdot c, b \cdot b\right)}}} \]
      12. lower-/.f64N/A

        \[\leadsto \frac{1}{\color{blue}{\frac{\mathsf{neg}\left(3 \cdot a\right)}{b - \sqrt{\mathsf{fma}\left(a, -3 \cdot c, b \cdot b\right)}}}} \]
      13. lift-*.f64N/A

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

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

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

        \[\leadsto \frac{1}{\frac{a \cdot \color{blue}{-3}}{b - \sqrt{\mathsf{fma}\left(a, -3 \cdot c, b \cdot b\right)}}} \]
      17. lower-*.f6450.6

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

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

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

        \[\leadsto \frac{1}{\color{blue}{\mathsf{fma}\left(-2, \frac{b}{c}, \frac{3}{2} \cdot \frac{a}{b}\right)}} \]
      2. lower-/.f64N/A

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

        \[\leadsto \frac{1}{\mathsf{fma}\left(-2, \frac{b}{c}, \color{blue}{\frac{3}{2} \cdot \frac{a}{b}}\right)} \]
      4. lower-/.f6487.3

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

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

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

Alternative 8: 84.8% accurate, 1.0× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;\frac{1}{\mathsf{fma}\left(-2, \frac{b}{c}, 1.5 \cdot \frac{a}{b}\right)}\\


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

    1. Initial program 87.2%

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

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

    if 0.38 < b

    1. Initial program 50.6%

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{1}{\frac{-3 \cdot a}{b - \sqrt{\mathsf{fma}\left(a, -3 \cdot c, b \cdot b\right)}}}} \]
      8. lower-/.f64N/A

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

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

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

        \[\leadsto \frac{1}{\frac{\mathsf{neg}\left(\color{blue}{3 \cdot a}\right)}{b - \sqrt{\mathsf{fma}\left(a, -3 \cdot c, b \cdot b\right)}}} \]
      12. lower-/.f64N/A

        \[\leadsto \frac{1}{\color{blue}{\frac{\mathsf{neg}\left(3 \cdot a\right)}{b - \sqrt{\mathsf{fma}\left(a, -3 \cdot c, b \cdot b\right)}}}} \]
      13. lift-*.f64N/A

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

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

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

        \[\leadsto \frac{1}{\frac{a \cdot \color{blue}{-3}}{b - \sqrt{\mathsf{fma}\left(a, -3 \cdot c, b \cdot b\right)}}} \]
      17. lower-*.f6450.6

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

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

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

        \[\leadsto \frac{1}{\color{blue}{\mathsf{fma}\left(-2, \frac{b}{c}, \frac{3}{2} \cdot \frac{a}{b}\right)}} \]
      2. lower-/.f64N/A

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

        \[\leadsto \frac{1}{\mathsf{fma}\left(-2, \frac{b}{c}, \color{blue}{\frac{3}{2} \cdot \frac{a}{b}}\right)} \]
      4. lower-/.f6487.3

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

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

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

Alternative 9: 81.3% accurate, 1.1× speedup?

\[\begin{array}{l} \\ \frac{1}{\mathsf{fma}\left(-2, \frac{b}{c}, 1.5 \cdot \frac{a}{b}\right)} \end{array} \]
(FPCore (a b c) :precision binary64 (/ 1.0 (fma -2.0 (/ b c) (* 1.5 (/ a b)))))
double code(double a, double b, double c) {
	return 1.0 / fma(-2.0, (b / c), (1.5 * (a / b)));
}
function code(a, b, c)
	return Float64(1.0 / fma(-2.0, Float64(b / c), Float64(1.5 * Float64(a / b))))
end
code[a_, b_, c_] := N[(1.0 / N[(-2.0 * N[(b / c), $MachinePrecision] + N[(1.5 * N[(a / b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\frac{1}{\mathsf{fma}\left(-2, \frac{b}{c}, 1.5 \cdot \frac{a}{b}\right)}
\end{array}
Derivation
  1. Initial program 54.0%

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{1}{\frac{-3 \cdot a}{b - \sqrt{\mathsf{fma}\left(a, -3 \cdot c, b \cdot b\right)}}}} \]
    8. lower-/.f64N/A

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

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

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

      \[\leadsto \frac{1}{\frac{\mathsf{neg}\left(\color{blue}{3 \cdot a}\right)}{b - \sqrt{\mathsf{fma}\left(a, -3 \cdot c, b \cdot b\right)}}} \]
    12. lower-/.f64N/A

      \[\leadsto \frac{1}{\color{blue}{\frac{\mathsf{neg}\left(3 \cdot a\right)}{b - \sqrt{\mathsf{fma}\left(a, -3 \cdot c, b \cdot b\right)}}}} \]
    13. lift-*.f64N/A

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

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

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

      \[\leadsto \frac{1}{\frac{a \cdot \color{blue}{-3}}{b - \sqrt{\mathsf{fma}\left(a, -3 \cdot c, b \cdot b\right)}}} \]
    17. lower-*.f6454.0

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

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

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

      \[\leadsto \frac{1}{\color{blue}{\mathsf{fma}\left(-2, \frac{b}{c}, \frac{3}{2} \cdot \frac{a}{b}\right)}} \]
    2. lower-/.f64N/A

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

      \[\leadsto \frac{1}{\mathsf{fma}\left(-2, \frac{b}{c}, \color{blue}{\frac{3}{2} \cdot \frac{a}{b}}\right)} \]
    4. lower-/.f6483.6

      \[\leadsto \frac{1}{\mathsf{fma}\left(-2, \frac{b}{c}, 1.5 \cdot \color{blue}{\frac{a}{b}}\right)} \]
  8. Simplified83.6%

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

Alternative 10: 63.7% accurate, 2.9× speedup?

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

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

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

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

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

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

      \[\leadsto \frac{\color{blue}{c \cdot \frac{-1}{2}}}{b} \]
    4. lower-*.f6465.8

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

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

Alternative 11: 63.6% accurate, 2.9× speedup?

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

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

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

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

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

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

      \[\leadsto \frac{\color{blue}{c \cdot \frac{-1}{2}}}{b} \]
    4. lower-*.f6465.8

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

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

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

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

      \[\leadsto \color{blue}{\frac{\frac{-1}{2}}{b} \cdot c} \]
    4. lower-/.f6465.7

      \[\leadsto \color{blue}{\frac{-0.5}{b}} \cdot c \]
  7. Applied egg-rr65.7%

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

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

Reproduce

?
herbie shell --seed 2024219 
(FPCore (a b c)
  :name "Cubic critical, 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) (* (* 3.0 a) c)))) (* 3.0 a)))