
(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 23 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}
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))) (t_1 (/ (tan B) x)))
(if (<= F -500000000.0)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 1.9e+118)
(- (* F (/ (sqrt (/ 1.0 (fma F F 2.0))) (sin B))) t_0)
(/ (/ (- t_1 (sin B)) (sin B)) t_1)))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double t_1 = tan(B) / x;
double tmp;
if (F <= -500000000.0) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 1.9e+118) {
tmp = (F * (sqrt((1.0 / fma(F, F, 2.0))) / sin(B))) - t_0;
} else {
tmp = ((t_1 - sin(B)) / sin(B)) / t_1;
}
return tmp;
}
function code(F, B, x) t_0 = Float64(x / tan(B)) t_1 = Float64(tan(B) / x) tmp = 0.0 if (F <= -500000000.0) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 1.9e+118) tmp = Float64(Float64(F * Float64(sqrt(Float64(1.0 / fma(F, F, 2.0))) / sin(B))) - t_0); else tmp = Float64(Float64(Float64(t_1 - sin(B)) / sin(B)) / t_1); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[Tan[B], $MachinePrecision] / x), $MachinePrecision]}, If[LessEqual[F, -500000000.0], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 1.9e+118], N[(N[(F * N[(N[Sqrt[N[(1.0 / N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], N[(N[(N[(t$95$1 - N[Sin[B], $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
t_1 := \frac{\tan B}{x}\\
\mathbf{if}\;F \leq -500000000:\\
\;\;\;\;\frac{-1}{\sin B} - t_0\\
\mathbf{elif}\;F \leq 1.9 \cdot 10^{+118}:\\
\;\;\;\;F \cdot \frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B} - t_0\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{t_1 - \sin B}{\sin B}}{t_1}\\
\end{array}
\end{array}
if F < -5e8Initial program 51.7%
Simplified70.9%
Taylor expanded in x around 0 71.0%
associate-*l/70.9%
*-lft-identity70.9%
+-commutative70.9%
unpow270.9%
fma-udef70.9%
Simplified70.9%
Taylor expanded in F around -inf 99.8%
if -5e8 < F < 1.90000000000000008e118Initial program 98.0%
Simplified99.6%
Taylor expanded in x around 0 99.6%
associate-*l/99.6%
*-lft-identity99.6%
+-commutative99.6%
unpow299.6%
fma-udef99.6%
Simplified99.6%
if 1.90000000000000008e118 < F Initial program 36.2%
Taylor expanded in F around -inf 50.4%
+-commutative50.4%
div-inv50.6%
unsub-neg50.6%
add-sqr-sqrt34.5%
sqrt-unprod63.7%
frac-times63.7%
metadata-eval63.7%
metadata-eval63.7%
frac-times63.7%
sqrt-unprod45.9%
add-sqr-sqrt99.7%
clear-num99.6%
frac-sub84.2%
*-un-lft-identity84.2%
metadata-eval84.2%
div-inv84.2%
/-rgt-identity84.2%
Applied egg-rr84.2%
associate-/r*99.7%
Simplified99.7%
Final simplification99.7%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -125000000.0)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 1.45e+22)
(- (/ F (/ (sin B) (pow (fma F F 2.0) -0.5))) t_0)
(- (/ 1.0 (sin B)) t_0)))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -125000000.0) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 1.45e+22) {
tmp = (F / (sin(B) / pow(fma(F, F, 2.0), -0.5))) - t_0;
} else {
tmp = (1.0 / sin(B)) - t_0;
}
return tmp;
}
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -125000000.0) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 1.45e+22) tmp = Float64(Float64(F / Float64(sin(B) / (fma(F, F, 2.0) ^ -0.5))) - t_0); else tmp = Float64(Float64(1.0 / sin(B)) - t_0); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -125000000.0], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 1.45e+22], N[(N[(F / N[(N[Sin[B], $MachinePrecision] / N[Power[N[(F * F + 2.0), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -125000000:\\
\;\;\;\;\frac{-1}{\sin B} - t_0\\
\mathbf{elif}\;F \leq 1.45 \cdot 10^{+22}:\\
\;\;\;\;\frac{F}{\frac{\sin B}{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-0.5}}} - t_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t_0\\
\end{array}
\end{array}
if F < -1.25e8Initial program 51.7%
Simplified70.9%
Taylor expanded in x around 0 71.0%
associate-*l/70.9%
*-lft-identity70.9%
+-commutative70.9%
unpow270.9%
fma-udef70.9%
Simplified70.9%
Taylor expanded in F around -inf 99.8%
if -1.25e8 < F < 1.45e22Initial program 99.4%
Simplified99.6%
Taylor expanded in x around 0 99.6%
associate-*l/99.6%
*-lft-identity99.6%
+-commutative99.6%
unpow299.6%
fma-udef99.6%
Simplified99.6%
clear-num99.5%
un-div-inv99.6%
inv-pow99.6%
sqrt-pow199.6%
metadata-eval99.6%
Applied egg-rr99.6%
if 1.45e22 < F Initial program 50.4%
Simplified66.5%
Taylor expanded in x around 0 66.5%
associate-*l/66.5%
*-lft-identity66.5%
+-commutative66.5%
unpow266.5%
fma-udef66.5%
Simplified66.5%
Taylor expanded in F around inf 99.6%
Final simplification99.7%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -7.6e+155)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 840.0)
(- (/ (/ F (sqrt (fma F F 2.0))) (sin B)) t_0)
(- (/ (/ F (+ F (/ 1.0 F))) (sin B)) t_0)))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -7.6e+155) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 840.0) {
tmp = ((F / sqrt(fma(F, F, 2.0))) / sin(B)) - t_0;
} else {
tmp = ((F / (F + (1.0 / F))) / sin(B)) - t_0;
}
return tmp;
}
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -7.6e+155) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 840.0) tmp = Float64(Float64(Float64(F / sqrt(fma(F, F, 2.0))) / sin(B)) - t_0); else tmp = Float64(Float64(Float64(F / Float64(F + Float64(1.0 / F))) / sin(B)) - t_0); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -7.6e+155], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 840.0], N[(N[(N[(F / N[Sqrt[N[(F * F + 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], N[(N[(N[(F / N[(F + N[(1.0 / F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -7.6 \cdot 10^{+155}:\\
\;\;\;\;\frac{-1}{\sin B} - t_0\\
\mathbf{elif}\;F \leq 840:\\
\;\;\;\;\frac{\frac{F}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B} - t_0\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{F}{F + \frac{1}{F}}}{\sin B} - t_0\\
\end{array}
\end{array}
if F < -7.6000000000000001e155Initial program 24.3%
Simplified48.9%
Taylor expanded in x around 0 48.9%
associate-*l/48.9%
*-lft-identity48.9%
+-commutative48.9%
unpow248.9%
fma-udef48.9%
Simplified48.9%
Taylor expanded in F around -inf 99.6%
if -7.6000000000000001e155 < F < 840Initial program 96.8%
Simplified99.6%
Taylor expanded in x around 0 99.6%
associate-*l/99.6%
*-lft-identity99.6%
+-commutative99.6%
unpow299.6%
fma-udef99.6%
Simplified99.6%
associate-*r/99.6%
sqrt-div99.6%
metadata-eval99.6%
un-div-inv99.7%
Applied egg-rr99.7%
if 840 < F Initial program 53.0%
Simplified68.3%
Taylor expanded in x around 0 68.2%
associate-*l/68.3%
*-lft-identity68.3%
+-commutative68.3%
unpow268.3%
fma-udef68.3%
Simplified68.3%
associate-*r/68.2%
sqrt-div68.2%
metadata-eval68.2%
un-div-inv68.2%
Applied egg-rr68.2%
Taylor expanded in F around inf 99.6%
Final simplification99.7%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -20500000.0)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 840.0)
(+
(* x (/ -1.0 (tan B)))
(* (/ F (sin B)) (pow (+ (+ 2.0 (* F F)) (* x 2.0)) -0.5)))
(- (/ (/ F (+ F (/ 1.0 F))) (sin B)) t_0)))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -20500000.0) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 840.0) {
tmp = (x * (-1.0 / tan(B))) + ((F / sin(B)) * pow(((2.0 + (F * F)) + (x * 2.0)), -0.5));
} else {
tmp = ((F / (F + (1.0 / F))) / sin(B)) - t_0;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: tmp
t_0 = x / tan(b)
if (f <= (-20500000.0d0)) then
tmp = ((-1.0d0) / sin(b)) - t_0
else if (f <= 840.0d0) then
tmp = (x * ((-1.0d0) / tan(b))) + ((f / sin(b)) * (((2.0d0 + (f * f)) + (x * 2.0d0)) ** (-0.5d0)))
else
tmp = ((f / (f + (1.0d0 / f))) / sin(b)) - t_0
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = x / Math.tan(B);
double tmp;
if (F <= -20500000.0) {
tmp = (-1.0 / Math.sin(B)) - t_0;
} else if (F <= 840.0) {
tmp = (x * (-1.0 / Math.tan(B))) + ((F / Math.sin(B)) * Math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5));
} else {
tmp = ((F / (F + (1.0 / F))) / Math.sin(B)) - t_0;
}
return tmp;
}
def code(F, B, x): t_0 = x / math.tan(B) tmp = 0 if F <= -20500000.0: tmp = (-1.0 / math.sin(B)) - t_0 elif F <= 840.0: tmp = (x * (-1.0 / math.tan(B))) + ((F / math.sin(B)) * math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5)) else: tmp = ((F / (F + (1.0 / F))) / math.sin(B)) - t_0 return tmp
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -20500000.0) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 840.0) tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(Float64(F / sin(B)) * (Float64(Float64(2.0 + Float64(F * F)) + Float64(x * 2.0)) ^ -0.5))); else tmp = Float64(Float64(Float64(F / Float64(F + Float64(1.0 / F))) / sin(B)) - t_0); end return tmp end
function tmp_2 = code(F, B, x) t_0 = x / tan(B); tmp = 0.0; if (F <= -20500000.0) tmp = (-1.0 / sin(B)) - t_0; elseif (F <= 840.0) tmp = (x * (-1.0 / tan(B))) + ((F / sin(B)) * (((2.0 + (F * F)) + (x * 2.0)) ^ -0.5)); else tmp = ((F / (F + (1.0 / F))) / sin(B)) - t_0; end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -20500000.0], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 840.0], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Power[N[(N[(2.0 + N[(F * F), $MachinePrecision]), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(F / N[(F + N[(1.0 / F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -20500000:\\
\;\;\;\;\frac{-1}{\sin B} - t_0\\
\mathbf{elif}\;F \leq 840:\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{F}{\sin B} \cdot {\left(\left(2 + F \cdot F\right) + x \cdot 2\right)}^{-0.5}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{F}{F + \frac{1}{F}}}{\sin B} - t_0\\
\end{array}
\end{array}
if F < -2.05e7Initial program 51.7%
Simplified70.9%
Taylor expanded in x around 0 71.0%
associate-*l/70.9%
*-lft-identity70.9%
+-commutative70.9%
unpow270.9%
fma-udef70.9%
Simplified70.9%
Taylor expanded in F around -inf 99.8%
if -2.05e7 < F < 840Initial program 99.4%
if 840 < F Initial program 53.0%
Simplified68.3%
Taylor expanded in x around 0 68.2%
associate-*l/68.3%
*-lft-identity68.3%
+-commutative68.3%
unpow268.3%
fma-udef68.3%
Simplified68.3%
associate-*r/68.2%
sqrt-div68.2%
metadata-eval68.2%
un-div-inv68.2%
Applied egg-rr68.2%
Taylor expanded in F around inf 99.6%
Final simplification99.6%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -1.05)
(- (/ (/ F (- (/ -1.0 F) F)) (sin B)) t_0)
(if (<= F 0.95)
(- (* F (* (/ 1.0 (sin B)) (sqrt (/ 1.0 (+ 2.0 (* x 2.0)))))) t_0)
(- (/ (/ F (+ F (/ 1.0 F))) (sin B)) t_0)))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -1.05) {
tmp = ((F / ((-1.0 / F) - F)) / sin(B)) - t_0;
} else if (F <= 0.95) {
tmp = (F * ((1.0 / sin(B)) * sqrt((1.0 / (2.0 + (x * 2.0)))))) - t_0;
} else {
tmp = ((F / (F + (1.0 / F))) / sin(B)) - t_0;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: tmp
t_0 = x / tan(b)
if (f <= (-1.05d0)) then
tmp = ((f / (((-1.0d0) / f) - f)) / sin(b)) - t_0
else if (f <= 0.95d0) then
tmp = (f * ((1.0d0 / sin(b)) * sqrt((1.0d0 / (2.0d0 + (x * 2.0d0)))))) - t_0
else
tmp = ((f / (f + (1.0d0 / f))) / sin(b)) - t_0
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = x / Math.tan(B);
double tmp;
if (F <= -1.05) {
tmp = ((F / ((-1.0 / F) - F)) / Math.sin(B)) - t_0;
} else if (F <= 0.95) {
tmp = (F * ((1.0 / Math.sin(B)) * Math.sqrt((1.0 / (2.0 + (x * 2.0)))))) - t_0;
} else {
tmp = ((F / (F + (1.0 / F))) / Math.sin(B)) - t_0;
}
return tmp;
}
def code(F, B, x): t_0 = x / math.tan(B) tmp = 0 if F <= -1.05: tmp = ((F / ((-1.0 / F) - F)) / math.sin(B)) - t_0 elif F <= 0.95: tmp = (F * ((1.0 / math.sin(B)) * math.sqrt((1.0 / (2.0 + (x * 2.0)))))) - t_0 else: tmp = ((F / (F + (1.0 / F))) / math.sin(B)) - t_0 return tmp
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -1.05) tmp = Float64(Float64(Float64(F / Float64(Float64(-1.0 / F) - F)) / sin(B)) - t_0); elseif (F <= 0.95) tmp = Float64(Float64(F * Float64(Float64(1.0 / sin(B)) * sqrt(Float64(1.0 / Float64(2.0 + Float64(x * 2.0)))))) - t_0); else tmp = Float64(Float64(Float64(F / Float64(F + Float64(1.0 / F))) / sin(B)) - t_0); end return tmp end
function tmp_2 = code(F, B, x) t_0 = x / tan(B); tmp = 0.0; if (F <= -1.05) tmp = ((F / ((-1.0 / F) - F)) / sin(B)) - t_0; elseif (F <= 0.95) tmp = (F * ((1.0 / sin(B)) * sqrt((1.0 / (2.0 + (x * 2.0)))))) - t_0; else tmp = ((F / (F + (1.0 / F))) / sin(B)) - t_0; end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -1.05], N[(N[(N[(F / N[(N[(-1.0 / F), $MachinePrecision] - F), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 0.95], N[(N[(F * N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(1.0 / N[(2.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], N[(N[(N[(F / N[(F + N[(1.0 / F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -1.05:\\
\;\;\;\;\frac{\frac{F}{\frac{-1}{F} - F}}{\sin B} - t_0\\
\mathbf{elif}\;F \leq 0.95:\\
\;\;\;\;F \cdot \left(\frac{1}{\sin B} \cdot \sqrt{\frac{1}{2 + x \cdot 2}}\right) - t_0\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{F}{F + \frac{1}{F}}}{\sin B} - t_0\\
\end{array}
\end{array}
if F < -1.05000000000000004Initial program 53.1%
Simplified71.7%
Taylor expanded in x around 0 71.8%
associate-*l/71.7%
*-lft-identity71.7%
+-commutative71.7%
unpow271.7%
fma-udef71.7%
Simplified71.7%
associate-*r/71.7%
sqrt-div71.8%
metadata-eval71.8%
un-div-inv71.9%
Applied egg-rr71.9%
Taylor expanded in F around -inf 98.8%
neg-mul-198.8%
Simplified98.8%
if -1.05000000000000004 < F < 0.94999999999999996Initial program 99.4%
Simplified99.6%
Taylor expanded in F around 0 98.6%
if 0.94999999999999996 < F Initial program 53.0%
Simplified68.3%
Taylor expanded in x around 0 68.2%
associate-*l/68.3%
*-lft-identity68.3%
+-commutative68.3%
unpow268.3%
fma-udef68.3%
Simplified68.3%
associate-*r/68.2%
sqrt-div68.2%
metadata-eval68.2%
un-div-inv68.2%
Applied egg-rr68.2%
Taylor expanded in F around inf 99.6%
Final simplification99.0%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -0.92)
(- (/ (/ F (- (/ -1.0 F) F)) (sin B)) t_0)
(if (<= F 0.95)
(- (* F (/ (sqrt 0.5) (sin B))) t_0)
(- (/ (/ F (+ F (/ 1.0 F))) (sin B)) t_0)))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -0.92) {
tmp = ((F / ((-1.0 / F) - F)) / sin(B)) - t_0;
} else if (F <= 0.95) {
tmp = (F * (sqrt(0.5) / sin(B))) - t_0;
} else {
tmp = ((F / (F + (1.0 / F))) / sin(B)) - t_0;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: tmp
t_0 = x / tan(b)
if (f <= (-0.92d0)) then
tmp = ((f / (((-1.0d0) / f) - f)) / sin(b)) - t_0
else if (f <= 0.95d0) then
tmp = (f * (sqrt(0.5d0) / sin(b))) - t_0
else
tmp = ((f / (f + (1.0d0 / f))) / sin(b)) - t_0
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = x / Math.tan(B);
double tmp;
if (F <= -0.92) {
tmp = ((F / ((-1.0 / F) - F)) / Math.sin(B)) - t_0;
} else if (F <= 0.95) {
tmp = (F * (Math.sqrt(0.5) / Math.sin(B))) - t_0;
} else {
tmp = ((F / (F + (1.0 / F))) / Math.sin(B)) - t_0;
}
return tmp;
}
def code(F, B, x): t_0 = x / math.tan(B) tmp = 0 if F <= -0.92: tmp = ((F / ((-1.0 / F) - F)) / math.sin(B)) - t_0 elif F <= 0.95: tmp = (F * (math.sqrt(0.5) / math.sin(B))) - t_0 else: tmp = ((F / (F + (1.0 / F))) / math.sin(B)) - t_0 return tmp
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -0.92) tmp = Float64(Float64(Float64(F / Float64(Float64(-1.0 / F) - F)) / sin(B)) - t_0); elseif (F <= 0.95) tmp = Float64(Float64(F * Float64(sqrt(0.5) / sin(B))) - t_0); else tmp = Float64(Float64(Float64(F / Float64(F + Float64(1.0 / F))) / sin(B)) - t_0); end return tmp end
function tmp_2 = code(F, B, x) t_0 = x / tan(B); tmp = 0.0; if (F <= -0.92) tmp = ((F / ((-1.0 / F) - F)) / sin(B)) - t_0; elseif (F <= 0.95) tmp = (F * (sqrt(0.5) / sin(B))) - t_0; else tmp = ((F / (F + (1.0 / F))) / sin(B)) - t_0; end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -0.92], N[(N[(N[(F / N[(N[(-1.0 / F), $MachinePrecision] - F), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 0.95], N[(N[(F * N[(N[Sqrt[0.5], $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], N[(N[(N[(F / N[(F + N[(1.0 / F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -0.92:\\
\;\;\;\;\frac{\frac{F}{\frac{-1}{F} - F}}{\sin B} - t_0\\
\mathbf{elif}\;F \leq 0.95:\\
\;\;\;\;F \cdot \frac{\sqrt{0.5}}{\sin B} - t_0\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{F}{F + \frac{1}{F}}}{\sin B} - t_0\\
\end{array}
\end{array}
if F < -0.92000000000000004Initial program 53.1%
Simplified71.7%
Taylor expanded in x around 0 71.8%
associate-*l/71.7%
*-lft-identity71.7%
+-commutative71.7%
unpow271.7%
fma-udef71.7%
Simplified71.7%
associate-*r/71.7%
sqrt-div71.8%
metadata-eval71.8%
un-div-inv71.9%
Applied egg-rr71.9%
Taylor expanded in F around -inf 98.8%
neg-mul-198.8%
Simplified98.8%
if -0.92000000000000004 < F < 0.94999999999999996Initial program 99.4%
Simplified99.6%
Taylor expanded in x around 0 99.6%
associate-*l/99.6%
*-lft-identity99.6%
+-commutative99.6%
unpow299.6%
fma-udef99.6%
Simplified99.6%
Taylor expanded in F around 0 98.6%
if 0.94999999999999996 < F Initial program 53.0%
Simplified68.3%
Taylor expanded in x around 0 68.2%
associate-*l/68.3%
*-lft-identity68.3%
+-commutative68.3%
unpow268.3%
fma-udef68.3%
Simplified68.3%
associate-*r/68.2%
sqrt-div68.2%
metadata-eval68.2%
un-div-inv68.2%
Applied egg-rr68.2%
Taylor expanded in F around inf 99.6%
Final simplification99.0%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -0.92)
(- (/ (/ F (- (/ -1.0 F) F)) (sin B)) t_0)
(if (<= F 0.95)
(- (/ (/ F (sqrt 2.0)) (sin B)) t_0)
(- (/ (/ F (+ F (/ 1.0 F))) (sin B)) t_0)))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -0.92) {
tmp = ((F / ((-1.0 / F) - F)) / sin(B)) - t_0;
} else if (F <= 0.95) {
tmp = ((F / sqrt(2.0)) / sin(B)) - t_0;
} else {
tmp = ((F / (F + (1.0 / F))) / sin(B)) - t_0;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: tmp
t_0 = x / tan(b)
if (f <= (-0.92d0)) then
tmp = ((f / (((-1.0d0) / f) - f)) / sin(b)) - t_0
else if (f <= 0.95d0) then
tmp = ((f / sqrt(2.0d0)) / sin(b)) - t_0
else
tmp = ((f / (f + (1.0d0 / f))) / sin(b)) - t_0
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = x / Math.tan(B);
double tmp;
if (F <= -0.92) {
tmp = ((F / ((-1.0 / F) - F)) / Math.sin(B)) - t_0;
} else if (F <= 0.95) {
tmp = ((F / Math.sqrt(2.0)) / Math.sin(B)) - t_0;
} else {
tmp = ((F / (F + (1.0 / F))) / Math.sin(B)) - t_0;
}
return tmp;
}
def code(F, B, x): t_0 = x / math.tan(B) tmp = 0 if F <= -0.92: tmp = ((F / ((-1.0 / F) - F)) / math.sin(B)) - t_0 elif F <= 0.95: tmp = ((F / math.sqrt(2.0)) / math.sin(B)) - t_0 else: tmp = ((F / (F + (1.0 / F))) / math.sin(B)) - t_0 return tmp
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -0.92) tmp = Float64(Float64(Float64(F / Float64(Float64(-1.0 / F) - F)) / sin(B)) - t_0); elseif (F <= 0.95) tmp = Float64(Float64(Float64(F / sqrt(2.0)) / sin(B)) - t_0); else tmp = Float64(Float64(Float64(F / Float64(F + Float64(1.0 / F))) / sin(B)) - t_0); end return tmp end
function tmp_2 = code(F, B, x) t_0 = x / tan(B); tmp = 0.0; if (F <= -0.92) tmp = ((F / ((-1.0 / F) - F)) / sin(B)) - t_0; elseif (F <= 0.95) tmp = ((F / sqrt(2.0)) / sin(B)) - t_0; else tmp = ((F / (F + (1.0 / F))) / sin(B)) - t_0; end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -0.92], N[(N[(N[(F / N[(N[(-1.0 / F), $MachinePrecision] - F), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 0.95], N[(N[(N[(F / N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], N[(N[(N[(F / N[(F + N[(1.0 / F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -0.92:\\
\;\;\;\;\frac{\frac{F}{\frac{-1}{F} - F}}{\sin B} - t_0\\
\mathbf{elif}\;F \leq 0.95:\\
\;\;\;\;\frac{\frac{F}{\sqrt{2}}}{\sin B} - t_0\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{F}{F + \frac{1}{F}}}{\sin B} - t_0\\
\end{array}
\end{array}
if F < -0.92000000000000004Initial program 53.1%
Simplified71.7%
Taylor expanded in x around 0 71.8%
associate-*l/71.7%
*-lft-identity71.7%
+-commutative71.7%
unpow271.7%
fma-udef71.7%
Simplified71.7%
associate-*r/71.7%
sqrt-div71.8%
metadata-eval71.8%
un-div-inv71.9%
Applied egg-rr71.9%
Taylor expanded in F around -inf 98.8%
neg-mul-198.8%
Simplified98.8%
if -0.92000000000000004 < F < 0.94999999999999996Initial program 99.4%
Simplified99.6%
Taylor expanded in x around 0 99.6%
associate-*l/99.6%
*-lft-identity99.6%
+-commutative99.6%
unpow299.6%
fma-udef99.6%
Simplified99.6%
associate-*r/99.6%
sqrt-div99.6%
metadata-eval99.6%
un-div-inv99.6%
Applied egg-rr99.6%
Taylor expanded in F around 0 98.6%
if 0.94999999999999996 < F Initial program 53.0%
Simplified68.3%
Taylor expanded in x around 0 68.2%
associate-*l/68.3%
*-lft-identity68.3%
+-commutative68.3%
unpow268.3%
fma-udef68.3%
Simplified68.3%
associate-*r/68.2%
sqrt-div68.2%
metadata-eval68.2%
un-div-inv68.2%
Applied egg-rr68.2%
Taylor expanded in F around inf 99.6%
Final simplification99.0%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -13000.0)
(- (/ -1.0 (sin B)) t_0)
(if (or (<= F -8.7e-215) (and (not (<= F 5.4e-43)) (<= F 8.5e-5)))
(- (* (/ F (sin B)) (pow (+ (+ 2.0 (* F F)) (* x 2.0)) -0.5)) (/ x B))
(- (/ (/ F (+ F (/ 1.0 F))) (sin B)) t_0)))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -13000.0) {
tmp = (-1.0 / sin(B)) - t_0;
} else if ((F <= -8.7e-215) || (!(F <= 5.4e-43) && (F <= 8.5e-5))) {
tmp = ((F / sin(B)) * pow(((2.0 + (F * F)) + (x * 2.0)), -0.5)) - (x / B);
} else {
tmp = ((F / (F + (1.0 / F))) / sin(B)) - t_0;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: tmp
t_0 = x / tan(b)
if (f <= (-13000.0d0)) then
tmp = ((-1.0d0) / sin(b)) - t_0
else if ((f <= (-8.7d-215)) .or. (.not. (f <= 5.4d-43)) .and. (f <= 8.5d-5)) then
tmp = ((f / sin(b)) * (((2.0d0 + (f * f)) + (x * 2.0d0)) ** (-0.5d0))) - (x / b)
else
tmp = ((f / (f + (1.0d0 / f))) / sin(b)) - t_0
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = x / Math.tan(B);
double tmp;
if (F <= -13000.0) {
tmp = (-1.0 / Math.sin(B)) - t_0;
} else if ((F <= -8.7e-215) || (!(F <= 5.4e-43) && (F <= 8.5e-5))) {
tmp = ((F / Math.sin(B)) * Math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5)) - (x / B);
} else {
tmp = ((F / (F + (1.0 / F))) / Math.sin(B)) - t_0;
}
return tmp;
}
def code(F, B, x): t_0 = x / math.tan(B) tmp = 0 if F <= -13000.0: tmp = (-1.0 / math.sin(B)) - t_0 elif (F <= -8.7e-215) or (not (F <= 5.4e-43) and (F <= 8.5e-5)): tmp = ((F / math.sin(B)) * math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5)) - (x / B) else: tmp = ((F / (F + (1.0 / F))) / math.sin(B)) - t_0 return tmp
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -13000.0) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif ((F <= -8.7e-215) || (!(F <= 5.4e-43) && (F <= 8.5e-5))) tmp = Float64(Float64(Float64(F / sin(B)) * (Float64(Float64(2.0 + Float64(F * F)) + Float64(x * 2.0)) ^ -0.5)) - Float64(x / B)); else tmp = Float64(Float64(Float64(F / Float64(F + Float64(1.0 / F))) / sin(B)) - t_0); end return tmp end
function tmp_2 = code(F, B, x) t_0 = x / tan(B); tmp = 0.0; if (F <= -13000.0) tmp = (-1.0 / sin(B)) - t_0; elseif ((F <= -8.7e-215) || (~((F <= 5.4e-43)) && (F <= 8.5e-5))) tmp = ((F / sin(B)) * (((2.0 + (F * F)) + (x * 2.0)) ^ -0.5)) - (x / B); else tmp = ((F / (F + (1.0 / F))) / sin(B)) - t_0; end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -13000.0], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[Or[LessEqual[F, -8.7e-215], And[N[Not[LessEqual[F, 5.4e-43]], $MachinePrecision], LessEqual[F, 8.5e-5]]], N[(N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Power[N[(N[(2.0 + N[(F * F), $MachinePrecision]), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], N[(N[(N[(F / N[(F + N[(1.0 / F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -13000:\\
\;\;\;\;\frac{-1}{\sin B} - t_0\\
\mathbf{elif}\;F \leq -8.7 \cdot 10^{-215} \lor \neg \left(F \leq 5.4 \cdot 10^{-43}\right) \land F \leq 8.5 \cdot 10^{-5}:\\
\;\;\;\;\frac{F}{\sin B} \cdot {\left(\left(2 + F \cdot F\right) + x \cdot 2\right)}^{-0.5} - \frac{x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{F}{F + \frac{1}{F}}}{\sin B} - t_0\\
\end{array}
\end{array}
if F < -13000Initial program 51.7%
Simplified70.9%
Taylor expanded in x around 0 71.0%
associate-*l/70.9%
*-lft-identity70.9%
+-commutative70.9%
unpow270.9%
fma-udef70.9%
Simplified70.9%
Taylor expanded in F around -inf 99.8%
if -13000 < F < -8.70000000000000017e-215 or 5.39999999999999982e-43 < F < 8.500000000000001e-5Initial program 99.3%
Taylor expanded in B around 0 89.8%
if -8.70000000000000017e-215 < F < 5.39999999999999982e-43 or 8.500000000000001e-5 < F Initial program 74.9%
Simplified83.1%
Taylor expanded in x around 0 83.1%
associate-*l/83.1%
*-lft-identity83.1%
+-commutative83.1%
unpow283.1%
fma-udef83.1%
Simplified83.1%
associate-*r/83.1%
sqrt-div83.1%
metadata-eval83.1%
un-div-inv83.0%
Applied egg-rr83.0%
Taylor expanded in F around inf 89.9%
Final simplification92.6%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -0.000395)
(- (/ -1.0 (sin B)) t_0)
(if (<= F -3.4e-140)
(/ F (* (sin B) (sqrt 2.0)))
(- (/ (/ F (+ F (/ 1.0 F))) (sin B)) t_0)))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -0.000395) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= -3.4e-140) {
tmp = F / (sin(B) * sqrt(2.0));
} else {
tmp = ((F / (F + (1.0 / F))) / sin(B)) - t_0;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: tmp
t_0 = x / tan(b)
if (f <= (-0.000395d0)) then
tmp = ((-1.0d0) / sin(b)) - t_0
else if (f <= (-3.4d-140)) then
tmp = f / (sin(b) * sqrt(2.0d0))
else
tmp = ((f / (f + (1.0d0 / f))) / sin(b)) - t_0
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = x / Math.tan(B);
double tmp;
if (F <= -0.000395) {
tmp = (-1.0 / Math.sin(B)) - t_0;
} else if (F <= -3.4e-140) {
tmp = F / (Math.sin(B) * Math.sqrt(2.0));
} else {
tmp = ((F / (F + (1.0 / F))) / Math.sin(B)) - t_0;
}
return tmp;
}
def code(F, B, x): t_0 = x / math.tan(B) tmp = 0 if F <= -0.000395: tmp = (-1.0 / math.sin(B)) - t_0 elif F <= -3.4e-140: tmp = F / (math.sin(B) * math.sqrt(2.0)) else: tmp = ((F / (F + (1.0 / F))) / math.sin(B)) - t_0 return tmp
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -0.000395) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= -3.4e-140) tmp = Float64(F / Float64(sin(B) * sqrt(2.0))); else tmp = Float64(Float64(Float64(F / Float64(F + Float64(1.0 / F))) / sin(B)) - t_0); end return tmp end
function tmp_2 = code(F, B, x) t_0 = x / tan(B); tmp = 0.0; if (F <= -0.000395) tmp = (-1.0 / sin(B)) - t_0; elseif (F <= -3.4e-140) tmp = F / (sin(B) * sqrt(2.0)); else tmp = ((F / (F + (1.0 / F))) / sin(B)) - t_0; end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -0.000395], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, -3.4e-140], N[(F / N[(N[Sin[B], $MachinePrecision] * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(F / N[(F + N[(1.0 / F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -0.000395:\\
\;\;\;\;\frac{-1}{\sin B} - t_0\\
\mathbf{elif}\;F \leq -3.4 \cdot 10^{-140}:\\
\;\;\;\;\frac{F}{\sin B \cdot \sqrt{2}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{F}{F + \frac{1}{F}}}{\sin B} - t_0\\
\end{array}
\end{array}
if F < -3.95000000000000006e-4Initial program 54.3%
Simplified72.5%
Taylor expanded in x around 0 72.5%
associate-*l/72.5%
*-lft-identity72.5%
+-commutative72.5%
unpow272.5%
fma-udef72.5%
Simplified72.5%
Taylor expanded in F around -inf 98.2%
if -3.95000000000000006e-4 < F < -3.40000000000000008e-140Initial program 99.3%
Simplified99.4%
Taylor expanded in x around 0 99.5%
associate-*l/99.4%
*-lft-identity99.4%
+-commutative99.4%
unpow299.4%
fma-udef99.4%
Simplified99.4%
associate-*r/99.3%
sqrt-div99.4%
metadata-eval99.4%
un-div-inv99.5%
Applied egg-rr99.5%
Taylor expanded in F around 0 97.8%
Taylor expanded in F around inf 76.5%
if -3.40000000000000008e-140 < F Initial program 78.0%
Simplified85.1%
Taylor expanded in x around 0 85.1%
associate-*l/85.1%
*-lft-identity85.1%
+-commutative85.1%
unpow285.1%
fma-udef85.1%
Simplified85.1%
associate-*r/85.1%
sqrt-div85.1%
metadata-eval85.1%
un-div-inv85.1%
Applied egg-rr85.1%
Taylor expanded in F around inf 84.8%
Final simplification87.9%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -0.000235)
(- (/ (/ F (- (/ -1.0 F) F)) (sin B)) t_0)
(if (<= F -1.85e-145)
(/ F (* (sin B) (sqrt 2.0)))
(- (/ (/ F (+ F (/ 1.0 F))) (sin B)) t_0)))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -0.000235) {
tmp = ((F / ((-1.0 / F) - F)) / sin(B)) - t_0;
} else if (F <= -1.85e-145) {
tmp = F / (sin(B) * sqrt(2.0));
} else {
tmp = ((F / (F + (1.0 / F))) / sin(B)) - t_0;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: tmp
t_0 = x / tan(b)
if (f <= (-0.000235d0)) then
tmp = ((f / (((-1.0d0) / f) - f)) / sin(b)) - t_0
else if (f <= (-1.85d-145)) then
tmp = f / (sin(b) * sqrt(2.0d0))
else
tmp = ((f / (f + (1.0d0 / f))) / sin(b)) - t_0
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = x / Math.tan(B);
double tmp;
if (F <= -0.000235) {
tmp = ((F / ((-1.0 / F) - F)) / Math.sin(B)) - t_0;
} else if (F <= -1.85e-145) {
tmp = F / (Math.sin(B) * Math.sqrt(2.0));
} else {
tmp = ((F / (F + (1.0 / F))) / Math.sin(B)) - t_0;
}
return tmp;
}
def code(F, B, x): t_0 = x / math.tan(B) tmp = 0 if F <= -0.000235: tmp = ((F / ((-1.0 / F) - F)) / math.sin(B)) - t_0 elif F <= -1.85e-145: tmp = F / (math.sin(B) * math.sqrt(2.0)) else: tmp = ((F / (F + (1.0 / F))) / math.sin(B)) - t_0 return tmp
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -0.000235) tmp = Float64(Float64(Float64(F / Float64(Float64(-1.0 / F) - F)) / sin(B)) - t_0); elseif (F <= -1.85e-145) tmp = Float64(F / Float64(sin(B) * sqrt(2.0))); else tmp = Float64(Float64(Float64(F / Float64(F + Float64(1.0 / F))) / sin(B)) - t_0); end return tmp end
function tmp_2 = code(F, B, x) t_0 = x / tan(B); tmp = 0.0; if (F <= -0.000235) tmp = ((F / ((-1.0 / F) - F)) / sin(B)) - t_0; elseif (F <= -1.85e-145) tmp = F / (sin(B) * sqrt(2.0)); else tmp = ((F / (F + (1.0 / F))) / sin(B)) - t_0; end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -0.000235], N[(N[(N[(F / N[(N[(-1.0 / F), $MachinePrecision] - F), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, -1.85e-145], N[(F / N[(N[Sin[B], $MachinePrecision] * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(F / N[(F + N[(1.0 / F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -0.000235:\\
\;\;\;\;\frac{\frac{F}{\frac{-1}{F} - F}}{\sin B} - t_0\\
\mathbf{elif}\;F \leq -1.85 \cdot 10^{-145}:\\
\;\;\;\;\frac{F}{\sin B \cdot \sqrt{2}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{F}{F + \frac{1}{F}}}{\sin B} - t_0\\
\end{array}
\end{array}
if F < -2.34999999999999993e-4Initial program 54.3%
Simplified72.5%
Taylor expanded in x around 0 72.5%
associate-*l/72.5%
*-lft-identity72.5%
+-commutative72.5%
unpow272.5%
fma-udef72.5%
Simplified72.5%
associate-*r/72.5%
sqrt-div72.5%
metadata-eval72.5%
un-div-inv72.6%
Applied egg-rr72.6%
Taylor expanded in F around -inf 98.9%
neg-mul-198.9%
Simplified98.9%
if -2.34999999999999993e-4 < F < -1.85000000000000006e-145Initial program 99.3%
Simplified99.4%
Taylor expanded in x around 0 99.5%
associate-*l/99.4%
*-lft-identity99.4%
+-commutative99.4%
unpow299.4%
fma-udef99.4%
Simplified99.4%
associate-*r/99.3%
sqrt-div99.4%
metadata-eval99.4%
un-div-inv99.5%
Applied egg-rr99.5%
Taylor expanded in F around 0 97.8%
Taylor expanded in F around inf 76.5%
if -1.85000000000000006e-145 < F Initial program 78.0%
Simplified85.1%
Taylor expanded in x around 0 85.1%
associate-*l/85.1%
*-lft-identity85.1%
+-commutative85.1%
unpow285.1%
fma-udef85.1%
Simplified85.1%
associate-*r/85.1%
sqrt-div85.1%
metadata-eval85.1%
un-div-inv85.1%
Applied egg-rr85.1%
Taylor expanded in F around inf 84.8%
Final simplification88.1%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -0.00043)
(- (/ -1.0 (sin B)) t_0)
(if (<= F -1.9e-135)
(/ F (* (sin B) (sqrt 2.0)))
(if (<= F 1.4e-47) (/ (- x) (tan B)) (- (/ 1.0 (sin B)) t_0))))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -0.00043) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= -1.9e-135) {
tmp = F / (sin(B) * sqrt(2.0));
} else if (F <= 1.4e-47) {
tmp = -x / tan(B);
} else {
tmp = (1.0 / sin(B)) - t_0;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: tmp
t_0 = x / tan(b)
if (f <= (-0.00043d0)) then
tmp = ((-1.0d0) / sin(b)) - t_0
else if (f <= (-1.9d-135)) then
tmp = f / (sin(b) * sqrt(2.0d0))
else if (f <= 1.4d-47) then
tmp = -x / tan(b)
else
tmp = (1.0d0 / sin(b)) - t_0
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = x / Math.tan(B);
double tmp;
if (F <= -0.00043) {
tmp = (-1.0 / Math.sin(B)) - t_0;
} else if (F <= -1.9e-135) {
tmp = F / (Math.sin(B) * Math.sqrt(2.0));
} else if (F <= 1.4e-47) {
tmp = -x / Math.tan(B);
} else {
tmp = (1.0 / Math.sin(B)) - t_0;
}
return tmp;
}
def code(F, B, x): t_0 = x / math.tan(B) tmp = 0 if F <= -0.00043: tmp = (-1.0 / math.sin(B)) - t_0 elif F <= -1.9e-135: tmp = F / (math.sin(B) * math.sqrt(2.0)) elif F <= 1.4e-47: tmp = -x / math.tan(B) else: tmp = (1.0 / math.sin(B)) - t_0 return tmp
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -0.00043) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= -1.9e-135) tmp = Float64(F / Float64(sin(B) * sqrt(2.0))); elseif (F <= 1.4e-47) tmp = Float64(Float64(-x) / tan(B)); else tmp = Float64(Float64(1.0 / sin(B)) - t_0); end return tmp end
function tmp_2 = code(F, B, x) t_0 = x / tan(B); tmp = 0.0; if (F <= -0.00043) tmp = (-1.0 / sin(B)) - t_0; elseif (F <= -1.9e-135) tmp = F / (sin(B) * sqrt(2.0)); elseif (F <= 1.4e-47) tmp = -x / tan(B); else tmp = (1.0 / sin(B)) - t_0; end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -0.00043], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, -1.9e-135], N[(F / N[(N[Sin[B], $MachinePrecision] * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.4e-47], N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -0.00043:\\
\;\;\;\;\frac{-1}{\sin B} - t_0\\
\mathbf{elif}\;F \leq -1.9 \cdot 10^{-135}:\\
\;\;\;\;\frac{F}{\sin B \cdot \sqrt{2}}\\
\mathbf{elif}\;F \leq 1.4 \cdot 10^{-47}:\\
\;\;\;\;\frac{-x}{\tan B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t_0\\
\end{array}
\end{array}
if F < -4.29999999999999989e-4Initial program 54.3%
Simplified72.5%
Taylor expanded in x around 0 72.5%
associate-*l/72.5%
*-lft-identity72.5%
+-commutative72.5%
unpow272.5%
fma-udef72.5%
Simplified72.5%
Taylor expanded in F around -inf 98.2%
if -4.29999999999999989e-4 < F < -1.9000000000000001e-135Initial program 99.3%
Simplified99.4%
Taylor expanded in x around 0 99.5%
associate-*l/99.4%
*-lft-identity99.4%
+-commutative99.4%
unpow299.4%
fma-udef99.4%
Simplified99.4%
associate-*r/99.3%
sqrt-div99.4%
metadata-eval99.4%
un-div-inv99.5%
Applied egg-rr99.5%
Taylor expanded in F around 0 97.8%
Taylor expanded in F around inf 76.5%
if -1.9000000000000001e-135 < F < 1.39999999999999996e-47Initial program 99.4%
Taylor expanded in F around -inf 31.0%
Taylor expanded in x around inf 75.1%
mul-1-neg75.1%
Simplified75.1%
associate-/l*75.1%
tan-quot75.2%
expm1-log1p-u56.7%
expm1-udef29.3%
Applied egg-rr29.3%
expm1-def56.7%
expm1-log1p75.2%
Simplified75.2%
if 1.39999999999999996e-47 < F Initial program 58.5%
Simplified71.9%
Taylor expanded in x around 0 71.9%
associate-*l/71.9%
*-lft-identity71.9%
+-commutative71.9%
unpow271.9%
fma-udef71.9%
Simplified71.9%
Taylor expanded in F around inf 93.3%
Final simplification87.9%
(FPCore (F B x)
:precision binary64
(if (<= F -0.0009)
(- (/ -1.0 (sin B)) (/ x B))
(if (<= F -1.9e-135)
(/ F (* (sin B) (sqrt 2.0)))
(if (<= F 850.0)
(/ (- x) (tan B))
(if (<= F 4.2e+81)
(- (* (/ 1.0 F) (/ F (sin B))) (/ x B))
(- (/ 1.0 B) (/ x (tan B))))))))
double code(double F, double B, double x) {
double tmp;
if (F <= -0.0009) {
tmp = (-1.0 / sin(B)) - (x / B);
} else if (F <= -1.9e-135) {
tmp = F / (sin(B) * sqrt(2.0));
} else if (F <= 850.0) {
tmp = -x / tan(B);
} else if (F <= 4.2e+81) {
tmp = ((1.0 / F) * (F / sin(B))) - (x / B);
} else {
tmp = (1.0 / B) - (x / tan(B));
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if (f <= (-0.0009d0)) then
tmp = ((-1.0d0) / sin(b)) - (x / b)
else if (f <= (-1.9d-135)) then
tmp = f / (sin(b) * sqrt(2.0d0))
else if (f <= 850.0d0) then
tmp = -x / tan(b)
else if (f <= 4.2d+81) then
tmp = ((1.0d0 / f) * (f / sin(b))) - (x / b)
else
tmp = (1.0d0 / b) - (x / tan(b))
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -0.0009) {
tmp = (-1.0 / Math.sin(B)) - (x / B);
} else if (F <= -1.9e-135) {
tmp = F / (Math.sin(B) * Math.sqrt(2.0));
} else if (F <= 850.0) {
tmp = -x / Math.tan(B);
} else if (F <= 4.2e+81) {
tmp = ((1.0 / F) * (F / Math.sin(B))) - (x / B);
} else {
tmp = (1.0 / B) - (x / Math.tan(B));
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -0.0009: tmp = (-1.0 / math.sin(B)) - (x / B) elif F <= -1.9e-135: tmp = F / (math.sin(B) * math.sqrt(2.0)) elif F <= 850.0: tmp = -x / math.tan(B) elif F <= 4.2e+81: tmp = ((1.0 / F) * (F / math.sin(B))) - (x / B) else: tmp = (1.0 / B) - (x / math.tan(B)) return tmp
function code(F, B, x) tmp = 0.0 if (F <= -0.0009) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B)); elseif (F <= -1.9e-135) tmp = Float64(F / Float64(sin(B) * sqrt(2.0))); elseif (F <= 850.0) tmp = Float64(Float64(-x) / tan(B)); elseif (F <= 4.2e+81) tmp = Float64(Float64(Float64(1.0 / F) * Float64(F / sin(B))) - Float64(x / B)); else tmp = Float64(Float64(1.0 / B) - Float64(x / tan(B))); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -0.0009) tmp = (-1.0 / sin(B)) - (x / B); elseif (F <= -1.9e-135) tmp = F / (sin(B) * sqrt(2.0)); elseif (F <= 850.0) tmp = -x / tan(B); elseif (F <= 4.2e+81) tmp = ((1.0 / F) * (F / sin(B))) - (x / B); else tmp = (1.0 / B) - (x / tan(B)); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -0.0009], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -1.9e-135], N[(F / N[(N[Sin[B], $MachinePrecision] * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 850.0], N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 4.2e+81], N[(N[(N[(1.0 / F), $MachinePrecision] * N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / B), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -0.0009:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\
\mathbf{elif}\;F \leq -1.9 \cdot 10^{-135}:\\
\;\;\;\;\frac{F}{\sin B \cdot \sqrt{2}}\\
\mathbf{elif}\;F \leq 850:\\
\;\;\;\;\frac{-x}{\tan B}\\
\mathbf{elif}\;F \leq 4.2 \cdot 10^{+81}:\\
\;\;\;\;\frac{1}{F} \cdot \frac{F}{\sin B} - \frac{x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{B} - \frac{x}{\tan B}\\
\end{array}
\end{array}
if F < -8.9999999999999998e-4Initial program 54.3%
Taylor expanded in F around -inf 98.2%
Taylor expanded in B around 0 82.1%
if -8.9999999999999998e-4 < F < -1.9000000000000001e-135Initial program 99.3%
Simplified99.4%
Taylor expanded in x around 0 99.5%
associate-*l/99.4%
*-lft-identity99.4%
+-commutative99.4%
unpow299.4%
fma-udef99.4%
Simplified99.4%
associate-*r/99.3%
sqrt-div99.4%
metadata-eval99.4%
un-div-inv99.5%
Applied egg-rr99.5%
Taylor expanded in F around 0 97.8%
Taylor expanded in F around inf 76.5%
if -1.9000000000000001e-135 < F < 850Initial program 99.4%
Taylor expanded in F around -inf 32.9%
Taylor expanded in x around inf 71.7%
mul-1-neg71.7%
Simplified71.7%
associate-/l*71.7%
tan-quot71.8%
expm1-log1p-u52.1%
expm1-udef28.1%
Applied egg-rr28.1%
expm1-def52.1%
expm1-log1p71.8%
Simplified71.8%
if 850 < F < 4.1999999999999997e81Initial program 99.3%
Taylor expanded in F around inf 99.0%
Taylor expanded in B around 0 86.6%
if 4.1999999999999997e81 < F Initial program 40.5%
Simplified59.8%
Taylor expanded in F around inf 99.6%
associate-/r*99.7%
Simplified99.7%
Taylor expanded in B around 0 77.4%
Final simplification77.3%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -0.00015)
(- (/ -1.0 (sin B)) t_0)
(if (<= F -5.8e-137)
(/ F (* (sin B) (sqrt 2.0)))
(if (<= F 850.0)
(/ (- x) (tan B))
(if (<= F 2.25e+80)
(- (* (/ 1.0 F) (/ F (sin B))) (/ x B))
(- (/ 1.0 B) t_0)))))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -0.00015) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= -5.8e-137) {
tmp = F / (sin(B) * sqrt(2.0));
} else if (F <= 850.0) {
tmp = -x / tan(B);
} else if (F <= 2.25e+80) {
tmp = ((1.0 / F) * (F / sin(B))) - (x / B);
} else {
tmp = (1.0 / B) - t_0;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: tmp
t_0 = x / tan(b)
if (f <= (-0.00015d0)) then
tmp = ((-1.0d0) / sin(b)) - t_0
else if (f <= (-5.8d-137)) then
tmp = f / (sin(b) * sqrt(2.0d0))
else if (f <= 850.0d0) then
tmp = -x / tan(b)
else if (f <= 2.25d+80) then
tmp = ((1.0d0 / f) * (f / sin(b))) - (x / b)
else
tmp = (1.0d0 / b) - t_0
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = x / Math.tan(B);
double tmp;
if (F <= -0.00015) {
tmp = (-1.0 / Math.sin(B)) - t_0;
} else if (F <= -5.8e-137) {
tmp = F / (Math.sin(B) * Math.sqrt(2.0));
} else if (F <= 850.0) {
tmp = -x / Math.tan(B);
} else if (F <= 2.25e+80) {
tmp = ((1.0 / F) * (F / Math.sin(B))) - (x / B);
} else {
tmp = (1.0 / B) - t_0;
}
return tmp;
}
def code(F, B, x): t_0 = x / math.tan(B) tmp = 0 if F <= -0.00015: tmp = (-1.0 / math.sin(B)) - t_0 elif F <= -5.8e-137: tmp = F / (math.sin(B) * math.sqrt(2.0)) elif F <= 850.0: tmp = -x / math.tan(B) elif F <= 2.25e+80: tmp = ((1.0 / F) * (F / math.sin(B))) - (x / B) else: tmp = (1.0 / B) - t_0 return tmp
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -0.00015) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= -5.8e-137) tmp = Float64(F / Float64(sin(B) * sqrt(2.0))); elseif (F <= 850.0) tmp = Float64(Float64(-x) / tan(B)); elseif (F <= 2.25e+80) tmp = Float64(Float64(Float64(1.0 / F) * Float64(F / sin(B))) - Float64(x / B)); else tmp = Float64(Float64(1.0 / B) - t_0); end return tmp end
function tmp_2 = code(F, B, x) t_0 = x / tan(B); tmp = 0.0; if (F <= -0.00015) tmp = (-1.0 / sin(B)) - t_0; elseif (F <= -5.8e-137) tmp = F / (sin(B) * sqrt(2.0)); elseif (F <= 850.0) tmp = -x / tan(B); elseif (F <= 2.25e+80) tmp = ((1.0 / F) * (F / sin(B))) - (x / B); else tmp = (1.0 / B) - t_0; end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -0.00015], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, -5.8e-137], N[(F / N[(N[Sin[B], $MachinePrecision] * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 850.0], N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 2.25e+80], N[(N[(N[(1.0 / F), $MachinePrecision] * N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / B), $MachinePrecision] - t$95$0), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -0.00015:\\
\;\;\;\;\frac{-1}{\sin B} - t_0\\
\mathbf{elif}\;F \leq -5.8 \cdot 10^{-137}:\\
\;\;\;\;\frac{F}{\sin B \cdot \sqrt{2}}\\
\mathbf{elif}\;F \leq 850:\\
\;\;\;\;\frac{-x}{\tan B}\\
\mathbf{elif}\;F \leq 2.25 \cdot 10^{+80}:\\
\;\;\;\;\frac{1}{F} \cdot \frac{F}{\sin B} - \frac{x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{B} - t_0\\
\end{array}
\end{array}
if F < -1.49999999999999987e-4Initial program 54.3%
Simplified72.5%
Taylor expanded in x around 0 72.5%
associate-*l/72.5%
*-lft-identity72.5%
+-commutative72.5%
unpow272.5%
fma-udef72.5%
Simplified72.5%
Taylor expanded in F around -inf 98.2%
if -1.49999999999999987e-4 < F < -5.7999999999999997e-137Initial program 99.3%
Simplified99.4%
Taylor expanded in x around 0 99.5%
associate-*l/99.4%
*-lft-identity99.4%
+-commutative99.4%
unpow299.4%
fma-udef99.4%
Simplified99.4%
associate-*r/99.3%
sqrt-div99.4%
metadata-eval99.4%
un-div-inv99.5%
Applied egg-rr99.5%
Taylor expanded in F around 0 97.8%
Taylor expanded in F around inf 76.5%
if -5.7999999999999997e-137 < F < 850Initial program 99.4%
Taylor expanded in F around -inf 32.9%
Taylor expanded in x around inf 71.7%
mul-1-neg71.7%
Simplified71.7%
associate-/l*71.7%
tan-quot71.8%
expm1-log1p-u52.1%
expm1-udef28.1%
Applied egg-rr28.1%
expm1-def52.1%
expm1-log1p71.8%
Simplified71.8%
if 850 < F < 2.25000000000000003e80Initial program 99.3%
Taylor expanded in F around inf 99.0%
Taylor expanded in B around 0 86.6%
if 2.25000000000000003e80 < F Initial program 40.5%
Simplified59.8%
Taylor expanded in F around inf 99.6%
associate-/r*99.7%
Simplified99.7%
Taylor expanded in B around 0 77.4%
Final simplification81.9%
(FPCore (F B x)
:precision binary64
(if (<= F -8.5e-5)
(- (/ -1.0 (sin B)) (/ x B))
(if (<= F -7.5e-179)
(/ (- (/ F (sqrt 2.0)) x) B)
(if (<= F 1200.0)
(/ (- x) (tan B))
(if (<= F 1.12e+80)
(- (* (/ 1.0 F) (/ F (sin B))) (/ x B))
(- (/ 1.0 B) (/ x (tan B))))))))
double code(double F, double B, double x) {
double tmp;
if (F <= -8.5e-5) {
tmp = (-1.0 / sin(B)) - (x / B);
} else if (F <= -7.5e-179) {
tmp = ((F / sqrt(2.0)) - x) / B;
} else if (F <= 1200.0) {
tmp = -x / tan(B);
} else if (F <= 1.12e+80) {
tmp = ((1.0 / F) * (F / sin(B))) - (x / B);
} else {
tmp = (1.0 / B) - (x / tan(B));
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if (f <= (-8.5d-5)) then
tmp = ((-1.0d0) / sin(b)) - (x / b)
else if (f <= (-7.5d-179)) then
tmp = ((f / sqrt(2.0d0)) - x) / b
else if (f <= 1200.0d0) then
tmp = -x / tan(b)
else if (f <= 1.12d+80) then
tmp = ((1.0d0 / f) * (f / sin(b))) - (x / b)
else
tmp = (1.0d0 / b) - (x / tan(b))
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -8.5e-5) {
tmp = (-1.0 / Math.sin(B)) - (x / B);
} else if (F <= -7.5e-179) {
tmp = ((F / Math.sqrt(2.0)) - x) / B;
} else if (F <= 1200.0) {
tmp = -x / Math.tan(B);
} else if (F <= 1.12e+80) {
tmp = ((1.0 / F) * (F / Math.sin(B))) - (x / B);
} else {
tmp = (1.0 / B) - (x / Math.tan(B));
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -8.5e-5: tmp = (-1.0 / math.sin(B)) - (x / B) elif F <= -7.5e-179: tmp = ((F / math.sqrt(2.0)) - x) / B elif F <= 1200.0: tmp = -x / math.tan(B) elif F <= 1.12e+80: tmp = ((1.0 / F) * (F / math.sin(B))) - (x / B) else: tmp = (1.0 / B) - (x / math.tan(B)) return tmp
function code(F, B, x) tmp = 0.0 if (F <= -8.5e-5) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B)); elseif (F <= -7.5e-179) tmp = Float64(Float64(Float64(F / sqrt(2.0)) - x) / B); elseif (F <= 1200.0) tmp = Float64(Float64(-x) / tan(B)); elseif (F <= 1.12e+80) tmp = Float64(Float64(Float64(1.0 / F) * Float64(F / sin(B))) - Float64(x / B)); else tmp = Float64(Float64(1.0 / B) - Float64(x / tan(B))); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -8.5e-5) tmp = (-1.0 / sin(B)) - (x / B); elseif (F <= -7.5e-179) tmp = ((F / sqrt(2.0)) - x) / B; elseif (F <= 1200.0) tmp = -x / tan(B); elseif (F <= 1.12e+80) tmp = ((1.0 / F) * (F / sin(B))) - (x / B); else tmp = (1.0 / B) - (x / tan(B)); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -8.5e-5], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -7.5e-179], N[(N[(N[(F / N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 1200.0], N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.12e+80], N[(N[(N[(1.0 / F), $MachinePrecision] * N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / B), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -8.5 \cdot 10^{-5}:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\
\mathbf{elif}\;F \leq -7.5 \cdot 10^{-179}:\\
\;\;\;\;\frac{\frac{F}{\sqrt{2}} - x}{B}\\
\mathbf{elif}\;F \leq 1200:\\
\;\;\;\;\frac{-x}{\tan B}\\
\mathbf{elif}\;F \leq 1.12 \cdot 10^{+80}:\\
\;\;\;\;\frac{1}{F} \cdot \frac{F}{\sin B} - \frac{x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{B} - \frac{x}{\tan B}\\
\end{array}
\end{array}
if F < -8.500000000000001e-5Initial program 54.9%
Taylor expanded in F around -inf 97.0%
Taylor expanded in B around 0 81.2%
if -8.500000000000001e-5 < F < -7.4999999999999996e-179Initial program 99.3%
Simplified99.5%
Taylor expanded in x around 0 99.6%
associate-*l/99.5%
*-lft-identity99.5%
+-commutative99.5%
unpow299.5%
fma-udef99.5%
Simplified99.5%
associate-*r/99.4%
sqrt-div99.5%
metadata-eval99.5%
un-div-inv99.7%
Applied egg-rr99.7%
Taylor expanded in F around 0 99.7%
Taylor expanded in B around 0 58.7%
if -7.4999999999999996e-179 < F < 1200Initial program 99.4%
Taylor expanded in F around -inf 32.3%
Taylor expanded in x around inf 72.5%
mul-1-neg72.5%
Simplified72.5%
associate-/l*72.5%
tan-quot72.6%
expm1-log1p-u52.5%
expm1-udef26.1%
Applied egg-rr26.1%
expm1-def52.5%
expm1-log1p72.6%
Simplified72.6%
if 1200 < F < 1.12e80Initial program 99.3%
Taylor expanded in F around inf 99.0%
Taylor expanded in B around 0 86.6%
if 1.12e80 < F Initial program 40.5%
Simplified59.8%
Taylor expanded in F around inf 99.6%
associate-/r*99.7%
Simplified99.7%
Taylor expanded in B around 0 77.4%
Final simplification75.5%
(FPCore (F B x)
:precision binary64
(if (<= F -8.5e-5)
(/ (- -1.0 x) B)
(if (<= F -8.6e-179)
(/ (- (/ F (sqrt 2.0)) x) B)
(if (<= F 1.2e-77) (/ (- x) (tan B)) (- (/ 1.0 B) (/ x (tan B)))))))
double code(double F, double B, double x) {
double tmp;
if (F <= -8.5e-5) {
tmp = (-1.0 - x) / B;
} else if (F <= -8.6e-179) {
tmp = ((F / sqrt(2.0)) - x) / B;
} else if (F <= 1.2e-77) {
tmp = -x / tan(B);
} else {
tmp = (1.0 / B) - (x / tan(B));
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if (f <= (-8.5d-5)) then
tmp = ((-1.0d0) - x) / b
else if (f <= (-8.6d-179)) then
tmp = ((f / sqrt(2.0d0)) - x) / b
else if (f <= 1.2d-77) then
tmp = -x / tan(b)
else
tmp = (1.0d0 / b) - (x / tan(b))
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -8.5e-5) {
tmp = (-1.0 - x) / B;
} else if (F <= -8.6e-179) {
tmp = ((F / Math.sqrt(2.0)) - x) / B;
} else if (F <= 1.2e-77) {
tmp = -x / Math.tan(B);
} else {
tmp = (1.0 / B) - (x / Math.tan(B));
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -8.5e-5: tmp = (-1.0 - x) / B elif F <= -8.6e-179: tmp = ((F / math.sqrt(2.0)) - x) / B elif F <= 1.2e-77: tmp = -x / math.tan(B) else: tmp = (1.0 / B) - (x / math.tan(B)) return tmp
function code(F, B, x) tmp = 0.0 if (F <= -8.5e-5) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= -8.6e-179) tmp = Float64(Float64(Float64(F / sqrt(2.0)) - x) / B); elseif (F <= 1.2e-77) tmp = Float64(Float64(-x) / tan(B)); else tmp = Float64(Float64(1.0 / B) - Float64(x / tan(B))); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -8.5e-5) tmp = (-1.0 - x) / B; elseif (F <= -8.6e-179) tmp = ((F / sqrt(2.0)) - x) / B; elseif (F <= 1.2e-77) tmp = -x / tan(B); else tmp = (1.0 / B) - (x / tan(B)); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -8.5e-5], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, -8.6e-179], N[(N[(N[(F / N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 1.2e-77], N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / B), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -8.5 \cdot 10^{-5}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq -8.6 \cdot 10^{-179}:\\
\;\;\;\;\frac{\frac{F}{\sqrt{2}} - x}{B}\\
\mathbf{elif}\;F \leq 1.2 \cdot 10^{-77}:\\
\;\;\;\;\frac{-x}{\tan B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{B} - \frac{x}{\tan B}\\
\end{array}
\end{array}
if F < -8.500000000000001e-5Initial program 54.9%
Taylor expanded in F around -inf 97.0%
Taylor expanded in B around 0 60.3%
associate-*r/60.3%
distribute-lft-in60.3%
metadata-eval60.3%
neg-mul-160.3%
Simplified60.3%
if -8.500000000000001e-5 < F < -8.60000000000000052e-179Initial program 99.3%
Simplified99.5%
Taylor expanded in x around 0 99.6%
associate-*l/99.5%
*-lft-identity99.5%
+-commutative99.5%
unpow299.5%
fma-udef99.5%
Simplified99.5%
associate-*r/99.4%
sqrt-div99.5%
metadata-eval99.5%
un-div-inv99.7%
Applied egg-rr99.7%
Taylor expanded in F around 0 99.7%
Taylor expanded in B around 0 58.7%
if -8.60000000000000052e-179 < F < 1.19999999999999995e-77Initial program 99.5%
Taylor expanded in F around -inf 28.7%
Taylor expanded in x around inf 76.5%
mul-1-neg76.5%
Simplified76.5%
associate-/l*76.5%
tan-quot76.6%
expm1-log1p-u56.7%
expm1-udef25.8%
Applied egg-rr25.8%
expm1-def56.7%
expm1-log1p76.6%
Simplified76.6%
if 1.19999999999999995e-77 < F Initial program 60.3%
Simplified73.2%
Taylor expanded in F around inf 91.4%
associate-/r*91.4%
Simplified91.4%
Taylor expanded in B around 0 70.1%
Final simplification67.7%
(FPCore (F B x)
:precision binary64
(if (<= F -8.5e-5)
(- (/ -1.0 (sin B)) (/ x B))
(if (<= F -8.6e-179)
(/ (- (/ F (sqrt 2.0)) x) B)
(if (<= F 3.8e-77) (/ (- x) (tan B)) (- (/ 1.0 B) (/ x (tan B)))))))
double code(double F, double B, double x) {
double tmp;
if (F <= -8.5e-5) {
tmp = (-1.0 / sin(B)) - (x / B);
} else if (F <= -8.6e-179) {
tmp = ((F / sqrt(2.0)) - x) / B;
} else if (F <= 3.8e-77) {
tmp = -x / tan(B);
} else {
tmp = (1.0 / B) - (x / tan(B));
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if (f <= (-8.5d-5)) then
tmp = ((-1.0d0) / sin(b)) - (x / b)
else if (f <= (-8.6d-179)) then
tmp = ((f / sqrt(2.0d0)) - x) / b
else if (f <= 3.8d-77) then
tmp = -x / tan(b)
else
tmp = (1.0d0 / b) - (x / tan(b))
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -8.5e-5) {
tmp = (-1.0 / Math.sin(B)) - (x / B);
} else if (F <= -8.6e-179) {
tmp = ((F / Math.sqrt(2.0)) - x) / B;
} else if (F <= 3.8e-77) {
tmp = -x / Math.tan(B);
} else {
tmp = (1.0 / B) - (x / Math.tan(B));
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -8.5e-5: tmp = (-1.0 / math.sin(B)) - (x / B) elif F <= -8.6e-179: tmp = ((F / math.sqrt(2.0)) - x) / B elif F <= 3.8e-77: tmp = -x / math.tan(B) else: tmp = (1.0 / B) - (x / math.tan(B)) return tmp
function code(F, B, x) tmp = 0.0 if (F <= -8.5e-5) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B)); elseif (F <= -8.6e-179) tmp = Float64(Float64(Float64(F / sqrt(2.0)) - x) / B); elseif (F <= 3.8e-77) tmp = Float64(Float64(-x) / tan(B)); else tmp = Float64(Float64(1.0 / B) - Float64(x / tan(B))); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -8.5e-5) tmp = (-1.0 / sin(B)) - (x / B); elseif (F <= -8.6e-179) tmp = ((F / sqrt(2.0)) - x) / B; elseif (F <= 3.8e-77) tmp = -x / tan(B); else tmp = (1.0 / B) - (x / tan(B)); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -8.5e-5], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -8.6e-179], N[(N[(N[(F / N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 3.8e-77], N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / B), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -8.5 \cdot 10^{-5}:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\
\mathbf{elif}\;F \leq -8.6 \cdot 10^{-179}:\\
\;\;\;\;\frac{\frac{F}{\sqrt{2}} - x}{B}\\
\mathbf{elif}\;F \leq 3.8 \cdot 10^{-77}:\\
\;\;\;\;\frac{-x}{\tan B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{B} - \frac{x}{\tan B}\\
\end{array}
\end{array}
if F < -8.500000000000001e-5Initial program 54.9%
Taylor expanded in F around -inf 97.0%
Taylor expanded in B around 0 81.2%
if -8.500000000000001e-5 < F < -8.60000000000000052e-179Initial program 99.3%
Simplified99.5%
Taylor expanded in x around 0 99.6%
associate-*l/99.5%
*-lft-identity99.5%
+-commutative99.5%
unpow299.5%
fma-udef99.5%
Simplified99.5%
associate-*r/99.4%
sqrt-div99.5%
metadata-eval99.5%
un-div-inv99.7%
Applied egg-rr99.7%
Taylor expanded in F around 0 99.7%
Taylor expanded in B around 0 58.7%
if -8.60000000000000052e-179 < F < 3.7999999999999999e-77Initial program 99.5%
Taylor expanded in F around -inf 28.7%
Taylor expanded in x around inf 76.5%
mul-1-neg76.5%
Simplified76.5%
associate-/l*76.5%
tan-quot76.6%
expm1-log1p-u56.7%
expm1-udef25.8%
Applied egg-rr25.8%
expm1-def56.7%
expm1-log1p76.6%
Simplified76.6%
if 3.7999999999999999e-77 < F Initial program 60.3%
Simplified73.2%
Taylor expanded in F around inf 91.4%
associate-/r*91.4%
Simplified91.4%
Taylor expanded in B around 0 70.1%
Final simplification73.7%
(FPCore (F B x) :precision binary64 (if (<= F -2.4e-21) (/ (- -1.0 x) B) (if (<= F 2e-77) (/ (- x) (tan B)) (- (/ 1.0 B) (/ x (tan B))))))
double code(double F, double B, double x) {
double tmp;
if (F <= -2.4e-21) {
tmp = (-1.0 - x) / B;
} else if (F <= 2e-77) {
tmp = -x / tan(B);
} else {
tmp = (1.0 / B) - (x / tan(B));
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if (f <= (-2.4d-21)) then
tmp = ((-1.0d0) - x) / b
else if (f <= 2d-77) then
tmp = -x / tan(b)
else
tmp = (1.0d0 / b) - (x / tan(b))
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -2.4e-21) {
tmp = (-1.0 - x) / B;
} else if (F <= 2e-77) {
tmp = -x / Math.tan(B);
} else {
tmp = (1.0 / B) - (x / Math.tan(B));
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -2.4e-21: tmp = (-1.0 - x) / B elif F <= 2e-77: tmp = -x / math.tan(B) else: tmp = (1.0 / B) - (x / math.tan(B)) return tmp
function code(F, B, x) tmp = 0.0 if (F <= -2.4e-21) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= 2e-77) tmp = Float64(Float64(-x) / tan(B)); else tmp = Float64(Float64(1.0 / B) - Float64(x / tan(B))); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -2.4e-21) tmp = (-1.0 - x) / B; elseif (F <= 2e-77) tmp = -x / tan(B); else tmp = (1.0 / B) - (x / tan(B)); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -2.4e-21], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 2e-77], N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / B), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -2.4 \cdot 10^{-21}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq 2 \cdot 10^{-77}:\\
\;\;\;\;\frac{-x}{\tan B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{B} - \frac{x}{\tan B}\\
\end{array}
\end{array}
if F < -2.3999999999999999e-21Initial program 57.7%
Taylor expanded in F around -inf 92.7%
Taylor expanded in B around 0 58.2%
associate-*r/58.2%
distribute-lft-in58.2%
metadata-eval58.2%
neg-mul-158.2%
Simplified58.2%
if -2.3999999999999999e-21 < F < 1.9999999999999999e-77Initial program 99.4%
Taylor expanded in F around -inf 28.0%
Taylor expanded in x around inf 66.2%
mul-1-neg66.2%
Simplified66.2%
associate-/l*66.3%
tan-quot66.4%
expm1-log1p-u49.0%
expm1-udef26.1%
Applied egg-rr26.1%
expm1-def49.0%
expm1-log1p66.4%
Simplified66.4%
if 1.9999999999999999e-77 < F Initial program 60.3%
Simplified73.2%
Taylor expanded in F around inf 91.4%
associate-/r*91.4%
Simplified91.4%
Taylor expanded in B around 0 70.1%
Final simplification65.1%
(FPCore (F B x) :precision binary64 (if (<= F -3.5e-97) (/ (- -1.0 x) B) (if (<= F 2.05e-77) (/ (- x) (sin B)) (/ (- 1.0 x) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -3.5e-97) {
tmp = (-1.0 - x) / B;
} else if (F <= 2.05e-77) {
tmp = -x / sin(B);
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if (f <= (-3.5d-97)) then
tmp = ((-1.0d0) - x) / b
else if (f <= 2.05d-77) then
tmp = -x / sin(b)
else
tmp = (1.0d0 - x) / b
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -3.5e-97) {
tmp = (-1.0 - x) / B;
} else if (F <= 2.05e-77) {
tmp = -x / Math.sin(B);
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -3.5e-97: tmp = (-1.0 - x) / B elif F <= 2.05e-77: tmp = -x / math.sin(B) else: tmp = (1.0 - x) / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= -3.5e-97) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= 2.05e-77) tmp = Float64(Float64(-x) / sin(B)); else tmp = Float64(Float64(1.0 - x) / B); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -3.5e-97) tmp = (-1.0 - x) / B; elseif (F <= 2.05e-77) tmp = -x / sin(B); else tmp = (1.0 - x) / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -3.5e-97], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 2.05e-77], N[((-x) / N[Sin[B], $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -3.5 \cdot 10^{-97}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq 2.05 \cdot 10^{-77}:\\
\;\;\;\;\frac{-x}{\sin B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -3.50000000000000019e-97Initial program 63.2%
Taylor expanded in F around -inf 83.4%
Taylor expanded in B around 0 52.2%
associate-*r/52.2%
distribute-lft-in52.2%
metadata-eval52.2%
neg-mul-152.2%
Simplified52.2%
if -3.50000000000000019e-97 < F < 2.04999999999999981e-77Initial program 99.5%
Taylor expanded in F around -inf 28.9%
Taylor expanded in x around inf 73.5%
mul-1-neg73.5%
Simplified73.5%
Taylor expanded in B around 0 39.8%
if 2.04999999999999981e-77 < F Initial program 60.3%
Simplified73.2%
Taylor expanded in F around inf 91.4%
associate-/r*91.4%
Simplified91.4%
Taylor expanded in B around 0 47.0%
Final simplification46.7%
(FPCore (F B x) :precision binary64 (if (<= F -2.4e-21) (/ (- -1.0 x) B) (/ (- x) (tan B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -2.4e-21) {
tmp = (-1.0 - x) / B;
} else {
tmp = -x / tan(B);
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if (f <= (-2.4d-21)) then
tmp = ((-1.0d0) - x) / b
else
tmp = -x / tan(b)
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -2.4e-21) {
tmp = (-1.0 - x) / B;
} else {
tmp = -x / Math.tan(B);
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -2.4e-21: tmp = (-1.0 - x) / B else: tmp = -x / math.tan(B) return tmp
function code(F, B, x) tmp = 0.0 if (F <= -2.4e-21) tmp = Float64(Float64(-1.0 - x) / B); else tmp = Float64(Float64(-x) / tan(B)); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -2.4e-21) tmp = (-1.0 - x) / B; else tmp = -x / tan(B); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -2.4e-21], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -2.4 \cdot 10^{-21}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{-x}{\tan B}\\
\end{array}
\end{array}
if F < -2.3999999999999999e-21Initial program 57.7%
Taylor expanded in F around -inf 92.7%
Taylor expanded in B around 0 58.2%
associate-*r/58.2%
distribute-lft-in58.2%
metadata-eval58.2%
neg-mul-158.2%
Simplified58.2%
if -2.3999999999999999e-21 < F Initial program 79.8%
Taylor expanded in F around -inf 37.4%
Taylor expanded in x around inf 57.6%
mul-1-neg57.6%
Simplified57.6%
associate-/l*57.6%
tan-quot57.7%
expm1-log1p-u36.5%
expm1-udef24.5%
Applied egg-rr24.5%
expm1-def36.5%
expm1-log1p57.7%
Simplified57.7%
Final simplification57.8%
(FPCore (F B x) :precision binary64 (if (<= F -5.6e-26) (/ (- -1.0 x) B) (if (<= F 2.3e-110) (/ (- x) B) (/ (- 1.0 x) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -5.6e-26) {
tmp = (-1.0 - x) / B;
} else if (F <= 2.3e-110) {
tmp = -x / B;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if (f <= (-5.6d-26)) then
tmp = ((-1.0d0) - x) / b
else if (f <= 2.3d-110) then
tmp = -x / b
else
tmp = (1.0d0 - x) / b
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -5.6e-26) {
tmp = (-1.0 - x) / B;
} else if (F <= 2.3e-110) {
tmp = -x / B;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -5.6e-26: tmp = (-1.0 - x) / B elif F <= 2.3e-110: tmp = -x / B else: tmp = (1.0 - x) / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= -5.6e-26) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= 2.3e-110) tmp = Float64(Float64(-x) / B); else tmp = Float64(Float64(1.0 - x) / B); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -5.6e-26) tmp = (-1.0 - x) / B; elseif (F <= 2.3e-110) tmp = -x / B; else tmp = (1.0 - x) / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -5.6e-26], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 2.3e-110], N[((-x) / B), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -5.6 \cdot 10^{-26}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq 2.3 \cdot 10^{-110}:\\
\;\;\;\;\frac{-x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -5.6000000000000002e-26Initial program 57.7%
Taylor expanded in F around -inf 92.7%
Taylor expanded in B around 0 58.2%
associate-*r/58.2%
distribute-lft-in58.2%
metadata-eval58.2%
neg-mul-158.2%
Simplified58.2%
if -5.6000000000000002e-26 < F < 2.3000000000000001e-110Initial program 99.4%
Simplified99.7%
Taylor expanded in F around inf 18.7%
associate-/r*18.7%
Simplified18.7%
Taylor expanded in B around 0 16.1%
Taylor expanded in x around inf 35.9%
associate-*r/35.9%
neg-mul-135.9%
Simplified35.9%
if 2.3000000000000001e-110 < F Initial program 62.8%
Simplified74.8%
Taylor expanded in F around inf 88.5%
associate-/r*88.6%
Simplified88.6%
Taylor expanded in B around 0 44.2%
Final simplification45.9%
(FPCore (F B x) :precision binary64 (if (<= F 2.3e-110) (/ (- x) B) (/ (- 1.0 x) B)))
double code(double F, double B, double x) {
double tmp;
if (F <= 2.3e-110) {
tmp = -x / B;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if (f <= 2.3d-110) then
tmp = -x / b
else
tmp = (1.0d0 - x) / b
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= 2.3e-110) {
tmp = -x / B;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= 2.3e-110: tmp = -x / B else: tmp = (1.0 - x) / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= 2.3e-110) tmp = Float64(Float64(-x) / B); else tmp = Float64(Float64(1.0 - x) / B); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= 2.3e-110) tmp = -x / B; else tmp = (1.0 - x) / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, 2.3e-110], N[((-x) / B), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq 2.3 \cdot 10^{-110}:\\
\;\;\;\;\frac{-x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < 2.3000000000000001e-110Initial program 79.0%
Simplified87.3%
Taylor expanded in F around inf 31.4%
associate-/r*31.4%
Simplified31.4%
Taylor expanded in B around 0 23.4%
Taylor expanded in x around inf 33.9%
associate-*r/33.9%
neg-mul-133.9%
Simplified33.9%
if 2.3000000000000001e-110 < F Initial program 62.8%
Simplified74.8%
Taylor expanded in F around inf 88.5%
associate-/r*88.6%
Simplified88.6%
Taylor expanded in B around 0 44.2%
Final simplification37.7%
(FPCore (F B x) :precision binary64 (/ (- x) B))
double code(double F, double B, double x) {
return -x / B;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
code = -x / b
end function
public static double code(double F, double B, double x) {
return -x / B;
}
def code(F, B, x): return -x / B
function code(F, B, x) return Float64(Float64(-x) / B) end
function tmp = code(F, B, x) tmp = -x / B; end
code[F_, B_, x_] := N[((-x) / B), $MachinePrecision]
\begin{array}{l}
\\
\frac{-x}{B}
\end{array}
Initial program 73.0%
Simplified82.7%
Taylor expanded in F around inf 52.6%
associate-/r*52.6%
Simplified52.6%
Taylor expanded in B around 0 31.1%
Taylor expanded in x around inf 30.4%
associate-*r/30.4%
neg-mul-130.4%
Simplified30.4%
Final simplification30.4%
(FPCore (F B x) :precision binary64 (/ 1.0 B))
double code(double F, double B, double x) {
return 1.0 / B;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
code = 1.0d0 / b
end function
public static double code(double F, double B, double x) {
return 1.0 / B;
}
def code(F, B, x): return 1.0 / B
function code(F, B, x) return Float64(1.0 / B) end
function tmp = code(F, B, x) tmp = 1.0 / B; end
code[F_, B_, x_] := N[(1.0 / B), $MachinePrecision]
\begin{array}{l}
\\
\frac{1}{B}
\end{array}
Initial program 73.0%
Simplified82.7%
Taylor expanded in F around inf 52.6%
associate-/r*52.6%
Simplified52.6%
Taylor expanded in B around 0 31.1%
Taylor expanded in x around 0 10.0%
Final simplification10.0%
herbie shell --seed 2024021
(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))))))