
(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 31 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
(if (<= F -110000000.0)
(- (/ -1.0 (sin B)) (/ x (tan B)))
(if (<= F 17500000.0)
(-
(* (/ F (sin B)) (pow (+ (+ (* F F) 2.0) (* x 2.0)) -0.5))
(/ (* x (cos B)) (sin B)))
(- (/ 1.0 (sin B)) (* (cos B) (/ x (sin B)))))))
double code(double F, double B, double x) {
double tmp;
if (F <= -110000000.0) {
tmp = (-1.0 / sin(B)) - (x / tan(B));
} else if (F <= 17500000.0) {
tmp = ((F / sin(B)) * pow((((F * F) + 2.0) + (x * 2.0)), -0.5)) - ((x * cos(B)) / sin(B));
} else {
tmp = (1.0 / sin(B)) - (cos(B) * (x / sin(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 <= (-110000000.0d0)) then
tmp = ((-1.0d0) / sin(b)) - (x / tan(b))
else if (f <= 17500000.0d0) then
tmp = ((f / sin(b)) * ((((f * f) + 2.0d0) + (x * 2.0d0)) ** (-0.5d0))) - ((x * cos(b)) / sin(b))
else
tmp = (1.0d0 / sin(b)) - (cos(b) * (x / sin(b)))
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -110000000.0) {
tmp = (-1.0 / Math.sin(B)) - (x / Math.tan(B));
} else if (F <= 17500000.0) {
tmp = ((F / Math.sin(B)) * Math.pow((((F * F) + 2.0) + (x * 2.0)), -0.5)) - ((x * Math.cos(B)) / Math.sin(B));
} else {
tmp = (1.0 / Math.sin(B)) - (Math.cos(B) * (x / Math.sin(B)));
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -110000000.0: tmp = (-1.0 / math.sin(B)) - (x / math.tan(B)) elif F <= 17500000.0: tmp = ((F / math.sin(B)) * math.pow((((F * F) + 2.0) + (x * 2.0)), -0.5)) - ((x * math.cos(B)) / math.sin(B)) else: tmp = (1.0 / math.sin(B)) - (math.cos(B) * (x / math.sin(B))) return tmp
function code(F, B, x) tmp = 0.0 if (F <= -110000000.0) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / tan(B))); elseif (F <= 17500000.0) tmp = Float64(Float64(Float64(F / sin(B)) * (Float64(Float64(Float64(F * F) + 2.0) + Float64(x * 2.0)) ^ -0.5)) - Float64(Float64(x * cos(B)) / sin(B))); else tmp = Float64(Float64(1.0 / sin(B)) - Float64(cos(B) * Float64(x / sin(B)))); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -110000000.0) tmp = (-1.0 / sin(B)) - (x / tan(B)); elseif (F <= 17500000.0) tmp = ((F / sin(B)) * ((((F * F) + 2.0) + (x * 2.0)) ^ -0.5)) - ((x * cos(B)) / sin(B)); else tmp = (1.0 / sin(B)) - (cos(B) * (x / sin(B))); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -110000000.0], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 17500000.0], N[(N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Power[N[(N[(N[(F * F), $MachinePrecision] + 2.0), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision] - N[(N[(x * N[Cos[B], $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(N[Cos[B], $MachinePrecision] * N[(x / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -110000000:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\
\mathbf{elif}\;F \leq 17500000:\\
\;\;\;\;\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + x \cdot 2\right)}^{-0.5} - \frac{x \cdot \cos B}{\sin B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - \cos B \cdot \frac{x}{\sin B}\\
\end{array}
\end{array}
if F < -1.1e8Initial program 58.6%
Simplified74.3%
Taylor expanded in x around 0 74.4%
associate-*l/74.3%
*-lft-identity74.3%
+-commutative74.3%
unpow274.3%
fma-udef74.3%
Simplified74.3%
Taylor expanded in F around -inf 99.8%
if -1.1e8 < F < 1.75e7Initial program 99.5%
Taylor expanded in x around 0 99.7%
if 1.75e7 < F Initial program 58.2%
Simplified74.7%
Taylor expanded in F around inf 99.6%
associate-/r*99.6%
Simplified99.6%
Taylor expanded in F around 0 99.8%
*-commutative99.8%
associate-*r/99.9%
Simplified99.9%
Final simplification99.7%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (* (cos B) (/ x (sin B)))))
(if (<= F -118000000.0)
(- (/ -1.0 (sin B)) (/ x (tan B)))
(if (<= F 35000000.0)
(- (* (/ F (sin B)) (pow (+ (+ (* F F) 2.0) (* x 2.0)) -0.5)) t_0)
(- (/ 1.0 (sin B)) t_0)))))
double code(double F, double B, double x) {
double t_0 = cos(B) * (x / sin(B));
double tmp;
if (F <= -118000000.0) {
tmp = (-1.0 / sin(B)) - (x / tan(B));
} else if (F <= 35000000.0) {
tmp = ((F / sin(B)) * pow((((F * F) + 2.0) + (x * 2.0)), -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 = cos(b) * (x / sin(b))
if (f <= (-118000000.0d0)) then
tmp = ((-1.0d0) / sin(b)) - (x / tan(b))
else if (f <= 35000000.0d0) then
tmp = ((f / sin(b)) * ((((f * f) + 2.0d0) + (x * 2.0d0)) ** (-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 = Math.cos(B) * (x / Math.sin(B));
double tmp;
if (F <= -118000000.0) {
tmp = (-1.0 / Math.sin(B)) - (x / Math.tan(B));
} else if (F <= 35000000.0) {
tmp = ((F / Math.sin(B)) * Math.pow((((F * F) + 2.0) + (x * 2.0)), -0.5)) - t_0;
} else {
tmp = (1.0 / Math.sin(B)) - t_0;
}
return tmp;
}
def code(F, B, x): t_0 = math.cos(B) * (x / math.sin(B)) tmp = 0 if F <= -118000000.0: tmp = (-1.0 / math.sin(B)) - (x / math.tan(B)) elif F <= 35000000.0: tmp = ((F / math.sin(B)) * math.pow((((F * F) + 2.0) + (x * 2.0)), -0.5)) - t_0 else: tmp = (1.0 / math.sin(B)) - t_0 return tmp
function code(F, B, x) t_0 = Float64(cos(B) * Float64(x / sin(B))) tmp = 0.0 if (F <= -118000000.0) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / tan(B))); elseif (F <= 35000000.0) tmp = Float64(Float64(Float64(F / sin(B)) * (Float64(Float64(Float64(F * F) + 2.0) + Float64(x * 2.0)) ^ -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 = cos(B) * (x / sin(B)); tmp = 0.0; if (F <= -118000000.0) tmp = (-1.0 / sin(B)) - (x / tan(B)); elseif (F <= 35000000.0) tmp = ((F / sin(B)) * ((((F * F) + 2.0) + (x * 2.0)) ^ -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[(N[Cos[B], $MachinePrecision] * N[(x / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -118000000.0], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 35000000.0], N[(N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Power[N[(N[(N[(F * F), $MachinePrecision] + 2.0), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $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 := \cos B \cdot \frac{x}{\sin B}\\
\mathbf{if}\;F \leq -118000000:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\
\mathbf{elif}\;F \leq 35000000:\\
\;\;\;\;\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + x \cdot 2\right)}^{-0.5} - t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_0\\
\end{array}
\end{array}
if F < -1.18e8Initial program 58.6%
Simplified74.3%
Taylor expanded in x around 0 74.4%
associate-*l/74.3%
*-lft-identity74.3%
+-commutative74.3%
unpow274.3%
fma-udef74.3%
Simplified74.3%
Taylor expanded in F around -inf 99.8%
if -1.18e8 < F < 3.5e7Initial program 99.5%
Taylor expanded in x around 0 99.7%
associate-*l/99.6%
*-commutative99.6%
Simplified99.6%
if 3.5e7 < F Initial program 58.2%
Simplified74.7%
Taylor expanded in F around inf 99.6%
associate-/r*99.6%
Simplified99.6%
Taylor expanded in F around 0 99.8%
*-commutative99.8%
associate-*r/99.9%
Simplified99.9%
Final simplification99.7%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -5e+37)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 47000000.0)
(- (/ F (/ (sin B) (pow (fma F F 2.0) -0.5))) t_0)
(- (/ 1.0 (sin B)) (* (cos B) (/ x (sin B))))))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -5e+37) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 47000000.0) {
tmp = (F / (sin(B) / pow(fma(F, F, 2.0), -0.5))) - t_0;
} else {
tmp = (1.0 / sin(B)) - (cos(B) * (x / sin(B)));
}
return tmp;
}
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -5e+37) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 47000000.0) tmp = Float64(Float64(F / Float64(sin(B) / (fma(F, F, 2.0) ^ -0.5))) - t_0); else tmp = Float64(Float64(1.0 / sin(B)) - Float64(cos(B) * Float64(x / sin(B)))); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -5e+37], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 47000000.0], 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] - N[(N[Cos[B], $MachinePrecision] * N[(x / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -5 \cdot 10^{+37}:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq 47000000:\\
\;\;\;\;\frac{F}{\frac{\sin B}{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-0.5}}} - t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - \cos B \cdot \frac{x}{\sin B}\\
\end{array}
\end{array}
if F < -4.99999999999999989e37Initial program 52.7%
Simplified70.7%
Taylor expanded in x around 0 70.8%
associate-*l/70.7%
*-lft-identity70.7%
+-commutative70.7%
unpow270.7%
fma-udef70.7%
Simplified70.7%
Taylor expanded in F around -inf 99.8%
if -4.99999999999999989e37 < F < 4.7e7Initial program 99.5%
Simplified99.6%
Taylor expanded in x around 0 99.4%
associate-*l/99.5%
*-lft-identity99.5%
+-commutative99.5%
unpow299.5%
fma-udef99.5%
Simplified99.5%
clear-num99.5%
un-div-inv99.5%
inv-pow99.5%
sqrt-pow199.5%
metadata-eval99.5%
Applied egg-rr99.5%
if 4.7e7 < F Initial program 58.2%
Simplified74.7%
Taylor expanded in F around inf 99.6%
associate-/r*99.6%
Simplified99.6%
Taylor expanded in F around 0 99.8%
*-commutative99.8%
associate-*r/99.9%
Simplified99.9%
Final simplification99.7%
(FPCore (F B x)
:precision binary64
(if (<= F -3.4e+48)
(- (/ -1.0 (sin B)) (/ x (tan B)))
(if (<= F 47000000.0)
(+
(* (/ F (sin B)) (pow (+ (+ (* F F) 2.0) (* x 2.0)) -0.5))
(* x (/ -1.0 (tan B))))
(- (/ 1.0 (sin B)) (* (cos B) (/ x (sin B)))))))
double code(double F, double B, double x) {
double tmp;
if (F <= -3.4e+48) {
tmp = (-1.0 / sin(B)) - (x / tan(B));
} else if (F <= 47000000.0) {
tmp = ((F / sin(B)) * pow((((F * F) + 2.0) + (x * 2.0)), -0.5)) + (x * (-1.0 / tan(B)));
} else {
tmp = (1.0 / sin(B)) - (cos(B) * (x / sin(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.4d+48)) then
tmp = ((-1.0d0) / sin(b)) - (x / tan(b))
else if (f <= 47000000.0d0) then
tmp = ((f / sin(b)) * ((((f * f) + 2.0d0) + (x * 2.0d0)) ** (-0.5d0))) + (x * ((-1.0d0) / tan(b)))
else
tmp = (1.0d0 / sin(b)) - (cos(b) * (x / sin(b)))
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -3.4e+48) {
tmp = (-1.0 / Math.sin(B)) - (x / Math.tan(B));
} else if (F <= 47000000.0) {
tmp = ((F / Math.sin(B)) * Math.pow((((F * F) + 2.0) + (x * 2.0)), -0.5)) + (x * (-1.0 / Math.tan(B)));
} else {
tmp = (1.0 / Math.sin(B)) - (Math.cos(B) * (x / Math.sin(B)));
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -3.4e+48: tmp = (-1.0 / math.sin(B)) - (x / math.tan(B)) elif F <= 47000000.0: tmp = ((F / math.sin(B)) * math.pow((((F * F) + 2.0) + (x * 2.0)), -0.5)) + (x * (-1.0 / math.tan(B))) else: tmp = (1.0 / math.sin(B)) - (math.cos(B) * (x / math.sin(B))) return tmp
function code(F, B, x) tmp = 0.0 if (F <= -3.4e+48) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / tan(B))); elseif (F <= 47000000.0) tmp = Float64(Float64(Float64(F / sin(B)) * (Float64(Float64(Float64(F * F) + 2.0) + Float64(x * 2.0)) ^ -0.5)) + Float64(x * Float64(-1.0 / tan(B)))); else tmp = Float64(Float64(1.0 / sin(B)) - Float64(cos(B) * Float64(x / sin(B)))); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -3.4e+48) tmp = (-1.0 / sin(B)) - (x / tan(B)); elseif (F <= 47000000.0) tmp = ((F / sin(B)) * ((((F * F) + 2.0) + (x * 2.0)) ^ -0.5)) + (x * (-1.0 / tan(B))); else tmp = (1.0 / sin(B)) - (cos(B) * (x / sin(B))); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -3.4e+48], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 47000000.0], N[(N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Power[N[(N[(N[(F * F), $MachinePrecision] + 2.0), $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] - N[(N[Cos[B], $MachinePrecision] * N[(x / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -3.4 \cdot 10^{+48}:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\
\mathbf{elif}\;F \leq 47000000:\\
\;\;\;\;\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + x \cdot 2\right)}^{-0.5} + x \cdot \frac{-1}{\tan B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - \cos B \cdot \frac{x}{\sin B}\\
\end{array}
\end{array}
if F < -3.4000000000000003e48Initial program 51.1%
Simplified69.7%
Taylor expanded in x around 0 69.8%
associate-*l/69.8%
*-lft-identity69.8%
+-commutative69.8%
unpow269.8%
fma-udef69.8%
Simplified69.8%
Taylor expanded in F around -inf 99.8%
if -3.4000000000000003e48 < F < 4.7e7Initial program 99.5%
if 4.7e7 < F Initial program 58.2%
Simplified74.7%
Taylor expanded in F around inf 99.6%
associate-/r*99.6%
Simplified99.6%
Taylor expanded in F around 0 99.8%
*-commutative99.8%
associate-*r/99.9%
Simplified99.9%
Final simplification99.7%
(FPCore (F B x)
:precision binary64
(if (<= F -0.037)
(- (/ -1.0 (sin B)) (/ x (tan B)))
(if (<= F 47000000.0)
(+
(* (/ F (sin B)) (pow (+ (+ (* F F) 2.0) (* x 2.0)) -0.5))
(/ -1.0 (/ (tan B) x)))
(- (/ 1.0 (sin B)) (* (cos B) (/ x (sin B)))))))
double code(double F, double B, double x) {
double tmp;
if (F <= -0.037) {
tmp = (-1.0 / sin(B)) - (x / tan(B));
} else if (F <= 47000000.0) {
tmp = ((F / sin(B)) * pow((((F * F) + 2.0) + (x * 2.0)), -0.5)) + (-1.0 / (tan(B) / x));
} else {
tmp = (1.0 / sin(B)) - (cos(B) * (x / sin(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.037d0)) then
tmp = ((-1.0d0) / sin(b)) - (x / tan(b))
else if (f <= 47000000.0d0) then
tmp = ((f / sin(b)) * ((((f * f) + 2.0d0) + (x * 2.0d0)) ** (-0.5d0))) + ((-1.0d0) / (tan(b) / x))
else
tmp = (1.0d0 / sin(b)) - (cos(b) * (x / sin(b)))
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -0.037) {
tmp = (-1.0 / Math.sin(B)) - (x / Math.tan(B));
} else if (F <= 47000000.0) {
tmp = ((F / Math.sin(B)) * Math.pow((((F * F) + 2.0) + (x * 2.0)), -0.5)) + (-1.0 / (Math.tan(B) / x));
} else {
tmp = (1.0 / Math.sin(B)) - (Math.cos(B) * (x / Math.sin(B)));
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -0.037: tmp = (-1.0 / math.sin(B)) - (x / math.tan(B)) elif F <= 47000000.0: tmp = ((F / math.sin(B)) * math.pow((((F * F) + 2.0) + (x * 2.0)), -0.5)) + (-1.0 / (math.tan(B) / x)) else: tmp = (1.0 / math.sin(B)) - (math.cos(B) * (x / math.sin(B))) return tmp
function code(F, B, x) tmp = 0.0 if (F <= -0.037) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / tan(B))); elseif (F <= 47000000.0) tmp = Float64(Float64(Float64(F / sin(B)) * (Float64(Float64(Float64(F * F) + 2.0) + Float64(x * 2.0)) ^ -0.5)) + Float64(-1.0 / Float64(tan(B) / x))); else tmp = Float64(Float64(1.0 / sin(B)) - Float64(cos(B) * Float64(x / sin(B)))); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -0.037) tmp = (-1.0 / sin(B)) - (x / tan(B)); elseif (F <= 47000000.0) tmp = ((F / sin(B)) * ((((F * F) + 2.0) + (x * 2.0)) ^ -0.5)) + (-1.0 / (tan(B) / x)); else tmp = (1.0 / sin(B)) - (cos(B) * (x / sin(B))); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -0.037], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 47000000.0], N[(N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Power[N[(N[(N[(F * F), $MachinePrecision] + 2.0), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision] + N[(-1.0 / N[(N[Tan[B], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(N[Cos[B], $MachinePrecision] * N[(x / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -0.037:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\
\mathbf{elif}\;F \leq 47000000:\\
\;\;\;\;\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + x \cdot 2\right)}^{-0.5} + \frac{-1}{\frac{\tan B}{x}}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - \cos B \cdot \frac{x}{\sin B}\\
\end{array}
\end{array}
if F < -0.0369999999999999982Initial program 59.1%
Simplified74.6%
Taylor expanded in x around 0 74.8%
associate-*l/74.7%
*-lft-identity74.7%
+-commutative74.7%
unpow274.7%
fma-udef74.7%
Simplified74.7%
Taylor expanded in F around -inf 99.8%
if -0.0369999999999999982 < F < 4.7e7Initial program 99.5%
div-inv99.6%
clear-num99.5%
Applied egg-rr99.5%
if 4.7e7 < F Initial program 58.2%
Simplified74.7%
Taylor expanded in F around inf 99.6%
associate-/r*99.6%
Simplified99.6%
Taylor expanded in F around 0 99.8%
*-commutative99.8%
associate-*r/99.9%
Simplified99.9%
Final simplification99.7%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B)))
(t_1 (/ 1.0 (sin B)))
(t_2
(- (* (pow (+ (+ (* F F) 2.0) (* x 2.0)) -0.5) (* F t_1)) (/ x B))))
(if (<= F -0.037)
(- (/ -1.0 (sin B)) t_0)
(if (<= F -2.3e-146)
t_2
(if (<= F 3e-33)
(- (/ F (* (sin B) (+ F (/ 1.0 F)))) t_0)
(if (<= F 7500000.0) t_2 (- t_1 (* (cos B) (/ x (sin B))))))))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double t_1 = 1.0 / sin(B);
double t_2 = (pow((((F * F) + 2.0) + (x * 2.0)), -0.5) * (F * t_1)) - (x / B);
double tmp;
if (F <= -0.037) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= -2.3e-146) {
tmp = t_2;
} else if (F <= 3e-33) {
tmp = (F / (sin(B) * (F + (1.0 / F)))) - t_0;
} else if (F <= 7500000.0) {
tmp = t_2;
} else {
tmp = t_1 - (cos(B) * (x / sin(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) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_0 = x / tan(b)
t_1 = 1.0d0 / sin(b)
t_2 = (((((f * f) + 2.0d0) + (x * 2.0d0)) ** (-0.5d0)) * (f * t_1)) - (x / b)
if (f <= (-0.037d0)) then
tmp = ((-1.0d0) / sin(b)) - t_0
else if (f <= (-2.3d-146)) then
tmp = t_2
else if (f <= 3d-33) then
tmp = (f / (sin(b) * (f + (1.0d0 / f)))) - t_0
else if (f <= 7500000.0d0) then
tmp = t_2
else
tmp = t_1 - (cos(b) * (x / sin(b)))
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 / Math.sin(B);
double t_2 = (Math.pow((((F * F) + 2.0) + (x * 2.0)), -0.5) * (F * t_1)) - (x / B);
double tmp;
if (F <= -0.037) {
tmp = (-1.0 / Math.sin(B)) - t_0;
} else if (F <= -2.3e-146) {
tmp = t_2;
} else if (F <= 3e-33) {
tmp = (F / (Math.sin(B) * (F + (1.0 / F)))) - t_0;
} else if (F <= 7500000.0) {
tmp = t_2;
} else {
tmp = t_1 - (Math.cos(B) * (x / Math.sin(B)));
}
return tmp;
}
def code(F, B, x): t_0 = x / math.tan(B) t_1 = 1.0 / math.sin(B) t_2 = (math.pow((((F * F) + 2.0) + (x * 2.0)), -0.5) * (F * t_1)) - (x / B) tmp = 0 if F <= -0.037: tmp = (-1.0 / math.sin(B)) - t_0 elif F <= -2.3e-146: tmp = t_2 elif F <= 3e-33: tmp = (F / (math.sin(B) * (F + (1.0 / F)))) - t_0 elif F <= 7500000.0: tmp = t_2 else: tmp = t_1 - (math.cos(B) * (x / math.sin(B))) return tmp
function code(F, B, x) t_0 = Float64(x / tan(B)) t_1 = Float64(1.0 / sin(B)) t_2 = Float64(Float64((Float64(Float64(Float64(F * F) + 2.0) + Float64(x * 2.0)) ^ -0.5) * Float64(F * t_1)) - Float64(x / B)) tmp = 0.0 if (F <= -0.037) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= -2.3e-146) tmp = t_2; elseif (F <= 3e-33) tmp = Float64(Float64(F / Float64(sin(B) * Float64(F + Float64(1.0 / F)))) - t_0); elseif (F <= 7500000.0) tmp = t_2; else tmp = Float64(t_1 - Float64(cos(B) * Float64(x / sin(B)))); end return tmp end
function tmp_2 = code(F, B, x) t_0 = x / tan(B); t_1 = 1.0 / sin(B); t_2 = (((((F * F) + 2.0) + (x * 2.0)) ^ -0.5) * (F * t_1)) - (x / B); tmp = 0.0; if (F <= -0.037) tmp = (-1.0 / sin(B)) - t_0; elseif (F <= -2.3e-146) tmp = t_2; elseif (F <= 3e-33) tmp = (F / (sin(B) * (F + (1.0 / F)))) - t_0; elseif (F <= 7500000.0) tmp = t_2; else tmp = t_1 - (cos(B) * (x / sin(B))); 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[Sin[B], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[Power[N[(N[(N[(F * F), $MachinePrecision] + 2.0), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] * N[(F * t$95$1), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -0.037], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, -2.3e-146], t$95$2, If[LessEqual[F, 3e-33], N[(N[(F / N[(N[Sin[B], $MachinePrecision] * N[(F + N[(1.0 / F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 7500000.0], t$95$2, N[(t$95$1 - N[(N[Cos[B], $MachinePrecision] * N[(x / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
t_1 := \frac{1}{\sin B}\\
t_2 := {\left(\left(F \cdot F + 2\right) + x \cdot 2\right)}^{-0.5} \cdot \left(F \cdot t\_1\right) - \frac{x}{B}\\
\mathbf{if}\;F \leq -0.037:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq -2.3 \cdot 10^{-146}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;F \leq 3 \cdot 10^{-33}:\\
\;\;\;\;\frac{F}{\sin B \cdot \left(F + \frac{1}{F}\right)} - t\_0\\
\mathbf{elif}\;F \leq 7500000:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;t\_1 - \cos B \cdot \frac{x}{\sin B}\\
\end{array}
\end{array}
if F < -0.0369999999999999982Initial program 59.1%
Simplified74.6%
Taylor expanded in x around 0 74.8%
associate-*l/74.7%
*-lft-identity74.7%
+-commutative74.7%
unpow274.7%
fma-udef74.7%
Simplified74.7%
Taylor expanded in F around -inf 99.8%
if -0.0369999999999999982 < F < -2.3000000000000001e-146 or 3.0000000000000002e-33 < F < 7.5e6Initial program 99.5%
Taylor expanded in B around 0 87.0%
div-inv87.2%
Applied egg-rr87.2%
if -2.3000000000000001e-146 < F < 3.0000000000000002e-33Initial 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%
expm1-log1p-u90.5%
expm1-udef83.4%
associate-*r/83.4%
sqrt-div83.4%
metadata-eval83.4%
un-div-inv83.4%
Applied egg-rr83.4%
expm1-def90.5%
expm1-log1p99.6%
associate-/l/99.7%
Simplified99.7%
Taylor expanded in F around inf 91.3%
if 7.5e6 < F Initial program 58.2%
Simplified74.7%
Taylor expanded in F around inf 99.6%
associate-/r*99.6%
Simplified99.6%
Taylor expanded in F around 0 99.8%
*-commutative99.8%
associate-*r/99.9%
Simplified99.9%
Final simplification95.6%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ 1.0 (sin B))) (t_1 (/ x (tan B))))
(if (<= F -1.75)
(- (/ -1.0 (sin B)) t_1)
(if (<= F 1.75)
(- (* F (* t_0 (sqrt (/ 1.0 (+ 2.0 (* x 2.0)))))) t_1)
(- t_0 (* (cos B) (/ x (sin B))))))))
double code(double F, double B, double x) {
double t_0 = 1.0 / sin(B);
double t_1 = x / tan(B);
double tmp;
if (F <= -1.75) {
tmp = (-1.0 / sin(B)) - t_1;
} else if (F <= 1.75) {
tmp = (F * (t_0 * sqrt((1.0 / (2.0 + (x * 2.0)))))) - t_1;
} else {
tmp = t_0 - (cos(B) * (x / sin(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) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = 1.0d0 / sin(b)
t_1 = x / tan(b)
if (f <= (-1.75d0)) then
tmp = ((-1.0d0) / sin(b)) - t_1
else if (f <= 1.75d0) then
tmp = (f * (t_0 * sqrt((1.0d0 / (2.0d0 + (x * 2.0d0)))))) - t_1
else
tmp = t_0 - (cos(b) * (x / sin(b)))
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = 1.0 / Math.sin(B);
double t_1 = x / Math.tan(B);
double tmp;
if (F <= -1.75) {
tmp = (-1.0 / Math.sin(B)) - t_1;
} else if (F <= 1.75) {
tmp = (F * (t_0 * Math.sqrt((1.0 / (2.0 + (x * 2.0)))))) - t_1;
} else {
tmp = t_0 - (Math.cos(B) * (x / Math.sin(B)));
}
return tmp;
}
def code(F, B, x): t_0 = 1.0 / math.sin(B) t_1 = x / math.tan(B) tmp = 0 if F <= -1.75: tmp = (-1.0 / math.sin(B)) - t_1 elif F <= 1.75: tmp = (F * (t_0 * math.sqrt((1.0 / (2.0 + (x * 2.0)))))) - t_1 else: tmp = t_0 - (math.cos(B) * (x / math.sin(B))) return tmp
function code(F, B, x) t_0 = Float64(1.0 / sin(B)) t_1 = Float64(x / tan(B)) tmp = 0.0 if (F <= -1.75) tmp = Float64(Float64(-1.0 / sin(B)) - t_1); elseif (F <= 1.75) tmp = Float64(Float64(F * Float64(t_0 * sqrt(Float64(1.0 / Float64(2.0 + Float64(x * 2.0)))))) - t_1); else tmp = Float64(t_0 - Float64(cos(B) * Float64(x / sin(B)))); end return tmp end
function tmp_2 = code(F, B, x) t_0 = 1.0 / sin(B); t_1 = x / tan(B); tmp = 0.0; if (F <= -1.75) tmp = (-1.0 / sin(B)) - t_1; elseif (F <= 1.75) tmp = (F * (t_0 * sqrt((1.0 / (2.0 + (x * 2.0)))))) - t_1; else tmp = t_0 - (cos(B) * (x / sin(B))); end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -1.75], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[F, 1.75], N[(N[(F * N[(t$95$0 * N[Sqrt[N[(1.0 / N[(2.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], N[(t$95$0 - N[(N[Cos[B], $MachinePrecision] * N[(x / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{1}{\sin B}\\
t_1 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -1.75:\\
\;\;\;\;\frac{-1}{\sin B} - t\_1\\
\mathbf{elif}\;F \leq 1.75:\\
\;\;\;\;F \cdot \left(t\_0 \cdot \sqrt{\frac{1}{2 + x \cdot 2}}\right) - t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_0 - \cos B \cdot \frac{x}{\sin B}\\
\end{array}
\end{array}
if F < -1.75Initial program 58.6%
Simplified74.3%
Taylor expanded in x around 0 74.4%
associate-*l/74.3%
*-lft-identity74.3%
+-commutative74.3%
unpow274.3%
fma-udef74.3%
Simplified74.3%
Taylor expanded in F around -inf 99.8%
if -1.75 < F < 1.75Initial program 99.4%
Simplified99.6%
Taylor expanded in F around 0 98.7%
if 1.75 < F Initial program 58.7%
Simplified75.0%
Taylor expanded in F around inf 98.7%
associate-/r*98.7%
Simplified98.7%
Taylor expanded in F around 0 98.9%
*-commutative98.9%
associate-*r/99.0%
Simplified99.0%
Final simplification99.1%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -1.4)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 1.45)
(- (/ F (* (sin B) (sqrt 2.0))) t_0)
(- (/ 1.0 (sin B)) (* (cos B) (/ x (sin B))))))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -1.4) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 1.45) {
tmp = (F / (sin(B) * sqrt(2.0))) - t_0;
} else {
tmp = (1.0 / sin(B)) - (cos(B) * (x / sin(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) :: t_0
real(8) :: tmp
t_0 = x / tan(b)
if (f <= (-1.4d0)) then
tmp = ((-1.0d0) / sin(b)) - t_0
else if (f <= 1.45d0) then
tmp = (f / (sin(b) * sqrt(2.0d0))) - t_0
else
tmp = (1.0d0 / sin(b)) - (cos(b) * (x / sin(b)))
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.4) {
tmp = (-1.0 / Math.sin(B)) - t_0;
} else if (F <= 1.45) {
tmp = (F / (Math.sin(B) * Math.sqrt(2.0))) - t_0;
} else {
tmp = (1.0 / Math.sin(B)) - (Math.cos(B) * (x / Math.sin(B)));
}
return tmp;
}
def code(F, B, x): t_0 = x / math.tan(B) tmp = 0 if F <= -1.4: tmp = (-1.0 / math.sin(B)) - t_0 elif F <= 1.45: tmp = (F / (math.sin(B) * math.sqrt(2.0))) - t_0 else: tmp = (1.0 / math.sin(B)) - (math.cos(B) * (x / math.sin(B))) return tmp
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -1.4) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 1.45) tmp = Float64(Float64(F / Float64(sin(B) * sqrt(2.0))) - t_0); else tmp = Float64(Float64(1.0 / sin(B)) - Float64(cos(B) * Float64(x / sin(B)))); end return tmp end
function tmp_2 = code(F, B, x) t_0 = x / tan(B); tmp = 0.0; if (F <= -1.4) tmp = (-1.0 / sin(B)) - t_0; elseif (F <= 1.45) tmp = (F / (sin(B) * sqrt(2.0))) - t_0; else tmp = (1.0 / sin(B)) - (cos(B) * (x / sin(B))); end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -1.4], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 1.45], N[(N[(F / N[(N[Sin[B], $MachinePrecision] * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(N[Cos[B], $MachinePrecision] * N[(x / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -1.4:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq 1.45:\\
\;\;\;\;\frac{F}{\sin B \cdot \sqrt{2}} - t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - \cos B \cdot \frac{x}{\sin B}\\
\end{array}
\end{array}
if F < -1.3999999999999999Initial program 58.6%
Simplified74.3%
Taylor expanded in x around 0 74.4%
associate-*l/74.3%
*-lft-identity74.3%
+-commutative74.3%
unpow274.3%
fma-udef74.3%
Simplified74.3%
Taylor expanded in F around -inf 99.8%
if -1.3999999999999999 < F < 1.44999999999999996Initial program 99.4%
Simplified99.6%
Taylor expanded in x around 0 99.4%
associate-*l/99.5%
*-lft-identity99.5%
+-commutative99.5%
unpow299.5%
fma-udef99.5%
Simplified99.5%
expm1-log1p-u80.5%
expm1-udef67.2%
associate-*r/67.2%
sqrt-div67.2%
metadata-eval67.2%
un-div-inv67.2%
Applied egg-rr67.2%
expm1-def80.6%
expm1-log1p99.5%
associate-/l/99.5%
Simplified99.5%
Taylor expanded in F around 0 98.5%
*-commutative98.5%
Simplified98.5%
if 1.44999999999999996 < F Initial program 58.7%
Simplified75.0%
Taylor expanded in F around inf 98.7%
associate-/r*98.7%
Simplified98.7%
Taylor expanded in F around 0 98.9%
*-commutative98.9%
associate-*r/99.0%
Simplified99.0%
Final simplification99.0%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -1.4)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 1.45)
(- (/ F (/ (sin B) (sqrt 0.5))) t_0)
(- (/ 1.0 (sin B)) (* (cos B) (/ x (sin B))))))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -1.4) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 1.45) {
tmp = (F / (sin(B) / sqrt(0.5))) - t_0;
} else {
tmp = (1.0 / sin(B)) - (cos(B) * (x / sin(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) :: t_0
real(8) :: tmp
t_0 = x / tan(b)
if (f <= (-1.4d0)) then
tmp = ((-1.0d0) / sin(b)) - t_0
else if (f <= 1.45d0) then
tmp = (f / (sin(b) / sqrt(0.5d0))) - t_0
else
tmp = (1.0d0 / sin(b)) - (cos(b) * (x / sin(b)))
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.4) {
tmp = (-1.0 / Math.sin(B)) - t_0;
} else if (F <= 1.45) {
tmp = (F / (Math.sin(B) / Math.sqrt(0.5))) - t_0;
} else {
tmp = (1.0 / Math.sin(B)) - (Math.cos(B) * (x / Math.sin(B)));
}
return tmp;
}
def code(F, B, x): t_0 = x / math.tan(B) tmp = 0 if F <= -1.4: tmp = (-1.0 / math.sin(B)) - t_0 elif F <= 1.45: tmp = (F / (math.sin(B) / math.sqrt(0.5))) - t_0 else: tmp = (1.0 / math.sin(B)) - (math.cos(B) * (x / math.sin(B))) return tmp
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -1.4) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 1.45) tmp = Float64(Float64(F / Float64(sin(B) / sqrt(0.5))) - t_0); else tmp = Float64(Float64(1.0 / sin(B)) - Float64(cos(B) * Float64(x / sin(B)))); end return tmp end
function tmp_2 = code(F, B, x) t_0 = x / tan(B); tmp = 0.0; if (F <= -1.4) tmp = (-1.0 / sin(B)) - t_0; elseif (F <= 1.45) tmp = (F / (sin(B) / sqrt(0.5))) - t_0; else tmp = (1.0 / sin(B)) - (cos(B) * (x / sin(B))); end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -1.4], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 1.45], 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] - N[(N[Cos[B], $MachinePrecision] * N[(x / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -1.4:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq 1.45:\\
\;\;\;\;\frac{F}{\frac{\sin B}{\sqrt{0.5}}} - t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - \cos B \cdot \frac{x}{\sin B}\\
\end{array}
\end{array}
if F < -1.3999999999999999Initial program 58.6%
Simplified74.3%
Taylor expanded in x around 0 74.4%
associate-*l/74.3%
*-lft-identity74.3%
+-commutative74.3%
unpow274.3%
fma-udef74.3%
Simplified74.3%
Taylor expanded in F around -inf 99.8%
if -1.3999999999999999 < F < 1.44999999999999996Initial program 99.4%
Simplified99.6%
Taylor expanded in x around 0 99.4%
associate-*l/99.5%
*-lft-identity99.5%
+-commutative99.5%
unpow299.5%
fma-udef99.5%
Simplified99.5%
clear-num99.5%
un-div-inv99.5%
inv-pow99.5%
sqrt-pow199.5%
metadata-eval99.5%
Applied egg-rr99.5%
Taylor expanded in F around 0 98.6%
if 1.44999999999999996 < F Initial program 58.7%
Simplified75.0%
Taylor expanded in F around inf 98.7%
associate-/r*98.7%
Simplified98.7%
Taylor expanded in F around 0 98.9%
*-commutative98.9%
associate-*r/99.0%
Simplified99.0%
Final simplification99.0%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -1.4)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 1.45)
(- (/ (* F (sqrt 0.5)) (sin B)) t_0)
(- (/ 1.0 (sin B)) (* (cos B) (/ x (sin B))))))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -1.4) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 1.45) {
tmp = ((F * sqrt(0.5)) / sin(B)) - t_0;
} else {
tmp = (1.0 / sin(B)) - (cos(B) * (x / sin(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) :: t_0
real(8) :: tmp
t_0 = x / tan(b)
if (f <= (-1.4d0)) then
tmp = ((-1.0d0) / sin(b)) - t_0
else if (f <= 1.45d0) then
tmp = ((f * sqrt(0.5d0)) / sin(b)) - t_0
else
tmp = (1.0d0 / sin(b)) - (cos(b) * (x / sin(b)))
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.4) {
tmp = (-1.0 / Math.sin(B)) - t_0;
} else if (F <= 1.45) {
tmp = ((F * Math.sqrt(0.5)) / Math.sin(B)) - t_0;
} else {
tmp = (1.0 / Math.sin(B)) - (Math.cos(B) * (x / Math.sin(B)));
}
return tmp;
}
def code(F, B, x): t_0 = x / math.tan(B) tmp = 0 if F <= -1.4: tmp = (-1.0 / math.sin(B)) - t_0 elif F <= 1.45: tmp = ((F * math.sqrt(0.5)) / math.sin(B)) - t_0 else: tmp = (1.0 / math.sin(B)) - (math.cos(B) * (x / math.sin(B))) return tmp
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -1.4) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 1.45) tmp = Float64(Float64(Float64(F * sqrt(0.5)) / sin(B)) - t_0); else tmp = Float64(Float64(1.0 / sin(B)) - Float64(cos(B) * Float64(x / sin(B)))); end return tmp end
function tmp_2 = code(F, B, x) t_0 = x / tan(B); tmp = 0.0; if (F <= -1.4) tmp = (-1.0 / sin(B)) - t_0; elseif (F <= 1.45) tmp = ((F * sqrt(0.5)) / sin(B)) - t_0; else tmp = (1.0 / sin(B)) - (cos(B) * (x / sin(B))); end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -1.4], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 1.45], 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] - N[(N[Cos[B], $MachinePrecision] * N[(x / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -1.4:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq 1.45:\\
\;\;\;\;\frac{F \cdot \sqrt{0.5}}{\sin B} - t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - \cos B \cdot \frac{x}{\sin B}\\
\end{array}
\end{array}
if F < -1.3999999999999999Initial program 58.6%
Simplified74.3%
Taylor expanded in x around 0 74.4%
associate-*l/74.3%
*-lft-identity74.3%
+-commutative74.3%
unpow274.3%
fma-udef74.3%
Simplified74.3%
Taylor expanded in F around -inf 99.8%
if -1.3999999999999999 < F < 1.44999999999999996Initial program 99.4%
Simplified99.6%
Taylor expanded in x around 0 99.4%
associate-*l/99.5%
*-lft-identity99.5%
+-commutative99.5%
unpow299.5%
fma-udef99.5%
Simplified99.5%
Taylor expanded in F around 0 98.6%
*-commutative98.6%
Simplified98.6%
if 1.44999999999999996 < F Initial program 58.7%
Simplified75.0%
Taylor expanded in F around inf 98.7%
associate-/r*98.7%
Simplified98.7%
Taylor expanded in F around 0 98.9%
*-commutative98.9%
associate-*r/99.0%
Simplified99.0%
Final simplification99.0%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B)))
(t_1 (/ 1.0 (sin B)))
(t_2
(- (* (pow (+ (+ (* F F) 2.0) (* x 2.0)) -0.5) (* F t_1)) (/ x B))))
(if (<= F -0.037)
(- (/ -1.0 (sin B)) t_0)
(if (<= F -5.6e-144)
t_2
(if (<= F 3.1e-33)
(- (/ F (* (sin B) (+ F (/ 1.0 F)))) t_0)
(if (<= F 27000.0) t_2 (- t_1 t_0)))))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double t_1 = 1.0 / sin(B);
double t_2 = (pow((((F * F) + 2.0) + (x * 2.0)), -0.5) * (F * t_1)) - (x / B);
double tmp;
if (F <= -0.037) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= -5.6e-144) {
tmp = t_2;
} else if (F <= 3.1e-33) {
tmp = (F / (sin(B) * (F + (1.0 / F)))) - t_0;
} else if (F <= 27000.0) {
tmp = t_2;
} else {
tmp = 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) :: t_2
real(8) :: tmp
t_0 = x / tan(b)
t_1 = 1.0d0 / sin(b)
t_2 = (((((f * f) + 2.0d0) + (x * 2.0d0)) ** (-0.5d0)) * (f * t_1)) - (x / b)
if (f <= (-0.037d0)) then
tmp = ((-1.0d0) / sin(b)) - t_0
else if (f <= (-5.6d-144)) then
tmp = t_2
else if (f <= 3.1d-33) then
tmp = (f / (sin(b) * (f + (1.0d0 / f)))) - t_0
else if (f <= 27000.0d0) then
tmp = t_2
else
tmp = 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 / Math.sin(B);
double t_2 = (Math.pow((((F * F) + 2.0) + (x * 2.0)), -0.5) * (F * t_1)) - (x / B);
double tmp;
if (F <= -0.037) {
tmp = (-1.0 / Math.sin(B)) - t_0;
} else if (F <= -5.6e-144) {
tmp = t_2;
} else if (F <= 3.1e-33) {
tmp = (F / (Math.sin(B) * (F + (1.0 / F)))) - t_0;
} else if (F <= 27000.0) {
tmp = t_2;
} else {
tmp = t_1 - t_0;
}
return tmp;
}
def code(F, B, x): t_0 = x / math.tan(B) t_1 = 1.0 / math.sin(B) t_2 = (math.pow((((F * F) + 2.0) + (x * 2.0)), -0.5) * (F * t_1)) - (x / B) tmp = 0 if F <= -0.037: tmp = (-1.0 / math.sin(B)) - t_0 elif F <= -5.6e-144: tmp = t_2 elif F <= 3.1e-33: tmp = (F / (math.sin(B) * (F + (1.0 / F)))) - t_0 elif F <= 27000.0: tmp = t_2 else: tmp = t_1 - t_0 return tmp
function code(F, B, x) t_0 = Float64(x / tan(B)) t_1 = Float64(1.0 / sin(B)) t_2 = Float64(Float64((Float64(Float64(Float64(F * F) + 2.0) + Float64(x * 2.0)) ^ -0.5) * Float64(F * t_1)) - Float64(x / B)) tmp = 0.0 if (F <= -0.037) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= -5.6e-144) tmp = t_2; elseif (F <= 3.1e-33) tmp = Float64(Float64(F / Float64(sin(B) * Float64(F + Float64(1.0 / F)))) - t_0); elseif (F <= 27000.0) tmp = t_2; else tmp = Float64(t_1 - t_0); end return tmp end
function tmp_2 = code(F, B, x) t_0 = x / tan(B); t_1 = 1.0 / sin(B); t_2 = (((((F * F) + 2.0) + (x * 2.0)) ^ -0.5) * (F * t_1)) - (x / B); tmp = 0.0; if (F <= -0.037) tmp = (-1.0 / sin(B)) - t_0; elseif (F <= -5.6e-144) tmp = t_2; elseif (F <= 3.1e-33) tmp = (F / (sin(B) * (F + (1.0 / F)))) - t_0; elseif (F <= 27000.0) tmp = t_2; else tmp = 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[Sin[B], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[Power[N[(N[(N[(F * F), $MachinePrecision] + 2.0), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] * N[(F * t$95$1), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -0.037], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, -5.6e-144], t$95$2, If[LessEqual[F, 3.1e-33], N[(N[(F / N[(N[Sin[B], $MachinePrecision] * N[(F + N[(1.0 / F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 27000.0], t$95$2, N[(t$95$1 - t$95$0), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
t_1 := \frac{1}{\sin B}\\
t_2 := {\left(\left(F \cdot F + 2\right) + x \cdot 2\right)}^{-0.5} \cdot \left(F \cdot t\_1\right) - \frac{x}{B}\\
\mathbf{if}\;F \leq -0.037:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq -5.6 \cdot 10^{-144}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;F \leq 3.1 \cdot 10^{-33}:\\
\;\;\;\;\frac{F}{\sin B \cdot \left(F + \frac{1}{F}\right)} - t\_0\\
\mathbf{elif}\;F \leq 27000:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;t\_1 - t\_0\\
\end{array}
\end{array}
if F < -0.0369999999999999982Initial program 59.1%
Simplified74.6%
Taylor expanded in x around 0 74.8%
associate-*l/74.7%
*-lft-identity74.7%
+-commutative74.7%
unpow274.7%
fma-udef74.7%
Simplified74.7%
Taylor expanded in F around -inf 99.8%
if -0.0369999999999999982 < F < -5.59999999999999995e-144 or 3.09999999999999997e-33 < F < 27000Initial program 99.5%
Taylor expanded in B around 0 87.0%
div-inv87.2%
Applied egg-rr87.2%
if -5.59999999999999995e-144 < F < 3.09999999999999997e-33Initial 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%
expm1-log1p-u90.5%
expm1-udef83.4%
associate-*r/83.4%
sqrt-div83.4%
metadata-eval83.4%
un-div-inv83.4%
Applied egg-rr83.4%
expm1-def90.5%
expm1-log1p99.6%
associate-/l/99.7%
Simplified99.7%
Taylor expanded in F around inf 91.3%
if 27000 < F Initial program 58.2%
Simplified74.7%
Taylor expanded in x around 0 74.7%
associate-*l/74.7%
*-lft-identity74.7%
+-commutative74.7%
unpow274.7%
fma-udef74.7%
Simplified74.7%
Taylor expanded in F around inf 99.8%
Final simplification95.6%
(FPCore (F B x)
:precision binary64
(let* ((t_0
(-
(* (/ F (sin B)) (pow (+ (+ (* F F) 2.0) (* x 2.0)) -0.5))
(/ x B)))
(t_1 (/ x (tan B))))
(if (<= F -0.037)
(- (/ -1.0 (sin B)) t_1)
(if (<= F -4.4e-147)
t_0
(if (<= F 3e-33)
(- (/ F (* (sin B) (+ F (/ 1.0 F)))) t_1)
(if (<= F 2600000.0) t_0 (- (/ 1.0 (sin B)) t_1)))))))
double code(double F, double B, double x) {
double t_0 = ((F / sin(B)) * pow((((F * F) + 2.0) + (x * 2.0)), -0.5)) - (x / B);
double t_1 = x / tan(B);
double tmp;
if (F <= -0.037) {
tmp = (-1.0 / sin(B)) - t_1;
} else if (F <= -4.4e-147) {
tmp = t_0;
} else if (F <= 3e-33) {
tmp = (F / (sin(B) * (F + (1.0 / F)))) - t_1;
} else if (F <= 2600000.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)) * ((((f * f) + 2.0d0) + (x * 2.0d0)) ** (-0.5d0))) - (x / b)
t_1 = x / tan(b)
if (f <= (-0.037d0)) then
tmp = ((-1.0d0) / sin(b)) - t_1
else if (f <= (-4.4d-147)) then
tmp = t_0
else if (f <= 3d-33) then
tmp = (f / (sin(b) * (f + (1.0d0 / f)))) - t_1
else if (f <= 2600000.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((((F * F) + 2.0) + (x * 2.0)), -0.5)) - (x / B);
double t_1 = x / Math.tan(B);
double tmp;
if (F <= -0.037) {
tmp = (-1.0 / Math.sin(B)) - t_1;
} else if (F <= -4.4e-147) {
tmp = t_0;
} else if (F <= 3e-33) {
tmp = (F / (Math.sin(B) * (F + (1.0 / F)))) - t_1;
} else if (F <= 2600000.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((((F * F) + 2.0) + (x * 2.0)), -0.5)) - (x / B) t_1 = x / math.tan(B) tmp = 0 if F <= -0.037: tmp = (-1.0 / math.sin(B)) - t_1 elif F <= -4.4e-147: tmp = t_0 elif F <= 3e-33: tmp = (F / (math.sin(B) * (F + (1.0 / F)))) - t_1 elif F <= 2600000.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(Float64(F * F) + 2.0) + Float64(x * 2.0)) ^ -0.5)) - Float64(x / B)) t_1 = Float64(x / tan(B)) tmp = 0.0 if (F <= -0.037) tmp = Float64(Float64(-1.0 / sin(B)) - t_1); elseif (F <= -4.4e-147) tmp = t_0; elseif (F <= 3e-33) tmp = Float64(Float64(F / Float64(sin(B) * Float64(F + Float64(1.0 / F)))) - t_1); elseif (F <= 2600000.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)) * ((((F * F) + 2.0) + (x * 2.0)) ^ -0.5)) - (x / B); t_1 = x / tan(B); tmp = 0.0; if (F <= -0.037) tmp = (-1.0 / sin(B)) - t_1; elseif (F <= -4.4e-147) tmp = t_0; elseif (F <= 3e-33) tmp = (F / (sin(B) * (F + (1.0 / F)))) - t_1; elseif (F <= 2600000.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[(N[(F * F), $MachinePrecision] + 2.0), $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, -0.037], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[F, -4.4e-147], t$95$0, If[LessEqual[F, 3e-33], N[(N[(F / N[(N[Sin[B], $MachinePrecision] * N[(F + N[(1.0 / F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[F, 2600000.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(F \cdot F + 2\right) + x \cdot 2\right)}^{-0.5} - \frac{x}{B}\\
t_1 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -0.037:\\
\;\;\;\;\frac{-1}{\sin B} - t\_1\\
\mathbf{elif}\;F \leq -4.4 \cdot 10^{-147}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;F \leq 3 \cdot 10^{-33}:\\
\;\;\;\;\frac{F}{\sin B \cdot \left(F + \frac{1}{F}\right)} - t\_1\\
\mathbf{elif}\;F \leq 2600000:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_1\\
\end{array}
\end{array}
if F < -0.0369999999999999982Initial program 59.1%
Simplified74.6%
Taylor expanded in x around 0 74.8%
associate-*l/74.7%
*-lft-identity74.7%
+-commutative74.7%
unpow274.7%
fma-udef74.7%
Simplified74.7%
Taylor expanded in F around -inf 99.8%
if -0.0369999999999999982 < F < -4.4000000000000002e-147 or 3.0000000000000002e-33 < F < 2.6e6Initial program 99.5%
Taylor expanded in B around 0 87.0%
if -4.4000000000000002e-147 < F < 3.0000000000000002e-33Initial 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%
expm1-log1p-u90.5%
expm1-udef83.4%
associate-*r/83.4%
sqrt-div83.4%
metadata-eval83.4%
un-div-inv83.4%
Applied egg-rr83.4%
expm1-def90.5%
expm1-log1p99.6%
associate-/l/99.7%
Simplified99.7%
Taylor expanded in F around inf 91.3%
if 2.6e6 < F Initial program 58.2%
Simplified74.7%
Taylor expanded in x around 0 74.7%
associate-*l/74.7%
*-lft-identity74.7%
+-commutative74.7%
unpow274.7%
fma-udef74.7%
Simplified74.7%
Taylor expanded in F around inf 99.8%
Final simplification95.5%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -0.0037)
(- (/ -1.0 (sin B)) t_0)
(if (<= F -1.2e-145)
(- (* (/ F (sin B)) (sqrt (/ 1.0 (+ 2.0 (* x 2.0))))) (/ x B))
(- (/ F (* (sin B) (+ F (/ 1.0 F)))) t_0)))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -0.0037) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= -1.2e-145) {
tmp = ((F / sin(B)) * sqrt((1.0 / (2.0 + (x * 2.0))))) - (x / B);
} else {
tmp = (F / (sin(B) * (F + (1.0 / 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 <= (-0.0037d0)) then
tmp = ((-1.0d0) / sin(b)) - t_0
else if (f <= (-1.2d-145)) then
tmp = ((f / sin(b)) * sqrt((1.0d0 / (2.0d0 + (x * 2.0d0))))) - (x / b)
else
tmp = (f / (sin(b) * (f + (1.0d0 / 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 <= -0.0037) {
tmp = (-1.0 / Math.sin(B)) - t_0;
} else if (F <= -1.2e-145) {
tmp = ((F / Math.sin(B)) * Math.sqrt((1.0 / (2.0 + (x * 2.0))))) - (x / B);
} else {
tmp = (F / (Math.sin(B) * (F + (1.0 / F)))) - t_0;
}
return tmp;
}
def code(F, B, x): t_0 = x / math.tan(B) tmp = 0 if F <= -0.0037: tmp = (-1.0 / math.sin(B)) - t_0 elif F <= -1.2e-145: tmp = ((F / math.sin(B)) * math.sqrt((1.0 / (2.0 + (x * 2.0))))) - (x / B) else: tmp = (F / (math.sin(B) * (F + (1.0 / F)))) - t_0 return tmp
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -0.0037) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= -1.2e-145) tmp = Float64(Float64(Float64(F / sin(B)) * sqrt(Float64(1.0 / Float64(2.0 + Float64(x * 2.0))))) - Float64(x / B)); else tmp = Float64(Float64(F / Float64(sin(B) * Float64(F + Float64(1.0 / F)))) - t_0); end return tmp end
function tmp_2 = code(F, B, x) t_0 = x / tan(B); tmp = 0.0; if (F <= -0.0037) tmp = (-1.0 / sin(B)) - t_0; elseif (F <= -1.2e-145) tmp = ((F / sin(B)) * sqrt((1.0 / (2.0 + (x * 2.0))))) - (x / B); else tmp = (F / (sin(B) * (F + (1.0 / 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, -0.0037], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, -1.2e-145], N[(N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(1.0 / N[(2.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], N[(N[(F / N[(N[Sin[B], $MachinePrecision] * N[(F + N[(1.0 / 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 -0.0037:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq -1.2 \cdot 10^{-145}:\\
\;\;\;\;\frac{F}{\sin B} \cdot \sqrt{\frac{1}{2 + x \cdot 2}} - \frac{x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{F}{\sin B \cdot \left(F + \frac{1}{F}\right)} - t\_0\\
\end{array}
\end{array}
if F < -0.0037000000000000002Initial program 59.1%
Simplified74.6%
Taylor expanded in x around 0 74.8%
associate-*l/74.7%
*-lft-identity74.7%
+-commutative74.7%
unpow274.7%
fma-udef74.7%
Simplified74.7%
Taylor expanded in F around -inf 99.8%
if -0.0037000000000000002 < F < -1.20000000000000008e-145Initial program 99.6%
Taylor expanded in B around 0 83.7%
Taylor expanded in F around 0 82.3%
if -1.20000000000000008e-145 < F Initial program 78.4%
Simplified86.9%
Taylor expanded in x around 0 86.9%
associate-*l/86.9%
*-lft-identity86.9%
+-commutative86.9%
unpow286.9%
fma-udef86.9%
Simplified86.9%
expm1-log1p-u68.9%
expm1-udef64.9%
associate-*r/64.9%
sqrt-div64.9%
metadata-eval64.9%
un-div-inv64.9%
Applied egg-rr64.9%
expm1-def68.9%
expm1-log1p87.0%
associate-/l/87.0%
Simplified87.0%
Taylor expanded in F around inf 92.8%
Final simplification93.4%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -0.017)
(- (/ -1.0 (sin B)) t_0)
(if (<= F -1.92e-90)
(+
(* (pow (+ (+ (* F F) 2.0) (* x 2.0)) -0.5) (/ F B))
(* x (- (/ -1.0 B) (* B -0.3333333333333333))))
(- (/ F (* (sin B) (+ F (/ 1.0 F)))) t_0)))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -0.017) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= -1.92e-90) {
tmp = (pow((((F * F) + 2.0) + (x * 2.0)), -0.5) * (F / B)) + (x * ((-1.0 / B) - (B * -0.3333333333333333)));
} else {
tmp = (F / (sin(B) * (F + (1.0 / 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 <= (-0.017d0)) then
tmp = ((-1.0d0) / sin(b)) - t_0
else if (f <= (-1.92d-90)) then
tmp = (((((f * f) + 2.0d0) + (x * 2.0d0)) ** (-0.5d0)) * (f / b)) + (x * (((-1.0d0) / b) - (b * (-0.3333333333333333d0))))
else
tmp = (f / (sin(b) * (f + (1.0d0 / 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 <= -0.017) {
tmp = (-1.0 / Math.sin(B)) - t_0;
} else if (F <= -1.92e-90) {
tmp = (Math.pow((((F * F) + 2.0) + (x * 2.0)), -0.5) * (F / B)) + (x * ((-1.0 / B) - (B * -0.3333333333333333)));
} else {
tmp = (F / (Math.sin(B) * (F + (1.0 / F)))) - t_0;
}
return tmp;
}
def code(F, B, x): t_0 = x / math.tan(B) tmp = 0 if F <= -0.017: tmp = (-1.0 / math.sin(B)) - t_0 elif F <= -1.92e-90: tmp = (math.pow((((F * F) + 2.0) + (x * 2.0)), -0.5) * (F / B)) + (x * ((-1.0 / B) - (B * -0.3333333333333333))) else: tmp = (F / (math.sin(B) * (F + (1.0 / F)))) - t_0 return tmp
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -0.017) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= -1.92e-90) tmp = Float64(Float64((Float64(Float64(Float64(F * F) + 2.0) + Float64(x * 2.0)) ^ -0.5) * Float64(F / B)) + Float64(x * Float64(Float64(-1.0 / B) - Float64(B * -0.3333333333333333)))); else tmp = Float64(Float64(F / Float64(sin(B) * Float64(F + Float64(1.0 / F)))) - t_0); end return tmp end
function tmp_2 = code(F, B, x) t_0 = x / tan(B); tmp = 0.0; if (F <= -0.017) tmp = (-1.0 / sin(B)) - t_0; elseif (F <= -1.92e-90) tmp = (((((F * F) + 2.0) + (x * 2.0)) ^ -0.5) * (F / B)) + (x * ((-1.0 / B) - (B * -0.3333333333333333))); else tmp = (F / (sin(B) * (F + (1.0 / 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, -0.017], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, -1.92e-90], N[(N[(N[Power[N[(N[(N[(F * F), $MachinePrecision] + 2.0), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] * N[(F / B), $MachinePrecision]), $MachinePrecision] + N[(x * N[(N[(-1.0 / B), $MachinePrecision] - N[(B * -0.3333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(F / N[(N[Sin[B], $MachinePrecision] * N[(F + N[(1.0 / 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 -0.017:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq -1.92 \cdot 10^{-90}:\\
\;\;\;\;{\left(\left(F \cdot F + 2\right) + x \cdot 2\right)}^{-0.5} \cdot \frac{F}{B} + x \cdot \left(\frac{-1}{B} - B \cdot -0.3333333333333333\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{F}{\sin B \cdot \left(F + \frac{1}{F}\right)} - t\_0\\
\end{array}
\end{array}
if F < -0.017000000000000001Initial program 59.1%
Simplified74.6%
Taylor expanded in x around 0 74.8%
associate-*l/74.7%
*-lft-identity74.7%
+-commutative74.7%
unpow274.7%
fma-udef74.7%
Simplified74.7%
Taylor expanded in F around -inf 99.8%
if -0.017000000000000001 < F < -1.92000000000000009e-90Initial program 99.7%
Taylor expanded in B around 0 81.6%
Taylor expanded in B around 0 77.4%
if -1.92000000000000009e-90 < F Initial program 79.9%
Simplified87.9%
Taylor expanded in x around 0 87.8%
associate-*l/87.9%
*-lft-identity87.9%
+-commutative87.9%
unpow287.9%
fma-udef87.9%
Simplified87.9%
expm1-log1p-u69.9%
expm1-udef63.8%
associate-*r/63.8%
sqrt-div63.8%
metadata-eval63.8%
un-div-inv63.8%
Applied egg-rr63.8%
expm1-def69.9%
expm1-log1p87.9%
associate-/l/87.9%
Simplified87.9%
Taylor expanded in F around inf 89.2%
Final simplification91.2%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -0.018)
(- (/ -1.0 (sin B)) t_0)
(if (<= F -1.26e-85)
(+
(* (pow (+ (+ (* F F) 2.0) (* x 2.0)) -0.5) (/ F B))
(* x (- (/ -1.0 B) (* B -0.3333333333333333))))
(if (<= F 2.65e-76)
(* (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 <= -0.018) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= -1.26e-85) {
tmp = (pow((((F * F) + 2.0) + (x * 2.0)), -0.5) * (F / B)) + (x * ((-1.0 / B) - (B * -0.3333333333333333)));
} else if (F <= 2.65e-76) {
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 <= (-0.018d0)) then
tmp = ((-1.0d0) / sin(b)) - t_0
else if (f <= (-1.26d-85)) then
tmp = (((((f * f) + 2.0d0) + (x * 2.0d0)) ** (-0.5d0)) * (f / b)) + (x * (((-1.0d0) / b) - (b * (-0.3333333333333333d0))))
else if (f <= 2.65d-76) 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 <= -0.018) {
tmp = (-1.0 / Math.sin(B)) - t_0;
} else if (F <= -1.26e-85) {
tmp = (Math.pow((((F * F) + 2.0) + (x * 2.0)), -0.5) * (F / B)) + (x * ((-1.0 / B) - (B * -0.3333333333333333)));
} else if (F <= 2.65e-76) {
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 <= -0.018: tmp = (-1.0 / math.sin(B)) - t_0 elif F <= -1.26e-85: tmp = (math.pow((((F * F) + 2.0) + (x * 2.0)), -0.5) * (F / B)) + (x * ((-1.0 / B) - (B * -0.3333333333333333))) elif F <= 2.65e-76: 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 <= -0.018) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= -1.26e-85) tmp = Float64(Float64((Float64(Float64(Float64(F * F) + 2.0) + Float64(x * 2.0)) ^ -0.5) * Float64(F / B)) + Float64(x * Float64(Float64(-1.0 / B) - Float64(B * -0.3333333333333333)))); elseif (F <= 2.65e-76) tmp = Float64(cos(B) * Float64(Float64(-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 <= -0.018) tmp = (-1.0 / sin(B)) - t_0; elseif (F <= -1.26e-85) tmp = (((((F * F) + 2.0) + (x * 2.0)) ^ -0.5) * (F / B)) + (x * ((-1.0 / B) - (B * -0.3333333333333333))); elseif (F <= 2.65e-76) 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, -0.018], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, -1.26e-85], N[(N[(N[Power[N[(N[(N[(F * F), $MachinePrecision] + 2.0), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] * N[(F / B), $MachinePrecision]), $MachinePrecision] + N[(x * N[(N[(-1.0 / B), $MachinePrecision] - N[(B * -0.3333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 2.65e-76], N[(N[Cos[B], $MachinePrecision] * N[((-x) / N[Sin[B], $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 -0.018:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq -1.26 \cdot 10^{-85}:\\
\;\;\;\;{\left(\left(F \cdot F + 2\right) + x \cdot 2\right)}^{-0.5} \cdot \frac{F}{B} + x \cdot \left(\frac{-1}{B} - B \cdot -0.3333333333333333\right)\\
\mathbf{elif}\;F \leq 2.65 \cdot 10^{-76}:\\
\;\;\;\;\cos B \cdot \frac{-x}{\sin B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_0\\
\end{array}
\end{array}
if F < -0.0179999999999999986Initial program 59.1%
Simplified74.6%
Taylor expanded in x around 0 74.8%
associate-*l/74.7%
*-lft-identity74.7%
+-commutative74.7%
unpow274.7%
fma-udef74.7%
Simplified74.7%
Taylor expanded in F around -inf 99.8%
if -0.0179999999999999986 < F < -1.26e-85Initial program 99.7%
Taylor expanded in B around 0 81.6%
Taylor expanded in B around 0 77.4%
if -1.26e-85 < F < 2.65e-76Initial program 99.4%
Simplified99.7%
Taylor expanded in x around 0 99.6%
associate-*l/99.7%
*-lft-identity99.7%
+-commutative99.7%
unpow299.7%
fma-udef99.7%
Simplified99.7%
Taylor expanded in F around -inf 34.6%
Taylor expanded in x around inf 84.6%
associate-*l/84.6%
neg-mul-184.6%
distribute-rgt-neg-in84.6%
Simplified84.6%
if 2.65e-76 < F Initial program 66.0%
Simplified79.4%
Taylor expanded in x around 0 79.4%
associate-*l/79.4%
*-lft-identity79.4%
+-commutative79.4%
unpow279.4%
fma-udef79.4%
Simplified79.4%
Taylor expanded in F around inf 92.5%
Final simplification91.2%
(FPCore (F B x)
:precision binary64
(if (<= F -0.037)
(- (/ -1.0 (sin B)) (/ x B))
(if (<= F -8e-86)
(+
(* (pow (+ (+ (* F F) 2.0) (* x 2.0)) -0.5) (/ F B))
(* x (- (/ -1.0 B) (* B -0.3333333333333333))))
(if (<= F 1.9e-20)
(* (cos B) (/ (- x) (sin B)))
(if (<= F 8.5e+120)
(- (/ 1.0 (sin B)) (/ x B))
(- (/ 1.0 B) (/ x (tan B))))))))
double code(double F, double B, double x) {
double tmp;
if (F <= -0.037) {
tmp = (-1.0 / sin(B)) - (x / B);
} else if (F <= -8e-86) {
tmp = (pow((((F * F) + 2.0) + (x * 2.0)), -0.5) * (F / B)) + (x * ((-1.0 / B) - (B * -0.3333333333333333)));
} else if (F <= 1.9e-20) {
tmp = cos(B) * (-x / sin(B));
} else if (F <= 8.5e+120) {
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 <= (-0.037d0)) then
tmp = ((-1.0d0) / sin(b)) - (x / b)
else if (f <= (-8d-86)) then
tmp = (((((f * f) + 2.0d0) + (x * 2.0d0)) ** (-0.5d0)) * (f / b)) + (x * (((-1.0d0) / b) - (b * (-0.3333333333333333d0))))
else if (f <= 1.9d-20) then
tmp = cos(b) * (-x / sin(b))
else if (f <= 8.5d+120) 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 <= -0.037) {
tmp = (-1.0 / Math.sin(B)) - (x / B);
} else if (F <= -8e-86) {
tmp = (Math.pow((((F * F) + 2.0) + (x * 2.0)), -0.5) * (F / B)) + (x * ((-1.0 / B) - (B * -0.3333333333333333)));
} else if (F <= 1.9e-20) {
tmp = Math.cos(B) * (-x / Math.sin(B));
} else if (F <= 8.5e+120) {
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 <= -0.037: tmp = (-1.0 / math.sin(B)) - (x / B) elif F <= -8e-86: tmp = (math.pow((((F * F) + 2.0) + (x * 2.0)), -0.5) * (F / B)) + (x * ((-1.0 / B) - (B * -0.3333333333333333))) elif F <= 1.9e-20: tmp = math.cos(B) * (-x / math.sin(B)) elif F <= 8.5e+120: 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 <= -0.037) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B)); elseif (F <= -8e-86) tmp = Float64(Float64((Float64(Float64(Float64(F * F) + 2.0) + Float64(x * 2.0)) ^ -0.5) * Float64(F / B)) + Float64(x * Float64(Float64(-1.0 / B) - Float64(B * -0.3333333333333333)))); elseif (F <= 1.9e-20) tmp = Float64(cos(B) * Float64(Float64(-x) / sin(B))); elseif (F <= 8.5e+120) 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 <= -0.037) tmp = (-1.0 / sin(B)) - (x / B); elseif (F <= -8e-86) tmp = (((((F * F) + 2.0) + (x * 2.0)) ^ -0.5) * (F / B)) + (x * ((-1.0 / B) - (B * -0.3333333333333333))); elseif (F <= 1.9e-20) tmp = cos(B) * (-x / sin(B)); elseif (F <= 8.5e+120) 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[LessEqual[F, -0.037], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -8e-86], N[(N[(N[Power[N[(N[(N[(F * F), $MachinePrecision] + 2.0), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] * N[(F / B), $MachinePrecision]), $MachinePrecision] + N[(x * N[(N[(-1.0 / B), $MachinePrecision] - N[(B * -0.3333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.9e-20], N[(N[Cos[B], $MachinePrecision] * N[((-x) / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 8.5e+120], 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 -0.037:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\
\mathbf{elif}\;F \leq -8 \cdot 10^{-86}:\\
\;\;\;\;{\left(\left(F \cdot F + 2\right) + x \cdot 2\right)}^{-0.5} \cdot \frac{F}{B} + x \cdot \left(\frac{-1}{B} - B \cdot -0.3333333333333333\right)\\
\mathbf{elif}\;F \leq 1.9 \cdot 10^{-20}:\\
\;\;\;\;\cos B \cdot \frac{-x}{\sin B}\\
\mathbf{elif}\;F \leq 8.5 \cdot 10^{+120}:\\
\;\;\;\;\frac{1}{\sin B} - \frac{x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{B} - \frac{x}{\tan B}\\
\end{array}
\end{array}
if F < -0.0369999999999999982Initial program 59.1%
Taylor expanded in B around 0 38.8%
Taylor expanded in F around -inf 78.6%
distribute-lft-in78.6%
mul-1-neg78.6%
unsub-neg78.6%
associate-*r/78.6%
metadata-eval78.6%
Simplified78.6%
if -0.0369999999999999982 < F < -8.00000000000000068e-86Initial program 99.7%
Taylor expanded in B around 0 81.6%
Taylor expanded in B around 0 77.4%
if -8.00000000000000068e-86 < F < 1.8999999999999999e-20Initial program 99.4%
Simplified99.7%
Taylor expanded in x around 0 99.6%
associate-*l/99.7%
*-lft-identity99.7%
+-commutative99.7%
unpow299.7%
fma-udef99.7%
Simplified99.7%
Taylor expanded in F around -inf 39.7%
Taylor expanded in x around inf 83.9%
associate-*l/83.9%
neg-mul-183.9%
distribute-rgt-neg-in83.9%
Simplified83.9%
if 1.8999999999999999e-20 < F < 8.50000000000000026e120Initial program 94.2%
Taylor expanded in B around 0 88.7%
Taylor expanded in F around inf 79.7%
if 8.50000000000000026e120 < F Initial program 40.7%
Simplified62.0%
Taylor expanded in F around inf 99.6%
associate-/r*99.6%
Simplified99.6%
Taylor expanded in B around 0 82.9%
Final simplification81.1%
(FPCore (F B x)
:precision binary64
(if (<= F -0.037)
(- (/ -1.0 (sin B)) (/ x B))
(if (<= F -2.25e-88)
(+
(* (pow (+ (+ (* F F) 2.0) (* x 2.0)) -0.5) (/ F B))
(* x (- (/ -1.0 B) (* B -0.3333333333333333))))
(if (<= F 1.9e-20)
(/ (* (cos B) (- x)) (sin B))
(if (<= F 1.01e+121)
(- (/ 1.0 (sin B)) (/ x B))
(- (/ 1.0 B) (/ x (tan B))))))))
double code(double F, double B, double x) {
double tmp;
if (F <= -0.037) {
tmp = (-1.0 / sin(B)) - (x / B);
} else if (F <= -2.25e-88) {
tmp = (pow((((F * F) + 2.0) + (x * 2.0)), -0.5) * (F / B)) + (x * ((-1.0 / B) - (B * -0.3333333333333333)));
} else if (F <= 1.9e-20) {
tmp = (cos(B) * -x) / sin(B);
} else if (F <= 1.01e+121) {
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 <= (-0.037d0)) then
tmp = ((-1.0d0) / sin(b)) - (x / b)
else if (f <= (-2.25d-88)) then
tmp = (((((f * f) + 2.0d0) + (x * 2.0d0)) ** (-0.5d0)) * (f / b)) + (x * (((-1.0d0) / b) - (b * (-0.3333333333333333d0))))
else if (f <= 1.9d-20) then
tmp = (cos(b) * -x) / sin(b)
else if (f <= 1.01d+121) 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 <= -0.037) {
tmp = (-1.0 / Math.sin(B)) - (x / B);
} else if (F <= -2.25e-88) {
tmp = (Math.pow((((F * F) + 2.0) + (x * 2.0)), -0.5) * (F / B)) + (x * ((-1.0 / B) - (B * -0.3333333333333333)));
} else if (F <= 1.9e-20) {
tmp = (Math.cos(B) * -x) / Math.sin(B);
} else if (F <= 1.01e+121) {
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 <= -0.037: tmp = (-1.0 / math.sin(B)) - (x / B) elif F <= -2.25e-88: tmp = (math.pow((((F * F) + 2.0) + (x * 2.0)), -0.5) * (F / B)) + (x * ((-1.0 / B) - (B * -0.3333333333333333))) elif F <= 1.9e-20: tmp = (math.cos(B) * -x) / math.sin(B) elif F <= 1.01e+121: 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 <= -0.037) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B)); elseif (F <= -2.25e-88) tmp = Float64(Float64((Float64(Float64(Float64(F * F) + 2.0) + Float64(x * 2.0)) ^ -0.5) * Float64(F / B)) + Float64(x * Float64(Float64(-1.0 / B) - Float64(B * -0.3333333333333333)))); elseif (F <= 1.9e-20) tmp = Float64(Float64(cos(B) * Float64(-x)) / sin(B)); elseif (F <= 1.01e+121) 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 <= -0.037) tmp = (-1.0 / sin(B)) - (x / B); elseif (F <= -2.25e-88) tmp = (((((F * F) + 2.0) + (x * 2.0)) ^ -0.5) * (F / B)) + (x * ((-1.0 / B) - (B * -0.3333333333333333))); elseif (F <= 1.9e-20) tmp = (cos(B) * -x) / sin(B); elseif (F <= 1.01e+121) 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[LessEqual[F, -0.037], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -2.25e-88], N[(N[(N[Power[N[(N[(N[(F * F), $MachinePrecision] + 2.0), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] * N[(F / B), $MachinePrecision]), $MachinePrecision] + N[(x * N[(N[(-1.0 / B), $MachinePrecision] - N[(B * -0.3333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.9e-20], N[(N[(N[Cos[B], $MachinePrecision] * (-x)), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.01e+121], 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 -0.037:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\
\mathbf{elif}\;F \leq -2.25 \cdot 10^{-88}:\\
\;\;\;\;{\left(\left(F \cdot F + 2\right) + x \cdot 2\right)}^{-0.5} \cdot \frac{F}{B} + x \cdot \left(\frac{-1}{B} - B \cdot -0.3333333333333333\right)\\
\mathbf{elif}\;F \leq 1.9 \cdot 10^{-20}:\\
\;\;\;\;\frac{\cos B \cdot \left(-x\right)}{\sin B}\\
\mathbf{elif}\;F \leq 1.01 \cdot 10^{+121}:\\
\;\;\;\;\frac{1}{\sin B} - \frac{x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{B} - \frac{x}{\tan B}\\
\end{array}
\end{array}
if F < -0.0369999999999999982Initial program 59.1%
Taylor expanded in B around 0 38.8%
Taylor expanded in F around -inf 78.6%
distribute-lft-in78.6%
mul-1-neg78.6%
unsub-neg78.6%
associate-*r/78.6%
metadata-eval78.6%
Simplified78.6%
if -0.0369999999999999982 < F < -2.24999999999999996e-88Initial program 99.7%
Taylor expanded in B around 0 81.6%
Taylor expanded in B around 0 77.4%
if -2.24999999999999996e-88 < F < 1.8999999999999999e-20Initial program 99.4%
Taylor expanded in F around -inf 39.6%
Taylor expanded in x around inf 83.9%
associate-*r/83.9%
*-commutative83.9%
neg-mul-183.9%
distribute-rgt-neg-in83.9%
Simplified83.9%
if 1.8999999999999999e-20 < F < 1.01e121Initial program 94.2%
Taylor expanded in B around 0 88.7%
Taylor expanded in F around inf 79.7%
if 1.01e121 < F Initial program 40.7%
Simplified62.0%
Taylor expanded in F around inf 99.6%
associate-/r*99.6%
Simplified99.6%
Taylor expanded in B around 0 82.9%
Final simplification81.1%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -0.031)
(- (/ -1.0 (sin B)) t_0)
(if (<= F -4.4e-87)
(+
(* (pow (+ (+ (* F F) 2.0) (* x 2.0)) -0.5) (/ F B))
(* x (- (/ -1.0 B) (* B -0.3333333333333333))))
(if (<= F 1.9e-20)
(/ (* (cos B) (- x)) (sin B))
(if (<= F 7.4e+120)
(- (/ 1.0 (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.031) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= -4.4e-87) {
tmp = (pow((((F * F) + 2.0) + (x * 2.0)), -0.5) * (F / B)) + (x * ((-1.0 / B) - (B * -0.3333333333333333)));
} else if (F <= 1.9e-20) {
tmp = (cos(B) * -x) / sin(B);
} else if (F <= 7.4e+120) {
tmp = (1.0 / 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.031d0)) then
tmp = ((-1.0d0) / sin(b)) - t_0
else if (f <= (-4.4d-87)) then
tmp = (((((f * f) + 2.0d0) + (x * 2.0d0)) ** (-0.5d0)) * (f / b)) + (x * (((-1.0d0) / b) - (b * (-0.3333333333333333d0))))
else if (f <= 1.9d-20) then
tmp = (cos(b) * -x) / sin(b)
else if (f <= 7.4d+120) then
tmp = (1.0d0 / 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.031) {
tmp = (-1.0 / Math.sin(B)) - t_0;
} else if (F <= -4.4e-87) {
tmp = (Math.pow((((F * F) + 2.0) + (x * 2.0)), -0.5) * (F / B)) + (x * ((-1.0 / B) - (B * -0.3333333333333333)));
} else if (F <= 1.9e-20) {
tmp = (Math.cos(B) * -x) / Math.sin(B);
} else if (F <= 7.4e+120) {
tmp = (1.0 / 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.031: tmp = (-1.0 / math.sin(B)) - t_0 elif F <= -4.4e-87: tmp = (math.pow((((F * F) + 2.0) + (x * 2.0)), -0.5) * (F / B)) + (x * ((-1.0 / B) - (B * -0.3333333333333333))) elif F <= 1.9e-20: tmp = (math.cos(B) * -x) / math.sin(B) elif F <= 7.4e+120: tmp = (1.0 / 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.031) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= -4.4e-87) tmp = Float64(Float64((Float64(Float64(Float64(F * F) + 2.0) + Float64(x * 2.0)) ^ -0.5) * Float64(F / B)) + Float64(x * Float64(Float64(-1.0 / B) - Float64(B * -0.3333333333333333)))); elseif (F <= 1.9e-20) tmp = Float64(Float64(cos(B) * Float64(-x)) / sin(B)); elseif (F <= 7.4e+120) tmp = Float64(Float64(1.0 / 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.031) tmp = (-1.0 / sin(B)) - t_0; elseif (F <= -4.4e-87) tmp = (((((F * F) + 2.0) + (x * 2.0)) ^ -0.5) * (F / B)) + (x * ((-1.0 / B) - (B * -0.3333333333333333))); elseif (F <= 1.9e-20) tmp = (cos(B) * -x) / sin(B); elseif (F <= 7.4e+120) tmp = (1.0 / 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.031], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, -4.4e-87], N[(N[(N[Power[N[(N[(N[(F * F), $MachinePrecision] + 2.0), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] * N[(F / B), $MachinePrecision]), $MachinePrecision] + N[(x * N[(N[(-1.0 / B), $MachinePrecision] - N[(B * -0.3333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.9e-20], N[(N[(N[Cos[B], $MachinePrecision] * (-x)), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 7.4e+120], N[(N[(1.0 / N[Sin[B], $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.031:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq -4.4 \cdot 10^{-87}:\\
\;\;\;\;{\left(\left(F \cdot F + 2\right) + x \cdot 2\right)}^{-0.5} \cdot \frac{F}{B} + x \cdot \left(\frac{-1}{B} - B \cdot -0.3333333333333333\right)\\
\mathbf{elif}\;F \leq 1.9 \cdot 10^{-20}:\\
\;\;\;\;\frac{\cos B \cdot \left(-x\right)}{\sin B}\\
\mathbf{elif}\;F \leq 7.4 \cdot 10^{+120}:\\
\;\;\;\;\frac{1}{\sin B} - \frac{x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{B} - t\_0\\
\end{array}
\end{array}
if F < -0.031Initial program 59.1%
Simplified74.6%
Taylor expanded in x around 0 74.8%
associate-*l/74.7%
*-lft-identity74.7%
+-commutative74.7%
unpow274.7%
fma-udef74.7%
Simplified74.7%
Taylor expanded in F around -inf 99.8%
if -0.031 < F < -4.39999999999999976e-87Initial program 99.7%
Taylor expanded in B around 0 81.6%
Taylor expanded in B around 0 77.4%
if -4.39999999999999976e-87 < F < 1.8999999999999999e-20Initial program 99.4%
Taylor expanded in F around -inf 39.6%
Taylor expanded in x around inf 83.9%
associate-*r/83.9%
*-commutative83.9%
neg-mul-183.9%
distribute-rgt-neg-in83.9%
Simplified83.9%
if 1.8999999999999999e-20 < F < 7.40000000000000048e120Initial program 94.2%
Taylor expanded in B around 0 88.7%
Taylor expanded in F around inf 79.7%
if 7.40000000000000048e120 < F Initial program 40.7%
Simplified62.0%
Taylor expanded in F around inf 99.6%
associate-/r*99.6%
Simplified99.6%
Taylor expanded in B around 0 82.9%
Final simplification87.1%
(FPCore (F B x)
:precision binary64
(if (<= F -0.037)
(- (/ -1.0 (sin B)) (/ x B))
(if (<= F 5.3e-170)
(+
(* (pow (+ (+ (* F F) 2.0) (* x 2.0)) -0.5) (/ F B))
(* x (- (/ -1.0 B) (* B -0.3333333333333333))))
(if (or (<= F 1.85e-20) (not (<= F 8.2e+120)))
(- (/ 1.0 B) (/ x (tan B)))
(- (/ 1.0 (sin B)) (/ x B))))))
double code(double F, double B, double x) {
double tmp;
if (F <= -0.037) {
tmp = (-1.0 / sin(B)) - (x / B);
} else if (F <= 5.3e-170) {
tmp = (pow((((F * F) + 2.0) + (x * 2.0)), -0.5) * (F / B)) + (x * ((-1.0 / B) - (B * -0.3333333333333333)));
} else if ((F <= 1.85e-20) || !(F <= 8.2e+120)) {
tmp = (1.0 / B) - (x / tan(B));
} else {
tmp = (1.0 / sin(B)) - (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 <= (-0.037d0)) then
tmp = ((-1.0d0) / sin(b)) - (x / b)
else if (f <= 5.3d-170) then
tmp = (((((f * f) + 2.0d0) + (x * 2.0d0)) ** (-0.5d0)) * (f / b)) + (x * (((-1.0d0) / b) - (b * (-0.3333333333333333d0))))
else if ((f <= 1.85d-20) .or. (.not. (f <= 8.2d+120))) then
tmp = (1.0d0 / b) - (x / tan(b))
else
tmp = (1.0d0 / sin(b)) - (x / b)
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -0.037) {
tmp = (-1.0 / Math.sin(B)) - (x / B);
} else if (F <= 5.3e-170) {
tmp = (Math.pow((((F * F) + 2.0) + (x * 2.0)), -0.5) * (F / B)) + (x * ((-1.0 / B) - (B * -0.3333333333333333)));
} else if ((F <= 1.85e-20) || !(F <= 8.2e+120)) {
tmp = (1.0 / B) - (x / Math.tan(B));
} else {
tmp = (1.0 / Math.sin(B)) - (x / B);
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -0.037: tmp = (-1.0 / math.sin(B)) - (x / B) elif F <= 5.3e-170: tmp = (math.pow((((F * F) + 2.0) + (x * 2.0)), -0.5) * (F / B)) + (x * ((-1.0 / B) - (B * -0.3333333333333333))) elif (F <= 1.85e-20) or not (F <= 8.2e+120): tmp = (1.0 / B) - (x / math.tan(B)) else: tmp = (1.0 / math.sin(B)) - (x / B) return tmp
function code(F, B, x) tmp = 0.0 if (F <= -0.037) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B)); elseif (F <= 5.3e-170) tmp = Float64(Float64((Float64(Float64(Float64(F * F) + 2.0) + Float64(x * 2.0)) ^ -0.5) * Float64(F / B)) + Float64(x * Float64(Float64(-1.0 / B) - Float64(B * -0.3333333333333333)))); elseif ((F <= 1.85e-20) || !(F <= 8.2e+120)) tmp = Float64(Float64(1.0 / B) - Float64(x / tan(B))); else tmp = Float64(Float64(1.0 / sin(B)) - Float64(x / B)); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -0.037) tmp = (-1.0 / sin(B)) - (x / B); elseif (F <= 5.3e-170) tmp = (((((F * F) + 2.0) + (x * 2.0)) ^ -0.5) * (F / B)) + (x * ((-1.0 / B) - (B * -0.3333333333333333))); elseif ((F <= 1.85e-20) || ~((F <= 8.2e+120))) tmp = (1.0 / B) - (x / tan(B)); else tmp = (1.0 / sin(B)) - (x / B); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -0.037], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 5.3e-170], N[(N[(N[Power[N[(N[(N[(F * F), $MachinePrecision] + 2.0), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] * N[(F / B), $MachinePrecision]), $MachinePrecision] + N[(x * N[(N[(-1.0 / B), $MachinePrecision] - N[(B * -0.3333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[F, 1.85e-20], N[Not[LessEqual[F, 8.2e+120]], $MachinePrecision]], N[(N[(1.0 / B), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -0.037:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\
\mathbf{elif}\;F \leq 5.3 \cdot 10^{-170}:\\
\;\;\;\;{\left(\left(F \cdot F + 2\right) + x \cdot 2\right)}^{-0.5} \cdot \frac{F}{B} + x \cdot \left(\frac{-1}{B} - B \cdot -0.3333333333333333\right)\\
\mathbf{elif}\;F \leq 1.85 \cdot 10^{-20} \lor \neg \left(F \leq 8.2 \cdot 10^{+120}\right):\\
\;\;\;\;\frac{1}{B} - \frac{x}{\tan B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - \frac{x}{B}\\
\end{array}
\end{array}
if F < -0.0369999999999999982Initial program 59.1%
Taylor expanded in B around 0 38.8%
Taylor expanded in F around -inf 78.6%
distribute-lft-in78.6%
mul-1-neg78.6%
unsub-neg78.6%
associate-*r/78.6%
metadata-eval78.6%
Simplified78.6%
if -0.0369999999999999982 < F < 5.3e-170Initial program 99.5%
Taylor expanded in B around 0 62.8%
Taylor expanded in B around 0 61.7%
if 5.3e-170 < F < 1.85e-20 or 8.2e120 < F Initial program 57.3%
Simplified72.6%
Taylor expanded in F around inf 90.4%
associate-/r*90.4%
Simplified90.4%
Taylor expanded in B around 0 83.3%
if 1.85e-20 < F < 8.2e120Initial program 94.2%
Taylor expanded in B around 0 88.7%
Taylor expanded in F around inf 79.7%
Final simplification74.9%
(FPCore (F B x)
:precision binary64
(if (<= F -7500.0)
(- (/ -1.0 (sin B)) (/ x B))
(if (<= F 7.8e-168)
(-
(*
(pow (+ (+ (* F F) 2.0) (* x 2.0)) -0.5)
(+ (/ F B) (* 0.16666666666666666 (* F B))))
(/ x B))
(if (or (<= F 1.9e-20) (not (<= F 7.5e+120)))
(- (/ 1.0 B) (/ x (tan B)))
(- (/ 1.0 (sin B)) (/ x B))))))
double code(double F, double B, double x) {
double tmp;
if (F <= -7500.0) {
tmp = (-1.0 / sin(B)) - (x / B);
} else if (F <= 7.8e-168) {
tmp = (pow((((F * F) + 2.0) + (x * 2.0)), -0.5) * ((F / B) + (0.16666666666666666 * (F * B)))) - (x / B);
} else if ((F <= 1.9e-20) || !(F <= 7.5e+120)) {
tmp = (1.0 / B) - (x / tan(B));
} else {
tmp = (1.0 / sin(B)) - (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 <= (-7500.0d0)) then
tmp = ((-1.0d0) / sin(b)) - (x / b)
else if (f <= 7.8d-168) then
tmp = (((((f * f) + 2.0d0) + (x * 2.0d0)) ** (-0.5d0)) * ((f / b) + (0.16666666666666666d0 * (f * b)))) - (x / b)
else if ((f <= 1.9d-20) .or. (.not. (f <= 7.5d+120))) then
tmp = (1.0d0 / b) - (x / tan(b))
else
tmp = (1.0d0 / sin(b)) - (x / b)
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -7500.0) {
tmp = (-1.0 / Math.sin(B)) - (x / B);
} else if (F <= 7.8e-168) {
tmp = (Math.pow((((F * F) + 2.0) + (x * 2.0)), -0.5) * ((F / B) + (0.16666666666666666 * (F * B)))) - (x / B);
} else if ((F <= 1.9e-20) || !(F <= 7.5e+120)) {
tmp = (1.0 / B) - (x / Math.tan(B));
} else {
tmp = (1.0 / Math.sin(B)) - (x / B);
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -7500.0: tmp = (-1.0 / math.sin(B)) - (x / B) elif F <= 7.8e-168: tmp = (math.pow((((F * F) + 2.0) + (x * 2.0)), -0.5) * ((F / B) + (0.16666666666666666 * (F * B)))) - (x / B) elif (F <= 1.9e-20) or not (F <= 7.5e+120): tmp = (1.0 / B) - (x / math.tan(B)) else: tmp = (1.0 / math.sin(B)) - (x / B) return tmp
function code(F, B, x) tmp = 0.0 if (F <= -7500.0) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B)); elseif (F <= 7.8e-168) tmp = Float64(Float64((Float64(Float64(Float64(F * F) + 2.0) + Float64(x * 2.0)) ^ -0.5) * Float64(Float64(F / B) + Float64(0.16666666666666666 * Float64(F * B)))) - Float64(x / B)); elseif ((F <= 1.9e-20) || !(F <= 7.5e+120)) tmp = Float64(Float64(1.0 / B) - Float64(x / tan(B))); else tmp = Float64(Float64(1.0 / sin(B)) - Float64(x / B)); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -7500.0) tmp = (-1.0 / sin(B)) - (x / B); elseif (F <= 7.8e-168) tmp = (((((F * F) + 2.0) + (x * 2.0)) ^ -0.5) * ((F / B) + (0.16666666666666666 * (F * B)))) - (x / B); elseif ((F <= 1.9e-20) || ~((F <= 7.5e+120))) tmp = (1.0 / B) - (x / tan(B)); else tmp = (1.0 / sin(B)) - (x / B); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -7500.0], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 7.8e-168], N[(N[(N[Power[N[(N[(N[(F * F), $MachinePrecision] + 2.0), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] * N[(N[(F / B), $MachinePrecision] + N[(0.16666666666666666 * N[(F * B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[F, 1.9e-20], N[Not[LessEqual[F, 7.5e+120]], $MachinePrecision]], N[(N[(1.0 / B), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -7500:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\
\mathbf{elif}\;F \leq 7.8 \cdot 10^{-168}:\\
\;\;\;\;{\left(\left(F \cdot F + 2\right) + x \cdot 2\right)}^{-0.5} \cdot \left(\frac{F}{B} + 0.16666666666666666 \cdot \left(F \cdot B\right)\right) - \frac{x}{B}\\
\mathbf{elif}\;F \leq 1.9 \cdot 10^{-20} \lor \neg \left(F \leq 7.5 \cdot 10^{+120}\right):\\
\;\;\;\;\frac{1}{B} - \frac{x}{\tan B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - \frac{x}{B}\\
\end{array}
\end{array}
if F < -7500Initial program 58.6%
Taylor expanded in B around 0 39.3%
Taylor expanded in F around -inf 79.7%
distribute-lft-in79.7%
mul-1-neg79.7%
unsub-neg79.7%
associate-*r/79.7%
metadata-eval79.7%
Simplified79.7%
if -7500 < F < 7.80000000000000025e-168Initial program 99.4%
Taylor expanded in B around 0 71.3%
Taylor expanded in B around 0 61.0%
if 7.80000000000000025e-168 < F < 1.8999999999999999e-20 or 7.5000000000000006e120 < F Initial program 57.3%
Simplified72.6%
Taylor expanded in F around inf 90.4%
associate-/r*90.4%
Simplified90.4%
Taylor expanded in B around 0 83.3%
if 1.8999999999999999e-20 < F < 7.5000000000000006e120Initial program 94.2%
Taylor expanded in B around 0 88.7%
Taylor expanded in F around inf 79.7%
Final simplification74.9%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -4500000.0)
(- (/ -1.0 (sin B)) (/ x B))
(if (<= F -8.6e-216)
(- (/ -1.0 B) t_0)
(if (<= F 5.3e-295)
(/ (- x) B)
(if (or (<= F 1.8e-20) (not (<= F 6e+120)))
(- (/ 1.0 B) t_0)
(- (/ 1.0 (sin B)) (/ x B))))))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -4500000.0) {
tmp = (-1.0 / sin(B)) - (x / B);
} else if (F <= -8.6e-216) {
tmp = (-1.0 / B) - t_0;
} else if (F <= 5.3e-295) {
tmp = -x / B;
} else if ((F <= 1.8e-20) || !(F <= 6e+120)) {
tmp = (1.0 / B) - t_0;
} else {
tmp = (1.0 / sin(B)) - (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) :: t_0
real(8) :: tmp
t_0 = x / tan(b)
if (f <= (-4500000.0d0)) then
tmp = ((-1.0d0) / sin(b)) - (x / b)
else if (f <= (-8.6d-216)) then
tmp = ((-1.0d0) / b) - t_0
else if (f <= 5.3d-295) then
tmp = -x / b
else if ((f <= 1.8d-20) .or. (.not. (f <= 6d+120))) then
tmp = (1.0d0 / b) - t_0
else
tmp = (1.0d0 / sin(b)) - (x / b)
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 <= -4500000.0) {
tmp = (-1.0 / Math.sin(B)) - (x / B);
} else if (F <= -8.6e-216) {
tmp = (-1.0 / B) - t_0;
} else if (F <= 5.3e-295) {
tmp = -x / B;
} else if ((F <= 1.8e-20) || !(F <= 6e+120)) {
tmp = (1.0 / B) - t_0;
} else {
tmp = (1.0 / Math.sin(B)) - (x / B);
}
return tmp;
}
def code(F, B, x): t_0 = x / math.tan(B) tmp = 0 if F <= -4500000.0: tmp = (-1.0 / math.sin(B)) - (x / B) elif F <= -8.6e-216: tmp = (-1.0 / B) - t_0 elif F <= 5.3e-295: tmp = -x / B elif (F <= 1.8e-20) or not (F <= 6e+120): tmp = (1.0 / B) - t_0 else: tmp = (1.0 / math.sin(B)) - (x / B) return tmp
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -4500000.0) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B)); elseif (F <= -8.6e-216) tmp = Float64(Float64(-1.0 / B) - t_0); elseif (F <= 5.3e-295) tmp = Float64(Float64(-x) / B); elseif ((F <= 1.8e-20) || !(F <= 6e+120)) tmp = Float64(Float64(1.0 / B) - t_0); else tmp = Float64(Float64(1.0 / sin(B)) - Float64(x / B)); end return tmp end
function tmp_2 = code(F, B, x) t_0 = x / tan(B); tmp = 0.0; if (F <= -4500000.0) tmp = (-1.0 / sin(B)) - (x / B); elseif (F <= -8.6e-216) tmp = (-1.0 / B) - t_0; elseif (F <= 5.3e-295) tmp = -x / B; elseif ((F <= 1.8e-20) || ~((F <= 6e+120))) tmp = (1.0 / B) - t_0; else tmp = (1.0 / sin(B)) - (x / B); end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -4500000.0], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -8.6e-216], N[(N[(-1.0 / B), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 5.3e-295], N[((-x) / B), $MachinePrecision], If[Or[LessEqual[F, 1.8e-20], N[Not[LessEqual[F, 6e+120]], $MachinePrecision]], N[(N[(1.0 / B), $MachinePrecision] - t$95$0), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -4500000:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\
\mathbf{elif}\;F \leq -8.6 \cdot 10^{-216}:\\
\;\;\;\;\frac{-1}{B} - t\_0\\
\mathbf{elif}\;F \leq 5.3 \cdot 10^{-295}:\\
\;\;\;\;\frac{-x}{B}\\
\mathbf{elif}\;F \leq 1.8 \cdot 10^{-20} \lor \neg \left(F \leq 6 \cdot 10^{+120}\right):\\
\;\;\;\;\frac{1}{B} - t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - \frac{x}{B}\\
\end{array}
\end{array}
if F < -4.5e6Initial program 58.6%
Taylor expanded in B around 0 39.3%
Taylor expanded in F around -inf 79.7%
distribute-lft-in79.7%
mul-1-neg79.7%
unsub-neg79.7%
associate-*r/79.7%
metadata-eval79.7%
Simplified79.7%
if -4.5e6 < F < -8.5999999999999995e-216Initial program 99.6%
Simplified99.7%
Taylor expanded in x around 0 99.2%
associate-*l/99.3%
*-lft-identity99.3%
+-commutative99.3%
unpow299.3%
fma-udef99.3%
Simplified99.3%
Taylor expanded in F around -inf 30.7%
Taylor expanded in B around 0 42.2%
if -8.5999999999999995e-216 < F < 5.3000000000000004e-295Initial program 99.5%
Simplified99.8%
Taylor expanded in F around inf 11.7%
associate-/r*11.7%
Simplified11.7%
Taylor expanded in B around 0 30.1%
Taylor expanded in x around inf 81.0%
neg-mul-181.0%
distribute-neg-frac81.0%
Simplified81.0%
if 5.3000000000000004e-295 < F < 1.79999999999999987e-20 or 6e120 < F Initial program 65.4%
Simplified77.8%
Taylor expanded in F around inf 78.4%
associate-/r*78.4%
Simplified78.4%
Taylor expanded in B around 0 76.6%
if 1.79999999999999987e-20 < F < 6e120Initial program 94.2%
Taylor expanded in B around 0 88.7%
Taylor expanded in F around inf 79.7%
Final simplification72.6%
(FPCore (F B x)
:precision binary64
(if (<= F -0.037)
(- (/ -1.0 (sin B)) (/ x B))
(if (<= F 1.85e-297)
(- (* (pow (+ (+ (* F F) 2.0) (* x 2.0)) -0.5) (/ F B)) (/ x B))
(if (or (<= F 4.6e-22) (not (<= F 1.01e+121)))
(- (/ 1.0 B) (/ x (tan B)))
(- (/ 1.0 (sin B)) (/ x B))))))
double code(double F, double B, double x) {
double tmp;
if (F <= -0.037) {
tmp = (-1.0 / sin(B)) - (x / B);
} else if (F <= 1.85e-297) {
tmp = (pow((((F * F) + 2.0) + (x * 2.0)), -0.5) * (F / B)) - (x / B);
} else if ((F <= 4.6e-22) || !(F <= 1.01e+121)) {
tmp = (1.0 / B) - (x / tan(B));
} else {
tmp = (1.0 / sin(B)) - (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 <= (-0.037d0)) then
tmp = ((-1.0d0) / sin(b)) - (x / b)
else if (f <= 1.85d-297) then
tmp = (((((f * f) + 2.0d0) + (x * 2.0d0)) ** (-0.5d0)) * (f / b)) - (x / b)
else if ((f <= 4.6d-22) .or. (.not. (f <= 1.01d+121))) then
tmp = (1.0d0 / b) - (x / tan(b))
else
tmp = (1.0d0 / sin(b)) - (x / b)
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -0.037) {
tmp = (-1.0 / Math.sin(B)) - (x / B);
} else if (F <= 1.85e-297) {
tmp = (Math.pow((((F * F) + 2.0) + (x * 2.0)), -0.5) * (F / B)) - (x / B);
} else if ((F <= 4.6e-22) || !(F <= 1.01e+121)) {
tmp = (1.0 / B) - (x / Math.tan(B));
} else {
tmp = (1.0 / Math.sin(B)) - (x / B);
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -0.037: tmp = (-1.0 / math.sin(B)) - (x / B) elif F <= 1.85e-297: tmp = (math.pow((((F * F) + 2.0) + (x * 2.0)), -0.5) * (F / B)) - (x / B) elif (F <= 4.6e-22) or not (F <= 1.01e+121): tmp = (1.0 / B) - (x / math.tan(B)) else: tmp = (1.0 / math.sin(B)) - (x / B) return tmp
function code(F, B, x) tmp = 0.0 if (F <= -0.037) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B)); elseif (F <= 1.85e-297) tmp = Float64(Float64((Float64(Float64(Float64(F * F) + 2.0) + Float64(x * 2.0)) ^ -0.5) * Float64(F / B)) - Float64(x / B)); elseif ((F <= 4.6e-22) || !(F <= 1.01e+121)) tmp = Float64(Float64(1.0 / B) - Float64(x / tan(B))); else tmp = Float64(Float64(1.0 / sin(B)) - Float64(x / B)); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -0.037) tmp = (-1.0 / sin(B)) - (x / B); elseif (F <= 1.85e-297) tmp = (((((F * F) + 2.0) + (x * 2.0)) ^ -0.5) * (F / B)) - (x / B); elseif ((F <= 4.6e-22) || ~((F <= 1.01e+121))) tmp = (1.0 / B) - (x / tan(B)); else tmp = (1.0 / sin(B)) - (x / B); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -0.037], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.85e-297], N[(N[(N[Power[N[(N[(N[(F * F), $MachinePrecision] + 2.0), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] * N[(F / B), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[F, 4.6e-22], N[Not[LessEqual[F, 1.01e+121]], $MachinePrecision]], N[(N[(1.0 / B), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -0.037:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\
\mathbf{elif}\;F \leq 1.85 \cdot 10^{-297}:\\
\;\;\;\;{\left(\left(F \cdot F + 2\right) + x \cdot 2\right)}^{-0.5} \cdot \frac{F}{B} - \frac{x}{B}\\
\mathbf{elif}\;F \leq 4.6 \cdot 10^{-22} \lor \neg \left(F \leq 1.01 \cdot 10^{+121}\right):\\
\;\;\;\;\frac{1}{B} - \frac{x}{\tan B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - \frac{x}{B}\\
\end{array}
\end{array}
if F < -0.0369999999999999982Initial program 59.1%
Taylor expanded in B around 0 38.8%
Taylor expanded in F around -inf 78.6%
distribute-lft-in78.6%
mul-1-neg78.6%
unsub-neg78.6%
associate-*r/78.6%
metadata-eval78.6%
Simplified78.6%
if -0.0369999999999999982 < F < 1.85e-297Initial program 99.5%
Taylor expanded in B around 0 78.1%
Taylor expanded in B around 0 65.1%
if 1.85e-297 < F < 4.5999999999999996e-22 or 1.01e121 < F Initial program 65.4%
Simplified77.8%
Taylor expanded in F around inf 78.4%
associate-/r*78.4%
Simplified78.4%
Taylor expanded in B around 0 76.6%
if 4.5999999999999996e-22 < F < 1.01e121Initial program 94.2%
Taylor expanded in B around 0 88.7%
Taylor expanded in F around inf 79.7%
Final simplification74.9%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -105000.0)
(- (/ -1.0 (sin B)) (/ x B))
(if (<= F -5e-211)
(- (/ -1.0 B) t_0)
(if (<= F 3.4e-294) (/ (- 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 <= -105000.0) {
tmp = (-1.0 / sin(B)) - (x / B);
} else if (F <= -5e-211) {
tmp = (-1.0 / B) - t_0;
} else if (F <= 3.4e-294) {
tmp = -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 <= (-105000.0d0)) then
tmp = ((-1.0d0) / sin(b)) - (x / b)
else if (f <= (-5d-211)) then
tmp = ((-1.0d0) / b) - t_0
else if (f <= 3.4d-294) then
tmp = -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 <= -105000.0) {
tmp = (-1.0 / Math.sin(B)) - (x / B);
} else if (F <= -5e-211) {
tmp = (-1.0 / B) - t_0;
} else if (F <= 3.4e-294) {
tmp = -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 <= -105000.0: tmp = (-1.0 / math.sin(B)) - (x / B) elif F <= -5e-211: tmp = (-1.0 / B) - t_0 elif F <= 3.4e-294: tmp = -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 <= -105000.0) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B)); elseif (F <= -5e-211) tmp = Float64(Float64(-1.0 / B) - t_0); elseif (F <= 3.4e-294) tmp = Float64(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 <= -105000.0) tmp = (-1.0 / sin(B)) - (x / B); elseif (F <= -5e-211) tmp = (-1.0 / B) - t_0; elseif (F <= 3.4e-294) tmp = -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, -105000.0], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -5e-211], N[(N[(-1.0 / B), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 3.4e-294], N[((-x) / B), $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 -105000:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\
\mathbf{elif}\;F \leq -5 \cdot 10^{-211}:\\
\;\;\;\;\frac{-1}{B} - t\_0\\
\mathbf{elif}\;F \leq 3.4 \cdot 10^{-294}:\\
\;\;\;\;\frac{-x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{B} - t\_0\\
\end{array}
\end{array}
if F < -105000Initial program 58.6%
Taylor expanded in B around 0 39.3%
Taylor expanded in F around -inf 79.7%
distribute-lft-in79.7%
mul-1-neg79.7%
unsub-neg79.7%
associate-*r/79.7%
metadata-eval79.7%
Simplified79.7%
if -105000 < F < -5.0000000000000002e-211Initial program 99.6%
Simplified99.7%
Taylor expanded in x around 0 99.2%
associate-*l/99.3%
*-lft-identity99.3%
+-commutative99.3%
unpow299.3%
fma-udef99.3%
Simplified99.3%
Taylor expanded in F around -inf 30.7%
Taylor expanded in B around 0 42.2%
if -5.0000000000000002e-211 < F < 3.39999999999999981e-294Initial program 99.5%
Simplified99.8%
Taylor expanded in F around inf 11.7%
associate-/r*11.7%
Simplified11.7%
Taylor expanded in B around 0 30.1%
Taylor expanded in x around inf 81.0%
neg-mul-181.0%
distribute-neg-frac81.0%
Simplified81.0%
if 3.39999999999999981e-294 < F Initial program 73.6%
Simplified84.0%
Taylor expanded in F around inf 80.3%
associate-/r*80.3%
Simplified80.3%
Taylor expanded in B around 0 70.4%
Final simplification69.2%
(FPCore (F B x) :precision binary64 (if (or (<= x -8e-79) (not (<= x 1.5e-35))) (- (/ -1.0 B) (/ x (tan B))) (- (/ -1.0 (sin B)) (/ x B))))
double code(double F, double B, double x) {
double tmp;
if ((x <= -8e-79) || !(x <= 1.5e-35)) {
tmp = (-1.0 / B) - (x / tan(B));
} else {
tmp = (-1.0 / sin(B)) - (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 ((x <= (-8d-79)) .or. (.not. (x <= 1.5d-35))) then
tmp = ((-1.0d0) / b) - (x / tan(b))
else
tmp = ((-1.0d0) / sin(b)) - (x / b)
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if ((x <= -8e-79) || !(x <= 1.5e-35)) {
tmp = (-1.0 / B) - (x / Math.tan(B));
} else {
tmp = (-1.0 / Math.sin(B)) - (x / B);
}
return tmp;
}
def code(F, B, x): tmp = 0 if (x <= -8e-79) or not (x <= 1.5e-35): tmp = (-1.0 / B) - (x / math.tan(B)) else: tmp = (-1.0 / math.sin(B)) - (x / B) return tmp
function code(F, B, x) tmp = 0.0 if ((x <= -8e-79) || !(x <= 1.5e-35)) tmp = Float64(Float64(-1.0 / B) - Float64(x / tan(B))); else tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B)); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if ((x <= -8e-79) || ~((x <= 1.5e-35))) tmp = (-1.0 / B) - (x / tan(B)); else tmp = (-1.0 / sin(B)) - (x / B); end tmp_2 = tmp; end
code[F_, B_, x_] := If[Or[LessEqual[x, -8e-79], N[Not[LessEqual[x, 1.5e-35]], $MachinePrecision]], N[(N[(-1.0 / B), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -8 \cdot 10^{-79} \lor \neg \left(x \leq 1.5 \cdot 10^{-35}\right):\\
\;\;\;\;\frac{-1}{B} - \frac{x}{\tan B}\\
\mathbf{else}:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\
\end{array}
\end{array}
if x < -8e-79 or 1.49999999999999994e-35 < x Initial program 81.2%
Simplified94.1%
Taylor expanded in x around 0 94.0%
associate-*l/94.0%
*-lft-identity94.0%
+-commutative94.0%
unpow294.0%
fma-udef94.0%
Simplified94.0%
Taylor expanded in F around -inf 80.1%
Taylor expanded in B around 0 82.8%
if -8e-79 < x < 1.49999999999999994e-35Initial program 68.4%
Taylor expanded in B around 0 62.4%
Taylor expanded in F around -inf 31.6%
distribute-lft-in31.6%
mul-1-neg31.6%
unsub-neg31.6%
associate-*r/31.6%
metadata-eval31.6%
Simplified31.6%
Final simplification61.0%
(FPCore (F B x) :precision binary64 (if (<= B 5.2e-216) (/ (- x) B) (if (<= B 1.7e-53) (/ (- 1.0 x) B) (- (/ -1.0 B) (/ x (tan B))))))
double code(double F, double B, double x) {
double tmp;
if (B <= 5.2e-216) {
tmp = -x / B;
} else if (B <= 1.7e-53) {
tmp = (1.0 - 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 (b <= 5.2d-216) then
tmp = -x / b
else if (b <= 1.7d-53) then
tmp = (1.0d0 - 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 (B <= 5.2e-216) {
tmp = -x / B;
} else if (B <= 1.7e-53) {
tmp = (1.0 - x) / B;
} else {
tmp = (-1.0 / B) - (x / Math.tan(B));
}
return tmp;
}
def code(F, B, x): tmp = 0 if B <= 5.2e-216: tmp = -x / B elif B <= 1.7e-53: tmp = (1.0 - x) / B else: tmp = (-1.0 / B) - (x / math.tan(B)) return tmp
function code(F, B, x) tmp = 0.0 if (B <= 5.2e-216) tmp = Float64(Float64(-x) / B); elseif (B <= 1.7e-53) tmp = Float64(Float64(1.0 - 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 (B <= 5.2e-216) tmp = -x / B; elseif (B <= 1.7e-53) tmp = (1.0 - x) / B; else tmp = (-1.0 / B) - (x / tan(B)); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[B, 5.2e-216], N[((-x) / B), $MachinePrecision], If[LessEqual[B, 1.7e-53], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision], N[(N[(-1.0 / B), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;B \leq 5.2 \cdot 10^{-216}:\\
\;\;\;\;\frac{-x}{B}\\
\mathbf{elif}\;B \leq 1.7 \cdot 10^{-53}:\\
\;\;\;\;\frac{1 - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{-1}{B} - \frac{x}{\tan B}\\
\end{array}
\end{array}
if B < 5.1999999999999997e-216Initial program 72.8%
Simplified83.5%
Taylor expanded in F around inf 52.7%
associate-/r*52.7%
Simplified52.7%
Taylor expanded in B around 0 31.5%
Taylor expanded in x around inf 35.4%
neg-mul-135.4%
distribute-neg-frac35.4%
Simplified35.4%
if 5.1999999999999997e-216 < B < 1.7e-53Initial program 65.9%
Simplified82.1%
Taylor expanded in F around inf 68.1%
associate-/r*68.0%
Simplified68.0%
Taylor expanded in B around 0 69.8%
if 1.7e-53 < B Initial program 87.1%
Simplified90.1%
Taylor expanded in x around 0 90.2%
associate-*l/90.1%
*-lft-identity90.1%
+-commutative90.1%
unpow290.1%
fma-udef90.1%
Simplified90.1%
Taylor expanded in F around -inf 57.2%
Taylor expanded in B around 0 54.4%
Final simplification45.6%
(FPCore (F B x)
:precision binary64
(if (<= F -6.3e-9)
(/ (- -1.0 x) B)
(if (<= F 9.5e-15)
(* x (- (/ -1.0 B) (* B -0.3333333333333333)))
(/ (- 1.0 x) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -6.3e-9) {
tmp = (-1.0 - x) / B;
} else if (F <= 9.5e-15) {
tmp = x * ((-1.0 / B) - (B * -0.3333333333333333));
} 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 <= (-6.3d-9)) then
tmp = ((-1.0d0) - x) / b
else if (f <= 9.5d-15) then
tmp = x * (((-1.0d0) / b) - (b * (-0.3333333333333333d0)))
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 <= -6.3e-9) {
tmp = (-1.0 - x) / B;
} else if (F <= 9.5e-15) {
tmp = x * ((-1.0 / B) - (B * -0.3333333333333333));
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -6.3e-9: tmp = (-1.0 - x) / B elif F <= 9.5e-15: tmp = x * ((-1.0 / B) - (B * -0.3333333333333333)) else: tmp = (1.0 - x) / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= -6.3e-9) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= 9.5e-15) tmp = Float64(x * Float64(Float64(-1.0 / B) - Float64(B * -0.3333333333333333))); else tmp = Float64(Float64(1.0 - x) / B); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -6.3e-9) tmp = (-1.0 - x) / B; elseif (F <= 9.5e-15) tmp = x * ((-1.0 / B) - (B * -0.3333333333333333)); else tmp = (1.0 - x) / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -6.3e-9], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 9.5e-15], N[(x * N[(N[(-1.0 / B), $MachinePrecision] - N[(B * -0.3333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -6.3 \cdot 10^{-9}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq 9.5 \cdot 10^{-15}:\\
\;\;\;\;x \cdot \left(\frac{-1}{B} - B \cdot -0.3333333333333333\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -6.3000000000000002e-9Initial program 59.7%
Taylor expanded in F around -inf 98.4%
Taylor expanded in B around 0 46.3%
associate-*r/46.3%
distribute-lft-in46.3%
metadata-eval46.3%
neg-mul-146.3%
Simplified46.3%
if -6.3000000000000002e-9 < F < 9.5000000000000005e-15Initial program 99.5%
Taylor expanded in B around 0 56.0%
Taylor expanded in F around inf 24.0%
Taylor expanded in x around inf 43.7%
if 9.5000000000000005e-15 < F Initial program 60.7%
Simplified76.2%
Taylor expanded in F around inf 94.5%
associate-/r*94.4%
Simplified94.4%
Taylor expanded in B around 0 51.3%
Final simplification46.8%
(FPCore (F B x)
:precision binary64
(if (<= F -1.85e-9)
(+ (/ (- -1.0 x) B) (* B (- (* x 0.3333333333333333) 0.16666666666666666)))
(if (<= F 1.15e-14)
(* x (- (/ -1.0 B) (* B -0.3333333333333333)))
(/ (- 1.0 x) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -1.85e-9) {
tmp = ((-1.0 - x) / B) + (B * ((x * 0.3333333333333333) - 0.16666666666666666));
} else if (F <= 1.15e-14) {
tmp = x * ((-1.0 / B) - (B * -0.3333333333333333));
} 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 <= (-1.85d-9)) then
tmp = (((-1.0d0) - x) / b) + (b * ((x * 0.3333333333333333d0) - 0.16666666666666666d0))
else if (f <= 1.15d-14) then
tmp = x * (((-1.0d0) / b) - (b * (-0.3333333333333333d0)))
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 <= -1.85e-9) {
tmp = ((-1.0 - x) / B) + (B * ((x * 0.3333333333333333) - 0.16666666666666666));
} else if (F <= 1.15e-14) {
tmp = x * ((-1.0 / B) - (B * -0.3333333333333333));
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -1.85e-9: tmp = ((-1.0 - x) / B) + (B * ((x * 0.3333333333333333) - 0.16666666666666666)) elif F <= 1.15e-14: tmp = x * ((-1.0 / B) - (B * -0.3333333333333333)) else: tmp = (1.0 - x) / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= -1.85e-9) tmp = Float64(Float64(Float64(-1.0 - x) / B) + Float64(B * Float64(Float64(x * 0.3333333333333333) - 0.16666666666666666))); elseif (F <= 1.15e-14) tmp = Float64(x * Float64(Float64(-1.0 / B) - Float64(B * -0.3333333333333333))); else tmp = Float64(Float64(1.0 - x) / B); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -1.85e-9) tmp = ((-1.0 - x) / B) + (B * ((x * 0.3333333333333333) - 0.16666666666666666)); elseif (F <= 1.15e-14) tmp = x * ((-1.0 / B) - (B * -0.3333333333333333)); else tmp = (1.0 - x) / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -1.85e-9], N[(N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision] + N[(B * N[(N[(x * 0.3333333333333333), $MachinePrecision] - 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.15e-14], N[(x * N[(N[(-1.0 / B), $MachinePrecision] - N[(B * -0.3333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -1.85 \cdot 10^{-9}:\\
\;\;\;\;\frac{-1 - x}{B} + B \cdot \left(x \cdot 0.3333333333333333 - 0.16666666666666666\right)\\
\mathbf{elif}\;F \leq 1.15 \cdot 10^{-14}:\\
\;\;\;\;x \cdot \left(\frac{-1}{B} - B \cdot -0.3333333333333333\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -1.85e-9Initial program 59.7%
Taylor expanded in F around -inf 98.4%
Taylor expanded in B around 0 46.3%
if -1.85e-9 < F < 1.14999999999999999e-14Initial program 99.5%
Taylor expanded in B around 0 56.0%
Taylor expanded in F around inf 24.0%
Taylor expanded in x around inf 43.7%
if 1.14999999999999999e-14 < F Initial program 60.7%
Simplified76.2%
Taylor expanded in F around inf 94.5%
associate-/r*94.4%
Simplified94.4%
Taylor expanded in B around 0 51.3%
Final simplification46.8%
(FPCore (F B x) :precision binary64 (if (<= F -2.75e-9) (/ (- -1.0 x) B) (if (<= F 9.2e-12) (/ (- x) B) (/ (- 1.0 x) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -2.75e-9) {
tmp = (-1.0 - x) / B;
} else if (F <= 9.2e-12) {
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.75d-9)) then
tmp = ((-1.0d0) - x) / b
else if (f <= 9.2d-12) 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.75e-9) {
tmp = (-1.0 - x) / B;
} else if (F <= 9.2e-12) {
tmp = -x / B;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -2.75e-9: tmp = (-1.0 - x) / B elif F <= 9.2e-12: tmp = -x / B else: tmp = (1.0 - x) / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= -2.75e-9) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= 9.2e-12) 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.75e-9) tmp = (-1.0 - x) / B; elseif (F <= 9.2e-12) tmp = -x / B; else tmp = (1.0 - x) / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -2.75e-9], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 9.2e-12], N[((-x) / B), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -2.75 \cdot 10^{-9}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq 9.2 \cdot 10^{-12}:\\
\;\;\;\;\frac{-x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -2.7499999999999998e-9Initial program 59.7%
Taylor expanded in F around -inf 98.4%
Taylor expanded in B around 0 46.3%
associate-*r/46.3%
distribute-lft-in46.3%
metadata-eval46.3%
neg-mul-146.3%
Simplified46.3%
if -2.7499999999999998e-9 < F < 9.19999999999999957e-12Initial program 99.5%
Simplified99.6%
Taylor expanded in F around inf 33.2%
associate-/r*33.2%
Simplified33.2%
Taylor expanded in B around 0 23.9%
Taylor expanded in x around inf 43.1%
neg-mul-143.1%
distribute-neg-frac43.1%
Simplified43.1%
if 9.19999999999999957e-12 < F Initial program 60.2%
Simplified75.9%
Taylor expanded in F around inf 95.5%
associate-/r*95.5%
Simplified95.5%
Taylor expanded in B around 0 51.9%
Final simplification46.8%
(FPCore (F B x) :precision binary64 (if (<= F 1.9e-12) (/ (- x) B) (/ (- 1.0 x) B)))
double code(double F, double B, double x) {
double tmp;
if (F <= 1.9e-12) {
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 <= 1.9d-12) 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 <= 1.9e-12) {
tmp = -x / B;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= 1.9e-12: tmp = -x / B else: tmp = (1.0 - x) / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= 1.9e-12) 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 <= 1.9e-12) tmp = -x / B; else tmp = (1.0 - x) / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, 1.9e-12], N[((-x) / B), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq 1.9 \cdot 10^{-12}:\\
\;\;\;\;\frac{-x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < 1.89999999999999998e-12Initial program 82.9%
Simplified89.4%
Taylor expanded in F around inf 36.2%
associate-/r*36.2%
Simplified36.2%
Taylor expanded in B around 0 22.9%
Taylor expanded in x around inf 34.3%
neg-mul-134.3%
distribute-neg-frac34.3%
Simplified34.3%
if 1.89999999999999998e-12 < F Initial program 60.2%
Simplified75.9%
Taylor expanded in F around inf 95.5%
associate-/r*95.5%
Simplified95.5%
Taylor expanded in B around 0 51.9%
Final simplification39.8%
(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 75.7%
Simplified85.1%
Taylor expanded in F around inf 54.9%
associate-/r*54.9%
Simplified54.9%
Taylor expanded in B around 0 32.0%
Taylor expanded in x around inf 32.4%
neg-mul-132.4%
distribute-neg-frac32.4%
Simplified32.4%
Final simplification32.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 75.7%
Simplified85.1%
Taylor expanded in F around inf 54.9%
associate-/r*54.9%
Simplified54.9%
Taylor expanded in B around 0 32.0%
Taylor expanded in x around 0 9.5%
Final simplification9.5%
herbie shell --seed 2024027
(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))))))