
(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 (- (* 4.0 (* A C)) (pow B_m 2.0)))
(t_1 (fma B_m B_m (* A (* C -4.0))))
(t_2 (* (* 4.0 A) C))
(t_3
(/
(sqrt
(*
(* 2.0 (* (- (pow B_m 2.0) t_2) F))
(+ (+ A C) (sqrt (+ (pow B_m 2.0) (pow (- A C) 2.0))))))
(- t_2 (pow B_m 2.0)))))
(if (<= t_3 -1e-211)
(/
(*
(* (sqrt (+ (+ A C) (hypot B_m (- A C)))) (sqrt F))
(sqrt (* 2.0 (fma A (* C -4.0) (pow B_m 2.0)))))
t_0)
(if (<= t_3 0.0)
(/
(sqrt
(fma
-16.0
(* A (* F (pow C 2.0)))
(fma
-2.0
(*
F
(/
(fma -2.0 (* (pow B_m 2.0) (pow C 2.0)) (* 0.5 (pow B_m 4.0)))
A))
(* 8.0 (* F (* (pow B_m 2.0) C))))))
t_0)
(if (<= t_3 INFINITY)
(/
(* (sqrt (+ (+ A C) (hypot (- A C) B_m))) (sqrt (* t_1 (* 2.0 F))))
(- t_1))
(*
(/ (sqrt 2.0) B_m)
(* (sqrt (+ A (hypot B_m A))) (- (sqrt F)))))))))B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
double t_0 = (4.0 * (A * C)) - pow(B_m, 2.0);
double t_1 = fma(B_m, B_m, (A * (C * -4.0)));
double t_2 = (4.0 * A) * C;
double t_3 = sqrt(((2.0 * ((pow(B_m, 2.0) - t_2) * F)) * ((A + C) + sqrt((pow(B_m, 2.0) + pow((A - C), 2.0)))))) / (t_2 - pow(B_m, 2.0));
double tmp;
if (t_3 <= -1e-211) {
tmp = ((sqrt(((A + C) + hypot(B_m, (A - C)))) * sqrt(F)) * sqrt((2.0 * fma(A, (C * -4.0), pow(B_m, 2.0))))) / t_0;
} else if (t_3 <= 0.0) {
tmp = sqrt(fma(-16.0, (A * (F * pow(C, 2.0))), fma(-2.0, (F * (fma(-2.0, (pow(B_m, 2.0) * pow(C, 2.0)), (0.5 * pow(B_m, 4.0))) / A)), (8.0 * (F * (pow(B_m, 2.0) * C)))))) / t_0;
} else if (t_3 <= ((double) INFINITY)) {
tmp = (sqrt(((A + C) + hypot((A - C), B_m))) * sqrt((t_1 * (2.0 * F)))) / -t_1;
} else {
tmp = (sqrt(2.0) / B_m) * (sqrt((A + hypot(B_m, A))) * -sqrt(F));
}
return tmp;
}
B_m = abs(B) function code(A, B_m, C, F) t_0 = Float64(Float64(4.0 * Float64(A * C)) - (B_m ^ 2.0)) t_1 = fma(B_m, B_m, Float64(A * Float64(C * -4.0))) t_2 = Float64(Float64(4.0 * A) * C) t_3 = Float64(sqrt(Float64(Float64(2.0 * Float64(Float64((B_m ^ 2.0) - t_2) * F)) * Float64(Float64(A + C) + sqrt(Float64((B_m ^ 2.0) + (Float64(A - C) ^ 2.0)))))) / Float64(t_2 - (B_m ^ 2.0))) tmp = 0.0 if (t_3 <= -1e-211) tmp = Float64(Float64(Float64(sqrt(Float64(Float64(A + C) + hypot(B_m, Float64(A - C)))) * sqrt(F)) * sqrt(Float64(2.0 * fma(A, Float64(C * -4.0), (B_m ^ 2.0))))) / t_0); elseif (t_3 <= 0.0) tmp = Float64(sqrt(fma(-16.0, Float64(A * Float64(F * (C ^ 2.0))), fma(-2.0, Float64(F * Float64(fma(-2.0, Float64((B_m ^ 2.0) * (C ^ 2.0)), Float64(0.5 * (B_m ^ 4.0))) / A)), Float64(8.0 * Float64(F * Float64((B_m ^ 2.0) * C)))))) / t_0); elseif (t_3 <= Inf) tmp = Float64(Float64(sqrt(Float64(Float64(A + C) + hypot(Float64(A - C), B_m))) * sqrt(Float64(t_1 * Float64(2.0 * F)))) / Float64(-t_1)); else tmp = Float64(Float64(sqrt(2.0) / B_m) * Float64(sqrt(Float64(A + hypot(B_m, A))) * 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[(4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision] - N[Power[B$95$m, 2.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(B$95$m * B$95$m + N[(A * N[(C * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(4.0 * A), $MachinePrecision] * C), $MachinePrecision]}, Block[{t$95$3 = N[(N[Sqrt[N[(N[(2.0 * N[(N[(N[Power[B$95$m, 2.0], $MachinePrecision] - t$95$2), $MachinePrecision] * F), $MachinePrecision]), $MachinePrecision] * 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] / N[(t$95$2 - N[Power[B$95$m, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$3, -1e-211], N[(N[(N[(N[Sqrt[N[(N[(A + C), $MachinePrecision] + N[Sqrt[B$95$m ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $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] / t$95$0), $MachinePrecision], If[LessEqual[t$95$3, 0.0], N[(N[Sqrt[N[(-16.0 * N[(A * N[(F * N[Power[C, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(-2.0 * N[(F * N[(N[(-2.0 * N[(N[Power[B$95$m, 2.0], $MachinePrecision] * N[Power[C, 2.0], $MachinePrecision]), $MachinePrecision] + N[(0.5 * N[Power[B$95$m, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / A), $MachinePrecision]), $MachinePrecision] + N[(8.0 * N[(F * N[(N[Power[B$95$m, 2.0], $MachinePrecision] * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / t$95$0), $MachinePrecision], If[LessEqual[t$95$3, 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$1 * N[(2.0 * F), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / (-t$95$1)), $MachinePrecision], N[(N[(N[Sqrt[2.0], $MachinePrecision] / B$95$m), $MachinePrecision] * N[(N[Sqrt[N[(A + N[Sqrt[B$95$m ^ 2 + A ^ 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-N[Sqrt[F], $MachinePrecision])), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
B_m = \left|B\right|
\\
\begin{array}{l}
t_0 := 4 \cdot \left(A \cdot C\right) - {B\_m}^{2}\\
t_1 := \mathsf{fma}\left(B\_m, B\_m, A \cdot \left(C \cdot -4\right)\right)\\
t_2 := \left(4 \cdot A\right) \cdot C\\
t_3 := \frac{\sqrt{\left(2 \cdot \left(\left({B\_m}^{2} - t\_2\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{{B\_m}^{2} + {\left(A - C\right)}^{2}}\right)}}{t\_2 - {B\_m}^{2}}\\
\mathbf{if}\;t\_3 \leq -1 \cdot 10^{-211}:\\
\;\;\;\;\frac{\left(\sqrt{\left(A + C\right) + \mathsf{hypot}\left(B\_m, A - C\right)} \cdot \sqrt{F}\right) \cdot \sqrt{2 \cdot \mathsf{fma}\left(A, C \cdot -4, {B\_m}^{2}\right)}}{t\_0}\\
\mathbf{elif}\;t\_3 \leq 0:\\
\;\;\;\;\frac{\sqrt{\mathsf{fma}\left(-16, A \cdot \left(F \cdot {C}^{2}\right), \mathsf{fma}\left(-2, F \cdot \frac{\mathsf{fma}\left(-2, {B\_m}^{2} \cdot {C}^{2}, 0.5 \cdot {B\_m}^{4}\right)}{A}, 8 \cdot \left(F \cdot \left({B\_m}^{2} \cdot C\right)\right)\right)\right)}}{t\_0}\\
\mathbf{elif}\;t\_3 \leq \infty:\\
\;\;\;\;\frac{\sqrt{\left(A + C\right) + \mathsf{hypot}\left(A - C, B\_m\right)} \cdot \sqrt{t\_1 \cdot \left(2 \cdot F\right)}}{-t\_1}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{2}}{B\_m} \cdot \left(\sqrt{A + \mathsf{hypot}\left(B\_m, A\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 47.1%
Simplified42.4%
pow1/242.4%
associate-*r*54.9%
unpow-prod-down69.1%
+-commutative69.1%
hypot-undefine53.4%
unpow253.4%
unpow253.4%
+-commutative53.4%
unpow253.4%
unpow253.4%
hypot-define69.1%
pow1/269.1%
Applied egg-rr69.1%
unpow1/269.1%
+-commutative69.1%
hypot-undefine53.4%
unpow253.4%
unpow253.4%
+-commutative53.4%
associate-+r+53.4%
unpow253.4%
unpow253.4%
hypot-undefine70.1%
Simplified70.1%
pow1/270.1%
*-commutative70.1%
unpow-prod-down77.1%
pow1/277.1%
associate-+r+76.1%
pow1/276.1%
Applied egg-rr76.1%
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))) < -0.0Initial program 3.5%
Simplified6.9%
Taylor expanded in A around -inf 32.7%
fma-define32.7%
fma-define32.7%
associate-/l*35.0%
fma-define35.0%
associate-*r*34.5%
Simplified34.5%
if -0.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))) < +inf.0Initial program 33.2%
Simplified63.9%
pow1/263.9%
*-commutative63.9%
unpow-prod-down76.3%
pow1/276.3%
+-commutative76.3%
hypot-undefine34.3%
unpow234.3%
unpow234.3%
+-commutative34.3%
unpow234.3%
unpow234.3%
hypot-define76.3%
pow1/276.3%
*-commutative76.3%
Applied egg-rr76.3%
if +inf.0 < (/.f64 (neg.f64 (sqrt.f64 (*.f64 (*.f64 2 (*.f64 (-.f64 (pow.f64 B 2) (*.f64 (*.f64 4 A) C)) F)) (+.f64 (+.f64 A C) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) 2) (pow.f64 B 2))))))) (-.f64 (pow.f64 B 2) (*.f64 (*.f64 4 A) C))) Initial program 0.0%
Taylor expanded in C around 0 2.1%
mul-1-neg2.1%
distribute-rgt-neg-in2.1%
+-commutative2.1%
unpow22.1%
unpow22.1%
hypot-define18.8%
Simplified18.8%
pow1/218.8%
*-commutative18.8%
unpow-prod-down32.1%
pow1/232.1%
pow1/232.1%
Applied egg-rr32.1%
Final simplification52.8%
B_m = (fabs.f64 B)
(FPCore (A B_m C F)
:precision binary64
(let* ((t_0 (* (* 4.0 A) C))
(t_1
(/
(sqrt
(*
(* 2.0 (* (- (pow B_m 2.0) t_0) F))
(+ (+ A C) (sqrt (+ (pow B_m 2.0) (pow (- A C) 2.0))))))
(- t_0 (pow B_m 2.0))))
(t_2 (fma B_m B_m (* A (* C -4.0)))))
(if (<= t_1 0.0)
(/
(*
(* (sqrt (+ (+ A C) (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_1 INFINITY)
(/
(* (sqrt (+ (+ A C) (hypot (- A C) B_m))) (sqrt (* t_2 (* 2.0 F))))
(- t_2))
(* (/ (sqrt 2.0) B_m) (* (sqrt (+ A (hypot B_m A))) (- (sqrt F))))))))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 = sqrt(((2.0 * ((pow(B_m, 2.0) - t_0) * F)) * ((A + C) + sqrt((pow(B_m, 2.0) + pow((A - C), 2.0)))))) / (t_0 - pow(B_m, 2.0));
double t_2 = fma(B_m, B_m, (A * (C * -4.0)));
double tmp;
if (t_1 <= 0.0) {
tmp = ((sqrt(((A + C) + 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_1 <= ((double) INFINITY)) {
tmp = (sqrt(((A + C) + hypot((A - C), B_m))) * sqrt((t_2 * (2.0 * F)))) / -t_2;
} else {
tmp = (sqrt(2.0) / B_m) * (sqrt((A + hypot(B_m, A))) * -sqrt(F));
}
return tmp;
}
B_m = abs(B) function code(A, B_m, C, F) t_0 = Float64(Float64(4.0 * A) * C) t_1 = Float64(sqrt(Float64(Float64(2.0 * Float64(Float64((B_m ^ 2.0) - t_0) * F)) * Float64(Float64(A + C) + sqrt(Float64((B_m ^ 2.0) + (Float64(A - C) ^ 2.0)))))) / Float64(t_0 - (B_m ^ 2.0))) t_2 = fma(B_m, B_m, Float64(A * Float64(C * -4.0))) tmp = 0.0 if (t_1 <= 0.0) tmp = Float64(Float64(Float64(sqrt(Float64(Float64(A + C) + 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_1 <= Inf) tmp = Float64(Float64(sqrt(Float64(Float64(A + C) + hypot(Float64(A - C), B_m))) * sqrt(Float64(t_2 * Float64(2.0 * F)))) / Float64(-t_2)); else tmp = Float64(Float64(sqrt(2.0) / B_m) * Float64(sqrt(Float64(A + hypot(B_m, A))) * 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[(4.0 * A), $MachinePrecision] * C), $MachinePrecision]}, Block[{t$95$1 = 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[(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] / N[(t$95$0 - N[Power[B$95$m, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(B$95$m * B$95$m + N[(A * N[(C * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, 0.0], N[(N[(N[(N[Sqrt[N[(N[(A + C), $MachinePrecision] + N[Sqrt[B$95$m ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $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$1, 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$2 * N[(2.0 * F), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / (-t$95$2)), $MachinePrecision], N[(N[(N[Sqrt[2.0], $MachinePrecision] / B$95$m), $MachinePrecision] * N[(N[Sqrt[N[(A + N[Sqrt[B$95$m ^ 2 + A ^ 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-N[Sqrt[F], $MachinePrecision])), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
B_m = \left|B\right|
\\
\begin{array}{l}
t_0 := \left(4 \cdot A\right) \cdot C\\
t_1 := \frac{\sqrt{\left(2 \cdot \left(\left({B\_m}^{2} - t\_0\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{{B\_m}^{2} + {\left(A - C\right)}^{2}}\right)}}{t\_0 - {B\_m}^{2}}\\
t_2 := \mathsf{fma}\left(B\_m, B\_m, A \cdot \left(C \cdot -4\right)\right)\\
\mathbf{if}\;t\_1 \leq 0:\\
\;\;\;\;\frac{\left(\sqrt{\left(A + C\right) + \mathsf{hypot}\left(B\_m, A - C\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\_1 \leq \infty:\\
\;\;\;\;\frac{\sqrt{\left(A + C\right) + \mathsf{hypot}\left(A - C, B\_m\right)} \cdot \sqrt{t\_2 \cdot \left(2 \cdot F\right)}}{-t\_2}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{2}}{B\_m} \cdot \left(\sqrt{A + \mathsf{hypot}\left(B\_m, A\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))) < -0.0Initial program 37.1%
Simplified34.3%
pow1/234.3%
associate-*r*43.9%
unpow-prod-down57.7%
+-commutative57.7%
hypot-undefine45.6%
unpow245.6%
unpow245.6%
+-commutative45.6%
unpow245.6%
unpow245.6%
hypot-define57.7%
pow1/257.7%
Applied egg-rr57.7%
unpow1/257.7%
+-commutative57.7%
hypot-undefine45.6%
unpow245.6%
unpow245.6%
+-commutative45.6%
associate-+r+45.9%
unpow245.9%
unpow245.9%
hypot-undefine58.8%
Simplified58.8%
pow1/258.8%
*-commutative58.8%
unpow-prod-down64.1%
pow1/264.1%
associate-+r+63.1%
pow1/263.1%
Applied egg-rr63.1%
if -0.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))) < +inf.0Initial program 33.2%
Simplified63.9%
pow1/263.9%
*-commutative63.9%
unpow-prod-down76.3%
pow1/276.3%
+-commutative76.3%
hypot-undefine34.3%
unpow234.3%
unpow234.3%
+-commutative34.3%
unpow234.3%
unpow234.3%
hypot-define76.3%
pow1/276.3%
*-commutative76.3%
Applied egg-rr76.3%
if +inf.0 < (/.f64 (neg.f64 (sqrt.f64 (*.f64 (*.f64 2 (*.f64 (-.f64 (pow.f64 B 2) (*.f64 (*.f64 4 A) C)) F)) (+.f64 (+.f64 A C) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) 2) (pow.f64 B 2))))))) (-.f64 (pow.f64 B 2) (*.f64 (*.f64 4 A) C))) Initial program 0.0%
Taylor expanded in C around 0 2.1%
mul-1-neg2.1%
distribute-rgt-neg-in2.1%
+-commutative2.1%
unpow22.1%
unpow22.1%
hypot-define18.8%
Simplified18.8%
pow1/218.8%
*-commutative18.8%
unpow-prod-down32.1%
pow1/232.1%
pow1/232.1%
Applied egg-rr32.1%
Final simplification51.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) 2e+117)
(/
(* (sqrt (+ (+ A C) (hypot (- A C) B_m))) (sqrt (* t_0 (* 2.0 F))))
(- t_0))
(* (/ (sqrt 2.0) B_m) (* (sqrt (+ A (hypot B_m A))) (- (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) <= 2e+117) {
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((A + hypot(B_m, A))) * -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) <= 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(2.0) / B_m) * Float64(sqrt(Float64(A + hypot(B_m, A))) * 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], 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[2.0], $MachinePrecision] / B$95$m), $MachinePrecision] * N[(N[Sqrt[N[(A + N[Sqrt[B$95$m ^ 2 + A ^ 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 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}:\\
\;\;\;\;\frac{\sqrt{2}}{B\_m} \cdot \left(\sqrt{A + \mathsf{hypot}\left(B\_m, A\right)} \cdot \left(-\sqrt{F}\right)\right)\\
\end{array}
\end{array}
if (pow.f64 B 2) < 2.0000000000000001e117Initial program 30.7%
Simplified39.0%
pow1/239.0%
*-commutative39.0%
unpow-prod-down47.2%
pow1/247.2%
+-commutative47.2%
hypot-undefine34.1%
unpow234.1%
unpow234.1%
+-commutative34.1%
unpow234.1%
unpow234.1%
hypot-define47.2%
pow1/247.2%
*-commutative47.2%
Applied egg-rr47.2%
if 2.0000000000000001e117 < (pow.f64 B 2) Initial program 8.0%
Taylor expanded in C around 0 11.1%
mul-1-neg11.1%
distribute-rgt-neg-in11.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.8%
B_m = (fabs.f64 B)
(FPCore (A B_m C F)
:precision binary64
(if (<= (pow B_m 2.0) 2e+117)
(/
(sqrt
(*
2.0
(*
(fma A (* C -4.0) (pow B_m 2.0))
(* F (+ A (+ C (hypot B_m (- A C))))))))
(- (* 4.0 (* A C)) (pow B_m 2.0)))
(* (/ (sqrt 2.0) B_m) (* (sqrt (+ A (hypot B_m A))) (- (sqrt F))))))B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
double tmp;
if (pow(B_m, 2.0) <= 2e+117) {
tmp = sqrt((2.0 * (fma(A, (C * -4.0), pow(B_m, 2.0)) * (F * (A + (C + hypot(B_m, (A - C)))))))) / ((4.0 * (A * C)) - pow(B_m, 2.0));
} else {
tmp = (sqrt(2.0) / B_m) * (sqrt((A + hypot(B_m, A))) * -sqrt(F));
}
return tmp;
}
B_m = abs(B) function code(A, B_m, C, F) tmp = 0.0 if ((B_m ^ 2.0) <= 2e+117) tmp = Float64(sqrt(Float64(2.0 * Float64(fma(A, Float64(C * -4.0), (B_m ^ 2.0)) * Float64(F * Float64(A + Float64(C + hypot(B_m, Float64(A - C)))))))) / Float64(Float64(4.0 * Float64(A * C)) - (B_m ^ 2.0))); else tmp = Float64(Float64(sqrt(2.0) / B_m) * Float64(sqrt(Float64(A + hypot(B_m, A))) * Float64(-sqrt(F)))); end return tmp end
B_m = N[Abs[B], $MachinePrecision] code[A_, B$95$m_, C_, F_] := If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 2e+117], N[(N[Sqrt[N[(2.0 * N[(N[(A * N[(C * -4.0), $MachinePrecision] + N[Power[B$95$m, 2.0], $MachinePrecision]), $MachinePrecision] * N[(F * N[(A + N[(C + N[Sqrt[B$95$m ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(N[(4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision] - N[Power[B$95$m, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[2.0], $MachinePrecision] / B$95$m), $MachinePrecision] * N[(N[Sqrt[N[(A + N[Sqrt[B$95$m ^ 2 + A ^ 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-N[Sqrt[F], $MachinePrecision])), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
B_m = \left|B\right|
\\
\begin{array}{l}
\mathbf{if}\;{B\_m}^{2} \leq 2 \cdot 10^{+117}:\\
\;\;\;\;\frac{\sqrt{2 \cdot \left(\mathsf{fma}\left(A, C \cdot -4, {B\_m}^{2}\right) \cdot \left(F \cdot \left(A + \left(C + \mathsf{hypot}\left(B\_m, A - C\right)\right)\right)\right)\right)}}{4 \cdot \left(A \cdot C\right) - {B\_m}^{2}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{2}}{B\_m} \cdot \left(\sqrt{A + \mathsf{hypot}\left(B\_m, A\right)} \cdot \left(-\sqrt{F}\right)\right)\\
\end{array}
\end{array}
if (pow.f64 B 2) < 2.0000000000000001e117Initial program 30.7%
Simplified35.2%
Taylor expanded in F around 0 30.0%
associate-*r*30.9%
unpow230.9%
unpow230.9%
hypot-undefine40.0%
*-commutative40.0%
associate-*r*40.0%
fma-undefine40.0%
Simplified40.0%
if 2.0000000000000001e117 < (pow.f64 B 2) Initial program 8.0%
Taylor expanded in C around 0 11.1%
mul-1-neg11.1%
distribute-rgt-neg-in11.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 simplification42.6%
B_m = (fabs.f64 B)
(FPCore (A B_m C F)
:precision binary64
(let* ((t_0 (fma B_m B_m (* A (* C -4.0)))))
(if (<= B_m 5e+58)
(/ (sqrt (* (+ (+ A C) (hypot B_m (- A C))) (* t_0 (* 2.0 F)))) (- t_0))
(* (/ (sqrt 2.0) B_m) (* (sqrt (+ A (hypot B_m A))) (- (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 (B_m <= 5e+58) {
tmp = sqrt((((A + C) + hypot(B_m, (A - C))) * (t_0 * (2.0 * F)))) / -t_0;
} else {
tmp = (sqrt(2.0) / B_m) * (sqrt((A + hypot(B_m, A))) * -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 <= 5e+58) tmp = Float64(sqrt(Float64(Float64(Float64(A + C) + hypot(B_m, Float64(A - C))) * Float64(t_0 * Float64(2.0 * F)))) / Float64(-t_0)); else tmp = Float64(Float64(sqrt(2.0) / B_m) * Float64(sqrt(Float64(A + hypot(B_m, A))) * 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[B$95$m, 5e+58], N[(N[Sqrt[N[(N[(N[(A + C), $MachinePrecision] + N[Sqrt[B$95$m ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision] * 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[(A + N[Sqrt[B$95$m ^ 2 + A ^ 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 \leq 5 \cdot 10^{+58}:\\
\;\;\;\;\frac{\sqrt{\left(\left(A + C\right) + \mathsf{hypot}\left(B\_m, A - C\right)\right) \cdot \left(t\_0 \cdot \left(2 \cdot F\right)\right)}}{-t\_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{2}}{B\_m} \cdot \left(\sqrt{A + \mathsf{hypot}\left(B\_m, A\right)} \cdot \left(-\sqrt{F}\right)\right)\\
\end{array}
\end{array}
if B < 4.99999999999999986e58Initial program 24.5%
Simplified31.4%
if 4.99999999999999986e58 < B Initial program 10.1%
Taylor expanded in C around 0 18.1%
mul-1-neg18.1%
distribute-rgt-neg-in18.1%
+-commutative18.1%
unpow218.1%
unpow218.1%
hypot-define49.9%
Simplified49.9%
pow1/249.9%
*-commutative49.9%
unpow-prod-down76.9%
pow1/276.9%
pow1/277.0%
Applied egg-rr77.0%
Final simplification42.8%
B_m = (fabs.f64 B)
(FPCore (A B_m C F)
:precision binary64
(if (<= B_m 3e-136)
(/
(sqrt
(*
(+ (+ A C) (hypot B_m (- A C)))
(* (fma B_m B_m (* A (* C -4.0))) (* 2.0 F))))
(* A (* C (- -4.0))))
(* (/ (sqrt 2.0) B_m) (* (sqrt (+ A (hypot B_m A))) (- (sqrt F))))))B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
double tmp;
if (B_m <= 3e-136) {
tmp = sqrt((((A + C) + hypot(B_m, (A - C))) * (fma(B_m, B_m, (A * (C * -4.0))) * (2.0 * F)))) / (A * (C * -(-4.0)));
} else {
tmp = (sqrt(2.0) / B_m) * (sqrt((A + hypot(B_m, A))) * -sqrt(F));
}
return tmp;
}
B_m = abs(B) function code(A, B_m, C, F) tmp = 0.0 if (B_m <= 3e-136) tmp = Float64(sqrt(Float64(Float64(Float64(A + C) + hypot(B_m, Float64(A - C))) * Float64(fma(B_m, B_m, Float64(A * Float64(C * -4.0))) * Float64(2.0 * F)))) / Float64(A * Float64(C * Float64(-(-4.0))))); else tmp = Float64(Float64(sqrt(2.0) / B_m) * Float64(sqrt(Float64(A + hypot(B_m, A))) * Float64(-sqrt(F)))); end return tmp end
B_m = N[Abs[B], $MachinePrecision] code[A_, B$95$m_, C_, F_] := If[LessEqual[B$95$m, 3e-136], N[(N[Sqrt[N[(N[(N[(A + C), $MachinePrecision] + N[Sqrt[B$95$m ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision] * N[(N[(B$95$m * B$95$m + N[(A * N[(C * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(2.0 * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(A * N[(C * (--4.0)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[2.0], $MachinePrecision] / B$95$m), $MachinePrecision] * N[(N[Sqrt[N[(A + N[Sqrt[B$95$m ^ 2 + A ^ 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-N[Sqrt[F], $MachinePrecision])), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
B_m = \left|B\right|
\\
\begin{array}{l}
\mathbf{if}\;B\_m \leq 3 \cdot 10^{-136}:\\
\;\;\;\;\frac{\sqrt{\left(\left(A + C\right) + \mathsf{hypot}\left(B\_m, A - C\right)\right) \cdot \left(\mathsf{fma}\left(B\_m, B\_m, A \cdot \left(C \cdot -4\right)\right) \cdot \left(2 \cdot F\right)\right)}}{A \cdot \left(C \cdot \left(--4\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{2}}{B\_m} \cdot \left(\sqrt{A + \mathsf{hypot}\left(B\_m, A\right)} \cdot \left(-\sqrt{F}\right)\right)\\
\end{array}
\end{array}
if B < 2.9999999999999998e-136Initial program 22.6%
Simplified29.2%
Taylor expanded in B around 0 18.8%
*-commutative18.8%
associate-*r*18.8%
Simplified18.8%
if 2.9999999999999998e-136 < B Initial program 18.6%
Taylor expanded in C around 0 24.3%
mul-1-neg24.3%
distribute-rgt-neg-in24.3%
+-commutative24.3%
unpow224.3%
unpow224.3%
hypot-define45.1%
Simplified45.1%
pow1/245.1%
*-commutative45.1%
unpow-prod-down61.7%
pow1/261.7%
pow1/261.7%
Applied egg-rr61.7%
Final simplification36.2%
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)))
(* (fma B_m B_m (* A (* C -4.0))) (* 2.0 F))))
(* A (* C (- -4.0))))
(if (<= F 15500.0)
(* (sqrt (* F (+ A (hypot B_m A)))) (/ -1.0 (/ B_m (sqrt 2.0))))
(* (sqrt 2.0) (/ (sqrt F) (- (sqrt B_m)))))))B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
double tmp;
if (F <= -4.3e-296) {
tmp = sqrt((((A + C) + hypot(B_m, (A - C))) * (fma(B_m, B_m, (A * (C * -4.0))) * (2.0 * F)))) / (A * (C * -(-4.0)));
} else if (F <= 15500.0) {
tmp = sqrt((F * (A + hypot(B_m, A)))) * (-1.0 / (B_m / sqrt(2.0)));
} else {
tmp = sqrt(2.0) * (sqrt(F) / -sqrt(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(fma(B_m, B_m, Float64(A * Float64(C * -4.0))) * Float64(2.0 * F)))) / Float64(A * Float64(C * Float64(-(-4.0))))); elseif (F <= 15500.0) tmp = Float64(sqrt(Float64(F * Float64(A + hypot(B_m, A)))) * Float64(-1.0 / Float64(B_m / sqrt(2.0)))); else tmp = Float64(sqrt(2.0) * Float64(sqrt(F) / Float64(-sqrt(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[(B$95$m * B$95$m + N[(A * N[(C * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(2.0 * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(A * N[(C * (--4.0)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 15500.0], N[(N[Sqrt[N[(F * N[(A + N[Sqrt[B$95$m ^ 2 + A ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(-1.0 / N[(B$95$m / N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[2.0], $MachinePrecision] * N[(N[Sqrt[F], $MachinePrecision] / (-N[Sqrt[B$95$m], $MachinePrecision])), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
B_m = \left|B\right|
\\
\begin{array}{l}
\mathbf{if}\;F \leq -4.3 \cdot 10^{-296}:\\
\;\;\;\;\frac{\sqrt{\left(\left(A + C\right) + \mathsf{hypot}\left(B\_m, A - C\right)\right) \cdot \left(\mathsf{fma}\left(B\_m, B\_m, A \cdot \left(C \cdot -4\right)\right) \cdot \left(2 \cdot F\right)\right)}}{A \cdot \left(C \cdot \left(--4\right)\right)}\\
\mathbf{elif}\;F \leq 15500:\\
\;\;\;\;\sqrt{F \cdot \left(A + \mathsf{hypot}\left(B\_m, A\right)\right)} \cdot \frac{-1}{\frac{B\_m}{\sqrt{2}}}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{2} \cdot \frac{\sqrt{F}}{-\sqrt{B\_m}}\\
\end{array}
\end{array}
if F < -4.29999999999999978e-296Initial program 21.3%
Simplified42.6%
Taylor expanded in B around 0 42.6%
*-commutative42.6%
associate-*r*42.6%
Simplified42.6%
if -4.29999999999999978e-296 < F < 15500Initial program 20.4%
Taylor expanded in C around 0 12.2%
mul-1-neg12.2%
distribute-rgt-neg-in12.2%
+-commutative12.2%
unpow212.2%
unpow212.2%
hypot-define28.5%
Simplified28.5%
clear-num28.5%
inv-pow28.5%
Applied egg-rr28.5%
unpow-128.5%
Simplified28.5%
if 15500 < F Initial program 21.4%
Taylor expanded in C around 0 13.3%
mul-1-neg13.3%
distribute-rgt-neg-in13.3%
+-commutative13.3%
unpow213.3%
unpow213.3%
hypot-define17.9%
Simplified17.9%
Taylor expanded in A around 0 30.6%
mul-1-neg30.6%
Simplified30.6%
sqrt-div32.1%
Applied egg-rr32.1%
Final simplification32.0%
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))) (* -8.0 (* A (* C F)))))
(- (fma B_m B_m (* A (* C -4.0)))))
(if (<= F 550000.0)
(* (sqrt (* F (+ A (hypot B_m A)))) (/ -1.0 (/ B_m (sqrt 2.0))))
(* (sqrt 2.0) (/ (sqrt F) (- (sqrt B_m)))))))B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
double tmp;
if (F <= -4.3e-296) {
tmp = sqrt((((A + C) + hypot(B_m, (A - C))) * (-8.0 * (A * (C * F))))) / -fma(B_m, B_m, (A * (C * -4.0)));
} else if (F <= 550000.0) {
tmp = sqrt((F * (A + hypot(B_m, A)))) * (-1.0 / (B_m / sqrt(2.0)));
} else {
tmp = sqrt(2.0) * (sqrt(F) / -sqrt(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(-8.0 * Float64(A * Float64(C * F))))) / Float64(-fma(B_m, B_m, Float64(A * Float64(C * -4.0))))); elseif (F <= 550000.0) tmp = Float64(sqrt(Float64(F * Float64(A + hypot(B_m, A)))) * Float64(-1.0 / Float64(B_m / sqrt(2.0)))); else tmp = Float64(sqrt(2.0) * Float64(sqrt(F) / Float64(-sqrt(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[(-8.0 * N[(A * N[(C * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / (-N[(B$95$m * B$95$m + N[(A * N[(C * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision])), $MachinePrecision], If[LessEqual[F, 550000.0], N[(N[Sqrt[N[(F * N[(A + N[Sqrt[B$95$m ^ 2 + A ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(-1.0 / N[(B$95$m / N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[2.0], $MachinePrecision] * N[(N[Sqrt[F], $MachinePrecision] / (-N[Sqrt[B$95$m], $MachinePrecision])), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
B_m = \left|B\right|
\\
\begin{array}{l}
\mathbf{if}\;F \leq -4.3 \cdot 10^{-296}:\\
\;\;\;\;\frac{\sqrt{\left(\left(A + C\right) + \mathsf{hypot}\left(B\_m, A - C\right)\right) \cdot \left(-8 \cdot \left(A \cdot \left(C \cdot F\right)\right)\right)}}{-\mathsf{fma}\left(B\_m, B\_m, A \cdot \left(C \cdot -4\right)\right)}\\
\mathbf{elif}\;F \leq 550000:\\
\;\;\;\;\sqrt{F \cdot \left(A + \mathsf{hypot}\left(B\_m, A\right)\right)} \cdot \frac{-1}{\frac{B\_m}{\sqrt{2}}}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{2} \cdot \frac{\sqrt{F}}{-\sqrt{B\_m}}\\
\end{array}
\end{array}
if F < -4.29999999999999978e-296Initial program 21.3%
Simplified42.6%
Taylor expanded in B around 0 34.9%
if -4.29999999999999978e-296 < F < 5.5e5Initial program 20.4%
Taylor expanded in C around 0 12.2%
mul-1-neg12.2%
distribute-rgt-neg-in12.2%
+-commutative12.2%
unpow212.2%
unpow212.2%
hypot-define28.5%
Simplified28.5%
clear-num28.5%
inv-pow28.5%
Applied egg-rr28.5%
unpow-128.5%
Simplified28.5%
if 5.5e5 < F Initial program 21.4%
Taylor expanded in C around 0 13.3%
mul-1-neg13.3%
distribute-rgt-neg-in13.3%
+-commutative13.3%
unpow213.3%
unpow213.3%
hypot-define17.9%
Simplified17.9%
Taylor expanded in A around 0 30.6%
mul-1-neg30.6%
Simplified30.6%
sqrt-div32.1%
Applied egg-rr32.1%
Final simplification30.9%
B_m = (fabs.f64 B)
(FPCore (A B_m C F)
:precision binary64
(if (<= F -4.3e-296)
(/
(sqrt (* (* A -8.0) (* C (* F (+ A (* 2.0 C))))))
(- (* (* 4.0 A) C) (pow B_m 2.0)))
(if (<= F 16000.0)
(* (sqrt (* F (+ A (hypot B_m A)))) (/ -1.0 (/ B_m (sqrt 2.0))))
(* (sqrt 2.0) (/ (sqrt F) (- (sqrt B_m)))))))B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
double tmp;
if (F <= -4.3e-296) {
tmp = sqrt(((A * -8.0) * (C * (F * (A + (2.0 * C)))))) / (((4.0 * A) * C) - pow(B_m, 2.0));
} else if (F <= 16000.0) {
tmp = sqrt((F * (A + hypot(B_m, A)))) * (-1.0 / (B_m / sqrt(2.0)));
} else {
tmp = sqrt(2.0) * (sqrt(F) / -sqrt(B_m));
}
return tmp;
}
B_m = Math.abs(B);
public static double code(double A, double B_m, double C, double F) {
double tmp;
if (F <= -4.3e-296) {
tmp = Math.sqrt(((A * -8.0) * (C * (F * (A + (2.0 * C)))))) / (((4.0 * A) * C) - Math.pow(B_m, 2.0));
} else if (F <= 16000.0) {
tmp = Math.sqrt((F * (A + Math.hypot(B_m, A)))) * (-1.0 / (B_m / Math.sqrt(2.0)));
} else {
tmp = Math.sqrt(2.0) * (Math.sqrt(F) / -Math.sqrt(B_m));
}
return tmp;
}
B_m = math.fabs(B) def code(A, B_m, C, F): tmp = 0 if F <= -4.3e-296: tmp = math.sqrt(((A * -8.0) * (C * (F * (A + (2.0 * C)))))) / (((4.0 * A) * C) - math.pow(B_m, 2.0)) elif F <= 16000.0: tmp = math.sqrt((F * (A + math.hypot(B_m, A)))) * (-1.0 / (B_m / math.sqrt(2.0))) else: tmp = math.sqrt(2.0) * (math.sqrt(F) / -math.sqrt(B_m)) return tmp
B_m = abs(B) function code(A, B_m, C, F) tmp = 0.0 if (F <= -4.3e-296) tmp = Float64(sqrt(Float64(Float64(A * -8.0) * Float64(C * Float64(F * Float64(A + Float64(2.0 * C)))))) / Float64(Float64(Float64(4.0 * A) * C) - (B_m ^ 2.0))); elseif (F <= 16000.0) tmp = Float64(sqrt(Float64(F * Float64(A + hypot(B_m, A)))) * Float64(-1.0 / Float64(B_m / sqrt(2.0)))); else tmp = Float64(sqrt(2.0) * Float64(sqrt(F) / Float64(-sqrt(B_m)))); end return tmp end
B_m = abs(B); function tmp_2 = code(A, B_m, C, F) tmp = 0.0; if (F <= -4.3e-296) tmp = sqrt(((A * -8.0) * (C * (F * (A + (2.0 * C)))))) / (((4.0 * A) * C) - (B_m ^ 2.0)); elseif (F <= 16000.0) tmp = sqrt((F * (A + hypot(B_m, A)))) * (-1.0 / (B_m / sqrt(2.0))); else tmp = sqrt(2.0) * (sqrt(F) / -sqrt(B_m)); end tmp_2 = tmp; end
B_m = N[Abs[B], $MachinePrecision] code[A_, B$95$m_, C_, F_] := If[LessEqual[F, -4.3e-296], N[(N[Sqrt[N[(N[(A * -8.0), $MachinePrecision] * N[(C * N[(F * N[(A + N[(2.0 * C), $MachinePrecision]), $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, 16000.0], N[(N[Sqrt[N[(F * N[(A + N[Sqrt[B$95$m ^ 2 + A ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(-1.0 / N[(B$95$m / N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[2.0], $MachinePrecision] * N[(N[Sqrt[F], $MachinePrecision] / (-N[Sqrt[B$95$m], $MachinePrecision])), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
B_m = \left|B\right|
\\
\begin{array}{l}
\mathbf{if}\;F \leq -4.3 \cdot 10^{-296}:\\
\;\;\;\;\frac{\sqrt{\left(A \cdot -8\right) \cdot \left(C \cdot \left(F \cdot \left(A + 2 \cdot C\right)\right)\right)}}{\left(4 \cdot A\right) \cdot C - {B\_m}^{2}}\\
\mathbf{elif}\;F \leq 16000:\\
\;\;\;\;\sqrt{F \cdot \left(A + \mathsf{hypot}\left(B\_m, A\right)\right)} \cdot \frac{-1}{\frac{B\_m}{\sqrt{2}}}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{2} \cdot \frac{\sqrt{F}}{-\sqrt{B\_m}}\\
\end{array}
\end{array}
if F < -4.29999999999999978e-296Initial program 21.3%
Taylor expanded in C around inf 25.2%
Taylor expanded in B around 0 27.5%
associate-*r*27.5%
Simplified27.5%
if -4.29999999999999978e-296 < F < 16000Initial program 20.4%
Taylor expanded in C around 0 12.2%
mul-1-neg12.2%
distribute-rgt-neg-in12.2%
+-commutative12.2%
unpow212.2%
unpow212.2%
hypot-define28.5%
Simplified28.5%
clear-num28.5%
inv-pow28.5%
Applied egg-rr28.5%
unpow-128.5%
Simplified28.5%
if 16000 < F Initial program 21.4%
Taylor expanded in C around 0 13.3%
mul-1-neg13.3%
distribute-rgt-neg-in13.3%
+-commutative13.3%
unpow213.3%
unpow213.3%
hypot-define17.9%
Simplified17.9%
Taylor expanded in A around 0 30.6%
mul-1-neg30.6%
Simplified30.6%
sqrt-div32.1%
Applied egg-rr32.1%
Final simplification29.9%
B_m = (fabs.f64 B)
(FPCore (A B_m C F)
:precision binary64
(if (<= F -4.3e-296)
(/
(sqrt (* (* A -8.0) (* C (* F (+ A (* 2.0 C))))))
(- (* (* 4.0 A) C) (pow B_m 2.0)))
(if (<= F 9200.0)
(* (sqrt 2.0) (/ (sqrt (* F (+ A (hypot B_m A)))) (- B_m)))
(* (sqrt 2.0) (/ (sqrt F) (- (sqrt B_m)))))))B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
double tmp;
if (F <= -4.3e-296) {
tmp = sqrt(((A * -8.0) * (C * (F * (A + (2.0 * C)))))) / (((4.0 * A) * C) - pow(B_m, 2.0));
} else if (F <= 9200.0) {
tmp = sqrt(2.0) * (sqrt((F * (A + hypot(B_m, A)))) / -B_m);
} else {
tmp = sqrt(2.0) * (sqrt(F) / -sqrt(B_m));
}
return tmp;
}
B_m = Math.abs(B);
public static double code(double A, double B_m, double C, double F) {
double tmp;
if (F <= -4.3e-296) {
tmp = Math.sqrt(((A * -8.0) * (C * (F * (A + (2.0 * C)))))) / (((4.0 * A) * C) - Math.pow(B_m, 2.0));
} else if (F <= 9200.0) {
tmp = Math.sqrt(2.0) * (Math.sqrt((F * (A + Math.hypot(B_m, A)))) / -B_m);
} else {
tmp = Math.sqrt(2.0) * (Math.sqrt(F) / -Math.sqrt(B_m));
}
return tmp;
}
B_m = math.fabs(B) def code(A, B_m, C, F): tmp = 0 if F <= -4.3e-296: tmp = math.sqrt(((A * -8.0) * (C * (F * (A + (2.0 * C)))))) / (((4.0 * A) * C) - math.pow(B_m, 2.0)) elif F <= 9200.0: tmp = math.sqrt(2.0) * (math.sqrt((F * (A + math.hypot(B_m, A)))) / -B_m) else: tmp = math.sqrt(2.0) * (math.sqrt(F) / -math.sqrt(B_m)) return tmp
B_m = abs(B) function code(A, B_m, C, F) tmp = 0.0 if (F <= -4.3e-296) tmp = Float64(sqrt(Float64(Float64(A * -8.0) * Float64(C * Float64(F * Float64(A + Float64(2.0 * C)))))) / Float64(Float64(Float64(4.0 * A) * C) - (B_m ^ 2.0))); elseif (F <= 9200.0) tmp = Float64(sqrt(2.0) * Float64(sqrt(Float64(F * Float64(A + hypot(B_m, A)))) / Float64(-B_m))); else tmp = Float64(sqrt(2.0) * Float64(sqrt(F) / Float64(-sqrt(B_m)))); end return tmp end
B_m = abs(B); function tmp_2 = code(A, B_m, C, F) tmp = 0.0; if (F <= -4.3e-296) tmp = sqrt(((A * -8.0) * (C * (F * (A + (2.0 * C)))))) / (((4.0 * A) * C) - (B_m ^ 2.0)); elseif (F <= 9200.0) tmp = sqrt(2.0) * (sqrt((F * (A + hypot(B_m, A)))) / -B_m); else tmp = sqrt(2.0) * (sqrt(F) / -sqrt(B_m)); end tmp_2 = tmp; end
B_m = N[Abs[B], $MachinePrecision] code[A_, B$95$m_, C_, F_] := If[LessEqual[F, -4.3e-296], N[(N[Sqrt[N[(N[(A * -8.0), $MachinePrecision] * N[(C * N[(F * N[(A + N[(2.0 * C), $MachinePrecision]), $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, 9200.0], N[(N[Sqrt[2.0], $MachinePrecision] * N[(N[Sqrt[N[(F * N[(A + N[Sqrt[B$95$m ^ 2 + A ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / (-B$95$m)), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[2.0], $MachinePrecision] * N[(N[Sqrt[F], $MachinePrecision] / (-N[Sqrt[B$95$m], $MachinePrecision])), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
B_m = \left|B\right|
\\
\begin{array}{l}
\mathbf{if}\;F \leq -4.3 \cdot 10^{-296}:\\
\;\;\;\;\frac{\sqrt{\left(A \cdot -8\right) \cdot \left(C \cdot \left(F \cdot \left(A + 2 \cdot C\right)\right)\right)}}{\left(4 \cdot A\right) \cdot C - {B\_m}^{2}}\\
\mathbf{elif}\;F \leq 9200:\\
\;\;\;\;\sqrt{2} \cdot \frac{\sqrt{F \cdot \left(A + \mathsf{hypot}\left(B\_m, A\right)\right)}}{-B\_m}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{2} \cdot \frac{\sqrt{F}}{-\sqrt{B\_m}}\\
\end{array}
\end{array}
if F < -4.29999999999999978e-296Initial program 21.3%
Taylor expanded in C around inf 25.2%
Taylor expanded in B around 0 27.5%
associate-*r*27.5%
Simplified27.5%
if -4.29999999999999978e-296 < F < 9200Initial program 20.4%
Simplified17.7%
pow1/217.7%
associate-*r*28.0%
unpow-prod-down35.9%
+-commutative35.9%
hypot-undefine24.5%
unpow224.5%
unpow224.5%
+-commutative24.5%
unpow224.5%
unpow224.5%
hypot-define35.9%
pow1/235.9%
Applied egg-rr35.9%
unpow1/235.9%
+-commutative35.9%
hypot-undefine24.5%
unpow224.5%
unpow224.5%
+-commutative24.5%
associate-+r+24.6%
unpow224.6%
unpow224.6%
hypot-undefine36.5%
Simplified36.5%
Taylor expanded in C around 0 12.2%
+-commutative12.2%
unpow212.2%
unpow212.2%
hypot-undefine28.5%
neg-mul-128.5%
distribute-rgt-neg-in28.5%
associate-*l/28.5%
associate-/l*28.4%
Simplified28.4%
if 9200 < F Initial program 21.4%
Taylor expanded in C around 0 13.3%
mul-1-neg13.3%
distribute-rgt-neg-in13.3%
+-commutative13.3%
unpow213.3%
unpow213.3%
hypot-define17.9%
Simplified17.9%
Taylor expanded in A around 0 30.6%
mul-1-neg30.6%
Simplified30.6%
sqrt-div32.1%
Applied egg-rr32.1%
Final simplification29.9%
B_m = (fabs.f64 B)
(FPCore (A B_m C F)
:precision binary64
(if (<= F -4.3e-296)
(/
(sqrt (* (* A -8.0) (* C (* F (+ A (* 2.0 C))))))
(- (* (* 4.0 A) C) (pow B_m 2.0)))
(if (<= F 165000.0)
(* (sqrt (* F (+ A (hypot B_m A)))) (/ (sqrt 2.0) (- B_m)))
(* (sqrt 2.0) (/ (sqrt F) (- (sqrt B_m)))))))B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
double tmp;
if (F <= -4.3e-296) {
tmp = sqrt(((A * -8.0) * (C * (F * (A + (2.0 * C)))))) / (((4.0 * A) * C) - pow(B_m, 2.0));
} else if (F <= 165000.0) {
tmp = sqrt((F * (A + hypot(B_m, A)))) * (sqrt(2.0) / -B_m);
} else {
tmp = sqrt(2.0) * (sqrt(F) / -sqrt(B_m));
}
return tmp;
}
B_m = Math.abs(B);
public static double code(double A, double B_m, double C, double F) {
double tmp;
if (F <= -4.3e-296) {
tmp = Math.sqrt(((A * -8.0) * (C * (F * (A + (2.0 * C)))))) / (((4.0 * A) * C) - Math.pow(B_m, 2.0));
} else if (F <= 165000.0) {
tmp = Math.sqrt((F * (A + Math.hypot(B_m, A)))) * (Math.sqrt(2.0) / -B_m);
} else {
tmp = Math.sqrt(2.0) * (Math.sqrt(F) / -Math.sqrt(B_m));
}
return tmp;
}
B_m = math.fabs(B) def code(A, B_m, C, F): tmp = 0 if F <= -4.3e-296: tmp = math.sqrt(((A * -8.0) * (C * (F * (A + (2.0 * C)))))) / (((4.0 * A) * C) - math.pow(B_m, 2.0)) elif F <= 165000.0: tmp = math.sqrt((F * (A + math.hypot(B_m, A)))) * (math.sqrt(2.0) / -B_m) else: tmp = math.sqrt(2.0) * (math.sqrt(F) / -math.sqrt(B_m)) return tmp
B_m = abs(B) function code(A, B_m, C, F) tmp = 0.0 if (F <= -4.3e-296) tmp = Float64(sqrt(Float64(Float64(A * -8.0) * Float64(C * Float64(F * Float64(A + Float64(2.0 * C)))))) / Float64(Float64(Float64(4.0 * A) * C) - (B_m ^ 2.0))); elseif (F <= 165000.0) tmp = Float64(sqrt(Float64(F * Float64(A + hypot(B_m, A)))) * Float64(sqrt(2.0) / Float64(-B_m))); else tmp = Float64(sqrt(2.0) * Float64(sqrt(F) / Float64(-sqrt(B_m)))); end return tmp end
B_m = abs(B); function tmp_2 = code(A, B_m, C, F) tmp = 0.0; if (F <= -4.3e-296) tmp = sqrt(((A * -8.0) * (C * (F * (A + (2.0 * C)))))) / (((4.0 * A) * C) - (B_m ^ 2.0)); elseif (F <= 165000.0) tmp = sqrt((F * (A + hypot(B_m, A)))) * (sqrt(2.0) / -B_m); else tmp = sqrt(2.0) * (sqrt(F) / -sqrt(B_m)); end tmp_2 = tmp; end
B_m = N[Abs[B], $MachinePrecision] code[A_, B$95$m_, C_, F_] := If[LessEqual[F, -4.3e-296], N[(N[Sqrt[N[(N[(A * -8.0), $MachinePrecision] * N[(C * N[(F * N[(A + N[(2.0 * C), $MachinePrecision]), $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, 165000.0], N[(N[Sqrt[N[(F * 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], N[(N[Sqrt[2.0], $MachinePrecision] * N[(N[Sqrt[F], $MachinePrecision] / (-N[Sqrt[B$95$m], $MachinePrecision])), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
B_m = \left|B\right|
\\
\begin{array}{l}
\mathbf{if}\;F \leq -4.3 \cdot 10^{-296}:\\
\;\;\;\;\frac{\sqrt{\left(A \cdot -8\right) \cdot \left(C \cdot \left(F \cdot \left(A + 2 \cdot C\right)\right)\right)}}{\left(4 \cdot A\right) \cdot C - {B\_m}^{2}}\\
\mathbf{elif}\;F \leq 165000:\\
\;\;\;\;\sqrt{F \cdot \left(A + \mathsf{hypot}\left(B\_m, A\right)\right)} \cdot \frac{\sqrt{2}}{-B\_m}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{2} \cdot \frac{\sqrt{F}}{-\sqrt{B\_m}}\\
\end{array}
\end{array}
if F < -4.29999999999999978e-296Initial program 21.3%
Taylor expanded in C around inf 25.2%
Taylor expanded in B around 0 27.5%
associate-*r*27.5%
Simplified27.5%
if -4.29999999999999978e-296 < F < 165000Initial program 20.4%
Taylor expanded in C around 0 12.2%
mul-1-neg12.2%
distribute-rgt-neg-in12.2%
+-commutative12.2%
unpow212.2%
unpow212.2%
hypot-define28.5%
Simplified28.5%
if 165000 < F Initial program 21.4%
Taylor expanded in C around 0 13.3%
mul-1-neg13.3%
distribute-rgt-neg-in13.3%
+-commutative13.3%
unpow213.3%
unpow213.3%
hypot-define17.9%
Simplified17.9%
Taylor expanded in A around 0 30.6%
mul-1-neg30.6%
Simplified30.6%
sqrt-div32.1%
Applied egg-rr32.1%
Final simplification29.9%
B_m = (fabs.f64 B)
(FPCore (A B_m C F)
:precision binary64
(if (<= F -4.3e-296)
(/
(sqrt (* (* A -8.0) (* C (* F (+ A (* 2.0 C))))))
(- (* (* 4.0 A) C) (pow B_m 2.0)))
(* (sqrt 2.0) (/ (sqrt F) (- (sqrt B_m))))))B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
double tmp;
if (F <= -4.3e-296) {
tmp = sqrt(((A * -8.0) * (C * (F * (A + (2.0 * C)))))) / (((4.0 * A) * C) - pow(B_m, 2.0));
} else {
tmp = sqrt(2.0) * (sqrt(F) / -sqrt(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 <= (-4.3d-296)) then
tmp = sqrt(((a * (-8.0d0)) * (c * (f * (a + (2.0d0 * c)))))) / (((4.0d0 * a) * c) - (b_m ** 2.0d0))
else
tmp = sqrt(2.0d0) * (sqrt(f) / -sqrt(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 <= -4.3e-296) {
tmp = Math.sqrt(((A * -8.0) * (C * (F * (A + (2.0 * C)))))) / (((4.0 * A) * C) - Math.pow(B_m, 2.0));
} else {
tmp = Math.sqrt(2.0) * (Math.sqrt(F) / -Math.sqrt(B_m));
}
return tmp;
}
B_m = math.fabs(B) def code(A, B_m, C, F): tmp = 0 if F <= -4.3e-296: tmp = math.sqrt(((A * -8.0) * (C * (F * (A + (2.0 * C)))))) / (((4.0 * A) * C) - math.pow(B_m, 2.0)) else: tmp = math.sqrt(2.0) * (math.sqrt(F) / -math.sqrt(B_m)) return tmp
B_m = abs(B) function code(A, B_m, C, F) tmp = 0.0 if (F <= -4.3e-296) tmp = Float64(sqrt(Float64(Float64(A * -8.0) * Float64(C * Float64(F * Float64(A + Float64(2.0 * C)))))) / Float64(Float64(Float64(4.0 * A) * C) - (B_m ^ 2.0))); else tmp = Float64(sqrt(2.0) * Float64(sqrt(F) / Float64(-sqrt(B_m)))); end return tmp end
B_m = abs(B); function tmp_2 = code(A, B_m, C, F) tmp = 0.0; if (F <= -4.3e-296) tmp = sqrt(((A * -8.0) * (C * (F * (A + (2.0 * C)))))) / (((4.0 * A) * C) - (B_m ^ 2.0)); else tmp = sqrt(2.0) * (sqrt(F) / -sqrt(B_m)); end tmp_2 = tmp; end
B_m = N[Abs[B], $MachinePrecision] code[A_, B$95$m_, C_, F_] := If[LessEqual[F, -4.3e-296], N[(N[Sqrt[N[(N[(A * -8.0), $MachinePrecision] * N[(C * N[(F * N[(A + N[(2.0 * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(N[(N[(4.0 * A), $MachinePrecision] * C), $MachinePrecision] - N[Power[B$95$m, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[2.0], $MachinePrecision] * N[(N[Sqrt[F], $MachinePrecision] / (-N[Sqrt[B$95$m], $MachinePrecision])), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
B_m = \left|B\right|
\\
\begin{array}{l}
\mathbf{if}\;F \leq -4.3 \cdot 10^{-296}:\\
\;\;\;\;\frac{\sqrt{\left(A \cdot -8\right) \cdot \left(C \cdot \left(F \cdot \left(A + 2 \cdot C\right)\right)\right)}}{\left(4 \cdot A\right) \cdot C - {B\_m}^{2}}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{2} \cdot \frac{\sqrt{F}}{-\sqrt{B\_m}}\\
\end{array}
\end{array}
if F < -4.29999999999999978e-296Initial program 21.3%
Taylor expanded in C around inf 25.2%
Taylor expanded in B around 0 27.5%
associate-*r*27.5%
Simplified27.5%
if -4.29999999999999978e-296 < F Initial program 20.9%
Taylor expanded in C around 0 12.7%
mul-1-neg12.7%
distribute-rgt-neg-in12.7%
+-commutative12.7%
unpow212.7%
unpow212.7%
hypot-define23.3%
Simplified23.3%
Taylor expanded in A around 0 20.1%
mul-1-neg20.1%
Simplified20.1%
sqrt-div26.0%
Applied egg-rr26.0%
Final simplification26.2%
B_m = (fabs.f64 B)
(FPCore (A B_m C F)
:precision binary64
(if (<= F -4.3e-296)
(/
(sqrt (* (* A -8.0) (* C (* F (+ A (* 2.0 C))))))
(- (* (* 4.0 A) C) (pow B_m 2.0)))
(if (<= F 1.8e+37)
(* (/ (sqrt 2.0) B_m) (- (sqrt (* B_m F))))
(- (sqrt (* 2.0 (/ F B_m)))))))B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
double tmp;
if (F <= -4.3e-296) {
tmp = sqrt(((A * -8.0) * (C * (F * (A + (2.0 * C)))))) / (((4.0 * A) * C) - pow(B_m, 2.0));
} else if (F <= 1.8e+37) {
tmp = (sqrt(2.0) / B_m) * -sqrt((B_m * F));
} else {
tmp = -sqrt((2.0 * (F / B_m)));
}
return tmp;
}
B_m = abs(B)
real(8) function code(a, b_m, c, f)
real(8), intent (in) :: a
real(8), intent (in) :: b_m
real(8), intent (in) :: c
real(8), intent (in) :: f
real(8) :: tmp
if (f <= (-4.3d-296)) then
tmp = sqrt(((a * (-8.0d0)) * (c * (f * (a + (2.0d0 * c)))))) / (((4.0d0 * a) * c) - (b_m ** 2.0d0))
else if (f <= 1.8d+37) then
tmp = (sqrt(2.0d0) / b_m) * -sqrt((b_m * f))
else
tmp = -sqrt((2.0d0 * (f / b_m)))
end if
code = tmp
end function
B_m = Math.abs(B);
public static double code(double A, double B_m, double C, double F) {
double tmp;
if (F <= -4.3e-296) {
tmp = Math.sqrt(((A * -8.0) * (C * (F * (A + (2.0 * C)))))) / (((4.0 * A) * C) - Math.pow(B_m, 2.0));
} else if (F <= 1.8e+37) {
tmp = (Math.sqrt(2.0) / B_m) * -Math.sqrt((B_m * F));
} else {
tmp = -Math.sqrt((2.0 * (F / B_m)));
}
return tmp;
}
B_m = math.fabs(B) def code(A, B_m, C, F): tmp = 0 if F <= -4.3e-296: tmp = math.sqrt(((A * -8.0) * (C * (F * (A + (2.0 * C)))))) / (((4.0 * A) * C) - math.pow(B_m, 2.0)) elif F <= 1.8e+37: tmp = (math.sqrt(2.0) / B_m) * -math.sqrt((B_m * F)) else: tmp = -math.sqrt((2.0 * (F / B_m))) return tmp
B_m = abs(B) function code(A, B_m, C, F) tmp = 0.0 if (F <= -4.3e-296) tmp = Float64(sqrt(Float64(Float64(A * -8.0) * Float64(C * Float64(F * Float64(A + Float64(2.0 * C)))))) / Float64(Float64(Float64(4.0 * A) * C) - (B_m ^ 2.0))); elseif (F <= 1.8e+37) tmp = Float64(Float64(sqrt(2.0) / B_m) * Float64(-sqrt(Float64(B_m * F)))); else tmp = Float64(-sqrt(Float64(2.0 * Float64(F / B_m)))); end return tmp end
B_m = abs(B); function tmp_2 = code(A, B_m, C, F) tmp = 0.0; if (F <= -4.3e-296) tmp = sqrt(((A * -8.0) * (C * (F * (A + (2.0 * C)))))) / (((4.0 * A) * C) - (B_m ^ 2.0)); elseif (F <= 1.8e+37) tmp = (sqrt(2.0) / B_m) * -sqrt((B_m * F)); else tmp = -sqrt((2.0 * (F / B_m))); end tmp_2 = tmp; end
B_m = N[Abs[B], $MachinePrecision] code[A_, B$95$m_, C_, F_] := If[LessEqual[F, -4.3e-296], N[(N[Sqrt[N[(N[(A * -8.0), $MachinePrecision] * N[(C * N[(F * N[(A + N[(2.0 * C), $MachinePrecision]), $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, 1.8e+37], N[(N[(N[Sqrt[2.0], $MachinePrecision] / B$95$m), $MachinePrecision] * (-N[Sqrt[N[(B$95$m * F), $MachinePrecision]], $MachinePrecision])), $MachinePrecision], (-N[Sqrt[N[(2.0 * N[(F / B$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])]]
\begin{array}{l}
B_m = \left|B\right|
\\
\begin{array}{l}
\mathbf{if}\;F \leq -4.3 \cdot 10^{-296}:\\
\;\;\;\;\frac{\sqrt{\left(A \cdot -8\right) \cdot \left(C \cdot \left(F \cdot \left(A + 2 \cdot C\right)\right)\right)}}{\left(4 \cdot A\right) \cdot C - {B\_m}^{2}}\\
\mathbf{elif}\;F \leq 1.8 \cdot 10^{+37}:\\
\;\;\;\;\frac{\sqrt{2}}{B\_m} \cdot \left(-\sqrt{B\_m \cdot F}\right)\\
\mathbf{else}:\\
\;\;\;\;-\sqrt{2 \cdot \frac{F}{B\_m}}\\
\end{array}
\end{array}
if F < -4.29999999999999978e-296Initial program 21.3%
Taylor expanded in C around inf 25.2%
Taylor expanded in B around 0 27.5%
associate-*r*27.5%
Simplified27.5%
if -4.29999999999999978e-296 < F < 1.79999999999999999e37Initial program 20.4%
Taylor expanded in C around 0 12.2%
mul-1-neg12.2%
distribute-rgt-neg-in12.2%
+-commutative12.2%
unpow212.2%
unpow212.2%
hypot-define28.3%
Simplified28.3%
Taylor expanded in A around 0 20.2%
if 1.79999999999999999e37 < F Initial program 21.4%
Taylor expanded in C around 0 13.3%
mul-1-neg13.3%
distribute-rgt-neg-in13.3%
+-commutative13.3%
unpow213.3%
unpow213.3%
hypot-define17.2%
Simplified17.2%
Taylor expanded in A around 0 31.0%
mul-1-neg31.0%
Simplified31.0%
sqrt-unprod31.3%
Applied egg-rr31.3%
Final simplification25.5%
B_m = (fabs.f64 B) (FPCore (A B_m C F) :precision binary64 (if (<= F 1.75e+37) (* (/ (sqrt 2.0) B_m) (- (sqrt (* B_m F)))) (- (sqrt (* 2.0 (/ F B_m))))))
B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
double tmp;
if (F <= 1.75e+37) {
tmp = (sqrt(2.0) / B_m) * -sqrt((B_m * F));
} else {
tmp = -sqrt((2.0 * (F / B_m)));
}
return tmp;
}
B_m = abs(B)
real(8) function code(a, b_m, c, f)
real(8), intent (in) :: a
real(8), intent (in) :: b_m
real(8), intent (in) :: c
real(8), intent (in) :: f
real(8) :: tmp
if (f <= 1.75d+37) then
tmp = (sqrt(2.0d0) / b_m) * -sqrt((b_m * f))
else
tmp = -sqrt((2.0d0 * (f / b_m)))
end if
code = tmp
end function
B_m = Math.abs(B);
public static double code(double A, double B_m, double C, double F) {
double tmp;
if (F <= 1.75e+37) {
tmp = (Math.sqrt(2.0) / B_m) * -Math.sqrt((B_m * F));
} else {
tmp = -Math.sqrt((2.0 * (F / B_m)));
}
return tmp;
}
B_m = math.fabs(B) def code(A, B_m, C, F): tmp = 0 if F <= 1.75e+37: tmp = (math.sqrt(2.0) / B_m) * -math.sqrt((B_m * F)) else: tmp = -math.sqrt((2.0 * (F / B_m))) return tmp
B_m = abs(B) function code(A, B_m, C, F) tmp = 0.0 if (F <= 1.75e+37) tmp = Float64(Float64(sqrt(2.0) / B_m) * Float64(-sqrt(Float64(B_m * F)))); else tmp = Float64(-sqrt(Float64(2.0 * Float64(F / B_m)))); end return tmp end
B_m = abs(B); function tmp_2 = code(A, B_m, C, F) tmp = 0.0; if (F <= 1.75e+37) tmp = (sqrt(2.0) / B_m) * -sqrt((B_m * F)); else tmp = -sqrt((2.0 * (F / B_m))); end tmp_2 = tmp; end
B_m = N[Abs[B], $MachinePrecision] code[A_, B$95$m_, C_, F_] := If[LessEqual[F, 1.75e+37], N[(N[(N[Sqrt[2.0], $MachinePrecision] / B$95$m), $MachinePrecision] * (-N[Sqrt[N[(B$95$m * F), $MachinePrecision]], $MachinePrecision])), $MachinePrecision], (-N[Sqrt[N[(2.0 * N[(F / B$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])]
\begin{array}{l}
B_m = \left|B\right|
\\
\begin{array}{l}
\mathbf{if}\;F \leq 1.75 \cdot 10^{+37}:\\
\;\;\;\;\frac{\sqrt{2}}{B\_m} \cdot \left(-\sqrt{B\_m \cdot F}\right)\\
\mathbf{else}:\\
\;\;\;\;-\sqrt{2 \cdot \frac{F}{B\_m}}\\
\end{array}
\end{array}
if F < 1.75e37Initial program 20.6%
Taylor expanded in C around 0 9.5%
mul-1-neg9.5%
distribute-rgt-neg-in9.5%
+-commutative9.5%
unpow29.5%
unpow29.5%
hypot-define21.9%
Simplified21.9%
Taylor expanded in A around 0 16.3%
if 1.75e37 < F Initial program 21.4%
Taylor expanded in C around 0 13.3%
mul-1-neg13.3%
distribute-rgt-neg-in13.3%
+-commutative13.3%
unpow213.3%
unpow213.3%
hypot-define17.2%
Simplified17.2%
Taylor expanded in A around 0 31.0%
mul-1-neg31.0%
Simplified31.0%
sqrt-unprod31.3%
Applied egg-rr31.3%
Final simplification22.0%
B_m = (fabs.f64 B) (FPCore (A B_m C F) :precision binary64 (if (<= A 3.4e+122) (- (pow (* 2.0 (/ F B_m)) 0.5)) (* (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 <= 3.4e+122) {
tmp = -pow((2.0 * (F / B_m)), 0.5);
} 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 <= 3.4d+122) then
tmp = -((2.0d0 * (f / b_m)) ** 0.5d0)
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 <= 3.4e+122) {
tmp = -Math.pow((2.0 * (F / B_m)), 0.5);
} 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 <= 3.4e+122: tmp = -math.pow((2.0 * (F / B_m)), 0.5) 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 <= 3.4e+122) tmp = Float64(-(Float64(2.0 * Float64(F / B_m)) ^ 0.5)); else tmp = Float64(sqrt(Float64(A * F)) * Float64(2.0 / Float64(-B_m))); end return tmp end
B_m = abs(B); function tmp_2 = code(A, B_m, C, F) tmp = 0.0; if (A <= 3.4e+122) tmp = -((2.0 * (F / B_m)) ^ 0.5); 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, 3.4e+122], (-N[Power[N[(2.0 * N[(F / B$95$m), $MachinePrecision]), $MachinePrecision], 0.5], $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 3.4 \cdot 10^{+122}:\\
\;\;\;\;-{\left(2 \cdot \frac{F}{B\_m}\right)}^{0.5}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{A \cdot F} \cdot \frac{2}{-B\_m}\\
\end{array}
\end{array}
if A < 3.4e122Initial program 23.6%
Taylor expanded in C around 0 12.3%
mul-1-neg12.3%
distribute-rgt-neg-in12.3%
+-commutative12.3%
unpow212.3%
unpow212.3%
hypot-define20.2%
Simplified20.2%
Taylor expanded in A around 0 20.4%
mul-1-neg20.4%
Simplified20.4%
sqrt-unprod20.5%
pow1/220.6%
Applied egg-rr20.6%
if 3.4e122 < A Initial program 9.8%
Taylor expanded in C around 0 5.3%
mul-1-neg5.3%
distribute-rgt-neg-in5.3%
+-commutative5.3%
unpow25.3%
unpow25.3%
hypot-define19.4%
Simplified19.4%
pow1/219.8%
*-commutative19.8%
unpow-prod-down25.2%
pow1/225.2%
pow1/225.2%
Applied egg-rr25.2%
Taylor expanded in B around 0 15.4%
mul-1-neg15.4%
distribute-rgt-neg-in15.4%
unpow215.4%
rem-square-sqrt15.5%
Simplified15.5%
Final simplification19.6%
B_m = (fabs.f64 B) (FPCore (A B_m C F) :precision binary64 (- (pow (* 2.0 (/ F B_m)) 0.5)))
B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
return -pow((2.0 * (F / B_m)), 0.5);
}
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 = -((2.0d0 * (f / b_m)) ** 0.5d0)
end function
B_m = Math.abs(B);
public static double code(double A, double B_m, double C, double F) {
return -Math.pow((2.0 * (F / B_m)), 0.5);
}
B_m = math.fabs(B) def code(A, B_m, C, F): return -math.pow((2.0 * (F / B_m)), 0.5)
B_m = abs(B) function code(A, B_m, C, F) return Float64(-(Float64(2.0 * Float64(F / B_m)) ^ 0.5)) end
B_m = abs(B); function tmp = code(A, B_m, C, F) tmp = -((2.0 * (F / B_m)) ^ 0.5); end
B_m = N[Abs[B], $MachinePrecision] code[A_, B$95$m_, C_, F_] := (-N[Power[N[(2.0 * N[(F / B$95$m), $MachinePrecision]), $MachinePrecision], 0.5], $MachinePrecision])
\begin{array}{l}
B_m = \left|B\right|
\\
-{\left(2 \cdot \frac{F}{B\_m}\right)}^{0.5}
\end{array}
Initial program 20.9%
Taylor expanded in C around 0 11.0%
mul-1-neg11.0%
distribute-rgt-neg-in11.0%
+-commutative11.0%
unpow211.0%
unpow211.0%
hypot-define20.1%
Simplified20.1%
Taylor expanded in A around 0 17.4%
mul-1-neg17.4%
Simplified17.4%
sqrt-unprod17.5%
pow1/217.6%
Applied egg-rr17.6%
Final simplification17.6%
B_m = (fabs.f64 B) (FPCore (A B_m C F) :precision binary64 (- (sqrt (* 2.0 (/ F B_m)))))
B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
return -sqrt((2.0 * (F / B_m)));
}
B_m = abs(B)
real(8) function code(a, b_m, c, f)
real(8), intent (in) :: a
real(8), intent (in) :: b_m
real(8), intent (in) :: c
real(8), intent (in) :: f
code = -sqrt((2.0d0 * (f / b_m)))
end function
B_m = Math.abs(B);
public static double code(double A, double B_m, double C, double F) {
return -Math.sqrt((2.0 * (F / B_m)));
}
B_m = math.fabs(B) def code(A, B_m, C, F): return -math.sqrt((2.0 * (F / B_m)))
B_m = abs(B) function code(A, B_m, C, F) return Float64(-sqrt(Float64(2.0 * Float64(F / B_m)))) end
B_m = abs(B); function tmp = code(A, B_m, C, F) tmp = -sqrt((2.0 * (F / B_m))); end
B_m = N[Abs[B], $MachinePrecision] code[A_, B$95$m_, C_, F_] := (-N[Sqrt[N[(2.0 * N[(F / B$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])
\begin{array}{l}
B_m = \left|B\right|
\\
-\sqrt{2 \cdot \frac{F}{B\_m}}
\end{array}
Initial program 20.9%
Taylor expanded in C around 0 11.0%
mul-1-neg11.0%
distribute-rgt-neg-in11.0%
+-commutative11.0%
unpow211.0%
unpow211.0%
hypot-define20.1%
Simplified20.1%
Taylor expanded in A around 0 17.4%
mul-1-neg17.4%
Simplified17.4%
sqrt-unprod17.5%
Applied egg-rr17.5%
Final simplification17.5%
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))))