
(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 22 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))))
(if (<= F -1.6e+15)
(- (/ -1.0 (sin B)) (* (cos B) (/ x (sin B))))
(if (<= F 300000.0)
(- (* F (/ (pow (fma x 2.0 (fma F F 2.0)) -0.5) (sin B))) 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 <= -1.6e+15) {
tmp = (-1.0 / sin(B)) - (cos(B) * (x / sin(B)));
} else if (F <= 300000.0) {
tmp = (F * (pow(fma(x, 2.0, fma(F, F, 2.0)), -0.5) / sin(B))) - 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 <= -1.6e+15) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(cos(B) * Float64(x / sin(B)))); elseif (F <= 300000.0) tmp = Float64(Float64(F * Float64((fma(x, 2.0, fma(F, F, 2.0)) ^ -0.5) / sin(B))) - 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, -1.6e+15], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(N[Cos[B], $MachinePrecision] * N[(x / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 300000.0], N[(N[(F * N[(N[Power[N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] / N[Sin[B], $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 -1.6 \cdot 10^{+15}:\\
\;\;\;\;\frac{-1}{\sin B} - \cos B \cdot \frac{x}{\sin B}\\
\mathbf{elif}\;F \leq 300000:\\
\;\;\;\;F \cdot \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B} - t_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t_0\\
\end{array}
\end{array}
if F < -1.6e15Initial program 66.6%
Taylor expanded in F around -inf 99.7%
Taylor expanded in x around 0 99.7%
associate-*l/99.8%
*-commutative99.8%
Simplified99.8%
if -1.6e15 < F < 3e5Initial program 99.4%
distribute-lft-neg-in99.4%
+-commutative99.4%
cancel-sign-sub-inv99.4%
Simplified99.6%
if 3e5 < F Initial program 57.3%
distribute-lft-neg-in57.3%
+-commutative57.3%
cancel-sign-sub-inv57.3%
Simplified72.2%
Taylor expanded in x around 0 72.2%
associate-*l/72.2%
*-lft-identity72.2%
+-commutative72.2%
unpow272.2%
fma-udef72.2%
Simplified72.2%
Taylor expanded in F around inf 99.7%
Final simplification99.7%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -200000000.0)
(- (/ -1.0 (sin B)) (* (cos B) (/ x (sin B))))
(if (<= F 300000.0)
(- (* F (/ (sqrt (/ 1.0 (fma F F 2.0))) (sin B))) 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 <= -200000000.0) {
tmp = (-1.0 / sin(B)) - (cos(B) * (x / sin(B)));
} else if (F <= 300000.0) {
tmp = (F * (sqrt((1.0 / fma(F, F, 2.0))) / sin(B))) - 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 <= -200000000.0) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(cos(B) * Float64(x / sin(B)))); elseif (F <= 300000.0) tmp = Float64(Float64(F * Float64(sqrt(Float64(1.0 / fma(F, F, 2.0))) / sin(B))) - 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, -200000000.0], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(N[Cos[B], $MachinePrecision] * N[(x / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 300000.0], 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[(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 -200000000:\\
\;\;\;\;\frac{-1}{\sin B} - \cos B \cdot \frac{x}{\sin B}\\
\mathbf{elif}\;F \leq 300000:\\
\;\;\;\;F \cdot \frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B} - t_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t_0\\
\end{array}
\end{array}
if F < -2e8Initial program 68.8%
Taylor expanded in F around -inf 99.8%
Taylor expanded in x around 0 99.7%
associate-*l/99.8%
*-commutative99.8%
Simplified99.8%
if -2e8 < F < 3e5Initial program 99.4%
distribute-lft-neg-in99.4%
+-commutative99.4%
cancel-sign-sub-inv99.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%
if 3e5 < F Initial program 57.3%
distribute-lft-neg-in57.3%
+-commutative57.3%
cancel-sign-sub-inv57.3%
Simplified72.2%
Taylor expanded in x around 0 72.2%
associate-*l/72.2%
*-lft-identity72.2%
+-commutative72.2%
unpow272.2%
fma-udef72.2%
Simplified72.2%
Taylor expanded in F around inf 99.7%
Final simplification99.7%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -1.15e+154)
(- (* F (/ -1.0 (* F (sin B)))) t_0)
(if (<= F 85000000.0)
(+
(* (/ F (sin B)) (pow (+ (+ 2.0 (* F F)) (* x 2.0)) -0.5))
(* x (/ -1.0 (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 <= -1.15e+154) {
tmp = (F * (-1.0 / (F * sin(B)))) - t_0;
} else if (F <= 85000000.0) {
tmp = ((F / sin(B)) * pow(((2.0 + (F * F)) + (x * 2.0)), -0.5)) + (x * (-1.0 / 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 <= (-1.15d+154)) then
tmp = (f * ((-1.0d0) / (f * sin(b)))) - t_0
else if (f <= 85000000.0d0) then
tmp = ((f / sin(b)) * (((2.0d0 + (f * f)) + (x * 2.0d0)) ** (-0.5d0))) + (x * ((-1.0d0) / 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 <= -1.15e+154) {
tmp = (F * (-1.0 / (F * Math.sin(B)))) - t_0;
} else if (F <= 85000000.0) {
tmp = ((F / Math.sin(B)) * Math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5)) + (x * (-1.0 / 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 <= -1.15e+154: tmp = (F * (-1.0 / (F * math.sin(B)))) - t_0 elif F <= 85000000.0: tmp = ((F / math.sin(B)) * math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5)) + (x * (-1.0 / 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 <= -1.15e+154) tmp = Float64(Float64(F * Float64(-1.0 / Float64(F * sin(B)))) - t_0); elseif (F <= 85000000.0) tmp = Float64(Float64(Float64(F / sin(B)) * (Float64(Float64(2.0 + Float64(F * F)) + Float64(x * 2.0)) ^ -0.5)) + Float64(x * Float64(-1.0 / 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 <= -1.15e+154) tmp = (F * (-1.0 / (F * sin(B)))) - t_0; elseif (F <= 85000000.0) tmp = ((F / sin(B)) * (((2.0 + (F * F)) + (x * 2.0)) ^ -0.5)) + (x * (-1.0 / 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, -1.15e+154], N[(N[(F * N[(-1.0 / N[(F * N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 85000000.0], 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 * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $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 -1.15 \cdot 10^{+154}:\\
\;\;\;\;F \cdot \frac{-1}{F \cdot \sin B} - t_0\\
\mathbf{elif}\;F \leq 85000000:\\
\;\;\;\;\frac{F}{\sin B} \cdot {\left(\left(2 + F \cdot F\right) + x \cdot 2\right)}^{-0.5} + x \cdot \frac{-1}{\tan B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t_0\\
\end{array}
\end{array}
if F < -1.15e154Initial program 18.0%
distribute-lft-neg-in18.0%
+-commutative18.0%
cancel-sign-sub-inv18.0%
Simplified54.0%
Taylor expanded in F around -inf 100.0%
if -1.15e154 < F < 8.5e7Initial program 99.4%
if 8.5e7 < F Initial program 56.7%
distribute-lft-neg-in56.7%
+-commutative56.7%
cancel-sign-sub-inv56.7%
Simplified71.8%
Taylor expanded in x around 0 71.9%
associate-*l/71.8%
*-lft-identity71.8%
+-commutative71.8%
unpow271.8%
fma-udef71.8%
Simplified71.8%
Taylor expanded in F around inf 99.7%
Final simplification99.6%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -1.15e+154)
(- (* F (/ -1.0 (* F (sin B)))) t_0)
(if (<= F 300000.0)
(+
(/ -1.0 (/ (tan B) x))
(* (/ F (sin B)) (pow (+ (+ 2.0 (* F F)) (* x 2.0)) -0.5)))
(- (/ 1.0 (sin B)) t_0)))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -1.15e+154) {
tmp = (F * (-1.0 / (F * sin(B)))) - t_0;
} else if (F <= 300000.0) {
tmp = (-1.0 / (tan(B) / x)) + ((F / sin(B)) * pow(((2.0 + (F * F)) + (x * 2.0)), -0.5));
} 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 <= (-1.15d+154)) then
tmp = (f * ((-1.0d0) / (f * sin(b)))) - t_0
else if (f <= 300000.0d0) then
tmp = ((-1.0d0) / (tan(b) / x)) + ((f / sin(b)) * (((2.0d0 + (f * f)) + (x * 2.0d0)) ** (-0.5d0)))
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 <= -1.15e+154) {
tmp = (F * (-1.0 / (F * Math.sin(B)))) - t_0;
} else if (F <= 300000.0) {
tmp = (-1.0 / (Math.tan(B) / x)) + ((F / Math.sin(B)) * Math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5));
} 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 <= -1.15e+154: tmp = (F * (-1.0 / (F * math.sin(B)))) - t_0 elif F <= 300000.0: tmp = (-1.0 / (math.tan(B) / x)) + ((F / math.sin(B)) * math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5)) 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 <= -1.15e+154) tmp = Float64(Float64(F * Float64(-1.0 / Float64(F * sin(B)))) - t_0); elseif (F <= 300000.0) tmp = Float64(Float64(-1.0 / Float64(tan(B) / x)) + Float64(Float64(F / sin(B)) * (Float64(Float64(2.0 + Float64(F * F)) + Float64(x * 2.0)) ^ -0.5))); 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 <= -1.15e+154) tmp = (F * (-1.0 / (F * sin(B)))) - t_0; elseif (F <= 300000.0) tmp = (-1.0 / (tan(B) / x)) + ((F / sin(B)) * (((2.0 + (F * F)) + (x * 2.0)) ^ -0.5)); 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, -1.15e+154], N[(N[(F * N[(-1.0 / N[(F * N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 300000.0], N[(N[(-1.0 / N[(N[Tan[B], $MachinePrecision] / x), $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[(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 -1.15 \cdot 10^{+154}:\\
\;\;\;\;F \cdot \frac{-1}{F \cdot \sin B} - t_0\\
\mathbf{elif}\;F \leq 300000:\\
\;\;\;\;\frac{-1}{\frac{\tan B}{x}} + \frac{F}{\sin B} \cdot {\left(\left(2 + F \cdot F\right) + x \cdot 2\right)}^{-0.5}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t_0\\
\end{array}
\end{array}
if F < -1.15e154Initial program 18.0%
distribute-lft-neg-in18.0%
+-commutative18.0%
cancel-sign-sub-inv18.0%
Simplified54.0%
Taylor expanded in F around -inf 100.0%
if -1.15e154 < F < 3e5Initial program 99.4%
div-inv99.5%
clear-num99.5%
Applied egg-rr99.5%
if 3e5 < F Initial program 57.3%
distribute-lft-neg-in57.3%
+-commutative57.3%
cancel-sign-sub-inv57.3%
Simplified72.2%
Taylor expanded in x around 0 72.2%
associate-*l/72.2%
*-lft-identity72.2%
+-commutative72.2%
unpow272.2%
fma-udef72.2%
Simplified72.2%
Taylor expanded in F around inf 99.7%
Final simplification99.6%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -1.42)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 1.4)
(- (/ F (/ (sin B) (sqrt 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 <= -1.42) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 1.4) {
tmp = (F / (sin(B) / sqrt(0.5))) - t_0;
} 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 <= (-1.42d0)) then
tmp = ((-1.0d0) / sin(b)) - t_0
else if (f <= 1.4d0) then
tmp = (f / (sin(b) / sqrt(0.5d0))) - t_0
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 <= -1.42) {
tmp = (-1.0 / Math.sin(B)) - t_0;
} else if (F <= 1.4) {
tmp = (F / (Math.sin(B) / Math.sqrt(0.5))) - t_0;
} 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 <= -1.42: tmp = (-1.0 / math.sin(B)) - t_0 elif F <= 1.4: tmp = (F / (math.sin(B) / math.sqrt(0.5))) - t_0 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 <= -1.42) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 1.4) tmp = Float64(Float64(F / Float64(sin(B) / sqrt(0.5))) - t_0); 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 <= -1.42) tmp = (-1.0 / sin(B)) - t_0; elseif (F <= 1.4) tmp = (F / (sin(B) / sqrt(0.5))) - t_0; 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, -1.42], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 1.4], N[(N[(F / N[(N[Sin[B], $MachinePrecision] / N[Sqrt[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 -1.42:\\
\;\;\;\;\frac{-1}{\sin B} - t_0\\
\mathbf{elif}\;F \leq 1.4:\\
\;\;\;\;\frac{F}{\frac{\sin B}{\sqrt{0.5}}} - t_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t_0\\
\end{array}
\end{array}
if F < -1.4199999999999999Initial program 70.8%
distribute-lft-neg-in70.8%
+-commutative70.8%
cancel-sign-sub-inv70.8%
Simplified83.5%
Taylor expanded in x around 0 83.3%
associate-*l/83.4%
*-lft-identity83.4%
+-commutative83.4%
unpow283.4%
fma-udef83.4%
Simplified83.4%
Taylor expanded in F around -inf 97.2%
if -1.4199999999999999 < F < 1.3999999999999999Initial program 99.4%
distribute-lft-neg-in99.4%
+-commutative99.4%
cancel-sign-sub-inv99.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 99.2%
associate-/l*99.2%
Simplified99.2%
if 1.3999999999999999 < F Initial program 57.8%
distribute-lft-neg-in57.8%
+-commutative57.8%
cancel-sign-sub-inv57.8%
Simplified72.5%
Taylor expanded in x around 0 72.6%
associate-*l/72.5%
*-lft-identity72.5%
+-commutative72.5%
unpow272.5%
fma-udef72.5%
Simplified72.5%
Taylor expanded in F around inf 99.2%
Final simplification98.8%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -1.42)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 1.4)
(- (/ (* F (sqrt 0.5)) (sin B)) 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 <= -1.42) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 1.4) {
tmp = ((F * sqrt(0.5)) / sin(B)) - t_0;
} 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 <= (-1.42d0)) then
tmp = ((-1.0d0) / sin(b)) - t_0
else if (f <= 1.4d0) then
tmp = ((f * sqrt(0.5d0)) / sin(b)) - t_0
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 <= -1.42) {
tmp = (-1.0 / Math.sin(B)) - t_0;
} else if (F <= 1.4) {
tmp = ((F * Math.sqrt(0.5)) / Math.sin(B)) - t_0;
} 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 <= -1.42: tmp = (-1.0 / math.sin(B)) - t_0 elif F <= 1.4: tmp = ((F * math.sqrt(0.5)) / math.sin(B)) - t_0 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 <= -1.42) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 1.4) tmp = Float64(Float64(Float64(F * sqrt(0.5)) / sin(B)) - t_0); 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 <= -1.42) tmp = (-1.0 / sin(B)) - t_0; elseif (F <= 1.4) tmp = ((F * sqrt(0.5)) / sin(B)) - t_0; 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, -1.42], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 1.4], N[(N[(N[(F * N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision] / N[Sin[B], $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 -1.42:\\
\;\;\;\;\frac{-1}{\sin B} - t_0\\
\mathbf{elif}\;F \leq 1.4:\\
\;\;\;\;\frac{F \cdot \sqrt{0.5}}{\sin B} - t_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t_0\\
\end{array}
\end{array}
if F < -1.4199999999999999Initial program 70.8%
distribute-lft-neg-in70.8%
+-commutative70.8%
cancel-sign-sub-inv70.8%
Simplified83.5%
Taylor expanded in x around 0 83.3%
associate-*l/83.4%
*-lft-identity83.4%
+-commutative83.4%
unpow283.4%
fma-udef83.4%
Simplified83.4%
Taylor expanded in F around -inf 97.2%
if -1.4199999999999999 < F < 1.3999999999999999Initial program 99.4%
distribute-lft-neg-in99.4%
+-commutative99.4%
cancel-sign-sub-inv99.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 99.2%
if 1.3999999999999999 < F Initial program 57.8%
distribute-lft-neg-in57.8%
+-commutative57.8%
cancel-sign-sub-inv57.8%
Simplified72.5%
Taylor expanded in x around 0 72.6%
associate-*l/72.5%
*-lft-identity72.5%
+-commutative72.5%
unpow272.5%
fma-udef72.5%
Simplified72.5%
Taylor expanded in F around inf 99.2%
Final simplification98.8%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -1.42)
(- (/ -1.0 (sin B)) (* (cos B) (/ x (sin B))))
(if (<= F 1.4)
(- (/ (* F (sqrt 0.5)) (sin B)) 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 <= -1.42) {
tmp = (-1.0 / sin(B)) - (cos(B) * (x / sin(B)));
} else if (F <= 1.4) {
tmp = ((F * sqrt(0.5)) / sin(B)) - t_0;
} 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 <= (-1.42d0)) then
tmp = ((-1.0d0) / sin(b)) - (cos(b) * (x / sin(b)))
else if (f <= 1.4d0) then
tmp = ((f * sqrt(0.5d0)) / sin(b)) - t_0
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 <= -1.42) {
tmp = (-1.0 / Math.sin(B)) - (Math.cos(B) * (x / Math.sin(B)));
} else if (F <= 1.4) {
tmp = ((F * Math.sqrt(0.5)) / Math.sin(B)) - t_0;
} 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 <= -1.42: tmp = (-1.0 / math.sin(B)) - (math.cos(B) * (x / math.sin(B))) elif F <= 1.4: tmp = ((F * math.sqrt(0.5)) / math.sin(B)) - t_0 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 <= -1.42) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(cos(B) * Float64(x / sin(B)))); elseif (F <= 1.4) tmp = Float64(Float64(Float64(F * sqrt(0.5)) / sin(B)) - t_0); 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 <= -1.42) tmp = (-1.0 / sin(B)) - (cos(B) * (x / sin(B))); elseif (F <= 1.4) tmp = ((F * sqrt(0.5)) / sin(B)) - t_0; 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, -1.42], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(N[Cos[B], $MachinePrecision] * N[(x / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.4], N[(N[(N[(F * N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision] / N[Sin[B], $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 -1.42:\\
\;\;\;\;\frac{-1}{\sin B} - \cos B \cdot \frac{x}{\sin B}\\
\mathbf{elif}\;F \leq 1.4:\\
\;\;\;\;\frac{F \cdot \sqrt{0.5}}{\sin B} - t_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t_0\\
\end{array}
\end{array}
if F < -1.4199999999999999Initial program 70.8%
Taylor expanded in F around -inf 97.2%
Taylor expanded in x around 0 97.2%
associate-*l/97.2%
*-commutative97.2%
Simplified97.2%
if -1.4199999999999999 < F < 1.3999999999999999Initial program 99.4%
distribute-lft-neg-in99.4%
+-commutative99.4%
cancel-sign-sub-inv99.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 99.2%
if 1.3999999999999999 < F Initial program 57.8%
distribute-lft-neg-in57.8%
+-commutative57.8%
cancel-sign-sub-inv57.8%
Simplified72.5%
Taylor expanded in x around 0 72.6%
associate-*l/72.5%
*-lft-identity72.5%
+-commutative72.5%
unpow272.5%
fma-udef72.5%
Simplified72.5%
Taylor expanded in F around inf 99.2%
Final simplification98.8%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (pow (+ (+ 2.0 (* F F)) (* x 2.0)) -0.5))
(t_1 (- (* (/ F (sin B)) t_0) (/ x B)))
(t_2 (/ x (tan B))))
(if (<= F -1.5e-14)
(- (/ -1.0 (sin B)) t_2)
(if (<= F -5.2e-122)
t_1
(if (<= F 1.45e-90)
(- (/ (* F (sqrt 0.5)) B) t_2)
(if (<= F 4.4e-55)
t_1
(if (<= F 13000.0)
(+ (/ -1.0 (/ (tan B) x)) (* t_0 (/ F B)))
(- (/ 1.0 (sin B)) t_2))))))))
double code(double F, double B, double x) {
double t_0 = pow(((2.0 + (F * F)) + (x * 2.0)), -0.5);
double t_1 = ((F / sin(B)) * t_0) - (x / B);
double t_2 = x / tan(B);
double tmp;
if (F <= -1.5e-14) {
tmp = (-1.0 / sin(B)) - t_2;
} else if (F <= -5.2e-122) {
tmp = t_1;
} else if (F <= 1.45e-90) {
tmp = ((F * sqrt(0.5)) / B) - t_2;
} else if (F <= 4.4e-55) {
tmp = t_1;
} else if (F <= 13000.0) {
tmp = (-1.0 / (tan(B) / x)) + (t_0 * (F / B));
} else {
tmp = (1.0 / sin(B)) - t_2;
}
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) :: t_1
real(8) :: t_2
real(8) :: tmp
t_0 = ((2.0d0 + (f * f)) + (x * 2.0d0)) ** (-0.5d0)
t_1 = ((f / sin(b)) * t_0) - (x / b)
t_2 = x / tan(b)
if (f <= (-1.5d-14)) then
tmp = ((-1.0d0) / sin(b)) - t_2
else if (f <= (-5.2d-122)) then
tmp = t_1
else if (f <= 1.45d-90) then
tmp = ((f * sqrt(0.5d0)) / b) - t_2
else if (f <= 4.4d-55) then
tmp = t_1
else if (f <= 13000.0d0) then
tmp = ((-1.0d0) / (tan(b) / x)) + (t_0 * (f / b))
else
tmp = (1.0d0 / sin(b)) - t_2
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = Math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5);
double t_1 = ((F / Math.sin(B)) * t_0) - (x / B);
double t_2 = x / Math.tan(B);
double tmp;
if (F <= -1.5e-14) {
tmp = (-1.0 / Math.sin(B)) - t_2;
} else if (F <= -5.2e-122) {
tmp = t_1;
} else if (F <= 1.45e-90) {
tmp = ((F * Math.sqrt(0.5)) / B) - t_2;
} else if (F <= 4.4e-55) {
tmp = t_1;
} else if (F <= 13000.0) {
tmp = (-1.0 / (Math.tan(B) / x)) + (t_0 * (F / B));
} else {
tmp = (1.0 / Math.sin(B)) - t_2;
}
return tmp;
}
def code(F, B, x): t_0 = math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5) t_1 = ((F / math.sin(B)) * t_0) - (x / B) t_2 = x / math.tan(B) tmp = 0 if F <= -1.5e-14: tmp = (-1.0 / math.sin(B)) - t_2 elif F <= -5.2e-122: tmp = t_1 elif F <= 1.45e-90: tmp = ((F * math.sqrt(0.5)) / B) - t_2 elif F <= 4.4e-55: tmp = t_1 elif F <= 13000.0: tmp = (-1.0 / (math.tan(B) / x)) + (t_0 * (F / B)) else: tmp = (1.0 / math.sin(B)) - t_2 return tmp
function code(F, B, x) t_0 = Float64(Float64(2.0 + Float64(F * F)) + Float64(x * 2.0)) ^ -0.5 t_1 = Float64(Float64(Float64(F / sin(B)) * t_0) - Float64(x / B)) t_2 = Float64(x / tan(B)) tmp = 0.0 if (F <= -1.5e-14) tmp = Float64(Float64(-1.0 / sin(B)) - t_2); elseif (F <= -5.2e-122) tmp = t_1; elseif (F <= 1.45e-90) tmp = Float64(Float64(Float64(F * sqrt(0.5)) / B) - t_2); elseif (F <= 4.4e-55) tmp = t_1; elseif (F <= 13000.0) tmp = Float64(Float64(-1.0 / Float64(tan(B) / x)) + Float64(t_0 * Float64(F / B))); else tmp = Float64(Float64(1.0 / sin(B)) - t_2); end return tmp end
function tmp_2 = code(F, B, x) t_0 = ((2.0 + (F * F)) + (x * 2.0)) ^ -0.5; t_1 = ((F / sin(B)) * t_0) - (x / B); t_2 = x / tan(B); tmp = 0.0; if (F <= -1.5e-14) tmp = (-1.0 / sin(B)) - t_2; elseif (F <= -5.2e-122) tmp = t_1; elseif (F <= 1.45e-90) tmp = ((F * sqrt(0.5)) / B) - t_2; elseif (F <= 4.4e-55) tmp = t_1; elseif (F <= 13000.0) tmp = (-1.0 / (tan(B) / x)) + (t_0 * (F / B)); else tmp = (1.0 / sin(B)) - t_2; end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[Power[N[(N[(2.0 + N[(F * F), $MachinePrecision]), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -1.5e-14], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$2), $MachinePrecision], If[LessEqual[F, -5.2e-122], t$95$1, If[LessEqual[F, 1.45e-90], N[(N[(N[(F * N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision] - t$95$2), $MachinePrecision], If[LessEqual[F, 4.4e-55], t$95$1, If[LessEqual[F, 13000.0], N[(N[(-1.0 / N[(N[Tan[B], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] + N[(t$95$0 * N[(F / B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$2), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\left(\left(2 + F \cdot F\right) + x \cdot 2\right)}^{-0.5}\\
t_1 := \frac{F}{\sin B} \cdot t_0 - \frac{x}{B}\\
t_2 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -1.5 \cdot 10^{-14}:\\
\;\;\;\;\frac{-1}{\sin B} - t_2\\
\mathbf{elif}\;F \leq -5.2 \cdot 10^{-122}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;F \leq 1.45 \cdot 10^{-90}:\\
\;\;\;\;\frac{F \cdot \sqrt{0.5}}{B} - t_2\\
\mathbf{elif}\;F \leq 4.4 \cdot 10^{-55}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;F \leq 13000:\\
\;\;\;\;\frac{-1}{\frac{\tan B}{x}} + t_0 \cdot \frac{F}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t_2\\
\end{array}
\end{array}
if F < -1.4999999999999999e-14Initial program 73.0%
distribute-lft-neg-in73.0%
+-commutative73.0%
cancel-sign-sub-inv73.0%
Simplified84.7%
Taylor expanded in x around 0 84.6%
associate-*l/84.7%
*-lft-identity84.7%
+-commutative84.7%
unpow284.7%
fma-udef84.7%
Simplified84.7%
Taylor expanded in F around -inf 97.4%
if -1.4999999999999999e-14 < F < -5.1999999999999995e-122 or 1.44999999999999992e-90 < F < 4.3999999999999999e-55Initial program 99.2%
Taylor expanded in B around 0 86.4%
if -5.1999999999999995e-122 < F < 1.44999999999999992e-90Initial program 99.4%
distribute-lft-neg-in99.4%
+-commutative99.4%
cancel-sign-sub-inv99.4%
Simplified99.7%
Taylor expanded in x around 0 99.7%
associate-*l/99.7%
*-lft-identity99.7%
+-commutative99.7%
unpow299.7%
fma-udef99.7%
Simplified99.7%
Taylor expanded in B around 0 93.1%
associate-*l/93.1%
*-lft-identity93.1%
+-commutative93.1%
unpow293.1%
fma-udef93.1%
Simplified93.1%
Taylor expanded in F around 0 93.2%
if 4.3999999999999999e-55 < F < 13000Initial program 99.1%
div-inv99.1%
clear-num99.1%
Applied egg-rr99.1%
Taylor expanded in B around 0 81.6%
if 13000 < F Initial program 57.3%
distribute-lft-neg-in57.3%
+-commutative57.3%
cancel-sign-sub-inv57.3%
Simplified72.2%
Taylor expanded in x around 0 72.2%
associate-*l/72.2%
*-lft-identity72.2%
+-commutative72.2%
unpow272.2%
fma-udef72.2%
Simplified72.2%
Taylor expanded in F around inf 99.7%
Final simplification94.7%
(FPCore (F B x)
:precision binary64
(let* ((t_0
(-
(* (/ F (sin B)) (pow (+ (+ 2.0 (* F F)) (* x 2.0)) -0.5))
(/ x B)))
(t_1 (/ x (tan B))))
(if (<= F -1.5e-14)
(- (/ -1.0 (sin B)) t_1)
(if (<= F -4.8e-122)
t_0
(if (<= F 5.7e-92)
(- (/ (* F (sqrt 0.5)) B) t_1)
(if (<= F 63000.0) t_0 (- (/ 1.0 (sin B)) t_1)))))))
double code(double F, double B, double x) {
double t_0 = ((F / sin(B)) * pow(((2.0 + (F * F)) + (x * 2.0)), -0.5)) - (x / B);
double t_1 = x / tan(B);
double tmp;
if (F <= -1.5e-14) {
tmp = (-1.0 / sin(B)) - t_1;
} else if (F <= -4.8e-122) {
tmp = t_0;
} else if (F <= 5.7e-92) {
tmp = ((F * sqrt(0.5)) / B) - t_1;
} else if (F <= 63000.0) {
tmp = t_0;
} else {
tmp = (1.0 / sin(B)) - t_1;
}
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) :: t_1
real(8) :: tmp
t_0 = ((f / sin(b)) * (((2.0d0 + (f * f)) + (x * 2.0d0)) ** (-0.5d0))) - (x / b)
t_1 = x / tan(b)
if (f <= (-1.5d-14)) then
tmp = ((-1.0d0) / sin(b)) - t_1
else if (f <= (-4.8d-122)) then
tmp = t_0
else if (f <= 5.7d-92) then
tmp = ((f * sqrt(0.5d0)) / b) - t_1
else if (f <= 63000.0d0) then
tmp = t_0
else
tmp = (1.0d0 / sin(b)) - t_1
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = ((F / Math.sin(B)) * Math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5)) - (x / B);
double t_1 = x / Math.tan(B);
double tmp;
if (F <= -1.5e-14) {
tmp = (-1.0 / Math.sin(B)) - t_1;
} else if (F <= -4.8e-122) {
tmp = t_0;
} else if (F <= 5.7e-92) {
tmp = ((F * Math.sqrt(0.5)) / B) - t_1;
} else if (F <= 63000.0) {
tmp = t_0;
} else {
tmp = (1.0 / Math.sin(B)) - t_1;
}
return tmp;
}
def code(F, B, x): t_0 = ((F / math.sin(B)) * math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5)) - (x / B) t_1 = x / math.tan(B) tmp = 0 if F <= -1.5e-14: tmp = (-1.0 / math.sin(B)) - t_1 elif F <= -4.8e-122: tmp = t_0 elif F <= 5.7e-92: tmp = ((F * math.sqrt(0.5)) / B) - t_1 elif F <= 63000.0: tmp = t_0 else: tmp = (1.0 / math.sin(B)) - t_1 return tmp
function code(F, B, x) t_0 = Float64(Float64(Float64(F / sin(B)) * (Float64(Float64(2.0 + Float64(F * F)) + Float64(x * 2.0)) ^ -0.5)) - Float64(x / B)) t_1 = Float64(x / tan(B)) tmp = 0.0 if (F <= -1.5e-14) tmp = Float64(Float64(-1.0 / sin(B)) - t_1); elseif (F <= -4.8e-122) tmp = t_0; elseif (F <= 5.7e-92) tmp = Float64(Float64(Float64(F * sqrt(0.5)) / B) - t_1); elseif (F <= 63000.0) tmp = t_0; else tmp = Float64(Float64(1.0 / sin(B)) - t_1); end return tmp end
function tmp_2 = code(F, B, x) t_0 = ((F / sin(B)) * (((2.0 + (F * F)) + (x * 2.0)) ^ -0.5)) - (x / B); t_1 = x / tan(B); tmp = 0.0; if (F <= -1.5e-14) tmp = (-1.0 / sin(B)) - t_1; elseif (F <= -4.8e-122) tmp = t_0; elseif (F <= 5.7e-92) tmp = ((F * sqrt(0.5)) / B) - t_1; elseif (F <= 63000.0) tmp = t_0; else tmp = (1.0 / sin(B)) - t_1; end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = 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]}, Block[{t$95$1 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -1.5e-14], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[F, -4.8e-122], t$95$0, If[LessEqual[F, 5.7e-92], N[(N[(N[(F * N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[F, 63000.0], t$95$0, N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{F}{\sin B} \cdot {\left(\left(2 + F \cdot F\right) + x \cdot 2\right)}^{-0.5} - \frac{x}{B}\\
t_1 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -1.5 \cdot 10^{-14}:\\
\;\;\;\;\frac{-1}{\sin B} - t_1\\
\mathbf{elif}\;F \leq -4.8 \cdot 10^{-122}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;F \leq 5.7 \cdot 10^{-92}:\\
\;\;\;\;\frac{F \cdot \sqrt{0.5}}{B} - t_1\\
\mathbf{elif}\;F \leq 63000:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t_1\\
\end{array}
\end{array}
if F < -1.4999999999999999e-14Initial program 73.0%
distribute-lft-neg-in73.0%
+-commutative73.0%
cancel-sign-sub-inv73.0%
Simplified84.7%
Taylor expanded in x around 0 84.6%
associate-*l/84.7%
*-lft-identity84.7%
+-commutative84.7%
unpow284.7%
fma-udef84.7%
Simplified84.7%
Taylor expanded in F around -inf 97.4%
if -1.4999999999999999e-14 < F < -4.79999999999999975e-122 or 5.70000000000000009e-92 < F < 63000Initial program 99.2%
Taylor expanded in B around 0 82.7%
if -4.79999999999999975e-122 < F < 5.70000000000000009e-92Initial program 99.4%
distribute-lft-neg-in99.4%
+-commutative99.4%
cancel-sign-sub-inv99.4%
Simplified99.7%
Taylor expanded in x around 0 99.7%
associate-*l/99.7%
*-lft-identity99.7%
+-commutative99.7%
unpow299.7%
fma-udef99.7%
Simplified99.7%
Taylor expanded in B around 0 93.1%
associate-*l/93.1%
*-lft-identity93.1%
+-commutative93.1%
unpow293.1%
fma-udef93.1%
Simplified93.1%
Taylor expanded in F around 0 93.2%
if 63000 < F Initial program 57.3%
distribute-lft-neg-in57.3%
+-commutative57.3%
cancel-sign-sub-inv57.3%
Simplified72.2%
Taylor expanded in x around 0 72.2%
associate-*l/72.2%
*-lft-identity72.2%
+-commutative72.2%
unpow272.2%
fma-udef72.2%
Simplified72.2%
Taylor expanded in F around inf 99.7%
Final simplification94.4%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -2.05e-29)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 0.39)
(- (* F (/ (sqrt (+ 0.5 (* (* F F) -0.25))) B)) 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 <= -2.05e-29) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 0.39) {
tmp = (F * (sqrt((0.5 + ((F * F) * -0.25))) / B)) - t_0;
} 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 <= (-2.05d-29)) then
tmp = ((-1.0d0) / sin(b)) - t_0
else if (f <= 0.39d0) then
tmp = (f * (sqrt((0.5d0 + ((f * f) * (-0.25d0)))) / b)) - t_0
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 <= -2.05e-29) {
tmp = (-1.0 / Math.sin(B)) - t_0;
} else if (F <= 0.39) {
tmp = (F * (Math.sqrt((0.5 + ((F * F) * -0.25))) / B)) - t_0;
} 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 <= -2.05e-29: tmp = (-1.0 / math.sin(B)) - t_0 elif F <= 0.39: tmp = (F * (math.sqrt((0.5 + ((F * F) * -0.25))) / B)) - t_0 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 <= -2.05e-29) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 0.39) tmp = Float64(Float64(F * Float64(sqrt(Float64(0.5 + Float64(Float64(F * F) * -0.25))) / B)) - t_0); 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 <= -2.05e-29) tmp = (-1.0 / sin(B)) - t_0; elseif (F <= 0.39) tmp = (F * (sqrt((0.5 + ((F * F) * -0.25))) / B)) - t_0; 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, -2.05e-29], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 0.39], N[(N[(F * N[(N[Sqrt[N[(0.5 + N[(N[(F * F), $MachinePrecision] * -0.25), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / B), $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 -2.05 \cdot 10^{-29}:\\
\;\;\;\;\frac{-1}{\sin B} - t_0\\
\mathbf{elif}\;F \leq 0.39:\\
\;\;\;\;F \cdot \frac{\sqrt{0.5 + \left(F \cdot F\right) \cdot -0.25}}{B} - t_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t_0\\
\end{array}
\end{array}
if F < -2.0499999999999999e-29Initial program 74.8%
distribute-lft-neg-in74.8%
+-commutative74.8%
cancel-sign-sub-inv74.8%
Simplified85.7%
Taylor expanded in x around 0 85.6%
associate-*l/85.7%
*-lft-identity85.7%
+-commutative85.7%
unpow285.7%
fma-udef85.7%
Simplified85.7%
Taylor expanded in F around -inf 91.1%
if -2.0499999999999999e-29 < F < 0.39000000000000001Initial program 99.3%
distribute-lft-neg-in99.3%
+-commutative99.3%
cancel-sign-sub-inv99.3%
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 B around 0 84.8%
associate-*l/84.8%
*-lft-identity84.8%
+-commutative84.8%
unpow284.8%
fma-udef84.8%
Simplified84.8%
Taylor expanded in F around 0 84.6%
*-commutative84.6%
unpow284.6%
Simplified84.6%
if 0.39000000000000001 < F Initial program 57.8%
distribute-lft-neg-in57.8%
+-commutative57.8%
cancel-sign-sub-inv57.8%
Simplified72.5%
Taylor expanded in x around 0 72.6%
associate-*l/72.5%
*-lft-identity72.5%
+-commutative72.5%
unpow272.5%
fma-udef72.5%
Simplified72.5%
Taylor expanded in F around inf 99.2%
Final simplification90.5%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -2.05e-29)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 0.07) (- (* F (/ (sqrt 0.5) B)) 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 <= -2.05e-29) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 0.07) {
tmp = (F * (sqrt(0.5) / B)) - t_0;
} 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 <= (-2.05d-29)) then
tmp = ((-1.0d0) / sin(b)) - t_0
else if (f <= 0.07d0) then
tmp = (f * (sqrt(0.5d0) / b)) - t_0
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 <= -2.05e-29) {
tmp = (-1.0 / Math.sin(B)) - t_0;
} else if (F <= 0.07) {
tmp = (F * (Math.sqrt(0.5) / B)) - t_0;
} 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 <= -2.05e-29: tmp = (-1.0 / math.sin(B)) - t_0 elif F <= 0.07: tmp = (F * (math.sqrt(0.5) / B)) - t_0 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 <= -2.05e-29) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 0.07) tmp = Float64(Float64(F * Float64(sqrt(0.5) / B)) - t_0); 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 <= -2.05e-29) tmp = (-1.0 / sin(B)) - t_0; elseif (F <= 0.07) tmp = (F * (sqrt(0.5) / B)) - t_0; 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, -2.05e-29], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 0.07], N[(N[(F * N[(N[Sqrt[0.5], $MachinePrecision] / B), $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 -2.05 \cdot 10^{-29}:\\
\;\;\;\;\frac{-1}{\sin B} - t_0\\
\mathbf{elif}\;F \leq 0.07:\\
\;\;\;\;F \cdot \frac{\sqrt{0.5}}{B} - t_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t_0\\
\end{array}
\end{array}
if F < -2.0499999999999999e-29Initial program 74.8%
distribute-lft-neg-in74.8%
+-commutative74.8%
cancel-sign-sub-inv74.8%
Simplified85.7%
Taylor expanded in x around 0 85.6%
associate-*l/85.7%
*-lft-identity85.7%
+-commutative85.7%
unpow285.7%
fma-udef85.7%
Simplified85.7%
Taylor expanded in F around -inf 91.1%
if -2.0499999999999999e-29 < F < 0.070000000000000007Initial program 99.3%
distribute-lft-neg-in99.3%
+-commutative99.3%
cancel-sign-sub-inv99.3%
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 B around 0 84.8%
associate-*l/84.8%
*-lft-identity84.8%
+-commutative84.8%
unpow284.8%
fma-udef84.8%
Simplified84.8%
Taylor expanded in F around 0 84.4%
if 0.070000000000000007 < F Initial program 57.8%
distribute-lft-neg-in57.8%
+-commutative57.8%
cancel-sign-sub-inv57.8%
Simplified72.5%
Taylor expanded in x around 0 72.6%
associate-*l/72.5%
*-lft-identity72.5%
+-commutative72.5%
unpow272.5%
fma-udef72.5%
Simplified72.5%
Taylor expanded in F around inf 99.2%
Final simplification90.4%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -9.6e-87)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 1.08e-19)
(- (/ (* (cos B) x) (sin 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 <= -9.6e-87) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 1.08e-19) {
tmp = -((cos(B) * x) / sin(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 <= (-9.6d-87)) then
tmp = ((-1.0d0) / sin(b)) - t_0
else if (f <= 1.08d-19) then
tmp = -((cos(b) * x) / sin(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 <= -9.6e-87) {
tmp = (-1.0 / Math.sin(B)) - t_0;
} else if (F <= 1.08e-19) {
tmp = -((Math.cos(B) * x) / Math.sin(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 <= -9.6e-87: tmp = (-1.0 / math.sin(B)) - t_0 elif F <= 1.08e-19: tmp = -((math.cos(B) * x) / math.sin(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 <= -9.6e-87) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 1.08e-19) tmp = Float64(-Float64(Float64(cos(B) * x) / sin(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 <= -9.6e-87) tmp = (-1.0 / sin(B)) - t_0; elseif (F <= 1.08e-19) tmp = -((cos(B) * x) / sin(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, -9.6e-87], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 1.08e-19], (-N[(N[(N[Cos[B], $MachinePrecision] * x), $MachinePrecision] / N[Sin[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 -9.6 \cdot 10^{-87}:\\
\;\;\;\;\frac{-1}{\sin B} - t_0\\
\mathbf{elif}\;F \leq 1.08 \cdot 10^{-19}:\\
\;\;\;\;-\frac{\cos B \cdot x}{\sin B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t_0\\
\end{array}
\end{array}
if F < -9.5999999999999998e-87Initial program 77.6%
distribute-lft-neg-in77.6%
+-commutative77.6%
cancel-sign-sub-inv77.6%
Simplified87.3%
Taylor expanded in x around 0 87.2%
associate-*l/87.3%
*-lft-identity87.3%
+-commutative87.3%
unpow287.3%
fma-udef87.3%
Simplified87.3%
Taylor expanded in F around -inf 86.2%
if -9.5999999999999998e-87 < F < 1.08e-19Initial program 99.4%
Taylor expanded in F around -inf 33.3%
Taylor expanded in x around inf 72.5%
mul-1-neg72.5%
Simplified72.5%
if 1.08e-19 < F Initial program 59.8%
distribute-lft-neg-in59.8%
+-commutative59.8%
cancel-sign-sub-inv59.8%
Simplified73.8%
Taylor expanded in x around 0 73.9%
associate-*l/73.8%
*-lft-identity73.8%
+-commutative73.8%
unpow273.8%
fma-udef73.8%
Simplified73.8%
Taylor expanded in F around inf 96.1%
Final simplification83.5%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))) (t_1 (/ 1.0 (* B (* F F)))))
(if (<= F -1.7e-25)
(- (+ t_1 (/ -1.0 B)) t_0)
(if (<= F 1.0) (- (/ (* (cos B) x) (sin B))) (- (- (/ 1.0 B) t_1) t_0)))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double t_1 = 1.0 / (B * (F * F));
double tmp;
if (F <= -1.7e-25) {
tmp = (t_1 + (-1.0 / B)) - t_0;
} else if (F <= 1.0) {
tmp = -((cos(B) * x) / sin(B));
} else {
tmp = ((1.0 / B) - t_1) - 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) :: t_1
real(8) :: tmp
t_0 = x / tan(b)
t_1 = 1.0d0 / (b * (f * f))
if (f <= (-1.7d-25)) then
tmp = (t_1 + ((-1.0d0) / b)) - t_0
else if (f <= 1.0d0) then
tmp = -((cos(b) * x) / sin(b))
else
tmp = ((1.0d0 / b) - t_1) - 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 t_1 = 1.0 / (B * (F * F));
double tmp;
if (F <= -1.7e-25) {
tmp = (t_1 + (-1.0 / B)) - t_0;
} else if (F <= 1.0) {
tmp = -((Math.cos(B) * x) / Math.sin(B));
} else {
tmp = ((1.0 / B) - t_1) - t_0;
}
return tmp;
}
def code(F, B, x): t_0 = x / math.tan(B) t_1 = 1.0 / (B * (F * F)) tmp = 0 if F <= -1.7e-25: tmp = (t_1 + (-1.0 / B)) - t_0 elif F <= 1.0: tmp = -((math.cos(B) * x) / math.sin(B)) else: tmp = ((1.0 / B) - t_1) - t_0 return tmp
function code(F, B, x) t_0 = Float64(x / tan(B)) t_1 = Float64(1.0 / Float64(B * Float64(F * F))) tmp = 0.0 if (F <= -1.7e-25) tmp = Float64(Float64(t_1 + Float64(-1.0 / B)) - t_0); elseif (F <= 1.0) tmp = Float64(-Float64(Float64(cos(B) * x) / sin(B))); else tmp = Float64(Float64(Float64(1.0 / B) - t_1) - t_0); end return tmp end
function tmp_2 = code(F, B, x) t_0 = x / tan(B); t_1 = 1.0 / (B * (F * F)); tmp = 0.0; if (F <= -1.7e-25) tmp = (t_1 + (-1.0 / B)) - t_0; elseif (F <= 1.0) tmp = -((cos(B) * x) / sin(B)); else tmp = ((1.0 / B) - t_1) - t_0; end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(1.0 / N[(B * N[(F * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -1.7e-25], N[(N[(t$95$1 + N[(-1.0 / B), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 1.0], (-N[(N[(N[Cos[B], $MachinePrecision] * x), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), N[(N[(N[(1.0 / B), $MachinePrecision] - t$95$1), $MachinePrecision] - t$95$0), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
t_1 := \frac{1}{B \cdot \left(F \cdot F\right)}\\
\mathbf{if}\;F \leq -1.7 \cdot 10^{-25}:\\
\;\;\;\;\left(t_1 + \frac{-1}{B}\right) - t_0\\
\mathbf{elif}\;F \leq 1:\\
\;\;\;\;-\frac{\cos B \cdot x}{\sin B}\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{1}{B} - t_1\right) - t_0\\
\end{array}
\end{array}
if F < -1.70000000000000001e-25Initial program 74.4%
distribute-lft-neg-in74.4%
+-commutative74.4%
cancel-sign-sub-inv74.4%
Simplified85.5%
Taylor expanded in x around 0 85.4%
associate-*l/85.4%
*-lft-identity85.4%
+-commutative85.4%
unpow285.4%
fma-udef85.4%
Simplified85.4%
Taylor expanded in B around 0 67.9%
associate-*l/67.9%
*-lft-identity67.9%
+-commutative67.9%
unpow267.9%
fma-udef67.9%
Simplified67.9%
Taylor expanded in F around -inf 76.5%
unpow276.5%
Simplified76.5%
if -1.70000000000000001e-25 < F < 1Initial program 99.3%
Taylor expanded in F around -inf 33.6%
Taylor expanded in x around inf 68.9%
mul-1-neg68.9%
Simplified68.9%
if 1 < F Initial program 57.8%
distribute-lft-neg-in57.8%
+-commutative57.8%
cancel-sign-sub-inv57.8%
Simplified72.5%
Taylor expanded in x around 0 72.6%
associate-*l/72.5%
*-lft-identity72.5%
+-commutative72.5%
unpow272.5%
fma-udef72.5%
Simplified72.5%
Taylor expanded in B around 0 58.6%
associate-*l/58.6%
*-lft-identity58.6%
+-commutative58.6%
unpow258.6%
fma-udef58.6%
Simplified58.6%
Taylor expanded in F around inf 73.7%
unpow273.7%
Simplified73.7%
Final simplification72.0%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))) (t_1 (/ 1.0 (* B (* F F)))))
(if (<= F -2.5e-24)
(- (+ t_1 (/ -1.0 B)) t_0)
(if (<= F 1.0) (/ (- x) (/ (sin B) (cos B))) (- (- (/ 1.0 B) t_1) t_0)))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double t_1 = 1.0 / (B * (F * F));
double tmp;
if (F <= -2.5e-24) {
tmp = (t_1 + (-1.0 / B)) - t_0;
} else if (F <= 1.0) {
tmp = -x / (sin(B) / cos(B));
} else {
tmp = ((1.0 / B) - t_1) - 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) :: t_1
real(8) :: tmp
t_0 = x / tan(b)
t_1 = 1.0d0 / (b * (f * f))
if (f <= (-2.5d-24)) then
tmp = (t_1 + ((-1.0d0) / b)) - t_0
else if (f <= 1.0d0) then
tmp = -x / (sin(b) / cos(b))
else
tmp = ((1.0d0 / b) - t_1) - 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 t_1 = 1.0 / (B * (F * F));
double tmp;
if (F <= -2.5e-24) {
tmp = (t_1 + (-1.0 / B)) - t_0;
} else if (F <= 1.0) {
tmp = -x / (Math.sin(B) / Math.cos(B));
} else {
tmp = ((1.0 / B) - t_1) - t_0;
}
return tmp;
}
def code(F, B, x): t_0 = x / math.tan(B) t_1 = 1.0 / (B * (F * F)) tmp = 0 if F <= -2.5e-24: tmp = (t_1 + (-1.0 / B)) - t_0 elif F <= 1.0: tmp = -x / (math.sin(B) / math.cos(B)) else: tmp = ((1.0 / B) - t_1) - t_0 return tmp
function code(F, B, x) t_0 = Float64(x / tan(B)) t_1 = Float64(1.0 / Float64(B * Float64(F * F))) tmp = 0.0 if (F <= -2.5e-24) tmp = Float64(Float64(t_1 + Float64(-1.0 / B)) - t_0); elseif (F <= 1.0) tmp = Float64(Float64(-x) / Float64(sin(B) / cos(B))); else tmp = Float64(Float64(Float64(1.0 / B) - t_1) - t_0); end return tmp end
function tmp_2 = code(F, B, x) t_0 = x / tan(B); t_1 = 1.0 / (B * (F * F)); tmp = 0.0; if (F <= -2.5e-24) tmp = (t_1 + (-1.0 / B)) - t_0; elseif (F <= 1.0) tmp = -x / (sin(B) / cos(B)); else tmp = ((1.0 / B) - t_1) - t_0; end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(1.0 / N[(B * N[(F * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -2.5e-24], N[(N[(t$95$1 + N[(-1.0 / B), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 1.0], N[((-x) / N[(N[Sin[B], $MachinePrecision] / N[Cos[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 / B), $MachinePrecision] - t$95$1), $MachinePrecision] - t$95$0), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
t_1 := \frac{1}{B \cdot \left(F \cdot F\right)}\\
\mathbf{if}\;F \leq -2.5 \cdot 10^{-24}:\\
\;\;\;\;\left(t_1 + \frac{-1}{B}\right) - t_0\\
\mathbf{elif}\;F \leq 1:\\
\;\;\;\;\frac{-x}{\frac{\sin B}{\cos B}}\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{1}{B} - t_1\right) - t_0\\
\end{array}
\end{array}
if F < -2.4999999999999999e-24Initial program 74.4%
distribute-lft-neg-in74.4%
+-commutative74.4%
cancel-sign-sub-inv74.4%
Simplified85.5%
Taylor expanded in x around 0 85.4%
associate-*l/85.4%
*-lft-identity85.4%
+-commutative85.4%
unpow285.4%
fma-udef85.4%
Simplified85.4%
Taylor expanded in B around 0 67.9%
associate-*l/67.9%
*-lft-identity67.9%
+-commutative67.9%
unpow267.9%
fma-udef67.9%
Simplified67.9%
Taylor expanded in F around -inf 76.5%
unpow276.5%
Simplified76.5%
if -2.4999999999999999e-24 < F < 1Initial program 99.3%
Taylor expanded in F around -inf 33.6%
Taylor expanded in x around inf 68.9%
mul-1-neg68.9%
associate-/l*68.9%
distribute-neg-frac68.9%
Simplified68.9%
if 1 < F Initial program 57.8%
distribute-lft-neg-in57.8%
+-commutative57.8%
cancel-sign-sub-inv57.8%
Simplified72.5%
Taylor expanded in x around 0 72.6%
associate-*l/72.5%
*-lft-identity72.5%
+-commutative72.5%
unpow272.5%
fma-udef72.5%
Simplified72.5%
Taylor expanded in B around 0 58.6%
associate-*l/58.6%
*-lft-identity58.6%
+-commutative58.6%
unpow258.6%
fma-udef58.6%
Simplified58.6%
Taylor expanded in F around inf 73.7%
unpow273.7%
Simplified73.7%
Final simplification72.0%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -9.6e-87)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 0.95)
(- (/ (* (cos B) x) (sin B)))
(- (- (/ 1.0 B) (/ 1.0 (* B (* F F)))) t_0)))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -9.6e-87) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 0.95) {
tmp = -((cos(B) * x) / sin(B));
} else {
tmp = ((1.0 / B) - (1.0 / (B * (F * F)))) - 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 <= (-9.6d-87)) then
tmp = ((-1.0d0) / sin(b)) - t_0
else if (f <= 0.95d0) then
tmp = -((cos(b) * x) / sin(b))
else
tmp = ((1.0d0 / b) - (1.0d0 / (b * (f * f)))) - 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 <= -9.6e-87) {
tmp = (-1.0 / Math.sin(B)) - t_0;
} else if (F <= 0.95) {
tmp = -((Math.cos(B) * x) / Math.sin(B));
} else {
tmp = ((1.0 / B) - (1.0 / (B * (F * F)))) - t_0;
}
return tmp;
}
def code(F, B, x): t_0 = x / math.tan(B) tmp = 0 if F <= -9.6e-87: tmp = (-1.0 / math.sin(B)) - t_0 elif F <= 0.95: tmp = -((math.cos(B) * x) / math.sin(B)) else: tmp = ((1.0 / B) - (1.0 / (B * (F * F)))) - t_0 return tmp
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -9.6e-87) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 0.95) tmp = Float64(-Float64(Float64(cos(B) * x) / sin(B))); else tmp = Float64(Float64(Float64(1.0 / B) - Float64(1.0 / Float64(B * Float64(F * F)))) - t_0); end return tmp end
function tmp_2 = code(F, B, x) t_0 = x / tan(B); tmp = 0.0; if (F <= -9.6e-87) tmp = (-1.0 / sin(B)) - t_0; elseif (F <= 0.95) tmp = -((cos(B) * x) / sin(B)); else tmp = ((1.0 / B) - (1.0 / (B * (F * F)))) - 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, -9.6e-87], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 0.95], (-N[(N[(N[Cos[B], $MachinePrecision] * x), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), N[(N[(N[(1.0 / B), $MachinePrecision] - N[(1.0 / N[(B * N[(F * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -9.6 \cdot 10^{-87}:\\
\;\;\;\;\frac{-1}{\sin B} - t_0\\
\mathbf{elif}\;F \leq 0.95:\\
\;\;\;\;-\frac{\cos B \cdot x}{\sin B}\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{1}{B} - \frac{1}{B \cdot \left(F \cdot F\right)}\right) - t_0\\
\end{array}
\end{array}
if F < -9.5999999999999998e-87Initial program 77.6%
distribute-lft-neg-in77.6%
+-commutative77.6%
cancel-sign-sub-inv77.6%
Simplified87.3%
Taylor expanded in x around 0 87.2%
associate-*l/87.3%
*-lft-identity87.3%
+-commutative87.3%
unpow287.3%
fma-udef87.3%
Simplified87.3%
Taylor expanded in F around -inf 86.2%
if -9.5999999999999998e-87 < F < 0.94999999999999996Initial program 99.3%
Taylor expanded in F around -inf 33.0%
Taylor expanded in x around inf 70.9%
mul-1-neg70.9%
Simplified70.9%
if 0.94999999999999996 < F Initial program 57.8%
distribute-lft-neg-in57.8%
+-commutative57.8%
cancel-sign-sub-inv57.8%
Simplified72.5%
Taylor expanded in x around 0 72.6%
associate-*l/72.5%
*-lft-identity72.5%
+-commutative72.5%
unpow272.5%
fma-udef72.5%
Simplified72.5%
Taylor expanded in B around 0 58.6%
associate-*l/58.6%
*-lft-identity58.6%
+-commutative58.6%
unpow258.6%
fma-udef58.6%
Simplified58.6%
Taylor expanded in F around inf 73.7%
unpow273.7%
Simplified73.7%
Final simplification75.5%
(FPCore (F B x) :precision binary64 (if (or (<= F -1.76e+221) (and (not (<= F -1.2e+118)) (<= F -0.0128))) (- (/ -1.0 (sin B)) (/ x B)) (- (/ 1.0 B) (/ x (tan B)))))
double code(double F, double B, double x) {
double tmp;
if ((F <= -1.76e+221) || (!(F <= -1.2e+118) && (F <= -0.0128))) {
tmp = (-1.0 / 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 <= (-1.76d+221)) .or. (.not. (f <= (-1.2d+118))) .and. (f <= (-0.0128d0))) then
tmp = ((-1.0d0) / 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 <= -1.76e+221) || (!(F <= -1.2e+118) && (F <= -0.0128))) {
tmp = (-1.0 / 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 <= -1.76e+221) or (not (F <= -1.2e+118) and (F <= -0.0128)): tmp = (-1.0 / 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 <= -1.76e+221) || (!(F <= -1.2e+118) && (F <= -0.0128))) tmp = Float64(Float64(-1.0 / 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 <= -1.76e+221) || (~((F <= -1.2e+118)) && (F <= -0.0128))) tmp = (-1.0 / sin(B)) - (x / B); else tmp = (1.0 / B) - (x / tan(B)); end tmp_2 = tmp; end
code[F_, B_, x_] := If[Or[LessEqual[F, -1.76e+221], And[N[Not[LessEqual[F, -1.2e+118]], $MachinePrecision], LessEqual[F, -0.0128]]], N[(N[(-1.0 / N[Sin[B], $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 -1.76 \cdot 10^{+221} \lor \neg \left(F \leq -1.2 \cdot 10^{+118}\right) \land F \leq -0.0128:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{B} - \frac{x}{\tan B}\\
\end{array}
\end{array}
if F < -1.75999999999999991e221 or -1.2e118 < F < -0.0128000000000000006Initial program 71.4%
Taylor expanded in F around -inf 96.3%
Taylor expanded in B around 0 85.7%
if -1.75999999999999991e221 < F < -1.2e118 or -0.0128000000000000006 < F Initial program 82.7%
distribute-lft-neg-in82.7%
+-commutative82.7%
cancel-sign-sub-inv82.7%
Simplified89.5%
Taylor expanded in B around 0 74.7%
*-commutative74.7%
fma-def74.7%
unpow274.7%
Simplified74.7%
Taylor expanded in F around inf 60.5%
Final simplification63.9%
(FPCore (F B x) :precision binary64 (if (<= F -7.8) (+ (/ (- -1.0 x) B) (* 0.3333333333333333 (* B x))) (- (/ 1.0 B) (/ x (tan B)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -7.8) {
tmp = ((-1.0 - x) / B) + (0.3333333333333333 * (B * x));
} 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 <= (-7.8d0)) then
tmp = (((-1.0d0) - x) / b) + (0.3333333333333333d0 * (b * x))
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 <= -7.8) {
tmp = ((-1.0 - x) / B) + (0.3333333333333333 * (B * x));
} else {
tmp = (1.0 / B) - (x / Math.tan(B));
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -7.8: tmp = ((-1.0 - x) / B) + (0.3333333333333333 * (B * x)) else: tmp = (1.0 / B) - (x / math.tan(B)) return tmp
function code(F, B, x) tmp = 0.0 if (F <= -7.8) tmp = Float64(Float64(Float64(-1.0 - x) / B) + Float64(0.3333333333333333 * Float64(B * x))); 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 <= -7.8) tmp = ((-1.0 - x) / B) + (0.3333333333333333 * (B * x)); else tmp = (1.0 / B) - (x / tan(B)); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -7.8], N[(N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision] + N[(0.3333333333333333 * N[(B * x), $MachinePrecision]), $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 -7.8:\\
\;\;\;\;\frac{-1 - x}{B} + 0.3333333333333333 \cdot \left(B \cdot x\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{B} - \frac{x}{\tan B}\\
\end{array}
\end{array}
if F < -7.79999999999999982Initial program 70.8%
Taylor expanded in F around -inf 81.2%
Taylor expanded in B around 0 62.5%
Taylor expanded in B around 0 54.9%
if -7.79999999999999982 < F Initial program 83.6%
distribute-lft-neg-in83.6%
+-commutative83.6%
cancel-sign-sub-inv83.6%
Simplified89.3%
Taylor expanded in B around 0 73.6%
*-commutative73.6%
fma-def73.6%
unpow273.6%
Simplified73.6%
Taylor expanded in F around inf 58.5%
Final simplification57.8%
(FPCore (F B x) :precision binary64 (let* ((t_0 (/ x (tan B)))) (if (<= F -9e-182) (- (/ -1.0 B) t_0) (- (/ 1.0 B) t_0))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -9e-182) {
tmp = (-1.0 / B) - t_0;
} 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 <= (-9d-182)) then
tmp = ((-1.0d0) / b) - t_0
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 <= -9e-182) {
tmp = (-1.0 / B) - t_0;
} else {
tmp = (1.0 / B) - t_0;
}
return tmp;
}
def code(F, B, x): t_0 = x / math.tan(B) tmp = 0 if F <= -9e-182: tmp = (-1.0 / B) - t_0 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 <= -9e-182) tmp = Float64(Float64(-1.0 / B) - t_0); 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 <= -9e-182) tmp = (-1.0 / B) - t_0; 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, -9e-182], N[(N[(-1.0 / B), $MachinePrecision] - t$95$0), $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 -9 \cdot 10^{-182}:\\
\;\;\;\;\frac{-1}{B} - t_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{B} - t_0\\
\end{array}
\end{array}
if F < -8.9999999999999998e-182Initial program 83.6%
Taylor expanded in F around -inf 72.6%
Taylor expanded in B around 0 65.7%
div-inv65.7%
expm1-log1p-u46.8%
expm1-udef44.0%
Applied egg-rr44.0%
expm1-def46.8%
expm1-log1p65.7%
Simplified65.7%
if -8.9999999999999998e-182 < F Initial program 79.9%
distribute-lft-neg-in79.9%
+-commutative79.9%
cancel-sign-sub-inv79.9%
Simplified86.9%
Taylor expanded in B around 0 73.8%
*-commutative73.8%
fma-def73.8%
unpow273.8%
Simplified73.8%
Taylor expanded in F around inf 60.7%
Final simplification62.4%
(FPCore (F B x) :precision binary64 (if (<= F -5.6e-120) (+ (/ (- -1.0 x) B) (* 0.3333333333333333 (* B x))) (/ x (- B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -5.6e-120) {
tmp = ((-1.0 - x) / B) + (0.3333333333333333 * (B * x));
} else {
tmp = 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-120)) then
tmp = (((-1.0d0) - x) / b) + (0.3333333333333333d0 * (b * x))
else
tmp = x / -b
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -5.6e-120) {
tmp = ((-1.0 - x) / B) + (0.3333333333333333 * (B * x));
} else {
tmp = x / -B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -5.6e-120: tmp = ((-1.0 - x) / B) + (0.3333333333333333 * (B * x)) else: tmp = x / -B return tmp
function code(F, B, x) tmp = 0.0 if (F <= -5.6e-120) tmp = Float64(Float64(Float64(-1.0 - x) / B) + Float64(0.3333333333333333 * Float64(B * x))); else tmp = Float64(x / Float64(-B)); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -5.6e-120) tmp = ((-1.0 - x) / B) + (0.3333333333333333 * (B * x)); else tmp = x / -B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -5.6e-120], N[(N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision] + N[(0.3333333333333333 * N[(B * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x / (-B)), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -5.6 \cdot 10^{-120}:\\
\;\;\;\;\frac{-1 - x}{B} + 0.3333333333333333 \cdot \left(B \cdot x\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{-B}\\
\end{array}
\end{array}
if F < -5.59999999999999988e-120Initial program 80.3%
Taylor expanded in F around -inf 69.4%
Taylor expanded in B around 0 59.1%
Taylor expanded in B around 0 45.0%
if -5.59999999999999988e-120 < F Initial program 81.5%
Taylor expanded in F around -inf 38.5%
Taylor expanded in B around 0 17.6%
associate-*r/17.6%
distribute-lft-in17.6%
metadata-eval17.6%
neg-mul-117.6%
Simplified17.6%
Taylor expanded in x around inf 26.5%
associate-*r/26.5%
associate-*l/26.4%
metadata-eval26.4%
associate-/r*26.4%
neg-mul-126.4%
associate-*l/26.5%
*-commutative26.5%
*-rgt-identity26.5%
Simplified26.5%
Final simplification31.7%
(FPCore (F B x) :precision binary64 (if (<= F -6.2e-164) (/ (- -1.0 x) B) (/ x (- B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -6.2e-164) {
tmp = (-1.0 - x) / B;
} else {
tmp = 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 <= (-6.2d-164)) then
tmp = ((-1.0d0) - x) / b
else
tmp = x / -b
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -6.2e-164) {
tmp = (-1.0 - x) / B;
} else {
tmp = x / -B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -6.2e-164: tmp = (-1.0 - x) / B else: tmp = x / -B return tmp
function code(F, B, x) tmp = 0.0 if (F <= -6.2e-164) tmp = Float64(Float64(-1.0 - x) / B); else tmp = Float64(x / Float64(-B)); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -6.2e-164) tmp = (-1.0 - x) / B; else tmp = x / -B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -6.2e-164], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], N[(x / (-B)), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -6.2 \cdot 10^{-164}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{-B}\\
\end{array}
\end{array}
if F < -6.2000000000000001e-164Initial program 82.2%
Taylor expanded in F around -inf 77.3%
Taylor expanded in B around 0 41.9%
associate-*r/41.9%
distribute-lft-in41.9%
metadata-eval41.9%
neg-mul-141.9%
Simplified41.9%
if -6.2000000000000001e-164 < F Initial program 80.7%
Taylor expanded in F around -inf 37.9%
Taylor expanded in B around 0 17.6%
associate-*r/17.6%
distribute-lft-in17.6%
metadata-eval17.6%
neg-mul-117.6%
Simplified17.6%
Taylor expanded in x around inf 27.0%
associate-*r/27.0%
associate-*l/26.9%
metadata-eval26.9%
associate-/r*26.9%
neg-mul-126.9%
associate-*l/27.0%
*-commutative27.0%
*-rgt-identity27.0%
Simplified27.0%
Final simplification31.7%
(FPCore (F B x) :precision binary64 (if (<= F -620.0) (/ -1.0 B) (/ x (- B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -620.0) {
tmp = -1.0 / B;
} else {
tmp = 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 <= (-620.0d0)) then
tmp = (-1.0d0) / b
else
tmp = x / -b
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -620.0) {
tmp = -1.0 / B;
} else {
tmp = x / -B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -620.0: tmp = -1.0 / B else: tmp = x / -B return tmp
function code(F, B, x) tmp = 0.0 if (F <= -620.0) tmp = Float64(-1.0 / B); else tmp = Float64(x / Float64(-B)); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -620.0) tmp = -1.0 / B; else tmp = x / -B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -620.0], N[(-1.0 / B), $MachinePrecision], N[(x / (-B)), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -620:\\
\;\;\;\;\frac{-1}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{-B}\\
\end{array}
\end{array}
if F < -620Initial program 69.5%
Taylor expanded in F around -inf 98.6%
Taylor expanded in B around 0 54.9%
associate-*r/54.9%
distribute-lft-in54.9%
metadata-eval54.9%
neg-mul-154.9%
Simplified54.9%
Taylor expanded in x around 0 36.2%
if -620 < F Initial program 83.7%
Taylor expanded in F around -inf 39.6%
Taylor expanded in B around 0 18.7%
associate-*r/18.7%
distribute-lft-in18.7%
metadata-eval18.7%
neg-mul-118.7%
Simplified18.7%
Taylor expanded in x around inf 26.4%
associate-*r/26.4%
associate-*l/26.3%
metadata-eval26.3%
associate-/r*26.3%
neg-mul-126.3%
associate-*l/26.4%
*-commutative26.4%
*-rgt-identity26.4%
Simplified26.4%
Final simplification28.2%
(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 81.2%
Taylor expanded in F around -inf 50.2%
Taylor expanded in B around 0 25.2%
associate-*r/25.2%
distribute-lft-in25.2%
metadata-eval25.2%
neg-mul-125.2%
Simplified25.2%
Taylor expanded in x around 0 9.4%
Final simplification9.4%
herbie shell --seed 2023271
(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))))))