?

Average Error: 52.3 → 47.0
Time: 40.7s
Precision: binary64
Cost: 41104

?

\[\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 := -\sqrt{-\frac{F}{C}}\\ t_2 := {B}^{2} - \left(4 \cdot A\right) \cdot C\\ t_3 := {B}^{2} - 4 \cdot \left(A \cdot C\right)\\ \mathbf{if}\;C \leq -2.5 \cdot 10^{+105}:\\ \;\;\;\;-\sqrt{-\frac{F}{A}}\\ \mathbf{elif}\;C \leq -3.5 \cdot 10^{-119}:\\ \;\;\;\;\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}\\ \mathbf{elif}\;C \leq -2.6 \cdot 10^{-241}:\\ \;\;\;\;-\sqrt{\frac{F}{B} \cdot -2}\\ \mathbf{elif}\;C \leq 6.1 \cdot 10^{-251}:\\ \;\;\;\;\frac{-\sqrt{\left(2 \cdot F\right) \cdot \left(\left(\left(A + C\right) - \sqrt{{B}^{2} + t_0}\right) \cdot t_3\right)}}{t_3}\\ \mathbf{elif}\;C \leq 4.8 \cdot 10^{+118}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;C \leq 6.5 \cdot 10^{+225}:\\ \;\;\;\;0.25 \cdot \sqrt{-16 \cdot \frac{F}{C}}\\ \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 (- A C) 2.0))
        (t_1 (- (sqrt (- (/ F C)))))
        (t_2 (- (pow B 2.0) (* (* 4.0 A) C)))
        (t_3 (- (pow B 2.0) (* 4.0 (* A C)))))
   (if (<= C -2.5e+105)
     (- (sqrt (- (/ F A))))
     (if (<= C -3.5e-119)
       (/
        (- (sqrt (* (* 2.0 (* t_2 F)) (- (+ A C) (sqrt (+ t_0 (pow B 2.0)))))))
        t_2)
       (if (<= C -2.6e-241)
         (- (sqrt (* (/ F B) -2.0)))
         (if (<= C 6.1e-251)
           (/
            (-
             (sqrt
              (* (* 2.0 F) (* (- (+ A C) (sqrt (+ (pow B 2.0) t_0))) t_3))))
            t_3)
           (if (<= C 4.8e+118)
             t_1
             (if (<= C 6.5e+225) (* 0.25 (sqrt (* -16.0 (/ F 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((A - C), 2.0);
	double t_1 = -sqrt(-(F / C));
	double t_2 = pow(B, 2.0) - ((4.0 * A) * C);
	double t_3 = pow(B, 2.0) - (4.0 * (A * C));
	double tmp;
	if (C <= -2.5e+105) {
		tmp = -sqrt(-(F / A));
	} else if (C <= -3.5e-119) {
		tmp = -sqrt(((2.0 * (t_2 * F)) * ((A + C) - sqrt((t_0 + pow(B, 2.0)))))) / t_2;
	} else if (C <= -2.6e-241) {
		tmp = -sqrt(((F / B) * -2.0));
	} else if (C <= 6.1e-251) {
		tmp = -sqrt(((2.0 * F) * (((A + C) - sqrt((pow(B, 2.0) + t_0))) * t_3))) / t_3;
	} else if (C <= 4.8e+118) {
		tmp = t_1;
	} else if (C <= 6.5e+225) {
		tmp = 0.25 * sqrt((-16.0 * (F / C)));
	} else {
		tmp = t_1;
	}
	return tmp;
}
real(8) function code(a, b, c, f)
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: f
    code = -sqrt(((2.0d0 * (((b ** 2.0d0) - ((4.0d0 * a) * c)) * f)) * ((a + c) - sqrt((((a - c) ** 2.0d0) + (b ** 2.0d0)))))) / ((b ** 2.0d0) - ((4.0d0 * a) * c))
end function
real(8) function code(a, b, c, f)
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: f
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: t_3
    real(8) :: tmp
    t_0 = (a - c) ** 2.0d0
    t_1 = -sqrt(-(f / c))
    t_2 = (b ** 2.0d0) - ((4.0d0 * a) * c)
    t_3 = (b ** 2.0d0) - (4.0d0 * (a * c))
    if (c <= (-2.5d+105)) then
        tmp = -sqrt(-(f / a))
    else if (c <= (-3.5d-119)) then
        tmp = -sqrt(((2.0d0 * (t_2 * f)) * ((a + c) - sqrt((t_0 + (b ** 2.0d0)))))) / t_2
    else if (c <= (-2.6d-241)) then
        tmp = -sqrt(((f / b) * (-2.0d0)))
    else if (c <= 6.1d-251) then
        tmp = -sqrt(((2.0d0 * f) * (((a + c) - sqrt(((b ** 2.0d0) + t_0))) * t_3))) / t_3
    else if (c <= 4.8d+118) then
        tmp = t_1
    else if (c <= 6.5d+225) then
        tmp = 0.25d0 * sqrt(((-16.0d0) * (f / c)))
    else
        tmp = t_1
    end if
    code = tmp
end function
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.sqrt(-(F / C));
	double t_2 = Math.pow(B, 2.0) - ((4.0 * A) * C);
	double t_3 = Math.pow(B, 2.0) - (4.0 * (A * C));
	double tmp;
	if (C <= -2.5e+105) {
		tmp = -Math.sqrt(-(F / A));
	} else if (C <= -3.5e-119) {
		tmp = -Math.sqrt(((2.0 * (t_2 * F)) * ((A + C) - Math.sqrt((t_0 + Math.pow(B, 2.0)))))) / t_2;
	} else if (C <= -2.6e-241) {
		tmp = -Math.sqrt(((F / B) * -2.0));
	} else if (C <= 6.1e-251) {
		tmp = -Math.sqrt(((2.0 * F) * (((A + C) - Math.sqrt((Math.pow(B, 2.0) + t_0))) * t_3))) / t_3;
	} else if (C <= 4.8e+118) {
		tmp = t_1;
	} else if (C <= 6.5e+225) {
		tmp = 0.25 * Math.sqrt((-16.0 * (F / 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((A - C), 2.0)
	t_1 = -math.sqrt(-(F / C))
	t_2 = math.pow(B, 2.0) - ((4.0 * A) * C)
	t_3 = math.pow(B, 2.0) - (4.0 * (A * C))
	tmp = 0
	if C <= -2.5e+105:
		tmp = -math.sqrt(-(F / A))
	elif C <= -3.5e-119:
		tmp = -math.sqrt(((2.0 * (t_2 * F)) * ((A + C) - math.sqrt((t_0 + math.pow(B, 2.0)))))) / t_2
	elif C <= -2.6e-241:
		tmp = -math.sqrt(((F / B) * -2.0))
	elif C <= 6.1e-251:
		tmp = -math.sqrt(((2.0 * F) * (((A + C) - math.sqrt((math.pow(B, 2.0) + t_0))) * t_3))) / t_3
	elif C <= 4.8e+118:
		tmp = t_1
	elif C <= 6.5e+225:
		tmp = 0.25 * math.sqrt((-16.0 * (F / 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(A - C) ^ 2.0
	t_1 = Float64(-sqrt(Float64(-Float64(F / C))))
	t_2 = Float64((B ^ 2.0) - Float64(Float64(4.0 * A) * C))
	t_3 = Float64((B ^ 2.0) - Float64(4.0 * Float64(A * C)))
	tmp = 0.0
	if (C <= -2.5e+105)
		tmp = Float64(-sqrt(Float64(-Float64(F / A))));
	elseif (C <= -3.5e-119)
		tmp = Float64(Float64(-sqrt(Float64(Float64(2.0 * Float64(t_2 * F)) * Float64(Float64(A + C) - sqrt(Float64(t_0 + (B ^ 2.0))))))) / t_2);
	elseif (C <= -2.6e-241)
		tmp = Float64(-sqrt(Float64(Float64(F / B) * -2.0)));
	elseif (C <= 6.1e-251)
		tmp = Float64(Float64(-sqrt(Float64(Float64(2.0 * F) * Float64(Float64(Float64(A + C) - sqrt(Float64((B ^ 2.0) + t_0))) * t_3)))) / t_3);
	elseif (C <= 4.8e+118)
		tmp = t_1;
	elseif (C <= 6.5e+225)
		tmp = Float64(0.25 * sqrt(Float64(-16.0 * Float64(F / 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 = (A - C) ^ 2.0;
	t_1 = -sqrt(-(F / C));
	t_2 = (B ^ 2.0) - ((4.0 * A) * C);
	t_3 = (B ^ 2.0) - (4.0 * (A * C));
	tmp = 0.0;
	if (C <= -2.5e+105)
		tmp = -sqrt(-(F / A));
	elseif (C <= -3.5e-119)
		tmp = -sqrt(((2.0 * (t_2 * F)) * ((A + C) - sqrt((t_0 + (B ^ 2.0)))))) / t_2;
	elseif (C <= -2.6e-241)
		tmp = -sqrt(((F / B) * -2.0));
	elseif (C <= 6.1e-251)
		tmp = -sqrt(((2.0 * F) * (((A + C) - sqrt(((B ^ 2.0) + t_0))) * t_3))) / t_3;
	elseif (C <= 4.8e+118)
		tmp = t_1;
	elseif (C <= 6.5e+225)
		tmp = 0.25 * sqrt((-16.0 * (F / 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[Power[N[(A - C), $MachinePrecision], 2.0], $MachinePrecision]}, Block[{t$95$1 = (-N[Sqrt[(-N[(F / C), $MachinePrecision])], $MachinePrecision])}, Block[{t$95$2 = N[(N[Power[B, 2.0], $MachinePrecision] - N[(N[(4.0 * A), $MachinePrecision] * C), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[Power[B, 2.0], $MachinePrecision] - N[(4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[C, -2.5e+105], (-N[Sqrt[(-N[(F / A), $MachinePrecision])], $MachinePrecision]), If[LessEqual[C, -3.5e-119], N[((-N[Sqrt[N[(N[(2.0 * N[(t$95$2 * 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$2), $MachinePrecision], If[LessEqual[C, -2.6e-241], (-N[Sqrt[N[(N[(F / B), $MachinePrecision] * -2.0), $MachinePrecision]], $MachinePrecision]), If[LessEqual[C, 6.1e-251], N[((-N[Sqrt[N[(N[(2.0 * F), $MachinePrecision] * N[(N[(N[(A + C), $MachinePrecision] - N[Sqrt[N[(N[Power[B, 2.0], $MachinePrecision] + t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * t$95$3), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$3), $MachinePrecision], If[LessEqual[C, 4.8e+118], t$95$1, If[LessEqual[C, 6.5e+225], N[(0.25 * N[Sqrt[N[(-16.0 * N[(F / 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 := {\left(A - C\right)}^{2}\\
t_1 := -\sqrt{-\frac{F}{C}}\\
t_2 := {B}^{2} - \left(4 \cdot A\right) \cdot C\\
t_3 := {B}^{2} - 4 \cdot \left(A \cdot C\right)\\
\mathbf{if}\;C \leq -2.5 \cdot 10^{+105}:\\
\;\;\;\;-\sqrt{-\frac{F}{A}}\\

\mathbf{elif}\;C \leq -3.5 \cdot 10^{-119}:\\
\;\;\;\;\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}\\

\mathbf{elif}\;C \leq -2.6 \cdot 10^{-241}:\\
\;\;\;\;-\sqrt{\frac{F}{B} \cdot -2}\\

\mathbf{elif}\;C \leq 6.1 \cdot 10^{-251}:\\
\;\;\;\;\frac{-\sqrt{\left(2 \cdot F\right) \cdot \left(\left(\left(A + C\right) - \sqrt{{B}^{2} + t_0}\right) \cdot t_3\right)}}{t_3}\\

\mathbf{elif}\;C \leq 4.8 \cdot 10^{+118}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;C \leq 6.5 \cdot 10^{+225}:\\
\;\;\;\;0.25 \cdot \sqrt{-16 \cdot \frac{F}{C}}\\

\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 6 regimes
  2. if C < -2.50000000000000023e105

    1. Initial program 59.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. Simplified60.4

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

      [Start]59.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} \]
    3. Taylor expanded in C around -inf 64.0

      \[\leadsto \color{blue}{-1 \cdot \left(\left(\sqrt{2} \cdot \sqrt{-0.5}\right) \cdot \sqrt{\frac{F}{A}}\right)} \]
    4. Simplified45.9

      \[\leadsto \color{blue}{-\sqrt{-\frac{F}{A}}} \]
      Proof

      [Start]64.0

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

      rational_best.json-simplify-2 [=>]64.0

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

      rational_best.json-simplify-12 [=>]64.0

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

      exponential.json-simplify-19 [=>]64.0

      \[ -\color{blue}{\sqrt{-0.5 \cdot 2}} \cdot \sqrt{\frac{F}{A}} \]

      metadata-eval [=>]64.0

      \[ -\sqrt{\color{blue}{-1}} \cdot \sqrt{\frac{F}{A}} \]

      exponential.json-simplify-19 [=>]45.9

      \[ -\color{blue}{\sqrt{\frac{F}{A} \cdot -1}} \]

      rational_best.json-simplify-12 [=>]45.9

      \[ -\sqrt{\color{blue}{-\frac{F}{A}}} \]

    if -2.50000000000000023e105 < C < -3.5e-119

    1. Initial program 42.2

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

    if -3.5e-119 < C < -2.5999999999999999e-241

    1. Initial program 47.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. Simplified49.3

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

      [Start]47.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} \]
    3. Taylor expanded in A around 0 56.2

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

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

      [Start]56.2

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

      rational_best.json-simplify-2 [=>]56.2

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

      rational_best.json-simplify-44 [=>]56.2

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

      exponential.json-simplify-19 [=>]56.2

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

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

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

      [Start]64.0

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

      rational_best.json-simplify-2 [=>]64.0

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

      rational_best.json-simplify-12 [=>]64.0

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

      exponential.json-simplify-19 [=>]64.0

      \[ -\color{blue}{\sqrt{-1 \cdot 2}} \cdot \sqrt{\frac{F}{B}} \]

      exponential.json-simplify-19 [=>]51.7

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

      metadata-eval [=>]51.7

      \[ -\sqrt{\frac{F}{B} \cdot \color{blue}{-2}} \]

    if -2.5999999999999999e-241 < C < 6.1000000000000003e-251

    1. Initial program 48.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. Simplified49.6

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

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

    if 6.1000000000000003e-251 < C < 4.8e118 or 6.5000000000000006e225 < C

    1. Initial program 53.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. Simplified55.1

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

      [Start]53.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} \]
    3. Taylor expanded in A around -inf 64.0

      \[\leadsto \color{blue}{-1 \cdot \left(\left(\sqrt{2} \cdot \sqrt{-0.5}\right) \cdot \sqrt{\frac{F}{C}}\right)} \]
    4. Simplified46.9

      \[\leadsto \color{blue}{-\sqrt{-\frac{F}{C}}} \]
      Proof

      [Start]64.0

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

      rational_best.json-simplify-2 [=>]64.0

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

      rational_best.json-simplify-12 [=>]64.0

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

      exponential.json-simplify-19 [=>]64.0

      \[ -\color{blue}{\sqrt{-0.5 \cdot 2}} \cdot \sqrt{\frac{F}{C}} \]

      metadata-eval [=>]64.0

      \[ -\sqrt{\color{blue}{-1}} \cdot \sqrt{\frac{F}{C}} \]

      exponential.json-simplify-19 [=>]46.9

      \[ -\color{blue}{\sqrt{\frac{F}{C} \cdot -1}} \]

      rational_best.json-simplify-12 [=>]46.9

      \[ -\sqrt{\color{blue}{-\frac{F}{C}}} \]

    if 4.8e118 < C < 6.5000000000000006e225

    1. Initial program 63.3

      \[\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. Simplified63.6

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

      [Start]63.3

      \[ \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 A around -inf 51.4

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

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

      [Start]51.4

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

      rational_best.json-simplify-44 [=>]51.4

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

      \[\leadsto \color{blue}{0.25 \cdot \left(\sqrt{\frac{F}{C}} \cdot \sqrt{-16}\right)} \]
    6. Simplified51.4

      \[\leadsto \color{blue}{0.25 \cdot \sqrt{-16 \cdot \frac{F}{C}}} \]
      Proof

      [Start]64.0

      \[ 0.25 \cdot \left(\sqrt{\frac{F}{C}} \cdot \sqrt{-16}\right) \]

      exponential.json-simplify-19 [=>]51.4

      \[ 0.25 \cdot \color{blue}{\sqrt{-16 \cdot \frac{F}{C}}} \]
  3. Recombined 6 regimes into one program.
  4. Final simplification47.0

    \[\leadsto \begin{array}{l} \mathbf{if}\;C \leq -2.5 \cdot 10^{+105}:\\ \;\;\;\;-\sqrt{-\frac{F}{A}}\\ \mathbf{elif}\;C \leq -3.5 \cdot 10^{-119}:\\ \;\;\;\;\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}\\ \mathbf{elif}\;C \leq -2.6 \cdot 10^{-241}:\\ \;\;\;\;-\sqrt{\frac{F}{B} \cdot -2}\\ \mathbf{elif}\;C \leq 6.1 \cdot 10^{-251}:\\ \;\;\;\;\frac{-\sqrt{\left(2 \cdot F\right) \cdot \left(\left(\left(A + C\right) - \sqrt{{B}^{2} + {\left(A - C\right)}^{2}}\right) \cdot \left({B}^{2} - 4 \cdot \left(A \cdot C\right)\right)\right)}}{{B}^{2} - 4 \cdot \left(A \cdot C\right)}\\ \mathbf{elif}\;C \leq 4.8 \cdot 10^{+118}:\\ \;\;\;\;-\sqrt{-\frac{F}{C}}\\ \mathbf{elif}\;C \leq 6.5 \cdot 10^{+225}:\\ \;\;\;\;0.25 \cdot \sqrt{-16 \cdot \frac{F}{C}}\\ \mathbf{else}:\\ \;\;\;\;-\sqrt{-\frac{F}{C}}\\ \end{array} \]

Alternatives

Alternative 1
Error47.4
Cost41104
\[\begin{array}{l} t_0 := {B}^{2} - 4 \cdot \left(A \cdot C\right)\\ t_1 := \frac{-\sqrt{\left(2 \cdot F\right) \cdot \left(\left(\left(A + C\right) - \sqrt{{B}^{2} + {\left(A - C\right)}^{2}}\right) \cdot t_0\right)}}{t_0}\\ t_2 := -\sqrt{-\frac{F}{C}}\\ \mathbf{if}\;C \leq -1.35 \cdot 10^{+105}:\\ \;\;\;\;-\sqrt{-\frac{F}{A}}\\ \mathbf{elif}\;C \leq -1.4 \cdot 10^{-120}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;C \leq -2.75 \cdot 10^{-248}:\\ \;\;\;\;-\sqrt{\frac{F}{B} \cdot -2}\\ \mathbf{elif}\;C \leq 5.1 \cdot 10^{-251}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;C \leq 3.9 \cdot 10^{+118}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;C \leq 5.5 \cdot 10^{+225}:\\ \;\;\;\;0.25 \cdot \sqrt{-16 \cdot \frac{F}{C}}\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 2
Error48.6
Cost21584
\[\begin{array}{l} t_0 := -\sqrt{\frac{F}{B} \cdot -2}\\ t_1 := {B}^{2} - \left(4 \cdot A\right) \cdot C\\ t_2 := -\sqrt{-\frac{F}{C}}\\ \mathbf{if}\;C \leq -9.2 \cdot 10^{+39}:\\ \;\;\;\;-\sqrt{-\frac{F}{A}}\\ \mathbf{elif}\;C \leq -1.05 \cdot 10^{-75}:\\ \;\;\;\;\frac{-\left(-C \cdot \sqrt{-16 \cdot \left(A \cdot F\right)}\right)}{t_1}\\ \mathbf{elif}\;C \leq -3.8 \cdot 10^{-211}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;C \leq -6.5 \cdot 10^{-261}:\\ \;\;\;\;\frac{-\sqrt{\left(2 \cdot \left(t_1 \cdot F\right)\right) \cdot \left(\left(A + C\right) - \left(-A\right)\right)}}{t_1}\\ \mathbf{elif}\;C \leq 5.1 \cdot 10^{-251}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;C \leq 1.05 \cdot 10^{+118}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;C \leq 4.5 \cdot 10^{+236}:\\ \;\;\;\;0.25 \cdot \sqrt{-16 \cdot \frac{F}{C}}\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 3
Error48.2
Cost14216
\[\begin{array}{l} t_0 := -\sqrt{-\frac{F}{C}}\\ \mathbf{if}\;C \leq -6 \cdot 10^{+39}:\\ \;\;\;\;-\sqrt{-\frac{F}{A}}\\ \mathbf{elif}\;C \leq -1.18 \cdot 10^{-77}:\\ \;\;\;\;\frac{-\left(-C \cdot \sqrt{-16 \cdot \left(A \cdot F\right)}\right)}{{B}^{2} - \left(4 \cdot A\right) \cdot C}\\ \mathbf{elif}\;C \leq 6.1 \cdot 10^{-251}:\\ \;\;\;\;-\sqrt{\frac{F}{B} \cdot -2}\\ \mathbf{elif}\;C \leq 2.6 \cdot 10^{+118}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;C \leq 3.4 \cdot 10^{+224}:\\ \;\;\;\;0.25 \cdot \sqrt{-16 \cdot \frac{F}{C}}\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 4
Error48.9
Cost7376
\[\begin{array}{l} t_0 := -\sqrt{-\frac{F}{C}}\\ \mathbf{if}\;C \leq -6 \cdot 10^{-11}:\\ \;\;\;\;-\sqrt{-\frac{F}{A}}\\ \mathbf{elif}\;C \leq 4.6 \cdot 10^{-251}:\\ \;\;\;\;-\sqrt{\frac{F}{B} \cdot -2}\\ \mathbf{elif}\;C \leq 4.2 \cdot 10^{+118}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;C \leq 1.1 \cdot 10^{+235}:\\ \;\;\;\;0.25 \cdot \sqrt{-16 \cdot \frac{F}{C}}\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 5
Error47.8
Cost7048
\[\begin{array}{l} \mathbf{if}\;C \leq -2 \cdot 10^{-10}:\\ \;\;\;\;-\sqrt{-\frac{F}{A}}\\ \mathbf{elif}\;C \leq 6.1 \cdot 10^{-251}:\\ \;\;\;\;-\sqrt{\frac{F}{B} \cdot -2}\\ \mathbf{else}:\\ \;\;\;\;-\sqrt{-\frac{F}{C}}\\ \end{array} \]
Alternative 6
Error47.4
Cost6852
\[\begin{array}{l} \mathbf{if}\;C \leq 1.7 \cdot 10^{-273}:\\ \;\;\;\;-\sqrt{-\frac{F}{A}}\\ \mathbf{else}:\\ \;\;\;\;-\sqrt{-\frac{F}{C}}\\ \end{array} \]
Alternative 7
Error54.7
Cost6720
\[-\sqrt{-\frac{F}{A}} \]

Error

Reproduce?

herbie shell --seed 2023090 
(FPCore (A B C F)
  :name "ABCF->ab-angle b"
  :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))))