
(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 -5e+45)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 64000000.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 <= -5e+45) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 64000000.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 <= -5e+45) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 64000000.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, -5e+45], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 64000000.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 -5 \cdot 10^{+45}:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq 64000000:\\
\;\;\;\;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 < -5e45Initial program 53.6%
Simplified72.2%
Taylor expanded in x around 0 72.3%
associate-*l/72.3%
*-lft-identity72.3%
+-commutative72.3%
unpow272.3%
fma-undefine72.3%
Simplified72.3%
Taylor expanded in F around -inf 99.8%
if -5e45 < F < 6.4e7Initial program 99.4%
Simplified99.6%
if 6.4e7 < F Initial program 54.0%
Simplified74.4%
Taylor expanded in x around 0 74.4%
associate-*l/74.4%
*-lft-identity74.4%
+-commutative74.4%
unpow274.4%
fma-undefine74.4%
Simplified74.4%
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 -4e+44)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 64000000.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 <= -4e+44) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 64000000.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 <= -4e+44) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 64000000.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, -4e+44], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 64000000.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 -4 \cdot 10^{+44}:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq 64000000:\\
\;\;\;\;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 < -4.0000000000000004e44Initial program 53.6%
Simplified72.2%
Taylor expanded in x around 0 72.3%
associate-*l/72.3%
*-lft-identity72.3%
+-commutative72.3%
unpow272.3%
fma-undefine72.3%
Simplified72.3%
Taylor expanded in F around -inf 99.8%
if -4.0000000000000004e44 < F < 6.4e7Initial program 99.4%
Simplified99.6%
Taylor expanded in x around 0 99.5%
associate-*l/99.6%
*-lft-identity99.6%
+-commutative99.6%
unpow299.6%
fma-undefine99.6%
Simplified99.6%
if 6.4e7 < F Initial program 54.0%
Simplified74.4%
Taylor expanded in x around 0 74.4%
associate-*l/74.4%
*-lft-identity74.4%
+-commutative74.4%
unpow274.4%
fma-undefine74.4%
Simplified74.4%
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 -1e+36)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 64000000.0)
(- (/ (* F (pow (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 <= -1e+36) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 64000000.0) {
tmp = ((F * pow(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 <= -1e+36) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 64000000.0) tmp = Float64(Float64(Float64(F * (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, -1e+36], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 64000000.0], N[(N[(N[(F * N[Power[N[(F * F + 2.0), $MachinePrecision], -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 \cdot 10^{+36}:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq 64000000:\\
\;\;\;\;\frac{F \cdot {\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-0.5}}{\sin B} - t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_0\\
\end{array}
\end{array}
if F < -1.00000000000000004e36Initial program 55.8%
Simplified73.6%
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 99.8%
if -1.00000000000000004e36 < F < 6.4e7Initial program 99.5%
Simplified99.6%
Taylor expanded in x around 0 99.5%
associate-*l/99.6%
*-lft-identity99.6%
+-commutative99.6%
unpow299.6%
fma-undefine99.6%
Simplified99.6%
associate-*r/99.6%
fma-define99.6%
inv-pow99.6%
sqrt-pow199.6%
fma-define99.6%
metadata-eval99.6%
Applied egg-rr99.6%
if 6.4e7 < F Initial program 54.0%
Simplified74.4%
Taylor expanded in x around 0 74.4%
associate-*l/74.4%
*-lft-identity74.4%
+-commutative74.4%
unpow274.4%
fma-undefine74.4%
Simplified74.4%
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 -1.7e+17)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 64000000.0)
(+
(* (/ F (sin B)) (pow (+ (+ 2.0 (* F F)) (* x 2.0)) -0.5))
(* x (/ -1.0 (tan B))))
(- (/ 1.0 (sin B)) t_0)))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -1.7e+17) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 64000000.0) {
tmp = ((F / sin(B)) * pow(((2.0 + (F * F)) + (x * 2.0)), -0.5)) + (x * (-1.0 / tan(B)));
} else {
tmp = (1.0 / sin(B)) - t_0;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: tmp
t_0 = x / tan(b)
if (f <= (-1.7d+17)) then
tmp = ((-1.0d0) / sin(b)) - t_0
else if (f <= 64000000.0d0) then
tmp = ((f / sin(b)) * (((2.0d0 + (f * f)) + (x * 2.0d0)) ** (-0.5d0))) + (x * ((-1.0d0) / tan(b)))
else
tmp = (1.0d0 / sin(b)) - t_0
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = x / Math.tan(B);
double tmp;
if (F <= -1.7e+17) {
tmp = (-1.0 / Math.sin(B)) - t_0;
} else if (F <= 64000000.0) {
tmp = ((F / Math.sin(B)) * Math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5)) + (x * (-1.0 / Math.tan(B)));
} else {
tmp = (1.0 / Math.sin(B)) - t_0;
}
return tmp;
}
def code(F, B, x): t_0 = x / math.tan(B) tmp = 0 if F <= -1.7e+17: tmp = (-1.0 / math.sin(B)) - t_0 elif F <= 64000000.0: tmp = ((F / math.sin(B)) * math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5)) + (x * (-1.0 / math.tan(B))) else: tmp = (1.0 / math.sin(B)) - t_0 return tmp
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -1.7e+17) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 64000000.0) tmp = Float64(Float64(Float64(F / sin(B)) * (Float64(Float64(2.0 + Float64(F * F)) + Float64(x * 2.0)) ^ -0.5)) + Float64(x * Float64(-1.0 / tan(B)))); else tmp = Float64(Float64(1.0 / sin(B)) - t_0); end return tmp end
function tmp_2 = code(F, B, x) t_0 = x / tan(B); tmp = 0.0; if (F <= -1.7e+17) tmp = (-1.0 / sin(B)) - t_0; elseif (F <= 64000000.0) tmp = ((F / sin(B)) * (((2.0 + (F * F)) + (x * 2.0)) ^ -0.5)) + (x * (-1.0 / tan(B))); else tmp = (1.0 / sin(B)) - t_0; end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -1.7e+17], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 64000000.0], N[(N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Power[N[(N[(2.0 + N[(F * F), $MachinePrecision]), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision] + N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -1.7 \cdot 10^{+17}:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq 64000000:\\
\;\;\;\;\frac{F}{\sin B} \cdot {\left(\left(2 + F \cdot F\right) + x \cdot 2\right)}^{-0.5} + x \cdot \frac{-1}{\tan B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_0\\
\end{array}
\end{array}
if F < -1.7e17Initial program 56.5%
Simplified74.0%
Taylor expanded in x around 0 74.1%
associate-*l/74.1%
*-lft-identity74.1%
+-commutative74.1%
unpow274.1%
fma-undefine74.1%
Simplified74.1%
Taylor expanded in F around -inf 99.8%
if -1.7e17 < F < 6.4e7Initial program 99.5%
if 6.4e7 < F Initial program 54.0%
Simplified74.4%
Taylor expanded in x around 0 74.4%
associate-*l/74.4%
*-lft-identity74.4%
+-commutative74.4%
unpow274.4%
fma-undefine74.4%
Simplified74.4%
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 -5.4e+16)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 64000000.0)
(+
(/ -1.0 (/ (tan B) x))
(* (/ F (sin B)) (pow (+ (+ 2.0 (* F F)) (* x 2.0)) -0.5)))
(- (/ 1.0 (sin B)) t_0)))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -5.4e+16) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 64000000.0) {
tmp = (-1.0 / (tan(B) / x)) + ((F / sin(B)) * pow(((2.0 + (F * F)) + (x * 2.0)), -0.5));
} else {
tmp = (1.0 / sin(B)) - t_0;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: tmp
t_0 = x / tan(b)
if (f <= (-5.4d+16)) then
tmp = ((-1.0d0) / sin(b)) - t_0
else if (f <= 64000000.0d0) then
tmp = ((-1.0d0) / (tan(b) / x)) + ((f / sin(b)) * (((2.0d0 + (f * f)) + (x * 2.0d0)) ** (-0.5d0)))
else
tmp = (1.0d0 / sin(b)) - t_0
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = x / Math.tan(B);
double tmp;
if (F <= -5.4e+16) {
tmp = (-1.0 / Math.sin(B)) - t_0;
} else if (F <= 64000000.0) {
tmp = (-1.0 / (Math.tan(B) / x)) + ((F / Math.sin(B)) * Math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5));
} else {
tmp = (1.0 / Math.sin(B)) - t_0;
}
return tmp;
}
def code(F, B, x): t_0 = x / math.tan(B) tmp = 0 if F <= -5.4e+16: tmp = (-1.0 / math.sin(B)) - t_0 elif F <= 64000000.0: tmp = (-1.0 / (math.tan(B) / x)) + ((F / math.sin(B)) * math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5)) else: tmp = (1.0 / math.sin(B)) - t_0 return tmp
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -5.4e+16) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 64000000.0) tmp = Float64(Float64(-1.0 / Float64(tan(B) / x)) + Float64(Float64(F / sin(B)) * (Float64(Float64(2.0 + Float64(F * F)) + Float64(x * 2.0)) ^ -0.5))); else tmp = Float64(Float64(1.0 / sin(B)) - t_0); end return tmp end
function tmp_2 = code(F, B, x) t_0 = x / tan(B); tmp = 0.0; if (F <= -5.4e+16) tmp = (-1.0 / sin(B)) - t_0; elseif (F <= 64000000.0) tmp = (-1.0 / (tan(B) / x)) + ((F / sin(B)) * (((2.0 + (F * F)) + (x * 2.0)) ^ -0.5)); else tmp = (1.0 / sin(B)) - t_0; end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -5.4e+16], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 64000000.0], N[(N[(-1.0 / N[(N[Tan[B], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] + N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Power[N[(N[(2.0 + N[(F * F), $MachinePrecision]), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -5.4 \cdot 10^{+16}:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq 64000000:\\
\;\;\;\;\frac{-1}{\frac{\tan B}{x}} + \frac{F}{\sin B} \cdot {\left(\left(2 + F \cdot F\right) + x \cdot 2\right)}^{-0.5}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_0\\
\end{array}
\end{array}
if F < -5.4e16Initial program 56.5%
Simplified74.0%
Taylor expanded in x around 0 74.1%
associate-*l/74.1%
*-lft-identity74.1%
+-commutative74.1%
unpow274.1%
fma-undefine74.1%
Simplified74.1%
Taylor expanded in F around -inf 99.8%
if -5.4e16 < F < 6.4e7Initial program 99.5%
div-inv39.3%
clear-num39.3%
Applied egg-rr99.5%
if 6.4e7 < F Initial program 54.0%
Simplified74.4%
Taylor expanded in x around 0 74.4%
associate-*l/74.4%
*-lft-identity74.4%
+-commutative74.4%
unpow274.4%
fma-undefine74.4%
Simplified74.4%
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 -1.4)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 1.45)
(- (* 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.4) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 1.45) {
tmp = (F * (sqrt(0.5) / sin(B))) - t_0;
} else {
tmp = (1.0 / sin(B)) - 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.4d0)) then
tmp = ((-1.0d0) / sin(b)) - t_0
else if (f <= 1.45d0) then
tmp = (f * (sqrt(0.5d0) / sin(b))) - t_0
else
tmp = (1.0d0 / sin(b)) - 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.4) {
tmp = (-1.0 / Math.sin(B)) - t_0;
} else if (F <= 1.45) {
tmp = (F * (Math.sqrt(0.5) / Math.sin(B))) - t_0;
} else {
tmp = (1.0 / Math.sin(B)) - t_0;
}
return tmp;
}
def code(F, B, x): t_0 = x / math.tan(B) tmp = 0 if F <= -1.4: tmp = (-1.0 / math.sin(B)) - t_0 elif F <= 1.45: tmp = (F * (math.sqrt(0.5) / math.sin(B))) - t_0 else: tmp = (1.0 / math.sin(B)) - t_0 return tmp
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -1.4) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 1.45) tmp = Float64(Float64(F * Float64(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.4) tmp = (-1.0 / sin(B)) - t_0; elseif (F <= 1.45) tmp = (F * (sqrt(0.5) / sin(B))) - t_0; else tmp = (1.0 / sin(B)) - 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.4], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 1.45], 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.4:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq 1.45:\\
\;\;\;\;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.3999999999999999Initial program 59.0%
Simplified75.5%
Taylor expanded in x around 0 75.5%
associate-*l/75.6%
*-lft-identity75.6%
+-commutative75.6%
unpow275.6%
fma-undefine75.6%
Simplified75.6%
Taylor expanded in F around -inf 98.7%
if -1.3999999999999999 < F < 1.44999999999999996Initial program 99.5%
Simplified99.6%
Taylor expanded in x around 0 99.5%
associate-*l/99.6%
*-lft-identity99.6%
+-commutative99.6%
unpow299.6%
fma-undefine99.6%
Simplified99.6%
Taylor expanded in F around 0 98.1%
if 1.44999999999999996 < F Initial program 54.0%
Simplified74.4%
Taylor expanded in x around 0 74.4%
associate-*l/74.4%
*-lft-identity74.4%
+-commutative74.4%
unpow274.4%
fma-undefine74.4%
Simplified74.4%
Taylor expanded in F around inf 99.9%
Final simplification98.9%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -1.4)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 1.45)
(- (/ (* F (sqrt 0.5)) (sin B)) t_0)
(- (/ 1.0 (sin B)) t_0)))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -1.4) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 1.45) {
tmp = ((F * sqrt(0.5)) / sin(B)) - t_0;
} else {
tmp = (1.0 / sin(B)) - 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.4d0)) then
tmp = ((-1.0d0) / sin(b)) - t_0
else if (f <= 1.45d0) then
tmp = ((f * sqrt(0.5d0)) / sin(b)) - t_0
else
tmp = (1.0d0 / sin(b)) - 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.4) {
tmp = (-1.0 / Math.sin(B)) - t_0;
} else if (F <= 1.45) {
tmp = ((F * Math.sqrt(0.5)) / Math.sin(B)) - t_0;
} else {
tmp = (1.0 / Math.sin(B)) - t_0;
}
return tmp;
}
def code(F, B, x): t_0 = x / math.tan(B) tmp = 0 if F <= -1.4: tmp = (-1.0 / math.sin(B)) - t_0 elif F <= 1.45: tmp = ((F * math.sqrt(0.5)) / math.sin(B)) - t_0 else: tmp = (1.0 / math.sin(B)) - t_0 return tmp
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -1.4) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 1.45) tmp = Float64(Float64(Float64(F * sqrt(0.5)) / sin(B)) - t_0); else tmp = Float64(Float64(1.0 / sin(B)) - t_0); end return tmp end
function tmp_2 = code(F, B, x) t_0 = x / tan(B); tmp = 0.0; if (F <= -1.4) tmp = (-1.0 / sin(B)) - t_0; elseif (F <= 1.45) tmp = ((F * sqrt(0.5)) / sin(B)) - t_0; else tmp = (1.0 / sin(B)) - 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.4], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 1.45], N[(N[(N[(F * N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -1.4:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq 1.45:\\
\;\;\;\;\frac{F \cdot \sqrt{0.5}}{\sin B} - t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_0\\
\end{array}
\end{array}
if F < -1.3999999999999999Initial program 59.0%
Simplified75.5%
Taylor expanded in x around 0 75.5%
associate-*l/75.6%
*-lft-identity75.6%
+-commutative75.6%
unpow275.6%
fma-undefine75.6%
Simplified75.6%
Taylor expanded in F around -inf 98.7%
if -1.3999999999999999 < F < 1.44999999999999996Initial program 99.5%
Simplified99.6%
Taylor expanded in x around 0 99.5%
associate-*l/99.6%
*-lft-identity99.6%
+-commutative99.6%
unpow299.6%
fma-undefine99.6%
Simplified99.6%
Taylor expanded in F around 0 98.1%
*-commutative98.1%
Simplified98.1%
if 1.44999999999999996 < F Initial program 54.0%
Simplified74.4%
Taylor expanded in x around 0 74.4%
associate-*l/74.4%
*-lft-identity74.4%
+-commutative74.4%
unpow274.4%
fma-undefine74.4%
Simplified74.4%
Taylor expanded in F around inf 99.9%
Final simplification98.9%
(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 -5.4e+16)
(- (/ -1.0 (sin B)) t_1)
(if (<= F -7.5e-227)
t_0
(if (<= F 2.7e-141)
(/ (* x (cos B)) (- (sin B)))
(if (<= F 6000000.0) t_0 (- (/ 1.0 (sin B)) t_1)))))))
double code(double F, double B, double x) {
double t_0 = ((F / sin(B)) * pow(((2.0 + (F * F)) + (x * 2.0)), -0.5)) - (x / B);
double t_1 = x / tan(B);
double tmp;
if (F <= -5.4e+16) {
tmp = (-1.0 / sin(B)) - t_1;
} else if (F <= -7.5e-227) {
tmp = t_0;
} else if (F <= 2.7e-141) {
tmp = (x * cos(B)) / -sin(B);
} else if (F <= 6000000.0) {
tmp = t_0;
} else {
tmp = (1.0 / sin(B)) - t_1;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = ((f / sin(b)) * (((2.0d0 + (f * f)) + (x * 2.0d0)) ** (-0.5d0))) - (x / b)
t_1 = x / tan(b)
if (f <= (-5.4d+16)) then
tmp = ((-1.0d0) / sin(b)) - t_1
else if (f <= (-7.5d-227)) then
tmp = t_0
else if (f <= 2.7d-141) then
tmp = (x * cos(b)) / -sin(b)
else if (f <= 6000000.0d0) then
tmp = t_0
else
tmp = (1.0d0 / sin(b)) - t_1
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = ((F / Math.sin(B)) * Math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5)) - (x / B);
double t_1 = x / Math.tan(B);
double tmp;
if (F <= -5.4e+16) {
tmp = (-1.0 / Math.sin(B)) - t_1;
} else if (F <= -7.5e-227) {
tmp = t_0;
} else if (F <= 2.7e-141) {
tmp = (x * Math.cos(B)) / -Math.sin(B);
} else if (F <= 6000000.0) {
tmp = t_0;
} else {
tmp = (1.0 / Math.sin(B)) - t_1;
}
return tmp;
}
def code(F, B, x): t_0 = ((F / math.sin(B)) * math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5)) - (x / B) t_1 = x / math.tan(B) tmp = 0 if F <= -5.4e+16: tmp = (-1.0 / math.sin(B)) - t_1 elif F <= -7.5e-227: tmp = t_0 elif F <= 2.7e-141: tmp = (x * math.cos(B)) / -math.sin(B) elif F <= 6000000.0: tmp = t_0 else: tmp = (1.0 / math.sin(B)) - t_1 return tmp
function code(F, B, x) t_0 = Float64(Float64(Float64(F / sin(B)) * (Float64(Float64(2.0 + Float64(F * F)) + Float64(x * 2.0)) ^ -0.5)) - Float64(x / B)) t_1 = Float64(x / tan(B)) tmp = 0.0 if (F <= -5.4e+16) tmp = Float64(Float64(-1.0 / sin(B)) - t_1); elseif (F <= -7.5e-227) tmp = t_0; elseif (F <= 2.7e-141) tmp = Float64(Float64(x * cos(B)) / Float64(-sin(B))); elseif (F <= 6000000.0) tmp = t_0; else tmp = Float64(Float64(1.0 / sin(B)) - t_1); end return tmp end
function tmp_2 = code(F, B, x) t_0 = ((F / sin(B)) * (((2.0 + (F * F)) + (x * 2.0)) ^ -0.5)) - (x / B); t_1 = x / tan(B); tmp = 0.0; if (F <= -5.4e+16) tmp = (-1.0 / sin(B)) - t_1; elseif (F <= -7.5e-227) tmp = t_0; elseif (F <= 2.7e-141) tmp = (x * cos(B)) / -sin(B); elseif (F <= 6000000.0) tmp = t_0; else tmp = (1.0 / sin(B)) - t_1; end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Power[N[(N[(2.0 + N[(F * F), $MachinePrecision]), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -5.4e+16], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[F, -7.5e-227], t$95$0, If[LessEqual[F, 2.7e-141], N[(N[(x * N[Cos[B], $MachinePrecision]), $MachinePrecision] / (-N[Sin[B], $MachinePrecision])), $MachinePrecision], If[LessEqual[F, 6000000.0], t$95$0, N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{F}{\sin B} \cdot {\left(\left(2 + F \cdot F\right) + x \cdot 2\right)}^{-0.5} - \frac{x}{B}\\
t_1 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -5.4 \cdot 10^{+16}:\\
\;\;\;\;\frac{-1}{\sin B} - t\_1\\
\mathbf{elif}\;F \leq -7.5 \cdot 10^{-227}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;F \leq 2.7 \cdot 10^{-141}:\\
\;\;\;\;\frac{x \cdot \cos B}{-\sin B}\\
\mathbf{elif}\;F \leq 6000000:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_1\\
\end{array}
\end{array}
if F < -5.4e16Initial program 56.5%
Simplified74.0%
Taylor expanded in x around 0 74.1%
associate-*l/74.1%
*-lft-identity74.1%
+-commutative74.1%
unpow274.1%
fma-undefine74.1%
Simplified74.1%
Taylor expanded in F around -inf 99.8%
if -5.4e16 < F < -7.49999999999999988e-227 or 2.7000000000000003e-141 < F < 6e6Initial program 99.5%
Taylor expanded in B around 0 79.8%
if -7.49999999999999988e-227 < F < 2.7000000000000003e-141Initial program 99.4%
Taylor expanded in F around -inf 41.1%
div-inv41.2%
clear-num41.1%
Applied egg-rr41.1%
Taylor expanded in x around inf 82.8%
mul-1-neg82.8%
Simplified82.8%
if 6e6 < F Initial program 54.0%
Simplified74.4%
Taylor expanded in x around 0 74.4%
associate-*l/74.4%
*-lft-identity74.4%
+-commutative74.4%
unpow274.4%
fma-undefine74.4%
Simplified74.4%
Taylor expanded in F around inf 99.9%
Final simplification92.0%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (pow (+ (+ 2.0 (* F F)) (* x 2.0)) -0.5))
(t_1 (/ x (tan B)))
(t_2 (/ 1.0 (sin B))))
(if (<= F -1.3e+51)
(- (/ -1.0 (sin B)) t_1)
(if (<= F -7.5e-227)
(- (* t_0 (* F t_2)) (/ x B))
(if (<= F 3.8e-140)
(/ (* x (cos B)) (- (sin B)))
(if (<= F 135000.0)
(- (* (/ F (sin B)) t_0) (/ x B))
(- t_2 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 t_2 = 1.0 / sin(B);
double tmp;
if (F <= -1.3e+51) {
tmp = (-1.0 / sin(B)) - t_1;
} else if (F <= -7.5e-227) {
tmp = (t_0 * (F * t_2)) - (x / B);
} else if (F <= 3.8e-140) {
tmp = (x * cos(B)) / -sin(B);
} else if (F <= 135000.0) {
tmp = ((F / sin(B)) * t_0) - (x / B);
} else {
tmp = t_2 - 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) :: t_2
real(8) :: tmp
t_0 = ((2.0d0 + (f * f)) + (x * 2.0d0)) ** (-0.5d0)
t_1 = x / tan(b)
t_2 = 1.0d0 / sin(b)
if (f <= (-1.3d+51)) then
tmp = ((-1.0d0) / sin(b)) - t_1
else if (f <= (-7.5d-227)) then
tmp = (t_0 * (f * t_2)) - (x / b)
else if (f <= 3.8d-140) then
tmp = (x * cos(b)) / -sin(b)
else if (f <= 135000.0d0) then
tmp = ((f / sin(b)) * t_0) - (x / b)
else
tmp = t_2 - 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 t_2 = 1.0 / Math.sin(B);
double tmp;
if (F <= -1.3e+51) {
tmp = (-1.0 / Math.sin(B)) - t_1;
} else if (F <= -7.5e-227) {
tmp = (t_0 * (F * t_2)) - (x / B);
} else if (F <= 3.8e-140) {
tmp = (x * Math.cos(B)) / -Math.sin(B);
} else if (F <= 135000.0) {
tmp = ((F / Math.sin(B)) * t_0) - (x / B);
} else {
tmp = t_2 - 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) t_2 = 1.0 / math.sin(B) tmp = 0 if F <= -1.3e+51: tmp = (-1.0 / math.sin(B)) - t_1 elif F <= -7.5e-227: tmp = (t_0 * (F * t_2)) - (x / B) elif F <= 3.8e-140: tmp = (x * math.cos(B)) / -math.sin(B) elif F <= 135000.0: tmp = ((F / math.sin(B)) * t_0) - (x / B) else: tmp = t_2 - 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)) t_2 = Float64(1.0 / sin(B)) tmp = 0.0 if (F <= -1.3e+51) tmp = Float64(Float64(-1.0 / sin(B)) - t_1); elseif (F <= -7.5e-227) tmp = Float64(Float64(t_0 * Float64(F * t_2)) - Float64(x / B)); elseif (F <= 3.8e-140) tmp = Float64(Float64(x * cos(B)) / Float64(-sin(B))); elseif (F <= 135000.0) tmp = Float64(Float64(Float64(F / sin(B)) * t_0) - Float64(x / B)); else tmp = Float64(t_2 - 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); t_2 = 1.0 / sin(B); tmp = 0.0; if (F <= -1.3e+51) tmp = (-1.0 / sin(B)) - t_1; elseif (F <= -7.5e-227) tmp = (t_0 * (F * t_2)) - (x / B); elseif (F <= 3.8e-140) tmp = (x * cos(B)) / -sin(B); elseif (F <= 135000.0) tmp = ((F / sin(B)) * t_0) - (x / B); else tmp = t_2 - 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]}, Block[{t$95$2 = N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -1.3e+51], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[F, -7.5e-227], N[(N[(t$95$0 * N[(F * t$95$2), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 3.8e-140], N[(N[(x * N[Cos[B], $MachinePrecision]), $MachinePrecision] / (-N[Sin[B], $MachinePrecision])), $MachinePrecision], If[LessEqual[F, 135000.0], N[(N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], N[(t$95$2 - 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}\\
t_2 := \frac{1}{\sin B}\\
\mathbf{if}\;F \leq -1.3 \cdot 10^{+51}:\\
\;\;\;\;\frac{-1}{\sin B} - t\_1\\
\mathbf{elif}\;F \leq -7.5 \cdot 10^{-227}:\\
\;\;\;\;t\_0 \cdot \left(F \cdot t\_2\right) - \frac{x}{B}\\
\mathbf{elif}\;F \leq 3.8 \cdot 10^{-140}:\\
\;\;\;\;\frac{x \cdot \cos B}{-\sin B}\\
\mathbf{elif}\;F \leq 135000:\\
\;\;\;\;\frac{F}{\sin B} \cdot t\_0 - \frac{x}{B}\\
\mathbf{else}:\\
\;\;\;\;t\_2 - t\_1\\
\end{array}
\end{array}
if F < -1.3000000000000001e51Initial program 51.1%
Simplified70.8%
Taylor expanded in x around 0 70.8%
associate-*l/70.8%
*-lft-identity70.8%
+-commutative70.8%
unpow270.8%
fma-undefine70.8%
Simplified70.8%
Taylor expanded in F around -inf 99.8%
if -1.3000000000000001e51 < F < -7.49999999999999988e-227Initial program 99.4%
Taylor expanded in B around 0 81.4%
div-inv81.5%
Applied egg-rr81.5%
if -7.49999999999999988e-227 < F < 3.79999999999999998e-140Initial program 99.4%
Taylor expanded in F around -inf 41.1%
div-inv41.2%
clear-num41.1%
Applied egg-rr41.1%
Taylor expanded in x around inf 82.8%
mul-1-neg82.8%
Simplified82.8%
if 3.79999999999999998e-140 < F < 135000Initial program 99.7%
Taylor expanded in B around 0 83.0%
if 135000 < F Initial program 54.0%
Simplified74.4%
Taylor expanded in x around 0 74.4%
associate-*l/74.4%
*-lft-identity74.4%
+-commutative74.4%
unpow274.4%
fma-undefine74.4%
Simplified74.4%
Taylor expanded in F around inf 99.9%
Final simplification92.0%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (- (* (/ F (sin B)) (sqrt (/ 1.0 (+ 2.0 (* x 2.0))))) (/ x B)))
(t_1 (/ x (tan B))))
(if (<= F -5.7e-8)
(- (/ -1.0 (sin B)) t_1)
(if (<= F -7.5e-227)
t_0
(if (<= F 4.5e-141)
(/ (* x (cos B)) (- (sin B)))
(if (<= F 0.24) t_0 (- (/ 1.0 (sin B)) t_1)))))))
double code(double F, double B, double x) {
double t_0 = ((F / sin(B)) * sqrt((1.0 / (2.0 + (x * 2.0))))) - (x / B);
double t_1 = x / tan(B);
double tmp;
if (F <= -5.7e-8) {
tmp = (-1.0 / sin(B)) - t_1;
} else if (F <= -7.5e-227) {
tmp = t_0;
} else if (F <= 4.5e-141) {
tmp = (x * cos(B)) / -sin(B);
} else if (F <= 0.24) {
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)) * sqrt((1.0d0 / (2.0d0 + (x * 2.0d0))))) - (x / b)
t_1 = x / tan(b)
if (f <= (-5.7d-8)) then
tmp = ((-1.0d0) / sin(b)) - t_1
else if (f <= (-7.5d-227)) then
tmp = t_0
else if (f <= 4.5d-141) then
tmp = (x * cos(b)) / -sin(b)
else if (f <= 0.24d0) 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.sqrt((1.0 / (2.0 + (x * 2.0))))) - (x / B);
double t_1 = x / Math.tan(B);
double tmp;
if (F <= -5.7e-8) {
tmp = (-1.0 / Math.sin(B)) - t_1;
} else if (F <= -7.5e-227) {
tmp = t_0;
} else if (F <= 4.5e-141) {
tmp = (x * Math.cos(B)) / -Math.sin(B);
} else if (F <= 0.24) {
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.sqrt((1.0 / (2.0 + (x * 2.0))))) - (x / B) t_1 = x / math.tan(B) tmp = 0 if F <= -5.7e-8: tmp = (-1.0 / math.sin(B)) - t_1 elif F <= -7.5e-227: tmp = t_0 elif F <= 4.5e-141: tmp = (x * math.cos(B)) / -math.sin(B) elif F <= 0.24: 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)) * sqrt(Float64(1.0 / Float64(2.0 + Float64(x * 2.0))))) - Float64(x / B)) t_1 = Float64(x / tan(B)) tmp = 0.0 if (F <= -5.7e-8) tmp = Float64(Float64(-1.0 / sin(B)) - t_1); elseif (F <= -7.5e-227) tmp = t_0; elseif (F <= 4.5e-141) tmp = Float64(Float64(x * cos(B)) / Float64(-sin(B))); elseif (F <= 0.24) 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)) * sqrt((1.0 / (2.0 + (x * 2.0))))) - (x / B); t_1 = x / tan(B); tmp = 0.0; if (F <= -5.7e-8) tmp = (-1.0 / sin(B)) - t_1; elseif (F <= -7.5e-227) tmp = t_0; elseif (F <= 4.5e-141) tmp = (x * cos(B)) / -sin(B); elseif (F <= 0.24) 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[Sqrt[N[(1.0 / N[(2.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -5.7e-8], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[F, -7.5e-227], t$95$0, If[LessEqual[F, 4.5e-141], N[(N[(x * N[Cos[B], $MachinePrecision]), $MachinePrecision] / (-N[Sin[B], $MachinePrecision])), $MachinePrecision], If[LessEqual[F, 0.24], 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 \sqrt{\frac{1}{2 + x \cdot 2}} - \frac{x}{B}\\
t_1 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -5.7 \cdot 10^{-8}:\\
\;\;\;\;\frac{-1}{\sin B} - t\_1\\
\mathbf{elif}\;F \leq -7.5 \cdot 10^{-227}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;F \leq 4.5 \cdot 10^{-141}:\\
\;\;\;\;\frac{x \cdot \cos B}{-\sin B}\\
\mathbf{elif}\;F \leq 0.24:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_1\\
\end{array}
\end{array}
if F < -5.70000000000000009e-8Initial program 59.6%
Simplified75.9%
Taylor expanded in x around 0 75.8%
associate-*l/75.8%
*-lft-identity75.8%
+-commutative75.8%
unpow275.8%
fma-undefine75.8%
Simplified75.8%
Taylor expanded in F around -inf 98.1%
if -5.70000000000000009e-8 < F < -7.49999999999999988e-227 or 4.5e-141 < F < 0.23999999999999999Initial program 99.6%
Taylor expanded in B around 0 79.9%
Taylor expanded in F around 0 77.0%
if -7.49999999999999988e-227 < F < 4.5e-141Initial program 99.4%
Taylor expanded in F around -inf 41.1%
div-inv41.2%
clear-num41.1%
Applied egg-rr41.1%
Taylor expanded in x around inf 82.8%
mul-1-neg82.8%
Simplified82.8%
if 0.23999999999999999 < F Initial program 54.0%
Simplified74.4%
Taylor expanded in x around 0 74.4%
associate-*l/74.4%
*-lft-identity74.4%
+-commutative74.4%
unpow274.4%
fma-undefine74.4%
Simplified74.4%
Taylor expanded in F around inf 99.9%
Final simplification91.4%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -4.6e-83)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 1.85e-92)
(/ (* 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 <= -4.6e-83) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 1.85e-92) {
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 <= (-4.6d-83)) then
tmp = ((-1.0d0) / sin(b)) - t_0
else if (f <= 1.85d-92) 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 <= -4.6e-83) {
tmp = (-1.0 / Math.sin(B)) - t_0;
} else if (F <= 1.85e-92) {
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 <= -4.6e-83: tmp = (-1.0 / math.sin(B)) - t_0 elif F <= 1.85e-92: 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 <= -4.6e-83) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 1.85e-92) tmp = Float64(Float64(x * cos(B)) / Float64(-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 <= -4.6e-83) tmp = (-1.0 / sin(B)) - t_0; elseif (F <= 1.85e-92) 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, -4.6e-83], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 1.85e-92], N[(N[(x * N[Cos[B], $MachinePrecision]), $MachinePrecision] / (-N[Sin[B], $MachinePrecision])), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -4.6 \cdot 10^{-83}:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq 1.85 \cdot 10^{-92}:\\
\;\;\;\;\frac{x \cdot \cos B}{-\sin B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_0\\
\end{array}
\end{array}
if F < -4.59999999999999979e-83Initial program 64.3%
Simplified78.6%
Taylor expanded in x around 0 78.6%
associate-*l/78.6%
*-lft-identity78.6%
+-commutative78.6%
unpow278.6%
fma-undefine78.6%
Simplified78.6%
Taylor expanded in F around -inf 90.0%
if -4.59999999999999979e-83 < F < 1.84999999999999988e-92Initial program 99.4%
Taylor expanded in F around -inf 38.3%
div-inv38.4%
clear-num38.3%
Applied egg-rr38.3%
Taylor expanded in x around inf 72.9%
mul-1-neg72.9%
Simplified72.9%
if 1.84999999999999988e-92 < F Initial program 61.2%
Simplified78.3%
Taylor expanded in x around 0 78.3%
associate-*l/78.3%
*-lft-identity78.3%
+-commutative78.3%
unpow278.3%
fma-undefine78.3%
Simplified78.3%
Taylor expanded in F around inf 91.1%
Final simplification85.3%
(FPCore (F B x)
:precision binary64
(if (<= F -1.6)
(- (/ -1.0 (sin B)) (/ x B))
(if (<= F 1.7e-59)
(/ (* x (cos B)) (- (sin B)))
(if (<= F 1200000000000.0)
(- (* (pow (+ (+ 2.0 (* F F)) (* x 2.0)) -0.5) (/ F B)) (/ x B))
(if (or (<= F 5.8e+32) (and (not (<= F 3.8e+127)) (<= F 9.5e+230)))
(- (* F (/ 1.0 (* F B))) (/ x (tan B)))
(- (/ 1.0 (sin B)) (/ x B)))))))
double code(double F, double B, double x) {
double tmp;
if (F <= -1.6) {
tmp = (-1.0 / sin(B)) - (x / B);
} else if (F <= 1.7e-59) {
tmp = (x * cos(B)) / -sin(B);
} else if (F <= 1200000000000.0) {
tmp = (pow(((2.0 + (F * F)) + (x * 2.0)), -0.5) * (F / B)) - (x / B);
} else if ((F <= 5.8e+32) || (!(F <= 3.8e+127) && (F <= 9.5e+230))) {
tmp = (F * (1.0 / (F * B))) - (x / tan(B));
} else {
tmp = (1.0 / sin(B)) - (x / B);
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if (f <= (-1.6d0)) then
tmp = ((-1.0d0) / sin(b)) - (x / b)
else if (f <= 1.7d-59) then
tmp = (x * cos(b)) / -sin(b)
else if (f <= 1200000000000.0d0) then
tmp = ((((2.0d0 + (f * f)) + (x * 2.0d0)) ** (-0.5d0)) * (f / b)) - (x / b)
else if ((f <= 5.8d+32) .or. (.not. (f <= 3.8d+127)) .and. (f <= 9.5d+230)) then
tmp = (f * (1.0d0 / (f * b))) - (x / tan(b))
else
tmp = (1.0d0 / sin(b)) - (x / b)
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -1.6) {
tmp = (-1.0 / Math.sin(B)) - (x / B);
} else if (F <= 1.7e-59) {
tmp = (x * Math.cos(B)) / -Math.sin(B);
} else if (F <= 1200000000000.0) {
tmp = (Math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5) * (F / B)) - (x / B);
} else if ((F <= 5.8e+32) || (!(F <= 3.8e+127) && (F <= 9.5e+230))) {
tmp = (F * (1.0 / (F * B))) - (x / Math.tan(B));
} else {
tmp = (1.0 / Math.sin(B)) - (x / B);
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -1.6: tmp = (-1.0 / math.sin(B)) - (x / B) elif F <= 1.7e-59: tmp = (x * math.cos(B)) / -math.sin(B) elif F <= 1200000000000.0: tmp = (math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5) * (F / B)) - (x / B) elif (F <= 5.8e+32) or (not (F <= 3.8e+127) and (F <= 9.5e+230)): tmp = (F * (1.0 / (F * B))) - (x / math.tan(B)) else: tmp = (1.0 / math.sin(B)) - (x / B) return tmp
function code(F, B, x) tmp = 0.0 if (F <= -1.6) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B)); elseif (F <= 1.7e-59) tmp = Float64(Float64(x * cos(B)) / Float64(-sin(B))); elseif (F <= 1200000000000.0) tmp = Float64(Float64((Float64(Float64(2.0 + Float64(F * F)) + Float64(x * 2.0)) ^ -0.5) * Float64(F / B)) - Float64(x / B)); elseif ((F <= 5.8e+32) || (!(F <= 3.8e+127) && (F <= 9.5e+230))) tmp = Float64(Float64(F * Float64(1.0 / Float64(F * B))) - Float64(x / tan(B))); else tmp = Float64(Float64(1.0 / sin(B)) - Float64(x / B)); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -1.6) tmp = (-1.0 / sin(B)) - (x / B); elseif (F <= 1.7e-59) tmp = (x * cos(B)) / -sin(B); elseif (F <= 1200000000000.0) tmp = ((((2.0 + (F * F)) + (x * 2.0)) ^ -0.5) * (F / B)) - (x / B); elseif ((F <= 5.8e+32) || (~((F <= 3.8e+127)) && (F <= 9.5e+230))) tmp = (F * (1.0 / (F * B))) - (x / tan(B)); else tmp = (1.0 / sin(B)) - (x / B); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -1.6], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.7e-59], N[(N[(x * N[Cos[B], $MachinePrecision]), $MachinePrecision] / (-N[Sin[B], $MachinePrecision])), $MachinePrecision], If[LessEqual[F, 1200000000000.0], N[(N[(N[Power[N[(N[(2.0 + N[(F * F), $MachinePrecision]), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] * N[(F / B), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[F, 5.8e+32], And[N[Not[LessEqual[F, 3.8e+127]], $MachinePrecision], LessEqual[F, 9.5e+230]]], N[(N[(F * N[(1.0 / N[(F * B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -1.6:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\
\mathbf{elif}\;F \leq 1.7 \cdot 10^{-59}:\\
\;\;\;\;\frac{x \cdot \cos B}{-\sin B}\\
\mathbf{elif}\;F \leq 1200000000000:\\
\;\;\;\;{\left(\left(2 + F \cdot F\right) + x \cdot 2\right)}^{-0.5} \cdot \frac{F}{B} - \frac{x}{B}\\
\mathbf{elif}\;F \leq 5.8 \cdot 10^{+32} \lor \neg \left(F \leq 3.8 \cdot 10^{+127}\right) \land F \leq 9.5 \cdot 10^{+230}:\\
\;\;\;\;F \cdot \frac{1}{F \cdot B} - \frac{x}{\tan B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - \frac{x}{B}\\
\end{array}
\end{array}
if F < -1.6000000000000001Initial program 59.0%
Taylor expanded in B around 0 43.0%
Taylor expanded in F around -inf 81.7%
distribute-lft-in81.7%
associate-*r/81.7%
metadata-eval81.7%
mul-1-neg81.7%
unsub-neg81.7%
Simplified81.7%
if -1.6000000000000001 < F < 1.70000000000000009e-59Initial program 99.4%
Taylor expanded in F around -inf 38.4%
div-inv38.4%
clear-num38.4%
Applied egg-rr38.4%
Taylor expanded in x around inf 67.1%
mul-1-neg67.1%
Simplified67.1%
if 1.70000000000000009e-59 < F < 1.2e12Initial program 99.7%
Taylor expanded in B around 0 99.7%
Taylor expanded in B around 0 75.6%
if 1.2e12 < F < 5.80000000000000006e32 or 3.7999999999999998e127 < F < 9.5000000000000002e230Initial program 40.9%
Simplified71.9%
Taylor expanded in x around 0 71.9%
associate-*l/71.9%
*-lft-identity71.9%
+-commutative71.9%
unpow271.9%
fma-undefine71.9%
Simplified71.9%
Taylor expanded in F around inf 99.6%
Taylor expanded in B around 0 93.8%
*-commutative93.8%
Simplified93.8%
if 5.80000000000000006e32 < F < 3.7999999999999998e127 or 9.5000000000000002e230 < F Initial program 60.3%
Taylor expanded in B around 0 43.3%
Taylor expanded in F around inf 81.7%
Final simplification77.6%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -5.2e-83)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 2.35e-51)
(/ (* x (cos B)) (- (sin B)))
(if (<= F 1200000000000.0)
(- (* (pow (+ (+ 2.0 (* F F)) (* x 2.0)) -0.5) (/ F B)) (/ x B))
(if (or (<= F 7.2e+31) (and (not (<= F 4.8e+128)) (<= F 5.8e+231)))
(- (* F (/ 1.0 (* F B))) t_0)
(- (/ 1.0 (sin B)) (/ x B))))))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -5.2e-83) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 2.35e-51) {
tmp = (x * cos(B)) / -sin(B);
} else if (F <= 1200000000000.0) {
tmp = (pow(((2.0 + (F * F)) + (x * 2.0)), -0.5) * (F / B)) - (x / B);
} else if ((F <= 7.2e+31) || (!(F <= 4.8e+128) && (F <= 5.8e+231))) {
tmp = (F * (1.0 / (F * B))) - t_0;
} else {
tmp = (1.0 / sin(B)) - (x / B);
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: tmp
t_0 = x / tan(b)
if (f <= (-5.2d-83)) then
tmp = ((-1.0d0) / sin(b)) - t_0
else if (f <= 2.35d-51) then
tmp = (x * cos(b)) / -sin(b)
else if (f <= 1200000000000.0d0) then
tmp = ((((2.0d0 + (f * f)) + (x * 2.0d0)) ** (-0.5d0)) * (f / b)) - (x / b)
else if ((f <= 7.2d+31) .or. (.not. (f <= 4.8d+128)) .and. (f <= 5.8d+231)) then
tmp = (f * (1.0d0 / (f * b))) - t_0
else
tmp = (1.0d0 / sin(b)) - (x / b)
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = x / Math.tan(B);
double tmp;
if (F <= -5.2e-83) {
tmp = (-1.0 / Math.sin(B)) - t_0;
} else if (F <= 2.35e-51) {
tmp = (x * Math.cos(B)) / -Math.sin(B);
} else if (F <= 1200000000000.0) {
tmp = (Math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5) * (F / B)) - (x / B);
} else if ((F <= 7.2e+31) || (!(F <= 4.8e+128) && (F <= 5.8e+231))) {
tmp = (F * (1.0 / (F * B))) - t_0;
} else {
tmp = (1.0 / Math.sin(B)) - (x / B);
}
return tmp;
}
def code(F, B, x): t_0 = x / math.tan(B) tmp = 0 if F <= -5.2e-83: tmp = (-1.0 / math.sin(B)) - t_0 elif F <= 2.35e-51: tmp = (x * math.cos(B)) / -math.sin(B) elif F <= 1200000000000.0: tmp = (math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5) * (F / B)) - (x / B) elif (F <= 7.2e+31) or (not (F <= 4.8e+128) and (F <= 5.8e+231)): tmp = (F * (1.0 / (F * B))) - t_0 else: tmp = (1.0 / math.sin(B)) - (x / B) return tmp
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -5.2e-83) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 2.35e-51) tmp = Float64(Float64(x * cos(B)) / Float64(-sin(B))); elseif (F <= 1200000000000.0) tmp = Float64(Float64((Float64(Float64(2.0 + Float64(F * F)) + Float64(x * 2.0)) ^ -0.5) * Float64(F / B)) - Float64(x / B)); elseif ((F <= 7.2e+31) || (!(F <= 4.8e+128) && (F <= 5.8e+231))) tmp = Float64(Float64(F * Float64(1.0 / Float64(F * B))) - t_0); else tmp = Float64(Float64(1.0 / sin(B)) - Float64(x / B)); end return tmp end
function tmp_2 = code(F, B, x) t_0 = x / tan(B); tmp = 0.0; if (F <= -5.2e-83) tmp = (-1.0 / sin(B)) - t_0; elseif (F <= 2.35e-51) tmp = (x * cos(B)) / -sin(B); elseif (F <= 1200000000000.0) tmp = ((((2.0 + (F * F)) + (x * 2.0)) ^ -0.5) * (F / B)) - (x / B); elseif ((F <= 7.2e+31) || (~((F <= 4.8e+128)) && (F <= 5.8e+231))) tmp = (F * (1.0 / (F * B))) - t_0; else tmp = (1.0 / sin(B)) - (x / B); end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -5.2e-83], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 2.35e-51], N[(N[(x * N[Cos[B], $MachinePrecision]), $MachinePrecision] / (-N[Sin[B], $MachinePrecision])), $MachinePrecision], If[LessEqual[F, 1200000000000.0], N[(N[(N[Power[N[(N[(2.0 + N[(F * F), $MachinePrecision]), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] * N[(F / B), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[F, 7.2e+31], And[N[Not[LessEqual[F, 4.8e+128]], $MachinePrecision], LessEqual[F, 5.8e+231]]], N[(N[(F * N[(1.0 / N[(F * B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -5.2 \cdot 10^{-83}:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq 2.35 \cdot 10^{-51}:\\
\;\;\;\;\frac{x \cdot \cos B}{-\sin B}\\
\mathbf{elif}\;F \leq 1200000000000:\\
\;\;\;\;{\left(\left(2 + F \cdot F\right) + x \cdot 2\right)}^{-0.5} \cdot \frac{F}{B} - \frac{x}{B}\\
\mathbf{elif}\;F \leq 7.2 \cdot 10^{+31} \lor \neg \left(F \leq 4.8 \cdot 10^{+128}\right) \land F \leq 5.8 \cdot 10^{+231}:\\
\;\;\;\;F \cdot \frac{1}{F \cdot B} - t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - \frac{x}{B}\\
\end{array}
\end{array}
if F < -5.20000000000000018e-83Initial program 64.3%
Simplified78.6%
Taylor expanded in x around 0 78.6%
associate-*l/78.6%
*-lft-identity78.6%
+-commutative78.6%
unpow278.6%
fma-undefine78.6%
Simplified78.6%
Taylor expanded in F around -inf 90.0%
if -5.20000000000000018e-83 < F < 2.3499999999999999e-51Initial program 99.4%
Taylor expanded in F around -inf 39.2%
div-inv39.2%
clear-num39.2%
Applied egg-rr39.2%
Taylor expanded in x around inf 71.4%
mul-1-neg71.4%
Simplified71.4%
if 2.3499999999999999e-51 < F < 1.2e12Initial program 99.7%
Taylor expanded in B around 0 99.7%
Taylor expanded in B around 0 75.6%
if 1.2e12 < F < 7.19999999999999992e31 or 4.8000000000000004e128 < F < 5.8000000000000002e231Initial program 40.9%
Simplified71.9%
Taylor expanded in x around 0 71.9%
associate-*l/71.9%
*-lft-identity71.9%
+-commutative71.9%
unpow271.9%
fma-undefine71.9%
Simplified71.9%
Taylor expanded in F around inf 99.6%
Taylor expanded in B around 0 93.8%
*-commutative93.8%
Simplified93.8%
if 7.19999999999999992e31 < F < 4.8000000000000004e128 or 5.8000000000000002e231 < F Initial program 60.3%
Taylor expanded in B around 0 43.3%
Taylor expanded in F around inf 81.7%
Final simplification82.1%
(FPCore (F B x)
:precision binary64
(if (<= F -9.5)
(- (/ -1.0 (sin B)) (/ x B))
(if (<= F 4.3e-44)
(+ (* x (/ -1.0 (tan B))) (/ -1.0 B))
(if (or (<= F 8.5e+124) (not (<= F 9.5e+230)))
(- (/ 1.0 (sin B)) (/ x B))
(- (* F (/ 1.0 (* F B))) (/ x (tan B)))))))
double code(double F, double B, double x) {
double tmp;
if (F <= -9.5) {
tmp = (-1.0 / sin(B)) - (x / B);
} else if (F <= 4.3e-44) {
tmp = (x * (-1.0 / tan(B))) + (-1.0 / B);
} else if ((F <= 8.5e+124) || !(F <= 9.5e+230)) {
tmp = (1.0 / sin(B)) - (x / B);
} else {
tmp = (F * (1.0 / (F * 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 <= (-9.5d0)) then
tmp = ((-1.0d0) / sin(b)) - (x / b)
else if (f <= 4.3d-44) then
tmp = (x * ((-1.0d0) / tan(b))) + ((-1.0d0) / b)
else if ((f <= 8.5d+124) .or. (.not. (f <= 9.5d+230))) then
tmp = (1.0d0 / sin(b)) - (x / b)
else
tmp = (f * (1.0d0 / (f * b))) - (x / tan(b))
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -9.5) {
tmp = (-1.0 / Math.sin(B)) - (x / B);
} else if (F <= 4.3e-44) {
tmp = (x * (-1.0 / Math.tan(B))) + (-1.0 / B);
} else if ((F <= 8.5e+124) || !(F <= 9.5e+230)) {
tmp = (1.0 / Math.sin(B)) - (x / B);
} else {
tmp = (F * (1.0 / (F * B))) - (x / Math.tan(B));
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -9.5: tmp = (-1.0 / math.sin(B)) - (x / B) elif F <= 4.3e-44: tmp = (x * (-1.0 / math.tan(B))) + (-1.0 / B) elif (F <= 8.5e+124) or not (F <= 9.5e+230): tmp = (1.0 / math.sin(B)) - (x / B) else: tmp = (F * (1.0 / (F * B))) - (x / math.tan(B)) return tmp
function code(F, B, x) tmp = 0.0 if (F <= -9.5) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B)); elseif (F <= 4.3e-44) tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(-1.0 / B)); elseif ((F <= 8.5e+124) || !(F <= 9.5e+230)) tmp = Float64(Float64(1.0 / sin(B)) - Float64(x / B)); else tmp = Float64(Float64(F * Float64(1.0 / Float64(F * B))) - Float64(x / tan(B))); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -9.5) tmp = (-1.0 / sin(B)) - (x / B); elseif (F <= 4.3e-44) tmp = (x * (-1.0 / tan(B))) + (-1.0 / B); elseif ((F <= 8.5e+124) || ~((F <= 9.5e+230))) tmp = (1.0 / sin(B)) - (x / B); else tmp = (F * (1.0 / (F * B))) - (x / tan(B)); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -9.5], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 4.3e-44], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(-1.0 / B), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[F, 8.5e+124], N[Not[LessEqual[F, 9.5e+230]], $MachinePrecision]], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], N[(N[(F * N[(1.0 / N[(F * B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -9.5:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\
\mathbf{elif}\;F \leq 4.3 \cdot 10^{-44}:\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{-1}{B}\\
\mathbf{elif}\;F \leq 8.5 \cdot 10^{+124} \lor \neg \left(F \leq 9.5 \cdot 10^{+230}\right):\\
\;\;\;\;\frac{1}{\sin B} - \frac{x}{B}\\
\mathbf{else}:\\
\;\;\;\;F \cdot \frac{1}{F \cdot B} - \frac{x}{\tan B}\\
\end{array}
\end{array}
if F < -9.5Initial program 59.0%
Taylor expanded in B around 0 43.0%
Taylor expanded in F around -inf 81.7%
distribute-lft-in81.7%
associate-*r/81.7%
metadata-eval81.7%
mul-1-neg81.7%
unsub-neg81.7%
Simplified81.7%
if -9.5 < F < 4.30000000000000013e-44Initial program 99.4%
Taylor expanded in F around -inf 38.4%
Taylor expanded in B around 0 51.1%
if 4.30000000000000013e-44 < F < 8.4999999999999997e124 or 9.5000000000000002e230 < F Initial program 69.6%
Taylor expanded in B around 0 53.7%
Taylor expanded in F around inf 74.0%
if 8.4999999999999997e124 < F < 9.5000000000000002e230Initial program 32.5%
Simplified68.0%
Taylor expanded in x around 0 68.0%
associate-*l/68.0%
*-lft-identity68.0%
+-commutative68.0%
unpow268.0%
fma-undefine68.0%
Simplified68.0%
Taylor expanded in F around inf 99.6%
Taylor expanded in B around 0 96.3%
*-commutative96.3%
Simplified96.3%
Final simplification70.1%
(FPCore (F B x)
:precision binary64
(if (<= F -7.8)
(- (/ -1.0 (sin B)) (/ x B))
(if (<= F 1.2e-44)
(+ (* x (/ -1.0 (tan B))) (/ -1.0 B))
(- (/ 1.0 (sin B)) (/ x B)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -7.8) {
tmp = (-1.0 / sin(B)) - (x / B);
} else if (F <= 1.2e-44) {
tmp = (x * (-1.0 / tan(B))) + (-1.0 / B);
} else {
tmp = (1.0 / sin(B)) - (x / B);
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if (f <= (-7.8d0)) then
tmp = ((-1.0d0) / sin(b)) - (x / b)
else if (f <= 1.2d-44) then
tmp = (x * ((-1.0d0) / tan(b))) + ((-1.0d0) / b)
else
tmp = (1.0d0 / sin(b)) - (x / b)
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -7.8) {
tmp = (-1.0 / Math.sin(B)) - (x / B);
} else if (F <= 1.2e-44) {
tmp = (x * (-1.0 / Math.tan(B))) + (-1.0 / B);
} else {
tmp = (1.0 / Math.sin(B)) - (x / B);
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -7.8: tmp = (-1.0 / math.sin(B)) - (x / B) elif F <= 1.2e-44: tmp = (x * (-1.0 / math.tan(B))) + (-1.0 / B) else: tmp = (1.0 / math.sin(B)) - (x / B) return tmp
function code(F, B, x) tmp = 0.0 if (F <= -7.8) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B)); elseif (F <= 1.2e-44) tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(-1.0 / B)); else tmp = Float64(Float64(1.0 / sin(B)) - Float64(x / B)); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -7.8) tmp = (-1.0 / sin(B)) - (x / B); elseif (F <= 1.2e-44) tmp = (x * (-1.0 / tan(B))) + (-1.0 / B); else tmp = (1.0 / sin(B)) - (x / B); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -7.8], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.2e-44], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(-1.0 / B), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -7.8:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\
\mathbf{elif}\;F \leq 1.2 \cdot 10^{-44}:\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{-1}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - \frac{x}{B}\\
\end{array}
\end{array}
if F < -7.79999999999999982Initial program 59.0%
Taylor expanded in B around 0 43.0%
Taylor expanded in F around -inf 81.7%
distribute-lft-in81.7%
associate-*r/81.7%
metadata-eval81.7%
mul-1-neg81.7%
unsub-neg81.7%
Simplified81.7%
if -7.79999999999999982 < F < 1.20000000000000004e-44Initial program 99.4%
Taylor expanded in F around -inf 38.4%
Taylor expanded in B around 0 51.1%
if 1.20000000000000004e-44 < F Initial program 58.8%
Taylor expanded in B around 0 40.7%
Taylor expanded in F around inf 74.7%
Final simplification67.9%
(FPCore (F B x) :precision binary64 (if (<= F -1.05e-142) (- (/ -1.0 (sin B)) (/ x B)) (if (<= F 3.6e-103) (/ x (- B)) (- (/ 1.0 (sin B)) (/ x B)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -1.05e-142) {
tmp = (-1.0 / sin(B)) - (x / B);
} else if (F <= 3.6e-103) {
tmp = x / -B;
} else {
tmp = (1.0 / sin(B)) - (x / B);
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if (f <= (-1.05d-142)) then
tmp = ((-1.0d0) / sin(b)) - (x / b)
else if (f <= 3.6d-103) then
tmp = x / -b
else
tmp = (1.0d0 / sin(b)) - (x / b)
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -1.05e-142) {
tmp = (-1.0 / Math.sin(B)) - (x / B);
} else if (F <= 3.6e-103) {
tmp = x / -B;
} else {
tmp = (1.0 / Math.sin(B)) - (x / B);
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -1.05e-142: tmp = (-1.0 / math.sin(B)) - (x / B) elif F <= 3.6e-103: tmp = x / -B else: tmp = (1.0 / math.sin(B)) - (x / B) return tmp
function code(F, B, x) tmp = 0.0 if (F <= -1.05e-142) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B)); elseif (F <= 3.6e-103) tmp = Float64(x / Float64(-B)); else tmp = Float64(Float64(1.0 / sin(B)) - Float64(x / B)); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -1.05e-142) tmp = (-1.0 / sin(B)) - (x / B); elseif (F <= 3.6e-103) tmp = x / -B; else tmp = (1.0 / sin(B)) - (x / B); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -1.05e-142], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 3.6e-103], N[(x / (-B)), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -1.05 \cdot 10^{-142}:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\
\mathbf{elif}\;F \leq 3.6 \cdot 10^{-103}:\\
\;\;\;\;\frac{x}{-B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - \frac{x}{B}\\
\end{array}
\end{array}
if F < -1.05e-142Initial program 68.3%
Taylor expanded in B around 0 50.6%
Taylor expanded in F around -inf 67.7%
distribute-lft-in67.7%
associate-*r/67.7%
metadata-eval67.7%
mul-1-neg67.7%
unsub-neg67.7%
Simplified67.7%
if -1.05e-142 < F < 3.5999999999999998e-103Initial program 99.4%
Taylor expanded in B around 0 57.3%
Taylor expanded in x around inf 36.2%
associate-*r/36.2%
neg-mul-136.2%
Simplified36.2%
if 3.5999999999999998e-103 < F Initial program 62.3%
Taylor expanded in B around 0 43.0%
Taylor expanded in F around inf 69.6%
Final simplification60.6%
(FPCore (F B x) :precision binary64 (if (<= F -1.06e-142) (- (/ -1.0 (sin B)) (/ x B)) (if (<= F 2.25e-103) (/ x (- B)) (/ (- 1.0 x) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -1.06e-142) {
tmp = (-1.0 / sin(B)) - (x / B);
} else if (F <= 2.25e-103) {
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.06d-142)) then
tmp = ((-1.0d0) / sin(b)) - (x / b)
else if (f <= 2.25d-103) 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.06e-142) {
tmp = (-1.0 / Math.sin(B)) - (x / B);
} else if (F <= 2.25e-103) {
tmp = x / -B;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -1.06e-142: tmp = (-1.0 / math.sin(B)) - (x / B) elif F <= 2.25e-103: tmp = x / -B else: tmp = (1.0 - x) / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= -1.06e-142) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B)); elseif (F <= 2.25e-103) 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 <= -1.06e-142) tmp = (-1.0 / sin(B)) - (x / B); elseif (F <= 2.25e-103) tmp = x / -B; else tmp = (1.0 - x) / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -1.06e-142], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 2.25e-103], N[(x / (-B)), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -1.06 \cdot 10^{-142}:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\
\mathbf{elif}\;F \leq 2.25 \cdot 10^{-103}:\\
\;\;\;\;\frac{x}{-B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -1.05999999999999999e-142Initial program 68.3%
Taylor expanded in B around 0 50.6%
Taylor expanded in F around -inf 67.7%
distribute-lft-in67.7%
associate-*r/67.7%
metadata-eval67.7%
mul-1-neg67.7%
unsub-neg67.7%
Simplified67.7%
if -1.05999999999999999e-142 < F < 2.25e-103Initial program 99.4%
Taylor expanded in B around 0 57.3%
Taylor expanded in x around inf 36.2%
associate-*r/36.2%
neg-mul-136.2%
Simplified36.2%
if 2.25e-103 < F Initial program 62.3%
Simplified78.9%
Taylor expanded in x around 0 78.9%
associate-*l/78.9%
*-lft-identity78.9%
+-commutative78.9%
unpow278.9%
fma-undefine78.9%
Simplified78.9%
Taylor expanded in F around inf 88.5%
Taylor expanded in B around 0 51.1%
Final simplification53.0%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (- B))))
(if (<= F -2e+188)
t_0
(if (<= F -5e+121)
(/ (+ -1.0 x) B)
(if (<= F 3.3e-103) t_0 (/ (- 1.0 x) B))))))
double code(double F, double B, double x) {
double t_0 = x / -B;
double tmp;
if (F <= -2e+188) {
tmp = t_0;
} else if (F <= -5e+121) {
tmp = (-1.0 + x) / B;
} else if (F <= 3.3e-103) {
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 = x / -b
if (f <= (-2d+188)) then
tmp = t_0
else if (f <= (-5d+121)) then
tmp = ((-1.0d0) + x) / b
else if (f <= 3.3d-103) 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 = x / -B;
double tmp;
if (F <= -2e+188) {
tmp = t_0;
} else if (F <= -5e+121) {
tmp = (-1.0 + x) / B;
} else if (F <= 3.3e-103) {
tmp = t_0;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
def code(F, B, x): t_0 = x / -B tmp = 0 if F <= -2e+188: tmp = t_0 elif F <= -5e+121: tmp = (-1.0 + x) / B elif F <= 3.3e-103: tmp = t_0 else: tmp = (1.0 - x) / B return tmp
function code(F, B, x) t_0 = Float64(x / Float64(-B)) tmp = 0.0 if (F <= -2e+188) tmp = t_0; elseif (F <= -5e+121) tmp = Float64(Float64(-1.0 + x) / B); elseif (F <= 3.3e-103) tmp = t_0; else tmp = Float64(Float64(1.0 - x) / B); end return tmp end
function tmp_2 = code(F, B, x) t_0 = x / -B; tmp = 0.0; if (F <= -2e+188) tmp = t_0; elseif (F <= -5e+121) tmp = (-1.0 + x) / B; elseif (F <= 3.3e-103) tmp = t_0; else tmp = (1.0 - x) / B; end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / (-B)), $MachinePrecision]}, If[LessEqual[F, -2e+188], t$95$0, If[LessEqual[F, -5e+121], N[(N[(-1.0 + x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 3.3e-103], t$95$0, N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{-B}\\
\mathbf{if}\;F \leq -2 \cdot 10^{+188}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;F \leq -5 \cdot 10^{+121}:\\
\;\;\;\;\frac{-1 + x}{B}\\
\mathbf{elif}\;F \leq 3.3 \cdot 10^{-103}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -2e188 or -5.00000000000000007e121 < F < 3.2999999999999999e-103Initial program 84.8%
Taylor expanded in B around 0 56.3%
Taylor expanded in x around inf 32.8%
associate-*r/32.8%
neg-mul-132.8%
Simplified32.8%
if -2e188 < F < -5.00000000000000007e121Initial program 55.2%
Taylor expanded in F around -inf 99.7%
add-exp-log61.6%
+-commutative61.6%
add-sqr-sqrt50.7%
sqrt-unprod61.7%
sqr-neg61.7%
sqrt-unprod11.0%
add-sqr-sqrt40.0%
un-div-inv40.0%
Applied egg-rr40.0%
Taylor expanded in B around 0 43.2%
if 3.2999999999999999e-103 < F Initial program 62.3%
Simplified78.9%
Taylor expanded in x around 0 78.9%
associate-*l/78.9%
*-lft-identity78.9%
+-commutative78.9%
unpow278.9%
fma-undefine78.9%
Simplified78.9%
Taylor expanded in F around inf 88.5%
Taylor expanded in B around 0 51.1%
Final simplification41.0%
(FPCore (F B x) :precision binary64 (if (<= F -1.02e-142) (/ (- -1.0 x) B) (if (<= F 3.3e-103) (/ x (- B)) (/ (- 1.0 x) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -1.02e-142) {
tmp = (-1.0 - x) / B;
} else if (F <= 3.3e-103) {
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.02d-142)) then
tmp = ((-1.0d0) - x) / b
else if (f <= 3.3d-103) 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.02e-142) {
tmp = (-1.0 - x) / B;
} else if (F <= 3.3e-103) {
tmp = x / -B;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -1.02e-142: tmp = (-1.0 - x) / B elif F <= 3.3e-103: tmp = x / -B else: tmp = (1.0 - x) / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= -1.02e-142) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= 3.3e-103) 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 <= -1.02e-142) tmp = (-1.0 - x) / B; elseif (F <= 3.3e-103) tmp = x / -B; else tmp = (1.0 - x) / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -1.02e-142], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 3.3e-103], N[(x / (-B)), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -1.02 \cdot 10^{-142}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq 3.3 \cdot 10^{-103}:\\
\;\;\;\;\frac{x}{-B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -1.0200000000000001e-142Initial program 68.3%
Taylor expanded in F around -inf 85.6%
Taylor expanded in B around 0 43.9%
mul-1-neg43.9%
distribute-neg-frac243.9%
Simplified43.9%
if -1.0200000000000001e-142 < F < 3.2999999999999999e-103Initial program 99.4%
Taylor expanded in B around 0 57.3%
Taylor expanded in x around inf 36.2%
associate-*r/36.2%
neg-mul-136.2%
Simplified36.2%
if 3.2999999999999999e-103 < F Initial program 62.3%
Simplified78.9%
Taylor expanded in x around 0 78.9%
associate-*l/78.9%
*-lft-identity78.9%
+-commutative78.9%
unpow278.9%
fma-undefine78.9%
Simplified78.9%
Taylor expanded in F around inf 88.5%
Taylor expanded in B around 0 51.1%
Final simplification44.9%
(FPCore (F B x) :precision binary64 (if (<= F -1.06e-142) (- (/ -1.0 B) (/ x B)) (if (<= F 1.5e-103) (/ x (- B)) (/ (- 1.0 x) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -1.06e-142) {
tmp = (-1.0 / B) - (x / B);
} else if (F <= 1.5e-103) {
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.06d-142)) then
tmp = ((-1.0d0) / b) - (x / b)
else if (f <= 1.5d-103) 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.06e-142) {
tmp = (-1.0 / B) - (x / B);
} else if (F <= 1.5e-103) {
tmp = x / -B;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -1.06e-142: tmp = (-1.0 / B) - (x / B) elif F <= 1.5e-103: tmp = x / -B else: tmp = (1.0 - x) / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= -1.06e-142) tmp = Float64(Float64(-1.0 / B) - Float64(x / B)); elseif (F <= 1.5e-103) 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 <= -1.06e-142) tmp = (-1.0 / B) - (x / B); elseif (F <= 1.5e-103) tmp = x / -B; else tmp = (1.0 - x) / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -1.06e-142], N[(N[(-1.0 / B), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.5e-103], N[(x / (-B)), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -1.06 \cdot 10^{-142}:\\
\;\;\;\;\frac{-1}{B} - \frac{x}{B}\\
\mathbf{elif}\;F \leq 1.5 \cdot 10^{-103}:\\
\;\;\;\;\frac{x}{-B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -1.05999999999999999e-142Initial program 68.3%
Taylor expanded in B around 0 50.6%
Taylor expanded in B around 0 27.6%
add-sqr-sqrt27.6%
unpow-prod-down27.5%
+-commutative27.5%
fma-define27.5%
fma-define27.5%
metadata-eval27.5%
metadata-eval27.5%
+-commutative27.5%
fma-define27.5%
fma-define27.5%
metadata-eval27.5%
metadata-eval27.5%
Applied egg-rr27.5%
pow-sqr27.6%
metadata-eval27.6%
unpow-127.6%
Simplified27.6%
Taylor expanded in F around -inf 43.9%
distribute-lft-in43.9%
mul-1-neg43.9%
unsub-neg43.9%
associate-*r/43.9%
metadata-eval43.9%
Simplified43.9%
if -1.05999999999999999e-142 < F < 1.5e-103Initial program 99.4%
Taylor expanded in B around 0 57.3%
Taylor expanded in x around inf 36.2%
associate-*r/36.2%
neg-mul-136.2%
Simplified36.2%
if 1.5e-103 < F Initial program 62.3%
Simplified78.9%
Taylor expanded in x around 0 78.9%
associate-*l/78.9%
*-lft-identity78.9%
+-commutative78.9%
unpow278.9%
fma-undefine78.9%
Simplified78.9%
Taylor expanded in F around inf 88.5%
Taylor expanded in B around 0 51.1%
Final simplification44.9%
(FPCore (F B x) :precision binary64 (if (<= F 2.15e-103) (/ x (- B)) (/ (- 1.0 x) B)))
double code(double F, double B, double x) {
double tmp;
if (F <= 2.15e-103) {
tmp = x / -B;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if (f <= 2.15d-103) then
tmp = x / -b
else
tmp = (1.0d0 - x) / b
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= 2.15e-103) {
tmp = x / -B;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= 2.15e-103: tmp = x / -B else: tmp = (1.0 - x) / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= 2.15e-103) 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 <= 2.15e-103) tmp = x / -B; else tmp = (1.0 - x) / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, 2.15e-103], N[(x / (-B)), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq 2.15 \cdot 10^{-103}:\\
\;\;\;\;\frac{x}{-B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < 2.15000000000000011e-103Initial program 81.5%
Taylor expanded in B around 0 53.4%
Taylor expanded in x around inf 30.0%
associate-*r/30.0%
neg-mul-130.0%
Simplified30.0%
if 2.15000000000000011e-103 < F Initial program 62.3%
Simplified78.9%
Taylor expanded in x around 0 78.9%
associate-*l/78.9%
*-lft-identity78.9%
+-commutative78.9%
unpow278.9%
fma-undefine78.9%
Simplified78.9%
Taylor expanded in F around inf 88.5%
Taylor expanded in B around 0 51.1%
Final simplification38.6%
(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 73.6%
Taylor expanded in B around 0 49.1%
Taylor expanded in x around inf 29.5%
associate-*r/29.5%
neg-mul-129.5%
Simplified29.5%
Final simplification29.5%
herbie shell --seed 2024071
(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))))))