
(FPCore (F B x) :precision binary64 (+ (- (* x (/ 1.0 (tan B)))) (* (/ F (sin B)) (pow (+ (+ (* F F) 2.0) (* 2.0 x)) (- (/ 1.0 2.0))))))
double code(double F, double B, double x) {
return -(x * (1.0 / tan(B))) + ((F / sin(B)) * pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
code = -(x * (1.0d0 / tan(b))) + ((f / sin(b)) * ((((f * f) + 2.0d0) + (2.0d0 * x)) ** -(1.0d0 / 2.0d0)))
end function
public static double code(double F, double B, double x) {
return -(x * (1.0 / Math.tan(B))) + ((F / Math.sin(B)) * Math.pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
}
def code(F, B, x): return -(x * (1.0 / math.tan(B))) + ((F / math.sin(B)) * math.pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)))
function code(F, B, x) return Float64(Float64(-Float64(x * Float64(1.0 / tan(B)))) + Float64(Float64(F / sin(B)) * (Float64(Float64(Float64(F * F) + 2.0) + Float64(2.0 * x)) ^ Float64(-Float64(1.0 / 2.0))))) end
function tmp = code(F, B, x) tmp = -(x * (1.0 / tan(B))) + ((F / sin(B)) * ((((F * F) + 2.0) + (2.0 * x)) ^ -(1.0 / 2.0))); end
code[F_, B_, x_] := N[((-N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]) + N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Power[N[(N[(N[(F * F), $MachinePrecision] + 2.0), $MachinePrecision] + N[(2.0 * x), $MachinePrecision]), $MachinePrecision], (-N[(1.0 / 2.0), $MachinePrecision])], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 19 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (F B x) :precision binary64 (+ (- (* x (/ 1.0 (tan B)))) (* (/ F (sin B)) (pow (+ (+ (* F F) 2.0) (* 2.0 x)) (- (/ 1.0 2.0))))))
double code(double F, double B, double x) {
return -(x * (1.0 / tan(B))) + ((F / sin(B)) * pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
code = -(x * (1.0d0 / tan(b))) + ((f / sin(b)) * ((((f * f) + 2.0d0) + (2.0d0 * x)) ** -(1.0d0 / 2.0d0)))
end function
public static double code(double F, double B, double x) {
return -(x * (1.0 / Math.tan(B))) + ((F / Math.sin(B)) * Math.pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
}
def code(F, B, x): return -(x * (1.0 / math.tan(B))) + ((F / math.sin(B)) * math.pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)))
function code(F, B, x) return Float64(Float64(-Float64(x * Float64(1.0 / tan(B)))) + Float64(Float64(F / sin(B)) * (Float64(Float64(Float64(F * F) + 2.0) + Float64(2.0 * x)) ^ Float64(-Float64(1.0 / 2.0))))) end
function tmp = code(F, B, x) tmp = -(x * (1.0 / tan(B))) + ((F / sin(B)) * ((((F * F) + 2.0) + (2.0 * x)) ^ -(1.0 / 2.0))); end
code[F_, B_, x_] := N[((-N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]) + N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Power[N[(N[(N[(F * F), $MachinePrecision] + 2.0), $MachinePrecision] + N[(2.0 * x), $MachinePrecision]), $MachinePrecision], (-N[(1.0 / 2.0), $MachinePrecision])], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}
\end{array}
B_m = (fabs.f64 B)
B_s = (copysign.f64 1 B)
(FPCore (B_s F B_m x)
:precision binary64
(let* ((t_0 (/ F (sin B_m)))
(t_1 (/ x (tan B_m)))
(t_2 (pow (+ (+ (* F F) 2.0) (* x 2.0)) -0.5))
(t_3 (/ -1.0 (/ (tan B_m) x)))
(t_4 (+ (* x (/ -1.0 (tan B_m))) (* t_0 t_2))))
(*
B_s
(if (<= t_4 -1e-184)
(- (* F (/ (pow (fma x 2.0 (fma F F 2.0)) -0.5) (sin B_m))) t_1)
(if (<= t_4 5e-170)
(+ t_3 (* t_0 (/ 1.0 (- (/ (- -1.0 x) F) F))))
(if (<= t_4 5e+219)
(+ t_3 (* t_2 (* F (/ 1.0 (sin B_m)))))
(- (/ 1.0 B_m) t_1)))))))B_m = fabs(B);
B_s = copysign(1.0, B);
double code(double B_s, double F, double B_m, double x) {
double t_0 = F / sin(B_m);
double t_1 = x / tan(B_m);
double t_2 = pow((((F * F) + 2.0) + (x * 2.0)), -0.5);
double t_3 = -1.0 / (tan(B_m) / x);
double t_4 = (x * (-1.0 / tan(B_m))) + (t_0 * t_2);
double tmp;
if (t_4 <= -1e-184) {
tmp = (F * (pow(fma(x, 2.0, fma(F, F, 2.0)), -0.5) / sin(B_m))) - t_1;
} else if (t_4 <= 5e-170) {
tmp = t_3 + (t_0 * (1.0 / (((-1.0 - x) / F) - F)));
} else if (t_4 <= 5e+219) {
tmp = t_3 + (t_2 * (F * (1.0 / sin(B_m))));
} else {
tmp = (1.0 / B_m) - t_1;
}
return B_s * tmp;
}
B_m = abs(B) B_s = copysign(1.0, B) function code(B_s, F, B_m, x) t_0 = Float64(F / sin(B_m)) t_1 = Float64(x / tan(B_m)) t_2 = Float64(Float64(Float64(F * F) + 2.0) + Float64(x * 2.0)) ^ -0.5 t_3 = Float64(-1.0 / Float64(tan(B_m) / x)) t_4 = Float64(Float64(x * Float64(-1.0 / tan(B_m))) + Float64(t_0 * t_2)) tmp = 0.0 if (t_4 <= -1e-184) tmp = Float64(Float64(F * Float64((fma(x, 2.0, fma(F, F, 2.0)) ^ -0.5) / sin(B_m))) - t_1); elseif (t_4 <= 5e-170) tmp = Float64(t_3 + Float64(t_0 * Float64(1.0 / Float64(Float64(Float64(-1.0 - x) / F) - F)))); elseif (t_4 <= 5e+219) tmp = Float64(t_3 + Float64(t_2 * Float64(F * Float64(1.0 / sin(B_m))))); else tmp = Float64(Float64(1.0 / B_m) - t_1); end return Float64(B_s * tmp) end
B_m = N[Abs[B], $MachinePrecision]
B_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[B]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[B$95$s_, F_, B$95$m_, x_] := Block[{t$95$0 = N[(F / N[Sin[B$95$m], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x / N[Tan[B$95$m], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Power[N[(N[(N[(F * F), $MachinePrecision] + 2.0), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]}, Block[{t$95$3 = N[(-1.0 / N[(N[Tan[B$95$m], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[(x * N[(-1.0 / N[Tan[B$95$m], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$0 * t$95$2), $MachinePrecision]), $MachinePrecision]}, N[(B$95$s * If[LessEqual[t$95$4, -1e-184], N[(N[(F * N[(N[Power[N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] / N[Sin[B$95$m], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[t$95$4, 5e-170], N[(t$95$3 + N[(t$95$0 * N[(1.0 / N[(N[(N[(-1.0 - x), $MachinePrecision] / F), $MachinePrecision] - F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$4, 5e+219], N[(t$95$3 + N[(t$95$2 * N[(F * N[(1.0 / N[Sin[B$95$m], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / B$95$m), $MachinePrecision] - t$95$1), $MachinePrecision]]]]), $MachinePrecision]]]]]]
\begin{array}{l}
B_m = \left|B\right|
\\
B_s = \mathsf{copysign}\left(1, B\right)
\\
\begin{array}{l}
t_0 := \frac{F}{\sin B\_m}\\
t_1 := \frac{x}{\tan B\_m}\\
t_2 := {\left(\left(F \cdot F + 2\right) + x \cdot 2\right)}^{-0.5}\\
t_3 := \frac{-1}{\frac{\tan B\_m}{x}}\\
t_4 := x \cdot \frac{-1}{\tan B\_m} + t\_0 \cdot t\_2\\
B\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_4 \leq -1 \cdot 10^{-184}:\\
\;\;\;\;F \cdot \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B\_m} - t\_1\\
\mathbf{elif}\;t\_4 \leq 5 \cdot 10^{-170}:\\
\;\;\;\;t\_3 + t\_0 \cdot \frac{1}{\frac{-1 - x}{F} - F}\\
\mathbf{elif}\;t\_4 \leq 5 \cdot 10^{+219}:\\
\;\;\;\;t\_3 + t\_2 \cdot \left(F \cdot \frac{1}{\sin B\_m}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{B\_m} - t\_1\\
\end{array}
\end{array}
\end{array}
if (+.f64 (neg.f64 (*.f64 x (/.f64 1 (tan.f64 B)))) (*.f64 (/.f64 F (sin.f64 B)) (pow.f64 (+.f64 (+.f64 (*.f64 F F) 2) (*.f64 2 x)) (neg.f64 (/.f64 1 2))))) < -1.0000000000000001e-184Initial program 81.6%
distribute-lft-neg-in81.6%
+-commutative81.6%
associate-*l/87.7%
associate-/l*87.5%
fma-define87.6%
/-rgt-identity87.6%
remove-double-neg87.6%
fma-neg87.5%
Simplified87.7%
if -1.0000000000000001e-184 < (+.f64 (neg.f64 (*.f64 x (/.f64 1 (tan.f64 B)))) (*.f64 (/.f64 F (sin.f64 B)) (pow.f64 (+.f64 (+.f64 (*.f64 F F) 2) (*.f64 2 x)) (neg.f64 (/.f64 1 2))))) < 5.0000000000000001e-170Initial program 44.5%
div-inv44.8%
clear-num44.5%
Applied egg-rr44.5%
add-sqr-sqrt44.3%
unpow-prod-down44.3%
+-commutative44.3%
fma-define44.3%
fma-define44.3%
metadata-eval44.3%
metadata-eval44.3%
+-commutative44.3%
fma-define44.3%
fma-define44.3%
metadata-eval44.3%
metadata-eval44.3%
Applied egg-rr44.3%
pow-sqr44.3%
metadata-eval44.3%
unpow-144.3%
Simplified44.3%
Taylor expanded in F around -inf 72.3%
neg-mul-172.3%
+-commutative72.3%
unsub-neg72.3%
associate-*r/72.3%
distribute-lft-in72.3%
metadata-eval72.3%
associate-*r*72.3%
metadata-eval72.3%
mul-1-neg72.3%
Simplified72.3%
if 5.0000000000000001e-170 < (+.f64 (neg.f64 (*.f64 x (/.f64 1 (tan.f64 B)))) (*.f64 (/.f64 F (sin.f64 B)) (pow.f64 (+.f64 (+.f64 (*.f64 F F) 2) (*.f64 2 x)) (neg.f64 (/.f64 1 2))))) < 5e219Initial program 96.3%
div-inv96.4%
clear-num96.4%
Applied egg-rr96.4%
clear-num96.4%
associate-/r/96.3%
Applied egg-rr96.3%
if 5e219 < (+.f64 (neg.f64 (*.f64 x (/.f64 1 (tan.f64 B)))) (*.f64 (/.f64 F (sin.f64 B)) (pow.f64 (+.f64 (+.f64 (*.f64 F F) 2) (*.f64 2 x)) (neg.f64 (/.f64 1 2))))) Initial program 21.7%
distribute-lft-neg-in21.7%
+-commutative21.7%
associate-*l/33.8%
associate-/l*33.8%
fma-define33.8%
/-rgt-identity33.8%
remove-double-neg33.8%
fma-neg33.8%
Simplified33.8%
Taylor expanded in F around inf 84.4%
Taylor expanded in B around 0 91.0%
Final simplification90.1%
B_m = (fabs.f64 B)
B_s = (copysign.f64 1 B)
(FPCore (B_s F B_m x)
:precision binary64
(let* ((t_0 (/ F (sin B_m)))
(t_1 (pow (+ (+ (* F F) 2.0) (* x 2.0)) -0.5))
(t_2 (+ (* x (/ -1.0 (tan B_m))) (* t_0 t_1)))
(t_3 (/ -1.0 (/ (tan B_m) x))))
(*
B_s
(if (<= t_2 -1e-184)
t_2
(if (<= t_2 5e-170)
(+ t_3 (* t_0 (/ 1.0 (- (/ (- -1.0 x) F) F))))
(if (<= t_2 5e+219)
(+ t_3 (* t_1 (* F (/ 1.0 (sin B_m)))))
(- (/ 1.0 B_m) (/ x (tan B_m)))))))))B_m = fabs(B);
B_s = copysign(1.0, B);
double code(double B_s, double F, double B_m, double x) {
double t_0 = F / sin(B_m);
double t_1 = pow((((F * F) + 2.0) + (x * 2.0)), -0.5);
double t_2 = (x * (-1.0 / tan(B_m))) + (t_0 * t_1);
double t_3 = -1.0 / (tan(B_m) / x);
double tmp;
if (t_2 <= -1e-184) {
tmp = t_2;
} else if (t_2 <= 5e-170) {
tmp = t_3 + (t_0 * (1.0 / (((-1.0 - x) / F) - F)));
} else if (t_2 <= 5e+219) {
tmp = t_3 + (t_1 * (F * (1.0 / sin(B_m))));
} else {
tmp = (1.0 / B_m) - (x / tan(B_m));
}
return B_s * tmp;
}
B_m = abs(B)
B_s = copysign(1.0d0, B)
real(8) function code(b_s, f, b_m, x)
real(8), intent (in) :: b_s
real(8), intent (in) :: f
real(8), intent (in) :: b_m
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_0 = f / sin(b_m)
t_1 = (((f * f) + 2.0d0) + (x * 2.0d0)) ** (-0.5d0)
t_2 = (x * ((-1.0d0) / tan(b_m))) + (t_0 * t_1)
t_3 = (-1.0d0) / (tan(b_m) / x)
if (t_2 <= (-1d-184)) then
tmp = t_2
else if (t_2 <= 5d-170) then
tmp = t_3 + (t_0 * (1.0d0 / ((((-1.0d0) - x) / f) - f)))
else if (t_2 <= 5d+219) then
tmp = t_3 + (t_1 * (f * (1.0d0 / sin(b_m))))
else
tmp = (1.0d0 / b_m) - (x / tan(b_m))
end if
code = b_s * tmp
end function
B_m = Math.abs(B);
B_s = Math.copySign(1.0, B);
public static double code(double B_s, double F, double B_m, double x) {
double t_0 = F / Math.sin(B_m);
double t_1 = Math.pow((((F * F) + 2.0) + (x * 2.0)), -0.5);
double t_2 = (x * (-1.0 / Math.tan(B_m))) + (t_0 * t_1);
double t_3 = -1.0 / (Math.tan(B_m) / x);
double tmp;
if (t_2 <= -1e-184) {
tmp = t_2;
} else if (t_2 <= 5e-170) {
tmp = t_3 + (t_0 * (1.0 / (((-1.0 - x) / F) - F)));
} else if (t_2 <= 5e+219) {
tmp = t_3 + (t_1 * (F * (1.0 / Math.sin(B_m))));
} else {
tmp = (1.0 / B_m) - (x / Math.tan(B_m));
}
return B_s * tmp;
}
B_m = math.fabs(B) B_s = math.copysign(1.0, B) def code(B_s, F, B_m, x): t_0 = F / math.sin(B_m) t_1 = math.pow((((F * F) + 2.0) + (x * 2.0)), -0.5) t_2 = (x * (-1.0 / math.tan(B_m))) + (t_0 * t_1) t_3 = -1.0 / (math.tan(B_m) / x) tmp = 0 if t_2 <= -1e-184: tmp = t_2 elif t_2 <= 5e-170: tmp = t_3 + (t_0 * (1.0 / (((-1.0 - x) / F) - F))) elif t_2 <= 5e+219: tmp = t_3 + (t_1 * (F * (1.0 / math.sin(B_m)))) else: tmp = (1.0 / B_m) - (x / math.tan(B_m)) return B_s * tmp
B_m = abs(B) B_s = copysign(1.0, B) function code(B_s, F, B_m, x) t_0 = Float64(F / sin(B_m)) t_1 = Float64(Float64(Float64(F * F) + 2.0) + Float64(x * 2.0)) ^ -0.5 t_2 = Float64(Float64(x * Float64(-1.0 / tan(B_m))) + Float64(t_0 * t_1)) t_3 = Float64(-1.0 / Float64(tan(B_m) / x)) tmp = 0.0 if (t_2 <= -1e-184) tmp = t_2; elseif (t_2 <= 5e-170) tmp = Float64(t_3 + Float64(t_0 * Float64(1.0 / Float64(Float64(Float64(-1.0 - x) / F) - F)))); elseif (t_2 <= 5e+219) tmp = Float64(t_3 + Float64(t_1 * Float64(F * Float64(1.0 / sin(B_m))))); else tmp = Float64(Float64(1.0 / B_m) - Float64(x / tan(B_m))); end return Float64(B_s * tmp) end
B_m = abs(B); B_s = sign(B) * abs(1.0); function tmp_2 = code(B_s, F, B_m, x) t_0 = F / sin(B_m); t_1 = (((F * F) + 2.0) + (x * 2.0)) ^ -0.5; t_2 = (x * (-1.0 / tan(B_m))) + (t_0 * t_1); t_3 = -1.0 / (tan(B_m) / x); tmp = 0.0; if (t_2 <= -1e-184) tmp = t_2; elseif (t_2 <= 5e-170) tmp = t_3 + (t_0 * (1.0 / (((-1.0 - x) / F) - F))); elseif (t_2 <= 5e+219) tmp = t_3 + (t_1 * (F * (1.0 / sin(B_m)))); else tmp = (1.0 / B_m) - (x / tan(B_m)); end tmp_2 = B_s * tmp; end
B_m = N[Abs[B], $MachinePrecision]
B_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[B]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[B$95$s_, F_, B$95$m_, x_] := Block[{t$95$0 = N[(F / N[Sin[B$95$m], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Power[N[(N[(N[(F * F), $MachinePrecision] + 2.0), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]}, Block[{t$95$2 = N[(N[(x * N[(-1.0 / N[Tan[B$95$m], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$0 * t$95$1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(-1.0 / N[(N[Tan[B$95$m], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]}, N[(B$95$s * If[LessEqual[t$95$2, -1e-184], t$95$2, If[LessEqual[t$95$2, 5e-170], N[(t$95$3 + N[(t$95$0 * N[(1.0 / N[(N[(N[(-1.0 - x), $MachinePrecision] / F), $MachinePrecision] - F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 5e+219], N[(t$95$3 + N[(t$95$1 * N[(F * N[(1.0 / N[Sin[B$95$m], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / B$95$m), $MachinePrecision] - N[(x / N[Tan[B$95$m], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]), $MachinePrecision]]]]]
\begin{array}{l}
B_m = \left|B\right|
\\
B_s = \mathsf{copysign}\left(1, B\right)
\\
\begin{array}{l}
t_0 := \frac{F}{\sin B\_m}\\
t_1 := {\left(\left(F \cdot F + 2\right) + x \cdot 2\right)}^{-0.5}\\
t_2 := x \cdot \frac{-1}{\tan B\_m} + t\_0 \cdot t\_1\\
t_3 := \frac{-1}{\frac{\tan B\_m}{x}}\\
B\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_2 \leq -1 \cdot 10^{-184}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{-170}:\\
\;\;\;\;t\_3 + t\_0 \cdot \frac{1}{\frac{-1 - x}{F} - F}\\
\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+219}:\\
\;\;\;\;t\_3 + t\_1 \cdot \left(F \cdot \frac{1}{\sin B\_m}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{B\_m} - \frac{x}{\tan B\_m}\\
\end{array}
\end{array}
\end{array}
if (+.f64 (neg.f64 (*.f64 x (/.f64 1 (tan.f64 B)))) (*.f64 (/.f64 F (sin.f64 B)) (pow.f64 (+.f64 (+.f64 (*.f64 F F) 2) (*.f64 2 x)) (neg.f64 (/.f64 1 2))))) < -1.0000000000000001e-184Initial program 81.6%
if -1.0000000000000001e-184 < (+.f64 (neg.f64 (*.f64 x (/.f64 1 (tan.f64 B)))) (*.f64 (/.f64 F (sin.f64 B)) (pow.f64 (+.f64 (+.f64 (*.f64 F F) 2) (*.f64 2 x)) (neg.f64 (/.f64 1 2))))) < 5.0000000000000001e-170Initial program 44.5%
div-inv44.8%
clear-num44.5%
Applied egg-rr44.5%
add-sqr-sqrt44.3%
unpow-prod-down44.3%
+-commutative44.3%
fma-define44.3%
fma-define44.3%
metadata-eval44.3%
metadata-eval44.3%
+-commutative44.3%
fma-define44.3%
fma-define44.3%
metadata-eval44.3%
metadata-eval44.3%
Applied egg-rr44.3%
pow-sqr44.3%
metadata-eval44.3%
unpow-144.3%
Simplified44.3%
Taylor expanded in F around -inf 72.3%
neg-mul-172.3%
+-commutative72.3%
unsub-neg72.3%
associate-*r/72.3%
distribute-lft-in72.3%
metadata-eval72.3%
associate-*r*72.3%
metadata-eval72.3%
mul-1-neg72.3%
Simplified72.3%
if 5.0000000000000001e-170 < (+.f64 (neg.f64 (*.f64 x (/.f64 1 (tan.f64 B)))) (*.f64 (/.f64 F (sin.f64 B)) (pow.f64 (+.f64 (+.f64 (*.f64 F F) 2) (*.f64 2 x)) (neg.f64 (/.f64 1 2))))) < 5e219Initial program 96.3%
div-inv96.4%
clear-num96.4%
Applied egg-rr96.4%
clear-num96.4%
associate-/r/96.3%
Applied egg-rr96.3%
if 5e219 < (+.f64 (neg.f64 (*.f64 x (/.f64 1 (tan.f64 B)))) (*.f64 (/.f64 F (sin.f64 B)) (pow.f64 (+.f64 (+.f64 (*.f64 F F) 2) (*.f64 2 x)) (neg.f64 (/.f64 1 2))))) Initial program 21.7%
distribute-lft-neg-in21.7%
+-commutative21.7%
associate-*l/33.8%
associate-/l*33.8%
fma-define33.8%
/-rgt-identity33.8%
remove-double-neg33.8%
fma-neg33.8%
Simplified33.8%
Taylor expanded in F around inf 84.4%
Taylor expanded in B around 0 91.0%
Final simplification88.0%
B_m = (fabs.f64 B)
B_s = (copysign.f64 1 B)
(FPCore (B_s F B_m x)
:precision binary64
(let* ((t_0 (/ F (sin B_m)))
(t_1
(+
(* x (/ -1.0 (tan B_m)))
(* t_0 (pow (+ (+ (* F F) 2.0) (* x 2.0)) -0.5)))))
(*
B_s
(if (<= t_1 -1e-184)
t_1
(if (<= t_1 5e-170)
(+ (/ -1.0 (/ (tan B_m) x)) (* t_0 (/ 1.0 (- (/ (- -1.0 x) F) F))))
(if (<= t_1 5e+219) t_1 (- (/ 1.0 B_m) (/ x (tan B_m)))))))))B_m = fabs(B);
B_s = copysign(1.0, B);
double code(double B_s, double F, double B_m, double x) {
double t_0 = F / sin(B_m);
double t_1 = (x * (-1.0 / tan(B_m))) + (t_0 * pow((((F * F) + 2.0) + (x * 2.0)), -0.5));
double tmp;
if (t_1 <= -1e-184) {
tmp = t_1;
} else if (t_1 <= 5e-170) {
tmp = (-1.0 / (tan(B_m) / x)) + (t_0 * (1.0 / (((-1.0 - x) / F) - F)));
} else if (t_1 <= 5e+219) {
tmp = t_1;
} else {
tmp = (1.0 / B_m) - (x / tan(B_m));
}
return B_s * tmp;
}
B_m = abs(B)
B_s = copysign(1.0d0, B)
real(8) function code(b_s, f, b_m, x)
real(8), intent (in) :: b_s
real(8), intent (in) :: f
real(8), intent (in) :: b_m
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = f / sin(b_m)
t_1 = (x * ((-1.0d0) / tan(b_m))) + (t_0 * ((((f * f) + 2.0d0) + (x * 2.0d0)) ** (-0.5d0)))
if (t_1 <= (-1d-184)) then
tmp = t_1
else if (t_1 <= 5d-170) then
tmp = ((-1.0d0) / (tan(b_m) / x)) + (t_0 * (1.0d0 / ((((-1.0d0) - x) / f) - f)))
else if (t_1 <= 5d+219) then
tmp = t_1
else
tmp = (1.0d0 / b_m) - (x / tan(b_m))
end if
code = b_s * tmp
end function
B_m = Math.abs(B);
B_s = Math.copySign(1.0, B);
public static double code(double B_s, double F, double B_m, double x) {
double t_0 = F / Math.sin(B_m);
double t_1 = (x * (-1.0 / Math.tan(B_m))) + (t_0 * Math.pow((((F * F) + 2.0) + (x * 2.0)), -0.5));
double tmp;
if (t_1 <= -1e-184) {
tmp = t_1;
} else if (t_1 <= 5e-170) {
tmp = (-1.0 / (Math.tan(B_m) / x)) + (t_0 * (1.0 / (((-1.0 - x) / F) - F)));
} else if (t_1 <= 5e+219) {
tmp = t_1;
} else {
tmp = (1.0 / B_m) - (x / Math.tan(B_m));
}
return B_s * tmp;
}
B_m = math.fabs(B) B_s = math.copysign(1.0, B) def code(B_s, F, B_m, x): t_0 = F / math.sin(B_m) t_1 = (x * (-1.0 / math.tan(B_m))) + (t_0 * math.pow((((F * F) + 2.0) + (x * 2.0)), -0.5)) tmp = 0 if t_1 <= -1e-184: tmp = t_1 elif t_1 <= 5e-170: tmp = (-1.0 / (math.tan(B_m) / x)) + (t_0 * (1.0 / (((-1.0 - x) / F) - F))) elif t_1 <= 5e+219: tmp = t_1 else: tmp = (1.0 / B_m) - (x / math.tan(B_m)) return B_s * tmp
B_m = abs(B) B_s = copysign(1.0, B) function code(B_s, F, B_m, x) t_0 = Float64(F / sin(B_m)) t_1 = Float64(Float64(x * Float64(-1.0 / tan(B_m))) + Float64(t_0 * (Float64(Float64(Float64(F * F) + 2.0) + Float64(x * 2.0)) ^ -0.5))) tmp = 0.0 if (t_1 <= -1e-184) tmp = t_1; elseif (t_1 <= 5e-170) tmp = Float64(Float64(-1.0 / Float64(tan(B_m) / x)) + Float64(t_0 * Float64(1.0 / Float64(Float64(Float64(-1.0 - x) / F) - F)))); elseif (t_1 <= 5e+219) tmp = t_1; else tmp = Float64(Float64(1.0 / B_m) - Float64(x / tan(B_m))); end return Float64(B_s * tmp) end
B_m = abs(B); B_s = sign(B) * abs(1.0); function tmp_2 = code(B_s, F, B_m, x) t_0 = F / sin(B_m); t_1 = (x * (-1.0 / tan(B_m))) + (t_0 * ((((F * F) + 2.0) + (x * 2.0)) ^ -0.5)); tmp = 0.0; if (t_1 <= -1e-184) tmp = t_1; elseif (t_1 <= 5e-170) tmp = (-1.0 / (tan(B_m) / x)) + (t_0 * (1.0 / (((-1.0 - x) / F) - F))); elseif (t_1 <= 5e+219) tmp = t_1; else tmp = (1.0 / B_m) - (x / tan(B_m)); end tmp_2 = B_s * tmp; end
B_m = N[Abs[B], $MachinePrecision]
B_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[B]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[B$95$s_, F_, B$95$m_, x_] := Block[{t$95$0 = N[(F / N[Sin[B$95$m], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x * N[(-1.0 / N[Tan[B$95$m], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$0 * N[Power[N[(N[(N[(F * F), $MachinePrecision] + 2.0), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(B$95$s * If[LessEqual[t$95$1, -1e-184], t$95$1, If[LessEqual[t$95$1, 5e-170], N[(N[(-1.0 / N[(N[Tan[B$95$m], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] + N[(t$95$0 * N[(1.0 / N[(N[(N[(-1.0 - x), $MachinePrecision] / F), $MachinePrecision] - F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 5e+219], t$95$1, N[(N[(1.0 / B$95$m), $MachinePrecision] - N[(x / N[Tan[B$95$m], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]), $MachinePrecision]]]
\begin{array}{l}
B_m = \left|B\right|
\\
B_s = \mathsf{copysign}\left(1, B\right)
\\
\begin{array}{l}
t_0 := \frac{F}{\sin B\_m}\\
t_1 := x \cdot \frac{-1}{\tan B\_m} + t\_0 \cdot {\left(\left(F \cdot F + 2\right) + x \cdot 2\right)}^{-0.5}\\
B\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{-184}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{-170}:\\
\;\;\;\;\frac{-1}{\frac{\tan B\_m}{x}} + t\_0 \cdot \frac{1}{\frac{-1 - x}{F} - F}\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+219}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{B\_m} - \frac{x}{\tan B\_m}\\
\end{array}
\end{array}
\end{array}
if (+.f64 (neg.f64 (*.f64 x (/.f64 1 (tan.f64 B)))) (*.f64 (/.f64 F (sin.f64 B)) (pow.f64 (+.f64 (+.f64 (*.f64 F F) 2) (*.f64 2 x)) (neg.f64 (/.f64 1 2))))) < -1.0000000000000001e-184 or 5.0000000000000001e-170 < (+.f64 (neg.f64 (*.f64 x (/.f64 1 (tan.f64 B)))) (*.f64 (/.f64 F (sin.f64 B)) (pow.f64 (+.f64 (+.f64 (*.f64 F F) 2) (*.f64 2 x)) (neg.f64 (/.f64 1 2))))) < 5e219Initial program 87.6%
if -1.0000000000000001e-184 < (+.f64 (neg.f64 (*.f64 x (/.f64 1 (tan.f64 B)))) (*.f64 (/.f64 F (sin.f64 B)) (pow.f64 (+.f64 (+.f64 (*.f64 F F) 2) (*.f64 2 x)) (neg.f64 (/.f64 1 2))))) < 5.0000000000000001e-170Initial program 44.5%
div-inv44.8%
clear-num44.5%
Applied egg-rr44.5%
add-sqr-sqrt44.3%
unpow-prod-down44.3%
+-commutative44.3%
fma-define44.3%
fma-define44.3%
metadata-eval44.3%
metadata-eval44.3%
+-commutative44.3%
fma-define44.3%
fma-define44.3%
metadata-eval44.3%
metadata-eval44.3%
Applied egg-rr44.3%
pow-sqr44.3%
metadata-eval44.3%
unpow-144.3%
Simplified44.3%
Taylor expanded in F around -inf 72.3%
neg-mul-172.3%
+-commutative72.3%
unsub-neg72.3%
associate-*r/72.3%
distribute-lft-in72.3%
metadata-eval72.3%
associate-*r*72.3%
metadata-eval72.3%
mul-1-neg72.3%
Simplified72.3%
if 5e219 < (+.f64 (neg.f64 (*.f64 x (/.f64 1 (tan.f64 B)))) (*.f64 (/.f64 F (sin.f64 B)) (pow.f64 (+.f64 (+.f64 (*.f64 F F) 2) (*.f64 2 x)) (neg.f64 (/.f64 1 2))))) Initial program 21.7%
distribute-lft-neg-in21.7%
+-commutative21.7%
associate-*l/33.8%
associate-/l*33.8%
fma-define33.8%
/-rgt-identity33.8%
remove-double-neg33.8%
fma-neg33.8%
Simplified33.8%
Taylor expanded in F around inf 84.4%
Taylor expanded in B around 0 91.0%
Final simplification88.0%
B_m = (fabs.f64 B)
B_s = (copysign.f64 1 B)
(FPCore (B_s F B_m x)
:precision binary64
(let* ((t_0 (/ F (sin B_m)))
(t_1 (* t_0 (pow (+ (+ (* F F) 2.0) (* x 2.0)) -0.5)))
(t_2 (+ (* x (/ -1.0 (tan B_m))) t_1))
(t_3 (/ -1.0 (/ (tan B_m) x))))
(*
B_s
(if (<= t_2 -1e-184)
t_2
(if (<= t_2 5e-170)
(+ t_3 (* t_0 (/ 1.0 (- (/ (- -1.0 x) F) F))))
(if (<= t_2 5e+219) (+ t_1 t_3) (- (/ 1.0 B_m) (/ x (tan B_m)))))))))B_m = fabs(B);
B_s = copysign(1.0, B);
double code(double B_s, double F, double B_m, double x) {
double t_0 = F / sin(B_m);
double t_1 = t_0 * pow((((F * F) + 2.0) + (x * 2.0)), -0.5);
double t_2 = (x * (-1.0 / tan(B_m))) + t_1;
double t_3 = -1.0 / (tan(B_m) / x);
double tmp;
if (t_2 <= -1e-184) {
tmp = t_2;
} else if (t_2 <= 5e-170) {
tmp = t_3 + (t_0 * (1.0 / (((-1.0 - x) / F) - F)));
} else if (t_2 <= 5e+219) {
tmp = t_1 + t_3;
} else {
tmp = (1.0 / B_m) - (x / tan(B_m));
}
return B_s * tmp;
}
B_m = abs(B)
B_s = copysign(1.0d0, B)
real(8) function code(b_s, f, b_m, x)
real(8), intent (in) :: b_s
real(8), intent (in) :: f
real(8), intent (in) :: b_m
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_0 = f / sin(b_m)
t_1 = t_0 * ((((f * f) + 2.0d0) + (x * 2.0d0)) ** (-0.5d0))
t_2 = (x * ((-1.0d0) / tan(b_m))) + t_1
t_3 = (-1.0d0) / (tan(b_m) / x)
if (t_2 <= (-1d-184)) then
tmp = t_2
else if (t_2 <= 5d-170) then
tmp = t_3 + (t_0 * (1.0d0 / ((((-1.0d0) - x) / f) - f)))
else if (t_2 <= 5d+219) then
tmp = t_1 + t_3
else
tmp = (1.0d0 / b_m) - (x / tan(b_m))
end if
code = b_s * tmp
end function
B_m = Math.abs(B);
B_s = Math.copySign(1.0, B);
public static double code(double B_s, double F, double B_m, double x) {
double t_0 = F / Math.sin(B_m);
double t_1 = t_0 * Math.pow((((F * F) + 2.0) + (x * 2.0)), -0.5);
double t_2 = (x * (-1.0 / Math.tan(B_m))) + t_1;
double t_3 = -1.0 / (Math.tan(B_m) / x);
double tmp;
if (t_2 <= -1e-184) {
tmp = t_2;
} else if (t_2 <= 5e-170) {
tmp = t_3 + (t_0 * (1.0 / (((-1.0 - x) / F) - F)));
} else if (t_2 <= 5e+219) {
tmp = t_1 + t_3;
} else {
tmp = (1.0 / B_m) - (x / Math.tan(B_m));
}
return B_s * tmp;
}
B_m = math.fabs(B) B_s = math.copysign(1.0, B) def code(B_s, F, B_m, x): t_0 = F / math.sin(B_m) t_1 = t_0 * math.pow((((F * F) + 2.0) + (x * 2.0)), -0.5) t_2 = (x * (-1.0 / math.tan(B_m))) + t_1 t_3 = -1.0 / (math.tan(B_m) / x) tmp = 0 if t_2 <= -1e-184: tmp = t_2 elif t_2 <= 5e-170: tmp = t_3 + (t_0 * (1.0 / (((-1.0 - x) / F) - F))) elif t_2 <= 5e+219: tmp = t_1 + t_3 else: tmp = (1.0 / B_m) - (x / math.tan(B_m)) return B_s * tmp
B_m = abs(B) B_s = copysign(1.0, B) function code(B_s, F, B_m, x) t_0 = Float64(F / sin(B_m)) t_1 = Float64(t_0 * (Float64(Float64(Float64(F * F) + 2.0) + Float64(x * 2.0)) ^ -0.5)) t_2 = Float64(Float64(x * Float64(-1.0 / tan(B_m))) + t_1) t_3 = Float64(-1.0 / Float64(tan(B_m) / x)) tmp = 0.0 if (t_2 <= -1e-184) tmp = t_2; elseif (t_2 <= 5e-170) tmp = Float64(t_3 + Float64(t_0 * Float64(1.0 / Float64(Float64(Float64(-1.0 - x) / F) - F)))); elseif (t_2 <= 5e+219) tmp = Float64(t_1 + t_3); else tmp = Float64(Float64(1.0 / B_m) - Float64(x / tan(B_m))); end return Float64(B_s * tmp) end
B_m = abs(B); B_s = sign(B) * abs(1.0); function tmp_2 = code(B_s, F, B_m, x) t_0 = F / sin(B_m); t_1 = t_0 * ((((F * F) + 2.0) + (x * 2.0)) ^ -0.5); t_2 = (x * (-1.0 / tan(B_m))) + t_1; t_3 = -1.0 / (tan(B_m) / x); tmp = 0.0; if (t_2 <= -1e-184) tmp = t_2; elseif (t_2 <= 5e-170) tmp = t_3 + (t_0 * (1.0 / (((-1.0 - x) / F) - F))); elseif (t_2 <= 5e+219) tmp = t_1 + t_3; else tmp = (1.0 / B_m) - (x / tan(B_m)); end tmp_2 = B_s * tmp; end
B_m = N[Abs[B], $MachinePrecision]
B_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[B]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[B$95$s_, F_, B$95$m_, x_] := Block[{t$95$0 = N[(F / N[Sin[B$95$m], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(t$95$0 * N[Power[N[(N[(N[(F * F), $MachinePrecision] + 2.0), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x * N[(-1.0 / N[Tan[B$95$m], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision]}, Block[{t$95$3 = N[(-1.0 / N[(N[Tan[B$95$m], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]}, N[(B$95$s * If[LessEqual[t$95$2, -1e-184], t$95$2, If[LessEqual[t$95$2, 5e-170], N[(t$95$3 + N[(t$95$0 * N[(1.0 / N[(N[(N[(-1.0 - x), $MachinePrecision] / F), $MachinePrecision] - F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 5e+219], N[(t$95$1 + t$95$3), $MachinePrecision], N[(N[(1.0 / B$95$m), $MachinePrecision] - N[(x / N[Tan[B$95$m], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]), $MachinePrecision]]]]]
\begin{array}{l}
B_m = \left|B\right|
\\
B_s = \mathsf{copysign}\left(1, B\right)
\\
\begin{array}{l}
t_0 := \frac{F}{\sin B\_m}\\
t_1 := t\_0 \cdot {\left(\left(F \cdot F + 2\right) + x \cdot 2\right)}^{-0.5}\\
t_2 := x \cdot \frac{-1}{\tan B\_m} + t\_1\\
t_3 := \frac{-1}{\frac{\tan B\_m}{x}}\\
B\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_2 \leq -1 \cdot 10^{-184}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{-170}:\\
\;\;\;\;t\_3 + t\_0 \cdot \frac{1}{\frac{-1 - x}{F} - F}\\
\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+219}:\\
\;\;\;\;t\_1 + t\_3\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{B\_m} - \frac{x}{\tan B\_m}\\
\end{array}
\end{array}
\end{array}
if (+.f64 (neg.f64 (*.f64 x (/.f64 1 (tan.f64 B)))) (*.f64 (/.f64 F (sin.f64 B)) (pow.f64 (+.f64 (+.f64 (*.f64 F F) 2) (*.f64 2 x)) (neg.f64 (/.f64 1 2))))) < -1.0000000000000001e-184Initial program 81.6%
if -1.0000000000000001e-184 < (+.f64 (neg.f64 (*.f64 x (/.f64 1 (tan.f64 B)))) (*.f64 (/.f64 F (sin.f64 B)) (pow.f64 (+.f64 (+.f64 (*.f64 F F) 2) (*.f64 2 x)) (neg.f64 (/.f64 1 2))))) < 5.0000000000000001e-170Initial program 44.5%
div-inv44.8%
clear-num44.5%
Applied egg-rr44.5%
add-sqr-sqrt44.3%
unpow-prod-down44.3%
+-commutative44.3%
fma-define44.3%
fma-define44.3%
metadata-eval44.3%
metadata-eval44.3%
+-commutative44.3%
fma-define44.3%
fma-define44.3%
metadata-eval44.3%
metadata-eval44.3%
Applied egg-rr44.3%
pow-sqr44.3%
metadata-eval44.3%
unpow-144.3%
Simplified44.3%
Taylor expanded in F around -inf 72.3%
neg-mul-172.3%
+-commutative72.3%
unsub-neg72.3%
associate-*r/72.3%
distribute-lft-in72.3%
metadata-eval72.3%
associate-*r*72.3%
metadata-eval72.3%
mul-1-neg72.3%
Simplified72.3%
if 5.0000000000000001e-170 < (+.f64 (neg.f64 (*.f64 x (/.f64 1 (tan.f64 B)))) (*.f64 (/.f64 F (sin.f64 B)) (pow.f64 (+.f64 (+.f64 (*.f64 F F) 2) (*.f64 2 x)) (neg.f64 (/.f64 1 2))))) < 5e219Initial program 96.3%
div-inv96.4%
clear-num96.4%
Applied egg-rr96.4%
if 5e219 < (+.f64 (neg.f64 (*.f64 x (/.f64 1 (tan.f64 B)))) (*.f64 (/.f64 F (sin.f64 B)) (pow.f64 (+.f64 (+.f64 (*.f64 F F) 2) (*.f64 2 x)) (neg.f64 (/.f64 1 2))))) Initial program 21.7%
distribute-lft-neg-in21.7%
+-commutative21.7%
associate-*l/33.8%
associate-/l*33.8%
fma-define33.8%
/-rgt-identity33.8%
remove-double-neg33.8%
fma-neg33.8%
Simplified33.8%
Taylor expanded in F around inf 84.4%
Taylor expanded in B around 0 91.0%
Final simplification88.0%
B_m = (fabs.f64 B)
B_s = (copysign.f64 1 B)
(FPCore (B_s F B_m x)
:precision binary64
(let* ((t_0 (/ 1.0 (sin B_m))))
(*
B_s
(if (<= F -8.5e-43)
(+ (/ -1.0 (/ (tan B_m) x)) (/ -1.0 (sin B_m)))
(if (<= F -3.5e-171)
(- (* F (* t_0 (sqrt (/ 1.0 (+ 2.0 (* x 2.0)))))) (/ x (tan B_m)))
(if (<= F 6.1e-44)
(/ x (- (tan B_m)))
(+ (* x (/ -1.0 (tan B_m))) t_0)))))))B_m = fabs(B);
B_s = copysign(1.0, B);
double code(double B_s, double F, double B_m, double x) {
double t_0 = 1.0 / sin(B_m);
double tmp;
if (F <= -8.5e-43) {
tmp = (-1.0 / (tan(B_m) / x)) + (-1.0 / sin(B_m));
} else if (F <= -3.5e-171) {
tmp = (F * (t_0 * sqrt((1.0 / (2.0 + (x * 2.0)))))) - (x / tan(B_m));
} else if (F <= 6.1e-44) {
tmp = x / -tan(B_m);
} else {
tmp = (x * (-1.0 / tan(B_m))) + t_0;
}
return B_s * tmp;
}
B_m = abs(B)
B_s = copysign(1.0d0, B)
real(8) function code(b_s, f, b_m, x)
real(8), intent (in) :: b_s
real(8), intent (in) :: f
real(8), intent (in) :: b_m
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: tmp
t_0 = 1.0d0 / sin(b_m)
if (f <= (-8.5d-43)) then
tmp = ((-1.0d0) / (tan(b_m) / x)) + ((-1.0d0) / sin(b_m))
else if (f <= (-3.5d-171)) then
tmp = (f * (t_0 * sqrt((1.0d0 / (2.0d0 + (x * 2.0d0)))))) - (x / tan(b_m))
else if (f <= 6.1d-44) then
tmp = x / -tan(b_m)
else
tmp = (x * ((-1.0d0) / tan(b_m))) + t_0
end if
code = b_s * tmp
end function
B_m = Math.abs(B);
B_s = Math.copySign(1.0, B);
public static double code(double B_s, double F, double B_m, double x) {
double t_0 = 1.0 / Math.sin(B_m);
double tmp;
if (F <= -8.5e-43) {
tmp = (-1.0 / (Math.tan(B_m) / x)) + (-1.0 / Math.sin(B_m));
} else if (F <= -3.5e-171) {
tmp = (F * (t_0 * Math.sqrt((1.0 / (2.0 + (x * 2.0)))))) - (x / Math.tan(B_m));
} else if (F <= 6.1e-44) {
tmp = x / -Math.tan(B_m);
} else {
tmp = (x * (-1.0 / Math.tan(B_m))) + t_0;
}
return B_s * tmp;
}
B_m = math.fabs(B) B_s = math.copysign(1.0, B) def code(B_s, F, B_m, x): t_0 = 1.0 / math.sin(B_m) tmp = 0 if F <= -8.5e-43: tmp = (-1.0 / (math.tan(B_m) / x)) + (-1.0 / math.sin(B_m)) elif F <= -3.5e-171: tmp = (F * (t_0 * math.sqrt((1.0 / (2.0 + (x * 2.0)))))) - (x / math.tan(B_m)) elif F <= 6.1e-44: tmp = x / -math.tan(B_m) else: tmp = (x * (-1.0 / math.tan(B_m))) + t_0 return B_s * tmp
B_m = abs(B) B_s = copysign(1.0, B) function code(B_s, F, B_m, x) t_0 = Float64(1.0 / sin(B_m)) tmp = 0.0 if (F <= -8.5e-43) tmp = Float64(Float64(-1.0 / Float64(tan(B_m) / x)) + Float64(-1.0 / sin(B_m))); elseif (F <= -3.5e-171) tmp = Float64(Float64(F * Float64(t_0 * sqrt(Float64(1.0 / Float64(2.0 + Float64(x * 2.0)))))) - Float64(x / tan(B_m))); elseif (F <= 6.1e-44) tmp = Float64(x / Float64(-tan(B_m))); else tmp = Float64(Float64(x * Float64(-1.0 / tan(B_m))) + t_0); end return Float64(B_s * tmp) end
B_m = abs(B); B_s = sign(B) * abs(1.0); function tmp_2 = code(B_s, F, B_m, x) t_0 = 1.0 / sin(B_m); tmp = 0.0; if (F <= -8.5e-43) tmp = (-1.0 / (tan(B_m) / x)) + (-1.0 / sin(B_m)); elseif (F <= -3.5e-171) tmp = (F * (t_0 * sqrt((1.0 / (2.0 + (x * 2.0)))))) - (x / tan(B_m)); elseif (F <= 6.1e-44) tmp = x / -tan(B_m); else tmp = (x * (-1.0 / tan(B_m))) + t_0; end tmp_2 = B_s * tmp; end
B_m = N[Abs[B], $MachinePrecision]
B_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[B]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[B$95$s_, F_, B$95$m_, x_] := Block[{t$95$0 = N[(1.0 / N[Sin[B$95$m], $MachinePrecision]), $MachinePrecision]}, N[(B$95$s * If[LessEqual[F, -8.5e-43], N[(N[(-1.0 / N[(N[Tan[B$95$m], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] + N[(-1.0 / N[Sin[B$95$m], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -3.5e-171], N[(N[(F * N[(t$95$0 * N[Sqrt[N[(1.0 / N[(2.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B$95$m], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 6.1e-44], N[(x / (-N[Tan[B$95$m], $MachinePrecision])), $MachinePrecision], N[(N[(x * N[(-1.0 / N[Tan[B$95$m], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$0), $MachinePrecision]]]]), $MachinePrecision]]
\begin{array}{l}
B_m = \left|B\right|
\\
B_s = \mathsf{copysign}\left(1, B\right)
\\
\begin{array}{l}
t_0 := \frac{1}{\sin B\_m}\\
B\_s \cdot \begin{array}{l}
\mathbf{if}\;F \leq -8.5 \cdot 10^{-43}:\\
\;\;\;\;\frac{-1}{\frac{\tan B\_m}{x}} + \frac{-1}{\sin B\_m}\\
\mathbf{elif}\;F \leq -3.5 \cdot 10^{-171}:\\
\;\;\;\;F \cdot \left(t\_0 \cdot \sqrt{\frac{1}{2 + x \cdot 2}}\right) - \frac{x}{\tan B\_m}\\
\mathbf{elif}\;F \leq 6.1 \cdot 10^{-44}:\\
\;\;\;\;\frac{x}{-\tan B\_m}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{-1}{\tan B\_m} + t\_0\\
\end{array}
\end{array}
\end{array}
if F < -8.50000000000000056e-43Initial program 62.4%
div-inv62.5%
clear-num62.5%
Applied egg-rr62.5%
clear-num62.4%
associate-/r/62.5%
Applied egg-rr62.5%
Taylor expanded in F around -inf 97.1%
if -8.50000000000000056e-43 < F < -3.49999999999999994e-171Initial program 82.2%
distribute-lft-neg-in82.2%
+-commutative82.2%
associate-*l/82.1%
associate-/l*82.2%
fma-define82.2%
/-rgt-identity82.2%
remove-double-neg82.2%
fma-neg82.2%
Simplified82.1%
Taylor expanded in F around 0 82.2%
if -3.49999999999999994e-171 < F < 6.0999999999999996e-44Initial program 66.2%
distribute-lft-neg-in66.2%
+-commutative66.2%
fma-define66.3%
+-commutative66.3%
*-commutative66.3%
fma-define66.3%
fma-define66.3%
metadata-eval66.3%
metadata-eval66.3%
associate-*r/66.4%
*-rgt-identity66.4%
Simplified66.4%
Taylor expanded in F around 0 84.2%
mul-1-neg84.2%
associate-*l/84.2%
*-commutative84.2%
Simplified84.2%
associate-*r/84.2%
Applied egg-rr84.2%
*-un-lft-identity84.2%
clear-num84.0%
/-rgt-identity84.0%
div-inv84.0%
metadata-eval84.0%
frac-times83.8%
tan-quot84.0%
div-inv84.0%
clear-num84.3%
Applied egg-rr84.3%
*-lft-identity84.3%
Simplified84.3%
if 6.0999999999999996e-44 < F Initial program 52.6%
Taylor expanded in F around inf 93.7%
Final simplification90.4%
B_m = (fabs.f64 B)
B_s = (copysign.f64 1 B)
(FPCore (B_s F B_m x)
:precision binary64
(let* ((t_0 (/ -1.0 (/ (tan B_m) x))))
(*
B_s
(if (<= F -5.8e-43)
(+ t_0 (/ -1.0 (sin B_m)))
(if (<= F -2.75e-171)
(+ t_0 (* (/ F (sin B_m)) (/ 1.0 (sqrt (+ 2.0 (* x 2.0))))))
(if (<= F 8e-45)
(/ x (- (tan B_m)))
(+ (* x (/ -1.0 (tan B_m))) (/ 1.0 (sin B_m)))))))))B_m = fabs(B);
B_s = copysign(1.0, B);
double code(double B_s, double F, double B_m, double x) {
double t_0 = -1.0 / (tan(B_m) / x);
double tmp;
if (F <= -5.8e-43) {
tmp = t_0 + (-1.0 / sin(B_m));
} else if (F <= -2.75e-171) {
tmp = t_0 + ((F / sin(B_m)) * (1.0 / sqrt((2.0 + (x * 2.0)))));
} else if (F <= 8e-45) {
tmp = x / -tan(B_m);
} else {
tmp = (x * (-1.0 / tan(B_m))) + (1.0 / sin(B_m));
}
return B_s * tmp;
}
B_m = abs(B)
B_s = copysign(1.0d0, B)
real(8) function code(b_s, f, b_m, x)
real(8), intent (in) :: b_s
real(8), intent (in) :: f
real(8), intent (in) :: b_m
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: tmp
t_0 = (-1.0d0) / (tan(b_m) / x)
if (f <= (-5.8d-43)) then
tmp = t_0 + ((-1.0d0) / sin(b_m))
else if (f <= (-2.75d-171)) then
tmp = t_0 + ((f / sin(b_m)) * (1.0d0 / sqrt((2.0d0 + (x * 2.0d0)))))
else if (f <= 8d-45) then
tmp = x / -tan(b_m)
else
tmp = (x * ((-1.0d0) / tan(b_m))) + (1.0d0 / sin(b_m))
end if
code = b_s * tmp
end function
B_m = Math.abs(B);
B_s = Math.copySign(1.0, B);
public static double code(double B_s, double F, double B_m, double x) {
double t_0 = -1.0 / (Math.tan(B_m) / x);
double tmp;
if (F <= -5.8e-43) {
tmp = t_0 + (-1.0 / Math.sin(B_m));
} else if (F <= -2.75e-171) {
tmp = t_0 + ((F / Math.sin(B_m)) * (1.0 / Math.sqrt((2.0 + (x * 2.0)))));
} else if (F <= 8e-45) {
tmp = x / -Math.tan(B_m);
} else {
tmp = (x * (-1.0 / Math.tan(B_m))) + (1.0 / Math.sin(B_m));
}
return B_s * tmp;
}
B_m = math.fabs(B) B_s = math.copysign(1.0, B) def code(B_s, F, B_m, x): t_0 = -1.0 / (math.tan(B_m) / x) tmp = 0 if F <= -5.8e-43: tmp = t_0 + (-1.0 / math.sin(B_m)) elif F <= -2.75e-171: tmp = t_0 + ((F / math.sin(B_m)) * (1.0 / math.sqrt((2.0 + (x * 2.0))))) elif F <= 8e-45: tmp = x / -math.tan(B_m) else: tmp = (x * (-1.0 / math.tan(B_m))) + (1.0 / math.sin(B_m)) return B_s * tmp
B_m = abs(B) B_s = copysign(1.0, B) function code(B_s, F, B_m, x) t_0 = Float64(-1.0 / Float64(tan(B_m) / x)) tmp = 0.0 if (F <= -5.8e-43) tmp = Float64(t_0 + Float64(-1.0 / sin(B_m))); elseif (F <= -2.75e-171) tmp = Float64(t_0 + Float64(Float64(F / sin(B_m)) * Float64(1.0 / sqrt(Float64(2.0 + Float64(x * 2.0)))))); elseif (F <= 8e-45) tmp = Float64(x / Float64(-tan(B_m))); else tmp = Float64(Float64(x * Float64(-1.0 / tan(B_m))) + Float64(1.0 / sin(B_m))); end return Float64(B_s * tmp) end
B_m = abs(B); B_s = sign(B) * abs(1.0); function tmp_2 = code(B_s, F, B_m, x) t_0 = -1.0 / (tan(B_m) / x); tmp = 0.0; if (F <= -5.8e-43) tmp = t_0 + (-1.0 / sin(B_m)); elseif (F <= -2.75e-171) tmp = t_0 + ((F / sin(B_m)) * (1.0 / sqrt((2.0 + (x * 2.0))))); elseif (F <= 8e-45) tmp = x / -tan(B_m); else tmp = (x * (-1.0 / tan(B_m))) + (1.0 / sin(B_m)); end tmp_2 = B_s * tmp; end
B_m = N[Abs[B], $MachinePrecision]
B_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[B]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[B$95$s_, F_, B$95$m_, x_] := Block[{t$95$0 = N[(-1.0 / N[(N[Tan[B$95$m], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]}, N[(B$95$s * If[LessEqual[F, -5.8e-43], N[(t$95$0 + N[(-1.0 / N[Sin[B$95$m], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -2.75e-171], N[(t$95$0 + N[(N[(F / N[Sin[B$95$m], $MachinePrecision]), $MachinePrecision] * N[(1.0 / N[Sqrt[N[(2.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 8e-45], N[(x / (-N[Tan[B$95$m], $MachinePrecision])), $MachinePrecision], N[(N[(x * N[(-1.0 / N[Tan[B$95$m], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[Sin[B$95$m], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]), $MachinePrecision]]
\begin{array}{l}
B_m = \left|B\right|
\\
B_s = \mathsf{copysign}\left(1, B\right)
\\
\begin{array}{l}
t_0 := \frac{-1}{\frac{\tan B\_m}{x}}\\
B\_s \cdot \begin{array}{l}
\mathbf{if}\;F \leq -5.8 \cdot 10^{-43}:\\
\;\;\;\;t\_0 + \frac{-1}{\sin B\_m}\\
\mathbf{elif}\;F \leq -2.75 \cdot 10^{-171}:\\
\;\;\;\;t\_0 + \frac{F}{\sin B\_m} \cdot \frac{1}{\sqrt{2 + x \cdot 2}}\\
\mathbf{elif}\;F \leq 8 \cdot 10^{-45}:\\
\;\;\;\;\frac{x}{-\tan B\_m}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{-1}{\tan B\_m} + \frac{1}{\sin B\_m}\\
\end{array}
\end{array}
\end{array}
if F < -5.8000000000000003e-43Initial program 62.4%
div-inv62.5%
clear-num62.5%
Applied egg-rr62.5%
clear-num62.4%
associate-/r/62.5%
Applied egg-rr62.5%
Taylor expanded in F around -inf 97.1%
if -5.8000000000000003e-43 < F < -2.75000000000000018e-171Initial program 82.2%
div-inv82.1%
clear-num82.1%
Applied egg-rr82.1%
add-sqr-sqrt82.2%
unpow-prod-down82.2%
+-commutative82.2%
fma-define82.2%
fma-define82.2%
metadata-eval82.2%
metadata-eval82.2%
+-commutative82.2%
fma-define82.2%
fma-define82.2%
metadata-eval82.2%
metadata-eval82.2%
Applied egg-rr82.2%
pow-sqr82.2%
metadata-eval82.2%
unpow-182.2%
Simplified82.2%
Taylor expanded in F around 0 82.2%
if -2.75000000000000018e-171 < F < 7.99999999999999987e-45Initial program 66.2%
distribute-lft-neg-in66.2%
+-commutative66.2%
fma-define66.3%
+-commutative66.3%
*-commutative66.3%
fma-define66.3%
fma-define66.3%
metadata-eval66.3%
metadata-eval66.3%
associate-*r/66.4%
*-rgt-identity66.4%
Simplified66.4%
Taylor expanded in F around 0 84.2%
mul-1-neg84.2%
associate-*l/84.2%
*-commutative84.2%
Simplified84.2%
associate-*r/84.2%
Applied egg-rr84.2%
*-un-lft-identity84.2%
clear-num84.0%
/-rgt-identity84.0%
div-inv84.0%
metadata-eval84.0%
frac-times83.8%
tan-quot84.0%
div-inv84.0%
clear-num84.3%
Applied egg-rr84.3%
*-lft-identity84.3%
Simplified84.3%
if 7.99999999999999987e-45 < F Initial program 52.6%
Taylor expanded in F around inf 93.7%
Final simplification90.4%
B_m = (fabs.f64 B)
B_s = (copysign.f64 1 B)
(FPCore (B_s F B_m x)
:precision binary64
(*
B_s
(if (<= F -2.4e+56)
(/ (- -1.0 x) B_m)
(if (<= F 4.3e-44)
(/ x (- (tan B_m)))
(- (/ F (* F (sin B_m))) (/ x (tan B_m)))))))B_m = fabs(B);
B_s = copysign(1.0, B);
double code(double B_s, double F, double B_m, double x) {
double tmp;
if (F <= -2.4e+56) {
tmp = (-1.0 - x) / B_m;
} else if (F <= 4.3e-44) {
tmp = x / -tan(B_m);
} else {
tmp = (F / (F * sin(B_m))) - (x / tan(B_m));
}
return B_s * tmp;
}
B_m = abs(B)
B_s = copysign(1.0d0, B)
real(8) function code(b_s, f, b_m, x)
real(8), intent (in) :: b_s
real(8), intent (in) :: f
real(8), intent (in) :: b_m
real(8), intent (in) :: x
real(8) :: tmp
if (f <= (-2.4d+56)) then
tmp = ((-1.0d0) - x) / b_m
else if (f <= 4.3d-44) then
tmp = x / -tan(b_m)
else
tmp = (f / (f * sin(b_m))) - (x / tan(b_m))
end if
code = b_s * tmp
end function
B_m = Math.abs(B);
B_s = Math.copySign(1.0, B);
public static double code(double B_s, double F, double B_m, double x) {
double tmp;
if (F <= -2.4e+56) {
tmp = (-1.0 - x) / B_m;
} else if (F <= 4.3e-44) {
tmp = x / -Math.tan(B_m);
} else {
tmp = (F / (F * Math.sin(B_m))) - (x / Math.tan(B_m));
}
return B_s * tmp;
}
B_m = math.fabs(B) B_s = math.copysign(1.0, B) def code(B_s, F, B_m, x): tmp = 0 if F <= -2.4e+56: tmp = (-1.0 - x) / B_m elif F <= 4.3e-44: tmp = x / -math.tan(B_m) else: tmp = (F / (F * math.sin(B_m))) - (x / math.tan(B_m)) return B_s * tmp
B_m = abs(B) B_s = copysign(1.0, B) function code(B_s, F, B_m, x) tmp = 0.0 if (F <= -2.4e+56) tmp = Float64(Float64(-1.0 - x) / B_m); elseif (F <= 4.3e-44) tmp = Float64(x / Float64(-tan(B_m))); else tmp = Float64(Float64(F / Float64(F * sin(B_m))) - Float64(x / tan(B_m))); end return Float64(B_s * tmp) end
B_m = abs(B); B_s = sign(B) * abs(1.0); function tmp_2 = code(B_s, F, B_m, x) tmp = 0.0; if (F <= -2.4e+56) tmp = (-1.0 - x) / B_m; elseif (F <= 4.3e-44) tmp = x / -tan(B_m); else tmp = (F / (F * sin(B_m))) - (x / tan(B_m)); end tmp_2 = B_s * tmp; end
B_m = N[Abs[B], $MachinePrecision]
B_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[B]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[B$95$s_, F_, B$95$m_, x_] := N[(B$95$s * If[LessEqual[F, -2.4e+56], N[(N[(-1.0 - x), $MachinePrecision] / B$95$m), $MachinePrecision], If[LessEqual[F, 4.3e-44], N[(x / (-N[Tan[B$95$m], $MachinePrecision])), $MachinePrecision], N[(N[(F / N[(F * N[Sin[B$95$m], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B$95$m], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]
\begin{array}{l}
B_m = \left|B\right|
\\
B_s = \mathsf{copysign}\left(1, B\right)
\\
B\_s \cdot \begin{array}{l}
\mathbf{if}\;F \leq -2.4 \cdot 10^{+56}:\\
\;\;\;\;\frac{-1 - x}{B\_m}\\
\mathbf{elif}\;F \leq 4.3 \cdot 10^{-44}:\\
\;\;\;\;\frac{x}{-\tan B\_m}\\
\mathbf{else}:\\
\;\;\;\;\frac{F}{F \cdot \sin B\_m} - \frac{x}{\tan B\_m}\\
\end{array}
\end{array}
if F < -2.40000000000000013e56Initial program 48.8%
distribute-lft-neg-in48.8%
+-commutative48.8%
fma-define48.8%
+-commutative48.8%
*-commutative48.8%
fma-define48.8%
fma-define48.8%
metadata-eval48.8%
metadata-eval48.8%
associate-*r/48.9%
*-rgt-identity48.9%
Simplified48.9%
Taylor expanded in B around 0 42.1%
Taylor expanded in F around -inf 57.7%
if -2.40000000000000013e56 < F < 4.30000000000000013e-44Initial program 73.3%
distribute-lft-neg-in73.3%
+-commutative73.3%
fma-define73.3%
+-commutative73.3%
*-commutative73.3%
fma-define73.3%
fma-define73.3%
metadata-eval73.3%
metadata-eval73.3%
associate-*r/73.4%
*-rgt-identity73.4%
Simplified73.4%
Taylor expanded in F around 0 77.1%
mul-1-neg77.1%
associate-*l/77.0%
*-commutative77.0%
Simplified77.0%
associate-*r/77.1%
Applied egg-rr77.1%
*-un-lft-identity77.1%
clear-num76.9%
/-rgt-identity76.9%
div-inv76.9%
metadata-eval76.9%
frac-times76.7%
tan-quot76.9%
div-inv76.9%
clear-num77.2%
Applied egg-rr77.2%
*-lft-identity77.2%
Simplified77.2%
if 4.30000000000000013e-44 < F Initial program 52.6%
distribute-lft-neg-in52.6%
+-commutative52.6%
associate-*l/63.2%
associate-/l*63.1%
fma-define63.1%
/-rgt-identity63.1%
remove-double-neg63.1%
fma-neg63.1%
Simplified63.1%
Taylor expanded in F around inf 93.4%
un-div-inv93.6%
Applied egg-rr93.6%
Final simplification78.3%
B_m = (fabs.f64 B)
B_s = (copysign.f64 1 B)
(FPCore (B_s F B_m x)
:precision binary64
(*
B_s
(if (<= F -1.25e-85)
(+ (* x (/ -1.0 (tan B_m))) (/ -1.0 (sin B_m)))
(if (<= F 5.6e-44)
(/ x (- (tan B_m)))
(- (/ F (* F (sin B_m))) (/ x (tan B_m)))))))B_m = fabs(B);
B_s = copysign(1.0, B);
double code(double B_s, double F, double B_m, double x) {
double tmp;
if (F <= -1.25e-85) {
tmp = (x * (-1.0 / tan(B_m))) + (-1.0 / sin(B_m));
} else if (F <= 5.6e-44) {
tmp = x / -tan(B_m);
} else {
tmp = (F / (F * sin(B_m))) - (x / tan(B_m));
}
return B_s * tmp;
}
B_m = abs(B)
B_s = copysign(1.0d0, B)
real(8) function code(b_s, f, b_m, x)
real(8), intent (in) :: b_s
real(8), intent (in) :: f
real(8), intent (in) :: b_m
real(8), intent (in) :: x
real(8) :: tmp
if (f <= (-1.25d-85)) then
tmp = (x * ((-1.0d0) / tan(b_m))) + ((-1.0d0) / sin(b_m))
else if (f <= 5.6d-44) then
tmp = x / -tan(b_m)
else
tmp = (f / (f * sin(b_m))) - (x / tan(b_m))
end if
code = b_s * tmp
end function
B_m = Math.abs(B);
B_s = Math.copySign(1.0, B);
public static double code(double B_s, double F, double B_m, double x) {
double tmp;
if (F <= -1.25e-85) {
tmp = (x * (-1.0 / Math.tan(B_m))) + (-1.0 / Math.sin(B_m));
} else if (F <= 5.6e-44) {
tmp = x / -Math.tan(B_m);
} else {
tmp = (F / (F * Math.sin(B_m))) - (x / Math.tan(B_m));
}
return B_s * tmp;
}
B_m = math.fabs(B) B_s = math.copysign(1.0, B) def code(B_s, F, B_m, x): tmp = 0 if F <= -1.25e-85: tmp = (x * (-1.0 / math.tan(B_m))) + (-1.0 / math.sin(B_m)) elif F <= 5.6e-44: tmp = x / -math.tan(B_m) else: tmp = (F / (F * math.sin(B_m))) - (x / math.tan(B_m)) return B_s * tmp
B_m = abs(B) B_s = copysign(1.0, B) function code(B_s, F, B_m, x) tmp = 0.0 if (F <= -1.25e-85) tmp = Float64(Float64(x * Float64(-1.0 / tan(B_m))) + Float64(-1.0 / sin(B_m))); elseif (F <= 5.6e-44) tmp = Float64(x / Float64(-tan(B_m))); else tmp = Float64(Float64(F / Float64(F * sin(B_m))) - Float64(x / tan(B_m))); end return Float64(B_s * tmp) end
B_m = abs(B); B_s = sign(B) * abs(1.0); function tmp_2 = code(B_s, F, B_m, x) tmp = 0.0; if (F <= -1.25e-85) tmp = (x * (-1.0 / tan(B_m))) + (-1.0 / sin(B_m)); elseif (F <= 5.6e-44) tmp = x / -tan(B_m); else tmp = (F / (F * sin(B_m))) - (x / tan(B_m)); end tmp_2 = B_s * tmp; end
B_m = N[Abs[B], $MachinePrecision]
B_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[B]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[B$95$s_, F_, B$95$m_, x_] := N[(B$95$s * If[LessEqual[F, -1.25e-85], N[(N[(x * N[(-1.0 / N[Tan[B$95$m], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(-1.0 / N[Sin[B$95$m], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 5.6e-44], N[(x / (-N[Tan[B$95$m], $MachinePrecision])), $MachinePrecision], N[(N[(F / N[(F * N[Sin[B$95$m], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B$95$m], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]
\begin{array}{l}
B_m = \left|B\right|
\\
B_s = \mathsf{copysign}\left(1, B\right)
\\
B\_s \cdot \begin{array}{l}
\mathbf{if}\;F \leq -1.25 \cdot 10^{-85}:\\
\;\;\;\;x \cdot \frac{-1}{\tan B\_m} + \frac{-1}{\sin B\_m}\\
\mathbf{elif}\;F \leq 5.6 \cdot 10^{-44}:\\
\;\;\;\;\frac{x}{-\tan B\_m}\\
\mathbf{else}:\\
\;\;\;\;\frac{F}{F \cdot \sin B\_m} - \frac{x}{\tan B\_m}\\
\end{array}
\end{array}
if F < -1.25e-85Initial program 64.5%
Taylor expanded in F around -inf 91.3%
if -1.25e-85 < F < 5.6e-44Initial program 68.5%
distribute-lft-neg-in68.5%
+-commutative68.5%
fma-define68.5%
+-commutative68.5%
*-commutative68.5%
fma-define68.5%
fma-define68.5%
metadata-eval68.5%
metadata-eval68.5%
associate-*r/68.7%
*-rgt-identity68.7%
Simplified68.7%
Taylor expanded in F around 0 81.1%
mul-1-neg81.1%
associate-*l/81.1%
*-commutative81.1%
Simplified81.1%
associate-*r/81.1%
Applied egg-rr81.1%
*-un-lft-identity81.1%
clear-num80.9%
/-rgt-identity80.9%
div-inv80.9%
metadata-eval80.9%
frac-times80.7%
tan-quot80.9%
div-inv81.0%
clear-num81.2%
Applied egg-rr81.2%
*-lft-identity81.2%
Simplified81.2%
if 5.6e-44 < F Initial program 52.6%
distribute-lft-neg-in52.6%
+-commutative52.6%
associate-*l/63.2%
associate-/l*63.1%
fma-define63.1%
/-rgt-identity63.1%
remove-double-neg63.1%
fma-neg63.1%
Simplified63.1%
Taylor expanded in F around inf 93.4%
un-div-inv93.6%
Applied egg-rr93.6%
Final simplification87.9%
B_m = (fabs.f64 B)
B_s = (copysign.f64 1 B)
(FPCore (B_s F B_m x)
:precision binary64
(let* ((t_0 (* x (/ -1.0 (tan B_m)))))
(*
B_s
(if (<= F -1.5e-85)
(+ t_0 (/ -1.0 (sin B_m)))
(if (<= F 2.4e-44) (/ x (- (tan B_m))) (+ t_0 (/ 1.0 (sin B_m))))))))B_m = fabs(B);
B_s = copysign(1.0, B);
double code(double B_s, double F, double B_m, double x) {
double t_0 = x * (-1.0 / tan(B_m));
double tmp;
if (F <= -1.5e-85) {
tmp = t_0 + (-1.0 / sin(B_m));
} else if (F <= 2.4e-44) {
tmp = x / -tan(B_m);
} else {
tmp = t_0 + (1.0 / sin(B_m));
}
return B_s * tmp;
}
B_m = abs(B)
B_s = copysign(1.0d0, B)
real(8) function code(b_s, f, b_m, x)
real(8), intent (in) :: b_s
real(8), intent (in) :: f
real(8), intent (in) :: b_m
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: tmp
t_0 = x * ((-1.0d0) / tan(b_m))
if (f <= (-1.5d-85)) then
tmp = t_0 + ((-1.0d0) / sin(b_m))
else if (f <= 2.4d-44) then
tmp = x / -tan(b_m)
else
tmp = t_0 + (1.0d0 / sin(b_m))
end if
code = b_s * tmp
end function
B_m = Math.abs(B);
B_s = Math.copySign(1.0, B);
public static double code(double B_s, double F, double B_m, double x) {
double t_0 = x * (-1.0 / Math.tan(B_m));
double tmp;
if (F <= -1.5e-85) {
tmp = t_0 + (-1.0 / Math.sin(B_m));
} else if (F <= 2.4e-44) {
tmp = x / -Math.tan(B_m);
} else {
tmp = t_0 + (1.0 / Math.sin(B_m));
}
return B_s * tmp;
}
B_m = math.fabs(B) B_s = math.copysign(1.0, B) def code(B_s, F, B_m, x): t_0 = x * (-1.0 / math.tan(B_m)) tmp = 0 if F <= -1.5e-85: tmp = t_0 + (-1.0 / math.sin(B_m)) elif F <= 2.4e-44: tmp = x / -math.tan(B_m) else: tmp = t_0 + (1.0 / math.sin(B_m)) return B_s * tmp
B_m = abs(B) B_s = copysign(1.0, B) function code(B_s, F, B_m, x) t_0 = Float64(x * Float64(-1.0 / tan(B_m))) tmp = 0.0 if (F <= -1.5e-85) tmp = Float64(t_0 + Float64(-1.0 / sin(B_m))); elseif (F <= 2.4e-44) tmp = Float64(x / Float64(-tan(B_m))); else tmp = Float64(t_0 + Float64(1.0 / sin(B_m))); end return Float64(B_s * tmp) end
B_m = abs(B); B_s = sign(B) * abs(1.0); function tmp_2 = code(B_s, F, B_m, x) t_0 = x * (-1.0 / tan(B_m)); tmp = 0.0; if (F <= -1.5e-85) tmp = t_0 + (-1.0 / sin(B_m)); elseif (F <= 2.4e-44) tmp = x / -tan(B_m); else tmp = t_0 + (1.0 / sin(B_m)); end tmp_2 = B_s * tmp; end
B_m = N[Abs[B], $MachinePrecision]
B_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[B]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[B$95$s_, F_, B$95$m_, x_] := Block[{t$95$0 = N[(x * N[(-1.0 / N[Tan[B$95$m], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(B$95$s * If[LessEqual[F, -1.5e-85], N[(t$95$0 + N[(-1.0 / N[Sin[B$95$m], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 2.4e-44], N[(x / (-N[Tan[B$95$m], $MachinePrecision])), $MachinePrecision], N[(t$95$0 + N[(1.0 / N[Sin[B$95$m], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]]
\begin{array}{l}
B_m = \left|B\right|
\\
B_s = \mathsf{copysign}\left(1, B\right)
\\
\begin{array}{l}
t_0 := x \cdot \frac{-1}{\tan B\_m}\\
B\_s \cdot \begin{array}{l}
\mathbf{if}\;F \leq -1.5 \cdot 10^{-85}:\\
\;\;\;\;t\_0 + \frac{-1}{\sin B\_m}\\
\mathbf{elif}\;F \leq 2.4 \cdot 10^{-44}:\\
\;\;\;\;\frac{x}{-\tan B\_m}\\
\mathbf{else}:\\
\;\;\;\;t\_0 + \frac{1}{\sin B\_m}\\
\end{array}
\end{array}
\end{array}
if F < -1.50000000000000011e-85Initial program 64.5%
Taylor expanded in F around -inf 91.3%
if -1.50000000000000011e-85 < F < 2.40000000000000009e-44Initial program 68.5%
distribute-lft-neg-in68.5%
+-commutative68.5%
fma-define68.5%
+-commutative68.5%
*-commutative68.5%
fma-define68.5%
fma-define68.5%
metadata-eval68.5%
metadata-eval68.5%
associate-*r/68.7%
*-rgt-identity68.7%
Simplified68.7%
Taylor expanded in F around 0 81.1%
mul-1-neg81.1%
associate-*l/81.1%
*-commutative81.1%
Simplified81.1%
associate-*r/81.1%
Applied egg-rr81.1%
*-un-lft-identity81.1%
clear-num80.9%
/-rgt-identity80.9%
div-inv80.9%
metadata-eval80.9%
frac-times80.7%
tan-quot80.9%
div-inv81.0%
clear-num81.2%
Applied egg-rr81.2%
*-lft-identity81.2%
Simplified81.2%
if 2.40000000000000009e-44 < F Initial program 52.6%
Taylor expanded in F around inf 93.7%
Final simplification88.0%
B_m = (fabs.f64 B)
B_s = (copysign.f64 1 B)
(FPCore (B_s F B_m x)
:precision binary64
(*
B_s
(if (<= F -1.8e-67)
(+ (/ -1.0 (/ (tan B_m) x)) (/ -1.0 (sin B_m)))
(if (<= F 1.6e-44)
(/ x (- (tan B_m)))
(+ (* x (/ -1.0 (tan B_m))) (/ 1.0 (sin B_m)))))))B_m = fabs(B);
B_s = copysign(1.0, B);
double code(double B_s, double F, double B_m, double x) {
double tmp;
if (F <= -1.8e-67) {
tmp = (-1.0 / (tan(B_m) / x)) + (-1.0 / sin(B_m));
} else if (F <= 1.6e-44) {
tmp = x / -tan(B_m);
} else {
tmp = (x * (-1.0 / tan(B_m))) + (1.0 / sin(B_m));
}
return B_s * tmp;
}
B_m = abs(B)
B_s = copysign(1.0d0, B)
real(8) function code(b_s, f, b_m, x)
real(8), intent (in) :: b_s
real(8), intent (in) :: f
real(8), intent (in) :: b_m
real(8), intent (in) :: x
real(8) :: tmp
if (f <= (-1.8d-67)) then
tmp = ((-1.0d0) / (tan(b_m) / x)) + ((-1.0d0) / sin(b_m))
else if (f <= 1.6d-44) then
tmp = x / -tan(b_m)
else
tmp = (x * ((-1.0d0) / tan(b_m))) + (1.0d0 / sin(b_m))
end if
code = b_s * tmp
end function
B_m = Math.abs(B);
B_s = Math.copySign(1.0, B);
public static double code(double B_s, double F, double B_m, double x) {
double tmp;
if (F <= -1.8e-67) {
tmp = (-1.0 / (Math.tan(B_m) / x)) + (-1.0 / Math.sin(B_m));
} else if (F <= 1.6e-44) {
tmp = x / -Math.tan(B_m);
} else {
tmp = (x * (-1.0 / Math.tan(B_m))) + (1.0 / Math.sin(B_m));
}
return B_s * tmp;
}
B_m = math.fabs(B) B_s = math.copysign(1.0, B) def code(B_s, F, B_m, x): tmp = 0 if F <= -1.8e-67: tmp = (-1.0 / (math.tan(B_m) / x)) + (-1.0 / math.sin(B_m)) elif F <= 1.6e-44: tmp = x / -math.tan(B_m) else: tmp = (x * (-1.0 / math.tan(B_m))) + (1.0 / math.sin(B_m)) return B_s * tmp
B_m = abs(B) B_s = copysign(1.0, B) function code(B_s, F, B_m, x) tmp = 0.0 if (F <= -1.8e-67) tmp = Float64(Float64(-1.0 / Float64(tan(B_m) / x)) + Float64(-1.0 / sin(B_m))); elseif (F <= 1.6e-44) tmp = Float64(x / Float64(-tan(B_m))); else tmp = Float64(Float64(x * Float64(-1.0 / tan(B_m))) + Float64(1.0 / sin(B_m))); end return Float64(B_s * tmp) end
B_m = abs(B); B_s = sign(B) * abs(1.0); function tmp_2 = code(B_s, F, B_m, x) tmp = 0.0; if (F <= -1.8e-67) tmp = (-1.0 / (tan(B_m) / x)) + (-1.0 / sin(B_m)); elseif (F <= 1.6e-44) tmp = x / -tan(B_m); else tmp = (x * (-1.0 / tan(B_m))) + (1.0 / sin(B_m)); end tmp_2 = B_s * tmp; end
B_m = N[Abs[B], $MachinePrecision]
B_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[B]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[B$95$s_, F_, B$95$m_, x_] := N[(B$95$s * If[LessEqual[F, -1.8e-67], N[(N[(-1.0 / N[(N[Tan[B$95$m], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] + N[(-1.0 / N[Sin[B$95$m], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.6e-44], N[(x / (-N[Tan[B$95$m], $MachinePrecision])), $MachinePrecision], N[(N[(x * N[(-1.0 / N[Tan[B$95$m], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[Sin[B$95$m], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]
\begin{array}{l}
B_m = \left|B\right|
\\
B_s = \mathsf{copysign}\left(1, B\right)
\\
B\_s \cdot \begin{array}{l}
\mathbf{if}\;F \leq -1.8 \cdot 10^{-67}:\\
\;\;\;\;\frac{-1}{\frac{\tan B\_m}{x}} + \frac{-1}{\sin B\_m}\\
\mathbf{elif}\;F \leq 1.6 \cdot 10^{-44}:\\
\;\;\;\;\frac{x}{-\tan B\_m}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{-1}{\tan B\_m} + \frac{1}{\sin B\_m}\\
\end{array}
\end{array}
if F < -1.8e-67Initial program 64.9%
div-inv65.0%
clear-num64.9%
Applied egg-rr64.9%
clear-num64.8%
associate-/r/64.9%
Applied egg-rr64.9%
Taylor expanded in F around -inf 92.4%
if -1.8e-67 < F < 1.59999999999999997e-44Initial program 68.2%
distribute-lft-neg-in68.2%
+-commutative68.2%
fma-define68.2%
+-commutative68.2%
*-commutative68.2%
fma-define68.2%
fma-define68.2%
metadata-eval68.2%
metadata-eval68.2%
associate-*r/68.3%
*-rgt-identity68.3%
Simplified68.3%
Taylor expanded in F around 0 80.5%
mul-1-neg80.5%
associate-*l/80.5%
*-commutative80.5%
Simplified80.5%
associate-*r/80.5%
Applied egg-rr80.5%
*-un-lft-identity80.5%
clear-num80.4%
/-rgt-identity80.4%
div-inv80.4%
metadata-eval80.4%
frac-times80.2%
tan-quot80.4%
div-inv80.4%
clear-num80.7%
Applied egg-rr80.7%
*-lft-identity80.7%
Simplified80.7%
if 1.59999999999999997e-44 < F Initial program 52.6%
Taylor expanded in F around inf 93.7%
Final simplification88.0%
B_m = (fabs.f64 B)
B_s = (copysign.f64 1 B)
(FPCore (B_s F B_m x)
:precision binary64
(*
B_s
(if (<= F -2.5e+56)
(/ (- -1.0 x) B_m)
(if (<= F 1.6e-31) (/ x (- (tan B_m))) (- (/ 1.0 B_m) (/ x (tan B_m)))))))B_m = fabs(B);
B_s = copysign(1.0, B);
double code(double B_s, double F, double B_m, double x) {
double tmp;
if (F <= -2.5e+56) {
tmp = (-1.0 - x) / B_m;
} else if (F <= 1.6e-31) {
tmp = x / -tan(B_m);
} else {
tmp = (1.0 / B_m) - (x / tan(B_m));
}
return B_s * tmp;
}
B_m = abs(B)
B_s = copysign(1.0d0, B)
real(8) function code(b_s, f, b_m, x)
real(8), intent (in) :: b_s
real(8), intent (in) :: f
real(8), intent (in) :: b_m
real(8), intent (in) :: x
real(8) :: tmp
if (f <= (-2.5d+56)) then
tmp = ((-1.0d0) - x) / b_m
else if (f <= 1.6d-31) then
tmp = x / -tan(b_m)
else
tmp = (1.0d0 / b_m) - (x / tan(b_m))
end if
code = b_s * tmp
end function
B_m = Math.abs(B);
B_s = Math.copySign(1.0, B);
public static double code(double B_s, double F, double B_m, double x) {
double tmp;
if (F <= -2.5e+56) {
tmp = (-1.0 - x) / B_m;
} else if (F <= 1.6e-31) {
tmp = x / -Math.tan(B_m);
} else {
tmp = (1.0 / B_m) - (x / Math.tan(B_m));
}
return B_s * tmp;
}
B_m = math.fabs(B) B_s = math.copysign(1.0, B) def code(B_s, F, B_m, x): tmp = 0 if F <= -2.5e+56: tmp = (-1.0 - x) / B_m elif F <= 1.6e-31: tmp = x / -math.tan(B_m) else: tmp = (1.0 / B_m) - (x / math.tan(B_m)) return B_s * tmp
B_m = abs(B) B_s = copysign(1.0, B) function code(B_s, F, B_m, x) tmp = 0.0 if (F <= -2.5e+56) tmp = Float64(Float64(-1.0 - x) / B_m); elseif (F <= 1.6e-31) tmp = Float64(x / Float64(-tan(B_m))); else tmp = Float64(Float64(1.0 / B_m) - Float64(x / tan(B_m))); end return Float64(B_s * tmp) end
B_m = abs(B); B_s = sign(B) * abs(1.0); function tmp_2 = code(B_s, F, B_m, x) tmp = 0.0; if (F <= -2.5e+56) tmp = (-1.0 - x) / B_m; elseif (F <= 1.6e-31) tmp = x / -tan(B_m); else tmp = (1.0 / B_m) - (x / tan(B_m)); end tmp_2 = B_s * tmp; end
B_m = N[Abs[B], $MachinePrecision]
B_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[B]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[B$95$s_, F_, B$95$m_, x_] := N[(B$95$s * If[LessEqual[F, -2.5e+56], N[(N[(-1.0 - x), $MachinePrecision] / B$95$m), $MachinePrecision], If[LessEqual[F, 1.6e-31], N[(x / (-N[Tan[B$95$m], $MachinePrecision])), $MachinePrecision], N[(N[(1.0 / B$95$m), $MachinePrecision] - N[(x / N[Tan[B$95$m], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]
\begin{array}{l}
B_m = \left|B\right|
\\
B_s = \mathsf{copysign}\left(1, B\right)
\\
B\_s \cdot \begin{array}{l}
\mathbf{if}\;F \leq -2.5 \cdot 10^{+56}:\\
\;\;\;\;\frac{-1 - x}{B\_m}\\
\mathbf{elif}\;F \leq 1.6 \cdot 10^{-31}:\\
\;\;\;\;\frac{x}{-\tan B\_m}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{B\_m} - \frac{x}{\tan B\_m}\\
\end{array}
\end{array}
if F < -2.50000000000000012e56Initial program 48.8%
distribute-lft-neg-in48.8%
+-commutative48.8%
fma-define48.8%
+-commutative48.8%
*-commutative48.8%
fma-define48.8%
fma-define48.8%
metadata-eval48.8%
metadata-eval48.8%
associate-*r/48.9%
*-rgt-identity48.9%
Simplified48.9%
Taylor expanded in B around 0 42.1%
Taylor expanded in F around -inf 57.7%
if -2.50000000000000012e56 < F < 1.60000000000000009e-31Initial program 74.2%
distribute-lft-neg-in74.2%
+-commutative74.2%
fma-define74.2%
+-commutative74.2%
*-commutative74.2%
fma-define74.2%
fma-define74.2%
metadata-eval74.2%
metadata-eval74.2%
associate-*r/74.3%
*-rgt-identity74.3%
Simplified74.3%
Taylor expanded in F around 0 75.1%
mul-1-neg75.1%
associate-*l/75.1%
*-commutative75.1%
Simplified75.1%
associate-*r/75.1%
Applied egg-rr75.1%
*-un-lft-identity75.1%
clear-num75.0%
/-rgt-identity75.0%
div-inv75.0%
metadata-eval75.0%
frac-times74.8%
tan-quot75.0%
div-inv75.0%
clear-num75.3%
Applied egg-rr75.3%
*-lft-identity75.3%
Simplified75.3%
if 1.60000000000000009e-31 < F Initial program 49.2%
distribute-lft-neg-in49.2%
+-commutative49.2%
associate-*l/60.6%
associate-/l*60.5%
fma-define60.5%
/-rgt-identity60.5%
remove-double-neg60.5%
fma-neg60.5%
Simplified60.5%
Taylor expanded in F around inf 98.2%
Taylor expanded in B around 0 79.3%
Final simplification73.1%
B_m = (fabs.f64 B)
B_s = (copysign.f64 1 B)
(FPCore (B_s F B_m x)
:precision binary64
(*
B_s
(if (<= F -2.4e+56)
(/ (- -1.0 x) B_m)
(if (<= F 1.3e-6)
(/ x (- (sin B_m)))
(+
(* B_m (+ 0.16666666666666666 (* x 0.3333333333333333)))
(/ (- 1.0 x) B_m))))))B_m = fabs(B);
B_s = copysign(1.0, B);
double code(double B_s, double F, double B_m, double x) {
double tmp;
if (F <= -2.4e+56) {
tmp = (-1.0 - x) / B_m;
} else if (F <= 1.3e-6) {
tmp = x / -sin(B_m);
} else {
tmp = (B_m * (0.16666666666666666 + (x * 0.3333333333333333))) + ((1.0 - x) / B_m);
}
return B_s * tmp;
}
B_m = abs(B)
B_s = copysign(1.0d0, B)
real(8) function code(b_s, f, b_m, x)
real(8), intent (in) :: b_s
real(8), intent (in) :: f
real(8), intent (in) :: b_m
real(8), intent (in) :: x
real(8) :: tmp
if (f <= (-2.4d+56)) then
tmp = ((-1.0d0) - x) / b_m
else if (f <= 1.3d-6) then
tmp = x / -sin(b_m)
else
tmp = (b_m * (0.16666666666666666d0 + (x * 0.3333333333333333d0))) + ((1.0d0 - x) / b_m)
end if
code = b_s * tmp
end function
B_m = Math.abs(B);
B_s = Math.copySign(1.0, B);
public static double code(double B_s, double F, double B_m, double x) {
double tmp;
if (F <= -2.4e+56) {
tmp = (-1.0 - x) / B_m;
} else if (F <= 1.3e-6) {
tmp = x / -Math.sin(B_m);
} else {
tmp = (B_m * (0.16666666666666666 + (x * 0.3333333333333333))) + ((1.0 - x) / B_m);
}
return B_s * tmp;
}
B_m = math.fabs(B) B_s = math.copysign(1.0, B) def code(B_s, F, B_m, x): tmp = 0 if F <= -2.4e+56: tmp = (-1.0 - x) / B_m elif F <= 1.3e-6: tmp = x / -math.sin(B_m) else: tmp = (B_m * (0.16666666666666666 + (x * 0.3333333333333333))) + ((1.0 - x) / B_m) return B_s * tmp
B_m = abs(B) B_s = copysign(1.0, B) function code(B_s, F, B_m, x) tmp = 0.0 if (F <= -2.4e+56) tmp = Float64(Float64(-1.0 - x) / B_m); elseif (F <= 1.3e-6) tmp = Float64(x / Float64(-sin(B_m))); else tmp = Float64(Float64(B_m * Float64(0.16666666666666666 + Float64(x * 0.3333333333333333))) + Float64(Float64(1.0 - x) / B_m)); end return Float64(B_s * tmp) end
B_m = abs(B); B_s = sign(B) * abs(1.0); function tmp_2 = code(B_s, F, B_m, x) tmp = 0.0; if (F <= -2.4e+56) tmp = (-1.0 - x) / B_m; elseif (F <= 1.3e-6) tmp = x / -sin(B_m); else tmp = (B_m * (0.16666666666666666 + (x * 0.3333333333333333))) + ((1.0 - x) / B_m); end tmp_2 = B_s * tmp; end
B_m = N[Abs[B], $MachinePrecision]
B_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[B]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[B$95$s_, F_, B$95$m_, x_] := N[(B$95$s * If[LessEqual[F, -2.4e+56], N[(N[(-1.0 - x), $MachinePrecision] / B$95$m), $MachinePrecision], If[LessEqual[F, 1.3e-6], N[(x / (-N[Sin[B$95$m], $MachinePrecision])), $MachinePrecision], N[(N[(B$95$m * N[(0.16666666666666666 + N[(x * 0.3333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 - x), $MachinePrecision] / B$95$m), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]
\begin{array}{l}
B_m = \left|B\right|
\\
B_s = \mathsf{copysign}\left(1, B\right)
\\
B\_s \cdot \begin{array}{l}
\mathbf{if}\;F \leq -2.4 \cdot 10^{+56}:\\
\;\;\;\;\frac{-1 - x}{B\_m}\\
\mathbf{elif}\;F \leq 1.3 \cdot 10^{-6}:\\
\;\;\;\;\frac{x}{-\sin B\_m}\\
\mathbf{else}:\\
\;\;\;\;B\_m \cdot \left(0.16666666666666666 + x \cdot 0.3333333333333333\right) + \frac{1 - x}{B\_m}\\
\end{array}
\end{array}
if F < -2.40000000000000013e56Initial program 48.8%
distribute-lft-neg-in48.8%
+-commutative48.8%
fma-define48.8%
+-commutative48.8%
*-commutative48.8%
fma-define48.8%
fma-define48.8%
metadata-eval48.8%
metadata-eval48.8%
associate-*r/48.9%
*-rgt-identity48.9%
Simplified48.9%
Taylor expanded in B around 0 42.1%
Taylor expanded in F around -inf 57.7%
if -2.40000000000000013e56 < F < 1.30000000000000005e-6Initial program 72.8%
distribute-lft-neg-in72.8%
+-commutative72.8%
fma-define72.8%
+-commutative72.8%
*-commutative72.8%
fma-define72.8%
fma-define72.8%
metadata-eval72.8%
metadata-eval72.8%
associate-*r/72.9%
*-rgt-identity72.9%
Simplified72.9%
Taylor expanded in F around 0 75.8%
mul-1-neg75.8%
associate-*l/75.8%
*-commutative75.8%
Simplified75.8%
associate-*r/75.8%
Applied egg-rr75.8%
Taylor expanded in B around 0 40.1%
if 1.30000000000000005e-6 < F Initial program 50.7%
div-inv50.7%
clear-num50.7%
Applied egg-rr50.7%
Taylor expanded in F around inf 79.8%
Taylor expanded in B around 0 52.6%
Taylor expanded in B around 0 59.2%
associate--l+59.2%
cancel-sign-sub-inv59.2%
metadata-eval59.2%
div-sub59.2%
Simplified59.2%
Final simplification48.3%
B_m = (fabs.f64 B)
B_s = (copysign.f64 1 B)
(FPCore (B_s F B_m x)
:precision binary64
(*
B_s
(if (<= F -2.6e+56)
(/ (- -1.0 x) B_m)
(if (<= F 6.5e+94)
(/ x (- (tan B_m)))
(+
(* B_m (+ 0.16666666666666666 (* x 0.3333333333333333)))
(/ (- 1.0 x) B_m))))))B_m = fabs(B);
B_s = copysign(1.0, B);
double code(double B_s, double F, double B_m, double x) {
double tmp;
if (F <= -2.6e+56) {
tmp = (-1.0 - x) / B_m;
} else if (F <= 6.5e+94) {
tmp = x / -tan(B_m);
} else {
tmp = (B_m * (0.16666666666666666 + (x * 0.3333333333333333))) + ((1.0 - x) / B_m);
}
return B_s * tmp;
}
B_m = abs(B)
B_s = copysign(1.0d0, B)
real(8) function code(b_s, f, b_m, x)
real(8), intent (in) :: b_s
real(8), intent (in) :: f
real(8), intent (in) :: b_m
real(8), intent (in) :: x
real(8) :: tmp
if (f <= (-2.6d+56)) then
tmp = ((-1.0d0) - x) / b_m
else if (f <= 6.5d+94) then
tmp = x / -tan(b_m)
else
tmp = (b_m * (0.16666666666666666d0 + (x * 0.3333333333333333d0))) + ((1.0d0 - x) / b_m)
end if
code = b_s * tmp
end function
B_m = Math.abs(B);
B_s = Math.copySign(1.0, B);
public static double code(double B_s, double F, double B_m, double x) {
double tmp;
if (F <= -2.6e+56) {
tmp = (-1.0 - x) / B_m;
} else if (F <= 6.5e+94) {
tmp = x / -Math.tan(B_m);
} else {
tmp = (B_m * (0.16666666666666666 + (x * 0.3333333333333333))) + ((1.0 - x) / B_m);
}
return B_s * tmp;
}
B_m = math.fabs(B) B_s = math.copysign(1.0, B) def code(B_s, F, B_m, x): tmp = 0 if F <= -2.6e+56: tmp = (-1.0 - x) / B_m elif F <= 6.5e+94: tmp = x / -math.tan(B_m) else: tmp = (B_m * (0.16666666666666666 + (x * 0.3333333333333333))) + ((1.0 - x) / B_m) return B_s * tmp
B_m = abs(B) B_s = copysign(1.0, B) function code(B_s, F, B_m, x) tmp = 0.0 if (F <= -2.6e+56) tmp = Float64(Float64(-1.0 - x) / B_m); elseif (F <= 6.5e+94) tmp = Float64(x / Float64(-tan(B_m))); else tmp = Float64(Float64(B_m * Float64(0.16666666666666666 + Float64(x * 0.3333333333333333))) + Float64(Float64(1.0 - x) / B_m)); end return Float64(B_s * tmp) end
B_m = abs(B); B_s = sign(B) * abs(1.0); function tmp_2 = code(B_s, F, B_m, x) tmp = 0.0; if (F <= -2.6e+56) tmp = (-1.0 - x) / B_m; elseif (F <= 6.5e+94) tmp = x / -tan(B_m); else tmp = (B_m * (0.16666666666666666 + (x * 0.3333333333333333))) + ((1.0 - x) / B_m); end tmp_2 = B_s * tmp; end
B_m = N[Abs[B], $MachinePrecision]
B_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[B]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[B$95$s_, F_, B$95$m_, x_] := N[(B$95$s * If[LessEqual[F, -2.6e+56], N[(N[(-1.0 - x), $MachinePrecision] / B$95$m), $MachinePrecision], If[LessEqual[F, 6.5e+94], N[(x / (-N[Tan[B$95$m], $MachinePrecision])), $MachinePrecision], N[(N[(B$95$m * N[(0.16666666666666666 + N[(x * 0.3333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 - x), $MachinePrecision] / B$95$m), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]
\begin{array}{l}
B_m = \left|B\right|
\\
B_s = \mathsf{copysign}\left(1, B\right)
\\
B\_s \cdot \begin{array}{l}
\mathbf{if}\;F \leq -2.6 \cdot 10^{+56}:\\
\;\;\;\;\frac{-1 - x}{B\_m}\\
\mathbf{elif}\;F \leq 6.5 \cdot 10^{+94}:\\
\;\;\;\;\frac{x}{-\tan B\_m}\\
\mathbf{else}:\\
\;\;\;\;B\_m \cdot \left(0.16666666666666666 + x \cdot 0.3333333333333333\right) + \frac{1 - x}{B\_m}\\
\end{array}
\end{array}
if F < -2.60000000000000011e56Initial program 48.8%
distribute-lft-neg-in48.8%
+-commutative48.8%
fma-define48.8%
+-commutative48.8%
*-commutative48.8%
fma-define48.8%
fma-define48.8%
metadata-eval48.8%
metadata-eval48.8%
associate-*r/48.9%
*-rgt-identity48.9%
Simplified48.9%
Taylor expanded in B around 0 42.1%
Taylor expanded in F around -inf 57.7%
if -2.60000000000000011e56 < F < 6.49999999999999976e94Initial program 71.5%
distribute-lft-neg-in71.5%
+-commutative71.5%
fma-define71.5%
+-commutative71.5%
*-commutative71.5%
fma-define71.5%
fma-define71.5%
metadata-eval71.5%
metadata-eval71.5%
associate-*r/71.6%
*-rgt-identity71.6%
Simplified71.6%
Taylor expanded in F around 0 73.6%
mul-1-neg73.6%
associate-*l/73.6%
*-commutative73.6%
Simplified73.6%
associate-*r/73.6%
Applied egg-rr73.6%
*-un-lft-identity73.6%
clear-num73.4%
/-rgt-identity73.4%
div-inv73.4%
metadata-eval73.4%
frac-times73.3%
tan-quot73.4%
div-inv73.5%
clear-num73.7%
Applied egg-rr73.7%
*-lft-identity73.7%
Simplified73.7%
if 6.49999999999999976e94 < F Initial program 42.4%
div-inv42.4%
clear-num42.5%
Applied egg-rr42.5%
Taylor expanded in F around inf 74.5%
Taylor expanded in B around 0 54.2%
Taylor expanded in B around 0 65.0%
associate--l+65.0%
cancel-sign-sub-inv65.0%
metadata-eval65.0%
div-sub65.0%
Simplified65.0%
Final simplification69.3%
B_m = (fabs.f64 B)
B_s = (copysign.f64 1 B)
(FPCore (B_s F B_m x)
:precision binary64
(*
B_s
(if (<= F -8.5e-106)
(/ (- -1.0 x) B_m)
(if (<= F 1.45e-15)
(- (/ x B_m))
(+
(* B_m (+ 0.16666666666666666 (* x 0.3333333333333333)))
(/ (- 1.0 x) B_m))))))B_m = fabs(B);
B_s = copysign(1.0, B);
double code(double B_s, double F, double B_m, double x) {
double tmp;
if (F <= -8.5e-106) {
tmp = (-1.0 - x) / B_m;
} else if (F <= 1.45e-15) {
tmp = -(x / B_m);
} else {
tmp = (B_m * (0.16666666666666666 + (x * 0.3333333333333333))) + ((1.0 - x) / B_m);
}
return B_s * tmp;
}
B_m = abs(B)
B_s = copysign(1.0d0, B)
real(8) function code(b_s, f, b_m, x)
real(8), intent (in) :: b_s
real(8), intent (in) :: f
real(8), intent (in) :: b_m
real(8), intent (in) :: x
real(8) :: tmp
if (f <= (-8.5d-106)) then
tmp = ((-1.0d0) - x) / b_m
else if (f <= 1.45d-15) then
tmp = -(x / b_m)
else
tmp = (b_m * (0.16666666666666666d0 + (x * 0.3333333333333333d0))) + ((1.0d0 - x) / b_m)
end if
code = b_s * tmp
end function
B_m = Math.abs(B);
B_s = Math.copySign(1.0, B);
public static double code(double B_s, double F, double B_m, double x) {
double tmp;
if (F <= -8.5e-106) {
tmp = (-1.0 - x) / B_m;
} else if (F <= 1.45e-15) {
tmp = -(x / B_m);
} else {
tmp = (B_m * (0.16666666666666666 + (x * 0.3333333333333333))) + ((1.0 - x) / B_m);
}
return B_s * tmp;
}
B_m = math.fabs(B) B_s = math.copysign(1.0, B) def code(B_s, F, B_m, x): tmp = 0 if F <= -8.5e-106: tmp = (-1.0 - x) / B_m elif F <= 1.45e-15: tmp = -(x / B_m) else: tmp = (B_m * (0.16666666666666666 + (x * 0.3333333333333333))) + ((1.0 - x) / B_m) return B_s * tmp
B_m = abs(B) B_s = copysign(1.0, B) function code(B_s, F, B_m, x) tmp = 0.0 if (F <= -8.5e-106) tmp = Float64(Float64(-1.0 - x) / B_m); elseif (F <= 1.45e-15) tmp = Float64(-Float64(x / B_m)); else tmp = Float64(Float64(B_m * Float64(0.16666666666666666 + Float64(x * 0.3333333333333333))) + Float64(Float64(1.0 - x) / B_m)); end return Float64(B_s * tmp) end
B_m = abs(B); B_s = sign(B) * abs(1.0); function tmp_2 = code(B_s, F, B_m, x) tmp = 0.0; if (F <= -8.5e-106) tmp = (-1.0 - x) / B_m; elseif (F <= 1.45e-15) tmp = -(x / B_m); else tmp = (B_m * (0.16666666666666666 + (x * 0.3333333333333333))) + ((1.0 - x) / B_m); end tmp_2 = B_s * tmp; end
B_m = N[Abs[B], $MachinePrecision]
B_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[B]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[B$95$s_, F_, B$95$m_, x_] := N[(B$95$s * If[LessEqual[F, -8.5e-106], N[(N[(-1.0 - x), $MachinePrecision] / B$95$m), $MachinePrecision], If[LessEqual[F, 1.45e-15], (-N[(x / B$95$m), $MachinePrecision]), N[(N[(B$95$m * N[(0.16666666666666666 + N[(x * 0.3333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 - x), $MachinePrecision] / B$95$m), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]
\begin{array}{l}
B_m = \left|B\right|
\\
B_s = \mathsf{copysign}\left(1, B\right)
\\
B\_s \cdot \begin{array}{l}
\mathbf{if}\;F \leq -8.5 \cdot 10^{-106}:\\
\;\;\;\;\frac{-1 - x}{B\_m}\\
\mathbf{elif}\;F \leq 1.45 \cdot 10^{-15}:\\
\;\;\;\;-\frac{x}{B\_m}\\
\mathbf{else}:\\
\;\;\;\;B\_m \cdot \left(0.16666666666666666 + x \cdot 0.3333333333333333\right) + \frac{1 - x}{B\_m}\\
\end{array}
\end{array}
if F < -8.4999999999999998e-106Initial program 65.0%
distribute-lft-neg-in65.0%
+-commutative65.0%
fma-define65.0%
+-commutative65.0%
*-commutative65.0%
fma-define65.0%
fma-define65.0%
metadata-eval65.0%
metadata-eval65.0%
associate-*r/65.1%
*-rgt-identity65.1%
Simplified65.1%
Taylor expanded in B around 0 40.0%
Taylor expanded in F around -inf 48.5%
if -8.4999999999999998e-106 < F < 1.45000000000000009e-15Initial program 68.7%
distribute-lft-neg-in68.7%
+-commutative68.7%
fma-define68.7%
+-commutative68.7%
*-commutative68.7%
fma-define68.7%
fma-define68.7%
metadata-eval68.7%
metadata-eval68.7%
associate-*r/68.9%
*-rgt-identity68.9%
Simplified68.9%
Taylor expanded in B around 0 32.8%
Taylor expanded in x around inf 37.2%
associate-*r/37.2%
mul-1-neg37.2%
Simplified37.2%
if 1.45000000000000009e-15 < F Initial program 50.0%
div-inv50.0%
clear-num49.9%
Applied egg-rr49.9%
Taylor expanded in F around inf 80.1%
Taylor expanded in B around 0 51.9%
Taylor expanded in B around 0 58.4%
associate--l+58.4%
cancel-sign-sub-inv58.4%
metadata-eval58.4%
div-sub58.4%
Simplified58.4%
Final simplification46.4%
B_m = (fabs.f64 B)
B_s = (copysign.f64 1 B)
(FPCore (B_s F B_m x)
:precision binary64
(*
B_s
(if (or (<= x -7.5e-134) (not (<= x 7.4e-211)))
(- (/ x B_m))
(/ (+ x 1.0) B_m))))B_m = fabs(B);
B_s = copysign(1.0, B);
double code(double B_s, double F, double B_m, double x) {
double tmp;
if ((x <= -7.5e-134) || !(x <= 7.4e-211)) {
tmp = -(x / B_m);
} else {
tmp = (x + 1.0) / B_m;
}
return B_s * tmp;
}
B_m = abs(B)
B_s = copysign(1.0d0, B)
real(8) function code(b_s, f, b_m, x)
real(8), intent (in) :: b_s
real(8), intent (in) :: f
real(8), intent (in) :: b_m
real(8), intent (in) :: x
real(8) :: tmp
if ((x <= (-7.5d-134)) .or. (.not. (x <= 7.4d-211))) then
tmp = -(x / b_m)
else
tmp = (x + 1.0d0) / b_m
end if
code = b_s * tmp
end function
B_m = Math.abs(B);
B_s = Math.copySign(1.0, B);
public static double code(double B_s, double F, double B_m, double x) {
double tmp;
if ((x <= -7.5e-134) || !(x <= 7.4e-211)) {
tmp = -(x / B_m);
} else {
tmp = (x + 1.0) / B_m;
}
return B_s * tmp;
}
B_m = math.fabs(B) B_s = math.copysign(1.0, B) def code(B_s, F, B_m, x): tmp = 0 if (x <= -7.5e-134) or not (x <= 7.4e-211): tmp = -(x / B_m) else: tmp = (x + 1.0) / B_m return B_s * tmp
B_m = abs(B) B_s = copysign(1.0, B) function code(B_s, F, B_m, x) tmp = 0.0 if ((x <= -7.5e-134) || !(x <= 7.4e-211)) tmp = Float64(-Float64(x / B_m)); else tmp = Float64(Float64(x + 1.0) / B_m); end return Float64(B_s * tmp) end
B_m = abs(B); B_s = sign(B) * abs(1.0); function tmp_2 = code(B_s, F, B_m, x) tmp = 0.0; if ((x <= -7.5e-134) || ~((x <= 7.4e-211))) tmp = -(x / B_m); else tmp = (x + 1.0) / B_m; end tmp_2 = B_s * tmp; end
B_m = N[Abs[B], $MachinePrecision]
B_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[B]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[B$95$s_, F_, B$95$m_, x_] := N[(B$95$s * If[Or[LessEqual[x, -7.5e-134], N[Not[LessEqual[x, 7.4e-211]], $MachinePrecision]], (-N[(x / B$95$m), $MachinePrecision]), N[(N[(x + 1.0), $MachinePrecision] / B$95$m), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
B_m = \left|B\right|
\\
B_s = \mathsf{copysign}\left(1, B\right)
\\
B\_s \cdot \begin{array}{l}
\mathbf{if}\;x \leq -7.5 \cdot 10^{-134} \lor \neg \left(x \leq 7.4 \cdot 10^{-211}\right):\\
\;\;\;\;-\frac{x}{B\_m}\\
\mathbf{else}:\\
\;\;\;\;\frac{x + 1}{B\_m}\\
\end{array}
\end{array}
if x < -7.50000000000000048e-134 or 7.3999999999999996e-211 < x Initial program 62.9%
distribute-lft-neg-in62.9%
+-commutative62.9%
fma-define62.9%
+-commutative62.9%
*-commutative62.9%
fma-define62.9%
fma-define62.9%
metadata-eval62.9%
metadata-eval62.9%
associate-*r/63.0%
*-rgt-identity63.0%
Simplified63.0%
Taylor expanded in B around 0 38.3%
Taylor expanded in x around inf 39.4%
associate-*r/39.4%
mul-1-neg39.4%
Simplified39.4%
if -7.50000000000000048e-134 < x < 7.3999999999999996e-211Initial program 61.7%
distribute-lft-neg-in61.7%
+-commutative61.7%
fma-define61.7%
+-commutative61.7%
*-commutative61.7%
fma-define61.7%
fma-define61.7%
metadata-eval61.7%
metadata-eval61.7%
associate-*r/61.8%
*-rgt-identity61.8%
Simplified61.8%
Taylor expanded in B around 0 29.6%
Taylor expanded in F around inf 27.3%
mul-1-neg27.3%
unsub-neg27.3%
Simplified27.3%
*-un-lft-identity27.3%
sub-neg27.3%
add-sqr-sqrt20.9%
sqrt-unprod27.3%
sqr-neg27.3%
sqrt-unprod6.5%
add-sqr-sqrt27.3%
Applied egg-rr27.3%
*-lft-identity27.3%
+-commutative27.3%
Simplified27.3%
Final simplification36.7%
B_m = (fabs.f64 B)
B_s = (copysign.f64 1 B)
(FPCore (B_s F B_m x)
:precision binary64
(*
B_s
(if (<= F -2.2e-105)
(/ (- -1.0 x) B_m)
(if (<= F 1.05e-27) (- (/ x B_m)) (/ (- 1.0 x) B_m)))))B_m = fabs(B);
B_s = copysign(1.0, B);
double code(double B_s, double F, double B_m, double x) {
double tmp;
if (F <= -2.2e-105) {
tmp = (-1.0 - x) / B_m;
} else if (F <= 1.05e-27) {
tmp = -(x / B_m);
} else {
tmp = (1.0 - x) / B_m;
}
return B_s * tmp;
}
B_m = abs(B)
B_s = copysign(1.0d0, B)
real(8) function code(b_s, f, b_m, x)
real(8), intent (in) :: b_s
real(8), intent (in) :: f
real(8), intent (in) :: b_m
real(8), intent (in) :: x
real(8) :: tmp
if (f <= (-2.2d-105)) then
tmp = ((-1.0d0) - x) / b_m
else if (f <= 1.05d-27) then
tmp = -(x / b_m)
else
tmp = (1.0d0 - x) / b_m
end if
code = b_s * tmp
end function
B_m = Math.abs(B);
B_s = Math.copySign(1.0, B);
public static double code(double B_s, double F, double B_m, double x) {
double tmp;
if (F <= -2.2e-105) {
tmp = (-1.0 - x) / B_m;
} else if (F <= 1.05e-27) {
tmp = -(x / B_m);
} else {
tmp = (1.0 - x) / B_m;
}
return B_s * tmp;
}
B_m = math.fabs(B) B_s = math.copysign(1.0, B) def code(B_s, F, B_m, x): tmp = 0 if F <= -2.2e-105: tmp = (-1.0 - x) / B_m elif F <= 1.05e-27: tmp = -(x / B_m) else: tmp = (1.0 - x) / B_m return B_s * tmp
B_m = abs(B) B_s = copysign(1.0, B) function code(B_s, F, B_m, x) tmp = 0.0 if (F <= -2.2e-105) tmp = Float64(Float64(-1.0 - x) / B_m); elseif (F <= 1.05e-27) tmp = Float64(-Float64(x / B_m)); else tmp = Float64(Float64(1.0 - x) / B_m); end return Float64(B_s * tmp) end
B_m = abs(B); B_s = sign(B) * abs(1.0); function tmp_2 = code(B_s, F, B_m, x) tmp = 0.0; if (F <= -2.2e-105) tmp = (-1.0 - x) / B_m; elseif (F <= 1.05e-27) tmp = -(x / B_m); else tmp = (1.0 - x) / B_m; end tmp_2 = B_s * tmp; end
B_m = N[Abs[B], $MachinePrecision]
B_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[B]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[B$95$s_, F_, B$95$m_, x_] := N[(B$95$s * If[LessEqual[F, -2.2e-105], N[(N[(-1.0 - x), $MachinePrecision] / B$95$m), $MachinePrecision], If[LessEqual[F, 1.05e-27], (-N[(x / B$95$m), $MachinePrecision]), N[(N[(1.0 - x), $MachinePrecision] / B$95$m), $MachinePrecision]]]), $MachinePrecision]
\begin{array}{l}
B_m = \left|B\right|
\\
B_s = \mathsf{copysign}\left(1, B\right)
\\
B\_s \cdot \begin{array}{l}
\mathbf{if}\;F \leq -2.2 \cdot 10^{-105}:\\
\;\;\;\;\frac{-1 - x}{B\_m}\\
\mathbf{elif}\;F \leq 1.05 \cdot 10^{-27}:\\
\;\;\;\;-\frac{x}{B\_m}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B\_m}\\
\end{array}
\end{array}
if F < -2.20000000000000004e-105Initial program 65.0%
distribute-lft-neg-in65.0%
+-commutative65.0%
fma-define65.0%
+-commutative65.0%
*-commutative65.0%
fma-define65.0%
fma-define65.0%
metadata-eval65.0%
metadata-eval65.0%
associate-*r/65.1%
*-rgt-identity65.1%
Simplified65.1%
Taylor expanded in B around 0 40.0%
Taylor expanded in F around -inf 48.5%
if -2.20000000000000004e-105 < F < 1.05000000000000008e-27Initial program 69.7%
distribute-lft-neg-in69.7%
+-commutative69.7%
fma-define69.8%
+-commutative69.8%
*-commutative69.8%
fma-define69.8%
fma-define69.8%
metadata-eval69.8%
metadata-eval69.8%
associate-*r/69.9%
*-rgt-identity69.9%
Simplified69.9%
Taylor expanded in B around 0 32.8%
Taylor expanded in x around inf 36.3%
associate-*r/36.3%
mul-1-neg36.3%
Simplified36.3%
if 1.05000000000000008e-27 < F Initial program 49.2%
distribute-lft-neg-in49.2%
+-commutative49.2%
fma-define49.2%
+-commutative49.2%
*-commutative49.2%
fma-define49.2%
fma-define49.2%
metadata-eval49.2%
metadata-eval49.2%
associate-*r/49.3%
*-rgt-identity49.3%
Simplified49.3%
Taylor expanded in B around 0 37.4%
Taylor expanded in F around inf 57.2%
mul-1-neg57.2%
unsub-neg57.2%
Simplified57.2%
Final simplification45.9%
B_m = (fabs.f64 B) B_s = (copysign.f64 1 B) (FPCore (B_s F B_m x) :precision binary64 (* B_s (if (or (<= x -2.6e-135) (not (<= x 4.7e-208))) (- (/ x B_m)) (/ 1.0 B_m))))
B_m = fabs(B);
B_s = copysign(1.0, B);
double code(double B_s, double F, double B_m, double x) {
double tmp;
if ((x <= -2.6e-135) || !(x <= 4.7e-208)) {
tmp = -(x / B_m);
} else {
tmp = 1.0 / B_m;
}
return B_s * tmp;
}
B_m = abs(B)
B_s = copysign(1.0d0, B)
real(8) function code(b_s, f, b_m, x)
real(8), intent (in) :: b_s
real(8), intent (in) :: f
real(8), intent (in) :: b_m
real(8), intent (in) :: x
real(8) :: tmp
if ((x <= (-2.6d-135)) .or. (.not. (x <= 4.7d-208))) then
tmp = -(x / b_m)
else
tmp = 1.0d0 / b_m
end if
code = b_s * tmp
end function
B_m = Math.abs(B);
B_s = Math.copySign(1.0, B);
public static double code(double B_s, double F, double B_m, double x) {
double tmp;
if ((x <= -2.6e-135) || !(x <= 4.7e-208)) {
tmp = -(x / B_m);
} else {
tmp = 1.0 / B_m;
}
return B_s * tmp;
}
B_m = math.fabs(B) B_s = math.copysign(1.0, B) def code(B_s, F, B_m, x): tmp = 0 if (x <= -2.6e-135) or not (x <= 4.7e-208): tmp = -(x / B_m) else: tmp = 1.0 / B_m return B_s * tmp
B_m = abs(B) B_s = copysign(1.0, B) function code(B_s, F, B_m, x) tmp = 0.0 if ((x <= -2.6e-135) || !(x <= 4.7e-208)) tmp = Float64(-Float64(x / B_m)); else tmp = Float64(1.0 / B_m); end return Float64(B_s * tmp) end
B_m = abs(B); B_s = sign(B) * abs(1.0); function tmp_2 = code(B_s, F, B_m, x) tmp = 0.0; if ((x <= -2.6e-135) || ~((x <= 4.7e-208))) tmp = -(x / B_m); else tmp = 1.0 / B_m; end tmp_2 = B_s * tmp; end
B_m = N[Abs[B], $MachinePrecision]
B_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[B]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[B$95$s_, F_, B$95$m_, x_] := N[(B$95$s * If[Or[LessEqual[x, -2.6e-135], N[Not[LessEqual[x, 4.7e-208]], $MachinePrecision]], (-N[(x / B$95$m), $MachinePrecision]), N[(1.0 / B$95$m), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
B_m = \left|B\right|
\\
B_s = \mathsf{copysign}\left(1, B\right)
\\
B\_s \cdot \begin{array}{l}
\mathbf{if}\;x \leq -2.6 \cdot 10^{-135} \lor \neg \left(x \leq 4.7 \cdot 10^{-208}\right):\\
\;\;\;\;-\frac{x}{B\_m}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{B\_m}\\
\end{array}
\end{array}
if x < -2.60000000000000004e-135 or 4.7000000000000003e-208 < x Initial program 62.9%
distribute-lft-neg-in62.9%
+-commutative62.9%
fma-define62.9%
+-commutative62.9%
*-commutative62.9%
fma-define62.9%
fma-define62.9%
metadata-eval62.9%
metadata-eval62.9%
associate-*r/63.0%
*-rgt-identity63.0%
Simplified63.0%
Taylor expanded in B around 0 38.3%
Taylor expanded in x around inf 39.4%
associate-*r/39.4%
mul-1-neg39.4%
Simplified39.4%
if -2.60000000000000004e-135 < x < 4.7000000000000003e-208Initial program 61.7%
distribute-lft-neg-in61.7%
+-commutative61.7%
fma-define61.7%
+-commutative61.7%
*-commutative61.7%
fma-define61.7%
fma-define61.7%
metadata-eval61.7%
metadata-eval61.7%
associate-*r/61.8%
*-rgt-identity61.8%
Simplified61.8%
Taylor expanded in B around 0 29.6%
Taylor expanded in F around inf 27.3%
mul-1-neg27.3%
unsub-neg27.3%
Simplified27.3%
Taylor expanded in x around 0 27.3%
Final simplification36.7%
B_m = (fabs.f64 B) B_s = (copysign.f64 1 B) (FPCore (B_s F B_m x) :precision binary64 (* B_s (if (<= F 1.2e-17) (- (/ x B_m)) (/ (- 1.0 x) B_m))))
B_m = fabs(B);
B_s = copysign(1.0, B);
double code(double B_s, double F, double B_m, double x) {
double tmp;
if (F <= 1.2e-17) {
tmp = -(x / B_m);
} else {
tmp = (1.0 - x) / B_m;
}
return B_s * tmp;
}
B_m = abs(B)
B_s = copysign(1.0d0, B)
real(8) function code(b_s, f, b_m, x)
real(8), intent (in) :: b_s
real(8), intent (in) :: f
real(8), intent (in) :: b_m
real(8), intent (in) :: x
real(8) :: tmp
if (f <= 1.2d-17) then
tmp = -(x / b_m)
else
tmp = (1.0d0 - x) / b_m
end if
code = b_s * tmp
end function
B_m = Math.abs(B);
B_s = Math.copySign(1.0, B);
public static double code(double B_s, double F, double B_m, double x) {
double tmp;
if (F <= 1.2e-17) {
tmp = -(x / B_m);
} else {
tmp = (1.0 - x) / B_m;
}
return B_s * tmp;
}
B_m = math.fabs(B) B_s = math.copysign(1.0, B) def code(B_s, F, B_m, x): tmp = 0 if F <= 1.2e-17: tmp = -(x / B_m) else: tmp = (1.0 - x) / B_m return B_s * tmp
B_m = abs(B) B_s = copysign(1.0, B) function code(B_s, F, B_m, x) tmp = 0.0 if (F <= 1.2e-17) tmp = Float64(-Float64(x / B_m)); else tmp = Float64(Float64(1.0 - x) / B_m); end return Float64(B_s * tmp) end
B_m = abs(B); B_s = sign(B) * abs(1.0); function tmp_2 = code(B_s, F, B_m, x) tmp = 0.0; if (F <= 1.2e-17) tmp = -(x / B_m); else tmp = (1.0 - x) / B_m; end tmp_2 = B_s * tmp; end
B_m = N[Abs[B], $MachinePrecision]
B_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[B]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[B$95$s_, F_, B$95$m_, x_] := N[(B$95$s * If[LessEqual[F, 1.2e-17], (-N[(x / B$95$m), $MachinePrecision]), N[(N[(1.0 - x), $MachinePrecision] / B$95$m), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
B_m = \left|B\right|
\\
B_s = \mathsf{copysign}\left(1, B\right)
\\
B\_s \cdot \begin{array}{l}
\mathbf{if}\;F \leq 1.2 \cdot 10^{-17}:\\
\;\;\;\;-\frac{x}{B\_m}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B\_m}\\
\end{array}
\end{array}
if F < 1.19999999999999993e-17Initial program 67.1%
distribute-lft-neg-in67.1%
+-commutative67.1%
fma-define67.1%
+-commutative67.1%
*-commutative67.1%
fma-define67.1%
fma-define67.1%
metadata-eval67.1%
metadata-eval67.1%
associate-*r/67.2%
*-rgt-identity67.2%
Simplified67.2%
Taylor expanded in B around 0 35.9%
Taylor expanded in x around inf 33.8%
associate-*r/33.8%
mul-1-neg33.8%
Simplified33.8%
if 1.19999999999999993e-17 < F Initial program 50.0%
distribute-lft-neg-in50.0%
+-commutative50.0%
fma-define50.0%
+-commutative50.0%
*-commutative50.0%
fma-define50.0%
fma-define50.0%
metadata-eval50.0%
metadata-eval50.0%
associate-*r/50.0%
*-rgt-identity50.0%
Simplified50.0%
Taylor expanded in B around 0 37.6%
Taylor expanded in F around inf 56.7%
mul-1-neg56.7%
unsub-neg56.7%
Simplified56.7%
Final simplification39.8%
B_m = (fabs.f64 B) B_s = (copysign.f64 1 B) (FPCore (B_s F B_m x) :precision binary64 (* B_s (/ 1.0 B_m)))
B_m = fabs(B);
B_s = copysign(1.0, B);
double code(double B_s, double F, double B_m, double x) {
return B_s * (1.0 / B_m);
}
B_m = abs(B)
B_s = copysign(1.0d0, B)
real(8) function code(b_s, f, b_m, x)
real(8), intent (in) :: b_s
real(8), intent (in) :: f
real(8), intent (in) :: b_m
real(8), intent (in) :: x
code = b_s * (1.0d0 / b_m)
end function
B_m = Math.abs(B);
B_s = Math.copySign(1.0, B);
public static double code(double B_s, double F, double B_m, double x) {
return B_s * (1.0 / B_m);
}
B_m = math.fabs(B) B_s = math.copysign(1.0, B) def code(B_s, F, B_m, x): return B_s * (1.0 / B_m)
B_m = abs(B) B_s = copysign(1.0, B) function code(B_s, F, B_m, x) return Float64(B_s * Float64(1.0 / B_m)) end
B_m = abs(B); B_s = sign(B) * abs(1.0); function tmp = code(B_s, F, B_m, x) tmp = B_s * (1.0 / B_m); end
B_m = N[Abs[B], $MachinePrecision]
B_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[B]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[B$95$s_, F_, B$95$m_, x_] := N[(B$95$s * N[(1.0 / B$95$m), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
B_m = \left|B\right|
\\
B_s = \mathsf{copysign}\left(1, B\right)
\\
B\_s \cdot \frac{1}{B\_m}
\end{array}
Initial program 62.6%
distribute-lft-neg-in62.6%
+-commutative62.6%
fma-define62.6%
+-commutative62.6%
*-commutative62.6%
fma-define62.6%
fma-define62.6%
metadata-eval62.6%
metadata-eval62.6%
associate-*r/62.7%
*-rgt-identity62.7%
Simplified62.7%
Taylor expanded in B around 0 36.4%
Taylor expanded in F around inf 34.6%
mul-1-neg34.6%
unsub-neg34.6%
Simplified34.6%
Taylor expanded in x around 0 10.9%
Final simplification10.9%
herbie shell --seed 2024061
(FPCore (F B x)
:name "VandenBroeck and Keller, Equation (23)"
:precision binary64
(+ (- (* x (/ 1.0 (tan B)))) (* (/ F (sin B)) (pow (+ (+ (* F F) 2.0) (* 2.0 x)) (- (/ 1.0 2.0))))))