| Alternative 1 | |
|---|---|
| Accuracy | 37.0% |
| Cost | 27984 |
(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 (hypot B (- A C)))
(t_2 (sqrt (* (+ C (- A t_1)) (* 2.0 F)))))
(if (<= B -2.15e-123)
(/ t_2 (+ B (* -4.0 (/ (* C A) B))))
(if (<= B 2.7e-174)
(/ (* (sqrt (* A -8.0)) (- (sqrt (* F (* C (+ A A)))))) t_0)
(if (<= B 1.32e-69)
(* C (/ (sqrt (* A (* F -16.0))) (fma B B (* C (* A -4.0)))))
(if (<= B 2.5e+39)
(/ (- (sqrt (* t_0 (* (* 2.0 F) (+ A (- C t_1)))))) t_0)
(/ t_2 (- 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 = hypot(B, (A - C));
double t_2 = sqrt(((C + (A - t_1)) * (2.0 * F)));
double tmp;
if (B <= -2.15e-123) {
tmp = t_2 / (B + (-4.0 * ((C * A) / B)));
} else if (B <= 2.7e-174) {
tmp = (sqrt((A * -8.0)) * -sqrt((F * (C * (A + A))))) / t_0;
} else if (B <= 1.32e-69) {
tmp = C * (sqrt((A * (F * -16.0))) / fma(B, B, (C * (A * -4.0))));
} else if (B <= 2.5e+39) {
tmp = -sqrt((t_0 * ((2.0 * F) * (A + (C - t_1))))) / t_0;
} else {
tmp = t_2 / -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 = hypot(B, Float64(A - C)) t_2 = sqrt(Float64(Float64(C + Float64(A - t_1)) * Float64(2.0 * F))) tmp = 0.0 if (B <= -2.15e-123) tmp = Float64(t_2 / Float64(B + Float64(-4.0 * Float64(Float64(C * A) / B)))); elseif (B <= 2.7e-174) tmp = Float64(Float64(sqrt(Float64(A * -8.0)) * Float64(-sqrt(Float64(F * Float64(C * Float64(A + A)))))) / t_0); elseif (B <= 1.32e-69) tmp = Float64(C * Float64(sqrt(Float64(A * Float64(F * -16.0))) / fma(B, B, Float64(C * Float64(A * -4.0))))); elseif (B <= 2.5e+39) tmp = Float64(Float64(-sqrt(Float64(t_0 * Float64(Float64(2.0 * F) * Float64(A + Float64(C - t_1)))))) / t_0); else tmp = Float64(t_2 / Float64(-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[Sqrt[B ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(N[(C + N[(A - t$95$1), $MachinePrecision]), $MachinePrecision] * N[(2.0 * F), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[B, -2.15e-123], N[(t$95$2 / N[(B + N[(-4.0 * N[(N[(C * A), $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, 2.7e-174], N[(N[(N[Sqrt[N[(A * -8.0), $MachinePrecision]], $MachinePrecision] * (-N[Sqrt[N[(F * N[(C * N[(A + A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision] / t$95$0), $MachinePrecision], If[LessEqual[B, 1.32e-69], 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, 2.5e+39], N[((-N[Sqrt[N[(t$95$0 * N[(N[(2.0 * F), $MachinePrecision] * N[(A + N[(C - t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], N[(t$95$2 / (-B)), $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 := \mathsf{hypot}\left(B, A - C\right)\\
t_2 := \sqrt{\left(C + \left(A - t_1\right)\right) \cdot \left(2 \cdot F\right)}\\
\mathbf{if}\;B \leq -2.15 \cdot 10^{-123}:\\
\;\;\;\;\frac{t_2}{B + -4 \cdot \frac{C \cdot A}{B}}\\
\mathbf{elif}\;B \leq 2.7 \cdot 10^{-174}:\\
\;\;\;\;\frac{\sqrt{A \cdot -8} \cdot \left(-\sqrt{F \cdot \left(C \cdot \left(A + A\right)\right)}\right)}{t_0}\\
\mathbf{elif}\;B \leq 1.32 \cdot 10^{-69}:\\
\;\;\;\;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 2.5 \cdot 10^{+39}:\\
\;\;\;\;\frac{-\sqrt{t_0 \cdot \left(\left(2 \cdot F\right) \cdot \left(A + \left(C - t_1\right)\right)\right)}}{t_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{t_2}{-B}\\
\end{array}
if B < -2.15000000000000016e-123Initial program 18.6%
Simplified23.3%
[Start]18.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}
\] |
|---|
Applied egg-rr1.3%
[Start]23.3 | \[ \frac{-\sqrt{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right) \cdot \left(\left(A + \left(C - \mathsf{hypot}\left(B, A - C\right)\right)\right) \cdot \left(2 \cdot F\right)\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}
\] |
|---|---|
add-sqr-sqrt [=>]0.6 | \[ \frac{\color{blue}{\sqrt{-\sqrt{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right) \cdot \left(\left(A + \left(C - \mathsf{hypot}\left(B, A - C\right)\right)\right) \cdot \left(2 \cdot F\right)\right)}} \cdot \sqrt{-\sqrt{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right) \cdot \left(\left(A + \left(C - \mathsf{hypot}\left(B, A - C\right)\right)\right) \cdot \left(2 \cdot F\right)\right)}}}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}
\] |
Simplified1.3%
[Start]1.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)}
\] |
|---|---|
associate-*r/ [=>]1.1 | \[ \color{blue}{\frac{\frac{\mathsf{hypot}\left(B, \sqrt{A \cdot \left(C \cdot -4\right)}\right)}{1} \cdot \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 [=>]1.1 | \[ \frac{\color{blue}{\mathsf{hypot}\left(B, \sqrt{A \cdot \left(C \cdot -4\right)}\right)} \cdot \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)}
\] |
*-commutative [<=]1.1 | \[ \frac{\color{blue}{\sqrt{\left(\left(A + C\right) - \mathsf{hypot}\left(B, A - C\right)\right) \cdot \left(2 \cdot F\right)} \cdot \mathsf{hypot}\left(B, \sqrt{A \cdot \left(C \cdot -4\right)}\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}
\] |
associate-/l* [=>]1.3 | \[ \color{blue}{\frac{\sqrt{\left(\left(A + C\right) - \mathsf{hypot}\left(B, A - C\right)\right) \cdot \left(2 \cdot F\right)}}{\frac{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}{\mathsf{hypot}\left(B, \sqrt{A \cdot \left(C \cdot -4\right)}\right)}}}
\] |
+-commutative [=>]1.3 | \[ \frac{\sqrt{\left(\color{blue}{\left(C + A\right)} - \mathsf{hypot}\left(B, A - C\right)\right) \cdot \left(2 \cdot F\right)}}{\frac{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}{\mathsf{hypot}\left(B, \sqrt{A \cdot \left(C \cdot -4\right)}\right)}}
\] |
associate--l+ [=>]1.3 | \[ \frac{\sqrt{\color{blue}{\left(C + \left(A - \mathsf{hypot}\left(B, A - C\right)\right)\right)} \cdot \left(2 \cdot F\right)}}{\frac{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}{\mathsf{hypot}\left(B, \sqrt{A \cdot \left(C \cdot -4\right)}\right)}}
\] |
associate-*r* [=>]1.3 | \[ \frac{\sqrt{\left(C + \left(A - \mathsf{hypot}\left(B, A - C\right)\right)\right) \cdot \left(2 \cdot F\right)}}{\frac{\mathsf{fma}\left(B, B, \color{blue}{\left(A \cdot C\right) \cdot -4}\right)}{\mathsf{hypot}\left(B, \sqrt{A \cdot \left(C \cdot -4\right)}\right)}}
\] |
associate-*r* [=>]1.3 | \[ \frac{\sqrt{\left(C + \left(A - \mathsf{hypot}\left(B, A - C\right)\right)\right) \cdot \left(2 \cdot F\right)}}{\frac{\mathsf{fma}\left(B, B, \left(A \cdot C\right) \cdot -4\right)}{\mathsf{hypot}\left(B, \sqrt{\color{blue}{\left(A \cdot C\right) \cdot -4}}\right)}}
\] |
Taylor expanded in A around 0 41.3%
if -2.15000000000000016e-123 < B < 2.69999999999999988e-174Initial program 17.5%
Simplified27.4%
[Start]17.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}
\] |
|---|
Taylor expanded in C around inf 20.3%
Simplified20.4%
[Start]20.3 | \[ \frac{-\sqrt{-8 \cdot \left(A \cdot \left(\left(A - -1 \cdot A\right) \cdot \left(C \cdot F\right)\right)\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}
\] |
|---|---|
associate-*r* [=>]20.4 | \[ \frac{-\sqrt{\color{blue}{\left(-8 \cdot A\right) \cdot \left(\left(A - -1 \cdot A\right) \cdot \left(C \cdot F\right)\right)}}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}
\] |
*-commutative [=>]20.4 | \[ \frac{-\sqrt{\left(-8 \cdot A\right) \cdot \color{blue}{\left(\left(C \cdot F\right) \cdot \left(A - -1 \cdot A\right)\right)}}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}
\] |
*-commutative [=>]20.4 | \[ \frac{-\sqrt{\left(-8 \cdot A\right) \cdot \left(\color{blue}{\left(F \cdot C\right)} \cdot \left(A - -1 \cdot A\right)\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}
\] |
mul-1-neg [=>]20.4 | \[ \frac{-\sqrt{\left(-8 \cdot A\right) \cdot \left(\left(F \cdot C\right) \cdot \left(A - \color{blue}{\left(-A\right)}\right)\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}
\] |
Applied egg-rr22.1%
[Start]20.4 | \[ \frac{-\sqrt{\left(-8 \cdot A\right) \cdot \left(\left(F \cdot C\right) \cdot \left(A - \left(-A\right)\right)\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}
\] |
|---|---|
sqrt-prod [=>]19.1 | \[ \frac{-\color{blue}{\sqrt{-8 \cdot A} \cdot \sqrt{\left(F \cdot C\right) \cdot \left(A - \left(-A\right)\right)}}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}
\] |
*-commutative [=>]19.1 | \[ \frac{-\color{blue}{\sqrt{\left(F \cdot C\right) \cdot \left(A - \left(-A\right)\right)} \cdot \sqrt{-8 \cdot A}}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}
\] |
associate-*l* [=>]22.1 | \[ \frac{-\sqrt{\color{blue}{F \cdot \left(C \cdot \left(A - \left(-A\right)\right)\right)}} \cdot \sqrt{-8 \cdot A}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}
\] |
neg-mul-1 [=>]22.1 | \[ \frac{-\sqrt{F \cdot \left(C \cdot \left(A - \color{blue}{-1 \cdot A}\right)\right)} \cdot \sqrt{-8 \cdot A}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}
\] |
cancel-sign-sub-inv [=>]22.1 | \[ \frac{-\sqrt{F \cdot \left(C \cdot \color{blue}{\left(A + \left(--1\right) \cdot A\right)}\right)} \cdot \sqrt{-8 \cdot A}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}
\] |
metadata-eval [=>]22.1 | \[ \frac{-\sqrt{F \cdot \left(C \cdot \left(A + \color{blue}{1} \cdot A\right)\right)} \cdot \sqrt{-8 \cdot A}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}
\] |
*-un-lft-identity [<=]22.1 | \[ \frac{-\sqrt{F \cdot \left(C \cdot \left(A + \color{blue}{A}\right)\right)} \cdot \sqrt{-8 \cdot A}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}
\] |
Simplified22.1%
[Start]22.1 | \[ \frac{-\sqrt{F \cdot \left(C \cdot \left(A + A\right)\right)} \cdot \sqrt{-8 \cdot A}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}
\] |
|---|---|
*-commutative [=>]22.1 | \[ \frac{-\sqrt{F \cdot \left(C \cdot \left(A + A\right)\right)} \cdot \sqrt{\color{blue}{A \cdot -8}}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}
\] |
if 2.69999999999999988e-174 < B < 1.32000000000000007e-69Initial program 21.5%
Simplified29.1%
[Start]21.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}
\] |
|---|
Taylor expanded in B around 0 14.6%
Simplified14.6%
[Start]14.6 | \[ \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* [=>]14.6 | \[ \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 [=>]14.6 | \[ \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 [=>]14.6 | \[ \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-rr23.2%
[Start]14.6 | \[ \frac{-\sqrt{\left(-16 \cdot A\right) \cdot \left(F \cdot \left(C \cdot C\right)\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}
\] |
|---|---|
distribute-frac-neg [=>]14.6 | \[ \color{blue}{-\frac{\sqrt{\left(-16 \cdot A\right) \cdot \left(F \cdot \left(C \cdot C\right)\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}}
\] |
neg-sub0 [=>]14.6 | \[ \color{blue}{0 - \frac{\sqrt{\left(-16 \cdot A\right) \cdot \left(F \cdot \left(C \cdot C\right)\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}}
\] |
add-sqr-sqrt [=>]14.6 | \[ 0 - \frac{\sqrt{\color{blue}{\sqrt{\left(-16 \cdot A\right) \cdot \left(F \cdot \left(C \cdot C\right)\right)} \cdot \sqrt{\left(-16 \cdot A\right) \cdot \left(F \cdot \left(C \cdot C\right)\right)}}}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}
\] |
sqr-neg [<=]14.6 | \[ 0 - \frac{\sqrt{\color{blue}{\left(-\sqrt{\left(-16 \cdot A\right) \cdot \left(F \cdot \left(C \cdot C\right)\right)}\right) \cdot \left(-\sqrt{\left(-16 \cdot A\right) \cdot \left(F \cdot \left(C \cdot C\right)\right)}\right)}}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}
\] |
sqrt-unprod [<=]1.0 | \[ 0 - \frac{\color{blue}{\sqrt{-\sqrt{\left(-16 \cdot A\right) \cdot \left(F \cdot \left(C \cdot C\right)\right)}} \cdot \sqrt{-\sqrt{\left(-16 \cdot A\right) \cdot \left(F \cdot \left(C \cdot C\right)\right)}}}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}
\] |
add-sqr-sqrt [<=]1.4 | \[ 0 - \frac{\color{blue}{-\sqrt{\left(-16 \cdot A\right) \cdot \left(F \cdot \left(C \cdot C\right)\right)}}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}
\] |
distribute-frac-neg [=>]1.4 | \[ 0 - \color{blue}{\left(-\frac{\sqrt{\left(-16 \cdot A\right) \cdot \left(F \cdot \left(C \cdot C\right)\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}\right)}
\] |
neg-sub0 [=>]1.4 | \[ 0 - \color{blue}{\left(0 - \frac{\sqrt{\left(-16 \cdot A\right) \cdot \left(F \cdot \left(C \cdot C\right)\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}\right)}
\] |
Simplified23.5%
[Start]23.2 | \[ 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 [=>]23.2 | \[ \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* [=>]24.6 | \[ \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/ [=>]23.5 | \[ \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 [<=]23.5 | \[ \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/ [<=]23.5 | \[ \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 [=>]23.5 | \[ \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/ [=>]23.5 | \[ 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 [=>]23.5 | \[ 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* [=>]23.5 | \[ 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 [=>]23.5 | \[ 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* [=>]23.5 | \[ 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 [=>]23.5 | \[ 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* [=>]23.5 | \[ 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.32000000000000007e-69 < B < 2.50000000000000008e39Initial program 35.1%
Simplified42.5%
[Start]35.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}
\] |
|---|
if 2.50000000000000008e39 < B Initial program 10.5%
Simplified12.5%
[Start]10.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-rr1.5%
[Start]12.5 | \[ \frac{-\sqrt{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right) \cdot \left(\left(A + \left(C - \mathsf{hypot}\left(B, A - C\right)\right)\right) \cdot \left(2 \cdot F\right)\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}
\] |
|---|---|
add-sqr-sqrt [=>]0.2 | \[ \frac{\color{blue}{\sqrt{-\sqrt{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right) \cdot \left(\left(A + \left(C - \mathsf{hypot}\left(B, A - C\right)\right)\right) \cdot \left(2 \cdot F\right)\right)}} \cdot \sqrt{-\sqrt{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right) \cdot \left(\left(A + \left(C - \mathsf{hypot}\left(B, A - C\right)\right)\right) \cdot \left(2 \cdot F\right)\right)}}}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}
\] |
Simplified1.4%
[Start]1.5 | \[ \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)}
\] |
|---|---|
associate-*r/ [=>]1.1 | \[ \color{blue}{\frac{\frac{\mathsf{hypot}\left(B, \sqrt{A \cdot \left(C \cdot -4\right)}\right)}{1} \cdot \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 [=>]1.1 | \[ \frac{\color{blue}{\mathsf{hypot}\left(B, \sqrt{A \cdot \left(C \cdot -4\right)}\right)} \cdot \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)}
\] |
*-commutative [<=]1.1 | \[ \frac{\color{blue}{\sqrt{\left(\left(A + C\right) - \mathsf{hypot}\left(B, A - C\right)\right) \cdot \left(2 \cdot F\right)} \cdot \mathsf{hypot}\left(B, \sqrt{A \cdot \left(C \cdot -4\right)}\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}
\] |
associate-/l* [=>]1.4 | \[ \color{blue}{\frac{\sqrt{\left(\left(A + C\right) - \mathsf{hypot}\left(B, A - C\right)\right) \cdot \left(2 \cdot F\right)}}{\frac{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}{\mathsf{hypot}\left(B, \sqrt{A \cdot \left(C \cdot -4\right)}\right)}}}
\] |
+-commutative [=>]1.4 | \[ \frac{\sqrt{\left(\color{blue}{\left(C + A\right)} - \mathsf{hypot}\left(B, A - C\right)\right) \cdot \left(2 \cdot F\right)}}{\frac{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}{\mathsf{hypot}\left(B, \sqrt{A \cdot \left(C \cdot -4\right)}\right)}}
\] |
associate--l+ [=>]1.4 | \[ \frac{\sqrt{\color{blue}{\left(C + \left(A - \mathsf{hypot}\left(B, A - C\right)\right)\right)} \cdot \left(2 \cdot F\right)}}{\frac{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}{\mathsf{hypot}\left(B, \sqrt{A \cdot \left(C \cdot -4\right)}\right)}}
\] |
associate-*r* [=>]1.4 | \[ \frac{\sqrt{\left(C + \left(A - \mathsf{hypot}\left(B, A - C\right)\right)\right) \cdot \left(2 \cdot F\right)}}{\frac{\mathsf{fma}\left(B, B, \color{blue}{\left(A \cdot C\right) \cdot -4}\right)}{\mathsf{hypot}\left(B, \sqrt{A \cdot \left(C \cdot -4\right)}\right)}}
\] |
associate-*r* [=>]1.4 | \[ \frac{\sqrt{\left(C + \left(A - \mathsf{hypot}\left(B, A - C\right)\right)\right) \cdot \left(2 \cdot F\right)}}{\frac{\mathsf{fma}\left(B, B, \left(A \cdot C\right) \cdot -4\right)}{\mathsf{hypot}\left(B, \sqrt{\color{blue}{\left(A \cdot C\right) \cdot -4}}\right)}}
\] |
Taylor expanded in B around -inf 51.7%
Simplified51.7%
[Start]51.7 | \[ \frac{\sqrt{\left(C + \left(A - \mathsf{hypot}\left(B, A - C\right)\right)\right) \cdot \left(2 \cdot F\right)}}{-1 \cdot B}
\] |
|---|---|
mul-1-neg [=>]51.7 | \[ \frac{\sqrt{\left(C + \left(A - \mathsf{hypot}\left(B, A - C\right)\right)\right) \cdot \left(2 \cdot F\right)}}{\color{blue}{-B}}
\] |
Final simplification37.0%
| Alternative 1 | |
|---|---|
| Accuracy | 37.0% |
| Cost | 27984 |
| Alternative 2 | |
|---|---|
| Accuracy | 35.1% |
| Cost | 21008 |
| Alternative 3 | |
|---|---|
| Accuracy | 24.5% |
| Cost | 14356 |
| Alternative 4 | |
|---|---|
| Accuracy | 35.4% |
| Cost | 14340 |
| Alternative 5 | |
|---|---|
| Accuracy | 35.7% |
| Cost | 14024 |
| Alternative 6 | |
|---|---|
| Accuracy | 26.1% |
| Cost | 13828 |
| Alternative 7 | |
|---|---|
| Accuracy | 22.5% |
| Cost | 13580 |
| Alternative 8 | |
|---|---|
| Accuracy | 19.2% |
| Cost | 8716 |
| Alternative 9 | |
|---|---|
| Accuracy | 19.8% |
| Cost | 8584 |
| Alternative 10 | |
|---|---|
| Accuracy | 17.7% |
| Cost | 8584 |
| Alternative 11 | |
|---|---|
| Accuracy | 18.3% |
| Cost | 7812 |
| Alternative 12 | |
|---|---|
| Accuracy | 18.3% |
| Cost | 7684 |
| Alternative 13 | |
|---|---|
| Accuracy | 13.9% |
| Cost | 7360 |
| Alternative 14 | |
|---|---|
| Accuracy | 2.5% |
| Cost | 6848 |
| Alternative 15 | |
|---|---|
| Accuracy | 1.2% |
| Cost | 6720 |
herbie shell --seed 2023135
(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))))