?

Average Error: 52.1 → 45.7
Time: 48.0s
Precision: binary64
Cost: 169676

?

\[\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 := {B}^{2} - \left(4 \cdot A\right) \cdot C\\ t_1 := \sqrt{2} \cdot \left(-\sqrt{\frac{F}{B}}\right)\\ t_2 := {\left(A - C\right)}^{2}\\ t_3 := \frac{-\sqrt{\left(2 \cdot \left(t_0 \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{t_2 + {B}^{2}}\right)}}{t_0}\\ t_4 := A \cdot \left(C \cdot 4\right)\\ \mathbf{if}\;t_3 \leq -\infty:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t_3 \leq -1 \cdot 10^{-202}:\\ \;\;\;\;\frac{1}{\frac{t_4 - {B}^{2}}{\sqrt{2 \cdot \left(\left(A + \left(C + \sqrt{{B}^{2} + t_2}\right)\right) \cdot \left(\left({B}^{2} - t_4\right) \cdot F\right)\right)}}}\\ \mathbf{elif}\;t_3 \leq \infty:\\ \;\;\;\;\frac{-\sqrt{8 \cdot \left(C \cdot \left(F \cdot {B}^{2}\right)\right) + \left(-16 \cdot \left(A \cdot \left({C}^{2} \cdot F\right)\right) + -2 \cdot \frac{F \cdot \left(0.5 \cdot {B}^{4} + -2 \cdot \left({C}^{2} \cdot {B}^{2}\right)\right)}{A}\right)}}{{B}^{2} - 4 \cdot \left(A \cdot C\right)}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \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 B 2.0) (* (* 4.0 A) C)))
        (t_1 (* (sqrt 2.0) (- (sqrt (/ F B)))))
        (t_2 (pow (- A C) 2.0))
        (t_3
         (/
          (-
           (sqrt (* (* 2.0 (* t_0 F)) (+ (+ A C) (sqrt (+ t_2 (pow B 2.0)))))))
          t_0))
        (t_4 (* A (* C 4.0))))
   (if (<= t_3 (- INFINITY))
     t_1
     (if (<= t_3 -1e-202)
       (/
        1.0
        (/
         (- t_4 (pow B 2.0))
         (sqrt
          (*
           2.0
           (*
            (+ A (+ C (sqrt (+ (pow B 2.0) t_2))))
            (* (- (pow B 2.0) t_4) F))))))
       (if (<= t_3 INFINITY)
         (/
          (-
           (sqrt
            (+
             (* 8.0 (* C (* F (pow B 2.0))))
             (+
              (* -16.0 (* A (* (pow C 2.0) F)))
              (*
               -2.0
               (/
                (*
                 F
                 (+ (* 0.5 (pow B 4.0)) (* -2.0 (* (pow C 2.0) (pow B 2.0)))))
                A))))))
          (- (pow B 2.0) (* 4.0 (* A C))))
         t_1)))))
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(B, 2.0) - ((4.0 * A) * C);
	double t_1 = sqrt(2.0) * -sqrt((F / B));
	double t_2 = pow((A - C), 2.0);
	double t_3 = -sqrt(((2.0 * (t_0 * F)) * ((A + C) + sqrt((t_2 + pow(B, 2.0)))))) / t_0;
	double t_4 = A * (C * 4.0);
	double tmp;
	if (t_3 <= -((double) INFINITY)) {
		tmp = t_1;
	} else if (t_3 <= -1e-202) {
		tmp = 1.0 / ((t_4 - pow(B, 2.0)) / sqrt((2.0 * ((A + (C + sqrt((pow(B, 2.0) + t_2)))) * ((pow(B, 2.0) - t_4) * F)))));
	} else if (t_3 <= ((double) INFINITY)) {
		tmp = -sqrt(((8.0 * (C * (F * pow(B, 2.0)))) + ((-16.0 * (A * (pow(C, 2.0) * F))) + (-2.0 * ((F * ((0.5 * pow(B, 4.0)) + (-2.0 * (pow(C, 2.0) * pow(B, 2.0))))) / A))))) / (pow(B, 2.0) - (4.0 * (A * C)));
	} else {
		tmp = t_1;
	}
	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(B, 2.0) - ((4.0 * A) * C);
	double t_1 = Math.sqrt(2.0) * -Math.sqrt((F / B));
	double t_2 = Math.pow((A - C), 2.0);
	double t_3 = -Math.sqrt(((2.0 * (t_0 * F)) * ((A + C) + Math.sqrt((t_2 + Math.pow(B, 2.0)))))) / t_0;
	double t_4 = A * (C * 4.0);
	double tmp;
	if (t_3 <= -Double.POSITIVE_INFINITY) {
		tmp = t_1;
	} else if (t_3 <= -1e-202) {
		tmp = 1.0 / ((t_4 - Math.pow(B, 2.0)) / Math.sqrt((2.0 * ((A + (C + Math.sqrt((Math.pow(B, 2.0) + t_2)))) * ((Math.pow(B, 2.0) - t_4) * F)))));
	} else if (t_3 <= Double.POSITIVE_INFINITY) {
		tmp = -Math.sqrt(((8.0 * (C * (F * Math.pow(B, 2.0)))) + ((-16.0 * (A * (Math.pow(C, 2.0) * F))) + (-2.0 * ((F * ((0.5 * Math.pow(B, 4.0)) + (-2.0 * (Math.pow(C, 2.0) * Math.pow(B, 2.0))))) / A))))) / (Math.pow(B, 2.0) - (4.0 * (A * C)));
	} else {
		tmp = t_1;
	}
	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(B, 2.0) - ((4.0 * A) * C)
	t_1 = math.sqrt(2.0) * -math.sqrt((F / B))
	t_2 = math.pow((A - C), 2.0)
	t_3 = -math.sqrt(((2.0 * (t_0 * F)) * ((A + C) + math.sqrt((t_2 + math.pow(B, 2.0)))))) / t_0
	t_4 = A * (C * 4.0)
	tmp = 0
	if t_3 <= -math.inf:
		tmp = t_1
	elif t_3 <= -1e-202:
		tmp = 1.0 / ((t_4 - math.pow(B, 2.0)) / math.sqrt((2.0 * ((A + (C + math.sqrt((math.pow(B, 2.0) + t_2)))) * ((math.pow(B, 2.0) - t_4) * F)))))
	elif t_3 <= math.inf:
		tmp = -math.sqrt(((8.0 * (C * (F * math.pow(B, 2.0)))) + ((-16.0 * (A * (math.pow(C, 2.0) * F))) + (-2.0 * ((F * ((0.5 * math.pow(B, 4.0)) + (-2.0 * (math.pow(C, 2.0) * math.pow(B, 2.0))))) / A))))) / (math.pow(B, 2.0) - (4.0 * (A * C)))
	else:
		tmp = t_1
	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((B ^ 2.0) - Float64(Float64(4.0 * A) * C))
	t_1 = Float64(sqrt(2.0) * Float64(-sqrt(Float64(F / B))))
	t_2 = Float64(A - C) ^ 2.0
	t_3 = Float64(Float64(-sqrt(Float64(Float64(2.0 * Float64(t_0 * F)) * Float64(Float64(A + C) + sqrt(Float64(t_2 + (B ^ 2.0))))))) / t_0)
	t_4 = Float64(A * Float64(C * 4.0))
	tmp = 0.0
	if (t_3 <= Float64(-Inf))
		tmp = t_1;
	elseif (t_3 <= -1e-202)
		tmp = Float64(1.0 / Float64(Float64(t_4 - (B ^ 2.0)) / sqrt(Float64(2.0 * Float64(Float64(A + Float64(C + sqrt(Float64((B ^ 2.0) + t_2)))) * Float64(Float64((B ^ 2.0) - t_4) * F))))));
	elseif (t_3 <= Inf)
		tmp = Float64(Float64(-sqrt(Float64(Float64(8.0 * Float64(C * Float64(F * (B ^ 2.0)))) + Float64(Float64(-16.0 * Float64(A * Float64((C ^ 2.0) * F))) + Float64(-2.0 * Float64(Float64(F * Float64(Float64(0.5 * (B ^ 4.0)) + Float64(-2.0 * Float64((C ^ 2.0) * (B ^ 2.0))))) / A)))))) / Float64((B ^ 2.0) - Float64(4.0 * Float64(A * C))));
	else
		tmp = t_1;
	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 = (B ^ 2.0) - ((4.0 * A) * C);
	t_1 = sqrt(2.0) * -sqrt((F / B));
	t_2 = (A - C) ^ 2.0;
	t_3 = -sqrt(((2.0 * (t_0 * F)) * ((A + C) + sqrt((t_2 + (B ^ 2.0)))))) / t_0;
	t_4 = A * (C * 4.0);
	tmp = 0.0;
	if (t_3 <= -Inf)
		tmp = t_1;
	elseif (t_3 <= -1e-202)
		tmp = 1.0 / ((t_4 - (B ^ 2.0)) / sqrt((2.0 * ((A + (C + sqrt(((B ^ 2.0) + t_2)))) * (((B ^ 2.0) - t_4) * F)))));
	elseif (t_3 <= Inf)
		tmp = -sqrt(((8.0 * (C * (F * (B ^ 2.0)))) + ((-16.0 * (A * ((C ^ 2.0) * F))) + (-2.0 * ((F * ((0.5 * (B ^ 4.0)) + (-2.0 * ((C ^ 2.0) * (B ^ 2.0))))) / A))))) / ((B ^ 2.0) - (4.0 * (A * C)));
	else
		tmp = t_1;
	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[(N[Power[B, 2.0], $MachinePrecision] - N[(N[(4.0 * A), $MachinePrecision] * C), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[Sqrt[2.0], $MachinePrecision] * (-N[Sqrt[N[(F / B), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]}, Block[{t$95$2 = N[Power[N[(A - C), $MachinePrecision], 2.0], $MachinePrecision]}, Block[{t$95$3 = N[((-N[Sqrt[N[(N[(2.0 * N[(t$95$0 * F), $MachinePrecision]), $MachinePrecision] * N[(N[(A + C), $MachinePrecision] + N[Sqrt[N[(t$95$2 + N[Power[B, 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision]}, Block[{t$95$4 = N[(A * N[(C * 4.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$3, (-Infinity)], t$95$1, If[LessEqual[t$95$3, -1e-202], N[(1.0 / N[(N[(t$95$4 - N[Power[B, 2.0], $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[(2.0 * N[(N[(A + N[(C + N[Sqrt[N[(N[Power[B, 2.0], $MachinePrecision] + t$95$2), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(N[Power[B, 2.0], $MachinePrecision] - t$95$4), $MachinePrecision] * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$3, Infinity], N[((-N[Sqrt[N[(N[(8.0 * N[(C * N[(F * N[Power[B, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(-16.0 * N[(A * N[(N[Power[C, 2.0], $MachinePrecision] * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(-2.0 * N[(N[(F * N[(N[(0.5 * N[Power[B, 4.0], $MachinePrecision]), $MachinePrecision] + N[(-2.0 * N[(N[Power[C, 2.0], $MachinePrecision] * N[Power[B, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / N[(N[Power[B, 2.0], $MachinePrecision] - N[(4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]]]]
\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 := {B}^{2} - \left(4 \cdot A\right) \cdot C\\
t_1 := \sqrt{2} \cdot \left(-\sqrt{\frac{F}{B}}\right)\\
t_2 := {\left(A - C\right)}^{2}\\
t_3 := \frac{-\sqrt{\left(2 \cdot \left(t_0 \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{t_2 + {B}^{2}}\right)}}{t_0}\\
t_4 := A \cdot \left(C \cdot 4\right)\\
\mathbf{if}\;t_3 \leq -\infty:\\
\;\;\;\;t_1\\

\mathbf{elif}\;t_3 \leq -1 \cdot 10^{-202}:\\
\;\;\;\;\frac{1}{\frac{t_4 - {B}^{2}}{\sqrt{2 \cdot \left(\left(A + \left(C + \sqrt{{B}^{2} + t_2}\right)\right) \cdot \left(\left({B}^{2} - t_4\right) \cdot F\right)\right)}}}\\

\mathbf{elif}\;t_3 \leq \infty:\\
\;\;\;\;\frac{-\sqrt{8 \cdot \left(C \cdot \left(F \cdot {B}^{2}\right)\right) + \left(-16 \cdot \left(A \cdot \left({C}^{2} \cdot F\right)\right) + -2 \cdot \frac{F \cdot \left(0.5 \cdot {B}^{4} + -2 \cdot \left({C}^{2} \cdot {B}^{2}\right)\right)}{A}\right)}}{{B}^{2} - 4 \cdot \left(A \cdot C\right)}\\

\mathbf{else}:\\
\;\;\;\;t_1\\


\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 +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. Simplified64.0

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

      [Start]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} \]

      rational.json-simplify-50 [<=]64.0

      \[ \color{blue}{\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)}}{\left(4 \cdot A\right) \cdot C - {B}^{2}}} \]

      rational.json-simplify-5 [<=]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)}}{\color{blue}{\left(\left(4 \cdot A\right) \cdot C - {B}^{2}\right) - 0}} \]

      rational.json-simplify-50 [=>]64.0

      \[ \color{blue}{\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)}}{0 - \left(\left(4 \cdot A\right) \cdot C - {B}^{2}\right)}} \]
    3. Taylor expanded in A around 0 63.5

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

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

      [Start]63.5

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

      rational.json-simplify-43 [=>]63.5

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

      rational.json-simplify-2 [<=]63.5

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

      rational.json-simplify-2 [=>]63.5

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

      \[\leadsto \color{blue}{-1 \cdot \left(\sqrt{2} \cdot \sqrt{\frac{F}{B}}\right)} \]
    6. Simplified54.0

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

      [Start]54.0

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

      rational.json-simplify-43 [=>]54.0

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

      rational.json-simplify-9 [=>]54.0

      \[ \sqrt{2} \cdot \color{blue}{\left(-\sqrt{\frac{F}{B}}\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))) < -1e-202

    1. Initial program 1.5

      \[\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. Simplified2.4

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

      [Start]1.5

      \[ \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} \]

      rational.json-simplify-50 [<=]1.5

      \[ \color{blue}{\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)}}{\left(4 \cdot A\right) \cdot C - {B}^{2}}} \]

      rational.json-simplify-5 [<=]1.5

      \[ \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)}}{\color{blue}{\left(\left(4 \cdot A\right) \cdot C - {B}^{2}\right) - 0}} \]

      rational.json-simplify-50 [=>]1.5

      \[ \color{blue}{\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)}}{0 - \left(\left(4 \cdot A\right) \cdot C - {B}^{2}\right)}} \]
    3. Applied egg-rr1.7

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

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

    if -1e-202 < (/.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 52.4

      \[\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. Simplified50.7

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

      [Start]52.4

      \[ \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} \]

      rational.json-simplify-50 [<=]52.4

      \[ \color{blue}{\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)}}{\left(4 \cdot A\right) \cdot C - {B}^{2}}} \]

      rational.json-simplify-5 [<=]52.4

      \[ \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)}}{\color{blue}{\left(\left(4 \cdot A\right) \cdot C - {B}^{2}\right) - 0}} \]

      rational.json-simplify-50 [=>]52.4

      \[ \color{blue}{\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)}}{0 - \left(\left(4 \cdot A\right) \cdot C - {B}^{2}\right)}} \]
    3. Taylor expanded in A around -inf 51.6

      \[\leadsto \frac{-\sqrt{\color{blue}{8 \cdot \left(C \cdot \left(F \cdot {B}^{2}\right)\right) + \left(-16 \cdot \left(A \cdot \left({C}^{2} \cdot F\right)\right) + -2 \cdot \frac{F \cdot \left(0.5 \cdot {B}^{4} + -2 \cdot \left({C}^{2} \cdot {B}^{2}\right)\right)}{A}\right)}}}{{B}^{2} - 4 \cdot \left(A \cdot C\right)} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification45.7

    \[\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:\\ \;\;\;\;\sqrt{2} \cdot \left(-\sqrt{\frac{F}{B}}\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 -1 \cdot 10^{-202}:\\ \;\;\;\;\frac{1}{\frac{A \cdot \left(C \cdot 4\right) - {B}^{2}}{\sqrt{2 \cdot \left(\left(A + \left(C + \sqrt{{B}^{2} + {\left(A - C\right)}^{2}}\right)\right) \cdot \left(\left({B}^{2} - A \cdot \left(C \cdot 4\right)\right) \cdot F\right)\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 \infty:\\ \;\;\;\;\frac{-\sqrt{8 \cdot \left(C \cdot \left(F \cdot {B}^{2}\right)\right) + \left(-16 \cdot \left(A \cdot \left({C}^{2} \cdot F\right)\right) + -2 \cdot \frac{F \cdot \left(0.5 \cdot {B}^{4} + -2 \cdot \left({C}^{2} \cdot {B}^{2}\right)\right)}{A}\right)}}{{B}^{2} - 4 \cdot \left(A \cdot C\right)}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{2} \cdot \left(-\sqrt{\frac{F}{B}}\right)\\ \end{array} \]

Alternatives

Alternative 1
Error45.9
Cost149260
\[\begin{array}{l} t_0 := {\left(A - C\right)}^{2}\\ t_1 := A \cdot \left(4 \cdot C\right)\\ t_2 := {B}^{2} - \left(4 \cdot A\right) \cdot C\\ t_3 := \frac{-\sqrt{\left(2 \cdot \left(t_2 \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{t_0 + {B}^{2}}\right)}}{t_2}\\ t_4 := \sqrt{2} \cdot \left(-\sqrt{\frac{F}{B}}\right)\\ \mathbf{if}\;t_3 \leq -\infty:\\ \;\;\;\;t_4\\ \mathbf{elif}\;t_3 \leq -1 \cdot 10^{-202}:\\ \;\;\;\;\frac{\sqrt{2 \cdot \left(\left(\left({B}^{2} - t_1\right) \cdot F\right) \cdot \left(A + \left(C + \sqrt{{B}^{2} + t_0}\right)\right)\right)}}{t_1 - {B}^{2}}\\ \mathbf{elif}\;t_3 \leq \infty:\\ \;\;\;\;\frac{-\sqrt{A \cdot \left(\left({C}^{2} \cdot F\right) \cdot -16\right) + \left({B}^{2} \cdot F\right) \cdot \left(8 \cdot C\right)}}{{B}^{2} - 4 \cdot \left(A \cdot C\right)}\\ \mathbf{else}:\\ \;\;\;\;t_4\\ \end{array} \]
Alternative 2
Error45.9
Cost149260
\[\begin{array}{l} t_0 := {B}^{2} - \left(4 \cdot A\right) \cdot C\\ t_1 := \sqrt{2} \cdot \left(-\sqrt{\frac{F}{B}}\right)\\ t_2 := {\left(A - C\right)}^{2}\\ t_3 := \frac{-\sqrt{\left(2 \cdot \left(t_0 \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{t_2 + {B}^{2}}\right)}}{t_0}\\ t_4 := A \cdot \left(C \cdot 4\right)\\ \mathbf{if}\;t_3 \leq -\infty:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t_3 \leq -1 \cdot 10^{-202}:\\ \;\;\;\;\frac{1}{\frac{t_4 - {B}^{2}}{\sqrt{2 \cdot \left(\left(A + \left(C + \sqrt{{B}^{2} + t_2}\right)\right) \cdot \left(\left({B}^{2} - t_4\right) \cdot F\right)\right)}}}\\ \mathbf{elif}\;t_3 \leq \infty:\\ \;\;\;\;\frac{-\sqrt{A \cdot \left(\left({C}^{2} \cdot F\right) \cdot -16\right) + \left({B}^{2} \cdot F\right) \cdot \left(8 \cdot C\right)}}{{B}^{2} - 4 \cdot \left(A \cdot C\right)}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 3
Error51.1
Cost21324
\[\begin{array}{l} t_0 := A \cdot \left(4 \cdot C\right)\\ \mathbf{if}\;C \leq -9.6 \cdot 10^{-25}:\\ \;\;\;\;\frac{-\sqrt{-16 \cdot \left({A}^{2} \cdot \left(C \cdot F\right)\right)}}{{B}^{2} - 4 \cdot \left(A \cdot C\right)}\\ \mathbf{elif}\;C \leq 3.3 \cdot 10^{-53}:\\ \;\;\;\;\sqrt{2} \cdot \left(-\sqrt{\frac{F}{B}}\right)\\ \mathbf{elif}\;C \leq 1.25 \cdot 10^{+69}:\\ \;\;\;\;\frac{-\sqrt{{C}^{2} \cdot \left(\left(A \cdot F\right) \cdot -16\right)}}{A \cdot \left(C \cdot -4\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{2 \cdot \left(\left(\left({B}^{2} - t_0\right) \cdot F\right) \cdot \left(A + \left(C + C\right)\right)\right)}}{t_0 - {B}^{2}}\\ \end{array} \]
Alternative 4
Error51.3
Cost20684
\[\begin{array}{l} t_0 := A \cdot \left(C \cdot 4\right)\\ t_1 := \frac{\sqrt{A \cdot \left({C}^{2} \cdot \left(F \cdot -16\right)\right)}}{t_0 - {B}^{2}}\\ \mathbf{if}\;B \leq 1.75 \cdot 10^{-288}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;B \leq 4.3 \cdot 10^{-101}:\\ \;\;\;\;\frac{1}{C \cdot \left(4 \cdot A\right)} \cdot \sqrt{\left(A + \left(C + C\right)\right) \cdot \left(2 \cdot \left(\left({B}^{2} - t_0\right) \cdot F\right)\right)}\\ \mathbf{elif}\;B \leq 8.8 \cdot 10^{-91}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;\sqrt{2} \cdot \left(-\sqrt{\frac{F}{B}}\right)\\ \end{array} \]
Alternative 5
Error51.6
Cost20484
\[\begin{array}{l} \mathbf{if}\;C \leq -2.2 \cdot 10^{-23}:\\ \;\;\;\;\frac{-\sqrt{-16 \cdot \left({A}^{2} \cdot \left(C \cdot F\right)\right)}}{{B}^{2} - 4 \cdot \left(A \cdot C\right)}\\ \mathbf{elif}\;C \leq 1.05 \cdot 10^{-54}:\\ \;\;\;\;\sqrt{2} \cdot \left(-\sqrt{\frac{F}{B}}\right)\\ \mathbf{elif}\;C \leq 8 \cdot 10^{+135}:\\ \;\;\;\;\frac{-\sqrt{{C}^{2} \cdot \left(\left(A \cdot F\right) \cdot -16\right)}}{A \cdot \left(C \cdot -4\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{C \cdot \left(4 \cdot A\right)} \cdot \sqrt{\left(A + \left(C + C\right)\right) \cdot \left(2 \cdot \left(\left({B}^{2} - A \cdot \left(C \cdot 4\right)\right) \cdot F\right)\right)}\\ \end{array} \]
Alternative 6
Error50.1
Cost20356
\[\begin{array}{l} \mathbf{if}\;B \leq -4.3 \cdot 10^{-47}:\\ \;\;\;\;\frac{-\sqrt{{B}^{3} \cdot \left(-2 \cdot F\right)}}{{B}^{2} - 4 \cdot \left(A \cdot C\right)}\\ \mathbf{elif}\;B \leq 5.8 \cdot 10^{-102}:\\ \;\;\;\;\frac{1}{C \cdot \left(4 \cdot A\right)} \cdot \sqrt{\left(A + \left(C + C\right)\right) \cdot \left(2 \cdot \left(\left({B}^{2} - A \cdot \left(C \cdot 4\right)\right) \cdot F\right)\right)}\\ \mathbf{elif}\;B \leq 2.6 \cdot 10^{-92}:\\ \;\;\;\;\frac{-\sqrt{{C}^{2} \cdot \left(\left(A \cdot F\right) \cdot -16\right)}}{A \cdot \left(C \cdot -4\right)}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{2} \cdot \left(-\sqrt{\frac{F}{B}}\right)\\ \end{array} \]
Alternative 7
Error50.3
Cost19972
\[\begin{array}{l} \mathbf{if}\;B \leq -9.8 \cdot 10^{-145}:\\ \;\;\;\;\frac{-\sqrt{{B}^{3} \cdot \left(-2 \cdot F\right)}}{{B}^{2}}\\ \mathbf{elif}\;B \leq 7 \cdot 10^{-102}:\\ \;\;\;\;\frac{1}{C \cdot \left(4 \cdot A\right)} \cdot \sqrt{\left(A + \left(C + C\right)\right) \cdot \left(2 \cdot \left(\left({B}^{2} - A \cdot \left(C \cdot 4\right)\right) \cdot F\right)\right)}\\ \mathbf{elif}\;B \leq 1.9 \cdot 10^{-91}:\\ \;\;\;\;\frac{-\sqrt{{C}^{2} \cdot \left(\left(A \cdot F\right) \cdot -16\right)}}{A \cdot \left(C \cdot -4\right)}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{2} \cdot \left(-\sqrt{\frac{F}{B}}\right)\\ \end{array} \]
Alternative 8
Error53.6
Cost13892
\[\begin{array}{l} \mathbf{if}\;A \leq -4.3 \cdot 10^{+60}:\\ \;\;\;\;\frac{-\sqrt{{C}^{2} \cdot \left(\left(A \cdot F\right) \cdot -16\right)}}{A \cdot \left(C \cdot -4\right)}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{2} \cdot \left(-\sqrt{\frac{F}{B}}\right)\\ \end{array} \]
Alternative 9
Error53.7
Cost13636
\[\begin{array}{l} \mathbf{if}\;B \leq -3.9 \cdot 10^{-244}:\\ \;\;\;\;\frac{\sqrt{2}}{B} \cdot \sqrt{F \cdot \left(A + 2 \cdot C\right)}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{2} \cdot \left(-\sqrt{\frac{F}{B}}\right)\\ \end{array} \]
Alternative 10
Error55.0
Cost13184
\[\sqrt{2} \cdot \left(-\sqrt{\frac{F}{B}}\right) \]
Alternative 11
Error62.1
Cost6976
\[-2 \cdot \frac{1}{\frac{B}{\sqrt{A \cdot F}}} \]
Alternative 12
Error62.1
Cost6848
\[-2 \cdot \frac{\sqrt{A \cdot F}}{B} \]

Error

Reproduce?

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