?

Average Error: 52.1 → 44.6
Time: 39.9s
Precision: binary64
Cost: 142796

?

\[\frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
\[\begin{array}{l} t_0 := {\left(A - C\right)}^{2}\\ t_1 := {B}^{2} - \left(4 \cdot A\right) \cdot C\\ t_2 := \frac{-\sqrt{\left(2 \cdot \left(t_1 \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{t_0 + {B}^{2}}\right)}}{t_1}\\ t_3 := \frac{-\frac{\sqrt{\left({B}^{2} + -4 \cdot \left(C \cdot A\right)\right) \cdot \left(F \cdot \left(4 \cdot A\right)\right)}}{1}}{{B}^{2} - 4 \cdot \left(C \cdot A\right)}\\ \mathbf{if}\;t_2 \leq -\infty:\\ \;\;\;\;t_3\\ \mathbf{elif}\;t_2 \leq -5 \cdot 10^{-219}:\\ \;\;\;\;\frac{-\sqrt{2 \cdot \left(\left(F \cdot \left({B}^{2} - A \cdot \left(4 \cdot C\right)\right)\right) \cdot \left(C + \left(A + \sqrt{{B}^{2} + t_0}\right)\right)\right)}}{t_1}\\ \mathbf{elif}\;t_2 \leq \infty:\\ \;\;\;\;t_3\\ \mathbf{else}:\\ \;\;\;\;-\frac{\sqrt{2}}{B} \cdot \sqrt{F \cdot B}\\ \end{array} \]
(FPCore (A B C F)
 :precision binary64
 (/
  (-
   (sqrt
    (*
     (* 2.0 (* (- (pow B 2.0) (* (* 4.0 A) C)) F))
     (+ (+ A C) (sqrt (+ (pow (- A C) 2.0) (pow B 2.0)))))))
  (- (pow B 2.0) (* (* 4.0 A) C))))
(FPCore (A B C F)
 :precision binary64
 (let* ((t_0 (pow (- A C) 2.0))
        (t_1 (- (pow B 2.0) (* (* 4.0 A) C)))
        (t_2
         (/
          (-
           (sqrt (* (* 2.0 (* t_1 F)) (+ (+ A C) (sqrt (+ t_0 (pow B 2.0)))))))
          t_1))
        (t_3
         (/
          (-
           (/ (sqrt (* (+ (pow B 2.0) (* -4.0 (* C A))) (* F (* 4.0 A)))) 1.0))
          (- (pow B 2.0) (* 4.0 (* C A))))))
   (if (<= t_2 (- INFINITY))
     t_3
     (if (<= t_2 -5e-219)
       (/
        (-
         (sqrt
          (*
           2.0
           (*
            (* F (- (pow B 2.0) (* A (* 4.0 C))))
            (+ C (+ A (sqrt (+ (pow B 2.0) t_0))))))))
        t_1)
       (if (<= t_2 INFINITY) t_3 (- (* (/ (sqrt 2.0) B) (sqrt (* F B)))))))))
double code(double A, double B, double C, double F) {
	return -sqrt(((2.0 * ((pow(B, 2.0) - ((4.0 * A) * C)) * F)) * ((A + C) + sqrt((pow((A - C), 2.0) + pow(B, 2.0)))))) / (pow(B, 2.0) - ((4.0 * A) * C));
}
double code(double A, double B, double C, double F) {
	double t_0 = pow((A - C), 2.0);
	double t_1 = pow(B, 2.0) - ((4.0 * A) * C);
	double t_2 = -sqrt(((2.0 * (t_1 * F)) * ((A + C) + sqrt((t_0 + pow(B, 2.0)))))) / t_1;
	double t_3 = -(sqrt(((pow(B, 2.0) + (-4.0 * (C * A))) * (F * (4.0 * A)))) / 1.0) / (pow(B, 2.0) - (4.0 * (C * A)));
	double tmp;
	if (t_2 <= -((double) INFINITY)) {
		tmp = t_3;
	} else if (t_2 <= -5e-219) {
		tmp = -sqrt((2.0 * ((F * (pow(B, 2.0) - (A * (4.0 * C)))) * (C + (A + sqrt((pow(B, 2.0) + t_0))))))) / t_1;
	} else if (t_2 <= ((double) INFINITY)) {
		tmp = t_3;
	} else {
		tmp = -((sqrt(2.0) / B) * sqrt((F * B)));
	}
	return tmp;
}
public static double code(double A, double B, double C, double F) {
	return -Math.sqrt(((2.0 * ((Math.pow(B, 2.0) - ((4.0 * A) * C)) * F)) * ((A + C) + Math.sqrt((Math.pow((A - C), 2.0) + Math.pow(B, 2.0)))))) / (Math.pow(B, 2.0) - ((4.0 * A) * C));
}
public static double code(double A, double B, double C, double F) {
	double t_0 = Math.pow((A - C), 2.0);
	double t_1 = Math.pow(B, 2.0) - ((4.0 * A) * C);
	double t_2 = -Math.sqrt(((2.0 * (t_1 * F)) * ((A + C) + Math.sqrt((t_0 + Math.pow(B, 2.0)))))) / t_1;
	double t_3 = -(Math.sqrt(((Math.pow(B, 2.0) + (-4.0 * (C * A))) * (F * (4.0 * A)))) / 1.0) / (Math.pow(B, 2.0) - (4.0 * (C * A)));
	double tmp;
	if (t_2 <= -Double.POSITIVE_INFINITY) {
		tmp = t_3;
	} else if (t_2 <= -5e-219) {
		tmp = -Math.sqrt((2.0 * ((F * (Math.pow(B, 2.0) - (A * (4.0 * C)))) * (C + (A + Math.sqrt((Math.pow(B, 2.0) + t_0))))))) / t_1;
	} else if (t_2 <= Double.POSITIVE_INFINITY) {
		tmp = t_3;
	} else {
		tmp = -((Math.sqrt(2.0) / B) * Math.sqrt((F * B)));
	}
	return tmp;
}
def code(A, B, C, F):
	return -math.sqrt(((2.0 * ((math.pow(B, 2.0) - ((4.0 * A) * C)) * F)) * ((A + C) + math.sqrt((math.pow((A - C), 2.0) + math.pow(B, 2.0)))))) / (math.pow(B, 2.0) - ((4.0 * A) * C))
def code(A, B, C, F):
	t_0 = math.pow((A - C), 2.0)
	t_1 = math.pow(B, 2.0) - ((4.0 * A) * C)
	t_2 = -math.sqrt(((2.0 * (t_1 * F)) * ((A + C) + math.sqrt((t_0 + math.pow(B, 2.0)))))) / t_1
	t_3 = -(math.sqrt(((math.pow(B, 2.0) + (-4.0 * (C * A))) * (F * (4.0 * A)))) / 1.0) / (math.pow(B, 2.0) - (4.0 * (C * A)))
	tmp = 0
	if t_2 <= -math.inf:
		tmp = t_3
	elif t_2 <= -5e-219:
		tmp = -math.sqrt((2.0 * ((F * (math.pow(B, 2.0) - (A * (4.0 * C)))) * (C + (A + math.sqrt((math.pow(B, 2.0) + t_0))))))) / t_1
	elif t_2 <= math.inf:
		tmp = t_3
	else:
		tmp = -((math.sqrt(2.0) / B) * math.sqrt((F * B)))
	return tmp
function code(A, B, C, F)
	return Float64(Float64(-sqrt(Float64(Float64(2.0 * Float64(Float64((B ^ 2.0) - Float64(Float64(4.0 * A) * C)) * F)) * Float64(Float64(A + C) + sqrt(Float64((Float64(A - C) ^ 2.0) + (B ^ 2.0))))))) / Float64((B ^ 2.0) - Float64(Float64(4.0 * A) * C)))
end
function code(A, B, C, F)
	t_0 = Float64(A - C) ^ 2.0
	t_1 = Float64((B ^ 2.0) - Float64(Float64(4.0 * A) * C))
	t_2 = Float64(Float64(-sqrt(Float64(Float64(2.0 * Float64(t_1 * F)) * Float64(Float64(A + C) + sqrt(Float64(t_0 + (B ^ 2.0))))))) / t_1)
	t_3 = Float64(Float64(-Float64(sqrt(Float64(Float64((B ^ 2.0) + Float64(-4.0 * Float64(C * A))) * Float64(F * Float64(4.0 * A)))) / 1.0)) / Float64((B ^ 2.0) - Float64(4.0 * Float64(C * A))))
	tmp = 0.0
	if (t_2 <= Float64(-Inf))
		tmp = t_3;
	elseif (t_2 <= -5e-219)
		tmp = Float64(Float64(-sqrt(Float64(2.0 * Float64(Float64(F * Float64((B ^ 2.0) - Float64(A * Float64(4.0 * C)))) * Float64(C + Float64(A + sqrt(Float64((B ^ 2.0) + t_0)))))))) / t_1);
	elseif (t_2 <= Inf)
		tmp = t_3;
	else
		tmp = Float64(-Float64(Float64(sqrt(2.0) / B) * sqrt(Float64(F * B))));
	end
	return tmp
end
function tmp = code(A, B, C, F)
	tmp = -sqrt(((2.0 * (((B ^ 2.0) - ((4.0 * A) * C)) * F)) * ((A + C) + sqrt((((A - C) ^ 2.0) + (B ^ 2.0)))))) / ((B ^ 2.0) - ((4.0 * A) * C));
end
function tmp_2 = code(A, B, C, F)
	t_0 = (A - C) ^ 2.0;
	t_1 = (B ^ 2.0) - ((4.0 * A) * C);
	t_2 = -sqrt(((2.0 * (t_1 * F)) * ((A + C) + sqrt((t_0 + (B ^ 2.0)))))) / t_1;
	t_3 = -(sqrt((((B ^ 2.0) + (-4.0 * (C * A))) * (F * (4.0 * A)))) / 1.0) / ((B ^ 2.0) - (4.0 * (C * A)));
	tmp = 0.0;
	if (t_2 <= -Inf)
		tmp = t_3;
	elseif (t_2 <= -5e-219)
		tmp = -sqrt((2.0 * ((F * ((B ^ 2.0) - (A * (4.0 * C)))) * (C + (A + sqrt(((B ^ 2.0) + t_0))))))) / t_1;
	elseif (t_2 <= Inf)
		tmp = t_3;
	else
		tmp = -((sqrt(2.0) / B) * sqrt((F * B)));
	end
	tmp_2 = tmp;
end
code[A_, B_, C_, F_] := N[((-N[Sqrt[N[(N[(2.0 * N[(N[(N[Power[B, 2.0], $MachinePrecision] - N[(N[(4.0 * A), $MachinePrecision] * C), $MachinePrecision]), $MachinePrecision] * F), $MachinePrecision]), $MachinePrecision] * N[(N[(A + C), $MachinePrecision] + N[Sqrt[N[(N[Power[N[(A - C), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[B, 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / N[(N[Power[B, 2.0], $MachinePrecision] - N[(N[(4.0 * A), $MachinePrecision] * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
code[A_, B_, C_, F_] := Block[{t$95$0 = N[Power[N[(A - C), $MachinePrecision], 2.0], $MachinePrecision]}, Block[{t$95$1 = N[(N[Power[B, 2.0], $MachinePrecision] - N[(N[(4.0 * A), $MachinePrecision] * C), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[((-N[Sqrt[N[(N[(2.0 * N[(t$95$1 * F), $MachinePrecision]), $MachinePrecision] * N[(N[(A + C), $MachinePrecision] + N[Sqrt[N[(t$95$0 + N[Power[B, 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$1), $MachinePrecision]}, Block[{t$95$3 = N[((-N[(N[Sqrt[N[(N[(N[Power[B, 2.0], $MachinePrecision] + N[(-4.0 * N[(C * A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(F * N[(4.0 * A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / 1.0), $MachinePrecision]) / N[(N[Power[B, 2.0], $MachinePrecision] - N[(4.0 * N[(C * A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, (-Infinity)], t$95$3, If[LessEqual[t$95$2, -5e-219], N[((-N[Sqrt[N[(2.0 * N[(N[(F * N[(N[Power[B, 2.0], $MachinePrecision] - N[(A * N[(4.0 * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(C + N[(A + N[Sqrt[N[(N[Power[B, 2.0], $MachinePrecision] + t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$1), $MachinePrecision], If[LessEqual[t$95$2, Infinity], t$95$3, (-N[(N[(N[Sqrt[2.0], $MachinePrecision] / B), $MachinePrecision] * N[Sqrt[N[(F * B), $MachinePrecision]], $MachinePrecision]), $MachinePrecision])]]]]]]]
\frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C}
\begin{array}{l}
t_0 := {\left(A - C\right)}^{2}\\
t_1 := {B}^{2} - \left(4 \cdot A\right) \cdot C\\
t_2 := \frac{-\sqrt{\left(2 \cdot \left(t_1 \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{t_0 + {B}^{2}}\right)}}{t_1}\\
t_3 := \frac{-\frac{\sqrt{\left({B}^{2} + -4 \cdot \left(C \cdot A\right)\right) \cdot \left(F \cdot \left(4 \cdot A\right)\right)}}{1}}{{B}^{2} - 4 \cdot \left(C \cdot A\right)}\\
\mathbf{if}\;t_2 \leq -\infty:\\
\;\;\;\;t_3\\

\mathbf{elif}\;t_2 \leq -5 \cdot 10^{-219}:\\
\;\;\;\;\frac{-\sqrt{2 \cdot \left(\left(F \cdot \left({B}^{2} - A \cdot \left(4 \cdot C\right)\right)\right) \cdot \left(C + \left(A + \sqrt{{B}^{2} + t_0}\right)\right)\right)}}{t_1}\\

\mathbf{elif}\;t_2 \leq \infty:\\
\;\;\;\;t_3\\

\mathbf{else}:\\
\;\;\;\;-\frac{\sqrt{2}}{B} \cdot \sqrt{F \cdot B}\\


\end{array}

Error?

Try it out?

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation?

  1. Split input into 3 regimes
  2. if (/.f64 (neg.f64 (sqrt.f64 (*.f64 (*.f64 2 (*.f64 (-.f64 (pow.f64 B 2) (*.f64 (*.f64 4 A) C)) F)) (+.f64 (+.f64 A C) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) 2) (pow.f64 B 2))))))) (-.f64 (pow.f64 B 2) (*.f64 (*.f64 4 A) C))) < -inf.0 or -5.0000000000000002e-219 < (/.f64 (neg.f64 (sqrt.f64 (*.f64 (*.f64 2 (*.f64 (-.f64 (pow.f64 B 2) (*.f64 (*.f64 4 A) C)) F)) (+.f64 (+.f64 A C) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) 2) (pow.f64 B 2))))))) (-.f64 (pow.f64 B 2) (*.f64 (*.f64 4 A) C))) < +inf.0

    1. Initial program 57.9

      \[\frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
    2. Simplified57.2

      \[\leadsto \color{blue}{\frac{-\sqrt{\left(\left({B}^{2} - 4 \cdot \left(C \cdot A\right)\right) \cdot F\right) \cdot \left(\left(A + \left(\sqrt{{B}^{2} + {\left(A - C\right)}^{2}} + C\right)\right) \cdot 2\right)}}{{B}^{2} - 4 \cdot \left(C \cdot A\right)}} \]
      Proof

      [Start]57.9

      \[ \frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
    3. Taylor expanded in B around 0 55.6

      \[\leadsto \frac{-\sqrt{\left(\left({B}^{2} - 4 \cdot \left(C \cdot A\right)\right) \cdot F\right) \cdot \left(\left(A + \left(\color{blue}{\left(A - C\right)} + C\right)\right) \cdot 2\right)}}{{B}^{2} - 4 \cdot \left(C \cdot A\right)} \]
    4. Applied egg-rr50.4

      \[\leadsto \frac{-\color{blue}{\frac{\sqrt{\left({B}^{2} + -4 \cdot \left(C \cdot A\right)\right) \cdot \left(F \cdot \left(4 \cdot A\right)\right)}}{1}}}{{B}^{2} - 4 \cdot \left(C \cdot A\right)} \]

    if -inf.0 < (/.f64 (neg.f64 (sqrt.f64 (*.f64 (*.f64 2 (*.f64 (-.f64 (pow.f64 B 2) (*.f64 (*.f64 4 A) C)) F)) (+.f64 (+.f64 A C) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) 2) (pow.f64 B 2))))))) (-.f64 (pow.f64 B 2) (*.f64 (*.f64 4 A) C))) < -5.0000000000000002e-219

    1. Initial program 1.6

      \[\frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
    2. Applied egg-rr1.6

      \[\leadsto \frac{-\color{blue}{\left(\sqrt{2 \cdot \left(\left(\left({B}^{2} - 4 \cdot \left(A \cdot C\right)\right) \cdot F\right) \cdot \left(A + \left(C + \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\right)\right)} + 0\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
    3. Simplified1.6

      \[\leadsto \frac{-\color{blue}{\sqrt{2 \cdot \left(\left(F \cdot \left({B}^{2} - A \cdot \left(4 \cdot C\right)\right)\right) \cdot \left(C + \left(A + \sqrt{{B}^{2} + {\left(A - C\right)}^{2}}\right)\right)\right)}}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
      Proof

      [Start]1.6

      \[ \frac{-\left(\sqrt{2 \cdot \left(\left(\left({B}^{2} - 4 \cdot \left(A \cdot C\right)\right) \cdot F\right) \cdot \left(A + \left(C + \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\right)\right)} + 0\right)}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]

      rational_best_oopsla_all_46_json_45_simplify-85 [=>]1.6

      \[ \frac{-\color{blue}{\sqrt{2 \cdot \left(\left(\left({B}^{2} - 4 \cdot \left(A \cdot C\right)\right) \cdot F\right) \cdot \left(A + \left(C + \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\right)\right)}}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]

      rational_best_oopsla_all_46_json_45_simplify-74 [=>]1.6

      \[ \frac{-\sqrt{2 \cdot \left(\color{blue}{\left(F \cdot \left({B}^{2} - 4 \cdot \left(A \cdot C\right)\right)\right)} \cdot \left(A + \left(C + \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\right)\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]

      rational_best_oopsla_all_46_json_45_simplify-7 [=>]1.6

      \[ \frac{-\sqrt{2 \cdot \left(\left(F \cdot \left({B}^{2} - \color{blue}{A \cdot \left(4 \cdot C\right)}\right)\right) \cdot \left(A + \left(C + \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\right)\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]

      rational_best_oopsla_all_46_json_45_simplify-82 [=>]1.6

      \[ \frac{-\sqrt{2 \cdot \left(\left(F \cdot \left({B}^{2} - A \cdot \left(4 \cdot C\right)\right)\right) \cdot \color{blue}{\left(C + \left(A + \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\right)}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]

      rational_best_oopsla_all_46_json_45_simplify-35 [=>]1.6

      \[ \frac{-\sqrt{2 \cdot \left(\left(F \cdot \left({B}^{2} - A \cdot \left(4 \cdot C\right)\right)\right) \cdot \left(C + \left(A + \sqrt{\color{blue}{{B}^{2} + {\left(A - C\right)}^{2}}}\right)\right)\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]

    if +inf.0 < (/.f64 (neg.f64 (sqrt.f64 (*.f64 (*.f64 2 (*.f64 (-.f64 (pow.f64 B 2) (*.f64 (*.f64 4 A) C)) F)) (+.f64 (+.f64 A C) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) 2) (pow.f64 B 2))))))) (-.f64 (pow.f64 B 2) (*.f64 (*.f64 4 A) C)))

    1. Initial program 64.0

      \[\frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
    2. Taylor expanded in A around 0 63.6

      \[\leadsto \color{blue}{-1 \cdot \left(\frac{\sqrt{2}}{B} \cdot \sqrt{\left(C + \sqrt{{B}^{2} + {C}^{2}}\right) \cdot F}\right)} \]
    3. Simplified63.6

      \[\leadsto \color{blue}{-\frac{\sqrt{2}}{B} \cdot \sqrt{F \cdot \left(C + \sqrt{{B}^{2} + {C}^{2}}\right)}} \]
      Proof

      [Start]63.6

      \[ -1 \cdot \left(\frac{\sqrt{2}}{B} \cdot \sqrt{\left(C + \sqrt{{B}^{2} + {C}^{2}}\right) \cdot F}\right) \]

      rational_best_oopsla_all_46_json_45_simplify-74 [=>]63.6

      \[ \color{blue}{\left(\frac{\sqrt{2}}{B} \cdot \sqrt{\left(C + \sqrt{{B}^{2} + {C}^{2}}\right) \cdot F}\right) \cdot -1} \]

      rational_best_oopsla_all_46_json_45_simplify-92 [=>]63.6

      \[ \color{blue}{-\frac{\sqrt{2}}{B} \cdot \sqrt{\left(C + \sqrt{{B}^{2} + {C}^{2}}\right) \cdot F}} \]

      rational_best_oopsla_all_46_json_45_simplify-74 [=>]63.6

      \[ -\frac{\sqrt{2}}{B} \cdot \sqrt{\color{blue}{F \cdot \left(C + \sqrt{{B}^{2} + {C}^{2}}\right)}} \]
    4. Taylor expanded in C around 0 54.1

      \[\leadsto -\frac{\sqrt{2}}{B} \cdot \color{blue}{\sqrt{F \cdot B}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification44.6

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \leq -\infty:\\ \;\;\;\;\frac{-\frac{\sqrt{\left({B}^{2} + -4 \cdot \left(C \cdot A\right)\right) \cdot \left(F \cdot \left(4 \cdot A\right)\right)}}{1}}{{B}^{2} - 4 \cdot \left(C \cdot A\right)}\\ \mathbf{elif}\;\frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \leq -5 \cdot 10^{-219}:\\ \;\;\;\;\frac{-\sqrt{2 \cdot \left(\left(F \cdot \left({B}^{2} - A \cdot \left(4 \cdot C\right)\right)\right) \cdot \left(C + \left(A + \sqrt{{B}^{2} + {\left(A - C\right)}^{2}}\right)\right)\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C}\\ \mathbf{elif}\;\frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \leq \infty:\\ \;\;\;\;\frac{-\frac{\sqrt{\left({B}^{2} + -4 \cdot \left(C \cdot A\right)\right) \cdot \left(F \cdot \left(4 \cdot A\right)\right)}}{1}}{{B}^{2} - 4 \cdot \left(C \cdot A\right)}\\ \mathbf{else}:\\ \;\;\;\;-\frac{\sqrt{2}}{B} \cdot \sqrt{F \cdot B}\\ \end{array} \]

Alternatives

Alternative 1
Error49.2
Cost66576
\[\begin{array}{l} t_0 := \frac{\sqrt{2}}{B}\\ t_1 := {B}^{2} - 4 \cdot \left(C \cdot A\right)\\ t_2 := \frac{-\sqrt{\left({B}^{2} \cdot F\right) \cdot \left(\left(A + \left(\sqrt{{B}^{2} + {\left(A - C\right)}^{2}} + C\right)\right) \cdot 2\right)}}{t_1}\\ \mathbf{if}\;{B}^{2} \leq 10^{-97}:\\ \;\;\;\;\frac{-\frac{\sqrt{\left({B}^{2} + -4 \cdot \left(C \cdot A\right)\right) \cdot \left(F \cdot \left(4 \cdot A\right)\right)}}{1}}{t_1}\\ \mathbf{elif}\;{B}^{2} \leq 5 \cdot 10^{+28}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;{B}^{2} \leq 4 \cdot 10^{+155}:\\ \;\;\;\;-t_0 \cdot \sqrt{F \cdot \left(\frac{{B}^{2}}{C} \cdot -0.5\right)}\\ \mathbf{elif}\;{B}^{2} \leq 1.5 \cdot 10^{+208}:\\ \;\;\;\;t_2\\ \mathbf{else}:\\ \;\;\;\;-t_0 \cdot \sqrt{F \cdot \left(C + B\right)}\\ \end{array} \]
Alternative 2
Error50.3
Cost40652
\[\begin{array}{l} t_0 := \frac{\sqrt{2}}{B}\\ t_1 := {B}^{2} - 4 \cdot \left(C \cdot A\right)\\ t_2 := \frac{-\sqrt{\left(t_1 \cdot F\right) \cdot \left(\left(A + A\right) \cdot 2\right)}}{t_1}\\ \mathbf{if}\;{B}^{2} \leq 10^{-21}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;{B}^{2} \leq 2 \cdot 10^{+137}:\\ \;\;\;\;-t_0 \cdot \sqrt{F \cdot \left(\frac{{B}^{2}}{C} \cdot -0.5\right)}\\ \mathbf{elif}\;{B}^{2} \leq 4 \cdot 10^{+155}:\\ \;\;\;\;t_2\\ \mathbf{else}:\\ \;\;\;\;-t_0 \cdot \sqrt{F \cdot \left(C + B\right)}\\ \end{array} \]
Alternative 3
Error53.7
Cost33224
\[\begin{array}{l} t_0 := \frac{\sqrt{2}}{B}\\ \mathbf{if}\;{B}^{2} \leq 5 \cdot 10^{-291}:\\ \;\;\;\;\frac{-\sqrt{\left(A \cdot \left(-4 \cdot \left(C \cdot F\right)\right)\right) \cdot \left(\left(A + \left(\left(A - C\right) + C\right)\right) \cdot 2\right)}}{{B}^{2} - 4 \cdot \left(C \cdot A\right)}\\ \mathbf{elif}\;{B}^{2} \leq 4 \cdot 10^{+155}:\\ \;\;\;\;-t_0 \cdot \sqrt{-0.5 \cdot \frac{F \cdot {B}^{2}}{C}}\\ \mathbf{else}:\\ \;\;\;\;-t_0 \cdot \sqrt{F \cdot \left(C + B\right)}\\ \end{array} \]
Alternative 4
Error54.0
Cost33224
\[\begin{array}{l} t_0 := \frac{\sqrt{2}}{B}\\ \mathbf{if}\;{B}^{2} \leq 2 \cdot 10^{-19}:\\ \;\;\;\;\frac{-\sqrt{\left(A \cdot \left(-4 \cdot \left(C \cdot F\right)\right)\right) \cdot \left(\left(A + \left(\left(A - C\right) + C\right)\right) \cdot 2\right)}}{{B}^{2} - 4 \cdot \left(C \cdot A\right)}\\ \mathbf{elif}\;{B}^{2} \leq 4 \cdot 10^{+155}:\\ \;\;\;\;-t_0 \cdot \sqrt{F \cdot \left(\frac{{B}^{2}}{C} \cdot -0.5\right)}\\ \mathbf{else}:\\ \;\;\;\;-t_0 \cdot \sqrt{F \cdot \left(C + B\right)}\\ \end{array} \]
Alternative 5
Error51.1
Cost33224
\[\begin{array}{l} t_0 := \frac{\sqrt{2}}{B}\\ \mathbf{if}\;{B}^{2} \leq 10^{-21}:\\ \;\;\;\;\frac{-\sqrt{F \cdot \left(\left({B}^{2} + A \cdot \left(-4 \cdot C\right)\right) \cdot \left(A \cdot 4\right)\right)}}{{B}^{2} - 4 \cdot \left(C \cdot A\right)}\\ \mathbf{elif}\;{B}^{2} \leq 4 \cdot 10^{+155}:\\ \;\;\;\;-t_0 \cdot \sqrt{F \cdot \left(\frac{{B}^{2}}{C} \cdot -0.5\right)}\\ \mathbf{else}:\\ \;\;\;\;-t_0 \cdot \sqrt{F \cdot \left(C + B\right)}\\ \end{array} \]
Alternative 6
Error51.2
Cost21784
\[\begin{array}{l} t_0 := \frac{\sqrt{2}}{B}\\ t_1 := {B}^{2} - 4 \cdot \left(C \cdot A\right)\\ t_2 := \frac{-\frac{\sqrt{\left({B}^{2} + -4 \cdot \left(C \cdot A\right)\right) \cdot \left(F \cdot \left(4 \cdot A\right)\right)}}{1}}{t_1}\\ \mathbf{if}\;C \leq -6.6 \cdot 10^{+206}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;C \leq -3.45 \cdot 10^{+112}:\\ \;\;\;\;-t_0 \cdot \sqrt{F \cdot \left(\frac{{B}^{2}}{C} \cdot -0.5\right)}\\ \mathbf{elif}\;C \leq -2.6 \cdot 10^{-49}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;C \leq 2.4 \cdot 10^{-302}:\\ \;\;\;\;-t_0 \cdot \sqrt{F \cdot B}\\ \mathbf{elif}\;C \leq 1.8 \cdot 10^{-210}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;C \leq 4.8 \cdot 10^{+38}:\\ \;\;\;\;-t_0 \cdot \sqrt{F \cdot \left(C + B\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{-\sqrt{\left(t_1 \cdot F\right) \cdot \left(\left(A + \left(C + C\right)\right) \cdot 2\right)}}{t_1}\\ \end{array} \]
Alternative 7
Error48.4
Cost21188
\[\begin{array}{l} t_0 := {B}^{2} - 4 \cdot \left(C \cdot A\right)\\ \mathbf{if}\;B \leq -1.1 \cdot 10^{-10}:\\ \;\;\;\;\frac{-\sqrt{\left(t_0 \cdot F\right) \cdot \left(\left(A + \left(\left(-B\right) + C\right)\right) \cdot 2\right)}}{t_0}\\ \mathbf{elif}\;B \leq 6.7 \cdot 10^{+72}:\\ \;\;\;\;\frac{-\frac{\sqrt{\left({B}^{2} + -4 \cdot \left(C \cdot A\right)\right) \cdot \left(F \cdot \left(4 \cdot A\right)\right)}}{1}}{t_0}\\ \mathbf{else}:\\ \;\;\;\;-\frac{\sqrt{2}}{B} \cdot \sqrt{F \cdot \left(C + B\right)}\\ \end{array} \]
Alternative 8
Error49.8
Cost20996
\[\begin{array}{l} \mathbf{if}\;B \leq 6.7 \cdot 10^{+72}:\\ \;\;\;\;\frac{-\frac{\sqrt{\left({B}^{2} + -4 \cdot \left(C \cdot A\right)\right) \cdot \left(F \cdot \left(4 \cdot A\right)\right)}}{1}}{{B}^{2} - 4 \cdot \left(C \cdot A\right)}\\ \mathbf{else}:\\ \;\;\;\;-\frac{\sqrt{2}}{B} \cdot \sqrt{F \cdot \left(C + B\right)}\\ \end{array} \]
Alternative 9
Error52.7
Cost14660
\[\begin{array}{l} \mathbf{if}\;B \leq 3.1 \cdot 10^{-68}:\\ \;\;\;\;\frac{-\sqrt{\left(A \cdot \left(-4 \cdot \left(C \cdot F\right)\right)\right) \cdot \left(\left(A + \left(\left(A - C\right) + C\right)\right) \cdot 2\right)}}{{B}^{2} - 4 \cdot \left(C \cdot A\right)}\\ \mathbf{else}:\\ \;\;\;\;-\frac{\sqrt{2}}{B} \cdot \sqrt{F \cdot B}\\ \end{array} \]
Alternative 10
Error53.8
Cost13444
\[\begin{array}{l} \mathbf{if}\;B \leq -4.7 \cdot 10^{-146}:\\ \;\;\;\;\sqrt{A \cdot F} \cdot \left(2 \cdot \frac{1}{B}\right)\\ \mathbf{else}:\\ \;\;\;\;-\frac{\sqrt{2}}{B} \cdot \sqrt{F \cdot B}\\ \end{array} \]
Alternative 11
Error60.9
Cost7108
\[\begin{array}{l} t_0 := \sqrt{A \cdot F}\\ \mathbf{if}\;B \leq -1.95 \cdot 10^{-276}:\\ \;\;\;\;t_0 \cdot \left(2 \cdot \frac{1}{B}\right)\\ \mathbf{else}:\\ \;\;\;\;t_0 \cdot \left(-2 \cdot \frac{1}{B}\right)\\ \end{array} \]
Alternative 12
Error62.0
Cost6976
\[\sqrt{A \cdot F} \cdot \left(-2 \cdot \frac{1}{B}\right) \]
Alternative 13
Error62.8
Cost6912
\[-\sqrt{A \cdot F} \cdot \frac{1}{B} \]

Error

Reproduce?

herbie shell --seed 2023090 
(FPCore (A B C F)
  :name "ABCF->ab-angle a"
  :precision binary64
  (/ (- (sqrt (* (* 2.0 (* (- (pow B 2.0) (* (* 4.0 A) C)) F)) (+ (+ A C) (sqrt (+ (pow (- A C) 2.0) (pow B 2.0))))))) (- (pow B 2.0) (* (* 4.0 A) C))))