
(FPCore (A B C F)
:precision binary64
(let* ((t_0 (- (pow B 2.0) (* (* 4.0 A) C))))
(/
(-
(sqrt
(*
(* 2.0 (* t_0 F))
(+ (+ A C) (sqrt (+ (pow (- A C) 2.0) (pow B 2.0)))))))
t_0)))
double code(double A, double B, double C, double F) {
double t_0 = pow(B, 2.0) - ((4.0 * A) * C);
return -sqrt(((2.0 * (t_0 * F)) * ((A + C) + sqrt((pow((A - C), 2.0) + pow(B, 2.0)))))) / t_0;
}
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
t_0 = (b ** 2.0d0) - ((4.0d0 * a) * c)
code = -sqrt(((2.0d0 * (t_0 * f)) * ((a + c) + sqrt((((a - c) ** 2.0d0) + (b ** 2.0d0)))))) / t_0
end function
public static double code(double A, double B, double C, double F) {
double t_0 = Math.pow(B, 2.0) - ((4.0 * A) * C);
return -Math.sqrt(((2.0 * (t_0 * F)) * ((A + C) + Math.sqrt((Math.pow((A - C), 2.0) + Math.pow(B, 2.0)))))) / t_0;
}
def code(A, B, C, F): t_0 = math.pow(B, 2.0) - ((4.0 * A) * C) return -math.sqrt(((2.0 * (t_0 * F)) * ((A + C) + math.sqrt((math.pow((A - C), 2.0) + math.pow(B, 2.0)))))) / t_0
function code(A, B, C, F) t_0 = Float64((B ^ 2.0) - Float64(Float64(4.0 * A) * C)) return Float64(Float64(-sqrt(Float64(Float64(2.0 * Float64(t_0 * F)) * Float64(Float64(A + C) + sqrt(Float64((Float64(A - C) ^ 2.0) + (B ^ 2.0))))))) / t_0) end
function tmp = code(A, B, C, F) t_0 = (B ^ 2.0) - ((4.0 * A) * C); tmp = -sqrt(((2.0 * (t_0 * F)) * ((A + C) + sqrt((((A - C) ^ 2.0) + (B ^ 2.0)))))) / t_0; end
code[A_, B_, C_, F_] := Block[{t$95$0 = N[(N[Power[B, 2.0], $MachinePrecision] - N[(N[(4.0 * A), $MachinePrecision] * C), $MachinePrecision]), $MachinePrecision]}, N[((-N[Sqrt[N[(N[(2.0 * N[(t$95$0 * 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]) / t$95$0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {B}^{2} - \left(4 \cdot A\right) \cdot C\\
\frac{-\sqrt{\left(2 \cdot \left(t\_0 \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{t\_0}
\end{array}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 15 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (A B C F)
:precision binary64
(let* ((t_0 (- (pow B 2.0) (* (* 4.0 A) C))))
(/
(-
(sqrt
(*
(* 2.0 (* t_0 F))
(+ (+ A C) (sqrt (+ (pow (- A C) 2.0) (pow B 2.0)))))))
t_0)))
double code(double A, double B, double C, double F) {
double t_0 = pow(B, 2.0) - ((4.0 * A) * C);
return -sqrt(((2.0 * (t_0 * F)) * ((A + C) + sqrt((pow((A - C), 2.0) + pow(B, 2.0)))))) / t_0;
}
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
t_0 = (b ** 2.0d0) - ((4.0d0 * a) * c)
code = -sqrt(((2.0d0 * (t_0 * f)) * ((a + c) + sqrt((((a - c) ** 2.0d0) + (b ** 2.0d0)))))) / t_0
end function
public static double code(double A, double B, double C, double F) {
double t_0 = Math.pow(B, 2.0) - ((4.0 * A) * C);
return -Math.sqrt(((2.0 * (t_0 * F)) * ((A + C) + Math.sqrt((Math.pow((A - C), 2.0) + Math.pow(B, 2.0)))))) / t_0;
}
def code(A, B, C, F): t_0 = math.pow(B, 2.0) - ((4.0 * A) * C) return -math.sqrt(((2.0 * (t_0 * F)) * ((A + C) + math.sqrt((math.pow((A - C), 2.0) + math.pow(B, 2.0)))))) / t_0
function code(A, B, C, F) t_0 = Float64((B ^ 2.0) - Float64(Float64(4.0 * A) * C)) return Float64(Float64(-sqrt(Float64(Float64(2.0 * Float64(t_0 * F)) * Float64(Float64(A + C) + sqrt(Float64((Float64(A - C) ^ 2.0) + (B ^ 2.0))))))) / t_0) end
function tmp = code(A, B, C, F) t_0 = (B ^ 2.0) - ((4.0 * A) * C); tmp = -sqrt(((2.0 * (t_0 * F)) * ((A + C) + sqrt((((A - C) ^ 2.0) + (B ^ 2.0)))))) / t_0; end
code[A_, B_, C_, F_] := Block[{t$95$0 = N[(N[Power[B, 2.0], $MachinePrecision] - N[(N[(4.0 * A), $MachinePrecision] * C), $MachinePrecision]), $MachinePrecision]}, N[((-N[Sqrt[N[(N[(2.0 * N[(t$95$0 * 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]) / t$95$0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {B}^{2} - \left(4 \cdot A\right) \cdot C\\
\frac{-\sqrt{\left(2 \cdot \left(t\_0 \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{t\_0}
\end{array}
\end{array}
B_m = (fabs.f64 B)
(FPCore (A B_m C F)
:precision binary64
(let* ((t_0 (pow (+ (+ A C) (hypot (- A C) B_m)) 0.25))
(t_1 (fma B_m B_m (* A (* C -4.0))))
(t_2 (- (pow B_m 2.0) (* (* 4.0 A) C)))
(t_3 (* 2.0 (* t_2 F)))
(t_4
(/
(-
(sqrt
(* t_3 (+ (+ A C) (sqrt (+ (pow (- A C) 2.0) (pow B_m 2.0)))))))
t_2)))
(if (<= t_4 -5e-207)
(/ (- (pow (* t_0 (* (pow (* t_1 2.0) 0.25) (pow F 0.25))) 2.0)) t_1)
(if (<= t_4 1e-35)
(/ (- (sqrt (* t_3 (+ (* -0.5 (/ (pow B_m 2.0) C)) (* 2.0 A))))) t_2)
(if (<= t_4 INFINITY)
(/
(-
(pow
(*
t_0
(exp
(*
0.25
(+
(log (* -2.0 (+ (* -4.0 (* A C)) (pow B_m 2.0))))
(* -1.0 (log (/ -1.0 F)))))))
2.0))
t_1)
(- (* (sqrt (/ F B_m)) (sqrt 2.0))))))))B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
double t_0 = pow(((A + C) + hypot((A - C), B_m)), 0.25);
double t_1 = fma(B_m, B_m, (A * (C * -4.0)));
double t_2 = pow(B_m, 2.0) - ((4.0 * A) * C);
double t_3 = 2.0 * (t_2 * F);
double t_4 = -sqrt((t_3 * ((A + C) + sqrt((pow((A - C), 2.0) + pow(B_m, 2.0)))))) / t_2;
double tmp;
if (t_4 <= -5e-207) {
tmp = -pow((t_0 * (pow((t_1 * 2.0), 0.25) * pow(F, 0.25))), 2.0) / t_1;
} else if (t_4 <= 1e-35) {
tmp = -sqrt((t_3 * ((-0.5 * (pow(B_m, 2.0) / C)) + (2.0 * A)))) / t_2;
} else if (t_4 <= ((double) INFINITY)) {
tmp = -pow((t_0 * exp((0.25 * (log((-2.0 * ((-4.0 * (A * C)) + pow(B_m, 2.0)))) + (-1.0 * log((-1.0 / F))))))), 2.0) / t_1;
} else {
tmp = -(sqrt((F / B_m)) * sqrt(2.0));
}
return tmp;
}
B_m = abs(B) function code(A, B_m, C, F) t_0 = Float64(Float64(A + C) + hypot(Float64(A - C), B_m)) ^ 0.25 t_1 = fma(B_m, B_m, Float64(A * Float64(C * -4.0))) t_2 = Float64((B_m ^ 2.0) - Float64(Float64(4.0 * A) * C)) t_3 = Float64(2.0 * Float64(t_2 * F)) t_4 = Float64(Float64(-sqrt(Float64(t_3 * Float64(Float64(A + C) + sqrt(Float64((Float64(A - C) ^ 2.0) + (B_m ^ 2.0))))))) / t_2) tmp = 0.0 if (t_4 <= -5e-207) tmp = Float64(Float64(-(Float64(t_0 * Float64((Float64(t_1 * 2.0) ^ 0.25) * (F ^ 0.25))) ^ 2.0)) / t_1); elseif (t_4 <= 1e-35) tmp = Float64(Float64(-sqrt(Float64(t_3 * Float64(Float64(-0.5 * Float64((B_m ^ 2.0) / C)) + Float64(2.0 * A))))) / t_2); elseif (t_4 <= Inf) tmp = Float64(Float64(-(Float64(t_0 * exp(Float64(0.25 * Float64(log(Float64(-2.0 * Float64(Float64(-4.0 * Float64(A * C)) + (B_m ^ 2.0)))) + Float64(-1.0 * log(Float64(-1.0 / F))))))) ^ 2.0)) / t_1); else tmp = Float64(-Float64(sqrt(Float64(F / B_m)) * sqrt(2.0))); end return tmp end
B_m = N[Abs[B], $MachinePrecision]
code[A_, B$95$m_, C_, F_] := Block[{t$95$0 = N[Power[N[(N[(A + C), $MachinePrecision] + N[Sqrt[N[(A - C), $MachinePrecision] ^ 2 + B$95$m ^ 2], $MachinePrecision]), $MachinePrecision], 0.25], $MachinePrecision]}, Block[{t$95$1 = N[(B$95$m * B$95$m + N[(A * N[(C * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[Power[B$95$m, 2.0], $MachinePrecision] - N[(N[(4.0 * A), $MachinePrecision] * C), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(2.0 * N[(t$95$2 * F), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[((-N[Sqrt[N[(t$95$3 * N[(N[(A + C), $MachinePrecision] + N[Sqrt[N[(N[Power[N[(A - C), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[B$95$m, 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$2), $MachinePrecision]}, If[LessEqual[t$95$4, -5e-207], N[((-N[Power[N[(t$95$0 * N[(N[Power[N[(t$95$1 * 2.0), $MachinePrecision], 0.25], $MachinePrecision] * N[Power[F, 0.25], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]) / t$95$1), $MachinePrecision], If[LessEqual[t$95$4, 1e-35], N[((-N[Sqrt[N[(t$95$3 * N[(N[(-0.5 * N[(N[Power[B$95$m, 2.0], $MachinePrecision] / C), $MachinePrecision]), $MachinePrecision] + N[(2.0 * A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$2), $MachinePrecision], If[LessEqual[t$95$4, Infinity], N[((-N[Power[N[(t$95$0 * N[Exp[N[(0.25 * N[(N[Log[N[(-2.0 * N[(N[(-4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision] + N[Power[B$95$m, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] + N[(-1.0 * N[Log[N[(-1.0 / F), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]) / t$95$1), $MachinePrecision], (-N[(N[Sqrt[N[(F / B$95$m), $MachinePrecision]], $MachinePrecision] * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision])]]]]]]]]
\begin{array}{l}
B_m = \left|B\right|
\\
\begin{array}{l}
t_0 := {\left(\left(A + C\right) + \mathsf{hypot}\left(A - C, B\_m\right)\right)}^{0.25}\\
t_1 := \mathsf{fma}\left(B\_m, B\_m, A \cdot \left(C \cdot -4\right)\right)\\
t_2 := {B\_m}^{2} - \left(4 \cdot A\right) \cdot C\\
t_3 := 2 \cdot \left(t\_2 \cdot F\right)\\
t_4 := \frac{-\sqrt{t\_3 \cdot \left(\left(A + C\right) + \sqrt{{\left(A - C\right)}^{2} + {B\_m}^{2}}\right)}}{t\_2}\\
\mathbf{if}\;t\_4 \leq -5 \cdot 10^{-207}:\\
\;\;\;\;\frac{-{\left(t\_0 \cdot \left({\left(t\_1 \cdot 2\right)}^{0.25} \cdot {F}^{0.25}\right)\right)}^{2}}{t\_1}\\
\mathbf{elif}\;t\_4 \leq 10^{-35}:\\
\;\;\;\;\frac{-\sqrt{t\_3 \cdot \left(-0.5 \cdot \frac{{B\_m}^{2}}{C} + 2 \cdot A\right)}}{t\_2}\\
\mathbf{elif}\;t\_4 \leq \infty:\\
\;\;\;\;\frac{-{\left(t\_0 \cdot e^{0.25 \cdot \left(\log \left(-2 \cdot \left(-4 \cdot \left(A \cdot C\right) + {B\_m}^{2}\right)\right) + -1 \cdot \log \left(\frac{-1}{F}\right)\right)}\right)}^{2}}{t\_1}\\
\mathbf{else}:\\
\;\;\;\;-\sqrt{\frac{F}{B\_m}} \cdot \sqrt{2}\\
\end{array}
\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))) < -5.00000000000000014e-207Initial program 49.1%
Simplified58.6%
add-sqr-sqrt58.4%
pow258.4%
Applied egg-rr58.4%
unpow-prod-down68.6%
associate-+r+67.6%
associate-*r*67.6%
Applied egg-rr67.6%
associate-*r*67.6%
unpow-prod-down73.7%
Applied egg-rr73.7%
if -5.00000000000000014e-207 < (/.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))) < 1.00000000000000001e-35Initial program 8.9%
Taylor expanded in C around -inf 46.0%
if 1.00000000000000001e-35 < (/.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 42.9%
Simplified58.9%
add-sqr-sqrt58.7%
pow258.7%
Applied egg-rr58.8%
unpow-prod-down83.2%
associate-+r+83.2%
associate-*r*83.2%
Applied egg-rr83.2%
Taylor expanded in F around -inf 86.6%
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 0.0%
Simplified0.9%
Taylor expanded in C around 0 0.5%
distribute-frac-neg0.5%
associate-*l*0.5%
pow1/20.5%
pow1/20.5%
pow-prod-down0.5%
unpow20.5%
unpow20.5%
hypot-define2.5%
Applied egg-rr2.5%
Taylor expanded in A around 0 15.5%
B_m = (fabs.f64 B)
(FPCore (A B_m C F)
:precision binary64
(let* ((t_0 (- (pow B_m 2.0) (* (* 4.0 A) C)))
(t_1 (* 2.0 (* t_0 F)))
(t_2
(/
(-
(sqrt
(* t_1 (+ (+ A C) (sqrt (+ (pow (- A C) 2.0) (pow B_m 2.0)))))))
t_0))
(t_3
(/
(-
(*
(sqrt (+ A (+ C (hypot (- A C) B_m))))
(sqrt (* (* 2.0 (- (pow B_m 2.0) (* 4.0 (* A C)))) F))))
t_0)))
(if (<= t_2 -5e-207)
t_3
(if (<= t_2 1e-35)
(/ (- (sqrt (* t_1 (+ (* -0.5 (/ (pow B_m 2.0) C)) (* 2.0 A))))) t_0)
(if (<= t_2 INFINITY) t_3 (- (* (sqrt (/ F B_m)) (sqrt 2.0))))))))B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
double t_0 = pow(B_m, 2.0) - ((4.0 * A) * C);
double t_1 = 2.0 * (t_0 * F);
double t_2 = -sqrt((t_1 * ((A + C) + sqrt((pow((A - C), 2.0) + pow(B_m, 2.0)))))) / t_0;
double t_3 = -(sqrt((A + (C + hypot((A - C), B_m)))) * sqrt(((2.0 * (pow(B_m, 2.0) - (4.0 * (A * C)))) * F))) / t_0;
double tmp;
if (t_2 <= -5e-207) {
tmp = t_3;
} else if (t_2 <= 1e-35) {
tmp = -sqrt((t_1 * ((-0.5 * (pow(B_m, 2.0) / C)) + (2.0 * A)))) / t_0;
} else if (t_2 <= ((double) INFINITY)) {
tmp = t_3;
} else {
tmp = -(sqrt((F / B_m)) * sqrt(2.0));
}
return tmp;
}
B_m = Math.abs(B);
public static double code(double A, double B_m, double C, double F) {
double t_0 = Math.pow(B_m, 2.0) - ((4.0 * A) * C);
double t_1 = 2.0 * (t_0 * F);
double t_2 = -Math.sqrt((t_1 * ((A + C) + Math.sqrt((Math.pow((A - C), 2.0) + Math.pow(B_m, 2.0)))))) / t_0;
double t_3 = -(Math.sqrt((A + (C + Math.hypot((A - C), B_m)))) * Math.sqrt(((2.0 * (Math.pow(B_m, 2.0) - (4.0 * (A * C)))) * F))) / t_0;
double tmp;
if (t_2 <= -5e-207) {
tmp = t_3;
} else if (t_2 <= 1e-35) {
tmp = -Math.sqrt((t_1 * ((-0.5 * (Math.pow(B_m, 2.0) / C)) + (2.0 * A)))) / t_0;
} else if (t_2 <= Double.POSITIVE_INFINITY) {
tmp = t_3;
} else {
tmp = -(Math.sqrt((F / B_m)) * Math.sqrt(2.0));
}
return tmp;
}
B_m = math.fabs(B) def code(A, B_m, C, F): t_0 = math.pow(B_m, 2.0) - ((4.0 * A) * C) t_1 = 2.0 * (t_0 * F) t_2 = -math.sqrt((t_1 * ((A + C) + math.sqrt((math.pow((A - C), 2.0) + math.pow(B_m, 2.0)))))) / t_0 t_3 = -(math.sqrt((A + (C + math.hypot((A - C), B_m)))) * math.sqrt(((2.0 * (math.pow(B_m, 2.0) - (4.0 * (A * C)))) * F))) / t_0 tmp = 0 if t_2 <= -5e-207: tmp = t_3 elif t_2 <= 1e-35: tmp = -math.sqrt((t_1 * ((-0.5 * (math.pow(B_m, 2.0) / C)) + (2.0 * A)))) / t_0 elif t_2 <= math.inf: tmp = t_3 else: tmp = -(math.sqrt((F / B_m)) * math.sqrt(2.0)) return tmp
B_m = abs(B) function code(A, B_m, C, F) t_0 = Float64((B_m ^ 2.0) - Float64(Float64(4.0 * A) * C)) t_1 = Float64(2.0 * Float64(t_0 * F)) t_2 = Float64(Float64(-sqrt(Float64(t_1 * Float64(Float64(A + C) + sqrt(Float64((Float64(A - C) ^ 2.0) + (B_m ^ 2.0))))))) / t_0) t_3 = Float64(Float64(-Float64(sqrt(Float64(A + Float64(C + hypot(Float64(A - C), B_m)))) * sqrt(Float64(Float64(2.0 * Float64((B_m ^ 2.0) - Float64(4.0 * Float64(A * C)))) * F)))) / t_0) tmp = 0.0 if (t_2 <= -5e-207) tmp = t_3; elseif (t_2 <= 1e-35) tmp = Float64(Float64(-sqrt(Float64(t_1 * Float64(Float64(-0.5 * Float64((B_m ^ 2.0) / C)) + Float64(2.0 * A))))) / t_0); elseif (t_2 <= Inf) tmp = t_3; else tmp = Float64(-Float64(sqrt(Float64(F / B_m)) * sqrt(2.0))); end return tmp end
B_m = abs(B); function tmp_2 = code(A, B_m, C, F) t_0 = (B_m ^ 2.0) - ((4.0 * A) * C); t_1 = 2.0 * (t_0 * F); t_2 = -sqrt((t_1 * ((A + C) + sqrt((((A - C) ^ 2.0) + (B_m ^ 2.0)))))) / t_0; t_3 = -(sqrt((A + (C + hypot((A - C), B_m)))) * sqrt(((2.0 * ((B_m ^ 2.0) - (4.0 * (A * C)))) * F))) / t_0; tmp = 0.0; if (t_2 <= -5e-207) tmp = t_3; elseif (t_2 <= 1e-35) tmp = -sqrt((t_1 * ((-0.5 * ((B_m ^ 2.0) / C)) + (2.0 * A)))) / t_0; elseif (t_2 <= Inf) tmp = t_3; else tmp = -(sqrt((F / B_m)) * sqrt(2.0)); end tmp_2 = tmp; end
B_m = N[Abs[B], $MachinePrecision]
code[A_, B$95$m_, C_, F_] := Block[{t$95$0 = N[(N[Power[B$95$m, 2.0], $MachinePrecision] - N[(N[(4.0 * A), $MachinePrecision] * C), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(2.0 * N[(t$95$0 * F), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[((-N[Sqrt[N[(t$95$1 * N[(N[(A + C), $MachinePrecision] + N[Sqrt[N[(N[Power[N[(A - C), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[B$95$m, 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision]}, Block[{t$95$3 = N[((-N[(N[Sqrt[N[(A + N[(C + N[Sqrt[N[(A - C), $MachinePrecision] ^ 2 + B$95$m ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(N[(2.0 * N[(N[Power[B$95$m, 2.0], $MachinePrecision] - N[(4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * F), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]) / t$95$0), $MachinePrecision]}, If[LessEqual[t$95$2, -5e-207], t$95$3, If[LessEqual[t$95$2, 1e-35], N[((-N[Sqrt[N[(t$95$1 * N[(N[(-0.5 * N[(N[Power[B$95$m, 2.0], $MachinePrecision] / C), $MachinePrecision]), $MachinePrecision] + N[(2.0 * A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], If[LessEqual[t$95$2, Infinity], t$95$3, (-N[(N[Sqrt[N[(F / B$95$m), $MachinePrecision]], $MachinePrecision] * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision])]]]]]]]
\begin{array}{l}
B_m = \left|B\right|
\\
\begin{array}{l}
t_0 := {B\_m}^{2} - \left(4 \cdot A\right) \cdot C\\
t_1 := 2 \cdot \left(t\_0 \cdot F\right)\\
t_2 := \frac{-\sqrt{t\_1 \cdot \left(\left(A + C\right) + \sqrt{{\left(A - C\right)}^{2} + {B\_m}^{2}}\right)}}{t\_0}\\
t_3 := \frac{-\sqrt{A + \left(C + \mathsf{hypot}\left(A - C, B\_m\right)\right)} \cdot \sqrt{\left(2 \cdot \left({B\_m}^{2} - 4 \cdot \left(A \cdot C\right)\right)\right) \cdot F}}{t\_0}\\
\mathbf{if}\;t\_2 \leq -5 \cdot 10^{-207}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;t\_2 \leq 10^{-35}:\\
\;\;\;\;\frac{-\sqrt{t\_1 \cdot \left(-0.5 \cdot \frac{{B\_m}^{2}}{C} + 2 \cdot A\right)}}{t\_0}\\
\mathbf{elif}\;t\_2 \leq \infty:\\
\;\;\;\;t\_3\\
\mathbf{else}:\\
\;\;\;\;-\sqrt{\frac{F}{B\_m}} \cdot \sqrt{2}\\
\end{array}
\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))) < -5.00000000000000014e-207 or 1.00000000000000001e-35 < (/.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 47.8%
*-commutative47.8%
sqrt-prod53.7%
associate-+l+53.7%
unpow253.7%
unpow253.7%
hypot-define72.0%
associate-*r*72.0%
associate-*l*71.9%
Applied egg-rr71.9%
if -5.00000000000000014e-207 < (/.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))) < 1.00000000000000001e-35Initial program 8.9%
Taylor expanded in C around -inf 46.0%
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 0.0%
Simplified0.9%
Taylor expanded in C around 0 0.5%
distribute-frac-neg0.5%
associate-*l*0.5%
pow1/20.5%
pow1/20.5%
pow-prod-down0.5%
unpow20.5%
unpow20.5%
hypot-define2.5%
Applied egg-rr2.5%
Taylor expanded in A around 0 15.5%
B_m = (fabs.f64 B)
(FPCore (A B_m C F)
:precision binary64
(let* ((t_0 (hypot (- A C) B_m))
(t_1 (fma B_m B_m (* A (* C -4.0))))
(t_2 (- (pow B_m 2.0) (* (* 4.0 A) C)))
(t_3 (* 2.0 (* t_2 F)))
(t_4
(/
(-
(sqrt
(* t_3 (+ (+ A C) (sqrt (+ (pow (- A C) 2.0) (pow B_m 2.0)))))))
t_2)))
(if (<= t_4 -5e-207)
(/
(-
(pow
(* (pow (+ (+ A C) t_0) 0.25) (* (pow (* t_1 2.0) 0.25) (pow F 0.25)))
2.0))
t_1)
(if (<= t_4 1e-35)
(/ (- (sqrt (* t_3 (+ (* -0.5 (/ (pow B_m 2.0) C)) (* 2.0 A))))) t_2)
(if (<= t_4 INFINITY)
(/
(-
(*
(sqrt (+ A (+ C t_0)))
(sqrt (* (* 2.0 (- (pow B_m 2.0) (* 4.0 (* A C)))) F))))
t_2)
(- (* (sqrt (/ F B_m)) (sqrt 2.0))))))))B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
double t_0 = hypot((A - C), B_m);
double t_1 = fma(B_m, B_m, (A * (C * -4.0)));
double t_2 = pow(B_m, 2.0) - ((4.0 * A) * C);
double t_3 = 2.0 * (t_2 * F);
double t_4 = -sqrt((t_3 * ((A + C) + sqrt((pow((A - C), 2.0) + pow(B_m, 2.0)))))) / t_2;
double tmp;
if (t_4 <= -5e-207) {
tmp = -pow((pow(((A + C) + t_0), 0.25) * (pow((t_1 * 2.0), 0.25) * pow(F, 0.25))), 2.0) / t_1;
} else if (t_4 <= 1e-35) {
tmp = -sqrt((t_3 * ((-0.5 * (pow(B_m, 2.0) / C)) + (2.0 * A)))) / t_2;
} else if (t_4 <= ((double) INFINITY)) {
tmp = -(sqrt((A + (C + t_0))) * sqrt(((2.0 * (pow(B_m, 2.0) - (4.0 * (A * C)))) * F))) / t_2;
} else {
tmp = -(sqrt((F / B_m)) * sqrt(2.0));
}
return tmp;
}
B_m = abs(B) function code(A, B_m, C, F) t_0 = hypot(Float64(A - C), B_m) t_1 = fma(B_m, B_m, Float64(A * Float64(C * -4.0))) t_2 = Float64((B_m ^ 2.0) - Float64(Float64(4.0 * A) * C)) t_3 = Float64(2.0 * Float64(t_2 * F)) t_4 = Float64(Float64(-sqrt(Float64(t_3 * Float64(Float64(A + C) + sqrt(Float64((Float64(A - C) ^ 2.0) + (B_m ^ 2.0))))))) / t_2) tmp = 0.0 if (t_4 <= -5e-207) tmp = Float64(Float64(-(Float64((Float64(Float64(A + C) + t_0) ^ 0.25) * Float64((Float64(t_1 * 2.0) ^ 0.25) * (F ^ 0.25))) ^ 2.0)) / t_1); elseif (t_4 <= 1e-35) tmp = Float64(Float64(-sqrt(Float64(t_3 * Float64(Float64(-0.5 * Float64((B_m ^ 2.0) / C)) + Float64(2.0 * A))))) / t_2); elseif (t_4 <= Inf) tmp = Float64(Float64(-Float64(sqrt(Float64(A + Float64(C + t_0))) * sqrt(Float64(Float64(2.0 * Float64((B_m ^ 2.0) - Float64(4.0 * Float64(A * C)))) * F)))) / t_2); else tmp = Float64(-Float64(sqrt(Float64(F / B_m)) * sqrt(2.0))); end return tmp end
B_m = N[Abs[B], $MachinePrecision]
code[A_, B$95$m_, C_, F_] := Block[{t$95$0 = N[Sqrt[N[(A - C), $MachinePrecision] ^ 2 + B$95$m ^ 2], $MachinePrecision]}, Block[{t$95$1 = N[(B$95$m * B$95$m + N[(A * N[(C * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[Power[B$95$m, 2.0], $MachinePrecision] - N[(N[(4.0 * A), $MachinePrecision] * C), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(2.0 * N[(t$95$2 * F), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[((-N[Sqrt[N[(t$95$3 * N[(N[(A + C), $MachinePrecision] + N[Sqrt[N[(N[Power[N[(A - C), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[B$95$m, 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$2), $MachinePrecision]}, If[LessEqual[t$95$4, -5e-207], N[((-N[Power[N[(N[Power[N[(N[(A + C), $MachinePrecision] + t$95$0), $MachinePrecision], 0.25], $MachinePrecision] * N[(N[Power[N[(t$95$1 * 2.0), $MachinePrecision], 0.25], $MachinePrecision] * N[Power[F, 0.25], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]) / t$95$1), $MachinePrecision], If[LessEqual[t$95$4, 1e-35], N[((-N[Sqrt[N[(t$95$3 * N[(N[(-0.5 * N[(N[Power[B$95$m, 2.0], $MachinePrecision] / C), $MachinePrecision]), $MachinePrecision] + N[(2.0 * A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$2), $MachinePrecision], If[LessEqual[t$95$4, Infinity], N[((-N[(N[Sqrt[N[(A + N[(C + t$95$0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(N[(2.0 * N[(N[Power[B$95$m, 2.0], $MachinePrecision] - N[(4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * F), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]) / t$95$2), $MachinePrecision], (-N[(N[Sqrt[N[(F / B$95$m), $MachinePrecision]], $MachinePrecision] * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision])]]]]]]]]
\begin{array}{l}
B_m = \left|B\right|
\\
\begin{array}{l}
t_0 := \mathsf{hypot}\left(A - C, B\_m\right)\\
t_1 := \mathsf{fma}\left(B\_m, B\_m, A \cdot \left(C \cdot -4\right)\right)\\
t_2 := {B\_m}^{2} - \left(4 \cdot A\right) \cdot C\\
t_3 := 2 \cdot \left(t\_2 \cdot F\right)\\
t_4 := \frac{-\sqrt{t\_3 \cdot \left(\left(A + C\right) + \sqrt{{\left(A - C\right)}^{2} + {B\_m}^{2}}\right)}}{t\_2}\\
\mathbf{if}\;t\_4 \leq -5 \cdot 10^{-207}:\\
\;\;\;\;\frac{-{\left({\left(\left(A + C\right) + t\_0\right)}^{0.25} \cdot \left({\left(t\_1 \cdot 2\right)}^{0.25} \cdot {F}^{0.25}\right)\right)}^{2}}{t\_1}\\
\mathbf{elif}\;t\_4 \leq 10^{-35}:\\
\;\;\;\;\frac{-\sqrt{t\_3 \cdot \left(-0.5 \cdot \frac{{B\_m}^{2}}{C} + 2 \cdot A\right)}}{t\_2}\\
\mathbf{elif}\;t\_4 \leq \infty:\\
\;\;\;\;\frac{-\sqrt{A + \left(C + t\_0\right)} \cdot \sqrt{\left(2 \cdot \left({B\_m}^{2} - 4 \cdot \left(A \cdot C\right)\right)\right) \cdot F}}{t\_2}\\
\mathbf{else}:\\
\;\;\;\;-\sqrt{\frac{F}{B\_m}} \cdot \sqrt{2}\\
\end{array}
\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))) < -5.00000000000000014e-207Initial program 49.1%
Simplified58.6%
add-sqr-sqrt58.4%
pow258.4%
Applied egg-rr58.4%
unpow-prod-down68.6%
associate-+r+67.6%
associate-*r*67.6%
Applied egg-rr67.6%
associate-*r*67.6%
unpow-prod-down73.7%
Applied egg-rr73.7%
if -5.00000000000000014e-207 < (/.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))) < 1.00000000000000001e-35Initial program 8.9%
Taylor expanded in C around -inf 46.0%
if 1.00000000000000001e-35 < (/.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 42.9%
*-commutative42.9%
sqrt-prod43.8%
associate-+l+43.8%
unpow243.8%
unpow243.8%
hypot-define83.3%
associate-*r*83.3%
associate-*l*83.3%
Applied egg-rr83.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 0.0%
Simplified0.9%
Taylor expanded in C around 0 0.5%
distribute-frac-neg0.5%
associate-*l*0.5%
pow1/20.5%
pow1/20.5%
pow-prod-down0.5%
unpow20.5%
unpow20.5%
hypot-define2.5%
Applied egg-rr2.5%
Taylor expanded in A around 0 15.5%
B_m = (fabs.f64 B)
(FPCore (A B_m C F)
:precision binary64
(let* ((t_0 (fma B_m B_m (* A (* C -4.0)))) (t_1 (* t_0 (* F 2.0))))
(if (<= B_m 5.1e-280)
(/
(- (pow (* (pow (* 2.0 A) 0.25) (pow (* t_0 (* 2.0 F)) 0.25)) 2.0))
t_0)
(if (<= B_m 6.8e-199)
(/ (- (sqrt (* t_1 (* 2.0 C)))) t_0)
(if (<= B_m 7.4e+28)
(/ (- (sqrt (* t_1 (+ A (+ C (hypot B_m (- A C))))))) t_0)
(if (<= B_m 3e+272)
(*
-1.0
(*
(/ (sqrt 2.0) B_m)
(sqrt (* F (+ B_m (+ C (* 0.5 (/ (pow C 2.0) B_m))))))))
(- (* (sqrt (/ F B_m)) (sqrt 2.0)))))))))B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
double t_0 = fma(B_m, B_m, (A * (C * -4.0)));
double t_1 = t_0 * (F * 2.0);
double tmp;
if (B_m <= 5.1e-280) {
tmp = -pow((pow((2.0 * A), 0.25) * pow((t_0 * (2.0 * F)), 0.25)), 2.0) / t_0;
} else if (B_m <= 6.8e-199) {
tmp = -sqrt((t_1 * (2.0 * C))) / t_0;
} else if (B_m <= 7.4e+28) {
tmp = -sqrt((t_1 * (A + (C + hypot(B_m, (A - C)))))) / t_0;
} else if (B_m <= 3e+272) {
tmp = -1.0 * ((sqrt(2.0) / B_m) * sqrt((F * (B_m + (C + (0.5 * (pow(C, 2.0) / B_m)))))));
} else {
tmp = -(sqrt((F / B_m)) * sqrt(2.0));
}
return tmp;
}
B_m = abs(B) function code(A, B_m, C, F) t_0 = fma(B_m, B_m, Float64(A * Float64(C * -4.0))) t_1 = Float64(t_0 * Float64(F * 2.0)) tmp = 0.0 if (B_m <= 5.1e-280) tmp = Float64(Float64(-(Float64((Float64(2.0 * A) ^ 0.25) * (Float64(t_0 * Float64(2.0 * F)) ^ 0.25)) ^ 2.0)) / t_0); elseif (B_m <= 6.8e-199) tmp = Float64(Float64(-sqrt(Float64(t_1 * Float64(2.0 * C)))) / t_0); elseif (B_m <= 7.4e+28) tmp = Float64(Float64(-sqrt(Float64(t_1 * Float64(A + Float64(C + hypot(B_m, Float64(A - C))))))) / t_0); elseif (B_m <= 3e+272) tmp = Float64(-1.0 * Float64(Float64(sqrt(2.0) / B_m) * sqrt(Float64(F * Float64(B_m + Float64(C + Float64(0.5 * Float64((C ^ 2.0) / B_m)))))))); else tmp = Float64(-Float64(sqrt(Float64(F / B_m)) * sqrt(2.0))); end return tmp end
B_m = N[Abs[B], $MachinePrecision]
code[A_, B$95$m_, C_, F_] := Block[{t$95$0 = N[(B$95$m * B$95$m + N[(A * N[(C * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(t$95$0 * N[(F * 2.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[B$95$m, 5.1e-280], N[((-N[Power[N[(N[Power[N[(2.0 * A), $MachinePrecision], 0.25], $MachinePrecision] * N[Power[N[(t$95$0 * N[(2.0 * F), $MachinePrecision]), $MachinePrecision], 0.25], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]) / t$95$0), $MachinePrecision], If[LessEqual[B$95$m, 6.8e-199], N[((-N[Sqrt[N[(t$95$1 * N[(2.0 * C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], If[LessEqual[B$95$m, 7.4e+28], N[((-N[Sqrt[N[(t$95$1 * N[(A + N[(C + N[Sqrt[B$95$m ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], If[LessEqual[B$95$m, 3e+272], N[(-1.0 * N[(N[(N[Sqrt[2.0], $MachinePrecision] / B$95$m), $MachinePrecision] * N[Sqrt[N[(F * N[(B$95$m + N[(C + N[(0.5 * N[(N[Power[C, 2.0], $MachinePrecision] / B$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], (-N[(N[Sqrt[N[(F / B$95$m), $MachinePrecision]], $MachinePrecision] * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision])]]]]]]
\begin{array}{l}
B_m = \left|B\right|
\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(B\_m, B\_m, A \cdot \left(C \cdot -4\right)\right)\\
t_1 := t\_0 \cdot \left(F \cdot 2\right)\\
\mathbf{if}\;B\_m \leq 5.1 \cdot 10^{-280}:\\
\;\;\;\;\frac{-{\left({\left(2 \cdot A\right)}^{0.25} \cdot {\left(t\_0 \cdot \left(2 \cdot F\right)\right)}^{0.25}\right)}^{2}}{t\_0}\\
\mathbf{elif}\;B\_m \leq 6.8 \cdot 10^{-199}:\\
\;\;\;\;\frac{-\sqrt{t\_1 \cdot \left(2 \cdot C\right)}}{t\_0}\\
\mathbf{elif}\;B\_m \leq 7.4 \cdot 10^{+28}:\\
\;\;\;\;\frac{-\sqrt{t\_1 \cdot \left(A + \left(C + \mathsf{hypot}\left(B\_m, A - C\right)\right)\right)}}{t\_0}\\
\mathbf{elif}\;B\_m \leq 3 \cdot 10^{+272}:\\
\;\;\;\;-1 \cdot \left(\frac{\sqrt{2}}{B\_m} \cdot \sqrt{F \cdot \left(B\_m + \left(C + 0.5 \cdot \frac{{C}^{2}}{B\_m}\right)\right)}\right)\\
\mathbf{else}:\\
\;\;\;\;-\sqrt{\frac{F}{B\_m}} \cdot \sqrt{2}\\
\end{array}
\end{array}
if B < 5.0999999999999996e-280Initial program 21.9%
Simplified27.7%
add-sqr-sqrt27.7%
pow227.7%
Applied egg-rr27.7%
unpow-prod-down34.8%
associate-+r+33.8%
associate-*r*33.8%
Applied egg-rr33.8%
Taylor expanded in A around inf 16.7%
if 5.0999999999999996e-280 < B < 6.80000000000000011e-199Initial program 23.1%
Simplified31.3%
Taylor expanded in A around -inf 42.5%
if 6.80000000000000011e-199 < B < 7.3999999999999998e28Initial program 33.7%
Simplified43.4%
if 7.3999999999999998e28 < B < 3.0000000000000002e272Initial program 17.9%
Simplified20.2%
Taylor expanded in B around inf 18.0%
Taylor expanded in A around 0 53.4%
if 3.0000000000000002e272 < B Initial program 0.0%
Simplified0.0%
Taylor expanded in C around 0 0.0%
distribute-frac-neg0.0%
associate-*l*0.0%
pow1/20.0%
pow1/20.0%
pow-prod-down0.0%
unpow20.0%
unpow20.0%
hypot-define0.0%
Applied egg-rr0.0%
Taylor expanded in A around 0 62.9%
B_m = (fabs.f64 B)
(FPCore (A B_m C F)
:precision binary64
(let* ((t_0 (fma B_m B_m (* A (* C -4.0))))
(t_1 (* t_0 (* F 2.0)))
(t_2 (/ (- (sqrt (* t_1 (+ A (+ C (hypot B_m (- A C))))))) t_0)))
(if (<= B_m 4.5e-264)
t_2
(if (<= B_m 5.8e-198)
(/ (- (sqrt (* t_1 (* 2.0 C)))) t_0)
(if (<= B_m 7.3e+28)
t_2
(if (<= B_m 2.5e+271)
(*
-1.0
(*
(/ (sqrt 2.0) B_m)
(sqrt (* F (+ B_m (+ C (* 0.5 (/ (pow C 2.0) B_m))))))))
(- (* (sqrt (/ F B_m)) (sqrt 2.0)))))))))B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
double t_0 = fma(B_m, B_m, (A * (C * -4.0)));
double t_1 = t_0 * (F * 2.0);
double t_2 = -sqrt((t_1 * (A + (C + hypot(B_m, (A - C)))))) / t_0;
double tmp;
if (B_m <= 4.5e-264) {
tmp = t_2;
} else if (B_m <= 5.8e-198) {
tmp = -sqrt((t_1 * (2.0 * C))) / t_0;
} else if (B_m <= 7.3e+28) {
tmp = t_2;
} else if (B_m <= 2.5e+271) {
tmp = -1.0 * ((sqrt(2.0) / B_m) * sqrt((F * (B_m + (C + (0.5 * (pow(C, 2.0) / B_m)))))));
} else {
tmp = -(sqrt((F / B_m)) * sqrt(2.0));
}
return tmp;
}
B_m = abs(B) function code(A, B_m, C, F) t_0 = fma(B_m, B_m, Float64(A * Float64(C * -4.0))) t_1 = Float64(t_0 * Float64(F * 2.0)) t_2 = Float64(Float64(-sqrt(Float64(t_1 * Float64(A + Float64(C + hypot(B_m, Float64(A - C))))))) / t_0) tmp = 0.0 if (B_m <= 4.5e-264) tmp = t_2; elseif (B_m <= 5.8e-198) tmp = Float64(Float64(-sqrt(Float64(t_1 * Float64(2.0 * C)))) / t_0); elseif (B_m <= 7.3e+28) tmp = t_2; elseif (B_m <= 2.5e+271) tmp = Float64(-1.0 * Float64(Float64(sqrt(2.0) / B_m) * sqrt(Float64(F * Float64(B_m + Float64(C + Float64(0.5 * Float64((C ^ 2.0) / B_m)))))))); else tmp = Float64(-Float64(sqrt(Float64(F / B_m)) * sqrt(2.0))); end return tmp end
B_m = N[Abs[B], $MachinePrecision]
code[A_, B$95$m_, C_, F_] := Block[{t$95$0 = N[(B$95$m * B$95$m + N[(A * N[(C * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(t$95$0 * N[(F * 2.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[((-N[Sqrt[N[(t$95$1 * N[(A + N[(C + N[Sqrt[B$95$m ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision]}, If[LessEqual[B$95$m, 4.5e-264], t$95$2, If[LessEqual[B$95$m, 5.8e-198], N[((-N[Sqrt[N[(t$95$1 * N[(2.0 * C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], If[LessEqual[B$95$m, 7.3e+28], t$95$2, If[LessEqual[B$95$m, 2.5e+271], N[(-1.0 * N[(N[(N[Sqrt[2.0], $MachinePrecision] / B$95$m), $MachinePrecision] * N[Sqrt[N[(F * N[(B$95$m + N[(C + N[(0.5 * N[(N[Power[C, 2.0], $MachinePrecision] / B$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], (-N[(N[Sqrt[N[(F / B$95$m), $MachinePrecision]], $MachinePrecision] * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision])]]]]]]]
\begin{array}{l}
B_m = \left|B\right|
\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(B\_m, B\_m, A \cdot \left(C \cdot -4\right)\right)\\
t_1 := t\_0 \cdot \left(F \cdot 2\right)\\
t_2 := \frac{-\sqrt{t\_1 \cdot \left(A + \left(C + \mathsf{hypot}\left(B\_m, A - C\right)\right)\right)}}{t\_0}\\
\mathbf{if}\;B\_m \leq 4.5 \cdot 10^{-264}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;B\_m \leq 5.8 \cdot 10^{-198}:\\
\;\;\;\;\frac{-\sqrt{t\_1 \cdot \left(2 \cdot C\right)}}{t\_0}\\
\mathbf{elif}\;B\_m \leq 7.3 \cdot 10^{+28}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;B\_m \leq 2.5 \cdot 10^{+271}:\\
\;\;\;\;-1 \cdot \left(\frac{\sqrt{2}}{B\_m} \cdot \sqrt{F \cdot \left(B\_m + \left(C + 0.5 \cdot \frac{{C}^{2}}{B\_m}\right)\right)}\right)\\
\mathbf{else}:\\
\;\;\;\;-\sqrt{\frac{F}{B\_m}} \cdot \sqrt{2}\\
\end{array}
\end{array}
if B < 4.5000000000000001e-264 or 5.80000000000000001e-198 < B < 7.2999999999999998e28Initial program 25.7%
Simplified33.2%
if 4.5000000000000001e-264 < B < 5.80000000000000001e-198Initial program 22.4%
Simplified26.0%
Taylor expanded in A around -inf 44.1%
if 7.2999999999999998e28 < B < 2.5000000000000002e271Initial program 17.9%
Simplified20.2%
Taylor expanded in B around inf 18.0%
Taylor expanded in A around 0 53.4%
if 2.5000000000000002e271 < B Initial program 0.0%
Simplified0.0%
Taylor expanded in C around 0 0.0%
distribute-frac-neg0.0%
associate-*l*0.0%
pow1/20.0%
pow1/20.0%
pow-prod-down0.0%
unpow20.0%
unpow20.0%
hypot-define0.0%
Applied egg-rr0.0%
Taylor expanded in A around 0 62.9%
B_m = (fabs.f64 B)
(FPCore (A B_m C F)
:precision binary64
(let* ((t_0 (fma B_m B_m (* A (* C -4.0)))) (t_1 (* t_0 (* F 2.0))))
(if (<= B_m 2.32e-212)
(/ (- (sqrt (* t_1 (+ A A)))) t_0)
(if (<= B_m 2.9e-198)
(/ (- (sqrt (* t_1 (* 2.0 C)))) t_0)
(if (<= B_m 7.7e-112)
(/
(-
(pow
(pow (* (+ A A) (* (fma B_m B_m (* (* A C) -4.0)) (* 2.0 F))) 0.25)
2.0))
t_0)
(if (<= B_m 3.6e+132)
(- (/ (* B_m (* (sqrt (* 2.0 F)) (sqrt (+ A (hypot A B_m))))) t_0))
(if (<= B_m 7.2e+270)
(*
-1.0
(*
(/ (sqrt 2.0) B_m)
(sqrt (* F (+ B_m (+ C (* 0.5 (/ (pow C 2.0) B_m))))))))
(- (* (sqrt (/ F B_m)) (sqrt 2.0))))))))))B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
double t_0 = fma(B_m, B_m, (A * (C * -4.0)));
double t_1 = t_0 * (F * 2.0);
double tmp;
if (B_m <= 2.32e-212) {
tmp = -sqrt((t_1 * (A + A))) / t_0;
} else if (B_m <= 2.9e-198) {
tmp = -sqrt((t_1 * (2.0 * C))) / t_0;
} else if (B_m <= 7.7e-112) {
tmp = -pow(pow(((A + A) * (fma(B_m, B_m, ((A * C) * -4.0)) * (2.0 * F))), 0.25), 2.0) / t_0;
} else if (B_m <= 3.6e+132) {
tmp = -((B_m * (sqrt((2.0 * F)) * sqrt((A + hypot(A, B_m))))) / t_0);
} else if (B_m <= 7.2e+270) {
tmp = -1.0 * ((sqrt(2.0) / B_m) * sqrt((F * (B_m + (C + (0.5 * (pow(C, 2.0) / B_m)))))));
} else {
tmp = -(sqrt((F / B_m)) * sqrt(2.0));
}
return tmp;
}
B_m = abs(B) function code(A, B_m, C, F) t_0 = fma(B_m, B_m, Float64(A * Float64(C * -4.0))) t_1 = Float64(t_0 * Float64(F * 2.0)) tmp = 0.0 if (B_m <= 2.32e-212) tmp = Float64(Float64(-sqrt(Float64(t_1 * Float64(A + A)))) / t_0); elseif (B_m <= 2.9e-198) tmp = Float64(Float64(-sqrt(Float64(t_1 * Float64(2.0 * C)))) / t_0); elseif (B_m <= 7.7e-112) tmp = Float64(Float64(-((Float64(Float64(A + A) * Float64(fma(B_m, B_m, Float64(Float64(A * C) * -4.0)) * Float64(2.0 * F))) ^ 0.25) ^ 2.0)) / t_0); elseif (B_m <= 3.6e+132) tmp = Float64(-Float64(Float64(B_m * Float64(sqrt(Float64(2.0 * F)) * sqrt(Float64(A + hypot(A, B_m))))) / t_0)); elseif (B_m <= 7.2e+270) tmp = Float64(-1.0 * Float64(Float64(sqrt(2.0) / B_m) * sqrt(Float64(F * Float64(B_m + Float64(C + Float64(0.5 * Float64((C ^ 2.0) / B_m)))))))); else tmp = Float64(-Float64(sqrt(Float64(F / B_m)) * sqrt(2.0))); end return tmp end
B_m = N[Abs[B], $MachinePrecision]
code[A_, B$95$m_, C_, F_] := Block[{t$95$0 = N[(B$95$m * B$95$m + N[(A * N[(C * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(t$95$0 * N[(F * 2.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[B$95$m, 2.32e-212], N[((-N[Sqrt[N[(t$95$1 * N[(A + A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], If[LessEqual[B$95$m, 2.9e-198], N[((-N[Sqrt[N[(t$95$1 * N[(2.0 * C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], If[LessEqual[B$95$m, 7.7e-112], N[((-N[Power[N[Power[N[(N[(A + A), $MachinePrecision] * N[(N[(B$95$m * B$95$m + N[(N[(A * C), $MachinePrecision] * -4.0), $MachinePrecision]), $MachinePrecision] * N[(2.0 * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.25], $MachinePrecision], 2.0], $MachinePrecision]) / t$95$0), $MachinePrecision], If[LessEqual[B$95$m, 3.6e+132], (-N[(N[(B$95$m * N[(N[Sqrt[N[(2.0 * F), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(A + N[Sqrt[A ^ 2 + B$95$m ^ 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision]), If[LessEqual[B$95$m, 7.2e+270], N[(-1.0 * N[(N[(N[Sqrt[2.0], $MachinePrecision] / B$95$m), $MachinePrecision] * N[Sqrt[N[(F * N[(B$95$m + N[(C + N[(0.5 * N[(N[Power[C, 2.0], $MachinePrecision] / B$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], (-N[(N[Sqrt[N[(F / B$95$m), $MachinePrecision]], $MachinePrecision] * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision])]]]]]]]
\begin{array}{l}
B_m = \left|B\right|
\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(B\_m, B\_m, A \cdot \left(C \cdot -4\right)\right)\\
t_1 := t\_0 \cdot \left(F \cdot 2\right)\\
\mathbf{if}\;B\_m \leq 2.32 \cdot 10^{-212}:\\
\;\;\;\;\frac{-\sqrt{t\_1 \cdot \left(A + A\right)}}{t\_0}\\
\mathbf{elif}\;B\_m \leq 2.9 \cdot 10^{-198}:\\
\;\;\;\;\frac{-\sqrt{t\_1 \cdot \left(2 \cdot C\right)}}{t\_0}\\
\mathbf{elif}\;B\_m \leq 7.7 \cdot 10^{-112}:\\
\;\;\;\;\frac{-{\left({\left(\left(A + A\right) \cdot \left(\mathsf{fma}\left(B\_m, B\_m, \left(A \cdot C\right) \cdot -4\right) \cdot \left(2 \cdot F\right)\right)\right)}^{0.25}\right)}^{2}}{t\_0}\\
\mathbf{elif}\;B\_m \leq 3.6 \cdot 10^{+132}:\\
\;\;\;\;-\frac{B\_m \cdot \left(\sqrt{2 \cdot F} \cdot \sqrt{A + \mathsf{hypot}\left(A, B\_m\right)}\right)}{t\_0}\\
\mathbf{elif}\;B\_m \leq 7.2 \cdot 10^{+270}:\\
\;\;\;\;-1 \cdot \left(\frac{\sqrt{2}}{B\_m} \cdot \sqrt{F \cdot \left(B\_m + \left(C + 0.5 \cdot \frac{{C}^{2}}{B\_m}\right)\right)}\right)\\
\mathbf{else}:\\
\;\;\;\;-\sqrt{\frac{F}{B\_m}} \cdot \sqrt{2}\\
\end{array}
\end{array}
if B < 2.3199999999999999e-212Initial program 21.6%
Simplified27.8%
Taylor expanded in C around -inf 18.4%
if 2.3199999999999999e-212 < B < 2.90000000000000001e-198Initial program 35.2%
Simplified39.5%
Taylor expanded in A around -inf 79.4%
if 2.90000000000000001e-198 < B < 7.69999999999999959e-112Initial program 16.2%
Simplified28.1%
add-sqr-sqrt28.0%
pow228.0%
Applied egg-rr28.1%
Taylor expanded in C around -inf 37.7%
if 7.69999999999999959e-112 < B < 3.60000000000000016e132Initial program 35.6%
Simplified42.6%
Taylor expanded in C around 0 33.7%
distribute-frac-neg33.7%
associate-*l*33.6%
pow1/233.6%
pow1/233.9%
pow-prod-down33.9%
unpow233.9%
unpow233.9%
hypot-define34.7%
Applied egg-rr34.7%
unpow1/234.4%
associate-*r*34.4%
sqrt-prod36.7%
Applied egg-rr36.7%
if 3.60000000000000016e132 < B < 7.2000000000000003e270Initial program 15.1%
Simplified15.1%
Taylor expanded in B around inf 15.1%
Taylor expanded in A around 0 74.1%
if 7.2000000000000003e270 < B Initial program 0.0%
Simplified0.0%
Taylor expanded in C around 0 0.0%
distribute-frac-neg0.0%
associate-*l*0.0%
pow1/20.0%
pow1/20.0%
pow-prod-down0.0%
unpow20.0%
unpow20.0%
hypot-define0.0%
Applied egg-rr0.0%
Taylor expanded in A around 0 62.9%
B_m = (fabs.f64 B)
(FPCore (A B_m C F)
:precision binary64
(let* ((t_0 (fma B_m B_m (* A (* C -4.0))))
(t_1 (* t_0 (* F 2.0)))
(t_2 (/ (- (sqrt (* t_1 (+ A A)))) t_0)))
(if (<= B_m 1.7e-212)
t_2
(if (<= B_m 1.6e-198)
(/ (- (sqrt (* t_1 (* 2.0 C)))) t_0)
(if (<= B_m 3.05e-111)
t_2
(if (<= B_m 3.6e+132)
(- (/ (* B_m (* (sqrt (* 2.0 F)) (sqrt (+ A (hypot A B_m))))) t_0))
(if (<= B_m 3e+271)
(*
-1.0
(*
(/ (sqrt 2.0) B_m)
(sqrt (* F (+ B_m (+ C (* 0.5 (/ (pow C 2.0) B_m))))))))
(- (* (sqrt (/ F B_m)) (sqrt 2.0))))))))))B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
double t_0 = fma(B_m, B_m, (A * (C * -4.0)));
double t_1 = t_0 * (F * 2.0);
double t_2 = -sqrt((t_1 * (A + A))) / t_0;
double tmp;
if (B_m <= 1.7e-212) {
tmp = t_2;
} else if (B_m <= 1.6e-198) {
tmp = -sqrt((t_1 * (2.0 * C))) / t_0;
} else if (B_m <= 3.05e-111) {
tmp = t_2;
} else if (B_m <= 3.6e+132) {
tmp = -((B_m * (sqrt((2.0 * F)) * sqrt((A + hypot(A, B_m))))) / t_0);
} else if (B_m <= 3e+271) {
tmp = -1.0 * ((sqrt(2.0) / B_m) * sqrt((F * (B_m + (C + (0.5 * (pow(C, 2.0) / B_m)))))));
} else {
tmp = -(sqrt((F / B_m)) * sqrt(2.0));
}
return tmp;
}
B_m = abs(B) function code(A, B_m, C, F) t_0 = fma(B_m, B_m, Float64(A * Float64(C * -4.0))) t_1 = Float64(t_0 * Float64(F * 2.0)) t_2 = Float64(Float64(-sqrt(Float64(t_1 * Float64(A + A)))) / t_0) tmp = 0.0 if (B_m <= 1.7e-212) tmp = t_2; elseif (B_m <= 1.6e-198) tmp = Float64(Float64(-sqrt(Float64(t_1 * Float64(2.0 * C)))) / t_0); elseif (B_m <= 3.05e-111) tmp = t_2; elseif (B_m <= 3.6e+132) tmp = Float64(-Float64(Float64(B_m * Float64(sqrt(Float64(2.0 * F)) * sqrt(Float64(A + hypot(A, B_m))))) / t_0)); elseif (B_m <= 3e+271) tmp = Float64(-1.0 * Float64(Float64(sqrt(2.0) / B_m) * sqrt(Float64(F * Float64(B_m + Float64(C + Float64(0.5 * Float64((C ^ 2.0) / B_m)))))))); else tmp = Float64(-Float64(sqrt(Float64(F / B_m)) * sqrt(2.0))); end return tmp end
B_m = N[Abs[B], $MachinePrecision]
code[A_, B$95$m_, C_, F_] := Block[{t$95$0 = N[(B$95$m * B$95$m + N[(A * N[(C * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(t$95$0 * N[(F * 2.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[((-N[Sqrt[N[(t$95$1 * N[(A + A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision]}, If[LessEqual[B$95$m, 1.7e-212], t$95$2, If[LessEqual[B$95$m, 1.6e-198], N[((-N[Sqrt[N[(t$95$1 * N[(2.0 * C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], If[LessEqual[B$95$m, 3.05e-111], t$95$2, If[LessEqual[B$95$m, 3.6e+132], (-N[(N[(B$95$m * N[(N[Sqrt[N[(2.0 * F), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(A + N[Sqrt[A ^ 2 + B$95$m ^ 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision]), If[LessEqual[B$95$m, 3e+271], N[(-1.0 * N[(N[(N[Sqrt[2.0], $MachinePrecision] / B$95$m), $MachinePrecision] * N[Sqrt[N[(F * N[(B$95$m + N[(C + N[(0.5 * N[(N[Power[C, 2.0], $MachinePrecision] / B$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], (-N[(N[Sqrt[N[(F / B$95$m), $MachinePrecision]], $MachinePrecision] * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision])]]]]]]]]
\begin{array}{l}
B_m = \left|B\right|
\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(B\_m, B\_m, A \cdot \left(C \cdot -4\right)\right)\\
t_1 := t\_0 \cdot \left(F \cdot 2\right)\\
t_2 := \frac{-\sqrt{t\_1 \cdot \left(A + A\right)}}{t\_0}\\
\mathbf{if}\;B\_m \leq 1.7 \cdot 10^{-212}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;B\_m \leq 1.6 \cdot 10^{-198}:\\
\;\;\;\;\frac{-\sqrt{t\_1 \cdot \left(2 \cdot C\right)}}{t\_0}\\
\mathbf{elif}\;B\_m \leq 3.05 \cdot 10^{-111}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;B\_m \leq 3.6 \cdot 10^{+132}:\\
\;\;\;\;-\frac{B\_m \cdot \left(\sqrt{2 \cdot F} \cdot \sqrt{A + \mathsf{hypot}\left(A, B\_m\right)}\right)}{t\_0}\\
\mathbf{elif}\;B\_m \leq 3 \cdot 10^{+271}:\\
\;\;\;\;-1 \cdot \left(\frac{\sqrt{2}}{B\_m} \cdot \sqrt{F \cdot \left(B\_m + \left(C + 0.5 \cdot \frac{{C}^{2}}{B\_m}\right)\right)}\right)\\
\mathbf{else}:\\
\;\;\;\;-\sqrt{\frac{F}{B\_m}} \cdot \sqrt{2}\\
\end{array}
\end{array}
if B < 1.69999999999999999e-212 or 1.59999999999999997e-198 < B < 3.0500000000000001e-111Initial program 20.8%
Simplified27.8%
Taylor expanded in C around -inf 21.0%
if 1.69999999999999999e-212 < B < 1.59999999999999997e-198Initial program 35.2%
Simplified39.5%
Taylor expanded in A around -inf 79.4%
if 3.0500000000000001e-111 < B < 3.60000000000000016e132Initial program 35.6%
Simplified42.6%
Taylor expanded in C around 0 33.7%
distribute-frac-neg33.7%
associate-*l*33.6%
pow1/233.6%
pow1/233.9%
pow-prod-down33.9%
unpow233.9%
unpow233.9%
hypot-define34.7%
Applied egg-rr34.7%
unpow1/234.4%
associate-*r*34.4%
sqrt-prod36.7%
Applied egg-rr36.7%
if 3.60000000000000016e132 < B < 3e271Initial program 15.1%
Simplified15.1%
Taylor expanded in B around inf 15.1%
Taylor expanded in A around 0 74.1%
if 3e271 < B Initial program 0.0%
Simplified0.0%
Taylor expanded in C around 0 0.0%
distribute-frac-neg0.0%
associate-*l*0.0%
pow1/20.0%
pow1/20.0%
pow-prod-down0.0%
unpow20.0%
unpow20.0%
hypot-define0.0%
Applied egg-rr0.0%
Taylor expanded in A around 0 62.9%
B_m = (fabs.f64 B)
(FPCore (A B_m C F)
:precision binary64
(let* ((t_0 (fma B_m B_m (* A (* C -4.0))))
(t_1 (* t_0 (* F 2.0)))
(t_2 (/ (- (sqrt (* t_1 (+ A A)))) t_0)))
(if (<= B_m 2e-212)
t_2
(if (<= B_m 1.65e-198)
(/ (- (sqrt (* t_1 (* 2.0 C)))) t_0)
(if (<= B_m 6.5e-57)
t_2
(if (<= B_m 2.8e+271)
(*
-1.0
(*
(/ (sqrt 2.0) B_m)
(sqrt (* F (+ B_m (+ C (* 0.5 (/ (pow C 2.0) B_m))))))))
(- (* (sqrt (/ F B_m)) (sqrt 2.0)))))))))B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
double t_0 = fma(B_m, B_m, (A * (C * -4.0)));
double t_1 = t_0 * (F * 2.0);
double t_2 = -sqrt((t_1 * (A + A))) / t_0;
double tmp;
if (B_m <= 2e-212) {
tmp = t_2;
} else if (B_m <= 1.65e-198) {
tmp = -sqrt((t_1 * (2.0 * C))) / t_0;
} else if (B_m <= 6.5e-57) {
tmp = t_2;
} else if (B_m <= 2.8e+271) {
tmp = -1.0 * ((sqrt(2.0) / B_m) * sqrt((F * (B_m + (C + (0.5 * (pow(C, 2.0) / B_m)))))));
} else {
tmp = -(sqrt((F / B_m)) * sqrt(2.0));
}
return tmp;
}
B_m = abs(B) function code(A, B_m, C, F) t_0 = fma(B_m, B_m, Float64(A * Float64(C * -4.0))) t_1 = Float64(t_0 * Float64(F * 2.0)) t_2 = Float64(Float64(-sqrt(Float64(t_1 * Float64(A + A)))) / t_0) tmp = 0.0 if (B_m <= 2e-212) tmp = t_2; elseif (B_m <= 1.65e-198) tmp = Float64(Float64(-sqrt(Float64(t_1 * Float64(2.0 * C)))) / t_0); elseif (B_m <= 6.5e-57) tmp = t_2; elseif (B_m <= 2.8e+271) tmp = Float64(-1.0 * Float64(Float64(sqrt(2.0) / B_m) * sqrt(Float64(F * Float64(B_m + Float64(C + Float64(0.5 * Float64((C ^ 2.0) / B_m)))))))); else tmp = Float64(-Float64(sqrt(Float64(F / B_m)) * sqrt(2.0))); end return tmp end
B_m = N[Abs[B], $MachinePrecision]
code[A_, B$95$m_, C_, F_] := Block[{t$95$0 = N[(B$95$m * B$95$m + N[(A * N[(C * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(t$95$0 * N[(F * 2.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[((-N[Sqrt[N[(t$95$1 * N[(A + A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision]}, If[LessEqual[B$95$m, 2e-212], t$95$2, If[LessEqual[B$95$m, 1.65e-198], N[((-N[Sqrt[N[(t$95$1 * N[(2.0 * C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], If[LessEqual[B$95$m, 6.5e-57], t$95$2, If[LessEqual[B$95$m, 2.8e+271], N[(-1.0 * N[(N[(N[Sqrt[2.0], $MachinePrecision] / B$95$m), $MachinePrecision] * N[Sqrt[N[(F * N[(B$95$m + N[(C + N[(0.5 * N[(N[Power[C, 2.0], $MachinePrecision] / B$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], (-N[(N[Sqrt[N[(F / B$95$m), $MachinePrecision]], $MachinePrecision] * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision])]]]]]]]
\begin{array}{l}
B_m = \left|B\right|
\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(B\_m, B\_m, A \cdot \left(C \cdot -4\right)\right)\\
t_1 := t\_0 \cdot \left(F \cdot 2\right)\\
t_2 := \frac{-\sqrt{t\_1 \cdot \left(A + A\right)}}{t\_0}\\
\mathbf{if}\;B\_m \leq 2 \cdot 10^{-212}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;B\_m \leq 1.65 \cdot 10^{-198}:\\
\;\;\;\;\frac{-\sqrt{t\_1 \cdot \left(2 \cdot C\right)}}{t\_0}\\
\mathbf{elif}\;B\_m \leq 6.5 \cdot 10^{-57}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;B\_m \leq 2.8 \cdot 10^{+271}:\\
\;\;\;\;-1 \cdot \left(\frac{\sqrt{2}}{B\_m} \cdot \sqrt{F \cdot \left(B\_m + \left(C + 0.5 \cdot \frac{{C}^{2}}{B\_m}\right)\right)}\right)\\
\mathbf{else}:\\
\;\;\;\;-\sqrt{\frac{F}{B\_m}} \cdot \sqrt{2}\\
\end{array}
\end{array}
if B < 1.99999999999999991e-212 or 1.65e-198 < B < 6.49999999999999992e-57Initial program 23.2%
Simplified30.6%
Taylor expanded in C around -inf 21.3%
if 1.99999999999999991e-212 < B < 1.65e-198Initial program 35.2%
Simplified39.5%
Taylor expanded in A around -inf 79.4%
if 6.49999999999999992e-57 < B < 2.7999999999999999e271Initial program 26.3%
Simplified29.6%
Taylor expanded in B around inf 23.3%
Taylor expanded in A around 0 48.0%
if 2.7999999999999999e271 < B Initial program 0.0%
Simplified0.0%
Taylor expanded in C around 0 0.0%
distribute-frac-neg0.0%
associate-*l*0.0%
pow1/20.0%
pow1/20.0%
pow-prod-down0.0%
unpow20.0%
unpow20.0%
hypot-define0.0%
Applied egg-rr0.0%
Taylor expanded in A around 0 62.9%
B_m = (fabs.f64 B)
(FPCore (A B_m C F)
:precision binary64
(let* ((t_0 (fma B_m B_m (* A (* C -4.0)))))
(if (<= B_m 1.05e-57)
(/ (- (sqrt (* (* t_0 (* F 2.0)) (* 2.0 C)))) t_0)
(if (<= B_m 1.9e+269)
(*
-1.0
(*
(/ (sqrt 2.0) B_m)
(sqrt (* F (+ B_m (+ C (* 0.5 (/ (pow C 2.0) B_m))))))))
(- (* (sqrt (/ F B_m)) (sqrt 2.0)))))))B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
double t_0 = fma(B_m, B_m, (A * (C * -4.0)));
double tmp;
if (B_m <= 1.05e-57) {
tmp = -sqrt(((t_0 * (F * 2.0)) * (2.0 * C))) / t_0;
} else if (B_m <= 1.9e+269) {
tmp = -1.0 * ((sqrt(2.0) / B_m) * sqrt((F * (B_m + (C + (0.5 * (pow(C, 2.0) / B_m)))))));
} else {
tmp = -(sqrt((F / B_m)) * sqrt(2.0));
}
return tmp;
}
B_m = abs(B) function code(A, B_m, C, F) t_0 = fma(B_m, B_m, Float64(A * Float64(C * -4.0))) tmp = 0.0 if (B_m <= 1.05e-57) tmp = Float64(Float64(-sqrt(Float64(Float64(t_0 * Float64(F * 2.0)) * Float64(2.0 * C)))) / t_0); elseif (B_m <= 1.9e+269) tmp = Float64(-1.0 * Float64(Float64(sqrt(2.0) / B_m) * sqrt(Float64(F * Float64(B_m + Float64(C + Float64(0.5 * Float64((C ^ 2.0) / B_m)))))))); else tmp = Float64(-Float64(sqrt(Float64(F / B_m)) * sqrt(2.0))); end return tmp end
B_m = N[Abs[B], $MachinePrecision]
code[A_, B$95$m_, C_, F_] := Block[{t$95$0 = N[(B$95$m * B$95$m + N[(A * N[(C * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[B$95$m, 1.05e-57], N[((-N[Sqrt[N[(N[(t$95$0 * N[(F * 2.0), $MachinePrecision]), $MachinePrecision] * N[(2.0 * C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], If[LessEqual[B$95$m, 1.9e+269], N[(-1.0 * N[(N[(N[Sqrt[2.0], $MachinePrecision] / B$95$m), $MachinePrecision] * N[Sqrt[N[(F * N[(B$95$m + N[(C + N[(0.5 * N[(N[Power[C, 2.0], $MachinePrecision] / B$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], (-N[(N[Sqrt[N[(F / B$95$m), $MachinePrecision]], $MachinePrecision] * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision])]]]
\begin{array}{l}
B_m = \left|B\right|
\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(B\_m, B\_m, A \cdot \left(C \cdot -4\right)\right)\\
\mathbf{if}\;B\_m \leq 1.05 \cdot 10^{-57}:\\
\;\;\;\;\frac{-\sqrt{\left(t\_0 \cdot \left(F \cdot 2\right)\right) \cdot \left(2 \cdot C\right)}}{t\_0}\\
\mathbf{elif}\;B\_m \leq 1.9 \cdot 10^{+269}:\\
\;\;\;\;-1 \cdot \left(\frac{\sqrt{2}}{B\_m} \cdot \sqrt{F \cdot \left(B\_m + \left(C + 0.5 \cdot \frac{{C}^{2}}{B\_m}\right)\right)}\right)\\
\mathbf{else}:\\
\;\;\;\;-\sqrt{\frac{F}{B\_m}} \cdot \sqrt{2}\\
\end{array}
\end{array}
if B < 1.05e-57Initial program 23.5%
Simplified30.9%
Taylor expanded in A around -inf 18.1%
if 1.05e-57 < B < 1.89999999999999991e269Initial program 26.3%
Simplified29.6%
Taylor expanded in B around inf 23.3%
Taylor expanded in A around 0 48.0%
if 1.89999999999999991e269 < B Initial program 0.0%
Simplified0.0%
Taylor expanded in C around 0 0.0%
distribute-frac-neg0.0%
associate-*l*0.0%
pow1/20.0%
pow1/20.0%
pow-prod-down0.0%
unpow20.0%
unpow20.0%
hypot-define0.0%
Applied egg-rr0.0%
Taylor expanded in A around 0 62.9%
B_m = (fabs.f64 B)
(FPCore (A B_m C F)
:precision binary64
(if (<= F 1.45e-56)
(*
-1.0
(*
(/ (sqrt 2.0) B_m)
(sqrt (* F (+ A (+ B_m (* 0.5 (/ (pow A 2.0) B_m))))))))
(- (* (sqrt (/ F B_m)) (sqrt 2.0)))))B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
double tmp;
if (F <= 1.45e-56) {
tmp = -1.0 * ((sqrt(2.0) / B_m) * sqrt((F * (A + (B_m + (0.5 * (pow(A, 2.0) / B_m)))))));
} else {
tmp = -(sqrt((F / B_m)) * sqrt(2.0));
}
return tmp;
}
B_m = abs(B)
real(8) function code(a, b_m, c, f)
real(8), intent (in) :: a
real(8), intent (in) :: b_m
real(8), intent (in) :: c
real(8), intent (in) :: f
real(8) :: tmp
if (f <= 1.45d-56) then
tmp = (-1.0d0) * ((sqrt(2.0d0) / b_m) * sqrt((f * (a + (b_m + (0.5d0 * ((a ** 2.0d0) / b_m)))))))
else
tmp = -(sqrt((f / b_m)) * sqrt(2.0d0))
end if
code = tmp
end function
B_m = Math.abs(B);
public static double code(double A, double B_m, double C, double F) {
double tmp;
if (F <= 1.45e-56) {
tmp = -1.0 * ((Math.sqrt(2.0) / B_m) * Math.sqrt((F * (A + (B_m + (0.5 * (Math.pow(A, 2.0) / B_m)))))));
} else {
tmp = -(Math.sqrt((F / B_m)) * Math.sqrt(2.0));
}
return tmp;
}
B_m = math.fabs(B) def code(A, B_m, C, F): tmp = 0 if F <= 1.45e-56: tmp = -1.0 * ((math.sqrt(2.0) / B_m) * math.sqrt((F * (A + (B_m + (0.5 * (math.pow(A, 2.0) / B_m))))))) else: tmp = -(math.sqrt((F / B_m)) * math.sqrt(2.0)) return tmp
B_m = abs(B) function code(A, B_m, C, F) tmp = 0.0 if (F <= 1.45e-56) tmp = Float64(-1.0 * Float64(Float64(sqrt(2.0) / B_m) * sqrt(Float64(F * Float64(A + Float64(B_m + Float64(0.5 * Float64((A ^ 2.0) / B_m)))))))); else tmp = Float64(-Float64(sqrt(Float64(F / B_m)) * sqrt(2.0))); end return tmp end
B_m = abs(B); function tmp_2 = code(A, B_m, C, F) tmp = 0.0; if (F <= 1.45e-56) tmp = -1.0 * ((sqrt(2.0) / B_m) * sqrt((F * (A + (B_m + (0.5 * ((A ^ 2.0) / B_m))))))); else tmp = -(sqrt((F / B_m)) * sqrt(2.0)); end tmp_2 = tmp; end
B_m = N[Abs[B], $MachinePrecision] code[A_, B$95$m_, C_, F_] := If[LessEqual[F, 1.45e-56], N[(-1.0 * N[(N[(N[Sqrt[2.0], $MachinePrecision] / B$95$m), $MachinePrecision] * N[Sqrt[N[(F * N[(A + N[(B$95$m + N[(0.5 * N[(N[Power[A, 2.0], $MachinePrecision] / B$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], (-N[(N[Sqrt[N[(F / B$95$m), $MachinePrecision]], $MachinePrecision] * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision])]
\begin{array}{l}
B_m = \left|B\right|
\\
\begin{array}{l}
\mathbf{if}\;F \leq 1.45 \cdot 10^{-56}:\\
\;\;\;\;-1 \cdot \left(\frac{\sqrt{2}}{B\_m} \cdot \sqrt{F \cdot \left(A + \left(B\_m + 0.5 \cdot \frac{{A}^{2}}{B\_m}\right)\right)}\right)\\
\mathbf{else}:\\
\;\;\;\;-\sqrt{\frac{F}{B\_m}} \cdot \sqrt{2}\\
\end{array}
\end{array}
if F < 1.44999999999999996e-56Initial program 25.6%
Simplified35.2%
Taylor expanded in B around inf 8.2%
Taylor expanded in C around 0 13.5%
if 1.44999999999999996e-56 < F Initial program 21.3%
Simplified24.5%
Taylor expanded in C around 0 10.8%
distribute-frac-neg10.8%
associate-*l*10.8%
pow1/210.8%
pow1/210.8%
pow-prod-down10.8%
unpow210.8%
unpow210.8%
hypot-define11.4%
Applied egg-rr11.4%
Taylor expanded in A around 0 16.7%
B_m = (fabs.f64 B)
(FPCore (A B_m C F)
:precision binary64
(if (<= F 3.8e-75)
(*
-1.0
(*
(/ (sqrt 2.0) B_m)
(sqrt (* F (+ B_m (+ C (* 0.5 (/ (pow C 2.0) B_m))))))))
(- (* (sqrt (/ F B_m)) (sqrt 2.0)))))B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
double tmp;
if (F <= 3.8e-75) {
tmp = -1.0 * ((sqrt(2.0) / B_m) * sqrt((F * (B_m + (C + (0.5 * (pow(C, 2.0) / B_m)))))));
} else {
tmp = -(sqrt((F / B_m)) * sqrt(2.0));
}
return tmp;
}
B_m = abs(B)
real(8) function code(a, b_m, c, f)
real(8), intent (in) :: a
real(8), intent (in) :: b_m
real(8), intent (in) :: c
real(8), intent (in) :: f
real(8) :: tmp
if (f <= 3.8d-75) then
tmp = (-1.0d0) * ((sqrt(2.0d0) / b_m) * sqrt((f * (b_m + (c + (0.5d0 * ((c ** 2.0d0) / b_m)))))))
else
tmp = -(sqrt((f / b_m)) * sqrt(2.0d0))
end if
code = tmp
end function
B_m = Math.abs(B);
public static double code(double A, double B_m, double C, double F) {
double tmp;
if (F <= 3.8e-75) {
tmp = -1.0 * ((Math.sqrt(2.0) / B_m) * Math.sqrt((F * (B_m + (C + (0.5 * (Math.pow(C, 2.0) / B_m)))))));
} else {
tmp = -(Math.sqrt((F / B_m)) * Math.sqrt(2.0));
}
return tmp;
}
B_m = math.fabs(B) def code(A, B_m, C, F): tmp = 0 if F <= 3.8e-75: tmp = -1.0 * ((math.sqrt(2.0) / B_m) * math.sqrt((F * (B_m + (C + (0.5 * (math.pow(C, 2.0) / B_m))))))) else: tmp = -(math.sqrt((F / B_m)) * math.sqrt(2.0)) return tmp
B_m = abs(B) function code(A, B_m, C, F) tmp = 0.0 if (F <= 3.8e-75) tmp = Float64(-1.0 * Float64(Float64(sqrt(2.0) / B_m) * sqrt(Float64(F * Float64(B_m + Float64(C + Float64(0.5 * Float64((C ^ 2.0) / B_m)))))))); else tmp = Float64(-Float64(sqrt(Float64(F / B_m)) * sqrt(2.0))); end return tmp end
B_m = abs(B); function tmp_2 = code(A, B_m, C, F) tmp = 0.0; if (F <= 3.8e-75) tmp = -1.0 * ((sqrt(2.0) / B_m) * sqrt((F * (B_m + (C + (0.5 * ((C ^ 2.0) / B_m))))))); else tmp = -(sqrt((F / B_m)) * sqrt(2.0)); end tmp_2 = tmp; end
B_m = N[Abs[B], $MachinePrecision] code[A_, B$95$m_, C_, F_] := If[LessEqual[F, 3.8e-75], N[(-1.0 * N[(N[(N[Sqrt[2.0], $MachinePrecision] / B$95$m), $MachinePrecision] * N[Sqrt[N[(F * N[(B$95$m + N[(C + N[(0.5 * N[(N[Power[C, 2.0], $MachinePrecision] / B$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], (-N[(N[Sqrt[N[(F / B$95$m), $MachinePrecision]], $MachinePrecision] * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision])]
\begin{array}{l}
B_m = \left|B\right|
\\
\begin{array}{l}
\mathbf{if}\;F \leq 3.8 \cdot 10^{-75}:\\
\;\;\;\;-1 \cdot \left(\frac{\sqrt{2}}{B\_m} \cdot \sqrt{F \cdot \left(B\_m + \left(C + 0.5 \cdot \frac{{C}^{2}}{B\_m}\right)\right)}\right)\\
\mathbf{else}:\\
\;\;\;\;-\sqrt{\frac{F}{B\_m}} \cdot \sqrt{2}\\
\end{array}
\end{array}
if F < 3.79999999999999994e-75Initial program 27.1%
Simplified35.4%
Taylor expanded in B around inf 8.6%
Taylor expanded in A around 0 16.7%
if 3.79999999999999994e-75 < F Initial program 20.4%
Simplified24.9%
Taylor expanded in C around 0 10.4%
distribute-frac-neg10.4%
associate-*l*10.3%
pow1/210.3%
pow1/210.3%
pow-prod-down10.4%
unpow210.4%
unpow210.4%
hypot-define11.0%
Applied egg-rr11.0%
Taylor expanded in A around 0 16.3%
B_m = (fabs.f64 B) (FPCore (A B_m C F) :precision binary64 (if (<= B_m 3.45e+146) (- (/ (* B_m (pow (* 2.0 (* F (+ A (hypot A B_m)))) 0.5)) (pow B_m 2.0))) (- (* (sqrt (/ F B_m)) (sqrt 2.0)))))
B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
double tmp;
if (B_m <= 3.45e+146) {
tmp = -((B_m * pow((2.0 * (F * (A + hypot(A, B_m)))), 0.5)) / pow(B_m, 2.0));
} else {
tmp = -(sqrt((F / B_m)) * sqrt(2.0));
}
return tmp;
}
B_m = Math.abs(B);
public static double code(double A, double B_m, double C, double F) {
double tmp;
if (B_m <= 3.45e+146) {
tmp = -((B_m * Math.pow((2.0 * (F * (A + Math.hypot(A, B_m)))), 0.5)) / Math.pow(B_m, 2.0));
} else {
tmp = -(Math.sqrt((F / B_m)) * Math.sqrt(2.0));
}
return tmp;
}
B_m = math.fabs(B) def code(A, B_m, C, F): tmp = 0 if B_m <= 3.45e+146: tmp = -((B_m * math.pow((2.0 * (F * (A + math.hypot(A, B_m)))), 0.5)) / math.pow(B_m, 2.0)) else: tmp = -(math.sqrt((F / B_m)) * math.sqrt(2.0)) return tmp
B_m = abs(B) function code(A, B_m, C, F) tmp = 0.0 if (B_m <= 3.45e+146) tmp = Float64(-Float64(Float64(B_m * (Float64(2.0 * Float64(F * Float64(A + hypot(A, B_m)))) ^ 0.5)) / (B_m ^ 2.0))); else tmp = Float64(-Float64(sqrt(Float64(F / B_m)) * sqrt(2.0))); end return tmp end
B_m = abs(B); function tmp_2 = code(A, B_m, C, F) tmp = 0.0; if (B_m <= 3.45e+146) tmp = -((B_m * ((2.0 * (F * (A + hypot(A, B_m)))) ^ 0.5)) / (B_m ^ 2.0)); else tmp = -(sqrt((F / B_m)) * sqrt(2.0)); end tmp_2 = tmp; end
B_m = N[Abs[B], $MachinePrecision] code[A_, B$95$m_, C_, F_] := If[LessEqual[B$95$m, 3.45e+146], (-N[(N[(B$95$m * N[Power[N[(2.0 * N[(F * N[(A + N[Sqrt[A ^ 2 + B$95$m ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.5], $MachinePrecision]), $MachinePrecision] / N[Power[B$95$m, 2.0], $MachinePrecision]), $MachinePrecision]), (-N[(N[Sqrt[N[(F / B$95$m), $MachinePrecision]], $MachinePrecision] * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision])]
\begin{array}{l}
B_m = \left|B\right|
\\
\begin{array}{l}
\mathbf{if}\;B\_m \leq 3.45 \cdot 10^{+146}:\\
\;\;\;\;-\frac{B\_m \cdot {\left(2 \cdot \left(F \cdot \left(A + \mathsf{hypot}\left(A, B\_m\right)\right)\right)\right)}^{0.5}}{{B\_m}^{2}}\\
\mathbf{else}:\\
\;\;\;\;-\sqrt{\frac{F}{B\_m}} \cdot \sqrt{2}\\
\end{array}
\end{array}
if B < 3.44999999999999978e146Initial program 25.6%
Simplified32.5%
Taylor expanded in C around 0 10.8%
distribute-frac-neg10.8%
associate-*l*10.7%
pow1/210.7%
pow1/210.8%
pow-prod-down10.8%
unpow210.8%
unpow210.8%
hypot-define11.7%
Applied egg-rr11.7%
Taylor expanded in B around inf 11.1%
if 3.44999999999999978e146 < B Initial program 3.7%
Simplified3.7%
Taylor expanded in C around 0 3.6%
distribute-frac-neg3.6%
associate-*l*3.6%
pow1/23.6%
pow1/23.6%
pow-prod-down3.7%
unpow23.7%
unpow23.7%
hypot-define5.5%
Applied egg-rr5.5%
Taylor expanded in A around 0 49.9%
B_m = (fabs.f64 B) (FPCore (A B_m C F) :precision binary64 (if (<= B_m 4.4e+145) (- (/ (* B_m (pow (* 2.0 (* F B_m)) 0.5)) (fma B_m B_m (* A (* C -4.0))))) (- (* (sqrt (/ F B_m)) (sqrt 2.0)))))
B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
double tmp;
if (B_m <= 4.4e+145) {
tmp = -((B_m * pow((2.0 * (F * B_m)), 0.5)) / fma(B_m, B_m, (A * (C * -4.0))));
} else {
tmp = -(sqrt((F / B_m)) * sqrt(2.0));
}
return tmp;
}
B_m = abs(B) function code(A, B_m, C, F) tmp = 0.0 if (B_m <= 4.4e+145) tmp = Float64(-Float64(Float64(B_m * (Float64(2.0 * Float64(F * B_m)) ^ 0.5)) / fma(B_m, B_m, Float64(A * Float64(C * -4.0))))); else tmp = Float64(-Float64(sqrt(Float64(F / B_m)) * sqrt(2.0))); end return tmp end
B_m = N[Abs[B], $MachinePrecision] code[A_, B$95$m_, C_, F_] := If[LessEqual[B$95$m, 4.4e+145], (-N[(N[(B$95$m * N[Power[N[(2.0 * N[(F * B$95$m), $MachinePrecision]), $MachinePrecision], 0.5], $MachinePrecision]), $MachinePrecision] / N[(B$95$m * B$95$m + N[(A * N[(C * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), (-N[(N[Sqrt[N[(F / B$95$m), $MachinePrecision]], $MachinePrecision] * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision])]
\begin{array}{l}
B_m = \left|B\right|
\\
\begin{array}{l}
\mathbf{if}\;B\_m \leq 4.4 \cdot 10^{+145}:\\
\;\;\;\;-\frac{B\_m \cdot {\left(2 \cdot \left(F \cdot B\_m\right)\right)}^{0.5}}{\mathsf{fma}\left(B\_m, B\_m, A \cdot \left(C \cdot -4\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;-\sqrt{\frac{F}{B\_m}} \cdot \sqrt{2}\\
\end{array}
\end{array}
if B < 4.40000000000000017e145Initial program 25.6%
Simplified32.5%
Taylor expanded in C around 0 10.8%
distribute-frac-neg10.8%
associate-*l*10.7%
pow1/210.7%
pow1/210.8%
pow-prod-down10.8%
unpow210.8%
unpow210.8%
hypot-define11.7%
Applied egg-rr11.7%
Taylor expanded in A around 0 9.9%
if 4.40000000000000017e145 < B Initial program 3.7%
Simplified3.7%
Taylor expanded in C around 0 3.6%
distribute-frac-neg3.6%
associate-*l*3.6%
pow1/23.6%
pow1/23.6%
pow-prod-down3.7%
unpow23.7%
unpow23.7%
hypot-define5.5%
Applied egg-rr5.5%
Taylor expanded in A around 0 49.9%
B_m = (fabs.f64 B) (FPCore (A B_m C F) :precision binary64 (- (* (sqrt (/ F B_m)) (sqrt 2.0))))
B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
return -(sqrt((F / B_m)) * sqrt(2.0));
}
B_m = abs(B)
real(8) function code(a, b_m, c, f)
real(8), intent (in) :: a
real(8), intent (in) :: b_m
real(8), intent (in) :: c
real(8), intent (in) :: f
code = -(sqrt((f / b_m)) * sqrt(2.0d0))
end function
B_m = Math.abs(B);
public static double code(double A, double B_m, double C, double F) {
return -(Math.sqrt((F / B_m)) * Math.sqrt(2.0));
}
B_m = math.fabs(B) def code(A, B_m, C, F): return -(math.sqrt((F / B_m)) * math.sqrt(2.0))
B_m = abs(B) function code(A, B_m, C, F) return Float64(-Float64(sqrt(Float64(F / B_m)) * sqrt(2.0))) end
B_m = abs(B); function tmp = code(A, B_m, C, F) tmp = -(sqrt((F / B_m)) * sqrt(2.0)); end
B_m = N[Abs[B], $MachinePrecision] code[A_, B$95$m_, C_, F_] := (-N[(N[Sqrt[N[(F / B$95$m), $MachinePrecision]], $MachinePrecision] * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision])
\begin{array}{l}
B_m = \left|B\right|
\\
-\sqrt{\frac{F}{B\_m}} \cdot \sqrt{2}
\end{array}
Initial program 23.2%
Simplified29.4%
Taylor expanded in C around 0 10.0%
distribute-frac-neg10.0%
associate-*l*10.0%
pow1/210.0%
pow1/210.0%
pow-prod-down10.1%
unpow210.1%
unpow210.1%
hypot-define11.0%
Applied egg-rr11.0%
Taylor expanded in A around 0 13.2%
B_m = (fabs.f64 B) (FPCore (A B_m C F) :precision binary64 0.0)
B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
return 0.0;
}
B_m = abs(B)
real(8) function code(a, b_m, c, f)
real(8), intent (in) :: a
real(8), intent (in) :: b_m
real(8), intent (in) :: c
real(8), intent (in) :: f
code = 0.0d0
end function
B_m = Math.abs(B);
public static double code(double A, double B_m, double C, double F) {
return 0.0;
}
B_m = math.fabs(B) def code(A, B_m, C, F): return 0.0
B_m = abs(B) function code(A, B_m, C, F) return 0.0 end
B_m = abs(B); function tmp = code(A, B_m, C, F) tmp = 0.0; end
B_m = N[Abs[B], $MachinePrecision] code[A_, B$95$m_, C_, F_] := 0.0
\begin{array}{l}
B_m = \left|B\right|
\\
0
\end{array}
Initial program 23.2%
Simplified29.4%
Taylor expanded in A around -inf 2.0%
Taylor expanded in A around inf 3.7%
herbie shell --seed 2024034 -o generate:simplify
(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))))