
(FPCore (F B x) :precision binary64 (+ (- (* x (/ 1.0 (tan B)))) (* (/ F (sin B)) (pow (+ (+ (* F F) 2.0) (* 2.0 x)) (- (/ 1.0 2.0))))))
double code(double F, double B, double x) {
return -(x * (1.0 / tan(B))) + ((F / sin(B)) * pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
code = -(x * (1.0d0 / tan(b))) + ((f / sin(b)) * ((((f * f) + 2.0d0) + (2.0d0 * x)) ** -(1.0d0 / 2.0d0)))
end function
public static double code(double F, double B, double x) {
return -(x * (1.0 / Math.tan(B))) + ((F / Math.sin(B)) * Math.pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
}
def code(F, B, x): return -(x * (1.0 / math.tan(B))) + ((F / math.sin(B)) * math.pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)))
function code(F, B, x) return Float64(Float64(-Float64(x * Float64(1.0 / tan(B)))) + Float64(Float64(F / sin(B)) * (Float64(Float64(Float64(F * F) + 2.0) + Float64(2.0 * x)) ^ Float64(-Float64(1.0 / 2.0))))) end
function tmp = code(F, B, x) tmp = -(x * (1.0 / tan(B))) + ((F / sin(B)) * ((((F * F) + 2.0) + (2.0 * x)) ^ -(1.0 / 2.0))); end
code[F_, B_, x_] := N[((-N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]) + N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Power[N[(N[(N[(F * F), $MachinePrecision] + 2.0), $MachinePrecision] + N[(2.0 * x), $MachinePrecision]), $MachinePrecision], (-N[(1.0 / 2.0), $MachinePrecision])], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 22 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (F B x) :precision binary64 (+ (- (* x (/ 1.0 (tan B)))) (* (/ F (sin B)) (pow (+ (+ (* F F) 2.0) (* 2.0 x)) (- (/ 1.0 2.0))))))
double code(double F, double B, double x) {
return -(x * (1.0 / tan(B))) + ((F / sin(B)) * pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
code = -(x * (1.0d0 / tan(b))) + ((f / sin(b)) * ((((f * f) + 2.0d0) + (2.0d0 * x)) ** -(1.0d0 / 2.0d0)))
end function
public static double code(double F, double B, double x) {
return -(x * (1.0 / Math.tan(B))) + ((F / Math.sin(B)) * Math.pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
}
def code(F, B, x): return -(x * (1.0 / math.tan(B))) + ((F / math.sin(B)) * math.pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)))
function code(F, B, x) return Float64(Float64(-Float64(x * Float64(1.0 / tan(B)))) + Float64(Float64(F / sin(B)) * (Float64(Float64(Float64(F * F) + 2.0) + Float64(2.0 * x)) ^ Float64(-Float64(1.0 / 2.0))))) end
function tmp = code(F, B, x) tmp = -(x * (1.0 / tan(B))) + ((F / sin(B)) * ((((F * F) + 2.0) + (2.0 * x)) ^ -(1.0 / 2.0))); end
code[F_, B_, x_] := N[((-N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]) + N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Power[N[(N[(N[(F * F), $MachinePrecision] + 2.0), $MachinePrecision] + N[(2.0 * x), $MachinePrecision]), $MachinePrecision], (-N[(1.0 / 2.0), $MachinePrecision])], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}
\end{array}
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -3.45e+19)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 100000000.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 <= -3.45e+19) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 100000000.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 <= -3.45e+19) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 100000000.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, -3.45e+19], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 100000000.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 -3.45 \cdot 10^{+19}:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq 100000000:\\
\;\;\;\;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 < -3.45e19Initial program 65.8%
Taylor expanded in F around -inf 99.8%
+-commutative99.8%
unsub-neg99.8%
un-div-inv99.9%
Applied egg-rr99.9%
if -3.45e19 < F < 1e8Initial program 99.5%
Simplified99.7%
if 1e8 < 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
(let* ((t_0 (/ x (tan B))))
(if (<= F -3.6e+34)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 5300000000.0)
(-
(* (/ F (sin B)) (pow (+ (+ 2.0 (* F F)) (* x 2.0)) -0.5))
(/ (* 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 <= -3.6e+34) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 5300000000.0) {
tmp = ((F / sin(B)) * pow(((2.0 + (F * F)) + (x * 2.0)), -0.5)) - ((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 <= (-3.6d+34)) then
tmp = ((-1.0d0) / sin(b)) - t_0
else if (f <= 5300000000.0d0) then
tmp = ((f / sin(b)) * (((2.0d0 + (f * f)) + (x * 2.0d0)) ** (-0.5d0))) - ((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 <= -3.6e+34) {
tmp = (-1.0 / Math.sin(B)) - t_0;
} else if (F <= 5300000000.0) {
tmp = ((F / Math.sin(B)) * Math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5)) - ((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 <= -3.6e+34: tmp = (-1.0 / math.sin(B)) - t_0 elif F <= 5300000000.0: tmp = ((F / math.sin(B)) * math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5)) - ((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 <= -3.6e+34) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); 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(Float64(x * 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 <= -3.6e+34) tmp = (-1.0 / sin(B)) - t_0; elseif (F <= 5300000000.0) tmp = ((F / sin(B)) * (((2.0 + (F * F)) + (x * 2.0)) ^ -0.5)) - ((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, -3.6e+34], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $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[(x * N[Cos[B], $MachinePrecision]), $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 -3.6 \cdot 10^{+34}:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq 5300000000:\\
\;\;\;\;\frac{F}{\sin B} \cdot {\left(\left(2 + F \cdot F\right) + x \cdot 2\right)}^{-0.5} - \frac{x \cdot \cos B}{\sin B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_0\\
\end{array}
\end{array}
if F < -3.6e34Initial program 63.2%
Taylor expanded in F around -inf 99.8%
+-commutative99.8%
unsub-neg99.8%
un-div-inv99.9%
Applied egg-rr99.9%
if -3.6e34 < F < 5.3e9Initial program 99.5%
Taylor expanded in x around 0 99.5%
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 -5e+19)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 110000000.0)
(- (* F (/ (sqrt (/ 1.0 (fma F F 2.0))) (sin B))) t_0)
(- (/ 1.0 (sin B)) t_0)))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -5e+19) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 110000000.0) {
tmp = (F * (sqrt((1.0 / fma(F, F, 2.0))) / sin(B))) - t_0;
} else {
tmp = (1.0 / sin(B)) - t_0;
}
return tmp;
}
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -5e+19) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 110000000.0) tmp = Float64(Float64(F * Float64(sqrt(Float64(1.0 / fma(F, F, 2.0))) / sin(B))) - t_0); else tmp = Float64(Float64(1.0 / sin(B)) - t_0); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -5e+19], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 110000000.0], N[(N[(F * N[(N[Sqrt[N[(1.0 / N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -5 \cdot 10^{+19}:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq 110000000:\\
\;\;\;\;F \cdot \frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B} - t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_0\\
\end{array}
\end{array}
if F < -5e19Initial program 65.8%
Taylor expanded in F around -inf 99.8%
+-commutative99.8%
unsub-neg99.8%
un-div-inv99.9%
Applied egg-rr99.9%
if -5e19 < F < 1.1e8Initial 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%
if 1.1e8 < 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 -2.23e+43)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 75000000.0)
(+
(* (/ F (sin B)) (pow (+ (+ 2.0 (* F F)) (* x 2.0)) -0.5))
(* x (/ -1.0 (tan B))))
(- (/ 1.0 (sin B)) t_0)))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -2.23e+43) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 75000000.0) {
tmp = ((F / sin(B)) * pow(((2.0 + (F * F)) + (x * 2.0)), -0.5)) + (x * (-1.0 / tan(B)));
} else {
tmp = (1.0 / sin(B)) - t_0;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: tmp
t_0 = x / tan(b)
if (f <= (-2.23d+43)) then
tmp = ((-1.0d0) / sin(b)) - t_0
else if (f <= 75000000.0d0) then
tmp = ((f / sin(b)) * (((2.0d0 + (f * f)) + (x * 2.0d0)) ** (-0.5d0))) + (x * ((-1.0d0) / tan(b)))
else
tmp = (1.0d0 / sin(b)) - t_0
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = x / Math.tan(B);
double tmp;
if (F <= -2.23e+43) {
tmp = (-1.0 / Math.sin(B)) - t_0;
} else if (F <= 75000000.0) {
tmp = ((F / Math.sin(B)) * Math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5)) + (x * (-1.0 / Math.tan(B)));
} else {
tmp = (1.0 / Math.sin(B)) - t_0;
}
return tmp;
}
def code(F, B, x): t_0 = x / math.tan(B) tmp = 0 if F <= -2.23e+43: tmp = (-1.0 / math.sin(B)) - t_0 elif F <= 75000000.0: tmp = ((F / math.sin(B)) * math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5)) + (x * (-1.0 / math.tan(B))) else: tmp = (1.0 / math.sin(B)) - t_0 return tmp
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -2.23e+43) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 75000000.0) tmp = Float64(Float64(Float64(F / sin(B)) * (Float64(Float64(2.0 + Float64(F * F)) + Float64(x * 2.0)) ^ -0.5)) + Float64(x * Float64(-1.0 / tan(B)))); else tmp = Float64(Float64(1.0 / sin(B)) - t_0); end return tmp end
function tmp_2 = code(F, B, x) t_0 = x / tan(B); tmp = 0.0; if (F <= -2.23e+43) tmp = (-1.0 / sin(B)) - t_0; elseif (F <= 75000000.0) tmp = ((F / sin(B)) * (((2.0 + (F * F)) + (x * 2.0)) ^ -0.5)) + (x * (-1.0 / tan(B))); else tmp = (1.0 / sin(B)) - t_0; end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -2.23e+43], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 75000000.0], N[(N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Power[N[(N[(2.0 + N[(F * F), $MachinePrecision]), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision] + N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -2.23 \cdot 10^{+43}:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq 75000000:\\
\;\;\;\;\frac{F}{\sin B} \cdot {\left(\left(2 + F \cdot F\right) + x \cdot 2\right)}^{-0.5} + x \cdot \frac{-1}{\tan B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_0\\
\end{array}
\end{array}
if F < -2.23e43Initial program 61.5%
Taylor expanded in F around -inf 99.8%
+-commutative99.8%
unsub-neg99.8%
un-div-inv99.9%
Applied egg-rr99.9%
if -2.23e43 < F < 7.5e7Initial program 99.5%
if 7.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 (/ 1.0 (sin B))) (t_1 (/ x (tan B))))
(if (<= F -1.42)
(- (/ -1.0 (sin B)) t_1)
(if (<= F 1.4)
(- (* F (* t_0 (sqrt (/ 1.0 (+ 2.0 (* x 2.0)))))) t_1)
(- t_0 t_1)))))
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.42) {
tmp = (-1.0 / sin(B)) - t_1;
} else if (F <= 1.4) {
tmp = (F * (t_0 * sqrt((1.0 / (2.0 + (x * 2.0)))))) - t_1;
} else {
tmp = t_0 - 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 = 1.0d0 / sin(b)
t_1 = x / tan(b)
if (f <= (-1.42d0)) then
tmp = ((-1.0d0) / sin(b)) - t_1
else if (f <= 1.4d0) then
tmp = (f * (t_0 * sqrt((1.0d0 / (2.0d0 + (x * 2.0d0)))))) - t_1
else
tmp = t_0 - t_1
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.42) {
tmp = (-1.0 / Math.sin(B)) - t_1;
} else if (F <= 1.4) {
tmp = (F * (t_0 * Math.sqrt((1.0 / (2.0 + (x * 2.0)))))) - t_1;
} else {
tmp = t_0 - t_1;
}
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.42: tmp = (-1.0 / math.sin(B)) - t_1 elif F <= 1.4: tmp = (F * (t_0 * math.sqrt((1.0 / (2.0 + (x * 2.0)))))) - t_1 else: tmp = t_0 - t_1 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.42) tmp = Float64(Float64(-1.0 / sin(B)) - t_1); elseif (F <= 1.4) 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 - t_1); 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.42) tmp = (-1.0 / sin(B)) - t_1; elseif (F <= 1.4) tmp = (F * (t_0 * sqrt((1.0 / (2.0 + (x * 2.0)))))) - t_1; else tmp = t_0 - t_1; 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.42], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[F, 1.4], 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 - t$95$1), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{1}{\sin B}\\
t_1 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -1.42:\\
\;\;\;\;\frac{-1}{\sin B} - t\_1\\
\mathbf{elif}\;F \leq 1.4:\\
\;\;\;\;F \cdot \left(t\_0 \cdot \sqrt{\frac{1}{2 + x \cdot 2}}\right) - t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_0 - t\_1\\
\end{array}
\end{array}
if F < -1.4199999999999999Initial program 68.4%
Taylor expanded in F around -inf 99.5%
+-commutative99.5%
unsub-neg99.5%
un-div-inv99.6%
Applied egg-rr99.6%
if -1.4199999999999999 < F < 1.3999999999999999Initial program 99.5%
Simplified99.7%
Taylor expanded in F around 0 98.9%
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.4%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -1.42)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 1.4)
(- (* F (/ (sqrt 0.5) (sin B))) t_0)
(- (/ 1.0 (sin B)) t_0)))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -1.42) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 1.4) {
tmp = (F * (sqrt(0.5) / sin(B))) - t_0;
} else {
tmp = (1.0 / sin(B)) - t_0;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: tmp
t_0 = x / tan(b)
if (f <= (-1.42d0)) then
tmp = ((-1.0d0) / sin(b)) - t_0
else if (f <= 1.4d0) then
tmp = (f * (sqrt(0.5d0) / sin(b))) - t_0
else
tmp = (1.0d0 / sin(b)) - t_0
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = x / Math.tan(B);
double tmp;
if (F <= -1.42) {
tmp = (-1.0 / Math.sin(B)) - t_0;
} else if (F <= 1.4) {
tmp = (F * (Math.sqrt(0.5) / Math.sin(B))) - t_0;
} else {
tmp = (1.0 / Math.sin(B)) - t_0;
}
return tmp;
}
def code(F, B, x): t_0 = x / math.tan(B) tmp = 0 if F <= -1.42: tmp = (-1.0 / math.sin(B)) - t_0 elif F <= 1.4: tmp = (F * (math.sqrt(0.5) / math.sin(B))) - t_0 else: tmp = (1.0 / math.sin(B)) - t_0 return tmp
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -1.42) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 1.4) tmp = Float64(Float64(F * Float64(sqrt(0.5) / sin(B))) - t_0); else tmp = Float64(Float64(1.0 / sin(B)) - t_0); end return tmp end
function tmp_2 = code(F, B, x) t_0 = x / tan(B); tmp = 0.0; if (F <= -1.42) tmp = (-1.0 / sin(B)) - t_0; elseif (F <= 1.4) tmp = (F * (sqrt(0.5) / sin(B))) - t_0; else tmp = (1.0 / sin(B)) - t_0; end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -1.42], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 1.4], N[(N[(F * N[(N[Sqrt[0.5], $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -1.42:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq 1.4:\\
\;\;\;\;F \cdot \frac{\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%
Taylor expanded in F around -inf 99.5%
+-commutative99.5%
unsub-neg99.5%
un-div-inv99.6%
Applied egg-rr99.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
(-
(* (/ F (sin B)) (pow (+ (+ 2.0 (* F F)) (* x 2.0)) -0.5))
(/ x B)))
(t_1 (/ x (tan B))))
(if (<= F -30500000000000.0)
(- (/ -1.0 (sin B)) t_1)
(if (<= F -1.45e-190)
t_0
(if (<= F 3.6e-153)
(* (cos B) (- (/ x (sin B))))
(if (<= F 3.8e-6) t_0 (- (/ 1.0 (sin B)) t_1)))))))
double code(double F, double B, double x) {
double t_0 = ((F / sin(B)) * pow(((2.0 + (F * F)) + (x * 2.0)), -0.5)) - (x / B);
double t_1 = x / tan(B);
double tmp;
if (F <= -30500000000000.0) {
tmp = (-1.0 / sin(B)) - t_1;
} else if (F <= -1.45e-190) {
tmp = t_0;
} else if (F <= 3.6e-153) {
tmp = cos(B) * -(x / sin(B));
} else if (F <= 3.8e-6) {
tmp = t_0;
} else {
tmp = (1.0 / sin(B)) - t_1;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = ((f / sin(b)) * (((2.0d0 + (f * f)) + (x * 2.0d0)) ** (-0.5d0))) - (x / b)
t_1 = x / tan(b)
if (f <= (-30500000000000.0d0)) then
tmp = ((-1.0d0) / sin(b)) - t_1
else if (f <= (-1.45d-190)) then
tmp = t_0
else if (f <= 3.6d-153) then
tmp = cos(b) * -(x / sin(b))
else if (f <= 3.8d-6) then
tmp = t_0
else
tmp = (1.0d0 / sin(b)) - t_1
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = ((F / Math.sin(B)) * Math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5)) - (x / B);
double t_1 = x / Math.tan(B);
double tmp;
if (F <= -30500000000000.0) {
tmp = (-1.0 / Math.sin(B)) - t_1;
} else if (F <= -1.45e-190) {
tmp = t_0;
} else if (F <= 3.6e-153) {
tmp = Math.cos(B) * -(x / Math.sin(B));
} else if (F <= 3.8e-6) {
tmp = t_0;
} else {
tmp = (1.0 / Math.sin(B)) - t_1;
}
return tmp;
}
def code(F, B, x): t_0 = ((F / math.sin(B)) * math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5)) - (x / B) t_1 = x / math.tan(B) tmp = 0 if F <= -30500000000000.0: tmp = (-1.0 / math.sin(B)) - t_1 elif F <= -1.45e-190: tmp = t_0 elif F <= 3.6e-153: tmp = math.cos(B) * -(x / math.sin(B)) elif F <= 3.8e-6: tmp = t_0 else: tmp = (1.0 / math.sin(B)) - t_1 return tmp
function code(F, B, x) t_0 = Float64(Float64(Float64(F / sin(B)) * (Float64(Float64(2.0 + Float64(F * F)) + Float64(x * 2.0)) ^ -0.5)) - Float64(x / B)) t_1 = Float64(x / tan(B)) tmp = 0.0 if (F <= -30500000000000.0) tmp = Float64(Float64(-1.0 / sin(B)) - t_1); elseif (F <= -1.45e-190) tmp = t_0; elseif (F <= 3.6e-153) tmp = Float64(cos(B) * Float64(-Float64(x / sin(B)))); elseif (F <= 3.8e-6) tmp = t_0; else tmp = Float64(Float64(1.0 / sin(B)) - t_1); end return tmp end
function tmp_2 = code(F, B, x) t_0 = ((F / sin(B)) * (((2.0 + (F * F)) + (x * 2.0)) ^ -0.5)) - (x / B); t_1 = x / tan(B); tmp = 0.0; if (F <= -30500000000000.0) tmp = (-1.0 / sin(B)) - t_1; elseif (F <= -1.45e-190) tmp = t_0; elseif (F <= 3.6e-153) tmp = cos(B) * -(x / sin(B)); elseif (F <= 3.8e-6) tmp = t_0; else tmp = (1.0 / sin(B)) - t_1; end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Power[N[(N[(2.0 + N[(F * F), $MachinePrecision]), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -30500000000000.0], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[F, -1.45e-190], t$95$0, If[LessEqual[F, 3.6e-153], N[(N[Cos[B], $MachinePrecision] * (-N[(x / N[Sin[B], $MachinePrecision]), $MachinePrecision])), $MachinePrecision], If[LessEqual[F, 3.8e-6], t$95$0, N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{F}{\sin B} \cdot {\left(\left(2 + F \cdot F\right) + x \cdot 2\right)}^{-0.5} - \frac{x}{B}\\
t_1 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -30500000000000:\\
\;\;\;\;\frac{-1}{\sin B} - t\_1\\
\mathbf{elif}\;F \leq -1.45 \cdot 10^{-190}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;F \leq 3.6 \cdot 10^{-153}:\\
\;\;\;\;\cos B \cdot \left(-\frac{x}{\sin B}\right)\\
\mathbf{elif}\;F \leq 3.8 \cdot 10^{-6}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_1\\
\end{array}
\end{array}
if F < -3.05e13Initial program 67.1%
Taylor expanded in F around -inf 99.8%
+-commutative99.8%
unsub-neg99.8%
un-div-inv99.9%
Applied egg-rr99.9%
if -3.05e13 < F < -1.4500000000000001e-190 or 3.5999999999999998e-153 < F < 3.8e-6Initial program 99.5%
Taylor expanded in B around 0 77.3%
if -1.4500000000000001e-190 < F < 3.5999999999999998e-153Initial program 99.5%
Taylor expanded in F around -inf 37.6%
Taylor expanded in x around inf 87.3%
mul-1-neg87.3%
associate-*l/87.4%
*-commutative87.4%
distribute-rgt-neg-in87.4%
Simplified87.4%
if 3.8e-6 < F Initial program 57.0%
Simplified71.4%
Taylor expanded in x around 0 71.3%
associate-*l/71.3%
*-lft-identity71.3%
+-commutative71.3%
unpow271.3%
fma-undefine71.3%
Simplified71.3%
Taylor expanded in F around inf 98.6%
Final simplification91.6%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (pow (+ (+ 2.0 (* F F)) (* x 2.0)) -0.5)) (t_1 (/ x (tan B))))
(if (<= F -30500000000000.0)
(- (/ -1.0 (sin B)) t_1)
(if (<= F -3.15e-114)
(- (* (/ F (sin B)) t_0) (/ x B))
(if (<= F 5300000000.0)
(+ (/ -1.0 (/ (tan B) x)) (* t_0 (/ F B)))
(- (/ 1.0 (sin B)) t_1))))))
double code(double F, double B, double x) {
double t_0 = pow(((2.0 + (F * F)) + (x * 2.0)), -0.5);
double t_1 = x / tan(B);
double tmp;
if (F <= -30500000000000.0) {
tmp = (-1.0 / sin(B)) - t_1;
} else if (F <= -3.15e-114) {
tmp = ((F / sin(B)) * t_0) - (x / B);
} else if (F <= 5300000000.0) {
tmp = (-1.0 / (tan(B) / x)) + (t_0 * (F / B));
} 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 = ((2.0d0 + (f * f)) + (x * 2.0d0)) ** (-0.5d0)
t_1 = x / tan(b)
if (f <= (-30500000000000.0d0)) then
tmp = ((-1.0d0) / sin(b)) - t_1
else if (f <= (-3.15d-114)) then
tmp = ((f / sin(b)) * t_0) - (x / b)
else if (f <= 5300000000.0d0) then
tmp = ((-1.0d0) / (tan(b) / x)) + (t_0 * (f / b))
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 = Math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5);
double t_1 = x / Math.tan(B);
double tmp;
if (F <= -30500000000000.0) {
tmp = (-1.0 / Math.sin(B)) - t_1;
} else if (F <= -3.15e-114) {
tmp = ((F / Math.sin(B)) * t_0) - (x / B);
} else if (F <= 5300000000.0) {
tmp = (-1.0 / (Math.tan(B) / x)) + (t_0 * (F / B));
} else {
tmp = (1.0 / Math.sin(B)) - t_1;
}
return tmp;
}
def code(F, B, x): t_0 = math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5) t_1 = x / math.tan(B) tmp = 0 if F <= -30500000000000.0: tmp = (-1.0 / math.sin(B)) - t_1 elif F <= -3.15e-114: tmp = ((F / math.sin(B)) * t_0) - (x / B) elif F <= 5300000000.0: tmp = (-1.0 / (math.tan(B) / x)) + (t_0 * (F / B)) else: tmp = (1.0 / math.sin(B)) - t_1 return tmp
function code(F, B, x) t_0 = Float64(Float64(2.0 + Float64(F * F)) + Float64(x * 2.0)) ^ -0.5 t_1 = Float64(x / tan(B)) tmp = 0.0 if (F <= -30500000000000.0) tmp = Float64(Float64(-1.0 / sin(B)) - t_1); elseif (F <= -3.15e-114) tmp = Float64(Float64(Float64(F / sin(B)) * t_0) - Float64(x / B)); elseif (F <= 5300000000.0) tmp = Float64(Float64(-1.0 / Float64(tan(B) / x)) + Float64(t_0 * Float64(F / B))); else tmp = Float64(Float64(1.0 / sin(B)) - t_1); end return tmp end
function tmp_2 = code(F, B, x) t_0 = ((2.0 + (F * F)) + (x * 2.0)) ^ -0.5; t_1 = x / tan(B); tmp = 0.0; if (F <= -30500000000000.0) tmp = (-1.0 / sin(B)) - t_1; elseif (F <= -3.15e-114) tmp = ((F / sin(B)) * t_0) - (x / B); elseif (F <= 5300000000.0) tmp = (-1.0 / (tan(B) / x)) + (t_0 * (F / B)); else tmp = (1.0 / sin(B)) - t_1; end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[Power[N[(N[(2.0 + N[(F * F), $MachinePrecision]), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]}, Block[{t$95$1 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -30500000000000.0], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[F, -3.15e-114], N[(N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 5300000000.0], N[(N[(-1.0 / N[(N[Tan[B], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] + N[(t$95$0 * N[(F / B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\left(\left(2 + F \cdot F\right) + x \cdot 2\right)}^{-0.5}\\
t_1 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -30500000000000:\\
\;\;\;\;\frac{-1}{\sin B} - t\_1\\
\mathbf{elif}\;F \leq -3.15 \cdot 10^{-114}:\\
\;\;\;\;\frac{F}{\sin B} \cdot t\_0 - \frac{x}{B}\\
\mathbf{elif}\;F \leq 5300000000:\\
\;\;\;\;\frac{-1}{\frac{\tan B}{x}} + t\_0 \cdot \frac{F}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_1\\
\end{array}
\end{array}
if F < -3.05e13Initial program 67.1%
Taylor expanded in F around -inf 99.8%
+-commutative99.8%
unsub-neg99.8%
un-div-inv99.9%
Applied egg-rr99.9%
if -3.05e13 < F < -3.15000000000000007e-114Initial program 99.4%
Taylor expanded in B around 0 83.4%
if -3.15000000000000007e-114 < F < 5.3e9Initial program 99.5%
div-inv99.7%
clear-num99.4%
Applied egg-rr99.4%
Taylor expanded in B around 0 85.0%
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 simplification93.1%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -1.65e-68)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 5e-12) (* (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 <= -1.65e-68) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 5e-12) {
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 <= (-1.65d-68)) then
tmp = ((-1.0d0) / sin(b)) - t_0
else if (f <= 5d-12) 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 <= -1.65e-68) {
tmp = (-1.0 / Math.sin(B)) - t_0;
} else if (F <= 5e-12) {
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 <= -1.65e-68: tmp = (-1.0 / math.sin(B)) - t_0 elif F <= 5e-12: 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 <= -1.65e-68) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 5e-12) 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 <= -1.65e-68) tmp = (-1.0 / sin(B)) - t_0; elseif (F <= 5e-12) 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, -1.65e-68], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 5e-12], 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 -1.65 \cdot 10^{-68}:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq 5 \cdot 10^{-12}:\\
\;\;\;\;\cos B \cdot \left(-\frac{x}{\sin B}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_0\\
\end{array}
\end{array}
if F < -1.6499999999999999e-68Initial program 73.6%
Taylor expanded in F around -inf 90.8%
+-commutative90.8%
unsub-neg90.8%
un-div-inv90.9%
Applied egg-rr90.9%
if -1.6499999999999999e-68 < F < 4.9999999999999997e-12Initial program 99.5%
Taylor expanded in F around -inf 39.4%
Taylor expanded in x around inf 70.0%
mul-1-neg70.0%
associate-*l/70.1%
*-commutative70.1%
distribute-rgt-neg-in70.1%
Simplified70.1%
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 simplification85.5%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -1.55e-68)
(- (/ -1.0 B) t_0)
(if (<= F 3.9e-140)
(* (cos B) (- (/ x (sin B))))
(if (or (<= F 1.55e+133) (not (<= F 2e+172)))
(- (/ 1.0 B) t_0)
(/ 1.0 (sin B)))))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -1.55e-68) {
tmp = (-1.0 / B) - t_0;
} else if (F <= 3.9e-140) {
tmp = cos(B) * -(x / sin(B));
} else if ((F <= 1.55e+133) || !(F <= 2e+172)) {
tmp = (1.0 / B) - t_0;
} else {
tmp = 1.0 / 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.55d-68)) then
tmp = ((-1.0d0) / b) - t_0
else if (f <= 3.9d-140) then
tmp = cos(b) * -(x / sin(b))
else if ((f <= 1.55d+133) .or. (.not. (f <= 2d+172))) then
tmp = (1.0d0 / b) - t_0
else
tmp = 1.0d0 / 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.55e-68) {
tmp = (-1.0 / B) - t_0;
} else if (F <= 3.9e-140) {
tmp = Math.cos(B) * -(x / Math.sin(B));
} else if ((F <= 1.55e+133) || !(F <= 2e+172)) {
tmp = (1.0 / B) - t_0;
} else {
tmp = 1.0 / Math.sin(B);
}
return tmp;
}
def code(F, B, x): t_0 = x / math.tan(B) tmp = 0 if F <= -1.55e-68: tmp = (-1.0 / B) - t_0 elif F <= 3.9e-140: tmp = math.cos(B) * -(x / math.sin(B)) elif (F <= 1.55e+133) or not (F <= 2e+172): tmp = (1.0 / B) - t_0 else: tmp = 1.0 / math.sin(B) return tmp
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -1.55e-68) tmp = Float64(Float64(-1.0 / B) - t_0); elseif (F <= 3.9e-140) tmp = Float64(cos(B) * Float64(-Float64(x / sin(B)))); elseif ((F <= 1.55e+133) || !(F <= 2e+172)) tmp = Float64(Float64(1.0 / B) - t_0); else tmp = Float64(1.0 / sin(B)); end return tmp end
function tmp_2 = code(F, B, x) t_0 = x / tan(B); tmp = 0.0; if (F <= -1.55e-68) tmp = (-1.0 / B) - t_0; elseif (F <= 3.9e-140) tmp = cos(B) * -(x / sin(B)); elseif ((F <= 1.55e+133) || ~((F <= 2e+172))) tmp = (1.0 / B) - t_0; else tmp = 1.0 / 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.55e-68], N[(N[(-1.0 / B), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 3.9e-140], N[(N[Cos[B], $MachinePrecision] * (-N[(x / N[Sin[B], $MachinePrecision]), $MachinePrecision])), $MachinePrecision], If[Or[LessEqual[F, 1.55e+133], N[Not[LessEqual[F, 2e+172]], $MachinePrecision]], N[(N[(1.0 / B), $MachinePrecision] - t$95$0), $MachinePrecision], N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -1.55 \cdot 10^{-68}:\\
\;\;\;\;\frac{-1}{B} - t\_0\\
\mathbf{elif}\;F \leq 3.9 \cdot 10^{-140}:\\
\;\;\;\;\cos B \cdot \left(-\frac{x}{\sin B}\right)\\
\mathbf{elif}\;F \leq 1.55 \cdot 10^{+133} \lor \neg \left(F \leq 2 \cdot 10^{+172}\right):\\
\;\;\;\;\frac{1}{B} - t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B}\\
\end{array}
\end{array}
if F < -1.55e-68Initial program 73.6%
Taylor expanded in F around -inf 90.8%
Taylor expanded in B around 0 73.1%
div-inv73.2%
Applied egg-rr73.2%
if -1.55e-68 < F < 3.90000000000000019e-140Initial program 99.5%
Taylor expanded in F around -inf 37.0%
Taylor expanded in x around inf 74.1%
mul-1-neg74.1%
associate-*l/74.2%
*-commutative74.2%
distribute-rgt-neg-in74.2%
Simplified74.2%
if 3.90000000000000019e-140 < F < 1.55e133 or 2.0000000000000002e172 < F Initial program 69.3%
Simplified80.4%
Taylor expanded in x around 0 80.0%
associate-*l/80.1%
*-lft-identity80.1%
+-commutative80.1%
unpow280.1%
fma-undefine80.1%
Simplified80.1%
Taylor expanded in F around inf 86.7%
Taylor expanded in B around 0 75.2%
if 1.55e133 < F < 2.0000000000000002e172Initial program 40.1%
Simplified51.9%
Taylor expanded in x around 0 51.7%
associate-*l/51.7%
*-lft-identity51.7%
+-commutative51.7%
unpow251.7%
fma-undefine51.7%
Simplified51.7%
Taylor expanded in F around inf 99.8%
Taylor expanded in x around 0 82.2%
Final simplification74.4%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -1.7e-68)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 7.2e-140)
(* (cos B) (- (/ x (sin B))))
(if (or (<= F 1.25e+133) (not (<= F 2.5e+173)))
(- (/ 1.0 B) t_0)
(/ 1.0 (sin B)))))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -1.7e-68) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 7.2e-140) {
tmp = cos(B) * -(x / sin(B));
} else if ((F <= 1.25e+133) || !(F <= 2.5e+173)) {
tmp = (1.0 / B) - t_0;
} else {
tmp = 1.0 / 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.7d-68)) then
tmp = ((-1.0d0) / sin(b)) - t_0
else if (f <= 7.2d-140) then
tmp = cos(b) * -(x / sin(b))
else if ((f <= 1.25d+133) .or. (.not. (f <= 2.5d+173))) then
tmp = (1.0d0 / b) - t_0
else
tmp = 1.0d0 / 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.7e-68) {
tmp = (-1.0 / Math.sin(B)) - t_0;
} else if (F <= 7.2e-140) {
tmp = Math.cos(B) * -(x / Math.sin(B));
} else if ((F <= 1.25e+133) || !(F <= 2.5e+173)) {
tmp = (1.0 / B) - t_0;
} else {
tmp = 1.0 / Math.sin(B);
}
return tmp;
}
def code(F, B, x): t_0 = x / math.tan(B) tmp = 0 if F <= -1.7e-68: tmp = (-1.0 / math.sin(B)) - t_0 elif F <= 7.2e-140: tmp = math.cos(B) * -(x / math.sin(B)) elif (F <= 1.25e+133) or not (F <= 2.5e+173): tmp = (1.0 / B) - t_0 else: tmp = 1.0 / math.sin(B) return tmp
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -1.7e-68) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 7.2e-140) tmp = Float64(cos(B) * Float64(-Float64(x / sin(B)))); elseif ((F <= 1.25e+133) || !(F <= 2.5e+173)) tmp = Float64(Float64(1.0 / B) - t_0); else tmp = Float64(1.0 / sin(B)); end return tmp end
function tmp_2 = code(F, B, x) t_0 = x / tan(B); tmp = 0.0; if (F <= -1.7e-68) tmp = (-1.0 / sin(B)) - t_0; elseif (F <= 7.2e-140) tmp = cos(B) * -(x / sin(B)); elseif ((F <= 1.25e+133) || ~((F <= 2.5e+173))) tmp = (1.0 / B) - t_0; else tmp = 1.0 / 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.7e-68], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 7.2e-140], N[(N[Cos[B], $MachinePrecision] * (-N[(x / N[Sin[B], $MachinePrecision]), $MachinePrecision])), $MachinePrecision], If[Or[LessEqual[F, 1.25e+133], N[Not[LessEqual[F, 2.5e+173]], $MachinePrecision]], N[(N[(1.0 / B), $MachinePrecision] - t$95$0), $MachinePrecision], N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -1.7 \cdot 10^{-68}:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq 7.2 \cdot 10^{-140}:\\
\;\;\;\;\cos B \cdot \left(-\frac{x}{\sin B}\right)\\
\mathbf{elif}\;F \leq 1.25 \cdot 10^{+133} \lor \neg \left(F \leq 2.5 \cdot 10^{+173}\right):\\
\;\;\;\;\frac{1}{B} - t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B}\\
\end{array}
\end{array}
if F < -1.70000000000000009e-68Initial program 73.6%
Taylor expanded in F around -inf 90.8%
+-commutative90.8%
unsub-neg90.8%
un-div-inv90.9%
Applied egg-rr90.9%
if -1.70000000000000009e-68 < F < 7.2000000000000001e-140Initial program 99.5%
Taylor expanded in F around -inf 37.0%
Taylor expanded in x around inf 74.1%
mul-1-neg74.1%
associate-*l/74.2%
*-commutative74.2%
distribute-rgt-neg-in74.2%
Simplified74.2%
if 7.2000000000000001e-140 < F < 1.2499999999999999e133 or 2.50000000000000017e173 < F Initial program 69.3%
Simplified80.4%
Taylor expanded in x around 0 80.0%
associate-*l/80.1%
*-lft-identity80.1%
+-commutative80.1%
unpow280.1%
fma-undefine80.1%
Simplified80.1%
Taylor expanded in F around inf 86.7%
Taylor expanded in B around 0 75.2%
if 1.2499999999999999e133 < F < 2.50000000000000017e173Initial program 40.1%
Simplified51.9%
Taylor expanded in x around 0 51.7%
associate-*l/51.7%
*-lft-identity51.7%
+-commutative51.7%
unpow251.7%
fma-undefine51.7%
Simplified51.7%
Taylor expanded in F around inf 99.8%
Taylor expanded in x around 0 82.2%
Final simplification80.9%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (- (/ 1.0 B) (/ x (tan B)))))
(if (<= F -4.5e-18)
(- (/ -1.0 (sin B)) (/ x B))
(if (<= F 5.6e-287)
t_0
(if (<= F 1.35e-177)
(* (cos B) (/ x (- B)))
(if (or (<= F 1.35e+133) (not (<= F 3.8e+172)))
t_0
(/ 1.0 (sin B))))))))
double code(double F, double B, double x) {
double t_0 = (1.0 / B) - (x / tan(B));
double tmp;
if (F <= -4.5e-18) {
tmp = (-1.0 / sin(B)) - (x / B);
} else if (F <= 5.6e-287) {
tmp = t_0;
} else if (F <= 1.35e-177) {
tmp = cos(B) * (x / -B);
} else if ((F <= 1.35e+133) || !(F <= 3.8e+172)) {
tmp = t_0;
} else {
tmp = 1.0 / 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 = (1.0d0 / b) - (x / tan(b))
if (f <= (-4.5d-18)) then
tmp = ((-1.0d0) / sin(b)) - (x / b)
else if (f <= 5.6d-287) then
tmp = t_0
else if (f <= 1.35d-177) then
tmp = cos(b) * (x / -b)
else if ((f <= 1.35d+133) .or. (.not. (f <= 3.8d+172))) then
tmp = t_0
else
tmp = 1.0d0 / sin(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 <= -4.5e-18) {
tmp = (-1.0 / Math.sin(B)) - (x / B);
} else if (F <= 5.6e-287) {
tmp = t_0;
} else if (F <= 1.35e-177) {
tmp = Math.cos(B) * (x / -B);
} else if ((F <= 1.35e+133) || !(F <= 3.8e+172)) {
tmp = t_0;
} else {
tmp = 1.0 / Math.sin(B);
}
return tmp;
}
def code(F, B, x): t_0 = (1.0 / B) - (x / math.tan(B)) tmp = 0 if F <= -4.5e-18: tmp = (-1.0 / math.sin(B)) - (x / B) elif F <= 5.6e-287: tmp = t_0 elif F <= 1.35e-177: tmp = math.cos(B) * (x / -B) elif (F <= 1.35e+133) or not (F <= 3.8e+172): tmp = t_0 else: tmp = 1.0 / math.sin(B) return tmp
function code(F, B, x) t_0 = Float64(Float64(1.0 / B) - Float64(x / tan(B))) tmp = 0.0 if (F <= -4.5e-18) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B)); elseif (F <= 5.6e-287) tmp = t_0; elseif (F <= 1.35e-177) tmp = Float64(cos(B) * Float64(x / Float64(-B))); elseif ((F <= 1.35e+133) || !(F <= 3.8e+172)) tmp = t_0; else tmp = Float64(1.0 / sin(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 <= -4.5e-18) tmp = (-1.0 / sin(B)) - (x / B); elseif (F <= 5.6e-287) tmp = t_0; elseif (F <= 1.35e-177) tmp = cos(B) * (x / -B); elseif ((F <= 1.35e+133) || ~((F <= 3.8e+172))) tmp = t_0; else tmp = 1.0 / sin(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, -4.5e-18], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 5.6e-287], t$95$0, If[LessEqual[F, 1.35e-177], N[(N[Cos[B], $MachinePrecision] * N[(x / (-B)), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[F, 1.35e+133], N[Not[LessEqual[F, 3.8e+172]], $MachinePrecision]], t$95$0, N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{1}{B} - \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -4.5 \cdot 10^{-18}:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\
\mathbf{elif}\;F \leq 5.6 \cdot 10^{-287}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;F \leq 1.35 \cdot 10^{-177}:\\
\;\;\;\;\cos B \cdot \frac{x}{-B}\\
\mathbf{elif}\;F \leq 1.35 \cdot 10^{+133} \lor \neg \left(F \leq 3.8 \cdot 10^{+172}\right):\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B}\\
\end{array}
\end{array}
if F < -4.49999999999999994e-18Initial program 69.5%
Taylor expanded in F around -inf 97.3%
Taylor expanded in B around 0 76.4%
if -4.49999999999999994e-18 < F < 5.6000000000000005e-287 or 1.3500000000000001e-177 < F < 1.3500000000000001e133 or 3.7999999999999997e172 < F Initial program 82.0%
Simplified88.5%
Taylor expanded in x around 0 88.2%
associate-*l/88.3%
*-lft-identity88.3%
+-commutative88.3%
unpow288.3%
fma-undefine88.3%
Simplified88.3%
Taylor expanded in F around inf 68.6%
Taylor expanded in B around 0 66.8%
if 5.6000000000000005e-287 < F < 1.3500000000000001e-177Initial program 99.6%
Taylor expanded in F around -inf 20.8%
Taylor expanded in x around inf 83.0%
mul-1-neg83.0%
associate-*l/82.9%
*-commutative82.9%
distribute-rgt-neg-in82.9%
Simplified82.9%
Taylor expanded in B around 0 56.8%
if 1.3500000000000001e133 < F < 3.7999999999999997e172Initial program 40.1%
Simplified51.9%
Taylor expanded in x around 0 51.7%
associate-*l/51.7%
*-lft-identity51.7%
+-commutative51.7%
unpow251.7%
fma-undefine51.7%
Simplified51.7%
Taylor expanded in F around inf 99.8%
Taylor expanded in x around 0 82.2%
Final simplification69.5%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ 1.0 (sin B))) (t_1 (/ x (tan B))) (t_2 (- (/ 1.0 B) t_1)))
(if (<= x -4.1e-144)
t_2
(if (<= x -1.15e-200)
(+ t_1 (/ -1.0 B))
(if (<= x 1.4e-217)
t_0
(if (<= x 4e-159)
(* (cos B) (/ x (- B)))
(if (<= x 1.3e-23) t_0 t_2)))))))
double code(double F, double B, double x) {
double t_0 = 1.0 / sin(B);
double t_1 = x / tan(B);
double t_2 = (1.0 / B) - t_1;
double tmp;
if (x <= -4.1e-144) {
tmp = t_2;
} else if (x <= -1.15e-200) {
tmp = t_1 + (-1.0 / B);
} else if (x <= 1.4e-217) {
tmp = t_0;
} else if (x <= 4e-159) {
tmp = cos(B) * (x / -B);
} else if (x <= 1.3e-23) {
tmp = t_0;
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_0 = 1.0d0 / sin(b)
t_1 = x / tan(b)
t_2 = (1.0d0 / b) - t_1
if (x <= (-4.1d-144)) then
tmp = t_2
else if (x <= (-1.15d-200)) then
tmp = t_1 + ((-1.0d0) / b)
else if (x <= 1.4d-217) then
tmp = t_0
else if (x <= 4d-159) then
tmp = cos(b) * (x / -b)
else if (x <= 1.3d-23) then
tmp = t_0
else
tmp = t_2
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 t_2 = (1.0 / B) - t_1;
double tmp;
if (x <= -4.1e-144) {
tmp = t_2;
} else if (x <= -1.15e-200) {
tmp = t_1 + (-1.0 / B);
} else if (x <= 1.4e-217) {
tmp = t_0;
} else if (x <= 4e-159) {
tmp = Math.cos(B) * (x / -B);
} else if (x <= 1.3e-23) {
tmp = t_0;
} else {
tmp = t_2;
}
return tmp;
}
def code(F, B, x): t_0 = 1.0 / math.sin(B) t_1 = x / math.tan(B) t_2 = (1.0 / B) - t_1 tmp = 0 if x <= -4.1e-144: tmp = t_2 elif x <= -1.15e-200: tmp = t_1 + (-1.0 / B) elif x <= 1.4e-217: tmp = t_0 elif x <= 4e-159: tmp = math.cos(B) * (x / -B) elif x <= 1.3e-23: tmp = t_0 else: tmp = t_2 return tmp
function code(F, B, x) t_0 = Float64(1.0 / sin(B)) t_1 = Float64(x / tan(B)) t_2 = Float64(Float64(1.0 / B) - t_1) tmp = 0.0 if (x <= -4.1e-144) tmp = t_2; elseif (x <= -1.15e-200) tmp = Float64(t_1 + Float64(-1.0 / B)); elseif (x <= 1.4e-217) tmp = t_0; elseif (x <= 4e-159) tmp = Float64(cos(B) * Float64(x / Float64(-B))); elseif (x <= 1.3e-23) tmp = t_0; else tmp = t_2; end return tmp end
function tmp_2 = code(F, B, x) t_0 = 1.0 / sin(B); t_1 = x / tan(B); t_2 = (1.0 / B) - t_1; tmp = 0.0; if (x <= -4.1e-144) tmp = t_2; elseif (x <= -1.15e-200) tmp = t_1 + (-1.0 / B); elseif (x <= 1.4e-217) tmp = t_0; elseif (x <= 4e-159) tmp = cos(B) * (x / -B); elseif (x <= 1.3e-23) tmp = t_0; else tmp = t_2; 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]}, Block[{t$95$2 = N[(N[(1.0 / B), $MachinePrecision] - t$95$1), $MachinePrecision]}, If[LessEqual[x, -4.1e-144], t$95$2, If[LessEqual[x, -1.15e-200], N[(t$95$1 + N[(-1.0 / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.4e-217], t$95$0, If[LessEqual[x, 4e-159], N[(N[Cos[B], $MachinePrecision] * N[(x / (-B)), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.3e-23], t$95$0, t$95$2]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{1}{\sin B}\\
t_1 := \frac{x}{\tan B}\\
t_2 := \frac{1}{B} - t\_1\\
\mathbf{if}\;x \leq -4.1 \cdot 10^{-144}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \leq -1.15 \cdot 10^{-200}:\\
\;\;\;\;t\_1 + \frac{-1}{B}\\
\mathbf{elif}\;x \leq 1.4 \cdot 10^{-217}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 4 \cdot 10^{-159}:\\
\;\;\;\;\cos B \cdot \frac{x}{-B}\\
\mathbf{elif}\;x \leq 1.3 \cdot 10^{-23}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if x < -4.1e-144 or 1.3e-23 < x Initial program 80.4%
Simplified92.0%
Taylor expanded in x around 0 91.8%
associate-*l/91.8%
*-lft-identity91.8%
+-commutative91.8%
unpow291.8%
fma-undefine91.8%
Simplified91.8%
Taylor expanded in F around inf 84.6%
Taylor expanded in B around 0 87.1%
if -4.1e-144 < x < -1.15000000000000004e-200Initial program 93.0%
Taylor expanded in F around -inf 53.7%
Taylor expanded in B around 0 53.7%
*-un-lft-identity53.7%
add-sqr-sqrt33.7%
sqrt-unprod53.3%
div-inv53.3%
div-inv53.3%
sqr-neg53.3%
sqrt-unprod19.7%
add-sqr-sqrt53.6%
Applied egg-rr53.6%
*-lft-identity53.6%
+-commutative53.6%
Simplified53.6%
if -1.15000000000000004e-200 < x < 1.4e-217 or 3.99999999999999995e-159 < x < 1.3e-23Initial program 68.7%
Simplified73.9%
Taylor expanded in x around 0 73.9%
associate-*l/73.9%
*-lft-identity73.9%
+-commutative73.9%
unpow273.9%
fma-undefine73.9%
Simplified73.9%
Taylor expanded in F around inf 35.1%
Taylor expanded in x around 0 35.1%
if 1.4e-217 < x < 3.99999999999999995e-159Initial program 88.0%
Taylor expanded in F around -inf 38.3%
Taylor expanded in x around inf 42.4%
mul-1-neg42.4%
associate-*l/42.4%
*-commutative42.4%
distribute-rgt-neg-in42.4%
Simplified42.4%
Taylor expanded in B around 0 31.3%
Final simplification66.2%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F 6.2e-287)
(- (/ -1.0 B) t_0)
(if (<= F 5.8e-185)
(* (cos B) (/ x (- B)))
(if (or (<= F 1.45e+133) (not (<= F 3.8e+172)))
(- (/ 1.0 B) t_0)
(/ 1.0 (sin B)))))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= 6.2e-287) {
tmp = (-1.0 / B) - t_0;
} else if (F <= 5.8e-185) {
tmp = cos(B) * (x / -B);
} else if ((F <= 1.45e+133) || !(F <= 3.8e+172)) {
tmp = (1.0 / B) - t_0;
} else {
tmp = 1.0 / 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 <= 6.2d-287) then
tmp = ((-1.0d0) / b) - t_0
else if (f <= 5.8d-185) then
tmp = cos(b) * (x / -b)
else if ((f <= 1.45d+133) .or. (.not. (f <= 3.8d+172))) then
tmp = (1.0d0 / b) - t_0
else
tmp = 1.0d0 / 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 <= 6.2e-287) {
tmp = (-1.0 / B) - t_0;
} else if (F <= 5.8e-185) {
tmp = Math.cos(B) * (x / -B);
} else if ((F <= 1.45e+133) || !(F <= 3.8e+172)) {
tmp = (1.0 / B) - t_0;
} else {
tmp = 1.0 / Math.sin(B);
}
return tmp;
}
def code(F, B, x): t_0 = x / math.tan(B) tmp = 0 if F <= 6.2e-287: tmp = (-1.0 / B) - t_0 elif F <= 5.8e-185: tmp = math.cos(B) * (x / -B) elif (F <= 1.45e+133) or not (F <= 3.8e+172): tmp = (1.0 / B) - t_0 else: tmp = 1.0 / math.sin(B) return tmp
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= 6.2e-287) tmp = Float64(Float64(-1.0 / B) - t_0); elseif (F <= 5.8e-185) tmp = Float64(cos(B) * Float64(x / Float64(-B))); elseif ((F <= 1.45e+133) || !(F <= 3.8e+172)) tmp = Float64(Float64(1.0 / B) - t_0); else tmp = Float64(1.0 / sin(B)); end return tmp end
function tmp_2 = code(F, B, x) t_0 = x / tan(B); tmp = 0.0; if (F <= 6.2e-287) tmp = (-1.0 / B) - t_0; elseif (F <= 5.8e-185) tmp = cos(B) * (x / -B); elseif ((F <= 1.45e+133) || ~((F <= 3.8e+172))) tmp = (1.0 / B) - t_0; else tmp = 1.0 / 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, 6.2e-287], N[(N[(-1.0 / B), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 5.8e-185], N[(N[Cos[B], $MachinePrecision] * N[(x / (-B)), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[F, 1.45e+133], N[Not[LessEqual[F, 3.8e+172]], $MachinePrecision]], N[(N[(1.0 / B), $MachinePrecision] - t$95$0), $MachinePrecision], N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq 6.2 \cdot 10^{-287}:\\
\;\;\;\;\frac{-1}{B} - t\_0\\
\mathbf{elif}\;F \leq 5.8 \cdot 10^{-185}:\\
\;\;\;\;\cos B \cdot \frac{x}{-B}\\
\mathbf{elif}\;F \leq 1.45 \cdot 10^{+133} \lor \neg \left(F \leq 3.8 \cdot 10^{+172}\right):\\
\;\;\;\;\frac{1}{B} - t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B}\\
\end{array}
\end{array}
if F < 6.2000000000000001e-287Initial program 81.6%
Taylor expanded in F around -inf 76.8%
Taylor expanded in B around 0 68.5%
div-inv68.6%
Applied egg-rr68.6%
if 6.2000000000000001e-287 < F < 5.79999999999999989e-185Initial program 99.6%
Taylor expanded in F around -inf 20.8%
Taylor expanded in x around inf 83.0%
mul-1-neg83.0%
associate-*l/82.9%
*-commutative82.9%
distribute-rgt-neg-in82.9%
Simplified82.9%
Taylor expanded in B around 0 56.8%
if 5.79999999999999989e-185 < F < 1.4500000000000001e133 or 3.7999999999999997e172 < F Initial program 71.3%
Simplified81.6%
Taylor expanded in x around 0 81.3%
associate-*l/81.4%
*-lft-identity81.4%
+-commutative81.4%
unpow281.4%
fma-undefine81.4%
Simplified81.4%
Taylor expanded in F around inf 83.3%
Taylor expanded in B around 0 73.9%
if 1.4500000000000001e133 < F < 3.7999999999999997e172Initial program 40.1%
Simplified51.9%
Taylor expanded in x around 0 51.7%
associate-*l/51.7%
*-lft-identity51.7%
+-commutative51.7%
unpow251.7%
fma-undefine51.7%
Simplified51.7%
Taylor expanded in F around inf 99.8%
Taylor expanded in x around 0 82.2%
Final simplification69.9%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F 1e-292)
(- (/ -1.0 B) t_0)
(if (<= F 1.15e-111)
(- (* (sqrt (/ 1.0 (+ 2.0 (* x 2.0)))) (/ F B)) (/ x B))
(if (or (<= F 9.5e+132) (not (<= F 3.8e+172)))
(- (/ 1.0 B) t_0)
(/ 1.0 (sin B)))))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= 1e-292) {
tmp = (-1.0 / B) - t_0;
} else if (F <= 1.15e-111) {
tmp = (sqrt((1.0 / (2.0 + (x * 2.0)))) * (F / B)) - (x / B);
} else if ((F <= 9.5e+132) || !(F <= 3.8e+172)) {
tmp = (1.0 / B) - t_0;
} else {
tmp = 1.0 / 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 <= 1d-292) then
tmp = ((-1.0d0) / b) - t_0
else if (f <= 1.15d-111) then
tmp = (sqrt((1.0d0 / (2.0d0 + (x * 2.0d0)))) * (f / b)) - (x / b)
else if ((f <= 9.5d+132) .or. (.not. (f <= 3.8d+172))) then
tmp = (1.0d0 / b) - t_0
else
tmp = 1.0d0 / 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 <= 1e-292) {
tmp = (-1.0 / B) - t_0;
} else if (F <= 1.15e-111) {
tmp = (Math.sqrt((1.0 / (2.0 + (x * 2.0)))) * (F / B)) - (x / B);
} else if ((F <= 9.5e+132) || !(F <= 3.8e+172)) {
tmp = (1.0 / B) - t_0;
} else {
tmp = 1.0 / Math.sin(B);
}
return tmp;
}
def code(F, B, x): t_0 = x / math.tan(B) tmp = 0 if F <= 1e-292: tmp = (-1.0 / B) - t_0 elif F <= 1.15e-111: tmp = (math.sqrt((1.0 / (2.0 + (x * 2.0)))) * (F / B)) - (x / B) elif (F <= 9.5e+132) or not (F <= 3.8e+172): tmp = (1.0 / B) - t_0 else: tmp = 1.0 / math.sin(B) return tmp
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= 1e-292) tmp = Float64(Float64(-1.0 / B) - t_0); elseif (F <= 1.15e-111) tmp = Float64(Float64(sqrt(Float64(1.0 / Float64(2.0 + Float64(x * 2.0)))) * Float64(F / B)) - Float64(x / B)); elseif ((F <= 9.5e+132) || !(F <= 3.8e+172)) tmp = Float64(Float64(1.0 / B) - t_0); else tmp = Float64(1.0 / sin(B)); end return tmp end
function tmp_2 = code(F, B, x) t_0 = x / tan(B); tmp = 0.0; if (F <= 1e-292) tmp = (-1.0 / B) - t_0; elseif (F <= 1.15e-111) tmp = (sqrt((1.0 / (2.0 + (x * 2.0)))) * (F / B)) - (x / B); elseif ((F <= 9.5e+132) || ~((F <= 3.8e+172))) tmp = (1.0 / B) - t_0; else tmp = 1.0 / 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, 1e-292], N[(N[(-1.0 / B), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 1.15e-111], N[(N[(N[Sqrt[N[(1.0 / N[(2.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(F / B), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[F, 9.5e+132], N[Not[LessEqual[F, 3.8e+172]], $MachinePrecision]], N[(N[(1.0 / B), $MachinePrecision] - t$95$0), $MachinePrecision], N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq 10^{-292}:\\
\;\;\;\;\frac{-1}{B} - t\_0\\
\mathbf{elif}\;F \leq 1.15 \cdot 10^{-111}:\\
\;\;\;\;\sqrt{\frac{1}{2 + x \cdot 2}} \cdot \frac{F}{B} - \frac{x}{B}\\
\mathbf{elif}\;F \leq 9.5 \cdot 10^{+132} \lor \neg \left(F \leq 3.8 \cdot 10^{+172}\right):\\
\;\;\;\;\frac{1}{B} - t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B}\\
\end{array}
\end{array}
if F < 1.0000000000000001e-292Initial program 81.6%
Taylor expanded in F around -inf 76.8%
Taylor expanded in B around 0 68.5%
div-inv68.6%
Applied egg-rr68.6%
if 1.0000000000000001e-292 < F < 1.15e-111Initial program 99.6%
div-inv99.8%
clear-num99.5%
Applied egg-rr99.5%
Taylor expanded in B around 0 93.7%
Taylor expanded in B around 0 69.9%
Taylor expanded in F around 0 70.0%
if 1.15e-111 < F < 9.5000000000000005e132 or 3.7999999999999997e172 < F Initial program 67.8%
Simplified79.4%
Taylor expanded in x around 0 79.0%
associate-*l/79.1%
*-lft-identity79.1%
+-commutative79.1%
unpow279.1%
fma-undefine79.1%
Simplified79.1%
Taylor expanded in F around inf 87.2%
Taylor expanded in B around 0 75.2%
if 9.5000000000000005e132 < F < 3.7999999999999997e172Initial program 40.1%
Simplified51.9%
Taylor expanded in x around 0 51.7%
associate-*l/51.7%
*-lft-identity51.7%
+-commutative51.7%
unpow251.7%
fma-undefine51.7%
Simplified51.7%
Taylor expanded in F around inf 99.8%
Taylor expanded in x around 0 82.2%
Final simplification71.3%
(FPCore (F B x) :precision binary64 (if (<= F -3.1e-57) (/ (- -1.0 x) B) (if (<= F 1.7e+50) (/ x (- B)) (/ 1.0 (sin B)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -3.1e-57) {
tmp = (-1.0 - x) / B;
} else if (F <= 1.7e+50) {
tmp = x / -B;
} else {
tmp = 1.0 / 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.1d-57)) then
tmp = ((-1.0d0) - x) / b
else if (f <= 1.7d+50) then
tmp = x / -b
else
tmp = 1.0d0 / sin(b)
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -3.1e-57) {
tmp = (-1.0 - x) / B;
} else if (F <= 1.7e+50) {
tmp = x / -B;
} else {
tmp = 1.0 / Math.sin(B);
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -3.1e-57: tmp = (-1.0 - x) / B elif F <= 1.7e+50: tmp = x / -B else: tmp = 1.0 / math.sin(B) return tmp
function code(F, B, x) tmp = 0.0 if (F <= -3.1e-57) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= 1.7e+50) tmp = Float64(x / Float64(-B)); else tmp = Float64(1.0 / sin(B)); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -3.1e-57) tmp = (-1.0 - x) / B; elseif (F <= 1.7e+50) tmp = x / -B; else tmp = 1.0 / sin(B); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -3.1e-57], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 1.7e+50], N[(x / (-B)), $MachinePrecision], N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -3.1 \cdot 10^{-57}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq 1.7 \cdot 10^{+50}:\\
\;\;\;\;\frac{x}{-B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B}\\
\end{array}
\end{array}
if F < -3.09999999999999976e-57Initial program 73.1%
Taylor expanded in F around -inf 90.6%
Taylor expanded in B around 0 50.0%
mul-1-neg50.0%
distribute-neg-frac250.0%
Simplified50.0%
Taylor expanded in B around 0 50.0%
associate-*r/50.0%
neg-mul-150.0%
distribute-neg-in50.0%
metadata-eval50.0%
unsub-neg50.0%
Simplified50.0%
if -3.09999999999999976e-57 < F < 1.6999999999999999e50Initial program 98.5%
Taylor expanded in F around -inf 43.8%
Taylor expanded in B around 0 24.8%
mul-1-neg24.8%
distribute-neg-frac224.8%
Simplified24.8%
Taylor expanded in x around inf 39.1%
mul-1-neg39.1%
distribute-neg-frac239.1%
Simplified39.1%
if 1.6999999999999999e50 < F Initial program 51.7%
Simplified66.8%
Taylor expanded in x around 0 66.7%
associate-*l/66.7%
*-lft-identity66.7%
+-commutative66.7%
unpow266.7%
fma-undefine66.7%
Simplified66.7%
Taylor expanded in F around inf 99.8%
Taylor expanded in x around 0 60.5%
Final simplification48.1%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (- B))))
(if (<= F -3.4e+55)
t_0
(if (<= F -3.8e-7) (/ -1.0 B) (if (<= F 1.72e+50) t_0 (/ (+ x 1.0) B))))))
double code(double F, double B, double x) {
double t_0 = x / -B;
double tmp;
if (F <= -3.4e+55) {
tmp = t_0;
} else if (F <= -3.8e-7) {
tmp = -1.0 / B;
} else if (F <= 1.72e+50) {
tmp = t_0;
} else {
tmp = (x + 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) :: t_0
real(8) :: tmp
t_0 = x / -b
if (f <= (-3.4d+55)) then
tmp = t_0
else if (f <= (-3.8d-7)) then
tmp = (-1.0d0) / b
else if (f <= 1.72d+50) then
tmp = t_0
else
tmp = (x + 1.0d0) / b
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = x / -B;
double tmp;
if (F <= -3.4e+55) {
tmp = t_0;
} else if (F <= -3.8e-7) {
tmp = -1.0 / B;
} else if (F <= 1.72e+50) {
tmp = t_0;
} else {
tmp = (x + 1.0) / B;
}
return tmp;
}
def code(F, B, x): t_0 = x / -B tmp = 0 if F <= -3.4e+55: tmp = t_0 elif F <= -3.8e-7: tmp = -1.0 / B elif F <= 1.72e+50: tmp = t_0 else: tmp = (x + 1.0) / B return tmp
function code(F, B, x) t_0 = Float64(x / Float64(-B)) tmp = 0.0 if (F <= -3.4e+55) tmp = t_0; elseif (F <= -3.8e-7) tmp = Float64(-1.0 / B); elseif (F <= 1.72e+50) tmp = t_0; else tmp = Float64(Float64(x + 1.0) / B); end return tmp end
function tmp_2 = code(F, B, x) t_0 = x / -B; tmp = 0.0; if (F <= -3.4e+55) tmp = t_0; elseif (F <= -3.8e-7) tmp = -1.0 / B; elseif (F <= 1.72e+50) tmp = t_0; else tmp = (x + 1.0) / B; end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / (-B)), $MachinePrecision]}, If[LessEqual[F, -3.4e+55], t$95$0, If[LessEqual[F, -3.8e-7], N[(-1.0 / B), $MachinePrecision], If[LessEqual[F, 1.72e+50], t$95$0, N[(N[(x + 1.0), $MachinePrecision] / B), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{-B}\\
\mathbf{if}\;F \leq -3.4 \cdot 10^{+55}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;F \leq -3.8 \cdot 10^{-7}:\\
\;\;\;\;\frac{-1}{B}\\
\mathbf{elif}\;F \leq 1.72 \cdot 10^{+50}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{x + 1}{B}\\
\end{array}
\end{array}
if F < -3.3999999999999998e55 or -3.80000000000000015e-7 < F < 1.72e50Initial program 85.1%
Taylor expanded in F around -inf 62.8%
Taylor expanded in B around 0 34.9%
mul-1-neg34.9%
distribute-neg-frac234.9%
Simplified34.9%
Taylor expanded in x around inf 35.9%
mul-1-neg35.9%
distribute-neg-frac235.9%
Simplified35.9%
if -3.3999999999999998e55 < F < -3.80000000000000015e-7Initial program 99.5%
Taylor expanded in F around -inf 94.1%
Taylor expanded in B around 0 53.1%
mul-1-neg53.1%
distribute-neg-frac253.1%
Simplified53.1%
Taylor expanded in x around 0 38.5%
if 1.72e50 < F Initial program 51.7%
Taylor expanded in F around -inf 39.8%
Taylor expanded in B around 0 19.8%
mul-1-neg19.8%
distribute-neg-frac219.8%
Simplified19.8%
add-sqr-sqrt10.7%
sqrt-unprod18.5%
sqr-neg18.5%
sqrt-unprod16.8%
add-sqr-sqrt37.3%
*-un-lft-identity37.3%
Applied egg-rr37.3%
*-lft-identity37.3%
Simplified37.3%
Final simplification36.4%
(FPCore (F B x) :precision binary64 (if (<= F -1.14e-57) (/ (- -1.0 x) B) (if (<= F 1.25e-56) (/ x (- B)) (- (/ 1.0 B) (/ x B)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -1.14e-57) {
tmp = (-1.0 - x) / B;
} else if (F <= 1.25e-56) {
tmp = x / -B;
} else {
tmp = (1.0 / 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 <= (-1.14d-57)) then
tmp = ((-1.0d0) - x) / b
else if (f <= 1.25d-56) then
tmp = x / -b
else
tmp = (1.0d0 / b) - (x / b)
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -1.14e-57) {
tmp = (-1.0 - x) / B;
} else if (F <= 1.25e-56) {
tmp = x / -B;
} else {
tmp = (1.0 / B) - (x / B);
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -1.14e-57: tmp = (-1.0 - x) / B elif F <= 1.25e-56: tmp = x / -B else: tmp = (1.0 / B) - (x / B) return tmp
function code(F, B, x) tmp = 0.0 if (F <= -1.14e-57) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= 1.25e-56) tmp = Float64(x / Float64(-B)); else tmp = Float64(Float64(1.0 / B) - Float64(x / B)); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -1.14e-57) tmp = (-1.0 - x) / B; elseif (F <= 1.25e-56) tmp = x / -B; else tmp = (1.0 / B) - (x / B); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -1.14e-57], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 1.25e-56], N[(x / (-B)), $MachinePrecision], N[(N[(1.0 / B), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -1.14 \cdot 10^{-57}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq 1.25 \cdot 10^{-56}:\\
\;\;\;\;\frac{x}{-B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{B} - \frac{x}{B}\\
\end{array}
\end{array}
if F < -1.14000000000000006e-57Initial program 73.1%
Taylor expanded in F around -inf 90.6%
Taylor expanded in B around 0 50.0%
mul-1-neg50.0%
distribute-neg-frac250.0%
Simplified50.0%
Taylor expanded in B around 0 50.0%
associate-*r/50.0%
neg-mul-150.0%
distribute-neg-in50.0%
metadata-eval50.0%
unsub-neg50.0%
Simplified50.0%
if -1.14000000000000006e-57 < F < 1.24999999999999999e-56Initial program 99.5%
Taylor expanded in F around -inf 41.8%
Taylor expanded in B around 0 23.9%
mul-1-neg23.9%
distribute-neg-frac223.9%
Simplified23.9%
Taylor expanded in x around inf 41.0%
mul-1-neg41.0%
distribute-neg-frac241.0%
Simplified41.0%
if 1.24999999999999999e-56 < F Initial program 60.8%
div-inv60.9%
clear-num60.9%
Applied egg-rr60.9%
Taylor expanded in B around 0 49.3%
Taylor expanded in B around 0 27.6%
Taylor expanded in F around inf 50.8%
Final simplification47.2%
(FPCore (F B x) :precision binary64 (if (<= F -6.9e-56) (/ (- -1.0 x) B) (if (<= F 2.95e+50) (/ x (- B)) (/ (+ x 1.0) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -6.9e-56) {
tmp = (-1.0 - x) / B;
} else if (F <= 2.95e+50) {
tmp = x / -B;
} else {
tmp = (x + 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 (f <= (-6.9d-56)) then
tmp = ((-1.0d0) - x) / b
else if (f <= 2.95d+50) then
tmp = x / -b
else
tmp = (x + 1.0d0) / b
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -6.9e-56) {
tmp = (-1.0 - x) / B;
} else if (F <= 2.95e+50) {
tmp = x / -B;
} else {
tmp = (x + 1.0) / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -6.9e-56: tmp = (-1.0 - x) / B elif F <= 2.95e+50: tmp = x / -B else: tmp = (x + 1.0) / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= -6.9e-56) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= 2.95e+50) tmp = Float64(x / Float64(-B)); else tmp = Float64(Float64(x + 1.0) / B); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -6.9e-56) tmp = (-1.0 - x) / B; elseif (F <= 2.95e+50) tmp = x / -B; else tmp = (x + 1.0) / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -6.9e-56], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 2.95e+50], N[(x / (-B)), $MachinePrecision], N[(N[(x + 1.0), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -6.9 \cdot 10^{-56}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq 2.95 \cdot 10^{+50}:\\
\;\;\;\;\frac{x}{-B}\\
\mathbf{else}:\\
\;\;\;\;\frac{x + 1}{B}\\
\end{array}
\end{array}
if F < -6.8999999999999996e-56Initial program 73.1%
Taylor expanded in F around -inf 90.6%
Taylor expanded in B around 0 50.0%
mul-1-neg50.0%
distribute-neg-frac250.0%
Simplified50.0%
Taylor expanded in B around 0 50.0%
associate-*r/50.0%
neg-mul-150.0%
distribute-neg-in50.0%
metadata-eval50.0%
unsub-neg50.0%
Simplified50.0%
if -6.8999999999999996e-56 < F < 2.9499999999999999e50Initial program 98.5%
Taylor expanded in F around -inf 43.8%
Taylor expanded in B around 0 24.8%
mul-1-neg24.8%
distribute-neg-frac224.8%
Simplified24.8%
Taylor expanded in x around inf 39.1%
mul-1-neg39.1%
distribute-neg-frac239.1%
Simplified39.1%
if 2.9499999999999999e50 < F Initial program 51.7%
Taylor expanded in F around -inf 39.8%
Taylor expanded in B around 0 19.8%
mul-1-neg19.8%
distribute-neg-frac219.8%
Simplified19.8%
add-sqr-sqrt10.7%
sqrt-unprod18.5%
sqr-neg18.5%
sqrt-unprod16.8%
add-sqr-sqrt37.3%
*-un-lft-identity37.3%
Applied egg-rr37.3%
*-lft-identity37.3%
Simplified37.3%
Final simplification42.5%
(FPCore (F B x) :precision binary64 (if (<= F -8.8e-57) (/ (- -1.0 x) B) (if (<= F 2.5e-58) (/ x (- B)) (/ (- 1.0 x) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -8.8e-57) {
tmp = (-1.0 - x) / B;
} else if (F <= 2.5e-58) {
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 <= (-8.8d-57)) then
tmp = ((-1.0d0) - x) / b
else if (f <= 2.5d-58) 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 <= -8.8e-57) {
tmp = (-1.0 - x) / B;
} else if (F <= 2.5e-58) {
tmp = x / -B;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -8.8e-57: tmp = (-1.0 - x) / B elif F <= 2.5e-58: tmp = x / -B else: tmp = (1.0 - x) / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= -8.8e-57) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= 2.5e-58) tmp = Float64(x / Float64(-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 <= -8.8e-57) tmp = (-1.0 - x) / B; elseif (F <= 2.5e-58) tmp = x / -B; else tmp = (1.0 - x) / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -8.8e-57], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 2.5e-58], N[(x / (-B)), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -8.8 \cdot 10^{-57}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq 2.5 \cdot 10^{-58}:\\
\;\;\;\;\frac{x}{-B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -8.79999999999999994e-57Initial program 73.1%
Taylor expanded in F around -inf 90.6%
Taylor expanded in B around 0 50.0%
mul-1-neg50.0%
distribute-neg-frac250.0%
Simplified50.0%
Taylor expanded in B around 0 50.0%
associate-*r/50.0%
neg-mul-150.0%
distribute-neg-in50.0%
metadata-eval50.0%
unsub-neg50.0%
Simplified50.0%
if -8.79999999999999994e-57 < F < 2.49999999999999989e-58Initial program 99.5%
Taylor expanded in F around -inf 41.8%
Taylor expanded in B around 0 23.9%
mul-1-neg23.9%
distribute-neg-frac223.9%
Simplified23.9%
Taylor expanded in x around inf 41.0%
mul-1-neg41.0%
distribute-neg-frac241.0%
Simplified41.0%
if 2.49999999999999989e-58 < 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.8%
Taylor expanded in B around 0 50.8%
Final simplification47.2%
(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(x / Float64(-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 78.2%
Taylor expanded in F around -inf 59.6%
Taylor expanded in B around 0 32.7%
mul-1-neg32.7%
distribute-neg-frac232.7%
Simplified32.7%
Taylor expanded in x around inf 31.0%
mul-1-neg31.0%
distribute-neg-frac231.0%
Simplified31.0%
Final simplification31.0%
(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%
distribute-neg-frac232.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))))))