
(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 20 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (F B x) :precision binary64 (+ (- (* x (/ 1.0 (tan B)))) (* (/ F (sin B)) (pow (+ (+ (* F F) 2.0) (* 2.0 x)) (- (/ 1.0 2.0))))))
double code(double F, double B, double x) {
return -(x * (1.0 / tan(B))) + ((F / sin(B)) * pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
code = -(x * (1.0d0 / tan(b))) + ((f / sin(b)) * ((((f * f) + 2.0d0) + (2.0d0 * x)) ** -(1.0d0 / 2.0d0)))
end function
public static double code(double F, double B, double x) {
return -(x * (1.0 / Math.tan(B))) + ((F / Math.sin(B)) * Math.pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
}
def code(F, B, x): return -(x * (1.0 / math.tan(B))) + ((F / math.sin(B)) * math.pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)))
function code(F, B, x) return Float64(Float64(-Float64(x * Float64(1.0 / tan(B)))) + Float64(Float64(F / sin(B)) * (Float64(Float64(Float64(F * F) + 2.0) + Float64(2.0 * x)) ^ Float64(-Float64(1.0 / 2.0))))) end
function tmp = code(F, B, x) tmp = -(x * (1.0 / tan(B))) + ((F / sin(B)) * ((((F * F) + 2.0) + (2.0 * x)) ^ -(1.0 / 2.0))); end
code[F_, B_, x_] := N[((-N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]) + N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Power[N[(N[(N[(F * F), $MachinePrecision] + 2.0), $MachinePrecision] + N[(2.0 * x), $MachinePrecision]), $MachinePrecision], (-N[(1.0 / 2.0), $MachinePrecision])], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}
\end{array}
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -2.3e+43)
(+ (* x (/ -1.0 (tan B))) (/ -1.0 (sin B)))
(if (<= F 104000000.0)
(- (* F (/ (pow (fma x 2.0 (fma F F 2.0)) -0.5) (sin B))) t_0)
(- (/ 1.0 (sin B)) t_0)))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -2.3e+43) {
tmp = (x * (-1.0 / tan(B))) + (-1.0 / sin(B));
} else if (F <= 104000000.0) {
tmp = (F * (pow(fma(x, 2.0, fma(F, F, 2.0)), -0.5) / sin(B))) - t_0;
} else {
tmp = (1.0 / sin(B)) - t_0;
}
return tmp;
}
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -2.3e+43) tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(-1.0 / sin(B))); elseif (F <= 104000000.0) tmp = Float64(Float64(F * Float64((fma(x, 2.0, fma(F, F, 2.0)) ^ -0.5) / sin(B))) - t_0); else tmp = Float64(Float64(1.0 / sin(B)) - t_0); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -2.3e+43], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 104000000.0], N[(N[(F * N[(N[Power[N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -2.3 \cdot 10^{+43}:\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{-1}{\sin B}\\
\mathbf{elif}\;F \leq 104000000:\\
\;\;\;\;F \cdot \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B} - t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_0\\
\end{array}
\end{array}
if F < -2.3000000000000002e43Initial program 60.9%
Taylor expanded in F around -inf 99.8%
if -2.3000000000000002e43 < F < 1.04e8Initial program 99.5%
Simplified99.7%
if 1.04e8 < F Initial program 55.8%
Simplified70.6%
Taylor expanded in x around 0 70.5%
associate-*l/70.5%
*-lft-identity70.5%
+-commutative70.5%
unpow270.5%
fma-undefine70.5%
Simplified70.5%
Taylor expanded in F around inf 99.8%
Final simplification99.8%
(FPCore (F B x)
:precision binary64
(if (<= F -1.6e+35)
(+ (* x (/ -1.0 (tan B))) (/ -1.0 (sin B)))
(if (<= F 5300000000.0)
(-
(* (/ F (sin B)) (pow (+ (+ 2.0 (* F F)) (* x 2.0)) -0.5))
(* (cos B) (/ x (sin B))))
(- (/ 1.0 (sin B)) (/ x (tan B))))))
double code(double F, double B, double x) {
double tmp;
if (F <= -1.6e+35) {
tmp = (x * (-1.0 / tan(B))) + (-1.0 / sin(B));
} else if (F <= 5300000000.0) {
tmp = ((F / sin(B)) * pow(((2.0 + (F * F)) + (x * 2.0)), -0.5)) - (cos(B) * (x / sin(B)));
} else {
tmp = (1.0 / sin(B)) - (x / tan(B));
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if (f <= (-1.6d+35)) then
tmp = (x * ((-1.0d0) / tan(b))) + ((-1.0d0) / sin(b))
else if (f <= 5300000000.0d0) then
tmp = ((f / sin(b)) * (((2.0d0 + (f * f)) + (x * 2.0d0)) ** (-0.5d0))) - (cos(b) * (x / sin(b)))
else
tmp = (1.0d0 / sin(b)) - (x / tan(b))
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -1.6e+35) {
tmp = (x * (-1.0 / Math.tan(B))) + (-1.0 / Math.sin(B));
} else if (F <= 5300000000.0) {
tmp = ((F / Math.sin(B)) * Math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5)) - (Math.cos(B) * (x / Math.sin(B)));
} else {
tmp = (1.0 / Math.sin(B)) - (x / Math.tan(B));
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -1.6e+35: tmp = (x * (-1.0 / math.tan(B))) + (-1.0 / math.sin(B)) elif F <= 5300000000.0: tmp = ((F / math.sin(B)) * math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5)) - (math.cos(B) * (x / math.sin(B))) else: tmp = (1.0 / math.sin(B)) - (x / math.tan(B)) return tmp
function code(F, B, x) tmp = 0.0 if (F <= -1.6e+35) tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(-1.0 / sin(B))); elseif (F <= 5300000000.0) tmp = Float64(Float64(Float64(F / sin(B)) * (Float64(Float64(2.0 + Float64(F * F)) + Float64(x * 2.0)) ^ -0.5)) - Float64(cos(B) * Float64(x / sin(B)))); else tmp = Float64(Float64(1.0 / sin(B)) - Float64(x / tan(B))); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -1.6e+35) tmp = (x * (-1.0 / tan(B))) + (-1.0 / sin(B)); elseif (F <= 5300000000.0) tmp = ((F / sin(B)) * (((2.0 + (F * F)) + (x * 2.0)) ^ -0.5)) - (cos(B) * (x / sin(B))); else tmp = (1.0 / sin(B)) - (x / tan(B)); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -1.6e+35], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 5300000000.0], N[(N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Power[N[(N[(2.0 + N[(F * F), $MachinePrecision]), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision] - N[(N[Cos[B], $MachinePrecision] * N[(x / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -1.6 \cdot 10^{+35}:\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{-1}{\sin B}\\
\mathbf{elif}\;F \leq 5300000000:\\
\;\;\;\;\frac{F}{\sin B} \cdot {\left(\left(2 + F \cdot F\right) + x \cdot 2\right)}^{-0.5} - \cos B \cdot \frac{x}{\sin B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - \frac{x}{\tan B}\\
\end{array}
\end{array}
if F < -1.59999999999999991e35Initial program 63.2%
Taylor expanded in F around -inf 99.8%
if -1.59999999999999991e35 < F < 5.3e9Initial program 99.5%
Taylor expanded in x around 0 99.5%
associate-*l/99.6%
*-commutative99.6%
Simplified99.6%
if 5.3e9 < F Initial program 55.2%
Simplified70.2%
Taylor expanded in x around 0 70.1%
associate-*l/70.1%
*-lft-identity70.1%
+-commutative70.1%
unpow270.1%
fma-undefine70.1%
Simplified70.1%
Taylor expanded in F around inf 99.9%
Final simplification99.7%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -85000000.0)
(- (* F (/ (/ -1.0 F) (sin B))) t_0)
(if (<= F 95000000.0)
(+
(* x (/ -1.0 (tan B)))
(* (/ F (sin B)) (pow (+ (+ 2.0 (* F F)) (* x 2.0)) -0.5)))
(- (/ 1.0 (sin B)) t_0)))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -85000000.0) {
tmp = (F * ((-1.0 / F) / sin(B))) - t_0;
} else if (F <= 95000000.0) {
tmp = (x * (-1.0 / tan(B))) + ((F / sin(B)) * pow(((2.0 + (F * F)) + (x * 2.0)), -0.5));
} else {
tmp = (1.0 / sin(B)) - t_0;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: tmp
t_0 = x / tan(b)
if (f <= (-85000000.0d0)) then
tmp = (f * (((-1.0d0) / f) / sin(b))) - t_0
else if (f <= 95000000.0d0) then
tmp = (x * ((-1.0d0) / tan(b))) + ((f / sin(b)) * (((2.0d0 + (f * f)) + (x * 2.0d0)) ** (-0.5d0)))
else
tmp = (1.0d0 / sin(b)) - t_0
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = x / Math.tan(B);
double tmp;
if (F <= -85000000.0) {
tmp = (F * ((-1.0 / F) / Math.sin(B))) - t_0;
} else if (F <= 95000000.0) {
tmp = (x * (-1.0 / Math.tan(B))) + ((F / Math.sin(B)) * Math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5));
} else {
tmp = (1.0 / Math.sin(B)) - t_0;
}
return tmp;
}
def code(F, B, x): t_0 = x / math.tan(B) tmp = 0 if F <= -85000000.0: tmp = (F * ((-1.0 / F) / math.sin(B))) - t_0 elif F <= 95000000.0: tmp = (x * (-1.0 / math.tan(B))) + ((F / math.sin(B)) * math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5)) else: tmp = (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 <= -85000000.0) tmp = Float64(Float64(F * Float64(Float64(-1.0 / F) / sin(B))) - t_0); elseif (F <= 95000000.0) tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(Float64(F / sin(B)) * (Float64(Float64(2.0 + Float64(F * F)) + Float64(x * 2.0)) ^ -0.5))); else tmp = Float64(Float64(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 <= -85000000.0) tmp = (F * ((-1.0 / F) / sin(B))) - t_0; elseif (F <= 95000000.0) tmp = (x * (-1.0 / tan(B))) + ((F / sin(B)) * (((2.0 + (F * F)) + (x * 2.0)) ^ -0.5)); else tmp = (1.0 / sin(B)) - t_0; end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -85000000.0], N[(N[(F * N[(N[(-1.0 / F), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 95000000.0], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Power[N[(N[(2.0 + N[(F * F), $MachinePrecision]), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(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 -85000000:\\
\;\;\;\;F \cdot \frac{\frac{-1}{F}}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq 95000000:\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{F}{\sin B} \cdot {\left(\left(2 + F \cdot F\right) + x \cdot 2\right)}^{-0.5}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_0\\
\end{array}
\end{array}
if F < -8.5e7Initial program 67.9%
Simplified82.0%
Taylor expanded in F around -inf 99.7%
associate-/r*99.8%
Simplified99.8%
if -8.5e7 < F < 9.5e7Initial program 99.5%
if 9.5e7 < F Initial program 55.8%
Simplified70.6%
Taylor expanded in x around 0 70.5%
associate-*l/70.5%
*-lft-identity70.5%
+-commutative70.5%
unpow270.5%
fma-undefine70.5%
Simplified70.5%
Taylor expanded in F around inf 99.8%
Final simplification99.7%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -1.55)
(- (* F (/ (/ -1.0 F) (sin B))) t_0)
(if (<= F 1.55)
(- (* F (/ (sqrt (/ 1.0 (+ 2.0 (* x 2.0)))) (sin B))) t_0)
(- (/ 1.0 (sin B)) t_0)))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -1.55) {
tmp = (F * ((-1.0 / F) / sin(B))) - t_0;
} else if (F <= 1.55) {
tmp = (F * (sqrt((1.0 / (2.0 + (x * 2.0)))) / sin(B))) - t_0;
} else {
tmp = (1.0 / sin(B)) - t_0;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: tmp
t_0 = x / tan(b)
if (f <= (-1.55d0)) then
tmp = (f * (((-1.0d0) / f) / sin(b))) - t_0
else if (f <= 1.55d0) then
tmp = (f * (sqrt((1.0d0 / (2.0d0 + (x * 2.0d0)))) / sin(b))) - t_0
else
tmp = (1.0d0 / sin(b)) - t_0
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = x / Math.tan(B);
double tmp;
if (F <= -1.55) {
tmp = (F * ((-1.0 / F) / Math.sin(B))) - t_0;
} else if (F <= 1.55) {
tmp = (F * (Math.sqrt((1.0 / (2.0 + (x * 2.0)))) / Math.sin(B))) - t_0;
} else {
tmp = (1.0 / Math.sin(B)) - t_0;
}
return tmp;
}
def code(F, B, x): t_0 = x / math.tan(B) tmp = 0 if F <= -1.55: tmp = (F * ((-1.0 / F) / math.sin(B))) - t_0 elif F <= 1.55: tmp = (F * (math.sqrt((1.0 / (2.0 + (x * 2.0)))) / math.sin(B))) - t_0 else: tmp = (1.0 / math.sin(B)) - t_0 return tmp
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -1.55) tmp = Float64(Float64(F * Float64(Float64(-1.0 / F) / sin(B))) - t_0); elseif (F <= 1.55) tmp = Float64(Float64(F * Float64(sqrt(Float64(1.0 / Float64(2.0 + Float64(x * 2.0)))) / sin(B))) - t_0); else tmp = Float64(Float64(1.0 / sin(B)) - t_0); end return tmp end
function tmp_2 = code(F, B, x) t_0 = x / tan(B); tmp = 0.0; if (F <= -1.55) tmp = (F * ((-1.0 / F) / sin(B))) - t_0; elseif (F <= 1.55) tmp = (F * (sqrt((1.0 / (2.0 + (x * 2.0)))) / sin(B))) - t_0; else tmp = (1.0 / sin(B)) - t_0; end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -1.55], N[(N[(F * N[(N[(-1.0 / F), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 1.55], N[(N[(F * N[(N[Sqrt[N[(1.0 / N[(2.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -1.55:\\
\;\;\;\;F \cdot \frac{\frac{-1}{F}}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq 1.55:\\
\;\;\;\;F \cdot \frac{\sqrt{\frac{1}{2 + x \cdot 2}}}{\sin B} - t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_0\\
\end{array}
\end{array}
if F < -1.55000000000000004Initial program 68.4%
Simplified82.2%
Taylor expanded in F around -inf 99.5%
associate-/r*99.6%
Simplified99.6%
if -1.55000000000000004 < F < 1.55000000000000004Initial program 99.5%
Simplified99.7%
Taylor expanded in F around 0 98.9%
associate-*l/99.0%
*-lft-identity99.0%
Simplified99.0%
if 1.55000000000000004 < F Initial program 55.8%
Simplified70.6%
Taylor expanded in x around 0 70.5%
associate-*l/70.5%
*-lft-identity70.5%
+-commutative70.5%
unpow270.5%
fma-undefine70.5%
Simplified70.5%
Taylor expanded in F around inf 99.8%
Final simplification99.4%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -1.42)
(- (* F (/ (/ -1.0 F) (sin B))) t_0)
(if (<= F 1.4)
(- (/ (* F (sqrt 0.5)) (sin B)) t_0)
(- (/ 1.0 (sin B)) t_0)))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -1.42) {
tmp = (F * ((-1.0 / F) / sin(B))) - t_0;
} else if (F <= 1.4) {
tmp = ((F * sqrt(0.5)) / sin(B)) - t_0;
} else {
tmp = (1.0 / sin(B)) - t_0;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: tmp
t_0 = x / tan(b)
if (f <= (-1.42d0)) then
tmp = (f * (((-1.0d0) / f) / sin(b))) - t_0
else if (f <= 1.4d0) then
tmp = ((f * sqrt(0.5d0)) / sin(b)) - t_0
else
tmp = (1.0d0 / sin(b)) - t_0
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = x / Math.tan(B);
double tmp;
if (F <= -1.42) {
tmp = (F * ((-1.0 / F) / Math.sin(B))) - t_0;
} else if (F <= 1.4) {
tmp = ((F * Math.sqrt(0.5)) / Math.sin(B)) - t_0;
} else {
tmp = (1.0 / Math.sin(B)) - t_0;
}
return tmp;
}
def code(F, B, x): t_0 = x / math.tan(B) tmp = 0 if F <= -1.42: tmp = (F * ((-1.0 / F) / math.sin(B))) - t_0 elif F <= 1.4: tmp = ((F * math.sqrt(0.5)) / math.sin(B)) - t_0 else: tmp = (1.0 / math.sin(B)) - t_0 return tmp
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -1.42) tmp = Float64(Float64(F * Float64(Float64(-1.0 / F) / sin(B))) - t_0); elseif (F <= 1.4) tmp = Float64(Float64(Float64(F * sqrt(0.5)) / sin(B)) - t_0); else tmp = Float64(Float64(1.0 / sin(B)) - t_0); end return tmp end
function tmp_2 = code(F, B, x) t_0 = x / tan(B); tmp = 0.0; if (F <= -1.42) tmp = (F * ((-1.0 / F) / sin(B))) - t_0; elseif (F <= 1.4) tmp = ((F * sqrt(0.5)) / sin(B)) - t_0; else tmp = (1.0 / sin(B)) - t_0; end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -1.42], N[(N[(F * N[(N[(-1.0 / F), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 1.4], N[(N[(N[(F * N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -1.42:\\
\;\;\;\;F \cdot \frac{\frac{-1}{F}}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq 1.4:\\
\;\;\;\;\frac{F \cdot \sqrt{0.5}}{\sin B} - t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_0\\
\end{array}
\end{array}
if F < -1.4199999999999999Initial program 68.4%
Simplified82.2%
Taylor expanded in F around -inf 99.5%
associate-/r*99.6%
Simplified99.6%
if -1.4199999999999999 < F < 1.3999999999999999Initial program 99.5%
Simplified99.7%
Taylor expanded in x around 0 99.4%
associate-*l/99.5%
*-lft-identity99.5%
+-commutative99.5%
unpow299.5%
fma-undefine99.5%
Simplified99.5%
Taylor expanded in F around 0 98.8%
if 1.3999999999999999 < F Initial program 55.8%
Simplified70.6%
Taylor expanded in x around 0 70.5%
associate-*l/70.5%
*-lft-identity70.5%
+-commutative70.5%
unpow270.5%
fma-undefine70.5%
Simplified70.5%
Taylor expanded in F around inf 99.8%
Final simplification99.3%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -14500000.0)
(- (* F (/ (/ -1.0 F) (sin B))) t_0)
(if (<= F -2.5e-110)
(- (* (/ F (sin B)) (pow (+ (+ 2.0 (* F F)) (* x 2.0)) -0.5)) (/ x B))
(if (<= F 0.49)
(- (* F (/ (sqrt 0.5) B)) t_0)
(- (/ 1.0 (sin B)) t_0))))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -14500000.0) {
tmp = (F * ((-1.0 / F) / sin(B))) - t_0;
} else if (F <= -2.5e-110) {
tmp = ((F / sin(B)) * pow(((2.0 + (F * F)) + (x * 2.0)), -0.5)) - (x / B);
} else if (F <= 0.49) {
tmp = (F * (sqrt(0.5) / B)) - t_0;
} else {
tmp = (1.0 / sin(B)) - t_0;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: tmp
t_0 = x / tan(b)
if (f <= (-14500000.0d0)) then
tmp = (f * (((-1.0d0) / f) / sin(b))) - t_0
else if (f <= (-2.5d-110)) then
tmp = ((f / sin(b)) * (((2.0d0 + (f * f)) + (x * 2.0d0)) ** (-0.5d0))) - (x / b)
else if (f <= 0.49d0) then
tmp = (f * (sqrt(0.5d0) / b)) - t_0
else
tmp = (1.0d0 / sin(b)) - t_0
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = x / Math.tan(B);
double tmp;
if (F <= -14500000.0) {
tmp = (F * ((-1.0 / F) / Math.sin(B))) - t_0;
} else if (F <= -2.5e-110) {
tmp = ((F / Math.sin(B)) * Math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5)) - (x / B);
} else if (F <= 0.49) {
tmp = (F * (Math.sqrt(0.5) / B)) - t_0;
} else {
tmp = (1.0 / Math.sin(B)) - t_0;
}
return tmp;
}
def code(F, B, x): t_0 = x / math.tan(B) tmp = 0 if F <= -14500000.0: tmp = (F * ((-1.0 / F) / math.sin(B))) - t_0 elif F <= -2.5e-110: tmp = ((F / math.sin(B)) * math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5)) - (x / B) elif F <= 0.49: tmp = (F * (math.sqrt(0.5) / B)) - t_0 else: tmp = (1.0 / math.sin(B)) - t_0 return tmp
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -14500000.0) tmp = Float64(Float64(F * Float64(Float64(-1.0 / F) / sin(B))) - t_0); elseif (F <= -2.5e-110) tmp = Float64(Float64(Float64(F / sin(B)) * (Float64(Float64(2.0 + Float64(F * F)) + Float64(x * 2.0)) ^ -0.5)) - Float64(x / B)); elseif (F <= 0.49) tmp = Float64(Float64(F * Float64(sqrt(0.5) / B)) - t_0); else tmp = Float64(Float64(1.0 / sin(B)) - t_0); end return tmp end
function tmp_2 = code(F, B, x) t_0 = x / tan(B); tmp = 0.0; if (F <= -14500000.0) tmp = (F * ((-1.0 / F) / sin(B))) - t_0; elseif (F <= -2.5e-110) tmp = ((F / sin(B)) * (((2.0 + (F * F)) + (x * 2.0)) ^ -0.5)) - (x / B); elseif (F <= 0.49) tmp = (F * (sqrt(0.5) / B)) - t_0; else tmp = (1.0 / sin(B)) - t_0; end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -14500000.0], N[(N[(F * N[(N[(-1.0 / F), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, -2.5e-110], N[(N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Power[N[(N[(2.0 + N[(F * F), $MachinePrecision]), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 0.49], N[(N[(F * N[(N[Sqrt[0.5], $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -14500000:\\
\;\;\;\;F \cdot \frac{\frac{-1}{F}}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq -2.5 \cdot 10^{-110}:\\
\;\;\;\;\frac{F}{\sin B} \cdot {\left(\left(2 + F \cdot F\right) + x \cdot 2\right)}^{-0.5} - \frac{x}{B}\\
\mathbf{elif}\;F \leq 0.49:\\
\;\;\;\;F \cdot \frac{\sqrt{0.5}}{B} - t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_0\\
\end{array}
\end{array}
if F < -1.45e7Initial program 67.9%
Simplified82.0%
Taylor expanded in F around -inf 99.7%
associate-/r*99.8%
Simplified99.8%
if -1.45e7 < F < -2.5e-110Initial program 99.4%
Taylor expanded in B around 0 81.6%
if -2.5e-110 < F < 0.48999999999999999Initial program 99.5%
Simplified99.7%
Taylor expanded in x around 0 99.4%
associate-*l/99.4%
*-lft-identity99.4%
+-commutative99.4%
unpow299.4%
fma-undefine99.4%
Simplified99.4%
Taylor expanded in F around 0 98.7%
Taylor expanded in B around 0 84.5%
associate-/l*84.6%
Simplified84.6%
if 0.48999999999999999 < F Initial program 55.8%
Simplified70.6%
Taylor expanded in x around 0 70.5%
associate-*l/70.5%
*-lft-identity70.5%
+-commutative70.5%
unpow270.5%
fma-undefine70.5%
Simplified70.5%
Taylor expanded in F around inf 99.8%
Final simplification92.9%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -1.42)
(- (/ -1.0 B) t_0)
(if (<= F 0.4) (- (* F (/ (sqrt 0.5) B)) t_0) (- (/ 1.0 (sin B)) t_0)))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -1.42) {
tmp = (-1.0 / B) - t_0;
} else if (F <= 0.4) {
tmp = (F * (sqrt(0.5) / B)) - t_0;
} else {
tmp = (1.0 / sin(B)) - t_0;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: tmp
t_0 = x / tan(b)
if (f <= (-1.42d0)) then
tmp = ((-1.0d0) / b) - t_0
else if (f <= 0.4d0) then
tmp = (f * (sqrt(0.5d0) / b)) - t_0
else
tmp = (1.0d0 / sin(b)) - t_0
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = x / Math.tan(B);
double tmp;
if (F <= -1.42) {
tmp = (-1.0 / B) - t_0;
} else if (F <= 0.4) {
tmp = (F * (Math.sqrt(0.5) / B)) - t_0;
} else {
tmp = (1.0 / Math.sin(B)) - t_0;
}
return tmp;
}
def code(F, B, x): t_0 = x / math.tan(B) tmp = 0 if F <= -1.42: tmp = (-1.0 / B) - t_0 elif F <= 0.4: tmp = (F * (math.sqrt(0.5) / B)) - t_0 else: tmp = (1.0 / math.sin(B)) - t_0 return tmp
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -1.42) tmp = Float64(Float64(-1.0 / B) - t_0); elseif (F <= 0.4) tmp = Float64(Float64(F * Float64(sqrt(0.5) / B)) - t_0); else tmp = Float64(Float64(1.0 / sin(B)) - t_0); end return tmp end
function tmp_2 = code(F, B, x) t_0 = x / tan(B); tmp = 0.0; if (F <= -1.42) tmp = (-1.0 / B) - t_0; elseif (F <= 0.4) tmp = (F * (sqrt(0.5) / B)) - t_0; else tmp = (1.0 / sin(B)) - t_0; end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -1.42], N[(N[(-1.0 / B), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 0.4], N[(N[(F * N[(N[Sqrt[0.5], $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -1.42:\\
\;\;\;\;\frac{-1}{B} - t\_0\\
\mathbf{elif}\;F \leq 0.4:\\
\;\;\;\;F \cdot \frac{\sqrt{0.5}}{B} - t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_0\\
\end{array}
\end{array}
if F < -1.4199999999999999Initial program 68.4%
Simplified82.2%
Taylor expanded in F around -inf 99.5%
associate-/r*99.6%
Simplified99.6%
Taylor expanded in B around 0 78.6%
*-commutative78.6%
Simplified78.6%
Taylor expanded in F around 0 78.6%
if -1.4199999999999999 < F < 0.40000000000000002Initial program 99.5%
Simplified99.7%
Taylor expanded in x around 0 99.4%
associate-*l/99.5%
*-lft-identity99.5%
+-commutative99.5%
unpow299.5%
fma-undefine99.5%
Simplified99.5%
Taylor expanded in F around 0 98.8%
Taylor expanded in B around 0 77.5%
associate-/l*77.5%
Simplified77.5%
if 0.40000000000000002 < F Initial program 55.8%
Simplified70.6%
Taylor expanded in x around 0 70.5%
associate-*l/70.5%
*-lft-identity70.5%
+-commutative70.5%
unpow270.5%
fma-undefine70.5%
Simplified70.5%
Taylor expanded in F around inf 99.8%
Final simplification83.9%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -0.115)
(+ (* x (/ -1.0 (tan B))) (/ -1.0 (sin B)))
(if (<= F 0.18) (- (* F (/ (sqrt 0.5) B)) t_0) (- (/ 1.0 (sin B)) t_0)))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -0.115) {
tmp = (x * (-1.0 / tan(B))) + (-1.0 / sin(B));
} else if (F <= 0.18) {
tmp = (F * (sqrt(0.5) / B)) - t_0;
} else {
tmp = (1.0 / sin(B)) - t_0;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: tmp
t_0 = x / tan(b)
if (f <= (-0.115d0)) then
tmp = (x * ((-1.0d0) / tan(b))) + ((-1.0d0) / sin(b))
else if (f <= 0.18d0) then
tmp = (f * (sqrt(0.5d0) / b)) - t_0
else
tmp = (1.0d0 / sin(b)) - t_0
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = x / Math.tan(B);
double tmp;
if (F <= -0.115) {
tmp = (x * (-1.0 / Math.tan(B))) + (-1.0 / Math.sin(B));
} else if (F <= 0.18) {
tmp = (F * (Math.sqrt(0.5) / B)) - t_0;
} else {
tmp = (1.0 / Math.sin(B)) - t_0;
}
return tmp;
}
def code(F, B, x): t_0 = x / math.tan(B) tmp = 0 if F <= -0.115: tmp = (x * (-1.0 / math.tan(B))) + (-1.0 / math.sin(B)) elif F <= 0.18: tmp = (F * (math.sqrt(0.5) / B)) - t_0 else: tmp = (1.0 / math.sin(B)) - t_0 return tmp
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -0.115) tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(-1.0 / sin(B))); elseif (F <= 0.18) tmp = Float64(Float64(F * Float64(sqrt(0.5) / B)) - t_0); else tmp = Float64(Float64(1.0 / sin(B)) - t_0); end return tmp end
function tmp_2 = code(F, B, x) t_0 = x / tan(B); tmp = 0.0; if (F <= -0.115) tmp = (x * (-1.0 / tan(B))) + (-1.0 / sin(B)); elseif (F <= 0.18) tmp = (F * (sqrt(0.5) / B)) - t_0; else tmp = (1.0 / sin(B)) - t_0; end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -0.115], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 0.18], N[(N[(F * N[(N[Sqrt[0.5], $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -0.115:\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{-1}{\sin B}\\
\mathbf{elif}\;F \leq 0.18:\\
\;\;\;\;F \cdot \frac{\sqrt{0.5}}{B} - t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_0\\
\end{array}
\end{array}
if F < -0.115000000000000005Initial program 68.4%
Taylor expanded in F around -inf 99.5%
if -0.115000000000000005 < F < 0.17999999999999999Initial program 99.5%
Simplified99.7%
Taylor expanded in x around 0 99.4%
associate-*l/99.5%
*-lft-identity99.5%
+-commutative99.5%
unpow299.5%
fma-undefine99.5%
Simplified99.5%
Taylor expanded in F around 0 98.8%
Taylor expanded in B around 0 77.5%
associate-/l*77.5%
Simplified77.5%
if 0.17999999999999999 < F Initial program 55.8%
Simplified70.6%
Taylor expanded in x around 0 70.5%
associate-*l/70.5%
*-lft-identity70.5%
+-commutative70.5%
unpow270.5%
fma-undefine70.5%
Simplified70.5%
Taylor expanded in F around inf 99.8%
Final simplification90.2%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -0.15)
(- (* F (/ (/ -1.0 F) (sin B))) t_0)
(if (<= F 0.118)
(- (* F (/ (sqrt 0.5) B)) t_0)
(- (/ 1.0 (sin B)) t_0)))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -0.15) {
tmp = (F * ((-1.0 / F) / sin(B))) - t_0;
} else if (F <= 0.118) {
tmp = (F * (sqrt(0.5) / B)) - t_0;
} else {
tmp = (1.0 / sin(B)) - t_0;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: tmp
t_0 = x / tan(b)
if (f <= (-0.15d0)) then
tmp = (f * (((-1.0d0) / f) / sin(b))) - t_0
else if (f <= 0.118d0) then
tmp = (f * (sqrt(0.5d0) / b)) - t_0
else
tmp = (1.0d0 / sin(b)) - t_0
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = x / Math.tan(B);
double tmp;
if (F <= -0.15) {
tmp = (F * ((-1.0 / F) / Math.sin(B))) - t_0;
} else if (F <= 0.118) {
tmp = (F * (Math.sqrt(0.5) / B)) - t_0;
} else {
tmp = (1.0 / Math.sin(B)) - t_0;
}
return tmp;
}
def code(F, B, x): t_0 = x / math.tan(B) tmp = 0 if F <= -0.15: tmp = (F * ((-1.0 / F) / math.sin(B))) - t_0 elif F <= 0.118: tmp = (F * (math.sqrt(0.5) / B)) - t_0 else: tmp = (1.0 / math.sin(B)) - t_0 return tmp
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -0.15) tmp = Float64(Float64(F * Float64(Float64(-1.0 / F) / sin(B))) - t_0); elseif (F <= 0.118) tmp = Float64(Float64(F * Float64(sqrt(0.5) / B)) - t_0); else tmp = Float64(Float64(1.0 / sin(B)) - t_0); end return tmp end
function tmp_2 = code(F, B, x) t_0 = x / tan(B); tmp = 0.0; if (F <= -0.15) tmp = (F * ((-1.0 / F) / sin(B))) - t_0; elseif (F <= 0.118) tmp = (F * (sqrt(0.5) / B)) - t_0; else tmp = (1.0 / sin(B)) - t_0; end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -0.15], N[(N[(F * N[(N[(-1.0 / F), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 0.118], N[(N[(F * N[(N[Sqrt[0.5], $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -0.15:\\
\;\;\;\;F \cdot \frac{\frac{-1}{F}}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq 0.118:\\
\;\;\;\;F \cdot \frac{\sqrt{0.5}}{B} - t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_0\\
\end{array}
\end{array}
if F < -0.149999999999999994Initial program 68.4%
Simplified82.2%
Taylor expanded in F around -inf 99.5%
associate-/r*99.6%
Simplified99.6%
if -0.149999999999999994 < F < 0.11799999999999999Initial program 99.5%
Simplified99.7%
Taylor expanded in x around 0 99.4%
associate-*l/99.5%
*-lft-identity99.5%
+-commutative99.5%
unpow299.5%
fma-undefine99.5%
Simplified99.5%
Taylor expanded in F around 0 98.8%
Taylor expanded in B around 0 77.5%
associate-/l*77.5%
Simplified77.5%
if 0.11799999999999999 < F Initial program 55.8%
Simplified70.6%
Taylor expanded in x around 0 70.5%
associate-*l/70.5%
*-lft-identity70.5%
+-commutative70.5%
unpow270.5%
fma-undefine70.5%
Simplified70.5%
Taylor expanded in F around inf 99.8%
Final simplification90.2%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -8.3e-57)
(- (/ -1.0 B) t_0)
(if (<= F 5e-12) (* x (/ (- (cos B)) (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 <= -8.3e-57) {
tmp = (-1.0 / B) - t_0;
} else if (F <= 5e-12) {
tmp = x * (-cos(B) / 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 <= (-8.3d-57)) then
tmp = ((-1.0d0) / b) - t_0
else if (f <= 5d-12) then
tmp = x * (-cos(b) / 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 <= -8.3e-57) {
tmp = (-1.0 / B) - t_0;
} else if (F <= 5e-12) {
tmp = x * (-Math.cos(B) / 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 <= -8.3e-57: tmp = (-1.0 / B) - t_0 elif F <= 5e-12: tmp = x * (-math.cos(B) / 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 <= -8.3e-57) tmp = Float64(Float64(-1.0 / B) - t_0); elseif (F <= 5e-12) tmp = Float64(x * Float64(Float64(-cos(B)) / 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 <= -8.3e-57) tmp = (-1.0 / B) - t_0; elseif (F <= 5e-12) tmp = x * (-cos(B) / 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, -8.3e-57], N[(N[(-1.0 / B), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 5e-12], N[(x * N[((-N[Cos[B], $MachinePrecision]) / 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 -8.3 \cdot 10^{-57}:\\
\;\;\;\;\frac{-1}{B} - t\_0\\
\mathbf{elif}\;F \leq 5 \cdot 10^{-12}:\\
\;\;\;\;x \cdot \frac{-\cos B}{\sin B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_0\\
\end{array}
\end{array}
if F < -8.30000000000000004e-57Initial program 73.1%
Simplified84.9%
Taylor expanded in F around -inf 90.6%
associate-/r*90.6%
Simplified90.6%
Taylor expanded in B around 0 72.6%
*-commutative72.6%
Simplified72.6%
Taylor expanded in F around 0 72.7%
if -8.30000000000000004e-57 < F < 4.9999999999999997e-12Initial program 99.5%
Taylor expanded in F around -inf 40.8%
Taylor expanded in x around inf 70.7%
mul-1-neg70.7%
associate-*r/70.8%
Simplified70.8%
if 4.9999999999999997e-12 < F Initial program 58.2%
Simplified72.2%
Taylor expanded in x around 0 72.1%
associate-*l/72.1%
*-lft-identity72.1%
+-commutative72.1%
unpow272.1%
fma-undefine72.1%
Simplified72.1%
Taylor expanded in F around inf 97.4%
Final simplification79.1%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -8.3e-57)
(- (/ -1.0 B) t_0)
(if (<= F 3e-63)
(* x (/ (- (cos B)) (sin B)))
(- (* F (/ 1.0 (* F B))) t_0)))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -8.3e-57) {
tmp = (-1.0 / B) - t_0;
} else if (F <= 3e-63) {
tmp = x * (-cos(B) / sin(B));
} else {
tmp = (F * (1.0 / (F * 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 <= (-8.3d-57)) then
tmp = ((-1.0d0) / b) - t_0
else if (f <= 3d-63) then
tmp = x * (-cos(b) / sin(b))
else
tmp = (f * (1.0d0 / (f * 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 <= -8.3e-57) {
tmp = (-1.0 / B) - t_0;
} else if (F <= 3e-63) {
tmp = x * (-Math.cos(B) / Math.sin(B));
} else {
tmp = (F * (1.0 / (F * B))) - t_0;
}
return tmp;
}
def code(F, B, x): t_0 = x / math.tan(B) tmp = 0 if F <= -8.3e-57: tmp = (-1.0 / B) - t_0 elif F <= 3e-63: tmp = x * (-math.cos(B) / math.sin(B)) else: tmp = (F * (1.0 / (F * B))) - t_0 return tmp
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -8.3e-57) tmp = Float64(Float64(-1.0 / B) - t_0); elseif (F <= 3e-63) tmp = Float64(x * Float64(Float64(-cos(B)) / sin(B))); else tmp = Float64(Float64(F * Float64(1.0 / Float64(F * B))) - t_0); end return tmp end
function tmp_2 = code(F, B, x) t_0 = x / tan(B); tmp = 0.0; if (F <= -8.3e-57) tmp = (-1.0 / B) - t_0; elseif (F <= 3e-63) tmp = x * (-cos(B) / sin(B)); else tmp = (F * (1.0 / (F * 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, -8.3e-57], N[(N[(-1.0 / B), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 3e-63], N[(x * N[((-N[Cos[B], $MachinePrecision]) / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(F * N[(1.0 / N[(F * B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -8.3 \cdot 10^{-57}:\\
\;\;\;\;\frac{-1}{B} - t\_0\\
\mathbf{elif}\;F \leq 3 \cdot 10^{-63}:\\
\;\;\;\;x \cdot \frac{-\cos B}{\sin B}\\
\mathbf{else}:\\
\;\;\;\;F \cdot \frac{1}{F \cdot B} - t\_0\\
\end{array}
\end{array}
if F < -8.30000000000000004e-57Initial program 73.1%
Simplified84.9%
Taylor expanded in F around -inf 90.6%
associate-/r*90.6%
Simplified90.6%
Taylor expanded in B around 0 72.6%
*-commutative72.6%
Simplified72.6%
Taylor expanded in F around 0 72.7%
if -8.30000000000000004e-57 < F < 2.99999999999999979e-63Initial program 99.5%
Taylor expanded in F around -inf 41.6%
Taylor expanded in x around inf 72.6%
mul-1-neg72.6%
associate-*r/72.7%
Simplified72.7%
if 2.99999999999999979e-63 < F Initial program 61.8%
Simplified74.6%
Taylor expanded in x around 0 74.3%
associate-*l/74.3%
*-lft-identity74.3%
+-commutative74.3%
unpow274.3%
fma-undefine74.3%
Simplified74.3%
Taylor expanded in F around inf 91.6%
Taylor expanded in B around 0 73.0%
*-commutative73.0%
Simplified73.0%
Final simplification72.8%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (- (/ -1.0 B) (/ x (tan B)))))
(if (<= F 2e-289)
t_0
(if (<= F 9.8e-166)
(/ (- x) (sin B))
(if (or (<= F 1.8e+50) (and (not (<= F 4.9e+120)) (<= F 3e+204)))
t_0
(/ (- 1.0 x) B))))))
double code(double F, double B, double x) {
double t_0 = (-1.0 / B) - (x / tan(B));
double tmp;
if (F <= 2e-289) {
tmp = t_0;
} else if (F <= 9.8e-166) {
tmp = -x / sin(B);
} else if ((F <= 1.8e+50) || (!(F <= 4.9e+120) && (F <= 3e+204))) {
tmp = t_0;
} 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) :: t_0
real(8) :: tmp
t_0 = ((-1.0d0) / b) - (x / tan(b))
if (f <= 2d-289) then
tmp = t_0
else if (f <= 9.8d-166) then
tmp = -x / sin(b)
else if ((f <= 1.8d+50) .or. (.not. (f <= 4.9d+120)) .and. (f <= 3d+204)) then
tmp = t_0
else
tmp = (1.0d0 - x) / b
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = (-1.0 / B) - (x / Math.tan(B));
double tmp;
if (F <= 2e-289) {
tmp = t_0;
} else if (F <= 9.8e-166) {
tmp = -x / Math.sin(B);
} else if ((F <= 1.8e+50) || (!(F <= 4.9e+120) && (F <= 3e+204))) {
tmp = t_0;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
def code(F, B, x): t_0 = (-1.0 / B) - (x / math.tan(B)) tmp = 0 if F <= 2e-289: tmp = t_0 elif F <= 9.8e-166: tmp = -x / math.sin(B) elif (F <= 1.8e+50) or (not (F <= 4.9e+120) and (F <= 3e+204)): tmp = t_0 else: tmp = (1.0 - x) / B return tmp
function code(F, B, x) t_0 = Float64(Float64(-1.0 / B) - Float64(x / tan(B))) tmp = 0.0 if (F <= 2e-289) tmp = t_0; elseif (F <= 9.8e-166) tmp = Float64(Float64(-x) / sin(B)); elseif ((F <= 1.8e+50) || (!(F <= 4.9e+120) && (F <= 3e+204))) tmp = t_0; else tmp = Float64(Float64(1.0 - x) / B); end return tmp end
function tmp_2 = code(F, B, x) t_0 = (-1.0 / B) - (x / tan(B)); tmp = 0.0; if (F <= 2e-289) tmp = t_0; elseif (F <= 9.8e-166) tmp = -x / sin(B); elseif ((F <= 1.8e+50) || (~((F <= 4.9e+120)) && (F <= 3e+204))) tmp = t_0; else tmp = (1.0 - x) / B; end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(N[(-1.0 / B), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, 2e-289], t$95$0, If[LessEqual[F, 9.8e-166], N[((-x) / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[F, 1.8e+50], And[N[Not[LessEqual[F, 4.9e+120]], $MachinePrecision], LessEqual[F, 3e+204]]], t$95$0, N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{-1}{B} - \frac{x}{\tan B}\\
\mathbf{if}\;F \leq 2 \cdot 10^{-289}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;F \leq 9.8 \cdot 10^{-166}:\\
\;\;\;\;\frac{-x}{\sin B}\\
\mathbf{elif}\;F \leq 1.8 \cdot 10^{+50} \lor \neg \left(F \leq 4.9 \cdot 10^{+120}\right) \land F \leq 3 \cdot 10^{+204}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < 2e-289 or 9.7999999999999998e-166 < F < 1.79999999999999993e50 or 4.9000000000000001e120 < F < 2.99999999999999983e204Initial program 82.2%
Simplified89.6%
Taylor expanded in F around -inf 69.1%
associate-/r*69.1%
Simplified69.1%
Taylor expanded in B around 0 65.1%
*-commutative65.1%
Simplified65.1%
Taylor expanded in F around 0 65.7%
if 2e-289 < F < 9.7999999999999998e-166Initial program 99.7%
Taylor expanded in F around -inf 23.7%
Taylor expanded in x around inf 84.3%
Taylor expanded in B around 0 58.1%
if 1.79999999999999993e50 < F < 4.9000000000000001e120 or 2.99999999999999983e204 < F Initial program 47.0%
Simplified64.6%
Taylor expanded in x around 0 64.6%
associate-*l/64.6%
*-lft-identity64.6%
+-commutative64.6%
unpow264.6%
fma-undefine64.6%
Simplified64.6%
Taylor expanded in F around inf 99.5%
Taylor expanded in B around 0 67.1%
Final simplification65.2%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (- (/ -1.0 B) (/ x (tan B)))))
(if (<= F 1.9e-294)
t_0
(if (<= F 1.35e-101)
(/ (- (* F (sqrt 0.5)) x) B)
(if (or (<= F 2.5e+50) (and (not (<= F 2.8e+120)) (<= F 5.2e+204)))
t_0
(/ (- 1.0 x) B))))))
double code(double F, double B, double x) {
double t_0 = (-1.0 / B) - (x / tan(B));
double tmp;
if (F <= 1.9e-294) {
tmp = t_0;
} else if (F <= 1.35e-101) {
tmp = ((F * sqrt(0.5)) - x) / B;
} else if ((F <= 2.5e+50) || (!(F <= 2.8e+120) && (F <= 5.2e+204))) {
tmp = t_0;
} 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) :: t_0
real(8) :: tmp
t_0 = ((-1.0d0) / b) - (x / tan(b))
if (f <= 1.9d-294) then
tmp = t_0
else if (f <= 1.35d-101) then
tmp = ((f * sqrt(0.5d0)) - x) / b
else if ((f <= 2.5d+50) .or. (.not. (f <= 2.8d+120)) .and. (f <= 5.2d+204)) then
tmp = t_0
else
tmp = (1.0d0 - x) / b
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = (-1.0 / B) - (x / Math.tan(B));
double tmp;
if (F <= 1.9e-294) {
tmp = t_0;
} else if (F <= 1.35e-101) {
tmp = ((F * Math.sqrt(0.5)) - x) / B;
} else if ((F <= 2.5e+50) || (!(F <= 2.8e+120) && (F <= 5.2e+204))) {
tmp = t_0;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
def code(F, B, x): t_0 = (-1.0 / B) - (x / math.tan(B)) tmp = 0 if F <= 1.9e-294: tmp = t_0 elif F <= 1.35e-101: tmp = ((F * math.sqrt(0.5)) - x) / B elif (F <= 2.5e+50) or (not (F <= 2.8e+120) and (F <= 5.2e+204)): tmp = t_0 else: tmp = (1.0 - x) / B return tmp
function code(F, B, x) t_0 = Float64(Float64(-1.0 / B) - Float64(x / tan(B))) tmp = 0.0 if (F <= 1.9e-294) tmp = t_0; elseif (F <= 1.35e-101) tmp = Float64(Float64(Float64(F * sqrt(0.5)) - x) / B); elseif ((F <= 2.5e+50) || (!(F <= 2.8e+120) && (F <= 5.2e+204))) tmp = t_0; else tmp = Float64(Float64(1.0 - x) / B); end return tmp end
function tmp_2 = code(F, B, x) t_0 = (-1.0 / B) - (x / tan(B)); tmp = 0.0; if (F <= 1.9e-294) tmp = t_0; elseif (F <= 1.35e-101) tmp = ((F * sqrt(0.5)) - x) / B; elseif ((F <= 2.5e+50) || (~((F <= 2.8e+120)) && (F <= 5.2e+204))) tmp = t_0; else tmp = (1.0 - x) / B; end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(N[(-1.0 / B), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, 1.9e-294], t$95$0, If[LessEqual[F, 1.35e-101], N[(N[(N[(F * N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], If[Or[LessEqual[F, 2.5e+50], And[N[Not[LessEqual[F, 2.8e+120]], $MachinePrecision], LessEqual[F, 5.2e+204]]], t$95$0, N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{-1}{B} - \frac{x}{\tan B}\\
\mathbf{if}\;F \leq 1.9 \cdot 10^{-294}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;F \leq 1.35 \cdot 10^{-101}:\\
\;\;\;\;\frac{F \cdot \sqrt{0.5} - x}{B}\\
\mathbf{elif}\;F \leq 2.5 \cdot 10^{+50} \lor \neg \left(F \leq 2.8 \cdot 10^{+120}\right) \land F \leq 5.2 \cdot 10^{+204}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < 1.9e-294 or 1.3500000000000001e-101 < F < 2.5e50 or 2.8000000000000001e120 < F < 5.2000000000000002e204Initial program 81.4%
Simplified89.1%
Taylor expanded in F around -inf 70.3%
associate-/r*70.3%
Simplified70.3%
Taylor expanded in B around 0 65.5%
*-commutative65.5%
Simplified65.5%
Taylor expanded in F around 0 66.1%
if 1.9e-294 < F < 1.3500000000000001e-101Initial program 99.6%
Simplified99.7%
Taylor expanded in x around 0 99.7%
associate-*l/99.7%
*-lft-identity99.7%
+-commutative99.7%
unpow299.7%
fma-undefine99.7%
Simplified99.7%
Taylor expanded in F around 0 99.8%
Taylor expanded in B around 0 68.0%
if 2.5e50 < F < 2.8000000000000001e120 or 5.2000000000000002e204 < F Initial program 47.0%
Simplified64.6%
Taylor expanded in x around 0 64.6%
associate-*l/64.6%
*-lft-identity64.6%
+-commutative64.6%
unpow264.6%
fma-undefine64.6%
Simplified64.6%
Taylor expanded in F around inf 99.5%
Taylor expanded in B around 0 67.1%
Final simplification66.5%
(FPCore (F B x)
:precision binary64
(if (<= F -1.7e-68)
(- (/ -1.0 B) (/ x (tan B)))
(if (or (<= F 1.75e+50) (and (not (<= F 4.2e+119)) (<= F 3.5e+204)))
(/ -1.0 (/ (tan B) x))
(/ (- 1.0 x) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -1.7e-68) {
tmp = (-1.0 / B) - (x / tan(B));
} else if ((F <= 1.75e+50) || (!(F <= 4.2e+119) && (F <= 3.5e+204))) {
tmp = -1.0 / (tan(B) / x);
} 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.7d-68)) then
tmp = ((-1.0d0) / b) - (x / tan(b))
else if ((f <= 1.75d+50) .or. (.not. (f <= 4.2d+119)) .and. (f <= 3.5d+204)) then
tmp = (-1.0d0) / (tan(b) / x)
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.7e-68) {
tmp = (-1.0 / B) - (x / Math.tan(B));
} else if ((F <= 1.75e+50) || (!(F <= 4.2e+119) && (F <= 3.5e+204))) {
tmp = -1.0 / (Math.tan(B) / x);
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -1.7e-68: tmp = (-1.0 / B) - (x / math.tan(B)) elif (F <= 1.75e+50) or (not (F <= 4.2e+119) and (F <= 3.5e+204)): tmp = -1.0 / (math.tan(B) / x) else: tmp = (1.0 - x) / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= -1.7e-68) tmp = Float64(Float64(-1.0 / B) - Float64(x / tan(B))); elseif ((F <= 1.75e+50) || (!(F <= 4.2e+119) && (F <= 3.5e+204))) tmp = Float64(-1.0 / Float64(tan(B) / x)); 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.7e-68) tmp = (-1.0 / B) - (x / tan(B)); elseif ((F <= 1.75e+50) || (~((F <= 4.2e+119)) && (F <= 3.5e+204))) tmp = -1.0 / (tan(B) / x); else tmp = (1.0 - x) / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -1.7e-68], N[(N[(-1.0 / B), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[F, 1.75e+50], And[N[Not[LessEqual[F, 4.2e+119]], $MachinePrecision], LessEqual[F, 3.5e+204]]], N[(-1.0 / N[(N[Tan[B], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -1.7 \cdot 10^{-68}:\\
\;\;\;\;\frac{-1}{B} - \frac{x}{\tan B}\\
\mathbf{elif}\;F \leq 1.75 \cdot 10^{+50} \lor \neg \left(F \leq 4.2 \cdot 10^{+119}\right) \land F \leq 3.5 \cdot 10^{+204}:\\
\;\;\;\;\frac{-1}{\frac{\tan B}{x}}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -1.70000000000000009e-68Initial program 73.6%
Simplified85.2%
Taylor expanded in F around -inf 90.8%
associate-/r*90.8%
Simplified90.8%
Taylor expanded in B around 0 73.2%
*-commutative73.2%
Simplified73.2%
Taylor expanded in F around 0 73.2%
if -1.70000000000000009e-68 < F < 1.75000000000000003e50 or 4.19999999999999966e119 < F < 3.49999999999999989e204Initial program 92.4%
Taylor expanded in F around -inf 44.8%
Taylor expanded in x around inf 67.6%
*-un-lft-identity67.6%
clear-num67.5%
*-un-lft-identity67.5%
times-frac67.4%
tan-quot67.4%
Applied egg-rr67.4%
*-lft-identity67.4%
associate-*l/67.4%
*-rgt-identity67.4%
*-commutative67.4%
times-frac67.4%
metadata-eval67.4%
Simplified67.4%
if 1.75000000000000003e50 < F < 4.19999999999999966e119 or 3.49999999999999989e204 < F Initial program 47.0%
Simplified64.6%
Taylor expanded in x around 0 64.6%
associate-*l/64.6%
*-lft-identity64.6%
+-commutative64.6%
unpow264.6%
fma-undefine64.6%
Simplified64.6%
Taylor expanded in F around inf 99.5%
Taylor expanded in B around 0 67.1%
Final simplification69.5%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -1.2e-68)
(- (/ -1.0 B) t_0)
(if (<= F 1.2e-63)
(/ -1.0 (/ (tan B) x))
(- (* F (/ 1.0 (* F B))) t_0)))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -1.2e-68) {
tmp = (-1.0 / B) - t_0;
} else if (F <= 1.2e-63) {
tmp = -1.0 / (tan(B) / x);
} else {
tmp = (F * (1.0 / (F * B))) - t_0;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: tmp
t_0 = x / tan(b)
if (f <= (-1.2d-68)) then
tmp = ((-1.0d0) / b) - t_0
else if (f <= 1.2d-63) then
tmp = (-1.0d0) / (tan(b) / x)
else
tmp = (f * (1.0d0 / (f * b))) - t_0
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = x / Math.tan(B);
double tmp;
if (F <= -1.2e-68) {
tmp = (-1.0 / B) - t_0;
} else if (F <= 1.2e-63) {
tmp = -1.0 / (Math.tan(B) / x);
} else {
tmp = (F * (1.0 / (F * B))) - t_0;
}
return tmp;
}
def code(F, B, x): t_0 = x / math.tan(B) tmp = 0 if F <= -1.2e-68: tmp = (-1.0 / B) - t_0 elif F <= 1.2e-63: tmp = -1.0 / (math.tan(B) / x) else: tmp = (F * (1.0 / (F * B))) - t_0 return tmp
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -1.2e-68) tmp = Float64(Float64(-1.0 / B) - t_0); elseif (F <= 1.2e-63) tmp = Float64(-1.0 / Float64(tan(B) / x)); else tmp = Float64(Float64(F * Float64(1.0 / Float64(F * B))) - t_0); end return tmp end
function tmp_2 = code(F, B, x) t_0 = x / tan(B); tmp = 0.0; if (F <= -1.2e-68) tmp = (-1.0 / B) - t_0; elseif (F <= 1.2e-63) tmp = -1.0 / (tan(B) / x); else tmp = (F * (1.0 / (F * B))) - t_0; end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -1.2e-68], N[(N[(-1.0 / B), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 1.2e-63], N[(-1.0 / N[(N[Tan[B], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], N[(N[(F * N[(1.0 / N[(F * B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -1.2 \cdot 10^{-68}:\\
\;\;\;\;\frac{-1}{B} - t\_0\\
\mathbf{elif}\;F \leq 1.2 \cdot 10^{-63}:\\
\;\;\;\;\frac{-1}{\frac{\tan B}{x}}\\
\mathbf{else}:\\
\;\;\;\;F \cdot \frac{1}{F \cdot B} - t\_0\\
\end{array}
\end{array}
if F < -1.19999999999999996e-68Initial program 73.6%
Simplified85.2%
Taylor expanded in F around -inf 90.8%
associate-/r*90.8%
Simplified90.8%
Taylor expanded in B around 0 73.2%
*-commutative73.2%
Simplified73.2%
Taylor expanded in F around 0 73.2%
if -1.19999999999999996e-68 < F < 1.2e-63Initial program 99.5%
Taylor expanded in F around -inf 40.2%
Taylor expanded in x around inf 72.0%
*-un-lft-identity72.0%
clear-num71.8%
*-un-lft-identity71.8%
times-frac71.8%
tan-quot71.7%
Applied egg-rr71.7%
*-lft-identity71.7%
associate-*l/71.8%
*-rgt-identity71.8%
*-commutative71.8%
times-frac71.8%
metadata-eval71.8%
Simplified71.8%
if 1.2e-63 < F Initial program 61.8%
Simplified74.6%
Taylor expanded in x around 0 74.3%
associate-*l/74.3%
*-lft-identity74.3%
+-commutative74.3%
unpow274.3%
fma-undefine74.3%
Simplified74.3%
Taylor expanded in F around inf 91.6%
Taylor expanded in B around 0 73.0%
*-commutative73.0%
Simplified73.0%
Final simplification72.7%
(FPCore (F B x) :precision binary64 (if (<= F -1.06e-10) (/ (- -1.0 x) B) (if (<= F 2.8e+32) (/ (- x) (sin B)) (/ (- 1.0 x) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -1.06e-10) {
tmp = (-1.0 - x) / B;
} else if (F <= 2.8e+32) {
tmp = -x / sin(B);
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if (f <= (-1.06d-10)) then
tmp = ((-1.0d0) - x) / b
else if (f <= 2.8d+32) then
tmp = -x / sin(b)
else
tmp = (1.0d0 - x) / b
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -1.06e-10) {
tmp = (-1.0 - x) / B;
} else if (F <= 2.8e+32) {
tmp = -x / Math.sin(B);
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -1.06e-10: tmp = (-1.0 - x) / B elif F <= 2.8e+32: tmp = -x / math.sin(B) else: tmp = (1.0 - x) / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= -1.06e-10) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= 2.8e+32) tmp = Float64(Float64(-x) / sin(B)); else tmp = Float64(Float64(1.0 - x) / B); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -1.06e-10) tmp = (-1.0 - x) / B; elseif (F <= 2.8e+32) tmp = -x / sin(B); else tmp = (1.0 - x) / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -1.06e-10], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 2.8e+32], N[((-x) / N[Sin[B], $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -1.06 \cdot 10^{-10}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq 2.8 \cdot 10^{+32}:\\
\;\;\;\;\frac{-x}{\sin B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -1.06e-10Initial program 68.8%
Taylor expanded in F around -inf 98.4%
Taylor expanded in B around 0 55.5%
Taylor expanded in B around 0 56.1%
associate-*r/56.1%
distribute-lft-in56.1%
metadata-eval56.1%
neg-mul-156.1%
unsub-neg56.1%
Simplified56.1%
if -1.06e-10 < F < 2.8e32Initial program 99.5%
Taylor expanded in F around -inf 41.7%
Taylor expanded in x around inf 65.8%
Taylor expanded in B around 0 38.6%
if 2.8e32 < F Initial program 53.1%
Simplified68.8%
Taylor expanded in x around 0 68.8%
associate-*l/68.8%
*-lft-identity68.8%
+-commutative68.8%
unpow268.8%
fma-undefine68.8%
Simplified68.8%
Taylor expanded in F around inf 99.6%
Taylor expanded in B around 0 56.8%
Final simplification48.6%
(FPCore (F B x) :precision binary64 (if (<= F -1.22e-55) (/ (- -1.0 x) B) (if (<= F 4.6e-54) (- (/ x B)) (/ (- 1.0 x) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -1.22e-55) {
tmp = (-1.0 - x) / B;
} else if (F <= 4.6e-54) {
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.22d-55)) then
tmp = ((-1.0d0) - x) / b
else if (f <= 4.6d-54) 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.22e-55) {
tmp = (-1.0 - x) / B;
} else if (F <= 4.6e-54) {
tmp = -(x / B);
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -1.22e-55: tmp = (-1.0 - x) / B elif F <= 4.6e-54: tmp = -(x / B) else: tmp = (1.0 - x) / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= -1.22e-55) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= 4.6e-54) 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.22e-55) tmp = (-1.0 - x) / B; elseif (F <= 4.6e-54) tmp = -(x / B); else tmp = (1.0 - x) / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -1.22e-55], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 4.6e-54], (-N[(x / B), $MachinePrecision]), N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -1.22 \cdot 10^{-55}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq 4.6 \cdot 10^{-54}:\\
\;\;\;\;-\frac{x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -1.22e-55Initial program 73.1%
Taylor expanded in F around -inf 90.6%
Taylor expanded in B around 0 49.1%
Taylor expanded in B around 0 50.0%
associate-*r/50.0%
distribute-lft-in50.0%
metadata-eval50.0%
neg-mul-150.0%
unsub-neg50.0%
Simplified50.0%
if -1.22e-55 < F < 4.5999999999999998e-54Initial program 99.5%
Taylor expanded in F around -inf 41.8%
Taylor expanded in B around 0 23.9%
mul-1-neg23.9%
Simplified23.9%
Taylor expanded in x around inf 41.0%
if 4.5999999999999998e-54 < F Initial program 60.8%
Simplified73.9%
Taylor expanded in x around 0 73.6%
associate-*l/73.6%
*-lft-identity73.6%
+-commutative73.6%
unpow273.6%
fma-undefine73.6%
Simplified73.6%
Taylor expanded in F around inf 92.6%
Taylor expanded in B around 0 50.8%
Final simplification47.2%
(FPCore (F B x) :precision binary64 (if (or (<= x -2.2e-177) (not (<= x 4.8e-235))) (- (/ x B)) (/ -1.0 B)))
double code(double F, double B, double x) {
double tmp;
if ((x <= -2.2e-177) || !(x <= 4.8e-235)) {
tmp = -(x / B);
} else {
tmp = -1.0 / 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 <= (-2.2d-177)) .or. (.not. (x <= 4.8d-235))) then
tmp = -(x / b)
else
tmp = (-1.0d0) / b
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if ((x <= -2.2e-177) || !(x <= 4.8e-235)) {
tmp = -(x / B);
} else {
tmp = -1.0 / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if (x <= -2.2e-177) or not (x <= 4.8e-235): tmp = -(x / B) else: tmp = -1.0 / B return tmp
function code(F, B, x) tmp = 0.0 if ((x <= -2.2e-177) || !(x <= 4.8e-235)) tmp = Float64(-Float64(x / B)); else tmp = Float64(-1.0 / B); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if ((x <= -2.2e-177) || ~((x <= 4.8e-235))) tmp = -(x / B); else tmp = -1.0 / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[Or[LessEqual[x, -2.2e-177], N[Not[LessEqual[x, 4.8e-235]], $MachinePrecision]], (-N[(x / B), $MachinePrecision]), N[(-1.0 / B), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.2 \cdot 10^{-177} \lor \neg \left(x \leq 4.8 \cdot 10^{-235}\right):\\
\;\;\;\;-\frac{x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{-1}{B}\\
\end{array}
\end{array}
if x < -2.20000000000000011e-177 or 4.80000000000000022e-235 < x Initial program 76.7%
Taylor expanded in F around -inf 66.7%
Taylor expanded in B around 0 35.3%
mul-1-neg35.3%
Simplified35.3%
Taylor expanded in x around inf 37.3%
if -2.20000000000000011e-177 < x < 4.80000000000000022e-235Initial program 84.3%
Taylor expanded in F around -inf 31.0%
Taylor expanded in B around 0 22.0%
mul-1-neg22.0%
Simplified22.0%
Taylor expanded in x around 0 22.0%
Final simplification34.3%
(FPCore (F B x) :precision binary64 (if (<= F -1.5e-57) (/ (- -1.0 x) B) (- (/ x B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -1.5e-57) {
tmp = (-1.0 - x) / B;
} else {
tmp = -(x / B);
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if (f <= (-1.5d-57)) then
tmp = ((-1.0d0) - x) / b
else
tmp = -(x / b)
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -1.5e-57) {
tmp = (-1.0 - x) / B;
} else {
tmp = -(x / B);
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -1.5e-57: tmp = (-1.0 - x) / B else: tmp = -(x / B) return tmp
function code(F, B, x) tmp = 0.0 if (F <= -1.5e-57) tmp = Float64(Float64(-1.0 - x) / B); else tmp = Float64(-Float64(x / B)); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -1.5e-57) tmp = (-1.0 - x) / B; else tmp = -(x / B); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -1.5e-57], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], (-N[(x / B), $MachinePrecision])]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -1.5 \cdot 10^{-57}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{else}:\\
\;\;\;\;-\frac{x}{B}\\
\end{array}
\end{array}
if F < -1.5e-57Initial program 73.1%
Taylor expanded in F around -inf 90.6%
Taylor expanded in B around 0 49.1%
Taylor expanded in B around 0 50.0%
associate-*r/50.0%
distribute-lft-in50.0%
metadata-eval50.0%
neg-mul-150.0%
unsub-neg50.0%
Simplified50.0%
if -1.5e-57 < F Initial program 81.1%
Taylor expanded in F around -inf 42.3%
Taylor expanded in B around 0 23.0%
mul-1-neg23.0%
Simplified23.0%
Taylor expanded in x around inf 32.4%
Final simplification38.7%
(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 78.2%
Taylor expanded in F around -inf 59.6%
Taylor expanded in B around 0 32.7%
mul-1-neg32.7%
Simplified32.7%
Taylor expanded in x around 0 11.0%
Final simplification11.0%
herbie shell --seed 2024053
(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))))))