| Alternative 1 | |
|---|---|
| Error | 39.7 |
| Cost | 34252 |
(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 (fma B B (* A (* C -4.0))))
(t_1 (/ (- (sqrt (* t_0 (* (+ A A) (* F 2.0))))) t_0))
(t_2 (/ (sqrt 2.0) B)))
(if (<= B -4.8e+139)
(* (sqrt (* F (- A (hypot B A)))) t_2)
(if (<= B -1.2e-79)
(* t_2 (sqrt (* F (/ (- (* B B)) (+ A (hypot A B))))))
(if (<= B -8e-223)
(/ (* (- (sqrt 2.0)) (sqrt (* F (/ (* B -0.5) (/ A B))))) B)
(if (<= B -1.75e-265)
t_1
(if (<= B 9.5e-264)
(* C (/ (sqrt (* A (* F -16.0))) (fma B B (* C (* A -4.0)))))
(if (<= B 1.15e-120)
t_1
(if (<= B 1450.0)
(* t_2 (/ (- (sqrt (* F (* -0.5 (* B B))))) (sqrt A)))
(*
t_2
(- (sqrt (* F (/ 1.0 (/ 1.0 (- A (hypot A 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 = fma(B, B, (A * (C * -4.0)));
double t_1 = -sqrt((t_0 * ((A + A) * (F * 2.0)))) / t_0;
double t_2 = sqrt(2.0) / B;
double tmp;
if (B <= -4.8e+139) {
tmp = sqrt((F * (A - hypot(B, A)))) * t_2;
} else if (B <= -1.2e-79) {
tmp = t_2 * sqrt((F * (-(B * B) / (A + hypot(A, B)))));
} else if (B <= -8e-223) {
tmp = (-sqrt(2.0) * sqrt((F * ((B * -0.5) / (A / B))))) / B;
} else if (B <= -1.75e-265) {
tmp = t_1;
} else if (B <= 9.5e-264) {
tmp = C * (sqrt((A * (F * -16.0))) / fma(B, B, (C * (A * -4.0))));
} else if (B <= 1.15e-120) {
tmp = t_1;
} else if (B <= 1450.0) {
tmp = t_2 * (-sqrt((F * (-0.5 * (B * B)))) / sqrt(A));
} else {
tmp = t_2 * -sqrt((F * (1.0 / (1.0 / (A - hypot(A, 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 = fma(B, B, Float64(A * Float64(C * -4.0))) t_1 = Float64(Float64(-sqrt(Float64(t_0 * Float64(Float64(A + A) * Float64(F * 2.0))))) / t_0) t_2 = Float64(sqrt(2.0) / B) tmp = 0.0 if (B <= -4.8e+139) tmp = Float64(sqrt(Float64(F * Float64(A - hypot(B, A)))) * t_2); elseif (B <= -1.2e-79) tmp = Float64(t_2 * sqrt(Float64(F * Float64(Float64(-Float64(B * B)) / Float64(A + hypot(A, B)))))); elseif (B <= -8e-223) tmp = Float64(Float64(Float64(-sqrt(2.0)) * sqrt(Float64(F * Float64(Float64(B * -0.5) / Float64(A / B))))) / B); elseif (B <= -1.75e-265) tmp = t_1; elseif (B <= 9.5e-264) tmp = Float64(C * Float64(sqrt(Float64(A * Float64(F * -16.0))) / fma(B, B, Float64(C * Float64(A * -4.0))))); elseif (B <= 1.15e-120) tmp = t_1; elseif (B <= 1450.0) tmp = Float64(t_2 * Float64(Float64(-sqrt(Float64(F * Float64(-0.5 * Float64(B * B))))) / sqrt(A))); else tmp = Float64(t_2 * Float64(-sqrt(Float64(F * Float64(1.0 / Float64(1.0 / Float64(A - hypot(A, 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[(B * B + N[(A * N[(C * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[((-N[Sqrt[N[(t$95$0 * N[(N[(A + A), $MachinePrecision] * N[(F * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision]}, Block[{t$95$2 = N[(N[Sqrt[2.0], $MachinePrecision] / B), $MachinePrecision]}, If[LessEqual[B, -4.8e+139], N[(N[Sqrt[N[(F * N[(A - N[Sqrt[B ^ 2 + A ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * t$95$2), $MachinePrecision], If[LessEqual[B, -1.2e-79], N[(t$95$2 * N[Sqrt[N[(F * N[((-N[(B * B), $MachinePrecision]) / N[(A + N[Sqrt[A ^ 2 + B ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[B, -8e-223], N[(N[((-N[Sqrt[2.0], $MachinePrecision]) * N[Sqrt[N[(F * N[(N[(B * -0.5), $MachinePrecision] / N[(A / B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[B, -1.75e-265], t$95$1, If[LessEqual[B, 9.5e-264], N[(C * N[(N[Sqrt[N[(A * N[(F * -16.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(B * B + N[(C * N[(A * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, 1.15e-120], t$95$1, If[LessEqual[B, 1450.0], N[(t$95$2 * N[((-N[Sqrt[N[(F * N[(-0.5 * N[(B * B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / N[Sqrt[A], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$2 * (-N[Sqrt[N[(F * N[(1.0 / N[(1.0 / N[(A - N[Sqrt[A ^ 2 + B ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $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 := \mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)\\
t_1 := \frac{-\sqrt{t_0 \cdot \left(\left(A + A\right) \cdot \left(F \cdot 2\right)\right)}}{t_0}\\
t_2 := \frac{\sqrt{2}}{B}\\
\mathbf{if}\;B \leq -4.8 \cdot 10^{+139}:\\
\;\;\;\;\sqrt{F \cdot \left(A - \mathsf{hypot}\left(B, A\right)\right)} \cdot t_2\\
\mathbf{elif}\;B \leq -1.2 \cdot 10^{-79}:\\
\;\;\;\;t_2 \cdot \sqrt{F \cdot \frac{-B \cdot B}{A + \mathsf{hypot}\left(A, B\right)}}\\
\mathbf{elif}\;B \leq -8 \cdot 10^{-223}:\\
\;\;\;\;\frac{\left(-\sqrt{2}\right) \cdot \sqrt{F \cdot \frac{B \cdot -0.5}{\frac{A}{B}}}}{B}\\
\mathbf{elif}\;B \leq -1.75 \cdot 10^{-265}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;B \leq 9.5 \cdot 10^{-264}:\\
\;\;\;\;C \cdot \frac{\sqrt{A \cdot \left(F \cdot -16\right)}}{\mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)}\\
\mathbf{elif}\;B \leq 1.15 \cdot 10^{-120}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;B \leq 1450:\\
\;\;\;\;t_2 \cdot \frac{-\sqrt{F \cdot \left(-0.5 \cdot \left(B \cdot B\right)\right)}}{\sqrt{A}}\\
\mathbf{else}:\\
\;\;\;\;t_2 \cdot \left(-\sqrt{F \cdot \frac{1}{\frac{1}{A - \mathsf{hypot}\left(A, B\right)}}}\right)\\
\end{array}
if B < -4.80000000000000016e139Initial program 63.4
Simplified63.2
[Start]63.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}
\] |
|---|
Applied egg-rr62.9
Simplified62.9
[Start]62.9 | \[ \frac{\mathsf{hypot}\left(B, \sqrt{A \cdot \left(C \cdot -4\right)}\right)}{1} \cdot \frac{\sqrt{\left(\left(A + C\right) - \mathsf{hypot}\left(B, A - C\right)\right) \cdot \left(2 \cdot F\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}
\] |
|---|---|
/-rgt-identity [=>]62.9 | \[ \color{blue}{\mathsf{hypot}\left(B, \sqrt{A \cdot \left(C \cdot -4\right)}\right)} \cdot \frac{\sqrt{\left(\left(A + C\right) - \mathsf{hypot}\left(B, A - C\right)\right) \cdot \left(2 \cdot F\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}
\] |
associate--l+ [=>]62.9 | \[ \mathsf{hypot}\left(B, \sqrt{A \cdot \left(C \cdot -4\right)}\right) \cdot \frac{\sqrt{\color{blue}{\left(A + \left(C - \mathsf{hypot}\left(B, A - C\right)\right)\right)} \cdot \left(2 \cdot F\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}
\] |
Taylor expanded in C around 0 61.5
Simplified61.5
[Start]61.5 | \[ \sqrt{\left(A - \sqrt{{B}^{2} + {A}^{2}}\right) \cdot F} \cdot \frac{\sqrt{2}}{B}
\] |
|---|---|
*-commutative [=>]61.5 | \[ \sqrt{\color{blue}{F \cdot \left(A - \sqrt{{B}^{2} + {A}^{2}}\right)}} \cdot \frac{\sqrt{2}}{B}
\] |
unpow2 [=>]61.5 | \[ \sqrt{F \cdot \left(A - \sqrt{\color{blue}{B \cdot B} + {A}^{2}}\right)} \cdot \frac{\sqrt{2}}{B}
\] |
unpow2 [=>]61.5 | \[ \sqrt{F \cdot \left(A - \sqrt{B \cdot B + \color{blue}{A \cdot A}}\right)} \cdot \frac{\sqrt{2}}{B}
\] |
Applied egg-rr35.2
Simplified32.7
[Start]35.2 | \[ \sqrt{F \cdot \left(A - \left(e^{\mathsf{log1p}\left(\mathsf{hypot}\left(B, A\right)\right)} - 1\right)\right)} \cdot \frac{\sqrt{2}}{B}
\] |
|---|---|
expm1-def [=>]35.2 | \[ \sqrt{F \cdot \left(A - \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\mathsf{hypot}\left(B, A\right)\right)\right)}\right)} \cdot \frac{\sqrt{2}}{B}
\] |
expm1-log1p [=>]32.7 | \[ \sqrt{F \cdot \left(A - \color{blue}{\mathsf{hypot}\left(B, A\right)}\right)} \cdot \frac{\sqrt{2}}{B}
\] |
if -4.80000000000000016e139 < B < -1.20000000000000003e-79Initial program 43.5
Simplified39.0
[Start]43.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}
\] |
|---|
Applied egg-rr63.3
Simplified63.3
[Start]63.3 | \[ \frac{\mathsf{hypot}\left(B, \sqrt{A \cdot \left(C \cdot -4\right)}\right)}{1} \cdot \frac{\sqrt{\left(\left(A + C\right) - \mathsf{hypot}\left(B, A - C\right)\right) \cdot \left(2 \cdot F\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}
\] |
|---|---|
/-rgt-identity [=>]63.3 | \[ \color{blue}{\mathsf{hypot}\left(B, \sqrt{A \cdot \left(C \cdot -4\right)}\right)} \cdot \frac{\sqrt{\left(\left(A + C\right) - \mathsf{hypot}\left(B, A - C\right)\right) \cdot \left(2 \cdot F\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}
\] |
associate--l+ [=>]63.3 | \[ \mathsf{hypot}\left(B, \sqrt{A \cdot \left(C \cdot -4\right)}\right) \cdot \frac{\sqrt{\color{blue}{\left(A + \left(C - \mathsf{hypot}\left(B, A - C\right)\right)\right)} \cdot \left(2 \cdot F\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}
\] |
Taylor expanded in C around 0 41.5
Simplified41.5
[Start]41.5 | \[ \sqrt{\left(A - \sqrt{{B}^{2} + {A}^{2}}\right) \cdot F} \cdot \frac{\sqrt{2}}{B}
\] |
|---|---|
*-commutative [=>]41.5 | \[ \sqrt{\color{blue}{F \cdot \left(A - \sqrt{{B}^{2} + {A}^{2}}\right)}} \cdot \frac{\sqrt{2}}{B}
\] |
unpow2 [=>]41.5 | \[ \sqrt{F \cdot \left(A - \sqrt{\color{blue}{B \cdot B} + {A}^{2}}\right)} \cdot \frac{\sqrt{2}}{B}
\] |
unpow2 [=>]41.5 | \[ \sqrt{F \cdot \left(A - \sqrt{B \cdot B + \color{blue}{A \cdot A}}\right)} \cdot \frac{\sqrt{2}}{B}
\] |
Applied egg-rr37.0
Simplified37.0
[Start]37.0 | \[ \sqrt{F \cdot \left(\left(A \cdot \left(A - A\right) - B \cdot B\right) \cdot \frac{1}{A + \mathsf{hypot}\left(A, B\right)}\right)} \cdot \frac{\sqrt{2}}{B}
\] |
|---|---|
associate-*r/ [=>]37.0 | \[ \sqrt{F \cdot \color{blue}{\frac{\left(A \cdot \left(A - A\right) - B \cdot B\right) \cdot 1}{A + \mathsf{hypot}\left(A, B\right)}}} \cdot \frac{\sqrt{2}}{B}
\] |
*-rgt-identity [=>]37.0 | \[ \sqrt{F \cdot \frac{\color{blue}{A \cdot \left(A - A\right) - B \cdot B}}{A + \mathsf{hypot}\left(A, B\right)}} \cdot \frac{\sqrt{2}}{B}
\] |
div-sub [=>]37.0 | \[ \sqrt{F \cdot \color{blue}{\left(\frac{A \cdot \left(A - A\right)}{A + \mathsf{hypot}\left(A, B\right)} - \frac{B \cdot B}{A + \mathsf{hypot}\left(A, B\right)}\right)}} \cdot \frac{\sqrt{2}}{B}
\] |
+-inverses [=>]37.0 | \[ \sqrt{F \cdot \left(\frac{A \cdot \color{blue}{0}}{A + \mathsf{hypot}\left(A, B\right)} - \frac{B \cdot B}{A + \mathsf{hypot}\left(A, B\right)}\right)} \cdot \frac{\sqrt{2}}{B}
\] |
mul0-rgt [=>]37.0 | \[ \sqrt{F \cdot \left(\frac{\color{blue}{0}}{A + \mathsf{hypot}\left(A, B\right)} - \frac{B \cdot B}{A + \mathsf{hypot}\left(A, B\right)}\right)} \cdot \frac{\sqrt{2}}{B}
\] |
+-inverses [<=]37.0 | \[ \sqrt{F \cdot \left(\frac{\color{blue}{A - A}}{A + \mathsf{hypot}\left(A, B\right)} - \frac{B \cdot B}{A + \mathsf{hypot}\left(A, B\right)}\right)} \cdot \frac{\sqrt{2}}{B}
\] |
div-sub [<=]37.0 | \[ \sqrt{F \cdot \color{blue}{\frac{\left(A - A\right) - B \cdot B}{A + \mathsf{hypot}\left(A, B\right)}}} \cdot \frac{\sqrt{2}}{B}
\] |
+-inverses [=>]37.0 | \[ \sqrt{F \cdot \frac{\color{blue}{0} - B \cdot B}{A + \mathsf{hypot}\left(A, B\right)}} \cdot \frac{\sqrt{2}}{B}
\] |
neg-sub0 [<=]37.0 | \[ \sqrt{F \cdot \frac{\color{blue}{-B \cdot B}}{A + \mathsf{hypot}\left(A, B\right)}} \cdot \frac{\sqrt{2}}{B}
\] |
distribute-rgt-neg-in [=>]37.0 | \[ \sqrt{F \cdot \frac{\color{blue}{B \cdot \left(-B\right)}}{A + \mathsf{hypot}\left(A, B\right)}} \cdot \frac{\sqrt{2}}{B}
\] |
if -1.20000000000000003e-79 < B < -7.9999999999999998e-223Initial program 52.6
Simplified52.0
[Start]52.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}
\] |
|---|
Taylor expanded in C around 0 63.0
Simplified63.0
[Start]63.0 | \[ -1 \cdot \left(\frac{\sqrt{2}}{B} \cdot \sqrt{\left(A - \sqrt{{B}^{2} + {A}^{2}}\right) \cdot F}\right)
\] |
|---|---|
associate-*r* [=>]63.0 | \[ \color{blue}{\left(-1 \cdot \frac{\sqrt{2}}{B}\right) \cdot \sqrt{\left(A - \sqrt{{B}^{2} + {A}^{2}}\right) \cdot F}}
\] |
associate-*r/ [=>]63.0 | \[ \color{blue}{\frac{-1 \cdot \sqrt{2}}{B}} \cdot \sqrt{\left(A - \sqrt{{B}^{2} + {A}^{2}}\right) \cdot F}
\] |
mul-1-neg [=>]63.0 | \[ \frac{\color{blue}{-\sqrt{2}}}{B} \cdot \sqrt{\left(A - \sqrt{{B}^{2} + {A}^{2}}\right) \cdot F}
\] |
*-commutative [=>]63.0 | \[ \frac{-\sqrt{2}}{B} \cdot \sqrt{\color{blue}{F \cdot \left(A - \sqrt{{B}^{2} + {A}^{2}}\right)}}
\] |
unpow2 [=>]63.0 | \[ \frac{-\sqrt{2}}{B} \cdot \sqrt{F \cdot \left(A - \sqrt{\color{blue}{B \cdot B} + {A}^{2}}\right)}
\] |
unpow2 [=>]63.0 | \[ \frac{-\sqrt{2}}{B} \cdot \sqrt{F \cdot \left(A - \sqrt{B \cdot B + \color{blue}{A \cdot A}}\right)}
\] |
Taylor expanded in A around inf 59.8
Simplified59.8
[Start]59.8 | \[ \frac{-\sqrt{2}}{B} \cdot \sqrt{F \cdot \left(-0.5 \cdot \frac{{B}^{2}}{A}\right)}
\] |
|---|---|
associate-*r/ [=>]59.8 | \[ \frac{-\sqrt{2}}{B} \cdot \sqrt{F \cdot \color{blue}{\frac{-0.5 \cdot {B}^{2}}{A}}}
\] |
unpow2 [=>]59.8 | \[ \frac{-\sqrt{2}}{B} \cdot \sqrt{F \cdot \frac{-0.5 \cdot \color{blue}{\left(B \cdot B\right)}}{A}}
\] |
associate-*r* [=>]59.8 | \[ \frac{-\sqrt{2}}{B} \cdot \sqrt{F \cdot \frac{\color{blue}{\left(-0.5 \cdot B\right) \cdot B}}{A}}
\] |
Applied egg-rr58.2
if -7.9999999999999998e-223 < B < -1.75000000000000008e-265 or 9.50000000000000012e-264 < B < 1.14999999999999993e-120Initial program 53.2
Simplified46.8
[Start]53.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 C around inf 48.9
if -1.75000000000000008e-265 < B < 9.50000000000000012e-264Initial program 53.4
Simplified46.6
[Start]53.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}
\] |
|---|
Taylor expanded in B around 0 52.9
Simplified53.0
[Start]52.9 | \[ \frac{-\sqrt{-16 \cdot \left(A \cdot \left({C}^{2} \cdot F\right)\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}
\] |
|---|---|
associate-*r* [=>]53.0 | \[ \frac{-\sqrt{\color{blue}{\left(-16 \cdot A\right) \cdot \left({C}^{2} \cdot F\right)}}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}
\] |
*-commutative [=>]53.0 | \[ \frac{-\sqrt{\left(-16 \cdot A\right) \cdot \color{blue}{\left(F \cdot {C}^{2}\right)}}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}
\] |
unpow2 [=>]53.0 | \[ \frac{-\sqrt{\left(-16 \cdot A\right) \cdot \left(F \cdot \color{blue}{\left(C \cdot C\right)}\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}
\] |
Applied egg-rr49.7
Simplified49.6
[Start]49.7 | \[ 0 + \frac{\sqrt{-16 \cdot \left(A \cdot F\right)} \cdot C}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}
\] |
|---|---|
+-lft-identity [=>]49.7 | \[ \color{blue}{\frac{\sqrt{-16 \cdot \left(A \cdot F\right)} \cdot C}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}}
\] |
associate-/l* [=>]49.0 | \[ \color{blue}{\frac{\sqrt{-16 \cdot \left(A \cdot F\right)}}{\frac{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}{C}}}
\] |
associate-/r/ [=>]49.7 | \[ \color{blue}{\frac{\sqrt{-16 \cdot \left(A \cdot F\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)} \cdot C}
\] |
*-lft-identity [<=]49.7 | \[ \frac{\color{blue}{1 \cdot \sqrt{-16 \cdot \left(A \cdot F\right)}}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)} \cdot C
\] |
associate-*l/ [<=]49.7 | \[ \color{blue}{\left(\frac{1}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)} \cdot \sqrt{-16 \cdot \left(A \cdot F\right)}\right)} \cdot C
\] |
*-commutative [=>]49.7 | \[ \color{blue}{C \cdot \left(\frac{1}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)} \cdot \sqrt{-16 \cdot \left(A \cdot F\right)}\right)}
\] |
associate-*l/ [=>]49.7 | \[ C \cdot \color{blue}{\frac{1 \cdot \sqrt{-16 \cdot \left(A \cdot F\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}}
\] |
*-lft-identity [=>]49.7 | \[ C \cdot \frac{\color{blue}{\sqrt{-16 \cdot \left(A \cdot F\right)}}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}
\] |
associate-*r* [=>]49.8 | \[ C \cdot \frac{\sqrt{\color{blue}{\left(-16 \cdot A\right) \cdot F}}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}
\] |
*-commutative [=>]49.8 | \[ C \cdot \frac{\sqrt{\color{blue}{\left(A \cdot -16\right)} \cdot F}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}
\] |
associate-*l* [=>]49.6 | \[ C \cdot \frac{\sqrt{\color{blue}{A \cdot \left(-16 \cdot F\right)}}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}
\] |
*-commutative [=>]49.6 | \[ C \cdot \frac{\sqrt{A \cdot \left(-16 \cdot F\right)}}{\mathsf{fma}\left(B, B, A \cdot \color{blue}{\left(-4 \cdot C\right)}\right)}
\] |
associate-*r* [=>]49.6 | \[ C \cdot \frac{\sqrt{A \cdot \left(-16 \cdot F\right)}}{\mathsf{fma}\left(B, B, \color{blue}{\left(A \cdot -4\right) \cdot C}\right)}
\] |
if 1.14999999999999993e-120 < B < 1450Initial program 44.3
Simplified44.0
[Start]44.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 0 50.1
Simplified50.1
[Start]50.1 | \[ -1 \cdot \left(\frac{\sqrt{2}}{B} \cdot \sqrt{\left(A - \sqrt{{B}^{2} + {A}^{2}}\right) \cdot F}\right)
\] |
|---|---|
associate-*r* [=>]50.1 | \[ \color{blue}{\left(-1 \cdot \frac{\sqrt{2}}{B}\right) \cdot \sqrt{\left(A - \sqrt{{B}^{2} + {A}^{2}}\right) \cdot F}}
\] |
associate-*r/ [=>]50.1 | \[ \color{blue}{\frac{-1 \cdot \sqrt{2}}{B}} \cdot \sqrt{\left(A - \sqrt{{B}^{2} + {A}^{2}}\right) \cdot F}
\] |
mul-1-neg [=>]50.1 | \[ \frac{\color{blue}{-\sqrt{2}}}{B} \cdot \sqrt{\left(A - \sqrt{{B}^{2} + {A}^{2}}\right) \cdot F}
\] |
*-commutative [=>]50.1 | \[ \frac{-\sqrt{2}}{B} \cdot \sqrt{\color{blue}{F \cdot \left(A - \sqrt{{B}^{2} + {A}^{2}}\right)}}
\] |
unpow2 [=>]50.1 | \[ \frac{-\sqrt{2}}{B} \cdot \sqrt{F \cdot \left(A - \sqrt{\color{blue}{B \cdot B} + {A}^{2}}\right)}
\] |
unpow2 [=>]50.1 | \[ \frac{-\sqrt{2}}{B} \cdot \sqrt{F \cdot \left(A - \sqrt{B \cdot B + \color{blue}{A \cdot A}}\right)}
\] |
Taylor expanded in A around inf 54.4
Simplified54.4
[Start]54.4 | \[ \frac{-\sqrt{2}}{B} \cdot \sqrt{F \cdot \left(-0.5 \cdot \frac{{B}^{2}}{A}\right)}
\] |
|---|---|
associate-*r/ [=>]54.4 | \[ \frac{-\sqrt{2}}{B} \cdot \sqrt{F \cdot \color{blue}{\frac{-0.5 \cdot {B}^{2}}{A}}}
\] |
unpow2 [=>]54.4 | \[ \frac{-\sqrt{2}}{B} \cdot \sqrt{F \cdot \frac{-0.5 \cdot \color{blue}{\left(B \cdot B\right)}}{A}}
\] |
associate-*r* [=>]54.4 | \[ \frac{-\sqrt{2}}{B} \cdot \sqrt{F \cdot \frac{\color{blue}{\left(-0.5 \cdot B\right) \cdot B}}{A}}
\] |
Applied egg-rr52.1
if 1450 < B Initial program 56.0
Simplified55.9
[Start]56.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 0 53.2
Simplified53.2
[Start]53.2 | \[ -1 \cdot \left(\frac{\sqrt{2}}{B} \cdot \sqrt{\left(A - \sqrt{{B}^{2} + {A}^{2}}\right) \cdot F}\right)
\] |
|---|---|
associate-*r* [=>]53.2 | \[ \color{blue}{\left(-1 \cdot \frac{\sqrt{2}}{B}\right) \cdot \sqrt{\left(A - \sqrt{{B}^{2} + {A}^{2}}\right) \cdot F}}
\] |
associate-*r/ [=>]53.2 | \[ \color{blue}{\frac{-1 \cdot \sqrt{2}}{B}} \cdot \sqrt{\left(A - \sqrt{{B}^{2} + {A}^{2}}\right) \cdot F}
\] |
mul-1-neg [=>]53.2 | \[ \frac{\color{blue}{-\sqrt{2}}}{B} \cdot \sqrt{\left(A - \sqrt{{B}^{2} + {A}^{2}}\right) \cdot F}
\] |
*-commutative [=>]53.2 | \[ \frac{-\sqrt{2}}{B} \cdot \sqrt{\color{blue}{F \cdot \left(A - \sqrt{{B}^{2} + {A}^{2}}\right)}}
\] |
unpow2 [=>]53.2 | \[ \frac{-\sqrt{2}}{B} \cdot \sqrt{F \cdot \left(A - \sqrt{\color{blue}{B \cdot B} + {A}^{2}}\right)}
\] |
unpow2 [=>]53.2 | \[ \frac{-\sqrt{2}}{B} \cdot \sqrt{F \cdot \left(A - \sqrt{B \cdot B + \color{blue}{A \cdot A}}\right)}
\] |
Applied egg-rr36.1
Final simplification42.8
| Alternative 1 | |
|---|---|
| Error | 39.7 |
| Cost | 34252 |
| Alternative 2 | |
|---|---|
| Error | 39.7 |
| Cost | 27916 |
| Alternative 3 | |
|---|---|
| Error | 39.1 |
| Cost | 27852 |
| Alternative 4 | |
|---|---|
| Error | 43.1 |
| Cost | 21084 |
| Alternative 5 | |
|---|---|
| Error | 43.1 |
| Cost | 20888 |
| Alternative 6 | |
|---|---|
| Error | 43.5 |
| Cost | 20828 |
| Alternative 7 | |
|---|---|
| Error | 43.3 |
| Cost | 20756 |
| Alternative 8 | |
|---|---|
| Error | 44.1 |
| Cost | 19972 |
| Alternative 9 | |
|---|---|
| Error | 44.5 |
| Cost | 15368 |
| Alternative 10 | |
|---|---|
| Error | 45.2 |
| Cost | 14684 |
| Alternative 11 | |
|---|---|
| Error | 44.8 |
| Cost | 14552 |
| Alternative 12 | |
|---|---|
| Error | 44.8 |
| Cost | 14552 |
| Alternative 13 | |
|---|---|
| Error | 46.2 |
| Cost | 14224 |
| Alternative 14 | |
|---|---|
| Error | 46.2 |
| Cost | 14224 |
| Alternative 15 | |
|---|---|
| Error | 46.0 |
| Cost | 14092 |
| Alternative 16 | |
|---|---|
| Error | 45.9 |
| Cost | 13704 |
| Alternative 17 | |
|---|---|
| Error | 45.8 |
| Cost | 13640 |
| Alternative 18 | |
|---|---|
| Error | 50.5 |
| Cost | 13380 |
| Alternative 19 | |
|---|---|
| Error | 55.4 |
| Cost | 8584 |
| Alternative 20 | |
|---|---|
| Error | 57.0 |
| Cost | 8452 |
| Alternative 21 | |
|---|---|
| Error | 59.5 |
| Cost | 8320 |
| Alternative 22 | |
|---|---|
| Error | 61.8 |
| Cost | 8064 |
| Alternative 23 | |
|---|---|
| Error | 61.9 |
| Cost | 7808 |
| Alternative 24 | |
|---|---|
| Error | 62.6 |
| Cost | 7680 |
| Alternative 25 | |
|---|---|
| Error | 62.6 |
| Cost | 7680 |
| Alternative 26 | |
|---|---|
| Error | 63.0 |
| Cost | 7296 |
herbie shell --seed 2023018
(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))))