
(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 21 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 -2e+41)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 1000.0)
(- (* F (/ (pow (fma x 2.0 (fma F F 2.0)) -0.5) (sin B))) t_0)
(/ (- 1.0 (* x (cos B))) (sin B))))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -2e+41) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 1000.0) {
tmp = (F * (pow(fma(x, 2.0, fma(F, F, 2.0)), -0.5) / sin(B))) - t_0;
} else {
tmp = (1.0 - (x * cos(B))) / sin(B);
}
return tmp;
}
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -2e+41) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 1000.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 - Float64(x * cos(B))) / sin(B)); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -2e+41], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 1000.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[(x * N[Cos[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -2 \cdot 10^{+41}:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq 1000:\\
\;\;\;\;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 - x \cdot \cos B}{\sin B}\\
\end{array}
\end{array}
if F < -2.00000000000000001e41Initial program 53.4%
Simplified71.8%
Taylor expanded in F around -inf 99.8%
if -2.00000000000000001e41 < F < 1e3Initial program 99.4%
Simplified99.6%
if 1e3 < F Initial program 56.2%
Simplified69.8%
fma-define69.8%
fma-undefine69.8%
*-commutative69.8%
+-commutative69.8%
add-sqr-sqrt69.8%
metadata-eval69.8%
metadata-eval69.8%
unpow-prod-down69.6%
+-commutative69.6%
fma-define69.6%
fma-define69.6%
metadata-eval69.6%
metadata-eval69.6%
+-commutative69.6%
fma-define69.6%
fma-define69.6%
metadata-eval69.6%
Applied egg-rr69.6%
pow-sqr69.8%
metadata-eval69.8%
unpow-169.8%
fma-undefine69.8%
*-commutative69.8%
fma-undefine69.8%
unpow269.8%
+-commutative69.8%
fma-define69.8%
+-commutative69.8%
unpow269.8%
fma-undefine69.8%
Simplified69.8%
Taylor expanded in F around inf 99.8%
div-sub99.8%
Simplified99.8%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -1.25e+73)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 10000000000.0)
(- (* F (/ (/ 1.0 (sqrt (fma F F 2.0))) (sin B))) t_0)
(/ (- 1.0 (* x (cos B))) (sin B))))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -1.25e+73) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 10000000000.0) {
tmp = (F * ((1.0 / sqrt(fma(F, F, 2.0))) / sin(B))) - t_0;
} else {
tmp = (1.0 - (x * cos(B))) / sin(B);
}
return tmp;
}
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -1.25e+73) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 10000000000.0) tmp = Float64(Float64(F * Float64(Float64(1.0 / sqrt(fma(F, F, 2.0))) / sin(B))) - t_0); else tmp = Float64(Float64(1.0 - Float64(x * cos(B))) / sin(B)); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -1.25e+73], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 10000000000.0], N[(N[(F * N[(N[(1.0 / N[Sqrt[N[(F * F + 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], N[(N[(1.0 - N[(x * N[Cos[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -1.25 \cdot 10^{+73}:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq 10000000000:\\
\;\;\;\;F \cdot \frac{\frac{1}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B} - t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x \cdot \cos B}{\sin B}\\
\end{array}
\end{array}
if F < -1.24999999999999994e73Initial program 50.6%
Simplified68.8%
Taylor expanded in F around -inf 99.8%
if -1.24999999999999994e73 < F < 1e10Initial program 98.6%
Simplified99.6%
fma-define99.6%
fma-undefine99.6%
*-commutative99.6%
+-commutative99.6%
add-sqr-sqrt99.5%
metadata-eval99.5%
metadata-eval99.5%
unpow-prod-down99.6%
+-commutative99.6%
fma-define99.6%
fma-define99.6%
metadata-eval99.6%
metadata-eval99.6%
+-commutative99.6%
fma-define99.6%
fma-define99.6%
metadata-eval99.6%
Applied egg-rr99.6%
pow-sqr99.5%
metadata-eval99.5%
unpow-199.6%
fma-undefine99.6%
*-commutative99.6%
fma-undefine99.6%
unpow299.6%
+-commutative99.6%
fma-define99.6%
+-commutative99.6%
unpow299.6%
fma-undefine99.6%
Simplified99.6%
Taylor expanded in x around 0 99.6%
+-commutative99.6%
unpow299.6%
fma-undefine99.6%
Simplified99.6%
if 1e10 < F Initial program 56.2%
Simplified69.8%
fma-define69.8%
fma-undefine69.8%
*-commutative69.8%
+-commutative69.8%
add-sqr-sqrt69.8%
metadata-eval69.8%
metadata-eval69.8%
unpow-prod-down69.6%
+-commutative69.6%
fma-define69.6%
fma-define69.6%
metadata-eval69.6%
metadata-eval69.6%
+-commutative69.6%
fma-define69.6%
fma-define69.6%
metadata-eval69.6%
Applied egg-rr69.6%
pow-sqr69.8%
metadata-eval69.8%
unpow-169.8%
fma-undefine69.8%
*-commutative69.8%
fma-undefine69.8%
unpow269.8%
+-commutative69.8%
fma-define69.8%
+-commutative69.8%
unpow269.8%
fma-undefine69.8%
Simplified69.8%
Taylor expanded in F around inf 99.8%
div-sub99.8%
Simplified99.8%
(FPCore (F B x)
:precision binary64
(if (<= F -2e+23)
(- (/ -1.0 (sin B)) (/ x (tan B)))
(if (<= F 1e+16)
(+
(* x (/ -1.0 (tan B)))
(* (/ F (sin B)) (pow (+ (+ 2.0 (* F F)) (* x 2.0)) -0.5)))
(/ (- 1.0 (* x (cos B))) (sin B)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -2e+23) {
tmp = (-1.0 / sin(B)) - (x / tan(B));
} else if (F <= 1e+16) {
tmp = (x * (-1.0 / tan(B))) + ((F / sin(B)) * pow(((2.0 + (F * F)) + (x * 2.0)), -0.5));
} else {
tmp = (1.0 - (x * cos(B))) / sin(B);
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if (f <= (-2d+23)) then
tmp = ((-1.0d0) / sin(b)) - (x / tan(b))
else if (f <= 1d+16) then
tmp = (x * ((-1.0d0) / tan(b))) + ((f / sin(b)) * (((2.0d0 + (f * f)) + (x * 2.0d0)) ** (-0.5d0)))
else
tmp = (1.0d0 - (x * cos(b))) / sin(b)
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -2e+23) {
tmp = (-1.0 / Math.sin(B)) - (x / Math.tan(B));
} else if (F <= 1e+16) {
tmp = (x * (-1.0 / Math.tan(B))) + ((F / Math.sin(B)) * Math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5));
} else {
tmp = (1.0 - (x * Math.cos(B))) / Math.sin(B);
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -2e+23: tmp = (-1.0 / math.sin(B)) - (x / math.tan(B)) elif F <= 1e+16: tmp = (x * (-1.0 / math.tan(B))) + ((F / math.sin(B)) * math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5)) else: tmp = (1.0 - (x * math.cos(B))) / math.sin(B) return tmp
function code(F, B, x) tmp = 0.0 if (F <= -2e+23) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / tan(B))); elseif (F <= 1e+16) tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(Float64(F / sin(B)) * (Float64(Float64(2.0 + Float64(F * F)) + Float64(x * 2.0)) ^ -0.5))); else tmp = Float64(Float64(1.0 - Float64(x * cos(B))) / sin(B)); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -2e+23) tmp = (-1.0 / sin(B)) - (x / tan(B)); elseif (F <= 1e+16) tmp = (x * (-1.0 / tan(B))) + ((F / sin(B)) * (((2.0 + (F * F)) + (x * 2.0)) ^ -0.5)); else tmp = (1.0 - (x * cos(B))) / sin(B); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -2e+23], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1e+16], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Power[N[(N[(2.0 + N[(F * F), $MachinePrecision]), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - N[(x * N[Cos[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -2 \cdot 10^{+23}:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\
\mathbf{elif}\;F \leq 10^{+16}:\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{F}{\sin B} \cdot {\left(\left(2 + F \cdot F\right) + x \cdot 2\right)}^{-0.5}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x \cdot \cos B}{\sin B}\\
\end{array}
\end{array}
if F < -1.9999999999999998e23Initial program 57.5%
Simplified74.2%
Taylor expanded in F around -inf 99.8%
if -1.9999999999999998e23 < F < 1e16Initial program 99.4%
metadata-eval99.4%
metadata-eval99.4%
Applied egg-rr99.4%
if 1e16 < F Initial program 55.1%
Simplified69.1%
fma-define69.1%
fma-undefine69.1%
*-commutative69.1%
+-commutative69.1%
add-sqr-sqrt69.1%
metadata-eval69.1%
metadata-eval69.1%
unpow-prod-down68.9%
+-commutative68.9%
fma-define68.9%
fma-define68.9%
metadata-eval68.9%
metadata-eval68.9%
+-commutative68.9%
fma-define68.9%
fma-define68.9%
metadata-eval68.9%
Applied egg-rr68.9%
pow-sqr69.1%
metadata-eval69.1%
unpow-169.1%
fma-undefine69.1%
*-commutative69.1%
fma-undefine69.1%
unpow269.1%
+-commutative69.1%
fma-define69.1%
+-commutative69.1%
unpow269.1%
fma-undefine69.1%
Simplified69.1%
Taylor expanded in F around inf 99.8%
div-sub99.8%
Simplified99.8%
Final simplification99.6%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -1.45)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 1.4)
(- (* F (/ (sqrt 0.5) (sin B))) t_0)
(/ (- 1.0 (* x (cos B))) (sin B))))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -1.45) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 1.4) {
tmp = (F * (sqrt(0.5) / sin(B))) - t_0;
} else {
tmp = (1.0 - (x * cos(B))) / sin(B);
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: tmp
t_0 = x / tan(b)
if (f <= (-1.45d0)) then
tmp = ((-1.0d0) / sin(b)) - t_0
else if (f <= 1.4d0) then
tmp = (f * (sqrt(0.5d0) / sin(b))) - t_0
else
tmp = (1.0d0 - (x * cos(b))) / sin(b)
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = x / Math.tan(B);
double tmp;
if (F <= -1.45) {
tmp = (-1.0 / Math.sin(B)) - t_0;
} else if (F <= 1.4) {
tmp = (F * (Math.sqrt(0.5) / Math.sin(B))) - t_0;
} else {
tmp = (1.0 - (x * Math.cos(B))) / Math.sin(B);
}
return tmp;
}
def code(F, B, x): t_0 = x / math.tan(B) tmp = 0 if F <= -1.45: tmp = (-1.0 / math.sin(B)) - t_0 elif F <= 1.4: tmp = (F * (math.sqrt(0.5) / math.sin(B))) - t_0 else: tmp = (1.0 - (x * math.cos(B))) / math.sin(B) return tmp
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -1.45) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 1.4) tmp = Float64(Float64(F * Float64(sqrt(0.5) / sin(B))) - t_0); else tmp = Float64(Float64(1.0 - Float64(x * cos(B))) / sin(B)); end return tmp end
function tmp_2 = code(F, B, x) t_0 = x / tan(B); tmp = 0.0; if (F <= -1.45) tmp = (-1.0 / sin(B)) - t_0; elseif (F <= 1.4) tmp = (F * (sqrt(0.5) / sin(B))) - t_0; else tmp = (1.0 - (x * cos(B))) / sin(B); end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -1.45], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 1.4], N[(N[(F * N[(N[Sqrt[0.5], $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], N[(N[(1.0 - N[(x * N[Cos[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -1.45:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq 1.4:\\
\;\;\;\;F \cdot \frac{\sqrt{0.5}}{\sin B} - t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x \cdot \cos B}{\sin B}\\
\end{array}
\end{array}
if F < -1.44999999999999996Initial program 58.9%
Simplified75.1%
Taylor expanded in F around -inf 98.5%
if -1.44999999999999996 < F < 1.3999999999999999Initial program 99.4%
Simplified99.6%
fma-define99.6%
fma-undefine99.6%
*-commutative99.6%
+-commutative99.6%
add-sqr-sqrt99.5%
metadata-eval99.5%
metadata-eval99.5%
unpow-prod-down99.5%
+-commutative99.5%
fma-define99.5%
fma-define99.5%
metadata-eval99.5%
metadata-eval99.5%
+-commutative99.5%
fma-define99.5%
fma-define99.5%
metadata-eval99.5%
Applied egg-rr99.5%
pow-sqr99.5%
metadata-eval99.5%
unpow-199.5%
fma-undefine99.5%
*-commutative99.5%
fma-undefine99.5%
unpow299.5%
+-commutative99.5%
fma-define99.5%
+-commutative99.5%
unpow299.5%
fma-undefine99.5%
Simplified99.5%
Taylor expanded in x around 0 99.5%
+-commutative99.5%
unpow299.5%
fma-undefine99.5%
Simplified99.5%
Taylor expanded in F around 0 98.9%
associate-/l*99.0%
Simplified99.0%
if 1.3999999999999999 < F Initial program 57.2%
Simplified70.5%
fma-define70.5%
fma-undefine70.5%
*-commutative70.5%
+-commutative70.5%
add-sqr-sqrt70.5%
metadata-eval70.5%
metadata-eval70.5%
unpow-prod-down70.3%
+-commutative70.3%
fma-define70.3%
fma-define70.3%
metadata-eval70.3%
metadata-eval70.3%
+-commutative70.3%
fma-define70.3%
fma-define70.3%
metadata-eval70.3%
Applied egg-rr70.3%
pow-sqr70.4%
metadata-eval70.4%
unpow-170.4%
fma-undefine70.4%
*-commutative70.4%
fma-undefine70.4%
unpow270.4%
+-commutative70.4%
fma-define70.4%
+-commutative70.4%
unpow270.4%
fma-undefine70.4%
Simplified70.4%
Taylor expanded in F around inf 98.4%
div-sub98.4%
Simplified98.4%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (* x (cos B))) (t_1 (pow (+ (+ 2.0 (* F F)) (* x 2.0)) -0.5)))
(if (<= F -2.8e-50)
(- (/ -1.0 (sin B)) (/ x (tan B)))
(if (<= F -4e-229)
(- (* t_1 (* F (/ 1.0 (sin B)))) (/ x B))
(if (<= F 4.5e-80)
(/ t_0 (- (sin B)))
(if (<= F 800000.0)
(- (* t_1 (/ 1.0 (/ (sin B) F))) (/ x B))
(/ (- 1.0 t_0) (sin B))))))))
double code(double F, double B, double x) {
double t_0 = x * cos(B);
double t_1 = pow(((2.0 + (F * F)) + (x * 2.0)), -0.5);
double tmp;
if (F <= -2.8e-50) {
tmp = (-1.0 / sin(B)) - (x / tan(B));
} else if (F <= -4e-229) {
tmp = (t_1 * (F * (1.0 / sin(B)))) - (x / B);
} else if (F <= 4.5e-80) {
tmp = t_0 / -sin(B);
} else if (F <= 800000.0) {
tmp = (t_1 * (1.0 / (sin(B) / F))) - (x / B);
} else {
tmp = (1.0 - t_0) / sin(B);
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = x * cos(b)
t_1 = ((2.0d0 + (f * f)) + (x * 2.0d0)) ** (-0.5d0)
if (f <= (-2.8d-50)) then
tmp = ((-1.0d0) / sin(b)) - (x / tan(b))
else if (f <= (-4d-229)) then
tmp = (t_1 * (f * (1.0d0 / sin(b)))) - (x / b)
else if (f <= 4.5d-80) then
tmp = t_0 / -sin(b)
else if (f <= 800000.0d0) then
tmp = (t_1 * (1.0d0 / (sin(b) / f))) - (x / b)
else
tmp = (1.0d0 - t_0) / sin(b)
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = x * Math.cos(B);
double t_1 = Math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5);
double tmp;
if (F <= -2.8e-50) {
tmp = (-1.0 / Math.sin(B)) - (x / Math.tan(B));
} else if (F <= -4e-229) {
tmp = (t_1 * (F * (1.0 / Math.sin(B)))) - (x / B);
} else if (F <= 4.5e-80) {
tmp = t_0 / -Math.sin(B);
} else if (F <= 800000.0) {
tmp = (t_1 * (1.0 / (Math.sin(B) / F))) - (x / B);
} else {
tmp = (1.0 - t_0) / Math.sin(B);
}
return tmp;
}
def code(F, B, x): t_0 = x * math.cos(B) t_1 = math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5) tmp = 0 if F <= -2.8e-50: tmp = (-1.0 / math.sin(B)) - (x / math.tan(B)) elif F <= -4e-229: tmp = (t_1 * (F * (1.0 / math.sin(B)))) - (x / B) elif F <= 4.5e-80: tmp = t_0 / -math.sin(B) elif F <= 800000.0: tmp = (t_1 * (1.0 / (math.sin(B) / F))) - (x / B) else: tmp = (1.0 - t_0) / math.sin(B) return tmp
function code(F, B, x) t_0 = Float64(x * cos(B)) t_1 = Float64(Float64(2.0 + Float64(F * F)) + Float64(x * 2.0)) ^ -0.5 tmp = 0.0 if (F <= -2.8e-50) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / tan(B))); elseif (F <= -4e-229) tmp = Float64(Float64(t_1 * Float64(F * Float64(1.0 / sin(B)))) - Float64(x / B)); elseif (F <= 4.5e-80) tmp = Float64(t_0 / Float64(-sin(B))); elseif (F <= 800000.0) tmp = Float64(Float64(t_1 * Float64(1.0 / Float64(sin(B) / F))) - Float64(x / B)); else tmp = Float64(Float64(1.0 - t_0) / sin(B)); end return tmp end
function tmp_2 = code(F, B, x) t_0 = x * cos(B); t_1 = ((2.0 + (F * F)) + (x * 2.0)) ^ -0.5; tmp = 0.0; if (F <= -2.8e-50) tmp = (-1.0 / sin(B)) - (x / tan(B)); elseif (F <= -4e-229) tmp = (t_1 * (F * (1.0 / sin(B)))) - (x / B); elseif (F <= 4.5e-80) tmp = t_0 / -sin(B); elseif (F <= 800000.0) tmp = (t_1 * (1.0 / (sin(B) / F))) - (x / B); else tmp = (1.0 - t_0) / sin(B); end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(x * N[Cos[B], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Power[N[(N[(2.0 + N[(F * F), $MachinePrecision]), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]}, If[LessEqual[F, -2.8e-50], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -4e-229], N[(N[(t$95$1 * N[(F * N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 4.5e-80], N[(t$95$0 / (-N[Sin[B], $MachinePrecision])), $MachinePrecision], If[LessEqual[F, 800000.0], N[(N[(t$95$1 * N[(1.0 / N[(N[Sin[B], $MachinePrecision] / F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - t$95$0), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x \cdot \cos B\\
t_1 := {\left(\left(2 + F \cdot F\right) + x \cdot 2\right)}^{-0.5}\\
\mathbf{if}\;F \leq -2.8 \cdot 10^{-50}:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\
\mathbf{elif}\;F \leq -4 \cdot 10^{-229}:\\
\;\;\;\;t\_1 \cdot \left(F \cdot \frac{1}{\sin B}\right) - \frac{x}{B}\\
\mathbf{elif}\;F \leq 4.5 \cdot 10^{-80}:\\
\;\;\;\;\frac{t\_0}{-\sin B}\\
\mathbf{elif}\;F \leq 800000:\\
\;\;\;\;t\_1 \cdot \frac{1}{\frac{\sin B}{F}} - \frac{x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - t\_0}{\sin B}\\
\end{array}
\end{array}
if F < -2.7999999999999998e-50Initial program 64.3%
Simplified78.3%
Taylor expanded in F around -inf 94.6%
if -2.7999999999999998e-50 < F < -4.00000000000000028e-229Initial program 99.5%
Taylor expanded in B around 0 90.4%
associate-*r/90.4%
neg-mul-190.4%
Simplified90.4%
div-inv90.4%
Applied egg-rr90.4%
if -4.00000000000000028e-229 < F < 4.5000000000000003e-80Initial program 99.4%
Simplified99.7%
fma-define99.7%
fma-undefine99.7%
*-commutative99.7%
+-commutative99.7%
add-sqr-sqrt99.6%
metadata-eval99.6%
metadata-eval99.6%
unpow-prod-down99.6%
+-commutative99.6%
fma-define99.6%
fma-define99.6%
metadata-eval99.6%
metadata-eval99.6%
+-commutative99.6%
fma-define99.6%
fma-define99.6%
metadata-eval99.6%
Applied egg-rr99.6%
pow-sqr99.6%
metadata-eval99.6%
unpow-199.6%
fma-undefine99.6%
*-commutative99.6%
fma-undefine99.6%
unpow299.6%
+-commutative99.6%
fma-define99.6%
+-commutative99.6%
unpow299.6%
fma-undefine99.6%
Simplified99.6%
Taylor expanded in F around 0 79.8%
associate-*r/79.8%
neg-mul-179.8%
distribute-rgt-neg-in79.8%
Simplified79.8%
if 4.5000000000000003e-80 < F < 8e5Initial program 98.9%
Taylor expanded in B around 0 89.3%
associate-*r/89.3%
neg-mul-189.3%
Simplified89.3%
clear-num89.5%
inv-pow89.5%
Applied egg-rr89.5%
unpow-189.5%
Simplified89.5%
metadata-eval98.9%
metadata-eval98.9%
Applied egg-rr89.5%
if 8e5 < F Initial program 56.2%
Simplified69.8%
fma-define69.8%
fma-undefine69.8%
*-commutative69.8%
+-commutative69.8%
add-sqr-sqrt69.8%
metadata-eval69.8%
metadata-eval69.8%
unpow-prod-down69.6%
+-commutative69.6%
fma-define69.6%
fma-define69.6%
metadata-eval69.6%
metadata-eval69.6%
+-commutative69.6%
fma-define69.6%
fma-define69.6%
metadata-eval69.6%
Applied egg-rr69.6%
pow-sqr69.8%
metadata-eval69.8%
unpow-169.8%
fma-undefine69.8%
*-commutative69.8%
fma-undefine69.8%
unpow269.8%
+-commutative69.8%
fma-define69.8%
+-commutative69.8%
unpow269.8%
fma-undefine69.8%
Simplified69.8%
Taylor expanded in F around inf 99.8%
div-sub99.8%
Simplified99.8%
Final simplification92.1%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (* x (cos B))))
(if (<= F -2.8e-50)
(- (/ -1.0 (sin B)) (/ x (tan B)))
(if (<= F -1.3e-228)
(- (* (/ F (sin B)) (sqrt (/ 1.0 (+ 2.0 (* x 2.0))))) (/ x B))
(if (<= F 3.05e-80)
(/ t_0 (- (sin B)))
(if (<= F 250000.0)
(-
(* (pow (+ (+ 2.0 (* F F)) (* x 2.0)) -0.5) (/ 1.0 (/ (sin B) F)))
(/ x B))
(/ (- 1.0 t_0) (sin B))))))))
double code(double F, double B, double x) {
double t_0 = x * cos(B);
double tmp;
if (F <= -2.8e-50) {
tmp = (-1.0 / sin(B)) - (x / tan(B));
} else if (F <= -1.3e-228) {
tmp = ((F / sin(B)) * sqrt((1.0 / (2.0 + (x * 2.0))))) - (x / B);
} else if (F <= 3.05e-80) {
tmp = t_0 / -sin(B);
} else if (F <= 250000.0) {
tmp = (pow(((2.0 + (F * F)) + (x * 2.0)), -0.5) * (1.0 / (sin(B) / F))) - (x / B);
} else {
tmp = (1.0 - t_0) / sin(B);
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: tmp
t_0 = x * cos(b)
if (f <= (-2.8d-50)) then
tmp = ((-1.0d0) / sin(b)) - (x / tan(b))
else if (f <= (-1.3d-228)) then
tmp = ((f / sin(b)) * sqrt((1.0d0 / (2.0d0 + (x * 2.0d0))))) - (x / b)
else if (f <= 3.05d-80) then
tmp = t_0 / -sin(b)
else if (f <= 250000.0d0) then
tmp = ((((2.0d0 + (f * f)) + (x * 2.0d0)) ** (-0.5d0)) * (1.0d0 / (sin(b) / f))) - (x / b)
else
tmp = (1.0d0 - t_0) / sin(b)
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = x * Math.cos(B);
double tmp;
if (F <= -2.8e-50) {
tmp = (-1.0 / Math.sin(B)) - (x / Math.tan(B));
} else if (F <= -1.3e-228) {
tmp = ((F / Math.sin(B)) * Math.sqrt((1.0 / (2.0 + (x * 2.0))))) - (x / B);
} else if (F <= 3.05e-80) {
tmp = t_0 / -Math.sin(B);
} else if (F <= 250000.0) {
tmp = (Math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5) * (1.0 / (Math.sin(B) / F))) - (x / B);
} else {
tmp = (1.0 - t_0) / Math.sin(B);
}
return tmp;
}
def code(F, B, x): t_0 = x * math.cos(B) tmp = 0 if F <= -2.8e-50: tmp = (-1.0 / math.sin(B)) - (x / math.tan(B)) elif F <= -1.3e-228: tmp = ((F / math.sin(B)) * math.sqrt((1.0 / (2.0 + (x * 2.0))))) - (x / B) elif F <= 3.05e-80: tmp = t_0 / -math.sin(B) elif F <= 250000.0: tmp = (math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5) * (1.0 / (math.sin(B) / F))) - (x / B) else: tmp = (1.0 - t_0) / math.sin(B) return tmp
function code(F, B, x) t_0 = Float64(x * cos(B)) tmp = 0.0 if (F <= -2.8e-50) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / tan(B))); elseif (F <= -1.3e-228) tmp = Float64(Float64(Float64(F / sin(B)) * sqrt(Float64(1.0 / Float64(2.0 + Float64(x * 2.0))))) - Float64(x / B)); elseif (F <= 3.05e-80) tmp = Float64(t_0 / Float64(-sin(B))); elseif (F <= 250000.0) tmp = Float64(Float64((Float64(Float64(2.0 + Float64(F * F)) + Float64(x * 2.0)) ^ -0.5) * Float64(1.0 / Float64(sin(B) / F))) - Float64(x / B)); else tmp = Float64(Float64(1.0 - t_0) / sin(B)); end return tmp end
function tmp_2 = code(F, B, x) t_0 = x * cos(B); tmp = 0.0; if (F <= -2.8e-50) tmp = (-1.0 / sin(B)) - (x / tan(B)); elseif (F <= -1.3e-228) tmp = ((F / sin(B)) * sqrt((1.0 / (2.0 + (x * 2.0))))) - (x / B); elseif (F <= 3.05e-80) tmp = t_0 / -sin(B); elseif (F <= 250000.0) tmp = ((((2.0 + (F * F)) + (x * 2.0)) ^ -0.5) * (1.0 / (sin(B) / F))) - (x / B); else tmp = (1.0 - t_0) / sin(B); end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(x * N[Cos[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -2.8e-50], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -1.3e-228], 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], If[LessEqual[F, 3.05e-80], N[(t$95$0 / (-N[Sin[B], $MachinePrecision])), $MachinePrecision], If[LessEqual[F, 250000.0], N[(N[(N[Power[N[(N[(2.0 + N[(F * F), $MachinePrecision]), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] * N[(1.0 / N[(N[Sin[B], $MachinePrecision] / F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - t$95$0), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x \cdot \cos B\\
\mathbf{if}\;F \leq -2.8 \cdot 10^{-50}:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\
\mathbf{elif}\;F \leq -1.3 \cdot 10^{-228}:\\
\;\;\;\;\frac{F}{\sin B} \cdot \sqrt{\frac{1}{2 + x \cdot 2}} - \frac{x}{B}\\
\mathbf{elif}\;F \leq 3.05 \cdot 10^{-80}:\\
\;\;\;\;\frac{t\_0}{-\sin B}\\
\mathbf{elif}\;F \leq 250000:\\
\;\;\;\;{\left(\left(2 + F \cdot F\right) + x \cdot 2\right)}^{-0.5} \cdot \frac{1}{\frac{\sin B}{F}} - \frac{x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - t\_0}{\sin B}\\
\end{array}
\end{array}
if F < -2.7999999999999998e-50Initial program 64.3%
Simplified78.3%
Taylor expanded in F around -inf 94.6%
if -2.7999999999999998e-50 < F < -1.3e-228Initial program 99.5%
Taylor expanded in B around 0 90.4%
associate-*r/90.4%
neg-mul-190.4%
Simplified90.4%
Taylor expanded in F around 0 90.4%
neg-mul-190.4%
distribute-frac-neg90.4%
+-commutative90.4%
distribute-frac-neg90.4%
unsub-neg90.4%
*-commutative90.4%
Simplified90.4%
if -1.3e-228 < F < 3.0500000000000001e-80Initial program 99.4%
Simplified99.7%
fma-define99.7%
fma-undefine99.7%
*-commutative99.7%
+-commutative99.7%
add-sqr-sqrt99.6%
metadata-eval99.6%
metadata-eval99.6%
unpow-prod-down99.6%
+-commutative99.6%
fma-define99.6%
fma-define99.6%
metadata-eval99.6%
metadata-eval99.6%
+-commutative99.6%
fma-define99.6%
fma-define99.6%
metadata-eval99.6%
Applied egg-rr99.6%
pow-sqr99.6%
metadata-eval99.6%
unpow-199.6%
fma-undefine99.6%
*-commutative99.6%
fma-undefine99.6%
unpow299.6%
+-commutative99.6%
fma-define99.6%
+-commutative99.6%
unpow299.6%
fma-undefine99.6%
Simplified99.6%
Taylor expanded in F around 0 79.8%
associate-*r/79.8%
neg-mul-179.8%
distribute-rgt-neg-in79.8%
Simplified79.8%
if 3.0500000000000001e-80 < F < 2.5e5Initial program 98.9%
Taylor expanded in B around 0 89.3%
associate-*r/89.3%
neg-mul-189.3%
Simplified89.3%
clear-num89.5%
inv-pow89.5%
Applied egg-rr89.5%
unpow-189.5%
Simplified89.5%
metadata-eval98.9%
metadata-eval98.9%
Applied egg-rr89.5%
if 2.5e5 < F Initial program 56.2%
Simplified69.8%
fma-define69.8%
fma-undefine69.8%
*-commutative69.8%
+-commutative69.8%
add-sqr-sqrt69.8%
metadata-eval69.8%
metadata-eval69.8%
unpow-prod-down69.6%
+-commutative69.6%
fma-define69.6%
fma-define69.6%
metadata-eval69.6%
metadata-eval69.6%
+-commutative69.6%
fma-define69.6%
fma-define69.6%
metadata-eval69.6%
Applied egg-rr69.6%
pow-sqr69.8%
metadata-eval69.8%
unpow-169.8%
fma-undefine69.8%
*-commutative69.8%
fma-undefine69.8%
unpow269.8%
+-commutative69.8%
fma-define69.8%
+-commutative69.8%
unpow269.8%
fma-undefine69.8%
Simplified69.8%
Taylor expanded in F around inf 99.8%
div-sub99.8%
Simplified99.8%
Final simplification92.1%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (* x (cos B))) (t_1 (/ F (sin B))))
(if (<= F -2.8e-50)
(- (/ -1.0 (sin B)) (/ x (tan B)))
(if (<= F -1.16e-228)
(- (* t_1 (sqrt (/ 1.0 (+ 2.0 (* x 2.0))))) (/ x B))
(if (<= F 3.05e-80)
(/ t_0 (- (sin B)))
(if (<= F 94000.0)
(- (* t_1 (pow (+ (+ 2.0 (* F F)) (* x 2.0)) -0.5)) (/ x B))
(/ (- 1.0 t_0) (sin B))))))))
double code(double F, double B, double x) {
double t_0 = x * cos(B);
double t_1 = F / sin(B);
double tmp;
if (F <= -2.8e-50) {
tmp = (-1.0 / sin(B)) - (x / tan(B));
} else if (F <= -1.16e-228) {
tmp = (t_1 * sqrt((1.0 / (2.0 + (x * 2.0))))) - (x / B);
} else if (F <= 3.05e-80) {
tmp = t_0 / -sin(B);
} else if (F <= 94000.0) {
tmp = (t_1 * pow(((2.0 + (F * F)) + (x * 2.0)), -0.5)) - (x / B);
} else {
tmp = (1.0 - t_0) / sin(B);
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = x * cos(b)
t_1 = f / sin(b)
if (f <= (-2.8d-50)) then
tmp = ((-1.0d0) / sin(b)) - (x / tan(b))
else if (f <= (-1.16d-228)) then
tmp = (t_1 * sqrt((1.0d0 / (2.0d0 + (x * 2.0d0))))) - (x / b)
else if (f <= 3.05d-80) then
tmp = t_0 / -sin(b)
else if (f <= 94000.0d0) then
tmp = (t_1 * (((2.0d0 + (f * f)) + (x * 2.0d0)) ** (-0.5d0))) - (x / b)
else
tmp = (1.0d0 - t_0) / sin(b)
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = x * Math.cos(B);
double t_1 = F / Math.sin(B);
double tmp;
if (F <= -2.8e-50) {
tmp = (-1.0 / Math.sin(B)) - (x / Math.tan(B));
} else if (F <= -1.16e-228) {
tmp = (t_1 * Math.sqrt((1.0 / (2.0 + (x * 2.0))))) - (x / B);
} else if (F <= 3.05e-80) {
tmp = t_0 / -Math.sin(B);
} else if (F <= 94000.0) {
tmp = (t_1 * Math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5)) - (x / B);
} else {
tmp = (1.0 - t_0) / Math.sin(B);
}
return tmp;
}
def code(F, B, x): t_0 = x * math.cos(B) t_1 = F / math.sin(B) tmp = 0 if F <= -2.8e-50: tmp = (-1.0 / math.sin(B)) - (x / math.tan(B)) elif F <= -1.16e-228: tmp = (t_1 * math.sqrt((1.0 / (2.0 + (x * 2.0))))) - (x / B) elif F <= 3.05e-80: tmp = t_0 / -math.sin(B) elif F <= 94000.0: tmp = (t_1 * math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5)) - (x / B) else: tmp = (1.0 - t_0) / math.sin(B) return tmp
function code(F, B, x) t_0 = Float64(x * cos(B)) t_1 = Float64(F / sin(B)) tmp = 0.0 if (F <= -2.8e-50) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / tan(B))); elseif (F <= -1.16e-228) tmp = Float64(Float64(t_1 * sqrt(Float64(1.0 / Float64(2.0 + Float64(x * 2.0))))) - Float64(x / B)); elseif (F <= 3.05e-80) tmp = Float64(t_0 / Float64(-sin(B))); elseif (F <= 94000.0) tmp = Float64(Float64(t_1 * (Float64(Float64(2.0 + Float64(F * F)) + Float64(x * 2.0)) ^ -0.5)) - Float64(x / B)); else tmp = Float64(Float64(1.0 - t_0) / sin(B)); end return tmp end
function tmp_2 = code(F, B, x) t_0 = x * cos(B); t_1 = F / sin(B); tmp = 0.0; if (F <= -2.8e-50) tmp = (-1.0 / sin(B)) - (x / tan(B)); elseif (F <= -1.16e-228) tmp = (t_1 * sqrt((1.0 / (2.0 + (x * 2.0))))) - (x / B); elseif (F <= 3.05e-80) tmp = t_0 / -sin(B); elseif (F <= 94000.0) tmp = (t_1 * (((2.0 + (F * F)) + (x * 2.0)) ^ -0.5)) - (x / B); else tmp = (1.0 - t_0) / sin(B); end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(x * N[Cos[B], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -2.8e-50], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -1.16e-228], N[(N[(t$95$1 * N[Sqrt[N[(1.0 / N[(2.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 3.05e-80], N[(t$95$0 / (-N[Sin[B], $MachinePrecision])), $MachinePrecision], If[LessEqual[F, 94000.0], N[(N[(t$95$1 * 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], N[(N[(1.0 - t$95$0), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x \cdot \cos B\\
t_1 := \frac{F}{\sin B}\\
\mathbf{if}\;F \leq -2.8 \cdot 10^{-50}:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\
\mathbf{elif}\;F \leq -1.16 \cdot 10^{-228}:\\
\;\;\;\;t\_1 \cdot \sqrt{\frac{1}{2 + x \cdot 2}} - \frac{x}{B}\\
\mathbf{elif}\;F \leq 3.05 \cdot 10^{-80}:\\
\;\;\;\;\frac{t\_0}{-\sin B}\\
\mathbf{elif}\;F \leq 94000:\\
\;\;\;\;t\_1 \cdot {\left(\left(2 + F \cdot F\right) + x \cdot 2\right)}^{-0.5} - \frac{x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - t\_0}{\sin B}\\
\end{array}
\end{array}
if F < -2.7999999999999998e-50Initial program 64.3%
Simplified78.3%
Taylor expanded in F around -inf 94.6%
if -2.7999999999999998e-50 < F < -1.16e-228Initial program 99.5%
Taylor expanded in B around 0 90.4%
associate-*r/90.4%
neg-mul-190.4%
Simplified90.4%
Taylor expanded in F around 0 90.4%
neg-mul-190.4%
distribute-frac-neg90.4%
+-commutative90.4%
distribute-frac-neg90.4%
unsub-neg90.4%
*-commutative90.4%
Simplified90.4%
if -1.16e-228 < F < 3.0500000000000001e-80Initial program 99.4%
Simplified99.7%
fma-define99.7%
fma-undefine99.7%
*-commutative99.7%
+-commutative99.7%
add-sqr-sqrt99.6%
metadata-eval99.6%
metadata-eval99.6%
unpow-prod-down99.6%
+-commutative99.6%
fma-define99.6%
fma-define99.6%
metadata-eval99.6%
metadata-eval99.6%
+-commutative99.6%
fma-define99.6%
fma-define99.6%
metadata-eval99.6%
Applied egg-rr99.6%
pow-sqr99.6%
metadata-eval99.6%
unpow-199.6%
fma-undefine99.6%
*-commutative99.6%
fma-undefine99.6%
unpow299.6%
+-commutative99.6%
fma-define99.6%
+-commutative99.6%
unpow299.6%
fma-undefine99.6%
Simplified99.6%
Taylor expanded in F around 0 79.8%
associate-*r/79.8%
neg-mul-179.8%
distribute-rgt-neg-in79.8%
Simplified79.8%
if 3.0500000000000001e-80 < F < 94000Initial program 98.9%
Taylor expanded in B around 0 89.3%
associate-*r/89.3%
neg-mul-189.3%
Simplified89.3%
metadata-eval98.9%
metadata-eval98.9%
Applied egg-rr89.3%
if 94000 < F Initial program 56.2%
Simplified69.8%
fma-define69.8%
fma-undefine69.8%
*-commutative69.8%
+-commutative69.8%
add-sqr-sqrt69.8%
metadata-eval69.8%
metadata-eval69.8%
unpow-prod-down69.6%
+-commutative69.6%
fma-define69.6%
fma-define69.6%
metadata-eval69.6%
metadata-eval69.6%
+-commutative69.6%
fma-define69.6%
fma-define69.6%
metadata-eval69.6%
Applied egg-rr69.6%
pow-sqr69.8%
metadata-eval69.8%
unpow-169.8%
fma-undefine69.8%
*-commutative69.8%
fma-undefine69.8%
unpow269.8%
+-commutative69.8%
fma-define69.8%
+-commutative69.8%
unpow269.8%
fma-undefine69.8%
Simplified69.8%
Taylor expanded in F around inf 99.8%
div-sub99.8%
Simplified99.8%
Final simplification92.1%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (* x (cos B)))
(t_1 (- (* (/ F (sin B)) (sqrt (/ 1.0 (+ 2.0 (* x 2.0))))) (/ x B))))
(if (<= F -2.8e-50)
(- (/ -1.0 (sin B)) (/ x (tan B)))
(if (<= F -3.4e-229)
t_1
(if (<= F 3.05e-80)
(/ t_0 (- (sin B)))
(if (<= F 0.5) t_1 (/ (- 1.0 t_0) (sin B))))))))
double code(double F, double B, double x) {
double t_0 = x * cos(B);
double t_1 = ((F / sin(B)) * sqrt((1.0 / (2.0 + (x * 2.0))))) - (x / B);
double tmp;
if (F <= -2.8e-50) {
tmp = (-1.0 / sin(B)) - (x / tan(B));
} else if (F <= -3.4e-229) {
tmp = t_1;
} else if (F <= 3.05e-80) {
tmp = t_0 / -sin(B);
} else if (F <= 0.5) {
tmp = t_1;
} else {
tmp = (1.0 - t_0) / sin(B);
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = x * cos(b)
t_1 = ((f / sin(b)) * sqrt((1.0d0 / (2.0d0 + (x * 2.0d0))))) - (x / b)
if (f <= (-2.8d-50)) then
tmp = ((-1.0d0) / sin(b)) - (x / tan(b))
else if (f <= (-3.4d-229)) then
tmp = t_1
else if (f <= 3.05d-80) then
tmp = t_0 / -sin(b)
else if (f <= 0.5d0) then
tmp = t_1
else
tmp = (1.0d0 - t_0) / sin(b)
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = x * Math.cos(B);
double t_1 = ((F / Math.sin(B)) * Math.sqrt((1.0 / (2.0 + (x * 2.0))))) - (x / B);
double tmp;
if (F <= -2.8e-50) {
tmp = (-1.0 / Math.sin(B)) - (x / Math.tan(B));
} else if (F <= -3.4e-229) {
tmp = t_1;
} else if (F <= 3.05e-80) {
tmp = t_0 / -Math.sin(B);
} else if (F <= 0.5) {
tmp = t_1;
} else {
tmp = (1.0 - t_0) / Math.sin(B);
}
return tmp;
}
def code(F, B, x): t_0 = x * math.cos(B) t_1 = ((F / math.sin(B)) * math.sqrt((1.0 / (2.0 + (x * 2.0))))) - (x / B) tmp = 0 if F <= -2.8e-50: tmp = (-1.0 / math.sin(B)) - (x / math.tan(B)) elif F <= -3.4e-229: tmp = t_1 elif F <= 3.05e-80: tmp = t_0 / -math.sin(B) elif F <= 0.5: tmp = t_1 else: tmp = (1.0 - t_0) / math.sin(B) return tmp
function code(F, B, x) t_0 = Float64(x * cos(B)) t_1 = Float64(Float64(Float64(F / sin(B)) * sqrt(Float64(1.0 / Float64(2.0 + Float64(x * 2.0))))) - Float64(x / B)) tmp = 0.0 if (F <= -2.8e-50) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / tan(B))); elseif (F <= -3.4e-229) tmp = t_1; elseif (F <= 3.05e-80) tmp = Float64(t_0 / Float64(-sin(B))); elseif (F <= 0.5) tmp = t_1; else tmp = Float64(Float64(1.0 - t_0) / sin(B)); end return tmp end
function tmp_2 = code(F, B, x) t_0 = x * cos(B); t_1 = ((F / sin(B)) * sqrt((1.0 / (2.0 + (x * 2.0))))) - (x / B); tmp = 0.0; if (F <= -2.8e-50) tmp = (-1.0 / sin(B)) - (x / tan(B)); elseif (F <= -3.4e-229) tmp = t_1; elseif (F <= 3.05e-80) tmp = t_0 / -sin(B); elseif (F <= 0.5) tmp = t_1; else tmp = (1.0 - t_0) / sin(B); end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(x * N[Cos[B], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = 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]}, If[LessEqual[F, -2.8e-50], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -3.4e-229], t$95$1, If[LessEqual[F, 3.05e-80], N[(t$95$0 / (-N[Sin[B], $MachinePrecision])), $MachinePrecision], If[LessEqual[F, 0.5], t$95$1, N[(N[(1.0 - t$95$0), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x \cdot \cos B\\
t_1 := \frac{F}{\sin B} \cdot \sqrt{\frac{1}{2 + x \cdot 2}} - \frac{x}{B}\\
\mathbf{if}\;F \leq -2.8 \cdot 10^{-50}:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\
\mathbf{elif}\;F \leq -3.4 \cdot 10^{-229}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;F \leq 3.05 \cdot 10^{-80}:\\
\;\;\;\;\frac{t\_0}{-\sin B}\\
\mathbf{elif}\;F \leq 0.5:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - t\_0}{\sin B}\\
\end{array}
\end{array}
if F < -2.7999999999999998e-50Initial program 64.3%
Simplified78.3%
Taylor expanded in F around -inf 94.6%
if -2.7999999999999998e-50 < F < -3.3999999999999999e-229 or 3.0500000000000001e-80 < F < 0.5Initial program 99.3%
Taylor expanded in B around 0 89.6%
associate-*r/89.6%
neg-mul-189.6%
Simplified89.6%
Taylor expanded in F around 0 87.9%
neg-mul-187.9%
distribute-frac-neg87.9%
+-commutative87.9%
distribute-frac-neg87.9%
unsub-neg87.9%
*-commutative87.9%
Simplified87.9%
if -3.3999999999999999e-229 < F < 3.0500000000000001e-80Initial program 99.4%
Simplified99.7%
fma-define99.7%
fma-undefine99.7%
*-commutative99.7%
+-commutative99.7%
add-sqr-sqrt99.6%
metadata-eval99.6%
metadata-eval99.6%
unpow-prod-down99.6%
+-commutative99.6%
fma-define99.6%
fma-define99.6%
metadata-eval99.6%
metadata-eval99.6%
+-commutative99.6%
fma-define99.6%
fma-define99.6%
metadata-eval99.6%
Applied egg-rr99.6%
pow-sqr99.6%
metadata-eval99.6%
unpow-199.6%
fma-undefine99.6%
*-commutative99.6%
fma-undefine99.6%
unpow299.6%
+-commutative99.6%
fma-define99.6%
+-commutative99.6%
unpow299.6%
fma-undefine99.6%
Simplified99.6%
Taylor expanded in F around 0 79.8%
associate-*r/79.8%
neg-mul-179.8%
distribute-rgt-neg-in79.8%
Simplified79.8%
if 0.5 < F Initial program 57.2%
Simplified70.5%
fma-define70.5%
fma-undefine70.5%
*-commutative70.5%
+-commutative70.5%
add-sqr-sqrt70.5%
metadata-eval70.5%
metadata-eval70.5%
unpow-prod-down70.3%
+-commutative70.3%
fma-define70.3%
fma-define70.3%
metadata-eval70.3%
metadata-eval70.3%
+-commutative70.3%
fma-define70.3%
fma-define70.3%
metadata-eval70.3%
Applied egg-rr70.3%
pow-sqr70.4%
metadata-eval70.4%
unpow-170.4%
fma-undefine70.4%
*-commutative70.4%
fma-undefine70.4%
unpow270.4%
+-commutative70.4%
fma-define70.4%
+-commutative70.4%
unpow270.4%
fma-undefine70.4%
Simplified70.4%
Taylor expanded in F around inf 98.4%
div-sub98.4%
Simplified98.4%
Final simplification91.3%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (* x (cos B))))
(if (<= F -4.4e-88)
(- (/ -1.0 (sin B)) (/ x (tan B)))
(if (<= F 6.4e-70) (/ t_0 (- (sin B))) (/ (- 1.0 t_0) (sin B))))))
double code(double F, double B, double x) {
double t_0 = x * cos(B);
double tmp;
if (F <= -4.4e-88) {
tmp = (-1.0 / sin(B)) - (x / tan(B));
} else if (F <= 6.4e-70) {
tmp = t_0 / -sin(B);
} else {
tmp = (1.0 - t_0) / sin(B);
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: tmp
t_0 = x * cos(b)
if (f <= (-4.4d-88)) then
tmp = ((-1.0d0) / sin(b)) - (x / tan(b))
else if (f <= 6.4d-70) then
tmp = t_0 / -sin(b)
else
tmp = (1.0d0 - t_0) / sin(b)
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = x * Math.cos(B);
double tmp;
if (F <= -4.4e-88) {
tmp = (-1.0 / Math.sin(B)) - (x / Math.tan(B));
} else if (F <= 6.4e-70) {
tmp = t_0 / -Math.sin(B);
} else {
tmp = (1.0 - t_0) / Math.sin(B);
}
return tmp;
}
def code(F, B, x): t_0 = x * math.cos(B) tmp = 0 if F <= -4.4e-88: tmp = (-1.0 / math.sin(B)) - (x / math.tan(B)) elif F <= 6.4e-70: tmp = t_0 / -math.sin(B) else: tmp = (1.0 - t_0) / math.sin(B) return tmp
function code(F, B, x) t_0 = Float64(x * cos(B)) tmp = 0.0 if (F <= -4.4e-88) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / tan(B))); elseif (F <= 6.4e-70) tmp = Float64(t_0 / Float64(-sin(B))); else tmp = Float64(Float64(1.0 - t_0) / sin(B)); end return tmp end
function tmp_2 = code(F, B, x) t_0 = x * cos(B); tmp = 0.0; if (F <= -4.4e-88) tmp = (-1.0 / sin(B)) - (x / tan(B)); elseif (F <= 6.4e-70) tmp = t_0 / -sin(B); else tmp = (1.0 - t_0) / sin(B); end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(x * N[Cos[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -4.4e-88], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 6.4e-70], N[(t$95$0 / (-N[Sin[B], $MachinePrecision])), $MachinePrecision], N[(N[(1.0 - t$95$0), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x \cdot \cos B\\
\mathbf{if}\;F \leq -4.4 \cdot 10^{-88}:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\
\mathbf{elif}\;F \leq 6.4 \cdot 10^{-70}:\\
\;\;\;\;\frac{t\_0}{-\sin B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - t\_0}{\sin B}\\
\end{array}
\end{array}
if F < -4.4000000000000001e-88Initial program 68.4%
Simplified80.8%
Taylor expanded in F around -inf 87.9%
if -4.4000000000000001e-88 < F < 6.3999999999999995e-70Initial program 99.4%
Simplified99.7%
fma-define99.7%
fma-undefine99.7%
*-commutative99.7%
+-commutative99.7%
add-sqr-sqrt99.6%
metadata-eval99.6%
metadata-eval99.6%
unpow-prod-down99.6%
+-commutative99.6%
fma-define99.6%
fma-define99.6%
metadata-eval99.6%
metadata-eval99.6%
+-commutative99.6%
fma-define99.6%
fma-define99.6%
metadata-eval99.6%
Applied egg-rr99.6%
pow-sqr99.6%
metadata-eval99.6%
unpow-199.6%
fma-undefine99.6%
*-commutative99.6%
fma-undefine99.6%
unpow299.6%
+-commutative99.6%
fma-define99.6%
+-commutative99.6%
unpow299.6%
fma-undefine99.6%
Simplified99.6%
Taylor expanded in F around 0 79.1%
associate-*r/79.1%
neg-mul-179.1%
distribute-rgt-neg-in79.1%
Simplified79.1%
if 6.3999999999999995e-70 < F Initial program 62.7%
Simplified74.3%
fma-define74.3%
fma-undefine74.3%
*-commutative74.3%
+-commutative74.3%
add-sqr-sqrt74.2%
metadata-eval74.2%
metadata-eval74.2%
unpow-prod-down74.1%
+-commutative74.1%
fma-define74.1%
fma-define74.1%
metadata-eval74.1%
metadata-eval74.1%
+-commutative74.1%
fma-define74.1%
fma-define74.1%
metadata-eval74.1%
Applied egg-rr74.1%
pow-sqr74.2%
metadata-eval74.2%
unpow-174.2%
fma-undefine74.2%
*-commutative74.2%
fma-undefine74.2%
unpow274.2%
+-commutative74.2%
fma-define74.2%
+-commutative74.2%
unpow274.2%
fma-undefine74.2%
Simplified74.2%
Taylor expanded in F around inf 90.3%
div-sub90.3%
Simplified90.3%
Final simplification86.1%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -4.4e-88)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 5.4e-70)
(/ (* 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.4e-88) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 5.4e-70) {
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.4d-88)) then
tmp = ((-1.0d0) / sin(b)) - t_0
else if (f <= 5.4d-70) 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.4e-88) {
tmp = (-1.0 / Math.sin(B)) - t_0;
} else if (F <= 5.4e-70) {
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.4e-88: tmp = (-1.0 / math.sin(B)) - t_0 elif F <= 5.4e-70: 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.4e-88) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 5.4e-70) 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.4e-88) tmp = (-1.0 / sin(B)) - t_0; elseif (F <= 5.4e-70) 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.4e-88], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 5.4e-70], 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.4 \cdot 10^{-88}:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq 5.4 \cdot 10^{-70}:\\
\;\;\;\;\frac{x \cdot \cos B}{-\sin B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_0\\
\end{array}
\end{array}
if F < -4.4000000000000001e-88Initial program 68.4%
Simplified80.8%
Taylor expanded in F around -inf 87.9%
if -4.4000000000000001e-88 < F < 5.4000000000000003e-70Initial program 99.4%
Simplified99.7%
fma-define99.7%
fma-undefine99.7%
*-commutative99.7%
+-commutative99.7%
add-sqr-sqrt99.6%
metadata-eval99.6%
metadata-eval99.6%
unpow-prod-down99.6%
+-commutative99.6%
fma-define99.6%
fma-define99.6%
metadata-eval99.6%
metadata-eval99.6%
+-commutative99.6%
fma-define99.6%
fma-define99.6%
metadata-eval99.6%
Applied egg-rr99.6%
pow-sqr99.6%
metadata-eval99.6%
unpow-199.6%
fma-undefine99.6%
*-commutative99.6%
fma-undefine99.6%
unpow299.6%
+-commutative99.6%
fma-define99.6%
+-commutative99.6%
unpow299.6%
fma-undefine99.6%
Simplified99.6%
Taylor expanded in F around 0 79.1%
associate-*r/79.1%
neg-mul-179.1%
distribute-rgt-neg-in79.1%
Simplified79.1%
if 5.4000000000000003e-70 < F Initial program 62.7%
Simplified74.3%
Taylor expanded in F around inf 90.3%
Final simplification86.1%
(FPCore (F B x)
:precision binary64
(if (<= F -4.2e-88)
(- (/ -1.0 (sin B)) (/ x (tan B)))
(if (<= F 2.3e-32)
(/ (* x (cos B)) (- (sin B)))
(- (/ 1.0 (sin B)) (/ x B)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -4.2e-88) {
tmp = (-1.0 / sin(B)) - (x / tan(B));
} else if (F <= 2.3e-32) {
tmp = (x * cos(B)) / -sin(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 <= (-4.2d-88)) then
tmp = ((-1.0d0) / sin(b)) - (x / tan(b))
else if (f <= 2.3d-32) then
tmp = (x * cos(b)) / -sin(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 <= -4.2e-88) {
tmp = (-1.0 / Math.sin(B)) - (x / Math.tan(B));
} else if (F <= 2.3e-32) {
tmp = (x * Math.cos(B)) / -Math.sin(B);
} else {
tmp = (1.0 / Math.sin(B)) - (x / B);
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -4.2e-88: tmp = (-1.0 / math.sin(B)) - (x / math.tan(B)) elif F <= 2.3e-32: tmp = (x * math.cos(B)) / -math.sin(B) else: tmp = (1.0 / math.sin(B)) - (x / B) return tmp
function code(F, B, x) tmp = 0.0 if (F <= -4.2e-88) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / tan(B))); elseif (F <= 2.3e-32) tmp = Float64(Float64(x * cos(B)) / Float64(-sin(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 <= -4.2e-88) tmp = (-1.0 / sin(B)) - (x / tan(B)); elseif (F <= 2.3e-32) tmp = (x * cos(B)) / -sin(B); else tmp = (1.0 / sin(B)) - (x / B); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -4.2e-88], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 2.3e-32], N[(N[(x * N[Cos[B], $MachinePrecision]), $MachinePrecision] / (-N[Sin[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 -4.2 \cdot 10^{-88}:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\
\mathbf{elif}\;F \leq 2.3 \cdot 10^{-32}:\\
\;\;\;\;\frac{x \cdot \cos B}{-\sin B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - \frac{x}{B}\\
\end{array}
\end{array}
if F < -4.1999999999999999e-88Initial program 68.4%
Simplified80.8%
Taylor expanded in F around -inf 87.9%
if -4.1999999999999999e-88 < F < 2.3000000000000001e-32Initial program 99.4%
Simplified99.7%
fma-define99.7%
fma-undefine99.7%
*-commutative99.7%
+-commutative99.7%
add-sqr-sqrt99.6%
metadata-eval99.6%
metadata-eval99.6%
unpow-prod-down99.6%
+-commutative99.6%
fma-define99.6%
fma-define99.6%
metadata-eval99.6%
metadata-eval99.6%
+-commutative99.6%
fma-define99.6%
fma-define99.6%
metadata-eval99.6%
Applied egg-rr99.6%
pow-sqr99.6%
metadata-eval99.6%
unpow-199.6%
fma-undefine99.6%
*-commutative99.6%
fma-undefine99.6%
unpow299.6%
+-commutative99.6%
fma-define99.6%
+-commutative99.6%
unpow299.6%
fma-undefine99.6%
Simplified99.6%
Taylor expanded in F around 0 75.2%
associate-*r/75.2%
neg-mul-175.2%
distribute-rgt-neg-in75.2%
Simplified75.2%
if 2.3000000000000001e-32 < F Initial program 59.9%
Simplified72.3%
Taylor expanded in F around inf 94.5%
Taylor expanded in B around 0 76.8%
Taylor expanded in F around 0 76.9%
Final simplification79.7%
(FPCore (F B x)
:precision binary64
(if (<= F -1.45)
(- (/ -1.0 (sin B)) (/ x B))
(if (<= F 2.3e-32)
(/ (* x (cos B)) (- (sin B)))
(- (/ 1.0 (sin B)) (/ x B)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -1.45) {
tmp = (-1.0 / sin(B)) - (x / B);
} else if (F <= 2.3e-32) {
tmp = (x * cos(B)) / -sin(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.45d0)) then
tmp = ((-1.0d0) / sin(b)) - (x / b)
else if (f <= 2.3d-32) then
tmp = (x * cos(b)) / -sin(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.45) {
tmp = (-1.0 / Math.sin(B)) - (x / B);
} else if (F <= 2.3e-32) {
tmp = (x * Math.cos(B)) / -Math.sin(B);
} else {
tmp = (1.0 / Math.sin(B)) - (x / B);
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -1.45: tmp = (-1.0 / math.sin(B)) - (x / B) elif F <= 2.3e-32: tmp = (x * math.cos(B)) / -math.sin(B) else: tmp = (1.0 / math.sin(B)) - (x / B) return tmp
function code(F, B, x) tmp = 0.0 if (F <= -1.45) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B)); elseif (F <= 2.3e-32) tmp = Float64(Float64(x * cos(B)) / Float64(-sin(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.45) tmp = (-1.0 / sin(B)) - (x / B); elseif (F <= 2.3e-32) tmp = (x * cos(B)) / -sin(B); else tmp = (1.0 / sin(B)) - (x / B); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -1.45], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 2.3e-32], N[(N[(x * N[Cos[B], $MachinePrecision]), $MachinePrecision] / (-N[Sin[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 -1.45:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\
\mathbf{elif}\;F \leq 2.3 \cdot 10^{-32}:\\
\;\;\;\;\frac{x \cdot \cos B}{-\sin B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - \frac{x}{B}\\
\end{array}
\end{array}
if F < -1.44999999999999996Initial program 58.9%
Simplified75.1%
Taylor expanded in F around -inf 98.5%
Taylor expanded in B around 0 79.0%
if -1.44999999999999996 < F < 2.3000000000000001e-32Initial program 99.4%
Simplified99.7%
fma-define99.7%
fma-undefine99.7%
*-commutative99.7%
+-commutative99.7%
add-sqr-sqrt99.5%
metadata-eval99.5%
metadata-eval99.5%
unpow-prod-down99.5%
+-commutative99.5%
fma-define99.5%
fma-define99.5%
metadata-eval99.5%
metadata-eval99.5%
+-commutative99.5%
fma-define99.5%
fma-define99.5%
metadata-eval99.5%
Applied egg-rr99.5%
pow-sqr99.5%
metadata-eval99.5%
unpow-199.5%
fma-undefine99.5%
*-commutative99.5%
fma-undefine99.5%
unpow299.5%
+-commutative99.5%
fma-define99.5%
+-commutative99.5%
unpow299.5%
fma-undefine99.5%
Simplified99.5%
Taylor expanded in F around 0 71.2%
associate-*r/71.2%
neg-mul-171.2%
distribute-rgt-neg-in71.2%
Simplified71.2%
if 2.3000000000000001e-32 < F Initial program 59.9%
Simplified72.3%
Taylor expanded in F around inf 94.5%
Taylor expanded in B around 0 76.8%
Taylor expanded in F around 0 76.9%
Final simplification75.1%
(FPCore (F B x)
:precision binary64
(if (<= F -1.25e-9)
(- (/ -1.0 (sin B)) (/ x B))
(if (<= F 9.2e-34)
(* x (/ (cos B) (- (sin B))))
(- (/ 1.0 (sin B)) (/ x B)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -1.25e-9) {
tmp = (-1.0 / sin(B)) - (x / B);
} else if (F <= 9.2e-34) {
tmp = x * (cos(B) / -sin(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.25d-9)) then
tmp = ((-1.0d0) / sin(b)) - (x / b)
else if (f <= 9.2d-34) then
tmp = x * (cos(b) / -sin(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.25e-9) {
tmp = (-1.0 / Math.sin(B)) - (x / B);
} else if (F <= 9.2e-34) {
tmp = x * (Math.cos(B) / -Math.sin(B));
} else {
tmp = (1.0 / Math.sin(B)) - (x / B);
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -1.25e-9: tmp = (-1.0 / math.sin(B)) - (x / B) elif F <= 9.2e-34: tmp = x * (math.cos(B) / -math.sin(B)) else: tmp = (1.0 / math.sin(B)) - (x / B) return tmp
function code(F, B, x) tmp = 0.0 if (F <= -1.25e-9) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B)); elseif (F <= 9.2e-34) tmp = Float64(x * Float64(cos(B) / Float64(-sin(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.25e-9) tmp = (-1.0 / sin(B)) - (x / B); elseif (F <= 9.2e-34) tmp = x * (cos(B) / -sin(B)); else tmp = (1.0 / sin(B)) - (x / B); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -1.25e-9], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 9.2e-34], N[(x * N[(N[Cos[B], $MachinePrecision] / (-N[Sin[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.25 \cdot 10^{-9}:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\
\mathbf{elif}\;F \leq 9.2 \cdot 10^{-34}:\\
\;\;\;\;x \cdot \frac{\cos B}{-\sin B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - \frac{x}{B}\\
\end{array}
\end{array}
if F < -1.25e-9Initial program 59.6%
Simplified75.5%
Taylor expanded in F around -inf 98.5%
Taylor expanded in B around 0 79.4%
if -1.25e-9 < F < 9.20000000000000045e-34Initial program 99.4%
Simplified99.7%
fma-define99.7%
fma-undefine99.7%
*-commutative99.7%
+-commutative99.7%
add-sqr-sqrt99.5%
metadata-eval99.5%
metadata-eval99.5%
unpow-prod-down99.5%
+-commutative99.5%
fma-define99.5%
fma-define99.5%
metadata-eval99.5%
metadata-eval99.5%
+-commutative99.5%
fma-define99.5%
fma-define99.5%
metadata-eval99.5%
Applied egg-rr99.5%
pow-sqr99.5%
metadata-eval99.5%
unpow-199.5%
fma-undefine99.5%
*-commutative99.5%
fma-undefine99.5%
unpow299.5%
+-commutative99.5%
fma-define99.5%
+-commutative99.5%
unpow299.5%
fma-undefine99.5%
Simplified99.5%
Taylor expanded in F around 0 71.0%
mul-1-neg71.0%
associate-/l*70.9%
distribute-rgt-neg-in70.9%
Simplified70.9%
if 9.20000000000000045e-34 < F Initial program 59.9%
Simplified72.3%
Taylor expanded in F around inf 94.5%
Taylor expanded in B around 0 76.8%
Taylor expanded in F around 0 76.9%
Final simplification75.0%
(FPCore (F B x)
:precision binary64
(if (<= F -90000000.0)
(- (/ -1.0 (sin B)) (/ x B))
(if (<= F -7e-230)
(- (* (pow (+ (+ 2.0 (* F F)) (* x 2.0)) -0.5) (/ F B)) (/ x B))
(if (<= F 1.35e+74)
(- (/ 1.0 B) (/ x (tan B)))
(- (/ 1.0 (sin B)) (/ x B))))))
double code(double F, double B, double x) {
double tmp;
if (F <= -90000000.0) {
tmp = (-1.0 / sin(B)) - (x / B);
} else if (F <= -7e-230) {
tmp = (pow(((2.0 + (F * F)) + (x * 2.0)), -0.5) * (F / B)) - (x / B);
} else if (F <= 1.35e+74) {
tmp = (1.0 / B) - (x / tan(B));
} else {
tmp = (1.0 / sin(B)) - (x / B);
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if (f <= (-90000000.0d0)) then
tmp = ((-1.0d0) / sin(b)) - (x / b)
else if (f <= (-7d-230)) then
tmp = ((((2.0d0 + (f * f)) + (x * 2.0d0)) ** (-0.5d0)) * (f / b)) - (x / b)
else if (f <= 1.35d+74) then
tmp = (1.0d0 / b) - (x / tan(b))
else
tmp = (1.0d0 / sin(b)) - (x / b)
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -90000000.0) {
tmp = (-1.0 / Math.sin(B)) - (x / B);
} else if (F <= -7e-230) {
tmp = (Math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5) * (F / B)) - (x / B);
} else if (F <= 1.35e+74) {
tmp = (1.0 / B) - (x / Math.tan(B));
} else {
tmp = (1.0 / Math.sin(B)) - (x / B);
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -90000000.0: tmp = (-1.0 / math.sin(B)) - (x / B) elif F <= -7e-230: tmp = (math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5) * (F / B)) - (x / B) elif F <= 1.35e+74: tmp = (1.0 / B) - (x / math.tan(B)) else: tmp = (1.0 / math.sin(B)) - (x / B) return tmp
function code(F, B, x) tmp = 0.0 if (F <= -90000000.0) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B)); elseif (F <= -7e-230) tmp = Float64(Float64((Float64(Float64(2.0 + Float64(F * F)) + Float64(x * 2.0)) ^ -0.5) * Float64(F / B)) - Float64(x / B)); elseif (F <= 1.35e+74) tmp = Float64(Float64(1.0 / B) - Float64(x / tan(B))); else tmp = Float64(Float64(1.0 / sin(B)) - Float64(x / B)); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -90000000.0) tmp = (-1.0 / sin(B)) - (x / B); elseif (F <= -7e-230) tmp = ((((2.0 + (F * F)) + (x * 2.0)) ^ -0.5) * (F / B)) - (x / B); elseif (F <= 1.35e+74) tmp = (1.0 / B) - (x / tan(B)); else tmp = (1.0 / sin(B)) - (x / B); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -90000000.0], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -7e-230], 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[LessEqual[F, 1.35e+74], N[(N[(1.0 / B), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -90000000:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\
\mathbf{elif}\;F \leq -7 \cdot 10^{-230}:\\
\;\;\;\;{\left(\left(2 + F \cdot F\right) + x \cdot 2\right)}^{-0.5} \cdot \frac{F}{B} - \frac{x}{B}\\
\mathbf{elif}\;F \leq 1.35 \cdot 10^{+74}:\\
\;\;\;\;\frac{1}{B} - \frac{x}{\tan B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - \frac{x}{B}\\
\end{array}
\end{array}
if F < -9e7Initial program 57.5%
Simplified74.2%
Taylor expanded in F around -inf 99.8%
Taylor expanded in B around 0 79.7%
if -9e7 < F < -6.99999999999999975e-230Initial program 99.5%
Taylor expanded in B around 0 83.9%
associate-*r/83.9%
neg-mul-183.9%
Simplified83.9%
Taylor expanded in B around 0 70.3%
if -6.99999999999999975e-230 < F < 1.3499999999999999e74Initial program 99.3%
Simplified99.6%
Taylor expanded in F around inf 37.6%
Taylor expanded in B around 0 56.1%
if 1.3499999999999999e74 < F Initial program 47.5%
Simplified63.9%
Taylor expanded in F around inf 99.7%
Taylor expanded in B around 0 81.8%
Taylor expanded in F around 0 81.9%
Final simplification70.8%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -5.2e-150)
(- (/ -1.0 B) t_0)
(if (<= F -3.8e-230)
(/ x (- B))
(if (<= F 3e+74) (- (/ 1.0 B) t_0) (- (/ 1.0 (sin B)) (/ x B)))))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -5.2e-150) {
tmp = (-1.0 / B) - t_0;
} else if (F <= -3.8e-230) {
tmp = x / -B;
} else if (F <= 3e+74) {
tmp = (1.0 / B) - t_0;
} else {
tmp = (1.0 / sin(B)) - (x / B);
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: tmp
t_0 = x / tan(b)
if (f <= (-5.2d-150)) then
tmp = ((-1.0d0) / b) - t_0
else if (f <= (-3.8d-230)) then
tmp = x / -b
else if (f <= 3d+74) then
tmp = (1.0d0 / b) - t_0
else
tmp = (1.0d0 / sin(b)) - (x / b)
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = x / Math.tan(B);
double tmp;
if (F <= -5.2e-150) {
tmp = (-1.0 / B) - t_0;
} else if (F <= -3.8e-230) {
tmp = x / -B;
} else if (F <= 3e+74) {
tmp = (1.0 / B) - t_0;
} else {
tmp = (1.0 / Math.sin(B)) - (x / B);
}
return tmp;
}
def code(F, B, x): t_0 = x / math.tan(B) tmp = 0 if F <= -5.2e-150: tmp = (-1.0 / B) - t_0 elif F <= -3.8e-230: tmp = x / -B elif F <= 3e+74: tmp = (1.0 / B) - t_0 else: tmp = (1.0 / math.sin(B)) - (x / B) return tmp
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -5.2e-150) tmp = Float64(Float64(-1.0 / B) - t_0); elseif (F <= -3.8e-230) tmp = Float64(x / Float64(-B)); elseif (F <= 3e+74) tmp = Float64(Float64(1.0 / B) - t_0); else tmp = Float64(Float64(1.0 / sin(B)) - Float64(x / B)); end return tmp end
function tmp_2 = code(F, B, x) t_0 = x / tan(B); tmp = 0.0; if (F <= -5.2e-150) tmp = (-1.0 / B) - t_0; elseif (F <= -3.8e-230) tmp = x / -B; elseif (F <= 3e+74) tmp = (1.0 / B) - t_0; else tmp = (1.0 / sin(B)) - (x / B); end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -5.2e-150], N[(N[(-1.0 / B), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, -3.8e-230], N[(x / (-B)), $MachinePrecision], If[LessEqual[F, 3e+74], N[(N[(1.0 / B), $MachinePrecision] - t$95$0), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -5.2 \cdot 10^{-150}:\\
\;\;\;\;\frac{-1}{B} - t\_0\\
\mathbf{elif}\;F \leq -3.8 \cdot 10^{-230}:\\
\;\;\;\;\frac{x}{-B}\\
\mathbf{elif}\;F \leq 3 \cdot 10^{+74}:\\
\;\;\;\;\frac{1}{B} - t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - \frac{x}{B}\\
\end{array}
\end{array}
if F < -5.1999999999999995e-150Initial program 71.7%
Simplified82.7%
Taylor expanded in F around -inf 83.6%
Taylor expanded in B around 0 68.6%
if -5.1999999999999995e-150 < F < -3.7999999999999998e-230Initial program 99.3%
Simplified100.0%
Taylor expanded in F around inf 2.4%
Taylor expanded in B around 0 26.8%
Taylor expanded in x around inf 85.3%
neg-mul-185.3%
Simplified85.3%
if -3.7999999999999998e-230 < F < 3e74Initial program 99.3%
Simplified99.6%
Taylor expanded in F around inf 37.6%
Taylor expanded in B around 0 56.1%
if 3e74 < F Initial program 47.5%
Simplified63.9%
Taylor expanded in F around inf 99.7%
Taylor expanded in B around 0 81.8%
Taylor expanded in F around 0 81.9%
Final simplification68.9%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (- (/ -1.0 B) (/ x (tan B)))))
(if (<= F 2.1e-32)
t_0
(if (<= F 2.5e+182)
(/ (- 1.0 x) B)
(if (<= F 4.2e+259) (* x (/ (/ 1.0 x) (sin B))) t_0)))))
double code(double F, double B, double x) {
double t_0 = (-1.0 / B) - (x / tan(B));
double tmp;
if (F <= 2.1e-32) {
tmp = t_0;
} else if (F <= 2.5e+182) {
tmp = (1.0 - x) / B;
} else if (F <= 4.2e+259) {
tmp = x * ((1.0 / x) / sin(B));
} else {
tmp = 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 = ((-1.0d0) / b) - (x / tan(b))
if (f <= 2.1d-32) then
tmp = t_0
else if (f <= 2.5d+182) then
tmp = (1.0d0 - x) / b
else if (f <= 4.2d+259) then
tmp = x * ((1.0d0 / x) / sin(b))
else
tmp = t_0
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = (-1.0 / B) - (x / Math.tan(B));
double tmp;
if (F <= 2.1e-32) {
tmp = t_0;
} else if (F <= 2.5e+182) {
tmp = (1.0 - x) / B;
} else if (F <= 4.2e+259) {
tmp = x * ((1.0 / x) / Math.sin(B));
} else {
tmp = t_0;
}
return tmp;
}
def code(F, B, x): t_0 = (-1.0 / B) - (x / math.tan(B)) tmp = 0 if F <= 2.1e-32: tmp = t_0 elif F <= 2.5e+182: tmp = (1.0 - x) / B elif F <= 4.2e+259: tmp = x * ((1.0 / x) / math.sin(B)) else: tmp = t_0 return tmp
function code(F, B, x) t_0 = Float64(Float64(-1.0 / B) - Float64(x / tan(B))) tmp = 0.0 if (F <= 2.1e-32) tmp = t_0; elseif (F <= 2.5e+182) tmp = Float64(Float64(1.0 - x) / B); elseif (F <= 4.2e+259) tmp = Float64(x * Float64(Float64(1.0 / x) / sin(B))); else tmp = t_0; end return tmp end
function tmp_2 = code(F, B, x) t_0 = (-1.0 / B) - (x / tan(B)); tmp = 0.0; if (F <= 2.1e-32) tmp = t_0; elseif (F <= 2.5e+182) tmp = (1.0 - x) / B; elseif (F <= 4.2e+259) tmp = x * ((1.0 / x) / sin(B)); else tmp = t_0; end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(N[(-1.0 / B), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, 2.1e-32], t$95$0, If[LessEqual[F, 2.5e+182], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 4.2e+259], N[(x * N[(N[(1.0 / x), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{-1}{B} - \frac{x}{\tan B}\\
\mathbf{if}\;F \leq 2.1 \cdot 10^{-32}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;F \leq 2.5 \cdot 10^{+182}:\\
\;\;\;\;\frac{1 - x}{B}\\
\mathbf{elif}\;F \leq 4.2 \cdot 10^{+259}:\\
\;\;\;\;x \cdot \frac{\frac{1}{x}}{\sin B}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if F < 2.0999999999999999e-32 or 4.20000000000000011e259 < F Initial program 80.7%
Simplified90.2%
Taylor expanded in F around -inf 61.6%
Taylor expanded in B around 0 60.8%
if 2.0999999999999999e-32 < F < 2.49999999999999987e182Initial program 83.3%
Simplified88.7%
Taylor expanded in F around inf 91.1%
Taylor expanded in B around 0 56.0%
if 2.49999999999999987e182 < F < 4.20000000000000011e259Initial program 12.1%
Simplified17.1%
Taylor expanded in F around inf 99.5%
Taylor expanded in B around 0 90.2%
Taylor expanded in x around inf 76.1%
Taylor expanded in x around 0 67.5%
associate-/r*67.3%
Simplified67.3%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -2e-150)
(- (/ -1.0 B) t_0)
(if (<= F -5.4e-230) (/ x (- B)) (- (/ 1.0 B) t_0)))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -2e-150) {
tmp = (-1.0 / B) - t_0;
} else if (F <= -5.4e-230) {
tmp = x / -B;
} else {
tmp = (1.0 / B) - t_0;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: tmp
t_0 = x / tan(b)
if (f <= (-2d-150)) then
tmp = ((-1.0d0) / b) - t_0
else if (f <= (-5.4d-230)) then
tmp = x / -b
else
tmp = (1.0d0 / b) - t_0
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = x / Math.tan(B);
double tmp;
if (F <= -2e-150) {
tmp = (-1.0 / B) - t_0;
} else if (F <= -5.4e-230) {
tmp = x / -B;
} else {
tmp = (1.0 / B) - t_0;
}
return tmp;
}
def code(F, B, x): t_0 = x / math.tan(B) tmp = 0 if F <= -2e-150: tmp = (-1.0 / B) - t_0 elif F <= -5.4e-230: tmp = x / -B else: tmp = (1.0 / B) - t_0 return tmp
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -2e-150) tmp = Float64(Float64(-1.0 / B) - t_0); elseif (F <= -5.4e-230) tmp = Float64(x / Float64(-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 <= -2e-150) tmp = (-1.0 / B) - t_0; elseif (F <= -5.4e-230) tmp = x / -B; else tmp = (1.0 / B) - t_0; end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -2e-150], N[(N[(-1.0 / B), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, -5.4e-230], N[(x / (-B)), $MachinePrecision], N[(N[(1.0 / B), $MachinePrecision] - t$95$0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -2 \cdot 10^{-150}:\\
\;\;\;\;\frac{-1}{B} - t\_0\\
\mathbf{elif}\;F \leq -5.4 \cdot 10^{-230}:\\
\;\;\;\;\frac{x}{-B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{B} - t\_0\\
\end{array}
\end{array}
if F < -2.00000000000000001e-150Initial program 71.7%
Simplified82.7%
Taylor expanded in F around -inf 83.6%
Taylor expanded in B around 0 68.6%
if -2.00000000000000001e-150 < F < -5.40000000000000023e-230Initial program 99.3%
Simplified100.0%
Taylor expanded in F around inf 2.4%
Taylor expanded in B around 0 26.8%
Taylor expanded in x around inf 85.3%
neg-mul-185.3%
Simplified85.3%
if -5.40000000000000023e-230 < F Initial program 76.2%
Simplified83.7%
Taylor expanded in F around inf 65.3%
Taylor expanded in B around 0 61.8%
Final simplification65.3%
(FPCore (F B x) :precision binary64 (if (<= F -8.5e-89) (/ (- -1.0 x) B) (if (<= F 1e-95) (/ x (- B)) (/ (- 1.0 x) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -8.5e-89) {
tmp = (-1.0 - x) / B;
} else if (F <= 1e-95) {
tmp = x / -B;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if (f <= (-8.5d-89)) then
tmp = ((-1.0d0) - x) / b
else if (f <= 1d-95) then
tmp = x / -b
else
tmp = (1.0d0 - x) / b
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -8.5e-89) {
tmp = (-1.0 - x) / B;
} else if (F <= 1e-95) {
tmp = x / -B;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -8.5e-89: tmp = (-1.0 - x) / B elif F <= 1e-95: tmp = x / -B else: tmp = (1.0 - x) / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= -8.5e-89) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= 1e-95) tmp = Float64(x / Float64(-B)); else tmp = Float64(Float64(1.0 - x) / B); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -8.5e-89) tmp = (-1.0 - x) / B; elseif (F <= 1e-95) tmp = x / -B; else tmp = (1.0 - x) / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -8.5e-89], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 1e-95], N[(x / (-B)), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -8.5 \cdot 10^{-89}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq 10^{-95}:\\
\;\;\;\;\frac{x}{-B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -8.49999999999999937e-89Initial program 68.4%
Simplified80.8%
Taylor expanded in F around -inf 87.9%
Taylor expanded in B around 0 52.3%
mul-1-neg52.3%
distribute-neg-frac252.3%
+-commutative52.3%
Simplified52.3%
if -8.49999999999999937e-89 < F < 9.99999999999999989e-96Initial program 99.4%
Simplified99.7%
Taylor expanded in F around inf 21.0%
Taylor expanded in B around 0 24.6%
Taylor expanded in x around inf 46.7%
neg-mul-146.7%
Simplified46.7%
if 9.99999999999999989e-96 < F Initial program 64.8%
Simplified75.7%
Taylor expanded in F around inf 86.1%
Taylor expanded in B around 0 47.2%
Final simplification48.6%
(FPCore (F B x) :precision binary64 (if (or (<= F 500.0) (not (<= F 1.2e+256))) (/ x (- B)) (/ 1.0 B)))
double code(double F, double B, double x) {
double tmp;
if ((F <= 500.0) || !(F <= 1.2e+256)) {
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 ((f <= 500.0d0) .or. (.not. (f <= 1.2d+256))) 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 ((F <= 500.0) || !(F <= 1.2e+256)) {
tmp = x / -B;
} else {
tmp = 1.0 / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if (F <= 500.0) or not (F <= 1.2e+256): tmp = x / -B else: tmp = 1.0 / B return tmp
function code(F, B, x) tmp = 0.0 if ((F <= 500.0) || !(F <= 1.2e+256)) tmp = Float64(x / Float64(-B)); else tmp = Float64(1.0 / B); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if ((F <= 500.0) || ~((F <= 1.2e+256))) tmp = x / -B; else tmp = 1.0 / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[Or[LessEqual[F, 500.0], N[Not[LessEqual[F, 1.2e+256]], $MachinePrecision]], N[(x / (-B)), $MachinePrecision], N[(1.0 / B), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq 500 \lor \neg \left(F \leq 1.2 \cdot 10^{+256}\right):\\
\;\;\;\;\frac{x}{-B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{B}\\
\end{array}
\end{array}
if F < 500 or 1.20000000000000007e256 < F Initial program 80.9%
Simplified90.1%
Taylor expanded in F around inf 37.8%
Taylor expanded in B around 0 27.4%
Taylor expanded in x around inf 35.9%
neg-mul-135.9%
Simplified35.9%
if 500 < F < 1.20000000000000007e256Initial program 61.9%
Simplified67.8%
Taylor expanded in F around inf 98.8%
Taylor expanded in B around 0 53.6%
Taylor expanded in x around 0 38.7%
Final simplification36.7%
(FPCore (F B x) :precision binary64 (if (<= F 9.6e-96) (/ x (- B)) (/ (- 1.0 x) B)))
double code(double F, double B, double x) {
double tmp;
if (F <= 9.6e-96) {
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 <= 9.6d-96) 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 <= 9.6e-96) {
tmp = x / -B;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= 9.6e-96: tmp = x / -B else: tmp = (1.0 - x) / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= 9.6e-96) 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 <= 9.6e-96) tmp = x / -B; else tmp = (1.0 - x) / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, 9.6e-96], N[(x / (-B)), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq 9.6 \cdot 10^{-96}:\\
\;\;\;\;\frac{x}{-B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < 9.60000000000000076e-96Initial program 83.6%
Simplified90.0%
Taylor expanded in F around inf 31.7%
Taylor expanded in B around 0 25.4%
Taylor expanded in x around inf 36.7%
neg-mul-136.7%
Simplified36.7%
if 9.60000000000000076e-96 < F Initial program 64.8%
Simplified75.7%
Taylor expanded in F around inf 86.1%
Taylor expanded in B around 0 47.2%
Final simplification41.0%
(FPCore (F B x) :precision binary64 (/ 1.0 B))
double code(double F, double B, double x) {
return 1.0 / B;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
code = 1.0d0 / b
end function
public static double code(double F, double B, double x) {
return 1.0 / B;
}
def code(F, B, x): return 1.0 / B
function code(F, B, x) return Float64(1.0 / B) end
function tmp = code(F, B, x) tmp = 1.0 / B; end
code[F_, B_, x_] := N[(1.0 / B), $MachinePrecision]
\begin{array}{l}
\\
\frac{1}{B}
\end{array}
Initial program 75.9%
Simplified84.2%
Taylor expanded in F around inf 54.0%
Taylor expanded in B around 0 34.3%
Taylor expanded in x around 0 12.5%
herbie shell --seed 2024146
(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))))))