?

Average Accuracy: 55.8% → 91.7%
Time: 24.0s
Precision: binary64
Cost: 61828

?

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

\mathbf{else}:\\
\;\;\;\;0.5 \cdot \left(\left({c}^{3} \cdot \frac{a \cdot a}{\frac{{b}^{5}}{-4}} + \left(c \cdot c\right) \cdot \left(\frac{a}{{b}^{3}} + 2 \cdot \frac{\frac{a \cdot a}{{b}^{4}} \cdot -1.5}{\frac{a}{b}}\right)\right) + {c}^{4} \cdot \left(\frac{\frac{{a}^{4}}{{b}^{8}} \cdot 2.25}{\frac{a}{b}} + -12.25 \cdot \frac{{a}^{3}}{{b}^{7}}\right)\right) - \frac{c}{b}\\


\end{array}

Error?

Try it out?

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation?

  1. Split input into 2 regimes
  2. if b < 0.55000000000000004

    1. Initial program 82.5%

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

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

      [Start]82.5

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

      *-commutative [=>]82.5

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

      +-commutative [=>]82.5

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

      unsub-neg [=>]82.5

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

      fma-neg [=>]82.6

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

      associate-*l* [=>]82.6

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

      *-commutative [=>]82.6

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

      distribute-rgt-neg-in [=>]82.6

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

      metadata-eval [=>]82.6

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

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

      [Start]82.6

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

      fma-udef [=>]82.5

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

      associate-*l* [=>]82.5

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

    if 0.55000000000000004 < b

    1. Initial program 51.6%

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

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

      [Start]51.6

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

      *-commutative [=>]51.6

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

      +-commutative [=>]51.6

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

      unsub-neg [=>]51.6

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

      fma-neg [=>]51.7

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

      associate-*l* [=>]51.7

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

      *-commutative [=>]51.7

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

      distribute-rgt-neg-in [=>]51.7

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

      metadata-eval [=>]51.7

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

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

      [Start]51.7

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

      add-sqr-sqrt [=>]50.6

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

      fma-neg [=>]51.2

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

      pow1/2 [=>]51.2

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

      sqrt-pow1 [=>]51.8

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

      fma-udef [=>]51.8

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

      +-commutative [=>]51.8

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

      associate-*l* [=>]51.8

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

      fma-def [=>]51.8

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

      metadata-eval [=>]51.8

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

      pow1/2 [=>]51.8

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

      sqrt-pow1 [=>]51.6

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

      fma-udef [=>]51.3

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

      +-commutative [=>]51.3

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

      associate-*l* [=>]51.3

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

      fma-def [=>]51.3

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

      metadata-eval [=>]51.3

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

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

      \[\leadsto \color{blue}{0.5 \cdot \left(\left({c}^{3} \cdot \mathsf{fma}\left(-2, \frac{\frac{a \cdot a}{{b}^{4}} \cdot -1.5}{b}, 2 \cdot \frac{\frac{{a}^{3}}{{b}^{6}} \cdot -3.5}{\frac{a}{b}}\right) + \left(c \cdot c\right) \cdot \left(\frac{a}{{b}^{3}} + 2 \cdot \frac{\frac{a \cdot a}{{b}^{4}} \cdot -1.5}{\frac{a}{b}}\right)\right) + {c}^{4} \cdot \left(\frac{\frac{{a}^{4}}{{b}^{8}} \cdot 2.25}{\frac{a}{b}} + \mathsf{fma}\left(-2, \frac{\frac{{a}^{3}}{{b}^{6}} \cdot -3.5}{b}, 2 \cdot \frac{b}{\frac{a}{\frac{{a}^{4}}{{b}^{8}} \cdot 1 + \frac{{a}^{4}}{{b}^{8}} \cdot -10.625}}\right)\right)\right) - \frac{c}{b}} \]
      Proof

      [Start]93.1

      \[ -1 \cdot \frac{c}{b} + \left(0.5 \cdot \left({c}^{4} \cdot \left(\frac{{\left(0.5 \cdot \frac{{a}^{2}}{{b}^{4}} + -2 \cdot \frac{{a}^{2}}{{b}^{4}}\right)}^{2} \cdot b}{a} + \left(-2 \cdot \frac{-0.16666666666666666 \cdot \frac{{a}^{3}}{{b}^{6}} + \left(2 \cdot \frac{{a}^{3}}{{b}^{6}} + -5.333333333333333 \cdot \frac{{a}^{3}}{{b}^{6}}\right)}{b} + 2 \cdot \frac{b \cdot \left(2 \cdot \frac{{a}^{4}}{{b}^{8}} + \left(-1 \cdot \frac{{a}^{4}}{{b}^{8}} + \left(5.333333333333333 \cdot \frac{{a}^{4}}{{b}^{8}} + \left(-16 \cdot \frac{{a}^{4}}{{b}^{8}} + 0.041666666666666664 \cdot \frac{{a}^{4}}{{b}^{8}}\right)\right)\right)\right)}{a}\right)\right)\right) + \left(0.5 \cdot \left({c}^{3} \cdot \left(-2 \cdot \frac{0.5 \cdot \frac{{a}^{2}}{{b}^{4}} + -2 \cdot \frac{{a}^{2}}{{b}^{4}}}{b} + 2 \cdot \frac{\left(-0.16666666666666666 \cdot \frac{{a}^{3}}{{b}^{6}} + \left(2 \cdot \frac{{a}^{3}}{{b}^{6}} + -5.333333333333333 \cdot \frac{{a}^{3}}{{b}^{6}}\right)\right) \cdot b}{a}\right)\right) + 0.5 \cdot \left({c}^{2} \cdot \left(\frac{a}{{b}^{3}} + 2 \cdot \frac{\left(0.5 \cdot \frac{{a}^{2}}{{b}^{4}} + -2 \cdot \frac{{a}^{2}}{{b}^{4}}\right) \cdot b}{a}\right)\right)\right)\right) \]
    6. Taylor expanded in a around 0 93.1%

      \[\leadsto 0.5 \cdot \left(\left({c}^{3} \cdot \mathsf{fma}\left(-2, \frac{\frac{a \cdot a}{{b}^{4}} \cdot -1.5}{b}, 2 \cdot \frac{\frac{{a}^{3}}{{b}^{6}} \cdot -3.5}{\frac{a}{b}}\right) + \left(c \cdot c\right) \cdot \left(\frac{a}{{b}^{3}} + 2 \cdot \frac{\frac{a \cdot a}{{b}^{4}} \cdot -1.5}{\frac{a}{b}}\right)\right) + {c}^{4} \cdot \left(\frac{\frac{{a}^{4}}{{b}^{8}} \cdot 2.25}{\frac{a}{b}} + \color{blue}{-12.25 \cdot \frac{{a}^{3}}{{b}^{7}}}\right)\right) - \frac{c}{b} \]
    7. Taylor expanded in a around 0 93.1%

      \[\leadsto 0.5 \cdot \left(\left({c}^{3} \cdot \color{blue}{\left(-4 \cdot \frac{{a}^{2}}{{b}^{5}}\right)} + \left(c \cdot c\right) \cdot \left(\frac{a}{{b}^{3}} + 2 \cdot \frac{\frac{a \cdot a}{{b}^{4}} \cdot -1.5}{\frac{a}{b}}\right)\right) + {c}^{4} \cdot \left(\frac{\frac{{a}^{4}}{{b}^{8}} \cdot 2.25}{\frac{a}{b}} + -12.25 \cdot \frac{{a}^{3}}{{b}^{7}}\right)\right) - \frac{c}{b} \]
    8. Simplified93.1%

      \[\leadsto 0.5 \cdot \left(\left({c}^{3} \cdot \color{blue}{\frac{a \cdot a}{\frac{{b}^{5}}{-4}}} + \left(c \cdot c\right) \cdot \left(\frac{a}{{b}^{3}} + 2 \cdot \frac{\frac{a \cdot a}{{b}^{4}} \cdot -1.5}{\frac{a}{b}}\right)\right) + {c}^{4} \cdot \left(\frac{\frac{{a}^{4}}{{b}^{8}} \cdot 2.25}{\frac{a}{b}} + -12.25 \cdot \frac{{a}^{3}}{{b}^{7}}\right)\right) - \frac{c}{b} \]
      Proof

      [Start]93.1

      \[ 0.5 \cdot \left(\left({c}^{3} \cdot \left(-4 \cdot \frac{{a}^{2}}{{b}^{5}}\right) + \left(c \cdot c\right) \cdot \left(\frac{a}{{b}^{3}} + 2 \cdot \frac{\frac{a \cdot a}{{b}^{4}} \cdot -1.5}{\frac{a}{b}}\right)\right) + {c}^{4} \cdot \left(\frac{\frac{{a}^{4}}{{b}^{8}} \cdot 2.25}{\frac{a}{b}} + -12.25 \cdot \frac{{a}^{3}}{{b}^{7}}\right)\right) - \frac{c}{b} \]

      *-commutative [=>]93.1

      \[ 0.5 \cdot \left(\left({c}^{3} \cdot \color{blue}{\left(\frac{{a}^{2}}{{b}^{5}} \cdot -4\right)} + \left(c \cdot c\right) \cdot \left(\frac{a}{{b}^{3}} + 2 \cdot \frac{\frac{a \cdot a}{{b}^{4}} \cdot -1.5}{\frac{a}{b}}\right)\right) + {c}^{4} \cdot \left(\frac{\frac{{a}^{4}}{{b}^{8}} \cdot 2.25}{\frac{a}{b}} + -12.25 \cdot \frac{{a}^{3}}{{b}^{7}}\right)\right) - \frac{c}{b} \]

      associate-/r/ [<=]93.1

      \[ 0.5 \cdot \left(\left({c}^{3} \cdot \color{blue}{\frac{{a}^{2}}{\frac{{b}^{5}}{-4}}} + \left(c \cdot c\right) \cdot \left(\frac{a}{{b}^{3}} + 2 \cdot \frac{\frac{a \cdot a}{{b}^{4}} \cdot -1.5}{\frac{a}{b}}\right)\right) + {c}^{4} \cdot \left(\frac{\frac{{a}^{4}}{{b}^{8}} \cdot 2.25}{\frac{a}{b}} + -12.25 \cdot \frac{{a}^{3}}{{b}^{7}}\right)\right) - \frac{c}{b} \]

      unpow2 [=>]93.1

      \[ 0.5 \cdot \left(\left({c}^{3} \cdot \frac{\color{blue}{a \cdot a}}{\frac{{b}^{5}}{-4}} + \left(c \cdot c\right) \cdot \left(\frac{a}{{b}^{3}} + 2 \cdot \frac{\frac{a \cdot a}{{b}^{4}} \cdot -1.5}{\frac{a}{b}}\right)\right) + {c}^{4} \cdot \left(\frac{\frac{{a}^{4}}{{b}^{8}} \cdot 2.25}{\frac{a}{b}} + -12.25 \cdot \frac{{a}^{3}}{{b}^{7}}\right)\right) - \frac{c}{b} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification91.7%

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq 0.55:\\ \;\;\;\;\frac{\sqrt{b \cdot b + a \cdot \left(c \cdot -4\right)} - b}{a \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;0.5 \cdot \left(\left({c}^{3} \cdot \frac{a \cdot a}{\frac{{b}^{5}}{-4}} + \left(c \cdot c\right) \cdot \left(\frac{a}{{b}^{3}} + 2 \cdot \frac{\frac{a \cdot a}{{b}^{4}} \cdot -1.5}{\frac{a}{b}}\right)\right) + {c}^{4} \cdot \left(\frac{\frac{{a}^{4}}{{b}^{8}} \cdot 2.25}{\frac{a}{b}} + -12.25 \cdot \frac{{a}^{3}}{{b}^{7}}\right)\right) - \frac{c}{b}\\ \end{array} \]

Alternatives

Alternative 1
Accuracy88.4%
Cost49412
\[\begin{array}{l} t_0 := \frac{c \cdot c}{{b}^{4}}\\ \mathbf{if}\;\frac{\sqrt{b \cdot b - c \cdot \left(a \cdot 4\right)} - b}{a \cdot 2} \leq -0.01:\\ \;\;\;\;\frac{\sqrt{\mathsf{fma}\left(b, b, -4 \cdot \left(a \cdot c\right)\right)} - b}{a \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;0.5 \cdot \left(a \cdot \left(\frac{c \cdot c}{{b}^{3}} + 2 \cdot \left(-1.5 \cdot \left(b \cdot t_0\right)\right)\right) + \left(a \cdot a\right) \cdot \mathsf{fma}\left(2, b \cdot \left(\frac{{c}^{3}}{{b}^{6}} \cdot -3.5\right), -2 \cdot \frac{-1.5 \cdot \left(c \cdot t_0\right)}{b}\right)\right) - \frac{c}{b}\\ \end{array} \]
Alternative 2
Accuracy91.6%
Cost47108
\[\begin{array}{l} \mathbf{if}\;b \leq 0.55:\\ \;\;\;\;\frac{\sqrt{b \cdot b + a \cdot \left(c \cdot -4\right)} - b}{a \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\frac{-0.25}{a}, \frac{{\left(a \cdot c\right)}^{4} \cdot 20}{{b}^{7}}, -2 \cdot \left(\left(a \cdot a\right) \cdot \frac{{c}^{3}}{{b}^{5}}\right) - \mathsf{fma}\left(\frac{c}{\frac{{b}^{3}}{c}}, a, \frac{c}{b}\right)\right)\\ \end{array} \]
Alternative 3
Accuracy83.2%
Cost35917
\[\begin{array}{l} t_0 := \frac{\sqrt{b \cdot b - c \cdot \left(a \cdot 4\right)} - b}{a \cdot 2}\\ \mathbf{if}\;t_0 \leq -0.00245 \lor \neg \left(t_0 \leq -1.5 \cdot 10^{-6}\right) \land t_0 \leq -1.65 \cdot 10^{-7}:\\ \;\;\;\;\frac{\sqrt{\mathsf{fma}\left(b, b, -4 \cdot \left(a \cdot c\right)\right)} - b}{a \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;\frac{c \cdot \left(c \cdot \left(-a\right)\right)}{{b}^{3}} - \frac{c}{b}\\ \end{array} \]
Alternative 4
Accuracy83.2%
Cost29645
\[\begin{array}{l} t_0 := \frac{\sqrt{b \cdot b - c \cdot \left(a \cdot 4\right)} - b}{a \cdot 2}\\ \mathbf{if}\;t_0 \leq -0.00245 \lor \neg \left(t_0 \leq -1.5 \cdot 10^{-6}\right) \land t_0 \leq -1.65 \cdot 10^{-7}:\\ \;\;\;\;\frac{\sqrt{b \cdot b + a \cdot \left(c \cdot -4\right)} - b}{a \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;\frac{c \cdot \left(c \cdot \left(-a\right)\right)}{{b}^{3}} - \frac{c}{b}\\ \end{array} \]
Alternative 5
Accuracy83.2%
Cost29645
\[\begin{array}{l} t_0 := \frac{\sqrt{b \cdot b - c \cdot \left(a \cdot 4\right)} - b}{a \cdot 2}\\ \mathbf{if}\;t_0 \leq -0.00245:\\ \;\;\;\;\left(\sqrt{\mathsf{fma}\left(b, b, -4 \cdot \left(a \cdot c\right)\right)} - b\right) \cdot \frac{0.5}{a}\\ \mathbf{elif}\;t_0 \leq -1.5 \cdot 10^{-6} \lor \neg \left(t_0 \leq -1.65 \cdot 10^{-7}\right):\\ \;\;\;\;\frac{c \cdot \left(c \cdot \left(-a\right)\right)}{{b}^{3}} - \frac{c}{b}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{b \cdot b + a \cdot \left(c \cdot -4\right)} - b}{a \cdot 2}\\ \end{array} \]
Alternative 6
Accuracy88.3%
Cost28164
\[\begin{array}{l} \mathbf{if}\;\frac{\sqrt{b \cdot b - c \cdot \left(a \cdot 4\right)} - b}{a \cdot 2} \leq -0.01:\\ \;\;\;\;\frac{\sqrt{\mathsf{fma}\left(b, b, -4 \cdot \left(a \cdot c\right)\right)} - b}{a \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;\left(\frac{{c}^{3} \cdot -2}{\frac{{b}^{5}}{a \cdot a}} - \frac{c}{b}\right) - a \cdot \frac{c}{\frac{{b}^{3}}{c}}\\ \end{array} \]
Alternative 7
Accuracy84.7%
Cost7492
\[\begin{array}{l} \mathbf{if}\;b \leq 0.6:\\ \;\;\;\;\left(\sqrt{b \cdot b + a \cdot \left(c \cdot -4\right)} - b\right) \cdot \frac{0.5}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{c \cdot \left(c \cdot \left(-a\right)\right)}{{b}^{3}} - \frac{c}{b}\\ \end{array} \]
Alternative 8
Accuracy81.5%
Cost7232
\[\frac{c \cdot \left(c \cdot \left(-a\right)\right)}{{b}^{3}} - \frac{c}{b} \]
Alternative 9
Accuracy81.3%
Cost1600
\[\frac{-2 \cdot \left(\frac{c \cdot c}{\frac{b \cdot b}{a} \cdot \frac{b}{a}} + \frac{c}{\frac{b}{a}}\right)}{a \cdot 2} \]
Alternative 10
Accuracy64.1%
Cost256
\[\frac{-c}{b} \]
Alternative 11
Accuracy3.2%
Cost64
\[0 \]

Error

Reproduce?

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