
(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 25 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 (* A (* C -4.0)))
(t_1 (hypot B_m (- A C)))
(t_2 (fma B_m B_m t_0))
(t_3 (* (* 2.0 F) t_2))
(t_4 (- (pow B_m 2.0) (* (* 4.0 A) C)))
(t_5
(/
(-
(sqrt
(*
(* 2.0 (* t_4 F))
(+ (+ A C) (sqrt (+ (pow B_m 2.0) (pow (- A C) 2.0)))))))
t_4))
(t_6 (/ (* (sqrt t_3) (- (sqrt (+ A (+ C t_1))))) t_2)))
(if (<= t_5 -4e+124)
(/
(*
(hypot B_m (sqrt t_0))
(* (sqrt (+ (+ A C) t_1)) (- (sqrt (* 2.0 F)))))
t_2)
(if (<= t_5 -5e-173)
t_6
(if (<= t_5 0.0)
(/ (- (sqrt (* t_3 (+ (* -0.5 (/ (pow B_m 2.0) C)) (* 2.0 A))))) t_2)
(if (<= t_5 INFINITY)
t_6
(/
(* (sqrt 2.0) (* (sqrt (+ C (hypot B_m C))) (- (sqrt F))))
B_m)))))))B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
double t_0 = A * (C * -4.0);
double t_1 = hypot(B_m, (A - C));
double t_2 = fma(B_m, B_m, t_0);
double t_3 = (2.0 * F) * t_2;
double t_4 = pow(B_m, 2.0) - ((4.0 * A) * C);
double t_5 = -sqrt(((2.0 * (t_4 * F)) * ((A + C) + sqrt((pow(B_m, 2.0) + pow((A - C), 2.0)))))) / t_4;
double t_6 = (sqrt(t_3) * -sqrt((A + (C + t_1)))) / t_2;
double tmp;
if (t_5 <= -4e+124) {
tmp = (hypot(B_m, sqrt(t_0)) * (sqrt(((A + C) + t_1)) * -sqrt((2.0 * F)))) / t_2;
} else if (t_5 <= -5e-173) {
tmp = t_6;
} else if (t_5 <= 0.0) {
tmp = -sqrt((t_3 * ((-0.5 * (pow(B_m, 2.0) / C)) + (2.0 * A)))) / t_2;
} else if (t_5 <= ((double) INFINITY)) {
tmp = t_6;
} else {
tmp = (sqrt(2.0) * (sqrt((C + hypot(B_m, C))) * -sqrt(F))) / B_m;
}
return tmp;
}
B_m = abs(B) function code(A, B_m, C, F) t_0 = Float64(A * Float64(C * -4.0)) t_1 = hypot(B_m, Float64(A - C)) t_2 = fma(B_m, B_m, t_0) t_3 = Float64(Float64(2.0 * F) * t_2) t_4 = Float64((B_m ^ 2.0) - Float64(Float64(4.0 * A) * C)) t_5 = Float64(Float64(-sqrt(Float64(Float64(2.0 * Float64(t_4 * F)) * Float64(Float64(A + C) + sqrt(Float64((B_m ^ 2.0) + (Float64(A - C) ^ 2.0))))))) / t_4) t_6 = Float64(Float64(sqrt(t_3) * Float64(-sqrt(Float64(A + Float64(C + t_1))))) / t_2) tmp = 0.0 if (t_5 <= -4e+124) tmp = Float64(Float64(hypot(B_m, sqrt(t_0)) * Float64(sqrt(Float64(Float64(A + C) + t_1)) * Float64(-sqrt(Float64(2.0 * F))))) / t_2); elseif (t_5 <= -5e-173) tmp = t_6; elseif (t_5 <= 0.0) tmp = Float64(Float64(-sqrt(Float64(t_3 * Float64(Float64(-0.5 * Float64((B_m ^ 2.0) / C)) + Float64(2.0 * A))))) / t_2); elseif (t_5 <= Inf) tmp = t_6; else tmp = Float64(Float64(sqrt(2.0) * Float64(sqrt(Float64(C + hypot(B_m, C))) * Float64(-sqrt(F)))) / B_m); end return tmp end
B_m = N[Abs[B], $MachinePrecision]
code[A_, B$95$m_, C_, F_] := Block[{t$95$0 = N[(A * N[(C * -4.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Sqrt[B$95$m ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]}, Block[{t$95$2 = N[(B$95$m * B$95$m + t$95$0), $MachinePrecision]}, Block[{t$95$3 = N[(N[(2.0 * F), $MachinePrecision] * t$95$2), $MachinePrecision]}, Block[{t$95$4 = N[(N[Power[B$95$m, 2.0], $MachinePrecision] - N[(N[(4.0 * A), $MachinePrecision] * C), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[((-N[Sqrt[N[(N[(2.0 * N[(t$95$4 * 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]) / t$95$4), $MachinePrecision]}, Block[{t$95$6 = N[(N[(N[Sqrt[t$95$3], $MachinePrecision] * (-N[Sqrt[N[(A + N[(C + t$95$1), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision] / t$95$2), $MachinePrecision]}, If[LessEqual[t$95$5, -4e+124], N[(N[(N[Sqrt[B$95$m ^ 2 + N[Sqrt[t$95$0], $MachinePrecision] ^ 2], $MachinePrecision] * N[(N[Sqrt[N[(N[(A + C), $MachinePrecision] + t$95$1), $MachinePrecision]], $MachinePrecision] * (-N[Sqrt[N[(2.0 * F), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]), $MachinePrecision] / t$95$2), $MachinePrecision], If[LessEqual[t$95$5, -5e-173], t$95$6, If[LessEqual[t$95$5, 0.0], N[((-N[Sqrt[N[(t$95$3 * N[(N[(-0.5 * N[(N[Power[B$95$m, 2.0], $MachinePrecision] / C), $MachinePrecision]), $MachinePrecision] + N[(2.0 * A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$2), $MachinePrecision], If[LessEqual[t$95$5, Infinity], t$95$6, N[(N[(N[Sqrt[2.0], $MachinePrecision] * N[(N[Sqrt[N[(C + N[Sqrt[B$95$m ^ 2 + C ^ 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-N[Sqrt[F], $MachinePrecision])), $MachinePrecision]), $MachinePrecision] / B$95$m), $MachinePrecision]]]]]]]]]]]]
\begin{array}{l}
B_m = \left|B\right|
\\
\begin{array}{l}
t_0 := A \cdot \left(C \cdot -4\right)\\
t_1 := \mathsf{hypot}\left(B_m, A - C\right)\\
t_2 := \mathsf{fma}\left(B_m, B_m, t_0\right)\\
t_3 := \left(2 \cdot F\right) \cdot t_2\\
t_4 := {B_m}^{2} - \left(4 \cdot A\right) \cdot C\\
t_5 := \frac{-\sqrt{\left(2 \cdot \left(t_4 \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{{B_m}^{2} + {\left(A - C\right)}^{2}}\right)}}{t_4}\\
t_6 := \frac{\sqrt{t_3} \cdot \left(-\sqrt{A + \left(C + t_1\right)}\right)}{t_2}\\
\mathbf{if}\;t_5 \leq -4 \cdot 10^{+124}:\\
\;\;\;\;\frac{\mathsf{hypot}\left(B_m, \sqrt{t_0}\right) \cdot \left(\sqrt{\left(A + C\right) + t_1} \cdot \left(-\sqrt{2 \cdot F}\right)\right)}{t_2}\\
\mathbf{elif}\;t_5 \leq -5 \cdot 10^{-173}:\\
\;\;\;\;t_6\\
\mathbf{elif}\;t_5 \leq 0:\\
\;\;\;\;\frac{-\sqrt{t_3 \cdot \left(-0.5 \cdot \frac{{B_m}^{2}}{C} + 2 \cdot A\right)}}{t_2}\\
\mathbf{elif}\;t_5 \leq \infty:\\
\;\;\;\;t_6\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{2} \cdot \left(\sqrt{C + \mathsf{hypot}\left(B_m, C\right)} \cdot \left(-\sqrt{F}\right)\right)}{B_m}\\
\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))) < -3.99999999999999979e124Initial program 9.5%
Simplified22.6%
pow1/222.6%
associate-*l*21.4%
unpow-prod-down46.1%
pow1/246.1%
fma-udef46.1%
add-sqr-sqrt39.4%
hypot-def39.4%
*-commutative39.4%
Applied egg-rr39.4%
unpow1/239.4%
*-commutative39.4%
Simplified39.4%
sqrt-prod48.7%
associate-+r+47.9%
*-commutative47.9%
Applied egg-rr47.9%
if -3.99999999999999979e124 < (/.f64 (neg.f64 (sqrt.f64 (*.f64 (*.f64 2 (*.f64 (-.f64 (pow.f64 B 2) (*.f64 (*.f64 4 A) C)) F)) (+.f64 (+.f64 A C) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) 2) (pow.f64 B 2))))))) (-.f64 (pow.f64 B 2) (*.f64 (*.f64 4 A) C))) < -5.0000000000000002e-173 or -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 81.2%
Simplified91.0%
pow1/291.0%
*-commutative91.0%
unpow-prod-down96.8%
pow1/296.8%
pow1/296.8%
*-commutative96.8%
Applied egg-rr96.8%
if -5.0000000000000002e-173 < (/.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%
Simplified7.6%
Taylor expanded in C around -inf 34.6%
if +inf.0 < (/.f64 (neg.f64 (sqrt.f64 (*.f64 (*.f64 2 (*.f64 (-.f64 (pow.f64 B 2) (*.f64 (*.f64 4 A) C)) F)) (+.f64 (+.f64 A C) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) 2) (pow.f64 B 2))))))) (-.f64 (pow.f64 B 2) (*.f64 (*.f64 4 A) C))) Initial program 0.0%
Simplified0.8%
Taylor expanded in A around 0 2.1%
mul-1-neg2.1%
distribute-rgt-neg-in2.1%
unpow22.1%
unpow22.1%
hypot-def18.0%
Simplified18.0%
associate-*l/18.0%
Applied egg-rr18.0%
pow1/218.1%
*-commutative18.1%
unpow-prod-down31.2%
pow1/231.2%
pow1/231.2%
Applied egg-rr31.2%
Final simplification50.8%
B_m = (fabs.f64 B)
(FPCore (A B_m C F)
:precision binary64
(let* ((t_0 (fma B_m B_m (* A (* C -4.0))))
(t_1 (* (* 2.0 F) t_0))
(t_2 (+ C (hypot B_m C))))
(if (<= (pow B_m 2.0) 2e-207)
(/ (- (sqrt (* t_1 (+ A A)))) t_0)
(if (<= (pow B_m 2.0) 2e-39)
(/ (- (sqrt (* t_1 t_2))) t_0)
(if (<= (pow B_m 2.0) 10000.0)
(*
(/ (sqrt 2.0) B_m)
(* (sqrt F) (- (sqrt (* -0.5 (/ (pow B_m 2.0) C))))))
(/ (* (sqrt 2.0) (* (sqrt t_2) (- (sqrt F)))) 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 t_1 = (2.0 * F) * t_0;
double t_2 = C + hypot(B_m, C);
double tmp;
if (pow(B_m, 2.0) <= 2e-207) {
tmp = -sqrt((t_1 * (A + A))) / t_0;
} else if (pow(B_m, 2.0) <= 2e-39) {
tmp = -sqrt((t_1 * t_2)) / t_0;
} else if (pow(B_m, 2.0) <= 10000.0) {
tmp = (sqrt(2.0) / B_m) * (sqrt(F) * -sqrt((-0.5 * (pow(B_m, 2.0) / C))));
} else {
tmp = (sqrt(2.0) * (sqrt(t_2) * -sqrt(F))) / 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))) t_1 = Float64(Float64(2.0 * F) * t_0) t_2 = Float64(C + hypot(B_m, C)) tmp = 0.0 if ((B_m ^ 2.0) <= 2e-207) tmp = Float64(Float64(-sqrt(Float64(t_1 * Float64(A + A)))) / t_0); elseif ((B_m ^ 2.0) <= 2e-39) tmp = Float64(Float64(-sqrt(Float64(t_1 * t_2))) / t_0); elseif ((B_m ^ 2.0) <= 10000.0) tmp = Float64(Float64(sqrt(2.0) / B_m) * Float64(sqrt(F) * Float64(-sqrt(Float64(-0.5 * Float64((B_m ^ 2.0) / C)))))); else tmp = Float64(Float64(sqrt(2.0) * Float64(sqrt(t_2) * Float64(-sqrt(F)))) / 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]}, Block[{t$95$1 = N[(N[(2.0 * F), $MachinePrecision] * t$95$0), $MachinePrecision]}, Block[{t$95$2 = N[(C + N[Sqrt[B$95$m ^ 2 + C ^ 2], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 2e-207], N[((-N[Sqrt[N[(t$95$1 * N[(A + A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 2e-39], N[((-N[Sqrt[N[(t$95$1 * t$95$2), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 10000.0], N[(N[(N[Sqrt[2.0], $MachinePrecision] / B$95$m), $MachinePrecision] * N[(N[Sqrt[F], $MachinePrecision] * (-N[Sqrt[N[(-0.5 * N[(N[Power[B$95$m, 2.0], $MachinePrecision] / C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[2.0], $MachinePrecision] * N[(N[Sqrt[t$95$2], $MachinePrecision] * (-N[Sqrt[F], $MachinePrecision])), $MachinePrecision]), $MachinePrecision] / B$95$m), $MachinePrecision]]]]]]]
\begin{array}{l}
B_m = \left|B\right|
\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(B_m, B_m, A \cdot \left(C \cdot -4\right)\right)\\
t_1 := \left(2 \cdot F\right) \cdot t_0\\
t_2 := C + \mathsf{hypot}\left(B_m, C\right)\\
\mathbf{if}\;{B_m}^{2} \leq 2 \cdot 10^{-207}:\\
\;\;\;\;\frac{-\sqrt{t_1 \cdot \left(A + A\right)}}{t_0}\\
\mathbf{elif}\;{B_m}^{2} \leq 2 \cdot 10^{-39}:\\
\;\;\;\;\frac{-\sqrt{t_1 \cdot t_2}}{t_0}\\
\mathbf{elif}\;{B_m}^{2} \leq 10000:\\
\;\;\;\;\frac{\sqrt{2}}{B_m} \cdot \left(\sqrt{F} \cdot \left(-\sqrt{-0.5 \cdot \frac{{B_m}^{2}}{C}}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{2} \cdot \left(\sqrt{t_2} \cdot \left(-\sqrt{F}\right)\right)}{B_m}\\
\end{array}
\end{array}
if (pow.f64 B 2) < 1.99999999999999985e-207Initial program 23.5%
Simplified31.8%
Taylor expanded in C around -inf 28.3%
if 1.99999999999999985e-207 < (pow.f64 B 2) < 1.99999999999999986e-39Initial program 28.7%
Simplified41.7%
Taylor expanded in A around 0 27.5%
unpow227.5%
unpow227.5%
hypot-def36.3%
Simplified36.3%
if 1.99999999999999986e-39 < (pow.f64 B 2) < 1e4Initial program 12.8%
Simplified15.4%
Taylor expanded in A around 0 8.0%
mul-1-neg8.0%
distribute-rgt-neg-in8.0%
unpow28.0%
unpow28.0%
hypot-def8.5%
Simplified8.5%
pow1/28.5%
*-commutative8.5%
unpow-prod-down8.6%
pow1/28.6%
pow1/28.6%
Applied egg-rr8.6%
Taylor expanded in C around -inf 44.5%
if 1e4 < (pow.f64 B 2) Initial program 18.9%
Simplified22.5%
Taylor expanded in A around 0 11.1%
mul-1-neg11.1%
distribute-rgt-neg-in11.1%
unpow211.1%
unpow211.1%
hypot-def25.2%
Simplified25.2%
associate-*l/25.3%
Applied egg-rr25.3%
pow1/225.3%
*-commutative25.3%
unpow-prod-down37.5%
pow1/237.5%
pow1/237.5%
Applied egg-rr37.5%
Final simplification34.8%
B_m = (fabs.f64 B)
(FPCore (A B_m C F)
:precision binary64
(let* ((t_0 (fma B_m B_m (* A (* C -4.0)))))
(if (<= (pow B_m 2.0) 1e+34)
(/
(* (sqrt (* (* 2.0 F) t_0)) (- (sqrt (+ A (+ C (hypot B_m (- A C)))))))
t_0)
(/ (* (sqrt 2.0) (* (sqrt (+ C (hypot B_m C))) (- (sqrt F)))) B_m))))B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
double t_0 = fma(B_m, B_m, (A * (C * -4.0)));
double tmp;
if (pow(B_m, 2.0) <= 1e+34) {
tmp = (sqrt(((2.0 * F) * t_0)) * -sqrt((A + (C + hypot(B_m, (A - C)))))) / t_0;
} else {
tmp = (sqrt(2.0) * (sqrt((C + hypot(B_m, C))) * -sqrt(F))) / B_m;
}
return tmp;
}
B_m = abs(B) function code(A, B_m, C, F) t_0 = fma(B_m, B_m, Float64(A * Float64(C * -4.0))) tmp = 0.0 if ((B_m ^ 2.0) <= 1e+34) tmp = Float64(Float64(sqrt(Float64(Float64(2.0 * F) * t_0)) * Float64(-sqrt(Float64(A + Float64(C + hypot(B_m, Float64(A - C))))))) / t_0); else tmp = Float64(Float64(sqrt(2.0) * Float64(sqrt(Float64(C + hypot(B_m, C))) * Float64(-sqrt(F)))) / B_m); end return tmp end
B_m = N[Abs[B], $MachinePrecision]
code[A_, B$95$m_, C_, F_] := Block[{t$95$0 = N[(B$95$m * B$95$m + N[(A * N[(C * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 1e+34], N[(N[(N[Sqrt[N[(N[(2.0 * F), $MachinePrecision] * t$95$0), $MachinePrecision]], $MachinePrecision] * (-N[Sqrt[N[(A + N[(C + N[Sqrt[B$95$m ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision] / t$95$0), $MachinePrecision], N[(N[(N[Sqrt[2.0], $MachinePrecision] * N[(N[Sqrt[N[(C + N[Sqrt[B$95$m ^ 2 + C ^ 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-N[Sqrt[F], $MachinePrecision])), $MachinePrecision]), $MachinePrecision] / B$95$m), $MachinePrecision]]]
\begin{array}{l}
B_m = \left|B\right|
\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(B_m, B_m, A \cdot \left(C \cdot -4\right)\right)\\
\mathbf{if}\;{B_m}^{2} \leq 10^{+34}:\\
\;\;\;\;\frac{\sqrt{\left(2 \cdot F\right) \cdot t_0} \cdot \left(-\sqrt{A + \left(C + \mathsf{hypot}\left(B_m, A - C\right)\right)}\right)}{t_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{2} \cdot \left(\sqrt{C + \mathsf{hypot}\left(B_m, C\right)} \cdot \left(-\sqrt{F}\right)\right)}{B_m}\\
\end{array}
\end{array}
if (pow.f64 B 2) < 9.99999999999999946e33Initial program 24.8%
Simplified34.0%
pow1/234.0%
*-commutative34.0%
unpow-prod-down38.0%
pow1/238.0%
pow1/238.0%
*-commutative38.0%
Applied egg-rr38.0%
if 9.99999999999999946e33 < (pow.f64 B 2) Initial program 18.3%
Simplified21.9%
Taylor expanded in A around 0 11.1%
mul-1-neg11.1%
distribute-rgt-neg-in11.1%
unpow211.1%
unpow211.1%
hypot-def25.4%
Simplified25.4%
associate-*l/25.4%
Applied egg-rr25.4%
pow1/225.5%
*-commutative25.5%
unpow-prod-down37.8%
pow1/237.8%
pow1/237.8%
Applied egg-rr37.8%
Final simplification37.9%
B_m = (fabs.f64 B)
(FPCore (A B_m C F)
:precision binary64
(if (<= (pow B_m 2.0) 4e-65)
(/
1.0
(/
(fma B_m B_m (* A (* C -4.0)))
(*
(sqrt (* 2.0 (+ A (+ C (hypot B_m (- A C))))))
(- (sqrt (* (* C F) (* A -4.0)))))))
(/ (* (sqrt 2.0) (* (sqrt (+ C (hypot B_m C))) (- (sqrt F)))) B_m)))B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
double tmp;
if (pow(B_m, 2.0) <= 4e-65) {
tmp = 1.0 / (fma(B_m, B_m, (A * (C * -4.0))) / (sqrt((2.0 * (A + (C + hypot(B_m, (A - C)))))) * -sqrt(((C * F) * (A * -4.0)))));
} else {
tmp = (sqrt(2.0) * (sqrt((C + hypot(B_m, C))) * -sqrt(F))) / B_m;
}
return tmp;
}
B_m = abs(B) function code(A, B_m, C, F) tmp = 0.0 if ((B_m ^ 2.0) <= 4e-65) tmp = Float64(1.0 / Float64(fma(B_m, B_m, Float64(A * Float64(C * -4.0))) / Float64(sqrt(Float64(2.0 * Float64(A + Float64(C + hypot(B_m, Float64(A - C)))))) * Float64(-sqrt(Float64(Float64(C * F) * Float64(A * -4.0))))))); else tmp = Float64(Float64(sqrt(2.0) * Float64(sqrt(Float64(C + hypot(B_m, C))) * Float64(-sqrt(F)))) / B_m); 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], 4e-65], N[(1.0 / N[(N[(B$95$m * B$95$m + N[(A * N[(C * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[Sqrt[N[(2.0 * N[(A + N[(C + N[Sqrt[B$95$m ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-N[Sqrt[N[(N[(C * F), $MachinePrecision] * N[(A * -4.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[2.0], $MachinePrecision] * N[(N[Sqrt[N[(C + N[Sqrt[B$95$m ^ 2 + C ^ 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-N[Sqrt[F], $MachinePrecision])), $MachinePrecision]), $MachinePrecision] / B$95$m), $MachinePrecision]]
\begin{array}{l}
B_m = \left|B\right|
\\
\begin{array}{l}
\mathbf{if}\;{B_m}^{2} \leq 4 \cdot 10^{-65}:\\
\;\;\;\;\frac{1}{\frac{\mathsf{fma}\left(B_m, B_m, A \cdot \left(C \cdot -4\right)\right)}{\sqrt{2 \cdot \left(A + \left(C + \mathsf{hypot}\left(B_m, A - C\right)\right)\right)} \cdot \left(-\sqrt{\left(C \cdot F\right) \cdot \left(A \cdot -4\right)}\right)}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{2} \cdot \left(\sqrt{C + \mathsf{hypot}\left(B_m, C\right)} \cdot \left(-\sqrt{F}\right)\right)}{B_m}\\
\end{array}
\end{array}
if (pow.f64 B 2) < 3.99999999999999969e-65Initial program 24.1%
clear-num24.1%
inv-pow24.1%
Applied egg-rr34.2%
Simplified34.2%
Taylor expanded in B around 0 28.0%
pow1/228.0%
associate-*r*28.0%
unpow-prod-down29.5%
associate-+r+28.2%
pow1/228.2%
associate-*r*28.2%
Applied egg-rr28.2%
unpow1/228.2%
associate-+l+29.5%
*-commutative29.5%
*-commutative29.5%
Simplified29.5%
if 3.99999999999999969e-65 < (pow.f64 B 2) Initial program 19.5%
Simplified23.0%
Taylor expanded in A around 0 11.2%
mul-1-neg11.2%
distribute-rgt-neg-in11.2%
unpow211.2%
unpow211.2%
hypot-def24.0%
Simplified24.0%
associate-*l/24.0%
Applied egg-rr24.0%
pow1/224.1%
*-commutative24.1%
unpow-prod-down35.0%
pow1/235.0%
pow1/235.0%
Applied egg-rr35.0%
Final simplification32.8%
B_m = (fabs.f64 B)
(FPCore (A B_m C F)
:precision binary64
(let* ((t_0 (fma B_m B_m (* A (* C -4.0)))))
(if (<= (pow B_m 2.0) 1e+34)
(/ (- (sqrt (* (+ A (+ C (hypot B_m (- A C)))) (* (* 2.0 F) t_0)))) t_0)
(/ (* (sqrt 2.0) (* (sqrt (+ C (hypot B_m C))) (- (sqrt F)))) B_m))))B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
double t_0 = fma(B_m, B_m, (A * (C * -4.0)));
double tmp;
if (pow(B_m, 2.0) <= 1e+34) {
tmp = -sqrt(((A + (C + hypot(B_m, (A - C)))) * ((2.0 * F) * t_0))) / t_0;
} else {
tmp = (sqrt(2.0) * (sqrt((C + hypot(B_m, C))) * -sqrt(F))) / B_m;
}
return tmp;
}
B_m = abs(B) function code(A, B_m, C, F) t_0 = fma(B_m, B_m, Float64(A * Float64(C * -4.0))) tmp = 0.0 if ((B_m ^ 2.0) <= 1e+34) tmp = Float64(Float64(-sqrt(Float64(Float64(A + Float64(C + hypot(B_m, Float64(A - C)))) * Float64(Float64(2.0 * F) * t_0)))) / t_0); else tmp = Float64(Float64(sqrt(2.0) * Float64(sqrt(Float64(C + hypot(B_m, C))) * Float64(-sqrt(F)))) / B_m); end return tmp end
B_m = N[Abs[B], $MachinePrecision]
code[A_, B$95$m_, C_, F_] := Block[{t$95$0 = N[(B$95$m * B$95$m + N[(A * N[(C * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 1e+34], N[((-N[Sqrt[N[(N[(A + N[(C + N[Sqrt[B$95$m ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(2.0 * F), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], N[(N[(N[Sqrt[2.0], $MachinePrecision] * N[(N[Sqrt[N[(C + N[Sqrt[B$95$m ^ 2 + C ^ 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-N[Sqrt[F], $MachinePrecision])), $MachinePrecision]), $MachinePrecision] / B$95$m), $MachinePrecision]]]
\begin{array}{l}
B_m = \left|B\right|
\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(B_m, B_m, A \cdot \left(C \cdot -4\right)\right)\\
\mathbf{if}\;{B_m}^{2} \leq 10^{+34}:\\
\;\;\;\;\frac{-\sqrt{\left(A + \left(C + \mathsf{hypot}\left(B_m, A - C\right)\right)\right) \cdot \left(\left(2 \cdot F\right) \cdot t_0\right)}}{t_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{2} \cdot \left(\sqrt{C + \mathsf{hypot}\left(B_m, C\right)} \cdot \left(-\sqrt{F}\right)\right)}{B_m}\\
\end{array}
\end{array}
if (pow.f64 B 2) < 9.99999999999999946e33Initial program 24.8%
Simplified34.0%
if 9.99999999999999946e33 < (pow.f64 B 2) Initial program 18.3%
Simplified21.9%
Taylor expanded in A around 0 11.1%
mul-1-neg11.1%
distribute-rgt-neg-in11.1%
unpow211.1%
unpow211.1%
hypot-def25.4%
Simplified25.4%
associate-*l/25.4%
Applied egg-rr25.4%
pow1/225.5%
*-commutative25.5%
unpow-prod-down37.8%
pow1/237.8%
pow1/237.8%
Applied egg-rr37.8%
Final simplification36.0%
B_m = (fabs.f64 B)
(FPCore (A B_m C F)
:precision binary64
(let* ((t_0 (fma B_m B_m (* A (* C -4.0)))))
(if (<= (pow B_m 2.0) 5e-99)
(/ (- (sqrt (* (* (* 2.0 F) t_0) (* 2.0 C)))) t_0)
(* (/ (sqrt 2.0) B_m) (* (sqrt F) (- (sqrt (+ A (hypot B_m A)))))))))B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
double t_0 = fma(B_m, B_m, (A * (C * -4.0)));
double tmp;
if (pow(B_m, 2.0) <= 5e-99) {
tmp = -sqrt((((2.0 * F) * t_0) * (2.0 * C))) / t_0;
} else {
tmp = (sqrt(2.0) / B_m) * (sqrt(F) * -sqrt((A + hypot(B_m, A))));
}
return tmp;
}
B_m = abs(B) function code(A, B_m, C, F) t_0 = fma(B_m, B_m, Float64(A * Float64(C * -4.0))) tmp = 0.0 if ((B_m ^ 2.0) <= 5e-99) tmp = Float64(Float64(-sqrt(Float64(Float64(Float64(2.0 * F) * t_0) * Float64(2.0 * C)))) / t_0); else tmp = Float64(Float64(sqrt(2.0) / B_m) * Float64(sqrt(F) * Float64(-sqrt(Float64(A + hypot(B_m, A)))))); end return tmp end
B_m = N[Abs[B], $MachinePrecision]
code[A_, B$95$m_, C_, F_] := Block[{t$95$0 = N[(B$95$m * B$95$m + N[(A * N[(C * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 5e-99], N[((-N[Sqrt[N[(N[(N[(2.0 * F), $MachinePrecision] * t$95$0), $MachinePrecision] * N[(2.0 * C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], N[(N[(N[Sqrt[2.0], $MachinePrecision] / B$95$m), $MachinePrecision] * N[(N[Sqrt[F], $MachinePrecision] * (-N[Sqrt[N[(A + N[Sqrt[B$95$m ^ 2 + A ^ 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
B_m = \left|B\right|
\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(B_m, B_m, A \cdot \left(C \cdot -4\right)\right)\\
\mathbf{if}\;{B_m}^{2} \leq 5 \cdot 10^{-99}:\\
\;\;\;\;\frac{-\sqrt{\left(\left(2 \cdot F\right) \cdot t_0\right) \cdot \left(2 \cdot C\right)}}{t_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{2}}{B_m} \cdot \left(\sqrt{F} \cdot \left(-\sqrt{A + \mathsf{hypot}\left(B_m, A\right)}\right)\right)\\
\end{array}
\end{array}
if (pow.f64 B 2) < 4.99999999999999969e-99Initial program 23.3%
Simplified33.9%
Taylor expanded in A around -inf 28.3%
if 4.99999999999999969e-99 < (pow.f64 B 2) Initial program 20.2%
Simplified23.6%
Taylor expanded in C around 0 11.3%
mul-1-neg11.3%
distribute-rgt-neg-in11.3%
+-commutative11.3%
unpow211.3%
unpow211.3%
hypot-def21.0%
Simplified21.0%
pow1/221.0%
*-commutative21.0%
unpow-prod-down31.1%
pow1/231.1%
pow1/231.1%
Applied egg-rr31.1%
Final simplification30.0%
B_m = (fabs.f64 B)
(FPCore (A B_m C F)
:precision binary64
(let* ((t_0 (fma B_m B_m (* A (* C -4.0)))))
(if (<= (pow B_m 2.0) 5e-99)
(/ (- (sqrt (* (* (* 2.0 F) t_0) (* 2.0 C)))) t_0)
(* (* (sqrt (+ C (hypot B_m C))) (sqrt F)) (/ (- (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) <= 5e-99) {
tmp = -sqrt((((2.0 * F) * t_0) * (2.0 * C))) / t_0;
} else {
tmp = (sqrt((C + hypot(B_m, C))) * sqrt(F)) * (-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) <= 5e-99) tmp = Float64(Float64(-sqrt(Float64(Float64(Float64(2.0 * F) * t_0) * Float64(2.0 * C)))) / t_0); else tmp = Float64(Float64(sqrt(Float64(C + hypot(B_m, C))) * sqrt(F)) * Float64(Float64(-sqrt(2.0)) / 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], 5e-99], N[((-N[Sqrt[N[(N[(N[(2.0 * F), $MachinePrecision] * t$95$0), $MachinePrecision] * N[(2.0 * C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], N[(N[(N[Sqrt[N[(C + N[Sqrt[B$95$m ^ 2 + C ^ 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sqrt[F], $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 5 \cdot 10^{-99}:\\
\;\;\;\;\frac{-\sqrt{\left(\left(2 \cdot F\right) \cdot t_0\right) \cdot \left(2 \cdot C\right)}}{t_0}\\
\mathbf{else}:\\
\;\;\;\;\left(\sqrt{C + \mathsf{hypot}\left(B_m, C\right)} \cdot \sqrt{F}\right) \cdot \frac{-\sqrt{2}}{B_m}\\
\end{array}
\end{array}
if (pow.f64 B 2) < 4.99999999999999969e-99Initial program 23.3%
Simplified33.9%
Taylor expanded in A around -inf 28.3%
if 4.99999999999999969e-99 < (pow.f64 B 2) Initial program 20.2%
Simplified23.6%
Taylor expanded in A around 0 11.5%
mul-1-neg11.5%
distribute-rgt-neg-in11.5%
unpow211.5%
unpow211.5%
hypot-def23.9%
Simplified23.9%
pow1/224.0%
*-commutative24.0%
unpow-prod-down34.6%
pow1/234.6%
pow1/234.6%
Applied egg-rr34.6%
Final simplification32.1%
B_m = (fabs.f64 B)
(FPCore (A B_m C F)
:precision binary64
(let* ((t_0 (fma B_m B_m (* A (* C -4.0)))))
(if (<= (pow B_m 2.0) 5e-99)
(/ (- (sqrt (* (* (* 2.0 F) t_0) (* 2.0 C)))) t_0)
(/ (* (sqrt 2.0) (* (sqrt (+ C (hypot B_m C))) (- (sqrt F)))) 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) <= 5e-99) {
tmp = -sqrt((((2.0 * F) * t_0) * (2.0 * C))) / t_0;
} else {
tmp = (sqrt(2.0) * (sqrt((C + hypot(B_m, C))) * -sqrt(F))) / 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) <= 5e-99) tmp = Float64(Float64(-sqrt(Float64(Float64(Float64(2.0 * F) * t_0) * Float64(2.0 * C)))) / t_0); else tmp = Float64(Float64(sqrt(2.0) * Float64(sqrt(Float64(C + hypot(B_m, C))) * Float64(-sqrt(F)))) / 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], 5e-99], N[((-N[Sqrt[N[(N[(N[(2.0 * F), $MachinePrecision] * t$95$0), $MachinePrecision] * N[(2.0 * C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], N[(N[(N[Sqrt[2.0], $MachinePrecision] * N[(N[Sqrt[N[(C + N[Sqrt[B$95$m ^ 2 + C ^ 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-N[Sqrt[F], $MachinePrecision])), $MachinePrecision]), $MachinePrecision] / B$95$m), $MachinePrecision]]]
\begin{array}{l}
B_m = \left|B\right|
\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(B_m, B_m, A \cdot \left(C \cdot -4\right)\right)\\
\mathbf{if}\;{B_m}^{2} \leq 5 \cdot 10^{-99}:\\
\;\;\;\;\frac{-\sqrt{\left(\left(2 \cdot F\right) \cdot t_0\right) \cdot \left(2 \cdot C\right)}}{t_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{2} \cdot \left(\sqrt{C + \mathsf{hypot}\left(B_m, C\right)} \cdot \left(-\sqrt{F}\right)\right)}{B_m}\\
\end{array}
\end{array}
if (pow.f64 B 2) < 4.99999999999999969e-99Initial program 23.3%
Simplified33.9%
Taylor expanded in A around -inf 28.3%
if 4.99999999999999969e-99 < (pow.f64 B 2) Initial program 20.2%
Simplified23.6%
Taylor expanded in A around 0 11.5%
mul-1-neg11.5%
distribute-rgt-neg-in11.5%
unpow211.5%
unpow211.5%
hypot-def23.9%
Simplified23.9%
associate-*l/24.0%
Applied egg-rr24.0%
pow1/224.0%
*-commutative24.0%
unpow-prod-down34.6%
pow1/234.6%
pow1/234.6%
Applied egg-rr34.6%
Final simplification32.1%
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 7e-190)
(/ 1.0 (/ t_0 (- (sqrt (* 2.0 (* (+ A A) (* -4.0 (* A (* C F)))))))))
(if (<= B_m 2.7e-59)
(/ (- (sqrt (* (* (* 2.0 F) t_0) (* 2.0 C)))) t_0)
(if (<= B_m 8e+17)
(/ (* (sqrt 2.0) (- (sqrt (* -0.5 (/ (pow B_m 2.0) (/ C F)))))) B_m)
(* (/ (sqrt 2.0) B_m) (- (* (sqrt F) (sqrt (+ B_m C))))))))))B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
double t_0 = fma(B_m, B_m, (A * (C * -4.0)));
double tmp;
if (B_m <= 7e-190) {
tmp = 1.0 / (t_0 / -sqrt((2.0 * ((A + A) * (-4.0 * (A * (C * F)))))));
} else if (B_m <= 2.7e-59) {
tmp = -sqrt((((2.0 * F) * t_0) * (2.0 * C))) / t_0;
} else if (B_m <= 8e+17) {
tmp = (sqrt(2.0) * -sqrt((-0.5 * (pow(B_m, 2.0) / (C / F))))) / B_m;
} else {
tmp = (sqrt(2.0) / B_m) * -(sqrt(F) * sqrt((B_m + C)));
}
return tmp;
}
B_m = abs(B) function code(A, B_m, C, F) t_0 = fma(B_m, B_m, Float64(A * Float64(C * -4.0))) tmp = 0.0 if (B_m <= 7e-190) tmp = Float64(1.0 / Float64(t_0 / Float64(-sqrt(Float64(2.0 * Float64(Float64(A + A) * Float64(-4.0 * Float64(A * Float64(C * F))))))))); elseif (B_m <= 2.7e-59) tmp = Float64(Float64(-sqrt(Float64(Float64(Float64(2.0 * F) * t_0) * Float64(2.0 * C)))) / t_0); elseif (B_m <= 8e+17) tmp = Float64(Float64(sqrt(2.0) * Float64(-sqrt(Float64(-0.5 * Float64((B_m ^ 2.0) / Float64(C / F)))))) / B_m); else tmp = Float64(Float64(sqrt(2.0) / B_m) * Float64(-Float64(sqrt(F) * sqrt(Float64(B_m + C))))); end return tmp end
B_m = N[Abs[B], $MachinePrecision]
code[A_, B$95$m_, C_, F_] := Block[{t$95$0 = N[(B$95$m * B$95$m + N[(A * N[(C * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[B$95$m, 7e-190], N[(1.0 / N[(t$95$0 / (-N[Sqrt[N[(2.0 * N[(N[(A + A), $MachinePrecision] * N[(-4.0 * N[(A * N[(C * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]), $MachinePrecision], If[LessEqual[B$95$m, 2.7e-59], N[((-N[Sqrt[N[(N[(N[(2.0 * F), $MachinePrecision] * t$95$0), $MachinePrecision] * N[(2.0 * C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], If[LessEqual[B$95$m, 8e+17], N[(N[(N[Sqrt[2.0], $MachinePrecision] * (-N[Sqrt[N[(-0.5 * N[(N[Power[B$95$m, 2.0], $MachinePrecision] / N[(C / F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision] / B$95$m), $MachinePrecision], N[(N[(N[Sqrt[2.0], $MachinePrecision] / B$95$m), $MachinePrecision] * (-N[(N[Sqrt[F], $MachinePrecision] * N[Sqrt[N[(B$95$m + C), $MachinePrecision]], $MachinePrecision]), $MachinePrecision])), $MachinePrecision]]]]]
\begin{array}{l}
B_m = \left|B\right|
\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(B_m, B_m, A \cdot \left(C \cdot -4\right)\right)\\
\mathbf{if}\;B_m \leq 7 \cdot 10^{-190}:\\
\;\;\;\;\frac{1}{\frac{t_0}{-\sqrt{2 \cdot \left(\left(A + A\right) \cdot \left(-4 \cdot \left(A \cdot \left(C \cdot F\right)\right)\right)\right)}}}\\
\mathbf{elif}\;B_m \leq 2.7 \cdot 10^{-59}:\\
\;\;\;\;\frac{-\sqrt{\left(\left(2 \cdot F\right) \cdot t_0\right) \cdot \left(2 \cdot C\right)}}{t_0}\\
\mathbf{elif}\;B_m \leq 8 \cdot 10^{+17}:\\
\;\;\;\;\frac{\sqrt{2} \cdot \left(-\sqrt{-0.5 \cdot \frac{{B_m}^{2}}{\frac{C}{F}}}\right)}{B_m}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{2}}{B_m} \cdot \left(-\sqrt{F} \cdot \sqrt{B_m + C}\right)\\
\end{array}
\end{array}
if B < 6.9999999999999999e-190Initial program 22.0%
clear-num22.0%
inv-pow22.0%
Applied egg-rr27.0%
Simplified27.0%
Taylor expanded in B around 0 18.3%
Taylor expanded in C around -inf 16.6%
if 6.9999999999999999e-190 < B < 2.6999999999999999e-59Initial program 28.4%
Simplified46.2%
Taylor expanded in A around -inf 24.2%
if 2.6999999999999999e-59 < B < 8e17Initial program 21.0%
Simplified22.5%
Taylor expanded in A around 0 32.9%
mul-1-neg32.9%
distribute-rgt-neg-in32.9%
unpow232.9%
unpow232.9%
hypot-def33.8%
Simplified33.8%
associate-*l/33.8%
Applied egg-rr33.8%
Taylor expanded in C around -inf 50.6%
associate-/l*50.2%
Simplified50.0%
if 8e17 < B Initial program 17.8%
Simplified23.5%
Taylor expanded in A around 0 20.0%
mul-1-neg20.0%
distribute-rgt-neg-in20.0%
unpow220.0%
unpow220.0%
hypot-def46.6%
Simplified46.6%
pow1/246.7%
*-commutative46.7%
unpow-prod-down70.1%
pow1/270.1%
pow1/270.1%
Applied egg-rr70.0%
Taylor expanded in C around 0 59.0%
Final simplification29.9%
B_m = (fabs.f64 B)
(FPCore (A B_m C F)
:precision binary64
(let* ((t_0 (fma B_m B_m (* A (* C -4.0)))) (t_1 (* (* 2.0 F) t_0)))
(if (<= B_m 1.9e-189)
(/ (- (sqrt (* t_1 (+ A A)))) t_0)
(if (<= B_m 2.2e-55)
(/ (- (sqrt (* t_1 (* 2.0 C)))) t_0)
(if (<= B_m 1.15e+17)
(/ (* (sqrt 2.0) (- (sqrt (* -0.5 (/ (pow B_m 2.0) (/ C F)))))) B_m)
(* (/ (sqrt 2.0) B_m) (- (* (sqrt F) (sqrt (+ B_m C))))))))))B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
double t_0 = fma(B_m, B_m, (A * (C * -4.0)));
double t_1 = (2.0 * F) * t_0;
double tmp;
if (B_m <= 1.9e-189) {
tmp = -sqrt((t_1 * (A + A))) / t_0;
} else if (B_m <= 2.2e-55) {
tmp = -sqrt((t_1 * (2.0 * C))) / t_0;
} else if (B_m <= 1.15e+17) {
tmp = (sqrt(2.0) * -sqrt((-0.5 * (pow(B_m, 2.0) / (C / F))))) / B_m;
} else {
tmp = (sqrt(2.0) / B_m) * -(sqrt(F) * sqrt((B_m + C)));
}
return tmp;
}
B_m = abs(B) function code(A, B_m, C, F) t_0 = fma(B_m, B_m, Float64(A * Float64(C * -4.0))) t_1 = Float64(Float64(2.0 * F) * t_0) tmp = 0.0 if (B_m <= 1.9e-189) tmp = Float64(Float64(-sqrt(Float64(t_1 * Float64(A + A)))) / t_0); elseif (B_m <= 2.2e-55) tmp = Float64(Float64(-sqrt(Float64(t_1 * Float64(2.0 * C)))) / t_0); elseif (B_m <= 1.15e+17) tmp = Float64(Float64(sqrt(2.0) * Float64(-sqrt(Float64(-0.5 * Float64((B_m ^ 2.0) / Float64(C / F)))))) / B_m); else tmp = Float64(Float64(sqrt(2.0) / B_m) * Float64(-Float64(sqrt(F) * sqrt(Float64(B_m + C))))); end return tmp end
B_m = N[Abs[B], $MachinePrecision]
code[A_, B$95$m_, C_, F_] := Block[{t$95$0 = N[(B$95$m * B$95$m + N[(A * N[(C * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(2.0 * F), $MachinePrecision] * t$95$0), $MachinePrecision]}, If[LessEqual[B$95$m, 1.9e-189], N[((-N[Sqrt[N[(t$95$1 * N[(A + A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], If[LessEqual[B$95$m, 2.2e-55], N[((-N[Sqrt[N[(t$95$1 * N[(2.0 * C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], If[LessEqual[B$95$m, 1.15e+17], N[(N[(N[Sqrt[2.0], $MachinePrecision] * (-N[Sqrt[N[(-0.5 * N[(N[Power[B$95$m, 2.0], $MachinePrecision] / N[(C / F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision] / B$95$m), $MachinePrecision], N[(N[(N[Sqrt[2.0], $MachinePrecision] / B$95$m), $MachinePrecision] * (-N[(N[Sqrt[F], $MachinePrecision] * N[Sqrt[N[(B$95$m + C), $MachinePrecision]], $MachinePrecision]), $MachinePrecision])), $MachinePrecision]]]]]]
\begin{array}{l}
B_m = \left|B\right|
\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(B_m, B_m, A \cdot \left(C \cdot -4\right)\right)\\
t_1 := \left(2 \cdot F\right) \cdot t_0\\
\mathbf{if}\;B_m \leq 1.9 \cdot 10^{-189}:\\
\;\;\;\;\frac{-\sqrt{t_1 \cdot \left(A + A\right)}}{t_0}\\
\mathbf{elif}\;B_m \leq 2.2 \cdot 10^{-55}:\\
\;\;\;\;\frac{-\sqrt{t_1 \cdot \left(2 \cdot C\right)}}{t_0}\\
\mathbf{elif}\;B_m \leq 1.15 \cdot 10^{+17}:\\
\;\;\;\;\frac{\sqrt{2} \cdot \left(-\sqrt{-0.5 \cdot \frac{{B_m}^{2}}{\frac{C}{F}}}\right)}{B_m}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{2}}{B_m} \cdot \left(-\sqrt{F} \cdot \sqrt{B_m + C}\right)\\
\end{array}
\end{array}
if B < 1.90000000000000011e-189Initial program 22.0%
Simplified27.1%
Taylor expanded in C around -inf 17.1%
if 1.90000000000000011e-189 < B < 2.2e-55Initial program 28.4%
Simplified46.2%
Taylor expanded in A around -inf 24.2%
if 2.2e-55 < B < 1.15e17Initial program 21.0%
Simplified22.5%
Taylor expanded in A around 0 32.9%
mul-1-neg32.9%
distribute-rgt-neg-in32.9%
unpow232.9%
unpow232.9%
hypot-def33.8%
Simplified33.8%
associate-*l/33.8%
Applied egg-rr33.8%
Taylor expanded in C around -inf 50.6%
associate-/l*50.2%
Simplified50.0%
if 1.15e17 < B Initial program 17.8%
Simplified23.5%
Taylor expanded in A around 0 20.0%
mul-1-neg20.0%
distribute-rgt-neg-in20.0%
unpow220.0%
unpow220.0%
hypot-def46.6%
Simplified46.6%
pow1/246.7%
*-commutative46.7%
unpow-prod-down70.1%
pow1/270.1%
pow1/270.1%
Applied egg-rr70.0%
Taylor expanded in C around 0 59.0%
Final simplification30.3%
B_m = (fabs.f64 B)
(FPCore (A B_m C F)
:precision binary64
(let* ((t_0 (* -4.0 (* A (* C F))))
(t_1 (/ (sqrt 2.0) B_m))
(t_2 (fma B_m B_m (* A (* C -4.0)))))
(if (<= B_m 4e-188)
(/ 1.0 (/ t_2 (- (sqrt (* 2.0 (* (+ A A) t_0))))))
(if (<= B_m 7.4e-61)
(/ 1.0 (/ t_2 (- (sqrt (* 2.0 (* (* 2.0 C) t_0))))))
(if (<= B_m 1.3e+18)
(* t_1 (- (sqrt (* -0.5 (/ (pow B_m 2.0) (/ C F))))))
(* t_1 (- (* (sqrt F) (sqrt (+ B_m C))))))))))B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
double t_0 = -4.0 * (A * (C * F));
double t_1 = sqrt(2.0) / B_m;
double t_2 = fma(B_m, B_m, (A * (C * -4.0)));
double tmp;
if (B_m <= 4e-188) {
tmp = 1.0 / (t_2 / -sqrt((2.0 * ((A + A) * t_0))));
} else if (B_m <= 7.4e-61) {
tmp = 1.0 / (t_2 / -sqrt((2.0 * ((2.0 * C) * t_0))));
} else if (B_m <= 1.3e+18) {
tmp = t_1 * -sqrt((-0.5 * (pow(B_m, 2.0) / (C / F))));
} else {
tmp = t_1 * -(sqrt(F) * sqrt((B_m + C)));
}
return tmp;
}
B_m = abs(B) function code(A, B_m, C, F) t_0 = Float64(-4.0 * Float64(A * Float64(C * F))) t_1 = Float64(sqrt(2.0) / B_m) t_2 = fma(B_m, B_m, Float64(A * Float64(C * -4.0))) tmp = 0.0 if (B_m <= 4e-188) tmp = Float64(1.0 / Float64(t_2 / Float64(-sqrt(Float64(2.0 * Float64(Float64(A + A) * t_0)))))); elseif (B_m <= 7.4e-61) tmp = Float64(1.0 / Float64(t_2 / Float64(-sqrt(Float64(2.0 * Float64(Float64(2.0 * C) * t_0)))))); elseif (B_m <= 1.3e+18) tmp = Float64(t_1 * Float64(-sqrt(Float64(-0.5 * Float64((B_m ^ 2.0) / Float64(C / F)))))); else tmp = Float64(t_1 * Float64(-Float64(sqrt(F) * sqrt(Float64(B_m + C))))); end return tmp end
B_m = N[Abs[B], $MachinePrecision]
code[A_, B$95$m_, C_, F_] := Block[{t$95$0 = N[(-4.0 * N[(A * N[(C * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[Sqrt[2.0], $MachinePrecision] / B$95$m), $MachinePrecision]}, Block[{t$95$2 = N[(B$95$m * B$95$m + N[(A * N[(C * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[B$95$m, 4e-188], N[(1.0 / N[(t$95$2 / (-N[Sqrt[N[(2.0 * N[(N[(A + A), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]), $MachinePrecision], If[LessEqual[B$95$m, 7.4e-61], N[(1.0 / N[(t$95$2 / (-N[Sqrt[N[(2.0 * N[(N[(2.0 * C), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]), $MachinePrecision], If[LessEqual[B$95$m, 1.3e+18], N[(t$95$1 * (-N[Sqrt[N[(-0.5 * N[(N[Power[B$95$m, 2.0], $MachinePrecision] / N[(C / F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision], N[(t$95$1 * (-N[(N[Sqrt[F], $MachinePrecision] * N[Sqrt[N[(B$95$m + C), $MachinePrecision]], $MachinePrecision]), $MachinePrecision])), $MachinePrecision]]]]]]]
\begin{array}{l}
B_m = \left|B\right|
\\
\begin{array}{l}
t_0 := -4 \cdot \left(A \cdot \left(C \cdot F\right)\right)\\
t_1 := \frac{\sqrt{2}}{B_m}\\
t_2 := \mathsf{fma}\left(B_m, B_m, A \cdot \left(C \cdot -4\right)\right)\\
\mathbf{if}\;B_m \leq 4 \cdot 10^{-188}:\\
\;\;\;\;\frac{1}{\frac{t_2}{-\sqrt{2 \cdot \left(\left(A + A\right) \cdot t_0\right)}}}\\
\mathbf{elif}\;B_m \leq 7.4 \cdot 10^{-61}:\\
\;\;\;\;\frac{1}{\frac{t_2}{-\sqrt{2 \cdot \left(\left(2 \cdot C\right) \cdot t_0\right)}}}\\
\mathbf{elif}\;B_m \leq 1.3 \cdot 10^{+18}:\\
\;\;\;\;t_1 \cdot \left(-\sqrt{-0.5 \cdot \frac{{B_m}^{2}}{\frac{C}{F}}}\right)\\
\mathbf{else}:\\
\;\;\;\;t_1 \cdot \left(-\sqrt{F} \cdot \sqrt{B_m + C}\right)\\
\end{array}
\end{array}
if B < 3.9999999999999998e-188Initial program 22.0%
clear-num22.0%
inv-pow22.0%
Applied egg-rr27.0%
Simplified27.0%
Taylor expanded in B around 0 18.3%
Taylor expanded in C around -inf 16.6%
if 3.9999999999999998e-188 < B < 7.3999999999999999e-61Initial program 28.4%
clear-num28.3%
inv-pow28.3%
Applied egg-rr46.0%
Simplified46.0%
Taylor expanded in B around 0 21.8%
Taylor expanded in A around -inf 16.6%
if 7.3999999999999999e-61 < B < 1.3e18Initial program 21.0%
Simplified22.5%
Taylor expanded in A around 0 32.9%
mul-1-neg32.9%
distribute-rgt-neg-in32.9%
unpow232.9%
unpow232.9%
hypot-def33.8%
Simplified33.8%
Taylor expanded in C around -inf 50.6%
associate-/l*50.2%
Simplified50.2%
if 1.3e18 < B Initial program 17.8%
Simplified23.5%
Taylor expanded in A around 0 20.0%
mul-1-neg20.0%
distribute-rgt-neg-in20.0%
unpow220.0%
unpow220.0%
hypot-def46.6%
Simplified46.6%
pow1/246.7%
*-commutative46.7%
unpow-prod-down70.1%
pow1/270.1%
pow1/270.1%
Applied egg-rr70.0%
Taylor expanded in C around 0 59.0%
Final simplification29.3%
B_m = (fabs.f64 B)
(FPCore (A B_m C F)
:precision binary64
(let* ((t_0 (* -4.0 (* A (* C F)))) (t_1 (fma B_m B_m (* A (* C -4.0)))))
(if (<= B_m 2.8e-194)
(/ 1.0 (/ t_1 (- (sqrt (* 2.0 (* (+ A A) t_0))))))
(if (<= B_m 2.2e-61)
(/ 1.0 (/ t_1 (- (sqrt (* 2.0 (* (* 2.0 C) t_0))))))
(if (<= B_m 2.4e+19)
(/ (* (sqrt 2.0) (- (sqrt (* -0.5 (/ (pow B_m 2.0) (/ C F)))))) B_m)
(* (/ (sqrt 2.0) B_m) (- (* (sqrt F) (sqrt (+ B_m C))))))))))B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
double t_0 = -4.0 * (A * (C * F));
double t_1 = fma(B_m, B_m, (A * (C * -4.0)));
double tmp;
if (B_m <= 2.8e-194) {
tmp = 1.0 / (t_1 / -sqrt((2.0 * ((A + A) * t_0))));
} else if (B_m <= 2.2e-61) {
tmp = 1.0 / (t_1 / -sqrt((2.0 * ((2.0 * C) * t_0))));
} else if (B_m <= 2.4e+19) {
tmp = (sqrt(2.0) * -sqrt((-0.5 * (pow(B_m, 2.0) / (C / F))))) / B_m;
} else {
tmp = (sqrt(2.0) / B_m) * -(sqrt(F) * sqrt((B_m + C)));
}
return tmp;
}
B_m = abs(B) function code(A, B_m, C, F) t_0 = Float64(-4.0 * Float64(A * Float64(C * F))) t_1 = fma(B_m, B_m, Float64(A * Float64(C * -4.0))) tmp = 0.0 if (B_m <= 2.8e-194) tmp = Float64(1.0 / Float64(t_1 / Float64(-sqrt(Float64(2.0 * Float64(Float64(A + A) * t_0)))))); elseif (B_m <= 2.2e-61) tmp = Float64(1.0 / Float64(t_1 / Float64(-sqrt(Float64(2.0 * Float64(Float64(2.0 * C) * t_0)))))); elseif (B_m <= 2.4e+19) tmp = Float64(Float64(sqrt(2.0) * Float64(-sqrt(Float64(-0.5 * Float64((B_m ^ 2.0) / Float64(C / F)))))) / B_m); else tmp = Float64(Float64(sqrt(2.0) / B_m) * Float64(-Float64(sqrt(F) * sqrt(Float64(B_m + C))))); end return tmp end
B_m = N[Abs[B], $MachinePrecision]
code[A_, B$95$m_, C_, F_] := Block[{t$95$0 = N[(-4.0 * N[(A * N[(C * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(B$95$m * B$95$m + N[(A * N[(C * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[B$95$m, 2.8e-194], N[(1.0 / N[(t$95$1 / (-N[Sqrt[N[(2.0 * N[(N[(A + A), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]), $MachinePrecision], If[LessEqual[B$95$m, 2.2e-61], N[(1.0 / N[(t$95$1 / (-N[Sqrt[N[(2.0 * N[(N[(2.0 * C), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]), $MachinePrecision], If[LessEqual[B$95$m, 2.4e+19], N[(N[(N[Sqrt[2.0], $MachinePrecision] * (-N[Sqrt[N[(-0.5 * N[(N[Power[B$95$m, 2.0], $MachinePrecision] / N[(C / F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision] / B$95$m), $MachinePrecision], N[(N[(N[Sqrt[2.0], $MachinePrecision] / B$95$m), $MachinePrecision] * (-N[(N[Sqrt[F], $MachinePrecision] * N[Sqrt[N[(B$95$m + C), $MachinePrecision]], $MachinePrecision]), $MachinePrecision])), $MachinePrecision]]]]]]
\begin{array}{l}
B_m = \left|B\right|
\\
\begin{array}{l}
t_0 := -4 \cdot \left(A \cdot \left(C \cdot F\right)\right)\\
t_1 := \mathsf{fma}\left(B_m, B_m, A \cdot \left(C \cdot -4\right)\right)\\
\mathbf{if}\;B_m \leq 2.8 \cdot 10^{-194}:\\
\;\;\;\;\frac{1}{\frac{t_1}{-\sqrt{2 \cdot \left(\left(A + A\right) \cdot t_0\right)}}}\\
\mathbf{elif}\;B_m \leq 2.2 \cdot 10^{-61}:\\
\;\;\;\;\frac{1}{\frac{t_1}{-\sqrt{2 \cdot \left(\left(2 \cdot C\right) \cdot t_0\right)}}}\\
\mathbf{elif}\;B_m \leq 2.4 \cdot 10^{+19}:\\
\;\;\;\;\frac{\sqrt{2} \cdot \left(-\sqrt{-0.5 \cdot \frac{{B_m}^{2}}{\frac{C}{F}}}\right)}{B_m}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{2}}{B_m} \cdot \left(-\sqrt{F} \cdot \sqrt{B_m + C}\right)\\
\end{array}
\end{array}
if B < 2.80000000000000011e-194Initial program 22.0%
clear-num22.0%
inv-pow22.0%
Applied egg-rr27.0%
Simplified27.0%
Taylor expanded in B around 0 18.3%
Taylor expanded in C around -inf 16.6%
if 2.80000000000000011e-194 < B < 2.20000000000000009e-61Initial program 28.4%
clear-num28.3%
inv-pow28.3%
Applied egg-rr46.0%
Simplified46.0%
Taylor expanded in B around 0 21.8%
Taylor expanded in A around -inf 16.6%
if 2.20000000000000009e-61 < B < 2.4e19Initial program 21.0%
Simplified22.5%
Taylor expanded in A around 0 32.9%
mul-1-neg32.9%
distribute-rgt-neg-in32.9%
unpow232.9%
unpow232.9%
hypot-def33.8%
Simplified33.8%
associate-*l/33.8%
Applied egg-rr33.8%
Taylor expanded in C around -inf 50.6%
associate-/l*50.2%
Simplified50.0%
if 2.4e19 < B Initial program 17.8%
Simplified23.5%
Taylor expanded in A around 0 20.0%
mul-1-neg20.0%
distribute-rgt-neg-in20.0%
unpow220.0%
unpow220.0%
hypot-def46.6%
Simplified46.6%
pow1/246.7%
*-commutative46.7%
unpow-prod-down70.1%
pow1/270.1%
pow1/270.1%
Applied egg-rr70.0%
Taylor expanded in C around 0 59.0%
Final simplification29.3%
B_m = (fabs.f64 B)
(FPCore (A B_m C F)
:precision binary64
(let* ((t_0 (* -4.0 (* A (* C F)))) (t_1 (fma B_m B_m (* A (* C -4.0)))))
(if (<= B_m 8e-193)
(/ 1.0 (/ t_1 (- (sqrt (* 2.0 (* (+ A A) t_0))))))
(if (<= B_m 9.2e-50)
(/ 1.0 (/ t_1 (- (sqrt (* 2.0 (* (* 2.0 C) t_0))))))
(* (/ (sqrt 2.0) B_m) (- (* (sqrt F) (sqrt (+ B_m C)))))))))B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
double t_0 = -4.0 * (A * (C * F));
double t_1 = fma(B_m, B_m, (A * (C * -4.0)));
double tmp;
if (B_m <= 8e-193) {
tmp = 1.0 / (t_1 / -sqrt((2.0 * ((A + A) * t_0))));
} else if (B_m <= 9.2e-50) {
tmp = 1.0 / (t_1 / -sqrt((2.0 * ((2.0 * C) * t_0))));
} else {
tmp = (sqrt(2.0) / B_m) * -(sqrt(F) * sqrt((B_m + C)));
}
return tmp;
}
B_m = abs(B) function code(A, B_m, C, F) t_0 = Float64(-4.0 * Float64(A * Float64(C * F))) t_1 = fma(B_m, B_m, Float64(A * Float64(C * -4.0))) tmp = 0.0 if (B_m <= 8e-193) tmp = Float64(1.0 / Float64(t_1 / Float64(-sqrt(Float64(2.0 * Float64(Float64(A + A) * t_0)))))); elseif (B_m <= 9.2e-50) tmp = Float64(1.0 / Float64(t_1 / Float64(-sqrt(Float64(2.0 * Float64(Float64(2.0 * C) * t_0)))))); else tmp = Float64(Float64(sqrt(2.0) / B_m) * Float64(-Float64(sqrt(F) * sqrt(Float64(B_m + C))))); end return tmp end
B_m = N[Abs[B], $MachinePrecision]
code[A_, B$95$m_, C_, F_] := Block[{t$95$0 = N[(-4.0 * N[(A * N[(C * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(B$95$m * B$95$m + N[(A * N[(C * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[B$95$m, 8e-193], N[(1.0 / N[(t$95$1 / (-N[Sqrt[N[(2.0 * N[(N[(A + A), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]), $MachinePrecision], If[LessEqual[B$95$m, 9.2e-50], N[(1.0 / N[(t$95$1 / (-N[Sqrt[N[(2.0 * N[(N[(2.0 * C), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[2.0], $MachinePrecision] / B$95$m), $MachinePrecision] * (-N[(N[Sqrt[F], $MachinePrecision] * N[Sqrt[N[(B$95$m + C), $MachinePrecision]], $MachinePrecision]), $MachinePrecision])), $MachinePrecision]]]]]
\begin{array}{l}
B_m = \left|B\right|
\\
\begin{array}{l}
t_0 := -4 \cdot \left(A \cdot \left(C \cdot F\right)\right)\\
t_1 := \mathsf{fma}\left(B_m, B_m, A \cdot \left(C \cdot -4\right)\right)\\
\mathbf{if}\;B_m \leq 8 \cdot 10^{-193}:\\
\;\;\;\;\frac{1}{\frac{t_1}{-\sqrt{2 \cdot \left(\left(A + A\right) \cdot t_0\right)}}}\\
\mathbf{elif}\;B_m \leq 9.2 \cdot 10^{-50}:\\
\;\;\;\;\frac{1}{\frac{t_1}{-\sqrt{2 \cdot \left(\left(2 \cdot C\right) \cdot t_0\right)}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{2}}{B_m} \cdot \left(-\sqrt{F} \cdot \sqrt{B_m + C}\right)\\
\end{array}
\end{array}
if B < 8.0000000000000004e-193Initial program 22.0%
clear-num22.0%
inv-pow22.0%
Applied egg-rr27.0%
Simplified27.0%
Taylor expanded in B around 0 18.3%
Taylor expanded in C around -inf 16.6%
if 8.0000000000000004e-193 < B < 9.20000000000000078e-50Initial program 28.4%
clear-num28.3%
inv-pow28.3%
Applied egg-rr46.0%
Simplified46.0%
Taylor expanded in B around 0 21.8%
Taylor expanded in A around -inf 16.6%
if 9.20000000000000078e-50 < B Initial program 18.2%
Simplified23.4%
Taylor expanded in A around 0 21.4%
mul-1-neg21.4%
distribute-rgt-neg-in21.4%
unpow221.4%
unpow221.4%
hypot-def45.3%
Simplified45.3%
pow1/245.4%
*-commutative45.4%
unpow-prod-down66.4%
pow1/266.4%
pow1/266.4%
Applied egg-rr66.3%
Taylor expanded in C around 0 56.2%
Final simplification28.7%
B_m = (fabs.f64 B)
(FPCore (A B_m C F)
:precision binary64
(let* ((t_0 (* -4.0 (* A (* C F)))) (t_1 (fma B_m B_m (* A (* C -4.0)))))
(if (<= B_m 3.6e-194)
(/ 1.0 (/ t_1 (- (sqrt (* 2.0 (* (+ A A) t_0))))))
(if (<= B_m 2.8e-49)
(/ 1.0 (/ t_1 (- (sqrt (* 2.0 (* (* 2.0 C) t_0))))))
(* (/ (sqrt F) (sqrt B_m)) (- (sqrt 2.0)))))))B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
double t_0 = -4.0 * (A * (C * F));
double t_1 = fma(B_m, B_m, (A * (C * -4.0)));
double tmp;
if (B_m <= 3.6e-194) {
tmp = 1.0 / (t_1 / -sqrt((2.0 * ((A + A) * t_0))));
} else if (B_m <= 2.8e-49) {
tmp = 1.0 / (t_1 / -sqrt((2.0 * ((2.0 * C) * t_0))));
} else {
tmp = (sqrt(F) / sqrt(B_m)) * -sqrt(2.0);
}
return tmp;
}
B_m = abs(B) function code(A, B_m, C, F) t_0 = Float64(-4.0 * Float64(A * Float64(C * F))) t_1 = fma(B_m, B_m, Float64(A * Float64(C * -4.0))) tmp = 0.0 if (B_m <= 3.6e-194) tmp = Float64(1.0 / Float64(t_1 / Float64(-sqrt(Float64(2.0 * Float64(Float64(A + A) * t_0)))))); elseif (B_m <= 2.8e-49) tmp = Float64(1.0 / Float64(t_1 / Float64(-sqrt(Float64(2.0 * Float64(Float64(2.0 * C) * t_0)))))); else tmp = Float64(Float64(sqrt(F) / sqrt(B_m)) * Float64(-sqrt(2.0))); end return tmp end
B_m = N[Abs[B], $MachinePrecision]
code[A_, B$95$m_, C_, F_] := Block[{t$95$0 = N[(-4.0 * N[(A * N[(C * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(B$95$m * B$95$m + N[(A * N[(C * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[B$95$m, 3.6e-194], N[(1.0 / N[(t$95$1 / (-N[Sqrt[N[(2.0 * N[(N[(A + A), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]), $MachinePrecision], If[LessEqual[B$95$m, 2.8e-49], N[(1.0 / N[(t$95$1 / (-N[Sqrt[N[(2.0 * N[(N[(2.0 * C), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[F], $MachinePrecision] / N[Sqrt[B$95$m], $MachinePrecision]), $MachinePrecision] * (-N[Sqrt[2.0], $MachinePrecision])), $MachinePrecision]]]]]
\begin{array}{l}
B_m = \left|B\right|
\\
\begin{array}{l}
t_0 := -4 \cdot \left(A \cdot \left(C \cdot F\right)\right)\\
t_1 := \mathsf{fma}\left(B_m, B_m, A \cdot \left(C \cdot -4\right)\right)\\
\mathbf{if}\;B_m \leq 3.6 \cdot 10^{-194}:\\
\;\;\;\;\frac{1}{\frac{t_1}{-\sqrt{2 \cdot \left(\left(A + A\right) \cdot t_0\right)}}}\\
\mathbf{elif}\;B_m \leq 2.8 \cdot 10^{-49}:\\
\;\;\;\;\frac{1}{\frac{t_1}{-\sqrt{2 \cdot \left(\left(2 \cdot C\right) \cdot t_0\right)}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{F}}{\sqrt{B_m}} \cdot \left(-\sqrt{2}\right)\\
\end{array}
\end{array}
if B < 3.6e-194Initial program 22.0%
clear-num22.0%
inv-pow22.0%
Applied egg-rr27.0%
Simplified27.0%
Taylor expanded in B around 0 18.3%
Taylor expanded in C around -inf 16.6%
if 3.6e-194 < B < 2.79999999999999997e-49Initial program 28.4%
clear-num28.3%
inv-pow28.3%
Applied egg-rr46.0%
Simplified46.0%
Taylor expanded in B around 0 21.8%
Taylor expanded in A around -inf 16.6%
if 2.79999999999999997e-49 < B Initial program 18.2%
Simplified23.4%
Taylor expanded in A around 0 21.4%
mul-1-neg21.4%
distribute-rgt-neg-in21.4%
unpow221.4%
unpow221.4%
hypot-def45.3%
Simplified45.3%
Taylor expanded in C around 0 43.4%
mul-1-neg43.4%
Simplified43.4%
sqrt-div54.3%
Applied egg-rr54.3%
Final simplification28.1%
B_m = (fabs.f64 B)
(FPCore (A B_m C F)
:precision binary64
(if (<= F -7.6e-293)
(/
1.0
(/
(fma B_m B_m (* A (* C -4.0)))
(- (sqrt (* 2.0 (* (* 2.0 C) (* -4.0 (* A (* C F)))))))))
(if (<= F 1.95e+32)
(/ (sqrt (* (* 2.0 F) (+ C (hypot C B_m)))) (- B_m))
(/ 1.0 (- (/ (sqrt (/ B_m F)) (sqrt 2.0)))))))B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
double tmp;
if (F <= -7.6e-293) {
tmp = 1.0 / (fma(B_m, B_m, (A * (C * -4.0))) / -sqrt((2.0 * ((2.0 * C) * (-4.0 * (A * (C * F)))))));
} else if (F <= 1.95e+32) {
tmp = sqrt(((2.0 * F) * (C + hypot(C, B_m)))) / -B_m;
} else {
tmp = 1.0 / -(sqrt((B_m / F)) / sqrt(2.0));
}
return tmp;
}
B_m = abs(B) function code(A, B_m, C, F) tmp = 0.0 if (F <= -7.6e-293) tmp = Float64(1.0 / Float64(fma(B_m, B_m, Float64(A * Float64(C * -4.0))) / Float64(-sqrt(Float64(2.0 * Float64(Float64(2.0 * C) * Float64(-4.0 * Float64(A * Float64(C * F))))))))); elseif (F <= 1.95e+32) tmp = Float64(sqrt(Float64(Float64(2.0 * F) * Float64(C + hypot(C, B_m)))) / Float64(-B_m)); else tmp = Float64(1.0 / Float64(-Float64(sqrt(Float64(B_m / F)) / sqrt(2.0)))); end return tmp end
B_m = N[Abs[B], $MachinePrecision] code[A_, B$95$m_, C_, F_] := If[LessEqual[F, -7.6e-293], N[(1.0 / N[(N[(B$95$m * B$95$m + N[(A * N[(C * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / (-N[Sqrt[N[(2.0 * N[(N[(2.0 * C), $MachinePrecision] * N[(-4.0 * N[(A * N[(C * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.95e+32], N[(N[Sqrt[N[(N[(2.0 * F), $MachinePrecision] * N[(C + N[Sqrt[C ^ 2 + B$95$m ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / (-B$95$m)), $MachinePrecision], N[(1.0 / (-N[(N[Sqrt[N[(B$95$m / F), $MachinePrecision]], $MachinePrecision] / N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision])), $MachinePrecision]]]
\begin{array}{l}
B_m = \left|B\right|
\\
\begin{array}{l}
\mathbf{if}\;F \leq -7.6 \cdot 10^{-293}:\\
\;\;\;\;\frac{1}{\frac{\mathsf{fma}\left(B_m, B_m, A \cdot \left(C \cdot -4\right)\right)}{-\sqrt{2 \cdot \left(\left(2 \cdot C\right) \cdot \left(-4 \cdot \left(A \cdot \left(C \cdot F\right)\right)\right)\right)}}}\\
\mathbf{elif}\;F \leq 1.95 \cdot 10^{+32}:\\
\;\;\;\;\frac{\sqrt{\left(2 \cdot F\right) \cdot \left(C + \mathsf{hypot}\left(C, B_m\right)\right)}}{-B_m}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{-\frac{\sqrt{\frac{B_m}{F}}}{\sqrt{2}}}\\
\end{array}
\end{array}
if F < -7.6e-293Initial program 29.9%
clear-num29.9%
inv-pow29.9%
Applied egg-rr48.5%
Simplified48.5%
Taylor expanded in B around 0 45.2%
Taylor expanded in A around -inf 18.8%
if -7.6e-293 < F < 1.95e32Initial program 26.0%
Simplified31.5%
Taylor expanded in A around 0 13.3%
mul-1-neg13.3%
distribute-rgt-neg-in13.3%
unpow213.3%
unpow213.3%
hypot-def27.5%
Simplified27.5%
pow1/227.6%
*-commutative27.6%
unpow-prod-down27.5%
pow1/227.5%
pow1/227.5%
Applied egg-rr27.4%
associate-*l/27.5%
*-commutative27.5%
sqrt-prod27.6%
expm1-log1p-u27.2%
expm1-udef4.8%
Applied egg-rr4.8%
expm1-def27.3%
expm1-log1p27.6%
*-lft-identity27.6%
metadata-eval27.6%
times-frac27.6%
neg-mul-127.6%
neg-mul-127.6%
remove-double-neg27.6%
unpow1/227.6%
associate-*r*27.6%
Simplified27.6%
if 1.95e32 < F Initial program 13.3%
clear-num13.3%
inv-pow13.3%
Applied egg-rr16.6%
Simplified16.6%
Taylor expanded in A around 0 7.4%
mul-1-neg7.4%
associate-/r*8.2%
+-commutative8.2%
Simplified8.2%
Taylor expanded in C around 0 21.8%
associate-*r/21.8%
*-rgt-identity21.8%
Simplified21.8%
Final simplification24.2%
B_m = (fabs.f64 B)
(FPCore (A B_m C F)
:precision binary64
(if (<= F -1.5e-299)
(/
1.0
(/
(fma B_m B_m (* A (* C -4.0)))
(- (sqrt (* 2.0 (* (+ A A) (* -4.0 (* A (* C F)))))))))
(if (<= F 8.8e+34)
(/ (sqrt (* (* 2.0 F) (+ C (hypot C B_m)))) (- B_m))
(/ 1.0 (- (/ (sqrt (/ B_m F)) (sqrt 2.0)))))))B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
double tmp;
if (F <= -1.5e-299) {
tmp = 1.0 / (fma(B_m, B_m, (A * (C * -4.0))) / -sqrt((2.0 * ((A + A) * (-4.0 * (A * (C * F)))))));
} else if (F <= 8.8e+34) {
tmp = sqrt(((2.0 * F) * (C + hypot(C, B_m)))) / -B_m;
} else {
tmp = 1.0 / -(sqrt((B_m / F)) / sqrt(2.0));
}
return tmp;
}
B_m = abs(B) function code(A, B_m, C, F) tmp = 0.0 if (F <= -1.5e-299) tmp = Float64(1.0 / Float64(fma(B_m, B_m, Float64(A * Float64(C * -4.0))) / Float64(-sqrt(Float64(2.0 * Float64(Float64(A + A) * Float64(-4.0 * Float64(A * Float64(C * F))))))))); elseif (F <= 8.8e+34) tmp = Float64(sqrt(Float64(Float64(2.0 * F) * Float64(C + hypot(C, B_m)))) / Float64(-B_m)); else tmp = Float64(1.0 / Float64(-Float64(sqrt(Float64(B_m / F)) / sqrt(2.0)))); end return tmp end
B_m = N[Abs[B], $MachinePrecision] code[A_, B$95$m_, C_, F_] := If[LessEqual[F, -1.5e-299], N[(1.0 / N[(N[(B$95$m * B$95$m + N[(A * N[(C * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / (-N[Sqrt[N[(2.0 * N[(N[(A + A), $MachinePrecision] * N[(-4.0 * N[(A * N[(C * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 8.8e+34], N[(N[Sqrt[N[(N[(2.0 * F), $MachinePrecision] * N[(C + N[Sqrt[C ^ 2 + B$95$m ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / (-B$95$m)), $MachinePrecision], N[(1.0 / (-N[(N[Sqrt[N[(B$95$m / F), $MachinePrecision]], $MachinePrecision] / N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision])), $MachinePrecision]]]
\begin{array}{l}
B_m = \left|B\right|
\\
\begin{array}{l}
\mathbf{if}\;F \leq -1.5 \cdot 10^{-299}:\\
\;\;\;\;\frac{1}{\frac{\mathsf{fma}\left(B_m, B_m, A \cdot \left(C \cdot -4\right)\right)}{-\sqrt{2 \cdot \left(\left(A + A\right) \cdot \left(-4 \cdot \left(A \cdot \left(C \cdot F\right)\right)\right)\right)}}}\\
\mathbf{elif}\;F \leq 8.8 \cdot 10^{+34}:\\
\;\;\;\;\frac{\sqrt{\left(2 \cdot F\right) \cdot \left(C + \mathsf{hypot}\left(C, B_m\right)\right)}}{-B_m}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{-\frac{\sqrt{\frac{B_m}{F}}}{\sqrt{2}}}\\
\end{array}
\end{array}
if F < -1.49999999999999992e-299Initial program 29.0%
clear-num29.0%
inv-pow29.0%
Applied egg-rr47.0%
Simplified47.0%
Taylor expanded in B around 0 43.8%
Taylor expanded in C around -inf 29.7%
if -1.49999999999999992e-299 < F < 8.8000000000000009e34Initial program 26.2%
Simplified31.8%
Taylor expanded in A around 0 13.4%
mul-1-neg13.4%
distribute-rgt-neg-in13.4%
unpow213.4%
unpow213.4%
hypot-def27.7%
Simplified27.7%
pow1/227.8%
*-commutative27.8%
unpow-prod-down27.7%
pow1/227.7%
pow1/227.7%
Applied egg-rr27.7%
associate-*l/27.7%
*-commutative27.7%
sqrt-prod27.8%
expm1-log1p-u27.4%
expm1-udef4.8%
Applied egg-rr4.8%
expm1-def27.5%
expm1-log1p27.9%
*-lft-identity27.9%
metadata-eval27.9%
times-frac27.9%
neg-mul-127.9%
neg-mul-127.9%
remove-double-neg27.9%
unpow1/227.9%
associate-*r*27.9%
Simplified27.9%
if 8.8000000000000009e34 < F Initial program 13.3%
clear-num13.3%
inv-pow13.3%
Applied egg-rr16.6%
Simplified16.6%
Taylor expanded in A around 0 7.4%
mul-1-neg7.4%
associate-/r*8.2%
+-commutative8.2%
Simplified8.2%
Taylor expanded in C around 0 21.8%
associate-*r/21.8%
*-rgt-identity21.8%
Simplified21.8%
Final simplification25.7%
B_m = (fabs.f64 B) (FPCore (A B_m C F) :precision binary64 (if (<= F 2.4e+34) (/ (sqrt (* (* 2.0 F) (+ C (hypot C B_m)))) (- B_m)) (/ 1.0 (- (/ (sqrt (/ B_m F)) (sqrt 2.0))))))
B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
double tmp;
if (F <= 2.4e+34) {
tmp = sqrt(((2.0 * F) * (C + hypot(C, B_m)))) / -B_m;
} else {
tmp = 1.0 / -(sqrt((B_m / F)) / sqrt(2.0));
}
return tmp;
}
B_m = Math.abs(B);
public static double code(double A, double B_m, double C, double F) {
double tmp;
if (F <= 2.4e+34) {
tmp = Math.sqrt(((2.0 * F) * (C + Math.hypot(C, B_m)))) / -B_m;
} else {
tmp = 1.0 / -(Math.sqrt((B_m / F)) / Math.sqrt(2.0));
}
return tmp;
}
B_m = math.fabs(B) def code(A, B_m, C, F): tmp = 0 if F <= 2.4e+34: tmp = math.sqrt(((2.0 * F) * (C + math.hypot(C, B_m)))) / -B_m else: tmp = 1.0 / -(math.sqrt((B_m / F)) / math.sqrt(2.0)) return tmp
B_m = abs(B) function code(A, B_m, C, F) tmp = 0.0 if (F <= 2.4e+34) tmp = Float64(sqrt(Float64(Float64(2.0 * F) * Float64(C + hypot(C, B_m)))) / Float64(-B_m)); else tmp = Float64(1.0 / Float64(-Float64(sqrt(Float64(B_m / F)) / sqrt(2.0)))); end return tmp end
B_m = abs(B); function tmp_2 = code(A, B_m, C, F) tmp = 0.0; if (F <= 2.4e+34) tmp = sqrt(((2.0 * F) * (C + hypot(C, B_m)))) / -B_m; else tmp = 1.0 / -(sqrt((B_m / F)) / sqrt(2.0)); end tmp_2 = tmp; end
B_m = N[Abs[B], $MachinePrecision] code[A_, B$95$m_, C_, F_] := If[LessEqual[F, 2.4e+34], N[(N[Sqrt[N[(N[(2.0 * F), $MachinePrecision] * N[(C + N[Sqrt[C ^ 2 + B$95$m ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / (-B$95$m)), $MachinePrecision], N[(1.0 / (-N[(N[Sqrt[N[(B$95$m / F), $MachinePrecision]], $MachinePrecision] / N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision])), $MachinePrecision]]
\begin{array}{l}
B_m = \left|B\right|
\\
\begin{array}{l}
\mathbf{if}\;F \leq 2.4 \cdot 10^{+34}:\\
\;\;\;\;\frac{\sqrt{\left(2 \cdot F\right) \cdot \left(C + \mathsf{hypot}\left(C, B_m\right)\right)}}{-B_m}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{-\frac{\sqrt{\frac{B_m}{F}}}{\sqrt{2}}}\\
\end{array}
\end{array}
if F < 2.39999999999999987e34Initial program 26.8%
Simplified35.0%
Taylor expanded in A around 0 10.6%
mul-1-neg10.6%
distribute-rgt-neg-in10.6%
unpow210.6%
unpow210.6%
hypot-def22.0%
Simplified22.0%
pow1/222.1%
*-commutative22.1%
unpow-prod-down22.0%
pow1/222.0%
pow1/222.0%
Applied egg-rr21.9%
associate-*l/22.0%
*-commutative22.0%
sqrt-prod22.0%
expm1-log1p-u21.7%
expm1-udef3.9%
Applied egg-rr3.9%
expm1-def21.9%
expm1-log1p22.2%
*-lft-identity22.2%
metadata-eval22.2%
times-frac22.2%
neg-mul-122.2%
neg-mul-122.2%
remove-double-neg22.2%
unpow1/222.1%
associate-*r*22.1%
Simplified22.1%
if 2.39999999999999987e34 < F Initial program 13.3%
clear-num13.3%
inv-pow13.3%
Applied egg-rr16.6%
Simplified16.6%
Taylor expanded in A around 0 7.4%
mul-1-neg7.4%
associate-/r*8.2%
+-commutative8.2%
Simplified8.2%
Taylor expanded in C around 0 21.8%
associate-*r/21.8%
*-rgt-identity21.8%
Simplified21.8%
Final simplification22.0%
B_m = (fabs.f64 B) (FPCore (A B_m C F) :precision binary64 (if (<= F 8e-33) (* (/ (sqrt 2.0) B_m) (- (sqrt (* F (+ B_m C))))) (/ 1.0 (- (/ (sqrt (/ B_m F)) (sqrt 2.0))))))
B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
double tmp;
if (F <= 8e-33) {
tmp = (sqrt(2.0) / B_m) * -sqrt((F * (B_m + C)));
} else {
tmp = 1.0 / -(sqrt((B_m / F)) / sqrt(2.0));
}
return tmp;
}
B_m = abs(B)
real(8) function code(a, b_m, c, f)
real(8), intent (in) :: a
real(8), intent (in) :: b_m
real(8), intent (in) :: c
real(8), intent (in) :: f
real(8) :: tmp
if (f <= 8d-33) then
tmp = (sqrt(2.0d0) / b_m) * -sqrt((f * (b_m + c)))
else
tmp = 1.0d0 / -(sqrt((b_m / f)) / sqrt(2.0d0))
end if
code = tmp
end function
B_m = Math.abs(B);
public static double code(double A, double B_m, double C, double F) {
double tmp;
if (F <= 8e-33) {
tmp = (Math.sqrt(2.0) / B_m) * -Math.sqrt((F * (B_m + C)));
} else {
tmp = 1.0 / -(Math.sqrt((B_m / F)) / Math.sqrt(2.0));
}
return tmp;
}
B_m = math.fabs(B) def code(A, B_m, C, F): tmp = 0 if F <= 8e-33: tmp = (math.sqrt(2.0) / B_m) * -math.sqrt((F * (B_m + C))) else: tmp = 1.0 / -(math.sqrt((B_m / F)) / math.sqrt(2.0)) return tmp
B_m = abs(B) function code(A, B_m, C, F) tmp = 0.0 if (F <= 8e-33) tmp = Float64(Float64(sqrt(2.0) / B_m) * Float64(-sqrt(Float64(F * Float64(B_m + C))))); else tmp = Float64(1.0 / Float64(-Float64(sqrt(Float64(B_m / F)) / sqrt(2.0)))); end return tmp end
B_m = abs(B); function tmp_2 = code(A, B_m, C, F) tmp = 0.0; if (F <= 8e-33) tmp = (sqrt(2.0) / B_m) * -sqrt((F * (B_m + C))); else tmp = 1.0 / -(sqrt((B_m / F)) / sqrt(2.0)); end tmp_2 = tmp; end
B_m = N[Abs[B], $MachinePrecision] code[A_, B$95$m_, C_, F_] := If[LessEqual[F, 8e-33], N[(N[(N[Sqrt[2.0], $MachinePrecision] / B$95$m), $MachinePrecision] * (-N[Sqrt[N[(F * N[(B$95$m + C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision], N[(1.0 / (-N[(N[Sqrt[N[(B$95$m / F), $MachinePrecision]], $MachinePrecision] / N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision])), $MachinePrecision]]
\begin{array}{l}
B_m = \left|B\right|
\\
\begin{array}{l}
\mathbf{if}\;F \leq 8 \cdot 10^{-33}:\\
\;\;\;\;\frac{\sqrt{2}}{B_m} \cdot \left(-\sqrt{F \cdot \left(B_m + C\right)}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{-\frac{\sqrt{\frac{B_m}{F}}}{\sqrt{2}}}\\
\end{array}
\end{array}
if F < 8.0000000000000004e-33Initial program 28.9%
Simplified38.1%
Taylor expanded in A around 0 11.6%
mul-1-neg11.6%
distribute-rgt-neg-in11.6%
unpow211.6%
unpow211.6%
hypot-def23.0%
Simplified23.0%
Taylor expanded in C around 0 17.0%
if 8.0000000000000004e-33 < F Initial program 13.1%
clear-num13.1%
inv-pow13.1%
Applied egg-rr16.0%
Simplified16.0%
Taylor expanded in A around 0 6.8%
mul-1-neg6.8%
associate-/r*7.5%
+-commutative7.5%
Simplified7.5%
Taylor expanded in C around 0 20.5%
associate-*r/20.5%
*-rgt-identity20.5%
Simplified20.5%
Final simplification18.7%
B_m = (fabs.f64 B) (FPCore (A B_m C F) :precision binary64 (if (<= F 1e-32) (/ (* (sqrt 2.0) (- (sqrt (* F (+ B_m C))))) B_m) (/ 1.0 (- (/ (sqrt (/ B_m F)) (sqrt 2.0))))))
B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
double tmp;
if (F <= 1e-32) {
tmp = (sqrt(2.0) * -sqrt((F * (B_m + C)))) / B_m;
} else {
tmp = 1.0 / -(sqrt((B_m / F)) / sqrt(2.0));
}
return tmp;
}
B_m = abs(B)
real(8) function code(a, b_m, c, f)
real(8), intent (in) :: a
real(8), intent (in) :: b_m
real(8), intent (in) :: c
real(8), intent (in) :: f
real(8) :: tmp
if (f <= 1d-32) then
tmp = (sqrt(2.0d0) * -sqrt((f * (b_m + c)))) / b_m
else
tmp = 1.0d0 / -(sqrt((b_m / f)) / sqrt(2.0d0))
end if
code = tmp
end function
B_m = Math.abs(B);
public static double code(double A, double B_m, double C, double F) {
double tmp;
if (F <= 1e-32) {
tmp = (Math.sqrt(2.0) * -Math.sqrt((F * (B_m + C)))) / B_m;
} else {
tmp = 1.0 / -(Math.sqrt((B_m / F)) / Math.sqrt(2.0));
}
return tmp;
}
B_m = math.fabs(B) def code(A, B_m, C, F): tmp = 0 if F <= 1e-32: tmp = (math.sqrt(2.0) * -math.sqrt((F * (B_m + C)))) / B_m else: tmp = 1.0 / -(math.sqrt((B_m / F)) / math.sqrt(2.0)) return tmp
B_m = abs(B) function code(A, B_m, C, F) tmp = 0.0 if (F <= 1e-32) tmp = Float64(Float64(sqrt(2.0) * Float64(-sqrt(Float64(F * Float64(B_m + C))))) / B_m); else tmp = Float64(1.0 / Float64(-Float64(sqrt(Float64(B_m / F)) / sqrt(2.0)))); end return tmp end
B_m = abs(B); function tmp_2 = code(A, B_m, C, F) tmp = 0.0; if (F <= 1e-32) tmp = (sqrt(2.0) * -sqrt((F * (B_m + C)))) / B_m; else tmp = 1.0 / -(sqrt((B_m / F)) / sqrt(2.0)); end tmp_2 = tmp; end
B_m = N[Abs[B], $MachinePrecision] code[A_, B$95$m_, C_, F_] := If[LessEqual[F, 1e-32], N[(N[(N[Sqrt[2.0], $MachinePrecision] * (-N[Sqrt[N[(F * N[(B$95$m + C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision] / B$95$m), $MachinePrecision], N[(1.0 / (-N[(N[Sqrt[N[(B$95$m / F), $MachinePrecision]], $MachinePrecision] / N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision])), $MachinePrecision]]
\begin{array}{l}
B_m = \left|B\right|
\\
\begin{array}{l}
\mathbf{if}\;F \leq 10^{-32}:\\
\;\;\;\;\frac{\sqrt{2} \cdot \left(-\sqrt{F \cdot \left(B_m + C\right)}\right)}{B_m}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{-\frac{\sqrt{\frac{B_m}{F}}}{\sqrt{2}}}\\
\end{array}
\end{array}
if F < 1.00000000000000006e-32Initial program 28.9%
Simplified38.1%
Taylor expanded in A around 0 11.6%
mul-1-neg11.6%
distribute-rgt-neg-in11.6%
unpow211.6%
unpow211.6%
hypot-def23.0%
Simplified23.0%
associate-*l/23.1%
Applied egg-rr23.1%
Taylor expanded in C around 0 17.0%
if 1.00000000000000006e-32 < F Initial program 13.1%
clear-num13.1%
inv-pow13.1%
Applied egg-rr16.0%
Simplified16.0%
Taylor expanded in A around 0 6.8%
mul-1-neg6.8%
associate-/r*7.5%
+-commutative7.5%
Simplified7.5%
Taylor expanded in C around 0 20.5%
associate-*r/20.5%
*-rgt-identity20.5%
Simplified20.5%
Final simplification18.7%
B_m = (fabs.f64 B) (FPCore (A B_m C F) :precision binary64 (if (<= F 4.4e-33) (* (/ (sqrt 2.0) B_m) (- (sqrt (* B_m F)))) (- (pow (* 2.0 (/ F B_m)) 0.5))))
B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
double tmp;
if (F <= 4.4e-33) {
tmp = (sqrt(2.0) / B_m) * -sqrt((B_m * F));
} else {
tmp = -pow((2.0 * (F / B_m)), 0.5);
}
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.4d-33) then
tmp = (sqrt(2.0d0) / b_m) * -sqrt((b_m * f))
else
tmp = -((2.0d0 * (f / b_m)) ** 0.5d0)
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.4e-33) {
tmp = (Math.sqrt(2.0) / B_m) * -Math.sqrt((B_m * F));
} else {
tmp = -Math.pow((2.0 * (F / B_m)), 0.5);
}
return tmp;
}
B_m = math.fabs(B) def code(A, B_m, C, F): tmp = 0 if F <= 4.4e-33: tmp = (math.sqrt(2.0) / B_m) * -math.sqrt((B_m * F)) else: tmp = -math.pow((2.0 * (F / B_m)), 0.5) return tmp
B_m = abs(B) function code(A, B_m, C, F) tmp = 0.0 if (F <= 4.4e-33) tmp = Float64(Float64(sqrt(2.0) / B_m) * Float64(-sqrt(Float64(B_m * F)))); else tmp = Float64(-(Float64(2.0 * Float64(F / B_m)) ^ 0.5)); end return tmp end
B_m = abs(B); function tmp_2 = code(A, B_m, C, F) tmp = 0.0; if (F <= 4.4e-33) tmp = (sqrt(2.0) / B_m) * -sqrt((B_m * F)); else tmp = -((2.0 * (F / B_m)) ^ 0.5); end tmp_2 = tmp; end
B_m = N[Abs[B], $MachinePrecision] code[A_, B$95$m_, C_, F_] := If[LessEqual[F, 4.4e-33], N[(N[(N[Sqrt[2.0], $MachinePrecision] / B$95$m), $MachinePrecision] * (-N[Sqrt[N[(B$95$m * F), $MachinePrecision]], $MachinePrecision])), $MachinePrecision], (-N[Power[N[(2.0 * N[(F / B$95$m), $MachinePrecision]), $MachinePrecision], 0.5], $MachinePrecision])]
\begin{array}{l}
B_m = \left|B\right|
\\
\begin{array}{l}
\mathbf{if}\;F \leq 4.4 \cdot 10^{-33}:\\
\;\;\;\;\frac{\sqrt{2}}{B_m} \cdot \left(-\sqrt{B_m \cdot F}\right)\\
\mathbf{else}:\\
\;\;\;\;-{\left(2 \cdot \frac{F}{B_m}\right)}^{0.5}\\
\end{array}
\end{array}
if F < 4.40000000000000011e-33Initial program 28.9%
Simplified38.1%
Taylor expanded in A around 0 11.6%
mul-1-neg11.6%
distribute-rgt-neg-in11.6%
unpow211.6%
unpow211.6%
hypot-def23.0%
Simplified23.0%
Taylor expanded in C around 0 17.1%
if 4.40000000000000011e-33 < F Initial program 13.1%
Simplified16.0%
Taylor expanded in A around 0 6.8%
mul-1-neg6.8%
distribute-rgt-neg-in6.8%
unpow26.8%
unpow26.8%
hypot-def10.3%
Simplified10.3%
Taylor expanded in C around 0 20.0%
mul-1-neg20.0%
Simplified20.0%
sqrt-unprod20.1%
pow1/220.3%
Applied egg-rr20.3%
Final simplification18.6%
B_m = (fabs.f64 B) (FPCore (A B_m C F) :precision binary64 (if (<= F 6e-33) (* (/ (sqrt 2.0) B_m) (- (sqrt (* B_m F)))) (/ 1.0 (- (/ (sqrt (/ B_m F)) (sqrt 2.0))))))
B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
double tmp;
if (F <= 6e-33) {
tmp = (sqrt(2.0) / B_m) * -sqrt((B_m * F));
} else {
tmp = 1.0 / -(sqrt((B_m / F)) / sqrt(2.0));
}
return tmp;
}
B_m = abs(B)
real(8) function code(a, b_m, c, f)
real(8), intent (in) :: a
real(8), intent (in) :: b_m
real(8), intent (in) :: c
real(8), intent (in) :: f
real(8) :: tmp
if (f <= 6d-33) then
tmp = (sqrt(2.0d0) / b_m) * -sqrt((b_m * f))
else
tmp = 1.0d0 / -(sqrt((b_m / f)) / sqrt(2.0d0))
end if
code = tmp
end function
B_m = Math.abs(B);
public static double code(double A, double B_m, double C, double F) {
double tmp;
if (F <= 6e-33) {
tmp = (Math.sqrt(2.0) / B_m) * -Math.sqrt((B_m * F));
} else {
tmp = 1.0 / -(Math.sqrt((B_m / F)) / Math.sqrt(2.0));
}
return tmp;
}
B_m = math.fabs(B) def code(A, B_m, C, F): tmp = 0 if F <= 6e-33: tmp = (math.sqrt(2.0) / B_m) * -math.sqrt((B_m * F)) else: tmp = 1.0 / -(math.sqrt((B_m / F)) / math.sqrt(2.0)) return tmp
B_m = abs(B) function code(A, B_m, C, F) tmp = 0.0 if (F <= 6e-33) tmp = Float64(Float64(sqrt(2.0) / B_m) * Float64(-sqrt(Float64(B_m * F)))); else tmp = Float64(1.0 / Float64(-Float64(sqrt(Float64(B_m / F)) / sqrt(2.0)))); end return tmp end
B_m = abs(B); function tmp_2 = code(A, B_m, C, F) tmp = 0.0; if (F <= 6e-33) tmp = (sqrt(2.0) / B_m) * -sqrt((B_m * F)); else tmp = 1.0 / -(sqrt((B_m / F)) / sqrt(2.0)); end tmp_2 = tmp; end
B_m = N[Abs[B], $MachinePrecision] code[A_, B$95$m_, C_, F_] := If[LessEqual[F, 6e-33], N[(N[(N[Sqrt[2.0], $MachinePrecision] / B$95$m), $MachinePrecision] * (-N[Sqrt[N[(B$95$m * F), $MachinePrecision]], $MachinePrecision])), $MachinePrecision], N[(1.0 / (-N[(N[Sqrt[N[(B$95$m / F), $MachinePrecision]], $MachinePrecision] / N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision])), $MachinePrecision]]
\begin{array}{l}
B_m = \left|B\right|
\\
\begin{array}{l}
\mathbf{if}\;F \leq 6 \cdot 10^{-33}:\\
\;\;\;\;\frac{\sqrt{2}}{B_m} \cdot \left(-\sqrt{B_m \cdot F}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{-\frac{\sqrt{\frac{B_m}{F}}}{\sqrt{2}}}\\
\end{array}
\end{array}
if F < 6.0000000000000003e-33Initial program 28.9%
Simplified38.1%
Taylor expanded in A around 0 11.6%
mul-1-neg11.6%
distribute-rgt-neg-in11.6%
unpow211.6%
unpow211.6%
hypot-def23.0%
Simplified23.0%
Taylor expanded in C around 0 17.1%
if 6.0000000000000003e-33 < F Initial program 13.1%
clear-num13.1%
inv-pow13.1%
Applied egg-rr16.0%
Simplified16.0%
Taylor expanded in A around 0 6.8%
mul-1-neg6.8%
associate-/r*7.5%
+-commutative7.5%
Simplified7.5%
Taylor expanded in C around 0 20.5%
associate-*r/20.5%
*-rgt-identity20.5%
Simplified20.5%
Final simplification18.7%
B_m = (fabs.f64 B) (FPCore (A B_m C F) :precision binary64 (if (<= F 5e-33) (/ (* (sqrt 2.0) (- (sqrt (* B_m F)))) B_m) (/ 1.0 (- (/ (sqrt (/ B_m F)) (sqrt 2.0))))))
B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
double tmp;
if (F <= 5e-33) {
tmp = (sqrt(2.0) * -sqrt((B_m * F))) / B_m;
} else {
tmp = 1.0 / -(sqrt((B_m / F)) / sqrt(2.0));
}
return tmp;
}
B_m = abs(B)
real(8) function code(a, b_m, c, f)
real(8), intent (in) :: a
real(8), intent (in) :: b_m
real(8), intent (in) :: c
real(8), intent (in) :: f
real(8) :: tmp
if (f <= 5d-33) then
tmp = (sqrt(2.0d0) * -sqrt((b_m * f))) / b_m
else
tmp = 1.0d0 / -(sqrt((b_m / f)) / sqrt(2.0d0))
end if
code = tmp
end function
B_m = Math.abs(B);
public static double code(double A, double B_m, double C, double F) {
double tmp;
if (F <= 5e-33) {
tmp = (Math.sqrt(2.0) * -Math.sqrt((B_m * F))) / B_m;
} else {
tmp = 1.0 / -(Math.sqrt((B_m / F)) / Math.sqrt(2.0));
}
return tmp;
}
B_m = math.fabs(B) def code(A, B_m, C, F): tmp = 0 if F <= 5e-33: tmp = (math.sqrt(2.0) * -math.sqrt((B_m * F))) / B_m else: tmp = 1.0 / -(math.sqrt((B_m / F)) / math.sqrt(2.0)) return tmp
B_m = abs(B) function code(A, B_m, C, F) tmp = 0.0 if (F <= 5e-33) tmp = Float64(Float64(sqrt(2.0) * Float64(-sqrt(Float64(B_m * F)))) / B_m); else tmp = Float64(1.0 / Float64(-Float64(sqrt(Float64(B_m / F)) / sqrt(2.0)))); end return tmp end
B_m = abs(B); function tmp_2 = code(A, B_m, C, F) tmp = 0.0; if (F <= 5e-33) tmp = (sqrt(2.0) * -sqrt((B_m * F))) / B_m; else tmp = 1.0 / -(sqrt((B_m / F)) / sqrt(2.0)); end tmp_2 = tmp; end
B_m = N[Abs[B], $MachinePrecision] code[A_, B$95$m_, C_, F_] := If[LessEqual[F, 5e-33], N[(N[(N[Sqrt[2.0], $MachinePrecision] * (-N[Sqrt[N[(B$95$m * F), $MachinePrecision]], $MachinePrecision])), $MachinePrecision] / B$95$m), $MachinePrecision], N[(1.0 / (-N[(N[Sqrt[N[(B$95$m / F), $MachinePrecision]], $MachinePrecision] / N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision])), $MachinePrecision]]
\begin{array}{l}
B_m = \left|B\right|
\\
\begin{array}{l}
\mathbf{if}\;F \leq 5 \cdot 10^{-33}:\\
\;\;\;\;\frac{\sqrt{2} \cdot \left(-\sqrt{B_m \cdot F}\right)}{B_m}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{-\frac{\sqrt{\frac{B_m}{F}}}{\sqrt{2}}}\\
\end{array}
\end{array}
if F < 5.00000000000000028e-33Initial program 28.9%
Simplified38.1%
Taylor expanded in A around 0 11.6%
mul-1-neg11.6%
distribute-rgt-neg-in11.6%
unpow211.6%
unpow211.6%
hypot-def23.0%
Simplified23.0%
associate-*l/23.1%
Applied egg-rr23.1%
Taylor expanded in C around 0 17.2%
if 5.00000000000000028e-33 < F Initial program 13.1%
clear-num13.1%
inv-pow13.1%
Applied egg-rr16.0%
Simplified16.0%
Taylor expanded in A around 0 6.8%
mul-1-neg6.8%
associate-/r*7.5%
+-commutative7.5%
Simplified7.5%
Taylor expanded in C around 0 20.5%
associate-*r/20.5%
*-rgt-identity20.5%
Simplified20.5%
Final simplification18.7%
B_m = (fabs.f64 B) (FPCore (A B_m C F) :precision binary64 (if (<= C 8.6e+145) (- (pow (* 2.0 (/ F B_m)) 0.5)) (* (/ 2.0 B_m) (- (sqrt (* C F))))))
B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
double tmp;
if (C <= 8.6e+145) {
tmp = -pow((2.0 * (F / B_m)), 0.5);
} else {
tmp = (2.0 / B_m) * -sqrt((C * F));
}
return tmp;
}
B_m = abs(B)
real(8) function code(a, b_m, c, f)
real(8), intent (in) :: a
real(8), intent (in) :: b_m
real(8), intent (in) :: c
real(8), intent (in) :: f
real(8) :: tmp
if (c <= 8.6d+145) then
tmp = -((2.0d0 * (f / b_m)) ** 0.5d0)
else
tmp = (2.0d0 / b_m) * -sqrt((c * f))
end if
code = tmp
end function
B_m = Math.abs(B);
public static double code(double A, double B_m, double C, double F) {
double tmp;
if (C <= 8.6e+145) {
tmp = -Math.pow((2.0 * (F / B_m)), 0.5);
} else {
tmp = (2.0 / B_m) * -Math.sqrt((C * F));
}
return tmp;
}
B_m = math.fabs(B) def code(A, B_m, C, F): tmp = 0 if C <= 8.6e+145: tmp = -math.pow((2.0 * (F / B_m)), 0.5) else: tmp = (2.0 / B_m) * -math.sqrt((C * F)) return tmp
B_m = abs(B) function code(A, B_m, C, F) tmp = 0.0 if (C <= 8.6e+145) tmp = Float64(-(Float64(2.0 * Float64(F / B_m)) ^ 0.5)); else tmp = Float64(Float64(2.0 / B_m) * Float64(-sqrt(Float64(C * F)))); end return tmp end
B_m = abs(B); function tmp_2 = code(A, B_m, C, F) tmp = 0.0; if (C <= 8.6e+145) tmp = -((2.0 * (F / B_m)) ^ 0.5); else tmp = (2.0 / B_m) * -sqrt((C * F)); end tmp_2 = tmp; end
B_m = N[Abs[B], $MachinePrecision] code[A_, B$95$m_, C_, F_] := If[LessEqual[C, 8.6e+145], (-N[Power[N[(2.0 * N[(F / B$95$m), $MachinePrecision]), $MachinePrecision], 0.5], $MachinePrecision]), N[(N[(2.0 / B$95$m), $MachinePrecision] * (-N[Sqrt[N[(C * F), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]]
\begin{array}{l}
B_m = \left|B\right|
\\
\begin{array}{l}
\mathbf{if}\;C \leq 8.6 \cdot 10^{+145}:\\
\;\;\;\;-{\left(2 \cdot \frac{F}{B_m}\right)}^{0.5}\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{B_m} \cdot \left(-\sqrt{C \cdot F}\right)\\
\end{array}
\end{array}
if C < 8.59999999999999996e145Initial program 23.6%
Simplified26.4%
Taylor expanded in A around 0 10.1%
mul-1-neg10.1%
distribute-rgt-neg-in10.1%
unpow210.1%
unpow210.1%
hypot-def16.3%
Simplified16.3%
Taylor expanded in C around 0 16.6%
mul-1-neg16.6%
Simplified16.6%
sqrt-unprod16.7%
pow1/216.8%
Applied egg-rr16.8%
if 8.59999999999999996e145 < C Initial program 7.5%
Simplified35.8%
Taylor expanded in A around 0 4.0%
mul-1-neg4.0%
distribute-rgt-neg-in4.0%
unpow24.0%
unpow24.0%
hypot-def21.2%
Simplified21.2%
pow1/221.7%
*-commutative21.7%
unpow-prod-down27.0%
pow1/227.0%
pow1/227.0%
Applied egg-rr26.8%
Taylor expanded in B around 0 18.7%
mul-1-neg18.7%
distribute-rgt-neg-in18.7%
unpow218.7%
rem-square-sqrt18.9%
Simplified18.9%
Final simplification17.1%
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 21.4%
Simplified27.7%
Taylor expanded in A around 0 9.3%
mul-1-neg9.3%
distribute-rgt-neg-in9.3%
unpow29.3%
unpow29.3%
hypot-def17.0%
Simplified17.0%
Taylor expanded in C around 0 14.8%
mul-1-neg14.8%
Simplified14.8%
sqrt-unprod14.9%
pow1/215.0%
Applied egg-rr15.0%
Final simplification15.0%
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 21.4%
Simplified27.7%
Taylor expanded in A around 0 9.3%
mul-1-neg9.3%
distribute-rgt-neg-in9.3%
unpow29.3%
unpow29.3%
hypot-def17.0%
Simplified17.0%
Taylor expanded in C around 0 14.8%
mul-1-neg14.8%
Simplified14.8%
sqrt-unprod14.9%
Applied egg-rr14.9%
Final simplification14.9%
herbie shell --seed 2024010
(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))))