
(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 (* C (* 4.0 A)))
(t_1 (* A (* C -4.0)))
(t_2 (hypot B_m (- A C)))
(t_3 (- t_0 (pow B_m 2.0)))
(t_4 (fma B_m B_m t_1))
(t_5 (- (pow B_m 2.0) t_0))
(t_6 (* 2.0 (* F t_5)))
(t_7
(/
(sqrt (* t_6 (+ (+ A C) (sqrt (+ (pow B_m 2.0) (pow (- A C) 2.0))))))
t_3)))
(if (<= t_7 -1e+204)
(/
(* (hypot B_m (sqrt t_1)) (* (sqrt (+ C (+ A t_2))) (sqrt (* 2.0 F))))
(- t_4))
(if (<= t_7 -5e-219)
(/ -1.0 (/ t_5 (sqrt (* 2.0 (* t_5 (* F (+ (+ A C) t_2)))))))
(if (<= t_7 1e-68)
(/ (sqrt (* t_6 (+ (* -0.5 (/ (pow B_m 2.0) A)) (* 2.0 C)))) t_3)
(if (<= t_7 INFINITY)
(/
(*
(sqrt (* (* 2.0 F) t_4))
(- (sqrt (+ (+ A C) (hypot (- A C) B_m)))))
t_4)
(*
(/ (sqrt 2.0) B_m)
(* (sqrt (+ C (hypot B_m C))) (- (sqrt F))))))))))B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
double t_0 = C * (4.0 * A);
double t_1 = A * (C * -4.0);
double t_2 = hypot(B_m, (A - C));
double t_3 = t_0 - pow(B_m, 2.0);
double t_4 = fma(B_m, B_m, t_1);
double t_5 = pow(B_m, 2.0) - t_0;
double t_6 = 2.0 * (F * t_5);
double t_7 = sqrt((t_6 * ((A + C) + sqrt((pow(B_m, 2.0) + pow((A - C), 2.0)))))) / t_3;
double tmp;
if (t_7 <= -1e+204) {
tmp = (hypot(B_m, sqrt(t_1)) * (sqrt((C + (A + t_2))) * sqrt((2.0 * F)))) / -t_4;
} else if (t_7 <= -5e-219) {
tmp = -1.0 / (t_5 / sqrt((2.0 * (t_5 * (F * ((A + C) + t_2))))));
} else if (t_7 <= 1e-68) {
tmp = sqrt((t_6 * ((-0.5 * (pow(B_m, 2.0) / A)) + (2.0 * C)))) / t_3;
} else if (t_7 <= ((double) INFINITY)) {
tmp = (sqrt(((2.0 * F) * t_4)) * -sqrt(((A + C) + hypot((A - C), B_m)))) / t_4;
} else {
tmp = (sqrt(2.0) / B_m) * (sqrt((C + hypot(B_m, C))) * -sqrt(F));
}
return tmp;
}
B_m = abs(B) function code(A, B_m, C, F) t_0 = Float64(C * Float64(4.0 * A)) t_1 = Float64(A * Float64(C * -4.0)) t_2 = hypot(B_m, Float64(A - C)) t_3 = Float64(t_0 - (B_m ^ 2.0)) t_4 = fma(B_m, B_m, t_1) t_5 = Float64((B_m ^ 2.0) - t_0) t_6 = Float64(2.0 * Float64(F * t_5)) t_7 = Float64(sqrt(Float64(t_6 * Float64(Float64(A + C) + sqrt(Float64((B_m ^ 2.0) + (Float64(A - C) ^ 2.0)))))) / t_3) tmp = 0.0 if (t_7 <= -1e+204) tmp = Float64(Float64(hypot(B_m, sqrt(t_1)) * Float64(sqrt(Float64(C + Float64(A + t_2))) * sqrt(Float64(2.0 * F)))) / Float64(-t_4)); elseif (t_7 <= -5e-219) tmp = Float64(-1.0 / Float64(t_5 / sqrt(Float64(2.0 * Float64(t_5 * Float64(F * Float64(Float64(A + C) + t_2))))))); elseif (t_7 <= 1e-68) tmp = Float64(sqrt(Float64(t_6 * Float64(Float64(-0.5 * Float64((B_m ^ 2.0) / A)) + Float64(2.0 * C)))) / t_3); elseif (t_7 <= Inf) tmp = Float64(Float64(sqrt(Float64(Float64(2.0 * F) * t_4)) * Float64(-sqrt(Float64(Float64(A + C) + hypot(Float64(A - C), B_m))))) / t_4); else tmp = Float64(Float64(sqrt(2.0) / B_m) * Float64(sqrt(Float64(C + hypot(B_m, C))) * Float64(-sqrt(F)))); end return tmp end
B_m = N[Abs[B], $MachinePrecision]
code[A_, B$95$m_, C_, F_] := Block[{t$95$0 = N[(C * N[(4.0 * A), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(A * N[(C * -4.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[B$95$m ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]}, Block[{t$95$3 = N[(t$95$0 - N[Power[B$95$m, 2.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(B$95$m * B$95$m + t$95$1), $MachinePrecision]}, Block[{t$95$5 = N[(N[Power[B$95$m, 2.0], $MachinePrecision] - t$95$0), $MachinePrecision]}, Block[{t$95$6 = N[(2.0 * N[(F * t$95$5), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$7 = N[(N[Sqrt[N[(t$95$6 * N[(N[(A + C), $MachinePrecision] + N[Sqrt[N[(N[Power[B$95$m, 2.0], $MachinePrecision] + N[Power[N[(A - C), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / t$95$3), $MachinePrecision]}, If[LessEqual[t$95$7, -1e+204], N[(N[(N[Sqrt[B$95$m ^ 2 + N[Sqrt[t$95$1], $MachinePrecision] ^ 2], $MachinePrecision] * N[(N[Sqrt[N[(C + N[(A + t$95$2), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(2.0 * F), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / (-t$95$4)), $MachinePrecision], If[LessEqual[t$95$7, -5e-219], N[(-1.0 / N[(t$95$5 / N[Sqrt[N[(2.0 * N[(t$95$5 * N[(F * N[(N[(A + C), $MachinePrecision] + t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$7, 1e-68], N[(N[Sqrt[N[(t$95$6 * N[(N[(-0.5 * N[(N[Power[B$95$m, 2.0], $MachinePrecision] / A), $MachinePrecision]), $MachinePrecision] + N[(2.0 * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / t$95$3), $MachinePrecision], If[LessEqual[t$95$7, Infinity], N[(N[(N[Sqrt[N[(N[(2.0 * F), $MachinePrecision] * t$95$4), $MachinePrecision]], $MachinePrecision] * (-N[Sqrt[N[(N[(A + C), $MachinePrecision] + N[Sqrt[N[(A - C), $MachinePrecision] ^ 2 + B$95$m ^ 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision] / t$95$4), $MachinePrecision], N[(N[(N[Sqrt[2.0], $MachinePrecision] / B$95$m), $MachinePrecision] * N[(N[Sqrt[N[(C + N[Sqrt[B$95$m ^ 2 + C ^ 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-N[Sqrt[F], $MachinePrecision])), $MachinePrecision]), $MachinePrecision]]]]]]]]]]]]]
\begin{array}{l}
B_m = \left|B\right|
\\
\begin{array}{l}
t_0 := C \cdot \left(4 \cdot A\right)\\
t_1 := A \cdot \left(C \cdot -4\right)\\
t_2 := \mathsf{hypot}\left(B\_m, A - C\right)\\
t_3 := t\_0 - {B\_m}^{2}\\
t_4 := \mathsf{fma}\left(B\_m, B\_m, t\_1\right)\\
t_5 := {B\_m}^{2} - t\_0\\
t_6 := 2 \cdot \left(F \cdot t\_5\right)\\
t_7 := \frac{\sqrt{t\_6 \cdot \left(\left(A + C\right) + \sqrt{{B\_m}^{2} + {\left(A - C\right)}^{2}}\right)}}{t\_3}\\
\mathbf{if}\;t\_7 \leq -1 \cdot 10^{+204}:\\
\;\;\;\;\frac{\mathsf{hypot}\left(B\_m, \sqrt{t\_1}\right) \cdot \left(\sqrt{C + \left(A + t\_2\right)} \cdot \sqrt{2 \cdot F}\right)}{-t\_4}\\
\mathbf{elif}\;t\_7 \leq -5 \cdot 10^{-219}:\\
\;\;\;\;\frac{-1}{\frac{t\_5}{\sqrt{2 \cdot \left(t\_5 \cdot \left(F \cdot \left(\left(A + C\right) + t\_2\right)\right)\right)}}}\\
\mathbf{elif}\;t\_7 \leq 10^{-68}:\\
\;\;\;\;\frac{\sqrt{t\_6 \cdot \left(-0.5 \cdot \frac{{B\_m}^{2}}{A} + 2 \cdot C\right)}}{t\_3}\\
\mathbf{elif}\;t\_7 \leq \infty:\\
\;\;\;\;\frac{\sqrt{\left(2 \cdot F\right) \cdot t\_4} \cdot \left(-\sqrt{\left(A + C\right) + \mathsf{hypot}\left(A - C, B\_m\right)}\right)}{t\_4}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{2}}{B\_m} \cdot \left(\sqrt{C + \mathsf{hypot}\left(B\_m, C\right)} \cdot \left(-\sqrt{F}\right)\right)\\
\end{array}
\end{array}
if (/.f64 (neg.f64 (sqrt.f64 (*.f64 (*.f64 2 (*.f64 (-.f64 (pow.f64 B 2) (*.f64 (*.f64 4 A) C)) F)) (+.f64 (+.f64 A C) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) 2) (pow.f64 B 2))))))) (-.f64 (pow.f64 B 2) (*.f64 (*.f64 4 A) C))) < -9.99999999999999989e203Initial program 6.9%
Simplified17.5%
pow1/217.5%
associate-*l*16.0%
unpow-prod-down37.8%
pow1/237.8%
fma-undefine37.8%
add-sqr-sqrt30.9%
hypot-define30.9%
Applied egg-rr30.9%
unpow1/230.9%
*-commutative30.9%
+-commutative30.9%
+-commutative30.9%
hypot-undefine11.5%
unpow211.5%
unpow211.5%
+-commutative11.5%
unpow211.5%
unpow211.5%
hypot-undefine30.9%
Simplified30.9%
sqrt-prod49.8%
associate-+l+50.1%
*-commutative50.1%
Applied egg-rr50.1%
if -9.99999999999999989e203 < (/.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-219Initial program 99.0%
clear-num99.0%
inv-pow99.0%
Applied egg-rr99.0%
unpow-199.0%
associate-*l*99.2%
+-commutative99.2%
+-commutative99.2%
hypot-undefine99.2%
unpow299.2%
unpow299.2%
+-commutative99.2%
unpow299.2%
unpow299.2%
Simplified99.2%
if -5.0000000000000002e-219 < (/.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.00000000000000007e-68Initial program 5.6%
Taylor expanded in A around -inf 27.6%
if 1.00000000000000007e-68 < (/.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 47.6%
Simplified64.7%
pow1/264.7%
*-commutative64.7%
unpow-prod-down81.5%
pow1/281.5%
+-commutative81.5%
hypot-undefine50.8%
unpow250.8%
unpow250.8%
+-commutative50.8%
unpow250.8%
unpow250.8%
hypot-define81.5%
pow1/281.5%
*-commutative81.5%
Applied egg-rr81.5%
if +inf.0 < (/.f64 (neg.f64 (sqrt.f64 (*.f64 (*.f64 2 (*.f64 (-.f64 (pow.f64 B 2) (*.f64 (*.f64 4 A) C)) F)) (+.f64 (+.f64 A C) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) 2) (pow.f64 B 2))))))) (-.f64 (pow.f64 B 2) (*.f64 (*.f64 4 A) C))) Initial program 0.0%
Taylor expanded in A around 0 1.8%
mul-1-neg1.8%
unpow21.8%
unpow21.8%
hypot-define16.3%
Simplified16.3%
pow1/216.4%
*-commutative16.4%
unpow-prod-down25.6%
pow1/225.6%
pow1/225.6%
Applied egg-rr25.6%
Final simplification44.5%
B_m = (fabs.f64 B)
(FPCore (A B_m C F)
:precision binary64
(let* ((t_0 (hypot (- A C) B_m))
(t_1 (* C (* 4.0 A)))
(t_2
(/
(* (sqrt (+ A (+ C t_0))) (sqrt (* F (* 2.0 (- (pow B_m 2.0) t_1)))))
(- t_1 (pow B_m 2.0)))))
(if (<= (pow B_m 2.0) 2e-54)
t_2
(if (<= (pow B_m 2.0) 5e+121)
(/
(*
(sqrt F)
(sqrt (* (+ (+ A C) t_0) (* 2.0 (fma A (* C -4.0) (pow B_m 2.0))))))
(- (* 4.0 (* A C)) (pow B_m 2.0)))
(if (<= (pow B_m 2.0) 5e+238)
t_2
(*
(/ (sqrt 2.0) B_m)
(* (sqrt (+ C (hypot B_m C))) (- (sqrt F)))))))))B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
double t_0 = hypot((A - C), B_m);
double t_1 = C * (4.0 * A);
double t_2 = (sqrt((A + (C + t_0))) * sqrt((F * (2.0 * (pow(B_m, 2.0) - t_1))))) / (t_1 - pow(B_m, 2.0));
double tmp;
if (pow(B_m, 2.0) <= 2e-54) {
tmp = t_2;
} else if (pow(B_m, 2.0) <= 5e+121) {
tmp = (sqrt(F) * sqrt((((A + C) + t_0) * (2.0 * fma(A, (C * -4.0), pow(B_m, 2.0)))))) / ((4.0 * (A * C)) - pow(B_m, 2.0));
} else if (pow(B_m, 2.0) <= 5e+238) {
tmp = t_2;
} else {
tmp = (sqrt(2.0) / B_m) * (sqrt((C + hypot(B_m, C))) * -sqrt(F));
}
return tmp;
}
B_m = abs(B) function code(A, B_m, C, F) t_0 = hypot(Float64(A - C), B_m) t_1 = Float64(C * Float64(4.0 * A)) t_2 = Float64(Float64(sqrt(Float64(A + Float64(C + t_0))) * sqrt(Float64(F * Float64(2.0 * Float64((B_m ^ 2.0) - t_1))))) / Float64(t_1 - (B_m ^ 2.0))) tmp = 0.0 if ((B_m ^ 2.0) <= 2e-54) tmp = t_2; elseif ((B_m ^ 2.0) <= 5e+121) tmp = Float64(Float64(sqrt(F) * sqrt(Float64(Float64(Float64(A + C) + t_0) * 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 ((B_m ^ 2.0) <= 5e+238) tmp = t_2; else tmp = Float64(Float64(sqrt(2.0) / B_m) * Float64(sqrt(Float64(C + hypot(B_m, C))) * Float64(-sqrt(F)))); end return tmp end
B_m = N[Abs[B], $MachinePrecision]
code[A_, B$95$m_, C_, F_] := Block[{t$95$0 = N[Sqrt[N[(A - C), $MachinePrecision] ^ 2 + B$95$m ^ 2], $MachinePrecision]}, Block[{t$95$1 = N[(C * N[(4.0 * A), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[Sqrt[N[(A + N[(C + t$95$0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(F * N[(2.0 * N[(N[Power[B$95$m, 2.0], $MachinePrecision] - t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[(t$95$1 - N[Power[B$95$m, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 2e-54], t$95$2, If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 5e+121], N[(N[(N[Sqrt[F], $MachinePrecision] * N[Sqrt[N[(N[(N[(A + C), $MachinePrecision] + t$95$0), $MachinePrecision] * N[(2.0 * N[(A * N[(C * -4.0), $MachinePrecision] + N[Power[B$95$m, 2.0], $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], If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 5e+238], t$95$2, N[(N[(N[Sqrt[2.0], $MachinePrecision] / B$95$m), $MachinePrecision] * N[(N[Sqrt[N[(C + N[Sqrt[B$95$m ^ 2 + C ^ 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-N[Sqrt[F], $MachinePrecision])), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
B_m = \left|B\right|
\\
\begin{array}{l}
t_0 := \mathsf{hypot}\left(A - C, B\_m\right)\\
t_1 := C \cdot \left(4 \cdot A\right)\\
t_2 := \frac{\sqrt{A + \left(C + t\_0\right)} \cdot \sqrt{F \cdot \left(2 \cdot \left({B\_m}^{2} - t\_1\right)\right)}}{t\_1 - {B\_m}^{2}}\\
\mathbf{if}\;{B\_m}^{2} \leq 2 \cdot 10^{-54}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;{B\_m}^{2} \leq 5 \cdot 10^{+121}:\\
\;\;\;\;\frac{\sqrt{F} \cdot \sqrt{\left(\left(A + C\right) + t\_0\right) \cdot \left(2 \cdot \mathsf{fma}\left(A, C \cdot -4, {B\_m}^{2}\right)\right)}}{4 \cdot \left(A \cdot C\right) - {B\_m}^{2}}\\
\mathbf{elif}\;{B\_m}^{2} \leq 5 \cdot 10^{+238}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{2}}{B\_m} \cdot \left(\sqrt{C + \mathsf{hypot}\left(B\_m, C\right)} \cdot \left(-\sqrt{F}\right)\right)\\
\end{array}
\end{array}
if (pow.f64 B 2) < 2.0000000000000001e-54 or 5.00000000000000007e121 < (pow.f64 B 2) < 4.99999999999999995e238Initial program 22.1%
associate-+l+23.0%
add-cube-cbrt23.1%
fma-define23.1%
pow223.1%
unpow223.1%
unpow223.1%
hypot-define30.9%
Applied egg-rr30.9%
pow1/231.0%
*-commutative31.0%
unpow-prod-down41.1%
pow1/241.1%
fma-undefine41.2%
unpow241.2%
add-cube-cbrt41.2%
pow1/241.2%
associate-*r*41.3%
Applied egg-rr41.3%
if 2.0000000000000001e-54 < (pow.f64 B 2) < 5.00000000000000007e121Initial program 32.2%
Simplified32.9%
pow1/232.9%
*-commutative32.9%
unpow-prod-down46.7%
Applied egg-rr46.7%
if 4.99999999999999995e238 < (pow.f64 B 2) Initial program 1.5%
Taylor expanded in A around 0 1.8%
mul-1-neg1.8%
unpow21.8%
unpow21.8%
hypot-define22.8%
Simplified22.8%
pow1/222.8%
*-commutative22.8%
unpow-prod-down35.7%
pow1/235.7%
pow1/235.7%
Applied egg-rr35.7%
Final simplification40.4%
B_m = (fabs.f64 B)
(FPCore (A B_m C F)
:precision binary64
(let* ((t_0 (* C (* 4.0 A)))
(t_1 (- t_0 (pow B_m 2.0)))
(t_2 (+ C (hypot B_m C)))
(t_3
(* (sqrt (* F (* -0.5 (/ (pow B_m 2.0) C)))) (/ (sqrt 2.0) (- B_m))))
(t_4 (* 2.0 (* F (- (pow B_m 2.0) t_0)))))
(if (<= (pow B_m 2.0) 4e-306)
(/ (sqrt (* t_4 (* 2.0 C))) t_1)
(if (<= (pow B_m 2.0) 5e-160)
t_3
(if (<= (pow B_m 2.0) 4e-27)
(/ (sqrt (* t_4 t_2)) t_1)
(if (<= (pow B_m 2.0) 2e+39)
t_3
(* (/ (sqrt 2.0) B_m) (* (sqrt t_2) (- (sqrt F))))))))))B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
double t_0 = C * (4.0 * A);
double t_1 = t_0 - pow(B_m, 2.0);
double t_2 = C + hypot(B_m, C);
double t_3 = sqrt((F * (-0.5 * (pow(B_m, 2.0) / C)))) * (sqrt(2.0) / -B_m);
double t_4 = 2.0 * (F * (pow(B_m, 2.0) - t_0));
double tmp;
if (pow(B_m, 2.0) <= 4e-306) {
tmp = sqrt((t_4 * (2.0 * C))) / t_1;
} else if (pow(B_m, 2.0) <= 5e-160) {
tmp = t_3;
} else if (pow(B_m, 2.0) <= 4e-27) {
tmp = sqrt((t_4 * t_2)) / t_1;
} else if (pow(B_m, 2.0) <= 2e+39) {
tmp = t_3;
} else {
tmp = (sqrt(2.0) / B_m) * (sqrt(t_2) * -sqrt(F));
}
return tmp;
}
B_m = Math.abs(B);
public static double code(double A, double B_m, double C, double F) {
double t_0 = C * (4.0 * A);
double t_1 = t_0 - Math.pow(B_m, 2.0);
double t_2 = C + Math.hypot(B_m, C);
double t_3 = Math.sqrt((F * (-0.5 * (Math.pow(B_m, 2.0) / C)))) * (Math.sqrt(2.0) / -B_m);
double t_4 = 2.0 * (F * (Math.pow(B_m, 2.0) - t_0));
double tmp;
if (Math.pow(B_m, 2.0) <= 4e-306) {
tmp = Math.sqrt((t_4 * (2.0 * C))) / t_1;
} else if (Math.pow(B_m, 2.0) <= 5e-160) {
tmp = t_3;
} else if (Math.pow(B_m, 2.0) <= 4e-27) {
tmp = Math.sqrt((t_4 * t_2)) / t_1;
} else if (Math.pow(B_m, 2.0) <= 2e+39) {
tmp = t_3;
} else {
tmp = (Math.sqrt(2.0) / B_m) * (Math.sqrt(t_2) * -Math.sqrt(F));
}
return tmp;
}
B_m = math.fabs(B) def code(A, B_m, C, F): t_0 = C * (4.0 * A) t_1 = t_0 - math.pow(B_m, 2.0) t_2 = C + math.hypot(B_m, C) t_3 = math.sqrt((F * (-0.5 * (math.pow(B_m, 2.0) / C)))) * (math.sqrt(2.0) / -B_m) t_4 = 2.0 * (F * (math.pow(B_m, 2.0) - t_0)) tmp = 0 if math.pow(B_m, 2.0) <= 4e-306: tmp = math.sqrt((t_4 * (2.0 * C))) / t_1 elif math.pow(B_m, 2.0) <= 5e-160: tmp = t_3 elif math.pow(B_m, 2.0) <= 4e-27: tmp = math.sqrt((t_4 * t_2)) / t_1 elif math.pow(B_m, 2.0) <= 2e+39: tmp = t_3 else: tmp = (math.sqrt(2.0) / B_m) * (math.sqrt(t_2) * -math.sqrt(F)) return tmp
B_m = abs(B) function code(A, B_m, C, F) t_0 = Float64(C * Float64(4.0 * A)) t_1 = Float64(t_0 - (B_m ^ 2.0)) t_2 = Float64(C + hypot(B_m, C)) t_3 = Float64(sqrt(Float64(F * Float64(-0.5 * Float64((B_m ^ 2.0) / C)))) * Float64(sqrt(2.0) / Float64(-B_m))) t_4 = Float64(2.0 * Float64(F * Float64((B_m ^ 2.0) - t_0))) tmp = 0.0 if ((B_m ^ 2.0) <= 4e-306) tmp = Float64(sqrt(Float64(t_4 * Float64(2.0 * C))) / t_1); elseif ((B_m ^ 2.0) <= 5e-160) tmp = t_3; elseif ((B_m ^ 2.0) <= 4e-27) tmp = Float64(sqrt(Float64(t_4 * t_2)) / t_1); elseif ((B_m ^ 2.0) <= 2e+39) tmp = t_3; else tmp = Float64(Float64(sqrt(2.0) / B_m) * Float64(sqrt(t_2) * Float64(-sqrt(F)))); end return tmp end
B_m = abs(B); function tmp_2 = code(A, B_m, C, F) t_0 = C * (4.0 * A); t_1 = t_0 - (B_m ^ 2.0); t_2 = C + hypot(B_m, C); t_3 = sqrt((F * (-0.5 * ((B_m ^ 2.0) / C)))) * (sqrt(2.0) / -B_m); t_4 = 2.0 * (F * ((B_m ^ 2.0) - t_0)); tmp = 0.0; if ((B_m ^ 2.0) <= 4e-306) tmp = sqrt((t_4 * (2.0 * C))) / t_1; elseif ((B_m ^ 2.0) <= 5e-160) tmp = t_3; elseif ((B_m ^ 2.0) <= 4e-27) tmp = sqrt((t_4 * t_2)) / t_1; elseif ((B_m ^ 2.0) <= 2e+39) tmp = t_3; else tmp = (sqrt(2.0) / B_m) * (sqrt(t_2) * -sqrt(F)); end tmp_2 = tmp; end
B_m = N[Abs[B], $MachinePrecision]
code[A_, B$95$m_, C_, F_] := Block[{t$95$0 = N[(C * N[(4.0 * A), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(t$95$0 - N[Power[B$95$m, 2.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(C + N[Sqrt[B$95$m ^ 2 + C ^ 2], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[Sqrt[N[(F * N[(-0.5 * N[(N[Power[B$95$m, 2.0], $MachinePrecision] / C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[Sqrt[2.0], $MachinePrecision] / (-B$95$m)), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(2.0 * N[(F * N[(N[Power[B$95$m, 2.0], $MachinePrecision] - t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 4e-306], N[(N[Sqrt[N[(t$95$4 * N[(2.0 * C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / t$95$1), $MachinePrecision], If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 5e-160], t$95$3, If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 4e-27], N[(N[Sqrt[N[(t$95$4 * t$95$2), $MachinePrecision]], $MachinePrecision] / t$95$1), $MachinePrecision], If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 2e+39], t$95$3, N[(N[(N[Sqrt[2.0], $MachinePrecision] / B$95$m), $MachinePrecision] * N[(N[Sqrt[t$95$2], $MachinePrecision] * (-N[Sqrt[F], $MachinePrecision])), $MachinePrecision]), $MachinePrecision]]]]]]]]]]
\begin{array}{l}
B_m = \left|B\right|
\\
\begin{array}{l}
t_0 := C \cdot \left(4 \cdot A\right)\\
t_1 := t\_0 - {B\_m}^{2}\\
t_2 := C + \mathsf{hypot}\left(B\_m, C\right)\\
t_3 := \sqrt{F \cdot \left(-0.5 \cdot \frac{{B\_m}^{2}}{C}\right)} \cdot \frac{\sqrt{2}}{-B\_m}\\
t_4 := 2 \cdot \left(F \cdot \left({B\_m}^{2} - t\_0\right)\right)\\
\mathbf{if}\;{B\_m}^{2} \leq 4 \cdot 10^{-306}:\\
\;\;\;\;\frac{\sqrt{t\_4 \cdot \left(2 \cdot C\right)}}{t\_1}\\
\mathbf{elif}\;{B\_m}^{2} \leq 5 \cdot 10^{-160}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;{B\_m}^{2} \leq 4 \cdot 10^{-27}:\\
\;\;\;\;\frac{\sqrt{t\_4 \cdot t\_2}}{t\_1}\\
\mathbf{elif}\;{B\_m}^{2} \leq 2 \cdot 10^{+39}:\\
\;\;\;\;t\_3\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{2}}{B\_m} \cdot \left(\sqrt{t\_2} \cdot \left(-\sqrt{F}\right)\right)\\
\end{array}
\end{array}
if (pow.f64 B 2) < 4.00000000000000011e-306Initial program 21.7%
Taylor expanded in A around -inf 27.4%
if 4.00000000000000011e-306 < (pow.f64 B 2) < 4.99999999999999994e-160 or 4.0000000000000002e-27 < (pow.f64 B 2) < 1.99999999999999988e39Initial program 16.6%
Taylor expanded in A around 0 7.2%
mul-1-neg7.2%
unpow27.2%
unpow27.2%
hypot-define7.5%
Simplified7.5%
Taylor expanded in C around -inf 20.8%
if 4.99999999999999994e-160 < (pow.f64 B 2) < 4.0000000000000002e-27Initial program 37.7%
Taylor expanded in A around 0 29.1%
unpow229.1%
unpow229.1%
hypot-define35.7%
Simplified35.7%
if 1.99999999999999988e39 < (pow.f64 B 2) Initial program 9.5%
Taylor expanded in A around 0 7.0%
mul-1-neg7.0%
unpow27.0%
unpow27.0%
hypot-define21.5%
Simplified21.5%
pow1/221.5%
*-commutative21.5%
unpow-prod-down31.3%
pow1/231.3%
pow1/231.3%
Applied egg-rr31.3%
Final simplification29.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))))
(t_1
(/
(sqrt (* (* (* 2.0 F) t_0) (+ (+ A C) (hypot B_m (- A C)))))
(- t_0)))
(t_2
(* (sqrt (* F (* -0.5 (/ (pow B_m 2.0) C)))) (/ (sqrt 2.0) (- B_m)))))
(if (<= (pow B_m 2.0) 5e-296)
t_1
(if (<= (pow B_m 2.0) 5e-160)
t_2
(if (<= (pow B_m 2.0) 4e-27)
t_1
(if (<= (pow B_m 2.0) 2e+39)
t_2
(*
(/ (sqrt 2.0) B_m)
(* (sqrt (+ C (hypot B_m C))) (- (sqrt F))))))))))B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
double t_0 = fma(B_m, B_m, (A * (C * -4.0)));
double t_1 = sqrt((((2.0 * F) * t_0) * ((A + C) + hypot(B_m, (A - C))))) / -t_0;
double t_2 = sqrt((F * (-0.5 * (pow(B_m, 2.0) / C)))) * (sqrt(2.0) / -B_m);
double tmp;
if (pow(B_m, 2.0) <= 5e-296) {
tmp = t_1;
} else if (pow(B_m, 2.0) <= 5e-160) {
tmp = t_2;
} else if (pow(B_m, 2.0) <= 4e-27) {
tmp = t_1;
} else if (pow(B_m, 2.0) <= 2e+39) {
tmp = t_2;
} else {
tmp = (sqrt(2.0) / B_m) * (sqrt((C + hypot(B_m, C))) * -sqrt(F));
}
return tmp;
}
B_m = abs(B) function code(A, B_m, C, F) t_0 = fma(B_m, B_m, Float64(A * Float64(C * -4.0))) t_1 = Float64(sqrt(Float64(Float64(Float64(2.0 * F) * t_0) * Float64(Float64(A + C) + hypot(B_m, Float64(A - C))))) / Float64(-t_0)) t_2 = Float64(sqrt(Float64(F * Float64(-0.5 * Float64((B_m ^ 2.0) / C)))) * Float64(sqrt(2.0) / Float64(-B_m))) tmp = 0.0 if ((B_m ^ 2.0) <= 5e-296) tmp = t_1; elseif ((B_m ^ 2.0) <= 5e-160) tmp = t_2; elseif ((B_m ^ 2.0) <= 4e-27) tmp = t_1; elseif ((B_m ^ 2.0) <= 2e+39) tmp = t_2; else tmp = Float64(Float64(sqrt(2.0) / B_m) * Float64(sqrt(Float64(C + hypot(B_m, C))) * Float64(-sqrt(F)))); end return tmp end
B_m = N[Abs[B], $MachinePrecision]
code[A_, B$95$m_, C_, F_] := Block[{t$95$0 = N[(B$95$m * B$95$m + N[(A * N[(C * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[Sqrt[N[(N[(N[(2.0 * F), $MachinePrecision] * t$95$0), $MachinePrecision] * N[(N[(A + C), $MachinePrecision] + N[Sqrt[B$95$m ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / (-t$95$0)), $MachinePrecision]}, Block[{t$95$2 = N[(N[Sqrt[N[(F * N[(-0.5 * N[(N[Power[B$95$m, 2.0], $MachinePrecision] / C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[Sqrt[2.0], $MachinePrecision] / (-B$95$m)), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 5e-296], t$95$1, If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 5e-160], t$95$2, If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 4e-27], t$95$1, If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 2e+39], t$95$2, N[(N[(N[Sqrt[2.0], $MachinePrecision] / B$95$m), $MachinePrecision] * N[(N[Sqrt[N[(C + N[Sqrt[B$95$m ^ 2 + C ^ 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-N[Sqrt[F], $MachinePrecision])), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
B_m = \left|B\right|
\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(B\_m, B\_m, A \cdot \left(C \cdot -4\right)\right)\\
t_1 := \frac{\sqrt{\left(\left(2 \cdot F\right) \cdot t\_0\right) \cdot \left(\left(A + C\right) + \mathsf{hypot}\left(B\_m, A - C\right)\right)}}{-t\_0}\\
t_2 := \sqrt{F \cdot \left(-0.5 \cdot \frac{{B\_m}^{2}}{C}\right)} \cdot \frac{\sqrt{2}}{-B\_m}\\
\mathbf{if}\;{B\_m}^{2} \leq 5 \cdot 10^{-296}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;{B\_m}^{2} \leq 5 \cdot 10^{-160}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;{B\_m}^{2} \leq 4 \cdot 10^{-27}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;{B\_m}^{2} \leq 2 \cdot 10^{+39}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{2}}{B\_m} \cdot \left(\sqrt{C + \mathsf{hypot}\left(B\_m, C\right)} \cdot \left(-\sqrt{F}\right)\right)\\
\end{array}
\end{array}
if (pow.f64 B 2) < 5.0000000000000003e-296 or 4.99999999999999994e-160 < (pow.f64 B 2) < 4.0000000000000002e-27Initial program 27.0%
Simplified32.9%
if 5.0000000000000003e-296 < (pow.f64 B 2) < 4.99999999999999994e-160 or 4.0000000000000002e-27 < (pow.f64 B 2) < 1.99999999999999988e39Initial program 15.0%
Taylor expanded in A around 0 7.6%
mul-1-neg7.6%
unpow27.6%
unpow27.6%
hypot-define7.9%
Simplified7.9%
Taylor expanded in C around -inf 19.3%
if 1.99999999999999988e39 < (pow.f64 B 2) Initial program 9.5%
Taylor expanded in A around 0 7.0%
mul-1-neg7.0%
unpow27.0%
unpow27.0%
hypot-define21.5%
Simplified21.5%
pow1/221.5%
*-commutative21.5%
unpow-prod-down31.3%
pow1/231.3%
pow1/231.3%
Applied egg-rr31.3%
Final simplification30.0%
B_m = (fabs.f64 B)
(FPCore (A B_m C F)
:precision binary64
(let* ((t_0 (* C (* 4.0 A))))
(if (<= (pow B_m 2.0) 5e+238)
(/
(*
(sqrt (+ A (+ C (hypot (- A C) B_m))))
(sqrt (* F (* 2.0 (- (pow B_m 2.0) t_0)))))
(- t_0 (pow B_m 2.0)))
(* (/ (sqrt 2.0) B_m) (* (sqrt (+ C (hypot B_m C))) (- (sqrt F)))))))B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
double t_0 = C * (4.0 * A);
double tmp;
if (pow(B_m, 2.0) <= 5e+238) {
tmp = (sqrt((A + (C + hypot((A - C), B_m)))) * sqrt((F * (2.0 * (pow(B_m, 2.0) - t_0))))) / (t_0 - pow(B_m, 2.0));
} else {
tmp = (sqrt(2.0) / B_m) * (sqrt((C + hypot(B_m, C))) * -sqrt(F));
}
return tmp;
}
B_m = Math.abs(B);
public static double code(double A, double B_m, double C, double F) {
double t_0 = C * (4.0 * A);
double tmp;
if (Math.pow(B_m, 2.0) <= 5e+238) {
tmp = (Math.sqrt((A + (C + Math.hypot((A - C), B_m)))) * Math.sqrt((F * (2.0 * (Math.pow(B_m, 2.0) - t_0))))) / (t_0 - Math.pow(B_m, 2.0));
} else {
tmp = (Math.sqrt(2.0) / B_m) * (Math.sqrt((C + Math.hypot(B_m, C))) * -Math.sqrt(F));
}
return tmp;
}
B_m = math.fabs(B) def code(A, B_m, C, F): t_0 = C * (4.0 * A) tmp = 0 if math.pow(B_m, 2.0) <= 5e+238: tmp = (math.sqrt((A + (C + math.hypot((A - C), B_m)))) * math.sqrt((F * (2.0 * (math.pow(B_m, 2.0) - t_0))))) / (t_0 - math.pow(B_m, 2.0)) else: tmp = (math.sqrt(2.0) / B_m) * (math.sqrt((C + math.hypot(B_m, C))) * -math.sqrt(F)) return tmp
B_m = abs(B) function code(A, B_m, C, F) t_0 = Float64(C * Float64(4.0 * A)) tmp = 0.0 if ((B_m ^ 2.0) <= 5e+238) tmp = Float64(Float64(sqrt(Float64(A + Float64(C + hypot(Float64(A - C), B_m)))) * sqrt(Float64(F * Float64(2.0 * Float64((B_m ^ 2.0) - t_0))))) / Float64(t_0 - (B_m ^ 2.0))); else tmp = Float64(Float64(sqrt(2.0) / B_m) * Float64(sqrt(Float64(C + hypot(B_m, C))) * Float64(-sqrt(F)))); end return tmp end
B_m = abs(B); function tmp_2 = code(A, B_m, C, F) t_0 = C * (4.0 * A); tmp = 0.0; if ((B_m ^ 2.0) <= 5e+238) tmp = (sqrt((A + (C + hypot((A - C), B_m)))) * sqrt((F * (2.0 * ((B_m ^ 2.0) - t_0))))) / (t_0 - (B_m ^ 2.0)); else tmp = (sqrt(2.0) / B_m) * (sqrt((C + hypot(B_m, C))) * -sqrt(F)); end tmp_2 = tmp; end
B_m = N[Abs[B], $MachinePrecision]
code[A_, B$95$m_, C_, F_] := Block[{t$95$0 = N[(C * N[(4.0 * A), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 5e+238], N[(N[(N[Sqrt[N[(A + N[(C + N[Sqrt[N[(A - C), $MachinePrecision] ^ 2 + B$95$m ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(F * N[(2.0 * N[(N[Power[B$95$m, 2.0], $MachinePrecision] - t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[(t$95$0 - 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[(C + N[Sqrt[B$95$m ^ 2 + C ^ 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-N[Sqrt[F], $MachinePrecision])), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
B_m = \left|B\right|
\\
\begin{array}{l}
t_0 := C \cdot \left(4 \cdot A\right)\\
\mathbf{if}\;{B\_m}^{2} \leq 5 \cdot 10^{+238}:\\
\;\;\;\;\frac{\sqrt{A + \left(C + \mathsf{hypot}\left(A - C, B\_m\right)\right)} \cdot \sqrt{F \cdot \left(2 \cdot \left({B\_m}^{2} - t\_0\right)\right)}}{t\_0 - {B\_m}^{2}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{2}}{B\_m} \cdot \left(\sqrt{C + \mathsf{hypot}\left(B\_m, C\right)} \cdot \left(-\sqrt{F}\right)\right)\\
\end{array}
\end{array}
if (pow.f64 B 2) < 4.99999999999999995e238Initial program 24.1%
associate-+l+24.8%
add-cube-cbrt24.9%
fma-define24.9%
pow224.9%
unpow224.9%
unpow224.9%
hypot-define31.2%
Applied egg-rr31.2%
pow1/231.4%
*-commutative31.4%
unpow-prod-down39.9%
pow1/239.9%
fma-undefine40.0%
unpow240.0%
add-cube-cbrt40.0%
pow1/240.0%
associate-*r*40.1%
Applied egg-rr40.1%
if 4.99999999999999995e238 < (pow.f64 B 2) Initial program 1.5%
Taylor expanded in A around 0 1.8%
mul-1-neg1.8%
unpow21.8%
unpow21.8%
hypot-define22.8%
Simplified22.8%
pow1/222.8%
*-commutative22.8%
unpow-prod-down35.7%
pow1/235.7%
pow1/235.7%
Applied egg-rr35.7%
Final simplification38.7%
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+238)
(/
(* (sqrt (* (* 2.0 F) t_0)) (- (sqrt (+ (+ A C) (hypot (- A C) B_m)))))
t_0)
(* (/ (sqrt 2.0) B_m) (* (sqrt (+ C (hypot B_m C))) (- (sqrt F)))))))B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
double t_0 = fma(B_m, B_m, (A * (C * -4.0)));
double tmp;
if (pow(B_m, 2.0) <= 5e+238) {
tmp = (sqrt(((2.0 * F) * t_0)) * -sqrt(((A + C) + hypot((A - C), B_m)))) / t_0;
} else {
tmp = (sqrt(2.0) / B_m) * (sqrt((C + hypot(B_m, C))) * -sqrt(F));
}
return tmp;
}
B_m = abs(B) function code(A, B_m, C, F) t_0 = fma(B_m, B_m, Float64(A * Float64(C * -4.0))) tmp = 0.0 if ((B_m ^ 2.0) <= 5e+238) tmp = Float64(Float64(sqrt(Float64(Float64(2.0 * F) * t_0)) * Float64(-sqrt(Float64(Float64(A + C) + hypot(Float64(A - C), B_m))))) / t_0); else tmp = Float64(Float64(sqrt(2.0) / B_m) * Float64(sqrt(Float64(C + hypot(B_m, C))) * Float64(-sqrt(F)))); end return tmp end
B_m = N[Abs[B], $MachinePrecision]
code[A_, B$95$m_, C_, F_] := Block[{t$95$0 = N[(B$95$m * B$95$m + N[(A * N[(C * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 5e+238], N[(N[(N[Sqrt[N[(N[(2.0 * F), $MachinePrecision] * t$95$0), $MachinePrecision]], $MachinePrecision] * (-N[Sqrt[N[(N[(A + C), $MachinePrecision] + N[Sqrt[N[(A - C), $MachinePrecision] ^ 2 + B$95$m ^ 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision] / t$95$0), $MachinePrecision], N[(N[(N[Sqrt[2.0], $MachinePrecision] / B$95$m), $MachinePrecision] * N[(N[Sqrt[N[(C + N[Sqrt[B$95$m ^ 2 + C ^ 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-N[Sqrt[F], $MachinePrecision])), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
B_m = \left|B\right|
\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(B\_m, B\_m, A \cdot \left(C \cdot -4\right)\right)\\
\mathbf{if}\;{B\_m}^{2} \leq 5 \cdot 10^{+238}:\\
\;\;\;\;\frac{\sqrt{\left(2 \cdot F\right) \cdot t\_0} \cdot \left(-\sqrt{\left(A + C\right) + \mathsf{hypot}\left(A - C, B\_m\right)}\right)}{t\_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{2}}{B\_m} \cdot \left(\sqrt{C + \mathsf{hypot}\left(B\_m, C\right)} \cdot \left(-\sqrt{F}\right)\right)\\
\end{array}
\end{array}
if (pow.f64 B 2) < 4.99999999999999995e238Initial program 24.1%
Simplified30.3%
pow1/230.3%
*-commutative30.3%
unpow-prod-down39.1%
pow1/239.1%
+-commutative39.1%
hypot-undefine26.7%
unpow226.7%
unpow226.7%
+-commutative26.7%
unpow226.7%
unpow226.7%
hypot-define39.1%
pow1/239.1%
*-commutative39.1%
Applied egg-rr39.1%
if 4.99999999999999995e238 < (pow.f64 B 2) Initial program 1.5%
Taylor expanded in A around 0 1.8%
mul-1-neg1.8%
unpow21.8%
unpow21.8%
hypot-define22.8%
Simplified22.8%
pow1/222.8%
*-commutative22.8%
unpow-prod-down35.7%
pow1/235.7%
pow1/235.7%
Applied egg-rr35.7%
Final simplification38.1%
B_m = (fabs.f64 B)
(FPCore (A B_m C F)
:precision binary64
(let* ((t_0 (* C (* 4.0 A))))
(if (<= (pow B_m 2.0) 4e-27)
(/
(sqrt
(* 2.0 (* F (* (- (pow B_m 2.0) t_0) (+ A (+ C (hypot (- A C) B_m)))))))
(- t_0 (pow B_m 2.0)))
(if (<= (pow B_m 2.0) 2e+39)
(* (sqrt (* F (* -0.5 (/ (pow B_m 2.0) C)))) (/ (sqrt 2.0) (- B_m)))
(* (/ (sqrt 2.0) B_m) (* (sqrt (+ C (hypot B_m C))) (- (sqrt F))))))))B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
double t_0 = C * (4.0 * A);
double tmp;
if (pow(B_m, 2.0) <= 4e-27) {
tmp = sqrt((2.0 * (F * ((pow(B_m, 2.0) - t_0) * (A + (C + hypot((A - C), B_m))))))) / (t_0 - pow(B_m, 2.0));
} else if (pow(B_m, 2.0) <= 2e+39) {
tmp = sqrt((F * (-0.5 * (pow(B_m, 2.0) / C)))) * (sqrt(2.0) / -B_m);
} else {
tmp = (sqrt(2.0) / B_m) * (sqrt((C + hypot(B_m, C))) * -sqrt(F));
}
return tmp;
}
B_m = Math.abs(B);
public static double code(double A, double B_m, double C, double F) {
double t_0 = C * (4.0 * A);
double tmp;
if (Math.pow(B_m, 2.0) <= 4e-27) {
tmp = Math.sqrt((2.0 * (F * ((Math.pow(B_m, 2.0) - t_0) * (A + (C + Math.hypot((A - C), B_m))))))) / (t_0 - Math.pow(B_m, 2.0));
} else if (Math.pow(B_m, 2.0) <= 2e+39) {
tmp = Math.sqrt((F * (-0.5 * (Math.pow(B_m, 2.0) / C)))) * (Math.sqrt(2.0) / -B_m);
} else {
tmp = (Math.sqrt(2.0) / B_m) * (Math.sqrt((C + Math.hypot(B_m, C))) * -Math.sqrt(F));
}
return tmp;
}
B_m = math.fabs(B) def code(A, B_m, C, F): t_0 = C * (4.0 * A) tmp = 0 if math.pow(B_m, 2.0) <= 4e-27: tmp = math.sqrt((2.0 * (F * ((math.pow(B_m, 2.0) - t_0) * (A + (C + math.hypot((A - C), B_m))))))) / (t_0 - math.pow(B_m, 2.0)) elif math.pow(B_m, 2.0) <= 2e+39: tmp = math.sqrt((F * (-0.5 * (math.pow(B_m, 2.0) / C)))) * (math.sqrt(2.0) / -B_m) else: tmp = (math.sqrt(2.0) / B_m) * (math.sqrt((C + math.hypot(B_m, C))) * -math.sqrt(F)) return tmp
B_m = abs(B) function code(A, B_m, C, F) t_0 = Float64(C * Float64(4.0 * A)) tmp = 0.0 if ((B_m ^ 2.0) <= 4e-27) tmp = Float64(sqrt(Float64(2.0 * Float64(F * Float64(Float64((B_m ^ 2.0) - t_0) * Float64(A + Float64(C + hypot(Float64(A - C), B_m))))))) / Float64(t_0 - (B_m ^ 2.0))); elseif ((B_m ^ 2.0) <= 2e+39) tmp = Float64(sqrt(Float64(F * Float64(-0.5 * Float64((B_m ^ 2.0) / C)))) * Float64(sqrt(2.0) / Float64(-B_m))); else tmp = Float64(Float64(sqrt(2.0) / B_m) * Float64(sqrt(Float64(C + hypot(B_m, C))) * Float64(-sqrt(F)))); end return tmp end
B_m = abs(B); function tmp_2 = code(A, B_m, C, F) t_0 = C * (4.0 * A); tmp = 0.0; if ((B_m ^ 2.0) <= 4e-27) tmp = sqrt((2.0 * (F * (((B_m ^ 2.0) - t_0) * (A + (C + hypot((A - C), B_m))))))) / (t_0 - (B_m ^ 2.0)); elseif ((B_m ^ 2.0) <= 2e+39) tmp = sqrt((F * (-0.5 * ((B_m ^ 2.0) / C)))) * (sqrt(2.0) / -B_m); else tmp = (sqrt(2.0) / B_m) * (sqrt((C + hypot(B_m, C))) * -sqrt(F)); end tmp_2 = tmp; end
B_m = N[Abs[B], $MachinePrecision]
code[A_, B$95$m_, C_, F_] := Block[{t$95$0 = N[(C * N[(4.0 * A), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 4e-27], N[(N[Sqrt[N[(2.0 * N[(F * N[(N[(N[Power[B$95$m, 2.0], $MachinePrecision] - t$95$0), $MachinePrecision] * N[(A + N[(C + N[Sqrt[N[(A - C), $MachinePrecision] ^ 2 + B$95$m ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(t$95$0 - N[Power[B$95$m, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 2e+39], N[(N[Sqrt[N[(F * N[(-0.5 * N[(N[Power[B$95$m, 2.0], $MachinePrecision] / C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[Sqrt[2.0], $MachinePrecision] / (-B$95$m)), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[2.0], $MachinePrecision] / B$95$m), $MachinePrecision] * N[(N[Sqrt[N[(C + N[Sqrt[B$95$m ^ 2 + C ^ 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-N[Sqrt[F], $MachinePrecision])), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
B_m = \left|B\right|
\\
\begin{array}{l}
t_0 := C \cdot \left(4 \cdot A\right)\\
\mathbf{if}\;{B\_m}^{2} \leq 4 \cdot 10^{-27}:\\
\;\;\;\;\frac{\sqrt{2 \cdot \left(F \cdot \left(\left({B\_m}^{2} - t\_0\right) \cdot \left(A + \left(C + \mathsf{hypot}\left(A - C, B\_m\right)\right)\right)\right)\right)}}{t\_0 - {B\_m}^{2}}\\
\mathbf{elif}\;{B\_m}^{2} \leq 2 \cdot 10^{+39}:\\
\;\;\;\;\sqrt{F \cdot \left(-0.5 \cdot \frac{{B\_m}^{2}}{C}\right)} \cdot \frac{\sqrt{2}}{-B\_m}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{2}}{B\_m} \cdot \left(\sqrt{C + \mathsf{hypot}\left(B\_m, C\right)} \cdot \left(-\sqrt{F}\right)\right)\\
\end{array}
\end{array}
if (pow.f64 B 2) < 4.0000000000000002e-27Initial program 23.8%
associate-+l+24.8%
add-cube-cbrt25.0%
fma-define24.9%
pow224.9%
unpow224.9%
unpow224.9%
hypot-define30.8%
Applied egg-rr30.8%
*-un-lft-identity30.8%
Applied egg-rr30.8%
*-lft-identity30.8%
distribute-frac-neg30.8%
distribute-neg-frac230.8%
associate-*l*30.6%
Simplified30.6%
if 4.0000000000000002e-27 < (pow.f64 B 2) < 1.99999999999999988e39Initial program 20.8%
Taylor expanded in A around 0 8.9%
mul-1-neg8.9%
unpow28.9%
unpow28.9%
hypot-define9.8%
Simplified9.8%
Taylor expanded in C around -inf 27.1%
if 1.99999999999999988e39 < (pow.f64 B 2) Initial program 9.5%
Taylor expanded in A around 0 7.0%
mul-1-neg7.0%
unpow27.0%
unpow27.0%
hypot-define21.5%
Simplified21.5%
pow1/221.5%
*-commutative21.5%
unpow-prod-down31.3%
pow1/231.3%
pow1/231.3%
Applied egg-rr31.3%
Final simplification30.7%
B_m = (fabs.f64 B)
(FPCore (A B_m C F)
:precision binary64
(let* ((t_0 (- (pow B_m 2.0) (* C (* 4.0 A)))))
(if (<= (pow B_m 2.0) 20000.0)
(*
(sqrt (* 2.0 (* F (* t_0 (+ A (+ C (hypot (- A C) B_m)))))))
(/ -1.0 t_0))
(if (<= (pow B_m 2.0) 2e+39)
(* (sqrt (* F (* -0.5 (/ (pow B_m 2.0) C)))) (/ (sqrt 2.0) (- B_m)))
(* (/ (sqrt 2.0) B_m) (* (sqrt (+ C (hypot B_m C))) (- (sqrt F))))))))B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
double t_0 = pow(B_m, 2.0) - (C * (4.0 * A));
double tmp;
if (pow(B_m, 2.0) <= 20000.0) {
tmp = sqrt((2.0 * (F * (t_0 * (A + (C + hypot((A - C), B_m))))))) * (-1.0 / t_0);
} else if (pow(B_m, 2.0) <= 2e+39) {
tmp = sqrt((F * (-0.5 * (pow(B_m, 2.0) / C)))) * (sqrt(2.0) / -B_m);
} else {
tmp = (sqrt(2.0) / B_m) * (sqrt((C + hypot(B_m, C))) * -sqrt(F));
}
return tmp;
}
B_m = Math.abs(B);
public static double code(double A, double B_m, double C, double F) {
double t_0 = Math.pow(B_m, 2.0) - (C * (4.0 * A));
double tmp;
if (Math.pow(B_m, 2.0) <= 20000.0) {
tmp = Math.sqrt((2.0 * (F * (t_0 * (A + (C + Math.hypot((A - C), B_m))))))) * (-1.0 / t_0);
} else if (Math.pow(B_m, 2.0) <= 2e+39) {
tmp = Math.sqrt((F * (-0.5 * (Math.pow(B_m, 2.0) / C)))) * (Math.sqrt(2.0) / -B_m);
} else {
tmp = (Math.sqrt(2.0) / B_m) * (Math.sqrt((C + Math.hypot(B_m, C))) * -Math.sqrt(F));
}
return tmp;
}
B_m = math.fabs(B) def code(A, B_m, C, F): t_0 = math.pow(B_m, 2.0) - (C * (4.0 * A)) tmp = 0 if math.pow(B_m, 2.0) <= 20000.0: tmp = math.sqrt((2.0 * (F * (t_0 * (A + (C + math.hypot((A - C), B_m))))))) * (-1.0 / t_0) elif math.pow(B_m, 2.0) <= 2e+39: tmp = math.sqrt((F * (-0.5 * (math.pow(B_m, 2.0) / C)))) * (math.sqrt(2.0) / -B_m) else: tmp = (math.sqrt(2.0) / B_m) * (math.sqrt((C + math.hypot(B_m, C))) * -math.sqrt(F)) return tmp
B_m = abs(B) function code(A, B_m, C, F) t_0 = Float64((B_m ^ 2.0) - Float64(C * Float64(4.0 * A))) tmp = 0.0 if ((B_m ^ 2.0) <= 20000.0) tmp = Float64(sqrt(Float64(2.0 * Float64(F * Float64(t_0 * Float64(A + Float64(C + hypot(Float64(A - C), B_m))))))) * Float64(-1.0 / t_0)); elseif ((B_m ^ 2.0) <= 2e+39) tmp = Float64(sqrt(Float64(F * Float64(-0.5 * Float64((B_m ^ 2.0) / C)))) * Float64(sqrt(2.0) / Float64(-B_m))); else tmp = Float64(Float64(sqrt(2.0) / B_m) * Float64(sqrt(Float64(C + hypot(B_m, C))) * Float64(-sqrt(F)))); end return tmp end
B_m = abs(B); function tmp_2 = code(A, B_m, C, F) t_0 = (B_m ^ 2.0) - (C * (4.0 * A)); tmp = 0.0; if ((B_m ^ 2.0) <= 20000.0) tmp = sqrt((2.0 * (F * (t_0 * (A + (C + hypot((A - C), B_m))))))) * (-1.0 / t_0); elseif ((B_m ^ 2.0) <= 2e+39) tmp = sqrt((F * (-0.5 * ((B_m ^ 2.0) / C)))) * (sqrt(2.0) / -B_m); else tmp = (sqrt(2.0) / B_m) * (sqrt((C + hypot(B_m, C))) * -sqrt(F)); end tmp_2 = tmp; end
B_m = N[Abs[B], $MachinePrecision]
code[A_, B$95$m_, C_, F_] := Block[{t$95$0 = N[(N[Power[B$95$m, 2.0], $MachinePrecision] - N[(C * N[(4.0 * A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 20000.0], N[(N[Sqrt[N[(2.0 * N[(F * N[(t$95$0 * N[(A + N[(C + N[Sqrt[N[(A - C), $MachinePrecision] ^ 2 + B$95$m ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(-1.0 / t$95$0), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 2e+39], N[(N[Sqrt[N[(F * N[(-0.5 * N[(N[Power[B$95$m, 2.0], $MachinePrecision] / C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[Sqrt[2.0], $MachinePrecision] / (-B$95$m)), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[2.0], $MachinePrecision] / B$95$m), $MachinePrecision] * N[(N[Sqrt[N[(C + N[Sqrt[B$95$m ^ 2 + C ^ 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-N[Sqrt[F], $MachinePrecision])), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
B_m = \left|B\right|
\\
\begin{array}{l}
t_0 := {B\_m}^{2} - C \cdot \left(4 \cdot A\right)\\
\mathbf{if}\;{B\_m}^{2} \leq 20000:\\
\;\;\;\;\sqrt{2 \cdot \left(F \cdot \left(t\_0 \cdot \left(A + \left(C + \mathsf{hypot}\left(A - C, B\_m\right)\right)\right)\right)\right)} \cdot \frac{-1}{t\_0}\\
\mathbf{elif}\;{B\_m}^{2} \leq 2 \cdot 10^{+39}:\\
\;\;\;\;\sqrt{F \cdot \left(-0.5 \cdot \frac{{B\_m}^{2}}{C}\right)} \cdot \frac{\sqrt{2}}{-B\_m}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{2}}{B\_m} \cdot \left(\sqrt{C + \mathsf{hypot}\left(B\_m, C\right)} \cdot \left(-\sqrt{F}\right)\right)\\
\end{array}
\end{array}
if (pow.f64 B 2) < 2e4Initial program 24.6%
associate-+l+25.6%
add-cube-cbrt25.8%
fma-define25.7%
pow225.7%
unpow225.7%
unpow225.7%
hypot-define31.4%
Applied egg-rr31.4%
div-inv30.8%
Applied egg-rr30.8%
distribute-lft-neg-out30.8%
associate-*l*31.2%
Simplified31.2%
if 2e4 < (pow.f64 B 2) < 1.99999999999999988e39Initial program 11.1%
Taylor expanded in A around 0 2.6%
mul-1-neg2.6%
unpow22.6%
unpow22.6%
hypot-define3.8%
Simplified3.8%
Taylor expanded in C around -inf 27.3%
if 1.99999999999999988e39 < (pow.f64 B 2) Initial program 9.5%
Taylor expanded in A around 0 7.0%
mul-1-neg7.0%
unpow27.0%
unpow27.0%
hypot-define21.5%
Simplified21.5%
pow1/221.5%
*-commutative21.5%
unpow-prod-down31.3%
pow1/231.3%
pow1/231.3%
Applied egg-rr31.3%
Final simplification31.1%
B_m = (fabs.f64 B)
(FPCore (A B_m C F)
:precision binary64
(if (<= F -5e-310)
(/
(- (sqrt (* (+ (+ A C) (hypot B_m (- A C))) (* (* A -8.0) (* C F)))))
(fma B_m B_m (* A (* C -4.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 tmp;
if (F <= -5e-310) {
tmp = -sqrt((((A + C) + hypot(B_m, (A - C))) * ((A * -8.0) * (C * F)))) / fma(B_m, B_m, (A * (C * -4.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) tmp = 0.0 if (F <= -5e-310) tmp = Float64(Float64(-sqrt(Float64(Float64(Float64(A + C) + hypot(B_m, Float64(A - C))) * Float64(Float64(A * -8.0) * Float64(C * F))))) / fma(B_m, B_m, Float64(A * Float64(C * -4.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_] := If[LessEqual[F, -5e-310], N[((-N[Sqrt[N[(N[(N[(A + C), $MachinePrecision] + N[Sqrt[B$95$m ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision] * N[(N[(A * -8.0), $MachinePrecision] * N[(C * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / N[(B$95$m * B$95$m + N[(A * N[(C * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $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}
\mathbf{if}\;F \leq -5 \cdot 10^{-310}:\\
\;\;\;\;\frac{-\sqrt{\left(\left(A + C\right) + \mathsf{hypot}\left(B\_m, A - C\right)\right) \cdot \left(\left(A \cdot -8\right) \cdot \left(C \cdot F\right)\right)}}{\mathsf{fma}\left(B\_m, B\_m, A \cdot \left(C \cdot -4\right)\right)}\\
\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 F < -4.999999999999985e-310Initial program 34.0%
Simplified45.4%
Taylor expanded in B around 0 39.3%
associate-*r*39.4%
Simplified39.4%
if -4.999999999999985e-310 < F Initial program 13.9%
Taylor expanded in C around 0 7.9%
mul-1-neg7.9%
+-commutative7.9%
unpow27.9%
unpow27.9%
hypot-define14.8%
Simplified14.8%
pow1/214.8%
*-commutative14.8%
unpow-prod-down19.7%
pow1/219.7%
pow1/219.7%
Applied egg-rr19.7%
Final simplification23.0%
B_m = (fabs.f64 B)
(FPCore (A B_m C F)
:precision binary64
(if (<= F -5e-310)
(/
(- (sqrt (* (+ (+ A C) (hypot B_m (- A C))) (* (* A -8.0) (* C F)))))
(fma B_m B_m (* A (* C -4.0))))
(* (/ (sqrt 2.0) B_m) (* (sqrt (+ C (hypot B_m C))) (- (sqrt F))))))B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
double tmp;
if (F <= -5e-310) {
tmp = -sqrt((((A + C) + hypot(B_m, (A - C))) * ((A * -8.0) * (C * F)))) / fma(B_m, B_m, (A * (C * -4.0)));
} else {
tmp = (sqrt(2.0) / B_m) * (sqrt((C + hypot(B_m, C))) * -sqrt(F));
}
return tmp;
}
B_m = abs(B) function code(A, B_m, C, F) tmp = 0.0 if (F <= -5e-310) tmp = Float64(Float64(-sqrt(Float64(Float64(Float64(A + C) + hypot(B_m, Float64(A - C))) * Float64(Float64(A * -8.0) * Float64(C * F))))) / fma(B_m, B_m, Float64(A * Float64(C * -4.0)))); else tmp = Float64(Float64(sqrt(2.0) / B_m) * Float64(sqrt(Float64(C + hypot(B_m, C))) * Float64(-sqrt(F)))); end return tmp end
B_m = N[Abs[B], $MachinePrecision] code[A_, B$95$m_, C_, F_] := If[LessEqual[F, -5e-310], N[((-N[Sqrt[N[(N[(N[(A + C), $MachinePrecision] + N[Sqrt[B$95$m ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision] * N[(N[(A * -8.0), $MachinePrecision] * N[(C * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / N[(B$95$m * B$95$m + N[(A * N[(C * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[2.0], $MachinePrecision] / B$95$m), $MachinePrecision] * N[(N[Sqrt[N[(C + N[Sqrt[B$95$m ^ 2 + C ^ 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-N[Sqrt[F], $MachinePrecision])), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
B_m = \left|B\right|
\\
\begin{array}{l}
\mathbf{if}\;F \leq -5 \cdot 10^{-310}:\\
\;\;\;\;\frac{-\sqrt{\left(\left(A + C\right) + \mathsf{hypot}\left(B\_m, A - C\right)\right) \cdot \left(\left(A \cdot -8\right) \cdot \left(C \cdot F\right)\right)}}{\mathsf{fma}\left(B\_m, B\_m, A \cdot \left(C \cdot -4\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{2}}{B\_m} \cdot \left(\sqrt{C + \mathsf{hypot}\left(B\_m, C\right)} \cdot \left(-\sqrt{F}\right)\right)\\
\end{array}
\end{array}
if F < -4.999999999999985e-310Initial program 34.0%
Simplified45.4%
Taylor expanded in B around 0 39.3%
associate-*r*39.4%
Simplified39.4%
if -4.999999999999985e-310 < F Initial program 13.9%
Taylor expanded in A around 0 7.7%
mul-1-neg7.7%
unpow27.7%
unpow27.7%
hypot-define15.6%
Simplified15.6%
pow1/215.6%
*-commutative15.6%
unpow-prod-down20.9%
pow1/220.9%
pow1/220.9%
Applied egg-rr20.9%
Final simplification23.9%
B_m = (fabs.f64 B)
(FPCore (A B_m C F)
:precision binary64
(if (<= F -2.4e-302)
(/
(- (sqrt (* (+ (+ A C) (hypot B_m (- A C))) (* (* A -8.0) (* C F)))))
(fma B_m B_m (* A (* C -4.0))))
(if (<= F 9.5e+90)
(/ (sqrt (* (* 2.0 F) (+ C (hypot B_m C)))) (- B_m))
(* (sqrt 2.0) (- (sqrt (/ F B_m)))))))B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
double tmp;
if (F <= -2.4e-302) {
tmp = -sqrt((((A + C) + hypot(B_m, (A - C))) * ((A * -8.0) * (C * F)))) / fma(B_m, B_m, (A * (C * -4.0)));
} else if (F <= 9.5e+90) {
tmp = sqrt(((2.0 * F) * (C + hypot(B_m, C)))) / -B_m;
} else {
tmp = sqrt(2.0) * -sqrt((F / B_m));
}
return tmp;
}
B_m = abs(B) function code(A, B_m, C, F) tmp = 0.0 if (F <= -2.4e-302) tmp = Float64(Float64(-sqrt(Float64(Float64(Float64(A + C) + hypot(B_m, Float64(A - C))) * Float64(Float64(A * -8.0) * Float64(C * F))))) / fma(B_m, B_m, Float64(A * Float64(C * -4.0)))); elseif (F <= 9.5e+90) tmp = Float64(sqrt(Float64(Float64(2.0 * F) * Float64(C + hypot(B_m, C)))) / Float64(-B_m)); else tmp = Float64(sqrt(2.0) * Float64(-sqrt(Float64(F / B_m)))); end return tmp end
B_m = N[Abs[B], $MachinePrecision] code[A_, B$95$m_, C_, F_] := If[LessEqual[F, -2.4e-302], N[((-N[Sqrt[N[(N[(N[(A + C), $MachinePrecision] + N[Sqrt[B$95$m ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision] * N[(N[(A * -8.0), $MachinePrecision] * N[(C * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / N[(B$95$m * B$95$m + N[(A * N[(C * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 9.5e+90], N[(N[Sqrt[N[(N[(2.0 * F), $MachinePrecision] * N[(C + N[Sqrt[B$95$m ^ 2 + C ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / (-B$95$m)), $MachinePrecision], N[(N[Sqrt[2.0], $MachinePrecision] * (-N[Sqrt[N[(F / B$95$m), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]]]
\begin{array}{l}
B_m = \left|B\right|
\\
\begin{array}{l}
\mathbf{if}\;F \leq -2.4 \cdot 10^{-302}:\\
\;\;\;\;\frac{-\sqrt{\left(\left(A + C\right) + \mathsf{hypot}\left(B\_m, A - C\right)\right) \cdot \left(\left(A \cdot -8\right) \cdot \left(C \cdot F\right)\right)}}{\mathsf{fma}\left(B\_m, B\_m, A \cdot \left(C \cdot -4\right)\right)}\\
\mathbf{elif}\;F \leq 9.5 \cdot 10^{+90}:\\
\;\;\;\;\frac{\sqrt{\left(2 \cdot F\right) \cdot \left(C + \mathsf{hypot}\left(B\_m, C\right)\right)}}{-B\_m}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{2} \cdot \left(-\sqrt{\frac{F}{B\_m}}\right)\\
\end{array}
\end{array}
if F < -2.40000000000000022e-302Initial program 34.7%
Simplified46.4%
Taylor expanded in B around 0 40.2%
associate-*r*40.3%
Simplified40.3%
if -2.40000000000000022e-302 < F < 9.4999999999999994e90Initial program 15.2%
Taylor expanded in A around 0 8.5%
mul-1-neg8.5%
unpow28.5%
unpow28.5%
hypot-define20.8%
Simplified20.8%
associate-*l/20.8%
pow1/220.8%
pow1/220.8%
pow-prod-down20.9%
Applied egg-rr20.9%
unpow1/220.9%
associate-*r*20.9%
Simplified20.9%
if 9.4999999999999994e90 < F Initial program 12.0%
Taylor expanded in A around 0 6.3%
mul-1-neg6.3%
unpow26.3%
unpow26.3%
hypot-define7.8%
Simplified7.8%
Taylor expanded in C around 0 17.6%
Final simplification22.9%
B_m = (fabs.f64 B)
(FPCore (A B_m C F)
:precision binary64
(if (<= F -5e-310)
(/
(sqrt (* -16.0 (* (* C F) (pow A 2.0))))
(- (* 4.0 (* A C)) (pow B_m 2.0)))
(if (<= F 9.5e+90)
(/ (sqrt (* (* 2.0 F) (+ C (hypot B_m C)))) (- B_m))
(* (sqrt 2.0) (- (sqrt (/ F B_m)))))))B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
double tmp;
if (F <= -5e-310) {
tmp = sqrt((-16.0 * ((C * F) * pow(A, 2.0)))) / ((4.0 * (A * C)) - pow(B_m, 2.0));
} else if (F <= 9.5e+90) {
tmp = sqrt(((2.0 * F) * (C + hypot(B_m, C)))) / -B_m;
} else {
tmp = sqrt(2.0) * -sqrt((F / B_m));
}
return tmp;
}
B_m = Math.abs(B);
public static double code(double A, double B_m, double C, double F) {
double tmp;
if (F <= -5e-310) {
tmp = Math.sqrt((-16.0 * ((C * F) * Math.pow(A, 2.0)))) / ((4.0 * (A * C)) - Math.pow(B_m, 2.0));
} else if (F <= 9.5e+90) {
tmp = Math.sqrt(((2.0 * F) * (C + Math.hypot(B_m, C)))) / -B_m;
} else {
tmp = Math.sqrt(2.0) * -Math.sqrt((F / B_m));
}
return tmp;
}
B_m = math.fabs(B) def code(A, B_m, C, F): tmp = 0 if F <= -5e-310: tmp = math.sqrt((-16.0 * ((C * F) * math.pow(A, 2.0)))) / ((4.0 * (A * C)) - math.pow(B_m, 2.0)) elif F <= 9.5e+90: tmp = math.sqrt(((2.0 * F) * (C + math.hypot(B_m, C)))) / -B_m else: tmp = math.sqrt(2.0) * -math.sqrt((F / B_m)) return tmp
B_m = abs(B) function code(A, B_m, C, F) tmp = 0.0 if (F <= -5e-310) tmp = Float64(sqrt(Float64(-16.0 * Float64(Float64(C * F) * (A ^ 2.0)))) / Float64(Float64(4.0 * Float64(A * C)) - (B_m ^ 2.0))); elseif (F <= 9.5e+90) tmp = Float64(sqrt(Float64(Float64(2.0 * F) * Float64(C + hypot(B_m, C)))) / Float64(-B_m)); else tmp = Float64(sqrt(2.0) * Float64(-sqrt(Float64(F / B_m)))); end return tmp end
B_m = abs(B); function tmp_2 = code(A, B_m, C, F) tmp = 0.0; if (F <= -5e-310) tmp = sqrt((-16.0 * ((C * F) * (A ^ 2.0)))) / ((4.0 * (A * C)) - (B_m ^ 2.0)); elseif (F <= 9.5e+90) tmp = sqrt(((2.0 * F) * (C + hypot(B_m, C)))) / -B_m; else tmp = sqrt(2.0) * -sqrt((F / B_m)); end tmp_2 = tmp; end
B_m = N[Abs[B], $MachinePrecision] code[A_, B$95$m_, C_, F_] := If[LessEqual[F, -5e-310], N[(N[Sqrt[N[(-16.0 * N[(N[(C * F), $MachinePrecision] * N[Power[A, 2.0], $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[F, 9.5e+90], N[(N[Sqrt[N[(N[(2.0 * F), $MachinePrecision] * N[(C + N[Sqrt[B$95$m ^ 2 + C ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / (-B$95$m)), $MachinePrecision], N[(N[Sqrt[2.0], $MachinePrecision] * (-N[Sqrt[N[(F / B$95$m), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]]]
\begin{array}{l}
B_m = \left|B\right|
\\
\begin{array}{l}
\mathbf{if}\;F \leq -5 \cdot 10^{-310}:\\
\;\;\;\;\frac{\sqrt{-16 \cdot \left(\left(C \cdot F\right) \cdot {A}^{2}\right)}}{4 \cdot \left(A \cdot C\right) - {B\_m}^{2}}\\
\mathbf{elif}\;F \leq 9.5 \cdot 10^{+90}:\\
\;\;\;\;\frac{\sqrt{\left(2 \cdot F\right) \cdot \left(C + \mathsf{hypot}\left(B\_m, C\right)\right)}}{-B\_m}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{2} \cdot \left(-\sqrt{\frac{F}{B\_m}}\right)\\
\end{array}
\end{array}
if F < -4.999999999999985e-310Initial program 34.0%
Simplified41.6%
Taylor expanded in A around inf 17.5%
if -4.999999999999985e-310 < F < 9.4999999999999994e90Initial program 15.3%
Taylor expanded in A around 0 8.6%
mul-1-neg8.6%
unpow28.6%
unpow28.6%
hypot-define20.9%
Simplified20.9%
associate-*l/20.9%
pow1/220.9%
pow1/220.9%
pow-prod-down21.0%
Applied egg-rr21.0%
unpow1/221.0%
associate-*r*21.0%
Simplified21.0%
if 9.4999999999999994e90 < F Initial program 12.0%
Taylor expanded in A around 0 6.3%
mul-1-neg6.3%
unpow26.3%
unpow26.3%
hypot-define7.8%
Simplified7.8%
Taylor expanded in C around 0 17.6%
Final simplification19.3%
B_m = (fabs.f64 B)
(FPCore (A B_m C F)
:precision binary64
(if (<= F -5e-310)
(/
(sqrt (* (* A -16.0) (* F (pow C 2.0))))
(- (* 4.0 (* A C)) (pow B_m 2.0)))
(if (<= F 1.25e+91)
(/ (sqrt (* (* 2.0 F) (+ C (hypot B_m C)))) (- B_m))
(* (sqrt 2.0) (- (sqrt (/ F B_m)))))))B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
double tmp;
if (F <= -5e-310) {
tmp = sqrt(((A * -16.0) * (F * pow(C, 2.0)))) / ((4.0 * (A * C)) - pow(B_m, 2.0));
} else if (F <= 1.25e+91) {
tmp = sqrt(((2.0 * F) * (C + hypot(B_m, C)))) / -B_m;
} else {
tmp = sqrt(2.0) * -sqrt((F / B_m));
}
return tmp;
}
B_m = Math.abs(B);
public static double code(double A, double B_m, double C, double F) {
double tmp;
if (F <= -5e-310) {
tmp = Math.sqrt(((A * -16.0) * (F * Math.pow(C, 2.0)))) / ((4.0 * (A * C)) - Math.pow(B_m, 2.0));
} else if (F <= 1.25e+91) {
tmp = Math.sqrt(((2.0 * F) * (C + Math.hypot(B_m, C)))) / -B_m;
} else {
tmp = Math.sqrt(2.0) * -Math.sqrt((F / B_m));
}
return tmp;
}
B_m = math.fabs(B) def code(A, B_m, C, F): tmp = 0 if F <= -5e-310: tmp = math.sqrt(((A * -16.0) * (F * math.pow(C, 2.0)))) / ((4.0 * (A * C)) - math.pow(B_m, 2.0)) elif F <= 1.25e+91: tmp = math.sqrt(((2.0 * F) * (C + math.hypot(B_m, C)))) / -B_m else: tmp = math.sqrt(2.0) * -math.sqrt((F / B_m)) return tmp
B_m = abs(B) function code(A, B_m, C, F) tmp = 0.0 if (F <= -5e-310) tmp = Float64(sqrt(Float64(Float64(A * -16.0) * Float64(F * (C ^ 2.0)))) / Float64(Float64(4.0 * Float64(A * C)) - (B_m ^ 2.0))); elseif (F <= 1.25e+91) tmp = Float64(sqrt(Float64(Float64(2.0 * F) * Float64(C + hypot(B_m, C)))) / Float64(-B_m)); else tmp = Float64(sqrt(2.0) * Float64(-sqrt(Float64(F / B_m)))); end return tmp end
B_m = abs(B); function tmp_2 = code(A, B_m, C, F) tmp = 0.0; if (F <= -5e-310) tmp = sqrt(((A * -16.0) * (F * (C ^ 2.0)))) / ((4.0 * (A * C)) - (B_m ^ 2.0)); elseif (F <= 1.25e+91) tmp = sqrt(((2.0 * F) * (C + hypot(B_m, C)))) / -B_m; else tmp = sqrt(2.0) * -sqrt((F / B_m)); end tmp_2 = tmp; end
B_m = N[Abs[B], $MachinePrecision] code[A_, B$95$m_, C_, F_] := If[LessEqual[F, -5e-310], N[(N[Sqrt[N[(N[(A * -16.0), $MachinePrecision] * N[(F * N[Power[C, 2.0], $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[F, 1.25e+91], N[(N[Sqrt[N[(N[(2.0 * F), $MachinePrecision] * N[(C + N[Sqrt[B$95$m ^ 2 + C ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / (-B$95$m)), $MachinePrecision], N[(N[Sqrt[2.0], $MachinePrecision] * (-N[Sqrt[N[(F / B$95$m), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]]]
\begin{array}{l}
B_m = \left|B\right|
\\
\begin{array}{l}
\mathbf{if}\;F \leq -5 \cdot 10^{-310}:\\
\;\;\;\;\frac{\sqrt{\left(A \cdot -16\right) \cdot \left(F \cdot {C}^{2}\right)}}{4 \cdot \left(A \cdot C\right) - {B\_m}^{2}}\\
\mathbf{elif}\;F \leq 1.25 \cdot 10^{+91}:\\
\;\;\;\;\frac{\sqrt{\left(2 \cdot F\right) \cdot \left(C + \mathsf{hypot}\left(B\_m, C\right)\right)}}{-B\_m}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{2} \cdot \left(-\sqrt{\frac{F}{B\_m}}\right)\\
\end{array}
\end{array}
if F < -4.999999999999985e-310Initial program 34.0%
Simplified41.6%
Taylor expanded in A around -inf 18.6%
associate-*r*18.6%
Simplified18.6%
if -4.999999999999985e-310 < F < 1.2500000000000001e91Initial program 15.3%
Taylor expanded in A around 0 8.6%
mul-1-neg8.6%
unpow28.6%
unpow28.6%
hypot-define20.9%
Simplified20.9%
associate-*l/20.9%
pow1/220.9%
pow1/220.9%
pow-prod-down21.0%
Applied egg-rr21.0%
unpow1/221.0%
associate-*r*21.0%
Simplified21.0%
if 1.2500000000000001e91 < F Initial program 12.0%
Taylor expanded in A around 0 6.3%
mul-1-neg6.3%
unpow26.3%
unpow26.3%
hypot-define7.8%
Simplified7.8%
Taylor expanded in C around 0 17.6%
Final simplification19.5%
B_m = (fabs.f64 B) (FPCore (A B_m C F) :precision binary64 (if (<= F 5.8e+64) (/ (sqrt (* 2.0 (* F (+ A (hypot B_m A))))) (- B_m)) (* (sqrt 2.0) (- (sqrt (/ F B_m))))))
B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
double tmp;
if (F <= 5.8e+64) {
tmp = sqrt((2.0 * (F * (A + hypot(B_m, A))))) / -B_m;
} else {
tmp = sqrt(2.0) * -sqrt((F / B_m));
}
return tmp;
}
B_m = Math.abs(B);
public static double code(double A, double B_m, double C, double F) {
double tmp;
if (F <= 5.8e+64) {
tmp = Math.sqrt((2.0 * (F * (A + Math.hypot(B_m, A))))) / -B_m;
} else {
tmp = Math.sqrt(2.0) * -Math.sqrt((F / B_m));
}
return tmp;
}
B_m = math.fabs(B) def code(A, B_m, C, F): tmp = 0 if F <= 5.8e+64: tmp = math.sqrt((2.0 * (F * (A + math.hypot(B_m, A))))) / -B_m else: tmp = math.sqrt(2.0) * -math.sqrt((F / B_m)) return tmp
B_m = abs(B) function code(A, B_m, C, F) tmp = 0.0 if (F <= 5.8e+64) tmp = Float64(sqrt(Float64(2.0 * Float64(F * Float64(A + hypot(B_m, A))))) / Float64(-B_m)); else tmp = Float64(sqrt(2.0) * Float64(-sqrt(Float64(F / B_m)))); end return tmp end
B_m = abs(B); function tmp_2 = code(A, B_m, C, F) tmp = 0.0; if (F <= 5.8e+64) tmp = sqrt((2.0 * (F * (A + hypot(B_m, A))))) / -B_m; else tmp = sqrt(2.0) * -sqrt((F / B_m)); end tmp_2 = tmp; end
B_m = N[Abs[B], $MachinePrecision] code[A_, B$95$m_, C_, F_] := If[LessEqual[F, 5.8e+64], N[(N[Sqrt[N[(2.0 * N[(F * N[(A + N[Sqrt[B$95$m ^ 2 + A ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / (-B$95$m)), $MachinePrecision], N[(N[Sqrt[2.0], $MachinePrecision] * (-N[Sqrt[N[(F / B$95$m), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]]
\begin{array}{l}
B_m = \left|B\right|
\\
\begin{array}{l}
\mathbf{if}\;F \leq 5.8 \cdot 10^{+64}:\\
\;\;\;\;\frac{\sqrt{2 \cdot \left(F \cdot \left(A + \mathsf{hypot}\left(B\_m, A\right)\right)\right)}}{-B\_m}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{2} \cdot \left(-\sqrt{\frac{F}{B\_m}}\right)\\
\end{array}
\end{array}
if F < 5.79999999999999986e64Initial program 20.2%
Taylor expanded in C around 0 6.9%
mul-1-neg6.9%
+-commutative6.9%
unpow26.9%
unpow26.9%
hypot-define16.0%
Simplified16.0%
associate-*l/16.0%
pow1/216.0%
pow1/216.1%
pow-prod-down16.2%
Applied egg-rr16.2%
unpow1/216.0%
Simplified16.0%
if 5.79999999999999986e64 < F Initial program 12.1%
Taylor expanded in A around 0 6.0%
mul-1-neg6.0%
unpow26.0%
unpow26.0%
hypot-define7.3%
Simplified7.3%
Taylor expanded in C around 0 16.2%
Final simplification16.1%
B_m = (fabs.f64 B) (FPCore (A B_m C F) :precision binary64 (if (<= F 9.5e+90) (/ (sqrt (* (* 2.0 F) (+ C (hypot B_m C)))) (- B_m)) (* (sqrt 2.0) (- (sqrt (/ F B_m))))))
B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
double tmp;
if (F <= 9.5e+90) {
tmp = sqrt(((2.0 * F) * (C + hypot(B_m, C)))) / -B_m;
} else {
tmp = sqrt(2.0) * -sqrt((F / B_m));
}
return tmp;
}
B_m = Math.abs(B);
public static double code(double A, double B_m, double C, double F) {
double tmp;
if (F <= 9.5e+90) {
tmp = Math.sqrt(((2.0 * F) * (C + Math.hypot(B_m, C)))) / -B_m;
} else {
tmp = Math.sqrt(2.0) * -Math.sqrt((F / B_m));
}
return tmp;
}
B_m = math.fabs(B) def code(A, B_m, C, F): tmp = 0 if F <= 9.5e+90: tmp = math.sqrt(((2.0 * F) * (C + math.hypot(B_m, C)))) / -B_m else: tmp = math.sqrt(2.0) * -math.sqrt((F / B_m)) return tmp
B_m = abs(B) function code(A, B_m, C, F) tmp = 0.0 if (F <= 9.5e+90) tmp = Float64(sqrt(Float64(Float64(2.0 * F) * Float64(C + hypot(B_m, C)))) / Float64(-B_m)); else tmp = Float64(sqrt(2.0) * Float64(-sqrt(Float64(F / B_m)))); end return tmp end
B_m = abs(B); function tmp_2 = code(A, B_m, C, F) tmp = 0.0; if (F <= 9.5e+90) tmp = sqrt(((2.0 * F) * (C + hypot(B_m, C)))) / -B_m; else tmp = sqrt(2.0) * -sqrt((F / B_m)); end tmp_2 = tmp; end
B_m = N[Abs[B], $MachinePrecision] code[A_, B$95$m_, C_, F_] := If[LessEqual[F, 9.5e+90], N[(N[Sqrt[N[(N[(2.0 * F), $MachinePrecision] * N[(C + N[Sqrt[B$95$m ^ 2 + C ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / (-B$95$m)), $MachinePrecision], N[(N[Sqrt[2.0], $MachinePrecision] * (-N[Sqrt[N[(F / B$95$m), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]]
\begin{array}{l}
B_m = \left|B\right|
\\
\begin{array}{l}
\mathbf{if}\;F \leq 9.5 \cdot 10^{+90}:\\
\;\;\;\;\frac{\sqrt{\left(2 \cdot F\right) \cdot \left(C + \mathsf{hypot}\left(B\_m, C\right)\right)}}{-B\_m}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{2} \cdot \left(-\sqrt{\frac{F}{B\_m}}\right)\\
\end{array}
\end{array}
if F < 9.4999999999999994e90Initial program 19.9%
Taylor expanded in A around 0 6.5%
mul-1-neg6.5%
unpow26.5%
unpow26.5%
hypot-define15.7%
Simplified15.7%
associate-*l/15.8%
pow1/215.8%
pow1/215.9%
pow-prod-down16.0%
Applied egg-rr16.0%
unpow1/215.8%
associate-*r*15.8%
Simplified15.8%
if 9.4999999999999994e90 < F Initial program 12.0%
Taylor expanded in A around 0 6.3%
mul-1-neg6.3%
unpow26.3%
unpow26.3%
hypot-define7.8%
Simplified7.8%
Taylor expanded in C around 0 17.6%
Final simplification16.4%
B_m = (fabs.f64 B) (FPCore (A B_m C F) :precision binary64 (if (<= F 7.5e+80) (* (/ (sqrt 2.0) B_m) (- (sqrt (* B_m F)))) (* (sqrt 2.0) (- (sqrt (/ F B_m))))))
B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
double tmp;
if (F <= 7.5e+80) {
tmp = (sqrt(2.0) / B_m) * -sqrt((B_m * F));
} else {
tmp = sqrt(2.0) * -sqrt((F / B_m));
}
return tmp;
}
B_m = abs(B)
real(8) function code(a, b_m, c, f)
real(8), intent (in) :: a
real(8), intent (in) :: b_m
real(8), intent (in) :: c
real(8), intent (in) :: f
real(8) :: tmp
if (f <= 7.5d+80) then
tmp = (sqrt(2.0d0) / b_m) * -sqrt((b_m * f))
else
tmp = sqrt(2.0d0) * -sqrt((f / b_m))
end if
code = tmp
end function
B_m = Math.abs(B);
public static double code(double A, double B_m, double C, double F) {
double tmp;
if (F <= 7.5e+80) {
tmp = (Math.sqrt(2.0) / B_m) * -Math.sqrt((B_m * F));
} else {
tmp = Math.sqrt(2.0) * -Math.sqrt((F / B_m));
}
return tmp;
}
B_m = math.fabs(B) def code(A, B_m, C, F): tmp = 0 if F <= 7.5e+80: tmp = (math.sqrt(2.0) / B_m) * -math.sqrt((B_m * F)) else: tmp = math.sqrt(2.0) * -math.sqrt((F / B_m)) return tmp
B_m = abs(B) function code(A, B_m, C, F) tmp = 0.0 if (F <= 7.5e+80) tmp = Float64(Float64(sqrt(2.0) / B_m) * Float64(-sqrt(Float64(B_m * F)))); else tmp = Float64(sqrt(2.0) * Float64(-sqrt(Float64(F / B_m)))); end return tmp end
B_m = abs(B); function tmp_2 = code(A, B_m, C, F) tmp = 0.0; if (F <= 7.5e+80) tmp = (sqrt(2.0) / B_m) * -sqrt((B_m * F)); else tmp = sqrt(2.0) * -sqrt((F / B_m)); end tmp_2 = tmp; end
B_m = N[Abs[B], $MachinePrecision] code[A_, B$95$m_, C_, F_] := If[LessEqual[F, 7.5e+80], N[(N[(N[Sqrt[2.0], $MachinePrecision] / B$95$m), $MachinePrecision] * (-N[Sqrt[N[(B$95$m * F), $MachinePrecision]], $MachinePrecision])), $MachinePrecision], N[(N[Sqrt[2.0], $MachinePrecision] * (-N[Sqrt[N[(F / B$95$m), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]]
\begin{array}{l}
B_m = \left|B\right|
\\
\begin{array}{l}
\mathbf{if}\;F \leq 7.5 \cdot 10^{+80}:\\
\;\;\;\;\frac{\sqrt{2}}{B\_m} \cdot \left(-\sqrt{B\_m \cdot F}\right)\\
\mathbf{else}:\\
\;\;\;\;\sqrt{2} \cdot \left(-\sqrt{\frac{F}{B\_m}}\right)\\
\end{array}
\end{array}
if F < 7.49999999999999994e80Initial program 19.9%
Taylor expanded in A around 0 6.6%
mul-1-neg6.6%
unpow26.6%
unpow26.6%
hypot-define16.2%
Simplified16.2%
Taylor expanded in C around 0 14.9%
if 7.49999999999999994e80 < F Initial program 12.4%
Taylor expanded in A around 0 6.1%
mul-1-neg6.1%
unpow26.1%
unpow26.1%
hypot-define7.5%
Simplified7.5%
Taylor expanded in C around 0 16.7%
Final simplification15.5%
B_m = (fabs.f64 B) (FPCore (A B_m C F) :precision binary64 (* (sqrt 2.0) (- (sqrt (/ F B_m)))))
B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
return sqrt(2.0) * -sqrt((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) * -sqrt((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) * -Math.sqrt((F / B_m));
}
B_m = math.fabs(B) def code(A, B_m, C, F): return math.sqrt(2.0) * -math.sqrt((F / B_m))
B_m = abs(B) function code(A, B_m, C, F) return Float64(sqrt(2.0) * Float64(-sqrt(Float64(F / B_m)))) end
B_m = abs(B); function tmp = code(A, B_m, C, F) tmp = sqrt(2.0) * -sqrt((F / B_m)); end
B_m = N[Abs[B], $MachinePrecision] code[A_, B$95$m_, C_, F_] := N[(N[Sqrt[2.0], $MachinePrecision] * (-N[Sqrt[N[(F / B$95$m), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]
\begin{array}{l}
B_m = \left|B\right|
\\
\sqrt{2} \cdot \left(-\sqrt{\frac{F}{B\_m}}\right)
\end{array}
Initial program 17.2%
Taylor expanded in A around 0 6.4%
mul-1-neg6.4%
unpow26.4%
unpow26.4%
hypot-define13.1%
Simplified13.1%
Taylor expanded in C around 0 10.9%
Final simplification10.9%
herbie shell --seed 2024044
(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))))