| Alternative 1 | |
|---|---|
| Error | 42.1 |
| 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 (* C (* A -4.0))))
(t_1 (- (pow B 2.0) (* (* 4.0 A) C)))
(t_2 (sqrt (* 2.0 (+ C (+ A (hypot B (- A C)))))))
(t_3
(/
(-
(sqrt
(*
(* 2.0 (* t_1 F))
(+ (+ A C) (sqrt (+ (pow B 2.0) (pow (- A C) 2.0)))))))
t_1))
(t_4 (fma -4.0 (* A C) (* B B))))
(if (<= t_3 -4e-205)
(/ (* t_2 (* (sqrt t_4) (- (sqrt F)))) t_4)
(if (<= t_3 5e-90)
(/
(- (sqrt (* 2.0 (* t_0 (* F (fma 2.0 C (* -0.5 (/ B (/ A B)))))))))
t_0)
(if (<= t_3 INFINITY)
(/ (* t_2 (* (sqrt (* A C)) (- (sqrt (* F -4.0))))) t_4)
(* (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 = fma(B, B, (C * (A * -4.0)));
double t_1 = pow(B, 2.0) - ((4.0 * A) * C);
double t_2 = sqrt((2.0 * (C + (A + hypot(B, (A - C))))));
double t_3 = -sqrt(((2.0 * (t_1 * F)) * ((A + C) + sqrt((pow(B, 2.0) + pow((A - C), 2.0)))))) / t_1;
double t_4 = fma(-4.0, (A * C), (B * B));
double tmp;
if (t_3 <= -4e-205) {
tmp = (t_2 * (sqrt(t_4) * -sqrt(F))) / t_4;
} else if (t_3 <= 5e-90) {
tmp = -sqrt((2.0 * (t_0 * (F * fma(2.0, C, (-0.5 * (B / (A / B)))))))) / t_0;
} else if (t_3 <= ((double) INFINITY)) {
tmp = (t_2 * (sqrt((A * C)) * -sqrt((F * -4.0)))) / t_4;
} 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 = fma(B, B, Float64(C * Float64(A * -4.0))) t_1 = Float64((B ^ 2.0) - Float64(Float64(4.0 * A) * C)) t_2 = sqrt(Float64(2.0 * Float64(C + Float64(A + hypot(B, Float64(A - C)))))) t_3 = Float64(Float64(-sqrt(Float64(Float64(2.0 * Float64(t_1 * F)) * Float64(Float64(A + C) + sqrt(Float64((B ^ 2.0) + (Float64(A - C) ^ 2.0))))))) / t_1) t_4 = fma(-4.0, Float64(A * C), Float64(B * B)) tmp = 0.0 if (t_3 <= -4e-205) tmp = Float64(Float64(t_2 * Float64(sqrt(t_4) * Float64(-sqrt(F)))) / t_4); elseif (t_3 <= 5e-90) tmp = Float64(Float64(-sqrt(Float64(2.0 * Float64(t_0 * Float64(F * fma(2.0, C, Float64(-0.5 * Float64(B / Float64(A / B))))))))) / t_0); elseif (t_3 <= Inf) tmp = Float64(Float64(t_2 * Float64(sqrt(Float64(A * C)) * Float64(-sqrt(Float64(F * -4.0))))) / t_4); 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[(B * B + N[(C * N[(A * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[Power[B, 2.0], $MachinePrecision] - N[(N[(4.0 * A), $MachinePrecision] * C), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(2.0 * N[(C + N[(A + N[Sqrt[B ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[((-N[Sqrt[N[(N[(2.0 * N[(t$95$1 * F), $MachinePrecision]), $MachinePrecision] * N[(N[(A + C), $MachinePrecision] + N[Sqrt[N[(N[Power[B, 2.0], $MachinePrecision] + N[Power[N[(A - C), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$1), $MachinePrecision]}, Block[{t$95$4 = N[(-4.0 * N[(A * C), $MachinePrecision] + N[(B * B), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$3, -4e-205], N[(N[(t$95$2 * N[(N[Sqrt[t$95$4], $MachinePrecision] * (-N[Sqrt[F], $MachinePrecision])), $MachinePrecision]), $MachinePrecision] / t$95$4), $MachinePrecision], If[LessEqual[t$95$3, 5e-90], N[((-N[Sqrt[N[(2.0 * N[(t$95$0 * N[(F * N[(2.0 * C + N[(-0.5 * N[(B / N[(A / B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], If[LessEqual[t$95$3, Infinity], N[(N[(t$95$2 * N[(N[Sqrt[N[(A * C), $MachinePrecision]], $MachinePrecision] * (-N[Sqrt[N[(F * -4.0), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]), $MachinePrecision] / t$95$4), $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 := \mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)\\
t_1 := {B}^{2} - \left(4 \cdot A\right) \cdot C\\
t_2 := \sqrt{2 \cdot \left(C + \left(A + \mathsf{hypot}\left(B, A - C\right)\right)\right)}\\
t_3 := \frac{-\sqrt{\left(2 \cdot \left(t_1 \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{{B}^{2} + {\left(A - C\right)}^{2}}\right)}}{t_1}\\
t_4 := \mathsf{fma}\left(-4, A \cdot C, B \cdot B\right)\\
\mathbf{if}\;t_3 \leq -4 \cdot 10^{-205}:\\
\;\;\;\;\frac{t_2 \cdot \left(\sqrt{t_4} \cdot \left(-\sqrt{F}\right)\right)}{t_4}\\
\mathbf{elif}\;t_3 \leq 5 \cdot 10^{-90}:\\
\;\;\;\;\frac{-\sqrt{2 \cdot \left(t_0 \cdot \left(F \cdot \mathsf{fma}\left(2, C, -0.5 \cdot \frac{B}{\frac{A}{B}}\right)\right)\right)}}{t_0}\\
\mathbf{elif}\;t_3 \leq \infty:\\
\;\;\;\;\frac{t_2 \cdot \left(\sqrt{A \cdot C} \cdot \left(-\sqrt{F \cdot -4}\right)\right)}{t_4}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{2} \cdot \left(-\sqrt{\frac{F}{B}}\right)\\
\end{array}
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))) < -4e-205Initial program 38.2
Simplified31.8
[Start]38.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-rr23.6
Simplified23.6
[Start]23.6 | \[ \frac{-\sqrt{2 \cdot \left(A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)\right)} \cdot \sqrt{\mathsf{fma}\left(-4, A \cdot C, B \cdot B\right) \cdot F}}{\mathsf{fma}\left(-4, A \cdot C, B \cdot B\right)}
\] |
|---|---|
*-commutative [<=]23.6 | \[ \frac{-\color{blue}{\sqrt{\mathsf{fma}\left(-4, A \cdot C, B \cdot B\right) \cdot F} \cdot \sqrt{2 \cdot \left(A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)\right)}}}{\mathsf{fma}\left(-4, A \cdot C, B \cdot B\right)}
\] |
*-commutative [=>]23.6 | \[ \frac{-\sqrt{\color{blue}{F \cdot \mathsf{fma}\left(-4, A \cdot C, B \cdot B\right)}} \cdot \sqrt{2 \cdot \left(A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)\right)}}{\mathsf{fma}\left(-4, A \cdot C, B \cdot B\right)}
\] |
*-commutative [=>]23.6 | \[ \frac{-\sqrt{F \cdot \mathsf{fma}\left(-4, \color{blue}{C \cdot A}, B \cdot B\right)} \cdot \sqrt{2 \cdot \left(A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)\right)}}{\mathsf{fma}\left(-4, A \cdot C, B \cdot B\right)}
\] |
associate-+r+ [=>]24.1 | \[ \frac{-\sqrt{F \cdot \mathsf{fma}\left(-4, C \cdot A, B \cdot B\right)} \cdot \sqrt{2 \cdot \color{blue}{\left(\left(A + C\right) + \mathsf{hypot}\left(B, A - C\right)\right)}}}{\mathsf{fma}\left(-4, A \cdot C, B \cdot B\right)}
\] |
+-commutative [=>]24.1 | \[ \frac{-\sqrt{F \cdot \mathsf{fma}\left(-4, C \cdot A, B \cdot B\right)} \cdot \sqrt{2 \cdot \left(\color{blue}{\left(C + A\right)} + \mathsf{hypot}\left(B, A - C\right)\right)}}{\mathsf{fma}\left(-4, A \cdot C, B \cdot B\right)}
\] |
associate-+l+ [=>]23.6 | \[ \frac{-\sqrt{F \cdot \mathsf{fma}\left(-4, C \cdot A, B \cdot B\right)} \cdot \sqrt{2 \cdot \color{blue}{\left(C + \left(A + \mathsf{hypot}\left(B, A - C\right)\right)\right)}}}{\mathsf{fma}\left(-4, A \cdot C, B \cdot B\right)}
\] |
Applied egg-rr16.3
if -4e-205 < (/.f64 (neg.f64 (sqrt.f64 (*.f64 (*.f64 2 (*.f64 (-.f64 (pow.f64 B 2) (*.f64 (*.f64 4 A) C)) F)) (+.f64 (+.f64 A C) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) 2) (pow.f64 B 2))))))) (-.f64 (pow.f64 B 2) (*.f64 (*.f64 4 A) C))) < 5.00000000000000019e-90Initial program 58.7
Simplified57.0
[Start]58.7 | \[ \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 44.3
Simplified44.3
[Start]44.3 | \[ \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 C + -0.5 \cdot \frac{{B}^{2}}{A}\right)\right)\right)}}{\mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)}
\] |
|---|---|
fma-def [=>]44.3 | \[ \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, C, -0.5 \cdot \frac{{B}^{2}}{A}\right)}\right)\right)}}{\mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)}
\] |
unpow2 [=>]44.3 | \[ \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, C, -0.5 \cdot \frac{\color{blue}{B \cdot B}}{A}\right)\right)\right)}}{\mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)}
\] |
associate-/l* [=>]44.3 | \[ \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, C, -0.5 \cdot \color{blue}{\frac{B}{\frac{A}{B}}}\right)\right)\right)}}{\mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)}
\] |
if 5.00000000000000019e-90 < (/.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.0Initial program 43.2
Simplified27.8
[Start]43.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-rr12.4
Simplified12.4
[Start]12.4 | \[ \frac{-\sqrt{2 \cdot \left(A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)\right)} \cdot \sqrt{\mathsf{fma}\left(-4, A \cdot C, B \cdot B\right) \cdot F}}{\mathsf{fma}\left(-4, A \cdot C, B \cdot B\right)}
\] |
|---|---|
*-commutative [<=]12.4 | \[ \frac{-\color{blue}{\sqrt{\mathsf{fma}\left(-4, A \cdot C, B \cdot B\right) \cdot F} \cdot \sqrt{2 \cdot \left(A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)\right)}}}{\mathsf{fma}\left(-4, A \cdot C, B \cdot B\right)}
\] |
*-commutative [=>]12.4 | \[ \frac{-\sqrt{\color{blue}{F \cdot \mathsf{fma}\left(-4, A \cdot C, B \cdot B\right)}} \cdot \sqrt{2 \cdot \left(A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)\right)}}{\mathsf{fma}\left(-4, A \cdot C, B \cdot B\right)}
\] |
*-commutative [=>]12.4 | \[ \frac{-\sqrt{F \cdot \mathsf{fma}\left(-4, \color{blue}{C \cdot A}, B \cdot B\right)} \cdot \sqrt{2 \cdot \left(A + \left(C + \mathsf{hypot}\left(B, A - C\right)\right)\right)}}{\mathsf{fma}\left(-4, A \cdot C, B \cdot B\right)}
\] |
associate-+r+ [=>]12.4 | \[ \frac{-\sqrt{F \cdot \mathsf{fma}\left(-4, C \cdot A, B \cdot B\right)} \cdot \sqrt{2 \cdot \color{blue}{\left(\left(A + C\right) + \mathsf{hypot}\left(B, A - C\right)\right)}}}{\mathsf{fma}\left(-4, A \cdot C, B \cdot B\right)}
\] |
+-commutative [=>]12.4 | \[ \frac{-\sqrt{F \cdot \mathsf{fma}\left(-4, C \cdot A, B \cdot B\right)} \cdot \sqrt{2 \cdot \left(\color{blue}{\left(C + A\right)} + \mathsf{hypot}\left(B, A - C\right)\right)}}{\mathsf{fma}\left(-4, A \cdot C, B \cdot B\right)}
\] |
associate-+l+ [=>]12.4 | \[ \frac{-\sqrt{F \cdot \mathsf{fma}\left(-4, C \cdot A, B \cdot B\right)} \cdot \sqrt{2 \cdot \color{blue}{\left(C + \left(A + \mathsf{hypot}\left(B, A - C\right)\right)\right)}}}{\mathsf{fma}\left(-4, A \cdot C, B \cdot B\right)}
\] |
Taylor expanded in C around inf 19.5
Simplified12.9
[Start]19.5 | \[ \frac{-\sqrt{-4 \cdot \left(A \cdot \left(C \cdot F\right)\right)} \cdot \sqrt{2 \cdot \left(C + \left(A + \mathsf{hypot}\left(B, A - C\right)\right)\right)}}{\mathsf{fma}\left(-4, A \cdot C, B \cdot B\right)}
\] |
|---|---|
associate-*r* [=>]12.9 | \[ \frac{-\sqrt{-4 \cdot \color{blue}{\left(\left(A \cdot C\right) \cdot F\right)}} \cdot \sqrt{2 \cdot \left(C + \left(A + \mathsf{hypot}\left(B, A - C\right)\right)\right)}}{\mathsf{fma}\left(-4, A \cdot C, B \cdot B\right)}
\] |
associate-*l* [<=]12.9 | \[ \frac{-\sqrt{\color{blue}{\left(-4 \cdot \left(A \cdot C\right)\right) \cdot F}} \cdot \sqrt{2 \cdot \left(C + \left(A + \mathsf{hypot}\left(B, A - C\right)\right)\right)}}{\mathsf{fma}\left(-4, A \cdot C, B \cdot B\right)}
\] |
*-commutative [<=]12.9 | \[ \frac{-\sqrt{\left(-4 \cdot \color{blue}{\left(C \cdot A\right)}\right) \cdot F} \cdot \sqrt{2 \cdot \left(C + \left(A + \mathsf{hypot}\left(B, A - C\right)\right)\right)}}{\mathsf{fma}\left(-4, A \cdot C, B \cdot B\right)}
\] |
*-commutative [<=]12.9 | \[ \frac{-\sqrt{\color{blue}{F \cdot \left(-4 \cdot \left(C \cdot A\right)\right)}} \cdot \sqrt{2 \cdot \left(C + \left(A + \mathsf{hypot}\left(B, A - C\right)\right)\right)}}{\mathsf{fma}\left(-4, A \cdot C, B \cdot B\right)}
\] |
*-commutative [=>]12.9 | \[ \frac{-\sqrt{F \cdot \left(-4 \cdot \color{blue}{\left(A \cdot C\right)}\right)} \cdot \sqrt{2 \cdot \left(C + \left(A + \mathsf{hypot}\left(B, A - C\right)\right)\right)}}{\mathsf{fma}\left(-4, A \cdot C, B \cdot B\right)}
\] |
Applied egg-rr7.3
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))) Initial program 64.0
Simplified64.0
[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}
\] |
|---|
Applied egg-rr64.0
Taylor expanded in A around 0 63.9
Simplified63.9
[Start]63.9 | \[ -1 \cdot \left(\frac{\sqrt{2}}{{B}^{2}} \cdot \sqrt{\left(F \cdot {B}^{2}\right) \cdot \sqrt{{B}^{2} + {C}^{2}} + C \cdot \left(F \cdot {B}^{2}\right)}\right)
\] |
|---|---|
associate-*r* [=>]63.9 | \[ \color{blue}{\left(-1 \cdot \frac{\sqrt{2}}{{B}^{2}}\right) \cdot \sqrt{\left(F \cdot {B}^{2}\right) \cdot \sqrt{{B}^{2} + {C}^{2}} + C \cdot \left(F \cdot {B}^{2}\right)}}
\] |
associate-*r/ [=>]63.9 | \[ \color{blue}{\frac{-1 \cdot \sqrt{2}}{{B}^{2}}} \cdot \sqrt{\left(F \cdot {B}^{2}\right) \cdot \sqrt{{B}^{2} + {C}^{2}} + C \cdot \left(F \cdot {B}^{2}\right)}
\] |
mul-1-neg [=>]63.9 | \[ \frac{\color{blue}{-\sqrt{2}}}{{B}^{2}} \cdot \sqrt{\left(F \cdot {B}^{2}\right) \cdot \sqrt{{B}^{2} + {C}^{2}} + C \cdot \left(F \cdot {B}^{2}\right)}
\] |
unpow2 [=>]63.9 | \[ \frac{-\sqrt{2}}{\color{blue}{B \cdot B}} \cdot \sqrt{\left(F \cdot {B}^{2}\right) \cdot \sqrt{{B}^{2} + {C}^{2}} + C \cdot \left(F \cdot {B}^{2}\right)}
\] |
fma-def [=>]63.9 | \[ \frac{-\sqrt{2}}{B \cdot B} \cdot \sqrt{\color{blue}{\mathsf{fma}\left(F \cdot {B}^{2}, \sqrt{{B}^{2} + {C}^{2}}, C \cdot \left(F \cdot {B}^{2}\right)\right)}}
\] |
unpow2 [=>]63.9 | \[ \frac{-\sqrt{2}}{B \cdot B} \cdot \sqrt{\mathsf{fma}\left(F \cdot \color{blue}{\left(B \cdot B\right)}, \sqrt{{B}^{2} + {C}^{2}}, C \cdot \left(F \cdot {B}^{2}\right)\right)}
\] |
unpow2 [=>]63.9 | \[ \frac{-\sqrt{2}}{B \cdot B} \cdot \sqrt{\mathsf{fma}\left(F \cdot \left(B \cdot B\right), \sqrt{\color{blue}{B \cdot B} + {C}^{2}}, C \cdot \left(F \cdot {B}^{2}\right)\right)}
\] |
unpow2 [=>]63.9 | \[ \frac{-\sqrt{2}}{B \cdot B} \cdot \sqrt{\mathsf{fma}\left(F \cdot \left(B \cdot B\right), \sqrt{B \cdot B + \color{blue}{C \cdot C}}, C \cdot \left(F \cdot {B}^{2}\right)\right)}
\] |
*-commutative [=>]63.9 | \[ \frac{-\sqrt{2}}{B \cdot B} \cdot \sqrt{\mathsf{fma}\left(F \cdot \left(B \cdot B\right), \sqrt{B \cdot B + C \cdot C}, \color{blue}{\left(F \cdot {B}^{2}\right) \cdot C}\right)}
\] |
unpow2 [=>]63.9 | \[ \frac{-\sqrt{2}}{B \cdot B} \cdot \sqrt{\mathsf{fma}\left(F \cdot \left(B \cdot B\right), \sqrt{B \cdot B + C \cdot C}, \left(F \cdot \color{blue}{\left(B \cdot B\right)}\right) \cdot C\right)}
\] |
Taylor expanded in C around 0 53.4
Simplified53.4
[Start]53.4 | \[ -1 \cdot \left(\sqrt{2} \cdot \sqrt{\frac{F}{B}}\right)
\] |
|---|---|
mul-1-neg [=>]53.4 | \[ \color{blue}{-\sqrt{2} \cdot \sqrt{\frac{F}{B}}}
\] |
distribute-rgt-neg-in [=>]53.4 | \[ \color{blue}{\sqrt{2} \cdot \left(-\sqrt{\frac{F}{B}}\right)}
\] |
Final simplification35.6
| Alternative 1 | |
|---|---|
| Error | 42.1 |
| Cost | 34252 |
| Alternative 2 | |
|---|---|
| Error | 42.1 |
| Cost | 34252 |
| Alternative 3 | |
|---|---|
| Error | 44.9 |
| Cost | 28048 |
| Alternative 4 | |
|---|---|
| Error | 46.5 |
| Cost | 27732 |
| Alternative 5 | |
|---|---|
| Error | 44.6 |
| Cost | 27732 |
| Alternative 6 | |
|---|---|
| Error | 44.9 |
| Cost | 27732 |
| Alternative 7 | |
|---|---|
| Error | 47.3 |
| Cost | 21700 |
| Alternative 8 | |
|---|---|
| Error | 47.6 |
| Cost | 21264 |
| Alternative 9 | |
|---|---|
| Error | 47.3 |
| Cost | 21132 |
| Alternative 10 | |
|---|---|
| Error | 47.3 |
| Cost | 20300 |
| Alternative 11 | |
|---|---|
| Error | 49.0 |
| Cost | 14532 |
| Alternative 12 | |
|---|---|
| Error | 49.9 |
| Cost | 13448 |
| Alternative 13 | |
|---|---|
| Error | 51.5 |
| Cost | 8584 |
| Alternative 14 | |
|---|---|
| Error | 53.2 |
| Cost | 7748 |
| Alternative 15 | |
|---|---|
| Error | 55.6 |
| Cost | 7684 |
| Alternative 16 | |
|---|---|
| Error | 58.4 |
| Cost | 7552 |
| Alternative 17 | |
|---|---|
| Error | 62.9 |
| Cost | 7296 |
| Alternative 18 | |
|---|---|
| Error | 61.9 |
| Cost | 6848 |
herbie shell --seed 2023031
(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))))