| Alternative 1 | |
|---|---|
| Error | 42.2 |
| Cost | 40388 |
(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 (- (* B B) (* (* A C) 4.0)))
(t_1 (hypot B (- A C)))
(t_2 (fma -4.0 (* A C) (* B B)))
(t_3 (sqrt (+ A (+ C t_1))))
(t_4 (- (sqrt (* 2.0 (+ t_1 (+ A C))))))
(t_5 (fma B B (* C (* -4.0 A)))))
(if (<= B -0.49)
(/ (* (* (sqrt F) (sqrt t_2)) t_4) t_2)
(if (<= B -2.1e-88)
(/
(- (sqrt (* 2.0 (* t_5 (* F (fma 2.0 A (* -0.5 (/ (* B B) C))))))))
t_5)
(if (<= B -2.15e-177)
(/ (* (pow (pow (* t_2 F) 0.25) 2.0) t_4) t_2)
(if (<= B -3.4e-270)
(/ (- (sqrt (* 2.0 (* t_5 (* F (* A 2.0)))))) t_5)
(if (<= B 8e-293)
(* (sqrt (* t_5 (* 2.0 (* 2.0 (* C F))))) (/ -1.0 t_5))
(if (<= B 4.8e-268)
(/ (* t_3 (- (sqrt (* 2.0 (* -4.0 (* A (* C F))))))) t_0)
(if (<= B 4.9e-110)
(/
(-
(sqrt
(* 2.0 (* t_5 (* F (fma 2.0 A (* -0.5 (/ B (/ C B)))))))))
t_5)
(if (<= B 1.25e+74)
(/
(* t_3 (- (sqrt (* 2.0 (* F (fma B B (* -4.0 (* A C))))))))
t_0)
(* (sqrt 2.0) (- (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 = (B * B) - ((A * C) * 4.0);
double t_1 = hypot(B, (A - C));
double t_2 = fma(-4.0, (A * C), (B * B));
double t_3 = sqrt((A + (C + t_1)));
double t_4 = -sqrt((2.0 * (t_1 + (A + C))));
double t_5 = fma(B, B, (C * (-4.0 * A)));
double tmp;
if (B <= -0.49) {
tmp = ((sqrt(F) * sqrt(t_2)) * t_4) / t_2;
} else if (B <= -2.1e-88) {
tmp = -sqrt((2.0 * (t_5 * (F * fma(2.0, A, (-0.5 * ((B * B) / C))))))) / t_5;
} else if (B <= -2.15e-177) {
tmp = (pow(pow((t_2 * F), 0.25), 2.0) * t_4) / t_2;
} else if (B <= -3.4e-270) {
tmp = -sqrt((2.0 * (t_5 * (F * (A * 2.0))))) / t_5;
} else if (B <= 8e-293) {
tmp = sqrt((t_5 * (2.0 * (2.0 * (C * F))))) * (-1.0 / t_5);
} else if (B <= 4.8e-268) {
tmp = (t_3 * -sqrt((2.0 * (-4.0 * (A * (C * F)))))) / t_0;
} else if (B <= 4.9e-110) {
tmp = -sqrt((2.0 * (t_5 * (F * fma(2.0, A, (-0.5 * (B / (C / B)))))))) / t_5;
} else if (B <= 1.25e+74) {
tmp = (t_3 * -sqrt((2.0 * (F * fma(B, B, (-4.0 * (A * C))))))) / t_0;
} else {
tmp = sqrt(2.0) * -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(Float64(B * B) - Float64(Float64(A * C) * 4.0)) t_1 = hypot(B, Float64(A - C)) t_2 = fma(-4.0, Float64(A * C), Float64(B * B)) t_3 = sqrt(Float64(A + Float64(C + t_1))) t_4 = Float64(-sqrt(Float64(2.0 * Float64(t_1 + Float64(A + C))))) t_5 = fma(B, B, Float64(C * Float64(-4.0 * A))) tmp = 0.0 if (B <= -0.49) tmp = Float64(Float64(Float64(sqrt(F) * sqrt(t_2)) * t_4) / t_2); elseif (B <= -2.1e-88) tmp = Float64(Float64(-sqrt(Float64(2.0 * Float64(t_5 * Float64(F * fma(2.0, A, Float64(-0.5 * Float64(Float64(B * B) / C)))))))) / t_5); elseif (B <= -2.15e-177) tmp = Float64(Float64(((Float64(t_2 * F) ^ 0.25) ^ 2.0) * t_4) / t_2); elseif (B <= -3.4e-270) tmp = Float64(Float64(-sqrt(Float64(2.0 * Float64(t_5 * Float64(F * Float64(A * 2.0)))))) / t_5); elseif (B <= 8e-293) tmp = Float64(sqrt(Float64(t_5 * Float64(2.0 * Float64(2.0 * Float64(C * F))))) * Float64(-1.0 / t_5)); elseif (B <= 4.8e-268) tmp = Float64(Float64(t_3 * Float64(-sqrt(Float64(2.0 * Float64(-4.0 * Float64(A * Float64(C * F))))))) / t_0); elseif (B <= 4.9e-110) tmp = Float64(Float64(-sqrt(Float64(2.0 * Float64(t_5 * Float64(F * fma(2.0, A, Float64(-0.5 * Float64(B / Float64(C / B))))))))) / t_5); elseif (B <= 1.25e+74) tmp = Float64(Float64(t_3 * Float64(-sqrt(Float64(2.0 * Float64(F * fma(B, B, Float64(-4.0 * Float64(A * C)))))))) / t_0); else tmp = Float64(sqrt(2.0) * Float64(-sqrt(Float64(F / B)))); end return 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[(B * B), $MachinePrecision] - N[(N[(A * C), $MachinePrecision] * 4.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Sqrt[B ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]}, Block[{t$95$2 = N[(-4.0 * N[(A * C), $MachinePrecision] + N[(B * B), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[Sqrt[N[(A + N[(C + t$95$1), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$4 = (-N[Sqrt[N[(2.0 * N[(t$95$1 + N[(A + C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])}, Block[{t$95$5 = N[(B * B + N[(C * N[(-4.0 * A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[B, -0.49], N[(N[(N[(N[Sqrt[F], $MachinePrecision] * N[Sqrt[t$95$2], $MachinePrecision]), $MachinePrecision] * t$95$4), $MachinePrecision] / t$95$2), $MachinePrecision], If[LessEqual[B, -2.1e-88], N[((-N[Sqrt[N[(2.0 * N[(t$95$5 * N[(F * N[(2.0 * A + N[(-0.5 * N[(N[(B * B), $MachinePrecision] / C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$5), $MachinePrecision], If[LessEqual[B, -2.15e-177], N[(N[(N[Power[N[Power[N[(t$95$2 * F), $MachinePrecision], 0.25], $MachinePrecision], 2.0], $MachinePrecision] * t$95$4), $MachinePrecision] / t$95$2), $MachinePrecision], If[LessEqual[B, -3.4e-270], N[((-N[Sqrt[N[(2.0 * N[(t$95$5 * N[(F * N[(A * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$5), $MachinePrecision], If[LessEqual[B, 8e-293], N[(N[Sqrt[N[(t$95$5 * N[(2.0 * N[(2.0 * N[(C * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(-1.0 / t$95$5), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, 4.8e-268], N[(N[(t$95$3 * (-N[Sqrt[N[(2.0 * N[(-4.0 * N[(A * N[(C * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision] / t$95$0), $MachinePrecision], If[LessEqual[B, 4.9e-110], N[((-N[Sqrt[N[(2.0 * N[(t$95$5 * N[(F * N[(2.0 * A + N[(-0.5 * N[(B / N[(C / B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$5), $MachinePrecision], If[LessEqual[B, 1.25e+74], N[(N[(t$95$3 * (-N[Sqrt[N[(2.0 * N[(F * N[(B * B + N[(-4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision] / t$95$0), $MachinePrecision], N[(N[Sqrt[2.0], $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 := B \cdot B - \left(A \cdot C\right) \cdot 4\\
t_1 := \mathsf{hypot}\left(B, A - C\right)\\
t_2 := \mathsf{fma}\left(-4, A \cdot C, B \cdot B\right)\\
t_3 := \sqrt{A + \left(C + t_1\right)}\\
t_4 := -\sqrt{2 \cdot \left(t_1 + \left(A + C\right)\right)}\\
t_5 := \mathsf{fma}\left(B, B, C \cdot \left(-4 \cdot A\right)\right)\\
\mathbf{if}\;B \leq -0.49:\\
\;\;\;\;\frac{\left(\sqrt{F} \cdot \sqrt{t_2}\right) \cdot t_4}{t_2}\\
\mathbf{elif}\;B \leq -2.1 \cdot 10^{-88}:\\
\;\;\;\;\frac{-\sqrt{2 \cdot \left(t_5 \cdot \left(F \cdot \mathsf{fma}\left(2, A, -0.5 \cdot \frac{B \cdot B}{C}\right)\right)\right)}}{t_5}\\
\mathbf{elif}\;B \leq -2.15 \cdot 10^{-177}:\\
\;\;\;\;\frac{{\left({\left(t_2 \cdot F\right)}^{0.25}\right)}^{2} \cdot t_4}{t_2}\\
\mathbf{elif}\;B \leq -3.4 \cdot 10^{-270}:\\
\;\;\;\;\frac{-\sqrt{2 \cdot \left(t_5 \cdot \left(F \cdot \left(A \cdot 2\right)\right)\right)}}{t_5}\\
\mathbf{elif}\;B \leq 8 \cdot 10^{-293}:\\
\;\;\;\;\sqrt{t_5 \cdot \left(2 \cdot \left(2 \cdot \left(C \cdot F\right)\right)\right)} \cdot \frac{-1}{t_5}\\
\mathbf{elif}\;B \leq 4.8 \cdot 10^{-268}:\\
\;\;\;\;\frac{t_3 \cdot \left(-\sqrt{2 \cdot \left(-4 \cdot \left(A \cdot \left(C \cdot F\right)\right)\right)}\right)}{t_0}\\
\mathbf{elif}\;B \leq 4.9 \cdot 10^{-110}:\\
\;\;\;\;\frac{-\sqrt{2 \cdot \left(t_5 \cdot \left(F \cdot \mathsf{fma}\left(2, A, -0.5 \cdot \frac{B}{\frac{C}{B}}\right)\right)\right)}}{t_5}\\
\mathbf{elif}\;B \leq 1.25 \cdot 10^{+74}:\\
\;\;\;\;\frac{t_3 \cdot \left(-\sqrt{2 \cdot \left(F \cdot \mathsf{fma}\left(B, B, -4 \cdot \left(A \cdot C\right)\right)\right)}\right)}{t_0}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{2} \cdot \left(-\sqrt{\frac{F}{B}}\right)\\
\end{array}
if B < -0.48999999999999999Initial program 54.8
Simplified52.7
[Start]54.8 | \[ \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}
\] |
|---|
Applied egg-rr48.5
Applied egg-rr45.5
if -0.48999999999999999 < B < -2.1e-88Initial program 43.3
Simplified37.5
[Start]43.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}
\] |
|---|
Taylor expanded in C around -inf 49.6
Simplified49.6
[Start]49.6 | \[ \frac{-\sqrt{2 \cdot \left(\mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right) \cdot \left(F \cdot \left(2 \cdot A + -0.5 \cdot \frac{{B}^{2}}{C}\right)\right)\right)}}{\mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)}
\] |
|---|---|
fma-def [=>]49.6 | \[ \frac{-\sqrt{2 \cdot \left(\mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right) \cdot \left(F \cdot \color{blue}{\mathsf{fma}\left(2, A, -0.5 \cdot \frac{{B}^{2}}{C}\right)}\right)\right)}}{\mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)}
\] |
unpow2 [=>]49.6 | \[ \frac{-\sqrt{2 \cdot \left(\mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right) \cdot \left(F \cdot \mathsf{fma}\left(2, A, -0.5 \cdot \frac{\color{blue}{B \cdot B}}{C}\right)\right)\right)}}{\mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)}
\] |
if -2.1e-88 < B < -2.1500000000000001e-177Initial program 52.2
Simplified45.7
[Start]52.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}
\] |
|---|
Applied egg-rr41.9
Applied egg-rr42.0
if -2.1500000000000001e-177 < B < -3.4000000000000001e-270Initial program 54.0
Simplified47.4
[Start]54.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}
\] |
|---|
Taylor expanded in A around inf 48.7
if -3.4000000000000001e-270 < B < 8.0000000000000004e-293Initial program 54.9
Simplified48.6
[Start]54.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}
\] |
|---|
Taylor expanded in A around -inf 49.7
Applied egg-rr49.9
if 8.0000000000000004e-293 < B < 4.7999999999999998e-268Initial program 55.1
Simplified55.1
[Start]55.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}
\] |
|---|
Applied egg-rr43.2
Simplified43.2
[Start]43.2 | \[ \frac{-\sqrt{2 \cdot \left(\mathsf{fma}\left(B, B, \left(A \cdot C\right) \cdot -4\right) \cdot F\right)} \cdot \sqrt{A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)}
\] |
|---|---|
*-commutative [=>]43.2 | \[ \frac{-\color{blue}{\sqrt{A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)} \cdot \sqrt{2 \cdot \left(\mathsf{fma}\left(B, B, \left(A \cdot C\right) \cdot -4\right) \cdot F\right)}}}{B \cdot B - 4 \cdot \left(A \cdot C\right)}
\] |
*-commutative [=>]43.2 | \[ \frac{-\sqrt{A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)} \cdot \sqrt{2 \cdot \color{blue}{\left(F \cdot \mathsf{fma}\left(B, B, \left(A \cdot C\right) \cdot -4\right)\right)}}}{B \cdot B - 4 \cdot \left(A \cdot C\right)}
\] |
Taylor expanded in B around 0 45.3
if 4.7999999999999998e-268 < B < 4.8999999999999997e-110Initial program 52.0
Simplified47.1
[Start]52.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}
\] |
|---|
Taylor expanded in C around -inf 48.9
Simplified48.9
[Start]48.9 | \[ \frac{-\sqrt{2 \cdot \left(\mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right) \cdot \left(F \cdot \left(2 \cdot A + -0.5 \cdot \frac{{B}^{2}}{C}\right)\right)\right)}}{\mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)}
\] |
|---|---|
fma-def [=>]48.9 | \[ \frac{-\sqrt{2 \cdot \left(\mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right) \cdot \left(F \cdot \color{blue}{\mathsf{fma}\left(2, A, -0.5 \cdot \frac{{B}^{2}}{C}\right)}\right)\right)}}{\mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)}
\] |
unpow2 [=>]48.9 | \[ \frac{-\sqrt{2 \cdot \left(\mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right) \cdot \left(F \cdot \mathsf{fma}\left(2, A, -0.5 \cdot \frac{\color{blue}{B \cdot B}}{C}\right)\right)\right)}}{\mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)}
\] |
associate-/l* [=>]48.9 | \[ \frac{-\sqrt{2 \cdot \left(\mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right) \cdot \left(F \cdot \mathsf{fma}\left(2, A, -0.5 \cdot \color{blue}{\frac{B}{\frac{C}{B}}}\right)\right)\right)}}{\mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)}
\] |
if 4.8999999999999997e-110 < B < 1.24999999999999991e74Initial program 43.1
Simplified43.1
[Start]43.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}
\] |
|---|
Applied egg-rr33.1
Simplified33.1
[Start]33.1 | \[ \frac{-\sqrt{2 \cdot \left(\mathsf{fma}\left(B, B, \left(A \cdot C\right) \cdot -4\right) \cdot F\right)} \cdot \sqrt{A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)}
\] |
|---|---|
*-commutative [=>]33.1 | \[ \frac{-\color{blue}{\sqrt{A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)} \cdot \sqrt{2 \cdot \left(\mathsf{fma}\left(B, B, \left(A \cdot C\right) \cdot -4\right) \cdot F\right)}}}{B \cdot B - 4 \cdot \left(A \cdot C\right)}
\] |
*-commutative [=>]33.1 | \[ \frac{-\sqrt{A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)} \cdot \sqrt{2 \cdot \color{blue}{\left(F \cdot \mathsf{fma}\left(B, B, \left(A \cdot C\right) \cdot -4\right)\right)}}}{B \cdot B - 4 \cdot \left(A \cdot C\right)}
\] |
if 1.24999999999999991e74 < B Initial program 59.2
Simplified59.2
[Start]59.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}
\] |
|---|
Taylor expanded in A around 0 55.4
Simplified55.4
[Start]55.4 | \[ \frac{-\sqrt{\left(C + \sqrt{{B}^{2} + {C}^{2}}\right) \cdot F} \cdot \left(\sqrt{2} \cdot B\right)}{B \cdot B - 4 \cdot \left(A \cdot C\right)}
\] |
|---|---|
*-commutative [=>]55.4 | \[ \frac{-\sqrt{\color{blue}{F \cdot \left(C + \sqrt{{B}^{2} + {C}^{2}}\right)}} \cdot \left(\sqrt{2} \cdot B\right)}{B \cdot B - 4 \cdot \left(A \cdot C\right)}
\] |
unpow2 [=>]55.4 | \[ \frac{-\sqrt{F \cdot \left(C + \sqrt{\color{blue}{B \cdot B} + {C}^{2}}\right)} \cdot \left(\sqrt{2} \cdot B\right)}{B \cdot B - 4 \cdot \left(A \cdot C\right)}
\] |
unpow2 [=>]55.4 | \[ \frac{-\sqrt{F \cdot \left(C + \sqrt{B \cdot B + \color{blue}{C \cdot C}}\right)} \cdot \left(\sqrt{2} \cdot B\right)}{B \cdot B - 4 \cdot \left(A \cdot C\right)}
\] |
*-commutative [=>]55.4 | \[ \frac{-\sqrt{F \cdot \left(C + \sqrt{B \cdot B + C \cdot C}\right)} \cdot \color{blue}{\left(B \cdot \sqrt{2}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)}
\] |
Taylor expanded in C around 0 33.2
Simplified33.2
[Start]33.2 | \[ -1 \cdot \left(\sqrt{2} \cdot \sqrt{\frac{F}{B}}\right)
\] |
|---|---|
mul-1-neg [=>]33.2 | \[ \color{blue}{-\sqrt{2} \cdot \sqrt{\frac{F}{B}}}
\] |
distribute-rgt-neg-in [=>]33.2 | \[ \color{blue}{\sqrt{2} \cdot \left(-\sqrt{\frac{F}{B}}\right)}
\] |
Final simplification42.1
| Alternative 1 | |
|---|---|
| Error | 42.2 |
| Cost | 40388 |
| Alternative 2 | |
|---|---|
| Error | 42.4 |
| Cost | 34252 |
| Alternative 3 | |
|---|---|
| Error | 43.3 |
| Cost | 33988 |
| Alternative 4 | |
|---|---|
| Error | 44.0 |
| Cost | 28312 |
| Alternative 5 | |
|---|---|
| Error | 43.9 |
| Cost | 28312 |
| Alternative 6 | |
|---|---|
| Error | 43.2 |
| Cost | 28116 |
| Alternative 7 | |
|---|---|
| Error | 40.2 |
| Cost | 28112 |
| Alternative 8 | |
|---|---|
| Error | 42.5 |
| Cost | 27732 |
| Alternative 9 | |
|---|---|
| Error | 42.6 |
| Cost | 27732 |
| Alternative 10 | |
|---|---|
| Error | 44.4 |
| Cost | 26884 |
| Alternative 11 | |
|---|---|
| Error | 43.3 |
| Cost | 26884 |
| Alternative 12 | |
|---|---|
| Error | 44.6 |
| Cost | 21924 |
| Alternative 13 | |
|---|---|
| Error | 44.6 |
| Cost | 21660 |
| Alternative 14 | |
|---|---|
| Error | 44.7 |
| Cost | 21528 |
| Alternative 15 | |
|---|---|
| Error | 45.1 |
| Cost | 21528 |
| Alternative 16 | |
|---|---|
| Error | 43.5 |
| Cost | 20484 |
| Alternative 17 | |
|---|---|
| Error | 43.9 |
| Cost | 20292 |
| Alternative 18 | |
|---|---|
| Error | 43.9 |
| Cost | 20292 |
| Alternative 19 | |
|---|---|
| Error | 44.3 |
| Cost | 15308 |
| Alternative 20 | |
|---|---|
| Error | 49.5 |
| Cost | 14604 |
| Alternative 21 | |
|---|---|
| Error | 50.5 |
| Cost | 14476 |
| Alternative 22 | |
|---|---|
| Error | 50.6 |
| Cost | 14348 |
| Alternative 23 | |
|---|---|
| Error | 50.5 |
| Cost | 13448 |
| Alternative 24 | |
|---|---|
| Error | 51.3 |
| Cost | 13316 |
| Alternative 25 | |
|---|---|
| Error | 52.9 |
| Cost | 8712 |
| Alternative 26 | |
|---|---|
| Error | 53.1 |
| Cost | 8584 |
| Alternative 27 | |
|---|---|
| Error | 55.7 |
| Cost | 8452 |
| Alternative 28 | |
|---|---|
| Error | 56.5 |
| Cost | 8452 |
| Alternative 29 | |
|---|---|
| Error | 56.9 |
| Cost | 8196 |
| Alternative 30 | |
|---|---|
| Error | 56.6 |
| Cost | 8196 |
| Alternative 31 | |
|---|---|
| Error | 58.2 |
| Cost | 7808 |
| Alternative 32 | |
|---|---|
| Error | 61.6 |
| Cost | 64 |
herbie shell --seed 2023039
(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))))