
(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 23 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 -7.5e+76)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 80000.0)
(- (* F (/ (pow (fma x 2.0 (fma F F 2.0)) -0.5) (sin B))) t_0)
(- (- (/ 1.0 (sin B)) (/ 1.0 (* (sin B) (pow F 2.0)))) t_0)))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -7.5e+76) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 80000.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)) - (1.0 / (sin(B) * pow(F, 2.0)))) - t_0;
}
return tmp;
}
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -7.5e+76) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 80000.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(Float64(1.0 / sin(B)) - Float64(1.0 / Float64(sin(B) * (F ^ 2.0)))) - t_0); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -7.5e+76], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 80000.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[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(1.0 / N[(N[Sin[B], $MachinePrecision] * N[Power[F, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -7.5 \cdot 10^{+76}:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq 80000:\\
\;\;\;\;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}:\\
\;\;\;\;\left(\frac{1}{\sin B} - \frac{1}{\sin B \cdot {F}^{2}}\right) - t\_0\\
\end{array}
\end{array}
if F < -7.4999999999999995e76Initial program 61.2%
Simplified69.5%
Taylor expanded in x around 0 69.6%
associate-*l/69.5%
*-lft-identity69.5%
+-commutative69.5%
unpow269.5%
fma-udef69.5%
Simplified69.5%
Taylor expanded in F around -inf 99.7%
if -7.4999999999999995e76 < F < 8e4Initial program 98.7%
Simplified99.7%
if 8e4 < F Initial program 53.4%
Simplified74.5%
Taylor expanded in x around 0 74.4%
associate-*l/74.5%
*-lft-identity74.5%
+-commutative74.5%
unpow274.5%
fma-udef74.5%
Simplified74.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 -8.8e+20)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 12000.0)
(- (* F (/ (sqrt (/ 1.0 (fma F F 2.0))) (sin B))) t_0)
(- (- (/ 1.0 (sin B)) (/ 1.0 (* (sin B) (pow F 2.0)))) t_0)))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -8.8e+20) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 12000.0) {
tmp = (F * (sqrt((1.0 / fma(F, F, 2.0))) / sin(B))) - t_0;
} else {
tmp = ((1.0 / sin(B)) - (1.0 / (sin(B) * pow(F, 2.0)))) - t_0;
}
return tmp;
}
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -8.8e+20) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 12000.0) tmp = Float64(Float64(F * Float64(sqrt(Float64(1.0 / fma(F, F, 2.0))) / sin(B))) - t_0); else tmp = Float64(Float64(Float64(1.0 / sin(B)) - Float64(1.0 / Float64(sin(B) * (F ^ 2.0)))) - t_0); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -8.8e+20], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 12000.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[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(1.0 / N[(N[Sin[B], $MachinePrecision] * N[Power[F, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -8.8 \cdot 10^{+20}:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq 12000:\\
\;\;\;\;F \cdot \frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B} - t\_0\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{1}{\sin B} - \frac{1}{\sin B \cdot {F}^{2}}\right) - t\_0\\
\end{array}
\end{array}
if F < -8.8e20Initial program 66.9%
Simplified75.2%
Taylor expanded in x around 0 75.2%
associate-*l/75.2%
*-lft-identity75.2%
+-commutative75.2%
unpow275.2%
fma-udef75.2%
Simplified75.2%
Taylor expanded in F around -inf 99.7%
if -8.8e20 < F < 12000Initial program 99.4%
Simplified99.7%
Taylor expanded in x around 0 99.7%
associate-*l/99.7%
*-lft-identity99.7%
+-commutative99.7%
unpow299.7%
fma-udef99.7%
Simplified99.7%
if 12000 < F Initial program 53.4%
Simplified74.5%
Taylor expanded in x around 0 74.4%
associate-*l/74.5%
*-lft-identity74.5%
+-commutative74.5%
unpow274.5%
fma-udef74.5%
Simplified74.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 -2e+20)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 650.0)
(- (* F (/ (sqrt (/ 1.0 (fma F F 2.0))) (sin B))) t_0)
(- (/ (/ F (+ F (- (/ 1.0 F) (/ 0.5 (pow F 3.0))))) (sin B)) t_0)))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -2e+20) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 650.0) {
tmp = (F * (sqrt((1.0 / fma(F, F, 2.0))) / sin(B))) - t_0;
} else {
tmp = ((F / (F + ((1.0 / F) - (0.5 / pow(F, 3.0))))) / sin(B)) - t_0;
}
return tmp;
}
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -2e+20) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 650.0) tmp = Float64(Float64(F * Float64(sqrt(Float64(1.0 / fma(F, F, 2.0))) / sin(B))) - t_0); else tmp = Float64(Float64(Float64(F / Float64(F + Float64(Float64(1.0 / F) - Float64(0.5 / (F ^ 3.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, -2e+20], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 650.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[(N[(F / N[(F + N[(N[(1.0 / F), $MachinePrecision] - N[(0.5 / N[Power[F, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 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 \cdot 10^{+20}:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq 650:\\
\;\;\;\;F \cdot \frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B} - t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{F}{F + \left(\frac{1}{F} - \frac{0.5}{{F}^{3}}\right)}}{\sin B} - t\_0\\
\end{array}
\end{array}
if F < -2e20Initial program 66.9%
Simplified75.2%
Taylor expanded in x around 0 75.2%
associate-*l/75.2%
*-lft-identity75.2%
+-commutative75.2%
unpow275.2%
fma-udef75.2%
Simplified75.2%
Taylor expanded in F around -inf 99.7%
if -2e20 < F < 650Initial program 99.5%
Simplified99.7%
Taylor expanded in x around 0 99.7%
associate-*l/99.7%
*-lft-identity99.7%
+-commutative99.7%
unpow299.7%
fma-udef99.7%
Simplified99.7%
if 650 < F Initial program 54.7%
Simplified75.2%
Taylor expanded in x around 0 75.1%
associate-*l/75.2%
*-lft-identity75.2%
+-commutative75.2%
unpow275.2%
fma-udef75.2%
Simplified75.2%
associate-*r/75.2%
sqrt-div75.3%
metadata-eval75.3%
un-div-inv75.3%
Applied egg-rr75.3%
Taylor expanded in F around inf 99.8%
associate--l+99.8%
associate-*r/99.8%
metadata-eval99.8%
Simplified99.8%
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 0.95)
(- (* F (/ (sqrt 0.5) (sin B))) t_0)
(- (/ (/ F (+ F (- (/ 1.0 F) (/ 0.5 (pow F 3.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 <= 0.95) {
tmp = (F * (sqrt(0.5) / sin(B))) - t_0;
} else {
tmp = ((F / (F + ((1.0 / F) - (0.5 / pow(F, 3.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 <= 0.95d0) then
tmp = (f * (sqrt(0.5d0) / sin(b))) - t_0
else
tmp = ((f / (f + ((1.0d0 / f) - (0.5d0 / (f ** 3.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 <= 0.95) {
tmp = (F * (Math.sqrt(0.5) / Math.sin(B))) - t_0;
} else {
tmp = ((F / (F + ((1.0 / F) - (0.5 / Math.pow(F, 3.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 <= 0.95: tmp = (F * (math.sqrt(0.5) / math.sin(B))) - t_0 else: tmp = ((F / (F + ((1.0 / F) - (0.5 / math.pow(F, 3.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 <= 0.95) tmp = Float64(Float64(F * Float64(sqrt(0.5) / sin(B))) - t_0); else tmp = Float64(Float64(Float64(F / Float64(F + Float64(Float64(1.0 / F) - Float64(0.5 / (F ^ 3.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 <= 0.95) tmp = (F * (sqrt(0.5) / sin(B))) - t_0; else tmp = ((F / (F + ((1.0 / F) - (0.5 / (F ^ 3.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, 0.95], N[(N[(F * N[(N[Sqrt[0.5], $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], N[(N[(N[(F / N[(F + N[(N[(1.0 / F), $MachinePrecision] - N[(0.5 / N[Power[F, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 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 0.95:\\
\;\;\;\;F \cdot \frac{\sqrt{0.5}}{\sin B} - t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{F}{F + \left(\frac{1}{F} - \frac{0.5}{{F}^{3}}\right)}}{\sin B} - t\_0\\
\end{array}
\end{array}
if F < -1.3999999999999999Initial program 68.7%
Simplified76.5%
Taylor expanded in x around 0 76.6%
associate-*l/76.5%
*-lft-identity76.5%
+-commutative76.5%
unpow276.5%
fma-udef76.5%
Simplified76.5%
Taylor expanded in F around -inf 99.7%
if -1.3999999999999999 < F < 0.94999999999999996Initial program 99.5%
Simplified99.7%
Taylor expanded in x around 0 99.7%
associate-*l/99.7%
*-lft-identity99.7%
+-commutative99.7%
unpow299.7%
fma-udef99.7%
Simplified99.7%
Taylor expanded in F around 0 99.7%
if 0.94999999999999996 < F Initial program 54.7%
Simplified75.2%
Taylor expanded in x around 0 75.1%
associate-*l/75.2%
*-lft-identity75.2%
+-commutative75.2%
unpow275.2%
fma-udef75.2%
Simplified75.2%
associate-*r/75.2%
sqrt-div75.3%
metadata-eval75.3%
un-div-inv75.3%
Applied egg-rr75.3%
Taylor expanded in F around inf 99.8%
associate--l+99.8%
associate-*r/99.8%
metadata-eval99.8%
Simplified99.8%
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 0.98)
(- (* F (/ (sqrt 0.5) (sin B))) t_0)
(- (/ (/ F (+ F (/ 1.0 F))) (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 <= 0.98) {
tmp = (F * (sqrt(0.5) / sin(B))) - t_0;
} else {
tmp = ((F / (F + (1.0 / F))) / 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 <= 0.98d0) then
tmp = (f * (sqrt(0.5d0) / sin(b))) - t_0
else
tmp = ((f / (f + (1.0d0 / f))) / 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 <= 0.98) {
tmp = (F * (Math.sqrt(0.5) / Math.sin(B))) - t_0;
} else {
tmp = ((F / (F + (1.0 / F))) / 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 <= 0.98: tmp = (F * (math.sqrt(0.5) / math.sin(B))) - t_0 else: tmp = ((F / (F + (1.0 / F))) / 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 <= 0.98) tmp = Float64(Float64(F * Float64(sqrt(0.5) / sin(B))) - t_0); else tmp = Float64(Float64(Float64(F / Float64(F + Float64(1.0 / F))) / 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 <= 0.98) tmp = (F * (sqrt(0.5) / sin(B))) - t_0; else tmp = ((F / (F + (1.0 / F))) / 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, 0.98], N[(N[(F * N[(N[Sqrt[0.5], $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], N[(N[(N[(F / N[(F + N[(1.0 / F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 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 0.98:\\
\;\;\;\;F \cdot \frac{\sqrt{0.5}}{\sin B} - t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{F}{F + \frac{1}{F}}}{\sin B} - t\_0\\
\end{array}
\end{array}
if F < -1.3999999999999999Initial program 68.7%
Simplified76.5%
Taylor expanded in x around 0 76.6%
associate-*l/76.5%
*-lft-identity76.5%
+-commutative76.5%
unpow276.5%
fma-udef76.5%
Simplified76.5%
Taylor expanded in F around -inf 99.7%
if -1.3999999999999999 < F < 0.97999999999999998Initial program 99.5%
Simplified99.7%
Taylor expanded in x around 0 99.7%
associate-*l/99.7%
*-lft-identity99.7%
+-commutative99.7%
unpow299.7%
fma-udef99.7%
Simplified99.7%
Taylor expanded in F around 0 99.7%
if 0.97999999999999998 < F Initial program 54.7%
Simplified75.2%
Taylor expanded in x around 0 75.1%
associate-*l/75.2%
*-lft-identity75.2%
+-commutative75.2%
unpow275.2%
fma-udef75.2%
Simplified75.2%
associate-*r/75.2%
sqrt-div75.3%
metadata-eval75.3%
un-div-inv75.3%
Applied egg-rr75.3%
Taylor expanded in F around inf 99.8%
Final simplification99.7%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (+ 2.0 (* x 2.0))) (t_1 (/ x (tan B))))
(if (<= F -6.8e-13)
(- (/ -1.0 (sin B)) t_1)
(if (<= F -4.8e-91)
(- (/ F (* (sin B) (sqrt t_0))) (/ x B))
(if (or (<= F 5.1e-206) (not (<= F 2.35e-117)))
(- (/ (/ F (+ F (/ 1.0 F))) (sin B)) t_1)
(- (* (/ F (sin B)) (sqrt (/ 1.0 t_0))) (/ x B)))))))
double code(double F, double B, double x) {
double t_0 = 2.0 + (x * 2.0);
double t_1 = x / tan(B);
double tmp;
if (F <= -6.8e-13) {
tmp = (-1.0 / sin(B)) - t_1;
} else if (F <= -4.8e-91) {
tmp = (F / (sin(B) * sqrt(t_0))) - (x / B);
} else if ((F <= 5.1e-206) || !(F <= 2.35e-117)) {
tmp = ((F / (F + (1.0 / F))) / sin(B)) - t_1;
} else {
tmp = ((F / sin(B)) * sqrt((1.0 / t_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) :: t_1
real(8) :: tmp
t_0 = 2.0d0 + (x * 2.0d0)
t_1 = x / tan(b)
if (f <= (-6.8d-13)) then
tmp = ((-1.0d0) / sin(b)) - t_1
else if (f <= (-4.8d-91)) then
tmp = (f / (sin(b) * sqrt(t_0))) - (x / b)
else if ((f <= 5.1d-206) .or. (.not. (f <= 2.35d-117))) then
tmp = ((f / (f + (1.0d0 / f))) / sin(b)) - t_1
else
tmp = ((f / sin(b)) * sqrt((1.0d0 / t_0))) - (x / b)
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = 2.0 + (x * 2.0);
double t_1 = x / Math.tan(B);
double tmp;
if (F <= -6.8e-13) {
tmp = (-1.0 / Math.sin(B)) - t_1;
} else if (F <= -4.8e-91) {
tmp = (F / (Math.sin(B) * Math.sqrt(t_0))) - (x / B);
} else if ((F <= 5.1e-206) || !(F <= 2.35e-117)) {
tmp = ((F / (F + (1.0 / F))) / Math.sin(B)) - t_1;
} else {
tmp = ((F / Math.sin(B)) * Math.sqrt((1.0 / t_0))) - (x / B);
}
return tmp;
}
def code(F, B, x): t_0 = 2.0 + (x * 2.0) t_1 = x / math.tan(B) tmp = 0 if F <= -6.8e-13: tmp = (-1.0 / math.sin(B)) - t_1 elif F <= -4.8e-91: tmp = (F / (math.sin(B) * math.sqrt(t_0))) - (x / B) elif (F <= 5.1e-206) or not (F <= 2.35e-117): tmp = ((F / (F + (1.0 / F))) / math.sin(B)) - t_1 else: tmp = ((F / math.sin(B)) * math.sqrt((1.0 / t_0))) - (x / B) return tmp
function code(F, B, x) t_0 = Float64(2.0 + Float64(x * 2.0)) t_1 = Float64(x / tan(B)) tmp = 0.0 if (F <= -6.8e-13) tmp = Float64(Float64(-1.0 / sin(B)) - t_1); elseif (F <= -4.8e-91) tmp = Float64(Float64(F / Float64(sin(B) * sqrt(t_0))) - Float64(x / B)); elseif ((F <= 5.1e-206) || !(F <= 2.35e-117)) tmp = Float64(Float64(Float64(F / Float64(F + Float64(1.0 / F))) / sin(B)) - t_1); else tmp = Float64(Float64(Float64(F / sin(B)) * sqrt(Float64(1.0 / t_0))) - Float64(x / B)); end return tmp end
function tmp_2 = code(F, B, x) t_0 = 2.0 + (x * 2.0); t_1 = x / tan(B); tmp = 0.0; if (F <= -6.8e-13) tmp = (-1.0 / sin(B)) - t_1; elseif (F <= -4.8e-91) tmp = (F / (sin(B) * sqrt(t_0))) - (x / B); elseif ((F <= 5.1e-206) || ~((F <= 2.35e-117))) tmp = ((F / (F + (1.0 / F))) / sin(B)) - t_1; else tmp = ((F / sin(B)) * sqrt((1.0 / t_0))) - (x / B); end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(2.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -6.8e-13], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[F, -4.8e-91], N[(N[(F / N[(N[Sin[B], $MachinePrecision] * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[F, 5.1e-206], N[Not[LessEqual[F, 2.35e-117]], $MachinePrecision]], N[(N[(N[(F / N[(F + N[(1.0 / F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], N[(N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(1.0 / t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 2 + x \cdot 2\\
t_1 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -6.8 \cdot 10^{-13}:\\
\;\;\;\;\frac{-1}{\sin B} - t\_1\\
\mathbf{elif}\;F \leq -4.8 \cdot 10^{-91}:\\
\;\;\;\;\frac{F}{\sin B \cdot \sqrt{t\_0}} - \frac{x}{B}\\
\mathbf{elif}\;F \leq 5.1 \cdot 10^{-206} \lor \neg \left(F \leq 2.35 \cdot 10^{-117}\right):\\
\;\;\;\;\frac{\frac{F}{F + \frac{1}{F}}}{\sin B} - t\_1\\
\mathbf{else}:\\
\;\;\;\;\frac{F}{\sin B} \cdot \sqrt{\frac{1}{t\_0}} - \frac{x}{B}\\
\end{array}
\end{array}
if F < -6.80000000000000031e-13Initial program 69.9%
Simplified77.5%
Taylor expanded in x around 0 77.5%
associate-*l/77.5%
*-lft-identity77.5%
+-commutative77.5%
unpow277.5%
fma-udef77.5%
Simplified77.5%
Taylor expanded in F around -inf 99.7%
if -6.80000000000000031e-13 < F < -4.80000000000000022e-91Initial program 99.5%
associate-*l/99.5%
+-commutative99.5%
*-commutative99.5%
fma-udef99.5%
fma-def99.5%
metadata-eval99.5%
metadata-eval99.5%
associate-/l*99.5%
fma-def99.5%
fma-udef99.5%
*-commutative99.5%
fma-def99.5%
fma-def99.5%
Applied egg-rr99.5%
Taylor expanded in F around 0 99.6%
Taylor expanded in B around 0 81.9%
if -4.80000000000000022e-91 < F < 5.10000000000000005e-206 or 2.35000000000000004e-117 < F Initial program 78.6%
Simplified88.3%
Taylor expanded in x around 0 88.3%
associate-*l/88.3%
*-lft-identity88.3%
+-commutative88.3%
unpow288.3%
fma-udef88.3%
Simplified88.3%
associate-*r/88.3%
sqrt-div88.3%
metadata-eval88.3%
un-div-inv88.3%
Applied egg-rr88.3%
Taylor expanded in F around inf 92.0%
if 5.10000000000000005e-206 < F < 2.35000000000000004e-117Initial program 99.4%
Taylor expanded in F around 0 99.4%
Taylor expanded in B around 0 75.5%
Final simplification92.5%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -6.5e-13)
(- (/ -1.0 (sin B)) t_0)
(if (or (<= F -7.2e-90) (and (not (<= F 5.1e-206)) (<= F 4.5e-113)))
(- (/ F (* (sin B) (sqrt (+ 2.0 (* x 2.0))))) (/ x B))
(- (/ (/ F (+ F (/ 1.0 F))) (sin B)) t_0)))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -6.5e-13) {
tmp = (-1.0 / sin(B)) - t_0;
} else if ((F <= -7.2e-90) || (!(F <= 5.1e-206) && (F <= 4.5e-113))) {
tmp = (F / (sin(B) * sqrt((2.0 + (x * 2.0))))) - (x / B);
} else {
tmp = ((F / (F + (1.0 / F))) / 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 <= (-6.5d-13)) then
tmp = ((-1.0d0) / sin(b)) - t_0
else if ((f <= (-7.2d-90)) .or. (.not. (f <= 5.1d-206)) .and. (f <= 4.5d-113)) then
tmp = (f / (sin(b) * sqrt((2.0d0 + (x * 2.0d0))))) - (x / b)
else
tmp = ((f / (f + (1.0d0 / f))) / 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 <= -6.5e-13) {
tmp = (-1.0 / Math.sin(B)) - t_0;
} else if ((F <= -7.2e-90) || (!(F <= 5.1e-206) && (F <= 4.5e-113))) {
tmp = (F / (Math.sin(B) * Math.sqrt((2.0 + (x * 2.0))))) - (x / B);
} else {
tmp = ((F / (F + (1.0 / F))) / Math.sin(B)) - t_0;
}
return tmp;
}
def code(F, B, x): t_0 = x / math.tan(B) tmp = 0 if F <= -6.5e-13: tmp = (-1.0 / math.sin(B)) - t_0 elif (F <= -7.2e-90) or (not (F <= 5.1e-206) and (F <= 4.5e-113)): tmp = (F / (math.sin(B) * math.sqrt((2.0 + (x * 2.0))))) - (x / B) else: tmp = ((F / (F + (1.0 / F))) / math.sin(B)) - t_0 return tmp
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -6.5e-13) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif ((F <= -7.2e-90) || (!(F <= 5.1e-206) && (F <= 4.5e-113))) tmp = Float64(Float64(F / Float64(sin(B) * sqrt(Float64(2.0 + Float64(x * 2.0))))) - Float64(x / B)); else tmp = Float64(Float64(Float64(F / Float64(F + Float64(1.0 / F))) / 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 <= -6.5e-13) tmp = (-1.0 / sin(B)) - t_0; elseif ((F <= -7.2e-90) || (~((F <= 5.1e-206)) && (F <= 4.5e-113))) tmp = (F / (sin(B) * sqrt((2.0 + (x * 2.0))))) - (x / B); else tmp = ((F / (F + (1.0 / F))) / 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, -6.5e-13], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[Or[LessEqual[F, -7.2e-90], And[N[Not[LessEqual[F, 5.1e-206]], $MachinePrecision], LessEqual[F, 4.5e-113]]], N[(N[(F / N[(N[Sin[B], $MachinePrecision] * N[Sqrt[N[(2.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], N[(N[(N[(F / N[(F + N[(1.0 / F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 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 -6.5 \cdot 10^{-13}:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq -7.2 \cdot 10^{-90} \lor \neg \left(F \leq 5.1 \cdot 10^{-206}\right) \land F \leq 4.5 \cdot 10^{-113}:\\
\;\;\;\;\frac{F}{\sin B \cdot \sqrt{2 + x \cdot 2}} - \frac{x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{F}{F + \frac{1}{F}}}{\sin B} - t\_0\\
\end{array}
\end{array}
if F < -6.49999999999999957e-13Initial program 69.9%
Simplified77.5%
Taylor expanded in x around 0 77.5%
associate-*l/77.5%
*-lft-identity77.5%
+-commutative77.5%
unpow277.5%
fma-udef77.5%
Simplified77.5%
Taylor expanded in F around -inf 99.7%
if -6.49999999999999957e-13 < F < -7.19999999999999961e-90 or 5.10000000000000005e-206 < F < 4.5000000000000001e-113Initial program 99.4%
associate-*l/99.5%
+-commutative99.5%
*-commutative99.5%
fma-udef99.5%
fma-def99.5%
metadata-eval99.5%
metadata-eval99.5%
associate-/l*99.4%
fma-def99.4%
fma-udef99.4%
*-commutative99.4%
fma-def99.4%
fma-def99.4%
Applied egg-rr99.4%
Taylor expanded in F around 0 99.1%
Taylor expanded in B around 0 77.6%
if -7.19999999999999961e-90 < F < 5.10000000000000005e-206 or 4.5000000000000001e-113 < F Initial program 78.6%
Simplified88.3%
Taylor expanded in x around 0 88.3%
associate-*l/88.3%
*-lft-identity88.3%
+-commutative88.3%
unpow288.3%
fma-udef88.3%
Simplified88.3%
associate-*r/88.3%
sqrt-div88.3%
metadata-eval88.3%
un-div-inv88.3%
Applied egg-rr88.3%
Taylor expanded in F around inf 92.0%
Final simplification92.5%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -1.9e-41)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 5.1e-206)
(- (/ x (/ (sin B) (cos B))))
(if (<= F 9.5e-118)
(* (/ F (sin B)) (sqrt (/ 1.0 (+ 2.0 (* x 2.0)))))
(- (/ (/ F (+ F (/ 1.0 F))) (sin B)) t_0))))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -1.9e-41) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 5.1e-206) {
tmp = -(x / (sin(B) / cos(B)));
} else if (F <= 9.5e-118) {
tmp = (F / sin(B)) * sqrt((1.0 / (2.0 + (x * 2.0))));
} else {
tmp = ((F / (F + (1.0 / F))) / 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.9d-41)) then
tmp = ((-1.0d0) / sin(b)) - t_0
else if (f <= 5.1d-206) then
tmp = -(x / (sin(b) / cos(b)))
else if (f <= 9.5d-118) then
tmp = (f / sin(b)) * sqrt((1.0d0 / (2.0d0 + (x * 2.0d0))))
else
tmp = ((f / (f + (1.0d0 / f))) / 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.9e-41) {
tmp = (-1.0 / Math.sin(B)) - t_0;
} else if (F <= 5.1e-206) {
tmp = -(x / (Math.sin(B) / Math.cos(B)));
} else if (F <= 9.5e-118) {
tmp = (F / Math.sin(B)) * Math.sqrt((1.0 / (2.0 + (x * 2.0))));
} else {
tmp = ((F / (F + (1.0 / F))) / Math.sin(B)) - t_0;
}
return tmp;
}
def code(F, B, x): t_0 = x / math.tan(B) tmp = 0 if F <= -1.9e-41: tmp = (-1.0 / math.sin(B)) - t_0 elif F <= 5.1e-206: tmp = -(x / (math.sin(B) / math.cos(B))) elif F <= 9.5e-118: tmp = (F / math.sin(B)) * math.sqrt((1.0 / (2.0 + (x * 2.0)))) else: tmp = ((F / (F + (1.0 / F))) / math.sin(B)) - t_0 return tmp
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -1.9e-41) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 5.1e-206) tmp = Float64(-Float64(x / Float64(sin(B) / cos(B)))); elseif (F <= 9.5e-118) tmp = Float64(Float64(F / sin(B)) * sqrt(Float64(1.0 / Float64(2.0 + Float64(x * 2.0))))); else tmp = Float64(Float64(Float64(F / Float64(F + Float64(1.0 / F))) / 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.9e-41) tmp = (-1.0 / sin(B)) - t_0; elseif (F <= 5.1e-206) tmp = -(x / (sin(B) / cos(B))); elseif (F <= 9.5e-118) tmp = (F / sin(B)) * sqrt((1.0 / (2.0 + (x * 2.0)))); else tmp = ((F / (F + (1.0 / F))) / 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.9e-41], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 5.1e-206], (-N[(x / N[(N[Sin[B], $MachinePrecision] / N[Cos[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), If[LessEqual[F, 9.5e-118], 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[(N[(N[(F / N[(F + N[(1.0 / F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 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.9 \cdot 10^{-41}:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq 5.1 \cdot 10^{-206}:\\
\;\;\;\;-\frac{x}{\frac{\sin B}{\cos B}}\\
\mathbf{elif}\;F \leq 9.5 \cdot 10^{-118}:\\
\;\;\;\;\frac{F}{\sin B} \cdot \sqrt{\frac{1}{2 + x \cdot 2}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{F}{F + \frac{1}{F}}}{\sin B} - t\_0\\
\end{array}
\end{array}
if F < -1.8999999999999999e-41Initial program 71.4%
Simplified78.6%
Taylor expanded in x around 0 78.6%
associate-*l/78.5%
*-lft-identity78.5%
+-commutative78.5%
unpow278.5%
fma-udef78.5%
Simplified78.5%
Taylor expanded in F around -inf 96.3%
if -1.8999999999999999e-41 < F < 5.10000000000000005e-206Initial program 99.4%
Taylor expanded in F around -inf 36.3%
Taylor expanded in x around inf 84.3%
mul-1-neg84.3%
associate-/l*84.4%
Simplified84.4%
if 5.10000000000000005e-206 < F < 9.49999999999999931e-118Initial program 99.4%
Taylor expanded in F around 0 99.4%
Taylor expanded in F around inf 66.0%
if 9.49999999999999931e-118 < F Initial program 63.6%
Simplified80.1%
Taylor expanded in x around 0 80.0%
associate-*l/80.1%
*-lft-identity80.1%
+-commutative80.1%
unpow280.1%
fma-udef80.1%
Simplified80.1%
associate-*r/80.1%
sqrt-div80.1%
metadata-eval80.1%
un-div-inv80.1%
Applied egg-rr80.1%
Taylor expanded in F around inf 93.3%
Final simplification89.7%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (- (/ x (/ (sin B) (cos B))))) (t_1 (/ x (tan B))))
(if (<= F -1.2e-46)
(- (/ -1.0 (sin B)) t_1)
(if (<= F 5.1e-206)
t_0
(if (<= F 5.8e-116)
(* (/ F (sin B)) (sqrt (/ 1.0 (+ 2.0 (* x 2.0)))))
(if (<= F 1.25e-46) t_0 (- (/ 1.0 (sin B)) t_1)))))))
double code(double F, double B, double x) {
double t_0 = -(x / (sin(B) / cos(B)));
double t_1 = x / tan(B);
double tmp;
if (F <= -1.2e-46) {
tmp = (-1.0 / sin(B)) - t_1;
} else if (F <= 5.1e-206) {
tmp = t_0;
} else if (F <= 5.8e-116) {
tmp = (F / sin(B)) * sqrt((1.0 / (2.0 + (x * 2.0))));
} else if (F <= 1.25e-46) {
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 = -(x / (sin(b) / cos(b)))
t_1 = x / tan(b)
if (f <= (-1.2d-46)) then
tmp = ((-1.0d0) / sin(b)) - t_1
else if (f <= 5.1d-206) then
tmp = t_0
else if (f <= 5.8d-116) then
tmp = (f / sin(b)) * sqrt((1.0d0 / (2.0d0 + (x * 2.0d0))))
else if (f <= 1.25d-46) 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 = -(x / (Math.sin(B) / Math.cos(B)));
double t_1 = x / Math.tan(B);
double tmp;
if (F <= -1.2e-46) {
tmp = (-1.0 / Math.sin(B)) - t_1;
} else if (F <= 5.1e-206) {
tmp = t_0;
} else if (F <= 5.8e-116) {
tmp = (F / Math.sin(B)) * Math.sqrt((1.0 / (2.0 + (x * 2.0))));
} else if (F <= 1.25e-46) {
tmp = t_0;
} else {
tmp = (1.0 / Math.sin(B)) - t_1;
}
return tmp;
}
def code(F, B, x): t_0 = -(x / (math.sin(B) / math.cos(B))) t_1 = x / math.tan(B) tmp = 0 if F <= -1.2e-46: tmp = (-1.0 / math.sin(B)) - t_1 elif F <= 5.1e-206: tmp = t_0 elif F <= 5.8e-116: tmp = (F / math.sin(B)) * math.sqrt((1.0 / (2.0 + (x * 2.0)))) elif F <= 1.25e-46: tmp = t_0 else: tmp = (1.0 / math.sin(B)) - t_1 return tmp
function code(F, B, x) t_0 = Float64(-Float64(x / Float64(sin(B) / cos(B)))) t_1 = Float64(x / tan(B)) tmp = 0.0 if (F <= -1.2e-46) tmp = Float64(Float64(-1.0 / sin(B)) - t_1); elseif (F <= 5.1e-206) tmp = t_0; elseif (F <= 5.8e-116) tmp = Float64(Float64(F / sin(B)) * sqrt(Float64(1.0 / Float64(2.0 + Float64(x * 2.0))))); elseif (F <= 1.25e-46) 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 = -(x / (sin(B) / cos(B))); t_1 = x / tan(B); tmp = 0.0; if (F <= -1.2e-46) tmp = (-1.0 / sin(B)) - t_1; elseif (F <= 5.1e-206) tmp = t_0; elseif (F <= 5.8e-116) tmp = (F / sin(B)) * sqrt((1.0 / (2.0 + (x * 2.0)))); elseif (F <= 1.25e-46) 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[(x / N[(N[Sin[B], $MachinePrecision] / N[Cos[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision])}, Block[{t$95$1 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -1.2e-46], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[F, 5.1e-206], t$95$0, If[LessEqual[F, 5.8e-116], 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], If[LessEqual[F, 1.25e-46], 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{x}{\frac{\sin B}{\cos B}}\\
t_1 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -1.2 \cdot 10^{-46}:\\
\;\;\;\;\frac{-1}{\sin B} - t\_1\\
\mathbf{elif}\;F \leq 5.1 \cdot 10^{-206}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;F \leq 5.8 \cdot 10^{-116}:\\
\;\;\;\;\frac{F}{\sin B} \cdot \sqrt{\frac{1}{2 + x \cdot 2}}\\
\mathbf{elif}\;F \leq 1.25 \cdot 10^{-46}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_1\\
\end{array}
\end{array}
if F < -1.20000000000000007e-46Initial program 71.4%
Simplified78.6%
Taylor expanded in x around 0 78.6%
associate-*l/78.5%
*-lft-identity78.5%
+-commutative78.5%
unpow278.5%
fma-udef78.5%
Simplified78.5%
Taylor expanded in F around -inf 96.3%
if -1.20000000000000007e-46 < F < 5.10000000000000005e-206 or 5.7999999999999996e-116 < F < 1.24999999999999998e-46Initial program 99.5%
Taylor expanded in F around -inf 39.3%
Taylor expanded in x around inf 83.0%
mul-1-neg83.0%
associate-/l*83.1%
Simplified83.1%
if 5.10000000000000005e-206 < F < 5.7999999999999996e-116Initial program 99.4%
Taylor expanded in F around 0 99.4%
Taylor expanded in F around inf 66.0%
if 1.24999999999999998e-46 < F Initial program 57.8%
Simplified76.9%
Taylor expanded in x around 0 76.7%
associate-*l/76.9%
*-lft-identity76.9%
+-commutative76.9%
unpow276.9%
fma-udef76.9%
Simplified76.9%
Taylor expanded in F around inf 95.0%
Final simplification89.3%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -1.75e-41)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 7.2e-59)
(- (/ x (/ (sin B) (cos 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.75e-41) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 7.2e-59) {
tmp = -(x / (sin(B) / cos(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.75d-41)) then
tmp = ((-1.0d0) / sin(b)) - t_0
else if (f <= 7.2d-59) then
tmp = -(x / (sin(b) / cos(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.75e-41) {
tmp = (-1.0 / Math.sin(B)) - t_0;
} else if (F <= 7.2e-59) {
tmp = -(x / (Math.sin(B) / Math.cos(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.75e-41: tmp = (-1.0 / math.sin(B)) - t_0 elif F <= 7.2e-59: tmp = -(x / (math.sin(B) / math.cos(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.75e-41) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 7.2e-59) tmp = Float64(-Float64(x / Float64(sin(B) / cos(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.75e-41) tmp = (-1.0 / sin(B)) - t_0; elseif (F <= 7.2e-59) tmp = -(x / (sin(B) / cos(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.75e-41], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 7.2e-59], (-N[(x / N[(N[Sin[B], $MachinePrecision] / N[Cos[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.75 \cdot 10^{-41}:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq 7.2 \cdot 10^{-59}:\\
\;\;\;\;-\frac{x}{\frac{\sin B}{\cos B}}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_0\\
\end{array}
\end{array}
if F < -1.75e-41Initial program 71.4%
Simplified78.6%
Taylor expanded in x around 0 78.6%
associate-*l/78.5%
*-lft-identity78.5%
+-commutative78.5%
unpow278.5%
fma-udef78.5%
Simplified78.5%
Taylor expanded in F around -inf 96.3%
if -1.75e-41 < F < 7.20000000000000001e-59Initial program 99.4%
Taylor expanded in F around -inf 33.3%
Taylor expanded in x around inf 74.0%
mul-1-neg74.0%
associate-/l*74.0%
Simplified74.0%
if 7.20000000000000001e-59 < F Initial program 57.8%
Simplified76.9%
Taylor expanded in x around 0 76.7%
associate-*l/76.9%
*-lft-identity76.9%
+-commutative76.9%
unpow276.9%
fma-udef76.9%
Simplified76.9%
Taylor expanded in F around inf 95.0%
Final simplification87.0%
(FPCore (F B x)
:precision binary64
(if (<= F -72000.0)
(- (/ -1.0 (sin B)) (/ x B))
(if (<= F 2.8e-78)
(- (/ x (/ (sin B) (cos B))))
(- (/ 1.0 B) (/ x (tan B))))))
double code(double F, double B, double x) {
double tmp;
if (F <= -72000.0) {
tmp = (-1.0 / sin(B)) - (x / B);
} else if (F <= 2.8e-78) {
tmp = -(x / (sin(B) / cos(B)));
} else {
tmp = (1.0 / B) - (x / tan(B));
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if (f <= (-72000.0d0)) then
tmp = ((-1.0d0) / sin(b)) - (x / b)
else if (f <= 2.8d-78) then
tmp = -(x / (sin(b) / cos(b)))
else
tmp = (1.0d0 / b) - (x / tan(b))
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -72000.0) {
tmp = (-1.0 / Math.sin(B)) - (x / B);
} else if (F <= 2.8e-78) {
tmp = -(x / (Math.sin(B) / Math.cos(B)));
} else {
tmp = (1.0 / B) - (x / Math.tan(B));
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -72000.0: tmp = (-1.0 / math.sin(B)) - (x / B) elif F <= 2.8e-78: tmp = -(x / (math.sin(B) / math.cos(B))) else: tmp = (1.0 / B) - (x / math.tan(B)) return tmp
function code(F, B, x) tmp = 0.0 if (F <= -72000.0) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B)); elseif (F <= 2.8e-78) tmp = Float64(-Float64(x / Float64(sin(B) / cos(B)))); else tmp = Float64(Float64(1.0 / B) - Float64(x / tan(B))); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -72000.0) tmp = (-1.0 / sin(B)) - (x / B); elseif (F <= 2.8e-78) tmp = -(x / (sin(B) / cos(B))); else tmp = (1.0 / B) - (x / tan(B)); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -72000.0], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 2.8e-78], (-N[(x / N[(N[Sin[B], $MachinePrecision] / N[Cos[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), N[(N[(1.0 / B), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -72000:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\
\mathbf{elif}\;F \leq 2.8 \cdot 10^{-78}:\\
\;\;\;\;-\frac{x}{\frac{\sin B}{\cos B}}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{B} - \frac{x}{\tan B}\\
\end{array}
\end{array}
if F < -72000Initial program 68.7%
Taylor expanded in F around -inf 99.4%
Taylor expanded in B around 0 71.8%
if -72000 < F < 2.80000000000000024e-78Initial program 99.5%
Taylor expanded in F around -inf 34.4%
Taylor expanded in x around inf 73.2%
mul-1-neg73.2%
associate-/l*73.3%
Simplified73.3%
if 2.80000000000000024e-78 < F Initial program 59.4%
Simplified77.8%
Taylor expanded in F around inf 93.6%
associate-/r*93.6%
Simplified93.6%
Taylor expanded in B around 0 67.1%
Final simplification71.0%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -4.2e-44)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 2.8e-78) (- (/ x (/ (sin B) (cos B)))) (- (/ 1.0 B) t_0)))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -4.2e-44) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 2.8e-78) {
tmp = -(x / (sin(B) / cos(B)));
} else {
tmp = (1.0 / B) - t_0;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: tmp
t_0 = x / tan(b)
if (f <= (-4.2d-44)) then
tmp = ((-1.0d0) / sin(b)) - t_0
else if (f <= 2.8d-78) then
tmp = -(x / (sin(b) / cos(b)))
else
tmp = (1.0d0 / b) - t_0
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = x / Math.tan(B);
double tmp;
if (F <= -4.2e-44) {
tmp = (-1.0 / Math.sin(B)) - t_0;
} else if (F <= 2.8e-78) {
tmp = -(x / (Math.sin(B) / Math.cos(B)));
} else {
tmp = (1.0 / B) - t_0;
}
return tmp;
}
def code(F, B, x): t_0 = x / math.tan(B) tmp = 0 if F <= -4.2e-44: tmp = (-1.0 / math.sin(B)) - t_0 elif F <= 2.8e-78: tmp = -(x / (math.sin(B) / math.cos(B))) else: tmp = (1.0 / B) - t_0 return tmp
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -4.2e-44) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 2.8e-78) tmp = Float64(-Float64(x / Float64(sin(B) / cos(B)))); else tmp = Float64(Float64(1.0 / B) - t_0); end return tmp end
function tmp_2 = code(F, B, x) t_0 = x / tan(B); tmp = 0.0; if (F <= -4.2e-44) tmp = (-1.0 / sin(B)) - t_0; elseif (F <= 2.8e-78) tmp = -(x / (sin(B) / cos(B))); else tmp = (1.0 / B) - t_0; end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -4.2e-44], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 2.8e-78], (-N[(x / N[(N[Sin[B], $MachinePrecision] / N[Cos[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), N[(N[(1.0 / B), $MachinePrecision] - t$95$0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -4.2 \cdot 10^{-44}:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq 2.8 \cdot 10^{-78}:\\
\;\;\;\;-\frac{x}{\frac{\sin B}{\cos B}}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{B} - t\_0\\
\end{array}
\end{array}
if F < -4.20000000000000003e-44Initial program 71.4%
Simplified78.6%
Taylor expanded in x around 0 78.6%
associate-*l/78.5%
*-lft-identity78.5%
+-commutative78.5%
unpow278.5%
fma-udef78.5%
Simplified78.5%
Taylor expanded in F around -inf 96.3%
if -4.20000000000000003e-44 < F < 2.80000000000000024e-78Initial program 99.4%
Taylor expanded in F around -inf 32.5%
Taylor expanded in x around inf 74.2%
mul-1-neg74.2%
associate-/l*74.3%
Simplified74.3%
if 2.80000000000000024e-78 < F Initial program 59.4%
Simplified77.8%
Taylor expanded in F around inf 93.6%
associate-/r*93.6%
Simplified93.6%
Taylor expanded in B around 0 67.1%
Final simplification79.0%
(FPCore (F B x)
:precision binary64
(if (<= F -0.12)
(- (/ -1.0 (sin B)) (/ x B))
(if (or (<= F -1.85e-293) (and (not (<= F 2.55e-244)) (<= F 3.4e-116)))
(/ (- (* F (sqrt (/ 1.0 (+ 2.0 (* x 2.0))))) x) B)
(- (/ 1.0 B) (/ x (tan B))))))
double code(double F, double B, double x) {
double tmp;
if (F <= -0.12) {
tmp = (-1.0 / sin(B)) - (x / B);
} else if ((F <= -1.85e-293) || (!(F <= 2.55e-244) && (F <= 3.4e-116))) {
tmp = ((F * sqrt((1.0 / (2.0 + (x * 2.0))))) - x) / B;
} else {
tmp = (1.0 / B) - (x / tan(B));
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if (f <= (-0.12d0)) then
tmp = ((-1.0d0) / sin(b)) - (x / b)
else if ((f <= (-1.85d-293)) .or. (.not. (f <= 2.55d-244)) .and. (f <= 3.4d-116)) then
tmp = ((f * sqrt((1.0d0 / (2.0d0 + (x * 2.0d0))))) - x) / b
else
tmp = (1.0d0 / b) - (x / tan(b))
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -0.12) {
tmp = (-1.0 / Math.sin(B)) - (x / B);
} else if ((F <= -1.85e-293) || (!(F <= 2.55e-244) && (F <= 3.4e-116))) {
tmp = ((F * Math.sqrt((1.0 / (2.0 + (x * 2.0))))) - x) / B;
} else {
tmp = (1.0 / B) - (x / Math.tan(B));
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -0.12: tmp = (-1.0 / math.sin(B)) - (x / B) elif (F <= -1.85e-293) or (not (F <= 2.55e-244) and (F <= 3.4e-116)): tmp = ((F * math.sqrt((1.0 / (2.0 + (x * 2.0))))) - x) / B else: tmp = (1.0 / B) - (x / math.tan(B)) return tmp
function code(F, B, x) tmp = 0.0 if (F <= -0.12) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B)); elseif ((F <= -1.85e-293) || (!(F <= 2.55e-244) && (F <= 3.4e-116))) tmp = Float64(Float64(Float64(F * sqrt(Float64(1.0 / Float64(2.0 + Float64(x * 2.0))))) - x) / B); else tmp = Float64(Float64(1.0 / B) - Float64(x / tan(B))); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -0.12) tmp = (-1.0 / sin(B)) - (x / B); elseif ((F <= -1.85e-293) || (~((F <= 2.55e-244)) && (F <= 3.4e-116))) tmp = ((F * sqrt((1.0 / (2.0 + (x * 2.0))))) - x) / B; else tmp = (1.0 / B) - (x / tan(B)); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -0.12], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[F, -1.85e-293], And[N[Not[LessEqual[F, 2.55e-244]], $MachinePrecision], LessEqual[F, 3.4e-116]]], N[(N[(N[(F * N[Sqrt[N[(1.0 / N[(2.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(N[(1.0 / B), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -0.12:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\
\mathbf{elif}\;F \leq -1.85 \cdot 10^{-293} \lor \neg \left(F \leq 2.55 \cdot 10^{-244}\right) \land F \leq 3.4 \cdot 10^{-116}:\\
\;\;\;\;\frac{F \cdot \sqrt{\frac{1}{2 + x \cdot 2}} - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{B} - \frac{x}{\tan B}\\
\end{array}
\end{array}
if F < -0.12Initial program 68.7%
Taylor expanded in F around -inf 99.4%
Taylor expanded in B around 0 71.8%
if -0.12 < F < -1.85000000000000004e-293 or 2.5499999999999999e-244 < F < 3.39999999999999992e-116Initial program 99.4%
Taylor expanded in F around 0 99.4%
Taylor expanded in B around 0 46.4%
if -1.85000000000000004e-293 < F < 2.5499999999999999e-244 or 3.39999999999999992e-116 < F Initial program 68.6%
Simplified82.9%
Taylor expanded in F around inf 82.9%
associate-/r*82.9%
Simplified82.9%
Taylor expanded in B around 0 67.3%
Final simplification61.8%
(FPCore (F B x)
:precision binary64
(if (<= F -11500.0)
(- (/ -1.0 (sin B)) (/ x B))
(if (<= F 1.22e-238)
(+ (* x (/ -1.0 (tan B))) (* (/ -1.0 F) (/ F B)))
(if (<= F 3.85e-113)
(/ (- (* F (sqrt (/ 1.0 (+ 2.0 (* x 2.0))))) x) B)
(- (/ 1.0 B) (/ x (tan B)))))))
double code(double F, double B, double x) {
double tmp;
if (F <= -11500.0) {
tmp = (-1.0 / sin(B)) - (x / B);
} else if (F <= 1.22e-238) {
tmp = (x * (-1.0 / tan(B))) + ((-1.0 / F) * (F / B));
} else if (F <= 3.85e-113) {
tmp = ((F * sqrt((1.0 / (2.0 + (x * 2.0))))) - x) / B;
} else {
tmp = (1.0 / B) - (x / tan(B));
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if (f <= (-11500.0d0)) then
tmp = ((-1.0d0) / sin(b)) - (x / b)
else if (f <= 1.22d-238) then
tmp = (x * ((-1.0d0) / tan(b))) + (((-1.0d0) / f) * (f / b))
else if (f <= 3.85d-113) then
tmp = ((f * sqrt((1.0d0 / (2.0d0 + (x * 2.0d0))))) - x) / b
else
tmp = (1.0d0 / b) - (x / tan(b))
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -11500.0) {
tmp = (-1.0 / Math.sin(B)) - (x / B);
} else if (F <= 1.22e-238) {
tmp = (x * (-1.0 / Math.tan(B))) + ((-1.0 / F) * (F / B));
} else if (F <= 3.85e-113) {
tmp = ((F * Math.sqrt((1.0 / (2.0 + (x * 2.0))))) - x) / B;
} else {
tmp = (1.0 / B) - (x / Math.tan(B));
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -11500.0: tmp = (-1.0 / math.sin(B)) - (x / B) elif F <= 1.22e-238: tmp = (x * (-1.0 / math.tan(B))) + ((-1.0 / F) * (F / B)) elif F <= 3.85e-113: tmp = ((F * math.sqrt((1.0 / (2.0 + (x * 2.0))))) - x) / B else: tmp = (1.0 / B) - (x / math.tan(B)) return tmp
function code(F, B, x) tmp = 0.0 if (F <= -11500.0) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B)); elseif (F <= 1.22e-238) tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(Float64(-1.0 / F) * Float64(F / B))); elseif (F <= 3.85e-113) tmp = Float64(Float64(Float64(F * sqrt(Float64(1.0 / Float64(2.0 + Float64(x * 2.0))))) - x) / B); else tmp = Float64(Float64(1.0 / B) - Float64(x / tan(B))); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -11500.0) tmp = (-1.0 / sin(B)) - (x / B); elseif (F <= 1.22e-238) tmp = (x * (-1.0 / tan(B))) + ((-1.0 / F) * (F / B)); elseif (F <= 3.85e-113) tmp = ((F * sqrt((1.0 / (2.0 + (x * 2.0))))) - x) / B; else tmp = (1.0 / B) - (x / tan(B)); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -11500.0], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.22e-238], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(-1.0 / F), $MachinePrecision] * N[(F / B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 3.85e-113], N[(N[(N[(F * N[Sqrt[N[(1.0 / N[(2.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(N[(1.0 / B), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -11500:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\
\mathbf{elif}\;F \leq 1.22 \cdot 10^{-238}:\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{-1}{F} \cdot \frac{F}{B}\\
\mathbf{elif}\;F \leq 3.85 \cdot 10^{-113}:\\
\;\;\;\;\frac{F \cdot \sqrt{\frac{1}{2 + x \cdot 2}} - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{B} - \frac{x}{\tan B}\\
\end{array}
\end{array}
if F < -11500Initial program 68.7%
Taylor expanded in F around -inf 99.4%
Taylor expanded in B around 0 71.8%
if -11500 < F < 1.22e-238Initial program 99.5%
Taylor expanded in F around -inf 38.3%
Taylor expanded in B around 0 54.5%
if 1.22e-238 < F < 3.85000000000000014e-113Initial program 99.4%
Taylor expanded in F around 0 99.4%
Taylor expanded in B around 0 49.1%
if 3.85000000000000014e-113 < F Initial program 63.6%
Simplified80.1%
Taylor expanded in F around inf 88.8%
associate-/r*88.8%
Simplified88.8%
Taylor expanded in B around 0 66.3%
Final simplification62.9%
(FPCore (F B x)
:precision binary64
(if (<= F -2400.0)
(- (/ -1.0 (sin B)) (/ x B))
(if (<= F 1.9e-236)
(+ (* x (/ -1.0 (tan B))) (/ (/ -1.0 F) (/ B F)))
(if (<= F 1.65e-117)
(/ (- (* F (sqrt (/ 1.0 (+ 2.0 (* x 2.0))))) x) B)
(- (/ 1.0 B) (/ x (tan B)))))))
double code(double F, double B, double x) {
double tmp;
if (F <= -2400.0) {
tmp = (-1.0 / sin(B)) - (x / B);
} else if (F <= 1.9e-236) {
tmp = (x * (-1.0 / tan(B))) + ((-1.0 / F) / (B / F));
} else if (F <= 1.65e-117) {
tmp = ((F * sqrt((1.0 / (2.0 + (x * 2.0))))) - x) / B;
} else {
tmp = (1.0 / B) - (x / tan(B));
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if (f <= (-2400.0d0)) then
tmp = ((-1.0d0) / sin(b)) - (x / b)
else if (f <= 1.9d-236) then
tmp = (x * ((-1.0d0) / tan(b))) + (((-1.0d0) / f) / (b / f))
else if (f <= 1.65d-117) then
tmp = ((f * sqrt((1.0d0 / (2.0d0 + (x * 2.0d0))))) - x) / b
else
tmp = (1.0d0 / b) - (x / tan(b))
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -2400.0) {
tmp = (-1.0 / Math.sin(B)) - (x / B);
} else if (F <= 1.9e-236) {
tmp = (x * (-1.0 / Math.tan(B))) + ((-1.0 / F) / (B / F));
} else if (F <= 1.65e-117) {
tmp = ((F * Math.sqrt((1.0 / (2.0 + (x * 2.0))))) - x) / B;
} else {
tmp = (1.0 / B) - (x / Math.tan(B));
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -2400.0: tmp = (-1.0 / math.sin(B)) - (x / B) elif F <= 1.9e-236: tmp = (x * (-1.0 / math.tan(B))) + ((-1.0 / F) / (B / F)) elif F <= 1.65e-117: tmp = ((F * math.sqrt((1.0 / (2.0 + (x * 2.0))))) - x) / B else: tmp = (1.0 / B) - (x / math.tan(B)) return tmp
function code(F, B, x) tmp = 0.0 if (F <= -2400.0) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B)); elseif (F <= 1.9e-236) tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(Float64(-1.0 / F) / Float64(B / F))); elseif (F <= 1.65e-117) tmp = Float64(Float64(Float64(F * sqrt(Float64(1.0 / Float64(2.0 + Float64(x * 2.0))))) - x) / B); else tmp = Float64(Float64(1.0 / B) - Float64(x / tan(B))); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -2400.0) tmp = (-1.0 / sin(B)) - (x / B); elseif (F <= 1.9e-236) tmp = (x * (-1.0 / tan(B))) + ((-1.0 / F) / (B / F)); elseif (F <= 1.65e-117) tmp = ((F * sqrt((1.0 / (2.0 + (x * 2.0))))) - x) / B; else tmp = (1.0 / B) - (x / tan(B)); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -2400.0], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.9e-236], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(-1.0 / F), $MachinePrecision] / N[(B / F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.65e-117], N[(N[(N[(F * N[Sqrt[N[(1.0 / N[(2.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(N[(1.0 / B), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -2400:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\
\mathbf{elif}\;F \leq 1.9 \cdot 10^{-236}:\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{\frac{-1}{F}}{\frac{B}{F}}\\
\mathbf{elif}\;F \leq 1.65 \cdot 10^{-117}:\\
\;\;\;\;\frac{F \cdot \sqrt{\frac{1}{2 + x \cdot 2}} - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{B} - \frac{x}{\tan B}\\
\end{array}
\end{array}
if F < -2400Initial program 68.7%
Taylor expanded in F around -inf 99.4%
Taylor expanded in B around 0 71.8%
if -2400 < F < 1.9e-236Initial program 99.5%
Taylor expanded in F around -inf 38.3%
*-commutative38.3%
clear-num38.3%
un-div-inv38.3%
Applied egg-rr38.3%
Taylor expanded in B around 0 55.9%
if 1.9e-236 < F < 1.65000000000000008e-117Initial program 99.4%
Taylor expanded in F around 0 99.4%
Taylor expanded in B around 0 49.1%
if 1.65000000000000008e-117 < F Initial program 63.6%
Simplified80.1%
Taylor expanded in F around inf 88.8%
associate-/r*88.8%
Simplified88.8%
Taylor expanded in B around 0 66.3%
Final simplification63.2%
(FPCore (F B x) :precision binary64 (if (<= B 4.6e-42) (/ (- x) B) (- (/ 1.0 B) (/ x (tan B)))))
double code(double F, double B, double x) {
double tmp;
if (B <= 4.6e-42) {
tmp = -x / B;
} else {
tmp = (1.0 / B) - (x / tan(B));
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if (b <= 4.6d-42) then
tmp = -x / b
else
tmp = (1.0d0 / b) - (x / tan(b))
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (B <= 4.6e-42) {
tmp = -x / B;
} else {
tmp = (1.0 / B) - (x / Math.tan(B));
}
return tmp;
}
def code(F, B, x): tmp = 0 if B <= 4.6e-42: tmp = -x / B else: tmp = (1.0 / B) - (x / math.tan(B)) return tmp
function code(F, B, x) tmp = 0.0 if (B <= 4.6e-42) tmp = Float64(Float64(-x) / B); else tmp = Float64(Float64(1.0 / B) - Float64(x / tan(B))); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (B <= 4.6e-42) tmp = -x / B; else tmp = (1.0 / B) - (x / tan(B)); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[B, 4.6e-42], N[((-x) / B), $MachinePrecision], N[(N[(1.0 / B), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;B \leq 4.6 \cdot 10^{-42}:\\
\;\;\;\;\frac{-x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{B} - \frac{x}{\tan B}\\
\end{array}
\end{array}
if B < 4.60000000000000008e-42Initial program 76.1%
Taylor expanded in F around -inf 55.9%
Taylor expanded in B around 0 30.6%
associate-*r/30.6%
mul-1-neg30.6%
Simplified30.6%
Taylor expanded in x around inf 34.5%
associate-*r/34.5%
neg-mul-134.5%
Simplified34.5%
if 4.60000000000000008e-42 < B Initial program 83.7%
Simplified84.0%
Taylor expanded in F around inf 49.5%
associate-/r*49.5%
Simplified49.5%
Taylor expanded in B around 0 47.1%
Final simplification38.7%
(FPCore (F B x) :precision binary64 (if (<= F -75.0) (- (/ -1.0 (sin B)) (/ x B)) (- (/ 1.0 B) (/ x (tan B)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -75.0) {
tmp = (-1.0 / sin(B)) - (x / B);
} else {
tmp = (1.0 / B) - (x / tan(B));
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if (f <= (-75.0d0)) then
tmp = ((-1.0d0) / sin(b)) - (x / b)
else
tmp = (1.0d0 / b) - (x / tan(b))
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -75.0) {
tmp = (-1.0 / Math.sin(B)) - (x / B);
} else {
tmp = (1.0 / B) - (x / Math.tan(B));
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -75.0: tmp = (-1.0 / math.sin(B)) - (x / B) else: tmp = (1.0 / B) - (x / math.tan(B)) return tmp
function code(F, B, x) tmp = 0.0 if (F <= -75.0) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B)); else tmp = Float64(Float64(1.0 / B) - Float64(x / tan(B))); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -75.0) tmp = (-1.0 / sin(B)) - (x / B); else tmp = (1.0 / B) - (x / tan(B)); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -75.0], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / B), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -75:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{B} - \frac{x}{\tan B}\\
\end{array}
\end{array}
if F < -75Initial program 68.7%
Taylor expanded in F around -inf 99.4%
Taylor expanded in B around 0 71.8%
if -75 < F Initial program 82.6%
Simplified90.5%
Taylor expanded in F around inf 55.9%
associate-/r*55.8%
Simplified55.8%
Taylor expanded in B around 0 54.4%
Final simplification59.3%
(FPCore (F B x)
:precision binary64
(if (<= F -1.7e-52)
(/ (- -1.0 x) B)
(if (<= F 1.2e-84)
(/ (- x) B)
(+ (* x (* B 0.3333333333333333)) (/ (- 1.0 x) B)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -1.7e-52) {
tmp = (-1.0 - x) / B;
} else if (F <= 1.2e-84) {
tmp = -x / B;
} else {
tmp = (x * (B * 0.3333333333333333)) + ((1.0 - x) / B);
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if (f <= (-1.7d-52)) then
tmp = ((-1.0d0) - x) / b
else if (f <= 1.2d-84) then
tmp = -x / b
else
tmp = (x * (b * 0.3333333333333333d0)) + ((1.0d0 - x) / b)
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -1.7e-52) {
tmp = (-1.0 - x) / B;
} else if (F <= 1.2e-84) {
tmp = -x / B;
} else {
tmp = (x * (B * 0.3333333333333333)) + ((1.0 - x) / B);
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -1.7e-52: tmp = (-1.0 - x) / B elif F <= 1.2e-84: tmp = -x / B else: tmp = (x * (B * 0.3333333333333333)) + ((1.0 - x) / B) return tmp
function code(F, B, x) tmp = 0.0 if (F <= -1.7e-52) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= 1.2e-84) tmp = Float64(Float64(-x) / B); else tmp = Float64(Float64(x * Float64(B * 0.3333333333333333)) + Float64(Float64(1.0 - x) / B)); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -1.7e-52) tmp = (-1.0 - x) / B; elseif (F <= 1.2e-84) tmp = -x / B; else tmp = (x * (B * 0.3333333333333333)) + ((1.0 - x) / B); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -1.7e-52], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 1.2e-84], N[((-x) / B), $MachinePrecision], N[(N[(x * N[(B * 0.3333333333333333), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -1.7 \cdot 10^{-52}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq 1.2 \cdot 10^{-84}:\\
\;\;\;\;\frac{-x}{B}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(B \cdot 0.3333333333333333\right) + \frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -1.70000000000000009e-52Initial program 71.8%
Taylor expanded in F around -inf 95.0%
Taylor expanded in B around 0 38.6%
associate-*r/38.6%
mul-1-neg38.6%
Simplified38.6%
if -1.70000000000000009e-52 < F < 1.20000000000000009e-84Initial program 99.4%
Taylor expanded in F around -inf 32.4%
Taylor expanded in B around 0 10.0%
associate-*r/10.0%
mul-1-neg10.0%
Simplified10.0%
Taylor expanded in x around inf 31.7%
associate-*r/31.7%
neg-mul-131.7%
Simplified31.7%
if 1.20000000000000009e-84 < F Initial program 60.4%
Simplified78.4%
Taylor expanded in F around inf 91.3%
associate-/r*91.3%
Simplified91.3%
Taylor expanded in B around 0 66.7%
Taylor expanded in B around 0 40.8%
associate--l+40.8%
associate-*r*40.8%
div-sub40.8%
Simplified40.8%
Final simplification36.7%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ (- x) B)))
(if (<= F -8.5e+218)
t_0
(if (<= F -185000000.0)
(/ -1.0 B)
(if (<= F 3e-75) t_0 (/ (- 1.0 x) B))))))
double code(double F, double B, double x) {
double t_0 = -x / B;
double tmp;
if (F <= -8.5e+218) {
tmp = t_0;
} else if (F <= -185000000.0) {
tmp = -1.0 / B;
} else if (F <= 3e-75) {
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 <= (-8.5d+218)) then
tmp = t_0
else if (f <= (-185000000.0d0)) then
tmp = (-1.0d0) / b
else if (f <= 3d-75) 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 <= -8.5e+218) {
tmp = t_0;
} else if (F <= -185000000.0) {
tmp = -1.0 / B;
} else if (F <= 3e-75) {
tmp = t_0;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
def code(F, B, x): t_0 = -x / B tmp = 0 if F <= -8.5e+218: tmp = t_0 elif F <= -185000000.0: tmp = -1.0 / B elif F <= 3e-75: tmp = t_0 else: tmp = (1.0 - x) / B return tmp
function code(F, B, x) t_0 = Float64(Float64(-x) / B) tmp = 0.0 if (F <= -8.5e+218) tmp = t_0; elseif (F <= -185000000.0) tmp = Float64(-1.0 / B); elseif (F <= 3e-75) 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 <= -8.5e+218) tmp = t_0; elseif (F <= -185000000.0) tmp = -1.0 / B; elseif (F <= 3e-75) 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, -8.5e+218], t$95$0, If[LessEqual[F, -185000000.0], N[(-1.0 / B), $MachinePrecision], If[LessEqual[F, 3e-75], 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 -8.5 \cdot 10^{+218}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;F \leq -185000000:\\
\;\;\;\;\frac{-1}{B}\\
\mathbf{elif}\;F \leq 3 \cdot 10^{-75}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -8.50000000000000041e218 or -1.85e8 < F < 2.9999999999999999e-75Initial program 93.1%
Taylor expanded in F around -inf 43.5%
Taylor expanded in B around 0 14.9%
associate-*r/14.9%
mul-1-neg14.9%
Simplified14.9%
Taylor expanded in x around inf 30.7%
associate-*r/30.7%
neg-mul-130.7%
Simplified30.7%
if -8.50000000000000041e218 < F < -1.85e8Initial program 73.1%
Taylor expanded in F around -inf 99.5%
Taylor expanded in B around 0 42.5%
associate-*r/42.5%
mul-1-neg42.5%
Simplified42.5%
Taylor expanded in x around 0 26.4%
if 2.9999999999999999e-75 < F Initial program 58.8%
Simplified77.5%
Taylor expanded in F around inf 94.8%
associate-/r*94.7%
Simplified94.7%
Taylor expanded in B around 0 40.5%
Final simplification32.7%
(FPCore (F B x) :precision binary64 (if (<= F -7.4e-52) (/ (- -1.0 x) B) (if (<= F 8e-74) (/ (- x) B) (/ (- 1.0 x) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -7.4e-52) {
tmp = (-1.0 - x) / B;
} else if (F <= 8e-74) {
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 <= (-7.4d-52)) then
tmp = ((-1.0d0) - x) / b
else if (f <= 8d-74) 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 <= -7.4e-52) {
tmp = (-1.0 - x) / B;
} else if (F <= 8e-74) {
tmp = -x / B;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -7.4e-52: tmp = (-1.0 - x) / B elif F <= 8e-74: tmp = -x / B else: tmp = (1.0 - x) / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= -7.4e-52) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= 8e-74) tmp = Float64(Float64(-x) / B); else tmp = Float64(Float64(1.0 - x) / B); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -7.4e-52) tmp = (-1.0 - x) / B; elseif (F <= 8e-74) tmp = -x / B; else tmp = (1.0 - x) / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -7.4e-52], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 8e-74], N[((-x) / B), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -7.4 \cdot 10^{-52}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq 8 \cdot 10^{-74}:\\
\;\;\;\;\frac{-x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -7.3999999999999995e-52Initial program 71.8%
Taylor expanded in F around -inf 95.0%
Taylor expanded in B around 0 38.6%
associate-*r/38.6%
mul-1-neg38.6%
Simplified38.6%
if -7.3999999999999995e-52 < F < 7.99999999999999966e-74Initial program 99.4%
Taylor expanded in F around -inf 32.4%
Taylor expanded in B around 0 10.8%
associate-*r/10.8%
mul-1-neg10.8%
Simplified10.8%
Taylor expanded in x around inf 31.8%
associate-*r/31.8%
neg-mul-131.8%
Simplified31.8%
if 7.99999999999999966e-74 < F Initial program 58.8%
Simplified77.5%
Taylor expanded in F around inf 94.8%
associate-/r*94.7%
Simplified94.7%
Taylor expanded in B around 0 40.5%
Final simplification36.6%
(FPCore (F B x) :precision binary64 (if (or (<= x -2.7e-140) (not (<= x 1.5e-166))) (/ (- x) B) (/ -1.0 B)))
double code(double F, double B, double x) {
double tmp;
if ((x <= -2.7e-140) || !(x <= 1.5e-166)) {
tmp = -x / B;
} else {
tmp = -1.0 / B;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if ((x <= (-2.7d-140)) .or. (.not. (x <= 1.5d-166))) then
tmp = -x / b
else
tmp = (-1.0d0) / b
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if ((x <= -2.7e-140) || !(x <= 1.5e-166)) {
tmp = -x / B;
} else {
tmp = -1.0 / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if (x <= -2.7e-140) or not (x <= 1.5e-166): tmp = -x / B else: tmp = -1.0 / B return tmp
function code(F, B, x) tmp = 0.0 if ((x <= -2.7e-140) || !(x <= 1.5e-166)) tmp = Float64(Float64(-x) / B); else tmp = Float64(-1.0 / B); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if ((x <= -2.7e-140) || ~((x <= 1.5e-166))) tmp = -x / B; else tmp = -1.0 / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[Or[LessEqual[x, -2.7e-140], N[Not[LessEqual[x, 1.5e-166]], $MachinePrecision]], N[((-x) / B), $MachinePrecision], N[(-1.0 / B), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.7 \cdot 10^{-140} \lor \neg \left(x \leq 1.5 \cdot 10^{-166}\right):\\
\;\;\;\;\frac{-x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{-1}{B}\\
\end{array}
\end{array}
if x < -2.7e-140 or 1.5000000000000001e-166 < x Initial program 80.4%
Taylor expanded in F around -inf 65.1%
Taylor expanded in B around 0 24.4%
associate-*r/24.4%
mul-1-neg24.4%
Simplified24.4%
Taylor expanded in x around inf 32.1%
associate-*r/32.1%
neg-mul-132.1%
Simplified32.1%
if -2.7e-140 < x < 1.5000000000000001e-166Initial program 73.1%
Taylor expanded in F around -inf 31.8%
Taylor expanded in B around 0 18.6%
associate-*r/18.6%
mul-1-neg18.6%
Simplified18.6%
Taylor expanded in x around 0 18.6%
Final simplification28.8%
(FPCore (F B x) :precision binary64 (if (<= F 7e-268) (/ -1.0 B) (/ 1.0 B)))
double code(double F, double B, double x) {
double tmp;
if (F <= 7e-268) {
tmp = -1.0 / B;
} else {
tmp = 1.0 / B;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if (f <= 7d-268) then
tmp = (-1.0d0) / b
else
tmp = 1.0d0 / b
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= 7e-268) {
tmp = -1.0 / B;
} else {
tmp = 1.0 / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= 7e-268: tmp = -1.0 / B else: tmp = 1.0 / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= 7e-268) tmp = Float64(-1.0 / B); else tmp = Float64(1.0 / B); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= 7e-268) tmp = -1.0 / B; else tmp = 1.0 / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, 7e-268], N[(-1.0 / B), $MachinePrecision], N[(1.0 / B), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq 7 \cdot 10^{-268}:\\
\;\;\;\;\frac{-1}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{B}\\
\end{array}
\end{array}
if F < 7.00000000000000011e-268Initial program 83.3%
Taylor expanded in F around -inf 70.2%
Taylor expanded in B around 0 28.4%
associate-*r/28.4%
mul-1-neg28.4%
Simplified28.4%
Taylor expanded in x around 0 13.6%
if 7.00000000000000011e-268 < F Initial program 73.1%
Simplified85.3%
Taylor expanded in F around inf 70.9%
associate-/r*70.9%
Simplified70.9%
Taylor expanded in B around 0 58.4%
Taylor expanded in x around 0 14.6%
Final simplification14.1%
(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.6%
Taylor expanded in F around -inf 56.9%
Taylor expanded in B around 0 23.0%
associate-*r/23.0%
mul-1-neg23.0%
Simplified23.0%
Taylor expanded in x around 0 8.8%
Final simplification8.8%
herbie shell --seed 2024040
(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))))))