
(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 20 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 (fma B_m B_m (* A (* C -4.0)))))
(if (<= (pow B_m 2.0) 5e+69)
(/
(* (sqrt (+ A (+ C (hypot (- A C) B_m)))) (- (sqrt (* t_0 (* 2.0 F)))))
t_0)
(* (/ (sqrt 2.0) B_m) (* (sqrt (+ C (hypot C B_m))) (- (sqrt F)))))))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) <= 5e+69) {
tmp = (sqrt((A + (C + hypot((A - C), B_m)))) * -sqrt((t_0 * (2.0 * F)))) / t_0;
} else {
tmp = (sqrt(2.0) / B_m) * (sqrt((C + hypot(C, B_m))) * -sqrt(F));
}
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) <= 5e+69) tmp = Float64(Float64(sqrt(Float64(A + Float64(C + hypot(Float64(A - C), B_m)))) * Float64(-sqrt(Float64(t_0 * Float64(2.0 * F))))) / t_0); else tmp = Float64(Float64(sqrt(2.0) / B_m) * Float64(sqrt(Float64(C + hypot(C, B_m))) * Float64(-sqrt(F)))); 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], 5e+69], 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[(t$95$0 * N[(2.0 * F), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision] / t$95$0), $MachinePrecision], N[(N[(N[Sqrt[2.0], $MachinePrecision] / B$95$m), $MachinePrecision] * N[(N[Sqrt[N[(C + N[Sqrt[C ^ 2 + B$95$m ^ 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-N[Sqrt[F], $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)\\
\mathbf{if}\;{B\_m}^{2} \leq 5 \cdot 10^{+69}:\\
\;\;\;\;\frac{\sqrt{A + \left(C + \mathsf{hypot}\left(A - C, B\_m\right)\right)} \cdot \left(-\sqrt{t\_0 \cdot \left(2 \cdot F\right)}\right)}{t\_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{2}}{B\_m} \cdot \left(\sqrt{C + \mathsf{hypot}\left(C, B\_m\right)} \cdot \left(-\sqrt{F}\right)\right)\\
\end{array}
\end{array}
if (pow.f64 B 2) < 5.00000000000000036e69Initial program 23.0%
Simplified32.9%
add-exp-log31.5%
hypot-udef23.3%
unpow223.3%
unpow223.3%
+-commutative23.3%
unpow223.3%
unpow223.3%
hypot-def31.5%
Applied egg-rr31.5%
pow1/231.5%
*-commutative31.5%
unpow-prod-down37.7%
pow1/237.7%
rem-exp-log39.7%
pow1/239.7%
Applied egg-rr39.7%
if 5.00000000000000036e69 < (pow.f64 B 2) Initial program 11.7%
Taylor expanded in A around 0 9.2%
mul-1-neg9.2%
distribute-rgt-neg-in9.2%
unpow29.2%
unpow29.2%
hypot-def25.1%
Simplified25.1%
pow1/225.1%
*-commutative25.1%
unpow-prod-down36.6%
pow1/236.6%
hypot-udef10.9%
unpow210.9%
unpow210.9%
+-commutative10.9%
unpow210.9%
unpow210.9%
hypot-def36.6%
pow1/236.6%
Applied egg-rr36.6%
Final simplification38.4%
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) 5e+69)
(/ (- (sqrt (* (* t_0 (* 2.0 F)) (+ A (+ C (hypot B_m (- A C))))))) t_0)
(* (/ (sqrt 2.0) B_m) (* (sqrt (+ C (hypot C B_m))) (- (sqrt F)))))))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) <= 5e+69) {
tmp = -sqrt(((t_0 * (2.0 * F)) * (A + (C + hypot(B_m, (A - C)))))) / t_0;
} else {
tmp = (sqrt(2.0) / B_m) * (sqrt((C + hypot(C, B_m))) * -sqrt(F));
}
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) <= 5e+69) tmp = Float64(Float64(-sqrt(Float64(Float64(t_0 * Float64(2.0 * F)) * Float64(A + Float64(C + hypot(B_m, Float64(A - C))))))) / t_0); else tmp = Float64(Float64(sqrt(2.0) / B_m) * Float64(sqrt(Float64(C + hypot(C, B_m))) * Float64(-sqrt(F)))); 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], 5e+69], N[((-N[Sqrt[N[(N[(t$95$0 * N[(2.0 * F), $MachinePrecision]), $MachinePrecision] * N[(A + N[(C + N[Sqrt[B$95$m ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], N[(N[(N[Sqrt[2.0], $MachinePrecision] / B$95$m), $MachinePrecision] * N[(N[Sqrt[N[(C + N[Sqrt[C ^ 2 + B$95$m ^ 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-N[Sqrt[F], $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)\\
\mathbf{if}\;{B\_m}^{2} \leq 5 \cdot 10^{+69}:\\
\;\;\;\;\frac{-\sqrt{\left(t\_0 \cdot \left(2 \cdot F\right)\right) \cdot \left(A + \left(C + \mathsf{hypot}\left(B\_m, A - C\right)\right)\right)}}{t\_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{2}}{B\_m} \cdot \left(\sqrt{C + \mathsf{hypot}\left(C, B\_m\right)} \cdot \left(-\sqrt{F}\right)\right)\\
\end{array}
\end{array}
if (pow.f64 B 2) < 5.00000000000000036e69Initial program 23.0%
Simplified32.9%
if 5.00000000000000036e69 < (pow.f64 B 2) Initial program 11.7%
Taylor expanded in A around 0 9.2%
mul-1-neg9.2%
distribute-rgt-neg-in9.2%
unpow29.2%
unpow29.2%
hypot-def25.1%
Simplified25.1%
pow1/225.1%
*-commutative25.1%
unpow-prod-down36.6%
pow1/236.6%
hypot-udef10.9%
unpow210.9%
unpow210.9%
+-commutative10.9%
unpow210.9%
unpow210.9%
hypot-def36.6%
pow1/236.6%
Applied egg-rr36.6%
Final simplification34.5%
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)))))
(if (<= (pow B_m 2.0) 5e-82)
(/ (- (sqrt (* (* 2.0 (* F t_0)) (* 2.0 C)))) t_0)
(* (sqrt (+ C (hypot C B_m))) (* (/ (sqrt 2.0) B_m) (- (sqrt F)))))))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 tmp;
if (pow(B_m, 2.0) <= 5e-82) {
tmp = -sqrt(((2.0 * (F * t_0)) * (2.0 * C))) / t_0;
} else {
tmp = sqrt((C + hypot(C, B_m))) * ((sqrt(2.0) / B_m) * -sqrt(F));
}
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 tmp;
if (Math.pow(B_m, 2.0) <= 5e-82) {
tmp = -Math.sqrt(((2.0 * (F * t_0)) * (2.0 * C))) / t_0;
} else {
tmp = Math.sqrt((C + Math.hypot(C, B_m))) * ((Math.sqrt(2.0) / B_m) * -Math.sqrt(F));
}
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)) tmp = 0 if math.pow(B_m, 2.0) <= 5e-82: tmp = -math.sqrt(((2.0 * (F * t_0)) * (2.0 * C))) / t_0 else: tmp = math.sqrt((C + math.hypot(C, B_m))) * ((math.sqrt(2.0) / B_m) * -math.sqrt(F)) 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))) tmp = 0.0 if ((B_m ^ 2.0) <= 5e-82) tmp = Float64(Float64(-sqrt(Float64(Float64(2.0 * Float64(F * t_0)) * Float64(2.0 * C)))) / t_0); else tmp = Float64(sqrt(Float64(C + hypot(C, B_m))) * Float64(Float64(sqrt(2.0) / B_m) * Float64(-sqrt(F)))); 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)); tmp = 0.0; if ((B_m ^ 2.0) <= 5e-82) tmp = -sqrt(((2.0 * (F * t_0)) * (2.0 * C))) / t_0; else tmp = sqrt((C + hypot(C, B_m))) * ((sqrt(2.0) / B_m) * -sqrt(F)); 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]}, If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 5e-82], 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], N[(N[Sqrt[N[(C + N[Sqrt[C ^ 2 + B$95$m ^ 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[(N[Sqrt[2.0], $MachinePrecision] / B$95$m), $MachinePrecision] * (-N[Sqrt[F], $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)\\
\mathbf{if}\;{B\_m}^{2} \leq 5 \cdot 10^{-82}:\\
\;\;\;\;\frac{-\sqrt{\left(2 \cdot \left(F \cdot t\_0\right)\right) \cdot \left(2 \cdot C\right)}}{t\_0}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{C + \mathsf{hypot}\left(C, B\_m\right)} \cdot \left(\frac{\sqrt{2}}{B\_m} \cdot \left(-\sqrt{F}\right)\right)\\
\end{array}
\end{array}
if (pow.f64 B 2) < 4.9999999999999998e-82Initial program 17.4%
Taylor expanded in A around -inf 28.9%
if 4.9999999999999998e-82 < (pow.f64 B 2) Initial program 18.7%
Taylor expanded in A around 0 9.1%
mul-1-neg9.1%
Simplified9.1%
add-cbrt-cube7.1%
pow37.1%
Applied egg-rr12.4%
rem-cbrt-cube22.3%
div-inv22.3%
unpow1/222.3%
*-commutative22.3%
sqrt-prod22.2%
sqrt-prod31.1%
*-commutative31.1%
add-sqr-sqrt31.1%
sqrt-prod22.2%
sqr-neg22.2%
sqrt-unprod0.6%
add-sqr-sqrt34.4%
associate-*r*34.3%
Applied egg-rr28.4%
Final simplification28.6%
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 (fma B_m B_m (* -4.0 (* A C))))
(t_2 (* 2.0 (* F t_0))))
(if (<= B_m 3.85e-41)
(/ (- (sqrt (* t_2 (* 2.0 C)))) t_0)
(if (<= B_m 5.2e-7)
(/ (- (sqrt (* t_2 (+ A (hypot B_m A))))) t_0)
(if (<= B_m 1.0)
(/
(- (sqrt (* (* 2.0 t_1) (* F (+ (hypot (- A C) B_m) (+ A C))))))
t_1)
(*
(/ (sqrt 2.0) B_m)
(* (sqrt (+ C (hypot C B_m))) (- (sqrt F)))))))))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 = fma(B_m, B_m, (-4.0 * (A * C)));
double t_2 = 2.0 * (F * t_0);
double tmp;
if (B_m <= 3.85e-41) {
tmp = -sqrt((t_2 * (2.0 * C))) / t_0;
} else if (B_m <= 5.2e-7) {
tmp = -sqrt((t_2 * (A + hypot(B_m, A)))) / t_0;
} else if (B_m <= 1.0) {
tmp = -sqrt(((2.0 * t_1) * (F * (hypot((A - C), B_m) + (A + C))))) / t_1;
} else {
tmp = (sqrt(2.0) / B_m) * (sqrt((C + hypot(C, B_m))) * -sqrt(F));
}
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 = fma(B_m, B_m, Float64(-4.0 * Float64(A * C))) t_2 = Float64(2.0 * Float64(F * t_0)) tmp = 0.0 if (B_m <= 3.85e-41) tmp = Float64(Float64(-sqrt(Float64(t_2 * Float64(2.0 * C)))) / t_0); elseif (B_m <= 5.2e-7) tmp = Float64(Float64(-sqrt(Float64(t_2 * Float64(A + hypot(B_m, A))))) / t_0); elseif (B_m <= 1.0) tmp = Float64(Float64(-sqrt(Float64(Float64(2.0 * t_1) * Float64(F * Float64(hypot(Float64(A - C), B_m) + Float64(A + C)))))) / t_1); else tmp = Float64(Float64(sqrt(2.0) / B_m) * Float64(sqrt(Float64(C + hypot(C, B_m))) * Float64(-sqrt(F)))); end return 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[(B$95$m * B$95$m + N[(-4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(2.0 * N[(F * t$95$0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[B$95$m, 3.85e-41], N[((-N[Sqrt[N[(t$95$2 * N[(2.0 * C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], If[LessEqual[B$95$m, 5.2e-7], N[((-N[Sqrt[N[(t$95$2 * N[(A + N[Sqrt[B$95$m ^ 2 + A ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], If[LessEqual[B$95$m, 1.0], N[((-N[Sqrt[N[(N[(2.0 * t$95$1), $MachinePrecision] * N[(F * N[(N[Sqrt[N[(A - C), $MachinePrecision] ^ 2 + B$95$m ^ 2], $MachinePrecision] + N[(A + C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$1), $MachinePrecision], N[(N[(N[Sqrt[2.0], $MachinePrecision] / B$95$m), $MachinePrecision] * N[(N[Sqrt[N[(C + N[Sqrt[C ^ 2 + B$95$m ^ 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-N[Sqrt[F], $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 := \mathsf{fma}\left(B\_m, B\_m, -4 \cdot \left(A \cdot C\right)\right)\\
t_2 := 2 \cdot \left(F \cdot t\_0\right)\\
\mathbf{if}\;B\_m \leq 3.85 \cdot 10^{-41}:\\
\;\;\;\;\frac{-\sqrt{t\_2 \cdot \left(2 \cdot C\right)}}{t\_0}\\
\mathbf{elif}\;B\_m \leq 5.2 \cdot 10^{-7}:\\
\;\;\;\;\frac{-\sqrt{t\_2 \cdot \left(A + \mathsf{hypot}\left(B\_m, A\right)\right)}}{t\_0}\\
\mathbf{elif}\;B\_m \leq 1:\\
\;\;\;\;\frac{-\sqrt{\left(2 \cdot t\_1\right) \cdot \left(F \cdot \left(\mathsf{hypot}\left(A - C, B\_m\right) + \left(A + C\right)\right)\right)}}{t\_1}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{2}}{B\_m} \cdot \left(\sqrt{C + \mathsf{hypot}\left(C, B\_m\right)} \cdot \left(-\sqrt{F}\right)\right)\\
\end{array}
\end{array}
if B < 3.8499999999999999e-41Initial program 19.1%
Taylor expanded in A around -inf 19.2%
if 3.8499999999999999e-41 < B < 5.19999999999999998e-7Initial program 35.9%
Taylor expanded in C around 0 37.2%
+-commutative37.2%
unpow237.2%
unpow237.2%
hypot-def68.7%
Simplified68.7%
if 5.19999999999999998e-7 < B < 1Initial program 100.0%
neg-sub0100.0%
div-sub100.0%
associate-*l*100.0%
Applied egg-rr100.0%
div0100.0%
neg-sub0100.0%
distribute-neg-frac100.0%
Simplified100.0%
if 1 < B Initial program 12.6%
Taylor expanded in A around 0 17.3%
mul-1-neg17.3%
distribute-rgt-neg-in17.3%
unpow217.3%
unpow217.3%
hypot-def43.5%
Simplified43.5%
pow1/243.5%
*-commutative43.5%
unpow-prod-down61.9%
pow1/261.9%
hypot-udef20.1%
unpow220.1%
unpow220.1%
+-commutative20.1%
unpow220.1%
unpow220.1%
hypot-def61.9%
pow1/261.9%
Applied egg-rr61.9%
Final simplification32.0%
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 (* 2.0 (* F t_0))))
(if (<= B_m 2.6e-41)
(/ (- (sqrt (* t_1 (* 2.0 C)))) t_0)
(if (<= B_m 0.96)
(/ (- (sqrt (* t_1 (+ A (hypot B_m A))))) t_0)
(* (/ (sqrt 2.0) B_m) (* (sqrt (+ C (hypot C B_m))) (- (sqrt F))))))))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 = 2.0 * (F * t_0);
double tmp;
if (B_m <= 2.6e-41) {
tmp = -sqrt((t_1 * (2.0 * C))) / t_0;
} else if (B_m <= 0.96) {
tmp = -sqrt((t_1 * (A + hypot(B_m, A)))) / t_0;
} else {
tmp = (sqrt(2.0) / B_m) * (sqrt((C + hypot(C, B_m))) * -sqrt(F));
}
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 = 2.0 * (F * t_0);
double tmp;
if (B_m <= 2.6e-41) {
tmp = -Math.sqrt((t_1 * (2.0 * C))) / t_0;
} else if (B_m <= 0.96) {
tmp = -Math.sqrt((t_1 * (A + Math.hypot(B_m, A)))) / t_0;
} else {
tmp = (Math.sqrt(2.0) / B_m) * (Math.sqrt((C + Math.hypot(C, B_m))) * -Math.sqrt(F));
}
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 = 2.0 * (F * t_0) tmp = 0 if B_m <= 2.6e-41: tmp = -math.sqrt((t_1 * (2.0 * C))) / t_0 elif B_m <= 0.96: tmp = -math.sqrt((t_1 * (A + math.hypot(B_m, A)))) / t_0 else: tmp = (math.sqrt(2.0) / B_m) * (math.sqrt((C + math.hypot(C, B_m))) * -math.sqrt(F)) 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(2.0 * Float64(F * t_0)) tmp = 0.0 if (B_m <= 2.6e-41) tmp = Float64(Float64(-sqrt(Float64(t_1 * Float64(2.0 * C)))) / t_0); elseif (B_m <= 0.96) tmp = Float64(Float64(-sqrt(Float64(t_1 * Float64(A + hypot(B_m, A))))) / t_0); else tmp = Float64(Float64(sqrt(2.0) / B_m) * Float64(sqrt(Float64(C + hypot(C, B_m))) * Float64(-sqrt(F)))); 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 = 2.0 * (F * t_0); tmp = 0.0; if (B_m <= 2.6e-41) tmp = -sqrt((t_1 * (2.0 * C))) / t_0; elseif (B_m <= 0.96) tmp = -sqrt((t_1 * (A + hypot(B_m, A)))) / t_0; else tmp = (sqrt(2.0) / B_m) * (sqrt((C + hypot(C, B_m))) * -sqrt(F)); 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[(2.0 * N[(F * t$95$0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[B$95$m, 2.6e-41], N[((-N[Sqrt[N[(t$95$1 * N[(2.0 * C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], If[LessEqual[B$95$m, 0.96], N[((-N[Sqrt[N[(t$95$1 * N[(A + N[Sqrt[B$95$m ^ 2 + A ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], N[(N[(N[Sqrt[2.0], $MachinePrecision] / B$95$m), $MachinePrecision] * N[(N[Sqrt[N[(C + N[Sqrt[C ^ 2 + B$95$m ^ 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-N[Sqrt[F], $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 := 2 \cdot \left(F \cdot t\_0\right)\\
\mathbf{if}\;B\_m \leq 2.6 \cdot 10^{-41}:\\
\;\;\;\;\frac{-\sqrt{t\_1 \cdot \left(2 \cdot C\right)}}{t\_0}\\
\mathbf{elif}\;B\_m \leq 0.96:\\
\;\;\;\;\frac{-\sqrt{t\_1 \cdot \left(A + \mathsf{hypot}\left(B\_m, A\right)\right)}}{t\_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{2}}{B\_m} \cdot \left(\sqrt{C + \mathsf{hypot}\left(C, B\_m\right)} \cdot \left(-\sqrt{F}\right)\right)\\
\end{array}
\end{array}
if B < 2.5999999999999999e-41Initial program 19.1%
Taylor expanded in A around -inf 19.2%
if 2.5999999999999999e-41 < B < 0.95999999999999996Initial program 45.0%
Taylor expanded in C around 0 33.2%
+-commutative33.2%
unpow233.2%
unpow233.2%
hypot-def60.2%
Simplified60.2%
if 0.95999999999999996 < B Initial program 12.6%
Taylor expanded in A around 0 17.3%
mul-1-neg17.3%
distribute-rgt-neg-in17.3%
unpow217.3%
unpow217.3%
hypot-def43.5%
Simplified43.5%
pow1/243.5%
*-commutative43.5%
unpow-prod-down61.9%
pow1/261.9%
hypot-udef20.1%
unpow220.1%
unpow220.1%
+-commutative20.1%
unpow220.1%
unpow220.1%
hypot-def61.9%
pow1/261.9%
Applied egg-rr61.9%
Final simplification31.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)))))
(if (<= B_m 3.8e-39)
(/ (- (sqrt (* (* 2.0 (* F t_0)) (* 2.0 C)))) t_0)
(* (sqrt F) (* (sqrt (+ C (hypot C B_m))) (- (/ (sqrt 2.0) B_m)))))))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 tmp;
if (B_m <= 3.8e-39) {
tmp = -sqrt(((2.0 * (F * t_0)) * (2.0 * C))) / t_0;
} else {
tmp = sqrt(F) * (sqrt((C + hypot(C, B_m))) * -(sqrt(2.0) / B_m));
}
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 tmp;
if (B_m <= 3.8e-39) {
tmp = -Math.sqrt(((2.0 * (F * t_0)) * (2.0 * C))) / t_0;
} else {
tmp = Math.sqrt(F) * (Math.sqrt((C + Math.hypot(C, B_m))) * -(Math.sqrt(2.0) / B_m));
}
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)) tmp = 0 if B_m <= 3.8e-39: tmp = -math.sqrt(((2.0 * (F * t_0)) * (2.0 * C))) / t_0 else: tmp = math.sqrt(F) * (math.sqrt((C + math.hypot(C, B_m))) * -(math.sqrt(2.0) / B_m)) 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))) tmp = 0.0 if (B_m <= 3.8e-39) tmp = Float64(Float64(-sqrt(Float64(Float64(2.0 * Float64(F * t_0)) * Float64(2.0 * C)))) / t_0); else tmp = Float64(sqrt(F) * Float64(sqrt(Float64(C + hypot(C, B_m))) * Float64(-Float64(sqrt(2.0) / B_m)))); 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)); tmp = 0.0; if (B_m <= 3.8e-39) tmp = -sqrt(((2.0 * (F * t_0)) * (2.0 * C))) / t_0; else tmp = sqrt(F) * (sqrt((C + hypot(C, B_m))) * -(sqrt(2.0) / B_m)); 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]}, If[LessEqual[B$95$m, 3.8e-39], 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], N[(N[Sqrt[F], $MachinePrecision] * N[(N[Sqrt[N[(C + N[Sqrt[C ^ 2 + B$95$m ^ 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-N[(N[Sqrt[2.0], $MachinePrecision] / B$95$m), $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)\\
\mathbf{if}\;B\_m \leq 3.8 \cdot 10^{-39}:\\
\;\;\;\;\frac{-\sqrt{\left(2 \cdot \left(F \cdot t\_0\right)\right) \cdot \left(2 \cdot C\right)}}{t\_0}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{F} \cdot \left(\sqrt{C + \mathsf{hypot}\left(C, B\_m\right)} \cdot \left(-\frac{\sqrt{2}}{B\_m}\right)\right)\\
\end{array}
\end{array}
if B < 3.8000000000000002e-39Initial program 19.1%
Taylor expanded in A around -inf 19.2%
if 3.8000000000000002e-39 < B Initial program 15.7%
Taylor expanded in A around 0 16.2%
mul-1-neg16.2%
Simplified16.2%
add-cbrt-cube12.2%
pow312.2%
Applied egg-rr21.0%
rem-cbrt-cube40.1%
div-inv40.1%
unpow1/240.0%
*-commutative40.0%
sqrt-prod40.0%
sqrt-prod56.7%
*-commutative56.7%
add-sqr-sqrt56.6%
sqrt-prod40.0%
sqr-neg40.0%
sqrt-unprod0.5%
add-sqr-sqrt2.4%
associate-*r*2.4%
Applied egg-rr56.7%
Final simplification30.2%
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)))))
(if (<= B_m 2.22e-41)
(/ (- (sqrt (* (* 2.0 (* F t_0)) (* 2.0 C)))) t_0)
(* (/ (sqrt 2.0) B_m) (* (sqrt (+ C (hypot C B_m))) (- (sqrt F)))))))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 tmp;
if (B_m <= 2.22e-41) {
tmp = -sqrt(((2.0 * (F * t_0)) * (2.0 * C))) / t_0;
} else {
tmp = (sqrt(2.0) / B_m) * (sqrt((C + hypot(C, B_m))) * -sqrt(F));
}
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 tmp;
if (B_m <= 2.22e-41) {
tmp = -Math.sqrt(((2.0 * (F * t_0)) * (2.0 * C))) / t_0;
} else {
tmp = (Math.sqrt(2.0) / B_m) * (Math.sqrt((C + Math.hypot(C, B_m))) * -Math.sqrt(F));
}
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)) tmp = 0 if B_m <= 2.22e-41: tmp = -math.sqrt(((2.0 * (F * t_0)) * (2.0 * C))) / t_0 else: tmp = (math.sqrt(2.0) / B_m) * (math.sqrt((C + math.hypot(C, B_m))) * -math.sqrt(F)) 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))) tmp = 0.0 if (B_m <= 2.22e-41) tmp = Float64(Float64(-sqrt(Float64(Float64(2.0 * Float64(F * t_0)) * Float64(2.0 * C)))) / t_0); else tmp = Float64(Float64(sqrt(2.0) / B_m) * Float64(sqrt(Float64(C + hypot(C, B_m))) * Float64(-sqrt(F)))); 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)); tmp = 0.0; if (B_m <= 2.22e-41) tmp = -sqrt(((2.0 * (F * t_0)) * (2.0 * C))) / t_0; else tmp = (sqrt(2.0) / B_m) * (sqrt((C + hypot(C, B_m))) * -sqrt(F)); 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]}, If[LessEqual[B$95$m, 2.22e-41], 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], N[(N[(N[Sqrt[2.0], $MachinePrecision] / B$95$m), $MachinePrecision] * N[(N[Sqrt[N[(C + N[Sqrt[C ^ 2 + B$95$m ^ 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-N[Sqrt[F], $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)\\
\mathbf{if}\;B\_m \leq 2.22 \cdot 10^{-41}:\\
\;\;\;\;\frac{-\sqrt{\left(2 \cdot \left(F \cdot t\_0\right)\right) \cdot \left(2 \cdot C\right)}}{t\_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{2}}{B\_m} \cdot \left(\sqrt{C + \mathsf{hypot}\left(C, B\_m\right)} \cdot \left(-\sqrt{F}\right)\right)\\
\end{array}
\end{array}
if B < 2.2200000000000001e-41Initial program 19.1%
Taylor expanded in A around -inf 19.2%
if 2.2200000000000001e-41 < B Initial program 15.7%
Taylor expanded in A around 0 16.2%
mul-1-neg16.2%
distribute-rgt-neg-in16.2%
unpow216.2%
unpow216.2%
hypot-def39.9%
Simplified39.9%
pow1/240.0%
*-commutative40.0%
unpow-prod-down56.7%
pow1/256.7%
hypot-udef18.8%
unpow218.8%
unpow218.8%
+-commutative18.8%
unpow218.8%
unpow218.8%
hypot-def56.7%
pow1/256.7%
Applied egg-rr56.7%
Final simplification30.2%
B_m = (fabs.f64 B)
(FPCore (A B_m C F)
:precision binary64
(if (<= F -3.8e-184)
(* (/ (sqrt 2.0) B_m) (sqrt (* -0.5 (* F (/ (pow B_m 2.0) A)))))
(if (<= F -1e-310)
(/
(- (sqrt (* (* 2.0 (* (* A -4.0) (* C F))) (+ C (hypot B_m C)))))
(- (pow B_m 2.0) (* C (* A 4.0))))
(if (<= F 2.7e+68)
(* (sqrt (* (+ C (hypot C B_m)) (* 2.0 F))) (/ -1.0 B_m))
(* (sqrt 2.0) (- (sqrt (/ F B_m))))))))B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
double tmp;
if (F <= -3.8e-184) {
tmp = (sqrt(2.0) / B_m) * sqrt((-0.5 * (F * (pow(B_m, 2.0) / A))));
} else if (F <= -1e-310) {
tmp = -sqrt(((2.0 * ((A * -4.0) * (C * F))) * (C + hypot(B_m, C)))) / (pow(B_m, 2.0) - (C * (A * 4.0)));
} else if (F <= 2.7e+68) {
tmp = sqrt(((C + hypot(C, B_m)) * (2.0 * F))) * (-1.0 / B_m);
} else {
tmp = sqrt(2.0) * -sqrt((F / 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 <= -3.8e-184) {
tmp = (Math.sqrt(2.0) / B_m) * Math.sqrt((-0.5 * (F * (Math.pow(B_m, 2.0) / A))));
} else if (F <= -1e-310) {
tmp = -Math.sqrt(((2.0 * ((A * -4.0) * (C * F))) * (C + Math.hypot(B_m, C)))) / (Math.pow(B_m, 2.0) - (C * (A * 4.0)));
} else if (F <= 2.7e+68) {
tmp = Math.sqrt(((C + Math.hypot(C, B_m)) * (2.0 * F))) * (-1.0 / B_m);
} else {
tmp = Math.sqrt(2.0) * -Math.sqrt((F / B_m));
}
return tmp;
}
B_m = math.fabs(B) def code(A, B_m, C, F): tmp = 0 if F <= -3.8e-184: tmp = (math.sqrt(2.0) / B_m) * math.sqrt((-0.5 * (F * (math.pow(B_m, 2.0) / A)))) elif F <= -1e-310: tmp = -math.sqrt(((2.0 * ((A * -4.0) * (C * F))) * (C + math.hypot(B_m, C)))) / (math.pow(B_m, 2.0) - (C * (A * 4.0))) elif F <= 2.7e+68: tmp = math.sqrt(((C + math.hypot(C, B_m)) * (2.0 * F))) * (-1.0 / B_m) else: tmp = math.sqrt(2.0) * -math.sqrt((F / B_m)) return tmp
B_m = abs(B) function code(A, B_m, C, F) tmp = 0.0 if (F <= -3.8e-184) tmp = Float64(Float64(sqrt(2.0) / B_m) * sqrt(Float64(-0.5 * Float64(F * Float64((B_m ^ 2.0) / A))))); elseif (F <= -1e-310) tmp = Float64(Float64(-sqrt(Float64(Float64(2.0 * Float64(Float64(A * -4.0) * Float64(C * F))) * Float64(C + hypot(B_m, C))))) / Float64((B_m ^ 2.0) - Float64(C * Float64(A * 4.0)))); elseif (F <= 2.7e+68) tmp = Float64(sqrt(Float64(Float64(C + hypot(C, B_m)) * Float64(2.0 * F))) * Float64(-1.0 / B_m)); else tmp = Float64(sqrt(2.0) * Float64(-sqrt(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 <= -3.8e-184) tmp = (sqrt(2.0) / B_m) * sqrt((-0.5 * (F * ((B_m ^ 2.0) / A)))); elseif (F <= -1e-310) tmp = -sqrt(((2.0 * ((A * -4.0) * (C * F))) * (C + hypot(B_m, C)))) / ((B_m ^ 2.0) - (C * (A * 4.0))); elseif (F <= 2.7e+68) tmp = sqrt(((C + hypot(C, B_m)) * (2.0 * F))) * (-1.0 / B_m); else tmp = sqrt(2.0) * -sqrt((F / B_m)); end tmp_2 = tmp; end
B_m = N[Abs[B], $MachinePrecision] code[A_, B$95$m_, C_, F_] := If[LessEqual[F, -3.8e-184], N[(N[(N[Sqrt[2.0], $MachinePrecision] / B$95$m), $MachinePrecision] * N[Sqrt[N[(-0.5 * N[(F * N[(N[Power[B$95$m, 2.0], $MachinePrecision] / A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -1e-310], N[((-N[Sqrt[N[(N[(2.0 * N[(N[(A * -4.0), $MachinePrecision] * N[(C * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(C + N[Sqrt[B$95$m ^ 2 + C ^ 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[F, 2.7e+68], N[(N[Sqrt[N[(N[(C + N[Sqrt[C ^ 2 + B$95$m ^ 2], $MachinePrecision]), $MachinePrecision] * N[(2.0 * F), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(-1.0 / B$95$m), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[2.0], $MachinePrecision] * (-N[Sqrt[N[(F / B$95$m), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]]]]
\begin{array}{l}
B_m = \left|B\right|
\\
\begin{array}{l}
\mathbf{if}\;F \leq -3.8 \cdot 10^{-184}:\\
\;\;\;\;\frac{\sqrt{2}}{B\_m} \cdot \sqrt{-0.5 \cdot \left(F \cdot \frac{{B\_m}^{2}}{A}\right)}\\
\mathbf{elif}\;F \leq -1 \cdot 10^{-310}:\\
\;\;\;\;\frac{-\sqrt{\left(2 \cdot \left(\left(A \cdot -4\right) \cdot \left(C \cdot F\right)\right)\right) \cdot \left(C + \mathsf{hypot}\left(B\_m, C\right)\right)}}{{B\_m}^{2} - C \cdot \left(A \cdot 4\right)}\\
\mathbf{elif}\;F \leq 2.7 \cdot 10^{+68}:\\
\;\;\;\;\sqrt{\left(C + \mathsf{hypot}\left(C, B\_m\right)\right) \cdot \left(2 \cdot F\right)} \cdot \frac{-1}{B\_m}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{2} \cdot \left(-\sqrt{\frac{F}{B\_m}}\right)\\
\end{array}
\end{array}
if F < -3.80000000000000017e-184Initial program 26.3%
Taylor expanded in C around 0 0.0%
mul-1-neg0.0%
distribute-rgt-neg-in0.0%
+-commutative0.0%
unpow20.0%
unpow20.0%
hypot-def0.0%
Simplified0.0%
Taylor expanded in A around -inf 12.6%
add-sqr-sqrt12.6%
sqr-neg12.6%
sqrt-unprod1.3%
add-sqr-sqrt31.8%
add-sqr-sqrt31.8%
distribute-rgt-neg-in31.8%
pow1/231.8%
sqrt-pow131.7%
associate-/l*17.5%
metadata-eval17.5%
pow1/217.5%
sqrt-pow117.5%
Applied egg-rr17.7%
distribute-rgt-neg-out17.7%
pow-sqr17.8%
metadata-eval17.8%
unpow1/217.8%
associate-/r/31.9%
*-commutative31.9%
Simplified31.9%
if -3.80000000000000017e-184 < F < -9.999999999999969e-311Initial program 30.2%
Taylor expanded in A around 0 17.3%
unpow217.3%
unpow217.3%
hypot-def38.0%
Simplified38.0%
Taylor expanded in B around 0 38.4%
associate-*r*38.4%
*-commutative38.4%
*-commutative38.4%
Simplified38.4%
if -9.999999999999969e-311 < F < 2.69999999999999991e68Initial program 23.1%
Taylor expanded in A around 0 10.7%
mul-1-neg10.7%
Simplified10.7%
add-cbrt-cube8.5%
pow38.5%
Applied egg-rr14.2%
rem-cbrt-cube24.5%
div-inv24.5%
unpow1/224.5%
associate-*r*24.5%
Applied egg-rr24.5%
if 2.69999999999999991e68 < F Initial program 6.2%
Taylor expanded in A around 0 4.7%
mul-1-neg4.7%
distribute-rgt-neg-in4.7%
unpow24.7%
unpow24.7%
hypot-def6.1%
Simplified6.1%
Taylor expanded in C around 0 16.1%
mul-1-neg16.1%
Simplified16.1%
Final simplification23.0%
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)))))
(if (<= F -1e-310)
(/ (- (sqrt (* (* 2.0 (* F t_0)) (* 2.0 C)))) t_0)
(if (<= F 8e+67)
(* (sqrt (* (+ C (hypot C B_m)) (* 2.0 F))) (/ -1.0 B_m))
(* (sqrt 2.0) (- (sqrt (/ F B_m))))))))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 tmp;
if (F <= -1e-310) {
tmp = -sqrt(((2.0 * (F * t_0)) * (2.0 * C))) / t_0;
} else if (F <= 8e+67) {
tmp = sqrt(((C + hypot(C, B_m)) * (2.0 * F))) * (-1.0 / B_m);
} else {
tmp = sqrt(2.0) * -sqrt((F / B_m));
}
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 tmp;
if (F <= -1e-310) {
tmp = -Math.sqrt(((2.0 * (F * t_0)) * (2.0 * C))) / t_0;
} else if (F <= 8e+67) {
tmp = Math.sqrt(((C + Math.hypot(C, B_m)) * (2.0 * F))) * (-1.0 / B_m);
} else {
tmp = Math.sqrt(2.0) * -Math.sqrt((F / B_m));
}
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)) tmp = 0 if F <= -1e-310: tmp = -math.sqrt(((2.0 * (F * t_0)) * (2.0 * C))) / t_0 elif F <= 8e+67: tmp = math.sqrt(((C + math.hypot(C, B_m)) * (2.0 * F))) * (-1.0 / B_m) else: tmp = math.sqrt(2.0) * -math.sqrt((F / B_m)) 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))) tmp = 0.0 if (F <= -1e-310) tmp = Float64(Float64(-sqrt(Float64(Float64(2.0 * Float64(F * t_0)) * Float64(2.0 * C)))) / t_0); elseif (F <= 8e+67) tmp = Float64(sqrt(Float64(Float64(C + hypot(C, B_m)) * Float64(2.0 * F))) * Float64(-1.0 / B_m)); else tmp = Float64(sqrt(2.0) * Float64(-sqrt(Float64(F / B_m)))); 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)); tmp = 0.0; if (F <= -1e-310) tmp = -sqrt(((2.0 * (F * t_0)) * (2.0 * C))) / t_0; elseif (F <= 8e+67) tmp = sqrt(((C + hypot(C, B_m)) * (2.0 * F))) * (-1.0 / B_m); else tmp = sqrt(2.0) * -sqrt((F / B_m)); 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]}, If[LessEqual[F, -1e-310], 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], If[LessEqual[F, 8e+67], N[(N[Sqrt[N[(N[(C + N[Sqrt[C ^ 2 + B$95$m ^ 2], $MachinePrecision]), $MachinePrecision] * N[(2.0 * F), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(-1.0 / B$95$m), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[2.0], $MachinePrecision] * (-N[Sqrt[N[(F / B$95$m), $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)\\
\mathbf{if}\;F \leq -1 \cdot 10^{-310}:\\
\;\;\;\;\frac{-\sqrt{\left(2 \cdot \left(F \cdot t\_0\right)\right) \cdot \left(2 \cdot C\right)}}{t\_0}\\
\mathbf{elif}\;F \leq 8 \cdot 10^{+67}:\\
\;\;\;\;\sqrt{\left(C + \mathsf{hypot}\left(C, B\_m\right)\right) \cdot \left(2 \cdot F\right)} \cdot \frac{-1}{B\_m}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{2} \cdot \left(-\sqrt{\frac{F}{B\_m}}\right)\\
\end{array}
\end{array}
if F < -9.999999999999969e-311Initial program 27.9%
Taylor expanded in A around -inf 31.3%
if -9.999999999999969e-311 < F < 7.99999999999999986e67Initial program 23.1%
Taylor expanded in A around 0 10.7%
mul-1-neg10.7%
Simplified10.7%
add-cbrt-cube8.5%
pow38.5%
Applied egg-rr14.2%
rem-cbrt-cube24.5%
div-inv24.5%
unpow1/224.5%
associate-*r*24.5%
Applied egg-rr24.5%
if 7.99999999999999986e67 < F Initial program 6.2%
Taylor expanded in A around 0 4.7%
mul-1-neg4.7%
distribute-rgt-neg-in4.7%
unpow24.7%
unpow24.7%
hypot-def6.1%
Simplified6.1%
Taylor expanded in C around 0 16.1%
mul-1-neg16.1%
Simplified16.1%
Final simplification22.6%
B_m = (fabs.f64 B)
(FPCore (A B_m C F)
:precision binary64
(if (<= F -1e-278)
(sqrt (* (* -0.5 (/ (pow B_m 2.0) (/ A F))) (/ 2.0 (pow B_m 2.0))))
(if (<= F 5.2e+68)
(* (sqrt (* (+ C (hypot C B_m)) (* 2.0 F))) (/ -1.0 B_m))
(* (sqrt 2.0) (- (sqrt (/ F B_m)))))))B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
double tmp;
if (F <= -1e-278) {
tmp = sqrt(((-0.5 * (pow(B_m, 2.0) / (A / F))) * (2.0 / pow(B_m, 2.0))));
} else if (F <= 5.2e+68) {
tmp = sqrt(((C + hypot(C, B_m)) * (2.0 * F))) * (-1.0 / B_m);
} else {
tmp = sqrt(2.0) * -sqrt((F / 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 <= -1e-278) {
tmp = Math.sqrt(((-0.5 * (Math.pow(B_m, 2.0) / (A / F))) * (2.0 / Math.pow(B_m, 2.0))));
} else if (F <= 5.2e+68) {
tmp = Math.sqrt(((C + Math.hypot(C, B_m)) * (2.0 * F))) * (-1.0 / B_m);
} else {
tmp = Math.sqrt(2.0) * -Math.sqrt((F / B_m));
}
return tmp;
}
B_m = math.fabs(B) def code(A, B_m, C, F): tmp = 0 if F <= -1e-278: tmp = math.sqrt(((-0.5 * (math.pow(B_m, 2.0) / (A / F))) * (2.0 / math.pow(B_m, 2.0)))) elif F <= 5.2e+68: tmp = math.sqrt(((C + math.hypot(C, B_m)) * (2.0 * F))) * (-1.0 / B_m) else: tmp = math.sqrt(2.0) * -math.sqrt((F / B_m)) return tmp
B_m = abs(B) function code(A, B_m, C, F) tmp = 0.0 if (F <= -1e-278) tmp = sqrt(Float64(Float64(-0.5 * Float64((B_m ^ 2.0) / Float64(A / F))) * Float64(2.0 / (B_m ^ 2.0)))); elseif (F <= 5.2e+68) tmp = Float64(sqrt(Float64(Float64(C + hypot(C, B_m)) * Float64(2.0 * F))) * Float64(-1.0 / B_m)); else tmp = Float64(sqrt(2.0) * Float64(-sqrt(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 <= -1e-278) tmp = sqrt(((-0.5 * ((B_m ^ 2.0) / (A / F))) * (2.0 / (B_m ^ 2.0)))); elseif (F <= 5.2e+68) tmp = sqrt(((C + hypot(C, B_m)) * (2.0 * F))) * (-1.0 / B_m); else tmp = sqrt(2.0) * -sqrt((F / B_m)); end tmp_2 = tmp; end
B_m = N[Abs[B], $MachinePrecision] code[A_, B$95$m_, C_, F_] := If[LessEqual[F, -1e-278], N[Sqrt[N[(N[(-0.5 * N[(N[Power[B$95$m, 2.0], $MachinePrecision] / N[(A / F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(2.0 / N[Power[B$95$m, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[F, 5.2e+68], N[(N[Sqrt[N[(N[(C + N[Sqrt[C ^ 2 + B$95$m ^ 2], $MachinePrecision]), $MachinePrecision] * N[(2.0 * F), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(-1.0 / B$95$m), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[2.0], $MachinePrecision] * (-N[Sqrt[N[(F / B$95$m), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]]]
\begin{array}{l}
B_m = \left|B\right|
\\
\begin{array}{l}
\mathbf{if}\;F \leq -1 \cdot 10^{-278}:\\
\;\;\;\;\sqrt{\left(-0.5 \cdot \frac{{B\_m}^{2}}{\frac{A}{F}}\right) \cdot \frac{2}{{B\_m}^{2}}}\\
\mathbf{elif}\;F \leq 5.2 \cdot 10^{+68}:\\
\;\;\;\;\sqrt{\left(C + \mathsf{hypot}\left(C, B\_m\right)\right) \cdot \left(2 \cdot F\right)} \cdot \frac{-1}{B\_m}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{2} \cdot \left(-\sqrt{\frac{F}{B\_m}}\right)\\
\end{array}
\end{array}
if F < -9.99999999999999938e-279Initial program 27.1%
Taylor expanded in C around 0 0.4%
mul-1-neg0.4%
distribute-rgt-neg-in0.4%
+-commutative0.4%
unpow20.4%
unpow20.4%
hypot-def0.4%
Simplified0.4%
Taylor expanded in A around -inf 9.8%
add-sqr-sqrt9.4%
sqrt-unprod19.7%
*-commutative19.7%
*-commutative19.7%
swap-sqr18.2%
sqr-neg18.2%
add-sqr-sqrt18.2%
associate-/l*18.4%
frac-times18.3%
rem-square-sqrt18.5%
unpow218.5%
Applied egg-rr18.5%
if -9.99999999999999938e-279 < F < 5.1999999999999996e68Initial program 23.4%
Taylor expanded in A around 0 10.5%
mul-1-neg10.5%
Simplified10.5%
add-cbrt-cube8.3%
pow38.3%
Applied egg-rr13.9%
rem-cbrt-cube24.0%
div-inv24.0%
unpow1/224.0%
associate-*r*24.0%
Applied egg-rr24.0%
if 5.1999999999999996e68 < F Initial program 6.2%
Taylor expanded in A around 0 4.7%
mul-1-neg4.7%
distribute-rgt-neg-in4.7%
unpow24.7%
unpow24.7%
hypot-def6.1%
Simplified6.1%
Taylor expanded in C around 0 16.1%
mul-1-neg16.1%
Simplified16.1%
Final simplification20.7%
B_m = (fabs.f64 B)
(FPCore (A B_m C F)
:precision binary64
(if (<= F -8.5e-304)
(* (/ (sqrt 2.0) B_m) (sqrt (* -0.5 (* F (/ (pow B_m 2.0) A)))))
(if (<= F 1.32e+70)
(* (sqrt (* (+ C (hypot C B_m)) (* 2.0 F))) (/ -1.0 B_m))
(* (sqrt 2.0) (- (sqrt (/ F B_m)))))))B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
double tmp;
if (F <= -8.5e-304) {
tmp = (sqrt(2.0) / B_m) * sqrt((-0.5 * (F * (pow(B_m, 2.0) / A))));
} else if (F <= 1.32e+70) {
tmp = sqrt(((C + hypot(C, B_m)) * (2.0 * F))) * (-1.0 / B_m);
} else {
tmp = sqrt(2.0) * -sqrt((F / 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 <= -8.5e-304) {
tmp = (Math.sqrt(2.0) / B_m) * Math.sqrt((-0.5 * (F * (Math.pow(B_m, 2.0) / A))));
} else if (F <= 1.32e+70) {
tmp = Math.sqrt(((C + Math.hypot(C, B_m)) * (2.0 * F))) * (-1.0 / B_m);
} else {
tmp = Math.sqrt(2.0) * -Math.sqrt((F / B_m));
}
return tmp;
}
B_m = math.fabs(B) def code(A, B_m, C, F): tmp = 0 if F <= -8.5e-304: tmp = (math.sqrt(2.0) / B_m) * math.sqrt((-0.5 * (F * (math.pow(B_m, 2.0) / A)))) elif F <= 1.32e+70: tmp = math.sqrt(((C + math.hypot(C, B_m)) * (2.0 * F))) * (-1.0 / B_m) else: tmp = math.sqrt(2.0) * -math.sqrt((F / B_m)) return tmp
B_m = abs(B) function code(A, B_m, C, F) tmp = 0.0 if (F <= -8.5e-304) tmp = Float64(Float64(sqrt(2.0) / B_m) * sqrt(Float64(-0.5 * Float64(F * Float64((B_m ^ 2.0) / A))))); elseif (F <= 1.32e+70) tmp = Float64(sqrt(Float64(Float64(C + hypot(C, B_m)) * Float64(2.0 * F))) * Float64(-1.0 / B_m)); else tmp = Float64(sqrt(2.0) * Float64(-sqrt(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 <= -8.5e-304) tmp = (sqrt(2.0) / B_m) * sqrt((-0.5 * (F * ((B_m ^ 2.0) / A)))); elseif (F <= 1.32e+70) tmp = sqrt(((C + hypot(C, B_m)) * (2.0 * F))) * (-1.0 / B_m); else tmp = sqrt(2.0) * -sqrt((F / B_m)); end tmp_2 = tmp; end
B_m = N[Abs[B], $MachinePrecision] code[A_, B$95$m_, C_, F_] := If[LessEqual[F, -8.5e-304], N[(N[(N[Sqrt[2.0], $MachinePrecision] / B$95$m), $MachinePrecision] * N[Sqrt[N[(-0.5 * N[(F * N[(N[Power[B$95$m, 2.0], $MachinePrecision] / A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.32e+70], N[(N[Sqrt[N[(N[(C + N[Sqrt[C ^ 2 + B$95$m ^ 2], $MachinePrecision]), $MachinePrecision] * N[(2.0 * F), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(-1.0 / B$95$m), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[2.0], $MachinePrecision] * (-N[Sqrt[N[(F / B$95$m), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]]]
\begin{array}{l}
B_m = \left|B\right|
\\
\begin{array}{l}
\mathbf{if}\;F \leq -8.5 \cdot 10^{-304}:\\
\;\;\;\;\frac{\sqrt{2}}{B\_m} \cdot \sqrt{-0.5 \cdot \left(F \cdot \frac{{B\_m}^{2}}{A}\right)}\\
\mathbf{elif}\;F \leq 1.32 \cdot 10^{+70}:\\
\;\;\;\;\sqrt{\left(C + \mathsf{hypot}\left(C, B\_m\right)\right) \cdot \left(2 \cdot F\right)} \cdot \frac{-1}{B\_m}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{2} \cdot \left(-\sqrt{\frac{F}{B\_m}}\right)\\
\end{array}
\end{array}
if F < -8.5e-304Initial program 28.6%
Taylor expanded in C around 0 0.5%
mul-1-neg0.5%
distribute-rgt-neg-in0.5%
+-commutative0.5%
unpow20.5%
unpow20.5%
hypot-def0.5%
Simplified0.5%
Taylor expanded in A around -inf 9.4%
add-sqr-sqrt9.4%
sqr-neg9.4%
sqrt-unprod2.6%
add-sqr-sqrt21.0%
add-sqr-sqrt21.0%
distribute-rgt-neg-in21.0%
pow1/221.0%
sqrt-pow121.0%
associate-/l*12.4%
metadata-eval12.4%
pow1/212.4%
sqrt-pow112.3%
Applied egg-rr12.5%
distribute-rgt-neg-out12.5%
pow-sqr12.5%
metadata-eval12.5%
unpow1/212.5%
associate-/r/21.1%
*-commutative21.1%
Simplified21.1%
if -8.5e-304 < F < 1.3199999999999999e70Initial program 23.0%
Taylor expanded in A around 0 10.6%
mul-1-neg10.6%
Simplified10.6%
add-cbrt-cube8.4%
pow38.4%
Applied egg-rr14.1%
rem-cbrt-cube24.3%
div-inv24.3%
unpow1/224.3%
associate-*r*24.3%
Applied egg-rr24.3%
if 1.3199999999999999e70 < F Initial program 6.2%
Taylor expanded in A around 0 4.7%
mul-1-neg4.7%
distribute-rgt-neg-in4.7%
unpow24.7%
unpow24.7%
hypot-def6.1%
Simplified6.1%
Taylor expanded in C around 0 16.1%
mul-1-neg16.1%
Simplified16.1%
Final simplification21.2%
B_m = (fabs.f64 B) (FPCore (A B_m C F) :precision binary64 (if (<= F 1.32e+70) (* (sqrt (* (+ C (hypot C B_m)) (* 2.0 F))) (/ -1.0 B_m)) (* (sqrt 2.0) (- (sqrt (/ F B_m))))))
B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
double tmp;
if (F <= 1.32e+70) {
tmp = sqrt(((C + hypot(C, B_m)) * (2.0 * F))) * (-1.0 / B_m);
} else {
tmp = sqrt(2.0) * -sqrt((F / 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 <= 1.32e+70) {
tmp = Math.sqrt(((C + Math.hypot(C, B_m)) * (2.0 * F))) * (-1.0 / B_m);
} else {
tmp = Math.sqrt(2.0) * -Math.sqrt((F / B_m));
}
return tmp;
}
B_m = math.fabs(B) def code(A, B_m, C, F): tmp = 0 if F <= 1.32e+70: tmp = math.sqrt(((C + math.hypot(C, B_m)) * (2.0 * F))) * (-1.0 / B_m) else: tmp = math.sqrt(2.0) * -math.sqrt((F / B_m)) return tmp
B_m = abs(B) function code(A, B_m, C, F) tmp = 0.0 if (F <= 1.32e+70) tmp = Float64(sqrt(Float64(Float64(C + hypot(C, B_m)) * Float64(2.0 * F))) * Float64(-1.0 / B_m)); else tmp = Float64(sqrt(2.0) * Float64(-sqrt(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 <= 1.32e+70) tmp = sqrt(((C + hypot(C, B_m)) * (2.0 * F))) * (-1.0 / B_m); else tmp = sqrt(2.0) * -sqrt((F / B_m)); end tmp_2 = tmp; end
B_m = N[Abs[B], $MachinePrecision] code[A_, B$95$m_, C_, F_] := If[LessEqual[F, 1.32e+70], N[(N[Sqrt[N[(N[(C + N[Sqrt[C ^ 2 + B$95$m ^ 2], $MachinePrecision]), $MachinePrecision] * N[(2.0 * F), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(-1.0 / B$95$m), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[2.0], $MachinePrecision] * (-N[Sqrt[N[(F / B$95$m), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]]
\begin{array}{l}
B_m = \left|B\right|
\\
\begin{array}{l}
\mathbf{if}\;F \leq 1.32 \cdot 10^{+70}:\\
\;\;\;\;\sqrt{\left(C + \mathsf{hypot}\left(C, B\_m\right)\right) \cdot \left(2 \cdot F\right)} \cdot \frac{-1}{B\_m}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{2} \cdot \left(-\sqrt{\frac{F}{B\_m}}\right)\\
\end{array}
\end{array}
if F < 1.3199999999999999e70Initial program 24.1%
Taylor expanded in A around 0 8.6%
mul-1-neg8.6%
Simplified8.6%
add-cbrt-cube6.8%
pow36.8%
Applied egg-rr11.5%
rem-cbrt-cube19.7%
div-inv19.7%
unpow1/219.6%
associate-*r*19.6%
Applied egg-rr19.6%
if 1.3199999999999999e70 < F Initial program 6.2%
Taylor expanded in A around 0 4.7%
mul-1-neg4.7%
distribute-rgt-neg-in4.7%
unpow24.7%
unpow24.7%
hypot-def6.1%
Simplified6.1%
Taylor expanded in C around 0 16.1%
mul-1-neg16.1%
Simplified16.1%
Final simplification18.4%
B_m = (fabs.f64 B) (FPCore (A B_m C F) :precision binary64 (if (<= F 1.55e+72) (/ (- (sqrt (* 2.0 (* F (+ C (hypot C B_m)))))) B_m) (* (sqrt 2.0) (- (sqrt (/ F B_m))))))
B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
double tmp;
if (F <= 1.55e+72) {
tmp = -sqrt((2.0 * (F * (C + hypot(C, B_m))))) / B_m;
} else {
tmp = sqrt(2.0) * -sqrt((F / 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 <= 1.55e+72) {
tmp = -Math.sqrt((2.0 * (F * (C + Math.hypot(C, B_m))))) / B_m;
} else {
tmp = Math.sqrt(2.0) * -Math.sqrt((F / B_m));
}
return tmp;
}
B_m = math.fabs(B) def code(A, B_m, C, F): tmp = 0 if F <= 1.55e+72: tmp = -math.sqrt((2.0 * (F * (C + math.hypot(C, B_m))))) / B_m else: tmp = math.sqrt(2.0) * -math.sqrt((F / B_m)) return tmp
B_m = abs(B) function code(A, B_m, C, F) tmp = 0.0 if (F <= 1.55e+72) tmp = Float64(Float64(-sqrt(Float64(2.0 * Float64(F * Float64(C + hypot(C, B_m)))))) / B_m); else tmp = Float64(sqrt(2.0) * Float64(-sqrt(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 <= 1.55e+72) tmp = -sqrt((2.0 * (F * (C + hypot(C, B_m))))) / B_m; else tmp = sqrt(2.0) * -sqrt((F / B_m)); end tmp_2 = tmp; end
B_m = N[Abs[B], $MachinePrecision] code[A_, B$95$m_, C_, F_] := If[LessEqual[F, 1.55e+72], N[((-N[Sqrt[N[(2.0 * N[(F * N[(C + N[Sqrt[C ^ 2 + B$95$m ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / B$95$m), $MachinePrecision], N[(N[Sqrt[2.0], $MachinePrecision] * (-N[Sqrt[N[(F / B$95$m), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]]
\begin{array}{l}
B_m = \left|B\right|
\\
\begin{array}{l}
\mathbf{if}\;F \leq 1.55 \cdot 10^{+72}:\\
\;\;\;\;\frac{-\sqrt{2 \cdot \left(F \cdot \left(C + \mathsf{hypot}\left(C, B\_m\right)\right)\right)}}{B\_m}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{2} \cdot \left(-\sqrt{\frac{F}{B\_m}}\right)\\
\end{array}
\end{array}
if F < 1.54999999999999994e72Initial program 24.1%
Taylor expanded in A around 0 8.6%
mul-1-neg8.6%
distribute-rgt-neg-in8.6%
unpow28.6%
unpow28.6%
hypot-def19.6%
Simplified19.6%
Applied egg-rr3.3%
expm1-def16.6%
expm1-log1p19.7%
distribute-neg-frac19.7%
unpow1/219.7%
Simplified19.7%
if 1.54999999999999994e72 < F Initial program 6.2%
Taylor expanded in A around 0 4.7%
mul-1-neg4.7%
distribute-rgt-neg-in4.7%
unpow24.7%
unpow24.7%
hypot-def6.1%
Simplified6.1%
Taylor expanded in C around 0 16.1%
mul-1-neg16.1%
Simplified16.1%
Final simplification18.5%
B_m = (fabs.f64 B) (FPCore (A B_m C F) :precision binary64 (if (<= C 3.8e+133) (* (sqrt 2.0) (- (sqrt (/ F B_m)))) (* (* (sqrt F) (sqrt C)) (/ (- 2.0) B_m))))
B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
double tmp;
if (C <= 3.8e+133) {
tmp = sqrt(2.0) * -sqrt((F / B_m));
} else {
tmp = (sqrt(F) * sqrt(C)) * (-2.0 / 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 (c <= 3.8d+133) then
tmp = sqrt(2.0d0) * -sqrt((f / b_m))
else
tmp = (sqrt(f) * sqrt(c)) * (-2.0d0 / 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 (C <= 3.8e+133) {
tmp = Math.sqrt(2.0) * -Math.sqrt((F / B_m));
} else {
tmp = (Math.sqrt(F) * Math.sqrt(C)) * (-2.0 / B_m);
}
return tmp;
}
B_m = math.fabs(B) def code(A, B_m, C, F): tmp = 0 if C <= 3.8e+133: tmp = math.sqrt(2.0) * -math.sqrt((F / B_m)) else: tmp = (math.sqrt(F) * math.sqrt(C)) * (-2.0 / B_m) return tmp
B_m = abs(B) function code(A, B_m, C, F) tmp = 0.0 if (C <= 3.8e+133) tmp = Float64(sqrt(2.0) * Float64(-sqrt(Float64(F / B_m)))); else tmp = Float64(Float64(sqrt(F) * sqrt(C)) * Float64(Float64(-2.0) / B_m)); end return tmp end
B_m = abs(B); function tmp_2 = code(A, B_m, C, F) tmp = 0.0; if (C <= 3.8e+133) tmp = sqrt(2.0) * -sqrt((F / B_m)); else tmp = (sqrt(F) * sqrt(C)) * (-2.0 / B_m); end tmp_2 = tmp; end
B_m = N[Abs[B], $MachinePrecision] code[A_, B$95$m_, C_, F_] := If[LessEqual[C, 3.8e+133], N[(N[Sqrt[2.0], $MachinePrecision] * (-N[Sqrt[N[(F / B$95$m), $MachinePrecision]], $MachinePrecision])), $MachinePrecision], N[(N[(N[Sqrt[F], $MachinePrecision] * N[Sqrt[C], $MachinePrecision]), $MachinePrecision] * N[((-2.0) / B$95$m), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
B_m = \left|B\right|
\\
\begin{array}{l}
\mathbf{if}\;C \leq 3.8 \cdot 10^{+133}:\\
\;\;\;\;\sqrt{2} \cdot \left(-\sqrt{\frac{F}{B\_m}}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\sqrt{F} \cdot \sqrt{C}\right) \cdot \frac{-2}{B\_m}\\
\end{array}
\end{array}
if C < 3.8000000000000002e133Initial program 21.4%
Taylor expanded in A around 0 8.7%
mul-1-neg8.7%
distribute-rgt-neg-in8.7%
unpow28.7%
unpow28.7%
hypot-def14.5%
Simplified14.5%
Taylor expanded in C around 0 14.2%
mul-1-neg14.2%
Simplified14.2%
if 3.8000000000000002e133 < C Initial program 3.8%
Taylor expanded in A around 0 1.4%
mul-1-neg1.4%
distribute-rgt-neg-in1.4%
unpow21.4%
unpow21.4%
hypot-def17.9%
Simplified17.9%
Taylor expanded in B around 0 12.0%
mul-1-neg12.0%
*-commutative12.0%
*-commutative12.0%
unpow212.0%
rem-square-sqrt12.2%
Simplified12.2%
sqrt-prod16.3%
Applied egg-rr16.3%
Final simplification14.6%
B_m = (fabs.f64 B) (FPCore (A B_m C F) :precision binary64 (if (<= F 1.8e+57) (* (/ (sqrt 2.0) B_m) (- (sqrt (* B_m F)))) (* (sqrt 2.0) (- (sqrt (/ F B_m))))))
B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
double tmp;
if (F <= 1.8e+57) {
tmp = (sqrt(2.0) / B_m) * -sqrt((B_m * F));
} else {
tmp = sqrt(2.0) * -sqrt((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 <= 1.8d+57) then
tmp = (sqrt(2.0d0) / b_m) * -sqrt((b_m * f))
else
tmp = sqrt(2.0d0) * -sqrt((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 <= 1.8e+57) {
tmp = (Math.sqrt(2.0) / B_m) * -Math.sqrt((B_m * F));
} else {
tmp = Math.sqrt(2.0) * -Math.sqrt((F / B_m));
}
return tmp;
}
B_m = math.fabs(B) def code(A, B_m, C, F): tmp = 0 if F <= 1.8e+57: tmp = (math.sqrt(2.0) / B_m) * -math.sqrt((B_m * F)) else: tmp = math.sqrt(2.0) * -math.sqrt((F / B_m)) return tmp
B_m = abs(B) function code(A, B_m, C, F) tmp = 0.0 if (F <= 1.8e+57) tmp = Float64(Float64(sqrt(2.0) / B_m) * Float64(-sqrt(Float64(B_m * F)))); else tmp = Float64(sqrt(2.0) * Float64(-sqrt(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 <= 1.8e+57) tmp = (sqrt(2.0) / B_m) * -sqrt((B_m * F)); else tmp = sqrt(2.0) * -sqrt((F / B_m)); end tmp_2 = tmp; end
B_m = N[Abs[B], $MachinePrecision] code[A_, B$95$m_, C_, F_] := If[LessEqual[F, 1.8e+57], N[(N[(N[Sqrt[2.0], $MachinePrecision] / B$95$m), $MachinePrecision] * (-N[Sqrt[N[(B$95$m * F), $MachinePrecision]], $MachinePrecision])), $MachinePrecision], N[(N[Sqrt[2.0], $MachinePrecision] * (-N[Sqrt[N[(F / B$95$m), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]]
\begin{array}{l}
B_m = \left|B\right|
\\
\begin{array}{l}
\mathbf{if}\;F \leq 1.8 \cdot 10^{+57}:\\
\;\;\;\;\frac{\sqrt{2}}{B\_m} \cdot \left(-\sqrt{B\_m \cdot F}\right)\\
\mathbf{else}:\\
\;\;\;\;\sqrt{2} \cdot \left(-\sqrt{\frac{F}{B\_m}}\right)\\
\end{array}
\end{array}
if F < 1.8000000000000001e57Initial program 24.3%
Taylor expanded in A around 0 8.3%
mul-1-neg8.3%
distribute-rgt-neg-in8.3%
unpow28.3%
unpow28.3%
hypot-def18.5%
Simplified18.5%
Taylor expanded in C around 0 15.1%
if 1.8000000000000001e57 < F Initial program 6.8%
Taylor expanded in A around 0 5.4%
mul-1-neg5.4%
distribute-rgt-neg-in5.4%
unpow25.4%
unpow25.4%
hypot-def8.9%
Simplified8.9%
Taylor expanded in C around 0 16.5%
mul-1-neg16.5%
Simplified16.5%
Final simplification15.6%
B_m = (fabs.f64 B) (FPCore (A B_m C F) :precision binary64 (if (<= C 9.5e+124) (* (sqrt 2.0) (- (sqrt (/ F B_m)))) (* (pow (* C F) 0.5) (/ (- 2.0) B_m))))
B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
double tmp;
if (C <= 9.5e+124) {
tmp = sqrt(2.0) * -sqrt((F / B_m));
} else {
tmp = pow((C * F), 0.5) * (-2.0 / 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 (c <= 9.5d+124) then
tmp = sqrt(2.0d0) * -sqrt((f / b_m))
else
tmp = ((c * f) ** 0.5d0) * (-2.0d0 / 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 (C <= 9.5e+124) {
tmp = Math.sqrt(2.0) * -Math.sqrt((F / B_m));
} else {
tmp = Math.pow((C * F), 0.5) * (-2.0 / B_m);
}
return tmp;
}
B_m = math.fabs(B) def code(A, B_m, C, F): tmp = 0 if C <= 9.5e+124: tmp = math.sqrt(2.0) * -math.sqrt((F / B_m)) else: tmp = math.pow((C * F), 0.5) * (-2.0 / B_m) return tmp
B_m = abs(B) function code(A, B_m, C, F) tmp = 0.0 if (C <= 9.5e+124) tmp = Float64(sqrt(2.0) * Float64(-sqrt(Float64(F / B_m)))); else tmp = Float64((Float64(C * F) ^ 0.5) * Float64(Float64(-2.0) / B_m)); end return tmp end
B_m = abs(B); function tmp_2 = code(A, B_m, C, F) tmp = 0.0; if (C <= 9.5e+124) tmp = sqrt(2.0) * -sqrt((F / B_m)); else tmp = ((C * F) ^ 0.5) * (-2.0 / B_m); end tmp_2 = tmp; end
B_m = N[Abs[B], $MachinePrecision] code[A_, B$95$m_, C_, F_] := If[LessEqual[C, 9.5e+124], N[(N[Sqrt[2.0], $MachinePrecision] * (-N[Sqrt[N[(F / B$95$m), $MachinePrecision]], $MachinePrecision])), $MachinePrecision], N[(N[Power[N[(C * F), $MachinePrecision], 0.5], $MachinePrecision] * N[((-2.0) / B$95$m), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
B_m = \left|B\right|
\\
\begin{array}{l}
\mathbf{if}\;C \leq 9.5 \cdot 10^{+124}:\\
\;\;\;\;\sqrt{2} \cdot \left(-\sqrt{\frac{F}{B\_m}}\right)\\
\mathbf{else}:\\
\;\;\;\;{\left(C \cdot F\right)}^{0.5} \cdot \frac{-2}{B\_m}\\
\end{array}
\end{array}
if C < 9.50000000000000004e124Initial program 21.4%
Taylor expanded in A around 0 8.7%
mul-1-neg8.7%
distribute-rgt-neg-in8.7%
unpow28.7%
unpow28.7%
hypot-def14.5%
Simplified14.5%
Taylor expanded in C around 0 14.2%
mul-1-neg14.2%
Simplified14.2%
if 9.50000000000000004e124 < C Initial program 3.8%
Taylor expanded in A around 0 1.4%
mul-1-neg1.4%
distribute-rgt-neg-in1.4%
unpow21.4%
unpow21.4%
hypot-def17.9%
Simplified17.9%
Taylor expanded in B around 0 12.0%
mul-1-neg12.0%
*-commutative12.0%
*-commutative12.0%
unpow212.0%
rem-square-sqrt12.2%
Simplified12.2%
pow1/212.3%
*-commutative12.3%
Applied egg-rr12.3%
Final simplification13.9%
B_m = (fabs.f64 B) (FPCore (A B_m C F) :precision binary64 (let* ((t_0 (/ (- 2.0) B_m))) (if (<= A 4.5e-174) (* (pow (* C F) 0.5) t_0) (* (sqrt (* A F)) t_0))))
B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
double t_0 = -2.0 / B_m;
double tmp;
if (A <= 4.5e-174) {
tmp = pow((C * F), 0.5) * t_0;
} else {
tmp = sqrt((A * F)) * t_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) :: t_0
real(8) :: tmp
t_0 = -2.0d0 / b_m
if (a <= 4.5d-174) then
tmp = ((c * f) ** 0.5d0) * t_0
else
tmp = sqrt((a * f)) * t_0
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 t_0 = -2.0 / B_m;
double tmp;
if (A <= 4.5e-174) {
tmp = Math.pow((C * F), 0.5) * t_0;
} else {
tmp = Math.sqrt((A * F)) * t_0;
}
return tmp;
}
B_m = math.fabs(B) def code(A, B_m, C, F): t_0 = -2.0 / B_m tmp = 0 if A <= 4.5e-174: tmp = math.pow((C * F), 0.5) * t_0 else: tmp = math.sqrt((A * F)) * t_0 return tmp
B_m = abs(B) function code(A, B_m, C, F) t_0 = Float64(Float64(-2.0) / B_m) tmp = 0.0 if (A <= 4.5e-174) tmp = Float64((Float64(C * F) ^ 0.5) * t_0); else tmp = Float64(sqrt(Float64(A * F)) * t_0); end return tmp end
B_m = abs(B); function tmp_2 = code(A, B_m, C, F) t_0 = -2.0 / B_m; tmp = 0.0; if (A <= 4.5e-174) tmp = ((C * F) ^ 0.5) * t_0; else tmp = sqrt((A * F)) * t_0; end tmp_2 = tmp; end
B_m = N[Abs[B], $MachinePrecision]
code[A_, B$95$m_, C_, F_] := Block[{t$95$0 = N[((-2.0) / B$95$m), $MachinePrecision]}, If[LessEqual[A, 4.5e-174], N[(N[Power[N[(C * F), $MachinePrecision], 0.5], $MachinePrecision] * t$95$0), $MachinePrecision], N[(N[Sqrt[N[(A * F), $MachinePrecision]], $MachinePrecision] * t$95$0), $MachinePrecision]]]
\begin{array}{l}
B_m = \left|B\right|
\\
\begin{array}{l}
t_0 := \frac{-2}{B\_m}\\
\mathbf{if}\;A \leq 4.5 \cdot 10^{-174}:\\
\;\;\;\;{\left(C \cdot F\right)}^{0.5} \cdot t\_0\\
\mathbf{else}:\\
\;\;\;\;\sqrt{A \cdot F} \cdot t\_0\\
\end{array}
\end{array}
if A < 4.49999999999999964e-174Initial program 13.4%
Taylor expanded in A around 0 7.1%
mul-1-neg7.1%
distribute-rgt-neg-in7.1%
unpow27.1%
unpow27.1%
hypot-def17.8%
Simplified17.8%
Taylor expanded in B around 0 5.4%
mul-1-neg5.4%
*-commutative5.4%
*-commutative5.4%
unpow25.4%
rem-square-sqrt5.4%
Simplified5.4%
pow1/25.6%
*-commutative5.6%
Applied egg-rr5.6%
if 4.49999999999999964e-174 < A Initial program 24.2%
Taylor expanded in C around 0 9.7%
mul-1-neg9.7%
distribute-rgt-neg-in9.7%
+-commutative9.7%
unpow29.7%
unpow29.7%
hypot-def17.8%
Simplified17.8%
Taylor expanded in B around 0 10.4%
mul-1-neg10.4%
*-commutative10.4%
unpow210.4%
rem-square-sqrt10.5%
*-commutative10.5%
Simplified10.5%
Final simplification7.7%
B_m = (fabs.f64 B) (FPCore (A B_m C F) :precision binary64 (let* ((t_0 (/ (- 2.0) B_m))) (if (<= A 3.2e-171) (* (sqrt (* C F)) t_0) (* (sqrt (* A F)) t_0))))
B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
double t_0 = -2.0 / B_m;
double tmp;
if (A <= 3.2e-171) {
tmp = sqrt((C * F)) * t_0;
} else {
tmp = sqrt((A * F)) * t_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) :: t_0
real(8) :: tmp
t_0 = -2.0d0 / b_m
if (a <= 3.2d-171) then
tmp = sqrt((c * f)) * t_0
else
tmp = sqrt((a * f)) * t_0
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 t_0 = -2.0 / B_m;
double tmp;
if (A <= 3.2e-171) {
tmp = Math.sqrt((C * F)) * t_0;
} else {
tmp = Math.sqrt((A * F)) * t_0;
}
return tmp;
}
B_m = math.fabs(B) def code(A, B_m, C, F): t_0 = -2.0 / B_m tmp = 0 if A <= 3.2e-171: tmp = math.sqrt((C * F)) * t_0 else: tmp = math.sqrt((A * F)) * t_0 return tmp
B_m = abs(B) function code(A, B_m, C, F) t_0 = Float64(Float64(-2.0) / B_m) tmp = 0.0 if (A <= 3.2e-171) tmp = Float64(sqrt(Float64(C * F)) * t_0); else tmp = Float64(sqrt(Float64(A * F)) * t_0); end return tmp end
B_m = abs(B); function tmp_2 = code(A, B_m, C, F) t_0 = -2.0 / B_m; tmp = 0.0; if (A <= 3.2e-171) tmp = sqrt((C * F)) * t_0; else tmp = sqrt((A * F)) * t_0; end tmp_2 = tmp; end
B_m = N[Abs[B], $MachinePrecision]
code[A_, B$95$m_, C_, F_] := Block[{t$95$0 = N[((-2.0) / B$95$m), $MachinePrecision]}, If[LessEqual[A, 3.2e-171], N[(N[Sqrt[N[(C * F), $MachinePrecision]], $MachinePrecision] * t$95$0), $MachinePrecision], N[(N[Sqrt[N[(A * F), $MachinePrecision]], $MachinePrecision] * t$95$0), $MachinePrecision]]]
\begin{array}{l}
B_m = \left|B\right|
\\
\begin{array}{l}
t_0 := \frac{-2}{B\_m}\\
\mathbf{if}\;A \leq 3.2 \cdot 10^{-171}:\\
\;\;\;\;\sqrt{C \cdot F} \cdot t\_0\\
\mathbf{else}:\\
\;\;\;\;\sqrt{A \cdot F} \cdot t\_0\\
\end{array}
\end{array}
if A < 3.2000000000000001e-171Initial program 13.4%
Taylor expanded in A around 0 7.1%
mul-1-neg7.1%
distribute-rgt-neg-in7.1%
unpow27.1%
unpow27.1%
hypot-def17.8%
Simplified17.8%
Taylor expanded in B around 0 5.4%
mul-1-neg5.4%
*-commutative5.4%
*-commutative5.4%
unpow25.4%
rem-square-sqrt5.4%
Simplified5.4%
if 3.2000000000000001e-171 < A Initial program 24.2%
Taylor expanded in C around 0 9.7%
mul-1-neg9.7%
distribute-rgt-neg-in9.7%
+-commutative9.7%
unpow29.7%
unpow29.7%
hypot-def17.8%
Simplified17.8%
Taylor expanded in B around 0 10.4%
mul-1-neg10.4%
*-commutative10.4%
unpow210.4%
rem-square-sqrt10.5%
*-commutative10.5%
Simplified10.5%
Final simplification7.6%
B_m = (fabs.f64 B) (FPCore (A B_m C F) :precision binary64 (* (sqrt (* C F)) (/ (- 2.0) B_m)))
B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
return sqrt((C * F)) * (-2.0 / 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((c * f)) * (-2.0d0 / 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((C * F)) * (-2.0 / B_m);
}
B_m = math.fabs(B) def code(A, B_m, C, F): return math.sqrt((C * F)) * (-2.0 / B_m)
B_m = abs(B) function code(A, B_m, C, F) return Float64(sqrt(Float64(C * F)) * Float64(Float64(-2.0) / B_m)) end
B_m = abs(B); function tmp = code(A, B_m, C, F) tmp = sqrt((C * F)) * (-2.0 / B_m); end
B_m = N[Abs[B], $MachinePrecision] code[A_, B$95$m_, C_, F_] := N[(N[Sqrt[N[(C * F), $MachinePrecision]], $MachinePrecision] * N[((-2.0) / B$95$m), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
B_m = \left|B\right|
\\
\sqrt{C \cdot F} \cdot \frac{-2}{B\_m}
\end{array}
Initial program 18.1%
Taylor expanded in A around 0 7.3%
mul-1-neg7.3%
distribute-rgt-neg-in7.3%
unpow27.3%
unpow27.3%
hypot-def15.1%
Simplified15.1%
Taylor expanded in B around 0 3.4%
mul-1-neg3.4%
*-commutative3.4%
*-commutative3.4%
unpow23.4%
rem-square-sqrt3.4%
Simplified3.4%
Final simplification3.4%
B_m = (fabs.f64 B) (FPCore (A B_m C F) :precision binary64 (/ (* (sqrt (* C F)) -2.0) B_m))
B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
return (sqrt((C * F)) * -2.0) / 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((c * f)) * (-2.0d0)) / 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((C * F)) * -2.0) / B_m;
}
B_m = math.fabs(B) def code(A, B_m, C, F): return (math.sqrt((C * F)) * -2.0) / B_m
B_m = abs(B) function code(A, B_m, C, F) return Float64(Float64(sqrt(Float64(C * F)) * -2.0) / B_m) end
B_m = abs(B); function tmp = code(A, B_m, C, F) tmp = (sqrt((C * F)) * -2.0) / B_m; end
B_m = N[Abs[B], $MachinePrecision] code[A_, B$95$m_, C_, F_] := N[(N[(N[Sqrt[N[(C * F), $MachinePrecision]], $MachinePrecision] * -2.0), $MachinePrecision] / B$95$m), $MachinePrecision]
\begin{array}{l}
B_m = \left|B\right|
\\
\frac{\sqrt{C \cdot F} \cdot -2}{B\_m}
\end{array}
Initial program 18.1%
Taylor expanded in A around 0 7.3%
mul-1-neg7.3%
distribute-rgt-neg-in7.3%
unpow27.3%
unpow27.3%
hypot-def15.1%
Simplified15.1%
pow1/215.1%
*-commutative15.1%
unpow-prod-down20.0%
pow1/220.0%
hypot-udef8.0%
unpow28.0%
unpow28.0%
+-commutative8.0%
unpow28.0%
unpow28.0%
hypot-def20.0%
pow1/220.0%
Applied egg-rr20.0%
Taylor expanded in B around 0 3.4%
mul-1-neg3.4%
associate-*l/3.4%
distribute-neg-frac3.4%
unpow23.4%
rem-square-sqrt3.4%
*-commutative3.4%
distribute-rgt-neg-in3.4%
*-commutative3.4%
metadata-eval3.4%
Simplified3.4%
Final simplification3.4%
herbie shell --seed 2024027
(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))))