
(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 11 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 (/ (sqrt 2.0) B_m)))
(if (<= (pow B_m 2.0) 2e+92)
(/
(*
(sqrt (* 2.0 (* F (fma B_m B_m (* (* C A) -4.0)))))
(- (sqrt (+ (+ C A) (hypot (- A C) B_m)))))
(- (pow B_m 2.0) (* C (* A 4.0))))
(if (<= (pow B_m 2.0) 5e+108)
(* t_0 (- (cbrt (pow (* F (* -0.5 (/ (pow B_m 2.0) A))) 1.5))))
(* t_0 (* (sqrt F) (- (sqrt (+ C (hypot B_m C))))))))))B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
double t_0 = sqrt(2.0) / B_m;
double tmp;
if (pow(B_m, 2.0) <= 2e+92) {
tmp = (sqrt((2.0 * (F * fma(B_m, B_m, ((C * A) * -4.0))))) * -sqrt(((C + A) + hypot((A - C), B_m)))) / (pow(B_m, 2.0) - (C * (A * 4.0)));
} else if (pow(B_m, 2.0) <= 5e+108) {
tmp = t_0 * -cbrt(pow((F * (-0.5 * (pow(B_m, 2.0) / A))), 1.5));
} else {
tmp = t_0 * (sqrt(F) * -sqrt((C + hypot(B_m, C))));
}
return tmp;
}
B_m = abs(B) function code(A, B_m, C, F) t_0 = Float64(sqrt(2.0) / B_m) tmp = 0.0 if ((B_m ^ 2.0) <= 2e+92) tmp = Float64(Float64(sqrt(Float64(2.0 * Float64(F * fma(B_m, B_m, Float64(Float64(C * A) * -4.0))))) * Float64(-sqrt(Float64(Float64(C + A) + hypot(Float64(A - C), B_m))))) / Float64((B_m ^ 2.0) - Float64(C * Float64(A * 4.0)))); elseif ((B_m ^ 2.0) <= 5e+108) tmp = Float64(t_0 * Float64(-cbrt((Float64(F * Float64(-0.5 * Float64((B_m ^ 2.0) / A))) ^ 1.5)))); else tmp = Float64(t_0 * Float64(sqrt(F) * Float64(-sqrt(Float64(C + hypot(B_m, C)))))); end return tmp end
B_m = N[Abs[B], $MachinePrecision]
code[A_, B$95$m_, C_, F_] := Block[{t$95$0 = N[(N[Sqrt[2.0], $MachinePrecision] / B$95$m), $MachinePrecision]}, If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 2e+92], N[(N[(N[Sqrt[N[(2.0 * N[(F * N[(B$95$m * B$95$m + N[(N[(C * A), $MachinePrecision] * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-N[Sqrt[N[(N[(C + A), $MachinePrecision] + N[Sqrt[N[(A - C), $MachinePrecision] ^ 2 + B$95$m ^ 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision] / N[(N[Power[B$95$m, 2.0], $MachinePrecision] - N[(C * N[(A * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 5e+108], N[(t$95$0 * (-N[Power[N[Power[N[(F * N[(-0.5 * N[(N[Power[B$95$m, 2.0], $MachinePrecision] / A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1.5], $MachinePrecision], 1/3], $MachinePrecision])), $MachinePrecision], N[(t$95$0 * N[(N[Sqrt[F], $MachinePrecision] * (-N[Sqrt[N[(C + N[Sqrt[B$95$m ^ 2 + C ^ 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
B_m = \left|B\right|
\\
\begin{array}{l}
t_0 := \frac{\sqrt{2}}{B_m}\\
\mathbf{if}\;{B_m}^{2} \leq 2 \cdot 10^{+92}:\\
\;\;\;\;\frac{\sqrt{2 \cdot \left(F \cdot \mathsf{fma}\left(B_m, B_m, \left(C \cdot A\right) \cdot -4\right)\right)} \cdot \left(-\sqrt{\left(C + A\right) + \mathsf{hypot}\left(A - C, B_m\right)}\right)}{{B_m}^{2} - C \cdot \left(A \cdot 4\right)}\\
\mathbf{elif}\;{B_m}^{2} \leq 5 \cdot 10^{+108}:\\
\;\;\;\;t_0 \cdot \left(-\sqrt[3]{{\left(F \cdot \left(-0.5 \cdot \frac{{B_m}^{2}}{A}\right)\right)}^{1.5}}\right)\\
\mathbf{else}:\\
\;\;\;\;t_0 \cdot \left(\sqrt{F} \cdot \left(-\sqrt{C + \mathsf{hypot}\left(B_m, C\right)}\right)\right)\\
\end{array}
\end{array}
if (pow.f64 B 2) < 2.0000000000000001e92Initial program 28.0%
sqrt-prod29.9%
associate-*r*29.9%
associate-*l*29.9%
associate-+l+30.7%
unpow230.7%
unpow230.7%
hypot-def45.1%
Applied egg-rr45.1%
associate-*l*45.1%
*-commutative45.1%
unpow245.1%
fma-neg45.1%
distribute-lft-neg-in45.1%
metadata-eval45.1%
*-commutative45.1%
*-commutative45.1%
associate-+r+43.5%
+-commutative43.5%
Simplified43.5%
if 2.0000000000000001e92 < (pow.f64 B 2) < 4.99999999999999991e108Initial program 2.2%
Taylor expanded in C around 0 2.5%
mul-1-neg2.5%
distribute-rgt-neg-in2.5%
+-commutative2.5%
unpow22.5%
unpow22.5%
hypot-def4.2%
Simplified4.2%
Taylor expanded in A around -inf 33.9%
associate-/l*50.1%
Simplified50.1%
add-cbrt-cube50.1%
pow1/345.9%
add-sqr-sqrt45.9%
pow145.9%
pow1/246.4%
pow-prod-up46.4%
associate-/r/46.4%
metadata-eval46.4%
Applied egg-rr46.4%
unpow1/350.5%
associate-*r*50.5%
Simplified50.5%
if 4.99999999999999991e108 < (pow.f64 B 2) Initial program 11.2%
Taylor expanded in A around 0 14.4%
mul-1-neg14.4%
*-commutative14.4%
distribute-rgt-neg-in14.4%
unpow214.4%
unpow214.4%
hypot-def26.9%
Simplified26.9%
pow1/226.9%
*-commutative26.9%
unpow-prod-down39.1%
pow1/239.1%
pow1/239.1%
Applied egg-rr39.1%
Final simplification41.7%
B_m = (fabs.f64 B)
(FPCore (A B_m C F)
:precision binary64
(let* ((t_0 (- (pow B_m 2.0) (* C (* A 4.0))))
(t_1 (/ (sqrt 2.0) B_m))
(t_2 (/ (- (sqrt (* (* 2.0 (* F t_0)) (* 2.0 C)))) t_0))
(t_3 (* t_1 (- (sqrt (* F (+ C (hypot B_m C))))))))
(if (<= (pow B_m 2.0) 5e-314)
t_2
(if (<= (pow B_m 2.0) 5e-194)
(* t_1 (- (sqrt (* -0.5 (/ (pow B_m 2.0) (/ C F))))))
(if (<= (pow B_m 2.0) 5e-110)
t_2
(if (<= (pow B_m 2.0) 2e+92)
t_3
(if (<= (pow B_m 2.0) 5e+108)
(/
(* (sqrt 2.0) (- (sqrt (* -0.5 (* F (/ (pow B_m 2.0) A))))))
B_m)
(if (<= (pow B_m 2.0) 1e+221)
t_3
(* (/ (- (sqrt 2.0)) B_m) (* (sqrt F) (sqrt (+ B_m C))))))))))))B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
double t_0 = pow(B_m, 2.0) - (C * (A * 4.0));
double t_1 = sqrt(2.0) / B_m;
double t_2 = -sqrt(((2.0 * (F * t_0)) * (2.0 * C))) / t_0;
double t_3 = t_1 * -sqrt((F * (C + hypot(B_m, C))));
double tmp;
if (pow(B_m, 2.0) <= 5e-314) {
tmp = t_2;
} else if (pow(B_m, 2.0) <= 5e-194) {
tmp = t_1 * -sqrt((-0.5 * (pow(B_m, 2.0) / (C / F))));
} else if (pow(B_m, 2.0) <= 5e-110) {
tmp = t_2;
} else if (pow(B_m, 2.0) <= 2e+92) {
tmp = t_3;
} else if (pow(B_m, 2.0) <= 5e+108) {
tmp = (sqrt(2.0) * -sqrt((-0.5 * (F * (pow(B_m, 2.0) / A))))) / B_m;
} else if (pow(B_m, 2.0) <= 1e+221) {
tmp = t_3;
} else {
tmp = (-sqrt(2.0) / B_m) * (sqrt(F) * sqrt((B_m + C)));
}
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) - (C * (A * 4.0));
double t_1 = Math.sqrt(2.0) / B_m;
double t_2 = -Math.sqrt(((2.0 * (F * t_0)) * (2.0 * C))) / t_0;
double t_3 = t_1 * -Math.sqrt((F * (C + Math.hypot(B_m, C))));
double tmp;
if (Math.pow(B_m, 2.0) <= 5e-314) {
tmp = t_2;
} else if (Math.pow(B_m, 2.0) <= 5e-194) {
tmp = t_1 * -Math.sqrt((-0.5 * (Math.pow(B_m, 2.0) / (C / F))));
} else if (Math.pow(B_m, 2.0) <= 5e-110) {
tmp = t_2;
} else if (Math.pow(B_m, 2.0) <= 2e+92) {
tmp = t_3;
} else if (Math.pow(B_m, 2.0) <= 5e+108) {
tmp = (Math.sqrt(2.0) * -Math.sqrt((-0.5 * (F * (Math.pow(B_m, 2.0) / A))))) / B_m;
} else if (Math.pow(B_m, 2.0) <= 1e+221) {
tmp = t_3;
} else {
tmp = (-Math.sqrt(2.0) / B_m) * (Math.sqrt(F) * Math.sqrt((B_m + C)));
}
return tmp;
}
B_m = math.fabs(B) def code(A, B_m, C, F): t_0 = math.pow(B_m, 2.0) - (C * (A * 4.0)) t_1 = math.sqrt(2.0) / B_m t_2 = -math.sqrt(((2.0 * (F * t_0)) * (2.0 * C))) / t_0 t_3 = t_1 * -math.sqrt((F * (C + math.hypot(B_m, C)))) tmp = 0 if math.pow(B_m, 2.0) <= 5e-314: tmp = t_2 elif math.pow(B_m, 2.0) <= 5e-194: tmp = t_1 * -math.sqrt((-0.5 * (math.pow(B_m, 2.0) / (C / F)))) elif math.pow(B_m, 2.0) <= 5e-110: tmp = t_2 elif math.pow(B_m, 2.0) <= 2e+92: tmp = t_3 elif math.pow(B_m, 2.0) <= 5e+108: tmp = (math.sqrt(2.0) * -math.sqrt((-0.5 * (F * (math.pow(B_m, 2.0) / A))))) / B_m elif math.pow(B_m, 2.0) <= 1e+221: tmp = t_3 else: tmp = (-math.sqrt(2.0) / B_m) * (math.sqrt(F) * math.sqrt((B_m + C))) return tmp
B_m = abs(B) function code(A, B_m, C, F) t_0 = Float64((B_m ^ 2.0) - Float64(C * Float64(A * 4.0))) t_1 = Float64(sqrt(2.0) / B_m) t_2 = Float64(Float64(-sqrt(Float64(Float64(2.0 * Float64(F * t_0)) * Float64(2.0 * C)))) / t_0) t_3 = Float64(t_1 * Float64(-sqrt(Float64(F * Float64(C + hypot(B_m, C)))))) tmp = 0.0 if ((B_m ^ 2.0) <= 5e-314) tmp = t_2; elseif ((B_m ^ 2.0) <= 5e-194) tmp = Float64(t_1 * Float64(-sqrt(Float64(-0.5 * Float64((B_m ^ 2.0) / Float64(C / F)))))); elseif ((B_m ^ 2.0) <= 5e-110) tmp = t_2; elseif ((B_m ^ 2.0) <= 2e+92) tmp = t_3; elseif ((B_m ^ 2.0) <= 5e+108) tmp = Float64(Float64(sqrt(2.0) * Float64(-sqrt(Float64(-0.5 * Float64(F * Float64((B_m ^ 2.0) / A)))))) / B_m); elseif ((B_m ^ 2.0) <= 1e+221) tmp = t_3; else tmp = Float64(Float64(Float64(-sqrt(2.0)) / B_m) * Float64(sqrt(F) * sqrt(Float64(B_m + C)))); end return tmp end
B_m = abs(B); function tmp_2 = code(A, B_m, C, F) t_0 = (B_m ^ 2.0) - (C * (A * 4.0)); t_1 = sqrt(2.0) / B_m; t_2 = -sqrt(((2.0 * (F * t_0)) * (2.0 * C))) / t_0; t_3 = t_1 * -sqrt((F * (C + hypot(B_m, C)))); tmp = 0.0; if ((B_m ^ 2.0) <= 5e-314) tmp = t_2; elseif ((B_m ^ 2.0) <= 5e-194) tmp = t_1 * -sqrt((-0.5 * ((B_m ^ 2.0) / (C / F)))); elseif ((B_m ^ 2.0) <= 5e-110) tmp = t_2; elseif ((B_m ^ 2.0) <= 2e+92) tmp = t_3; elseif ((B_m ^ 2.0) <= 5e+108) tmp = (sqrt(2.0) * -sqrt((-0.5 * (F * ((B_m ^ 2.0) / A))))) / B_m; elseif ((B_m ^ 2.0) <= 1e+221) tmp = t_3; else tmp = (-sqrt(2.0) / B_m) * (sqrt(F) * sqrt((B_m + C))); 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[(C * N[(A * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[Sqrt[2.0], $MachinePrecision] / B$95$m), $MachinePrecision]}, Block[{t$95$2 = N[((-N[Sqrt[N[(N[(2.0 * N[(F * t$95$0), $MachinePrecision]), $MachinePrecision] * N[(2.0 * C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision]}, Block[{t$95$3 = N[(t$95$1 * (-N[Sqrt[N[(F * N[(C + N[Sqrt[B$95$m ^ 2 + C ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]}, If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 5e-314], t$95$2, If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 5e-194], N[(t$95$1 * (-N[Sqrt[N[(-0.5 * N[(N[Power[B$95$m, 2.0], $MachinePrecision] / N[(C / F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision], If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 5e-110], t$95$2, If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 2e+92], t$95$3, If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 5e+108], N[(N[(N[Sqrt[2.0], $MachinePrecision] * (-N[Sqrt[N[(-0.5 * N[(F * N[(N[Power[B$95$m, 2.0], $MachinePrecision] / A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision] / B$95$m), $MachinePrecision], If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 1e+221], t$95$3, N[(N[((-N[Sqrt[2.0], $MachinePrecision]) / B$95$m), $MachinePrecision] * N[(N[Sqrt[F], $MachinePrecision] * N[Sqrt[N[(B$95$m + C), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]]]
\begin{array}{l}
B_m = \left|B\right|
\\
\begin{array}{l}
t_0 := {B_m}^{2} - C \cdot \left(A \cdot 4\right)\\
t_1 := \frac{\sqrt{2}}{B_m}\\
t_2 := \frac{-\sqrt{\left(2 \cdot \left(F \cdot t_0\right)\right) \cdot \left(2 \cdot C\right)}}{t_0}\\
t_3 := t_1 \cdot \left(-\sqrt{F \cdot \left(C + \mathsf{hypot}\left(B_m, C\right)\right)}\right)\\
\mathbf{if}\;{B_m}^{2} \leq 5 \cdot 10^{-314}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;{B_m}^{2} \leq 5 \cdot 10^{-194}:\\
\;\;\;\;t_1 \cdot \left(-\sqrt{-0.5 \cdot \frac{{B_m}^{2}}{\frac{C}{F}}}\right)\\
\mathbf{elif}\;{B_m}^{2} \leq 5 \cdot 10^{-110}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;{B_m}^{2} \leq 2 \cdot 10^{+92}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;{B_m}^{2} \leq 5 \cdot 10^{+108}:\\
\;\;\;\;\frac{\sqrt{2} \cdot \left(-\sqrt{-0.5 \cdot \left(F \cdot \frac{{B_m}^{2}}{A}\right)}\right)}{B_m}\\
\mathbf{elif}\;{B_m}^{2} \leq 10^{+221}:\\
\;\;\;\;t_3\\
\mathbf{else}:\\
\;\;\;\;\frac{-\sqrt{2}}{B_m} \cdot \left(\sqrt{F} \cdot \sqrt{B_m + C}\right)\\
\end{array}
\end{array}
if (pow.f64 B 2) < 4.99999999982e-314 or 5.0000000000000002e-194 < (pow.f64 B 2) < 5e-110Initial program 25.7%
Taylor expanded in A around -inf 23.2%
if 4.99999999982e-314 < (pow.f64 B 2) < 5.0000000000000002e-194Initial program 22.5%
Taylor expanded in A around 0 8.7%
mul-1-neg8.7%
*-commutative8.7%
distribute-rgt-neg-in8.7%
unpow28.7%
unpow28.7%
hypot-def9.0%
Simplified9.0%
Taylor expanded in C around -inf 18.3%
associate-/l*17.9%
Simplified17.9%
if 5e-110 < (pow.f64 B 2) < 2.0000000000000001e92 or 4.99999999999999991e108 < (pow.f64 B 2) < 1e221Initial program 38.7%
Taylor expanded in A around 0 28.3%
mul-1-neg28.3%
*-commutative28.3%
distribute-rgt-neg-in28.3%
unpow228.3%
unpow228.3%
hypot-def30.4%
Simplified30.4%
if 2.0000000000000001e92 < (pow.f64 B 2) < 4.99999999999999991e108Initial program 2.2%
Taylor expanded in C around 0 2.5%
mul-1-neg2.5%
distribute-rgt-neg-in2.5%
+-commutative2.5%
unpow22.5%
unpow22.5%
hypot-def4.2%
Simplified4.2%
Taylor expanded in A around -inf 33.9%
associate-/l*50.1%
Simplified50.1%
associate-*l/50.1%
associate-/r/50.1%
Applied egg-rr50.1%
if 1e221 < (pow.f64 B 2) Initial program 2.7%
Taylor expanded in A around 0 8.2%
mul-1-neg8.2%
*-commutative8.2%
distribute-rgt-neg-in8.2%
unpow28.2%
unpow28.2%
hypot-def23.1%
Simplified23.1%
pow1/223.1%
*-commutative23.1%
unpow-prod-down38.6%
pow1/238.6%
pow1/238.6%
Applied egg-rr38.6%
Taylor expanded in C around 0 35.6%
Final simplification29.5%
B_m = (fabs.f64 B)
(FPCore (A B_m C F)
:precision binary64
(let* ((t_0 (* (/ (sqrt 2.0) B_m) (- (sqrt (* F (+ C (hypot B_m C)))))))
(t_1 (fma B_m B_m (* A (* C -4.0)))))
(if (<= (pow B_m 2.0) 1e-128)
(/ (- (sqrt (* (* t_1 (* 2.0 F)) (+ A A)))) t_1)
(if (<= (pow B_m 2.0) 2e+92)
t_0
(if (<= (pow B_m 2.0) 5e+108)
(/ (* (sqrt 2.0) (- (sqrt (* -0.5 (* F (/ (pow B_m 2.0) A)))))) B_m)
(if (<= (pow B_m 2.0) 1e+221)
t_0
(* (/ (- (sqrt 2.0)) B_m) (* (sqrt F) (sqrt (+ B_m C))))))))))B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
double t_0 = (sqrt(2.0) / B_m) * -sqrt((F * (C + hypot(B_m, C))));
double t_1 = fma(B_m, B_m, (A * (C * -4.0)));
double tmp;
if (pow(B_m, 2.0) <= 1e-128) {
tmp = -sqrt(((t_1 * (2.0 * F)) * (A + A))) / t_1;
} else if (pow(B_m, 2.0) <= 2e+92) {
tmp = t_0;
} else if (pow(B_m, 2.0) <= 5e+108) {
tmp = (sqrt(2.0) * -sqrt((-0.5 * (F * (pow(B_m, 2.0) / A))))) / B_m;
} else if (pow(B_m, 2.0) <= 1e+221) {
tmp = t_0;
} else {
tmp = (-sqrt(2.0) / B_m) * (sqrt(F) * sqrt((B_m + C)));
}
return tmp;
}
B_m = abs(B) function code(A, B_m, C, F) t_0 = Float64(Float64(sqrt(2.0) / B_m) * Float64(-sqrt(Float64(F * Float64(C + hypot(B_m, C)))))) t_1 = fma(B_m, B_m, Float64(A * Float64(C * -4.0))) tmp = 0.0 if ((B_m ^ 2.0) <= 1e-128) tmp = Float64(Float64(-sqrt(Float64(Float64(t_1 * Float64(2.0 * F)) * Float64(A + A)))) / t_1); elseif ((B_m ^ 2.0) <= 2e+92) tmp = t_0; elseif ((B_m ^ 2.0) <= 5e+108) tmp = Float64(Float64(sqrt(2.0) * Float64(-sqrt(Float64(-0.5 * Float64(F * Float64((B_m ^ 2.0) / A)))))) / B_m); elseif ((B_m ^ 2.0) <= 1e+221) tmp = t_0; else tmp = Float64(Float64(Float64(-sqrt(2.0)) / B_m) * Float64(sqrt(F) * sqrt(Float64(B_m + C)))); end return tmp end
B_m = N[Abs[B], $MachinePrecision]
code[A_, B$95$m_, C_, F_] := Block[{t$95$0 = N[(N[(N[Sqrt[2.0], $MachinePrecision] / B$95$m), $MachinePrecision] * (-N[Sqrt[N[(F * N[(C + N[Sqrt[B$95$m ^ 2 + C ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]}, Block[{t$95$1 = N[(B$95$m * B$95$m + N[(A * N[(C * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 1e-128], N[((-N[Sqrt[N[(N[(t$95$1 * N[(2.0 * F), $MachinePrecision]), $MachinePrecision] * N[(A + A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$1), $MachinePrecision], If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 2e+92], t$95$0, If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 5e+108], N[(N[(N[Sqrt[2.0], $MachinePrecision] * (-N[Sqrt[N[(-0.5 * N[(F * N[(N[Power[B$95$m, 2.0], $MachinePrecision] / A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision] / B$95$m), $MachinePrecision], If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 1e+221], t$95$0, N[(N[((-N[Sqrt[2.0], $MachinePrecision]) / B$95$m), $MachinePrecision] * N[(N[Sqrt[F], $MachinePrecision] * N[Sqrt[N[(B$95$m + C), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
B_m = \left|B\right|
\\
\begin{array}{l}
t_0 := \frac{\sqrt{2}}{B_m} \cdot \left(-\sqrt{F \cdot \left(C + \mathsf{hypot}\left(B_m, C\right)\right)}\right)\\
t_1 := \mathsf{fma}\left(B_m, B_m, A \cdot \left(C \cdot -4\right)\right)\\
\mathbf{if}\;{B_m}^{2} \leq 10^{-128}:\\
\;\;\;\;\frac{-\sqrt{\left(t_1 \cdot \left(2 \cdot F\right)\right) \cdot \left(A + A\right)}}{t_1}\\
\mathbf{elif}\;{B_m}^{2} \leq 2 \cdot 10^{+92}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;{B_m}^{2} \leq 5 \cdot 10^{+108}:\\
\;\;\;\;\frac{\sqrt{2} \cdot \left(-\sqrt{-0.5 \cdot \left(F \cdot \frac{{B_m}^{2}}{A}\right)}\right)}{B_m}\\
\mathbf{elif}\;{B_m}^{2} \leq 10^{+221}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;\frac{-\sqrt{2}}{B_m} \cdot \left(\sqrt{F} \cdot \sqrt{B_m + C}\right)\\
\end{array}
\end{array}
if (pow.f64 B 2) < 1.00000000000000005e-128Initial program 24.3%
Simplified33.7%
Taylor expanded in A around inf 33.7%
distribute-rgt1-in33.7%
metadata-eval33.7%
mul0-lft33.7%
Simplified33.7%
if 1.00000000000000005e-128 < (pow.f64 B 2) < 2.0000000000000001e92 or 4.99999999999999991e108 < (pow.f64 B 2) < 1e221Initial program 38.8%
Taylor expanded in A around 0 27.8%
mul-1-neg27.8%
*-commutative27.8%
distribute-rgt-neg-in27.8%
unpow227.8%
unpow227.8%
hypot-def29.7%
Simplified29.7%
if 2.0000000000000001e92 < (pow.f64 B 2) < 4.99999999999999991e108Initial program 2.2%
Taylor expanded in C around 0 2.5%
mul-1-neg2.5%
distribute-rgt-neg-in2.5%
+-commutative2.5%
unpow22.5%
unpow22.5%
hypot-def4.2%
Simplified4.2%
Taylor expanded in A around -inf 33.9%
associate-/l*50.1%
Simplified50.1%
associate-*l/50.1%
associate-/r/50.1%
Applied egg-rr50.1%
if 1e221 < (pow.f64 B 2) Initial program 2.7%
Taylor expanded in A around 0 8.2%
mul-1-neg8.2%
*-commutative8.2%
distribute-rgt-neg-in8.2%
unpow28.2%
unpow28.2%
hypot-def23.1%
Simplified23.1%
pow1/223.1%
*-commutative23.1%
unpow-prod-down38.6%
pow1/238.6%
pow1/238.6%
Applied egg-rr38.6%
Taylor expanded in C around 0 35.6%
Final simplification33.8%
B_m = (fabs.f64 B)
(FPCore (A B_m C F)
:precision binary64
(let* ((t_0 (/ (sqrt 2.0) B_m)) (t_1 (fma B_m B_m (* A (* C -4.0)))))
(if (<= (pow B_m 2.0) 1e-128)
(/ (- (sqrt (* (* t_1 (* 2.0 F)) (+ A A)))) t_1)
(if (or (<= (pow B_m 2.0) 2e+92) (not (<= (pow B_m 2.0) 5e+108)))
(* t_0 (* (sqrt F) (- (sqrt (+ C (hypot B_m C))))))
(* t_0 (- (cbrt (pow (* F (* -0.5 (/ (pow B_m 2.0) A))) 1.5))))))))B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
double t_0 = sqrt(2.0) / B_m;
double t_1 = fma(B_m, B_m, (A * (C * -4.0)));
double tmp;
if (pow(B_m, 2.0) <= 1e-128) {
tmp = -sqrt(((t_1 * (2.0 * F)) * (A + A))) / t_1;
} else if ((pow(B_m, 2.0) <= 2e+92) || !(pow(B_m, 2.0) <= 5e+108)) {
tmp = t_0 * (sqrt(F) * -sqrt((C + hypot(B_m, C))));
} else {
tmp = t_0 * -cbrt(pow((F * (-0.5 * (pow(B_m, 2.0) / A))), 1.5));
}
return tmp;
}
B_m = abs(B) function code(A, B_m, C, F) t_0 = Float64(sqrt(2.0) / B_m) t_1 = fma(B_m, B_m, Float64(A * Float64(C * -4.0))) tmp = 0.0 if ((B_m ^ 2.0) <= 1e-128) tmp = Float64(Float64(-sqrt(Float64(Float64(t_1 * Float64(2.0 * F)) * Float64(A + A)))) / t_1); elseif (((B_m ^ 2.0) <= 2e+92) || !((B_m ^ 2.0) <= 5e+108)) tmp = Float64(t_0 * Float64(sqrt(F) * Float64(-sqrt(Float64(C + hypot(B_m, C)))))); else tmp = Float64(t_0 * Float64(-cbrt((Float64(F * Float64(-0.5 * Float64((B_m ^ 2.0) / A))) ^ 1.5)))); end return tmp end
B_m = N[Abs[B], $MachinePrecision]
code[A_, B$95$m_, C_, F_] := Block[{t$95$0 = N[(N[Sqrt[2.0], $MachinePrecision] / B$95$m), $MachinePrecision]}, Block[{t$95$1 = N[(B$95$m * B$95$m + N[(A * N[(C * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 1e-128], N[((-N[Sqrt[N[(N[(t$95$1 * N[(2.0 * F), $MachinePrecision]), $MachinePrecision] * N[(A + A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$1), $MachinePrecision], If[Or[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 2e+92], N[Not[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 5e+108]], $MachinePrecision]], N[(t$95$0 * N[(N[Sqrt[F], $MachinePrecision] * (-N[Sqrt[N[(C + N[Sqrt[B$95$m ^ 2 + C ^ 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]), $MachinePrecision], N[(t$95$0 * (-N[Power[N[Power[N[(F * N[(-0.5 * N[(N[Power[B$95$m, 2.0], $MachinePrecision] / A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1.5], $MachinePrecision], 1/3], $MachinePrecision])), $MachinePrecision]]]]]
\begin{array}{l}
B_m = \left|B\right|
\\
\begin{array}{l}
t_0 := \frac{\sqrt{2}}{B_m}\\
t_1 := \mathsf{fma}\left(B_m, B_m, A \cdot \left(C \cdot -4\right)\right)\\
\mathbf{if}\;{B_m}^{2} \leq 10^{-128}:\\
\;\;\;\;\frac{-\sqrt{\left(t_1 \cdot \left(2 \cdot F\right)\right) \cdot \left(A + A\right)}}{t_1}\\
\mathbf{elif}\;{B_m}^{2} \leq 2 \cdot 10^{+92} \lor \neg \left({B_m}^{2} \leq 5 \cdot 10^{+108}\right):\\
\;\;\;\;t_0 \cdot \left(\sqrt{F} \cdot \left(-\sqrt{C + \mathsf{hypot}\left(B_m, C\right)}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_0 \cdot \left(-\sqrt[3]{{\left(F \cdot \left(-0.5 \cdot \frac{{B_m}^{2}}{A}\right)\right)}^{1.5}}\right)\\
\end{array}
\end{array}
if (pow.f64 B 2) < 1.00000000000000005e-128Initial program 24.3%
Simplified33.7%
Taylor expanded in A around inf 33.7%
distribute-rgt1-in33.7%
metadata-eval33.7%
mul0-lft33.7%
Simplified33.7%
if 1.00000000000000005e-128 < (pow.f64 B 2) < 2.0000000000000001e92 or 4.99999999999999991e108 < (pow.f64 B 2) Initial program 17.7%
Taylor expanded in A around 0 16.3%
mul-1-neg16.3%
*-commutative16.3%
distribute-rgt-neg-in16.3%
unpow216.3%
unpow216.3%
hypot-def25.8%
Simplified25.8%
pow1/225.8%
*-commutative25.8%
unpow-prod-down34.9%
pow1/234.9%
pow1/234.9%
Applied egg-rr34.9%
if 2.0000000000000001e92 < (pow.f64 B 2) < 4.99999999999999991e108Initial program 2.2%
Taylor expanded in C around 0 2.5%
mul-1-neg2.5%
distribute-rgt-neg-in2.5%
+-commutative2.5%
unpow22.5%
unpow22.5%
hypot-def4.2%
Simplified4.2%
Taylor expanded in A around -inf 33.9%
associate-/l*50.1%
Simplified50.1%
add-cbrt-cube50.1%
pow1/345.9%
add-sqr-sqrt45.9%
pow145.9%
pow1/246.4%
pow-prod-up46.4%
associate-/r/46.4%
metadata-eval46.4%
Applied egg-rr46.4%
unpow1/350.5%
associate-*r*50.5%
Simplified50.5%
Final simplification34.8%
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 (<= (pow B_m 2.0) 1e-128)
(/ (- (sqrt (* (* t_0 (* 2.0 F)) (+ A A)))) t_0)
(if (or (<= (pow B_m 2.0) 2e+92) (not (<= (pow B_m 2.0) 5e+108)))
(* (/ (sqrt 2.0) B_m) (* (sqrt F) (- (sqrt (+ C (hypot B_m C))))))
(/ (* (sqrt 2.0) (- (sqrt (* -0.5 (* F (/ (pow B_m 2.0) A)))))) B_m)))))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 (pow(B_m, 2.0) <= 1e-128) {
tmp = -sqrt(((t_0 * (2.0 * F)) * (A + A))) / t_0;
} else if ((pow(B_m, 2.0) <= 2e+92) || !(pow(B_m, 2.0) <= 5e+108)) {
tmp = (sqrt(2.0) / B_m) * (sqrt(F) * -sqrt((C + hypot(B_m, C))));
} else {
tmp = (sqrt(2.0) * -sqrt((-0.5 * (F * (pow(B_m, 2.0) / A))))) / B_m;
}
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 ^ 2.0) <= 1e-128) tmp = Float64(Float64(-sqrt(Float64(Float64(t_0 * Float64(2.0 * F)) * Float64(A + A)))) / t_0); elseif (((B_m ^ 2.0) <= 2e+92) || !((B_m ^ 2.0) <= 5e+108)) tmp = Float64(Float64(sqrt(2.0) / B_m) * Float64(sqrt(F) * Float64(-sqrt(Float64(C + hypot(B_m, C)))))); else tmp = Float64(Float64(sqrt(2.0) * Float64(-sqrt(Float64(-0.5 * Float64(F * Float64((B_m ^ 2.0) / A)))))) / B_m); 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[N[Power[B$95$m, 2.0], $MachinePrecision], 1e-128], N[((-N[Sqrt[N[(N[(t$95$0 * N[(2.0 * F), $MachinePrecision]), $MachinePrecision] * N[(A + A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], If[Or[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 2e+92], N[Not[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 5e+108]], $MachinePrecision]], N[(N[(N[Sqrt[2.0], $MachinePrecision] / B$95$m), $MachinePrecision] * N[(N[Sqrt[F], $MachinePrecision] * (-N[Sqrt[N[(C + N[Sqrt[B$95$m ^ 2 + C ^ 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[2.0], $MachinePrecision] * (-N[Sqrt[N[(-0.5 * N[(F * N[(N[Power[B$95$m, 2.0], $MachinePrecision] / A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision] / B$95$m), $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}^{2} \leq 10^{-128}:\\
\;\;\;\;\frac{-\sqrt{\left(t_0 \cdot \left(2 \cdot F\right)\right) \cdot \left(A + A\right)}}{t_0}\\
\mathbf{elif}\;{B_m}^{2} \leq 2 \cdot 10^{+92} \lor \neg \left({B_m}^{2} \leq 5 \cdot 10^{+108}\right):\\
\;\;\;\;\frac{\sqrt{2}}{B_m} \cdot \left(\sqrt{F} \cdot \left(-\sqrt{C + \mathsf{hypot}\left(B_m, C\right)}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{2} \cdot \left(-\sqrt{-0.5 \cdot \left(F \cdot \frac{{B_m}^{2}}{A}\right)}\right)}{B_m}\\
\end{array}
\end{array}
if (pow.f64 B 2) < 1.00000000000000005e-128Initial program 24.3%
Simplified33.7%
Taylor expanded in A around inf 33.7%
distribute-rgt1-in33.7%
metadata-eval33.7%
mul0-lft33.7%
Simplified33.7%
if 1.00000000000000005e-128 < (pow.f64 B 2) < 2.0000000000000001e92 or 4.99999999999999991e108 < (pow.f64 B 2) Initial program 17.7%
Taylor expanded in A around 0 16.3%
mul-1-neg16.3%
*-commutative16.3%
distribute-rgt-neg-in16.3%
unpow216.3%
unpow216.3%
hypot-def25.8%
Simplified25.8%
pow1/225.8%
*-commutative25.8%
unpow-prod-down34.9%
pow1/234.9%
pow1/234.9%
Applied egg-rr34.9%
if 2.0000000000000001e92 < (pow.f64 B 2) < 4.99999999999999991e108Initial program 2.2%
Taylor expanded in C around 0 2.5%
mul-1-neg2.5%
distribute-rgt-neg-in2.5%
+-commutative2.5%
unpow22.5%
unpow22.5%
hypot-def4.2%
Simplified4.2%
Taylor expanded in A around -inf 33.9%
associate-/l*50.1%
Simplified50.1%
associate-*l/50.1%
associate-/r/50.1%
Applied egg-rr50.1%
Final simplification34.8%
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 (/ (sqrt 2.0) B_m)))
(if (<= (pow B_m 2.0) 2e+92)
(/ (- (sqrt (* (* 2.0 t_0) (* F (+ A (+ C (hypot (- A C) B_m))))))) t_0)
(if (<= (pow B_m 2.0) 5e+108)
(* t_1 (- (cbrt (pow (* F (* -0.5 (/ (pow B_m 2.0) A))) 1.5))))
(if (<= (pow B_m 2.0) 2e+194)
(* t_1 (* (sqrt F) (- (sqrt (+ A (hypot B_m A))))))
(* t_1 (* (sqrt F) (- (sqrt (+ C (hypot B_m C)))))))))))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 = sqrt(2.0) / B_m;
double tmp;
if (pow(B_m, 2.0) <= 2e+92) {
tmp = -sqrt(((2.0 * t_0) * (F * (A + (C + hypot((A - C), B_m)))))) / t_0;
} else if (pow(B_m, 2.0) <= 5e+108) {
tmp = t_1 * -cbrt(pow((F * (-0.5 * (pow(B_m, 2.0) / A))), 1.5));
} else if (pow(B_m, 2.0) <= 2e+194) {
tmp = t_1 * (sqrt(F) * -sqrt((A + hypot(B_m, A))));
} else {
tmp = t_1 * (sqrt(F) * -sqrt((C + hypot(B_m, C))));
}
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(sqrt(2.0) / B_m) tmp = 0.0 if ((B_m ^ 2.0) <= 2e+92) tmp = Float64(Float64(-sqrt(Float64(Float64(2.0 * t_0) * Float64(F * Float64(A + Float64(C + hypot(Float64(A - C), B_m))))))) / t_0); elseif ((B_m ^ 2.0) <= 5e+108) tmp = Float64(t_1 * Float64(-cbrt((Float64(F * Float64(-0.5 * Float64((B_m ^ 2.0) / A))) ^ 1.5)))); elseif ((B_m ^ 2.0) <= 2e+194) tmp = Float64(t_1 * Float64(sqrt(F) * Float64(-sqrt(Float64(A + hypot(B_m, A)))))); else tmp = Float64(t_1 * Float64(sqrt(F) * Float64(-sqrt(Float64(C + hypot(B_m, C)))))); 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[(N[Sqrt[2.0], $MachinePrecision] / B$95$m), $MachinePrecision]}, If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 2e+92], N[((-N[Sqrt[N[(N[(2.0 * t$95$0), $MachinePrecision] * N[(F * N[(A + N[(C + N[Sqrt[N[(A - C), $MachinePrecision] ^ 2 + B$95$m ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 5e+108], N[(t$95$1 * (-N[Power[N[Power[N[(F * N[(-0.5 * N[(N[Power[B$95$m, 2.0], $MachinePrecision] / A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1.5], $MachinePrecision], 1/3], $MachinePrecision])), $MachinePrecision], If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 2e+194], N[(t$95$1 * N[(N[Sqrt[F], $MachinePrecision] * (-N[Sqrt[N[(A + N[Sqrt[B$95$m ^ 2 + A ^ 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]), $MachinePrecision], N[(t$95$1 * N[(N[Sqrt[F], $MachinePrecision] * (-N[Sqrt[N[(C + N[Sqrt[B$95$m ^ 2 + C ^ 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $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 := \frac{\sqrt{2}}{B_m}\\
\mathbf{if}\;{B_m}^{2} \leq 2 \cdot 10^{+92}:\\
\;\;\;\;\frac{-\sqrt{\left(2 \cdot t_0\right) \cdot \left(F \cdot \left(A + \left(C + \mathsf{hypot}\left(A - C, B_m\right)\right)\right)\right)}}{t_0}\\
\mathbf{elif}\;{B_m}^{2} \leq 5 \cdot 10^{+108}:\\
\;\;\;\;t_1 \cdot \left(-\sqrt[3]{{\left(F \cdot \left(-0.5 \cdot \frac{{B_m}^{2}}{A}\right)\right)}^{1.5}}\right)\\
\mathbf{elif}\;{B_m}^{2} \leq 2 \cdot 10^{+194}:\\
\;\;\;\;t_1 \cdot \left(\sqrt{F} \cdot \left(-\sqrt{A + \mathsf{hypot}\left(B_m, A\right)}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_1 \cdot \left(\sqrt{F} \cdot \left(-\sqrt{C + \mathsf{hypot}\left(B_m, C\right)}\right)\right)\\
\end{array}
\end{array}
if (pow.f64 B 2) < 2.0000000000000001e92Initial program 28.0%
neg-sub028.0%
div-sub28.0%
associate-*l*28.0%
Applied egg-rr36.7%
div036.7%
neg-sub036.7%
distribute-neg-frac36.7%
Simplified37.5%
if 2.0000000000000001e92 < (pow.f64 B 2) < 4.99999999999999991e108Initial program 2.2%
Taylor expanded in C around 0 2.5%
mul-1-neg2.5%
distribute-rgt-neg-in2.5%
+-commutative2.5%
unpow22.5%
unpow22.5%
hypot-def4.2%
Simplified4.2%
Taylor expanded in A around -inf 33.9%
associate-/l*50.1%
Simplified50.1%
add-cbrt-cube50.1%
pow1/345.9%
add-sqr-sqrt45.9%
pow145.9%
pow1/246.4%
pow-prod-up46.4%
associate-/r/46.4%
metadata-eval46.4%
Applied egg-rr46.4%
unpow1/350.5%
associate-*r*50.5%
Simplified50.5%
if 4.99999999999999991e108 < (pow.f64 B 2) < 1.99999999999999989e194Initial program 51.0%
Taylor expanded in C around 0 40.0%
mul-1-neg40.0%
distribute-rgt-neg-in40.0%
+-commutative40.0%
unpow240.0%
unpow240.0%
hypot-def40.3%
Simplified40.3%
pow1/240.3%
*-commutative40.3%
unpow-prod-down50.0%
pow1/250.0%
pow1/250.0%
Applied egg-rr50.0%
if 1.99999999999999989e194 < (pow.f64 B 2) Initial program 4.7%
Taylor expanded in A around 0 9.3%
mul-1-neg9.3%
*-commutative9.3%
distribute-rgt-neg-in9.3%
unpow29.3%
unpow29.3%
hypot-def22.9%
Simplified22.9%
pow1/222.9%
*-commutative22.9%
unpow-prod-down37.0%
pow1/237.0%
pow1/237.0%
Applied egg-rr37.0%
Final simplification38.4%
B_m = (fabs.f64 B)
(FPCore (A B_m C F)
:precision binary64
(let* ((t_0 (/ (sqrt 2.0) B_m))
(t_1 (+ C (hypot B_m C)))
(t_2 (* t_0 (- (sqrt (* F t_1))))))
(if (<= B_m 1.3e-157)
(/
(- (sqrt (* t_1 (* 2.0 (* -4.0 (* A (* F C)))))))
(- (pow B_m 2.0) (* C (* A 4.0))))
(if (<= B_m 1.4e-74)
(* t_0 (- (sqrt (* -0.5 (/ (pow B_m 2.0) (/ C F))))))
(if (<= B_m 1.45e+50)
t_2
(if (<= B_m 2.05e+54)
(/ (* (sqrt 2.0) (- (sqrt (* -0.5 (* F (/ (pow B_m 2.0) A)))))) B_m)
(if (<= B_m 3.5e+110)
t_2
(* (/ (- (sqrt 2.0)) B_m) (* (sqrt F) (sqrt (+ B_m C)))))))))))B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
double t_0 = sqrt(2.0) / B_m;
double t_1 = C + hypot(B_m, C);
double t_2 = t_0 * -sqrt((F * t_1));
double tmp;
if (B_m <= 1.3e-157) {
tmp = -sqrt((t_1 * (2.0 * (-4.0 * (A * (F * C)))))) / (pow(B_m, 2.0) - (C * (A * 4.0)));
} else if (B_m <= 1.4e-74) {
tmp = t_0 * -sqrt((-0.5 * (pow(B_m, 2.0) / (C / F))));
} else if (B_m <= 1.45e+50) {
tmp = t_2;
} else if (B_m <= 2.05e+54) {
tmp = (sqrt(2.0) * -sqrt((-0.5 * (F * (pow(B_m, 2.0) / A))))) / B_m;
} else if (B_m <= 3.5e+110) {
tmp = t_2;
} else {
tmp = (-sqrt(2.0) / B_m) * (sqrt(F) * sqrt((B_m + C)));
}
return tmp;
}
B_m = Math.abs(B);
public static double code(double A, double B_m, double C, double F) {
double t_0 = Math.sqrt(2.0) / B_m;
double t_1 = C + Math.hypot(B_m, C);
double t_2 = t_0 * -Math.sqrt((F * t_1));
double tmp;
if (B_m <= 1.3e-157) {
tmp = -Math.sqrt((t_1 * (2.0 * (-4.0 * (A * (F * C)))))) / (Math.pow(B_m, 2.0) - (C * (A * 4.0)));
} else if (B_m <= 1.4e-74) {
tmp = t_0 * -Math.sqrt((-0.5 * (Math.pow(B_m, 2.0) / (C / F))));
} else if (B_m <= 1.45e+50) {
tmp = t_2;
} else if (B_m <= 2.05e+54) {
tmp = (Math.sqrt(2.0) * -Math.sqrt((-0.5 * (F * (Math.pow(B_m, 2.0) / A))))) / B_m;
} else if (B_m <= 3.5e+110) {
tmp = t_2;
} else {
tmp = (-Math.sqrt(2.0) / B_m) * (Math.sqrt(F) * Math.sqrt((B_m + C)));
}
return tmp;
}
B_m = math.fabs(B) def code(A, B_m, C, F): t_0 = math.sqrt(2.0) / B_m t_1 = C + math.hypot(B_m, C) t_2 = t_0 * -math.sqrt((F * t_1)) tmp = 0 if B_m <= 1.3e-157: tmp = -math.sqrt((t_1 * (2.0 * (-4.0 * (A * (F * C)))))) / (math.pow(B_m, 2.0) - (C * (A * 4.0))) elif B_m <= 1.4e-74: tmp = t_0 * -math.sqrt((-0.5 * (math.pow(B_m, 2.0) / (C / F)))) elif B_m <= 1.45e+50: tmp = t_2 elif B_m <= 2.05e+54: tmp = (math.sqrt(2.0) * -math.sqrt((-0.5 * (F * (math.pow(B_m, 2.0) / A))))) / B_m elif B_m <= 3.5e+110: tmp = t_2 else: tmp = (-math.sqrt(2.0) / B_m) * (math.sqrt(F) * math.sqrt((B_m + C))) return tmp
B_m = abs(B) function code(A, B_m, C, F) t_0 = Float64(sqrt(2.0) / B_m) t_1 = Float64(C + hypot(B_m, C)) t_2 = Float64(t_0 * Float64(-sqrt(Float64(F * t_1)))) tmp = 0.0 if (B_m <= 1.3e-157) tmp = Float64(Float64(-sqrt(Float64(t_1 * Float64(2.0 * Float64(-4.0 * Float64(A * Float64(F * C))))))) / Float64((B_m ^ 2.0) - Float64(C * Float64(A * 4.0)))); elseif (B_m <= 1.4e-74) tmp = Float64(t_0 * Float64(-sqrt(Float64(-0.5 * Float64((B_m ^ 2.0) / Float64(C / F)))))); elseif (B_m <= 1.45e+50) tmp = t_2; elseif (B_m <= 2.05e+54) tmp = Float64(Float64(sqrt(2.0) * Float64(-sqrt(Float64(-0.5 * Float64(F * Float64((B_m ^ 2.0) / A)))))) / B_m); elseif (B_m <= 3.5e+110) tmp = t_2; else tmp = Float64(Float64(Float64(-sqrt(2.0)) / B_m) * Float64(sqrt(F) * sqrt(Float64(B_m + C)))); end return tmp end
B_m = abs(B); function tmp_2 = code(A, B_m, C, F) t_0 = sqrt(2.0) / B_m; t_1 = C + hypot(B_m, C); t_2 = t_0 * -sqrt((F * t_1)); tmp = 0.0; if (B_m <= 1.3e-157) tmp = -sqrt((t_1 * (2.0 * (-4.0 * (A * (F * C)))))) / ((B_m ^ 2.0) - (C * (A * 4.0))); elseif (B_m <= 1.4e-74) tmp = t_0 * -sqrt((-0.5 * ((B_m ^ 2.0) / (C / F)))); elseif (B_m <= 1.45e+50) tmp = t_2; elseif (B_m <= 2.05e+54) tmp = (sqrt(2.0) * -sqrt((-0.5 * (F * ((B_m ^ 2.0) / A))))) / B_m; elseif (B_m <= 3.5e+110) tmp = t_2; else tmp = (-sqrt(2.0) / B_m) * (sqrt(F) * sqrt((B_m + C))); end tmp_2 = tmp; end
B_m = N[Abs[B], $MachinePrecision]
code[A_, B$95$m_, C_, F_] := Block[{t$95$0 = N[(N[Sqrt[2.0], $MachinePrecision] / B$95$m), $MachinePrecision]}, Block[{t$95$1 = N[(C + N[Sqrt[B$95$m ^ 2 + C ^ 2], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t$95$0 * (-N[Sqrt[N[(F * t$95$1), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]}, If[LessEqual[B$95$m, 1.3e-157], N[((-N[Sqrt[N[(t$95$1 * N[(2.0 * N[(-4.0 * N[(A * N[(F * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / N[(N[Power[B$95$m, 2.0], $MachinePrecision] - N[(C * N[(A * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[B$95$m, 1.4e-74], N[(t$95$0 * (-N[Sqrt[N[(-0.5 * N[(N[Power[B$95$m, 2.0], $MachinePrecision] / N[(C / F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision], If[LessEqual[B$95$m, 1.45e+50], t$95$2, If[LessEqual[B$95$m, 2.05e+54], N[(N[(N[Sqrt[2.0], $MachinePrecision] * (-N[Sqrt[N[(-0.5 * N[(F * N[(N[Power[B$95$m, 2.0], $MachinePrecision] / A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision] / B$95$m), $MachinePrecision], If[LessEqual[B$95$m, 3.5e+110], t$95$2, N[(N[((-N[Sqrt[2.0], $MachinePrecision]) / B$95$m), $MachinePrecision] * N[(N[Sqrt[F], $MachinePrecision] * N[Sqrt[N[(B$95$m + C), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}
B_m = \left|B\right|
\\
\begin{array}{l}
t_0 := \frac{\sqrt{2}}{B_m}\\
t_1 := C + \mathsf{hypot}\left(B_m, C\right)\\
t_2 := t_0 \cdot \left(-\sqrt{F \cdot t_1}\right)\\
\mathbf{if}\;B_m \leq 1.3 \cdot 10^{-157}:\\
\;\;\;\;\frac{-\sqrt{t_1 \cdot \left(2 \cdot \left(-4 \cdot \left(A \cdot \left(F \cdot C\right)\right)\right)\right)}}{{B_m}^{2} - C \cdot \left(A \cdot 4\right)}\\
\mathbf{elif}\;B_m \leq 1.4 \cdot 10^{-74}:\\
\;\;\;\;t_0 \cdot \left(-\sqrt{-0.5 \cdot \frac{{B_m}^{2}}{\frac{C}{F}}}\right)\\
\mathbf{elif}\;B_m \leq 1.45 \cdot 10^{+50}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;B_m \leq 2.05 \cdot 10^{+54}:\\
\;\;\;\;\frac{\sqrt{2} \cdot \left(-\sqrt{-0.5 \cdot \left(F \cdot \frac{{B_m}^{2}}{A}\right)}\right)}{B_m}\\
\mathbf{elif}\;B_m \leq 3.5 \cdot 10^{+110}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;\frac{-\sqrt{2}}{B_m} \cdot \left(\sqrt{F} \cdot \sqrt{B_m + C}\right)\\
\end{array}
\end{array}
if B < 1.29999999999999994e-157Initial program 19.8%
Taylor expanded in A around 0 14.6%
unpow214.6%
unpow214.6%
hypot-def15.9%
Simplified15.9%
Taylor expanded in B around 0 10.0%
*-commutative10.0%
*-commutative10.0%
Simplified10.0%
if 1.29999999999999994e-157 < B < 1.39999999999999994e-74Initial program 32.8%
Taylor expanded in A around 0 10.3%
mul-1-neg10.3%
*-commutative10.3%
distribute-rgt-neg-in10.3%
unpow210.3%
unpow210.3%
hypot-def10.3%
Simplified10.3%
Taylor expanded in C around -inf 20.7%
associate-/l*20.5%
Simplified20.5%
if 1.39999999999999994e-74 < B < 1.45e50 or 2.04999999999999984e54 < B < 3.4999999999999999e110Initial program 35.5%
Taylor expanded in A around 0 45.5%
mul-1-neg45.5%
*-commutative45.5%
distribute-rgt-neg-in45.5%
unpow245.5%
unpow245.5%
hypot-def48.6%
Simplified48.6%
if 1.45e50 < B < 2.04999999999999984e54Initial program 1.8%
Taylor expanded in C around 0 3.4%
mul-1-neg3.4%
distribute-rgt-neg-in3.4%
+-commutative3.4%
unpow23.4%
unpow23.4%
hypot-def4.5%
Simplified4.5%
Taylor expanded in A around -inf 50.0%
associate-/l*74.2%
Simplified74.2%
associate-*l/74.2%
associate-/r/74.2%
Applied egg-rr74.2%
if 3.4999999999999999e110 < B Initial program 2.9%
Taylor expanded in A around 0 15.9%
mul-1-neg15.9%
*-commutative15.9%
distribute-rgt-neg-in15.9%
unpow215.9%
unpow215.9%
hypot-def45.7%
Simplified45.7%
pow1/245.7%
*-commutative45.7%
unpow-prod-down77.8%
pow1/277.8%
pow1/277.8%
Applied egg-rr77.8%
Taylor expanded in C around 0 74.4%
Final simplification28.2%
B_m = (fabs.f64 B) (FPCore (A B_m C F) :precision binary64 (if (<= F 6.5e+36) (* (/ (sqrt 2.0) B_m) (- (sqrt (* F (+ C (hypot B_m C)))))) (* (sqrt 2.0) (- (/ (sqrt F) (sqrt B_m))))))
B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
double tmp;
if (F <= 6.5e+36) {
tmp = (sqrt(2.0) / B_m) * -sqrt((F * (C + hypot(B_m, C))));
} else {
tmp = sqrt(2.0) * -(sqrt(F) / sqrt(B_m));
}
return tmp;
}
B_m = Math.abs(B);
public static double code(double A, double B_m, double C, double F) {
double tmp;
if (F <= 6.5e+36) {
tmp = (Math.sqrt(2.0) / B_m) * -Math.sqrt((F * (C + Math.hypot(B_m, C))));
} else {
tmp = Math.sqrt(2.0) * -(Math.sqrt(F) / Math.sqrt(B_m));
}
return tmp;
}
B_m = math.fabs(B) def code(A, B_m, C, F): tmp = 0 if F <= 6.5e+36: tmp = (math.sqrt(2.0) / B_m) * -math.sqrt((F * (C + math.hypot(B_m, C)))) else: tmp = math.sqrt(2.0) * -(math.sqrt(F) / math.sqrt(B_m)) return tmp
B_m = abs(B) function code(A, B_m, C, F) tmp = 0.0 if (F <= 6.5e+36) tmp = Float64(Float64(sqrt(2.0) / B_m) * Float64(-sqrt(Float64(F * Float64(C + hypot(B_m, C)))))); else tmp = Float64(sqrt(2.0) * Float64(-Float64(sqrt(F) / sqrt(B_m)))); end return tmp end
B_m = abs(B); function tmp_2 = code(A, B_m, C, F) tmp = 0.0; if (F <= 6.5e+36) tmp = (sqrt(2.0) / B_m) * -sqrt((F * (C + hypot(B_m, C)))); else tmp = sqrt(2.0) * -(sqrt(F) / sqrt(B_m)); end tmp_2 = tmp; end
B_m = N[Abs[B], $MachinePrecision] code[A_, B$95$m_, C_, F_] := If[LessEqual[F, 6.5e+36], N[(N[(N[Sqrt[2.0], $MachinePrecision] / B$95$m), $MachinePrecision] * (-N[Sqrt[N[(F * N[(C + N[Sqrt[B$95$m ^ 2 + C ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision], N[(N[Sqrt[2.0], $MachinePrecision] * (-N[(N[Sqrt[F], $MachinePrecision] / N[Sqrt[B$95$m], $MachinePrecision]), $MachinePrecision])), $MachinePrecision]]
\begin{array}{l}
B_m = \left|B\right|
\\
\begin{array}{l}
\mathbf{if}\;F \leq 6.5 \cdot 10^{+36}:\\
\;\;\;\;\frac{\sqrt{2}}{B_m} \cdot \left(-\sqrt{F \cdot \left(C + \mathsf{hypot}\left(B_m, C\right)\right)}\right)\\
\mathbf{else}:\\
\;\;\;\;\sqrt{2} \cdot \left(-\frac{\sqrt{F}}{\sqrt{B_m}}\right)\\
\end{array}
\end{array}
if F < 6.4999999999999998e36Initial program 23.3%
Taylor expanded in A around 0 13.7%
mul-1-neg13.7%
*-commutative13.7%
distribute-rgt-neg-in13.7%
unpow213.7%
unpow213.7%
hypot-def23.0%
Simplified23.0%
if 6.4999999999999998e36 < F Initial program 14.9%
Taylor expanded in A around 0 7.7%
mul-1-neg7.7%
*-commutative7.7%
distribute-rgt-neg-in7.7%
unpow27.7%
unpow27.7%
hypot-def9.1%
Simplified9.1%
Taylor expanded in C around 0 20.9%
mul-1-neg20.9%
Simplified20.9%
sqrt-div21.1%
Applied egg-rr21.1%
Final simplification22.2%
B_m = (fabs.f64 B) (FPCore (A B_m C F) :precision binary64 (* (sqrt 2.0) (- (/ (sqrt F) (sqrt B_m)))))
B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
return sqrt(2.0) * -(sqrt(F) / sqrt(B_m));
}
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(2.0d0) * -(sqrt(f) / sqrt(b_m))
end function
B_m = Math.abs(B);
public static double code(double A, double B_m, double C, double F) {
return Math.sqrt(2.0) * -(Math.sqrt(F) / Math.sqrt(B_m));
}
B_m = math.fabs(B) def code(A, B_m, C, F): return math.sqrt(2.0) * -(math.sqrt(F) / math.sqrt(B_m))
B_m = abs(B) function code(A, B_m, C, F) return Float64(sqrt(2.0) * Float64(-Float64(sqrt(F) / sqrt(B_m)))) end
B_m = abs(B); function tmp = code(A, B_m, C, F) tmp = sqrt(2.0) * -(sqrt(F) / sqrt(B_m)); end
B_m = N[Abs[B], $MachinePrecision] code[A_, B$95$m_, C_, F_] := N[(N[Sqrt[2.0], $MachinePrecision] * (-N[(N[Sqrt[F], $MachinePrecision] / N[Sqrt[B$95$m], $MachinePrecision]), $MachinePrecision])), $MachinePrecision]
\begin{array}{l}
B_m = \left|B\right|
\\
\sqrt{2} \cdot \left(-\frac{\sqrt{F}}{\sqrt{B_m}}\right)
\end{array}
Initial program 19.8%
Taylor expanded in A around 0 11.2%
mul-1-neg11.2%
*-commutative11.2%
distribute-rgt-neg-in11.2%
unpow211.2%
unpow211.2%
hypot-def17.2%
Simplified17.2%
Taylor expanded in C around 0 15.8%
mul-1-neg15.8%
Simplified15.8%
sqrt-div19.8%
Applied egg-rr19.8%
Final simplification19.8%
B_m = (fabs.f64 B) (FPCore (A B_m C F) :precision binary64 (if (<= F 6.8e-50) (* (/ (- (sqrt 2.0)) B_m) (sqrt (* B_m F))) (- (sqrt (* 2.0 (/ F B_m))))))
B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
double tmp;
if (F <= 6.8e-50) {
tmp = (-sqrt(2.0) / B_m) * sqrt((B_m * F));
} else {
tmp = -sqrt((2.0 * (F / B_m)));
}
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 <= 6.8d-50) then
tmp = (-sqrt(2.0d0) / b_m) * sqrt((b_m * f))
else
tmp = -sqrt((2.0d0 * (f / b_m)))
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 <= 6.8e-50) {
tmp = (-Math.sqrt(2.0) / B_m) * Math.sqrt((B_m * F));
} else {
tmp = -Math.sqrt((2.0 * (F / B_m)));
}
return tmp;
}
B_m = math.fabs(B) def code(A, B_m, C, F): tmp = 0 if F <= 6.8e-50: tmp = (-math.sqrt(2.0) / B_m) * math.sqrt((B_m * F)) else: tmp = -math.sqrt((2.0 * (F / B_m))) return tmp
B_m = abs(B) function code(A, B_m, C, F) tmp = 0.0 if (F <= 6.8e-50) tmp = Float64(Float64(Float64(-sqrt(2.0)) / B_m) * sqrt(Float64(B_m * F))); else tmp = Float64(-sqrt(Float64(2.0 * Float64(F / B_m)))); end return tmp end
B_m = abs(B); function tmp_2 = code(A, B_m, C, F) tmp = 0.0; if (F <= 6.8e-50) tmp = (-sqrt(2.0) / B_m) * sqrt((B_m * F)); else tmp = -sqrt((2.0 * (F / B_m))); end tmp_2 = tmp; end
B_m = N[Abs[B], $MachinePrecision] code[A_, B$95$m_, C_, F_] := If[LessEqual[F, 6.8e-50], N[(N[((-N[Sqrt[2.0], $MachinePrecision]) / B$95$m), $MachinePrecision] * N[Sqrt[N[(B$95$m * F), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], (-N[Sqrt[N[(2.0 * N[(F / B$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])]
\begin{array}{l}
B_m = \left|B\right|
\\
\begin{array}{l}
\mathbf{if}\;F \leq 6.8 \cdot 10^{-50}:\\
\;\;\;\;\frac{-\sqrt{2}}{B_m} \cdot \sqrt{B_m \cdot F}\\
\mathbf{else}:\\
\;\;\;\;-\sqrt{2 \cdot \frac{F}{B_m}}\\
\end{array}
\end{array}
if F < 6.80000000000000029e-50Initial program 23.1%
Taylor expanded in A around 0 10.8%
mul-1-neg10.8%
*-commutative10.8%
distribute-rgt-neg-in10.8%
unpow210.8%
unpow210.8%
hypot-def21.2%
Simplified21.2%
Taylor expanded in C around 0 18.5%
if 6.80000000000000029e-50 < F Initial program 16.8%
Taylor expanded in A around 0 11.5%
mul-1-neg11.5%
*-commutative11.5%
distribute-rgt-neg-in11.5%
unpow211.5%
unpow211.5%
hypot-def13.5%
Simplified13.5%
Taylor expanded in C around 0 21.8%
mul-1-neg21.8%
Simplified21.8%
sqrt-unprod21.9%
Applied egg-rr21.9%
Final simplification20.3%
B_m = (fabs.f64 B) (FPCore (A B_m C F) :precision binary64 (- (sqrt (* 2.0 (/ F B_m)))))
B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
return -sqrt((2.0 * (F / B_m)));
}
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((2.0d0 * (f / b_m)))
end function
B_m = Math.abs(B);
public static double code(double A, double B_m, double C, double F) {
return -Math.sqrt((2.0 * (F / B_m)));
}
B_m = math.fabs(B) def code(A, B_m, C, F): return -math.sqrt((2.0 * (F / B_m)))
B_m = abs(B) function code(A, B_m, C, F) return Float64(-sqrt(Float64(2.0 * Float64(F / B_m)))) end
B_m = abs(B); function tmp = code(A, B_m, C, F) tmp = -sqrt((2.0 * (F / B_m))); end
B_m = N[Abs[B], $MachinePrecision] code[A_, B$95$m_, C_, F_] := (-N[Sqrt[N[(2.0 * N[(F / B$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])
\begin{array}{l}
B_m = \left|B\right|
\\
-\sqrt{2 \cdot \frac{F}{B_m}}
\end{array}
Initial program 19.8%
Taylor expanded in A around 0 11.2%
mul-1-neg11.2%
*-commutative11.2%
distribute-rgt-neg-in11.2%
unpow211.2%
unpow211.2%
hypot-def17.2%
Simplified17.2%
Taylor expanded in C around 0 15.8%
mul-1-neg15.8%
Simplified15.8%
sqrt-unprod15.9%
Applied egg-rr15.9%
Final simplification15.9%
herbie shell --seed 2024021
(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))))