
(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 17 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))))
(t_1 (* (* 4.0 A) C))
(t_2 (* 2.0 (* (- (pow B_m 2.0) t_1) F)))
(t_3 (- t_1 (pow B_m 2.0)))
(t_4
(/
(sqrt (* t_2 (+ (+ A C) (sqrt (+ (pow B_m 2.0) (pow (- A C) 2.0))))))
t_3)))
(if (<= t_4 -1e-211)
(/
(*
(* (sqrt (+ C (+ A (hypot B_m (- A C))))) (sqrt F))
(sqrt (* 2.0 (fma A (* C -4.0) (pow B_m 2.0)))))
(- (* 4.0 (* A C)) (pow B_m 2.0)))
(if (<= t_4 4e+185)
(/ (sqrt (* t_2 (+ (* -0.5 (/ (pow B_m 2.0) A)) (* 2.0 C)))) t_3)
(if (<= t_4 INFINITY)
(/
(* (sqrt (+ (+ A C) (hypot (- A C) B_m))) (sqrt (* t_0 (* 2.0 F))))
(- t_0))
(*
(/ (sqrt 2.0) B_m)
(* (sqrt (+ C (hypot B_m C))) (- (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 t_1 = (4.0 * A) * C;
double t_2 = 2.0 * ((pow(B_m, 2.0) - t_1) * F);
double t_3 = t_1 - pow(B_m, 2.0);
double t_4 = sqrt((t_2 * ((A + C) + sqrt((pow(B_m, 2.0) + pow((A - C), 2.0)))))) / t_3;
double tmp;
if (t_4 <= -1e-211) {
tmp = ((sqrt((C + (A + hypot(B_m, (A - C))))) * sqrt(F)) * sqrt((2.0 * fma(A, (C * -4.0), pow(B_m, 2.0))))) / ((4.0 * (A * C)) - pow(B_m, 2.0));
} else if (t_4 <= 4e+185) {
tmp = sqrt((t_2 * ((-0.5 * (pow(B_m, 2.0) / A)) + (2.0 * C)))) / t_3;
} else if (t_4 <= ((double) INFINITY)) {
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(B_m, C))) * -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))) t_1 = Float64(Float64(4.0 * A) * C) t_2 = Float64(2.0 * Float64(Float64((B_m ^ 2.0) - t_1) * F)) t_3 = Float64(t_1 - (B_m ^ 2.0)) t_4 = Float64(sqrt(Float64(t_2 * Float64(Float64(A + C) + sqrt(Float64((B_m ^ 2.0) + (Float64(A - C) ^ 2.0)))))) / t_3) tmp = 0.0 if (t_4 <= -1e-211) tmp = Float64(Float64(Float64(sqrt(Float64(C + Float64(A + hypot(B_m, Float64(A - C))))) * sqrt(F)) * sqrt(Float64(2.0 * fma(A, Float64(C * -4.0), (B_m ^ 2.0))))) / Float64(Float64(4.0 * Float64(A * C)) - (B_m ^ 2.0))); elseif (t_4 <= 4e+185) tmp = Float64(sqrt(Float64(t_2 * Float64(Float64(-0.5 * Float64((B_m ^ 2.0) / A)) + Float64(2.0 * C)))) / t_3); elseif (t_4 <= Inf) tmp = Float64(Float64(sqrt(Float64(Float64(A + C) + hypot(Float64(A - C), B_m))) * sqrt(Float64(t_0 * Float64(2.0 * F)))) / Float64(-t_0)); else tmp = Float64(Float64(sqrt(2.0) / B_m) * Float64(sqrt(Float64(C + hypot(B_m, C))) * 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]}, Block[{t$95$1 = N[(N[(4.0 * A), $MachinePrecision] * C), $MachinePrecision]}, Block[{t$95$2 = N[(2.0 * N[(N[(N[Power[B$95$m, 2.0], $MachinePrecision] - t$95$1), $MachinePrecision] * F), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(t$95$1 - N[Power[B$95$m, 2.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[Sqrt[N[(t$95$2 * N[(N[(A + C), $MachinePrecision] + N[Sqrt[N[(N[Power[B$95$m, 2.0], $MachinePrecision] + N[Power[N[(A - C), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / t$95$3), $MachinePrecision]}, If[LessEqual[t$95$4, -1e-211], N[(N[(N[(N[Sqrt[N[(C + N[(A + N[Sqrt[B$95$m ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sqrt[F], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(2.0 * N[(A * N[(C * -4.0), $MachinePrecision] + N[Power[B$95$m, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[(N[(4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision] - N[Power[B$95$m, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$4, 4e+185], N[(N[Sqrt[N[(t$95$2 * N[(N[(-0.5 * N[(N[Power[B$95$m, 2.0], $MachinePrecision] / A), $MachinePrecision]), $MachinePrecision] + N[(2.0 * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / t$95$3), $MachinePrecision], If[LessEqual[t$95$4, Infinity], N[(N[(N[Sqrt[N[(N[(A + C), $MachinePrecision] + N[Sqrt[N[(A - C), $MachinePrecision] ^ 2 + B$95$m ^ 2], $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[B$95$m ^ 2 + C ^ 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)\\
t_1 := \left(4 \cdot A\right) \cdot C\\
t_2 := 2 \cdot \left(\left({B\_m}^{2} - t\_1\right) \cdot F\right)\\
t_3 := t\_1 - {B\_m}^{2}\\
t_4 := \frac{\sqrt{t\_2 \cdot \left(\left(A + C\right) + \sqrt{{B\_m}^{2} + {\left(A - C\right)}^{2}}\right)}}{t\_3}\\
\mathbf{if}\;t\_4 \leq -1 \cdot 10^{-211}:\\
\;\;\;\;\frac{\left(\sqrt{C + \left(A + \mathsf{hypot}\left(B\_m, A - C\right)\right)} \cdot \sqrt{F}\right) \cdot \sqrt{2 \cdot \mathsf{fma}\left(A, C \cdot -4, {B\_m}^{2}\right)}}{4 \cdot \left(A \cdot C\right) - {B\_m}^{2}}\\
\mathbf{elif}\;t\_4 \leq 4 \cdot 10^{+185}:\\
\;\;\;\;\frac{\sqrt{t\_2 \cdot \left(-0.5 \cdot \frac{{B\_m}^{2}}{A} + 2 \cdot C\right)}}{t\_3}\\
\mathbf{elif}\;t\_4 \leq \infty:\\
\;\;\;\;\frac{\sqrt{\left(A + C\right) + \mathsf{hypot}\left(A - C, B\_m\right)} \cdot \sqrt{t\_0 \cdot \left(2 \cdot F\right)}}{-t\_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{2}}{B\_m} \cdot \left(\sqrt{C + \mathsf{hypot}\left(B\_m, C\right)} \cdot \left(-\sqrt{F}\right)\right)\\
\end{array}
\end{array}
if (/.f64 (neg.f64 (sqrt.f64 (*.f64 (*.f64 2 (*.f64 (-.f64 (pow.f64 B 2) (*.f64 (*.f64 4 A) C)) F)) (+.f64 (+.f64 A C) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) 2) (pow.f64 B 2))))))) (-.f64 (pow.f64 B 2) (*.f64 (*.f64 4 A) C))) < -1.00000000000000009e-211Initial program 48.1%
Simplified43.3%
pow1/243.3%
associate-*r*56.1%
unpow-prod-down69.5%
+-commutative69.5%
hypot-undefine54.5%
unpow254.5%
unpow254.5%
+-commutative54.5%
unpow254.5%
unpow254.5%
hypot-define69.5%
pow1/269.5%
Applied egg-rr69.5%
unpow1/269.5%
+-commutative69.5%
+-commutative69.5%
hypot-undefine54.5%
unpow254.5%
unpow254.5%
+-commutative54.5%
unpow254.5%
unpow254.5%
hypot-undefine69.5%
Simplified69.5%
pow1/269.5%
*-commutative69.5%
unpow-prod-down76.6%
pow1/276.6%
associate-+l+77.2%
pow1/277.2%
Applied egg-rr77.2%
if -1.00000000000000009e-211 < (/.f64 (neg.f64 (sqrt.f64 (*.f64 (*.f64 2 (*.f64 (-.f64 (pow.f64 B 2) (*.f64 (*.f64 4 A) C)) F)) (+.f64 (+.f64 A C) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) 2) (pow.f64 B 2))))))) (-.f64 (pow.f64 B 2) (*.f64 (*.f64 4 A) C))) < 3.9999999999999999e185Initial program 21.3%
Taylor expanded in A around -inf 50.9%
if 3.9999999999999999e185 < (/.f64 (neg.f64 (sqrt.f64 (*.f64 (*.f64 2 (*.f64 (-.f64 (pow.f64 B 2) (*.f64 (*.f64 4 A) C)) F)) (+.f64 (+.f64 A C) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) 2) (pow.f64 B 2))))))) (-.f64 (pow.f64 B 2) (*.f64 (*.f64 4 A) C))) < +inf.0Initial program 9.3%
Simplified54.4%
pow1/254.4%
*-commutative54.4%
unpow-prod-down71.1%
pow1/271.1%
+-commutative71.1%
hypot-undefine9.4%
unpow29.4%
unpow29.4%
+-commutative9.4%
unpow29.4%
unpow29.4%
hypot-define71.1%
pow1/271.1%
*-commutative71.1%
Applied egg-rr71.1%
if +inf.0 < (/.f64 (neg.f64 (sqrt.f64 (*.f64 (*.f64 2 (*.f64 (-.f64 (pow.f64 B 2) (*.f64 (*.f64 4 A) C)) F)) (+.f64 (+.f64 A C) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) 2) (pow.f64 B 2))))))) (-.f64 (pow.f64 B 2) (*.f64 (*.f64 4 A) C))) Initial program 0.0%
Taylor expanded in A around 0 2.1%
mul-1-neg2.1%
unpow22.1%
unpow22.1%
hypot-define20.2%
Simplified20.2%
pow1/220.2%
*-commutative20.2%
unpow-prod-down31.6%
pow1/231.6%
pow1/231.6%
Applied egg-rr31.6%
Final simplification53.3%
B_m = (fabs.f64 B)
(FPCore (A B_m C F)
:precision binary64
(let* ((t_0 (* (* 4.0 A) C))
(t_1 (- t_0 (pow B_m 2.0)))
(t_2 (* 2.0 (+ (pow B_m 2.0) (* -4.0 (* A C)))))
(t_3 (/ (sqrt (* (* 2.0 (* (- (pow B_m 2.0) t_0) F)) (* 2.0 A))) t_1)))
(if (<= (pow B_m 2.0) 0.0)
(/ (sqrt (fabs (* t_2 (* F (* 2.0 C))))) t_1)
(if (<= (pow B_m 2.0) 1e-219)
t_3
(if (<= (pow B_m 2.0) 2e-128)
(/ (* (sqrt (* (* 2.0 F) t_2)) (sqrt C)) t_1)
(if (<= (pow B_m 2.0) 1e-127)
t_3
(*
(* (sqrt F) (sqrt (+ A (hypot B_m A))))
(/ (sqrt 2.0) (- B_m)))))))))B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
double t_0 = (4.0 * A) * C;
double t_1 = t_0 - pow(B_m, 2.0);
double t_2 = 2.0 * (pow(B_m, 2.0) + (-4.0 * (A * C)));
double t_3 = sqrt(((2.0 * ((pow(B_m, 2.0) - t_0) * F)) * (2.0 * A))) / t_1;
double tmp;
if (pow(B_m, 2.0) <= 0.0) {
tmp = sqrt(fabs((t_2 * (F * (2.0 * C))))) / t_1;
} else if (pow(B_m, 2.0) <= 1e-219) {
tmp = t_3;
} else if (pow(B_m, 2.0) <= 2e-128) {
tmp = (sqrt(((2.0 * F) * t_2)) * sqrt(C)) / t_1;
} else if (pow(B_m, 2.0) <= 1e-127) {
tmp = t_3;
} else {
tmp = (sqrt(F) * sqrt((A + hypot(B_m, A)))) * (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 = (4.0 * A) * C;
double t_1 = t_0 - Math.pow(B_m, 2.0);
double t_2 = 2.0 * (Math.pow(B_m, 2.0) + (-4.0 * (A * C)));
double t_3 = Math.sqrt(((2.0 * ((Math.pow(B_m, 2.0) - t_0) * F)) * (2.0 * A))) / t_1;
double tmp;
if (Math.pow(B_m, 2.0) <= 0.0) {
tmp = Math.sqrt(Math.abs((t_2 * (F * (2.0 * C))))) / t_1;
} else if (Math.pow(B_m, 2.0) <= 1e-219) {
tmp = t_3;
} else if (Math.pow(B_m, 2.0) <= 2e-128) {
tmp = (Math.sqrt(((2.0 * F) * t_2)) * Math.sqrt(C)) / t_1;
} else if (Math.pow(B_m, 2.0) <= 1e-127) {
tmp = t_3;
} else {
tmp = (Math.sqrt(F) * Math.sqrt((A + Math.hypot(B_m, A)))) * (Math.sqrt(2.0) / -B_m);
}
return tmp;
}
B_m = math.fabs(B) def code(A, B_m, C, F): t_0 = (4.0 * A) * C t_1 = t_0 - math.pow(B_m, 2.0) t_2 = 2.0 * (math.pow(B_m, 2.0) + (-4.0 * (A * C))) t_3 = math.sqrt(((2.0 * ((math.pow(B_m, 2.0) - t_0) * F)) * (2.0 * A))) / t_1 tmp = 0 if math.pow(B_m, 2.0) <= 0.0: tmp = math.sqrt(math.fabs((t_2 * (F * (2.0 * C))))) / t_1 elif math.pow(B_m, 2.0) <= 1e-219: tmp = t_3 elif math.pow(B_m, 2.0) <= 2e-128: tmp = (math.sqrt(((2.0 * F) * t_2)) * math.sqrt(C)) / t_1 elif math.pow(B_m, 2.0) <= 1e-127: tmp = t_3 else: tmp = (math.sqrt(F) * math.sqrt((A + math.hypot(B_m, A)))) * (math.sqrt(2.0) / -B_m) return tmp
B_m = abs(B) function code(A, B_m, C, F) t_0 = Float64(Float64(4.0 * A) * C) t_1 = Float64(t_0 - (B_m ^ 2.0)) t_2 = Float64(2.0 * Float64((B_m ^ 2.0) + Float64(-4.0 * Float64(A * C)))) t_3 = Float64(sqrt(Float64(Float64(2.0 * Float64(Float64((B_m ^ 2.0) - t_0) * F)) * Float64(2.0 * A))) / t_1) tmp = 0.0 if ((B_m ^ 2.0) <= 0.0) tmp = Float64(sqrt(abs(Float64(t_2 * Float64(F * Float64(2.0 * C))))) / t_1); elseif ((B_m ^ 2.0) <= 1e-219) tmp = t_3; elseif ((B_m ^ 2.0) <= 2e-128) tmp = Float64(Float64(sqrt(Float64(Float64(2.0 * F) * t_2)) * sqrt(C)) / t_1); elseif ((B_m ^ 2.0) <= 1e-127) tmp = t_3; else tmp = Float64(Float64(sqrt(F) * sqrt(Float64(A + hypot(B_m, A)))) * Float64(sqrt(2.0) / Float64(-B_m))); end return tmp end
B_m = abs(B); function tmp_2 = code(A, B_m, C, F) t_0 = (4.0 * A) * C; t_1 = t_0 - (B_m ^ 2.0); t_2 = 2.0 * ((B_m ^ 2.0) + (-4.0 * (A * C))); t_3 = sqrt(((2.0 * (((B_m ^ 2.0) - t_0) * F)) * (2.0 * A))) / t_1; tmp = 0.0; if ((B_m ^ 2.0) <= 0.0) tmp = sqrt(abs((t_2 * (F * (2.0 * C))))) / t_1; elseif ((B_m ^ 2.0) <= 1e-219) tmp = t_3; elseif ((B_m ^ 2.0) <= 2e-128) tmp = (sqrt(((2.0 * F) * t_2)) * sqrt(C)) / t_1; elseif ((B_m ^ 2.0) <= 1e-127) tmp = t_3; else tmp = (sqrt(F) * sqrt((A + hypot(B_m, A)))) * (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[(4.0 * A), $MachinePrecision] * C), $MachinePrecision]}, Block[{t$95$1 = N[(t$95$0 - N[Power[B$95$m, 2.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(2.0 * N[(N[Power[B$95$m, 2.0], $MachinePrecision] + N[(-4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[Sqrt[N[(N[(2.0 * N[(N[(N[Power[B$95$m, 2.0], $MachinePrecision] - t$95$0), $MachinePrecision] * F), $MachinePrecision]), $MachinePrecision] * N[(2.0 * A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / t$95$1), $MachinePrecision]}, If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 0.0], N[(N[Sqrt[N[Abs[N[(t$95$2 * N[(F * N[(2.0 * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] / t$95$1), $MachinePrecision], If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 1e-219], t$95$3, If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 2e-128], N[(N[(N[Sqrt[N[(N[(2.0 * F), $MachinePrecision] * t$95$2), $MachinePrecision]], $MachinePrecision] * N[Sqrt[C], $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision], If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 1e-127], t$95$3, N[(N[(N[Sqrt[F], $MachinePrecision] * N[Sqrt[N[(A + N[Sqrt[B$95$m ^ 2 + A ^ 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(N[Sqrt[2.0], $MachinePrecision] / (-B$95$m)), $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}
B_m = \left|B\right|
\\
\begin{array}{l}
t_0 := \left(4 \cdot A\right) \cdot C\\
t_1 := t\_0 - {B\_m}^{2}\\
t_2 := 2 \cdot \left({B\_m}^{2} + -4 \cdot \left(A \cdot C\right)\right)\\
t_3 := \frac{\sqrt{\left(2 \cdot \left(\left({B\_m}^{2} - t\_0\right) \cdot F\right)\right) \cdot \left(2 \cdot A\right)}}{t\_1}\\
\mathbf{if}\;{B\_m}^{2} \leq 0:\\
\;\;\;\;\frac{\sqrt{\left|t\_2 \cdot \left(F \cdot \left(2 \cdot C\right)\right)\right|}}{t\_1}\\
\mathbf{elif}\;{B\_m}^{2} \leq 10^{-219}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;{B\_m}^{2} \leq 2 \cdot 10^{-128}:\\
\;\;\;\;\frac{\sqrt{\left(2 \cdot F\right) \cdot t\_2} \cdot \sqrt{C}}{t\_1}\\
\mathbf{elif}\;{B\_m}^{2} \leq 10^{-127}:\\
\;\;\;\;t\_3\\
\mathbf{else}:\\
\;\;\;\;\left(\sqrt{F} \cdot \sqrt{A + \mathsf{hypot}\left(B\_m, A\right)}\right) \cdot \frac{\sqrt{2}}{-B\_m}\\
\end{array}
\end{array}
if (pow.f64 B 2) < 0.0Initial program 20.2%
Taylor expanded in A around -inf 34.3%
add-sqr-sqrt34.3%
pow1/234.3%
pow1/234.4%
pow-prod-down18.1%
pow218.1%
associate-*r*18.1%
*-commutative18.1%
*-commutative18.1%
Applied egg-rr18.1%
unpow1/218.1%
unpow218.1%
rem-sqrt-square34.9%
associate-*l*36.7%
*-commutative36.7%
*-commutative36.7%
associate-*r*36.7%
cancel-sign-sub-inv36.7%
metadata-eval36.7%
Simplified36.7%
if 0.0 < (pow.f64 B 2) < 1e-219 or 2.00000000000000011e-128 < (pow.f64 B 2) < 1e-127Initial program 31.9%
Taylor expanded in A around inf 58.3%
if 1e-219 < (pow.f64 B 2) < 2.00000000000000011e-128Initial program 28.8%
Taylor expanded in A around -inf 20.8%
pow1/220.9%
associate-*r*20.9%
unpow-prod-down34.2%
associate-*r*34.2%
*-commutative34.2%
*-commutative34.2%
pow1/234.2%
Applied egg-rr34.2%
unpow1/234.2%
associate-*l*34.2%
*-commutative34.2%
*-commutative34.2%
associate-*r*34.2%
cancel-sign-sub-inv34.2%
metadata-eval34.2%
Simplified34.2%
if 1e-127 < (pow.f64 B 2) Initial program 18.7%
Taylor expanded in C around 0 13.4%
mul-1-neg13.4%
+-commutative13.4%
unpow213.4%
unpow213.4%
hypot-define27.5%
Simplified27.5%
pow1/227.6%
*-commutative27.6%
unpow-prod-down38.5%
pow1/238.5%
pow1/238.5%
Applied egg-rr38.5%
Final simplification39.2%
B_m = (fabs.f64 B)
(FPCore (A B_m C F)
:precision binary64
(let* ((t_0 (* (* 4.0 A) C))
(t_1 (- (pow B_m 2.0) t_0))
(t_2 (- t_0 (pow B_m 2.0)))
(t_3 (/ (sqrt (* (* 2.0 (* t_1 F)) (* 2.0 A))) t_2)))
(if (<= (pow B_m 2.0) 0.0)
(/
(sqrt
(fabs (* (* 2.0 (+ (pow B_m 2.0) (* -4.0 (* A C)))) (* F (* 2.0 C)))))
t_2)
(if (<= (pow B_m 2.0) 1e-219)
t_3
(if (<= (pow B_m 2.0) 2e-128)
(/ (* (sqrt (* F (* 2.0 t_1))) (sqrt (* 2.0 C))) t_2)
(if (<= (pow B_m 2.0) 1e-127)
t_3
(*
(* (sqrt F) (sqrt (+ A (hypot B_m A))))
(/ (sqrt 2.0) (- B_m)))))))))B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
double t_0 = (4.0 * A) * C;
double t_1 = pow(B_m, 2.0) - t_0;
double t_2 = t_0 - pow(B_m, 2.0);
double t_3 = sqrt(((2.0 * (t_1 * F)) * (2.0 * A))) / t_2;
double tmp;
if (pow(B_m, 2.0) <= 0.0) {
tmp = sqrt(fabs(((2.0 * (pow(B_m, 2.0) + (-4.0 * (A * C)))) * (F * (2.0 * C))))) / t_2;
} else if (pow(B_m, 2.0) <= 1e-219) {
tmp = t_3;
} else if (pow(B_m, 2.0) <= 2e-128) {
tmp = (sqrt((F * (2.0 * t_1))) * sqrt((2.0 * C))) / t_2;
} else if (pow(B_m, 2.0) <= 1e-127) {
tmp = t_3;
} else {
tmp = (sqrt(F) * sqrt((A + hypot(B_m, A)))) * (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 = (4.0 * A) * C;
double t_1 = Math.pow(B_m, 2.0) - t_0;
double t_2 = t_0 - Math.pow(B_m, 2.0);
double t_3 = Math.sqrt(((2.0 * (t_1 * F)) * (2.0 * A))) / t_2;
double tmp;
if (Math.pow(B_m, 2.0) <= 0.0) {
tmp = Math.sqrt(Math.abs(((2.0 * (Math.pow(B_m, 2.0) + (-4.0 * (A * C)))) * (F * (2.0 * C))))) / t_2;
} else if (Math.pow(B_m, 2.0) <= 1e-219) {
tmp = t_3;
} else if (Math.pow(B_m, 2.0) <= 2e-128) {
tmp = (Math.sqrt((F * (2.0 * t_1))) * Math.sqrt((2.0 * C))) / t_2;
} else if (Math.pow(B_m, 2.0) <= 1e-127) {
tmp = t_3;
} else {
tmp = (Math.sqrt(F) * Math.sqrt((A + Math.hypot(B_m, A)))) * (Math.sqrt(2.0) / -B_m);
}
return tmp;
}
B_m = math.fabs(B) def code(A, B_m, C, F): t_0 = (4.0 * A) * C t_1 = math.pow(B_m, 2.0) - t_0 t_2 = t_0 - math.pow(B_m, 2.0) t_3 = math.sqrt(((2.0 * (t_1 * F)) * (2.0 * A))) / t_2 tmp = 0 if math.pow(B_m, 2.0) <= 0.0: tmp = math.sqrt(math.fabs(((2.0 * (math.pow(B_m, 2.0) + (-4.0 * (A * C)))) * (F * (2.0 * C))))) / t_2 elif math.pow(B_m, 2.0) <= 1e-219: tmp = t_3 elif math.pow(B_m, 2.0) <= 2e-128: tmp = (math.sqrt((F * (2.0 * t_1))) * math.sqrt((2.0 * C))) / t_2 elif math.pow(B_m, 2.0) <= 1e-127: tmp = t_3 else: tmp = (math.sqrt(F) * math.sqrt((A + math.hypot(B_m, A)))) * (math.sqrt(2.0) / -B_m) return tmp
B_m = abs(B) function code(A, B_m, C, F) t_0 = Float64(Float64(4.0 * A) * C) t_1 = Float64((B_m ^ 2.0) - t_0) t_2 = Float64(t_0 - (B_m ^ 2.0)) t_3 = Float64(sqrt(Float64(Float64(2.0 * Float64(t_1 * F)) * Float64(2.0 * A))) / t_2) tmp = 0.0 if ((B_m ^ 2.0) <= 0.0) tmp = Float64(sqrt(abs(Float64(Float64(2.0 * Float64((B_m ^ 2.0) + Float64(-4.0 * Float64(A * C)))) * Float64(F * Float64(2.0 * C))))) / t_2); elseif ((B_m ^ 2.0) <= 1e-219) tmp = t_3; elseif ((B_m ^ 2.0) <= 2e-128) tmp = Float64(Float64(sqrt(Float64(F * Float64(2.0 * t_1))) * sqrt(Float64(2.0 * C))) / t_2); elseif ((B_m ^ 2.0) <= 1e-127) tmp = t_3; else tmp = Float64(Float64(sqrt(F) * sqrt(Float64(A + hypot(B_m, A)))) * Float64(sqrt(2.0) / Float64(-B_m))); end return tmp end
B_m = abs(B); function tmp_2 = code(A, B_m, C, F) t_0 = (4.0 * A) * C; t_1 = (B_m ^ 2.0) - t_0; t_2 = t_0 - (B_m ^ 2.0); t_3 = sqrt(((2.0 * (t_1 * F)) * (2.0 * A))) / t_2; tmp = 0.0; if ((B_m ^ 2.0) <= 0.0) tmp = sqrt(abs(((2.0 * ((B_m ^ 2.0) + (-4.0 * (A * C)))) * (F * (2.0 * C))))) / t_2; elseif ((B_m ^ 2.0) <= 1e-219) tmp = t_3; elseif ((B_m ^ 2.0) <= 2e-128) tmp = (sqrt((F * (2.0 * t_1))) * sqrt((2.0 * C))) / t_2; elseif ((B_m ^ 2.0) <= 1e-127) tmp = t_3; else tmp = (sqrt(F) * sqrt((A + hypot(B_m, A)))) * (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[(4.0 * A), $MachinePrecision] * C), $MachinePrecision]}, Block[{t$95$1 = N[(N[Power[B$95$m, 2.0], $MachinePrecision] - t$95$0), $MachinePrecision]}, Block[{t$95$2 = N[(t$95$0 - N[Power[B$95$m, 2.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[Sqrt[N[(N[(2.0 * N[(t$95$1 * F), $MachinePrecision]), $MachinePrecision] * N[(2.0 * A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / t$95$2), $MachinePrecision]}, If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 0.0], N[(N[Sqrt[N[Abs[N[(N[(2.0 * N[(N[Power[B$95$m, 2.0], $MachinePrecision] + N[(-4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(F * N[(2.0 * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] / t$95$2), $MachinePrecision], If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 1e-219], t$95$3, If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 2e-128], N[(N[(N[Sqrt[N[(F * N[(2.0 * t$95$1), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(2.0 * C), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / t$95$2), $MachinePrecision], If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 1e-127], t$95$3, N[(N[(N[Sqrt[F], $MachinePrecision] * N[Sqrt[N[(A + N[Sqrt[B$95$m ^ 2 + A ^ 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(N[Sqrt[2.0], $MachinePrecision] / (-B$95$m)), $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}
B_m = \left|B\right|
\\
\begin{array}{l}
t_0 := \left(4 \cdot A\right) \cdot C\\
t_1 := {B\_m}^{2} - t\_0\\
t_2 := t\_0 - {B\_m}^{2}\\
t_3 := \frac{\sqrt{\left(2 \cdot \left(t\_1 \cdot F\right)\right) \cdot \left(2 \cdot A\right)}}{t\_2}\\
\mathbf{if}\;{B\_m}^{2} \leq 0:\\
\;\;\;\;\frac{\sqrt{\left|\left(2 \cdot \left({B\_m}^{2} + -4 \cdot \left(A \cdot C\right)\right)\right) \cdot \left(F \cdot \left(2 \cdot C\right)\right)\right|}}{t\_2}\\
\mathbf{elif}\;{B\_m}^{2} \leq 10^{-219}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;{B\_m}^{2} \leq 2 \cdot 10^{-128}:\\
\;\;\;\;\frac{\sqrt{F \cdot \left(2 \cdot t\_1\right)} \cdot \sqrt{2 \cdot C}}{t\_2}\\
\mathbf{elif}\;{B\_m}^{2} \leq 10^{-127}:\\
\;\;\;\;t\_3\\
\mathbf{else}:\\
\;\;\;\;\left(\sqrt{F} \cdot \sqrt{A + \mathsf{hypot}\left(B\_m, A\right)}\right) \cdot \frac{\sqrt{2}}{-B\_m}\\
\end{array}
\end{array}
if (pow.f64 B 2) < 0.0Initial program 20.2%
Taylor expanded in A around -inf 34.3%
add-sqr-sqrt34.3%
pow1/234.3%
pow1/234.4%
pow-prod-down18.1%
pow218.1%
associate-*r*18.1%
*-commutative18.1%
*-commutative18.1%
Applied egg-rr18.1%
unpow1/218.1%
unpow218.1%
rem-sqrt-square34.9%
associate-*l*36.7%
*-commutative36.7%
*-commutative36.7%
associate-*r*36.7%
cancel-sign-sub-inv36.7%
metadata-eval36.7%
Simplified36.7%
if 0.0 < (pow.f64 B 2) < 1e-219 or 2.00000000000000011e-128 < (pow.f64 B 2) < 1e-127Initial program 31.9%
Taylor expanded in A around inf 58.3%
if 1e-219 < (pow.f64 B 2) < 2.00000000000000011e-128Initial program 28.8%
Taylor expanded in A around -inf 20.8%
sqrt-prod34.3%
associate-*r*34.3%
*-commutative34.3%
*-commutative34.3%
Applied egg-rr34.3%
if 1e-127 < (pow.f64 B 2) Initial program 18.7%
Taylor expanded in C around 0 13.4%
mul-1-neg13.4%
+-commutative13.4%
unpow213.4%
unpow213.4%
hypot-define27.5%
Simplified27.5%
pow1/227.6%
*-commutative27.6%
unpow-prod-down38.5%
pow1/238.5%
pow1/238.5%
Applied egg-rr38.5%
Final simplification39.2%
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) 0.0)
(/
(sqrt
(fabs (* (* 2.0 (+ (pow B_m 2.0) (* -4.0 (* A C)))) (* F (* 2.0 C)))))
(- (* (* 4.0 A) C) (pow B_m 2.0)))
(if (<= (pow B_m 2.0) 2e+117)
(/ (sqrt (* (* t_0 (* 2.0 F)) (+ (+ A C) (hypot B_m (- A C))))) (- t_0))
(* (* (sqrt F) (sqrt (+ A (hypot B_m A)))) (/ (sqrt 2.0) (- 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) <= 0.0) {
tmp = sqrt(fabs(((2.0 * (pow(B_m, 2.0) + (-4.0 * (A * C)))) * (F * (2.0 * C))))) / (((4.0 * A) * C) - pow(B_m, 2.0));
} else if (pow(B_m, 2.0) <= 2e+117) {
tmp = sqrt(((t_0 * (2.0 * F)) * ((A + C) + hypot(B_m, (A - C))))) / -t_0;
} else {
tmp = (sqrt(F) * sqrt((A + hypot(B_m, A)))) * (sqrt(2.0) / -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) <= 0.0) tmp = Float64(sqrt(abs(Float64(Float64(2.0 * Float64((B_m ^ 2.0) + Float64(-4.0 * Float64(A * C)))) * Float64(F * Float64(2.0 * C))))) / Float64(Float64(Float64(4.0 * A) * C) - (B_m ^ 2.0))); elseif ((B_m ^ 2.0) <= 2e+117) tmp = Float64(sqrt(Float64(Float64(t_0 * Float64(2.0 * F)) * Float64(Float64(A + C) + hypot(B_m, Float64(A - C))))) / Float64(-t_0)); else tmp = Float64(Float64(sqrt(F) * sqrt(Float64(A + hypot(B_m, A)))) * Float64(sqrt(2.0) / Float64(-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], 0.0], N[(N[Sqrt[N[Abs[N[(N[(2.0 * N[(N[Power[B$95$m, 2.0], $MachinePrecision] + N[(-4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(F * N[(2.0 * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] / N[(N[(N[(4.0 * A), $MachinePrecision] * C), $MachinePrecision] - N[Power[B$95$m, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 2e+117], N[(N[Sqrt[N[(N[(t$95$0 * N[(2.0 * F), $MachinePrecision]), $MachinePrecision] * N[(N[(A + C), $MachinePrecision] + N[Sqrt[B$95$m ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / (-t$95$0)), $MachinePrecision], N[(N[(N[Sqrt[F], $MachinePrecision] * N[Sqrt[N[(A + N[Sqrt[B$95$m ^ 2 + A ^ 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(N[Sqrt[2.0], $MachinePrecision] / (-B$95$m)), $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 0:\\
\;\;\;\;\frac{\sqrt{\left|\left(2 \cdot \left({B\_m}^{2} + -4 \cdot \left(A \cdot C\right)\right)\right) \cdot \left(F \cdot \left(2 \cdot C\right)\right)\right|}}{\left(4 \cdot A\right) \cdot C - {B\_m}^{2}}\\
\mathbf{elif}\;{B\_m}^{2} \leq 2 \cdot 10^{+117}:\\
\;\;\;\;\frac{\sqrt{\left(t\_0 \cdot \left(2 \cdot F\right)\right) \cdot \left(\left(A + C\right) + \mathsf{hypot}\left(B\_m, A - C\right)\right)}}{-t\_0}\\
\mathbf{else}:\\
\;\;\;\;\left(\sqrt{F} \cdot \sqrt{A + \mathsf{hypot}\left(B\_m, A\right)}\right) \cdot \frac{\sqrt{2}}{-B\_m}\\
\end{array}
\end{array}
if (pow.f64 B 2) < 0.0Initial program 20.2%
Taylor expanded in A around -inf 34.3%
add-sqr-sqrt34.3%
pow1/234.3%
pow1/234.4%
pow-prod-down18.1%
pow218.1%
associate-*r*18.1%
*-commutative18.1%
*-commutative18.1%
Applied egg-rr18.1%
unpow1/218.1%
unpow218.1%
rem-sqrt-square34.9%
associate-*l*36.7%
*-commutative36.7%
*-commutative36.7%
associate-*r*36.7%
cancel-sign-sub-inv36.7%
metadata-eval36.7%
Simplified36.7%
if 0.0 < (pow.f64 B 2) < 2.0000000000000001e117Initial program 37.3%
Simplified45.3%
if 2.0000000000000001e117 < (pow.f64 B 2) Initial program 7.9%
Taylor expanded in C around 0 11.1%
mul-1-neg11.1%
+-commutative11.1%
unpow211.1%
unpow211.1%
hypot-define30.3%
Simplified30.3%
pow1/230.3%
*-commutative30.3%
unpow-prod-down46.1%
pow1/246.1%
pow1/246.2%
Applied egg-rr46.2%
Final simplification43.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) 2e+117)
(/
(* (sqrt (+ (+ A C) (hypot (- A C) B_m))) (sqrt (* t_0 (* 2.0 F))))
(- t_0))
(* (* (sqrt F) (sqrt (+ A (hypot B_m A)))) (/ (sqrt 2.0) (- 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) <= 2e+117) {
tmp = (sqrt(((A + C) + hypot((A - C), B_m))) * sqrt((t_0 * (2.0 * F)))) / -t_0;
} else {
tmp = (sqrt(F) * sqrt((A + hypot(B_m, A)))) * (sqrt(2.0) / -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) <= 2e+117) tmp = Float64(Float64(sqrt(Float64(Float64(A + C) + hypot(Float64(A - C), B_m))) * sqrt(Float64(t_0 * Float64(2.0 * F)))) / Float64(-t_0)); else tmp = Float64(Float64(sqrt(F) * sqrt(Float64(A + hypot(B_m, A)))) * Float64(sqrt(2.0) / Float64(-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], 2e+117], N[(N[(N[Sqrt[N[(N[(A + C), $MachinePrecision] + N[Sqrt[N[(A - C), $MachinePrecision] ^ 2 + B$95$m ^ 2], $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[F], $MachinePrecision] * N[Sqrt[N[(A + N[Sqrt[B$95$m ^ 2 + A ^ 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(N[Sqrt[2.0], $MachinePrecision] / (-B$95$m)), $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 2 \cdot 10^{+117}:\\
\;\;\;\;\frac{\sqrt{\left(A + C\right) + \mathsf{hypot}\left(A - C, B\_m\right)} \cdot \sqrt{t\_0 \cdot \left(2 \cdot F\right)}}{-t\_0}\\
\mathbf{else}:\\
\;\;\;\;\left(\sqrt{F} \cdot \sqrt{A + \mathsf{hypot}\left(B\_m, A\right)}\right) \cdot \frac{\sqrt{2}}{-B\_m}\\
\end{array}
\end{array}
if (pow.f64 B 2) < 2.0000000000000001e117Initial program 30.7%
Simplified39.0%
pow1/239.0%
*-commutative39.0%
unpow-prod-down45.9%
pow1/245.9%
+-commutative45.9%
hypot-undefine33.4%
unpow233.4%
unpow233.4%
+-commutative33.4%
unpow233.4%
unpow233.4%
hypot-define45.9%
pow1/245.9%
*-commutative45.9%
Applied egg-rr45.9%
if 2.0000000000000001e117 < (pow.f64 B 2) Initial program 7.9%
Taylor expanded in C around 0 11.1%
mul-1-neg11.1%
+-commutative11.1%
unpow211.1%
unpow211.1%
hypot-define30.3%
Simplified30.3%
pow1/230.3%
*-commutative30.3%
unpow-prod-down46.1%
pow1/246.1%
pow1/246.2%
Applied egg-rr46.2%
Final simplification46.0%
B_m = (fabs.f64 B)
(FPCore (A B_m C F)
:precision binary64
(let* ((t_0 (* (* 4.0 A) C)) (t_1 (- t_0 (pow B_m 2.0))))
(if (<= (pow B_m 2.0) 0.0)
(/ (sqrt (* 4.0 (* (+ (pow B_m 2.0) (* -4.0 (* A C))) (* C F)))) t_1)
(if (<= (pow B_m 2.0) 1e-127)
(/ (sqrt (* (* 2.0 (* (- (pow B_m 2.0) t_0) F)) (* 2.0 A))) t_1)
(* (* (sqrt F) (sqrt (+ A (hypot B_m A)))) (/ (sqrt 2.0) (- B_m)))))))B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
double t_0 = (4.0 * A) * C;
double t_1 = t_0 - pow(B_m, 2.0);
double tmp;
if (pow(B_m, 2.0) <= 0.0) {
tmp = sqrt((4.0 * ((pow(B_m, 2.0) + (-4.0 * (A * C))) * (C * F)))) / t_1;
} else if (pow(B_m, 2.0) <= 1e-127) {
tmp = sqrt(((2.0 * ((pow(B_m, 2.0) - t_0) * F)) * (2.0 * A))) / t_1;
} else {
tmp = (sqrt(F) * sqrt((A + hypot(B_m, A)))) * (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 = (4.0 * A) * C;
double t_1 = t_0 - Math.pow(B_m, 2.0);
double tmp;
if (Math.pow(B_m, 2.0) <= 0.0) {
tmp = Math.sqrt((4.0 * ((Math.pow(B_m, 2.0) + (-4.0 * (A * C))) * (C * F)))) / t_1;
} else if (Math.pow(B_m, 2.0) <= 1e-127) {
tmp = Math.sqrt(((2.0 * ((Math.pow(B_m, 2.0) - t_0) * F)) * (2.0 * A))) / t_1;
} else {
tmp = (Math.sqrt(F) * Math.sqrt((A + Math.hypot(B_m, A)))) * (Math.sqrt(2.0) / -B_m);
}
return tmp;
}
B_m = math.fabs(B) def code(A, B_m, C, F): t_0 = (4.0 * A) * C t_1 = t_0 - math.pow(B_m, 2.0) tmp = 0 if math.pow(B_m, 2.0) <= 0.0: tmp = math.sqrt((4.0 * ((math.pow(B_m, 2.0) + (-4.0 * (A * C))) * (C * F)))) / t_1 elif math.pow(B_m, 2.0) <= 1e-127: tmp = math.sqrt(((2.0 * ((math.pow(B_m, 2.0) - t_0) * F)) * (2.0 * A))) / t_1 else: tmp = (math.sqrt(F) * math.sqrt((A + math.hypot(B_m, A)))) * (math.sqrt(2.0) / -B_m) return tmp
B_m = abs(B) function code(A, B_m, C, F) t_0 = Float64(Float64(4.0 * A) * C) t_1 = Float64(t_0 - (B_m ^ 2.0)) tmp = 0.0 if ((B_m ^ 2.0) <= 0.0) tmp = Float64(sqrt(Float64(4.0 * Float64(Float64((B_m ^ 2.0) + Float64(-4.0 * Float64(A * C))) * Float64(C * F)))) / t_1); elseif ((B_m ^ 2.0) <= 1e-127) tmp = Float64(sqrt(Float64(Float64(2.0 * Float64(Float64((B_m ^ 2.0) - t_0) * F)) * Float64(2.0 * A))) / t_1); else tmp = Float64(Float64(sqrt(F) * sqrt(Float64(A + hypot(B_m, A)))) * Float64(sqrt(2.0) / Float64(-B_m))); end return tmp end
B_m = abs(B); function tmp_2 = code(A, B_m, C, F) t_0 = (4.0 * A) * C; t_1 = t_0 - (B_m ^ 2.0); tmp = 0.0; if ((B_m ^ 2.0) <= 0.0) tmp = sqrt((4.0 * (((B_m ^ 2.0) + (-4.0 * (A * C))) * (C * F)))) / t_1; elseif ((B_m ^ 2.0) <= 1e-127) tmp = sqrt(((2.0 * (((B_m ^ 2.0) - t_0) * F)) * (2.0 * A))) / t_1; else tmp = (sqrt(F) * sqrt((A + hypot(B_m, A)))) * (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[(4.0 * A), $MachinePrecision] * C), $MachinePrecision]}, Block[{t$95$1 = N[(t$95$0 - N[Power[B$95$m, 2.0], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 0.0], N[(N[Sqrt[N[(4.0 * N[(N[(N[Power[B$95$m, 2.0], $MachinePrecision] + N[(-4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(C * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / t$95$1), $MachinePrecision], If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 1e-127], N[(N[Sqrt[N[(N[(2.0 * N[(N[(N[Power[B$95$m, 2.0], $MachinePrecision] - t$95$0), $MachinePrecision] * F), $MachinePrecision]), $MachinePrecision] * N[(2.0 * A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / t$95$1), $MachinePrecision], N[(N[(N[Sqrt[F], $MachinePrecision] * N[Sqrt[N[(A + N[Sqrt[B$95$m ^ 2 + A ^ 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(N[Sqrt[2.0], $MachinePrecision] / (-B$95$m)), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
B_m = \left|B\right|
\\
\begin{array}{l}
t_0 := \left(4 \cdot A\right) \cdot C\\
t_1 := t\_0 - {B\_m}^{2}\\
\mathbf{if}\;{B\_m}^{2} \leq 0:\\
\;\;\;\;\frac{\sqrt{4 \cdot \left(\left({B\_m}^{2} + -4 \cdot \left(A \cdot C\right)\right) \cdot \left(C \cdot F\right)\right)}}{t\_1}\\
\mathbf{elif}\;{B\_m}^{2} \leq 10^{-127}:\\
\;\;\;\;\frac{\sqrt{\left(2 \cdot \left(\left({B\_m}^{2} - t\_0\right) \cdot F\right)\right) \cdot \left(2 \cdot A\right)}}{t\_1}\\
\mathbf{else}:\\
\;\;\;\;\left(\sqrt{F} \cdot \sqrt{A + \mathsf{hypot}\left(B\_m, A\right)}\right) \cdot \frac{\sqrt{2}}{-B\_m}\\
\end{array}
\end{array}
if (pow.f64 B 2) < 0.0Initial program 20.2%
Taylor expanded in A around -inf 34.3%
Taylor expanded in F around 0 34.1%
associate-*r*35.9%
*-commutative35.9%
cancel-sign-sub-inv35.9%
metadata-eval35.9%
Simplified35.9%
if 0.0 < (pow.f64 B 2) < 1e-127Initial program 30.3%
Taylor expanded in A around inf 34.9%
if 1e-127 < (pow.f64 B 2) Initial program 18.7%
Taylor expanded in C around 0 13.4%
mul-1-neg13.4%
+-commutative13.4%
unpow213.4%
unpow213.4%
hypot-define27.5%
Simplified27.5%
pow1/227.6%
*-commutative27.6%
unpow-prod-down38.5%
pow1/238.5%
pow1/238.5%
Applied egg-rr38.5%
Final simplification37.3%
B_m = (fabs.f64 B)
(FPCore (A B_m C F)
:precision binary64
(let* ((t_0 (* (* 4.0 A) C)) (t_1 (- t_0 (pow B_m 2.0))))
(if (<= (pow B_m 2.0) 0.0)
(/
(sqrt
(fabs (* (* 2.0 (+ (pow B_m 2.0) (* -4.0 (* A C)))) (* F (* 2.0 C)))))
t_1)
(if (<= (pow B_m 2.0) 1e-127)
(/ (sqrt (* (* 2.0 (* (- (pow B_m 2.0) t_0) F)) (* 2.0 A))) t_1)
(* (* (sqrt F) (sqrt (+ A (hypot B_m A)))) (/ (sqrt 2.0) (- B_m)))))))B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
double t_0 = (4.0 * A) * C;
double t_1 = t_0 - pow(B_m, 2.0);
double tmp;
if (pow(B_m, 2.0) <= 0.0) {
tmp = sqrt(fabs(((2.0 * (pow(B_m, 2.0) + (-4.0 * (A * C)))) * (F * (2.0 * C))))) / t_1;
} else if (pow(B_m, 2.0) <= 1e-127) {
tmp = sqrt(((2.0 * ((pow(B_m, 2.0) - t_0) * F)) * (2.0 * A))) / t_1;
} else {
tmp = (sqrt(F) * sqrt((A + hypot(B_m, A)))) * (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 = (4.0 * A) * C;
double t_1 = t_0 - Math.pow(B_m, 2.0);
double tmp;
if (Math.pow(B_m, 2.0) <= 0.0) {
tmp = Math.sqrt(Math.abs(((2.0 * (Math.pow(B_m, 2.0) + (-4.0 * (A * C)))) * (F * (2.0 * C))))) / t_1;
} else if (Math.pow(B_m, 2.0) <= 1e-127) {
tmp = Math.sqrt(((2.0 * ((Math.pow(B_m, 2.0) - t_0) * F)) * (2.0 * A))) / t_1;
} else {
tmp = (Math.sqrt(F) * Math.sqrt((A + Math.hypot(B_m, A)))) * (Math.sqrt(2.0) / -B_m);
}
return tmp;
}
B_m = math.fabs(B) def code(A, B_m, C, F): t_0 = (4.0 * A) * C t_1 = t_0 - math.pow(B_m, 2.0) tmp = 0 if math.pow(B_m, 2.0) <= 0.0: tmp = math.sqrt(math.fabs(((2.0 * (math.pow(B_m, 2.0) + (-4.0 * (A * C)))) * (F * (2.0 * C))))) / t_1 elif math.pow(B_m, 2.0) <= 1e-127: tmp = math.sqrt(((2.0 * ((math.pow(B_m, 2.0) - t_0) * F)) * (2.0 * A))) / t_1 else: tmp = (math.sqrt(F) * math.sqrt((A + math.hypot(B_m, A)))) * (math.sqrt(2.0) / -B_m) return tmp
B_m = abs(B) function code(A, B_m, C, F) t_0 = Float64(Float64(4.0 * A) * C) t_1 = Float64(t_0 - (B_m ^ 2.0)) tmp = 0.0 if ((B_m ^ 2.0) <= 0.0) tmp = Float64(sqrt(abs(Float64(Float64(2.0 * Float64((B_m ^ 2.0) + Float64(-4.0 * Float64(A * C)))) * Float64(F * Float64(2.0 * C))))) / t_1); elseif ((B_m ^ 2.0) <= 1e-127) tmp = Float64(sqrt(Float64(Float64(2.0 * Float64(Float64((B_m ^ 2.0) - t_0) * F)) * Float64(2.0 * A))) / t_1); else tmp = Float64(Float64(sqrt(F) * sqrt(Float64(A + hypot(B_m, A)))) * Float64(sqrt(2.0) / Float64(-B_m))); end return tmp end
B_m = abs(B); function tmp_2 = code(A, B_m, C, F) t_0 = (4.0 * A) * C; t_1 = t_0 - (B_m ^ 2.0); tmp = 0.0; if ((B_m ^ 2.0) <= 0.0) tmp = sqrt(abs(((2.0 * ((B_m ^ 2.0) + (-4.0 * (A * C)))) * (F * (2.0 * C))))) / t_1; elseif ((B_m ^ 2.0) <= 1e-127) tmp = sqrt(((2.0 * (((B_m ^ 2.0) - t_0) * F)) * (2.0 * A))) / t_1; else tmp = (sqrt(F) * sqrt((A + hypot(B_m, A)))) * (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[(4.0 * A), $MachinePrecision] * C), $MachinePrecision]}, Block[{t$95$1 = N[(t$95$0 - N[Power[B$95$m, 2.0], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 0.0], N[(N[Sqrt[N[Abs[N[(N[(2.0 * N[(N[Power[B$95$m, 2.0], $MachinePrecision] + N[(-4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(F * N[(2.0 * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] / t$95$1), $MachinePrecision], If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 1e-127], N[(N[Sqrt[N[(N[(2.0 * N[(N[(N[Power[B$95$m, 2.0], $MachinePrecision] - t$95$0), $MachinePrecision] * F), $MachinePrecision]), $MachinePrecision] * N[(2.0 * A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / t$95$1), $MachinePrecision], N[(N[(N[Sqrt[F], $MachinePrecision] * N[Sqrt[N[(A + N[Sqrt[B$95$m ^ 2 + A ^ 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(N[Sqrt[2.0], $MachinePrecision] / (-B$95$m)), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
B_m = \left|B\right|
\\
\begin{array}{l}
t_0 := \left(4 \cdot A\right) \cdot C\\
t_1 := t\_0 - {B\_m}^{2}\\
\mathbf{if}\;{B\_m}^{2} \leq 0:\\
\;\;\;\;\frac{\sqrt{\left|\left(2 \cdot \left({B\_m}^{2} + -4 \cdot \left(A \cdot C\right)\right)\right) \cdot \left(F \cdot \left(2 \cdot C\right)\right)\right|}}{t\_1}\\
\mathbf{elif}\;{B\_m}^{2} \leq 10^{-127}:\\
\;\;\;\;\frac{\sqrt{\left(2 \cdot \left(\left({B\_m}^{2} - t\_0\right) \cdot F\right)\right) \cdot \left(2 \cdot A\right)}}{t\_1}\\
\mathbf{else}:\\
\;\;\;\;\left(\sqrt{F} \cdot \sqrt{A + \mathsf{hypot}\left(B\_m, A\right)}\right) \cdot \frac{\sqrt{2}}{-B\_m}\\
\end{array}
\end{array}
if (pow.f64 B 2) < 0.0Initial program 20.2%
Taylor expanded in A around -inf 34.3%
add-sqr-sqrt34.3%
pow1/234.3%
pow1/234.4%
pow-prod-down18.1%
pow218.1%
associate-*r*18.1%
*-commutative18.1%
*-commutative18.1%
Applied egg-rr18.1%
unpow1/218.1%
unpow218.1%
rem-sqrt-square34.9%
associate-*l*36.7%
*-commutative36.7%
*-commutative36.7%
associate-*r*36.7%
cancel-sign-sub-inv36.7%
metadata-eval36.7%
Simplified36.7%
if 0.0 < (pow.f64 B 2) < 1e-127Initial program 30.3%
Taylor expanded in A around inf 34.9%
if 1e-127 < (pow.f64 B 2) Initial program 18.7%
Taylor expanded in C around 0 13.4%
mul-1-neg13.4%
+-commutative13.4%
unpow213.4%
unpow213.4%
hypot-define27.5%
Simplified27.5%
pow1/227.6%
*-commutative27.6%
unpow-prod-down38.5%
pow1/238.5%
pow1/238.5%
Applied egg-rr38.5%
Final simplification37.5%
B_m = (fabs.f64 B)
(FPCore (A B_m C F)
:precision binary64
(if (<= F -4.3e-296)
(/
(sqrt (* (+ (+ A C) (hypot B_m (- A C))) (* (* C F) (* A -8.0))))
(- (fma B_m B_m (* A (* C -4.0)))))
(if (<= F 175000.0)
(/ (pow (* 2.0 (* F (+ A (hypot B_m A)))) 0.5) (- 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 <= -4.3e-296) {
tmp = sqrt((((A + C) + hypot(B_m, (A - C))) * ((C * F) * (A * -8.0)))) / -fma(B_m, B_m, (A * (C * -4.0)));
} else if (F <= 175000.0) {
tmp = pow((2.0 * (F * (A + hypot(B_m, A)))), 0.5) / -B_m;
} else {
tmp = sqrt(2.0) * -sqrt((F / B_m));
}
return tmp;
}
B_m = abs(B) function code(A, B_m, C, F) tmp = 0.0 if (F <= -4.3e-296) tmp = Float64(sqrt(Float64(Float64(Float64(A + C) + hypot(B_m, Float64(A - C))) * Float64(Float64(C * F) * Float64(A * -8.0)))) / Float64(-fma(B_m, B_m, Float64(A * Float64(C * -4.0))))); elseif (F <= 175000.0) tmp = Float64((Float64(2.0 * Float64(F * Float64(A + hypot(B_m, A)))) ^ 0.5) / Float64(-B_m)); else tmp = Float64(sqrt(2.0) * Float64(-sqrt(Float64(F / B_m)))); end return tmp end
B_m = N[Abs[B], $MachinePrecision] code[A_, B$95$m_, C_, F_] := If[LessEqual[F, -4.3e-296], N[(N[Sqrt[N[(N[(N[(A + C), $MachinePrecision] + N[Sqrt[B$95$m ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision] * N[(N[(C * F), $MachinePrecision] * N[(A * -8.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / (-N[(B$95$m * B$95$m + N[(A * N[(C * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision])), $MachinePrecision], If[LessEqual[F, 175000.0], N[(N[Power[N[(2.0 * N[(F * N[(A + N[Sqrt[B$95$m ^ 2 + A ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.5], $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 -4.3 \cdot 10^{-296}:\\
\;\;\;\;\frac{\sqrt{\left(\left(A + C\right) + \mathsf{hypot}\left(B\_m, A - C\right)\right) \cdot \left(\left(C \cdot F\right) \cdot \left(A \cdot -8\right)\right)}}{-\mathsf{fma}\left(B\_m, B\_m, A \cdot \left(C \cdot -4\right)\right)}\\
\mathbf{elif}\;F \leq 175000:\\
\;\;\;\;\frac{{\left(2 \cdot \left(F \cdot \left(A + \mathsf{hypot}\left(B\_m, A\right)\right)\right)\right)}^{0.5}}{-B\_m}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{2} \cdot \left(-\sqrt{\frac{F}{B\_m}}\right)\\
\end{array}
\end{array}
if F < -4.29999999999999978e-296Initial program 21.8%
Simplified43.7%
Taylor expanded in B around 0 35.7%
associate-*r*35.7%
Simplified35.7%
if -4.29999999999999978e-296 < F < 175000Initial program 20.7%
Taylor expanded in C around 0 12.3%
mul-1-neg12.3%
+-commutative12.3%
unpow212.3%
unpow212.3%
hypot-define28.0%
Simplified28.0%
associate-*l/28.0%
pow1/228.0%
pow1/228.0%
pow-prod-down28.2%
Applied egg-rr28.2%
if 175000 < F Initial program 20.8%
Taylor expanded in C around 0 13.0%
mul-1-neg13.0%
+-commutative13.0%
unpow213.0%
unpow213.0%
hypot-define18.4%
Simplified18.4%
Taylor expanded in A around 0 30.6%
Final simplification30.3%
B_m = (fabs.f64 B)
(FPCore (A B_m C F)
:precision binary64
(if (<= F -4.3e-296)
(/
(sqrt (* 4.0 (* (+ (pow B_m 2.0) (* -4.0 (* A C))) (* C F))))
(- (* (* 4.0 A) C) (pow B_m 2.0)))
(if (<= F 500000.0)
(/ (pow (* 2.0 (* F (+ A (hypot B_m A)))) 0.5) (- 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 <= -4.3e-296) {
tmp = sqrt((4.0 * ((pow(B_m, 2.0) + (-4.0 * (A * C))) * (C * F)))) / (((4.0 * A) * C) - pow(B_m, 2.0));
} else if (F <= 500000.0) {
tmp = pow((2.0 * (F * (A + hypot(B_m, A)))), 0.5) / -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 <= -4.3e-296) {
tmp = Math.sqrt((4.0 * ((Math.pow(B_m, 2.0) + (-4.0 * (A * C))) * (C * F)))) / (((4.0 * A) * C) - Math.pow(B_m, 2.0));
} else if (F <= 500000.0) {
tmp = Math.pow((2.0 * (F * (A + Math.hypot(B_m, A)))), 0.5) / -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 <= -4.3e-296: tmp = math.sqrt((4.0 * ((math.pow(B_m, 2.0) + (-4.0 * (A * C))) * (C * F)))) / (((4.0 * A) * C) - math.pow(B_m, 2.0)) elif F <= 500000.0: tmp = math.pow((2.0 * (F * (A + math.hypot(B_m, A)))), 0.5) / -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 <= -4.3e-296) tmp = Float64(sqrt(Float64(4.0 * Float64(Float64((B_m ^ 2.0) + Float64(-4.0 * Float64(A * C))) * Float64(C * F)))) / Float64(Float64(Float64(4.0 * A) * C) - (B_m ^ 2.0))); elseif (F <= 500000.0) tmp = Float64((Float64(2.0 * Float64(F * Float64(A + hypot(B_m, A)))) ^ 0.5) / Float64(-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 <= -4.3e-296) tmp = sqrt((4.0 * (((B_m ^ 2.0) + (-4.0 * (A * C))) * (C * F)))) / (((4.0 * A) * C) - (B_m ^ 2.0)); elseif (F <= 500000.0) tmp = ((2.0 * (F * (A + hypot(B_m, A)))) ^ 0.5) / -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, -4.3e-296], N[(N[Sqrt[N[(4.0 * N[(N[(N[Power[B$95$m, 2.0], $MachinePrecision] + N[(-4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(C * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(N[(N[(4.0 * A), $MachinePrecision] * C), $MachinePrecision] - N[Power[B$95$m, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 500000.0], N[(N[Power[N[(2.0 * N[(F * N[(A + N[Sqrt[B$95$m ^ 2 + A ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.5], $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 -4.3 \cdot 10^{-296}:\\
\;\;\;\;\frac{\sqrt{4 \cdot \left(\left({B\_m}^{2} + -4 \cdot \left(A \cdot C\right)\right) \cdot \left(C \cdot F\right)\right)}}{\left(4 \cdot A\right) \cdot C - {B\_m}^{2}}\\
\mathbf{elif}\;F \leq 500000:\\
\;\;\;\;\frac{{\left(2 \cdot \left(F \cdot \left(A + \mathsf{hypot}\left(B\_m, A\right)\right)\right)\right)}^{0.5}}{-B\_m}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{2} \cdot \left(-\sqrt{\frac{F}{B\_m}}\right)\\
\end{array}
\end{array}
if F < -4.29999999999999978e-296Initial program 21.8%
Taylor expanded in A around -inf 22.2%
Taylor expanded in F around 0 22.2%
associate-*r*25.2%
*-commutative25.2%
cancel-sign-sub-inv25.2%
metadata-eval25.2%
Simplified25.2%
if -4.29999999999999978e-296 < F < 5e5Initial program 20.7%
Taylor expanded in C around 0 12.3%
mul-1-neg12.3%
+-commutative12.3%
unpow212.3%
unpow212.3%
hypot-define28.0%
Simplified28.0%
associate-*l/28.0%
pow1/228.0%
pow1/228.0%
pow-prod-down28.2%
Applied egg-rr28.2%
if 5e5 < F Initial program 20.8%
Taylor expanded in C around 0 13.0%
mul-1-neg13.0%
+-commutative13.0%
unpow213.0%
unpow213.0%
hypot-define18.4%
Simplified18.4%
Taylor expanded in A around 0 30.6%
Final simplification28.8%
B_m = (fabs.f64 B)
(FPCore (A B_m C F)
:precision binary64
(if (<= F -4.3e-296)
(/
(sqrt (* (* 2.0 C) (* 2.0 (* (* C F) (* A -4.0)))))
(- (* (* 4.0 A) C) (pow B_m 2.0)))
(if (<= F 530000.0)
(/ (pow (* 2.0 (* F (+ A (hypot B_m A)))) 0.5) (- 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 <= -4.3e-296) {
tmp = sqrt(((2.0 * C) * (2.0 * ((C * F) * (A * -4.0))))) / (((4.0 * A) * C) - pow(B_m, 2.0));
} else if (F <= 530000.0) {
tmp = pow((2.0 * (F * (A + hypot(B_m, A)))), 0.5) / -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 <= -4.3e-296) {
tmp = Math.sqrt(((2.0 * C) * (2.0 * ((C * F) * (A * -4.0))))) / (((4.0 * A) * C) - Math.pow(B_m, 2.0));
} else if (F <= 530000.0) {
tmp = Math.pow((2.0 * (F * (A + Math.hypot(B_m, A)))), 0.5) / -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 <= -4.3e-296: tmp = math.sqrt(((2.0 * C) * (2.0 * ((C * F) * (A * -4.0))))) / (((4.0 * A) * C) - math.pow(B_m, 2.0)) elif F <= 530000.0: tmp = math.pow((2.0 * (F * (A + math.hypot(B_m, A)))), 0.5) / -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 <= -4.3e-296) tmp = Float64(sqrt(Float64(Float64(2.0 * C) * Float64(2.0 * Float64(Float64(C * F) * Float64(A * -4.0))))) / Float64(Float64(Float64(4.0 * A) * C) - (B_m ^ 2.0))); elseif (F <= 530000.0) tmp = Float64((Float64(2.0 * Float64(F * Float64(A + hypot(B_m, A)))) ^ 0.5) / Float64(-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 <= -4.3e-296) tmp = sqrt(((2.0 * C) * (2.0 * ((C * F) * (A * -4.0))))) / (((4.0 * A) * C) - (B_m ^ 2.0)); elseif (F <= 530000.0) tmp = ((2.0 * (F * (A + hypot(B_m, A)))) ^ 0.5) / -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, -4.3e-296], N[(N[Sqrt[N[(N[(2.0 * C), $MachinePrecision] * N[(2.0 * N[(N[(C * F), $MachinePrecision] * N[(A * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(N[(N[(4.0 * A), $MachinePrecision] * C), $MachinePrecision] - N[Power[B$95$m, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 530000.0], N[(N[Power[N[(2.0 * N[(F * N[(A + N[Sqrt[B$95$m ^ 2 + A ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.5], $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 -4.3 \cdot 10^{-296}:\\
\;\;\;\;\frac{\sqrt{\left(2 \cdot C\right) \cdot \left(2 \cdot \left(\left(C \cdot F\right) \cdot \left(A \cdot -4\right)\right)\right)}}{\left(4 \cdot A\right) \cdot C - {B\_m}^{2}}\\
\mathbf{elif}\;F \leq 530000:\\
\;\;\;\;\frac{{\left(2 \cdot \left(F \cdot \left(A + \mathsf{hypot}\left(B\_m, A\right)\right)\right)\right)}^{0.5}}{-B\_m}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{2} \cdot \left(-\sqrt{\frac{F}{B\_m}}\right)\\
\end{array}
\end{array}
if F < -4.29999999999999978e-296Initial program 21.8%
Taylor expanded in A around -inf 22.2%
Taylor expanded in B around 0 22.6%
associate-*r*22.6%
*-commutative22.6%
Simplified22.6%
if -4.29999999999999978e-296 < F < 5.3e5Initial program 20.7%
Taylor expanded in C around 0 12.3%
mul-1-neg12.3%
+-commutative12.3%
unpow212.3%
unpow212.3%
hypot-define28.0%
Simplified28.0%
associate-*l/28.0%
pow1/228.0%
pow1/228.0%
pow-prod-down28.2%
Applied egg-rr28.2%
if 5.3e5 < F Initial program 20.8%
Taylor expanded in C around 0 13.0%
mul-1-neg13.0%
+-commutative13.0%
unpow213.0%
unpow213.0%
hypot-define18.4%
Simplified18.4%
Taylor expanded in A around 0 30.6%
Final simplification28.5%
B_m = (fabs.f64 B) (FPCore (A B_m C F) :precision binary64 (if (<= F 680.0) (/ (pow (* 2.0 (* F (+ A (hypot B_m A)))) 0.5) (- 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 <= 680.0) {
tmp = pow((2.0 * (F * (A + hypot(B_m, A)))), 0.5) / -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 <= 680.0) {
tmp = Math.pow((2.0 * (F * (A + Math.hypot(B_m, A)))), 0.5) / -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 <= 680.0: tmp = math.pow((2.0 * (F * (A + math.hypot(B_m, A)))), 0.5) / -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 <= 680.0) tmp = Float64((Float64(2.0 * Float64(F * Float64(A + hypot(B_m, A)))) ^ 0.5) / Float64(-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 <= 680.0) tmp = ((2.0 * (F * (A + hypot(B_m, A)))) ^ 0.5) / -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, 680.0], N[(N[Power[N[(2.0 * N[(F * N[(A + N[Sqrt[B$95$m ^ 2 + A ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.5], $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 680:\\
\;\;\;\;\frac{{\left(2 \cdot \left(F \cdot \left(A + \mathsf{hypot}\left(B\_m, A\right)\right)\right)\right)}^{0.5}}{-B\_m}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{2} \cdot \left(-\sqrt{\frac{F}{B\_m}}\right)\\
\end{array}
\end{array}
if F < 680Initial program 21.0%
Taylor expanded in C around 0 9.4%
mul-1-neg9.4%
+-commutative9.4%
unpow29.4%
unpow29.4%
hypot-define21.4%
Simplified21.4%
associate-*l/21.4%
pow1/221.4%
pow1/221.5%
pow-prod-down21.6%
Applied egg-rr21.6%
if 680 < F Initial program 20.8%
Taylor expanded in C around 0 13.0%
mul-1-neg13.0%
+-commutative13.0%
unpow213.0%
unpow213.0%
hypot-define18.4%
Simplified18.4%
Taylor expanded in A around 0 30.6%
Final simplification25.5%
B_m = (fabs.f64 B) (FPCore (A B_m C F) :precision binary64 (if (<= F 450000000000.0) (/ (sqrt (* 2.0 (* F (+ C (hypot B_m C))))) (- 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 <= 450000000000.0) {
tmp = sqrt((2.0 * (F * (C + hypot(B_m, C))))) / -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 <= 450000000000.0) {
tmp = Math.sqrt((2.0 * (F * (C + Math.hypot(B_m, C))))) / -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 <= 450000000000.0: tmp = math.sqrt((2.0 * (F * (C + math.hypot(B_m, C))))) / -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 <= 450000000000.0) tmp = Float64(sqrt(Float64(2.0 * Float64(F * Float64(C + hypot(B_m, C))))) / Float64(-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 <= 450000000000.0) tmp = sqrt((2.0 * (F * (C + hypot(B_m, C))))) / -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, 450000000000.0], N[(N[Sqrt[N[(2.0 * N[(F * N[(C + N[Sqrt[B$95$m ^ 2 + C ^ 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 450000000000:\\
\;\;\;\;\frac{\sqrt{2 \cdot \left(F \cdot \left(C + \mathsf{hypot}\left(B\_m, C\right)\right)\right)}}{-B\_m}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{2} \cdot \left(-\sqrt{\frac{F}{B\_m}}\right)\\
\end{array}
\end{array}
if F < 4.5e11Initial program 20.6%
Taylor expanded in A around 0 7.0%
mul-1-neg7.0%
unpow27.0%
unpow27.0%
hypot-define17.1%
Simplified17.1%
associate-*l/17.2%
pow1/217.2%
pow1/217.3%
pow-prod-down17.3%
Applied egg-rr17.3%
unpow1/217.2%
Simplified17.2%
if 4.5e11 < F Initial program 21.3%
Taylor expanded in C around 0 13.3%
mul-1-neg13.3%
+-commutative13.3%
unpow213.3%
unpow213.3%
hypot-define18.6%
Simplified18.6%
Taylor expanded in A around 0 31.2%
Final simplification23.1%
B_m = (fabs.f64 B) (FPCore (A B_m C F) :precision binary64 (if (<= F 70000.0) (/ (sqrt (* (* 2.0 F) (+ A (hypot B_m A)))) (- 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 <= 70000.0) {
tmp = sqrt(((2.0 * F) * (A + hypot(B_m, A)))) / -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 <= 70000.0) {
tmp = Math.sqrt(((2.0 * F) * (A + Math.hypot(B_m, A)))) / -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 <= 70000.0: tmp = math.sqrt(((2.0 * F) * (A + math.hypot(B_m, A)))) / -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 <= 70000.0) tmp = Float64(sqrt(Float64(Float64(2.0 * F) * Float64(A + hypot(B_m, A)))) / Float64(-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 <= 70000.0) tmp = sqrt(((2.0 * F) * (A + hypot(B_m, A)))) / -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, 70000.0], N[(N[Sqrt[N[(N[(2.0 * F), $MachinePrecision] * N[(A + N[Sqrt[B$95$m ^ 2 + A ^ 2], $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 70000:\\
\;\;\;\;\frac{\sqrt{\left(2 \cdot F\right) \cdot \left(A + \mathsf{hypot}\left(B\_m, A\right)\right)}}{-B\_m}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{2} \cdot \left(-\sqrt{\frac{F}{B\_m}}\right)\\
\end{array}
\end{array}
if F < 7e4Initial program 21.0%
Taylor expanded in C around 0 9.4%
mul-1-neg9.4%
+-commutative9.4%
unpow29.4%
unpow29.4%
hypot-define21.4%
Simplified21.4%
associate-*l/21.4%
pow1/221.4%
pow1/221.5%
pow-prod-down21.6%
Applied egg-rr21.6%
unpow1/221.5%
associate-*r*21.5%
Simplified21.5%
if 7e4 < F Initial program 20.8%
Taylor expanded in C around 0 13.0%
mul-1-neg13.0%
+-commutative13.0%
unpow213.0%
unpow213.0%
hypot-define18.4%
Simplified18.4%
Taylor expanded in A around 0 30.6%
Final simplification25.4%
B_m = (fabs.f64 B) (FPCore (A B_m C F) :precision binary64 (if (<= F 2.6e+55) (* (sqrt (* B_m F)) (/ (sqrt 2.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 <= 2.6e+55) {
tmp = sqrt((B_m * F)) * (sqrt(2.0) / -B_m);
} 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 <= 2.6d+55) then
tmp = sqrt((b_m * f)) * (sqrt(2.0d0) / -b_m)
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 <= 2.6e+55) {
tmp = Math.sqrt((B_m * F)) * (Math.sqrt(2.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 <= 2.6e+55: tmp = math.sqrt((B_m * F)) * (math.sqrt(2.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 <= 2.6e+55) tmp = Float64(sqrt(Float64(B_m * F)) * Float64(sqrt(2.0) / Float64(-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 <= 2.6e+55) tmp = sqrt((B_m * F)) * (sqrt(2.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, 2.6e+55], N[(N[Sqrt[N[(B$95$m * F), $MachinePrecision]], $MachinePrecision] * N[(N[Sqrt[2.0], $MachinePrecision] / (-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 2.6 \cdot 10^{+55}:\\
\;\;\;\;\sqrt{B\_m \cdot F} \cdot \frac{\sqrt{2}}{-B\_m}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{2} \cdot \left(-\sqrt{\frac{F}{B\_m}}\right)\\
\end{array}
\end{array}
if F < 2.6e55Initial program 22.5%
Taylor expanded in C around 0 11.1%
mul-1-neg11.1%
+-commutative11.1%
unpow211.1%
unpow211.1%
hypot-define23.2%
Simplified23.2%
Taylor expanded in A around 0 17.8%
if 2.6e55 < F Initial program 18.1%
Taylor expanded in C around 0 10.7%
mul-1-neg10.7%
+-commutative10.7%
unpow210.7%
unpow210.7%
hypot-define14.7%
Simplified14.7%
Taylor expanded in A around 0 29.0%
Final simplification21.9%
B_m = (fabs.f64 B) (FPCore (A B_m C F) :precision binary64 (if (<= A 7.5e+124) (* (sqrt 2.0) (- (sqrt (/ F B_m)))) (* (sqrt (* A F)) (- (/ 2.0 B_m)))))
B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
double tmp;
if (A <= 7.5e+124) {
tmp = sqrt(2.0) * -sqrt((F / B_m));
} else {
tmp = sqrt((A * F)) * -(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 (a <= 7.5d+124) then
tmp = sqrt(2.0d0) * -sqrt((f / b_m))
else
tmp = sqrt((a * f)) * -(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 (A <= 7.5e+124) {
tmp = Math.sqrt(2.0) * -Math.sqrt((F / B_m));
} else {
tmp = Math.sqrt((A * F)) * -(2.0 / B_m);
}
return tmp;
}
B_m = math.fabs(B) def code(A, B_m, C, F): tmp = 0 if A <= 7.5e+124: tmp = math.sqrt(2.0) * -math.sqrt((F / B_m)) else: tmp = math.sqrt((A * F)) * -(2.0 / B_m) return tmp
B_m = abs(B) function code(A, B_m, C, F) tmp = 0.0 if (A <= 7.5e+124) tmp = Float64(sqrt(2.0) * Float64(-sqrt(Float64(F / B_m)))); else tmp = Float64(sqrt(Float64(A * F)) * 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 (A <= 7.5e+124) tmp = sqrt(2.0) * -sqrt((F / B_m)); else tmp = sqrt((A * F)) * -(2.0 / B_m); end tmp_2 = tmp; end
B_m = N[Abs[B], $MachinePrecision] code[A_, B$95$m_, C_, F_] := If[LessEqual[A, 7.5e+124], N[(N[Sqrt[2.0], $MachinePrecision] * (-N[Sqrt[N[(F / B$95$m), $MachinePrecision]], $MachinePrecision])), $MachinePrecision], N[(N[Sqrt[N[(A * F), $MachinePrecision]], $MachinePrecision] * (-N[(2.0 / B$95$m), $MachinePrecision])), $MachinePrecision]]
\begin{array}{l}
B_m = \left|B\right|
\\
\begin{array}{l}
\mathbf{if}\;A \leq 7.5 \cdot 10^{+124}:\\
\;\;\;\;\sqrt{2} \cdot \left(-\sqrt{\frac{F}{B\_m}}\right)\\
\mathbf{else}:\\
\;\;\;\;\sqrt{A \cdot F} \cdot \left(-\frac{2}{B\_m}\right)\\
\end{array}
\end{array}
if A < 7.50000000000000038e124Initial program 23.3%
Taylor expanded in C around 0 12.2%
mul-1-neg12.2%
+-commutative12.2%
unpow212.2%
unpow212.2%
hypot-define20.5%
Simplified20.5%
Taylor expanded in A around 0 20.6%
if 7.50000000000000038e124 < A Initial program 10.1%
Taylor expanded in C around 0 5.4%
mul-1-neg5.4%
+-commutative5.4%
unpow25.4%
unpow25.4%
hypot-define18.1%
Simplified18.1%
Taylor expanded in B around 0 15.9%
*-commutative15.9%
unpow215.9%
rem-square-sqrt16.0%
Simplified16.0%
Final simplification19.8%
B_m = (fabs.f64 B) (FPCore (A B_m C F) :precision binary64 (let* ((t_0 (- (/ 2.0 B_m)))) (if (<= C 1.3e-98) (* (sqrt (* A F)) t_0) (* (sqrt (* C 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 (C <= 1.3e-98) {
tmp = sqrt((A * F)) * t_0;
} else {
tmp = sqrt((C * 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 (c <= 1.3d-98) then
tmp = sqrt((a * f)) * t_0
else
tmp = sqrt((c * 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 (C <= 1.3e-98) {
tmp = Math.sqrt((A * F)) * t_0;
} else {
tmp = Math.sqrt((C * 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 C <= 1.3e-98: tmp = math.sqrt((A * F)) * t_0 else: tmp = math.sqrt((C * 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 (C <= 1.3e-98) tmp = Float64(sqrt(Float64(A * F)) * t_0); else tmp = Float64(sqrt(Float64(C * 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 (C <= 1.3e-98) tmp = sqrt((A * F)) * t_0; else tmp = sqrt((C * 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[C, 1.3e-98], N[(N[Sqrt[N[(A * F), $MachinePrecision]], $MachinePrecision] * t$95$0), $MachinePrecision], N[(N[Sqrt[N[(C * 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}\;C \leq 1.3 \cdot 10^{-98}:\\
\;\;\;\;\sqrt{A \cdot F} \cdot t\_0\\
\mathbf{else}:\\
\;\;\;\;\sqrt{C \cdot F} \cdot t\_0\\
\end{array}
\end{array}
if C < 1.30000000000000007e-98Initial program 19.6%
Taylor expanded in C around 0 13.4%
mul-1-neg13.4%
+-commutative13.4%
unpow213.4%
unpow213.4%
hypot-define23.1%
Simplified23.1%
Taylor expanded in B around 0 7.0%
*-commutative7.0%
unpow27.0%
rem-square-sqrt7.0%
Simplified7.0%
if 1.30000000000000007e-98 < C Initial program 23.3%
Taylor expanded in A around 0 5.9%
mul-1-neg5.9%
unpow25.9%
unpow25.9%
hypot-define17.4%
Simplified17.4%
Taylor expanded in B around 0 6.4%
unpow26.4%
rem-square-sqrt6.4%
*-commutative6.4%
Simplified6.4%
Final simplification6.8%
B_m = (fabs.f64 B) (FPCore (A B_m C F) :precision binary64 (* (sqrt (* A F)) (/ 2.0 (- B_m))))
B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
return sqrt((A * 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((a * 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((A * F)) * (2.0 / -B_m);
}
B_m = math.fabs(B) def code(A, B_m, C, F): return math.sqrt((A * F)) * (2.0 / -B_m)
B_m = abs(B) function code(A, B_m, C, F) return Float64(sqrt(Float64(A * F)) * Float64(2.0 / Float64(-B_m))) end
B_m = abs(B); function tmp = code(A, B_m, C, F) tmp = sqrt((A * F)) * (2.0 / -B_m); end
B_m = N[Abs[B], $MachinePrecision] code[A_, B$95$m_, C_, F_] := N[(N[Sqrt[N[(A * F), $MachinePrecision]], $MachinePrecision] * N[(2.0 / (-B$95$m)), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
B_m = \left|B\right|
\\
\sqrt{A \cdot F} \cdot \frac{2}{-B\_m}
\end{array}
Initial program 20.9%
Taylor expanded in C around 0 11.0%
mul-1-neg11.0%
+-commutative11.0%
unpow211.0%
unpow211.0%
hypot-define20.1%
Simplified20.1%
Taylor expanded in B around 0 5.0%
*-commutative5.0%
unpow25.0%
rem-square-sqrt5.0%
Simplified5.0%
Final simplification5.0%
herbie shell --seed 2024046
(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))))